removed relativeTime util method, utils.js better be a C now.

This commit is contained in:
Julian Lam
2015-01-19 15:43:22 -05:00
parent d2938ea509
commit 99dc37bd9c
3 changed files with 35 additions and 39 deletions

View File

@@ -25,11 +25,14 @@ define('notifications', ['sounds'], function(sound) {
image = '';
}
return '<li class="' + (notification.readClass || '') + '"><a href="' + (notification.path || '#') + '">' + image + '<span class="pull-right relTime">' + utils.relativeTime(notification.datetime, true) + '</span><span class="text">' + notification.bodyShort + '</span></a></li>';
return '<li class="' + (notification.readClass || '') + '"><a href="' + (notification.path || '#') + '">' + image + '<span class="pull-right relTime">' + $.timeago(new Date(parseInt(notification.datetime, 10))) + '</span><span class="text">' + notification.bodyShort + '</span></a></li>';
}
var x, html = '';
// Switch to shorthand
translator.toggleTimeagoShorthand();
if (!err && (data.read.length + data.unread.length) > 0) {
var image = '';
for (x = 0; x < data.unread.length; x++) {
@@ -43,6 +46,9 @@ define('notifications', ['sounds'], function(sound) {
html += '<li class="no-notifs"><a>[[notifications:no_notifs]]</a></li>';
}
// Switch back to original timeago strings
translator.toggleTimeagoShorthand();
html += '<li class="pagelink"><a href="' + config.relative_path + '/notifications">[[notifications:see_all]]</a></li>';
notifList.translateHtml(html);