1
- ! Presenter
1
+ ! Mostrami
2
2
3
- script Presenter
3
+ script Mostrami
4
4
5
5
div Body
6
6
div Left
50
50
variable Message
51
51
variable Section
52
52
variable Item
53
+ variable Array
53
54
variable N
54
55
55
56
! The browser
@@ -212,51 +213,16 @@ L2:
212
213
put -1 into Section
213
214
on click SectionButton
214
215
begin
216
+ put the index of SectionButton into N
215
217
if Section is not -1
216
218
begin
217
219
index SectionButton to Section
218
220
set style `background` of SectionButton to ``
219
221
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
227
223
index SectionButton to Section
228
224
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
260
226
end
261
227
262
228
! Create the file browser
@@ -355,14 +321,124 @@ L2:
355
321
go to ResetStatus
356
322
end
357
323
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
358
347
stop
359
348
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
+
360
436
DoOpen:
361
437
! gosub to StopTestModule
362
438
gosub to GetPassword
363
439
364
440
clear FileIsOpen
365
- if Content is not Current
441
+ if Presentation is not Current
366
442
begin
367
443
if confirm `Content has changed. Do you want to save it?`
368
444
begin
@@ -461,12 +537,7 @@ SelectFile:
461
537
if PasswordValid rest get Presentation from `/resources/json/` cat File
462
538
else get Presentation from storage as File
463
539
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
470
541
set the content of Status to `Presentation '` cat File cat `' loaded`
471
542
fork to ResetStatus
472
543
set ShowRun
@@ -482,54 +553,6 @@ ResetStatus:
482
553
set the content of Status to ``
483
554
stop
484
555
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
-
533
556
GetPassword:
534
557
if ReadOnly
535
558
begin
0 commit comments