|
|
@ -3599,8 +3599,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
var nextSoundAt = false; |
|
|
|
var nextSoundAt = false; |
|
|
|
var prevSoundVolume = false; |
|
|
|
var prevSoundVolume = false; |
|
|
|
var peerSettings = {}; |
|
|
|
var peerSettings = {}; |
|
|
|
var faviconBackupEl = $('link[rel="icon"]:first'), |
|
|
|
var faviconEl = $('link[rel="icon"]:first')[0]; |
|
|
|
faviconNewEl = $('<link rel="icon" href="favicon_unread.ico" type="image/x-icon" />'); |
|
|
|
|
|
|
|
var langNotificationsPluralize = _.pluralize('page_title_pluralize_notifications'); |
|
|
|
var langNotificationsPluralize = _.pluralize('page_title_pluralize_notifications'); |
|
|
|
|
|
|
|
|
|
|
|
var titleBackup = document.title, |
|
|
|
var titleBackup = document.title, |
|
|
@ -3614,7 +3613,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
$interval.cancel(titlePromise); |
|
|
|
$interval.cancel(titlePromise); |
|
|
|
if (!newVal) { |
|
|
|
if (!newVal) { |
|
|
|
document.title = titleBackup; |
|
|
|
document.title = titleBackup; |
|
|
|
$('link[rel="icon"]:first').replaceWith(faviconBackupEl); |
|
|
|
setFavicon(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
titleBackup = document.title; |
|
|
|
titleBackup = document.title; |
|
|
|
|
|
|
|
|
|
|
@ -3622,13 +3621,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
var time = tsNow(); |
|
|
|
var time = tsNow(); |
|
|
|
if (!notificationsCount || time % 2000 > 1000) { |
|
|
|
if (!notificationsCount || time % 2000 > 1000) { |
|
|
|
document.title = titleBackup; |
|
|
|
document.title = titleBackup; |
|
|
|
var curFav = $('link[rel="icon"]:first'); |
|
|
|
setFavicon(); |
|
|
|
if (curFav.attr('href').indexOf('favicon_unread') != -1) { |
|
|
|
|
|
|
|
curFav.replaceWith(faviconBackupEl); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
document.title = langNotificationsPluralize(notificationsCount); |
|
|
|
document.title = langNotificationsPluralize(notificationsCount); |
|
|
|
$('link[rel="icon"]:first').replaceWith(faviconNewEl); |
|
|
|
setFavicon('favicon_unread.ico'); |
|
|
|
} |
|
|
|
} |
|
|
|
}, 1000); |
|
|
|
}, 1000); |
|
|
|
} |
|
|
|
} |
|
|
@ -3687,6 +3683,15 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setFavicon (href) { |
|
|
|
|
|
|
|
var link = document.createElement('link'); |
|
|
|
|
|
|
|
link.rel = 'shortcut icon'; |
|
|
|
|
|
|
|
link.type = 'image/x-icon'; |
|
|
|
|
|
|
|
link.href = href || 'favicon.ico'; |
|
|
|
|
|
|
|
faviconEl.parentNode.replaceChild(link, faviconEl); |
|
|
|
|
|
|
|
faviconEl = link; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function savePeerSettings (peerID, settings) { |
|
|
|
function savePeerSettings (peerID, settings) { |
|
|
|
// console.trace(dT(), 'peer settings', peerID, settings);
|
|
|
|
// console.trace(dT(), 'peer settings', peerID, settings);
|
|
|
|
peerSettings[peerID] = $q.when(settings); |
|
|
|
peerSettings[peerID] = $q.when(settings); |
|
|
|