From 5f898194f520645c771641de14b6228976e8db5c Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sat, 6 Jun 2026 20:34:56 +0100 Subject: [PATCH] Remove dead code --- frontend/js/fizika.js | 59 +++---------------------------------------- frontend/js/load.js | 39 +++++++++++++--------------- 2 files changed, 20 insertions(+), 78 deletions(-) diff --git a/frontend/js/fizika.js b/frontend/js/fizika.js index b104137..7efb99f 100644 --- a/frontend/js/fizika.js +++ b/frontend/js/fizika.js @@ -190,15 +190,6 @@ function teszt(id, correctAns) { } } -function scrollTo(where) { - $("html, body").animate( - { - scrollTop: $(where).offset().top - 100, - }, - 1000, - ); -} - function howMany() { var localString = "localStorage.teszt"; numberOfPreviousTests = 1; //number of previous tests+1 @@ -266,28 +257,13 @@ setInterval(function () { $(document).ready(function () { eredmeny(); - // Initialize year dropdown with dynamic years from question data - if (typeof initializeYearDropdown === "function") { - initializeYearDropdown().then(() => { - // Initialize month dropdown for default "all" year selection - if (typeof initializeMonthDropdown === "function") { - initializeMonthDropdown("all/"); - } - }); - } + // Populate the year dropdown, then the month dropdown for the default "all". + initializeYearDropdown().then(() => initializeMonthDropdown("all/")); $(window).on("mousewheel", function () { $("body").stop(); }); - $(document).ajaxError(function (event, jqxhr, settings) { - if (!settings.secondExec) { - settings.secondExec = true; - setTimeout(function () { - $.ajax(settings); - }, 500); - } - }); aspect(); $("#bfooldal").click(function () { @@ -333,36 +309,7 @@ $(document).ready(function () { isSearch = false; }); $("#evszam").change(function () { - const selectedYear = $("#evszam").val(); - - // Initialize month dropdown dynamically based on selected year - if (typeof initializeMonthDropdown === "function") { - initializeMonthDropdown(selectedYear); - } else { - // Fallback to original logic if dynamic function not available - if (selectedYear == "2006/") { - $(".f2006").show(); - $(".f2016").hide(); - $(".f").hide(); - $(".fnem17").hide(); - } else if (selectedYear == "2016/") { - $(".f2006").hide(); - $(".f2016").show(); - $(".f").show(); - $(".fnem17").show(); - } else if (selectedYear == "2017/") { - $(".f2006").hide(); - $(".f2016").hide(); - $(".f").show(); - $(".fnem17").hide(); - } else { - $(".f2006").hide(); - $(".f2016").hide(); - $(".f").show(); - $(".fnem17").show(); - } - } - + initializeMonthDropdown($("#evszam").val()); $("#honap").val("all"); }); diff --git a/frontend/js/load.js b/frontend/js/load.js index 0d36dfa..d387085 100644 --- a/frontend/js/load.js +++ b/frontend/js/load.js @@ -200,7 +200,7 @@ const initializeMonthDropdown = (selectedYear) => { // Convert to sorted array and create options const uniqueMonths = Array.from(monthSet).sort(); uniqueMonths.forEach((month) => { - monthOptions += ``; + monthOptions += ``; }); } else { // Extract year from selected value (e.g., "2024/" -> "2024") @@ -220,44 +220,39 @@ const initializeMonthDropdown = (selectedYear) => { // Special handling for known year patterns if (year === "2006") { // Preserve existing 2006 logic but add any new months found - monthOptions += - ''; - monthOptions += ''; - monthOptions += - ''; + monthOptions += ''; + monthOptions += ''; + monthOptions += ''; // Add any dynamic months not covered by the standard ones uniqueMonths.forEach((month) => { if (!["1", "2", "3"].includes(month)) { - monthOptions += ``; + monthOptions += ``; } }); } else if (year === "2016") { // Preserve existing 2016 logic but add any new months found - monthOptions += ''; - monthOptions += ''; - monthOptions += - ''; - monthOptions += - ''; - monthOptions += - ''; + monthOptions += ''; + monthOptions += ''; + monthOptions += ''; + monthOptions += ''; + monthOptions += ''; // Add any dynamic months not covered uniqueMonths.forEach((month) => { if (!["1", "2", "m1", "m2", "m3"].includes(month)) { - monthOptions += ``; + monthOptions += ``; } }); } else if (year === "2017") { // Preserve existing 2017 logic but add any new months found - monthOptions += ''; - monthOptions += ''; + monthOptions += ''; + monthOptions += ''; // Add any dynamic months uniqueMonths.forEach((month) => { if (!["1", "2"].includes(month)) { - monthOptions += ``; + monthOptions += ``; } }); } else { @@ -266,16 +261,16 @@ const initializeMonthDropdown = (selectedYear) => { const hasStandard2 = uniqueMonths.includes("2"); if (hasStandard1) { - monthOptions += ''; + monthOptions += ''; } if (hasStandard2) { - monthOptions += ''; + monthOptions += ''; } // Add any non-standard months uniqueMonths.forEach((month) => { if (!["1", "2"].includes(month)) { - monthOptions += ``; + monthOptions += ``; } }); }