mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-15 19:49:30 +00:00
bc9ae355dc
Change-Id: Ic03e25acb751f6cb9f9e832dae71bef01622afc4
29 lines
775 B
JavaScript
29 lines
775 B
JavaScript
( function ( mw, $ ) {
|
|
var DiffPage = function () {
|
|
};
|
|
|
|
$.extend( DiffPage.prototype, {
|
|
refresh: function ( revId1, revId2 ) {
|
|
$( 'body' )
|
|
.find( 'table.diff[data-mw=\'interface\']' )
|
|
.append( '<div id="revision-slider-darkness"></div>' );
|
|
$.ajax( {
|
|
url: mw.util.wikiScript( 'index' ),
|
|
data: {
|
|
diff: Math.max( revId1, revId2 ),
|
|
oldid: Math.min( revId1, revId2 )
|
|
},
|
|
success: function ( data ) {
|
|
data = $( '<div/>' ).html( data ).contents();
|
|
$( 'body' )
|
|
.find( 'table.diff[data-mw=\'interface\']' )
|
|
.html( data.find( 'table.diff[data-mw=\'interface\']' ) );
|
|
}
|
|
} );
|
|
}
|
|
} );
|
|
|
|
mw.libs.revisionSlider = mw.libs.revisionSlider || {};
|
|
mw.libs.revisionSlider.DiffPage = DiffPage;
|
|
}( mediaWiki, jQuery ) );
|