Skip to content

Reorganise file structure #140

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
Jun 22, 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
Reorganise file structure
  • Loading branch information
graham-trott committed Jun 22, 2020
commit 1e07d07feed42d1857def0172b52da25a0628a8b
File renamed without changes.
35 changes: 33 additions & 2 deletions iwsy/resources/ecs/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import div Container

div Player
callback DecoratorCallback
a Link
variable Mobile
Expand All @@ -12,6 +13,8 @@
variable Payload
variable ImageCount
variable LinkCount
variable HasEmbed
variable Embed
variable Function
variable Data
variable Source
Expand All @@ -32,14 +35,22 @@
load showdown
on DecoratorCallback go to Decorate

on message go to Show
on message
begin
if the message is `stop`
begin
if HasEmbed iwsy stop
end
else go to Show
end
set ready
stop

Show:
set style `display` of Container to `block`
get Page from storage as `.help`
GetPage:
clear HasEmbed
if Page is empty
begin
put `iwsy` into Page
Expand All @@ -66,9 +77,22 @@ GetPage:
end
on click Link
begin
if HasEmbed iwsy stop
put attribute `data-page` of Link into Page
go to GetPage
end
if HasEmbed
begin
attach Player to `iwsy-embed`
put attribute `data-url` of Player into Data
rest get Embed from Data
put the position of the last `/` in Data into N
add 1 to N
put left N of Data into Data
iwsy load Player Embed
iwsy path Data
iwsy run
end
stop

!------------------------------------------------------------------------------
Expand All @@ -92,6 +116,7 @@ Decorate:
put `<span style="font-family:monospace;color:darkred">` cat Data cat `</span>` into Payload
else if Function is `img` gosub to ProcessImage
else if Function is `page` gosub to ProcessPage
else if Function is `embed` gosub to ProcessEmbed
end
end
set the payload of DecoratorCallback to Payload
Expand Down Expand Up @@ -140,7 +165,7 @@ ProcessImage:
add 1 to ImageCount
return

! Process a request for a new page.
! Process a request for a new page
ProcessPage:
put the position of `:` in Data into N
if N is -1 return
Expand All @@ -152,6 +177,12 @@ ProcessPage:
add 1 to LinkCount
return

! Process a request for an embedded presentation
ProcessEmbed:
put `<div id="iwsy-embed" data-url="` cat Data cat `" style "width:100%"></div>` into Payload
set HasEmbed
return

Exit:
set style `display` of Container to `none`
stop
37 changes: 25 additions & 12 deletions iwsy/resources/ecs/iwsy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
variable Presentation
variable OriginalPresentation
variable Name
variable ShowRun
variable ReadOnly
variable CallStack
variable Message
Expand Down Expand Up @@ -121,8 +120,8 @@ Start:

! The left-hand panel
create Left in Body
set the style of Left to
`flex:1;height:100%;border-right:1px solid black;margin-right:0.5em;display:flex;flex-direction:column`
set the style of Left to `flex:1;height:100%;border-right:1px solid black;margin-right:0.5em;`
cat `display:flex;flex-direction:column;max-width:50%`

create Masthead in Left
set the style of Masthead to
Expand Down Expand Up @@ -194,7 +193,7 @@ Start:
set attribute `title` of FileMan to `File Manager`
create Link in Buttons
create RunStop in Link
set the style of RunStop to `width:40px;margin-right:1.5em`
set the style of RunStop to `width:40px;margin-right:0.5em`
set attribute `src` of RunStop to `resources/icon/run.png`
set attribute `title` of RunStop to `Run`
create Link in Buttons
Expand All @@ -221,7 +220,7 @@ Start:
set the style of FileManPanel to `flex:1;display:none;margin-top:0.5em;border-top:1px solid black`

create HelpPanel in Left
set the style of HelpPanel to `flex:1;display:none;margin-top:0.5em;border-top:1px solid black`
set the style of HelpPanel to `flex:1;display:none;margin-top:0.5em;border-top:1px solid black;overflow:scroll`

! The right-hand panel
create Right in Body
Expand Down Expand Up @@ -313,6 +312,9 @@ Start:
end
clear FileIsOpen
clear Player
clear Running
iwsy stop
set attribute `src` of RunStop to `resources/icon/run.png`
set the content of NameEditor to empty
put empty into CurrentScriptName
gosub to CreateNewPresentation
Expand Down Expand Up @@ -400,7 +402,7 @@ Start:
end
end

