<commit_before>"use strict";

var Core = require("lapis-core/index.js");
var UI = require("lazuli-ui/index.js");


module.exports = Core.Base.clone({
    id: "Button",
    label: null,                         // Text label of button
    visible: true,                         // Whether or not this tab is shown (defaults to true)
});


/**
* Generate HTML output for this page button
* @param xmlstream div element object to contain the buttons; render_opts
*/
module.exports.define("render", function (parent_elmt, render_opts) {
    var button_elmt = parent_elmt
        .makeElement("li")
        .makeElement("a", this.getCSSClass(render_opts), this.id);

    if (this.target) {
        button_elmt.attr("target", this.target);
    }
    if (this.confirm_text) {
        button_elmt.attr("data-confirm-text", this.confirm_text);
    }
    button_elmt.text(this.label);
    return button_elmt;
});


module.exports.define("getCSSClass", function (render_opts) {
    var css_class;
    if (this.css_class) {
        css_class = this.css_class;
    } else if (this.main_button) {
        css_class = "btn-primary";
    } else {
        css_class = "btn-default";
    }
    if (this.main_button) {
        css_class += "css_button_main";
    }
    css_class += " btn css_cmd";<commit_msg>fix CSS class output when main_button is true<commit_after>"use strict";

var Core = require("lapis-core/index.js");
var UI = require("lazuli-ui/index.js");


module.exports = Core.Base.clone({
    id: "Button",
    label: null,                         // Text label of button
    visible: true,                         // Whether or not this tab is shown (defaults to true)
});


/**
* Generate HTML output for this page button
* @param xmlstream div element object to contain the buttons; render_opts
*/
module.exports.define("render", function (parent_elmt, render_opts) {
    var button_elmt = parent_elmt
        .makeElement("li")
        .makeElement("a", this.getCSSClass(render_opts), this.id);

    if (this.target) {
        button_elmt.attr("target", this.target);
    }
    if (this.confirm_text) {
        button_elmt.attr("data-confirm-text", this.confirm_text);
    }
    button_elmt.text(this.label);
    return button_elmt;
});


module.exports.define("getCSSClass", function (render_opts) {
    var css_class;
    if (this.css_class) {
        css_class = this.css_class;
    } else if (this.main_button) {
        css_class = "btn-primary";
    } else {
        css_class = "btn-default";
    }
    if (this.main_button) {
        css_class += " css_button_main";
    }
    css_class += " btn css_cmd";
{'fraction_non_alphanumeric': 0.13098429720413635, 'fraction_numerical': 0.0, 'mean_word_length': 2.6328233657858138, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1593716', 'n_tokens_mistral': 834, 'n_tokens_neox': 821, 'n_words': 192}