Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
jlopez
wicopa
Commits
e329829d
Commit
e329829d
authored
Oct 12, 2020
by
jlopez
Browse files
Add copied button
parent
ccf50afe
Changes
2
Hide whitespace changes
Inline
Side-by-side
inc/js/wicopa.js
View file @
e329829d
...
...
@@ -63,7 +63,33 @@ function buildCommand() {
}
}
alert
(
cmd
);
document
.
getElementById
(
"
valueBuildCommand
"
).
value
=
cmd
;
$
(
"
#modalBuildCommand
"
).
modal
();
}
function
copieCommand
()
{
var
toCopy
=
document
.
getElementById
(
'
valueBuildCommand
'
),
btnCopy
=
document
.
getElementById
(
'
copy
'
),
copied
=
document
.
getElementById
(
'
copied
'
);
toCopy
.
select
();
if
(
document
.
execCommand
(
'
copy
'
)
)
{
//btnCopy.classList.add( 'copied' );
copied
.
style
.
display
=
"
block
"
;
console
.
log
(
copied
.
style
.
display
);
var
temp
=
setInterval
(
function
(){
copied
.
style
.
display
=
"
none
"
;
clearInterval
(
temp
);
},
600
);
}
else
{
console
.
info
(
'
document.execCommand went wrong…
'
)
}
}
/**
...
...
index.php
View file @
e329829d
...
...
@@ -387,6 +387,43 @@ require_once "./inc/php/buildHeader.php";
</div>
</div>
</div>
<!-- End Modal Publish -->
<!-- Start Modal Publish -->
<div
class=
"modal"
id=
"modalBuildCommand"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<!-- Modal Header -->
<div
class=
"modal-header"
>
<h4
class=
"modal-title"
>
Build Command
</h4>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
>
×
</button>
</div>
<!-- Modal body -->
<div
class=
"modal-body"
>
<div
class=
"form-group"
>
<input
type=
"text"
class=
"form-control"
id=
"valueBuildCommand"
readonly
><br/>
</div>
<div
class=
"form-group"
>
<span
id=
"copied"
class=
"copiedtext text-center"
style=
"display:none; font-weight: bold; margin: 0 auto;"
>
Copied
</span>
</div>
</div>
<!-- Modal footer -->
<div
class=
"modal-footer"
>
<button
id=
"copy"
type=
"button"
class=
"btn btn-success"
onclick=
"copieCommand()"
>
Copy
</button>
<button
type=
"button"
class=
"btn"
data-dismiss=
"modal"
>
Close
</button>
</div>
</div>
</div>
</div>
<!-- End Modal Publish -->
</div>
...
...
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