Jump to content

User:JPxG/current-switcher.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by JPxG (talk | contribs) at 03:06, 25 August 2021 (I saw this on the Internet. Maybe it'll work.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
$( function() {
    if( (window.location.href.indexOf( "Special:Contributions/" ) >= 0 ) || (window.location.href.indexOf( "Special%3AContributions" ) >= 0 )) {
    	$('.mw-pager-navigation-bar').append('&nbsp;&nbsp;<button type="button" id="currentrevs-hide">hide current</button><button type="button" id="currentrevs-show">show current</button>');
		// Add a listener to your button, that does something when it is clicked.
		$('#currentrevs-hide').click(function(e) {
			$( '.mw-contributions-current' ).hide();
		});
		$('#currentrevs-show').click(function(e) {
			$( '.mw-contributions-current' ).show();
		});
    }
} );