Subversion Repositories Applications.papyrus

Rev

Rev 1372 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1372 Rev 1422
Line 97... Line 97...
97
dojo.locale  = djConfig.locale;
97
dojo.locale  = djConfig.locale;
Line 98... Line 98...
98
 
98
 
99
//TODOC:  HOW TO DOC THIS?
99
//TODOC:  HOW TO DOC THIS?
100
dojo.version = {
100
dojo.version = {
101
	// summary: version number of this instance of dojo.
101
	// summary: version number of this instance of dojo.
102
	major: 0, minor: 4, patch: 2, flag: "",
102
	major: 0, minor: 4, patch: 3, flag: "",
103
	revision: Number("$Rev: 7616 $".match(/[0-9]+/)[0]),
103
	revision: Number("$Rev: 8617 $".match(/[0-9]+/)[0]),
104
	toString: function(){
104
	toString: function(){
105
		with(dojo.version){
105
		with(dojo.version){
106
			return major + "." + minor + "." + patch + flag + " (" + revision + ")";	// String
106
			return major + "." + minor + "." + patch + flag + " (" + revision + ")";	// String
107
		}
107
		}
Line 1388... Line 1388...
1388
			oldHandler.apply(node, arguments);
1388
			oldHandler.apply(node, arguments);
1389
		}
1389
		}
1390
		return true;
1390
		return true;
1391
	}
1391
	}
Line -... Line 1392...
-
 
1392
 
1392
 
1393
	dojo.hostenv._djInitFired = false;
1393
	//	BEGIN DOMContentLoaded, from Dean Edwards (http://dean.edwards.name/weblog/2006/06/again/)
1394
	//	BEGIN DOMContentLoaded, from Dean Edwards (http://dean.edwards.name/weblog/2006/06/again/)
-
 
1395
	function dj_load_init(e){
1394
	function dj_load_init(e){
1396
		dojo.hostenv._djInitFired = true;
1395
		// allow multiple calls, only first one will take effect
1397
		// allow multiple calls, only first one will take effect
1396
		// A bug in khtml calls events callbacks for document for event which isnt supported
1398
		// A bug in khtml calls events callbacks for document for event which isnt supported
1397
		// for example a created contextmenu event calls DOMContentLoaded, workaround
1399
		// for example a created contextmenu event calls DOMContentLoaded, workaround
1398
		var type = (e && e.type) ? e.type.toLowerCase() : "load";
1400
		var type = (e && e.type) ? e.type.toLowerCase() : "load";
Line 2220... Line 2222...
2220
	 */
2222
	 */
2221
	useCache: false,
2223
	useCache: false,
Line 2222... Line 2224...
2222
 
2224
 
2223
	/** Prevent the browser from caching this by adding a query string argument to the URL */
2225
	/** Prevent the browser from caching this by adding a query string argument to the URL */
-
 
2226
	preventCache: false,
-
 
2227
 
-
 
2228
	jsonFilter: function(value){
-
 
2229
		if(	(this.mimetype == "text/json-comment-filtered")||
-
 
2230
			(this.mimetype == "application/json-comment-filtered")
-
 
2231
		){
-
 
2232
			var cStartIdx = value.indexOf("\/*");
-
 
2233
			var cEndIdx = value.lastIndexOf("*\/");
-
 
2234
			if((cStartIdx == -1)||(cEndIdx == -1)){
-
 
2235
				dojo.debug("your JSON wasn't comment filtered!"); // FIXME: throw exception instead?
-
 
2236
				return "";
-
 
2237
			}
-
 
2238
			return value.substring(cStartIdx+2, cEndIdx);
-
 
2239
		}
-
 
2240
		dojo.debug("please consider using a mimetype of text/json-comment-filtered to avoid potential security issues with JSON endpoints");
-
 
2241
		return value;
Line 2224... Line 2242...
2224
	preventCache: false,
2242
	},
2225
	
2243
	
2226
	// events stuff
2244
	// events stuff
2227
	load: function(/*String*/type, /*Object*/data, /*Object*/transportImplementation, /*Object*/kwArgs){
2245
	load: function(/*String*/type, /*Object*/data, /*Object*/transportImplementation, /*Object*/kwArgs){
Line 2890... Line 2908...
2890
});
2908
});
Line 2891... Line 2909...
2891
 
2909
 
Line 2892... Line 2910...
2892
dojo.provide("dojo.lang.func");
2910
dojo.provide("dojo.lang.func");
2893
 
2911
 
2894
 
2912
 
