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('User:Joeytje50/ChatPMs.js', 'c');

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

/* Start a wikia to Skin Changer/Wiki Activity to Recent Changes */ $('.start-wikia') .attr('href', '/wiki/' + mw.config.get('wgPageName') + '?useskin=monobook') .find('span').html('Monobook'); $('[data-canonical="wikiactivity"]') .attr('href', '/wiki/Special:RecentChanges') .html('Recent Changes'); $('.rc-conntent') .find('a') .each(function {       $(this).attr('target', '_blank');    });

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

/**        * @desc For preventing autoplay on embedded youtube videos *      which are normally embedded through templates and MediaWiki pages *        * @author Bobogoobo  * @author Cqm */       switchAutoplay: function  { $( '[src*="youtube.com"]' ).each( function {                var $this = $( this ),                    source = $this.attr( 'src' );                if ( source.indexOf( 'autoplay=' ) > -1 ) {                    $this.attr( 'src', source.replace( 'autoplay=1',  ).replace( 'autoplay=0',  ) );                }                // for embedded flash files                // which are so annoying they get their own console message                if ( $this.prop( 'tagName' ) === 'EMBED' ) {                    console.log( 'kill embed with fiyah' );                    $this.remove;                }            } ); }