mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01:00
Lint
This commit is contained in:
parent
bec4e0a1ce
commit
89e7e107fc
10
js/main.js
10
js/main.js
@ -37,7 +37,7 @@ document.querySelector(".header_bar").addEventListener("click", function(event)
|
||||
//------------------------------------------------
|
||||
// Keyboard shortcuts
|
||||
//------------------------------------------------
|
||||
let previousTabId = 'chat-tab-button';
|
||||
let previousTabId = "chat-tab-button";
|
||||
document.addEventListener("keydown", function(event) {
|
||||
|
||||
// Stop generation on Esc pressed
|
||||
@ -101,10 +101,10 @@ document.addEventListener("keydown", function(event) {
|
||||
// Switch between tabs on Tab
|
||||
else if (!event.ctrlKey && !event.shiftKey && event.key === "Tab") {
|
||||
event.preventDefault();
|
||||
var parametersButton = document.getElementById('parameters-button');
|
||||
var parametersButton = document.getElementById("parameters-button");
|
||||
var parentContainer = parametersButton.parentNode;
|
||||
var selectedChild = parentContainer.querySelector('.selected');
|
||||
if (selectedChild.id == 'parameters-button') {
|
||||
var selectedChild = parentContainer.querySelector(".selected");
|
||||
if (selectedChild.id == "parameters-button") {
|
||||
document.getElementById(previousTabId).click();
|
||||
} else {
|
||||
previousTabId = selectedChild.id;
|
||||
@ -401,7 +401,7 @@ window.addEventListener("resize", updateDocumentWidth);
|
||||
//------------------------------------------------
|
||||
// Focus on the rename text area when it becomes visible
|
||||
//------------------------------------------------
|
||||
const renameTextArea = document.getElementById('rename-row').querySelector('textarea');
|
||||
const renameTextArea = document.getElementById("rename-row").querySelector("textarea");
|
||||
|
||||
function respondToVisibility(element, callback) {
|
||||
var options = {
|
||||
|
@ -529,6 +529,7 @@ def load_history_after_deletion(state, idx):
|
||||
|
||||
histories = find_all_histories(state)
|
||||
idx = min(int(idx), len(histories) - 1)
|
||||
idx = max(0, idx)
|
||||
|
||||
if len(histories) > 0:
|
||||
history = load_history(histories[idx], state['character_menu'], state['mode'])
|
||||
@ -542,6 +543,7 @@ def load_history_after_deletion(state, idx):
|
||||
def update_character_menu_after_deletion(idx):
|
||||
characters = utils.get_available_characters()
|
||||
idx = min(int(idx), len(characters) - 1)
|
||||
idx = max(0, idx)
|
||||
return gr.update(choices=characters, value=characters[idx])
|
||||
|
||||
|
||||
|
@ -246,7 +246,6 @@ def create_event_handlers():
|
||||
|
||||
shared.gradio['delete_chat'].click(lambda: [gr.update(visible=True), gr.update(visible=False), gr.update(visible=True)], None, gradio(clear_arr))
|
||||
shared.gradio['delete_chat-cancel'].click(lambda: [gr.update(visible=False), gr.update(visible=True), gr.update(visible=False)], None, gradio(clear_arr))
|
||||
|
||||
shared.gradio['delete_chat-confirm'].click(
|
||||
ui.gather_interface_values, gradio(shared.input_elements), gradio('interface_state')).then(
|
||||
lambda x, y: str(chat.find_all_histories(x).index(y)), gradio('interface_state', 'unique_id'), gradio('temporary_text')).then(
|
||||
|
Loading…
Reference in New Issue
Block a user