/
githubmirror
/
text-generation-webui
Обзор
Документация
Войти
/
githubmirror
/
text-generation-webui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v3.21
js/switch_tabs.js
52 строки
1 KB
oobabooga
Image generation: Small UI improvements
04 дек 2025, 03:03
04 дек 2025, 03:03
59285d5
Код
Авторство
О чём код?
function scrollToTop() { window.scrollTo({ top: 0 }); } function findButtonsByText(buttonText) { const buttons = document.getElementsByTagName("button"); const matchingButtons = []; for (let i = 0; i < buttons.length; i++) { if (buttons[i].textContent.trim() === buttonText) { matchingButtons.push(buttons[i]); } } return matchingButtons; } function switch_to_chat() { document.getElementById("chat-tab-button").click(); scrollToTop(); } function switch_to_notebook() { document.getElementById("notebook-parent-tab-button").click(); findButtonsByText("Raw")[1].click(); scrollToTop(); } function switch_to_generation_parameters() { document.getElementById("parameters-button").click(); findButtonsByText("Generation")[0].click(); scrollToTop(); } function switch_to_character() { document.getElementById("character-tab-button").click(); scrollToTop(); } function switch_to_image_ai_generate() { const container = document.querySelector("#image-ai-tab"); const buttons = container.getElementsByTagName("button"); for (let i = 0; i < buttons.length; i++) { if (buttons[i].textContent.trim() === "Generate") { buttons[i].click(); break; } } scrollToTop(); }