[Xmpp4js-commit] SF.net SVN: xmpp4js: [730] trunk/src
Status: Beta
Brought to you by:
h-iverson
From: <h-i...@us...> - 2008-07-07 20:45:53
|
Revision: 730 http://xmpp4js.svn.sourceforge.net/xmpp4js/?rev=730&view=rev Author: h-iverson Date: 2008-07-07 13:45:50 -0700 (Mon, 07 Jul 2008) Log Message: ----------- remove urlEncoder dependence and a couple more Observable references I forgot in test dir Modified Paths: -------------- trunk/src/main/javascript/adapter/Default.js trunk/src/main/javascript/transport/Script.js trunk/src/test/javascript/common-test-library.js Modified: trunk/src/main/javascript/adapter/Default.js =================================================================== --- trunk/src/main/javascript/adapter/Default.js 2008-07-07 20:35:35 UTC (rev 729) +++ trunk/src/main/javascript/adapter/Default.js 2008-07-07 20:45:50 UTC (rev 730) @@ -367,6 +367,30 @@ return xhr; }, + urlEncode: function (clearString) { + var output = ''; + var x = 0; + clearString = clearString.toString(); + var regex = /(^[a-zA-Z0-9_.]*)/; + while (x < clearString.length) { + var match = regex.exec(clearString.substr(x)); + if (match != null && match.length > 1 && match[1] != '') { + output += match[1]; + x += match[1].length; + } else { + if (clearString[x] == ' ') { + output += '+'; + } else { + var charCode = clearString.charCodeAt(x); + var hexVal = charCode.toString(16); + output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase(); + } + x++; + } + } + return output; + }, + noOp: function(){} Modified: trunk/src/main/javascript/transport/Script.js =================================================================== --- trunk/src/main/javascript/transport/Script.js 2008-07-07 20:35:35 UTC (rev 729) +++ trunk/src/main/javascript/transport/Script.js 2008-07-07 20:45:50 UTC (rev 730) @@ -76,7 +76,7 @@ // TODO check for max length constraints in browsers // HACK substr(5) takes out body=; there should be a method to // only encode the right-hand side of the params. - var requestUrl = this.endpoint+"?"+Ext.urlEncode({body: xml}).substr(5); + var requestUrl = this.endpoint+"?"+Soashable.Lang.urlEncode(xml); var scriptElem = document.createElement( "script" ); scriptElem.setAttribute( "type", "text/javascript" ); Modified: trunk/src/test/javascript/common-test-library.js =================================================================== --- trunk/src/test/javascript/common-test-library.js 2008-07-07 20:35:35 UTC (rev 729) +++ trunk/src/test/javascript/common-test-library.js 2008-07-07 20:45:50 UTC (rev 730) @@ -21,7 +21,7 @@ }; }; -Soashable.Lang.extend( MockRequest, Ext.util.Observable, { +Soashable.Lang.extend( MockRequest, Soashable.Event.EventProvider, { request: function(options) { this.fireEvent( "beforerequest", this, options ); @@ -237,7 +237,7 @@ } } -Soashable.Lang.extend( TestTransport, Ext.util.Observable, TestTransport.prototype ); +Soashable.Lang.extend( TestTransport, Soashable.Event.EventProvider, TestTransport.prototype ); @@ -322,4 +322,4 @@ } } -Soashable.Lang.extend( MockConnection, Ext.util.Observable, MockConnection.prototype ); +Soashable.Lang.extend( MockConnection, Soashable.Event.EventProvider, MockConnection.prototype ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |