1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2025-06-05 21:49:31 +02:00

Option to enable HTML-Filter by default improved (#33)

This commit is contained in:
nobody
2020-06-26 19:49:34 +02:00
parent 05a1e30ab4
commit 7a576059d8
3 changed files with 20 additions and 0 deletions

View File

@@ -72,6 +72,14 @@ options._renderOptionsPanel = function () {
options._renderLocaleNotice();
}
if(elements.negateHtmlFilterList.checked === true) {
document.getElementById('html-filter-domains-title-include').style.display = "none";
document.getElementById('html-filter-domains-title-exclude').style.display = "block";
} else {
document.getElementById('html-filter-domains-title-include').style.display = "block";
document.getElementById('html-filter-domains-title-exclude').style.display = "none";
}
document.getElementById('last-mapping-update').textContent += ' ' + lastMappingUpdate;
document.getElementById('negate-html-filter-list-warning').addEventListener('click', options._onClickHTMLFilterWarning);
};
@@ -252,6 +260,16 @@ options._onOptionChanged = function ({target}) {
optionValue = options._parseDomainWhitelist(optionValue);
}
if (optionKey === Setting.NEGATE_HTML_FILTER_LIST) {
if(optionValue === true) {
document.getElementById('html-filter-domains-title-include').style.display = "none";
document.getElementById('html-filter-domains-title-exclude').style.display = "block";
} else {
document.getElementById('html-filter-domains-title-include').style.display = "block";
document.getElementById('html-filter-domains-title-exclude').style.display = "none";
}
}
chrome.storage.sync.set({
[optionKey]: optionValue
});