<commit_before>// Replaces rating selectboxes with the rating widget
$.fn.ratingwidget = function() {
    this.each(function(n, el) {
        var $el = $(el),
            $widget = $("<span class='ratingwidget stars stars-0'></span>"),
            rs = [],
            showStars = function(n) {
                $widget.removeClass('stars-0 stars-1 stars-2 stars-3 stars-4 stars-5').addClass('stars-' + n);
            };
        for (var i=1; i<=5; i++) {
            rs.push("<label data-stars='", i, "'>",
                    format(ngettext('{0} star', '{0} stars', i), [i]),
                    "<input type='radio' name='rating' value='", i, "'></label>");
        }
        var rating = 0;
        $widget.click(function(evt) {
            var t = $(evt.target);
            if (t.val()) {
                showStars(t.val());
            }
            rating = t.val();
        });
        $widget.mouseover(function(evt) {
            var t = $(evt.target);
            if (t.attr('data-stars')) {
                showStars(t.attr('data-stars'));
            }
        });
        $widget.mouseout(function(evt) {
            showStars(rating);
        });
        $widget.html(rs.join(''));
        $el.before($widget);
        $el.detach();
    });
    return this;
}<commit_msg>un-borking ratingswidget js<commit_after>// Replaces rating selectboxes with the rating widget
$.fn.ratingwidget = function() {
    this.each(function(n, el) {
        var $el = $(el),
            $widget = $("<span class='ratingwidget stars stars-0'></span>"),
            rs = [],
            showStars = function(n) {
                $widget.removeClass('stars-0 stars-1 stars-2 stars-3 stars-4 stars-5').addClass('stars-' + n);
            };
        for (var i=1; i<=5; i++) {
            rs.push("<label data-stars='", i, "'>",
                    format(ngettext('{0} star', '{0} stars', i), [i]),
                    "<input type='radio' name='rating' value='", i, "'></label>");
        }
        var rating = 0;
        $widget.click(function(evt) {
            var t = $(evt.target);
            if (t.val()) {
                showStars(t.val());
            }
            rating = t.val();
        });
        $widget.mouseover(function(evt) {
            var t = $(evt.target);
            if (t.attr('data-stars')) {
                showStars(t.attr('data-stars'));
            }
        });
        $widget.mouseout(function(evt) {
            showStars(rating);
        });
        $widget.html(rs.join(''));
        $el.before($widget);
        $el.detach();
    });
    return this;
};
{'fraction_non_alphanumeric': 0.18911617136240833, 'fraction_numerical': 0.009262832883056734, 'mean_word_length': 1.5816733067729083, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '948314', 'n_tokens_mistral': 802, 'n_tokens_neox': 790, 'n_words': 154}