mirror of
https://bitbucket.org/skobkin/chrome_point_plus.git
synced 2024-11-23 18:56:04 +00:00
* Если окно активное, мы не меняем заголовок
This commit is contained in:
parent
d166ece3dd
commit
e6d8c31d7a
|
@ -1231,6 +1231,32 @@ function set_comments_refresh_tick(current_options) {
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
comments_count_refresh_tick(current_options);
|
comments_count_refresh_tick(current_options);
|
||||||
}, 60000);
|
}, 60000);
|
||||||
|
|
||||||
|
// Ставим слежение за позицией мыши
|
||||||
|
if (current_options.option_other_comments_count_refresh_title.value == true) {
|
||||||
|
$(document).
|
||||||
|
on('mouseenter', function() {
|
||||||
|
set_comments_refresh_clear_title_marks();
|
||||||
|
}).on('mouseleave', function() {
|
||||||
|
window_focused = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$(window).
|
||||||
|
on('focus', function() {
|
||||||
|
set_comments_refresh_clear_title_marks();
|
||||||
|
}).on('blur', function() {
|
||||||
|
window_focused = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var window_focused = true;
|
||||||
|
|
||||||
|
// Очищаем [0; 0]
|
||||||
|
function set_comments_refresh_clear_title_marks() {
|
||||||
|
var new_title = document.title.replace(new RegExp('^\\[[0-9]+\\; [0-9]+\\] '), '');
|
||||||
|
document.title = new_title;
|
||||||
|
window_focused = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Проверка обновления комментариев, обновляется по крону
|
// Проверка обновления комментариев, обновляется по крону
|
||||||
|
@ -1280,7 +1306,8 @@ function comments_count_refresh_tick(current_options) {
|
||||||
$('#main #left-menu #menu-comments .unread').text('0').hide();
|
$('#main #left-menu #menu-comments .unread').text('0').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_options.option_other_comments_count_refresh_title.value == true) {
|
if ((current_options.option_other_comments_count_refresh_title.value == true) &&
|
||||||
|
(!window_focused)) {
|
||||||
var new_title = document.title.replace(new RegExp('^\\[[0-9]+\\; [0-9]+\\] '), '');
|
var new_title = document.title.replace(new RegExp('^\\[[0-9]+\\; [0-9]+\\] '), '');
|
||||||
if ((count_recent > 0) || (count_comments > 0)) {
|
if ((count_recent > 0) || (count_comments > 0)) {
|
||||||
new_title = '[' + count_recent + '; ' + count_comments + '] ' + new_title;
|
new_title = '[' + count_recent + '; ' + count_comments + '] ' + new_title;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "Point+",
|
"name": "Point+",
|
||||||
"version": "1.18.5",
|
"version": "1.18.6",
|
||||||
"default_locale": "ru",
|
"default_locale": "ru",
|
||||||
"author": "__MSG_ext_author__",
|
"author": "__MSG_ext_author__",
|
||||||
"homepage_url": "https://bitbucket.org/skobkin/chrome_point_plus",
|
"homepage_url": "https://bitbucket.org/skobkin/chrome_point_plus",
|
||||||
|
|
Loading…
Reference in a new issue