This repository has been archived by the owner on Oct 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlaunch.hl
163 lines (110 loc) · 3.77 KB
/
launch.hl
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
/*
* File responsible for starting Sephia Five, which means creating the main widget,
* and wire frame for displaying inbox, starting POP3 worker thread, etc.
*
* Notice, it will first force the user to setup his POP3 and SMTP settings, unless
* he has already done so.
*/
/*
* Creating main content container.
*
* This is the place where "everything" is stored in Sephia, and is used to display
* the inbox, Sephia's settings, emails the user is reading, etc, etc, etc.
*
* Notice, we only use one "container" widget from Micro for everything related to Sephia.
*/
create-container-widget:sephia-main-container
class:container
/*
* Including Micro, and adding Awesome Fonts.
*/
micro.css.include
/*
* Making sure user has an attachment folder.
*
* The first time the user opens Sephia, it will automatically create the user's
* attachment folder, in addition to a temporary folder, where uploaded attachments will
* be temporary stored, before an email is sent.
*
* Every time the user refresh Sephia's page, this temporary attachment folder will be emptied.
*/
micro.evaluate.file:@SEPHIA/init-user/ensure-user-attachment-folder.hl
/*
* Making sure we delete all file in temporary attachment folder.
*/
list-files:@SEPHIA-USER-ATTACHMENTS/tmp/
delete-file:x:/-/*?name
/*
* Retrieving user's settings, and making sure user has setup his account(s).
*
* Notice, if user hasn't setup his account(s), we won't allow him to open his inbox,
* but force him to go through his settings, such as POP3, SMTP, PGP settings, etc.
*/
p5.auth.my-settings.get
if:x:/@p5.auth.my-settings.get/*/sephia
not
/*
* Then creating our settings widget, before we return early.
*/
create-widget
parent:sephia-main-container
widgets
div
class:row air-top
widgets
div
class:col-100
widgets
div
class:right
widgets
div
class:strip toolbar
widgets
button
innerValue:@"<span class=""icon-home3""></span>"
onclick
/*
* Changing root URL of client to main root URL.
*/
p5.web.get-root-location
p5.web.set-location:x:/-?value
div
class:col-100
widgets
sephia._internals.widgets.settings
wizard-mode:true
/*
* Returning early to avoid evaluating the rest of this file.
*/
return
/*
* Including main CSS file for Sephia.
*
* Notice, this is done after all other CSS files are included, to make sure we
* can override anything we wish in Sephia's main CSS file.
*/
p5.web.include-css-file:@SEPHIA/media/main.css
/*
* Ensuring user has his "welcome email(s) and contact(s)".
*/
micro.evaluate.file:@SEPHIA/init-user/ensure-initial-welcome-emails-and-contacts.hl
/*
* Making sure we start email fetching thread.
*
* This will by default create a thread for each user, that runs in the background,
* and constantly pulls new emails from the user's POP3 server.
*
* Alternatively, it will check if user is allowed to fetch his emails, and if not,
* return boolean "false".
*/
sephia._internals.create-pop3-user-thread
/*
* Creating inbox widget.
*/
micro.evaluate.file:@SEPHIA/inbox/create-inbox.hl
/*
* Creates widget that constantly polls server every n'th second to
* check if new emails have arrived.
*/
micro.evaluate.file:@SEPHIA/inbox/create-client-server-poller.hl