MediaWiki:Gadget-lastdiff.js: diferenças entre revisões
Conteúdo apagado Conteúdo adicionado
Sincronização com mw:Snippets/Last revision action: jQuery → mw.hook( 'wikipage.content' ).add; +wgCurRevisionId |
m Validação com JSHint e etc. |
||
Linha 3: | Linha 3: | ||
* |
* |
||
* @source: www.mediawiki.org/wiki/Snippets/Last_revision_action |
* @source: www.mediawiki.org/wiki/Snippets/Last_revision_action |
||
* @rev: 2014-08- |
* @rev: 2014-08-13 |
||
*/ |
*/ |
||
/* jshint laxbreak: true */ |
|||
⚫ | |||
/* global mediaWiki, jQuery */ |
|||
⚫ | |||
⚫ | |||
( function( mw, $ ) { |
|||
return; |
|||
'use strict'; |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
} |
|||
⚫ | |||
⚫ | |||
}( mediaWiki, jQuery ) ); |
Edição atual tal como às 11h57min de 13 de agosto de 2014
/**
* Action link: Last revision diff
*
* @source: www.mediawiki.org/wiki/Snippets/Last_revision_action
* @rev: 2014-08-13
*/
/* jshint laxbreak: true */
/* global mediaWiki, jQuery */
( function( mw, $ ) {
'use strict';
// Not on Special pages
if ( !mw.config.get( 'wgCanonicalSpecialPageName' ) ) {
mw.hook( 'wikipage.content' ).add( function() {
var url = mw.util.getUrl( mw.config.get( 'wgPageName' ) )
+ '?diff=' + mw.config.get( 'wgCurRevisionId' ),
$link = $( '#ca-lastdiff' ).find( 'a' );
if ( $link.length ) {
$link.attr( 'href', url );
} else {
mw.util.addPortletLink( 'p-cactions', url, 'Última edição', 'ca-lastdiff', 'Mostrar mudanças feitas na edição mais recente' );
}
} );
}
}( mediaWiki, jQuery ) );