<commit_before>(ns deathrow.common
  (:require [deathrow.history :as h]
            [deathrow.utils :as utils]
            [om.next :as om :refer-macros [defui]]
            [om.dom :as dom]))

(def app-element (.getElementById js/document "content"))

(defonce app-state {:path nil})
                    ;:data nil
                    ;; :data is always remote, adding it to our state map will break,
                    ;; because Om Next will merge incoming novelty with merge-with


(defn build-app-state [& args]
  (-> (apply merge app-state args)
      (atom)))

(defui PanelBody
  Object
  (render [this]
    (dom/div #js {:className "panel-body"}
      (dom/div #js {:className "row"}
        (apply dom/div #js {:className "col-md-10 col-md-offset-1 well quote"}
          (om/children this)))
      (dom/div #js {:className "col-md-4 col-md-offset-4 text-center"}
        (dom/button #js {:className "btn btn-default load-statement"
                         :onClick #(h/replace-token! "/offenders/random")}
          "Load another random statement")))))

(def panel-body
  (om/factory PanelBody))

(defn error-msg []
  (panel-body nil
    (dom/h2 nil "There was an error loading your request. "
      (dom/small nil "Try again!"))))

(defn spinner []
  (dom/div #js{:id "circularG" :className "center-block spinner fade"}
    (dom/div #js{:id "circularG_1" :className "circularG"})
    (dom/div #js{:id "circularG_2" :className "circularG"})
    (dom/div #js{:id "circularG_3" :className "circularG"})
    (dom/div #js{:id "circularG_4" :className "circularG"})
    (dom/div #js{:id "circularG_5" :className "circularG"})
    (dom/div #js{:id "circularG_6" :className "circularG"})
    (dom/div #js{:id "circularG_7" :className "circularG"})
    (dom/div #js{:id "circularG_8" :className "circularG"})))

(defui GenericPanel
  Object
  (getInitialState [this]<commit_msg>getInitialState -> initLocalState in next.common<commit_after>(ns deathrow.common
  (:require [deathrow.history :as h]
            [deathrow.utils :as utils]
            [om.next :as om :refer-macros [defui]]
            [om.dom :as dom]))

(def app-element (.getElementById js/document "content"))

(defonce app-state {:path nil})
                    ;:data nil
                    ;; :data is always remote, adding it to our state map will break,
                    ;; because Om Next will merge incoming novelty with merge-with


(defn build-app-state [& args]
  (-> (apply merge app-state args)
      (atom)))

(defui PanelBody
  Object
  (render [this]
    (dom/div #js {:className "panel-body"}
      (dom/div #js {:className "row"}
        (apply dom/div #js {:className "col-md-10 col-md-offset-1 well quote"}
          (om/children this)))
      (dom/div #js {:className "col-md-4 col-md-offset-4 text-center"}
        (dom/button #js {:className "btn btn-default load-statement"
                         :onClick #(h/replace-token! "/offenders/random")}
          "Load another random statement")))))

(def panel-body
  (om/factory PanelBody))

(defn error-msg []
  (panel-body nil
    (dom/h2 nil "There was an error loading your request. "
      (dom/small nil "Try again!"))))

(defn spinner []
  (dom/div #js{:id "circularG" :className "center-block spinner fade"}
    (dom/div #js{:id "circularG_1" :className "circularG"})
    (dom/div #js{:id "circularG_2" :className "circularG"})
    (dom/div #js{:id "circularG_3" :className "circularG"})
    (dom/div #js{:id "circularG_4" :className "circularG"})
    (dom/div #js{:id "circularG_5" :className "circularG"})
    (dom/div #js{:id "circularG_6" :className "circularG"})
    (dom/div #js{:id "circularG_7" :className "circularG"})
    (dom/div #js{:id "circularG_8" :className "circularG"})))

(defui GenericPanel
  Object
  (initLocalState [this]
{'fraction_non_alphanumeric': 0.15560821484992102, 'fraction_numerical': 0.00737230121116377, 'mean_word_length': 2.8964102564102565, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '6518426', 'n_tokens_mistral': 1326, 'n_tokens_neox': 1277, 'n_words': 350}