1
0
mirror of https://github.com/zumbiepig/MineXLauncher.git synced 2025-06-08 08:34:48 +00:00
This commit is contained in:
zumbiepig 2024-08-21 16:37:07 -07:00
parent 23316a0f20
commit 873a396049
No known key found for this signature in database
GPG Key ID: 17C891BE28B953DE
2 changed files with 5 additions and 22 deletions

View File

@ -75,7 +75,7 @@
<input type="checkbox" id="offline-checkbox" />
</div> -->
<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" />
</div>
</div>

View File

@ -7,10 +7,9 @@ if (window.location.pathname === '/settings/') {
const adsCheckbox = document.getElementById('ads-checkbox') as HTMLInputElement;
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;
const showAds = storage.local.get('showAds');
adsCheckbox.checked = showAds === null ? true : showAds;
adsCheckbox.checked = storage.local.get('showAds');
usernameInput.addEventListener('input', () => {
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', () => {
if (adsCheckbox.checked === false) {
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();
} 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();
}
storage.local.set('showAds', adsCheckbox.checked);
window.location.reload();
});
});
}