diff --git a/swearify/megachat.css b/swearify/megachat.css deleted file mode 100644 index 2518bbdc..00000000 --- a/swearify/megachat.css +++ /dev/null @@ -1,608 +0,0 @@ -/* REQUIRED CSS */ /*all of it is required, are you on drugs? */ -.a_chat_pm tr, .a_chat_pm td, .a_chat_tab tr, .a_chat_tab td, .a_chat_cmd tr, .a_chat_cmd td { - display:none!important; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -.a_chat_pm:before, .a_chat_tab:before, .a_chat_cmd:before { - content: 'Hidden Content'; - font-style: italic; - font-family: Verdana,Arial,Helvetica,sans-serif; -}"; - - -/* AvacWeb Chat CSS (2.0+) */ - - -/* ------------------------- - * MAIN AVACWEB CHAT ELEMENTS - * ------------------------- - */ -#avacweb_chat { /* the box that holds the chat */ - position: fixed; - bottom: 25px; - right: 10px; - height: 70%; - width: 75%; - z-index: 99998; - font-family: Verdana,Arial,Helvetica,sans-serif; -}mar -#avacweb_chat iframe { - border: 2px solid #2e2e2e!important; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -.custom_placement #avacweb_chat { /* fixes the positioning of an AWC placed in page using custom_placement */ - position: relative; - height: 400px; - min-width: 700px; - bottom: initial; - top: initial; - z-index: inherit; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -/*#avacweb_chat_button { - position: fixed; - right: 29px; - font-size: 1.3em; - font-weight: bold; - z-index: 99999; - bottom: 0px; - background: #000000; - box-shadow: inset 0 10px 10px #111316; - -moz-box-shadow: inset 0 10px 10px #111316; - -webkit-box-shadow: inset 0 10px 10px #111316; - color: #FFF; - border: 1px solid #161616; - padding: 5px 7px; - text-align: center; - border-radius: 2px; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - font-family: Verdana,Arial,Helvetica,sans-serif; - text-shadow: 0 0px #FFF; -} -#avacweb_chat_button:hover { - border: 1px solid #7A0000!important; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -#avacweb_chat_button.newmsg { - background: #FFA500; - box-shadow: inset 0 10px 10px #F0D443; - -moz-box-shadow: inset 0 10px 10px #F0D443; - -webkit-box-shadow: inset 0 10px 10px #F0D443; - color: #FFF; - text-shadow: 0 1px #555; - border: 1px solid #C5946D; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -*//* The button that opens the chat */ - -/* my additions */ -#avacweb_chat_button { - background: #000000; - background-image: -webkit-linear-gradient(top, #000000, #75736f); - background-image: -moz-linear-gradient(top, #000000, #75736f); - background-image: -ms-linear-gradient(top, #000000, #75736f); - background-image: -o-linear-gradient(top, #000000, #75736f); - background-image: linear-gradient(to bottom, #000000, #75736f); - -webkit-border-radius: 26; - -moz-border-radius: 26; - border-radius: 26px; - -webkit-box-shadow: 0px 0px 7px #751700; - -moz-box-shadow: 0px 0px 7px #751700; - box-shadow: 0px 0px 7px #751700; - font-family: Arial; - color: #e6e6e6; - font-size: 21px; - padding: 10px 15px 10px 15px; - /*border: solid #751700 2px;*/ - text-decoration: none; - margin-bottom: 9px; - margin-right: 7px; - color: #991F00; - text-shadow: 0px 0px 3px #000; -} - -#avacweb_chat_button:hover { - background: #0f0f0f; - background-image: -webkit-linear-gradient(top, #0f0f0f, #516880); - background-image: -moz-linear-gradient(top, #0f0f0f, #516880); - background-image: -ms-linear-gradient(top, #0f0f0f, #516880); - background-image: -o-linear-gradient(top, #0f0f0f, #516880); - background-image: linear-gradient(to bottom, #0f0f0f, #516880); - text-decoration: none; -} - -#avacweb_chat_button.newmsg { - background: #000000; - background-image: -webkit-linear-gradient(top, #000000, #e3a446); - background-image: -moz-linear-gradient(top, #000000, #e3a446); - background-image: -ms-linear-gradient(top, #000000, #e3a446); - background-image: -o-linear-gradient(top, #000000, #e3a446); - background-image: linear-gradient(to bottom, #000000, #e3a446); - -webkit-border-radius: 26; - -moz-border-radius: 26; - border-radius: 26px; - -webkit-box-shadow: 0px 0px 7px #751700; - -moz-box-shadow: 0px 0px 7px #751700; - box-shadow: 0px 0px 7px #751700; - font-family: Arial; - color: #EADAD6; /*whiter white*/ - font-size: 21px; - padding: 10px 15px 10px 15px; - /*border: solid #751700 2px;*/ - text-decoration: none; -} -#awc_tabs { /* The box that holds the tabs */ - background: #1C1C1C; - border-bottom: 1px solid #CCC; - padding: 0; - margin: 0; - display: block; - font-family: Verdana,Arial,Helvetica,sans-serif; - font-size: .9em; -} -#awc_header { /* the top header */ - background: #991F00; - padding: 5px; - font-family: Adventure,Verdana,Arial,Helvetica,sans-serif; -} -#awc_footer { /* the bottom footer containing hte buttons and message box */ - clear: both; - background: #991F00; - padding: 5px; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -#awc_rightbox { /* the box right of the userlist contianing the messages and tabs */ - float: right; - width: 80%; - height: 79%; - background: #1C1C1C; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -#awc_userlist { /* the memberlist on the left */ - font-size: .7em; - font-weight: 600; - float: left; - width: 20%; - height: 79%; - background: #1C1C1C; - font-family: Verdana,Arial,Helvetica,sans-serif; -} - -#awc_userlist .online-users { - padding-left: 20px; -} - -#awc_messages { /* box where the messages appear. */ - max-height: 93%; - min-height: 93%; - overflow: auto; - font-family: Verdana,Arial,Helvetica,sans-serif; -} - - -/* --------------------- - * SMALLER ELEMENTS WITHIN AWC - * --------------------- - */ - #awc_title { /* The chat title */ - color: #FFF; - text-shadow: 0 1px #00F; - font-weight: bold; - font-size: 1.4em; - margin-left: 10px; - /*font-family: Verdana,Arial,Helvetica,sans-serif;*/ -} -#awc_buttons { /* the box which holds the header buttons */ - float: right; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -#awc_userlist h4.member-title { /* 'Online' title on memberlist. */ - text-align: center; - padding: 7px; - background: #7A0000; - font-weight: bold; - font-size: 1.2em; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -#awc_userlist li { /* online user row */ - font-size: 1.1em; - padding: 5px; - list-style-type: none; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -#awc_userlist li.idle { /* styling for an idle user in list */ - font-style: italic; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -#awc_userlist li.idle:after { /* (Idle) after an idle user */ - font-style: italic; - content: '(AFK)'; - color: #FFF; - margin-left: 5px; - font-family: Verdana,Arial,Helvetica,sans-serif; -} - -.achat_tab { /* Design of the actual tabs */ - border-radius: 0; - -moz-border-radius: 0; - -webkit-border-radius:0; - margin: 0; - border: none; - border-right: 1px solid #FFF; - padding: 3px 17px; - color: #CC3300; - font-weight: bold; - display: inline-block; - background: #C8D8EB; - text-shadow: 0 1px #EEE; - cursor: pointer; - box-shadow: inset 0 5px 5px #DFE9FA; - -moz-box-shadow: inset 0 5px 5px #DFE9FA; - -webkit-box-shadow: inset 0 5px 5px #DFE9FA; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -#achat_login { /* Red log in box when user is logged out */ - background: #444; - border: 1px solid #2e2e2e; - border-radius: 3px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - box-shadow: 0 10px 15px #888 inset; - -moz-box-shadow: 0 10px 15px #888 inset; - -webkit-box-shadow: 0 10px 15px #888 inset; - color: #696962; - /*color: #808078;*/ - font-size: 1.3em; - font-weight: 700; - margin: 10px auto; - width: 90%; - padding: 5px 0; - text-shadow: 0 1px #CC0000; - text-align: center; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -#awc_form { - float: right; - width: 50%; - font-family: Verdana,Arial,Helvetica,sans-serif; -} - -.achat_button { /* The grey-style button found through out AWC */ - display: inline-block; - padding: 3px 12px; - border: 1px solid #AAA; - border-radius: 3px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - box-shadow: inset 0 5px 10px #EEE; - -moz-box-shadow: inset 0 5px 10px #EEE; - -webkit-box-shadow: inset 0 5px 10px #EEE; - background: #DDD; - color: #777; - text-shadow: 0 1px #EEE; - cursor: pointer; - margin: 0 3px; - font-size: .7em; - /*font-size: 1em;*/ - margin-top:2px; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -.achat_button:hover { - color: #444; - border: 1px solid #888; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -.achat_row { /* Each message row in the chatbox */ - border-bottom: 1px solid #DDD; - border-top: 1px solid #FFF; - padding: 5px 2px; - min-height: 22px; - line-height: 21px; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -.achat_row.my_message { /* different background color for your own messages in the chat */ - background: #232424; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -.achat_row .user { - font-weight: 700; -} -.achat_row .date-and-time { - float: right; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -.achat_row .awc_avatar { - height: 20px; - width: 20px; - padding: 1px; - margin-right: 5px; - border: 1px solid #DDD; - float: left; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -#achat_user_prefs, #achat_smilies, #achat_colors, #achat_popup { /*The pop up boxes that display user options, smilies, colors */ - position: absolute; - bottom: 15%; - background: #161616; - padding: 10px; - border: 1px solid #BBB; - border-radius: 3px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - font-weight: bold; - text-shadow: 0 1px black; - box-shadow: 3px 3px 10px #888, inset 0 20px 20px #474747; - max-height: 250px; - overflow: auto; - left: 5%; - max-width: 250px; - /*color: white;*/ - font-size: .7em; - font-family: Verdana,Arial,Helvetica,sans-serif; -} -#achat_popup { - text-align: center; - left: 20%; - min-width: 45%; -} -#achat_popup.error { - border: 2px solid #E76878; -} -.awc_x { /* the 'X' close button. */ - float: right; - margin-right: 5px; - margin-top: -10px; - font-weight: bold; - cursor: pointer; - color: #E27474; - text-shadow: 0 1px #FFF; - font-size: 2em; - font-family: sans; -} -.awc_x:hover { - color: #D52727; -} - -.achat_user_setting { /* User options in the small box. */ - margin: 3px 0; - border: 1px solid #CCC; - padding: 2px 5px; - width: 150px; -} -.achat_user_setting input { - float: right; -} -.achat_pm_prepend { /* The small bit that says 'Private messsage:' at the start of PM's */ - font-weight: bold; - font-style: italic; - font-size: 0.8em; - margin-right: 5px; -} -#awc_contextmenu { /* The drop down menu when right-click a user name */ - background: #EEE; - position: absolute; - z-index: 9999; - border: 1px solid #CCC; - width: 187px; - height: 380px; -} -#awc_contextmenu p { /* The options within the dropdown menu */ - padding: 3px 5px; - border-bottom: 1px solid #CCC; - cursor: pointer; - font-size: 0.7em; - color: #9B9B9B; -} -#awc_contextmenu p:hover { - background: #DDD; - box-shadow: inset 0 5px 10px white; - -moz-box-shadow: inset 0 5px 10px white; - -webkit-box-shadow: inset 0 5px 10px white; -} -#awc_contextmenu p.contexthead { - background: #CCC; - padding: 5px; - color: #555; - font-size: .9em; - font-weight: bold; - box-shadow: inset #DDD 0 10px 15px; - -moz-box-shadow: inset #DDD 0 10px 15px; - -webkit-box-shadow: inset #DDD 0 10px 15px; - text-shadow: 0 1px white; - cursor: default; -} -#awc_contextmenu .contexthead img { - float: right; - cursor: pointer; -} -#achat_dimensions { /* Positions the resize/move buttons */ - width: 80px; - height: 30px; - display: inline; -} -#achat_dimensions span { /* Design of the resize and drag buttons */ - opacity: 0.7; - -moz-opacity: 0.7; - -webkit-opacity: 0.7; - filter: alpha(opacity=70); - display: block; - height: 20px; - width: 20px; - float: left; - margin-left: 5px; - background-color: #EEE; - padding: 2px; - border-radius: 3px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - background-repeat: no-repeat; - background-position: center center; -} -#achat_dimensions span:hover { - opacity: 1; - -moz-opacity: 1; - -webkit-opacity: 1; - filter: alpha(opacity=100); -} -#achat_resizer { background-image: url(http://i14.servimg.com/u/f14/17/20/25/96/resize10.gif); } -#achat_mover { background-image: url(http://i14.servimg.com/u/f14/17/20/25/96/move_i10.jpg); } - -.achat_tab .delete_tab { /* The delete button on tabs */ - position: absolute; - font-family: sans; - display: none; - color: #E71919; - text-shadow: none; - font-weight: bold; - font-size: 18px; - margin-left: 3px; - opacity: 0.8; -} - -/* ----------------------- - * ELEMENT TWEEKS FOR SETTINGS - * ----------------------- - */ -.achat_button.reading { /* Changes the reading button when in reading mode */ - color: red; -} -#achat_smilies, #achat_colors { /* Tweeks the width of the colors and smilies box to look neat */ - max-width: 96%; - margin: 0 2%; -} -#achat_colors td { - cursor: crosshair; - padding: 5px; - border: 1px solid #FFF; -} -.a_chat_pm, table.a_chat_pm, .a_chat_tab, .a_chat_cmd { - display: none!important; -} -.achat_tab.selected { /* Changes the design of the tab when its selected */ - background: #5C8AFF; - color: #FFF; - text-shadow: 0 1px #222; - box-shadow: inset 0 5px 5px #669CF8; - -moz-box-shadow: inset 0 5px 5px #669CF8; - -webkit-box-shadow: inset 0 5px 5px #669CF8; -} -.achat_tab:hover .delete_tab { - display: inline; -} -.achat_tab.new { - background: #F0D096; -} -#achat_smilies p.center, #achat_smilies input[type="submit"] { - display: none; -} - -#awc_message { /* the actual message thingy where you type your msgs duh*/ - width: 80%; - height: 50%; - padding: 3px 5px; - border-radius: 3px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - box-shadow: inset 0 3px 5px #363636; - -moz-box-shadow: inset 0 3px 5px #363636; - -webkit-box-shadow: inset 0 3px 5px #363636; - border: 1px solid #888; -} - - -/* ---------------------- - * MOBILE ADJUSTMENTS - * ---------------------- */ - - #avacweb_chat_holder.mobile { - font-size: 100%; - - } -.mobile #avacweb_chat { - top: 0px; - bottom: 5%; - right: 0px; - height: 95%; - width: 100%; -} -.mobile #awc_footer > .achat_button { - display: none; -} -.mobile #awc_form, .mobile #awc_userlist, .mobile #awc_rightbox { - float: inherit; - width: 100%; -} -.mobile #awc_message { - width: 70%; -} -.mobile #awc_userlist { - max-height: 150px; - overflow: auto; - height: auto; -} -.mobile #awc_userlist li { - display: inline; -} -.mobile #awc_rightbox { - height: 70%; -} -.mobile #avacweb_chat_button { - width: 100%; - height: 5%; -} -.mobile #awc_buttons { - float: inherit; -} -.mobile .achat_row .date-and-time, .mobile #awc_title { - display: none; -} -/* Already Existing elements */ -/*#chatbox_messenger_form { - color: #cc0000!important; -} -#chatbox_header, #chatbox_footer { -background-image: url("http://i45.servimg.com/u/f45/17/55/77/65/nav-bg10.png") !important; -background-repeat: repeat !important; -background-color: #161617!important; - box-shadow: inset 0 0px 0px #cc0000 !important; - -moz-box-shadow: inset 0 0px 0px #cc0000 !important; - -webkit-box-shadow: inset 0 0px 0px #cc0000 !important; - text-shadow: 0 1px #cc0000!important; -} -.chatbox_row_1 { - background-color: #1f1f1f !important; - font-size: 1.1em!important; -} -.chatbox_row_2 { - background-color: #161617 !important; - font-size: 1.1em!important; -} -#chatbox_members .member-title { - background-color: #444!important; - color: #fffff0!important; - border: 1px solid #2e2e2e!important; - box-shadow: inset 0 10px 10px #888!important; - -moz-box-shadow: inset 0 10px 10px #888!important; - -webkit-box-shadow: inset 0 10px 10px #888!important; - text-shadow: 0 1px #cc0000!important; -} -.chatbox { - background-color: #161617!important; -} -#chatbox { - display: none!important; -} -.chatbox-title, .chatbox-title a.chat-title { -color: #cc0000!important; -} -#chatbox_header { -text-shadow: 0 1px #999!important; -font-weight: bold!important; -} -#chatbox_footer { -text-shadow: 0 0px #ffffff!important; -font-weight: none!important; -}*/ - - diff --git a/swearify/megachat.js b/swearify/megachat.js deleted file mode 100644 index 4f1d8b6f..00000000 --- a/swearify/megachat.js +++ /dev/null @@ -1,1299 +0,0 @@ -var avacweb_chat_config = { - version : '2-0', - chat_title : 'AIM Chat', - stylesheet : "http://chat.avacweb.net/avacweb_chat_2.css", //NEVER CHANGE THIS - allow_private_messaging : 1, - allow_user_resize : 0, - custom_placement : null, - commands : {/* commands can be added here */}, - tabs : {/* tabs can be added here */}, - filters : {/* don't fuck with this */}, - allow_copyrights : 0, //please be kind and allow AWC to place small discreet copyrights and backlink on your forum. -}; -Math.irandom = new Function('min', 'max', 'return Math.floor(Math.random() * (max - min + 1)) + min;'); -(function (f, l, h) { - if (!l) { - if (!(window.JSON && window.sessionStorage && window.localStorage && Array.prototype.sort && Array.prototype.join)) return console.log("Minimum requirements not met to run AWC."); - var g = { - version: "2-0", - mobile: window.AWC_dev_mobile || !(!navigator.userAgent.match(/Android|webOS|BlackBerry|iP([oa]d|hone)|MeeGo|Mobile|PlayBook/i) && !navigator.userAgent.match(/Windows Phone/i)), - logged_in: !1, - last_data: { - connected: !1, - users: [], - messages: [] - }, - user_data: {}, - inactive_refreshes: 0, - refresh_timeout: null, - plain_text: "", - config: { - chat_title: "AIM Chat", - stylesheet: "http://chat.avacweb.net/avacweb_chat_2.css", //NEVER CHANGE THIS - allow_private_messaging: 1, - allow_user_resize: 0, - custom_placement: null, - allow_copyrights: 0, - loading_image: "http://i40.servimg.com/u/f40/17/20/25/96/26-110.gif", - template: { - markup: '', - ids: { - header: "awc_header", - footer: "awc_footer", - userlist: "awc_userlist", - messages: "awc_messages", - messagebox: "awc_message", - tabs: "awc_tabs", - buttons: "awc_buttons", - title: "awc_title", - usercount: "achat_user_count", - chat: "avacweb_chat" - } - }, - filters: {} - }, - refresh_rates: { - normal: 3E3, - in10: 8E3, - in20: 2E4, - in30: 4E4, - in40: 6E4 - }, - init: function (a, b) { - var c = document.getElementById("achat_script"), - d = this; - //if (!c || "script" !== c.tagName.toLowerCase() || -1 === c.src.indexOf("avacweb.net/v" + this.version)) throw Error("Avacweb chat has detected that you have installed it from another source. To prevent theft and copyright issues AWC can only be used via the AWC server"); - this.tid = a; - this._user = b; - b.session_logged_in && (f("head").prepend(''), c = f(this.config.custom_placement), c[0] ? c.html('
') : (c = '
' + this.t("Chat") + ': 0
', f(document.body).append(c + '
")), this.settings.init(), f.get("/chatbox/actions.forum?archives=" + this.settings.value("archives") + "&method=" + (this.config.auto_log_in ? "connect" : "get") + "&tid=" + a, function (a) { - d.load_template.call(d, a) - }, "json")) - }, - load_template: function (a) { - var b = this.config.template.markup, - c = document.getElementById("avacweb_chat_holder"); - if (c) { - c.innerHTML = b; - this.loading(); - this.create_userbase(a.users); - this.get_template_item("title").innerHTML = ' ' + this.config.chat_title + ""; - b = '' + this.t("Reading") + ""; - b += '' + this.t("Archives") + ': ' + (this.settings.on("archives") ? this.t("On") : this.t("Off")) + ""; - b += '' + this.t("Log Out") + ""; /// edited because css - this.get_template_item("buttons").innerHTML = b; - f(this.get_template_item("messagebox")).after('' + this.t("Send") + ""); - footer_html = '
' + this.t("User Options") + "
"; - footer_html += ''; - footer_html += ''; - footer_html += '
' + this.t("Smilies") + '
'; - footer_html += '
' + this.t("Colors") + '
'; - window.AWC_update && this.cookie("update") !== AWC_update.id && this._user.user_level && footer_html; - f(this.get_template_item("footer")).append(footer_html); - this.get_template_item("chat").style.display = this.settings.on("open") || this.config.custom_placement ? "" : "none"; - /*if (this.config.allow_user_resize && !this.mobile && !this.config.custom_placement) { - f(this.get_template_item("header")).prepend('
'); - if (b = this.cookie("dimensions")) { - var b = JSON.parse(b), - d; - for (d in b) this.get_template_item("chat").style[d] = b[d] - } - f("#achat_resizer").mousedown(function (a) { - 0 === a.button && avacweb_chat.resize.init(a, "drag") - }); - f("#achat_mover").mousedown(function (a) { - 0 === a.button && avacweb_chat.resize.init(a, "move") - }) - }*/ - //this.config.allow_copyrights && f(this.get_template_item("chat")).prepend('AWC2.0 © Copyright 2015 AvacWeb All rights reserved.'); - this.switch_display(a.connected); - this.handle_data(a); - this.event.fire("onload") - } - }, - switch_display: function (a) { - 0 === arguments.length && (a = this.logged_in); - this.logged_in = a; - var b = this.get_template_item("buttons"), - c = this.get_template_item("footer"), - d = this.get_template_item("tabs"); - a ? b.style.display = c.style.display = d.style.display = "" : (b.style.display = c.style.display = d.style.display = "none", this.get_template_item("messages").innerHTML = '
' + this.t("You are disconnected. Click log in to join the chat.") + '

' + this.t("Log In") + "
") - }, - log_in: function (a) { - this.last_data.messages = []; - var b = this; - this.refresh_timeout && clearTimeout(this.refresh_timeout); - a ? this.event.fire("onlogout") && (this.switch_display(!1), f.get("/chatbox/actions.forum?method=disconnect&tid=" + this.tid, function (a) { - b.handle_data.call(b, a) - })) : this.event.fire("onlogin") && (this.loading(), f.get("/chatbox/actions.forum?archives=" + this.settings.value("archives") + "&method=connect&tid=" + this.tid, function (a) { - b.switch_display(!0); - b.handle_data.call(b, a) - })) - }, - refresh: function () { - this.refresh_timeout && clearTimeout(this.refresh_timeout); - var a = avacweb_chat; - if (a.event.fire("onrefresh", a.logged_in)) { - if (a.logged_in && a.settings.on("disable timeout")) return a.simple_send("method=send&message="); - f.get("/chatbox/actions.forum?archives=" + a.settings.value("archives") + "&method=get&tid=" + this.tid, function (b) { - a.handle_data.call(a, b) - }, "json") - } - }, - filter_swears: function (msg) { - var http_link = msg.indexOf(link_code[0]); - var www_link = msg.indexOf(link_code[1]); - var https_link = msg.indexOf(link_code[2]); - var exit_code = msg.indexOf(spec_code[0]); - var away_code = msg.indexOf(spec_code[1]); - var abs_code = msg.indexOf(spec_code[2]); - var code_code = msg.indexOf(spec_code[3]); - var semi_code = msg.indexOf(spec_code[3]); - var spec_switch = 0; - if (exit_code != -1 || away_code != -1 || abs_code != -1 || code_code != -1 || semi_code != -1) spec_switch = 1; - - for (var i in swear_words) { - if (http_link > 0 || www_link > 0 || https_link > 0) { - var which = 0; - if (http_link != -1) { - which = http_link; - } else if (www_link != -1) { - which = www_link; - } else { - which = https_link; - } - var before_link = msg.substr(0, which); - var link = msg.substr(which, msg.length); - if (before_link.toLowerCase().indexOf(swear_words[i]) != -1) { - var word_msg = before_link.split(' '); - for (var j in word_msg) { - if (word_msg[j].toLowerCase().indexOf(swear_words[i]) != -1) { - word_msg[j] = word_msg[j].split('').join(swear_code[spec_switch]); - } - } - msg = word_msg.join(' '); - msg += link; - } - } else if (msg.toLowerCase().indexOf(swear_words[i]) != -1) { - var word_msg = msg.split(' '); - for (var j in word_msg) { - if (word_msg[j].toLowerCase().indexOf(swear_words[i]) != -1) { - word_msg[j] = word_msg[j].split('').join(swear_code[spec_switch]); - } - } - msg = word_msg.join(' '); - } - } - return msg; - }, - filter_emoticons: function (input) { - for (var i = 0; i < Object.keys(emoticon_1).length; i++) { - var index_num = input.regexIndexOf(new RegExp(values(emoticon_1)[i][0], "gi")); - if (index_num >= 0) { - var new_msg = input.replace(new RegExp(values(emoticon_1)[i][0], "gi"), img_tag[0] + values(emoticon_1)[i][1] + img_tag[1]); - input = new_msg; - } - } - for (var i = 0; i < Object.keys(emoticon_2).length; i++) { - var index_num = input.regexIndexOf(new RegExp(values(emoticon_2)[i][0], "gi")); - if (index_num >= 0) { - var new_msg = input.replace(new RegExp(values(emoticon_2)[i][0], "gi"), img_tag[0] + values(emoticon_2)[i][1] + img_tag[1]); - input = new_msg; - } - } - for (var i = 0; i < Object.keys(emoticon_3).length; i++) { - var index_num = input.regexIndexOf(new RegExp(values(emoticon_3)[i][0], "gi")); - if (index_num >= 0) { - var new_msg = input.replace(new RegExp(values(emoticon_3)[i][0], "gi"), img_tag[0] + values(emoticon_3)[i][1] + img_tag[1]); - input = new_msg; - } - } - return input; - }, - filter_maymays: function(input) { - for (var i = 0; i < Object.keys(maymay).length; i++) { - var index_num = input.regexIndexOf(new RegExp(values(maymay)[i][0], "gi")); - if (index_num >= 0) { - var new_msg = input.replace(new RegExp(values(maymay)[i][0], "gi"), values(maymay)[i][1]); - input = new_msg; - } - } - return input; - }, - filter_greentext: function(input) { - if (input.indexOf('>') === 0) - return color_code[0] + input + color_code[1]; - else return input; - }, - filter_redtext: function(input) { - if (input.length >= 1) - if (input.indexOf('<') === input.length - 1) - return color_code[2] + input + color_code[3]; - else return input; - else return input; - }, - filter_leet: function(new_msg) { - if (new_msg.regexIndexOf(/\/leet /i) === 0) { - new_msg = new_msg.replace(/\/leet /i, ''); - new_msg = new_msg.replace(/a/gi, '4'); - new_msg = new_msg.replace(/b/gi, '|3'); - new_msg = new_msg.replace(/c/gi, '('); - new_msg = new_msg.replace(/d/gi, '|)'); - new_msg = new_msg.replace(/e/gi, '3'); - new_msg = new_msg.replace(/f/gi, '|='); - new_msg = new_msg.replace(/g/gi, '9'); - new_msg = new_msg.replace(/h/gi, '|-|'); - new_msg = new_msg.replace(/i/gi, '1'); - new_msg = new_msg.replace(/j/gi, '_|'); - new_msg = new_msg.replace(/k/gi, '|<'); - new_msg = new_msg.replace(/l/gi, '1'); - new_msg = new_msg.replace(/m/gi, '|\\/|'); // escaped - new_msg = new_msg.replace(/n/gi, '|\\|'); // escaped - new_msg = new_msg.replace(/o/gi, '0'); - new_msg = new_msg.replace(/p/gi, '|>'); - new_msg = new_msg.replace(/q/gi, '().'); - new_msg = new_msg.replace(/r/gi, '|2'); - new_msg = new_msg.replace(/s/gi, '5'); - new_msg = new_msg.replace(/t/gi, '7'); - new_msg = new_msg.replace(/u/gi, '|_|'); - new_msg = new_msg.replace(/v/gi, '\\/'); // escaped - new_msg = new_msg.replace(/w/gi, '\\/\\/'); // escaped - new_msg = new_msg.replace(/x/gi, '><'); - new_msg = new_msg.replace(/y/gi, '`/'); - new_msg = new_msg.replace(/z/gi, '2'); - return new_msg; - } else return new_msg; - }, - filter_balloon: function(new_msg) { - if (new_msg.regexIndexOf(/\/balloon /i) === 0) { - new_msg = new_msg.replace(/\/balloon /i, ''); - new_msg = new_msg.replace(/a/gi, 'ⓐ'); - new_msg = new_msg.replace(/b/gi, 'ⓑ'); - new_msg = new_msg.replace(/c/gi, 'ⓒ'); - new_msg = new_msg.replace(/d/gi, 'ⓓ'); - new_msg = new_msg.replace(/e/gi, 'ⓔ'); - new_msg = new_msg.replace(/f/gi, 'ⓕ'); - new_msg = new_msg.replace(/g/gi, 'ⓖ'); - new_msg = new_msg.replace(/h/gi, 'ⓗ'); - new_msg = new_msg.replace(/i/gi, 'ⓘ'); - new_msg = new_msg.replace(/j/gi, 'ⓙ'); - new_msg = new_msg.replace(/k/gi, 'ⓚ'); - new_msg = new_msg.replace(/l/gi, 'ⓛ'); - new_msg = new_msg.replace(/m/gi, 'ⓜ'); - new_msg = new_msg.replace(/n/gi, 'ⓝ'); - new_msg = new_msg.replace(/o/gi, 'ⓞ'); - new_msg = new_msg.replace(/p/gi, 'ⓟ'); - new_msg = new_msg.replace(/q/gi, 'ⓠ'); - new_msg = new_msg.replace(/r/gi, 'ⓡ'); - new_msg = new_msg.replace(/s/gi, 'ⓢ'); - new_msg = new_msg.replace(/t/gi, 'ⓣ'); - new_msg = new_msg.replace(/u/gi, 'ⓤ'); - new_msg = new_msg.replace(/v/gi, 'ⓥ'); - new_msg = new_msg.replace(/w/gi, 'ⓦ'); - new_msg = new_msg.replace(/x/gi, 'ⓧ'); - new_msg = new_msg.replace(/y/gi, 'ⓨ'); - new_msg = new_msg.replace(/z/gi, 'ⓩ'); - new_msg = new_msg.replace(/1/gi, '⓵'); - new_msg = new_msg.replace(/2/gi, '⓶'); - new_msg = new_msg.replace(/3/gi, '⓷'); - new_msg = new_msg.replace(/4/gi, '⓸'); - new_msg = new_msg.replace(/5/gi, '⓹'); - new_msg = new_msg.replace(/6/gi, '⓺'); - new_msg = new_msg.replace(/7/gi, '⓻'); - new_msg = new_msg.replace(/8/gi, '⓼'); - new_msg = new_msg.replace(/9/gi, '⓽'); - new_msg = new_msg.replace(/0/gi, '⓪'); - return new_msg; - } else return new_msg; - }, - filter_braille: function(new_msg) { - if (new_msg.regexIndexOf(/\/braille /i) === 0) { - new_msg = new_msg.replace(/\/braille /i, ''); - new_msg = new_msg.replace(/a/gi, '⠁'); - new_msg = new_msg.replace(/b/gi, '⠃'); - new_msg = new_msg.replace(/c/gi, '⠉'); - new_msg = new_msg.replace(/d/gi, '⠙'); - new_msg = new_msg.replace(/e/gi, '⠑'); - new_msg = new_msg.replace(/f/gi, '⠋'); - new_msg = new_msg.replace(/g/gi, '⠛'); - new_msg = new_msg.replace(/h/gi, '⠓'); - new_msg = new_msg.replace(/i/gi, '⠊'); - new_msg = new_msg.replace(/j/gi, '⠚'); - new_msg = new_msg.replace(/k/gi, '⠅'); - new_msg = new_msg.replace(/l/gi, '⠇'); - new_msg = new_msg.replace(/m/gi, '⠍'); - new_msg = new_msg.replace(/n/gi, '⠝'); - new_msg = new_msg.replace(/o/gi, '⠕'); - new_msg = new_msg.replace(/p/gi, '⠏'); - new_msg = new_msg.replace(/q/gi, '⠟'); - new_msg = new_msg.replace(/r/gi, '⠗'); - new_msg = new_msg.replace(/s/gi, '⠎'); - new_msg = new_msg.replace(/t/gi, '⠞'); - new_msg = new_msg.replace(/u/gi, '⠥'); - new_msg = new_msg.replace(/v/gi, '⠧'); - new_msg = new_msg.replace(/w/gi, '⠺'); - new_msg = new_msg.replace(/x/gi, '⠭'); - new_msg = new_msg.replace(/y/gi, '⠽'); - new_msg = new_msg.replace(/z/gi, '⠵'); - new_msg = new_msg.replace(/1/gi, '⠼⠁'); - new_msg = new_msg.replace(/2/gi, '⠼⠃'); - new_msg = new_msg.replace(/3/gi, '⠼⠉'); - new_msg = new_msg.replace(/4/gi, '⠼⠙'); - new_msg = new_msg.replace(/5/gi, '⠼⠑'); - new_msg = new_msg.replace(/6/gi, '⠼⠋'); - new_msg = new_msg.replace(/7/gi, '⠼⠛'); - new_msg = new_msg.replace(/8/gi, '⠼⠓'); - new_msg = new_msg.replace(/9/gi, '⠼⠊'); - new_msg = new_msg.replace(/0/gi, '⠼⠚'); - return new_msg; - } else return new_msg; - }, - filter_greek: function(new_msg) { - if (new_msg.regexIndexOf(/\/greek /i) === 0) { - new_msg = new_msg.replace(/\/greek /i, ''); - new_msg = new_msg.replace(/a/gi, 'α'); - new_msg = new_msg.replace(/b/gi, 'β'); - new_msg = new_msg.replace(/c/gi, 'ς'); - new_msg = new_msg.replace(/d/gi, 'δ'); - new_msg = new_msg.replace(/e/gi, 'ε'); - new_msg = new_msg.replace(/f/gi, 'ƒ'); - new_msg = new_msg.replace(/g/gi, 'g'); - new_msg = new_msg.replace(/h/gi, 'н'); - new_msg = new_msg.replace(/i/gi, 'ι'); - new_msg = new_msg.replace(/j/gi, 'j'); - new_msg = new_msg.replace(/k/gi, 'κ'); - new_msg = new_msg.replace(/l/gi, 'ℓ'); - new_msg = new_msg.replace(/m/gi, 'м'); - new_msg = new_msg.replace(/n/gi, 'η'); - new_msg = new_msg.replace(/o/gi, 'ο'); - new_msg = new_msg.replace(/p/gi, 'ρ'); - new_msg = new_msg.replace(/q/gi, 'φ'); - new_msg = new_msg.replace(/r/gi, 'я'); - new_msg = new_msg.replace(/s/gi, 's'); - new_msg = new_msg.replace(/t/gi, 'τ'); - new_msg = new_msg.replace(/u/gi, 'μ'); - new_msg = new_msg.replace(/v/gi, 'v'); - new_msg = new_msg.replace(/w/gi, 'ω'); - new_msg = new_msg.replace(/x/gi, 'χ'); - new_msg = new_msg.replace(/y/gi, 'λ'); - new_msg = new_msg.replace(/z/gi, 'ζ'); - return new_msg; - } else return new_msg; - }, - filter_morse: function(new_msg) { - if (new_msg.regexIndexOf(/\/morse /i) === 0) { - new_msg = new_msg.replace(/\/morse /i, ''); - new_msg = new_msg.replace(/a/gi, '.-//'); - new_msg = new_msg.replace(/b/gi, '-...//'); - new_msg = new_msg.replace(/c/gi, '-[b][/b].[b][/b]-.//'); - new_msg = new_msg.replace(/d/gi, '-..//'); - new_msg = new_msg.replace(/e/gi, './/'); - new_msg = new_msg.replace(/f/gi, '..-.//'); - new_msg = new_msg.replace(/g/gi, '--.//'); - new_msg = new_msg.replace(/h/gi, '....//'); - new_msg = new_msg.replace(/i/gi, '..//'); - new_msg = new_msg.replace(/j/gi, '.---//'); - new_msg = new_msg.replace(/k/gi, '-[b][/b].[b][/b]-//'); - new_msg = new_msg.replace(/l/gi, '.-..//'); - new_msg = new_msg.replace(/m/gi, '--//'); - new_msg = new_msg.replace(/n/gi, '-.//'); - new_msg = new_msg.replace(/o/gi, '---//'); - new_msg = new_msg.replace(/p/gi, '.--.//'); - new_msg = new_msg.replace(/q/gi, '--[b][/b].[b][/b]-//'); - new_msg = new_msg.replace(/r/gi, '.-.//'); - new_msg = new_msg.replace(/s/gi, '...//'); - new_msg = new_msg.replace(/t/gi, '-//'); - new_msg = new_msg.replace(/u/gi, '..-//'); - new_msg = new_msg.replace(/v/gi, '...-//'); - new_msg = new_msg.replace(/w/gi, '.--//'); - new_msg = new_msg.replace(/x/gi, '-..-//'); - new_msg = new_msg.replace(/y/gi, '-[b][/b].[b][/b]--//'); - new_msg = new_msg.replace(/z/gi, '--..////'); - return new_msg; - } else return new_msg; - }, - filter_sekrit: function(new_msg) { - if (new_msg.regexIndexOf(/\/s /i) === 0) { - new_msg = new_msg.replace(/\/s /i, ''); - try { - for (i = 0; i < new_msg.match(/\./gi).length; i++) - if (Math.random() > 0.9) - new_msg = new_msg.replace(/\./, endings[Math.irandom(0, endings.length)]); // here we use a temp . as [dot] to avoid a bug - new_msg = new_msg.replace(/\[dot\]/gi, '.'); // and here we fix the . - } catch(e) { /* there are no dots in our message */ } - for (i = 0; i < Object.keys(replacements).length; i++) new_msg = new_msg.replace(new RegExp(Object.keys(replacements)[i], "gi"), values(replacements)[i]); - return new_msg; - } else return new_msg; - }, - submit: function (a) { - if (!a) { - var b = this.get_template_item("messagebox"); - a = b.value; - b.value = ""; - b.focus() - } - if (this.event.fire("onsend", a)) { - a = a.replace(/^\s+/, ""); - a = avacweb_chat.filter_swears(a); - a = avacweb_chat.filter_emoticons(a); - a = avacweb_chat.filter_maymays(a); - a = avacweb_chat.filter_greentext(a); - a = avacweb_chat.filter_redtext(a); - a = avacweb_chat.filter_leet(a); - a = avacweb_chat.filter_balloon(a); - a = avacweb_chat.filter_braille(a); - a = avacweb_chat.filter_greek(a); - a = avacweb_chat.filter_morse(a); - a = avacweb_chat.filter_sekrit(a); - this.tabs.in_tab() && "/" !== a.charAt(0) && ((b = this.tabs.get()) && b.user_tab ? a = "/tab(" + b.name + ") " + a : b && (a = "/pm(" + b.users.join(", ") + ") " + a)); - if ("/" === a.charAt(0)) { - b = this.parse_command(a); - if (!1 === b) return; - "string" === typeof b && (a = b) - } - var c = "method=send&message=" + encodeURIComponent(a), - d = this; - this.array_walk(["bold", "italic", "underline", "strike"], function (a) { - d.settings.on(a) && (c += "&" + a + "=on") - }); - c += "&scolor=" + this.settings.value("color"); - this.simple_send(c); - return !1 - } - }, - simple_send: function (a) { - var b = this; - f.post("/chatbox/actions.forum?archives=" + this.settings.value("archives") + "&tid=" + this.tid, a, function (a) { - if (b.settings.on("archives")) return f.get("/chatbox/actions.forum?archives=1&method=get&tid=" + this.tid, function (a) { - b.handle_data.call(b, a) - }, "json"); - b.handle_data.call(b, a) - }, "json") - }, - handle_data: function (a) { - "string" === typeof a && (a = JSON.parse(a)); - a.connected !== this.logged_in && this.switch_display(a.connected); - a.users && (this.update_users(a.users), this.last_data.users = a.users); - a.connected && !this.tabs.initiated && this.tabs.init(); - a.connected && a.messages && a.messages.length !== this.last_data.messages.length && (this.update_messages(a.messages), this.last_data.messages = a.messages, this.inactive_refreshes = 0); - this.settings.on("reading") || (this.get_template_item("messages").scrollTop = this.settings.on("newest first") ? 0 : 9999999); - this.refresh_timeout && clearTimeout(this.refresh_timeout); - this.refresh_timeout = setTimeout(this.refresh, this.get_refresh_rate()) - }, - create_userbase: function (a) { - var b = this; - this.array_walk("a", a, function (a) { - var d = { - id: parseInt(a.id), - username: a.username, - staff: a.admin, - color: a.color, - online: a.online - }; - b.user_data["u" + a.id] = b.user_data[a.username] = d - }) - }, - update_users: function (a) { - var b = this, - c = 0, - d = '

' + this.t("Online") + '

"; - this.config.custom_placement || (this.get_template_item("usercount").innerHTML = c); - this.get_template_item("userlist").innerHTML = 0 < c ? d : '
' + this.t("No users online") + "
" - }, - update_messages: function (a) { - var b = this, - c = {}, - d = f(document.createElement("div")), - e = "", - t = function (a, b) { - if (b) return c[a] = 0; - a in c ? c[a]++ : c[a] = 1 - }; - this.array_walk("a", a, function (a, c) { - var h = f('
[' + a.datetime + "]
"); - if ("msg" !== a.action) switch (a.action) { - case "connect": - return e += "[" + a.datetime + "] " + a.msg + "\n", h.append(' ' + a.msg + ""), d[b.settings.on("newest first") ? "prepend" : "append"](h) - } else if (!b.settings.value("ignored")["u" + a.userId]) { - var g = f('' + a.msg + ""), - k = g[0].getElementsByTagName("table")[0], - q = "public", - l = "' + (a.user.admin ? b.t("@") : "") + " " + a.username + ": "; - a.user.avatar && (l = '' + l); - if (k && k.className && /^a_chat_(pm|cmd|tab)$/.test(k.className)) { - var q = k.className.replace("a_chat_", ""), - p = k.getElementsByTagName("td")[0].innerHTML, - m = k.getElementsByTagName("td")[1].innerHTML; - f(k).replaceWith('') - } - a.userId = parseInt(a.userId); - switch (q) { - case "pm": - if (!b.config.allow_private_messaging) return console.log("AWCError 202: Private messaging is turned off and therefore can not be displayed."); - q = b.tabs.safe_name(p).split("]-[~~SPLITTER~~]-["); - k = b.tabs.create["private"](q); - if (b.tabs.can_view(k) && b.tabs.can_view(k, a.userId) && (b.tabs.get(k.id) || b.tabs.add(k), t(k.id), b.tabs.in_tab() && b.tabs.current === k.id)) { - h.addClass("chat_private_message"); - window.LGBB && (m = LGBB.parse(m)); - f("#AWCMESSAGESWITCH", g).replaceWith(b.filter(m)).prepend('' + b.t("Private message") + ": "); - break - } - return; - case "cmd": - if ("pub" === m && (q = "public"), "me" === p) { - var r = k.getElementsByTagName("td")[2].innerHTML, - k = b.tabs.get(m), - l = !1; - if (k) { - if (p = k.name, m = "* " + a.username + " " + r + "", "public" === q) { - if (b.tabs.in_tab()) return; - g.html(m); - break - } - } else return - } else { - if ("cleartab" === p) { - if (b.get_user(a.userId).staff && (t(m, !0), b.tabs.current === m)) { - d.empty(); - f("#AWCMESSAGESWITCH", g).replaceWith("* " + b.t("Tab cleared by") + " " + a.username + ""); - l = !1; - break - } - return - } - if ("nudge" !== p && "global" === p) { - t(m); - r = k.getElementsByTagName("td")[2].innerHTML; - f("#AWCMESSAGESWITCH", g).replaceWith(b.t("Global") + ": " + b.filter(r)); - break - } - } - case "tab": - r = b.tabs.create_id(p); - k = b.tabs.get(r); - if (!k) - if (b.get_user(a.userId).staff && !avacweb_chat_config.tabs[p]) k = b.tabs.create.user(p, a.username), b.tabs.add(k); - else return; - if (b.tabs.can_view(k)) { - t(r); - if (b.tabs.current !== r) return; - "tab" === q ? (window.LGBB && (m = LGBB.parse(m)), f("#AWCMESSAGESWITCH", g).replaceWith(b.filter(m))) : g.html(b.filter(m)); - break - } - return; - case "public": - t("pub"); - if (b.tabs.in_tab()) return; - m = g.html(); - window.LGBB && (m = LGBB.parse(m)); - g.html(b.filter(m)) - } - l && (h.append(l), a.userId === b.user("id") && h.addClass("my_message")); - e += "[" + a.datetime + "] " + a.username + ": " + g.text() + "\n"; - h.append(g); - d[b.settings.on("newest first") ? "prepend" : "append"](h) - } - }); - this.plain_text = e; - this.get_template_item("messages").innerHTML = this.settings.on("plain text") ? e.replace(/[\r\n]+/g, "
") : d.html(); - d.empty(); - delete d; - this.check_tab_counts(c); - this.tabs.save() - }, - check_tab_counts: function (a) { - var b = !1, - c = 0, - d; - for (d in a) { - var e = this.tabs.get(d); - e && this.tabs.can_view(e) && (0 !== e.count && a[d] !== e.count && ((b = document.getElementById("achat_tab_" + d)) && !f(b).hasClass("selected") && f(b).addClass("new"), b = !0), c += a[d] - e.count, this.tabs.data[d].count = a[d]) - } - b && this.alert_new_messages(c) - }, - alert_new_messages: function (a) { - this.event.fire("onnew", a) && !this.settings.on("reading") && (this.settings.on("open") || this.config.custom_placement || f("#avacweb_chat_button").addClass("newmsg")) - }, - get_user: function (a) { - var b = { - id: 0, - username: "Guest", - staff: !1, - color: "none", - online: !1 - }; - return "string" === typeof a ? this.user_data[a] ? this.user_data[a] : b : this.user_data["u" + a] ? this.user_data["u" + a] : b - }, - user: function (a) { - return this.get_user(this._user.user_id)[a] - }, - array_walk: function (a, b, c) { - "string" !== typeof a && (c = b, b = a, a = "a"); - var d = { - f: "filter", - m: "map", - a: "forEach" - }[a], - e = 0, - f = [], - g = b.length; - if (d && b[d]) return b[d](c); - for (; e < g; e++) { - var d = b[e], - h = c.call(b, d, e, b); - switch (a) { - case "f": - h && f.push(d); - break; - case "m": - f.push(h) - } - } - return f - }, - in_array: function (a, b) { - return a.indexOf ? -1 !== a.indexOf(b) : 0 < this.array_walk("f", a, function (a) { - return a === b - }).length - }, - cookie: function (a, b, c) { - a = "achat_" + a; - if (1 === arguments.length) return a in sessionStorage ? sessionStorage.getItem(a) : localStorage.getItem(a); - (c ? localStorage : sessionStorage).setItem(a, b) - }, - t: function (a) { - return window.avacweb_chat_translation ? avacweb_chat_translation[a.toLowerCase()] || a : a - }, - get_template_item: function (a) { - var b = document.getElementById(this.config.template.ids[a]); - if (b) return b; - console.log('AWCError 201: No id or element found for template item "' + a + '"'); - return document.createElement("div") - }, - loading: function () { - this.get_template_item("messages").innerHTML = '
' - }, - get_refresh_rate: function () { - var a = ++this.inactive_refreshes, - b = "normal"; - switch (!0) { - case 40 < a: - b = "in40"; - break; - case 30 < a: - b = "in30"; - break; - case 20 < a: - b = "in20"; - break; - case 10 < a: - b = "in10" - } - this.logged_in || (b = "in20"); - this.settings.on("disable timeout") && (b = "in10"); - return this.refresh_rates[b] - }, - ignore: function (a, b) { - var c = this.settings.value("ignored"); - a = this.get_user(a); - if (!a.id) return this.popup(ac.t("User not found")); - if (a.staff) return this.popup(ac.t("Staff can not be ignored")); - b ? delete c["u" + a.id] : c["u" + a.id] = 1; - this.settings.value("ignored", c); - this.update_messages(this.last_data.messages) - }, - popup: function (a, b) { - if ("update" === a) { - var c = window.AWC_update; - this.cookie("update", c.id, 1); - a = c.text - } - c = document.getElementById("achat_popup"); - c.className = b && a ? "error" : ""; - c.lastChild.innerHTML = a || ""; - this.showhide("achat_popup") - }, - showhide: function (a) { - var b = document.getElementById(a); - this.current_popup && a !== this.current_popup && (document.getElementById(this.current_popup).style.display = "none"); - if ("" === b.innerHTML && "achat_smilies" === a) { - var c = function () { - b.innerHTML = b.innerHTML.replace(/href="javascript:insert_chatboxsmilie/g, 'onclick="return avacweb_chat.insert_text'); - f("form select", b).removeAttr("onchange").change(function (a) { - d("/smilies.forum?categ=" + this.value + "&mode=smilies_frame") - }) - }, - d = function (a) { - b.innerHTML = ''; - f(b).load(a + " #simple-wrap", c) - }; - d("/smilies.forum?mode=smilies_frame") - } - if ("" === b.innerHTML && "achat_colors" === a) { - for (var e = "0369BDF".split(""), g = '', - h = e.length, l = 0; l < h; l++) { - for (var g = g + "", n = 0; n < h; n++) - for (var u = 0; u < h; u++) var k = "#" + e[l] + e[l] + e[n] + e[n] + e[u] + e[u], - g = g + ('"); - g += "" - } - b.innerHTML = g + "
" - } - "none" === b.style.display ? (b.style.display = "", this.current_popup = a) : (b.style.display = "none", this.current_popup = null) - }, - insert_text: function (a) { - var b = this.get_template_item("messagebox"); - b.value += a; - b.focus(); - return !1 - }, - insert_pm: function (a) { - var b = this.get_template_item("messagebox"), - c = b.value; - 0 === c.indexOf("/pm(") ? b.value = "/pm(" + a + "," + c.substr(4) : b.value = "/pm(" + a + ") " + c; - b.focus(); - return !1 - }, - capitalize: function (a) { - return a.charAt(0).toUpperCase() + a.substr(1) - }, - filter: function (a) { - for (var b in this.config.filters) a = a.replace(RegExp(b, "gi"), this.config.filters[b]); - return a - }, - resize: { - dimensions: {}, - init: function (a, b) { - var c = avacweb_chat.resize, - d = document.getElementById("avacweb_chat"); - c.startX = a.pageX; - c.startY = a.pageY; - c.startW = d.offsetWidth; - c.startH = d.offsetHeight; - c.windowW = f(window).width(); - c.windowH = f(window).height(); - c.startB = c.windowH - (d.offsetTop + c.startH); - f("body, html").mousemove(c[b]).mouseup(function () { - f("body, html").off("mousemove").off("mouseup"); - avacweb_chat.cookie("dimensions", JSON.stringify(avacweb_chat.resize.dimensions)) - }) - }, - drag: function (a) { - var b = document.getElementById("avacweb_chat"), - c = avacweb_chat.resize; - c.dimensions.width = b.style.width = c.startW + (c.startX - a.pageX) + "px"; - c.dimensions.height = b.style.height = c.startH + (c.startY - a.pageY) + "px" - }, - move: function (a) { - var b = document.getElementById("avacweb_chat"), - c = avacweb_chat.resize; - c.dimensions.right = b.style.right = c.windowW - a.pageX - c.startW + "px"; - c.dimensions.bottom = b.style.bottom = c.startB - (a.pageY - c.startY) + "px" - } - }, - settings: { - initiated: !1, - data: {}, - add: function (a, b, c) { - if ("object" === typeof a) { - for (var d in a) this.add(d, a[d], b); - return this - } - this.data[a] ? (this.data[a].save = c ? !0 : !1, this.data[a].value = b) : (b = "boolean" === typeof b ? b ? 1 : 0 : b, this.data[a] = { - value: b, - special: "number" !== typeof b ? !0 : !1, - save: c ? !0 : !1, - UI_added: !1 - }); - return this - }, - add_ui: function (a) { - this.initiated || this.init(); - if (1 < arguments.length) return avacweb_chat.array_walk(arguments, function (a) { - avacweb_chat.settings.add_ui(a) - }); - if (this.data[a] && (!this.data[a] || !this.data[a].special && !this.data[a].UI_added)) { - var b = avacweb_chat, - b = '
' + b.t(b.capitalize(a)) + "", - b = b + ('
"); - f(document.getElementById("achat_user_prefs")).append(b); - this.data[a].UI_added = !0 - } - }, - remove: function (a) { - if (this.data[a]) { - if (this.data[a].UI_added) { - var b = document.getElementById("ac_" + a.replace(/\s/g, "_") + "_checkbox"); - b && b.parentNode.parentNode.removeChild(b.parentNode) - } - delete this.data[a]; - this.save() - } - }, - value: function (a, b) { - 2 === arguments.length && this.data[a] && (this.data[a].value = b, this.data[a].UI_added && (document.getElementById("ac_" + a.replace(" ", "_") + "_checkbox").checked = !!b), avacweb_chat.event.fire("onsettingchange", a), this.save()); - return this.data[a] ? this.data[a].value : null - }, - on: function (a) { - return !(!this.data[a] || !this.data[a].value) - }, - toggle: function (a) { - return this.value(a, this.on(a) ? 0 : 1) - }, - save: function () { - var a = {}, - b, c; - for (b in this.data) c = this.data[b], c.save && (a[b] = c.value); - avacweb_chat.cookie("user_prefs", JSON.stringify(a), 1) - }, - init: function () { - if (!this.initiated) { - var a = avacweb_chat, - b = a.cookie("user_prefs"); - b && !a.mobile && this.add(JSON.parse(b), !0); - this.initiated = !0 - } - } - } - }; - l = function () { - return !0 - }; - g.commands = { - away: !1, - abs: !1, - exit: !1, - banlist: { - description: "/banlist - View a list of banned users. Chatbox moderators only.", - staff: !0, - run: function () { - return !1 - } - }, - cls: { - description: "/cls - clear the chatbox. Chatbox moderators only.", - run: l, - staff: !0 - }, - clear: { - description: "/clear - clear the chatbox. Chatbox moderators only.", - run: l, - staff: !0 - }, - ban: { - description: "/ban username - Ban a user in the chatbox. Chatbox moderators only.", - run: l, - staff: !0 - }, - unban: { - description: "/unban username - Unban a user in the chatbox. Chatbox moderators only.", - run: l, - staff: !0 - }, - mod: { - description: "/mod username - Give a user moderator privileges in the chatbox. Admin only", - run: l, - staff: !0 - }, - unmod: { - description: "/unmod username - Remove a users moderator privileges in the chatbox. Admin only", - run: l, - staff: !0 - }, - kick: { - description: "/kick username - Disconnect a member from the Chatbox. Moderators only.", - run: l, - staff: !0 - }, - logs: { - description: "/logs - Open up the log management page for your chat to manage your saved chat logs.", - staff: !0, - run: function () { - window.open("", "awc-logs").document.write('