(function (a) { a.arrowchat = function () { var $body = a('body'); var $base; var $maintenance; var $show_bar_button; var $popout_chat_button; var $optionsbutton; var $optionsbutton_popup; var $modbutton; var $modbutton_popup; var $chatrooms_button; var $buddy_list_tab; var $userstab_popup; var $tooltip = null; var $tooltip_content; var $chatroom_chat; var $chatroom_room_list; var $chatrooms_popup; var $chatroom_tab = {}; var $chatroom_create; var $chatroom_create_flyout; var $application_buttons = {}; var $application_button_popups = {}; var $applications_button; var $applications_button_popup; var $applications_button_popups; var $users = []; var $user_popups = []; var $chatboxes; var $chatboxes_wide; var $chatbox_left; var $unseen_users; var $chatroom_admin_controls = ""; function addHover($elements, classes) { $elements.each( function (i, element) { a(element).hover( function () { a(this).addClass(classes); }, function () { a(this).removeClass(classes); } ); }); } function preventScrolling($target) { $target.bind('mousewheel DOMMouseScroll', function (e) { var e0 = e.originalEvent, delta = e0.wheelDelta || -e0.deltaY || -e0.detail; this.scrollTop += ( delta < 0 ? 1 : -1 ) * 30; e.preventDefault(); }); } function showLoading($element) { a('.arrowchat_hide_loading', $element).hide(); a('.arrowchat_show_loading', $element).show(); } function hideLoading($element) { a('.arrowchat_hide_loading', $element).show(); a('.arrowchat_show_loading', $element).hide(); } function closePopup($popup, $button, hidden) { if ($popup !== undefined) { if (hidden == 1) { $popup.addClass("arrowchat_tabopen_hidden"); } else{ $popup.removeClass("arrowchat_tabopen"); } } if ($button !== undefined) { $button.removeClass("arrowchat_tabclick arrowchat_userstabclick arrowchat_trayclick arrowchat_usertabclick"); } } function hideTooltip() { if ($tooltip) { $tooltip.hide(); } } function showTooltip($target, text, is_left, custom_left, custom_top, is_sideways, is_sideways_right) { if ($tooltip === null) { $tooltip = a('
').appendTo($body); $tooltip_content = a('.arrowchat_tooltip_content', $tooltip); } $tooltip_content.html(text); var target_offset = $target.offset(); var target_width = $target.width(); var target_height = $target.height(); var tooltip_width = $tooltip.width(); if (!custom_left) { custom_left = 0; } if (!custom_top) { custom_top = 0; } if (is_left) { $tooltip.css({ top : target_offset.top - a(window).scrollTop() - target_height - 5 - custom_top, left : target_offset.left + target_width - 16 - custom_left, display : "block", 'padding-right' : "0px", 'padding-left' : "0px" }).addClass("arrowchat_tooltip_left"); } else if (is_sideways_right) { $tooltip.css({ top : target_offset.top - a(window).scrollTop() + (target_height/2) - 10 - custom_top, left : target_offset.left + target_width + 28 - custom_left, display : "block", 'background-position' : "-113px -58px", 'padding-right' : "0px", 'padding-left' : "6px" }).removeClass("arrowchat_tooltip_left"); } else if (is_sideways) { $tooltip.css({ top : target_offset.top - a(window).scrollTop() + (target_height/2) - 10 - custom_top, left : target_offset.left + target_width - tooltip_width + 18 - custom_left, display : "block", 'background-position' : tooltip_width - 128 + "px -58px", 'padding-right' : "6px", 'padding-left' : "0px" }).removeClass("arrowchat_tooltip_left"); } else { $tooltip.css({ top : target_offset.top - a(window).scrollTop() - target_height - 5 - custom_top, left : target_offset.left + target_width - tooltip_width + 18 - custom_left, display : "block", 'background-position' : tooltip_width - 23 + "px -114px", 'padding-right' : "0px", 'padding-left' : "0px" }).removeClass("arrowchat_tooltip_left"); } if (W) { $tooltip.css("position", "absolute"); $tooltip.css( "top", parseInt(a(window).height()) - parseInt($tooltip.css("bottom")) - parseInt($tooltip.height()) + a(window).scrollTop() + "px" ); } } function replaceURLWithHTMLLinks(text) { return anchorme.js(text); } RegExp.escape = function(text) { return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); }; function youTubeEmbed(mess) { var regExp = /^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=)?([^\s]+)$/mi; var match = mess.match(regExp); if (match && match[1].length == 11) { mess = '' + match[0] + '
'; } return mess; } function smileyreplace(mess) { if (c_disable_smilies != 1) { mess = mess.replace(/^(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*$/g, function(match, contents, offset, s) { return '' + match + ''; } ); for (var i = 0; i < premade_smiley.length; i++) { var smiley_test = premade_smiley[i][0].replace(//g, ">"); var check_emoticon = mess.lastIndexOf(smiley_test); if (check_emoticon != -1) { if (mess == smiley_test) { mess = mess.replace( new RegExp(RegExp.escape(smiley_test), 'g'), premade_smiley[i][1] ); } else { mess = mess.replace( new RegExp(RegExp.escape(" " + smiley_test), 'g'), ' ' + premade_smiley[i][1] ); } } } } return mess; } function chatroomKeydown(key, $element) { if (key.keyCode == 13 && key.shiftKey == 0) { var i = $element.val(); i = i.replace(/^\s+|\s+$/g, ""); $element.val(""); $element.css("height", "18px"); $element.css("overflow-y", "hidden"); $element.focus(); if (c_send_room_msg == 1 && i != "") { displayMessage("arrowchat_chatroom_message_flyout", lang[209], "error"); } else { i != "" && a.ajax({ url: c_ac_path + "includes/json/send/send_message_chatroom.php", type: "post", cache: false, dataType: "json", data: { userid: u_id, username: u_name, chatroomid: Ccr, message: i }, beforeSend: function () { a(".arrowchat_chatroom_message_input").addClass("arrowchat_message_sending"); }, error: function () { a(".arrowchat_chatroom_message_input").removeClass("arrowchat_message_sending"); displayMessage("arrowchat_chatroom_message_flyout", lang[135], "error"); }, success: function (o) { a(".arrowchat_chatroom_message_input").removeClass("arrowchat_message_sending"); if (o) { var is_json = true; if (a.isNumeric(o)) is_json = false; var no_error = true; if (is_json) { o && a.each(o, function (i, e) { if (i == "error") { a.each(e, function (l, f) { no_error = false; displayMessage("arrowchat_chatroom_message_flyout", f.m, "error"); }); } }); } if (no_error) { addMessageToChatroom(o, u_name, i); var data_array = [o, u_name, i, Ccr]; lsClick(JSON.stringify(data_array), 'send_chatroom_message'); $chatroom_chat.scrollTop($chatroom_chat[0].scrollHeight) } } } }); } return false } } function userchatKeydown(key, $element, typing, jabber) { if (jabber != 1) { clearTimeout(pa); pa = setTimeout(function () { a.post(c_ac_path + "includes/json/send/send_typing.php", { userid: u_id, typing: typing, untype: 1 }, function () {}); fa = -1 }, 5E3); if (fa != typing) { a.post(c_ac_path + "includes/json/send/send_typing.php", { userid: u_id, typing: typing }, function () {}); fa = typing } } if (key.keyCode == 13 && key.shiftKey == 0) { var i = $element.val(); i = i.replace(/^\s+|\s+$/g, ""); $element.val("").css({ height: '18px', 'overflow-y': 'hidden' }).focus(); if (c_send_priv_msg == 1 && i != "") { displayMessage("arrowchat_chatbox_message_flyout_" + typing, lang[209], "error"); } else { i != "" && a.ajax({ url: c_ac_path + "includes/json/send/send_message.php", type: "post", cache: false, dataType: "json", data: { userid: u_id, to: typing, message: i }, beforeSend: function () { a(".arrowchat_textarea").addClass("arrowchat_message_sending"); }, error: function () { a(".arrowchat_textarea").removeClass("arrowchat_message_sending"); displayMessage("arrowchat_chatbox_message_flyout_" + typing, lang[135], "error"); }, success: function (e) { a(".arrowchat_textarea").removeClass("arrowchat_message_sending"); if (e) { if (e == "-1") { displayMessage("arrowchat_chatbox_message_flyout_" + typing, lang[102], "error"); } else { clearTimeout(pa); fa = -1; var time = Math.floor((new Date).getTime() / 1E3); addMessageToChatbox(typing, i, "1", "1", e, 1, time); var data_array = [e, typing, i, time, 1, 1]; lsClick(JSON.stringify(data_array), 'private_message'); } } K = 1; } }); } return false; } } function resizeChatfield($element) { var height = $element[0].clientHeight; if (height < 94) { height = Math.max($element[0].scrollHeight, height); height = Math.min(94, height); if (height > $element[0].clientHeight) { $element.css("height", height + 3 + "px") } } else { $element.css("overflow-y", "auto"); } } function chatroomKeyup(b, $element) { resizeChatfield($element); $chatroom_chat.scrollTop($chatroom_chat[0].scrollHeight) } function userchatKeyup(key, $element, d) { if (a(".arrowchat_smiley_popout", $user_popups[d]).children(".arrowchat_more_popout").is(":visible")) { a(".arrowchat_smiley_popout", $user_popups[d]).children(".arrowchat_more_popout").hide(); } resizeChatfield($element); a(".arrowchat_tabcontenttext", $user_popups[d]).scrollTop(a(".arrowchat_tabcontenttext", $user_popups[d])[0].scrollHeight) } function clearUserStatus() { a("#arrowchat_userstab_icon").removeClass("arrowchat_user_available2 arrowchat_user_busy2 arrowchat_user_invisible2 arrowchat_user_away2"); } function setUserStatus(status) { a("#arrowchat_userstab_icon").removeClass("arrowchat_user_available2 arrowchat_user_busy2 arrowchat_user_invisible2"); a.post(c_ac_path + "includes/json/send/send_status.php", { userid: u_id, status: status }, function () {}) } function showUserOffline() { w = 1; clearUserStatus(); a("#arrowchat_userstab_icon").addClass("arrowchat_user_invisible2"); setUserStatus("offline"); closePopup($userstab_popup, $buddy_list_tab); closePopup($optionsbutton_popup, $optionsbutton); closePopup($modbutton_popup, $modbutton); if (a('#arrowchat_chatbox_left').hasClass('arrowchat_unseen_list_open')) a('#arrowchat_chatbox_left').click(); a("#arrowchat_userstab_text").html(lang[7]) } function buildMaintenance() { $maintenance = a(ArrowChat.Templates.maintenance_tab(c_login_url)).appendTo($base); $maintenance.mouseover(function () { if (c_db_connection == "1") { showTooltip($maintenance, "We couldn't connect to the database. Please try again later."); } else if (c_guests_login_msg == "1" && u_id == "") { showTooltip($maintenance, lang[58]); } else { showTooltip($maintenance, lang[27]); } a(this).addClass("arrowchat_tabmouseover") }); $maintenance.mouseout(function () { a(this).removeClass("arrowchat_tabmouseover"); hideTooltip(); }); } function buildHideBarButton() { $hide_bar_button = a(ArrowChat.Templates.bar_hide_tab()).appendTo($base); $hide_bar_button.mouseover(function () { showTooltip($hide_bar_button, lang[14]); a(this).addClass("arrowchat_tabmouseover") }); $hide_bar_button.mouseout(function () { a(this).removeClass("arrowchat_tabmouseover"); hideTooltip(); }); $hide_bar_button.click(function () { lsClick("#arrowchat_hide_bar_button", 'ac_click'); a.post(c_ac_path + "includes/json/send/send_settings.php", { hide: "1" }); showUserOffline(); closePopup($chatrooms_popup, $chatrooms_button); closePopup($applications_button_popup, $applications_button); if (m != "") { closePopup($application_button_popups[m], $application_buttons[m]); m = ""; } if (j != "") { closePopup($user_popups[j], $users[j]); a(".arrowchat_closebox_bottom", $users[j]).removeClass("arrowchat_closebox_bottom_click"); j = ""; } clearTimeout(Z); clearTimeout(Crref2); a.idleTimer("destroy"); pushCancelAll(); cancelJSONP(); $base.hide(); $show_bar_button.show() }) } function buildShowBarButton() { $show_bar_button = a(ArrowChat.Templates.bar_show_tab()).appendTo($body); $show_bar_button.mouseover(function () { showTooltip($show_bar_button, lang[15]); a(this).addClass("arrowchat_tabmouseover") }); $show_bar_button.mouseout(function () { a(this).removeClass("arrowchat_tabmouseover"); hideTooltip(); }); $show_bar_button.click(function () { showBar(); }) } function showBar() { lsClick("#arrowchat_show_bar_button", 'ac_click'); a.post(c_ac_path + "includes/json/send/send_settings.php", { hide: "-1" }); setUserStatus("available"); a("#arrowchat_userstab_icon").addClass("arrowchat_user_available2"); w = 0; loadBuddyList(); pushSubscribe(); receiveCore(); a.idleTimer(60000 * ArrowChat.IdleTime); $show_bar_button.hide(); $base.show(); } function startCreateChatRoom() { var i = a("#arrowchat_chatroom_create_input").val(); var passinput = a("#arrowchat_chatroom_create_password_input").val(); var descinput = a("#arrowchat_chatroom_create_desc_input").val(); var welcomeinput = a("#arrowchat_chatroom_create_welcome_input").val(); a(".arrowchat_chatroom_full_content").removeClass("arrowchat_chatroom_opacity"); a("#arrowchat_chatroom_create_input").val(""); a("#arrowchat_chatroom_create_password_input").val(""); a("#arrowchat_chatroom_create_desc_input").val(""); a("#arrowchat_chatroom_create_welcome_input").val(""); i = i.replace(/^\s+|\s+$/g, ""); i != "" && a.post(c_ac_path + "includes/json/send/send_chatroom_create.php", { userid: u_id, name: i, password: passinput, description: descinput, welcome: welcomeinput }, function (e) { if (e) { $chatroom_create_flyout.hide("slide", { direction: "up"}, 250); a("#arrowchat_chatroom_options_flyout").removeClass("arrowchat_chatroom_options_flyout_display"); if (e == "-1") { displayMessage("arrowchat_chatroom_message_flyout", lang[39], "error"); } else if (e == "-2") { displayMessage("arrowchat_chatroom_message_flyout", lang[40], "error"); } else { chatroomreceived = 0; loadChatroomList(); } } }); } function buildChatroomsButton() { $chatrooms_button = a(ArrowChat.Templates.chatrooms_tab()).appendTo($base); $chatrooms_popup = a(ArrowChat.Templates.chatrooms_window()).css("display", "none").appendTo($body); $chatroom_create = a("#arrowchat_chatroom_create"); $chatroom_create_flyout = a("#arrowchat_chatroom_create_flyout"); $chatrooms_button.css("width", c_width_chatroom + "px"); addHover(a("#arrowchat_chatroom_add_tab"), "arrowchat_add_tab_hover"); a("#arrowchat_chatroom_add_tab").mouseover(function () { showTooltip(a("#arrowchat_chatroom_add_tab"), lang[217], 0, -2, 14, 0, 0); }); a("#arrowchat_chatroom_add_tab").mouseout(function () { hideTooltip(); }); a("#arrowchat_chatroom_add_tab").click(function () { lsClick("#arrowchat_chatroom_add_tab", 'ac_click'); hideTooltip(); if (Object.keys($chatroom_tab).length <= 2) { a("#arrowchat_chatroom_open_chats").hide(); a(".arrowchat_chatroom_tab").removeClass("arrowchat_chatroom_tab_focused"); a("#arrowchat_chatroom_leave").click(); } else { displayMessage("arrowchat_chatroom_message_flyout", lang[218], "error"); } }); a("#arrowchat_chatroom_create_input").placeholder(); a("#arrowchat_chatroom_create_password_input").placeholder(); if (c_width_chatroom <= 25) { a("#arrowchat_chatrooms_text", $chatrooms_button).hide(); } if (u_chatroom_block_chats == 1) { a("#arrowchat_chatroom_block :input").prop("checked", true) } else { a("#arrowchat_chatroom_block").addClass("arrowchat_menu_unchecked"); a("#arrowchat_chatroom_block :input").prop("checked", false) } if (u_chatroom_sound == 1) { a("#arrowchat_chatroom_sound :input").prop("checked", true) } else { a("#arrowchat_chatroom_sound").addClass("arrowchat_menu_unchecked"); a("#arrowchat_chatroom_sound :input").prop("checked", false) } if (u_chatroom_show_names == 1) { a("#arrowchat_chatroom_show_names :input").prop("checked", true) } else { a("#arrowchat_chatroom_show_names").addClass("arrowchat_menu_unchecked"); a("#arrowchat_chatroom_show_names :input").prop("checked", false) } if (u_chatroom_stay != "-1") { a("#arrowchat_chatroom_stay :input").prop("checked", true) } else { a("#arrowchat_chatroom_stay").addClass("arrowchat_menu_unchecked"); a("#arrowchat_chatroom_stay :input").prop("checked", false) } if (u_chatroom_open != "-1") { a("#arrowchat_chatroom_window :input").prop("checked", true) } else { a("#arrowchat_chatroom_window").addClass("arrowchat_menu_unchecked"); a("#arrowchat_chatroom_window :input").prop("checked", false) } if (c_user_chatrooms == "0") { $chatroom_create.hide(); } $chatrooms_button.click(function () { lsClick("#arrowchat_chatrooms_button", 'ac_openclose'); count = 0; if (c_width_chatroom <= 25) { hideTooltip(); } if (a(".arrowchat_tabalert", $chatrooms_button).length > 0) { a(".arrowchat_tabalert", $chatrooms_button).remove(); $chatrooms_button.removeClass("arrowchat_tab_new_message") } loadChatroomList(); closePopup($userstab_popup, $buddy_list_tab); closePopup($optionsbutton_popup, $optionsbutton); closePopup($modbutton_popup, $modbutton); $chatrooms_popup.css("left", $chatrooms_button.offset().left - $chatrooms_popup.outerWidth() + $chatrooms_button.outerWidth()).css("bottom", "25px"); a(this).toggleClass("arrowchat_tabclick").toggleClass("arrowchat_userstabclick"); $chatrooms_popup.toggleClass("arrowchat_tabopen"); if ($chatroom_chat !== undefined) { $chatroom_chat.scrollTop(5E4); } a(".arrowchat_chatroom_message_input").focus(); }); $chatrooms_button.mouseover(function () { if (c_width_chatroom <= 25) { if ($chatrooms_button.hasClass("arrowchat_tabclick")) {} else { showTooltip($chatrooms_button, lang[19]); } } a(this).addClass("arrowchat_tabmouseover") }); $chatrooms_button.mouseout(function () { a(this).removeClass("arrowchat_tabmouseover"); hideTooltip(); }); preventScrolling(a(".arrowchat_chatroom_content")); if (a.cookie('arrowchat_no_userlist') == 1) { a(".arrowchat_chatroom_full_content").addClass("arrowchat_no_userlist"); } a("#arrowchat_chatroom_userlist_button").click(function() { if (a(".arrowchat_chatroom_full_content").hasClass("arrowchat_no_userlist")) { a.cookie('arrowchat_no_userlist', 0, {expires: 365, path: '/'}); a(".arrowchat_chatroom_full_content").removeClass("arrowchat_no_userlist"); } else { a.cookie('arrowchat_no_userlist', 1, {expires: 365, path: '/'}); a(".arrowchat_chatroom_full_content").addClass("arrowchat_no_userlist"); } a(".arrowchat_chatroom_message_input").focus(); }); a("#arrowchat_chatroom_password_input").keydown(function (h) { if (h.keyCode == 13) { c = a("#arrowchat_chatroom_password_id").val(); a("#arrowchat_chatroom_password_flyout").hide(); input_value = a("#arrowchat_chatroom_password_input").val(); a("#arrowchat_chatroom_password_input").val(""); input_value = input_value.replace(/^\s+|\s+$/g, ""); a(".arrowchat_chatroom_full_content").html('
' + lang[34] + "
"); $chatroom_create.hide(); Ccr = c; loadChatroom(c, crt[c], input_value) } }); a(".arrowchat_chatroom_create_options").click(function () { a(".arrowchat_chatroom_create_options_wrapper").show(); a(".arrowchat_chatroom_create_input").prop('disabled', false); }); a("#arrowchat_password_cancel_button").click(function () { a(".arrowchat_chatroom_full_content").removeClass("arrowchat_chatroom_opacity"); a(".arrowchat_chatroom_list").removeClass("arrowchat_chatroom_clicked"); a("#arrowchat_chatroom_password_flyout").hide("slide", { direction: "up"}, 250); }); a("#arrowchat_create_cancel_button").click(function () { $chatroom_create_flyout.hide("slide", { direction: "up"}, 250); a(".arrowchat_chatroom_full_content").removeClass("arrowchat_chatroom_opacity"); }); a("#arrowchat_password_button").click(function () { c = a("#arrowchat_chatroom_password_id").val(); a("#arrowchat_chatroom_password_flyout").hide(); input_value = a("#arrowchat_chatroom_password_input").val(); a("#arrowchat_chatroom_password_input").val(""); input_value = input_value.replace(/^\s+|\s+$/g, ""); a(".arrowchat_chatroom_full_content").html('
' + lang[34] + "
"); $chatroom_create.hide(); Ccr = c; loadChatroom(c, crt[c], input_value) }); a("#arrowchat_chatroom_stay").click(function () { a(this).toggleClass("arrowchat_menu_unchecked"); if (a("#arrowchat_chatroom_stay :input").is(":checked")) { a("#arrowchat_chatroom_stay :input").prop("checked", false); _chatroomstay = -1; } else { a("#arrowchat_chatroom_stay :input").prop("checked", true); u_chatroom_stay = Ccr; _chatroomstay = Ccr; } if (a("#arrowchat_chatroom_window :input").is(":checked")) { a("#arrowchat_chatroom_window").toggleClass("arrowchat_menu_unchecked"); a("#arrowchat_chatroom_window :input").prop("checked", false); } a.post(c_ac_path + "includes/json/send/send_settings.php", { chatroom_stay: _chatroomstay }, function () { }); }); a("#arrowchat_chatroom_window").click(function () { a(this).toggleClass("arrowchat_menu_unchecked"); if (a("#arrowchat_chatroom_window :input").is(":checked")) { a("#arrowchat_chatroom_window :input").prop("checked", false); _chatroomwindow = -1; } else { a("#arrowchat_chatroom_window :input").prop("checked", true); u_chatroom_open = Ccr; _chatroomwindow = Ccr; } if (a("#arrowchat_chatroom_stay :input").is(":checked")) { a("#arrowchat_chatroom_stay").toggleClass("arrowchat_menu_unchecked"); a("#arrowchat_chatroom_stay :input").prop("checked", false); } a.post(c_ac_path + "includes/json/send/send_settings.php", { chatroom_window: _chatroomwindow }, function () { }) }); a("#arrowchat_chatroom_block").click(function () { lsClick("#arrowchat_chatroom_block", 'ac_click'); a(this).toggleClass("arrowchat_menu_unchecked"); if (a("#arrowchat_chatroom_block :input").is(":checked")) { a("#arrowchat_chatroom_block :input").prop("checked", false); _chatroomblock = -1; } else { a("#arrowchat_chatroom_block :input").prop("checked", true); _chatroomblock = 1; } a.post(c_ac_path + "includes/json/send/send_settings.php", { chatroom_block_chats: _chatroomblock }, function () { }) }); a("#arrowchat_chatroom_sound").click(function () { lsClick("#arrowchat_chatroom_sound", 'ac_click'); a(this).toggleClass("arrowchat_menu_unchecked"); if (a("#arrowchat_chatroom_sound :input").is(":checked")) { a("#arrowchat_chatroom_sound :input").prop("checked", false); _chatroomsound = -1; u_chatroom_sound = 0; } else { a("#arrowchat_chatroom_sound :input").prop("checked", true); _chatroomsound = 1; u_chatroom_sound = 1; } a.post(c_ac_path + "includes/json/send/send_settings.php", { chatroom_sound: _chatroomsound }, function () { }) }); a("#arrowchat_chatroom_show_names").click(function () { lsClick("#arrowchat_chatroom_show_names", 'ac_click'); a(this).toggleClass("arrowchat_menu_unchecked"); if (a("#arrowchat_chatroom_show_names :input").is(":checked")) { a("#arrowchat_chatroom_show_names :input").prop("checked", false); _chatroomshownames = -1; u_chatroom_show_names = 0; a(".arrowchat_chatroom_message_name").hide(); a(".arrowchat_chatroom_message_avatar").addClass("arrowchat_no_names"); $chatroom_chat.scrollTop(5E4); } else { a("#arrowchat_chatroom_show_names :input").prop("checked", true); _chatroomshownames = 1; u_chatroom_show_names = 1; a(".arrowchat_chatroom_message_name").show(); a(".arrowchat_chatroom_message_avatar").removeClass("arrowchat_no_names"); $chatroom_chat.scrollTop(5E4); } a.post(c_ac_path + "includes/json/send/send_settings.php", { chatroom_show_names: _chatroomshownames }, function () { }) }); a(".arrowchat_chatrooms_title", $chatrooms_popup).click(function () { $chatrooms_button.click() }).children().not(".arrowchat_tab_name").click(function () { return false; }); a(".arrowchat_chatrooms_title", $chatrooms_popup).mouseenter(function () { a(this).addClass("arrowchat_chatboxtabtitlemouseover3") }); a(".arrowchat_chatrooms_title", $chatrooms_popup).mouseleave(function () { a(this).removeClass("arrowchat_chatboxtabtitlemouseover3") }); a("#arrowchat_chatroom_create_input").keydown(function (h) { if (h.keyCode == 13) { startCreateChatRoom(); } }); a("#arrowchat_create_button").click(function () { startCreateChatRoom(); }); a("#arrowchat_chatroom_leave").click(function () { lsClick("#arrowchat_chatroom_leave", 'ac_click'); if (a.isEmptyObject($chatroom_tab)) { clearTimeout(Crref2); } if (a(".arrowchat_smiley_box", $chatrooms_popup).is(":visible")) { a(".arrowchat_smiley_box", $chatrooms_popup).hide("slide", { direction: "up"}, 250, function() {}); } if (a("#arrowchat_chatroom_options_flyout", $chatrooms_popup).is(":visible")) a(".arrowchat_chatroom_item2").click(); if ($chatroom_admin_controls.length) $chatroom_admin_controls.remove(); a(".arrowchat_chatrooms_title .arrowchat_tab_name").html(lang[19]); a(".arrowchat_chatroom_full_content").html('
' + lang[34] + "
"); a("#arrowchat_chatroom_leave").hide(); a(".arrowchat_chatroom_popout").hide(); if (c_user_chatrooms == "1") { $chatroom_create.show(); } chatroom_popout = ""; chatroomreceived = 0; u_chatroom_stay = Ccr; loadChatroomList(); var retain_ccr = Ccr; Ccr = 0; if (c_push_engine != 1) { cancelJSONP(); receiveCore(); } }); a(".arrowchat_chatroom_leave").mouseenter(function () { showTooltip(a(this), lang[92], 0, 10, 5); a(this).addClass("arrowchat_chatroom_leave_hover"); a("#arrowchat_chatrooms_popup .arrowchat_chatrooms_title").removeClass("arrowchat_chatboxtabtitlemouseover3") }); a(".arrowchat_chatroom_leave").mouseleave(function () { a(this).removeClass("arrowchat_chatroom_leave_hover"); a("#arrowchat_chatrooms_popup .arrowchat_chatrooms_title").addClass("arrowchat_chatboxtabtitlemouseover3"); hideTooltip(); }); function i() { a("#arrowchat_chatroom_options_flyout").removeClass("arrowchat_chatroom_options_flyout_display"); } a(".arrowchat_chatroom_item").click(function () { i(); if (a(".arrowchat_chatroom_item2").hasClass("arrowchat_more_button_selected")) { a(".arrowchat_chatroom_item2").toggleClass("arrowchat_more_button_selected"); } if (!$chatroom_create_flyout.is(":visible")) { $chatroom_create_flyout.show("slide", { direction: "up"}, 250, function() { a("#arrowchat_chatroom_create_input").focus(); }); a(".arrowchat_chatroom_full_content").addClass("arrowchat_chatroom_opacity"); } else { $chatroom_create_flyout.hide("slide", { direction: "up"}, 250); a(".arrowchat_chatroom_full_content").removeClass("arrowchat_chatroom_opacity"); } if (a("#arrowchat_chatroom_password_flyout").is(":visible")) { a(".arrowchat_chatroom_list").removeClass("arrowchat_chatroom_clicked"); a("#arrowchat_chatroom_password_flyout").hide("slide", { direction: "up"}, 250); } }); a(".arrowchat_chatroom_item").mouseenter(function () { showTooltip(a(this), lang[93], 0, 10, 5); a(this).parent().addClass("arrowchat_chatroom_create_hover"); a("#arrowchat_chatrooms_popup .arrowchat_chatrooms_title").removeClass("arrowchat_chatboxtabtitlemouseover3") }); a(".arrowchat_chatroom_item").mouseleave(function () { hideTooltip(); a(this).parent().removeClass("arrowchat_chatroom_create_hover"); a("#arrowchat_chatrooms_popup .arrowchat_chatrooms_title").addClass("arrowchat_chatboxtabtitlemouseover3") }); a(".arrowchat_chatroom_item2").click(function () { a("#arrowchat_chatroom_options_flyout").children(".arrowchat_inner_menu").show(); a(".arrowchat_flood_menu").hide(); hideTooltip(); if ($chatroom_create_flyout.is(":visible")) { $chatroom_create_flyout.hide("slide", { direction: "up"}, 250); } if (a("#arrowchat_chatroom_password_flyout").is(":visible")) { a("#arrowchat_chatroom_password_flyout").hide("slide", { direction: "up"}, 250); a(".arrowchat_chatroom_list").removeClass("arrowchat_chatroom_clicked"); } a(".arrowchat_chatroom_full_content").removeClass("arrowchat_chatroom_opacity"); a("#arrowchat_chatroom_options_flyout").toggleClass("arrowchat_chatroom_options_flyout_display"); a(this).addClass("arrowchat_more_button_hover"); a(this).toggleClass("arrowchat_more_button_selected"); }); a(".arrowchat_chatroom_item2").mouseenter(function () { showTooltip(a(this), lang[23], 0, 10, 5); a(this).parent().addClass("arrowchat_more_button_hover"); a("#arrowchat_chatrooms_popup .arrowchat_chatrooms_title").removeClass("arrowchat_chatboxtabtitlemouseover3") }); a(".arrowchat_chatroom_item2").mouseleave(function () { hideTooltip(); a(this).parent().removeClass("arrowchat_more_button_hover"); a("#arrowchat_chatrooms_popup .arrowchat_chatrooms_title").addClass("arrowchat_chatboxtabtitlemouseover3") }); } function buildApplicationButtons() { var pold = apps.slice(); function mysortfn(a, b) { if (a[13] < b[13]) return -1; if (a[13] > b[13]) return 1; return 0; } apps.sort(mysortfn); for (b in apps) { if (typeof apps[b][0] != "undefined") { if (apps[b][10] == "" || apps[b][10] == 0) apps[b][10] = 16; $application_buttons[apps[b][0]] = a("
").attr("id", "arrowchat_applications_button_" + apps[b][0]).addClass("arrowchat_appname_" + apps[b][2]).addClass("arrowchat_bar_left").addClass("arrowchat_apps_button").css("width", apps[b][10] + "px").html(ArrowChat.Templates.applications_bookmarks_tab(c_ac_path, apps, b)).appendTo($base); if ((apps[b][12] == "1" || (apps[b][9] != "1" && u_id == "") || (u_id != "" && apps[b][9] != "1" && u_is_guest == "1")) && c_no_apps_menu != 1) { $application_buttons[apps[b][0]].hide(); } if (apps[b][6] == "") { $application_button_popups[apps[b][0]] = a("
").attr("id", "arrowchat_applications_button_" + apps[b][0] + "_popup").addClass("arrowchat_apppopup").css("display", "none").html(ArrowChat.Templates.applications_bookmarks_window(c_ac_path, apps, b)).appendTo($body); } } } apps = pold.slice(); a(".arrowchat_app_keep_open").addClass("arrowchat_menu_unchecked"); a(".arrowchat_app_keep_open :input").prop("checked", false); if (u_apps_open != "" && u_apps_open != "0") { a("#arrowchat_app_keep_open_"+u_apps_open+" :input").prop("checked", true); a("#arrowchat_app_keep_open_"+u_apps_open).removeClass("arrowchat_menu_unchecked"); } a(".arrowchat_apps_button").mouseover(function () { var c = a(this).attr("id").substr(30); if ($application_buttons[c].hasClass("arrowchat_trayclick")) {} else { if (apps[c][10] <= 16 || apps[c][10] == "") showTooltip($application_buttons[c], apps[c][1], true); } a(this).addClass("arrowchat_tabmouseover") }); a(".arrowchat_apps_button").mouseout(function () { a(this).removeClass("arrowchat_tabmouseover"); hideTooltip(); }); a(".arrowchat_traytitle").click(function () { var e = a(this).parent().attr("id"); e = e.substring(30, e.length - 6); if ($application_buttons[e]) { $application_buttons[e].click(); } }).children().not(".arrowchat_tab_name").click(function () { return false; });; a(".arrowchat_traytitle").each( function (i, element) { a(element).mouseenter(function () { a(this).addClass("arrowchat_chatboxtabtitlemouseover") }); a(element).mouseleave( function () { a(this).removeClass("arrowchat_chatboxtabtitlemouseover") }); }); a(".arrowchat_traytitle .arrowchat_more_button").each( function (i, element) { a(element).mouseenter(function () { showTooltip(a(this), lang[23], 0, 10, 5); a(this).addClass("arrowchat_more_button_hover"); a(".arrowchat_traytitle").removeClass("arrowchat_chatboxtabtitlemouseover") }); a(element).mouseleave( function () { hideTooltip(); a(this).removeClass("arrowchat_more_button_hover"); a(".arrowchat_traytitle").addClass("arrowchat_chatboxtabtitlemouseover") }); }); a(".arrowchat_traytitle .arrowchat_more_anchor").click(function () { hideTooltip(); var c = a(this).attr("id").substr(20); a("#arrowchat_apps_more_popout_" + c).toggle(); a(this).addClass("arrowchat_more_button_hover"); a(this).toggleClass("arrowchat_more_button_selected"); }); addHover(a(".arrowchat_menu_item"), "arrowchat_more_hover"); a(".arrowchat_app_keep_open").click(function () { var c = a(this).attr("id").substr(24); a(".arrowchat_app_keep_open").addClass("arrowchat_menu_unchecked"); if (a("#arrowchat_app_keep_open_"+c+" :input").is(":checked")) { a("#arrowchat_app_keep_open_"+c+" :input").prop("checked", false); var keep_open_id = -1; u_apps_open = ""; } else { a(".arrowchat_app_keep_open :input").prop("checked", false); a("#arrowchat_app_keep_open_"+c+" :input").prop("checked", true); var keep_open_id = c; u_apps_open = c; a(this).removeClass("arrowchat_menu_unchecked"); } a.post(c_ac_path + "includes/json/send/send_settings.php", { app_keep: keep_open_id }, function () { }); }); a(".arrowchat_apps_button").click(function () { var c = a(this).attr("id").substr(30); closePopup($applications_button_popup, $applications_button); a(this).children(".arrowchat_tabalert").remove(); if (apps[c][6] == "") { if (m != c && m !== "") { if (apps[m][7] == 1) { closePopup($application_button_popups[m], $application_buttons[m], 1); } else { closePopup($application_button_popups[m], $application_buttons[m]); } m = ""; } if (m == "") { $application_button_popups[c].css("left", $application_buttons[c].offset().left).css("bottom", "25px").css("width", apps[c][4]); $application_button_popups[c].removeClass("arrowchat_tabopen_hidden"); $application_button_popups[c].addClass("arrowchat_tabopen"); $application_buttons[c].addClass("arrowchat_trayclick"); if (apps[c][7] != "1" || apps[c][14] != "1") { a.get(c_ac_path + "applications/" + apps[c][2] + "/index.php", function (d) { a("#arrowchat_applications_button_" + apps[c][0] + "_content").html(d) }); } apps[c][14] = 1; m = c; } else { if (apps[m][7] == 1) { closePopup($application_button_popups[m], $application_buttons[m], 1); } else { closePopup($application_button_popups[m], $application_buttons[m]); } var test = a("#arrowchatapplist_" + m).parent().attr('id'); if (test == "arrowchat_other_applications") { $application_buttons[m].hide() } m = ""; } } else { window.open(apps[c][6], "self"); } }); } function buildApplicationsButton() { $applications_button = a("
").attr("id", "arrowchat_applications_button").addClass("arrowchat_bar_left").addClass("arrowchat_bar_button").html(ArrowChat.Templates.applications_tab()).appendTo($base); $applications_button_popup = a("
").attr("id", "arrowchat_applications_button_popup").addClass("arrowchat_tabpopup").css("display", "none").html(ArrowChat.Templates.applications_window()).appendTo($body); $applications_button.css("width", c_width_apps + "px"); if (c_width_apps <= 25) { a(".arrowchat_tray_name", $applications_button).hide(); } var pold = apps.slice(); function mysortfn(a, b) { if (a[13] < b[13]) return -1; if (a[13] > b[13]) return 1; return 0; } apps.sort(mysortfn); _appslist = '
' + lang[20] + '
    '; for (b in apps) { if (typeof apps[b][0] != "undefined") { if (apps[b][12] != "1") { if ((apps[b][9] == "1" && u_id == "") || (u_id != "" && u_is_guest == "1" && apps[b][9] == "1") || (u_id != "" && u_is_guest != "1")) { _appslist += ArrowChat.Templates.applications_bookmarks_list(c_ac_path, apps, b); } } } } _appslist += '
' + lang[64] + '
    '; for (b in apps) { if (typeof apps[b][0] != "undefined") { if (apps[b][12] == "1") { if ((apps[b][9] == "1" && u_id == "") || (u_id != "" && u_is_guest == "1" && apps[b][9] == "1") || (u_id != "" && u_is_guest != "1")) { _appslist += ArrowChat.Templates.applications_bookmarks_list(c_ac_path, apps, b); } } } } _appslist += '
'; apps = pold.slice(); a("#arrowchat_bookmarks").append("
" + _appslist + "
"); if (u_id != "") { a("#arrowchat_applications, #arrowchat_other_applications").sortable({ delay: 50, connectWith: ".arrowchat_connectedSortable", scroll: false, axis: 'y', containment: '.arrowchat_traycontent', update: function () { var result = a('#arrowchat_other_applications').sortable('toArray'); var result2 = a(this).sortable('serialize') + "&" + a(this).attr('id') + "=1"; a.post(c_ac_path + "includes/json/send/send_settings.php", result2, function () {}); for (var b = 0; b < result.length; b++) { var c = result[b].substr(17); $application_buttons[c].hide(); apps[c][12] = "1"; } var result2 = a('#arrowchat_applications').sortable('toArray'); for (var b = 0; b < result2.length; b++) { var d = result2[b].substr(17); $application_buttons[d].show(); apps[d][12] = ""; } } }); } else { a(".arrowchat_apps_subtitle").hide(); } a(".arrowchat_app_link:not(.ui-sortable-helper)").on("click", function () { var c = a(this).attr("id").substr(19); if (apps[c][6] == "") { $application_buttons[c].show(); closePopup($applications_button_popup, $applications_button); } $application_buttons[c].click() }); a(".arrowchat_traytitle", $applications_button_popup).mouseenter(function () { a(this).addClass("arrowchat_chatboxtabtitlemouseover") }); a(".arrowchat_traytitle", $applications_button_popup).mouseleave(function () { a(this).removeClass("arrowchat_chatboxtabtitlemouseover") }); $applications_button.mouseover(function () { if (c_width_apps <= 25) { if ($applications_button.hasClass("arrowchat_tabclick")) {} else { showTooltip($applications_button, lang[16], true); } } a(this).addClass("arrowchat_tabmouseover") }); $applications_button.mouseout(function () { a(this).removeClass("arrowchat_tabmouseover"); if (c_width_apps <= 25) { hideTooltip(); } }); a(".arrowchat_traytitle", $applications_button_popup).click(function () { $applications_button.click(); }); $applications_button.click(function () { lsClick("#arrowchat_applications_button", 'ac_openclose'); if (c_width_apps <= 25) { hideTooltip(); } if (m != "") { $application_buttons[m].click(); m = ""; } $applications_button_popup.css("left", $applications_button.offset().left).css("bottom", "25px"); a(this).toggleClass("arrowchat_tabclick"); $applications_button_popup.toggleClass("arrowchat_tabopen"); }); } function buildModButton() { $modbutton = a("
").attr("id", "arrowchat_modbutton").addClass("arrowchat_bar_right").addClass("arrowchat_bar_button").html(ArrowChat.Templates.mod_tab()).appendTo($base); $modbutton_popup = a("
").attr("id", "arrowchat_modbutton_popup").addClass("arrowchat_tabpopup").css("display", "none").html(ArrowChat.Templates.mod_window()).appendTo($body); $modbutton.mouseover(function () { $modbutton_popup.hasClass("arrowchat_tabopen") || ($ == 0 ? showTooltip($modbutton, lang[166]) : showTooltip($modbutton, lang[166])); a(this).addClass("arrowchat_tabmouseover") }); $modbutton.mouseout(function () { a(this).removeClass("arrowchat_tabmouseover"); hideTooltip(); }); $modbutton.click(function () { lsClick("#arrowchat_modbutton", 'ac_openclose'); if (a("#arrowchat_modbutton .arrowchat_tabalertnf").length) { a("#arrowchat_modbutton .arrowchat_tabalertnf").remove(); } closePopup($chatrooms_popup, $chatrooms_button); closePopup($userstab_popup, $buddy_list_tab); closePopup($optionsbutton_popup, $optionsbutton); hideTooltip(); $modbutton_popup.css("left", $modbutton.offset().left - $modbutton_popup.outerWidth() + $modbutton.outerWidth()).css("bottom", "25px"); a(this).toggleClass("arrowchat_tabclick"); $modbutton_popup.toggleClass("arrowchat_tabopen"); $modbutton.toggleClass("arrowchat_modimages_click"); adjustBarSize(); if ($modbutton.hasClass("arrowchat_tabclick")) loadModerationContent(); }); a(".arrowchat_moderation_title", $modbutton_popup).click(function () { $modbutton.click() }).children().not(".arrowchat_tab_name").click(function () { return false; }); a(".arrowchat_moderation_title", $modbutton_popup).mouseenter(function () { a(this).addClass("arrowchat_chatboxtabtitlemouseover2") }); a(".arrowchat_moderation_title", $modbutton_popup).mouseleave(function () { a(this).removeClass("arrowchat_chatboxtabtitlemouseover2") }); if (u_num_mod_reports > 0) { a("
").css("top", "-11px").css("left", "8px").addClass("arrowchat_tabalertnf").html(u_num_mod_reports).prependTo($modbutton); } } function loadModerationContent() { a(".arrowchat_moderation_full_content").html('
' + lang[34] + "
"); a.ajax({ url: c_ac_path + "includes/json/receive/receive_moderation.php", cache: false, type: "get", dataType: "json", success: function (b) { buildModerationContent(b); } }); } function buildModerationContent(b) { a(".arrowchat_moderation_full_content").html(""); a(".arrowchat_reports_subtitle").html('
' + lang[177] + '
' + lang[178] + '
' + lang[179] + '
'); var c = {}, no_reports = true; b && a.each(b, function (i, e) { if (i == "reports") { a.each(e, function (l, f) { no_reports = false; a("
").attr("id", "arrowchat_report_" + f.id).mouseover(function () { a(this).addClass("arrowchat_report_list_hover"); }).mouseout(function () { a(this).removeClass("arrowchat_report_list_hover"); }).addClass("arrowchat_report_list").html('
' + f.from + '
' + f.about + ' (' + f.about_num + ')
' + f.time + '
').appendTo(a(".arrowchat_moderation_full_content")); }) } if (i == "total_reports") { a(".arrowchat_moderation_title .arrowchat_tab_name").html(lang[166] + " (" + e.count + " " + lang[180] + ")"); } }); if (c_disable_avatars == 1 || a("#arrowchat_setting_names_only :input").is(":checked")) { a(".arrowchat_report_from_image").addClass("arrowchat_hide_avatars"); a(".arrowchat_report_about_image").addClass("arrowchat_hide_avatars"); a(".arrowchat_report_from_name").css("width","165px"); } if (no_reports) { a("
").attr("id", "arrowchat_report_no_reports").html(lang[189]).appendTo(a(".arrowchat_moderation_full_content")); } preventScrolling(a(".arrowchat_moderation_content")); a(".arrowchat_report_list").click(function (l) { reportClicked(a(this)) }); } function reportClicked(b) { c = ""; if (a(b).attr("id")) c = a(b).attr("id").substr(17); if (c == "") c = a(b).parent().attr("id").substr(17); a(".arrowchat_moderation_full_content").html('
' + lang[34] + "
"); open_report = c; loadReport(c); } function loadReport(b) { a.ajax({ url: c_ac_path + "includes/json/receive/receive_report.php", data: { reportid: b }, type: "post", cache: false, dataType: "json", success: function (o) { if (o) { var no_error = true; o && a.each(o, function (i, e) { if (i == "error") { a.each(e, function (l, f) { no_error = false; open_report = 0; displayMessage("arrowchat_moderation_flyout", f.m, "error"); loadModerationContent(); }); } }); if (no_error) { a(".arrowchat_reports_subtitle").html(''); a(".arrowchat_moderation_full_content").html(ArrowChat.Templates.mod_report()); a(".arrowchat_report_sub_back a").click(function() { loadModerationContent(); }); a(".arrowchat_report_sub_close a").click(function() { a(".arrowchat_reports_subtitle").html(''); a(".arrowchat_moderation_full_content").html('
' + lang[34] + "
"); a.post(c_ac_path + "includes/json/send/send_settings.php", { report_id: b }, function () { loadModerationContent(); }) }); a(".arrowchat_report_sub_ban a").click(function() { var r = confirm(lang[195]); if (r == true) { a(".arrowchat_reports_subtitle").html(''); a(".arrowchat_moderation_full_content").html('
' + lang[34] + "
"); a.post(c_ac_path + "includes/json/send/send_settings.php", { report_ban: b }, function () { loadModerationContent(); }) } }); a(".arrowchat_report_sub_warn a").click(function() { var reason = prompt(lang[196]); if (reason != null && reason != "") { a.post(c_ac_path + "includes/json/send/send_settings.php", { report_warn: b, report_warn_reason: reason }, function (e) { if (e == 2) { var r = confirm(lang[197]); if (r == true) { a(".arrowchat_reports_subtitle").html(''); a(".arrowchat_moderation_full_content").html('
' + lang[34] + "
"); a.post(c_ac_path + "includes/json/send/send_settings.php", { report_warn: b, report_warn_reason: reason, report_warn_confirm: 1 }, function () { loadModerationContent(); }) } } else { a(".arrowchat_reports_subtitle").html(''); a(".arrowchat_moderation_full_content").html('
' + lang[34] + "
"); loadModerationContent(); } }) } }); $report_history = a("#arrowchat_report_history"); $report_list = a("#arrowchat_report_list"); preventScrolling(a("#arrowchat_report_list")); var no_additional_reports = true,report_time = 0; o && a.each(o, function (i, e) { if (i == "reports") { a.each(e, function (l, f) { no_additional_reports = false; a("
").attr("id", "arrowchat_report_list_id_" + f.id).mouseover(function () { a(this).addClass("arrowchat_report_list_hover"); }).mouseout(function () { a(this).removeClass("arrowchat_report_list_hover"); }).click(function () { if (f.id != open_report) { a("#arrowchat_report_history_content").html('
' + lang[34] + "
"); loadReport(f.id); open_report = f.id; } }).addClass("arrowchat_report_other_list").html('' + lang[187] + f.id + '').appendTo(a("#arrowchat_list_reports")); if (f.id == open_report) { a("#arrowchat_report_list_id_" + f.id).addClass('arrowchat_report_clicked'); } }); } if (i == "report_info") { a.each(e, function (l, f) { a(".arrowchat_report_info_about").html(lang[190] + '' + f.about_name + ''); a(".arrowchat_report_info_from").html(lang[191] + '' + f.from_name + ''); a(".arrowchat_report_info_warnings").html(lang[192] + f.previous_warnings); a(".arrowchat_report_info_time").html(lang[193] + f.time); a(".arrowchat_report_info_about a").click(function() { receiveUser(f.about, uc_name[f.about], uc_status[f.about], uc_avatar[f.about], uc_link[f.about]); }); a(".arrowchat_report_info_from a").click(function() { receiveUser(f.from, uc_name[f.from], uc_status[f.from], uc_avatar[f.from], uc_link[f.from]); }); report_time = f.unix; }); } if (i == "report_history") { var d = "",report_here_used=false; a.each(e, function (l, f) { if (typeof(blockList[f.userid]) == "undefined") { var title = "", important = ""; if (f.mod == 1) { title = lang[137]; important = " arrowchat_chatroom_important"; } if (f.admin == 1) { title = lang[136]; important = " arrowchat_chatroom_important"; } l = "",repotee="",image_msg=""; fromname = f.n; if (f.reportee == 1) { repotee = " arrowchat_reportee"; } if (f.m.substr(0, 4) == "= report_time && !report_here_used) { d += '
' + lang[194] + "
"; report_here_used = true; } if (f.global == 1) { d += '
' + formatTimestamp(sent_time) + f.m + "
" } else { d += '
' + fromname + title + ' ' + tooltip + '
' + fromname + title + ':
' + f.m + '
' } } }); if (!report_here_used) { d += '
' + lang[194] + "
"; } a("#arrowchat_report_history_content").html(d); showChatroomTime(); } }); if (c_disable_avatars == 1 || a("#arrowchat_setting_names_only :input").is(":checked")) { a(".arrowchat_chatroom_message_avatar").addClass("arrowchat_hide_avatars"); a(".arrowchat_chatroom_message_name").show(); a(".arrowchat_chatroom_message_avatar").removeClass("arrowchat_no_names"); } a('#arrowchat_report_history').scrollTop(a('#arrowchat_report_history').scrollTop() + a(".arrowchat_report_here").position().top - a('#arrowchat_report_history').height()/2 + a(".arrowchat_report_here").height()/2); a(".arrowchat_image_msg img,.arrowchat_emoji_text img").one("load", function() { a('#arrowchat_report_history').scrollTop(a('#arrowchat_report_history').scrollTop() + a(".arrowchat_report_here").position().top - a('#arrowchat_report_history').height()/2 + a(".arrowchat_report_here").height()/2); }).each(function() { if(this.complete) a(this).trigger('load'); }); preventScrolling(a("#arrowchat_report_history")); if (no_additional_reports) { a("
").attr("id", "arrowchat_report_list_none").addClass("arrowchat_report_other_list").html('' + lang[188] + '').appendTo(a("#arrowchat_list_reports")); } } } } }) } function receiveWarning(h) { if (h.read == 0 && h.data != "") { a("#arrowchat_warnings").remove(); $body.append(ArrowChat.Templates.warnings_display(h)); if (a("#arrowchat_announcement").length) { var nb = parseInt(a(window).height() - a("#arrowchat_announcement").position().top); a("#arrowchat_warnings").css("bottom", nb + 5 + "px"); } a("#arrowchat_warnings .arrowchat_warnings_close").click(function () { a("#arrowchat_warnings").remove(); if (a("#arrowchat_announcement").length) a("#arrowchat_announcement").css("bottom", "35px"); a.post(c_ac_path + "includes/json/send/send_settings.php", { warning_read: 1 }, function () {}); }); } else { a("#arrowchat_warnings").remove(); } } function buildOptionsButton() { $optionsbutton = a("
").attr("id", "arrowchat_optionsbutton").addClass("arrowchat_bar_right").addClass("arrowchat_bar_button").html(ArrowChat.Templates.notifications_tab()).appendTo($base); $optionsbutton_popup = a("
").attr("id", "arrowchat_optionsbutton_popup").addClass("arrowchat_tabpopup").css("display", "none").html(ArrowChat.Templates.notifications_window()).appendTo($body); $optionsbutton.mouseover(function () { $optionsbutton_popup.hasClass("arrowchat_tabopen") || ($ == 0 ? showTooltip($optionsbutton, lang[0]) : showTooltip($optionsbutton, lang[0])); a(this).addClass("arrowchat_tabmouseover") }); $optionsbutton.mouseout(function () { a(this).removeClass("arrowchat_tabmouseover"); hideTooltip(); }); a(".arrowchat_see_all_link").mouseenter(function () { showTooltip(a(this), lang[21], 0, 10, 5); a(this).parent().addClass("arrowchat_see_all_button_hover"); a("#arrowchat_userstab_popup .arrowchat_userstabtitle").removeClass("arrowchat_chatboxtabtitlemouseover2") }); a(".arrowchat_see_all_link").mouseleave(function () { hideTooltip(); a(this).parent().removeClass("arrowchat_see_all_button_hover"); a("#arrowchat_userstab_popup .arrowchat_userstabtitle").addClass("arrowchat_chatboxtabtitlemouseover2") }); a(".arrowchat_see_all_link").click(function () { lsClick(".arrowchat_see_all_link", 'ac_click'); a("#arrowchat_notifications_content").html('
'); var i = 0; a.ajax({ url: c_ac_path + "includes/json/receive/receive_notifications.php", type: "get", cache: false, dataType: "json", success: function (b) { if (b && b != null) { a("#arrowchat_notifications_content").html(""); a.each(b, function (e, l) { a.each(l, function (f, h) { a("
").attr("id", "arrowchat_alert_" + h.alert_id).attr("class", "arrowchat_notification_message_div").html(h.markup).appendTo(a("#arrowchat_notifications_content")); i++; }); }); if (i == 0) { a("#arrowchat_notifications_content").html(lang[9]); } if ((a(window).height() - $optionsbutton_popup.height()) < 80) { a("#arrowchat_notifications_content").css("height", a(window).height() - 135); } else { a("#arrowchat_notifications_content").css("height", "auto"); } adjustBarSize(); } } }); }); $optionsbutton.click(function () { lsClick("#arrowchat_optionsbutton", 'ac_openclose'); if (a("#arrowchat_notification_alert").length > 0) { a("#arrowchat_notification_alert").remove(); $optionsbutton.removeClass("arrowchat_tab_new_message"); } closePopup($modbutton_popup, $modbutton); closePopup($chatrooms_popup, $chatrooms_button); if (Q > 0) { a("#arrowchat_optionsbutton .arrowchat_tabalertnf").remove(); a.post(c_ac_path + "includes/json/send/send_notifications.php", { userid: u_id }, function () {}); Q = 0 } if ($ == 0) { hideTooltip(); $optionsbutton_popup.css("left", $optionsbutton.offset().left - $optionsbutton_popup.outerWidth() + $optionsbutton.outerWidth()).css("bottom", "25px"); a(this).toggleClass("arrowchat_tabclick"); $optionsbutton_popup.toggleClass("arrowchat_tabopen"); $optionsbutton.toggleClass("arrowchat_optionsimages_click"); closePopup($userstab_popup, $buddy_list_tab); } else if (lang[16] != "") location.href = lang[16]; if ((a(window).height() - $optionsbutton_popup.height()) < 80) { a("#arrowchat_notifications_content").css("height", a(window).height() - 135); } else { a("#arrowchat_notifications_content").css("height", "auto"); } adjustBarSize(); }); a(".arrowchat_userstabtitle", $optionsbutton_popup).click(function () { $optionsbutton.click() }).children().not(".arrowchat_tab_name").click(function () { return false; }); a(".arrowchat_userstabtitle", $optionsbutton_popup).mouseenter(function () { a(this).addClass("arrowchat_chatboxtabtitlemouseover2") }); a(".arrowchat_userstabtitle", $optionsbutton_popup).mouseleave(function () { a(this).removeClass("arrowchat_chatboxtabtitlemouseover2") }) } function displayMessage(id, message, type) { clearTimeout(message_timeout); if (a("#" + id).is(":visible")) { a("#" + id).hide("slide", { direction: "up"}, 250, function() { a("#" + id + " .arrowchat_message_text").html(message); type == "error" && a(".arrowchat_message_box").addClass("arrowchat_message_box_error").removeClass("arrowchat_message_box_notice"); type == "notice" && a(".arrowchat_message_box").addClass("arrowchat_message_box_notice").removeClass("arrowchat_message_box_error"); a("#" + id).show("slide", { direction: "up"}, 250); }); } else { type == "error" && a(".arrowchat_message_box").addClass("arrowchat_message_box_error").removeClass("arrowchat_message_box_notice"); type == "notice" && a(".arrowchat_message_box").addClass("arrowchat_message_box_notice").removeClass("arrowchat_message_box_error"); a("#" + id + " .arrowchat_message_text").html(message); a("#" + id).show("slide", { direction: "up"}, 250); } message_timeout = setTimeout(function () { a("#" + id).hide("slide", { direction: "up"}, 250); }, 5000); } function loadGiphy(url, selector, popup_id) { var selector_id = $chatrooms_popup; if (selector == 1) selector_id = $user_popups[popup_id]; a.ajax({ url: url, type: "get", cache: false, dataType: "json", success: function (results) { results && a.each(results, function (i, e) { if (i == "data") { a(".arrowchat_giphy_image_wrapper", selector_id).html(''); var new_height = 0; a.each(e, function (l, f) { new_height = Math.round((256/(f.images.fixed_height_downsampled.width/f.images.fixed_height_downsampled.height))); a(".arrowchat_giphy_image_wrapper", selector_id).append(''); }); a(".arrowchat_giphy_image", selector_id).click(function () { a(".arrowchat_giphy_popout", selector_id).children(".arrowchat_more_popout").hide(); var giphy_src = a(this).attr('src'); if (selector == 2) { a.post(c_ac_path + "includes/json/send/send_message_chatroom.php", { userid: u_id, username: u_name, chatroomid: Ccr, message: "giphy{" + a(this).attr('height') + "}{" + a(this).attr('src') + "}" }, function (e) { if (a("#arrowchat_chatroom_message_" + e).length) {} else { $chatroom_chat.append('
' + lang[90] + '
'); var data_array = [e, u_name, '
', Ccr]; lsClick(JSON.stringify(data_array), 'send_chatroom_message'); } $chatroom_chat.scrollTop(5E4); }); } else { a.post(c_ac_path + "includes/json/send/send_message.php", { userid: u_id, to: popup_id, message: "giphy{" + a(this).attr('height') + "}{" + a(this).attr('src') + "}" }, function (e) { if (a("#arrowchat_message_" + e).length) {} else { a(".arrowchat_tabcontenttext", $user_popups[popup_id]).append('
' + lang[90] + '
'); var time = Math.floor((new Date).getTime() / 1E3); var data_array = [e, popup_id, '
', time, 1, 1]; lsClick(JSON.stringify(data_array), 'private_message'); } a(".arrowchat_tabcontenttext", $user_popups[popup_id]).scrollTop(a(".arrowchat_tabcontenttext", $user_popups[popup_id])[0].scrollHeight); }); } }); } }); } }); } function addChatroomTab(id, name, focused) { if (typeof $chatroom_tab[id] == "undefined") { crt2[id] = name; $chatroom_tab[id] = a("
").attr("id", "arrowchat_chatroom_tab_" + id).addClass("arrowchat_chatroom_tab").html('
' + crt2[id] + '
').prependTo(a("#arrowchat_chatroom_open_chats_container")); if (focused == 1) $chatroom_tab[id].addClass("arrowchat_chatroom_tab_focused"); addHover($chatroom_tab[id], "arrowchat_chatroom_tab_hover"); a(".arrowchat_closebox_bottom", $chatroom_tab[id]).unbind('click'); a(".arrowchat_closebox_bottom", $chatroom_tab[id]).click(function() { lsClick(".arrowchat_closebox_bottom", 'ac_click', "chatroom_tab['"+id+"']"); var id2 = a(this).attr("data-id"); var focused = false; if (typeof($chatroom_tab[id2]) != "undefined") { if ($chatroom_tab[id2].hasClass("arrowchat_chatroom_tab_focused")) focused = true; $chatroom_tab[id2].remove(); delete $chatroom_tab[id2]; } u_chatroom_stay = 0; if (a.isEmptyObject($chatroom_tab)) { a("#arrowchat_chatroom_open_chats").hide(); a("#arrowchat_chatroom_leave").click(); } else { if (focused) { for (var i in $chatroom_tab) { chatroomListClicked(a("#arrowchat_chatroom_tab_" + i), 23); break; } } } a.post(c_ac_path + "includes/json/send/send_settings.php", { chatroom_unfocus: id2 }, function () {}); changePushChannel(id2, 0); }); $chatroom_tab[id].unbind('click'); $chatroom_tab[id].click(function () { if (!$chatroom_tab[id].hasClass("arrowchat_chatroom_tab_focused")) { lsClick(" ", 'ac_click', "chatroom_tab['"+id+"']"); if (a(".arrowchat_popout_alert", $chatroom_tab[id]).length > 0) { a(".arrowchat_popout_alert", $chatroom_tab[id]).remove(); } a(".arrowchat_chatroom_tab").removeClass("arrowchat_chatroom_tab_focused"); $chatroom_tab[id].addClass("arrowchat_chatroom_tab_focused"); chatroomListClicked(a("#arrowchat_chatroom_tab_" + id), 23); } }); a(".arrowchat_closebox_bottom", $chatroom_tab[id]).mouseenter(function () { a(this).addClass("arrowchat_closebox_bottomhover") }); a(".arrowchat_closebox_bottom", $chatroom_tab[id]).mouseleave(function () { a(this).removeClass("arrowchat_closebox_bottomhover") }); } else { $chatroom_tab[id].addClass("arrowchat_chatroom_tab_focused"); } } function loadChatroom(b, c, pass) { a(".arrowchat_chatroom_full_content").removeClass("arrowchat_chatroom_opacity"); a(".arrowchat_chatroom_content").removeClass("arrowchat_chatroom_lobby"); a(".arrowchat_chatrooms_title").removeClass("arrowchat_chatroom_lobby_title"); lsClick("#arrowchat_chatroom_"+b, 'ac_click'); var global_mod = 0, global_admin = 0, admin_markup = ""; chatroom_mod = 0; chatroom_popout = ""; chatroom_admin = 0; chatroomreceived = 1; a.ajax({ url: c_ac_path + "includes/json/receive/receive_chatroom_room.php", data: { chatroomid: b, chatroom_window: u_chatroom_open, chatroom_stay: u_chatroom_stay, chatroom_pw: pass }, type: "post", cache: false, dataType: "json", success: function (o) { if (o) { clearTimeout(Crref2); var no_error = true; o && a.each(o, function (i, e) { if (i == "error") { a.each(e, function (l, f) { no_error = false; Ccr = 0; clearTimeout(Crref2); if (typeof($chatroom_tab[b]) != "undefined") { a(".arrowchat_closebox_bottom", $chatroom_tab[b]).click(); } if (!a.isEmptyObject($chatroom_tab)) { for (var i in $chatroom_tab) { $chatroom_tab[i].click(); break; } } else { chatroomreceived = 0; loadChatroomList(); } displayMessage("arrowchat_chatroom_message_flyout", f.m, "error"); }); } }); if (no_error) { u_chatroom_stay = b; Crref2 = setTimeout(function () { receiveChatroom(b) }, 30000); if (c_push_engine != 1) { cancelJSONP(); changePushChannel(b, 1); receiveCore(); } else { changePushChannel(b, 1); } a("#arrowchat_chatroom_userlist_button").show(); a("#arrowchat_chatroom_open_chats").show(); if (typeof crt2[b] != "undefined") { a(".arrowchat_chatrooms_title .arrowchat_tab_name").html(lang[19]); addChatroomTab(b, crt2[b], 1); } a("#arrowchat_chatroom_leave").show(); a(".arrowchat_chatroom_full_content").html(ArrowChat.Templates.chatrooms_room(c_max_chatroom_msg)); $chatroom_chat = a("#arrowchat_chatroom_chat"); $chatroom_room_list = a("#arrowchat_chatroom_room_list"); if(c_popout_on == 1){a(".arrowchat_chatroom_popout", $chatrooms_popup).show();} a("#arrowchat_chatroom_chat").click(function () { if (window.getSelection().toString().length) {} else { a(".arrowchat_chatroom_message_input").focus(); } }); a(".arrowchat_chatroom_message_input").focusin(function() { a(".arrowchat_chatrooms_title").addClass("arrowchat_typing_title"); }); a(".arrowchat_chatroom_message_input").focusout(function() { a(".arrowchat_chatrooms_title").removeClass("arrowchat_typing_title"); }); a(".arrowchat_chatroom_popout", $chatrooms_popup).mouseenter(function () { showTooltip(a(this), lang[117], 0, 10, 5); a(this).addClass("arrowchat_chatroom_popout_hover"); a(".arrowchat_chatrooms_title", $chatrooms_popup).removeClass("arrowchat_chatboxtabtitlemouseover3") }); a(".arrowchat_chatroom_popout", $chatrooms_popup).mouseleave(function () { a(this).removeClass("arrowchat_chatroom_popout_hover"); a(".arrowchat_chatrooms_title", $chatrooms_popup).addClass("arrowchat_chatboxtabtitlemouseover3"); hideTooltip(); }); a(".arrowchat_chatroom_popout", $chatrooms_popup).unbind('click'); a(".arrowchat_chatroom_popout", $chatrooms_popup).click(function() { window.open(c_ac_path + "public/popout/?cid=" + b + "&ah=1", "chatroom", "menubar=0,resizable=0,width=940,height=620,top=25,left=25,scrollbars=0,status=0"); }); a(".arrowchat_chatroom_message_input", $chatrooms_popup).keydown(function (h) { if (a(".arrowchat_smiley_popout", $chatrooms_popup).children(".arrowchat_more_popout").is(":visible")) { a(".arrowchat_smiley_popout", $chatrooms_popup).children(".arrowchat_more_popout").hide(); } return chatroomKeydown(h, a(this)) }); a(".arrowchat_chatroom_message_input", $chatrooms_popup).keyup(function (h) { return chatroomKeyup(h, a(this)) }); a(".arrowchat_emoji_selector", $chatrooms_popup).click(function() { if (!a(this).hasClass("arrowchat_emoji_focused")) { a(".arrowchat_emoji_wrapper", $chatrooms_popup).html('
'); a(".arrowchat_emoji_selector", $chatrooms_popup).removeClass("arrowchat_emoji_focused"); a(this).addClass("arrowchat_emoji_focused"); var load_id = a(this).attr("data-id"); a.ajax({ url: c_ac_path + 'includes/emojis/' + load_id + '.php', type: "GET", cache: true, success: function(html) { a(".arrowchat_emoji_wrapper", $chatrooms_popup).html(html); a(".arrowchat_emoji", $chatrooms_popup).click(function () { if (a(this).hasClass("arrowchat_emoji_custom")) var smiley_code = a(this).children('img').attr("data-id"); else var smiley_code = a(this).html(); var existing_text = a(".arrowchat_chatroom_message_input", $chatrooms_popup).val(); a(".arrowchat_chatroom_message_input", $chatrooms_popup).focus().val('').val(existing_text + smiley_code); }); } }); } }); a(".arrowchat_emoji_smileys").mouseover(function(){showTooltip(a(this), lang[230], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_emoji_animals").mouseover(function(){showTooltip(a(this), lang[231], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_emoji_food").mouseover(function(){showTooltip(a(this), lang[232], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_emoji_activities").mouseover(function(){showTooltip(a(this), lang[233], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_emoji_travel").mouseover(function(){showTooltip(a(this), lang[234], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_emoji_objects").mouseover(function(){showTooltip(a(this), lang[235], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_emoji_symbols").mouseover(function(){showTooltip(a(this), lang[236], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_emoji_flags").mouseover(function(){showTooltip(a(this), lang[237], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_emoji_custom").mouseover(function(){showTooltip(a(this), lang[238], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_smiley_button", $chatrooms_popup).mouseenter(function () { a(this).addClass("arrowchat_smiley_button_hover") }); a(".arrowchat_smiley_button", $chatrooms_popup).mouseleave(function () { a(this).removeClass("arrowchat_smiley_button_hover"); }); a(".arrowchat_smiley_button", $chatrooms_popup).click(function () { if (a(".arrowchat_giphy_popout", $chatrooms_popup).children(".arrowchat_more_popout").is(":visible")) { a(".arrowchat_giphy_popout", $chatrooms_popup).children(".arrowchat_more_popout").hide(); } if (a(".arrowchat_smiley_popout", $chatrooms_popup).children(".arrowchat_more_popout").is(":visible")) { a(".arrowchat_smiley_popout", $chatrooms_popup).children(".arrowchat_more_popout").hide(); } else { if (!a(".arrowchat_emoji_selector", $chatrooms_popup).hasClass("arrowchat_emoji_focused")) { a(".arrowchat_emoji_wrapper", $chatrooms_popup).html('
'); a(".arrowchat_emoji_selector", $chatrooms_popup).removeClass("arrowchat_emoji_focused"); a(".arrowchat_emoji_smileys", $chatrooms_popup).addClass("arrowchat_emoji_focused"); a.ajax({ url: c_ac_path + 'includes/emojis/emoji_smileys.php', type: "GET", cache: true, success: function(html) { a(".arrowchat_emoji_wrapper", $chatrooms_popup).html(html); a(".arrowchat_emoji", $chatrooms_popup).click(function () { if (a(this).hasClass("arrowchat_emoji_custom")) var smiley_code = a(this).children('img').attr("data-id"); else var smiley_code = a(this).html(); var existing_text = a(".arrowchat_chatroom_message_input", $chatrooms_popup).val(); a(".arrowchat_chatroom_message_input", $chatrooms_popup).focus().val('').val(existing_text + smiley_code); }); } }); } a(".arrowchat_chatroom_message_input", $chatrooms_popup).focus(); a(".arrowchat_smiley_popout", $chatrooms_popup).children(".arrowchat_more_popout").show(); } }).children().click(function(e){ return false; }); a(".arrowchat_giphy_button", $chatrooms_popup).mouseenter(function () { a(this).addClass("arrowchat_giphy_button_hover") }); a(".arrowchat_giphy_button", $chatrooms_popup).mouseleave(function () { a(this).removeClass("arrowchat_giphy_button_hover"); }); a(".arrowchat_giphy_button", $chatrooms_popup).click(function () { if (a(".arrowchat_smiley_popout", $chatrooms_popup).children(".arrowchat_more_popout").is(":visible")) { a(".arrowchat_smiley_popout", $chatrooms_popup).children(".arrowchat_more_popout").hide(); } if (a(".arrowchat_giphy_popout", $chatrooms_popup).children(".arrowchat_more_popout").is(":visible")) { a(".arrowchat_giphy_popout", $chatrooms_popup).children(".arrowchat_more_popout").hide(); } else { a(".arrowchat_giphy_popout", $chatrooms_popup).children(".arrowchat_more_popout").show(); a(".arrowchat_giphy_search", $chatrooms_popup).val(''); a(".arrowchat_giphy_search", $chatrooms_popup).focus(); loadGiphy('https://api.giphy.com/v1/gifs/trending?api_key=IOYyr4NK5ldaU&limit=20', 2, 0); } }).children().click(function(e){ return false; }); a(".arrowchat_giphy_search", $chatrooms_popup).keyup(function () { a(".arrowchat_giphy_image_wrapper", $chatrooms_popup).html('
'); if (a(".arrowchat_giphy_search", $chatrooms_popup).val() == '') loadGiphy('https://api.giphy.com/v1/gifs/trending?api_key=IOYyr4NK5ldaU&limit=20', 2, 0); else loadGiphy('https://api.giphy.com/v1/gifs/search?api_key=IOYyr4NK5ldaU&limit=20&q=' + a(".arrowchat_giphy_search", $chatrooms_popup).val(), 2); }); if (c_chatroom_transfer == 1) { chatroomUploadProcessing(); } preventScrolling(a(".arrowchat_giphy_image_wrapper")); preventScrolling(a(".arrowchat_emoji_wrapper")); preventScrolling(a("#arrowchat_chatroom_chat")); preventScrolling(a("#arrowchat_chatroom_room_list")); if (c_chatroom_transfer != 1) {a("#arrowchat_upload_button", $chatrooms_popup).hide();a(".arrowchat_chatroom_message_area", $chatrooms_popup).addClass("arrowchat_no_file_upload")} if (c_disable_smilies == 1) {a(".arrowchat_smiley_button", $chatrooms_popup).hide();a(".arrowchat_chatroom_message_area", $chatrooms_popup).addClass("arrowchat_no_smiley")} if (c_giphy_chatroom == 1) {a(".arrowchat_giphy_button", $chatrooms_popup).hide();a(".arrowchat_chatroom_message_area", $chatrooms_popup).addClass("arrowchat_no_giphy")} o && a.each(o, function (i, e) { if (i == "user_title") { a.each(e, function (l, f) { if (f.admin == 1) { global_admin = 1; chatroom_admin = 1; } if (f.mod == 1) { global_mod = 1; chatroom_mod = 1; } }); } if (i == "chat_name") { a.each(e, function (l, f) { if (typeof crt2[b] == "undefined") { crt2[b] = f.n; addChatroomTab(b, crt2[b], 1); a(".arrowchat_chatrooms_title .arrowchat_tab_name").html(lang[19]); } }); } if (i == "chat_users") { var longname,adminCount=0,modCount=0,userCount=0; a.each(e, function (l, f) { if ((global_admin == 1 || global_mod == 1) && (f.t == 1 || f.t == 4)) { admin_markup = '
' + lang[52] + '
' + lang[161] + '
' + lang[53] + '
'; } if (global_admin == 1 && f.t == 2) { admin_markup = '
' + lang[54] + '
'; } appendVal = a("#arrowchat_chatroom_list_users"); if (f.t == 2) { appendVal = a("#arrowchat_chatroom_list_mods"); modCount++; } else if (f.t == 3) { appendVal = a("#arrowchat_chatroom_list_admins"); adminCount++; } else userCount++; longname = renderHTMLString(f.n); f.n = renderHTMLString(f.n); a("
").attr("id", "arrowchat_chatroom_user_" + f.id).mouseover(function () { a(this).addClass("arrowchat_chatroom_list_hover"); }).mouseout(function () { a(this).removeClass("arrowchat_chatroom_list_hover"); }).addClass("arrowchat_chatroom_room_list").addClass('arrowchat_chatroom_admin_' + f.t).html('' + f.n + '').appendTo(appendVal); var pm_opacity = ""; if ((f.b == 1 && global_admin != 1) || f.id == u_id) pm_opacity = " arrowchat_no_private_msg"; a("
").attr("id", "arrowchat_chatroom_users_flyout_" + f.id).addClass("arrowchat_more_wrapper_chatroom").html('
' + longname + '
' + lang[43] + '

' + lang[41] + '
' + lang[84] + '
' + lang[167] + '
' + admin_markup + '
').appendTo(a("#arrowchat_chatroom_user_" + f.id)); if (f.t == 2) { a("#arrowchat_chatroom_title_" + f.id).html('' + longname + '
' + lang[44]); } else if (f.t == 3) { a("#arrowchat_chatroom_title_" + f.id).html('' + longname + '
' + lang[45]); } else if (f.t == 4) { a("#arrowchat_chatroom_title_" + f.id).html('' + longname + '
' + lang[212]) } addHover(a(".arrowchat_chatroom_options_padding"), "arrowchat_options_padding_hover"); chatroomUserOptions(f, global_admin); }); userCount == 0 && a("#arrowchat_chatroom_line_users").hide(); adminCount == 0 && a("#arrowchat_chatroom_line_admins").hide(); modCount == 0 && a("#arrowchat_chatroom_line_mods").hide(); a(".arrowchat_chatroom_admin_3").css("background-color", "#"+c_admin_bg); a(".arrowchat_chatroom_admin_3").css("color", "#"+c_admin_txt); } if (i == "chat_history") { d = ""; a.each(e, function (l, f) { var regex = new RegExp('^(^|\\s)(@' + u_name + ')(\\s|$)', 'i'); f.m = f.m.replace(regex, '$1$2$3'); if (typeof(blockList[f.userid]) == "undefined") { var title = "", important = ""; if (f.mod == 1) { title = lang[137]; important = " arrowchat_chatroom_important"; } if (f.admin == 1) { title = lang[136]; important = " arrowchat_chatroom_important"; } l = ""; var image_msg = ""; fromname = f.n; if (f.n == u_name) { l = " arrowchat_self"; } if (f.m.substr(0, 4) == "
' + formatTimestamp(sent_time) + f.m + "
" } else { d += '
' + fromname + title + ' ' + tooltip + '
' + fromname + title + ':
' + f.m + '
' } } }); a("#arrowchat_chatroom_chat #arrowchat_chatroom_chat_content").html(d); showChatroomTime(); } if (i == "room_info") { a.each(e, function (l, f) { if (f.welcome_msg != "") { var message = stripslashes(f.welcome_msg); room_info[b] = message; message = replaceURLWithHTMLLinks(message); $chatroom_chat.append('
' + message + "
"); } room_desc[b] = f.desc; room_limit_msg[b] = f.limit_msg; room_limit_sec[b] = f.limit_sec; }); } }); modDeleteControls(); if (c_disable_avatars == 1 || a("#arrowchat_setting_names_only :input").is(":checked")) { a(".arrowchat_chatroom_avatar").addClass("arrowchat_hide_avatars"); a(".arrowchat_chatroom_message_avatar").addClass("arrowchat_hide_avatars"); a(".arrowchat_chatroom_flyout_avatar").addClass("arrowchat_hide_avatars"); a(".arrowchat_chatroom_message_name").show(); a(".arrowchat_chatroom_message_avatar").removeClass("arrowchat_no_names"); } if (a("#arrowchat_chatroom_show_names :input").is(":checked")) { a(".arrowchat_chatroom_message_name").show(); a(".arrowchat_chatroom_message_avatar").removeClass("arrowchat_no_names"); } $chatroom_chat.scrollTop(5E4); a(".arrowchat_chatroom_message_input").focus(); if (global_admin == 1 || global_mod == 1) { if (!a('.arrowchat_chatroom_admin_menu').length || !a('.arrowchat_flood_menu').length) addChatroomAdminControls(); } else { if ($chatroom_admin_controls.length) $chatroom_admin_controls.remove(); } a(".arrowchat_image_msg img,.arrowchat_emoji_text img").one("load", function() { $chatroom_chat.scrollTop(5E4); }).each(function() { if(this.complete) a(this).trigger('load'); }); } else { if (c_user_chatrooms == "1") { $chatroom_create.show(); } } } } }) } function modDeleteControls() { if (chatroom_mod == 1 || chatroom_admin == 1) { a(".arrowchat_chatroom_delete").show(); a(".arrowchat_chatroom_delete", $chatrooms_popup).unbind("mouseenter").unbind("mouseleave").unbind("click"); a(".arrowchat_chatroom_delete", $chatrooms_popup).mouseenter(function () { showTooltip(a(this), lang[160], 0, 3, 21); a(this).addClass("arrowchat_chatroom_delete_hover") }); a(".arrowchat_chatroom_delete", $chatrooms_popup).mouseleave(function () { hideTooltip(); a(this).removeClass("arrowchat_chatroom_delete_hover"); }); a(".arrowchat_chatroom_delete").click(function () { hideTooltip(); var msg_id = a(this).attr('data-id'); a("#arrowchat_chatroom_message_" + msg_id + " .arrowchat_chatroom_delete").remove(); a.post(c_ac_path + "includes/json/send/send_settings.php", { delete_msg: msg_id, chatroom_id: Ccr, delete_name: u_name }, function () { a("#arrowchat_chatroom_message_" + msg_id + " .arrowchat_chatroom_msg").html(lang[159] + u_name); }) }); } else { a(".arrowchat_chatroom_delete").hide(); } } function chatroomUploadProcessing() { var ts67 = Math.round(new Date().getTime()); var path = c_ac_path.replace("../", "/"); a("#arrowchat_upload_button").uploadifive({ 'uploadScript': path + 'includes/classes/class_uploads.php', 'buttonText': ' ', 'removeCompleted' : true, 'formData': { 'unixtime': ts67, 'user': u_id }, 'queueID' : 'arrowchat_chatroom_upload_queue', 'height': 25, 'width': 24, 'multi': false, 'auto': true, 'fileType': '.avi,.bmp,.doc,.docx,.gif,.ico,.jpeg,.jpg,.mp3,.mp4,.pdf,.png,.ppt,.pptx,.rar,.tar,.txt,.wav,.wmv,.xls,.xlsx,.zip,.7z', 'fileSizeLimit' : c_max_upload_size + 'MB', 'onError': function (file, errorCode, errorMsg, errorString) { }, 'onUploadComplete': function (file) { var uploadType = "file", fileType = file.type.toLowerCase(); if (fileType == "image/jpeg" || fileType == "image/gif" || fileType == "image/jpg" || fileType == "image/png") uploadType = "image"; a.post(c_ac_path + "includes/json/send/send_message_chatroom.php", { userid: u_id, username: u_name, chatroomid: Ccr, message: uploadType + "{" + ts67 + "}{" + file.name + "}" }, function (e) { if (a("#arrowchat_chatroom_message_" + e).length) {} else { var message = ''; if (uploadType == "image") { $chatroom_chat.append('
' + lang[90] + '
Image
'); message = '
Image
'; a(".arrowchat_image_msg img,.arrowchat_emoji_text img").one("load", function() { setTimeout(function () { $chatroom_chat.scrollTop(5E4); }, 500); }).each(function() { if(this.complete) a(this).trigger('load'); }); } else { $chatroom_chat.append('
' + lang[90] + '
' + lang[69] + '
' + file.name + '
'); message = '
' + lang[69] + '
' + file.name + '
'; } showChatroomTime(); var data_array = [e, u_name, message, Ccr]; lsClick(JSON.stringify(data_array), 'send_chatroom_message'); } $chatroom_chat.scrollTop(5E4); }); chatroomUploadProcessing(); } }); a("#uploadifive-arrowchat_upload_button", $chatrooms_popup).mouseenter(function () { a(this).addClass("arrowchat_upload_button_hover") }); a("#uploadifive-arrowchat_upload_button", $chatrooms_popup).mouseleave(function () { a(this).removeClass("arrowchat_upload_button_hover"); }); } function addChatroomAdminControls() { $chatroom_admin_controls = a("
").addClass('arrowchat_chatroom_admin_menu').html('
  • ' + lang[157] + '
  • ' + lang[153] + '
  • ' + lang[171] + '
  • ').appendTo('#arrowchat_chatroom_options_flyout .arrowchat_inner_menu'); addHover(a(".arrowchat_menu_item"), "arrowchat_more_hover"); a("#arrowchat_edit_welcome").click(function () { var welcome_msg_input = prompt(lang[154], room_info[Ccr]); if (welcome_msg_input || welcome_msg_input == "") { a.post(c_ac_path + "includes/json/send/send_settings.php", { chatroom_welcome_msg: welcome_msg_input , chatroom_id: Ccr }, function () { displayMessage("arrowchat_chatroom_message_flyout", lang[155], "notice"); room_info[Ccr] = welcome_msg_input; a(".arrowchat_chatroom_item2").click(); }); } }); a("#arrowchat_edit_description").click(function () { var desc_input = prompt(lang[158], room_desc[Ccr]); if (desc_input || desc_input == "") { a.post(c_ac_path + "includes/json/send/send_settings.php", { chatroom_description: desc_input, chatroom_id: Ccr }, function () { displayMessage("arrowchat_chatroom_message_flyout", lang[155], "notice"); room_desc[Ccr] = desc_input; a(".arrowchat_chatroom_item2").click(); }); } }); a("#arrowchat_edit_flood").unbind('click'); a("#arrowchat_edit_flood").click(function () { a(this).parent().parent().parent(".arrowchat_inner_menu").hide(); a("#arrowchat_flood_select_messages").val(room_limit_msg[Ccr]); a("#arrowchat_flood_select_seconds").val(room_limit_sec[Ccr]); a(".arrowchat_flood_menu").show(); }); a("#arrowchat_flood_button").unbind('click'); a("#arrowchat_flood_button").click(function () { a(".arrowchat_chatroom_item2").click(); var flood_message = a("#arrowchat_flood_select_messages").val(); var flood_seconds = a("#arrowchat_flood_select_seconds").val(); if (!isNaN(flood_message) && !isNaN(flood_seconds)) { a.post(c_ac_path + "includes/json/send/send_settings.php", { chatroom_id: Ccr, flood_message: flood_message, flood_seconds: flood_seconds }, function () { displayMessage("arrowchat_chatroom_message_flyout", lang[155], "notice"); room_limit_msg[Ccr] = flood_message; room_limit_sec[Ccr] = flood_seconds; }); } }); } function receiveUser(b, c, d, e, l, f, h) { if (!(b == null || b == "")) { if ((uc_name[b] == null || uc_name[b] == "") && b.toString().search('facebook') == "-1") { if (aa[b] != 1) { aa[b] = 1; a.ajax({ url: c_ac_path + "includes/json/receive/receive_user.php", data: { userid: b }, type: "post", cache: false, dataType: "json", success: function (o) { if (o) { c = uc_name[b] = o.n; d = uc_status[b] = o.s; e = uc_avatar[b] = o.a; l = uc_link[b] = o.l; if (G[b] != null && typeof($user) != "undefined") { a(".arrowchat_closebox_bottom_status", $user[b]).removeClass("arrowchat_available arrowchat_busy arrowchat_offline").addClass("arrowchat_" + d); $users[b].removeClass("arrowchat_tab_offline").addClass("arrowchat_tab_" + c); $user_popups[b].length > 0 && a(".arrowchat_tabsubtitle .arrowchat_message", $user_popups[b]).html(i) } aa[b] = 0; if (c != null) { toggleUserChatTab(b, c, d, e, l, f); } else { a.post(c_ac_path + "includes/json/send/send_settings.php", { unfocus_chat: b }, function () {}) } } } }) } else { setTimeout(function () { receiveUser(b, uc_name[b], uc_status[b], uc_avatar[b], uc_link[b], f, h) }, 500); } } else { if (b.toString().search('facebook') == "-1") toggleUserChatTab(b, uc_name[b], uc_status[b], uc_avatar[b], uc_link[b], f); else toggleUserChatTab(b, uc_name[b], uc_status[b], uc_avatar[b], uc_link[b], f, 1); } } } function userUploadProcessing(b) { var ts67 = Math.round(new Date().getTime()); var path = c_ac_path.replace("../", "/"); a("#arrowchat_file_transfer_" + b).uploadifive({ 'uploadScript': path + 'includes/classes/class_uploads.php', 'buttonText': ' ', 'buttonClass': 'arrowchat_upload_user_button', 'removeCompleted' : true, 'formData': { 'unixtime': ts67, 'user': u_id }, 'queueID' : 'arrowchat_user_upload_queue_' + b, 'height': 25, 'width': 24, 'multi': false, 'auto': true, 'fileType': '.avi,.bmp,.doc,.docx,.gif,.ico,.jpeg,.jpg,.mp3,.mp4,.pdf,.png,.ppt,.pptx,.rar,.tar,.txt,.wav,.wmv,.xls,.xlsx,.zip,.7z', 'fileSizeLimit' : c_max_upload_size + 'MB', 'onError': function (file, errorCode, errorMsg, errorString) { a(".arrowchat_textarea", $user_popups[b]).focus(); }, 'onCancel': function (file) { a(".arrowchat_textarea", $user_popups[b]).focus(); }, 'onUploadComplete': function (file) { var uploadType = "file", fileType = file.type.toLowerCase(); if (fileType == "image/jpeg" || fileType == "image/gif" || fileType == "image/jpg" || fileType == "image/png") uploadType = "image"; a.post(c_ac_path + "includes/json/send/send_message.php", { userid: u_id, to: b, message: uploadType + "{" + ts67 + "}{" + file.name + "}" }, function (e) { if (a("#arrowchat_message_" + e).length) {} else { var message = ""; if (uploadType == "image") { a(".arrowchat_tabcontenttext", $user_popups[b]).append('
    ' + lang[90] + '
    Image
    '); message = '
    Image
    '; a(".arrowchat_image_msg img,.arrowchat_emoji_text img").one("load", function() { setTimeout(function () { a(".arrowchat_tabcontenttext", $user_popups[b]).scrollTop(a(".arrowchat_tabcontenttext", $user_popups[b])[0].scrollHeight); }, 500); }).each(function() { if(this.complete) a(this).trigger('load'); }); } else { a(".arrowchat_tabcontenttext", $user_popups[b]).append('
    ' + lang[90] + '
    ' + lang[69] + '
    ' + file.name + '
    '); message = '
    ' + lang[69] + '
    ' + file.name + '
    '; } showTimeAndTooltip(); var time = Math.floor((new Date).getTime() / 1E3); var data_array = [e, b, message, time, 1, 1]; lsClick(JSON.stringify(data_array), 'private_message'); } a(".arrowchat_tabcontenttext", $user_popups[b]).scrollTop(a(".arrowchat_tabcontenttext", $user_popups[b])[0].scrollHeight); }); a(".arrowchat_textarea", $user_popups[b]).focus(); userUploadProcessing(b); } }); a(".arrowchat_upload_user_button", $user_popups[b]).mouseenter(function () { a(this).addClass("arrowchat_upload_button_hover") }); a(".arrowchat_upload_user_button", $user_popups[b]).mouseleave(function () { a(this).removeClass("arrowchat_upload_button_hover"); }); } function toggleUserChatTab(b, c, d, e, l, f, jabber) { if (G[b] != null) { if (!$users[b].hasClass("arrowchat_tabclick") && f != 1) { if (j != "") { closePopup($user_popups[j], $users[j]); j = ""; } if (a("#arrowchat_unseenuser_" + b).length > 0) { a("#arrowchat_unseenuser_" + b).click(); } else { $users[b].click(); } } } else { shortname = renderHTMLString(c); longname = renderHTMLString(c); $users[b] = a(ArrowChat.Templates.chat_tab(shortname)).attr('data-id', b).appendTo($chatboxes_wide); $users[b].children('.arrowchat_inner_button').prepend('
    '); $users[b].addClass("arrowchat_tab_" + d); adjustBarSize(); a(".arrowchat_closebox_bottom", $users[b]).mouseenter(function () { a(this).addClass("arrowchat_closebox_bottomhover") }); a(".arrowchat_closebox_bottom", $users[b]).mouseleave(function () { a(this).removeClass("arrowchat_closebox_bottomhover"); }); a(".arrowchat_closebox_bottom", $users[b]).click(function () { lsClick(".arrowchat_closebox_bottom", 'ac_click', "users['"+b+"']"); a.post(c_ac_path + "includes/json/send/send_settings.php", { close_chat: b, tab_alert: 1 }, function () {}); $user_popups[b].remove(); $users[b].remove(); if (j == b) j = ""; adjustBarSize(); y[b] = null; G[b] = null; ca[b] = 0; }); i = c = ""; if (l != "") { c = ''; i = "" } l = ""; if (e != "") l = '
    ' + c + '' + i + "
    "; $user_popups[b] = a(ArrowChat.Templates.chat_window(c, longname, i, l, b)).css("display", "none").appendTo($body); if (c_video_chat != 1) { a("#arrowchat_video_chat_" + b).hide(); } if (c_enable_moderation != 1) { a("#arrowchat_report_" + b).hide(); } if (c_popout_on != 1) { a(".arrowchat_chat_popout").hide(); } addHover(a(".arrowchat_video_chat"), "arrowchat_more_hover"); a(".arrowchat_tabcontenttext", $user_popups[b]).click(function () { if (window.getSelection().toString().length) {} else { a(".arrowchat_textarea", $user_popups[b]).focus(); } }); a(".arrowchat_textarea", $user_popups[b]).focusin(function() { a(".arrowchat_tabtitle", $user_popups[b]).addClass("arrowchat_typing_title"); }); a(".arrowchat_textarea", $user_popups[b]).focusout(function() { a(".arrowchat_tabtitle", $user_popups[b]).removeClass("arrowchat_typing_title"); }); if (c_file_transfer == 1) { userUploadProcessing(b); } if (uc_status[b] == 'offline' || (uc_status[b] == 'busy' && c_video_select != 2 && c_video_select != 3)) a(".arrowchat_tabtitle .arrowchat_video_icon", $user_popups[b]).addClass("arrowchat_video_unavailable"); else a(".arrowchat_tabtitle .arrowchat_video_icon", $user_popups[b]).removeClass("arrowchat_video_unavailable"); a("#arrowchat_video_chat_" + b).click(function () { if (uc_status[b] != 'offline' && (uc_status[b] != 'busy' || c_video_select == 2 || c_video_select == 3)) { var RN = Math.floor(Math.random() * 9999999999); while (String(RN).length < 10) { RN = '0' + RN; } if (c_video_select == 4 || c_video_select == 1) RN = encodeURI(location.host).replace(/\./g, '') + RN; if (c_video_select == 2) { a.ajax({ type:"post", url: c_ac_path + "public/video/video_session.php", data: { room: RN }, async: false, success: function(sess) { jqac.arrowchat.videoWith(sess); a.post(c_ac_path + "includes/json/send/send_message.php", { userid: u_id, to: b, message: "video{" + sess + "}" }, function (e) { if (e == "-1") { displayMessage("arrowchat_chatbox_message_flyout_" + b, lang[102], "error"); } else { displayMessage("arrowchat_chatbox_message_flyout_" + b, lang[63], "notice"); } a(".arrowchat_tabcontenttext", $user_popups[b]).scrollTop(a(".arrowchat_tabcontenttext", $user_popups[b])[0].scrollHeight); }); } }); } else { jqac.arrowchat.videoWith(RN); a.post(c_ac_path + "includes/json/send/send_message.php", { userid: u_id, to: b, message: "video{" + RN + "}" }, function (e) { if (e == "-1") { displayMessage("arrowchat_chatbox_message_flyout_" + b, lang[102], "error"); } else { displayMessage("arrowchat_chatbox_message_flyout_" + b, lang[63], "notice"); } a(".arrowchat_tabcontenttext", $user_popups[b]).scrollTop(a(".arrowchat_tabcontenttext", $user_popups[b])[0].scrollHeight); }); } } }); preventScrolling(a(".arrowchat_tabcontenttext, .arrowchat_emoji_wrapper")); preventScrolling(a(".arrowchat_giphy_image_wrapper")); a(".arrowchat_emoji_selector", $user_popups[b]).click(function() { if (!a(this).hasClass("arrowchat_emoji_focused")) { a(".arrowchat_emoji_wrapper", $user_popups[b]).html('
    '); a(".arrowchat_emoji_selector", $user_popups[b]).removeClass("arrowchat_emoji_focused"); a(this).addClass("arrowchat_emoji_focused"); var load_id = a(this).attr("data-id"); a.ajax({ url: c_ac_path + 'includes/emojis/' + load_id + '.php', type: "GET", cache: true, success: function(html) { a(".arrowchat_emoji_wrapper", $user_popups[b]).html(html); a(".arrowchat_emoji", $user_popups[b]).click(function () { if (a(this).hasClass("arrowchat_emoji_custom")) var smiley_code = a(this).children('img').attr("data-id"); else var smiley_code = a(this).html(); var existing_text = a(".arrowchat_textarea", $user_popups[b]).val(); a(".arrowchat_textarea", $user_popups[b]).focus().val('').val(existing_text + smiley_code); }); } }); } }); a(".arrowchat_emoji_smileys").mouseover(function(){showTooltip(a(this), lang[230], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_emoji_animals").mouseover(function(){showTooltip(a(this), lang[231], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_emoji_food").mouseover(function(){showTooltip(a(this), lang[232], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_emoji_activities").mouseover(function(){showTooltip(a(this), lang[233], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_emoji_travel").mouseover(function(){showTooltip(a(this), lang[234], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_emoji_objects").mouseover(function(){showTooltip(a(this), lang[235], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_emoji_symbols").mouseover(function(){showTooltip(a(this), lang[236], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_emoji_flags").mouseover(function(){showTooltip(a(this), lang[237], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_emoji_custom").mouseover(function(){showTooltip(a(this), lang[238], true, 15);}).mouseout(function(){hideTooltip();}); a(".arrowchat_smiley_button", $user_popups[b]).mouseenter(function () { a(this).addClass("arrowchat_smiley_button_hover") }); a(".arrowchat_smiley_button", $user_popups[b]).mouseleave(function () { a(this).removeClass("arrowchat_smiley_button_hover"); }); a(".arrowchat_smiley_button", $user_popups[b]).click(function () { if (a(".arrowchat_giphy_popout", $user_popups[b]).children(".arrowchat_more_popout").is(":visible")) { a(".arrowchat_giphy_popout", $user_popups[b]).children(".arrowchat_more_popout").hide(); } if (a(".arrowchat_smiley_popout", $user_popups[b]).children(".arrowchat_more_popout").is(":visible")) { a(".arrowchat_smiley_popout", $user_popups[b]).children(".arrowchat_more_popout").hide(); } else { if (!a(".arrowchat_emoji_selector", $user_popups[b]).hasClass("arrowchat_emoji_focused")) { a(".arrowchat_emoji_wrapper", $user_popups[b]).html('
    '); a(".arrowchat_emoji_selector", $user_popups[b]).removeClass("arrowchat_emoji_focused"); a(".arrowchat_emoji_smileys", $user_popups[b]).addClass("arrowchat_emoji_focused"); a.ajax({ url: c_ac_path + 'includes/emojis/emoji_smileys.php', type: "GET", cache: true, success: function(html) { a(".arrowchat_emoji_wrapper", $user_popups[b]).html(html); a(".arrowchat_emoji", $user_popups[b]).click(function () { if (a(this).hasClass("arrowchat_emoji_custom")) var smiley_code = a(this).children('img').attr("data-id"); else var smiley_code = a(this).html(); var existing_text = a(".arrowchat_textarea", $user_popups[b]).val(); a(".arrowchat_textarea", $user_popups[b]).focus().val('').val(existing_text + smiley_code); }); } }); } a(".arrowchat_textarea", $user_popups[b]).focus(); a(".arrowchat_smiley_popout", $user_popups[b]).children(".arrowchat_more_popout").show(); } }).children().click(function(e){ return false; }); a(".arrowchat_giphy_button", $user_popups[b]).mouseenter(function () { a(this).addClass("arrowchat_giphy_button_hover") }); a(".arrowchat_giphy_button", $user_popups[b]).mouseleave(function () { a(this).removeClass("arrowchat_giphy_button_hover"); }); a(".arrowchat_giphy_button", $user_popups[b]).click(function () { if (a(".arrowchat_smiley_popout", $user_popups[b]).children(".arrowchat_more_popout").is(":visible")) { a(".arrowchat_smiley_popout", $user_popups[b]).children(".arrowchat_more_popout").hide(); } if (a(".arrowchat_giphy_popout", $user_popups[b]).children(".arrowchat_more_popout").is(":visible")) { a(".arrowchat_giphy_popout", $user_popups[b]).children(".arrowchat_more_popout").hide(); } else { a(".arrowchat_giphy_popout", $user_popups[b]).children(".arrowchat_more_popout").show(); a(".arrowchat_giphy_search", $user_popups[b]).val(''); a(".arrowchat_giphy_search", $user_popups[b]).focus(); loadGiphy('https://api.giphy.com/v1/gifs/trending?api_key=IOYyr4NK5ldaU&limit=20', 1, b); } }).children().click(function(e){ return false; }); a(".arrowchat_giphy_search", $user_popups[b]).keyup(function () { a(".arrowchat_giphy_image_wrapper", $user_popups[b]).html('
    '); if (a(".arrowchat_giphy_search", $user_popups[b]).val() == '') loadGiphy('https://api.giphy.com/v1/gifs/trending?api_key=IOYyr4NK5ldaU&limit=20', 1, b); else loadGiphy('https://api.giphy.com/v1/gifs/search?api_key=IOYyr4NK5ldaU&limit=20&q=' + a(".arrowchat_giphy_search", $user_popups[b]).val(), 1, b); }); if (c_file_transfer != 1) {a("#arrowchat_file_transfer_" + b).hide();a(".arrowchat_tabcontentinput", $user_popups[b]).addClass("arrowchat_no_file_upload")} if (c_disable_smilies == 1) {a(".arrowchat_smiley_button").hide();a(".arrowchat_tabcontentinput", $user_popups[b]).addClass("arrowchat_no_smiley")} if (c_giphy == 1) {a(".arrowchat_giphy_button", $user_popups[b]).hide();a(".arrowchat_tabcontentinput", $user_popups[b]).addClass("arrowchat_no_giphy")} a(".arrowchat_tabtitle .arrowchat_more_button", $user_popups[b]).mouseenter(function () { showTooltip(a(this), lang[23], 0, 10, 5); a(this).addClass("arrowchat_more_button_hover"); a(".arrowchat_tabtitle", $user_popups[b]).removeClass("arrowchat_chatboxtabtitlemouseover") }); a(".arrowchat_tabtitle .arrowchat_more_button", $user_popups[b]).mouseleave(function () { hideTooltip(); a(this).removeClass("arrowchat_more_button_hover"); a(".arrowchat_tabtitle", $user_popups[b]).addClass("arrowchat_chatboxtabtitlemouseover") }); a("#arrowchat_more_" + b).click(function () { hideTooltip(); a("#arrowchat_more_popout_" + b).toggle(); a(this).addClass("arrowchat_more_button_hover"); a(this).toggleClass("arrowchat_more_button_selected"); }); a("#arrowchat_block_" + b).click(function () { a("#arrowchat_more_popout_" + b).toggle(); a("#arrowchat_more_" + b).toggleClass("arrowchat_more_button_selected"); a(".arrowchat_tabtitle .arrowchat_closebox", $user_popups[b]).click(); a.post(c_ac_path + "includes/json/send/send_settings.php", { block_chat: b }, function () { if (typeof(blockList[b]) == "undefined") { blockList[b] = b; } loadBuddyList(); }) }); a("#arrowchat_clear_" + b).click(function () { a("#arrowchat_more_popout_" + b).toggle(); a("#arrowchat_more_" + b).toggleClass("arrowchat_more_button_selected"); a("#arrowchat_tabcontenttext_" + b).html(""); a.post(c_ac_path + "includes/json/send/send_settings.php", { clear_chat: b }, function () {}) }); a("#arrowchat_report_" + b).click(function () { a("#arrowchat_more_popout_" + b).toggle(); a("#arrowchat_more_" + b).toggleClass("arrowchat_more_button_selected"); a.post(c_ac_path + "includes/json/send/send_settings.php", { report_from: u_id, report_about: b }, function () { displayMessage("arrowchat_chatbox_message_flyout_" + b, lang[168], "notice"); }); }); a(".arrowchat_textarea", $user_popups[b]).keydown(function (h) { return userchatKeydown(h, a(this), b, jabber) }); a(".arrowchat_textarea", $user_popups[b]).keyup(function (h) { return userchatKeyup(h, a(this), b) }); a(".arrowchat_tabtitle .arrowchat_closebox", $user_popups[b]).mouseenter(function () { showTooltip(a(this), lang[89], 0, 10, 5); a(this).addClass("arrowchat_chatboxmouseoverclose"); a(".arrowchat_tabtitle", $user_popups[b]).removeClass("arrowchat_chatboxtabtitlemouseover") }); a(".arrowchat_tabtitle .arrowchat_closebox", $user_popups[b]).mouseleave(function () { a(this).removeClass("arrowchat_chatboxmouseoverclose"); a(".arrowchat_tabtitle", $user_popups[b]).addClass("arrowchat_chatboxtabtitlemouseover"); hideTooltip(); }); a(".arrowchat_tabtitle .arrowchat_closebox", $user_popups[b]).click(function () { lsClick(".arrowchat_tabtitle .arrowchat_closebox", 'ac_click', "user_popups['"+b+"']"); hideTooltip(); a.post(c_ac_path + "includes/json/send/send_settings.php", { close_chat: b, tab_alert: 1 }, function () {}); $user_popups[b].remove(); $users[b].remove(); if (j == b) j = ""; adjustBarSize(); G[b] = null; y[b] = null; ca[b] = 0; }); a(".arrowchat_tabtitle .arrowchat_video_icon", $user_popups[b]).mouseenter(function () { if (uc_status[b] == 'offline' || (uc_status[b] == 'busy' && c_video_select != 2 && c_video_select != 3)) { showTooltip(a(this), lang[146], 0, 10, 5); } else { showTooltip(a(this), lang[88], 0, 10, 5); a(this).addClass("arrowchat_video_icon_hover"); } a(".arrowchat_tabtitle", $user_popups[b]).removeClass("arrowchat_chatboxtabtitlemouseover") }); a(".arrowchat_tabtitle .arrowchat_video_icon", $user_popups[b]).mouseleave(function () { a(this).removeClass("arrowchat_video_icon_hover"); a(".arrowchat_tabtitle", $user_popups[b]).addClass("arrowchat_chatboxtabtitlemouseover"); hideTooltip(); }); a(".arrowchat_more_popout .arrowchat_chat_popout", $user_popups[b]).click(function () { a("#arrowchat_more_popout_" + b).toggle(); a("#arrowchat_more_" + b).toggleClass("arrowchat_more_button_selected"); startPopoutChat(); }); a(".arrowchat_more_popout .arrowchat_chat_popout", $user_popups[b]).popupWindow({ windowURL: c_ac_path + "public/popout/", height: 620, width: 940, top: 25, left: 25 }); a(".arrowchat_tabtitle", $user_popups[b]).not('.arrowchat_video_icon').click(function () { $users[b].click() }).children().not('.arrowchat_tab_name').click(function () { return false; }); a(".arrowchat_tabtitle", $user_popups[b]).mouseenter(function () { a(this).addClass("arrowchat_chatboxtabtitlemouseover") }); a(".arrowchat_tabtitle", $user_popups[b]).mouseleave(function () { a(this).removeClass("arrowchat_chatboxtabtitlemouseover") }); $users[b].mouseenter(function () { a(this).addClass("arrowchat_tabmouseover"); a("div", $users[b]).addClass("arrowchat_tabmouseovertext") }); $users[b].mouseleave(function () { a(this).removeClass("arrowchat_tabmouseover"); a("div", $users[b]).removeClass("arrowchat_tabmouseovertext") }); $users[b].click(function () { lsClick(" ", 'ac_openclose', "users['"+b+"']"); var tba = 0; if (a(".arrowchat_tabalert", $users[b]).length > 0) { tba = 1; a(".arrowchat_tabalert", $users[b]).remove(); $users[b].removeClass("arrowchat_tab_new_message"); G[b] = 0; y[b] = 0; } if (a(this).hasClass("arrowchat_tabclick")) { closePopup($user_popups[b], a(this)); a(".arrowchat_closebox_bottom", $users[b]).removeClass("arrowchat_closebox_bottom_click"); j = ""; a.post(c_ac_path + "includes/json/send/send_settings.php", { unfocus_chat: b, tab_alert: 1 }, function () {}) } else { if (j != "") { closePopup($user_popups[j], $users[j]); a(".arrowchat_closebox_bottom", $users[j]).removeClass("arrowchat_closebox_bottom_click"); j = "" } if (ca[b] != 1) { receiveHistory(b); ca[b] = 1 } a.post(c_ac_path + "includes/json/send/send_settings.php", { focus_chat: b, tab_alert: tba }, function () {}); $user_popups[b].css("left", $users[b].offset().left).css("bottom", "25px"); a(this).addClass("arrowchat_tabclick").addClass("arrowchat_usertabclick"); $user_popups[b].addClass("arrowchat_tabopen"); a(".arrowchat_closebox_bottom", $users[b]).addClass("arrowchat_closebox_bottom_click"); j = b; if (W) { $user_popups[j].css("position", "absolute").css("top", parseInt(a(window).height()) - parseInt($user_popups[j].css("bottom")) - parseInt($user_popups[j].height()) + a(window).scrollTop() + "px") } } adjustBarSize(); a(".arrowchat_tabcontenttext", $user_popups[b]).scrollTop(a(".arrowchat_tabcontenttext", $user_popups[b])[0].scrollHeight); getStatus("updatingsession") != 1 && a(".arrowchat_textarea", $user_popups[b]).focus() }); if (f != 1) { if (a("#arrowchat_chatbox_left").is(":visible")) { swapTab(b); } else { $users[b].click(); } } y[b] = 0; G[b] = 0; if (c_disable_avatars == 1) { a(".arrowchat_avatarbox").hide(); a("#arrowchat_setting_names_only").parent("li").hide(); } } } function formatTimestamp(b, noHTML) { var c = "am", d = b.getHours(), i = b.getMinutes(), e = b.getDate(); b = b.getMonth(); var g = d; if (d > 11) c = "pm"; if (d > 12) d -= 12; if (d == 0) d = 12; if (d < 10) d = d; if (i < 10) i = "0" + i; var l = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], f = "th"; if (e == 1 || e == 21 || e == 31) f = "st"; else if (e == 2 || e == 22) f = "nd"; else if (e == 3 || e == 23) f = "rd"; if (noHTML) { if (c_us_time != 1) { return e != Na ? '' + g + ":" + i + " " + e + f + " " + l[b] + "" : '' + g + ":" + i + "" } else { return e != Na ? '' + d + ":" + i + c + " " + e + f + " " + l[b] + "" : '' + d + ":" + i + c + "" } } else { if (c_us_time != 1) { return e != Na ? '' + g + ":" + i + " " + e + f + " " + l[b] + "" : '' + g + ":" + i + "" } else { return e != Na ? '' + d + ":" + i + c + " " + e + f + " " + l[b] + "" : '' + d + ":" + i + c + "" } } } function receiveHistory(b, times) { if (times) {} else times = 1; if (times > 1) { a('
    Loading
    ').prependTo(a("#arrowchat_tabcontenttext_" + b)); } a.ajax({ cache: false, url: c_ac_path + "includes/json/receive/receive_history.php", data: { chatbox: b, history: times }, type: "post", dataType: "json", success: function (c) { a(".arrowchat_message_history_loading").remove(); history_ids[b] = 0; numMessages = 0; if (c) { if (times == 1) a(".arrowchat_tabcontenttext", $user_popups[b]).html(""); last_sent[b] = null; var d = "", i = uc_name[b], init = false, unhide_avatars = []; a.each(c, function (e, l) { e == "messages" && a.each(l, function (f, h) { numMessages++; f = ""; if (h.self == 1) { fromname = u_name; fromid = u_id; f = " arrowchat_self"; _aa5 = _aa4 = ""; avatar = u_avatar; } else { fromname = i; fromid = b; _aa4 = ''; _aa5 = ""; avatar = uc_avatar[h.from]; } if (last_name[h.from] != fromid && typeof(last_name[h.from]) != "undefined") { unhide_avatars.push(last_id[h.from]); } var image_msg = ""; var o = new Date(h.sent * 1E3); tooltip = formatTimestamp(o, 1); if (c_show_full_name != "1") { if (fromname.indexOf(" ") != -1) fromname = fromname.slice(0, fromname.indexOf(" ")); } if (h.message.substr(0, 4) == "' + formatTimestamp(o) + '
    ' + fromname + '
    ' + fromname + ' ' + tooltip + '
    ' + h.message + "
    "; last_sent[h.from] = h.sent; last_name[h.from] = fromid; last_id[h.from] = h.id; init = true; }) }); var current_top_element = a("#arrowchat_tabcontenttext_" + b).children('div').first('div'); if (times > 1) { a(d).prependTo(a("#arrowchat_tabcontenttext_" + b).first('div')); } else { a("#arrowchat_tabcontenttext_" + b).html("
    " + d + "
    "); } if (a("#arrowchat_message_" + last_id[b]).length) { a("#arrowchat_message_" + last_id[b]).children('.arrowchat_chatboxmessagefrom').children('.arrowchat_chatbox_avatar').removeClass('arrowchat_single_avatar_hide'); } a.each(unhide_avatars, function(key, value) { if (a("#arrowchat_message_" + value).length) { a("#arrowchat_message_" + value).children('.arrowchat_chatboxmessagefrom').children('.arrowchat_chatbox_avatar').removeClass('arrowchat_single_avatar_hide'); } }); showTimeAndTooltip(); if (c_disable_avatars == 1 || a("#arrowchat_setting_names_only :input").is(":checked")) { setAvatarVisibility(1); } var previous_height = 0; current_top_element.prevAll().each(function() { previous_height += a(this).outerHeight(); }); if (times == 1) a("#arrowchat_tabcontenttext_" + b).scrollTop(5E4); else a("#arrowchat_tabcontenttext_" + b).scrollTop(previous_height); a("#arrowchat_tabcontenttext_" + b).scroll(function(){ if (a("#arrowchat_tabcontenttext_" + b).scrollTop() < 50 && history_ids[b] != 1) { history_ids[b] = 1; if (numMessages == 20) { times++; receiveHistory(b, times); } } }); if (times == 1) { a(".arrowchat_image_msg img,.arrowchat_emoji_text img").one("load", function() { a("#arrowchat_tabcontenttext_" + b).scrollTop(5E4); }).each(function() { if(this.complete) a(this).trigger('load'); }); } } } }) } function showTimeAndTooltip() { a(".arrowchat_chatboxmessagecontent").mouseenter(function () { if (a(this).parent().parent().hasClass('arrowchat_self')) showTooltip(a(this), a(this).attr("data-id"), false, 10, 0, false, 1); else showTooltip(a(this), a(this).attr("data-id"), false, a(this).parent().width() + 10, 0, 1, false); }); a(".arrowchat_chatboxmessagecontent").mouseleave(function () { hideTooltip(); }); a(".arrowchat_chatboxmessage").mouseenter(function () { a(this).children(".arrowchat_ts").show(); }); a(".arrowchat_chatboxmessage").mouseleave(function () { a(this).children(".arrowchat_ts").hide(); }); a(".arrowchat_lightbox").unbind('click'); a(".arrowchat_lightbox").click(function (){ a.slimbox(a(this).attr('data-id'), ''+lang[70]+'', {resizeDuration:1, overlayFadeDuration:1, imageFadeDuration:1, captionAnimationDuration:1}); }); } function showChatroomTime() { a(".arrowchat_chatroom_message_content").mouseenter(function () { if (a(this).parent().hasClass('arrowchat_self')) showTooltip(a(this), a(this).attr("data-id"), false, 10, 0, false, 1); else showTooltip(a(this), a(this).attr("data-id"), false, a(this).width() + 25, 0, 1, false); }); a(".arrowchat_chatroom_message_content").mouseleave(function () { hideTooltip(); }); a(".arrowchat_lightbox").unbind('click'); a(".arrowchat_lightbox").click(function (){ a.slimbox(a(this).attr('data-id'), ''+lang[70]+'', {resizeDuration:1, overlayFadeDuration:1, imageFadeDuration:1, captionAnimationDuration:1}); }); } function notifyNewMessage(b, c, d) { if (uc_name[b] == null || uc_name[b] == "") setTimeout(function () { notifyNewMessage(b, c, d) }, 500); else { receiveUser(b, uc_name[b], uc_status[b], uc_avatar[b], uc_link[b], 1); if (d == 1) if (a(".arrowchat_tabalert", $users[b]).length > 0) c = parseInt(a(".arrowchat_tabalert", $users[b]).html()) + parseInt(c); if (c == 0) { $users[b].removeClass("arrowchat_tab_new_message"); a(".arrowchat_tabalert", $users[b]).remove() } else { if (a(".arrowchat_tabalert", $users[b]).length > 0) { a(".arrowchat_tabalert", $users[b]).html(c); } else a("
    ").css("top", "-11px").css("left", "112px").addClass("arrowchat_tabalert").html(c).appendTo($users[b]); $users[b].removeClass("arrowchat_tab_new_message").addClass("arrowchat_tab_new_message") } y[b] = c; adjustBarSize(); } } function setAvatarVisibility(b) { if (b == 1) { a(".arrowchat_userlist_avatar").addClass("arrowchat_hide_avatars"); a(".arrowchat_chatroom_avatar").addClass("arrowchat_hide_avatars"); a(".arrowchat_chatroom_flyout_avatar").addClass("arrowchat_hide_avatars"); a(".arrowchat_chatroom_message_avatar").addClass("arrowchat_hide_avatars"); a(".arrowchat_chatroom_message_name").show(); a(".arrowchat_chatroom_message_avatar").removeClass("arrowchat_no_names"); a(".arrowchat_chatbox_avatar").hide(); a(".arrowchat_disable_avatars_name").show(); a(".arrowchat_chatboxmessage_wrapper").addClass("arrowchat_chatboxmessage_wrapper2"); a(".arrowchat_chatboxmessagecontent").addClass("arrowchat_chatboxmessagecontent2"); } else { a(".arrowchat_userlist_avatar").removeClass("arrowchat_hide_avatars"); a(".arrowchat_chatroom_avatar").removeClass("arrowchat_hide_avatars"); a(".arrowchat_chatroom_flyout_avatar").removeClass("arrowchat_hide_avatars"); a(".arrowchat_chatroom_message_avatar").removeClass("arrowchat_hide_avatars"); a(".arrowchat_chatroom_message_name").hide(); a(".arrowchat_chatroom_message_avatar").addClass("arrowchat_no_names"); a(".arrowchat_chatbox_avatar").show(); a(".arrowchat_disable_avatars_name").hide(); a(".arrowchat_chatboxmessage_wrapper").removeClass("arrowchat_chatboxmessage_wrapper2"); a(".arrowchat_chatboxmessagecontent").removeClass("arrowchat_chatboxmessagecontent2"); } } function buildBuddyListTab() { var d = ""; $buddy_list_tab = a("
    ").attr("id", "arrowchat_buddy_list_tab").addClass("arrowchat_bar_button").addClass("arrowchat_bar_right").html(ArrowChat.Templates.buddylist_tab()).appendTo($base); $userstab_popup = a("
    ").attr("id", "arrowchat_userstab_popup").addClass("arrowchat_tabpopup").css("display", "none").html(ArrowChat.Templates.buddylist_window(d, _ts, acp)).appendTo($body); if (c_disable_avatars == 1) { a("#arrowchat_name_box").hide(); a("#arrowchat_setting_names_only").parent("li").hide(); } $buddy_list_tab.css("width", c_width_blist + "px"); if (c_width_blist <= 25) { a("#arrowchat_userstab_text").hide(); } if (c_theme_change != 1) { a(".arrowchat_theme_button").hide(); } a(".arrowchat_powered_by").css("display", "none"); a(".arrowchat_search_friends_text").placeholder(); if (u_sounds == 1) { a("#arrowchat_setting_sound :input").prop("checked", true) } else { a("#arrowchat_setting_sound").addClass("arrowchat_menu_unchecked"); a("#arrowchat_setting_sound :input").prop("checked", false) } if (u_blist_open == 1) { a("#arrowchat_setting_window_open :input").prop("checked", true) } else { a("#arrowchat_setting_window_open").addClass("arrowchat_menu_unchecked"); a("#arrowchat_setting_window_open :input").prop("checked", false) } if (u_no_avatars == 1) { a("#arrowchat_setting_names_only :input").prop("checked", true) } else { a("#arrowchat_setting_names_only").addClass("arrowchat_menu_unchecked"); a("#arrowchat_setting_names_only :input").prop("checked", false); } u_is_guest == 1 && c_guest_name_change == 1 && u_guest_name == "" && a(".arrowchat_enter_name_wrapper").show(); a("#arrowchat_guest_name_input").placeholder(); a("#arrowchat_guest_name_input").keydown(function (h) { if (h.keyCode == 13) { var new_name = a(this).val(); a.post(c_ac_path + "includes/json/send/send_settings.php", { chat_name: new_name }, function (data) { if (data != "1") { displayMessage("arrowchat_buddylist_message_flyout", data, "error"); } else { a(".arrowchat_enter_name_wrapper").slideUp("fast"); u_name = new_name; } }); } }); a(".arrowchat_search_friends_text").keyup(function () { if (typeof(searchxhr) != "undefined") searchxhr.abort(); a(".arrowchat_search_not_found").remove(); a("#arrowchat_userscontent").children('div').not('.arrowchat_userslist_offline').hide(); a("
    ").attr("class", "arrowchat_search_not_found arrowchat_nofriends").html('
    ').prependTo("#arrowchat_userscontent"); clearTimeout(Z); adjustBarSize(); var i = 0, c = "", d = "", f = a(this).val(); if (f.length < 2) { a(".arrowchat_search_not_found").remove(); a("#arrowchat_userscontent").children('div').not('#arrowchat_userslist_offline').show(); if (buddylisttest == 2) loadBuddyList(); buddylisttest = 1; } else { buddylisttest = 2; if (a("#arrowchat_setting_names_only :input").is(":checked")) d = "arrowchat_hide_avatars"; searchxhr = a.ajax({ url: c_ac_path + "includes/json/receive/receive_search.php", type: "post", cache: false, dataType: "json", data: { search_name: f }, success: function (b) { if (b && b != null) { a.each(b, function (e, l) { a.each(l, function (f, h) { if (typeof(uc_avatar[h.id]) != "undefined") var ava = uc_avatar[h.id]; else var ava = h.avatar; if (c_disable_avatars == 1 || a("#arrowchat_setting_names_only :input").is(":checked")) d = "arrowchat_hide_avatars"; c += '
    ' + h.name + '
    '; i++; }); }); if (i == 0) { a(".arrowchat_search_not_found").html(lang[26]); } else { a(".arrowchat_search_not_found").remove(); a('#arrowchat_userslist_available').show().html(c); a(".arrowchat_userlist").click(function (l) { receiveUserFromUserlist(l.target) }); } } adjustBarSize(); } }); } adjustBarSize(); }); a(document).bind("idle.idleTimer", function () { if (w != 1) { clearUserStatus(); a("#arrowchat_userstab_icon").addClass("arrowchat_user_away2"); setUserStatus("away"); isAway = 1; } }); a(document).bind("active.idleTimer", function () { if (w != 1) { clearUserStatus(); setUserStatus("available"); a("#arrowchat_userstab_icon").addClass("arrowchat_user_available2"); isAway = 0; } }); a.idleTimer(60000 * ArrowChat.IdleTime); a("#arrowchat_theme_button").click(function () { a("#arrowchat_theme_flyout").toggleClass("arrowchat_theme_flyout_display"); a(".arrowchat_theme_link").addClass("arrowchat_theme_button_hover"); a(".arrowchat_theme_link").toggleClass("arrowchat_more_button_selected"); var theme_switch = a(".arrowchat_themeswitcher").val(); a.post(c_ac_path + "includes/json/send/send_settings.php", { theme: theme_switch }, function (theme) { a("#arrowchat_css").attr({ href: c_ac_path + "external.php?type=css&t=" + theme_switch }); window.location.reload(); }); }); a("#arrowchat_setting_sound").click(function () { lsClick("#arrowchat_setting_sound", 'ac_click'); a(this).toggleClass("arrowchat_menu_unchecked"); if (a("#arrowchat_setting_sound :input").is(":checked")) { a("#arrowchat_setting_sound :input").prop("checked", false); _soundcheck = -1; u_sounds = 0; } else { a("#arrowchat_setting_sound :input").prop("checked", true); _soundcheck = 1; u_sounds = 1; } a.post(c_ac_path + "includes/json/send/send_settings.php", { sound: _soundcheck }, function () { }); }); a("#arrowchat_setting_window_open").click(function () { a(this).toggleClass("arrowchat_menu_unchecked"); if (a("#arrowchat_setting_window_open :input").is(":checked")) { a("#arrowchat_setting_window_open :input").prop("checked", false); _windowcheck = -1 } else { a("#arrowchat_setting_window_open :input").prop("checked", true); _windowcheck = 1 } a.post(c_ac_path + "includes/json/send/send_settings.php", { window: _windowcheck }, function () { }); }); a("#arrowchat_setting_names_only").click(function () { lsClick("#arrowchat_setting_names_only", 'ac_click'); a(this).toggleClass("arrowchat_menu_unchecked"); if (a("#arrowchat_setting_names_only :input").is(":checked")) { a("#arrowchat_setting_names_only :input").prop("checked", false); setAvatarVisibility(0); _namecheck = -1 } else { a("#arrowchat_setting_names_only :input").prop("checked", true); setAvatarVisibility(1); _namecheck = 1 } a.post(c_ac_path + "includes/json/send/send_settings.php", { name: _namecheck }, function () { }); }); a("#arrowchat_setting_block_list").click(function () { a(this).parent().parent(".arrowchat_inner_menu").hide(); a(".arrowchat_block_menu").show(); a.ajax({ url: c_ac_path + "includes/json/receive/receive_block_list.php", type: "get", cache: false, dataType: "json", success: function (b) { if (b && b != null) { a(".arrowchat_block_menu select").html(""); a("