diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index a2810e3870..a10a93a70a 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/.bower.json +++ b/dashboard-ui/bower_components/emby-webcomponents/.bower.json @@ -16,12 +16,12 @@ }, "devDependencies": {}, "ignore": [], - "version": "1.2.19", - "_release": "1.2.19", + "version": "1.2.21", + "_release": "1.2.21", "_resolution": { "type": "version", - "tag": "1.2.19", - "commit": "31e70d0eb2beebfcff7817b4e91177fbc16962b5" + "tag": "1.2.21", + "commit": "562008a40ddd38451acd2eaee618541fbf3472d3" }, "_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_target": "^1.2.0", diff --git a/dashboard-ui/bower_components/emby-webcomponents/input/api.js b/dashboard-ui/bower_components/emby-webcomponents/input/api.js index 0a3414f309..5a27f078b1 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/input/api.js +++ b/dashboard-ui/bower_components/emby-webcomponents/input/api.js @@ -127,9 +127,7 @@ define(['connectionManager', 'playbackManager', 'events', 'inputManager', 'focus var apiClient = this; - if (msg.MessageType === "LibraryChanged") { - } - else if (msg.MessageType === "Play") { + if (msg.MessageType === "Play") { var serverId = apiClient.serverInfo().Id; @@ -143,10 +141,6 @@ define(['connectionManager', 'playbackManager', 'events', 'inputManager', 'focus playbackManager.play({ ids: msg.Data.ItemIds, startPositionTicks: msg.Data.StartPositionTicks, serverId: serverId }); } } - else if (msg.MessageType === "ServerShuttingDown") { - } - else if (msg.MessageType === "ServerRestarting") { - } else if (msg.MessageType === "Playstate") { if (msg.Data.Command === 'Stop') { @@ -172,8 +166,6 @@ define(['connectionManager', 'playbackManager', 'events', 'inputManager', 'focus var cmd = msg.Data; processGeneralCommand(cmd); } - else if (msg.MessageType === "RestartRequired") { - } } function bindEvents(apiClient) { diff --git a/dashboard-ui/bower_components/emby-webcomponents/servernotifications.js b/dashboard-ui/bower_components/emby-webcomponents/servernotifications.js new file mode 100644 index 0000000000..7387708a73 --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/servernotifications.js @@ -0,0 +1,48 @@ +define(['connectionManager', 'events'], function (connectionManager, events) { + + var serverNotifications = {}; + + function onWebSocketMessageReceived(e, msg) { + + var apiClient = this; + + if (msg.MessageType === "LibraryChanged") { + } + else if (msg.MessageType === "ServerShuttingDown") { + events.trigger(serverNotifications, 'ServerShuttingDown', [apiClient]); + } + else if (msg.MessageType === "ServerRestarting") { + events.trigger(serverNotifications, 'ServerRestarting', [apiClient]); + } + else if (msg.MessageType === "RestartRequired") { + events.trigger(serverNotifications, 'RestartRequired', [apiClient]); + } + else if (msg.MessageType === "UserDataChanged") { + + if (msg.Data.UserId == apiClient.getCurrentUserId()) { + + for (var i = 0, length = msg.Data.UserDataList.length; i < length; i++) { + events.trigger(serverNotifications, 'UserDataChanged', [apiClient, msg.Data.UserDataList[i]]); + } + } + } + } + + function bindEvents(apiClient) { + + events.off(apiClient, "websocketmessage", onWebSocketMessageReceived); + events.on(apiClient, "websocketmessage", onWebSocketMessageReceived); + } + + //var current = connectionManager.currentApiClient(); + //if (current) { + // bindEvents(current); + //} + + events.on(connectionManager, 'apiclientcreated', function (e, newApiClient) { + + bindEvents(newApiClient); + }); + + return serverNotifications; +}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-behaviors/.bower.json b/dashboard-ui/bower_components/iron-behaviors/.bower.json index 0b0736d6a6..85e8252b32 100644 --- a/dashboard-ui/bower_components/iron-behaviors/.bower.json +++ b/dashboard-ui/bower_components/iron-behaviors/.bower.json @@ -29,14 +29,14 @@ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, "ignore": [], - "homepage": "https://github.com/polymerelements/iron-behaviors", + "homepage": "https://github.com/PolymerElements/iron-behaviors", "_release": "1.0.13", "_resolution": { "type": "version", "tag": "v1.0.13", "commit": "a7bc3428a6da2beed21987b3a8028206826a12bc" }, - "_source": "git://github.com/polymerelements/iron-behaviors.git", + "_source": "git://github.com/PolymerElements/iron-behaviors.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/iron-behaviors" + "_originalSource": "PolymerElements/iron-behaviors" } \ No newline at end of file diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 44a2d12cc6..5d6a84a12e 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -832,6 +832,11 @@ var Dashboard = { icon: 'add-shopping-cart' } ] + }, { + name: Globalize.translate('TabNotifications'), + icon: 'notifications', + color: 'brown', + href: "notificationsettings.html" }, { name: Globalize.translate('TabPlayback'), icon: 'play-circle-filled', @@ -921,11 +926,6 @@ var Dashboard = { href: "dashboardhosting.html", pageIds: ['dashboardHostingPage'], icon: 'wifi' - }, { - name: Globalize.translate('TabNotifications'), - href: "notificationsettings.html", - pageIds: ['notificationSettingsPage', 'notificationSettingPage'], - icon: 'notifications' }, { name: Globalize.translate('TabScheduledTasks'), href: "scheduledtasks.html",