Advertisement
Guest User

Epik Chat Menu - For Educational Purposes

a guest
Dec 26th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. //EPIK CHAT - [MENU BASED] [ZALGO-TRIGGER/CONTENT-LENGTH-DISPLAY/PARROT/AUTO-POKE/ZALGO-EDITOR]
  3. //Crafted by Asmodeus 2018
  4.  
  5. //To use zalgo, Write a message and presses # key
  6.  
  7. //Use your prefered injector
  8.  
  9. var idleTime = 0;
  10. var doubleNotif = false;
  11. var autoPoke = false;
  12. var lengthdisplay = false;
  13.  
  14. //UI INJECT
  15. document.getElementById("chatTextWrapper").innerHTML +=
  16.     "<center><div style='display:none; background:white;' id='infoPanel'></div></center>" +
  17.     "<div style='position: absolute; top:5px; right: 21px; border-radius: 5px; padding: 4px;' id='hiddenmenu'><a href='#' onclick='openCloseMenu()' class='btn btn-danger' style='width:100%;'>EPIK MENU</a></div>" +
  18.     "<form id='asmomenu' style='display:none; position: absolute; top:5px; right: 21px; background: grey; border-radius: 5px; padding: 4px;' id='asmodeus_form' action=''>" +
  19.     "   <font style='border-radius:5px; background:red;padding:2px 2px 2px 2px;'>ASMODEUS PANEL</font><br>" +
  20.     "   <a href='#' id='initialiser' onclick='initSocket()' class='btn btn-primary' style='width:100%;'>Initalise Abilities</a>" +
  21.     "   <a href='#' onclick='openCloseMenu()' class='btn btn-danger' style='width:100%;'>Close Menu</a>" +
  22.     "   <div id='menu'></div>"
  23.     "</form>";
  24.    
  25. //MENU BOOL OPEN-CLOSE
  26. var menudisplay = ["block", "none"];
  27. function openCloseMenu() {
  28.     document.getElementById('asmomenu').style.display = menudisplay[0];
  29.     document.getElementById('hiddenmenu').style.display = menudisplay[1];
  30.     swapTemp = menudisplay[0];
  31.     swapTemp2 = menudisplay[1];
  32.     menudisplay[0] = swapTemp2;
  33.     menudisplay[1] = swapTemp;
  34. }
  35.  
  36. //MENU BOOL SHOW LENGTH
  37. var showhide = ["block", "none"];
  38. function showContentLength() {
  39.     document.getElementById('infoPanel').style.display = showhide[0];
  40.     swapTemp = showhide[0];
  41.     swapTemp2 = showhide[1];
  42.     showhide[0] = swapTemp2;
  43.     showhide[1] = swapTemp;
  44. }
  45.  
  46. //VARIABLE TIMER INTERVAL
  47. setInterval(function () { //JUST USE A TIMER, COULD USE A HANDLER
  48.     try {
  49.         //DYNAMIC ADDED BUTTONS
  50.         document.getElementById('parrot').innerHTML = "PARROT [" + doubleNotif + "]";
  51.         document.getElementById('poke').innerHTML = "AUTO POKE [" + autoPoke + "]";
  52.         document.getElementById('contentlength').innerHTML = "SHOW LENGTH [" + lengthdisplay + "]";
  53.  
  54.         //Emoji :E REPLACE
  55.         if (document.getElementsByClassName('emojionearea-editor')[0].innerHTML.indexOf(":E") > -1) {
  56.             document.getElementsByClassName('emojionearea-editor')[0].innerHTML = document.getElementsByClassName('emojionearea-editor')[0].innerHTML.replace(":E", ":sunglasses:");
  57.         }
  58.  
  59.         //CONTENT LENGTH DISPLAY
  60.         document.getElementById('infoPanel').innerHTML = "Content Length: " + document.getElementsByClassName('emojionearea-editor')[0].innerHTML.length;
  61.  
  62.         //ZALGO----------------------------------------------------------
  63.         if (document.getElementsByClassName('emojionearea-editor')[0].innerHTML.indexOf("#") > -1) {
  64.             asmodeus_textarea('asmodeus_txt');
  65.         }
  66.         //End ZALGO-------------------------------------------------------
  67.     } catch (ex) {
  68.         console.log("ERROR: " + ex);
  69.     }
  70. }, 100);
  71.  
  72. //var pressed = false;
  73. //document.querySelector('#message').addEventListener('keypress',function(e) {
  74. //    var key = e.which || e.keyCode;
  75. //    if(key === 13) {
  76. //        pressed = true;
  77. //        console.log("Pressed");
  78. //    }
  79. //});
  80.  
  81.  
  82. //ZALGO---------------------------------------------------------------
  83. function asmodeus_textarea(id) {
  84.     var p = document.getElementById(id);
  85.     var el = document.getElementsByClassName('emojionearea-editor')[0].innerHTML.replace("#", "").replace("<br>", "");
  86.     var txt = el;
  87.     var newtxt = '';
  88.     for (var i = 0; i < txt.length; i++) {
  89.         if (is_asmodeus_char(txt.substr(i, 1)))
  90.             continue;
  91.         var num_up;
  92.         var num_mid;
  93.         var num_down;
  94.         //add the normal character
  95.         newtxt += txt.substr(i, 1);
  96.         //options
  97.         if (document.getElementById('asmodeus_opt_mini').checked) {
  98.             num_up = rand(8);
  99.             num_mid = rand(2);
  100.             num_down = rand(8);
  101.         }
  102.         else if (document.getElementById('asmodeus_opt_normal').checked) {
  103.             num_up = rand(16) / 2 + 1;
  104.             num_mid = rand(6) / 2;
  105.             num_down = rand(16) / 2 + 1;
  106.         }
  107.         else //maxi
  108.         {
  109.             num_up = rand(64) / 4 + 3;
  110.             num_mid = rand(16) / 4 + 1;
  111.             num_down = rand(64) / 4 + 3;
  112.         }
  113.         if (document.getElementById('asmodeus_opt_up').checked)
  114.             for (var j = 0; j < num_up; j++)
  115.                 newtxt += rand_asmodeus(asmodeus_up);
  116.         if (document.getElementById('asmodeus_opt_mid').checked)
  117.             for (var j = 0; j < num_mid; j++)
  118.                 newtxt += rand_asmodeus(asmodeus_mid);
  119.         if (document.getElementById('asmodeus_opt_down').checked)
  120.             for (var j = 0; j < num_down; j++)
  121.                 newtxt += rand_asmodeus(asmodeus_down);
  122.     }
  123.     document.getElementsByClassName('emojionearea-editor')[0].innerHTML = newtxt;
  124.     //done
  125. }
  126. var asmodeus_up = [
  127.     '\u030d', /*     ̍     */      '\u030e', /*     ̎     */      '\u0304', /*     ̄     */      '\u0305', /*     ̅     */
  128.     '\u033f', /*     ̿     */      '\u0311', /*     ̑     */      '\u0306', /*     ̆     */      '\u0310', /*     ̐     */
  129.     '\u0352', /*     ͒     */      '\u0357', /*     ͗     */      '\u0351', /*     ͑     */      '\u0307', /*     ̇     */
  130.     '\u0308', /*     ̈     */      '\u030a', /*     ̊     */      '\u0342', /*     ͂     */      '\u0343', /*     ̓     */
  131.     '\u0344', /*     ̈́     */      '\u034a', /*     ͊     */      '\u034b', /*     ͋     */      '\u034c', /*     ͌     */
  132.     '\u0303', /*     ̃     */      '\u0302', /*     ̂     */      '\u030c', /*     ̌     */      '\u0350', /*     ͐     */
  133.     '\u0300', /*     ̀     */      '\u0301', /*     ́     */      '\u030b', /*     ̋     */      '\u030f', /*     ̏     */
  134.     '\u0312', /*     ̒     */      '\u0313', /*     ̓     */      '\u0314', /*     ̔     */      '\u033d', /*     ̽     */
  135.     '\u0309', /*     ̉     */      '\u0363', /*     ͣ     */      '\u0364', /*     ͤ     */      '\u0365', /*     ͥ     */
  136.     '\u0366', /*     ͦ     */      '\u0367', /*     ͧ     */      '\u0368', /*     ͨ     */      '\u0369', /*     ͩ     */
  137.     '\u036a', /*     ͪ     */      '\u036b', /*     ͫ     */      '\u036c', /*     ͬ     */      '\u036d', /*     ͭ     */
  138.     '\u036e', /*     ͮ     */      '\u036f', /*     ͯ     */      '\u033e', /*     ̾     */      '\u035b', /*     ͛     */
  139.     '\u0346', /*     ͆     */      '\u031a' /*     ̚     */
  140. ];
  141. var asmodeus_down = [
  142.     '\u0316', /*     ̖     */      '\u0317', /*     ̗     */      '\u0318', /*     ̘     */      '\u0319', /*     ̙     */
  143.     '\u031c', /*     ̜     */      '\u031d', /*     ̝     */      '\u031e', /*     ̞     */      '\u031f', /*     ̟     */
  144.     '\u0320', /*     ̠     */      '\u0324', /*     ̤     */      '\u0325', /*     ̥     */      '\u0326', /*     ̦     */
  145.     '\u0329', /*     ̩     */      '\u032a', /*     ̪     */      '\u032b', /*     ̫     */      '\u032c', /*     ̬     */
  146.     '\u032d', /*     ̭     */      '\u032e', /*     ̮     */      '\u032f', /*     ̯     */      '\u0330', /*     ̰     */
  147.     '\u0331', /*     ̱     */      '\u0332', /*     ̲     */      '\u0333', /*     ̳     */      '\u0339', /*     ̹     */
  148.     '\u033a', /*     ̺     */      '\u033b', /*     ̻     */      '\u033c', /*     ̼     */      '\u0345', /*     ͅ     */
  149.     '\u0347', /*     ͇     */      '\u0348', /*     ͈     */      '\u0349', /*     ͉     */      '\u034d', /*     ͍     */
  150.     '\u034e', /*     ͎     */      '\u0353', /*     ͓     */      '\u0354', /*     ͔     */      '\u0355', /*     ͕     */
  151.     '\u0356', /*     ͖     */      '\u0359', /*     ͙     */      '\u035a', /*     ͚     */      '\u0323' /*     ̣     */
  152. ];
  153. var asmodeus_mid = [
  154.     '\u0315', /*     ̕     */      '\u031b', /*     ̛     */      '\u0340', /*     ̀     */      '\u0341', /*     ́     */
  155.     '\u0358', /*     ͘     */      '\u0321', /*     ̡     */      '\u0322', /*     ̢     */      '\u0327', /*     ̧     */
  156.     '\u0328', /*     ̨     */      '\u0334', /*     ̴     */      '\u0335', /*     ̵     */      '\u0336', /*     ̶     */
  157.     '\u034f', /*     ͏     */      '\u035c', /*     ͜     */      '\u035d', /*     ͝     */      '\u035e', /*     ͞     */
  158.     '\u035f', /*     ͟     */      '\u0360', /*     ͠     */      '\u0362', /*     ͢     */      '\u0338', /*     ̸     */
  159.     '\u0337', /*     ̷     */      '\u0361', /*     ͡     */      '\u0489' /*     ҉_     */
  160. ];
  161. function rand(max) {
  162.     return Math.floor(Math.random() * max);
  163. }
  164. function rand_asmodeus(array) {
  165.     var ind = Math.floor(Math.random() * array.length);
  166.     return array[ind];
  167. }
  168. function toggle(id) {
  169.     if (document.getElementById(id).style.display == "none")
  170.         document.getElementById(id).style.display = "block";
  171.     else
  172.         document.getElementById(id).style.display = "none";
  173. }
  174. function is_asmodeus_char(c) {
  175.     var i;
  176.     for (i = 0; i < asmodeus_up.length; i++)
  177.         if (c == asmodeus_up[i])
  178.             return true;
  179.     for (i = 0; i < asmodeus_down.length; i++)
  180.         if (c == asmodeus_down[i])
  181.             return true;
  182.     for (i = 0; i < asmodeus_mid.length; i++)
  183.         if (c == asmodeus_mid[i])
  184.             return true;
  185.     return false;
  186. }
  187. //End ZALGO------------------------------------------------------------
  188.  
  189. $(function () {
  190.     // $("body").on("shown.bs.tab", '#ctabs a[data-toggle="tab"]', function(a) {
  191.     //     "all" == $(a.target).data("dest") && void 0 !== roomUserLists[$(a.target).data("roomid")] && $('a[data-target="#users"]').parent("li").hasClass("active") && usersListTitleChange(roomUserLists[$(a.target).data("roomid")].items.length, $(".chat-tabs .avatar-list-item.active a").find("strong").text());
  192.     //     $('#ctabs a[data-toggle="tab"]').removeClass("active");
  193.     //     $(a.target).addClass("active");
  194.     //     $(a.target).children(".num-container").hide();
  195.     //     $(a.target).children(".num-container").children(".num-circle").html("0");
  196.     //     scrollToBottom($(".chat-area > .tab-pane.active .chat-text"));
  197.     //     $(".emojionearea-editor").focus()
  198.     // });
  199.     // $("body").on("click", ".chat-tabs-closer", function(a) {
  200.     //     a.stopPropagation();
  201.     //     $tab = $(this).parent("a");
  202.     //     "all" == $tab.data("dest") ? leaveRoom($tab.data("roomid"), function() {
  203.     //         delete roomUserLists[$tab.data("roomid")];
  204.     //         closeChatTab($tab.data("roomid"), !0)
  205.     //     }) : closeChatTab($tab.data("dest"), !1)
  206.     // })
  207. });
  208.  
  209. function newChatTab(a, b, c, f, e) {
  210.     // f = "all" == c ? "<strong>" + f + "</strong>" : f;
  211.     // $(".chat-tabs").append('<li class="avatar-list-item"><a data-target="' + a + '" data-roomid="' + b + '" data-dest="' + c + '" class="ct-tab btn btn-xs btn-primary-outline" data-toggle="tab"><span class="chat-tabs-title">' + f + '</span><span class="chat-tabs-closer">&times;</span></a></li>');
  212.     // $(".chat-area").append('<div id="ct_' + e + '" class="tab-pane"><div class="chat-text" style="font-size:' + $("#optTextSize").val() + 'px;" data-id="' + e + '"></div></div>')
  213. }
  214.  
  215. function closeChatTab(a, b) {
  216.     // b ? ($('#ctabs a[data-target="#ct_' + a + ", #ul_" + a + '"]').parent("li").remove(), $("#ul_" + a).remove()) : $('#ctabs a[data-target="#ct_' + a + '"]').parent("li").remove();
  217.     // $("#ct_" + a).remove();
  218.     // 0 === $(".chat-tabs li").length ? ($("#userLists, #chatArea").css("visibility", "hidden"), $("#roomsList_modal").modal("show")) : (0 !== $(".chat-tabs li.active").length && 0 !== $("#users .tab-pane.active").length || $(".chat-tabs li").children('a[data-dest="all"]').first().click(), 1 == $(".chat-tabs li").children('a[data-dest="all"]').length && $(".chat-tabs li").children('a[data-dest="all"]').children(".chat-tabs-closer").css("visibility", "hidden"), 0 === $(".chat-tabs li").children('a[data-dest="all"]').length && ($(".chat-tabs").html(""), $(".chat-area").html(""), $("#userLists, #chatArea").css("visibility", "hidden"), $("#roomsList_modal").modal("show")))
  219. }
  220.  
  221. function onNewMessageReceivedInActiveTab() {
  222.     // isActive || (count++, document.title = "(" + parseInt(count, 10) + ") Chat | EpikChat")
  223. }
  224. $(function () {
  225.     // $("body").on("blur", ".tab-pane > .form-group > input.search:text", function(a) {
  226.     //     $(this).val("");
  227.     //     $(this).parents(".tab-pane").is("#ul_viewers") ? viewersList.search() : $(this).parents(".tab-pane").is("#ul_blocked") ? blockedList.search() : roomUserLists[$(this).parents(".tab-pane").data("roomid")].search()
  228.     // });
  229.     // $("body").on("click", "a.tcLink", function(a) {
  230.     //     a.preventDefault();
  231.     //     openLink($(this).attr("href"))
  232.     // });
  233.     // $("#youTube-content").resizable({
  234.     //     handles: "sw",
  235.     //     aspectRatio: !0,
  236.     //     alsoResize: "#ytplayer",
  237.     //     maxHeight: 360,
  238.     //     maxWidth: 640,
  239.     //     minHeight: 72,
  240.     //     minWidth: 128,
  241.     //     start: function(a, b) {
  242.     //         $("#ytplayer").css("pointer-events", "none")
  243.     //     },
  244.     //     stop: function(a, b) {
  245.     //         $("#ytplayer").css("pointer-events", "auto")
  246.     //     }
  247.     // })
  248. });
  249.  
  250. function youtubePlayer(a, b) {
  251.     // switch (a) {
  252.     //     case "open":
  253.     //         $("#ytplayer").show();
  254.     //         $("#ytplayer").attr("src", "https://www.youtube.com/embed/" + b + "?disablekb=1&rel=0&theme=light&playsinline=1");
  255.     //         $(".avatar-list-item.yticon").hide();
  256.     //         $(".avatar-list-item.ytminmax").removeClass("max");
  257.     //         $(".ytresize").removeClass("max");
  258.     //         $("#youTube-content").fadeIn();
  259.     //         break;
  260.     //     case "close":
  261.     //         $("#youTube-content").hide();
  262.     //         $("#ytplayer").attr("src", "about:blank");
  263.     //         break;
  264.     //     case "minmax":
  265.     //         $("#ytplayer").toggle(), $(".ytresize").toggleClass("max"), $(".avatar-list-item.ytminmax").toggleClass("max"), $("#ytcontrols .avatar-list-item.yticon").fadeToggle(150, "linear")
  266.     // }
  267. }
  268. $(function () {
  269.     // $("body").on("click", "#ytcontrols .avatar-list-item", function() {
  270.     //     youtubePlayer($(this).data("action"), null)
  271.     // });
  272.     // $('[data-toggle="popoverColor"]').popover({
  273.     //     template: '<div class="popover colorselectpopover" role="tooltip"><div class="arrow"></div><div class="popover-content p-x-0"></div></div>',
  274.     //     title: "",
  275.     //     html: !0,
  276.     //     trigger: "manual",
  277.     //     placement: "top",
  278.     //     container: ".message-input",
  279.     //     content: '<span class="simplecolorpicker inline"><span class="color" style="background-color: #212121;" data-color="#212121"></span><span class="color" style="background-color: #3d3c3a;" data-color="#3d3c3a"></span><span class="color" style="background-color: #656565;" data-color="#656565"></span><span class="color" style="background-color: #6f4341;" data-color="#6f4341"></span><span class="color" style="background-color: #990703;" data-color="#990703"></span><span class="color" style="background-color: #ca226b;" data-color="#ca226b"></span><span class="color" style="background-color: #f778a1;" data-color="#f778a1"></span><span class="color" style="background-color: #f32f2f;" data-color="#f32f2f"></span><span class="color" style="background-color: #c35817;" data-color="#c35817"></span><span class="color" style="background-color: #ffad46;" data-color="#ffad46"></span><span class="color" style="background-color: #f1c85e;" data-color="#f1c85e"></span><span class="color" style="background-color: #006666;" data-color="#006666"></span><span class="color" style="background-color: #596247;" data-color="#596247"></span><span class="color" style="background-color: #3a6636;" data-color="#3a6636"></span><span class="color" style="background-color: #47b617;" data-color="#47b617"></span><span class="color" style="background-color: #5cd87e;" data-color="#5cd87e"></span><span class="color" style="background-color: #11c4cd;" data-color="#11c4cd"></span><span class="color" style="background-color: #6db4e9;" data-color="#6db4e9"></span><span class="color" style="background-color: #2a61e3;" data-color="#2a61e3"></span><span class="color" style="background-color: #2d1ae1;" data-color="#2d1ae1"></span><span class="color" style="background-color: #645be5;" data-color="#645be5"></span><span class="color" style="background-color: #ff0099;" data-color="#ff0099"></span><span class="color" style="background-color: #cc00cc;" data-color="#cc00cc"></span><span class="color" style="background-color: #9334d8;" data-color="#9334d8"></span></span>'
  280.     // });
  281.     // $('[data-toggle="popoverColor"]').on("click", function(a) {
  282.     //     $('[data-toggle="popoverColor"]').data("bs.popover").tip().hasClass("in") ? ($('[data-toggle="popoverColor"]').popover("hide"), $(document).off("click.app.popover")) : ($('[data-toggle="popoverColor"]').popover("show"), $(".simplecolorpicker span.color").removeAttr("data-selected"), $('.simplecolorpicker span.color[data-color="' + $("#optTextColor").data("color") + '"]').attr("data-selected", !0), setTimeout(function() {
  283.     //         $(document).one("click.app.popover", function() {
  284.     //             $('[data-toggle="popoverColor"]').popover("hide")
  285.     //         })
  286.     //     }, 1))
  287.     // });
  288.     // $("body").on("click", ".simplecolorpicker span.color", function(a) {
  289.     //     $("#optTextColor").attr("data-color", $(this).data("color"));
  290.     //     $("#optTextColor").data("color", $(this).data("color"));
  291.     //     $("#optTextColor").css("background-color", $(this).data("color"));
  292.     //     $(".emojionearea-editor").focus();
  293.     //     saveChatSettings()
  294.     // });
  295.     // $("body").on("click", 'a[data-target="#user_action_modal"]', function(a) {
  296.     //     userActions($("#user_action_modal"), $(this), !0)
  297.     // })
  298. });
  299.  
  300. function openLink(a) {
  301.     // a.match(/^http([s]?):\/\/.*/) || (a = "http://" + a);
  302.     // a = a.replace("&amp;", "&");
  303.     // var b = $("<a>", {
  304.     //         href: a
  305.     //     })[0],
  306.     //     c = !1;
  307.     // $.each("epikchat.com youtube.com youtu.be ytimg.com facebook.com fb.com fbcdn.net instagram.com cdninstagram.com twitter.com twimg.com pinterest.com pinimg.com imgur.com reddit.com ebay.com amazon.com google.com wikipedia.org".split(" "), function(a, e) {
  308.     //     if (b.hostname.lastIndexOf(e) == b.hostname.length - e.length && -1 != b.hostname.lastIndexOf(e)) return c = !0, !1
  309.     // });
  310.     // if (c)
  311.     //     if (regExp = /.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#&\?]*).*/, match = a.match(regExp), res = a.split("/"), match && 11 == match[1].length) youtubePlayer("open", match[1]);
  312.     //     else if (res[4] && ("doodles" == res[4].toLowerCase() || "photos" == res[4].toLowerCase()) && res[5]) viewMedia(a);
  313.     // else if (-1 == a.indexOf("epikchat.com/chat")) window.open(a, "_blank");
  314.     // else return !1;
  315.     // else $("#link-checker-content").html(""), $(".indicator").show(), $("#linkCheckerModal").modal("show"), $("#linkCheckerModal").find(".modal-header .modal-title").html("Checking link..."), $.ajax({
  316.     //     type: "POST",
  317.     //     url: "/sites/all/modules/avc/avc_ui/linkCheck",
  318.     //     data: {
  319.     //         url: a
  320.     //     },
  321.     //     dataType: "json",
  322.     //     success: function(b) {
  323.     //         if (0 === b.status) return !1;
  324.     //         1 == b.status ? ($("#linkCheckerModal").find(".modal-header .modal-title").html("Be careful!<br>This link leads you off EpikChat!"), b.url ? $("#link-checker-content").html('<div style="width: 260px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><b>This link redirects to:</b> ' + b.url + "</div><a href=\"javascript:alert('" + b.redirects + '\')" style="text-decoration:none;">(show all)</a><br>') : $("#link-checker-content").html('<div style="width: 260px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">' +
  325.     //             a + "</div>"), $("#link-checker-content").append('<br><p>If you trust this link, choose Open Link. If you do not trust the link, choose Cancel.</p><br><button type="button" class="btn btn-primary pull-right" onclick="window.open(\'' + a + "', '_blank');$('#linkCheckerModal').modal('hide');\">Open Link</button><button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Cancel</button>")) : 2 == b.status && ($("#linkCheckerModal").find(".modal-header .modal-title").html("Link Blocked"), $("#link-checker-content").html('<b>This link has been identified as potentially dangerous and has been blocked.</b><br><br><div style="width: 260px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" onselectstart="return false;">' +
  326.     //             a + '</div><br><button type="button" class="btn btn-default" data-dismiss="modal">Close</button>'))
  327.     //     }
  328.     // }), $(".indicator").hide()
  329. }
  330.  
  331. function gotDevices(a) {
  332.     // var b = broadcastSelectors.map(function(a) {
  333.     //     return a.value
  334.     // });
  335.     // broadcastSelectors.forEach(function(a) {
  336.     //     for (; a.firstChild;) a.removeChild(a.firstChild)
  337.     // });
  338.     // for (var c = 0; c !== a.length; ++c) {
  339.     //     var f = a[c],
  340.     //         e = document.createElement("option");
  341.     //     e.value = f.deviceId;
  342.     //     "audioinput" === f.kind && (e.text = f.label || "microphone " + (audioInputSelect.length + 1), audioInputSelect.appendChild(e));
  343.     //     "videoinput" === f.kind && (e.text = f.label || "camera " + (videoInputSelect.length + 1), videoInputSelect.appendChild(e))
  344.     // }
  345.     // broadcastSelectors.forEach(function(a, c) {
  346.     //     Array.prototype.slice.call(a.childNodes).some(function(a) {
  347.     //         return a.value === b[c]
  348.     //     }) && (a.value = b[c])
  349.     // })
  350. }
  351.  
  352. function gotStream(a) {
  353.     // window.stream = a;
  354.     // document.getElementById("videoPreview").srcObject = a;
  355.     // meters[socket.id] = kurentoUtils.WebRtcPeer.hark(a);
  356.     // meters[socket.id].on("volume_change", function(a) {
  357.     //     $("#volPreviewBar").height(a + 100 + "%")
  358.     // });
  359.     // return navigator.mediaDevices.enumerateDevices()
  360. }
  361.  
  362. function complete() {
  363.     // $("#broadcastReqPerm").hide();
  364.     // $("#broadcastReqFail").hide();
  365.     // $("#broadcastSettingsForm").show()
  366. }
  367.  
  368. function handleError(a) {
  369.     // var b = "";
  370.     // console.log("navigator.getUserMedia error: " + a);
  371.     // if ("NotAllowedError" == a.name || "PermissionDeniedError" == a.name) b = "<div><h5>Camera access denied</h5>You need to allow the use of your camera and microphone in order to broadcast.</div><br><br>";
  372.     // if ("OverconstrainedError" == a.name || "DevicesNotFoundError" == a.name) b = '<div class="error" style="margin: 0px 15px 15px 15px;font-size: 13px;padding: 4px;">ERROR: One of your currently selected audio/video devices could not be found!<br>Please select another device.</div>';
  373.     // "PermissionDismissedError" == a.name && (b = '<div><h5>Select "Allow" to broadcast</h5>Click "Try again" to allow the use of your camera and microphone in order to broadcast.</div><br><button type="button" name="op" value="Try again" class="btn btn-primary form-submit" onClick="start()">Try again</button><br><br>');
  374.     // $("#broadcastReqFail").html(b);
  375.     // $("#broadcastReqPerm").hide();
  376.     // $("#broadcastReqFail").show()
  377. }
  378. $(function () {
  379.     // $("body").on("click", "#startBroadcasting", function() {
  380.     //     navigator.getUserMedia ? ($("#startBroadcasting").addClass("disabled"), $("#broadcastSettings").modal("show")) : notifyUser("Broadcasting is not supported with this browser.")
  381.     // });
  382.     // $("#broadcastSettings").on("show.bs.modal", function() {
  383.     //     startPreview()
  384.     // });
  385.     // $("#broadcastSettings").on("hide.bs.modal", function() {
  386.     //     window.stream && window.stream.getTracks().forEach(function(a) {
  387.     //         a.stop()
  388.     //     });
  389.     //     $("#startBroadcasting").removeClass("disabled")
  390.     // });
  391.     // $("body").on("click", ".stopBroadcasting", function(a) {
  392.     //     stopBroadcasting(!1)
  393.     // });
  394.     // $("body").on("click", ".pauseVideo", function(a) {
  395.     //     webRtcPeerPresenter && ($(this).toggleClass("active"), webRtcPeerPresenter.videoEnabled = webRtcPeerPresenter.videoEnabled ? !1 : !0)
  396.     // });
  397.     // $("body").on("click", ".muteMic", function(a) {
  398.     //     webRtcPeerPresenter && ($(this).toggleClass("active"), webRtcPeerPresenter.audioEnabled = webRtcPeerPresenter.audioEnabled ? !1 : !0)
  399.     // })
  400. });
  401.  
  402. function presenterResponse(a) {
  403.     // "accepted" != a.response ? (console.warn("Not accepted for the following reason: " + (a.message ? a.message : "Unknown error")), webRtcPeerPresenter.dispose()) : webRtcPeerPresenter.processAnswer(a.sdpAnswer)
  404. }
  405. $(function () {
  406.     // $("body").on("click", ".stopViewing", function(a) {
  407.     //     stopViewing($(this).data("sid"))
  408.     // });
  409.     // $("body").on("click", ".ecp-mute > svg", function(a) {
  410.     //     a = $(this).next(".vol-control");
  411.     //     var b = 100 * $('video[data-sid="' + $(this).parents(".bcst-player").data("sid") + '"]').prop("volume");
  412.     //     $('video[data-sid="' + $(this).parents(".bcst-player").data("sid") + '"]').prop("muted") && 0 !== b ? ($('video[data-sid="' + $(this).parents(".bcst-player").data("sid") + '"]').prop("muted", !1), a.val(b), a.css("background", "linear-gradient(to left, #505050 0%, #505050 0%, #505050 " +
  413.     //         (100 - b) + "%, #f9f9f9 " + (100 - b) + "%, #f9f9f9 100%)"), $(this).html('<path d="M8,21 L12,21 L17,26 L17,10 L12,15 L8,15 L8,21 Z M19,14 L19,22 C20.48,21.32 21.5,19.77 21.5,18 C21.5,16.26 20.48,14.74 19,14 ZM19,11.29 C21.89,12.15 24,14.83 24,18 C24,21.17 21.89,23.85 19,24.71 L19,26.77 C23.01,25.86 26,22.28 26,18 C26,13.72 23.01,10.14 19,9.23 L19,11.29 Z" fill="#fff"></path>')) : ($('video[data-sid="' + $(this).parents(".bcst-player").data("sid") + '"]').prop("muted", !0), a.val(0), a.css("background", "linear-gradient(to left, #505050 0%, #505050 0%, #505050 100%, #f9f9f9 100%, #f9f9f9 100%)"), $(this).html('<path d="m 21.48,17.98 c 0,-1.77 -1.02,-3.29 -2.5,-4.03 v 2.21 l 2.45,2.45 c .03,-0.2 .05,-0.41 .05,-0.63 z m 2.5,0 c 0,.94 -0.2,1.82 -0.54,2.64 l 1.51,1.51 c .66,-1.24 1.03,-2.65 1.03,-4.15 0,-4.28 -2.99,-7.86 -7,-8.76 v 2.05 c 2.89,.86 5,3.54 5,6.71 z M 9.25,8.98 l -1.27,1.26 4.72,4.73 H 7.98 v 6 H 11.98 l 5,5 v -6.73 l 4.25,4.25 c -0.67,.52 -1.42,.93 -2.25,1.18 v 2.06 c 1.38,-0.31 2.63,-0.95 3.69,-1.81 l 2.04,2.05 1.27,-1.27 -9,-9 -7.72,-7.72 z m 7.72,.99 -2.09,2.08 2.09,2.09 V 9.98 z" fill="#fff"></path>'))
  414.     // });
  415.     // $("body").on("input", ".vol-control", function(a) {
  416.     //     $('video[data-sid="' + $(this).parents(".bcst-player").data("sid") + '"]').prop("volume", $(this).val() / 100);
  417.     //     $(this).css("background", "linear-gradient(to left, #505050 0%, #505050 0%, #505050 " + (100 - $(this).val()) + "%, #f9f9f9 " + (100 - $(this).val()) + "%, #f9f9f9 100%)");
  418.     //     "0" == $(this).val() ? $(this).siblings("svg").html('<path d="m 21.48,17.98 c 0,-1.77 -1.02,-3.29 -2.5,-4.03 v 2.21 l 2.45,2.45 c .03,-0.2 .05,-0.41 .05,-0.63 z m 2.5,0 c 0,.94 -0.2,1.82 -0.54,2.64 l 1.51,1.51 c .66,-1.24 1.03,-2.65 1.03,-4.15 0,-4.28 -2.99,-7.86 -7,-8.76 v 2.05 c 2.89,.86 5,3.54 5,6.71 z M 9.25,8.98 l -1.27,1.26 4.72,4.73 H 7.98 v 6 H 11.98 l 5,5 v -6.73 l 4.25,4.25 c -0.67,.52 -1.42,.93 -2.25,1.18 v 2.06 c 1.38,-0.31 2.63,-0.95 3.69,-1.81 l 2.04,2.05 1.27,-1.27 -9,-9 -7.72,-7.72 z m 7.72,.99 -2.09,2.08 2.09,2.09 V 9.98 z" fill="#fff"></path>') : ($('video[data-sid="' + $(this).parents(".bcst-player").data("sid") + '"]').prop("muted", !1), $(this).siblings("svg").html('<path d="M8,21 L12,21 L17,26 L17,10 L12,15 L8,15 L8,21 Z M19,14 L19,22 C20.48,21.32 21.5,19.77 21.5,18 C21.5,16.26 20.48,14.74 19,14 ZM19,11.29 C21.89,12.15 24,14.83 24,18 C24,21.17 21.89,23.85 19,24.71 L19,26.77 C23.01,25.86 26,22.28 26,18 C26,13.72 23.01,10.14 19,9.23 L19,11.29 Z" fill="#fff"></path>'))
  419.     // });
  420.     // $("body").on("click", ".ecp-resize", function(a) {
  421.     //     $(this).parents(".bcst-player").hasClass("stack-lg") ? ($(this).parents(".bcst-player").removeClass("stack-lg").find(".stack").removeClass("stack-lg"), $(this).find(".icon").removeClass("icon-resize-100").addClass("icon-resize-full-screen")) : ($(this).parents(".bcst-player").addClass("stack-lg").find(".stack").addClass("stack-lg"), $(this).find(".icon").removeClass("icon-resize-full-screen").addClass("icon-resize-100"));
  422.     //     scrollToBottom($(".chat-area > .tab-pane.active .chat-text"))
  423.     // });
  424.     // $("body").on("click", ".ecp-fullscreen", function(a) {
  425.     //     target = $('video[data-sid="' +
  426.     //         $(this).parents(".bcst-player").find("video").data("sid") + '"]')[0];
  427.     //     screenfull.enabled && (screenfull.request(target), screenfull.onchange(function() {
  428.     //         screenfull.isFullscreen || scrollToBottom($(".chat-area > .tab-pane.active .chat-text"))
  429.     //     }))
  430.     // })
  431. });
  432.  
  433. function viewerResponse(a) {
  434.     // if ("accepted" != a.response) {
  435.     //     var b = a.data.data ? a.data.data : "Unknown error";
  436.     //     console.warn(b);
  437.     //     notifyUser("Could not establish a connection with the broadcaster: " + b);
  438.     //     removePlayer(a.data.sid)
  439.     // } else webRtcPeerViewer[a.sid].processAnswer(a.sdpAnswer, function(b) {
  440.     //     if (b) return console.log(b);
  441.     //     document.querySelector('video[data-sid="' + a.sid + '"]').addEventListener("loadeddata", function() {
  442.     //         $('.bcst-player[data-sid="' + a.sid + '"] .stack.spinner').hide();
  443.     //         a.simulated && ($('.bcst-player[data-sid="' +
  444.     //             a.sid + '"]').find(".ecp-overlay").prepend('<div class="simIco pull-right" style="padding:3px 5px;" title="This person may be using a simulated webcam" data-toggle="tooltip" data-container="#broadcastSlots"><span class="icon icon-warning"></span></div>'), $('[data-toggle="tooltip"]').tooltip())
  445.     //     }, !1)
  446.     // })
  447. }
  448.  
  449. function removePlayer(a) {
  450.     // webRtcPeerViewer[a] && webRtcPeerViewer[a] && (webRtcPeerViewer[a].dispose(), delete webRtcPeerViewer[a]);
  451.     // $('.bcst-player[data-sid="' + a + '"]').remove()
  452. }
  453. $(function () {
  454.     $("#reportUser").submit(function (a) {
  455.         // a.preventDefault();
  456.         // 0 === $(this).find("select").val() ? $(this).find("select").addClass("error") : ($(this).find("select").removeClass("error"), reportUser($(this).find("#report_roomid").val(), $(this).find("#report_sid").val(), $(this).find("select").val(), $(this).find("textarea").val()), $("#reportUser_modal").modal("hide"), $(this).find("select").val(0), $(this).find("textarea").val(""))
  457.     });
  458.     $("body").on("click", "#suggest_ban", function (a) {
  459.         // a.preventDefault();
  460.         // $("#suggestBan_modal").data("sid", $(this).attr("href"));
  461.         // $("#suggestBan_modal .modal-body").html("Ban " + $(this).data("name") + " from The Lobby?<br><br><strong>WARNING:</strong><br><small>You are about to initiate a room wide vote to ban user " + $(this).data("name") + ". If over 50% of voters choose YES this user will be banned. If over 50% of voters choose NO you will be banned.</small><br>");
  462.         // $("#suggestBan_modal").modal("show");
  463.         // $("#reportUser_modal").modal("hide")
  464.     });
  465.     $("body").on("click", "#processBan", function (a) {
  466.         // requestVote($(".userList div.active").data("roomid"), $("#suggestBan_modal").data("sid"))
  467.     })
  468. });
  469. $(function () {
  470.     // $("#alert_modal").on("hide.bs.modal", function() {
  471.     //     "hidden" !== $("#userLists, #chatArea").css("visibility") || $("#roomsList_modal").is(":visible") || $("#roomsList_modal").modal("show")
  472.     // });
  473.     // $("#roomsList_modal").on("show.bs.modal", function() {
  474.     //     roomsListRefresh();
  475.     //     roomsListRefreshTimer = setInterval(function() {
  476.     //         roomsListRefresh()
  477.     //     }, 5E3)
  478.     // });
  479.     // $("#roomsList_modal").on("hide.bs.modal", function() {
  480.     //     clearInterval(roomsListRefreshTimer)
  481.     // });
  482.     // $("#chatSettings_modal").on("hidden.bs.modal", function() {
  483.     //     saveChatSettings();
  484.     //     $(this).find(".modal-content").hide();
  485.     //     $(this).find(".modal-content.main").show()
  486.     // });
  487.     // $("#showEmpty").change(function() {
  488.     //     $(this).is(":checked") ? $(".roomspicker > a[data-users=0]").show() : $(".roomspicker > a[data-users=0]").hide()
  489.     // });
  490.     // $("body").on("click", ".roomspicker > a.list-group-item, .roomInvite, .roomInfo", function(a) {
  491.     //     a.preventDefault();
  492.     //     $("#roomsList_modal").modal("hide");
  493.     //     $('#ctabs a[data-roomid="' + $(this).data("roomid") + '"][data-dest="all"]').length ? notifyUser("This room is already open, please close/exit the room before attempting to rejoin.") : $(this).data("passworded") ? ($("#passwordJoin").data("roomid", $(this).data("roomid")), $("#password_modal").modal("show")) : joinRoom($(this).data("roomid"), "")
  494.     // });
  495.     // $("body").on("click", ".viewInvite", function(a) {
  496.     //     a.preventDefault();
  497.     //     sendViewRequest($(this).data("sid"), $(this).data("cam"))
  498.     // });
  499.     // $("#password_modal").on("shown.bs.modal", function() {
  500.     //     $(this).find("[autofocus]:first").focus()
  501.     // });
  502.     // $("#password_modal").on("hidden.bs.modal", function(a) {
  503.     //     $("#rmpwd").val("")
  504.     // });
  505.     // $("#passwordJoin").submit(function(a) {
  506.     //     a.preventDefault();
  507.     //     $("#password_modal").modal("hide");
  508.     //     joinRoom($(this).data("roomid"), $("#rmpwd").val())
  509.     // });
  510.     // $("#inviteToRoom").submit(function(a) {
  511.     //     a.preventDefault();
  512.     //     $("#inviteroom_modal").modal("hide");
  513.     //     inviteUser("room", $("#inviteroom_modal").find("#inviteroom_roomId").val(), $("#inviteroom_modal").find("#inviteroom_sid").val(), $("#inviteroom_modal").find("#inviteroom_name").val(), $("#inviteroom_modal").find("select").val())
  514.     // })
  515. });
  516.  
  517. function notifyUser(a, b, c) {
  518.     // a = '<div class="alert alert-dark alert-dismissable" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' + a + "</div>";
  519.     // b ? $(a).appendTo(".growl") : (c = c ? c : 1E4, $(a).appendTo(".growl").delay(c).fadeOut("fast", function() {
  520.     //     $(this).remove()
  521.     // }))
  522. }
  523.  
  524. function notificationSound(a) {
  525.     // if ($("#optSounds" + a).is(":checked")) {
  526.     //     switch (a) {
  527.     //         case "Msg":
  528.     //             file = "message-html5.mp3";
  529.     //             break;
  530.     //         case "Poke":
  531.     //             file = "poke-html5.mp3";
  532.     //             break;
  533.     //         case "ViewReq":
  534.     //             file = "viewRequest-html5.mp3"
  535.     //     }
  536.     //     audio = new Audio("/sites/all/modules/avc/avc_ui/sounds/" + file);
  537.     //     audio.play()
  538.     // }
  539. }
  540.  
  541. function inList(a, b, c) {
  542.     // if (!a) return !1;
  543.     // a = a.get(b, c);
  544.     // return a.length ? a[0].values() : !1
  545. }
  546.  
  547. function isBlocked(a, b) {
  548.     // if (void 0 === a || null === a) return console.log("no siteId blocking just in case"), !0;
  549.     // if (void 0 === b || null === b) return console.log("no clientId blocking just in case"), !0;
  550.     // if (a) {
  551.     //     if (inList(blockedList, "siteId", a)) return !0
  552.     // } else if (inList(blockedList, "clientId", b)) return !0;
  553.     // return !1
  554. }
  555. $(function () {
  556.     // $('<ul class="chat-nav nav navbar-nav" style="position: absolute;left: 190px;font-size: 17px;display: none;margin:0;"><li class="pull-left" title="Settings"><a data-target="#chatSettings_modal" data-toggle="modal" style="padding: 14px 0px 14px 15px; cursor:pointer;"><span class="icon icon-cog"></span></a></li><li class="pull-left" title="Chat Rooms"><a data-target="#roomsList_modal" style="padding: 14px 0px 14px 15px; font-size:18px; cursor:pointer;" data-toggle="modal"><span class="icon icon-chat"></span></a></li></ul>').insertAfter(".navbar-header > a");
  557.     // $("body").on("shown.bs.tab", '#userListingType a[data-toggle="tab"]', function(a) {
  558.     //     $("#user_action_slider").hide();
  559.     //     "#users" == $(a.target).data("target") ? usersListTitleChange(roomUserLists[$(".userList div.active").data("roomid")].items.length, $(".userList div.active").data("roomname")) : "#viewers" == $(a.target).data("target") ? usersListTitleChange($(viewersList.listContainer).find(".emptyList").hasClass("hidden") ? viewersList.items.length : 0, "Viewers") : "#blocked" == $(a.target).data("target") && usersListTitleChange(0, "Blocked")
  560.     // });
  561.     // $("body").on("click", "[data-ulitem]", function(a) {
  562.     //     a.preventDefault();
  563.     //     userActions($("#user_action_slider"), $(a.currentTarget), !1)
  564.     // });
  565.     // $("#user_action_slider .close").on("click", function() {
  566.     //     $("#user_action_slider").hide()
  567.     // })
  568. });
  569.  
  570. function findUser(a) {
  571.     // for (var b in roomUserLists)
  572.     //     if (roomUserLists.hasOwnProperty(b)) {
  573.     //         var c = roomUserLists[b].get("sid", a);
  574.     //         if (c.length) return {
  575.     //             item: c[0].values(),
  576.     //             roomId: b
  577.     //         }
  578.     //     } return !1
  579. }
  580.  
  581. function userActions(a, b, c) {
  582.     // a.find(".roomKick, .roomBan, .viewProfile, .inviteView, .inviteRoom").hide();
  583.     // var f = b.data("clientid"),
  584.     //     e = b.data("siteid"),
  585.     //     d = inList(roomUserLists[$(".userList div.active").data("roomid")], "sid", socket.id),
  586.     //     g = {};
  587.     // b = b.data("sid");
  588.     // var h = inList(roomUserLists[$(".userList div.active").data("roomid")], "sid", b);
  589.     // if (isBlocked(e, f)) a.data("clientid", f), a.data("siteid", e), a.find(".panel-profile-img").attr("src", "/sites/default/files/global/images/default_profile.png"), a.find(".overlayBtns2 li").data("ulmenu", "").addClass("disableUlitemMenu"), a.find(".blockUnblock a").data("ulmenu", "unblock").text("Unblock this person");
  590.     // else {
  591.     //     if (b == socket.id || !1 === d) return;
  592.     //     if (!1 === h) {
  593.     //         g = findUser(b);
  594.     //         if (!1 === g) return;
  595.     //         h = g.item
  596.     //     } else g.roomId = $(".userList div.active").data("roomid");
  597.     //     a.find(".panel-profile-img").attr("src", h.profileImg);
  598.     //     a.find(".panel-badge").attr("src", h.userLevelIcon);
  599.     //     a.find(".bio").html("");
  600.     //     h.cam.startsWith("99_") ? a.find(".view").data("ulmenu", "").addClass("disableUlitemMenu") : a.find(".view").data("ulmenu", "view").removeClass("disableUlitemMenu");
  601.     //     a.find(".message").data("ulmenu", "message").removeClass("disableUlitemMenu");
  602.     //     a.find(".poke").data("ulmenu", "poke").removeClass("disableUlitemMenu");
  603.     //     a.find(".report").data("ulmenu", "report").removeClass("disableUlitemMenu");
  604.     //     "verified" == d.badge && (d.cam.startsWith("0_") || d.cam.startsWith("1_")) && a.find(".inviteView").data("ulmenu", "inviteview").show();
  605.     //     for (var k in roomUserLists)
  606.     //         if (roomUserLists.hasOwnProperty(k) && (f = roomUserLists[k].get("siteId", d.siteId), f.length && "" !== f[0].values().modIcon)) {
  607.     //             a.find(".inviteRoom").data("ulmenu", "inviteroom").show();
  608.     //             break
  609.     //         } $('a[data-target="#users"]').parents("li").hasClass("active") && "" === h.modIcon && "" !== d.modIcon && a.find(".roomKick, .roomBan").show();
  610.     //     a.find(".blockUnblock a").data("ulmenu", "block").text("Block this person");
  611.     //     a.data("sid", b);
  612.     //     a.data("roomid", g.roomId)
  613.     // }
  614.     // a.find(".name").html(h.name);
  615.     // "guest" != h.badge && a.find(".viewProfile").show();
  616.     // "guest" == d.badge && (a.find(".blockUnblock").hide(), a.find(".poke").data("ulmenu", "").addClass("disableUlitemMenu"));
  617.     // c ? a.modal("show") : a.show()
  618. }
  619.  
  620. function userListAdd(a, b, c) {
  621.     // $(b.listContainer).find(".emptyList").addClass("hidden");
  622.     // var f = "",
  623.     //     e = "",
  624.     //     d = "",
  625.     //     g = "";
  626.     // if ("blocked" == a) f = '<strong title="' + c.name + '">' + c.name + "</strong>", e = void 0 == c.uid ? c.siteId : c.uid, b.add({
  627.     //     siteId: e,
  628.     //     name: e ? '<a href="/' + c.name + '" target="_blank">' + f + "</a>" : f,
  629.     //     clientId: c.clientId
  630.     // });
  631.     // else {
  632.     //     isBlocked(c.siteId, c.clientId) && (e = '<span class="icon icon-block"></span>');
  633.     //     0 !== c.idle && (f = '<svg viewBox="0 0 1000 1000" height="10" width="10" style="margin-top: 8px;margin-left: -9px; position:absolute;"><circle cx="500" cy="500" r="480" fill="#ffffff"></circle><path d="M500,10C229.8,10,10,229.8,10,500c0,270.2,219.8,490,490,490c270.2,0,490-219.8,490-490C990,229.8,770.2,10,500,10L500,10zM500,906.3C276,906.3,93.7,724,93.7,500C93.7,276,276,93.7,500,93.7C724,93.7,906.3,276,906.3,500C906.3,724,724,906.3,500,906.3L500,906.3z M325.3,500c-19.4,0-35.1,15.6-35.1,35s15.7,35,35.1,35h210c19.4,0,35-15.6,35-35V255.1c0-19.4-15.6-35.1-35-35.1c-19.4,0-35,15.7-35,35.1V500L325.3,500L325.3,500z" fill="#5e92c4"></path></svg>');
  634.     //     !0 === c.isMod && (d = '<span class="icon icon-star"></span>');
  635.     //     switch (c.cam) {
  636.     //         case 99:
  637.     //             g = '<span class="icon icon-video-camera off"></span>';
  638.     //             break;
  639.     //         case 0:
  640.     //             g = '<span class="icon icon-video-camera"></span>';
  641.     //             break;
  642.     //         case 1:
  643.     //             g = '<span class="icon icon-video-camera"></span><span class="icon icon-lock"></span>'
  644.     //     }
  645.     //     b.add({
  646.     //         sid: c.sid,
  647.     //         siteId: c.siteId,
  648.     //         clientId: c.clientId,
  649.     //         name: c.name,
  650.     //         gender: c.gender,
  651.     //         badge: c.badge,
  652.     //         countryCode: c.countryCode,
  653.     //         cam: c.cam + "_" + c.name,
  654.     //         idle: c.idle,
  655.     //         camIcon: g,
  656.     //         modIcon: d,
  657.     //         idleIcon: f,
  658.     //         blockedIcon: e,
  659.     //         genderIcon: "/sites/all/modules/avc/avc_ui/images/genders/" +
  660.     //             c.gender + ".png",
  661.     //         countryCodeIcon: "/sites/all/modules/avc/avc_ui/images/flags/" + c.countryCode + ".svg",
  662.     //         userLevelIcon: "/sites/default/files/badges/" + c.badge + ".png",
  663.     //         profileImg: c.profileImg,
  664.     //         self: socket.id == c.sid ? !0 : !1
  665.     //     })
  666.     // }
  667.     // "users" == a && $('a[data-target="#users"]').parent("li").hasClass("active") ? usersListTitleChange(roomUserLists[$(".userList div.active").data("roomid")].items.length, $(".userList div.active").data("roomname")) : $('a[data-target="#' + a + '"]').parent("li").hasClass("active") && usersListTitleChange(b.items.length, a.charAt(0).toUpperCase() + a.slice(1))
  668. }
  669.  
  670. function userListRemove(a, b, c) {
  671.     // "blocked" == a ? c.siteId ? b.remove("siteId", c.siteId) : b.remove("clientId", c.clientId) : b.remove("sid", c.sid);
  672.     // 0 === b.items.length && $(b.listContainer).find(".emptyList").removeClass("hidden");
  673.     // "users" == a && $('a[data-target="#users"]').parent("li").hasClass("active") ? usersListTitleChange(roomUserLists[$(".userList div.active").data("roomid")].items.length, $(".userList div.active").data("roomname")) : $('a[data-target="#' + a + '"]').parent("li").hasClass("active") && usersListTitleChange(b.items.length, a.charAt(0).toUpperCase() + a.slice(1))
  674. }
  675.  
  676. function populateUserList(a, b, c) {
  677.     // void 0 !== roomUserLists[b] && roomUserLists[b].clear();
  678.     // var f = 0;
  679.     // roomUserLists[b] = new List("ul_" + b, newListOptions);
  680.     // roomUserLists[b].on("searchComplete", function(a) {
  681.     //     a.matchingItems.length || $(a.list).html('<div class="p-a text-muted text-center">No results found.</div>')
  682.     // });
  683.     // Object.keys(a).forEach(function(c) {
  684.     //     f++;
  685.     //     userListAdd("users", roomUserLists[b], a[c])
  686.     // });
  687.     // $('a[data-target="#users"]').parents("li").hasClass("active") && usersListTitleChange(f, c)
  688. }
  689.  
  690. function usersListTitleChange(a, b) {
  691.     // null === b ? $("#ul-title").html($("#ul-title").text().replace(/\((.+?)\)/g, "(" + a + ")")) : $("#ul-title").html("(" + a + ") " + b)
  692. }
  693. var blockListOpts = {
  694.     valueNames: ["name", {
  695.         name: "siteId",
  696.         attr: "data-siteid"
  697.     }, {
  698.             name: "clientId",
  699.             attr: "data-clientid"
  700.         }],
  701.     item: '<div style="padding-bottom: 5px;"><div class="media-body" style="padding-top: 5px;"><span class="name" style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 150px; display: inline-block;"></span><a class="btn btn-default-outline btn-xs btn-pill pull-right siteId clientId removeBlock">Remove</a></div></div>'
  702. },
  703.     newListOptions = {
  704.         valueNames: ["name", "gender", "idleIcon", "blockedIcon", "idle", "countryCode", "cam", "camIcon", "modIcon", "profileImg", {
  705.             data: ["sid", "siteId", "self", "clientId"]
  706.         }, {
  707.                 name: "link",
  708.                 attr: "href"
  709.             }, {
  710.                 name: "genderIcon",
  711.                 attr: "src"
  712.             }, {
  713.                 name: "countryCodeIcon",
  714.                 attr: "src"
  715.             }, {
  716.                 name: "userLevelIcon",
  717.                 attr: "src"
  718.             }],
  719.         item: '<a data-target="#user_options" class="list-group-item cur-pointer" data-ulitem=""><ul class="avatar-list m-a-0"><li class="avatar-list-item" style="width: auto;"><img class="userLevelIcon img-circle" style="width:14px; height:14px; margin-top:-3px;"></li><li class="avatar-list-item" style="width: auto;"><img class="genderIcon" style="width:14px; height:14px; margin-top:-3px;"><span class="idleIcon"></span><span class="blockedIcon"></span></li><li class="avatar-list-item" style="width: auto;"><div class="countryCodeIcon-wrapper"><img class="countryCodeIcon" src=""></div></li><li class="avatar-list-item camIcon" style="width: auto;"><span class="icon icon-video-camera off"></span></li><li class="avatar-list-item name"></li><li class="avatar-list-item modIcon pull-right"></li></ul></a>',
  720.         searchColumns: ["name"]
  721.     };
  722. $(function () {
  723.     // $("body").on("click", "a.list-group-item", function(a) {
  724.     //     $(this).blur();
  725.     //     $(this).data("section") && (a.preventDefault(), $(".modal-content.main").hide(), $(".modal-content." + $(this).data("section")).show())
  726.     // });
  727.     // $("body").on("click", ".section-close", function(a) {
  728.     //     $(this).parents(".modal-content").hide();
  729.     //     $(".modal-content.main").show()
  730.     // });
  731.     // $("body").on("click", ".removeBlock", function(a) {
  732.     //     $(this).data("siteid") ? blockList("unblock", {
  733.     //         siteId: $(this).data("siteid"),
  734.     //         clientId: null
  735.     //     }) : blockList("unblock", {
  736.     //         siteId: 0,
  737.     //         clientId: $(this).data("clientid")
  738.     //     })
  739.     // });
  740.     // $("body").on("click", "[data-ulmenu]", function(a) {
  741.     //     a.preventDefault();
  742.     //     if ("" !== $(this).data("ulmenu")) {
  743.     //         $("#user_action_slider").is(":visible") && $("#user_action_slider").hide();
  744.     //         a = $(this).data("ulmenu").toLowerCase();
  745.     //         var b = $(this).closest("[id^='user_action_']").data("sid"),
  746.     //             c = $(this).closest("[id^='user_action_']").data("clientid"),
  747.     //             f = $(this).closest("[id^='user_action_']").data("siteid"),
  748.     //             e = $(this).closest("[id^='user_action_']").data("roomid"),
  749.     //             d = inList(roomUserLists[e], "sid", b);
  750.     //         b = inList(roomUserLists[e], "sid", socket.id);
  751.     //         if (!1 === d && "unblock" != a) notifyUser("User action (" + a + ") has failed, this person may have left the chat by now.");
  752.     //         else switch (a) {
  753.     //             case "profile":
  754.     //                 0 === d.siteId ? notifyUser("This user is not signed in to Epikchat.com") : window.open("/" + d.name);
  755.     //                 break;
  756.     //             case "view":
  757.     //                 sendViewRequest(d.sid, d.cam);
  758.     //                 break;
  759.     //             case "poke":
  760.     //                 pokeUser(e, d.sid, d.name);
  761.     //                 break;
  762.     //             case "message":
  763.     //                 "member" == b.badge || "guest" == b.badge ? notifyUser("You must be a verified member to initiate private messages. <a href='/verify' target='_blank'>Get verified</a>") : $('a[data-target="#ct_' + d.sid + '"]').length ? $('a[data-target="#ct_' + d.sid + '"]').click() : (newChatTab("#ct_" + d.sid, e, d.sid, d.name, d.sid), addToChatArea(d.sid, '<div style="background-color:#f0f8ff; margin: 0;"><strong>Private chat with: ' + d.name + "</strong></div>"), $('a[data-target="#ct_' + d.sid + '"]').tab("show"), $('a.btn[data-dest="all"]').children(".chat-tabs-closer").css("visibility", "visible"), $(".emojionearea-editor").focus());
  764.     //                 break;
  765.     //             case "inviteview":
  766.     //                 inviteUser("view", e, d.sid, d.name, "");
  767.     //                 break;
  768.     //             case "inviteroom":
  769.     //                 $("#inviteroom_modal").find("select").html("");
  770.     //                 $("#inviteroom_modal").find("#inviteroom_roomId").val(e);
  771.     //                 $("#inviteroom_modal").find("#inviteroom_sid").val(d.sid);
  772.     //                 $("#inviteroom_modal").find("#inviteroom_name").val(d.name);
  773.     //                 for (var g in roomUserLists) roomUserLists.hasOwnProperty(g) && (a = roomUserLists[g].get("siteId", b.siteId), a.length && "" !== a[0].values().modIcon && $("#inviteroom_modal").find("select").append($("<option>", {
  774.     //                     value: g,
  775.     //                     text: $('#ctabs a[data-target="#ct_' + g + ", #ul_" + g + '"]').find("strong").text()
  776.     //                 })));
  777.     //                 $("#inviteroom_modal").modal("show");
  778.     //                 break;
  779.     //             case "kick":
  780.     //                 kickUserFromRoom(e, d.sid);
  781.     //                 break;
  782.     //             case "ban":
  783.     //                 banUserFromRoom(e, d.sid);
  784.     //                 break;
  785.     //             case "report":
  786.     //                 $("#reportUser_modal .modal-title").html("Report " + d.name);
  787.     //                 $("#report_sid").val(d.sid);
  788.     //                 $("#report_roomid").val(e);
  789.     //                 $("#reportUser_modal .sug_ban_link").html('<small>You can also <a href="' + d.sid + '" data-name="' + d.name + '" id="suggest_ban">suggest a ban</a> of this user.</small>');
  790.     //                 $("#reportUser_modal").modal("show");
  791.     //                 break;
  792.     //             case "block":
  793.     //                 blockList("block", {
  794.     //                     sid: d.sid,
  795.     //                     siteId: d.siteId,
  796.     //                     clientId: d.clientId,
  797.     //                     name: d.name + (d.siteId ? "" : " (guest)")
  798.     //                 });
  799.     //                 break;
  800.     //             case "unblock":
  801.     //                 blockList("unblock", {
  802.     //                     siteId: f,
  803.     //                     clientId: c
  804.     //                 })
  805.     //         }
  806.     //     }
  807.     // })
  808. });
  809. $(function () {
  810.  
  811.     // idleInterval = setInterval(timerIncrement, 6E4);
  812.     // $(window).bind("mousemove keydown", function() {
  813.     //     idleTime >= considerIdle && idleNow(!1);
  814.     //     idleTime = 0
  815.     // })
  816. });
  817.  
  818. function timerIncrement() {
  819.     // idleTime++;
  820.     // idleTime == considerIdle && idleNow(!0)
  821. }
  822.  
  823. function idleNow(a) {
  824.     // socket.emit("idle", {
  825.     //     isIdle: a
  826.     // }, function(a) {
  827.     //     a.sent || console.log("Idle transmission error.")
  828.     // })
  829. }
  830. $(function () {
  831.     // $("body").on("input", "#optTextSize", function(a) {
  832.     //     $(".chat-text").css("font-size", $(this).val() + "px")
  833.     // });
  834.     // $("body").on("hidden.bs.modal", ".modal", function() {
  835.     //     $("a").blur()
  836.     // });
  837.     // $("div.checkbox input").change(function() {
  838.     //     $(this).blur()
  839.     // });
  840.     // $("#optEnableSidebar").change(function() {
  841.     //     $("#sidebar").toggleClass("hidden");
  842.     //     $("#optEnableSidebar").is(":checked") && socket.connected && getSidebarData()
  843.     // });
  844.     // $("#optStackBrdcsts").change(function() {
  845.     //     $("#broadcastSlots").toggleClass("stackBrdcsts")
  846.     // });
  847.     // $("#optDarkTheme").change(function() {
  848.     //     $("body").toggleClass("dark-theme")
  849.     // });
  850.     // $(".logo.navbar-btn").removeAttr("href").removeAttr("title")
  851. });
  852. $(window).focus(function () {
  853.     // count = 0;
  854.     // isActive = !0;
  855.     // window.setTimeout(function() {
  856.     //     $(document).attr("title", "Chat | EpikChat")
  857.     // }, 150)
  858. });
  859. $(window).blur(function () {
  860.     // count = 0;
  861.     // isActive = !1
  862. });
  863. window.onbeforeunload = function (a) {
  864.     // if (leave_chat_warning && 0 < localTotal) return a.returnValue = "You have unread messages in open chat rooms or PMs."
  865. };
  866.  
  867. function linkify(a) {
  868.     // a = a.replace(/(\b(https?):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim, '<a href="$1" class="tcLink">$1</a>');
  869.     // return a = a.replace(/(^|[^\/])(www\.[^.\s:]+\.[^.\s:]+(\b|$))/gim, '$1<a href="http://$2" class="tcLink">$2</a>')
  870. };;
  871. var logItemCount, logItemClicks = readCookie("cl_clicks"),
  872.     isActive = !0,
  873.     leave_chat_warning = !0,
  874.     count = 0;
  875.  
  876. function saveChatSettings() {
  877.     // localStorage.setItem("chat_settings", JSON.stringify({
  878.     //     enableSidebar: $("#optEnableSidebar").is(":checked"),
  879.     //     stackBrdcsts: $("#optStackBrdcsts").is(":checked"),
  880.     //     enablePM: $("#optEnablePM").is(":checked"),
  881.     //     textSize: $("#optTextSize").val(),
  882.     //     soundsMsg: $("#optSoundsMsg").is(":checked"),
  883.     //     soundsPoke: $("#optSoundsPoke").is(":checked"),
  884.     //     soundsViewReq: $("#optSoundsViewReq").is(":checked"),
  885.     //     showJlMsgs: $("#optShowJlMsgs").is(":checked"),
  886.     //     textColor: $("#optTextColor").data("color"),
  887.     //     darkTheme: $("#optDarkTheme").is(":checked")
  888.     // }))
  889. }
  890. $(function () {
  891.     // var b = localStorage.getItem("chat_settings");
  892.     // b && (b = JSON.parse(b), $("#optEnableSidebar").prop("checked", b.enableSidebar), $("#optStackBrdcsts").prop("checked", b.stackBrdcsts), $("#optEnablePM").prop("checked", b.enablePM), $("#optTextSize").val(b.textSize), $("#optSoundsMsg").prop("checked", b.soundsMsg), $("#optSoundsPoke").prop("checked", b.soundsPoke), $("#optSoundsViewReq").prop("checked", b.soundsViewReq), $("#optShowJlMsgs").prop("checked", b.showJlMsgs), $("#optDarkTheme").prop("checked", b.darkTheme), b.enableSidebar || $("#sidebar").addClass("hidden"), b.stackBrdcsts && $("#broadcastSlots").addClass("stackBrdcsts"), b.textColor && $("#optTextColor").data("color", b.textColor), b.darkTheme && $("body").toggleClass("dark-theme"));
  893.     // $("#optTextColor").css("background-color", $("#optTextColor").data("color"));
  894.     // $('a[data-toggle="tab"]').on("shown.bs.tab", function(a) {
  895.     //     a = $(a.target).attr("href");
  896.     //     "#home-media-photos" == a ? $("#media-section-header-text").text("photos") : "#home-media-doodles" == a && $("#media-section-header-text").text("doodles")
  897.     // });
  898.     // $("#createDoodleModal").draggable({
  899.     //     handle: ".modal-header",
  900.     //     containment: "body"
  901.     // });
  902.     // $("#wPaint").wPaint({
  903.     //     path: "/sites/all/modules/avc/avc_ui/js/wPaint/",
  904.     //     bg: "#ffffff",
  905.     //     menuOffsetLeft: -3,
  906.     //     menuOffsetTop: 240,
  907.     //     saveImg: saveImg,
  908.     //     menuHandle: !1,
  909.     //     mode: "pencil",
  910.     //     lineWidth: "3",
  911.     //     fillStyle: "#2187D8",
  912.     //     strokeStyle: "#15C223",
  913.     //     onShapeMove: function(a) {
  914.     //         $(".uploadDoodle").addClass("btn-success");
  915.     //         $(".uploadDoodle").prop("disabled", !1)
  916.     //     }
  917.     // });
  918.     // $("body").on("click", ".minimize", function() {
  919.     //     $(this).parent().siblings(".modal-body").hide();
  920.     //     $(this).parent().parent().parent().parent().css("height", "42px");
  921.     //     $(this).addClass("maximize");
  922.     //     $(this).removeClass("minimize");
  923.     //     $(this).blur()
  924.     // });
  925.     // $("body").on("click", ".maximize", function() {
  926.     //     $(this).parent().siblings(".modal-body").show();
  927.     //     $(this).parent().parent().parent().parent().css("height", $(this).parent().parent().parent().css("height"));
  928.     //     $(this).addClass("minimize");
  929.     //     $(this).removeClass("maximize");
  930.     //     $(this).blur()
  931.     // });
  932.     // $("body").on("click", ".sbMediaItem", function() {
  933.     //     viewMedia($(this).data("url"))
  934.     // });
  935.     // $("body").on("click", ".sbTrendingItem", function() {
  936.     //     roomInfo($(this).data("roomid"))
  937.     // });
  938.     // $("body").on("click", "#uploadDoodle", function() {
  939.     //     $("#uploadDoodle").prop("disabled", !0);
  940.     //     $.ajax({
  941.     //         type: "POST",
  942.     //         url: "/user_media/doodle/post",
  943.     //         data: {
  944.     //             title: $("#doodleTitle").val(),
  945.     //             doodle: $("#wPaint").wPaint("image")
  946.     //         },
  947.     //         dataType: "json",
  948.     //         success: function(a) {
  949.     //             !0 === a.status ? ($("#doodleSuccess").show(), $("#wPaint").wPaint("clear"), $("#doodleTitle").val("")) : (alertPopup("Error", a.message, "Ok", !1, !1, ""), $("#uploadDoodle").prop("disabled", !1))
  950.     //         }
  951.     //     })
  952.     // })
  953. });
  954.  
  955. function roomInfo(b) {
  956.     // if (!b) return !1;
  957.     // socket.emit("getRoomInfo", {
  958.     //     roomId: b
  959.     // }, function(a) {
  960.     //     if (a.status) {
  961.     //         var c = "" === a.room.coverImg ? "no_coverImg.jpg" : a.room.coverImg,
  962.     //             d = "" === a.room.icon ? "no_icon.png" : a.room.icon;
  963.     //         $("#roomInfoModal").find(".panel-heading").css("background-image", "url(/sites/default/files/chat/room_coverImg_uploads/" + c + ")");
  964.     //         $("#roomInfoModal").find(".panel-profile-img").attr("src", "/sites/default/files/chat/room_icon_uploads/" + d);
  965.     //         $("#roomInfoModal").find(".panel-title").html(a.room.name);
  966.     //         $("#roomInfoModal").find("p").html(a.room.description);
  967.     //         $("#roomInfoModal").find("button.roomInfo").data("roomid", b).data("passworded", a.room.passworded);
  968.     //         $("#roomInfoModal").find(".usersCount").html(a.room.users);
  969.     //         $("#roomInfoModal").find(".modal-title").html(a.room.name);
  970.     //         $("#roomInfoModal").modal("show")
  971.     //     } else notifyUser("Error: " + a.message)
  972.     // })
  973. }
  974.  
  975. function createDoodle() {
  976.     // if ($("#createDoodleModal").hasClass("in")) return !1;
  977.     // if (socket.userData.siteId) $("#doodleSuccess").hide(), $("#createDoodleModal").modal("show");
  978.     // else return alertPopup("Error", 'You must be logged in to create new doodles.<br><a href="/user/login" target="_blank">Log in</a> or <a href="/user/register" target="_blank">Create an account</a>', "Ok", !0, !1, ""), !1
  979. }
  980.  
  981. function uploadPhoto() {
  982.     // if ($("#uploadPhotoModal").hasClass("in")) return !1;
  983.     // if (socket.userData.siteId) $("#upload-photo-content").html(""), $(".indicator").show(), $("#uploadPhotoModal").modal("show"), $("#upload-photo-content").load("https://www.epikchat.com/developer/photos/new/js", function(b, a, c) {
  984.     //     "success" == a ? ($(".indicator").hide(), $("#upload-photo-content").show()) : "error" == a && ($(".indicator").hide(), msg = "403" == c.status ? 'You must be logged in to upload photos.<br><a href="/user/login" target="_blank">Log in</a> or <a href="/user/register" target="_blank">Create an account</a>' : "An unexpected error has occured: " + c.statusText + "(" + c.status + ")", $("#upload-photo-content").html('<div class="modal-header" style="padding: 0px 0px 6px 0px;border: none;"><div class="media-body text-center"><br><strong>' + msg + "</strong></div></div>"));
  985.     //     $("#upload-photo-content").show()
  986.     // });
  987.     // else return alertPopup("Error", 'You must be logged in to upload photos.<br><a href="/user/login" target="_blank">Log in</a> or <a href="/user/register" target="_blank">Create an account</a>', "Ok", !0, !1, ""), !1
  988. }
  989.  
  990. function saveImg(b) {
  991.     // var a = new Date,
  992.     //     c = a.getDate(),
  993.     //     d = a.getMonth() + 1;
  994.     // a = a.getFullYear();
  995.     // c = d + "_" + c + "_" + a;
  996.     // d = document.createElement("a");
  997.     // d.href = b;
  998.     // d.download = "My_EpikChat_Doodle_" + c + ".jpg";
  999.     // document.body.appendChild(d);
  1000.     // d.click();
  1001.     // this._displayStatus("Image saved.")
  1002. };;
  1003.  
  1004.  
  1005. function initSocket() {
  1006.     document.getElementById('initialiser').style.display = "none";
  1007.     document.getElementById('menu').innerHTML =
  1008.         "<div style='background:white; border-radius:5px; padding:0px 5px 5px 5px;'>" +
  1009.         "   <center><h3>EPIK MENU</h3></center>" +
  1010.         "   <a href='#' id='parrot' onclick='(doubleNotif = !doubleNotif)' class='btn btn-success' style='width:100%;'>PARROT [false]</a>" +
  1011.         "   <a href='#' id='poke' onclick='(autoPoke = !autoPoke)' class='btn btn-success' style='width:100%;'>AUTO POKE [false]</a>" +
  1012.         "   <a href='#' id='contentlength' onclick='showContentLength(); (lengthdisplay = !lengthdisplay)' class='btn btn-success' style='width:100%;'>SHOW LENGTH [false]</a>" +
  1013.         "   <div class='dropdown'>" +
  1014.         "       <button style='width:100%' class='btn btn-primary dropdown-toggle' data-toggle='dropdown' aria-expanded='false' type='button'>Zalgo Editor/Help</button>" +
  1015.         "       <div style='padding:10px 10px 10px 10px; background:lightgrey;' class='dropdown-menu' role='menu'>" +
  1016.         "          <p class='dropdown-item' role='presentation'>" +
  1017.         "              <fieldset style='margin:3px 3px 3px 3px; background:white; border-radius:5px;'><center>" +
  1018.         "                  <h4>INK TEXT</h4>" +
  1019.         "                  <input id='asmodeus_opt_up' type='checkbox'> INK UP</input><br>" +
  1020.         "                  <input id='asmodeus_opt_mid' type='checkbox' checked=''> INK MIDDLE</input><br>" +
  1021.         "                  <input id='asmodeus_opt_down' type='checkbox'> INK DOWN</input></center>" +
  1022.         "              </fieldset>" +
  1023.         "              <fieldset style='margin:3px 3px 3px 3px; background:white; border-radius:5px;'><center>" +
  1024.         "                  <h4>INK WEIGHT</h4>" +
  1025.         "                  <input id='asmodeus_opt_mini' type='radio' name='optval' checked=''> LIGHT INK</input><br>" +
  1026.         "                  <input id='asmodeus_opt_normal' type='radio' name='optval'> HEAVY INK</input><br>" +
  1027.         "                   <input id='asmodeus_opt_maxi' type='radio' name='optval'> MAX INK</input></center>" +
  1028.         "               </fieldset>" +
  1029.         "           </p>" +
  1030.         "           <center>Press # to Zalgo your Text</center>" +
  1031.         "       </div>" +
  1032.         "   </div>" +
  1033.         "</div>";
  1034.     socket.on("poke", function (a) {
  1035.         if (autoPoke === true) {
  1036.             pokeUser(a.roomId, a.senderSiteId, a.senderName);
  1037.             !1 === isBlocked(a.senderSiteId, a.senderClientId) && (addToChatArea(a.roomId, '<div class="notification"><span style="flex: 1; -ms-flex: 1;"><div class="pull-left bubble poke">😎 You poked back</div></span><span class="time-box pull-right text-right disable-select"><small>' + "" + "</small></span></div>"), notificationSound("Poke"))
  1038.         }
  1039.     });
  1040.     socket.on("connect", function () {
  1041.         // $("#loading-overlay").is(":visible") ? (console.log("Connected"), $(".loadingInfo").html("")) : (console.log("Reconnected"), $("#alert_modal").modal("hide"), notifyUser("You have reconnected to the chat."))
  1042.     });
  1043.     socket.on("connect_error", function (a) {
  1044.         // console.log("Connect failed (" + a + ")");
  1045.         // $("#loading-overlay").is(":visible") && $(".loadingInfo").html('<p>The connection is taking longer than usual.</p><p>See the <a href="https://status.epikchat.com" target="_blank">status page</a> for information on any known issues.</p>')
  1046.     });
  1047.     socket.on("reconnect_attempt", function (a) {
  1048.         // console.log("Connecting..");
  1049.         // $("#alert_modal .modal-body").html("The connection to the chat was interrupted. Attempting to reconnect...<br><br>Connection attempt: " + a)
  1050.     });
  1051.     socket.on("connectionAccepted", function (a) {
  1052.         // console.log("Log on successful (" + socket.id + ")");
  1053.         // socket.userData = a.userData;
  1054.         // idleTime = 0;
  1055.         // viewersList ? (viewersList.clear(), $("#ul_viewers .emptyList").removeClass("hidden")) : (viewersList = new List("ul_viewers", newListOptions), viewersList.on("searchComplete", function(a) {
  1056.         //     !a.matchingItems.length && 0 < viewersList.size() && $(a.list).html('<div class="p-a text-muted text-center">No results found.</div>')
  1057.         // }));
  1058.         // if (blockedList)
  1059.         //     for (a = 0; a < blockedList.items.length; a++) 0 !== blockedList.items[a]._values.siteId && blockedList.remove("siteId", blockedList.items[a]._values.siteId);
  1060.         // else blockedList = new List("ul_blocked", blockListOpts), blockedList.on("searchComplete", function(a) {
  1061.         //     !a.matchingItems.length && 0 < blockedList.size() && $(a.list).html('<div class="p-a text-muted text-center">No results found.</div>')
  1062.         // });
  1063.         // blockList("list", null);
  1064.         // $("#username").text(socket.userData.name);
  1065.         // $("#profileImg").attr("src", socket.userData.profileImg);
  1066.         // $("#badge").attr("src", "/sites/default/files/badges/" + socket.userData.badge + ".png");
  1067.         // $(".chat-nav").show();
  1068.         // var b = $(".chat-tabs li").length ? $('.chat-tabs a[data-dest="all"]').map(function() {
  1069.         //     return $(this).data("roomid")
  1070.         // }).get() : Drupal.settings.avc_ui.autoJoin.toString().split(",");
  1071.         // for (a = 0; a < b.length; a++) joinRoom(b[a], "");
  1072.         // $("#loading-overlay").is(":visible") && (getSidebarData(), setInterval(function() {
  1073.         //     $("#optEnableSidebar").is(":checked") && socket.connected && getSidebarData()
  1074.         // }, 1E4), $("#loading-overlay").fadeOut(), $("#optEnablePM").is(":checked") || setTimeout(function() {
  1075.         //     notifyUser('<span class="icon icon-info-with-circle pull-left" style="font-size: 16px;margin-right: 7px;height: 20px;"></span> You have private message receiving turned off, people will not be able to send you private messages. You can change this in your <a data-target="#chatSettings_modal" data-toggle="modal" href="">settings</a>.', !1, 2E4)
  1076.         // }, 2E3))
  1077.     });
  1078.     socket.on("systemAnnouncement", function (a) {
  1079.         // alertPopup("System Announcement", a.message, "Ok", !1, !1, "")
  1080.     });
  1081.  
  1082.     socket.on("invite", function (a) {
  1083.         // if (!1 === isBlocked(a.senderSiteId, a.senderClientId)) switch (a.type) {
  1084.         //     case "view":
  1085.         //         addToChatArea(a.roomId, '<div class="notification"><span style="flex: 1; -ms-flex: 1;"><div class="pull-left bubble invite">' + a.senderName + ' has invited you to <a class="viewInvite cur-pointer" data-sid="' + a.sid + '" data-cam="' + a.cam + '">view their broadcast</a></div></span><span class="time-box pull-right text-right disable-select"><small>' + convertTimestamp(Date.now()) + "</small></span></div>");
  1086.         //         break;
  1087.         //     case "room":
  1088.         //         addToChatArea(a.roomId, '<div class="notification"><span style="flex: 1; -ms-flex: 1;"><div class="pull-left bubble invite">' + a.senderName + ' has invited you to <a class="roomInvite cur-pointer" data-roomid="' + a.invitedRoomId + '" data-passworded="' + a.passworded + '">join room ' + a.invitedRoomName + '</a></div></span><span class="time-box pull-right text-right disable-select"><small>' + convertTimestamp(Date.now()) + "</small></span></div>")
  1089.         // }
  1090.     });
  1091.     socket.on("viewRequest", function (a) {
  1092.         // !1 === isBlocked(a.siteId, a.clientId) ? $("#privateBroadcast").is(":checked") ? (notifyUser(a.msg + '<span class="viewOptions pull-right"><a href="#" class="btn btn-sm" onClick="javascript:sendViewResponse(\'' + a.viewer + "', true);$(this).parent('span').html('<small>Permission Granted<small>');return false;\">Accept</a> <a href=\"#\" class=\"btn btn-sm\" onClick=\"javascript:sendViewResponse('" + a.viewer + "', false);$(this).parent('span').html('<small>Permission Denied<small>');return false;\">Deny</a></span><div class=\"spacer\" style=\"clear: both;\"></div></small>"), notificationSound("ViewReq")) : sendViewResponse(a.viewer, !0) : sendViewResponse(a.viewer, !1)
  1093.     });
  1094.     socket.on("viewResponse", function (a) {
  1095.         // a.canView ? startViewing(a.sid, a.name) : notifyUser(a.msg)
  1096.     });
  1097.     socket.on("viewer", function (a) {
  1098.         // "start" == a.action ? (userListAdd("viewers", viewersList, a.user), viewersList.sort("cam", {
  1099.         //     order: "asc"
  1100.         // })) : "stop" == a.action && userListRemove("viewers", viewersList, a.user);
  1101.         // $("#viewersCount").text(viewersList.items.length)
  1102.     });
  1103.     socket.on("vote2ban", function (a) {
  1104.         // notifyUser("<strong>Community Vote</strong><br>Would you like to ban: " +
  1105.         //     a.nominated.name + "<br><small>Started by: " + a.nominator.name + '<span class="voteOptions pull-right"><a href="#" class="btn btn-sm" onClick="javascript:voteForBan(1, \'yes\')">Yes</a> <a href="#" class="btn btn-sm" onClick="javascript:voteForBan(1, \'no\')">No</a></span></small>')
  1106.     });
  1107.     socket.on("userKicked", function (a) {
  1108.         // a.user.sid == socket.id ? (closeChatTab(a.roomId, !0), notifyUser("You were kicked from room: " + a.roomName, !0)) : addToChatArea(a.roomId, '<div class="notification kick"><span style="flex: 1; -ms-flex: 1;">' +
  1109.         //     a.user.name + " was kicked out of the room by " + a.kickedBy + '</span><span class="time-box pull-right text-right disable-select"><small>' + convertTimestamp(Date.now()) + "</small></span></div>")
  1110.     });
  1111.     socket.on("userBanned", function (a) {
  1112.         //     if (a.user.sid == socket.id) {
  1113.         //         closeChatTab(a.roomId, !0);
  1114.         //         var b = "";
  1115.         //         "Community Vote" == a.bannedBy && (b = " (10 minutes)");
  1116.         //         notifyUser("You were banned from room: " + a.roomName + b, !0)
  1117.         //     } else addToChatArea(a.roomId, '<div class="notification kick"><span style="flex: 1; -ms-flex: 1;">' + a.user.name +
  1118.         //         " was banned by " + a.bannedBy + '</span><span class="time-box pull-right text-right disable-select"><small>' + convertTimestamp(Date.now()) + "</small></span></div>")
  1119.     });
  1120.     socket.on("textMessage", function (a) {
  1121.         if (doubleNotif === true) {
  1122.             sendChatMsg(processEmoji(linkify(a.msg)));
  1123.         }
  1124.         // if (!1 === isBlocked(a.senderSiteId, a.senderClientId)) {
  1125.         //     if ("all" == a.dest) addToChatArea(a.roomId, '<div><span style="color:' + a.format.color + ';"><a data-target="#user_action_modal" data-sid="' + a.sid + '" data-siteid="' + a.senderSiteId + '" data-clientid="' + a.senderClientId + '" style="cursor:pointer;text-decoration:none; outline:none; color:' +
  1126.         //         a.format.color + ';"><strong>' + a.senderName + ":</strong> </a><span>" + processEmoji(linkify(a.msg)) + '</span></span><span class="time-box pull-right text-right"><small>' + convertTimestamp(a.time) + "</small></span></div>"), a = $('.chat-tabs a[data-target="#ct_' + a.roomId + ", #ul_" + a.roomId + '"]');
  1127.         //     else {
  1128.         //         if (!$('a[data-target="#ct_' + a.dest + '"]').length) {
  1129.         //             if (!$("#optEnablePM").is(":checked")) return !1;
  1130.         //             newChatTab("#ct_" + a.dest, a.roomId, a.dest, a.senderName, a.dest);
  1131.         //             addToChatArea(a.dest, '<div style="background-color:#f0f8ff; margin: 0;"><strong>Private chat with: ' +
  1132.         //                 a.senderName + "</strong></div>")
  1133.         //         }
  1134.         //         addToChatArea(a.dest, '<div><span style="color:' + a.format.color + ';"><a data-target="#user_action_modal" data-sid="' + a.sid + '" data-siteid="' + a.senderSiteId + '" data-clientid="' + a.senderClientId + '" style="cursor:pointer;text-decoration:none; outline:none; color:' + a.format.color + ';"><strong>' + a.senderName + ":</strong> </a><span>" + processEmoji(linkify(a.msg)) + '</span></span><span class="time-box pull-right text-right"><small>' + convertTimestamp(a.time) + "</small></span></div>");
  1135.         //         a = $('.chat-tabs a[data-target="#ct_' + a.dest + '"]')
  1136.         //     }
  1137.         //     a.hasClass("active") ? (notificationSound("Msg"), onNewMessageReceivedInActiveTab()) : a.children(".num-container").length ? (missed = parseInt(a.children(".num-container").children(".num-circle").html()) + 1, 9 < missed && (missed = "9+"), a.children(".num-container").children(".num-circle").html(missed), a.children(".num-container").show()) : a.append('<span class="num-container"><span class="num-circle visible">1</span></span>')
  1138.         // }
  1139.     });
  1140.     socket.on("userJoin", function (a) {
  1141.         //sendChatMsg(a.user.name + " just entered the flippin chatroom :sunglasses:");
  1142.         // userListAdd("users", roomUserLists[a.roomId], a.user);
  1143.         // roomUserLists[a.roomId].sort("cam", {
  1144.         //     order: "asc"
  1145.         // });
  1146.         // $("#optShowJlMsgs").is(":checked") && addToChatArea(a.roomId, '<div class="notification"><span style="flex: 1; -ms-flex: 1;"><div class="pull-left bubble">' + a.user.name + ' has entered the room</div></span><span class="time-box pull-right text-right disable-select"><small>' + convertTimestamp(Date.now()) + "</small></span></div>")
  1147.     });
  1148.     socket.on("userLeave", function (a) {
  1149.         // sendChatMsg(a.user + " Left the chat...");
  1150.         // userListRemove("users", roomUserLists[a.roomId], a.user);
  1151.         // $("#optShowJlMsgs").is(":checked") && addToChatArea(a.roomId, '<div class="notification"><span style="flex: 1; -ms-flex: 1;"><div class="pull-left bubble">' + a.user.name + ' has left the room</div></span><span class="time-box pull-right text-right disable-select"><small>' + convertTimestamp(Date.now()) + "</small></span></div>")
  1152.     });
  1153.     socket.on("liveStream", function (a) {
  1154.         // addToChatArea(a.roomId, '<div class="notification"><span style="flex: 1; -ms-flex: 1;"><a href="/' + a.user.name + '/live" target="_blank"><div class="pull-left bubble ls">' + a.user.name +
  1155.         //     ' is live now!  Click to watch the broadcast!</div></a></span><span class="time-box pull-right text-right disable-select"><small>' + convertTimestamp(Date.now()) + "</small></span></div>")
  1156.     });
  1157.     socket.on("userUpdate", function (a) {
  1158.         // var b = roomUserLists[a.roomId].get("sid", a.user.sid);
  1159.         // idleIcon = 0 !== a.user.idle ? '<svg viewBox="0 0 1000 1000" height="10" width="10" style="margin-top: 8px;margin-left: -9px; position:absolute;"><circle cx="500" cy="500" r="480" fill="#ffffff"></circle><path d="M500,10C229.8,10,10,229.8,10,500c0,270.2,219.8,490,490,490c270.2,0,490-219.8,490-490C990,229.8,770.2,10,500,10L500,10zM500,906.3C276,906.3,93.7,724,93.7,500C93.7,276,276,93.7,500,93.7C724,93.7,906.3,276,906.3,500C906.3,724,724,906.3,500,906.3L500,906.3z M325.3,500c-19.4,0-35.1,15.6-35.1,35s15.7,35,35.1,35h210c19.4,0,35-15.6,35-35V255.1c0-19.4-15.6-35.1-35-35.1c-19.4,0-35,15.7-35,35.1V500L325.3,500L325.3,500z" fill="#5e92c4"></path></svg>' : "";
  1160.         // switch (a.user.cam) {
  1161.         //     case 99:
  1162.         //         camIcon = '<span class="icon icon-video-camera off"></span>';
  1163.         //         break;
  1164.         //     case 0:
  1165.         //         camIcon = '<span class="icon icon-video-camera"></span>';
  1166.         //         break;
  1167.         //     case 1:
  1168.         //         camIcon = '<span class="icon icon-video-camera"></span><span class="icon icon-lock"></span>'
  1169.         // }
  1170.         // b[0].values({
  1171.         //     idle: a.user.idle,
  1172.         //     idleIcon: idleIcon,
  1173.         //     cam: a.user.cam + "_" + b[0].values().name,
  1174.         //     camIcon: camIcon
  1175.         // });
  1176.         // roomUserLists[a.roomId].sort("cam", {
  1177.         //     order: "asc"
  1178.         // });
  1179.         // b = viewersList.get("sid", a.user.sid);
  1180.         // b.length && (b[0].values({
  1181.         //     idle: a.user.idle,
  1182.         //     idleIcon: idleIcon,
  1183.         //     cam: a.user.cam + "_" + b[0].values().name,
  1184.         //     camIcon: camIcon
  1185.         // }), viewersList.sort("cam", {
  1186.         //     order: "asc"
  1187.         // }))
  1188.     });
  1189.     socket.on("editAdmins", function (a) {
  1190.         // var b = roomUserLists[a.roomId].get("siteId", a.siteId);
  1191.         // "add" == a.action ? (addToChatArea(a.roomId, '<div class="notification"><span style="flex: 1; -ms-flex: 1;"><div class="pull-left bubble">' + a.name + " has been promoted to " + a.type + " by " + a.actionBy + '</div></span><span class="time-box pull-right text-right disable-select"><small>' + convertTimestamp(Date.now()) + "</small></span></div>"), b.length && b[0].values({
  1192.         //     modIcon: '<span class="icon icon-star"></span>'
  1193.         // })) : "remove" == a.action && (addToChatArea(a.roomId, '<div class="notification"><span style="flex: 1; -ms-flex: 1;"><div class="pull-left bubble">' + a.name + "'s " + a.type + " privileges have been revoked by " + a.actionBy + '</div></span><span class="time-box pull-right text-right disable-select"><small>' + convertTimestamp(Date.now()) + "</small></span></div>"), b.length && b[0].values({
  1194.         //     modIcon: ""
  1195.         // }))
  1196.     });
  1197.     socket.on("sendReport", function (a) {
  1198.         // if (null !== webRtcPeerPresenter) {
  1199.         //     var b = document.getElementById("broadcast"),
  1200.         //         c = document.createElement("canvas");
  1201.         //     c.width = b.videoWidth;
  1202.         //     c.height = b.videoHeight;
  1203.         //     c.getContext("2d").drawImage(b, 0, 0);
  1204.         //     $.ajax({
  1205.         //         url: "/sites/all/modules/avc/avc_ui/reportImgUpload.php",
  1206.         //         method: "POST",
  1207.         //         data: {
  1208.         //             img: c.toDataURL("img/png"),
  1209.         //             reportId: a.reportId
  1210.         //         },
  1211.         //         success: function(a) {}
  1212.         //     })
  1213.         // }
  1214.     })
  1215.  
  1216.     console.log("Client Ready");
  1217. }
  1218.  
  1219. function joinRoom(a, b) {
  1220.     // console.log("Joining rid:" + a);
  1221.     // socket.emit("joinRoom", {
  1222.     //     roomId: a,
  1223.     //     password: b
  1224.     // }, function(c) {
  1225.     //     !0 === c.joined ? (console.log("Joined rid:" + c.room.roomId), $("#userLists, #chatArea").css("visibility", "visible"), $('#ctabs a[data-roomid="' + c.room.roomId + '"][data-dest="all"]').length ? addToChatArea(a, '<div><small class="text-muted"><i>You have reconnected to the room.</i></small></div>') : (newChatTab("#ct_" + c.room.roomId + ", #ul_" + c.room.roomId, c.room.roomId, "all", c.room.name, c.room.roomId), $('a.btn[data-dest="all"]').children(".chat-tabs-closer").css("visibility", "visible"), c.room.msgHistory.length && Object.keys(c.room.msgHistory).forEach(function(a) {
  1226.     //         historyText = c.room.msgHistory[a];
  1227.     //         addToChatArea(c.room.roomId, '<div class="text-muted"><span><strong>' + historyText.senderName + ":</strong> <span>" + processEmoji(historyText.msg) + '</span></span><span class="time-box pull-right text-right disable-select"><small>' + convertTimestamp(historyText.time) + "</small></span></div>")
  1228.     //     }), addToChatArea(c.room.roomId, '<div style="background-color:#f0f8ff; margin: 0;"><strong>You have entered room: ' +
  1229.     //         c.room.name + "</strong></div>" + (c.room.welcomeMsg ? '<div style="background-color:#f0f8ff; margin: 0;">' + processEmoji(linkify(c.room.welcomeMsg)) + "</div>" : "")), $("#users > .tab-content").append('<div id="ul_' + c.room.roomId + '" data-roomid="' + c.room.roomId + '" data-roomName="' + c.room.name + '" class="tab-pane btn-group" style="width:100%; height:calc(100% - 30px);"><div class="list" style=" height: 100%; overflow-y: auto; "></div><div class="form-group has-feedback"><input type="text" class="search form-control input-sm" placeholder="Search" /></div></div>')), $('a[data-target="#ct_' + c.room.roomId + ", #ul_" + c.room.roomId + '"]').tab("show"), populateUserList(c.room.users, c.room.roomId, c.room.name), roomUserLists[c.room.roomId].sort("cam", {
  1230.     //         order: "asc"
  1231.     //     }), scrollToBottom($('.chat-text[data-id="' + c.room.roomId + '"]')), $(roomUserLists[a].listContainer).children(".list").removeClass("offline")) : (notifyUser(c.msg), console.log("Could not join rid:" + a + " (" + c.msg + ")"), $('#ctabs a[data-roomid="' + a + '"][data-dest="all"]').length && ($(roomUserLists[a].listContainer).children(".list").addClass("offline"), addToChatArea(a, '<div><small class="text-muted"><i>You have reconnected to the chat server but were unable to automatically rejoin this room.</i></small></div>')))
  1232.     // })
  1233. }
  1234.  
  1235. function leaveRoom(a, b) {
  1236.     // socket.emit("leaveRoom", {
  1237.     //     roomId: a
  1238.     // }, function(a) {
  1239.     //     !1 === a.left && console.warn(a.msg);
  1240.     //     b()
  1241.     // })
  1242. }
  1243.  
  1244. function sendChatMsg(a) {
  1245.     // $tab = $(".chat-tabs .avatar-list-item.active a");
  1246.     // $("#message").val("");
  1247.     // $(".emojionearea-editor").length && $(".emojionearea-editor").html("");
  1248.     // socket.emit("distributeTextMessage", {
  1249.     //     roomId: $tab.data("roomid"),
  1250.     //     dest: $tab.data("dest"),
  1251.     //     msg: a,
  1252.     //     format: {
  1253.     //         color: $("#optTextColor").data("color")
  1254.     //     }
  1255.     // }, function(a) {
  1256.     //     a.sent || ("all" == $tab.data("dest") ? addToChatArea($(".chat-tabs .avatar-list-item.active a").data("roomid"), '<div><small class="text-muted"><i>' + linkify(a.msg) + "</i></small></div>") : addToChatArea($(".chat-tabs .avatar-list-item.active a").data("dest"), '<div><small class="text-muted"><i>' + linkify(a.msg) + "</i></small></div>"))
  1257.     // })
  1258. }
  1259.  
  1260. function kickUserFromRoom(a, b) {
  1261.     // socket.emit("kickUserFromRoom", {
  1262.     //     roomId: a,
  1263.     //     sid: b
  1264.     // }, function(a) {
  1265.     //     a.kicked || notifyUser("Server response error: " + a.msg)
  1266.     // })
  1267. }
  1268.  
  1269. function banUserFromRoom(a, b) {
  1270.     // socket.emit("banUserFromRoom", {
  1271.     //     roomId: a,
  1272.     //     sid: b
  1273.     // }, function(a) {
  1274.     //     a.banned || notifyUser("Server response error: " + a.msg)
  1275.     // })
  1276. }
  1277.  
  1278. function pokeUser(a, b, c) {
  1279.     // socket.emit("poke", {
  1280.     //     sid: b,
  1281.     //     roomId: a
  1282.     // }, function(b) {
  1283.     //     b.success ? (addToChatArea(a, '<div class="notification"><span style="flex: 1; -ms-flex: 1;"><div class="pull-left bubble poke">You have poked ' + c + '</div></span><span class="time-box pull-right text-right disable-select"><small>' + convertTimestamp(Date.now()) + "</small></span></div>"), notificationSound("Poke")) : notifyUser(b.message)
  1284.     // })
  1285. }
  1286.  
  1287. function inviteUser(a, b, c, d, e) {
  1288.     // socket.emit("invite", {
  1289.     //     type: a,
  1290.     //     roomId: b,
  1291.     //     destination: c,
  1292.     //     roomInvited: e
  1293.     // }, function(b) {
  1294.     //     b.sent ? notifyUser("You sent a " + a + " invite to " + d) : notifyUser(b.msg)
  1295.     // })
  1296. }
  1297.  
  1298. function blockList(a, b) {
  1299.     // function c(a, b, c) {
  1300.     //     for (d in roomUserLists) roomUserLists.hasOwnProperty(d) && (e = roomUserLists[d].get(a, b), e.length && Object.keys(e).forEach(function(a) {
  1301.     //         e[a].values({
  1302.     //             blockedIcon: c
  1303.     //         })
  1304.     //     }))
  1305.     // }
  1306.     // var d, e;
  1307.     // socket.emit("blockList", {
  1308.     //     action: a,
  1309.     //     user: b
  1310.     // }, function(e) {
  1311.     //     if (e.status) switch (a) {
  1312.     //         case "list":
  1313.     //             0 < e.list.length && e.list.map(function(a) {
  1314.     //                 userListAdd("blocked", blockedList, a)
  1315.     //             });
  1316.     //             break;
  1317.     //         case "block":
  1318.     //             userListAdd("blocked", blockedList, b);
  1319.     //             b.siteId ? c("siteId", b.siteId, '<span class="icon icon-block"></span>') : c("clientId", b.clientId, '<span class="icon icon-block"></span>');
  1320.     //             break;
  1321.     //         case "unblock":
  1322.     //             userListRemove("blocked", blockedList, b), b.siteId ? c("siteId", b.siteId, "") : c("clientId", b.clientId, "")
  1323.     //     } else "list" == a ? $("#ul_blocked .emptyList").text("You must be logged in to access your block list") : notifyUser(e.msg)
  1324.     // })
  1325. }
  1326.  
  1327. function requestVote(a, b) {
  1328.     // socket.emit("requestVote", {
  1329.     //     roomId: a,
  1330.     //     nominated: b
  1331.     // }, function(a) {
  1332.     //     a.sent ? notifyUser("<strong>Community Vote</strong><br>A vote to ban user: " + a.nominatedName + " has been started.") : notifyUser("An error occurred: " + a.msg)
  1333.     // })
  1334. }
  1335.  
  1336. function voteForBan(a, b) {
  1337.     // socket.emit("addVote", {
  1338.     //     roomId: a,
  1339.     //     vote: b
  1340.     // }, function(a) {
  1341.     //     $(".voteOptions").html("Voted")
  1342.     // })
  1343. }
  1344.  
  1345. function reportUser(a, b, c, d) {
  1346.     // socket.emit("reportUser", {
  1347.     //     roomId: a,
  1348.     //     reported: b,
  1349.     //     category: c,
  1350.     //     details: d
  1351.     // }, function(a) {
  1352.     //     a.sent ? notifyUser("Your report has been sent.") : notifyUser(a.message)
  1353.     // })
  1354. }
  1355.  
  1356. function roomsListRefresh() {
  1357.     // socket.emit("getRoomsList", function(a) {
  1358.     //     var b = "",
  1359.     //         c;
  1360.     //     a.sort(function(a, b) {
  1361.     //         return b.users - a.users
  1362.     //     });
  1363.     //     for (var d = 0; d < a.length; d++) {
  1364.     //         room = a[d];
  1365.     //         var e = c = "";
  1366.     //         var f = room.icon ? room.icon : "no_icon.png";
  1367.     //         room.closed ? (e = "span", c = '<li title="Room closed" data-toggle="tooltip" data-container=".media-list" style="font-size: 16px;color: #d83434; margin: -1px 7px;"><span class="icon icon-circle-with-cross"></span></li>') : (e = "a", 0 === room.user_level_restrictions[1] && (c = '<li title="No guest access" data-toggle="tooltip" data-container=".media-list" style="font-size: 15px;color: #FF9800; margin: -1px 7px;"><span class="icon icon-warning"></span></li>'), room.passworded && (c += '<li title="Password protected" data-toggle="tooltip" style="margin: -1px 7px;font-size:15px;" data-container=".media-list" ><span class="icon icon-lock"></span></li>'), c += '<li style="margin: 0px 7px;"><span class="icon icon-users"></span> ' + room.users + "</li>");
  1368.     //         b += "<" + e + ' class="list-group-item cur-pointer" data-roomid="' + room.roomId + '" data-users="' + room.users + '" data-passworded="' + room.passworded + '"><div class="media"><span class="media-left"><img class="img-circle media-object" src="/sites/default/files/chat/room_icon_uploads/' +
  1369.     //             f + '" style="width:42px;height:42px;"></span><div class="media-body" style="font-size:14px;"><div class="media-body"><div class="media-body-first">' + room.name + '</div><ul style="color: #676767;" class="nav nav-pills pull-right">' + c + '</ul></div><div class="media-body-secondary">' + room.description + "</div></div></div></" + e + ">"
  1370.     //     }
  1371.     //     $(".roomspicker").html(b);
  1372.     //     $('[data-toggle="tooltip"]').tooltip();
  1373.     //     $("#showEmpty").is(":checked") ? $(".roomspicker > a[data-users=0]").show() : $(".roomspicker > a[data-users=0]").hide();
  1374.     //     $("#roomsList_modal").find("h4.modal-title").text("Rooms (" + a.length + ")")
  1375.     // })
  1376. }
  1377.  
  1378. function getSidebarData() {
  1379.     // socket.emit("getSidebarData", function(a) {
  1380.     //     var b = [];
  1381.     //     a.roomList.sort(function(a, b) {
  1382.     //         return b.users - a.users
  1383.     //     });
  1384.     //     $.each(a.roomList, function(a, c) {
  1385.     //         c.systemRoom || (icon = c.icon ? c.icon : "no_icon.png", b.push('<a class="list-item sbTrendingItem cur-pointer" data-roomid="' + c.roomId + '"><div class="media"><span class="media-left" style="padding-right: 7px;"><img class="img-circle media-object" style="height:32px; width:32px;" src="/sites/default/files/chat/room_icon_uploads/' + icon + '"></span><div class="media-body" style="vertical-align: middle;"><div style="margin-top: -2px;max-width: 130px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">' +
  1386.     //             c.name + '</div><div class="text-muted" style="margin-top: -3px;font-size: 11px;"><span style="font-size: 11px;" class="icon icon-users"></span><span style="margin-top: -6px;"> ' + c.users + "</span></div></div></div></a>"))
  1387.     //     });
  1388.     //     $("#home-trending").html(b.slice(0, 5));
  1389.     //     var c = [];
  1390.     //     $.each(a.popularList, function(a, b) {
  1391.     //         0 === a ? c.push('<div style="display: block; padding: 4px 10px; color: #555; text-decoration: none;font-weight: 500;"><div class="media"><div class="media-body" style="vertical-align: middle;"><svg width="16" height="16" viewBox="2 -8 28 28" class="pull-left"><path d="M5 19h14v3h-14v-3zm18-11c-.729 0-1.295.79-.832 1.521-1.229 1.474-3.371 2.971-4.355 2.438-1.201-.65-.277-3.302.451-4.982.958.15 1.736-.591 1.736-1.477 0-.829-.672-1.5-1.5-1.5s-1.5.671-1.5 1.5c0 .452.204.853.52 1.127-.645 1.643-2.325 3.807-3.41 3.591-1.347-.268-1.69-3.448-1.685-5.287.62-.183 1.075-.751 1.075-1.431 0-.829-.672-1.5-1.5-1.5s-1.5.671-1.5 1.5c0 .68.455 1.248 1.075 1.432.006 1.839-.338 5.019-1.685 5.287-1.084.216-2.765-1.949-3.41-3.592.316-.274.52-.675.52-1.127 0-.829-.672-1.5-1.5-1.5s-1.5.671-1.5 1.5c0 .886.778 1.627 1.736 1.476.729 1.681 1.652 4.333.451 4.982-.984.533-3.127-.964-4.355-2.438.463-.73-.103-1.52-.832-1.52-.553 0-1 .448-1 1 0 .704.726 1.221 1.413.905 1.134 1.264 3.335 4.242 3.587 7.095h14c.252-2.853 2.453-5.831 3.587-7.095.687.316 1.413-.201 1.413-.905 0-.552-.447-1-1-1z" fill="#de1616" transform="rotate(-15)"></path></svg><span class="popListUn">' +
  1392.     //             b.name + '</span><span class="pull-right" style=" border-radius: 4px; width: 30px;text-align: center;"><b>' + b.viewers + "</b></span></div></div></div>") : c.push('<div style="display: block; padding: 4px 10px; color: #555; text-decoration: none;font-weight: 500;"><div class="media"><div class="media-body" style="vertical-align: middle;"><span class="popListUn">' + b.name + '</span><span class="pull-right" style=" border-radius: 4px; width: 30px;text-align: center;"><b>' + b.viewers + "</b></span></div></div></div>")
  1393.     //     });
  1394.     //     $("#home-popular").html(c);
  1395.     //     var d = [];
  1396.     //     socket.userData.siteId ? a.onlineFriends ? $.each(a.onlineFriends, function(a, b) {
  1397.     //         "online" == b.status && (onlineStatus = '<span class="status-online"></span>');
  1398.     //         "broadcasting" == b.status && (onlineStatus = '<span class="icon icon-video-camera pull-right" style="color: #1BBD1B;margin-top: -1px;">');
  1399.     //         d.push('<a href="/' + b.username + '" target="_blank" class="list-item"><div class="media"><span class="media-left" style="padding-right: 7px;"><img class="img-circle media-object" style="height:32px; width:32px;" src="' +
  1400.     //             b.img + '"></span><div class="media-body" style="vertical-align: middle;">' + b.username + '<span class="pull-right">' + onlineStatus + "</span></div></div></a>")
  1401.     //     }) : d.push('<div class="p-a text-center"><br><span class="icon icon-emoji-sad" style="font-size: 41px;color: #b5b5b5;"></span><br><small>No one seems to be online at the moment</small></div>') : d.push('<br><center><a href="/user/login" target="_blank" class="m-a-md"><small>Login to see who\'s online</small></a></center>');
  1402.     //     $("#friendsList").html(d);
  1403.     //     $.each(a.media, function(a, b) {
  1404.     //         var c = [],
  1405.     //             e = [];
  1406.     //         $.each(b, function(b, d) {
  1407.     //             e.push('<a class="sbMediaItem cur-pointer" data-url="/' + d.name.toLowerCase() + "/" + a + "/" + d.mid + '"><img src="/sites/default/files/media/' + d.uri + '" width="41" height="41" style="margin: 2px;  border-radius: 5px;  background: white;  border: 1px solid rgba(0, 0, 0, .1);"></a>');
  1408.     //             c.push('<a class="sbMediaItem cur-pointer" data-url="/' + d.name.toLowerCase() + "/" + a + "/" + d.mid + '"><img src="/sites/default/files/media/' + d.uri + '" width="51" height="51" style="margin: 5px; border-radius: 7px; background: white; border: 1px solid rgba(0, 0, 0, .1);"></a>')
  1409.     //         });
  1410.     //         $("#" + a + "List").html(e);
  1411.     //         $("#home-media-" + a).html(c.slice(0, 3))
  1412.     //     })
  1413.     // })
  1414. }
  1415.  
  1416. function startBroadcasting(a, b) {
  1417.     // if (a) return console.log(a);
  1418.     // var c = {
  1419.     //     id: "presenter",
  1420.     //     streamInfo: {
  1421.     //         sdpOffer: b,
  1422.     //         privateBroadcast: $("#privateBroadcast").is(":checked"),
  1423.     //         srcName: $("select#videoSource option:selected").text(),
  1424.     //         watermark: $("#watermark").is(":checked")
  1425.     //     }
  1426.     // };
  1427.     // $("#privateBroadcast").is(":checked") || $("#watermark").is(":checked") ? ($("#bcstIconWrap").removeClass("hidden"), $("#watermark").is(":checked") ? $("#wmSymbol").removeClass("hidden") : $("#wmSymbol").addClass("hidden"), $("#privateBroadcast").is(":checked") ? $("#lockSymbol").removeClass("hidden") : $("#lockSymbol").addClass("hidden")) : $("#bcstIconWrap").addClass("hidden");
  1428.     // socket.emit("userMedia", c, function(a) {
  1429.     //     a ? console.log(a) : console.log("ERROR")
  1430.     // })
  1431. }
  1432.  
  1433. function stopBroadcasting(a) {
  1434.     // webRtcPeerPresenter && (a || socket.emit("userMedia", {
  1435.     //     id: "stopBroadcast",
  1436.     //     sid: socket.id
  1437.     // }, function(a) {
  1438.     //     a ? console.log(a) : console.log("ERROR")
  1439.     // }), meters[socket.id] && meters[socket.id].stop(), webRtcPeerPresenter.dispose(), webRtcPeerPresenter = null);
  1440.     // video = document.getElementById("broadcast");
  1441.     // video.src = "";
  1442.     // window.stream && window.stream.getTracks().forEach(function(a) {
  1443.     //     a.stop()
  1444.     // });
  1445.     // try {
  1446.     //     viewersList.clear()
  1447.     // } catch (b) {}
  1448.     // $("#viewersCount").text(viewersList.items.length);
  1449.     // $('a[data-target="#viewers"]').parent("li").hasClass("active") && usersListTitleChange(viewersList.items.length, "Viewers");
  1450.     // $("#ul_viewers .emptyList").removeClass("hidden");
  1451.     // $("#broadcastWrapper").hide();
  1452.     // $("#thePanel").removeClass("broadcasting");
  1453.     // $(".muteMic").removeClass("active");
  1454.     // $(".pauseVideo").addClass("active");
  1455.     // $("#startBroadcasting").show()
  1456. }
  1457.  
  1458. function startViewing(a, b) {
  1459.     // function c(b, c) {
  1460.     //     if (b) return console.log(b);
  1461.     //     socket.emit("userMedia", {
  1462.     //         id: "viewer",
  1463.     //         streamInfo: {
  1464.     //             sdpOffer: c,
  1465.     //             sid: a
  1466.     //         }
  1467.     //     }, function(a) {
  1468.     //         a ? console.log(a) : console.log("ERROR")
  1469.     //     })
  1470.     // }
  1471.     // $("#broadcastSlots").append('<div class="bcst-player" data-sid="' + a + '"><div class="stack ecp-overlay"><div class="stopViewing avatar-list-item img-circle cur-pointer" data-sid="' + a + '"><div class="x">\u00d7</div></div><ul class="vidControls avatar-list" style="width: 100%;position: absolute;bottom: 0;"><li class="ecp-mute avatar-list-item pull-left cur-pointer"><svg height="29" version="1.1" viewBox="0 0 32 32" width="29"><path class="ytp-svg-fill ytp-svg-volume-animation-speaker" clip-path="url(#ytp-svg-volume-animation-mask)" d="M8,21 L12,21 L17,26 L17,10 L12,15 L8,15 L8,21 Z M19,14 L19,22 C20.48,21.32 21.5,19.77 21.5,18 C21.5,16.26 20.48,14.74 19,14 ZM19,11.29 C21.89,12.15 24,14.83 24,18 C24,21.17 21.89,23.85 19,24.71 L19,26.77 C23.01,25.86 26,22.28 26,18 C26,13.72 23.01,10.14 19,9.23 L19,11.29 Z" fill="#fff" id="ytp-svg-11"></path></svg><input class="vol-control" type="range" min="0" max="100" step="1" value="100"></li><li class="ecp-fullscreen avatar-list-item pull-right m-a-0 cur-pointer"><svg height="30" version="1.1" viewBox="5 0 32 32" width="30"><g class="ytp-fullscreen-button-corner-0"><use class="ytp-svg-shadow" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ytp-svg-18"></use><path class="ytp-svg-fill" d="m 10,16 2,0 0,-4 4,0 0,-2 L 10,10 l 0,6 0,0 z" id="ytp-svg-18" fill="#fff"></path></g><g class="ytp-fullscreen-button-corner-1"><use class="ytp-svg-shadow" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ytp-svg-19"></use><path class="ytp-svg-fill" d="m 20,10 0,2 4,0 0,4 2,0 L 26,10 l -6,0 0,0 z" id="ytp-svg-19" fill="#fff"></path></g><g class="ytp-fullscreen-button-corner-2"><use class="ytp-svg-shadow" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ytp-svg-20"></use><path class="ytp-svg-fill" d="m 24,24 -4,0 0,2 L 26,26 l 0,-6 -2,0 0,4 0,0 z" id="ytp-svg-20" fill="#fff"></path></g><g class="ytp-fullscreen-button-corner-3"><use class="ytp-svg-shadow" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ytp-svg-21"></use><path class="ytp-svg-fill" d="M 12,20 10,20 10,26 l 6,0 0,-2 -4,0 0,-4 0,0 z" id="ytp-svg-21" fill="#fff"></path></g></svg></li><li class="ecp-resize avatar-list-item pull-right cur-pointer" style="color: #fff;font-size: 16px;margin-top: 4px;"><span class="icon icon-resize-full-screen"></span></li></ul></div><div class="stack spinner"><div class="ispinner ispinner--white ispinner--animating ispinner--medium"><div class="ispinner__blade"></div><div class="ispinner__blade"></div><div class="ispinner__blade"></div><div class="ispinner__blade"></div><div class="ispinner__blade"></div><div class="ispinner__blade"></div><div class="ispinner__blade"></div><div class="ispinner__blade"></div><div class="ispinner__blade"></div><div class="ispinner__blade"></div><div class="ispinner__blade"></div><div class="ispinner__blade"></div></div></div><div class="username">' +
  1472.     //     b + '</div><div class="stack"><video autoplay playsinline data-sid="' + a + '" style="width: 100%;height: 100%;background-color: #000;"></video></div></div>');
  1473.     // scrollToBottom($(".chat-area > .tab-pane.active .chat-text"));
  1474.     // var d = {
  1475.     //     remoteVideo: document.querySelector('video[data-sid="' + a + '"]'),
  1476.     //     onicecandidate: function(b) {
  1477.     //         socket.emit("userMedia", {
  1478.     //             id: "onIceCandidate",
  1479.     //             candidate: b,
  1480.     //             sid: a
  1481.     //         })
  1482.     //     }
  1483.     // };
  1484.     // webRtcPeerViewer[a] = kurentoUtils.WebRtcPeer.WebRtcPeerRecvonly(d, function(b) {
  1485.     //     if (b) return console.log(b);
  1486.     //     this.generateOffer(c);
  1487.     //     "safari" == adapter.browserDetails.browser && ($('.bcst-player[data-sid="' + a + '"]').find(".ecp-mute > svg").click(), $('.bcst-player[data-sid="' + a + '"]').find(".vol-control").addClass("hidden"), $('.bcst-player[data-sid="' + a + '"]').find(".ecp-fullscreen").addClass("hidden"))
  1488.     // })
  1489. }
  1490.  
  1491. function stopViewing(a) {
  1492.     // socket.emit("userMedia", {
  1493.     //     id: "stopViewer",
  1494.     //     broadcaster: a
  1495.     // }, function(a) {
  1496.     //     a ? console.log(a) : console.log("ERROR")
  1497.     // });
  1498.     // removePlayer(a)
  1499. }
  1500.  
  1501. function sendViewRequest(a, b) {
  1502.     // if (!navigator.getUserMedia) return notifyUser("Broadcast viewing is not supported with this browser."), !1;
  1503.     // $('.bcst-player[data-sid="' + a + '"]').length ? notifyUser("You are already viewing this user") : socket.emit("viewRequest", {
  1504.     //     sid: a
  1505.     // }, function(a) {
  1506.     //     a.sent ? String(b).startsWith(1) && notifyUser("Your request to view was sent to " + a.sentTo + ", please wait for a response.") : notifyUser(a.message)
  1507.     // })
  1508. }
  1509.  
  1510. function sendViewResponse(a, b) {
  1511.     // socket.emit("viewResponse", {
  1512.     //     viewer: a,
  1513.     //     canView: b
  1514.     // }, function(a) {})
  1515. };;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement