Updated dependencies to use Git modules, Updated build script, Improved wedge

Update .gitignore, .gitmodules, and 6 more files...
This commit is contained in:
2023-12-20 01:59:26 +01:00
parent 44a05eb73a
commit f84e5ddfa3
8 changed files with 49 additions and 35 deletions

View File

@@ -1,31 +1,29 @@
// Highlights the code blocks when included on a page.
// This command is separated in its own file since highlight.js isn't on every page and because I can't use JS
// in a script element without using an external .js file.
Array.from(document.getElementsByClassName("code")).forEach(eCodeContainer => {
let language = null;
eCodeContainer.classList.forEach(cCodeContainer => {
if(cCodeContainer.startsWith("language-")) {
language = cCodeContainer;
}
});
if(language !== null) {
Array.from(eCodeContainer.children).forEach(eCodeLine => {
if(eCodeLine.classList.contains("code-line")) {
eCodeLine.classList.add(language);
hljs.highlightElement(eCodeLine);
document.addEventListener("DOMContentLoaded", () => {
// Highlights the code blocks when included on a page.
// This command is separated in its own file since highlight.js isn't on every page and because I can't use JS
// in a script element without using an external .js file.
Array.from(document.getElementsByClassName("code")).forEach(eCodeContainer => {
let language = null;
eCodeContainer.classList.forEach(cCodeContainer => {
if(cCodeContainer.startsWith("language-")) {
language = cCodeContainer;
}
});
}
});
if(language !== null) {
Array.from(eCodeContainer.children).forEach(eCodeLine => {
if(eCodeLine.classList.contains("code-line")) {
eCodeLine.classList.add(language);
hljs.highlightElement(eCodeLine);
}
});
}
});
// Adding the action to copy the code to elements with the "js-code-copy" class.
// The search works by searching the closest parent with the "code" class or that is a "code" element, and then
// reading each of its children with the "code-line" class.
document.addEventListener("DOMContentLoaded", () => {
//let codeCopyButtonCount = 0;
// Adding the action to copy the code to elements with the "js-code-copy" class.
// The search works by searching the closest parent with the "code" class or that is a "code" element, and then
// reading each of its children with the "code-line" class.
Array.from(document.getElementsByClassName("js-code-copy")).forEach(eCodeCopyButton => {
let eParentCodeBlock = eCodeCopyButton;
@@ -46,10 +44,8 @@ document.addEventListener("DOMContentLoaded", () => {
eCodeCopyButton.onclick = function() {
navigator.clipboard.writeText(code);
};
eCodeCopyButton.hidden = false;
}
//codeCopyButtonCount++;
});
//console.debug("Added code copying to " + codeCopyButtonCount + " button(s)");
});