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
32d46d5f
Commit
32d46d5f
authored
Aug 28, 2017
by
yann300
Committed by
GitHub
Aug 28, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #705 from ethereum/payableTransact
Remove legend, add info about type (call/payable/not payable, restyle…
parents
eeba72c1
2a7e8164
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
36 deletions
+56
-36
universal-dapp.css
assets/css/universal-dapp.css
+2
-2
app.js
src/app.js
+2
-2
file-panel.js
src/app/panels/file-panel.js
+2
-2
run-tab.js
src/app/tabs/run-tab.js
+42
-28
universal-dapp.js
src/universal-dapp.js
+6
-0
compiling.js
test-browser/tests/compiling.js
+2
-2
No files found.
assets/css/universal-dapp.css
View file @
32d46d5f
...
@@ -216,8 +216,8 @@
...
@@ -216,8 +216,8 @@
}
}
#runTabView
.contractProperty.payable
.call
{
#runTabView
.contractProperty.payable
.call
{
background-color
:
hsla
(
0
,
82%
,
82%
,
.5
);
/* lightR
ed in style-guide.js */
background-color
:
hsla
(
0
,
82%
,
82%
,
1
);
/* r
ed in style-guide.js */
border-color
:
hsla
(
0
,
82%
,
82%
,
.5
);
/* lightR
ed in style-guide.js */
border-color
:
hsla
(
0
,
82%
,
82%
,
1
);
/* r
ed in style-guide.js */
width
:
25%
;
width
:
25%
;
}
}
...
...
src/app.js
View file @
32d46d5f
...
@@ -12,7 +12,7 @@ var OffsetToLineColumnConverter = require('./lib/offsetToLineColumnConverter')
...
@@ -12,7 +12,7 @@ var OffsetToLineColumnConverter = require('./lib/offsetToLineColumnConverter')
var
QueryParams
=
require
(
'./lib/query-params'
)
var
QueryParams
=
require
(
'./lib/query-params'
)
var
GistHandler
=
require
(
'./lib/gist-handler'
)
var
GistHandler
=
require
(
'./lib/gist-handler'
)
var
helper
s
=
require
(
'./lib/helper'
)
var
helper
=
require
(
'./lib/helper'
)
var
Storage
=
require
(
'./storage'
)
var
Storage
=
require
(
'./storage'
)
var
Browserfiles
=
require
(
'./app/files/browser-files'
)
var
Browserfiles
=
require
(
'./app/files/browser-files'
)
var
chromeCloudStorageSync
=
require
(
'./app/files/chromeCloudStorageSync'
)
var
chromeCloudStorageSync
=
require
(
'./app/files/chromeCloudStorageSync'
)
...
@@ -219,7 +219,7 @@ function run () {
...
@@ -219,7 +219,7 @@ function run () {
// Add files received from remote instance (i.e. another browser-solidity)
// Add files received from remote instance (i.e. another browser-solidity)
function
loadFiles
(
filesSet
)
{
function
loadFiles
(
filesSet
)
{
for
(
var
f
in
filesSet
)
{
for
(
var
f
in
filesSet
)
{
filesProviders
[
'browser'
].
set
(
helper
s
.
createNonClashingName
(
f
,
filesProviders
[
'browser'
]),
filesSet
[
f
].
content
)
filesProviders
[
'browser'
].
set
(
helper
.
createNonClashingName
(
f
,
filesProviders
[
'browser'
]),
filesSet
[
f
].
content
)
}
}
fileManager
.
switchFile
()
fileManager
.
switchFile
()
}
}
...
...
src/app/panels/file-panel.js
View file @
32d46d5f
...
@@ -10,7 +10,7 @@ var modalDialog = require('../ui/modaldialog')
...
@@ -10,7 +10,7 @@ var modalDialog = require('../ui/modaldialog')
var
modalDialogCustom
=
require
(
'../ui/modal-dialog-custom'
)
var
modalDialogCustom
=
require
(
'../ui/modal-dialog-custom'
)
var
QueryParams
=
require
(
'../../lib/query-params'
)
var
QueryParams
=
require
(
'../../lib/query-params'
)
var
queryParams
=
new
QueryParams
()
var
queryParams
=
new
QueryParams
()
var
helper
s
=
require
(
'../../lib/helper'
)
var
helper
=
require
(
'../../lib/helper'
)
var
remix
=
require
(
'ethereum-remix'
)
var
remix
=
require
(
'ethereum-remix'
)
var
styleGuide
=
remix
.
ui
.
styleGuide
var
styleGuide
=
remix
.
ui
.
styleGuide
...
@@ -246,7 +246,7 @@ function filepanel (appAPI, filesProvider) {
...
@@ -246,7 +246,7 @@ function filepanel (appAPI, filesProvider) {
}
}
function
createNewFile
()
{
function
createNewFile
()
{
var
newName
=
filesProvider
[
'browser'
].
type
+
'/'
+
helper
s
.
createNonClashingName
(
'Untitled.sol'
,
filesProvider
[
'browser'
])
var
newName
=
filesProvider
[
'browser'
].
type
+
'/'
+
helper
.
createNonClashingName
(
'Untitled.sol'
,
filesProvider
[
'browser'
])
if
(
!
filesProvider
[
'browser'
].
set
(
newName
,
''
))
{
if
(
!
filesProvider
[
'browser'
].
set
(
newName
,
''
))
{
modalDialogCustom
.
alert
(
'Failed to create file '
+
newName
)
modalDialogCustom
.
alert
(
'Failed to create file '
+
newName
)
}
else
{
}
else
{
...
...
src/app/tabs/run-tab.js
View file @
32d46d5f
...
@@ -69,6 +69,15 @@ var css = csjs`
...
@@ -69,6 +69,15 @@ var css = csjs`
margin-top: 2%;
margin-top: 2%;
border: none;
border: none;
}
}
.pendingTxsContainer {
${
styles
.
displayBox
}
display: flex;
flex-direction: column;
background-color:
${
styles
.
colors
.
transparent
}
;
margin-top: 2%;
border: none;
padding-bottom: 0;
}
.container {
.container {
${
styles
.
displayBox
}
${
styles
.
displayBox
}
margin-top: 2%;
margin-top: 2%;
...
@@ -76,6 +85,11 @@ var css = csjs`
...
@@ -76,6 +85,11 @@ var css = csjs`
.contractNames {
.contractNames {
${
styles
.
dropdown
}
${
styles
.
dropdown
}
}
}
.subcontainer {
display: flex;
flex-direction: row;
align-items: baseline;
}
.buttons {
.buttons {
display: flex;
display: flex;
cursor: pointer;
cursor: pointer;
...
@@ -115,11 +129,11 @@ var css = csjs`
...
@@ -115,11 +129,11 @@ var css = csjs`
color:
${
styles
.
colors
.
lightGrey
}
;
color:
${
styles
.
colors
.
lightGrey
}
;
font-style: italic;
font-style: italic;
}
}
.
legend
{
.
pendingTxsText
{
float: right;
${
styles
.
displayBox
}
display: flex
;
text-align: center
;
word-break: normal
;
color:
${
styles
.
colors
.
lightGrey
}
;
margin-left: auto
;
font-style: italic
;
}
}
.item {
.item {
margin-right: 1em;
margin-right: 1em;
...
@@ -138,13 +152,21 @@ var css = csjs`
...
@@ -138,13 +152,21 @@ var css = csjs`
color:
${
styles
.
colors
.
lightBlue
}
;
color:
${
styles
.
colors
.
lightBlue
}
;
margin-right: .3em;
margin-right: .3em;
}
}
.pendingContainer {
display: flex;
align-items: baseline;
}
.pending {
.pending {
background-color:
${
styles
.
colors
.
lightRed
}
;
width: 75px;
height: 25px;
height: 25px;
text-align: center;
text-align: center;
padding-left: 10px;
padding-left: 10px;
border-radius: 3px;
border-radius: 3px;
margin-left: 5px;
}
.icon {
font-size: 12px;
color:
${
styles
.
colors
.
orange
}
;
margin-left: 10%;
}
}
`
`
console
.
log
(
styles
.
displayBox
.
toString
())
console
.
log
(
styles
.
displayBox
.
toString
())
...
@@ -155,16 +177,26 @@ module.exports = runTab
...
@@ -155,16 +177,26 @@ module.exports = runTab
var
instanceContainer
=
yo
`<div class="
${
css
.
instanceContainer
}
"></div>`
var
instanceContainer
=
yo
`<div class="
${
css
.
instanceContainer
}
"></div>`
var
noInstancesText
=
yo
`<div class="
${
css
.
noInstancesText
}
">No Contract Instances.</div>`
var
noInstancesText
=
yo
`<div class="
${
css
.
noInstancesText
}
">No Contract Instances.</div>`
var
pendingTxsText
=
yo
`<div class="
${
css
.
pendingTxsText
}
"></div>`
var
pendingTxsContainer
=
yo
`<div class="
${
css
.
pendingTxsContainer
}
">
${
pendingTxsText
}
</div>`
function
runTab
(
container
,
appAPI
,
appEvents
,
opts
)
{
function
runTab
(
container
,
appAPI
,
appEvents
,
opts
)
{
var
el
=
yo
`
var
el
=
yo
`
<div class="
${
css
.
runTabView
}
" id="runTabView">
<div class="
${
css
.
runTabView
}
" id="runTabView">
${
settings
(
appAPI
,
appEvents
)}
${
settings
(
appAPI
,
appEvents
)}
${
contractDropdown
(
appAPI
,
appEvents
,
instanceContainer
)}
${
contractDropdown
(
appAPI
,
appEvents
,
instanceContainer
)}
${
pendingTxsContainer
}
${
instanceContainer
}
${
instanceContainer
}
</div>
</div>
`
`
container
.
appendChild
(
el
)
container
.
appendChild
(
el
)
// PENDING transactions
function
updatePendingTxs
(
container
,
appAPI
)
{
var
pendingCount
=
Object
.
keys
(
appAPI
.
udapp
().
pendingTransactions
()).
length
pendingTxsText
.
innerText
=
pendingCount
+
' pending transactions'
}
// DROPDOWN
// DROPDOWN
var
selectExEnv
=
el
.
querySelector
(
'#selectExEnvOptions'
)
var
selectExEnv
=
el
.
querySelector
(
'#selectExEnvOptions'
)
selectExEnv
.
addEventListener
(
'change'
,
function
(
event
)
{
selectExEnv
.
addEventListener
(
'change'
,
function
(
event
)
{
...
@@ -211,10 +243,6 @@ function updateAccountBalances (container, appAPI) {
...
@@ -211,10 +243,6 @@ function updateAccountBalances (container, appAPI) {
})
})
}
}
function
updatePendingTxs
(
container
,
appAPI
)
{
container
.
querySelector
(
'#pendingtxs'
).
innerText
=
Object
.
keys
(
appAPI
.
udapp
().
pendingTransactions
()).
length
+
' pending'
}
/* ------------------------------------------------
/* ------------------------------------------------
section CONTRACT DROPDOWN and BUTTONS
section CONTRACT DROPDOWN and BUTTONS
------------------------------------------------ */
------------------------------------------------ */
...
@@ -231,7 +259,9 @@ function contractDropdown (appAPI, appEvents, instanceContainer) {
...
@@ -231,7 +259,9 @@ function contractDropdown (appAPI, appEvents, instanceContainer) {
var
selectContractNames
=
yo
`<select class="
${
css
.
contractNames
}
" disabled></select>`
var
selectContractNames
=
yo
`<select class="
${
css
.
contractNames
}
" disabled></select>`
var
el
=
yo
`
var
el
=
yo
`
<div class="
${
css
.
container
}
">
<div class="
${
css
.
container
}
">
${
selectContractNames
}
${
legend
()}
<div class="
${
css
.
subcontainer
}
">
${
selectContractNames
}
</div>
<div class="
${
css
.
buttons
}
">
<div class="
${
css
.
buttons
}
">
<div class="
${
css
.
button
}
">
<div class="
${
css
.
button
}
">
<div class="
${
css
.
atAddress
}
" onclick=
${
function
()
{
loadFromAddress
(
appAPI
)
}
}>At Address</div>
<div class="
${
css
.
atAddress
}
" onclick=
${
function
()
{
loadFromAddress
(
appAPI
)
}
}>At Address</div>
...
@@ -397,19 +427,3 @@ function settings (appAPI, appEvents) {
...
@@ -397,19 +427,3 @@ function settings (appAPI, appEvents) {
return
el
return
el
}
}
/* ------------------------------------------------
section LEGEND
------------------------------------------------ */
function
legend
()
{
var
el
=
yo
`
<div class="
${
css
.
legend
}
">
<div class="
${
css
.
item
}
"><i class="fa fa-circle
${
css
.
call
}
" aria-hidden="true"></i>Call</div>
<div class="
${
css
.
item
}
"><i class="fa fa-circle
${
css
.
transact
}
" aria-hidden="true"></i>Transact</div>
<div class="
${
css
.
item
}
"><i class="fa fa-circle
${
css
.
payable
}
" aria-hidden="true"></i>Transact(Payable)</div>
<div class="
${
css
.
item
}
${
css
.
pending
}
" id="pendingtxs"></div>
</div>
`
return
el
}
src/universal-dapp.js
View file @
32d46d5f
...
@@ -334,6 +334,7 @@ UniversalDApp.prototype.getCallButton = function (args) {
...
@@ -334,6 +334,7 @@ UniversalDApp.prototype.getCallButton = function (args) {
if
(
lookupOnly
)
{
if
(
lookupOnly
)
{
$contractProperty
.
addClass
(
'constant'
)
$contractProperty
.
addClass
(
'constant'
)
button
.
attr
(
'title'
,
(
title
+
' - call'
))
call
()
call
()
}
}
...
@@ -343,6 +344,11 @@ UniversalDApp.prototype.getCallButton = function (args) {
...
@@ -343,6 +344,11 @@ UniversalDApp.prototype.getCallButton = function (args) {
if
(
args
.
funABI
.
payable
===
true
)
{
if
(
args
.
funABI
.
payable
===
true
)
{
$contractProperty
.
addClass
(
'payable'
)
$contractProperty
.
addClass
(
'payable'
)
button
.
attr
(
'title'
,
(
title
+
' - transact (payable)'
))
}
if
(
!
lookupOnly
&&
args
.
funABI
.
payable
===
false
)
{
button
.
attr
(
'title'
,
(
title
+
' - transact (not payable)'
))
}
}
return
$contractProperty
return
$contractProperty
...
...
test-browser/tests/compiling.js
View file @
32d46d5f
...
@@ -30,8 +30,8 @@ function runTests (browser) {
...
@@ -30,8 +30,8 @@ function runTests (browser) {
contractHelper
.
testContracts
(
browser
,
sources
.
sources
[
'browser/Untitled.sol'
],
[
'browser/Untitled.sol:TestContract'
],
function
()
{
contractHelper
.
testContracts
(
browser
,
sources
.
sources
[
'browser/Untitled.sol'
],
[
'browser/Untitled.sol:TestContract'
],
function
()
{
browser
.
click
(
'.runView'
)
browser
.
click
(
'.runView'
)
.
click
(
'#runTabView div[class^="create"]'
)
.
click
(
'#runTabView div[class^="create"]'
)
.
waitForElementPresent
(
'.instance button[title="f"]'
)
.
waitForElementPresent
(
'.instance button[title="f
- transact (not payable)
"]'
)
.
click
(
'.instance button[title="f"]'
)
.
click
(
'.instance button[title="f
- transact (not payable)
"]'
)
.
end
()
.
end
()
/*
/*
TODO: this will be logged in the dom console
TODO: this will be logged in the dom console
...
...
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