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
0cfd5ab4
Unverified
Commit
0cfd5ab4
authored
Jul 17, 2019
by
Liana Husikyan
Committed by
GitHub
Jul 17, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2182 from ethereum/yann300-patch-55
Fix modal dialog callback being called multiple times
parents
6d32d939
9a0f00f3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
17 deletions
+18
-17
settings.js
src/app/tabs/runTab/settings.js
+2
-1
modal-dialog-custom.js
src/app/ui/modal-dialog-custom.js
+6
-6
modaldialog.js
src/app/ui/modaldialog.js
+7
-8
addFile.js
test-browser/commands/addFile.js
+1
-0
verifyContracts.js
test-browser/commands/verifyContracts.js
+2
-2
No files found.
src/app/tabs/runTab/settings.js
View file @
0cfd5ab4
...
@@ -273,11 +273,12 @@ class SettingsUI {
...
@@ -273,11 +273,12 @@ class SettingsUI {
var
account
=
$txOrigin
.
selectedOptions
[
0
].
value
var
account
=
$txOrigin
.
selectedOptions
[
0
].
value
var
promptCb
=
(
passphrase
)
=>
{
var
promptCb
=
(
passphrase
)
=>
{
modalDialogCustom
.
promptMulti
(
signMessageDialog
,
(
message
)
=>
{
const
modal
=
modalDialogCustom
.
promptMulti
(
signMessageDialog
,
(
message
)
=>
{
this
.
settings
.
signMessage
(
message
,
account
,
passphrase
,
(
err
,
msgHash
,
signedData
)
=>
{
this
.
settings
.
signMessage
(
message
,
account
,
passphrase
,
(
err
,
msgHash
,
signedData
)
=>
{
if
(
err
)
{
if
(
err
)
{
return
addTooltip
(
err
)
return
addTooltip
(
err
)
}
}
modal
.
hide
()
modalDialogCustom
.
alert
(
yo
`
modalDialogCustom
.
alert
(
yo
`
<div>
<div>
<b>hash:</b><br>
<b>hash:</b><br>
...
...
src/app/ui/modal-dialog-custom.js
View file @
0cfd5ab4
...
@@ -4,13 +4,13 @@ var css = require('./styles/modal-dialog-custom-styles')
...
@@ -4,13 +4,13 @@ var css = require('./styles/modal-dialog-custom-styles')
module
.
exports
=
{
module
.
exports
=
{
alert
:
function
(
text
)
{
alert
:
function
(
text
)
{
modal
(
''
,
yo
`<div>
${
text
}
</div>`
,
null
,
{
label
:
null
})
return
modal
(
''
,
yo
`<div>
${
text
}
</div>`
,
null
,
{
label
:
null
})
},
},
prompt
:
function
(
title
,
text
,
inputValue
,
ok
,
cancel
,
focus
)
{
prompt
:
function
(
title
,
text
,
inputValue
,
ok
,
cancel
,
focus
)
{
prompt
(
title
,
text
,
false
,
inputValue
,
ok
,
cancel
,
focus
)
return
prompt
(
title
,
text
,
false
,
inputValue
,
ok
,
cancel
,
focus
)
},
},
promptPassphrase
:
function
(
title
,
text
,
inputValue
,
ok
,
cancel
)
{
promptPassphrase
:
function
(
title
,
text
,
inputValue
,
ok
,
cancel
)
{
prompt
(
title
,
text
,
true
,
inputValue
,
ok
,
cancel
)
return
prompt
(
title
,
text
,
true
,
inputValue
,
ok
,
cancel
)
},
},
promptPassphraseCreation
:
function
(
ok
,
cancel
)
{
promptPassphraseCreation
:
function
(
ok
,
cancel
)
{
var
text
=
'Please provide a Passphrase for the account creation'
var
text
=
'Please provide a Passphrase for the account creation'
...
@@ -20,7 +20,7 @@ module.exports = {
...
@@ -20,7 +20,7 @@ module.exports = {
<br>
<br>
<input id="prompt2" type="password" name='prompt_text' class="
${
css
[
'prompt_text'
]}
" >
<input id="prompt2" type="password" name='prompt_text' class="
${
css
[
'prompt_text'
]}
" >
</div>`
</div>`
modal
(
null
,
yo
`<div>
${
text
}
<div>
${
input
}
</div></div>`
,
return
modal
(
null
,
yo
`<div>
${
text
}
<div>
${
input
}
</div></div>`
,
{
{
fn
:
()
=>
{
fn
:
()
=>
{
if
(
typeof
ok
===
'function'
)
{
if
(
typeof
ok
===
'function'
)
{
...
@@ -42,7 +42,7 @@ module.exports = {
...
@@ -42,7 +42,7 @@ module.exports = {
promptMulti
:
function
({
title
,
text
,
inputValue
},
ok
,
cancel
)
{
promptMulti
:
function
({
title
,
text
,
inputValue
},
ok
,
cancel
)
{
if
(
!
inputValue
)
inputValue
=
''
if
(
!
inputValue
)
inputValue
=
''
var
input
=
yo
`<textarea id="prompt_text" class=
${
css
.
prompt_text
}
rows="4" cols="50"></textarea>`
var
input
=
yo
`<textarea id="prompt_text" class=
${
css
.
prompt_text
}
rows="4" cols="50"></textarea>`
modal
(
title
,
yo
`<div>
${
text
}
<div>
${
input
}
</div></div>`
,
return
modal
(
title
,
yo
`<div>
${
text
}
<div>
${
input
}
</div></div>`
,
{
{
fn
:
()
=>
{
if
(
typeof
ok
===
'function'
)
ok
(
document
.
getElementById
(
'prompt_text'
).
value
)
}
fn
:
()
=>
{
if
(
typeof
ok
===
'function'
)
ok
(
document
.
getElementById
(
'prompt_text'
).
value
)
}
},
},
...
@@ -52,7 +52,7 @@ module.exports = {
...
@@ -52,7 +52,7 @@ module.exports = {
)
)
},
},
confirm
:
function
(
title
,
text
,
ok
,
cancel
)
{
confirm
:
function
(
title
,
text
,
ok
,
cancel
)
{
modal
(
title
,
yo
`<div>
${
text
}
</div>`
,
return
modal
(
title
,
yo
`<div>
${
text
}
</div>`
,
{
{
fn
:
()
=>
{
if
(
typeof
ok
===
'function'
)
ok
()
}
fn
:
()
=>
{
if
(
typeof
ok
===
'function'
)
ok
()
}
},
},
...
...
src/app/ui/modaldialog.js
View file @
0cfd5ab4
...
@@ -49,18 +49,14 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => {
...
@@ -49,18 +49,14 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => {
function
okListener
()
{
function
okListener
()
{
removeEventListener
()
removeEventListener
()
hide
()
if
(
ok
&&
ok
.
fn
&&
agreed
)
ok
.
fn
()
if
(
ok
&&
ok
.
fn
&&
agreed
)
ok
.
fn
()
hide
()
}
}
function
cancelListener
()
{
function
cancelListener
()
{
removeEventListener
()
removeEventListener
()
hide
()
if
(
cancel
&&
cancel
.
fn
)
cancel
.
fn
()
if
(
cancel
&&
cancel
.
fn
)
cancel
.
fn
()
if
(
container
)
{
hide
()
container
.
class
=
`modal`
container
=
null
}
}
}
function
modalKeyEvent
(
e
)
{
function
modalKeyEvent
(
e
)
{
...
@@ -81,7 +77,10 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => {
...
@@ -81,7 +77,10 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => {
}
}
function
hide
()
{
function
hide
()
{
if
(
container
)
container
.
style
.
display
=
'none'
if
(
!
container
)
return
container
.
style
.
display
=
'none'
if
(
container
.
parentElement
)
container
.
parentElement
.
removeChild
(
container
)
container
=
null
}
}
function
show
()
{
function
show
()
{
...
@@ -121,7 +120,7 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => {
...
@@ -121,7 +120,7 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => {
}
}
})
})
}
}
return
{
container
,
okListener
,
cancelListener
}
return
{
container
,
okListener
,
cancelListener
,
hide
}
}
}
function
html
(
opts
)
{
function
html
(
opts
)
{
...
...
test-browser/commands/addFile.js
View file @
0cfd5ab4
...
@@ -14,6 +14,7 @@ class AddFile extends EventEmitter {
...
@@ -14,6 +14,7 @@ class AddFile extends EventEmitter {
function
addFile
(
browser
,
name
,
content
,
done
)
{
function
addFile
(
browser
,
name
,
content
,
done
)
{
browser
.
clickLaunchIcon
(
'udapp'
).
clickLaunchIcon
(
'fileExplorers'
).
click
(
'.newFile'
)
browser
.
clickLaunchIcon
(
'udapp'
).
clickLaunchIcon
(
'fileExplorers'
).
click
(
'.newFile'
)
.
waitForElementVisible
(
'#modal-dialog'
)
.
perform
((
client
,
done
)
=>
{
.
perform
((
client
,
done
)
=>
{
browser
.
execute
(
function
(
fileName
)
{
browser
.
execute
(
function
(
fileName
)
{
if
(
fileName
!==
'Untitled.sol'
)
{
if
(
fileName
!==
'Untitled.sol'
)
{
...
...
test-browser/commands/verifyContracts.js
View file @
0cfd5ab4
...
@@ -14,7 +14,7 @@ class VerifyContracts extends EventEmitter {
...
@@ -14,7 +14,7 @@ class VerifyContracts extends EventEmitter {
function
getCompiledContracts
(
browser
,
callback
)
{
function
getCompiledContracts
(
browser
,
callback
)
{
browser
.
clickLaunchIcon
(
'solidity'
).
execute
(
function
()
{
browser
.
clickLaunchIcon
(
'solidity'
).
execute
(
function
()
{
var
contracts
=
document
.
querySelectorAll
(
'#compileTabView select option'
)
var
contracts
=
document
.
querySelectorAll
(
'#compileTabView select
#compiledContracts
option'
)
if
(
!
contracts
)
{
if
(
!
contracts
)
{
return
null
return
null
}
else
{
}
else
{
...
@@ -33,7 +33,7 @@ function verifyContracts (browser, compiledContractNames, callback) {
...
@@ -33,7 +33,7 @@ function verifyContracts (browser, compiledContractNames, callback) {
getCompiledContracts
(
browser
,
(
result
)
=>
{
getCompiledContracts
(
browser
,
(
result
)
=>
{
if
(
result
.
value
)
{
if
(
result
.
value
)
{
for
(
var
contract
in
compiledContractNames
)
{
for
(
var
contract
in
compiledContractNames
)
{
console
.
log
(
' - '
+
compiledContractNames
[
contract
])
console
.
log
(
' - '
+
compiledContractNames
[
contract
]
,
result
.
value
)
if
(
result
.
value
.
indexOf
(
compiledContractNames
[
contract
])
===
-
1
)
{
if
(
result
.
value
.
indexOf
(
compiledContractNames
[
contract
])
===
-
1
)
{
browser
.
assert
.
fail
(
'compiled contract '
+
compiledContractNames
+
' not found'
,
'info about error'
,
''
)
browser
.
assert
.
fail
(
'compiled contract '
+
compiledContractNames
+
' not found'
,
'info about error'
,
''
)
browser
.
end
()
browser
.
end
()
...
...
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