- eNotif.children("note").each(function(){
- e = $(this);
- var text = e.text().format("<span class='contactname'>"+e.attr('name')+"</span>");
- var seenclass = (e.attr('seen')==1)?"notify-seen":"notify-unseen";
- var html = notifications_tpl.format(e.attr('href'),
- e.attr('photo'), // {0}
- text, // {1}
- e.attr('date'), // {2}
- seenclass, // {3}
- new Date(e.attr('timestamp')*1000) // {4}
+ $(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