2023-04-10 15:15:16 -04:00
|
|
|
document.getElementById("main").parentNode.childNodes[0].classList.add("header_bar");
|
2023-03-15 12:24:54 -04:00
|
|
|
document.getElementById("main").parentNode.style = "padding: 0; margin: 0";
|
|
|
|
document.getElementById("main").parentNode.parentNode.parentNode.style = "padding: 0";
|
2023-03-15 15:34:31 -04:00
|
|
|
|
|
|
|
// Get references to the elements
|
|
|
|
let main = document.getElementById('main');
|
|
|
|
let main_parent = main.parentNode;
|
|
|
|
let extensions = document.getElementById('extensions');
|
|
|
|
|
|
|
|
// Add an event listener to the main element
|
|
|
|
main_parent.addEventListener('click', function(e) {
|
|
|
|
// Check if the main element is visible
|
|
|
|
if (main.offsetHeight > 0 && main.offsetWidth > 0) {
|
2023-03-26 21:20:30 -04:00
|
|
|
extensions.style.display = 'flex';
|
2023-03-15 15:34:31 -04:00
|
|
|
} else {
|
2023-03-15 15:41:38 -04:00
|
|
|
extensions.style.display = 'none';
|
2023-03-15 15:34:31 -04:00
|
|
|
}
|
|
|
|
});
|
2023-08-02 11:02:36 -04:00
|
|
|
|
2023-08-02 21:50:13 -04:00
|
|
|
// Add some scrollbars
|
2023-08-02 11:02:36 -04:00
|
|
|
const textareaElements = document.querySelectorAll('.add_scrollbar textarea');
|
|
|
|
for(i = 0; i < textareaElements.length; i++) {
|
|
|
|
textareaElements[i].classList.remove('scroll-hide');
|
|
|
|
textareaElements[i].classList.add('pretty_scrollbar');
|
|
|
|
textareaElements[i].style.resize = "none";
|
|
|
|
}
|
2023-08-03 11:13:17 -04:00
|
|
|
|
|
|
|
// Stop generation on Esc pressed
|
|
|
|
document.addEventListener("keydown", function(event) {
|
|
|
|
if (event.key === "Escape") {
|
|
|
|
// Find the element with id 'stop' and click it
|
|
|
|
var stopButton = document.getElementById("stop");
|
|
|
|
if (stopButton) {
|
|
|
|
stopButton.click();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|