diff --git a/cljs/nrepl_playground.cljs b/cljs/nrepl_playground.cljs new file mode 100644 index 0000000..2c71307 --- /dev/null +++ b/cljs/nrepl_playground.cljs @@ -0,0 +1,15 @@ +(ns nrepl-playground) + +(+ 1 2 3) + +(-> + (js/document.getElementsByTagName "body") + first + (.append + (doto (js/document.createElement "p") + (.append + (js/document.createTextNode "there"))))) + +(defn foo []) + +(js/alert "Isn't this cool? :)") diff --git a/index.html b/index.html index 82ea23f..c2720e5 100644 --- a/index.html +++ b/index.html @@ -19,10 +19,10 @@ (def state (r/atom {:clicks 0})) (defn my-component [] - [:div - [:p "Clicks: " (:clicks @state)] - [:p [:button {:on-click #(swap! state update :clicks inc)} - "Click me!"]]]) + [:div + [:p "Clicks: " (:clicks @state)] + [:p [:button {:on-click #(swap! state update :clicks inc)} + "Click me!"]]]) (rdom/render [my-component] (.getElementById js/document "app")) @@ -41,15 +41,15 @@ (require '[goog.object :as gobject]) (doseq [code code-tags] - (let [src (.getAttribute code "data-src") - req (js/XMLHttpRequest.)] - (.open req "GET" src true) - (set! (.-onload req) - (fn [] - (let [response (gobject/get req "response")] - (set! (.-innerText code) response) - (.highlightElement js/hljs code)))) - (.send req))) + (let [src (.getAttribute code "data-src") + req (js/XMLHttpRequest.)] + (.open req "GET" src true) + (set! (.-onload req) + (fn [] + (let [response (gobject/get req "response")] + (set! (.-innerText code) response) + (.highlightElement js/hljs code)))) + (.send req))) @@ -60,7 +60,7 @@
+
-<script src="cljs/script.cljs" type="application/x-scittle"></script>
+ <script src="cljs/script.cljs" type="application/x-scittle"></script>
@@ -118,6 +118,12 @@
Click me!
+
+