User:Fandyllic/global.js

/* Back to top button on Wikia bottom tool bar */ importScriptPage('BackToTopButton/code.js', 'dev');

/* Edit button (classic editor) to right of page name header */ /* DISABLE, since you can now default to source editor, but still access new VE (but not old VE) $(function {    var currServer = mw.config.get('wgServer');	var newPageName = wgPageName.replace(/\?/,"\%3F");	var newTitle = wgTitle;	if (wgCanonicalNamespace) newTitle = wgCanonicalNamespace + ":" + wgTitle;	$('#WikiaPageHeader > h1').after(' Edit '); });

/* Purge link to right of page name header */ $(function {	var currServer = mw.config.get('wgServer');	var newPageName = wgPageName.replace(/\?/,"\%3F");	var newTitle = wgTitle;	if (wgCanonicalNamespace) newTitle = wgCanonicalNamespace + ":" + wgTitle;	$('.tally > em').before('  ');	/* PAGE TITLE LINK $('#WikiaPageHeader > h1').after('  ' + newTitle + ' '); */ });

/* History button for diffs */ /* (doesn't work on some namespaces like User: and User talk: */ /*   because w:Special:MyPage/global.js and Special:MyPage/wikia.js */ /*   never get loaded) */ $(function {	$("h1:contains('Changes:')").after('History '); })

/** * To use this script, install it and view:  Special:InterLangList?filtertype=interlanguage */ if (mediaWiki.config.get('wgCanonicalSpecialPageName') === 'Blankpage' && $.getUrlVar('filtertype') === 'interlanguage') { (function ($, mw) {		var url = mw.config.get('wgServer') + '/api.php?action=query&meta=siteinfo&siprop=interwikimap&format=json';		// get local interwiki map		$.getJSON(url, function (data) { var interlanguageWikis = [], map = data.query.interwikimap; for (var i = 0, len = map.length; i < len; i++) { if (map[i].language) { interlanguageWikis[interlanguageWikis.length] = map[i]; }			}			// display results in an HTML table $(function {				// generate html				var wiki, link, html, message;				message = ' The ' + mw.config.get('wgSiteName') + ' appears to be available in ' + interlanguageWikis.length + ' language(s).  Do you know of a version of this wiki in a language not listed here? You can make a request here for it to be interlanguage linked. ';				html = ' ' + message + ' ';				// insert html				document.title = 'Interlanguage wikis';				$('#firstHeading, #WikiaArticle h1').first.text('Interlanguage wikis');				$('#mw-content-text').html(html);			}); });	}(jQuery, mediaWiki)); }

/* Skin switch links at top bar */

function addSkinSwitchButton { switch (skin) { case 'answers': $('Monobook</a></li> <li>Oasis</a></li> <li>Wikia App</a></li>').appendTo('#page_controls'); break;

case 'uncyclopedia': // pass to monobook case 'monobook': $(' Oasis</a></li> <li>Wikia App</a></li>').appendTo('#p-cactions > .pBody > ul'); break;

case 'oasis': case 'wikia': $(' Monobook</a></li>  <li>Wikia Mobile</a></li>').appendTo('#GlobalNavigation'); break;

case 'app': case 'wikiaapp': $(' Monobook</a></li> Wikia Mobile</a></li> ').appendTo('#GlobalNavigation'); break;

case 'wikiamobile': $(' Oasis</a>  Wikia App</a> ').appendTo('a[href="http://community.wikia.com/wiki/Community_Central"'); break; } }

if (wgNamespaceNumber != -1 && !window.SkinSwitchLoad) { addOnloadHook(addSkinSwitchButton); } var SkinSwitchLoad = true; // prevent duplication

/* Add Contributions to user drop down */ $(function {   $('ul.AccountNavigation li:first-child ul.subnav li:first-child').after('<li>Contributions</a></li>'); });

/* Convert "Anonymous" in Comments to IP address from User:Monchoman45                        */ $(function {   var list = document.getElementsByTagName('a');    for(var i in list) {        if(list[i].href && list[i].href.indexOf('Special:Contributions/') && list[i].innerHTML == 'A Wikia contributor') {            list[i].innerHTML = list[i].href.substring(list[i].href.lastIndexOf('/') + 1, list[i].href.length);        }    } }); /* END Convert "Anonymous" in Comments to IP address */

/* Adds a 'Back to page' link under the preview header when previewing an edit. */ $(function {   if (wgAction == "submit") {        $('#WikiaEditBoxHeader p').clone.appendTo('#WikiaPageHeader:first-child');    } });

/* Experimental auto signer http://dev.wikia.com/wiki/Sine */ /* Disable for now importScriptPage('Sine/code.js', 'dev');

/* See User:Fandyllic/langwikicheckerJS for a copy of JS at Thread:484838   */