1
0
mirror of https://github.com/S2-/pwgen.git synced 2025-08-03 01:00:04 +02:00

5 Commits

Author SHA1 Message Date
s2
fcceca980c v1.1.8 2017-11-21 19:44:29 +01:00
s2
59094b76bb increment delay to 200ms 2017-11-21 19:44:03 +01:00
s2
6c773377b1 v1.1.7 2017-11-21 19:33:35 +01:00
s2
b0932baeea add timeout before copying password 2017-11-21 19:33:09 +01:00
s2
81d5bbb055 add a margin 2017-11-21 15:39:56 +01:00
4 changed files with 38 additions and 26 deletions

View File

@@ -2,7 +2,7 @@
"description": "Just a toolbar button that generates a password and copies it to your clipboard.",
"manifest_version": 2,
"name": "pwgen reloaded",
"version": "1.1.6",
"version": "1.1.8",
"homepage_url": "https://github.com/S2-/pwgen",
"icons": {
"48": "icons/lock-48.png"

View File

@@ -2,6 +2,10 @@ body {
margin: 15px;
}
div {
margin-top: 5px;
}
input[type="number"] {
-moz-appearance: none;
color: var(--in-content-text-color);

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="chrome://global/skin/global.css" type="text/css" />
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css" type="text/css" />

View File

@@ -35,30 +35,34 @@ function saveOptions(options) {
}
function copypasstoclippboard() {
setTimeout(function() {
var copyText = document.getElementById('pw');
copyText.select();
document.execCommand('copy');
}, 200);
}
document.getElementById('new').addEventListener('click', (ev) => {
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('new').addEventListener('click', (ev) => {
ev.preventDefault();
var params = getParams();
document.getElementById('pw').value = randPassword(params.length, params.special);
});
});
document.getElementById('copy').addEventListener('click', (ev) => {
document.getElementById('copy').addEventListener('click', (ev) => {
ev.preventDefault();
copypasstoclippboard();
});
});
var list = document.getElementsByTagName('input');
for (var i = 0; i < list.length; i++) {
var list = document.getElementsByTagName('input');
for (var i = 0; i < list.length; i++) {
list[i].addEventListener('change', (ev) => {
saveOptions(getParams());
});
}
}
loadOptions().then((options) => {
loadOptions().then((options) => {
document.getElementById('length').value = options.length;
document.getElementById('special').checked = options.special;
document.getElementById('directcopy').checked = options.directcopy;
@@ -67,4 +71,7 @@ loadOptions().then((options) => {
if (options.directcopy) {
copypasstoclippboard();
}
});
});