added a notifications service

This commit is contained in:
Luke Pulverenti
2013-07-06 17:23:32 -04:00
parent b3054a6a22
commit 53450bd514
36 changed files with 1368 additions and 114 deletions

View File

@@ -468,6 +468,7 @@ namespace MediaBrowser.WebDashboard.Api
"musicgenres.js",
"musicrecommended.js",
"musicvideos.js",
"notifications.js",
"playlist.js",
"plugincatalogpage.js",
"pluginspage.js",
@@ -524,6 +525,7 @@ namespace MediaBrowser.WebDashboard.Api
"detailtable.css",
"posteritem.css",
"tileitem.css",
"notifications.css",
"search.css",
"pluginupdates.css",
"remotecontrol.css",

View File

@@ -243,6 +243,61 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
});
};
self.getNotificationSummary = function (userId) {
if (!userId) {
throw new Error("null userId");
}
var url = self.getUrl("Notifications/" + userId + "/Summary");
return self.ajax({
type: "GET",
url: url,
dataType: "json"
});
};
self.getNotifications = function (userId, options) {
if (!userId) {
throw new Error("null userId");
}
var url = self.getUrl("Notifications/" + userId, options || {});
return self.ajax({
type: "GET",
url: url,
dataType: "json"
});
};
self.markNotificationsRead = function (userId, idList, isRead) {
if (!userId) {
throw new Error("null userId");
}
if (!idList || !idList.length) {
throw new Error("null idList");
}
var suffix = isRead ? "Read" : "Unread";
var params = {
UserId: userId,
Ids: idList.join(',')
};
var url = self.getUrl("Notifications/" + userId + "/" + suffix, params);
return self.ajax({
type: "POST",
url: url
});
};
/**
* Gets the current server status
*/
@@ -1937,7 +1992,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
if (!item) {
throw new Error("null item");
}
var url = self.getUrl("Artists/" + self.encodeName(item.Name));
return self.ajax({

View File

@@ -84,6 +84,9 @@
<Content Include="dashboard-ui\boxsets.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\css\notifications.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\edititempeople.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -354,6 +357,9 @@
<Content Include="dashboard-ui\scripts\alphapicker.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\directorybrowser.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\edititempeople.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -375,6 +381,9 @@
<Content Include="dashboard-ui\scripts\musicvideos.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\notifications.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\remotecontrol.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.131" targetFramework="net45" />
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.135" targetFramework="net45" />
<package id="ServiceStack.Common" version="3.9.54" targetFramework="net45" />
<package id="ServiceStack.Text" version="3.9.54" targetFramework="net45" />
</packages>