fix paths in js

This commit is contained in:
Jacob Mason 2010-08-10 15:07:30 -05:00
parent eb2557f479
commit 1068ece635

View File

@ -354,6 +354,9 @@ class WebSupport(object):
that remains the same throughout the lifetime of the
:class:`~sphinx.websupport.WebSupport` object.
"""
self.base_comment_opts = {}
if self.docroot is not '':
comment_urls = [
('addCommentURL', 'add_comment'),
('getCommentsURL', 'get_comments'),
@ -362,6 +365,10 @@ class WebSupport(object):
('rejectCommentURL', 'reject_comment'),
('deleteCommentURL', 'delete_comment')
]
for key, value in comment_urls:
self.base_comment_opts[key] = \
'/' + posixpath.join(self.docroot, value)
if self.staticdir != 'static':
static_urls = [
('commentImage', 'comment.png'),
('loadingImage', 'ajax-loader.gif'),
@ -371,12 +378,9 @@ class WebSupport(object):
('downArrow', 'down.png'),
('downArrowPressed', 'down-pressed.png')
]
self.base_comment_opts = {}
for key, value in comment_urls:
self.base_comment_opts[key] = posixpath.join(self.docroot, value)
for key, value in static_urls:
self.base_comment_opts[key] = posixpath.join(self.staticdir, value)
self.base_comment_opts[key] = \
'/' + posixpath.join(self.staticdir, '_static', value)
def _make_comment_options(self, username, moderator):
"""Helper method to create the parts of the COMMENT_OPTIONS