Created
November 15, 2016 16:17
-
-
Save micha/e57a8b1bdabe78d748b6a9b0b486eeec to your computer and use it in GitHub Desktop.
This file contains 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 characters
(ns ui.app | |
(:refer-hoplon :exclude [main body]) | |
(:refer-clojure :exclude [meta]) | |
(:require-macros [ui.app :as app]) | |
(:require [app.routes :as routes] | |
[app.integrations :as int] | |
[ui.global-state :as global])) | |
(def meta html-meta) | |
(defmethod do! :active | |
[elem k v] | |
(elem :class {:active v})) | |
(defelem main* | |
[attr kids] | |
(let [modal-backdrop (div)] | |
(html | |
:lang "en" | |
(head | |
(link :href (bust-cache "css/application.css") :rel "stylesheet") | |
(link :href "vendors/jqueryui/jquery-ui.css" :rel "stylesheet") | |
(link :rel "shortcut icon" :href "favicon.ico" :type "image/x-icon") | |
(link :rel "icon" :href "favicon.ico" :type "image/x-icon") | |
(meta :name "viewport" :content "width=device-width, initial-scale=1") | |
(title :text routes/page-title)) | |
(hoplon.core/body | |
:class (cell= {:modal-open global/modal-open}) | |
;; clickjacking countermeasures | |
(if (not= js/top js/self) | |
(set! (.-location js/top) (.-location js/self)) | |
[kids | |
(modal-backdrop | |
:toggle global/modal-open | |
:class (cell= {:modal-backdrop true | |
:fade true | |
:in global/modal-open})) | |
(int/scripts)]))))) | |
(defelem intercept [attr kids] | |
((div :class "intercept" | |
(div :class "intercept-content" | |
kids)) | |
attr)) | |
(defelem body | |
[attr kids] | |
((div :class "body") attr kids)) | |
(defelem app | |
[attr kids] | |
((div :class "app") attr kids)) | |
(defelem large-only | |
[_ kids] | |
(map #(% :class "large-only") kids)) | |
(defelem small-only | |
[_ kids] | |
(map #(% :class "small-only") kids)) | |
(defelem container-fluid | |
[attr kids] | |
((div :class "container-fluid") attr kids)) | |
(defelem row | |
[attr kids] | |
((div :class "row") attr kids)) | |
(defelem col-md-3 | |
[attr kids] | |
((div :class "col-md-3") attr kids)) | |
(defelem col-md-6 | |
[attr kids] | |
((div :class "col-md-6") attr kids)) | |
(defelem col-md-9 | |
[attr kids] | |
((div :class "col-md-9") attr kids)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment