<commit_before>/* eslint-env browser */
/* global allPlugins, allInputs, allSettings, allIDs */

// TODO: Add In-Browser Tests
(function formUX() {
  var script = function (target) {
    var inp = allInputs[target.id];
    var input = {};
    var settings = {};

    // Set up script input
    input.target = target;
    input.parent = target.parentNode;
    input.all = {};
    input.all[inp.name] = target;

    // Set up script settings
    settings.target = inp.settings;
    settings.all = {};
    settings.all[inp.name] = inp.settings;

    // Set all sibling input and settings
    Object.keys(inp.siblings).forEach(function (sibling) {
      input.all[sibling] = allIDs[inp.siblings[sibling]];
      settings.all[sibling] = allSettings[inp.parent.id][sibling];
    });

    // Run the script
    script = allPlugins[inp.parent.type].scripts[inp.script.function](input, settings);
  };

  // Call script for each input
  Object.keys(allInputs).forEach(function (id) {
    if (allInputs[id].hasOwnProperty('script')) {
      script(allIDs[id]);
    }
  });
}());<commit_msg>:bug: fixes multiple scripts call<commit_after>/* eslint-env browser */
/* global allPlugins, allInputs, allSettings, allIDs */

// TODO: Add In-Browser Tests
(function formUX() {
  var script = function (target) {
    var inp = allInputs[target.id];
    var input = {};
    var settings = {};

    // Set up script input
    input.target = target;
    input.parent = target.parentNode;
    input.all = {};
    input.all[inp.name] = target;

    // Set up script settings
    settings.target = inp.settings;
    settings.all = {};
    settings.all[inp.name] = inp.settings;

    // Set all sibling input and settings
    Object.keys(inp.siblings).forEach(function (sibling) {
      input.all[sibling] = allIDs[inp.siblings[sibling]];
      settings.all[sibling] = allSettings[inp.parent.id][sibling];
    });

    // Run the script
    allPlugins[inp.parent.type].scripts[inp.script.function](input, settings);
  };

  // Call script for each input
  Object.keys(allInputs).forEach(function (id) {
    if (allInputs[id].hasOwnProperty('script')) {
      script(allIDs[id]);
    }
  });
}());
{'fraction_non_alphanumeric': 0.15246430216490098, 'fraction_numerical': 0.0, 'mean_word_length': 3.0598130841121494, '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': '1729419', 'n_tokens_mistral': 707, 'n_tokens_neox': 713, 'n_words': 149}