Update main page with more org syntax
This commit is contained in:
15
dist/script.js
vendored
15
dist/script.js
vendored
@@ -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
4
dist/style.css
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user