Added virtually the whole of the Scittle distribution, as it proves to be
virtually necessary to do development.
This commit is contained in:
parent
fcb023ecc5
commit
0a200aca94
741 changed files with 174111 additions and 11 deletions
23
resources/public/html/cljs-ajax.html
Normal file
23
resources/public/html/cljs-ajax.html
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.js" type="application/javascript"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.cljs-ajax.js" type="application/javascript"></script>
|
||||
<script type="application/x-scittle">
|
||||
(require '[ajax.core :refer [GET]])
|
||||
|
||||
(defn handler [response]
|
||||
(js/alert (str response)))
|
||||
|
||||
(defn make-request []
|
||||
(GET "html/cljs-ajax.html" {:handler handler}))
|
||||
|
||||
;; export function to use from JavaScript:
|
||||
(set! (.-make_request js/window) make-request)
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<button onclick="make_request()">
|
||||
Click me!
|
||||
</button>
|
||||
</body>
|
||||
</html>
|
||||
16
resources/public/html/export.html
Normal file
16
resources/public/html/export.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.js" type="application/javascript"></script>
|
||||
<script type="application/x-scittle">
|
||||
(defn my-alert []
|
||||
(js/alert "You clicked!"))
|
||||
;; export function to use from JavaScript:
|
||||
(set! (.-my_alert js/window) my-alert)
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<button onclick="my_alert()">
|
||||
Click me!
|
||||
</button>
|
||||
</body>
|
||||
</html>
|
||||
15
resources/public/html/local.html
Normal file
15
resources/public/html/local.html
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="../js/scittle.js" type="application/javascript"></script>
|
||||
<script crossorigin src="https://cdn.jsdelivr.net/npm/react@18/umd/react.production.min.js"></script>
|
||||
<script crossorigin src="https://cdn.jsdelivr.net/npm/react-dom@18/umd/react-dom.production.min.js"></script>
|
||||
<script src="../js/scittle.reagent.js" type="application/javascript"></script>
|
||||
<script type="application/x-scittle">
|
||||
(defn f [x]
|
||||
(inc n))
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
</html>
|
||||
25
resources/public/html/reagent.html
Normal file
25
resources/public/html/reagent.html
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.js" type="application/javascript"></script>
|
||||
<script crossorigin src="https://cdn.jsdelivr.net/npm/react@18/umd/react.production.min.js"></script>
|
||||
<script crossorigin src="https://cdn.jsdelivr.net/npm/react-dom@18/umd/react-dom.production.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.reagent.js" type="application/javascript"></script>
|
||||
<script type="application/x-scittle">
|
||||
(require '[reagent.core :as r]
|
||||
'[reagent.dom :as rdom])
|
||||
|
||||
(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!"]]])
|
||||
|
||||
(rdom/render [my-component] (.getElementById js/document "app"))
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue