Mudanças entre as edições de "MediaWiki:Common.js"
Ir para navegação
Ir para pesquisar
(Limpado o código, não foi necessário.) |
(teste de resposta) |
||
| Linha 1: | Linha 1: | ||
/* Códigos JavaScript aqui colocados serão carregados por todos aqueles que acessarem alguma página deste wiki */ | /* Códigos JavaScript aqui colocados serão carregados por todos aqueles que acessarem alguma página deste wiki */ | ||
| + | |||
| + | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
| + | /* FastCCI botão - PERSONALIZADO */ | ||
| + | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
| + | |||
| + | <script> | ||
| + | document.addEventListener("DOMContentLoaded", function () { | ||
| + | const title = document.querySelector("#firstHeading"); // pega o título da página | ||
| + | const buttonset = document.querySelector(".fastcci-buttonset"); // seu bloco copiado | ||
| + | |||
| + | if (title && buttonset) { | ||
| + | buttonset.style.marginLeft = "10px"; // dá um espaçamento | ||
| + | buttonset.style.display = "inline-block"; | ||
| + | title.appendChild(buttonset); // coloca ao lado do título | ||
| + | } | ||
| + | }); | ||
| + | </script> | ||
| + | |||
| + | <script> | ||
| + | document.addEventListener("DOMContentLoaded", function () { | ||
| + | const toggleButton = document.querySelector(".ui-button-icon-only"); | ||
| + | const menu = document.querySelector(".fastcci-menu"); | ||
| + | |||
| + | if (toggleButton && menu) { | ||
| + | toggleButton.addEventListener("click", function (e) { | ||
| + | e.preventDefault(); | ||
| + | menu.style.display = (menu.style.display === "block") ? "none" : "block"; | ||
| + | }); | ||
| + | |||
| + | // Fecha o menu se clicar fora | ||
| + | document.addEventListener("click", function (e) { | ||
| + | if (!menu.contains(e.target) && !toggleButton.contains(e.target)) { | ||
| + | menu.style.display = "none"; | ||
| + | } | ||
| + | }); | ||
| + | } | ||
| + | }); | ||
| + | </script> | ||
Edição das 23h41min de 26 de setembro de 2025
/* Códigos JavaScript aqui colocados serão carregados por todos aqueles que acessarem alguma página deste wiki */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* FastCCI botão - PERSONALIZADO */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
<script>
document.addEventListener("DOMContentLoaded", function () {
const title = document.querySelector("#firstHeading"); // pega o título da página
const buttonset = document.querySelector(".fastcci-buttonset"); // seu bloco copiado
if (title && buttonset) {
buttonset.style.marginLeft = "10px"; // dá um espaçamento
buttonset.style.display = "inline-block";
title.appendChild(buttonset); // coloca ao lado do título
}
});
</script>
<script>
document.addEventListener("DOMContentLoaded", function () {
const toggleButton = document.querySelector(".ui-button-icon-only");
const menu = document.querySelector(".fastcci-menu");
if (toggleButton && menu) {
toggleButton.addEventListener("click", function (e) {
e.preventDefault();
menu.style.display = (menu.style.display === "block") ? "none" : "block";
});
// Fecha o menu se clicar fora
document.addEventListener("click", function (e) {
if (!menu.contains(e.target) && !toggleButton.contains(e.target)) {
menu.style.display = "none";
}
});
}
});
</script>