Update of /cvsroot/qooxdoo/qooxdoo/source/script/transport
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5133/source/script/transport
Modified Files:
Tag: renderer
QxRequest.js QxResponse.js QxXmlHttpTransport.js
Log Message:
Initial real xmlhttp done
Index: QxRequest.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/transport/Attic/QxRequest.js,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** QxRequest.js 19 Jan 2006 10:59:40 -0000 1.1.2.4
--- QxRequest.js 19 Jan 2006 12:54:22 -0000 1.1.2.5
***************
*** 48,52 ****
QxRequest.addProperty({ name : "url", type : QxConst.TYPEOF_STRING });
! QxRequest.addProperty({ name : "method", type : QxConst.TYPEOF_STRING, possibleValues : [ "GET", "POST", "PUT", "HEAD", "DELETE" ] });
QxRequest.addProperty({ name : "asynchronous", type : QxConst.TYPEOF_BOOLEAN, defaultValue : true });
QxRequest.addProperty({ name : "data", type : QxConst.TYPEOF_OBJECT });
--- 48,52 ----
QxRequest.addProperty({ name : "url", type : QxConst.TYPEOF_STRING });
! QxRequest.addProperty({ name : "method", type : QxConst.TYPEOF_STRING, possibleValues : [ "GET", "POST", "PUT", "HEAD", "DELETE" ], defaultValue : "POST" });
QxRequest.addProperty({ name : "asynchronous", type : QxConst.TYPEOF_BOOLEAN, defaultValue : true });
QxRequest.addProperty({ name : "data", type : QxConst.TYPEOF_OBJECT });
Index: QxResponse.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/transport/Attic/QxResponse.js,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** QxResponse.js 18 Jan 2006 13:28:11 -0000 1.1.2.1
--- QxResponse.js 19 Jan 2006 12:54:22 -0000 1.1.2.2
***************
*** 50,52 ****
QxResponse.addProperty({ name : "statusMessage", type : QxConst.TYPEOF_STRING });
QxResponse.addProperty({ name : "textContent", type : QxConst.TYPEOF_STRING });
! QxResponse.addProperty({ name : "xmlContent", type : QxConst.TYPEOF_STRING });
--- 50,52 ----
QxResponse.addProperty({ name : "statusMessage", type : QxConst.TYPEOF_STRING });
QxResponse.addProperty({ name : "textContent", type : QxConst.TYPEOF_STRING });
! QxResponse.addProperty({ name : "xmlContent", type : QxConst.TYPEOF_OBJECT });
Index: QxXmlHttpTransport.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/transport/Attic/QxXmlHttpTransport.js,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** QxXmlHttpTransport.js 19 Jan 2006 10:59:40 -0000 1.1.2.4
--- QxXmlHttpTransport.js 19 Jan 2006 12:54:22 -0000 1.1.2.5
***************
*** 34,38 ****
QxTarget.call(this);
! this._req = QxXmlHttpTransport.createRequestObject();
};
--- 34,41 ----
QxTarget.call(this);
! this._req = QxXmlHttpTransport.createRequestObject();
!
! var o = this;
! this._req.onreadystatechange = function(e) { return o._onreadystatechange(e) };
};
***************
*** 121,130 ****
Determines what type of request to issue
*/
! QxXmlHttpTransport.addProperty({name : "method", type : QxConst.TYPEOF_STRING, defaultValue: "post" });
/*!
Set the request to asynchronous
*/
! QxXmlHttpTransport.addProperty({name : "asynchronous", type : QxConst.TYPEOF_BOOLEAN, defaultValue: true });
/*!
--- 124,133 ----
Determines what type of request to issue
*/
! QxXmlHttpTransport.addProperty({name : "method", type : QxConst.TYPEOF_STRING });
/*!
Set the request to asynchronous
*/
! QxXmlHttpTransport.addProperty({name : "asynchronous", type : QxConst.TYPEOF_BOOLEAN });
/*!
***************
*** 148,151 ****
--- 151,156 ----
+
+
/*
---------------------------------------------------------------------------
***************
*** 162,177 ****
this.debug("Sending...");
! if (this.hasEventListeners(QxConst.EVENT_TYPE_COMPLETE))
{
! this.debug("Complete!");
! this.dispatchEvent(new QxDataEvent(QxConst.EVENT_TYPE_COMPLETE,
! {
! statusCode : 404,
! statusMessage : "Not Found",
! xmlContent : "<xml>foo</xml>",
! textContent : "foo"
! }), true);
};
};
--- 167,235 ----
this.debug("Sending...");
! var vRequest = this.getRequest();
!
! if (this.getUsername())
{
! vRequest.open(this.getMethod(), this.getUrl(), this.getAsynchronous(), this.getUsername(), this.getPassword());
! }
! else
! {
! vRequest.open(this.getMethod(), this.getUrl(), this.getAsynchronous());
! };
!
! vRequest.send(null);
! };
!
!
!
!
!
!
!
!
! /*
! ---------------------------------------------------------------------------
! EVENT HANDLER
! ---------------------------------------------------------------------------
! */
!
! proto._onreadystatechange = function(e)
! {
! var vRequest = this.getRequest();
!
! this.debug("_onreadystatechange: " + vRequest.readyState);
!
! switch(vRequest.readyState)
! {
! case 1:
! break;
!
! case 2:
! break;
!
!
! case 3:
! break;
!
!
! case 4:
! if (this.hasEventListeners(QxConst.EVENT_TYPE_COMPLETE))
! {
! this.debug("Complete!");
!
! this.dispatchEvent(new QxDataEvent(QxConst.EVENT_TYPE_COMPLETE,
! {
! statusCode : vRequest.statusCode,
! statusMessage : vRequest.statusMessage,
! xmlContent : vRequest.responseXML,
! textContent : vRequest.responseText
! }), true);
! };
};
+
+
+
+
};
***************
*** 180,183 ****
--- 238,244 ----
+
+
+
/*
---------------------------------------------------------------------------
|