User:Equazcion/SidebarHistoryTools.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
This user script seems to have a documentation page at User:Equazcion/SidebarHistoryTools. |
if (mw.config.get( 'wgNamespaceNumber' ) !== -1) { // Serves no purpose on Special pages
// Create our History tools group by cloning the sidebar's existing Toolbox, insert the clone after Toolbox.
// Then add new 'histtools' class for referencing, remove cloned ID, and set its title.
$('#p-tb').clone(true).insertAfter($('#p-tb')).addClass('histtools').removeAttr('id').find('h3').text('History tools');
// Clear all links cloned with the Toolbox
$('.histtools li').remove();
// Create new links
$('.histtools .body ul').append('<li><a class="histTool1"></a></li>');
$('.histtools .body ul').append('<li><a class="histTool2"></a></li>');
$('.histtools .body ul').append('<li><a class="histTool3"></a></li>');
$('.histtools .body ul').append('<li><a class="histTool4"></a></li>');
$('.histtools .body ul').append('<li><a class="histTool5"></a></li>');
$('.histtools .body ul').append('<li><a class="histTool6"></a></li>');
$('.histtools .body ul').append('<li><a class="histTool7"></a></li>');
// Set each new link's text and url
// On 20190825 Tools 1/2/3/5 updated on this abandoned scrript
//$('.histTool1').text('Page logs').attr('href', 'http://en.wikipedia.org/w/index.php?title=Special:Log&page=' + mw.config.get( 'wgPageName' ) );
//$('.histTool2').text('Contributors').attr('href', 'http://toolserver.org/~daniel/WikiSense/Contributors.php?wikilang=en&wikifam=.wikipedia.org&grouped=on&page=' + mw.config.get( 'wgPageName' ));
//$('.histTool3').text('User edits').attr('href', 'http://toolserver.org/~snottywong/usersearch.html?page=' + mw.config.get( 'wgPageName' ));
//$('.histTool5').text('Page view stats').attr('href', 'http://stats.grok.se/en/latest/' + mw.config.get( 'wgPageName' ));
$('.histTool1').text('Page logs').attr('href', 'https://en.wikipedia.org/w/index.php?title=Special:Log&page=' + mw.config.get( 'wgPageName' ) );
$('.histTool2').text('Contributors').attr('href', 'https://xtools.wmflabs.org/articleinfo/en.wikipedia.org/' + mw.config.get( 'wgPageName' ));
$('.histTool3').text('User edits').attr('href', 'https://tools.wmflabs.org/jackbot/snottywong/usersearch.html?page=' + mw.config.get( 'wgPageName' ));
$('.histTool4').text('Watchers').attr('href', 'http://toolserver.org/~dispenser/cgi-bin/watcher.py?page=' + mw.config.get( 'wgPageName' ));
$('.histTool5').text('Page view stats').attr('href', ' https://tools.wmflabs.org/pageviews/?project=en.wikipedia.org&range=latest-200&pages=' + mw.config.get( 'wgPageName' ));
$('.histTool6').text('History stats').attr('href', 'https://tools.wmflabs.org/xtools/articleinfo/index.php?article=' + mw.config.get( 'wgPageName' ) + '&lang=en&wiki=wikipedia');
$('.histTool7').text('History search').attr('href', 'http://wikipedia.ramselehof.de/wikiblame.php?lang=en&article=' + mw.config.get( 'wgPageName' ));
}