diff --git a/index.php b/index.php index 1fdb2b5f..6151bef2 100644 --- a/index.php +++ b/index.php @@ -1791,10 +1791,9 @@ public function logVersion() {
  • -

    Keep maintenance mode active?

    +

    Continue with web based updater

  • @@ -2128,6 +2127,8 @@ function performStep(number, callback) { } }, 12: function (response) { + done = true; + window.removeEventListener('beforeunload', confirmExit); if (response.proceed === true) { successStep('step-done'); @@ -2135,10 +2136,16 @@ function performStep(number, callback) { var el = document.getElementById('step-done') .getElementsByClassName('output')[0]; el.classList.remove('hidden'); + + // above is the fallback if the Javascript redirect doesn't work + window.location.href = ""; } else { - errorStep('step-done', 11); + errorStep('step-done', 12); + var text = escapeHTML(response.response); + text += '
    Show detailed response
    ' +
    +						escapeHTML(response.detailedResponseText) + '
    '; + addStepText('step-done', text); } - done = true; }, }; @@ -2169,19 +2176,12 @@ function retryUpdate() { startUpdate(); } - function askForMaintenance(keepActive) { + function askForMaintenance() { var el = document.getElementById('step-maintenance-mode') .getElementsByClassName('output')[0]; - if (keepActive) { - el.innerHTML = 'Maintenance mode will kept active.
    Now trigger the migration via command line: ./occ upgrade
    '; - successStep('step-maintenance-mode'); - currentStep('step-done'); - performStep(12, performStepCallbacks[12]); - } else { - el.innerHTML = 'Maintenance mode will get disabled.
    '; - currentStep('step-maintenance-mode'); - performStep(11, performStepCallbacks[11]); - } + el.innerHTML = 'Maintenance mode will get disabled.
    '; + currentStep('step-maintenance-mode'); + performStep(11, performStepCallbacks[11]); } if(document.getElementById('startUpdateButton')) { @@ -2197,26 +2197,21 @@ function askForMaintenance(keepActive) { retryUpdate(); }; } - if(document.getElementById('maintenance-enable')) { - document.getElementById('maintenance-enable').onclick = function (e) { - e.preventDefault(); - askForMaintenance(true); - }; - } if(document.getElementById('maintenance-disable')) { document.getElementById('maintenance-disable').onclick = function (e) { e.preventDefault(); - askForMaintenance(false); + askForMaintenance(); }; } // Show a popup when user tries to close page - window.onbeforeunload = confirmExit; function confirmExit() { if (done === false && started === true) { return 'Update is in progress. Are you sure, you want to close?'; } } + // this is unregistered in step 12 + window.addEventListener('beforeunload', confirmExit);