added github pages support
This commit is contained in:
1 parent
b14ebdbf63
commit
6ed638a1cc
373 files changed
+185436
-2343
No files matched your search
@@ -0,0 +1,562 @@
|
||||
(ns figwheel.client.file-reloading
|
||||
(:require
|
||||
[figwheel.client.utils :as utils :refer-macros [dev-assert]]
|
||||
[goog.Uri :as guri]
|
||||
[goog.string]
|
||||
[goog.object :as gobj]
|
||||
[goog.net.jsloader :as loader]
|
||||
[goog.html.legacyconversions :as conv]
|
||||
[goog.string :as gstring]
|
||||
[clojure.string :as string]
|
||||
[clojure.set :refer [difference]]
|
||||
[cljs.core.async :refer [put! chan <! map< close! timeout alts!] :as async])
|
||||
(:require-macros
|
||||
[cljs.core.async.macros :refer [go go-loop]])
|
||||
(:import [goog]
|
||||
[goog.async Deferred]))
|
||||
|
||||
(declare queued-file-reload)
|
||||
|
||||
(defonce figwheel-meta-pragmas (atom {}))
|
||||
|
||||
;; you can listen to this event easily like so:
|
||||
;; document.body.addEventListener("figwheel.js-reload", function (e) {console.log(e.detail);} );
|
||||
(defn on-jsload-custom-event [url]
|
||||
(utils/dispatch-custom-event "figwheel.js-reload" url))
|
||||
|
||||
;; you can listen to this event easily like so:
|
||||
;; document.body.addEventListener("figwheel.before-js-reload", function (e) { console.log(e.detail);} );
|
||||
(defn before-jsload-custom-event [files]
|
||||
(utils/dispatch-custom-event "figwheel.before-js-reload" files))
|
||||
|
||||
;; you can listen to this event easily like so:
|
||||
;; document.body.addEventListener("figwheel.css-reload", function (e) {console.log(e.detail);} );
|
||||
(defn on-cssload-custom-event [files]
|
||||
(utils/dispatch-custom-event "figwheel.css-reload" files))
|
||||
|
||||
|
||||
#_(defn all? [pred coll]
|
||||
(reduce #(and %1 %2) true (map pred coll)))
|
||||
|
||||
(defn namespace-file-map? [m]
|
||||
(or
|
||||
(and (map? m)
|
||||
(string? (:namespace m))
|
||||
(or (nil? (:file m))
|
||||
(string? (:file m)))
|
||||
(= (:type m)
|
||||
:namespace))
|
||||
(do
|
||||
(println "Error not namespace-file-map" (pr-str m))
|
||||
false)))
|
||||
|
||||
;; this assumes no query string on url
|
||||
(defn add-cache-buster [url]
|
||||
(dev-assert (string? url))
|
||||
(.makeUnique (guri/parse url)))
|
||||
|
||||
(defn name->path [ns]
|
||||
(dev-assert (string? ns))
|
||||
(gobj/get js/goog.dependencies_.nameToPath ns))
|
||||
|
||||
(defn provided? [ns]
|
||||
(gobj/get js/goog.dependencies_.written (name->path ns)))
|
||||
|
||||
(defn immutable-ns? [name]
|
||||
(or (#{"goog" "cljs.core" "cljs.nodejs"} name)
|
||||
(goog.string/startsWith "clojure." name)
|
||||
(goog.string/startsWith "goog." name)))
|
||||
|
||||
(defn get-requires [ns]
|
||||
(->> ns
|
||||
name->path
|
||||
(gobj/get js/goog.dependencies_.requires)
|
||||
(gobj/getKeys)
|
||||
(filter #(not (immutable-ns? %)))
|
||||
set))
|
||||
|
||||
(defonce dependency-data (atom {:pathToName {} :dependents {}}))
|
||||
|
||||
(defn path-to-name! [path name]
|
||||
(swap! dependency-data update-in [:pathToName path] (fnil clojure.set/union #{}) #{name}))
|
||||
|
||||
(defn setup-path->name!
|
||||
"Setup a path to name dependencies map.
|
||||
That goes from path -> #{ ns-names }"
|
||||
[]
|
||||
;; we only need this for dependents
|
||||
(let [nameToPath (gobj/filter js/goog.dependencies_.nameToPath
|
||||
(fn [v k o] (gstring/startsWith v "../")))]
|
||||
(gobj/forEach nameToPath (fn [v k o] (path-to-name! v k)))))
|
||||
|
||||
(defn path->name
|
||||
"returns a set of namespaces defined by a path"
|
||||
[path]
|
||||
(get-in @dependency-data [:pathToName path]))
|
||||
|
||||
(defn name-to-parent! [ns parent-ns]
|
||||
(swap! dependency-data update-in [:dependents ns] (fnil clojure.set/union #{}) #{parent-ns}))
|
||||
|
||||
(defn setup-ns->dependents!
|
||||
"This reverses the goog.dependencies_.requires for looking up ns-dependents."
|
||||
[]
|
||||
(let [requires (gobj/filter js/goog.dependencies_.requires
|
||||
(fn [v k o] (gstring/startsWith k "../")))]
|
||||
(gobj/forEach
|
||||
requires
|
||||
(fn [v k _]
|
||||
(gobj/forEach
|
||||
v
|
||||
(fn [v' k' _]
|
||||
(doseq [n (path->name k)]
|
||||
(name-to-parent! k' n))))))))
|
||||
|
||||
(defn ns->dependents [ns]
|
||||
(get-in @dependency-data [:dependents ns]))
|
||||
|
||||
(defn in-upper-level? [topo-state current-depth dep]
|
||||
(some (fn [[_ v]] (and v (v dep)))
|
||||
(filter (fn [[k v]] (> k current-depth)) topo-state)))
|
||||
|
||||
(defn build-topo-sort [get-deps]
|
||||
(let [get-deps (memoize get-deps)]
|
||||
(letfn [(topo-sort-helper* [x depth state]
|
||||
(let [deps (get-deps x)]
|
||||
(when-not (empty? deps) (topo-sort* deps depth state))))
|
||||
(topo-sort*
|
||||
([deps]
|
||||
(topo-sort* deps 0 (atom (sorted-map))))
|
||||
([deps depth state]
|
||||
(swap! state update-in [depth] (fnil into #{}) deps)
|
||||
(doseq [dep deps]
|
||||
(when (and dep (not (in-upper-level? @state depth dep)))
|
||||
(topo-sort-helper* dep (inc depth) state)))
|
||||
(when (= depth 0)
|
||||
(elim-dups* (reverse (vals @state))))))
|
||||
(elim-dups* [[x & xs]]
|
||||
(if (nil? x)
|
||||
(list)
|
||||
(cons x (elim-dups* (map #(difference % x) xs)))))]
|
||||
topo-sort*)))
|
||||
|
||||
(defn get-all-dependencies [ns]
|
||||
(let [topo-sort' (build-topo-sort get-requires)]
|
||||
(apply concat (topo-sort' (set [ns])))))
|
||||
|
||||
(defn get-all-dependents [nss]
|
||||
(let [topo-sort' (build-topo-sort ns->dependents)]
|
||||
(filter (comp not immutable-ns?)
|
||||
(reverse (apply concat (topo-sort' (set nss)))))))
|
||||
|
||||
#_(prn "dependents" (get-all-dependents [ "example.core" "figwheel.client.file_reloading" "cljs.core"]))
|
||||
|
||||
#_(prn "dependencies" (get-all-dependencies "figwheel.client.file_reloading"))
|
||||
|
||||
#_(time (get-all-dependents [ "example.core" "figwheel.client.file_reloading" "cljs.core"]))
|
||||
|
||||
(defn unprovide! [ns]
|
||||
(let [path (name->path ns)]
|
||||
(gobj/remove js/goog.dependencies_.visited path)
|
||||
(gobj/remove js/goog.dependencies_.written path)
|
||||
(gobj/remove js/goog.dependencies_.written (str js/goog.basePath path))))
|
||||
|
||||
;; this matches goog behavior in url resolution should actually just
|
||||
;; use that code
|
||||
(defn resolve-ns [ns] (str goog/basePath (name->path ns)))
|
||||
|
||||
(defn addDependency [path provides requires]
|
||||
(doseq [prov provides]
|
||||
(path-to-name! path prov)
|
||||
(doseq [req requires]
|
||||
(name-to-parent! req prov))))
|
||||
|
||||
(defn figwheel-require [src reload]
|
||||
;; require is going to be called
|
||||
(set! (.-require js/goog) figwheel-require)
|
||||
(when (= reload "reload-all")
|
||||
(doseq [ns (get-all-dependencies src)] (unprovide! ns)))
|
||||
(when reload (unprovide! src))
|
||||
(.require_figwheel_backup_ js/goog src))
|
||||
|
||||
(defn bootstrap-goog-base
|
||||
"Reusable browser REPL bootstrapping. Patches the essential functions
|
||||
in goog.base to support re-loading of namespaces after page load."
|
||||
[]
|
||||
;; The biggest problem here is that clojure.browser.repl might have
|
||||
;; patched this or might patch this afterward
|
||||
(when-not js/COMPILED
|
||||
(set! (.-require_figwheel_backup_ js/goog) (or js/goog.require__ js/goog.require))
|
||||
;; suppress useless Google Closure error about duplicate provides
|
||||
(set! (.-isProvided_ js/goog) (fn [name] false))
|
||||
;; provide cljs.user
|
||||
(setup-path->name!)
|
||||
(setup-ns->dependents!)
|
||||
|
||||
(set! (.-addDependency_figwheel_backup_ js/goog) js/goog.addDependency)
|
||||
(set! (.-addDependency js/goog)
|
||||
(fn [& args]
|
||||
(apply addDependency args)
|
||||
(apply (.-addDependency_figwheel_backup_ js/goog) args)))
|
||||
|
||||
(goog/constructNamespace_ "cljs.user")
|
||||
;; we must reuse Closure library dev time dependency management, under namespace
|
||||
;; reload scenarios we simply delete entries from the correct
|
||||
;; private locations
|
||||
(set! (.-CLOSURE_IMPORT_SCRIPT goog/global) queued-file-reload)
|
||||
(set! (.-require js/goog) figwheel-require)))
|
||||
|
||||
(defn patch-goog-base []
|
||||
(defonce bootstrapped-cljs (do (bootstrap-goog-base) true)))
|
||||
|
||||
(def gloader
|
||||
(cond
|
||||
(exists? loader/safeLoad)
|
||||
#(loader/safeLoad (conv/trustedResourceUrlFromString (str %1)) %2)
|
||||
(exists? loader/load) #(loader/load (str %1) %2)
|
||||
:else (throw (ex-info "No remote script loading function found." {}))))
|
||||
|
||||
(defn reload-file-in-html-env
|
||||
[request-url callback]
|
||||
(dev-assert (string? request-url) (not (nil? callback)))
|
||||
(doto (gloader (add-cache-buster request-url) #js {:cleanupWhenDone true})
|
||||
(.addCallback #(apply callback [true]))
|
||||
(.addErrback #(apply callback [false]))))
|
||||
|
||||
(def ^:export write-script-tag-import reload-file-in-html-env)
|
||||
|
||||
(defn ^:export worker-import-script [request-url callback]
|
||||
(dev-assert (string? request-url) (not (nil? callback)))
|
||||
(callback (try
|
||||
(do (.importScripts js/self (add-cache-buster request-url))
|
||||
true)
|
||||
(catch js/Error e
|
||||
(utils/log :error (str "Figwheel: Error loading file " request-url))
|
||||
(utils/log :error (.-stack e))
|
||||
false))))
|
||||
|
||||
(defn ^:export create-node-script-import-fn []
|
||||
(let [node-path-lib (js/require "path")
|
||||
;; just finding a file that is in the cache so we can
|
||||
;; figure out where we are
|
||||
util-pattern (str (.-sep node-path-lib)
|
||||
(.join node-path-lib "goog" "bootstrap" "nodejs.js"))
|
||||
util-path (gobj/findKey js/require.cache (fn [v k o] (gstring/endsWith k util-pattern)))
|
||||
parts (-> (string/split util-path #"[/\\]") pop pop)
|
||||
root-path (string/join (.-sep node-path-lib) parts)]
|
||||
(fn [request-url callback]
|
||||
(dev-assert (string? request-url) (not (nil? callback)))
|
||||
(let [cache-path (.resolve node-path-lib root-path request-url)]
|
||||
(gobj/remove (.-cache js/require) cache-path)
|
||||
(callback (try
|
||||
(js/require cache-path)
|
||||
(catch js/Error e
|
||||
(utils/log :error (str "Figwheel: Error loading file " cache-path))
|
||||
(utils/log :error (.-stack e))
|
||||
false)))))))
|
||||
|
||||
;; TODO
|
||||
#_(defn async-fetch-import-script [request-url callback]
|
||||
(let [base-url (or goog.global.FIGWHEEL_RELOAD_BASE_URL "http://localhost:8081")]
|
||||
(doto (js/fetch (str base-url "/" request-url))
|
||||
(.then (fn [r] ))
|
||||
)))
|
||||
|
||||
(def reload-file*
|
||||
(condp = (utils/host-env?)
|
||||
:node (create-node-script-import-fn)
|
||||
:html write-script-tag-import
|
||||
;; TODO react native reloading not supported internally yet
|
||||
;:react-native
|
||||
#_(if (utils/worker-env?)
|
||||
worker-import-script
|
||||
async-fetch-import-script)
|
||||
:worker worker-import-script
|
||||
(fn [a b] (throw "Reload not defined for this platform"))))
|
||||
|
||||
(defn reload-file [{:keys [request-url] :as file-msg} callback]
|
||||
(dev-assert (string? request-url) (not (nil? callback)))
|
||||
(utils/debug-prn (str "FigWheel: Attempting to load " request-url))
|
||||
((or (gobj/get goog.global "FIGWHEEL_IMPORT_SCRIPT") reload-file*)
|
||||
request-url
|
||||
(fn [success?]
|
||||
(if success?
|
||||
(do
|
||||
(utils/debug-prn (str "FigWheel: Successfully loaded " request-url))
|
||||
(apply callback [(assoc file-msg :loaded-file true)]))
|
||||
(do
|
||||
(utils/log :error (str "Figwheel: Error loading file " request-url))
|
||||
(apply callback [file-msg]))))))
|
||||
|
||||
;; for goog.require consumption
|
||||
(defonce reload-chan (chan))
|
||||
|
||||
(defonce on-load-callbacks (atom {}))
|
||||
|
||||
(defonce dependencies-loaded (atom []))
|
||||
|
||||
(defn blocking-load [url]
|
||||
(let [out (chan)]
|
||||
(reload-file
|
||||
{:request-url url}
|
||||
(fn [file-msg]
|
||||
(put! out file-msg)
|
||||
(close! out)))
|
||||
out))
|
||||
|
||||
(defonce reloader-loop
|
||||
(go-loop []
|
||||
(when-let [[url opt-source-text] (<! reload-chan)]
|
||||
(cond
|
||||
opt-source-text
|
||||
(do
|
||||
(js/console.log "Evaling!" opt-source-text)
|
||||
(js/eval opt-source-text))
|
||||
url
|
||||
(let [file-msg (<! (blocking-load url))]
|
||||
(js/console.log "Loading!" url)
|
||||
(if-let [callback (get @on-load-callbacks url)]
|
||||
(callback file-msg)
|
||||
(swap! dependencies-loaded conj file-msg))))
|
||||
(recur))))
|
||||
|
||||
(defn queued-file-reload
|
||||
([url] (queued-file-reload url nil))
|
||||
([url opt-source-text] (put! reload-chan [url opt-source-text])))
|
||||
|
||||
(defn require-with-callback [{:keys [namespace] :as file-msg} callback]
|
||||
(let [request-url (resolve-ns namespace)]
|
||||
(swap! on-load-callbacks assoc request-url
|
||||
(fn [file-msg']
|
||||
(swap! on-load-callbacks dissoc request-url)
|
||||
(apply callback [(merge file-msg (select-keys file-msg' [:loaded-file]))])))
|
||||
;; we are forcing reload here
|
||||
(figwheel-require (name namespace) true)))
|
||||
|
||||
(defn figwheel-no-load? [{:keys [namespace] :as file-msg}]
|
||||
(let [meta-pragmas (get @figwheel-meta-pragmas (name namespace))]
|
||||
(:figwheel-no-load meta-pragmas)))
|
||||
|
||||
(defn reload-file? [{:keys [namespace] :as file-msg}]
|
||||
(dev-assert (namespace-file-map? file-msg))
|
||||
(let [meta-pragmas (get @figwheel-meta-pragmas (name namespace))]
|
||||
(and
|
||||
(not (figwheel-no-load? file-msg))
|
||||
(or
|
||||
(:figwheel-always meta-pragmas)
|
||||
(:figwheel-load meta-pragmas)
|
||||
;; might want to use .-visited here
|
||||
(provided? (name namespace))))))
|
||||
|
||||
(defn js-reload [{:keys [request-url namespace] :as file-msg} callback]
|
||||
(dev-assert (namespace-file-map? file-msg))
|
||||
(if (reload-file? file-msg)
|
||||
(require-with-callback file-msg callback)
|
||||
(do
|
||||
(utils/debug-prn (str "Figwheel: Not trying to load file " request-url))
|
||||
(apply callback [file-msg]))))
|
||||
|
||||
(defn reload-js-file [file-msg]
|
||||
(let [out (chan)]
|
||||
(js-reload
|
||||
file-msg
|
||||
(fn [url]
|
||||
#_(patch-goog-base)
|
||||
(put! out url)
|
||||
(close! out)))
|
||||
out))
|
||||
|
||||
(defn load-all-js-files
|
||||
"Returns a chanel with one collection of loaded filenames on it."
|
||||
[files]
|
||||
(let [out (chan)]
|
||||
(go-loop [[f & fs] files]
|
||||
(if-not (nil? f)
|
||||
(do (put! out (<! (reload-js-file f)))
|
||||
(recur fs))
|
||||
(close! out)))
|
||||
(async/into [] out)))
|
||||
|
||||
|
||||
(defn eval-body [{:keys [eval-body file]} opts]
|
||||
(when (and eval-body (string? eval-body))
|
||||
(let [code eval-body]
|
||||
(try
|
||||
(utils/debug-prn (str "Evaling file " file))
|
||||
(utils/eval-helper code opts)
|
||||
(catch :default e
|
||||
(utils/log :error (str "Unable to evaluate " file)))))))
|
||||
|
||||
(defn expand-files [files]
|
||||
(let [deps (get-all-dependents (map :namespace files))]
|
||||
(filter (comp not
|
||||
(partial re-matches #"figwheel\.connect.*")
|
||||
:namespace)
|
||||
(map
|
||||
(fn [n]
|
||||
(if-let [file-msg (first (filter #(= (:namespace %) n) files))]
|
||||
file-msg
|
||||
{:type :namespace :namespace n}))
|
||||
deps))))
|
||||
|
||||
(defn sort-files [files]
|
||||
(if (<= (count files) 1) ;; no need to sort if only one
|
||||
files
|
||||
(let [keep-files (set (keep :namespace files))]
|
||||
(filter (comp keep-files :namespace) (expand-files files)))))
|
||||
|
||||
(defn get-figwheel-always []
|
||||
(map (fn [[k v]] {:namespace k :type :namespace})
|
||||
(filter (fn [[k v]]
|
||||
(:figwheel-always v)) @figwheel-meta-pragmas)))
|
||||
|
||||
(defn reload-js-files [{:keys [before-jsload on-jsload reload-dependents] :as opts}
|
||||
{:keys [files figwheel-meta recompile-dependents] :as msg}]
|
||||
(when-not (empty? figwheel-meta)
|
||||
(reset! figwheel-meta-pragmas figwheel-meta))
|
||||
(go
|
||||
(before-jsload files)
|
||||
(before-jsload-custom-event files)
|
||||
;; evaluate the eval bodies first
|
||||
;; for now this is only for updating dependencies
|
||||
;; we are not handling removals
|
||||
;; TODO handle removals
|
||||
(let [eval-bodies (filter #(:eval-body %) files)]
|
||||
(when (not-empty eval-bodies)
|
||||
(doseq [eval-body-file eval-bodies]
|
||||
(eval-body eval-body-file opts))))
|
||||
(reset! dependencies-loaded (list))
|
||||
(let [all-files (filter #(and (:namespace %)
|
||||
(not (:eval-body %))
|
||||
(not (figwheel-no-load? %)))
|
||||
files)
|
||||
;; add in figwheel always
|
||||
all-files (concat all-files (get-figwheel-always))
|
||||
all-files (if (or reload-dependents recompile-dependents)
|
||||
(expand-files all-files)
|
||||
(sort-files all-files))
|
||||
;_ (prn "expand-files" (expand-files all-files))
|
||||
;_ (prn "sort-files" (sort-files all-files))
|
||||
res' (<! (load-all-js-files all-files))
|
||||
res (filter :loaded-file res')
|
||||
files-not-loaded (filter #(not (:loaded-file %)) res')
|
||||
dependencies-that-loaded (filter :loaded-file @dependencies-loaded)]
|
||||
(when (not-empty dependencies-that-loaded)
|
||||
(utils/log :debug "Figwheel: loaded these dependencies")
|
||||
(utils/log (pr-str (map (fn [{:keys [request-url]}]
|
||||
(string/replace request-url goog/basePath ""))
|
||||
(reverse dependencies-that-loaded)))))
|
||||
(when (not-empty res)
|
||||
(utils/log :debug "Figwheel: loaded these files")
|
||||
(utils/log (pr-str (map (fn [{:keys [namespace file]}]
|
||||
(if namespace
|
||||
(name->path (name namespace))
|
||||
file)) res)))
|
||||
(js/setTimeout #(do
|
||||
(on-jsload-custom-event res)
|
||||
(apply on-jsload [res])) 10))
|
||||
|
||||
(when (not-empty files-not-loaded)
|
||||
(utils/log :debug "Figwheel: NOT loading these files ")
|
||||
(let [{:keys [figwheel-no-load not-required]}
|
||||
(group-by
|
||||
(fn [{:keys [namespace]}]
|
||||
(let [meta-data (get @figwheel-meta-pragmas (name namespace))]
|
||||
(cond
|
||||
(nil? meta-data) :not-required
|
||||
(meta-data :figwheel-no-load) :figwheel-no-load
|
||||
:else :not-required)))
|
||||
files-not-loaded)]
|
||||
(when (not-empty figwheel-no-load)
|
||||
(utils/log (str "figwheel-no-load meta-data: "
|
||||
(pr-str (map (comp name->path :namespace) figwheel-no-load)))))
|
||||
(when (not-empty not-required)
|
||||
(utils/log (str "not required: " (pr-str (map :file not-required))))))))))
|
||||
|
||||
;; CSS reloading
|
||||
|
||||
(defn current-links []
|
||||
(.call (.. js/Array -prototype -slice)
|
||||
(.getElementsByTagName js/document "link")))
|
||||
|
||||
(defn truncate-url [url]
|
||||
(-> (first (string/split url #"\?"))
|
||||
(string/replace-first (str (.-protocol js/location) "//") "")
|
||||
(string/replace-first ".*://" "")
|
||||
(string/replace-first #"^//" "")
|
||||
(string/replace-first #"[^\/]*" "")))
|
||||
|
||||
(defn matches-file?
|
||||
[{:keys [file]} link]
|
||||
(when-let [link-href (.-href link)]
|
||||
(let [match (string/join "/"
|
||||
(take-while identity
|
||||
(map #(if (= %1 %2) %1 false)
|
||||
(reverse (string/split file "/"))
|
||||
(reverse (string/split (truncate-url link-href) "/")))))
|
||||
match-length (count match)
|
||||
file-name-length (count (last (string/split file "/")))]
|
||||
(when (>= match-length file-name-length) ;; has to match more than the file name length
|
||||
{:link link
|
||||
:link-href link-href
|
||||
:match-length match-length
|
||||
:current-url-length (count (truncate-url link-href))}))))
|
||||
|
||||
(defn get-correct-link [f-data]
|
||||
(when-let [res (first
|
||||
(sort-by
|
||||
(fn [{:keys [match-length current-url-length]}]
|
||||
(- current-url-length match-length))
|
||||
(keep #(matches-file? f-data %)
|
||||
(current-links))))]
|
||||
(:link res)))
|
||||
|
||||
(defn clone-link [link url]
|
||||
(let [clone (.createElement js/document "link")]
|
||||
(set! (.-rel clone) "stylesheet")
|
||||
(set! (.-media clone) (.-media link))
|
||||
(set! (.-disabled clone) (.-disabled link))
|
||||
(set! (.-href clone) (add-cache-buster url))
|
||||
clone))
|
||||
|
||||
(defn create-link [url]
|
||||
(let [link (.createElement js/document "link")]
|
||||
(set! (.-rel link) "stylesheet")
|
||||
(set! (.-href link) (add-cache-buster url))
|
||||
link))
|
||||
|
||||
(defn distinctify [key seqq]
|
||||
(vals (reduce #(assoc %1 (get %2 key) %2) {} seqq)))
|
||||
|
||||
(defn add-link-to-document [orig-link klone finished-fn]
|
||||
(let [parent (.-parentNode orig-link)]
|
||||
(if (= orig-link (.-lastChild parent))
|
||||
(.appendChild parent klone)
|
||||
(.insertBefore parent klone (.-nextSibling orig-link)))
|
||||
;; prevent css removal flash
|
||||
(js/setTimeout #(do
|
||||
(.removeChild parent orig-link)
|
||||
(finished-fn))
|
||||
300)))
|
||||
|
||||
(defonce reload-css-deferred-chain (atom (.succeed Deferred)))
|
||||
|
||||
(defn reload-css-file [f-data fin]
|
||||
(if-let [link (get-correct-link f-data)]
|
||||
(add-link-to-document link (clone-link link (.-href link))
|
||||
#(fin (assoc f-data :loaded true)))
|
||||
(fin f-data)))
|
||||
|
||||
(defn reload-css-files* [deferred f-datas on-cssload]
|
||||
(-> deferred
|
||||
(utils/mapConcatD reload-css-file f-datas)
|
||||
(utils/liftContD (fn [f-datas' fin]
|
||||
(let [loaded-f-datas (filter :loaded f-datas')]
|
||||
(on-cssload-custom-event loaded-f-datas)
|
||||
(when (fn? on-cssload)
|
||||
(on-cssload loaded-f-datas)))
|
||||
(fin)))))
|
||||
|
||||
(defn reload-css-files [{:keys [on-cssload]} {:keys [files] :as files-msg}]
|
||||
(when (utils/html-env?)
|
||||
(when-let [f-datas (not-empty (distinctify :file files))]
|
||||
(swap! reload-css-deferred-chain reload-css-files* f-datas on-cssload))))
|
||||
@@ -0,0 +1 @@
|
||||
{:rename-macros {}, :renames {}, :externs {console {log {}}, Error {}, Object {sep {}, join {}, resolve {}, rel {}, media {}, disabled {}, href {}}, location {protocol {}}, self {importScripts {}}, eval {}, Array {prototype {slice {call {}}}}, goog {dependencies_ {nameToPath {}, written {}, requires {}, visited {}}, basePath {}, require {}, require_figwheel_backup_ {}, require__ {}, isProvided_ {}, addDependency_figwheel_backup_ {}, addDependency {}}, require {cache {}}, setTimeout {}, document {getElementsByTagName {}, createElement {}}, COMPILED {}}, :use-macros {go cljs.core.async.macros, dev-assert figwheel.client.utils, go-loop cljs.core.async.macros, difference clojure.set}, :excludes #{}, :name figwheel.client.file-reloading, :imports {Deferred goog.async.Deferred}, :requires {gstring goog.string, Deferred goog.async.Deferred, guri goog.Uri, goog.string goog.string, loader goog.net.jsloader, async cljs.core.async, goog.net.jsloader goog.net.jsloader, goog.Uri goog.Uri, gobj goog.object, goog.object goog.object, cljs.core.async cljs.core.async, clojure.set clojure.set, goog.html.legacyconversions goog.html.legacyconversions, string clojure.string, figwheel.client.utils figwheel.client.utils, conv goog.html.legacyconversions, utils figwheel.client.utils, clojure.string clojure.string}, :cljs.spec/speced-vars [], :uses {timeout cljs.core.async, <! cljs.core.async, close! cljs.core.async, chan cljs.core.async, alts! cljs.core.async, difference clojure.set, map< cljs.core.async, put! cljs.core.async}, :defs {figwheel-require {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/file_reloading.cljs", :line 173, :column 7, :end-line 173, :end-column 23, :arglists (quote ([src reload]))}, :name figwheel.client.file-reloading/figwheel-require, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/file_reloading.cljs", :end-column 23, :method-params ([src reload]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 173, :end-line 173, :max-fixed-arity 2, :fn-var true, :arglists (quote ([src reload]))}, create-node-script-import-fn {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/file_reloading.cljs", :line 237, :column 16, :end-line 237, :end-column 44, :export true, :arglists (quote ([]))}, :name figwheel.client.file-reloading/create-node-script-import-fn, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/file_reloading.cljs", :end-column 44, :method-params ([]), :protocol-impl nil, :export true, :arglists-meta (nil nil), :column 1, :line 237, :end-line 237, :max-fixed-arity 0, :fn-var true, :arglists (quote ([]))}, matches-file? {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/file_reloading.cljs", :line 488, :column 7, :end-line 488, :end-column 20, :arglists (quote ([{:keys [file]} link]))}, :name figwheel.client.file-reloading/matches-file?, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/file_reloading.cljs", :end-column 20, :method-params ([p__45296 link]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 488, :end-line 488, :max-fixed-arity 2, :fn-var true, :arglists (quote ([{:keys [file]} link]))}, build-topo-sort {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/file_reloading.cljs", :line 121, :column 7, :end-line 121, :end-column 22, :arglists (quote ([get-deps]))}, :name figwheel.client.file-reloading/build-topo-sort, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/file_reloading.cljs", :end-column 22, :method-params ([get-deps]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 121, :end-line 121, :max-fixed-arity 1, :fn-var true, :arglists (quote ([get-deps]))}, unprovide! {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/file_reloading.cljs", :line 157, :column 7, :end-line 157, :end-column 17, :arglists (quote ([ns]))}, :name figwheel.client.file-reloading/unprovide!, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/file_reloading.cljs", :end-column 17, :method-params ([ns]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 157, :end-line 157, :max-fixed-arity 1, :fn-var true, :arglists (quote ([ns]))}, get-all-dependents {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/file_reloading.cljs", :line 146, :column 7, :end-line 146, :end-column 25, :arglists (quote ([nss]))}, :name figwheel.client.file-reloading/get-all-dependents, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/file_reloading.cljs", :end-column 25, :method-params ([nss]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 146, :end-line 146, :max-fixLine truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"\/home\/didier\/clojupyter\/website\/target\/cljsbuild\/public\/js\/out\/figwheel\/client\/file_reloading.js","sources":["file_reloading.cljs?rel=1517021947367"],"lineCount":2613,"mappings":";AAAA;;;;;;;;;;;;AAiBA,AAAA,AAEA,GAAA,OAASA;AAAT;AAAA,AAAA,AAASA,uDAAsB,yBAAA,zBAACC;;AAIhC,wDAAA,xDAAMC,wHAAwBC;AAA9B,AACE,6DAAA,tDAACC,2EAAiDD;;AAIpD,4DAAA,5DAAME,gIAA4BC;AAAlC,AACE,6DAAA,tDAACF,kFAAwDE;;AAI3D,yDAAA,zDAAMC,0HAAyBD;AAA\/B,AACE,6DAAA,tDAACF,4EAAkDE;;AAMrD,2DAAA,3DAAME,8HAAqBC;AAA3B,AACE,IAAAC,oBACC,CAAK,AAACC,+BAAKF,QACN,OAAS,AAAA,6FAAYA,qBACrB,CAAI,2FAAA,1FAAM,AAAA,oFAAOA,iBACb,OAAS,AAAA,oFAAOA,sBACpB,+GAAA,\/GAACG,yBAAE,AAAA,mFAAOH;AALhB,AAAA,GAAAC;AAAAA;;AAOC,AACE,4BAAA,5BAACG,2DAAuC,AAACC,2BAAOL;;AADlD;;;AAKH,kDAAA,lDAAMM,4GAAkBZ;AAAxB,AACE;AACA,OAAa,AAACa,eAAWb;;AAE3B,+CAAA,\/CAAMc,sGAAYC;AAAlB,AACE;AACA,OAACC,gBAASC,8BAAiCF;;AAE7C,iDAAA,jDAAMG,0GAAWH;AAAjB,AACE,OAACC,gBAASG,2BAA8B,AAACL,uDAAWC;;AAEtD,qDAAA,rDAAMK,kHAAeC;AAArB,AACE,IAAAd,oBAAI,AAAA,iFAAA,mBAAA,YAAA,0CAAqCc;AAAzC,AAAA,oBAAAd;AAAAA;;AAAA,IAAAA,wBACI,uBAAA,vBAACe,kCAAkCD;AADvC,AAAA,oBAAAd;AAAAA;;AAEI,8BAAA,vBAACe,+BAA+BD;;;;AAEtC,8CAAA,9CAAME,oGAAc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C;;AADrC;;AADF,eAAA,AAAAvB,yBAAA6B;eAAA;eAAA;eAAA;;;;;;;;AAAA;;;;;AAGA,GAAM,+BAAA,\/BAACvF,yBAAEgF;AAAT,AACE,OAACY,0BAAW,AAACC,4BAAQ,yBAAA,AAAAzD,zBAAC0D,mDAAMb;;AAD9B;;;4EALCC,KAAKF,MAAMC;;;qFAAXC;;qFAAAA,KAAKF,MAAMC;;;;;;;;;;sBANvB;kFAAAN;AAAA,AAAA,IAAAC,aAAAD;IAAAE,aAAA,AAAA\/B,wBAAA8B;IAAAE,eAAA,AAAArB,0BAAAoB;IAAAA,iBAAA,AAAAnB,yBAAAmB;QAAAC,JAasBC;SAbtBF,LAa0BkB;AAb1B,AAcU,GAAI,MAAA,LAAMhB;AA6yEpB,OAAA6T;;AA3yEY,OAAC5S,yBAAKjB,EAAE,AAACa,2EAAW,wBAAA,xBAACM;kBAADD;AAAA,AAAM,wCAAAA,jCAACE,kDAAapB;;CAAGgB;;;;AAhBvD,AAiBEX;;AAEN,sDAAA,tDAAMgB,oHAAsB9F;AAA5B,AACE,IAAM+F,yBAAW,AAAC7B,yDAAgB1D;AAAlC,AACE,OAACwF,0BAAMC,iBAAO,AAACF,iCAAW,wBAAA,xBAACjF,2GAAKd;;AAEpC,oDAAA,pDAAMkG,gHAAoBLine truncated
|
||||
@@ -0,0 +1,422 @@
|
||||
(ns figwheel.client.heads-up
|
||||
(:require
|
||||
[clojure.string :as string]
|
||||
[figwheel.client.socket :as socket]
|
||||
[figwheel.client.utils :as utils]
|
||||
[cljs.core.async :refer [put! chan <! map< close! timeout alts!] :as async]
|
||||
[goog.string]
|
||||
[goog.dom.dataset :as data]
|
||||
[goog.object :as gobj]
|
||||
[goog.dom :as dom]
|
||||
[cljs.pprint :as pp])
|
||||
(:require-macros
|
||||
[cljs.core.async.macros :refer [go go-loop]]))
|
||||
|
||||
(declare clear cljs-logo-svg)
|
||||
|
||||
;; cheap hiccup
|
||||
(defn node [t attrs & children]
|
||||
(let [e (.createElement js/document (name t))]
|
||||
(doseq [k (keys attrs)] (.setAttribute e (name k) (get attrs k)))
|
||||
(doseq [ch children] (.appendChild e ch)) ;; children
|
||||
e))
|
||||
|
||||
(defmulti heads-up-event-dispatch (fn [dataset] (.-figwheelEvent dataset)))
|
||||
(defmethod heads-up-event-dispatch :default [_] {})
|
||||
|
||||
(defmethod heads-up-event-dispatch "file-selected" [dataset]
|
||||
(socket/send! {:figwheel-event "file-selected"
|
||||
:file-name (.-fileName dataset)
|
||||
:file-line (.-fileLine dataset)
|
||||
:file-column (.-fileColumn dataset)}))
|
||||
|
||||
(defmethod heads-up-event-dispatch "close-heads-up" [dataset] (clear))
|
||||
|
||||
(defn ancestor-nodes [el]
|
||||
(iterate (fn [e] (.-parentNode e)) el))
|
||||
|
||||
(defn get-dataset [el]
|
||||
(first (keep (fn [x] (when (.. x -dataset -figwheelEvent) (.. x -dataset)))
|
||||
(take 4 (ancestor-nodes el)))))
|
||||
|
||||
(defn heads-up-onclick-handler [event]
|
||||
(let [dataset (get-dataset (.. event -target))]
|
||||
(.preventDefault event)
|
||||
(when dataset
|
||||
(heads-up-event-dispatch dataset))))
|
||||
|
||||
(defn ensure-container []
|
||||
(let [cont-id "figwheel-heads-up-container"
|
||||
content-id "figwheel-heads-up-content-area"]
|
||||
(if-not (.querySelector js/document (str "#" cont-id))
|
||||
(let [el (node :div { :id cont-id
|
||||
:style
|
||||
(str "-webkit-transition: all 0.2s ease-in-out;"
|
||||
"-moz-transition: all 0.2s ease-in-out;"
|
||||
"-o-transition: all 0.2s ease-in-out;"
|
||||
"transition: all 0.2s ease-in-out;"
|
||||
"font-size: 13px;"
|
||||
"border-top: 1px solid #f5f5f5;"
|
||||
"box-shadow: 0px 0px 1px #aaaaaa;"
|
||||
"line-height: 18px;"
|
||||
"color: #333;"
|
||||
"font-family: monospace;"
|
||||
"padding: 0px 10px 0px 70px;"
|
||||
"position: fixed;"
|
||||
"bottom: 0px;"
|
||||
"left: 0px;"
|
||||
"height: 0px;"
|
||||
"opacity: 0.0;"
|
||||
"box-sizing: border-box;"
|
||||
"z-index: 10000;"
|
||||
"text-align: left;"
|
||||
) })]
|
||||
(set! (.-onclick el) heads-up-onclick-handler)
|
||||
(set! (.-innerHTML el) cljs-logo-svg)
|
||||
(.appendChild el (node :div {:id content-id}))
|
||||
(-> (.-body js/document)
|
||||
(.appendChild el))))
|
||||
{ :container-el (.getElementById js/document cont-id)
|
||||
:content-area-el (.getElementById js/document content-id) }
|
||||
))
|
||||
|
||||
(defn set-style! [{:keys [container-el]} st-map]
|
||||
(mapv
|
||||
(fn [[k v]]
|
||||
(gobj/set (.-style container-el) (name k) v))
|
||||
st-map))
|
||||
|
||||
(defn set-content! [{:keys [content-area-el] :as c} dom-str]
|
||||
(set! (.-innerHTML content-area-el) dom-str))
|
||||
|
||||
(defn get-content [{:keys [content-area-el]}]
|
||||
(.-innerHTML content-area-el))
|
||||
|
||||
(defn close-link []
|
||||
(str "<a style=\""
|
||||
"float: right;"
|
||||
"font-size: 18px;"
|
||||
"text-decoration: none;"
|
||||
"text-align: right;"
|
||||
"width: 30px;"
|
||||
"height: 30px;"
|
||||
"color: rgba(84,84,84, 0.5);"
|
||||
"\" href=\"#\" data-figwheel-event=\"close-heads-up\">"
|
||||
"x"
|
||||
"</a>"))
|
||||
|
||||
(defn display-heads-up [style msg]
|
||||
(go
|
||||
(let [c (ensure-container)]
|
||||
(set-style! c (merge {
|
||||
:paddingTop "10px"
|
||||
:paddingBottom "10px"
|
||||
:width "100%"
|
||||
:minHeight "68px"
|
||||
:opacity "1.0" }
|
||||
style))
|
||||
(set-content! c msg)
|
||||
(<! (timeout 300))
|
||||
(set-style! c {:height "auto"}))))
|
||||
|
||||
(defn heading
|
||||
([s] (heading s ""))
|
||||
([s sub-head]
|
||||
(str "<div style=\""
|
||||
"font-size: 26px;"
|
||||
"line-height: 26px;"
|
||||
"margin-bottom: 2px;"
|
||||
"padding-top: 1px;"
|
||||
"\">"
|
||||
s
|
||||
" <span style=\""
|
||||
"display: inline-block;"
|
||||
"font-size: 13px;"
|
||||
"\">"
|
||||
sub-head
|
||||
"</span></div>")))
|
||||
|
||||
(defn file-selector-div [file-name line-number column-number msg]
|
||||
(str "<div style=\"cursor: pointer;\" data-figwheel-event=\"file-selected\" data-file-name=\""
|
||||
file-name "\" data-file-line=\"" line-number "\" data-file-column=\"" column-number
|
||||
"\">" msg "</div>"))
|
||||
|
||||
(defn format-line [msg {:keys [file line column]}]
|
||||
(let [msg (goog.string/htmlEscape msg)]
|
||||
(if (or file line)
|
||||
(file-selector-div file line column msg)
|
||||
(str "<div>" msg "</div>"))))
|
||||
|
||||
(defn escape [x]
|
||||
(goog.string/htmlEscape x))
|
||||
|
||||
(defn pad-line-number [n line-number]
|
||||
(let [len (count ((fnil str "") line-number))]
|
||||
(-> (if (< len n)
|
||||
(apply str (repeat (- n len) " "))
|
||||
"")
|
||||
(str line-number))))
|
||||
|
||||
(defn inline-error-line [style line-number line]
|
||||
(str "<span style='" style "'>" "<span style='color: #757575;'>" line-number " </span>" (escape line) "</span>"))
|
||||
|
||||
(defn format-inline-error-line [[typ line-number line]]
|
||||
(condp = typ
|
||||
:code-line (inline-error-line "color: #999;" line-number line)
|
||||
:error-in-code (inline-error-line "color: #ccc; font-weight: bold;" line-number line)
|
||||
:error-message (inline-error-line "color: #D07D7D;" line-number line)
|
||||
(inline-error-line "color: #666;" line-number line)))
|
||||
|
||||
(defn pad-line-numbers [inline-error]
|
||||
(let [max-line-number-length (count (str (reduce max (map second inline-error))))]
|
||||
(map #(update-in % [1]
|
||||
(partial pad-line-number max-line-number-length)) inline-error)))
|
||||
|
||||
(defn format-inline-error [inline-error]
|
||||
(let [lines (map format-inline-error-line (pad-line-numbers inline-error))]
|
||||
(str "<pre style='whitespace:pre; overflow-x: scroll; display:block; font-family:monospace; font-size:0.8em; border-radius: 3px;"
|
||||
" line-height: 1.1em; padding: 10px; background-color: rgb(24,26,38); margin-right: 5px'>"
|
||||
(string/join "\n" lines)
|
||||
"</pre>")))
|
||||
|
||||
(def flatten-exception #(take-while some? (iterate :cause %)))
|
||||
|
||||
(defn exception->display-data [{:keys [failed-loading-clj-file
|
||||
failed-compiling
|
||||
reader-exception
|
||||
analysis-exception
|
||||
display-ex-data
|
||||
class file line column message
|
||||
error-inline] :as exception}]
|
||||
(let [last-message (cond
|
||||
(and file line)
|
||||
(str "Please see line " line " of file " file )
|
||||
file (str "Please see " file)
|
||||
:else nil)]
|
||||
{:head (cond
|
||||
failed-loading-clj-file "Couldn't load Clojure file"
|
||||
analysis-exception "Could not Analyze"
|
||||
reader-exception "Could not Read"
|
||||
failed-compiling "Could not Compile"
|
||||
:else "Compile Exception")
|
||||
:sub-head file
|
||||
:messages (concat
|
||||
(map
|
||||
#(str "<div>" % "</div>")
|
||||
(if message
|
||||
[(str (if class
|
||||
(str (escape class)
|
||||
": ") "")
|
||||
"<span style=\"font-weight:bold;\">" (escape message) "</span>")
|
||||
(when display-ex-data
|
||||
(str "<pre>" (utils/pprint-to-string display-ex-data) "</pre>"))
|
||||
(when (pos? (count error-inline))
|
||||
(format-inline-error error-inline))]
|
||||
(map #(str (escape (:class %))
|
||||
": " (escape (:message %))) (flatten-exception (:exception-data exception)))))
|
||||
(when last-message [(str "<div style=\"color: #AD4F4F; padding-top: 3px;\">" (escape last-message) "</div>")]))
|
||||
:file file
|
||||
:line line
|
||||
:column column}))
|
||||
|
||||
(defn auto-notify-source-file-line [{:keys [file line column]}]
|
||||
(socket/send! {:figwheel-event "file-selected"
|
||||
:file-name (str file)
|
||||
:file-line (str line)
|
||||
:file-column (str column)}))
|
||||
|
||||
(defn display-exception [exception-data]
|
||||
(let [{:keys [head
|
||||
sub-head
|
||||
messages
|
||||
last-message
|
||||
file
|
||||
line
|
||||
column]}
|
||||
(-> exception-data
|
||||
exception->display-data)
|
||||
msg (apply str messages
|
||||
#_(map #(str "<div>" (goog.string/htmlEscape %)
|
||||
"</div>") messages))]
|
||||
(display-heads-up {:backgroundColor "rgba(255, 161, 161, 0.95)"}
|
||||
(str (close-link)
|
||||
(heading head sub-head)
|
||||
(file-selector-div file line column msg)))))
|
||||
|
||||
(defn warning-data->display-data [{:keys [file line column message error-inline] :as warning-data}]
|
||||
(let [last-message (cond
|
||||
(and file line)
|
||||
(str "Please see line " line " of file " file )
|
||||
file (str "Please see " file)
|
||||
:else nil)]
|
||||
{:head "Compile Warning"
|
||||
:sub-head file
|
||||
:messages (concat
|
||||
(map
|
||||
#(str "<div>" % "</div>")
|
||||
[(when message
|
||||
(str "<span style=\"font-weight:bold;\">" (escape message) "</span>"))
|
||||
(when (pos? (count error-inline))
|
||||
(format-inline-error error-inline))])
|
||||
(when last-message
|
||||
[(str "<div style=\"color: #AD4F4F; padding-top: 3px; margin-bottom: 10px;\">" (escape last-message) "</div>")]))
|
||||
:file file
|
||||
:line line
|
||||
:column column}))
|
||||
|
||||
(defn display-system-warning [header msg]
|
||||
(display-heads-up {:backgroundColor "rgba(255, 220, 110, 0.95)" }
|
||||
(str (close-link) (heading header)
|
||||
"<div>" msg "</div>"
|
||||
#_(format-line msg {}))))
|
||||
|
||||
(defn display-warning [warning-data]
|
||||
(let [{:keys [head
|
||||
sub-head
|
||||
messages
|
||||
last-message
|
||||
file
|
||||
line
|
||||
column]}
|
||||
(-> warning-data
|
||||
warning-data->display-data)
|
||||
msg (apply str messages)]
|
||||
(display-heads-up {:backgroundColor "rgba(255, 220, 110, 0.95)" }
|
||||
(str (close-link)
|
||||
(heading head sub-head)
|
||||
(file-selector-div file line column msg)))))
|
||||
|
||||
(defn format-warning-message [{:keys [message file line column] :as warning-data}]
|
||||
(cond-> message
|
||||
line (str " at line " line)
|
||||
(and line column) (str ", column " column)
|
||||
file (str " in file " file)) )
|
||||
|
||||
(defn append-warning-message [{:keys [message file line column] :as warning-data}]
|
||||
(when message
|
||||
(let [{:keys [content-area-el]} (ensure-container)
|
||||
el (dom/createElement "div")
|
||||
child-count (.-length (dom/getChildren content-area-el))]
|
||||
(if (< child-count 6)
|
||||
(do
|
||||
(set! (.-innerHTML el)
|
||||
(format-line (format-warning-message warning-data)
|
||||
warning-data))
|
||||
(dom/append content-area-el el))
|
||||
(when-let [last-child (dom/getLastElementChild content-area-el)]
|
||||
(if-let [message-count (data/get last-child "figwheel_count")]
|
||||
(let [message-count (inc (js/parseInt message-count))]
|
||||
(data/set last-child "figwheel_count" message-count)
|
||||
(set! (.-innerHTML last-child)
|
||||
(str message-count " more warnings have not been displayed ...")))
|
||||
(dom/append
|
||||
content-area-el
|
||||
(dom/createDom "div" #js {:data-figwheel_count 1
|
||||
:style "margin-top: 3px; font-weight: bold"}
|
||||
"1 more warning that has not been displayed ..."))))))))
|
||||
|
||||
(defn clear []
|
||||
(go
|
||||
(let [c (ensure-container)]
|
||||
(set-style! c { :opacity "0.0" })
|
||||
(<! (timeout 300))
|
||||
(set-style! c { :width "auto"
|
||||
:height "0px"
|
||||
:minHeight "0px"
|
||||
:padding "0px 10px 0px 70px"
|
||||
:borderRadius "0px"
|
||||
:backgroundColor "transparent" })
|
||||
(<! (timeout 200))
|
||||
(set-content! c ""))))
|
||||
|
||||
(defn display-loaded-start []
|
||||
(display-heads-up {:backgroundColor "rgba(211,234,172,1.0)"
|
||||
:width "68px"
|
||||
:height "68px"
|
||||
:paddingLeft "0px"
|
||||
:paddingRight "0px"
|
||||
:borderRadius "35px" } ""))
|
||||
|
||||
(defn flash-loaded []
|
||||
(go
|
||||
(<! (display-loaded-start))
|
||||
(<! (timeout 400))
|
||||
(<! (clear))))
|
||||
|
||||
(def cljs-logo-svg
|
||||
"<?xml version='1.0' encoding='utf-8'?>
|
||||
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
|
||||
<svg width='49px' height='49px' style='position:absolute; top:9px; left: 10px;' version='1.1'
|
||||
xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px'
|
||||
viewBox='0 0 428 428' enable-background='new 0 0 428 428' xml:space='preserve'>
|
||||
<circle fill='#fff' cx='213' cy='214' r='213' />
|
||||
<g>
|
||||
<path fill='#96CA4B' d='M122,266.6c-12.7,0-22.3-3.7-28.9-11.1c-6.6-7.4-9.9-18-9.9-31.8c0-14.1,3.4-24.9,10.3-32.5
|
||||
s16.8-11.4,29.9-11.4c8.8,0,16.8,1.6,23.8,4.9l-5.4,14.3c-7.5-2.9-13.7-4.4-18.6-4.4c-14.5,0-21.7,9.6-21.7,28.8
|
||||
c0,9.4,1.8,16.4,5.4,21.2c3.6,4.7,8.9,7.1,15.9,7.1c7.9,0,15.4-2,22.5-5.9v15.5c-3.2,1.9-6.6,3.2-10.2,4
|
||||
C131.5,266.2,127.1,266.6,122,266.6z'/>
|
||||
<path fill='#96CA4B' d='M194.4,265.1h-17.8V147.3h17.8V265.1z'/>
|
||||
<path fill='#5F7FBF' d='M222.9,302.3c-5.3,0-9.8-0.6-13.3-1.9v-14.1c3.4,0.9,6.9,1.4,10.5,1.4c7.6,0,11.4-4.3,11.4-12.9v-93.5h17.8
|
||||
v94.7c0,8.6-2.3,15.2-6.8,19.6C237.9,300.1,231.4,302.3,222.9,302.3z M230.4,159.2c0-3.2,0.9-5.6,2.6-7.3c1.7-1.7,4.2-2.6,7.5-2.6
|
||||
c3.1,0,5.6,0.9,7.3,2.6c1.7,1.7,2.6,4.2,2.6,7.3c0,3-0.9,5.4-2.6,7.2c-1.7,1.7-4.2,2.6-7.3,2.6c-3.2,0-5.7-0.9-7.5-2.6
|
||||
C231.2,164.6,230.4,162.2,230.4,159.2z'/>
|
||||
<path fill='#5F7FBF' d='M342.5,241.3c0,8.2-3,14.4-8.9,18.8c-6,4.4-14.5,6.5-25.6,6.5c-11.2,0-20.1-1.7-26.9-5.1v-15.4
|
||||
c9.8,4.5,19,6.8,27.5,6.8c10.9,0,16.4-3.3,16.4-9.9c0-2.1-0.6-3.9-1.8-5.3c-1.2-1.4-3.2-2.9-6-4.4c-2.8-1.5-6.6-3.2-11.6-5.1
|
||||
c-9.6-3.7-16.2-7.5-19.6-11.2c-3.4-3.7-5.1-8.6-5.1-14.5c0-7.2,2.9-12.7,8.7-16.7c5.8-4,13.6-5.9,23.6-5.9c9.8,0,19.1,2,27.9,6
|
||||
l-5.8,13.4c-9-3.7-16.6-5.6-22.8-5.6c-9.4,0-14.1,2.7-14.1,8c0,2.6,1.2,4.8,3.7,6.7c2.4,1.8,7.8,4.3,16,7.5
|
||||
c6.9,2.7,11.9,5.1,15.1,7.3c3.1,2.2,5.4,4.8,7,7.7C341.7,233.7,342.5,237.2,342.5,241.3z'/>
|
||||
</g>
|
||||
<path fill='#96CA4B' stroke='#96CA4B' stroke-width='6' stroke-miterlimit='10' d='M197,392.7c-91.2-8.1-163-85-163-178.3
|
||||
S105.8,44.3,197,36.2V16.1c-102.3,8.2-183,94-183,198.4s80.7,190.2,183,198.4V392.7z'/>
|
||||
<path fill='#5F7FBF' stroke='#5F7FBF' stroke-width='6' stroke-miterlimit='10' d='M229,16.1v20.1c91.2,8.1,163,85,163,178.3
|
||||
s-71.8,170.2-163,178.3v20.1c102.3-8.2,183-94,183-198.4S331.3,24.3,229,16.1z'/>
|
||||
</svg>")
|
||||
|
||||
;; ---- bad compile helper ui ----
|
||||
|
||||
(defn close-bad-compile-screen []
|
||||
(when-let [el (js/document.getElementById "figwheelFailScreen")]
|
||||
(dom/removeNode el)))
|
||||
|
||||
(defn bad-compile-screen []
|
||||
(let [body (-> (dom/getElementsByTagNameAndClass "body")
|
||||
(aget 0))]
|
||||
(close-bad-compile-screen)
|
||||
#_(dom/removeChildren body)
|
||||
(dom/append body
|
||||
(dom/createDom
|
||||
"div"
|
||||
#js {:id "figwheelFailScreen"
|
||||
:style (str "background-color: rgba(24, 26, 38, 0.95);"
|
||||
"position: absolute;"
|
||||
"z-index: 9000;"
|
||||
"width: 100vw;"
|
||||
"height: 100vh;"
|
||||
"top: 0px; left: 0px;"
|
||||
"font-family: monospace")}
|
||||
(dom/createDom
|
||||
"div"
|
||||
#js {:class "message"
|
||||
:style (str
|
||||
"color: #FFF5DB;"
|
||||
"width: 100vw;"
|
||||
"margin: auto;"
|
||||
"margin-top: 10px;"
|
||||
"text-align: center; "
|
||||
"padding: 2px 0px;"
|
||||
"font-size: 13px;"
|
||||
"position: relative")}
|
||||
(dom/createDom
|
||||
"a"
|
||||
#js {:onclick (fn [e]
|
||||
(.preventDefault e)
|
||||
(close-bad-compile-screen))
|
||||
:href "javascript:"
|
||||
:style "position: absolute; right: 10px; top: 10px; color: #666"}
|
||||
"X")
|
||||
(dom/createDom "h2" #js {:style "color: #FFF5DB"}
|
||||
"Figwheel Says: Your code didn't compile.")
|
||||
(dom/createDom "div" #js {:style "font-size: 12px"}
|
||||
(dom/createDom "p" #js { :style "color: #D07D7D;"}
|
||||
"Keep trying. This page will auto-refresh when your code compiles successfully.")
|
||||
))))))
|
||||
@@ -0,0 +1 @@
|
||||
{:rename-macros {}, :renames {}, :externs {document {createElement {}, querySelector {}, body {appendChild {}}, getElementById {}}, Object {setAttribute {}, appendChild {}}, Error {}, parseInt {}}, :use-macros {go cljs.core.async.macros, go-loop cljs.core.async.macros}, :excludes #{}, :name figwheel.client.heads-up, :imports nil, :requires {goog.dom goog.dom, dom goog.dom, data goog.dom.dataset, goog.string goog.string, async cljs.core.async, goog.dom.dataset goog.dom.dataset, gobj goog.object, goog.object goog.object, cljs.core.async cljs.core.async, socket figwheel.client.socket, pp cljs.pprint, cljs.pprint cljs.pprint, string clojure.string, figwheel.client.utils figwheel.client.utils, utils figwheel.client.utils, figwheel.client.socket figwheel.client.socket, clojure.string clojure.string}, :cljs.spec/speced-vars [], :uses {timeout cljs.core.async, <! cljs.core.async, close! cljs.core.async, chan cljs.core.async, alts! cljs.core.async, map< cljs.core.async, put! cljs.core.async}, :defs {get-content {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/heads_up.cljs", :line 92, :column 7, :end-line 92, :end-column 18, :arglists (quote ([{:keys [content-area-el]}]))}, :name figwheel.client.heads-up/get-content, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/heads_up.cljs", :end-column 18, :method-params ([p__46279]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 92, :end-line 92, :max-fixed-arity 1, :fn-var true, :arglists (quote ([{:keys [content-area-el]}]))}, auto-notify-source-file-line {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/heads_up.cljs", :line 222, :column 7, :end-line 222, :end-column 35, :arglists (quote ([{:keys [file line column]}]))}, :name figwheel.client.heads-up/auto-notify-source-file-line, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/heads_up.cljs", :end-column 35, :method-params ([p__46327]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 222, :end-line 222, :max-fixed-arity 1, :fn-var true, :arglists (quote ([{:keys [file line column]}]))}, display-exception {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/heads_up.cljs", :line 228, :column 7, :end-line 228, :end-column 24, :arglists (quote ([exception-data]))}, :name figwheel.client.heads-up/display-exception, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/heads_up.cljs", :end-column 24, :method-params ([exception-data]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 228, :end-line 228, :max-fixed-arity 1, :fn-var true, :arglists (quote ([exception-data]))}, set-style! {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/heads_up.cljs", :line 83, :column 7, :end-line 83, :end-column 17, :arglists (quote ([{:keys [container-el]} st-map]))}, :name figwheel.client.heads-up/set-style!, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/heads_up.cljs", :end-column 17, :method-params ([p__46269 st-map]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 83, :end-line 83, :max-fixed-arity 2, :fn-var true, :arglists (quote ([{:keys [container-el]} st-map]))}, heading {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/heads_up.cljs", :line 122, :column 7, :end-line 122, :end-column 14, :arglists (quote ([s] [s sub-head])), :top-fn {:variadic false, :max-fixed-arity 2, :method-params ([s] [s sub-head]), :arglists ([s] [s sub-head]), :arglists-meta (nil nil)}}, :name figwheel.client.heads-up/heading, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/heads_up.cljs", :end-column 14, :top-fn {:variadic false, :max-fixed-arity 2, :method-params ([s] [s sub-head]), :arglists ([s] [s sub-head]), :arglists-meta (nil nil)}, :method-params ([s] [s sub-head]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 122, :end-line 122, :max-fixed-arity 2, :fn-var true, :arglists ([s] [s sub-head])}, clear {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/heads_up.cljs", :line 318, :column 7, :end-line 318, :end-column 12, :arglists (quote ([]))}, :name figwheel.client.heads-up/clear, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/heads_up.cljs", :end-column 12, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 318, :end-line 318, :max-fixed-arity 0, :fn-var true, :arglists (quote ([]))}, escape {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/heads_up.cljs", :line 150, :column 7, :end-line 150, :end-column 13, :arglists (quote ([x]))}, :name figwheel.client.heLine truncated
|
||||
@@ -0,0 +1,891 @@
|
||||
// Compiled by ClojureScript 1.9.946 {}
|
||||
goog.provide('figwheel.client.heads_up');
|
||||
goog.require('cljs.core');
|
||||
goog.require('clojure.string');
|
||||
goog.require('figwheel.client.socket');
|
||||
goog.require('figwheel.client.utils');
|
||||
goog.require('cljs.core.async');
|
||||
goog.require('goog.string');
|
||||
goog.require('goog.dom.dataset');
|
||||
goog.require('goog.object');
|
||||
goog.require('goog.dom');
|
||||
goog.require('cljs.pprint');
|
||||
|
||||
figwheel.client.heads_up.node = (function figwheel$client$heads_up$node(var_args){
|
||||
var args__36784__auto__ = [];
|
||||
var len__36777__auto___46223 = arguments.length;
|
||||
var i__36778__auto___46224 = (0);
|
||||
while(true){
|
||||
if((i__36778__auto___46224 < len__36777__auto___46223)){
|
||||
args__36784__auto__.push((arguments[i__36778__auto___46224]));
|
||||
|
||||
var G__46225 = (i__36778__auto___46224 + (1));
|
||||
i__36778__auto___46224 = G__46225;
|
||||
continue;
|
||||
} else {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
var argseq__36785__auto__ = ((((2) < args__36784__auto__.length))?(new cljs.core.IndexedSeq(args__36784__auto__.slice((2)),(0),null)):null);
|
||||
return figwheel.client.heads_up.node.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__36785__auto__);
|
||||
});
|
||||
|
||||
figwheel.client.heads_up.node.cljs$core$IFn$_invoke$arity$variadic = (function (t,attrs,children){
|
||||
var e = document.createElement(cljs.core.name.call(null,t));
|
||||
var seq__46215_46226 = cljs.core.seq.call(null,cljs.core.keys.call(null,attrs));
|
||||
var chunk__46216_46227 = null;
|
||||
var count__46217_46228 = (0);
|
||||
var i__46218_46229 = (0);
|
||||
while(true){
|
||||
if((i__46218_46229 < count__46217_46228)){
|
||||
var k_46230 = cljs.core._nth.call(null,chunk__46216_46227,i__46218_46229);
|
||||
e.setAttribute(cljs.core.name.call(null,k_46230),cljs.core.get.call(null,attrs,k_46230));
|
||||
|
||||
var G__46231 = seq__46215_46226;
|
||||
var G__46232 = chunk__46216_46227;
|
||||
var G__46233 = count__46217_46228;
|
||||
var G__46234 = (i__46218_46229 + (1));
|
||||
seq__46215_46226 = G__46231;
|
||||
chunk__46216_46227 = G__46232;
|
||||
count__46217_46228 = G__46233;
|
||||
i__46218_46229 = G__46234;
|
||||
continue;
|
||||
} else {
|
||||
var temp__5457__auto___46235 = cljs.core.seq.call(null,seq__46215_46226);
|
||||
if(temp__5457__auto___46235){
|
||||
var seq__46215_46236__$1 = temp__5457__auto___46235;
|
||||
if(cljs.core.chunked_seq_QMARK_.call(null,seq__46215_46236__$1)){
|
||||
var c__36429__auto___46237 = cljs.core.chunk_first.call(null,seq__46215_46236__$1);
|
||||
var G__46238 = cljs.core.chunk_rest.call(null,seq__46215_46236__$1);
|
||||
var G__46239 = c__36429__auto___46237;
|
||||
var G__46240 = cljs.core.count.call(null,c__36429__auto___46237);
|
||||
var G__46241 = (0);
|
||||
seq__46215_46226 = G__46238;
|
||||
chunk__46216_46227 = G__46239;
|
||||
count__46217_46228 = G__46240;
|
||||
i__46218_46229 = G__46241;
|
||||
continue;
|
||||
} else {
|
||||
var k_46242 = cljs.core.first.call(null,seq__46215_46236__$1);
|
||||
e.setAttribute(cljs.core.name.call(null,k_46242),cljs.core.get.call(null,attrs,k_46242));
|
||||
|
||||
var G__46243 = cljs.core.next.call(null,seq__46215_46236__$1);
|
||||
var G__46244 = null;
|
||||
var G__46245 = (0);
|
||||
var G__46246 = (0);
|
||||
seq__46215_46226 = G__46243;
|
||||
chunk__46216_46227 = G__46244;
|
||||
count__46217_46228 = G__46245;
|
||||
i__46218_46229 = G__46246;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
var seq__46219_46247 = cljs.core.seq.call(null,children);
|
||||
var chunk__46220_46248 = null;
|
||||
var count__46221_46249 = (0);
|
||||
var i__46222_46250 = (0);
|
||||
while(true){
|
||||
if((i__46222_46250 < count__46221_46249)){
|
||||
var ch_46251 = cljs.core._nth.call(null,chunk__46220_46248,i__46222_46250);
|
||||
e.appendChild(ch_46251);
|
||||
|
||||
var G__46252 = seq__46219_46247;
|
||||
var G__46253 = chunk__46220_46248;
|
||||
var G__46254 = count__46221_46249;
|
||||
var G__46255 = (i__46222_46250 + (1));
|
||||
seq__46219_46247 = G__46252;
|
||||
chunk__46220_46248 = G__46253;
|
||||
count__46221_46249 = G__46254;
|
||||
i__46222_46250 = G__46255;
|
||||
continue;
|
||||
} else {
|
||||
var temp__5457__auto___46256 = cljs.core.seq.call(null,seq__46219_46247);
|
||||
if(temp__5457__auto___46256){
|
||||
var seq__46219_46257__$1 = temp__5457__auto___46256;
|
||||
if(cljs.core.chunked_seq_QMARK_.call(null,seq__46219_46257__$1)){
|
||||
var c__36429__auto___46258 = cljs.core.chunk_first.call(null,seq__46219_46257__$1);
|
||||
var G__46259 = cljs.core.chunk_rest.call(null,seq__46219_46257__$1);
|
||||
var G__46260 = c__36429__auto___46258;
|
||||
var G__46261 = cljs.core.count.call(null,c__36429__auto___46258);
|
||||
var G__46262 = (0);
|
||||
seq__46219_46247 = G__46259;
|
||||
chunk__46220_46248 = G__46260;
|
||||
count__46221_46249 = G__46261;
|
||||
i__46222_46250 = G__46262;
|
||||
continue;
|
||||
} else {
|
||||
var ch_46263 = cljs.core.first.call(null,seq__46219_46257__$1);
|
||||
e.appendChild(ch_46263);
|
||||
|
||||
var G__46264 = cljs.core.next.call(null,seq__46219_46257__$1);
|
||||
var G__46265 = null;
|
||||
var G__46266 = (0);
|
||||
var G__46267 = (0);
|
||||
seq__46219_46247 = G__46264;
|
||||
chunk__46220_46248 = G__46265;
|
||||
count__46221_46249 = G__46266;
|
||||
i__46222_46250 = G__46267;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return e;
|
||||
});
|
||||
|
||||
figwheel.client.heads_up.node.cljs$lang$maxFixedArity = (2);
|
||||
|
||||
figwheel.client.heads_up.node.cljs$lang$applyTo = (function (seq46212){
|
||||
var G__46213 = cljs.core.first.call(null,seq46212);
|
||||
var seq46212__$1 = cljs.core.next.call(null,seq46212);
|
||||
var G__46214 = cljs.core.first.call(null,seq46212__$1);
|
||||
var seq46212__$2 = cljs.core.next.call(null,seq46212__$1);
|
||||
return figwheel.client.heads_up.node.cljs$core$IFn$_invoke$arity$variadic(G__46213,G__46214,seq46212__$2);
|
||||
});
|
||||
|
||||
if(typeof figwheel.client.heads_up.heads_up_event_dispatch !== 'undefined'){
|
||||
} else {
|
||||
figwheel.client.heads_up.heads_up_event_dispatch = (function (){var method_table__36553__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
|
||||
var prefer_table__36554__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
|
||||
var method_cache__36555__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
|
||||
var cached_hierarchy__36556__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
|
||||
var hierarchy__36557__auto__ = cljs.core.get.call(null,cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),cljs.core.get_global_hierarchy.call(null));
|
||||
return (new cljs.core.MultiFn(cljs.core.symbol.call(null,"figwheel.client.heads-up","heads-up-event-dispatch"),((function (method_table__36553__auto__,prefer_table__36554__auto__,method_cache__36555__auto__,cached_hierarchy__36556__auto__,hierarchy__36557__auto__){
|
||||
return (function (dataset){
|
||||
return dataset.figwheelEvent;
|
||||
});})(method_table__36553__auto__,prefer_table__36554__auto__,method_cache__36555__auto__,cached_hierarchy__36556__auto__,hierarchy__36557__auto__))
|
||||
,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__36557__auto__,method_table__36553__auto__,prefer_table__36554__auto__,method_cache__36555__auto__,cached_hierarchy__36556__auto__));
|
||||
})();
|
||||
}
|
||||
cljs.core._add_method.call(null,figwheel.client.heads_up.heads_up_event_dispatch,new cljs.core.Keyword(null,"default","default",-1987822328),(function (_){
|
||||
return cljs.core.PersistentArrayMap.EMPTY;
|
||||
}));
|
||||
cljs.core._add_method.call(null,figwheel.client.heads_up.heads_up_event_dispatch,"file-selected",(function (dataset){
|
||||
return figwheel.client.socket.send_BANG_.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"figwheel-event","figwheel-event",519570592),"file-selected",new cljs.core.Keyword(null,"file-name","file-name",-1654217259),dataset.fileName,new cljs.core.Keyword(null,"file-line","file-line",-1228823138),dataset.fileLine,new cljs.core.Keyword(null,"file-column","file-column",1543934780),dataset.fileColumn], null));
|
||||
}));
|
||||
cljs.core._add_method.call(null,figwheel.client.heads_up.heads_up_event_dispatch,"close-heads-up",(function (dataset){
|
||||
return figwheel.client.heads_up.clear.call(null);
|
||||
}));
|
||||
figwheel.client.heads_up.ancestor_nodes = (function figwheel$client$heads_up$ancestor_nodes(el){
|
||||
return cljs.core.iterate.call(null,(function (e){
|
||||
return e.parentNode;
|
||||
}),el);
|
||||
});
|
||||
figwheel.client.heads_up.get_dataset = (function figwheel$client$heads_up$get_dataset(el){
|
||||
return cljs.core.first.call(null,cljs.core.keep.call(null,(function (x){
|
||||
if(cljs.core.truth_(x.dataset.figwheelEvent)){
|
||||
return x.dataset;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}),cljs.core.take.call(null,(4),figwheel.client.heads_up.ancestor_nodes.call(null,el))));
|
||||
});
|
||||
figwheel.client.heads_up.heads_up_onclick_handler = (function figwheel$client$heads_up$heads_up_onclick_handler(event){
|
||||
var dataset = figwheel.client.heads_up.get_dataset.call(null,event.target);
|
||||
event.preventDefault();
|
||||
|
||||
if(cljs.core.truth_(dataset)){
|
||||
return figwheel.client.heads_up.heads_up_event_dispatch.call(null,dataset);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
figwheel.client.heads_up.ensure_container = (function figwheel$client$heads_up$ensure_container(){
|
||||
var cont_id = "figwheel-heads-up-container";
|
||||
var content_id = "figwheel-heads-up-content-area";
|
||||
if(cljs.core.not.call(null,document.querySelector(["#",cljs.core.str.cljs$core$IFn$_invoke$arity$1(cont_id)].join('')))){
|
||||
var el_46268 = figwheel.client.heads_up.node.call(null,new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"id","id",-1388402092),cont_id,new cljs.core.Keyword(null,"style","style",-496642736),["-webkit-transition: all 0.2s ease-in-out;","-moz-transition: all 0.2s ease-in-out;","-o-transition: all 0.2s ease-in-out;","transition: all 0.2s ease-in-out;","font-size: 13px;","border-top: 1px solid #f5f5f5;","box-shadow: 0px 0px 1px #aaaaaa;","line-height: 18px;","color: #333;","font-family: monospace;","padding: 0px 10px 0px 70px;","position: fixed;","bottom: 0px;","left: 0px;","height: 0px;","opacity: 0.0;","box-sizing: border-box;","z-index: 10000;","text-align: left;"].join('')], null));
|
||||
el_46268.onclick = figwheel.client.heads_up.heads_up_onclick_handler;
|
||||
|
||||
el_46268.innerHTML = figwheel.client.heads_up.cljs_logo_svg;
|
||||
|
||||
el_46268.appendChild(figwheel.client.heads_up.node.call(null,new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"id","id",-1388402092),content_id], null)));
|
||||
|
||||
document.body.appendChild(el_46268);
|
||||
} else {
|
||||
}
|
||||
|
||||
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"container-el","container-el",109664205),document.getElementById(cont_id),new cljs.core.Keyword(null,"content-area-el","content-area-el",742757187),document.getElementById(content_id)], null);
|
||||
});
|
||||
figwheel.client.heads_up.set_style_BANG_ = (function figwheel$client$heads_up$set_style_BANG_(p__46269,st_map){
|
||||
var map__46270 = p__46269;
|
||||
var map__46270__$1 = ((((!((map__46270 == null)))?((((map__46270.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46270.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46270):map__46270);
|
||||
var container_el = cljs.core.get.call(null,map__46270__$1,new cljs.core.Keyword(null,"container-el","container-el",109664205));
|
||||
return cljs.core.mapv.call(null,((function (map__46270,map__46270__$1,container_el){
|
||||
return (function (p__46272){
|
||||
var vec__46273 = p__46272;
|
||||
var k = cljs.core.nth.call(null,vec__46273,(0),null);
|
||||
var v = cljs.core.nth.call(null,vec__46273,(1),null);
|
||||
return goog.object.set(container_el.style,cljs.core.name.call(null,k),v);
|
||||
});})(map__46270,map__46270__$1,container_el))
|
||||
,st_map);
|
||||
});
|
||||
figwheel.client.heads_up.set_content_BANG_ = (function figwheel$client$heads_up$set_content_BANG_(p__46276,dom_str){
|
||||
var map__46277 = p__46276;
|
||||
var map__46277__$1 = ((((!((map__46277 == null)))?((((map__46277.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46277.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46277):map__46277);
|
||||
var c = map__46277__$1;
|
||||
var content_area_el = cljs.core.get.call(null,map__46277__$1,new cljs.core.Keyword(null,"content-area-el","content-area-el",742757187));
|
||||
return content_area_el.innerHTML = dom_str;
|
||||
});
|
||||
figwheel.client.heads_up.get_content = (function figwheel$client$heads_up$get_content(p__46279){
|
||||
var map__46280 = p__46279;
|
||||
var map__46280__$1 = ((((!((map__46280 == null)))?((((map__46280.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46280.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46280):map__46280);
|
||||
var content_area_el = cljs.core.get.call(null,map__46280__$1,new cljs.core.Keyword(null,"content-area-el","content-area-el",742757187));
|
||||
return content_area_el.innerHTML;
|
||||
});
|
||||
figwheel.client.heads_up.close_link = (function figwheel$client$heads_up$close_link(){
|
||||
return ["<a style=\"","float: right;","font-size: 18px;","text-decoration: none;","text-align: right;","width: 30px;","height: 30px;","color: rgba(84,84,84, 0.5);","\" href=\"#\" data-figwheel-event=\"close-heads-up\">","x","</a>"].join('');
|
||||
});
|
||||
figwheel.client.heads_up.display_heads_up = (function figwheel$client$heads_up$display_heads_up(style,msg){
|
||||
var c__42249__auto__ = cljs.core.async.chan.call(null,(1));
|
||||
cljs.core.async.impl.dispatch.run.call(null,((function (c__42249__auto__){
|
||||
return (function (){
|
||||
var f__42250__auto__ = (function (){var switch__42159__auto__ = ((function (c__42249__auto__){
|
||||
return (function (state_46297){
|
||||
var state_val_46298 = (state_46297[(1)]);
|
||||
if((state_val_46298 === (1))){
|
||||
var inst_46282 = (state_46297[(7)]);
|
||||
var inst_46282__$1 = figwheel.client.heads_up.ensure_container.call(null);
|
||||
var inst_46283 = [new cljs.core.Keyword(null,"paddingTop","paddingTop",-1088692345),new cljs.core.Keyword(null,"paddingBottom","paddingBottom",-916694489),new cljs.core.Keyword(null,"width","width",-384071477),new cljs.core.Keyword(null,"minHeight","minHeight",-1635998980),new cljs.core.Keyword(null,"opacity","opacity",397153780)];
|
||||
var inst_46284 = ["10px","10px","100%","68px","1.0"];
|
||||
var inst_46285 = cljs.core.PersistentHashMap.fromArrays(inst_46283,inst_46284);
|
||||
var inst_46286 = cljs.core.merge.call(null,inst_46285,style);
|
||||
var inst_46287 = figwheel.client.heads_up.set_style_BANG_.call(null,inst_46282__$1,inst_46286);
|
||||
var inst_46288 = figwheel.client.heads_up.set_content_BANG_.call(null,inst_46282__$1,msg);
|
||||
var inst_46289 = cljs.core.async.timeout.call(null,(300));
|
||||
var state_46297__$1 = (function (){var statearr_46299 = state_46297;
|
||||
(statearr_46299[(8)] = inst_46288);
|
||||
|
||||
(statearr_46299[(7)] = inst_46282__$1);
|
||||
|
||||
(statearr_46299[(9)] = inst_46287);
|
||||
|
||||
return statearr_46299;
|
||||
})();
|
||||
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46297__$1,(2),inst_46289);
|
||||
} else {
|
||||
if((state_val_46298 === (2))){
|
||||
var inst_46282 = (state_46297[(7)]);
|
||||
var inst_46291 = (state_46297[(2)]);
|
||||
var inst_46292 = [new cljs.core.Keyword(null,"height","height",1025178622)];
|
||||
var inst_46293 = ["auto"];
|
||||
var inst_46294 = cljs.core.PersistentHashMap.fromArrays(inst_46292,inst_46293);
|
||||
var inst_46295 = figwheel.client.heads_up.set_style_BANG_.call(null,inst_46282,inst_46294);
|
||||
var state_46297__$1 = (function (){var statearr_46300 = state_46297;
|
||||
(statearr_46300[(10)] = inst_46291);
|
||||
|
||||
return statearr_46300;
|
||||
})();
|
||||
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46297__$1,inst_46295);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});})(c__42249__auto__))
|
||||
;
|
||||
return ((function (switch__42159__auto__,c__42249__auto__){
|
||||
return (function() {
|
||||
var figwheel$client$heads_up$display_heads_up_$_state_machine__42160__auto__ = null;
|
||||
var figwheel$client$heads_up$display_heads_up_$_state_machine__42160__auto____0 = (function (){
|
||||
var statearr_46301 = [null,null,null,null,null,null,null,null,null,null,null];
|
||||
(statearr_46301[(0)] = figwheel$client$heads_up$display_heads_up_$_state_machine__42160__auto__);
|
||||
|
||||
(statearr_46301[(1)] = (1));
|
||||
|
||||
return statearr_46301;
|
||||
});
|
||||
var figwheel$client$heads_up$display_heads_up_$_state_machine__42160__auto____1 = (function (state_46297){
|
||||
while(true){
|
||||
var ret_value__42161__auto__ = (function (){try{while(true){
|
||||
var result__42162__auto__ = switch__42159__auto__.call(null,state_46297);
|
||||
if(cljs.core.keyword_identical_QMARK_.call(null,result__42162__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
|
||||
continue;
|
||||
} else {
|
||||
return result__42162__auto__;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}catch (e46302){if((e46302 instanceof Object)){
|
||||
var ex__42163__auto__ = e46302;
|
||||
var statearr_46303_46305 = state_46297;
|
||||
(statearr_46303_46305[(5)] = ex__42163__auto__);
|
||||
|
||||
|
||||
cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46297);
|
||||
|
||||
return new cljs.core.Keyword(null,"recur","recur",-437573268);
|
||||
} else {
|
||||
throw e46302;
|
||||
|
||||
}
|
||||
}})();
|
||||
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__42161__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
|
||||
var G__46306 = state_46297;
|
||||
state_46297 = G__46306;
|
||||
continue;
|
||||
} else {
|
||||
return ret_value__42161__auto__;
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
figwheel$client$heads_up$display_heads_up_$_state_machine__42160__auto__ = function(state_46297){
|
||||
switch(arguments.length){
|
||||
case 0:
|
||||
return figwheel$client$heads_up$display_heads_up_$_state_machine__42160__auto____0.call(this);
|
||||
case 1:
|
||||
return figwheel$client$heads_up$display_heads_up_$_state_machine__42160__auto____1.call(this,state_46297);
|
||||
}
|
||||
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
|
||||
};
|
||||
figwheel$client$heads_up$display_heads_up_$_state_machine__42160__auto__.cljs$core$IFn$_invoke$arity$0 = figwheel$client$heads_up$display_heads_up_$_state_machine__42160__auto____0;
|
||||
figwheel$client$heads_up$display_heads_up_$_state_machine__42160__auto__.cljs$core$IFn$_invoke$arity$1 = figwheel$client$heads_up$display_heads_up_$_state_machine__42160__auto____1;
|
||||
return figwheel$client$heads_up$display_heads_up_$_state_machine__42160__auto__;
|
||||
})()
|
||||
;})(switch__42159__auto__,c__42249__auto__))
|
||||
})();
|
||||
var state__42251__auto__ = (function (){var statearr_46304 = f__42250__auto__.call(null);
|
||||
(statearr_46304[(6)] = c__42249__auto__);
|
||||
|
||||
return statearr_46304;
|
||||
})();
|
||||
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__42251__auto__);
|
||||
});})(c__42249__auto__))
|
||||
);
|
||||
|
||||
return c__42249__auto__;
|
||||
});
|
||||
figwheel.client.heads_up.heading = (function figwheel$client$heads_up$heading(var_args){
|
||||
var G__46308 = arguments.length;
|
||||
switch (G__46308) {
|
||||
case 1:
|
||||
return figwheel.client.heads_up.heading.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
|
||||
|
||||
break;
|
||||
case 2:
|
||||
return figwheel.client.heads_up.heading.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
|
||||
|
||||
break;
|
||||
default:
|
||||
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
figwheel.client.heads_up.heading.cljs$core$IFn$_invoke$arity$1 = (function (s){
|
||||
return figwheel.client.heads_up.heading.call(null,s,"");
|
||||
});
|
||||
|
||||
figwheel.client.heads_up.heading.cljs$core$IFn$_invoke$arity$2 = (function (s,sub_head){
|
||||
return ["<div style=\"","font-size: 26px;","line-height: 26px;","margin-bottom: 2px;","padding-top: 1px;","\">",cljs.core.str.cljs$core$IFn$_invoke$arity$1(s)," <span style=\"","display: inline-block;","font-size: 13px;","\">",cljs.core.str.cljs$core$IFn$_invoke$arity$1(sub_head),"</span></div>"].join('');
|
||||
});
|
||||
|
||||
figwheel.client.heads_up.heading.cljs$lang$maxFixedArity = 2;
|
||||
|
||||
figwheel.client.heads_up.file_selector_div = (function figwheel$client$heads_up$file_selector_div(file_name,line_number,column_number,msg){
|
||||
return ["<div style=\"cursor: pointer;\" data-figwheel-event=\"file-selected\" data-file-name=\"",cljs.core.str.cljs$core$IFn$_invoke$arity$1(file_name),"\" data-file-line=\"",cljs.core.str.cljs$core$IFn$_invoke$arity$1(line_number),"\" data-file-column=\"",cljs.core.str.cljs$core$IFn$_invoke$arity$1(column_number),"\">",cljs.core.str.cljs$core$IFn$_invoke$arity$1(msg),"</div>"].join('');
|
||||
});
|
||||
figwheel.client.heads_up.format_line = (function figwheel$client$heads_up$format_line(msg,p__46310){
|
||||
var map__46311 = p__46310;
|
||||
var map__46311__$1 = ((((!((map__46311 == null)))?((((map__46311.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46311.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46311):map__46311);
|
||||
var file = cljs.core.get.call(null,map__46311__$1,new cljs.core.Keyword(null,"file","file",-1269645878));
|
||||
var line = cljs.core.get.call(null,map__46311__$1,new cljs.core.Keyword(null,"line","line",212345235));
|
||||
var column = cljs.core.get.call(null,map__46311__$1,new cljs.core.Keyword(null,"column","column",2078222095));
|
||||
var msg__$1 = goog.string.htmlEscape(msg);
|
||||
if(cljs.core.truth_((function (){var or__35498__auto__ = file;
|
||||
if(cljs.core.truth_(or__35498__auto__)){
|
||||
return or__35498__auto__;
|
||||
} else {
|
||||
return line;
|
||||
}
|
||||
})())){
|
||||
return figwheel.client.heads_up.file_selector_div.call(null,file,line,column,msg__$1);
|
||||
} else {
|
||||
return ["<div>",cljs.core.str.cljs$core$IFn$_invoke$arity$1(msg__$1),"</div>"].join('');
|
||||
}
|
||||
});
|
||||
figwheel.client.heads_up.escape = (function figwheel$client$heads_up$escape(x){
|
||||
return goog.string.htmlEscape(x);
|
||||
});
|
||||
figwheel.client.heads_up.pad_line_number = (function figwheel$client$heads_up$pad_line_number(n,line_number){
|
||||
var len = cljs.core.count.call(null,cljs.core.fnil.call(null,cljs.core.str,"").call(null,line_number));
|
||||
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1((((len < n))?cljs.core.apply.call(null,cljs.core.str,cljs.core.repeat.call(null,(n - len)," ")):"")),cljs.core.str.cljs$core$IFn$_invoke$arity$1(line_number)].join('');
|
||||
});
|
||||
figwheel.client.heads_up.inline_error_line = (function figwheel$client$heads_up$inline_error_line(style,line_number,line){
|
||||
return ["<span style='",cljs.core.str.cljs$core$IFn$_invoke$arity$1(style),"'>","<span style='color: #757575;'>",cljs.core.str.cljs$core$IFn$_invoke$arity$1(line_number)," </span>",cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.heads_up.escape.call(null,line)),"</span>"].join('');
|
||||
});
|
||||
figwheel.client.heads_up.format_inline_error_line = (function figwheel$client$heads_up$format_inline_error_line(p__46313){
|
||||
var vec__46314 = p__46313;
|
||||
var typ = cljs.core.nth.call(null,vec__46314,(0),null);
|
||||
var line_number = cljs.core.nth.call(null,vec__46314,(1),null);
|
||||
var line = cljs.core.nth.call(null,vec__46314,(2),null);
|
||||
var pred__46317 = cljs.core._EQ_;
|
||||
var expr__46318 = typ;
|
||||
if(cljs.core.truth_(pred__46317.call(null,new cljs.core.Keyword(null,"code-line","code-line",-2138627853),expr__46318))){
|
||||
return figwheel.client.heads_up.inline_error_line.call(null,"color: #999;",line_number,line);
|
||||
} else {
|
||||
if(cljs.core.truth_(pred__46317.call(null,new cljs.core.Keyword(null,"error-in-code","error-in-code",-1661931357),expr__46318))){
|
||||
return figwheel.client.heads_up.inline_error_line.call(null,"color: #ccc; font-weight: bold;",line_number,line);
|
||||
} else {
|
||||
if(cljs.core.truth_(pred__46317.call(null,new cljs.core.Keyword(null,"error-message","error-message",1756021561),expr__46318))){
|
||||
return figwheel.client.heads_up.inline_error_line.call(null,"color: #D07D7D;",line_number,line);
|
||||
} else {
|
||||
return figwheel.client.heads_up.inline_error_line.call(null,"color: #666;",line_number,line);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
figwheel.client.heads_up.pad_line_numbers = (function figwheel$client$heads_up$pad_line_numbers(inline_error){
|
||||
var max_line_number_length = cljs.core.count.call(null,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.reduce.call(null,cljs.core.max,cljs.core.map.call(null,cljs.core.second,inline_error)))].join(''));
|
||||
return cljs.core.map.call(null,((function (max_line_number_length){
|
||||
return (function (p1__46320_SHARP_){
|
||||
return cljs.core.update_in.call(null,p1__46320_SHARP_,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1)], null),cljs.core.partial.call(null,figwheel.client.heads_up.pad_line_number,max_line_number_length));
|
||||
});})(max_line_number_length))
|
||||
,inline_error);
|
||||
});
|
||||
figwheel.client.heads_up.format_inline_error = (function figwheel$client$heads_up$format_inline_error(inline_error){
|
||||
var lines = cljs.core.map.call(null,figwheel.client.heads_up.format_inline_error_line,figwheel.client.heads_up.pad_line_numbers.call(null,inline_error));
|
||||
return ["<pre style='whitespace:pre; overflow-x: scroll; display:block; font-family:monospace; font-size:0.8em; border-radius: 3px;"," line-height: 1.1em; padding: 10px; background-color: rgb(24,26,38); margin-right: 5px'>",cljs.core.str.cljs$core$IFn$_invoke$arity$1(clojure.string.join.call(null,"\n",lines)),"</pre>"].join('');
|
||||
});
|
||||
figwheel.client.heads_up.flatten_exception = (function figwheel$client$heads_up$flatten_exception(p1__46321_SHARP_){
|
||||
return cljs.core.take_while.call(null,cljs.core.some_QMARK_,cljs.core.iterate.call(null,new cljs.core.Keyword(null,"cause","cause",231901252),p1__46321_SHARP_));
|
||||
});
|
||||
figwheel.client.heads_up.exception__GT_display_data = (function figwheel$client$heads_up$exception__GT_display_data(p__46324){
|
||||
var map__46325 = p__46324;
|
||||
var map__46325__$1 = ((((!((map__46325 == null)))?((((map__46325.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46325.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46325):map__46325);
|
||||
var exception = map__46325__$1;
|
||||
var message = cljs.core.get.call(null,map__46325__$1,new cljs.core.Keyword(null,"message","message",-406056002));
|
||||
var failed_loading_clj_file = cljs.core.get.call(null,map__46325__$1,new cljs.core.Keyword(null,"failed-loading-clj-file","failed-loading-clj-file",-1682536481));
|
||||
var reader_exception = cljs.core.get.call(null,map__46325__$1,new cljs.core.Keyword(null,"reader-exception","reader-exception",-1938323098));
|
||||
var file = cljs.core.get.call(null,map__46325__$1,new cljs.core.Keyword(null,"file","file",-1269645878));
|
||||
var column = cljs.core.get.call(null,map__46325__$1,new cljs.core.Keyword(null,"column","column",2078222095));
|
||||
var failed_compiling = cljs.core.get.call(null,map__46325__$1,new cljs.core.Keyword(null,"failed-compiling","failed-compiling",1768639503));
|
||||
var error_inline = cljs.core.get.call(null,map__46325__$1,new cljs.core.Keyword(null,"error-inline","error-inline",1073987185));
|
||||
var line = cljs.core.get.call(null,map__46325__$1,new cljs.core.Keyword(null,"line","line",212345235));
|
||||
var class$ = cljs.core.get.call(null,map__46325__$1,new cljs.core.Keyword(null,"class","class",-2030961996));
|
||||
var analysis_exception = cljs.core.get.call(null,map__46325__$1,new cljs.core.Keyword(null,"analysis-exception","analysis-exception",591623285));
|
||||
var display_ex_data = cljs.core.get.call(null,map__46325__$1,new cljs.core.Keyword(null,"display-ex-data","display-ex-data",-1611558730));
|
||||
var last_message = (cljs.core.truth_((function (){var and__35486__auto__ = file;
|
||||
if(cljs.core.truth_(and__35486__auto__)){
|
||||
return line;
|
||||
} else {
|
||||
return and__35486__auto__;
|
||||
}
|
||||
})())?["Please see line ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(line)," of file ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(file)].join(''):(cljs.core.truth_(file)?["Please see ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(file)].join(''):null
|
||||
));
|
||||
return new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"head","head",-771383919),(cljs.core.truth_(failed_loading_clj_file)?"Couldn't load Clojure file":(cljs.core.truth_(analysis_exception)?"Could not Analyze":(cljs.core.truth_(reader_exception)?"Could not Read":(cljs.core.truth_(failed_compiling)?"Could not Compile":"Compile Exception"
|
||||
)))),new cljs.core.Keyword(null,"sub-head","sub-head",1930649117),file,new cljs.core.Keyword(null,"messages","messages",345434482),cljs.core.concat.call(null,cljs.core.map.call(null,((function (last_message,map__46325,map__46325__$1,exception,message,failed_loading_clj_file,reader_exception,file,column,failed_compiling,error_inline,line,class$,analysis_exception,display_ex_data){
|
||||
return (function (p1__46322_SHARP_){
|
||||
return ["<div>",cljs.core.str.cljs$core$IFn$_invoke$arity$1(p1__46322_SHARP_),"</div>"].join('');
|
||||
});})(last_message,map__46325,map__46325__$1,exception,message,failed_loading_clj_file,reader_exception,file,column,failed_compiling,error_inline,line,class$,analysis_exception,display_ex_data))
|
||||
,(cljs.core.truth_(message)?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [[cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(class$)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.heads_up.escape.call(null,class$)),": "].join(''):"")),"<span style=\"font-weight:bold;\">",cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.heads_up.escape.call(null,message)),"</span>"].join(''),(cljs.core.truth_(display_ex_data)?["<pre>",cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.utils.pprint_to_string.call(null,display_ex_data)),"</pre>"].join(''):null),(((cljs.core.count.call(null,error_inline) > (0)))?figwheel.client.heads_up.format_inline_error.call(null,error_inline):null)], null):cljs.core.map.call(null,((function (last_message,map__46325,map__46325__$1,exception,message,failed_loading_clj_file,reader_exception,file,column,failed_compiling,error_inline,line,class$,analysis_exception,display_ex_data){
|
||||
return (function (p1__46323_SHARP_){
|
||||
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.heads_up.escape.call(null,new cljs.core.Keyword(null,"class","class",-2030961996).cljs$core$IFn$_invoke$arity$1(p1__46323_SHARP_))),": ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.heads_up.escape.call(null,new cljs.core.Keyword(null,"message","message",-406056002).cljs$core$IFn$_invoke$arity$1(p1__46323_SHARP_)))].join('');
|
||||
});})(last_message,map__46325,map__46325__$1,exception,message,failed_loading_clj_file,reader_exception,file,column,failed_compiling,error_inline,line,class$,analysis_exception,display_ex_data))
|
||||
,figwheel.client.heads_up.flatten_exception.call(null,new cljs.core.Keyword(null,"exception-data","exception-data",-512474886).cljs$core$IFn$_invoke$arity$1(exception))))),(cljs.core.truth_(last_message)?new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [["<div style=\"color: #AD4F4F; padding-top: 3px;\">",cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.heads_up.escape.call(null,last_message)),"</div>"].join('')], null):null)),new cljs.core.Keyword(null,"file","file",-1269645878),file,new cljs.core.Keyword(null,"line","line",212345235),line,new cljs.core.Keyword(null,"column","column",2078222095),column], null);
|
||||
});
|
||||
figwheel.client.heads_up.auto_notify_source_file_line = (function figwheel$client$heads_up$auto_notify_source_file_line(p__46327){
|
||||
var map__46328 = p__46327;
|
||||
var map__46328__$1 = ((((!((map__46328 == null)))?((((map__46328.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46328.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46328):map__46328);
|
||||
var file = cljs.core.get.call(null,map__46328__$1,new cljs.core.Keyword(null,"file","file",-1269645878));
|
||||
var line = cljs.core.get.call(null,map__46328__$1,new cljs.core.Keyword(null,"line","line",212345235));
|
||||
var column = cljs.core.get.call(null,map__46328__$1,new cljs.core.Keyword(null,"column","column",2078222095));
|
||||
return figwheel.client.socket.send_BANG_.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"figwheel-event","figwheel-event",519570592),"file-selected",new cljs.core.Keyword(null,"file-name","file-name",-1654217259),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(file)].join(''),new cljs.core.Keyword(null,"file-line","file-line",-1228823138),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(line)].join(''),new cljs.core.Keyword(null,"file-column","file-column",1543934780),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(column)].join('')], null));
|
||||
});
|
||||
figwheel.client.heads_up.display_exception = (function figwheel$client$heads_up$display_exception(exception_data){
|
||||
var map__46331 = figwheel.client.heads_up.exception__GT_display_data.call(null,exception_data);
|
||||
var map__46331__$1 = ((((!((map__46331 == null)))?((((map__46331.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46331.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46331):map__46331);
|
||||
var head = cljs.core.get.call(null,map__46331__$1,new cljs.core.Keyword(null,"head","head",-771383919));
|
||||
var sub_head = cljs.core.get.call(null,map__46331__$1,new cljs.core.Keyword(null,"sub-head","sub-head",1930649117));
|
||||
var messages = cljs.core.get.call(null,map__46331__$1,new cljs.core.Keyword(null,"messages","messages",345434482));
|
||||
var last_message = cljs.core.get.call(null,map__46331__$1,new cljs.core.Keyword(null,"last-message","last-message",-2087778135));
|
||||
var file = cljs.core.get.call(null,map__46331__$1,new cljs.core.Keyword(null,"file","file",-1269645878));
|
||||
var line = cljs.core.get.call(null,map__46331__$1,new cljs.core.Keyword(null,"line","line",212345235));
|
||||
var column = cljs.core.get.call(null,map__46331__$1,new cljs.core.Keyword(null,"column","column",2078222095));
|
||||
var msg = cljs.core.apply.call(null,cljs.core.str,messages);
|
||||
return figwheel.client.heads_up.display_heads_up.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"backgroundColor","backgroundColor",1738438491),"rgba(255, 161, 161, 0.95)"], null),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.heads_up.close_link.call(null)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.heads_up.heading.call(null,head,sub_head)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.heads_up.file_selector_div.call(null,file,line,column,msg))].join(''));
|
||||
});
|
||||
figwheel.client.heads_up.warning_data__GT_display_data = (function figwheel$client$heads_up$warning_data__GT_display_data(p__46334){
|
||||
var map__46335 = p__46334;
|
||||
var map__46335__$1 = ((((!((map__46335 == null)))?((((map__46335.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46335.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46335):map__46335);
|
||||
var warning_data = map__46335__$1;
|
||||
var file = cljs.core.get.call(null,map__46335__$1,new cljs.core.Keyword(null,"file","file",-1269645878));
|
||||
var line = cljs.core.get.call(null,map__46335__$1,new cljs.core.Keyword(null,"line","line",212345235));
|
||||
var column = cljs.core.get.call(null,map__46335__$1,new cljs.core.Keyword(null,"column","column",2078222095));
|
||||
var message = cljs.core.get.call(null,map__46335__$1,new cljs.core.Keyword(null,"message","message",-406056002));
|
||||
var error_inline = cljs.core.get.call(null,map__46335__$1,new cljs.core.Keyword(null,"error-inline","error-inline",1073987185));
|
||||
var last_message = (cljs.core.truth_((function (){var and__35486__auto__ = file;
|
||||
if(cljs.core.truth_(and__35486__auto__)){
|
||||
return line;
|
||||
} else {
|
||||
return and__35486__auto__;
|
||||
}
|
||||
})())?["Please see line ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(line)," of file ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(file)].join(''):(cljs.core.truth_(file)?["Please see ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(file)].join(''):null
|
||||
));
|
||||
return new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"head","head",-771383919),"Compile Warning",new cljs.core.Keyword(null,"sub-head","sub-head",1930649117),file,new cljs.core.Keyword(null,"messages","messages",345434482),cljs.core.concat.call(null,cljs.core.map.call(null,((function (last_message,map__46335,map__46335__$1,warning_data,file,line,column,message,error_inline){
|
||||
return (function (p1__46333_SHARP_){
|
||||
return ["<div>",cljs.core.str.cljs$core$IFn$_invoke$arity$1(p1__46333_SHARP_),"</div>"].join('');
|
||||
});})(last_message,map__46335,map__46335__$1,warning_data,file,line,column,message,error_inline))
|
||||
,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(cljs.core.truth_(message)?["<span style=\"font-weight:bold;\">",cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.heads_up.escape.call(null,message)),"</span>"].join(''):null),(((cljs.core.count.call(null,error_inline) > (0)))?figwheel.client.heads_up.format_inline_error.call(null,error_inline):null)], null)),(cljs.core.truth_(last_message)?new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [["<div style=\"color: #AD4F4F; padding-top: 3px; margin-bottom: 10px;\">",cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.heads_up.escape.call(null,last_message)),"</div>"].join('')], null):null)),new cljs.core.Keyword(null,"file","file",-1269645878),file,new cljs.core.Keyword(null,"line","line",212345235),line,new cljs.core.Keyword(null,"column","column",2078222095),column], null);
|
||||
});
|
||||
figwheel.client.heads_up.display_system_warning = (function figwheel$client$heads_up$display_system_warning(header,msg){
|
||||
return figwheel.client.heads_up.display_heads_up.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"backgroundColor","backgroundColor",1738438491),"rgba(255, 220, 110, 0.95)"], null),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.heads_up.close_link.call(null)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.heads_up.heading.call(null,header)),"<div>",cljs.core.str.cljs$core$IFn$_invoke$arity$1(msg),"</div>"].join(''));
|
||||
});
|
||||
figwheel.client.heads_up.display_warning = (function figwheel$client$heads_up$display_warning(warning_data){
|
||||
var map__46337 = figwheel.client.heads_up.warning_data__GT_display_data.call(null,warning_data);
|
||||
var map__46337__$1 = ((((!((map__46337 == null)))?((((map__46337.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46337.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46337):map__46337);
|
||||
var head = cljs.core.get.call(null,map__46337__$1,new cljs.core.Keyword(null,"head","head",-771383919));
|
||||
var sub_head = cljs.core.get.call(null,map__46337__$1,new cljs.core.Keyword(null,"sub-head","sub-head",1930649117));
|
||||
var messages = cljs.core.get.call(null,map__46337__$1,new cljs.core.Keyword(null,"messages","messages",345434482));
|
||||
var last_message = cljs.core.get.call(null,map__46337__$1,new cljs.core.Keyword(null,"last-message","last-message",-2087778135));
|
||||
var file = cljs.core.get.call(null,map__46337__$1,new cljs.core.Keyword(null,"file","file",-1269645878));
|
||||
var line = cljs.core.get.call(null,map__46337__$1,new cljs.core.Keyword(null,"line","line",212345235));
|
||||
var column = cljs.core.get.call(null,map__46337__$1,new cljs.core.Keyword(null,"column","column",2078222095));
|
||||
var msg = cljs.core.apply.call(null,cljs.core.str,messages);
|
||||
return figwheel.client.heads_up.display_heads_up.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"backgroundColor","backgroundColor",1738438491),"rgba(255, 220, 110, 0.95)"], null),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.heads_up.close_link.call(null)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.heads_up.heading.call(null,head,sub_head)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(figwheel.client.heads_up.file_selector_div.call(null,file,line,column,msg))].join(''));
|
||||
});
|
||||
figwheel.client.heads_up.format_warning_message = (function figwheel$client$heads_up$format_warning_message(p__46339){
|
||||
var map__46340 = p__46339;
|
||||
var map__46340__$1 = ((((!((map__46340 == null)))?((((map__46340.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46340.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46340):map__46340);
|
||||
var warning_data = map__46340__$1;
|
||||
var message = cljs.core.get.call(null,map__46340__$1,new cljs.core.Keyword(null,"message","message",-406056002));
|
||||
var file = cljs.core.get.call(null,map__46340__$1,new cljs.core.Keyword(null,"file","file",-1269645878));
|
||||
var line = cljs.core.get.call(null,map__46340__$1,new cljs.core.Keyword(null,"line","line",212345235));
|
||||
var column = cljs.core.get.call(null,map__46340__$1,new cljs.core.Keyword(null,"column","column",2078222095));
|
||||
var G__46342 = message;
|
||||
var G__46342__$1 = (cljs.core.truth_(line)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__46342)," at line ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(line)].join(''):G__46342);
|
||||
var G__46342__$2 = (cljs.core.truth_((function (){var and__35486__auto__ = line;
|
||||
if(cljs.core.truth_(and__35486__auto__)){
|
||||
return column;
|
||||
} else {
|
||||
return and__35486__auto__;
|
||||
}
|
||||
})())?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__46342__$1),", column ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(column)].join(''):G__46342__$1);
|
||||
if(cljs.core.truth_(file)){
|
||||
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__46342__$2)," in file ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(file)].join('');
|
||||
} else {
|
||||
return G__46342__$2;
|
||||
}
|
||||
});
|
||||
figwheel.client.heads_up.append_warning_message = (function figwheel$client$heads_up$append_warning_message(p__46343){
|
||||
var map__46344 = p__46343;
|
||||
var map__46344__$1 = ((((!((map__46344 == null)))?((((map__46344.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46344.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46344):map__46344);
|
||||
var warning_data = map__46344__$1;
|
||||
var message = cljs.core.get.call(null,map__46344__$1,new cljs.core.Keyword(null,"message","message",-406056002));
|
||||
var file = cljs.core.get.call(null,map__46344__$1,new cljs.core.Keyword(null,"file","file",-1269645878));
|
||||
var line = cljs.core.get.call(null,map__46344__$1,new cljs.core.Keyword(null,"line","line",212345235));
|
||||
var column = cljs.core.get.call(null,map__46344__$1,new cljs.core.Keyword(null,"column","column",2078222095));
|
||||
if(cljs.core.truth_(message)){
|
||||
var map__46346 = figwheel.client.heads_up.ensure_container.call(null);
|
||||
var map__46346__$1 = ((((!((map__46346 == null)))?((((map__46346.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46346.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46346):map__46346);
|
||||
var content_area_el = cljs.core.get.call(null,map__46346__$1,new cljs.core.Keyword(null,"content-area-el","content-area-el",742757187));
|
||||
var el = goog.dom.createElement("div");
|
||||
var child_count = goog.dom.getChildren(content_area_el).length;
|
||||
if((child_count < (6))){
|
||||
el.innerHTML = figwheel.client.heads_up.format_line.call(null,figwheel.client.heads_up.format_warning_message.call(null,warning_data),warning_data);
|
||||
|
||||
return goog.dom.append(content_area_el,el);
|
||||
} else {
|
||||
var temp__5457__auto__ = goog.dom.getLastElementChild(content_area_el);
|
||||
if(cljs.core.truth_(temp__5457__auto__)){
|
||||
var last_child = temp__5457__auto__;
|
||||
var temp__5455__auto__ = goog.dom.dataset.get(last_child,"figwheel_count");
|
||||
if(cljs.core.truth_(temp__5455__auto__)){
|
||||
var message_count = temp__5455__auto__;
|
||||
var message_count__$1 = (parseInt(message_count) + (1));
|
||||
goog.dom.dataset.set(last_child,"figwheel_count",message_count__$1);
|
||||
|
||||
return last_child.innerHTML = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(message_count__$1)," more warnings have not been displayed ..."].join('');
|
||||
} else {
|
||||
return goog.dom.append(content_area_el,goog.dom.createDom("div",({"data-figwheel_count": (1), "style": "margin-top: 3px; font-weight: bold"}),"1 more warning that has not been displayed ..."));
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
figwheel.client.heads_up.clear = (function figwheel$client$heads_up$clear(){
|
||||
var c__42249__auto__ = cljs.core.async.chan.call(null,(1));
|
||||
cljs.core.async.impl.dispatch.run.call(null,((function (c__42249__auto__){
|
||||
return (function (){
|
||||
var f__42250__auto__ = (function (){var switch__42159__auto__ = ((function (c__42249__auto__){
|
||||
return (function (state_46365){
|
||||
var state_val_46366 = (state_46365[(1)]);
|
||||
if((state_val_46366 === (1))){
|
||||
var inst_46348 = (state_46365[(7)]);
|
||||
var inst_46348__$1 = figwheel.client.heads_up.ensure_container.call(null);
|
||||
var inst_46349 = [new cljs.core.Keyword(null,"opacity","opacity",397153780)];
|
||||
var inst_46350 = ["0.0"];
|
||||
var inst_46351 = cljs.core.PersistentHashMap.fromArrays(inst_46349,inst_46350);
|
||||
var inst_46352 = figwheel.client.heads_up.set_style_BANG_.call(null,inst_46348__$1,inst_46351);
|
||||
var inst_46353 = cljs.core.async.timeout.call(null,(300));
|
||||
var state_46365__$1 = (function (){var statearr_46367 = state_46365;
|
||||
(statearr_46367[(7)] = inst_46348__$1);
|
||||
|
||||
(statearr_46367[(8)] = inst_46352);
|
||||
|
||||
return statearr_46367;
|
||||
})();
|
||||
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46365__$1,(2),inst_46353);
|
||||
} else {
|
||||
if((state_val_46366 === (2))){
|
||||
var inst_46348 = (state_46365[(7)]);
|
||||
var inst_46355 = (state_46365[(2)]);
|
||||
var inst_46356 = [new cljs.core.Keyword(null,"width","width",-384071477),new cljs.core.Keyword(null,"height","height",1025178622),new cljs.core.Keyword(null,"minHeight","minHeight",-1635998980),new cljs.core.Keyword(null,"padding","padding",1660304693),new cljs.core.Keyword(null,"borderRadius","borderRadius",-1505621083),new cljs.core.Keyword(null,"backgroundColor","backgroundColor",1738438491)];
|
||||
var inst_46357 = ["auto","0px","0px","0px 10px 0px 70px","0px","transparent"];
|
||||
var inst_46358 = cljs.core.PersistentHashMap.fromArrays(inst_46356,inst_46357);
|
||||
var inst_46359 = figwheel.client.heads_up.set_style_BANG_.call(null,inst_46348,inst_46358);
|
||||
var inst_46360 = cljs.core.async.timeout.call(null,(200));
|
||||
var state_46365__$1 = (function (){var statearr_46368 = state_46365;
|
||||
(statearr_46368[(9)] = inst_46359);
|
||||
|
||||
(statearr_46368[(10)] = inst_46355);
|
||||
|
||||
return statearr_46368;
|
||||
})();
|
||||
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46365__$1,(3),inst_46360);
|
||||
} else {
|
||||
if((state_val_46366 === (3))){
|
||||
var inst_46348 = (state_46365[(7)]);
|
||||
var inst_46362 = (state_46365[(2)]);
|
||||
var inst_46363 = figwheel.client.heads_up.set_content_BANG_.call(null,inst_46348,"");
|
||||
var state_46365__$1 = (function (){var statearr_46369 = state_46365;
|
||||
(statearr_46369[(11)] = inst_46362);
|
||||
|
||||
return statearr_46369;
|
||||
})();
|
||||
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46365__$1,inst_46363);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
});})(c__42249__auto__))
|
||||
;
|
||||
return ((function (switch__42159__auto__,c__42249__auto__){
|
||||
return (function() {
|
||||
var figwheel$client$heads_up$clear_$_state_machine__42160__auto__ = null;
|
||||
var figwheel$client$heads_up$clear_$_state_machine__42160__auto____0 = (function (){
|
||||
var statearr_46370 = [null,null,null,null,null,null,null,null,null,null,null,null];
|
||||
(statearr_46370[(0)] = figwheel$client$heads_up$clear_$_state_machine__42160__auto__);
|
||||
|
||||
(statearr_46370[(1)] = (1));
|
||||
|
||||
return statearr_46370;
|
||||
});
|
||||
var figwheel$client$heads_up$clear_$_state_machine__42160__auto____1 = (function (state_46365){
|
||||
while(true){
|
||||
var ret_value__42161__auto__ = (function (){try{while(true){
|
||||
var result__42162__auto__ = switch__42159__auto__.call(null,state_46365);
|
||||
if(cljs.core.keyword_identical_QMARK_.call(null,result__42162__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
|
||||
continue;
|
||||
} else {
|
||||
return result__42162__auto__;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}catch (e46371){if((e46371 instanceof Object)){
|
||||
var ex__42163__auto__ = e46371;
|
||||
var statearr_46372_46374 = state_46365;
|
||||
(statearr_46372_46374[(5)] = ex__42163__auto__);
|
||||
|
||||
|
||||
cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46365);
|
||||
|
||||
return new cljs.core.Keyword(null,"recur","recur",-437573268);
|
||||
} else {
|
||||
throw e46371;
|
||||
|
||||
}
|
||||
}})();
|
||||
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__42161__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
|
||||
var G__46375 = state_46365;
|
||||
state_46365 = G__46375;
|
||||
continue;
|
||||
} else {
|
||||
return ret_value__42161__auto__;
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
figwheel$client$heads_up$clear_$_state_machine__42160__auto__ = function(state_46365){
|
||||
switch(arguments.length){
|
||||
case 0:
|
||||
return figwheel$client$heads_up$clear_$_state_machine__42160__auto____0.call(this);
|
||||
case 1:
|
||||
return figwheel$client$heads_up$clear_$_state_machine__42160__auto____1.call(this,state_46365);
|
||||
}
|
||||
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
|
||||
};
|
||||
figwheel$client$heads_up$clear_$_state_machine__42160__auto__.cljs$core$IFn$_invoke$arity$0 = figwheel$client$heads_up$clear_$_state_machine__42160__auto____0;
|
||||
figwheel$client$heads_up$clear_$_state_machine__42160__auto__.cljs$core$IFn$_invoke$arity$1 = figwheel$client$heads_up$clear_$_state_machine__42160__auto____1;
|
||||
return figwheel$client$heads_up$clear_$_state_machine__42160__auto__;
|
||||
})()
|
||||
;})(switch__42159__auto__,c__42249__auto__))
|
||||
})();
|
||||
var state__42251__auto__ = (function (){var statearr_46373 = f__42250__auto__.call(null);
|
||||
(statearr_46373[(6)] = c__42249__auto__);
|
||||
|
||||
return statearr_46373;
|
||||
})();
|
||||
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__42251__auto__);
|
||||
});})(c__42249__auto__))
|
||||
);
|
||||
|
||||
return c__42249__auto__;
|
||||
});
|
||||
figwheel.client.heads_up.display_loaded_start = (function figwheel$client$heads_up$display_loaded_start(){
|
||||
return figwheel.client.heads_up.display_heads_up.call(null,new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"backgroundColor","backgroundColor",1738438491),"rgba(211,234,172,1.0)",new cljs.core.Keyword(null,"width","width",-384071477),"68px",new cljs.core.Keyword(null,"height","height",1025178622),"68px",new cljs.core.Keyword(null,"paddingLeft","paddingLeft",262720813),"0px",new cljs.core.Keyword(null,"paddingRight","paddingRight",-1642313463),"0px",new cljs.core.Keyword(null,"borderRadius","borderRadius",-1505621083),"35px"], null),"");
|
||||
});
|
||||
figwheel.client.heads_up.flash_loaded = (function figwheel$client$heads_up$flash_loaded(){
|
||||
var c__42249__auto__ = cljs.core.async.chan.call(null,(1));
|
||||
cljs.core.async.impl.dispatch.run.call(null,((function (c__42249__auto__){
|
||||
return (function (){
|
||||
var f__42250__auto__ = (function (){var switch__42159__auto__ = ((function (c__42249__auto__){
|
||||
return (function (state_46386){
|
||||
var state_val_46387 = (state_46386[(1)]);
|
||||
if((state_val_46387 === (1))){
|
||||
var inst_46376 = figwheel.client.heads_up.display_loaded_start.call(null);
|
||||
var state_46386__$1 = state_46386;
|
||||
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46386__$1,(2),inst_46376);
|
||||
} else {
|
||||
if((state_val_46387 === (2))){
|
||||
var inst_46378 = (state_46386[(2)]);
|
||||
var inst_46379 = cljs.core.async.timeout.call(null,(400));
|
||||
var state_46386__$1 = (function (){var statearr_46388 = state_46386;
|
||||
(statearr_46388[(7)] = inst_46378);
|
||||
|
||||
return statearr_46388;
|
||||
})();
|
||||
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46386__$1,(3),inst_46379);
|
||||
} else {
|
||||
if((state_val_46387 === (3))){
|
||||
var inst_46381 = (state_46386[(2)]);
|
||||
var inst_46382 = figwheel.client.heads_up.clear.call(null);
|
||||
var state_46386__$1 = (function (){var statearr_46389 = state_46386;
|
||||
(statearr_46389[(8)] = inst_46381);
|
||||
|
||||
return statearr_46389;
|
||||
})();
|
||||
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46386__$1,(4),inst_46382);
|
||||
} else {
|
||||
if((state_val_46387 === (4))){
|
||||
var inst_46384 = (state_46386[(2)]);
|
||||
var state_46386__$1 = state_46386;
|
||||
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46386__$1,inst_46384);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});})(c__42249__auto__))
|
||||
;
|
||||
return ((function (switch__42159__auto__,c__42249__auto__){
|
||||
return (function() {
|
||||
var figwheel$client$heads_up$flash_loaded_$_state_machine__42160__auto__ = null;
|
||||
var figwheel$client$heads_up$flash_loaded_$_state_machine__42160__auto____0 = (function (){
|
||||
var statearr_46390 = [null,null,null,null,null,null,null,null,null];
|
||||
(statearr_46390[(0)] = figwheel$client$heads_up$flash_loaded_$_state_machine__42160__auto__);
|
||||
|
||||
(statearr_46390[(1)] = (1));
|
||||
|
||||
return statearr_46390;
|
||||
});
|
||||
var figwheel$client$heads_up$flash_loaded_$_state_machine__42160__auto____1 = (function (state_46386){
|
||||
while(true){
|
||||
var ret_value__42161__auto__ = (function (){try{while(true){
|
||||
var result__42162__auto__ = switch__42159__auto__.call(null,state_46386);
|
||||
if(cljs.core.keyword_identical_QMARK_.call(null,result__42162__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
|
||||
continue;
|
||||
} else {
|
||||
return result__42162__auto__;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}catch (e46391){if((e46391 instanceof Object)){
|
||||
var ex__42163__auto__ = e46391;
|
||||
var statearr_46392_46394 = state_46386;
|
||||
(statearr_46392_46394[(5)] = ex__42163__auto__);
|
||||
|
||||
|
||||
cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46386);
|
||||
|
||||
return new cljs.core.Keyword(null,"recur","recur",-437573268);
|
||||
} else {
|
||||
throw e46391;
|
||||
|
||||
}
|
||||
}})();
|
||||
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__42161__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
|
||||
var G__46395 = state_46386;
|
||||
state_46386 = G__46395;
|
||||
continue;
|
||||
} else {
|
||||
return ret_value__42161__auto__;
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
figwheel$client$heads_up$flash_loaded_$_state_machine__42160__auto__ = function(state_46386){
|
||||
switch(arguments.length){
|
||||
case 0:
|
||||
return figwheel$client$heads_up$flash_loaded_$_state_machine__42160__auto____0.call(this);
|
||||
case 1:
|
||||
return figwheel$client$heads_up$flash_loaded_$_state_machine__42160__auto____1.call(this,state_46386);
|
||||
}
|
||||
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
|
||||
};
|
||||
figwheel$client$heads_up$flash_loaded_$_state_machine__42160__auto__.cljs$core$IFn$_invoke$arity$0 = figwheel$client$heads_up$flash_loaded_$_state_machine__42160__auto____0;
|
||||
figwheel$client$heads_up$flash_loaded_$_state_machine__42160__auto__.cljs$core$IFn$_invoke$arity$1 = figwheel$client$heads_up$flash_loaded_$_state_machine__42160__auto____1;
|
||||
return figwheel$client$heads_up$flash_loaded_$_state_machine__42160__auto__;
|
||||
})()
|
||||
;})(switch__42159__auto__,c__42249__auto__))
|
||||
})();
|
||||
var state__42251__auto__ = (function (){var statearr_46393 = f__42250__auto__.call(null);
|
||||
(statearr_46393[(6)] = c__42249__auto__);
|
||||
|
||||
return statearr_46393;
|
||||
})();
|
||||
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__42251__auto__);
|
||||
});})(c__42249__auto__))
|
||||
);
|
||||
|
||||
return c__42249__auto__;
|
||||
});
|
||||
figwheel.client.heads_up.cljs_logo_svg = "<?xml version='1.0' encoding='utf-8'?>\n<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>\n<svg width='49px' height='49px' style='position:absolute; top:9px; left: 10px;' version='1.1'\n xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px'\n viewBox='0 0 428 428' enable-background='new 0 0 428 428' xml:space='preserve'>\n<circle fill='#fff' cx='213' cy='214' r='213' />\n<g>\n<path fill='#96CA4B' d='M122,266.6c-12.7,0-22.3-3.7-28.9-11.1c-6.6-7.4-9.9-18-9.9-31.8c0-14.1,3.4-24.9,10.3-32.5\n s16.8-11.4,29.9-11.4c8.8,0,16.8,1.6,23.8,4.9l-5.4,14.3c-7.5-2.9-13.7-4.4-18.6-4.4c-14.5,0-21.7,9.6-21.7,28.8\n c0,9.4,1.8,16.4,5.4,21.2c3.6,4.7,8.9,7.1,15.9,7.1c7.9,0,15.4-2,22.5-5.9v15.5c-3.2,1.9-6.6,3.2-10.2,4\n C131.5,266.2,127.1,266.6,122,266.6z'/>\n<path fill='#96CA4B' d='M194.4,265.1h-17.8V147.3h17.8V265.1z'/>\n<path fill='#5F7FBF' d='M222.9,302.3c-5.3,0-9.8-0.6-13.3-1.9v-14.1c3.4,0.9,6.9,1.4,10.5,1.4c7.6,0,11.4-4.3,11.4-12.9v-93.5h17.8\n v94.7c0,8.6-2.3,15.2-6.8,19.6C237.9,300.1,231.4,302.3,222.9,302.3z M230.4,159.2c0-3.2,0.9-5.6,2.6-7.3c1.7-1.7,4.2-2.6,7.5-2.6\n c3.1,0,5.6,0.9,7.3,2.6c1.7,1.7,2.6,4.2,2.6,7.3c0,3-0.9,5.4-2.6,7.2c-1.7,1.7-4.2,2.6-7.3,2.6c-3.2,0-5.7-0.9-7.5-2.6\n C231.2,164.6,230.4,162.2,230.4,159.2z'/>\n<path fill='#5F7FBF' d='M342.5,241.3c0,8.2-3,14.4-8.9,18.8c-6,4.4-14.5,6.5-25.6,6.5c-11.2,0-20.1-1.7-26.9-5.1v-15.4\n c9.8,4.5,19,6.8,27.5,6.8c10.9,0,16.4-3.3,16.4-9.9c0-2.1-0.6-3.9-1.8-5.3c-1.2-1.4-3.2-2.9-6-4.4c-2.8-1.5-6.6-3.2-11.6-5.1\n c-9.6-3.7-16.2-7.5-19.6-11.2c-3.4-3.7-5.1-8.6-5.1-14.5c0-7.2,2.9-12.7,8.7-16.7c5.8-4,13.6-5.9,23.6-5.9c9.8,0,19.1,2,27.9,6\n l-5.8,13.4c-9-3.7-16.6-5.6-22.8-5.6c-9.4,0-14.1,2.7-14.1,8c0,2.6,1.2,4.8,3.7,6.7c2.4,1.8,7.8,4.3,16,7.5\n c6.9,2.7,11.9,5.1,15.1,7.3c3.1,2.2,5.4,4.8,7,7.7C341.7,233.7,342.5,237.2,342.5,241.3z'/>\n</g>\n<path fill='#96CA4B' stroke='#96CA4B' stroke-width='6' stroke-miterlimit='10' d='M197,392.7c-91.2-8.1-163-85-163-178.3\n S105.8,44.3,197,36.2V16.1c-102.3,8.2-183,94-183,198.4s80.7,190.2,183,198.4V392.7z'/>\n<path fill='#5F7FBF' stroke='#5F7FBF' stroke-width='6' stroke-miterlimit='10' d='M229,16.1v20.1c91.2,8.1,163,85,163,178.3\n s-71.8,170.2-163,178.3v20.1c102.3-8.2,183-94,183-198.4S331.3,24.3,229,16.1z'/>\n</svg>";
|
||||
figwheel.client.heads_up.close_bad_compile_screen = (function figwheel$client$heads_up$close_bad_compile_screen(){
|
||||
var temp__5457__auto__ = document.getElementById("figwheelFailScreen");
|
||||
if(cljs.core.truth_(temp__5457__auto__)){
|
||||
var el = temp__5457__auto__;
|
||||
return goog.dom.removeNode(el);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
figwheel.client.heads_up.bad_compile_screen = (function figwheel$client$heads_up$bad_compile_screen(){
|
||||
var body = (goog.dom.getElementsByTagNameAndClass("body")[(0)]);
|
||||
figwheel.client.heads_up.close_bad_compile_screen.call(null);
|
||||
|
||||
return goog.dom.append(body,goog.dom.createDom("div",({"id": "figwheelFailScreen", "style": ["background-color: rgba(24, 26, 38, 0.95);","position: absolute;","z-index: 9000;","width: 100vw;","height: 100vh;","top: 0px; left: 0px;","font-family: monospace"].join('')}),goog.dom.createDom("div",({"class": "message", "style": ["color: #FFF5DB;","width: 100vw;","margin: auto;","margin-top: 10px;","text-align: center; ","padding: 2px 0px;","font-size: 13px;","position: relative"].join('')}),goog.dom.createDom("a",({"onclick": ((function (body){
|
||||
return (function (e){
|
||||
e.preventDefault();
|
||||
|
||||
return figwheel.client.heads_up.close_bad_compile_screen.call(null);
|
||||
});})(body))
|
||||
, "href": "javascript:", "style": "position: absolute; right: 10px; top: 10px; color: #666"}),"X"),goog.dom.createDom("h2",({"style": "color: #FFF5DB"}),"Figwheel Says: Your code didn't compile."),goog.dom.createDom("div",({"style": "font-size: 12px"}),goog.dom.createDom("p",({"style": "color: #D07D7D;"}),"Keep trying. This page will auto-refresh when your code compiles successfully.")))));
|
||||
});
|
||||
|
||||
//# sourceMappingURL=heads_up.js.map?rel=1517021948676
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"\/home\/didier\/clojupyter\/website\/target\/cljsbuild\/public\/js\/out\/figwheel\/client\/heads_up.js","sources":["heads_up.cljs?rel=1517021948680"],"lineCount":891,"mappings":";AAAA;;;;;;;;;;;AAcA,AAAA;AAAA,AAGA,AAAA,gCAAA,wCAAAA,xEAAMM;AAAN,AAAA,IAAAL,sBAAA;AAAA,AAAA,IAAAC,2BAAA,AAAA;AAAA,AAAA,IAAAC,yBAAA;;AAAA,AAAA,GAAA,CAAAA,yBAAAD;AAAA,AAAA,AAAAD,yBAAA,CAAA,UAAAE;;AAAA,eAAA,CAAAA,yBAAA;;;;AAAA;;;;AAAA,IAAAC,wBAAA,EAAA,CAAA,MAAA,AAAAH,6BAAA,AAAA,KAAAI,qBAAA,AAAAJ,0BAAA,KAAA,IAAA,OAAA;AAAA,AAAA,OAAAK,mEAAA,CAAA,UAAA,MAAA,CAAA,UAAA,MAAAF;;;AAAA,AAAA,AAAA,AAAAE,qEAAA,WAAYM,EAAEC,MAAQC;AAAtB,AACK,IAAMC,IAAE,AAAgBC,uBAAY,AAACC,yBAAKL;AAA1C,AACE,IAAAM,mBAAA,AAAAC,wBAAU,AAACY,yBAAKlB;IAAhBO,qBAAA;IAAAC,qBAAA;IAAAC,iBAAA;;AAAA,AAAA,GAAA,AAAA,CAAAA,iBAAAD;AAAA,cAAA,AAAAE,yBAAAH,mBAAAE,tDAAQQ;AAAR,AAAA,AAA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eAAA,OAAAT;;AAAA,CAAALine truncated
|
||||
@@ -0,0 +1,96 @@
|
||||
(ns figwheel.client.socket
|
||||
(:require
|
||||
[goog.object :as gobj]
|
||||
[figwheel.client.utils :as utils]
|
||||
[cljs.reader :refer [read-string]]))
|
||||
|
||||
(defn get-websocket-imp []
|
||||
(or
|
||||
(gobj/get goog.global "FIGWHEEL_WEBSOCKET_CLASS")
|
||||
(gobj/get goog.global "WebSocket")
|
||||
(cond
|
||||
;; TODO remove
|
||||
(utils/html-or-react-native-env?) (gobj/get js/window "WebSocket")
|
||||
(utils/node-env?) (try (js/require "ws")
|
||||
(catch js/Error e
|
||||
nil))
|
||||
;; TODO remove
|
||||
(utils/worker-env?) (gobj/get js/self "WebSocket")
|
||||
:else nil)))
|
||||
|
||||
|
||||
;; messages have the following formats
|
||||
|
||||
;; files-changed message
|
||||
;; { :msg-name :files-changed
|
||||
;; :files [{:file "/js/compiled/out/example/core.js",
|
||||
;; :type :javascript,
|
||||
;; :msg-name :file-changed,
|
||||
;; :namespace "example.core" }] }
|
||||
|
||||
;; css-files-changed message
|
||||
;; there should really only be one file in here at a time
|
||||
;; { :msg-name :css-files-changed
|
||||
;; :files [{:file "/css/example.css",
|
||||
;; :type :css }] }
|
||||
|
||||
;; compile-failed message
|
||||
;; { :msg-name :compile-failed
|
||||
;; :exception-data {:cause { ... lots of exception info ... } }}
|
||||
;; the exception data is nested raw info obtained for the compile time
|
||||
;; exception
|
||||
|
||||
(defonce message-history-atom (atom (list)))
|
||||
|
||||
(defonce socket-atom (atom false))
|
||||
|
||||
(defn send!
|
||||
"Send a end message to the server."
|
||||
[msg]
|
||||
(when @socket-atom
|
||||
(.send @socket-atom (pr-str msg))))
|
||||
|
||||
(defn close! []
|
||||
(set! (.-onclose @socket-atom) identity)
|
||||
(.close @socket-atom))
|
||||
|
||||
(defn handle-incoming-message [msg]
|
||||
(utils/debug-prn msg)
|
||||
(and (map? msg)
|
||||
(:msg-name msg)
|
||||
;; don't forward pings
|
||||
(not= (:msg-name msg) :ping)
|
||||
(swap! message-history-atom
|
||||
conj msg)))
|
||||
|
||||
(defn open [{:keys [retry-count retried-count websocket-url build-id] :as opts}]
|
||||
(if-let [WebSocket (get-websocket-imp)]
|
||||
(do
|
||||
(utils/log :debug "Figwheel: trying to open cljs reload socket")
|
||||
(let [url (str websocket-url (if build-id (str "/" build-id) ""))
|
||||
socket (WebSocket. url)]
|
||||
(set! (.-onmessage socket) (fn [msg-str]
|
||||
(when-let [msg
|
||||
(read-string (.-data msg-str))]
|
||||
(#'handle-incoming-message msg))))
|
||||
(set! (.-onopen socket) (fn [x]
|
||||
(reset! socket-atom socket)
|
||||
(when (utils/html-env?)
|
||||
(.addEventListener js/window "beforeunload" close!))
|
||||
(utils/log :debug "Figwheel: socket connection established")))
|
||||
(set! (.-onclose socket) (fn [x]
|
||||
(let [retried-count (or retried-count 0)]
|
||||
(utils/debug-prn "Figwheel: socket closed or failed to open")
|
||||
(when (> retry-count retried-count)
|
||||
(js/setTimeout
|
||||
(fn []
|
||||
(open
|
||||
(assoc opts :retried-count (inc retried-count))))
|
||||
;; linear back off
|
||||
(min 10000 (+ 2000 (* 500 retried-count))))))))
|
||||
(set! (.-onerror socket) (fn [x] (utils/debug-prn "Figwheel: socket error ")))
|
||||
socket))
|
||||
(utils/log :debug
|
||||
(if (utils/node-env?)
|
||||
"Figwheel: Can't start Figwheel!! Please make sure ws is installed\n do -> 'npm install ws'"
|
||||
"Figwheel: Can't start Figwheel!! This browser doesn't support WebSockets"))))
|
||||
@@ -0,0 +1 @@
|
||||
{:rename-macros {}, :renames {}, :externs {window {addEventListener {}}, Error {}, require {}, self {}, setTimeout {}}, :use-macros {}, :excludes #{}, :name figwheel.client.socket, :imports nil, :requires {gobj goog.object, goog.object goog.object, utils figwheel.client.utils, figwheel.client.utils figwheel.client.utils, cljs.reader cljs.reader}, :cljs.spec/speced-vars [], :uses {read-string cljs.reader}, :defs {get-websocket-imp {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/socket.cljs", :line 7, :column 7, :end-line 7, :end-column 24, :arglists (quote ([]))}, :name figwheel.client.socket/get-websocket-imp, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/socket.cljs", :end-column 24, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 7, :end-line 7, :max-fixed-arity 0, :fn-var true, :arglists (quote ([]))}, message-history-atom {:name figwheel.client.socket/message-history-atom, :file "target/cljsbuild/public/js/out/figwheel/client/socket.cljs", :line 43, :column 1, :end-line 43, :end-column 30, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/socket.cljs", :line 43, :column 10, :end-line 43, :end-column 30}, :tag any}, socket-atom {:name figwheel.client.socket/socket-atom, :file "target/cljsbuild/public/js/out/figwheel/client/socket.cljs", :line 45, :column 1, :end-line 45, :end-column 21, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/socket.cljs", :line 45, :column 10, :end-line 45, :end-column 21}, :tag any}, send! {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/socket.cljs", :line 47, :column 7, :end-line 47, :end-column 12, :arglists (quote ([msg])), :doc "Send a end message to the server."}, :name figwheel.client.socket/send!, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/socket.cljs", :end-column 12, :method-params ([msg]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 47, :end-line 47, :max-fixed-arity 1, :fn-var true, :arglists (quote ([msg])), :doc "Send a end message to the server."}, close! {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/socket.cljs", :line 53, :column 7, :end-line 53, :end-column 13, :arglists (quote ([]))}, :name figwheel.client.socket/close!, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/socket.cljs", :end-column 13, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 53, :end-line 53, :max-fixed-arity 0, :fn-var true, :arglists (quote ([]))}, handle-incoming-message {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/socket.cljs", :line 57, :column 7, :end-line 57, :end-column 30, :arglists (quote ([msg]))}, :name figwheel.client.socket/handle-incoming-message, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/socket.cljs", :end-column 30, :method-params ([msg]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 57, :end-line 57, :max-fixed-arity 1, :fn-var true, :arglists (quote ([msg]))}, open {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/socket.cljs", :line 66, :column 7, :end-line 66, :end-column 11, :arglists (quote ([{:keys [retry-count retried-count websocket-url build-id], :as opts}]))}, :name figwheel.client.socket/open, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/socket.cljs", :end-column 11, :method-params ([p__46207]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 66, :end-line 66, :max-fixed-arity 1, :fn-var true, :arglists (quote ([{:keys [retry-count retried-count websocket-url build-id], :as opts}]))}}, :cljs.spec/registry-ref [], :require-macros {cljs.reader cljs.reader}, :cljs.analyzer/constants {:seen #{:ping :retried-count :else :ns handle-incoming-message :name figwheel.client.socket/handle-incoming-message :file :end-column :debug :column :build-id :line msg :websocket-url :end-line :msg-name :arglists figwheel.client.socket :doc :retry-count :test}, :order [:else :msg-name :ping :retry-count :retried-count :websocket-url :build-id :debug figwheel.client.socket/handle-incoming-message :ns :name :file :end-column :column :line :end-line :arglists :doc :test figwheel.client.socket handle-incoming-message msg]}, :doc nil}
|
||||
@@ -0,0 +1,161 @@
|
||||
// Compiled by ClojureScript 1.9.946 {}
|
||||
goog.provide('figwheel.client.socket');
|
||||
goog.require('cljs.core');
|
||||
goog.require('goog.object');
|
||||
goog.require('figwheel.client.utils');
|
||||
goog.require('cljs.reader');
|
||||
figwheel.client.socket.get_websocket_imp = (function figwheel$client$socket$get_websocket_imp(){
|
||||
var or__35498__auto__ = goog.object.get(goog.global,"FIGWHEEL_WEBSOCKET_CLASS");
|
||||
if(cljs.core.truth_(or__35498__auto__)){
|
||||
return or__35498__auto__;
|
||||
} else {
|
||||
var or__35498__auto____$1 = goog.object.get(goog.global,"WebSocket");
|
||||
if(cljs.core.truth_(or__35498__auto____$1)){
|
||||
return or__35498__auto____$1;
|
||||
} else {
|
||||
if(cljs.core.truth_(figwheel.client.utils.html_or_react_native_env_QMARK_.call(null))){
|
||||
return goog.object.get(window,"WebSocket");
|
||||
} else {
|
||||
if(cljs.core.truth_(figwheel.client.utils.node_env_QMARK_.call(null))){
|
||||
try{return require("ws");
|
||||
}catch (e46206){if((e46206 instanceof Error)){
|
||||
var e = e46206;
|
||||
return null;
|
||||
} else {
|
||||
throw e46206;
|
||||
|
||||
}
|
||||
}} else {
|
||||
if(cljs.core.truth_(figwheel.client.utils.worker_env_QMARK_.call(null))){
|
||||
return goog.object.get(self,"WebSocket");
|
||||
} else {
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if(typeof figwheel.client.socket.message_history_atom !== 'undefined'){
|
||||
} else {
|
||||
figwheel.client.socket.message_history_atom = cljs.core.atom.call(null,cljs.core.List.EMPTY);
|
||||
}
|
||||
if(typeof figwheel.client.socket.socket_atom !== 'undefined'){
|
||||
} else {
|
||||
figwheel.client.socket.socket_atom = cljs.core.atom.call(null,false);
|
||||
}
|
||||
/**
|
||||
* Send a end message to the server.
|
||||
*/
|
||||
figwheel.client.socket.send_BANG_ = (function figwheel$client$socket$send_BANG_(msg){
|
||||
if(cljs.core.truth_(cljs.core.deref.call(null,figwheel.client.socket.socket_atom))){
|
||||
return cljs.core.deref.call(null,figwheel.client.socket.socket_atom).send(cljs.core.pr_str.call(null,msg));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
figwheel.client.socket.close_BANG_ = (function figwheel$client$socket$close_BANG_(){
|
||||
cljs.core.deref.call(null,figwheel.client.socket.socket_atom).onclose = cljs.core.identity;
|
||||
|
||||
return cljs.core.deref.call(null,figwheel.client.socket.socket_atom).close();
|
||||
});
|
||||
figwheel.client.socket.handle_incoming_message = (function figwheel$client$socket$handle_incoming_message(msg){
|
||||
figwheel.client.utils.debug_prn.call(null,msg);
|
||||
|
||||
var and__35486__auto__ = cljs.core.map_QMARK_.call(null,msg);
|
||||
if(and__35486__auto__){
|
||||
var and__35486__auto____$1 = new cljs.core.Keyword(null,"msg-name","msg-name",-353709863).cljs$core$IFn$_invoke$arity$1(msg);
|
||||
if(cljs.core.truth_(and__35486__auto____$1)){
|
||||
var and__35486__auto____$2 = cljs.core.not_EQ_.call(null,new cljs.core.Keyword(null,"msg-name","msg-name",-353709863).cljs$core$IFn$_invoke$arity$1(msg),new cljs.core.Keyword(null,"ping","ping",-1670114784));
|
||||
if(and__35486__auto____$2){
|
||||
return cljs.core.swap_BANG_.call(null,figwheel.client.socket.message_history_atom,cljs.core.conj,msg);
|
||||
} else {
|
||||
return and__35486__auto____$2;
|
||||
}
|
||||
} else {
|
||||
return and__35486__auto____$1;
|
||||
}
|
||||
} else {
|
||||
return and__35486__auto__;
|
||||
}
|
||||
});
|
||||
figwheel.client.socket.open = (function figwheel$client$socket$open(p__46207){
|
||||
var map__46208 = p__46207;
|
||||
var map__46208__$1 = ((((!((map__46208 == null)))?((((map__46208.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46208.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46208):map__46208);
|
||||
var opts = map__46208__$1;
|
||||
var retry_count = cljs.core.get.call(null,map__46208__$1,new cljs.core.Keyword(null,"retry-count","retry-count",1936122875));
|
||||
var retried_count = cljs.core.get.call(null,map__46208__$1,new cljs.core.Keyword(null,"retried-count","retried-count",-2127867357));
|
||||
var websocket_url = cljs.core.get.call(null,map__46208__$1,new cljs.core.Keyword(null,"websocket-url","websocket-url",-490444938));
|
||||
var build_id = cljs.core.get.call(null,map__46208__$1,new cljs.core.Keyword(null,"build-id","build-id",1642831089));
|
||||
var temp__5455__auto__ = figwheel.client.socket.get_websocket_imp.call(null);
|
||||
if(cljs.core.truth_(temp__5455__auto__)){
|
||||
var WebSocket = temp__5455__auto__;
|
||||
figwheel.client.utils.log.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Figwheel: trying to open cljs reload socket");
|
||||
|
||||
var url = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(websocket_url),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(build_id)?["/",cljs.core.str.cljs$core$IFn$_invoke$arity$1(build_id)].join(''):""))].join('');
|
||||
var socket = (new WebSocket(url));
|
||||
socket.onmessage = ((function (url,socket,WebSocket,temp__5455__auto__,map__46208,map__46208__$1,opts,retry_count,retried_count,websocket_url,build_id){
|
||||
return (function (msg_str){
|
||||
var temp__5457__auto__ = cljs.reader.read_string.call(null,msg_str.data);
|
||||
if(cljs.core.truth_(temp__5457__auto__)){
|
||||
var msg = temp__5457__auto__;
|
||||
return new cljs.core.Var(function(){return figwheel.client.socket.handle_incoming_message;},new cljs.core.Symbol("figwheel.client.socket","handle-incoming-message","figwheel.client.socket/handle-incoming-message",-2084786999,null),cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"ns","ns",441598760),new cljs.core.Keyword(null,"name","name",1843675177),new cljs.core.Keyword(null,"file","file",-1269645878),new cljs.core.Keyword(null,"end-column","end-column",1425389514),new cljs.core.Keyword(null,"column","column",2078222095),new cljs.core.Keyword(null,"line","line",212345235),new cljs.core.Keyword(null,"end-line","end-line",1837326455),new cljs.core.Keyword(null,"arglists","arglists",1661989754),new cljs.core.Keyword(null,"doc","doc",1913296891),new cljs.core.Keyword(null,"test","test",577538877)],[new cljs.core.Symbol(null,"figwheel.client.socket","figwheel.client.socket",-1038129509,null),new cljs.core.Symbol(null,"handle-incoming-message","handle-incoming-message",-1068736536,null),"target/cljsbuild/public/js/out/figwheel/client/socket.cljs",30,1,57,57,cljs.core.list(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"msg","msg",254428083,null)], null)),null,(cljs.core.truth_(figwheel.client.socket.handle_incoming_message)?figwheel.client.socket.handle_incoming_message.cljs$lang$test:null)])).call(null,msg);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});})(url,socket,WebSocket,temp__5455__auto__,map__46208,map__46208__$1,opts,retry_count,retried_count,websocket_url,build_id))
|
||||
;
|
||||
|
||||
socket.onopen = ((function (url,socket,WebSocket,temp__5455__auto__,map__46208,map__46208__$1,opts,retry_count,retried_count,websocket_url,build_id){
|
||||
return (function (x){
|
||||
cljs.core.reset_BANG_.call(null,figwheel.client.socket.socket_atom,socket);
|
||||
|
||||
if(cljs.core.truth_(figwheel.client.utils.html_env_QMARK_.call(null))){
|
||||
window.addEventListener("beforeunload",figwheel.client.socket.close_BANG_);
|
||||
} else {
|
||||
}
|
||||
|
||||
return figwheel.client.utils.log.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Figwheel: socket connection established");
|
||||
});})(url,socket,WebSocket,temp__5455__auto__,map__46208,map__46208__$1,opts,retry_count,retried_count,websocket_url,build_id))
|
||||
;
|
||||
|
||||
socket.onclose = ((function (url,socket,WebSocket,temp__5455__auto__,map__46208,map__46208__$1,opts,retry_count,retried_count,websocket_url,build_id){
|
||||
return (function (x){
|
||||
var retried_count__$1 = (function (){var or__35498__auto__ = retried_count;
|
||||
if(cljs.core.truth_(or__35498__auto__)){
|
||||
return or__35498__auto__;
|
||||
} else {
|
||||
return (0);
|
||||
}
|
||||
})();
|
||||
figwheel.client.utils.debug_prn.call(null,"Figwheel: socket closed or failed to open");
|
||||
|
||||
if((retry_count > retried_count__$1)){
|
||||
return setTimeout(((function (retried_count__$1,url,socket,WebSocket,temp__5455__auto__,map__46208,map__46208__$1,opts,retry_count,retried_count,websocket_url,build_id){
|
||||
return (function (){
|
||||
return figwheel.client.socket.open.call(null,cljs.core.assoc.call(null,opts,new cljs.core.Keyword(null,"retried-count","retried-count",-2127867357),(retried_count__$1 + (1))));
|
||||
});})(retried_count__$1,url,socket,WebSocket,temp__5455__auto__,map__46208,map__46208__$1,opts,retry_count,retried_count,websocket_url,build_id))
|
||||
,(function (){var x__35857__auto__ = (10000);
|
||||
var y__35858__auto__ = ((2000) + ((500) * retried_count__$1));
|
||||
return ((x__35857__auto__ < y__35858__auto__) ? x__35857__auto__ : y__35858__auto__);
|
||||
})());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});})(url,socket,WebSocket,temp__5455__auto__,map__46208,map__46208__$1,opts,retry_count,retried_count,websocket_url,build_id))
|
||||
;
|
||||
|
||||
socket.onerror = ((function (url,socket,WebSocket,temp__5455__auto__,map__46208,map__46208__$1,opts,retry_count,retried_count,websocket_url,build_id){
|
||||
return (function (x){
|
||||
return figwheel.client.utils.debug_prn.call(null,"Figwheel: socket error ");
|
||||
});})(url,socket,WebSocket,temp__5455__auto__,map__46208,map__46208__$1,opts,retry_count,retried_count,websocket_url,build_id))
|
||||
;
|
||||
|
||||
return socket;
|
||||
} else {
|
||||
return figwheel.client.utils.log.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),(cljs.core.truth_(figwheel.client.utils.node_env_QMARK_.call(null))?"Figwheel: Can't start Figwheel!! Please make sure ws is installed\n do -> 'npm install ws'":"Figwheel: Can't start Figwheel!! This browser doesn't support WebSockets"));
|
||||
}
|
||||
});
|
||||
|
||||
//# sourceMappingURL=socket.js.map?rel=1517021948538
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"\/home\/didier\/clojupyter\/website\/target\/cljsbuild\/public\/js\/out\/figwheel\/client\/socket.js","sources":["socket.cljs?rel=1517021948538"],"lineCount":161,"mappings":";AAAA;;;;;AAMA,2CAAA,3CAAMA;AAAN,AACE,IAAAC,oBACC,4BAAA,5BAACC,g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AAMb,6EAAoB,qBAAA,pBAAKH;;CAEnC,iBAAAiB,mBAAA;IAAAC,mBAAW,CAAA,SAAQ,CAAA,QAAOlB;AAA1B,AAAA,SAAAiB,mBAAAC,oBAAAD,mBAAAC;;;AANH;;;;;AAO7B,AAAM,AAAWV,iBAAQ;kBAAKI;AAAL,AAAQ,iDAAA,1CAAC1B;;;;AAClCsB;;AACJ,2CAAA,pCAACF,4FACU,oEAAA,6FAAA,\/IAAI,AAACrC","names":["figwheel.client.socket\/get-websocket-imp","or__35498__auto__","goog.object\/get","goog\/global","figwheel.client.utils\/html-or-react-native-env?","js\/window","figwheel.client.utils\/node-env?","e46206","js\/require","js\/Error","e","figwheel.client.utils\/worker-env?","js\/self","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","figwheel.client.socket\/handle-incoming-message","figwheel.client.utils\/debug-prn","and__35486__auto__","cljs.core\/map?","cljs.core\/not=","cljs.core\/swap!","cljs.core\/conj","p__46207","map__46208","cljs.core\/PROTOCOL_SENTINEL","cljs.core\/apply","cljs.core\/hash-map","cljs.core\/get","figwheel.client.socket\/open","retry-count","retried-count","websocket-url","build-id","opts","temp__5455__auto__","WebSocket","figwheel.client.utils\/log","url","socket","msg-str","temp__5457__auto__","cljs.reader\/read-string","x","cljs.core\/reset!","figwheel.client.utils\/html-env?","js\/setTimeout","cljs.core\/assoc","x__35857__auto__","y__35858__auto__","cljs.core\/List"]}
|
||||
@@ -0,0 +1,147 @@
|
||||
(ns ^:figwheel-no-load figwheel.client.utils
|
||||
(:require [clojure.string :as string]
|
||||
[goog.string :as gstring]
|
||||
[goog.object :as gobj]
|
||||
[cljs.reader :refer [read-string]]
|
||||
[cljs.pprint :refer [pprint]]
|
||||
[goog.userAgent.product :as product])
|
||||
(:import [goog]
|
||||
[goog.async Deferred]
|
||||
[goog.string StringBuffer]))
|
||||
|
||||
;; don't auto reload this file it will mess up the debug printing
|
||||
|
||||
(def ^:dynamic *print-debug* false)
|
||||
|
||||
(defn html-env? [] (not (nil? goog/global.document)))
|
||||
|
||||
(defn react-native-env? [] (and (exists? goog/global.navigator)
|
||||
(= goog/global.navigator.product "ReactNative")))
|
||||
|
||||
(defn node-env? [] (not (nil? goog/nodeGlobalRequire)))
|
||||
|
||||
(defn html-or-react-native-env? []
|
||||
(or (html-env?) (react-native-env?)))
|
||||
|
||||
(defn worker-env? [] (and
|
||||
(nil? goog/global.document)
|
||||
(exists? js/self)
|
||||
(exists? (.-importScripts js/self))))
|
||||
|
||||
(defn host-env? [] (cond (node-env?) :node
|
||||
(html-env?) :html
|
||||
(react-native-env?) :react-native
|
||||
(worker-env?) :worker))
|
||||
|
||||
(defn base-url-path [] (string/replace goog/basePath #"(.*)goog/" "$1"))
|
||||
|
||||
;; Custom Event must exist before calling this
|
||||
(defn create-custom-event [event-name data]
|
||||
(if-not product/IE
|
||||
(js/CustomEvent. event-name (js-obj "detail" data))
|
||||
;; in windows world
|
||||
;; this will probably not work at some point in
|
||||
;; newer versions of IE
|
||||
(let [event (js/document.createEvent "CustomEvent")]
|
||||
(.. event (initCustomEvent event-name false false data))
|
||||
event)))
|
||||
|
||||
;; actually we should probably lift the event system here off the DOM
|
||||
;; so that we work well in Node and other environments
|
||||
(defn dispatch-custom-event [event-name data]
|
||||
(when (and (html-env?) (gobj/get js/window "CustomEvent") (js* "typeof document !== 'undefined'"))
|
||||
(.dispatchEvent (.-body js/document)
|
||||
(create-custom-event event-name data))))
|
||||
|
||||
(defn debug-prn [o]
|
||||
(when *print-debug*
|
||||
(let [o (if (or (map? o)
|
||||
(seq? o))
|
||||
(prn-str o)
|
||||
o)]
|
||||
(.log js/console o))))
|
||||
|
||||
(defn log
|
||||
([x] (log :info x))
|
||||
([level arg]
|
||||
(let [f (condp = (if (html-or-react-native-env?) level :info)
|
||||
:warn #(.warn js/console %)
|
||||
:debug #(.debug js/console %)
|
||||
:error #(.error js/console %)
|
||||
#(.log js/console %))]
|
||||
(f arg))))
|
||||
|
||||
(defn eval-helper [code {:keys [eval-fn] :as opts}]
|
||||
(if eval-fn
|
||||
(eval-fn code opts)
|
||||
(js* "eval(~{code})")))
|
||||
|
||||
(defn pprint-to-string [x]
|
||||
(let [sb (StringBuffer.)
|
||||
sbw (StringBufferWriter. sb)]
|
||||
(pprint x sbw)
|
||||
(gstring/trimRight (str sb))))
|
||||
|
||||
;; Deferred helpers that focus on guaranteed successful side effects
|
||||
;; not very monadic but it meets our needs
|
||||
|
||||
(defn liftContD
|
||||
"chains an async action on to a deferred
|
||||
Must provide a goog.async.Deferred and action function that
|
||||
takes an initial value and a continuation fn to call with the result"
|
||||
[deferred f]
|
||||
(.then deferred (fn [val]
|
||||
(let [new-def (Deferred.)]
|
||||
(f val #(.callback new-def %))
|
||||
new-def))))
|
||||
|
||||
(defn mapConcatD
|
||||
"maps an async action across a collection and chains the results
|
||||
onto a deferred"
|
||||
[deferred f coll]
|
||||
(let [results (atom [])]
|
||||
(.then
|
||||
(reduce (fn [defr v]
|
||||
(liftContD defr
|
||||
(fn [_ fin]
|
||||
(f v (fn [v]
|
||||
(swap! results conj v)
|
||||
(fin v))))))
|
||||
deferred coll)
|
||||
(fn [_] (.succeed Deferred @results)))))
|
||||
|
||||
|
||||
;; persistent storage of configuration keys
|
||||
|
||||
(defonce local-persistent-config
|
||||
(let [a (atom {})]
|
||||
(when (exists? js/localStorage)
|
||||
(add-watch a :sync-local-storage
|
||||
(fn [_ _ _ n]
|
||||
(mapv (fn [[ky v]]
|
||||
(.setItem js/localStorage (name ky) (pr-str v)))
|
||||
n))))
|
||||
a))
|
||||
|
||||
(defn persistent-config-set!
|
||||
"Set a local value on a key that in a browser will persist even when
|
||||
the browser gets reloaded."
|
||||
[ky v]
|
||||
(swap! local-persistent-config assoc ky v))
|
||||
|
||||
(defn persistent-config-get
|
||||
([ky not-found]
|
||||
(try
|
||||
(cond
|
||||
(contains? @local-persistent-config ky)
|
||||
(get @local-persistent-config ky)
|
||||
(and (exists? js/localStorage)
|
||||
(.getItem js/localStorage (name ky)))
|
||||
(let [v (read-string (.getItem js/localStorage (name ky)))]
|
||||
(persistent-config-set! ky v)
|
||||
v)
|
||||
:else not-found)
|
||||
(catch js/Error e
|
||||
not-found)))
|
||||
([ky]
|
||||
(persistent-config-get ky nil)))
|
||||
@@ -0,0 +1 @@
|
||||
{:rename-macros {}, :renames {}, :externs {self {importScripts {}}, CustomEvent {}, document {createEvent {}, body {dispatchEvent {}}}, Object {initCustomEvent {}}, window {}, console {log {}, warn {}, debug {}, error {}}, Error {}, localStorage {setItem {}, getItem {}}}, :use-macros {}, :excludes #{}, :name figwheel.client.utils, :imports {Deferred goog.async.Deferred, StringBuffer goog.string.StringBuffer}, :requires {gstring goog.string, goog.userAgent.product goog.userAgent.product, Deferred goog.async.Deferred, goog.string goog.string, gobj goog.object, goog.object goog.object, cljs.pprint cljs.pprint, StringBuffer goog.string.StringBuffer, string clojure.string, product goog.userAgent.product, clojure.string clojure.string, cljs.reader cljs.reader}, :cljs.spec/speced-vars [], :uses {pprint cljs.pprint, read-string cljs.reader}, :defs {mapConcatD {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/utils.cljs", :line 98, :column 7, :end-line 98, :end-column 17, :arglists (quote ([deferred f coll])), :doc "maps an async action across a collection and chains the results\n onto a deferred"}, :name figwheel.client.utils/mapConcatD, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/utils.cljs", :end-column 17, :method-params ([deferred f coll]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 98, :end-line 98, :max-fixed-arity 3, :fn-var true, :arglists (quote ([deferred f coll])), :doc "maps an async action across a collection and chains the results\n onto a deferred"}, base-url-path {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/utils.cljs", :line 36, :column 7, :end-line 36, :end-column 20, :arglists (quote ([]))}, :name figwheel.client.utils/base-url-path, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/utils.cljs", :end-column 20, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 36, :end-line 36, :max-fixed-arity 0, :fn-var true, :arglists (quote ([]))}, log {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/utils.cljs", :line 64, :column 7, :end-line 64, :end-column 10, :arglists (quote ([x] [level arg])), :top-fn {:variadic false, :max-fixed-arity 2, :method-params ([x] [level arg]), :arglists ([x] [level arg]), :arglists-meta (nil nil)}}, :name figwheel.client.utils/log, :variadic false, :file "target/cljsbuild/public/js/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 64, :end-line 64, :max-fixed-arity 2, :fn-var true, :arglists ([x] [level arg])}, create-custom-event {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/utils.cljs", :line 39, :column 7, :end-line 39, :end-column 26, :arglists (quote ([event-name data]))}, :name figwheel.client.utils/create-custom-event, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/utils.cljs", :end-column 26, :method-params ([event-name data]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 39, :end-line 39, :max-fixed-arity 2, :fn-var true, :arglists (quote ([event-name data]))}, worker-env? {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/utils.cljs", :line 26, :column 7, :end-line 26, :end-column 18, :arglists (quote ([]))}, :name figwheel.client.utils/worker-env?, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/utils.cljs", :end-column 18, :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 ([]))}, host-env? {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/utils.cljs", :line 31, :column 7, :end-line 31, :end-column 16, :arglists (quote ([]))}, :name figwheel.client.utils/host-env?, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/client/utils.cljs", :end-column 16, :method-params ([]), :protocol-impl nil, :arglists-meta (nil nil), :column 1, :line 31, :end-line 31, :max-fixed-arity 0, :fn-var true, :arglists (quote ([]))}, persistent-config-set! {:protocol-inline nil, :meta {:file "/home/didier/clojupyter/website/target/cljsbuild/public/js/out/figwheel/client/utils.cljs", :line 126, :column 7, :end-line 126, :end-column 29, :arglists (quote ([ky v])), :doc "Set a local value on a key that in a browser will persist even when \nthe browser gets reloaded."}, :name figwheel.client.utils/persistent-config-set!, :variadic false, :file "target/cljsbuild/public/js/out/figwheel/clieLine truncated
|
||||
@@ -0,0 +1,295 @@
|
||||
// Compiled by ClojureScript 1.9.946 {}
|
||||
goog.provide('figwheel.client.utils');
|
||||
goog.require('cljs.core');
|
||||
goog.require('clojure.string');
|
||||
goog.require('goog.string');
|
||||
goog.require('goog.object');
|
||||
goog.require('cljs.reader');
|
||||
goog.require('cljs.pprint');
|
||||
goog.require('goog.userAgent.product');
|
||||
goog.require('goog.async.Deferred');
|
||||
goog.require('goog.string.StringBuffer');
|
||||
figwheel.client.utils._STAR_print_debug_STAR_ = false;
|
||||
figwheel.client.utils.html_env_QMARK_ = (function figwheel$client$utils$html_env_QMARK_(){
|
||||
return !((goog.global.document == null));
|
||||
});
|
||||
figwheel.client.utils.react_native_env_QMARK_ = (function figwheel$client$utils$react_native_env_QMARK_(){
|
||||
return (typeof goog.global.navigator !== 'undefined') && (cljs.core._EQ_.call(null,goog.global.navigator.product,"ReactNative"));
|
||||
});
|
||||
figwheel.client.utils.node_env_QMARK_ = (function figwheel$client$utils$node_env_QMARK_(){
|
||||
return !((goog.nodeGlobalRequire == null));
|
||||
});
|
||||
figwheel.client.utils.html_or_react_native_env_QMARK_ = (function figwheel$client$utils$html_or_react_native_env_QMARK_(){
|
||||
var or__35498__auto__ = figwheel.client.utils.html_env_QMARK_.call(null);
|
||||
if(cljs.core.truth_(or__35498__auto__)){
|
||||
return or__35498__auto__;
|
||||
} else {
|
||||
return figwheel.client.utils.react_native_env_QMARK_.call(null);
|
||||
}
|
||||
});
|
||||
figwheel.client.utils.worker_env_QMARK_ = (function figwheel$client$utils$worker_env_QMARK_(){
|
||||
return ((goog.global.document == null)) && (typeof self !== 'undefined') && (typeof self.importScripts !== 'undefined');
|
||||
});
|
||||
figwheel.client.utils.host_env_QMARK_ = (function figwheel$client$utils$host_env_QMARK_(){
|
||||
if(cljs.core.truth_(figwheel.client.utils.node_env_QMARK_.call(null))){
|
||||
return new cljs.core.Keyword(null,"node","node",581201198);
|
||||
} else {
|
||||
if(cljs.core.truth_(figwheel.client.utils.html_env_QMARK_.call(null))){
|
||||
return new cljs.core.Keyword(null,"html","html",-998796897);
|
||||
} else {
|
||||
if(cljs.core.truth_(figwheel.client.utils.react_native_env_QMARK_.call(null))){
|
||||
return new cljs.core.Keyword(null,"react-native","react-native",-1543085138);
|
||||
} else {
|
||||
if(cljs.core.truth_(figwheel.client.utils.worker_env_QMARK_.call(null))){
|
||||
return new cljs.core.Keyword(null,"worker","worker",938239996);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
figwheel.client.utils.base_url_path = (function figwheel$client$utils$base_url_path(){
|
||||
return clojure.string.replace.call(null,goog.basePath,/(.*)goog\//,"$1");
|
||||
});
|
||||
figwheel.client.utils.create_custom_event = (function figwheel$client$utils$create_custom_event(event_name,data){
|
||||
if(cljs.core.not.call(null,goog.userAgent.product.IE)){
|
||||
return (new CustomEvent(event_name,(function (){var obj44584 = {"detail":data};
|
||||
return obj44584;
|
||||
})()));
|
||||
} else {
|
||||
var event = document.createEvent("CustomEvent");
|
||||
event.initCustomEvent(event_name,false,false,data);
|
||||
|
||||
return event;
|
||||
}
|
||||
});
|
||||
figwheel.client.utils.dispatch_custom_event = (function figwheel$client$utils$dispatch_custom_event(event_name,data){
|
||||
if(cljs.core.truth_((function (){var and__35486__auto__ = figwheel.client.utils.html_env_QMARK_.call(null);
|
||||
if(cljs.core.truth_(and__35486__auto__)){
|
||||
var and__35486__auto____$1 = goog.object.get(window,"CustomEvent");
|
||||
if(cljs.core.truth_(and__35486__auto____$1)){
|
||||
return typeof document !== 'undefined';
|
||||
} else {
|
||||
return and__35486__auto____$1;
|
||||
}
|
||||
} else {
|
||||
return and__35486__auto__;
|
||||
}
|
||||
})())){
|
||||
return document.body.dispatchEvent(figwheel.client.utils.create_custom_event.call(null,event_name,data));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
figwheel.client.utils.debug_prn = (function figwheel$client$utils$debug_prn(o){
|
||||
if(figwheel.client.utils._STAR_print_debug_STAR_){
|
||||
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);
|
||||
return console.log(o__$1);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
figwheel.client.utils.log = (function figwheel$client$utils$log(var_args){
|
||||
var G__44590 = arguments.length;
|
||||
switch (G__44590) {
|
||||
case 1:
|
||||
return figwheel.client.utils.log.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
|
||||
|
||||
break;
|
||||
case 2:
|
||||
return figwheel.client.utils.log.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
|
||||
|
||||
break;
|
||||
default:
|
||||
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
figwheel.client.utils.log.cljs$core$IFn$_invoke$arity$1 = (function (x){
|
||||
return figwheel.client.utils.log.call(null,new cljs.core.Keyword(null,"info","info",-317069002),x);
|
||||
});
|
||||
|
||||
figwheel.client.utils.log.cljs$core$IFn$_invoke$arity$2 = (function (level,arg){
|
||||
var f = (function (){var pred__44591 = cljs.core._EQ_;
|
||||
var expr__44592 = (cljs.core.truth_(figwheel.client.utils.html_or_react_native_env_QMARK_.call(null))?level:new cljs.core.Keyword(null,"info","info",-317069002));
|
||||
if(cljs.core.truth_(pred__44591.call(null,new cljs.core.Keyword(null,"warn","warn",-436710552),expr__44592))){
|
||||
return ((function (pred__44591,expr__44592){
|
||||
return (function (p1__44585_SHARP_){
|
||||
return console.warn(p1__44585_SHARP_);
|
||||
});
|
||||
;})(pred__44591,expr__44592))
|
||||
} else {
|
||||
if(cljs.core.truth_(pred__44591.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),expr__44592))){
|
||||
return ((function (pred__44591,expr__44592){
|
||||
return (function (p1__44586_SHARP_){
|
||||
return console.debug(p1__44586_SHARP_);
|
||||
});
|
||||
;})(pred__44591,expr__44592))
|
||||
} else {
|
||||
if(cljs.core.truth_(pred__44591.call(null,new cljs.core.Keyword(null,"error","error",-978969032),expr__44592))){
|
||||
return ((function (pred__44591,expr__44592){
|
||||
return (function (p1__44587_SHARP_){
|
||||
return console.error(p1__44587_SHARP_);
|
||||
});
|
||||
;})(pred__44591,expr__44592))
|
||||
} else {
|
||||
return ((function (pred__44591,expr__44592){
|
||||
return (function (p1__44588_SHARP_){
|
||||
return console.log(p1__44588_SHARP_);
|
||||
});
|
||||
;})(pred__44591,expr__44592))
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
return f.call(null,arg);
|
||||
});
|
||||
|
||||
figwheel.client.utils.log.cljs$lang$maxFixedArity = 2;
|
||||
|
||||
figwheel.client.utils.eval_helper = (function figwheel$client$utils$eval_helper(code,p__44595){
|
||||
var map__44596 = p__44595;
|
||||
var map__44596__$1 = ((((!((map__44596 == null)))?((((map__44596.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__44596.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__44596):map__44596);
|
||||
var opts = map__44596__$1;
|
||||
var eval_fn = cljs.core.get.call(null,map__44596__$1,new cljs.core.Keyword(null,"eval-fn","eval-fn",-1111644294));
|
||||
if(cljs.core.truth_(eval_fn)){
|
||||
return eval_fn.call(null,code,opts);
|
||||
} else {
|
||||
return eval(code);
|
||||
}
|
||||
});
|
||||
figwheel.client.utils.pprint_to_string = (function figwheel$client$utils$pprint_to_string(x){
|
||||
var sb = (new goog.string.StringBuffer());
|
||||
var sbw = (new cljs.core.StringBufferWriter(sb));
|
||||
cljs.pprint.pprint.call(null,x,sbw);
|
||||
|
||||
return goog.string.trimRight([cljs.core.str.cljs$core$IFn$_invoke$arity$1(sb)].join(''));
|
||||
});
|
||||
/**
|
||||
* chains an async action on to a deferred
|
||||
* Must provide a goog.async.Deferred and action function that
|
||||
* takes an initial value and a continuation fn to call with the result
|
||||
*/
|
||||
figwheel.client.utils.liftContD = (function figwheel$client$utils$liftContD(deferred,f){
|
||||
return deferred.then((function (val){
|
||||
var new_def = (new goog.async.Deferred());
|
||||
f.call(null,val,((function (new_def){
|
||||
return (function (p1__44598_SHARP_){
|
||||
return new_def.callback(p1__44598_SHARP_);
|
||||
});})(new_def))
|
||||
);
|
||||
|
||||
return new_def;
|
||||
}));
|
||||
});
|
||||
/**
|
||||
* maps an async action across a collection and chains the results
|
||||
* onto a deferred
|
||||
*/
|
||||
figwheel.client.utils.mapConcatD = (function figwheel$client$utils$mapConcatD(deferred,f,coll){
|
||||
var results = cljs.core.atom.call(null,cljs.core.PersistentVector.EMPTY);
|
||||
return cljs.core.reduce.call(null,((function (results){
|
||||
return (function (defr,v){
|
||||
return figwheel.client.utils.liftContD.call(null,defr,((function (results){
|
||||
return (function (_,fin){
|
||||
return f.call(null,v,((function (results){
|
||||
return (function (v__$1){
|
||||
cljs.core.swap_BANG_.call(null,results,cljs.core.conj,v__$1);
|
||||
|
||||
return fin.call(null,v__$1);
|
||||
});})(results))
|
||||
);
|
||||
});})(results))
|
||||
);
|
||||
});})(results))
|
||||
,deferred,coll).then(((function (results){
|
||||
return (function (_){
|
||||
return goog.async.Deferred.succeed(cljs.core.deref.call(null,results));
|
||||
});})(results))
|
||||
);
|
||||
});
|
||||
if(typeof figwheel.client.utils.local_persistent_config !== 'undefined'){
|
||||
} else {
|
||||
figwheel.client.utils.local_persistent_config = (function (){var a = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
|
||||
if(typeof localStorage !== 'undefined'){
|
||||
cljs.core.add_watch.call(null,a,new cljs.core.Keyword(null,"sync-local-storage","sync-local-storage",-473590105),((function (a){
|
||||
return (function (_,___$1,___$2,n){
|
||||
return cljs.core.mapv.call(null,((function (a){
|
||||
return (function (p__44599){
|
||||
var vec__44600 = p__44599;
|
||||
var ky = cljs.core.nth.call(null,vec__44600,(0),null);
|
||||
var v = cljs.core.nth.call(null,vec__44600,(1),null);
|
||||
return localStorage.setItem(cljs.core.name.call(null,ky),cljs.core.pr_str.call(null,v));
|
||||
});})(a))
|
||||
,n);
|
||||
});})(a))
|
||||
);
|
||||
} else {
|
||||
}
|
||||
|
||||
return a;
|
||||
})();
|
||||
}
|
||||
/**
|
||||
* Set a local value on a key that in a browser will persist even when
|
||||
* the browser gets reloaded.
|
||||
*/
|
||||
figwheel.client.utils.persistent_config_set_BANG_ = (function figwheel$client$utils$persistent_config_set_BANG_(ky,v){
|
||||
return cljs.core.swap_BANG_.call(null,figwheel.client.utils.local_persistent_config,cljs.core.assoc,ky,v);
|
||||
});
|
||||
figwheel.client.utils.persistent_config_get = (function figwheel$client$utils$persistent_config_get(var_args){
|
||||
var G__44604 = arguments.length;
|
||||
switch (G__44604) {
|
||||
case 2:
|
||||
return figwheel.client.utils.persistent_config_get.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
|
||||
|
||||
break;
|
||||
case 1:
|
||||
return figwheel.client.utils.persistent_config_get.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
|
||||
|
||||
break;
|
||||
default:
|
||||
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
figwheel.client.utils.persistent_config_get.cljs$core$IFn$_invoke$arity$2 = (function (ky,not_found){
|
||||
try{if(cljs.core.contains_QMARK_.call(null,cljs.core.deref.call(null,figwheel.client.utils.local_persistent_config),ky)){
|
||||
return cljs.core.get.call(null,cljs.core.deref.call(null,figwheel.client.utils.local_persistent_config),ky);
|
||||
} else {
|
||||
if(cljs.core.truth_((function (){var and__35486__auto__ = typeof localStorage !== 'undefined';
|
||||
if(and__35486__auto__){
|
||||
return localStorage.getItem(cljs.core.name.call(null,ky));
|
||||
} else {
|
||||
return and__35486__auto__;
|
||||
}
|
||||
})())){
|
||||
var v = cljs.reader.read_string.call(null,localStorage.getItem(cljs.core.name.call(null,ky)));
|
||||
figwheel.client.utils.persistent_config_set_BANG_.call(null,ky,v);
|
||||
|
||||
return v;
|
||||
} else {
|
||||
return not_found;
|
||||
|
||||
}
|
||||
}
|
||||
}catch (e44605){if((e44605 instanceof Error)){
|
||||
var e = e44605;
|
||||
return not_found;
|
||||
} else {
|
||||
throw e44605;
|
||||
|
||||
}
|
||||
}});
|
||||
|
||||
figwheel.client.utils.persistent_config_get.cljs$core$IFn$_invoke$arity$1 = (function (ky){
|
||||
return figwheel.client.utils.persistent_config_get.call(null,ky,null);
|
||||
});
|
||||
|
||||
figwheel.client.utils.persistent_config_get.cljs$lang$maxFixedArity = 2;
|
||||
|
||||
|
||||
//# sourceMappingURL=utils.js.map?rel=1517021947032
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"\/home\/didier\/clojupyter\/website\/target\/cljsbuild\/public\/js\/out\/figwheel\/client\/utils.js","sources":["utils.cljs?rel=1517021947033"],"lineCount":295,"mappings":";AAAA;;;;;;;;;;AAaA,gDAAA,hDAAeA;AAEf,wCAAA,xCAAM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;AAAN,AAAA,IAAAD,WAAA,AAAA;AAAA,AAAA,QAAAA;KAAA;AAAA,OAAAC,0EAAA,CAAA,UAAA,MAAA,CAAA,UAAA;;;KAAA;AAAA,OAAAA,0EAAA,CAAA,UAAA;;;;AAAA,MAAA,KAAA7D,MAAA,CAAA,8DAAA,AAAA;;;;;AAAA,AAAA,4EAAA,5EAAM6D,uFACFN,GAAGO;AADP,AAEG,IAAA,AACE,GACE,oCAAA,AAAAjB,pCAACmB,8DAAWlB,+CAAwBS;AACpC,+BAAA,AAAAV,xBAAC7B,kDAAK8B,+CAAwBS;;AAFhC,oBAGE,iBAAApE,qBAAK,OAAS6D;AAAd,AAAA,GAAA7D;AACK,OAAU6D,qBAAgB,AAACQ,yBAAKD;;AADrCpE;;;AAEA,IAAMqD,IAAE,AAACyB,kCAAY,AAAUjB,qBAAgB,AAACQ,yBAAKD;AAArD,AACE,AAACG,4DAAuBH,GAAGf;;AAC3BA;;AAPJ,AAQQsB;;;;gBATV,GAAA,CAAAC,kBAUS\/D;AAVT,QAAA+D,JAUkBG;AAVlB,AAWIJ;;AAXJ,AAAA,MAAAC;;;;;AAFH,AAAA,4EAAA,5EAAMF,uFAcFN;AAdJ,AAeG,gEAAA,zDAACM,sDAAsBN;;;AAf1B,AAAA,sEAAA,tEAAMM;;AAAN","names":["figwheel.client.utils\/*print-debug*","figwheel.client.utils\/html-env?","goog\/global.document","figwheel.client.utils\/react-native-env?","goog\/global.navigator","cljs.core\/=","goog\/global.navigator.product","figwheel.client.utils\/node-env?","goog\/nodeGlobalRequire","figwheel.client.utils\/html-or-react-native-env?","or__35498__auto__","figwheel.client.utils\/worker-env?","js\/self","figwheel.client.utils\/host-env?","figwheel.client.utils\/base-url-path","clojure.string\/replace","goog\/basePath","figwheel.client.utils\/create-custom-event","event-name","data","cljs.core\/not","goog.userAgent.product\/IE","js\/CustomEvent","obj44584","event","js\/document.createEvent","figwheel.client.utils\/dispatch-custom-event","and__35486__auto__","goog.object\/get","js\/window","js\/document","figwheel.client.utils\/debug-prn","o","cljs.core\/map?","cljs.core\/seq?","cljs.core\/prn-str","js\/console","vaLine truncated
|
||||
Reference in new issue
Block a user