Skip to content

Commit

Permalink
syncing speaker notes to speaker window after figwheel reload (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliyh authored Feb 8, 2023
1 parent 4abdb60 commit b2e111f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ clean:
@echo ":: Clean"
rm -rf target/
rm -rf resources/public/node_modules
rm -rf resources/public/cljs-out

web: install
mkdir -p resources/public/cljs-out
Expand Down
7 changes: 7 additions & 0 deletions src/reveal/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,12 @@
(let [state (and (.isReady js/Reveal) (.getState js/Reveal))]
(-> (.initialize js/Reveal options)
(.then #(when state (.setState js/Reveal state)))
(.then #(if (.isSpeakerNotes js/Reveal)
;; disable figwheel connection for speaker notes
(when (.hasOwnProperty js/window "figwheel")
(set! (.-connect js/figwheel.repl) (constantly "Disabled for speaker notes")))

;; trigger an event which will update the speaker notes
(.dispatchEvent js/Reveal (clj->js {:type "resumed"}))))
(.then (fn [] "call your own init code from here")))))
(main)
4 changes: 3 additions & 1 deletion src/reveal/slides.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
[:h1 "reveal-cljs"]
[:h5 "Create awesome Web-Presentations with ClojureScript"]
[:p "Based on "
[:a {:href "http://lab.hakim.se/reveal-js/"} "reveal.js"]]])
[:a {:href "http://lab.hakim.se/reveal-js/"} "reveal.js"]]
[:aside.notes
[:ul [:li "Some notes"]]]])

(def ^:private argument
[:div.argument
Expand Down

0 comments on commit b2e111f

Please # to comment.