Merge pull request #743 from ethereum/modal

shortened strings and some text fixes for title of each key in details
pull/1/head
yann300 8 years ago committed by GitHub
commit dd6a7a8565
  1. 28
      src/app/tabs/compile-tab.js

@ -358,9 +358,9 @@ function compileTab (container, appAPI, appEvents, opts) {
function insertValue (details, x) { function insertValue (details, x) {
var value = yo`<pre class="${css.value}"></pre>` var value = yo`<pre class="${css.value}"></pre>`
var node var node
if (x === 'bytecode' || x === 'metadataHash' || x === 'swarmLocation' || x === 'Runtime Bytecode' || x === 'Opcodes' || x === 'name') { if (x === 'bytecode' || x === 'metadataHash' || x === 'swarmLocation' || x === 'Runtime Bytecode' || x === 'Opcodes') {
node = yo`<div>${details[x]}</div>` node = yo`<div>${details[x].slice(0, 60) + '...'}</div>`
} else if (x === 'web3Deploy') { } else if (x === 'web3Deploy' || x === 'name') {
node = yo`<pre>${details[x]}</pre>` node = yo`<pre>${details[x]}</pre>`
} else if (x === 'interface' || x === 'metadata') { } else if (x === 'interface' || x === 'metadata') {
var treeView = new TreeView({ var treeView = new TreeView({
@ -383,11 +383,19 @@ function compileTab (container, appAPI, appEvents, opts) {
return ret return ret
} }
}) })
node = yo`<div>${treeView.render(JSON.parse(details[x]))}</div>` if (details[x] !== '') {
try {
node = yo`<div>${treeView.render(JSON.parse(details[x]))}</div>` // catch in case the parsing fails.
} catch (e) {
node = yo`<div>Unable to display "${x}": ${e.message}</div>`
}
} else {
node = yo`<div> - </div>`
}
} else { } else {
node = yo`<div>${JSON.stringify(details[x], null, 4)}</div>` node = yo`<div>${JSON.stringify(details[x], null, 4)}</div>`
} }
value.appendChild(node) if (node) value.appendChild(node)
return value return value
} }
@ -412,13 +420,13 @@ function detailsHelpSection () {
return { return {
'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',
'Runtime Bytecode': 'Bytecode actually store in the state and executed during normal contract call', 'Runtime Bytecode': 'Bytecode storing the state and being executed during normal contract call',
'bytecode': 'Bytecode executed during contract creation', 'bytecode': 'Bytecode being executed during contract creation',
'functionHashes': 'List of declared function and their corresonding hash', 'functionHashes': 'List of declared function and their corresponding hash',
'gasEstimates': 'Gas estimation for each function call', 'gasEstimates': 'Gas estimation for each function call',
'metadata': 'Contain all informations related to the compilation', 'metadata': 'Contains all informations related to the compilation',
'metadataHash': 'Hash representing all metadata information', 'metadataHash': 'Hash representing all metadata information',
'interface': 'ABI: Describe all the functions (input/output params, scope, ...)', 'interface': 'ABI: describing all the functions (input/output params, scope, ...)',
'name': 'Name of the compiled contract', 'name': 'Name of the compiled contract',
'swarmLocation': 'Swarm url where all metadata information can be found (contract needs to be published first)', 'swarmLocation': 'Swarm url where all metadata information can be found (contract needs to be published first)',
'web3Deploy': 'Copy/paste this code to any JavaScript/Web3 console to deploy this contract' 'web3Deploy': 'Copy/paste this code to any JavaScript/Web3 console to deploy this contract'

Loading…
Cancel
Save