chore: dalle2

This commit is contained in:
lencx
2023-01-06 14:39:25 +08:00
parent d0df8df108
commit 8c2303dec9
9 changed files with 86 additions and 41 deletions

View File

@@ -10,6 +10,16 @@ async function init() {
// const searchBtn = document.querySelector('.image-prompt-form-wrapper form .image-prompt-btn');
const searchInput = document.querySelector('.image-prompt-form-wrapper form>.text-input');
if (searchInput) {
document.addEventListener("click", (e) => {
const origin = e.target.closest("a");
if (origin && origin.href && origin.target !== '_self') {
invoke('open_link', { url: origin.href });
}
});
clearInterval(window.searchInterval);
if (!window.__CHATGPT_QUERY__) return;
const query = decodeURIComponent(window.__CHATGPT_QUERY__);
searchInput.focus();
searchInput.value = query;
@@ -19,7 +29,6 @@ async function init() {
// searchBtn.classList.add('active-style');
// searchBtn.removeAttribute('disabled');
// searchBtn.classList.remove('btn-disabled', 'btn-disabled-style');
clearInterval(window.searchInterval);
}
}, 200)
}