From c25527cbe82245b3433725fc673334a7c53df4ae Mon Sep 17 00:00:00 2001
From: Hypolite Petovan <hypolite@mrpetovan.com>
Date: Mon, 29 Jul 2019 21:58:37 -0400
Subject: [PATCH] Replace obsolete #comment-preview-inp field by query string
 append

---
 view/js/main.js                                         | 4 +---
 view/templates/comment_item.tpl                         | 1 -
 view/templates/item/compose.tpl                         | 1 -
 view/templates/moderated_comment.tpl                    | 1 -
 view/theme/duepuntozero/templates/comment_item.tpl      | 1 -
 view/theme/duepuntozero/templates/moderated_comment.tpl | 1 -
 view/theme/frio/templates/comment_item.tpl              | 1 -
 view/theme/quattro/templates/comment_item.tpl           | 1 -
 view/theme/vier/templates/comment_item.tpl              | 1 -
 9 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/view/js/main.js b/view/js/main.js
index a2e2698a82..8b1303e7d3 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -632,7 +632,6 @@ function post_comment(id) {
 	unpause();
 	commentBusy = true;
 	$('body').css('cursor', 'wait');
-	$("#comment-preview-inp-" + id).val("0");
 	$.post(
 		"item",
 		$("#comment-edit-form-" + id).serialize(),
@@ -661,11 +660,10 @@ function post_comment(id) {
 }
 
 function preview_comment(id) {
-	$("#comment-preview-inp-" + id).val("1");
 	$("#comment-edit-preview-" + id).show();
 	$.post(
 		"item",
-		$("#comment-edit-form-" + id).serialize(),
+		$("#comment-edit-form-" + id).serialize() + '&preview=1',
 		function(data) {
 			if (data.preview) {
 				$("#comment-edit-preview-" + id).html(data.preview);
diff --git a/view/templates/comment_item.tpl b/view/templates/comment_item.tpl
index 352ff417f0..977a5b75b2 100644
--- a/view/templates/comment_item.tpl
+++ b/view/templates/comment_item.tpl
@@ -10,7 +10,6 @@
 				<input type="hidden" name="parent" value="{{$parent}}" />
 				{{*<!--<input type="hidden" name="return" value="{{$return_path}}" />-->*}}
 				<input type="hidden" name="jsreload" value="{{$jsreload}}" />
-				<input type="hidden" name="preview" id="comment-preview-inp-{{$id}}" value="0" />
 				<input type="hidden" name="post_id_random" value="{{$rand_num}}" />
 
 				<div class="comment-edit-photo" id="comment-edit-photo-{{$id}}" >
diff --git a/view/templates/item/compose.tpl b/view/templates/item/compose.tpl
index b1aa73d332..d18b1a2d36 100644
--- a/view/templates/item/compose.tpl
+++ b/view/templates/item/compose.tpl
@@ -3,7 +3,6 @@
 	<div id="profile-jot-wrapper">
 		<form class="comment-edit-form" data-item-id="{{$id}}" id="comment-edit-form-{{$id}}" action="compose/{{$type}}" method="post">
 		    {{*<!--<input type="hidden" name="return" value="{{$return_path}}" />-->*}}
-			<input type="hidden" name="preview" id="comment-preview-inp-{{$id}}" value="0" />
 			<input type="hidden" name="post_id_random" value="{{$rand_num}}" />
 			<input type="hidden" name="post_type" value="{{$posttype}}" />
 			<input type="hidden" name="wall" value="{{$wall}}" />
diff --git a/view/templates/moderated_comment.tpl b/view/templates/moderated_comment.tpl
index d52bf172a0..39dbbde477 100644
--- a/view/templates/moderated_comment.tpl
+++ b/view/templates/moderated_comment.tpl
@@ -6,7 +6,6 @@
 				<input type="hidden" name="parent" value="{{$parent}}" />
 				<input type="hidden" name="return" value="{{$return_path}}" />
 				<input type="hidden" name="jsreload" value="{{$jsreload}}" />
-				<input type="hidden" name="preview" id="comment-preview-inp-{{$id}}" value="0" />
 
 				<div class="comment-edit-photo" id="comment-edit-photo-{{$id}}">
 					<a class="comment-edit-photo-link" href="{{$mylink}}" title="{{$mytitle}}"><img class="my-comment-photo" src="{{$myphoto}}" alt="{{$mytitle}}" title="{{$mytitle}}" /></a>
diff --git a/view/theme/duepuntozero/templates/comment_item.tpl b/view/theme/duepuntozero/templates/comment_item.tpl
index bfa5f09388..cd14b253c5 100644
--- a/view/theme/duepuntozero/templates/comment_item.tpl
+++ b/view/theme/duepuntozero/templates/comment_item.tpl
@@ -10,7 +10,6 @@
 				<input type="hidden" name="parent" value="{{$parent}}" />
 				{{*<!--<input type="hidden" name="return" value="{{$return_path}}" />-->*}}
 				<input type="hidden" name="jsreload" value="{{$jsreload}}" />
-				<input type="hidden" name="preview" id="comment-preview-inp-{{$id}}" value="0" />
 				<input type="hidden" name="post_id_random" value="{{$rand_num}}" />
 
 				<div class="comment-edit-photo" id="comment-edit-photo-{{$id}}">
diff --git a/view/theme/duepuntozero/templates/moderated_comment.tpl b/view/theme/duepuntozero/templates/moderated_comment.tpl
index e5c2e5b9ad..197d1281d3 100644
--- a/view/theme/duepuntozero/templates/moderated_comment.tpl
+++ b/view/theme/duepuntozero/templates/moderated_comment.tpl
@@ -6,7 +6,6 @@
 				<input type="hidden" name="parent" value="{{$parent}}" />
 				<input type="hidden" name="return" value="{{$return_path}}" />
 				<input type="hidden" name="jsreload" value="{{$jsreload}}" />
-				<input type="hidden" name="preview" id="comment-preview-inp-{{$id}}" value="0" />
 
 				<div class="comment-edit-photo" id="comment-edit-photo-{{$id}}">
 					<a class="comment-edit-photo-link" href="{{$mylink}}" title="{{$mytitle}}"><img class="my-comment-photo" src="{{$myphoto}}" alt="{{$mytitle}}" title="{{$mytitle}}" /></a>
diff --git a/view/theme/frio/templates/comment_item.tpl b/view/theme/frio/templates/comment_item.tpl
index 98b3c45636..b60f5c429e 100644
--- a/view/theme/frio/templates/comment_item.tpl
+++ b/view/theme/frio/templates/comment_item.tpl
@@ -10,7 +10,6 @@
 		<input type="hidden" name="parent" value="{{$parent}}" />
 		{{*<!--<input type="hidden" name="return" value="{{$return_path}}" />-->*}}
 		<input type="hidden" name="jsreload" value="{{$jsreload}}" />
-		<input type="hidden" name="preview" id="comment-preview-inp-{{$id}}" value="0" />
 		<input type="hidden" name="post_id_random" value="{{$rand_num}}" />
 
 		<p class="comment-edit-bb-{{$id}} comment-icon-list">
diff --git a/view/theme/quattro/templates/comment_item.tpl b/view/theme/quattro/templates/comment_item.tpl
index 774ffac275..1fa4e333ed 100644
--- a/view/theme/quattro/templates/comment_item.tpl
+++ b/view/theme/quattro/templates/comment_item.tpl
@@ -5,7 +5,6 @@
 				<input type="hidden" name="parent" value="{{$parent}}" />
 				{{*<!--<input type="hidden" name="return" value="{{$return_path}}" />-->*}}
 				<input type="hidden" name="jsreload" value="{{$jsreload}}" />
-				<input type="hidden" name="preview" id="comment-preview-inp-{{$id}}" value="0" />
 				<input type="hidden" name="post_id_random" value="{{$rand_num}}" />
 
 				<div class="comment-edit-photo" id="comment-edit-photo-{{$id}}">
diff --git a/view/theme/vier/templates/comment_item.tpl b/view/theme/vier/templates/comment_item.tpl
index 8ccdccb80d..0e2cbb5bbf 100644
--- a/view/theme/vier/templates/comment_item.tpl
+++ b/view/theme/vier/templates/comment_item.tpl
@@ -10,7 +10,6 @@
 				<input type="hidden" name="parent" value="{{$parent}}" />
 				{{*<!--<input type="hidden" name="return" value="{{$return_path}}" />-->*}}
 				<input type="hidden" name="jsreload" value="{{$jsreload}}" />
-				<input type="hidden" name="preview" id="comment-preview-inp-{{$id}}" value="0" />
 				<input type="hidden" name="post_id_random" value="{{$rand_num}}" />
 
 				<div class="comment-edit-photo" id="comment-edit-photo-{{$id}}">