diff --git a/public/assets/js/ai-editor.js b/public/assets/js/ai-editor.js index 43cc1d9..5d0e3b8 100644 --- a/public/assets/js/ai-editor.js +++ b/public/assets/js/ai-editor.js @@ -9,7 +9,7 @@ document.addEventListener('DOMContentLoaded', function () { var resultEl = document.getElementById('ai-result-content'); var btnApply = document.getElementById('btn-ai-apply'); var btnClose = document.getElementById('btn-ai-close'); - var ta = document.getElementById('content'); + var ta = document.getElementById('wz-content') || document.getElementById('content'); var titleEl = document.getElementById('title'); var lastRewrite = ''; @@ -33,13 +33,19 @@ document.addEventListener('DOMContentLoaded', function () { lastRewrite = ''; try { + var titleVal = titleEl ? titleEl.value : ''; + if (!titleVal && ta) { + var m = ta.value.match(/^#\s+(.+)/m); + if (m) { titleVal = m[1].trim(); } + } + var res = await fetch('/?action=ai_query', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams({ action: action, - title: titleEl ? titleEl.value : '', - content: ta ? ta.value : '', + title: titleVal, + content: ta ? ta.value : '', }), }); diff --git a/templates/wizard/step1.php b/templates/wizard/step1.php index 367143d..0b77541 100644 --- a/templates/wizard/step1.php +++ b/templates/wizard/step1.php @@ -49,15 +49,44 @@ $_hasUuid = $_wizUuid !== ''; - +
-
+
Plan
-
+
    + + +
    +
    IA
    +
    +
    + + +
    + +
    +
    +
    @@ -172,4 +201,5 @@ $_hasUuid = $_wizUuid !== '';