User:Randomfvideos/global.js

// ==UserScript==

// @name      Chat Script

// @namespace http://use.i.E.your.homepage/

// @version   0.1

// @description Chat Script I use

// @match     http://*.wikia.com/wiki/Special:Chat*

// @copyright 2012+, You

// ==/UserScript==

/*- JS Functions -*/

// Imports Wikia scripts

function importScriptPage(y, x){

var link=document.createElement('script');

link.setAttribute('src','http://' + x +'.wikia.com/wiki/' + y + '?&action=raw');

link.type='text/javascript';

document.getElementsByTagName('head')[0].appendChild(link);

}

// Imports any JS script

function importScriptPage(x){

var link=document.createElement('script');

link.setAttribute('src', x);

link.type='text/javascript';

document.getElementsByTagName('head')[0].appendChild(link);

}

/*- End JS functions -*/

/*- Chat functions -*/

// Chat hacks

importScriptPage('User:Monchoman45/chathacks.js','c');

// Message blocker

importScriptPage('MessageBlocker/code.js','dev');

// Clear chat button

function addClearChatText{

if ($('.clearChatText').length <= 0) {

var clearChatText = document.createElement('span');

$('Clear chat ').prependTo('.Rail');

}

}

function clearChat{

chatSize = $('div.Chat:first ul li').size-1;

$('.Chat:first li:lt('+chatSize+')').remove;

}

window.onload=addClearChatText;

/*- End Chat functions -*/

/*- Wiki functions -*/

// Auto-updates recent changes

importScriptPage('AjaxRC/code.js','dev');

// Side bar

importScriptPage('User:Randomfvideos/Sidebar.js','dragonball');

// wikiEd

importScript('http://en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Cacycle/wikEd.user.js');

/*- End Wiki functions -*/