« MediaWiki:Common.js » : différence entre les versions
Apparence
Aucun résumé des modifications Balise : Révocation manuelle |
Aucun résumé des modifications |
||
| Ligne 13 : | Ligne 13 : | ||
header.prepend(container); | header.prepend(container); | ||
}); | |||
/* ============================= */ | |||
/* DÉTECTION AUTOMATIQUE DES VALEURS NUMÉRIQUES */ | |||
/* ============================= */ | |||
mw.hook('wikipage.content').add(function ($content) { | |||
$content.find('table.fandom-table td, table.wikitable td').each(function () { | |||
const cell = $(this); | |||
const text = cell.text().trim(); | |||
// Nombre entier, décimal, positif/négatif, avec éventuellement % | |||
if (/^[+-]?\d+(?:[.,]\d+)?%?$/.test(text)) { | |||
cell.addClass('pne-number'); | |||
} | |||
}); | |||
}); | }); | ||
Version du 8 août 2026 à 13:26
$(function () {
const header = document.querySelector('.vector-header-end');
if (!header) return;
const container = document.createElement('div');
container.className = "pne-header-links";
container.innerHTML = `
<a href="/wiki/index.php/Spécial:Toutes_les_pages">Parcourir</a>
<a href="/wiki/index.php/Spécial:Catégories">Catégories</a>
`;
header.prepend(container);
});
/* ============================= */
/* DÉTECTION AUTOMATIQUE DES VALEURS NUMÉRIQUES */
/* ============================= */
mw.hook('wikipage.content').add(function ($content) {
$content.find('table.fandom-table td, table.wikitable td').each(function () {
const cell = $(this);
const text = cell.text().trim();
// Nombre entier, décimal, positif/négatif, avec éventuellement %
if (/^[+-]?\d+(?:[.,]\d+)?%?$/.test(text)) {
cell.addClass('pne-number');
}
});
});