User:Slayingthehalcyon/global.js

importArticles({   type: 'script',    articles: [        'w:coreychambers:MediaWiki:VectorSkin.js'   ]  }); if (mw.config.get('skin') === 'monobook') { importArticle({   type: 'style',    article: 'u:dev:Pseudo-Vector/code.css'  }); } batchDeleteDelay = 1000; importScriptPage('AjaxBatchDelete/code.2.js', 'dev'); importScriptPage('MediaWiki:EasyPublish.js', 'corey'); importScriptPage('User:Callofduty4/ChatHacks.js', 'c'); if (mw.config.get('wgPageName') == "Special:Torus") { importScriptPage('MediaWiki:Torus.js', 'monchbox'); $('.global-navigation').remove; } /* Skin Switch Button (changing "Start a wikia" in Oasis to it) */ if (mw.config.get('skin') == 'oasis') { $('.start-wikia').attr('href','/index.php?title='+encodeURIComponent(mw.config.get('wgPageName'))+'&useskin=monobook').text('Monobook'); } else { $('#p-cactions > .pBody > ul > li:last-child').after(   $('').append('Oasis')  ); } $(function { if (window.snowStorm) snowStorm.stop; }); importScriptPage('MessageBlocker/code.js', 'dev'); // http://blog.vishalon.net/index.php/javascript-getting-and-setting-caret-position-in-textarea/ function getCaretPos(ctrl) { var CaretPos = 0;   // IE Support if (document.selection) { ctrl.focus ; var Sel = document.selection.createRange ; Sel.moveStart ('character', -ctrl.value.length); CaretPos = Sel.text.length; }   // Firefox support else if (ctrl.selectionStart || ctrl.selectionStart == '0') CaretPos = ctrl.selectionStart; return (CaretPos); } function setCaretPos(ctrl, pos){ if(ctrl.setSelectionRange) {       ctrl.focus; ctrl.setSelectionRange(pos,pos); }   else if (ctrl.createTextRange) { var range = ctrl.createTextRange; range.collapse(true); range.moveEnd('character', pos); range.moveStart('character', pos); range.select; } } //Tab insert for usernames $('[name="message"]').after(' [0,"","",0,null] '); $('[name="message"]').keydown(function(e) {	if (e.keyCode == 9) {		e.preventDefault;		var curval = this.value;		var afData = eval(document.getElementById('autofilldata').innerHTML);		var curpos = afData[3]==0?getCaretPos(this):afData[3];		var carpos = getCaretPos(this)		if ((!curval.charAt(carpos)||curval.charAt(carpos).match(/\s/))&&!curval.charAt(carpos-1).match(/\s/)&&this.value.length) {			var unamestart = ;			if (afData[1].length==0) {				for (i=curpos-1;i>=0&&!curval.charAt(i).match(/\s/);i--) {					unamestart = curval.charAt(i) + unamestart;				}			} else {				unamestart = afData[1];			}			var afterTComplete = ;			for (i=curpos;i<curval.length;i++) {				afterTComplete += curval.charAt(i);			}			//generate list of users			var userList = '';			var userlistelems = document.getElementsByClassName('User');			for (i=0;i=0&&i>=carpos-(!(afData[4]===null)?(matchedNames[afData[4]]?matchedNames[afData[4]].length:0) : unamestart.length)&&matchedNames.length>0;i--) { newval[i] = ''; }			matchedNames = !matchedNames[0]?['']:matchedNames; newval[curpos-unamestart.length] += matchedNames[afData[0]]?matchedNames[afData[0]]:''; newval = newval.join(''); this.value = newval; setCaretPos(this, curpos+(matchedNames[afData[0]].length?matchedNames[afData[0]].length:0)) var iter = afData[0]>=matchedNames.length-1?0:afData[0]+1; document.getElementById('autofilldata').innerHTML = '['+iter+',"'+unamestart+'","'+matchedNames[afData[0]]+'",'+curpos+','+afData[0]+']' }		return false; } else if (e.which != 16) { document.getElementById('autofilldata').innerHTML = '[0,"","",0,null]'; } }).click(function { document.getElementById('autofilldata').innerHTML = '[0,"","",0,null]'; }).blur(function { document.getElementById('autofilldata').innerHTML = '[0,"","",0,null]'; })

/* Eyup */ $('.WikiaBarWrapper .tools').append(' » ▲ ● ► ▼ #MagicSpells{font-family:Helvetica;padding:2px 5px !important}#trigger{font-size:16px;color:white !important;display:inline-block;margin-top:-1px;cursor:default;transition:transform .5s;-moz-transition:-moz-transform .5s;-webkit-transition:-webkit-transform .5s;-o-transition:-o-transform .5s}.spell{display:inline-block;color:white !important;margin:0 3px;vertical-align:top;cursor:pointer;transition:transform .5s,text-shadow .5s;-moz-transition:-moz-transform .5s,text-shadow .5s;-webkit-transition:-webkit-transform .5s,text-shadow .5s;-o-transition:-o-transform .5s,text-shadow .5s}.spell:hover{text-shadow:0 0 4px silver} '); $('#MagicSpells').mouseenter(function {	$('.spell').toggle('slow');	$('#trigger').css({'transform':'rotateY(180deg)','-moz-transform':'rotateY(180deg)','-webkit-transform':'rotateY(180deg)','-ms-transform':'scaleX(-1)','-o-transform':'scaleX(-1)'}); } ); $('#MagicSpells').mouseleave(function {	$('.spell').toggle('slow');	$('#trigger').css({'transform':'rotateY(0deg)','-moz-transform':'rotateY(0deg)','-webkit-transform':'rotateY(0deg)','-ms-transform':'scaleX(1)','-o-transform':'scaleX(1)'}); } ); $('.scroll-top').click(function {	$('html, body').animate({scrollTop:0}, 'slow'); } ); $('#toggle-ads').toggle(function {	$('#toggle-ads').attr('title','Show ads');	$('.wikia-ad, .SelfServeUrl').hide('slow'); },	function {		$('#toggle-ads').attr('title','Hide ads');		$('.wikia-ad, .SelfServeUrl').show('slow');	} ); $('#hide-rail').toggle(function {	$('#hide-rail').css({'transform':'rotateY(180deg)','-moz-transform':'rotateY(180deg)','-webkit-transform':'rotateY(180deg)','-ms-transform':'scaleX(-1)','-o-transform':'scaleX(-1)'});	$('#hide-rail').attr('title', 'Show rail');	$('.WikiaRail').hide('slow');	$('.WikiaMainContent').animate({width:'1010'}, 'slow'); },	function {		$('#hide-rail').css({'transform':'rotateY(0deg)','-moz-transform':'rotateY(0deg)','-webkit-transform':'rotateY(0deg)','-ms-transform':'scaleX(1)','-o-transform':'scaleX(1)'});		$('#hide-rail').attr('title', 'Hide rail');		$('.WikiaRail').show('slow');		$('.WikiaMainContent').animate({width:'670'}, 'slow');	} ); $('.scroll-bottom').click(function {	$('html, body').animate({scrollTop: $(document).height}, 'slow'); } ); /* Minor Fix */

$('#my-tools-menu').addClass('WikiaMenuElement'); $('.mediawiki').addClass(wgUserName); $('.shortcut > a').attr('title','shortcut'); $('.WikiNav > ul > li:first-child').addClass('liActive'); $('.WikiNav > ul > li').mouseenter(function {	$('.WikiNav > ul > li').removeClass('liActive');	$(this).addClass('liActive'); } );