<commit_before>if (typeof Fulcrum == 'undefined') {
  Fulcrum = {};
}

Fulcrum.FormView = Backbone.View.extend({
  tagName: 'form',

  label: function(elem_id, value) {
    value = value || this.model.humanAttributeName(elem_id);
    return this.make('label', {'for': elem_id}, value);
  },

  textField: function(name, extra_opts) {
    var defaults = {type: "text", name: name, value: this.model.get(name)}
    this.mergeAttrs(defaults, extra_opts);
    var el = this.make('input', defaults);
    this.bindElementToAttribute(el, name, "keyup");
    return el;
  }, 

  hiddenField: function(name) {
    var el = this.make('input', {type: "hidden", name: name, value: this.model.get(name)});
    this.bindElementToAttribute(el, name);
    return el;
  }, 

  textArea: function(name) {
    var el = this.make('textarea', {name: name, value: this.model.get(name), class: 'form-control'});
    this.bindElementToAttribute(el, name);
    return el;
  },

  select: function(name, select_options, options) {
    var select = this.make('select', {name: name, class: 'form-control'});
    var view = this;
    var model = this.model;

    if (typeof options == 'undefined') {
      options = {};
    }

    if (options.blank) {
      $(select).append(this.make('option', {value: ''}, options.blank));
    }<commit_msg>Now description textarea shows previous content<commit_after>if (typeof Fulcrum == 'undefined') {
  Fulcrum = {};
}

Fulcrum.FormView = Backbone.View.extend({
  tagName: 'form',

  label: function(elem_id, value) {
    value = value || this.model.humanAttributeName(elem_id);
    return this.make('label', {'for': elem_id}, value);
  },

  textField: function(name, extra_opts) {
    var defaults = {type: "text", name: name, value: this.model.get(name)}
    this.mergeAttrs(defaults, extra_opts);
    var el = this.make('input', defaults);
    this.bindElementToAttribute(el, name, "keyup");
    return el;
  }, 

  hiddenField: function(name) {
    var el = this.make('input', {type: "hidden", name: name, value: this.model.get(name)});
    this.bindElementToAttribute(el, name);
    return el;
  }, 

  textArea: function(name) {
    var el = this.make('textarea', {name: name, class: 'form-control'}, this.model.get(name));
    this.bindElementToAttribute(el, name);
    return el;
  },

  select: function(name, select_options, options) {
    var select = this.make('select', {name: name, class: 'form-control'});
    var view = this;
    var model = this.model;

    if (typeof options == 'undefined') {
      options = {};
    }

    if (options.blank) {
      $(select).append(this.make('option', {value: ''}, options.blank));
    }
{'fraction_non_alphanumeric': 0.17075009423294385, 'fraction_numerical': 0.0, 'mean_word_length': 3.6807760141093473, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2221746', 'n_tokens_mistral': 892, 'n_tokens_neox': 868, 'n_words': 202}