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
ac4f636e
Commit
ac4f636e
authored
May 20, 2018
by
serapath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CompileTab: rename compileIcon, compileButton, warnCompilationSlow
parent
9054c7b9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
27 deletions
+29
-27
compile-tab.js
src/app/tabs/compile-tab.js
+29
-27
No files found.
src/app/tabs/compile-tab.js
View file @
ac4f636e
...
@@ -20,7 +20,9 @@ module.exports = class CompileTab {
...
@@ -20,7 +20,9 @@ module.exports = class CompileTab {
self
.
_view
=
{
self
.
_view
=
{
el
:
null
,
el
:
null
,
autoCompile
:
null
,
autoCompile
:
null
,
compileButton
:
null
compileButton
:
null
,
warnCompilationSlow
:
null
,
compileIcon
:
null
}
}
self
.
data
=
{
self
.
data
=
{
autoCompile
:
self
.
_opts
.
config
.
get
(
'autoCompile'
),
autoCompile
:
self
.
_opts
.
config
.
get
(
'autoCompile'
),
...
@@ -38,47 +40,47 @@ module.exports = class CompileTab {
...
@@ -38,47 +40,47 @@ module.exports = class CompileTab {
self
.
data
.
compileTimeout
=
window
.
setTimeout
(()
=>
self
.
_api
.
runCompiler
(),
self
.
data
.
timeout
)
self
.
data
.
compileTimeout
=
window
.
setTimeout
(()
=>
self
.
_api
.
runCompiler
(),
self
.
data
.
timeout
)
}
}
self
.
_events
.
compiler
.
register
(
'compilationDuration'
,
function
tabHighlighting
(
speed
)
{
self
.
_events
.
compiler
.
register
(
'compilationDuration'
,
function
tabHighlighting
(
speed
)
{
if
(
!
warnCompilationSlow
)
return
if
(
!
self
.
_view
.
warnCompilationSlow
)
return
if
(
speed
>
self
.
data
.
maxTime
)
{
if
(
speed
>
self
.
data
.
maxTime
)
{
var
msg
=
`Last compilation took
${
speed
}
ms. We suggest to turn off autocompilation.`
var
msg
=
`Last compilation took
${
speed
}
ms. We suggest to turn off autocompilation.`
warnCompilationSlow
.
setAttribute
(
'title'
,
msg
)
self
.
_view
.
warnCompilationSlow
.
setAttribute
(
'title'
,
msg
)
warnCompilationSlow
.
style
.
display
=
'inline-block'
self
.
_view
.
warnCompilationSlow
.
style
.
display
=
'inline-block'
}
else
{
}
else
{
warnCompilationSlow
.
style
.
display
=
'none'
self
.
_view
.
warnCompilationSlow
.
style
.
display
=
'none'
}
}
})
})
self
.
_events
.
editor
.
register
(
'contentChanged'
,
function
changedFile
()
{
self
.
_events
.
editor
.
register
(
'contentChanged'
,
function
changedFile
()
{
if
(
!
compileIcon
)
return
if
(
!
self
.
_view
.
compileIcon
)
return
var
compileTab
=
document
.
querySelector
(
'.compileView'
)
// @TODO: compileView tab
var
compileTab
=
document
.
querySelector
(
'.compileView'
)
// @TODO: compileView tab
compileTab
.
style
.
color
=
styles
.
colors
.
red
// @TODO: compileView tab
compileTab
.
style
.
color
=
styles
.
colors
.
red
// @TODO: compileView tab
compileIcon
.
classList
.
add
(
`
${
css
.
bouncingIcon
}
`
)
// @TODO: compileView tab
self
.
_view
.
compileIcon
.
classList
.
add
(
`
${
css
.
bouncingIcon
}
`
)
// @TODO: compileView tab
})
})
self
.
_events
.
compiler
.
register
(
'loadingCompiler'
,
function
start
()
{
self
.
_events
.
compiler
.
register
(
'loadingCompiler'
,
function
start
()
{
if
(
!
compileIcon
)
return
if
(
!
self
.
_view
.
compileIcon
)
return
compileIcon
.
classList
.
add
(
`
${
css
.
spinningIcon
}
`
)
self
.
_view
.
compileIcon
.
classList
.
add
(
`
${
css
.
spinningIcon
}
`
)
warnCompilationSlow
.
style
.
display
=
'none'
self
.
_view
.
warnCompilationSlow
.
style
.
display
=
'none'
compileIcon
.
setAttribute
(
'title'
,
'compiler is loading, please wait a few moments.'
)
self
.
_view
.
compileIcon
.
setAttribute
(
'title'
,
'compiler is loading, please wait a few moments.'
)
})
})
self
.
_events
.
compiler
.
register
(
'compilationStarted'
,
function
start
()
{
self
.
_events
.
compiler
.
register
(
'compilationStarted'
,
function
start
()
{
if
(
!
compileIcon
)
return
if
(
!
self
.
_view
.
compileIcon
)
return
errorContainer
.
innerHTML
=
''
errorContainer
.
innerHTML
=
''
compileIcon
.
classList
.
remove
(
`
${
css
.
bouncingIcon
}
`
)
self
.
_view
.
compileIcon
.
classList
.
remove
(
`
${
css
.
bouncingIcon
}
`
)
compileIcon
.
classList
.
add
(
`
${
css
.
spinningIcon
}
`
)
self
.
_view
.
compileIcon
.
classList
.
add
(
`
${
css
.
spinningIcon
}
`
)
compileIcon
.
setAttribute
(
'title'
,
'compiling...'
)
self
.
_view
.
compileIcon
.
setAttribute
(
'title'
,
'compiling...'
)
})
})
self
.
_events
.
compiler
.
register
(
'compilerLoaded'
,
function
loaded
()
{
self
.
_events
.
compiler
.
register
(
'compilerLoaded'
,
function
loaded
()
{
if
(
!
compileIcon
)
return
if
(
!
self
.
_view
.
compileIcon
)
return
compileIcon
.
classList
.
remove
(
`
${
css
.
spinningIcon
}
`
)
self
.
_view
.
compileIcon
.
classList
.
remove
(
`
${
css
.
spinningIcon
}
`
)
compileIcon
.
setAttribute
(
'title'
,
''
)
self
.
_view
.
compileIcon
.
setAttribute
(
'title'
,
''
)
})
})
self
.
_events
.
compiler
.
register
(
'compilationFinished'
,
function
finish
(
success
,
data
,
source
)
{
self
.
_events
.
compiler
.
register
(
'compilationFinished'
,
function
finish
(
success
,
data
,
source
)
{
if
(
compileIcon
)
{
if
(
self
.
_view
.
compileIcon
)
{
var
compileTab
=
document
.
querySelector
(
'.compileView'
)
var
compileTab
=
document
.
querySelector
(
'.compileView'
)
compileTab
.
style
.
color
=
styles
.
colors
.
black
compileTab
.
style
.
color
=
styles
.
colors
.
black
compileIcon
.
style
.
color
=
styles
.
colors
.
black
self
.
_view
.
compileIcon
.
style
.
color
=
styles
.
colors
.
black
compileIcon
.
classList
.
remove
(
`
${
css
.
spinningIcon
}
`
)
self
.
_view
.
compileIcon
.
classList
.
remove
(
`
${
css
.
spinningIcon
}
`
)
compileIcon
.
classList
.
remove
(
`
${
css
.
bouncingIcon
}
`
)
self
.
_view
.
compileIcon
.
classList
.
remove
(
`
${
css
.
bouncingIcon
}
`
)
compileIcon
.
setAttribute
(
'title'
,
'idle'
)
self
.
_view
.
compileIcon
.
setAttribute
(
'title'
,
'idle'
)
}
}
// reset the contractMetadata list (used by the publish action)
// reset the contractMetadata list (used by the publish action)
self
.
data
.
contractsDetails
=
{}
self
.
data
.
contractsDetails
=
{}
...
@@ -120,9 +122,9 @@ module.exports = class CompileTab {
...
@@ -120,9 +122,9 @@ module.exports = class CompileTab {
})
})
// Containers
// Containers
var
warnCompilationSlow
=
yo
`<i title="Copy Address" style="display:none" class="
${
css
.
warnCompilationSlow
}
fa fa-exclamation-triangle" aria-hidden="true"></i>`
self
.
_view
.
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
.
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
.
compileButton
=
yo
`<div class="
${
css
.
compileButton
}
onclick=
${
compile
}
"id="compile" title="Compile source code">
${
self
.
_view
.
compileIcon
}
Start to compile</div>`
self
.
_view
.
autoCompile
=
yo
`<input class="
${
css
.
autocompile
}
" onchange=
${
updateAutoCompile
}
id="autoCompile" type="checkbox" title="Auto compile">`
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'
,
''
)
if
(
self
.
data
.
autoCompile
)
self
.
_view
.
autoCompile
.
setAttribute
(
'checked'
,
''
)
var
compileContainer
=
yo
`
var
compileContainer
=
yo
`
...
@@ -133,7 +135,7 @@ module.exports = class CompileTab {
...
@@ -133,7 +135,7 @@ module.exports = class CompileTab {
${
self
.
_view
.
autoCompile
}
${
self
.
_view
.
autoCompile
}
<span class="
${
css
.
autocompileText
}
">Auto compile</span>
<span class="
${
css
.
autocompileText
}
">Auto compile</span>
</div>
</div>
${
warnCompilationSlow
}
${
self
.
_view
.
warnCompilationSlow
}
</div>
</div>
</div>`
</div>`
var
errorContainer
=
yo
`<div class='error'></div>`
var
errorContainer
=
yo
`<div class='error'></div>`
...
...
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