Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

syncing speaker notes to speaker window after figwheel reload #15

Merged
merged 1 commit into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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