7
7
div Editor
8
8
div Row
9
9
div Cell
10
+ div Title
10
11
table Table
11
12
tr TR
12
13
td TD
13
14
select PropertySelect
14
15
input PropertyValue
15
16
button EditButton
16
17
img Add
18
+ img AddBlock
17
19
img Delete
18
20
a Link
19
21
variable Blocks
23
25
variable BlockProperties
24
26
variable PropertyNames
25
27
variable PropertyName
28
+ variable SelectedBlock
26
29
variable Name
27
30
variable Action
28
31
variable N
@@ -54,15 +57,39 @@ Start:
54
57
json add `blockBackground` to BlockProperties
55
58
json add `blockBorder` to BlockProperties
56
59
json add `blockBorderRadius` to BlockProperties
57
-
60
+
61
+ Restart:
58
62
put property `blocks` of Presentation into Blocks
59
63
put the json keys of Blocks into BlockNames
60
- create Table in Panel
61
- set the style of Table to `width:100%;border:1px solid black`
62
- put the json count of BlockNames into N
64
+
65
+ clear Panel
66
+ create Row in Panel
67
+ set the style of Row to `display:flex;margin-top:0.5em`
68
+ create Title in Row
69
+ set the style of Title to
70
+ `flex:1;font-size:110%;font-weight:bold;background:lightgray;text-align:center`
71
+ set the content of Title to `Blocks`
72
+ create Cell in Row
73
+ set the style of Cell to `width:1.4em;text-align:center`
74
+ create Link in Cell
75
+ create AddBlock in Link
76
+ set the style of AddBlock to `width:1em;margin-top:0.1em`
77
+ set attribute `src` of AddBlock to `resources/icon/plus.png`
78
+ on click AddBlock
79
+ begin
80
+ put prompt `Name of new block:` with `new block` into BlockName
81
+ set Block to object
82
+ set property BlockName of Blocks to Block
83
+ set property `blocks` of Presentation to Blocks
84
+ go to Restart
85
+ end
86
+
87
+ put the json count of BlockNames into N
63
88
set the elements of EditButton to N
64
89
set the elements of Editor to N
65
90
set the elements of Add to N
91
+ create Table in Panel
92
+ if N is greater than 0 set the style of Table to `width:100%;border:1px solid black`
66
93
put 0 into B
67
94
while B is less than the elements of EditButton
68
95
begin
@@ -93,7 +120,7 @@ Start:
93
120
end
94
121
on click EditButton
95
122
begin
96
- put the index of EditButton into B
123
+ put the index of EditButton into SelectedBlock
97
124
put the text of EditButton into Action
98
125
put 0 into N
99
126
while N is less than the json count of BlockNames
@@ -107,9 +134,10 @@ Start:
107
134
set style `display` of Editor to `none`
108
135
add 1 to N
109
136
end
110
- index EditButton to B
137
+ index EditButton to SelectedBlock
111
138
if Action is `Edit`
112
139
begin
140
+ RestartEditor:
113
141
set style `background` of EditButton to `lightgray`
114
142
set the text of EditButton to `Close`
115
143
index Add to B
@@ -157,6 +185,11 @@ Start:
157
185
end
158
186
on click Add
159
187
begin
160
- alert `Add ` cat the index of Add
188
+ index BlockNames to SelectedBlock
189
+ put property BlockNames of Blocks into Block
190
+ set property ` ` of Block to ` `
191
+ set property BlockNames of Blocks to Block
192
+ set property `blocks` of Presentation to Blocks
193
+ go to RestartEditor
161
194
end
162
- stop
195
+ stop
0 commit comments