Skip to content
This repository was archived by the owner on Jan 24, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c29f702
fix change password modal bug, when clicking submit nothing happens
burnick Oct 14, 2015
6387016
fix test fail by running build
burnick Oct 14, 2015
b5e9529
make single login sequence
burnick Oct 23, 2015
a8fcb7f
build files
burnick Oct 23, 2015
b2a8404
update tab index
burnick Oct 23, 2015
87eb5a8
updated compiled templates
burnick Oct 23, 2015
de157bf
updated tab index
burnick Oct 23, 2015
0dfd33c
updated login modal
burnick Nov 9, 2015
899c8db
updated translation files
burnick Nov 9, 2015
058b32d
prevent close in login modal
burnick Nov 30, 2015
6e0d642
only verify if user and password is existing
burnick Dec 2, 2015
27c7d51
always show forgot password
burnick Dec 2, 2015
cf80723
fix error on blur then focus
burnick Dec 2, 2015
a0c1870
updated empty fields with error notice
burnick Dec 2, 2015
b5d1b5c
updated translation files
burnick Dec 3, 2015
90d96a3
removed password reset message
burnick Dec 7, 2015
6084672
updated image background color
burnick Dec 7, 2015
9f867ec
updated bg image
burnick Dec 7, 2015
1209b9c
updated reset password message
burnick Dec 7, 2015
2414333
removed error when successful in reset password
burnick Dec 10, 2015
67efcdf
removed videoremix instance
burnick Dec 10, 2015
cf2cb79
changed to Username (your email) intead of Username or Email
burnick Jan 20, 2016
2518a99
added zendesk link
burnick Feb 7, 2016
6e45148
added reset password modal
burnick Feb 14, 2016
08bae63
updated fix forjust showing password modal
burnick Feb 16, 2016
8bcfe08
reload after reseting password
burnick Feb 21, 2016
01177e6
updated redirection
burnick Feb 22, 2016
5876be0
updated removed
burnick Feb 23, 2016
dede894
#98243416734415 fix help link for login instead of mozilla redirect t…
burnick Mar 8, 2016
262ad49
#91051469674948 press enter for password field show validation
burnick Mar 11, 2016
79ee62b
Merge pull request #2 from burnick/password-validation-empty-fields/9…
burnick Mar 11, 2016
a0bc6a4
updated link fix for reset password
burnick Mar 19, 2016
3a2d95d
fix reset password link
burnick Mar 19, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dist/min/ngWebmakerLogin.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/min/ngWebmakerLogin.templates.min.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions dist/min/webmakerLogin.min.js

Large diffs are not rendered by default.

47 changes: 40 additions & 7 deletions dist/ngWebmakerLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1415,11 +1415,13 @@ ngModule.directive('wmSignin', [
checkEmail: 1,
enterKey: 2,
enterPassword: 3,
resetRequestSent: 4
resetRequestSent: 4,
enterEmail: 5
};

$scope.MODALSTATE = MODALSTATE;
$scope.currentState = MODALSTATE.enterUid;
$scope.enterEmail = enterEmail;
$scope.passwordWasReset = passwordWasReset;
$scope.sendingRequest = false;
$scope.disablePersona = disablePersona;
Expand All @@ -1446,6 +1448,13 @@ ngModule.directive('wmSignin', [
}, 0);
});

signinController.on('displayEnterEmail', function () {
$timeout(function () {
$scope.currentState = MODALSTATE.enterEmail;
focus('input[focus-on="login-uid2"]');
}, 0);
});

