Update Scripts
This commit is contained in:
8
dist/script.js
vendored
8
dist/script.js
vendored
@@ -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);
|
||||
});
|
||||
};
|
||||
|
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