diff --git a/module/ai/view/inputinject.html.php b/module/ai/view/inputinject.html.php index 90da315f70..57db49caa4 100644 --- a/module/ai/view/inputinject.html.php +++ b/module/ai/view/inputinject.html.php @@ -83,6 +83,10 @@ publishButton.addEventListener('click', function(e) { e.preventDefault(); + + const container = publishButton.ownerDocument.defaultView.parent.document.querySelector('.load-indicator'); + if(container) container.classList.toggle('loading', true); + const promptId = publishButton.dataset.promptid; const aTag = document.createElement('a'); aTag.href = createLink('ai', 'promptPublish', 'promptId=' + promptId + '&$backToTestingLocation=true'); @@ -91,6 +95,16 @@ aTag.click(); }); } + + const regenerateButton = document.getElementById('promptRegenerate'); + if(regenerateButton) + { + regenerateButton.addEventListener('click', function() + { + const container = regenerateButton.ownerDocument.defaultView.parent.document.querySelector('.load-indicator'); + if(container) container.classList.toggle('loading', true); + }); + } }); diff --git a/module/ai/view/promptaudit.html.php b/module/ai/view/promptaudit.html.php index 89ebc14d45..8a253d2650 100644 --- a/module/ai/view/promptaudit.html.php +++ b/module/ai/view/promptaudit.html.php @@ -128,6 +128,11 @@ function reloadPrompt(promptId, objectId) { + const container = parent.parent.document.querySelector('.load-indicator'); + if(container) container.classList.toggle('loading', true); + + parent.$.zui.closeModal(); + let link = createLink('ai', 'promptexecute', 'promptId=' + promptId + '&objectId=' + objectId); link = link.replace('onlybody=yes', ''); const aTag = document.createElement('a'); diff --git a/module/ai/view/promptmenu.html.php b/module/ai/view/promptmenu.html.php index 61581a3bcb..42517d361a 100644 --- a/module/ai/view/promptmenu.html.php +++ b/module/ai/view/promptmenu.html.php @@ -30,14 +30,14 @@ $currentObjectId = !empty($this->view->$objectVarName) ? $this->view->$objectVarName->id : 0; if(count($prompts) > 1) { - $html .= '