<commit_before>/*jslint node: true */
'use strict';
var map = Array.prototype.map;
var demoOutput;
var x = '',
    y = '',
    z = '',
    final_transformation = '',
    scalex = '',
    scaley = '',
    translatex = '',
    translatey = '',
    translatez = '',
    skewY = '',
    skewX = '';
/*is2dmatrix = false;*/ //transformations
var hor = '',
    ver = '',
    blur = '',
    spread = '',
    inset = '',
    red = "0",
    green = "0",
    blue = "0",
    color = 'rgb(250,48,90)',
    bshadow = '0px 0px black',
    transparency = 1; //box-shadow
var tl = '',
    tr = '',
    bl = '',
    br = '',
    rad = 0; //border-radius
//Text shadow properies
var text_shadow = "",
    text_shadow_x = "",
    text_shadow_y = "",
    text_shadow_blur = "",
    add_text_transform = false;
//Text shadow color
//Note:We could use the color from the box-shadow but instead we choose to seperate box-shadow color from text-shadow color
var text_shadow_r = 0,
    text_shadow_g = 0,
    text_shadow_b = 0,
    text_shadow_opacity = 0,
    text_shadow_color = "";
var addRadius = false,
    addTransform = false;
var transform_fav = [],
    radius_fav = [],
    box_fav = [],
    text_fav = [];
var transform_col = 0,
    box_col = 0,
    radius_col = 0,
    text_col = 0; //columns in each table
var line = [false, false, false, false]; //this array is used to create a new row in each favourite table after adding 3 cells in each row
//Select which generators you want to see on the page
var visibleGenerators = [];
var selectEnabledGenerators = function(generators) {
    var list = generators;
    var allGenerators = $(".generatorContainer");
    allGenerators.hide();

    for (var i = 0, max = list.length; i < max; i++) {
        $(".generatorContainer[data-generator=" + list[i] + "]").show();
    }
};
var showGeneratorList = function() {
    var list;
    var markup = "<div class ='panel panel-primary' style='margin-top:10px'>\n\t";
    markup += "<div class='panel-heading'>Choose which generators to show</div>\n\t"
    markup += "<div class='panel-body'>\n\t\t";
    markup += "<div class='list-group'>\n\t\t\t";
    markup += "<div class='list-group-item generatorItem' data-index='0'>CSS Transform</div>\n\t\t\t\t";
    markup += "<div class='list-group-item generatorItem' data-index='1'>CSS Box shadow</div>\n\t\t\t\t";
    markup += "<div class='list-group-item generatorItem' data-index='2'>CSS Border radius</div>\n\t\t\t\t";
    markup += "<div class='list-group-item generatorItem' data-index='3'>CSS Text Shadow</div>\n</div>";

    bootbox.alert({
        message: markup,
        callback: function() {
            //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
            list = map.call($(".generatorItemSelected"), function(i) {
                return $(i).data("index");
            });
            visibleGenerators = $(".generatorItemSelected");
            if (list)
                selectEnabledGenerators(list);
        }
    });
    var visibleGeneratorsIndex = map.call(visibleGenerators, function(i) {
        return $(i).data("index");
    });
    log(visibleGeneratorsIndex)
    if (len(visibleGeneratorsIndex) == 4 || len($(".generatorContainer:visible")) == 4) {
        $(".generatorItem").addClass("active generatorItemSelected");
    } else {
        var generatorsToSelect = map.call(visibleGeneratorsIndex, function(i) {
            return ".generatorItem[data-index=" + i + "]";
        }).join(",");
        log(generatorsToSelect)
        $(generatorsToSelect).addClass("active generatorItemSelected");
    }
};<commit_msg>added comments<commit_after>/*jslint node: true */
'use strict';
var map = Array.prototype.map;
var demoOutput;
var x = '',
    y = '',
    z = '',
    final_transformation = '',
    scalex = '',
    scaley = '',
    translatex = '',
    translatey = '',
    translatez = '',
    skewY = '',
    skewX = '';
/*is2dmatrix = false;*/ //transformations
var hor = '',
    ver = '',
    blur = '',
    spread = '',
    inset = '',
    red = "0",
    green = "0",
    blue = "0",
    color = 'rgb(250,48,90)',
    bshadow = '0px 0px black',
    transparency = 1; //box-shadow
var tl = '',
    tr = '',
    bl = '',
    br = '',
    rad = 0; //border-radius
//Text shadow properies
var text_shadow = "",
    text_shadow_x = "",
    text_shadow_y = "",
    text_shadow_blur = "",
    add_text_transform = false;
//Text shadow color
//Note:We could use the color from the box-shadow but instead we choose to seperate box-shadow color from text-shadow color
var text_shadow_r = 0,
    text_shadow_g = 0,
    text_shadow_b = 0,
    text_shadow_opacity = 0,
    text_shadow_color = "";
var addRadius = false,
    addTransform = false;
var transform_fav = [],
    radius_fav = [],
    box_fav = [],
    text_fav = [];
var transform_col = 0,
    box_col = 0,
    radius_col = 0,
    text_col = 0; //columns in each table
var line = [false, false, false, false]; //this array is used to create a new row in each favourite table after adding 3 cells in each row
//Select which generators you want to see on the page
var visibleGenerators = [];
var selectEnabledGenerators = function(generators) {
    var list = generators;
    var allGenerators = $(".generatorContainer");
    allGenerators.hide();

    for (var i = 0, max = list.length; i < max; i++) {
        $(".generatorContainer[data-generator=" + list[i] + "]").show();
    }
};
var showGeneratorList = function() {
    var list;
    var markup = "<div class ='panel panel-primary' style='margin-top:10px'>\n\t";
    markup += "<div class='panel-heading'>Choose which generators to show</div>\n\t"
    markup += "<div class='panel-body'>\n\t\t";
    markup += "<div class='list-group'>\n\t\t\t";
    markup += "<div class='list-group-item generatorItem' data-index='0'>CSS Transform</div>\n\t\t\t\t";
    markup += "<div class='list-group-item generatorItem' data-index='1'>CSS Box shadow</div>\n\t\t\t\t";
    markup += "<div class='list-group-item generatorItem' data-index='2'>CSS Border radius</div>\n\t\t\t\t";
    markup += "<div class='list-group-item generatorItem' data-index='3'>CSS Text Shadow</div>\n</div>";

    bootbox.alert({
        message: markup,
        callback: function() {
            //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
            list = map.call($(".generatorItemSelected"), function(i) {
                return $(i).data("index");
            });

            if (list)
                selectEnabledGenerators(list);
        }
    });
    visibleGenerators = $(".generatorContainer:visible");
    //From each visible generatorContainer extract its data-generator value
    var visibleGeneratorsIndex = map.call(visibleGenerators, function(i) {
        return $(i).data("generator");
    });
    //If there are 4 visible generatorContainer it means that all generators are visible
    //so mark them as both active and selected
    if (len(visibleGeneratorsIndex) == 4) {
        $(".generatorItem").addClass("active generatorItemSelected");
    } else {
        var generatorsToSelect = map.call(visibleGeneratorsIndex, function(i) {
            return ".generatorItem[data-index=" + i + "]";
        }).join(",");
        //Each generator that is selected also has to be marked as selected
        $(generatorsToSelect).addClass("active generatorItemSelected");
    }
};
{'fraction_non_alphanumeric': 0.16107292087882463, 'fraction_numerical': 0.008896077638495753, 'mean_word_length': 2.8366080661840742, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 31, 'https://': 2, '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': '6620207', 'n_tokens_mistral': 2355, 'n_tokens_neox': 2268, 'n_words': 584}