forked from Smoothieware/Mousse
-
Notifications
You must be signed in to change notification settings - Fork 3
/
template.tpl
160 lines (132 loc) · 5.1 KB
/
template.tpl
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html>
<html>
[% IF file.type == 'dev' %]
<!-- This file is for development purposes, it is not self-contained and will fetch all javascript files and included assets when loaded -->
[% ELSE %]
<!-- This file is for deployement purposes, it is a self-contained and compiled version of the interface -->
[% END %]
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>MOUSSE</title>
<!-- Dropbox is retreived online as it is useless if we don't have an internet connection, and that's what they recommend -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/dropbox.js/0.10.2/dropbox.min.js"></script>
[% IF file.type == 'dev' %]
[% FOREACH module = modules %]
[% FOREACH to_include = module.json_data.IncludeCSS %]
<link rel="stylesheet" href="[% module.folder %]/[% to_include %]">
[% END %]
[% FOREACH to_include = module.json_data.Include %]
<script src="[% module.folder %]/[% to_include %]"></script>
[% END %]
<script src="[% module.javascript_file %]"></script>
[% END %]
[% ELSE %]
[% FOREACH module = modules %]
[% FOREACH to_include = module.json_data.IncludeCSS %]
<style> [% INSERT "$module.folder/$to_include" %]</style>
[% END %]
[% FOREACH to_include = module.json_data.Include %]
<script type="text/javascript"> [% INSERT "$module.folder/$to_include" %]</script>
[% END %]
<script type="text/javascript"> [% INSERT "$module.javascript_file" %] </script>
[% END %]
[% END %]
<script type="text/javascript">
// Instantiate kernel
var kernel = new Kernel();
// Instantiate all of the modules
[% FOREACH module = modules %]
[% NEXT IF module.module_name == 'kernel' %]
[% NEXT IF module.module_name == 'module' %]
var [% module.module_name %] = new [% module.class_name %]();
kernel.add_module( "[% module.module_name %]", [% module.module_name %] );
[% END %]
// When the document is loaded, have kernel tell all the modules
$().ready( function(){ kernel.signal_modules_loaded(); } );
</script>
<style>
.wholescreen{
width:100%;
height:100%;
}
.bs-callout {
padding: 20px;
margin: 20px 0;
border: 1px solid #eee;
border-left-width: 5px;
border-radius: 3px;
}
.bs-callout h4 {
margin-top: 0;
margin-bottom: 5px;
}
.bs-callout p:last-child {
margin-bottom: 0;
}
.bs-callout code {
border-radius: 3px;
}
.bs-callout+.bs-callout {
margin-top: -5px;
}
.bs-callout-default {
border-left-color: #777;
}
.bs-callout-default h4 {
color: #777;
}
.bs-callout-primary {
border-left-color: #428bca;
}
.bs-callout-primary h4 {
color: #428bca;
}
.bs-callout-success {
border-left-color: #5cb85c;
}
.bs-callout-success h4 {
color: #5cb85c;
}
.bs-callout-danger {
border-left-color: #d9534f;
}
.bs-callout-danger h4 {
color: #d9534f;
}
.bs-callout-warning {
border-left-color: #f0ad4e;
}
.bs-callout-warning h4 {
color: #f0ad4e;
}
.bs-callout-info {
border-left-color: #5bc0de;
}
.bs-callout-info h4 {
color: #5bc0de;
}
</style>
</head>
<body class="fuelux">
<div id="root" class="wholescreen">
</div>
<div id="assets" style="display:none">
[% FOREACH module = modules %]
[% FOREACH asset = module.asset_files %]
<div id="[% asset.path %]" class="wholescreen">
[% IF file.type == 'dev' %]
<script type="text/javascript">
$("#[% asset.path %]").load( "[% asset.file %]" );
</script>
[% asset.path %]
[% ELSE %]
[% INSERT "$asset.file" %]
[% END %]
</div>
[% END %]
[% END %]
</div>
</body>
</html>