Permalink
Browse files

browserid.org appears to be calling our callback function.

  • Loading branch information...
1 parent b190256 commit 19e8f4998dbf466deb609168067259fc718c44a8 @nickbauman nickbauman committed May 6, 2012
Showing with 12 additions and 7 deletions.
  1. +1 −0 resources/public/deps.js
  2. +9 −5 src-cljs/nongrata/main.cljs
  3. +2 −2 src/nongrata/views/welcome.clj
View
@@ -0,0 +1 @@
+// google closure wants this file for some reason...
@@ -8,10 +8,14 @@
(defn log-obj [obj]
(.log js/console obj))
-; Using jayq, do this with jquery...
-; $("#signin-img").bind('click', function() { alert("button clicked!"); });
-(.bind ($ "#signin-img") "click" (fn[] (js/alert "button clicked!")))
+(defn gotAssertion
+ [assertion]
+ (js/alert (str "callback invoked: " assertion)))
-; If we got here, everything should be good
-(js/alert "JS Code compiled and running 5...")
+(.bind ($ "#browserid") "click" (fn[evt] (js/alert (str "button clicked! event: " evt))
+ (do
+ navigator.id/get(gotAssertion)
+ false)))
+
+(js/alert "JS evaluation reached bottom of the main.js file...")
@@ -9,6 +9,6 @@
(common/layout
[:p
(if (not (session/get "browser-id"))
- [:a {"href" "#" "id" "browserid" "title" "Sign-in with BrowserID"}
- [:img {"id" "signin-img" "src" "/img/sign_in_blue.png" "alt" "Sign in"}]]
+ [:a#browserid-link {"href" "#" "title" "Sign-in with BrowserID"}
+ [:img#browserid {"src" "/img/sign_in_blue.png" "alt" "Sign in"}]]
"You are signed in!")]))

0 comments on commit 19e8f49

Please sign in to comment.