Commit 4d1b66af authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 225731: Implement a user pref to choose if clicking the "Reply" link of a…

Bug 225731: Implement a user pref to choose if clicking the "Reply" link of a comment should qutote the comment or not, or only its ID - Patch by Albert Ting <altlist@gmail.com> r/a=LpSolit
parent 0d8f1f66
...@@ -60,7 +60,9 @@ sub SETTINGS { ...@@ -60,7 +60,9 @@ sub SETTINGS {
skin => { subclass => 'Skin', default => 'standard' }, skin => { subclass => 'Skin', default => 'standard' },
# 2006-12-10 LpSolit@gmail.com -- Bug 297186 # 2006-12-10 LpSolit@gmail.com -- Bug 297186
lang => { options => \@languages, lang => { options => \@languages,
default => $languages[0] } default => $languages[0] },
# 2007-07-02 altlist@gmail.com -- Bug 225731
quote_replies => { options => ['quoted_reply', 'simple_reply', 'off'], default => "quoted_reply" }
} }
}; };
......
...@@ -37,12 +37,17 @@ ...@@ -37,12 +37,17 @@
/* XXX this should really be updated to use the DOM Core's /* XXX this should really be updated to use the DOM Core's
* createElement, but finding a container isn't trivial. * createElement, but finding a container isn't trivial.
*/ */
[% IF user.settings.quote_replies.value != 'off' %]
document.write('[<a href="#add_comment" onclick="replyToComment(' + document.write('[<a href="#add_comment" onclick="replyToComment(' +
id + ');">reply<' + '/a>]'); id + ');">reply<' + '/a>]');
[% END %]
} }
/* Adds the reply text to the `comment' textarea */ /* Adds the reply text to the `comment' textarea */
function replyToComment(id) { function replyToComment(id) {
var prefix = "(In reply to comment #" + id + ")\n";
var replytext = "";
[% IF user.settings.quote_replies.value == 'quoted_reply' %]
/* pre id="comment_name_N" */ /* pre id="comment_name_N" */
var text_elem = document.getElementById('comment_text_'+id); var text_elem = document.getElementById('comment_text_'+id);
var text = getText(text_elem); var text = getText(text_elem);
...@@ -52,12 +57,14 @@ ...@@ -52,12 +57,14 @@
*/ */
text = text.split(/\r|\n/); text = text.split(/\r|\n/);
var replytext = "";
for (var i=0; i < text.length; i++) { for (var i=0; i < text.length; i++) {
replytext += "> " + text[i] + "\n"; replytext += "> " + text[i] + "\n";
} }
replytext = "(In reply to comment #" + id + ")\n" + replytext + "\n"; replytext = prefix + replytext + "\n";
[% ELSIF user.settings.quote_replies.value == 'simple_reply' %]
replytext = prefix;
[% END %]
[% IF Param("insidergroup") && user.in_group(Param("insidergroup")) %] [% IF Param("insidergroup") && user.in_group(Param("insidergroup")) %]
if (document.getElementById('isprivate-'+id).checked) { if (document.getElementById('isprivate-'+id).checked) {
......
...@@ -41,5 +41,8 @@ ...@@ -41,5 +41,8 @@
"never" => "Never", "never" => "Never",
"cc_unless_role" => "Only if I have no role on them", "cc_unless_role" => "Only if I have no role on them",
"lang" => "Language used in email", "lang" => "Language used in email",
"quote_replies" => "Quote the associated comment when you click on its reply link",
"quoted_reply" => "Quote the full comment",
"simple_reply" => "Reference the comment number only",
} }
%] %]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment