summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sphinx/builders/websupport.py14
-rw-r--r--sphinx/themes/basic/static/websupport.js12
-rw-r--r--sphinx/websupport/__init__.py9
-rw-r--r--sphinx/writers/websupport.py3
4 files changed, 21 insertions, 17 deletions
diff --git a/sphinx/builders/websupport.py b/sphinx/builders/websupport.py
index cdd0fb925..3d0356b71 100644
--- a/sphinx/builders/websupport.py
+++ b/sphinx/builders/websupport.py
@@ -81,9 +81,11 @@ class WebSupportBuilder(StandaloneHTMLBuilder):
ctx, event_arg)
# Create a dict that will be pickled and used by webapps.
+ css = '<link rel="stylesheet" href="%s" type=text/css />' % \
+ pathto('_static/pygmentcs.css', 1)
doc_ctx = {'body': ctx.get('body', ''),
'title': ctx.get('title', ''),
- 'css': self._make_css(ctx),
+ 'css': css,
'js': self._make_js(ctx)}
# Partially render the html template to proved a more useful ctx.
template = self.templates.environment.get_template(templatename)
@@ -124,16 +126,6 @@ class WebSupportBuilder(StandaloneHTMLBuilder):
def dump_search_index(self):
self.indexer.finish_indexing()
- def _make_css(self, ctx):
- def make_link(file):
- path = ctx['pathto'](file, 1)
- return '<link rel="stylesheet" href="%s" type=text/css />' % path
-
- links = [make_link('_static/pygments.css')]
- for file in ctx['css_files']:
- links.append(make_link(file))
- return '\n'.join(links)
-
def _make_js(self, ctx):
def make_script(file):
path = ctx['pathto'](file, 1)
diff --git a/sphinx/themes/basic/static/websupport.js b/sphinx/themes/basic/static/websupport.js
index 0e2b44303..aeef3ece1 100644
--- a/sphinx/themes/basic/static/websupport.js
+++ b/sphinx/themes/basic/static/websupport.js
@@ -615,7 +615,7 @@
return this.each(function() {
$(this).append(
$('<a href="#" class="sphinx_comment"></a>')
- .html(opts.commentHTML)
+ .html('<img src="' + opts.commentImage + '" alt="comment" />')
.click(function(event) {
event.preventDefault();
show($(this).parent().attr('id'));
@@ -722,11 +722,11 @@
acceptCommentURL: '/accept_comment',
rejectCommentURL: '/reject_comment',
rejectCommentURL: '/delete_comment',
- commentHTML: '<img src="/static/comment.png" alt="comment" />',
- upArrow: '/static/up.png',
- downArrow: '/static/down.png',
- upArrowPressed: '/static/up-pressed.png',
- downArrowPressed: '/static/down-pressed.png',
+ commentImage: '/static/_static/comment.png',
+ upArrow: '/static/_static/up.png',
+ downArrow: '/static/_static/down.png',
+ upArrowPressed: '/static/_static/up-pressed.png',
+ downArrowPressed: '/static/_static/down-pressed.png',
voting: false,
moderator: false
}, COMMENT_OPTIONS);
diff --git a/sphinx/websupport/__init__.py b/sphinx/websupport/__init__.py
index 9bd6cbda5..3215e856e 100644
--- a/sphinx/websupport/__init__.py
+++ b/sphinx/websupport/__init__.py
@@ -162,6 +162,15 @@ class WebSupport(object):
'reject_comment'))
parts.append('deleteCommentURL: "/%s/%s",' % (self.docroot,
'delete_comment'))
+
+ if self.staticdir != 'static':
+ p = lambda file: '%s/_static/%s' % (self.staticdir, file)
+ parts.append('commentImage: "/%s",' % p('comment.png') )
+ parts.append('upArrow: "/%s",' % p('up.png'))
+ parts.append('downArrow: "/%s",' % p('down.png'))
+ parts.append('upArrowPressed: "/%s",' % p('up-pressed.png'))
+ parts.append('downArrowPressed: "/%s",' % p('down-pressed.png'))
+
if username is not '':
parts.append('voting: true,')
parts.append('username: "%s",' % username)
diff --git a/sphinx/writers/websupport.py b/sphinx/writers/websupport.py
index 63281f182..688fdbeaf 100644
--- a/sphinx/writers/websupport.py
+++ b/sphinx/writers/websupport.py
@@ -62,4 +62,7 @@ class WebSupportTranslator(HTMLTranslator):
line=node.line,
source=node.rawsource,
treeloc='???')
+ if db_node_id == 30711:
+ import pdb
+ pdb.set_trace()
return db_node_id