Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
revoxhere authored Nov 5, 2023
1 parent e2c15e1 commit 3721001
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions 2023/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,7 @@ $(document).ready(function() {
}
}

if (!localStorage.getItem('halloween')) {
localStorage.setItem('halloween', "true");
localStorage.setItem('theme', "Halloween");
}

saved_theme = localStorage.getItem('theme');
if (saved_theme) {
$(`#theme_mobile option[value='${saved_theme}']`).prop('selected', true).change();
Expand Down Expand Up @@ -1580,7 +1577,6 @@ function logout() {
localStorage.removeItem("username");
localStorage.removeItem("authToken");
localStorage.removeItem("balance_history");
localStorage.removeItem("halloween");
location.reload()
}

Expand Down Expand Up @@ -1932,7 +1928,7 @@ function close_help() {
}

function adblock_alert() {
alert_bulma("Please disable your ad-blocking software. There is just a single ad space on this website and we have to pay the bills somehow.");
//alert_bulma("Please disable your ad-blocking software. There is just a single ad space on this website and we have to pay the bills somehow.");
}


Expand Down Expand Up @@ -2742,7 +2738,8 @@ $(document).keyup(function(e) {

function on_mobile() {
const ua = navigator.userAgent;
if (/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(ua)) {
if ($(window).width() >= 1024) return false;
if (/Mobile|Android|iP(hone|od|ad)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(ua)) {
return true;
}
return false;
Expand Down Expand Up @@ -3104,23 +3101,15 @@ $("#theme_desktop").on('change', function() {
if (selected_theme == "Terminal") {
$("#theme-terminal").attr('disabled', false);
$("#theme-glossy").attr('disabled', true);
$("#theme-halloween").attr('disabled', true);
localStorage.setItem('theme', 'Terminal');
} else if (selected_theme == "Glossy") {
$("#theme-terminal").attr('disabled', true);
$("#theme-glossy").attr('disabled', false);
$("#theme-halloween").attr('disabled', true);
localStorage.setItem('theme', 'Glossy');
} else if (selected_theme == "Halloween") {
$("#theme-terminal").attr('disabled', true);
$("#theme-glossy").attr('disabled', true);
$("#theme-halloween").attr('disabled', false);
localStorage.setItem('theme', 'Halloween');
} else {
// default adaptive - disable all
$("#theme-terminal").attr('disabled', true);
$("#theme-glossy").attr('disabled', true);
$("#theme-halloween").attr('disabled', true);
localStorage.setItem('theme', 'Adaptive');
}
});
Expand All @@ -3131,23 +3120,15 @@ $("#theme_mobile").on('change', function() {
if (selected_theme == "Terminal") {
$("#theme-terminal").attr('disabled', false);
$("#theme-glossy").attr('disabled', true);
$("#theme-halloween").attr('disabled', true);
localStorage.setItem('theme', 'Terminal');
} else if (selected_theme == "Glossy") {
$("#theme-terminal").attr('disabled', true);
$("#theme-glossy").attr('disabled', false);
$("#theme-halloween").attr('disabled', true);
localStorage.setItem('theme', 'Glossy');
} else if (selected_theme == "Halloween") {
$("#theme-terminal").attr('disabled', true);
$("#theme-glossy").attr('disabled', true);
$("#theme-halloween").attr('disabled', false);
localStorage.setItem('theme', 'Halloween');
} else {
// default adaptive - disable all
$("#theme-terminal").attr('disabled', true);
$("#theme-glossy").attr('disabled', true);
$("#theme-halloween").attr('disabled', true);
localStorage.setItem('theme', 'Adaptive');
}
});
Expand Down

0 comments on commit 3721001

Please sign in to comment.