User:JPhil2.0/global.js

/* =========================================================================    JS for monobook and oasis applied to all wikia wikis. @author JPhil2.0 ========================================================================== */ importScriptPage('CapsFirst/code.js', 'dev'); importScriptPage('WHAM/code.2.js', 'dev'); importScriptPage('PortableCSSPad/code.js', 'dev'); importScriptPage('HeaderLinks/code.js', 'dev'); importScriptPage('View_Source/code.js', 'dev'); importScriptPage('RevealAnonIP/usercode.js', 'dev' ); importScriptPage('User:Wildream/SoundNotifications.js', 'ru.community'); importScriptPage('User:Wildream/ChatQuote/code.js', 'ru.community'); importScriptPage('User:Foodbandlt/FixedChatHacks.js', 'c'); importScriptPage('CategoryRenameAuto-update/code.js', 'dev'); importScriptPage('FileUsageAuto-update/code.js', 'dev'); importScriptPage('RedirectManagement/code.js', 'dev'); importScriptPage('MassCategorization/code.js', 'dev'); importScriptPage('MassNullEdit/code.js', 'dev'); importScriptPage('MassRenameRevert/code.js', 'dev'); importScriptPage('NoImageLightbox/code.js', 'dev');

/* Ajax Customization */ window.ajaxPages = ["Special:RecentChanges","Special:Watchlist","Special:Log","Special:Contributions"]; window.ajaxIndicator = 'http://www.stspress.com/wp-content/themes/bravo/images/ajax-loader.gif'; importScriptPage('AjaxRC/code.js', 'dev'); importScriptPage('AjaxTemplate/code.js', 'dev'); importScriptPage('AjaxBatchDeleteV2/code.js', 'dev'); importScriptPage('AjaxUndo/code.js', 'dev'); importScriptPage('AjaxPatrol/code.js', 'dev' );

/* QuickCreateUserPage Customization */ var qtUserPageTemplate = ""; var qtEnableUserPageOverwrite = true; importScriptPage('QuickCreateUserPage/code.js', 'dev');

/* Custom Account Navigation */ $(function { $('Contributions').insertBefore('.AccountNavigation .subnav li:first'); }); $(function { $('Global.css').insertBefore('.AccountNavigation .subnav li:first'); }); $(function { $('Global.js').insertBefore('.AccountNavigation .subnav li:first'); });

/* Wiki Activity to Recent Changes */ if (mw.config.get('skin') === 'oasis') { $(function {       $("a[data-canonical='wikiactivity']").attr('href', '/wiki/Special:RecentChanges').text('Recent Changes');        if (mw.config.get('wgCityId') == 177) {            $("a[data-canonical='chat']").click(function (event) { event.preventDefault; });       }    }); }

/* Add quick link to IP location lookup for anon contributors */ if (mw.config.get("wgCanonicalSpecialPageName") === "Contributions" && ($('a:contains("Why create an account?")').length == 1)) { $('.masthead-info').find('h2').html(" (Lookup)"); } /* InactiveUsers Customization */ InactiveUsers = { months: 1 }; importScriptPage('InactiveUsers/code.js', 'dev');

/* Thread history return to thread */ if (page.split(':')[0] == "Thread" && action == "history") $('.SortingBar').after('Back to thread');

/* Always go to IP contributions, not userpage */ if (mw.config.get('wgNamespaceNumber') == 2 && title.split('.').length == 4) location.replace("/wiki/Special:Contributions/"+mw.config.get('wgPageName').split(':')[1]);

/* if ("Special:Log/chatconnect".indexOf(mw.config.get('wgPageName')) !== -1) { $('li.mw-logline-chatconnect').each(function {     var IP = $(this).text.match(/((?:\d{1,3}\.){3}\d{1,3})/)[0], //IP      text = IP + ' ' + decodeURIComponent($(this).children('a.mw-userlink,a.new mw-userlink').attr('href').split(':')[1])+'\n', //Username      IPLookup = '(<a href="http://myip.ms/info/whois/'+IP+'">lookup</a>', IPContribs = ' | <a href="/wiki/Special:Contributions/'+IP+'">contribs</a>', IPBlock = ' | <a href="/wiki/Special:Block/'+IP+'">block</a>)';     $(this).append(IPLookup).append(IPContribs).append(IPBlock);      $('#output-box').append(text);   }); $('#button-filter').click(function {      var uniqueDetails = [],       nameList = $('#output-box').val;      $.each(nameList.split(/\n/), function(i, details) { if ($.inArray(details, uniqueDetails) === -1) uniqueDetails.push(details); });          $('#output-box').val(uniqueDetails.sort.join('\n').trim);	      }); }
 * Advanced chatconnect log interface
 * Filter button for all unique IPs to users in chat in a text box + IP lookup, contribs and block links
 * @author Ozuzanna