Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | 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
 
11
dojo.provide("dojo.rpc.YahooService");
12
dojo.require("dojo.rpc.RpcService");
13
dojo.require("dojo.rpc.JsonService");
14
dojo.require("dojo.json");
15
dojo.require("dojo.uri.*");
16
dojo.require("dojo.io.ScriptSrcIO");
17
dojo.rpc.YahooService = function (appId) {
18
	this.appId = appId;
19
	if (!appId) {
20
		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");
22
	}
23
	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");
25
	}
26
	this.connect(djConfig["yahooServiceSmdUrl"] || dojo.uri.moduleUri("dojo.rpc", "yahoo.smd"));
27
	this.strictArgChecks = false;
28
};
29
dojo.inherits(dojo.rpc.YahooService, dojo.rpc.JsonService);
30
dojo.lang.extend(dojo.rpc.YahooService, {strictArgChecks:false, bind:function (method, parameters, deferredRequestHandler, url) {
31
	var params = parameters;
32
	if ((dojo.lang.isArrayLike(parameters)) && (parameters.length == 1)) {
33
		params = parameters[0];
34
	}
35
	params.output = "json";
36
	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});
38
}});
39