|
227 | 227 | script.src = 'https://unpkg.com/babili-standalone@0/babili.min.js'; |
228 | 228 | script.onload = function() { |
229 | 229 | enableCommonJSError = true; |
230 | | - onSourceChange(); |
| 230 | + //onSourceChange(); |
231 | 231 | }; |
232 | 232 | document.head.appendChild(script); |
233 | 233 | isBabiliLoading = true; |
|
253 | 253 | // Merge in defaults |
254 | 254 | var defaults = { |
255 | 255 | babili: false, |
256 | | - evaluate: true, |
| 256 | + evaluate: false, |
257 | 257 | lineWrap: false, |
258 | 258 | presets: 'es2015,stage-2,react' |
259 | 259 | }; |
|
351 | 351 | }; |
352 | 352 | transformed = babel.transformFromAst(ast, null, options); |
353 | 353 | } catch (err) { |
354 | | - this.printError(err.message); |
| 354 | + //this.printError(err.message); |
| 355 | + this.setOutput(err.message); |
355 | 356 | throw err; |
356 | 357 | } |
357 | 358 |
|
|
428 | 429 | var presetList = repl.options.presets.replace(/,/g, ', '); |
429 | 430 | document.getElementById('babel-repl-selected-presets').innerHTML = presetList; |
430 | 431 |
|
431 | | - onSourceChange(); |
| 432 | + //onSourceChange(); |
432 | 433 | } |
433 | 434 |
|
434 | 435 | function onSourceChange () { |
|
446 | 447 | if (error) throw error; |
447 | 448 | } |
448 | 449 |
|
| 450 | + function onOutputClear() { |
| 451 | + repl.setOutput(""); |
| 452 | + } |
| 453 | + |
449 | 454 | //repl.input.on('change', _.debounce(onSourceChange, 500)); |
450 | | - repl.$toolBar.on('change', onSourceChange); |
| 455 | + //repl.$toolBar.on('change', onSourceChange); |
451 | 456 |
|
452 | 457 | /* |
453 | 458 | * Make REPL editors resizable by width |
|
530 | 535 | getFileBlob(fileName, '/out/metadata/' + fileName); |
531 | 536 | }); |
532 | 537 | } |
533 | | - |
| 538 | + |
534 | 539 | loadMetadata(); |
535 | 540 |
|
536 | 541 | $('#fabel-compile').on('click', onSourceChange); |
| 542 | + $('#fabel-clear').on('click', onOutputClear); |
537 | 543 |
|
538 | | - initResizable('.babel-repl-resize'); |
| 544 | + //initResizable('.babel-repl-resize'); |
539 | 545 | //onPresetChange(); |
540 | 546 | }(Babel, $, _, ace, window)); |
0 commit comments