forked from requirejs/requirejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpriorityOrder.html
More file actions
62 lines (58 loc) · 1.67 KB
/
priorityOrder.html
File metadata and controls
62 lines (58 loc) · 1.67 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
<!DOCTYPE html>
<html>
<head>
<title>require.js: Priority order! 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(),
count = 0;
doh.register(
"priority",
[
{
name: "priorityOrder",
timeout: 5000,
runTest: function () {
return master;
}
}
]
);
doh.run();
require(
{
baseUrl: "./",
paths: {
text: "../../text"
},
priority: ["order!leaf", "order!tree"]
},
["leaf", "bark", "tree", "flower"],
function (leaf, bark, tree, bush) {
count += 1;
//Make sure callback is only called once.
doh.is(1, count);
doh.is("leaf", leaf.name);
doh.is("bark", bark.name);
doh.is("tree", tree.name);
doh.is("leaf", tree.leafName);
doh.is("bark", tree.barkName);
doh.is("flower", bush.name);
var regExp = /bark/,
i,
scripts = document.getElementsByTagName("script");
for (i = scripts.length - 1; i > -1; i--) {
doh.f(regExp.test(scripts[i].src));
}
master.callback(true);
}
);
</script>
</head>
<body>
<h1>require.js: Priority order! Test</h1>
<p>Check console for messages</p>
</body>
</html>