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

This commit is contained in:
2026-03-23 22:56:56 -04:00
parent ee77daa6d7
commit 1bfe2359d9
2 changed files with 43 additions and 2 deletions
+19 -2
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");