Fix JS
Browse files333 unmodified lines33433533633733833964 unmodified lines40440540640740840941013 unmodified lines4244254264274284294301 unmodified line43243343443543643743810 unmodified lines44945045145245345445545645745893 unmodified lines552553554555556557558559560561562333 unmodified linesfunction categorizeRequirements(max_categories) {isRequirements = false;fetch("https://game4all-reqroup.hf.space/reqs/categorize_requirements", {method: "POST",headers: {64 unmodified linesconst criticism = item.criticism;// Récupérer le titre de la catégorieconst categoryTitle = document.querySelector(`#category-${index} h2`)?.textContent || `Catégorie ${index + 1}`;// Container pour chaque solutionconst solutionCard = document.createElement('div');13 unmodified lines<h3 class="text-sm font-semibold text-gray-800">${categoryTitle}</h3><div class="flex items-center space-x-2 bg-white px-3 py-1 rounded-full border"><button class="version-btn-left w-6 h-6 flex items-center justify-center rounded-full hover:bg-gray-100 transition-colors ${currentVersion === 1 ? 'opacity-50 cursor-not-allowed' : ''}"data-solution-index="${index}"${currentVersion === 1 ? 'disabled' : ''}><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path>1 unmodified line</button><span class="text-xs font-medium text-gray-600 min-w-[60px] text-center version-indicator">Version ${currentVersion}</span><button class="version-btn-right w-6 h-6 flex items-center justify-center rounded-full hover:bg-gray-100 transition-colors ${currentVersion === totalVersions ? 'opacity-50 cursor-not-allowed' : ''}"data-solution-index="${index}"${currentVersion === totalVersions ? 'disabled' : ''}><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>10 unmodified lines// Contenu de l'accordéonconst content = document.createElement('div');content.className = `accordion-content px-4 py-3 space-y-3`;content.id = `content-${index}`;// Vérifier l'état d'ouverture précédentconst isOpen = accordionStates[index] || false;if (!isOpen) {content.classList.add('hidden');} else {93 unmodified linesif (isCurrentlyOpen) {content.classList.add('hidden');icon.style.transform = 'rotate(0deg)';accordionStates[index] = false;} else {content.classList.remove('hidden');icon.style.transform = 'rotate(180deg)';accordionStates[index] = true;}});333 unmodified lines33433533633733833934034134234334434534664 unmodified lines41141241341441541641713 unmodified lines4314324334344354364371 unmodified line43944044144244344444510 unmodified lines45645745845946046146246346446593 unmodified lines559560561562563564565566567568569333 unmodified linesfunction categorizeRequirements(max_categories) {isRequirements = false;document.getElementById('categorizeReq').setAttribute('disabled', 'true');document.getElementById('downloadZip').setAttribute('disabled', 'true');document.getElementById('searchReq').setAttribute('disabled', 'true');document.getElementById('progressText').classList.remove('hidden');document.getElementById('loadingBar').classList.remove('hidden');document.getElementById('progressText').textContent = "Grouping requirements by their context ...";fetch("https://game4all-reqroup.hf.space/reqs/categorize_requirements", {method: "POST",headers: {64 unmodified linesconst criticism = item.criticism;// Récupérer le titre de la catégorieconst categoryTitle = document.querySelector(`#category-${solution['Category_Id']} h2`)?.textContent || `Catégorie ${solution['Category_Id'] + 1}`;// Container pour chaque solutionconst solutionCard = document.createElement('div');13 unmodified lines<h3 class="text-sm font-semibold text-gray-800">${categoryTitle}</h3><div class="flex items-center space-x-2 bg-white px-3 py-1 rounded-full border"><button class="version-btn-left w-6 h-6 flex items-center justify-center rounded-full hover:bg-gray-100 transition-colors ${currentVersion === 1 ? 'opacity-50 cursor-not-allowed' : ''}"data-solution-index="${solution['Category_Id']}"${currentVersion === 1 ? 'disabled' : ''}><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path>1 unmodified line</button><span class="text-xs font-medium text-gray-600 min-w-[60px] text-center version-indicator">Version ${currentVersion}</span><button class="version-btn-right w-6 h-6 flex items-center justify-center rounded-full hover:bg-gray-100 transition-colors ${currentVersion === totalVersions ? 'opacity-50 cursor-not-allowed' : ''}"data-solution-index="${solution['Category_Id']}"${currentVersion === totalVersions ? 'disabled' : ''}><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>10 unmodified lines// Contenu de l'accordéonconst content = document.createElement('div');content.className = `accordion-content px-4 py-3 space-y-3`;content.id = `content-${solution['Category_Id']}`;// Vérifier l'état d'ouverture précédentconst isOpen = accordionStates[solution['Category_Id']] || false;if (!isOpen) {content.classList.add('hidden');} else {93 unmodified linesif (isCurrentlyOpen) {content.classList.add('hidden');icon.style.transform = 'rotate(0deg)';accordionStates[solution['Category_Id']] = false;} else {content.classList.remove('hidden');icon.style.transform = 'rotate(180deg)';accordionStates[solution['Category_Id']] = true;}});
static/script.js+14-7