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
f0d18b86
Commit
f0d18b86
authored
Apr 19, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
still display alert
parent
32db5ed0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
18 deletions
+10
-18
app.js
src/app.js
+1
-5
execution-context.js
src/app/execution-context.js
+9
-13
No files found.
src/app.js
View file @
f0d18b86
...
@@ -899,11 +899,7 @@ var run = function () {
...
@@ -899,11 +899,7 @@ var run = function () {
runCompiler
()
runCompiler
()
if
(
queryParams
.
get
().
context
)
{
if
(
queryParams
.
get
().
context
)
{
executionContext
.
setContext
(
queryParams
.
get
().
context
,
false
)
executionContext
.
setContext
(
queryParams
.
get
().
context
,
queryParams
.
get
().
endpointurl
)
}
if
(
queryParams
.
get
().
endpointurl
)
{
executionContext
.
setEndPointUrl
(
queryParams
.
get
().
endpointurl
)
}
}
if
(
queryParams
.
get
().
debugtx
)
{
if
(
queryParams
.
get
().
debugtx
)
{
...
...
src/app/execution-context.js
View file @
f0d18b86
...
@@ -86,28 +86,24 @@ function ExecutionContext () {
...
@@ -86,28 +86,24 @@ function ExecutionContext () {
return
vm
return
vm
}
}
this
.
setEndPointUrl
=
function
(
url
)
{
this
.
setContext
=
function
(
context
,
endPointUrl
)
{
setProviderFromEndpoint
(
url
)
}
this
.
setContext
=
function
(
context
,
alert
)
{
executionContext
=
context
executionContext
=
context
executionContextChange
(
context
,
alert
)
executionContextChange
(
context
,
endPointUrl
)
}
}
function
executionContextChange
(
context
,
alert
)
{
function
executionContextChange
(
context
,
endPointUrl
)
{
if
(
alert
&&
context
===
'web3'
&&
!
confirm
(
'Are you sure you want to connect to a loc
al ethereum node?'
))
{
if
(
context
===
'web3'
&&
!
confirm
(
'Are you sure you want to connect to an extern
al ethereum node?'
))
{
return
false
return
false
}
else
if
(
context
===
'injected'
&&
injectedProvider
===
undefined
)
{
}
else
if
(
context
===
'injected'
&&
injectedProvider
===
undefined
)
{
return
false
return
false
}
else
{
}
else
{
if
(
context
===
'web3'
)
{
if
(
context
===
'web3'
)
{
executionContext
=
context
executionContext
=
context
var
endPoint
=
'http://localhost:8545'
if
(
!
endPointUrl
)
{
if
(
alert
)
{
endPointUrl
=
'http://localhost:8545'
endPoint
=
prompt
(
'Please type Web3 Provider Endpoint'
,
endPoint
)
}
}
setProviderFromEndpoint
(
endPoint
)
endPointUrl
=
prompt
(
'Web3 Provider Endpoint'
,
endPointUrl
)
setProviderFromEndpoint
(
endPointUrl
)
self
.
event
.
trigger
(
'contextChanged'
,
[
'web3'
])
self
.
event
.
trigger
(
'contextChanged'
,
[
'web3'
])
}
else
if
(
context
===
'injected'
)
{
}
else
if
(
context
===
'injected'
)
{
executionContext
=
context
executionContext
=
context
...
@@ -139,7 +135,7 @@ function ExecutionContext () {
...
@@ -139,7 +135,7 @@ function ExecutionContext () {
var
selectExEnv
=
document
.
querySelector
(
'#selectExEnv'
)
var
selectExEnv
=
document
.
querySelector
(
'#selectExEnv'
)
selectExEnv
.
addEventListener
(
'change'
,
function
(
event
)
{
selectExEnv
.
addEventListener
(
'change'
,
function
(
event
)
{
if
(
!
executionContextChange
(
selectExEnv
.
options
[
selectExEnv
.
selectedIndex
].
value
,
true
))
{
if
(
!
executionContextChange
(
selectExEnv
.
options
[
selectExEnv
.
selectedIndex
].
value
))
{
selectExEnv
.
value
=
executionContext
selectExEnv
.
value
=
executionContext
}
}
})
})
...
...
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