<commit_before>(ns y-om.components.columns
  (:require-macros [cljs.core.async.macros :refer [go alt!]])
  (:require
   [y-om.utils :as utils]
   [y-om.components.card :as card]
   [clojure.string :as string]
   [om-tools.core :refer-macros [defcomponent]]
   [om-tools.dom :as dom :include-macros true]
   [cljs.core.async :as async :refer [>! <! alts! chan sliding-buffer put! close!]]
   [om.core :as om :include-macros true]
   [sablono.core :as html :refer-macros [html]]))

(enable-console-print!)

(defn toggle-state [data state]
  (let [current-state (get-in @data state)]
    (om/update! data state (not current-state))))

(defn submit-card [owner data state ref]
  (let [element (om/get-node owner ref)
        text (. element -value)]
    (when (not (string/blank? text))
      (let [next-id (->> (:cards @data)
                  last
                  :id)
            id (if (nil? next-id)
                 0
                 next-id)]
        (om/transact! data :cards #(conj % {:task text :id id}))
        (set! (.-value element) "")
        (om/update! data [:state :add-card?] false)))))

(defn rename-column [owner data state ref]
  (let [element (om/get-node owner ref)
        text (. element -value)]
    (om/update! data :name text)
    (toggle-header data state)))

(defn display? [show-input?]
  (if show-input?
    ""
    "hide"))

(defn render-input [owner data submit-fn val state ref button-text]
  (dom/div
    (dom/input {:type "textarea"
                :auto-complete "off"
                :ref ref
                :defaultValue val
                :on-key-down #(if (= 13 (.. % -keyCode))
                                (submit-fn owner data state ref))})
    (dom/button {:on-click
                 #(submit-fn owner data state ref)}
      button-text)
    (dom/a {:class "close"<commit_msg>Increment the id of the above card when creating a new card.<commit_after>(ns y-om.components.columns
  (:require-macros [cljs.core.async.macros :refer [go alt!]])
  (:require
   [y-om.utils :as utils]
   [y-om.components.card :as card]
   [clojure.string :as string]
   [om-tools.core :refer-macros [defcomponent]]
   [om-tools.dom :as dom :include-macros true]
   [cljs.core.async :as async :refer [>! <! alts! chan sliding-buffer put! close!]]
   [om.core :as om :include-macros true]
   [sablono.core :as html :refer-macros [html]]))

(enable-console-print!)

(defn toggle-state [data state]
  (let [current-state (get-in @data state)]
    (om/update! data state (not current-state))))

(defn submit-card [owner data state ref]
  (let [element (om/get-node owner ref)
        text (. element -value)]
    (when (not (string/blank? text))
      (let [next-id (->> (:cards @data)
                  last
                  :id)
            id (if (nil? next-id)
                 0
                 (inc next-id))]
        (om/transact! data :cards #(conj % {:task text :id id}))
        (set! (.-value element) "")
        (om/update! data [:state :add-card?] false)))))

(defn rename-column [owner data state ref]
  (let [element (om/get-node owner ref)
        text (. element -value)]
    (om/update! data :name text)
    (toggle-header data state)))

(defn display? [show-input?]
  (if show-input?
    ""
    "hide"))

(defn render-input [owner data submit-fn val state ref button-text]
  (dom/div
    (dom/input {:type "textarea"
                :auto-complete "off"
                :ref ref
                :defaultValue val
                :on-key-down #(if (= 13 (.. % -keyCode))
                                (submit-fn owner data state ref))})
    (dom/button {:on-click
                 #(submit-fn owner data state ref)}
      button-text)
    (dom/a {:class "close"
{'fraction_non_alphanumeric': 0.15565147019152953, 'fraction_numerical': 0.0016185594820609657, 'mean_word_length': 2.1477079796264857, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3208436', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1229, 'n_words': 353}