PageSourceSearch

https://vensnab.ru/css/comments1.js

js vensnab.ru collected 2026-10-08 08:26:25 UTC 7,573 bytes, 250 lines download raw bytes

1
2
3
4$(document).ready(function () {    
5
6    $('a.toggleLink').click(function () {
7        $(this).next('.toggle').show('fast');
8        $(this).hide();
9    });
10
11    $('.warnForm').submit(function () {
12        var form = $(this);
13        $.ajax({
14            type: "POST",
15            url: "",
16            data: $(this).serialize(),
17            success: function (data)
18            {
19                form.text("Жалоба принята");
20            }
21        });
22
23        return false;
24    });
25
26    $('.adminUnblock').submit(function () {
27        var form = $(this);
28        $.ajax({
29            type: "POST",
30            url: "",
31            data: $(this).serialize(),
32            success: function (data)
33            {
34                form.text("Комментарий разблокирован");
35            }
36        });
37
38        return false;
39    });
40
41    $('.adminDelete').submit(function () {
42        var form = $(this);
43        $.ajax({
44            type: "POST",
45            url: "",
46            data: $(this).serialize(),
47            success: function (data)
48            {
49                form.text("Комментарий удален");
50            }
51        });
52
53        return false;
54    });
55
56    $('.adminSeen').submit(function () {
57        var form = $(this);
58        $.ajax({
59            type: "POST",
60            url: "",
61            data: $(this).serialize(),
62            success: function (data)
63            {
64                form.text("Просмотрено");
65            }
66        });
67
68        return false;
69    });
70
71    // Административный интерфейс
72    $('#warnList').hide();
73    $('#blockList').hide();
74    $('#seenList').hide();
75
76    $('#warnShow').click(function () {
77        $("#warnShow").attr("class", "hc_menu e_hc_menu hc_menu_active");
78        $("#recentShow").attr("class", "hc_menu e_hc_menu");
79        $("#blockShow").attr("class", "hc_menu e_hc_menu");
80        $("#seenShow").attr("class", "hc_menu e_hc_menu");
81        $('#warnList').show("300");
82        $('#recentList').hide("300");
83        $('#blockList').hide("300");
84        $('#seenList').hide("300");
85    });
86
87    $('#blockShow').click(function () {
88        $("#warnShow").attr("class", "hc_menu e_hc_menu");
89        $("#recentShow").attr("class", "hc_menu e_hc_menu");
90        $("#blockShow").attr("class", "hc_menu e_hc_menu hc_menu_active");
91        $("#seenShow").attr("class", "hc_menu e_hc_menu");
92        $('#blockList').show("300");
93        $('#recentList').hide("300");
94        $('#warnList').hide("300");
95        $('#seenList').hide("300");
96    });
97
98    $('#recentShow').click(function () {
99        $("#warnShow").attr("class", "hc_menu e_hc_menu");
100        $("#recentShow").attr("class", "hc_menu e_hc_menu hc_menu_active");
101        $("#blockShow").attr("class", "hc_menu e_hc_menu");
102        $("#seenShow").attr("class", "hc_menu e_hc_menu");
103        $('#recentList').show("300");
104        $('#blockList').hide("300");
105        $('#warnList').hide("300");
106        $('#seenList').hide("300");
107    });
108    
109    $('#seenShow').click(function () {
110        $("#warnShow").attr("class", "hc_menu e_hc_menu");
111        $("#recentShow").attr("class", "hc_menu e_hc_menu");
112        $("#blockShow").attr("class", "hc_menu e_hc_menu");
113        $("#seenShow").attr("class", "hc_menu e_hc_menu hc_menu_active");
114        $('#recentList').hide("300");
115        $('#blockList').hide("300");
116        $('#warnList').hide("300");
117        $('#seenList').show("300");
118    });
119
120});
121
122// Всплывающие подсказки:
123$(document).ready(function () {
124    $('.tooltipForm').hover(function (event) {
125        var titleText = $(this).attr('title');
126        $(this)
127                .data('tipText', titleText)
128                .attr('title', '');
129
130        $('<p class="tooltip"></p>')
131                .text(titleText)
132                .appendTo('body')
133                .css('top', (event.pageY - 10) + 'px')
134                .css('left', (event.pageX + 20) + 'px')
135                .fadeIn('slow');
136    }, function () {
137        // Hover out code
138        $(this).attr('title', $(this).data('tipText'));
139        $('.tooltip').remove();
140    }).mousemove(function (event) {
141        // Mouse move code
142        $('.tooltip')
143                .css('top', (event.pageY - 10) + 'px')
144                .css('left', (event.pageX + 20) + 'px');
145    });
146});
147
148
149
150
151
152$(function () {
153
154	//загрузка кооментариев аякс
155	/*
156	$.ajax({
157	  url: '/comments/view/3580',
158	  success: function(data) {
159		$('#commentsBlock').html(data);
160	  }
161	});
162	*/
163
164
165    $('.comments_captcha_refresh').click(function () {
166        $.ajax({
167            url: "/comments/captcha?refresh=1",
168            dataType: 'json',
169            cache: false,
170            success: function(data) {
171                $('.comments_captcha').attr('src', data['url']);
172            }
173        });
174        return false;
175    });
176
177	
178	
179	
180    $('.commentForm').submit(function (e) {
181        e.preventDefault();
182        var m_method = $(this).attr('method');
183        var m_action = $(this).attr('action');
184        var m_data = $(this).serialize();
185		var submitButton = $(this).find('.commentSubmit');
186        var form = $(this);
187        var comment_id = form.find('input#Comments_id_parent').val();
188
189        $.ajax({
190            type: m_method,
191            url: m_action,
192            data: m_data,
193			dataType: 'json',
194			beforeSend: function(){
195				submitButton.attr("disabled", true).val("Отправка комментария...");
196			},
197            success: function (result) {
198                
199                submitButton.removeAttr("disabled").val("Опубликовать");
200
201                if (result.status == 'success') {
202                    if (comment_id > 0) {                    
203                        $('#comment_'+comment_id).find(".comment-answers").prepend(result.msg);
204                    }
205                    else {
206                        $('#commentsBlock').prepend(result.msg);
207                    }
208                    $('#reply_'+comment_id).hide().remove();
209                    $('#countComments').text(result.count);
210
211                    $('#commentsBlock').find('.no-comments').remove();
212                }
213                else {
214                    var errors = '';
215                    $.each(result.msg, function(index, value) {
216                        //console.log(value);
217                        if (index == 0)
218                            errors = value;
219                        else
220                            errors += '\n'+value;
221                    }); 
222                    alert(errors);
223                }
224            },
225			error: function(){
226				alert('Ошибка отправки комментария. Обратитесь в администратору')
227			}
228        });
229    });
230});
231
232function getData(token) {
233    $.ajax({
234        url: 'http://ulogin.ru/token.php',
235        type: 'GET',
236        dataType: 'jsonp',
237        data: {'token': token, 'host': encodeURIComponent(location.toString())},
238        success: function (jqXHR) {
239            var obj = JSON.parse(jqXHR);
240			//alert("Привет, "+obj.first_name+" "+obj.photo+"!");
241            $(".comments_form_name").val(obj.first_name);
242			$('.comments_form_email').val(obj.email);	
243			$(".comments_form_avatar").val(obj.photo);			
244            $(".comments_form_photo").attr('src', obj.photo);
245        },
246        complete: function (jqXHR, status) {
247            console.log(status);
248        }
249    });
250}

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.