1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

merge from dev

This commit is contained in:
Luke Pulverenti 2015-12-14 10:43:03 -05:00
parent 1c8f02ce0f
commit 33b01d778c
911 changed files with 34157 additions and 57125 deletions

View file

@ -37,7 +37,7 @@
return;
}
promise.done(function (summary) {
promise.then(function (summary) {
var item = $('.btnNotificationsInner').removeClass('levelNormal').removeClass('levelWarning').removeClass('levelError').html(summary.UnreadCount);
@ -49,7 +49,7 @@
self.markNotificationsRead = function (ids, callback) {
ApiClient.markNotificationsRead(Dashboard.getCurrentUserId(), ids, true).done(function () {
ApiClient.markNotificationsRead(Dashboard.getCurrentUserId(), ids, true).then(function () {
self.getNotificationsSummaryPromise = null;
@ -75,7 +75,7 @@
var apiClient = window.ApiClient;
if (apiClient) {
return apiClient.getNotifications(Dashboard.getCurrentUserId(), { StartIndex: startIndex, Limit: limit }).done(function (result) {
return apiClient.getNotifications(Dashboard.getCurrentUserId(), { StartIndex: startIndex, Limit: limit }).then(function (result) {
listUnreadNotifications(result.Notifications, result.TotalRecordCount, startIndex, limit, elem, showPaging);
@ -108,15 +108,17 @@
});
}
for (var i = 0, length = list.length; i < length; i++) {
require(['humanedate', 'paper-fab', 'paper-item-body', 'paper-icon-item'], function () {
for (var i = 0, length = list.length; i < length; i++) {
var notification = list[i];
var notification = list[i];
html += getNotificationHtml(notification);
html += getNotificationHtml(notification);
}
}
elem.html(html).trigger('create');
elem.html(html).trigger('create');
});
}
function getNotificationHtml(notification) {
@ -178,35 +180,24 @@
$(apiClient).off("websocketmessage", onWebSocketMessage).on("websocketmessage", onWebSocketMessage);
}
$(document).on('headercreated', function (e, apiClient) {
$('.btnNotifications').on('click', function () {
Dashboard.navigate('notificationlist.html');
});
if (window.ApiClient) {
initializeApiClient(window.ApiClient);
}
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
initializeApiClient(apiClient);
});
Dashboard.ready(function () {
Events.on(ConnectionManager, 'localusersignedin', function () {
needsRefresh = true;
});
if (window.ApiClient) {
initializeApiClient(window.ApiClient);
}
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
initializeApiClient(apiClient);
});
Events.on(ConnectionManager, 'localusersignedin', function () {
needsRefresh = true;
});
Events.on(ConnectionManager, 'localusersignedout', function () {
needsRefresh = true;
});
Events.on(ConnectionManager, 'localusersignedout', function () {
needsRefresh = true;
});
pageClassOn('pageshow', "type-interior", function () {
var page = $(this);
if (needsRefresh) {
Notifications.updateNotificationCount();
}