##// END OF EJS Templates
Added translation to the refpopup messages
neko259 -
r356:aedcd29c default
parent child Browse files
Show More
1 NO CONTENT: modified file, binary diff hidden
@@ -1,32 +1,39 b''
1 1 # SOME DESCRIPTIVE TITLE.
2 2 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 3 # This file is distributed under the same license as the PACKAGE package.
4 4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 5 #
6 6 #, fuzzy
7 7 msgid ""
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11 "POT-Creation-Date: 2013-08-27 23:21+0300\n"
11 "POT-Creation-Date: 2013-11-13 17:25+0200\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
15 15 "Language: \n"
16 16 "MIME-Version: 1.0\n"
17 17 "Content-Type: text/plain; charset=UTF-8\n"
18 18 "Content-Transfer-Encoding: 8bit\n"
19 19 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
20 20 "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
21 21
22 #: static/js/thread.js:17
22 #: static/js/refpopup.js:60
23 msgid "Loading..."
24 msgstr "Загрузка..."
25
26 #: static/js/refpopup.js:86
27 msgid "Post not found"
28 msgstr "Сообщение не найдено"
29
30 #: static/js/thread.js:32
23 31 msgid "Normal"
24 32 msgstr "Нормальный"
25 33
26 #: static/js/thread.js:24
34 #: static/js/thread.js:33
27 35 msgid "Gallery"
28 36 msgstr "Галерея"
29 37
30 #: static/js/thread.js:125
31 msgid "Replies"
32 msgstr "Ответы"
38 #~ msgid "Replies"
39 #~ msgstr "Ответы"
@@ -1,108 +1,108 b''
1 1 function $X(path, root) {
2 2 return document.evaluate(path, root || document, null, 6, null);
3 3 }
4 4 function $x(path, root) {
5 5 return document.evaluate(path, root || document, null, 8, null).singleNodeValue;
6 6 }
7 7
8 8 function $del(el) {
9 9 if(el) el.parentNode.removeChild(el);
10 10 }
11 11
12 12 function $each(list, fn) {
13 13 if(!list) return;
14 14 var i = list.snapshotLength;
15 15 if(i > 0) while(i--) fn(list.snapshotItem(i), i);
16 16 }
17 17
18 18 function addRefLinkPreview(node) {
19 19 $each($X('.//a[starts-with(text(),">>")]', node || document), function(link) {
20 20 link.addEventListener('mouseover', showPostPreview, false);
21 21 link.addEventListener('mouseout', delPostPreview, false);
22 22 });
23 23 }
24 24
25 25 function showPostPreview(e) {
26 26 var doc = document;
27 27 //ref id
28 28 var pNum = $(this).text().match(/\d+/);
29 29
30 30 if (pNum.length == 0) {
31 31 return;
32 32 }
33 33
34 34 //position
35 35 //var x = e.clientX + (doc.documentElement.scrollLeft || doc.body.scrollLeft) - doc.documentElement.clientLeft + 1;
36 36 //var y = e.clientY + (doc.documentElement.scrollTop || doc.body.scrollTop) - doc.documentElement.clientTop;
37 37
38 38 var x = e.clientX + (doc.documentElement.scrollLeft || doc.body.scrollLeft) + 2;
39 39 var y = e.clientY + (doc.documentElement.scrollTop || doc.body.scrollTop);
40 40
41 41 var cln = doc.createElement('div');
42 42 cln.id = 'pstprev_' + pNum;
43 43 cln.className = 'post_preview post';
44 44
45 45 cln.style.cssText = 'top:' + y + 'px;' + (x < doc.body.clientWidth/2 ? 'left:' + x + 'px' : 'right:' + parseInt(doc.body.clientWidth - x + 1) + 'px');
46 46
47 47 cln.addEventListener('mouseout', delPostPreview, false);
48 48
49 49
50 50 var mkPreview = function(cln, html) {
51 51
52 52 cln.innerHTML = html;
53 53
54 54 addRefLinkPreview(cln);
55 55
56 56 //if(!$x('.//small', cln)) showRefMap(post, p_num, refMap)
57 57 };
58 58
59 59
60 cln.innerHTML = 'Загрузка...';
60 cln.innerHTML = gettext('Loading...');
61 61
62 62 //если пост найден в дереве.
63 63 if($('div[id='+pNum+']').length > 0) {
64 64 var postdata = $('div[id='+pNum+']').html();
65 65
66 66 //TODO: временно
67 67 //funcInit(postdata);
68 68
69 69 //make preview
70 70 mkPreview(cln, postdata);
71 71 }
72 72 //ajax api
73 73 else {
74 74 $.ajax({
75 75 url: '/api/post/' + pNum
76 76 })
77 77 .success(function(data) {
78 78 // TODO get a json, not post itself
79 79 var postdata = $(data).html();
80 80
81 81 //make preview
82 82 mkPreview(cln, postdata);
83 83
84 84 })
85 85 .error(function() {
86 cln.innerHTML = 'Пост не найден.';
86 cln.innerHTML = gettext('Post not found');
87 87 });
88 88 }
89 89
90 90 $del(doc.getElementById(cln.id));
91 91
92 92 //add preview
93 93 $('body').append(cln);
94 94 }
95 95
96 96 function delPostPreview(e) {
97 97 var el = $x('ancestor-or-self::*[starts-with(@id,"pstprev")]', e.relatedTarget);
98 98 if(!el) $each($X('.//div[starts-with(@id,"pstprev")]'), function(clone) {
99 99 $del(clone)
100 100 });
101 101 else while(el.nextSibling) $del(el.nextSibling);
102 102 }
103 103
104 104 function addPreview() {
105 105 $('.post').find('a').each(function() {
106 106 showPostPreview($(this));
107 107 });
108 108 }
General Comments 0
You need to be logged in to leave comments. Login now