| 249 | } |
| 250 | |
| 251 | function updOngoingStatus() { |
| 252 | chrome.runtime.sendMessage({ |
| 253 | type: "coursedump_checkOngoing" |
| 254 | }, (response) => { |
| 255 | document.body.setAttribute("data-ongoing-download", response['ongoing-status']); |
| 256 | if (response['ongoing-status'] && buttons.BatchDownload.title === "") { |
| 257 | buttons.BatchDownload.title = messages["already downloading"]; |
| 258 | } |
| 259 | if (!response['ongoing-status'] && buttons.BatchDownload.title === messages["already downloading"]) { |
| 260 | buttons.BatchDownload.title = ""; |
| 261 | } |
| 262 | buttons.Stop.removeAttribute('disabled'); |
| 263 | }); |
| 264 | } |
| 265 | |
| 266 | updCounters(); |
| 267 | updOngoingStatus(); |