@
Generic: Project CI / Tests (pull_request) Failing after 5s
Universal: PR Check / Require Docs Update (pull_request) Has been skipped
Universal: PR Check / Wiki Update Reminder (pull_request) Has been skipped
Universal: PR Check / Branch Policy (pull_request) Successful in 1s
Generic: Project CI / Lint & Validate (pull_request) Successful in 8s
Universal: PR Check / Secret Scan (pull_request) Successful in 5s
Branch Cleanup / Delete merged branch (pull_request) Successful in 1s
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Joomla: Metadata Validation / Validate Joomla Metadata (pull_request) Successful in 7s
Universal: PR Check / Validate PR (pull_request) Failing after 17s
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled

feat(runbackup): open record link in new window; harden leave warning

- The "View backup record" link on the pre-update completion screen now
  opens in a new window (target=_blank rel=noopener), so viewing the
  record does not leave the "Continue the update" flow.
- beforeunload leave-warning now also returns the message (broader browser
  support) so closing the window mid-backup reliably prompts a warning.

Claude-Session: https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i
@
This commit is contained in:
2026-07-13 10:56:29 -05:00
parent 6da7ef0b69
commit bd2effd89c
@@ -132,7 +132,7 @@ $this->getDocument()->addStyleSheet(Uri::root(true) . '/media/com_mokosuitebacku
<div id="msb-rb-actions" class="d-none mt-3">
<button type="button" id="msb-rb-retry" class="btn btn-primary d-none"></button>
<a href="#" id="msb-rb-record" class="btn btn-primary d-none"></a>
<a href="#" id="msb-rb-record" class="btn btn-primary d-none" target="_blank" rel="noopener"></a>
<a href="#" id="msb-rb-continue" class="btn btn-warning d-none"></a>
<a href="<?php echo $dashboardUrl; ?>" id="msb-rb-dashboard" class="btn btn-secondary d-none"></a>
</div>
@@ -316,9 +316,15 @@ $this->getDocument()->addStyleSheet(Uri::root(true) . '/media/com_mokosuitebacku
}
}
/* Warn before leaving while a backup is mid-flight. */
/* Warn before closing/leaving the window while a backup is mid-flight.
Return the message too — some browsers need it, others show a generic
prompt, but any non-empty value triggers the confirmation dialog. */
window.addEventListener('beforeunload', function (e) {
if (running) { e.preventDefault(); e.returnValue = L.leaveWarn || ''; }
if (!running) { return undefined; }
var msg = L.leaveWarn || 'A backup is in progress. Leaving now will cancel it.';
e.preventDefault();
e.returnValue = msg;
return msg;
});
if (CFG.autostart) {