|
|
@ -55,7 +55,7 @@ define([
|
|
|
|
var makeNotificationList = function (key, filterTypes) {
|
|
|
|
var makeNotificationList = function (key, filterTypes) {
|
|
|
|
filterTypes = filterTypes || [];
|
|
|
|
filterTypes = filterTypes || [];
|
|
|
|
var safeKey = key.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
|
|
|
|
var safeKey = key.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
|
|
|
|
var categoryName = Messages['notification_cat_' + safeKey] || safeKey;
|
|
|
|
var categoryName = Messages['notifications_cat_' + safeKey] || safeKey;
|
|
|
|
|
|
|
|
|
|
|
|
var notifsData = [];
|
|
|
|
var notifsData = [];
|
|
|
|
if (key === "all") {
|
|
|
|
if (key === "all") {
|
|
|
@ -68,7 +68,7 @@ define([
|
|
|
|
h("span.cp-app-notifications-panel-title",
|
|
|
|
h("span.cp-app-notifications-panel-title",
|
|
|
|
(Messages.notificationsPage || "Notifications") + " - " + categoryName),
|
|
|
|
(Messages.notificationsPage || "Notifications") + " - " + categoryName),
|
|
|
|
h("div.cp-app-notifications-panel-titlebar-buttons", [
|
|
|
|
h("div.cp-app-notifications-panel-titlebar-buttons", [
|
|
|
|
dismissAll = h("div.cp-app-notifications-dismissall.cp-clickable", { title: Messages.dismissAll || "Dismiss All" }, h("span.fa.fa-trash")),
|
|
|
|
dismissAll = h("div.cp-app-notifications-dismissall.cp-clickable", { title: Messages.notifications_dismissAll || "Dismiss All" }, h("span.fa.fa-trash")),
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
notifsList = h("div.cp-app-notifications-panel-list", [
|
|
|
|
notifsList = h("div.cp-app-notifications-panel-list", [
|
|
|
@ -106,7 +106,7 @@ define([
|
|
|
|
var loadmore;
|
|
|
|
var loadmore;
|
|
|
|
var lastKnownHash;
|
|
|
|
var lastKnownHash;
|
|
|
|
$(dismissAll).remove();
|
|
|
|
$(dismissAll).remove();
|
|
|
|
loadmore = h("div.cp-app-notification-loadmore.cp-clickable", Messages.loadMore || "Load more ...");
|
|
|
|
loadmore = h("div.cp-app-notification-loadmore.cp-clickable", Messages.notifications_loadMore || "Load more ...");
|
|
|
|
$(loadmore).click(function () {
|
|
|
|
$(loadmore).click(function () {
|
|
|
|
common.mailbox.getNotificationsHistory('notifications', 10, lastKnownHash, function (err, messages, end) {
|
|
|
|
common.mailbox.getNotificationsHistory('notifications', 10, lastKnownHash, function (err, messages, end) {
|
|
|
|
if (!Array.isArray(messages)) { return; }
|
|
|
|
if (!Array.isArray(messages)) { return; }
|
|
|
@ -211,7 +211,7 @@ define([
|
|
|
|
showCategories(categories[key]);
|
|
|
|
showCategories(categories[key]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$category.append(Messages['notification_cat_'+key] || key);
|
|
|
|
$category.append(Messages['notifications_cat_'+key] || key);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
showCategories(categories[active]);
|
|
|
|
showCategories(categories[active]);
|
|
|
|
};
|
|
|
|
};
|
|
|
|