1. Lucian Brănescu-Mihăilă
  2. lichen-clj

Commits

Lucian Brănescu-Mihăilă  committed 7075341

Cljs hello world in a page.

  • Participants
  • Parent commits 17a53eb
  • Branches default

Comments (0)

Files changed (4)

File project.clj

View file
       ; The standard ClojureScript compiler options:
       ; (See the ClojureScript compiler documentation for details.)
       :compiler {
-        :output-to "war/javascripts/main.js"  ; default: main.js in current directory
+        :output-to "resources/public/js/main.js"
         :optimizations :whitespace
         :pretty-print true}}]}
   :main lichen.server)

File src-cljs/lichen/main.cljs

View file
+(ns lichen.main)
+
+(js/alert "Hello world!")

File src/lichen/views/common.clj

View file
 (ns lichen.views.common
   (:use [noir.core :only [defpartial]]
-        [hiccup.page-helpers :only [include-css html5]]))
+    [hiccup.page-helpers :only [include-css include-js html5]]))
 
 (defpartial layout [& content]
-            (html5
-              [:head
-               [:title "lichen"]
-               (include-css "/css/reset.css")]
-              [:body
-               [:div#wrapper
-                content]]))
+  (html5
+    [:head
+      [:title "lichen"]
+      (include-css "/css/reset.css")]
+    [:body
+      [:div#wrapper
+        content]]
+      (include-js "/js/main.js")))

File src/lichen/views/welcome.clj

View file
         [hiccup.core :only [html]]))
 
 (defpage "/welcome" []
-         (common/layout
-           [:p "Welcome to lichen"]))
+  (common/layout
+    [:p "Welcome to lichen"]))