- if (data.notifications.length == 0) {
- $("#nav-notifications-menu").html(notifications_empty);
- } else {
- var nnm = $("#nav-notifications-menu");
- nnm.html(notifications_all + notifications_mark);
-
- var lastItemStorageKey = "notification-lastitem:" + localUser;
- var notification_lastitem = parseInt(localStorage.getItem(lastItemStorageKey));
- var notification_id = 0;
-
- // Insert notifs into the notifications-menu
- $(data.notifications).each(function(key, notif){
- var text = notif.message.format('<span class="contactname">' + notif.name + '</span>');
- var contact = ('<a href="' + notif.url + '"><span class="contactname">' + notif.name + '</span></a>');
- var seenclass = (notif.seen == 1) ? "notify-seen" : "notify-unseen";
- var html = notifications_tpl.format(
- notif.href, // {0} // link to the source
- notif.photo, // {1} // photo of the contact
- text, // {2} // preformatted text (autor + text)
- notif.date, // {3} // date of notification (time ago)
- seenclass, // {4} // visited status of the notification
- new Date(notif.timestamp*1000), // {5} // date of notification
- notif.url, // {6} // profile url of the contact
- notif.message.format(contact), // {7} // preformatted html (text including author profile url)
- '' // {8} // Deprecated
- );
- nnm.append(html);
- });
+ if (data.notifications.length == 0) {
+ $("#nav-notifications-menu").html(notifications_empty);
+ } else {
+ var nnm = $("#nav-notifications-menu");
+ nnm.html(notifications_all + notifications_mark);
+
+ var lastItemStorageKey = "notification-lastitem:" + localUser;
+ var notification_lastitem = parseInt(localStorage.getItem(lastItemStorageKey));
+ var notification_id = 0;
+
+ // Insert notifs into the notifications-menu
+ $(data.notifications).each(function(key, notif) {
+ var text = notif.message.format('<span class="contactname">' + notif.name + '</span>');
+ var contact = ('<a href="' + notif.url + '"><span class="contactname">' + notif.name + '</span></a>');
+ var seenclass = (notif.seen == 1) ? "notify-seen" : "notify-unseen";
+ var html = notifications_tpl.format(
+ notif.href, // {0} // link to the source
+ notif.photo, // {1} // photo of the contact
+ text, // {2} // preformatted text (autor + text)
+ notif.date, // {3} // date of notification (time ago)
+ seenclass, // {4} // visited status of the notification
+ new Date(notif.timestamp*1000), // {5} // date of notification
+ notif.url, // {6} // profile url of the contact
+ notif.message.format(contact), // {7} // preformatted html (text including author profile url)
+ '' // {8} // Deprecated
+ );
+ nnm.append(html);
+ });