Skip to content

Commit

Permalink
Fill Passwordfield on Enter (Fixes passwordmaker#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
bitboxer committed Jul 28, 2011
1 parent 970a4a4 commit df84aff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
9 changes: 0 additions & 9 deletions css/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@ label {
font-size:15px;
}

#generated{
color: #5E80F0;
font-style: italic;
text-align: center;
width: 200px;
border: 1px solid #000000;
font-size:15px;
}

select {
margin: 0px;
width: 200px;
Expand Down
21 changes: 12 additions & 9 deletions javascript/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ function updateFields(e) {
$("#generatedForClipboard").val("");
}
setPasswordColors("#000000", "#FFFFFF")
// pressed enter in confirmation field
if(e && e.keyCode == 13){
chrome.tabs.sendRequest(currentTab, {hasPasswordField: true}, function(response) {
if (response.hasField) {
fillPassword();
}
});
}
}
if (Settings.keepMasterPasswordHash()) {
$("#confirmation_row").css('display', 'none');
Expand Down Expand Up @@ -118,6 +110,8 @@ function init(url) {
password = $("#password").val();
if (password == null || password.length == 0 || (password != $("#confirmation").val())) {
$("#password").focus();
} else {
$("#generated").focus();
}
});
}
Expand Down Expand Up @@ -148,7 +142,6 @@ $(function() {
$("#activatePassword").show();
} else {
$("#generated").show();
$("#generated").focus();
$("#activatePassword").hide();
}

Expand All @@ -160,6 +153,16 @@ $(function() {
}
}

$("#generated").keypress(function(event) {
if (event.keyCode == 13) {
chrome.tabs.sendRequest(currentTab, {hasPasswordField: true}, function(response) {
if (response.hasField) {
fillPassword();
}
});
}
});

chrome.windows.getCurrent(function(obj) {
chrome.tabs.getSelected(obj.id, function(tab) {
currentTab = tab.id;
Expand Down

0 comments on commit df84aff

Please sign in to comment.