X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Fjs%2Fmain.js;h=86131539871b8e4848abbaa3726c8dbe30d2cf71;hb=7e37378c2a453cae4c3e47a8ba93f61318917003;hp=560d9c428630abfec220d936e70ce46427141e40;hpb=0b0309ce8f10e1f7f3a519d6d91408f8e9d35140;p=friendica.git diff --git a/view/js/main.js b/view/js/main.js index 560d9c4286..8613153987 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -134,6 +134,7 @@ var commentBusy = false; var last_popup_menu = null; var last_popup_button = null; 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; @@ -242,6 +243,13 @@ $(function() { 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) { var number = data[type]; if (number == 0) { @@ -527,6 +535,8 @@ function updateConvItems(data) { // Add new top-level item. if ($('#' + ident).length === 0 && (!getUrlParameter('page') + && !getUrlParameter('max_id') + && !getUrlParameter('since_id') || getUrlParameter('page') === '1' ) ) { @@ -597,6 +607,12 @@ function liveUpdate(src) { if (getUrlParameter('page')) { update_url += '&page=' + getUrlParameter('page'); } + if (getUrlParameter('since_id')) { + update_url += '&since_id=' + getUrlParameter('since_id'); + } + if (getUrlParameter('max_id')) { + update_url += '&max_id=' + getUrlParameter('max_id'); + } $.get(update_url,function(data) { in_progress = false;