From aca29b0c889955285a8e56e7609724a9fd873345 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Mon, 30 Oct 2017 17:56:49 +0100 Subject: Directly show Forgot password link, fix #6808 Signed-off-by: Jan-Christoph Borchardt --- core/css/guest.css | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'core/css/guest.css') diff --git a/core/css/guest.css b/core/css/guest.css index 576efafec5f..dd610384e31 100644 --- a/core/css/guest.css +++ b/core/css/guest.css @@ -384,13 +384,22 @@ form .warning input[type='checkbox']+label { #remember_login { margin: 18px 5px 0 16px !important; } -.remember-login-container { +.remember-login-container, +.lost-password-container { display: inline-block; margin: 10px 0; text-align: center; width: 100%; text-shadow: 0 0 2px rgba(0, 0, 0, .4); // better readability on bright background } +.lost-password-container { + margin: 0; +} +.lost-password-container #lost-password { + color: #fff; + padding: 10px; + opacity: .7; +} #forgot-password { padding: 11px; float: right; -- cgit v1.2.3 From 585e9f9fcdfbe095f7112ca102c7da59179266e0 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Thu, 2 Nov 2017 12:02:51 +0100 Subject: Add some JS to hide and show elements for password reset Signed-off-by: Jan-Christoph Borchardt --- core/css/guest.css | 26 +++++++++++++++----------- core/js/lostpassword.js | 24 +++++++++++++++++++++++- core/templates/login.php | 11 +++++++++-- 3 files changed, 47 insertions(+), 14 deletions(-) (limited to 'core/css/guest.css') diff --git a/core/css/guest.css b/core/css/guest.css index dd610384e31..4741339e183 100644 --- a/core/css/guest.css +++ b/core/css/guest.css @@ -130,28 +130,29 @@ form #datadirField legend { } /* Buttons and input */ -#submit-wrapper { +#submit-wrapper, +#reset-password-wrapper { position: relative; /* Make the wrapper the containing block of its absolutely positioned descendant icons */ } -#submit-wrapper .icon-confirm-white { + +#submit-wrapper .submit-icon, +#reset-password-wrapper .submit-icon { position: absolute; top: 23px; right: 23px; + pointer-events: none; /* The submit icon is positioned on the submit button. + From the user point of view the icon is part of the + button, so the clicks on the icon have to be + applied to the button instead. */ } + #submit-wrapper .icon-loading-small { position: absolute; top: 22px; right: 24px; } -#submit-wrapper #submit-icon { - pointer-events: none; /* The submit icon is positioned on the submit button. - From the user point of view the icon is part of the - button, so the clicks on the icon have to be - applied to the button instead. */ -} - input, textarea, select, button, div[contenteditable=true] { font-family: 'Open Sans', Frutiger, Calibri, 'Myriad Pro', Myriad, sans-serif; } @@ -395,9 +396,12 @@ form .warning input[type='checkbox']+label { .lost-password-container { margin: 0; } -.lost-password-container #lost-password { +.lost-password-container #lost-password, +.lost-password-container #lost-password-back { + display: inline-block; + padding: 12px; + margin-top: -6px; color: #fff; - padding: 10px; opacity: .7; } #forgot-password { diff --git a/core/js/lostpassword.js b/core/js/lostpassword.js index 1923b73a179..58102d2485c 100644 --- a/core/js/lostpassword.js +++ b/core/js/lostpassword.js @@ -14,11 +14,33 @@ OC.Lostpassword = { init : function() { $('#lost-password').click(OC.Lostpassword.resetLink); - $('#reset-password #submit').click(OC.Lostpassword.resetPassword); + $('#reset-password-submit').click(OC.Lostpassword.resetPassword); + $('#lost-password-back').click(OC.Lostpassword.backToLogin); + }, + + backToLogin : function(event){ + event.preventDefault(); + + $('#reset-password-wrapper').slideUp().fadeOut(); + $('#lost-password').slideDown().fadeIn(); + $('.remember-login-container').slideDown().fadeIn(); + $('#submit-wrapper').slideDown().fadeIn(); + $('.groupbottom').slideDown().fadeIn(); + $('#user').parent().addClass('grouptop'); + $('#user').focus(); }, resetLink : function(event){ event.preventDefault(); + + $('#lost-password').slideUp().fadeOut(); + $('.remember-login-container').slideUp().fadeOut(); + $('#submit-wrapper').slideUp().fadeOut(); + $('.groupbottom').slideUp().fadeOut(); + $('#user').parent().removeClass('grouptop'); + $('#reset-password-wrapper').slideDown().fadeIn(); + $('#user').focus(); + if (!$('#user').val().length){ $('#submit').trigger('click'); } else { diff --git a/core/templates/login.php b/core/templates/login.php index 342eb43a625..c7b43bb3d84 100644 --- a/core/templates/login.php +++ b/core/templates/login.php @@ -51,7 +51,7 @@ script('core', 'merged-login');

