* Add passwordStrength tip for user::batchCreate.
This commit is contained in:
@@ -37,3 +37,29 @@ function toggleNew(event)
|
||||
$newCompany.addClass('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle checkbox and check password strength.
|
||||
*
|
||||
* @param event $event
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function togglePasswordStrength(event)
|
||||
{
|
||||
const $target = $(event.target);
|
||||
const $currentRow = $target.closest('tr');
|
||||
const password = $target.val();
|
||||
|
||||
let $passwordStrength = $currentRow.find('.passwordStrength');
|
||||
if(password == '')
|
||||
{
|
||||
$passwordStrength.addClass('hidden');
|
||||
$passwordStrength.html('');
|
||||
}
|
||||
else
|
||||
{
|
||||
$passwordStrength.html(passwordStrengthList[computePasswordStrength(password)]);
|
||||
$passwordStrength.removeClass('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ formBatchPanel
|
||||
set::headingClass('user-batchcreate-heading'),
|
||||
set::title($lang->user->batchCreate),
|
||||
on::change('[data-name="new"]', 'toggleNew'),
|
||||
on::keyup('[data-name="password"]', 'togglePasswordStrength'),
|
||||
to::headingActions
|
||||
(
|
||||
radioList
|
||||
@@ -158,7 +159,20 @@ formBatchPanel
|
||||
(
|
||||
set::name('password'),
|
||||
set::label($lang->user->password),
|
||||
set::control('input'),
|
||||
set::control('inputGroup'),
|
||||
inputGroup
|
||||
(
|
||||
input
|
||||
(
|
||||
set::name('password'),
|
||||
set::value(''),
|
||||
set::placeholder(zget($lang->user->placeholder->passwordStrength, $config->safe->mode, '')),
|
||||
),
|
||||
span
|
||||
(
|
||||
setClass('input-group-addon passwordStrength hidden'),
|
||||
),
|
||||
),
|
||||
set::width('200px'),
|
||||
),
|
||||
formBatchItem
|
||||
|
||||
Reference in New Issue
Block a user