mirror of
https://github.com/zumbiepig/MineXLauncher.git
synced 2025-06-08 09:24:48 +00:00
.
This commit is contained in:
parent
23316a0f20
commit
873a396049
@ -75,7 +75,7 @@
|
|||||||
<input type="checkbox" id="offline-checkbox" />
|
<input type="checkbox" id="offline-checkbox" />
|
||||||
</div> -->
|
</div> -->
|
||||||
<div class="settings-section">
|
<div class="settings-section">
|
||||||
<label for="ads-checkbox">Show ads (helps support us):</label>
|
<label for="ads-checkbox">Show ads:</label>
|
||||||
<input type="checkbox" id="ads-checkbox" />
|
<input type="checkbox" id="ads-checkbox" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,10 +7,9 @@ if (window.location.pathname === '/settings/') {
|
|||||||
const adsCheckbox = document.getElementById('ads-checkbox') as HTMLInputElement;
|
const adsCheckbox = document.getElementById('ads-checkbox') as HTMLInputElement;
|
||||||
|
|
||||||
usernameInput.placeholder = storage.local.get('username') ?? '';
|
usernameInput.placeholder = storage.local.get('username') ?? '';
|
||||||
themeSelect.value = storage.local.get('theme') ?? 'default';
|
themeSelect.value = storage.local.get('theme') ?? '';
|
||||||
// offlineCheckbox.checked = storage.local.get('offlineCache') ?? false;
|
// offlineCheckbox.checked = storage.local.get('offlineCache') ?? false;
|
||||||
const showAds = storage.local.get('showAds');
|
adsCheckbox.checked = storage.local.get('showAds');
|
||||||
adsCheckbox.checked = showAds === null ? true : showAds;
|
|
||||||
|
|
||||||
usernameInput.addEventListener('input', () => {
|
usernameInput.addEventListener('input', () => {
|
||||||
let username = usernameInput.value.replace(/[^A-Za-z0-9]/g, '_').substring(0, 16);
|
let username = usernameInput.value.replace(/[^A-Za-z0-9]/g, '_').substring(0, 16);
|
||||||
@ -42,24 +41,8 @@ if (window.location.pathname === '/settings/') {
|
|||||||
}); */
|
}); */
|
||||||
|
|
||||||
adsCheckbox.addEventListener('change', () => {
|
adsCheckbox.addEventListener('change', () => {
|
||||||
if (adsCheckbox.checked === false) {
|
storage.local.set('showAds', adsCheckbox.checked);
|
||||||
if (
|
|
||||||
prompt(
|
|
||||||
'Ads are the only source of income for this project, and they help keep the servers running.\n\nIf you really want to disable ads, join the Discord server and get the password to disable ads.'
|
|
||||||
) === 'zombie'
|
|
||||||
) {
|
|
||||||
storage.local.set('showAds', false);
|
|
||||||
alert('Ads have successfully been disabled.');
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
} else {
|
|
||||||
alert('Wrong password. Join the Discord server to get the password.');
|
|
||||||
adsCheckbox.checked = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
storage.local.set('showAds', true);
|
|
||||||
alert('Ads have been enabled. Thank you for supporting the project!');
|
|
||||||
window.location.reload();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user