@ -185,14 +185,28 @@ class CompilerContainer {
this . _view . warnCompilationSlow = yo ` <i title="Compilation Slow" style="visibility:hidden" class=" ${ css . warnCompilationSlow } fas fa-exclamation-triangle" aria-hidden="true"></i> `
this . _view . warnCompilationSlow = yo ` <i title="Compilation Slow" style="visibility:hidden" class=" ${ css . warnCompilationSlow } fas fa-exclamation-triangle" aria-hidden="true"></i> `
this . _view . compileIcon = yo ` <i class="fas fa-sync ${ css . icon } " aria-hidden="true"></i> `
this . _view . compileIcon = yo ` <i class="fas fa-sync ${ css . icon } " aria-hidden="true"></i> `
this . _view . autoCompile = yo ` <input class=" ${ css . autocompile } custom-control-input" onchange= ${ this . updateAutoCompile . bind ( this ) } data-id="compilerContainerAutoCompile" id="autoCompile" type="checkbox" title="Auto compile"> `
this . _view . autoCompile = yo ` <input class=" ${ css . autocompile } custom-control-input" onchange= ${ ( ) => this . updateAutoCompile ( ) } data-id="compilerContainerAutoCompile" id="autoCompile" type="checkbox" title="Auto compile"> `
this . _view . hideWarningsBox = yo ` <input class=" ${ css . autocompile } custom-control-input" onchange= ${ this . hideWarnings . bind ( this ) } id="hideWarningsBox" type="checkbox" title="Hide warnings"> `
this . _view . hideWarningsBox = yo ` <input class=" ${ css . autocompile } custom-control-input" onchange= ${ ( ) => this . hideWarnings ( ) } id="hideWarningsBox" type="checkbox" title="Hide warnings"> `
if ( this . data . autoCompile ) this . _view . autoCompile . setAttribute ( 'checked' , '' )
if ( this . data . autoCompile ) this . _view . autoCompile . setAttribute ( 'checked' , '' )
if ( this . data . hideWarnings ) this . _view . hideWarningsBox . setAttribute ( 'checked' , '' )
if ( this . data . hideWarnings ) this . _view . hideWarningsBox . setAttribute ( 'checked' , '' )
this . _view . optimize = yo ` <input onchange= ${ this . onchangeOptimize . bind ( this ) } class="custom-control-input" id="optimize" type="checkbox"> `
this . _view . optimize = yo ` <input onchange= ${ ( ) => this . onchangeOptimize ( ) } class="custom-control-input" id="optimize" type="checkbox"> `
if ( this . compileTabLogic . optimize ) this . _view . optimize . setAttribute ( 'checked' , '' )
if ( this . compileTabLogic . optimize ) this . _view . optimize . setAttribute ( 'checked' , '' )
this . _view . runs = yo ` <input
onkeypress = "return event.charCode >= 48"
min = "1"
class = "custom-select ml-2 w-50"
id = "runs"
placeholder = "200"
type = "number"
title = "Number of optimisation runs."
> `
if ( this . compileTabLogic . optimize ) this . _view . runs . removeAttribute ( 'disabled' )
else {
this . _view . runs . setAttribute ( 'disabled' , '' )
}
this . _view . versionSelector = yo `
this . _view . versionSelector = yo `
< select onchange = "${this.onchangeLoadVersion.bind(this)}" class = "custom-select" id = "versionSelector" disabled >
< select onchange = "${this.onchangeLoadVersion.bind(this)}" class = "custom-select" id = "versionSelector" disabled >
< option disabled selected > $ { this . data . defaultVersion } < / o p t i o n >
< option disabled selected > $ { this . data . defaultVersion } < / o p t i o n >
@ -267,8 +281,11 @@ class CompilerContainer {
< label class = "form-check-label custom-control-label" for = "autoCompile" > Auto compile < / l a b e l >
< label class = "form-check-label custom-control-label" for = "autoCompile" > Auto compile < / l a b e l >
< / d i v >
< / d i v >
< div class = "mt-2 ${css.compilerConfig} custom-control custom-checkbox" >
< div class = "mt-2 ${css.compilerConfig} custom-control custom-checkbox" >
$ { this . _view . optimize }
< div class = "justify-content-between align-items-center d-flex" >
< label class = "form-check-label custom-control-label" for = "optimize" > Enable optimization < / l a b e l >
$ { this . _view . optimize }
< label class = "form-check-label custom-control-label" for = "optimize" > Enable optimization < / l a b e l >
$ { this . _view . runs }
< / d i v >
< / d i v >
< / d i v >
< div class = "mt-2 ${css.compilerConfig} custom-control custom-checkbox" >
< div class = "mt-2 ${css.compilerConfig} custom-control custom-checkbox" >
$ { this . _view . hideWarningsBox }
$ { this . _view . hideWarningsBox }
@ -327,6 +344,10 @@ class CompilerContainer {
onchangeOptimize ( ) {
onchangeOptimize ( ) {
this . compileTabLogic . setOptimize ( ! ! this . _view . optimize . checked )
this . compileTabLogic . setOptimize ( ! ! this . _view . optimize . checked )
if ( this . compileTabLogic . optimize ) this . _view . runs . removeAttribute ( 'disabled' )
else {
this . _view . runs . setAttribute ( 'disabled' , '' )
}
this . compileIfAutoCompileOn ( )
this . compileIfAutoCompileOn ( )
}
}
@ -360,6 +381,7 @@ class CompilerContainer {
this . setLanguage ( settings . language )
this . setLanguage ( settings . language )
this . setEvmVersion ( settings . evmVersion )
this . setEvmVersion ( settings . evmVersion )
this . setOptimize ( settings . optimize )
this . setOptimize ( settings . optimize )
this . setRuns ( settings . runs )
this . setVersion ( settings . version )
this . setVersion ( settings . version )
}
}
@ -368,6 +390,10 @@ class CompilerContainer {
this . onchangeOptimize ( )
this . onchangeOptimize ( )
}
}
setRuns ( value ) {
this . _view . runs . value = value
}
setLanguage ( lang ) {
setLanguage ( lang ) {
this . _view . languageSelector . value = lang
this . _view . languageSelector . value = lang
this . onchangeLanguage ( )
this . onchangeLanguage ( )