⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loader.js

📁 ajax框架原吗,dojo目前很流行的,希望大家多多学习啊
💻 JS
📖 第 1 页 / 共 2 页
字号:
		return module;	}	dojo.provide = function(/*String*/ resourceName){		//	summary:		//		Each javascript source file must have (exactly) one dojo.provide()		//		call at the top of the file, corresponding to the file name.		//		For example, js/dojo/foo.js must have dojo.provide("dojo.foo"); at the		//		top of the file.		//	description:		//		Each javascript source file is called a resource.  When a resource		//		is loaded by the browser, dojo.provide() registers that it has been		//		loaded.		//			//		For backwards compatibility reasons, in addition to registering the		//		resource, dojo.provide() also ensures that the javascript object		//		for the module exists.  For example,		//		dojo.provide("dojo.io.cometd"), in addition to registering that		//		cometd.js is a resource for the dojo.iomodule, will ensure that		//		the dojo.io javascript object exists, so that calls like		//		dojo.io.foo = function(){ ... } don't fail.		//		//		In the case of a build (or in the future, a rollup), where multiple		//		javascript source files are combined into one bigger file (similar		//		to a .lib or .jar file), that file will contain multiple		//		dojo.provide() calls, to note that it includes multiple resources.		//Make sure we have a string.		resourceName = resourceName + "";		return (d._loadedModules[resourceName] = d.getObject(resourceName, true)); // Object	}	//Start of old bootstrap2:	dojo.platformRequire = function(/*Object containing Arrays*/modMap){		//	description:		//		This method taks a "map" of arrays which one can use to optionally		//		load dojo modules. The map is indexed by the possible		//		dojo.name_ values, with two additional values: "default"		//		and "common". The items in the "default" array will be loaded if		//		none of the other items have been choosen based on the		//		hostenv.name_ item. The items in the "common" array will _always_		//		be loaded, regardless of which list is chosen.  Here's how it's		//		normally called:		//			//		|	dojo.platformRequire({		//		|		// an example that passes multiple args to _loadModule()		//		|		browser: [		//		|			["foo.bar.baz", true, true], 		//		|			"foo.sample",		//		|			"foo.test,		//		|		],		//		|		default: [ "foo.sample.*" ],		//		|		common: [ "really.important.module.*" ]		//		|	});		// FIXME: dojo.name_ no longer works!!		var common = modMap["common"]||[];		var result = common.concat(modMap[d._name]||modMap["default"]||[]);		for(var x=0; x<result.length; x++){			var curr = result[x];			if(curr.constructor == Array){				d._loadModule.apply(d, curr);			}else{				d._loadModule(curr);			}		}	}	dojo.requireIf = function(/*Boolean*/ condition, /*String*/ resourceName){		// summary:		//		If the condition is true then call dojo.require() for the specified		//		resource		if(condition === true){			// FIXME: why do we support chained require()'s here? does the build system?			var args = [];			for(var i = 1; i < arguments.length; i++){ 				args.push(arguments[i]);			}			d.require.apply(d, args);		}	}	dojo.requireAfterIf = d.requireIf;	dojo.registerModulePath = function(/*String*/module, /*String*/prefix){		//	summary: 		//		maps a module name to a path		//	description: 		//		An unregistered module is given the default path of ../<module>,		//		relative to Dojo root. For example, module acme is mapped to		//		../acme.  If you want to use a different module name, use		//		dojo.registerModulePath. 		d._modulePrefixes[module] = { name: module, value: prefix };	}	dojo.requireLocalization = function(/*String*/moduleName, /*String*/bundleName, /*String?*/locale, /*String?*/availableFlatLocales){		// summary:		//		Declares translated resources and loads them if necessary, in the		//		same style as dojo.require.  Contents of the resource bundle are		//		typically strings, but may be any name/value pair, represented in		//		JSON format.  See also dojo.i18n.getLocalization.		// moduleName: 		//		name of the package containing the "nls" directory in which the		//		bundle is found		// bundleName: 		//		bundle name, i.e. the filename without the '.js' suffix		// locale: 		//		the locale to load (optional)  By default, the browser's user		//		locale as defined by dojo.locale		// availableFlatLocales: 		//		A comma-separated list of the available, flattened locales for this		//		bundle. This argument should only be set by the build process.		// description:		//		Load translated resource bundles provided underneath the "nls"		//		directory within a package.  Translated resources may be located in		//		different packages throughout the source tree.  For example, a		//		particular widget may define one or more resource bundles,		//		structured in a program as follows, where moduleName is		//		mycode.mywidget and bundleNames available include bundleone and		//		bundletwo:		//		//			...		//			mycode/		//			 mywidget/		//			  nls/		//			   bundleone.js (the fallback translation, English in this example)		//			   bundletwo.js (also a fallback translation)		//			   de/		//			    bundleone.js		//			    bundletwo.js		//			   de-at/		//			    bundleone.js		//			   en/		//			    (empty; use the fallback translation)		//			   en-us/		//			    bundleone.js		//			   en-gb/		//			    bundleone.js		//			   es/		//			    bundleone.js		//			    bundletwo.js		//			  ...etc		//			...		//		//		Each directory is named for a locale as specified by RFC 3066,		//		(http://www.ietf.org/rfc/rfc3066.txt), normalized in lowercase.		//		Note that the two bundles in the example do not define all the same		//		variants.  For a given locale, bundles will be loaded for that		//		locale and all more general locales above it, including a fallback		//		at the root directory.  For example, a declaration for the "de-at"		//		locale will first load nls/de-at/bundleone.js, then		//		nls/de/bundleone.js and finally nls/bundleone.js.  The data will be		//		flattened into a single Object so that lookups will follow this		//		cascading pattern.  An optional build step can preload the bundles		//		to avoid data redundancy and the multiple network hits normally		//		required to load these resources.		d.require("dojo.i18n");		d.i18n._requireLocalization.apply(d.hostenv, arguments);	};	var ore = new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$");	var ire = new RegExp("^((([^:]+:)?([^@]+))@)?([^:]*)(:([0-9]+))?$");	dojo._Url = function(/*dojo._Url||String...*/){		// summary: 		//		Constructor to create an object representing a URL.		//		It is marked as private, since we might consider removing		//		or simplifying it.		// description: 		//		Each argument is evaluated in order relative to the next until		//		a canonical uri is produced. To get an absolute Uri relative to		//		the current document use:		//      	new dojo._Url(document.baseURI, url)		var n = null;		// TODO: support for IPv6, see RFC 2732		var _a = arguments;		var uri = _a[0];		// resolve uri components relative to each other		for(var i = 1; i<_a.length; i++){			if(!_a[i]){ continue; }			// Safari doesn't support this.constructor so we have to be explicit			// FIXME: Tracked (and fixed) in Webkit bug 3537.			//		http://bugs.webkit.org/show_bug.cgi?id=3537			var relobj = new d._Url(_a[i]+"");			var uriobj = new d._Url(uri+"");			if(				(relobj.path=="")	&&				(!relobj.scheme)	&&				(!relobj.authority)	&&				(!relobj.query)			){				if(relobj.fragment != n){					uriobj.fragment = relobj.fragment;				}				relobj = uriobj;			}else if(!relobj.scheme){				relobj.scheme = uriobj.scheme;				if(!relobj.authority){					relobj.authority = uriobj.authority;					if(relobj.path.charAt(0) != "/"){						var path = uriobj.path.substring(0,							uriobj.path.lastIndexOf("/") + 1) + relobj.path;						var segs = path.split("/");						for(var j = 0; j < segs.length; j++){							if(segs[j] == "."){								if(j == segs.length - 1){									segs[j] = "";								}else{									segs.splice(j, 1);									j--;								}							}else if(j > 0 && !(j == 1 && segs[0] == "") &&								segs[j] == ".." && segs[j-1] != ".."){								if(j == (segs.length - 1)){									segs.splice(j, 1);									segs[j - 1] = "";								}else{									segs.splice(j - 1, 2);									j -= 2;								}							}						}						relobj.path = segs.join("/");					}				}			}			uri = "";			if(relobj.scheme){ 				uri += relobj.scheme + ":";			}			if(relobj.authority){				uri += "//" + relobj.authority;			}			uri += relobj.path;			if(relobj.query){				uri += "?" + relobj.query;			}			if(relobj.fragment){				uri += "#" + relobj.fragment;			}		}		this.uri = uri.toString();		// break the uri into its main components		var r = this.uri.match(ore);		this.scheme = r[2] || (r[1] ? "" : n);		this.authority = r[4] || (r[3] ? "" : n);		this.path = r[5]; // can never be undefined		this.query = r[7] || (r[6] ? "" : n);		this.fragment  = r[9] || (r[8] ? "" : n);		if(this.authority != n){			// server based naming authority			r = this.authority.match(ire);			this.user = r[3] || n;			this.password = r[4] || n;			this.host = r[5];			this.port = r[7] || n;		}	}	dojo._Url.prototype.toString = function(){ return this.uri; };	dojo.moduleUrl = function(/*String*/module, /*dojo._Url||String*/url){		// summary: 		//		Returns a Url object relative to a module		//				// example: 		//	|	dojo.moduleUrl("dojo.widget","templates/template.html");		// example:		//	|	dojo.moduleUrl("acme","images/small.png")		var loc = dojo._getModuleSymbols(module).join('/');		if(!loc){ return null; }		if(loc.lastIndexOf("/") != loc.length-1){			loc += "/";		}				//If the path is an absolute path (starts with a / or is on another		//domain/xdomain) then don't add the baseUrl.		var colonIndex = loc.indexOf(":");		if(loc.charAt(0) != "/" && (colonIndex == -1 || colonIndex > loc.indexOf("/"))){			loc = d.baseUrl + loc;		}		return new d._Url(loc, url); // String	}})();}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -