Skip to content

Commit 56f28eb

Browse files
committed
Code the steps module
1 parent 67a6a8a commit 56f28eb

File tree

8 files changed

+326
-378
lines changed

8 files changed

+326
-378
lines changed

mostrami/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
<head>
33
<meta charset="UTF-8">
44
<meta name="viewport" content="width=device-width, initial-scale=1.0">
5-
<script type='text/javascript' src='https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/easycoder.js?v=200521'></script>
5+
<!--script src='https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/easycoder.js?v=2.7.1'></script-->
6+
<script src='dist/easycoder.js?v=2.7.1'></script>
67
</head>
78

89
<body>
910

1011
<pre id="easycoder-rest" style="display:none">rest.php</pre>
1112
<pre id="easycoder-script" style="display:none">
12-
! EasyCoder Presenter
13+
! Mostrami Pro
1314

1415
script Launcher
1516

1617
variable Script
17-
require js `https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/plugins/codemirror.js?v=` cat now
18-
rest get Script from `/resources/ecs/presenter.txt`
18+
rest get Script from `/resources/ecs/mostrami.txt?v=` cat now
1919
run Script
2020

2121
</body>

mostrami/resources/ecs/presenter.txt renamed to mostrami/resources/ecs/mostrami.txt

Lines changed: 118 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
! Presenter
1+
! Mostrami
22

3-
script Presenter
3+
script Mostrami
44

55
div Body
66
div Left
@@ -50,6 +50,7 @@
5050
variable Message
5151
variable Section
5252
variable Item
53+
variable Array
5354
variable N
5455

5556
! The browser
@@ -212,51 +213,16 @@ L2:
212213
put -1 into Section
213214
on click SectionButton
214215
begin
216+
put the index of SectionButton into N
215217
if Section is not -1
216218
begin
217219
index SectionButton to Section
218220
set style `background` of SectionButton to ``
219221
end
220-
set style `display` of GlobalsPanel to `none`
221-
set style `display` of ContainerPanel to `none`
222-
set style `display` of DefaultsPanel to `none`
223-
set style `display` of BlocksPanel to `none`
224-
set style `display` of ContentPanel to `none`
225-
set style `display` of StepsPanel to `none`
226-
put the index of SectionButton into Section
222+
put N into Section
227223
index SectionButton to Section
228224
set style `background` of SectionButton to `lightgray`
229-
230-
if Section is 0
231-
begin
232-
gosub to SetupGlobalsModule
233-
send to GlobalsModule
234-
end
235-
else if Section is 1
236-
begin
237-
gosub to SetupContainerModule
238-
send to ContainerModule
239-
end
240-
else if Section is 2
241-
begin
242-
gosub to SetupDefaultsModule
243-
send to DefaultsModule
244-
end
245-
else if Section is 3
246-
begin
247-
gosub to SetupBlocksModule
248-
send to BlocksModule
249-
end
250-
else if Section is 4
251-
begin
252-
gosub to SetupContentModule
253-
send to ContentModule
254-
end
255-
else if Section is 5
256-
begin
257-
gosub to SetupStepsModule
258-
send to StepsModule
259-
end
225+
gosub to UpdateCurrentSection
260226
end
261227

262228
! Create the file browser
@@ -355,14 +321,124 @@ L2:
355321
go to ResetStatus
356322
end
357323
end
324+
325+
set Presentation to object
326+
set Item to object
327+
set property `global` of Presentation to Item
328+
set property `container` of Presentation to Item
329+
set property `defaults` of Presentation to Item
330+
set property `blocks` of Presentation to Item
331+
set property `content` of Presentation to Item
332+
set Item to object
333+
set property `comment` of Item to `Pause for a second`
334+
set property `action` of Item to `pause`
335+
set property `duration` of Item to 1
336+
set Array to array
337+
json add Item to Array
338+
set property `steps` of Presentation to Array
339+
put Presentation into Current
340+
gosub to SetupGlobals
341+
gosub to SetupContainer
342+
gosub to SetupDefaults
343+
gosub to SetupBlocks
344+
gosub to SetupContent
345+
gosub to SetupSteps
346+
gosub to UpdateCurrentSection
358347
stop
359348

