From 1b3aed19ffc3d2d3e4e6a6570e7fddd225847901 Mon Sep 17 00:00:00 2001 From: bruno Date: Wed, 22 Jul 2026 11:10:54 -0400 Subject: [PATCH] modular editor: extract original scripts into _page_editor_scripts.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now 3 shared modules (zero code duplication): - _page_editor_content.html — editor HTML (title block, slash menu, toolbar etc) - _page_editor_scripts.html — 100% original editorState() JS (CMDS, render, save, slash, database, share/publish, favorites, formatting, etc) - Used by page_editor.html (full page) and page_editor_embed.html (peek iframe) Embed page_editor_embed.html now has the exact same editor as full page. One change to _page_editor_scripts.html updates both views. --- app/templates/_page_editor_content.html | 2 +- app/templates/_page_editor_scripts.html | 480 +++++++++++++++++++++++ app/templates/page_editor.html | 483 +----------------------- app/templates/page_editor_embed.html | 398 +------------------ 4 files changed, 484 insertions(+), 879 deletions(-) create mode 100644 app/templates/_page_editor_scripts.html diff --git a/app/templates/_page_editor_content.html b/app/templates/_page_editor_content.html index 5291c28..0d37405 100644 --- a/app/templates/_page_editor_content.html +++ b/app/templates/_page_editor_content.html @@ -510,4 +510,4 @@ > - \ No newline at end of file + diff --git a/app/templates/_page_editor_scripts.html b/app/templates/_page_editor_scripts.html new file mode 100644 index 0000000..eab25fe --- /dev/null +++ b/app/templates/_page_editor_scripts.html @@ -0,0 +1,480 @@ + + diff --git a/app/templates/page_editor.html b/app/templates/page_editor.html index 7768a76..f389d96 100644 --- a/app/templates/page_editor.html +++ b/app/templates/page_editor.html @@ -5,486 +5,7 @@ page_title %}{{ page.title }}{% endblock %} {% block topbar %} {% set right_actions = 'Edited ▾' %} {% include '_header.html' %} {% endblock %} {% block content %} -{% include '_page_editor_content.html' %} +{% include "_page_editor_content.html" %} {% endblock %} {% block scripts %} - - +{% include "_page_editor_scripts.html" %} {% endblock %} diff --git a/app/templates/page_editor_embed.html b/app/templates/page_editor_embed.html index e4fccbd..db93a57 100644 --- a/app/templates/page_editor_embed.html +++ b/app/templates/page_editor_embed.html @@ -7,401 +7,5 @@ {% endblock %} {% block scripts %} - - +{% include '_page_editor_scripts.html' %} {% endblock %}