From 848dd52d3cb17eae1659c08dbbf988302d084275 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Tue, 17 May 2022 14:24:51 +0200 Subject: [PATCH] wip --- README.md | 2 +- resources/public/cljs/nrepl.cljs | 2 ++ resources/public/index.html | 38 ++++++++++++++++++-------------- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 764fed7..d9efcb0 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,6 @@ Idea by Arne Brasseur a.k.a [plexus](https://github.com/plexus). ## License -Copyright © 2021 Michiel Borkent +Copyright © 2021 - 2022 Michiel Borkent Distributed under the EPL License. See LICENSE. diff --git a/resources/public/cljs/nrepl.cljs b/resources/public/cljs/nrepl.cljs index a77d1d3..e7f7c45 100644 --- a/resources/public/cljs/nrepl.cljs +++ b/resources/public/cljs/nrepl.cljs @@ -10,4 +10,6 @@ (.append (js/document.createTextNode "there"))))) +(defn foo []) + (js/alert "Isn't this cool? :)") diff --git a/resources/public/index.html b/resources/public/index.html index 82ea23f..c2720e5 100644 --- a/resources/public/index.html +++ b/resources/public/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