Advertisement
Guest User

Asmodeus Menu - Epik Chat (11)

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