mirror of
https://github.com/zumbiepig/MineXLauncher.git
synced 2025-06-08 09:24:48 +00:00
.
This commit is contained in:
parent
e39346a2eb
commit
43b52601ad
@ -74,6 +74,10 @@
|
||||
<label for="offline-checkbox">Enable offline use:</label>
|
||||
<input type="checkbox" id="offline-checkbox" />
|
||||
</div> -->
|
||||
<div class="settings-section">
|
||||
<label for="ads-checkbox">Show ads (helps support us):</label>
|
||||
<input type="checkbox" id="ads-checkbox" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -4,10 +4,12 @@ if (window.location.pathname === '/settings/') {
|
||||
const usernameInput = document.getElementById('username-input') as HTMLInputElement;
|
||||
const themeSelect = document.getElementById('theme-select') as HTMLSelectElement;
|
||||
// const offlineCheckbox = document.getElementById('offline-checkbox') as HTMLInputElement;
|
||||
const adsCheckbox = document.getElementById('ads-checkbox') as HTMLInputElement;
|
||||
|
||||
usernameInput.placeholder = storage.local.get('username') ?? '';
|
||||
themeSelect.value = storage.local.get('theme') ?? '';
|
||||
themeSelect.value = storage.local.get('theme') ?? 'default';
|
||||
// offlineCheckbox.checked = storage.local.get('offlineCache') ?? false;
|
||||
adsCheckbox.checked = storage.local.get('showAds') ?? true;
|
||||
|
||||
usernameInput.addEventListener('input', () => {
|
||||
let username = usernameInput.value.replace(/[^A-Za-z0-9]/g, '_').substring(0, 16);
|
||||
@ -37,6 +39,25 @@ if (window.location.pathname === '/settings/') {
|
||||
alert('Offline cache has been deleted.');
|
||||
}
|
||||
}); */
|
||||
|
||||
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', true);
|
||||
alert('Ads have been disabled. Reload the page to apply the changes.');
|
||||
} 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!');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -73,6 +94,7 @@ if (window.location.pathname === '/welcome/') {
|
||||
storage.local.set('username', username);
|
||||
storage.local.set('theme', themeSelect.value);
|
||||
// storage.local.set('offlineCache', offlineCheckbox.checked);
|
||||
storage.local.set('showAds', true);
|
||||
storage.local.set('lastVersion', launcherVersion);
|
||||
|
||||
/* if (offlineCheckbox.checked) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user