<commit_before>'use strict';
var Class = require('sji'),
    util = require('util'),
    _ = require('lodash');

var Widget = exports.Widget = Class.extend({
    init: function (options) {
        this.limit = options.limit || 50;
        this.validators = options.validators;
        this.attrs = _.assign({class: []}, options.attrs);
        this.attrs.class.push(options.required || options.attrs.required ? 'required' : 'optional');
        this.data = options.data || {};
        this.name = '';
        this.value = null;
    },

    render: function () { }
});


exports.InputWidget = Widget.extend({
    init: function (type, options) {
        options.attrs.type = options.attrs.type || type;
        this._super(options);
    },
    render: function (res) {
        var attr_string = render_attributes(this.name, this.value, this.data, this.attrs);
        res.write('<input ' + attr_string + ' />\n');
        return this;
    }
});


exports.HiddenWidget = exports.InputWidget.extend({
    init: function (options) {
        this._super('hidden', options);
    }
});


exports.TextWidget = exports.InputWidget.extend({
    init: function (options) {
        this._super('text', options);
    }
});


exports.PasswordWidget = exports.InputWidget.extend({
    init: function (options) {
        this._super('password', options);
    }
});


exports.TextAreaWidget = Widget.extend({
    render: function (res) {
        var attr_string = render_attributes(this.name, undefined, this.data, this.attrs);
        res.write('<textarea ' + attr_string + ' >\n');
        res.write(_.escape(this.value));
        res.write('</textarea>\n');
        return this;
    }
});


exports.RichTextAreaWidget = exports.TextAreaWidget.extend({
    init: function (options) {
        this._super(options);
        this.attrs.class.push('ckeditor');
    },
    render: function (res) {
        res.write('<div class="nf_widget">\n');
        this._super(res);
        res.write('</div>\n');
    }
});


exports.DateWidget = exports.InputWidget.extend({
    init: function (options) {
        this._super('text', options);
        this.attrs.class.push('nf_datepicker');
    },
    render: function (res) {
        res.write('<div class="input-append date">\n');
        this._super(res);
        res.write('<span class="add-on"><i class="icon-calendar"></i></span>\n');
        res.write('</div>\n');
    }
});


exports.DateTimeWidget = exports.InputWidget.extend({
    init: function (options) {
        this._super('text', options);
        this.attrs['data-format'] = "yyyy-MM-dd hh:mm";
    },
    render: function (res) {
        var widget_id = 'datetimepicker' + this.name;
        res.write('<div class="input-append date" id="' + widget_id + '">\n');
        this._super(res);
        res.write('<span class="add-on">\n<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>\n</span>\n</div>\n');
        var script = "$('#" + widget_id + "').datetimepicker();";
        res.write('<script>' + script + '</script>');
    }
});


exports.TimeWidget = exports.InputWidget.extend({
    init: function (options) {
        this._super('time', options);
        this.attrs.class.push('nf_timepicker');
    },
    render: function (res) {
        res.write('<div class="input-append bootstrap-timepicker-component">\n');
        this._super(res);
        res.write('<span class="add-on"><i class="icon-time"></i></span>\n');
        res.write('</div>\n');
    }
});


exports.NumberWidget = exports.InputWidget.extend({
    init: function (options) {
        options.attrs.min = options.min;
        options.attrs.max = options.max;
        options.attrs.step = options.attrs.step || options.step || 'any';
        this._super('number', options);
    }
});

<commit_msg>Fix conflict between chrome `time` input and bootstrap<commit_after>'use strict';
var Class = require('sji'),
    util = require('util'),
    _ = require('lodash');

var Widget = exports.Widget = Class.extend({
    init: function (options) {
        this.limit = options.limit || 50;
        this.validators = options.validators;
        this.attrs = _.assign({class: []}, options.attrs);
        this.attrs.class.push(options.required || options.attrs.required ? 'required' : 'optional');
        this.data = options.data || {};
        this.name = '';
        this.value = null;
    },

    render: function () { }
});


exports.InputWidget = Widget.extend({
    init: function (type, options) {
        options.attrs.type = options.attrs.type || type;
        this._super(options);
    },
    render: function (res) {
        var attr_string = render_attributes(this.name, this.value, this.data, this.attrs);
        res.write('<input ' + attr_string + ' />\n');
        return this;
    }
});


exports.HiddenWidget = exports.InputWidget.extend({
    init: function (options) {
        this._super('hidden', options);
    }
});


exports.TextWidget = exports.InputWidget.extend({
    init: function (options) {
        this._super('text', options);
    }
});


exports.PasswordWidget = exports.InputWidget.extend({
    init: function (options) {
        this._super('password', options);
    }
});


exports.TextAreaWidget = Widget.extend({
    render: function (res) {
        var attr_string = render_attributes(this.name, undefined, this.data, this.attrs);
        res.write('<textarea ' + attr_string + ' >\n');
        res.write(_.escape(this.value));
        res.write('</textarea>\n');
        return this;
    }
});


exports.RichTextAreaWidget = exports.TextAreaWidget.extend({
    init: function (options) {
        this._super(options);
        this.attrs.class.push('ckeditor');
    },
    render: function (res) {
        res.write('<div class="nf_widget">\n');
        this._super(res);
        res.write('</div>\n');
    }
});


exports.DateWidget = exports.InputWidget.extend({
    init: function (options) {
        this._super('text', options);
        this.attrs.class.push('nf_datepicker');
    },
    render: function (res) {
        res.write('<div class="input-append date">\n');
        this._super(res);
        res.write('<span class="add-on"><i class="icon-calendar"></i></span>\n');
        res.write('</div>\n');
    }
});


exports.DateTimeWidget = exports.InputWidget.extend({
    init: function (options) {
        this._super('text', options);
        this.attrs['data-format'] = "yyyy-MM-dd hh:mm";
    },
    render: function (res) {
        var widget_id = 'datetimepicker' + this.name;
        res.write('<div class="input-append date" id="' + widget_id + '">\n');
        this._super(res);
        res.write('<span class="add-on">\n<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>\n</span>\n</div>\n');
        var script = "$('#" + widget_id + "').datetimepicker();";
        res.write('<script>' + script + '</script>');
    }
});


exports.TimeWidget = exports.InputWidget.extend({
    init: function (options) {
        this._super('text', options);
        this.attrs.class.push('nf_timepicker');
    },
    render: function (res) {
        res.write('<div class="input-append bootstrap-timepicker-component">\n');
        this._super(res);
        res.write('<span class="add-on"><i class="icon-time"></i></span>\n');
        res.write('</div>\n');
    }
});


exports.NumberWidget = exports.InputWidget.extend({
    init: function (options) {
        options.attrs.min = options.min;
        options.attrs.max = options.max;
        options.attrs.step = options.attrs.step || options.step || 'any';
        this._super('number', options);
    }
});


{'fraction_non_alphanumeric': 0.18363851929917008, 'fraction_numerical': 0.0005269397971281781, 'mean_word_length': 2.7179236043095005, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 53, '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': '5404224', 'n_tokens_mistral': 2328, 'n_tokens_neox': 2290, 'n_words': 405}