<commit_before>(ns netrunner.main
  (:require [om.core :as om :include-macros true]
            [sablono.core :as sab :include-macros true]
            [goog.events :as events])
  (:import goog.history.Html5History
           goog.history.EventType))

(def app-state
  (atom {:active-page ["/"]}))

(defn navigate [token]
  (let [page-number (case token "/" 0 "/play" 1 "/deckbuilder" 2 "/cards" 3 "/news" 4)]
    (.carousel (js/$ ".carousel") page-number))
  (swap! app-state assoc :active-page [token]))

(def history (Html5History.))

(events/listen history EventType/NAVIGATE #(navigate (.-token %)))
(.setUseFragment history false)
(.setPathPrefix history "")
(.setEnabled history true)

(defn navbar [app owner]
  (om/component
   (let [page (:active-page app)]
     (sab/html
      [:ul.carousel-indicator {}
       [:li {:class (if (= (first page) "/") "active" "")
             :on-click #(.setToken history "/")
             :data-target "#main" :data-slide-to 0}
        [:a {:href "/"} "Manabase"]]
       [:li {:class (if (= (first page) "/play") "active" "")
             :on-click #(.setToken history "/play")
             :data-target "#main" :data-slide-to 1}
        [:a {:href "/play"} "Play"]]
       [:li {:class (if (= (first page) "/deckbuilder") "active" "")
             :on-click #(.setToken history "/deckbuilder")
             :data-target "#main" :data-slide-to 2}
        [:a {:href "/deckbuilder"} "Decks"]]
       [:li {:class (if (= (first page) "/cards") "active" "")<commit_msg>Send pageview to Google Analytics on page change<commit_after>(ns netrunner.main
  (:require [om.core :as om :include-macros true]
            [sablono.core :as sab :include-macros true]
            [goog.events :as events])
  (:import goog.history.Html5History
           goog.history.EventType))

(def app-state
  (atom {:active-page ["/"]}))

(defn navigate [token]
  (let [page-number (case token "/" 0 "/play" 1 "/deckbuilder" 2 "/cards" 3 "/news" 4)]
    (.carousel (js/$ ".carousel") page-number))
  (js/ga "send" "pageview")
  (swap! app-state assoc :active-page [token]))

(def history (Html5History.))

(events/listen history EventType/NAVIGATE #(navigate (.-token %)))
(.setUseFragment history false)
(.setPathPrefix history "")
(.setEnabled history true)

(defn navbar [app owner]
  (om/component
   (let [page (:active-page app)]
     (sab/html
      [:ul.carousel-indicator {}
       [:li {:class (if (= (first page) "/") "active" "")
             :on-click #(.setToken history "/")
             :data-target "#main" :data-slide-to 0}
        [:a {:href "/"} "Manabase"]]
       [:li {:class (if (= (first page) "/play") "active" "")
             :on-click #(.setToken history "/play")
             :data-target "#main" :data-slide-to 1}
        [:a {:href "/play"} "Play"]]
       [:li {:class (if (= (first page) "/deckbuilder") "active" "")
             :on-click #(.setToken history "/deckbuilder")
             :data-target "#main" :data-slide-to 2}
        [:a {:href "/deckbuilder"} "Decks"]]
       [:li {:class (if (= (first page) "/cards") "active" "")
{'fraction_non_alphanumeric': 0.1971511816121722, 'fraction_numerical': 0.006474587245063127, 'mean_word_length': 2.669833729216152, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6484575', 'n_tokens_mistral': 1079, 'n_tokens_neox': 999, 'n_words': 282}