<commit_before>import {html} from 'es6-string-html-template';
import delegate from 'delegate';
import Component from 'lib/ui/component';


delegate(document, '[data-action="show-casebook-modal"]', 'click', showCasebookModal);

let modal = null;

document.addEventListener("turbolinks:before-cache", function() {
  if (modal) { modal.destroy(); }
});

function showCasebookModal () {
  modal = new NewCasebookModal;
}

class NewCasebookModal extends Component {
  constructor () {
    super({
      id: 'new-casebook-modal',
      events: {
        'click #new-casebook-modal': (e) => { if (e.target.id === 'new-casebook-modal') this.destroy()},
        'click .close': (e) => { this.destroy() },
      }
    });
    document.body.appendChild(this.el);
    this.render();
  }

  destroy () {
    super.destroy();
    modal = null;
  }

  template () {
    return html`<div class="modal fade in" id="new-casebook-modal" style="display: block">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header"><commit_msg>Comment out modal.destroy for dashboard.js (New casebook modal).<commit_after>import {html} from 'es6-string-html-template';
import delegate from 'delegate';
import Component from 'lib/ui/component';


delegate(document, '[data-action="show-casebook-modal"]', 'click', showCasebookModal);

let modal = null;

// document.addEventListener("turbolinks:before-cache", function() {
//   if (modal) { modal.destroy(); }
// });

function showCasebookModal () {
  modal = new NewCasebookModal;
}

class NewCasebookModal extends Component {
  constructor () {
    super({
      id: 'new-casebook-modal',
      events: {
        'click #new-casebook-modal': (e) => { if (e.target.id === 'new-casebook-modal') this.destroy()},
        'click .close': (e) => { this.destroy() },
      }
    });
    document.body.appendChild(this.el);
    this.render();
  }

  destroy () {
    super.destroy();
    modal = null;
  }

  template () {
    return html`<div class="modal fade in" id="new-casebook-modal" style="display: block">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
{'fraction_non_alphanumeric': 0.17239819004524887, 'fraction_numerical': 0.0009049773755656109, 'mean_word_length': 3.4576612903225805, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '368621', 'n_tokens_mistral': 690, 'n_tokens_neox': 682, 'n_words': 148}