From 136caf50f2569b380879cc68d3dc10142c8e4f84 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 1 May 2012 17:29:26 +0800 Subject: Bug 743090: add ability to toggle wrapping of quoted text --- template/en/default/bug/comments.html.tmpl | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'template/en/default') 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; + } //--> @@ -146,6 +166,10 @@ [% IF mode == "edit" %] + [% IF comment_text.search("(?:^>|\n>)") %] + [wrap] + [% END %] [