MediaWiki:Gadget-SpecialPages.js/WantedFiles.js

// - Easier to read Special:WantedFiles

/* hideFalsePositives */// Function to actually remove the false positives like they never happened. function hideFalsePositives { // Count how many items are on the list to start (to replace the number with a new correct number when done) var strStartCountString = $( 'ol.special li' ).length.toString.replace(/\B(?=(\d{3})+(?!\d))/g, ","); // Actually remove the false positives $( 'del' ).parent( 'li' ).remove; // Count how many items are on the list at the end (to replace the starting number with) var strEndCountString = $( 'ol.special li' ).length.toString.replace(/\B(?=(\d{3})+(?!\d))/g, ","); // Replace the starting number with the new count (should be two of them) $( 'strong' ).each( function {   $( this ).html( $( this ).html.replace( strStartCountString, strEndCountString ) );  } );// End replacing the li count // Get rid of the extra text and link when done. $( 'del' ).parent( 'p' ).html(   $( 'del' ).parent( 'p' ).html    .replace( 'Files from foreign repositories may be listed despite existing.' + ' Any such false positives will be struck out ' + ' hide.' + ' Additionally, pages that embed files that do not exist are ', 'Pages that embed files that do not exist are also ' ) );// End replace block text }// End function

/* function addImageEntryToDatabase( filename ) { ( new mw.Api ).postWithToken( 'edit', {   action: 'upload',    ignorewarnings: true,    comment: encodeURI( 'Fixing Special:WantedFiles false positives with ReUploader.' ),    filename: encodeURI( filename ),    url: 'http://ddowiki.com/images/' + encodeURI( filename )  } ).done( function( uResult ) {    console.log( '%o', uResult );  } ); }

// Make sure that there are always 5,000 results (max results) if ( mw.util.getParamValue( 'limit' ) === null ) { location.href = location.href.replace( location.hash, '' ) + ( location.search ? '&' : '?' ) + 'limit=5000' }

// Find the -struck out- text and add a remove link after it so false positives are only removed on request. $( $( 'del' ).get( 0 ) ).after( ' hide ' );

// Add direct link to file and reupload link $( 'ol.special' ).find( 'del' ).siblings( 'a' ).each( function ( i ) { var thisImage = $( this ).siblings( 'del' ).text.replace( 'File:',  ).replace( ' ', '_' ).replace( /'/g, '\\\ );  $( this ).after( ' - file - upload'/* - Fix!'*/ ); } );

//