##// END OF EJS Templates
Added new posts notification in the not active browser page
neko259 -
r451:01ebe19d 1.5-dev
parent child Browse files
Show More
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -8,7 +8,7 b' msgid ""'
8 msgstr ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "Report-Msgid-Bugs-To: \n"
10 "Report-Msgid-Bugs-To: \n"
11 "POT-Creation-Date: 2013-11-13 17:25+0200\n"
11 "POT-Creation-Date: 2013-12-21 21:45+0200\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -19,11 +19,11 b' msgstr ""'
19 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
19 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
20 "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
20 "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
21
21
22 #: static/js/refpopup.js:60
22 #: static/js/refpopup.js:57
23 msgid "Loading..."
23 msgid "Loading..."
24 msgstr "Загрузка..."
24 msgstr "Загрузка..."
25
25
26 #: static/js/refpopup.js:86
26 #: static/js/refpopup.js:76
27 msgid "Post not found"
27 msgid "Post not found"
28 msgstr "Сообщение не найдено"
28 msgstr "Сообщение не найдено"
29
29
@@ -35,5 +35,9 b' msgstr "\xd0\x9d\xd0\xbe\xd1\x80\xd0\xbc\xd0\xb0\xd0\xbb\xd1\x8c\xd0\xbd\xd1\x8b\xd0\xb9"'
35 msgid "Gallery"
35 msgid "Gallery"
36 msgstr "Галерея"
36 msgstr "Галерея"
37
37
38 #: static/js/thread_update.js:177
39 msgid "[new posts]"
40 msgstr "[новые посты]"
41
38 #~ msgid "Replies"
42 #~ msgid "Replies"
39 #~ msgstr "Ответы"
43 #~ msgstr "Ответы"
@@ -97,6 +97,10 b' function updateThread() {'
97
97
98 updateBumplimitProgress(data.added.length);
98 updateBumplimitProgress(data.added.length);
99 updatePostBumpableStatus();
99 updatePostBumpableStatus();
100
101 if (data.added.length + data.updated.length > 0) {
102 showNewPostsTitle();
103 }
100 })
104 })
101 .error(function(data) {
105 .error(function(data) {
102 // TODO Show error message that server is unavailable?
106 // TODO Show error message that server is unavailable?
@@ -162,3 +166,23 b' function updatePostBumpableStatus() {'
162 $('.thread').find('.post').addClass('dead_post');
166 $('.thread').find('.post').addClass('dead_post');
163 }
167 }
164 }
168 }
169
170 var documentOriginalTitle = '';
171 /**
172 * Show 'new posts' text in the title if the document is not visible to a user
173 */
174 function showNewPostsTitle() {
175 if (document.hidden) {
176 documentOriginalTitle = document.title;
177 document.title = gettext('[new posts]') + ' ' + document.title;
178
179 document.addEventListener('visibilitychange', function() {
180 if (documentOriginalTitle !== '') {
181 document.title = documentOriginalTitle;
182 documentOriginalTitle = '';
183 }
184
185 document.removeEventListener('visibilitychange', null);
186 });
187 }
188 } No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now