Skip to content

Commit cc363fc

Browse files
authored
Merge pull request #674 from rgantzos/main
2 parents a7a708e + 4cfcf66 commit cc363fc

3 files changed

Lines changed: 76 additions & 1 deletion

File tree

extras/popup/popup.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,3 +429,29 @@ span.new-feature-tag.beta {
429429
transform: scale(1.5);
430430
top: 0.1rem;
431431
}
432+
433+
.special-switch {
434+
position: relative;
435+
width: 55px;
436+
height: 28px;
437+
transform: scale(80%);
438+
float: right;
439+
position: relative;
440+
top: -0.25rem;
441+
margin: 0px;
442+
}
443+
444+
.feature table,
445+
.feature table tr {
446+
width: 100%;
447+
}
448+
449+
.feature table {
450+
margin-top: .5rem;
451+
}
452+
453+
.special-switch input {
454+
opacity: 0;
455+
width: 0;
456+
height: 0;
457+
}

extras/popup/popup.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,11 +682,34 @@ async function getFeatures() {
682682
input.type = ["text", "checkbox", "number", "color"][option.type || 0];
683683
var optionData = (await chrome.storage.sync.get(option.id))[option.id];
684684
input.value = optionData || "";
685+
if (input.type === "checkbox") {
686+
var specialLabel = document.createElement("label");
687+
specialLabel.className = "special-switch";
688+
input.className = "checkbox"
689+
var span = document.createElement("span");
690+
span.className = "slider round";
691+
specialLabel.appendChild(input);
692+
specialLabel.appendChild(span);
693+
} else {
685694
div.appendChild(input);
695+
}
686696
if (input.type === "checkbox") {
697+
let table = document.createElement("table")
698+
let tr = document.createElement("tr")
699+
table.appendChild(tr)
700+
701+
let td1 = document.createElement("td")
702+
tr.appendChild(td1)
703+
let td2 = document.createElement("td")
704+
tr.appendChild(td2)
705+
706+
div.appendChild(table)
707+
687708
var label = document.createElement("label");
688709
label.textContent = option.name;
689-
div.appendChild(label);
710+
label.style.marginLeft = "0px"
711+
td1.appendChild(label);
712+
td2.appendChild(specialLabel)
690713
input.checked = optionData || false;
691714
}
692715
input.dataset.validation = btoa(

extras/style.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,3 +783,29 @@ span.new-feature-tag.beta {
783783
transform: scale(1.8);
784784
cursor: pointer;
785785
}
786+
787+
.special-switch {
788+
position: relative;
789+
width: 55px;
790+
height: 28px;
791+
margin: 0px;
792+
transform: scale(80%);
793+
float: right;
794+
position: relative;
795+
top: -0.25rem;
796+
}
797+
798+
.feature table,
799+
.feature table tr {
800+
width: 100%;
801+
}
802+
803+
.special-switch input {
804+
opacity: 0;
805+
width: 0;
806+
height: 0;
807+
}
808+
809+
.feature table {
810+
margin-top: .5rem;
811+
}

0 commit comments

Comments
 (0)