Skip to content

Commit

Permalink
?
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyEye-FAST committed Jul 12, 2024
1 parent 06c7173 commit a7d19a4
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions static/js/quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,27 +151,4 @@ $(document).ready(function () {

// Initialize first question
initializeQuestion();

var currentUrl = window.location.href;
var match = currentUrl.match(/\/([^\/?#]+)[\/?#]?$/);
var lastSegment = match ? match[1] : "";
document.getElementById("last-segment").textContent = lastSegment;

$("#copy-button").click(function () {
var $copyButton = $(this);
var $lastSegment = $("#last-segment");
var lastSegmentContent = $lastSegment.text();

navigator.clipboard
.writeText(lastSegmentContent)
.then(function () {
$copyButton.text("check");
setTimeout(function () {
$copyButton.text("content_copy");
}, 1500);
})
.catch(function (err) {
console.error("Failed to copy: ", err);
});
});
});

0 comments on commit a7d19a4

Please sign in to comment.