Community Central
Community Central

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* 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('<div style="float:right; margin-right:12px;"><a class="wikia-button" href="'+currServer+'/index.php?title=' + newPageName + '&action=edit">Edit</a></div>');
});
*/

/* 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('<span style="margin-right:6px;"><a href="'+currServer+'/index.php?title=' + newPageName + '&action=purge"><img src="http://images3.wikia.nocookie.net/wowwiki/images/8/88/Wiki-purge-icon_15.png"/><!--&nbsp;Purge link--></a></span>');
	/* PAGE TITLE LINK $('#WikiaPageHeader > h1').after('<div style="float:right;"><a href="http://images3.wikia.nocookie.net/wowwiki/images/8/88/Wiki-purge-icon_15.png/index.php?title=' + newPageName + '&action=purge"><img src="http://images3.wikia.nocookie.net/wowwiki/images/8/88/Wiki-purge-icon_15.png"/>&nbsp;' + newTitle + '</a></div>'); */
});

/* 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('<a class="button" data-id="history" href="/' + wgPageName + '?action=history" style="margin-top:2px; vertical-align:top;">History</a>&nbsp;');
})

/**
 * 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 = '<p>The ' + mw.config.get('wgSiteName') + ' appears to be available in ' + interlanguageWikis.length + ' language(s).</p><p>Do you know of a version of this wiki in a language not listed here? You can make a request <a title="Community Central:Interlanguage link requests" href="http://community.wikia.com/wiki/Community_Central:Interlanguage_link_requests">here</a> for it to be <a title="Help:Interlanguage links" href="http://community.wikia.com/wiki/Help:Interlanguage_links">interlanguage linked</a>.</p>';
 
				html = '<div id="interlanguage-wikis-container">' + message + '<table id="interlanguage-wikis-table" class="wikitable"><thead><tr><th>Prefix</th><th>Language</th><th>URL</th></thead><tbody>';
 
				for (var i = 0, len = interlanguageWikis.length; i < len; i++) {
					wiki = interlanguageWikis[i];
					link = wiki.url.substring(wiki.url.indexOf('http://') + 7);
					link = link.substring(0, link.indexOf('/'));
					link = '<a href="http://' + link + '">' + link + '</a>'; 
					html += '<tr><td>' + wiki.prefix + '</td>' + '<td>' + wiki.language + '</td>' + '<td>' + link + '</td></tr>';
				}
				html += '</tbody></table></div>';
 
				// 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':
        $('<li><a id="skins" href="/index.php?title=' + encodeURIComponent(wgPageName) + '&useskin=monobook" rel="nofollow" style="font-size:60%;">Monobook</a></li> <li><a id="skins" href="/index.php?title=' + encodeURIComponent(wgPageName) + '&useskin=wikia" rel="nofollow" style="font-size:60%;">Oasis</a></li> <li><a id="skins" href="/index.php?title=' + encodeURIComponent(wgPageName) + '&useskin=wikiaapp" rel="nofollow" style="font-size:60%;">Wikia App</a></li>').appendTo('#page_controls');
        break;

    case 'uncyclopedia':
        // pass to monobook
    case 'monobook':
        $('<li id="skins"><a href="/index.php?title=' + encodeURIComponent(wgPageName) + '&useskin=wikia" style="font-size:60%;">Oasis</a></li> <li><a id="skins" href="/index.php?title=' + encodeURIComponent(wgPageName) + '&useskin=wikiaapp" rel="nofollow" style="font-size:60%;">Wikia App</a></li>').appendTo('#p-cactions > .pBody > ul');
        break;

    case 'oasis':
    case 'wikia':
        $('<li id="skins"><a href="/index.php?title=' + encodeURIComponent(wgPageName) + '&useskin=monobook" style="font-size:60%;">Monobook</a></li>   <li><a id="skins" href="/index.php?title=' + encodeURIComponent(wgPageName) + '&useskin=wikiamobile" rel="nofollow" style="font-size:60%;">Wikia Mobile</a></li>').appendTo('#GlobalNavigation');
        break;

    case 'app':
    case 'wikiaapp':
        $('<li id="skins"><a href="/index.php?title=' + encodeURIComponent(wgPageName) + '&useskin=monobook" style="font-size:60%;">Monobook</a></li> <li id="skins"><a href="/index.php?title=' + encodeURIComponent(wgPageName) + '&useskin=wikiamobile" style="font-size:60%;">Wikia Mobile</a></li> ').appendTo('#GlobalNavigation');
        break;

    case 'wikiamobile':
        $('<span><a href="/index.php?title=' + encodeURIComponent(wgPageName) + '&useskin=wikia" style="font-size:60%;">Oasis</a></span>   <span><a id="skins" href="/index.php?title=' + encodeURIComponent(wgPageName) + '&useskin=wikiaapp" rel="nofollow" style="font-size:60%;">Wikia App</a></span>').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><a href="/wiki/Special:Contributions/' + encodeURIComponent(wgUserName) + '">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');
*/