#1: Adding ability to copy link by clicking it
All checks were successful
Jenkins Production Deployment

This commit is contained in:
Patrick Müller 2021-10-08 06:57:05 +02:00
parent bc9a43e648
commit ebfe66bb89
Signed by: Paddy
GPG Key ID: 3433DBC617B195CA

View File

@ -4,7 +4,25 @@ $(document).ready(function () {
$('#submitBtn').click(function () { $('#submitBtn').click(function () {
generateLink(); 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() { function generateLink() {
let selectedCourseFromPicker = $('#coursename').val().toString(); let selectedCourseFromPicker = $('#coursename').val().toString();