<commit_before>if($('.btn-circle-progress').length){
    var progress = $('.btn-circle-progress').attr('data-progress');
    if (progress >=100) {
        fillArc(1);
        fillArc(2);
        fillArc(3);
        fillArc(4);
        $('.btn-circle-progress').removeAttr('href');
        $('.btn-circle-progress p').html('<i class="fa fa-thumbs-up fa-4x"></i>');
    } else if (progress>=75) {
        fillArc(1);
        fillArc(2);
        fillArc(3);
        partialFillArc(4, progress - 75);
    } else if (progress>=50) {
        fillArc(1);
        fillArc(2);
        partialFillArc(3, progress - 50);
    } else if (progress>25) {
        fillArc(1);
        partialFillArc(2, progress - 25);
    } else {
        partialFillArc(1, progress);
    }
}

function fillArc(quarter) {
    $('.arc-q' + quarter).addClass('full');
}

function partialFillArc(quarter, progress){
    var skew =  (25 - progress) * 3.6;
    var degrees = 90;
    switch (quarter) {
        case 2:
            degrees = 180;
            break;
        case 3:
            degrees = 270;
            break;
        case 4:
            degrees = 360;
            break;
    }
    $('.arc-q' + quarter).css({
        '-moz-transform':'rotate(' + degrees + 'deg) skewX(' + skew + 'deg)',
        '-webkit-transform':'rotate(' + degrees + 'deg) skewX(' + skew + 'deg)',
        '-ms-transform':'rotate(' + degrees + 'deg) skewX(' + skew + 'deg)',
        '-o-transform':'rotate(' + degrees + 'deg) skewX(' + skew + 'deg)',
        'transform':'rotate(' + degrees + 'deg) skewX(' + skew + 'deg)'
    });
    $('.arc-q' + quarter).addClass('percent' + (25 - progress));
}<commit_msg>Allow multiple circular progress buttons<commit_after>/** Renders a circular 'progress' button. */
$(function() {
    $('.btn-circle-progress').each(function() {
        var progress = $(this).attr('data-progress');
	var btn = $(this);

    function fillArc(quarter) {
	console.log(btn);
        btn.children('.arc-q' + quarter).addClass('full');
    }

    function partialFillArc(quarter, progress){
        var skew =  (25 - progress) * 3.6;
        var degrees = 90;
        switch (quarter) {
            case 2:
            degrees = 180;
            break;
            case 3:
            degrees = 270;
            break;
            case 4:
            degrees = 360;
            break;
        }
        btn.children('.arc-q' + quarter).css({
            '-moz-transform':'rotate(' + degrees + 'deg) skewX(' + skew + 'deg)',
            '-webkit-transform':'rotate(' + degrees + 'deg) skewX(' + skew + 'deg)',
            '-ms-transform':'rotate(' + degrees + 'deg) skewX(' + skew + 'deg)',
            '-o-transform':'rotate(' + degrees + 'deg) skewX(' + skew + 'deg)',
            'transform':'rotate(' + degrees + 'deg) skewX(' + skew + 'deg)'
        });
        $('.arc-q' + quarter).addClass('percent' + (25 - progress));
        }

    if (progress >= 100) {
            fillArc(1);
            fillArc(2);
            fillArc(3);
            fillArc(4);
            $(this).removeAttr('href');
            $(this).children('p').html('<i class="fa fa-thumbs-up fa-4x"></i>');
        } else if (progress >= 75 ) {
            fillArc(1);
            fillArc(2);
            fillArc(3);
            partialFillArc(4, progress - 75);
        } else if (progress >= 50) {
            fillArc(1);
            fillArc(2);
            partialFillArc(3, progress - 50);
        } else if (progress > 25) {
            fillArc(1);
            partialFillArc(2, progress - 25);
        } else {
            partialFillArc(1, progress);
        }
    });
});
{'fraction_non_alphanumeric': 0.18272150151807895, 'fraction_numerical': 0.02760143527463428, 'mean_word_length': 1.8334636434714622, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '4089544', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1091, 'n_words': 241}