on click RunStop
on click FileMan
begin
if Running stop
if UserRecord is empty stop
Expand All @@ -411,6 +413,7 @@ Start:
end
set style `display` of Player to `none`
set style `display` of HelpPanel to `none`
if HelpModule is running send `stop` to HelpModule
set style `display` of FileManPanel to `block`
send to FileManModule
end
Expand Down Expand Up @@ -473,6 +476,7 @@ Start:
begin
set style `display` of FileManPanel to `none`
set style `display` of HelpPanel to `none`
if HelpModule is running send `stop` to HelpModule
set style `display` of Player to `block`
put property `block` of Message into N
iwsy block N
Expand Down Expand Up @@ -553,7 +557,8 @@ FullScreenManual:

ShowHelp:
if Running stop
if HelpModule is not running
if HelpModule is running send `stop` to HelpModule
else
begin
require js
`https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/plugins/showdown.js?v=` cat now
Expand Down Expand Up @@ -768,9 +773,11 @@ SelectFile:
gosub to SetStatusGreen
set the text of Status to `Presentation '` cat File cat `' loaded`
fork to ResetStatus
set ShowRun
clear Running
set attribute `src` of RunStop to `resources/icon/run.png`
set style `display` of FileManPanel to `none`
set style `display` of HelpPanel to `none`
if HelpModule is running send `stop` to HelpModule
set style `display` of Player to `block`
iwsy script Presentation

Expand Down Expand Up @@ -806,11 +813,13 @@ DoRunStop:
begin
put property `steps` of Presentation into Item
if the json count of Item is 1 stop
set Running
if HelpModule is running send `stop` to HelpModule
set style `display` of Player to `block`
set style `display` of FileManPanel to `none`
set style `display` of HelpPanel to `none`
gosub to ClearStepsButtons
set attribute `src` of RunStop to `resources/icon/runstop.png`
set Running

put 0 into N
gosub to SelectSection
Expand All @@ -820,7 +829,6 @@ DoRunStop:
put the iwsy step into N
if N is -1
begin
! set the content of NameEditor to empty
put the iwsy script into Presentation
go to PrepareScript
end
Expand All @@ -834,8 +842,8 @@ DoRunStop:
end

put Presentation into OriginalPresentation
! put NameEditor into OriginalName
set style `display` of HelpPanel to `none`
if HelpModule is running send `stop` to HelpModule
set Message to object
set property `action` of Message to `running`
send Message to StepsModule
Expand All @@ -844,7 +852,6 @@ DoRunStop:
gosub to ClearStepsButtons
set attribute `src` of RunStop to `resources/icon/run.png`
clear Running
! set the text of NameEditor to OriginalName
put OriginalPresentation into Presentation
go to PrepareScript
end
Expand All @@ -862,6 +869,12 @@ PrepareScript:
RunFullScreen:
put property `steps` of Presentation into Item
if the json count of Item is 1 stop
if HelpModule is running send `stop` to HelpModule
set style `display` of Player to `block`
set style `display` of FileManPanel to `none`
set style `display` of HelpPanel to `none`
iwsy init
iwsy script Presentation
if Running iwsy stop
else iwsy run fullscreen
toggle Running
Expand Down
7 changes: 5 additions & 2 deletions iwsy/resources/ecs/steps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -776,10 +776,12 @@ EditBlockList:
gosub to SaveCurrentStep
json add empty to Blocks
set property `blocks` of CurrentStep to Blocks
set element SelectedStep of Steps to CurrentStep
clear Table
go to ReloadStepEditor
end
put property `blocks` of CurrentStep into Blocks
if Blocks is empty set Blocks to array
put the json count of Blocks into N
set the elements of BlockSelect to N
set the elements of DeleteContent to N
Expand Down Expand Up @@ -814,6 +816,7 @@ EditBlockList:
put the index of DeleteContent into N
json delete element N of Blocks
set property `blocks` of CurrentStep to Blocks
set element SelectedStep of Steps to CurrentStep
clear Table
go to ReloadStepEditor
end
Expand Down Expand Up @@ -912,7 +915,7 @@ CreateNewAction:
put property `blocks` of CurrentStep into Blocks
if Blocks is empty
begin
set Blocks to object
set Blocks to array
set property `blocks` of CurrentStep to Blocks
end
end
Expand Down Expand Up @@ -1026,7 +1029,7 @@ SaveCurrentStep:
put property `blocks` of CurrentStep into Blocks
if Blocks is empty
begin
set Blocks to object
set Blocks to array
set property `blocks` of CurrentStep to Blocks
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"top": 0,
"width": 1000,
"height": 1000,
"background": "url('resources/img/SemoigoDawn.jpg')",
"background": "url('resources/img/quickstart/SemoigoDawn.jpg')",
"border": "",
"borderRadius": "",
"fontFamily": "",
Expand Down