MediaWiki:Wikia.js

/* */

importArticles({   type: 'script',    articles: [        'MediaWiki:Common.js/displayTimer.js',        'u:dev:ListAdmins/code.js',        'u:dev:UserTags/code.js',        'u:dev:MiniComplete/code.js'    ] });

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'] };

/* Apparently this is a TOU violation. Won't matter soon anyway.

$(document).ready(function {	// A big thanks to user:The Librarian who first pointed out the problem this code will fix. This restores normal upload form since the popup one ignores source and license policy. Adapted from http://es.pokemon.wikia.com/wiki/MediaWiki:Wikia.js via Wookieepedia.	$('a.wikia-button.upphotos').unbind('click',UploadPhotos.showDialog); });



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

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

/* */