From be26c119991e5e4e6ec28a881bc0860a4cd9aefc Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Mon, 22 Dec 2014 19:18:01 +0000 Subject: Bug 1093924: Move replyToMarkdownComment() and replyToComment() out of templates r=LpSolit,a=glob --- js/comments.js | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'js') diff --git a/js/comments.js b/js/comments.js index 43e6fe96e..30baf53f4 100644 --- a/js/comments.js +++ b/js/comments.js @@ -6,6 +6,69 @@ * defined by the Mozilla Public License, v. 2.0. */ +/* Adds the reply text to the 'comment' textarea */ +function replyToComment(id, real_id, replyto_header, text) { + var replytext = ""; + if (replyCommentConfig.quote_replies == 'quoted_reply') { + /* pre id="comment_name_N" */ + if (text == null) { + var text_elem = document.getElementById('comment_text_'+id); + text = getText(text_elem); + } + replytext = replyto_header + "\n" + wrapReplyText(text); + } else if (replyCommentConfig.quote_replies == 'simple_reply') { + replytext = replyto_header + "\n"; + } + + if (replyCommentConfig.is_insider) { + if (document.getElementById('isprivate_' + real_id).checked) { + document.getElementById('newcommentprivacy').checked = 'checked'; + updateCommentTagControl(document.getElementById('newcommentprivacy'), 'comment'); + } + } + + /*