Permalink
Browse files

Migrated to new ClojureScript prop lookup syntax and made similar mig…

…ration to Domina. The Domina lib is in flux at the moment, so I pointed the dependency to my own fork for now. We can move to Luke's latest once he is done with his XPath changes.
  • Loading branch information...
1 parent e23834f commit 934df802a55cf340740cabc29a129a9d29073733 @fogus fogus committed Jan 13, 2012
View
@@ -9,15 +9,16 @@ lein deps
cd lib
-git clone https://github.com/levand/domina.git
+# change this to levand's repo once he merges in the prop-lookup changes
+git clone https://github.com/fogus/domina.git
git clone https://github.com/clojure/clojurescript.git
cd domina
-git checkout -b clojurescript-one-lib c0eb06f677e0f9f72537682e3c702dd27b03e2e4
+git checkout -b clojurescript-one-lib cc2ee723b28fd3de6023156cab23b86daaa72210
cd ../clojurescript
-git checkout -b clojurescript-one-lib 329708bdd0f039241b187bc639836d9997d8fbd4
+git checkout -b clojurescript-one-lib3 493213cca55f4d4d112b57a040a7f5363b60a28b
script/bootstrap
echo "Copy ClojureScript deps to lib directory..."
@@ -101,7 +101,7 @@
#(dispatch/fire [:field-changed field-id] (value field)))
(event/listen keyboard
"key"
- (fn [e] (when (= (.keyCode e) key-codes/ENTER)
+ (fn [e] (when (= (.-keyCode e) key-codes/ENTER)
(do (.blur (by-id "name-input") ())
(dispatch/fire :form-submit)))))))
@@ -53,7 +53,7 @@
js/Element
(scroll [this]
- [(.scrollLeft this) (.scrollTop this)]))
+ [(.-scrollLeft this) (.-scrollTop this)]))
(defprotocol ISize
(size [this] "Return the size of an element as `[W H]`.")
@@ -34,9 +34,9 @@
(goog.History.))]
(do (event/listen h "navigate"
(fn [e]
- (callback {:token (keyword (.token e))
- :type (.type e)
- :navigation? (.isNavigation e)})))
+ (callback {:token (keyword (.-token e))
+ :type (.-type e)
+ :navigation? (.-isNavigation e)})))
(.setEnabled h true)
h)))
@@ -76,7 +76,7 @@
(defn- response-received
[f e]
- (f {:id (.id e)
+ (f {:id (.-id e)
:body (. e/xhrIo (getResponseText))
:status (. e/xhrIo (getStatus))
:event e}))
@@ -16,6 +16,6 @@
(some #(let [v (%)] (when (not= "" v) v))
[#(style/getComputedStyle element style)
#(style/getStyle element style)
- #(aget (.currentStyle element) style)
+ #(aget (.-currentStyle element) style)
#(throw (js/Error. (str "Could not retrieve value for style " style)))]))
@@ -12,9 +12,9 @@
(fx/enable-button "greet-button")
(clojure.browser.dom/click-element :greet-button))
(cljs-wait-for #(= % :greeting) one.sample.model (:state @state))
- (is (= (cljs-eval one.sample.view (.innerHTML (first (nodes (by-class "name")))))
+ (is (= (cljs-eval one.sample.view (.-innerHTML (first (nodes (by-class "name")))))
"Ted"))
- (is (= (cljs-eval one.sample.view (.innerHTML (first (nodes (by-class "again")))))
+ (is (= (cljs-eval one.sample.view (.-innerHTML (first (nodes (by-class "again")))))
""))
(is (= (cljs-eval one.sample.model @state)
{:state :greeting, :name "Ted", :exists false}))
@@ -28,9 +28,9 @@
(fx/enable-button "greet-button")
(clojure.browser.dom/click-element :greet-button))
(cljs-wait-for #(= % :greeting) one.sample.model (:state @state))
- (is (= (cljs-eval one.sample.view (.innerHTML (first (nodes (by-class "name")))))
+ (is (= (cljs-eval one.sample.view (.-innerHTML (first (nodes (by-class "name")))))
"Ted"))
- (is (= (cljs-eval one.sample.view (.innerHTML (first (nodes (by-class "again")))))
+ (is (= (cljs-eval one.sample.view (.-innerHTML (first (nodes (by-class "again")))))
"again"))
(is (= (cljs-eval one.sample.model @state)
{:state :greeting, :name "Ted", :exists true}))

0 comments on commit 934df80

Please sign in to comment.