Subversion Repositories Applications.papyrus

Rev

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

Rev 1318 Rev 1422
Line 6... Line 6...
6
	modified BSD license. For more information on Dojo licensing, see:
6
	modified BSD license. For more information on Dojo licensing, see:
Line 7... Line 7...
7
 
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
8
		http://dojotoolkit.org/community/licensing.shtml
Line -... Line 9...
-
 
9
*/
-
 
10
 
9
*/
11
 
10
 
12
 
11
dojo.hostenv.resetXd = function () {
13
dojo.hostenv.resetXd = function () {
12
	this.isXDomain = djConfig.useXDomain || false;
14
	this.isXDomain = djConfig.useXDomain || false;
13
	this.xdTimer = 0;
15
	this.xdTimer = 0;
Line 18... Line 20...
18
	this.xdDefList = [];
20
	this.xdDefList = [];
19
};
21
};
20
dojo.hostenv.resetXd();
22
dojo.hostenv.resetXd();
21
dojo.hostenv.createXdPackage = function (contents, resourceName, resourcePath) {
23
dojo.hostenv.createXdPackage = function (contents, resourceName, resourcePath) {
22
	var deps = [];
24
	var deps = [];
23
	var depRegExp = /dojo.(require|requireIf|requireAll|provide|requireAfterIf|requireAfter|kwCompoundRequire|conditionalRequire|hostenv\.conditionalLoadModule|.hostenv\.loadModule|hostenv\.moduleLoaded)\(([\w\W]*?)\)/mg;
25
	var depRegExp = /dojo.(requireLocalization|require|requireIf|requireAll|provide|requireAfterIf|requireAfter|kwCompoundRequire|conditionalRequire|hostenv\.conditionalLoadModule|.hostenv\.loadModule|hostenv\.moduleLoaded)\(([\w\W]*?)\)/mg;
24
	var match;
26
	var match;
25
	while ((match = depRegExp.exec(contents)) != null) {
27
	while ((match = depRegExp.exec(contents)) != null) {
-
 
28
		if (match[1] == "requireLocalization") {
-
 
29
			eval(match[0]);
-
 
30
		} else {
26
		deps.push("\"" + match[1] + "\", " + match[2]);
31
			deps.push("\"" + match[1] + "\", " + match[2]);
-
 
32
		}
27
	}
33
	}
28
	var output = [];
34
	var output = [];
29
	output.push("dojo.hostenv.packageLoaded({\n");
35
	output.push("dojo.hostenv.packageLoaded({\n");
30
	if (deps.length > 0) {
36
	if (deps.length > 0) {
31
		output.push("depends: [");
37
		output.push("depends: [");
Line 71... Line 77...
71
};
77
};
72
dojo.hostenv.loadUri = function (uri, cb, currentIsXDomain, module) {
78
dojo.hostenv.loadUri = function (uri, cb, currentIsXDomain, module) {
73
	if (this.loadedUris[uri]) {
79
	if (this.loadedUris[uri]) {
74
		return 1;
80
		return 1;
75
	}
81
	}
76
	if (this.isXDomain) {
82
	if (this.isXDomain && module) {
77
		if (uri.indexOf("__package__") != -1) {
83
		if (uri.indexOf("__package__") != -1) {
78
			module += ".*";
84
			module += ".*";
79
		}
85
		}
80
		this.xdOrderedReqs.push(module);
86
		this.xdOrderedReqs.push(module);
81
		if (currentIsXDomain) {
87
		if (currentIsXDomain || uri.indexOf("/nls/") == -1) {
82
			this.xdInFlight[module] = true;
88
			this.xdInFlight[module] = true;
83
			this.inFlightCount++;
89
			this.inFlightCount++;
84
		}
90
		}
85
		if (!this.xdTimer) {
91
		if (!this.xdTimer) {
86
			this.xdTimer = setInterval("dojo.hostenv.watchInFlightXDomain();", 100);
92
			this.xdTimer = setInterval("dojo.hostenv.watchInFlightXDomain();", 100);
Line 367... Line 373...
367
		this.xdNotifyLoaded();
373
		this.xdNotifyLoaded();
368
	}
374
	}
369
};
375
};
370
dojo.hostenv.xdNotifyLoaded = function () {
376
dojo.hostenv.xdNotifyLoaded = function () {
371
	this.inFlightCount = 0;
377
	this.inFlightCount = 0;
-
 
378
	if (this._djInitFired && !this.loadNotifying) {
372
	this.callLoaded();
379
		this.callLoaded();
-
 
380
	}
373
};
381
};
374
dojo.hostenv.flattenRequireArray = function (target) {
382
dojo.hostenv.flattenRequireArray = function (target) {
375
	if (target) {
383
	if (target) {
376
		for (var i = 0; i < target.length; i++) {
384
		for (var i = 0; i < target.length; i++) {
377
			if (target[i] instanceof Array) {
385
			if (target[i] instanceof Array) {
Line 385... Line 393...
385
dojo.hostenv.xdHasCalledPreload = false;
393
dojo.hostenv.xdHasCalledPreload = false;
386
dojo.hostenv.xdRealCallLoaded = dojo.hostenv.callLoaded;
394
dojo.hostenv.xdRealCallLoaded = dojo.hostenv.callLoaded;
387
dojo.hostenv.callLoaded = function () {
395
dojo.hostenv.callLoaded = function () {
388
	if (this.xdHasCalledPreload || dojo.hostenv.getModulePrefix("dojo") == "src" || !this.localesGenerated) {
396
	if (this.xdHasCalledPreload || dojo.hostenv.getModulePrefix("dojo") == "src" || !this.localesGenerated) {
389
		this.xdRealCallLoaded();
397
		this.xdRealCallLoaded();
390
		this.xdHasCalledPreload = true;
-
 
391
	} else {
398
	} else {
392
		if (this.localesGenerated) {
399
		if (this.localesGenerated) {
393
			this.registerNlsPrefix = function () {
400
			this.registerNlsPrefix = function () {
394
				dojo.registerModulePath("nls", dojo.hostenv.getModulePrefix("dojo") + "/../nls");
401
				dojo.registerModulePath("nls", dojo.hostenv.getModulePrefix("dojo") + "/../nls");
395
			};
402
			};
396
			this.preloadLocalizations();
403
			this.preloadLocalizations();
397
		}
404
		}
398
		this.xdHasCalledPreload = true;
-
 
399
	}
405
	}
-
 
406
	this.xdHasCalledPreload = true;
400
};
407
};