MediaWiki:Gadget-highlightsUsername.js
Nota: Depois de publicar, poderá ter de contornar a cache do seu navegador para ver as alterações.
- Firefox / Safari: Pressione Shift enquanto clica Recarregar, ou pressione Ctrl-F5 ou Ctrl-R (⌘-R no Mac)
- Google Chrome: Pressione Ctrl-Shift-R (⌘-Shift-R no Mac)
- Internet Explorer / Edge: Pressione Ctrl enquanto clica Recarregar, ou pressione Ctrl-F5
- Opera: Pressione Ctrl-F5.
/**
* Highlights your username in historic
*
* @author [[w:en:User:Gray King]]
* @author [[w:pt:User:!Silent]]
* @source [[w:en:User:Gary/highlight my username in history.js]]
* @update 12/Ago/2014
*/
/* global mediaWiki, jQuery */
( function ( mw, $ ) {
'use strict';
function highlightsUsername() {
$( '#pagehistory' ).find( '.mw-userlink' ).each( function () {
var $this = $( this );
if ( $this.text() === mw.config.get( 'wgUserName' ) ) {
$this.addClass( 'highlightsUsername' );
}
} );
}
if ( mw.config.get( 'wgAction' ) === 'history' ) {
$( highlightsUsername );
}
}( mediaWiki, jQuery ) );