<commit_before><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0;">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<title>Example of using $.Template</title>
	<link rel="apple-touch-startup-image" href="/Splash.png" />
	<link rel="apple-touch-icon" href="app.png">
	<link rel="stylesheet" href="../chui/chui.css">
	<style type="text/css">
		view#main {
			background-color: rgba(192,132,96,0.25);
		}
		view#main tableview > tablecell {
			background-color: rgba(255,255,255,0.75);
		}
	</style>
	<script type="text/javascript" src="../chui/chocolatechip.js"></script>
	<script type="text/javascript" src="../chui/chui.js"></script>
	<script type="text/javascript">
		$.ready(function() {
			var data = null;
			$.templates.customers =
			"<% for (var i = 0; i < customers.length; i++) { %>\
				<tablecell>\
				  <celltitle><%= customers[i].firstName %> <%= customers[i].lastName %></celltitle>\
				  <cellsubtitle><%= customers[i].address  %></cellsubtitle>\
				  <celldetail><%= customers[i].description %></celldetail>\
				</tablecell>\
			<%  } %>";
			$.app.xhr("customers.json", {
				successCallback: function() {
					data = $.responseText;
					$.processJSON(data);
				}
			});
		});
	</script>
</head>

<body>
<app>
	<view id="main" ui-background-style="slanted-left">
		<navbar class="ui-custom-tint"><h1>$.Template</h1</navbar>
		<subview ui-associations="withNavBar">
			<scrollpanel>
				<tableview ui-tablecell-order="stacked" ui-kind="grouped">
				
				</tableview>
			</scrollpanel>
		</subview>
	</view>
</app>
<script type="text/javascript">
	$.ready(function() {
		$.defer(function() {
			// Process the template of ID "template_01" with JSON data in the variable "data".
			// This is read from an Ajax call to an external JSON object in json.json.
			$.templateCache.customers = $.template("customers", data); 
			// insert the results of the parsed template into the div with id "template_1_output."
			$("#main tableview:first-of-type").insert($.templateCache.customers);		
		});
	});
</script>
</body>
</html><commit_msg>Updated $.template example to be more efficient.<commit_after><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0;">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<title>Example of using $.Template</title>
	<link rel="apple-touch-startup-image" href="/Splash.png" />
	<link rel="apple-touch-icon" href="app.png">
	<link rel="stylesheet" href="../chui/chui.css">
	<style type="text/css">
		view#main {
			background-color: rgba(192,132,96,0.25);
		}
		view#main tableview > tablecell {
			background-color: rgba(255,255,255,0.75);
		}
	</style>
	<script type="text/javascript" src="../chui/chocolatechip.js"></script>
	<script type="text/javascript" src="../chui/chui.js"></script>
	<script type="text/javascript">
		$.ready(function() {
			var data = null;
			$.templates.customers =
			"<% for (var i = 0; i < customers.length; i++) { %>\
				<tablecell>\
				  <celltitle><%= customers[i].firstName %> <%= customers[i].lastName %></celltitle>\
				  <cellsubtitle><%= customers[i].address  %></cellsubtitle>\
				  <celldetail><%= customers[i].description %></celldetail>\
				</tablecell>\
			<%  } %>";
			$.app.xhr("customers.json", {
				successCallback: function() {
					data = $.responseText;
					$.processJSON(data);
				}
			});
		});
		$.ready(function() {
			// Process the template $.template.customers with JSON data in the variable "data".
			// This is read from an Ajax call to an external JSON object in json.json.
			$.templateCache.customers = $.template("customers", data); 
			// insert the results of the parsed template into the div with id "template_1_output."
			$("#main tableview:first-of-type").insert($.templateCache.customers);	
		});
</script>
</head>

<body>
<app>
	<view id="main" ui-background-style="slanted-left">
		<navbar class="ui-custom-tint"><h1>$.Template</h1</navbar>
		<subview ui-associations="withNavBar">
			<scrollpanel>
				<tableview ui-tablecell-order="stacked" ui-kind="grouped">
				
				</tableview>
			</scrollpanel>
		</subview>
	</view>
</app>
</body>
</html>
{'fraction_non_alphanumeric': 0.20069848661233994, 'fraction_numerical': 0.015832363213038415, 'mean_word_length': 3.8929384965831435, 'pattern_counts': {'":': 0, '<': 109, '<?xml version=': 0, '>': 107, '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': '4797101', 'n_tokens_mistral': 1708, 'n_tokens_neox': 1471, 'n_words': 297}