/**
* JavaScript for common installer functions
* --------------------------------------------------------------------
- * $Revision:: $
- * $Date:: $
- * $Tag:: 0.2.1-FINAL $
- * $Author:: $
- * --------------------------------------------------------------------
* Copyright (c) 2003 - 2009 by Roland Haeder
- * Copyright (c) 2009 - 2012 by Mailer Developer Team
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team
* For more information visit: http://mxchange.org
*
* This program is free software; you can redistribute it and/or modify
// Failed step
var failedStep = '';
-var counterSuccess = 0;
// Init all installation steps
installationSteps[0] = 'import_tables_sql';
installationSteps[1] = 'import_menu_sql';
installationSteps[2] = 'install_extensions';
+installationSteps[3] = 'register_first_admin';
// Always keep as last step
installationSteps[installationSteps.length] = 'write_local_config';
// Display progress window
displayProgressWindow('install', 'Init ...');
- // 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++;
+ // Wait for window fader
+ $().ready(function () {
+ // Start installation loop delayed
+ window.setTimeout('doInstallationLoop()', 500);
- // 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"
function doInstallationLoop () {
+ // Reset counter
+ counterSuccess = 0;
+
// For-loop for all installation steps
for (var i = 0; i < installationSteps.length; i++) {
// Output message
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
if (counterSuccess != installationSteps.length) {
// Display error message
displayErrorWindow('install', getAjaxContent() + ':' + counterSuccess + '/' + installationSteps.length + ':' + failedStep);
- } // END - if
+ } else {
+ // Redirect to admin.php
+ document.location.href = 'admin.php';
+ }
}
// Sends an "installation step" request out
} // 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"