feat: 添加快捷提示词标签,点击即可追加到描述
This commit is contained in:
16
ui.js
16
ui.js
@@ -221,6 +221,22 @@ generateForm.addEventListener('submit', async (e) => {
|
||||
}
|
||||
});
|
||||
|
||||
// ── Quick prompt tags ──────────────────────────────────────────
|
||||
|
||||
document.querySelectorAll('.tag-pill').forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
const tag = btn.dataset.tag;
|
||||
const current = promptInput.value.trim();
|
||||
if (current) {
|
||||
promptInput.value = current + ',' + tag;
|
||||
} else {
|
||||
promptInput.value = tag;
|
||||
}
|
||||
promptInput.dispatchEvent(new Event('input'));
|
||||
promptInput.focus();
|
||||
});
|
||||
});
|
||||
|
||||
// ── Prompt char count ──────────────────────────────────────────
|
||||
|
||||
promptInput.addEventListener('input', () => {
|
||||
|
||||
Reference in New Issue
Block a user