Skip to content

Commit

Permalink
update to v1.1.8
Browse files Browse the repository at this point in the history
1. change the onload function load method
  • Loading branch information
Mike Tang committed Oct 26, 2016
1 parent 60d2570 commit 1bbbaf0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions lib/mcommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,24 @@ function decodeBase64(content) {


// add enter to decrypt
window.onload = function() {
addLoadEvent(function() {
console.log('register');
document.getElementById("pass").onkeypress = function(keyPressEvent) {
console.log(keyPressEvent.keyCode === 13);
if (keyPressEvent.keyCode === 13) {
decryptAES();
}
};
};
});

function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "1.1.7"
"version": "1.1.8"
}

0 comments on commit 1bbbaf0

Please sign in to comment.