#1: Adding ability to copy link by clicking it
All checks were successful
Jenkins Production Deployment
All checks were successful
Jenkins Production Deployment
This commit is contained in:
parent
bc9a43e648
commit
ebfe66bb89
18
scripts.js
18
scripts.js
|
@ -4,8 +4,26 @@ $(document).ready(function () {
|
|||
$('#submitBtn').click(function () {
|
||||
generateLink();
|
||||
});
|
||||
|
||||
$('#full-link').click(function () {
|
||||
let element = $('#full-link');
|
||||
let text = element.text()
|
||||
copyToClipboard(text);
|
||||
element.text('Copied!');
|
||||
setTimeout(function () {
|
||||
element.text(text);
|
||||
}, 2000);
|
||||
});
|
||||
});
|
||||
|
||||
function copyToClipboard(text) {
|
||||
var $temp = $("<input>");
|
||||
$("body").append($temp);
|
||||
$temp.val(text).select();
|
||||
document.execCommand("copy");
|
||||
$temp.remove();
|
||||
}
|
||||
|
||||
function generateLink() {
|
||||
let selectedCourseFromPicker = $('#coursename').val().toString();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user