User:Nanaki/global.js

importArticles({   type: "script",    articles: [      "w:c:dev:NoImageLightbox/code.js",      "w:c:dev:AjaxBatchDelete/code.js",    ] });

function lookupContribsLink { if($('#contentSub').length==0) return; var allLinks = $('#contentSub > A'); var lastLink = $('#contentSub > A:last-child'); for(var x=0;x<allLinks.length;x++) { var el = $(allLinks[x]) if (el.html == 'LookupContribs') { lastLink.after(el); lastLink.after(' • ') break; } else if (el.html == 'PhalanxBlock') { var clone = el.clone lastLink.after(clone); lastLink.after(' • ') clone.attr('title', 'Wyświetlić globalne edycje użytkownika') clone.html('LookupContribs') clone.attr('href', clone.attr('href').replace('Special:Phalanx', 'Special:LookupContribs')); break; };	}	$('#contentSub').html($('#contentSub').html.replace(/•\s+•/,'•')) return; }

function userLinkToCentral { if($('#UserProfileMasthead').length==0) return; var hgroup = $('#UserProfileMasthead hgroup'); var user = hgroup.find('> H1:first-child').html; var css = { 'background-color': 'rgba(255,255,255,0.9)', 'border-radius': '3px', 'display': 'inline-block', 'padding': '3px 5px', 'margin': '2px 5px', 'height': '16px', 'line-height': '16px', 'vertical-align': 'middle', }	var en = $(document.createElement('span')).css(css).append(''); var pl = $(document.createElement('span')).css(css).append(''); var container = $(document.createElement('div')).css({		'float': 'right',		'height': '38px',		'line-height': '38px',		'vertical-align': 'middle',		'margin-right': '-15px',	}); if(! /spolecznosc.wikia.com/.test(location.href)) container.append(pl); if(! /community.wikia.com/.test(location.href)) container.append(en); hgroup.append(container); } addOnloadHook(lookupContribsLink); addOnloadHook(userLinkToCentral);