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
d5cb4fe7
Commit
d5cb4fe7
authored
May 19, 2018
by
serapath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CompileTab: minor refactorings
parent
05c67024
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
19 deletions
+23
-19
compile-tab.js
src/app/tabs/compile-tab.js
+23
-19
No files found.
src/app/tabs/compile-tab.js
View file @
d5cb4fe7
...
...
@@ -18,10 +18,12 @@ module.exports = class CompileTab {
self
.
_api
=
api
self
.
_events
=
events
self
.
_view
=
{
el
:
null
el
:
null
,
autoCompile
:
null
,
compileButton
:
null
}
self
.
data
=
{
autoCompile
:
self
.
_opts
.
config
.
get
(
'autoCompile'
)
||
false
,
autoCompile
:
self
.
_opts
.
config
.
get
(
'autoCompile'
),
compileTimeout
:
null
,
contractsDetails
:
{},
maxTime
:
1000
,
...
...
@@ -120,32 +122,34 @@ module.exports = class CompileTab {
// Containers
var
warnCompilationSlow
=
yo
`<i title="Copy Address" style="display:none" class="
${
css
.
warnCompilationSlow
}
fa fa-exclamation-triangle" aria-hidden="true"></i>`
var
compileIcon
=
yo
`<i class="fa fa-refresh
${
css
.
icon
}
" aria-hidden="true"></i>`
self
.
_view
.
compileButton
=
yo
`<div class="
${
css
.
compileButton
}
onclick=
${
compile
}
"id="compile" title="Compile source code">
${
compileIcon
}
Start to compile</div>`
self
.
_view
.
autoCompile
=
yo
`<input class="
${
css
.
autocompile
}
" onchange=
${
updateAutoCompile
}
id="autoCompile" type="checkbox" title="Auto compile">`
if
(
self
.
data
.
autoCompile
)
self
.
_view
.
autoCompile
.
setAttribute
(
'checked'
,
''
)
var
compileContainer
=
yo
`
<div class="
${
css
.
compileContainer
}
">
<div class="
${
css
.
compileButtons
}
">
<div class="
${
css
.
compileButton
}
"id="compile" title="Compile source code">
${
compileIcon
}
Start to compile</div>
${
self
.
_view
.
compileButton
}
<div class="
${
css
.
autocompileContainer
}
">
<input class="
${
css
.
autocompile
}
" id="autoCompile" type="checkbox" title="Auto compile">
${
self
.
_view
.
autoCompile
}
<span class="
${
css
.
autocompileText
}
">Auto compile</span>
</div>
${
warnCompilationSlow
}
</div>
</div>`
compileContainer
.
querySelector
(
'#compile'
).
addEventListener
(
'click'
,
()
=>
{
self
.
_api
.
runCompiler
()
})
var
autoCompileInput
=
compileContainer
.
querySelector
(
'#autoCompile'
)
var
autoCompile
=
false
if
(
opts
.
config
.
exists
(
'autoCompile'
))
{
autoCompile
=
opts
.
config
.
get
(
'autoCompile'
)
}
opts
.
config
.
set
(
'autoCompile'
,
autoCompile
)
if
(
autoCompile
)
{
autoCompileInput
.
setAttribute
(
'checked'
,
autoCompile
)
}
autoCompileInput
.
addEventListener
(
'change'
,
function
()
{
opts
.
config
.
set
(
'autoCompile'
,
autoCompileInput
.
checked
)
})
function
updateAutoCompile
(
event
)
{
self
.
_opts
.
config
.
set
(
'autoCompile'
,
self
.
_view
.
autoCompile
.
checked
)
}
function
compile
(
event
)
{
self
.
_api
.
runCompiler
()
}
// compileContainer.querySelector('#compile').addEventListener('click', () => {
// self._api.runCompiler()
// })
// var autoCompileInput = compileContainer.querySelector('#autoCompile')
// var autoCompile = false
// if (opts.config.exists('autoCompile')) {
// autoCompile = opts.config.get('autoCompile')
// }
// opts.config.set('autoCompile', autoCompile)
// self._view.autoCompile.addEventListener('change', function () {
//
// })
var
errorContainer
=
yo
`<div class='error'></div>`
var
contractsDetails
=
{}
var
contractEl
=
yo
`
...
...
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