diff --git a/authority/jsapi/include.js b/authority/jsapi/include.js index 4f6847205daac3164f864305b24c76d595a744af..b6b46b0a86e5e4dee24be5771a0f3f4e5edfa065 100644 --- a/authority/jsapi/include.js +++ b/authority/jsapi/include.js @@ -530,9 +530,11 @@ if (!navigator.id.getVerifiedEmail) { method: "getVerifiedEmail", success: function(rv) { if (onsuccess) onsuccess(rv); + w.close(); }, error: function(code, msg) { if (onerror) onerror(code, msg); + w.close(); } }); }; diff --git a/authority/jsapi/picker.html b/authority/jsapi/picker.html index 1270a6609e6e550aa7c54da9fdfac08f75934eb1..988323c499818d818c3e509ab5e83a4a3b82f7eb 100644 --- a/authority/jsapi/picker.html +++ b/authority/jsapi/picker.html @@ -1,13 +1,16 @@ <html> -<body> -<p>Hi! Want to log into [sitename]?</p> +<head> + <title> Mozilla ID </title> + <style> + body { display: none } + </style> +</head> +<body id="body"> +<p>Hi! Want to log into <span id="sitename"></span>?</p> <p> Which ID would you like to use? </p> -<ul> - <li> <a href="#">AAA</a> - <li> <a href="#">BBB</a> - <li> <a href="#">AAA</a> +<ul id="availableIdentities"> </ul> <script src="jschannel.js"></script> diff --git a/authority/jsapi/picker.js b/authority/jsapi/picker.js index 8af5b3b0a38b5b93394d5f18db0726f6879a6203..4339e0bb0e43652c84a859101c98135775251e79 100644 --- a/authority/jsapi/picker.js +++ b/authority/jsapi/picker.js @@ -2,14 +2,35 @@ // fiddles the dom expressed by picker.html var chan = Channel.build( - { - window: window.opener, - origin: "*", - scope: "mozid" + { + window: window.opener, + origin: "*", + scope: "mozid" + }); - }); chan.bind("getVerifiedEmail", function(trans, s) { - alert("you called getVerifiedEmail"); - return "AAA"; + trans.delayReturn(true); + + // set the requesting site + document.getElementById("sitename").innerText = trans.origin.replace(/^.*:\/\//, ""); + + // iterate over all of the available identities and add a links to them + // XXX -- actually pull these guys outta localStorage + + var list = document.getElementById('availableIdentities'); + [ "foo@bar.com", "baz@bing.com" ].forEach(function(i) { + var li = document.createElement("li"); + var link = document.createElement("a"); + link.innerText = i; + link.href = "#"; + li.appendChild(link); + link.addEventListener("click", function(evt) { + trans.complete(this.innerText); + }); + list.appendChild(li); + }); + + // now let's make the body visible + document.getElementById("body").style.display = "block"; }); diff --git a/rp/index.html b/rp/index.html index 26523881c6902097f59664f4527c9728a77e2b21..6802e9b31a97157f692bfb8c3950d552fc07e0a5 100644 --- a/rp/index.html +++ b/rp/index.html @@ -27,6 +27,7 @@ computer usage for little ones. // // Now we'll send this assertion up to the mywords server for // validation + console.log("got assertion: " + assertion); $.post( '/login',