From 18531979e830c8c094e8de0b3ee593eebd250807 Mon Sep 17 00:00:00 2001 From: Ian Coleman Date: Fri, 23 Oct 2015 09:41:49 +1100 Subject: Strength field uses select tag Closes #17 --- src/index.html | 11 ++++++++++- src/js/index.js | 15 --------------- 2 files changed, 10 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/index.html b/src/index.html index 34b4248..1699b39 100644 --- a/src/index.html +++ b/src/index.html @@ -66,7 +66,16 @@
- + diff --git a/src/js/index.js b/src/js/index.js index 0a662a8..9dabe95 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -162,21 +162,6 @@ return; } var numWords = parseInt(DOM.strength.val()); - // Check strength is an integer - if (isNaN(numWords)) { - DOM.strength.val("12"); - numWords = 12; - } - // Check strength is a multiple of 32, if not round it down - if (numWords % 3 != 0) { - numWords = Math.floor(numWords / 3) * 3; - DOM.strength.val(numWords); - } - // Check strength is at least 32 - if (numWords == 0) { - numWords = 3; - DOM.strength.val(numWords); - } var strength = numWords / 3 * 32; var words = mnemonic.generate(strength); DOM.phrase.val(words); -- cgit v1.2.3