mediawiki-extensions-Revisi.../modules/ext.RevisionSlider.fetchRevisions.js
Leszek Manicki 94405e7f6d Add a simple JSDuck config file
Running jsduck command generates API documentation to docs directory.

Change-Id: I1f9acbaf7868ebf48a56d20d6906cbcf23ef9748
2016-06-22 14:40:27 +02:00

30 lines
771 B
JavaScript

( function ( mw, $ ) {
mw.libs.revisionSlider = mw.libs.revisionSlider || {};
/**
* @member RevisionSlider
* Fetches up to 500 revisions at a time
*
* @param {Object} options - Options containing callbacks for `success` and `error` as well as fields for
* `pageName` and `startId`
*/
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
},
success: options.success,
error: options.error
} );
};
}( mediaWiki, jQuery ) );