mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-02-01 20:07:20 +01:00
Implemented: Hide donation button
This commit is contained in:
parent
176ddc1305
commit
7e2027db65
@ -80,7 +80,8 @@ const Setting = {
|
||||
'ALLOWED_DOMAINS_GOOGLE_FONTS': 'allowedDomainsGoogleFonts',
|
||||
'STORAGE_TYPE': 'storageType',
|
||||
'BADGE_COLOR': 'badgeColor',
|
||||
'BADGE_TEXT_COLOR': 'badgeTextColor'
|
||||
'BADGE_TEXT_COLOR': 'badgeTextColor',
|
||||
'HIDE_DONATION_BUTTON': 'hideDonationButton'
|
||||
};
|
||||
|
||||
const SettingDefaults = {
|
||||
@ -104,7 +105,8 @@ const SettingDefaults = {
|
||||
[Setting.ALLOWLISTED_DOMAINS]: {},
|
||||
[Setting.XHR_TEST_DOMAIN]: Address.LOCALCDN,
|
||||
[Setting.BADGE_COLOR]: '#4A826C',
|
||||
[Setting.BADGE_TEXT_COLOR]: '#FFFFFF'
|
||||
[Setting.BADGE_TEXT_COLOR]: '#FFFFFF',
|
||||
[Setting.HIDE_DONATION_BUTTON]: false
|
||||
};
|
||||
|
||||
const WebRequest = {
|
||||
|
@ -200,6 +200,8 @@ stateManager._handleStorageChanged = function (changes) {
|
||||
stateManager.internalStatistics = changes.internalStatistics.newValue;
|
||||
} else if (Setting.INTERNAL_STATISTICS_DATA in changes) {
|
||||
stats.data = changes.internalStatisticsData.newValue;
|
||||
} else if (Setting.HIDE_DONATION_BUTTON in changes) {
|
||||
stateManager.hideDonationButton = changes.hideDonationButton.newValue;
|
||||
}
|
||||
};
|
||||
|
||||
@ -248,6 +250,7 @@ stateManager.getInvertOption = false;
|
||||
stateManager.validHosts = [];
|
||||
stateManager.selectedIcon = 'Default';
|
||||
stateManager.internalStatistics = false;
|
||||
stateManager.hideDonationButton = false;
|
||||
|
||||
for (let mapping in mappings.cdn) {
|
||||
let supportedHost = Address.ANY_PROTOCOL + mapping + Address.ANY_PATH;
|
||||
|
@ -88,6 +88,15 @@
|
||||
</div>
|
||||
<div class="description-option" data-i18n-content="internalStatisticsDescription">No data transmission. It's all local on your device.</div>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="hideDonationButton" type="checkbox">
|
||||
<span data-i18n-content="hideDonationButton">Hide donation button</span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="option-group">
|
||||
<section class="option">
|
||||
|
@ -64,6 +64,7 @@ options._renderOptionsPanel = function () {
|
||||
'disablePrefetch': options._optionValues.disablePrefetch,
|
||||
'stripMetadata': options._optionValues.stripMetadata,
|
||||
'internalStatistics': options._internalStatistics,
|
||||
'hideDonationButton': options._optionValues.hideDonationButton,
|
||||
'allowlistedDomains': domainAllowlist
|
||||
};
|
||||
|
||||
|
@ -223,7 +223,7 @@ footer {
|
||||
#donate-button {
|
||||
color: #5f5f5f;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
display: none;
|
||||
float: right;
|
||||
font-size: 12px;
|
||||
-moz-user-select: none;
|
||||
|
@ -82,6 +82,10 @@ popup._renderNonContextualContents = function () {
|
||||
document.getElementById('logging-button').style.display = 'block';
|
||||
document.getElementById('logging-button').addEventListener('mouseup', popup._onLoggingButtonClicked);
|
||||
}
|
||||
|
||||
if (!popup.hideDonationButton) {
|
||||
document.getElementById('donate-button').style.display = 'flex';
|
||||
}
|
||||
};
|
||||
|
||||
popup._renderContextualContents = function () {
|
||||
|
@ -28,6 +28,7 @@
|
||||
<li>Fixed: Check status code in HTML filter (<a href="https://codeberg.org/nobody/LocalCDN/issues/277">#277</a>)</li>
|
||||
<li>Improved: "Website broken?" Link in popup menu (<a href="https://codeberg.org/nobody/LocalCDN/issues/278">#278</a>)</li>
|
||||
<li>Implemented: Simple logging page (<a href="https://codeberg.org/nobody/LocalCDN/issues/279">#279</a>)</li>
|
||||
<li>Implemented: Hide donation button</li>
|
||||
</ul>
|
||||
<div id="generator-section">
|
||||
<div class="topic-label">
|
||||
|
Loading…
x
Reference in New Issue
Block a user