             [discuss.utils.common :as lib]
             [discuss.utils.extensions]
             [discuss.utils.views :as vlib]))
+
+;;;; Auxiliary
+(defn- remaining-characters
+  "Show remaining characters needed to submit a post."
+  [statement]
+  (let [remaining (- 10 (count statement))]
+    (if (pos? remaining)
+      (str "Noch " remaining " Zeichen")
+      "Abschicken")))
+
 
 ;;;; Elements
 (defn control-elements []

  "Shows selected text from website if available."
  []
  (let [selection (lib/get-selection)]
    (when (> (count selection) 1)
      (dom/div #js {:className "input-group"}
               (dom/span #js {:className "input-group-addon"}
                         (vlib/fa-icon "fa-quote-left"))

                         (vlib/fa-icon "fa-quote-right"))
               (dom/span #js {:className "input-group-addon pointer"
                              :onClick   lib/remove-selection}
                         (vlib/fa-icon "fa-times")))
      (dom/p #js {:className "text-center"} "Möchtest du deine Aussage durch eine Referenz von dieser Seite stützen? Dann markiere einfach einen Teil des Textes mit der Maus."))))

(defn add-element
  "Show form to add a new statement."
