diff --git a/src/js/controller/login-initial.js b/src/js/controller/login-initial.js index 103da70..02c896d 100644 --- a/src/js/controller/login-initial.js +++ b/src/js/controller/login-initial.js @@ -19,6 +19,9 @@ define(function(require) { // scope functions // + /** + * Continue to key import screen + */ $scope.importKey = function() { if (!$scope.state.agree) { $scope.onError({ @@ -27,9 +30,15 @@ define(function(require) { return; } + // sing up to newsletter + $scope.signUpToNewsletter(); + // go to key import $location.path('/login-new-device'); }; + /** + * Continue to set passphrase screen for keygen + */ $scope.setPassphrase = function() { if (!$scope.state.agree) { $scope.onError({ @@ -38,9 +47,46 @@ define(function(require) { return; } + // sing up to newsletter + $scope.signUpToNewsletter(); + // go to set passphrase screen $scope.setState(states.SET_PASSPHRASE); }; + /** + * [signUpToNewsletter description] + * @param {Function} callback (optional) + */ + $scope.signUpToNewsletter = function(callback) { + if (!$scope.state.newsletter) { + return; + } + + var address = emailDao._account.emailAddress; + var uri = 'https://whiteout.us8.list-manage.com/subscribe/post?u=52ea5a9e1be9e1d194f184158&id=6538e8f09f'; + + var formData = new FormData(); + formData.append('EMAIL', address); + formData.append('b_52ea5a9e1be9e1d194f184158_6538e8f09f', ''); + + var xhr = new XMLHttpRequest(); + xhr.open('post', uri, true); + + xhr.onload = function() { + if (callback) { + callback(null, xhr); + } + }; + + xhr.onerror = function(err) { + if (callback) { + callback(err); + } + }; + + xhr.send(formData); + }; + /* * Taken from jQuery validate.password plug-in 1.0 * http://bassistance.de/jquery-plugins/jquery-plugin-validate.password/ diff --git a/src/sass/_scaffolding.scss b/src/sass/_scaffolding.scss index dac7522..ac8a627 100755 --- a/src/sass/_scaffolding.scss +++ b/src/sass/_scaffolding.scss @@ -37,6 +37,10 @@ textarea { -moz-osx-font-smoothing: grayscale; } +fieldset { + border: 1px solid $color-grey-lighter; +} + // Basic layout .main-app-view { height: 100%; diff --git a/src/sass/views/_login.scss b/src/sass/views/_login.scss index 8129dce..eeaa48a 100644 --- a/src/sass/views/_login.scss +++ b/src/sass/views/_login.scss @@ -119,8 +119,21 @@ .view-login-initial { .content { - .terms { - margin-bottom: 40px; + form { + .option { + width: 90%; + font-size: $font-size-small; + margin: 0 auto; + } + + .terms { + margin-top: 30px; + margin-bottom: 15px; + } + + .newsletter { + margin-bottom: 40px; + } } } } diff --git a/src/tpl/login-initial.html b/src/tpl/login-initial.html index e60e30e..4d1c7ab 100644 --- a/src/tpl/login-initial.html +++ b/src/tpl/login-initial.html @@ -9,11 +9,16 @@
PGP key. You can either import an existing PGP key or generate a new one. Your private key remains on your device and is not sent to our servers.