diff options
author | lpsolit%gmail.com <> | 2007-08-08 08:49:25 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2007-08-08 08:49:25 +0200 |
commit | 4d1b66af361378015042bc3d73d83c12de58621d (patch) | |
tree | c8dc3434b272b7e77205ae5ef2bffc3475945bca | |
parent | 0d8f1f66a249190d26f58e652aa9c723acd29970 (diff) | |
download | bugzilla-4d1b66af361378015042bc3d73d83c12de58621d.tar.gz bugzilla-4d1b66af361378015042bc3d73d83c12de58621d.tar.xz |
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
-rw-r--r-- | Bugzilla/Install.pm | 4 | ||||
-rw-r--r-- | template/en/default/bug/edit.html.tmpl | 39 | ||||
-rw-r--r-- | template/en/default/global/setting-descs.none.tmpl | 3 |
3 files changed, 29 insertions, 17 deletions
diff --git a/Bugzilla/Install.pm b/Bugzilla/Install.pm index c488ab314..d6d216155 100644 --- a/Bugzilla/Install.pm +++ b/Bugzilla/Install.pm @@ -60,7 +60,9 @@ sub SETTINGS { skin => { subclass => 'Skin', default => 'standard' }, # 2006-12-10 LpSolit@gmail.com -- Bug 297186 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" } } }; diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index a7bef1ff5..61f5221ad 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -37,27 +37,34 @@ /* XXX this should really be updated to use the DOM Core's * createElement, but finding a container isn't trivial. */ - document.write('[<a href="#add_comment" onclick="replyToComment(' + - id + ');">reply<' + '/a>]'); + [% IF user.settings.quote_replies.value != 'off' %] + document.write('[<a href="#add_comment" onclick="replyToComment(' + + id + ');">reply<' + '/a>]'); + [% END %] } /* Adds the reply text to the `comment' textarea */ function replyToComment(id) { - /* pre id="comment_name_N" */ - var text_elem = document.getElementById('comment_text_'+id); - var text = getText(text_elem); - - /* make sure we split on all newlines -- IE or Moz use \r and \n - * respectively. - */ - text = text.split(/\r|\n/); - + var prefix = "(In reply to comment #" + id + ")\n"; var replytext = ""; - for (var i=0; i < text.length; i++) { - replytext += "> " + text[i] + "\n"; - } - - replytext = "(In reply to comment #" + id + ")\n" + replytext + "\n"; + [% IF user.settings.quote_replies.value == 'quoted_reply' %] + /* pre id="comment_name_N" */ + var text_elem = document.getElementById('comment_text_'+id); + var text = getText(text_elem); + + /* make sure we split on all newlines -- IE or Moz use \r and \n + * respectively. + */ + text = text.split(/\r|\n/); + + for (var i=0; i < text.length; i++) { + replytext += "> " + text[i] + "\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 (document.getElementById('isprivate-'+id).checked) { diff --git a/template/en/default/global/setting-descs.none.tmpl b/template/en/default/global/setting-descs.none.tmpl index 921b75911..c79949a73 100644 --- a/template/en/default/global/setting-descs.none.tmpl +++ b/template/en/default/global/setting-descs.none.tmpl @@ -41,5 +41,8 @@ "never" => "Never", "cc_unless_role" => "Only if I have no role on them", "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", } %] |