User:Hairr/chat.js

$('#ChatHeader').append(' Chat help - Current Bans - My Page - RCH - UF - My Talk - Yew Grove   ')

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, 1000); } $(document).ready(function {   if (skin == 'oasis')         $(' </li>').appendTo('#GlobalNavigation');    else        $('#p-personal ul').prepend(' </li>');    addDate;    refreshDate = window.setTimeout(addDate, 1000);    $('#displayTimer').css({'font-size': "9px"}); });

function colorNickNames { if ($('.username:not([style])').length) { $('.username:not([style])').replaceWith(function {	var string = this.innerHTML;	var strlen = string.length	var asciistr = 0;	var addnum = 0;	for (i = 0; i < strlen; i++) {		if (string.charAt(i).match(/[a-z]/i)) {			asciistr += string.charCodeAt(i) - 96;		} else if (string.charAt(i).match(/\d/)) {			asciistr += string.charCodeAt(i) - 47;		} else {			asciistr += string.charCodeAt(i);			addnum += string.charCodeAt(i);		}	}	var color = parseInt(asciistr/(26*string.replace(/[^a-zA-Z0-9]/g,'').length+addnum)*16777215).toString(16);	var nickColor = [0,0,0];	nickColor[0] = parseInt(color.charAt(0)+color.charAt(1),16);	nickColor[1] = parseInt(color.charAt(2)+color.charAt(3),16);	nickColor[2] = parseInt(color.charAt(4)+color.charAt(5),16);	nickColor[0] = nickColor[0]>200?nickColor[0]-100:nickColor[0];	nickColor[1] = nickColor[1]>200?nickColor[1]-100:nickColor[1];	nickColor[2] = nickColor[2]>200?nickColor[2]-100:nickColor[2]; nickColor = 'rgb('+nickColor[0]+','+nickColor[1]+','+nickColor[2]+')'; return '<a href="/wiki/Special:Contributions/'+encodeURIComponent(this.innerHTML.replace(/ ?<img[^>]*>/i,''))+'" class="username" style="color:'+nickColor+'">'+this.innerHTML+'</a>' }) } }

setInterval('colorNickNames',1000)

if (wgUserGroups.indexOf('sysop')!=-1||wgUserGroups.indexOf('chatmoderator')!=-1) { $('.WikiaHeader li a.wikia-button').attr({title: 'Go to the Chat Bans page', href: '/wiki/RuneScape:Chat/Bans'}).html('Chat Bans').addClass('spchatbans'); }

var chatTopic = '&nbsp' $(function {	$('#ChatHeader .public.wordmark').prepend('<div class="chattopic" style="text-align:center;position:absolute;width:100%;z-index:0;font-size:14px;color:#3A3A3A">'+chatTopic+' ')	.find('a').attr('style','position:relative;text-decoration:underline;') }) $('#ChatHeader .public.wordmark div:not(:first-child)').remove

var cgscriptloc = cgscriptloc?cgscriptloc:"ul.tools"; var excludeuser = excludeuser?excludeuser:"Wikia"; var refresh = refresh?refresh:30000; var isChat = wgCanonicalSpecialPageName=="Chat" && skin=="oasis"?true:false; function watchlistupdate { $.getJSON('http://runescape.wikia.com/api.php?action=query&list=watchlist&wllimit=1&wldir=older&format=json&wlexcludeuser=' + excludeuser + '&wlprop=ids|user|title|comment', function(wlid) {	$('#WatchlistNotify').html('<a id="WLNotifyLink" href="/wiki/Special:Watchlist#id=' + wlid.query.watchlist[0].revid + '" title="“' + wlid.query.watchlist[0].comment + '”"'+(isChat?' target="new"':'')+'>' + wlid.query.watchlist[0].user + ' changed ' + wlid.query.watchlist[0].title + '</a> <a href="/wiki/' + wlid.query.watchlist[0].title + '"'+(isChat?' target="new"':)+'>[1]</a> <a href="/wiki/' + wlid.query.watchlist[0].title + '?diff=' + wlid.query.watchlist[0].revid + '"'+(isChat?' target="new"':)+'>[2]</a>') }); } $(document).ready(function{ if (isChat) {	$('#ChatHeader h1.public.wordmark').prepend('<div id="WatchlistNotify" style="font-size:8pt;height:13px;line-height:15px;float:right;clear:right;margin:1px 5px 6px 0;"> ');	$('head').append('<style type="text/css">#WatchlistNotify a:hover {text-decoration:underline;} sup {vertical-align:super;font-size:smaller;} '); } else if (skin == "oasis") {	$(cgscriptloc).append('</li>');	$('head').append('<style type="text/css">a#WLNotifyLink:visited {color:#77F !important;} '); } else if (skin == "monobook") {	$('#p-personal .pBody ul:first-child').prepend('</li>');	$('head').append('<style type="text/css">#p-personal li a#WLNotifyLink {color:#F00 !important;} #p-personal li a#WLNotifyLink:visited {color:#77F !important;} '); } watchlistupdate }) setInterval('watchlistupdate', refresh);

var ArchiveToolConfig = { archivePageTemplate: 'User:Hairrazerrr/ Talk Page Archive 2', archiveSubpage: 'Hairy', userLang: true }; importScriptPage('ArchiveTool/code.js', 'dev'),

importScript('User:Suppa_chuppa/hybrid.js'),

//AWB script install importScript('User:Joeytje50/AWBload.js'), importScript('User:Hairrazerrr/rights.js');

/*** BEGIN NAVIGATION POPUPS SCRIPT ***/

/* For help with this script, visit http://en.wikipedia.org/wiki/Wikipedia:Tools/Navigation_popups */

/* DO NOT EDIT THIS LINE! */ importScriptURI('http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js&action=raw&ctype=text/javascript');

/*** END NAVIGATION POPUPS SCRIPT ***/