Advertisement
Joeytje50

Untitled

May 8th, 2012
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. importScript('User:Joeytje50/chatmsg.js')
  2.  
  3. onchatmessage = function(text, rawtext) {
  4.     setTimeout(function() {
  5.         /* Add chat-mod class in the chat itself to chat mods */
  6.         $('.WikiChatList .User.chat-mod .username').each(function() {
  7.             $('.Chat li[data-user="'+this.innerHTML+'"]').addClass('chat-mod');
  8.         });
  9.  
  10.         /* Add seconds to timestamps */
  11.         var d = new Date();
  12.         var time = pad(d.getHours()) + ':' + pad(d.getMinutes()) + ':' + pad(d.getSeconds());
  13.         var selector = $('form+.Chat ul li:last-child:not(.inline-alert) .time');
  14.         if (selector.length && selector.html().split(':').length != 3) {
  15.             selector.html(time);
  16.         }
  17.     }, 20)
  18.     //Make the (qc) emot fit in the line better
  19.     text = text.replace((new RegExp('<img src=["\']http://i.imgur.com/DexQI.png["\'] width=["\']19["\'] height=["\']19["\']')), '<img src="http://images2.wikia.nocookie.net/runescape/images/d/de/Quick_chat_button.png" style="width:13px;height:10px;"')
  20.  
  21.     return text; //DO NOT EDIT THIS LINE
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement