User:JPhil2.0/global.js

//Quick create userpage var qtUserPageTemplate = ""; var qtEnableUserPageOverwrite = true; function highlightAnons { //IP regular expression var ip = /\d{2,3}\.\d{2,3}\.\d{2,3}/; //Check if user is anon and highlight $(".mw-userlink").each(function {       var text = $(this).text;        if (text.match(ip)) {            //Highlight            $(this).css("background", "yellow");        }    }); } $(document).ready(function {   highlightAnons; });

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

// Account Navigation $(function { $('Global.css').insertBefore('.AccountNavigation .subnav li:first'); }); $(function { $('Global.js').insertBefore('.AccountNavigation .subnav li:first'); }); $(function { $('Special Pages').insertBefore('.AccountNavigation .subnav li:first'); }); $(function { $('Leaderboard').insertBefore('.AccountNavigation .subnav li:first'); }); $(function { $('<a href="/wiki/User blog:JPhil2.0">Blog</a></li>').insertBefore('.AccountNavigation .subnav li:first'); });

// Skin Switch Button for monobook to oasis and vice versa $( function {	if ( !document.getElementById( 'ca-skins' ) ) {		if ( skin === 'oasis' || skin === 'wikia' ) {			$( '<a href="/index.php?title=' + encodeURIComponent( wgPageName ) + '&useskin=monobook">MB</a></li>' ).appendTo( '#AccountNavigation' ); $( '<a href="/index.php?title=' + encodeURIComponent( wgPageName ) + '&useskin=wikiamobile">WM</a></li>' ).appendTo( '#AccountNavigation' );		} else {			$( '<a href="/index.php?title=' + encodeURIComponent( wgPageName ) + '&useskin=wikia">Oasis</a></li>' ).appendTo( '#p-cactions > .pBody > ul' ); $( '<a href="/index.php?title=' + encodeURIComponent( wgPageName ) + '&useskin=wikiamobile">Mobile</a></li>' ).appendTo( '#p-cactions > .pBody > ul' );		} 	} } );

//Advanced Tool Script $.getScript('https://raw.github.com/PrincessPlatinum/Ajax-Scripts/master/Advanced%20Tools.js'); //Misc. importArticles({   type: "script",    articles: [	"w:c:dev:MarkForDeletion/code.js",	"w:c:dev:AutoEditDropdown/code.js",	"w:c:dev:PurgeButton/code.js",	"w:c:dev:RevealAnonIP/usercode.js",	"w:c:dev:ListFiles/code.js",	"w:c:dev:View_Source/code.js",	"w:c:dev:ReferencePopups/code.js",	"w:c:dev:PortableCSSPad/code.js",	"w:c:dev:QuickCreateUserPage/code.js",	"w:c:dev:AllPagesHideRedirect/code.js",	"w:c:dev:BackToTopButton/code.js",	"w:c:dev:AjaxBatchDelete/code.js",	'w:c:dev:RelatedDiscussionsModule/code.js',	"w:c:admintools:MediaWiki:Wikia.js/cancelButton.js",    ] }); //Chat importScriptPage('User:Monchoman45/ChatHacks.js', 'c'); importScriptPage('User:Joeytje50/ChatPMs.js', 'c'); importScriptPage('MessageBlocker/code.js', 'dev'); importScriptPage('User:Madnessfan34537/multikick.js','cod'); importScriptPage("PageMakerPro/code.js", "dev"); importScriptPage('User:Joeytje50/tabinsert.js', 'runescape'); //Ajax Undo importScriptPage('MediaWiki:AjaxUndo.js', 'yuzura'); //Kick if (wgUserGroups.indexOf('chatmoderator')!=-1 || wgUserGroups.indexOf('sysop')!=-1) { $(function {	$('[name="message"]').keypress(function(e) { if (e.which == 13) { if (this.value.split(' ')[0] == '/kick') { e.preventDefault; var toKick = this.value.replace(/^\/kick /,'') if (!$('#WikiChatList [data-user="'+toKick+'"]').length) { confirm(toKick + ' is not in this chat. Still try to kick him?')?mainRoom.kick({name: toKick}):undefined; } else { mainRoom.kick({name: toKick}) }				this.value = ''; return true; }		}	}); }); }

//Auto Update ajaxPages = ["Special:WikiActivity","Special:RecentChanges","Special:Watchlist","Special:Log","Special:Contributions"]; AjaxRCRefreshText = 'Auto-refresh'; AjaxRCRefreshHoverText = 'Automatically refresh the page'; importScriptPage('AjaxRC/code.js', 'dev');

//No more image pop-ups window.wgEnableImageLightboxExt = false; function changeimagelinks { $('#WikiaArticle, .LatestPhotosModule, #article-comments').unbind('click.lightbox');

var a = document.getElementsByTagName('a'); for(var t = 0; t < a.length; ++t) { var a2 = a[t]; var img = a2.getElementsByTagName('img'); if(img[0] != null) { if (a2.href.indexOf('images.wikia.com') != -1) { var link = wgServer + '/wiki/File:' + a2.href.substring(a2.href.lastIndexOf('/') + 1); a2.setAttribute('href',link); }		}	} } addOnloadHook(changeimagelinks); //Toolbar extentions $('ul.tools li:first-child').before('<a href="http://c.wikia.com/wiki/Special:RandomWiki">Random Wiki'); $('ul.tools li:first-child').before('<a href="/wiki/Special:Log/block">Block Log'); $('ul.tools li:first-child').before('<a href="/wiki/Special:Log">Logs'); $('ul.tools li:first-child').before('<a href="/wiki/Special:RecentChanges?hideenhanced=1&hidelogs=1">Recent changes<li>'); //Move File code if (wgPageName.indexOf("Special:MovePage/File:") != -1 || (wgCanonicalNamespace == "File" && Storage)){ LIRoptions = { bottomMessage: 'This appears below the buttons on Special:MovePage', editSummary: 'Updating file link (automatic)', singleButtonText: 'Rename and replace', queueButtonText: 'Rename and add to queue' }  importScriptPage("FileUsageAuto-update/code.js/min.js", "dev"); } // Rename and delete buttons if (wgCanonicalNamespace == "File" && document.URL.indexOf("action=delete") == -1){ var escapedPageName = wgPageName; escapedPageName = encodeURIComponent(escapedPageName).replace(/'/g, "%27"); $('header.WikiaPageHeader').append("<a class='wikia-button' href='?action=delete'>Delete<a> <a class='wikia-button' href='/wiki/Special:MovePage/"+escapedPageName+"'>Rename<a>"); } // Variables (Auto protect-delete) var fdButtons = []; fdButtons[fdButtons.length] = { 'summary': 'vandalism', 'label': 'V' }; fdButtons[fdButtons.length] = { 'summary': 'spam', 'label': 'S' }; fdButtons[fdButtons.length] = { 'summary': 'Housekeeping', 'label': 'HK' }; fdButtons[fdButtons.length] = { 'summary': 'Terms of Use violation', 'label': 'ToU' }; // Import for Delete Protect importScriptPage('User:The Mol Man/FastDeleteProtect.js', 'a');