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
e1c5fe17
Commit
e1c5fe17
authored
Sep 28, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add callback, comment
parent
52863b84
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
run-tab.js
src/app/tabs/run-tab.js
+1
-1
execution-context.js
src/execution-context.js
+5
-3
No files found.
src/app/tabs/run-tab.js
View file @
e1c5fe17
...
...
@@ -200,7 +200,7 @@ function runTab (container, appAPI, appEvents, opts) {
var
selectExEnv
=
el
.
querySelector
(
'#selectExEnvOptions'
)
selectExEnv
.
addEventListener
(
'change'
,
function
(
event
)
{
executionContext
.
executionContextChange
(
selectExEnv
.
options
[
selectExEnv
.
selectedIndex
].
value
,
null
,
()
=>
{
// set the
new context. if that fails, rollback the current one.
// set the
final context. Cause it is possible that this is not the one we've originaly selected
selectExEnv
.
value
=
executionContext
.
getProvider
()
})
...
...
src/execution-context.js
View file @
e1c5fe17
...
...
@@ -112,8 +112,8 @@ function ExecutionContext () {
}
this
.
executionContextChange
=
function
(
context
,
endPointUrl
,
cb
)
{
if
(
!
cb
)
cb
=
()
=>
{}
function
runPrompt
()
{
console
.
log
(
'runPrompt'
)
executionContext
=
context
if
(
!
endPointUrl
)
{
endPointUrl
=
'http://localhost:8545'
...
...
@@ -121,6 +121,10 @@ function ExecutionContext () {
modalDialogCustom
.
prompt
(
null
,
'Web3 Provider Endpoint'
,
endPointUrl
,
(
target
)
=>
{
setProviderFromEndpoint
(
target
)
self
.
event
.
trigger
(
'contextChanged'
,
[
'web3'
])
cb
()
},
()
=>
{
self
.
event
.
trigger
(
'contextChanged'
,
[
'web3'
])
cb
()
})
}
...
...
@@ -135,9 +139,7 @@ function ExecutionContext () {
executionContext
=
context
web3
.
setProvider
(
injectedProvider
)
self
.
event
.
trigger
(
'contextChanged'
,
[
'injected'
])
console
.
log
(
'injected'
)
}
else
if
(
context
===
'vm'
)
{
console
.
log
(
'vm!!'
)
executionContext
=
context
vm
.
stateManager
.
revert
(
function
()
{
vm
.
stateManager
.
checkpoint
()
...
...
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