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('CategoryRenameAuto-update/code.js', 'dev'); importScriptPage('FileUsageAuto-update/code.js', 'dev'); importScriptPage('MassCategorization/code.js', 'dev'); importScriptPage('NoImageLightbox/code.js', 'dev'); importScriptPage('User:Monchoman45/ChatHacks.js', 'c'); importScriptPage('SkinSwitchButton/code.js', 'dev'); $.getScript('https://raw.github.com/sactage/wikia-js-snippets/master/ChatOptions.js');

/* AjaxRC Customization */ if (mw.config.get('wgCanonicalSpecialPageName') == 'WikiActivity') { mw.util.addCSS(       '#ajaxRefresh {' +            'position: absolute;' +            'right: 0;' +            'bottom: 10px;' +        '}' +        '#ajaxLoadProgress {' +            'margin-left:5px;' +        '}'    ); } window.ajaxRefresh = 30000; window.ajaxPages = ["Special:RecentChanges","Special:Watchlist","Special:Log","Special:Contributions"]; importScriptPage('AjaxRC/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 */ $('[data-canonical="wikiactivity"]') .attr('href', '/wiki/Special:RecentChanges') .html('Recent Changes');

/* 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');

/* 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      username = decodeURIComponent($(this).children('a.mw-userlink,a.new mw-userlink').attr('href').split(':')[1])+'\n',      text = IP + ' ' + decodeURIComponent($(this).children('a.mw-userlink,a.new mw-userlink').attr('href').split(':')[1])+'\n', //Username      IPLookup = '(lookup', IPContribs = ' | <a href="/wiki/Special:Contributions/'+IP+'">contribs</a>', IPBlock = ' | <a href="/wiki/Special:Block/'+IP+'">block</a>'; IPHistory = ' | <a href="/wiki/Special:Log/chatconnect?user='+username+'">history</a>)';     $(this).append(IPLookup).append(IPContribs).append(IPBlock).append(IPHistory);      $('#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

/* Thread modifications, Editing modifications @author 452 */ if ($(".WikiaPageHeaderDiffHistory").length && $(".wikia-button[data-id=edit]").attr("href").length) { /* change the "edit" link of a diff page to edit the current version, as there is already an edit link for both diffs */ oldhref = $(".wikia-button[data-id=edit]").attr("href"); var newhref = oldhref.split("&oldid=")[0]; $(".wikia-button[data-id=edit]").attr("href", newhref); } if (!$("#ca-diff").length && $("a[data-id='history']").closest("ul")) { //adapted from NullEditButton script $("a[data-id='history']").closest("ul").prepend($('<a/>').find("a").attr({ href: window.location.origin+window.location.pathname+"?diff=cur", accesskey: "0", id: "ca-diff", title: mw.config.get('wgPageName') }).text("Last diff")) } if ((wgNamespaceNumber == 1201) && !$(".msg-title a").text) { $("ul.replies").prepend("<h1 class='center'><a href="+$(".msg-title a").attr("href")+">Link to parent thread</a> </li>"); } if ($(".replies .SpeechBubble.message").length) $(".replies .SpeechBubble.message").each(function{ $(".timestamp", this).append("(<a href='./Thread:"+$(this).attr("data-id")+"'>link</a>)"); });