feat: Implement initial ObsiGate frontend SPA with comprehensive search, vault browsing, and file editing capabilities.

This commit is contained in:
Bruno Charest 2026-03-23 22:56:56 -04:00
parent ee77daa6d7
commit 1bfe2359d9
2 changed files with 43 additions and 2 deletions

View File

@ -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");

View File

@ -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;
}