|
|
@ -128,12 +128,14 @@ var compile = function() { |
|
|
|
outputArea.innerHTML = "Uncaught JavaScript Exception:\n" + exception; |
|
|
|
outputArea.innerHTML = "Uncaught JavaScript Exception:\n" + exception; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var compileTimeout = null; |
|
|
|
var onChange = function() { |
|
|
|
var onChange = function() { |
|
|
|
var input = editor.getValue(); |
|
|
|
var input = editor.getValue(); |
|
|
|
if (input == previousInput) |
|
|
|
if (input == previousInput) |
|
|
|
return; |
|
|
|
return; |
|
|
|
previousInput = input; |
|
|
|
previousInput = input; |
|
|
|
compile(); |
|
|
|
if (compileTimeout) window.clearTimeout(compileTimeout); |
|
|
|
|
|
|
|
compileTimeout = window.setTimeout(compile, 300); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
editor.getSession().on('change', onChange); |
|
|
|
editor.getSession().on('change', onChange); |
|
|
|