Spaces:
Paused
Paused
Download js/switch_tabs.js from bicheichane/testing123: direct link, hf CLI and curl.
- Browser
- Download file 907 Bytes
-
https://huggingface.co/spaces/bicheichane/testing123/resolve/main/js/switch_tabs.js
- Command line
-
hf download hf://spaces/bicheichane/testing123/js/switch_tabs.js
-
curl -L -o switch_tabs.js https://huggingface.co/spaces/bicheichane/testing123/resolve/main/js/switch_tabs.js
907 Bytes
| 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(); | |
| } | |