js loading made optional
This commit is contained in:
@@ -13,96 +13,104 @@
|
|||||||
(mixin
|
(mixin
|
||||||
:font-weight 300
|
:font-weight 300
|
||||||
:font-family (gen-comma-list "'Helvetica Neue'"
|
:font-family (gen-comma-list "'Helvetica Neue'"
|
||||||
"Helvetica"
|
"Helvetica"
|
||||||
"Arial"
|
"Arial"
|
||||||
"'Lucida Grande'"
|
"'Lucida Grande'"
|
||||||
"sans-serif")))
|
"sans-serif")))
|
||||||
(def central-element
|
(def central-element
|
||||||
(mixin
|
(mixin
|
||||||
page-width
|
page-width
|
||||||
:margin-top :5em
|
:margin-top :5em
|
||||||
:margin-bottom :10em
|
:margin-bottom :10em
|
||||||
:margin-left "auto"
|
:margin-left "auto"
|
||||||
:margin-right "auto"))
|
:margin-right "auto"))
|
||||||
|
|
||||||
(def global-css
|
(def global-css
|
||||||
(css
|
(css
|
||||||
(rule ".landing-button"
|
(rule ".landing-button"
|
||||||
:box-shadow [0 :2px :5px :#aaa]
|
:box-shadow [0 :2px :5px :#aaa]
|
||||||
:text-decoration :none
|
:text-decoration :none
|
||||||
:font-size :1.5em
|
:font-size :1.5em
|
||||||
:background :#0a2
|
:background :#0a2
|
||||||
:color :white
|
:color :white
|
||||||
:border :none
|
:border :none
|
||||||
:border-radius :10px
|
:border-radius :10px
|
||||||
:padding :10px
|
:padding :10px
|
||||||
helvetica-neue
|
helvetica-neue
|
||||||
(rule "&:hover"
|
(rule "&:hover"
|
||||||
:background :#0b2))
|
:background :#0b2))
|
||||||
(rule "html, body"
|
(rule "html, body"
|
||||||
:color :#333
|
:color :#333
|
||||||
:margin 0
|
:margin 0
|
||||||
:padding 0)
|
:padding 0)
|
||||||
(rule "#hero"
|
(rule "#hero"
|
||||||
:padding-top :5em
|
:padding-top :5em
|
||||||
:padding-bottom :5em
|
:padding-bottom :5em
|
||||||
:text-align :center
|
:text-align :center
|
||||||
(rule "h2"
|
(rule "h2"
|
||||||
helvetica-neue))
|
helvetica-neue))
|
||||||
(rule "article"
|
(rule "article"
|
||||||
central-element
|
central-element
|
||||||
:font-family :Georgia
|
:font-family :Georgia
|
||||||
:font-size :1.2em
|
:font-size :1.2em
|
||||||
(rule "& > h1:first-child"
|
(rule "& > h1:first-child"
|
||||||
:text-align :center
|
:text-align :center
|
||||||
:margin :2em))
|
:margin :2em))
|
||||||
(rule "pre"
|
(rule "pre"
|
||||||
:border-radius :3px
|
:border-radius :3px
|
||||||
:padding :1em
|
:padding :1em
|
||||||
:border [:1px :dotted :gray]
|
:border [:1px :dotted :gray]
|
||||||
:background :#efefef)
|
:background :#efefef)
|
||||||
(rule "*:focus"
|
(rule "*:focus"
|
||||||
:outline [:0px :none :transparent])
|
:outline [:0px :none :transparent])
|
||||||
(rule "textarea"
|
(rule "textarea"
|
||||||
page-width
|
page-width
|
||||||
:font-family :Courier
|
:font-family :Courier
|
||||||
:font-size :1.2em
|
:font-size :1.2em
|
||||||
:border :none
|
:border :none
|
||||||
; TODO: make this dynamic
|
; TODO: make this dynamic
|
||||||
:height :500px
|
:height :500px
|
||||||
:margin-bottom :2em)
|
:margin-bottom :2em)
|
||||||
(rule ".hidden"
|
(rule ".hidden"
|
||||||
:display :none)
|
:display :none)
|
||||||
(rule ".button"
|
(rule ".button"
|
||||||
:border-radius :3px
|
:border-radius :3px
|
||||||
helvetica-neue
|
helvetica-neue
|
||||||
:cursor :pointer
|
:cursor :pointer
|
||||||
:border [:1px :solid]
|
:border [:1px :solid]
|
||||||
:opacity 0.8
|
:opacity 0.8
|
||||||
:font-size :1em
|
:font-size :1em
|
||||||
:background :white)
|
:background :white)
|
||||||
(rule ".central-element"
|
(rule ".central-element"
|
||||||
central-element)
|
central-element)
|
||||||
(rule "h1"
|
(rule "h1"
|
||||||
:font-size :2em)
|
:font-size :2em)
|
||||||
(rule "#preview-start-line"
|
(rule "#preview-start-line"
|
||||||
:border-bottom [:1px :dashed :gray]
|
:border-bottom [:1px :dashed :gray]
|
||||||
:margin-bottom :5em)
|
:margin-bottom :5em)
|
||||||
(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