Skip to content
This repository has been archived by the owner on May 10, 2019. It is now read-only.

Commit

Permalink
Merge branch 'dev' into required_email_frontend
Browse files Browse the repository at this point in the history
Conflicts:
	resources/static/dialog/controllers/dialog_controller.js
  • Loading branch information
lloyd committed Nov 16, 2011
2 parents 3cce950 + 2f11bff commit c64bf3b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion example/index.html
Expand Up @@ -124,7 +124,7 @@
$("#oAssertion").text(assertion);
checkAssertion(assertion);
};
}, {persistent: true});
}, {allowPersistent: true});
});

$("#logout").click(function(event) {
Expand Down
6 changes: 3 additions & 3 deletions resources/static/dialog/controllers/dialog_controller.js
Expand Up @@ -94,7 +94,7 @@
getVerifiedEmail: function(origin_url, onsuccess, onerror) {
return this.get(origin_url, {}, onsuccess, onerror);
},

get: function(origin_url, params, onsuccess, onerror) {
var self=this;
self.onsuccess = onsuccess;
Expand All @@ -103,8 +103,8 @@
if (typeof(params) == 'undefined') {
params = {};
}
self.allowPersistent = !!params.persistent;

self.allowPersistent = !!params.allowPersistent;
self.requiredEmail = params.requiredEmail;

if ('onLine' in navigator && !navigator.onLine) {
Expand Down
9 changes: 7 additions & 2 deletions resources/static/dialog/resources/channel.js
Expand Up @@ -54,10 +54,15 @@
(function() {
var win = window,
nav = navigator,
onCompleteCallback;
onCompleteCallback,
WINDOW_NAME_REGEXP= "^_mozid_signin_(.*)";

function getRelayName() {
return win.localStorage.RELAYFRAME_NAME;
var result = win.name.match(WINDOW_NAME_REGEXP);
if (result)
return result[1];
else
return null;
}

function getRelayWindow() {
Expand Down
10 changes: 7 additions & 3 deletions resources/static/include.js
Expand Up @@ -668,16 +668,20 @@
return iframe;
}

function _open_window(url) {
function _open_window(url, name_suffix) {
url = url || "about:blank";
// we open the window initially blank, and only after our relay frame has
// been constructed do we update the location. This is done because we
// must launch the window inside a click handler, but we should wait to
// start loading it until our relay iframe is instantiated and ready.
// see issue #287 & #286
var window_name = "_mozid_signin";
if (name_suffix)
window_name += "_" + name_suffix;

var dialog = window.open(
url,
"_mozid_signin",
window_name,
isFennec ? undefined : "menubar=0,location=0,resizable=0,scrollbars=0,status=0,dialog=1,width=700,height=375");

dialog.focus();
Expand Down Expand Up @@ -773,7 +777,7 @@
});

// open the window now that all else is ready
w = _open_window(ipServer + "/sign_in");
w = _open_window(ipServer + "/sign_in", relay_iframe.getAttribute('name'));

// if the RP window closes, close the dialog as well.
_attach_event(window, 'unload', cleanup);
Expand Down
2 changes: 0 additions & 2 deletions resources/static/relay/relay.js
Expand Up @@ -39,8 +39,6 @@
(function() {
"use strict";

window.localStorage.RELAYFRAME_NAME = window.name;

window.console = window.console || {
log: function() {}
};
Expand Down
4 changes: 1 addition & 3 deletions resources/static/test/qunit/resources/channel_unit_test.js
Expand Up @@ -43,12 +43,10 @@ steal.then("/dialog/resources/channel", function() {

// Mock in the window object as well as the frame relay
var winMock = {
name : "_mozid_signin_browserid_relay_1234",
location: {
href: "browserid.org/sign_in"
},
localStorage: {
RELAYFRAME_NAME : "browserid_relay_1234"
},
opener: {
frames: {
browserid_relay_1234: {
Expand Down

0 comments on commit c64bf3b

Please sign in to comment.