2016-04-19 12:45:09 +00:00
|
|
|
( function ( mw, $ ) {
|
|
|
|
mw.libs.revisionSlider = mw.libs.revisionSlider || {};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fetches up to 500 revisions at a time
|
|
|
|
*
|
2016-05-11 12:34:27 +00:00
|
|
|
* @param {{}} options - Options containing success /error callback, pageName and startId
|
2016-04-19 12:45:09 +00:00
|
|
|
*/
|
|
|
|
mw.libs.revisionSlider.fetchRevisions = function ( options ) {
|
|
|
|
$.ajax( {
|
|
|
|
url: mw.util.wikiScript( 'api' ),
|
|
|
|
data: {
|
|
|
|
action: 'query',
|
|
|
|
prop: 'revisions',
|
|
|
|
format: 'json',
|
|
|
|
rvprop: 'ids|timestamp|user|comment|parsedcomment|size|flags',
|
|
|
|
titles: options.pageName,
|
|
|
|
formatversion: 2,
|
|
|
|
rvstartid: options.startId,
|
|
|
|
'continue': '',
|
|
|
|
rvlimit: 500
|
|
|
|
},
|
2016-05-11 12:34:27 +00:00
|
|
|
success: options.success,
|
|
|
|
error: options.error
|
2016-04-19 12:45:09 +00:00
|
|
|
} );
|
|
|
|
};
|
|
|
|
}( mediaWiki, jQuery ) );
|