Update of /cvsroot/qooxdoo/qooxdoo/source/script/transport
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5380/source/script/transport
Modified Files:
Tag: renderer
QxRequest.js
Log Message:
Major API cleanup: renamed readyState to state, etc.
Index: QxRequest.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/transport/Attic/QxRequest.js,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -C2 -d -r1.1.2.10 -r1.1.2.11
*** QxRequest.js 19 Jan 2006 16:26:51 -0000 1.1.2.10
--- QxRequest.js 19 Jan 2006 18:43:59 -0000 1.1.2.11
***************
*** 34,41 ****
QxTarget.call(this);
! this.addEventListener("scheduled", this._onscheduled);
! this.addEventListener("sending", this._onsending);
! this.addEventListener("receiving", this._onreceiving);
! this.addEventListener("complete", this._oncomplete);
this.setUrl(vUrl);
--- 34,41 ----
QxTarget.call(this);
! this.addEventListener(QxConst.EVENT_TYPE_QUEUED, this._onqueued);
! this.addEventListener(QxConst.EVENT_TYPE_SENDING, this._onsending);
! this.addEventListener(QxConst.EVENT_TYPE_RECEIVING, this._onreceiving);
! this.addEventListener(QxConst.EVENT_TYPE_COMPLETED, this._oncompleted);
this.setUrl(vUrl);
***************
*** 61,65 ****
QxRequest.addProperty({ name : "username", type : QxConst.TYPEOF_STRING });
QxRequest.addProperty({ name : "password", type : QxConst.TYPEOF_STRING });
! QxRequest.addProperty({ name : "readyState", type : QxConst.TYPEOF_STRING, possibleValues : [ "configured", "scheduled", "sending", "receiving", "complete" ], defaultValue : "configured" });
--- 61,75 ----
QxRequest.addProperty({ name : "username", type : QxConst.TYPEOF_STRING });
QxRequest.addProperty({ name : "password", type : QxConst.TYPEOF_STRING });
! QxRequest.addProperty(
! {
! name : "state",
! type : QxConst.TYPEOF_STRING,
! possibleValues : [
! QxConst.REQUEST_STATE_CONFIGURED, QxConst.REQUEST_STATE_QUEUED,
! QxConst.REQUEST_STATE_SENDING, QxConst.REQUEST_STATE_RECEIVING,
! QxConst.REQUEST_STATE_COMPLETED
! ],
! defaultValue : QxConst.REQUEST_STATE_CONFIGURED
! });
***************
*** 85,96 ****
proto.reset = function()
{
! switch(this.getReadyState())
{
! case QxConst.READY_STATE_SENDING:
! case QxConst.READY_STATE_RECEIVING:
this.error("Aborting already sent request!");
// no break
! case QxConst.READY_STATE_SCHEDULED:
this.abort();
break;
--- 95,106 ----
proto.reset = function()
{
! switch(this.getState())
{
! case QxConst.REQUEST_STATE_SENDING:
! case QxConst.REQUEST_STATE_RECEIVING:
this.error("Aborting already sent request!");
// no break
! case QxConst.REQUEST_STATE_QUEUED:
this.abort();
break;
***************
*** 109,134 ****
/*
---------------------------------------------------------------------------
! READY STATE ALIASES
---------------------------------------------------------------------------
*/
proto.isConfigured = function() {
! return this.getReadyState() === QxConst.READY_STATE_CONFIGURED;
};
! proto.isScheduled = function() {
! return this.getReadyState() === QxConst.READY_STATE_SCHEDULED;
};
proto.isSending = function() {
! return this.getReadyState() === QxConst.READY_STATE_SENDING;
};
proto.isLoading = function() {
! return this.getReadyState() === QxConst.READY_STATE_RECEIVING;
};
! proto.isComplete = function() {
! return this.getReadyState() === QxConst.READY_STATE_COMPLETE;
};
--- 119,144 ----
/*
---------------------------------------------------------------------------
! STATE ALIASES
---------------------------------------------------------------------------
*/
proto.isConfigured = function() {
! return this.getState() === QxConst.REQUEST_STATE_CONFIGURED;
};
! proto.isQueued = function() {
! return this.getState() === QxConst.REQUEST_STATE_QUEUED;
};
proto.isSending = function() {
! return this.getState() === QxConst.REQUEST_STATE_SENDING;
};
proto.isLoading = function() {
! return this.getState() === QxConst.REQUEST_STATE_RECEIVING;
};
! proto.isCompleted = function() {
! return this.getState() === QxConst.REQUEST_STATE_COMPLETED;
};
***************
*** 147,167 ****
proto._onabort = function(e) {
! this.setReadyState(QxConst.READY_STATE_CONFIGURED);
};
! proto._onscheduled = function(e) {
! this.setReadyState(QxConst.READY_STATE_SCHEDULED);
};
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);
};
--- 157,177 ----
proto._onabort = function(e) {
! this.setState(QxConst.REQUEST_STATE_CONFIGURED);
};
! proto._onqueued = function(e) {
! this.setState(QxConst.REQUEST_STATE_QUEUED);
};
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);
};
***************
*** 179,185 ****
*/
! proto._modifyReadyState = function(propValue, propOldValue, propData)
{
! this.debug("readyState: " + propValue);
return true;
};
--- 189,195 ----
*/
! proto._modifyState = function(propValue, propOldValue, propData)
{
! this.debug("state: " + propValue);
return true;
};
***************
*** 204,211 ****
};
! this.removeEventListener("scheduled", this._onscheduled);
! this.removeEventListener("sending", this._onsending);
! this.removeEventListener("receiving", this._onreceiving);
! this.removeEventListener("complete", this._oncomplete);
return QxTarget.prototype.dispose.call(this);
--- 214,221 ----
};
! this.removeEventListener(QxConst.EVENT_TYPE_QUEUED, this._onqueued);
! this.removeEventListener(QxConst.EVENT_TYPE_SENDING, this._onsending);
! this.removeEventListener(QxConst.EVENT_TYPE_RECEIVING, this._onreceiving);
! this.removeEventListener(QxConst.EVENT_TYPE_COMPLETED, this._oncompleted);
return QxTarget.prototype.dispose.call(this);
|