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
aee8ae83
Commit
aee8ae83
authored
Jan 11, 2019
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove _deps
parent
d5c6c7b8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
45 deletions
+29
-45
app.js
src/app.js
+11
-1
run-tab.js
src/app/tabs/run-tab.js
+18
-44
No files found.
src/app.js
View file @
aee8ae83
...
@@ -423,7 +423,17 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -423,7 +423,17 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
let
compileTab
=
new
CompileTab
(
self
.
_components
.
registry
)
let
compileTab
=
new
CompileTab
(
self
.
_components
.
registry
)
let
tabs
=
{
let
tabs
=
{
compile
:
compileTab
,
compile
:
compileTab
,
run
:
new
RunTab
(
self
.
_components
.
registry
),
run
:
new
RunTab
(
registry
.
get
(
'udapp'
).
api
,
registry
.
get
(
'udappUI'
).
api
,
registry
.
get
(
'config'
).
api
,
registry
.
get
(
'filemanager'
).
api
,
registry
.
get
(
'editor'
).
api
,
registry
.
get
(
'logCallback'
).
api
,
registry
.
get
(
'filepanel'
).
api
,
registry
.
get
(
'pluginmanager'
).
api
,
registry
.
get
(
'compilersartefacts'
).
api
),
settings
:
new
SettingsTab
(
self
.
_components
.
registry
),
settings
:
new
SettingsTab
(
self
.
_components
.
registry
),
analysis
:
new
AnalysisTab
(
self
.
_components
.
registry
),
analysis
:
new
AnalysisTab
(
self
.
_components
.
registry
),
debug
:
new
DebuggerTab
(
self
.
_components
.
registry
),
debug
:
new
DebuggerTab
(
self
.
_components
.
registry
),
...
...
src/app/tabs/run-tab.js
View file @
aee8ae83
...
@@ -17,18 +17,14 @@ var RecorderUI = require('./runTab/recorder.js')
...
@@ -17,18 +17,14 @@ var RecorderUI = require('./runTab/recorder.js')
class
RunTab
{
class
RunTab
{
constructor
()
{
constructor
(
udapp
,
udappUI
,
config
,
fileManager
,
editor
,
logCallback
,
filePanel
,
pluginManager
,
compilersArtefacts
)
{
var
self
=
this
var
self
=
this
self
.
event
=
new
EventManager
()
this
.
event
=
new
EventManager
()
self
.
_view
=
{}
self
.
data
=
{
this
.
_view
=
{}
count
:
0
,
this
.
registry
=
globalRegistry
text
:
`All transactions (deployed contracts and function executions) in this environment can be saved and replayed in
another environment. e.g Transactions created in Javascript VM can be replayed in the Injected Web3.`
this
.
transactionContextAPI
=
{
}
self
.
_components
=
{}
self
.
_components
.
registry
=
globalRegistry
self
.
_components
.
transactionContextAPI
=
{
getAddress
:
(
cb
)
=>
{
getAddress
:
(
cb
)
=>
{
cb
(
null
,
$
(
'#txorigin'
).
val
())
cb
(
null
,
$
(
'#txorigin'
).
val
())
},
},
...
@@ -51,19 +47,7 @@ class RunTab {
...
@@ -51,19 +47,7 @@ class RunTab {
cb
(
null
,
$
(
'#gasLimit'
).
val
())
cb
(
null
,
$
(
'#gasLimit'
).
val
())
}
}
}
}
// dependencies
udapp
.
resetAPI
(
this
.
transactionContextAPI
)
self
.
_deps
=
{
udapp
:
self
.
_components
.
registry
.
get
(
'udapp'
).
api
,
udappUI
:
self
.
_components
.
registry
.
get
(
'udappUI'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
fileManager
:
self
.
_components
.
registry
.
get
(
'filemanager'
).
api
,
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
,
logCallback
:
self
.
_components
.
registry
.
get
(
'logCallback'
).
api
,
filePanel
:
self
.
_components
.
registry
.
get
(
'filepanel'
).
api
,
pluginManager
:
self
.
_components
.
registry
.
get
(
'pluginmanager'
).
api
,
compilersArtefacts
:
self
.
_components
.
registry
.
get
(
'compilersartefacts'
).
api
}
self
.
_deps
.
udapp
.
resetAPI
(
self
.
_components
.
transactionContextAPI
)
self
.
_view
.
recorderCount
=
yo
`<span>0</span>`
self
.
_view
.
recorderCount
=
yo
`<span>0</span>`
self
.
_view
.
instanceContainer
=
yo
`<div class="
${
css
.
instanceContainer
}
"></div>`
self
.
_view
.
instanceContainer
=
yo
`<div class="
${
css
.
instanceContainer
}
"></div>`
self
.
_view
.
clearInstanceElement
=
yo
`
self
.
_view
.
clearInstanceElement
=
yo
`
...
@@ -83,24 +67,22 @@ class RunTab {
...
@@ -83,24 +67,22 @@ class RunTab {
var
container
=
yo
`<div class="
${
css
.
runTabView
}
" id="runTabView" ></div>`
var
container
=
yo
`<div class="
${
css
.
runTabView
}
" id="runTabView" ></div>`
var
recorder
=
new
Recorder
(
self
.
_deps
.
udapp
,
self
.
_deps
.
fileManager
,
self
.
_deps
.
config
)
var
recorder
=
new
Recorder
(
udapp
,
fileManager
,
config
)
recorder
.
event
.
register
(
'newTxRecorded'
,
(
count
)
=>
{
recorder
.
event
.
register
(
'newTxRecorded'
,
(
count
)
=>
{
this
.
data
.
count
=
count
this
.
_view
.
recorderCount
.
innerText
=
count
this
.
_view
.
recorderCount
.
innerText
=
count
})
})
recorder
.
event
.
register
(
'cleared'
,
()
=>
{
recorder
.
event
.
register
(
'cleared'
,
()
=>
{
this
.
data
.
count
=
0
this
.
_view
.
recorderCount
.
innerText
=
0
this
.
_view
.
recorderCount
.
innerText
=
0
})
})
executionContext
.
event
.
register
(
'contextChanged'
,
recorder
.
clearAll
.
bind
(
recorder
))
executionContext
.
event
.
register
(
'contextChanged'
,
recorder
.
clearAll
.
bind
(
recorder
))
self
.
event
.
register
(
'clearInstance'
,
recorder
.
clearAll
.
bind
(
recorder
))
self
.
event
.
register
(
'clearInstance'
,
recorder
.
clearAll
.
bind
(
recorder
))
var
recorderInterface
=
new
RecorderUI
(
recorder
,
self
.
_deps
.
logCallback
)
var
recorderInterface
=
new
RecorderUI
(
recorder
,
logCallback
)
recorderInterface
.
event
.
register
(
'newScenario'
,
(
abi
,
address
,
contractName
)
=>
{
recorderInterface
.
event
.
register
(
'newScenario'
,
(
abi
,
address
,
contractName
)
=>
{
var
noInstancesText
=
this
.
_view
.
noInstancesText
var
noInstancesText
=
this
.
_view
.
noInstancesText
if
(
noInstancesText
.
parentNode
)
{
noInstancesText
.
parentNode
.
removeChild
(
noInstancesText
)
}
if
(
noInstancesText
.
parentNode
)
{
noInstancesText
.
parentNode
.
removeChild
(
noInstancesText
)
}
this
.
_view
.
instanceContainer
.
appendChild
(
this
.
_deps
.
udappUI
.
renderInstanceFromABI
(
abi
,
address
,
contractName
))
this
.
_view
.
instanceContainer
.
appendChild
(
udappUI
.
renderInstanceFromABI
(
abi
,
address
,
contractName
))
})
})
recorderInterface
.
render
()
recorderInterface
.
render
()
...
@@ -113,7 +95,8 @@ class RunTab {
...
@@ -113,7 +95,8 @@ class RunTab {
self
.
_view
.
expandedView
=
yo
`
self
.
_view
.
expandedView
=
yo
`
<div class=
${
css
.
recorderExpandedView
}
>
<div class=
${
css
.
recorderExpandedView
}
>
<div class=
${
css
.
recorderDescription
}
>
<div class=
${
css
.
recorderDescription
}
>
${
self
.
data
.
text
}
All transactions (deployed contracts and function executions) in this environment can be saved and replayed in
another environment. e.g Transactions created in Javascript VM can be replayed in the Injected Web3.
</div>
</div>
<div class="
${
css
.
transactionActions
}
">
<div class="
${
css
.
transactionActions
}
">
${
recorderInterface
.
recordButton
}
${
recorderInterface
.
recordButton
}
...
@@ -139,7 +122,7 @@ class RunTab {
...
@@ -139,7 +122,7 @@ class RunTab {
}
}
})
})
var
settings
=
new
Settings
(
self
.
_deps
.
udapp
)
var
settings
=
new
Settings
(
udapp
)
var
settingsUI
=
new
SettingsUI
(
settings
)
var
settingsUI
=
new
SettingsUI
(
settings
)
self
.
event
.
register
(
'clearInstance'
,
()
=>
{
self
.
event
.
register
(
'clearInstance'
,
()
=>
{
...
@@ -151,27 +134,18 @@ class RunTab {
...
@@ -151,27 +134,18 @@ class RunTab {
this
.
event
.
trigger
(
'clearInstance'
,
[])
this
.
event
.
trigger
(
'clearInstance'
,
[])
})
})
var
dropdownLogic
=
new
DropdownLogic
(
var
dropdownLogic
=
new
DropdownLogic
(
fileManager
,
pluginManager
,
compilersArtefacts
,
null
,
config
,
editor
,
udapp
,
filePanel
)
this
.
_deps
.
fileManager
,
var
contractDropdownUI
=
new
ContractDropdownUI
(
dropdownLogic
,
logCallback
)
this
.
_deps
.
pluginManager
,
this
.
_deps
.
compilersArtefacts
,
this
.
_deps
.
compiler
,
this
.
_deps
.
config
,
this
.
_deps
.
editor
,
this
.
_deps
.
udapp
,
this
.
_deps
.
filePanel
)
var
contractDropdownUI
=
new
ContractDropdownUI
(
dropdownLogic
,
this
.
_deps
.
logCallback
)
contractDropdownUI
.
event
.
register
(
'clearInstance'
,
()
=>
{
contractDropdownUI
.
event
.
register
(
'clearInstance'
,
()
=>
{
var
noInstancesText
=
this
.
_view
.
noInstancesText
var
noInstancesText
=
this
.
_view
.
noInstancesText
if
(
noInstancesText
.
parentNode
)
{
noInstancesText
.
parentNode
.
removeChild
(
noInstancesText
)
}
if
(
noInstancesText
.
parentNode
)
{
noInstancesText
.
parentNode
.
removeChild
(
noInstancesText
)
}
})
})
contractDropdownUI
.
event
.
register
(
'newContractABIAdded'
,
(
abi
,
address
)
=>
{
contractDropdownUI
.
event
.
register
(
'newContractABIAdded'
,
(
abi
,
address
)
=>
{
this
.
_view
.
instanceContainer
.
appendChild
(
this
.
_deps
.
udappUI
.
renderInstanceFromABI
(
abi
,
address
,
address
))
this
.
_view
.
instanceContainer
.
appendChild
(
udappUI
.
renderInstanceFromABI
(
abi
,
address
,
address
))
})
})
contractDropdownUI
.
event
.
register
(
'newContractInstanceAdded'
,
(
contractObject
,
address
,
value
)
=>
{
contractDropdownUI
.
event
.
register
(
'newContractInstanceAdded'
,
(
contractObject
,
address
,
value
)
=>
{
this
.
_view
.
instanceContainer
.
appendChild
(
this
.
_deps
.
udappUI
.
renderInstance
(
contractObject
,
address
,
value
))
this
.
_view
.
instanceContainer
.
appendChild
(
udappUI
.
renderInstance
(
contractObject
,
address
,
value
))
})
})
this
.
_view
.
instanceContainer
.
appendChild
(
this
.
_view
.
instanceContainerTitle
)
this
.
_view
.
instanceContainer
.
appendChild
(
this
.
_view
.
instanceContainerTitle
)
...
...
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