Files
katenary/doc/docs/statics/addons.js

49 lines
1.4 KiB
JavaScript
Raw Normal View History

2022-06-13 13:18:31 +02:00
function addSmileLogo() {
2022-06-14 09:25:43 +02:00
const logo = document.createElement("img");
2022-06-13 13:18:31 +02:00
logo.src = "/statics/Logo_Smile.png";
logo.classList.add("smile-logo");
logo.alt = "Smile logo";
2022-06-14 09:25:43 +02:00
const link = document.createElement("a");
2022-06-13 13:18:31 +02:00
link.href = "https://www.smile.eu";
link.target = "_blank";
link.title = "Smile website";
2022-06-14 09:25:43 +02:00
link.classList.add("smile-logo");
2022-06-13 13:18:31 +02:00
link.appendChild(logo);
2022-06-14 09:25:43 +02:00
const text = document.createElement("p");
text.innerHTML = "Sponsored by Smile";
2022-06-13 13:18:31 +02:00
2022-06-14 09:25:43 +02:00
const div = document.createElement("div");
div.classList.add("smile-logo");
div.appendChild(text);
div.appendChild(link);
2022-06-13 13:18:31 +02:00
logo.addEventListener("load", () => {
2022-06-14 09:25:43 +02:00
let side = document.querySelector(".md-footer-meta__inner");
side.appendChild(div);
2022-06-13 13:18:31 +02:00
});
}
2022-06-14 09:25:43 +02:00
function hljsInstall() {
const version = "11.5.1";
const theme = "github-dark";
const script = document.createElement("script");
script.src = `//cdnjs.cloudflare.com/ajax/libs/highlight.js/${version}/highlight.min.js`;
script.onload = () => {
const style = document.createElement("link");
style.rel = "stylesheet";
style.href = `//cdnjs.cloudflare.com/ajax/libs/highlight.js/${version}/styles/${theme}.min.css`;
document.head.appendChild(style);
hljs.initHighlightingOnLoad();
};
document.head.appendChild(script);
}
2022-06-13 13:18:31 +02:00
document.addEventListener("DOMContentLoaded", () => {
2022-06-14 09:25:43 +02:00
addSmileLogo();
hljsInstall();
2022-06-13 13:18:31 +02:00
});