From c80b3d9cabd946f1b6d76b365adb988006bd1ef4 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Tue, 17 May 2022 21:20:57 +0200 Subject: [PATCH] update build --- cljs/nrepl_playground.cljs | 15 + index.html | 38 +- js/scittle.cljs-ajax.js | 28 +- js/scittle.js | 966 +++++++++++++++++++------------------ js/scittle.nrepl.js | 16 + js/scittle.reagent.js | 162 ++++--- report.html | 2 +- 7 files changed, 657 insertions(+), 570 deletions(-) create mode 100644 cljs/nrepl_playground.cljs create mode 100644 js/scittle.nrepl.js 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 @@
-
+

Scittle

What is this?

@@ -73,7 +73,7 @@ To embed scittle in your website, it is recommended to use the links published to the releases - page. + page. Include scittle.js and write a script tag where type is set @@ -90,7 +90,7 @@ When you have a file on your server, say cljs/script.cljs, you can load it using the src attribute:

-<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! + +

REPL

+ + To connect to a REPL with Scittle, + see README.md +

Examples