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
d9519965
Commit
d9519965
authored
Feb 08, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename handleErrorClick / use API
parent
f67c4886
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
18 deletions
+16
-18
editor.js
src/app/editor.js
+2
-2
renderer.js
src/app/renderer.js
+14
-16
No files found.
src/app/editor.js
View file @
d9519965
...
...
@@ -149,9 +149,9 @@ function Editor (doNotLoadStorage, storage) {
editor
.
getSession
().
setAnnotations
(
sourceAnnotations
)
}
this
.
handleErrorClick
=
function
(
errLine
,
errC
ol
)
{
this
.
gotoLine
=
function
(
line
,
c
ol
)
{
editor
.
focus
()
editor
.
gotoLine
(
errLine
+
1
,
errC
ol
-
1
,
true
)
editor
.
gotoLine
(
line
+
1
,
c
ol
-
1
,
true
)
}
function
newEditorSession
(
filekey
)
{
...
...
src/app/renderer.js
View file @
d9519965
...
...
@@ -4,11 +4,10 @@ var $ = require('jquery')
var
utils
=
require
(
'./utils'
)
function
Renderer
(
editor
,
updateFiles
,
udapp
,
executionContext
,
formalVerificationEvent
,
compilerEvent
)
{
this
.
editor
=
editor
this
.
updateFiles
=
updateFiles
this
.
udapp
=
udapp
this
.
executionContext
=
executionContext
function
Renderer
(
editorAPI
,
udappAPI
,
ethToolAPI
,
formalVerificationEvent
,
compilerEvent
)
{
this
.
editorAPI
=
editorAPI
this
.
udappAPI
=
udappAPI
this
.
ethToolAPI
=
ethToolAPI
var
self
=
this
formalVerificationEvent
.
register
(
'compilationFinished'
,
this
,
function
(
success
,
message
,
container
,
options
)
{
if
(
!
success
)
{
...
...
@@ -55,8 +54,8 @@ Renderer.prototype.error = function (message, container, options) {
var
errFile
=
err
[
1
]
var
errLine
=
parseInt
(
err
[
2
],
10
)
-
1
var
errCol
=
err
[
4
]
?
parseInt
(
err
[
4
],
10
)
:
0
if
(
!
opt
.
noAnnotations
&&
(
errFile
===
''
||
errFile
===
self
.
editor
.
getCache
File
()))
{
self
.
editor
.
addAnnotation
({
if
(
!
opt
.
noAnnotations
&&
(
errFile
===
''
||
errFile
===
self
.
editor
API
.
currentOpened
File
()))
{
self
.
editor
API
.
addAnnotation
({
row
:
errLine
,
column
:
errCol
,
text
:
message
,
...
...
@@ -64,12 +63,11 @@ Renderer.prototype.error = function (message, container, options) {
})
}
$error
.
click
(
function
(
ev
)
{
if
(
errFile
!==
''
&&
errFile
!==
self
.
editor
.
getCacheFile
()
&&
self
.
editor
.
hasFile
(
errFile
))
{
if
(
errFile
!==
''
&&
errFile
!==
self
.
editor
API
.
currentOpenedFile
()
&&
self
.
editorAPI
.
hasFile
(
errFile
))
{
// Switch to file
self
.
editor
.
setCacheFile
(
errFile
)
self
.
updateFiles
()
self
.
editorAPI
.
switchToFile
(
errFile
)
}
self
.
editor
.
handleErrorClick
(
errLine
,
errCol
)
self
.
editor
API
.
gotoLine
(
errLine
,
errCol
)
})
}
$error
.
find
(
'.close'
).
click
(
function
(
ev
)
{
...
...
@@ -288,7 +286,7 @@ Renderer.prototype.contracts = function (data, source) {
var
self
=
this
var
getSource
=
function
(
contractName
,
source
,
data
)
{
var
currentFile
=
self
.
editor
.
getCache
File
()
var
currentFile
=
self
.
editor
API
.
currentOpened
File
()
return
source
.
sources
[
currentFile
]
}
...
...
@@ -299,7 +297,7 @@ Renderer.prototype.contracts = function (data, source) {
var
getValue
=
function
(
cb
)
{
try
{
var
comp
=
$
(
'#value'
).
val
().
split
(
' '
)
cb
(
null
,
self
.
e
xecutionContext
.
web3
()
.
toWei
(
comp
[
0
],
comp
.
slice
(
1
).
join
(
' '
)))
cb
(
null
,
self
.
e
thToolAPI
.
toWei
(
comp
[
0
],
comp
.
slice
(
1
).
join
(
' '
)))
}
catch
(
e
)
{
cb
(
e
)
}
...
...
@@ -309,13 +307,13 @@ Renderer.prototype.contracts = function (data, source) {
cb
(
null
,
$
(
'#gasLimit'
).
val
())
}
this
.
udapp
.
reset
(
udappContracts
,
getAddress
,
getValue
,
getGasLimit
,
renderOutputModifier
)
this
.
udapp
API
.
reset
(
udappContracts
,
getAddress
,
getValue
,
getGasLimit
,
renderOutputModifier
)
var
$contractOutput
=
this
.
udapp
.
render
()
var
$contractOutput
=
this
.
udapp
API
.
render
()
var
$txOrigin
=
$
(
'#txorigin'
)
this
.
udapp
.
getAccounts
(
function
(
err
,
accounts
)
{
this
.
udapp
API
.
getAccounts
(
function
(
err
,
accounts
)
{
if
(
err
)
{
self
.
error
(
err
.
message
)
}
...
...
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