File tree Expand file tree Collapse file tree 3 files changed +5
-21
lines changed Expand file tree Collapse file tree 3 files changed +5
-21
lines changed Original file line number Diff line number Diff line change @@ -49,21 +49,6 @@ addEventListener("load", () => {
49
49
return chapterData [ i ]
50
50
}
51
51
52
- function getURL ( url , callback ) {
53
- let req = new XMLHttpRequest ( )
54
- req . open ( "GET" , url , true )
55
- req . addEventListener ( "load" , ( ) => {
56
- if ( req . status < 400 )
57
- callback ( null , req . responseText )
58
- else
59
- callback ( new Error ( "Request failed: " + req . statusText ) )
60
- } )
61
- req . addEventListener ( "error" , ( ) => {
62
- callback ( new Error ( "Network error" ) )
63
- } )
64
- req . send ( null )
65
- }
66
-
67
52
let per = document . querySelector ( "#per_chapter" )
68
53
per . addEventListener ( "change" , ( ) => {
69
54
selectContext ( per . value )
Original file line number Diff line number Diff line change @@ -148,7 +148,6 @@ window.addEventListener("load", () => {
148
148
function runCode ( data ) {
149
149
data . output . clear ( )
150
150
let val = data . editor . getValue ( )
151
- let sb = data . sandbox
152
151
getSandbox ( data . sandbox , data . isHTML , box => {
153
152
if ( data . isHTML )
154
153
box . setHTML ( val , data . output , ( ) => {
@@ -208,9 +207,9 @@ window.addEventListener("load", () => {
208
207
}
209
208
210
209
function placeFrame ( frame , snippet ) {
211
- let wrap = snippet . previousSibling
210
+ let wrap = snippet . previousSibling , bot
212
211
if ( ! wrap || wrap . className != "editor-wrap" ) {
213
- let bot = snippet . getBoundingClientRect ( ) . bottom
212
+ bot = snippet . getBoundingClientRect ( ) . bottom
214
213
activateCode ( snippet , null , "text/html" )
215
214
wrap = snippet . previousSibling
216
215
} else {
Original file line number Diff line number Diff line change 31
31
32
32
function loaded ( ) {
33
33
frame . removeEventListener ( "load" , loaded )
34
- let box = new SandBox ( options , frame )
34
+ let box = new SandBox ( frame )
35
35
36
36
promiseChain ( ( options . loadFiles || [ ] ) . map ( file => ( ) => {
37
37
let script = box . win . document . createElement ( "script" )
43
43
} )
44
44
}
45
45
46
- constructor ( options , frame ) {
46
+ constructor ( frame ) {
47
47
this . startedAt = null
48
48
this . extraSecs = 2
49
49
this . output = null
387
387
return known || resp . text ( ) . then ( code => resolved . store ( found , { name : found , code} ) )
388
388
} ) )
389
389
390
- let Output = SandBox . Output = class {
390
+ SandBox . Output = class {
391
391
constructor ( div ) { this . div = div }
392
392
393
393
clear ( ) {
You can’t perform that action at this time.
0 commit comments