<commit_before>class ResizableColumns {

  constructor(element) {
    this.startTime = new Date();

    this.wrapper = $(element);
    this.contentWrapper = this.wrapper.find('.rescol-content-wrapper');
    this.headerWrapper = this.wrapper.find('.rescol-header-wrapper');
    this.contentTable = this.contentWrapper.find('table');

    if (this.contentTable.length == 0) {
      console.log(element);
      throw new Error("Can not find table inside .rescol-content-wrapper");
    }

    if (this.headerWrapper.length == 0) {
      this.headerWrapper = $("<div>").addClass('.rescol-header-wrapper');
      this.headerWrapper.appendTo(this.wrapper, 'top');
    }

    // this.setFullWidth()
    this.mesureTime('setFullWidth', () => this.setFullWidth());

    this.mesureTime('createHeaders', () => this.createHeaders());
    //this.createHeaders();

    this.mesureTime('addDraggers', () => this.addDraggers());
    //this.addDraggers();

    console.log("Init sec", ((new Date()) - this.startTime) / 1000);
  }

  mesureTime(title, callback) {
    var startTime = new Date();
    callback();
    //console.log(title + " sec", ((new Date()) - startTime) / 1000);
  }

  setFullWidth() {
    this.wrapper.css('width', '20000px');
    var naturalWidth = this.contentTable.outerWidth();

    this.contentTable.css('width', `${naturalWidth}px`);
    this.wrapper.css('width', '');

    this.columnWidths = [];

    this.contentTable.find('th').each(function (i, th) {
      th = $(th);<commit_msg>Don’t create resizable columns for table without headers<commit_after>class ResizableColumns {

  constructor(element) {
    this.startTime = new Date();

    this.wrapper = $(element);
    this.contentWrapper = this.wrapper.find('.rescol-content-wrapper');
    this.headerWrapper = this.wrapper.find('.rescol-header-wrapper');
    this.contentTable = this.contentWrapper.find('table');

    if (this.contentTable.length == 0) {
      console.log(element);
      throw new Error("Can not find table inside .rescol-content-wrapper");
    }

    if (this.headerWrapper.length == 0) {
      this.headerWrapper = $("<div>").addClass('.rescol-header-wrapper');
      this.headerWrapper.appendTo(this.wrapper, 'top');
    }

    if (this.contentWrapper.find('th').length == 0) {
      console.log('table without headers');
      return;
    }

    // this.setFullWidth()
    this.mesureTime('setFullWidth', () => this.setFullWidth());

    this.mesureTime('createHeaders', () => this.createHeaders());
    //this.createHeaders();

    this.mesureTime('addDraggers', () => this.addDraggers());
    //this.addDraggers();

    console.log("Init sec", ((new Date()) - this.startTime) / 1000);
  }

  mesureTime(title, callback) {
    var startTime = new Date();
    callback();
    //console.log(title + " sec", ((new Date()) - startTime) / 1000);
  }

  setFullWidth() {
    this.wrapper.css('width', '20000px');
    var naturalWidth = this.contentTable.outerWidth();

    this.contentTable.css('width', `${naturalWidth}px`);
    this.wrapper.css('width', '');

    this.columnWidths = [];

    this.contentTable.find('th').each(function (i, th) {
      th = $(th);
{'fraction_non_alphanumeric': 0.1819047619047619, 'fraction_numerical': 0.009841269841269842, 'mean_word_length': 3.4193548387096775, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2453289', 'n_tokens_mistral': 1014, 'n_tokens_neox': 957, 'n_words': 165}