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
1309e093
Commit
1309e093
authored
Sep 04, 2017
by
Rob Stupay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaner version of #747
parent
dd6a7a85
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
7 deletions
+18
-7
app.js
src/app.js
+9
-2
run-tab.js
src/app/tabs/run-tab.js
+1
-0
universal-dapp.js
src/universal-dapp.js
+8
-5
No files found.
src/app.js
View file @
1309e093
...
@@ -343,8 +343,12 @@ function run () {
...
@@ -343,8 +343,12 @@ function run () {
}
}
var
udapp
=
new
UniversalDApp
({
var
udapp
=
new
UniversalDApp
({
removable
:
false
,
api
:
{
removable_instances
:
true
logMessage
:
(
msg
)
=>
{
self
.
_components
.
editorpanel
.
log
({
type
:
'log'
,
value
:
msg
})
}
},
opt
:
{
removable
:
false
,
removable_instances
:
true
}
})
})
udapp
.
reset
({},
transactionContextAPI
)
udapp
.
reset
({},
transactionContextAPI
)
udapp
.
event
.
register
(
'debugRequested'
,
this
,
function
(
txResult
)
{
udapp
.
event
.
register
(
'debugRequested'
,
this
,
function
(
txResult
)
{
...
@@ -402,6 +406,9 @@ function run () {
...
@@ -402,6 +406,9 @@ function run () {
},
},
runCompiler
:
()
=>
{
runCompiler
:
()
=>
{
runCompiler
()
runCompiler
()
},
logMessage
:
(
msg
)
=>
{
self
.
_components
.
editorpanel
.
log
({
type
:
'log'
,
value
:
msg
})
}
}
}
}
var
rhpEvents
=
{
var
rhpEvents
=
{
...
...
src/app/tabs/run-tab.js
View file @
1309e093
...
@@ -300,6 +300,7 @@ function contractDropdown (appAPI, appEvents, instanceContainer) {
...
@@ -300,6 +300,7 @@ function contractDropdown (appAPI, appEvents, instanceContainer) {
var
args
=
createButtonInput
.
value
var
args
=
createButtonInput
.
value
txFormat
.
buildData
(
contract
,
contracts
,
true
,
constructor
,
args
,
appAPI
.
udapp
(),
(
error
,
data
)
=>
{
txFormat
.
buildData
(
contract
,
contracts
,
true
,
constructor
,
args
,
appAPI
.
udapp
(),
(
error
,
data
)
=>
{
if
(
!
error
)
{
if
(
!
error
)
{
appAPI
.
logMessage
(
'transaction added ...'
)
txExecution
.
createContract
(
data
,
appAPI
.
udapp
(),
(
error
,
txResult
)
=>
{
txExecution
.
createContract
(
data
,
appAPI
.
udapp
(),
(
error
,
txResult
)
=>
{
if
(
!
error
)
{
if
(
!
error
)
{
var
isVM
=
executionContext
.
isVM
()
var
isVM
=
executionContext
.
isVM
()
...
...
src/universal-dapp.js
View file @
1309e093
...
@@ -96,13 +96,16 @@ var css = csjs`
...
@@ -96,13 +96,16 @@ var css = csjs`
/*
/*
trigger debugRequested
trigger debugRequested
*/
*/
function
UniversalDApp
(
opt
ions
)
{
function
UniversalDApp
(
opt
s
=
{}
)
{
this
.
event
=
new
EventManager
()
this
.
event
=
new
EventManager
()
var
self
=
this
var
self
=
this
self
.
options
=
options
||
{}
self
.
_api
=
opts
.
api
self
.
removable
=
opts
.
opt
.
removable
self
.
removable_instance
=
opts
.
opt
.
removable_instance
// self.options = options || {}
self
.
el
=
yo
`<div class="udapp"></div>`
self
.
el
=
yo
`<div class="udapp"></div>`
self
.
personalMode
=
self
.
options
.
personalMode
||
false
self
.
personalMode
=
opts
.
opt
.
personalMode
||
false
self
.
contracts
self
.
contracts
self
.
transactionContextAPI
self
.
transactionContextAPI
executionContext
.
event
.
register
(
'contextChanged'
,
this
,
function
(
context
)
{
executionContext
.
event
.
register
(
'contextChanged'
,
this
,
function
(
context
)
{
...
@@ -229,8 +232,7 @@ UniversalDApp.prototype.renderInstance = function (contract, address, contractNa
...
@@ -229,8 +232,7 @@ UniversalDApp.prototype.renderInstance = function (contract, address, contractNa
<div class="
${
css
.
titleText
}
">
${
contractName
}
at
${
shortAddress
}
(
${
context
}
) </div>
<div class="
${
css
.
titleText
}
">
${
contractName
}
at
${
shortAddress
}
(
${
context
}
) </div>
<i class="fa fa-clipboard
${
css
.
copy
}
" aria-hidden="true" onclick=
${
copyToClipboard
}
title='Copy to clipboard'></i>
<i class="fa fa-clipboard
${
css
.
copy
}
" aria-hidden="true" onclick=
${
copyToClipboard
}
title='Copy to clipboard'></i>
</div>`
</div>`
if
(
this
.
removable_instance
)
{
if
(
this
.
options
.
removable_instances
)
{
var
close
=
yo
`<div class="
${
css
.
udappClose
}
" onclick=
${
remove
}
><i class="
${
css
.
closeIcon
}
fa fa-close" aria-hidden="true"></i></div>`
var
close
=
yo
`<div class="
${
css
.
udappClose
}
" onclick=
${
remove
}
><i class="
${
css
.
closeIcon
}
fa fa-close" aria-hidden="true"></i></div>`
title
.
appendChild
(
close
)
title
.
appendChild
(
close
)
}
}
...
@@ -308,6 +310,7 @@ UniversalDApp.prototype.getCallButton = function (args) {
...
@@ -308,6 +310,7 @@ UniversalDApp.prototype.getCallButton = function (args) {
if
(
!
error
)
{
if
(
!
error
)
{
txExecution
.
callFunction
(
args
.
address
,
data
,
args
.
funABI
,
self
,
(
error
,
txResult
)
=>
{
txExecution
.
callFunction
(
args
.
address
,
data
,
args
.
funABI
,
self
,
(
error
,
txResult
)
=>
{
if
(
!
error
)
{
if
(
!
error
)
{
self
.
_api
.
logMessage
(
'UDApp transaction added ...'
)
var
isVM
=
executionContext
.
isVM
()
var
isVM
=
executionContext
.
isVM
()
if
(
isVM
)
{
if
(
isVM
)
{
var
vmError
=
txExecution
.
checkVMError
(
txResult
)
var
vmError
=
txExecution
.
checkVMError
(
txResult
)
...
...
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