MediaWiki:Common.js

/* By w:User:Lunarity * For more information, see Template:CustomRBE */ jQuery(function($) {   var defaultShowText = '[Show]';    function toggle {        var $this = $(this);        if ($this.hasClass('inline-collapsible-hidden')) {            $this.html($this.data('content')).removeClass('inline-collapsible-hidden');        } else {            $this.text($this.data('showtext') || defaultShowText).addClass('inline-collapsible-hidden');        }    }    $('.inline-collapsible').each(function { var $this = $(this); $this.data('content', $this.html) .click(toggle) ;        toggle.call(this); }); }); /* End */

/* Adding links to On the Wiki tab - From Runescape Wiki */ $(document).ready(function {   if ( skin == 'oasis' && $.inArray("staff", wgUserGroups) == -1) {        $('.WikiHeaderRestyle nav ul li.marked ul').prepend('Our Policies');        $('.WikiHeaderRestyle nav ul li.marked ul').append('Rollbacker nominations');    } }); /* End */

/* "Username" template - from Avatar Wiki */

$(function { if (typeof wgUserName != 'undefined') {     $('.insertusername').html(wgUserName);  } }); /* End */

/* Ajax-refresh button config options */ ajaxPages = ["Special:Contributions","Special:Log","Special:RecentChanges","Special:WikiActivity"]; /* End */

/* UserTags settings */

window.UserTagsJS = { modules: {}, tags: { 'patroller': { link:'Help:Recent changes patrol' }, 'chatmoderator': { link:'Bloons Wiki:Chat moderators' }, 'rollback': { link:'Bloons Wiki:Rollback' }, 'sysop': { u:'Admin', link:'Bloons Wiki:Administrators' }, 'bureaucrat': { link:'Bloons Wiki:Bureaucrats' }, 'retired bureaucrat': { u:'Retired Bureaucrat', link:'Bloons Wiki:Bureaucrats' }, 'founder': { link:'w:c:Help:Help:Founders' }, 'bot': { link:'Bloons Wiki:Bots' }, 'bot-global': { link:'Bloons Wiki:Bot-global' }, 'checkuser': { link:'w:help:checkuser' }, 'checkuser-global': { link:'w:help:checkuser' }, 'util': { link:'Help:User_access_levels#Utilites' }, 'council': { link:'w:Help:Community Council' }, 'vstf': { link:'w:c:Help:Help:VSTF' }, 'helper': { link:'w:c:Help:Help:Helpers' }, 'staff': { link:'w:Community Central:Staff' }, 'inactive': { link:'Special:ActiveUsers' }, 'bannedfromchat': { link:'Bloons Wiki:Chat' } } }; UserTagsJS.modules.nonuser = true; // mark users with no edits UserTagsJS.modules.autoconfirmed = true; // mark autoconfirmed users UserTagsJS.modules.isblocked = true; // mark blocked users on MonoBook //UserTagsJS.modules.newuser = true; // mark new users - probably not needed when the line below works UserTagsJS.modules.newuser = { days: 7, // must have been on the Wiki for X days edits: 15, // and have at least X edits to remove the tag namespace: 0 // edits must be made to articles to count }; UserTagsJS.modules.inactive = { days: 30, namespaces: [0], zeroIsInactive: false // 0 article edits = inactive }; UserTagsJS.modules.mwGroups = ['bureaucrat', 'chatmoderator', 'patroller', 'rollback', 'sysop', 'bannedfromchat', 'bot', 'bot-global']; // add corresponding tags to users // adding tags to users UserTagsJS.modules.custom = { //	'somebody': ['inactive'], // Force inactive group instead of relying on the inactive module 'Roberto1205': ['retired bureaucrat'], 'Zelda311': ['founder'] }; // removing tags to users UserTagsJS.modules.userfilter = { //	'somebody': ['inactive'] // 'somebody' is never marked as inactive, even when he is }; UserTagsJS.modules.metafilter = { 'sysop': ['bot'], // remove sysop tag from bots 'bot': ['bot-global'], // remove bot tag from global bots 'inactive': ['bot', 'bot-global', 'util', 'council', 'vstf', 'helper', 'staff'], // remove inactive tag from bots & global users 'newuser': ['bot', 'bot-global', 'util', 'council', 'vstf', 'helper', 'staff'] // remove newuser tag from bots & global users };

/* End */

/* LockOldBlogs settings */ window.LockOldBlogs = { expiryDays: 30,     // lock blogs after "expiryDays" days expiryMessage: "This blog is considered archived because it hasn\'t been commented on in over  days.\nTo disable the auto-archiving on your post you can add it to the \"Never archived posts\" category.", nonexpiryCategory: "Never archived posts" }; /* End */

/* RevealAnonIP */ window.RevealAnonIP = { permissions : ['user'] // Syntax -    permissions : ['GROUP1', 'GROUP2', 'GROUP3'] }; /* End RevealAnonIP */

importArticles({   type: "script",    articles: [        "MediaWiki:Common.js/ajaxrefresh.js",           //Auto-refresh        "MediaWiki:Common.js/chat.js",                  //Test only        "MediaWiki:Chat-headline",        "MediaWiki:Common.js/Contribs.js",              //Contribs to user menu        "MediaWiki:Common.js/displayTimer.js",          //UTC Clock        "MediaWiki:Common.js/EditGreeting.js",          //Edit greeting button        "MediaWiki:Common.js/ShowHide.js",              //From dev        "MediaWiki:Common.js/standardeditsummaries.js", //From runescape        "w:c:dev:LockOldBlogs/code.js",                 //Disables commenting on old blogs        "w:c:dev:Countdown/code.js",                    //Countdown timer        "w:c:dev:UserTags/code.min.js",                 //Inactive tag + UserBadges + more new functions        "w:c:dev:FastDelete/code.js",                   //FastDelete "w:c:dev:RevealAnonIP/code.js"                 //Reveals anon IPs ] });

/* FastDelete settings */ var fdButtons = [];

fdButtons[fdButtons.length] = { 'summary': 'Spam', 'label': 'Spam' };

fdButtons[fdButtons.length] = { 'summary': 'Vandalism', 'label': 'Vandalism' }; /* End */

/* Change chat description * First seen (aka borrowed) at my little pony wiki */

function changeChatDesc { try { if ($('section.ChatModule').size > 0 && $('p.chat-name').html != chatDesc){ $('p.chat-name').html(+chatDesc+); setTimeout("changeChatDesc", 200); } }catch (err){ setTimeout("changeChatDesc", 200); } }; $(document).ready(function {changeChatDesc}); /* End */