<commit_before>var modal = require('./modaldialog.js')
var yo = require('yo-yo')
var csjs = require('csjs-inject')

var css = csjs`
  .prompt_text {
    width: 300px;
  }
`
module.exports = {
  alert: function (text) {
    modal('', yo`<div>${text}</div>`, null, { label: null })
  },
  prompt: function (title, text, inputValue, ok, cancel) {
    modal(title,
  yo`<div>${text}<div><input type='text' name='prompt_text' id='prompt_text' class="${css['prompt_text']}" value='${inputValue}' ></div></div>`,
      {
        fn: () => { if (typeof ok === 'function') ok(document.getElementById('prompt_text').value) }<commit_msg>don't display 'null' in the prompt<commit_after>var modal = require('./modaldialog.js')
var yo = require('yo-yo')
var csjs = require('csjs-inject')

var css = csjs`
  .prompt_text {
    width: 300px;
  }
`
module.exports = {
  alert: function (text) {
    modal('', yo`<div>${text}</div>`, null, { label: null })
  },
  prompt: function (title, text, inputValue, ok, cancel) {
    if (!inputValue) inputValue = ''
    modal(title,
  yo`<div>${text}<div><input type='text' name='prompt_text' id='prompt_text' class="${css['prompt_text']}" value='${inputValue}' ></div></div>`,
      {
        fn: () => { if (typeof ok === 'function') ok(document.getElementById('prompt_text').value) }
{'fraction_non_alphanumeric': 0.21450381679389313, 'fraction_numerical': 0.004580152671755725, 'mean_word_length': 4.351020408163265, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, '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': '4918226', 'n_tokens_mistral': 469, 'n_tokens_neox': 447, 'n_words': 98}