Gadget:avatar.js:修订间差异

添加224字节 、​ 2023年7月24日 (星期一)
// Edit via Wikiplus
(// Edit via Wikiplus)
(// Edit via Wikiplus)
 
(未显示同一用户的4个中间版本)
第16行: 第16行:
}
}
}
}
$( '.mw-userlink' ).each( function ( _, item ) {
function setAvatar() {
item.prepend(
$( 'a.mw-userlink:not(.mw-anonuserlink)' ).each( function ( _, item ) {
$( '<img>' )
item.prepend(
.addClass( 'userlink-avatar' )
$( '<img>' )
.attr(
.addClass( 'userlink-avatar' )
'src',
.attr( 'src', mw.config.get( 'wgScriptPath' ) + '/index.php?title=Special:Avatar&wpUsername=' + item.textContent )[ 0 ]
mw.config.get( 'wgScriptPath' ) +
);
              '/index.php?title=Special:Avatar&wpUsername=' +
} );
              item.text
}
)[ 0 ]
mw.hook( 'wikipage.content' ).add( function ( e ) {
);
 
if ( e.attr( 'id' ) === 'mw-content-text' ) {
setAvatar();
return;
}
if ( e.hasClass( 'mw-changeslist' ) ) {
setAvatar();
}
 
} );
} );
} );
} );
维护员、​界面管理员、​巡查员、​监督员、​小部件编辑者
3,469

个编辑