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
7d5cfbb9
Commit
7d5cfbb9
authored
Jun 04, 2017
by
ninabreznik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed vmin to em for font-size
parent
4a2c8139
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
33 deletions
+32
-33
universal-dapp.css
assets/css/universal-dapp.css
+2
-4
editor.js
src/app/editor.js
+1
-1
universal-dapp.js
src/universal-dapp.js
+29
-28
No files found.
assets/css/universal-dapp.css
View file @
7d5cfbb9
...
@@ -80,11 +80,9 @@
...
@@ -80,11 +80,9 @@
}
}
.udapp
.output
.result
.debugTx
{
.udapp
.output
.result
.debugTx
{
position
:
absolute
;
top
:
0.4em
;
right
:
1.4em
;
height
:
1.5em
;
height
:
1.5em
;
width
:
2.5em
;
width
:
2.5em
;
margin-top
:
1em
;
}
}
.udapp
.output
.result
:last-child
{
.udapp
.output
.result
:last-child
{
...
@@ -202,7 +200,7 @@
...
@@ -202,7 +200,7 @@
}
}
.udapp
.contractProperty
button
.debug
{
.udapp
.contractProperty
button
.debug
{
width
:
21px
;
width
:
12em
;
}
}
.udapp
.contractProperty
button
:disabled
{
.udapp
.contractProperty
button
:disabled
{
...
...
src/app/editor.js
View file @
7d5cfbb9
...
@@ -19,7 +19,7 @@ var css = csjs`
...
@@ -19,7 +19,7 @@ var css = csjs`
}
}
.ace-editor {
.ace-editor {
top : 4px;
top : 4px;
font-size :
2vmin
;
font-size :
1.1em
;
width : 100%;
width : 100%;
}
}
`
`
...
...
src/universal-dapp.js
View file @
7d5cfbb9
...
@@ -281,25 +281,27 @@ UniversalDApp.prototype.getContractByName = function (contractName) {
...
@@ -281,25 +281,27 @@ UniversalDApp.prototype.getContractByName = function (contractName) {
UniversalDApp
.
prototype
.
getCreateInterface
=
function
(
$container
,
contract
)
{
UniversalDApp
.
prototype
.
getCreateInterface
=
function
(
$container
,
contract
)
{
var
self
=
this
var
self
=
this
var
$createInterface
=
$
(
'<div class="create"/>'
)
var
createInterface
=
yo
`<div class="create"></div>`
if
(
self
.
options
.
removable
)
{
if
(
self
.
options
.
removable
)
{
var
$close
=
$
(
'<div class="udapp-close" />'
)
var
close
=
yo
`<div class="udapp-close" onclick=
${
remove
}
></div>`
$close
.
click
(
function
()
{
self
.
$el
.
remove
()
})
function
remove
()
{
$createInterface
.
append
(
$close
)
self
.
$el
.
remove
()
}
createInterface
.
appendChild
(
close
)
}
}
var
$publishButton
=
$
(
`<button class="publishContract"/>`
).
text
(
'Publish'
).
click
(
function
()
{
self
.
event
.
trigger
(
'publishContract'
,
[
contract
])
})
var
$publishButton
=
$
(
`<button class="publishContract"/>`
).
text
(
'Publish'
).
click
(
function
()
{
self
.
event
.
trigger
(
'publishContract'
,
[
contract
])
})
$createInterface
.
append
(
$publishButton
)
createInterface
.
appendChild
(
$publishButton
.
get
(
0
)
)
var
$atButton
=
$
(
'<button class="atAddress"/>'
).
text
(
'At Address'
).
click
(
function
()
{
self
.
clickContractAt
(
self
,
$container
.
find
(
'.createContract'
),
contract
)
})
var
$atButton
=
$
(
'<button class="atAddress"/>'
).
text
(
'At Address'
).
click
(
function
()
{
self
.
clickContractAt
(
self
,
$container
.
find
(
'.createContract'
),
contract
)
})
$createInterface
.
append
(
$atButton
)
createInterface
.
appendChild
(
$atButton
.
get
(
0
)
)
var
$newButton
=
self
.
getInstanceInterface
(
contract
)
var
$newButton
=
self
.
getInstanceInterface
(
contract
)
if
(
!
$newButton
)
{
if
(
!
$newButton
)
{
return
$
createInterface
return
createInterface
}
}
$createInterface
.
appen
d
(
$newButton
)
createInterface
.
appendChil
d
(
$newButton
)
// Only display creation interface for non-abstract contracts.
// Only display creation interface for non-abstract contracts.
// FIXME: maybe have a flag for this in the JSON?
// FIXME: maybe have a flag for this in the JSON?
...
@@ -318,7 +320,7 @@ UniversalDApp.prototype.getCreateInterface = function ($container, contract) {
...
@@ -318,7 +320,7 @@ UniversalDApp.prototype.getCreateInterface = function ($container, contract) {
$publishButton
.
attr
(
'title'
,
'This contract does not implement all functions and thus cannot be published.'
)
$publishButton
.
attr
(
'title'
,
'This contract does not implement all functions and thus cannot be published.'
)
}
}
return
$
createInterface
return
createInterface
}
}
UniversalDApp
.
prototype
.
getInstanceInterface
=
function
(
contract
,
address
,
$target
)
{
UniversalDApp
.
prototype
.
getInstanceInterface
=
function
(
contract
,
address
,
$target
)
{
...
@@ -342,14 +344,14 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
...
@@ -342,14 +344,14 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
return
return
}
}
var
$createInterface
=
$
(
'<div class="createContract"/>'
)
var
createInterface
=
yo
`<div class="createContract"></div>`
var
appendFunctions
=
function
(
address
,
$el
)
{
var
appendFunctions
=
function
(
address
,
$el
)
{
var
$instance
=
$
(
`<div class="instance
${
cssInstance
.
instance
}
"/>`
)
var
$instance
=
$
(
`<div class="instance
${
cssInstance
.
instance
}
"/>`
)
if
(
self
.
options
.
removable_instances
)
{
if
(
self
.
options
.
removable_instances
)
{
var
$close
=
$
(
'<div class="udapp-close" />'
)
var
close
=
yo
`<div class="udapp-close" onclick=
${
remove
}
></div>`
$close
.
click
(
function
()
{
$instance
.
remove
()
})
function
remove
()
{
$instance
.
remove
()
}
$instance
.
append
(
$
close
)
$instance
.
get
(
0
).
appendChild
(
close
)
}
}
var
context
=
self
.
executionContext
.
isVM
()
?
'memory'
:
'blockchain'
var
context
=
self
.
executionContext
.
isVM
()
?
'memory'
:
'blockchain'
...
@@ -379,13 +381,12 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
...
@@ -379,13 +381,12 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
var
$event
=
$
(
'<div class="event" />'
)
var
$event
=
$
(
'<div class="event" />'
)
var
$close
=
$
(
'<div class="udapp-close" />'
)
var
close
=
yo
`<div class="udapp-close" onclick=
${
remove
}
></div>`
$close
.
click
(
function
()
{
$event
.
remove
()
})
function
remove
()
{
$event
.
remove
()
}
$event
.
append
(
$
(
'<span class="name"/>'
).
text
(
response
.
event
))
$event
.
append
(
$
(
'<span class="name"/>'
).
text
(
response
.
event
))
.
append
(
$
(
'<span class="args" />'
).
text
(
JSON
.
stringify
(
response
.
args
,
null
,
2
)))
.
append
(
$
(
'<span class="args" />'
).
text
(
JSON
.
stringify
(
response
.
args
,
null
,
2
)))
.
append
(
$close
)
$event
.
get
(
0
).
appendChild
(
close
)
$events
.
append
(
$event
)
$events
.
append
(
$event
)
}
}
...
@@ -461,12 +462,12 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
...
@@ -461,12 +462,12 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
}))
}))
})
})
$el
=
$el
||
$
createInterface
$el
=
$el
||
createInterface
$el
.
append
(
$instance
.
append
(
$events
))
$el
.
append
Child
(
$instance
.
append
(
$events
).
get
(
0
))
}
}
if
(
!
address
||
!
$target
)
{
if
(
!
address
||
!
$target
)
{
$createInterface
.
appen
d
(
self
.
getCallButton
({
createInterface
.
appendChil
d
(
self
.
getCallButton
({
abi
:
funABI
,
abi
:
funABI
,
encode
:
function
(
args
)
{
encode
:
function
(
args
)
{
var
types
=
[]
var
types
=
[]
...
@@ -481,12 +482,12 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
...
@@ -481,12 +482,12 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
contractName
:
contract
.
name
,
contractName
:
contract
.
name
,
bytecode
:
contract
.
bytecode
,
bytecode
:
contract
.
bytecode
,
appendFunctions
:
appendFunctions
appendFunctions
:
appendFunctions
}))
})
.
get
(
0
)
)
}
else
{
}
else
{
appendFunctions
(
address
,
$target
)
appendFunctions
(
address
,
$target
)
}
}
return
$
createInterface
return
createInterface
}
}
UniversalDApp
.
prototype
.
getConstructorInterface
=
function
(
abi
)
{
UniversalDApp
.
prototype
.
getConstructorInterface
=
function
(
abi
)
{
...
@@ -535,7 +536,7 @@ UniversalDApp.prototype.getCallButton = function (args) {
...
@@ -535,7 +536,7 @@ UniversalDApp.prototype.getCallButton = function (args) {
var
getDebugTransaction
=
function
(
result
)
{
var
getDebugTransaction
=
function
(
result
)
{
var
$debugTx
=
$
(
'<div class="debugTx">'
)
var
$debugTx
=
$
(
'<div class="debugTx">'
)
var
$button
=
$
(
'<button title="Launch Debugger" class="debug"><i class="fa fa-bug"></i></button>'
)
var
$button
=
$
(
'<button title="Launch Debugger" class="debug"><i class="fa fa-bug"></i>
Launch debugger
</button>'
)
$button
.
click
(
function
()
{
$button
.
click
(
function
()
{
self
.
event
.
trigger
(
'debugRequested'
,
[
result
])
self
.
event
.
trigger
(
'debugRequested'
,
[
result
])
})
})
...
@@ -545,7 +546,7 @@ UniversalDApp.prototype.getCallButton = function (args) {
...
@@ -545,7 +546,7 @@ UniversalDApp.prototype.getCallButton = function (args) {
var
getDebugCall
=
function
(
result
)
{
var
getDebugCall
=
function
(
result
)
{
var
$debugTx
=
$
(
'<div class="debugCall">'
)
var
$debugTx
=
$
(
'<div class="debugCall">'
)
var
$button
=
$
(
'<button title="Launch Debugger" class="debug"><i class="fa fa-bug"></i></button>'
)
var
$button
=
$
(
'<button title="Launch Debugger" class="debug"><i class="fa fa-bug"></i>
Launch debugger
</button>'
)
$button
.
click
(
function
()
{
$button
.
click
(
function
()
{
self
.
event
.
trigger
(
'debugRequested'
,
[
result
])
self
.
event
.
trigger
(
'debugRequested'
,
[
result
])
})
})
...
@@ -554,7 +555,7 @@ UniversalDApp.prototype.getCallButton = function (args) {
...
@@ -554,7 +555,7 @@ UniversalDApp.prototype.getCallButton = function (args) {
}
}
var
getGasUsedOutput
=
function
(
result
,
vmResult
)
{
var
getGasUsedOutput
=
function
(
result
,
vmResult
)
{
var
$gasUsed
=
$
(
'<div class="gasUsed">'
)
var
$gasUsed
=
$
(
'<div class="gasUsed">
</div>
'
)
var
caveat
=
lookupOnly
?
'<em>(<span class="caveat" title="Cost only applies when called by a contract">caveat</span>)</em>'
:
''
var
caveat
=
lookupOnly
?
'<em>(<span class="caveat" title="Cost only applies when called by a contract">caveat</span>)</em>'
:
''
var
gas
var
gas
if
(
result
.
gasUsed
)
{
if
(
result
.
gasUsed
)
{
...
@@ -585,9 +586,9 @@ UniversalDApp.prototype.getCallButton = function (args) {
...
@@ -585,9 +586,9 @@ UniversalDApp.prototype.getCallButton = function (args) {
var
getOutput
=
function
()
{
var
getOutput
=
function
()
{
var
$result
=
$
(
'<div class="result" />'
)
var
$result
=
$
(
'<div class="result" />'
)
var
$close
=
$
(
'<div class="udapp-close" />'
)
var
close
=
yo
`<div class="udapp-close" onclick=
${
remove
}
></div>`
$close
.
click
(
function
()
{
$result
.
remove
()
})
function
remove
()
{
$result
.
remove
()
}
$result
.
append
(
$
close
)
$result
.
get
(
0
).
appendChild
(
close
)
return
$result
return
$result
}
}
var
clearOutput
=
function
(
$result
)
{
var
clearOutput
=
function
(
$result
)
{
...
...
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