From 4bc8b47d053a40afea173f6267829f2c632b0251 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sun, 12 Jul 2026 16:07:36 -0500 Subject: [PATCH] @ fix: reliably intercept extension update/uninstall + polish backup screen The full-screen pre-action backup did not fire for extension updates/uninstalls because Joomla 6 renders the com_installer toolbar Update/Uninstall buttons as ` + + +
+
0%
+
@@ -126,6 +174,7 @@ $config = [ var el = { bar: document.getElementById('msb-rb-bar'), + track: document.querySelector('.msb-rb-progress'), phase: document.getElementById('msb-rb-phase'), status: document.getElementById('msb-rb-status'), title: document.getElementById('msb-rb-title'), @@ -140,9 +189,9 @@ $config = [ pct = Math.max(0, Math.min(100, parseInt(pct, 10) || 0)); el.bar.style.width = pct + '%'; el.bar.textContent = pct + '%'; - el.bar.setAttribute('aria-valuenow', pct); + if (el.track) { el.track.setAttribute('aria-valuenow', pct); } if (!striped) { - el.bar.classList.remove('progress-bar-striped', 'progress-bar-animated'); + el.bar.classList.remove('is-animated'); } } function setPhase(t) { el.phase.textContent = t || ''; } @@ -167,8 +216,8 @@ $config = [ } async function onComplete() { - el.bar.classList.remove('progress-bar-striped', 'progress-bar-animated'); - el.bar.classList.add('bg-success'); + el.bar.classList.remove('is-animated'); + el.bar.classList.add('is-success'); setBar(100, false); el.title.textContent = L.complete || 'Backup complete'; @@ -198,8 +247,8 @@ $config = [ function onError(message) { running = false; - el.bar.classList.remove('progress-bar-striped', 'progress-bar-animated'); - el.bar.classList.add('bg-danger'); + el.bar.classList.remove('is-animated'); + el.bar.classList.add('is-danger'); el.title.textContent = L.failed || 'Backup failed'; setStatus(message || 'Backup failed'); showActions(); @@ -209,8 +258,8 @@ $config = [ el.retry.onclick = function () { el.retry.classList.add('d-none'); el.continue.classList.add('d-none'); - el.bar.classList.remove('bg-danger'); - el.bar.classList.add('progress-bar-striped', 'progress-bar-animated'); + el.bar.classList.remove('is-danger'); + el.bar.classList.add('is-animated'); run(); }; diff --git a/source/packages/plg_system_mokosuitebackup/media/js/installer-backup.js b/source/packages/plg_system_mokosuitebackup/media/js/installer-backup.js index 1153e59a..6f80f850 100644 --- a/source/packages/plg_system_mokosuitebackup/media/js/installer-backup.js +++ b/source/packages/plg_system_mokosuitebackup/media/js/installer-backup.js @@ -1,17 +1,17 @@ /** * MokoSuiteBackup — full-screen backup before an EXTENSION update / uninstall. * - * Injected by plg_system_mokosuitebackup on the Extensions → Update and - * Extensions → Manage pages. Unlike the core Joomla update (which has a - * server-side page load we can redirect), com_installer's update.update and - * manage.remove are POST actions with a CSRF token and a checked cid[] list — - * so we intercept CLIENT-SIDE: capture the selection, go to the full-screen - * backup page, and on return restore the selection and re-submit the real POST - * form (fresh token) so the update/uninstall proceeds. + * Injected by plg_system_mokosuitebackup on Extensions → Update and + * Extensions → Manage. Joomla 6 renders those toolbar buttons as web + * components (`