]> git.wh0rd.org - tt-rss.git/blobdiff - lib/dojo/rpc/JsonpService.js
upgrade dojo to 1.8.3 (refs #570)
[tt-rss.git] / lib / dojo / rpc / JsonpService.js
index ecdadc7fcc08bdfa570821e11f2ce2be2361427c..e6b16ceef1058dc18359876d582693e0dd9290d6 100644 (file)
@@ -1,73 +1,8 @@
 /*
-       Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+       Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved.
        Available via Academic Free License >= 2.1 OR the modified BSD license.
        see: http://dojotoolkit.org/license for details
 */
 
-
-if(!dojo._hasResource["dojo.rpc.JsonpService"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.rpc.JsonpService"] = true;
-dojo.provide("dojo.rpc.JsonpService");
-dojo.require("dojo.rpc.RpcService");
-dojo.require("dojo.io.script");
-
-
-dojo.declare("dojo.rpc.JsonpService", dojo.rpc.RpcService, {
-       // summary:
-       //      Generic JSONP service.  Minimally extends RpcService to allow
-       //      easy definition of nearly any JSONP style service. Example
-       //      SMD files exist in dojox.data
-
-       constructor: function(args, requiredArgs){
-               if(this.required) {
-                       if(requiredArgs){
-                               dojo.mixin(this.required, requiredArgs);
-                       }
-
-                       dojo.forEach(this.required, function(req){
-                               if(req=="" || req==undefined){
-                                       throw new Error("Required Service Argument not found: "+req);
-                               }
-                       });
-               }
-       },
-
-       strictArgChecks: false,
-
-       bind: function(method, parameters, deferredRequestHandler, url){
-               //summary:
-               //              JSONP bind method. Takes remote method, parameters,
-               //              deferred, and a url, calls createRequest to make a JSON-RPC
-               //              envelope and passes that off with bind.
-               //      method: string
-               //              The name of the method we are calling
-               //      parameters: array
-               //              The parameters we are passing off to the method
-               //      deferredRequestHandler: deferred
-               //              The Deferred object for this particular request
-
-               var def = dojo.io.script.get({
-                       url: url||this.serviceUrl,
-                       callbackParamName: this.callbackParamName||"callback",
-                       content: this.createRequest(parameters),
-                       timeout: this.timeout,
-                       handleAs: "json",
-                       preventCache: true
-               });
-               def.addCallbacks(this.resultCallback(deferredRequestHandler), this.errorCallback(deferredRequestHandler));
-       },
-
-       createRequest: function(parameters){
-               // summary:
-               //      create a JSONP req
-               //      params: array
-               //              The array of parameters for this request;
-
-               var params = (dojo.isArrayLike(parameters) && parameters.length==1) ?
-                               parameters[0] : {};
-               dojo.mixin(params,this.required);
-               return params;
-       }
-});
-
-}
+//>>built
+define("dojo/rpc/JsonpService",["../_base/array","../_base/declare","../_base/lang","./RpcService","../io/script"],function(_1,_2,_3,_4,_5){return _2("dojo.rpc.JsonpService",_4,{constructor:function(_6,_7){if(this.required){if(_7){_3.mixin(this.required,_7);}_1.forEach(this.required,function(_8){if(_8==""||_8==undefined){throw new Error("Required Service Argument not found: "+_8);}});}},strictArgChecks:false,bind:function(_9,_a,_b,_c){var _d=_5.get({url:_c||this.serviceUrl,callbackParamName:this.callbackParamName||"callback",content:this.createRequest(_a),timeout:this.timeout,handleAs:"json",preventCache:true});_d.addCallbacks(this.resultCallback(_b),this.errorCallback(_b));},createRequest:function(_e){var _f=(_3.isArrayLike(_e)&&_e.length==1)?_e[0]:{};_3.mixin(_f,this.required);return _f;}});});
\ No newline at end of file