diff --git a/boards/locale/ru/LC_MESSAGES/djangojs.mo b/boards/locale/ru/LC_MESSAGES/djangojs.mo index f54a84b5df0bd1d59557c847115a6b039705b611..5a71c8cdbcca6cf836cb63bc08bd7f181f42260d GIT binary patch literal 779 zc$`g9zi-n(6uv?M$w&-<#KLe4L{!xU+bvS%#-%24LWG?}Nm>c24o7nhM($l?Uw}#- z3QVX-41kyz5DRQA5S2n323CeMe?b2U{sErTpzy5kzW3vMch7f+XUAV7u#)kG{Y7ZR_EE^nbF&K}|pZ~IoN&L7Sw8)KaJ0?wGVXanel6=Id zgeFp;l3Cc)jVWT7#5AyJSku=gbyL?tNb2lC5RY`XU8hd`Dk(VlX4Ue`lXt2WSMz8r zNi(864yhE8g^LTGhbxZn;+*R{WpCao6zXoHF$YrK?$S0RO-9!&>^YUvLOOEJ^X9`K zE28#D1Ecz7-yQv*k=3=l;F57TZoLBn$sWn8osb567O&i+QOu;h&@7UfkuDu;l|{tm zDN5e-QZE;_a_?+n7&o|?r+u6>1HHgwxIa3+IOSHEN%2ELAUYz^W$ z+x%C`+0&^z=+JY9jyE=rT0o;uK#u`E=ESUq)JwIkzN=oc33!3j8wfuqo5@qPtG=o2 z^y$@G)razaDomcMgJetXA@xr6;oC``sh&DeUsVqS4VG=Sr@jobeYBLW>Jzj;=?Cod KIC+w6Eu+7X+3$4# diff --git a/boards/locale/ru/LC_MESSAGES/djangojs.po b/boards/locale/ru/LC_MESSAGES/djangojs.po --- a/boards/locale/ru/LC_MESSAGES/djangojs.po +++ b/boards/locale/ru/LC_MESSAGES/djangojs.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-11-13 17:25+0200\n" +"POT-Creation-Date: 2013-12-21 21:45+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -19,11 +19,11 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -#: static/js/refpopup.js:60 +#: static/js/refpopup.js:57 msgid "Loading..." msgstr "Загрузка..." -#: static/js/refpopup.js:86 +#: static/js/refpopup.js:76 msgid "Post not found" msgstr "Сообщение не найдено" @@ -35,5 +35,9 @@ msgstr "Нормальный" msgid "Gallery" msgstr "Галерея" +#: static/js/thread_update.js:177 +msgid "[new posts]" +msgstr "[новые посты]" + #~ msgid "Replies" #~ msgstr "Ответы" diff --git a/boards/static/js/thread_update.js b/boards/static/js/thread_update.js --- a/boards/static/js/thread_update.js +++ b/boards/static/js/thread_update.js @@ -97,6 +97,10 @@ function updateThread() { updateBumplimitProgress(data.added.length); updatePostBumpableStatus(); + + if (data.added.length + data.updated.length > 0) { + showNewPostsTitle(); + } }) .error(function(data) { // TODO Show error message that server is unavailable? @@ -162,3 +166,23 @@ function updatePostBumpableStatus() { $('.thread').find('.post').addClass('dead_post'); } } + +var documentOriginalTitle = ''; +/** + * Show 'new posts' text in the title if the document is not visible to a user + */ +function showNewPostsTitle() { + if (document.hidden) { + documentOriginalTitle = document.title; + document.title = gettext('[new posts]') + ' ' + document.title; + + document.addEventListener('visibilitychange', function() { + if (documentOriginalTitle !== '') { + document.title = documentOriginalTitle; + documentOriginalTitle = ''; + } + + document.removeEventListener('visibilitychange', null); + }); + } +} \ No newline at end of file