[Opensrf-commits] r1259 - trunk/src/javascript
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Mar 6 15:04:39 EST 2008
Author: erickson
Date: 2008-03-06 14:32:07 -0500 (Thu, 06 Mar 2008)
New Revision: 1259
Modified:
trunk/src/javascript/opensrf.js
Log:
added support for ses.request(method, param1, param2, ...) style requests
Modified: trunk/src/javascript/opensrf.js
===================================================================
--- trunk/src/javascript/opensrf.js 2008-03-06 17:28:04 UTC (rev 1258)
+++ trunk/src/javascript/opensrf.js 2008-03-06 19:32:07 UTC (rev 1259)
@@ -108,9 +108,21 @@
OpenSRF.ClientSession.prototype.request = function(args) {
+
+ if(typeof args == 'string') {
+ params = [];
+ for(var i = 1; i < arguments.length; i++)
+ params.push(arguments[i]);
+
+ args = {
+ method : args,
+ params : params
+ };
+ }
+
var req = new OpenSRF.Request(this, this.last_id++, args);
this.requests.push(req);
- req.send();
+ return req;
}
OpenSRF.ClientSession.prototype.find_request = function(reqid) {
More information about the opensrf-commits
mailing list