summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extensions/BMO/template/en/default/hook/bug/comments-a_comment-end.html.tmpl (renamed from extensions/BMO/template/en/default/hook/bug/comments-user.html.tmpl)11
-rw-r--r--extensions/BMO/template/en/default/hook/bug/comments-aftercomments.html.tmpl14
-rw-r--r--template/en/default/bug/comments.html.tmpl1
3 files changed, 22 insertions, 4 deletions
diff --git a/extensions/BMO/template/en/default/hook/bug/comments-user.html.tmpl b/extensions/BMO/template/en/default/hook/bug/comments-a_comment-end.html.tmpl
index 62b0c8c4a..caf7acca7 100644
--- a/extensions/BMO/template/en/default/hook/bug/comments-user.html.tmpl
+++ b/extensions/BMO/template/en/default/hook/bug/comments-a_comment-end.html.tmpl
@@ -6,7 +6,14 @@
# defined by the Mozilla Public License, v. 2.0.
#%]
-[% IF comment.author.login_name == 'tbplbot@gmail.com' %]
+[% IF user.id && comment.author.login_name == 'tbplbot@gmail.com' %]
[% has_tbpl_comment = 1 %]
- <script>tbpl_comment_ids.push([% count FILTER none %]);</script>
+ <script>
+ var id = [% count FILTER none %];
+ tbpl_comment_ids.push(id);
+ collapse_comment(
+ document.getElementById('comment_link_' + id),
+ document.getElementById('comment_text_' + id)
+ );
+ </script>
[% END %]
diff --git a/extensions/BMO/template/en/default/hook/bug/comments-aftercomments.html.tmpl b/extensions/BMO/template/en/default/hook/bug/comments-aftercomments.html.tmpl
index 3a8913be3..d8dc5bba0 100644
--- a/extensions/BMO/template/en/default/hook/bug/comments-aftercomments.html.tmpl
+++ b/extensions/BMO/template/en/default/hook/bug/comments-aftercomments.html.tmpl
@@ -7,6 +7,8 @@
#%]
[% IF has_tbpl_comment %]
+ [% expand_caption = 'Expand TinderboxPushlog Comments' %]
+ [% collapse_caption = 'Collapse TinderboxPushlog Comments' %]
<script>
YAHOO.util.Event.onDOMReady(function () {
var ul = document.getElementsByClassName('bz_collapse_expand_comments');
@@ -16,14 +18,22 @@
var a = document.createElement('a');
Dom.setAttribute(a, 'href', 'javascript:void(0)');
Dom.setAttribute(a, 'id', 'toggle_tbplbot_comments');
- a.innerHTML = 'Collapse TinderboxPushlog Comments';
+ a.innerHTML = '[% expand_caption FILTER js %]';
YAHOO.util.Event.on(a, 'click', function() {
+ var do_expand = a.innerHTML == '[% expand_caption FILTER js %]';
for (var i = 0, n = tbpl_comment_ids.length; i < n; i++) {
var id = tbpl_comment_ids[i];
var link = document.getElementById('comment_link_' + id);
var text = document.getElementById('comment_text_' + id);
- collapse_comment(link, text);
+ if (do_expand) {
+ expand_comment(link, text);
+ } else {
+ collapse_comment(link, text);
+ }
}
+ a.innerHTML = do_expand
+ ? '[% collapse_caption FILTER js %]'
+ : '[% expand_caption FILTER js %]';
});
li.appendChild(a);
ul[0].appendChild(li);
diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl
index 5b90c1720..7b305a248 100644
--- a/template/en/default/bug/comments.html.tmpl
+++ b/template/en/default/bug/comments.html.tmpl
@@ -240,4 +240,5 @@
[%- comment_text FILTER quoteUrls(bug, comment) -%]
</pre>
</div>
+ [% Hook.process('a_comment-end', 'bug/comments.html.tmpl') %]
[% END %]