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
2d7bb2d7
Unverified
Commit
2d7bb2d7
authored
Oct 20, 2020
by
yann300
Committed by
GitHub
Oct 20, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #429 from ethereum/modals
Fading the bg for modals
parents
8dd20d45
76de804a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
10 deletions
+45
-10
modal-dialog-custom.js
apps/remix-ide/src/app/ui/modal-dialog-custom.js
+43
-8
modaldialog.js
apps/remix-ide/src/app/ui/modaldialog.js
+1
-1
modaldialog-styles.js
apps/remix-ide/src/app/ui/styles/modaldialog-styles.js
+1
-1
No files found.
apps/remix-ide/src/app/ui/modal-dialog-custom.js
View file @
2d7bb2d7
...
@@ -15,12 +15,14 @@ module.exports = {
...
@@ -15,12 +15,14 @@ module.exports = {
},
},
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'
var
input
=
yo
`<div>
var
input
=
yo
`
<input id="prompt1" type="password" name='prompt_text' class="
${
css
[
'prompt_text'
]}
" >
<div>
<br>
<input id="prompt1" type="password" name='prompt_text' class="
${
css
[
'prompt_text'
]}
" oninput="
${(
e
)
=>
validateInput
(
e
)}
">
<br>
<br>
<input id="prompt2" type="password" name='prompt_text' class="
${
css
[
'prompt_text'
]}
" >
<br>
</div>`
<input id="prompt2" type="password" name='prompt_text' class="
${
css
[
'prompt_text'
]}
" oninput="
${(
e
)
=>
validateInput
(
e
)}
">
</div>
`
return
modal
(
null
,
yo
`<div>
${
text
}
<div>
${
input
}
</div></div>`
,
return
modal
(
null
,
yo
`<div>
${
text
}
<div>
${
input
}
</div></div>`
,
{
{
fn
:
()
=>
{
fn
:
()
=>
{
...
@@ -42,7 +44,16 @@ module.exports = {
...
@@ -42,7 +44,16 @@ 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" data-id="modalDialogCustomPromptText" class=
${
css
.
prompt_text
}
rows="4" cols="50"></textarea>`
const
input
=
yo
`
<textarea
id="prompt_text"
data-id="modalDialogCustomPromptText"
class=
${
css
.
prompt_text
}
rows="4"
cols="50"
oninput="
${(
e
)
=>
validateInput
(
e
)}
"
></textarea>
`
return
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
)
}
...
@@ -64,10 +75,34 @@ module.exports = {
...
@@ -64,10 +75,34 @@ module.exports = {
}
}
}
}
const
validateInput
=
(
e
)
=>
{
console
.
log
(
'validation from '
,
e
)
if
(
!
document
.
getElementById
(
'modal-footer-ok'
))
return
if
(
e
.
target
.
value
===
''
)
{
document
.
getElementById
(
'modal-footer-ok'
).
classList
.
add
(
'disabled'
)
document
.
getElementById
(
'modal-footer-ok'
).
style
.
pointerEvents
=
'none'
}
else
{
document
.
getElementById
(
'modal-footer-ok'
).
classList
.
remove
(
'disabled'
)
document
.
getElementById
(
'modal-footer-ok'
).
style
.
pointerEvents
=
'auto'
}
}
function
prompt
(
title
,
text
,
hidden
,
inputValue
,
ok
,
cancel
,
focus
)
{
function
prompt
(
title
,
text
,
hidden
,
inputValue
,
ok
,
cancel
,
focus
)
{
if
(
!
inputValue
)
inputValue
=
''
if
(
!
inputValue
)
inputValue
=
''
var
type
=
hidden
?
'password'
:
'text'
var
type
=
hidden
?
'password'
:
'text'
var
input
=
yo
`<input type=
${
type
}
name='prompt_text' id='prompt_text' class="
${
css
[
'prompt_text'
]}
form-control" value='
${
inputValue
}
' data-id="modalDialogCustomPromptText">`
var
input
=
yo
`
<input
type=
${
type
}
name='prompt_text'
id='prompt_text'
class="
${
css
[
'prompt_text'
]}
form-control"
value='
${
inputValue
}
'
data-id="modalDialogCustomPromptText"
oninput="
${(
e
)
=>
validateInput
(
e
)}
"
>
`
modal
(
title
,
yo
`<div>
${
text
}
<div>
${
input
}
</div></div>`
,
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
)
}
...
...
apps/remix-ide/src/app/ui/modaldialog.js
View file @
2d7bb2d7
...
@@ -130,7 +130,7 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => {
...
@@ -130,7 +130,7 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => {
function
html
(
opts
)
{
function
html
(
opts
)
{
return
yo
`
return
yo
`
<div id="modal-dialog" data-id="modalDialogContainer" class="modal" tabindex="-1" role="dialog">
<div id="modal-dialog" data-id="modalDialogContainer"
data-backdrop="static" data-keyboard="false"
class="modal" tabindex="-1" role="dialog">
<div id="modal-background" class="modal-dialog" role="document">
<div id="modal-background" class="modal-dialog" role="document">
<div class="modal-content
${
css
.
modalContent
}
${
opts
.
class
}
">
<div class="modal-content
${
css
.
modalContent
}
${
opts
.
class
}
">
<div class="modal-header">
<div class="modal-header">
...
...
apps/remix-ide/src/app/ui/styles/modaldialog-styles.js
View file @
2d7bb2d7
...
@@ -5,7 +5,7 @@ var css = csjs`
...
@@ -5,7 +5,7 @@ var css = csjs`
.modalFooter {
.modalFooter {
}
}
.modalContent {
.modalContent {
box-shadow: 0
4px 8px 0 rgba(0,0,0,0.2
),0 6px 20px 0 rgba(0,0,0,0.19);
box-shadow: 0
0 8px 1000px rgba(0,0,0,0.6
),0 6px 20px 0 rgba(0,0,0,0.19);
-webkit-animation-name: animatetop;
-webkit-animation-name: animatetop;
-webkit-animation-duration: 0.4s;
-webkit-animation-duration: 0.4s;
animation-name: animatetop;
animation-name: animatetop;
...
...
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