Show More
@@ -67,13 +67,29 b' function addQuickReply(postId) {' | |||||
67 | if (getForm().prev().attr('id') == postId) { |
|
67 | if (getForm().prev().attr('id') == postId) { | |
68 | resetFormPosition(); |
|
68 | resetFormPosition(); | |
69 | } else { |
|
69 | } else { | |
70 | var postLinkRaw = '[post]' + postId + '[/post]' |
|
70 | ||
|
71 | var blockToInsert = null; | |||
|
72 | ||||
|
73 | ||||
|
74 | if (postId != null) { | |||
|
75 | var post = $('#' + postId); | |||
|
76 | ||||
|
77 | blockToInsert = post; | |||
|
78 | } else { | |||
|
79 | blockToInsert = $('.thread'); | |||
|
80 | } | |||
|
81 | showFormAfter(blockToInsert); | |||
|
82 | } | |||
|
83 | } | |||
|
84 | ||||
|
85 | function addQuickQuote(postId) { | |||
|
86 | if (getForm().prev().attr('id') != postId) { | |||
|
87 | addQuickReply(postId); | |||
|
88 | } | |||
71 |
|
89 | |||
72 |
|
|
90 | var textToAdd = ''; | |
73 | var blockToInsert = null; |
|
|||
74 |
|
||||
75 |
|
|
91 | var textAreaJq = $('textarea'); | |
76 |
|
92 | var postLinkRaw = '[post]' + postId + '[/post]' | ||
77 |
|
|
93 | if (postId != null) { | |
78 |
|
|
94 | var post = $('#' + postId); | |
79 |
|
95 | |||
@@ -82,12 +98,7 b' function addQuickReply(postId) {' | |||||
82 |
|
|
98 | if (!post.is(':first-child') && textAreaJq.val().indexOf(postLinkRaw) < 0) { | |
83 |
|
|
99 | textToAdd += postLinkRaw + '\n'; | |
84 |
|
|
100 | } | |
85 |
|
||||
86 | blockToInsert = post; |
|
|||
87 | } else { |
|
|||
88 | blockToInsert = $('.thread'); |
|
|||
89 |
|
|
101 | } | |
90 |
|
||||
91 |
|
|
102 | var selection = window.getSelection().toString(); | |
92 |
|
|
103 | if (selection.length > 0) { | |
93 |
|
|
104 | textToAdd += '[quote]' + selection + '[/quote]\n'; | |
@@ -95,13 +106,10 b' function addQuickReply(postId) {' | |||||
95 |
|
106 | |||
96 |
|
|
107 | textAreaJq.val(textAreaJq.val()+ textToAdd); | |
97 |
|
108 | |||
98 | showFormAfter(blockToInsert); |
|
|||
99 |
|
||||
100 |
|
|
109 | textAreaJq.focus(); | |
101 |
|
|
110 | var textarea = document.getElementsByTagName('textarea')[0]; | |
102 |
|
|
111 | moveCaretToEnd(textarea); | |
103 | } |
|
112 | } | |
104 | } |
|
|||
105 |
|
113 | |||
106 | function scrollToBottom() { |
|
114 | function scrollToBottom() { | |
107 | $html.animate({scrollTop: $html.height()}, "fast"); |
|
115 | $html.animate({scrollTop: $html.height()}, "fast"); |
@@ -42,7 +42,8 b'' | |||||
42 | {% endif %} |
|
42 | {% endif %} | |
43 | {% endif %} |
|
43 | {% endif %} | |
44 | {% if reply_link and not thread.is_archived %} |
|
44 | {% if reply_link and not thread.is_archived %} | |
45 | <a href="#form" onclick="addQuickReply('{{ post.id }}'); return false;">{% trans 'Reply' %}</a> |
|
45 | <a href="#form" onclick="addQuickReply('{{ post.id }}'); return false;">{% trans 'Reply' %}</a> | | |
|
46 | <a href="#form" onclick="addQuickQuote('{{ post.id }}'); return false;">{% trans 'Quote' %}</a> | |||
46 | {% endif %} |
|
47 | {% endif %} | |
47 |
|
48 | |||
48 | {% if perms.boards.change_post or perms.boards.delete_post or perms.boards.change_thread or perms_boards.delete_thread %} |
|
49 | {% if perms.boards.change_post or perms.boards.delete_post or perms.boards.change_thread or perms_boards.delete_thread %} |
General Comments 0
You need to be logged in to leave comments.
Login now