From 1ee1a1ce54970479eaaa76bd06cfc0bd77d839da Mon Sep 17 00:00:00 2001 From: varjolintu Date: Sat, 27 May 2017 12:43:10 +0300 Subject: [PATCH] Redesigned password generator dialog --- chromeKeePassXC/background/httpauth.js | 6 +- chromeKeePassXC/background/keepass.js | 4 - chromeKeePassXC/background/page.js | 10 +- chromeKeePassXC/chromekeepassxc.css | 106 +++++++++-------- chromeKeePassXC/chromekeepassxc.js | 153 +++++++++++-------------- chromeKeePassXC/manifest.json | 2 +- chromeKeePassXC/options/options.js | 5 - chromeKeePassXC/popups/popup.html | 6 +- 8 files changed, 130 insertions(+), 162 deletions(-) diff --git a/chromeKeePassXC/background/httpauth.js b/chromeKeePassXC/background/httpauth.js index fe995b2..bd7223d 100644 --- a/chromeKeePassXC/background/httpauth.js +++ b/chromeKeePassXC/background/httpauth.js @@ -10,7 +10,7 @@ httpAuth.proxyUrl = null; httpAuth.handleRequest = function (details, callback) { - if(httpAuth.requestId == details.requestId || !page.tabs[details.tabId]) { + if (httpAuth.requestId == details.requestId || !page.tabs[details.tabId]) { callback({}); } else { @@ -26,7 +26,7 @@ httpAuth.processPendingCallbacks = function(details) { httpAuth.url = details.url; httpAuth.isProxy = details.isProxy; - if(details.challenger){ + if (details.challenger){ httpAuth.proxyUrl = details.challenger.host; } @@ -46,7 +46,7 @@ httpAuth.loginOrShowCredentials = function(logins) { event.onHTTPAuthPopup(null, {"id": httpAuth.tabId}, {"logins": logins, "url": url}); //generate popup-list for HTTP Auth usernames + descriptions - if(page.settings.autoFillAndSend) { + if (page.settings.autoFillAndSend) { httpAuth.callback({ authCredentials: { username: logins[0].login, diff --git a/chromeKeePassXC/background/keepass.js b/chromeKeePassXC/background/keepass.js index 9d4ad25..3100f97 100644 --- a/chromeKeePassXC/background/keepass.js +++ b/chromeKeePassXC/background/keepass.js @@ -606,10 +606,6 @@ keepass.deleteKey = function(hash) { localStorage.keyRing = JSON.stringify(keepass.keyRing); } -keepass.getIconColor = function() { - return ((keepass.databaseHash in keepass.keyRing) && keepass.keyRing[keepass.databaseHash].icon) ? keepass.keyRing[keepass.databaseHash].icon : "blue"; -} - keepass.setcurrentKeePassXCVersion = function(version) { if (version) { keepass.currentKeePassXC = { diff --git a/chromeKeePassXC/background/page.js b/chromeKeePassXC/background/page.js index 6c1a05e..0cbe005 100644 --- a/chromeKeePassXC/background/page.js +++ b/chromeKeePassXC/background/page.js @@ -19,19 +19,19 @@ page.initSettings = function() { page.settings.checkUpdateKeePassXC = 3; } if (!("autoCompleteUsernames" in page.settings)) { - page.settings.autoCompleteUsernames = 1; + page.settings.autoCompleteUsernames = true; } if (!("autoFillAndSend" in page.settings)) { - page.settings.autoFillAndSend = 1; + page.settings.autoFillAndSend = true; } if (!("usePasswordGenerator" in page.settings)) { - page.settings.usePasswordGenerator = 1; + page.settings.usePasswordGenerator = true; } if (!("autoFillSingleEntry" in page.settings)) { - page.settings.autoFillSingleEntry = 0; + page.settings.autoFillSingleEntry = false; } if (!("autoRetrieveCredentials" in page.settings)) { - page.settings.autoRetrieveCredentials = 1; + page.settings.autoRetrieveCredentials = true; } localStorage.settings = JSON.stringify(page.settings); } diff --git a/chromeKeePassXC/chromekeepassxc.css b/chromeKeePassXC/chromekeepassxc.css index 2ed1f9b..c1be006 100644 --- a/chromeKeePassXC/chromekeepassxc.css +++ b/chromeKeePassXC/chromekeepassxc.css @@ -6,38 +6,65 @@ font-family: Verdana, Arial, sans-serif !important; color: #222222 !important; } + .ui-dialog-titlebar-close { visibility: hidden !important; } -.cip-ui-widget-overlay { - background: none !important; - z-index: 2147483601 !important; -} -.cip-ui-dialog { - z-index: 2147483602 !important; -} -.cip-ui-dialog .cip-ui-dialog-title { - font-size:.8em !important; -} -.cip-ui-dialog .cip-ui-dialog-titlebar { - padding:.1em .5em !important; -} -.cip-ui-dialog-content { - font-size: .8em !important; + +.ui-dialog { + font-size: 12px !important; } -#cip-genpw-dialog { - text-align: left !important; +.dialog-form .ui-dialog-content .ui-widget-content { + max-height: 80px !important; } -#cip-genpw-dialog button { - height: 26px !important; + +.ui-dialog-titlebar { + background-color: #3a8233; + color: #fff; } -.cip-genpw-clearfix:after { - clear: both; - line-height: 0; - content: ""; + +.ui-dialog .ui-dialog-buttonpane { + text-align: center !important; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: none !important; +} + +.ui-button .ui-button-text .ui-button { + font-size: .10em !important; +} + +input.genpw-text { + font-size: .9em !important; + padding: .4em; + border-radius: 4px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-collapse: separate; + width: 100%; +} +.genpw-input-group-addon { + font-size: inherit !important; + background-color: #eee; + border: 1px solid #ccc; + padding: .4em; + border-radius: 4px; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + white-space: nowrap; + vertical-align: middle; + display: table-cell; + border-collapse: separate; +} + +.genpw-input-group { + position: relative; display: table; + border-collapse: separate; + width: 100%; } + .cip-genpw-icon { position: absolute; cursor: pointer; @@ -62,38 +89,7 @@ height: 24px; background-image: url(moz-extension://__MSG_@@extension_id__/icons/key_24x24.png); } -.cip-genpw-password-frame { - margin-top: 5px !important; - margin-bottom: 5px !important; -} -.cip-genpw-password-frame > * { - height: 20px !important; - font-size: 11px !important; -} -.cip-genpw-textfield { - background: none !important; - font-size: 11px !important; - display: inline !important; - border: 1px solid rgb(170, 170, 170) !important; - padding: 1px 2px !important; - max-width: none !important; - min-width: 0 !important; - font-size: 1em !important; - width: 240px !important; - padding-left: 5px !important; -} -#cip-genpw-quality { - width: 50px !important; - padding-top: 1px !important; - padding-bottom: 1px !important; -} -.cip-genpw-label { - display: block !important; - margin: 5px 0 !important; -} -.cip-genpw-checkbox { - vertical-align: middle !important; -} + #cip-genpw-btn-fillin { margin-right: 5px; } diff --git a/chromeKeePassXC/chromekeepassxc.js b/chromeKeePassXC/chromekeepassxc.js index da244fa..df17b7d 100644 --- a/chromeKeePassXC/chromekeepassxc.js +++ b/chromeKeePassXC/chromekeepassxc.js @@ -210,59 +210,28 @@ cipPassword.createDialog = function() { _called.passwordCreateDialog = true; var $dialog = jQuery("
") + .addClass("dialog-form") .attr("id", "cip-genpw-dialog"); - - var $divFloat = jQuery("
").addClass("cip-genpw-clearfix"); - var $btnGenerate = jQuery(" - +
You use an old version of KeePassXC. @@ -62,7 +62,7 @@ connected to KeePassXC.

- +
@@ -74,7 +74,7 @@

- +