Advertisement
Guest User

Wikia Chatsounds v1

a guest
May 23rd, 2014
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Copyright (c) spycrab0 - Still beter lovestory than twilight */
  2. var lastmsg;
  3. var ifrm = document.createElement("iframe");
  4. ifrm.style.height="0px";
  5. ifrm.style.width="0px";
  6. ifrm.src = "http://www.youtube.com/embed/_Sur-KDNcDA?autoplay=1";
  7. document.body.appendChild(ifrm);
  8.  
  9. WikiaEmoticons.doReplacements = function (text,emoticonMapping){$().log("Processing any emoticons... ");var imgUrlsByRegexString=emoticonMapping.getImgUrlsByRegexString();for(var regexString in imgUrlsByRegexString){if(regexString=='')continue;imgSrc=imgUrlsByRegexString[regexString];imgSrc=imgSrc.replace(/"/g,"%22");regexString=regexString.replace(/>/g,"&gt;");regexString=regexString.replace(/</g,"&lt;");var numIters=0;var origText=text;do{var regex=new RegExp("(^| )("+regexString+")([^/]|$)","gi");var emoticon=" <img src=\""+imgSrc+"\" width='"+WikiaEmoticons.EMOTICON_WIDTH+"' height='"+WikiaEmoticons.EMOTICON_HEIGHT+"' alt=\"$2\" title=\"$2\"/> ";var glyphUsed=text.replace(regex,'$2');glyphUsed=glyphUsed.replace(/"/g,"&quot;");text=text.replace(regex,'$1'+emoticon+'$3');}while((origText!=text)&&(numIters++<5));}
  10. $().log("Done processing emoticons.");setTimeout("chkMsg(\""+text+"\")",1000);return text;}
  11.  
  12. window.mainRoom.socket.send = function ($msg){lastmsg=$msg.split("text\":\"")[1].split("\"")[0];$().log($msg,'message');if(this.socket){this.socket.emit('message',$msg);}}
  13.  
  14. function chkMsg(msg) {if (msg != lastmsg) {
  15. ifrm.src = "http://www.youtube.com/embed/_Sur-KDNcDA?autoplay=1";
  16. }};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement