From b74e144ab304f566117c82c67d65432e4aa610f9 Mon Sep 17 00:00:00 2001 From: bruno Date: Sun, 12 Jul 2026 12:45:26 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20=C3=A9chappement=20cass=C3=A9=20dans=20?= =?UTF-8?q?=5FloadPreviewContent=20=E2=80=94=20quotes=20=C3=A9chapp=C3=A9e?= =?UTF-8?q?s=20causaient=20SyntaxError?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - window.location=\\'/path\\'" → (évite onclick inline échappé) - onerror="this.parentElement.innerHTML=\\'...\\'" → onerror="this.style.display='none'" - Ces doubles-échappements injectés par le patch tool cassaient le parsing JS - Résultat: Alpine.data('wsInit') ne s'exécutait pas → toutes variables 'not defined' --- app/templates/local_workspace.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/templates/local_workspace.html b/app/templates/local_workspace.html index 79e161e..2ad4703 100644 --- a/app/templates/local_workspace.html +++ b/app/templates/local_workspace.html @@ -1159,7 +1159,7 @@ document.addEventListener('alpine:init', function() { this.previewPanelContent = '
' + '📁' + '
' + (node.child_count||0) + ' item(s)
' - + '' + + '
Open folder' + '
'; return; } @@ -1167,10 +1167,10 @@ document.addEventListener('alpine:init', function() { var name = (node.name || '').toLowerCase(); // Image preview if (/\.(png|jpe?g|gif|webp|svg|bmp|ico)$/.test(name)) { - var wsId = 1; // from workspace + var wsId = 1; var imgUrl = '/api/files/' + wsId + '/' + encodeURIComponent(node.name); this.previewPanelContent = '
' - + '' + + '' + '
'; return; } @@ -1189,7 +1189,6 @@ document.addEventListener('alpine:init', function() { var format = r.format || ''; var preview = ''; if (format === 'file') { - // Try to detect image/pdf from content metadata try { var meta = JSON.parse(content); if (meta.file_path && /\.(png|jpe?g|gif|webp|svg|bmp|ico)$/i.test(meta.file_path)) {