Subversion Repositories Applications.papyrus

Rev

Rev 1318 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1318 Rev 1422
1
/*
1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
3
	All Rights Reserved.
4
 
4
 
5
	Licensed under the Academic Free License version 2.1 or above OR the
5
	Licensed under the Academic Free License version 2.1 or above OR the
6
	modified BSD license. For more information on Dojo licensing, see:
6
	modified BSD license. For more information on Dojo licensing, see:
7
 
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
9
*/
-
 
10
 
-
 
11
 
10
 
12
 
11
dojo.provide("dojo.rpc.YahooService");
13
dojo.provide("dojo.rpc.YahooService");
12
dojo.require("dojo.rpc.RpcService");
14
dojo.require("dojo.rpc.RpcService");
13
dojo.require("dojo.rpc.JsonService");
15
dojo.require("dojo.rpc.JsonService");
14
dojo.require("dojo.json");
16
dojo.require("dojo.json");
15
dojo.require("dojo.uri.*");
17
dojo.require("dojo.uri.*");
16
dojo.require("dojo.io.ScriptSrcIO");
18
dojo.require("dojo.io.ScriptSrcIO");
17
dojo.rpc.YahooService = function (appId) {
19
dojo.rpc.YahooService = function (appId) {
18
	this.appId = appId;
20
	this.appId = appId;
19
	if (!appId) {
21
	if (!appId) {
20
		this.appId = "dojotoolkit";
22
		this.appId = "dojotoolkit";
21
		dojo.debug("please initialize the YahooService class with your own", "application ID. Using the default may cause problems during", "deployment of your application");
23
		dojo.debug("please initialize the YahooService class with your own", "application ID. Using the default may cause problems during", "deployment of your application");
22
	}
24
	}
23
	if (djConfig["useXDomain"] && !djConfig["yahooServiceSmdUrl"]) {
25
	if (djConfig["useXDomain"] && !djConfig["yahooServiceSmdUrl"]) {
24
		dojo.debug("dojo.rpc.YahooService: When using cross-domain Dojo builds," + " please save yahoo.smd to your domain and set djConfig.yahooServiceSmdUrl" + " to the path on your domain to yahoo.smd");
26
		dojo.debug("dojo.rpc.YahooService: When using cross-domain Dojo builds," + " please save yahoo.smd to your domain and set djConfig.yahooServiceSmdUrl" + " to the path on your domain to yahoo.smd");
25
	}
27
	}
26
	this.connect(djConfig["yahooServiceSmdUrl"] || dojo.uri.moduleUri("dojo.rpc", "yahoo.smd"));
28
	this.connect(djConfig["yahooServiceSmdUrl"] || dojo.uri.moduleUri("dojo.rpc", "yahoo.smd"));
27
	this.strictArgChecks = false;
29
	this.strictArgChecks = false;
28
};
30
};
29
dojo.inherits(dojo.rpc.YahooService, dojo.rpc.JsonService);
31
dojo.inherits(dojo.rpc.YahooService, dojo.rpc.JsonService);
30
dojo.lang.extend(dojo.rpc.YahooService, {strictArgChecks:false, bind:function (method, parameters, deferredRequestHandler, url) {
32
dojo.lang.extend(dojo.rpc.YahooService, {strictArgChecks:false, bind:function (method, parameters, deferredRequestHandler, url) {
31
	var params = parameters;
33
	var params = parameters;
32
	if ((dojo.lang.isArrayLike(parameters)) && (parameters.length == 1)) {
34
	if ((dojo.lang.isArrayLike(parameters)) && (parameters.length == 1)) {
33
		params = parameters[0];
35
		params = parameters[0];
34
	}
36
	}
35
	params.output = "json";
37
	params.output = "json";
36
	params.appid = this.appId;
38
	params.appid = this.appId;
37
	dojo.io.bind({url:url || this.serviceUrl, transport:"ScriptSrcTransport", content:params, jsonParamName:"callback", mimetype:"text/json", load:this.resultCallback(deferredRequestHandler), error:this.errorCallback(deferredRequestHandler), preventCache:true});
39
	dojo.io.bind({url:url || this.serviceUrl, transport:"ScriptSrcTransport", content:params, jsonParamName:"callback", mimetype:"text/json", load:this.resultCallback(deferredRequestHandler), error:this.errorCallback(deferredRequestHandler), preventCache:true});
38
}});
40
}});
39
 
41