<commit_before>"use strict";

define([], function () {

    var DesignerCanvasToolBar;

    DesignerCanvasToolBar = function () {
    };

    DesignerCanvasToolBar.prototype.addButtonGroup = function (clickFn) {
        var $btnGroup = $('<div/>', {
            "class": "btn-group inline"
        });

        this.skinParts.$toolBar.append($btnGroup);

        if (clickFn) {
            $btnGroup.on("click", ".btn", function (event) {
                clickFn.call(this, event, $(this).data());
                event.stopPropagation();
                event.preventDefault();
            });
        }

        return $btnGroup;
    };

    DesignerCanvasToolBar.prototype.addRadioButtonGroup = function (clickFn) {
        var $btnGroup;

        $btnGroup = this.addButtonGroup(function (event, data) {
            $btnGroup.find('.btn.active').removeClass('active');
            $(this).addClass('active');
            clickFn.call(this, event, data);
        });

        return $btnGroup;
    };

    DesignerCanvasToolBar.prototype.addButton = function (params, btnGroup) {
        var $btn,
            i;

        $btn = $('<a/>', {
            "class": "btn" + (params.class || ""),
            "href": "#",
            "title": params.title
        });

        if (params.data) {
            $btn.data(params.data);
        }

        if (params.selected === true) {
            $btn.addClass("active");
        }

        if (params.icon) {
            $btn.append($('<i class="' + params.icon + '"></i>'));
        }

        if (params.text) {
            $btn.append(params.text);
        }

        if (params.clickFn) {
            $btn.on("click", function (event) {
                params.clickFn.call(this, event, $(this).data());
                event.stopPropagation();
                event.preventDefault();
            });
        }

        btnGroup.append($btn);

        return $btn;
    };

    return DesignerCanvasToolBar;
});<commit_msg>radio button group clear active button fix<commit_after>"use strict";

define([], function () {

    var DesignerCanvasToolBar;

    DesignerCanvasToolBar = function () {
    };

    DesignerCanvasToolBar.prototype.addButtonGroup = function (clickFn) {
        var $btnGroup = $('<div/>', {
            "class": "btn-group inline"
        });

        this.skinParts.$toolBar.append($btnGroup);

        if (clickFn) {
            $btnGroup.on("click", ".btn", function (event) {
                clickFn.call(this, event, $(this).data());
                event.stopPropagation();
                event.preventDefault();
            });
        }

        return $btnGroup;
    };

    DesignerCanvasToolBar.prototype.addRadioButtonGroup = function (clickFn) {
        var $btnGroup;

        $btnGroup = this.addButtonGroup(function (event, data) {
            $btnGroup.find('.btn.active').removeClass('active');
            $(this).addClass('active');
            clickFn.call(this, event, data);
        });

        $btnGroup.setButtonsInactive = function () {
            $btnGroup.find('.btn.active').removeClass('active');
        }

        return $btnGroup;
    };

    DesignerCanvasToolBar.prototype.addButton = function (params, btnGroup) {
        var $btn,
            i;

        $btn = $('<a/>', {
            "class": "btn" + (params.class || ""),
            "href": "#",
            "title": params.title
        });

        if (params.data) {
            $btn.data(params.data);
        }

        if (params.selected === true) {
            btnGroup.find('.btn.active').removeClass('active');
            $btn.addClass("active");
        }

        if (params.icon) {
            $btn.append($('<i class="' + params.icon + '"></i>'));
        }

        if (params.text) {
            $btn.append(params.text);
        }

        if (params.clickFn) {
            $btn.on("click", function (event) {
                params.clickFn.call(this, event, $(this).data());
                event.stopPropagation();
                event.preventDefault();
            });
        }

        btnGroup.append($btn);

        return $btn;
    };

    return DesignerCanvasToolBar;
});
{'fraction_non_alphanumeric': 0.15938550168026885, 'fraction_numerical': 0.0, 'mean_word_length': 1.714657980456026, 'pattern_counts': {'":': 8, '<': 11, '<?xml version=': 0, '>': 11, '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': '3956422', 'n_tokens_mistral': 1194, 'n_tokens_neox': 1153, 'n_words': 196}