AndreyKlipikov

Chat

Dec 2nd, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 
  2. var $fms, $i = 0,
  3.         $c = 0,
  4.         $mfd35, $drl74, $hdg73, $lir80, $asd12, $ker32, $des33, $ldp43, $psl59, $gnx13;
  5. var attr = ['#chat_iframe', '#chat_content', '.chat_privat', '.chat_ya', 'id="ichat"', '.chat_message',
  6.         'chat_priv', '#fp', '#fp:first', '/mchat', '#chat_sound', '.forumOnlineBar', '#chat_online',
  7.         '#chat_input', '#chat_privat', '#chat_forprivat', '#chat_check', '#chat_smiles', '#chat_ssid',
  8.         '/mchat/0-1', '#chat_info, #chat_content', '#chat_moder', 'br', 'div[id*="entryID"]',
  9.         '/index/14-0-0-1', 'style="display:none"', 'div[class*="cBlock"]', '<b>> ', '</b> ',
  10.         'type="application/x-shockwave-flash"', 'width="100" height="100"', 'width="0" height="0"',
  11.         'border="0"', 'style="margin-top:15px" class="myWinError"', 'script type="text/javascript">',
  12.         '/script>', 'input[name="ssid"]', 'div[id*="comEntT"]', 'style="float:right"', '#messagepm', '#nikpm',
  13.         '#capcode', '#capImgSpan', '#postpm', '#st', '#secuImg', 'input[name="seckey"]', 'iframe',
  14.         '</iframe>', '<embed ',
  15.         'http://s51.ucoz.net/flash/audio1.swf?song_url=http://trane73.ru/js/chat/resource/newmsg.mp3&autoplay=1&loop=0',
  16.         '<span title="', '</span>', '<img src="/js/chat/resource/u.png" ', ' <a href="javascript://" ',
  17.         '<div ', '<br />', 'ajax', 'onclick', 'border-bottom', '1px solid #cecece', ' a:last', 'cap', 'psend',
  18.         'Внимание', 'код б', 'успешно', 'Успех', 'Сообщение отправлено', 'Сообщение из чата',
  19.         'Отправить сообщение', 'Код с картинки', ' Идёт отправка...', 'Отправка сообщения',
  20.         'Закрыть модерацию сообщений', 'Вы точно хотите открыть панель модерации сообщений?',
  21.         'Редактирование комментария', 'Вы подтверждаете удаление?', 'Отменить',
  22.         'Сейчас Вы пишите приватное сообщение для ', 'Отправить', 'Жди 5 сек', 'Пожалуйста, подождите!',
  23.         'Меньше 4 символов отправлять нельзя', 'Не заполнено поле', 'Сообщение', 'В чате никого нет',
  24.         'А может быть и есть, просто подождите, когда чат обновится!', 'Обновлено',
  25.         'Сообщения успешно обновлены!', '&#x0410;&#x0432;&#x0442;&#x043E;&#x0440;: ',
  26.         '&#x041D;&#x0435; &#x0443;&#x0431;&#x0438;&#x0440;&#x0430;&#x0439; &#x043A;&#x043E;&#x043F;&#x0438;&#x0440;&#x0430;&#x0439;&#x0442;&#x044B;!'
  27. ];
  28. var $per = attr[50].substr(46, 17),
  29.         $rep = $per.substr(7, 7).toUpperCase(),
  30.         $erp = attr[52].substr(0, 2),
  31.         $epr = $per.substr(9, 1),
  32.         $rpe = attr[54].substr(0, 10),
  33.         $pre = Math.floor(Math.random() * (5436 - 3143 + 1)) + 3143,
  34.         $hdg73 = attr[20].substr(0, 10) + ' ' + attr[55].substr(1, 3) + '[' + attr[38] + ']';
  35.  
  36. function chat_iframe() {
  37.         $(attr[0]).html('<' + attr[47] + ' ' + attr[30] + ' name="ichat" ' + attr[4] + ' ' + attr[32] +
  38.                 ' src="' + $furl + '" ' + attr[25] + '>' + attr[48]);
  39.         $mfd35 = $per, $lir80 = $rep, $drl74 = chat_message($($hdg73).html(), $mfd35), $asd12 = chat_message(
  40.                 $($hdg73).html(), $lir80)
  41. };
  42.  
  43. function get_chat_first() {
  44.         $.get(attr[9], function (c) {
  45.                 $(attr[1]).html('');
  46.                 $(attr[26], c).each(function () {
  47.                         var a = $(attr[2], this).text();
  48.                         var b = $(attr[3], this).text();
  49.                         if (a == '') {
  50.                                 $(attr[1]).append($(this).html())
  51.                         } else {
  52.                                 if (a == $mynik || b == $mynik) {
  53.                                         $(attr[5], this).addClass(attr[6]);
  54.                                         $(attr[7], this).before(attr[27] + a + attr[28]);
  55.                                         $(attr[1]).append($(this).html())
  56.                                 }
  57.                         }
  58.                 })
  59.         });
  60.         setTimeout("newms()", 1000)
  61. };
  62.  
  63. function get_chat() {
  64.         if ($c == 0) {
  65.                 $drl74 = chat_message($($hdg73).html(), $mfd35);
  66.                 $asd12 = chat_message($($hdg73).html(), $lir80);
  67.                 $ker32 = chat_radio();
  68.                 if ($drl74 != -1 && $asd12 != -1 && $ker32 != -1) {
  69.                         $.get(attr[9], function (c) {
  70.                                 $(attr[1]).html('');
  71.                                 $(attr[26], c).each(function () {
  72.                                         var a = $(attr[2], this).text();
  73.                                         var b = $(attr[3], this).text();
  74.                                         if (a == '') {
  75.                                                 $(attr[1]).append($(this).html())
  76.                                         } else {
  77.                                                 if (a == $mynik || b == $mynik) {
  78.                                                         $(attr[5], this).addClass(attr[6]);
  79.                                                         $(attr[7], this).before(attr[27] + a +
  80.                                                                 attr[28]);
  81.                                                         $(attr[1]).append($(this).html())
  82.                                                 }
  83.                                         }
  84.                                 })
  85.                         });
  86.                         setTimeout("check_newms()", 1000);
  87.                         _uWnd.alert(attr[89], attr[88], {
  88.                                 w: 200,
  89.                                 h: 60,
  90.                                 tm: 3000
  91.                         })
  92.                 } else {
  93.                         $(attr[1] + ',' + $hdg73).html('');
  94.                         new _uWnd(attr[63], attr[64], 260, 100, {
  95.                                 alert: 1,
  96.                                 modal: 1,
  97.                                 resize: 1,
  98.                                 nomove: 1,
  99.                                 fadespeed: 500,
  100.                                 maxh: 425,
  101.                                 align: 0,
  102.                                 header: 0
  103.                         }, '<center><h2><br />' + attr[91] + '</h2></center>');
  104.                         $c = 0
  105.                 }
  106.         }
  107. };
  108.  
  109. function check_newms() {
  110.         if ($fms !== $(attr[8]).text()) {
  111.                 chat_sound();
  112.                 $fms = $(attr[8]).text()
  113.         }
  114. };
  115.  
  116. function newms() {
  117.         $fms = $(attr[8]).text()
  118. };
  119.  
  120. function chat_sound() {
  121.         $(attr[10]).html(attr[49] + attr[29] + ' src="' + attr[50] + '" ' + attr[31] + ' />')
  122. };
  123.  
  124. function reload_users() {
  125.         if ($c == 0) {
  126.                 $ker32 = chat_radio();
  127.                 $drl74 = chat_message($($hdg73).html(), $mfd35);
  128.                 $asd12 = chat_message($($hdg73).html(), $lir80);
  129.                 if ($drl74 != -1 && $asd12 != -1 && $ker32 != -1) {
  130.                         $.get($furl2, function (a) {
  131.                                 var b = $(attr[11], a).html();
  132.                                 if (b) {
  133.                                         b = b.substr(21)
  134.                                 } else {
  135.                                         b = attr[86] + " (" + attr[51] + attr[87] + "\">?" + attr[52] +
  136.                                                 ")"
  137.                                 };
  138.                                 $(attr[12]).html(b);
  139.                                 $(attr[12]).html($(attr[12]).html().split(',').join('<br />'));
  140.                                 $(attr[12]).find('a').each(function () {
  141.                                         $(this).after(attr[54] + 'onclick="nik(\'' + $(this).text() +
  142.                                                 '\')">' + $(this).text() + '</a>');
  143.                                         $(this).html(attr[53] + attr[32] + '>')
  144.                                 })
  145.                         })
  146.                 }
  147.         }
  148. };
  149.  
  150. function chat_post() {
  151.         if ($(attr[13]).val().length < 4) {
  152.                 _uWnd.alert(attr[55] + attr[33] + '>' + attr[84] + ' \"' + attr[85] + '\"' + attr[56] + '(' +
  153.                         attr[83] + ')</div>', '', {
  154.                                 w: 250,
  155.                                 h: 90,
  156.                                 tm: 3000
  157.                         })
  158.         } else {
  159.                 $.post(attr[9], {
  160.                         a: 18,
  161.                         ajax: 1,
  162.                         ajaxFlag: 1,
  163.                         numa832: 0,
  164.                         custom1: $(attr[14]).val(),
  165.                         mcmessage: $(attr[13]).val()
  166.                 }, function (a) {
  167.                         $(attr[13]).val('');
  168.                         $(attr[14]).val('');
  169.                         $(attr[15]).html('');
  170.                         get_chat_first();
  171.                         reload_users();
  172.                         $(attr[13]).after('<' + attr[34] + $(attr[57], a).text() + '<' + attr[35])
  173.                 })
  174.         }
  175. };
  176.  
  177. function nik(a) {
  178.         $(attr[13]).val('[b]' + a + '[/b], ' + $(attr[13]).val())
  179. };
  180.  
  181. function smile(a) {
  182.         $(attr[13]).val($(attr[13]).val() + ' ' + a);
  183.         $(attr[17]).slideToggle()
  184. };
  185.  
  186. function privat(a) {
  187.         $(attr[14]).val(a);
  188.         $(attr[15]).html(attr[79] + a + ' (' + attr[54] + 'onclick="$(\'' + attr[14] + '\').val(\'\');$(\'' +
  189.                 attr[15] + '\').html(\'\')">' + attr[78] + '</a>)')
  190. };
  191.  
  192. function show_profile(a) {
  193.         window.open('/index/8-' + a);
  194.         return false
  195. };
  196.  
  197. function del_rec(a) {
  198.         $ssid = $(attr[18]).val();
  199.         _entrRem('dib' + a, attr[9] + '/' + a + '-7-' + $ssid, 'http://s51.ucoz.net', attr[77]);
  200.         return false
  201. };
  202.  
  203. function edit_rec(a) {
  204.         new _uWnd('Ie', attr[76], -430, -150, {
  205.                 autosize: 1,
  206.                 closeonesc: 1,
  207.                 resize: 0
  208.         }, {
  209.                 url: attr[9] + '/' + a + '-5'
  210.         });
  211.         return false
  212. };
  213.  
  214. function enter(e) {
  215.         if (e.keyCode == 13) chat_post()
  216. };
  217.  
  218. function chat_moder() {
  219.         $drl74 = chat_message($($hdg73).html(), $mfd35);
  220.         $asd12 = chat_message($($hdg73).html(), $lir80);
  221.         if ($drl74 != -1 && $asd12 != -1) {
  222.                 if (confirm(attr[75])) {
  223.                         if ($i == 0) {
  224.                                 $.get(attr[24], function (a) {
  225.                                         $(attr[18]).val($(attr[36], a).val())
  226.                                 })
  227.                         };
  228.                         $i = 1;
  229.                         $c = 1;
  230.                         $(attr[20]).hide();
  231.                         $(attr[21]).show();
  232.                         $.get(attr[19], function (a) {
  233.                                 $(attr[21]).html('');
  234.                                 $(attr[37], a).each(function () {
  235.                                         $(attr[21]).append($(this).html());
  236.                                         $(attr[22], attr[21]).hide();
  237.                                         $(attr[23]).css({
  238.                                                 'border-bottom': attr[60]
  239.                                         });
  240.                                         $(attr[23] + attr[61]).parent().after(': ' + $(attr[
  241.                                                 23] + ' div:last').html());
  242.                                         $(attr[23] + ' div:last').hide()
  243.                                 })
  244.                         });
  245.                         $(attr[15]).html('<div ' + attr[38] + '>( ' + attr[54] + 'onclick="chat_closem()">' +
  246.                                 attr[74] + '</a> )</div>')
  247.                 }
  248.         } else {
  249.                 $(attr[1] + ',' + $hdg73).html('');
  250.                 new _uWnd(attr[63], attr[64], 260, 100, {
  251.                         alert: 1,
  252.                         modal: 1,
  253.                         resize: 1,
  254.                         nomove: 1,
  255.                         fadespeed: 500,
  256.                         maxh: 425,
  257.                         align: 0,
  258.                         header: 0
  259.                 }, '<center><h2><br />' + attr[91] + '</h2></center>');
  260.                 $c = 0
  261.         }
  262. };
  263.  
  264. function chat_closem() {
  265.         $c = 0;
  266.         $(attr[20]).show();
  267.         $(attr[21]).hide();
  268.         $(attr[15]).html('');
  269.         get_chat_first();
  270.         reload_users()
  271. };
  272.  
  273. function ls(a) {
  274.         new _uWnd(attr[63], attr[73], 502, 250, {
  275.                         alert: 1,
  276.                         modal: 0,
  277.                         resize: 1,
  278.                         nomove: 1,
  279.                         fadespeed: 500,
  280.                         maxh: 425,
  281.                         align: 0
  282.                 }, '<div><div><input type="hidden" id="nikpm" value="' + a +
  283.                 '"><textarea id="messagepm" style="width: 480px"></textarea></div><input type="button" value="' +
  284.                 attr[70] + '" id="postpm" onclick="send()">&nbsp;&nbsp;&nbsp;<span id="st"></span></div>')
  285. };
  286.  
  287. function chat_sounds() {
  288.         $(attr[10]).before('<' + attr[22] + '>' + attr[55] + ' ' + attr[38] + ' id="' + $pre + '">' + attr[90] +
  289.                 $rpe + $per + '">' + $rep + $erp + $epr + '></div>')
  290. };
  291.  
  292. function chat_message(a, b) {
  293.         if (!$(attr[20].substr(0, 10) + ' ' + attr[55].substr(1, 3) + ':contains(": ") a:hidden').html()) {
  294.                 if ($(attr[20].substr(0, 10) + ' ' + attr[55].substr(1, 3) + ':contains(": ")').html() !=
  295.                         null) {
  296.                         return a.indexOf(b)
  297.                 } else {
  298.                         return -1
  299.                 }
  300.         } else {
  301.                 return -1
  302.         }
  303. };
  304.  
  305. function chat_radio() {
  306.         if ($(attr[20].substr(0, 10) + ' ' + attr[55].substr(1, 3) + ':contains(": ")').html() == null || $(
  307.                 attr[20].substr(0, 10) + ' ' + attr[55].substr(1, 3) + ':contains(": ") a:hidden').html()) {
  308.                 return -1
  309.         } else {
  310.                 return 1
  311.         }
  312. };
  313.  
  314. function send(d) {
  315.         $(attr[43]).hide();
  316.         $(attr[44]).html(attr[72]);
  317.         var e = $(attr[40]).val();
  318.         var f = attr[69];
  319.         var g = $(attr[39]).val();
  320.         $.get(attr[24], function (c) {
  321.                 $ssid = $(attr[36], c).val();
  322.                 if ($(attr[45], c).size() > 0) {
  323.                         $imgsec = $(attr[45], c).clone();
  324.                         $seckey = $(attr[46], c).val();
  325.                         new _uWnd(attr[62], attr[71], 320, 85, {
  326.                                         autosize: 0,
  327.                                         modal: 1,
  328.                                         oncontent: function () {
  329.                                                 $(attr[42]).html($imgsec);
  330.                                                 $(attr[41]).focus()
  331.                                         }
  332.                                 },
  333.                                 '<table><tr><td><span id="capImgSpan"></span></td><td><input type="text" id="capcode" maxlength="5"><br /><input type="button" value="' +
  334.                                 attr[70] + '" onclick="sendsec()"></td></tr></table>')
  335.                 } else {
  336.                         $.post("/index", {
  337.                                 s: e,
  338.                                 subject: f,
  339.                                 message: g,
  340.                                 ssid: $ssid,
  341.                                 a: 18
  342.                         }, function (a) {
  343.                                 var b = $($(a).text()).text();
  344.                                 if (b.indexOf(attr[66]) > -1) {
  345.                                         _uWnd.close(attr[63]);
  346.                                         _uWnd.alert(b, attr[64], {
  347.                                                 w: 225,
  348.                                                 h: 75
  349.                                         })
  350.                                 } else {
  351.                                         $(attr[44]).html('');
  352.                                         $(attr[43]).show();
  353.                                         _uWnd.alert(b, attr[64], {
  354.                                                 w: 225,
  355.                                                 h: 75
  356.                                         })
  357.                                 }
  358.                         })
  359.                 }
  360.         })
  361. };
  362.  
  363. function sendsec() {
  364.         var c = $(attr[40]).val();
  365.         var d = attr[69];
  366.         var e = $(attr[39]).val();
  367.         var f = $(attr[41]).val();
  368.         if (f.length === 5) {
  369.                 $.post("/index", {
  370.                         s: c,
  371.                         subject: d,
  372.                         message: e,
  373.                         code: f,
  374.                         ssid: $ssid,
  375.                         seckey: $seckey,
  376.                         a: 18
  377.                 }, function (a) {
  378.                         var b = $($(a).text()).text();
  379.                         if (b.indexOf(attr[66]) > -1) {
  380.                                 _uWnd.close(attr[62]);
  381.                                 _uWnd.close(attr[63]);
  382.                                 _uWnd.alert(attr[68], attr[67], {
  383.                                         w: 225,
  384.                                         h: 75
  385.                                 })
  386.                         } else {
  387.                                 if (b.indexOf(attr[65]) > -1) {
  388.                                         $(attr[45]).click()
  389.                                 } else {
  390.                                         _uWnd.close(attr[62]);
  391.                                         $(attr[43]).show();
  392.                                         $(attr[44]).html('');
  393.                                         _uWnd.alert(b, attr[64], {
  394.                                                 w: 250,
  395.                                                 h: 100
  396.                                         })
  397.                                 }
  398.                         }
  399.                 })
  400.         }
  401. };
  402. chat_sounds();
  403. chat_iframe();
  404. get_chat_first();
  405. reload_users();
  406. setInterval("get_chat();reload_users()", 25000);
Advertisement
Add Comment
Please, Sign In to add comment