Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
03480700
Commit
03480700
authored
Feb 27, 2019
by
Grandschtroumpf
Committed by
yann300
Mar 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
standard
parent
da888d4b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 deletions
+15
-13
compile-tab.js
src/app/tabs/compile-tab.js
+12
-8
compilerContainer.js
src/app/tabs/compileTab/compilerContainer.js
+3
-5
No files found.
src/app/tabs/compile-tab.js
View file @
03480700
...
@@ -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
.
select
edContract
=
e
.
value
}
" id="compiledContracts" class="custom-select">
<select onchange="
${
e
=>
this
.
select
Contract
(
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'
)
}
}
...
...
src/app/tabs/compileTab/compilerContainer.js
View file @
03480700
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment