MediaWiki:Common.js: Difference between revisions
Criou página com '→Códigos JavaScript aqui colocados serão carregados por todos aqueles que acessarem alguma página deste wiki: mw.hook('wikipage.content').add(function () { console.log("[Language Menu] Script started"); var path = mw.config.get("wgPageName"); console.log("[Language Menu] Current path:", path); var currentLang = ''; var base = path; var langs = ['pt', 'en', 'es']; // Detecta idioma pelo sufixo langs.forEach(function (lang) { var suffix = '/'...' |
No edit summary |
||
| Line 89: | Line 89: | ||
} | } | ||
}); | }); | ||
}); | |||
$(document).ready(function() { | |||
// Procura por qualquer tag <a> que tenha 'redlink=1' no endereço | |||
$('a[href*="redlink=1"]').each(function() { | |||
// Substitui o link pelo que estiver dentro dele (texto, negritos, etc) | |||
$(this).replaceWith($(this).contents()); | |||
}); | |||
}); | }); | ||