MCPcopy Create free account
hub / github.com/DenOfEquity/ersatzForge / showSubmitButtons

Function showSubmitButtons

javascript/ui.js:123–147  ·  view source on GitHub ↗
(tabname, show)

Source from the content-addressed store, hash-verified

121
122
123function showSubmitButtons(tabname, show) {
124 const submit = gradioApp().getElementById(tabname + "_generate");
125 const interrupt = gradioApp().getElementById(tabname + "_interrupt");
126 const skip = gradioApp().getElementById(tabname + "_skip");
127 if (show) {
128 if ((opts.generate_forever_t2i && tabname === "txt2img") || (opts.generate_forever_i2i && tabname === "img2img")) {
129 submit.disabled = false;
130 submit.click();
131 submit.disabled = true;
132 }
133 else {
134 submit.disabled = false;
135 submit.style.zIndex = 0;
136 interrupt.style.display = "none";
137 skip.style.display = "none";
138 }
139 }
140 else {
141 submit.disabled = true;
142 submit.style.zIndex = -1;
143 interrupt.innerText = "Interrupt";
144 interrupt.style.display = "block";
145 skip.style.display = "block";
146 }
147}
148
149function showSubmitInterruptingPlaceholder(tabname) {
150 gradioApp().getElementById(tabname + '_interrupt').innerText = "Interrupting ...";

Callers 3

submitFunction · 0.85
submit_img2imgFunction · 0.85
submit_extrasFunction · 0.85

Calls 1

gradioAppFunction · 0.85

Tested by

no test coverage detected