Simplified the "display hidden settings" UI

Fixes #314
This commit is contained in:
kkapsner 2019-05-20 08:55:19 +02:00
parent e0dda5ec0f
commit 32fab79e09
4 changed files with 36 additions and 16 deletions

View File

@ -144,11 +144,11 @@
"description": "" "description": ""
}, },
"displayHiddenSettings_title": { "displayHiddenSettings_title": {
"message": "Versteckte Einstellungen anzeigen", "message": "Verborgene Einstellungen anzeigen",
"description": "" "description": ""
}, },
"displayHiddenSettings_description": { "displayHiddenSettings_description": {
"message": "Aktivieren, um versteckte Einstellungen anzuzeigen.", "message": "Aktivieren, um verborgene Einstellungen anzuzeigen.",
"description": "" "description": ""
}, },
"askForInvisiblePermission": { "askForInvisiblePermission": {

View File

@ -56,6 +56,23 @@ header .bookmarkNotice .dontShowOptionsOnUpdate input {
border-top: 1px solid #c1c1c1; border-top: 1px solid #c1c1c1;
position: relative; 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 { .settings .settingRow td:first-child .content, td.hideColumn label {
margin-left: 10px; margin-left: 10px;

View File

@ -411,28 +411,30 @@
function createThead(displayHidden, restContent){ function createThead(displayHidden, restContent){
const tHead = document.createElement("thead"); const tHead = document.createElement("thead");
const headRow = document.createElement("tr"); const searchRow = document.createElement("tr");
const hideHeadCell = document.createElement("td"); const hideHeadCell = document.createElement("td");
hideHeadCell.className = "hideColumn"; hideHeadCell.className = "hideColumn";
hideHeadCell.title = extension.getTranslation(displayHidden.name + "_description"); searchRow.appendChild(hideHeadCell);
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);
const restHeadCell = document.createElement("td"); const restHeadCell = document.createElement("td");
restHeadCell.colSpan = 2; restHeadCell.colSpan = 2;
if (restContent){ if (restContent){
restHeadCell.appendChild(restContent); restHeadCell.appendChild(restContent);
} }
headRow.appendChild(restHeadCell); searchRow.appendChild(restHeadCell);
tHead.appendChild(headRow); 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; return tHead;
} }

View File

@ -4,6 +4,7 @@ Version 0.5.9:
- made history length threshold url specific - made history length threshold url specific
- made navigator protection url specific - made navigator protection url specific
- uniform themes - uniform themes
- simplified the "display hidden settings" UI
new features: new features:
- added protection for navigator properties - added protection for navigator properties