1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-10 16:54:44 +02:00

Update ProcessLogin to support login by email address for the admin. To use, you must enable the "unique" flag on your "email" field (Setup > Fields > email > Advanced), and then you can enable login-by-email in the ProcessLogin module settings.

This commit is contained in:
Ryan Cramer
2020-02-14 15:15:28 -05:00
parent eedad3a742
commit af6a68e06d
4 changed files with 145 additions and 23 deletions

View File

@@ -1967,18 +1967,21 @@ function InputfieldStates($target) {
});
// Make the first field in any form have focus, if it is a text field that is blank
// $('#content .InputfieldForm:not(.InputfieldNoFocus):not(.InputfieldFormNoFocus)')
$('#content .InputfieldFormFocusFirst:not(.InputfieldFormNoFocus)')
.find('input[type=text]:enabled:first:not(.hasDatepicker):not(.InputfieldNoFocus)').each(function() {
var $t = $(this);
// jump to first input, if it happens to be blank
if($t.val()) return;
// avoid jumping to inputs that fall "below the fold"
if($t.offset().top < $(window).height()) {
window.setTimeout(function () {
if($t.is(":visible")) $t.focus();
}, 250);
}
var $focusInputs = $('input.InputfieldFocusFirst'); // input elements only
if(!$focusInputs.length) {
$focusInputs = $('#content .InputfieldFormFocusFirst:not(.InputfieldFormNoFocus)')
.find('input[type=text]:enabled:first:not(.hasDatepicker):not(.InputfieldNoFocus)');
}
if($focusInputs.length) $focusInputs.each(function() {
var $t = $(this);
// jump to first input, if it happens to be blank
if($t.val()) return;
// avoid jumping to inputs that fall "below the fold"
if($t.offset().top < $(window).height()) {
window.setTimeout(function () {
if($t.is(":visible")) $t.focus();
}, 250);
}
});
// confirm changed forms that user navigates away from before submitting

File diff suppressed because one or more lines are too long