<commit_before>(ns nightweb.core
  (:use splendid.jfx
        nightweb.page)
  (:import javafx.scene.layout.VBox
           javafx.scene.layout.HBox
           javafx.scene.control.TabPane
           javafx.scene.control.Tab
           javafx.scene.web.WebView
           javafx.scene.layout.Priority
           javafx.scene.control.Button
           javafx.scene.control.TextField
           javafx.geometry.Insets
           net.i2p.router.Router)
  (:gen-class))

(defn start-browser
  "Launch the JavaFX browser (non-blocking)."
  []
  (jfx (let [window (VBox.)
             tab-view (VBox.)
             nav-bar (HBox.)
             back-btn (Button. "<-")
             for-btn (Button. "->")
             reload-btn (Button. "Reload")
             url-field (TextField.)
             tab-bar (TabPane.)
             main-tab (Tab. "Main Page")
             add-tab (Tab. "+")
             web-view (WebView.)]
         (.setPadding nav-bar (Insets. 4))
         (.setSpacing nav-bar 2)
         (add nav-bar [back-btn for-btn reload-btn url-field])
         (HBox/setHgrow url-field Priority/ALWAYS)
         (add tab-view [nav-bar web-view])
         (.setClosable add-tab false)
         (.setContent main-tab tab-view)
         (.add (.getTabs tab-bar) main-tab)
         (.add (.getTabs tab-bar) add-tab)
         (.load (.getEngine web-view) "http://localhost:8080")
         (VBox/setVgrow tab-bar Priority/ALWAYS)
         (add window [tab-bar])
         (show window))))

(defn start-router
  "Launch the router (blocking)."
  []
  (Router/main nil))

(defn -main
  "Launch everything."
  [& args]<commit_msg>Add ability to create tabs.<commit_after>(ns nightweb.core
  (:use nightweb.page
        nightweb.browser)
  (:import net.i2p.router.Router)
  (:gen-class))

(defn start-router
  "Launch the router (blocking)."
  []
  (Router/main nil))

(defn -main
  "Launch everything."
  [& args]
{'fraction_non_alphanumeric': 0.14060860440713535, 'fraction_numerical': 0.004197271773347324, 'mean_word_length': 1.8806646525679758, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '1673877', 'n_tokens_mistral': 648, 'n_tokens_neox': 611, 'n_words': 134}