]> git.mxchange.org Git - mailer.git/blobdiff - js/ajax-common.js
Code style changed, ext-user continued:
[mailer.git] / js / ajax-common.js
index 01c56a9febc6df85b6fdd0c099e5828c71a046af..113864a9ee58b7b626fcba27c4034058b76bd9d6 100644 (file)
@@ -193,16 +193,16 @@ function sendAjaxRequest (level, doValue, extra, isJson) {
                // Called on success
                success: function (ajax_content) {
                        // Is ajax_content set?
-                       if (ajax_content.responseText == undefined) {
+                       if (ajax_content.reply_content == undefined) {
                                // This shall not happen
-                               throw new 'ajax_content.responseText not returned from ajax.php, please fix your scripts.';
-                       } else if (ajax_content.responseText == null) {
+                               throw new 'ajax_content.reply_content not returned from ajax.php, please fix your scripts.';
+                       } else if (ajax_content.reply_content == null) {
                                // This shall not happen, too
-                               throw new 'ajax_content.responseText=null from ajax.php, please fix your scripts.';
+                               throw new 'ajax_content.reply_content=null from ajax.php, please fix your scripts.';
                        }
 
                        // Set AJAX reply
-                       setAjaxReply(ajax_content.responseText, isJson);
+                       setAjaxReply(ajax_content.reply_content, isJson);
 
                        // Mark it as success
                        setAjaxSuccess(true);
@@ -211,16 +211,16 @@ function sendAjaxRequest (level, doValue, extra, isJson) {
                // Called in case of an error (e.g. HTTP response status not '200 OK')
                error: function (ajax_content) {
                        // Is ajax_content set?
-                       if (ajax_content.responseText == undefined) {
+                       if (ajax_content.reply_content == undefined) {
                                // This shall not happen
-                               throw new 'ajax_content.responseText not returned from ajax.php, please fix your scripts.';
-                       } else if (ajax_content.responseText == null) {
+                               throw new 'ajax_content.reply_content not returned from ajax.php, please fix your scripts.';
+                       } else if (ajax_content.reply_content == null) {
                                // This shall not happen, too
-                               throw new 'ajax_content.responseText=null from ajax.php, please fix your scripts.';
+                               throw new 'ajax_content.reply_content=null from ajax.php, please fix your scripts.';
                        }
 
                        // Set AJAX reply
-                       setAjaxReply(ajax_content.responseText, isJson);
+                       setAjaxReply(ajax_content.reply_content, isJson);
                }
        });
 
@@ -379,8 +379,8 @@ function displayErrorWindow (prefix, ajax_content) {
        } // END - if
 
        // Copy the response text to the error variable
-       if (ajax_content.responseText != undefined) {
-               $('#' + prefix + '_error_content').html(ajax_content.responseText);
+       if (ajax_content.reply_content != undefined) {
+               $('#' + prefix + '_error_content').html(ajax_content.reply_content);
        } else {
                $('#' + prefix + '_error_content').html(ajax_content);
        }
@@ -491,7 +491,7 @@ function doFooterPage (prefix, htmlId, button) {
                return;
        } // END - if
 
-       // Do we have a 'next' entry?
+       // Is there a 'next' entry?
        //* DEBUG: */ alert('doFooterPage(): button=' + button + ',currentTabId=' + currentTabId + ',nextPage[currentTabId]=' + nextPage[currentTabId]);
        if ((button == 'next') && (nextPage[currentTabId] != null)) {
                // Then call the AJAX requester
@@ -592,7 +592,7 @@ function saveChanges (prefix) {
        // Mark all elements as unchanged
        markAllElementsAsUnchanged();
 
-       // Do we have changed elements
+       // Is there changed elements
        if (changedElements.length == 0) {
                // This should not happen
                displayErrorWindow(prefix, '<div class="ajax_error_message">saveChanges() called with no changed elements.</div>');
@@ -624,7 +624,7 @@ function saveChanges (prefix) {
                        // Reset form
                        resetMailerAjaxForm();
                } else {
-                       // Do we have 'failed_fields' set?
+                       // Is there 'failed_fields' set?
                        if ((ajax_content.failed_fields != undefined) && (ajax_content.message != undefined)) {
                                // Mark all fields as 'failed'
                                markFormFieldsFailed(ajax_content.failed_fields);