MediaWiki:Common.js: Difference between revisions
MediaWiki interface page
More actions
Hytalewiki (talk | contribs) Created page with "→Any JavaScript here will be loaded for all users on every page load.: <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-C5TG4DYGL8"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-C5TG4DYGL8'); </script>" Tag: Recreated |
Hytalewiki (talk | contribs) No edit summary |
||
| (19 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
//Google Analytics GA4 | |||
/* | |||
var gaScript = document.createElement('script'); | |||
gaScript.async = true; | |||
gaScript.src = "https://www.googletagmanager.com/gtag/js?id=G-C5TG4DYGL8"; | |||
document.head.appendChild(gaScript); | |||
window.dataLayer = window.dataLayer || []; | |||
function gtag(){ dataLayer.push(arguments); } | |||
gtag('js', new Date()); | |||
gtag('config', 'G-C5TG4DYGL8'); | |||
//Google AdSense | |||
var adsense = document.createElement('script'); | |||
adsense.async = true; | |||
adsense.src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6165763582752350"; | |||
adsense.setAttribute("crossorigin", "anonymous"); | |||
document.head.appendChild(adsense); | |||
*/ | |||
$(document).ready(function () { | |||
$('a[href*="?"]').each(function () { | |||
var href = $(this).attr('href'); | |||
// Excluir enlaces que sí deben ser seguidos (como ?title=...) | |||
if ( | |||
href.includes('action=edit') || | |||
href.includes('action=history') || | |||
href.includes('oldid=') || | |||
href.includes('diff=') | |||
) { | |||
$(this).attr('rel', 'nofollow'); | |||
} | |||
}); | |||
//Modificar boton de idioma de "español" a "Español" | |||
$('a[lang="es"]').text('Español'); | |||
$('span[lang="es"]').text('Español'); | |||
//Eliminar botones sobrantes en paginas traducidas | |||
$('.mw-pt-languages').filter(function () { | |||
return $(this).attr('xml:lang') !== ''; | |||
}).remove(); | |||
}); | |||
Latest revision as of 15:27, 26 January 2026
/* Any JavaScript here will be loaded for all users on every page load. */
//Google Analytics GA4
/*
var gaScript = document.createElement('script');
gaScript.async = true;
gaScript.src = "https://www.googletagmanager.com/gtag/js?id=G-C5TG4DYGL8";
document.head.appendChild(gaScript);
window.dataLayer = window.dataLayer || [];
function gtag(){ dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-C5TG4DYGL8');
//Google AdSense
var adsense = document.createElement('script');
adsense.async = true;
adsense.src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6165763582752350";
adsense.setAttribute("crossorigin", "anonymous");
document.head.appendChild(adsense);
*/
$(document).ready(function () {
$('a[href*="?"]').each(function () {
var href = $(this).attr('href');
// Excluir enlaces que sí deben ser seguidos (como ?title=...)
if (
href.includes('action=edit') ||
href.includes('action=history') ||
href.includes('oldid=') ||
href.includes('diff=')
) {
$(this).attr('rel', 'nofollow');
}
});
//Modificar boton de idioma de "español" a "Español"
$('a[lang="es"]').text('Español');
$('span[lang="es"]').text('Español');
//Eliminar botones sobrantes en paginas traducidas
$('.mw-pt-languages').filter(function () {
return $(this).attr('xml:lang') !== '';
}).remove();
});