Skip to content

Commit

Permalink
Merge pull request #148 from jhoenicke/master
Browse files Browse the repository at this point in the history
Add keyboard shortcut to copy password
  • Loading branch information
heavensrevenge committed Jun 15, 2015
2 parents 2cc75f3 + 5e8ca06 commit 34fd9dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion html/options.html
Expand Up @@ -350,7 +350,8 @@ <h2>Information</h2>
When you are done typing your master password in the <i>Password</i> textfield of the
PassworkMaker Pro popup, you can push <b>Enter</b> to fill the open website'spassword field
with the generated password, using the settings that were preselected in the
PasswordMaker Pro popup.<br><br>
PasswordMaker Pro popup. Alternatively, you can copy the generated password
to the clipboard by pressing <b>Ctrl+C</b>.<br><br>
If you do not have the <b>Keep Master Password Hash</b> setting enabled, pushing <b>Enter</b> or
<b>Tab</b> in the <i>Password</i> textfield will bring you to the <i>Confirmation</i> textfield. Here you can
then push <b>Enter</b>, after you are done typing your master password again, to fill the open
Expand Down
7 changes: 6 additions & 1 deletion javascript/popup.js
Expand Up @@ -141,6 +141,7 @@ function showButtons() {
}

function fillFields() {
updateFields();
if (!(/^chrome/i).test(Settings.currentUrl)) {
chrome.tabs.executeScript({
"allFrames": true,
Expand Down Expand Up @@ -170,6 +171,7 @@ function fillFields() {
}

function copyPassword() {
updateFields();
chrome.tabs.query({ "windowType": "popup" }, function() {
$("#activatePassword").hide();
$("#generated").show().get(0).select();
Expand Down Expand Up @@ -206,10 +208,13 @@ function enterKeyPressed(event) {
if ((/password/i).test($("#generated").val())) {
$("#password").focus();
} else {
updateFields();
fillFields();
}
}
// ctrl+C or option+C: copy password to clipboard
if ((event.ctrlKey || event.metaKey) && event.keyCode === 67) {
copyPassword();
}
}

function init() {
Expand Down

0 comments on commit 34fd9dc

Please sign in to comment.