349+
SetupGlobals:
350+
if GlobalsModule is not running
351+
begin
352+
rest get Script from `/resources/ecs/globals.txt`
353+
run Script with GlobalsPanel and Presentation as GlobalsModule
354+
end
355+
return
356+
357+
SetupContainer:
358+
if ContainerModule is not running
359+
begin
360+
rest get Script from `/resources/ecs/container.txt`
361+
run Script with ContainerPanel and Presentation as ContainerModule
362+
end
363+
return
364+
365+
SetupDefaults:
366+
if DefaultsModule is not running
367+
begin
368+
rest get Script from `/resources/ecs/defaults.txt`
369+
run Script with DefaultsPanel and Presentation as DefaultsModule
370+
end
371+
return
372+
373+
SetupBlocks:
374+
if BlocksModule is not running
375+
begin
376+
rest get Script from `/resources/ecs/blocks.txt`
377+
run Script with BlocksPanel and Presentation as BlocksModule
378+
end
379+
return
380+
381+
SetupContent:
382+
if ContentModule is not running
383+
begin
384+
rest get Script from `/resources/ecs/content.txt`
385+
run Script with ContentPanel and Presentation as ContentModule
386+
end
387+
return
388+
389+
SetupSteps:
390+
if StepsModule is not running
391+
begin
392+
rest get Script from `/resources/ecs/steps.txt`
393+
run Script with StepsPanel and Presentation as StepsModule
394+
end
395+
return
396+
397+
UpdateCurrentSection:
398+
set style `display` of GlobalsPanel to `none`
399+
set style `display` of ContainerPanel to `none`
400+
set style `display` of DefaultsPanel to `none`
401+
set style `display` of BlocksPanel to `none`
402+
set style `display` of ContentPanel to `none`
403+
set style `display` of StepsPanel to `none`
404+
if Section is 0
405+
begin
406+
set style `display` of GlobalsPanel to `block`
407+
send to GlobalsModule
408+
end
409+
if Section is 1
410+
begin
411+
set style `display` of ContainerPanel to `block`
412+
send to ContainerModule
413+
end
414+
if Section is 2
415+
begin
416+
set style `display` of DefaultsPanel to `block`
417+
send to DefaultsModule
418+
end
419+
if Section is 3
420+
begin
421+
set style `display` of BlocksPanel to `block`
422+
send to BlocksModule
423+
end
424+
if Section is 4
425+
begin
426+
set style `display` of ContentPanel to `block`
427+
send to ContentModule
428+
end
429+
if Section is 5
430+
begin
431+
set style `display` of StepsPanel to `block`
432+
send to StepsModule
433+
end
434+
return
435+
360436
DoOpen:
361437
! gosub to StopTestModule
362438
gosub to GetPassword
363439

364440
clear FileIsOpen
365-
if Content is not Current
441+
if Presentation is not Current
366442
begin
367443
if confirm `Content has changed. Do you want to save it?`
368444
begin
@@ -461,12 +537,7 @@ SelectFile:
461537
if PasswordValid rest get Presentation from `/resources/json/` cat File
462538
else get Presentation from storage as File
463539
put Presentation into Current
464-
gosub to SetupGlobalsModule
465-
gosub to SetupContainerModule
466-
gosub to SetupDefaultsModule
467-
gosub to SetupBlocksModule
468-
gosub to SetupContentModule
469-
gosub to SetupStepsModule
540+
gosub to UpdateCurrentSection
470541
set the content of Status to `Presentation '` cat File cat `' loaded`
471542
fork to ResetStatus
472543
set ShowRun
@@ -482,54 +553,6 @@ ResetStatus:
482553
set the content of Status to ``
483554
stop
484555

485-
SetupGlobalsModule:
486-
if GlobalsModule is not running
487-
begin
488-
rest get Script from `/resources/ecs/globals.txt`
489-
run Script with GlobalsPanel and Presentation as GlobalsModule
490-
end
491-
return
492-
493-
SetupContainerModule:
494-
if ContainerModule is not running
495-
begin
496-
rest get Script from `/resources/ecs/container.txt`
497-
run Script with ContainerPanel and Presentation as ContainerModule
498-
end
499-
return
500-
501-
SetupDefaultsModule:
502-
if DefaultsModule is not running
503-
begin
504-
rest get Script from `/resources/ecs/defaults.txt`
505-
run Script with DefaultsPanel and Presentation as DefaultsModule
506-
end
507-
return
508-
509-
SetupBlocksModule:
510-
if BlocksModule is not running
511-
begin
512-
rest get Script from `/resources/ecs/blocks.txt`
513-
run Script with BlocksPanel and Presentation as BlocksModule
514-
end
515-
return
516-
517-
SetupContentModule:
518-
if ContentModule is not running
519-
begin
520-
rest get Script from `/resources/ecs/content.txt`
521-
run Script with ContentPanel and Presentation as ContentModule
522-
end
523-
return
524-
525-
SetupStepsModule:
526-
if StepsModule is not running
527-
begin
528-
rest get Script from `/resources/ecs/steps.txt`
529-
run Script with StepsPanel and Presentation as StepsModule
530-
end
531-
return
532-
533556
GetPassword:
534557
if ReadOnly
535558
begin

0 commit comments

Comments
 (0)