diff --git a/langs/english.json b/langs/english.json
index 941ce2d8..419c4a4e 100644
--- a/langs/english.json
+++ b/langs/english.json
@@ -378,6 +378,7 @@
"topic.plus":"+",
"topic.plus_one":"+1",
"topic.gap_up":" up",
+ "topic.quote_button_text":"Quote",
"topic.edit_button_text":"Edit",
"topic.delete_button_text":"Delete",
"topic.ip_button_text":"IP",
@@ -553,6 +554,7 @@
"topic_list.moderate_tooltip":"Moderate",
"topic_list.moderate_aria":"Moderate Posts",
"topic_list.what_to_do":"What do you want to do with these {0} topics?",
+ "topic_list.what_to_do_single":"What do you want to do with this topic?",
"topic_list.moderate_delete":"Delete them",
"topic_list.moderate_lock":"Lock them",
"topic_list.moderate_move":"Move them",
@@ -599,6 +601,8 @@
"topic.unlike_aria":"Unlike this topic",
"topic.like_tooltip":"Like",
"topic.like_aria":"Like this topic",
+ "topic.quote_tooltip":"Quote Topic",
+ "topic.quote_aria":"Quote this topic",
"topic.edit_tooltip":"Edit Topic",
"topic.edit_aria":"Edit this topic",
"topic.delete_tooltip":"Delete Topic",
diff --git a/public/global.js b/public/global.js
index 55ddb348..c33a5da7 100644
--- a/public/global.js
+++ b/public/global.js
@@ -7,6 +7,7 @@ var moreTopicCount = 0;
var conn = false;
var selectedTopics = [];
var attachItemCallback = function(){}
+var quoteItemCallback = function(){}
var baseTitle = document.title;
var wsBackoff = 0;
@@ -749,8 +750,7 @@ function mainInit(){
// Remove any handlers already attached to the submitter
$(".submit_edit").unbind("click");
- $(".submit_edit").click(function(event)
- {
+ $(".submit_edit").click(function(event) {
event.preventDefault();
var outData = {isJs: "1"}
var blockParent = $(this).closest('.editable_parent');
@@ -793,6 +793,23 @@ function mainInit(){
}
});
+ $(".quote_item").click(function(){
+ event.preventDefault();
+ event.stopPropagation();
+ let source = this.closest(".post_item").getElementsByClassName("edit_source")[0];
+ let content = document.getElementById("input_content")
+ console.log("content.value", content.value);
+
+ let item;
+ if(content.value == "") item = "
" + source.innerHTML + "
"
+ else item = "\r\n
" + source.innerHTML + "
";
+ content.value = content.value + item;
+ console.log("content.value", content.value);
+
+ // For custom / third party text editors
+ quoteItemCallback(source.innerHTML,item);
+ });
+
$(this).click(() => {
$(".selectedAlert").removeClass("selectedAlert");
$("#back").removeClass("alertActive");
@@ -935,7 +952,7 @@ function mainInit(){
else attachItem = "\r\n//" + window.location.host + "/attachs/" + hash + "." + ext;
content.value = content.value + attachItem;
console.log("content.value", content.value);
-
+
// For custom / third party text editors
attachItemCallback(attachItem);
});
@@ -1021,7 +1038,7 @@ function mainInit(){
$(this).click(function(){
selectedTopics.push(parseInt($(this).attr("data-tid"),10));
if(selectedTopics.length==1) {
- var msg = "What do you want to do with this topic?";
+ var msg = phraseBox["topic_list"]["topic_list.what_to_do_single"];
} else {
var msg = "What do you want to do with these "+selectedTopics.length+" topics?";
}
diff --git a/templates/topic.html b/templates/topic.html
index 40a72d94..07dcb8f8 100644
--- a/templates/topic.html
+++ b/templates/topic.html
@@ -54,26 +54,32 @@
{{if $.CurrentUser.Loggedin}}
{{if $.CurrentUser.Perms.LikeItem}}{{end}}
+
{{if not $.Topic.IsClosed or $.CurrentUser.Perms.CloseTopic}}
{{if $.CurrentUser.Perms.EditReply}}{{end}}
{{end}}
diff --git a/templates/topic_posts.html b/templates/topic_posts.html
index d127375c..3d149495 100644
--- a/templates/topic_posts.html
+++ b/templates/topic_posts.html
@@ -7,14 +7,16 @@
{{else}}
{{/** TODO: We might end up with s in the inline editor, fix this **/}}
-