MediaWiki:Gadget-markAdmins.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Evito inherit di attributi dalla firma, +FixMe con miglioramento a mio avviso necessario
fix regex: sostituisci tutti gli underscore nei nomi utente, non solo il primo
 
(2 versioni intermedie di 2 utenti non mostrate)
Riga 36:
 
mw.hook( 'wikipage.content' ).add( function markAdmins ( $content ) {
mw.util.addCSS( 'abbr.adminMark { font-style: initial; font-weight: bold; padding-left: 5px; font-size: 0.7em; }' );
$.getJSON( '/wiki/' + cfgPage + '?action=raw&ctype=application/json', function processList ( response ) {
var userNs = mw.config.get( 'wgFormattedNamespaces' )[ 2 ],
Riga 44:
// for each link
$content.find( 'a' ).each( function addPerUserGroups () {
var $link = $( this ), userPatternMatch,
href = $link.attr( 'href' ),
userLink, userName, knownUserGroups, groupShort, groupName, i,
Riga 53:
 
// no sub pages
userLinkuserPatternMatch = userPattern.exec( href )[ 1 ];
if( userLink.indexOf( '/'= )userPatternMatch ===? userPatternMatch[ -1 )] : {null;
if( userLink && userLink.indexOf( '/' ) === -1 ) {
userName = decodeURIComponent( userLink.replace( /\/.*/, '' ).replace( /_/g, ' ' ) );
knownUserGroups = response.users[ userName ];
if ( knownUserGroups ) {