2895
dojo.lang.hitch = function(/*Object*/thisObject, /*Function|String*/method){
2913
dojo.lang.hitch = function(/*Object*/thisObject, /*Function|String*/method /*, ...*/){
2896
	// summary: 
2914
	// summary: 
2897
	//		Returns a function that will only ever execute in the a given scope
2915
	//		Returns a function that will only ever execute in the a given scope
-
 
2916
	//		(thisObject). This allows for easy use of object member functions
-
 
2917
	//		in callbacks and other places in which the "this" keyword may
-
 
2918
	//		otherwise not reference the expected scope. Any number of default
2898
	//		(thisObject). This allows for easy use of object member functions
2919
	//		positional arguments may be passed as parameters beyond "method".
2899
	//		in callbacks and other places in which the "this" keyword may
2920
	//		Each of these values will be used to "placehold" (similar to curry)
2900
	//		otherwise not reference the expected scope. Note that the order of
2921
	//		for the hitched function. Note that the order of arguments may be
2901
	//		arguments may be reversed in a future version.
2922
	//		reversed in a future version.
2902
	// thisObject: the scope to run the method in
2923
	// thisObject: the scope to run the method in
2903
	// method:
2924
	// method:
2904
	//		a function to be "bound" to thisObject or the name of the method in
2925
	//		a function to be "bound" to thisObject or the name of the method in
2905
	//		thisObject to be used as the basis for the binding
2926
	//		thisObject to be used as the basis for the binding
Line 2906... Line 2927...
2906
	// usage:
2927
	// usage:
2907
	//		dojo.lang.hitch(foo, "bar")(); // runs foo.bar() in the scope of foo
2928
	//		dojo.lang.hitch(foo, "bar")(); // runs foo.bar() in the scope of foo
2908
	//		dojo.lang.hitch(foo, myFunction); // returns a function that runs myFunction in the scope of foo
2929
	//		dojo.lang.hitch(foo, myFunction); // returns a function that runs myFunction in the scope of foo
-
 
2930
 
2909
 
2931
	var args = [];
2910
	// FIXME:
2932
	for(var x=2; x<arguments.length; x++){
-
 
2933
		args.push(arguments[x]);
-
 
2934
	}
-
 
2935
	var fcn = (dojo.lang.isString(method) ? thisObject[method] : method) || function(){};
-
 
2936
	return function(){
-
 
2937
		var ta = args.concat([]); // make a copy
2911
	//		should this be extended to "fixate" arguments in a manner similar
2938
		for(var x=0; x<arguments.length; x++){
2912
	//		to dojo.lang.curry, but without the default execution of curry()?
2939
			ta.push(arguments[x]);
2913
	var fcn = (dojo.lang.isString(method) ? thisObject[method] : method) || function(){};
2940
		}
Line 2914... Line 2941...
2914
	return function(){
2941
		return fcn.apply(thisObject, ta); // Function
2915
		return fcn.apply(thisObject, arguments); // Function
2942
		// return fcn.apply(thisObject, arguments); // Function
Line 4490... Line 4517...
4490
 
4517
 
4491
	// moved successful load stuff here
4518
	// moved successful load stuff here
4492
	function doLoad(kwArgs, http, url, query, useCache) {
4519
	function doLoad(kwArgs, http, url, query, useCache) {
4493
		if(	((http.status>=200)&&(http.status<300))|| 	// allow any 2XX response code
4520
		if(	((http.status>=200)&&(http.status<300))|| 	// allow any 2XX response code
-
 
4521
			(http.status==304)|| 						// get it out of the cache
4494
			(http.status==304)|| 						// get it out of the cache
4522
			(http.status==1223)|| 						// Internet Explorer mangled the status code
4495
			(location.protocol=="file:" && (http.status==0 || http.status==undefined))||
4523
			(location.protocol=="file:" && (http.status==0 || http.status==undefined))||
4496
			(location.protocol=="chrome:" && (http.status==0 || http.status==undefined))
4524
			(location.protocol=="chrome:" && (http.status==0 || http.status==undefined))
4497
		){
4525
		){
4498
			var ret;
4526
			var ret;
Line 4513... Line 4541...
4513
				}catch(e){
4541
				}catch(e){
4514
					dojo.debug(e);
4542
					dojo.debug(e);
4515
					dojo.debug(http.responseText);
4543
					dojo.debug(http.responseText);
4516
					ret = null;
4544
					ret = null;
4517
				}
4545
				}
4518
			}else if(kwArgs.mimetype == "text/json" || kwArgs.mimetype == "application/json"){
4546
			}else if(kwArgs.mimetype.substr(0, 9) == "text/json" || kwArgs.mimetype.substr(0, 16) == "application/json"){
4519
				try{
4547
				try{
4520
					ret = dj_eval("("+http.responseText+")");
4548
					ret = dj_eval("("+kwArgs.jsonFilter(http.responseText)+")");
4521
				}catch(e){
4549
				}catch(e){
4522
					dojo.debug(e);
4550
					dojo.debug(e);
4523
					dojo.debug(http.responseText);
4551
					dojo.debug(http.responseText);
4524
					ret = false;
4552
					ret = false;
4525
				}
4553
				}
Line 4629... Line 4657...
4629
		//handle forms that have an input type="file" element.
4657
		//handle forms that have an input type="file" element.
Line 4630... Line 4658...
4630
 
4658
 
4631
		// FIXME: we need to determine when form values need to be
4659
		// FIXME: we need to determine when form values need to be
4632
		// multi-part mime encoded and avoid using this transport for those
4660
		// multi-part mime encoded and avoid using this transport for those
-
 
4661
		// requests.
4633
		// requests.
4662
		var mlc = kwArgs["mimetype"].toLowerCase()||"";
-
 
4663
		return hasXmlHttp
-
 
4664
			&& (
-
 
4665
				(
-
 
4666
					dojo.lang.inArray([
-
 
4667
						"text/plain", "text/html", "application/xml", 
-
 
4668
						"text/xml", "text/javascript"
-
 
4669
						], mlc
-
 
4670
					)
4634
		return hasXmlHttp
4671
				) || (
-
 
4672
					mlc.substr(0, 9) == "text/json" || mlc.substr(0, 16) == "application/json"
-
 
4673
				)
4635
			&& dojo.lang.inArray(["text/plain", "text/html", "application/xml", "text/xml", "text/javascript", "text/json", "application/json"], (kwArgs["mimetype"].toLowerCase()||""))
4674
			)
4636
			&& !( kwArgs["formNode"] && dojo.io.formHasFile(kwArgs["formNode"]) ); //boolean
4675
			&& !( kwArgs["formNode"] && dojo.io.formHasFile(kwArgs["formNode"]) ); //boolean
Line 4637... Line 4676...
4637
	}
4676
	}
Line 5310... Line 5349...
5310
		if(arguments.length == 1){
5349
		if(arguments.length == 1){
5311
			var ao = arguments[0];
5350
			var ao = arguments[0];
5312
		}else{
5351
		}else{
5313
			var ao = interpolateArgs(arguments, true);
5352
			var ao = interpolateArgs(arguments, true);
5314
		}
5353
		}
5315
		/*
-
 
5316
		if(dojo.lang.isString(ao.srcFunc) && (ao.srcFunc.toLowerCase() == "onkey") ){
5354
		if(dojo.lang.isString(ao.srcFunc) && (ao.srcFunc.toLowerCase() == "onkey") ){
5317
			if(dojo.render.html.ie){
5355
			if(dojo.render.html.ie){
5318
				ao.srcFunc = "onkeydown";
5356
				ao.srcFunc = "onkeydown";
5319
				this.connect(ao);
5357
				this.connect(ao);
5320
			}
5358
			}
5321
			ao.srcFunc = "onkeypress";
5359
			ao.srcFunc = "onkeypress";
5322
		}
5360
		}
5323
		*/
-
 
Line 5324... Line 5361...
5324
 
5361
 
5325
		if(dojo.lang.isArray(ao.srcObj) && ao.srcObj!=""){
5362
		if(dojo.lang.isArray(ao.srcObj) && ao.srcObj!=""){
5326
			var tmpAO = {};
5363
			var tmpAO = {};
5327
			for(var x in ao){
5364
			for(var x in ao){
Line 7984... Line 8021...
7984
if (dojo.render.html.ie) {
8021
if (dojo.render.html.ie) {
7985
	// IE branch
8022
	// IE branch
7986
	dojo.html.getComputedStyle = function(/*HTMLElement|String*/node, /*String*/property, /*String*/value) {
8023
	dojo.html.getComputedStyle = function(/*HTMLElement|String*/node, /*String*/property, /*String*/value) {
7987
		// summary
8024
		// summary
7988
		// Get the computed style value for style "property" on "node" (IE).
8025
		// Get the computed style value for style "property" on "node" (IE).
7989
		node = dojo.byId(node);  // FIXME: remove ability to access nodes by id for this time-critical function
8026
		node = dojo.byId(node); // FIXME: remove ability to access nodes by id for this time-critical function
7990
		if(!node || !node.style){return value;}
8027
		if(!node || !node.currentStyle){return value;}
7991
		// FIXME: standardize on camel-case input to improve speed
8028
		// FIXME: standardize on camel-case input to improve speed
7992
		return node.currentStyle[dojo.html.toCamelCase(property)]; // String
8029
		return node.currentStyle[dojo.html.toCamelCase(property)]; // String
7993
	}
8030
	}
7994
	// SJM: getComputedStyle should be abandoned and replaced with the below function.
8031
	// SJM: getComputedStyle should be abandoned and replaced with the below function.
7995
	// All our supported browsers can return CSS2 compliant CssStyleDeclaration objects
8032
	// All our supported browsers can return CSS2 compliant CssStyleDeclaration objects