mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 04:26:35 +02:00
Added option "Don't show again on update." for options page.
Fixes #227.
This commit is contained in:
parent
34019f2515
commit
cedd2137e2
7 changed files with 48 additions and 2 deletions
|
@ -13,6 +13,12 @@ header .bookmarkNotice {
|
|||
color: #880000;
|
||||
}
|
||||
|
||||
header .bookmarkNotice .dontShowOptionsOnUpdate {
|
||||
display: block;
|
||||
margin-top: 0.5em;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
.settings {
|
||||
width: 100%;
|
||||
border-spacing: 0;
|
||||
|
|
|
@ -65,7 +65,30 @@
|
|||
let bookmarkingNotice = document.createElement("div");
|
||||
bookmarkingNotice.className = noticeName + " bookmarkNotice";
|
||||
bookmarkingNotice.textContent = notice;
|
||||
|
||||
const dontShowAgain = document.createElement("label");
|
||||
dontShowAgain.className = "dontShowOptionsOnUpdate";
|
||||
const dontShowAgainInput = document.createElement("input");
|
||||
dontShowAgainInput.type = "checkbox";
|
||||
settings.onloaded(function(){
|
||||
dontShowAgainInput.checked = settings.dontShowOptionsOnUpdate;
|
||||
});
|
||||
dontShowAgainInput.addEventListener("change", function(){
|
||||
settings.dontShowOptionsOnUpdate = this.checked;
|
||||
});
|
||||
dontShowAgain.appendChild(dontShowAgainInput);
|
||||
dontShowAgain.appendChild(
|
||||
document.createTextNode(
|
||||
browser.i18n.getMessage("dontShowOptionsOnUpdate")
|
||||
)
|
||||
);
|
||||
bookmarkingNotice.appendChild(dontShowAgain);
|
||||
|
||||
head.appendChild(bookmarkingNotice);
|
||||
|
||||
const newUrl = new URL(window.location.href);
|
||||
newUrl.search = "";
|
||||
window.history.pushState({}, "", newUrl.href);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue