Skip to content

Commit 66fac30

Browse files
committed
Add file extensions
1 parent 0ab35a8 commit 66fac30

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+264
-200
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<body>
1212
<pre id="easycoder-script" style="display:none">
1313
variable Script
14-
rest get Script from `/resources/ecs/main`
14+
rest get Script from `/resources/ecs/main.ecs`
1515
run Script
1616
</pre>
1717
</body>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

resources/codex/md/step1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ If you leave off the ~code:exit~ instruction the ~ec~ compiler puts one in for y
2424
~pre:alert &#96;Hello, world!&#96;
2525
stop~
2626

27-
In this case, after you click the OK button and the popup box disappears, the button doesn't change back to . This is because the script is still in a 'running' state but it isn't actually doing anything. If you click the ~icon:runstop:20px:Stop~ button the script will be forced to exit. Try it and see.
27+
In this case, after you click the OK button and the popup box disappears, the button doesn't change back to ~icon:run:20px:Run~. This is because the script is still in a 'running' state but it isn't actually doing anything. If you click the ~icon:runstop:20px:Stop~ button the script will be forced to exit. Try it and see.
2828

2929
The alert popup is very useful when you want to stop your script and check what it's doing. You can construct a message that contains whatever information you need. For the next couple of steps in this tutorial we'll use alerts to explore some of the basic programming features and do some arithmetical computing before we get onto the visual stuff.
3030

resources/codex/md/step6.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ First we create the container, giving it center alignment, a margin around itsel
2222

2323
The image element is then created. Note that the command requests it to be created inside the container; the default would be for it to sit underneath. The image width is set to 70% of its containing element. Then we request the image itself from our server. When resources such as graphics are located on the same server as the code that uses them it's common for the URL not to begin with the usual ~code:http://~; here we have a relative path that refers to a folder on the server. As the programmer you obviously will know where your images are kept.
2424

25-
The title text comprises several lines. In a web page a line break is requested by using the word break, and to keep things tidy here the whole string is divided into lines and catenated together.
25+
The title text comprises several lines. In a web page a line break is requested by using the word ~code:break~, and to keep things tidy here the whole string is divided into lines and catenated together.
2626

2727
~next:Animation~

resources/css/styles.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ pre {
33
color:yellow;
44
padding:0.5em;
55
}
6+
7+
h1,h2,h3,h4,h5,h6 {
8+
font-family:sans;
9+
}

resources/ecs/about

Lines changed: 0 additions & 37 deletions
This file was deleted.

resources/ecs/about.ecs

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
! About
2+
3+
script About
4+
5+
import module Showdown
6+
7+
button ShowMeButton
8+
button CodexButton
9+
variable Script
10+
variable Item
11+
variable Codex
12+
variable ShowMe
13+
variable Message
14+
15+
rest get Script from `/resources/md/about.md`
16+
if mobile
17+
begin
18+
replace `/SIDEBAR/` with `below` in Script
19+
end
20+
else
21+
begin
22+
replace `/SIDEBAR/` with `on the left` in Script
23+
end
24+
rest get Item from `/resources/fragment/about/0.txt`
25+
replace `/0/` with `<span style="font-family:mono;color:darkred">` cat Item cat `</span>` in Script
26+
replace `/SHOWME/` with `<button style="margin-left:3em" id="showme">Show Me</button>` in Script
27+
replace `/CODEX/` with `<a href="#" id="about-codex">EasyCoder Codex</a>` in Script
28+
replace `/SLACK/` with `<a href="https://easycoder-software.slack.com">Slack workspace</a>` in Script
29+
30+
on message
31+
begin
32+
put the message into Message
33+
if Message is `restore` send Message to parent
34+
else if Message is `pause` begin end
35+
else go to Start
36+
end
37+
38+
set ready
39+
load plugin `codemirror`
40+
stop
41+
42+
Start:
43+
send Script to Showdown
44+
clear ShowMe
45+
attach ShowMeButton to `showme`
46+
set style `border-radius` of ShowMeButton to `0.5em`
47+
set style `padding` of ShowMeButton to `1em`
48+
on click ShowMeButton
49+
begin
50+
if ShowMe set style `background` of ShowMeButton to ``
51+
else set style `background` of ShowMeButton to `pink`
52+
toggle ShowMe
53+
end
54+
attach CodexButton to `about-codex`
55+
on click CodexButton
56+
begin
57+
load plugin `codemirror`
58+
rest get Codex from `/resources/ecs/codex`
59+
send `hide` to parent
60+
run Codex
61+
end
62+
stop

resources/ecs/codex renamed to resources/ecs/codex.ecs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
variable Items
9191

9292
load showdown
93-
rest get ECPayload from `/resources/fragment/ec`
93+
rest get ECPayload from `/resources/fragment/ec.txt`
9494

