]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 225731: Implement a user pref to choose if clicking the "Reply" link of a comment...
authorlpsolit%gmail.com <>
Wed, 8 Aug 2007 06:49:25 +0000 (06:49 +0000)
committerlpsolit%gmail.com <>
Wed, 8 Aug 2007 06:49:25 +0000 (06:49 +0000)
Bugzilla/Install.pm
template/en/default/bug/edit.html.tmpl
template/en/default/global/setting-descs.none.tmpl

index c488ab31405cd207e2a071b717eb5c6af66fda74..d6d2161551f6f3483808c1098c133ab735ab0f25 100644 (file)
@@ -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" }
     }
 };
 
index a7bef1ff595bddf52b682837969e6eb0f61138f3..61f5221ad63741031a4c7d962a4a167f3d104f04 100644 (file)
       /* 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) {
index 921b759119d4bd8018e2e2be43e18467b63d1fe8..c79949a7389978465dd9f0ea942707ebafa3b311 100644 (file)
@@ -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",
                    } 
 %]