* add loading indicator.

This commit is contained in:
Chenjianyu
2023-07-19 10:38:55 +08:00
parent 7cc382fad5
commit 0103f8bee9
4 changed files with 44 additions and 4 deletions
+14
View File
@@ -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);
});
}
});
</script>
<?php endif;?>