MediaWiki:Wikia.js

/* Any JavaScript here will be loaded for all users on every page load. */

/*********************************************************************************************************************/ /* All credits to You-Zitsu Wiki https://you-zitsu.wikia.com. You are not authorized to replicate or copy coding/design without its admin's permission. */

/*********************************************************************************************************************/

// Oasis-only scripts if (mw.config.get('skin') === 'oasis') { // Template adder on file pages if (mw.config.get('wgCanonicalNamespace') === 'File') $(function {           if ($.inArray("autoconfirmed", mw.config.get("wgUserGroups")) === -1)                return;            var Options = {                    : 'Unlicensed image',                    : 'No Fairuse info',                    : 'Unused image',                    : 'Poor name'                },                tempOptStr = '';            for (var i in Options) {                tempOptStr += '' + Options[i] + ' ';            }            var html = '' + tempOptStr + ' Add template';            $('.comments').after(html);            $('#templateSubmit').click(function { $(this).html(''); new mw.Api.post({                       format: 'json',                        action: 'edit',                        title: mw.config.get('wgPageName'),                        token: mw.user.tokens.get('editToken'),                        summary: 'Adding template: ' + $('#FileTemplateAdder').val,                        minor: true,                        prependtext: $('#FileTemplateAdder').val + "\n"                    }) .done(function {                       $('#templateSubmit').text('Add this Template too!');                        new BannerNotification('Template: ' + $('#FileTemplateAdder').val + ' Added Successfully', 'confirm').show;                    }) .fail(function {                       new BannerNotification('Template addition failed!', 'error').show;                    }); });       });	}

/* Adds icons to page header bottom border */

$(document).ready(function {	if (skin == "oasis" || skin == "wikia") {		$('.WikiaPageHeader').append($('#icons'));		$('#icons').css({'position' : 'absolute', 'right' : '0', 'bottom' : '-1.2em'});	} });