2 * JavaScript for Special:Undelete when results exceed REVISION_HISTORY_LIMIT.
6 const $linkSpan = $( '#mw-load-more-revisions' );
7 let $link = $( '<a>' );
9 $link = $linkSpan.wrapAll( $link ).on( 'click', () => {
10 // Get the URL of the last link in the list
11 const urlString = $( '.mw-undelete-revlist li:last-child a' ).prop( 'href' );
12 // Extract the timestamp
13 const timestamp = mw.util.getParamValue( 'timestamp', urlString );
14 const $oldList = $( '.mw-undelete-revlist' );
15 const $spinner = $.createSpinner( { size: 'large', type: 'block' } );
16 const path = mw.util.wikiScript() + '?' + $.param( {
17 title: mw.config.get( 'wgPageName' ),
18 target: mw.config.get( 'wgRelevantPageName' )
21 $oldList.after( $spinner );
28 historyoffset: timestamp,
31 success: function ( data, status, jqXHR ) {
33 const $newDoc = $.parseHTML( data );
34 if ( !$newDoc.length ) {
37 const $newList = $( $newDoc[ 0 ] );
38 $oldList.append( $newList.children() );
39 if ( jqXHR.status !== 206 ) {
43 error: function ( data, textStatus, errorMessage ) {
46 mw.log.error( errorMessage );