Update of /cvsroot/qooxdoo/qooxdoo/source/script/transport
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6642/source/script/transport
Modified Files:
Tag: renderer
QxTransport.js
Log Message:
API cleanup
Index: QxTransport.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/transport/Attic/QxTransport.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
*** QxTransport.js 19 Jan 2006 16:26:51 -0000 1.1.2.8
--- QxTransport.js 19 Jan 2006 18:47:18 -0000 1.1.2.9
***************
*** 51,55 ****
QxTransport.addProperty({ name : "request", type : QxConst.TYPEOF_OBJECT, instance : "QxRequest" });
QxTransport.addProperty({ name : "implementation", type : QxConst.TYPEOF_OBJECT });
! QxTransport.addProperty({ name : "readyState", type : QxConst.TYPEOF_STRING, possibleValues : [ "configured", "sending", "receiving", "complete" ], defaultValue : "configured" });
--- 51,64 ----
QxTransport.addProperty({ name : "request", type : QxConst.TYPEOF_OBJECT, instance : "QxRequest" });
QxTransport.addProperty({ name : "implementation", type : QxConst.TYPEOF_OBJECT });
! QxTransport.addProperty(
! {
! name : "state",
! type : QxConst.TYPEOF_STRING,
! possibleValues : [
! QxConst.REQUEST_STATE_CONFIGURED, QxConst.REQUEST_STATE_SENDING,
! QxConst.REQUEST_STATE_RECEIVING, QxConst.REQUEST_STATE_COMPLETED
! ],
! defaultValue : QxConst.REQUEST_STATE_CONFIGURED
! });
***************
*** 69,73 ****
propOldValue.removeEventListener(QxConst.EVENT_TYPE_SENDING, this._onsending, this);
propOldValue.removeEventListener(QxConst.EVENT_TYPE_RECEIVING, this._onreceiving, this);
! propOldValue.removeEventListener(QxConst.EVENT_TYPE_COMPLETE, this._oncomplete, this);
propOldValue.dispose();
--- 78,82 ----
propOldValue.removeEventListener(QxConst.EVENT_TYPE_SENDING, this._onsending, this);
propOldValue.removeEventListener(QxConst.EVENT_TYPE_RECEIVING, this._onreceiving, this);
! propOldValue.removeEventListener(QxConst.EVENT_TYPE_COMPLETED, this._oncompleted, this);
propOldValue.dispose();
***************
*** 87,91 ****
propValue.addEventListener(QxConst.EVENT_TYPE_SENDING, this._onsending, this);
propValue.addEventListener(QxConst.EVENT_TYPE_RECEIVING, this._onreceiving, this);
! propValue.addEventListener(QxConst.EVENT_TYPE_COMPLETE, this._oncomplete, this);
propValue.send();
--- 96,100 ----
propValue.addEventListener(QxConst.EVENT_TYPE_SENDING, this._onsending, this);
propValue.addEventListener(QxConst.EVENT_TYPE_RECEIVING, this._onreceiving, this);
! propValue.addEventListener(QxConst.EVENT_TYPE_COMPLETED, this._oncompleted, this);
propValue.send();
***************
*** 95,116 ****
};
! proto._modifyReadyState = function(propValue, propOldValue, propData)
{
var vRequest = this.getRequest();
! this.debug("readyState: " + propValue);
switch(propValue)
{
! case QxConst.READY_STATE_SENDING:
vRequest.createDispatchEvent(QxConst.EVENT_TYPE_SENDING);
break;
! case QxConst.READY_STATE_RECEIVING:
vRequest.createDispatchEvent(QxConst.EVENT_TYPE_RECEIVING);
break;
! case QxConst.READY_STATE_COMPLETE:
! if (vRequest.hasEventListeners(QxConst.EVENT_TYPE_COMPLETE))
{
var vImpl = this.getImplementation();
--- 104,125 ----
};
! proto._modifyState = function(propValue, propOldValue, propData)
{
var vRequest = this.getRequest();
! this.debug("state: " + propValue);
switch(propValue)
{
! case QxConst.REQUEST_STATE_SENDING:
vRequest.createDispatchEvent(QxConst.EVENT_TYPE_SENDING);
break;
! case QxConst.REQUEST_STATE_RECEIVING:
vRequest.createDispatchEvent(QxConst.EVENT_TYPE_RECEIVING);
break;
! case QxConst.REQUEST_STATE_COMPLETED:
! if (vRequest.hasEventListeners(QxConst.EVENT_TYPE_COMPLETED))
{
var vImpl = this.getImplementation();
***************
*** 124,128 ****
// TODO: Response Headers
! vRequest.dispatchEvent(new QxDataEvent(QxConst.EVENT_TYPE_COMPLETE, vResponse), true);
};
--- 133,137 ----
// TODO: Response Headers
! vRequest.dispatchEvent(new QxDataEvent(QxConst.EVENT_TYPE_COMPLETED, vResponse), true);
};
***************
*** 233,244 ****
proto._onsending = function(e) {
! this.setReadyState(QxConst.READY_STATE_SENDING);
};
proto._onreceiving = function(e) {
! this.setReadyState(QxConst.READY_STATE_RECEIVING);
};
! proto._oncomplete = function(e) {
! this.setReadyState(QxConst.READY_STATE_COMPLETE);
};
--- 242,253 ----
proto._onsending = function(e) {
! this.setState(QxConst.REQUEST_STATE_SENDING);
};
proto._onreceiving = function(e) {
! this.setState(QxConst.REQUEST_STATE_RECEIVING);
};
! proto._oncompleted = function(e) {
! this.setState(QxConst.REQUEST_STATE_COMPLETED);
};
|