Merge pull request #8687 from MrPetovan/task/8683-add-tab-notification-number
Add page title notification count display
This commit is contained in:
commit
410cee4e48
|
@ -134,6 +134,7 @@ var commentBusy = false;
|
||||||
var last_popup_menu = null;
|
var last_popup_menu = null;
|
||||||
var last_popup_button = null;
|
var last_popup_button = null;
|
||||||
var lockLoadContent = false;
|
var lockLoadContent = false;
|
||||||
|
var originalTitle = document.title;
|
||||||
|
|
||||||
const urlRegex = /^(?:https?:\/\/|\s)[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})(?:\/+[a-z0-9_.:;-]*)*(?:\?[&%|+a-z0-9_=,.:;-]*)?(?:[&%|+&a-z0-9_=,:;.-]*)(?:[!#\/&%|+a-z0-9_=,:;.-]*)}*$/i;
|
const urlRegex = /^(?:https?:\/\/|\s)[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})(?:\/+[a-z0-9_.:;-]*)*(?:\?[&%|+a-z0-9_=,.:;-]*)?(?:[&%|+&a-z0-9_=,:;.-]*)(?:[!#\/&%|+a-z0-9_=,:;.-]*)}*$/i;
|
||||||
|
|
||||||
|
@ -242,6 +243,13 @@ $(function() {
|
||||||
window.location.href=window.location.href
|
window.location.href=window.location.href
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let tabNotifications = data.mail + data.notification;
|
||||||
|
if (tabNotifications > 0) {
|
||||||
|
document.title = '(' + tabNotifications + ') ' + originalTitle;
|
||||||
|
} else {
|
||||||
|
document.title = originalTitle;
|
||||||
|
}
|
||||||
|
|
||||||
['net', 'home', 'intro', 'mail', 'events', 'birthdays', 'notification'].forEach(function(type) {
|
['net', 'home', 'intro', 'mail', 'events', 'birthdays', 'notification'].forEach(function(type) {
|
||||||
var number = data[type];
|
var number = data[type];
|
||||||
if (number == 0) {
|
if (number == 0) {
|
||||||
|
|
Loading…
Reference in a new issue