diff --git a/docs/CODE_STRUCTURE.md b/docs/CODE_STRUCTURE.md index e4bb5a0..e65df20 100644 --- a/docs/CODE_STRUCTURE.md +++ b/docs/CODE_STRUCTURE.md @@ -31,8 +31,8 @@ A line-by-line map of the main application file and key functions. | ~3840–4030 | Save/load | `save`, `load`, `setFromHash`, URL updates | | ~4030–4125 | Theme | Light/dark toggle, URL param, system preference | | ~4125–4685 | Version history | `pushLocalVersion`, `versionUndo`, `versionRedo`, `enterPreview`, `exitPreview` | -| ~4685–4760 | UI helpers | `setSaveStatus`, `notify`, `updateQR` | -| ~4588–4727 | Export | `downloadTXT`, `downloadHTML`, `downloadMD` | +| ~4685–4756 | UI helpers | `setSaveStatus`, `notify`, `updateQR` | +| ~4756–4940 | Export | `downloadTXT`, `downloadHTML`, `downloadMD` | | ~4727–5100 | Initialization | DOM ready, hash load, event listeners, Editor setup | ## Key Functions diff --git a/index.html b/index.html index d3b3218..aba6a9a 100644 --- a/index.html +++ b/index.html @@ -5110,6 +5110,21 @@

Document is getting large

document.getElementById('editor-wrap')?.classList.remove('encrypted-mode') updateLockButtonVisibility() document.getElementById('unlock-password').value = '' + renderAllBlocks() + + if (previewHash) { + const wrap = document.getElementById('editor-wrap') + const text = document.getElementById('preview-banner-text') + if (wrap) wrap.classList.add('preview-mode') + if (text) text.textContent = 'Previewing ' + formatVersionLabel(previewHash) + updateTitle() + updateQR() + updateStatusBar() + renderHistoryGraph() + notify('Unlocked preview') + return + } + const prevHead = getHeadHash() const hash = '#' + await getShortestHash(blocks) history.replaceState({}, '', buildUrl(hash)) @@ -5119,7 +5134,6 @@

Document is getting large

pushLocalVersion(hash, prevHead ? [prevHead] : (getLocalVersions()[0]?.hash ? [getLocalVersions()[0].hash] : [])) localStorage.setItem('hash', hash) } catch (e) {} - renderAllBlocks() updateTitle() updateQR() updateStatusBar()