 
 (defn add-thick-class
   "Adds thick-left and thick-right classes to every 5th element
-Basically it add thick-left to 0, 5, 10 element and thick-right to last one."
+  Basically it add thick-left to 0, 5, 10 element and thick-right to last one."
   [tds]
   (let [tds (map-indexed
              (fn [ind value]


(defn rate [diff]
  "Submits rating for puzzle id. Assumed to be called from rating dialog.
  Puzzle ID is implicitely taken from dialog properties"
  (let [args (.-dialogArguments js/window)
        id (.-id args) ]
    (goog.net.XhrIo/send (str "/api/rate/" id "?difficulty=" diff) #(.close js/window))))

(defn rate-dialog [id]
  "Shows rate dialog for give puzzle id"
  (let [d-attrs (js-obj)
        _ (set! (.-id d-attrs) id)]
    (js/showModalDialog "rating" d-attrs "dialogWidth:250; dialogHeight:100; dialogLeft:860; dialogTop: 540; resizable: no")))



(defn pad [nums beg end value]
  (vec (concat (repeat beg value)
               nums
               (repeat end value))))

(defn add-class-templ [el class]
  (update-in el [1 :class] str class))
