File tree Expand file tree Collapse file tree 3 files changed +38
-33
lines changed Expand file tree Collapse file tree 3 files changed +38
-33
lines changed Original file line number Diff line number Diff line change @@ -64,16 +64,16 @@ const EasyCoder_IWSY = {
64
64
return true ;
65
65
}
66
66
return false ;
67
- // case `path`:
68
- // const path = compiler.getNextValue();
69
- // compiler.addCommand({
70
- // domain: `iwsy`,
71
- // keyword: `iwsy`,
72
- // lino,
73
- // action,
74
- // path
75
- // });
76
- // return true;
67
+ case `path` :
68
+ const path = compiler . getNextValue ( ) ;
69
+ compiler . addCommand ( {
70
+ domain : `iwsy` ,
71
+ keyword : `iwsy` ,
72
+ lino,
73
+ action,
74
+ path
75
+ } ) ;
76
+ return true ;
77
77
case `script` :
78
78
const script = compiler . getNextValue ( ) ;
79
79
compiler . addCommand ( {
@@ -197,11 +197,11 @@ const EasyCoder_IWSY = {
197
197
}
198
198
program . iwsyFunctions = IWSY ( player , script ) ;
199
199
break ;
200
- // case `path`:
201
- // if (program.iwsyFunctions) {
202
- // program.iwsyFunctions.setPath(program.getValue(command.path));
203
- // }
204
- // break;
200
+ case `path` :
201
+ if ( program . iwsyFunctions ) {
202
+ program . iwsyFunctions . setPath ( program . getValue ( command . path ) ) ;
203
+ }
204
+ break ;
205
205
case `script` :
206
206
script = program . getValue ( command . script ) ;
207
207
try {
@@ -234,7 +234,6 @@ const EasyCoder_IWSY = {
234
234
case `stop` :
235
235
if ( program . iwsyFunctions ) {
236
236
program . iwsyFunctions . stop ( ) ;
237
- // delete program.iwsyFunctions;
238
237
}
239
238
break ;
240
239
case `removeStyles` :
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const IWSY = (playerElement, scriptObject) => {
4
4
let player = playerElement ;
5
5
let script = scriptObject ;
6
6
let homeScript = script ;
7
+ let thePath = `` ;
7
8
let afterRun ;
8
9
let plugins ;
9
10
let timeouts = [ ] ;
@@ -991,7 +992,7 @@ const IWSY = (playerElement, scriptObject) => {
991
992
script . runMode = runMode ;
992
993
doStep ( script . steps [ 1 ] ) ;
993
994
} else {
994
- fetch ( `${ step . path } ${ step . script } ?v=${ Date . now ( ) } ` )
995
+ fetch ( `${ thePath } / ${ step . script } ?v=${ Date . now ( ) } ` )
995
996
. then ( response => {
996
997
if ( response . status >= 400 ) {
997
998
throw Error ( `Unable to load ${ step . script } : ${ response . status } ` ) ;
@@ -1063,6 +1064,11 @@ const IWSY = (playerElement, scriptObject) => {
1063
1064
initScript ( ) ;
1064
1065
} ;
1065
1066
1067
+ // Set the path (for 'embed')
1068
+ const setPath = path => {
1069
+ thePath = path ;
1070
+ } ;
1071
+
1066
1072
// Go to a specified step number
1067
1073
const gotoStep = target => {
1068
1074
script . scanTarget = target ;
@@ -1270,6 +1276,7 @@ const IWSY = (playerElement, scriptObject) => {
1270
1276
return {
1271
1277
getScript,
1272
1278
setScript,
1279
+ setPath,
1273
1280
gotoStep,
1274
1281
block,
1275
1282
run,
Original file line number Diff line number Diff line change @@ -64,16 +64,16 @@ const EasyCoder_IWSY = {
64
64
return true ;
65
65
}
66
66
return false ;
67
- // case `path`:
68
- // const path = compiler.getNextValue();
69
- // compiler.addCommand({
70
- // domain: `iwsy`,
71
- // keyword: `iwsy`,
72
- // lino,
73
- // action,
74
- // path
75
- // });
76
- // return true;
67
+ case `path` :
68
+ const path = compiler . getNextValue ( ) ;
69
+ compiler . addCommand ( {
70
+ domain : `iwsy` ,
71
+ keyword : `iwsy` ,
72
+ lino,
73
+ action,
74
+ path
75
+ } ) ;
76
+ return true ;
77
77
case `script` :
78
78
const script = compiler . getNextValue ( ) ;
79
79
compiler . addCommand ( {
@@ -197,11 +197,11 @@ const EasyCoder_IWSY = {
197
197
}
198
198
program . iwsyFunctions = IWSY ( player , script ) ;
199
199
break ;
200
- // case `path`:
201
- // if (program.iwsyFunctions) {
202
- // program.iwsyFunctions.setPath(program.getValue(command.path));
203
- // }
204
- // break;
200
+ case `path` :
201
+ if ( program . iwsyFunctions ) {
202
+ program . iwsyFunctions . setPath ( program . getValue ( command . path ) ) ;
203
+ }
204
+ break ;
205
205
case `script` :
206
206
script = program . getValue ( command . script ) ;
207
207
try {
@@ -234,7 +234,6 @@ const EasyCoder_IWSY = {
234
234
case `stop` :
235
235
if ( program . iwsyFunctions ) {
236
236
program . iwsyFunctions . stop ( ) ;
237
- // delete program.iwsyFunctions;
238
237
}
239
238
break ;
240
239
case `removeStyles` :
You can’t perform that action at this time.
0 commit comments