         (om/set-state! owner :url-input-text "")))))
 
 
+
 ;; --- MAIN VIEW ---
 
 (defsnippet url "templates/bookmarks.html" [:.list-group-item]

   [:.url-ts] (content (.toLocaleString ts))})



(deftemplate bookmarks "templates/bookmarks.html"
  [app owner state]
  {[:#bm-header] (content "Recent bookmarks")
   [:#url-input] (do-> (set-attr :value (:url-input-text state))
                       (listen :on-change #(handle-text-change % owner :url-input-text)
                               :on-key-down #(if (= (.-keyCode %) 10)
                                              (send-bookmark state owner)
                                              (when (= (.-which %) 13)
                                                (when (.-ctrlKey %)
                                                  (send-bookmark state owner))))))
   [:#url-list] (content (map #(url %) (sort-by :ts > app)))
   [:#bookmark-btn] (listen :on-click (fn [e] (send-bookmark state owner)))})


;; --- INIT ---

  (do
    #_(ws-repl/connect "ws://localhost:9001" :verbose true)
    (figw/watch-and-reload
     :jsload-callback (fn [] (print "reloaded")))))


