diff --git a/frontend/app.js b/frontend/app.js index 27e9f6c..f35cc28 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -2180,8 +2180,8 @@ ]); openNewWindowBtn.addEventListener("click", () => { const currentUrl = window.location.origin + window.location.pathname; - const fileUrl = `${currentUrl}#file=${encodeURIComponent(data.vault)}:${encodeURIComponent(data.path)}`; - window.open(fileUrl, '_blank'); + const fileUrl = `${currentUrl}?popup=true#file=${encodeURIComponent(data.vault)}:${encodeURIComponent(data.path)}`; + window.open(fileUrl, '_blank', 'menubar=no,toolbar=no,location=no,status=no,width=1000,height=800'); }); // Frontmatter @@ -3962,6 +3962,23 @@ if (authOk) { try { await Promise.all([loadVaults(), loadTags()]); + + // Check for popup mode query parameter + const urlParams = new URLSearchParams(window.location.search); + if (urlParams.get("popup") === "true") { + document.body.classList.add("popup-mode"); + } + + // Handle direct deep-link to file via #file=... + if (window.location.hash && window.location.hash.startsWith("#file=")) { + const hashVal = window.location.hash.substring(6); + const sepIndex = hashVal.indexOf(":"); + if (sepIndex > -1) { + const vault = decodeURIComponent(hashVal.substring(0, sepIndex)); + const path = decodeURIComponent(hashVal.substring(sepIndex + 1)); + openFile(vault, path); + } + } } catch (err) { console.error("Failed to initialize ObsiGate:", err); showToast("Erreur lors de l'initialisation"); diff --git a/frontend/style.css b/frontend/style.css index f5fb1ba..c1627b0 100644 --- a/frontend/style.css +++ b/frontend/style.css @@ -3329,3 +3329,27 @@ body.resizing-v { gap: 8px; margin-top: 20px; } + +/* --------------------------------------------------------------------------- + Popup Mode (Nouvelle fenĂȘtre) + --------------------------------------------------------------------------- */ +body.popup-mode .top-nav, +body.popup-mode .sidebar, +body.popup-mode .resizer, +body.popup-mode .content-header { + display: none !important; +} +body.popup-mode .main-layout { + height: 100vh; +} +body.popup-mode .content-area { + margin: 15px auto; + padding: 30px; + border: 1px solid var(--border); + border-radius: 12px; + height: calc(100vh - 30px); + max-width: 1000px; + overflow-y: auto; + box-shadow: 0 8px 30px rgba(0,0,0,0.15); + box-sizing: border-box; +}