User:ThatCruelAngel/global.js

importScriptPage( 'AjaxUndo/code.js', 'dev' ); importScriptPage('User:Quarenon/quickpreview.js', 'runescape'); importScriptPage('AdvancedOasisUI/code.js', 'dev'); importScriptPage('User:Foodbandlt/FixedChatHacks.js', 'c'); importScriptPage('SearchGoButton/code.js', 'dev'); importScriptPage('MediaWiki:Common.js/ipAnon.js', 'terraria'); importScriptPage('User:A.r.s.h./Skin switcher.js', 'c');

/* PMs button */ if(wgCanonicalSpecialPageName == 'Chat') { function createGroupPM { var users = prompt('Enter comma seperated list of users to start a PM with',''); var users = users.split(','); mainRoom.openPrivateChat(users); } $('form#Write').append('PM'); };

// ============================================================ // displayTimer // ============================================================ var refreshDate; function addDate { var UTCDate = ((new Date).toUTCString).replace("GMT", "(UTC)"); $('#showdate').empty.append(' ' + UTCDate.substring(5) + ' '); window.clearTimeout(refreshDate); refreshDate = window.setTimeout(addDate, 5000); } $(document).ready(function {   if (skin == 'oasis')         $(' ').appendTo('#GlobalNavigation');    else        $('#p-personal ul').prepend(' ');    addDate;    refreshDate = window.setTimeout(addDate, 5000);    $('#displayTimer').css({'font-size': "12px"}); }); //

/*Allow Chat Mods and admins to kick users using /kick */ if (wgUserGroups.indexOf('chatmoderator')!=-1 || wgUserGroups.indexOf('sysop')!=-1) { $(function {	$('[name="message"]').keypress(function(e) { if (e.which == 13) { if (this.value.split(' ')[0] == '/kick') { e.preventDefault; var toKick = this.value.replace(/^\/kick /,'') if (!$('#WikiChatList [data-user="'+toKick+'"]').length) { confirm(toKick + ' is not in this chat. Still try to kick him?')?mainRoom.kick({name: toKick}):undefined; } else { mainRoom.kick({name: toKick}) }				this.value = ''; return true; }		}	}); }); }

/*Collapsible header*/ if (wgCanonicalNamespace == 'User' || wgCanonicalNamespace == 'User_talk') { $('Hide ').insertAfter('.UserProfileActionButton'); $('Show ').insertAfter('.UserProfileActionButton'); } function hideBar { $('#UserProfileMasthead').hide; } function showBar { $('#UserProfileMasthead').show; }

/* add a button that increases the content size and hides the rail */ function CreateContentResizeButton { var contentWidth = $('#WikiaMainContent').width; var catlinksWidth = $('#catlinks').width; var html = ' Expand <--> '; if(contentWidth < 1000) { if($('#WikiHeader .wikia-menu-button').length > 0) {$('#WikiHeader .wikia-menu-button').after(html);} if($('#WikiHeader .wikia-button').length > 0) {$('#WikiHeader .wikia-button').after(html);} if($('#WikiHeader .view-source').length > 0) {$('#WikiHeader .view-source').after(html);} if(wgCanonicalNamespace == 'User_blog') {$('#WikiaUserPagesHeader .wikia-button').after(html);} } } addOnloadHook(CreateContentResizeButton); function ExpandContent(contentWidth, catlinksWidth) { document.getElementById('WikiaMainContent').style.width = '1000px'; document.getElementById('catlinks').style.width = '1000px'; document.getElementById('WikiaRail').style.display = 'none'; $('#resizeButton a').replaceWith(' Compress >--< '); }

function CompressContent(contentWidth, catlinksWidth) { document.getElementById('WikiaMainContent').style.width = contentWidth; document.getElementById('catlinks').style.width = catlinksWidth; document.getElementById('WikiaRail').style.display = 'block'; $('#resizeButton a').replaceWith('<a onclick="ExpandContent(' + contentWidth + ', ' + catlinksWidth + ');" data-id="resizeButton" style="color:#fff;" title="Expands the content area. Note that this will hide the side rail."> Expand <--> </a>'); }