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
389e2eba
Commit
389e2eba
authored
Jul 04, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move static analysis to its own tab
parent
38050759
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
21 deletions
+28
-21
app.js
src/app.js
+0
-8
righthand-panel.js
src/app/panels/righthand-panel.js
+6
-2
analysis-tab.js
src/app/tabs/analysis-tab.js
+13
-1
compile-tab.js
src/app/tabs/compile-tab.js
+9
-10
No files found.
src/app.js
View file @
389e2eba
...
@@ -28,7 +28,6 @@ var Renderer = require('./app/ui/renderer')
...
@@ -28,7 +28,6 @@ var Renderer = require('./app/ui/renderer')
var
Compiler
=
require
(
'remix-solidity'
).
Compiler
var
Compiler
=
require
(
'remix-solidity'
).
Compiler
var
executionContext
=
require
(
'./execution-context'
)
var
executionContext
=
require
(
'./execution-context'
)
var
Debugger
=
require
(
'./app/debugger/debugger'
)
var
Debugger
=
require
(
'./app/debugger/debugger'
)
var
StaticAnalysis
=
require
(
'./app/staticanalysis/staticAnalysisView'
)
var
FilePanel
=
require
(
'./app/panels/file-panel'
)
var
FilePanel
=
require
(
'./app/panels/file-panel'
)
var
EditorPanel
=
require
(
'./app/panels/editor-panel'
)
var
EditorPanel
=
require
(
'./app/panels/editor-panel'
)
var
RighthandPanel
=
require
(
'./app/panels/righthand-panel'
)
var
RighthandPanel
=
require
(
'./app/panels/righthand-panel'
)
...
@@ -483,19 +482,12 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -483,19 +482,12 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
var
renderer
=
new
Renderer
()
var
renderer
=
new
Renderer
()
registry
.
put
({
api
:
renderer
,
name
:
'renderer'
})
registry
.
put
({
api
:
renderer
,
name
:
'renderer'
})
// ----------------- StaticAnalysis -----------------
var
staticanalysis
=
new
StaticAnalysis
()
registry
.
put
({
api
:
staticanalysis
,
name
:
'staticanalysis'
})
// ---------------- Righthand-panel --------------------
// ---------------- Righthand-panel --------------------
self
.
_components
.
righthandpanel
=
new
RighthandPanel
()
self
.
_components
.
righthandpanel
=
new
RighthandPanel
()
self
.
_view
.
rightpanel
.
appendChild
(
self
.
_components
.
righthandpanel
.
render
())
self
.
_view
.
rightpanel
.
appendChild
(
self
.
_components
.
righthandpanel
.
render
())
self
.
_components
.
righthandpanel
.
init
()
self
.
_components
.
righthandpanel
.
init
()
self
.
_components
.
righthandpanel
.
event
.
register
(
'resize'
,
delta
=>
self
.
_adjustLayout
(
'right'
,
delta
))
self
.
_components
.
righthandpanel
.
event
.
register
(
'resize'
,
delta
=>
self
.
_adjustLayout
(
'right'
,
delta
))
var
node
=
document
.
getElementById
(
'staticanalysisView'
)
node
.
insertBefore
(
staticanalysis
.
render
(),
node
.
childNodes
[
0
])
// ----------------- Debugger -----------------
// ----------------- Debugger -----------------
self
.
_view
.
transactionDebugger
=
new
Debugger
(
'#debugger'
,
new
SourceHighlighter
())
self
.
_view
.
transactionDebugger
=
new
Debugger
(
'#debugger'
,
new
SourceHighlighter
())
self
.
_view
.
transactionDebugger
.
addProvider
(
'vm'
,
executionContext
.
vm
())
self
.
_view
.
transactionDebugger
.
addProvider
(
'vm'
,
executionContext
.
vm
())
...
...
src/app/panels/righthand-panel.js
View file @
389e2eba
...
@@ -57,7 +57,11 @@ module.exports = class RighthandPanel {
...
@@ -57,7 +57,11 @@ module.exports = class RighthandPanel {
pluginAPI
,
pluginAPI
,
self
.
_deps
.
app
,
self
.
_deps
.
app
,
self
.
_deps
.
compiler
,
self
.
_deps
.
compiler
,
self
.
_deps
.
txlistener
)
self
.
_deps
.
txlistener
)
var
analysisTab
=
new
AnalysisTab
(
self
.
_components
.
registry
)
analysisTab
.
event
.
register
(
'newStaticAnaysisWarningMessage'
,
(
msg
,
settings
)
=>
{
self
.
_components
.
compile
.
addWarning
(
msg
,
settings
)
})
self
.
_components
=
{
self
.
_components
=
{
pluginManager
:
pluginManager
,
pluginManager
:
pluginManager
,
...
@@ -65,7 +69,7 @@ module.exports = class RighthandPanel {
...
@@ -65,7 +69,7 @@ module.exports = class RighthandPanel {
compile
:
new
CompileTab
(
self
.
_components
.
registry
),
compile
:
new
CompileTab
(
self
.
_components
.
registry
),
run
:
new
RunTab
(
self
.
_components
.
registry
),
run
:
new
RunTab
(
self
.
_components
.
registry
),
settings
:
new
SettingsTab
(
self
.
_components
.
registry
),
settings
:
new
SettingsTab
(
self
.
_components
.
registry
),
analysis
:
new
AnalysisTab
(
self
.
_components
.
registry
)
,
analysis
:
analysisTab
,
debug
:
new
DebuggerTab
(
self
.
_components
.
registry
),
debug
:
new
DebuggerTab
(
self
.
_components
.
registry
),
support
:
new
SupportTab
(
self
.
_components
.
registry
),
support
:
new
SupportTab
(
self
.
_components
.
registry
),
test
:
new
TestTab
(
self
.
_components
.
registry
)
test
:
new
TestTab
(
self
.
_components
.
registry
)
...
...
src/app/tabs/analysis-tab.js
View file @
389e2eba
var
yo
=
require
(
'yo-yo'
)
var
yo
=
require
(
'yo-yo'
)
var
csjs
=
require
(
'csjs-inject'
)
var
csjs
=
require
(
'csjs-inject'
)
var
remixLib
=
require
(
'remix-lib'
)
var
remixLib
=
require
(
'remix-lib'
)
var
StaticAnalysis
=
require
(
'../staticanalysis/staticAnalysisView'
)
var
globalRegistry
=
require
(
'../../global/registry'
)
var
globalRegistry
=
require
(
'../../global/registry'
)
var
EventManager
=
remixLib
.
EventManager
var
EventManager
=
remixLib
.
EventManager
...
@@ -13,12 +14,23 @@ module.exports = class AnalysisTab {
...
@@ -13,12 +14,23 @@ module.exports = class AnalysisTab {
self
.
data
=
{}
self
.
data
=
{}
self
.
_components
=
{}
self
.
_components
=
{}
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
self
.
_deps
=
{
rightHandPanel
:
self
.
_components
.
registry
.
get
(
'righthandpanel'
).
api
}
}
}
render
()
{
render
()
{
const
self
=
this
const
self
=
this
var
staticanalysis
=
new
StaticAnalysis
()
staticanalysis
.
event
.
register
(
'staticAnaysisWarning'
,
(
count
)
=>
{
const
msg
=
`Static Analysis raised
${
count
}
warning(s) that requires your attention. Click here to show the warning(s).`
const
settings
=
{
type
:
'staticAnalysisWarning'
,
click
:
()
=>
self
.
_deps
.
rightHandPanel
.
focusOn
(
'staticanalysisView'
),
useSpan
:
true
}
self
.
event
.
trigger
(
'newStaticAnaysisWarningMessage'
,
[
msg
,
settings
])
})
self
.
_components
.
registry
.
put
({
api
:
staticanalysis
,
name
:
'staticanalysis'
})
if
(
self
.
_view
.
el
)
return
self
.
_view
.
el
if
(
self
.
_view
.
el
)
return
self
.
_view
.
el
self
.
_view
.
el
=
yo
`
self
.
_view
.
el
=
yo
`
<div class="
${
css
.
analysisTabView
}
"id="staticanalysisView"></div>`
<div class="
${
css
.
analysisTabView
}
"id="staticanalysisView">
${
staticanalysis
.
render
()}
</div>`
return
self
.
_view
.
el
return
self
.
_view
.
el
}
}
}
}
...
...
src/app/tabs/compile-tab.js
View file @
389e2eba
...
@@ -25,6 +25,7 @@ module.exports = class CompileTab {
...
@@ -25,6 +25,7 @@ module.exports = class CompileTab {
compileIcon
:
null
,
compileIcon
:
null
,
compileContainer
:
null
,
compileContainer
:
null
,
errorContainer
:
null
,
errorContainer
:
null
,
errorContainerHead
:
null
,
contractNames
:
null
,
contractNames
:
null
,
contractEl
:
null
contractEl
:
null
}
}
...
@@ -36,9 +37,7 @@ module.exports = class CompileTab {
...
@@ -36,9 +37,7 @@ module.exports = class CompileTab {
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
,
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
compiler
:
self
.
_components
.
registry
.
get
(
'compiler'
).
api
,
compiler
:
self
.
_components
.
registry
.
get
(
'compiler'
).
api
,
staticAnalysis
:
self
.
_components
.
registry
.
get
(
'staticanalysis'
).
api
,
renderer
:
self
.
_components
.
registry
.
get
(
'renderer'
).
api
renderer
:
self
.
_components
.
registry
.
get
(
'renderer'
).
api
,
rightHandPanel
:
self
.
_components
.
registry
.
get
(
'righthandpanel'
).
api
}
}
self
.
data
=
{
self
.
data
=
{
hideWarnings
:
self
.
_deps
.
config
.
get
(
'hideWarnings'
)
||
false
,
hideWarnings
:
self
.
_deps
.
config
.
get
(
'hideWarnings'
)
||
false
,
...
@@ -80,6 +79,7 @@ module.exports = class CompileTab {
...
@@ -80,6 +79,7 @@ module.exports = class CompileTab {
self
.
_deps
.
compiler
.
event
.
register
(
'compilationStarted'
,
function
start
()
{
self
.
_deps
.
compiler
.
event
.
register
(
'compilationStarted'
,
function
start
()
{
if
(
!
self
.
_view
.
compileIcon
)
return
if
(
!
self
.
_view
.
compileIcon
)
return
self
.
_view
.
errorContainer
.
innerHTML
=
''
self
.
_view
.
errorContainer
.
innerHTML
=
''
self
.
_view
.
errorContainerHead
.
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...'
)
...
@@ -139,13 +139,10 @@ module.exports = class CompileTab {
...
@@ -139,13 +139,10 @@ module.exports = class CompileTab {
})
})
}
}
})
})
self
.
_deps
.
staticAnalysis
.
event
.
register
(
'staticAnaysisWarning'
,
(
count
)
=>
{
}
if
(
count
)
{
addWarning
(
msg
,
settings
)
{
const
msg
=
`Static Analysis raised
${
count
}
warning(s) that requires your attention. Click here to show the warning(s).`
const
self
=
this
const
settings
=
{
type
:
'staticAnalysisWarning'
,
click
:
()
=>
self
.
_deps
.
rightHandPanel
.
focusOn
(
'staticanalysisView'
),
useSpan
:
true
}
self
.
_deps
.
renderer
.
error
(
msg
,
self
.
_view
.
errorContainerHead
,
settings
)
self
.
_deps
.
renderer
.
error
(
msg
,
self
.
_view
.
errorContainer
,
settings
)
}
})
}
}
render
()
{
render
()
{
const
self
=
this
const
self
=
this
...
@@ -173,6 +170,7 @@ module.exports = class CompileTab {
...
@@ -173,6 +170,7 @@ module.exports = class CompileTab {
</div>
</div>
</div>`
</div>`
self
.
_view
.
errorContainer
=
yo
`<div class='error'></div>`
self
.
_view
.
errorContainer
=
yo
`<div class='error'></div>`
self
.
_view
.
errorContainerHead
=
yo
`<div class='error'></div>`
self
.
_view
.
contractNames
=
yo
`<select class="
${
css
.
contractNames
}
" disabled></select>`
self
.
_view
.
contractNames
=
yo
`<select class="
${
css
.
contractNames
}
" disabled></select>`
self
.
_view
.
contractEl
=
yo
`
self
.
_view
.
contractEl
=
yo
`
<div class="
${
css
.
container
}
">
<div class="
${
css
.
container
}
">
...
@@ -194,6 +192,7 @@ module.exports = class CompileTab {
...
@@ -194,6 +192,7 @@ module.exports = class CompileTab {
<div class="
${
css
.
compileTabView
}
" id="compileTabView">
<div class="
${
css
.
compileTabView
}
" id="compileTabView">
${
self
.
_view
.
compileContainer
}
${
self
.
_view
.
compileContainer
}
${
self
.
_view
.
contractEl
}
${
self
.
_view
.
contractEl
}
${
self
.
_view
.
errorContainerHead
}
${
self
.
_view
.
errorContainer
}
${
self
.
_view
.
errorContainer
}
</div>`
</div>`
const
help
=
{
const
help
=
{
...
...
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