Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

Commit 12637d1

Browse files
committed
(#155) rework on script.js and register.js
1 parent 6fdc259 commit 12637d1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

root/static/js/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// event handler
1212
articleElem.onchange = () => {
13-
const data_units = articleElem.options[articleElem.selectedIndex].getAttribute('data-units');
13+
let data_units = articleElem.options[articleElem.selectedIndex].getAttribute('data-units');
1414

1515
let units = data_units.split(',');
1616
let units_hash = {};

root/static/js/user/register.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
passwordElem.parentElement.appendChild(meterElem);
1010

1111
passwordElem.addEventListener('input', () => {
12-
const password = passwordElem.value;
12+
let password = passwordElem.value;
1313

14-
const stars = password == '' ? 0 : ( zxcvbn(password).score + 1 );
14+
let stars = password == '' ? 0 : ( zxcvbn(password).score + 1 );
1515

1616
let html = 'strength: ';
1717
html += '★'.repeat( stars );
@@ -26,8 +26,8 @@
2626

2727
[passwordElem, password2Elem].forEach(item => {
2828
item.addEventListener('input', () => {
29-
const password = passwordElem.value;
30-
const password2 = password2Elem.value;
29+
let password = passwordElem.value;
30+
let password2 = password2Elem.value;
3131

3232
if( password.length || password2.length ) {
3333
comparatorElem.innerHTML = password == password2 ? "matches" : "doesn't match";

0 commit comments

Comments
 (0)