diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..e5ef07f464a1ade71ba3bc69137e97b519add62e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: node_js + +before_install: + - sudo apt-get install libgmp3-dev + +node_js: + - 0.6 + +notifications: + irc: "irc.mozilla.org#identity" diff --git a/ChangeLog b/ChangeLog index 9a546b9af12906cedc3572d56b939fcbaeb385b5..245d20964c8af2516c948e2778d5894fd6f94842 100644 --- a/ChangeLog +++ b/ChangeLog @@ -40,6 +40,7 @@ train-2012.02.02: * (hotfix 2012.02.07) Modify build process to pick up locales from a .json file * (hotfix 2012.02.07) fix production-locales.sh script to defer to the environment for configuration * (hotfix 2012.02.13) fix for IE users not seeing error screens sometimes: #1087 + * (hotfix 2012.02.22) add banner announcing brand change train-2012.01.18: * support for 3rd party primary identity providers: #761, #904, #865 diff --git a/README.md b/README.md index 16c9a2836fb4fed60c9e9af913b25acad527124f..b683b966a0ae82417b1918ba28438eabbbb334c4 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Unit tests can be run by invoking `npm test` at the top level, and you should run them often. Like before committing code. To fully test the code you should install mysql and have a well permissions `test` user (can create and drop databases). If you don't have mysql installed, -code testing is still possible (it just uses a little json database). +code testing is still possible (it just uses a little JSON database). ## Development model diff --git a/resources/static/css/m.css b/resources/static/css/m.css index c8004bb1d30b84a130f6c05e4d63c6dd2e37ac25..66274ef26d56b47b296906d4d9c91ba91a02b8c0 100644 --- a/resources/static/css/m.css +++ b/resources/static/css/m.css @@ -99,7 +99,7 @@ padding: 0 10px; font-size: 16px; line-height: 21px; - margin: 122px 0 122px; + margin: 0 0 90px; /* Add a bottom margin so the footer is never overlapped. */ } #signUp p { @@ -231,4 +231,8 @@ float: right; } + #newsbanner { + margin: 115px 0 28px 0; /* put a margin-top on so that it does not go under the header */ + + } } diff --git a/resources/static/css/style.css b/resources/static/css/style.css index 2b75378bdbc0a133fc700aa3f456892252a6f32d..7e42ec91215f19a5f1aafd04aed6b5032fa7e6f2 100644 --- a/resources/static/css/style.css +++ b/resources/static/css/style.css @@ -809,6 +809,7 @@ footer { } #newsbanner { + margin-top: 60px; /* put a margin-top on so that it does not go under the header */ background-color: #faca33; line-height: 32px; border-radius: 4px; @@ -816,7 +817,6 @@ footer { text-align: center; color: #626160; text-shadow: 1px 1px 0 rgba(255,255,255,0.5); - height: 32px; -webkit-transition: all 500ms; -moz-transition: all 500ms; -ms-transition: all 500ms; 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/error.ejs b/resources/static/dialog/views/error.ejs index 8db38ff478f2f711b60c44bbc95ed3db838c81f6..cd96ea5649356e9103ae30bded442ec4916cdb74 100644 --- a/resources/static/dialog/views/error.ejs +++ b/resources/static/dialog/views/error.ejs @@ -21,9 +21,9 @@ <% if (!(typeof network !== "undefined" && network.status == 403)) { %> <p> <% if (typeof dialog !== "undefined" && dialog !== false) { %> - <%= gettext("To retry, you will have to reload the page and try again.") %> + <%= gettext("Please reload the page and try again.") %> <% } else { %> - <%= gettext("To retry, you will have to close this window and try again.") %> + <%= gettext("Please close this window and try again.") %> <% } %> </p> <% } %> 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 }); diff --git a/scripts/browserid.spec b/scripts/browserid.spec index 6ed39bbfd82a3d7c4c310e7b9d8de75e05742771..e1bc7df0d3118dad98e3a4c3dfa02734007cd6a6 100644 --- a/scripts/browserid.spec +++ b/scripts/browserid.spec @@ -34,7 +34,7 @@ echo "locale svn r$SVN_REVISION" >> resources/static/ver.txt %install rm -rf %{buildroot} mkdir -p %{buildroot}%{_rootdir} -for f in bin lib locale node_modules resources scripts *.json; do +for f in bin config lib locale node_modules resources scripts *.json; do cp -rp $f %{buildroot}%{_rootdir}/ done mkdir -p %{buildroot}%{_rootdir}/config diff --git a/scripts/extract_po.sh b/scripts/extract_po.sh index 5407ff2644e5a0fb2f62b17ff1f7baae304a1185..92ef55b724b1532428069106eeb59f2f8cc493cd 100755 --- a/scripts/extract_po.sh +++ b/scripts/extract_po.sh @@ -3,16 +3,17 @@ # syntax: # extract-po.sh +# No -j on first line, to clear out .pot file (Issue#1170) # messages.po is server side strings -xgettext -j --keyword=_ -L Perl --output-dir=locale/templates/LC_MESSAGES --from-code=utf-8 --output=messages.pot\ - `find lib -name '*.js' | grep -v 'i18n.js'` +xgettext --keyword=_ -L Perl --output-dir=locale/templates/LC_MESSAGES --from-code=utf-8 --output=messages.pot\ + `find lib -name '*.js' | grep -v 'i18n.js' | grep -v jwcrypto` xgettext -j -L PHP --keyword=_ --output-dir=locale/templates/LC_MESSAGES --output=messages.pot `find resources/views -name '*.ejs'` xgettext -j -L PHP --keyword=_ --output-dir=locale/templates/LC_MESSAGES --output=messages.pot `find lib/browserid -name '*.ejs'` # client.po # js -xgettext -j -L Perl --output-dir=locale/templates/LC_MESSAGES --from-code=utf-8 --output=client.pot\ +xgettext -L Perl --output-dir=locale/templates/LC_MESSAGES --from-code=utf-8 --output=client.pot\ `find resources/static -name '*.js' | grep -v /lib/ | grep -v /build/ | grep -v /production/ | grep -v 'gettext.js'` xgettext -j -L Perl --output-dir=locale/templates/LC_MESSAGES --output=client.pot `find resources/static/dialog/ -name '*.js' | grep -v include.js` # ejs