<commit_before>import _ from 'lodash';
import { showShield, hideShield } from '../tools/ui/shield';

export default class Modal {
    constructor (message, confirm = _.noop, abort = _.noop, options = {}) {
        // Set up options
        this.options = options;
        // this.options.disableEsc = false;

        // Modal element to use
        this.el = (this.options.el) ? this.options.el : document.body.querySelector('.modal');

        this.message = message;

        // Set callback methods
        this.onConfirm = confirm;
        this.onAbort = abort;

        // Setup proper "this" binding to these callback functions
        // This is necessary so that these functions have the proper
        // "this" scope of this class
        // Setting it here (instead of an arrow function or a .bind(this))
        // allows removeEventListener to remove this via the correct
        // reference later. We are reusing these DOM elements so it is
        // important to remove the callbacks, otherwise multiple
        // callbacks remain attached to the buttons, which is not great.
        this._handleConfirm = this._handleConfirm.bind(this);
        this._handleAbort = this._handleAbort.bind(this);
        this._handleEsc = this._handleEsc.bind(this);<commit_msg>Fixed problem of not finding tools files<commit_after>import _ from 'lodash';
import { showShield, hideShield } from '../ui/shield';

export default class Modal {
    constructor (message, confirm = _.noop, abort = _.noop, options = {}) {
        // Set up options
        this.options = options;
        // this.options.disableEsc = false;

        // Modal element to use
        this.el = (this.options.el) ? this.options.el : document.body.querySelector('.modal');

        this.message = message;

        // Set callback methods
        this.onConfirm = confirm;
        this.onAbort = abort;

        // Setup proper "this" binding to these callback functions
        // This is necessary so that these functions have the proper
        // "this" scope of this class
        // Setting it here (instead of an arrow function or a .bind(this))
        // allows removeEventListener to remove this via the correct
        // reference later. We are reusing these DOM elements so it is
        // important to remove the callbacks, otherwise multiple
        // callbacks remain attached to the buttons, which is not great.
        this._handleConfirm = this._handleConfirm.bind(this);
        this._handleAbort = this._handleAbort.bind(this);
        this._handleEsc = this._handleEsc.bind(this);
{'fraction_non_alphanumeric': 0.09499806126405584, 'fraction_numerical': 0.0, 'mean_word_length': 2.4036939313984167, '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': '3477892', 'n_tokens_mistral': 665, 'n_tokens_neox': 644, 'n_words': 243}