// Failed step
var failedStep = '';
-var counterSuccess = 0;
// Init all installation steps
installationSteps[0] = 'import_tables_sql';
// Display progress window
displayProgressWindow('install', 'Init ...');
- // Start installation loop delayed
- window.setTimeout('doInstallationLoop()', 500);
+ // Wait for window fader
+ $().ready(function () {
+ // Start installation loop delayed
+ window.setTimeout('doInstallationLoop()', 500);
- // Wait here
- window.setTimeout('doWait()', 500);
-}
-
-// Do wait
-function doWait () {
- // Is still something to do?
- if ((failedStep == '') && (counterSuccess != installationSteps.length)) {
- // Wait one round more
- window.setTimeout('doWait()', 500);
- } else if ((failedStep == '') && (counterSuccess == installationSteps.length)) {
- // Close window
- closeProgressWindow('install', true, false);
-
- // Redirect to old 'finished' page
- document.location.href = 'admin.php';
- } else if (failedStep != '') {
- // Something happens that should not happen!
- displayErrorWindow('install', 'failedStep=' + failedStep);
- }
-}
-
-// Update progress bar
-function updateProgressBar () {
- // Increment counter
- counterSuccess++;
-
- // Do only update <= 100% values
- if (counterSuccess <= installationSteps.length) {
- // Update progress bar
- $('#progressbar').progressbar({
- value: (counterSuccess / installationSteps.length * 100)
- });
- } // END - if
+ // Wait here
+ $('body').delay(500);
+ });
}
// Does the "installation loop"
outputInstallationStepMessage(installationSteps[i]);
// Initialize next step
- if (!sendInstallationStepRequest(i) == true) {
+ if (sendInstallationStepRequest(i) === false) {
// Failed step, so remember it for later display
failedStep = installationSteps[i];
$('body').delay(500);
// Update progress bar
- updateProgressBar();
+ updateProgressBar(installationSteps.length);
} // END - for
// Is success counter same as array size
} // END - if
// Send out the request
- return sendAjaxRequest('install', 'do_step', '&step=' + installationSteps[i], true);
+ return sendAjaxRequest('install', 'do_step', '&step=' + installationSteps[i], false);
}
// Outputs a "step message"