Add notifications in title

This commit is contained in:
Christian Vogeley 2012-09-17 20:39:34 +02:00
parent e34b8e6d46
commit 318bc23e8a
5 changed files with 12 additions and 0 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

BIN
view/.DS_Store vendored Normal file

Binary file not shown.

BIN
view/theme/.DS_Store vendored Normal file

Binary file not shown.

BIN
view/theme/cleanzero/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -71,3 +71,15 @@
<ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul>
<script>
var pagetitle = null;
$("nav").bind('nav-update', function(e,data){
if (pagetitle==null) pagetitle = document.title;
var count = $(data).find('notif').attr('count');
if (count>0) {
document.title = "("+count+") "+pagetitle;
} else {
document.title = pagetitle;
}
});
</script>