PageSourceSearch

https://ds401.ru/_ext/comment.js

js ds401.ru collected 2026-10-04 03:33:31 UTC 5,176 bytes, 94 lines download raw bytes

1  $(document).ready(function () {
2    $('#comment-button:not(.comment-button-processed)').addClass('comment-button-processed').click(function() {
3      $("#comment-button").attr("disabled", "disabled");
4      $('#message').html('<div class="loading">Подождите, пожалуйста...</div>');
5      $('#message').show();
6
7      var formData = $('#comment_form').serialize();
8      $.ajax({
9        type: 'POST',
10        url: '/_ext/commentpost.php',
11        data: formData,
12        datatype: 'json',
13        success: function(response) {
14          var msg = '';
15          $('#message').delay(500).fadeOut(500);
16          $("#comment-button").removeAttr("disabled");
17          $.each(response.msg, function(i, e) {
18            msg += e + '<br>';
19          });
20          if (msg.length) {
21            if (response.success === true) {
22              $('#form-post').html('<div class="form-post-ok">' + msg + '</div>');
23              $("#comment_form").trigger('reset');
24            } else {
25              $('#form-post').html('<div class="form-post">' + msg + '</div>');
26
27              if(msg.indexOf("Неверный код") !== -1){
28                document.getElementsByName('code')[0].style.border = "1px solid red";
29                document.getElementsByName('code')[0].style.backgroundColor = "rgba(218, 34, 56, 0.1)";
30              }
31              else {
32                document.getElementsByName('code')[0].style.border = "1px solid #a6a6a6";
33                document.getElementsByName('code')[0].style.backgroundColor = "#ffffff";
34              }
35                
36              if(msg.indexOf('Необходимо подтвердить согласие') !== -1){
37                document.getElementsByName('chk_comment')[0].style.border = "1px solid red";
38                document.getElementsByName('chk_comment')[0].style.backgroundColor = "rgba(218, 34, 56, 0.1)";
39              } 
40              else {
41                document.getElementsByName('chk_comment')[0].style.border = "1px solid #a6a6a6";
42                document.getElementsByName('chk_comment')[0].style.backgroundColor = "#ffffff";
43              }
44                
45              if(msg.indexOf("Необходимо указать имя") !== -1 || msg.indexOf("Имя содержит запрещенный символ") !== -1){
46                document.getElementsByName('poster_name')[0].style.border = "1px solid red";
47                document.getElementsByName('poster_name')[0].style.backgroundColor = "rgba(218, 34, 56, 0.1)";
48              }
49              else {
50                document.getElementsByName('poster_name')[0].style.border = "1px solid #a6a6a6";
51                document.getElementsByName('poster_name')[0].style.backgroundColor = "#ffffff";
52              }
53                
54              if(msg.indexOf("Указана неверная эл. почта") !== -1 || msg.indexOf("Необходимо указать e-mail") !== -1){
55                document.getElementsByName('poster_email')[0].style.border = "1px solid red";
56                document.getElementsByName('poster_email')[0].style.backgroundColor = "rgba(218, 34, 56, 0.1)";
57              } 
58              else {
59                document.getElementsByName('poster_email')[0].style.border = "1px solid #a6a6a6";
60                document.getElementsByName('poster_email')[0].style.backgroundColor = "#ffffff";
61              }
62                
63              if(msg.indexOf("Не указан статус") !== -1) {
64                document.getElementsByName('poster_status')[0].style.border = "1px solid red";
65                document.getElementsByName('poster_status')[0].style.backgroundColor = "rgba(218, 34, 56, 0.1)";
66              }
67              else {
68                document.getElementsByName('poster_status')[0].style.border = "1px solid #a6a6a6";
69                document.getElementsByName('poster_status')[0].style.backgroundColor = "#ffffff";
70              }
71              
72              if(msg.indexOf("Комментарий не может быть пустым") !== -1 || msg.indexOf("Что то пошло Ð
72½Ðµ так. Ваш комментарий содержит запрещенные слова.") !== -1 || msg.indexOf("Что то пошло не так. Ваш комментарий содержит слишком много латинских символов.") !== -1){
73                document.getElementsByName('comment')[0].style.border = "1px solid red";
74                document.getElementsByName('comment')[0].style.backgroundColor = "rgba(218, 34, 56, 0.1)";
75              }
76              else {
77                document.getElementsByName('comment')[0].style.border = "1px solid #a6a6a6"; 
78                document.getElementsByName('comment')[0].style.backgroundColor = "#ffffff";
79              }
80            }
81          }
82          console.log(response);
83        },
84        error: function (xhr, ajaxOptions, thrownError) {
85          console.log(xhr.status);
86          console.log(thrownError);
87        }
88      });
89      var date = new Date(); 
90      $('#capcha').attr('src','/_ext/picutf.php?v=' + date.getTime());
91      $('#code').val('');
92
93    });
94  });

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.