forked from bestiejs/platform.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
69 lines (64 loc) · 1.53 KB
/
index.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Platform.js Test Suite</title>
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
</head>
<body>
<div id="qunit"></div>
<script src="../platform.js"></script>
<script src="../vendor/qunit/qunit/qunit.js"></script>
<script>
QUnit.urlParams.norequire = /[?&]norequire=true(?:&|$)/.test(location.search);
// load test.js if not using require.js
document.write(QUnit.urlParams.norequire
? '<script src="test.js"><\/script>'
: '<script src="../vendor/requirejs/require.js"><\/script>'
);
</script>
<script>
var platformModule;
(function() {
if (!window.require) {
return;
}
QUnit.config.autostart = false;
requirejs.config({
'baseUrl': './',
'urlArgs': 't=' + (+new Date),
'waitSeconds': 0,
'packages': [
{
'name': 'platform',
'location': '..',
'main': 'platform'
},
{
'name': 'test',
'location': '.',
'main': 'test'
}
]
});
// load platform as a module
require(['platform'], function(platform) {
platformModule = platform;
require(['test'], function() {
QUnit.start();
});
});
}());
// set a more readable browser name
window.onload = function() {
var timeoutId = setInterval(function() {
var ua = document.getElementById('qunit-userAgent');
if (ua) {
ua.innerHTML = platform;
clearInterval(timeoutId);
}
}, 16);
};
</script>
</body>
</html>