Last active
July 15, 2016 15:13
-
-
Save danielsz/8086074 to your computer and use it in GitHub Desktop.
Revisions
-
danielsz renamed this gist
Dec 22, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
danielsz revised this gist
Dec 22, 2013 . 1 changed file with 0 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +0,0 @@ -
danielsz renamed this gist
Dec 22, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
danielsz revised this gist
Dec 22, 2013 . 1 changed file with 17 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ (def history (Html5History.)) (.setUseFragment history false) (.setPathPrefix history "") (.setEnabled history true) (let [navigation (listen history EventType/NAVIGATE)] (go (while true (let [token (.-token (<! navigation))] (secretary/dispatch! token))))) (events/listen js/document "click" (fn [e] (let [path (.getPath (.parse Uri (.-href (.-target e)))) title (.-title (.-target e))] (when (secretary/any-matches? path) (. history (setToken path title)) (.preventDefault e))))) -
danielsz revised this gist
Dec 22, 2013 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,6 @@ (go (while true (let [token (.-token (<! navigation))] (secretary/dispatch! token))))) (events/listen js/document "click" (fn [e] -
danielsz revised this gist
Dec 22, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ (while true (let [token (.-token (<! navigation))] (.log js/console (str "navigation event: " token)) (secretary/dispatch! token))))) (events/listen js/document "click" (fn [e] (let [path (.getPath (.parse Uri (.-href (.-target e)))) -
danielsz created this gist
Dec 22, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ (def history (Html5History.)) (.setUseFragment history false) (.setPathPrefix history "") (.setEnabled history true) (let [navigation (listen history EventType/NAVIGATE)] (go (while true (let [token (.-token (<! navigation))] (.log js/console (str "navigation event: " token)) (secretary/dispatch! token)))))) (events/listen js/document "click" (fn [e] (let [path (.getPath (.parse Uri (.-href (.-target e)))) title (.-title (.-target e))] (when (secretary/any-matches? path) (. history (setToken path title)) (.preventDefault e)))))