<commit_before>  /**
   *  Edit Number dialog, comes from Small Dialog -> cell editor!
   *
   *  Associate templates:
   *    - dialog_small_edit
   */

  cdb.admin.EditNumberDialog = cdb.admin.SmallDialog.extend({

    className: "floating edit_text_dialog number_dialog",

    events: cdb.core.View.extendEvents({
      'keyup input.number': '_keyPress',
      'click': '_stopPropagation'
    }),

    initialize: function() {
      _.defaults(this.options, {
        template_name: 'common/views/dialog_small_edit',
        ok_title: 'Save',
        readOnly: this.options.readOnly,
        modal_class: 'edit_text_dialog',
        clean_on_hide: true
      });

      this.enable = true;

      cdb.ui.common.Dialog.prototype.initialize.apply(this);
      this.render();
      $(document.body).find("div.table table").append(this.el);
    },


    render_content: function() {
      var val = '';
      if (this.options.initial_value === 0 || this.options.initial_value === "0") {
        val = '0';
      } else if (this.options.initial_value) {
        val = this.options.initial_value;
      }
      if(this.options.readOnly) {
        return '<textarea  disabled="disabled" readOnly="true">' + val + '</textarea>';
      } else {
        return '<input class="number" value="' + val + '"></input>';
      }
    },


    /**
     *  Stop propagation click event
     */
    _stopPropagation: function(e) {
      e.stopPropagation();
    },


    /**
     *  Check if the number is well formed or not<commit_msg>public number cell editor is now an input<commit_after>  /**
   *  Edit Number dialog, comes from Small Dialog -> cell editor!
   *
   *  Associate templates:
   *    - dialog_small_edit
   */

  cdb.admin.EditNumberDialog = cdb.admin.SmallDialog.extend({

    className: "floating edit_text_dialog number_dialog",

    events: cdb.core.View.extendEvents({
      'keyup input.number': '_keyPress',
      'click': '_stopPropagation'
    }),

    initialize: function() {
      _.defaults(this.options, {
        template_name: 'common/views/dialog_small_edit',
        ok_title: 'Save',
        readOnly: this.options.readOnly,
        modal_class: 'edit_text_dialog',
        clean_on_hide: true
      });

      this.enable = true;

      cdb.ui.common.Dialog.prototype.initialize.apply(this);
      this.render();
      $(document.body).find("div.table table").append(this.el);
    },


    render_content: function() {
      var val = '';
      if (this.options.initial_value === 0 || this.options.initial_value === "0") {
        val = '0';
      } else if (this.options.initial_value) {
        val = this.options.initial_value;
      }
      if(this.options.readOnly) {
        return '<input disabled="disabled" readOnly="true" value="' + val + '"></input>';
      } else {
        return '<input class="number" value="' + val + '"></input>';
      }
    },


    /**
     *  Stop propagation click event
     */
    _stopPropagation: function(e) {
      e.stopPropagation();
    },


    /**
     *  Check if the number is well formed or not
{'fraction_non_alphanumeric': 0.14504563233376794, 'fraction_numerical': 0.001955671447196871, 'mean_word_length': 2.41, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '7247540', 'n_tokens_mistral': 958, 'n_tokens_neox': 928, 'n_words': 189}