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
c6787528
Commit
c6787528
authored
Apr 18, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not alert user if config set from the url param
parent
ca2f8910
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
18 deletions
+17
-18
app.js
src/app.js
+5
-3
execution-context.js
src/app/execution-context.js
+12
-15
No files found.
src/app.js
View file @
c6787528
...
...
@@ -898,12 +898,14 @@ var run = function () {
setVersionText
(
version
)
runCompiler
()
if
(
queryParams
.
get
().
context
)
{
executionContext
.
setContext
(
queryParams
.
get
().
context
,
false
)
}
if
(
queryParams
.
get
().
endpointurl
)
{
executionContext
.
setEndPointUrl
(
queryParams
.
get
().
endpointurl
)
}
if
(
queryParams
.
get
().
context
)
{
executionContext
.
setContext
(
queryParams
.
get
().
context
)
}
if
(
queryParams
.
get
().
debugtx
)
{
startdebugging
(
queryParams
.
get
().
debugtx
)
}
...
...
src/app/execution-context.js
View file @
c6787528
...
...
@@ -88,31 +88,27 @@ function ExecutionContext () {
}
this
.
setEndPointUrl
=
function
(
url
)
{
$web3endpoint
.
val
(
url
)
setProviderFromEndpoint
(
url
)
}
this
.
setContext
=
function
(
context
)
{
this
.
setContext
=
function
(
context
,
alert
)
{
executionContext
=
context
executionContextChange
(
context
)
executionContextChange
(
context
,
alert
)
}
var
$web3endpoint
=
$
(
'#web3Endpoint'
)
if
(
web3
.
providers
&&
web3
.
currentProvider
instanceof
web3
.
providers
.
IpcProvider
)
{
$web3endpoint
.
val
(
'ipc'
)
}
function
executionContextChange
(
context
)
{
if
(
context
===
'web3'
&&
!
confirm
(
'Are you sure you want to connect to a local ethereum node?'
))
{
function
executionContextChange
(
context
,
alert
)
{
if
(
alert
&&
context
===
'web3'
&&
!
confirm
(
'Are you sure you want to connect to a local ethereum node?'
))
{
return
false
}
else
if
(
context
===
'injected'
&&
injectedProvider
===
undefined
)
{
return
false
}
else
{
if
(
context
===
'web3'
)
{
executionContext
=
context
var
endpoint
=
prompt
(
'Please type Web3 Provider Endpoint'
,
'http://localhost:8545'
)
setProviderFromEndpoint
(
endpoint
)
self
.
event
.
trigger
(
'web3EndpointChanged'
)
var
endPoint
=
'http://localhost:8545'
if
(
alert
)
{
endPoint
=
prompt
(
'Please type Web3 Provider Endpoint'
,
endPoint
)
}
setProviderFromEndpoint
(
endPoint
)
self
.
event
.
trigger
(
'contextChanged'
,
[
'web3'
])
}
else
if
(
context
===
'injected'
)
{
executionContext
=
context
...
...
@@ -135,6 +131,7 @@ function ExecutionContext () {
}
else
{
web3
.
setProvider
(
new
web3
.
providers
.
HttpProvider
(
endpoint
))
}
self
.
event
.
trigger
(
'web3EndpointChanged'
)
}
/* ---------------------------------------------------------------------------
...
...
@@ -143,7 +140,7 @@ function ExecutionContext () {
var
selectExEnv
=
document
.
querySelector
(
'#selectExEnv'
)
selectExEnv
.
addEventListener
(
'change'
,
function
(
event
)
{
if
(
!
executionContextChange
(
selectExEnv
.
options
[
selectExEnv
.
selectedIndex
].
value
))
{
if
(
!
executionContextChange
(
selectExEnv
.
options
[
selectExEnv
.
selectedIndex
].
value
,
true
))
{
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