 (ns discuss.components.clipboard
-  (:require [om.core :as om :include-macros true]
-            [om.dom :as dom :include-macros true]
-            [om.next :as nom :refer-macros [defui]]
+  (:require [om.next :as om :refer-macros [defui]]
             [sablono.core :as html :refer-macros [html]]
             [discuss.translations :refer [translate] :rename {translate t}]
             [discuss.utils.common :as lib]))
 
 (defn get-stored-selections
   "Return all stored selections."
-  {:deprecated 0.4}
   []
   (let [selections (get-in @lib/app-state [:clipboard :selections])]
     (or selections [])))

  "Removes clicked selection."
  [title]
  (let [rcol (remove #(= (:title %) title) (get-stored-selections))]
    (lib/update-state-item! :clipboard :selections (fn [] rcol))))

(defn add-item!
  "Store current selection in clipboard."

   (let [selections (get-stored-selections)
         current current
         with-current (distinct (merge selections {:title current}))]
     #_(lib/update-state-item! :clipboard :selections (fn [_] with-current))))
  ([] (add-item! (lib/get-selection))))


