Show More
@@ -154,3 +154,8 b' textarea, input {' | |||
|
154 | 154 | -webkit-filter: grayscale(100%); |
|
155 | 155 | } |
|
156 | 156 | |
|
157 | #quote-button { | |
|
158 | position: absolute; | |
|
159 | display: none; | |
|
160 | cursor: pointer; | |
|
161 | } No newline at end of file |
@@ -571,3 +571,13 b' ul {' | |||
|
571 | 571 | .post-blink { |
|
572 | 572 | background-color: #000; |
|
573 | 573 | } |
|
574 | ||
|
575 | #quote-button { | |
|
576 | background-color: black; | |
|
577 | border: solid white 1px; | |
|
578 | padding: 2px; | |
|
579 | } | |
|
580 | ||
|
581 | #quote-button:hover { | |
|
582 | background-color: #2d3955; | |
|
583 | } No newline at end of file |
@@ -381,3 +381,13 b' input[type="submit"]:hover {' | |||
|
381 | 381 | .post-blink { |
|
382 | 382 | background-color: #333; |
|
383 | 383 | } |
|
384 | ||
|
385 | #quote-button { | |
|
386 | background-color: #e2c48f; | |
|
387 | border: solid #000000 1px; | |
|
388 | padding: 2px; | |
|
389 | } | |
|
390 | ||
|
391 | #quote-button:hover { | |
|
392 | background-color: #bde2a6; | |
|
393 | } No newline at end of file |
@@ -416,3 +416,13 b' audio {' | |||
|
416 | 416 | .post-blink { |
|
417 | 417 | background-color: #ccc; |
|
418 | 418 | } |
|
419 | ||
|
420 | #quote-button { | |
|
421 | background-color: #99a3e2; | |
|
422 | border: solid #000000 1px; | |
|
423 | padding: 2px; | |
|
424 | } | |
|
425 | ||
|
426 | #quote-button:hover { | |
|
427 | background-color: #b9c4e2; | |
|
428 | } No newline at end of file |
@@ -67,12 +67,10 b' function addQuickReply(postId) {' | |||
|
67 | 67 | if (getForm().prev().attr('id') == postId) { |
|
68 | 68 | resetFormPosition(); |
|
69 | 69 | } else { |
|
70 | var blockToInsert = null; | |
|
71 | var textAreaJq = $('textarea'); | |
|
70 | 72 | var postLinkRaw = '[post]' + postId + '[/post]' |
|
71 | ||
|
72 | 73 |
|
|
73 | var blockToInsert = null; | |
|
74 | ||
|
75 | var textAreaJq = $('textarea'); | |
|
76 | 74 | |
|
77 | 75 | if (postId != null) { |
|
78 | 76 | var post = $('#' + postId); |
@@ -83,27 +81,63 b' function addQuickReply(postId) {' | |||
|
83 | 81 | textToAdd += postLinkRaw + '\n'; |
|
84 | 82 | } |
|
85 | 83 | |
|
84 | textAreaJq.val(textAreaJq.val()+ textToAdd); | |
|
86 | 85 | blockToInsert = post; |
|
87 | 86 | } else { |
|
88 | 87 | blockToInsert = $('.thread'); |
|
89 | 88 | } |
|
89 | showFormAfter(blockToInsert); | |
|
90 | 90 | |
|
91 | textAreaJq.focus(); | |
|
92 | ||
|
93 | var textarea = document.getElementsByTagName('textarea')[0]; | |
|
94 | moveCaretToEnd(textarea); | |
|
95 | } | |
|
96 | } | |
|
97 | ||
|
98 | function addQuickQuote() { | |
|
99 | var textToAdd = ''; | |
|
100 | var textAreaJq = $('textarea'); | |
|
91 | 101 |
|
|
102 | if (selection.length == 0) { | |
|
103 | selection = $("#quote-button").attr('data-text'); | |
|
104 | } | |
|
92 | 105 |
|
|
93 | 106 |
|
|
94 | 107 |
|
|
95 | 108 | |
|
96 | 109 |
|
|
97 | 110 | |
|
98 | showFormAfter(blockToInsert); | |
|
111 | textAreaJq.focus(); | |
|
99 | 112 | |
|
100 | textAreaJq.focus(); | |
|
101 | 113 |
|
|
102 | 114 |
|
|
103 | 115 | } |
|
104 | } | |
|
105 | 116 | |
|
106 | 117 | function scrollToBottom() { |
|
107 | 118 | $html.animate({scrollTop: $html.height()}, "fast"); |
|
108 | 119 | } |
|
109 | 120 | |
|
121 | function showQuoteButton() { | |
|
122 | var selection = window.getSelection().getRangeAt(0).getBoundingClientRect(); | |
|
123 | var quoteButton = $("#quote-button"); | |
|
124 | if (selection.width > 0) { | |
|
125 | // quoteButton.offset({ top: selection.top - selection.height, left: selection.left }); | |
|
126 | quoteButton.css({top: selection.top + $(window).scrollTop() - 30, left: selection.left}); | |
|
127 | quoteButton.show(); | |
|
128 | ||
|
129 | var text = window.getSelection().toString(); | |
|
130 | quoteButton.attr('data-text', text); | |
|
131 | } else { | |
|
132 | quoteButton.hide(); | |
|
133 | } | |
|
134 | } | |
|
135 | ||
|
136 | $(document).ready(function() { | |
|
137 | $('body').on('mouseup', function() { | |
|
138 | showQuoteButton(); | |
|
139 | }); | |
|
140 | $("#quote-button").click(function() { | |
|
141 | addQuickQuote(); | |
|
142 | }) | |
|
143 | }); No newline at end of file |
@@ -9,6 +9,8 b'' | |||
|
9 | 9 | {% get_current_language as LANGUAGE_CODE %} |
|
10 | 10 | {% get_current_timezone as TIME_ZONE %} |
|
11 | 11 | |
|
12 | <div id="quote-button">{% trans 'Quote' %}</div> | |
|
13 | ||
|
12 | 14 | <div class="tag_info"> |
|
13 | 15 | <h2> |
|
14 | 16 | <form action="{% url 'thread' opening_post.id %}" method="post" class="post-button-form"> |
General Comments 0
You need to be logged in to leave comments.
Login now