Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

Commit

Permalink
Merge pull request #27 from Sneezry/develop
Browse files Browse the repository at this point in the history
bugfix
  • Loading branch information
Sneezry committed Sep 2, 2015
2 parents 2890031 + 4205803 commit e751a8d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
5 changes: 3 additions & 2 deletions css/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ body {
opacity: 1;
}

#codes.edit .showqr {
#codes.edit .showqr,
.showqr.hidden {
display: none;
}

Expand Down Expand Up @@ -595,7 +596,7 @@ body {
}

#exportData {
height: 340px;
height: 330px;
width: 100%;
word-break: break-all;
resize: none;
Expand Down
20 changes: 20 additions & 0 deletions javascript/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,24 @@ document.getElementById('security_save').onclick = function () {
}
}

document.getElementById('phrase').onkeydown = function(e) {
if (e.keyCode === 13) {
var phrase = document.getElementById('phrase').value;
document.getElementById('phrase').value = '';
localStorage.notRememberPassphrase = (!document.getElementById('remeber_phrase').checked).toString();
document.getElementById('remeber_new_phrase').checked = document.getElementById('remeber_phrase').checked;
encryptSecret(phrase, false, function () {
document.getElementById('passphrase').className = 'fadeout';
setTimeout(function () {
document.getElementById('passphrase').className = '';
document.getElementById('passphrase').style.opacity = 0;
}, 200);
}, function () {
showMessage(chrome.i18n.getMessage('phrase_incorrect'));
});
}
}

document.getElementById('passphrase_ok').onclick = function () {
var phrase = document.getElementById('phrase').value;
document.getElementById('phrase').value = '';
Expand Down Expand Up @@ -515,6 +533,7 @@ function updateCode() {
for (var i = 0; i < _secret.length; i++) {
if (!_secret[i].secret) {
document.getElementById('code-' + i).innerText = chrome.i18n.getMessage('encrypted');
document.getElementById('showqr-' + i).className = 'showqr hidden';
if (!shownPassphrase) {
shownPassphrase = true;
document.getElementById('passphrase').className = 'fadein';
Expand All @@ -524,6 +543,7 @@ function updateCode() {
}
} else if (_secret[i].type !== 'hotp') {
document.getElementById('code-' + i).innerText = getCode(_secret[i].secret);
document.getElementById('showqr-' + i).className = 'showqr';
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "__MSG_extName__",
"short_name": "__MSG_extShortName__",
"version": "4.15",
"version": "4.16",
"default_locale": "en",
"description": "__MSG_extDesc__",
"icons": {
Expand Down
4 changes: 4 additions & 0 deletions totp/totp.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ var KeyUtilities = function() {
hex = hex + parseInt(chunk, 2).toString(16);
}

if (hex.length % 2 && hex[hex.length - 1] === '0') {
hex = hex.substr(0, hex.length - 1);
}

return hex;
};

Expand Down

0 comments on commit e751a8d

Please sign in to comment.