       false)))
 
 (set! (.-onreadystatechange js/document) on-doc-ready)
-

(ns owl.web.popup
  (:use [domina :only [by-id value
                       set-value!
                       set-attr!
                       set-text!]])
  (:require [domina.events :as ev]))

(defonce ^:export proxy-settings (atom {}))
(defonce ^:export proxy-switch (atom false))
(defonce ^:export proxy-types {:raw [:auto_detect
                                     :pac_script

                    (reset! proxy-switch false))))))))

(defn apply-proxy-settings! [e]
  (let [c (make-proxy-settings! (value (by-id "proxy_uri")))
        d (clj->js c)]
    (.preventDefault e.evt)
    (.stopPropagation e.evt)
    (.log js/console d)
    (.set js/chrome.proxy.settings
          d (fn [s]
              (.log js/console (js->clj s))))
    (.sendRequest js/chrome.extension {:type "clearError"})))

(defn clear-proxy-settings! []
