MediaWiki:Common.css: Difference between revisions
Jump to navigation
Jump to search
Replaced content with "→CSS placed here will be applied to all skins: #ca-history { display:none!important; } #ca-talk { display:none!important; } →To make images responsive: .res-img img { max-width:100%; height:auto; } img { max-width:100%; height:auto; }" Tags: Replaced Manual revert |
No edit summary |
||
| Line 11: | Line 11: | ||
height:auto; | height:auto; | ||
} | } | ||
/* ============================================= | |||
SCRUM MANAGER BOK — Common.js | |||
============================================= */ | |||
/* 1. Intento de corrección de viewport para móvil | |||
Nota: funciona en la mayoría de navegadores | |||
móviles modernos aunque el meta esté hardcodeado */ | |||
(function () { | |||
var vp = document.querySelector('meta[name="viewport"]'); | |||
if (vp) { | |||
vp.content = 'width=device-width, initial-scale=1.0'; | |||
} | |||
})(); | |||
/* 2. CTA automático al final de los artículos del glosario | |||
Se inyecta solo en páginas con categorías asignadas, | |||
evitando la portada y las páginas de índice */ | |||
(function () { | |||
var titulo = document.querySelector('#firstHeading'); | |||
if (!titulo) return; | |||
var tituloTexto = titulo.textContent.trim(); | |||
var excluidos = ['Scrum Manager BoK', 'Main Page', 'Glosario de términos']; | |||
if (excluidos.indexOf(tituloTexto) !== -1) return; | |||
/* Solo artículos con categorías (son del glosario) */ | |||
var catLinks = document.querySelector('#mw-normal-catlinks'); | |||
if (!catLinks) return; | |||
var parser = document.querySelector('.mw-parser-output'); | |||
if (!parser) return; | |||
var cta = document.createElement('div'); | |||
cta.className = 'bok-cta-articulo'; | |||
cta.innerHTML = | |||
'<span class="titulo">¿Te ha resultado útil?</span>' + | |||
'En el <a href="https://scrummanager.com/club/">Club Agile</a> ' + | |||
'encontrarás retos y recursos para seguir aprendiendo sobre este y otros temas. ' + | |||
'Si quieres certificar tus conocimientos, consulta el ' + | |||
'<a href="https://www.scrummanager.com/website/c/calendar/show-courses.php">' + | |||
'calendario de convocatorias</a>.'; | |||
parser.appendChild(cta); | |||
})(); | |||
/* 3. Scroll suave para los enlaces del índice de contenidos */ | |||
(function () { | |||
document.querySelectorAll('.toc a[href^="#"]').forEach(function (enlace) { | |||
enlace.addEventListener('click', function (e) { | |||
var destino = document.querySelector(this.getAttribute('href')); | |||
if (destino) { | |||
e.preventDefault(); | |||
destino.scrollIntoView({ behavior: 'smooth', block: 'start' }); | |||
} | |||
}); | |||
}); | |||
})(); | |||