Skip to content

Commit 20e9a4a

Browse files
committed
Modify block structure
1 parent bac0ea1 commit 20e9a4a

File tree

7 files changed

+823
-284
lines changed

7 files changed

+823
-284
lines changed

iwsy/iwsy.js

Lines changed: 160 additions & 136 deletions
Large diffs are not rendered by default.

iwsy/resources/ecs/blocks.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
variable Blocks
2222
variable Block
2323
variable Block2
24+
variable Defaults
2425
variable PropertyDefaults
2526
variable PropertyNames
2627
variable PropertyName
@@ -63,14 +64,15 @@ Restart:
6364
set attribute `src` of AddBlock to `resources/icon/plus.png`
6465
on click AddBlock
6566
begin
66-
set Block to object
67+
set Defaults to object
6768
put 0 into N
6869
while N is less than the json count of PropertyNames
6970
begin
7071
put element N of PropertyNames into PropertyName
71-
set property PropertyName of Block to property PropertyName of PropertyDefaults
72+
set property PropertyName of Defaults to property PropertyName of PropertyDefaults
7273
add 1 to N
7374
end
75+
set property `defaults` of Block to Defaults
7476
json add Block to Blocks
7577
set property `blocks` of Presentation to Blocks
7678
go to Restart
@@ -103,7 +105,8 @@ Restart:
103105
create EditButton in Cell
104106
set the style of EditButton to `flex:1`
105107
put element N of Blocks into Block
106-
set the text of EditButton to property `name` of Block
108+
put property `defaults` of Block into Defaults
109+
set the text of EditButton to property `name` of Defaults
107110
if N is 0
108111
begin
109112
create Empty in Cell
@@ -157,6 +160,7 @@ Restart:
157160
set style `background` of EditButton to `lightgray`
158161
set style `display` of Editor to `block`
159162
put element SelectedBlock of Blocks into Block
163+
put property `defaults` of Block into Defaults
160164
put the json count of PropertyNames into N
161165
set the elements of PropertyValue to N
162166
put 0 into N
@@ -171,7 +175,7 @@ Restart:
171175
index PropertyValue to N
172176
create PropertyValue in Row
173177
set the style of PropertyValue to `flex:1`
174-
set the text of PropertyValue to property PropertyName of Block
178+
set the text of PropertyValue to property PropertyName of Defaults
175179
add 1 to N
176180
end
177181
create Row in Editor
@@ -196,6 +200,7 @@ Restart:
196200
add 1 to N
197201
set element N of Blocks to Block2
198202
set property `blocks` of Presentation to Blocks
203+
put -1 into SelectedBlock
199204
go to Restart
200205
end
201206
on click DeleteBlock
@@ -217,10 +222,11 @@ SaveSelectedBlock:
217222
begin
218223
put element N of PropertyNames into PropertyName
219224
index PropertyValue to N
220-
set property PropertyName of Block to the text of PropertyValue
225+
set property PropertyName of Defaults to the text of PropertyValue
221226
add 1 to N
222227
end
223-
set the text of EditButton to property `name` of Block
228+
set the text of EditButton to property `name` of Defaults
229+
set property `defaults` of Block to Defaults
224230
set element SelectedBlock of Blocks to Block
225231
set property `blocks` of Presentation to Blocks
226232

iwsy/resources/ecs/content.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ Restart:
6969
set attribute `src` of AddItem to `resources/icon/plus.png`
7070
on click AddItem
7171
begin
72-
put prompt `Name of new content item:` with `new content` into ItemName
73-
put empty into Item
74-
set property ItemName of Items to Item
72+
! put prompt `Name of new content item:` with `new content` into ItemName
73+
set Item to object
74+
set property `name` of Item to `New content`
75+
set property `content` of Item to empty
76+
json add Item to Items
7577
set property `content` of Presentation to Items
7678
go to Restart
7779
end
@@ -184,6 +186,7 @@ Restart:
184186
add 1 to N
185187
set element N of Items to Item2
186188
set property `content` of Presentation to Items
189+
put -1 into SelectedItem
187190
go to Restart
188191
end
189192
on click DeleteItem

iwsy/resources/ecs/iwsy.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
div Body
66
div Left
77
div Right
8+
div Masthead
9+
div Title
10+
div Subtitle
811
div Controls
912
div ContentDiv
1013
div Buttons
@@ -98,6 +101,17 @@ L2:
98101
create Left in Body
99102
set the style of Left to `flex:1;height:100%;border-right:1px solid black;margin-right:0.5em`
100103

104+
create Masthead in Left
105+
set the style of Masthead to
106+
`border:0.2em solid purple;text-align:center;color: lemonchiffon;background:darkmagenta;position:relative`
107+
create Title in Masthead
108+
set the style of Title to `font-size:4em;font-weight:bold;font-style:italic`
109+
set the content of Title to `I Wanna Show You`
110+
create Subtitle in Masthead
111+
set the style of Subtitle to
112+
`position:relative;top:-0.5em;font-size:1.5em;font-weight:bold;font-style:italic`
113+
set the content of Subtitle to `powerful web-based presentations`
114+
101115
create Controls in Left
102116
set the style of Controls to `padding:0 0.5em`
103117

0 commit comments

Comments
 (0)