summaryrefslogtreecommitdiff
path: root/sphinx/themes/basic/static/websupport.js
diff options
context:
space:
mode:
authorJacob Mason <jacoblmason@gmail.com>2010-08-09 19:07:18 -0500
committerJacob Mason <jacoblmason@gmail.com>2010-08-09 19:07:18 -0500
commitd77cbf3043b88a31424d44538b8b8bb5fdc1e490 (patch)
tree796d4102f292f9af9418a63429a5c2814ed99b96 /sphinx/themes/basic/static/websupport.js
parent0f98c779c0813ffe3413f8678bb7c8cd88aabdab (diff)
downloadsphinx-git-d77cbf3043b88a31424d44538b8b8bb5fdc1e490.tar.gz
added comment metadata to frontend
Diffstat (limited to 'sphinx/themes/basic/static/websupport.js')
-rw-r--r--sphinx/themes/basic/static/websupport.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/sphinx/themes/basic/static/websupport.js b/sphinx/themes/basic/static/websupport.js
index c4fa57555..99d1a2217 100644
--- a/sphinx/themes/basic/static/websupport.js
+++ b/sphinx/themes/basic/static/websupport.js
@@ -617,9 +617,14 @@
*/
$.fn.comment = function() {
return this.each(function() {
+ var id = $(this).attr('id').substring(1);
+ var count = COMMENT_METADATA[id]
+ var title = count + ' comment' + (count == 1 ? '' : 's');
+ var image = count > 0 ? opts.commentBrightImage : opts.commentImage;
$(this).append(
$('<a href="#" class="sphinx_comment"></a>')
- .html('<img src="' + opts.commentImage + '" alt="comment" />')
+ .html('<img src="' + image + '" alt="comment" />')
+ .attr('title', title)
.click(function(event) {
event.preventDefault();
show($(this).parent().attr('id'));
@@ -727,6 +732,7 @@
rejectCommentURL: '/reject_comment',
rejectCommentURL: '/delete_comment',
commentImage: '/static/_static/comment.png',
+ commentBrightImage: '/static/_static/comment-bright.png',
upArrow: '/static/_static/up.png',
downArrow: '/static/_static/down.png',
upArrowPressed: '/static/_static/up-pressed.png',