Commit 03480700 authored by Grandschtroumpf's avatar Grandschtroumpf Committed by yann300

standard

parent da888d4b
...@@ -153,7 +153,7 @@ class CompileTab { ...@@ -153,7 +153,7 @@ class CompileTab {
* Section to select the compiled contract * Section to select the compiled contract
* @param {string[]} contractList Names of the compiled contracts * @param {string[]} contractList Names of the compiled contracts
*/ */
contractSelection(contractList = []) { contractSelection (contractList = []) {
return contractList.length !== 0 return contractList.length !== 0
? yo`<section class="${css.container}"> ? yo`<section class="${css.container}">
<!-- Select Compiler Version --> <!-- Select Compiler Version -->
...@@ -161,7 +161,7 @@ class CompileTab { ...@@ -161,7 +161,7 @@ class CompileTab {
<div class="input-group-prepend"> <div class="input-group-prepend">
<label class="input-group-text" for="compiledContracts">Contract</label> <label class="input-group-text" for="compiledContracts">Contract</label>
</div> </div>
<select onchange="${e => this.selectedContract = e.value}" id="compiledContracts" class="custom-select"> <select onchange="${e => this.selectContract(e.value)}" id="compiledContracts" class="custom-select">
${contractList.map((name) => yo`<option value="${name}">${name}</option>`)} ${contractList.map((name) => yo`<option value="${name}">${name}</option>`)}
</select> </select>
</header> </header>
...@@ -195,11 +195,11 @@ class CompileTab { ...@@ -195,11 +195,11 @@ class CompileTab {
} }
// TODO : Add success alert when compilation succeed // TODO : Add success alert when compilation succeed
contractCompiledSuccess() { contractCompiledSuccess () {
return yo`` return yo``
} }
// TODO : Add error alert when compilation failed // TODO : Add error alert when compilation failed
contractCompiledError() { contractCompiledError () {
return yo`` return yo``
} }
...@@ -207,7 +207,11 @@ class CompileTab { ...@@ -207,7 +207,11 @@ class CompileTab {
* METHODS * METHODS
*/ */
publish() { selectContract (contractName) {
this.selectContract = contractName
}
publish () {
const selectContractNames = this._view.contractNames const selectContractNames = this._view.contractNames
if (selectContractNames.children.length > 0 && selectContractNames.selectedIndex >= 0) { if (selectContractNames.children.length > 0 && selectContractNames.selectedIndex >= 0) {
var contract = this.data.contractsDetails[selectContractNames.children[selectContractNames.selectedIndex].innerHTML] var contract = this.data.contractsDetails[selectContractNames.children[selectContractNames.selectedIndex].innerHTML]
...@@ -234,7 +238,7 @@ class CompileTab { ...@@ -234,7 +238,7 @@ class CompileTab {
} }
} }
details() { details () {
const help = { const help = {
'Assembly': 'Assembly opcodes describing the contract including corresponding solidity source code', 'Assembly': 'Assembly opcodes describing the contract including corresponding solidity source code',
'Opcodes': 'Assembly opcodes describing the contract', 'Opcodes': 'Assembly opcodes describing the contract',
...@@ -306,7 +310,7 @@ class CompileTab { ...@@ -306,7 +310,7 @@ class CompileTab {
} }
copyContractProperty (property) { copyContractProperty (property) {
let content = getContractProperty(property) let content = this.getContractProperty(property)
if (!content) { if (!content) {
addTooltip('No content available for ' + property) addTooltip('No content available for ' + property)
return return
...@@ -325,7 +329,7 @@ class CompileTab { ...@@ -325,7 +329,7 @@ class CompileTab {
copyABI () { copyABI () {
this.copyContractProperty('abi') this.copyContractProperty('abi')
} }
copyBytecode () { copyBytecode () {
this.copyContractProperty('bytecode') this.copyContractProperty('bytecode')
} }
......
...@@ -34,7 +34,7 @@ class CompilerContainer { ...@@ -34,7 +34,7 @@ class CompilerContainer {
/** /**
* Update the compilation button with the name of the current file * Update the compilation button with the name of the current file
*/ */
set currentFile(name) { set currentFile (name) {
if (!this._view.compilationButton) return if (!this._view.compilationButton) return
const button = this.compilationButton(name.split('/').pop()) const button = this.compilationButton(name.split('/').pop())
yo.update(this._view.compilationButton, button) yo.update(this._view.compilationButton, button)
...@@ -92,8 +92,7 @@ class CompilerContainer { ...@@ -92,8 +92,7 @@ class CompilerContainer {
/************** /**************
* SUBCOMPONENT * SUBCOMPONENT
*/ */
compilationButton(name) { compilationButton (name) {
console.log({name})
return yo` return yo`
<div class="${css.compilerArticle}"> <div class="${css.compilerArticle}">
<button class="btn btn-primary btn-block" title="Compile" onclick="${this.compile.bind(this)}"> <button class="btn btn-primary btn-block" title="Compile" onclick="${this.compile.bind(this)}">
...@@ -102,7 +101,6 @@ class CompilerContainer { ...@@ -102,7 +101,6 @@ class CompilerContainer {
</div>` </div>`
} }
render () { render () {
this.compileTabLogic.compiler.event.register('compilerLoaded', (version) => this.setVersionText(version)) this.compileTabLogic.compiler.event.register('compilerLoaded', (version) => this.setVersionText(version))
this.fetchAllVersion((allversions, selectedVersion) => { this.fetchAllVersion((allversions, selectedVersion) => {
...@@ -193,7 +191,7 @@ class CompilerContainer { ...@@ -193,7 +191,7 @@ class CompilerContainer {
_updateVersionSelector () { _updateVersionSelector () {
this._view.versionSelector.innerHTML = '' this._view.versionSelector.innerHTML = ''
this.data.allversions.forEach(build => { this.data.allversions.forEach(build => {
const option = build.path === this.data.selectedVersion const option = build.path === this.data.selectedVersion
? yo`<option value="${build.path}" selected>${build.longVersion}</option>` ? yo`<option value="${build.path}" selected>${build.longVersion}</option>`
: yo`<option value="${build.path}">${build.longVersion}</option>` : yo`<option value="${build.path}">${build.longVersion}</option>`
this._view.versionSelector.appendChild(option) this._view.versionSelector.appendChild(option)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment