Utente:Titore/Gadget-MultiDiffConsecutive.js: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
uso direttamente le api |
sposto api in funzione |
||
Riga 20:
* @author Marius Hoch < hoo@online.de >
*/
mw.loader.using( [ 'mediawiki.util', 'mediawiki.api' ], function() {
$( document ).ready( function() {
'use strict';
var oldRevision, newRevision, nextRevisionText, prevRevisionText;
/**
*
* @return {jQuery.promise}
*/
function getMessages() {
'previousdiff',
'nextdiff'
}
if ( mw.config.get( 'wgAction' ) !== 'view' ) {
Riga 51 ⟶ 63:
getPrevRevisionText();
} else {
getMessages()
▲ // Loading the interface message into the client, so it can be accessed by mw.msg
▲ return new mw.Api().loadMessagesIfMissing( ['nextdiff'] );
▲ } )
nextRevisionText = mw.msg( 'nextdiff' );
} )
.
}
Riga 70 ⟶ 79:
doLink();
} else {
getMessages()
} )
.
}
}
|