// Init variables
var currentTabId = null;
+var processDisplayed = false;
var errorDisplayed = false;
var warningDisplayed = false;
var defaultTabId = null;
// Marks a tab navigation entry
function markTabNavigation (prefix, tab) {
+ // Is process working?
+ if (processDisplayed == true) {
+ // Then exit silently
+ return;
+ } // END - if
+
// Get all li-tags
var li = document.getElementsByTagName('li');
// Enables a given footer navigation element
function enableFooterNavigationPage (element) {
// Remove the 'disabled' class and attribute
- enableElement('input#' + element + '_page');
+ if (element == 'finish') {
+ enableElement('input#finish');
+ } else {
+ enableElement('input#' + element + '_page');
+ disableElement('input#finish');
+ }
}
// Resets footer navigation by adding CSS class 'disabled'
// Is ajax_content set?
if (ajax_content.reply_content == undefined) {
// This shall not happen
- throw new 'ajax_content.reply_content not returned from ajax.php, please fix your scripts.';
+ throw new 'ajax_content.reply_content not returned from ajax.php, please fix your scripts. (1)';
} else if (ajax_content.reply_content == null) {
// This shall not happen, too
- throw new 'ajax_content.reply_content=null from ajax.php, please fix your scripts.';
+ throw new 'ajax_content.reply_content=null from ajax.php, please fix your scripts. (2)';
}
// Set AJAX reply
error: function (ajax_content) {
// Is ajax_content set?
if (ajax_content.reply_content == undefined) {
- // This shall not happen
- throw new 'ajax_content.reply_content not returned from ajax.php, please fix your scripts.';
+ // Is 'responseText' there?
+ if (ajax_content.responseText != undefined) {
+ // Then parse it
+ var obj = jQuery.parseJSON(ajax_content.responseText.replace('%20', ' '));
+
+ // Is 'reply_content' set?
+ if (obj.reply_content == undefined) {
+ // This shall not happen
+ throw new 'obj.reply_content not returned from ajax.php, please fix your scripts. (3)';
+ } // END - if
+
+ // Set it
+ setAjaxReply(obj.reply_content, false);
+ return false;
+ } else {
+ // This shall not happen
+ throw new 'ajax_content.reply_content not returned from ajax.php, please fix your scripts. (4)';
+ }
} else if (ajax_content.reply_content == null) {
// This shall not happen, too
- throw new 'ajax_content.reply_content=null from ajax.php, please fix your scripts.';
+ throw new 'ajax_content.reply_content=null from ajax.php, please fix your scripts. (5)';
}
// Set AJAX reply
// Enables footer navigation buttons
function enableFooterNavigation (prefix, tabId) {
+ // Is process working?
+ if (processDisplayed == true) {
+ // Then exit silently
+ return;
+ } // END - if
+
// Reset both footer navigation first
resetFooterNavigation();
// Requests an AJAX content
function requestAjaxContent (prefix, htmlId, tabId, footerNavigation) {
+ // Is process working?
+ if (processDisplayed == true) {
+ // Then exit silently
+ return;
+ } // END - if
+
// Check if this request is disabled
if ($('#' + prefix + '_' + tabId).hasClass('tab_disabled')) {
// Clicked on a disabled tabId so blur it
});
}
+// Displays the process window for given prefix and content
+function displayProcessWindow (prefix, ajax_content) {
+ // Fade out warning window, if open
+ //* DEBUG: */ alert('displayProcessWindow(): prefix=' + prefix + ' - calling closeWarningWindow()');
+ closeWarningWindow(prefix);
+
+ // Fade it out for eye-candy
+ closeErrorWindow(prefix);
+
+ // Fade it out for eye-candy
+ closeProcessWindow(prefix);
+
+ // Abort here if processDisplayed is still true
+ if (processDisplayed == true) {
+ // Make sure this doesn't happen
+ return;
+ } // END - if
+
+ // Copy the response text to the process variable
+ if (ajax_content.reply_content != undefined) {
+ $('#' + prefix + '_process_content').html(ajax_content.reply_content);
+ } else {
+ $('#' + prefix + '_process_content').html(ajax_content);
+ }
+
+ // Fade the process in
+ $('#' + prefix + '_process').fadeIn('slow', function() {
+ // Mark process as displayed
+ processDisplayed = true;
+ });
+}
+
// Waits until the window has been closed
function closeErrorLocked () {
// Has all been loaded?
}
}
+// Waits until the window has been closed
+function closeProcessLocked () {
+ // Has all been loaded?
+ if (processDisplayed == false) {
+ // Then release ready()
+ $.holdReady(false);
+ } else {
+ // Recursive call again
+ window.setTimeout('closeProcessLocked()', 10);
+ }
+}
+
// Closes an error window
function closeErrorWindow (prefix, waitClose, resetCurrentTabId) {
// Is the error displayed?
} // END - if
}
+// Closes an process window
+function closeProcessWindow (prefix, waitClose, resetCurrentTabId) {
+ // Is the process displayed?
+ if (processDisplayed == true) {
+ // Shall we wait ("sync") until the animation has completed?
+ if (waitClose == true) {
+ // Hold the ready status
+ $.holdReady(true);
+ } // END - if
+
+ // Yes, then fade it out
+ $('#' + prefix + '_process').fadeOut('fast', function() {
+ // Set current tab id to default
+ if (resetCurrentTabId == true) {
+ setCurrentTabId(defaultTabId);
+ } // END - if
+
+ // Mark it as closed
+ processDisplayed = false;
+ });
+
+ // Shall this animation be "synchronized"?
+ if (waitClose == true) {
+ // Wait for the window has been closed
+ closeProcessLocked();
+ } // END - if
+ } // END - if
+}
+
// Waits until the window has been closed
function closeWarningLocked () {
// Has all been loaded?
return;
} // END - if
+ // Is process working?
+ if (processDisplayed == true) {
+ // Then exit silently
+ return;
+ } // END - if
+
// Is there a 'next' entry?
//* DEBUG: */ alert('doFooterPage(): button=' + button + ',currentTabId=' + currentTabId + ',nextPage[currentTabId]=' + nextPage[currentTabId]);
if ((button == 'next') && (nextPage[currentTabId] != null)) {
// Saves changes by sending the data to the AJAX backend script
function saveChanges (prefix) {
+ // Is process working?
+ if (processDisplayed == true) {
+ // Then exit silently
+ return;
+ } // END - if
+
// Mark all elements as unchanged
markAllElementsAsUnchanged();
// Saves changed settings and continues with given tab
function doSaveChangesContinue (prefix, htmlId, tab) {
+ // Is process working?
+ if (processDisplayed == true) {
+ // Then exit silently
+ return;
+ } // END - if
+
// Save the changes
saveChanges(prefix);