forked from requirejs/requirejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayers.html
More file actions
67 lines (64 loc) · 2.01 KB
/
layers.html
File metadata and controls
67 lines (64 loc) · 2.01 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
<!DOCTYPE html>
<html>
<head>
<title>require.js: Layers Test</title>
<script type="text/javascript" src="../../require.js"></script>
<script type="text/javascript" src="../doh/runner.js"></script>
<script type="text/javascript" src="../doh/_browserRunner.js"></script>
<script type="text/javascript">
var master = new doh.Deferred();
doh.register(
"layers",
[
{
name: "layers",
timeout: 5000,
runTest: function() {
return master;
}
}
]
);
doh.run();
require(
{
baseUrl: "./"
},
["require", "layer1"],
function(require) {
require(["alpha", "beta", "gamma", "epsilon"],
function(alpha, beta, gamma, epsilon) {
doh.is("alpha", alpha.name);
doh.is("beta", alpha.betaName);
doh.is("beta", beta.name);
doh.is("gamma", beta.gammaName);
doh.is("gamma", gamma.name);
doh.is("epsilon", gamma.epsilonName);
doh.is("epsilon", epsilon.name);
}
);
var verifyFunc = function () {
var regExp = /alpha|beta|gamma/,
i,
scripts = document.getElementsByTagName("script");
for (var i = scripts.length - 1; i > -1; i--) {
doh.f(regExp.test(scripts[i].src));
}
master.callback(true);
};
//Account for requirening this test with a version of require.js that
//does not have require.ready built in.
if (require.ready) {
require.ready(verifyFunc);
} else {
setTimeout(verifyFunc, 3000);
}
}
);
</script>
</head>
<body>
<h1>require.js: Layers Test</h1>
<p>Check console for messages</p>
</body>
</html>