Spaces:
Running
Running
P01yH3dr0n
commited on
Commit
•
27fffd9
1
Parent(s):
ee50c99
Update tagcomplete/javascript/_textAreas.js
Browse files
tagcomplete/javascript/_textAreas.js
CHANGED
@@ -93,24 +93,6 @@ const thirdParty = {
|
|
93 |
function getTextAreas() {
|
94 |
// First get all core text areas
|
95 |
let textAreas = [...gradioApp().querySelectorAll(core.join(", "))];
|
96 |
-
|
97 |
-
for (const [key, entry] of Object.entries(thirdParty)) {
|
98 |
-
if (entry.hasIds) { // If the entry has proper ids, we can just select them
|
99 |
-
textAreas = textAreas.concat([...gradioApp().querySelectorAll(entry.selectors.join(", "))]);
|
100 |
-
} else { // Otherwise, we have to find the text areas by their adjacent labels
|
101 |
-
let base = gradioApp().querySelector(entry.base);
|
102 |
-
|
103 |
-
// Safety check
|
104 |
-
if (!base) continue;
|
105 |
-
|
106 |
-
let allTextAreas = [...base.querySelectorAll("textarea, input[type='text']")];
|
107 |
-
|
108 |
-
// Filter the text areas where the adjacent label matches one of the selectors
|
109 |
-
let matchingTextAreas = allTextAreas.filter(ta => [...ta.parentElement.childNodes].some(x => entry.selectors.includes(x.innerText)));
|
110 |
-
textAreas = textAreas.concat(matchingTextAreas);
|
111 |
-
}
|
112 |
-
};
|
113 |
-
|
114 |
return textAreas;
|
115 |
}
|
116 |
|
|
|
93 |
function getTextAreas() {
|
94 |
// First get all core text areas
|
95 |
let textAreas = [...gradioApp().querySelectorAll(core.join(", "))];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
return textAreas;
|
97 |
}
|
98 |
|