aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/user_pages/forms.py
diff options
context:
space:
mode:
authorEmily O'Leary <lotusecho@ThinkLotus>2013-03-24 21:42:42 -0400
committerRodney Ewing <ewing.rj@gmail.com>2013-08-07 16:33:09 -0700
commit5ab60299619557307cf38aa14824c8576f23f21c (patch)
tree6d1d19ddbbfa1405105ca34393a8ea8770b396c4 /mediagoblin/user_pages/forms.py
parent9da4e8049f2de900f7aa12f2fed8c60d6749ff0b (diff)
downloadmediagoblin-5ab60299619557307cf38aa14824c8576f23f21c.tar.lz
mediagoblin-5ab60299619557307cf38aa14824c8576f23f21c.tar.xz
mediagoblin-5ab60299619557307cf38aa14824c8576f23f21c.zip
Added comment preview functionality to user pages. It works by passing the comment's value as a JSON string to a new handler that lives at /ajax/comment/preview. The query string is decoded, unquoted, and has its leading and trailing quotes removed to match the input that cleaned_markdown_conversion expects.
It does this in real time with a 500ms lag by using a timer. Initially I tried the onChange handler but you need to lose focus for that to process. The javascript timer is only invoked if the add comment button is pressed. A request is only sent if the comment box is not empty and the current value is not the same as the last value.
Diffstat (limited to 'mediagoblin/user_pages/forms.py')
-rw-r--r--mediagoblin/user_pages/forms.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py
index 9a193680..cb8acb36 100644
--- a/mediagoblin/user_pages/forms.py
+++ b/mediagoblin/user_pages/forms.py
@@ -23,7 +23,7 @@ class MediaCommentForm(wtforms.Form):
_('Comment'),
[wtforms.validators.Required()],
description=_(u'You can use '
- u'<a href="http://daringfireball.net/projects/markdown/basics">'
+ u'<a href="http://daringfireball.net/projects/markdown/basics" target=new>'
u'Markdown</a> for formatting.'))
class ConfirmDeleteForm(wtforms.Form):