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
62b6dde8
Commit
62b6dde8
authored
May 20, 2018
by
serapath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CompileTab: refactor element errorContainer
parent
396be94e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
compile-tab.js
src/app/tabs/compile-tab.js
+9
-8
No files found.
src/app/tabs/compile-tab.js
View file @
62b6dde8
...
@@ -23,7 +23,8 @@ module.exports = class CompileTab {
...
@@ -23,7 +23,8 @@ module.exports = class CompileTab {
compileButton
:
null
,
compileButton
:
null
,
warnCompilationSlow
:
null
,
warnCompilationSlow
:
null
,
compileIcon
:
null
,
compileIcon
:
null
,
compileContainer
:
null
compileContainer
:
null
,
errorContainer
:
null
}
}
self
.
data
=
{
self
.
data
=
{
autoCompile
:
self
.
_opts
.
config
.
get
(
'autoCompile'
),
autoCompile
:
self
.
_opts
.
config
.
get
(
'autoCompile'
),
...
@@ -64,7 +65,7 @@ module.exports = class CompileTab {
...
@@ -64,7 +65,7 @@ module.exports = class CompileTab {
})
})
self
.
_events
.
compiler
.
register
(
'compilationStarted'
,
function
start
()
{
self
.
_events
.
compiler
.
register
(
'compilationStarted'
,
function
start
()
{
if
(
!
self
.
_view
.
compileIcon
)
return
if
(
!
self
.
_view
.
compileIcon
)
return
errorContainer
.
innerHTML
=
''
self
.
_view
.
errorContainer
.
innerHTML
=
''
self
.
_view
.
compileIcon
.
classList
.
remove
(
`
${
css
.
bouncingIcon
}
`
)
self
.
_view
.
compileIcon
.
classList
.
remove
(
`
${
css
.
bouncingIcon
}
`
)
self
.
_view
.
compileIcon
.
classList
.
add
(
`
${
css
.
spinningIcon
}
`
)
self
.
_view
.
compileIcon
.
classList
.
add
(
`
${
css
.
spinningIcon
}
`
)
self
.
_view
.
compileIcon
.
setAttribute
(
'title'
,
'compiling...'
)
self
.
_view
.
compileIcon
.
setAttribute
(
'title'
,
'compiling...'
)
...
@@ -97,25 +98,25 @@ module.exports = class CompileTab {
...
@@ -97,25 +98,25 @@ module.exports = class CompileTab {
var
error
=
false
var
error
=
false
if
(
data
[
'error'
])
{
if
(
data
[
'error'
])
{
error
=
true
error
=
true
self
.
_opts
.
renderer
.
error
(
data
[
'error'
].
formattedMessage
,
errorContainer
,
{
type
:
data
[
'error'
].
severity
})
self
.
_opts
.
renderer
.
error
(
data
[
'error'
].
formattedMessage
,
self
.
_view
.
errorContainer
,
{
type
:
data
[
'error'
].
severity
})
}
}
if
(
data
[
'errors'
])
{
if
(
data
[
'errors'
])
{
if
(
data
[
'errors'
].
length
)
error
=
true
if
(
data
[
'errors'
].
length
)
error
=
true
data
[
'errors'
].
forEach
(
function
(
err
)
{
data
[
'errors'
].
forEach
(
function
(
err
)
{
self
.
_opts
.
renderer
.
error
(
err
.
formattedMessage
,
errorContainer
,
{
type
:
err
.
severity
})
self
.
_opts
.
renderer
.
error
(
err
.
formattedMessage
,
self
.
_view
.
errorContainer
,
{
type
:
err
.
severity
})
})
})
}
}
if
(
!
error
)
{
if
(
!
error
)
{
if
(
data
.
contracts
)
{
if
(
data
.
contracts
)
{
self
.
_opts
.
compiler
.
visitContracts
((
contract
)
=>
{
self
.
_opts
.
compiler
.
visitContracts
((
contract
)
=>
{
self
.
_opts
.
renderer
.
error
(
contract
.
name
,
errorContainer
,
{
type
:
'success'
})
self
.
_opts
.
renderer
.
error
(
contract
.
name
,
self
.
_view
.
errorContainer
,
{
type
:
'success'
})
})
})
}
}
}
}
})
})
self
.
_events
.
staticAnalysis
.
register
(
'staticAnaysisWarning'
,
(
count
)
=>
{
self
.
_events
.
staticAnalysis
.
register
(
'staticAnaysisWarning'
,
(
count
)
=>
{
if
(
count
)
{
if
(
count
)
{
self
.
_opts
.
renderer
.
error
(
`Static Analysis raised
${
count
}
warning(s) that requires your attention.`
,
errorContainer
,
{
self
.
_opts
.
renderer
.
error
(
`Static Analysis raised
${
count
}
warning(s) that requires your attention.`
,
self
.
_view
.
errorContainer
,
{
type
:
'warning'
,
type
:
'warning'
,
click
:
()
=>
self
.
_api
.
switchTab
(
'staticanalysisView'
)
click
:
()
=>
self
.
_api
.
switchTab
(
'staticanalysisView'
)
})
})
...
@@ -139,7 +140,7 @@ module.exports = class CompileTab {
...
@@ -139,7 +140,7 @@ module.exports = class CompileTab {
${
self
.
_view
.
warnCompilationSlow
}
${
self
.
_view
.
warnCompilationSlow
}
</div>
</div>
</div>`
</div>`
var
errorContainer
=
yo
`<div class='error'></div>`
self
.
_view
.
errorContainer
=
yo
`<div class='error'></div>`
var
contractNames
=
yo
`<select class="
${
css
.
contractNames
}
" disabled></select>`
var
contractNames
=
yo
`<select class="
${
css
.
contractNames
}
" disabled></select>`
var
contractEl
=
yo
`
var
contractEl
=
yo
`
<div class="
${
css
.
container
}
">
<div class="
${
css
.
container
}
">
...
@@ -153,7 +154,7 @@ module.exports = class CompileTab {
...
@@ -153,7 +154,7 @@ module.exports = class CompileTab {
<div class="
${
css
.
compileTabView
}
" id="compileTabView">
<div class="
${
css
.
compileTabView
}
" id="compileTabView">
${
self
.
_view
.
compileContainer
}
${
self
.
_view
.
compileContainer
}
${
contractEl
}
${
contractEl
}
${
errorContainer
}
${
self
.
_view
.
errorContainer
}
</div>`
</div>`
function
updateAutoCompile
(
event
)
{
self
.
_opts
.
config
.
set
(
'autoCompile'
,
self
.
_view
.
autoCompile
.
checked
)
}
function
updateAutoCompile
(
event
)
{
self
.
_opts
.
config
.
set
(
'autoCompile'
,
self
.
_view
.
autoCompile
.
checked
)
}
function
compile
(
event
)
{
self
.
_api
.
runCompiler
()
}
function
compile
(
event
)
{
self
.
_api
.
runCompiler
()
}
...
...
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