web/data/cubicweb.compat.js
changeset 5698 5c8fa1650299
parent 5658 7b9553a9db65
child 5699 f4f6ee3af50b
--- a/web/data/cubicweb.compat.js	Wed Jun 09 12:32:54 2010 +0200
+++ b/web/data/cubicweb.compat.js	Wed Jun 09 12:39:55 2010 +0200
@@ -104,76 +104,6 @@
 );
 
 /**
- * .. function:: Deferred
- *
- * dummy ultra minimalist implementation on deferred for jQuery
- */
-function Deferred() {
-    this.__init__(this);
-}
-
-jQuery.extend(Deferred.prototype, {
-    __init__: function() {
-        this._onSuccess = [];
-        this._onFailure = [];
-        this._req = null;
-        this._result = null;
-        this._error = null;
-    },
-
-    addCallback: function(callback) {
-        if (this._req.readyState == 4) {
-            if (this._result) {
-                var args = [this._result, this._req];
-                jQuery.merge(args, cw.utils.sliceList(arguments, 1));
-                callback.apply(null, args);
-            }
-        }
-        else {
-            this._onSuccess.push([callback, cw.utils.sliceList(arguments, 1)]);
-        }
-        return this;
-    },
-
-    addErrback: function(callback) {
-        if (this._req.readyState == 4) {
-            if (this._error) {
-                callback.apply(null, [this._error, this._req]);
-            }
-        }
-        else {
-            this._onFailure.push([callback, cw.utils.sliceList(arguments, 1)]);
-        }
-        return this;
-    },
-
-    success: function(result) {
-        this._result = result;
-        try {
-            for (var i = 0; i < this._onSuccess.length; i++) {
-                var callback = this._onSuccess[i][0];
-                var args = [result, this._req];
-                jQuery.merge(args, this._onSuccess[i][1]);
-                callback.apply(null, args);
-            }
-        } catch(error) {
-            this.error(this.xhr, null, error);
-        }
-    },
-
-    error: function(xhr, status, error) {
-        this._error = error;
-        for (var i = 0; i < this._onFailure.length; i++) {
-            var callback = this._onFailure[i][0];
-            var args = [error, this._req];
-            jQuery.merge(args, this._onFailure[i][1]);
-            callback.apply(null, args);
-        }
-    }
-
-});
-
-/**
  * The only known usage of KEYS is in the tag cube. Once cubicweb-tag 1.7.0 is out,
  * this current definition can be removed.
  */