Subversion Repositories Applications.papyrus

Rev

Rev 1318 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1318 alexandre_ 1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
4
 
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:
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
10
 
1422 alexandre_ 11
 
12
 
1318 alexandre_ 13
dojo.provide("dojo.rpc.YahooService");
14
dojo.require("dojo.rpc.RpcService");
15
dojo.require("dojo.rpc.JsonService");
16
dojo.require("dojo.json");
17
dojo.require("dojo.uri.*");
18
dojo.require("dojo.io.ScriptSrcIO");
19
dojo.rpc.YahooService = function (appId) {
20
	this.appId = appId;
21
	if (!appId) {
22
		this.appId = "dojotoolkit";
23
		dojo.debug("please initialize the YahooService class with your own", "application ID. Using the default may cause problems during", "deployment of your application");
24
	}
25
	if (djConfig["useXDomain"] && !djConfig["yahooServiceSmdUrl"]) {
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");
27
	}
28
	this.connect(djConfig["yahooServiceSmdUrl"] || dojo.uri.moduleUri("dojo.rpc", "yahoo.smd"));
29
	this.strictArgChecks = false;
30
};
31
dojo.inherits(dojo.rpc.YahooService, dojo.rpc.JsonService);
32
dojo.lang.extend(dojo.rpc.YahooService, {strictArgChecks:false, bind:function (method, parameters, deferredRequestHandler, url) {
33
	var params = parameters;
34
	if ((dojo.lang.isArrayLike(parameters)) && (parameters.length == 1)) {
35
		params = parameters[0];
36
	}
37
	params.output = "json";
38
	params.appid = this.appId;
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});
40
}});
41