forked from vitmalina/w2ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathks.html
83 lines (77 loc) · 1.76 KB
/
ks.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<html>
<head>
<script type="text/javascript" src="../libs/jquery/jquery-3.5.1.min.js"></script>
<script src="../src/kickstart/ks-core.js"></script>
<script src="../src/kickstart/ks-route.js"></script>
</head>
<body>
See console
<script>
//<![CDATA[
$(function () {
app.define({
"main": {
"start": "app/main/main.js",
"route": "/main",
"assets": [
"app/main/config.js",
"app/main/formula.html"
]
},
"some-module": {
"start": "app/some/some.js",
"route": "/some*",
"assets": []
}
});
app.require(['route', 'main'], function (files) {
app.route.init('/some');
console.log('loaded');
});
});
//]]>
</script>
<script type="text/file" path="app/main/config.js">
some: {
a: 1,
b: 2
}
</script>
<script type="text/file" path="app/main/main.js">
app.register('main', function (files) {
init();
return {};
function init() {
app.route.add({
"/main*": function (param) {
console.log('MAIN', param);
},
"/main/1": function (param) {
console.log('route 1');
},
"/main/2": function (param) {
console.log('route 2');
}
})
console.log(files);
}
});
</script>
<script type="text/file" path="app/main/formula.html">
some html file
</script>
<script type="text/file" path="app/some/some.js">
app.register('some-module', function (files) {
console.log("LOADED \"some-module\"");
app.route.add({
"/some": function () {
console.log('+++SOME');
},
"/some/1": function () {
console.log('+++SOME 1');
}
});
});
</script>
</body>
</html>