Skip to content

More development of 'steps' module #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions mostrami/resources/ecs/defaults.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,46 @@

import div Panel and variable Presentation

div GlobalTitle
div GlobalPanel
div ContainerTitle
div ContainerPanel
div DefaultsTitle
div DefaultsPanel

create GlobalTitle in Panel
set the style of GlobalTitle to
`font-weight:bold;font-size:110%;background:lightgray;padding:0.2em;text-align:center`

create GlobalPanel in Panel
set the style of GlobalPanel to `height:auto;max-height:30%;flex:1;overflow-y:scroll;margin-top:0.5em`

create ContainerTitle in Panel
set the style of ContainerTitle to
`font-weight:bold;font-size:110%;background:lightgray;padding:0.2em;text-align:center`

create ContainerPanel in Panel
set the style of ContainerPanel to `height:auto;max-height:30%;flex:1;overflow-y:scroll;margin-top:0.5em`

create DefaultsTitle in Panel
set the style of DefaultsTitle to
`font-weight:bold;font-size:110%;background:lightgray;padding:0.2em;text-align:center`

create DefaultsPanel in Panel
set the style of DefaultsPanel to `flex:1;overflow-y:scroll;margin-top:0.5em`

on message go to Start
set ready
stop

Start:
set style `display` of Panel to `flex`
set style `flex-direction` of Panel to `column`

clear GlobalPanel
clear ContainerPanel
clear DefaultsPanel
set the content of GlobalTitle to `Global defaults`
set the content of ContainerTitle to `Container defaults`
set the content of DefaultsTitle to `Block defaults`
stop
68 changes: 9 additions & 59 deletions mostrami/resources/ecs/mostrami.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
div Tabs
div Tab
div ScriptName
div GlobalsPanel
div ContainerPanel
div DefaultsPanel
div BlocksPanel
div ContentPanel
Expand All @@ -28,8 +26,6 @@
img Delete
img Cycle
a Link
module GlobalsModule
module ContainerModule
module DefaultsModule
module BlocksModule
module ContentModule
Expand Down Expand Up @@ -91,7 +87,7 @@ L2:
if mobile set Mobile else clear Mobile
end

set the title to `JSON::Prsenter`
set the title to `Mostrami Pro`
create Body
if Mobile
set the style of Body to `width:100%;height:100%`
Expand Down Expand Up @@ -159,51 +155,35 @@ L2:
create Tabs in Controls
set the style of Tabs to `width:100%;padding-bottom:0.5em;text-align:center`
put the width of Tabs into N
divide N by 6
set the elements of SectionButton to 6
divide N by 4
set the elements of SectionButton to 4
create Tab in Tabs
set the style of Tab to `display:inline-block;width:` cat N cat `px`
index SectionButton to 0
create SectionButton in Tab
set the style of SectionButton to `width:100%`
set the content of SectionButton to `Global`
create GlobalsPanel in ContentDiv
set the style of GlobalsPanel to `position:absolute;left:0;top:0;width:100%;height:100%;`
create Tab in Tabs
set the style of Tab to `display:inline-block;width:` cat N cat `px`
index SectionButton to 1
create SectionButton in Tab
set the style of SectionButton to `width:100%`
set the content of SectionButton to `Container`
create ContainerPanel in ContentDiv
set the style of ContainerPanel to `position:absolute;left:0;top:0;width:100%;height:100%;`
create Tab in Tabs
set the style of Tab to `display:inline-block;width:` cat N cat `px`
index SectionButton to 2
create SectionButton in Tab
set the style of SectionButton to `width:100%`
set the content of SectionButton to `Defaults`
create DefaultsPanel in ContentDiv
set the style of DefaultsPanel to `position:absolute;left:0;top:0;width:100%;height:100%;`
create Tab in Tabs
set the style of Tab to `display:inline-block;width:` cat N cat `px`
index SectionButton to 3
index SectionButton to 1
create SectionButton in Tab
set the style of SectionButton to `width:100%`
set the content of SectionButton to `Blocks`
create BlocksPanel in ContentDiv
set the style of BlocksPanel to `position:absolute;left:0;top:0;width:100%;height:100%;`
create Tab in Tabs
set the style of Tab to `display:inline-block;width:` cat N cat `px`
index SectionButton to 4
index SectionButton to 2
create SectionButton in Tab
set the style of SectionButton to `width:100%`
set the content of SectionButton to `Content`
create ContentPanel in ContentDiv
set the style of ContentPanel to `position:absolute;left:0;top:0;width:100%;height:100%;`
create Tab in Tabs
set the style of Tab to `display:inline-block;width:` cat N cat `px`
index SectionButton to 5
index SectionButton to 3
create SectionButton in Tab
set the style of SectionButton to `width:100%`
set the content of SectionButton to `Steps`
Expand Down Expand Up @@ -337,31 +317,13 @@ L2:
json add Item to Array
set property `steps` of Presentation to Array
put Presentation into Current
gosub to SetupGlobals
gosub to SetupContainer
gosub to SetupDefaults
gosub to SetupBlocks
gosub to SetupContent
gosub to SetupSteps
gosub to UpdateCurrentSection
stop

SetupGlobals:
if GlobalsModule is not running
begin
rest get Script from `/resources/ecs/globals.txt`
run Script with GlobalsPanel and Presentation as GlobalsModule
end
return

SetupContainer:
if ContainerModule is not running
begin
rest get Script from `/resources/ecs/container.txt`
run Script with ContainerPanel and Presentation as ContainerModule
end
return

SetupDefaults:
if DefaultsModule is not running
begin
Expand Down Expand Up @@ -395,38 +357,26 @@ SetupSteps:
return

UpdateCurrentSection:
set style `display` of GlobalsPanel to `none`
set style `display` of ContainerPanel to `none`
set style `display` of DefaultsPanel to `none`
set style `display` of BlocksPanel to `none`
set style `display` of ContentPanel to `none`
set style `display` of StepsPanel to `none`
if Section is 0
begin
set style `display` of GlobalsPanel to `block`
send to GlobalsModule
end
if Section is 1
begin
set style `display` of ContainerPanel to `block`
send to ContainerModule
end
if Section is 2
begin
set style `display` of DefaultsPanel to `block`
send to DefaultsModule
end
if Section is 3
else if Section is 1
begin
set style `display` of BlocksPanel to `block`
send to BlocksModule
end
if Section is 4
else if Section is 2
begin
set style `display` of ContentPanel to `block`
send to ContentModule
end
if Section is 5
else if Section is 3
begin
set style `display` of StepsPanel to `block`
send to StepsModule
Expand Down
Loading