42
42
variable N
43
43
variable Even
44
44
variable Args
45
- variable Protocol
46
45
variable Domain
47
- variable Properties
48
- variable UserPath
49
- variable Resources
50
- variable Message
46
+ variable IsHome
47
+ variable Item
51
48
variable Post
52
49
53
50
json parse url the location as Args
54
- put property `protocol` of Args into Protocol
55
51
put property `domain` of Args into Domain
56
- rest get Properties from Protocol cat Domain cat `/easycoder-properties.json`
57
- put property `path` of Properties into UserPath
58
- put property `resources` of Properties into Resources
59
- if Resources is empty put `resources` into Resources
52
+ if Domain is `iwannashowyou.com` set IsHome
53
+ else clear IsHome
54
+ ! If the debug flag is set use admin storage
55
+ get Item from storage as `debug`
56
+ if Item is `true` clear IsHome
57
+ get AdminPassword from storage as `.password`
60
58
61
59
if portrait
62
60
begin
139
137
Show:
140
138
set style `display` of Container to `block`
141
139
142
- if UserPath
143
- begin
144
- put UserPath cat `/images` into Home
145
- end
146
- else
140
+ if IsHome
147
141
begin
148
142
get UserRecord from storage as `.user`
149
143
put property `email` of UserRecord into Email
150
144
get Password from storage as `user.password`
151
145
put property `home` of UserRecord into Home
152
- put Home cat `/` cat property `id` of UserRecord cat `/images` into Home
153
- put `users/` cat Home into Home
146
+ put `users/` cat Home cat `/` cat property `id` of UserRecord into Home
147
+ put Home cat `/images` into Home
154
148
end
149
+ else put `images` into Home
155
150
get CurrentPath from storage as `.filepath`
156
151
if CurrentPath is empty put Home into CurrentPath
157
- get AdminPassword from storage as `.password`
158
152
159
153
! Build the list
160
154
Browser:
161
155
put CurrentPath into storage as `.filepath`
162
- if UserPath
156
+ if IsHome
163
157
begin
164
- if AdminPassword is empty
165
- begin
166
- set Message to object
167
- set property `Action` of Message to `password`
168
- send Message to parent
169
- stop
170
- end
171
- rest get Content from `list/` cat AdminPassword cat `/` cat CurrentPath cat `?v=` cat now
158
+ rest get Content from `ulist/` cat Email cat `/` cat Password cat `/` cat CurrentPath cat `?v=` cat now
172
159
or begin
173
160
alert `Failed to list files.`
174
161
put empty into storage as `.filepath`
@@ -177,7 +164,7 @@ Browser:
177
164
end
178
165
else
179
166
begin
180
- rest get Content from `ulist /` cat Email cat `/` cat Password cat `/` cat CurrentPath cat `?v=` cat now
167
+ rest get Content from `list /` cat AdminPassword cat `/` cat CurrentPath cat `?v=` cat now
181
168
or begin
182
169
alert `Failed to list files.`
183
170
put empty into storage as `.filepath`
@@ -243,8 +230,8 @@ Browser:
243
230
if FileCount is 0
244
231
begin
245
232
put Path into CurrentPath
246
- if UserPath put `delete /` cat AdminPassword cat `/` cat CurrentPath into Post
247
- else put `udelete /` cat Email cat `/` cat Password cat `/` cat CurrentPath into Post
233
+ if IsHome put `udelete /` cat Email cat `/` cat Password cat `/` cat CurrentPath into Post
234
+ else put `delete /` cat AdminPassword cat `/` cat CurrentPath into Post
248
235
rest post to Post or
249
236
begin
250
237
alert `Failed to delete a file.`
@@ -286,8 +273,8 @@ SelectFile:
286
273
set the text of URL to `resources/` cat FilePath
287
274
on click DeleteButton
288
275
begin
289
- if UserPath put `delete /` cat AdminPassword cat `/` cat FilePath into Post
290
- else put `udelete /` cat Email cat `/` cat Password cat `/` cat FilePath into Post
276
+ if IsHome put `udelete /` cat Email cat `/` cat Password cat `/` cat FilePath into Post
277
+ else put `delete /` cat AdminPassword cat `/` cat FilePath into Post
291
278
rest post to Post or
292
279
begin
293
280
alert `Failed to delete the image.`
@@ -315,13 +302,13 @@ Upload:
315
302
else
316
303
begin
317
304
put CurrentPath into Path
318
- if UserPath put `upload /` cat AdminPassword cat `/` cat Path into Path
319
- else put `uupload /` cat Password cat `/` cat Email cat `/` cat Password cat `/` cat Path into Path
305
+ if IsHome put `uupload /` cat Password cat `/` cat Email cat `/` cat Password cat `/` cat Path into Path
306
+ else put `upload /` cat AdminPassword cat `/` cat Path into Path
320
307
upload UploadFile to Path with UploadProgress and UploadStatus
321
308
goto Browser
322
309
end
323
310
stop
324
311
325
312
Exit:
326
313
set style `display` of Container to `none`
327
- stop
314
+ stop
0 commit comments