diff options
author | Ian Coleman <coleman.ian@gmail.com> | 2016-12-15 11:39:44 +1100 |
---|---|---|
committer | Ian Coleman <coleman.ian@gmail.com> | 2016-12-15 11:39:44 +1100 |
commit | 97811c294cc2b89b2923c206cc918a5c9a4f9fc9 (patch) | |
tree | 3dde618295e8a29d734e8248065234a8f721ea68 /src | |
parent | ede5137f6eafa4519830920765284b826e252a2f (diff) | |
download | BIP39-97811c294cc2b89b2923c206cc918a5c9a4f9fc9.tar.gz BIP39-97811c294cc2b89b2923c206cc918a5c9a4f9fc9.tar.zst BIP39-97811c294cc2b89b2923c206cc918a5c9a4f9fc9.zip |
QR code warns for scanners that keep history
Diffstat (limited to 'src')
-rw-r--r-- | src/index.html | 9 | ||||
-rw-r--r-- | src/js/index.js | 8 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/index.html b/src/index.html index 10fd62a..71df82a 100644 --- a/src/index.html +++ b/src/index.html | |||
@@ -92,8 +92,10 @@ | |||
92 | .qr-image { | 92 | .qr-image { |
93 | margin: 5px; | 93 | margin: 5px; |
94 | } | 94 | } |
95 | .qr-hint { | 95 | .qr-hint, |
96 | .qr-warning { | ||
96 | padding: 2px; | 97 | padding: 2px; |
98 | max-width: 150px; | ||
97 | } | 99 | } |
98 | .more-info { | 100 | .more-info { |
99 | cursor: help; | 101 | cursor: help; |
@@ -623,7 +625,10 @@ | |||
623 | <div class="qr-container hidden"> | 625 | <div class="qr-container hidden"> |
624 | <div class="qr-hint bg-primary" data-translate>Click field to hide QR</div> | 626 | <div class="qr-hint bg-primary" data-translate>Click field to hide QR</div> |
625 | <div class="qr-hint bg-primary hidden" data-translate>Click field to show QR</div> | 627 | <div class="qr-hint bg-primary hidden" data-translate>Click field to show QR</div> |
626 | <div class="qr-image"></div> | 628 | <div class="qr-hider"> |
629 | <div class="qr-image"></div> | ||
630 | <div class="qr-warning bg-primary" data-translate>Caution: Scanner may keep history</div> | ||
631 | </div> | ||
627 | </div> | 632 | </div> |
628 | 633 | ||
629 | <div class="feedback-container"> | 634 | <div class="feedback-container"> |
diff --git a/src/js/index.js b/src/js/index.js index 748a2ba..04559d1 100644 --- a/src/js/index.js +++ b/src/js/index.js | |||
@@ -67,6 +67,7 @@ | |||
67 | DOM.privateKeyToggle = $(".private-key-toggle"); | 67 | DOM.privateKeyToggle = $(".private-key-toggle"); |
68 | DOM.languages = $(".languages a"); | 68 | DOM.languages = $(".languages a"); |
69 | DOM.qrContainer = $(".qr-container"); | 69 | DOM.qrContainer = $(".qr-container"); |
70 | DOM.qrHider = DOM.qrContainer.find(".qr-hider"); | ||
70 | DOM.qrImage = DOM.qrContainer.find(".qr-image"); | 71 | DOM.qrImage = DOM.qrContainer.find(".qr-image"); |
71 | DOM.qrHint = DOM.qrContainer.find(".qr-hint"); | 72 | DOM.qrHint = DOM.qrContainer.find(".qr-hint"); |
72 | DOM.showQrEls = $("[data-show-qr]"); | 73 | DOM.showQrEls = $("[data-show-qr]"); |
@@ -946,7 +947,10 @@ | |||
946 | var size = 130; | 947 | var size = 130; |
947 | DOM.qrImage.qrcode({width: size, height: size, text: content}); | 948 | DOM.qrImage.qrcode({width: size, height: size, text: content}); |
948 | if (!showQr) { | 949 | if (!showQr) { |
949 | DOM.qrImage.addClass("hidden"); | 950 | DOM.qrHider.addClass("hidden"); |
951 | } | ||
952 | else { | ||
953 | DOM.qrHider.removeClass("hidden"); | ||
950 | } | 954 | } |
951 | DOM.qrContainer.removeClass("hidden"); | 955 | DOM.qrContainer.removeClass("hidden"); |
952 | } | 956 | } |
@@ -959,7 +963,7 @@ | |||
959 | 963 | ||
960 | function toggleQr() { | 964 | function toggleQr() { |
961 | showQr = !showQr; | 965 | showQr = !showQr; |
962 | DOM.qrImage.toggleClass("hidden"); | 966 | DOM.qrHider.toggleClass("hidden"); |
963 | DOM.qrHint.toggleClass("hidden"); | 967 | DOM.qrHint.toggleClass("hidden"); |
964 | } | 968 | } |
965 | 969 | ||