MediaWiki:Gadget-MultiDiffConsecutive.js: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m parametro non più utilizzato (v. T206319) |
Riscrivo funzione per ottenere i messaggi di sistema con le API, rielaborando codice di User:Titore (https://it.wikipedia.org/w/index.php?oldid=100195482&diff=100196971). Separo l'onReady dal resto per chiarezza e aggiungo nomi alle funzioni anonime per migliore lettura delle stack trace |
||
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 ⟶ 21:
* @author Marius Hoch < hoo@online.de >
*/
mw.loader.using( 'mediawiki.util', function() {▼
$( document ).ready( function() {▼
'use strict';
var oldRevision, newRevision, nextRevisionText, prevRevisionText;
/**
* Load missing messages needed by this script
*
* @return {jQuery.promise}
*/
function
return
▲ } );
}
Riga 70 ⟶ 64:
getPrevRevisionText();
} else {
loadMessages()
.
▲ }, function rejected() {
} )
.
}
Riga 90 ⟶ 80:
doLink();
} else {
loadMessages()
▲ getMessage( 'previousdiff' )
.
prevRevisionText =
} )
.
}
}
Riga 144 ⟶ 130:
}
}
}
▲$( document ).ready( function init () {
} );
|