This repository was archived by the owner on Oct 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlaunch.hl
More file actions
237 lines (190 loc) · 6.34 KB
/
launch.hl
File metadata and controls
237 lines (190 loc) · 6.34 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
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
/*
* File responsible for starting Hyperbuild.
*/
/*
* Including Micro, adding Awesome Fonts, and serious skin.
*/
micro.css.include
/*
* Iterating through all "/modules/", and making sure we add each module into
* the [.modules] lambda.
*/
.modules
list-folders:/modules/
for-each:x:/@list-folders/*?name
/*
* Figuring out module name
*/
split:x:/@_dp?value
=:/
add:x:/@.modules
src:x:/@split/0/-?name
/*
* Removing license module, if it exists, since license needs to be purchased
* for each server.
*/
set:x:/@.modules/*/license
/*
* Adding a select option for each module into "build single module" select dropdown.
*/
for-each:x:/@.modules/*?name
eval-x:x:/+/*/*/*
add:x:/../*/create-widget/**/select/=hyperbuild-build-single-module/*/widgets
src
option
innerValue:x:/@_dp?value
/*
* Adding a checkbox for each module into "main distro" widget.
*/
for-each:x:/@.modules/*?name
/*
* Checking if this module should be checked off by default.
*/
if:x:/@_dp?value
=:desktop
or:x:/@_dp?value
=:micro
/*
* Module should be included by default.
*/
add:x:/..for-each/*/add/*/*/*/*/input
src
checked
/*
* Adding checkbox.
*/
eval-x:x:/+/*/*/*/*/*
add:x:/../*/create-widget/**/widgets/=modules
src
label
widgets
span
innerValue:x:/@_dp?value
input
type:checkbox
.data-field:/modules/{0}/
:x:/@_dp?value
/*
* Creating our main wireframe widget.
*/
create-widget:hyperbuild-main-container
class:container
events
/*
* Help context Active Event.
*/
desktop.help.get-context
return:@HYPERBUILD/help-files/Hyperbuild/index.hl
widgets
div
class:row
widgets
div
class:col-100
widgets
div
class:right
widgets
div
class:strip toolbar
widgets
a
href:/
class:button
role:button
innerValue:@"<span class=""icon-home3""></span>"
div
class:row
widgets
div
class:col-100
widgets
div
class:shaded rounded air-inner
widgets
h3
innerValue:Hyperbuild
p
innerValue:Build a single module. Choose a module you want to build, and click the <em>'Build'</em> button.
div
class:strip fill
widgets
label
innerValue:Module
select:hyperbuild-build-single-module
widgets
button
innerValue:Build
onclick
/*
* Figuring out which module user selected, building it,
* and downloading it to client.
*/
get-widget-property:hyperbuild-build-single-module
value
/*
* Checking if temp file exists, and if it does, deleting it.
*/
if
fetch:x:/0/0?value
file-exists::~/temp/{0}.zip
:x:/@get-widget-property/*/*?value
/*
* There exists a temp file with the filename we need to use
* for our output file, hence deleting it.
*/
delete-file:~/temp/{0}.zip
:x:/@get-widget-property/*/*?value
/*
* Zipping file, and downloading it to client.
*/
zip:~/temp/{0}.zip
:x:/@get-widget-property/*/*?value
src:/modules/{0}/
:x:/@get-widget-property/*/*?value
micro.download.file:~/temp/{0}.zip
:x:/@get-widget-property/*/*?value
hr
h3
innerValue:Main distro
p
innerValue:Build a main distro. Choose which modules you want to include in your main distro.
div:build-configuration
widgets:modules
div
class:right
widgets
button:hyperbuild-create-main-distro-btn
innerValue:Build
onclick
/*
* Making sure we create an obscurer, before we invoke the actual implementation.
*/
create-widgets
micro.widgets.cover:hyperbuild-cover-widget
message:Please wait while I create your build ...
/*
* Creating a pingback, which does the actual heavy lifting.
*/
micro.lambda.create-timeout
milliseconds:1
onfinish
/*
* Invoking Ajax method that is actually responsible for installing our module.
*
* Making sure we wrap invocation in a try/catch block.
*/
p5.web.widgets.ajax-events.raise:hyperbuild-create-main-distro-btn
.onclick
delete-widget:hyperbuild-cover-widget
.onclick
/*
* Serializing form, and creating our build.
*/
micro.form.serialize:build-configuration
add:x:/../*/micro.evaluate.file/*/core
src:x:@"/@micro.form.serialize/*/""=:bool:true""?name"
micro.evaluate.file:@HYPERBUILD/helpers/build.hl
include-web-config:bool:true
core