From 3f19a88131273da70b4a1a5e4854d30828785a65 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" Date: Thu, 1 Sep 2011 18:46:16 +0000 Subject: [PATCH] Bug 653634 - Change the comment reply header to include the name of the person who has commented r/a=LpSolit git-svn-id: svn://10.0.0.236/trunk@262789 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/js/comments.js | 27 ++++++++ .../en/default/bug/comments.html.tmpl | 37 +++++++++- .../template/en/default/bug/edit.html.tmpl | 67 ------------------- 4 files changed, 64 insertions(+), 69 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index 50ab4cfe7f1..c9e43af8cf7 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -7947 \ No newline at end of file +7948 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/js/comments.js b/mozilla/webtools/bugzilla/js/comments.js index f46499b62f3..28ef54397bd 100644 --- a/mozilla/webtools/bugzilla/js/comments.js +++ b/mozilla/webtools/bugzilla/js/comments.js @@ -145,3 +145,30 @@ function goto_add_comments( anchor ){ },10); return false; } + +if (typeof Node == 'undefined') { + /* MSIE doesn't define Node, so provide a compatibility object */ + window.Node = { + TEXT_NODE: 3, + ENTITY_REFERENCE_NODE: 5 + }; +} + +/* Concatenates all text from element's childNodes. This is used + * instead of innerHTML because we want the actual text (and + * innerText is non-standard). + */ +function getText(element) { + var child, text = ""; + for (var i=0; i < element.childNodes.length; i++) { + child = element.childNodes[i]; + var type = child.nodeType; + if (type == Node.TEXT_NODE || type == Node.ENTITY_REFERENCE_NODE) { + text += child.nodeValue; + } else { + /* recurse into nodes of other types */ + text += getText(child); + } + } + return text; +} diff --git a/mozilla/webtools/bugzilla/template/en/default/bug/comments.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/bug/comments.html.tmpl index cbd1d0b8362..7b383daf5ac 100644 --- a/mozilla/webtools/bugzilla/template/en/default/bug/comments.html.tmpl +++ b/mozilla/webtools/bugzilla/template/en/default/bug/comments.html.tmpl @@ -25,6 +25,37 @@ + + [% DEFAULT start_at = 0 mode = "show" %] [% sort_order = user.settings.comment_sort_order.value %] @@ -120,8 +151,12 @@ [% IF mode == "edit" %] + [reply] diff --git a/mozilla/webtools/bugzilla/template/en/default/bug/edit.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/bug/edit.html.tmpl index c2f8894d7dd..6a7f76c876c 100644 --- a/mozilla/webtools/bugzilla/template/en/default/bug/edit.html.tmpl +++ b/mozilla/webtools/bugzilla/template/en/default/bug/edit.html.tmpl @@ -32,72 +32,6 @@