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", () => {
4949 return chapterData [ i ]
5050 }
5151
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-
6752 let per = document . querySelector ( "#per_chapter" )
6853 per . addEventListener ( "change" , ( ) => {
6954 selectContext ( per . value )
Original file line number Diff line number Diff line change @@ -148,7 +148,6 @@ window.addEventListener("load", () => {
148148 function runCode ( data ) {
149149 data . output . clear ( )
150150 let val = data . editor . getValue ( )
151- let sb = data . sandbox
152151 getSandbox ( data . sandbox , data . isHTML , box => {
153152 if ( data . isHTML )
154153 box . setHTML ( val , data . output , ( ) => {
@@ -208,9 +207,9 @@ window.addEventListener("load", () => {
208207 }
209208
210209 function placeFrame ( frame , snippet ) {
211- let wrap = snippet . previousSibling
210+ let wrap = snippet . previousSibling , bot
212211 if ( ! wrap || wrap . className != "editor-wrap" ) {
213- let bot = snippet . getBoundingClientRect ( ) . bottom
212+ bot = snippet . getBoundingClientRect ( ) . bottom
214213 activateCode ( snippet , null , "text/html" )
215214 wrap = snippet . previousSibling
216215 } else {
Original file line number Diff line number Diff line change 3131
3232 function loaded ( ) {
3333 frame . removeEventListener ( "load" , loaded )
34- let box = new SandBox ( options , frame )
34+ let box = new SandBox ( frame )
3535
3636 promiseChain ( ( options . loadFiles || [ ] ) . map ( file => ( ) => {
3737 let script = box . win . document . createElement ( "script" )
4343 } )
4444 }
4545
46- constructor ( options , frame ) {
46+ constructor ( frame ) {
4747 this . startedAt = null
4848 this . extraSecs = 2
4949 this . output = null
387387 return known || resp . text ( ) . then ( code => resolved . store ( found , { name : found , code} ) )
388388 } ) )
389389
390- let Output = SandBox . Output = class {
390+ SandBox . Output = class {
391391 constructor ( div ) { this . div = div }
392392
393393 clear ( ) {
You can’t perform that action at this time.
0 commit comments