diff --git a/assets/css/frontend/pages/submit.css b/assets/css/frontend/pages/submit.css index 9a7d4df1..fd816f49 100644 --- a/assets/css/frontend/pages/submit.css +++ b/assets/css/frontend/pages/submit.css @@ -71,10 +71,6 @@ border: none; } -.aksrt-submit-editor-wrap textarea.wp-editor-area { - opacity: 1; -} - .aksrt-submit-editor-wrap .mce-toolbar-grp { background: var(--surface-1, #fff); border-bottom: 1px solid var(--color-line, #eceff4); diff --git a/assets/js/front-submit.js b/assets/js/front-submit.js index 44678fca..ae62eeed 100644 --- a/assets/js/front-submit.js +++ b/assets/js/front-submit.js @@ -100,7 +100,6 @@ if (!this.form) { return; } - this.hydrateEditor(); this.bindDirty(); this.bindAutoHeight(); this.bindSubmitButtons(); @@ -114,59 +113,6 @@ this.loadFeaturedFromDom(); }, - hydrateEditor: function () { - var snapshot = document.getElementById('aksrt-initial-post-content'); - var textarea = qs('#post_content') || qs('[name="post_content"]'); - var initialContent = snapshot ? snapshot.value : textarea ? textarea.value : ''; - if (!initialContent) { - return; - } - - var fallbackToTextEditor = function () { - if (window.switchEditors && typeof window.switchEditors.go === 'function') { - window.switchEditors.go('post_content', 'html'); - } - if (textarea) { - textarea.value = initialContent; - textarea.style.opacity = '1'; - textarea.style.display = 'block'; - } - }; - - var attempts = 0; - var restore = function () { - var editor = window.tinymce && window.tinymce.get('post_content'); - if (!editor) { - attempts += 1; - if (attempts < 20) { - setTimeout(restore, 250); - } else { - fallbackToTextEditor(); - } - return; - } - - var hydrate = function () { - var current = editor.getContent({ format: 'raw' }); - if (!current || !current.trim()) { - editor.setContent(initialContent); - editor.save(); - } - if (!editor.getContent({ format: 'raw' }).trim()) { - fallbackToTextEditor(); - } - }; - - if (editor.initialized) { - hydrate(); - } else { - editor.on('init', hydrate); - } - }; - - restore(); - }, - bindDirty: function () { var self = this; this.form.addEventListener('input', function () { diff --git a/src/Core/ScriptsPart1b.php b/src/Core/ScriptsPart1b.php index b85252af..c11930e3 100644 --- a/src/Core/ScriptsPart1b.php +++ b/src/Core/ScriptsPart1b.php @@ -16,15 +16,11 @@ trait ScriptsPart1b { $runtime_uri = $base_uri . '/assets'; $fa5_uri = $base_uri . '/assets/fontawesome5'; - // The legacy frontend runtime is the single public dependency stack. - wp_deregister_script('jquery'); - wp_register_script( - 'jquery', - $runtime_uri . '/js/runtime/libs/jquery.min.js', - [], - '1.9.1', - false - ); + // Keep the WordPress handle but make its modern core build the only runtime. + $wp_scripts = wp_scripts(); + if (isset($wp_scripts->registered['jquery'])) { + $wp_scripts->registered['jquery']->deps = ['jquery-core']; + } wp_enqueue_script('jquery'); wp_enqueue_script( diff --git a/templates/parts/submit/editor-main.php b/templates/parts/submit/editor-main.php index a3a170df..4fcd347d 100644 --- a/templates/parts/submit/editor-main.php +++ b/templates/parts/submit/editor-main.php @@ -42,12 +42,6 @@ $is_can_new = !empty($ctx['is_can_new']);