diff --git a/resources/static/dialog/controllers/actions.js b/resources/static/dialog/controllers/actions.js index bdc78df16ac55c6df3abe6f23d312c187ca83e25..320877daf875844026c6909919e5660447cc13c7 100644 --- a/resources/static/dialog/controllers/actions.js +++ b/resources/static/dialog/controllers/actions.js @@ -67,10 +67,6 @@ BrowserID.Modules.Actions = (function() { this.renderError(template, info); }, - doOffline: function() { - this.renderError("offline", {}); - }, - doCancel: function() { if(onsuccess) onsuccess(null); }, diff --git a/resources/static/dialog/controllers/dialog.js b/resources/static/dialog/controllers/dialog.js index 7192887df535bad47060c338a62ee6acefc9c327..74a30d092d9d98e26037ab249e3764b284959981 100644 --- a/resources/static/dialog/controllers/dialog.js +++ b/resources/static/dialog/controllers/dialog.js @@ -16,15 +16,6 @@ BrowserID.Modules.Dialog = (function() { channel, sc; - function checkOnline() { - if (false && 'onLine' in navigator && !navigator.onLine) { - this.publish("offline"); - return false; - } - - return true; - } - function startActions(onsuccess, onerror) { var actions = BrowserID.Modules.Actions.create(); actions.start({ @@ -121,35 +112,26 @@ BrowserID.Modules.Dialog = (function() { var actions = startActions.call(self, success, error); startStateMachine.call(self, actions); - if(checkOnline.call(self)) { - params = params || {}; - - params.hostname = user.getHostname(); - - // XXX Perhaps put this into the state machine. - self.bind(win, "unload", onWindowUnload); + params = params || {}; + params.hostname = user.getHostname(); - if(hash.indexOf("#CREATE_EMAIL=") === 0) { - var email = hash.replace(/#CREATE_EMAIL=/, ""); - params.type = "primary"; - params.email = email; - params.add = false; - } - else if(hash.indexOf("#ADD_EMAIL=") === 0) { - var email = hash.replace(/#ADD_EMAIL=/, ""); - params.type = "primary"; - params.email = email; - params.add = true; - } - - /* - if(hash.indexOf("REQUIRED=true") > -1) { - params.requiredEmail = params.email; - } - */ + // XXX Perhaps put this into the state machine. + self.bind(win, "unload", onWindowUnload); - self.publish("start", params); + if(hash.indexOf("#CREATE_EMAIL=") === 0) { + var email = hash.replace(/#CREATE_EMAIL=/, ""); + params.type = "primary"; + params.email = email; + params.add = false; + } + else if(hash.indexOf("#ADD_EMAIL=") === 0) { + var email = hash.replace(/#ADD_EMAIL=/, ""); + params.type = "primary"; + params.email = email; + params.add = true; } + + self.publish("start", params); } // BEGIN TESTING API diff --git a/resources/static/dialog/resources/state.js b/resources/static/dialog/resources/state.js index 846eaddb7e0b4d48302872ca664419e9599bf30b..9759b9a3c3baf3b4beb6dba6a3d0b55cb2ad9f66 100644 --- a/resources/static/dialog/resources/state.js +++ b/resources/static/dialog/resources/state.js @@ -32,10 +32,6 @@ BrowserID.State = (function() { }, cancelState = self.popState.bind(self); - subscribe("offline", function(msg, info) { - startState("doOffline"); - }); - subscribe("start", function(msg, info) { info = info || {}; diff --git a/resources/static/dialog/views/offline.ejs b/resources/static/dialog/views/offline.ejs deleted file mode 100644 index 942e98958271b64dd78554a3fe6d2295dde58362..0000000000000000000000000000000000000000 --- a/resources/static/dialog/views/offline.ejs +++ /dev/null @@ -1,12 +0,0 @@ -<!-- This Source Code Form is subject to the terms of the Mozilla Public - - License, v. 2.0. If a copy of the MPL was not distributed with this - - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - - - <h2 id="offline"><%= gettext('You are offline!') %></h2> - - <p> - <%= gettext('We are sorry, but we cannot communicate with BrowserID while you are offline.') %> - </p> - - diff --git a/resources/static/shared/error-messages.js b/resources/static/shared/error-messages.js index fcedfc5ceac4f8ba76d2eaf6a0fcd00ed5cc44b1..3616066baf88c9d62d56639f12b4078ed88ce2c7 100644 --- a/resources/static/shared/error-messages.js +++ b/resources/static/shared/error-messages.js @@ -78,11 +78,6 @@ BrowserID.Errors = (function(){ title: "Logout Failed" }, - offline: { - title: gettext("You are offline!"), - message: gettext("Unfortunately, BrowserID cannot communicate while offline!") - }, - primaryAuthentication: { title: "Authenticating with Identity Provider", message: "We had trouble communicating with your email provider, please try again!" diff --git a/resources/static/test/cases/controllers/actions.js b/resources/static/test/cases/controllers/actions.js index 20593ecac0c0a8920a89d67386f861beaa5cafa0..c670633e8a71193cb9443778085c5702d2f4aac9 100644 --- a/resources/static/test/cases/controllers/actions.js +++ b/resources/static/test/cases/controllers/actions.js @@ -54,17 +54,6 @@ }); }); - asyncTest("doOffline - print offline error screen", function() { - createController({ - ready: function() { - controller.doOffline(); - ok($("#error .contents").text().length, "contents have been written"); - ok($("#error #offline").text().length, "offline error message has been written"); - start(); - } - }); - }); - asyncTest("doProvisionPrimaryUser - start the provision_primary_user service", function() { createController({ ready: function() { diff --git a/resources/static/test/cases/resources/state.js b/resources/static/test/cases/resources/state.js index 9bdb1d44c3e94365d594914c3ce2a5b2b24bdb5f..c951c5ec98f1b11a55af5b52b98c58a17522a534 100644 --- a/resources/static/test/cases/resources/state.js +++ b/resources/static/test/cases/resources/state.js @@ -67,12 +67,6 @@ equal(error, "start: controller must be specified", "creating a state machine without a controller fails"); }); - test("offline does offline", function() { - mediator.publish("offline"); - - equal(actions.called.doOffline, true, "controller is offline"); - }); - test("user_staged - call doConfirmUser", function() { mediator.publish("user_staged", { email: "testuser@testuser.com" @@ -359,7 +353,7 @@ equal(error, "invalid email", "expected exception thrown"); }); - + test("null assertion generated - preserve original options in doPickEmail", function() { mediator.publish("start", { allowPersistent: true }); mediator.publish("assertion_generated", { assertion: null });