Update main page with more org syntax

This commit is contained in:
2020-11-26 19:57:35 +01:00
parent 7dc2dcd681
commit 10518c6128
4 changed files with 370 additions and 144 deletions

15
dist/script.js vendored
View File

@@ -57,15 +57,24 @@ docReady(function () {
boxCopy.textContent = "Copy";
boxCopy.onclick = function () {
// Get text inside (remove 4 first char corresponding to "Copy")
var srcText = this.parentNode.textContent.slice(4);
// Create a clone the node to not affect the original one
var nodeClone = this.parentNode.cloneNode(true); // Remove Line Numbers and Copy Button
var linenumNodes = nodeClone.querySelectorAll('.linenr,.src-copy');
for (var i = linenumNodes.length - 1; i >= 0; --i) {
nodeClone.removeChild(linenumNodes[i]);
} // Copy the filetered content to the clipboard
var srcText = nodeClone.textContent;
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);
}, 2000);
});
};

4
dist/style.css vendored

File diff suppressed because one or more lines are too long