diff --git a/public/js/selfoss-base.js b/public/js/selfoss-base.js index 77d87bff55..d34e7fe1c7 100644 --- a/public/js/selfoss-base.js +++ b/public/js/selfoss-base.js @@ -169,6 +169,8 @@ var selfoss = { // update sources selfoss.refreshSources(data.sources); + selfoss.setUnreadCount(data.unread); + // clean up $('#content').removeClass('loading'); selfoss.activeAjaxReq = null; @@ -301,6 +303,19 @@ var selfoss = { } } }); + }, + + /** + * show the unread count in the document title + * + * @param int unread + */ + setUnreadCount: function(unread) { + if(unread>0) { + $(document).attr('title', 'selfoss ('+unread+')'); + } else { + $(document).attr('title', 'selfoss'); + } } }; diff --git a/public/js/selfoss-events-entriestoolbar.js b/public/js/selfoss-events-entriestoolbar.js index 074147955e..9cbf5374c8 100644 --- a/public/js/selfoss-events-entriestoolbar.js +++ b/public/js/selfoss-events-entriestoolbar.js @@ -204,6 +204,7 @@ selfoss.events.entriesToolbar = function(parent) { tagsCountEl.html(''); } ); + selfoss.setUnreadCount(unreadstats); }; updateStats(unread); diff --git a/templates/home.phtml b/templates/home.phtml index c645226fdc..88e7638e3b 100644 --- a/templates/home.phtml +++ b/templates/home.phtml @@ -4,7 +4,7 @@ - selfoss + selfoss<?PHP echo $this->statsUnread>0 ? ' ('.$this->statsUnread.')' : ''; ?>