Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Migrated TwitterBuzz to new prop acces synatx

  • Loading branch information...
commit 2a4f406a3268968cdda260ca7635750eef2734b9 1 parent 8b5b29e
@fogus fogus authored
View
6 samples/twitterbuzz/src/twitterbuzz/core.cljs
@@ -45,7 +45,7 @@
(defn search-tag
"Get the current tag value from the page."
[]
- (.value (dom/get-element :twitter-search-tag)))
+ (.-value (dom/get-element :twitter-search-tag)))
(defn retrieve
"Send request to twitter."
@@ -205,7 +205,7 @@
(let [q (apply str (interpose " OR " (map #(str "from:" %)
(take max-missing-query missing))))]
(set-tweet-status :okay "Fetching mentioned tweets")
- (retrieve (.strobj {"q" q "rpp" results-per-page})
+ (retrieve (.-strobj {"q" q "rpp" results-per-page})
#(add-missing-callback missing %)
error-callback)))
@@ -214,7 +214,7 @@
[]
(when-let [tag (:search-tag @state)]
(set-tweet-status :okay "Fetching tweets")
- (retrieve (.strobj {"q" tag "rpp" results-per-page})
+ (retrieve (.-strobj {"q" tag "rpp" results-per-page})
new-tweets-callback
error-callback)))
View
2  samples/twitterbuzz/src/twitterbuzz/dom-helpers.cljs
@@ -52,7 +52,7 @@
[tag & args]
(let [[tag attrs children] (normalize-args tag args)
parent (dom/createDom (name tag)
- (.strobj (reduce (fn [m [k v]]
+ (.-strobj (reduce (fn [m [k v]]
(assoc m k v))
{}
(map #(vector (name %1) %2)
View
14 samples/twitterbuzz/src/twitterbuzz/showgraph.cljs
@@ -77,12 +77,12 @@
; Draw mention edges
(doseq [[username {ux1 :x, uy1 :y}] locs
- :let [x1 (unit-to-pixel ux1 (.width canvas-size))
- y1 (unit-to-pixel uy1 (.height canvas-size))]
+ :let [x1 (unit-to-pixel ux1 (.-width canvas-size))
+ y1 (unit-to-pixel uy1 (.-height canvas-size))]
[mention-name mention-count] (:mentions (get mentions username))]
(when-let [{ux2 :x, uy2 :y} (get locs mention-name)]
- (let [x2 (unit-to-pixel ux2 (.width canvas-size))
- y2 (unit-to-pixel uy2 (.height canvas-size))]
+ (let [x2 (unit-to-pixel ux2 (.-width canvas-size))
+ y2 (unit-to-pixel uy2 (.-height canvas-size))]
(.drawPath g
(-> (. g (createPath)) (.moveTo x1 y1) (.lineTo x2 y2))
edge-stroke nil))))
@@ -90,8 +90,8 @@
; Draw avatar nodes
(doseq [[username {:keys [x y] :as foo}] locs]
;(log (pr-str foo))
- (let [px (- (unit-to-pixel x (.width canvas-size)) (/ avatar-size 2))
- py (- (unit-to-pixel y (.height canvas-size)) (/ avatar-size 2))
+ (let [px (- (unit-to-pixel x (.-width canvas-size)) (/ avatar-size 2))
+ py (- (unit-to-pixel y (.-height canvas-size)) (/ avatar-size 2))
user (get mentions username)
image-url (get user :image-url default-avatar)
img (.drawImage g px py avatar-size avatar-size image-url)]
@@ -104,7 +104,7 @@
"No locations to graph"
text)]
(when text
- (.drawTextOnLine g text 5 20 (.width canvas-size) 20
+ (.drawTextOnLine g text 5 20 (.-width canvas-size) 20
"left" font nil fill)))))
(def graph-data (atom nil))
Please sign in to comment.
Something went wrong with that request. Please try again.