Commit e329829d authored by jlopez's avatar jlopez
Browse files

Add copied button

parent ccf50afe
......@@ -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…' )
}
}
/**
......
......@@ -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">&times;</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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment