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
f303e7f7
Commit
f303e7f7
authored
Apr 19, 2017
by
yann300
Committed by
GitHub
Apr 19, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #519 from ethereum/dontalertifparamsetinurl
Do not alert user if config set from the url param
parents
ca2f8910
29cc9884
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
22 deletions
+12
-22
app.js
src/app.js
+2
-4
execution-context.js
src/app/execution-context.js
+10
-18
No files found.
src/app.js
View file @
f303e7f7
...
...
@@ -898,12 +898,10 @@ var run = function () {
setVersionText
(
version
)
runCompiler
()
if
(
queryParams
.
get
().
endpointurl
)
{
executionContext
.
setEndPointUrl
(
queryParams
.
get
().
endpointurl
)
}
if
(
queryParams
.
get
().
context
)
{
executionContext
.
setContext
(
queryParams
.
get
().
context
)
executionContext
.
setContext
(
queryParams
.
get
().
context
,
queryParams
.
get
().
endpointurl
)
}
if
(
queryParams
.
get
().
debugtx
)
{
startdebugging
(
queryParams
.
get
().
debugtx
)
}
...
...
src/app/execution-context.js
View file @
f303e7f7
/* global confirm, prompt */
'use strict'
var
$
=
require
(
'jquery'
)
var
Web3
=
require
(
'web3'
)
var
EventManager
=
require
(
'../lib/eventManager'
)
var
EthJSVM
=
require
(
'ethereumjs-vm'
)
...
...
@@ -87,32 +86,24 @@ function ExecutionContext () {
return
vm
}
this
.
setEndPointUrl
=
function
(
url
)
{
$web3endpoint
.
val
(
url
)
}
this
.
setContext
=
function
(
context
)
{
this
.
setContext
=
function
(
context
,
endPointUrl
)
{
executionContext
=
context
executionContextChange
(
context
)
}
var
$web3endpoint
=
$
(
'#web3Endpoint'
)
if
(
web3
.
providers
&&
web3
.
currentProvider
instanceof
web3
.
providers
.
IpcProvider
)
{
$web3endpoint
.
val
(
'ipc'
)
executionContextChange
(
context
,
endPointUrl
)
}
function
executionContextChange
(
context
)
{
if
(
context
===
'web3'
&&
!
confirm
(
'Are you sure you want to connect to a
local
ethereum node?'
))
{
function
executionContextChange
(
context
,
endPointUrl
)
{
if
(
context
===
'web3'
&&
!
confirm
(
'Are you sure you want to connect to a
n
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'
)
if
(
!
endPointUrl
)
{
endPointUrl
=
'http://localhost:8545'
}
endPointUrl
=
prompt
(
'Web3 Provider Endpoint'
,
endPointUrl
)
setProviderFromEndpoint
(
endPointUrl
)
self
.
event
.
trigger
(
'contextChanged'
,
[
'web3'
])
}
else
if
(
context
===
'injected'
)
{
executionContext
=
context
...
...
@@ -135,6 +126,7 @@ function ExecutionContext () {
}
else
{
web3
.
setProvider
(
new
web3
.
providers
.
HttpProvider
(
endpoint
))
}
self
.
event
.
trigger
(
'web3EndpointChanged'
)
}
/* ---------------------------------------------------------------------------
...
...
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