<commit_before><!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>Pay The Artist</title>
        <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script>
        <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>      
      <!--  <script src='../app/assets/javascripts/bootstrap.js'></script> 
        <script type="text/javascript" charset="utf-8" src='../app/assets/javascripts/bootstrap-modal.js'></script>
       -->
       <script src='http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js'></script>
       <script type="text/javascript">

		var totalAmount = jQuery("#total").val();
		var artists = new Array("artist1");
		var percents = new Array("amount1");
		var amounts = new Array(0);

		function addArtist() {
		  input = jQuery('<p>Artist '+(artists.length+1)+':  <input type = "text" name = "artist'+(artists.length+1)+'"/></p><p>Percent: <input type = "number" name = "amount'+(artists.length+1)+'" value = "0"/>%</p><p id = "splitAmount'+(artists.length+1)+'">Amount: $<span id="fill'+(artists.length+1)+'"></span></p><br/><br/>');
		  console.log("addArtist was run");
		  jQuery('#artists').append(input);
		  artists[artists.length] = "artist" + (artists.length + 1);  
		};

		function updateValues() {
		  console.log("updateValues run");
		  var percentTotal = 0;
		  for (i = 1; i <= artists.length; i++) {
		    var percentTotal = percentTotal + parseFloat($("input[name=amount"+i+"]").val());
		    artists[i-1] = $("input[name=artist"+i+"]").val();
		    percents[i-1] = $("input[name=amount"+i+"]");
		  }
		  if (percentTotal != 100 && artists.length != 1) {
		    alert("Your percentages don't add up to 100!");
		    return false;
		  } else if (parseInt(percentTotal) === 100) {
		    
		    for (i = 1; i <= artists.length; i++) {
		      amounts[i-1] = Math.round((parseFloat($("input[name=amount"+i+"]").val()) / 100 * parseFloat($("#total").val()))*100)/100.0;
		    }
		  }
		  for (i = 1; i <= artists.length; i++) {
		    $("#fill"+i).text(amounts[i-1]);
		  }  
		}; 
		
	</script>
    </head>
    <body>
        <div id="wrapper">
            <header>
                <hgroup>
                     <!--<%= image_tag("RobinTunes.png") %>-->
                    <h1 class="home">
                        <span>
                            <a rel="bookmark" href="index.html">Pay The Artist</a>
                        </span>
                    </h1><commit_msg>Changed the link to index.html<commit_after><!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>Pay The Artist</title>
        <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script>
        <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>      
      <!--  <script src='../app/assets/javascripts/bootstrap.js'></script> 
        <script type="text/javascript" charset="utf-8" src='../app/assets/javascripts/bootstrap-modal.js'></script>
       -->
       <script src='http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js'></script>
       <script type="text/javascript">

		var totalAmount = jQuery("#total").val();
		var artists = new Array("artist1");
		var percents = new Array("amount1");
		var amounts = new Array(0);

		function addArtist() {
		  input = jQuery('<p>Artist '+(artists.length+1)+':  <input type = "text" name = "artist'+(artists.length+1)+'"/></p><p>Percent: <input type = "number" name = "amount'+(artists.length+1)+'" value = "0"/>%</p><p id = "splitAmount'+(artists.length+1)+'">Amount: $<span id="fill'+(artists.length+1)+'"></span></p><br/><br/>');
		  console.log("addArtist was run");
		  jQuery('#artists').append(input);
		  artists[artists.length] = "artist" + (artists.length + 1);  
		};

		function updateValues() {
		  console.log("updateValues run");
		  var percentTotal = 0;
		  for (i = 1; i <= artists.length; i++) {
		    var percentTotal = percentTotal + parseFloat($("input[name=amount"+i+"]").val());
		    artists[i-1] = $("input[name=artist"+i+"]").val();
		    percents[i-1] = $("input[name=amount"+i+"]");
		  }
		  if (percentTotal != 100 && artists.length != 1) {
		    alert("Your percentages don't add up to 100!");
		    return false;
		  } else if (parseInt(percentTotal) === 100) {
		    
		    for (i = 1; i <= artists.length; i++) {
		      amounts[i-1] = Math.round((parseFloat($("input[name=amount"+i+"]").val()) / 100 * parseFloat($("#total").val()))*100)/100.0;
		    }
		  }
		  for (i = 1; i <= artists.length; i++) {
		    $("#fill"+i).text(amounts[i-1]);
		  }  
		}; 
		
	</script>
    </head>
    <body>
        <div id="wrapper">
            <header>
                <hgroup>
                     <!--<%= image_tag("RobinTunes.png") %>-->
                    <h1 class="home">
                        <span>
                            <a rel="bookmark" href="/">Pay The Artist</a>
                        </span>
                    </h1>
{'fraction_non_alphanumeric': 0.2202, 'fraction_numerical': 0.0204, 'mean_word_length': 2.5875179340028693, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 91, 'https://': 2, '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': '7301640', 'n_tokens_mistral': 1865, 'n_tokens_neox': 1666, 'n_words': 285}