|
20 | 20 | var capabilities = {}; |
21 | 21 | var selectedPath = ""; |
22 | 22 | var selectedName = ""; |
| 23 | + var _clipDurationSeconds = 0; |
23 | 24 | var currentJob = null; |
24 | 25 | var pollTimer = null; |
25 | 26 | var healthTimer = null; |
|
2523 | 2524 |
|
2524 | 2525 | function applyClipPreviewMeta(path, data) { |
2525 | 2526 | if (!data || path !== selectedPath) return; |
| 2527 | + _clipDurationSeconds = parseFloat(data.duration) || 0; |
2526 | 2528 | if (el.clipMetaDur) el.clipMetaDur.textContent = data.duration ? fmtDur(data.duration) : ""; |
2527 | 2529 | if (el.clipMetaRes) { |
2528 | 2530 | el.clipMetaRes.textContent = data.video |
|
3914 | 3916 | el.progressLabel.textContent = preparingMessage; |
3915 | 3917 | el.cancelBtn.classList.remove("hidden"); |
3916 | 3918 |
|
3917 | | - // Lock the entire UI |
| 3919 | + // Lock the entire UI (pointer-events + keyboard/AT via inert) |
3918 | 3920 | document.body.classList.add("job-active"); |
| 3921 | + var mc = document.getElementById("mainContent"); |
| 3922 | + if (mc) mc.inert = true; |
3919 | 3923 |
|
3920 | 3924 | // Track for retry |
3921 | 3925 | lastJobEndpoint = endpoint; |
|
4351 | 4355 | setButtonText(el.processingCancel, rememberButtonText(el.processingCancel)); |
4352 | 4356 | el.processingCancel.disabled = false; |
4353 | 4357 | document.body.classList.remove("job-active"); |
| 4358 | + var mc = document.getElementById("mainContent"); |
| 4359 | + if (mc) mc.inert = false; |
4354 | 4360 | if (elapsedTimer) { clearInterval(elapsedTimer); elapsedTimer = null; } |
4355 | 4361 | } |
4356 | 4362 |
|
|
8270 | 8276 | } |
8271 | 8277 | } |
8272 | 8278 |
|
8273 | | - function showAlert(msg, errorData) { |
| 8279 | + function showAlert(msg, errorData, explicitTone) { |
8274 | 8280 | var display = enhanceError(msg, errorData); |
8275 | | - var tone = inferNotificationTone(display, errorData); |
| 8281 | + var tone = inferNotificationTone(display, errorData, explicitTone); |
8276 | 8282 | var heading = getNotificationHeading(tone, display); |
8277 | 8283 | applyNotificationTone(el.alertBanner, tone); |
8278 | 8284 | if (el.alertIcon) { |
|
12226 | 12232 | // ================================================================ |
12227 | 12233 | function fetchTimeEstimate(jobType) { |
12228 | 12234 | if (!el.processingEstimate) return; |
12229 | | - // Get file duration from file info (fmtDur outputs M:SS or H:MM:SS) |
12230 | | - var fileDuration = 0; |
12231 | | - var metaEl = document.getElementById("fileMetaDisplay"); |
12232 | | - if (metaEl) { |
12233 | | - var txt = metaEl.textContent || ""; |
12234 | | - // Match M:SS or H:MM:SS format from fmtDur() |
12235 | | - var hmatch = txt.match(/(\d+):(\d+):(\d+)/); |
12236 | | - var mmatch = !hmatch && txt.match(/(\d+):(\d+)/); |
12237 | | - if (hmatch) fileDuration = parseInt(hmatch[1]) * 3600 + parseInt(hmatch[2]) * 60 + parseInt(hmatch[3]); |
12238 | | - else if (mmatch) fileDuration = parseInt(mmatch[1]) * 60 + parseInt(mmatch[2]); |
12239 | | - } |
| 12235 | + var fileDuration = _clipDurationSeconds || 0; |
12240 | 12236 | api("POST", "/system/estimate-time", { type: jobType, file_duration: fileDuration }, function (err, data) { |
12241 | 12237 | if (err || !data || !data.estimate_seconds) { |
12242 | 12238 | el.processingEstimate.textContent = ""; |
|
0 commit comments