Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Recreatu Chatroom Enchancement
- // @include http://*.rescreatu.com/chat/*
- // @description An extension to add rich features to the Rescreatu shoutbox
- // @version 2.2.5
- // ==/UserScript==
- /*
- This work is protected by copyright. I reserve the right to refuse use of my work to anyone.
- */
- (function (window, undefined) {
- "use strict";
- var data = { // not a configuration, all data needs to be set on runtime in release version
- alert:[] // empty array to store alert objects that are loaded
- , DOMLoadTimer:null
- , options:{}
- , playAudio:null
- , poll:null
- , soundurl:['http://www.ilovewavs.com/Effects/Beeps/Bleep.wav'] // array of some sound files
- , timeout:1225
- , tmp:null
- , userid:null
- , userlist:{}
- , usersound:{} // map some user ids to sounds ids
- }
- , loader = document.createElement('div')
- , $_RCVmeta = {
- major:1
- , minor:8
- , revision:107
- };
- // quality assurance, and beta testing; helps me find new javascript errors and bugs to fix
- window.onerror = function myErrorHandler(errorMsg, url, lineNumber) {
- // there's an error we keep catching that's not my fault and I don't have control to fix
- if (errorMsg.toLowerCase() == "uncaught typeerror: cannot set property 'innerhtml' of null") return false;//&& lineNumber == 285) return false; // so we try to detect it and ignore
- if(confirm('An unexpected error has occured on line '+lineNumber+'\nMay we attempt to notify the developer?')) { // ask user for permission to report it
- var posty = new Poll('POST');
- posty.callback('http://www.rescreatu.com/rmail/new/', { // gonna send an rmail through ajax
- 'open' : function () {
- this.ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
- return 'to=pseudonymous&subject=ResChatv1%20beta%20error%20report&message='+encodeURIComponent('<div><b>'+errorMsg+'</b></div><div><b>Error line:</b> '+lineNumber+'</div><div><b>Error url:</b> '+url+'</div><div><b>Last MID:</b> '+(data.room.last||'none')+'</div><div><b>Message count:</b> '+(this.msgcount||0)+'</div>');
- },
- 'success':function(){
- alert('The error had been reported,\nThank you for your help and testing!\n\nYou may need to refresh the page if have any issues');
- },
- 'unexpected':function () {
- alert('That failed too... Please contact pseudonymous through rmail.\n\nError message: '+errorMsg+'\nError line: '+lineNumber);
- }
- });
- };
- return false;
- }
- // temporary bandaid until I improve the preferences
- window.onhashchange = function () {
- if (confirm('Changing options requires the page to reload.\nAre you sure you want to continue?')) window.location.reload();
- };
- document.body.style.overflow = 'hidden'; // hide scrollbars
- loader.style.backgroundColor = '#000';
- // this is an entire gif file encoded in base64 and embedded directly on the page using data-uris, because it's silly to have to wait to load a "now loading" image
- loader.style.backgroundImage = 'url(data:image/gif;base64,R0lGODlhZABkAPQAAAAAAP///3BwcJaWlsjIyMLCwqKiouLi4uzs7NLS0qqqqrKysoCAgHh4eNra2v///4iIiLq6uvT09AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH+GkNyZWF0ZWQgd2l0aCBhamF4bG9hZC5pbmZvACH5BAAHAAAAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAZABkAAAF/yAgjmRpnmiqrmzrvnAsz3Rt33iu73zfMgoDw0csAgSEh/JBEBifucRymYBaaYzpdHjtuhba5cJLXoHDj3HZBykkIpDWAP0YrHsDiV5faB3CB3c8EHuFdisNDlMHTi4NEI2CJwWFewQuAwtBMAIKQZGSJAmVelVGEAaeXKEkEaQSpkUNngYNrCWEpIdGj6C3IpSFfb+CAwkOCbvEy8zNzs/Q0dLT1NUrAgOf1kUMBwjfB8rbOQLe3+C24wxCNwPn7wrjEAv0qzMK7+eX2wb0mzXu8iGIty1TPRvlBKazJgBVnBsN8okbRy6VgoUUM2rcyLGjx48gQ4ocSbKkyZMoJf8JMFCAwAJfKU0gOUDzgAOYHiE8XDGAJoKaalAoObHERFESU0oMFbF06YikKQQsiKCJBYGaNR2ocPr0AQCuQ8F6Fdt1rNeuLSBQjRDB3qSfPm1uPYvUbN2jTO2izQs171e6J9SuxXjCAFaaQYkC9ku2MWCnYR2rkDqV4IoEWG/O5fp3ceS7nuk2Db0YBQS3UVm6xBmztevXsGPLnk27tu3buHOvQU3bgIPflscJ4C3D92/gFNUWgHPj2G+bmhkWWL78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iTllCk+ikbNurXr17Bjy55Nu7bt20HkKGCwOiWDBAeC63S4B1vvFAIIBF+e4DEuAQsISCdHI/Ly5ad1QZBeQLrzMssRLFdgDKF0AgUUybB+/YB6XiO7Sz9+QkAE8cEREPh+y8B5hjbYtxxU6kDQAH3I7XEgnG4MNujggxBGCAVvt2XhwIUK8JfEIX3YYsCFB2CoRwEJJEQAgkM0ANyFLL7HgwElxphdGhCwCKIDLu4QXYwEUEeJAAnc6EACOeowAI8n1TKAjQ74uIIAo9Bnn4kRoDgElEEmQIULNWY54wkMjAKSLQq+IMCQQwZp5UVdZpnkbBC4OeSXqCXnJpG1qahQc7c1wAADGkoo6KCEFrpCCAA7AAAAAAAAAAAA)';
- loader.style.backgroundPosition = 'center center';
- loader.style.backgroundRepeat = 'no-repeat';
- loader.style.height = '100%';
- loader.style.left = '0px';
- loader.style.position = 'fixed';
- loader.style.top = '0px';
- loader.style.width = '100%';
- loader.style.zIndex = '999999999';
- document.body.appendChild(loader); // we cleanup a lot of stuff, which looks quite ugly as we load, so we create an element to overlay and hide everything
- data.DOMLoadTimer = setInterval(init, 10); // An interval to constantly run init every one hundredth of a second until DOM is Ready
- function init() {
- if (/loaded|complete/i.test(document.readyState)) { // Begin working if DOM is Ready or do nothing
- clearInterval(data.DOMLoadTimer); // Clear interval so we only run the code once
- window.onload = function () { clearTimeout(window.counter); }; // Stop the timer that refreshes the page
- var userid = document.getElementById('avatar').src // Looking for the userid, which can be found in the avatar url
- , username = document.getElementById('username').children[0].innerText // Looking for the member's username
- , chatmini = document.getElementById('chatroom')
- , matchsound = []
- , usersound = [];
- // mini chat still loads on rescreatu.com/chat/ rather than rescreatu.com/chat.php
- if (chatmini) document.body.removeChild(chatmini); // so remove it
- else {
- chatmini = document.getElementById('chatroom_close');
- if (chatmini) document.body.removeChild(chatmini);
- //else probably b& or does not meet coppa
- };
- data.options = init.getOptions({
- audio:'true'
- , autolink:'false'
- , last:null
- , lean:'true'
- , limit:20
- , matchsound:''
- , threshold:1000
- , usersound:''
- });
- data.options.limit = Number(data.options.limit);
- data.options.threshold = Number(data.options.threshold);
- if (data.options.matchsound.length > 0) {
- matchsound = data.options.matchsound.split('|');
- }
- if (data.options.usersound.length > 0) {
- usersound = data.options.usersound.split('|');
- for (var i = 0; i < usersound.length; ++i) data.usersound[usersound[i].toLowerCase()] = 0;
- }
- userid = userid.split('/').pop(); // splits string into array then gets last array item
- if (userid == 'empty-na.gif') { console.log("You must be logged in"); return; }; // end it all if not logged in
- // expects userid to be something like "crop.php?id=__UID__"
- userid = userid.substring(12); // Final digest for userid, everything from 12th char to the end of string
- data.userid = userid; // remember userid in global scope
- if (data.options.lean != 'false') data.userlist[userid] = [username,'font-style:italic;']; // username and some user specific css in global scope
- if (!inArray(matchsound, username)) matchsound.push(username);
- data.alert.push(new Audio(data.soundurl[0],matchsound)); // creates and registers a new sound
- data.tmp = (new Temp()).getContent().makeStyle('dynamic').makeBody();
- data.room = (new Room(data.tmp)).makeRoom().makeToolbar().start(); // Bulk of work in creating template
- /*data.post = new Poll('POST');
- data.post.callback('http://www.rescreatu.com/getTime.php',{
- 'open' : function (event) {
- };
- , 'success' : function (event) {
- };
- , 'unexpected' : function () {
- alert('Unable to query server, chatting will not be available at this time.');
- };
- };);
- else this.get.open('GET','http://www.rescreatu.com/tagbox2/getChat.php?chat=1');*/
- };
- };
- init.getOptions = function (ret) { // takes object of defaults
- if (window.location.hash.length > 1) {
- var query = window.location.hash.substring(1)
- , vars = query.split('&')
- , i,pair;
- for (i = 0; i < vars.length; i++) {
- pair = vars[i].split('=');
- ret[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
- };
- };
- return ret;
- };
- init.setOptions = function (opt) {
- var i, ret=[];
- for (i in opt) ret.push(encodeURIComponent(i)+'='+encodeURIComponent(opt[i]));
- return ret.join('&');
- };
- function Audio (url,list) {
- this.regex = Audio.setMatchList(list);
- this.audio = document.createElement('audio');
- this.audio.setAttribute('preload','auto');
- this.audio.setAttribute('src',url);
- document.body.appendChild(this.audio);
- return this;
- };
- Audio.play = function (index) {
- data.alert[index||data.playAudio].play();
- };
- Audio.prototype.play = function () {
- return this.audio.play();
- };
- Audio.setMatchList = function (list) {
- if (isArray(list) && list.length > 0) {
- list.sort(); // sort first
- return new RegExp('\\b'+list.join('\\b|\\b')+'\\b','i'); // should make something like /\bentry1\b|\bentry2\b|\bentry3\b/i
- }
- return null;
- };
- Audio.prototype.setMatchList = function (list) {
- this.regex = Audio.setMatchList(list);
- return this;
- };
- Audio.test = function (text) {
- var i = 0
- , x = data.alert.length;
- for (; i < x; ++i) if ((data.alert[i].regex !== null && data.alert[i].regex.test(text))) return i;
- return null;
- };
- /* [s]this ajax class is garbage and needs a complete redo[/s] - gettin better */
- function Poll (method,fn) {
- var _t = this; // event scopes
- // XMLHttpRequest won't work on interneh splorerer
- this.method = method||'GET';
- this.event = {};
- this.state = fn||Poll.noop;
- this.ajax = new XMLHttpRequest;
- this.ajax.onreadystatechange = function(event){ // simple event mapper
- //console.log(_t.ajax.readyState,event);
- var eventname = Poll._[_t.ajax.readyState];
- if (_t.state[eventname]) _t.state[eventname].call(_t,event);
- };
- return this;
- };
- Poll.prototype.getTime = function () {
- //this.bg.open('GET','http://www.rescreatu.com/getTime.php');
- };
- Poll.prototype.setEvent = function (name, fn) {
- this.event[name] = fn;
- //this.bg.open('GET','http://www.rescreatu.com/getTime.php');
- };
- Poll.prototype.setEvents = function (fn) {
- this.event = fn;
- //this.bg.open('GET','http://www.rescreatu.com/getTime.php');
- };
- Poll.prototype.callback = function (url, events, fn, method, async) {
- if (events) this.event = events;
- if (fn) this.state = fn;
- if (method) this.method = method;
- return this.ajax.open(this.method, url, (async===false?false:true));
- };
- Poll._ = ['start','open','send','load','end'];
- Poll.noop = {
- start:function(event){ if (this.event.start) this.event.start.call(this,event); }
- , open:function(event){
- var params = null;
- if (this.event.open) params = this.event.open.call(this,open)||null;
- this.ajax.send(params);
- }
- , send:function(event){}
- , load:function(event){}
- , end:function(event){
- switch (this.ajax.status) {
- case 200:
- if (this.event.success) this.event.success.call(this,event);
- break;
- default:
- if (this.event.unexpected) this.event.unexpected.call(this,event);
- break;
- };
- }
- };
- /* very sloppy and lazy, but effective template system */
- function Temp () {
- this.index = {
- $:[]
- , _:{}
- , css:{
- dynamic : {
- 'a.uc':'color:#000;font-weight:bold'
- , 'div[data-mid]':'margin:2px 0'
- , 'div[data-mid]:hover':'background-color:#eee'
- , '.space':'margin-left:5px'
- , '.wrap':'border:#ccc 1px solid; border-radius:5px; float:left'
- , '.btn':'background-color:#eee; cursor:pointer; padding:5px'
- , '.btn:hover':'background-color:#ddd; padding:5px'
- , '.input':'background-color:transparent; border:none; color:#59534C; font-family:Tahoma, Arial, Verdana; padding:4px'
- , '.input:focus':'outline:none'
- , '#room':'font-size:10pt; height:400px; margin:0px 10px; overflow-Y:scroll; word-wrap:break-word'
- , '#room img':'max-height:15px'
- , '#toolbar':'border-top:#e1ecef 1px solid; margin:0 10px; padding-top:10px'
- , '#btn-alerts':''
- }
- }
- };
- return this;
- };
- Temp.ele = function (node,style,attr,events) {
- var node = document.createElement(node)
- , index;
- if (style) for (index in style) node.style[index] = style[index];
- if (attr) for (index in attr) node.setAttribute(index,attr[index]);
- if (events) for (index in events) node.addEventListener(index,events[index],false);
- return node;
- };
- Temp.prototype.appendTo = function (index,obj) { // get object by name
- return this.index.$[index].appendChild(obj);
- };
- Temp.prototype.get = function (name) { // get object by name
- return this.index.$[this.index._[name]];
- };
- Temp.prototype.geti = function (name) { // get index by name
- return this.index._[name];
- };
- Temp.prototype.set = function (name,value,appendTo) {
- if (this.index._[name]) this.index.$[this.index._[name]] = value;
- else {
- this.index._[name] = this.index.$.length;
- this.index.$.push(value);
- };
- if (appendTo) {
- if (typeof this.index._[appendTo] == 'number') {
- this.index.$[this.index._[appendTo]].appendChild(this.index.$[this.index._[name]]);
- }
- else if (appendTo.appendChild) appendTo.appendChild(this.index.$[this.index._[name]]);
- };
- return this.index._[name];
- };
- Temp.prototype.setStyle = function (name) {
- var si=this.geti(name),i,css='';
- for (i in this.index.css[name]) css+=i+'{'+this.index.css[name][i]+'}';
- this.index.$[si].innerHTML = css;
- };
- Temp.prototype.getContent = function () {
- var ci = this.set('content',document.getElementById('content')); // Content: Wrapper for the old body
- this.index.$[ci].removeChild(document.getElementById('body')); // remove old body
- this.set('header',document.getElementById('breadcrumbs')); // breadcrumbs becomes our header
- return this;
- };
- Temp.prototype.makeBody = function () {
- this.set('body',Temp.ele('div',{
- background:'white url(http://www.rescreatu.com/system/schemes/images/content-corner-bottom.gif) no-repeat center bottom'
- , float:'left'
- , minHeight:'757px'
- , width:'630px'
- }),'content');
- return this;
- };
- Temp.prototype.makeStyle = function (name,noset) {
- name = name||'style';
- this.set(name,Temp.ele('style'),document.getElementsByTagName('head')[0]);
- if(!noset) this.setStyle(name);
- return this;
- };
- Temp.userCaption = function (uid, name, css) {
- var anchor = Temp.ele('a',false,{
- class:'uc'
- , 'data-uid':uid
- , href:'../profile.php?id='+uid
- , style:css||null
- , target:'_blank'
- });
- anchor.appendChild(document.createTextNode(name));
- return anchor;
- };
- /* Todo:
- make work the same with minichat, standard chat, and/or popup window chat
- */
- function Room (tmp) {
- this.index = {
- $:[],
- _:{}
- };
- this.first = this.last = this.msgcount = this.offsetTop = 0;
- this.tmp = tmp;
- this.get = new Poll('GET');
- this.post = new Poll('POST');
- return this;
- };
- Room.prototype.start = function () {
- var T = this, strikes = 0;
- this.get.callback('http://www.rescreatu.com/tagbox2/getChat.php?chat=1',{
- 'success' : function (event) {
- if (data.options.limit > 20) { // user wants more messages, so we get a new list based on last message's id
- var last = this.ajax.responseXML.firstChild.lastChild.getAttribute('id') // expects lastChild to be a message
- , limit = last-(data.options.limit>data.options.threshold&&data.options.threshold>0?data.options.threshold:data.options.limit); // make sure limit does not exceed threshold
- T.get.setEvent('success',procedure);
- console.log(limit, limit>1);
- T.get.callback('http://www.rescreatu.com/tagbox2/getChat.php?chat=1&last='+(limit>1?limit:1)); // we can only start where mid is 2
- }
- else procedure.call(this);
- }
- , 'unexpected' : function () {
- keepAlive.call(this);
- }
- });
- this.post.setEvents({
- 'open' : function (event) {
- clearTimeout(data.timer);
- T.tmp.index.$[T.ii].style.color = '#aaa';
- T.tmp.index.$[T.ii].readonly = 'readonly';
- T.tmp.index.$[T.si].setAttribute('data-disabled','true');
- this.ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
- if (data.options.autolink == 'true'){
- T.tmp.index.$[T.ii].value = T.tmp.index.$[T.ii].value.replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, '[url=$1]');
- }
- return 'chat=1&message='+encodeURIComponent(T.tmp.index.$[T.ii].value);
- },
- 'success' : function (event) {
- T.tmp.index.$[T.ii].style.color = '';
- T.tmp.index.$[T.ii].readonly = '';
- T.tmp.index.$[T.ii].value = '';
- T.tmp.index.$[T.ii].focus();
- T.tmp.index.$[T.si].setAttribute('data-disabled','false');
- T.parse(this,true);
- strikes = 0;
- clearTimeout(data.timer);
- data.timer = setTimeout(loopFunc, data.timeout);
- }
- , 'unexpected' : function () {
- keepAlive.call(this);
- }
- });
- return this;
- function procedure () {
- T.get.setEvent('success',function () { // simplify success event, which we run very often
- T.parse(this);
- strikes = 0;
- clearTimeout(data.timer);
- data.timer = setTimeout(loopFunc, data.timeout);
- });
- T.parse(this);
- strikes = 0;
- clearTimeout(data.timer);
- data.timer = setTimeout(loopFunc, data.timeout);
- loader.style.display = 'none';
- document.body.style.overflow = 'auto';
- document.body.scrollTop = T.offsetTop;
- };
- function loopFunc () {
- T.get.callback('http://www.rescreatu.com/tagbox2/getChat.php?chat=1&last='+T.last);
- };
- function keepAlive () {
- ++strikes;
- clearTimeout(data.timer);
- if (strikes == 3) {
- var oldTO = data.timeout;
- data.timeout = data.timeout * 4;
- this.setEvent('success',function(){
- T.get.setEvent('success',function () { // simplify success event, which we run very often
- T.parse(this);
- strikes = 0;
- clearTimeout(data.timer);
- data.timer = setTimeout(loopFunc, data.timeout);
- });
- data.timeout = oldTO;
- strikes = 0;
- clearTimeout(data.timer);
- data.timer = setTimeout(loopFunc, data.timeout);
- });
- if (confirm('Unable to query server, would you like to keep trying?')) data.timer = setTimeout(loopFunc, data.timeout);
- }
- else data.timer = setTimeout(loopFunc, data.timeout);
- };
- //this.post = new Poll('GET');
- }
- Room.prototype.makeRoom = function () {
- this.ri = this.tmp.set('room', Temp.ele('div',false,{
- id:'room'
- }), 'body');
- this.offsetTop = document.getElementById('sidebar').offsetTop;
- this.scrollHeight = this.tmp.index.$[this.ri].scrollHeight;
- return this;
- }
- Room.prototype.makeToolbar = function () {
- var te = false, beText = document.createTextNode('Expand View'), m=10, T=this;
- this.be = this.tmp.set('btn-expand',Temp.ele('span',{
- 'cursor':'pointer'
- , 'float':'left'
- , 'font-size':'11px'
- , 'padding':'7px 0 0 15px'
- },false,{
- 'mouseout':function () {
- this.style.textDecoration = 'none';
- },
- 'mouseover':function () {
- this.style.textDecoration = 'underline';
- },
- 'mouseup':function () {
- te = !te;
- if (te) {
- beText.nodeValue = 'Collapse View';
- T.tmp.index.$[T.ri].style.height = 'auto';
- T.tmp.index.$[T.ri].style.overflowY = 'visible';
- }
- else {
- beText.nodeValue = 'Expand View';
- T.tmp.index.$[T.ri].style.height = '';
- T.tmp.index.$[T.ri].style.overflowY = 'scroll';
- }
- }
- }),'header');
- this.tmp.appendTo(this.be,beText);
- this.tmp.set('toolbar',Temp.ele('div',false,{
- id:'toolbar'
- }),'body');
- this.ai = this.tmp.set('btn-alerts',Temp.ele('div',false,{
- id:'btn-alerts'
- , class:'btn wrap'
- },{
- 'mouseup':function(event){
- alert('Alerts not yet worthy');
- }
- }),'toolbar');
- this.tmp.appendTo(this.ai,document.createTextNode('a'));
- this.wi = this.tmp.set('input-wrap',Temp.ele('div',false,{
- class:'wrap space'
- }),'toolbar');
- this.ii = this.tmp.set('input',Temp.ele('textarea',false,{
- class:'input'
- },{
- 'keypress':function(event){
- if (event.which === 13) T.post.callback('http://www.rescreatu.com/tagbox2/getChat.php?chat=1&last='+T.last);
- }
- }),'input-wrap');
- this.tmp.index.$[this.ii].focus();
- this.si = this.tmp.set('btn-submit',Temp.ele('div',false,{
- class:'btn wrap space'
- , 'data-disabled':'false'
- },{
- 'mouseup' : function (event) {
- if (this.getAttribute('data-disabled') != 'true') T.post.callback('http://www.rescreatu.com/tagbox2/getChat.php?chat=1&last='+T.last);
- }
- }),'toolbar');
- this.tmp.appendTo(this.si, document.createTextNode('send'));
- var plus = 12; // 10 for margins 2 for wrapper border
- plus += this.tmp.index.$[this.ai].offsetWidth;
- plus += this.tmp.index.$[this.si].offsetWidth;
- plus = this.tmp.index.$[this.ri].offsetWidth-plus;
- this.tmp.index.$[this.wi].style.width = plus+'px';
- this.tmp.index.$[this.ii].style.width = (plus-8)+'px'; // 8 for padding
- return this;
- };
- Room.prototype.keepClean = function () {
- if (data.options.threshold < 1) return;
- var limit = this.last-data.options.threshold;
- if (limit > this.first) for (; this.first < limit; ++this.first) this.tmp.index.$[this.ri].removeChild(this.tmp.index.$[this.ri].firstChild);
- //if (data.options.threshold > 0 && this.msgcount > data.options.threshold) for (; this.msgcount > data.options.threshold; --this.msgcount) this.tmp.index.$[this.ri].removeChild(this.tmp.index.$[this.ri].firstChild);
- };
- Room.prototype.checkScroll = function () {
- var diff = this.tmp.index.$[this.ri].scrollHeight-this.scrollHeight; // difference of room scrollHeight and inital scrollHeight
- return !!(diff<=this.tmp.index.$[this.ri].scrollTop); // true if difference is the same as scrollTop (or greater than just incase), meaning it's scrolled to the bottom
- };
- Room.prototype.setScroll = function () {
- return this.tmp.index.$[this.ri].scrollTop = this.tmp.index.$[this.ri].scrollHeight-this.scrollHeight;
- };
- Room.prototype.addRow = function (usr, mid, text) {
- var row = Temp.ele('div',false,{'data-mid':mid})
- , msg = Temp.ele('span', row);
- /* NEEDS ATTENTION: innerHTML is bad practice and has potential security flaws, but is our best option with the current system */
- msg.innerHTML = text; // it puts a lot a of trust in contents of messages :(
- row.appendChild(usr);
- row.appendChild(document.createTextNode(': '));
- row.appendChild(msg);
- this.tmp.index.$[this.ri].appendChild(row);
- this.last = mid;
- ++this.msgcount;
- };
- Room.prototype.sysMessage = function (mid, text) {
- var user = Temp.ele('span',{'color':'#f00','fontWeight':'bold'});
- user.appendChild(document.createTextNode('System message'));
- this.addRow(user, mid, text);
- };
- /* following function needs optimization */
- Room.prototype.parse = function (obj,forceScroll) {
- var i, mid, uid, user, scroll, messages = obj.ajax.responseXML.getElementsByTagName('message');
- if (messages.length < 1) return;
- this.first = this.first||messages[0].getAttribute('id');
- scroll = forceScroll||this.checkScroll(); // return true if at bottom of scroll area
- for (i = 0; i < messages.length; ++i) {
- mid = messages[i].getAttribute('id');
- if ((uid = Room.parseUser(messages[i].childNodes[0].textContent)) === false) {
- if (data.playAudio===null) data.playAudio = Audio.test(messages[i].childNodes[1].textContent); // set alerts by only regexp for system message
- this.sysMessage(mid, messages[i].childNodes[1].textContent);
- }
- else {
- if (data.playAudio===null) { // only begin to set sound if not already set
- if (typeof data.usersound[uid] == 'number') data.playAudio = data.usersound[uid]; // set by user id posting
- else if (typeof data.usersound[data.userlist[uid][0].toLowerCase()] == 'number') data.playAudio = data.usersound[data.userlist[uid][0].toLowerCase()]; // set by username posting
- else data.playAudio = Audio.test(messages[i].childNodes[1].textContent); // set by regexp
- };
- this.addRow(Temp.userCaption(uid,data.userlist[uid][0],data.userlist[uid][1]), mid, messages[i].childNodes[1].textContent);
- }
- };
- this.keepClean();
- if (scroll) this.setScroll(); // only scroll to the bottom if were at the bottom
- if (data.playAudio !== null && data.options.audio !== 'false') {
- Audio.play(data.playAudio);
- data.playAudio = null;
- }
- };
- /*parsing old html pseudocode style to extract id, username, and color */
- Room.parseUser = function (us) {
- if (/system message/i.test(us)) return false; // return false if username is system message (needs work)
- var uid = us.substring(49, us.indexOf('" target="_blank"'));
- if (!data.userlist[uid]) { // only if we haven't seen them yet
- var un = us.substring(us.indexOf('<font color=')+12)
- , os = un.indexOf('>')
- , css = un.substring(0,os);
- un = un.substring(++os);
- un = un.substring(0,un.indexOf('<'));
- data.userlist[uid] = [un,(css=='black'?null:'color:'+css+';')]; // saves username color/css in an array under user id
- //console.log(uid,un,css);
- };
- return uid; // returns user id
- };
- function inArray(arr,val) {
- for (var i = 0; i < arr.length; ++i) if (arr[i] === val) return true;
- return false;
- }
- function isArray(arr) {
- return Object.prototype.toString.call(arr) === "[object Array]";
- }
- })(window);
Add Comment
Please, Sign In to add comment