signinController.on('displayEnterPassword', function () {
$timeout(function () {
$scope.currentState = MODALSTATE.enterPassword;
Expand Down Expand Up @@ -1499,6 +1508,10 @@ ngModule.directive('wmSignin', [
signinController.displayEnterKey();
};

$scope.enterEmail = function(){
signinController.displayEnterEmail();
};

$scope.submitKey = function () {
signinController.verifyKey($scope.user.uid, $scope.user.key, $scope.user.rememberMe);
};
Expand All @@ -1518,6 +1531,7 @@ ngModule.directive('wmSignin', [

$scope.switchToSignup = function () {
var uid = $scope.user.uid,
myid = $scope.user.id,
type = signinController.getUidType(uid),
email = type === 'email' ? uid : '',
username = type === 'username' ? uid : '';
Expand Down Expand Up @@ -1552,7 +1566,9 @@ ngModule.directive('wmSignin', [
disablePersona: function () {
return $scope.disablePersona;
}
}
},
backdrop: 'static', /* this prevent user interaction with the background */
keyboard: false
});
};
}
Expand Down Expand Up @@ -1655,6 +1671,7 @@ ngModule.directive('wmPasswordReset', [
};

$scope.submitResetRequest = function () {
var uid = $scope.user.uid;
resetController.submitResetRequest(uid, resetCode, $scope.password.value);
};

Expand Down Expand Up @@ -1768,7 +1785,7 @@ module.exports = function WebmakerLoginCore(options) {
});
}

window.addEventListener('focus', verify);
//window.addEventListener('focus', verify);

return {
on: function (event, listener) {
Expand Down Expand Up @@ -1897,6 +1914,12 @@ module.exports = function LoginAPI(options) {
}, callback);
}

function requestEmail(uid,callback) {
doRequest(loginUrls.requestResetCode, {
uid: uid
}, callback);
}

function resetPassword(uid, resetCode, password, callback) {
doRequest(loginUrls.resetPassword, {
uid: uid,
Expand Down Expand Up @@ -1931,6 +1954,7 @@ module.exports = function LoginAPI(options) {
verifyKey: verifyKey,
verifyPassword: verifyPassword,
requestReset: requestReset,
requestEmail: requestEmail,
resetPassword: resetPassword,
personaLogin: personaLogin,
logout: logout,
Expand Down Expand Up @@ -2381,8 +2405,8 @@ module.exports = function ResetController(loginApi) {
}

analytics.event('Webmaker Password Reset Succeeded');

emit(RESET_EVENTS.resetSucceeded);
window.location = '/';
//emit(RESET_EVENTS.resetSucceeded);
});
}
};
Expand Down Expand Up @@ -2416,7 +2440,8 @@ module.exports = function SignInController(loginApi) {
displayEnterKey: 'displayEnterKey',
displayCheckEmail: 'displayCheckEmail',
displayResetSent: 'displayResetSent',
signedIn: 'signedIn'
signedIn: 'signedIn',
displayEnterEmail: 'displayEnterEmail'
};

function emit() {
Expand Down Expand Up @@ -2480,7 +2505,7 @@ module.exports = function SignInController(loginApi) {
}

if (body.usePasswordLogin) {
return emit(SIGNIN_EVENTS.displayEnterPassword);
return false; //emit(SIGNIN_EVENTS.displayEnterPassword);
}

loginApi.sendLoginKey(uid, path, function sendLoginKeyCallback(err, resp, body) {
Expand Down Expand Up @@ -2545,16 +2570,24 @@ module.exports = function SignInController(loginApi) {
emit(SIGNIN_EVENTS.signedIn, body.user);
});
},
requestEmail: function(uid) {
setRequestState(false);
emit(SIGNIN_EVENTS.displayEnterEmail);
},
requestReset: function (uid) {
setRequestState(true);
loginApi.requestReset(uid, function requestResetCallback(err, resp, body) {
setRequestState(false);
if (err) {
return displayAlert(SIGNIN_ALERTS.serverError);
} else {
hideAlert(SIGNIN_ALERTS.serverError);
}

if (!body.status) {
return displayAlert(SIGNIN_ALERTS.resetRequestFailed);
} else {
hideAlert(SIGNIN_ALERTS.resetRequestFailed);
}

analytics.event('Webmaker Password Reset Requested');
Expand Down
58 changes: 44 additions & 14 deletions dist/templates/ngWebmakerLogin.templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ angular.module("reset-modal.html", []).run(["$templateCache", function($template
angular.module("signin-modal.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("signin-modal.html",
"<div class=\"modal-header\">\n" +
" <button ng-click=\"close()\" type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">&times;</button>\n" +
" <button ng-click=\"close()\" type=\"button\" class=\"close\" ng-hide=\"true\" data-dismiss=\"modal\" aria-hidden=\"true\">&times;</button>\n" +
" <h3 class=\"modal-title\" ng-show=\"currentState === MODALSTATE.enterUid || currentState === MODALSTATE.enterPassword\">\n" +
" <button href=\"#\" ng-click=\"close()\" class=\"modal-title-left btn-link\">{{ 'Cancel' | i18n }}</button>\n" +
" <span class=\"modal-title-center\">{{ 'Sign in to Webmaker' | i18n }}</span>\n" +
" <span class=\"modal-title-center\">{{ 'Sign in' | i18n }}</span>\n" +
" <button ng-show=\"currentState === MODALSTATE.enterUid\"\n" +
" ng-disabled=\"sendingRequest\"\n" +
" ng-click=\"submitUid()\"\n" +
Expand All @@ -188,6 +188,9 @@ angular.module("signin-modal.html", []).run(["$templateCache", function($templat
" ng-disabled=\"sendingRequest\"\n" +
" ng-click=\"user.password && submitPassword()\" tabindex=\"9\">{{ 'Submit' | i18n }}</button>\n" +
" </h3>\n" +
" <h3 class=\"modal-title\" ng-show=\"currentState === MODALSTATE.enterEmail\">\n" +
" Reset Password\n" +
" </h3>\n" +
" <h3 class=\"modal-title\" ng-show=\"currentState === MODALSTATE.checkEmail || currentState === MODALSTATE.resetRequestSent || currentState === MODALSTATE.enterKey\">\n" +
" <a href=\"#\" ng-click=\"close()\" class=\"modal-title-left\">{{ 'Cancel' | i18n }}</a>\n" +
" <span class=\"modal-title-center\">{{ 'checkEmail' | i18n }}</span>\n" +
Expand Down Expand Up @@ -218,19 +221,50 @@ angular.module("signin-modal.html", []).run(["$templateCache", function($templat
" <div class=\"form-group\">\n" +
" <label for=\"uid\">{{ 'EmailOrUsername' | i18n }}</label>\n" +
" <input name=\"uid\" class=\"form-control\" ng-model=\"user.uid\" autocomplete=\"on\" required tabindex=\"1\" autofocus=\"true\" focus-on=\"login-uid\" ng-keyup=\"$event.keyCode === 13 && !sendingRequest && submitUid()\">\n" +
" <label for=\"password\">{{ 'Password' | i18n }}</label>\n" +
" <input type=\"password\" class=\"form-control\" required name=\"password\" ng-model=\"user.password\" tabindex=\"2\" focus-on=\"enter-password\" ng-keyup=\"$event.keyCode === 13 && user.password && !sendingRequest && submitPassword()\">\n" +
" </div>\n" +
" <div class=\"alert alert-warning\" ng-show=\"form.user.$error.noAccount\" bind-trusted-html=\"'No account found for your uid' | i18n\"></div>\n" +
" <div class=\"alert alert-danger\" ng-show=\"form.user.$error.passwordSigninFailed\" ng-bind-html=\"'passLoginFailed' | i18n\"></div>\n" +
" <div class=\"alert alert-danger\" ng-show=\"form.user.$error.invalidUid\" ng-bind-html=\"'That does not look like an email address or username' | i18n\"></div>\n" +
" <div class=\"remember-me-password checkbox\">\n" +
" <input id=\"remember-me-password\" ng-model=\"user.rememberMe\" type=\"checkbox\" name=\"rememberMe\" tabindex=\"3\">\n" +
" <label for=\"remember-me-password\" tabindex=\"4\">\n" +
" <div><span></span></div>\n" +
" <span ng-bind-html=\"'Remember me for one year' | i18n\"></span>\n" +
" </label>\n" +
" </div>\n" +
" <div class=\"cta-links clearfix\">\n" +
" <button class=\"submit-userid btn btn-primary hidden-xs-login\" type=\"button\" ng-disabled=\"sendingRequest\" ng-click=\"submitUid()\" tabindex=\"2\">{{ 'Sign in' | i18n }}</button>\n" +
" <div ng-hide=\"disablePersona\">\n" +
" <button type=\"button\" class=\"submit-password btn btn-primary hidden-xs-login\" type=\"button\" ng-disabled=\"sendingRequest\" ng-click=\"user.password && submitPassword()\" tabindex=\"5\">{{ 'Submit' | i18n }}</button> <p><a ng-click=\"requestEmail()\">{{ 'Reset your password?' | i18n }}</a></p>\n" +
" <p class=\"align-left\" style=\"margin-left: 200px;\"><a target=\"_blank\" href=\"https://digistrats.zendesk.com/\">{{ 'Contact Support' | i18n }}</a></p>\n" +
"\n" +
" <div ng-hide=\"true\">\n" +
" <p class=\"align-left\">{{ 'or' | i18n }}</p>\n" +
" <button type=\"button\" wm-persona-login class=\"btn btn-link\" ng-disabled=\"sendingRequest\" ng-click=\"usePersona();\" tabindex=\"3\">{{ 'log in with Persona' | i18n }}</button>\n" +
" <button type=\"button\" wm-persona-login class=\"btn btn-link\" ng-disabled=\"sendingRequest\" ng-click=\"usePersona();\" tabindex=\"6\">{{ 'log in with Persona' | i18n }}</button>\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
" <!-- end enter uid -->\n" +
"\n" +
" <!-- Enter Email -->\n" +
" <div ng-show=\"currentState === MODALSTATE.enterEmail;\">\n" +
"\n" +
" <div class=\"form-group\">\n" +
" <label for=\"uid\">{{ 'EmailOrUsername' | i18n }}</label>\n" +
" <input name=\"myuid\" class=\"form-control\" ng-model=\"user.uid\" autocomplete=\"on\" required tabindex=\"1\" autofocus=\"true\" focus-on=\"login-uid2\">\n" +
"\n" +
" </div>\n" +
" <div class=\"alert alert-warning\" ng-show=\"form.user.$error.noAccount\" bind-trusted-html=\"'No account found for your uid' | i18n\"></div>\n" +
" <div class=\"alert alert-danger\" ng-show=\"form.user.$error.passwordSigninFailed\" ng-bind-html=\"'passLoginFailed' | i18n\"></div>\n" +
" <div class=\"alert alert-danger\" ng-show=\"form.user.$error.invalidUid\" ng-bind-html=\"'That does not look like an email address or username' | i18n\"></div>\n" +
" <div class=\"cta-links clearfix\">\n" +
" <p><a ng-click=\"requestReset()\">{{ 'Click to Reset your password' | i18n }}</a></p>\n" +
" <p class=\"align-left\" style=\"margin-left: 309px;\"><a href=\"\">{{ 'Back' | i18n }}</a></p>\n" +
"\n" +
" </div>\n" +
" </div>\n" +
" <!-- end enter Email -->\n" +
"\n" +
" <!-- checkEmail begins -->\n" +
" <div class=\"checkEmail\" ng-show=\"currentState === MODALSTATE.checkEmail\">\n" +
" <div class=\"mailIcon clearfix\">\n" +
Expand Down Expand Up @@ -274,7 +308,7 @@ angular.module("signin-modal.html", []).run(["$templateCache", function($templat
" <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n" +
" <g id=\"AC4\" sketch:type=\"MSArtboardGroup\" transform=\"translate(-126.000000, -92.000000)\">\n" +
" <g id=\"Mail-Icon\" sketch:type=\"MSLayerGroup\" transform=\"translate(126.000000, 92.000000)\">\n" +
" <circle id=\"Oval-1\" fill=\"#3FB58E\" sketch:type=\"MSShapeGroup\" cx=\"47\" cy=\"47\" r=\"47\"></circle>\n" +
" <circle id=\"Oval-1\" fill=\"#EB5054\" sketch:type=\"MSShapeGroup\" cx=\"47\" cy=\"47\" r=\"47\"></circle>\n" +
" <rect id=\"Rectangle-1\" fill=\"#FFFFFF\" sketch:type=\"MSShapeGroup\" x=\"18\" y=\"27\" width=\"59\" height=\"41\" rx=\"3\"></rect>\n" +
" <path d=\"M21.0069321,27 C19.3462494,27 17.9900756,28.3368135 17.9778938,29.9953973 C17.9778938,29.9953973 17.9712616,30.8538058 17.9707031,31.0256348 C17.9688241,31.6037734 44.3277476,50.7739169 44.3277476,50.7739169 C45.6547338,51.7409595 47.981989,52.0459954 49.4771883,51.3411914 C49.4771883,51.3411914 52.3180561,50.8603167 59.4023438,44.0800781 C61.1871084,42.3719134 77.0395508,31.2178814 77.0395508,30.1010742 C77.0395508,29.644898 77.0391066,29.9910722 77.0391066,29.9910722 C77.0175086,28.3391486 75.6568485,27 73.9930679,27 L21.0069321,27 Z\" id=\"Rectangle-95\" fill=\"#F3F3F3\" sketch:type=\"MSShapeGroup\"></path>\n" +
" <path d=\"M17.7634277,31.0032813 L46.7917565,50.276875 L75.0556641,31.3201563 L46.5782176,55.1035938 L17.7634277,31.0032813 Z\" id=\"Path-1\" fill=\"#D8D8D8\" sketch:type=\"MSShapeGroup\"></path>\n" +
Expand All @@ -293,7 +327,7 @@ angular.module("signin-modal.html", []).run(["$templateCache", function($templat
" <div class=\"alert alert-danger\" ng-show=\"form.user.$error.invalidKey\" ng-bind-html=\"'incorrectToken' | i18n\"></div>\n" +
" <div class=\"remember-me-token checkbox\">\n" +
" <input id=\"remember-me-token\" ng-model=\"user.rememberMe\" type=\"checkbox\" name=\"rememberMe\" tabindex=\"7\">\n" +
" <label for=\"remember-me-token\">\n" +
" <label for=\"remember-me-token\" tabindex=\"7\">\n" +
" <div><span></span></div>\n" +
" <span ng-bind-html=\"'Remember me for one year' | i18n\"></span>\n" +
" </label>\n" +
Expand All @@ -317,7 +351,7 @@ angular.module("signin-modal.html", []).run(["$templateCache", function($templat
" <div class=\"alert alert-danger\" ng-show=\"form.user.$error.passwordSigninFailed\" ng-bind-html=\"'passLoginFailed' | i18n\"></div>\n" +
" <div class=\"remember-me-password checkbox\">\n" +
" <input id=\"remember-me-password\" ng-model=\"user.rememberMe\" type=\"checkbox\" name=\"rememberMe\" tabindex=\"10\">\n" +
" <label for=\"remember-me-password\">\n" +
" <label for=\"remember-me-password\" tabindex=\"10\">\n" +
" <div><span></span></div>\n" +
" <span ng-bind-html=\"'Remember me for one year' | i18n\"></span>\n" +
" </label>\n" +
Expand All @@ -329,7 +363,7 @@ angular.module("signin-modal.html", []).run(["$templateCache", function($templat
" </div>\n" +
" <hr>\n" +
" <footer class=\"help-footer\">\n" +
" <p class=\"switch-back\">{{ 'you can switch to webmaker login' | i18n }}</p>\n" +
" <!-- p class=\"switch-back\">{{ 'you can switch to webmaker login' | i18n }}</p -->\n" +
" </footer>\n" +
" </div>\n" +
"\n" +
Expand All @@ -343,7 +377,7 @@ angular.module("signin-modal.html", []).run(["$templateCache", function($templat
" <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n" +
" <g id=\"AC4\" sketch:type=\"MSArtboardGroup\" transform=\"translate(-126.000000, -92.000000)\">\n" +
" <g id=\"Mail-Icon\" sketch:type=\"MSLayerGroup\" transform=\"translate(126.000000, 92.000000)\">\n" +
" <circle id=\"Oval-1\" fill=\"#3FB58E\" sketch:type=\"MSShapeGroup\" cx=\"47\" cy=\"47\" r=\"47\"></circle>\n" +
" <circle id=\"Oval-1\" fill=\"#EB5054\" sketch:type=\"MSShapeGroup\" cx=\"47\" cy=\"47\" r=\"47\"></circle>\n" +
" <rect id=\"Rectangle-1\" fill=\"#FFFFFF\" sketch:type=\"MSShapeGroup\" x=\"18\" y=\"27\" width=\"59\" height=\"41\" rx=\"3\"></rect>\n" +
" <path d=\"M21.0069321,27 C19.3462494,27 17.9900756,28.3368135 17.9778938,29.9953973 C17.9778938,29.9953973 17.9712616,30.8538058 17.9707031,31.0256348 C17.9688241,31.6037734 44.3277476,50.7739169 44.3277476,50.7739169 C45.6547338,51.7409595 47.981989,52.0459954 49.4771883,51.3411914 C49.4771883,51.3411914 52.3180561,50.8603167 59.4023438,44.0800781 C61.1871084,42.3719134 77.0395508,31.2178814 77.0395508,30.1010742 C77.0395508,29.644898 77.0391066,29.9910722 77.0391066,29.9910722 C77.0175086,28.3391486 75.6568485,27 73.9930679,27 L21.0069321,27 Z\" id=\"Rectangle-95\" fill=\"#F3F3F3\" sketch:type=\"MSShapeGroup\"></path>\n" +
" <path d=\"M17.7634277,31.0032813 L46.7917565,50.276875 L75.0556641,31.3201563 L46.5782176,55.1035938 L17.7634277,31.0032813 Z\" id=\"Path-1\" fill=\"#D8D8D8\" sketch:type=\"MSShapeGroup\"></path>\n" +
Expand All @@ -353,10 +387,6 @@ angular.module("signin-modal.html", []).run(["$templateCache", function($templat
" </svg>\n" +
" <p>{{ 'resetMessage' | i18n }}</p>\n" +
" </div>\n" +
" <hr>\n" +
" <footer class=\"help-footer\">\n" +
" <p class=\"switch-back\">{{ 'you can switch to webmaker login' | i18n }}</p>\n" +
" </footer>\n" +
" </div>\n" +
" </form>\n" +
"</div>\n" +
Expand Down
Loading