diff --git a/boards/static/js/form.js b/boards/static/js/form.js --- a/boards/static/js/form.js +++ b/boards/static/js/form.js @@ -1,5 +1,3 @@ -var isCompact = false; - $('input[name=image]').wrap($('
')); $('body').on('change', 'input[name=image]', function(event) { @@ -19,4 +17,11 @@ var isCompact = false; fileReader.readAsDataURL(file); } +}); + +var form = $('#form'); +$('textarea').keypress(function(event) { + if (event.which == 13) { + form.submit(); + } }); \ No newline at end of file diff --git a/boards/static/js/thread_update.js b/boards/static/js/thread_update.js --- a/boards/static/js/thread_update.js +++ b/boards/static/js/thread_update.js @@ -25,7 +25,6 @@ var wsUser = ''; -var loading = false; var unreadPosts = 0; var documentOriginalTitle = ''; @@ -94,8 +93,6 @@ function getThreadDiff() { var post = $(postText); updatePost(post) - - lastPost = post; } var updatedPosts = data.updated; @@ -297,8 +294,7 @@ function showAsErrors(form, text) { form.children('.form-errors').remove(); if (text.length > 0) { - var errorList = $('
' + text - + '
'); + var errorList = $('
' + text + '
'); errorList.appendTo(form); } } diff --git a/boards/templates/boards/posting_general.html b/boards/templates/boards/posting_general.html --- a/boards/templates/boards/posting_general.html +++ b/boards/templates/boards/posting_general.html @@ -127,11 +127,12 @@
{% trans "Create new thread" %}
-
{% csrf_token %} + {% csrf_token %} {{ form.as_div }}
+ (ctrl-enter)
diff --git a/boards/templates/boards/thread.html b/boards/templates/boards/thread.html --- a/boards/templates/boards/thread.html +++ b/boards/templates/boards/thread.html @@ -41,18 +41,18 @@
{% if not thread.archived %} -
+
{% trans "Reply to thread" %} #{{ opening_post.id }}
-
{% csrf_token %} + {% csrf_token %}
{{ form.as_div }}
+ (ctrl-enter)