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
ae9b4896
Commit
ae9b4896
authored
May 22, 2017
by
yann300
Committed by
GitHub
May 22, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #553 from ethereum/loadingSpinnerOrigin
Loading spinner
parents
10cdc1dc
14de99cf
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
104 additions
and
32 deletions
+104
-32
index.html
index.html
+2
-2
app.js
src/app.js
+19
-25
compiler.js
src/app/compiler.js
+0
-1
loading-spinner.js
src/app/loading-spinner.js
+26
-0
renderer.js
src/app/renderer.js
+4
-0
style-guide.js
src/app/style-guide.js
+5
-4
tabbed-menu.js
src/app/tabbed-menu.js
+47
-0
smoke-test.js
test-browser/tests/smoke-test.js
+1
-0
No files found.
index.html
View file @
ae9b4896
...
@@ -57,9 +57,9 @@
...
@@ -57,9 +57,9 @@
<div
id=
"menu"
>
<div
id=
"menu"
>
<img
id=
"solIcon"
title=
"Solidity realtime compiler and runtime"
src=
"assets/img/remix_logo_512x512.svg"
alt=
"Solidity realtime compiler and runtime"
>
<img
id=
"solIcon"
title=
"Solidity realtime compiler and runtime"
src=
"assets/img/remix_logo_512x512.svg"
alt=
"Solidity realtime compiler and runtime"
>
<ul
id=
"options"
>
<ul
id=
"options"
>
<li
class=
"settingsView active"
title=
"Settings"
>
Settings
</li>
<li
class=
"publishView"
title=
"Publish"
>
Files
</li>
<li
class=
"envView"
title=
"Environment"
>
Contract
</li>
<li
class=
"envView"
title=
"Environment"
>
Contract
</li>
<li
class=
"settingsView"
title=
"Settings"
>
Settings
</li>
<li
class=
"publishView"
title=
"Publish"
>
Files
</li>
<li
class=
"debugView"
title=
"Debugger"
>
Debugger
</li>
<li
class=
"debugView"
title=
"Debugger"
>
Debugger
</li>
<li
class=
"staticanalysisView"
title=
"Static Analysis"
>
Analysis
</li>
<li
class=
"staticanalysisView"
title=
"Static Analysis"
>
Analysis
</li>
<li
id=
"helpButton"
><a
href=
"https://remix.readthedocs.org"
target=
"_blank"
title=
"Open Documentation"
>
Docs
</a></li>
<li
id=
"helpButton"
><a
href=
"https://remix.readthedocs.org"
target=
"_blank"
title=
"Open Documentation"
>
Docs
</a></li>
...
...
src/app.js
View file @
ae9b4896
...
@@ -26,7 +26,7 @@ var EventManager = require('ethereum-remix').lib.EventManager
...
@@ -26,7 +26,7 @@ var EventManager = require('ethereum-remix').lib.EventManager
var
StaticAnalysis
=
require
(
'./app/staticanalysis/staticAnalysisView'
)
var
StaticAnalysis
=
require
(
'./app/staticanalysis/staticAnalysisView'
)
var
OffsetToLineColumnConverter
=
require
(
'./lib/offsetToLineColumnConverter'
)
var
OffsetToLineColumnConverter
=
require
(
'./lib/offsetToLineColumnConverter'
)
var
FilePanel
=
require
(
'./app/file-panel'
)
var
FilePanel
=
require
(
'./app/file-panel'
)
var
tabbedMenu
=
require
(
'./app/tabbed-menu'
)
var
examples
=
require
(
'./app/example-contracts'
)
var
examples
=
require
(
'./app/example-contracts'
)
var
contractTab
=
require
(
'./app/contract-tab.js'
)
var
contractTab
=
require
(
'./app/contract-tab.js'
)
...
@@ -70,6 +70,11 @@ var run = function () {
...
@@ -70,6 +70,11 @@ var run = function () {
var
files
=
new
Files
(
fileStorage
)
var
files
=
new
Files
(
fileStorage
)
var
config
=
new
Config
(
fileStorage
)
var
config
=
new
Config
(
fileStorage
)
var
executionContext
=
new
ExecutionContext
()
var
compiler
=
new
Compiler
(
handleImportCall
)
var
formalVerification
=
new
FormalVerification
(
$
(
'#verificationView'
),
compiler
.
event
)
var
offsetToLineColumnConverter
=
new
OffsetToLineColumnConverter
(
compiler
.
event
)
// return all the files, except the temporary/readonly ones
// return all the files, except the temporary/readonly ones
function
packageFiles
()
{
function
packageFiles
()
{
var
ret
=
{}
var
ret
=
{}
...
@@ -277,24 +282,7 @@ var run = function () {
...
@@ -277,24 +282,7 @@ var run = function () {
}).
appendTo
(
'body'
)
}).
appendTo
(
'body'
)
})
})
// ---------------- tabbed menu ------------------
// --------------------Files tabs-----------------------------
$
(
'#options li'
).
click
(
function
(
ev
)
{
var
$el
=
$
(
this
)
selectTab
(
$el
)
})
var
selectTab
=
function
(
el
)
{
var
match
=
/
[
a-z
]
+View/
.
exec
(
el
.
get
(
0
).
className
)
if
(
!
match
)
return
var
cls
=
match
[
0
]
if
(
!
el
.
hasClass
(
'active'
))
{
el
.
parent
().
find
(
'li'
).
removeClass
(
'active'
)
$
(
'#optionViews'
).
attr
(
'class'
,
''
).
addClass
(
cls
)
el
.
addClass
(
'active'
)
}
self
.
event
.
trigger
(
'tabChanged'
,
[
cls
])
}
var
$filesEl
=
$
(
'#files'
)
var
$filesEl
=
$
(
'#files'
)
var
FILE_SCROLL_DELTA
=
300
var
FILE_SCROLL_DELTA
=
300
...
@@ -623,11 +611,6 @@ var run = function () {
...
@@ -623,11 +611,6 @@ var run = function () {
}
}
}
}
var
executionContext
=
new
ExecutionContext
()
var
compiler
=
new
Compiler
(
handleImportCall
)
var
formalVerification
=
new
FormalVerification
(
$
(
'#verificationView'
),
compiler
.
event
)
var
offsetToLineColumnConverter
=
new
OffsetToLineColumnConverter
(
compiler
.
event
)
// ----------------- Debugger -----------------
// ----------------- Debugger -----------------
var
debugAPI
=
{
var
debugAPI
=
{
statementMarker
:
null
,
statementMarker
:
null
,
...
@@ -915,8 +898,8 @@ var run = function () {
...
@@ -915,8 +898,8 @@ var run = function () {
})
})
function
startdebugging
(
txHash
)
{
function
startdebugging
(
txHash
)
{
self
.
event
.
trigger
(
'debuggingRequested'
,
[])
transactionDebugger
.
debug
(
txHash
)
transactionDebugger
.
debug
(
txHash
)
selectTab
(
$
(
'ul#options li.debugView'
))
}
}
function
setVersionText
(
text
)
{
function
setVersionText
(
text
)
{
...
@@ -1004,6 +987,17 @@ var run = function () {
...
@@ -1004,6 +987,17 @@ var run = function () {
loadVersion
(
'builtin'
)
loadVersion
(
'builtin'
)
})
})
var
tabbedMenuAPI
=
{
warnCompilerLoading
:
function
(
msg
)
{
renderer
.
clear
()
if
(
msg
)
{
renderer
.
error
(
msg
,
$
(
'#output'
),
{
type
:
'warning'
})
}
}
}
// load tabbed menu component
tabbedMenu
(
tabbedMenuAPI
,
compiler
.
event
,
self
.
event
)
}
}
module
.
exports
=
{
module
.
exports
=
{
...
...
src/app/compiler.js
View file @
ae9b4896
...
@@ -77,7 +77,6 @@ function Compiler (handleImportCall) {
...
@@ -77,7 +77,6 @@ function Compiler (handleImportCall) {
compilationFinished
(
result
,
missingInputs
,
source
)
compilationFinished
(
result
,
missingInputs
,
source
)
}
}
onCompilerLoaded
(
compiler
.
version
())
onCompilerLoaded
(
compiler
.
version
())
}
}
}
}
...
...
src/app/loading-spinner.js
0 → 100644
View file @
ae9b4896
var
yo
=
require
(
'yo-yo'
)
// -------------- styling ----------------------
var
csjs
=
require
(
'csjs-inject'
)
module
.
exports
=
loadingSpinner
var
css
=
csjs
`
.loader {
display: inline-block;
margin-left: .3em;
border: 2px solid orange;
border-top: 2px solid #F4F6FF; /* Light blue */
border-radius: 50%;
width: 8px;
height: 8px;
animation: spin 2s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
`
function
loadingSpinner
()
{
var
el
=
yo
`<div class=
${
css
.
loader
}
></div>`
return
el
}
src/app/renderer.js
View file @
ae9b4896
...
@@ -68,6 +68,10 @@ function Renderer (appAPI, formalVerificationEvent, compilerEvent) {
...
@@ -68,6 +68,10 @@ function Renderer (appAPI, formalVerificationEvent, compilerEvent) {
})
})
}
}
Renderer
.
prototype
.
clear
=
function
()
{
$
(
'#output'
).
empty
()
}
Renderer
.
prototype
.
error
=
function
(
message
,
container
,
options
)
{
Renderer
.
prototype
.
error
=
function
(
message
,
container
,
options
)
{
var
self
=
this
var
self
=
this
var
opt
=
options
||
{}
var
opt
=
options
||
{}
...
...
src/app/style-guide.js
View file @
ae9b4896
...
@@ -74,11 +74,11 @@ function styleGuide () {
...
@@ -74,11 +74,11 @@ function styleGuide () {
}
}
.warning-text-box {
.warning-text-box {
background-color :
#E6E5A7
; // yellow
background-color :
hsla(59, 56%, 78%, 0.5)
; // yellow
line-height : 20px;
line-height : 20px;
padding :
1em 1em .5em 1em
;
padding :
8px 15px
;
border-radius :
3
px;
border-radius :
5
px;
bo
x-shadow : rgba(0,0,0,.2) 0 1px 4px;
bo
rder : .2em dotted #ffbd01; // orange-yellow
margin-bottom : 1em;
margin-bottom : 1em;
}
}
...
@@ -143,6 +143,7 @@ function styleGuide () {
...
@@ -143,6 +143,7 @@ function styleGuide () {
return
{
return
{
textBoxL
:
textBoxes
[
'display-box-L'
],
textBoxL
:
textBoxes
[
'display-box-L'
],
infoTextBox
:
textBoxes
[
'info-text-box'
],
infoTextBox
:
textBoxes
[
'info-text-box'
],
warningTextBox
:
textBoxes
[
'warning-text-box'
],
titleL
:
texts
[
'title-L'
],
titleL
:
texts
[
'title-L'
],
titleM
:
texts
[
'title-M'
],
titleM
:
texts
[
'title-M'
],
dropdown
:
buttons
[
'dropdown-menu'
],
dropdown
:
buttons
[
'dropdown-menu'
],
...
...
src/app/tabbed-menu.js
0 → 100644
View file @
ae9b4896
var
$
=
require
(
'jquery'
)
var
loadingSpinner
=
require
(
'./loading-spinner'
)
module
.
exports
=
tabbedMenu
function
tabbedMenu
(
rendererAPI
,
compilerEvent
,
appEvent
)
{
$
(
'#options li'
).
click
(
function
(
ev
)
{
var
$el
=
$
(
this
)
selectTab
(
$el
)
})
appEvent
.
register
(
'debuggingRequested'
,
()
=>
{
selectTab
(
$
(
'ul#options li.debugView'
))
})
// initialize tabbed menu
selectTab
(
$
(
'#options .envView'
))
// add event listeners for loading spinner
compilerEvent
.
register
(
'loadingCompiler'
,
function
start
()
{
var
settingsTab
=
document
.
querySelector
(
'.settingsView'
)
if
(
settingsTab
.
children
.
length
)
return
var
spinner
=
loadingSpinner
()
settingsTab
.
appendChild
(
spinner
)
rendererAPI
.
warnCompilerLoading
(
'Solidity compiler is currently loading. Please wait a moment...'
)
compilerEvent
.
register
(
'compilerLoaded'
,
finish
)
function
finish
()
{
compilerEvent
.
unregister
(
'compilerLoaded'
,
finish
)
settingsTab
.
removeChild
(
spinner
)
}
})
// select tab
function
selectTab
(
el
)
{
var
match
=
/
[
a-z
]
+View/
.
exec
(
el
.
get
(
0
).
className
)
if
(
!
match
)
return
var
cls
=
match
[
0
]
if
(
!
el
.
hasClass
(
'active'
))
{
el
.
parent
().
find
(
'li'
).
removeClass
(
'active'
)
$
(
'#optionViews'
).
attr
(
'class'
,
''
).
addClass
(
cls
)
el
.
addClass
(
'active'
)
}
appEvent
.
trigger
(
'tabChanged'
,
[
cls
])
}
}
test-browser/tests/smoke-test.js
View file @
ae9b4896
...
@@ -10,6 +10,7 @@ module.exports = {
...
@@ -10,6 +10,7 @@ module.exports = {
'Smoke test'
:
function
(
browser
)
{
'Smoke test'
:
function
(
browser
)
{
browser
browser
.
waitForElementVisible
(
'#righthand-panel'
,
10000
)
.
waitForElementVisible
(
'#righthand-panel'
,
10000
)
.
click
(
'.settingsView'
)
.
assert
.
containsText
(
'#righthand-panel'
,
'Solidity version'
)
.
assert
.
containsText
(
'#righthand-panel'
,
'Solidity version'
)
.
end
()
.
end
()
},
},
...
...
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