9595
! create Tracer
9696
! set attribute `id` of Tracer to `easycoder-tracer`
@@ -121,7 +121,7 @@
121121

122122
if not ReadOnly set the title to `EasyCoder Codex`
123123

124-
rest get Pages from `/resources/ecs/pages`
124+
rest get Pages from `/resources/ecs/pages.json`
125125

126126
get Step from storage as `.step`
127127
if left 4 of Step is not `step`
@@ -276,7 +276,7 @@
276276
set the style of ReferencePanel to `display:none;width:100%;height:100%`
277277

278278
gosub to ShowHelpPage
279-
rest get Script from `/resources/ecs/docman`
279+
rest get Script from `/resources/ecs/docman.ecs`
280280
run Script with ReferencePanel
281281
put empty into storage as `.ref`
282282

@@ -592,7 +592,7 @@ DoOpen:
592592
SelectFile:
593593
index File to the index of FileName
594594
set the content of NameEditor to File
595-
if PasswordValid rest get Content from `/resources/scripts/` cat File
595+
if PasswordValid rest get Content from `/resources/scripts/` cat File cat `.ecs`
596596
else get Content from storage as File
597597
put Content into Current
598598
set the content of Status to `Script '` cat File cat `' loaded`
@@ -645,7 +645,7 @@ ShowContents:
645645

646646
ShowHelpPage:
647647
put Step into storage as `.step`
648-
put `/resources/codex/code/` cat Step into Item
648+
put `/resources/codex/code/` cat Step cat `.ecs` into Item
649649
rest get Fragment from Item or begin end
650650
put property Step of Pages into Page
651651
if property `prev` of Page is empty set style `visibility` of Back to `hidden`
@@ -910,13 +910,15 @@ DoRunStop:
910910
end
911911

912912
set attribute `src` of RunStop to `resources/icon/runstop.png`
913+
set attribute `title` of RunStop to `Stop`
913914
set Running
914915
wait 10 ticks
915916

916917
run Script with RunPanel as TestModule nowait then
917918
begin
918919
clear Running
919920
set attribute `src` of RunStop to `resources/icon/run.png`
921+
set attribute `title` of RunStop to `Run`
920922
set style `display` of RunPanel to `none`
921923
set style `display` of HelpOuter to `block`
922924
if Mobile set style `display` of ScriptName to `none`
@@ -975,4 +977,4 @@ GetPassword:
975977

976978
SetPasswordValid:
977979
set PasswordValid
978-
return
980+
return

resources/ecs/concertina.ecs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
! Concertina
2+
3+
script Concertina
4+
5+
div Container
6+
7+
attach Container to `concertina`
8+
on message go to Start
9+
set ready
10+
stop
11+
12+
Start:
13+
set the content of Container to `The quick brown fox...`
14+
stop
File renamed without changes.

resources/ecs/examples.ecs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
! Examples
2+
3+
script Examples
4+
5+
import module Showdown
6+
7+
div Container
8+
div Concertina
9+
module ConcertinaModule
10+
variable Content
11+
variable Script
12+
variable Message
13+
variable ConcertinaRunning
14+
15+
rest get Content from `/resources/md/examples.md`
16+
17+
on message
18+
begin
19+
put the message into Message
20+
if Message is `restore` send `show` to parent
21+
else if Message is `pause` begin end
22+
else go to Start
23+
end
24+
25+
set ready
26+
stop
27+
28+
Start:
29+
send Content to Showdown
30+
if not ConcertinaRunning
31+
begin
32+
wait 10 ticks
33+
attach Container to `container`
34+
create Concertina in Container
35+
rest get Script from `/resources/ecs/concertina.ecs`
36+
run Script as ConcertinaModule
37+
set ConcertinaRunning
38+
end
39+
send to ConcertinaModule
40+
stop

resources/ecs/home

Lines changed: 0 additions & 92 deletions
This file was deleted.

resources/ecs/home.ecs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
! Home
2+
3+
script Home
4+
5+
import module Showdown
6+
7+
variable Script
8+
variable Item
9+
variable Message
10+
11+
rest get Script from `/resources/md/home.md`
12+
if mobile
13+
begin
14+
replace `/SIDEBAR/` with `below` in Script
15+
end
16+
else
17+
begin
18+
replace `/SIDEBAR/` with `on the left` in Script
19+
end
20+
rest get Item from `/resources/fragment/home/0.txt`
21+
replace `/0/` with `<span style="font-family:mono;color:darkred">` cat Item cat `</span>` in Script
22+
23+
on message
24+
begin
25+
put the message into Message
26+
if Message is `restore` send Message to parent
27+
else go to Start
28+
end
29+
set ready
30+
stop
31+
32+
Start:
33+
send Script to Showdown
34+
35+
stop

0 commit comments

Comments
 (0)