js loading made optional
This commit is contained in:
@@ -91,18 +91,26 @@
|
|||||||
(rule "h1, h2, h3, h4"
|
(rule "h1, h2, h3, h4"
|
||||||
:font-family (gen-comma-list "'Noticia Text'" "'PT Serif'"))))
|
:font-family (gen-comma-list "'Noticia Text'" "'PT Serif'"))))
|
||||||
|
|
||||||
(defpartial layout [title & content]
|
(defpartial generate-layout
|
||||||
|
[params title & content]
|
||||||
(html5
|
(html5
|
||||||
[:head
|
[:head
|
||||||
[:title "NoteHub — " title]
|
[:title "NoteHub — " title]
|
||||||
(include-js "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js")
|
|
||||||
[:link {:href (str "http://fonts.googleapis.com/css?family="
|
[:link {:href (str "http://fonts.googleapis.com/css?family="
|
||||||
"PT+Serif:700|Noticia+Text:700"
|
"PT+Serif:700|Noticia+Text:700"
|
||||||
"&subset=latin,cyrillic" )
|
"&subset=latin,cyrillic" )
|
||||||
:rel "stylesheet"
|
:rel "stylesheet"
|
||||||
:type "text/css"}]
|
:type "text/css"}]
|
||||||
[:style {:type "text/css"} global-css]]
|
[:style {:type "text/css"} global-css]]
|
||||||
[:body
|
(if (params :js)
|
||||||
content
|
[:body content
|
||||||
(javascript-tag "var CLOSURE_NO_DEPS = true;")
|
(javascript-tag "var CLOSURE_NO_DEPS = true;")
|
||||||
(include-js "/cljs/main.js")]))
|
(include-js "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js")
|
||||||
|
(include-js "/cljs/main.js")]
|
||||||
|
[:body content])))
|
||||||
|
|
||||||
|
(defn layout [& args]
|
||||||
|
(if (map? (first args))
|
||||||
|
(apply generate-layout args)
|
||||||
|
(apply generate-layout {} args)))
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
; New Note Page
|
; New Note Page
|
||||||
(defpage "/new" {}
|
(defpage "/new" {}
|
||||||
(common/layout "New Markdown Note"
|
(common/layout {:js true} "New Markdown Note"
|
||||||
[:div.central-element
|
[:div.central-element
|
||||||
(form-to [:post "/post-note"]
|
(form-to [:post "/post-note"]
|
||||||
(hidden-field :session-key (get-flash-key))
|
(hidden-field :session-key (get-flash-key))
|
||||||
|
|||||||
Reference in New Issue
Block a user