forked from mamei16/LLM_Web_search
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
24 lines (22 loc) · 1.12 KB
/
script.js
File metadata and controls
24 lines (22 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var generate_button = document.getElementById("Generate");
generate_button.insertAdjacentHTML("afterend", '<div style="position:relative;"> <label style="color:#8b8b8b;white-space:nowrap;position:absolute;top:8px;right:0px;"><input type="checkbox" id="force-search" name="accept"> Force web search </label> </div>');
generate_button.style.setProperty("position", "relative");
generate_button.style.setProperty("top", "15px");
generate_button.style.setProperty("margin-left", "-10px");
var stop_button = document.getElementById("stop");
stop_button.style.setProperty("position", "relative");
stop_button.style.setProperty("top", "15px");
stop_button.style.setProperty("margin-left", "-10px");
var checkbox = document.getElementById("force-search");
var gradio_force_search_checkbox = document.getElementById("Force-search-checkbox").children[1].firstChild;
checkbox.addEventListener('change', function() {
if (this.checked) {
if (!gradio_force_search_checkbox.checked) {
gradio_force_search_checkbox.click();
}
} else {
if (gradio_force_search_checkbox.checked) {
gradio_force_search_checkbox.click();
}
}
});