Skip to content

Commit e81cfbf

Browse files
authored
Merge pull request #88 from easycoder/dev
Small bug fixes
2 parents d59a74a + 958fbcf commit e81cfbf

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

iwsy/iwsy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ const IWSY = (container, text) => {
659659
throw Error(`Unknown action: '${step.action}'`);
660660
}
661661
}
662-
if (script.onStepCB) {
662+
if (script.onStepCB && script.runMode === `auto`) {
663663
script.onStepCB(step.index);
664664
}
665665
handler(step);

iwsy/resources/ecs/iwsy.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,12 @@ L2:
267267
if Name is not CurrentScriptName put empty into LastSavedState
268268
if Presentation is not LastSavedState
269269
begin
270-
if PasswordValid rest post Presentation to `_save/json/` cat Name
270+
if PasswordValid
271+
begin
272+
put Presentation into Content
273+
json format Content
274+
rest post Content to `_save/json/` cat Name
275+
end
271276
else put Presentation into storage as Name
272277
put Presentation into LastSavedState
273278
gosub to SetStatusGreen
@@ -322,7 +327,10 @@ L2:
322327
begin
323328
put the message into Message
324329
put property `action` of Message into Action
325-
if Action is `goto` iwsy goto property `index` of Message
330+
if Action is `goto`
331+
begin
332+
if not Running iwsy goto property `index` of Message
333+
end
326334
else if Action is `refresh`
327335
begin
328336
iwsy script Presentation
@@ -548,6 +556,7 @@ DoRunStop:
548556
else
549557
begin
550558
set Running
559+
gosub to ClearStepsButtons
551560
put property `steps` of Presentation into Item
552561
if the json count of Item is 0 stop
553562
set attribute `src` of RunStop to `resources/icon/runstop.png`
@@ -558,6 +567,9 @@ DoRunStop:
558567
set property `action` of Message to `step`
559568
set property `step` of Message to the step
560569
send Message to StepsModule
570+
set Message to object
571+
set property `action` of Message to `running`
572+
send Message to StepsModule
561573
end
562574

563575
iwsy run then

iwsy/resources/ecs/steps.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
variable TrueFalse
6161
variable Response
6262
variable Message
63+
variable Running
6364
variable N
6465
variable B
6566

@@ -87,6 +88,7 @@ Start:
8788
end
8889
if property `action` of Message is `clear`
8990
begin
91+
clear Running
9092
put 0 into N
9193
while N is less than the elements of StepButton
9294
begin
@@ -96,6 +98,11 @@ Start:
9698
end
9799
stop
98100
end
101+
if property `action` of Message is `running`
102+
begin
103+
set Running
104+
stop
105+
end
99106
if property `action` of Message is `step`
100107
begin
101108
put property `step` of Message into N
@@ -207,6 +214,7 @@ Restart:
207214
end
208215
on click ShowStep
209216
begin
217+
if Running stop
210218
put 0 into N
211219
while N is less than the json count of Steps
212220
begin
@@ -247,6 +255,7 @@ Restart:
247255
json add `false` to ContinueTypes
248256

249257
put property `steps` of Presentation into Steps
258+
clear Running
250259

251260
stop
252261

0 commit comments

Comments
 (0)