Preset auto refresh. (#41)

* Preset auto refresh.

Workaround for gradio bug.

* simplified?

renamed variables
renamed function, removed an argument
removed globals

* save button label/tooltip

* cleanup

moved function down, typed argument

---------

Co-authored-by: Zyin055 <5003647+Zyin055@users.noreply.github.com>
This commit is contained in:
Symbiomatrix
2023-05-16 00:39:00 +03:00
committed by GitHub
parent 1683ad6e64
commit 5f9af2777a
2 changed files with 34 additions and 24 deletions

View File

@@ -5,7 +5,7 @@ onUiUpdate(function() {
//set tooltips
gradioApp().querySelectorAll("#script_config_preset_open_config_file_button").forEach(el => el.setAttribute("title", "Open the config .json file for manual editing if you want to make changes that way, requires Gradio restart after editing. The txt2img and img2img tabs have separate config files."))
gradioApp().querySelectorAll("#script_config_preset_save_textbox").forEach(el => el.setAttribute("title", "The name of a new Config Preset that will be added to the dropdown above"))
gradioApp().querySelectorAll("#script_config_preset_save_button").forEach(el => el.setAttribute("title", "Save selected fields with the new preset name, then restarts the UI. Overwrites existing preset with the same name."))
gradioApp().querySelectorAll("#script_config_preset_save_button").forEach(el => el.setAttribute("title", "Save selected fields with the new preset name. It will overwrite an existing preset with the same name."))
gradioApp().querySelectorAll("#script_config_preset_add_button").forEach(el => el.setAttribute("title", "[Config Presets] Create or delete a preset"))
gradioApp().querySelectorAll("#script_config_preset_cancel_save_button").forEach(el => el.setAttribute("title", "Go back"))
gradioApp().querySelectorAll("#script_config_preset_trash_button").forEach(el => el.setAttribute("title", "Permanently delete selected preset"))