diff options
author | David Barksdale <amatus@amatus.name> | 2014-08-21 19:24:11 -0500 |
---|---|---|
committer | David Barksdale <amatus@amatus.name> | 2014-08-21 19:24:11 -0500 |
commit | 1cb1777920bfc1af4318e5c5a398ddf403fd0489 (patch) | |
tree | 05a358630fc53673e3402740ea12eb5b1d693345 /src | |
parent | cac12cceb58c3d71e0f33027558812a82ce5b58a (diff) |
Use magic string interpolation
Diffstat (limited to 'src')
-rw-r--r-- | src/hl/index.cljs.hl | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/hl/index.cljs.hl b/src/hl/index.cljs.hl index 91a9f4f..72c88d1 100644 --- a/src/hl/index.cljs.hl +++ b/src/hl/index.cljs.hl @@ -23,6 +23,10 @@ (set! *print-fn* #(.log js/console %)) +(defn peer-id-short + [peer] + (.substr (code/base32-crockford peer) 0 4)) + (def topology-worker (service/start-worker "topology" "js/gnunet-daemon-topology.js")) (def fs-worker (service/start-worker "fs" "js/gnunet-service-fs.js")) @@ -56,12 +60,8 @@ (script :src "js/semantic.min.js")) (body (div :class "ui header" - :text (cell= - (apply str - (concat "My Peer ID: " - (take 4 (code/base32-crockford my-id)) - "\u2026"))) - :title (cell= (code/base32-crockford my-id))) + :title (cell= (code/base32-crockford my-id)) + (text "My Peer ID: ~(peer-id-short my-id)\u2026")) (table :class "ui table segment" (thead (tr @@ -73,13 +73,8 @@ (loop-tpl :bindings [[peer info] peers] (tr (td :width "25%" - :text (cell= - (apply str - (concat - (take 4 - (code/base32-crockford peer)) - "\u2026"))) - :title (cell= (code/base32-crockford peer))) + :title (cell= (code/base32-crockford peer)) + (text "~(peer-id-short peer)\u2026")) (td :width "25%" :text (cell= (transport/state->string (:transport-state info)))) |