PageSourceSearch

https://warsztatherbaty.pl/modules/productcomments/js/productcomments.js

js warsztatherbaty.pl collected 2026-10-03 01:28:18 UTC 3,153 bytes, 95 lines download raw bytes

1$(document).ready(function () {
2    $('input.star').rating();
3    $('.auto-submit-star').rating();
4
5    $('.open-comment-form').fancybox({
6        'hideOnContentClick': false
7    });
8
9    url_options = '?';
10
11    if (typeof(productcomments_url_rewrite) !== 'undefined'){
12        if (productcomments_url_rewrite == '0') {
13            url_options = '&';
14        }
15    }
16
17    $('button.usefulness_btn').click(function () {
18        var id_product_comment = $(this).data('id-product-comment');
19        var is_usefull = $(this).data('is-usefull');
20        var parent = $(this).parent();
21
22        $.ajax({
23            url: productcomments_controller_url + url_options + 'rand=' + new Date().getTime(),
24            data: {
25                id_product_comment: id_product_comment,
26                action: 'comment_is_usefull',
27                value: is_usefull
28            },
29            type: 'POST',
30            headers: {"cache-control": "no-cache"},
31            success: function (result) {
32                parent.fadeOut('slow', function () {
33                    parent.remove();
34                });
35            }
36        });
37    });
38
39    $('span.report_btn').click(function () {
40        if (confirm(confirm_report_message)) {
41            var idProductComment = $(this).data('id-product-comment');
42            var parent = $(this).parent();
43
44            $.ajax({
45                url: productcomments_controller_url + url_options + 'rand=' + new Date().getTime(),
46                data: {
47                    id_product_comment: idProductComment,
48                    action: 'report_abuse'
49                },
50                type: 'POST',
51                headers: {"cache-control": "no-cache"},
52                success: function (result) {
53                    parent.fadeOut('slow', function () {
54                        parent.remove();
55                    });
56                }
57            });
58        }
59    });
60
61    $('#submitNewMessage').click(function (e) {
62        // Kill default behaviour
63        e.preventDefault();
64
65        $.ajax({
66            url: productcomments_controller_url + url_options + 'action=add_comment&secure_key=' + secure_key + '&rand=' + new Date().getTime(),
67            data: $('#id_new_comment_form').serialize(),
68            type: 'POST',
69            headers: {"cache-control": "no-cache"},
70            dataType: "json",
71            success: function (data) {
72                if (data.result) {
73                    $.fancybox.close();
74                    fancyChooseBox(moderation_active ? productcomment_added_moderation : productcomment_added);
75                }
76                else {
77                    $('#new_comment_form_error ul').html('');
78                    $.each(data.errors, function (index, value) {
79                        $('#new_comment_form_error ul').append('<li>' + value + '</li>');
80                    });
81                    $('#new_comment_form_error').slideDown('slow');
82                }
83            }
84        });
85        return false;
86    });
87});
88
89function fancyChooseBox(msg) {
90    $('#new_comment_form_ok').html(msg).show();
91}
92
93function productcommentRefreshPage() {
94    window.location.reload();
95}

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.