Skip to content

Commit

Permalink
Ability to evaluate single, query, or col of script tags. (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
chr15m authored Nov 23, 2024
1 parent 6da99ff commit d23cbc1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/scittle/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,14 @@
(eval-script-tags* (rest script-tags)))
(eval-script-tags* (rest script-tags))))))

(defn ^:export eval-script-tags [& script-tags]
(defn ^:export eval-script-tags [& [script-tags]]
(let [script-tags (or script-tags
(.querySelectorAll
doc "script[type='application/x-scittle']"))]
doc "script[type='application/x-scittle']"))
script-tags (if (or (coll? script-tags)
(aget script-tags "length"))
script-tags
[script-tags])]
(eval-script-tags* script-tags)))

(def auto-load-disabled? (volatile! false))
Expand Down

0 comments on commit d23cbc1

Please sign in to comment.