Show More
@@ -1,37 +1,35 | |||
|
1 | 1 | /* |
|
2 | 2 | @licstart The following is the entire license notice for the |
|
3 | 3 | JavaScript code in this page. |
|
4 | 4 | |
|
5 | 5 | |
|
6 | 6 | Copyright (C) 2013 neko259 |
|
7 | 7 | |
|
8 | 8 | The JavaScript code in this page is free software: you can |
|
9 | 9 | redistribute it and/or modify it under the terms of the GNU |
|
10 | 10 | General Public License (GNU GPL) as published by the Free Software |
|
11 | 11 | Foundation, either version 3 of the License, or (at your option) |
|
12 | 12 | any later version. The code is distributed WITHOUT ANY WARRANTY; |
|
13 | 13 | without even the implied warranty of MERCHANTABILITY or FITNESS |
|
14 | 14 | FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. |
|
15 | 15 | |
|
16 | 16 | As additional permission under GNU GPL version 3 section 7, you |
|
17 | 17 | may distribute non-source (e.g., minimized or compacted) forms of |
|
18 | 18 | that code without the copy of the GNU GPL normally required by |
|
19 | 19 | section 4, provided you include this license notice and a URL |
|
20 | 20 | through which recipients can access the Corresponding Source. |
|
21 | 21 | |
|
22 | 22 | @licend The above is the entire license notice |
|
23 | 23 | for the JavaScript code in this page. |
|
24 | 24 | */ |
|
25 | 25 | |
|
26 | 26 | $( document ).ready(function() { |
|
27 | 27 | $("a[href='#top']").click(function() { |
|
28 | 28 | $("html, body").animate({ scrollTop: 0 }, "slow"); |
|
29 | 29 | return false; |
|
30 | 30 | }); |
|
31 | 31 | |
|
32 | 32 | addImgPreview(); |
|
33 | 33 | |
|
34 | addMarkPanel(); | |
|
35 | ||
|
36 | 34 | addRefLinkPreview(); |
|
37 | 35 | }); |
@@ -1,81 +1,81 | |||
|
1 | 1 | /* |
|
2 | 2 | @licstart The following is the entire license notice for the |
|
3 | 3 | JavaScript code in this page. |
|
4 | 4 | |
|
5 | 5 | |
|
6 | 6 | Copyright (C) 2013 neko259 |
|
7 | 7 | |
|
8 | 8 | The JavaScript code in this page is free software: you can |
|
9 | 9 | redistribute it and/or modify it under the terms of the GNU |
|
10 | 10 | General Public License (GNU GPL) as published by the Free Software |
|
11 | 11 | Foundation, either version 3 of the License, or (at your option) |
|
12 | 12 | any later version. The code is distributed WITHOUT ANY WARRANTY; |
|
13 | 13 | without even the implied warranty of MERCHANTABILITY or FITNESS |
|
14 | 14 | FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. |
|
15 | 15 | |
|
16 | 16 | As additional permission under GNU GPL version 3 section 7, you |
|
17 | 17 | may distribute non-source (e.g., minimized or compacted) forms of |
|
18 | 18 | that code without the copy of the GNU GPL normally required by |
|
19 | 19 | section 4, provided you include this license notice and a URL |
|
20 | 20 | through which recipients can access the Corresponding Source. |
|
21 | 21 | |
|
22 | 22 | @licend The above is the entire license notice |
|
23 | 23 | for the JavaScript code in this page. |
|
24 | 24 | */ |
|
25 | 25 | |
|
26 | 26 | function addGalleryPanel() { |
|
27 | 27 | var gallery = $('a[class="thumb"]').clone(true), |
|
28 | 28 | normal = $('.post').clone(true); |
|
29 | 29 | |
|
30 | 30 | $('.navigation_panel').filter(':first').after( |
|
31 | 31 | '<div class="image-mode-tab" role="radiogroup" aria-label="Image mode2">' + |
|
32 | 32 | '<label><input type="radio" class="image-mode-normal" name="image-mode" value="0" checked="checked"/>'+ gettext('Normal') +'</label>' + |
|
33 | 33 | '<label><input type="radio" class="image-mode-table" name="image-mode" value="1"/>'+ gettext('Gallery') +'</label>' + |
|
34 | 34 | '</div>' |
|
35 | 35 | ); |
|
36 | 36 | |
|
37 | 37 | $('input[name="image-mode"]').change(function() { |
|
38 | 38 | //gallery mode |
|
39 | 39 | if($(this).val() === '1') { |
|
40 | 40 | $('.thread').replaceWith( |
|
41 | 41 | $('<div id="posts-table"></div>').append(gallery) |
|
42 | 42 | ); |
|
43 | 43 | } |
|
44 | 44 | //normal mode |
|
45 | 45 | else { |
|
46 | 46 | $('#posts-table').replaceWith( |
|
47 | 47 | $('<div class="thread"></div>').append(normal) |
|
48 | 48 | ); |
|
49 | 49 | } |
|
50 | 50 | }); |
|
51 | 51 | } |
|
52 | 52 | |
|
53 | 53 | function moveCaretToEnd(el) { |
|
54 | 54 | if (typeof el.selectionStart == "number") { |
|
55 | 55 | el.selectionStart = el.selectionEnd = el.value.length; |
|
56 | 56 | } else if (typeof el.createTextRange != "undefined") { |
|
57 | 57 | el.focus(); |
|
58 | 58 | var range = el.createTextRange(); |
|
59 | 59 | range.collapse(false); |
|
60 | 60 | range.select(); |
|
61 | 61 | } |
|
62 | 62 | } |
|
63 | 63 | |
|
64 | 64 | function addQuickReply(postId) { |
|
65 | 65 | var textToAdd = '>>' + postId + '\n\n'; |
|
66 |
var textAreaId = ' |
|
|
66 | var textAreaId = 'textarea'; | |
|
67 | 67 | $(textAreaId).val($(textAreaId).val()+ textToAdd); |
|
68 | 68 | |
|
69 |
var textarea = document.getElement |
|
|
69 | var textarea = document.getElementsByTagName('textarea')[0]; | |
|
70 | 70 | $(textAreaId).focus(); |
|
71 | 71 | moveCaretToEnd(textarea); |
|
72 | 72 | |
|
73 | 73 | $("html, body").animate({ scrollTop: $(textAreaId).offset().top }, "slow"); |
|
74 | 74 | } |
|
75 | 75 | |
|
76 | 76 | |
|
77 | 77 | |
|
78 | 78 | $(document).ready(function(){ |
|
79 | 79 | addGalleryPanel(); |
|
80 | 80 | initAutoupdate(); |
|
81 | 81 | }); |
General Comments 0
You need to be logged in to leave comments.
Login now