add a button to read descript into decription input box

This commit is contained in:
Miao Xiang
2023-04-01 19:47:45 -07:00
parent 26d0c12444
commit 54e755528f
3 changed files with 20 additions and 0 deletions
+16
View File
@@ -112,6 +112,22 @@ function saveCardDescription(event, tabname, filename, descript){
event.preventDefault()
}
function readCardDescription(event, tabname, filename, descript){
var textarea = gradioApp().querySelector("#" + tabname + '_description_filename > label > textarea')
var description_textarea = gradioApp().querySelector("#" + tabname+ '_description_input > label > textarea')
var button = gradioApp().getElementById(tabname + '_read_description')
textarea.value = filename
description_textarea.value = descript
updateInput(textarea)
updateInput(description_textarea)
button.click()
event.stopPropagation()
event.preventDefault()
}
function extraNetworksSearchButton(tabs_id, event){
searchTextarea = gradioApp().querySelector("#" + tabs_id + ' > div > textarea')
button = event.target