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
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
3 changed files with 20 additions and 0 deletions

View File

@ -165,6 +165,7 @@
<div class="html-filter-section">
<section class="option">
<div id="html-filter-domains-title-exclude" class="title-option without-checkbox" data-i18n-content="htmlFilterDomainsTitleExclude">Do not apply HTML-Filter to these domains:</div>
<div id="html-filter-domains-title-include" class="title-option without-checkbox" data-i18n-content="htmlFilterDomainsTitleInclude">Apply HTML-Filter for these domains:</div>
<input class="input-text without-checkbox" data-option="domainsManipulateDOM" type="text">
<div class="description-option without-checkbox" data-i18n-content="htmlFilterDomainsDescription">Enter domains for HTML filter. Separate multiple entries with semi-colons (;).</div>
</section>

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
});

View File

@ -41,6 +41,7 @@
<li>Added: libphonenumber-js v1.7.53 (reported by email)</li>
<li>Added: Bootstrap 3 Typeahead v4.0.2 (reported by email)</li>
<li>Added: Chart.js (JS-Bundle & CSS) v2.9.3 (reported by email)</li>
<li>Improved: Option to enable HTML-Filter by default (<a href="https://codeberg.org/nobody/LocalCDN/issues/33">#33</a>)</li>
</ul>
<div class="topic-label">
Generate rule sets for uBlock or uMatrix