 
 (enable-console-print!)
 
+;; Routing mode
+(aset (.-route js/m) "mode" "hash")
+
+;; Dropbox OAuth process
 (js/setup_dropbox)
 
 (defn setup []
+  "Mount app"
   (do
-    (set! (.-mode (.-route js/m)) "hash")
     (.route js/m
             (.getElementById js/document "app")
             "/"
             (clj->js {"/" app}))))
 
+;; If authentication has been successful, mount app and use query params if any
 (if (and (not (nil? js/client)) (.isAuthenticated js/client))
   (do
     (setup)

        referer (get data "referer" "")
        comment (get data "comment" "")
        time (get data "time" "")]
    (m "form.pure-form" nil
       [(m "fieldset" nil
           [(text "title" title 35)
            (text "url" url 15)
            (text "referer" referer 15)
            (text "time" time 15)
            (text "comment" comment 50)
            (m "button.pure-button.pure-button-primary"
               {:onclick #(save)} "Update")
            (m "button.pure-button" {:onclick #(clear)} "Clear")])])))

(defn notes [data start]
  "Returns 10 items from data"

                  "referer" (route_param "referer")}]
      (if (not(nil? params))
        (do (println "initial param was:" params)
            (.route js/m "/")
            (updatedb [:editing] params)))))
  (println "No auth!"))

;; (require '[modern-cljs.core :as c] :reload)
;; alt cmd e -> search repl history
;; (.route js/m "/")
