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
bde41fa8
Commit
bde41fa8
authored
Mar 14, 2020
by
LianaHus
Committed by
Liana Husikyan
Mar 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not compile not sol/yul files
parent
3cecdb02
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
compilerContainer.js
src/app/tabs/compileTab/compilerContainer.js
+15
-7
No files found.
src/app/tabs/compileTab/compilerContainer.js
View file @
bde41fa8
...
...
@@ -38,10 +38,17 @@ class CompilerContainer {
}
if
(
!
this
.
_view
.
compilationButton
)
return
const
button
=
this
.
compilationButton
(
name
.
split
(
'/'
).
pop
())
this
.
_disableCompileBtn
(
!
name
)
this
.
_disableCompileBtn
(
!
name
||
(
name
&&
!
this
.
isSolFileSelected
(
name
))
)
yo
.
update
(
this
.
_view
.
compilationButton
,
button
)
}
isSolFileSelected
(
currentFile
=
''
)
{
if
(
!
currentFile
)
currentFile
=
this
.
config
.
get
(
'currentFile'
)
if
(
!
currentFile
)
return
false
return
currentFile
.
substr
(
currentFile
.
length
-
3
,
currentFile
.
length
)
===
'sol'
||
currentFile
.
substr
(
currentFile
.
length
-
3
,
currentFile
.
length
)
===
'yul'
}
deactivate
()
{
// deactivate editor listeners
this
.
editor
.
event
.
unregister
(
'contentChanged'
)
...
...
@@ -113,7 +120,7 @@ class CompilerContainer {
*/
compilationButton
(
name
=
''
)
{
const
displayed
=
name
||
'<no file selected>'
const
disabled
=
name
?
''
:
'disabled'
const
disabled
=
name
&&
this
.
isSolFileSelected
()
?
''
:
'disabled'
const
compileBtn
=
yo
`
<button id="compileBtn" data-id="compilerContainerCompileBtn" class="btn btn-primary btn-block
${
disabled
}
" title="Compile" onclick="
${
this
.
compile
.
bind
(
this
)}
">
<span>
${
this
.
_view
.
compileIcon
}
Compile
${
displayed
}
</span>
...
...
@@ -131,7 +138,7 @@ class CompilerContainer {
if
(
!
btn
)
return
if
(
shouldDisable
)
{
btn
.
classList
.
add
(
'disabled'
)
}
else
if
(
this
.
config
.
get
(
'currentFile'
))
{
}
else
if
(
this
.
isSolFileSelected
(
))
{
btn
.
classList
.
remove
(
'disabled'
)
}
}
...
...
@@ -316,10 +323,11 @@ class CompilerContainer {
}
compile
(
event
)
{
if
(
this
.
config
.
get
(
'currentFile'
))
{
this
.
_setCompilerVersionFromPragma
(
this
.
config
.
get
(
'currentFile'
))
this
.
compileTabLogic
.
runCompiler
()
}
const
currentFile
=
this
.
config
.
get
(
'currentFile'
)
if
(
!
this
.
isSolFileSelected
())
return
this
.
_setCompilerVersionFromPragma
(
currentFile
)
this
.
compileTabLogic
.
runCompiler
()
}
compileIfAutoCompileOn
()
{
...
...
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