<commit_before>$(document).on("pagebeforeshow", "#singlePage", function () {
	$("#commentFormDish").attr("value", storeObject.DishID);
	$("#dishInfo").text("");
	$("#dishStar").text("");
	$("#dishComment").text("");
	$.post("includes/readdish.php",
	{
		DishID: storeObject.DishID
	},
	function(data) {
		$.each(JSON.parse(data), function(i, field){	
        	$("#dishInfo").append("<p>Name: "        + field.DishName        + "</p>");
        	$("#dishInfo").append("<p>Type: "        + field.DishType        + "</p>");
        	$("#dishInfo").append("<p>Composition: " + field.DishComposition + "</p>");
        	$("#dishInfo").append("<p>Price: "       + field.Price           + "</p>");
        });
	});
	$.post("includes/readdishstar.php",
	{
		DishID: storeObject.DishID
	},
	function(data) {
		$("#dishStar").append("<p>Star: " + data + "</p>");
	});
	$.post("includes/readdishcomment.php",
	{
		DishID: storeObject.DishID
	},
	function(data) {
		$.each(JSON.parse(data), function(i, field){	
        	//$("#dishComment").append("<p>" + field.Time    + "</p>");
        	//$("#dishComment").append("<p>" + field.Comment + "</p>");
        	$("#dishComment").append(listComment(field.Time, field.Comment));
        });
	});
});

$(document).on('pageinit', "#singlePage", function () {
	// have issue if I put form submission into "pagebeforeshow"
	// because each time I open the menu page, the form submission has one more chance
	// to submit
	// also have issue if I put this into a seperate file (outside "pagebeforeshow")
	// because the following code won't execute (this page cannot load)
	$('#commentForm').submit(function(event) {
		var form = $(this);
		//if(this.beenSubmitted) {
		//	return false;
		//} else {
		//	this.beenSubmitted = true;
		//}
		$.ajax({
      		type: form.attr('method'),
      		url: form.attr('action'),
      		data: form.serialize()
    	}).done(function() {
      		// Optionally alert the user of success here...
<<<<<<< HEAD
=======
      		time = getTime();
>>>>>>> d02e007d286a4266ec937934aab3c7334e13b470
      		$("#dishComment").append(listComment(curTime(), $("#dishCommentInput").val()));
      		$("#commentForm").trigger("reset");
      		$('#dialogComment').popup('open', {
      			history: false,
      			transition: "slideup",
      			positionTo: "#commentSubmitButton",
      			dismissible: false
      		});
      		setTimeout(function() {
      			$('#dialogComment').popup('close', {
      				history: false,
      				transition: "slidedown"<commit_msg>upload a change<commit_after>$(document).on("pagebeforeshow", "#singlePage", function () {
	$("#commentFormDish").attr("value", storeObject.DishID);
	$("#dishInfo").text("");
	$("#dishStar").text("");
	$("#dishComment").text("");
	$.post("includes/readdish.php",
	{
		DishID: storeObject.DishID
	},
	function(data) {
		$.each(JSON.parse(data), function(i, field){	
        	$("#dishInfo").append("<p>Name: "        + field.DishName        + "</p>");
        	$("#dishInfo").append("<p>Type: "        + field.DishType        + "</p>");
        	$("#dishInfo").append("<p>Composition: " + field.DishComposition + "</p>");
        	$("#dishInfo").append("<p>Price: "       + field.Price           + "</p>");
        });
	});
	$.post("includes/readdishstar.php",
	{
		DishID: storeObject.DishID
	},
	function(data) {
		$("#dishStar").append("<p>Star: " + data + "</p>");
	});
	$.post("includes/readdishcomment.php",
	{
		DishID: storeObject.DishID
	},
	function(data) {
		$.each(JSON.parse(data), function(i, field){	
        	//$("#dishComment").append("<p>" + field.Time    + "</p>");
        	//$("#dishComment").append("<p>" + field.Comment + "</p>");
        	$("#dishComment").append(listComment(field.Time, field.Comment));
        });
	});
});

$(document).on('pageinit', "#singlePage", function () {
	// have issue if I put form submission into "pagebeforeshow"
	// because each time I open the menu page, the form submission has one more chance
	// to submit
	// also have issue if I put this into a seperate file (outside "pagebeforeshow")
	// because the following code won't execute (this page cannot load)
	$('#commentForm').submit(function(event) {
		var form = $(this);
		//if(this.beenSubmitted) {
		//	return false;
		//} else {
		//	this.beenSubmitted = true;
		//}
		$.ajax({
      		type: form.attr('method'),
      		url: form.attr('action'),
      		data: form.serialize()
    	}).done(function() {
      		// Optionally alert the user of success here...
      		$("#dishComment").append(listComment(curTime(), $("#dishCommentInput").val()));
      		$("#commentForm").trigger("reset");
      		$('#dialogComment').popup('open', {
      			history: false,
      			transition: "slideup",
      			positionTo: "#commentSubmitButton",
      			dismissible: false
      		});
      		setTimeout(function() {
      			$('#dialogComment').popup('close', {
      				history: false,
      				transition: "slidedown"
{'fraction_non_alphanumeric': 0.2162762520193861, 'fraction_numerical': 0.005654281098546042, 'mean_word_length': 2.991136180499597, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 38, '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': '7019616', 'n_tokens_mistral': 1717, 'n_tokens_neox': 1673, 'n_words': 295}