├── README.md ├── example ├── .nrepl-port ├── README.md ├── figwheel_server.log ├── project.clj ├── resources │ └── public │ │ ├── index.html │ │ └── js │ │ └── compiled │ │ ├── app.js │ │ └── out │ │ ├── cljs │ │ ├── core.cljs │ │ ├── core.js │ │ ├── core.js.map │ │ ├── core │ │ │ ├── async.cljs │ │ │ ├── async.cljs.cache.edn │ │ │ ├── async.js │ │ │ ├── async.js.map │ │ │ └── async │ │ │ │ └── impl │ │ │ │ ├── buffers.cljs │ │ │ │ ├── buffers.cljs.cache.edn │ │ │ │ ├── buffers.js │ │ │ │ ├── buffers.js.map │ │ │ │ ├── channels.cljs │ │ │ │ ├── channels.cljs.cache.edn │ │ │ │ ├── channels.js │ │ │ │ ├── channels.js.map │ │ │ │ ├── dispatch.cljs │ │ │ │ ├── dispatch.cljs.cache.edn │ │ │ │ ├── dispatch.js │ │ │ │ ├── dispatch.js.map │ │ │ │ ├── ioc_helpers.cljs │ │ │ │ ├── ioc_helpers.cljs.cache.edn │ │ │ │ ├── ioc_helpers.js │ │ │ │ ├── ioc_helpers.js.map │ │ │ │ ├── protocols.cljs │ │ │ │ ├── protocols.cljs.cache.edn │ │ │ │ ├── protocols.js │ │ │ │ ├── protocols.js.map │ │ │ │ ├── timers.cljs │ │ │ │ ├── timers.cljs.cache.edn │ │ │ │ ├── timers.js │ │ │ │ └── timers.js.map │ │ ├── reader.cljs │ │ ├── reader.cljs.cache.edn │ │ ├── reader.js │ │ ├── reader.js.map │ │ ├── repl.cljs │ │ ├── repl.cljs.cache.edn │ │ ├── repl.js │ │ └── repl.js.map │ │ ├── cljs_deps.js │ │ ├── clojure │ │ ├── data.cljs │ │ ├── data.cljs.cache.edn │ │ ├── data.js │ │ ├── data.js.map │ │ ├── set.cljs │ │ ├── set.cljs.cache.edn │ │ ├── set.js │ │ ├── set.js.map │ │ ├── string.cljs │ │ ├── string.cljs.cache.edn │ │ ├── string.js │ │ └── string.js.map │ │ ├── example │ │ ├── core.cljs │ │ ├── core.cljs.cache.edn │ │ ├── core.js │ │ ├── core.js.map │ │ ├── db.cljs │ │ ├── db.cljs.cache.edn │ │ ├── db.js │ │ ├── db.js.map │ │ ├── handlers.cljs │ │ ├── handlers.cljs.cache.edn │ │ ├── handlers.js │ │ ├── handlers.js.map │ │ ├── subs.cljs │ │ ├── subs.cljs.cache.edn │ │ ├── subs.js │ │ ├── subs.js.map │ │ ├── views.cljs │ │ ├── views.cljs.cache.edn │ │ ├── views.js │ │ └── views.js.map │ │ ├── figwheel │ │ ├── client.cljs │ │ ├── client.cljs.cache.edn │ │ ├── client.js │ │ ├── client.js.map │ │ ├── client │ │ │ ├── file_reloading.cljs │ │ │ ├── file_reloading.cljs.cache.edn │ │ │ ├── file_reloading.js │ │ │ ├── file_reloading.js.map │ │ │ ├── heads_up.cljs │ │ │ ├── heads_up.cljs.cache.edn │ │ │ ├── heads_up.js │ │ │ ├── heads_up.js.map │ │ │ ├── socket.cljs │ │ │ ├── socket.cljs.cache.edn │ │ │ ├── socket.js │ │ │ ├── socket.js.map │ │ │ ├── utils.cljs │ │ │ ├── utils.cljs.cache.edn │ │ │ ├── utils.js │ │ │ └── utils.js.map │ │ ├── connect.cljs │ │ ├── connect.cljs.cache.edn │ │ ├── connect.js │ │ └── connect.js.map │ │ ├── goog │ │ ├── array │ │ │ └── array.js │ │ ├── asserts │ │ │ └── asserts.js │ │ ├── async │ │ │ ├── nexttick.js │ │ │ └── run.js │ │ ├── base.js │ │ ├── debug │ │ │ ├── entrypointregistry.js │ │ │ └── error.js │ │ ├── deps.js │ │ ├── dom │ │ │ ├── browserfeature.js │ │ │ ├── dom.js │ │ │ ├── nodetype.js │ │ │ └── tagname.js │ │ ├── functions │ │ │ └── functions.js │ │ ├── iter │ │ │ └── iter.js │ │ ├── labs │ │ │ └── useragent │ │ │ │ ├── browser.js │ │ │ │ ├── engine.js │ │ │ │ └── util.js │ │ ├── math │ │ │ ├── coordinate.js │ │ │ ├── math.js │ │ │ └── size.js │ │ ├── mochikit │ │ │ └── async │ │ │ │ └── deferred.js │ │ ├── net │ │ │ └── jsloader.js │ │ ├── object │ │ │ └── object.js │ │ ├── promise │ │ │ ├── promise.js │ │ │ ├── resolver.js │ │ │ └── thenable.js │ │ ├── string │ │ │ ├── string.js │ │ │ └── stringbuffer.js │ │ ├── structs │ │ │ ├── map.js │ │ │ └── structs.js │ │ ├── testing │ │ │ └── watchers.js │ │ ├── uri │ │ │ ├── uri.js │ │ │ └── utils.js │ │ └── useragent │ │ │ └── useragent.js │ │ ├── re_frame │ │ ├── core.cljs │ │ ├── core.cljs.cache.edn │ │ ├── core.js │ │ ├── core.js.map │ │ ├── db.cljs │ │ ├── db.cljs.cache.edn │ │ ├── db.js │ │ ├── db.js.map │ │ ├── handlers.cljs │ │ ├── handlers.cljs.cache.edn │ │ ├── handlers.js │ │ ├── handlers.js.map │ │ ├── middleware.cljs │ │ ├── middleware.cljs.cache.edn │ │ ├── middleware.js │ │ ├── middleware.js.map │ │ ├── router.cljs │ │ ├── router.cljs.cache.edn │ │ ├── router.js │ │ ├── router.js.map │ │ ├── subs.cljs │ │ ├── subs.cljs.cache.edn │ │ ├── subs.js │ │ ├── subs.js.map │ │ ├── undo.cljs │ │ ├── undo.cljs.cache.edn │ │ ├── undo.js │ │ ├── undo.js.map │ │ ├── utils.cljs │ │ ├── utils.cljs.cache.edn │ │ ├── utils.js │ │ └── utils.js.map │ │ ├── react.inc.js │ │ └── reagent │ │ ├── core.cljs │ │ ├── core.cljs.cache.edn │ │ ├── core.js │ │ ├── core.js.map │ │ ├── debug.cljs │ │ ├── debug.cljs.cache.edn │ │ ├── debug.js │ │ ├── debug.js.map │ │ ├── impl │ │ ├── batching.cljs │ │ ├── batching.cljs.cache.edn │ │ ├── batching.js │ │ ├── batching.js.map │ │ ├── component.cljs │ │ ├── component.cljs.cache.edn │ │ ├── component.js │ │ ├── component.js.map │ │ ├── template.cljs │ │ ├── template.cljs.cache.edn │ │ ├── template.js │ │ ├── template.js.map │ │ ├── util.cljs │ │ ├── util.cljs.cache.edn │ │ ├── util.js │ │ └── util.js.map │ │ ├── interop.cljs │ │ ├── interop.cljs.cache.edn │ │ ├── interop.js │ │ ├── interop.js.map │ │ ├── ratom.cljs │ │ ├── ratom.cljs.cache.edn │ │ ├── ratom.js │ │ └── ratom.js.map ├── src │ ├── clj │ │ └── example │ │ │ └── core.clj │ └── cljs │ │ └── example │ │ ├── core.cljs │ │ ├── db.cljs │ │ ├── handlers.cljs │ │ ├── subs.cljs │ │ └── views.cljs └── target │ ├── figwheel_temp │ └── dev │ │ └── figwheel │ │ └── connect.cljs │ ├── repl-port │ └── stale │ └── extract-native.dependencies └── presentation ├── Learn basics of Clojure 4-3.pdf ├── Learn basics of Clojure.pdf └── Learn basics of Clojure.pptx /README.md: -------------------------------------------------------------------------------- 1 | # Learn basics of Clojure/script and Reagent 2 | 3 | Materials and links for clojure workshop @ Reactive 2015 4 | 5 | Presentation can be found in folder presentation 6 | 7 | # Before workshop 8 | 9 | Install [leiningen](http://leiningen.org/) 10 | 11 | For linux install rlwrap `sudo apt-get install rlwrap` 12 | 13 | Install some text editor preferably [Light table](http://lighttable.com/) 14 | 15 | ### Run some commands to download stuff to prevent jaming wifi at once 16 | 17 | Download and start clojure repl 18 | * `lein repl` 19 | * wait to start 20 | 21 | For clojurescript development use [re-frame template](https://github.com/Day8/re-frame-template) 22 | * `lein new re-frame ` 23 | * `cd ` 24 | * `lein figwheel dev` 25 | * wait 26 | 27 | Or if you want only clojurescript repl without web stuff (on node for example). 28 | [https://github.com/clojure/clojurescript/wiki/Quick-Start](https://github.com/clojure/clojurescript/wiki/Quick-Start) 29 | 30 | # At workshop 31 | 32 | 33 | ## For begginers interactive workshop from Cognitect 34 | 35 | See [https://github.com/cognitect/clojure-lab](https://github.com/cognitect/clojure-lab) 36 | * Basic concepts of clojure with interactive REPL. 37 | * 2-day workshop held at Clojure/West 2015 38 | * lot of explanation and some excercise 39 | 40 | ## Materials about different topics 41 | 42 | ### Cheatsheets 43 | 44 | Great for learning new functions and what they do. 45 | 46 | [http://clojure.org/cheatsheet](http://clojure.org/cheatsheet) 47 | 48 | [http://cljs.info/cheatsheet/](http://cljs.info/cheatsheet/) 49 | 50 | [https://en.wikibooks.org/wiki/Learning_Clojure/Reader_Macros](https://en.wikibooks.org/wiki/Learning_Clojure/Reader_Macros) 51 | * for strange looking characters at code 52 | 53 | ### Destructuring 54 | 55 | [http://blog.jayfields.com/2010/07/clojure-destructuring.html](http://blog.jayfields.com/2010/07/clojure-destructuring.html) 56 | 57 | ### Javascript interoperability 58 | 59 | [http://www.spacjer.com/blog/2014/09/12/clojurescript-javascript-interop/](http://www.spacjer.com/blog/2014/09/12/clojurescript-javascript-interop/) 60 | 61 | ### Identity, state and values 62 | 63 | * [http://clojure.org/state](http://clojure.org/state) 64 | * [http://stackoverflow.com/questions/9132346/clojure-differences-between-ref-var-agent-atom-with-examples](http://stackoverflow.com/questions/9132346/clojure-differences-between-ref-var-agent-atom-with-examples) 65 | * [Video Are We There Yet by Rich Hickey](http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey) 66 | 67 | ## What to code in clojure? 68 | 69 | [http://www.codewars.com/](http://www.codewars.com/) 70 | * Improve your skills by training with others on real code challenges 71 | * Clojure is supported. 72 | * See other solution but only after solving problem 73 | * have automatic test for you 74 | 75 | 76 | [https://github.com/gigasquid/wonderland-clojure-katas](https://github.com/gigasquid/wonderland-clojure-katas) 77 | * Collection of Clojure katas inspired by Lewis Carroll and Alice in Wonderland. 78 | * They have links to solution of other users. 79 | 80 | 81 | 82 | # Web frontend stuff 83 | 84 | ## Reagent 85 | 86 | A simple ClojureScript interface to React. 87 | [https://github.com/reagent-project/reagent](https://github.com/reagent-project/reagent) 88 | 89 | Tutorial 90 | [https://github.com/jonase/reagent-tutorial]([https://github.com/jonase/reagent-tutorial) 91 | 92 | Detailed intro with live examples 93 | [http://reagent-project.github.io/](http://reagent-project.github.io/) 94 | 95 | Template 96 | [https://github.com/reagent-project/reagent-template](https://github.com/reagent-project/reagent-template) 97 | 98 | ## Devcards 99 | 100 | Enviroment for better development of UI application. 101 | [https://github.com/bhauman/devcards](https://github.com/bhauman/devcards) 102 | 103 | Template 104 | [https://github.com/bhauman/devcards-template](https://github.com/bhauman/devcards-template) 105 | 106 | Can be used with reagent template 107 | `lein new reagent +devcards` 108 | 109 | ## Re-frame 110 | 111 | Pattern for writing SPAs in ClojureScript, using Reagent. 112 | [https://github.com/Day8/re-frame](https://github.com/Day8/re-frame) 113 | 114 | Template 115 | [https://github.com/Day8/re-frame-template](https://github.com/Day8/re-frame-template) 116 | 117 | 118 | # After workshop 119 | 120 | ## Some great video presentation 121 | 122 | TODO 123 | 124 | But anything from Rich Hickey or David Nolan is great (search on youtube ;-) 125 | 126 | ### Other presentation 127 | 128 | [http://www.slideshare.net/thnetos/clojure-intro](http://www.slideshare.net/thnetos/clojure-intro) 129 | [http://www.slideshare.net/bmabey/clojure-plainandsimple](http://www.slideshare.net/bmabey/clojure-plainandsimple) 130 | 131 | -------------------------------------------------------------------------------- /example/.nrepl-port: -------------------------------------------------------------------------------- 1 | 56467 -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | A [re-frame](https://github.com/Day8/re-frame) application designed to ... well, that part is up to you. 4 | 5 | ## Development Mode 6 | 7 | ### Run application: 8 | 9 | ``` 10 | lein clean 11 | lein figwheel dev 12 | ``` 13 | 14 | Figwheel will automatically push cljs changes to the browser. 15 | 16 | Wait a bit, then browse to [http://localhost:3449](http://localhost:3449). 17 | 18 | ## Production Build 19 | 20 | ``` 21 | lein clean 22 | lein cljsbuild once min 23 | ``` 24 | -------------------------------------------------------------------------------- /example/project.clj: -------------------------------------------------------------------------------- 1 | (defproject example "0.1.0-SNAPSHOT" 2 | :dependencies [[org.clojure/clojure "1.6.0"] 3 | [org.clojure/clojurescript "0.0-3211"] 4 | [reagent "0.5.0"] 5 | [re-frame "0.4.1"]] 6 | 7 | :source-paths ["src/clj"] 8 | 9 | :plugins [[lein-cljsbuild "1.0.6"] 10 | [lein-figwheel "0.3.3" :exclusions [cider/cider-nrepl]] ] 11 | 12 | :clean-targets ^{:protect false} ["resources/public/js/compiled" "target" ] 13 | 14 | :cljsbuild {:builds [{:id "dev" 15 | :source-paths ["src/cljs"] 16 | 17 | :figwheel {:on-jsload "example.core/mount-root"} 18 | 19 | :compiler {:main example.core 20 | :output-to "resources/public/js/compiled/app.js" 21 | :output-dir "resources/public/js/compiled/out" 22 | :asset-path "js/compiled/out" 23 | :source-map-timestamp true}} 24 | 25 | {:id "min" 26 | :source-paths ["src/cljs"] 27 | :compiler {:main example.core 28 | :output-to "resources/public/js/compiled/app.js" 29 | :optimizations :advanced 30 | :pretty-print false}}]}) 31 | -------------------------------------------------------------------------------- /example/resources/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/app.js: -------------------------------------------------------------------------------- 1 | if(typeof goog == "undefined") document.write(''); 2 | document.write(''); 3 | document.write(''); 4 | 5 | document.write(""); -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/cljs/core/async/impl/buffers.cljs: -------------------------------------------------------------------------------- 1 | ;; Copyright (c) Rich Hickey and contributors. All rights reserved. 2 | ;; The use and distribution terms for this software are covered by the 3 | ;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ;; which can be found in the file epl-v10.html at the root of this distribution. 5 | ;; By using this software in any fashion, you are agreeing to be bound by 6 | ;; the terms of this license. 7 | ;; You must not remove this notice, or any other, from this software. 8 | 9 | (ns cljs.core.async.impl.buffers 10 | (:require [cljs.core.async.impl.protocols :as impl])) 11 | 12 | ;; ----------------------------------------------------------------------------- 13 | ;; DO NOT USE, this is internal buffer representation 14 | 15 | (defn acopy [src src-start dest dest-start len] 16 | (loop [cnt 0] 17 | (when (< cnt len) 18 | (aset dest 19 | (+ dest-start cnt) 20 | (aget src (+ src-start cnt))) 21 | (recur (inc cnt))))) 22 | 23 | (deftype RingBuffer [^:mutable head ^:mutable tail ^:mutable length ^:mutable arr] 24 | Object 25 | (pop [_] 26 | (when-not (zero? length) 27 | (let [x (aget arr tail)] 28 | (aset arr tail nil) 29 | (set! tail (js-mod (inc tail) (alength arr))) 30 | (set! length (dec length)) 31 | x))) 32 | 33 | (unshift [_ x] 34 | (aset arr head x) 35 | (set! head (js-mod (inc head) (alength arr))) 36 | (set! length (inc length)) 37 | nil) 38 | 39 | (unbounded-unshift [this x] 40 | (if (== (inc length) (alength arr)) 41 | (.resize this)) 42 | (.unshift this x)) 43 | 44 | ;; Doubles the size of the buffer while retaining all the existing values 45 | (resize 46 | [_] 47 | (let [new-arr-size (* (alength arr) 2) 48 | new-arr (make-array new-arr-size)] 49 | (cond 50 | (< tail head) 51 | (do (acopy arr tail new-arr 0 length) 52 | (set! tail 0) 53 | (set! head length) 54 | (set! arr new-arr)) 55 | 56 | (> tail head) 57 | (do (acopy arr tail new-arr 0 (- (alength arr) tail)) 58 | (acopy arr 0 new-arr (- (alength arr) tail) head) 59 | (set! tail 0) 60 | (set! head length) 61 | (set! arr new-arr)) 62 | 63 | (== tail head) 64 | (do (set! tail 0) 65 | (set! head 0) 66 | (set! arr new-arr))))) 67 | 68 | (cleanup [this keep?] 69 | (dotimes [x length] 70 | (let [v (.pop this)] 71 | (when ^boolean (keep? v) 72 | (.unshift this v)))))) 73 | 74 | (defn ring-buffer [n] 75 | (assert (> n 0) "Can't create a ring buffer of size 0") 76 | (RingBuffer. 0 0 0 (make-array n))) 77 | 78 | ;; ----------------------------------------------------------------------------- 79 | 80 | (deftype FixedBuffer [buf n] 81 | impl/Buffer 82 | (full? [this] 83 | (== (.-length buf) n)) 84 | (remove! [this] 85 | (.pop buf)) 86 | (add!* [this itm] 87 | (.unbounded-unshift buf itm) 88 | this) 89 | cljs.core/ICounted 90 | (-count [this] 91 | (.-length buf))) 92 | 93 | (defn fixed-buffer [n] 94 | (FixedBuffer. (ring-buffer n) n)) 95 | 96 | (deftype DroppingBuffer [buf n] 97 | impl/UnblockingBuffer 98 | impl/Buffer 99 | (full? [this] 100 | false) 101 | (remove! [this] 102 | (.pop buf)) 103 | (add!* [this itm] 104 | (when-not (== (.-length buf) n) 105 | (.unshift buf itm)) 106 | this) 107 | cljs.core/ICounted 108 | (-count [this] 109 | (.-length buf))) 110 | 111 | (defn dropping-buffer [n] 112 | (DroppingBuffer. (ring-buffer n) n)) 113 | 114 | (deftype SlidingBuffer [buf n] 115 | impl/UnblockingBuffer 116 | impl/Buffer 117 | (full? [this] 118 | false) 119 | (remove! [this] 120 | (.pop buf)) 121 | (add!* [this itm] 122 | (when (== (.-length buf) n) 123 | (impl/remove! this)) 124 | (.unshift buf itm) 125 | this) 126 | cljs.core/ICounted 127 | (-count [this] 128 | (.-length buf))) 129 | 130 | (defn sliding-buffer [n] 131 | (SlidingBuffer. (ring-buffer n) n)) 132 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/cljs/core/async/impl/buffers.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/cljs\/core\/async\/impl\/buffers.js","sources":["buffers.cljs?rel=1446435321552"],"lineCount":323,"mappings":";AAQA;;;AAMA,qCAAA,rCAAMA,kFAAOC,IAAIC,UAAUC,KAAKC,WAAWC;AAA3C,AACE,UAAA,NAAOC;;AAAP,AACE,GAAM,CAAGA,MAAID;AAAb,AACE,CAAMF,KACA,CAAGC,aAAWE,QACd,CAAML,IAAI,CAAGC,YAAUI;;AAC7B,eAAO,OAAA,NAAKA;;;;AAJd;;;;;AAMJ,AAAA;;;;;;;;;;AAAA,AAAA,AAAA,AAAA,wDAAA,xDAASK;;AAAT,AAAA,QAAA,JAEQM;AAFR,AAGI,GAAU,mBAAA,lBAAOF;AAAjB;;AAAA,AACE,IAAMG,IAAE,CAAMF,WAAIF;AAAlB,AACE,2BAAA,1BA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,8FAAA,9FAASM;;AAAT,AAAA,AAAA,iHAAA,jHAASA,4HAGCnB;;AAHV,AAAA,gBAAA,ZAGUA;AAHV,AAAA;;;AAAA,AAAA,AAAA,kHAAA,lHAASmB,6HAKGnB;;AALZ,AAAA,gBAAA,ZAKYA;AALZ,AAMI,OAAMa;;;AANV,AAAA,AAAA,qHAAA,rHAASM,gIAOCnB,MAAKc;;AAPf,AAAA,gBAAA,ZAOUd;AAPV,AAQI,GAAM,CAAI,AAAUa,sBAAKL;AAAzB,AACE,AAACa,sDAAarB;;AADhB;;AAEA,AAAUa,mBAAIC;;AACdd;;;AAXJ,AAAA,AAAA,wGAAA,xGAASmB;;AAAT,AAAA,4DAAA,5DAASA;;AAAT,AAAA,+DAAA,\/DAASA;;AAAT,AAAA,oEAAA,WAAA\/B,oBAAAC,sBAAAC,zHAAS6B;AAAT,AAAA,OAAA5B,2BAAAF,sBAAA;;;AAAA,kDAAA,lDAAS+B,4GAAeP,IAAIL;AAA5B,AAAA,YAAAW,2CAAwBN,IAAIL;;;AAAnBW,AAgBT,8CAAA,9CAAMG,oGAAgBd;AAAtB,AACE,YAAAW,2CAAgB,AAACZ,mDAAYC,GAAGA","names":["cljs.core.async.impl.buffers\/acopy","src","src-start","dest","dest-start","len","cnt","this__18739__auto__","writer__18740__auto__","opt__18741__auto__","cljs.core\/-write","cljs.core.async.impl.buffers\/RingBuffer","cljs.core.async.impl.buffers\/->RingBuffer","head","tail","length","arr","_","x","this","new-arr-size","new-arr","js\/Array","keep?","n__19045__auto__","v","cljs.core.async.impl.buffers\/ring-buffer","n","js\/Error","cljs.core\/pr-str","cljs.core.async.impl.buffers\/FixedBuffer","cljs.core.async.impl.buffers\/->FixedBuffer","buf","itm","cljs.core.async.impl.buffers\/fixed-buffer","cljs.core.async.impl.buffers\/DroppingBuffer","cljs.core.async.impl.buffers\/->DroppingBuffer","cljs.core.async.impl.buffers\/dropping-buffer","cljs.core.async.impl.buffers\/SlidingBuffer","cljs.core.async.impl.buffers\/->SlidingBuffer","cljs.core.async.impl.protocols\/remove!","cljs.core.async.impl.buffers\/sliding-buffer"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs: -------------------------------------------------------------------------------- 1 | (ns cljs.core.async.impl.dispatch 2 | (:require [cljs.core.async.impl.buffers :as buffers] 3 | [goog.async.nextTick])) 4 | 5 | (def tasks (buffers/ring-buffer 32)) 6 | (def running? false) 7 | (def queued? false) 8 | 9 | (def TASK_BATCH_SIZE 1024) 10 | 11 | (declare queue-dispatcher) 12 | 13 | (defn process-messages [] 14 | (set! running? true) 15 | (set! queued? false) 16 | (loop [count 0] 17 | (let [m (.pop tasks)] 18 | (when-not (nil? m) 19 | (m) 20 | (when (< count TASK_BATCH_SIZE) 21 | (recur (inc count)))))) 22 | (set! running? false) 23 | (when (> (.-length tasks) 0) 24 | (queue-dispatcher))) 25 | 26 | (defn queue-dispatcher [] 27 | (when-not (and queued? running?) 28 | (set! queued? true) 29 | (goog.async.nextTick process-messages))) 30 | 31 | (defn run [f] 32 | (.unbounded-unshift tasks f) 33 | (queue-dispatcher)) 34 | 35 | (defn queue-delay [f delay] 36 | (js/setTimeout f delay)) 37 | 38 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs.cache.edn: -------------------------------------------------------------------------------- 1 | ;; Analyzed by ClojureScript 0.0-3211 2 | {:defs {queue-delay {:protocol-inline nil, :meta {:arglists (quote ([f delay])), :end-column 18, :end-line 35, :column 7, :line 35, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs"}, :name cljs.core.async.impl.dispatch/queue-delay, :variadic false, :file "resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs", :end-column 18, :method-params ([f delay]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 35, :end-line 35, :max-fixed-arity 2, :fn-var true, :arglists (quote ([f delay])), :test true}, run {:protocol-inline nil, :meta {:arglists (quote ([f])), :end-column 10, :end-line 31, :column 7, :line 31, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs"}, :name cljs.core.async.impl.dispatch/run, :variadic false, :file "resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs", :end-column 10, :method-params ([f]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 31, :end-line 31, :max-fixed-arity 1, :fn-var true, :arglists (quote ([f])), :test true}, process-messages {:protocol-inline nil, :meta {:arglists (quote ([])), :end-column 23, :end-line 13, :column 7, :line 13, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs"}, :name cljs.core.async.impl.dispatch/process-messages, :variadic false, :file "resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs", :end-column 23, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 13, :end-line 13, :max-fixed-arity 0, :fn-var true, :arglists (quote ([])), :test true}, queue-dispatcher {:protocol-inline nil, :meta {:arglists (quote ([])), :end-column 23, :end-line 26, :column 7, :line 26, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs"}, :name cljs.core.async.impl.dispatch/queue-dispatcher, :variadic false, :file "resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs", :end-column 23, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 26, :end-line 26, :max-fixed-arity 0, :fn-var true, :arglists (quote ([])), :test true}, TASK_BATCH_SIZE {:meta {:end-column 21, :end-line 9, :column 6, :line 9, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs"}, :file "resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs", :line 9, :column 1, :end-line 9, :end-column 21, :test true, :name cljs.core.async.impl.dispatch/TASK_BATCH_SIZE}, queued? {:meta {:end-column 13, :end-line 7, :column 6, :line 7, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs"}, :file "resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs", :line 7, :column 1, :end-line 7, :end-column 13, :test true, :name cljs.core.async.impl.dispatch/queued?}, running? {:meta {:end-column 14, :end-line 6, :column 6, :line 6, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs"}, :file "resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs", :line 6, :column 1, :end-line 6, :end-column 14, :test true, :name cljs.core.async.impl.dispatch/running?}, tasks {:meta {:end-column 11, :end-line 5, :column 6, :line 5, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs"}, :file "resources/public/js/compiled/out/cljs/core/async/impl/dispatch.cljs", :line 5, :column 1, :end-line 5, :end-column 11, :test true, :name cljs.core.async.impl.dispatch/tasks}}, :imports nil, :requires {goog.async.nextTick goog.async.nextTick, cljs.core.async.impl.buffers cljs.core.async.impl.buffers, buffers cljs.core.async.impl.buffers}, :uses nil, :require-macros nil, :use-macros nil, :excludes #{}, :doc nil, :name cljs.core.async.impl.dispatch} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/cljs/core/async/impl/dispatch.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-3211 {} 2 | goog.provide('cljs.core.async.impl.dispatch'); 3 | goog.require('cljs.core'); 4 | goog.require('goog.async.nextTick'); 5 | goog.require('cljs.core.async.impl.buffers'); 6 | cljs.core.async.impl.dispatch.tasks = cljs.core.async.impl.buffers.ring_buffer.call(null,(32)); 7 | cljs.core.async.impl.dispatch.running_QMARK_ = false; 8 | cljs.core.async.impl.dispatch.queued_QMARK_ = false; 9 | cljs.core.async.impl.dispatch.TASK_BATCH_SIZE = (1024); 10 | cljs.core.async.impl.dispatch.process_messages = (function cljs$core$async$impl$dispatch$process_messages(){ 11 | cljs.core.async.impl.dispatch.running_QMARK_ = true; 12 | 13 | cljs.core.async.impl.dispatch.queued_QMARK_ = false; 14 | 15 | var count_28331 = (0); 16 | while(true){ 17 | var m_28332 = cljs.core.async.impl.dispatch.tasks.pop(); 18 | if((m_28332 == null)){ 19 | } else { 20 | m_28332.call(null); 21 | 22 | if((count_28331 < cljs.core.async.impl.dispatch.TASK_BATCH_SIZE)){ 23 | var G__28333 = (count_28331 + (1)); 24 | count_28331 = G__28333; 25 | continue; 26 | } else { 27 | } 28 | } 29 | break; 30 | } 31 | 32 | cljs.core.async.impl.dispatch.running_QMARK_ = false; 33 | 34 | if((cljs.core.async.impl.dispatch.tasks.length > (0))){ 35 | return cljs.core.async.impl.dispatch.queue_dispatcher.call(null); 36 | } else { 37 | return null; 38 | } 39 | }); 40 | cljs.core.async.impl.dispatch.queue_dispatcher = (function cljs$core$async$impl$dispatch$queue_dispatcher(){ 41 | if(cljs.core.truth_((function (){var and__18148__auto__ = cljs.core.async.impl.dispatch.queued_QMARK_; 42 | if(cljs.core.truth_(and__18148__auto__)){ 43 | return cljs.core.async.impl.dispatch.running_QMARK_; 44 | } else { 45 | return and__18148__auto__; 46 | } 47 | })())){ 48 | return null; 49 | } else { 50 | cljs.core.async.impl.dispatch.queued_QMARK_ = true; 51 | 52 | return goog.async.nextTick(cljs.core.async.impl.dispatch.process_messages); 53 | } 54 | }); 55 | cljs.core.async.impl.dispatch.run = (function cljs$core$async$impl$dispatch$run(f){ 56 | cljs.core.async.impl.dispatch.tasks.unbounded_unshift(f); 57 | 58 | return cljs.core.async.impl.dispatch.queue_dispatcher.call(null); 59 | }); 60 | cljs.core.async.impl.dispatch.queue_delay = (function cljs$core$async$impl$dispatch$queue_delay(f,delay){ 61 | return setTimeout(f,delay); 62 | }); 63 | 64 | //# sourceMappingURL=dispatch.js.map?rel=1446435321568 -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/cljs/core/async/impl/dispatch.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/cljs\/core\/async\/impl\/dispatch.js","sources":["dispatch.cljs?rel=1446435321568"],"lineCount":64,"mappings":";AAAA;;;;AAIA,AAAKA,sCAAM,mDAAA,nDAACC;AACZ,+CAAA,\/CAAKC;AACL,8CAAA,9CAAKC;AAEL,gDAAA,hDAAKC;AAEL,AAAA,AAEA,iDAAA,jDAAMC;AAAN,AACE,+CAAA,\/CAAMH;;AACN,8CAAA,9CAAMC;;AACN,kBAAA,dAAOG;;AAAP,AACE,IAAMC,UAAE,AAAMP;AAAd,AACE,GAAU,YAAA,XAAMO;AAAhB;AAAA,AACE,AAACA;;AACD,GAAM,CAAGD,cAAMF;AAAf,AACE,eAAO,eAAA,dAAKE;;;;AADd;;;;;AAEN,+CAAA,\/CAAMJ;;AACN,GAAM,8CAAA,7CAAG,AAAUF;AAAnB,AACE,OAACQ;;AADH;;;AAGF,iDAAA,jDAAMA;AAAN,AACE,oBAAU,iBAAAC,qBAAKN;AAAL,AAAA,oBAAAM;AAAaP;;AAAbO;;;AAAV;;AAAA,AACE,8CAAA,9CAAMN;;AACN,OAACO,oBAAoBL;;;AAEzB,oCAAA,pCAAMM,gFAAKC;AAAX,AACE,AAAoBZ,sDAAMY;;AAC1B,OAACJ;;AAEH,4CAAA,5CAAMK,gGAAaD,EAAEE;AAArB,AACE,OAACC,WAAcH,EAAEE","names":["cljs.core.async.impl.dispatch\/tasks","cljs.core.async.impl.buffers\/ring-buffer","cljs.core.async.impl.dispatch\/running?","cljs.core.async.impl.dispatch\/queued?","cljs.core.async.impl.dispatch\/TASK_BATCH_SIZE","cljs.core.async.impl.dispatch\/process-messages","count","m","cljs.core.async.impl.dispatch\/queue-dispatcher","and__18148__auto__","goog\/async.nextTick","cljs.core.async.impl.dispatch\/run","f","cljs.core.async.impl.dispatch\/queue-delay","delay","js\/setTimeout"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/cljs/core/async/impl/ioc_helpers.cljs: -------------------------------------------------------------------------------- 1 | (ns cljs.core.async.impl.ioc-helpers 2 | (:require [cljs.core.async.impl.protocols :as impl]) 3 | (:require-macros [cljs.core.async.impl.ioc-macros :as ioc])) 4 | 5 | (def ^:const FN-IDX 0) 6 | (def ^:const STATE-IDX 1) 7 | (def ^:const VALUE-IDX 2) 8 | (def ^:const BINDINGS-IDX 3) 9 | (def ^:const EXCEPTION-FRAMES 4) 10 | (def ^:const CURRENT-EXCEPTION 5) 11 | (def ^:const USER-START-IDX 6) 12 | 13 | (defn aset-object [arr idx o] 14 | (aget arr idx o)) 15 | 16 | (defn aget-object [arr idx] 17 | (aget arr idx)) 18 | 19 | 20 | (defn finished? 21 | "Returns true if the machine is in a finished state" 22 | [state-array] 23 | (keyword-identical? (aget state-array STATE-IDX) :finished)) 24 | 25 | (defn- fn-handler 26 | [f] 27 | (reify 28 | impl/Handler 29 | (active? [_] true) 30 | (commit [_] f))) 31 | 32 | 33 | (defn run-state-machine [state] 34 | ((aget-object state FN-IDX) state)) 35 | 36 | (defn run-state-machine-wrapped [state] 37 | (try 38 | (run-state-machine state) 39 | (catch js/Object ex 40 | (impl/close! ^not-native (aget-object state USER-START-IDX)) 41 | (throw ex)))) 42 | 43 | (defn take! [state blk ^not-native c] 44 | (if-let [cb (impl/take! c (fn-handler 45 | (fn [x] 46 | (ioc/aset-all! state VALUE-IDX x STATE-IDX blk) 47 | (run-state-machine-wrapped state))))] 48 | (do (ioc/aset-all! state VALUE-IDX @cb STATE-IDX blk) 49 | :recur) 50 | nil)) 51 | 52 | (defn put! [state blk ^not-native c val] 53 | (if-let [cb (impl/put! c val (fn-handler (fn [ret-val] 54 | (ioc/aset-all! state VALUE-IDX ret-val STATE-IDX blk) 55 | (run-state-machine-wrapped state))))] 56 | (do (ioc/aset-all! state VALUE-IDX @cb STATE-IDX blk) 57 | :recur) 58 | nil)) 59 | 60 | (defn return-chan [state value] 61 | (let [^not-native c (aget state USER-START-IDX)] 62 | (when-not (nil? value) 63 | (impl/put! c value (fn-handler (fn [] nil)))) 64 | (impl/close! c) 65 | c)) 66 | 67 | (defrecord ExceptionFrame [catch-block 68 | ^Class catch-exception 69 | finally-block 70 | continue-block 71 | prev]) 72 | 73 | (defn add-exception-frame [state catch-block catch-exception finally-block continue-block] 74 | (ioc/aset-all! state 75 | EXCEPTION-FRAMES 76 | (->ExceptionFrame catch-block 77 | catch-exception 78 | finally-block 79 | continue-block 80 | (aget-object state EXCEPTION-FRAMES)))) 81 | 82 | (defn process-exception [state] 83 | (let [exception-frame (aget-object state EXCEPTION-FRAMES) 84 | catch-block (:catch-block exception-frame) 85 | catch-exception (:catch-exception exception-frame) 86 | exception (aget-object state CURRENT-EXCEPTION)] 87 | (cond 88 | (and exception 89 | (not exception-frame)) 90 | (throw exception) 91 | 92 | (and exception 93 | catch-block 94 | (instance? catch-exception exception)) 95 | (ioc/aset-all! state 96 | STATE-IDX 97 | catch-block 98 | VALUE-IDX 99 | exception 100 | CURRENT-EXCEPTION 101 | nil 102 | EXCEPTION-FRAMES 103 | (assoc exception-frame 104 | :catch-block nil 105 | :catch-exception nil)) 106 | 107 | 108 | (and exception 109 | (not catch-block) 110 | (not (:finally-block exception-frame))) 111 | 112 | (do (ioc/aset-all! state 113 | EXCEPTION-FRAMES 114 | (:prev exception-frame)) 115 | (recur state)) 116 | 117 | (and exception 118 | (not catch-block) 119 | (:finally-block exception-frame)) 120 | (ioc/aset-all! state 121 | STATE-IDX 122 | (:finally-block exception-frame) 123 | EXCEPTION-FRAMES 124 | (assoc exception-frame 125 | :finally-block nil)) 126 | 127 | (and (not exception) 128 | (:finally-block exception-frame)) 129 | (do (ioc/aset-all! state 130 | STATE-IDX 131 | (:finally-block exception-frame) 132 | EXCEPTION-FRAMES 133 | (assoc exception-frame 134 | :finally-block nil))) 135 | 136 | (and (not exception) 137 | (not (:finally-block exception-frame))) 138 | (do (ioc/aset-all! state 139 | STATE-IDX 140 | (:continue-block exception-frame) 141 | EXCEPTION-FRAMES 142 | (:prev exception-frame))) 143 | 144 | :else (throw (js/Error. "No matching clause"))))) 145 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/cljs/core/async/impl/protocols.cljs: -------------------------------------------------------------------------------- 1 | ;; Copyright (c) Rich Hickey and contributors. All rights reserved. 2 | ;; The use and distribution terms for this software are covered by the 3 | ;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ;; which can be found in the file epl-v10.html at the root of this distribution. 5 | ;; By using this software in any fashion, you are agreeing to be bound by 6 | ;; the terms of this license. 7 | ;; You must not remove this notice, or any other, from this software. 8 | 9 | (ns cljs.core.async.impl.protocols) 10 | 11 | (def ^:const MAX-QUEUE-SIZE 1024) 12 | 13 | (defprotocol ReadPort 14 | (take! [port fn1-handler] "derefable val if taken, nil if take was enqueued")) 15 | 16 | (defprotocol WritePort 17 | (put! [port val fn1-handler] "derefable boolean (false if already closed) if handled, nil if put was enqueued. 18 | Must throw on nil val.")) 19 | 20 | (defprotocol Channel 21 | (close! [chan]) 22 | (closed? [chan])) 23 | 24 | (defprotocol Handler 25 | (active? [h] "returns true if has callback. Must work w/o lock") 26 | #_(lock-id [h] "a unique id for lock acquisition order, 0 if no lock") 27 | (commit [h] "commit to fulfilling its end of the transfer, returns cb. Must be called within lock")) 28 | 29 | (defprotocol Buffer 30 | (full? [b]) 31 | (remove! [b]) 32 | (add!* [b itm])) 33 | 34 | (defn add! 35 | ([b] b) 36 | ([b itm] 37 | (assert (not (nil? itm))) 38 | (add!* b itm))) 39 | 40 | ;; Defines a buffer that will never block (return true to full?) 41 | (defprotocol UnblockingBuffer) 42 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/cljs/core/async/impl/protocols.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/cljs\/core\/async\/impl\/protocols.js","sources":["protocols.cljs?rel=1446435321503"],"lineCount":314,"m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;;AAHVnC;;;AAAA,OAGUmC,gEAAAA,EAAEG;;AAHZ,IAAArC,mBAAA,EAAA,MAAA,OAAA,ZAGUkC,iBAAAA;AAHV,AAAA,OAAA,iBAAAjC,oBAAA,CAAA8B,+CAAA,AAAA5B,YAAAH;AAAA,AAAA,GAAAC;AAAAA;;AAAA,IAAAA,wBAAA,CAAA8B,+CAAA;AAAA,AAAA,GAAA9B;AAAAA;;AAAA,MAAA,AAAAG,qCAAA,eAGU8B;;;eAAAA,EAAEG;;;;AAHZ,AAKA,AAAA,2CAAA,3CAAME;AAAN,AAAA,IAAAD,WAAA,AAAA;AAAA,AAAA,QAAAA;KAAA;AAAA,OAAAC,uEAAA,CAAA,UAAA;;;KAAA;AAAA,OAAAA,uEAAA,CAAA,UAAA,MAAA,CAAA,UAAA;;;;AAAA,MAAA,KAAAC,MAAA,eAAA,iCAAA,AAAA;;;;;AAAA,AAAA,yEAAA,zEAAMD,oFACFL;AADJ,AACOA;;;AADP,AAAA,yEAAA,zEAAMK,oFAEFL,EAAEG;AAFN,AAGK,GAAQ,EAAK,QAAA,PAAMA;AAAnB;AAAA,AAAA,MAAA,KAAAG,MAAA,eAAA,iCAAA,AAAAC,2BAAA,eAAA,uDAAA,eAAA,yDAAA;;;AACA,OAACL,yDAAMF,EAAEG;;;AAJd,AAAA,mEAAA,nEAAME;AAON,AAAA;AAAA,kDAAA,iBAAAG,WAAA,9EAAaC;AAAb,AAAAD;;;AAAA","names":["cljs.core.async.impl.protocols\/MAX-QUEUE-SIZE","obj28310","and__18148__auto__","x__18796__auto__","or__18160__auto__","cljs\/core.async.impl.protocols.take!","goog\/typeOf","cljs.core\/missing-protocol","cljs.core.async.impl.protocols\/ReadPort","cljs.core.async.impl.protocols\/take!","port","fn1-handler","obj28312","cljs\/core.async.impl.protocols.put!","cljs.core.async.impl.protocols\/WritePort","cljs.core.async.impl.protocols\/put!","val","obj28314","cljs\/core.async.impl.protocols.close!","cljs\/core.async.impl.protocols.closed?","cljs.core.async.impl.protocols\/Channel","cljs.core.async.impl.protocols\/close!","chan","cljs.core.async.impl.protocols\/closed?","obj28316","cljs\/core.async.impl.protocols.active?","cljs\/core.async.impl.protocols.commit","cljs.core.async.impl.protocols\/Handler","cljs.core.async.impl.protocols\/active?","h","cljs.core.async.impl.protocols\/commit","obj28318","cljs\/core.async.impl.protocols.full?","cljs\/core.async.impl.protocols.remove!","cljs\/core.async.impl.protocols.add!*","cljs.core.async.impl.protocols\/Buffer","cljs.core.async.impl.protocols\/full?","b","cljs.core.async.impl.protocols\/remove!","cljs.core.async.impl.protocols\/add!*","itm","G__28320","cljs.core.async.impl.protocols\/add!","js\/Error","cljs.core\/pr-str","obj28323","cljs.core.async.impl.protocols\/UnblockingBuffer"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/cljs/repl.cljs: -------------------------------------------------------------------------------- 1 | ;; Copyright (c) Rich Hickey. All rights reserved. 2 | ;; The use and distribution terms for this software are covered by the 3 | ;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ;; which can be found in the file epl-v10.html at the root of this distribution. 5 | ;; By using this software in any fashion, you are agreeing to be bound by 6 | ;; the terms of this license. 7 | ;; You must not remove this notice, or any other, from this software. 8 | 9 | (ns cljs.repl 10 | (:require-macros cljs.repl)) 11 | 12 | (defn print-doc [m] 13 | (println "-------------------------") 14 | (println (str (when-let [ns (:ns m)] (str ns "/")) (:name m))) 15 | (when (:protocol m) 16 | (println "Protocol")) 17 | (cond 18 | (:forms m) (doseq [f (:forms m)] 19 | (println " " f)) 20 | (:arglists m) (if (or (:macro m) 21 | (:repl-special-function m)) 22 | (prn (:arglists m)) 23 | (prn (second (:arglists m))))) 24 | (if (:special-form m) 25 | (do 26 | (println "Special Form") 27 | (println " " (:doc m)) 28 | (if (contains? m :url) 29 | (when (:url m) 30 | (println (str "\n Please see http://clojure.org/" (:url m)))) 31 | (println (str "\n Please see http://clojure.org/special_forms#" 32 | (:name m))))) 33 | (do 34 | (when (:macro m) 35 | (println "Macro")) 36 | (when (:repl-special-function m) 37 | (println "REPL Special Function")) 38 | (println " " (:doc m)) 39 | (when (:protocol m) 40 | (doseq [[name {:keys [doc arglists]}] (:methods m)] 41 | (println) 42 | (println " " name) 43 | (println " " arglists) 44 | (when doc 45 | (println " " doc))))))) 46 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/cljs/repl.cljs.cache.edn: -------------------------------------------------------------------------------- 1 | ;; Analyzed by ClojureScript 0.0-3211 2 | {:use-macros nil, :excludes #{}, :name cljs.repl, :imports nil, :requires nil, :uses nil, :defs {print-doc {:protocol-inline nil, :meta {:arglists (quote ([m])), :end-column 16, :end-line 12, :column 7, :line 12, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/cljs/repl.cljs"}, :name cljs.repl/print-doc, :variadic false, :file "resources/public/js/compiled/out/cljs/repl.cljs", :end-column 16, :method-params ([m]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 12, :end-line 12, :max-fixed-arity 1, :fn-var true, :arglists (quote ([m])), :test true}}, :require-macros {cljs.repl cljs.repl}, :cljs.analyzer/constants {:order [:ns :name :protocol :forms :arglists :macro :repl-special-function :special-form :doc :url :methods], :seen #{:protocol :ns :name :special-form :repl-special-function :methods :macro :url :arglists :doc :forms}}, :doc nil} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/cljs/repl.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/cljs\/repl.js","sources":["repl.cljs?rel=1446435322615"],"lineCount":206,"mappings":";AAQA;;AAGA,sBAAA,tBAAMA,oDAAWC;AAAjB,AACE,4BAAA,5BAACC;;AACD,AAACA,4BAAQ,eAAK,iBAAAC,qBAAc,AAAA,8EAAKF;AAAnB,AAAA,oBAAAE;AAAA,AAAA,SAAAA,LAAWC;AAAX,AAAuB,wCAAA,lBAAKA;;AAA5B;;oBAAqC,AAAA,mFAA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0BAAAC,mBAAAG,YAAAA;eAAA,AAAAF,wBAAAE,eAAA,lDAA0BG;UAA1B,AAAAL,wBAAAE,eAAA,7CAAsBE;AAAtB,AAAA,AACE,AAACnC;;AACD,4BAAA,5BAACA,gCAAYkC;;AACb,4BAAA,5BAAClC,gCAAYoC;;AACb,oBAAMD;AAAN,AACE,4BAAA,5BAACnC,gCAAYmC;;AADf;;AAJF,eAAA,AAAApB,yBAAAM;eAAA;eAAA;eAAA;;;;;;;;AAAA;;;;;;AADF","names":["cljs.repl\/print-doc","m","cljs.core\/println","temp__4126__auto__","ns","seq__29391","cljs.core\/seq","chunk__29392","count__29393","i__29394","cljs.core\/-nth","cljs.core\/chunked-seq?","c__18945__auto__","cljs.core\/chunk-first","cljs.core\/chunk-rest","cljs.core\/count","cljs.core\/first","cljs.core\/next","f","or__18160__auto__","cljs.core\/prn","cljs.core\/second","cljs.core\/contains?","seq__29395","chunk__29396","count__29397","i__29398","vec__29399","cljs.core\/nth","map__29400","cljs.core\/seq?","cljs.core\/apply","cljs.core\/hash-map","cljs.core\/get","vec__29401","map__29402","name","doc","arglists"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/cljs_deps.js: -------------------------------------------------------------------------------- 1 | goog.addDependency("base.js", ['goog'], []); 2 | goog.addDependency("../cljs/core.js", ['cljs.core'], ['goog.string', 'goog.object', 'goog.string.StringBuffer', 'goog.array']); 3 | goog.addDependency("../reagent/interop.js", ['reagent.interop'], ['cljs.core']); 4 | goog.addDependency("../reagent/debug.js", ['reagent.debug'], ['cljs.core']); 5 | goog.addDependency("../clojure/string.js", ['clojure.string'], ['goog.string', 'cljs.core', 'goog.string.StringBuffer']); 6 | goog.addDependency("../reagent/impl/util.js", ['reagent.impl.util'], ['reagent.interop', 'cljs.core', 'reagent.debug', 'clojure.string']); 7 | goog.addDependency("../reagent/ratom.js", ['reagent.ratom'], ['reagent.impl.util', 'cljs.core']); 8 | goog.addDependency("../react.inc.js", ['cljsjs.react'], []); 9 | goog.addDependency("../reagent/impl/batching.js", ['reagent.impl.batching'], ['reagent.impl.util', 'reagent.interop', 'reagent.ratom', 'cljs.core', 'reagent.debug', 'clojure.string']); 10 | goog.addDependency("../reagent/impl/component.js", ['reagent.impl.component'], ['reagent.impl.util', 'reagent.interop', 'reagent.ratom', 'cljs.core', 'reagent.impl.batching', 'reagent.debug']); 11 | goog.addDependency("../reagent/impl/template.js", ['reagent.impl.template'], ['reagent.impl.util', 'reagent.interop', 'reagent.ratom', 'cljs.core', 'reagent.impl.batching', 'reagent.impl.component', 'reagent.debug', 'clojure.string']); 12 | goog.addDependency("../reagent/core.js", ['reagent.core'], ['reagent.impl.util', 'reagent.interop', 'reagent.ratom', 'cljs.core', 'cljsjs.react', 'reagent.impl.template', 'reagent.impl.batching', 'reagent.impl.component', 'reagent.debug']); 13 | goog.addDependency("../cljs/core/async/impl/protocols.js", ['cljs.core.async.impl.protocols'], ['cljs.core']); 14 | goog.addDependency("../cljs/core/async/impl/buffers.js", ['cljs.core.async.impl.buffers'], ['cljs.core', 'cljs.core.async.impl.protocols']); 15 | goog.addDependency("../cljs/core/async/impl/dispatch.js", ['cljs.core.async.impl.dispatch'], ['cljs.core', 'cljs.core.async.impl.buffers', 'goog.async.nextTick']); 16 | goog.addDependency("../cljs/core/async/impl/channels.js", ['cljs.core.async.impl.channels'], ['cljs.core.async.impl.dispatch', 'cljs.core', 'cljs.core.async.impl.buffers', 'cljs.core.async.impl.protocols']); 17 | goog.addDependency("../cljs/core/async/impl/ioc_helpers.js", ['cljs.core.async.impl.ioc_helpers'], ['cljs.core', 'cljs.core.async.impl.protocols']); 18 | goog.addDependency("../cljs/core/async/impl/timers.js", ['cljs.core.async.impl.timers'], ['cljs.core.async.impl.channels', 'cljs.core.async.impl.dispatch', 'cljs.core', 'cljs.core.async.impl.protocols']); 19 | goog.addDependency("../cljs/core/async.js", ['cljs.core.async'], ['cljs.core.async.impl.channels', 'cljs.core.async.impl.dispatch', 'cljs.core', 'cljs.core.async.impl.buffers', 'cljs.core.async.impl.protocols', 'cljs.core.async.impl.ioc_helpers', 'cljs.core.async.impl.timers']); 20 | goog.addDependency("../clojure/set.js", ['clojure.set'], ['cljs.core']); 21 | goog.addDependency("../re_frame/utils.js", ['re_frame.utils'], ['cljs.core', 'clojure.set']); 22 | goog.addDependency("../re_frame/db.js", ['re_frame.db'], ['reagent.core', 'cljs.core']); 23 | goog.addDependency("../re_frame/handlers.js", ['re_frame.handlers'], ['cljs.core', 're_frame.utils', 're_frame.db']); 24 | goog.addDependency("../re_frame/router.js", ['re_frame.router'], ['reagent.core', 'cljs.core', 'cljs.core.async', 're_frame.utils', 're_frame.handlers']); 25 | goog.addDependency("../re_frame/subs.js", ['re_frame.subs'], ['reagent.ratom', 'cljs.core', 're_frame.utils', 're_frame.db']); 26 | goog.addDependency("../re_frame/undo.js", ['re_frame.undo'], ['reagent.core', 'cljs.core', 're_frame.utils', 're_frame.handlers', 're_frame.subs', 're_frame.db']); 27 | goog.addDependency("../clojure/data.js", ['clojure.data'], ['cljs.core', 'clojure.set']); 28 | goog.addDependency("../re_frame/middleware.js", ['re_frame.middleware'], ['reagent.ratom', 'cljs.core', 're_frame.undo', 're_frame.utils', 'clojure.data']); 29 | goog.addDependency("../re_frame/core.js", ['re_frame.core'], ['cljs.core', 're_frame.router', 're_frame.utils', 're_frame.handlers', 're_frame.subs', 're_frame.middleware']); 30 | goog.addDependency("../example/views.js", ['example.views'], ['cljs.core', 're_frame.core']); 31 | goog.addDependency("../example/subs.js", ['example.subs'], ['cljs.core', 're_frame.core']); 32 | goog.addDependency("../figwheel/client/utils.js", ['figwheel.client.utils'], ['cljs.core', 'clojure.string']); 33 | goog.addDependency("../cljs/reader.js", ['cljs.reader'], ['goog.string', 'cljs.core', 'goog.string.StringBuffer']); 34 | goog.addDependency("../figwheel/client/socket.js", ['figwheel.client.socket'], ['cljs.core', 'figwheel.client.utils', 'cljs.reader']); 35 | goog.addDependency("../example/db.js", ['example.db'], ['cljs.core']); 36 | goog.addDependency("../example/handlers.js", ['example.handlers'], ['cljs.core', 'example.db', 're_frame.core']); 37 | goog.addDependency("../example/core.js", ['example.core'], ['reagent.core', 'cljs.core', 'example.views', 'example.handlers', 'example.subs', 're_frame.core']); 38 | goog.addDependency("../figwheel/client/file_reloading.js", ['figwheel.client.file_reloading'], ['goog.string', 'goog.net.jsloader', 'goog.Uri', 'cljs.core', 'cljs.core.async', 'clojure.set', 'figwheel.client.utils', 'clojure.string']); 39 | goog.addDependency("../figwheel/client/heads_up.js", ['figwheel.client.heads_up'], ['cljs.core', 'cljs.core.async', 'figwheel.client.socket', 'clojure.string']); 40 | goog.addDependency("../cljs/repl.js", ['cljs.repl'], ['cljs.core']); 41 | goog.addDependency("../figwheel/client.js", ['figwheel.client'], ['goog.Uri', 'cljs.core', 'cljs.core.async', 'figwheel.client.file_reloading', 'figwheel.client.utils', 'cljs.repl', 'figwheel.client.heads_up', 'figwheel.client.socket', 'clojure.string']); 42 | goog.addDependency("../figwheel/connect.js", ['figwheel.connect'], ['example.core', 'cljs.core', 'figwheel.client', 'figwheel.client.utils']); 43 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/clojure/data.cljs: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | (ns 10 | ^{:author "Stuart Halloway", 11 | :doc "Non-core data functions."} 12 | clojure.data 13 | (:require [clojure.set :as set])) 14 | 15 | (declare diff) 16 | 17 | (defn- atom-diff 18 | "Internal helper for diff." 19 | [a b] 20 | (if (= a b) [nil nil a] [a b nil])) 21 | 22 | ;; for big things a sparse vector class would be better 23 | (defn- vectorize 24 | "Convert an associative-by-numeric-index collection into 25 | an equivalent vector, with nil for any missing keys" 26 | [m] 27 | (when (seq m) 28 | (reduce 29 | (fn [result [k v]] (assoc result k v)) 30 | (vec (repeat (apply max (keys m)) nil)) 31 | m))) 32 | 33 | (defn- diff-associative-key 34 | "Diff associative things a and b, comparing only the key k." 35 | [a b k] 36 | (let [va (get a k) 37 | vb (get b k) 38 | [a* b* ab] (diff va vb) 39 | in-a (contains? a k) 40 | in-b (contains? b k) 41 | same (and in-a in-b 42 | (or (not (nil? ab)) 43 | (and (nil? va) (nil? vb))))] 44 | [(when (and in-a (or (not (nil? a*)) (not same))) {k a*}) 45 | (when (and in-b (or (not (nil? b*)) (not same))) {k b*}) 46 | (when same {k ab}) 47 | ])) 48 | 49 | (defn- diff-associative 50 | "Diff associative things a and b, comparing only keys in ks (if supplied)." 51 | ([a b] 52 | (diff-associative a b (set/union (keys a) (keys b)))) 53 | ([a b ks] 54 | (reduce 55 | (fn [diff1 diff2] 56 | (doall (map merge diff1 diff2))) 57 | [nil nil nil] 58 | (map 59 | (partial diff-associative-key a b) 60 | ks)))) 61 | 62 | (defn- diff-sequential 63 | [a b] 64 | (vec (map vectorize (diff-associative 65 | (if (vector? a) a (vec a)) 66 | (if (vector? b) b (vec b)) 67 | (range (max (count a) (count b))))))) 68 | 69 | (defn- diff-set 70 | [a b] 71 | [(not-empty (set/difference a b)) 72 | (not-empty (set/difference b a)) 73 | (not-empty (set/intersection a b))]) 74 | 75 | (defprotocol EqualityPartition 76 | "Implementation detail. Subject to change." 77 | (equality-partition [x] "Implementation detail. Subject to change.")) 78 | 79 | (defprotocol Diff 80 | "Implementation detail. Subject to change." 81 | (diff-similar [a b] "Implementation detail. Subject to change.")) 82 | 83 | (extend-protocol EqualityPartition 84 | nil 85 | (equality-partition [x] :atom) 86 | 87 | string 88 | (equality-partition [x] :atom) 89 | 90 | number 91 | (equality-partition [x] :atom) 92 | 93 | array 94 | (equality-partition [x] :sequential) 95 | 96 | function 97 | (equality-partition [x] :atom) 98 | 99 | boolean 100 | (equality-partition [x] :atom) 101 | 102 | default 103 | (equality-partition [x] 104 | (cond 105 | (satisfies? IMap x) :map 106 | (satisfies? ISet x) :set 107 | (satisfies? ISequential x) :sequential 108 | :default :atom))) 109 | 110 | (extend-protocol Diff 111 | nil 112 | (diff-similar [a b] 113 | (atom-diff a b)) 114 | 115 | string 116 | (diff-similar [a b] 117 | (atom-diff a b)) 118 | 119 | number 120 | (diff-similar [a b] 121 | (atom-diff a b)) 122 | 123 | array 124 | (diff-similar [a b] 125 | (diff-sequential a b)) 126 | 127 | function 128 | (diff-similar [a b] 129 | (atom-diff a b)) 130 | 131 | boolean 132 | (diff-similar [a b] 133 | (atom-diff a b)) 134 | 135 | default 136 | (diff-similar [a b] 137 | ((case (equality-partition a) 138 | :atom atom-diff 139 | :set diff-set 140 | :sequential diff-sequential 141 | :map diff-associative) 142 | a b))) 143 | 144 | (defn diff 145 | "Recursively compares a and b, returning a tuple of 146 | [things-only-in-a things-only-in-b things-in-both]. 147 | Comparison rules: 148 | 149 | * For equal a and b, return [nil nil a]. 150 | * Maps are subdiffed where keys match and values differ. 151 | * Sets are never subdiffed. 152 | * All sequential things are treated as associative collections 153 | by their indexes, with results returned as vectors. 154 | * Everything else (including strings!) is treated as 155 | an atom and compared for equality." 156 | [a b] 157 | (if (= a b) 158 | [nil nil a] 159 | (if (= (equality-partition a) (equality-partition b)) 160 | (diff-similar a b) 161 | (atom-diff a b)))) 162 | 163 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/clojure/set.cljs: -------------------------------------------------------------------------------- 1 | ; Copyright (c) Rich Hickey. All rights reserved. 2 | ; The use and distribution terms for this software are covered by the 3 | ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ; which can be found in the file epl-v10.html at the root of this distribution. 5 | ; By using this software in any fashion, you are agreeing to be bound by 6 | ; the terms of this license. 7 | ; You must not remove this notice, or any other, from this software. 8 | 9 | (ns ^{:doc "Set operations such as union/intersection." 10 | :author "Rich Hickey"} 11 | clojure.set) 12 | 13 | (defn- bubble-max-key [k coll] 14 | "Move a maximal element of coll according to fn k (which returns a number) 15 | to the front of coll." 16 | (let [max (apply max-key k coll)] 17 | (cons max (remove #(identical? max %) coll)))) 18 | 19 | (defn union 20 | "Return a set that is the union of the input sets" 21 | ([] #{}) 22 | ([s1] s1) 23 | ([s1 s2] 24 | (if (< (count s1) (count s2)) 25 | (reduce conj s2 s1) 26 | (reduce conj s1 s2))) 27 | ([s1 s2 & sets] 28 | (let [bubbled-sets (bubble-max-key count (conj sets s2 s1))] 29 | (reduce into (first bubbled-sets) (rest bubbled-sets))))) 30 | 31 | (defn intersection 32 | "Return a set that is the intersection of the input sets" 33 | ([s1] s1) 34 | ([s1 s2] 35 | (if (< (count s2) (count s1)) 36 | (recur s2 s1) 37 | (reduce (fn [result item] 38 | (if (contains? s2 item) 39 | result 40 | (disj result item))) 41 | s1 s1))) 42 | ([s1 s2 & sets] 43 | (let [bubbled-sets (bubble-max-key #(- (count %)) (conj sets s2 s1))] 44 | (reduce intersection (first bubbled-sets) (rest bubbled-sets))))) 45 | 46 | (defn difference 47 | "Return a set that is the first set without elements of the remaining sets" 48 | ([s1] s1) 49 | ([s1 s2] 50 | (if (< (count s1) (count s2)) 51 | (reduce (fn [result item] 52 | (if (contains? s2 item) 53 | (disj result item) 54 | result)) 55 | s1 s1) 56 | (reduce disj s1 s2))) 57 | ([s1 s2 & sets] 58 | (reduce difference s1 (conj sets s2)))) 59 | 60 | 61 | (defn select 62 | "Returns a set of the elements for which pred is true" 63 | [pred xset] 64 | (reduce (fn [s k] (if (pred k) s (disj s k))) 65 | xset xset)) 66 | 67 | (defn project 68 | "Returns a rel of the elements of xrel with only the keys in ks" 69 | [xrel ks] 70 | (set (map #(select-keys % ks) xrel))) 71 | 72 | (defn rename-keys 73 | "Returns the map with the keys in kmap renamed to the vals in kmap" 74 | [map kmap] 75 | (reduce 76 | (fn [m [old new]] 77 | (if (contains? map old) 78 | (assoc m new (get map old)) 79 | m)) 80 | (apply dissoc map (keys kmap)) kmap)) 81 | 82 | (defn rename 83 | "Returns a rel of the maps in xrel with the keys in kmap renamed to the vals in kmap" 84 | [xrel kmap] 85 | (set (map #(rename-keys % kmap) xrel))) 86 | 87 | (defn index 88 | "Returns a map of the distinct values of ks in the xrel mapped to a 89 | set of the maps in xrel with the corresponding values of ks." 90 | [xrel ks] 91 | (reduce 92 | (fn [m x] 93 | (let [ik (select-keys x ks)] 94 | (assoc m ik (conj (get m ik #{}) x)))) 95 | {} xrel)) 96 | 97 | (defn map-invert 98 | "Returns the map with the vals mapped to the keys." 99 | [m] (reduce (fn [m [k v]] (assoc m v k)) {} m)) 100 | 101 | (defn join 102 | "When passed 2 rels, returns the rel corresponding to the natural 103 | join. When passed an additional keymap, joins on the corresponding 104 | keys." 105 | ([xrel yrel] ;natural join 106 | (if (and (seq xrel) (seq yrel)) 107 | (let [ks (intersection (set (keys (first xrel))) (set (keys (first yrel)))) 108 | [r s] (if (<= (count xrel) (count yrel)) 109 | [xrel yrel] 110 | [yrel xrel]) 111 | idx (index r ks)] 112 | (reduce (fn [ret x] 113 | (let [found (idx (select-keys x ks))] 114 | (if found 115 | (reduce #(conj %1 (merge %2 x)) ret found) 116 | ret))) 117 | #{} s)) 118 | #{})) 119 | ([xrel yrel km] ;arbitrary key mapping 120 | (let [[r s k] (if (<= (count xrel) (count yrel)) 121 | [xrel yrel (map-invert km)] 122 | [yrel xrel km]) 123 | idx (index r (vals k))] 124 | (reduce (fn [ret x] 125 | (let [found (idx (rename-keys (select-keys x (keys k)) k))] 126 | (if found 127 | (reduce #(conj %1 (merge %2 x)) ret found) 128 | ret))) 129 | #{} s)))) 130 | 131 | (defn subset? 132 | "Is set1 a subset of set2?" 133 | [set1 set2] 134 | (and (<= (count set1) (count set2)) 135 | (every? #(contains? set2 %) set1))) 136 | 137 | (defn superset? 138 | "Is set1 a superset of set2?" 139 | [set1 set2] 140 | (and (>= (count set1) (count set2)) 141 | (every? #(contains? set1 %) set2))) 142 | 143 | (comment 144 | (refer 'set) 145 | (def xs #{{:a 11 :b 1 :c 1 :d 4} 146 | {:a 2 :b 12 :c 2 :d 6} 147 | {:a 3 :b 3 :c 3 :d 8 :f 42}}) 148 | 149 | (def ys #{{:a 11 :b 11 :c 11 :e 5} 150 | {:a 12 :b 11 :c 12 :e 3} 151 | {:a 3 :b 3 :c 3 :e 7 }}) 152 | 153 | (join xs ys) 154 | (join xs (rename ys {:b :yb :c :yc}) {:a :a}) 155 | 156 | (union #{:a :b :c} #{:c :d :e }) 157 | (difference #{:a :b :c} #{:c :d :e}) 158 | (intersection #{:a :b :c} #{:c :d :e}) 159 | 160 | (index ys [:b])) 161 | 162 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/clojure/string.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/clojure\/string.js","sources":["string.cljs?rel=1446435319054"],"lineCount":310,"mappings":";AAQA;;;;AAKA,6BAAA,7BAAOA,kEACJC;AADH,AAEE,iDAAA,1CAACC,2BAAOC,oCAAQF;;AAElB,AAAeG,mCACb,KAAAC,OAAA,yCAAA;AAEF;;;yBAAA,zBAAMC,0DAEHC;AAFH,OAGM,2CAAA,3CAAUA,UAAEH,jBACZ,OAAA,AAAA,yDAAA,mBAAA;;AAEN;;;;;;;yBAAA,zBAAMI,0DAMHD,EAAEE,MAAMC;AANX,AAOE,GAAM,OAASD;AACT,OAAUF,UAAE,KAAAF,uCAAA,hCAAY,AAACM,yBAAqBF,aAAYC;;AADhE,GAEM,kBAAWL,jBAAUI;AACrB,OAAUF,UAAE,KAAAF,oBAAA,bAAY,AAAUI,mBAAYC;;AAHpD,AAIY,MAAO,eAAA,qCAA2BD;;;;;AAEhD;;;;;;;+BAAA,\/BAAMG,sEAMHL,EAAEE,MAAMC;AANX,AAOE,OAAUH,UAAEE,MAAMC;;AAEpB,AAAA;;;;sBAAA,tBAAMI;AAAN,AAAA,I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BAAA,9BAAMW,oEAEHvD;AAFH,AAGE,OAACwD,wBAAoBxD;;AAEvB;;;;;;;wBAAA,xBAAMyD,wDAMHzD,EAAE0D;AANL,AAOE,IAAMC,SAAO,KAAAjD;IACPkD,SAAO,AAAU5D;AADvB,AAEE,YAAA,RAAO4C;;AAAP,AACE,GAAI,AAACtB,yBAAEsC,OAAOhB;AACZ,OAAGe;;AACH,IAAMN,KAAG,AAASrD,SAAE4C;AAApB,AACE,IAAAH,2BAAqB,AAACa,wBAAII,KAAKL;AAA\/B,AAAA,oBAAAZ;AAAA,wBAAAA,pBAAStC;AAAT,AACE,AAASwD,cAAO,eAAKxD;;AACrB,AAASwD,cAAON;;;AAClB,eAAO,SAAA,RAAKT","names":["clojure.string\/seq-reverse","coll","cljs.core\/reduce","cljs.core\/conj","clojure.string\/re-surrogate-pair","js\/RegExp","clojure.string\/reverse","s","clojure.string\/replace","match","replacement","goog.string\/regExpEscape","clojure.string\/replace-first","G__25249","clojure.string\/join","js\/Error","sb","goog\/string.StringBuffer","cljs.core\/seq","cljs.core\/first","cljs.core\/next","separator","clojure.string\/upper-case","clojure.string\/lower-case","clojure.string\/capitalize","cljs.core\/count","cljs.core\/subs","clojure.string\/pop-last-while-empty","v","cljs.core\/=","cljs.core\/peek","cljs.core\/pop","clojure.string\/discard-trailing-if-needed","limit","clojure.string\/split-with-empty-regex","cljs.core\/vec","cljs.core\/cons","cljs.core\/map","cljs.core\/str","pred__25259","expr__25260","cljs.core\/PersistentVector","c","cljs.core\/subvec","G__25263","clojure.string\/split","re","parts","temp__4124__auto__","m","cljs.core\/re-find","index","clojure.string\/split-lines","clojure.string\/trim","goog.string\/trim","clojure.string\/triml","goog.string\/trimLeft","clojure.string\/trimr","goog.string\/trimRight","clojure.string\/trim-newline","ch","cljs.core\/get","clojure.string\/blank?","goog.string\/isEmptySafe","clojure.string\/escape","cmap","buffer","length"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/core.cljs: -------------------------------------------------------------------------------- 1 | (ns example.core 2 | (:require-macros [reagent.ratom :refer [reaction]]) 3 | (:require [reagent.core :as reagent] 4 | [re-frame.core :as re-frame] 5 | [example.handlers] 6 | [example.subs] 7 | [example.views :as views])) 8 | 9 | 10 | (def whole-db-dont-use (re-frame/subscribe [:whole-db-dont-use])) 11 | 12 | (enable-console-print!) 13 | 14 | 15 | (defn mount-root [] ; [views/main-panel] 16 | (reagent/render [views/comp-with-state] 17 | (.getElementById js/document "app"))) 18 | 19 | (defn ^:export init [] 20 | (re-frame/dispatch-sync [:initialize-db]) 21 | (mount-root)) 22 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/core.cljs.cache.edn: -------------------------------------------------------------------------------- 1 | ;; Analyzed by ClojureScript 0.0-3211 2 | {:use-macros {reaction reagent.ratom}, :excludes #{}, :name example.core, :imports nil, :requires {views example.views, example.views example.views, example.subs example.subs, example.handlers example.handlers, re-frame re-frame.core, re-frame.core re-frame.core, reagent.core reagent.core, reagent reagent.core}, :uses nil, :defs {init {:protocol-inline nil, :meta {:arglists (quote ([])), :export true, :end-column 20, :end-line 19, :column 16, :line 19, :file "/home/maty/vacuumlabs/clojurescript/example/src/cljs/example/core.cljs"}, :name example.core/init, :variadic false, :file "src/cljs/example/core.cljs", :end-column 20, :method-params ([]), :protocol-impl nil, :export true, :arglists-meta (nil nil), :column 1, :line 19, :end-line 19, :max-fixed-arity 0, :fn-var true, :arglists (quote ([])), :test true}, mount-root {:protocol-inline nil, :meta {:arglists (quote ([])), :end-column 17, :end-line 15, :column 7, :line 15, :file "/home/maty/vacuumlabs/clojurescript/example/src/cljs/example/core.cljs"}, :name example.core/mount-root, :variadic false, :file "src/cljs/example/core.cljs", :end-column 17, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 15, :end-line 15, :max-fixed-arity 0, :fn-var true, :arglists (quote ([])), :test true}, whole-db-dont-use {:meta {:end-column 23, :end-line 10, :column 6, :line 10, :file "/home/maty/vacuumlabs/clojurescript/example/src/cljs/example/core.cljs"}, :file "src/cljs/example/core.cljs", :line 10, :column 1, :end-line 10, :end-column 23, :test true, :name example.core/whole-db-dont-use}}, :require-macros {reagent.ratom reagent.ratom}, :cljs.analyzer/constants {:order [:whole-db-dont-use :initialize-db], :seen #{:initialize-db :whole-db-dont-use}}, :doc nil} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/core.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-3211 {} 2 | goog.provide('example.core'); 3 | goog.require('cljs.core'); 4 | goog.require('example.views'); 5 | goog.require('example.subs'); 6 | goog.require('example.handlers'); 7 | goog.require('re_frame.core'); 8 | goog.require('reagent.core'); 9 | example.core.whole_db_dont_use = re_frame.core.subscribe.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"whole-db-dont-use","whole-db-dont-use",-963225719)], null)); 10 | cljs.core.enable_console_print_BANG_.call(null); 11 | example.core.mount_root = (function example$core$mount_root(){ 12 | return reagent.core.render.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [example.views.comp_with_state], null),document.getElementById("app")); 13 | }); 14 | example.core.init = (function example$core$init(){ 15 | re_frame.core.dispatch_sync.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"initialize-db","initialize-db",230998432)], null)); 16 | 17 | return example.core.mount_root.call(null); 18 | }); 19 | goog.exportSymbol('example.core.init', example.core.init); 20 | 21 | //# sourceMappingURL=core.js.map?rel=1446472443948 -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/core.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/example\/core.js","sources":["core.cljs?rel=1446472443948"],"lineCount":21,"mappings":";AAAA;;;;;;;AASA,AAAKA,iCAAkB,kCAAA,mFAAA,rHAACC;AAExB,AAACC;AAGD,0BAAA,1BAAMC;AAAN,AACE,qCAAA,9BAACC,iHAAgBC,sCACD,wBAAA,xBAAiBC;;AAEnC,oBAAA,pBAAeC;AAAf,AACE,sCAAA,mFAAA,zHAACC;;AACD,OAACL","names":["example.core\/whole-db-dont-use","re-frame.core\/subscribe","cljs.core\/enable-console-print!","example.core\/mount-root","reagent.core\/render","example.views\/comp-with-state","js\/document","example.core\/init","re-frame.core\/dispatch-sync"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/db.cljs: -------------------------------------------------------------------------------- 1 | (ns example.db) 2 | 3 | (def default-db 4 | {:name "re-frame" 5 | :counter 0}) 6 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/db.cljs.cache.edn: -------------------------------------------------------------------------------- 1 | ;; Analyzed by ClojureScript 0.0-3211 2 | {:use-macros nil, :excludes #{}, :name example.db, :imports nil, :requires nil, :uses nil, :defs {default-db {:meta {:end-column 16, :end-line 3, :column 6, :line 3, :file "/home/maty/vacuumlabs/clojurescript/example/src/cljs/example/db.cljs"}, :file "src/cljs/example/db.cljs", :line 3, :column 1, :end-line 3, :end-column 16, :test true, :name example.db/default-db}}, :require-macros nil, :cljs.analyzer/constants {:order [:name :counter], :seen #{:name :counter}}, :doc nil} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/db.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-3211 {} 2 | goog.provide('example.db'); 3 | goog.require('cljs.core'); 4 | example.db.default_db = new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"re-frame",new cljs.core.Keyword(null,"counter","counter",804008177),(0)], null); 5 | 6 | //# sourceMappingURL=db.js.map?rel=1446471267603 -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/db.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/example\/db.js","sources":["db.cljs?rel=1446471267603"],"lineCount":6,"mappings":";AAAA;;AAEA,wBAAA,2CAAA,qDAAA,WAAA,0DAAA,7LAAKA","names":["example.db\/default-db"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/handlers.cljs: -------------------------------------------------------------------------------- 1 | (ns example.handlers 2 | (:require [re-frame.core :as re-frame] 3 | [example.db :as db])) 4 | 5 | 6 | [:action-type arguments] 7 | 8 | (re-frame/register-handler 9 | :initialize-db 10 | (fn [db [type args]] 11 | db/default-db)) 12 | 13 | 14 | 15 | (re-frame/register-handler 16 | :inc-counter-by 17 | (fn [db [_ by]] 18 | (update-in db [:counter] + by))) 19 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/handlers.cljs.cache.edn: -------------------------------------------------------------------------------- 1 | ;; Analyzed by ClojureScript 0.0-3211 2 | {:use-macros nil, :excludes #{}, :name example.handlers, :imports nil, :requires {db example.db, example.db example.db, re-frame.core re-frame.core, re-frame re-frame.core}, :uses nil, :require-macros nil, :cljs.analyzer/constants {:order [:initialize-db :action-type :inc-counter-by :counter], :seen #{:initialize-db :inc-counter-by :counter :action-type}}, :doc nil} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/handlers.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-3211 {} 2 | goog.provide('example.handlers'); 3 | goog.require('cljs.core'); 4 | goog.require('example.db'); 5 | goog.require('re_frame.core'); 6 | new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"action-type","action-type",-1141667361),example.handlers.arguments], null); 7 | re_frame.core.register_handler.call(null,new cljs.core.Keyword(null,"initialize-db","initialize-db",230998432),(function (db,p__21497){ 8 | var vec__21498 = p__21497; 9 | var type = cljs.core.nth.call(null,vec__21498,(0),null); 10 | var args = cljs.core.nth.call(null,vec__21498,(1),null); 11 | return example.db.default_db; 12 | })); 13 | re_frame.core.register_handler.call(null,new cljs.core.Keyword(null,"inc-counter-by","inc-counter-by",-851838045),(function (db,p__21499){ 14 | var vec__21500 = p__21499; 15 | var _ = cljs.core.nth.call(null,vec__21500,(0),null); 16 | var by = cljs.core.nth.call(null,vec__21500,(1),null); 17 | return cljs.core.update_in.call(null,db,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"counter","counter",804008177)], null),cljs.core._PLUS_,by); 18 | })); 19 | 20 | //# sourceMappingURL=handlers.js.map?rel=1446471602006 -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/handlers.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/example\/handlers.js","sources":["handlers.cljs?rel=1446471602007"],"lineCount":20,"mappings":";AAAA;;;;uJAKcA;AAEd,yCAAA,zCAACC,+GAEA,cAAAC,HAAMG;AAAN,AAAA,IAAAF,aAAAD;WAAA,AAAAE,wBAAAD,WAAA,IAAA,9CAAUG;WAAV,AAAAF,wBAAAD,WAAA,IAAA,9CAAeI;AAAf,AACEC;;AAIH,yCAAA,zCAACP,kHAEA,cAAAQ,HAAMJ;AAAN,AAAA,IAAAK,aAAAD;QAAA,AAAAL,wBAAAM,WAAA,IAAA,3CAAUC;SAAV,AAAAP,wBAAAM,WAAA,IAAA,5CAAYE;AAAZ,AACE,wCAAA,mFAAA,pHAACC,8BAAUR,wJAAcS,iBAAEF","names":["example.handlers\/arguments","re-frame.core\/register-handler","p__21497","vec__21498","cljs.core\/nth","db","type","args","example.db\/default-db","p__21499","vec__21500","_","by","cljs.core\/update-in","cljs.core\/+"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/subs.cljs: -------------------------------------------------------------------------------- 1 | (ns example.subs 2 | (:require-macros [reagent.ratom :refer [reaction]]) 3 | (:require [re-frame.core :as re-frame])) 4 | 5 | (re-frame/register-sub 6 | :name 7 | (fn [db] 8 | (reaction (:name @db)))) 9 | 10 | 11 | (re-frame/register-sub 12 | :counter 13 | (fn [db] 14 | (reaction (:counter @db)))) 15 | 16 | (re-frame/register-sub 17 | :whole-db-dont-use 18 | (fn [db] 19 | db)) 20 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/subs.cljs.cache.edn: -------------------------------------------------------------------------------- 1 | ;; Analyzed by ClojureScript 0.0-3211 2 | {:use-macros {reaction reagent.ratom}, :excludes #{}, :name example.subs, :imports nil, :requires {re-frame.core re-frame.core, re-frame re-frame.core}, :uses nil, :require-macros {reagent.ratom reagent.ratom}, :cljs.analyzer/constants {:order [:name :counter :whole-db-dont-use], :seen #{:name :whole-db-dont-use :counter}}, :doc nil} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/subs.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-3211 {} 2 | goog.provide('example.subs'); 3 | goog.require('cljs.core'); 4 | goog.require('re_frame.core'); 5 | re_frame.core.register_sub.call(null,new cljs.core.Keyword(null,"name","name",1843675177),(function (db){ 6 | return reagent.ratom.make_reaction.call(null,(function (){ 7 | return new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,db)); 8 | })); 9 | })); 10 | re_frame.core.register_sub.call(null,new cljs.core.Keyword(null,"counter","counter",804008177),(function (db){ 11 | return reagent.ratom.make_reaction.call(null,(function (){ 12 | return new cljs.core.Keyword(null,"counter","counter",804008177).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,db)); 13 | })); 14 | })); 15 | re_frame.core.register_sub.call(null,new cljs.core.Keyword(null,"whole-db-dont-use","whole-db-dont-use",-963225719),(function (db){ 16 | return db; 17 | })); 18 | 19 | //# sourceMappingURL=subs.js.map?rel=1446472397398 -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/subs.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/example\/subs.js","sources":["subs.cljs?rel=1446472397398"],"lineCount":19,"mappings":";AAAA;;;AAIA,qCAAA,rCAACA,0FAEA,WAAKC;AAAL,AACE,OAAAC,sCAAA;AAAA,AAAU,OAAA,mFAAA,AAAAC,0BAAQF;;;AAGrB,qCAAA,rCAACD,+FAEA,WAAKC;AAAL,AACE,OAAAC,sCAAA;AAAA,AAAU,OAAA,wFAAA,AAAAC,0BAAWF;;;AAExB,qCAAA,rCAACD,oHAEA,WAAKC;AAAL,AACEA","names":["re-frame.core\/register-sub","db","reagent.ratom\/make-reaction","cljs.core\/deref"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/views.cljs: -------------------------------------------------------------------------------- 1 | (ns example.views 2 | (:require [re-frame.core :as re-frame])) 3 | 4 | (defn main-panel [] 5 | (let [name (re-frame/subscribe [:name])] 6 | (fn [] 7 | [:div "Hello from " @name]))) 8 | 9 | 10 | (defn counter [state-from-props] 11 | [:div "Value of counter is:" state-from-props]) 12 | 13 | 14 | (defn my-first-component [{:keys [name address]}] 15 | [:div "This is my component " name address]) 16 | 17 | 18 | (defn comp-with-state [] 19 | (let [counter (re-frame/subscribe [:counter])] 20 | (fn [] 21 | [:div 22 | "With local state Value of counter is:" @counter 23 | [:button {:on-click #(re-frame/dispatch [:inc-counter-by 1])} "inc by 1"] 24 | [:button {:on-click #(re-frame/dispatch [:inc-counter-by 2])} "inc by 2"] 25 | ]))) 26 | 27 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/views.cljs.cache.edn: -------------------------------------------------------------------------------- 1 | ;; Analyzed by ClojureScript 0.0-3211 2 | {:use-macros nil, :excludes #{}, :name example.views, :imports nil, :requires {re-frame.core re-frame.core, re-frame re-frame.core}, :uses nil, :defs {comp-with-state {:protocol-inline nil, :meta {:arglists (quote ([])), :end-column 22, :end-line 18, :column 7, :line 18, :file "/home/maty/vacuumlabs/clojurescript/example/src/cljs/example/views.cljs"}, :name example.views/comp-with-state, :variadic false, :file "src/cljs/example/views.cljs", :end-column 22, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 18, :end-line 18, :max-fixed-arity 0, :fn-var true, :arglists (quote ([])), :test true}, my-first-component {:protocol-inline nil, :meta {:arglists (quote ([{:keys [name address]}])), :end-column 25, :end-line 14, :column 7, :line 14, :file "/home/maty/vacuumlabs/clojurescript/example/src/cljs/example/views.cljs"}, :name example.views/my-first-component, :variadic false, :file "src/cljs/example/views.cljs", :end-column 25, :method-params ([p__21520]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 14, :end-line 14, :max-fixed-arity 1, :fn-var true, :arglists (quote ([{:keys [name address]}])), :test true}, counter {:protocol-inline nil, :meta {:arglists (quote ([state-from-props])), :end-column 14, :end-line 10, :column 7, :line 10, :file "/home/maty/vacuumlabs/clojurescript/example/src/cljs/example/views.cljs"}, :name example.views/counter, :variadic false, :file "src/cljs/example/views.cljs", :end-column 14, :method-params ([state-from-props]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 10, :end-line 10, :max-fixed-arity 1, :fn-var true, :arglists (quote ([state-from-props])), :test true}, main-panel {:protocol-inline nil, :meta {:arglists (quote ([])), :end-column 17, :end-line 4, :column 7, :line 4, :file "/home/maty/vacuumlabs/clojurescript/example/src/cljs/example/views.cljs"}, :name example.views/main-panel, :variadic false, :file "src/cljs/example/views.cljs", :end-column 17, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 4, :end-line 4, :max-fixed-arity 0, :fn-var true, :arglists (quote ([])), :test true}}, :require-macros nil, :cljs.analyzer/constants {:order [:name :div :address :counter :button :on-click :inc-counter-by], :seen #{:address :inc-counter-by :button :name :on-click :div :counter}}, :doc nil} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/views.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-3211 {} 2 | goog.provide('example.views'); 3 | goog.require('cljs.core'); 4 | goog.require('re_frame.core'); 5 | example.views.main_panel = (function example$views$main_panel(){ 6 | var name = re_frame.core.subscribe.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"name","name",1843675177)], null)); 7 | return ((function (name){ 8 | return (function (){ 9 | return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),"Hello from ",cljs.core.deref.call(null,name)], null); 10 | }); 11 | ;})(name)) 12 | }); 13 | example.views.counter = (function example$views$counter(state_from_props){ 14 | return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),"Value of counter is:",state_from_props], null); 15 | }); 16 | example.views.my_first_component = (function example$views$my_first_component(p__21520){ 17 | var map__21522 = p__21520; 18 | var map__21522__$1 = ((cljs.core.seq_QMARK_.call(null,map__21522))?cljs.core.apply.call(null,cljs.core.hash_map,map__21522):map__21522); 19 | var address = cljs.core.get.call(null,map__21522__$1,new cljs.core.Keyword(null,"address","address",559499426)); 20 | var name = cljs.core.get.call(null,map__21522__$1,new cljs.core.Keyword(null,"name","name",1843675177)); 21 | return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),"This is my component ",name,address], null); 22 | }); 23 | example.views.comp_with_state = (function example$views$comp_with_state(){ 24 | var counter = re_frame.core.subscribe.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"counter","counter",804008177)], null)); 25 | return ((function (counter){ 26 | return (function (){ 27 | return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),"With local state Value of counter is:",cljs.core.deref.call(null,counter),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button","button",1456579943),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (counter){ 28 | return (function (){ 29 | return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"inc-counter-by","inc-counter-by",-851838045),(1)], null)); 30 | });})(counter)) 31 | ], null),"inc by 1"], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button","button",1456579943),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (counter){ 32 | return (function (){ 33 | return re_frame.core.dispatch.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"inc-counter-by","inc-counter-by",-851838045),(2)], null)); 34 | });})(counter)) 35 | ], null),"inc by 2"], null)], null); 36 | }); 37 | ;})(counter)) 38 | }); 39 | 40 | //# sourceMappingURL=views.js.map?rel=1446471764053 -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/example/views.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/example\/views.js","sources":["views.cljs?rel=1446471764053"],"lineCount":40,"mappings":";AAAA;;;AAGA,2BAAA,3BAAMA;AAAN,AACE,IAAMC,OAAK,kCAAA,mFAAA,rHAACC;AAAZ,AACE;;AAAA,AAAA,0FAAA,mDAAA,cAAA,AAAAC,0BACuBF;;;;AAG3B,wBAAA,xBAAMG,wDAASC;AAAf,AAAA,0FAAA,mDAAA,uBAC+BA;;AAG\/B,mCAAA,2CAAAC,9EAAMM;AAAN,AAAA,IAAAL,aAAAD;IAAAC,iBAAA,EAAA,AAAAC,+BAAAD,aAAA,AAAAE,0BAAAC,mBAAAH,YAAAA;cAAA,AAAAI,wBAAAJ,eAAA,jDAAuCM;WAAvC,AAAAF,wBAAAJ,eAAA,9CAAkCN;AAAlC,AAAA,0FAAA,mDAAA,wBACgCA,KAAKY;;AAGrC,gCAAA,hCAAMC;AAAN,AACE,IAAMC,UAAQ,kCAAA,mFAAA,rHAACb;AAAf,AACE;;AAAA,AAAA,0FAAA,mDAAA,wCAAA,AAAAC,mCAAA,mFAAA,yDAAA,2CAAA,6DAAA,7PAE6CY;;AAF7C,AAGwB,wCAAA,mFAAA,yEAAA,7LAACC;;SAHzB,mBAAA,mFAAA,yDAAA,2CAAA,6DAAA;;AAAA,AAIwB,wCAAA,mFAAA,yEAAA,7LAACA;;SAJzB","names":["example.views\/main-panel","name","re-frame.core\/subscribe","cljs.core\/deref","example.views\/counter","state-from-props","p__21520","map__21522","cljs.core\/seq?","cljs.core\/apply","cljs.core\/hash-map","cljs.core\/get","example.views\/my-first-component","address","example.views\/comp-with-state","counter","re-frame.core\/dispatch"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/figwheel/client/socket.cljs: -------------------------------------------------------------------------------- 1 | (ns figwheel.client.socket 2 | (:require 3 | [figwheel.client.utils :as utils] 4 | [cljs.reader :refer [read-string]])) 5 | 6 | (defn get-websocket-imp [] 7 | (cond 8 | (utils/html-env?) (aget js/window "WebSocket") 9 | (utils/node-env?) (try (js/require "ws") 10 | (catch js/Error e 11 | nil)) 12 | :else nil)) 13 | 14 | ;; messages have the following formats 15 | 16 | ;; files-changed message 17 | ;; { :msg-name :files-changed 18 | ;; :files [{:file "/js/compiled/out/example/core.js", 19 | ;; :type :javascript, 20 | ;; :msg-name :file-changed, 21 | ;; :namespace "example.core" }] } 22 | 23 | ;; css-files-changed message 24 | ;; there should really only be one file in here at a time 25 | ;; { :msg-name :css-files-changed 26 | ;; :files [{:file "/css/example.css", 27 | ;; :type :css }] } 28 | 29 | ;; compile-failed message 30 | ;; { :msg-name :compile-failed 31 | ;; :exception-data {:cause { ... lots of exception info ... } }} 32 | ;; the exception data is nested raw info obtained for the compile time 33 | ;; exception 34 | 35 | (defonce message-history-atom (atom (list))) 36 | 37 | (defonce socket-atom (atom false)) 38 | 39 | (defn send! 40 | "Send a end message to the server." 41 | [msg] 42 | (when @socket-atom 43 | (.send @socket-atom (pr-str msg)))) 44 | 45 | (defn close! [] 46 | (set! (.-onclose @socket-atom) identity) 47 | (.close @socket-atom)) 48 | 49 | (defn open [{:keys [retry-count retried-count websocket-url build-id] :as opts}] 50 | (if-let [WebSocket (get-websocket-imp)] 51 | (do 52 | (utils/log :debug "Figwheel: trying to open cljs reload socket") 53 | (let [url (str websocket-url (if build-id (str "/" build-id) "")) 54 | socket (WebSocket. url)] 55 | (set! (.-onmessage socket) (fn [msg-str] 56 | (when-let [msg (read-string (.-data msg-str))] 57 | (utils/debug-prn msg) 58 | (and (map? msg) 59 | (:msg-name msg) 60 | ;; don't forward pings 61 | (not= (:msg-name msg) :ping) 62 | (swap! message-history-atom 63 | conj msg))))) 64 | (set! (.-onopen socket) (fn [x] 65 | (reset! socket-atom socket) 66 | (utils/log :debug "Figwheel: socket connection established"))) 67 | (set! (.-onclose socket) (fn [x] 68 | (let [retried-count (or retried-count 0)] 69 | (utils/debug-prn "Figwheel: socket closed or failed to open") 70 | (when (> retry-count retried-count) 71 | (js/setTimeout 72 | (fn [] 73 | (open 74 | (assoc opts :retried-count (inc retried-count)))) 75 | ;; linear back off 76 | (min 10000 (+ 2000 (* 500 retried-count)))))))) 77 | (set! (.-onerror socket) (fn [x] (utils/debug-prn "Figwheel: socket error "))) 78 | socket)) 79 | (utils/log :debug 80 | (if (utils/node-env?) 81 | "Figwheel: Can't start Figwheel!! Please make sure ws is installed\n do -> 'npm install ws'" 82 | "Figwheel: Can't start Figwheel!! This browser doesn't support WebSockets")))) 83 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/figwheel/client/socket.cljs.cache.edn: -------------------------------------------------------------------------------- 1 | ;; Analyzed by ClojureScript 0.0-3211 2 | {:use-macros nil, :excludes #{}, :name figwheel.client.socket, :imports nil, :requires {cljs.reader cljs.reader, figwheel.client.utils figwheel.client.utils, utils figwheel.client.utils}, :uses {read-string cljs.reader}, :defs {open {:protocol-inline nil, :meta {:arglists (quote ([{:keys [retry-count retried-count websocket-url build-id], :as opts}])), :end-column 11, :end-line 49, :column 7, :line 49, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/figwheel/client/socket.cljs"}, :name figwheel.client.socket/open, :variadic false, :file "resources/public/js/compiled/out/figwheel/client/socket.cljs", :end-column 11, :method-params ([p__29026]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 49, :end-line 49, :max-fixed-arity 1, :fn-var true, :arglists (quote ([{:keys [retry-count retried-count websocket-url build-id], :as opts}])), :test true}, close! {:protocol-inline nil, :meta {:arglists (quote ([])), :end-column 13, :end-line 45, :column 7, :line 45, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/figwheel/client/socket.cljs"}, :name figwheel.client.socket/close!, :variadic false, :file "resources/public/js/compiled/out/figwheel/client/socket.cljs", :end-column 13, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 45, :end-line 45, :max-fixed-arity 0, :fn-var true, :arglists (quote ([])), :test true}, send! {:protocol-inline nil, :meta {:arglists (quote ([msg])), :doc "Send a end message to the server.", :end-column 12, :end-line 39, :column 7, :line 39, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/figwheel/client/socket.cljs"}, :name figwheel.client.socket/send!, :variadic false, :file "resources/public/js/compiled/out/figwheel/client/socket.cljs", :end-column 12, :method-params ([msg]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 39, :end-line 39, :max-fixed-arity 1, :fn-var true, :arglists (quote ([msg])), :doc "Send a end message to the server.", :test true}, socket-atom {:meta {:end-column 21, :end-line 37, :column 10, :line 37, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/figwheel/client/socket.cljs"}, :file "resources/public/js/compiled/out/figwheel/client/socket.cljs", :line 37, :column 1, :end-line 37, :end-column 21, :test true, :name figwheel.client.socket/socket-atom}, message-history-atom {:meta {:end-column 30, :end-line 35, :column 10, :line 35, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/figwheel/client/socket.cljs"}, :file "resources/public/js/compiled/out/figwheel/client/socket.cljs", :line 35, :column 1, :end-line 35, :end-column 30, :test true, :name figwheel.client.socket/message-history-atom}, get-websocket-imp {:protocol-inline nil, :meta {:arglists (quote ([])), :end-column 24, :end-line 6, :column 7, :line 6, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/figwheel/client/socket.cljs"}, :name figwheel.client.socket/get-websocket-imp, :variadic false, :file "resources/public/js/compiled/out/figwheel/client/socket.cljs", :end-column 24, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 6, :end-line 6, :max-fixed-arity 0, :fn-var true, :arglists (quote ([])), :test true}}, :require-macros nil, :cljs.analyzer/constants {:order [:else :build-id :websocket-url :retried-count :retry-count :debug :msg-name :ping], :seen #{:ping :retried-count :else :debug :build-id :websocket-url :msg-name :retry-count}}, :doc nil} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/figwheel/client/socket.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/figwheel\/client\/socket.js","sources":["socket.cljs?rel=1446435322140"],"lineCount":138,"mappings":";AAAA;;;;AAKA,2CAAA,3CAAMA;AAAN,AACE,oBACE,AAACC;AAAiB,eAAA,PAAMC;;AAD1B,oBAEE,AAACC;AAAiB,IAAA,AAAK,eAAA,RAACE;gBAAN,GAAA,CAAAD,kBACYE;AADZ,QAAAF,JACqBG;AADrB,AAAA;;AAAA,AAAA,MAAAH;;;;AAFpB,AAAA;;;;;AA4BF,GAAA,OAASI;AAAT;AAAA,AAAA,AAASA,8CAAqB,AAACC,yBA0qDxB,AAAA0C;;AAxqDP,GAAA,OAASzC;AAAT;AAAA,AAAA,AAAS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AM,AAAUL,gBAAS;kBAAKU;AAAL,AACE,AAACC,gCAAOlC,mCAAYuB;;AACpB,2CAAA,wDAAA,5FAACF;;;;AAC5B,AAAM,AAAWE,iBAAQ;kBAAKU;AAAL,AACE,IAAMlB,oBAAc,iBAAAoB,oBAAIpB;AAAJ,AAAA,oBAAAoB;AAAAA;;AAAA;;;AAApB,AACE,0CAAA,1CAACR;;AACD,GAAM,CAAGb,cAAYC;AAArB,AACE,OAACqB,WACA;;AAAA,AACE,OAACC,sCACA,+BAAA,\/BAACC,0BAAMpB,6EAAoB,qBAAA,pBAAKH;;CAEnC,iBAAAwB,mBAAA;IAAAC,mBAAW,CAAA,SAAQ,CAAA,QAAOzB;AAA1B,AAAA,SAAAwB,mBAAAC,oBAAAD,mBAAAC;;;AANH;;;;;AAO7B,AAAM,AAAWjB,iBAAQ;kBAAKU;AAAL,AAAQ,iDAAA,1CAACN;;;;AAClCJ;;AACJ,2CAAA,pCAACF,4FACU,oEAAA,6FAAA,\/IAAI,AAAC5B","names":["figwheel.client.socket\/get-websocket-imp","figwheel.client.utils\/html-env?","js\/window","figwheel.client.utils\/node-env?","e29025","js\/require","js\/Error","e","figwheel.client.socket\/message-history-atom","cljs.core\/atom","figwheel.client.socket\/socket-atom","figwheel.client.socket\/send!","msg","cljs.core\/deref","cljs.core\/pr-str","figwheel.client.socket\/close!","cljs.core\/identity","p__29026","map__29028","cljs.core\/seq?","cljs.core\/apply","cljs.core\/hash-map","cljs.core\/get","figwheel.client.socket\/open","retry-count","retried-count","websocket-url","build-id","opts","temp__4124__auto__","WebSocket","figwheel.client.utils\/log","url","socket","msg-str","temp__4126__auto__","cljs.reader\/read-string","figwheel.client.utils\/debug-prn","and__18148__auto__","cljs.core\/map?","cljs.core\/not=","cljs.core\/swap!","cljs.core\/conj","x","cljs.core\/reset!","or__18160__auto__","js\/setTimeout","open","cljs.core\/assoc","x__18479__auto__","y__18480__auto__","cljs.core\/List"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/figwheel/client/utils.cljs: -------------------------------------------------------------------------------- 1 | (ns ^:figwheel-no-load figwheel.client.utils 2 | (:require [clojure.string :as string]) 3 | (:import [goog])) 4 | 5 | ;; don't auto reload this file it will mess up the debug printing 6 | 7 | (def ^:dynamic *print-debug* false) 8 | 9 | (defn html-env? [] (goog/inHtmlDocument_)) 10 | 11 | (defn node-env? [] (not (nil? goog/nodeGlobalRequire))) 12 | 13 | (defn base-url-path [] (string/replace goog/basePath #"(.*)goog/" #(str %2))) 14 | 15 | (defn host-env? [] 16 | (cond 17 | (html-env?) :html 18 | (node-env?) :node 19 | :else :html)) 20 | 21 | (defn dispatch-custom-event [event-name data] 22 | (when (and (html-env?) (aget js/window "CustomEvent")) 23 | (.dispatchEvent (.-body js/document) 24 | (js/CustomEvent. event-name 25 | (js-obj "detail" data))))) 26 | 27 | (defn debug-prn [o] 28 | (when *print-debug* 29 | (let [o (if (or (map? o) 30 | (seq? o)) 31 | (prn-str o) 32 | o)] 33 | (.log js/console o)))) 34 | 35 | (defn log 36 | ([x] (log :info x)) 37 | ([level arg] 38 | (let [f (condp = (if (html-env?) level :info) 39 | :warn #(.warn js/console %) 40 | :debug #(.debug js/console %) 41 | :error #(.error js/console %) 42 | #(.log js/console %))] 43 | (f arg)))) 44 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/figwheel/client/utils.cljs.cache.edn: -------------------------------------------------------------------------------- 1 | ;; Analyzed by ClojureScript 0.0-3211 2 | {:use-macros nil, :excludes #{}, :name figwheel.client.utils, :imports {}, :requires {clojure.string clojure.string, string clojure.string}, :uses nil, :defs {log {:protocol-inline nil, :meta {:top-fn {:variadic false, :max-fixed-arity 2, :method-params ([x] [level arg]), :arglists ([x] [level arg]), :arglists-meta (nil nil)}, :arglists (quote ([x] [level arg])), :end-column 10, :end-line 35, :column 7, :line 35, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/figwheel/client/utils.cljs"}, :name figwheel.client.utils/log, :variadic false, :file "resources/public/js/compiled/out/figwheel/client/utils.cljs", :end-column 10, :top-fn {:variadic false, :max-fixed-arity 2, :method-params ([x] [level arg]), :arglists ([x] [level arg]), :arglists-meta (nil nil)}, :method-params ([x] [level arg]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 35, :end-line 35, :max-fixed-arity 2, :fn-var true, :arglists ([x] [level arg]), :test true}, debug-prn {:protocol-inline nil, :meta {:arglists (quote ([o])), :end-column 16, :end-line 27, :column 7, :line 27, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/figwheel/client/utils.cljs"}, :name figwheel.client.utils/debug-prn, :variadic false, :file "resources/public/js/compiled/out/figwheel/client/utils.cljs", :end-column 16, :method-params ([o]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 27, :end-line 27, :max-fixed-arity 1, :fn-var true, :arglists (quote ([o])), :test true}, dispatch-custom-event {:protocol-inline nil, :meta {:arglists (quote ([event-name data])), :end-column 28, :end-line 21, :column 7, :line 21, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/figwheel/client/utils.cljs"}, :name figwheel.client.utils/dispatch-custom-event, :variadic false, :file "resources/public/js/compiled/out/figwheel/client/utils.cljs", :end-column 28, :method-params ([event-name data]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 21, :end-line 21, :max-fixed-arity 2, :fn-var true, :arglists (quote ([event-name data])), :test true}, host-env? {:protocol-inline nil, :meta {:arglists (quote ([])), :end-column 16, :end-line 15, :column 7, :line 15, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/figwheel/client/utils.cljs"}, :name figwheel.client.utils/host-env?, :variadic false, :file "resources/public/js/compiled/out/figwheel/client/utils.cljs", :end-column 16, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 15, :end-line 15, :max-fixed-arity 0, :fn-var true, :arglists (quote ([])), :test true}, base-url-path {:protocol-inline nil, :meta {:arglists (quote ([])), :end-column 20, :end-line 13, :column 7, :line 13, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/figwheel/client/utils.cljs"}, :name figwheel.client.utils/base-url-path, :variadic false, :file "resources/public/js/compiled/out/figwheel/client/utils.cljs", :end-column 20, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 13, :end-line 13, :max-fixed-arity 0, :fn-var true, :arglists (quote ([])), :test true}, node-env? {:protocol-inline nil, :meta {:arglists (quote ([])), :end-column 16, :end-line 11, :column 7, :line 11, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/figwheel/client/utils.cljs"}, :name figwheel.client.utils/node-env?, :variadic false, :file "resources/public/js/compiled/out/figwheel/client/utils.cljs", :end-column 16, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 11, :end-line 11, :max-fixed-arity 0, :fn-var true, :arglists (quote ([])), :test true}, html-env? {:protocol-inline nil, :meta {:arglists (quote ([])), :end-column 16, :end-line 9, :column 7, :line 9, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/figwheel/client/utils.cljs"}, :name figwheel.client.utils/html-env?, :variadic false, :file "resources/public/js/compiled/out/figwheel/client/utils.cljs", :end-column 16, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 9, :end-line 9, :max-fixed-arity 0, :fn-var true, :arglists (quote ([])), :test true}, *print-debug* {:meta {:dynamic true, :end-column 29, :end-line 7, :column 16, :line 7, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/figwheel/client/utils.cljs"}, :file "resources/public/js/compiled/out/figwheel/client/utils.cljs", :line 7, :column 1, :end-line 7, :end-column 29, :dynamic true, :test true, :name figwheel.client.utils/*print-debug*}}, :require-macros nil, :cljs.analyzer/constants {:order [:html :node :else :info :warn :debug :error], :seen #{:else :warn :debug :node :info :error :html}}, :doc nil} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/figwheel/client/utils.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-3211 {} 2 | goog.provide('figwheel.client.utils'); 3 | goog.require('cljs.core'); 4 | goog.require('clojure.string'); 5 | figwheel.client.utils._STAR_print_debug_STAR_ = false; 6 | figwheel.client.utils.html_env_QMARK_ = (function figwheel$client$utils$html_env_QMARK_(){ 7 | return goog.inHtmlDocument_(); 8 | }); 9 | figwheel.client.utils.node_env_QMARK_ = (function figwheel$client$utils$node_env_QMARK_(){ 10 | return !((goog.nodeGlobalRequire == null)); 11 | }); 12 | figwheel.client.utils.base_url_path = (function figwheel$client$utils$base_url_path(){ 13 | return clojure.string.replace.call(null,goog.basePath,/(.*)goog\//,(function (p1__28367_SHARP_,p2__28366_SHARP_){ 14 | return [cljs.core.str(p2__28366_SHARP_)].join(''); 15 | })); 16 | }); 17 | figwheel.client.utils.host_env_QMARK_ = (function figwheel$client$utils$host_env_QMARK_(){ 18 | if(cljs.core.truth_(figwheel.client.utils.html_env_QMARK_.call(null))){ 19 | return new cljs.core.Keyword(null,"html","html",-998796897); 20 | } else { 21 | if(cljs.core.truth_(figwheel.client.utils.node_env_QMARK_.call(null))){ 22 | return new cljs.core.Keyword(null,"node","node",581201198); 23 | } else { 24 | return new cljs.core.Keyword(null,"html","html",-998796897); 25 | 26 | } 27 | } 28 | }); 29 | figwheel.client.utils.dispatch_custom_event = (function figwheel$client$utils$dispatch_custom_event(event_name,data){ 30 | if(cljs.core.truth_((function (){var and__18148__auto__ = figwheel.client.utils.html_env_QMARK_.call(null); 31 | if(cljs.core.truth_(and__18148__auto__)){ 32 | return (window["CustomEvent"]); 33 | } else { 34 | return and__18148__auto__; 35 | } 36 | })())){ 37 | return document.body.dispatchEvent((new CustomEvent(event_name,(function (){var obj28371 = {"detail":data}; 38 | return obj28371; 39 | })()))); 40 | } else { 41 | return null; 42 | } 43 | }); 44 | figwheel.client.utils.debug_prn = (function figwheel$client$utils$debug_prn(o){ 45 | if(cljs.core.truth_(figwheel.client.utils._STAR_print_debug_STAR_)){ 46 | var o__$1 = (((cljs.core.map_QMARK_.call(null,o)) || (cljs.core.seq_QMARK_.call(null,o)))?cljs.core.prn_str.call(null,o):o); 47 | return console.log(o__$1); 48 | } else { 49 | return null; 50 | } 51 | }); 52 | figwheel.client.utils.log = (function figwheel$client$utils$log(){ 53 | var G__28377 = arguments.length; 54 | switch (G__28377) { 55 | case 1: 56 | return figwheel.client.utils.log.cljs$core$IFn$_invoke$arity$1((arguments[(0)])); 57 | 58 | break; 59 | case 2: 60 | return figwheel.client.utils.log.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)])); 61 | 62 | break; 63 | default: 64 | throw (new Error([cljs.core.str("Invalid arity: "),cljs.core.str(arguments.length)].join(''))); 65 | 66 | } 67 | }); 68 | 69 | figwheel.client.utils.log.cljs$core$IFn$_invoke$arity$1 = (function (x){ 70 | return figwheel.client.utils.log.call(null,new cljs.core.Keyword(null,"info","info",-317069002),x); 71 | }); 72 | 73 | figwheel.client.utils.log.cljs$core$IFn$_invoke$arity$2 = (function (level,arg){ 74 | var f = (function (){var pred__28378 = cljs.core._EQ_; 75 | var expr__28379 = (cljs.core.truth_(figwheel.client.utils.html_env_QMARK_.call(null))?level:new cljs.core.Keyword(null,"info","info",-317069002)); 76 | if(cljs.core.truth_(pred__28378.call(null,new cljs.core.Keyword(null,"warn","warn",-436710552),expr__28379))){ 77 | return ((function (pred__28378,expr__28379){ 78 | return (function (p1__28372_SHARP_){ 79 | return console.warn(p1__28372_SHARP_); 80 | }); 81 | ;})(pred__28378,expr__28379)) 82 | } else { 83 | if(cljs.core.truth_(pred__28378.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),expr__28379))){ 84 | return ((function (pred__28378,expr__28379){ 85 | return (function (p1__28373_SHARP_){ 86 | return console.debug(p1__28373_SHARP_); 87 | }); 88 | ;})(pred__28378,expr__28379)) 89 | } else { 90 | if(cljs.core.truth_(pred__28378.call(null,new cljs.core.Keyword(null,"error","error",-978969032),expr__28379))){ 91 | return ((function (pred__28378,expr__28379){ 92 | return (function (p1__28374_SHARP_){ 93 | return console.error(p1__28374_SHARP_); 94 | }); 95 | ;})(pred__28378,expr__28379)) 96 | } else { 97 | return ((function (pred__28378,expr__28379){ 98 | return (function (p1__28375_SHARP_){ 99 | return console.log(p1__28375_SHARP_); 100 | }); 101 | ;})(pred__28378,expr__28379)) 102 | } 103 | } 104 | } 105 | })(); 106 | return f.call(null,arg); 107 | }); 108 | 109 | figwheel.client.utils.log.cljs$lang$maxFixedArity = 2; 110 | 111 | //# sourceMappingURL=utils.js.map?rel=1446435321676 -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/figwheel/client/utils.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/figwheel\/client\/utils.js","sources":["utils.cljs?rel=1446435321676"],"lineCount":111,"mappings":";AAAA;;;AAMA,gDAAA,hDAAeA;AAEf,wCAAA,xCAAMC;AAAN,AAAmB,OAACC;;AAEpB,wCAAA,xCAAMC;AAAN,AAAmB,SAAK,2BAAA,1BAAMC;;AAE9B,sCAAA,tCAAMC;AAAN,AAAuB,sDAAA,aAAA,WAAAC,iBAAAC,xFAACC,iCAAeC;AAAhB,AAA4C,sBAAAF;;;AAEnE,wCAAA,xCAAMG;AAAN,AACE,oBACE,AAACT;AADH;;AAAA,oBAEE,AAACE;AAFH;;AAAA,AAAA;;;;;AAKF,8CAAA,9CAAMQ,oGAAuBC,WAAWC;AAAxC,AACE,oBAAM,iBAAAC,qBAAK,AAACb;AAAN,AAAA,oBAAAa;AAAiB,eAAA,PAAMC;;AAAvBD;;;AAAN,AACE,OAAgB,AAAQE,4BACR,KAAAC,YAAiBL,WACA,iBAAAM,WAAA,CAAA,SAAiBL;AAAjB,AAAAK;;;AAHnC;;;AAKF,kCAAA,lCAAMC,4EAAWC;AAAjB,AACE,oBAAMpB;AAAN,AACE,IAAMoB,QAAE,EAAI,CAAI,AAACC,+BAAKD,QACR,AAACE,+BAAKF,KACZ,AAACG,4BAAQH,GACTA;AAHR,AAIE,OAAMI,YAAWJ;;AALrB;;;AAOF,AAAA,4BAAA,5BAAMM;AAAN,AAAA,IAAAD,WAAA,AAAA;AAAA,AAAA,QAAAA;KAAA;AAAA,OAAAC,wDAAA,CAAA,UAAA;;;KAAA;AAAA,OAAAA,wDAAA,CAAA,UAAA,MAAA,CAAA,UAAA;;;;AAAA,MAAA,KAAAC,MAAA,eAAA,iCAAA,AAAA;;;;;AAAA,AAAA,0DAAA,1DAAMD,qEACFE;AADJ,AACO,2CAAA,pCAACF,yFAAUE;;;AADlB,AAAA,0DAAA,1DAAMF,qEAEFG,MAAMC;AAFV,AAGG,IAAMC,IAAE,iBAAAC,cAAOM;IAAPL,cAAS,0EAAA,xDAAI,AAAChC,kDAAW4B;AAAzB,AAAA,oBAAA,AAAAG,sBAAA,qDAAAC;AAAA;kBAAAC;AAAA,AACS,oBAAAA,bAAOV;;;;AADhB,oBAAA,AAAAQ,sBAAA,wDAAAC;AAAA;kBAAAE;AAAA,AAES,qBAAAA,dAAQX;;;;AAFjB,oBAAA,AAAAQ,sBAAA,uDAAAC;AAAA;kBAAAG;AAAA,AAGS,qBAAAA,dAAQZ;;;;AAHjB;kBAAAa;AAAA,AAIE,mBAAAA,ZAAMb;;;;;;;AAJhB,AAKE,OAACO,YAAED;;;AARR,AAAA,oDAAA,pDAAMJ","names":["figwheel.client.utils\/*print-debug*","figwheel.client.utils\/html-env?","goog\/inHtmlDocument_","figwheel.client.utils\/node-env?","goog\/nodeGlobalRequire","figwheel.client.utils\/base-url-path","p1__28367#","p2__28366#","clojure.string\/replace","goog\/basePath","figwheel.client.utils\/host-env?","figwheel.client.utils\/dispatch-custom-event","event-name","data","and__18148__auto__","js\/window","js\/document","js\/CustomEvent","obj28371","figwheel.client.utils\/debug-prn","o","cljs.core\/map?","cljs.core\/seq?","cljs.core\/prn-str","js\/console","G__28377","figwheel.client.utils\/log","js\/Error","x","level","arg","f","pred__28378","expr__28379","p1__28372#","p1__28373#","p1__28374#","p1__28375#","cljs.core\/="]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/figwheel/connect.cljs: -------------------------------------------------------------------------------- 1 | (ns figwheel.connect (:require [example.core] [figwheel.client] [figwheel.client.utils])) 2 | (figwheel.client/start {:websocket-url "ws://localhost:3449/figwheel-ws", :on-jsload (fn [& x] (if js/example.core.mount-root (apply js/example.core.mount-root x) (figwheel.client.utils/log :debug "Figwheel: :on-jsload hook 'example.core/mount-root' is missing"))), :build-id "dev"}) 3 | 4 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/figwheel/connect.cljs.cache.edn: -------------------------------------------------------------------------------- 1 | ;; Analyzed by ClojureScript 0.0-3211 2 | {:cljs.analyzer/constants {:order [:websocket-url :on-jsload :build-id :debug], :seen #{:on-jsload :debug :build-id :websocket-url}}, :imports nil, :requires {figwheel.client.utils figwheel.client.utils, figwheel.client figwheel.client, example.core example.core}, :uses nil, :require-macros nil, :use-macros nil, :excludes #{}, :doc nil, :name figwheel.connect} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/figwheel/connect.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-3211 {} 2 | goog.provide('figwheel.connect'); 3 | goog.require('cljs.core'); 4 | goog.require('figwheel.client.utils'); 5 | goog.require('figwheel.client'); 6 | goog.require('example.core'); 7 | figwheel.client.start.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"websocket-url","websocket-url",-490444938),"ws://localhost:3449/figwheel-ws",new cljs.core.Keyword(null,"on-jsload","on-jsload",-395756602),(function() { 8 | var G__21267__delegate = function (x){ 9 | if(cljs.core.truth_(example.core.mount_root)){ 10 | return cljs.core.apply.call(null,example.core.mount_root,x); 11 | } else { 12 | return figwheel.client.utils.log.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Figwheel: :on-jsload hook 'example.core/mount-root' is missing"); 13 | } 14 | }; 15 | var G__21267 = function (var_args){ 16 | var x = null; 17 | if (arguments.length > 0) { 18 | var G__21268__i = 0, G__21268__a = new Array(arguments.length - 0); 19 | while (G__21268__i < G__21268__a.length) {G__21268__a[G__21268__i] = arguments[G__21268__i + 0]; ++G__21268__i;} 20 | x = new cljs.core.IndexedSeq(G__21268__a,0); 21 | } 22 | return G__21267__delegate.call(this,x);}; 23 | G__21267.cljs$lang$maxFixedArity = 0; 24 | G__21267.cljs$lang$applyTo = (function (arglist__21269){ 25 | var x = cljs.core.seq(arglist__21269); 26 | return G__21267__delegate(x); 27 | }); 28 | G__21267.cljs$core$IFn$_invoke$arity$variadic = G__21267__delegate; 29 | return G__21267; 30 | })() 31 | ,new cljs.core.Keyword(null,"build-id","build-id",1642831089),"dev"], null)); 32 | 33 | //# sourceMappingURL=connect.js.map?rel=1446467270047 -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/figwheel/connect.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/figwheel\/connect.js","sources":["connect.cljs?rel=1446467270050"],"lineCount":33,"mappings":";AAAA;;;;;AACA,gCAAA,2CAAA,uEAAA,kCAAA,pLAACA,mPAAoF;mCAAOC;AAAP,AAAU,oBAAIC;AAA2B,OAACC,0BAAMD,wBAA2BD;;AAAG,2CAAA,wDAAA,5FAACG;;;;IAAxEH;;;;EAAAA;;oCAAAA;;;IAAAA;0BAAAA;;;;;CAA5F,6DAAA","names":["figwheel.client\/start","x","js\/example.core.mount-root","cljs.core\/apply","figwheel.client.utils\/log"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/goog/async/run.js: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | goog.provide('goog.async.run'); 16 | 17 | goog.require('goog.async.nextTick'); 18 | goog.require('goog.async.throwException'); 19 | goog.require('goog.testing.watchers'); 20 | 21 | 22 | /** 23 | * Fires the provided callback just before the current callstack unwinds, or as 24 | * soon as possible after the current JS execution context. 25 | * @param {function(this:THIS)} callback 26 | * @param {THIS=} opt_context Object to use as the "this value" when calling 27 | * the provided function. 28 | * @template THIS 29 | */ 30 | goog.async.run = function(callback, opt_context) { 31 | if (!goog.async.run.schedule_) { 32 | goog.async.run.initializeRunner_(); 33 | } 34 | if (!goog.async.run.workQueueScheduled_) { 35 | // Nothing is currently scheduled, schedule it now. 36 | goog.async.run.schedule_(); 37 | goog.async.run.workQueueScheduled_ = true; 38 | } 39 | 40 | goog.async.run.workQueue_.push( 41 | new goog.async.run.WorkItem_(callback, opt_context)); 42 | }; 43 | 44 | 45 | /** 46 | * Initializes the function to use to process the work queue. 47 | * @private 48 | */ 49 | goog.async.run.initializeRunner_ = function() { 50 | // If native Promises are available in the browser, just schedule the callback 51 | // on a fulfilled promise, which is specified to be async, but as fast as 52 | // possible. 53 | if (goog.global.Promise && goog.global.Promise.resolve) { 54 | var promise = goog.global.Promise.resolve(); 55 | goog.async.run.schedule_ = function() { 56 | promise.then(goog.async.run.processWorkQueue); 57 | }; 58 | } else { 59 | goog.async.run.schedule_ = function() { 60 | goog.async.nextTick(goog.async.run.processWorkQueue); 61 | }; 62 | } 63 | }; 64 | 65 | 66 | /** 67 | * Forces goog.async.run to use nextTick instead of Promise. 68 | * 69 | * This should only be done in unit tests. It's useful because MockClock 70 | * replaces nextTick, but not the browser Promise implementation, so it allows 71 | * Promise-based code to be tested with MockClock. 72 | */ 73 | goog.async.run.forceNextTick = function() { 74 | goog.async.run.schedule_ = function() { 75 | goog.async.nextTick(goog.async.run.processWorkQueue); 76 | }; 77 | }; 78 | 79 | 80 | /** 81 | * The function used to schedule work asynchronousely. 82 | * @private {function()} 83 | */ 84 | goog.async.run.schedule_; 85 | 86 | 87 | /** @private {boolean} */ 88 | goog.async.run.workQueueScheduled_ = false; 89 | 90 | 91 | /** @private {!Array.} */ 92 | goog.async.run.workQueue_ = []; 93 | 94 | 95 | if (goog.DEBUG) { 96 | /** 97 | * Reset the event queue. 98 | * @private 99 | */ 100 | goog.async.run.resetQueue_ = function() { 101 | goog.async.run.workQueueScheduled_ = false; 102 | goog.async.run.workQueue_ = []; 103 | }; 104 | 105 | // If there is a clock implemenation in use for testing 106 | // and it is reset, reset the queue. 107 | goog.testing.watchers.watchClockReset(goog.async.run.resetQueue_); 108 | } 109 | 110 | 111 | /** 112 | * Run any pending goog.async.run work items. This function is not intended 113 | * for general use, but for use by entry point handlers to run items ahead of 114 | * goog.async.nextTick. 115 | */ 116 | goog.async.run.processWorkQueue = function() { 117 | // NOTE: additional work queue items may be pushed while processing. 118 | while (goog.async.run.workQueue_.length) { 119 | // Don't let the work queue grow indefinitely. 120 | var workItems = goog.async.run.workQueue_; 121 | goog.async.run.workQueue_ = []; 122 | for (var i = 0; i < workItems.length; i++) { 123 | var workItem = workItems[i]; 124 | try { 125 | workItem.fn.call(workItem.scope); 126 | } catch (e) { 127 | goog.async.throwException(e); 128 | } 129 | } 130 | } 131 | 132 | // There are no more work items, reset the work queue. 133 | goog.async.run.workQueueScheduled_ = false; 134 | }; 135 | 136 | 137 | 138 | /** 139 | * @constructor 140 | * @final 141 | * @struct 142 | * @private 143 | * 144 | * @param {function()} fn 145 | * @param {Object|null|undefined} scope 146 | */ 147 | goog.async.run.WorkItem_ = function(fn, scope) { 148 | /** @const */ this.fn = fn; 149 | /** @const */ this.scope = scope; 150 | }; 151 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/goog/debug/error.js: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Provides a base class for custom Error objects such that the 17 | * stack is correctly maintained. 18 | * 19 | * You should never need to throw goog.debug.Error(msg) directly, Error(msg) is 20 | * sufficient. 21 | * 22 | */ 23 | 24 | goog.provide('goog.debug.Error'); 25 | 26 | 27 | 28 | /** 29 | * Base class for custom error objects. 30 | * @param {*=} opt_msg The message associated with the error. 31 | * @constructor 32 | * @extends {Error} 33 | */ 34 | goog.debug.Error = function(opt_msg) { 35 | 36 | // Attempt to ensure there is a stack trace. 37 | if (Error.captureStackTrace) { 38 | Error.captureStackTrace(this, goog.debug.Error); 39 | } else { 40 | var stack = new Error().stack; 41 | if (stack) { 42 | this.stack = stack; 43 | } 44 | } 45 | 46 | if (opt_msg) { 47 | this.message = String(opt_msg); 48 | } 49 | }; 50 | goog.inherits(goog.debug.Error, Error); 51 | 52 | 53 | /** @override */ 54 | goog.debug.Error.prototype.name = 'CustomError'; 55 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/goog/dom/browserfeature.js: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Browser capability checks for the dom package. 17 | * 18 | */ 19 | 20 | 21 | goog.provide('goog.dom.BrowserFeature'); 22 | 23 | goog.require('goog.userAgent'); 24 | 25 | 26 | /** 27 | * Enum of browser capabilities. 28 | * @enum {boolean} 29 | */ 30 | goog.dom.BrowserFeature = { 31 | /** 32 | * Whether attributes 'name' and 'type' can be added to an element after it's 33 | * created. False in Internet Explorer prior to version 9. 34 | */ 35 | CAN_ADD_NAME_OR_TYPE_ATTRIBUTES: !goog.userAgent.IE || 36 | goog.userAgent.isDocumentModeOrHigher(9), 37 | 38 | /** 39 | * Whether we can use element.children to access an element's Element 40 | * children. Available since Gecko 1.9.1, IE 9. (IE<9 also includes comment 41 | * nodes in the collection.) 42 | */ 43 | CAN_USE_CHILDREN_ATTRIBUTE: !goog.userAgent.GECKO && !goog.userAgent.IE || 44 | goog.userAgent.IE && goog.userAgent.isDocumentModeOrHigher(9) || 45 | goog.userAgent.GECKO && goog.userAgent.isVersionOrHigher('1.9.1'), 46 | 47 | /** 48 | * Opera, Safari 3, and Internet Explorer 9 all support innerText but they 49 | * include text nodes in script and style tags. Not document-mode-dependent. 50 | */ 51 | CAN_USE_INNER_TEXT: ( 52 | goog.userAgent.IE && !goog.userAgent.isVersionOrHigher('9')), 53 | 54 | /** 55 | * MSIE, Opera, and Safari>=4 support element.parentElement to access an 56 | * element's parent if it is an Element. 57 | */ 58 | CAN_USE_PARENT_ELEMENT_PROPERTY: goog.userAgent.IE || goog.userAgent.OPERA || 59 | goog.userAgent.WEBKIT, 60 | 61 | /** 62 | * Whether NoScope elements need a scoped element written before them in 63 | * innerHTML. 64 | * MSDN: http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx#1 65 | */ 66 | INNER_HTML_NEEDS_SCOPED_ELEMENT: goog.userAgent.IE, 67 | 68 | /** 69 | * Whether we use legacy IE range API. 70 | */ 71 | LEGACY_IE_RANGES: goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(9) 72 | }; 73 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/goog/dom/nodetype.js: -------------------------------------------------------------------------------- 1 | // Copyright 2006 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Definition of goog.dom.NodeType. 17 | */ 18 | 19 | goog.provide('goog.dom.NodeType'); 20 | 21 | 22 | /** 23 | * Constants for the nodeType attribute in the Node interface. 24 | * 25 | * These constants match those specified in the Node interface. These are 26 | * usually present on the Node object in recent browsers, but not in older 27 | * browsers (specifically, early IEs) and thus are given here. 28 | * 29 | * In some browsers (early IEs), these are not defined on the Node object, 30 | * so they are provided here. 31 | * 32 | * See http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247 33 | * @enum {number} 34 | */ 35 | goog.dom.NodeType = { 36 | ELEMENT: 1, 37 | ATTRIBUTE: 2, 38 | TEXT: 3, 39 | CDATA_SECTION: 4, 40 | ENTITY_REFERENCE: 5, 41 | ENTITY: 6, 42 | PROCESSING_INSTRUCTION: 7, 43 | COMMENT: 8, 44 | DOCUMENT: 9, 45 | DOCUMENT_TYPE: 10, 46 | DOCUMENT_FRAGMENT: 11, 47 | NOTATION: 12 48 | }; 49 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/goog/dom/tagname.js: -------------------------------------------------------------------------------- 1 | // Copyright 2007 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Defines the goog.dom.TagName enum. This enumerates 17 | * all HTML tag names specified in either the the W3C HTML 4.01 index of 18 | * elements or the HTML5 draft specification. 19 | * 20 | * References: 21 | * http://www.w3.org/TR/html401/index/elements.html 22 | * http://dev.w3.org/html5/spec/section-index.html 23 | * 24 | */ 25 | goog.provide('goog.dom.TagName'); 26 | 27 | 28 | /** 29 | * Enum of all html tag names specified by the W3C HTML4.01 and HTML5 30 | * specifications. 31 | * @enum {string} 32 | */ 33 | goog.dom.TagName = { 34 | A: 'A', 35 | ABBR: 'ABBR', 36 | ACRONYM: 'ACRONYM', 37 | ADDRESS: 'ADDRESS', 38 | APPLET: 'APPLET', 39 | AREA: 'AREA', 40 | ARTICLE: 'ARTICLE', 41 | ASIDE: 'ASIDE', 42 | AUDIO: 'AUDIO', 43 | B: 'B', 44 | BASE: 'BASE', 45 | BASEFONT: 'BASEFONT', 46 | BDI: 'BDI', 47 | BDO: 'BDO', 48 | BIG: 'BIG', 49 | BLOCKQUOTE: 'BLOCKQUOTE', 50 | BODY: 'BODY', 51 | BR: 'BR', 52 | BUTTON: 'BUTTON', 53 | CANVAS: 'CANVAS', 54 | CAPTION: 'CAPTION', 55 | CENTER: 'CENTER', 56 | CITE: 'CITE', 57 | CODE: 'CODE', 58 | COL: 'COL', 59 | COLGROUP: 'COLGROUP', 60 | COMMAND: 'COMMAND', 61 | DATA: 'DATA', 62 | DATALIST: 'DATALIST', 63 | DD: 'DD', 64 | DEL: 'DEL', 65 | DETAILS: 'DETAILS', 66 | DFN: 'DFN', 67 | DIALOG: 'DIALOG', 68 | DIR: 'DIR', 69 | DIV: 'DIV', 70 | DL: 'DL', 71 | DT: 'DT', 72 | EM: 'EM', 73 | EMBED: 'EMBED', 74 | FIELDSET: 'FIELDSET', 75 | FIGCAPTION: 'FIGCAPTION', 76 | FIGURE: 'FIGURE', 77 | FONT: 'FONT', 78 | FOOTER: 'FOOTER', 79 | FORM: 'FORM', 80 | FRAME: 'FRAME', 81 | FRAMESET: 'FRAMESET', 82 | H1: 'H1', 83 | H2: 'H2', 84 | H3: 'H3', 85 | H4: 'H4', 86 | H5: 'H5', 87 | H6: 'H6', 88 | HEAD: 'HEAD', 89 | HEADER: 'HEADER', 90 | HGROUP: 'HGROUP', 91 | HR: 'HR', 92 | HTML: 'HTML', 93 | I: 'I', 94 | IFRAME: 'IFRAME', 95 | IMG: 'IMG', 96 | INPUT: 'INPUT', 97 | INS: 'INS', 98 | ISINDEX: 'ISINDEX', 99 | KBD: 'KBD', 100 | KEYGEN: 'KEYGEN', 101 | LABEL: 'LABEL', 102 | LEGEND: 'LEGEND', 103 | LI: 'LI', 104 | LINK: 'LINK', 105 | MAP: 'MAP', 106 | MARK: 'MARK', 107 | MATH: 'MATH', 108 | MENU: 'MENU', 109 | META: 'META', 110 | METER: 'METER', 111 | NAV: 'NAV', 112 | NOFRAMES: 'NOFRAMES', 113 | NOSCRIPT: 'NOSCRIPT', 114 | OBJECT: 'OBJECT', 115 | OL: 'OL', 116 | OPTGROUP: 'OPTGROUP', 117 | OPTION: 'OPTION', 118 | OUTPUT: 'OUTPUT', 119 | P: 'P', 120 | PARAM: 'PARAM', 121 | PRE: 'PRE', 122 | PROGRESS: 'PROGRESS', 123 | Q: 'Q', 124 | RP: 'RP', 125 | RT: 'RT', 126 | RUBY: 'RUBY', 127 | S: 'S', 128 | SAMP: 'SAMP', 129 | SCRIPT: 'SCRIPT', 130 | SECTION: 'SECTION', 131 | SELECT: 'SELECT', 132 | SMALL: 'SMALL', 133 | SOURCE: 'SOURCE', 134 | SPAN: 'SPAN', 135 | STRIKE: 'STRIKE', 136 | STRONG: 'STRONG', 137 | STYLE: 'STYLE', 138 | SUB: 'SUB', 139 | SUMMARY: 'SUMMARY', 140 | SUP: 'SUP', 141 | SVG: 'SVG', 142 | TABLE: 'TABLE', 143 | TBODY: 'TBODY', 144 | TD: 'TD', 145 | TEXTAREA: 'TEXTAREA', 146 | TFOOT: 'TFOOT', 147 | TH: 'TH', 148 | THEAD: 'THEAD', 149 | TIME: 'TIME', 150 | TITLE: 'TITLE', 151 | TR: 'TR', 152 | TRACK: 'TRACK', 153 | TT: 'TT', 154 | U: 'U', 155 | UL: 'UL', 156 | VAR: 'VAR', 157 | VIDEO: 'VIDEO', 158 | WBR: 'WBR' 159 | }; 160 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/goog/labs/useragent/engine.js: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Closure user agent detection. 17 | * @see http://en.wikipedia.org/wiki/User_agent 18 | * For more information on browser brand, platform, or device see the other 19 | * sub-namespaces in goog.labs.userAgent (browser, platform, and device). 20 | * 21 | */ 22 | 23 | goog.provide('goog.labs.userAgent.engine'); 24 | 25 | goog.require('goog.array'); 26 | goog.require('goog.labs.userAgent.util'); 27 | goog.require('goog.string'); 28 | 29 | 30 | /** 31 | * @return {boolean} Whether the rendering engine is Presto. 32 | */ 33 | goog.labs.userAgent.engine.isPresto = function() { 34 | return goog.labs.userAgent.util.matchUserAgent('Presto'); 35 | }; 36 | 37 | 38 | /** 39 | * @return {boolean} Whether the rendering engine is Trident. 40 | */ 41 | goog.labs.userAgent.engine.isTrident = function() { 42 | // IE only started including the Trident token in IE8. 43 | return goog.labs.userAgent.util.matchUserAgent('Trident') || 44 | goog.labs.userAgent.util.matchUserAgent('MSIE'); 45 | }; 46 | 47 | 48 | /** 49 | * @return {boolean} Whether the rendering engine is WebKit. 50 | */ 51 | goog.labs.userAgent.engine.isWebKit = function() { 52 | return goog.labs.userAgent.util.matchUserAgentIgnoreCase('WebKit'); 53 | }; 54 | 55 | 56 | /** 57 | * @return {boolean} Whether the rendering engine is Gecko. 58 | */ 59 | goog.labs.userAgent.engine.isGecko = function() { 60 | return goog.labs.userAgent.util.matchUserAgent('Gecko') && 61 | !goog.labs.userAgent.engine.isWebKit() && 62 | !goog.labs.userAgent.engine.isTrident(); 63 | }; 64 | 65 | 66 | /** 67 | * @return {string} The rendering engine's version or empty string if version 68 | * can't be determined. 69 | */ 70 | goog.labs.userAgent.engine.getVersion = function() { 71 | var userAgentString = goog.labs.userAgent.util.getUserAgent(); 72 | if (userAgentString) { 73 | var tuples = goog.labs.userAgent.util.extractVersionTuples( 74 | userAgentString); 75 | 76 | var engineTuple = tuples[1]; 77 | if (engineTuple) { 78 | // In Gecko, the version string is either in the browser info or the 79 | // Firefox version. See Gecko user agent string reference: 80 | // http://goo.gl/mULqa 81 | if (engineTuple[0] == 'Gecko') { 82 | return goog.labs.userAgent.engine.getVersionForKey_( 83 | tuples, 'Firefox'); 84 | } 85 | 86 | return engineTuple[1]; 87 | } 88 | 89 | // IE has only one version identifier, and the Trident version is 90 | // specified in the parenthetical. 91 | var browserTuple = tuples[0]; 92 | var info; 93 | if (browserTuple && (info = browserTuple[2])) { 94 | var match = /Trident\/([^\s;]+)/.exec(info); 95 | if (match) { 96 | return match[1]; 97 | } 98 | } 99 | } 100 | return ''; 101 | }; 102 | 103 | 104 | /** 105 | * @param {string|number} version The version to check. 106 | * @return {boolean} Whether the rendering engine version is higher or the same 107 | * as the given version. 108 | */ 109 | goog.labs.userAgent.engine.isVersionOrHigher = function(version) { 110 | return goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(), 111 | version) >= 0; 112 | }; 113 | 114 | 115 | /** 116 | * @param {!Array.>} tuples Version tuples. 117 | * @param {string} key The key to look for. 118 | * @return {string} The version string of the given key, if present. 119 | * Otherwise, the empty string. 120 | * @private 121 | */ 122 | goog.labs.userAgent.engine.getVersionForKey_ = function(tuples, key) { 123 | // TODO(nnaze): Move to util if useful elsewhere. 124 | 125 | var pair = goog.array.find(tuples, function(pair) { 126 | return key == pair[0]; 127 | }); 128 | 129 | return pair && pair[1] || ''; 130 | }; 131 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/goog/labs/useragent/util.js: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Utilities used by goog.labs.userAgent tools. These functions 17 | * should not be used outside of goog.labs.userAgent.*. 18 | * 19 | * @visibility {//closure/goog/bin/sizetests:__pkg__} 20 | * @visibility {//closure/goog/dom:__subpackages__} 21 | * @visibility {//closure/goog/style:__pkg__} 22 | * @visibility {//closure/goog/testing:__pkg__} 23 | * @visibility {//closure/goog/useragent:__subpackages__} 24 | * @visibility {//testing/puppet/modules:__pkg__} * 25 | * 26 | * @author nnaze@google.com (Nathan Naze) 27 | */ 28 | 29 | goog.provide('goog.labs.userAgent.util'); 30 | 31 | goog.require('goog.string'); 32 | 33 | 34 | /** 35 | * Gets the native userAgent string from navigator if it exists. 36 | * If navigator or navigator.userAgent string is missing, returns an empty 37 | * string. 38 | * @return {string} 39 | * @private 40 | */ 41 | goog.labs.userAgent.util.getNativeUserAgentString_ = function() { 42 | var navigator = goog.labs.userAgent.util.getNavigator_(); 43 | if (navigator) { 44 | var userAgent = navigator.userAgent; 45 | if (userAgent) { 46 | return userAgent; 47 | } 48 | } 49 | return ''; 50 | }; 51 | 52 | 53 | /** 54 | * Getter for the native navigator. 55 | * This is a separate function so it can be stubbed out in testing. 56 | * @return {Navigator} 57 | * @private 58 | */ 59 | goog.labs.userAgent.util.getNavigator_ = function() { 60 | return goog.global.navigator; 61 | }; 62 | 63 | 64 | /** 65 | * A possible override for applications which wish to not check 66 | * navigator.userAgent but use a specified value for detection instead. 67 | * @private {string} 68 | */ 69 | goog.labs.userAgent.util.userAgent_ = 70 | goog.labs.userAgent.util.getNativeUserAgentString_(); 71 | 72 | 73 | /** 74 | * Applications may override browser detection on the built in 75 | * navigator.userAgent object by setting this string. Set to null to use the 76 | * browser object instead. 77 | * @param {?string=} opt_userAgent The User-Agent override. 78 | */ 79 | goog.labs.userAgent.util.setUserAgent = function(opt_userAgent) { 80 | goog.labs.userAgent.util.userAgent_ = opt_userAgent || 81 | goog.labs.userAgent.util.getNativeUserAgentString_(); 82 | }; 83 | 84 | 85 | /** 86 | * @return {string} The user agent string. 87 | */ 88 | goog.labs.userAgent.util.getUserAgent = function() { 89 | return goog.labs.userAgent.util.userAgent_; 90 | }; 91 | 92 | 93 | /** 94 | * @param {string} str 95 | * @return {boolean} Whether the user agent contains the given string, ignoring 96 | * case. 97 | */ 98 | goog.labs.userAgent.util.matchUserAgent = function(str) { 99 | var userAgent = goog.labs.userAgent.util.getUserAgent(); 100 | return goog.string.contains(userAgent, str); 101 | }; 102 | 103 | 104 | /** 105 | * @param {string} str 106 | * @return {boolean} Whether the user agent contains the given string. 107 | */ 108 | goog.labs.userAgent.util.matchUserAgentIgnoreCase = function(str) { 109 | var userAgent = goog.labs.userAgent.util.getUserAgent(); 110 | return goog.string.caseInsensitiveContains(userAgent, str); 111 | }; 112 | 113 | 114 | /** 115 | * Parses the user agent into tuples for each section. 116 | * @param {string} userAgent 117 | * @return {!Array.>} Tuples of key, version, and the contents 118 | * of the parenthetical. 119 | */ 120 | goog.labs.userAgent.util.extractVersionTuples = function(userAgent) { 121 | // Matches each section of a user agent string. 122 | // Example UA: 123 | // Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) 124 | // AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405 125 | // This has three version tuples: Mozilla, AppleWebKit, and Mobile. 126 | 127 | var versionRegExp = new RegExp( 128 | // Key. Note that a key may have a space. 129 | // (i.e. 'Mobile Safari' in 'Mobile Safari/5.0') 130 | '(\\w[\\w ]+)' + 131 | 132 | '/' + // slash 133 | '([^\\s]+)' + // version (i.e. '5.0b') 134 | '\\s*' + // whitespace 135 | '(?:\\((.*?)\\))?', // parenthetical info. parentheses not matched. 136 | 'g'); 137 | 138 | var data = []; 139 | var match; 140 | 141 | // Iterate and collect the version tuples. Each iteration will be the 142 | // next regex match. 143 | while (match = versionRegExp.exec(userAgent)) { 144 | data.push([ 145 | match[1], // key 146 | match[2], // value 147 | // || undefined as this is not undefined in IE7 and IE8 148 | match[3] || undefined // info 149 | ]); 150 | } 151 | 152 | return data; 153 | }; 154 | 155 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/goog/promise/resolver.js: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | goog.provide('goog.promise.Resolver'); 16 | 17 | 18 | 19 | /** 20 | * Resolver interface for promises. The resolver is a convenience interface that 21 | * bundles the promise and its associated resolve and reject functions together, 22 | * for cases where the resolver needs to be persisted internally. 23 | * 24 | * @interface 25 | * @template TYPE 26 | */ 27 | goog.promise.Resolver = function() {}; 28 | 29 | 30 | /** 31 | * The promise that created this resolver. 32 | * @const {!goog.Promise.} 33 | */ 34 | goog.promise.Resolver.prototype.promise; 35 | 36 | 37 | /** 38 | * Resolves this resolver with the specified value. 39 | * @const {function((TYPE|goog.Promise.|Thenable)=)} 40 | */ 41 | goog.promise.Resolver.prototype.resolve; 42 | 43 | 44 | /** 45 | * Rejects this resolver with the specified reason. 46 | * @const {function(*): void} 47 | */ 48 | goog.promise.Resolver.prototype.reject; 49 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/goog/promise/thenable.js: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | goog.provide('goog.Thenable'); 16 | 17 | 18 | 19 | /** 20 | * Provides a more strict interface for Thenables in terms of 21 | * http://promisesaplus.com for interop with {@see goog.Promise}. 22 | * 23 | * @interface 24 | * @extends {IThenable.} 25 | * @template TYPE 26 | */ 27 | goog.Thenable = function() {}; 28 | 29 | 30 | /** 31 | * Adds callbacks that will operate on the result of the Thenable, returning a 32 | * new child Promise. 33 | * 34 | * If the Thenable is fulfilled, the {@code onFulfilled} callback will be 35 | * invoked with the fulfillment value as argument, and the child Promise will 36 | * be fulfilled with the return value of the callback. If the callback throws 37 | * an exception, the child Promise will be rejected with the thrown value 38 | * instead. 39 | * 40 | * If the Thenable is rejected, the {@code onRejected} callback will be invoked 41 | * with the rejection reason as argument, and the child Promise will be rejected 42 | * with the return value of the callback or thrown value. 43 | * 44 | * @param {?(function(this:THIS, TYPE): 45 | * (RESULT|IThenable.|Thenable))=} opt_onFulfilled A 46 | * function that will be invoked with the fulfillment value if the Promise 47 | * is fullfilled. 48 | * @param {?(function(this:THIS, *): *)=} opt_onRejected A function that will 49 | * be invoked with the rejection reason if the Promise is rejected. 50 | * @param {THIS=} opt_context An optional context object that will be the 51 | * execution context for the callbacks. By default, functions are executed 52 | * with the default this. 53 | * @return {!goog.Promise.} A new Promise that will receive the result 54 | * of the fulfillment or rejection callback. 55 | * @template RESULT,THIS 56 | */ 57 | goog.Thenable.prototype.then = function(opt_onFulfilled, opt_onRejected, 58 | opt_context) {}; 59 | 60 | 61 | /** 62 | * An expando property to indicate that an object implements 63 | * {@code goog.Thenable}. 64 | * 65 | * {@see addImplementation}. 66 | * 67 | * @const 68 | */ 69 | goog.Thenable.IMPLEMENTED_BY_PROP = '$goog_Thenable'; 70 | 71 | 72 | /** 73 | * Marks a given class (constructor) as an implementation of Thenable, so 74 | * that we can query that fact at runtime. The class must have already 75 | * implemented the interface. 76 | * Exports a 'then' method on the constructor prototype, so that the objects 77 | * also implement the extern {@see goog.Thenable} interface for interop with 78 | * other Promise implementations. 79 | * @param {function(new:goog.Thenable,...[?])} ctor The class constructor. The 80 | * corresponding class must have already implemented the interface. 81 | */ 82 | goog.Thenable.addImplementation = function(ctor) { 83 | goog.exportProperty(ctor.prototype, 'then', ctor.prototype.then); 84 | if (COMPILED) { 85 | ctor.prototype[goog.Thenable.IMPLEMENTED_BY_PROP] = true; 86 | } else { 87 | // Avoids dictionary access in uncompiled mode. 88 | ctor.prototype.$goog_Thenable = true; 89 | } 90 | }; 91 | 92 | 93 | /** 94 | * @param {*} object 95 | * @return {boolean} Whether a given instance implements {@code goog.Thenable}. 96 | * The class/superclass of the instance must call {@code addImplementation}. 97 | */ 98 | goog.Thenable.isImplementedBy = function(object) { 99 | if (!object) { 100 | return false; 101 | } 102 | try { 103 | if (COMPILED) { 104 | return !!object[goog.Thenable.IMPLEMENTED_BY_PROP]; 105 | } 106 | return !!object.$goog_Thenable; 107 | } catch (e) { 108 | // Property access seems to be forbidden. 109 | return false; 110 | } 111 | }; 112 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/goog/string/stringbuffer.js: -------------------------------------------------------------------------------- 1 | // Copyright 2006 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Utility for fast string concatenation. 17 | */ 18 | 19 | goog.provide('goog.string.StringBuffer'); 20 | 21 | 22 | 23 | /** 24 | * Utility class to facilitate string concatenation. 25 | * 26 | * @param {*=} opt_a1 Optional first initial item to append. 27 | * @param {...*} var_args Other initial items to 28 | * append, e.g., new goog.string.StringBuffer('foo', 'bar'). 29 | * @constructor 30 | */ 31 | goog.string.StringBuffer = function(opt_a1, var_args) { 32 | if (opt_a1 != null) { 33 | this.append.apply(this, arguments); 34 | } 35 | }; 36 | 37 | 38 | /** 39 | * Internal buffer for the string to be concatenated. 40 | * @type {string} 41 | * @private 42 | */ 43 | goog.string.StringBuffer.prototype.buffer_ = ''; 44 | 45 | 46 | /** 47 | * Sets the contents of the string buffer object, replacing what's currently 48 | * there. 49 | * 50 | * @param {*} s String to set. 51 | */ 52 | goog.string.StringBuffer.prototype.set = function(s) { 53 | this.buffer_ = '' + s; 54 | }; 55 | 56 | 57 | /** 58 | * Appends one or more items to the buffer. 59 | * 60 | * Calling this with null, undefined, or empty arguments is an error. 61 | * 62 | * @param {*} a1 Required first string. 63 | * @param {*=} opt_a2 Optional second string. 64 | * @param {...*} var_args Other items to append, 65 | * e.g., sb.append('foo', 'bar', 'baz'). 66 | * @return {!goog.string.StringBuffer} This same StringBuffer object. 67 | * @suppress {duplicate} 68 | */ 69 | goog.string.StringBuffer.prototype.append = function(a1, opt_a2, var_args) { 70 | // Use a1 directly to avoid arguments instantiation for single-arg case. 71 | this.buffer_ += a1; 72 | if (opt_a2 != null) { // second argument is undefined (null == undefined) 73 | for (var i = 1; i < arguments.length; i++) { 74 | this.buffer_ += arguments[i]; 75 | } 76 | } 77 | return this; 78 | }; 79 | 80 | 81 | /** 82 | * Clears the internal buffer. 83 | */ 84 | goog.string.StringBuffer.prototype.clear = function() { 85 | this.buffer_ = ''; 86 | }; 87 | 88 | 89 | /** 90 | * @return {number} the length of the current contents of the buffer. 91 | */ 92 | goog.string.StringBuffer.prototype.getLength = function() { 93 | return this.buffer_.length; 94 | }; 95 | 96 | 97 | /** 98 | * @return {string} The concatenated string. 99 | * @override 100 | */ 101 | goog.string.StringBuffer.prototype.toString = function() { 102 | return this.buffer_; 103 | }; 104 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/goog/testing/watchers.js: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Simple notifiers for the Closure testing framework. 17 | * 18 | * @author johnlenz@google.com (John Lenz) 19 | */ 20 | 21 | goog.provide('goog.testing.watchers'); 22 | 23 | 24 | /** @private {!Array.} */ 25 | goog.testing.watchers.resetWatchers_ = []; 26 | 27 | 28 | /** 29 | * Fires clock reset watching functions. 30 | */ 31 | goog.testing.watchers.signalClockReset = function() { 32 | var watchers = goog.testing.watchers.resetWatchers_; 33 | for (var i = 0; i < watchers.length; i++) { 34 | goog.testing.watchers.resetWatchers_[i](); 35 | } 36 | }; 37 | 38 | 39 | /** 40 | * Enqueues a function to be called when the clock used for setTimeout is reset. 41 | * @param {function()} fn 42 | */ 43 | goog.testing.watchers.watchClockReset = function(fn) { 44 | goog.testing.watchers.resetWatchers_.push(fn); 45 | }; 46 | 47 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/core.cljs: -------------------------------------------------------------------------------- 1 | (ns re-frame.core 2 | (:require 3 | [re-frame.handlers :as handlers] 4 | [re-frame.subs :as subs] 5 | [re-frame.router :as router] 6 | [re-frame.utils :as utils] 7 | [re-frame.middleware :as middleware])) 8 | 9 | 10 | ;; -- API ------- 11 | 12 | (def dispatch router/dispatch) 13 | (def dispatch-sync router/dispatch-sync) 14 | 15 | (def register-sub subs/register) 16 | (def clear-sub-handlers! subs/clear-handlers!) 17 | (def subscribe subs/subscribe) 18 | 19 | 20 | (def clear-event-handlers! handlers/clear-handlers!) 21 | 22 | 23 | (def pure middleware/pure) 24 | (def debug middleware/debug) 25 | (def undoable middleware/undoable) 26 | (def path middleware/path) 27 | (def enrich middleware/enrich) 28 | (def trim-v middleware/trim-v) 29 | (def after middleware/after) 30 | (def log-ex middleware/log-ex) 31 | 32 | 33 | ;; ALPHA - EXPERIMENTAL MIDDLEWARE 34 | (def on-changes middleware/on-changes) 35 | 36 | 37 | ;; -- Logging ----- 38 | ;; re-frame uses the logging functions: warn, log, error, group and groupEnd 39 | ;; By default, these functions map directly to the js/console implementations 40 | ;; But you can override with your own (set or subset): 41 | ;; (set-loggers! {:warn my-warn :log my-looger ...}) 42 | (def set-loggers! utils/set-loggers!) 43 | 44 | 45 | ;; -- Convenience API ------- 46 | 47 | ;; Almost 100% of handlers will be pure, so make it easy to 48 | ;; register with "pure" middleware in the correct (left-hand-side) position. 49 | (defn register-handler 50 | ([id handler] 51 | (handlers/register-base id pure handler)) 52 | ([id middleware handler] 53 | (handlers/register-base id [pure middleware] handler))) 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/core.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-3211 {} 2 | goog.provide('re_frame.core'); 3 | goog.require('cljs.core'); 4 | goog.require('re_frame.subs'); 5 | goog.require('re_frame.router'); 6 | goog.require('re_frame.utils'); 7 | goog.require('re_frame.handlers'); 8 | goog.require('re_frame.middleware'); 9 | re_frame.core.dispatch = re_frame.router.dispatch; 10 | re_frame.core.dispatch_sync = re_frame.router.dispatch_sync; 11 | re_frame.core.register_sub = re_frame.subs.register; 12 | re_frame.core.clear_sub_handlers_BANG_ = re_frame.subs.clear_handlers_BANG_; 13 | re_frame.core.subscribe = re_frame.subs.subscribe; 14 | re_frame.core.clear_event_handlers_BANG_ = re_frame.handlers.clear_handlers_BANG_; 15 | re_frame.core.pure = re_frame.middleware.pure; 16 | re_frame.core.debug = re_frame.middleware.debug; 17 | re_frame.core.undoable = re_frame.middleware.undoable; 18 | re_frame.core.path = re_frame.middleware.path; 19 | re_frame.core.enrich = re_frame.middleware.enrich; 20 | re_frame.core.trim_v = re_frame.middleware.trim_v; 21 | re_frame.core.after = re_frame.middleware.after; 22 | re_frame.core.log_ex = re_frame.middleware.log_ex; 23 | re_frame.core.on_changes = re_frame.middleware.on_changes; 24 | re_frame.core.set_loggers_BANG_ = re_frame.utils.set_loggers_BANG_; 25 | re_frame.core.register_handler = (function re_frame$core$register_handler(){ 26 | var G__25477 = arguments.length; 27 | switch (G__25477) { 28 | case 2: 29 | return re_frame.core.register_handler.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)])); 30 | 31 | break; 32 | case 3: 33 | return re_frame.core.register_handler.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)])); 34 | 35 | break; 36 | default: 37 | throw (new Error([cljs.core.str("Invalid arity: "),cljs.core.str(arguments.length)].join(''))); 38 | 39 | } 40 | }); 41 | 42 | re_frame.core.register_handler.cljs$core$IFn$_invoke$arity$2 = (function (id,handler){ 43 | return re_frame.handlers.register_base.call(null,id,re_frame.core.pure,handler); 44 | }); 45 | 46 | re_frame.core.register_handler.cljs$core$IFn$_invoke$arity$3 = (function (id,middleware,handler){ 47 | return re_frame.handlers.register_base.call(null,id,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [re_frame.core.pure,middleware], null),handler); 48 | }); 49 | 50 | re_frame.core.register_handler.cljs$lang$maxFixedArity = 3; 51 | 52 | //# sourceMappingURL=core.js.map?rel=1446435319521 -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/core.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/re_frame\/core.js","sources":["core.cljs?rel=1446435319521"],"lineCount":52,"mappings":";AAAA;;;;;;;AAWA,AAAKA,yBAAiBC;AACtB,AAAKC,8BAAiBC;AAEtB,AAAKC,6BAAoBC;AACzB,AAAKC,yCAAoBC;AACzB,AAAKC,0BAAoBC;AAGzB,AAAKC,2CAAuBC;AAG5B,AAAKC,qBAAYC;AACjB,AAAKC,sBAAYC;AACjB,AAAKC,yBAAYC;AACjB,AAAKC,qBAAYC;AACjB,AAAKC,uBAAYC;AACjB,AAAKC,uBAAYC;AACjB,AAAKC,sBAAYC;AACjB,AAAKC,uBAAYC;AAIjB,AAAKC,2BAAYC;AAQjB,AAAKC,kCAAaC;AAOlB,AAAA,iCAAA,jCAAME;AAAN,AAAA,IAAAD,WAAA,AAAA;AAAA,AAAA,QAAAA;KAAA;AAAA,OAAAC,6DAAA,CAAA,UAAA,MAAA,CAAA,UAAA;;;KAAA;AAAA,OAAAA,6DAAA,CAAA,UAAA,MAAA,CAAA,UAAA,MAAA,CAAA,UAAA;;;;AAAA,MAAA,KAAAC,MAAA,eAAA,iCAAA,AAAA;;;;;AAAA,AAAA,+DAAA,\/DAAMD,0EACFE,GAAGC;AADP,AAEI,OAACC,0CAAuBF,GAAGvB,mBAAKwB;;;AAFpC,AAAA,+DAAA,\/DAAMH,0EAGFE,GAAGG,WAAWF;AAHlB,AAII,oDAAA,7CAACC,0CAAuBF,sFAAIvB,mBAAK0B,mBAAYF;;;AAJjD,AAAA,yDAAA,zDAAMH","names":["re-frame.core\/dispatch","re-frame.router\/dispatch","re-frame.core\/dispatch-sync","re-frame.router\/dispatch-sync","re-frame.core\/register-sub","re-frame.subs\/register","re-frame.core\/clear-sub-handlers!","re-frame.subs\/clear-handlers!","re-frame.core\/subscribe","re-frame.subs\/subscribe","re-frame.core\/clear-event-handlers!","re-frame.handlers\/clear-handlers!","re-frame.core\/pure","re-frame.middleware\/pure","re-frame.core\/debug","re-frame.middleware\/debug","re-frame.core\/undoable","re-frame.middleware\/undoable","re-frame.core\/path","re-frame.middleware\/path","re-frame.core\/enrich","re-frame.middleware\/enrich","re-frame.core\/trim-v","re-frame.middleware\/trim-v","re-frame.core\/after","re-frame.middleware\/after","re-frame.core\/log-ex","re-frame.middleware\/log-ex","re-frame.core\/on-changes","re-frame.middleware\/on-changes","re-frame.core\/set-loggers!","re-frame.utils\/set-loggers!","G__25477","re-frame.core\/register-handler","js\/Error","id","handler","re-frame.handlers\/register-base","middleware"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/db.cljs: -------------------------------------------------------------------------------- 1 | (ns re-frame.db 2 | (:require [reagent.core :as reagent])) 3 | 4 | 5 | ;; -- Application State -------------------------------------------------------------------------- 6 | ;; 7 | ;; Should not be accessed directly by application code 8 | ;; Read access goes through subscriptions. 9 | ;; Updates via event handlers. 10 | (def app-db (reagent/atom {})) 11 | 12 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/db.cljs.cache.edn: -------------------------------------------------------------------------------- 1 | ;; Analyzed by ClojureScript 0.0-3211 2 | {:defs {app-db {:meta {:end-column 12, :end-line 10, :column 6, :line 10, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/re_frame/db.cljs"}, :file "resources/public/js/compiled/out/re_frame/db.cljs", :line 10, :column 1, :end-line 10, :end-column 12, :test true, :name re-frame.db/app-db}}, :imports nil, :requires {reagent.core reagent.core, reagent reagent.core}, :uses nil, :require-macros nil, :use-macros nil, :excludes #{}, :doc nil, :name re-frame.db} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/db.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-3211 {} 2 | goog.provide('re_frame.db'); 3 | goog.require('cljs.core'); 4 | goog.require('reagent.core'); 5 | re_frame.db.app_db = reagent.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY); 6 | 7 | //# sourceMappingURL=db.js.map?rel=1446435319783 -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/db.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/re_frame\/db.js","sources":["db.cljs?rel=1446435319783"],"lineCount":7,"mappings":";AAAA;;;AASA,AAAKA,qBAAO,4BAAA,5BAACC","names":["re-frame.db\/app-db","reagent.core\/atom"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/handlers.cljs: -------------------------------------------------------------------------------- 1 | (ns re-frame.handlers 2 | (:require [re-frame.db :refer [app-db]] 3 | [re-frame.utils :refer [first-in-vector warn error]])) 4 | 5 | 6 | ;; -- composing middleware ----------------------------------------------------------------------- 7 | 8 | 9 | (defn report-middleware-factories 10 | "See https://github.com/Day8/re-frame/issues/65" 11 | [v] 12 | (letfn [(name-of-factory 13 | [f] 14 | (-> f meta :re-frame-factory-name)) 15 | (factory-names-in 16 | [v] 17 | (remove nil? (map name-of-factory v)))] 18 | (doseq [name (factory-names-in v)] 19 | (error "re-frame: \"" name "\" used incorrectly. Must be used like this \"(" name " ...)\", whereas you just used \"" name "\".")))) 20 | 21 | 22 | (defn comp-middleware 23 | "Given a vector of middleware, filter out any nils, and use \"comp\" to compose the elements. 24 | v can have nested vectors, and will be flattened before \"comp\" is applied. 25 | For convienience, if v is a function (assumed to be middleware already), just return it. 26 | Filtering out nils allows us to create Middleware conditionally like this: 27 | (comp-middleware [pure (when debug? debug)]) ;; that 'when' might leave a nil 28 | " 29 | [v] 30 | 31 | (cond 32 | (fn? v) v ;; assumed to be existing middleware 33 | (vector? v) (let [v (remove nil? (flatten v)) 34 | _ (report-middleware-factories v)] ;; damn error detection! always messes up the code 35 | (cond 36 | (empty? v) identity ;; no-op middleware 37 | (= 1 (count v)) (first v) ;; only one middleware, no composing needed 38 | :else (apply comp v))) 39 | :else (warn "re-frame: comp-middleware expects a vector, got: " v))) 40 | 41 | 42 | ;; -- the register of event handlers -------------------------------------------------------------- 43 | 44 | (def ^:private id->fn (atom {})) 45 | 46 | 47 | (defn lookup-handler 48 | [event-id] 49 | (get @id->fn event-id)) 50 | 51 | 52 | (defn clear-handlers! 53 | "Unregister all event handlers" 54 | [] 55 | (reset! id->fn {})) 56 | 57 | 58 | (defn register-base 59 | "register a handler for an event. 60 | This is low level and it is expected that \"re-frame.core/register-handler\" would 61 | generally be used." 62 | ([event-id handler-fn] 63 | (when (contains? @id->fn event-id) 64 | (warn "re-frame: overwriting an event-handler for: " event-id)) ;; allow it, but warn. 65 | (swap! id->fn assoc event-id handler-fn)) 66 | 67 | ([event-id middleware handler-fn] 68 | (let [mid-ware (comp-middleware middleware) ;; compose the middleware 69 | midware+hfn (mid-ware handler-fn)] ;; wrap the handler in the middleware 70 | (register-base event-id midware+hfn)))) 71 | 72 | 73 | 74 | 75 | ;; -- lookup and call ----------------------------------------------------------------------------- 76 | 77 | (def ^:dynamic *handling* nil) ;; remember what event we are currently handling 78 | 79 | 80 | (defn handle 81 | "Given an event vector, look up the handler, then call it. 82 | By default, handlers are not assumed to be pure. They are called with 83 | two paramters: 84 | - the `app-db` atom 85 | - the event vector 86 | The handler is assumed to side-effect on `app-db` - the return value is ignored. 87 | To write a pure handler, use the \"pure\" middleware when registering the handler." 88 | [event-v] 89 | (let [event-id (first-in-vector event-v) 90 | handler-fn (lookup-handler event-id)] 91 | (if (nil? handler-fn) 92 | (error "re-frame: no event handler registered for: \"" event-id "\". Ignoring.") 93 | (if *handling* 94 | (error "re-frame: while handling \"" *handling* "\" dispatch-sync was called for \"" event-v "\". You can't call dispatch-sync in an event handler.") 95 | (binding [*handling* event-v] 96 | (handler-fn app-db event-v)))))) 97 | 98 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/handlers.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/re_frame\/handlers.js","sources":["handlers.cljs?rel=1446435319825"],"lineCount":177,"mappings":";AAAA;;;;AAQA;;;gDAAA,hDAAMA,wGAEHC;AAFH,AAGE,sBAAA,0EACWC;AADX,AAEU,OAAA,sHAAA,yBAAIA,zBAAEC;;uBAFhB,2EAIWF;AAJX,AAKU,OAACG,2BAAOC,qBAAK,AAACC,wBAAIC,gBAAgBN;;AAL5C,AAME,IAAAO,aAAA,AAAAC,wBAAa,AAACc,2BAAiBtB;IAA\/BS,eAAA;IAAAC,eAAA;IAAAC,WAAA;;AAAA,AAAA,GAAA,AAAA,CAAAA,WAAAD;AAAA,WAAA,AAAAE,yBAAAH,aAAAE,7CAAQU;AAAR,AAAA,AACE,+BAAA,oBAAA,uDAAA,yCAAA,nJAACE,8CAAqBF,uDAAuDA,yCAAyCA;;AADxH,eAAAd;eAAAE;eAAAC;eAAA,CAAAC,WAAA;;;;;;;AAAA,IA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AAAC,MAAA,eAAA,iCAAA,AAAA;;;;;AAAA,AAAA,gEAAA,hEAAMD,2EAIFN,SAASQ;AAJb,AAKI,GAAM,oCAAA,AAAAP,pCAACQ,8DAAWZ,6BAAOG;AAAzB,AACE,8BAAA,9BAACJ,6EAAoDI;;AADvD;;AAEA,OAACU,+BAAMb,4BAAOc,gBAAMX,SAASQ;;;AAPjC,AAAA,gEAAA,hEAAMF,2EASFN,SAASY,WAAWJ;AATxB,AAUI,IAAOK,WAAY,AAAC3B,4CAAgB0B;IAC7BE,mBAAY,AAACD,mBAASL;AAD7B,AAEE,OAACF,0CAAcN,SAASc;;;AAZ9B,AAAA,0DAAA,1DAAMR;AAmBN,yCAAA,zCAAeS;AAGf;;;;;;;;;2BAAA,3BAAMC,8DAQHC;AARH,AASE,IAAMjB,WAAY,AAACkB,yCAAgBD;IAC7BT,aAAY,AAACT,2CAAeC;AADlC,AAEE,GAAI,eAAA,dAAMQ;AACR,sCAAA,yDAAA,xFAACvB,+EAAsDe;;AACvD,oBAAKe;AACH,sCAAA,qEAAA,8CAAA,lJAAC9B,6DAAqC8B,6EAAkDE;;AACxF,IAAAE,4BAAUJ;AAAV,AAAA,AAAUA,yCAAYE;;AAAtB,IAAA,AACE,OAACT,qBAAWY,mBAAOH;UADrB,AAAA,yCAAAE,zCAAUJ","names":["re-frame.handlers\/report-middleware-factories","v","f","cljs.core\/meta","cljs.core\/remove","cljs.core\/nil?","cljs.core\/map","name-of-factory","seq__25580","cljs.core\/seq","chunk__25581","count__25582","i__25583","cljs.core\/-nth","temp__4126__auto__","cljs.core\/chunked-seq?","c__18945__auto__","cljs.core\/chunk-first","cljs.core\/chunk-rest","cljs.core\/count","cljs.core\/first","cljs.core\/next","name","factory-names-in","re-frame.utils\/error","re-frame.handlers\/comp-middleware","cljs.core\/fn?","cljs.core\/vector?","cljs.core\/flatten","_","cljs.core\/empty?","cljs.core\/identity","cljs.core\/=","cljs.core\/apply","cljs.core\/comp","re-frame.utils\/warn","re-frame.handlers\/id->fn","cljs.core\/atom","re-frame.handlers\/lookup-handler","event-id","cljs.core\/deref","cljs.core\/get","re-frame.handlers\/clear-handlers!","cljs.core\/reset!","G__25597","re-frame.handlers\/register-base","js\/Error","handler-fn","cljs.core\/contains?","cljs.core\/swap!","cljs.core\/assoc","middleware","mid-ware","midware+hfn","re-frame.handlers\/*handling*","re-frame.handlers\/handle","event-v","re-frame.utils\/first-in-vector","*handling*25600","re-frame.db\/app-db"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/middleware.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/re_frame\/middleware.js","sources":["middleware.cljs?rel=1446435319572"],"lineCount":292,"mappings":";AAAA;;;;;;AAWA;;;;;;;;;;;2BAAA,3BAAMA,8DAUHC;AAVH,AAWE,yDACGC,OAAOC;AADV,AAEE,GAAI,EAAK,iBAAAC,WAA0BF;AAA1B,AAAA,GAAAE;AAAA,IAAAC,qBAAA;AAAA,AAAA,oBAAA,iBAAAC,oBAAAD;AAAA,AAAA,oBAAAC;AAAAA;;AAAA,OAAAF;;;AAAA;;AAAA,GAAA,EAAA,AAAAA;AAAA,OAAAG,wEAAAH,5BAAYI;;AAAZ;;;;AAAA,OAAAD,wEAAAH,5BAAYI;;;AACnB,AACE,GAAI,AAACC,+BAAKP;AACR,8BAAA,9BAACQ;;AACD,8BAAA,9BAACA,wFAA+DR;;;AAClED;;AACF,SAAA,AAAAU,LAAMC,+BAASV;IACTW,SAAQ,AAACZ,kBAAQW,GAAGT;AAD1B,AAEE,GAAI,WAAA,VAAMU;AACR,sCAAA,\/BAACC;;AACD,GAAA,EAAQ,CAAYF,OAAGC;AACrB,OAACE,gCAAOb,OAAOW;;AADjB;;;;;;AAIV;;;;;;;;;;6BAAA,7BAAMG,kEASHf;AATH,AAUE,6DACGW,GAAGK;AADN,AAEE,8BAAA,9BAACP;;AACD,IAAA,AACE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ACxC,kBAAQW,GAAGT;;;GAbpB,2CAAA,wFAAA;AAgBF;;;;;;;;;;;;;;;;;;;AAAKyC,6BAkBH,oBAAA,qCAEGC;AAFH,AAGE,gEACG5C;AADH,AAEE,iFACGW,GAAGK;AADN,AAEE,OAAC4B,YAAE,AAAC5C,kBAAQW,GAAGK,GAAGA;;;GAPxB,2CAAA,wFAAA;AAUF;;;;;;;;AAAK6B,4BAOH,oBAAA,oCAEGD;AAFH,AAGE,8DACG5C;AADH,AAEE,8EACGW,GAAGK;AADN,AAEE,IAAMJ,SAAO,AAACZ,kBAAQW,GAAGK;AAAzB,AACE,AAAC4B,YAAEhC,OAAOI;;AACVJ;;;GATR,2CAAA,wFAAA;AAcF;;;;;;;;;;;;;;;;;;;;;AAAMkC,iCAoBJ,oBAAA;yDAEGF,EAAEG,SAAWC;AAFhB,AAGE,wEACGhD;AADH,AAEE,6FACGW,GAAGK;AADN,AAEE,IACMJ,SAAO,AAACZ,kBAAQW,GAAGK;IAGnBiC,UAAa,wBAAA,xBAACE;kBAADD;AAAA,AAAM,yCAAAA,lCAACZ,2BAAO1B;;CAAUoC;IACrCI,UAAa,wBAAA,xBAACD;kBAADE;AAAA,AAAM,qCAAAA,9BAACf,2BAAO3B;;CAAMqC;IACjCM,qBAAa,AAACC,yBAAKC,uBAAO,AAACL,wBAAIM,2BAAWR,QAAQG;AANxD,AASE,oBAAIE;AACF,OAACjB,6BAASzB,OAAOmC,SAAS,AAACW,0BAAMd,EAAEK;;AACnCrC;;;;;+CAhBPgC,EAAEG;IAAWC;;;;EAAAA;;0DAAbJ,EAAEG,SAAWC;;;IAAbJ;;IAAEG;IAAWC;gDAAbJ,EAAEG,SAAWC;;;;;CAFhB,2CAAA,wFAAA","names":["re-frame.middleware\/pure","handler","app-db","event-vec","G__25484","bit__18834__auto__","or__18160__auto__","cljs.core\/native-satisfies?","reagent.ratom\/IReactiveAtom","cljs.core\/map?","re-frame.utils\/warn","cljs.core\/deref","db","new-db","re-frame.utils\/error","cljs.core\/reset!","re-frame.middleware\/log-ex","v","e25488","e","js\/console","re-frame.middleware\/debug","re-frame.utils\/log","re-frame.utils\/group","diff","clojure.data\/diff","cljs.core\/first","cljs.core\/second","re-frame.utils\/groupEnd","re-frame.middleware\/trim-v","cljs.core\/vec","cljs.core\/rest","re-frame.middleware\/path","args","path","cljs.core\/flatten","_","cljs.core\/empty?","cljs.core\/assoc-in","cljs.core\/get-in","re-frame.middleware\/undoable","explanation","cljs.core\/fn?","re-frame.undo\/store-now!","re-frame.middleware\/enrich","f","re-frame.middleware\/after","re-frame.middleware\/on-changes","out-path","in-paths","new-ins","p1__25491#","cljs.core\/map","old-ins","p1__25492#","changed-ins?","cljs.core\/some","cljs.core\/false?","cljs.core\/identical?","cljs.core\/apply"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/router.cljs: -------------------------------------------------------------------------------- 1 | (ns re-frame.router 2 | (:refer-clojure :exclude [flush]) 3 | (:require-macros [cljs.core.async.macros :refer [go-loop go]]) 4 | (:require [reagent.core :refer [flush]] 5 | [re-frame.handlers :refer [handle]] 6 | [re-frame.utils :refer [warn error]] 7 | [cljs.core.async :refer [chan put! fn (atom {})) 10 | 11 | 12 | (defn clear-handlers! 13 | "Unregisters all subscription handlers" 14 | [] 15 | (reset! key->fn {})) 16 | 17 | 18 | (defn register 19 | "Registers a handler function for an id" 20 | [key-v handler-fn] 21 | (if (contains? @key->fn key-v) 22 | (warn "re-frame: overwriting subscription-handler for: " key-v)) ;; allow it, but warn. 23 | (swap! key->fn assoc key-v handler-fn)) 24 | 25 | 26 | (defn subscribe 27 | "Returns a reagent/reaction which observes a part of app-db" 28 | [v] 29 | (let [key-v (first-in-vector v) 30 | handler-fn (get @key->fn key-v)] 31 | (if (nil? handler-fn) 32 | (error "re-frame: no subscription handler registered for: \"" key-v "\". Returning a nil subscription.") 33 | (handler-fn app-db v)))) 34 | 35 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/subs.cljs.cache.edn: -------------------------------------------------------------------------------- 1 | ;; Analyzed by ClojureScript 0.0-3211 2 | {:defs {subscribe {:protocol-inline nil, :meta {:arglists (quote ([v])), :doc "Returns a reagent/reaction which observes a part of app-db", :end-column 16, :end-line 26, :column 7, :line 26, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/re_frame/subs.cljs"}, :name re-frame.subs/subscribe, :variadic false, :file "resources/public/js/compiled/out/re_frame/subs.cljs", :end-column 16, :method-params ([v]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 26, :end-line 26, :max-fixed-arity 1, :fn-var true, :arglists (quote ([v])), :doc "Returns a reagent/reaction which observes a part of app-db", :test true}, register {:protocol-inline nil, :meta {:arglists (quote ([key-v handler-fn])), :doc "Registers a handler function for an id", :end-column 15, :end-line 18, :column 7, :line 18, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/re_frame/subs.cljs"}, :name re-frame.subs/register, :variadic false, :file "resources/public/js/compiled/out/re_frame/subs.cljs", :end-column 15, :method-params ([key-v handler-fn]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 18, :end-line 18, :max-fixed-arity 2, :fn-var true, :arglists (quote ([key-v handler-fn])), :doc "Registers a handler function for an id", :test true}, clear-handlers! {:protocol-inline nil, :meta {:arglists (quote ([])), :doc "Unregisters all subscription handlers", :end-column 22, :end-line 12, :column 7, :line 12, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/re_frame/subs.cljs"}, :name re-frame.subs/clear-handlers!, :variadic false, :file "resources/public/js/compiled/out/re_frame/subs.cljs", :end-column 22, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 12, :end-line 12, :max-fixed-arity 0, :fn-var true, :arglists (quote ([])), :doc "Unregisters all subscription handlers", :test true}, key->fn {:meta {:private true, :end-column 23, :end-line 9, :column 16, :line 9, :file "/home/maty/vacuumlabs/clojurescript/example/resources/public/js/compiled/out/re_frame/subs.cljs"}, :file "resources/public/js/compiled/out/re_frame/subs.cljs", :line 9, :column 1, :end-line 9, :end-column 23, :private true, :test true, :name re-frame.subs/key->fn}}, :imports nil, :requires {re-frame.utils re-frame.utils, re-frame.db re-frame.db, reagent.ratom reagent.ratom}, :uses {app-db re-frame.db, warn re-frame.utils, make-reaction reagent.ratom, first-in-vector re-frame.utils, error re-frame.utils}, :require-macros nil, :use-macros nil, :excludes #{}, :doc nil, :name re-frame.subs} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/subs.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-3211 {} 2 | goog.provide('re_frame.subs'); 3 | goog.require('cljs.core'); 4 | goog.require('re_frame.utils'); 5 | goog.require('re_frame.db'); 6 | goog.require('reagent.ratom'); 7 | re_frame.subs.key__GT_fn = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY); 8 | /** 9 | * Unregisters all subscription handlers 10 | */ 11 | re_frame.subs.clear_handlers_BANG_ = (function re_frame$subs$clear_handlers_BANG_(){ 12 | return cljs.core.reset_BANG_.call(null,re_frame.subs.key__GT_fn,cljs.core.PersistentArrayMap.EMPTY); 13 | }); 14 | /** 15 | * Registers a handler function for an id 16 | */ 17 | re_frame.subs.register = (function re_frame$subs$register(key_v,handler_fn){ 18 | if(cljs.core.contains_QMARK_.call(null,cljs.core.deref.call(null,re_frame.subs.key__GT_fn),key_v)){ 19 | re_frame.utils.warn.call(null,"re-frame: overwriting subscription-handler for: ",key_v); 20 | } else { 21 | } 22 | 23 | return cljs.core.swap_BANG_.call(null,re_frame.subs.key__GT_fn,cljs.core.assoc,key_v,handler_fn); 24 | }); 25 | /** 26 | * Returns a reagent/reaction which observes a part of app-db 27 | */ 28 | re_frame.subs.subscribe = (function re_frame$subs$subscribe(v){ 29 | var key_v = re_frame.utils.first_in_vector.call(null,v); 30 | var handler_fn = cljs.core.get.call(null,cljs.core.deref.call(null,re_frame.subs.key__GT_fn),key_v); 31 | if((handler_fn == null)){ 32 | return re_frame.utils.error.call(null,"re-frame: no subscription handler registered for: \"",key_v,"\". Returning a nil subscription."); 33 | } else { 34 | return handler_fn.call(null,re_frame.db.app_db,v); 35 | } 36 | }); 37 | 38 | //# sourceMappingURL=subs.js.map?rel=1446435319792 -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/subs.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/re_frame\/subs.js","sources":["subs.cljs?rel=1446435319792"],"lineCount":38,"mappings":";AAAA;;;;;AAQA,AAAeA,2BAAQ,yBAAA,zBAACC;AAGxB;;;qCAAA,rCAAMC;AAAN,AAGE,gEAAA,zDAACC,gCAAOH;;AAGV;;;yBAAA,zBAAMI,0DAEHC,MAAMC;AAFT,AAGE,GAAI,oCAAA,AAAAC,pCAACC,8DAAWR,0BAAQK;AACtB,8BAAA,9BAACI,iFAAwDJ;;AAD3D;;AAEA,OAACK,+BAAMV,yBAAQW,gBAAMN,MAAMC;;AAG7B;;;0BAAA,1BAAMM,4DAEHC;AAFH,AAGE,IAAMR,QAAY,AAACS,yCAAgBD;IAC7BP,aAAY,wBAAA,AAAAC,xBAACQ,kDAAKf,0BAAQK;AADhC,AAEE,GAAI,eAAA,dAAMC;AACR,sCAAA,6DAAA,5FAACU,sFAA6DX;;AAC9D,OAACC,qBAAWW,mBAAOJ","names":["re-frame.subs\/key->fn","cljs.core\/atom","re-frame.subs\/clear-handlers!","cljs.core\/reset!","re-frame.subs\/register","key-v","handler-fn","cljs.core\/deref","cljs.core\/contains?","re-frame.utils\/warn","cljs.core\/swap!","cljs.core\/assoc","re-frame.subs\/subscribe","v","re-frame.utils\/first-in-vector","cljs.core\/get","re-frame.utils\/error","re-frame.db\/app-db"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/undo.cljs: -------------------------------------------------------------------------------- 1 | (ns re-frame.undo 2 | (:require-macros [reagent.ratom :refer [reaction]]) 3 | (:require 4 | [reagent.core :as reagent] 5 | [re-frame.utils :refer [warn]] 6 | [re-frame.db :refer [app-db]] 7 | [re-frame.handlers :as handlers] 8 | [re-frame.subs :as subs])) 9 | 10 | 11 | ;; -- History ------------------------------------------------------------------------------------- 12 | ;; 13 | ;; 14 | (def ^:private max-undos "Maximum number of undo states maintained" (atom 50)) 15 | (defn set-max-undos! 16 | [n] 17 | (reset! max-undos n)) 18 | 19 | 20 | (def ^:private undo-list "A list of history states" (reagent/atom [])) 21 | (def ^:private redo-list "A list of future states, caused by undoing" (reagent/atom [])) 22 | 23 | ;; -- Explanations ----------------------------------------------------------- 24 | ;; 25 | ;; Each undo has an associated explanation which can be displayed to the user. 26 | ;; 27 | ;; Seems really ugly to have mirrored vectors, but ... 28 | ;; the code kinda falls out when you do. I'm feeling lazy. 29 | (def ^:private app-explain "Mirrors app-db" (reagent/atom "")) 30 | (def ^:private undo-explain-list "Mirrors undo-list" (reagent/atom [])) 31 | (def ^:private redo-explain-list "Mirrors redo-list" (reagent/atom [])) 32 | 33 | (defn- clear-undos! 34 | [] 35 | (reset! undo-list []) 36 | (reset! undo-explain-list [])) 37 | 38 | 39 | (defn- clear-redos! 40 | [] 41 | (reset! redo-list []) 42 | (reset! redo-explain-list [])) 43 | 44 | 45 | (defn clear-history! 46 | [] 47 | (clear-undos!) 48 | (clear-redos!) 49 | (reset! app-explain "")) 50 | 51 | 52 | (defn store-now! 53 | "Stores the value currently in app-db, so the user can later undo" 54 | [explanation] 55 | (clear-redos!) 56 | (reset! undo-list (vec (take 57 | @max-undos 58 | (conj @undo-list @app-db)))) 59 | (reset! undo-explain-list (vec (take 60 | @max-undos 61 | (conj @undo-explain-list @app-explain)))) 62 | (reset! app-explain explanation)) 63 | 64 | 65 | (defn undos? 66 | "Returns true if undos exist, false otherwise" 67 | [] 68 | (pos? (count @undo-list))) 69 | 70 | (defn redos? 71 | "Returns true if redos exist, false otherwise" 72 | [] 73 | (pos? (count @redo-list))) 74 | 75 | (defn undo-explanations 76 | "Returns list of undo descriptions or empty list if no undos" 77 | [] 78 | (if (undos?) 79 | (conj @undo-explain-list @app-explain) 80 | [])) 81 | 82 | ;; -- subscriptions ----------------------------------------------------------------------------- 83 | 84 | (subs/register 85 | :undos? 86 | (fn handler 87 | ; "return true if anything is stored in the undo list, otherwise false" 88 | [_ _] 89 | (reaction (undos?)))) 90 | 91 | (subs/register 92 | :redos? 93 | (fn handler 94 | ; "return true if anything is stored in the redo list, otherwise false" 95 | [_ _] 96 | (reaction (redos?)))) 97 | 98 | 99 | (subs/register 100 | :undo-explanations 101 | (fn handler 102 | ; "return a vector of string explanations ordered oldest to most recent" 103 | [_ _] 104 | (reaction (undo-explanations)))) 105 | 106 | (subs/register 107 | :redo-explanations 108 | (fn handler 109 | ; "returns a vector of string explanations ordered from most recent undo onward" 110 | [_ _] 111 | (reaction (deref redo-explain-list)))) 112 | 113 | ;; -- event handlers ---------------------------------------------------------------------------- 114 | 115 | 116 | (defn- undo 117 | [undos cur redos] 118 | (let [u @undos 119 | r (cons @cur @redos)] 120 | (reset! cur (last u)) 121 | (reset! redos r) 122 | (reset! undos (pop u)))) 123 | 124 | (defn- undo-n 125 | "undo n steps or until we run out of undos" 126 | [n] 127 | (when (and (pos? n) (undos?)) 128 | (undo undo-list app-db redo-list) 129 | (undo undo-explain-list app-explain redo-explain-list) 130 | (recur (dec n)))) 131 | 132 | (handlers/register-base ;; not a pure handler 133 | :undo ;; usage: (dispatch [:undo n]) n is optional, defaults to 1 134 | (fn handler 135 | [_ [_ n]] 136 | (if-not (undos?) 137 | (warn "re-frame: you did a (dispatch [:undo]), but there is nothing to undo.") 138 | (undo-n (or n 1))))) 139 | 140 | 141 | (defn- redo 142 | [undos cur redos] 143 | (let [u (conj @undos @cur) 144 | r @redos] 145 | (reset! cur (first r)) 146 | (reset! redos (rest r)) 147 | (reset! undos u))) 148 | 149 | (defn- redo-n 150 | "redo n steps or until we run out of redos" 151 | [n] 152 | (when (and (pos? n) (redos?)) 153 | (redo undo-list app-db redo-list) 154 | (redo undo-explain-list app-explain redo-explain-list) 155 | (recur (dec n)))) 156 | 157 | (handlers/register-base ;; not a pure handler 158 | :redo ;; usage: (dispatch [:redo n]) 159 | (fn handler ;; if n absent, defaults to 1 160 | [_ [_ n]] 161 | (if-not (redos?) 162 | (warn "re-frame: you did a (dispatch [:redo]), but there is nothing to redo.") 163 | (redo-n (or n 1))))) 164 | 165 | 166 | (handlers/register-base ;; not a pure handler 167 | :purge-redos ;; usage: (dispatch [:purge-redo]) 168 | (fn handler 169 | [_ _] 170 | (if-not (redos?) 171 | (warn "re-frame: you did a (dispatch [:purge-redos]), but there is nothing to redo.") 172 | (clear-redos!)))) 173 | 174 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/undo.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/re_frame\/undo.js","sources":["undo.cljs?rel=1446435319776"],"lineCount":215,"mappings":";AAAA;;;;;;;AAaA;;;AAAeA,0BAAqD,yBAAA,zBAACC;AACrE,oCAAA,pCAAMC,gFACHC;AADH,AAEE,OAACC,gCAAOJ,wBAAUG;;AAGpB;;;AAAeE,0BAAqC,4BAAA,5BAACC;AACrD;;;AAAeC,0BAAuD,4BAAA,5BAACD;AAQvE;;;AAAeE,4BAA6B,4BAAA,5BAACF;AAC7C;;;AAAeG,kCAAsC,4BAAA,5BAACH;AACtD;;;AAAeI,kCAAsC,4BAAA,5BAACJ;AAEtD,kCAAA,lCAAOK;AAAP,AAEE,wDAAA,xDAACP,gCAAOC;;AACR,uEAAA,hEAACD,gCAAOK;;AAGV,kCAAA,lCAAOG;AAAP,AAEE,wDAAA,xDAACR,gCAAOG;;AACR,uEAAA,hEAACH,gCAAOM;;AAGV,oCAAA,pCAAMG;AAAN,AAEE,AAACF;;AACD,AAACC;;AACD,iEAAA,1DAACR,gCAAOI;;AAGV;;;gCAAA,hCAAMM,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A,IAAA,\/CACMzB;QADN,AAAAgB,wBAAAS,WAAA,IAAA,3CACQhD;AADR,AAEE,GAAA,AAAAwC,wBAAQ,AAACpB;AACP,qCAAA,9BAACqB;;AACD,OAACK,+BAAO,iBAAAJ,oBAAI1C;AAAJ,AAAA,oBAAA0C;AAAAA;;AAAA;;;;;AAGd,0CAAA,1CAACN,6GAEC,gCACGb,EAAEA;AADL,AAEE,GAAA,AAAAiB,wBAAQ,AAACpB;AACP,qCAAA,9BAACqB;;AACD,OAAChC","names":["re-frame.undo\/max-undos","cljs.core\/atom","re-frame.undo\/set-max-undos!","n","cljs.core\/reset!","re-frame.undo\/undo-list","reagent.core\/atom","re-frame.undo\/redo-list","re-frame.undo\/app-explain","re-frame.undo\/undo-explain-list","re-frame.undo\/redo-explain-list","re-frame.undo\/clear-undos!","re-frame.undo\/clear-redos!","re-frame.undo\/clear-history!","re-frame.undo\/store-now!","explanation","cljs.core\/vec","cljs.core\/deref","cljs.core\/take","cljs.core\/conj","re-frame.db\/app-db","re-frame.undo\/undos?","cljs.core\/count","re-frame.undo\/redos?","re-frame.undo\/undo-explanations","re-frame.subs\/register","_","reagent.ratom\/make-reaction","re-frame.undo\/undo","undos","cur","redos","u","r","cljs.core\/cons","cljs.core\/last","cljs.core\/pop","re-frame.undo\/undo-n","and__18148__auto__","re-frame.handlers\/register-base","p__25563","vec__25565","cljs.core\/nth","cljs.core\/not","re-frame.utils\/warn","or__18160__auto__","re-frame.undo\/redo","cljs.core\/first","cljs.core\/rest","re-frame.undo\/redo-n","p__25567","vec__25569"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/utils.cljs: -------------------------------------------------------------------------------- 1 | (ns re-frame.utils 2 | (:require 3 | [clojure.set :refer [difference]])) 4 | 5 | 6 | ;; -- Logging ----------------------------------------------------------------- 7 | ;; 8 | ;; re-frame internally uses a set of logging functions which, by default, 9 | ;; print to js/console. 10 | ;; Use set-loggers! if you want to change this default behaviour. 11 | ;; In production environment, you may want to capture exceptions and POST 12 | ;; them somewhere. to , you might want to override the way that exceptions are 13 | ;; handled by overridding "error" 14 | ;; 15 | (def default-loggers 16 | {:log #(.log js/console %) 17 | :warn #(.warn js/console %) 18 | :error #(.error js/console %) 19 | :group #(if (.group js/console) (.group js/console %) (.log js/console %)) ;; group does not exist < IE 11 20 | :groupEnd #(when (.groupEnd js/console) (.groupEnd js/console))}) ;; groupEnd does not exist < IE 11 21 | 22 | ;; holds the current set of loggers. 23 | (def loggers (atom default-loggers)) 24 | 25 | (defn set-loggers! 26 | "Change the set (subset?) of logging functions used by re-frame. 27 | 'new-loggers' should be a map which looks like default-loggers" 28 | [new-loggers] 29 | (assert (empty? (difference (set (keys new-loggers)) (set (keys default-loggers)))) "Unknown keys in new-loggers") 30 | (swap! loggers merge new-loggers)) 31 | 32 | 33 | (defn log [& args] ((:log @loggers) (apply str args))) 34 | (defn warn [& args] ((:warn @loggers) (apply str args))) 35 | (defn group [& args] ((:group @loggers) (apply str args))) 36 | (defn groupEnd [& args] ((:groupEnd @loggers) (apply str args))) 37 | (defn error [& args] ((:error @loggers) (apply str args))) 38 | 39 | ;; -- Misc -------------------------------------------------------------------- 40 | 41 | (defn first-in-vector 42 | [v] 43 | (if (vector? v) 44 | (first v) 45 | (error "re-frame: expected a vector event, but got: " v))) 46 | 47 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/re_frame/utils.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/re_frame\/utils.js","sources":["utils.cljs?rel=1446435319857"],"lineCount":115,"mappings":";AAAA;;;AAcA,iCAAA,2CAAA,oDAAA,WAAAA,3IAAKI;AAAL,AACe,mBAAAJ,ZAAMK;GADrB,qDAAA,WAAAJ;AAAA,AAEe,oBAAAA,bAAOI;GAFtB,uDAAA,WAAAH;AAAA,AAGe,qBAAAA,dAAQG;GAHvB,sDAAA,WAAAF;AAAA,AAIe,oBAAI,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AAA,AAAA,OAAAD,0DAAA,AAAAX,wBAAAY;;AAIA,iCAAA,jCAAMC,0EACHC;AADH,AAEE,GAAI,AAACC,kCAAQD;AACX,OAACE,0BAAMF;;AACP,sCAAA,\/BAACH,8EAAqDG","names":["p1__25603#","p1__25604#","p1__25605#","p1__25606#","re-frame.utils\/default-loggers","js\/console","re-frame.utils\/loggers","cljs.core\/atom","re-frame.utils\/set-loggers!","new-loggers","js\/Error","cljs.core\/pr-str","cljs.core\/empty?","clojure.set\/difference","cljs.core\/set","cljs.core\/keys","cljs.core\/swap!","cljs.core\/merge","argseq__19200__auto__","cljs.core\/IndexedSeq","js\/Array.prototype.slice","re-frame.utils\/log","seq25607","cljs.core\/seq","args","cljs.core\/deref","cljs.core\/apply","cljs.core\/str","re-frame.utils\/warn","seq25608","re-frame.utils\/group","seq25609","re-frame.utils\/groupEnd","seq25610","re-frame.utils\/error","seq25611","re-frame.utils\/first-in-vector","v","cljs.core\/vector?","cljs.core\/first"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/reagent/debug.cljs: -------------------------------------------------------------------------------- 1 | (ns reagent.debug) 2 | 3 | ;; Empty file, to allow require with :refer-macros 4 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/reagent/debug.cljs.cache.edn: -------------------------------------------------------------------------------- 1 | ;; Analyzed by ClojureScript 0.0-3211 2 | {:imports nil, :requires nil, :uses nil, :require-macros nil, :use-macros nil, :excludes #{}, :doc nil, :name reagent.debug} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/reagent/debug.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-3211 {} 2 | goog.provide('reagent.debug'); 3 | goog.require('cljs.core'); 4 | 5 | //# sourceMappingURL=debug.js.map?rel=1446435318842 -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/reagent/debug.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/reagent\/debug.js","sources":["debug.cljs?rel=1446435318842"],"lineCount":5,"mappings":";AAAA","names":[]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/reagent/impl/batching.cljs: -------------------------------------------------------------------------------- 1 | (ns reagent.impl.batching 2 | (:refer-clojure :exclude [flush]) 3 | (:require [reagent.debug :refer-macros [dbg]] 4 | [reagent.interop :refer-macros [.' .!]] 5 | [reagent.ratom :as ratom] 6 | [reagent.impl.util :refer [is-client]] 7 | [clojure.string :as string])) 8 | 9 | ;;; Update batching 10 | 11 | (defonce mount-count 0) 12 | 13 | (defn next-mount-count [] 14 | (set! mount-count (inc mount-count))) 15 | 16 | (defn fake-raf [f] 17 | (js/setTimeout f 16)) 18 | 19 | (def next-tick 20 | (if-not is-client 21 | fake-raf 22 | (let [w js/window] 23 | (or (.' w :requestAnimationFrame) 24 | (.' w :webkitRequestAnimationFrame) 25 | (.' w :mozRequestAnimationFrame) 26 | (.' w :msRequestAnimationFrame) 27 | fake-raf)))) 28 | 29 | (defn compare-mount-order [c1 c2] 30 | (- (.' c1 :cljsMountOrder) 31 | (.' c2 :cljsMountOrder))) 32 | 33 | (defn run-queue [a] 34 | ;; sort components by mount order, to make sure parents 35 | ;; are rendered before children 36 | (.sort a compare-mount-order) 37 | (dotimes [i (alength a)] 38 | (let [c (aget a i)] 39 | (when (.' c :cljsIsDirty) 40 | (.' c forceUpdate))))) 41 | 42 | (defn run-funs [a] 43 | (dotimes [i (alength a)] 44 | ((aget a i)))) 45 | 46 | (deftype RenderQueue [^:mutable queue ^:mutable scheduled? 47 | ^:mutable after-render] 48 | Object 49 | (queue-render [this c] 50 | (.push queue c) 51 | (.schedule this)) 52 | (add-after-render [_ f] 53 | (.push after-render f)) 54 | (schedule [this] 55 | (when-not scheduled? 56 | (set! scheduled? true) 57 | (next-tick #(.run-queue this)))) 58 | (run-queue [_] 59 | (let [q queue aq after-render] 60 | (set! queue (array)) 61 | (set! after-render (array)) 62 | (set! scheduled? false) 63 | (run-queue q) 64 | (run-funs aq)))) 65 | 66 | (def render-queue (RenderQueue. (array) false (array))) 67 | 68 | (defn flush [] 69 | (.run-queue render-queue)) 70 | 71 | (defn queue-render [c] 72 | (.! c :cljsIsDirty true) 73 | (.queue-render render-queue c)) 74 | 75 | (defn mark-rendered [c] 76 | (.! c :cljsIsDirty false)) 77 | 78 | (defn do-after-flush [f] 79 | (.add-after-render render-queue f)) 80 | 81 | (defn do-later [f] 82 | (do-after-flush f) 83 | (.schedule render-queue)) 84 | 85 | ;; Render helper 86 | 87 | (defn is-reagent-component [c] 88 | (some-> c (.' :props) (.' :argv))) 89 | 90 | (defn run-reactively [c run] 91 | (assert (is-reagent-component c)) 92 | (mark-rendered c) 93 | (let [rat (.' c :cljsRatom)] 94 | (if (nil? rat) 95 | (let [res (ratom/capture-derefed run c) 96 | derefed (ratom/captured c)] 97 | (when (not (nil? derefed)) 98 | (.! c :cljsRatom 99 | (ratom/make-reaction run 100 | :auto-run #(queue-render c) 101 | :derefed derefed))) 102 | res) 103 | (ratom/run rat)))) 104 | 105 | (defn dispose [c] 106 | (some-> (.' c :cljsRatom) 107 | ratom/dispose!) 108 | (mark-rendered c)) 109 | 110 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/reagent/impl/batching.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/reagent\/impl\/batching.js","sources":["batching.cljs?rel=1446435318994"],"lineCount":209,"mappings":";AAAA;;;;;;;AAUA,GAAA,OAASA;AAAT;AAAA,AAAA,oCAAA,pCAASA;;AAET,yCAAA,zCAAMC;AAAN,AACE,OAAMD,oCAAY,qCAAA,pCAAKA;;AAEzB,iCAAA,jCAAME,0EAAUC;AAAhB,AACE,oBAAA,bAACC,WAAcD;;AAEjB,AAAKE,kCACH,EAAA,AAAAC,wBAAQC,8BACNL,+BACA,iBAAMM,IAAEC;AAAR,AACE,IAAAC,oBAAI,GAAA,F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A,FAAI3B;AAAd,AACE,GAAI,QAAA,PAAM2B;AACR,IAAMC,MAAI,AAACC,wCAAsBL,IAAIxB;IAC\/B8B,UAAQ,AAACC,iCAAe\/B;AAD9B,AAEE,GAAM,EAAK,YAAA,XAAM8B;AAAjB,AACE,GAAA,FAAI9B,iBACA,0CAAA,6DAAA,vGAACgC,sCAAoBR;;AAArB,AACgC,OAACP,6CAAajB;;CAD9C,0DAE8B8B;;AAJpC;;AAKAF;;AACF,OAACK,4BAAUN;;;AAEjB,gCAAA,hCAAMO,wEAASlC;AAAf,AACE,IAAAmC,iBAAQ,GAAA,FAAInC;IAAZmC,qBAAA,EAAA,CAAAA,kBAAA,OAAA,KAAA,sCAAAA,tCACQC;AADR,AAAAD;AAEA,OAACjB,8CAAclB","names":["reagent.impl.batching\/mount-count","reagent.impl.batching\/next-mount-count","reagent.impl.batching\/fake-raf","f","js\/setTimeout","reagent.impl.batching\/next-tick","cljs.core\/not","reagent.impl.util\/is-client","w","js\/window","or__18160__auto__","reagent.impl.batching\/compare-mount-order","c1","c2","reagent.impl.batching\/run-queue","a","n__19045__auto__","i","c","reagent.impl.batching\/run-funs","this__18739__auto__","writer__18740__auto__","opt__18741__auto__","cljs.core\/-write","reagent.impl.batching\/RenderQueue","reagent.impl.batching\/->RenderQueue","queue","scheduled?","after-render","this","_","q","aq","reagent.impl.batching\/render-queue","reagent.impl.batching\/flush","reagent.impl.batching\/queue-render","reagent.impl.batching\/mark-rendered","reagent.impl.batching\/do-after-flush","reagent.impl.batching\/do-later","reagent.impl.batching\/is-reagent-component","G__25241","reagent.impl.batching\/run-reactively","run","js\/Error","cljs.core\/pr-str","rat","res","reagent.ratom\/capture-derefed","derefed","reagent.ratom\/captured","reagent.ratom\/make-reaction","reagent.ratom\/run","reagent.impl.batching\/dispose","G__25243","reagent.ratom\/dispose!"]} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/reagent/impl/util.cljs: -------------------------------------------------------------------------------- 1 | (ns reagent.impl.util 2 | (:require [reagent.debug :refer-macros [dbg log warn]] 3 | [reagent.interop :refer-macros [.' .!]] 4 | [clojure.string :as string])) 5 | 6 | (def is-client (and (exists? js/window) 7 | (-> js/window (.' :document) nil? not))) 8 | 9 | ;;; Props accessors 10 | 11 | (defn extract-props [v] 12 | (let [p (nth v 1 nil)] 13 | (if (map? p) p))) 14 | 15 | (defn extract-children [v] 16 | (let [p (nth v 1 nil) 17 | first-child (if (or (nil? p) (map? p)) 2 1)] 18 | (if (> (count v) first-child) 19 | (subvec v first-child)))) 20 | 21 | (defn get-argv [c] 22 | (.' c :props.argv)) 23 | 24 | (defn get-props [c] 25 | (-> (.' c :props.argv) extract-props)) 26 | 27 | (defn get-children [c] 28 | (-> (.' c :props.argv) extract-children)) 29 | 30 | (defn reagent-component? [c] 31 | (-> (.' c :props.argv) nil? not)) 32 | 33 | (defn cached-react-class [c] 34 | (.' c :cljsReactClass)) 35 | 36 | (defn cache-react-class [c constructor] 37 | (.! c :cljsReactClass constructor)) 38 | 39 | ;; Misc utilities 40 | 41 | (defn memoize-1 [f] 42 | (let [mem (atom {})] 43 | (fn [arg] 44 | (let [v (get @mem arg)] 45 | (if-not (nil? v) 46 | v 47 | (let [ret (f arg)] 48 | (swap! mem assoc arg ret) 49 | ret)))))) 50 | 51 | (def dont-camel-case #{"aria" "data"}) 52 | 53 | (defn capitalize [s] 54 | (if (< (count s) 2) 55 | (string/upper-case s) 56 | (str (string/upper-case (subs s 0 1)) (subs s 1)))) 57 | 58 | (defn dash-to-camel [dashed] 59 | (if (string? dashed) 60 | dashed 61 | (let [name-str (name dashed) 62 | [start & parts] (string/split name-str #"-")] 63 | (if (dont-camel-case start) 64 | name-str 65 | (apply str start (map capitalize parts)))))) 66 | 67 | 68 | (deftype partial-ifn [f args ^:mutable p] 69 | IFn 70 | (-invoke [_ & a] 71 | (or p (set! p (apply clojure.core/partial f args))) 72 | (apply p a)) 73 | IEquiv 74 | (-equiv [_ other] 75 | (and (= f (.-f other)) (= args (.-args other)))) 76 | IHash 77 | (-hash [_] (hash [f args]))) 78 | 79 | (defn- merge-class [p1 p2] 80 | (let [class (when-let [c1 (:class p1)] 81 | (when-let [c2 (:class p2)] 82 | (str c1 " " c2)))] 83 | (if (nil? class) 84 | p2 85 | (assoc p2 :class class)))) 86 | 87 | (defn- merge-style [p1 p2] 88 | (let [style (when-let [s1 (:style p1)] 89 | (when-let [s2 (:style p2)] 90 | (merge s1 s2)))] 91 | (if (nil? style) 92 | p2 93 | (assoc p2 :style style)))) 94 | 95 | (defn merge-props [p1 p2] 96 | (if (nil? p1) 97 | p2 98 | (do 99 | (assert (map? p1)) 100 | (merge-style p1 (merge-class p1 (merge p1 p2)))))) 101 | 102 | 103 | (def ^:dynamic *always-update* false) 104 | 105 | (defonce roots (atom {})) 106 | 107 | (defn clear-container [node] 108 | ;; If render throws, React may get confused, and throw on 109 | ;; unmount as well, so try to force React to start over. 110 | (try 111 | (.' js/React unmountComponentAtNode node) 112 | (catch js/Object e 113 | (do (warn "Error unmounting:") 114 | (log e))))) 115 | 116 | (defn render-component [comp container callback] 117 | (try 118 | (binding [*always-update* true] 119 | (.' js/React render (comp) container 120 | (fn [] 121 | (binding [*always-update* false] 122 | (swap! roots assoc container [comp container]) 123 | (if (some? callback) 124 | (callback)))))) 125 | (catch js/Object e 126 | (do (clear-container container) 127 | (throw e))))) 128 | 129 | (defn re-render-component [comp container] 130 | (render-component comp container nil)) 131 | 132 | (defn unmount-component-at-node [container] 133 | (swap! roots dissoc container) 134 | (.' js/React unmountComponentAtNode container)) 135 | 136 | (defn force-update-all [] 137 | (doseq [v (vals @roots)] 138 | (apply re-render-component v)) 139 | "Updated") 140 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/reagent/interop.cljs: -------------------------------------------------------------------------------- 1 | (ns reagent.interop) 2 | 3 | ;; Empty 4 | -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/reagent/interop.cljs.cache.edn: -------------------------------------------------------------------------------- 1 | ;; Analyzed by ClojureScript 0.0-3211 2 | {:imports nil, :requires nil, :uses nil, :require-macros nil, :use-macros nil, :excludes #{}, :doc nil, :name reagent.interop} -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/reagent/interop.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-3211 {} 2 | goog.provide('reagent.interop'); 3 | goog.require('cljs.core'); 4 | 5 | //# sourceMappingURL=interop.js.map?rel=1446435319413 -------------------------------------------------------------------------------- /example/resources/public/js/compiled/out/reagent/interop.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"\/home\/maty\/vacuumlabs\/clojurescript\/example\/resources\/public\/js\/compiled\/out\/reagent\/interop.js","sources":["interop.cljs?rel=1446435319413"],"lineCount":5,"mappings":";AAAA","names":[]} -------------------------------------------------------------------------------- /example/src/clj/example/core.clj: -------------------------------------------------------------------------------- 1 | (ns example.core) 2 | -------------------------------------------------------------------------------- /example/src/cljs/example/core.cljs: -------------------------------------------------------------------------------- 1 | (ns example.core 2 | (:require-macros [reagent.ratom :refer [reaction]]) 3 | (:require [reagent.core :as reagent] 4 | [re-frame.core :as re-frame] 5 | [example.handlers] 6 | [example.subs] 7 | [example.views :as views])) 8 | 9 | 10 | (def whole-db-dont-use (re-frame/subscribe [:whole-db-dont-use])) 11 | 12 | (enable-console-print!) 13 | 14 | 15 | (defn mount-root [] ; [views/main-panel] 16 | (reagent/render [views/comp-with-state] 17 | (.getElementById js/document "app"))) 18 | 19 | (defn ^:export init [] 20 | (re-frame/dispatch-sync [:initialize-db]) 21 | (mount-root)) 22 | -------------------------------------------------------------------------------- /example/src/cljs/example/db.cljs: -------------------------------------------------------------------------------- 1 | (ns example.db) 2 | 3 | (def default-db 4 | {:name "re-frame" 5 | :counter 0}) 6 | -------------------------------------------------------------------------------- /example/src/cljs/example/handlers.cljs: -------------------------------------------------------------------------------- 1 | (ns example.handlers 2 | (:require [re-frame.core :as re-frame] 3 | [example.db :as db])) 4 | 5 | 6 | [:action-type arguments] 7 | 8 | (re-frame/register-handler 9 | :initialize-db 10 | (fn [db [type args]] 11 | db/default-db)) 12 | 13 | 14 | 15 | (re-frame/register-handler 16 | :inc-counter-by 17 | (fn [db [_ by]] 18 | (update-in db [:counter] + by))) 19 | -------------------------------------------------------------------------------- /example/src/cljs/example/subs.cljs: -------------------------------------------------------------------------------- 1 | (ns example.subs 2 | (:require-macros [reagent.ratom :refer [reaction]]) 3 | (:require [re-frame.core :as re-frame])) 4 | 5 | (re-frame/register-sub 6 | :name 7 | (fn [db] 8 | (reaction (:name @db)))) 9 | 10 | 11 | (re-frame/register-sub 12 | :counter 13 | (fn [db] 14 | (reaction (:counter @db)))) 15 | 16 | (re-frame/register-sub 17 | :whole-db-dont-use 18 | (fn [db] 19 | db)) 20 | -------------------------------------------------------------------------------- /example/src/cljs/example/views.cljs: -------------------------------------------------------------------------------- 1 | (ns example.views 2 | (:require [re-frame.core :as re-frame])) 3 | 4 | (defn main-panel [] 5 | (let [name (re-frame/subscribe [:name])] 6 | (fn [] 7 | [:div "Hello from " @name]))) 8 | 9 | 10 | (defn counter [state-from-props] 11 | [:div "Value of counter is:" state-from-props]) 12 | 13 | 14 | (defn my-first-component [{:keys [name address]}] 15 | [:div "This is my component " name address]) 16 | 17 | 18 | (defn comp-with-state [] 19 | (let [counter (re-frame/subscribe [:counter])] 20 | (fn [] 21 | [:div 22 | "With local state Value of counter is:" @counter 23 | [:button {:on-click #(re-frame/dispatch [:inc-counter-by 1])} "inc by 1"] 24 | [:button {:on-click #(re-frame/dispatch [:inc-counter-by 2])} "inc by 2"] 25 | ]))) 26 | 27 | -------------------------------------------------------------------------------- /example/target/figwheel_temp/dev/figwheel/connect.cljs: -------------------------------------------------------------------------------- 1 | (ns figwheel.connect (:require [example.core] [figwheel.client] [figwheel.client.utils])) 2 | (figwheel.client/start {:websocket-url "ws://localhost:3449/figwheel-ws", :on-jsload (fn [& x] (if js/example.core.mount-root (apply js/example.core.mount-root x) (figwheel.client.utils/log :debug "Figwheel: :on-jsload hook 'example.core/mount-root' is missing"))), :build-id "dev"}) 3 | 4 | -------------------------------------------------------------------------------- /example/target/repl-port: -------------------------------------------------------------------------------- 1 | 56467 -------------------------------------------------------------------------------- /example/target/stale/extract-native.dependencies: -------------------------------------------------------------------------------- 1 | ([:dependencies ([org.clojure/clojure "1.6.0"] [org.clojure/clojurescript "0.0-3211"] [reagent/reagent "0.5.0"] [re-frame/re-frame "0.4.1"] [org.clojure/tools.nrepl "0.2.3" :exclusions ([org.clojure/clojure])] [clojure-complete/clojure-complete "0.2.3" :exclusions ([org.clojure/clojure])] [lein-light-nrepl/lein-light-nrepl "0.1.0"] [org.clojure/tools.reader "0.8.3"])]) -------------------------------------------------------------------------------- /presentation/Learn basics of Clojure 4-3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matystl/clojure-workshop/aa826b31092e350376166d402ac3206dcdb53322/presentation/Learn basics of Clojure 4-3.pdf -------------------------------------------------------------------------------- /presentation/Learn basics of Clojure.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matystl/clojure-workshop/aa826b31092e350376166d402ac3206dcdb53322/presentation/Learn basics of Clojure.pdf -------------------------------------------------------------------------------- /presentation/Learn basics of Clojure.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matystl/clojure-workshop/aa826b31092e350376166d402ac3206dcdb53322/presentation/Learn basics of Clojure.pptx --------------------------------------------------------------------------------