From 663671f9e483dc5e8373e6bda65a19f4e587c69a Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sun, 31 Aug 2025 14:58:06 +0100 Subject: [PATCH] fix cors --- frontend/js/load.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/frontend/js/load.js b/frontend/js/load.js index 57fe525..1da2bef 100644 --- a/frontend/js/load.js +++ b/frontend/js/load.js @@ -68,7 +68,7 @@ const loadQuestions = async (

${i + 1}.

${source}

${description}
- ${image ? `
` : ""} + ${image ? `
` : ""}
@@ -169,14 +169,14 @@ const initializeYearDropdown = async () => { // Preserve the "Összes év" option and add dynamic years const allYearsOption = ''; - const yearOptions = uniqueYears.map(year => + const yearOptions = uniqueYears.map(year => `` ).join(''); yearDropdown.innerHTML = allYearsOption + yearOptions; - + console.log('Year dropdown initialized with years:', uniqueYears); - + } catch (error) { console.error('Failed to initialize year dropdown:', error); } @@ -211,7 +211,7 @@ const initializeMonthDropdown = (selectedYear) => { } else { // Extract year from selected value (e.g., "2024/" -> "2024") const year = selectedYear.replace('/', ''); - + // Get unique months for this specific year const monthSet = new Set(); questions.forEach(q => { @@ -222,21 +222,21 @@ const initializeMonthDropdown = (selectedYear) => { }); const uniqueMonths = Array.from(monthSet).sort(); - + // Special handling for known year patterns if (year === '2006') { // Preserve existing 2006 logic but add any new months found monthOptions += ''; monthOptions += ''; monthOptions += ''; - + // Add any dynamic months not covered by the standard ones uniqueMonths.forEach(month => { if (!['1', '2', '3'].includes(month)) { monthOptions += ``; } }); - + } else if (year === '2016') { // Preserve existing 2016 logic but add any new months found monthOptions += ''; @@ -244,38 +244,38 @@ const initializeMonthDropdown = (selectedYear) => { monthOptions += ''; monthOptions += ''; monthOptions += ''; - + // Add any dynamic months not covered uniqueMonths.forEach(month => { if (!['1', '2', 'm1', 'm2', 'm3'].includes(month)) { monthOptions += ``; } }); - + } else if (year === '2017') { // Preserve existing 2017 logic but add any new months found monthOptions += ''; monthOptions += ''; - + // Add any dynamic months uniqueMonths.forEach(month => { if (!['1', '2'].includes(month)) { monthOptions += ``; } }); - + } else { // For other years, use standard logic plus dynamic months const hasStandard1 = uniqueMonths.includes('1'); const hasStandard2 = uniqueMonths.includes('2'); - + if (hasStandard1) { monthOptions += ''; } if (hasStandard2) { monthOptions += ''; } - + // Add any non-standard months uniqueMonths.forEach(month => { if (!['1', '2'].includes(month)) { @@ -294,12 +294,12 @@ const getMonthLabel = (monthValue) => { // Handle known patterns const knownLabels = { '1': 'Május-Június', - '2': 'Október-November', + '2': 'Október-November', '3': 'Harmadik időszak', 'm1': '1. Mintafeladatsor', - 'm2': '2. Mintafeladatsor', + 'm2': '2. Mintafeladatsor', 'm3': '3. Mintafeladatsor' }; - + return knownLabels[monthValue] || monthValue; };