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
053304ef
Commit
053304ef
authored
Feb 22, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use new API
parent
3b7d4dd5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
18 deletions
+11
-18
browser-solidity.css
assets/css/browser-solidity.css
+4
-0
debugger.js
src/app/debugger.js
+5
-16
editor.js
src/app/editor.js
+2
-2
No files found.
assets/css/browser-solidity.css
View file @
053304ef
...
@@ -487,3 +487,7 @@ input[type="file"] {
...
@@ -487,3 +487,7 @@ input[type="file"] {
background-color
:
#F4B9B7
;
background-color
:
#F4B9B7
;
opacity
:
0.5
;
opacity
:
0.5
;
}
}
.ace_gutter-cell.ace_breakpoint
{
background-color
:
#F77E79
;
}
src/app/debugger.js
View file @
053304ef
...
@@ -11,28 +11,28 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) {
...
@@ -11,28 +11,28 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) {
this
.
sourceMappingDecoder
=
new
remix
.
util
.
SourceMappingDecoder
()
this
.
sourceMappingDecoder
=
new
remix
.
util
.
SourceMappingDecoder
()
this
.
el
.
appendChild
(
this
.
debugger
.
render
())
this
.
el
.
appendChild
(
this
.
debugger
.
render
())
this
.
appAPI
=
appAPI
this
.
appAPI
=
appAPI
this
.
markers
=
{}
this
.
breakPointManager
=
new
remix
.
code
.
BreakpointManager
(
this
.
debugger
,
(
sourceLocation
)
=>
{
this
.
breakPointManager
=
new
remix
.
code
.
BreakpointManager
(
this
.
debugger
,
(
sourceLocation
)
=>
{
return
this
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
sourceLocation
,
sourceLocation
.
file
,
this
.
editor
,
this
.
compiler
.
lastCompilationResult
.
data
)
return
appAPI
.
offsetToLineColumn
(
sourceLocation
,
sourceLocation
.
file
,
this
.
editor
,
this
.
appAPI
.
lastCompilationResult
()
.
data
)
})
})
this
.
debugger
.
setBreakpointManager
(
this
.
breakPointManager
)
this
.
debugger
.
setBreakpointManager
(
this
.
breakPointManager
)
this
.
breakPointManager
.
event
.
register
(
'breakpointHit'
,
(
sourceLocation
)
=>
{
this
.
breakPointManager
.
event
.
register
(
'breakpointHit'
,
(
sourceLocation
)
=>
{
})
})
var
self
=
this
editorEvent
.
register
(
'breakpointCleared'
,
(
fileName
,
row
)
=>
{
editorEvent
.
register
(
'breakpointCleared'
,
(
fileName
,
row
)
=>
{
if
(
self
.
compiler
.
lastCompilationResult
.
data
)
{
if
(
self
.
appAPI
.
lastCompilationResult
()
.
data
)
{
this
.
breakPointManager
.
remove
({
fileName
:
fileName
,
row
:
row
})
this
.
breakPointManager
.
remove
({
fileName
:
fileName
,
row
:
row
})
}
}
})
})
editorEvent
.
register
(
'breakpointAdded'
,
(
fileName
,
row
)
=>
{
editorEvent
.
register
(
'breakpointAdded'
,
(
fileName
,
row
)
=>
{
if
(
self
.
compiler
.
lastCompilationResult
.
data
)
{
if
(
self
.
appAPI
.
lastCompilationResult
()
.
data
)
{
this
.
breakPointManager
.
add
({
fileName
:
fileName
,
row
:
row
})
this
.
breakPointManager
.
add
({
fileName
:
fileName
,
row
:
row
})
}
}
})
})
var
self
=
this
executionContextEvent
.
register
(
'contextChanged'
,
this
,
function
(
context
)
{
executionContextEvent
.
register
(
'contextChanged'
,
this
,
function
(
context
)
{
self
.
switchProvider
(
context
)
self
.
switchProvider
(
context
)
})
})
...
@@ -44,7 +44,6 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) {
...
@@ -44,7 +44,6 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) {
// unload if a file has changed (but not if tabs were switched)
// unload if a file has changed (but not if tabs were switched)
editorEvent
.
register
(
'contentChanged'
,
function
()
{
editorEvent
.
register
(
'contentChanged'
,
function
()
{
self
.
debugger
.
unLoad
()
self
.
debugger
.
unLoad
()
self
.
removeMarkers
()
})
})
// register selected code item, highlight the corresponding source location
// register selected code item, highlight the corresponding source location
...
@@ -77,16 +76,6 @@ Debugger.prototype.debug = function (txHash) {
...
@@ -77,16 +76,6 @@ Debugger.prototype.debug = function (txHash) {
})
})
}
}
Debugger
.
prototype
.
switchFile
=
function
(
rawLocation
)
{
var
name
=
this
.
editor
.
getCacheFile
()
// current opened tab
if
(
this
.
compiler
.
lastCompilationResult
.
data
)
{
var
source
=
this
.
compiler
.
lastCompilationResult
.
data
.
sourceList
[
rawLocation
.
file
]
// auto switch to that tab
if
(
name
!==
source
)
{
this
.
switchToFile
(
source
)
// command the app to swicth to the next file
}
}
}
/**
/**
* add a new web3 provider to remix
* add a new web3 provider to remix
*
*
...
...
src/app/editor.js
View file @
053304ef
...
@@ -28,14 +28,14 @@ function Editor () {
...
@@ -28,14 +28,14 @@ function Editor () {
var
breakpoints
=
e
.
editor
.
session
.
getBreakpoints
()
var
breakpoints
=
e
.
editor
.
session
.
getBreakpoints
()
for
(
var
k
in
breakpoints
)
{
for
(
var
k
in
breakpoints
)
{
if
(
k
===
row
.
toString
())
{
if
(
k
===
row
.
toString
())
{
event
.
trigger
(
'breakpointCleared'
,
[
self
.
getCacheFile
()
,
row
])
event
.
trigger
(
'breakpointCleared'
,
[
currentSession
,
row
])
e
.
editor
.
session
.
clearBreakpoint
(
row
)
e
.
editor
.
session
.
clearBreakpoint
(
row
)
e
.
stop
()
e
.
stop
()
return
return
}
}
}
}
self
.
setBreakpoint
(
row
)
self
.
setBreakpoint
(
row
)
event
.
trigger
(
'breakpointAdded'
,
[
self
.
getCacheFile
()
,
row
])
event
.
trigger
(
'breakpointAdded'
,
[
currentSession
,
row
])
e
.
stop
()
e
.
stop
()
})
})
...
...
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