summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sphinx/quickstart.py14
-rw-r--r--sphinx/themes/basic/static/websupport.js18
2 files changed, 28 insertions, 4 deletions
diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py
index b67ee054c..d79c555d3 100644
--- a/sphinx/quickstart.py
+++ b/sphinx/quickstart.py
@@ -784,14 +784,24 @@ def inner_main(args):
if not color_terminal():
nocolor()
+ if len(args) > 3:
+ print 'Usage: sphinx-quickstart [root]'
+ sys.exit(1)
+ elif len(args) == 2:
+ d['path'] = args[1]
+
print bold('Welcome to the Sphinx %s quickstart utility.') % __version__
print '''
Please enter values for the following settings (just press Enter to
accept a default value, if one is given in brackets).'''
- print '''
+ if 'path' in d:
+ print bold('''
+Selected root path: %s''' % d['path'])
+ else:
+ print '''
Enter the root path for documentation.'''
- do_prompt(d, 'path', 'Root path for the documentation', '.', is_path)
+ do_prompt(d, 'path', 'Root path for the documentation', '.', is_path)
while path.isfile(path.join(d['path'], 'conf.py')) or \
path.isfile(path.join(d['path'], 'source', 'conf.py')):
diff --git a/sphinx/themes/basic/static/websupport.js b/sphinx/themes/basic/static/websupport.js
index f1b64a0db..aff5ef414 100644
--- a/sphinx/themes/basic/static/websupport.js
+++ b/sphinx/themes/basic/static/websupport.js
@@ -156,7 +156,11 @@
event.preventDefault();
addComment(form);
});
+ if (COMMENT_METADATA[id] == 0)
+ $('#cn' + id).hide();
$('#s' + id).after(popup);
+// Recaptcha.create("6LfFAr8SAAAAADQ4xx8foVRW51EnF1fe4Apyivxf",
+// "cap" + id, { theme: "clean" });
popup.slideDown('fast', function() {
getComments(id);
});
@@ -227,6 +231,10 @@
// Disable the form that is being submitted.
form.find('textarea,input').attr('disabled', 'disabled');
+ // Solve CAPTCHA.
+ var challenge = Recaptcha.get_challenge();
+ var response = Recaptcha.get_response();
+
// Send the comment to the server.
$.ajax({
type: "POST",
@@ -236,7 +244,9 @@
node: node_id,
parent: parent_id,
text: text,
- proposal: proposal
+ proposal: proposal,
+ challenge: challenge,
+ response: response
},
success: function(data, textStatus, error) {
// Reset the form.
@@ -714,6 +724,7 @@
</p>\
<textarea name="proposal" id="pt<%id%>" cols="80"\
spellcheck="false"></textarea>\
+ <div id="cap<%id%>" />\
<input type="submit" value="Add comment" />\
<input type="hidden" name="node" value="<%id%>" />\
<input type="hidden" name="parent" value="" />\
@@ -787,7 +798,10 @@
$(document).ready(function() {
// add comment anchors for all paragraphs that are commentable
- $('.sphinx-has-comment').comment();
+ //$('.sphinx-has-comment').comment();
+ $('.sphinx-has-comment').mouseenter(function() {
+ $(this).unbind('mouseenter');
+ $(this).comment();});
// highlight search words in search results
$("div.context").each(function() {