MediaWiki:Wikia.js

/* */

var SocialMediaButtons = { position: "top", colorScheme: "color" }; cacheSkip = []; cacheSkipLimit = 5000; importArticles({   type: 'script',    articles: [        'MediaWiki:Common.js/displayTimer.js',        'MediaWiki:Tags.js',        'MediaWiki:LWN.js',        'u:dev:ListAdmins/code.js',        'u:dev:UserTags/code.js',        'u:dev:MiniComplete/code.js',        'u:dev:SocialIcons/code.js',          'u:dev:CacheCheck/code.js'    ] });

/* Don't need this anymore, but preserving to demonstrate how to use adobe edge fonts

I don't think I actually figured out which one of these statements was the better for fixing things

mw.loader.load( 'http://use.edgefonts.net/aclonica;aguafina-script;numans;adamina;andada:n4:all;averia-serif-libre;belgrano;bebas-neue:n4:all.js' );

$.getScript ('http://use.edgefonts.net/aclonica;aguafina-script;numans;adamina;andada:n4:all;averia-serif-libre;belgrano;bebas-neue:n4:all.js');

window.UserTagsJS = { modules: {}, tags: {} }; UserTagsJS.modules.inactive = 30; UserTagsJS.modules.newuser = true; UserTagsJS.modules.autoconfirmed = false; // NOTE: bannedfromchat displays in Oasis but is not a user-identity group so must be checked manually UserTagsJS.modules.mwGroups = ['bureaucrat', 'chatmoderator', 'patroller', 'rollback', 'sysop', 'bannedfromchat', 'bot', 'bot-global']; UserTagsJS.modules.metafilter = { sysop: ['bureaucrat', 'founder'], bureaucrat: ['founder'], chatmoderator: ['sysop', 'bureaucrat'] };

/* =========================  Custom preload templates for the new (2011) Wikia editor Version 0.2 23.12.11 with slight cosmetic changes from original =========================  Written by starwars:user:Grunny First published at: starwars:MediaWiki:Wikia.js =========================  Requires additional code at   Common.js   ========================= */

function customPreloadTemplates { if( wgAction !== 'edit' || !$( 'div.module_content' ).length ) { return; }	var	preloadOptionsHtml = '', $preloadOptionsList, preloadBaseHtml = ' Standard preloads: ' +			' Custom preload pagename: ';	$( 'div.module_content:first' ).append( preloadBaseHtml ); $.get( wgScript, { title: 'Template:Stdpreloads', action: 'raw', ctype: 'text/plain' }, function( data ) {		var lines = data.split( '\n' );		for( var i = 0; i < lines.length; i++ ) {			var value = ( lines[i].indexOf( '-- ' ) === 0 ) ? lines[i].substring(3) : "";			preloadOptionsHtml += '' + lines[i] + ' ';		}		$preloadOptionsList = $( ' ' ).attr( 'id', 'stdSummaries' ).html( preloadOptionsHtml ).change( function { var value = $( this ).val; if ( value !== '' ) { value = 'Template:' + value + '/preload'; value = value.replace( ' ', '_' ); $.get( wgScript, { title: value, action: 'raw', ctype: 'text/plain' }, function( data ) {					insertAtCursor( document.getElementById( 'wpTextbox1' ), data );				} ); }		} );		$( 'div#lf-preload' ).append( $preloadOptionsList );	} ); $( '#lf-preload-pagename-w' ).html( '' ); $( '#lf-preload-button-w' ).html( '' ); } $( customPreloadTemplates ); function doCustomPreloadOasis { var value = $( '#lf-preload-pagename-w > input' ).val; value = value.replace( ' ', '_' ); $.get( wgScript, { title: value, action: 'raw', ctype: 'text/plain' }, function( data ) {		insertAtCursor( document.getElementById( 'wpTextbox1' ), data );	} ); }

/* ==================  COLOUR CHANGER 1.0 ==================  by user:Pecoes see http://community.wikia.com/wiki/Thread:477388 for conceptual design discussion ================== */

(function (mw, $, window) {   'use strict';    if (mw.config.get('skin') !== 'oasis' || mw.config.get('wgNamespaceNumber')) return;    var css, stylesheet, button, defer;    function addStylesheet  {        stylesheet =        $('' + css + '">')        .appendTo(window.document.head || 'head');        $.storage.set('altStylesheet', '1');    }    function loadStylesheet  {        if (!css) {            if (defer && defer.state === 'pending') return;            if (button && button.length) {                button.prop('disabled', true);            }            defer = $.ajax({                url: 'http://tardis.wikia.com/index.php?title=MediaWiki:Ns0.css&action=raw&ctype=text/css&maxage=3600&smaxage=3600',                dataType: 'text',                async: false,                cache: true            })            .done(function (text) { css = text; addStylesheet; if (button && button.length) { button.prop('disabled', false); }           });        } else {            addStylesheet;        }    }    if ($.storage.get('altStylesheet')) {        loadStylesheet;    }    $(function  { button = // this is the button: $('') .insertBefore('#WikiaPageHeader .tally') //.prependTo('.grid-4') //('.WikiaMainContent') .click(function {            var stylesheet = $('#alt-stylesheet');            if (stylesheet.length) {                stylesheet.remove;                $.storage.del('altStylesheet');            } else {                loadStylesheet;            }            // this BS code forces stupid browsers to repaint:            var div = $(' ').appendTo(window.document.body);            window.setTimeout(function{ div.remove; }, 0);        }); if (defer && defer.state === 'pending') { button.prop('disabled', true); }   }); }(mediaWiki, jQuery, window));

//Sitenotice: the notion of prepending to $WikiaArticle came from User:Cåm //$('#WikiaArticle').prepend('<div style="color:#012c57;font-family:Raleway;padding:10px;background-image: -ms-linear-gradient(left, #8BADCE 0%, #8BBBDF 100%); background-image: -moz-linear-gradient(left, #8BADCE 0%, #8BBBDF 100%); background-image: -o-linear-gradient(left, #8BADCE 0%, #8BBBDF 100%); background-image: -webkit-gradient(linear, left top, right top, color-stop(0, #8BADCE), color-stop(1, #8BBBDF)); background-image: -webkit-linear-gradient(left, #8BADCE 0%, #8BBBDF 100%); background-image: linear-gradient(to right, #8BADCE 0%, #8BBBDF 100%);text-align:center;margin-left:auto;margin-right:auto;margin-bottom:20px;">The  new VisualEditor  is here! Tell us what you think. ');

//$('#WikiaArticle').prepend('<div style="color:#012c57;font-family:Raleway;padding:10px;background-image: -ms-linear-gradient(left, #8BADCE 0%, #8BBBDF 100%); background-image: -moz-linear-gradient(left, #8BADCE 0%, #8BBBDF 100%); background-image: -o-linear-gradient(left, #8BADCE 0%, #8BBBDF 100%); background-image: -webkit-gradient(linear, left top, right top, color-stop(0, #8BADCE), color-stop(1, #8BBBDF)); background-image: -webkit-linear-gradient(left, #8BADCE 0%, #8BBBDF 100%); background-image: linear-gradient(to right, #8BADCE 0%, #8BBBDF 100%);text-align:center;margin-left:auto;margin-right:auto;margin-bottom:20px;">Vote in our Community Choice Awards. If you think you\'ve got what it takes. ');

$('.page-Doctor_Who_Wiki .WikiaArticle').prepend(' ');

//Getting rid of comment button $('a[data-id="comment"]').removeClass('comments');

/* */