Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
4055a481
Commit
4055a481
authored
Sep 01, 2011
by
David Lawrence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 653634 - Change the comment reply header to include the name of the person who has commented
r/a=LpSolit
parent
af9cc042
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
68 deletions
+63
-68
comments.js
js/comments.js
+27
-0
comments.html.tmpl
template/en/default/bug/comments.html.tmpl
+36
-1
edit.html.tmpl
template/en/default/bug/edit.html.tmpl
+0
-67
No files found.
js/comments.js
View file @
4055a481
...
...
@@ -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
;
}
template/en/default/bug/comments.html.tmpl
View file @
4055a481
...
...
@@ -25,6 +25,37 @@
<script src="[% 'js/comments.js' FILTER mtime %]" type="text/javascript">
</script>
<script type="text/javascript">
<!--
/* Adds the reply text to the `comment' textarea */
function replyToComment(id, real_id, name) {
var prefix = "(In reply to " + name + " from comment #" + id + ")\n";
var replytext = "";
[% 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);
replytext = prefix + wrapReplyText(text);
[% ELSIF user.settings.quote_replies.value == 'simple_reply' %]
replytext = prefix;
[% END %]
[% IF user.is_insider %]
if (document.getElementById('isprivate_' + real_id).checked) {
document.getElementById('newcommentprivacy').checked = 'checked';
updateCommentTagControl(document.getElementById('newcommentprivacy'), 'comment');
}
[% END %]
/* <textarea id="comment"> */
var textarea = document.getElementById('comment');
textarea.value += replytext;
textarea.focus();
}
//-->
</script>
[% DEFAULT start_at = 0 mode = "show" %]
[% sort_order = user.settings.comment_sort_order.value %]
...
...
@@ -120,8 +151,12 @@
[% IF mode == "edit" %]
<span class="bz_comment_actions">
[<a class="bz_reply_link" href="#add_comment"
[% IF user.settings.quote_replies.value != 'off' %]
onclick="replyToComment('[% count %]', '[% comment.id %]', '[% comment.author.name || comment.author.nick FILTER js %]'); return false;"
[% END %]
>reply</a>]
<script type="text/javascript"><!--
addReplyLink([% count %], [% comment.id %]);
addCollapseLink([% count %]); // -->
</script>
</span>
...
...
template/en/default/bug/edit.html.tmpl
View file @
4055a481
...
...
@@ -32,72 +32,6 @@
<script type="text/javascript">
<!--
/* Outputs a link to call replyToComment(); used to reduce HTML output */
function addReplyLink(id, real_id) {
/* XXX this should really be updated to use the DOM Core's
* createElement, but finding a container isn't trivial.
*/
[% IF user.settings.quote_replies.value != 'off' %]
document.write('[<a href="#add_comment" onclick="replyToComment(' +
id + ',' + real_id + '); return false;">reply<' + '/a>]');
[% END %]
}
/* Adds the reply text to the `comment' textarea */
function replyToComment(id, real_id) {
var prefix = "(In reply to comment #" + id + ")\n";
var replytext = "";
[% 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);
replytext = prefix + wrapReplyText(text);
[% ELSIF user.settings.quote_replies.value == 'simple_reply' %]
replytext = prefix;
[% END %]
[% IF user.is_insider %]
if (document.getElementById('isprivate_' + real_id).checked) {
document.getElementById('newcommentprivacy').checked = 'checked';
updateCommentTagControl(document.getElementById('newcommentprivacy'), 'comment');
}
[% END %]
/* <textarea id="comment"> */
var textarea = document.getElementById('comment');
textarea.value += replytext;
textarea.focus();
}
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;
}
[% IF user.is_timetracker %]
var fRemainingTime = [% bug.remaining_time %]; // holds the original value
function adjustRemainingTime() {
...
...
@@ -116,7 +50,6 @@
// if the remaining time is changed manually, update fRemainingTime
fRemainingTime = document.changeform.remaining_time.value;
}
[% END %]
/* Index all classifications so we can keep track of the classification
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment