##// END OF EJS Templates
Post message by ctrl-enter on the text field
neko259 -
r1005:1df42bd8 default
parent child Browse files
Show More
@@ -1,5 +1,3 b''
1 var isCompact = false;
2
3 $('input[name=image]').wrap($('<div class="file_wrap"></div>'));
1 $('input[name=image]').wrap($('<div class="file_wrap"></div>'));
4
2
5 $('body').on('change', 'input[name=image]', function(event) {
3 $('body').on('change', 'input[name=image]', function(event) {
@@ -19,4 +17,11 b' var isCompact = false;'
19
17
20 fileReader.readAsDataURL(file);
18 fileReader.readAsDataURL(file);
21 }
19 }
20 });
21
22 var form = $('#form');
23 $('textarea').keypress(function(event) {
24 if (event.which == 13) {
25 form.submit();
26 }
22 }); No newline at end of file
27 });
@@ -25,7 +25,6 b''
25
25
26 var wsUser = '';
26 var wsUser = '';
27
27
28 var loading = false;
29 var unreadPosts = 0;
28 var unreadPosts = 0;
30 var documentOriginalTitle = '';
29 var documentOriginalTitle = '';
31
30
@@ -94,8 +93,6 b' function getThreadDiff() {'
94 var post = $(postText);
93 var post = $(postText);
95
94
96 updatePost(post)
95 updatePost(post)
97
98 lastPost = post;
99 }
96 }
100
97
101 var updatedPosts = data.updated;
98 var updatedPosts = data.updated;
@@ -297,8 +294,7 b' function showAsErrors(form, text) {'
297 form.children('.form-errors').remove();
294 form.children('.form-errors').remove();
298
295
299 if (text.length > 0) {
296 if (text.length > 0) {
300 var errorList = $('<div class="form-errors">' + text
297 var errorList = $('<div class="form-errors">' + text + '<div>');
301 + '<div>');
302 errorList.appendTo(form);
298 errorList.appendTo(form);
303 }
299 }
304 }
300 }
@@ -127,11 +127,12 b''
127 <div class="post-form">
127 <div class="post-form">
128 <div class="form-title">{% trans "Create new thread" %}</div>
128 <div class="form-title">{% trans "Create new thread" %}</div>
129 <div class="swappable-form-full">
129 <div class="swappable-form-full">
130 <form enctype="multipart/form-data" method="post">{% csrf_token %}
130 <form enctype="multipart/form-data" method="post"id="form">{% csrf_token %}
131 {{ form.as_div }}
131 {{ form.as_div }}
132 <div class="form-submit">
132 <div class="form-submit">
133 <input type="submit" value="{% trans "Post" %}"/>
133 <input type="submit" value="{% trans "Post" %}"/>
134 </div>
134 </div>
135 (ctrl-enter)
135 </form>
136 </form>
136 </div>
137 </div>
137 <div>
138 <div>
@@ -41,18 +41,18 b''
41 </div>
41 </div>
42
42
43 {% if not thread.archived %}
43 {% if not thread.archived %}
44 <div class="post-form-w" id="form">
44 <div class="post-form-w">
45 <script src="{% static 'js/panel.js' %}"></script>
45 <script src="{% static 'js/panel.js' %}"></script>
46 <div class="form-title">{% trans "Reply to thread" %} #{{ opening_post.id }}</div>
46 <div class="form-title">{% trans "Reply to thread" %} #{{ opening_post.id }}</div>
47 <div class="post-form" id="compact-form">
47 <div class="post-form" id="compact-form">
48 <div class="swappable-form-full">
48 <div class="swappable-form-full">
49 <form enctype="multipart/form-data" method="post"
49 <form enctype="multipart/form-data" method="post" id="form">{% csrf_token %}
50 >{% csrf_token %}
51 <div class="compact-form-text"></div>
50 <div class="compact-form-text"></div>
52 {{ form.as_div }}
51 {{ form.as_div }}
53 <div class="form-submit">
52 <div class="form-submit">
54 <input type="submit" value="{% trans "Post" %}"/>
53 <input type="submit" value="{% trans "Post" %}"/>
55 </div>
54 </div>
55 (ctrl-enter)
56 </form>
56 </form>
57 </div>
57 </div>
58 <div><a href="{% url "staticpage" name="help" %}">
58 <div><a href="{% url "staticpage" name="help" %}">
General Comments 0
You need to be logged in to leave comments. Login now