         end (+ next PAGESIZE)
         stop (if (not (or (< next 0) (< count next))) true false)]
     (if stop
-      (m "span.pagelink" nil
+      (nm "span.pagelink"
        [(m "a"
            {:onclick (fn [e]
                        (.preventDefault e)
                        (setpage next))
             :href ""}
            (str pagenum " - " end))])
-      (m "span.pagelink.emptypage" nil "______"))))
+      (nm "span.pagelink.emptypage" "______"))))
 
 (defn pages []
   (let [start (:start db)
         count (count (:data db))]
-    (m "#pages" nil ["Count: " count " " (page start - count) " " (page start + count)])))
+    (nm "#pages" ["Count: " count " " (page start - count) " " (page start + count)])))
 
 (defn ctrl []
   (if (not (:data db nil))

        (data_from_db DB))))

(defn viewer [c]
  (m "div" nil
     [(m "div" nil [(m "h1" {:style {:color "green"}} "NoteTapp")])
      (m "#nav" nil
         [(m "div" nil
             (m "button.pure-button.button-success" {:onclick #(data_to_db DB)} "Save"))])
      (m "#editor" nil [(editor (:editing db))])
      (pages)
      (m "div" {} [(notes (:data db) (:start db))])]))

(def app {:controller ctrl :view viewer})

(enable-console-print!)

;; Routing mode
(aset (.-route js/m) "mode" "hash")

            [setup_dropbox]
            [goog.i18n.DateTimeFormat :as dtf]))

(enable-console-print!)

;
; Constants
;

(def ^:const PAGESIZE 10)
(def ^:const DB "/data.json")
(def ^:const DATEFORMAT "d.M.yyyy H:mm")

;
; Mithril helpers
