Page MenuHomeWickedGov Phorge

special.undelete.loadMoreRevisions.js
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

special.undelete.loadMoreRevisions.js

/*!
* JavaScript for Special:Undelete when results exceed REVISION_HISTORY_LIMIT.
*/
( function () {
'use strict';
const $linkSpan = $( '#mw-load-more-revisions' );
let $link = $( '<a>' );
$link = $linkSpan.wrapAll( $link ).on( 'click', () => {
// Get the URL of the last link in the list
const urlString = $( '.mw-undelete-revlist li:last-child a' ).prop( 'href' );
// Extract the timestamp
const timestamp = mw.util.getParamValue( 'timestamp', urlString );
const $oldList = $( '.mw-undelete-revlist' );
const $spinner = $.createSpinner( { size: 'large', type: 'block' } );
const path = mw.util.wikiScript() + '?' + $.param( {
title: mw.config.get( 'wgPageName' ),
target: mw.config.get( 'wgRelevantPageName' )
} );
$oldList.after( $spinner );
$.ajax( {
type: 'GET',
url: path,
dataType: 'html',
data: {
historyoffset: timestamp,
action: 'render'
},
success: function ( data, status, jqXHR ) {
$spinner.remove();
const $newDoc = $.parseHTML( data );
if ( !$newDoc.length ) {
return;
}
const $newList = $( $newDoc[ 0 ] );
$oldList.append( $newList.children() );
if ( jqXHR.status !== 206 ) {
$link.hide();
}
},
error: function ( data, textStatus, errorMessage ) {
$spinner.remove();
$link.show();
mw.log.error( errorMessage );
}
} );
} );
}() );

File Metadata

Mime Type
text/plain
Expires
Aug 19 2026, 18:24 (6 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
06/ea/f41502744929a95cfe37fde131a3
Default Alt Text
special.undelete.loadMoreRevisions.js (1 KB)

Event Timeline