Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ChatDialogue.MESSAGE_TEMPLATE=new Template('<p class="#{classNames}"><span class="#{userClassNames} username time">#{time}</span> <span username="#{username}" class="username #{userClassNames}" oncontextmenu="rClick(\'#{username}\',event);return false;">#{prefix}#{username}</span><span class="separator">: </span><span class="message hyphenate">#{message}</span><span class="clear"></span></p>');
- ChatDialogue.MESSAGE_TEMPLATE.reEval = ChatDialogue.MESSAGE_TEMPLATE.evaluate;
- ChatDialogue.MESSAGE_TEMPLATE.evaluate = function(a) {
- a.time = dotd_tools['tools_timestamp'] == true ? timestamp() + " ": "";
- return this.reEval(a);
- };
- ChatDialogue.prototype.msgHandler = ChatDialogue.prototype.displayUnsanitizedMessage;
- ChatDialogue.prototype.displayUnsanitizedMessage = function(a,b,c,d) {
- //console.log("Chat:" + a,b,c,d);
- if (!c) { c = {}; }
- if (dotd_tools['tools_charter'] == true && /kv_action_type\=signcharter/.test(b)) { return; }
- if (dotd_tools['tools_guildinv'] == true && /kv_action_type\=guildinvite/.test(b)) { return; }
- if (dotd_tools['tools_friend'] == true && isFriend(a)) { c.class += " friend"; }
- if (dotd_tools['tools_highlight'] == true) {
- var r = new RegExp("(^|\\s|\\*|@)("+holodeck._username+")(\\s|\\.|\\,|\\!|\\:|\\?|\\'|\\*|$)","ig");
- //var e = this._holodeck._chat_window._active_room._tab_for_room;
- if (r.test(b)) {
- c.class += " highlight";
- if (dotd_tools['tools_highlight_alert'] == true && document.hidden == true) { tabAlert(); }
- }
- else if (dotd_tools['tools_highlight_ext'] == true) {
- var s = dotd_tools['tools_highlight_list'];
- s = s.replace(/(\.|\*|\$|\^|\[|\]|\+|\?)/g,"\\$1");
- r = new RegExp("(^|\\s|\\*|@)("+s.replace(/(,|\s)/g,'|')+")(\\s|\\.|\\,|\\!|\\:|\\?|\\'|\\*|$)", "ig");
- if (r.test(b)) {
- c.class += " highlight";
- if (dotd_tools['tools_highlight_alert'] == true && document.hidden == true) { tabAlert(); }
- }
- }
- }
- if (d && d.whisper == true && document.hidden == true) { tabAlert(); }
- this.msgHandler(a,b,c,d);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement