From: Michael V. DePalatis Date: Fri, 12 Aug 2016 14:53:05 +0000 (+0200) Subject: Clear input when submitting message X-Git-Tag: v4.5.0~79^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1797%2Fhead;p=thirdparty%2Ftornado.git Clear input when submitting message --- diff --git a/demos/chat/static/chat.js b/demos/chat/static/chat.js index 240b4aea6..151a5880b 100644 --- a/demos/chat/static/chat.js +++ b/demos/chat/static/chat.js @@ -25,6 +25,7 @@ $(document).ready(function() { newMessage($(this)); return false; } + return true; }); $("#message").select(); updater.poll(); @@ -56,13 +57,13 @@ jQuery.postJSON = function(url, args, callback) { success: function(response) { if (callback) callback(eval("(" + response + ")")); }, error: function(response) { - console.log("ERROR:", response) + console.log("ERROR:", response); }}); }; jQuery.fn.formToDict = function() { var fields = this.serializeArray(); - var json = {} + var json = {}; for (var i = 0; i < fields.length; i++) { json[fields[i].name] = fields[i].value; } diff --git a/demos/chat/templates/index.html b/demos/chat/templates/index.html index 2e5852dbf..58433b446 100644 --- a/demos/chat/templates/index.html +++ b/demos/chat/templates/index.html @@ -16,7 +16,7 @@
- +