<commit_before>Asset = {
  addInput: function() {
    var list = $('files'), copyFrom = list.down(), tagall = $('tagall-files');
    var newNode = copyFrom.cloneNode(true), files = list.getElementsByTagName('p');
    var close = $(newNode).select('.remove-file')[0]; 
    Element.remove($(newNode).select('.tagall-files')[0]);
    Event.observe(close, 'click', function(e) { 
      Event.findElement(e, 'p').remove(); 
      if(tagall.visible() && files.length == 1) tagall.hide();
    });
    close.show();
    if(!tagall.visible() && files.length > 0) tagall.show();
    list.appendChild(newNode);
  },
  
  removeInput: function(input, formId, inputClass) {
    var length = $$('#' + formId + ' .' + inputClass).findAll(function(e) { return e.visible(); }).length;<commit_msg>Fixed js/form bug where you could upload only one asset Closes #176<commit_after>Asset = {
  addInput: function() {
    var list = $('files'), copyFrom = list.down(), tagall = $('tagall-files');
    var newNode = copyFrom.cloneNode(true), files = list.getElementsByTagName('p');
		for(c=0; c < newNode.childNodes.length; c++) {
			if(newNode.childNodes[c].id == undefined) { continue; }
			newNode.childNodes[c].id = newNode.childNodes[c].id.replace(/[0-9]+/, list.childNodes.length-2);
			newNode.childNodes[c].name = newNode.childNodes[c].name.replace(/[0-9]+/, list.childNodes.length-2);
		}
    var close = $(newNode).select('.remove-file')[0]; 
    Element.remove($(newNode).select('.tagall-files')[0]);
    Event.observe(close, 'click', function(e) { 
      Event.findElement(e, 'p').remove(); 
      if(tagall.visible() && files.length == 1) tagall.hide();
    });
    close.show();
    if(!tagall.visible() && files.length > 0) tagall.show();
    list.appendChild(newNode);
  },
  
  removeInput: function(input, formId, inputClass) {
    var length = $$('#' + formId + ' .' + inputClass).findAll(function(e) { return e.visible(); }).length;
{'fraction_non_alphanumeric': 0.20695020746887965, 'fraction_numerical': 0.00933609958506224, 'mean_word_length': 3.9335038363171355, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, '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': '2362049', 'n_tokens_mistral': 670, 'n_tokens_neox': 644, 'n_words': 113}