This is the current revision of this page, as edited by MusikAnimal (talk | contribs) at 16:03, 26 September 2020 (rm {{pp-template}} as page is not template-protected; user CSS/JS is automatically protected so only yourself or interface admins can edit it, anyway). The present address (URL) is a permanent link to this version.
Revision as of 16:03, 26 September 2020 by MusikAnimal (talk | contribs) (rm {{pp-template}} as page is not template-protected; user CSS/JS is automatically protected so only yourself or interface admins can edit it, anyway)(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)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. |
Documentation for this user script can be added at User:GoldenRing/userlinks. |
// <pre> <nowiki> (function() { $(document).ready(function() { var div = $("<div></div>"); div.css({ display: 'none', border: 'solid thin black', position: 'absolute', 'background-color': '#ffffff', 'z-index': '10', padding: '0.3em' }); div.attr('id', 'gr-userlinks-hover'); $('body').append(div); var hidetimer = null; var hidebox = function() { $('#gr-userlinks-hover').css('display', 'none'); hidetimer = null; } var wikilink = function(l, t) { return '<a href="' + mw.config.get('wgServer') + '/' + l + '">' + t + '</a>'; } $("a.userlink, a.mw-userlink").hover( function() { if (hidetimer != null) { window.clearTimeout(hidetimer); } var title = $(this).attr('title'); var username = title.split(':'); var dne = ' (page does not exist)'; if( username.endsWith(dne) ) username = username.substring(0, username.indexOf(dne)); if( username.indexOf(";") > 0 ) username = username.substring(0, username.indexOf(";")); console.log(username); $('#gr-userlinks-hover') .html(wikilink('User talk:' + username, 'talk') + ' ' + wikilink('Special:Contributions/' + username, 'contribs') + ' <a href="https://xtools.wmflabs.org/ec/en.wikipedia.org/' + username + '">X!</a> ' + wikilink('Special:Log/' + username, 'log') + ' ' + wikilink('Special:Log/block?page=' + username, 'block log') + ' ' + wikilink('Special:DeletedContributions/' + username, 'deleted contribs')) .css({ display: 'block', top: $(this).offset().top + $(this).height() + 3, left: $(this).offset().left }); }, function() { hidetimer = window.setTimeout(hidebox, 250); } ); $("#gr-userlinks-hover").hover( function() { if (hidetimer != null) window.clearTimeout(hidetimer); }, function() { hidetimer = window.setTimeout(hidebox, 250); } ); }); } ()); // </nowiki> </pre>