Added ability to suppress errors for an action proxy
authorAlexander Ebert <ebert@woltlab.com>
Sat, 16 Feb 2013 18:29:41 +0000 (19:29 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 16 Feb 2013 18:29:41 +0000 (19:29 +0100)
wcfsetup/install/files/js/WCF.js

index 09651ef13362806ac46968e13e7ee846d28345c5..748c7e316e30708b50d5aff78e65dc2b0de6a0ad 100755 (executable)
@@ -1472,6 +1472,7 @@ WCF.Action.Proxy = Class.extend({
                        failure: null,
                        showLoadingOverlay: true,
                        success: null,
+                       suppressErrors: false,
                        type: 'POST',
                        url: 'index.php/AJAXProxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND
                }, options);
@@ -1479,7 +1480,7 @@ WCF.Action.Proxy = Class.extend({
                this.confirmationDialog = null;
                this.loading = null;
                this._showLoadingOverlayOnce = false;
-               this._suppressErrors = false;
+               this._suppressErrors = (this.options === true);
                
                // send request immediately after initialization
                if (this.options.autoSend) {
@@ -1513,6 +1514,13 @@ WCF.Action.Proxy = Class.extend({
                this._showLoadingOverlayOnce = true;
        },
        
+       /**
+        * Suppressed errors for this action proxy.
+        */
+       suppressErrors: function() {
+               this._suppressErrors = true;
+       },
+       
        /**
         * Fires before request is send, displays global loading status.
         */
@@ -5446,7 +5454,8 @@ WCF.System.KeepAlive = Class.extend({
                                        actionName: 'keepAlive',
                                        className: 'wcf\\data\\session\\SessionAction'
                                },
-                               showLoadingOverlay: false
+                               showLoadingOverlay: false,
+                               suppressErrors: true
                        });
                }, (seconds * 1000));
        }