aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dojo/tests/_base/_loader/scope/scopeContainedXd.html
blob: c4c2edae7cfa7a886dad808f9ff2410f86ebba66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
	"http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>Multiversion Dojo: 0.4.3 and 1.0</title>

		<link rel="stylesheet" type="text/css" href="../../../../resources/dojo.css" />
		<link rel="stylesheet" type="text/css" href="../../../../../dijit/css/dijitTests.css" />
		<link rel="stylesheet" type="text/css" href="../../../../../dijit/themes/tundra/tundra.css" />
		
		<script type="text/javascript">
			//djConfig for 0.4.3 setup.
			djConfig = {
				isDebug: true
			};
		</script>
		<script type="text/javascript" src="http://o.aolcdn.com/dojo/0.4.3/dojo.js"></script>
		
		<script type="text/javascript">
			//Scope map for this page is "burned in" via a build command (see HTML notes below).
			//Also, just adding properties instead of redefining djConfig, since that
			//will wipe out djConfig values set up by the 0.4.3 dojo.
			djConfig.parseOnLoad = true;
			djConfig.baseUrl = "../../../../";
			djConfig.useXDomain = true; //Technically this was set already in the 0.4.3 xd dojo.js file.
		</script>
		<script type="text/javascript" src="../../../../dojo.xd.js"></script>
		<script type="text/javascript">
			dojo.require("dojo.widget.DropdownDatePicker");

			//Get base xd path
			var xdPath = location.href;
			var lastIndex = location.href.lastIndexOf("/");
			xdPath = xdPath.substring(0, lastIndex + 1);
			
			//Set up xdomain locations for dojo/dijit/dojox.
			jodo.registerModulePath("dojo", xdPath + "../../../../../dojo");
			jodo.registerModulePath("dijit", xdPath + "../../../../../dijit");
			jodo.registerModulePath("dojox", xdPath + "../../../../../dojox");
			
			//Notice that dijit._Calendar is required, not jidit._Calendar.
			//Same for the dojo resources (not jodo resources).
			jodo.require("dijit._Calendar");
			jodo.require("dojo.date.locale");
			jodo.require("dojo.parser"); // scan page for widgets

			dojo.addOnLoad(function(){
				dojo.byId("output043").innerHTML = dojo.version.toString();
			});
			jodo.addOnLoad(function(){
				dojo.byId("output10").innerHTML = jodo.version.toString();
			});

			function myHandler(id,newValue){
				console.debug("onChange for id = " + id + ", value: " + newValue);
			}
		</script>
	</head>
	<body>
		<h1>XDomain Multiversion Dojo: 0.4.3 and 1.0</h1>
	
		<p><b>NOTE: This test only works with a built, xdomain version of Dojo, and it must be built with the scopeMap parameter (the backslashes below are required):</b></p>

		<p style="color: blue; background-color: yellow">build.sh profile=standard action=release scopeMap=[[\"dojo\",\"jodo\"],[\"dijit\",\"jidit\"],[\"dojox\",\"jodox\"]] xdDojoScopeName=jodo loader=xdomain</p>
		
		<p><b>Only load this page from an http:// URL</b>. Otherwise, the xd loading will not happen.</p>

		<p>This page xdomain loads Dojo 0.4.3 and Dojo 1.0 (under the jodo scope)</p>
		
		<p>Dojo 0.4.3 version: <span id="output043"></span></p>
		
		<p>Jodo version: <span id="output10"></span></p>
		
		<p>
			<input dojoType="dropdowndatepicker" value="2006-10-31" containerToggle="wipe" containerToggleDuration="300" >
		</p>
		
		<p class="tundra">
			<input id="calendar1" jodoType="dijit._Calendar" onChange="myHandler(this.id,arguments[0])">
		</p>
		
	</body>
</html>