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
f84551b9
Unverified
Commit
f84551b9
authored
Apr 26, 2019
by
Liana Husikyan
Committed by
GitHub
Apr 26, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1859 from ethereum/fixSpinningBouncing
Fix spinning bouncing
parents
8fca40fe
ada343c1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
33 deletions
+97
-33
compile-tab.js
src/app/tabs/compile-tab.js
+17
-3
compileTab.js
src/app/tabs/compileTab/compileTab.js
+7
-1
compilerContainer.js
src/app/tabs/compileTab/compilerContainer.js
+10
-10
compile-tab-styles.js
src/app/tabs/styles/compile-tab-styles.js
+63
-17
landing-page.js
src/app/ui/landing-page/landing-page.js
+0
-2
No files found.
src/app/tabs/compile-tab.js
View file @
f84551b9
...
@@ -76,7 +76,21 @@ class CompileTab extends CompilerApi {
...
@@ -76,7 +76,21 @@ class CompileTab extends CompilerApi {
*/
*/
listenToEvents
()
{
listenToEvents
()
{
this
.
compiler
.
event
.
register
(
'compilationStarted'
,
()
=>
{
let
onContentChanged
=
()
=>
{
this
.
events
.
emit
(
'statusChanged'
,
{
key
:
'code'
,
title
:
'the content has changed, needs recompilation'
,
type
:
'info'
})
}
this
.
editor
.
event
.
register
(
'contentChanged'
,
onContentChanged
)
this
.
editor
.
event
.
register
(
'sessionSwitched'
,
onContentChanged
)
this
.
compiler
.
event
.
register
(
'loadingCompiler'
,
()
=>
{
this
.
events
.
emit
(
'statusChanged'
,
{
key
:
'spinner'
,
title
:
'loading compiler...'
,
type
:
'info'
})
})
this
.
compiler
.
event
.
register
(
'compilerLoaded'
,
()
=>
{
this
.
events
.
emit
(
'statusChanged'
,
{
key
:
''
,
title
:
''
,
type
:
''
})
})
this
.
compileTabLogic
.
event
.
on
(
'startingCompilation'
,
()
=>
{
if
(
this
.
_view
.
errorContainer
)
{
if
(
this
.
_view
.
errorContainer
)
{
this
.
_view
.
errorContainer
.
innerHTML
=
''
this
.
_view
.
errorContainer
.
innerHTML
=
''
}
}
...
@@ -85,10 +99,12 @@ class CompileTab extends CompilerApi {
...
@@ -85,10 +99,12 @@ class CompileTab extends CompilerApi {
this
.
fileManager
.
events
.
on
(
'currentFileChanged'
,
(
name
)
=>
{
this
.
fileManager
.
events
.
on
(
'currentFileChanged'
,
(
name
)
=>
{
this
.
compilerContainer
.
currentFile
=
name
this
.
compilerContainer
.
currentFile
=
name
onContentChanged
()
})
})
this
.
fileManager
.
events
.
on
(
'noFileSelected'
,
()
=>
{
this
.
fileManager
.
events
.
on
(
'noFileSelected'
,
()
=>
{
this
.
compilerContainer
.
currentFile
=
''
this
.
compilerContainer
.
currentFile
=
''
onContentChanged
()
})
})
this
.
compiler
.
event
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
this
.
compiler
.
event
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
...
@@ -352,8 +368,6 @@ class CompileTab extends CompilerApi {
...
@@ -352,8 +368,6 @@ class CompileTab extends CompilerApi {
this
.
_view
.
errorContainer
=
yo
`<div class="
${
css
.
errorBlobs
}
"></div>`
this
.
_view
.
errorContainer
=
yo
`<div class="
${
css
.
errorBlobs
}
"></div>`
this
.
_view
.
contractSelection
=
this
.
contractSelection
()
this
.
_view
.
contractSelection
=
this
.
contractSelection
()
this
.
_view
.
compilerContainer
=
this
.
compilerContainer
.
render
()
this
.
_view
.
compilerContainer
=
this
.
compilerContainer
.
render
()
const
currentFile
=
this
.
fileManager
.
currentFile
()
if
(
currentFile
)
this
.
compilerContainer
.
currentFile
=
currentFile
this
.
_view
.
el
=
yo
`
this
.
_view
.
el
=
yo
`
<div id="compileTabView">
<div id="compileTabView">
...
...
src/app/tabs/compileTab/compileTab.js
View file @
f84551b9
const
async
=
require
(
'async'
)
const
async
=
require
(
'async'
)
const
EventEmitter
=
require
(
'events'
)
var
remixTests
=
require
(
'remix-tests'
)
var
remixTests
=
require
(
'remix-tests'
)
var
Compiler
=
require
(
'remix-solidity'
).
Compiler
var
Compiler
=
require
(
'remix-solidity'
).
Compiler
var
CompilerImport
=
require
(
'../../compiler/compiler-imports'
)
var
CompilerImport
=
require
(
'../../compiler/compiler-imports'
)
...
@@ -9,6 +10,7 @@ const addTooltip = require('../../ui/tooltip')
...
@@ -9,6 +10,7 @@ const addTooltip = require('../../ui/tooltip')
class
CompileTab
{
class
CompileTab
{
constructor
(
queryParams
,
fileManager
,
editor
,
config
,
fileProviders
)
{
constructor
(
queryParams
,
fileManager
,
editor
,
config
,
fileProviders
)
{
this
.
event
=
new
EventEmitter
()
this
.
queryParams
=
queryParams
this
.
queryParams
=
queryParams
this
.
compilerImport
=
new
CompilerImport
()
this
.
compilerImport
=
new
CompilerImport
()
this
.
compiler
=
new
Compiler
((
url
,
cb
)
=>
this
.
importFileCb
(
url
,
cb
))
this
.
compiler
=
new
Compiler
((
url
,
cb
)
=>
this
.
importFileCb
(
url
,
cb
))
...
@@ -45,7 +47,11 @@ class CompileTab {
...
@@ -45,7 +47,11 @@ class CompileTab {
provider
.
get
(
target
,
(
error
,
content
)
=>
{
provider
.
get
(
target
,
(
error
,
content
)
=>
{
if
(
error
)
return
console
.
log
(
error
)
if
(
error
)
return
console
.
log
(
error
)
sources
[
target
]
=
{
content
}
sources
[
target
]
=
{
content
}
this
.
compiler
.
compile
(
sources
,
target
)
this
.
event
.
emit
(
'startingCompilation'
)
setTimeout
(()
=>
{
// setTimeout fix the animation on chrome... (animation triggered by 'staringCompilation')
this
.
compiler
.
compile
(
sources
,
target
)
},
100
)
})
})
}
}
...
...
src/app/tabs/compileTab/compilerContainer.js
View file @
f84551b9
...
@@ -47,6 +47,13 @@ class CompilerContainer {
...
@@ -47,6 +47,13 @@ class CompilerContainer {
this
.
editor
.
event
.
register
(
'contentChanged'
,
this
.
scheduleCompilation
.
bind
(
this
))
this
.
editor
.
event
.
register
(
'contentChanged'
,
this
.
scheduleCompilation
.
bind
(
this
))
this
.
editor
.
event
.
register
(
'sessionSwitched'
,
this
.
scheduleCompilation
.
bind
(
this
))
this
.
editor
.
event
.
register
(
'sessionSwitched'
,
this
.
scheduleCompilation
.
bind
(
this
))
this
.
compileTabLogic
.
event
.
on
(
'startingCompilation'
,
()
=>
{
if
(
!
this
.
_view
.
compileIcon
)
return
this
.
_view
.
compileIcon
.
setAttribute
(
'title'
,
'compiling...'
)
this
.
_view
.
compileIcon
.
classList
.
remove
(
`
${
css
.
bouncingIcon
}
`
)
this
.
_view
.
compileIcon
.
classList
.
add
(
`
${
css
.
spinningIcon
}
`
)
})
this
.
compileTabLogic
.
compiler
.
event
.
register
(
'compilationDuration'
,
(
speed
)
=>
{
this
.
compileTabLogic
.
compiler
.
event
.
register
(
'compilationDuration'
,
(
speed
)
=>
{
if
(
!
this
.
_view
.
warnCompilationSlow
)
return
if
(
!
this
.
_view
.
warnCompilationSlow
)
return
if
(
speed
>
1000
)
{
if
(
speed
>
1000
)
{
...
@@ -65,29 +72,22 @@ class CompilerContainer {
...
@@ -65,29 +72,22 @@ class CompilerContainer {
this
.
compileTabLogic
.
compiler
.
event
.
register
(
'loadingCompiler'
,
()
=>
{
this
.
compileTabLogic
.
compiler
.
event
.
register
(
'loadingCompiler'
,
()
=>
{
if
(
!
this
.
_view
.
compileIcon
)
return
if
(
!
this
.
_view
.
compileIcon
)
return
this
.
_view
.
compileIcon
.
classList
.
add
(
`
${
css
.
spinningIcon
}
`
)
this
.
_view
.
warnCompilationSlow
.
style
.
visibility
=
'hidden'
this
.
_view
.
compileIcon
.
setAttribute
(
'title'
,
'compiler is loading, please wait a few moments.'
)
this
.
_view
.
compileIcon
.
setAttribute
(
'title'
,
'compiler is loading, please wait a few moments.'
)
})
this
.
compileTabLogic
.
compiler
.
event
.
register
(
'compilationStarted'
,
()
=>
{
if
(
!
this
.
_view
.
compileIcon
)
return
this
.
_view
.
compileIcon
.
classList
.
remove
(
`
${
css
.
bouncingIcon
}
`
)
this
.
_view
.
compileIcon
.
classList
.
add
(
`
${
css
.
spinningIcon
}
`
)
this
.
_view
.
compileIcon
.
classList
.
add
(
`
${
css
.
spinningIcon
}
`
)
this
.
_view
.
compileIcon
.
setAttribute
(
'title'
,
'compiling...'
)
this
.
_view
.
warnCompilationSlow
.
style
.
visibility
=
'hidden'
})
})
this
.
compileTabLogic
.
compiler
.
event
.
register
(
'compilerLoaded'
,
()
=>
{
this
.
compileTabLogic
.
compiler
.
event
.
register
(
'compilerLoaded'
,
()
=>
{
if
(
!
this
.
_view
.
compileIcon
)
return
if
(
!
this
.
_view
.
compileIcon
)
return
this
.
_view
.
compileIcon
.
classList
.
remove
(
`
${
css
.
spinningIcon
}
`
)
this
.
_view
.
compileIcon
.
setAttribute
(
'title'
,
''
)
this
.
_view
.
compileIcon
.
setAttribute
(
'title'
,
''
)
this
.
_view
.
compileIcon
.
classList
.
remove
(
`
${
css
.
spinningIcon
}
`
)
})
})
this
.
compileTabLogic
.
compiler
.
event
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
this
.
compileTabLogic
.
compiler
.
event
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
if
(
!
this
.
_view
.
compileIcon
)
return
if
(
!
this
.
_view
.
compileIcon
)
return
this
.
_view
.
compileIcon
.
setAttribute
(
'title'
,
'idle'
)
this
.
_view
.
compileIcon
.
classList
.
remove
(
`
${
css
.
spinningIcon
}
`
)
this
.
_view
.
compileIcon
.
classList
.
remove
(
`
${
css
.
spinningIcon
}
`
)
this
.
_view
.
compileIcon
.
classList
.
remove
(
`
${
css
.
bouncingIcon
}
`
)
this
.
_view
.
compileIcon
.
classList
.
remove
(
`
${
css
.
bouncingIcon
}
`
)
this
.
_view
.
compileIcon
.
setAttribute
(
'title'
,
'idle'
)
})
})
}
}
...
...
src/app/tabs/styles/compile-tab-styles.js
View file @
f84551b9
...
@@ -141,32 +141,78 @@ const css = csjs`
...
@@ -141,32 +141,78 @@ const css = csjs`
.icon {
.icon {
margin-right: 0.3em;
margin-right: 0.3em;
}
}
.spinningIcon {
margin-right: .3em;
animation: spin 2s linear infinite;
}
.bouncingIcon {
margin-right: .3em;
animation: bounce 2s infinite;
}
.errorBlobs {
.errorBlobs {
padding-left: 5px;
padding-left: 5px;
padding-right: 5px;
padding-right: 5px;
}
}
.spinningIcon {
display: inline-block;
position: relative;
animation: spin 2s infinite linear;
-moz-animation: spin 2s infinite linear;
-o-animation: spin 2s infinite linear;
-webkit-animation: spin 2s infinite linear;
}
@keyframes spin {
@keyframes spin {
0% { transform: rotate(0deg); }
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
100% { transform: rotate(360deg); }
}
}
@-webkit-keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@-moz-keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@-o-keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@-ms-keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.bouncingIcon {
display: inline-block;
position: relative;
-moz-animation: bounce 2s infinite linear;
-o-animation: bounce 2s infinite linear;
-webkit-animation: bounce 2s infinite linear;
animation: bounce 2s infinite linear;
}
@-webkit-keyframes bounce {
@-webkit-keyframes bounce {
0% {
0% { top: 0; }
margin-bottom: 0;
50% { top: -0.2em; }
}
70% { top: -0.3em; }
70% {
100% { top: 0; }
margin-bottom: 0;
}
}
@-moz-keyframes bounce {
100% {
0% { top: 0; }
margin-bottom: 0;
50% { top: -0.2em; }
}
70% { top: -0.3em; }
100% { top: 0; }
}
@-o-keyframes bounce {
0% { top: 0; }
50% { top: -0.2em; }
70% { top: -0.3em; }
100% { top: 0; }
}
@-ms-keyframes bounce {
0% { top: 0; }
50% { top: -0.2em; }
70% { top: -0.3em; }
100% { top: 0; }
}
@keyframes bounce {
0% { top: 0; }
50% { top: -0.2em; }
70% { top: -0.3em; }
100% { top: 0; }
}
}
`
`
...
...
src/app/ui/landing-page/landing-page.js
View file @
f84551b9
...
@@ -125,14 +125,12 @@ export class LandingPage extends BaseApi {
...
@@ -125,14 +125,12 @@ export class LandingPage extends BaseApi {
this
.
appManager
.
ensureActivated
(
'run'
)
this
.
appManager
.
ensureActivated
(
'run'
)
this
.
appManager
.
ensureActivated
(
'solidityStaticAnalysis'
)
this
.
appManager
.
ensureActivated
(
'solidityStaticAnalysis'
)
this
.
appManager
.
ensureActivated
(
'solidityUnitTesting'
)
this
.
appManager
.
ensureActivated
(
'solidityUnitTesting'
)
globalRegistry
.
get
(
'filemanager'
).
api
.
switchFile
()
globalRegistry
.
get
(
'verticalicon'
).
api
.
select
(
'solidity'
)
globalRegistry
.
get
(
'verticalicon'
).
api
.
select
(
'solidity'
)
}
}
let
startVyper
=
()
=>
{
let
startVyper
=
()
=>
{
closeAll
()
closeAll
()
this
.
appManager
.
ensureActivated
(
'vyper'
)
this
.
appManager
.
ensureActivated
(
'vyper'
)
this
.
appManager
.
ensureActivated
(
'run'
)
this
.
appManager
.
ensureActivated
(
'run'
)
globalRegistry
.
get
(
'filemanager'
).
api
.
switchFile
()
globalRegistry
.
get
(
'verticalicon'
).
api
.
select
(
'vyper'
)
globalRegistry
.
get
(
'verticalicon'
).
api
.
select
(
'vyper'
)
}
}
...
...
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