<commit_before>function Checky(opts) {
    this.delete_selection = opts.delete_selection;
    this.check_feed_id = opts.check_feed_id;
    this.click_all = opts.click_all;
    this.count = 0;
}

Checky.prototype.init = function() {
    var me = this;    
   
    $(me.delete_selection).bind('change', function(e) {
        var mode = $(this).val();
        var checkFeed = me.check_feed_id;
        var ifChecked = checkFeed.is(':checked');
        var currentUrl = $(location).attr('href');

        var collection = new Array();
       
        if(ifChecked && mode != 'none') { 

            var conf = null; 
            var color = null; 

            if(mode == 'restore') {
                conf = confirm("Are you sure you want to restore these feedbacks?");     
                color = '#fef1b5';
            }
           
            if(mode == 'remove') {
                conf = confirm("Are you sure you want to permanently remove these feedbacks?");                  
                color = '#fef1b5';
            }
           
            if(mode == 'publish') {
                conf = confirm("Are you sure want to publish these feedbacks?");     
                color = '#66cd00';
            }
           
            if(mode == 'feature') {
                conf = confirm("Are you sure want to feature these feedbacks?");     
                color = '#fbec5d';
            }
           
            if(mode == 'delete') {
                conf = confirm("Are you sure want to delete these feedbacks?");     
                color = '#fef1b5';
            } 

            if(conf) {
               checkFeed.each(function() {
                    if($(this).is(':checked')) {
                        collection.push($(this).val());
                        $('#' + $(this).val()).fadeOut(300, function() {
                            $(this).remove();
                        });
                    }
                });    
            }
            //revert to default -- select
            $("option:first", this).prop("selected", true);
            console.log(me.count);
            console.log(mode);
            console.log(collection); 
            checkFeed.attr('checked', false);

            $('.checky-bar').css({
                'position': 'fixed'
              , 'width': '450px'
              , 'font-size': '1.2em'
              , 'font-weight': 'bold'
              , 'background': color 
              , 'text-align': 'center'
              , 'left': '40%'
              , 'top': '23%'
              , 'z-index': '200'
              , 'padding': '5px'
              , 'border-radius': '12px'
              , 'margin': '2px 5px'
            }).html(mode);
            /*
            $.ajax({
                type: "POST"      
              , data: {col: mode, feed_ids: collection, curl: currentUrl}
              , url: $(this).attr("hrefaction")
              , success: function(msg) {
                    //$('.the-feedbacks').children().remove().end().html(msg);
                    //console.log(msg);
                    if(mode == 'restore') {
                        location.reload(); 
                    } 
                    checkFeed.attr('checked', false);
              }
            });
            */
        } else {
            collection.length = 0;     
        } 
    });
}

Checky.prototype.clickAll = function() { 
    var me = this;    
    $(me.click_all).bind('click', function(e) {
        if(this.checked) {
            $(me.check_feed_id).prop("checked", true);
            $(me.click_all).prop("checked", true);
        } else {
            $(me.check_feed_id).prop("checked", false);
            $(me.click_all).prop("checked", false);
        }                                            
    });
}
<commit_msg>effects 60%<commit_after>function Checky(opts) {
    this.delete_selection = opts.delete_selection;
    this.check_feed_id = opts.check_feed_id;
    this.click_all = opts.click_all;
    this.count = 0;
}

Checky.prototype.init = function() {
    var me = this;    
   
    $(me.delete_selection).bind('change', function(e) {
        var mode = $(this).val();
        var checkFeed = me.check_feed_id;
        var ifChecked = checkFeed.is(':checked');
        var currentUrl = $(location).attr('href');

        var collection = new Array();
       
        if(ifChecked && mode != 'none') { 

            var conf = null; 
            var color = null; 

            if(mode == 'restore') {
                conf = confirm("Are you sure you want to restore these feedbacks?");     
                color = '#fef1b5';
            }
           
            if(mode == 'remove') {
                conf = confirm("Are you sure you want to permanently remove these feedbacks?");                  
                color = '#fef1b5';
            }
           
            if(mode == 'publish') {
                conf = confirm("Are you sure want to publish these feedbacks?");     
                color = '#66cd00';
            }
           
            if(mode == 'feature') {
                conf = confirm("Are you sure want to feature these feedbacks?");     
                color = '#fbec5d';
            }
           
            if(mode == 'delete') {
                conf = confirm("Are you sure want to delete these feedbacks?");     
                color = '#fef1b5';
            } 

            if(conf) {
               checkFeed.each(function() {
                    if($(this).is(':checked')) {
                        collection.push($(this).val());
                        $('#' + $(this).val()).fadeOut(300, function() {
                            $(this).remove();
                        });
                    }
                });    
            }
            //revert to default -- select
            $("option:first", this).prop("selected", true);
            console.log(me.count);
            console.log(mode);
            console.log(collection); 
            checkFeed.attr('checked', false);
           
            var hideLink = document.createElement("a");
            var gotoLink = document.createElement("a");

            hideLink.setAttribute("href", "#");
            hideLink.setAttribute("id", "hide-undo-bar");
            hideLink.style.color = "#00688b";
            hideLink.style.fontSize = "0.7em";
            hideLink.innerHTML = " hide";

            gotoLink.setAttribute("href", "#");
            gotoLink.setAttribute("id", "hide-undo-bar");
            gotoLink.style.color = "#00688b";
            gotoLink.style.fontSize = "0.7em";
            gotoLink.innerHTML = " go to " + mode;

            $('.checky-bar').css({
                'position': 'fixed'
              , 'width': '450px'
              , 'font-size': '1.2em'
              , 'font-weight': 'bold'
              , 'background': color 
              , 'text-align': 'center'
              , 'left': '40%'
              , 'top': '23%'
              , 'z-index': '200'
              , 'padding': '5px'
              , 'border-radius': '12px'
              , 'margin': '2px 5px'
            }).html(mode + ": " + collection.length + (collection.length > 1 ? " feedbacks" : " feedback")).append(hideLink).append(gotoLink);
            /*
            $.ajax({
                type: "POST"      
              , data: {col: mode, feed_ids: collection, curl: currentUrl}
              , url: $(this).attr("hrefaction")
              , success: function(msg) {
                    //$('.the-feedbacks').children().remove().end().html(msg);
                    //console.log(msg);
                    if(mode == 'restore') {
                        location.reload(); 
                    } 
                    checkFeed.attr('checked', false);
              }
            });
            */
        } else {
            collection.length = 0;     
        } 
    });
}

Checky.prototype.clickAll = function() { 
    var me = this;    
    $(me.click_all).bind('click', function(e) {
        if(this.checked) {
            $(me.check_feed_id).prop("checked", true);
            $(me.click_all).prop("checked", true);
        } else {
            $(me.check_feed_id).prop("checked", false);
            $(me.click_all).prop("checked", false);
        }                                            
    });
}

{'fraction_non_alphanumeric': 0.14784913845041572, 'fraction_numerical': 0.010001204964453548, 'mean_word_length': 1.2269922189428495, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4359404', 'n_tokens_mistral': 2282, 'n_tokens_neox': 2163, 'n_words': 426}