User:Evad37/Watchlist-hideAWB.js

function setupHideAWB { // Add a class to list items with AWB in edit summary $( "a[title='Wikipedia:AWB'], a[title='Wikipedia:AutoWikiBrowser']" ).closest("li, tr").addClass("watchlist-awb-edit");

// Show/hide AWB edits mw.util.addPortletLink( 'p-cactions', '#', 'Hide AWB', 'ca-hideAWB', "Hide AWB edits" ); mw.util.addPortletLink( 'p-cactions', '#', 'Show AWB', 'ca-showAWB', "Show AWB edits" ); // 'Hidden by default' option if ( window.awbHiddenByDefault ) { $(".watchlist-awb-edit").hide; $('#ca-hideAWB').hide; } else { $('#ca-showAWB').hide; }	$('#ca-hideAWB').on('click', function {		$(".watchlist-awb-edit").hide;		$('#ca-showAWB').show;		$('#ca-hideAWB').hide;		return false;	}); $('#ca-showAWB').on('click', function {		$(".watchlist-awb-edit").show;		$('#ca-showAWB').hide;		$('#ca-hideAWB').show;		return false;	});

}

if( mw.config.get('wgNamespaceNumber') === -1 ) { // Only operate in Special: namespace $.when( mw.loader.using( ['mediawiki.util'] ), $.ready).done( setupHideAWB ); }