(tabname, show)
| 121 | |
| 122 | |
| 123 | function 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 | |
| 149 | function showSubmitInterruptingPlaceholder(tabname) { |
| 150 | gradioApp().getElementById(tabname + '_interrupt').innerText = "Interrupting ..."; |
no test coverage detected