Handle custom formatter objects

This commit is contained in:
chris (daiyi) 2017-09-18 16:43:16 +02:00 committed by Daniel Compton
parent ed21d59ede
commit 3a2f14cf32
3 changed files with 10 additions and 16 deletions

View File

@ -460,7 +460,3 @@
color: #8f8f8f; color: #8f8f8f;
content: "▶ "; content: "▶ ";
} }
#--re-frame-trace-- .re-frame-trace--object:after {
color: #222222;
content: "{...}";
}

View File

@ -579,9 +579,5 @@
color: @text-color-muted; color: @text-color-muted;
content: "▶ "; content: "▶ ";
} }
&:after {
color: @text-color;
content: "{...}";
}
} }
} }

View File

@ -36,10 +36,8 @@
(defn str->hiccup (defn str->hiccup
[string] [string]
(println string)
(cond (= string "span") :span (cond (= string "span") :span
(= string "style") :style (= string "style") :style
(= string "object") :span.re-frame-trace--object
:else string)) :else string))
(defn crawl (defn crawl
@ -49,14 +47,18 @@
(view data))) (view data)))
(defn jsonml->hiccup (defn jsonml->hiccup
[data] [jsonml]
(cond (cond
(vector? data) (mapv jsonml->hiccup data) (array? jsonml) (if (= "object" (get jsonml 0))
(map? data) (jsonml-style data) [:span.re-frame-trace--object
:else (str->hiccup data))) (jsonml->hiccup (cljs-devtools/header-api-call
(.-object (get jsonml 1))
(.-config (get jsonml 1))))]
(mapv jsonml->hiccup jsonml))
(object? jsonml) (jsonml-style jsonml)
:else (str->hiccup jsonml)))
(defn tab [data] (defn tab [data]
[:div {:style {:flex "1 0 auto" :width "100%" :height "100%" :display "flex" :flex-direction "column"}} [:div {:style {:flex "1 0 auto" :width "100%" :height "100%" :display "flex" :flex-direction "column"}}
[:div.panel-content-scrollable [:div.panel-content-scrollable
(jsonml->hiccup (js->clj (cljs-devtools/header-api-call data) :keywordize-keys true))]]) (jsonml->hiccup (cljs-devtools/header-api-call data))]])
; (crawl data)]])