mirror of
https://github.com/privacyguides/privacyguides.org.git
synced 2025-06-07 14:22:46 -04:00
readability tweak
This commit is contained in:
parent
97f89b7ba2
commit
28803ae0b9
1 changed files with 7 additions and 15 deletions
|
@ -218,34 +218,28 @@
|
||||||
if (options.includePunctuationChars) {
|
if (options.includePunctuationChars) {
|
||||||
candidates += punct;
|
candidates += punct;
|
||||||
}
|
}
|
||||||
var result = "";
|
var password = "";
|
||||||
for (var i = 0; i < options.passwordLength; i++) {
|
for (var i = 0; i < options.passwordLength; i++) {
|
||||||
var randomNum = generateRandomNum(candidates.length);
|
var randomNum = generateRandomNum(candidates.length);
|
||||||
result += candidates.substring(randomNum, randomNum + 1);
|
password += candidates.substring(randomNum, randomNum + 1);
|
||||||
}
|
}
|
||||||
return result;
|
return password;
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
generatePassword: generatePassword
|
generatePassword: generatePassword
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
(function() {
|
(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
function getOptions() {
|
function getOptions() {
|
||||||
return {
|
return {
|
||||||
passwordLength: $("#password-length").val(),
|
passwordLength: $("#password-length").val(),
|
||||||
includeUppercaseChars: $("#include-uppercase-chars-checkbox").is(
|
includeUppercaseChars: $("#include-uppercase-chars-checkbox").is(":checked"),
|
||||||
":checked"),
|
includeLowercaseChars: $("#include-lowercase-chars-checkbox").is(":checked"),
|
||||||
includeLowercaseChars: $("#include-lowercase-chars-checkbox").is(
|
|
||||||
":checked"),
|
|
||||||
includeNumbers: $("#include-digits-checkbox").is(":checked"),
|
includeNumbers: $("#include-digits-checkbox").is(":checked"),
|
||||||
includePunctuationChars: $("#include-special-chars-checkbox").is(
|
includePunctuationChars: $("#include-special-chars-checkbox").is(":checked"),
|
||||||
":checked"),
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function outputGeneratedPassword() {
|
function outputGeneratedPassword() {
|
||||||
var password;
|
var password;
|
||||||
try {
|
try {
|
||||||
|
@ -254,9 +248,7 @@
|
||||||
return $("#unsupported-browser-alert").show();
|
return $("#unsupported-browser-alert").show();
|
||||||
}
|
}
|
||||||
if (password === '') {
|
if (password === '') {
|
||||||
alert(
|
alert("Whops. You unselected all the options. I don't know what characters you want. Click on the button entitled \"Advanced Options\" and enable some options then try again. Nice one");
|
||||||
"Whops. You unselected all the options. I don't know what characters you want. Click on the button entitled \"Advanced Options\" and enable some options then try again. Nice one"
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$("#password-input").val(password);
|
$("#password-input").val(password);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue