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('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('LastEdited/code.js', 'dev');

var c = mw.config.get( [   'wgArticlePath',    'wgPageName',    'wgCanonicalSpecialPageName',    'wgTitle',    'wgAction',    'wgCanonicalNamespace',    'wgNamespaceNumber',    'wgUserGroups',    'wgSiteName',    'skin' ] ), tempArray, escapedPage = encodeURIComponent(c.wgPageName);
 * (function($, mw) {

/* add powerusers checkbox to Special:Listuers */ if (wgCanonicalSpecialPageName == "Listusers") $("fieldset.lu_fieldset tr:last-child").prepend('  Power Users ');

/* LastEdited Customization */ window.lastEdited = { avatar: false };

/* AjaxRC Customization */ if (mw.config.get('wgCanonicalSpecialPageName') == 'WikiActivity') { mw.util.addCSS(       '#ajaxRefresh {' +            'position: absolute;' +            'right: 0;' +            'bottom: 10px;' +        '}' +        '#ajaxLoadProgress {' +            'margin-left:5px;' +        '}'    ); } window.ajaxCallAgain = window.ajaxCallAgain || []; window.ajaxCallAgain.push(function {   $('.rc-conntent, .activityfeed')        .find('a')        .each(function { $(this).attr('target', '_blank'); }); }); window.ajaxPages = ['Special:RecentChanges', 'Special:WikiActivity'], window.ajaxRefresh = 30000; importScriptPage('AjaxRC/code.js', 'dev'); importScriptPage('AjaxBatchDelete/code.2.js', 'dev'); importScriptPage('AjaxUndo/code.js', 'dev'); importScriptPage('AjaxRedirect/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'); });

/* Masthead modifications */ if ($("#UserProfileMasthead").size) $("#UserProfileMasthead .tally em").wrap($("").attr("href", "/Special:Editcount/"+$("#UserProfileMasthead h1[itemprop=name]").html));

/* Wiki Activity to Recent Changes */ $('[data-canonical="wikiactivity"]') .attr('href', '/wiki/Special:RecentChanges') .html('Recent Changes'); $('.rc-conntent, .activityfeed') .find('a') .each(function {       $(this).attr('target', '_blank');    }); /* IP lookup on contribs */ if (c.wgCanonicalSpecialPageName == "Contributions" && $('#anontalktext').length && c.wgTitle.split('.').length == 4) $('.masthead-info h2').html('<a style="color:white" href="http://myip.ms/info/whois/'+c.wgPageName.split('/')[1]+'">(lookup)</a>'); /* InactiveUsers Customization */ InactiveUsers = { months: 1 }; importScriptPage('InactiveUsers/code.js', 'dev');

/* Always go to IP contributions, not userpage */ if (c.wgNamespaceNumber == 2 && $('h2:contains("A Wikia Contributor")').length) location.replace("/wiki/Special:Contributions/"+c.wgPageName.split(':')[1]);

/* Thread modifications @author 452 */ 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>)"); });

/* Untick minor edit box after 10 seconds when editing */ if (c.wgAction === 'edit' || c.wgAction === 'submit') { setTimeout(function {   if ($('#wpMinoredit').attr('Checked'))       $('#wpMinoredit').removeAttr('checked');  }, 10000); }

/* Toolbar modifications */ if ($('.toolbar > .tools').length) { $('.toolbar > .tools > li:last').after(   $('').append('<a href="/index.php?title='+escapedPage+'&allowuserjs=0">No User JS</a>'),    $('').append('<a href="/index.php?title='+escapedPage+'&allowusercss=0">No User CSS</a>'),    $('').append('<a href="/index.php?title='+escapedPage+'&usesitejs=0">No Site JS</a>'),    $('').append('<a href="/index.php?title='+escapedPage+'&usesitecss=0">No Site CSS</a>')  ); }

/* Skin Switch Buttons */ $('.start-wikia-container').html(   '<a href="/wiki/' + mw.config.get('wgPageName') + (document.URL.indexOf('?') > -1 ? '&' : '?') + 'useskin=monobook" class="start-wikia">M</a>' +    '<a href="/wiki/' + mw.config.get('wgPageName') + (document.URL.indexOf('?') > -1 ? '&' : '?') + 'useskin=wikiamobile" class="start-wikia" style="margin-left:10px">W</a>' +    '<a href="/wiki/' + mw.config.get('wgPageName') + (document.URL.indexOf('?') > -1 ? '&' : '?') + 'uselang=qqx" class="start-wikia" style="margin-left:10px">Q</a>' ); }) (this.jQuery, this.mediaWiki);