Show More
@@ -4,6 +4,7 b' var MIN_INPUT_LENGTH = 3;' | |||
|
4 | 4 | var URL_DELIMITER = '\n'; |
|
5 | 5 | // TODO This needs to be the same for attachment download time limit. |
|
6 | 6 | var POST_AJAX_TIMEOUT = 30000; |
|
7 | var REPLY_TO_MSG = '.reply-to-message'; | |
|
7 | 8 | |
|
8 | 9 | var pastedImages = []; |
|
9 | 10 | |
@@ -198,6 +199,32 b' function initAjaxForm(openingPostId) {' | |||
|
198 | 199 | } |
|
199 | 200 | } |
|
200 | 201 | |
|
202 | function getForm() { | |
|
203 | return $('.post-form-w'); | |
|
204 | } | |
|
205 | ||
|
206 | /** | |
|
207 | * Clear all entered values in the form fields | |
|
208 | */ | |
|
209 | function resetForm() { | |
|
210 | var form = getForm(); | |
|
211 | ||
|
212 | form.find('input:text, input:password, input:file, textarea').val(''); | |
|
213 | form.find('input:radio, input:checkbox').removeAttr('checked').removeAttr('selected'); | |
|
214 | pastedImages = []; | |
|
215 | $('#pasted-images').remove(); | |
|
216 | $('.file_wrap').find('.file-thumb').remove(); | |
|
217 | $('#preview-text').hide(); | |
|
218 | ||
|
219 | resetFormPosition(form); | |
|
220 | } | |
|
221 | ||
|
222 | function resetFormPosition(form) { | |
|
223 | form.insertBefore($('footer')); | |
|
224 | ||
|
225 | $(REPLY_TO_MSG).hide(); | |
|
226 | } | |
|
227 | ||
|
201 | 228 | $(document).ready(function() { |
|
202 | 229 | var powDifficulty = parseInt($('body').attr('data-pow-difficulty')); |
|
203 | 230 | if (powDifficulty > 0 && typeof SharedWorker != 'undefined') { |
@@ -33,31 +33,6 b' function moveCaretToEnd(el) {' | |||
|
33 | 33 | el[0].setSelectionRange(newPos, newPos); |
|
34 | 34 | } |
|
35 | 35 | |
|
36 | function getForm() { | |
|
37 | return $('.post-form-w'); | |
|
38 | } | |
|
39 | ||
|
40 | /** | |
|
41 | * Clear all entered values in the form fields | |
|
42 | */ | |
|
43 | function resetForm() { | |
|
44 | var form = getForm(); | |
|
45 | ||
|
46 | form.find('input:text, input:password, input:file, textarea').val(''); | |
|
47 | form.find('input:radio, input:checkbox').removeAttr('checked').removeAttr('selected'); | |
|
48 | pastedImages = []; | |
|
49 | $('#pasted-images').remove(); | |
|
50 | $('.file_wrap').find('.file-thumb').remove(); | |
|
51 | $('#preview-text').hide(); | |
|
52 | ||
|
53 | resetFormPosition(form); | |
|
54 | } | |
|
55 | ||
|
56 | function resetFormPosition(form) { | |
|
57 | form.insertAfter($('.thread')); | |
|
58 | ||
|
59 | $(REPLY_TO_MSG).hide(); | |
|
60 | } | |
|
61 | 36 | |
|
62 | 37 | function showFormAfter(blockToInsertAfter) { |
|
63 | 38 | var form = getForm(); |
General Comments 0
You need to be logged in to leave comments.
Login now