forked from cujojs/curl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pluginConfig.html
62 lines (53 loc) · 1.43 KB
/
pluginConfig.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
<!DOCTYPE HTML>
<html>
<head>
<title>plugin config test file</title>
<script>
</script>
<script src="../src/curl.js" type="text/javascript"></script>
<script type="text/javascript">
var testValue = 'does it work?';
curl(
{
baseUrl: '..',
pluginPath: 'test/support',
paths: {
stuff: 'test/stuff'
},
plugins: {
'fake': {
testValue: testValue
}
}
},
[
'fake!', // explicitly configured plugin
'test/support/simple-plugin', // un-configured plugin should still get config
'test/support/simple-plugin!stuff/zero', // just to run load method
'src/curl/domReady'
]
).then(
function (pluginsValue, simple, dummy, ready) {
ready(function () {
if (pluginsValue == testValue) {
document.body.appendChild(document.createTextNode('SUCCESS: config value passed to explicitly configured plugin'));
}
else {
document.body.appendChild(document.createTextNode('FAILED: config value NOT passed to explicitly configured plugin'));
}
document.body.appendChild(document.createElement('br'));
if (simple.config.baseUrl) {
document.body.appendChild(document.createTextNode('SUCCESS: config value passed to un-configured plugin'));
}
else {
document.body.appendChild(document.createTextNode('FAILED: config value NOT passed to un-configured plugin'));
}
});
}
);
</script>
</head>
<body>
<p>There should be text below if this page loaded.</p>
</body>
</html>