diff options
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/index.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/js/index.js b/src/js/index.js index 9bd77b9..6a2fea6 100644 --- a/src/js/index.js +++ b/src/js/index.js | |||
@@ -38,6 +38,7 @@ | |||
38 | DOM.entropyWordCount = DOM.entropyContainer.find(".word-count"); | 38 | DOM.entropyWordCount = DOM.entropyContainer.find(".word-count"); |
39 | DOM.entropyBinary = DOM.entropyContainer.find(".binary"); | 39 | DOM.entropyBinary = DOM.entropyContainer.find(".binary"); |
40 | DOM.entropyMnemonicLength = DOM.entropyContainer.find(".mnemonic-length"); | 40 | DOM.entropyMnemonicLength = DOM.entropyContainer.find(".mnemonic-length"); |
41 | DOM.entropyFilterWarning = DOM.entropyContainer.find(".filter-warning"); | ||
41 | DOM.phrase = $(".phrase"); | 42 | DOM.phrase = $(".phrase"); |
42 | DOM.passphrase = $(".passphrase"); | 43 | DOM.passphrase = $(".passphrase"); |
43 | DOM.generateContainer = $(".generate-container"); | 44 | DOM.generateContainer = $(".generate-container"); |
@@ -1061,6 +1062,16 @@ | |||
1061 | DOM.entropyWordCount.text(wordCount); | 1062 | DOM.entropyWordCount.text(wordCount); |
1062 | DOM.entropyBinary.text(entropy.binaryStr); | 1063 | DOM.entropyBinary.text(entropy.binaryStr); |
1063 | DOM.entropyBitsPerEvent.text(bitsPerEvent); | 1064 | DOM.entropyBitsPerEvent.text(bitsPerEvent); |
1065 | // detect and warn of filtering | ||
1066 | var rawNoSpaces = DOM.entropy.val().replace(/\s/g, ""); | ||
1067 | var cleanNoSpaces = entropy.cleanStr.replace(/\s/g, ""); | ||
1068 | var isFiltered = rawNoSpaces.length != cleanNoSpaces.length; | ||
1069 | if (isFiltered) { | ||
1070 | DOM.entropyFilterWarning.removeClass('hidden'); | ||
1071 | } | ||
1072 | else { | ||
1073 | DOM.entropyFilterWarning.addClass('hidden'); | ||
1074 | } | ||
1064 | } | 1075 | } |
1065 | 1076 | ||
1066 | function getEntropyTypeStr(entropy) { | 1077 | function getEntropyTypeStr(entropy) { |