]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Clear input when submitting message 1797/head
authorMichael V. DePalatis <mike@depalatis.net>
Fri, 12 Aug 2016 14:53:05 +0000 (16:53 +0200)
committerMichael V. DePalatis <mike@depalatis.net>
Fri, 12 Aug 2016 14:56:15 +0000 (16:56 +0200)
demos/chat/static/chat.js
demos/chat/templates/index.html

index 240b4aea6a0950cc63db0858368af6c473179783..151a5880bc8b5dd6958c13b9c1544273fd9cd00c 100644 (file)
@@ -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;
     }
index 2e5852dbf90e2bcae9637e81400046bb695b38cc..58433b446d647599306414e0bf3376eb4f34344e 100644 (file)
@@ -16,7 +16,7 @@
         <form action="/a/message/new" method="post" id="messageform">
           <table>
             <tr>
-              <td><input name="body" id="message" style="width:500px"></td>
+              <td><input type="text" name="body" id="message" style="width:500px"></td>
               <td style="padding-left:5px">
                 <input type="submit" value="{{ _("Post") }}">
                 <input type="hidden" name="next" value="{{ request.path }}">