From 5ab60299619557307cf38aa14824c8576f23f21c Mon Sep 17 00:00:00 2001 From: Emily O'Leary Date: Sun, 24 Mar 2013 21:42:42 -0400 Subject: 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. --- mediagoblin/user_pages/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/user_pages/forms.py') 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'' + u'' u'Markdown for formatting.')) class ConfirmDeleteForm(wtforms.Form): -- cgit v1.2.3 From 3cf4ae0c41618fca764b80c5888c2868b8be5829 Mon Sep 17 00:00:00 2001 From: Emily O'Leary Date: Mon, 25 Mar 2013 14:13:09 -0400 Subject: Changed the target of the markdown links for opening in a new tab as suggested by joar. --- mediagoblin/user_pages/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index cb8acb36..ac8084c5 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'' + u'' u'Markdown for formatting.')) class ConfirmDeleteForm(wtforms.Form): @@ -47,5 +47,5 @@ class MediaCollectForm(wtforms.Form): collection_description = wtforms.TextAreaField( _('Description of this collection'), description=_("""You can use - + Markdown for formatting.""")) -- cgit v1.2.3