config.html
4.06 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<html>
<head>
<script type="text/javascript">
var hasAlias, dojoAlias;
var _dojoConfig= {
baseUrl:"../../../../dojo",
waitSeconds:5,
locale:"us-en1",
has:{
configTestHas1:1
},
cats:'dojo-config-dogs',
a:2,
b:[3,4,5]
};
function expectDojoConfig(t) {
t.is(require.rawConfig.baseUrl, "../../../../dojo");
t.is(require.rawConfig.waitSeconds, 5);
t.is(require.rawConfig.locale,"us-en1");
t.is(require.rawConfig.has, _dojoConfig.has);
t.is(require.rawConfig.cats, 'dojo-config-dogs');
t.is(require.rawConfig.a, 2);
t.is(require.rawConfig.b, [3,4,5]);
t.is(require.baseUrl, "../../../../dojo/");
t.t(hasAlias("configTestHas1"));
t.is(require.cats, undefined);
t.is(require.a, undefined);
t.is(require.b, undefined);
t.is(dojo.config.baseUrl, "../../../../dojo/");
t.is(dojo.config.waitSeconds, 5);
t.is(dojo.config.locale,"us-en1");
t.is(dojo.config.cats, 'dojo-config-dogs');
t.is(dojo.config.a, 2);
t.is(dojo.config.b, [3,4,5]);
}
var _djConfig= {
baseUrl:"../../../../dojo",
waitSeconds:6,
locale:"us-en2",
has:{
configTestHas2:1
},
cats:'dj-config-dogs',
a:6,
b:[7,8,9]
};
function expectDjConfig(t) {
t.is(require.rawConfig.baseUrl, "../../../../dojo");
t.is(require.rawConfig.waitSeconds, 6);
t.is(require.rawConfig.locale,"us-en2");
t.is(require.rawConfig.has, _djConfig.has);
t.is(require.rawConfig.cats, 'dj-config-dogs');
t.is(require.rawConfig.a, 6);
t.is(require.rawConfig.b, [7,8,9]);
t.is(require.baseUrl, "../../../../dojo/");
t.t(hasAlias("configTestHas2"));
t.is(require.cats, undefined);
t.is(require.a, undefined);
t.is(require.b, undefined);
t.is(dojo.config.baseUrl, "../../../../dojo/");
t.is(dojo.config.waitSeconds, 6);
t.is(dojo.config.locale,"us-en2");
t.is(dojo.config.cats, 'dj-config-dogs');
t.is(dojo.config.a, 6);
t.is(dojo.config.b, [7,8,9]);
}
var _require= {
baseUrl:"../../../../dojo",
waitSeconds:7,
locale:"us-en3",
has:{
configTestHas3:1
},
cats:'require-config-dogs',
a:10,
b:[11,12,13]
};
function expectRequireConfig(t) {
t.is(require.rawConfig.baseUrl, "../../../../dojo");
t.is(require.rawConfig.waitSeconds, 7);
t.is(require.rawConfig.locale,"us-en3");
t.is(require.rawConfig.has, _require.has);
t.is(require.rawConfig.cats, 'require-config-dogs');
t.is(require.rawConfig.a, 10);
t.is(require.rawConfig.b, [11,12,13]);
t.is(require.baseUrl, "../../../../dojo/");
t.t(hasAlias("configTestHas3"));
t.is(require.cats, undefined);
t.is(require.a, undefined);
t.is(require.b, undefined);
t.is(dojo.config.baseUrl, "../../../../dojo/");
t.is(dojo.config.waitSeconds, 7);
t.is(dojo.config.locale,"us-en3");
t.is(dojo.config.cats, 'require-config-dogs');
t.is(dojo.config.a, 10);
t.is(dojo.config.b, [11,12,13]);
}
switch(location.search){
case "?dojoConfig-djConfig-require":
dojoConfig= _dojoConfig;
djConfig= _djConfig;
require= _require;
expect= expectDojoConfig;
break;
case "?dojoConfig-djConfig":
dojoConfig= _dojoConfig;
djConfig= _djConfig;
expect= expectDojoConfig;
break;
case "?dojoConfig-require":
dojoConfig= _dojoConfig;
require= _require;
expect= expectDojoConfig;
break;
case "?djConfig-require":
djConfig= _djConfig;
require= _require;
expect= expectDjConfig;
break;
case "?djConfig":
djConfig= _djConfig;
expect= expectDjConfig;
break;
case "?require":
require= _require;
expect= expectRequireConfig;
break;
case "?dojoConfig":
dojoConfig= _dojoConfig;
expect= expectDojoConfig;
break;
}
</script>
<script type="text/javascript" src="../../../dojo.js" data-dojo-config="isDebug:1, async:1"></script>
<script type="text/javascript">
require(["dojo", "doh", "dojo/has"], function(dojo, doh, has) {
dojo.ready(function() {
dojoAlias= dojo;
hasAlias= has;
doh.register("dojoConfig-test", [expect]);
doh.runOnLoad();
});
});
</script>
</head>
<body>
</body>
</html>