User:Technical 13/Scripts/Gadget-watchlistCleaner.js

if ( mw.config.get( 'wgPageName' ) == "Special:Watchlist" ) { if($( 'a:contains("since last visit")' ).length >= 1){ $( 'a:contains("since last visit")' ).each(function{			$(this).html($(this).html.replace( 'since last visit', 'new' ) )		}); }	if( window.screen.width < 640 ){ $( 'span.mw-watchlist-toollinks' ).html( $( 'span.mw-watchlist-toollinks' ).html.replace( / \| /g, '&thinsp;•&thinsp;' ).replace( 'View relevant changes', 'V' ).replace( 'View and edit watchlist', 'E' ).replace( 'Edit raw watchlist',  'R' ).replace( 'Clear the watchlist',  'D' ) ); var wlCount = $( '#mw-content-text' ).find( 'p b' ).text;// Get the count of pages on watchlist $( 'input[name="dummy"]' ).val( ' — Mark all ' + wlCount + ' watchlisted pages as visited. — ' );// Update button $( '#mw-content-text' ).find( 'p b' ).closest( 'p' ).remove;// Remove now obsolete sentence $( 'span#mw-wlheader-showupdated' ).remove;// Remove notice that all changed are bold $( 'form#mw-watchlist-form' ).remove;// Remove the controls for changing how the page is displayed }

/* Code to temporarily disable the "Mark all as read" button. Comment this code out when not needed for testing. */	$( 'input[name="dummy"]' ).val( $( 'input[name="dummy"]' ).val + ' — temporarily disabled' ).attr( 'disabled','disabled' ); $('input[name="dummy"]').after('<input type="button" id="enable-ma" onClick="$(\'input[name=dummy]\').removeAttr(\'disabled\'); $(\'input#enable-ma\').remove;" value="← Enable the mark all button" />'); }

/* Start working on condensing each row to new posts or last posts without expanding when using enhanced recent changes

var newEdits = []; $('table.mw-enhanced-rc').each(function {    newEdits = $(this).find('span.mw-title').closest('td').find('a:nth-child(3)').text.match(/(\d)/);    if (newEdits !== null) {        newEdits = parseInt(thisRowsNewEdits[1].replace(/,/g,''), 10);    } else {        newEdits = parseInt(0, 10);    }    for(var i = 0; i <= newEdits; i++){ // Just got to find the right element...        console.log('%o', $(this).find('td.mw-enhanced-rc-nested a.mw-userlink:nth-child(3)').text);    }    newEdits = []; });

/* Pagenames: *//* $('table.mw-enhanced-rc').each(function{	console.log("%o", $(this).find('span.mw-title').text//; ); });