mirror of
https://github.com/quantum5/correcthorsebatterystaple.git
synced 2025-07-27 03:54:11 -04:00
Compare commits
No commits in common. "6b540a940ed30659dd47ee7a5bf79cbd402342cd" and "8a3d1f1d85fd14d82252aa5fcc7cb2f5a8a0c902" have entirely different histories.
6b540a940e
...
8a3d1f1d85
33
src/ui.js
33
src/ui.js
|
@ -55,26 +55,15 @@ $(() => {
|
|||
updateBitMeter()
|
||||
}
|
||||
|
||||
function generatePassword () {
|
||||
const options = $options.serializeObject()
|
||||
$output.text(generate(options)).removeClass('placeholder')
|
||||
$('#copy-password').prop('disabled', false)
|
||||
return false
|
||||
}
|
||||
|
||||
const settings = window.localStorage.getItem('settings')
|
||||
if (settings) {
|
||||
try {
|
||||
loadSettings(JSON.parse(settings))
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
if (window.crypto && window.crypto.getRandomValues) {
|
||||
$('#too-old').hide()
|
||||
|
||||
$('#run-generator').click(generatePassword)
|
||||
$('#run-generator').click(() => {
|
||||
const options = $options.serializeObject()
|
||||
$output.text(generate(options)).removeClass('placeholder')
|
||||
$('#copy-password').prop('disabled', false)
|
||||
return false
|
||||
})
|
||||
|
||||
$('#save-settings').click(() => {
|
||||
const options = $options.serializeObject()
|
||||
|
@ -91,6 +80,14 @@ $(() => {
|
|||
$options.find('select, input').change(updateBitMeter)
|
||||
$options.find('input[type=number]').on('input', updateBitMeter)
|
||||
updateBitMeter()
|
||||
generatePassword()
|
||||
}
|
||||
|
||||
const settings = window.localStorage.getItem('settings')
|
||||
if (settings) {
|
||||
try {
|
||||
loadSettings(JSON.parse(settings))
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue