Utente:Titore/Gadget-MultiDiffConsecutive.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
 
sposto api in funzione
 
(Una versione intermedia di uno stesso utente non è mostrata)
Riga 1:
/**
* View the next/ previous edit of a revision in MediaWiki multi diffs.
* Uses the localization provided by MediaWiki, requires mediawiki.util and mediawiki.api to work.
*
* This program is free software; you can redistribute it and/or modify
Riga 20:
* @author Marius Hoch < hoo@online.de >
*/
mw.loader.using( [ 'mediawiki.util', 'mediawiki.api' ], function() {
 
$( document ).ready( function() {
Riga 27:
 
/**
* Gets the needed interface messages to the client, so they can be accessed by mw.msg.
* Get an interface message
*
* @param {string} msg Message key (without MediaWiki:)
*
* @return {jQuery.promise}
*/
function getMessagegetMessages( msg ) {
return $new mw.Api().ajaxloadMessagesIfMissing( {[
getMessage( 'previousdiff' ),
url: mw.util.wikiScript( 'index' ),
data: {'nextdiff'
}] );
title: 'MediaWiki:' + msg,
action: 'raw',
usemsgcache: true
},
dataType: 'text',
cache: true
} );
}
 
Riga 71 ⟶ 63:
getPrevRevisionText();
} else {
getMessages()
getMessage( 'nextdiff' )
.done( function( text ) {
nextRevisionText = textmw.msg( 'nextdiff' );
} )
.done( getPrevRevisionText );
Riga 87 ⟶ 79:
doLink();
} else {
getMessages()
getMessage( 'previousdiff' )
.done( function( text ) {
prevRevisionText = textmw.msg( 'previousdiff' );
} )
.done( doLink );