- + t('Wrong password. Reset it?')); ?> @@ -63,7 +63,7 @@ script('core', 'merged-login');
-
+
-- cgit v1.2.3 From 6347fe86c9fbecc49c25b732da9e3ba858356b48 Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Sun, 5 Nov 2017 05:45:32 +0100 Subject: Fix loading state and error message display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- core/css/guest.css | 3 --- core/js/login.js | 2 +- core/js/lostpassword.js | 18 +++++++++++++++++- 3 files changed, 18 insertions(+), 5 deletions(-) (limited to 'core/css/guest.css') diff --git a/core/css/guest.css b/core/css/guest.css index 4741339e183..e55874f3e09 100644 --- a/core/css/guest.css +++ b/core/css/guest.css @@ -393,9 +393,6 @@ form .warning input[type='checkbox']+label { width: 100%; text-shadow: 0 0 2px rgba(0, 0, 0, .4); // better readability on bright background } -.lost-password-container { - margin: 0; -} .lost-password-container #lost-password, .lost-password-container #lost-password-back { display: inline-block; diff --git a/core/js/login.js b/core/js/login.js index 81ef25ef2d4..09e7499e811 100644 --- a/core/js/login.js +++ b/core/js/login.js @@ -12,7 +12,7 @@ */ OC.Login = _.extend(OC.Login || {}, { onLogin: function () { - $('#submit-icon') + $('#submit-wrapper .submit-icon') .removeClass('icon-confirm-white') .addClass('icon-loading-small'); $('#submit') diff --git a/core/js/lostpassword.js b/core/js/lostpassword.js index 58102d2485c..6c34e7b40fc 100644 --- a/core/js/lostpassword.js +++ b/core/js/lostpassword.js @@ -16,6 +16,11 @@ OC.Lostpassword = { $('#lost-password').click(OC.Lostpassword.resetLink); $('#reset-password-submit').click(OC.Lostpassword.resetPassword); $('#lost-password-back').click(OC.Lostpassword.backToLogin); + $('#reset-password-wrapper .submit-icon') + .addClass('icon-confirm-white') + .removeClass('icon-loading-small'); + $('#reset-password-submit') + .attr('value', t('core', 'Reset password')); }, backToLogin : function(event){ @@ -41,7 +46,8 @@ OC.Lostpassword = { $('#reset-password-wrapper').slideDown().fadeIn(); $('#user').focus(); - if (!$('#user').val().length){ + // Generate a browser warning if field empty + if ($('#user').val().length === 0) { $('#submit').trigger('click'); } else { if (OC.config.lost_password_link === 'disabled') { @@ -49,6 +55,7 @@ OC.Lostpassword = { } else if (OC.config.lost_password_link) { window.location = OC.config.lost_password_link; } else { + OC.Lostpassword.onSendLink(); $.post( OC.generateUrl('/lostpassword/email'), { @@ -62,6 +69,15 @@ OC.Lostpassword = { } }, + onSendLink: function () { + $('.submit-icon') + .removeClass('icon-confirm-white') + .addClass('icon-loading-small'); + $('#reset-password-submit') + .attr('value', t('core', 'Sending email …')); + return true; + }, + sendLinkDone : function(result){ var sendErrorMsg; -- cgit v1.2.3