diff --git a/src/App.vue b/src/App.vue index 6ff1b17..1068d9e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -12,8 +12,6 @@ import Coloris from '@melloware/coloris'; const stylesheetStore = useStylesheetStore(); const narrativeStore = useNarrativeStore(); -// Get narrative URL from body data attribute (set by print.php template) -const narrativeUrl = document.body.dataset.narrativeUrl || null; const previewFrame1 = ref(null); const previewFrame2 = ref(null); const elementPopup = ref(null); @@ -28,8 +26,6 @@ const selectedPages = ref([]); // Pages with active border (when popup is open) const hoveredElement = ref(null); // Currently hovered content element const selectedElement = ref(null); // Selected element (when popup is open) const EDGE_THRESHOLD = 30; // px from edge to trigger hover -const PAGE_HIGHLIGHT_COLOR = '#ff8a50'; -const ELEMENT_HIGHLIGHT_COLOR = '#7136ff'; let savedScrollPercentage = 0; const currentFrameIndex = ref(1); // 1 or 2, which iframe is currently visible @@ -559,9 +555,7 @@ const printPreview = async () => { onMounted(async () => { // Load narrative data if URL is provided (print mode) - if (narrativeUrl) { - await narrativeStore.loadNarrative(narrativeUrl); - } + await narrativeStore.loadNarrative(location.href + '.json'); // Render preview after data is loaded renderPreview(true); diff --git a/src/stores/narrative.js b/src/stores/narrative.js index 19bfe13..766010b 100644 --- a/src/stores/narrative.js +++ b/src/stores/narrative.js @@ -26,7 +26,7 @@ export const useNarrativeStore = defineStore('narrative', () => { title: data.value.title, author: data.value.author, cover: data.value.cover, - introduction: data.value.introduction + introduction: data.value.introduction, }); // Recursively flatten children @@ -41,7 +41,7 @@ export const useNarrativeStore = defineStore('narrative', () => { subtitle: child.subtitle, tags: child.tags, cover: child.cover, - text: child.text + text: child.text, }); // Add geoformat chapters @@ -53,7 +53,7 @@ export const useNarrativeStore = defineStore('narrative', () => { id: child.id, template: 'chapitre', title: child.title, - blocks: child.blocks + blocks: child.blocks, }); } else if (child.template === 'carte') { items.push({ @@ -61,7 +61,7 @@ export const useNarrativeStore = defineStore('narrative', () => { template: 'carte', title: child.title, tags: child.tags, - text: child.text + text: child.text, }); } } @@ -122,6 +122,6 @@ export const useNarrativeStore = defineStore('narrative', () => { // Actions loadNarrative, - reset + reset, }; });