Spaces:
Paused

File size: 907 Bytes
aea84cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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();
}