fix(csp): docs + 418 sans style/script inline — CSS/JS externalisés, header/footer injectés par components.js (#h/#f), playground API déplacé dans docs-playground.js et docs.css
This commit is contained in:
parent
1482c6aaf0
commit
b65db0be44
7 changed files with 310 additions and 112 deletions
16
public/js/teapot.js
Normal file
16
public/js/teapot.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
(function () {
|
||||
var toast = document.querySelector(".tea-toast");
|
||||
if (!toast) return;
|
||||
var timer = null;
|
||||
function spin(msg) {
|
||||
toast.textContent = msg;
|
||||
toast.classList.add("show");
|
||||
if (timer) clearTimeout(timer);
|
||||
timer = setTimeout(function () { toast.classList.remove("show"); }, 3200);
|
||||
}
|
||||
document.querySelectorAll("[data-tea]").forEach(function (b) {
|
||||
b.addEventListener("click", function () {
|
||||
spin(b.getAttribute("data-toast") || "");
|
||||
});
|
||||
});
|
||||
})();
|
||||
Loading…
Reference in a new issue