Update of /cvsroot/qooxdoo/qooxdoo/source/script/transport
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24347/source/script/transport
Modified Files:
Tag: renderer
QxRequest.js QxTransport.js
Log Message:
Improved QxRequest object
Index: QxRequest.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/transport/Attic/QxRequest.js,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -C2 -d -r1.1.2.8 -r1.1.2.9
*** QxRequest.js 19 Jan 2006 13:58:25 -0000 1.1.2.8
--- QxRequest.js 19 Jan 2006 15:07:44 -0000 1.1.2.9
***************
*** 34,37 ****
--- 34,41 ----
QxTarget.call(this);
+ this.addEventListener("prepared", this._onprepared);
+ this.addEventListener("loading", this._onloading);
+ this.addEventListener("complete", this._oncomplete);
+
this.setUrl(vUrl);
};
***************
*** 112,118 ****
/*
---------------------------------------------------------------------------
! MODIFIERS
---------------------------------------------------------------------------
*/
--- 116,146 ----
+
/*
---------------------------------------------------------------------------
! EVENT HANDLER
! ---------------------------------------------------------------------------
! */
!
! proto._onprepared = function(e) {
! this.setReadyState("prepared");
! };
!
! proto._onloading = function(e) {
! this.setReadyState("loading");
! };
!
! proto._oncomplete = function(e) {
! this.setReadyState("complete");
! };
!
!
!
!
!
!
! /*
! ---------------------------------------------------------------------------
! MODIFIER
---------------------------------------------------------------------------
*/
***************
*** 120,141 ****
proto._modifyReadyState = function(propValue, propOldValue, propData)
{
! switch(propValue)
! {
! case QxRequest.READY_STATE_PREPARED:
! // this should normally never be called
! break;
!
! case QxRequest.READY_STATE_LOADING:
! // support loading state informations (how to name the real transport event?)
! // startLoading vs. loading
! this.createDispatchEvent("loading");
! break;
!
! case QxRequest.READY_STATE_COMPLETE:
! // send QxResponse instance through QxDataEvent?
! this.createDispatchDataEvent("complete");
! break;
! };
!
return true;
};
--- 148,174 ----
proto._modifyReadyState = function(propValue, propOldValue, propData)
{
! this.debug("readyState [norm]: " + propValue);
return true;
};
+
+
+
+
+ /*
+ ---------------------------------------------------------------------------
+ DISPOSER
+ ---------------------------------------------------------------------------
+ */
+
+ proto.dispose = function()
+ {
+ if (this.getDisposed()) {
+ return;
+ };
+
+ this.removeEventListener("prepared", this._onprepared);
+ this.removeEventListener("loading", this._onloading);
+ this.removeEventListener("complete", this._oncomplete);
+
+ return QxTarget.prototype.dispose.call(this);
+ };
Index: QxTransport.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/transport/Attic/QxTransport.js,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -d -r1.1.2.6 -r1.1.2.7
*** QxTransport.js 19 Jan 2006 13:56:09 -0000 1.1.2.6
--- QxTransport.js 19 Jan 2006 15:07:44 -0000 1.1.2.7
***************
*** 104,110 ****
--- 104,112 ----
{
case "prepared":
+ vRequest.createDispatchEvent("prepared");
break;
case "loading":
+ vRequest.createDispatchEvent("loading");
break;
|