Update Scripts

This commit is contained in:
2020-11-26 15:59:17 +01:00
parent 845cb0d521
commit 7f0fbb1b2f
6 changed files with 403 additions and 186 deletions
+6 -2
View File
@@ -44,7 +44,7 @@ docReady(function () {
}); // Copy Source Block
docReady(function () {
var srcContainers = document.querySelectorAll('div.org-src-container');
var srcContainers = document.querySelectorAll('pre.src');
var _iterator2 = _createForOfIteratorHelper(srcContainers),
_step2;
@@ -57,10 +57,14 @@ docReady(function () {
boxCopy.textContent = "Copy";
boxCopy.onclick = function () {
navigator.clipboard.writeText(this.nextElementSibling.textContent).then(function () {
// Get text inside (remove 4 first char corresponding to "Copy")
var srcText = this.parentNode.textContent.slice(4);
navigator.clipboard.writeText(srcText).then(function () {
boxCopy.textContent = "Copied";
boxCopy.classList.add("src-copied");
setTimeout(function () {
boxCopy.textContent = "Copy";
boxCopy.classList.remove("src-copied");
}, 1000);
});
};
+2 -2
View File
File diff suppressed because one or more lines are too long