PageSourceSearch

https://www.actions4photoshop.com/atn/Scripts/jquery.rating.js

js actions4photoshop.com collected 2026-10-06 02:47:03 UTC 3,523 bytes, 92 lines download raw bytes

1
2if (window.jQuery)
3    (
4function ($) {
5    $.fn.rating = function (options) {
6        if (this.length == 0) return this;
7        var options = $.extend(
8			{}/* new object */,
9			$.fn.rating.options/* default options */,
10			options || { callback: submitRating} /* just-in-time options */
11		);
12
13        $(this).each(
14            function () {
15                var ratingHolder = $(this);
16                var rat_avg = ratingHolder.attr("rating");
17                var rat_id = ratingHolder.attr("id");
18                var base_folder = ratingHolder.attr("basefolder");
19
20
21                ratingHolder.bind("init",
22                    function () {
23                        ratingHolder.html("");
24                        rat_avg = parseFloat(ratingHolder.attr("rating"));
25                        
26                        for (i = 1; i <= 5; i++) {
27                            
28                            var star = ratingHolder.append("<a class='star-rating " + ((rat_avg >= i) ? "star-rating-on" : "") + "'>" + i + "</a>");
29                        }
30
31                        var stars = ratingHolder.find("a");
32
33                        stars
34                            .mouseover(
35                                function () {
36                                    var crt = $(this);
37                                    crt.addClass("star-rating-hover");
38                                    crt.siblings().each(
39                                        function () {
40                                            if ($(this).text() <= crt.text()) {
41                                                $(this).addClass("star-rating-hover");
42                                            }
43                                        }
44                                    );
45                                }
46                            )
47                            .mouseout(
48                                function () {
49                                    var crt = $(this);
50                                    crt.removeClass("star-rating-hover");
51                                    crt.siblings().each(
52                                        function () {
53                                            if ($(this).text() <= crt.text()) {
54                                                $(this).removeClass("star-rating-hover");
55                                            }
56                                        }
57                                    );
58                                }
59                            )
60                            .click(
61                                function () {
62                                    (options.callback)(rat_id, $(this).text(), base_folder);
63                                }
64                            );
65                    }
66                );
67
68                $(this).trigger("init");
69
70
71
72            }
73        );
74    };
75})(jQuery);
76
77
78function submitRating(_id, _rating, bf) {
79    $.ajax(
80        {
81            url: bf + "/ajax.aspx",
82            data: { cmd: "rating", id: _id, rating: _rating },
83            contentType: "application/json; charset=utf-8",
84            success: function (res) {
85                if (res.status == "ok") { $("#" + _id).attr("rating", res.newRating).trigger("init"); alert("Thank you for rating this resource!"); } else { alert(res.status); };
86            },
87            failure: function (msg) {
88                alert(msg);
89            }
90        }
91    );
92}

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.