From 6bd531a7cf99802eb4be902a2c32ba2767168a3d Mon Sep 17 00:00:00 2001 From: varjolintu Date: Sun, 2 Mar 2025 10:14:48 +0200 Subject: [PATCH] Allow editing Site Preferences table --- keepassxc-browser/_locales/en/messages.json | 8 ++ keepassxc-browser/options/options.css | 37 ++++++++- keepassxc-browser/options/options.html | 18 ++++- keepassxc-browser/options/options.js | 88 ++++++++++++++++++++- 4 files changed, 146 insertions(+), 5 deletions(-) diff --git a/keepassxc-browser/_locales/en/messages.json b/keepassxc-browser/_locales/en/messages.json index ecfa3c7..7a9e078 100644 --- a/keepassxc-browser/_locales/en/messages.json +++ b/keepassxc-browser/_locales/en/messages.json @@ -7,6 +7,10 @@ "message": "Add Site Preferences for this URL.", "description": "Add button title text on Site Preferences tab." }, + "editSitePreferenceButtonTitle": { + "message": "Edit URL for this Site Preferences.", + "description": "Edit button title text on Site Preferences tab." + }, "allowIframeButtonTitle": { "message": "Allows Cross-Origin iframes for the current page.", "description": "Allow Cross-Origin iframes button title text." @@ -686,6 +690,10 @@ "message": "Add", "description": "Add button text." }, + "optionsButtonEdit": { + "message": "Edit", + "description": "Edit button text." + }, "optionsButtonUpdate": { "message": "Check for updates", "description": "Check for updates button text." diff --git a/keepassxc-browser/options/options.css b/keepassxc-browser/options/options.css index da74ffe..b0dbe4a 100644 --- a/keepassxc-browser/options/options.css +++ b/keepassxc-browser/options/options.css @@ -51,7 +51,7 @@ input:invalid { border: 2px solid red; } -input[disabled] { +input:disabled { opacity: .3!important; } @@ -112,6 +112,18 @@ tbody { background-color: var(--kpxc-checkbox-background-color) !important; } +.table-striped > tbody > tr:nth-of-type(even) input[type="url"] { + --bs-table-bg-type: var(--kpxc-card-background-color) !important; + background-color: var(--kpxc-card-background-color) !important; + color: var(--kpxc-text-color) !important; +} + +.table-striped > tbody > tr:nth-of-type(odd) input[type="url"] { + --bs-table-bg-type: var(--kpxc-table-odd-color) !important; + background-color: var(--kpxc-table-odd-color) !important; + color: var(--kpxc-text-color) !important; +} + .table tbody td { vertical-align: middle; } @@ -213,6 +225,29 @@ table td:last-of-type { color: var(--kpxc-text-color); } +.site-preferences-input { + border: 0; + border-bottom-right-radius: 4px !important; + border-top-right-radius: 4px !important; +} + +.site-preferences-input:disabled { + opacity: 1 !important; + pointer-events: none; +} + +button#sitePreferencesEditUrl { + border-bottom-left-radius: 4px !important; + border-bottom-right-radius: 4px !important; + border-top-left-radius: 4px !important; + border-top-right-radius: 4px !important; +} + +button#sitePreferencesCancelEdit { + border-bottom-left-radius: 4px !important; + border-top-left-radius: 4px !important; +} + @media (min-width: 768px) { .sidebar { height: auto; diff --git a/keepassxc-browser/options/options.html b/keepassxc-browser/options/options.html index 366e521..6bf76e5 100644 --- a/keepassxc-browser/options/options.html +++ b/keepassxc-browser/options/options.html @@ -760,7 +760,23 @@ - + +
+ + + + +
+