|
|
|
@ -286,13 +286,17 @@ THE SOFTWARE. |
|
|
|
|
var previousInput = ''; |
|
|
|
|
var sourceAnnotations = []; |
|
|
|
|
var compile = function() { |
|
|
|
|
|
|
|
|
|
editor.getSession().clearAnnotations(); |
|
|
|
|
sourceAnnotations = []; |
|
|
|
|
editor.getSession().removeMarker(errMarkerId); |
|
|
|
|
$('#output').empty(); |
|
|
|
|
var input = editor.getValue(); |
|
|
|
|
window.localStorage.setItem( SOL_CACHE_FILE, input ); |
|
|
|
|
|
|
|
|
|
var inputIncludingImports = includeLocalImports( input ); |
|
|
|
|
var optimize = document.querySelector('#optimize').checked; |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
var data = $.parseJSON(compileJSON(inputIncludingImports, optimize ? 1 : 0)); |
|
|
|
|
} catch (exception) { |
|
|
|
@ -309,6 +313,7 @@ THE SOFTWARE. |
|
|
|
|
renderContracts(data, input); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var compileTimeout = null; |
|
|
|
|
var onChange = function() { |
|
|
|
|
var input = editor.getValue(); |
|
|
|
@ -411,8 +416,6 @@ THE SOFTWARE. |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
var renderContracts = function(data, source) { |
|
|
|
|
window.localStorage.setItem( SOL_CACHE_FILE, source ); |
|
|
|
|
|
|
|
|
|
$('#output').empty(); |
|
|
|
|
for (var contractName in data.contracts) { |
|
|
|
|
var contract = data.contracts[contractName]; |
|
|
|
|