summaryrefslogtreecommitdiffstats
path: root/template/en/default/bug/comments.html.tmpl
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2012-05-01 11:29:26 +0200
committerByron Jones <bjones@mozilla.com>2012-05-01 11:29:26 +0200
commit136caf50f2569b380879cc68d3dc10142c8e4f84 (patch)
tree9a8e96799fae6c0a6362a3242a7c7d2ba66d9929 /template/en/default/bug/comments.html.tmpl
parent2e2178ab6272bb130c8dd15bb1cc9be50aa75ce4 (diff)
downloadbugzilla-136caf50f2569b380879cc68d3dc10142c8e4f84.tar.gz
bugzilla-136caf50f2569b380879cc68d3dc10142c8e4f84.tar.xz
Bug 743090: add ability to toggle wrapping of quoted text
Diffstat (limited to 'template/en/default/bug/comments.html.tmpl')
-rw-r--r--template/en/default/bug/comments.html.tmpl26
1 files changed, 25 insertions, 1 deletions
diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl
index 0c0f959f6..5b90c1720 100644
--- a/template/en/default/bug/comments.html.tmpl
+++ b/template/en/default/bug/comments.html.tmpl
@@ -57,7 +57,27 @@
}
textarea.focus();
- }
+ }
+
+ function toggleCommentWrap(a, id) {
+ var spans = document.getElementById('comment_text_' + id).getElementsByTagName('span');
+ var old_class;
+ var new_class;
+ if (a.innerHTML == 'wrap') {
+ a.innerHTML = 'unwrap';
+ old_class = 'quote';
+ new_class = 'quote_wrapped';
+ } else {
+ a.innerHTML = 'wrap';
+ old_class = 'quote_wrapped';
+ new_class = 'quote';
+ }
+ for (var i = 0, l = spans.length; i < l; i++) {
+ if (spans[i].className == old_class)
+ spans[i].className = new_class;
+ }
+ return false;
+ }
//-->
</script>
@@ -146,6 +166,10 @@
[% IF mode == "edit" %]
<span class="bz_comment_actions">
+ [% IF comment_text.search("(?:^>|\n>)") %]
+ [<a class="bz_wrap_link" href="#"
+ onclick="return toggleCommentWrap(this, [% count %])">wrap</a>]
+ [% END %]
[<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 html FILTER js %]'); return false;"