Page créée avec « →Le CSS placé ici sera appliqué à tous les habillages. : →***** ***** TimelineTable ***** ***** : table.tl_table{ border-width: thin; border-spacing: 2px; border-style: outset; border-color: black; border-collapse: separate; background-color: white; border-radius: 9px; } th.tl_title{ text-transform: uppercase text-align: center; border-width: 1px; padding: 1px;... » Balise : wikieditor |
Aucun résumé des modifications |
||
| (8 versions intermédiaires par un autre utilisateur non affichées) | |||
| Ligne 1 : | Ligne 1 : | ||
/* | /* Kolleggram – masquage RC des pages privées pour les visiteurs */ | ||
window.kgmHideRC = (function () { | |||
var groups = mw.config.get('wgUserGroups') || []; | |||
var isAdmin = groups.indexOf('sysop') !== -1; | |||
if (isAdmin) return; // les admins voient tout | |||
var canon = mw.config.get('wgCanonicalSpecialPageName') || ''; | |||
var onList = ['Recentchanges','Recentchangeslinked','Watchlist','Newpages'].indexOf(canon) !== -1; | |||
if (!onList) return; | |||
var targets = [ | |||
'Espace_administratrice', // DBkey | |||
'Espace administratrice', // titre humain | |||
'Admini' | |||
]; | |||
function isTargetLink(a) { | |||
var href = (a.getAttribute('href') || '').toLowerCase(); | |||
var text = (a.textContent || '').toLowerCase(); | |||
return targets.some(function (t) { | |||
t = t.toLowerCase(); | |||
return href.indexOf(t) !== -1 || href.indexOf(encodeURIComponent(t)) !== -1 || text.indexOf(t) !== -1; | |||
}); | |||
} | |||
} | |||
function removeRowForLink(a) { | |||
var row = a.closest('li, tr, .mw-changeslist-line, .mw-newpages-page'); // gère plusieurs skins | |||
if (row) row.remove(); | |||
} | |||
} | |||
function sweep() { | |||
// Liens de titre dans les RC (plusieurs variantes selon skin/extensions) | |||
var sel = [ | |||
'.mw-changeslist a.mw-changeslist-title', | |||
'.mw-changeslist .mw-title a', | |||
'a.mw-newpages-pagename', | |||
'a[title]' // filet de sécurité | |||
].join(', '); | |||
} | document.querySelectorAll(sel).forEach(function (a) { | ||
if (isTargetLink(a)) removeRowForLink(a); | |||
}); | |||
} | |||
// Premier passage + pour les mises à jour en direct | |||
sweep(); | |||
mw.hook('wikipage.content').add(sweep); | |||
// Et si RC Live réinvente le DOM, on observe aussi | |||
var obs = new MutationObserver(function () { sweep(); }); | |||
obs.observe(document.body, {childList: true, subtree: true}); | |||
// Marqueur debug | |||
console.log('kgmHideRC actif'); | |||
})(); | |||
} | |||
Dernière version du 27 octobre 2025 à 11:53
/* Kolleggram – masquage RC des pages privées pour les visiteurs */
window.kgmHideRC = (function () {
var groups = mw.config.get('wgUserGroups') || [];
var isAdmin = groups.indexOf('sysop') !== -1;
if (isAdmin) return; // les admins voient tout
var canon = mw.config.get('wgCanonicalSpecialPageName') || '';
var onList = ['Recentchanges','Recentchangeslinked','Watchlist','Newpages'].indexOf(canon) !== -1;
if (!onList) return;
var targets = [
'Espace_administratrice', // DBkey
'Espace administratrice', // titre humain
'Admini'
];
function isTargetLink(a) {
var href = (a.getAttribute('href') || '').toLowerCase();
var text = (a.textContent || '').toLowerCase();
return targets.some(function (t) {
t = t.toLowerCase();
return href.indexOf(t) !== -1 || href.indexOf(encodeURIComponent(t)) !== -1 || text.indexOf(t) !== -1;
});
}
function removeRowForLink(a) {
var row = a.closest('li, tr, .mw-changeslist-line, .mw-newpages-page'); // gère plusieurs skins
if (row) row.remove();
}
function sweep() {
// Liens de titre dans les RC (plusieurs variantes selon skin/extensions)
var sel = [
'.mw-changeslist a.mw-changeslist-title',
'.mw-changeslist .mw-title a',
'a.mw-newpages-pagename',
'a[title]' // filet de sécurité
].join(', ');
document.querySelectorAll(sel).forEach(function (a) {
if (isTargetLink(a)) removeRowForLink(a);
});
}
// Premier passage + pour les mises à jour en direct
sweep();
mw.hook('wikipage.content').add(sweep);
// Et si RC Live réinvente le DOM, on observe aussi
var obs = new MutationObserver(function () { sweep(); });
obs.observe(document.body, {childList: true, subtree: true});
// Marqueur debug
console.log('kgmHideRC actif');
})();