| 172 | onProviderChange(); |
| 173 | |
| 174 | function setBusy(isBusy, reason = "") { |
| 175 | const controls = [ |
| 176 | $("send"), |
| 177 | $("newModel"), |
| 178 | $("downloadIfc"), |
| 179 | $("ifcFile"), |
| 180 | ]; |
| 181 | |
| 182 | for (const el of controls) el.disabled = isBusy; |
| 183 | |
| 184 | $("input").disabled = isBusy; |
| 185 | |
| 186 | const browseBtn = $("browseBtn"); |
| 187 | if (browseBtn) { |
| 188 | browseBtn.classList.toggle("disabled", isBusy); |
| 189 | browseBtn.setAttribute("aria-disabled", isBusy ? "true" : "false"); |
| 190 | browseBtn.tabIndex = isBusy ? -1 : 0; |
| 191 | } |
| 192 | |
| 193 | sendBtn.innerHTML = isBusy |
| 194 | ? `<span class="spinner"></span>` |
| 195 | : `Send <span class="material-icons">send</span>`; |
| 196 | |
| 197 | setStatus(isBusy ? (reason || "Working…") : "Ready"); |
| 198 | } |
| 199 | |
| 200 | function escapeHtml(text) { |
| 201 | return text |