From 32fab79e09e4ff2e005d6ea51b357511c49c9d04 Mon Sep 17 00:00:00 2001 From: kkapsner Date: Mon, 20 May 2019 08:55:19 +0200 Subject: [PATCH] Simplified the "display hidden settings" UI Fixes #314 --- _locales/de/messages.json | 4 ++-- options/options.css | 17 +++++++++++++++++ options/optionsGui.js | 30 ++++++++++++++++-------------- releaseNotes.txt | 1 + 4 files changed, 36 insertions(+), 16 deletions(-) diff --git a/_locales/de/messages.json b/_locales/de/messages.json index d5253f7..0e8f02b 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -144,11 +144,11 @@ "description": "" }, "displayHiddenSettings_title": { - "message": "Versteckte Einstellungen anzeigen", + "message": "Verborgene Einstellungen anzeigen", "description": "" }, "displayHiddenSettings_description": { - "message": "Aktivieren, um versteckte Einstellungen anzuzeigen.", + "message": "Aktivieren, um verborgene Einstellungen anzuzeigen.", "description": "" }, "askForInvisiblePermission": { diff --git a/options/options.css b/options/options.css index 1089163..122d3eb 100644 --- a/options/options.css +++ b/options/options.css @@ -56,6 +56,23 @@ header .bookmarkNotice .dontShowOptionsOnUpdate input { border-top: 1px solid #c1c1c1; position: relative; } +.settings .settingRow.displayHiddenRow td { + position: relative; +} +.settings .settingRow.displayHiddenRow { + display: table-row; +} +.settings .settingRow.displayHiddenRow .content { + border-top: 0px solid #c1c1c1; + border-bottom: 1px solid #c1c1c1; +} +.settings .settingRow.displayHiddenRow td + td + td .content { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +} .settings .settingRow td:first-child .content, td.hideColumn label { margin-left: 10px; diff --git a/options/optionsGui.js b/options/optionsGui.js index 7cb4f5a..c696885 100644 --- a/options/optionsGui.js +++ b/options/optionsGui.js @@ -411,28 +411,30 @@ function createThead(displayHidden, restContent){ const tHead = document.createElement("thead"); - const headRow = document.createElement("tr"); + const searchRow = document.createElement("tr"); const hideHeadCell = document.createElement("td"); hideHeadCell.className = "hideColumn"; - hideHeadCell.title = extension.getTranslation(displayHidden.name + "_description"); - const label = document.createElement("label"); - label.className = "hideContent"; - const input = createInput(displayHidden); - input.className = "displayHidden"; - label.appendChild(input); - const display = document.createElement("span"); - display.className = "display"; - label.appendChild(display); - hideHeadCell.appendChild(label); - headRow.appendChild(hideHeadCell); + searchRow.appendChild(hideHeadCell); const restHeadCell = document.createElement("td"); restHeadCell.colSpan = 2; if (restContent){ restHeadCell.appendChild(restContent); } - headRow.appendChild(restHeadCell); - tHead.appendChild(headRow); + searchRow.appendChild(restHeadCell); + tHead.appendChild(searchRow); + + const displayHiddenRow = document.createElement("tr"); + displayHiddenRow.className = "settingRow displayHiddenRow"; + displayHiddenRow.appendChild(hideHeadCell.cloneNode()); + const displayHiddenDescription = document.createElement("td"); + displayHiddenDescription.appendChild(createDescription(displayHidden)); + displayHiddenRow.appendChild(displayHiddenDescription); + + var displayHiddenInteraction = document.createElement("td"); + displayHiddenInteraction.appendChild(createInteraction(displayHidden)); + displayHiddenRow.appendChild(displayHiddenInteraction); + tHead.appendChild(displayHiddenRow); return tHead; } diff --git a/releaseNotes.txt b/releaseNotes.txt index 4eeb061..1ce1a0e 100644 --- a/releaseNotes.txt +++ b/releaseNotes.txt @@ -4,6 +4,7 @@ Version 0.5.9: - made history length threshold url specific - made navigator protection url specific - uniform themes + - simplified the "display hidden settings" UI new features: - added protection for navigator properties