File tree Expand file tree Collapse file tree 3 files changed +7
-27
lines changed Expand file tree Collapse file tree 3 files changed +7
-27
lines changed Original file line number Diff line number Diff line change @@ -12,5 +12,6 @@ module.exports = {
12
12
rules : { } ,
13
13
globals : {
14
14
eBookConfig : "readonly" ,
15
+ require : "readonly" ,
15
16
} ,
16
17
} ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export default class HTMLActiveCode extends ActiveCode {
12
12
async runProg ( ) {
13
13
var prog = await this . buildProg ( true ) ;
14
14
let saveCode = "True" ;
15
- saveCode = await this . manage_scrubber ( saveCode ) ;
15
+ this . saveCode = await this . manage_scrubber ( saveCode ) ;
16
16
$ ( this . output ) . text ( "" ) ;
17
17
if ( ! this . alignVertical ) {
18
18
$ ( this . codeDiv ) . switchClass ( "col-md-12" , "col-md-6" , {
@@ -25,17 +25,8 @@ export default class HTMLActiveCode extends ActiveCode {
25
25
"<script type=text/javascript>window.onerror = function(msg,url,line) {alert(msg+' on line: '+line);};</script>" +
26
26
prog ;
27
27
this . output . srcdoc = prog ;
28
- this . logRunEvent ( {
29
- div_id : this . divid ,
30
- code : this . editor . getValue ( ) ,
31
- errinfo : "success" ,
32
- to_save : saveCode ,
33
- prefix : this . pretext ,
34
- suffix : this . suffix ,
35
- lang : this . language ,
36
- partner : this . partner ,
37
- } ) ; // Log the run event
38
28
}
29
+
39
30
createOutput ( ) {
40
31
this . alignVertical = true ;
41
32
var outDiv = document . createElement ( "div" ) ;
Original file line number Diff line number Diff line change @@ -31,8 +31,7 @@ export default class JSActiveCode extends ActiveCode {
31
31
}
32
32
async runProg ( ) {
33
33
var _this = this ;
34
- var prog = this . buildProg ( true ) ;
35
- var einfo ;
34
+ var prog = await this . buildProg ( true ) ;
36
35
var saveCode = "True" ;
37
36
var write = function ( str ) {
38
37
_this . output . innerHTML += _this . outputfun ( str ) ;
@@ -41,27 +40,16 @@ export default class JSActiveCode extends ActiveCode {
41
40
if ( ! str ) str = "" ;
42
41
_this . output . innerHTML += _this . outputfun ( str ) + "<br />" ;
43
42
} ;
44
- saveCode = await this . manage_scrubber ( saveCode ) ;
43
+ this . saveCode = await this . manage_scrubber ( saveCode ) ;
45
44
$ ( this . eContainer ) . remove ( ) ;
46
45
$ ( this . output ) . text ( "" ) ;
47
46
$ ( this . outDiv ) . show ( { duration : 700 , queue : false } ) ;
48
47
try {
49
48
eval ( prog ) ;
50
- einfo = "success" ;
49
+ this . errinfo = "success" ;
51
50
} catch ( e ) {
52
51
this . addErrorMessage ( e ) ;
53
- einfo = e ;
52
+ this . errinfo = e ;
54
53
}
55
- // Note that, since this isn't awaited, the request may not be complete when this function returns.
56
- this . logRunEvent ( {
57
- div_id : this . divid ,
58
- code : this . editor . getValue ( ) ,
59
- errinfo : einfo ,
60
- lang : this . language ,
61
- to_save : saveCode ,
62
- prefix : this . pretext ,
63
- suffix : this . suffix ,
64
- partner : this . partner ,
65
- } ) ;
66
54
}
67
55
}
You can’t perform that action at this time.
0 commit comments