From 722a452b9179137928bc727b63226f7ecf9725ed Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 16 Jul 2016 21:58:51 -0400 Subject: [PATCH] update listviews --- .../emby-webcomponents/.bower.json | 8 +- .../emby-webcomponents/itemcontextmenu.js | 85 +++++++++++++++++-- .../emby-webcomponents/itemhelper.js | 46 +++++++++- .../emby-webcomponents/strings/da.json | 17 ++-- .../emby-webcomponents/strings/de.json | 17 ++-- .../emby-webcomponents/strings/en-US.json | 3 + .../emby-webcomponents/strings/es-MX.json | 17 ++-- .../emby-webcomponents/strings/kk.json | 17 ++-- .../emby-webcomponents/strings/nb.json | 17 ++-- .../emby-webcomponents/strings/nl.json | 17 ++-- .../emby-webcomponents/strings/pt-BR.json | 17 ++-- .../emby-webcomponents/strings/pt-PT.json | 17 ++-- .../emby-webcomponents/strings/ru.json | 17 ++-- .../emby-webcomponents/strings/sv.json | 17 ++-- .../emby-webcomponents/strings/zh-TW.json | 17 ++-- .../metadataeditor/metadataeditor.js | 4 +- dashboard-ui/scripts/itemdetailpage.js | 43 ++++++---- dashboard-ui/scripts/librarybrowser.js | 54 ++---------- dashboard-ui/scripts/librarylist.js | 2 +- 19 files changed, 277 insertions(+), 155 deletions(-) diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index 2610d42109..3a8b625ce2 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/.bower.json +++ b/dashboard-ui/bower_components/emby-webcomponents/.bower.json @@ -15,12 +15,12 @@ }, "devDependencies": {}, "ignore": [], - "version": "1.4.88", - "_release": "1.4.88", + "version": "1.4.89", + "_release": "1.4.89", "_resolution": { "type": "version", - "tag": "1.4.88", - "commit": "3a8a6459a61777d7b6f5c3b7c089b1ec391cd036" + "tag": "1.4.89", + "commit": "fb661d66f08795bad7137b9a193c7fd07d6ab9c8" }, "_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_target": "^1.2.0", diff --git a/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js b/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js index 5c58eb2a28..1138b8d43c 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js +++ b/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js @@ -1,5 +1,10 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', 'playbackManager'], function (appHost, globalize, connectionManager, itemHelper, embyRouter, playbackManager) { + var isTheater = true; + appHost.appInfo().then(function(result) { + isTheater = result.appName.toLowerCase().indexOf('theater') != -1; + }); + function getCommands(options) { var item = options.item; @@ -32,12 +37,25 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', }); } - if (user.Policy.IsAdministrator) { - if (item.MediaType == 'Video' && item.Type != 'TvChannel' && item.Type != 'Program' && item.LocationType != 'Virtual') { - commands.push({ - name: globalize.translate('sharedcomponents#EditSubtitles'), - id: 'editsubtitles' - }); + if (options.edit !== false) { + if (itemHelper.canEdit(user, item.Type)) { + + if (!isTheater) { + commands.push({ + name: globalize.translate('sharedcomponents#Edit'), + id: 'edit' + }); + commands.push({ + name: globalize.translate('sharedcomponents#EditImages'), + id: 'editimages' + }); + } + if (item.MediaType == 'Video' && item.Type != 'TvChannel' && item.Type != 'Program' && item.LocationType != 'Virtual') { + commands.push({ + name: globalize.translate('sharedcomponents#EditSubtitles'), + id: 'editsubtitles' + }); + } } } @@ -48,6 +66,15 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', }); } + if (!isTheater && options.identify !== false) { + if (itemHelper.canIdentify(user, item.Type)) { + commands.push({ + name: globalize.translate('sharedcomponents#Identify'), + id: 'identify' + }); + } + } + if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist" || item.Type == "MusicGenre" || item.CollectionType == "music") { if (options.instantMix !== false) { commands.push({ @@ -118,6 +145,15 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', } } + if (!isTheater && options.sync !== false) { + if (itemHelper.canSync(user, item)) { + commands.push({ + name: globalize.translate('sharedcomponents#Sync'), + id: 'sync' + }); + } + } + if (options.openAlbum !== false && item.AlbumId) { commands.push({ name: Globalize.translate('sharedcomponents#ViewAlbum'), @@ -209,6 +245,30 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', }); break; } + case 'edit': + { + require(['components/metadataeditor/metadataeditor'], function (metadataeditor) { + + metadataeditor.show(itemId).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id)); + }); + break; + } + case 'editimages': + { + require(['components/imageeditor/imageeditor'], function (ImageEditor) { + + ImageEditor.show(itemId).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id)); + }); + break; + } + case 'identify': + { + require(['components/itemidentifier/itemidentifier'], function (itemidentifier) { + + itemidentifier.show(itemId).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id)); + }); + break; + } case 'refresh': { refresh(apiClient, itemId); @@ -295,6 +355,19 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', getResolveFunction(resolve, id)(); break; } + case 'sync': + { + require(['syncDialog'], function (syncDialog) { + syncDialog.showMenu({ + items: [ + { + Id: itemId + }] + }); + }); + getResolveFunction(resolve, id)(); + break; + } default: reject(); break; diff --git a/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js b/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js index 1056f685f2..cfdef76a13 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js +++ b/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js @@ -67,6 +67,50 @@ define([], function () { return { getDisplayName: getDisplayName, supportsAddingToCollection: supportsAddingToCollection, - supportsAddingToPlaylist: supportsAddingToPlaylist + supportsAddingToPlaylist: supportsAddingToPlaylist, + + canIdentify: function (user, itemType) { + + if (itemType == "Movie" || + itemType == "Trailer" || + itemType == "Series" || + itemType == "Game" || + itemType == "BoxSet" || + itemType == "Person" || + itemType == "Book" || + itemType == "MusicAlbum" || + itemType == "MusicArtist") { + + if (user.Policy.IsAdministrator) { + + return true; + } + } + + return false; + }, + + canEdit: function (user, itemType) { + + if (itemType == "UserRootFolder" || /*itemType == "CollectionFolder" ||*/ itemType == "UserView" || itemType == 'Timer') { + return false; + } + + if (user.Policy.IsAdministrator) { + + return true; + } + + return false; + }, + + canSync: function (user, item) { + + if (user && !user.Policy.EnableSync) { + return false; + } + + return item.SupportsSync; + } }; }); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/da.json b/dashboard-ui/bower_components/emby-webcomponents/strings/da.json index 383ecd8138..c536180e89 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/da.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/da.json @@ -1,10 +1,4 @@ { - "Play": "Play", - "Queue": "Queue", - "Shuffle": "Shuffle", - "InstantMix": "Instant Mix", - "QueueAllFromHere": "Queue All from Here", - "PlayAllFromHere": "Play All from Here", "ValueSpecialEpisodeName": "Special - {0}", "Share": "Del", "ServerUpdateNeeded": "Denne Emby server b\u00f8r opdateres. For at downloade den nyeste version bes\u00f8g venligst {0}", @@ -106,6 +100,15 @@ "Played": "Played", "RefreshDialogHelp": "Metadata is refreshed based on settings and internet services that are enabled in the Emby Server dashboard.", "Open": "Open", + "Play": "Play", + "Queue": "Queue", + "Shuffle": "Shuffle", + "Identify": "Identify", + "EditImages": "Edit Images", + "Sync": "Sync", + "InstantMix": "Instant Mix", "ViewAlbum": "View Album", - "ViewArtist": "View Artist" + "ViewArtist": "View Artist", + "QueueAllFromHere": "Queue All from Here", + "PlayAllFromHere": "Play All from Here" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/de.json b/dashboard-ui/bower_components/emby-webcomponents/strings/de.json index 214068407c..c2601c7826 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/de.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/de.json @@ -1,10 +1,4 @@ { - "Play": "Play", - "Queue": "Queue", - "Shuffle": "Shuffle", - "InstantMix": "Instant Mix", - "QueueAllFromHere": "Queue All from Here", - "PlayAllFromHere": "Play All from Here", "ValueSpecialEpisodeName": "Special - {0}", "Share": "Teilen", "ServerUpdateNeeded": "Dieser Emby Server sollte aktualisiert werden. Um die neueste Version zu laden, besuche bitte {0}", @@ -106,6 +100,15 @@ "Played": "Played", "RefreshDialogHelp": "Metadata is refreshed based on settings and internet services that are enabled in the Emby Server dashboard.", "Open": "Open", + "Play": "Play", + "Queue": "Queue", + "Shuffle": "Shuffle", + "Identify": "Identify", + "EditImages": "Edit Images", + "Sync": "Sync", + "InstantMix": "Instant Mix", "ViewAlbum": "View Album", - "ViewArtist": "View Artist" + "ViewArtist": "View Artist", + "QueueAllFromHere": "Queue All from Here", + "PlayAllFromHere": "Play All from Here" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json b/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json index 41eaaf4f9b..d5924228cc 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json @@ -103,6 +103,9 @@ "Play": "Play", "Queue": "Queue", "Shuffle": "Shuffle", + "Identify": "Identify", + "EditImages": "Edit Images", + "Sync": "Sync", "InstantMix": "Instant Mix", "ViewAlbum": "View Album", "ViewArtist": "View Artist", diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/es-MX.json b/dashboard-ui/bower_components/emby-webcomponents/strings/es-MX.json index c59a057cfc..c89a812496 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/es-MX.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/es-MX.json @@ -1,10 +1,4 @@ { - "Play": "Play", - "Queue": "Queue", - "Shuffle": "Shuffle", - "InstantMix": "Instant Mix", - "QueueAllFromHere": "Queue All from Here", - "PlayAllFromHere": "Play All from Here", "ValueSpecialEpisodeName": "Especial - {0}", "Share": "Compartir", "ServerUpdateNeeded": "Este Servidor Emby necesita ser actualizado. Para descargar la ultima versi\u00f3n, por favor visite {0}", @@ -106,6 +100,15 @@ "Played": "Played", "RefreshDialogHelp": "Los metadatos son actualizados bas\u00e1ndose en las configuraciones y servicios de internet que que est\u00e9n activados en el panel de control de su Servidor de Emby.", "Open": "Open", + "Play": "Play", + "Queue": "Queue", + "Shuffle": "Shuffle", + "Identify": "Identify", + "EditImages": "Edit Images", + "Sync": "Sync", + "InstantMix": "Instant Mix", "ViewAlbum": "View Album", - "ViewArtist": "View Artist" + "ViewArtist": "View Artist", + "QueueAllFromHere": "Queue All from Here", + "PlayAllFromHere": "Play All from Here" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/kk.json b/dashboard-ui/bower_components/emby-webcomponents/strings/kk.json index 3d98aa3884..da34f0b3de 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/kk.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/kk.json @@ -1,10 +1,4 @@ { - "Play": "Play", - "Queue": "Queue", - "Shuffle": "Shuffle", - "InstantMix": "Instant Mix", - "QueueAllFromHere": "Queue All from Here", - "PlayAllFromHere": "Play All from Here", "ValueSpecialEpisodeName": "\u0410\u0440\u043d\u0430\u0439\u044b - {0}", "Share": "\u041e\u0440\u0442\u0430\u049b\u0442\u0430\u0441\u0443", "ServerUpdateNeeded": "\u041e\u0441\u044b Emby Server \u0436\u0430\u04a3\u0430\u0440\u0442\u044b\u043b\u0443\u044b \u049b\u0430\u0436\u0435\u0442. \u0421\u043e\u04a3\u0493\u044b \u043d\u04b1\u0441\u049b\u0430\u0441\u044b\u043d \u0436\u04af\u043a\u0442\u0435\u043f \u0430\u043b\u0443 \u04af\u0448\u0456\u043d, {0} \u043a\u0456\u0440\u0456\u04a3\u0456\u0437", @@ -106,6 +100,15 @@ "Played": "Played", "RefreshDialogHelp": "\u041c\u0435\u0442\u0430\u0434\u0435\u0440\u0435\u043a\u0442\u0435\u0440 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043b\u0435\u0440 \u043c\u0435\u043d Emby Server \u0431\u0430\u049b\u044b\u043b\u0430\u0443 \u0442\u0430\u049b\u0442\u0430\u0441\u044b\u043d\u0434\u0430 \u049b\u043e\u0441\u044b\u043b\u0493\u0430\u043d \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u049b\u044b\u0437\u043c\u0435\u0442\u0442\u0435\u0440\u0456 \u043d\u0435\u0433\u0456\u0437\u0456\u043d\u0434\u0435 \u0436\u0430\u04a3\u0493\u044b\u0440\u0442\u044b\u043b\u0430\u0434\u044b.", "Open": "Open", + "Play": "Play", + "Queue": "Queue", + "Shuffle": "Shuffle", + "Identify": "Identify", + "EditImages": "Edit Images", + "Sync": "Sync", + "InstantMix": "Instant Mix", "ViewAlbum": "View Album", - "ViewArtist": "View Artist" + "ViewArtist": "View Artist", + "QueueAllFromHere": "Queue All from Here", + "PlayAllFromHere": "Play All from Here" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/nb.json b/dashboard-ui/bower_components/emby-webcomponents/strings/nb.json index fe44f0ac8c..4f250fabd7 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/nb.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/nb.json @@ -1,10 +1,4 @@ { - "Play": "Play", - "Queue": "Queue", - "Shuffle": "Shuffle", - "InstantMix": "Instant Mix", - "QueueAllFromHere": "Queue All from Here", - "PlayAllFromHere": "Play All from Here", "ValueSpecialEpisodeName": "Spesial - {0}", "Share": "Del", "ServerUpdateNeeded": "Denne Emby serveren trenger en oppdatering. For \u00e5 laste ned nyeste versjon, vennligst bes\u00f8k: {0}", @@ -106,6 +100,15 @@ "Played": "Played", "RefreshDialogHelp": "Metadata is refreshed based on settings and internet services that are enabled in the Emby Server dashboard.", "Open": "Open", + "Play": "Play", + "Queue": "Queue", + "Shuffle": "Shuffle", + "Identify": "Identify", + "EditImages": "Edit Images", + "Sync": "Sync", + "InstantMix": "Instant Mix", "ViewAlbum": "View Album", - "ViewArtist": "View Artist" + "ViewArtist": "View Artist", + "QueueAllFromHere": "Queue All from Here", + "PlayAllFromHere": "Play All from Here" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/nl.json b/dashboard-ui/bower_components/emby-webcomponents/strings/nl.json index 17a675d76d..2724e702d8 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/nl.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/nl.json @@ -1,10 +1,4 @@ { - "Play": "Play", - "Queue": "Queue", - "Shuffle": "Shuffle", - "InstantMix": "Instant Mix", - "QueueAllFromHere": "Queue All from Here", - "PlayAllFromHere": "Play All from Here", "ValueSpecialEpisodeName": "Speciaal - {0}", "Share": "Delen", "ServerUpdateNeeded": "Deze Emby Server moet worden bijgewerkt. Om de laatste versie te downloaden, gaat u naar {0}", @@ -106,6 +100,15 @@ "Played": "Played", "RefreshDialogHelp": "Metadata wordt vernieuwd op basis van de instellingen en internet diensten die zijn ingeschakeld in het dashboard van de Emby Server.", "Open": "Open", + "Play": "Play", + "Queue": "Queue", + "Shuffle": "Shuffle", + "Identify": "Identify", + "EditImages": "Edit Images", + "Sync": "Sync", + "InstantMix": "Instant Mix", "ViewAlbum": "View Album", - "ViewArtist": "View Artist" + "ViewArtist": "View Artist", + "QueueAllFromHere": "Queue All from Here", + "PlayAllFromHere": "Play All from Here" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/pt-BR.json b/dashboard-ui/bower_components/emby-webcomponents/strings/pt-BR.json index fc1dcffc13..e658df31cc 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/pt-BR.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/pt-BR.json @@ -1,10 +1,4 @@ { - "Play": "Play", - "Queue": "Queue", - "Shuffle": "Shuffle", - "InstantMix": "Instant Mix", - "QueueAllFromHere": "Queue All from Here", - "PlayAllFromHere": "Play All from Here", "ValueSpecialEpisodeName": "Especial - {0}", "Share": "Compartilhar", "ServerUpdateNeeded": "Este servidor Emby precisa ser atualizado. Para baixar a \u00faltima vers\u00e3o, por favor visite {0}", @@ -106,6 +100,15 @@ "Played": "Played", "RefreshDialogHelp": "Os metadados s\u00e3o atualizados com bases nas defini\u00e7\u00f5es e nos servi\u00e7os de internet que est\u00e3o ativos no painel do Servidor Emby.", "Open": "Open", + "Play": "Play", + "Queue": "Queue", + "Shuffle": "Shuffle", + "Identify": "Identify", + "EditImages": "Edit Images", + "Sync": "Sync", + "InstantMix": "Instant Mix", "ViewAlbum": "View Album", - "ViewArtist": "View Artist" + "ViewArtist": "View Artist", + "QueueAllFromHere": "Queue All from Here", + "PlayAllFromHere": "Play All from Here" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/pt-PT.json b/dashboard-ui/bower_components/emby-webcomponents/strings/pt-PT.json index a5a3003144..96464ac699 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/pt-PT.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/pt-PT.json @@ -1,10 +1,4 @@ { - "Play": "Play", - "Queue": "Queue", - "Shuffle": "Shuffle", - "InstantMix": "Instant Mix", - "QueueAllFromHere": "Queue All from Here", - "PlayAllFromHere": "Play All from Here", "ValueSpecialEpisodeName": "Especial - {0}", "Share": "Partilhar", "ServerUpdateNeeded": "Este Servidor Emby precisa ser atualizado. Para fazer download da vers\u00e3o mais recente, por favor visite {0}", @@ -106,6 +100,15 @@ "Played": "Played", "RefreshDialogHelp": "Metadata is refreshed based on settings and internet services that are enabled in the Emby Server dashboard.", "Open": "Open", + "Play": "Play", + "Queue": "Queue", + "Shuffle": "Shuffle", + "Identify": "Identify", + "EditImages": "Edit Images", + "Sync": "Sync", + "InstantMix": "Instant Mix", "ViewAlbum": "View Album", - "ViewArtist": "View Artist" + "ViewArtist": "View Artist", + "QueueAllFromHere": "Queue All from Here", + "PlayAllFromHere": "Play All from Here" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/ru.json b/dashboard-ui/bower_components/emby-webcomponents/strings/ru.json index 164e5fdc77..4c9e62a2c7 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/ru.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/ru.json @@ -1,10 +1,4 @@ { - "Play": "Play", - "Queue": "Queue", - "Shuffle": "Shuffle", - "InstantMix": "Instant Mix", - "QueueAllFromHere": "Queue All from Here", - "PlayAllFromHere": "Play All from Here", "ValueSpecialEpisodeName": "\u0421\u043f\u0435\u0446\u044d\u043f\u0438\u0437\u043e\u0434 - {0}", "Share": "\u041f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f", "ServerUpdateNeeded": "\u0414\u0430\u043d\u043d\u044b\u0439 Emby Server \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c. \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435 {0}", @@ -106,6 +100,15 @@ "Played": "Played", "RefreshDialogHelp": "\u041f\u043e\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 \u0438\u043d\u0444\u043e\u043f\u0430\u043d\u0435\u043b\u0438 Emby Server \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0443\u0441\u043b\u0443\u0433\u0430\u043c\u0438.", "Open": "Open", + "Play": "Play", + "Queue": "Queue", + "Shuffle": "Shuffle", + "Identify": "Identify", + "EditImages": "Edit Images", + "Sync": "Sync", + "InstantMix": "Instant Mix", "ViewAlbum": "View Album", - "ViewArtist": "View Artist" + "ViewArtist": "View Artist", + "QueueAllFromHere": "Queue All from Here", + "PlayAllFromHere": "Play All from Here" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/sv.json b/dashboard-ui/bower_components/emby-webcomponents/strings/sv.json index 26b93aa5a4..8242707c4c 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/sv.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/sv.json @@ -1,10 +1,4 @@ { - "Play": "Play", - "Queue": "Queue", - "Shuffle": "Shuffle", - "InstantMix": "Instant Mix", - "QueueAllFromHere": "Queue All from Here", - "PlayAllFromHere": "Play All from Here", "ValueSpecialEpisodeName": "Specialavsnitt - {0}", "Share": "Dela", "ServerUpdateNeeded": "Den h\u00e4r Emby servern beh\u00f6ver uppdateras. F\u00f6r att ladda ner senaste versionen, g\u00e5 till {0}", @@ -106,6 +100,15 @@ "Played": "Played", "RefreshDialogHelp": "Metadata uppdateras baserat p\u00e5 inst\u00e4llningar och internettj\u00e4nster som har aktiverats under Emby servers kontrollpanel.", "Open": "Open", + "Play": "Play", + "Queue": "Queue", + "Shuffle": "Shuffle", + "Identify": "Identify", + "EditImages": "Edit Images", + "Sync": "Sync", + "InstantMix": "Instant Mix", "ViewAlbum": "View Album", - "ViewArtist": "View Artist" + "ViewArtist": "View Artist", + "QueueAllFromHere": "Queue All from Here", + "PlayAllFromHere": "Play All from Here" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/zh-TW.json b/dashboard-ui/bower_components/emby-webcomponents/strings/zh-TW.json index fa77810ea3..2b90b06e19 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/zh-TW.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/zh-TW.json @@ -1,10 +1,4 @@ { - "Play": "Play", - "Queue": "Queue", - "Shuffle": "Shuffle", - "InstantMix": "Instant Mix", - "QueueAllFromHere": "Queue All from Here", - "PlayAllFromHere": "Play All from Here", "ValueSpecialEpisodeName": "Special - {0}", "Share": "\u5206\u4eab", "ServerUpdateNeeded": "\u6b64Emby\u4f3a\u670d\u5668\u9700\u8981\u66f4\u65b0\uff0c\u8acb\u81f3{0}\u53d6\u5f97\u6700\u65b0\u7248\u672c", @@ -106,6 +100,15 @@ "Played": "Played", "RefreshDialogHelp": "\u8a73\u7d30\u8cc7\u6599\u7684\u66f4\u65b0\u65b9\u5f0f\u6703\u4f9d\u64daEmby\u7684\u8a2d\u5b9a\u53ca\u5df2\u7d93\u555f\u7528\u7684\u7db2\u8def\u670d\u52d9\u4f86\u9032\u884c", "Open": "Open", + "Play": "Play", + "Queue": "Queue", + "Shuffle": "Shuffle", + "Identify": "Identify", + "EditImages": "Edit Images", + "Sync": "Sync", + "InstantMix": "Instant Mix", "ViewAlbum": "View Album", - "ViewArtist": "View Artist" + "ViewArtist": "View Artist", + "QueueAllFromHere": "Queue All from Here", + "PlayAllFromHere": "Play All from Here" } \ No newline at end of file diff --git a/dashboard-ui/components/metadataeditor/metadataeditor.js b/dashboard-ui/components/metadataeditor/metadataeditor.js index 8481043d6e..846e24f192 100644 --- a/dashboard-ui/components/metadataeditor/metadataeditor.js +++ b/dashboard-ui/components/metadataeditor/metadataeditor.js @@ -1,4 +1,4 @@ -define(['dialogHelper', 'datetime', 'jQuery', 'emby-checkbox', 'emby-input', 'emby-select', 'listViewStyle', 'emby-textarea', 'emby-button', 'paper-icon-button-light'], function (dialogHelper, datetime, $) { +define(['itemHelper', 'dialogHelper', 'datetime', 'jQuery', 'emby-checkbox', 'emby-input', 'emby-select', 'listViewStyle', 'emby-textarea', 'emby-button', 'paper-icon-button-light'], function (itemHelper, dialogHelper, datetime, $) { var currentContext; var metadataEditorInfo; @@ -286,7 +286,7 @@ id: 'images' }); - if (LibraryBrowser.canIdentify(user, currentItem.Type)) { + if (itemHelper.canIdentify(user, currentItem.Type)) { items.push({ name: Globalize.translate('ButtonIdentify'), id: 'identify' diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index 66813a4423..8fbe7fa9a4 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -1,4 +1,4 @@ -define(['layoutManager', 'datetime', 'mediaInfo', 'backdrop', 'listView', 'scrollStyles'], function (layoutManager, datetime, mediaInfo, backdrop, listView) { +define(['layoutManager', 'datetime', 'mediaInfo', 'backdrop', 'listView', 'itemContextMenu', 'itemHelper', 'scrollStyles'], function (layoutManager, datetime, mediaInfo, backdrop, listView, itemContextMenu, itemHelper) { var currentItem; @@ -61,6 +61,19 @@ } } + function getContextMenuOptions(item, button) { + + return { + item: item, + open: false, + play: false, + queue: false, + playAllFromHere: false, + queueAllFromHere: false, + positionTo: button + }; + } + function reloadFromItem(page, params, item) { currentItem = item; @@ -128,7 +141,7 @@ hideAll(page, 'btnPlayTrailer'); } - if (LibraryBrowser.enableSync(item, user)) { + if (itemHelper.canSync(user, item)) { hideAll(page, 'btnSync', true); } else { hideAll(page, 'btnSync'); @@ -178,11 +191,13 @@ page.querySelector('.splitVersionContainer').classList.add('hide'); } - if (LibraryBrowser.getMoreCommands(item, user).length > 0) { - hideAll(page, 'btnMoreCommands', true); - } else { - hideAll(page, 'btnMoreCommands'); - } + itemContextMenu.getCommands(getContextMenuOptions(item)).then(function (commands) { + if (commands.length) { + hideAll(page, 'btnMoreCommands', true); + } else { + hideAll(page, 'btnMoreCommands'); + } + }); if (user.Policy.IsAdministrator) { page.querySelector('.chapterSettingsButton').classList.remove('hide'); @@ -2105,11 +2120,14 @@ function onMoreCommandsClick() { var button = this; - Dashboard.getCurrentUser().then(function (user) { + itemContextMenu.show(getContextMenuOptions(currentItem, button)).then(function (result) { - LibraryBrowser.showMoreCommands(button, currentItem.Id, currentItem.Type, LibraryBrowser.getMoreCommands(currentItem, user)).then(function () { + if (result.deleted) { + Emby.Page.goHome(); + + } else if (result.updated) { reload(view, params); - }); + } }); } @@ -2192,11 +2210,6 @@ } }); - //var btnMore = page.querySelectorAll('.btnMoreCommands iron-icon'); - //for (var i = 0, length = btnMore.length; i < length; i++) { - // btnMore[i].icon = AppInfo.moreIcon; - //} - function onWebSocketMessage(e, data) { var msg = data; diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 14a4f46ad7..8866692c55 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -685,15 +685,6 @@ }); }, - supportsEditing: function (itemType) { - - if (itemType == "UserRootFolder" || /*itemType == "CollectionFolder" ||*/ itemType == "UserView" || itemType == 'Timer') { - return false; - } - - return true; - }, - getMoreCommands: function (item, user) { var commands = []; @@ -715,7 +706,7 @@ if (user.Policy.IsAdministrator) { - if (LibraryBrowser.supportsEditing(item.Type)) { + if (itemHelper.canEdit(user, item.Type)) { commands.push('edit'); } @@ -733,7 +724,7 @@ commands.push('refresh'); } - if (LibraryBrowser.enableSync(item, user)) { + if (itemHelper.canSync(user, item)) { commands.push('sync'); } @@ -747,34 +738,13 @@ commands.push('share'); } - if (LibraryBrowser.canIdentify(user, item.Type)) { + if (itemHelper.canIdentify(user, item.Type)) { commands.push('identify'); } return commands; }, - canIdentify: function (user, itemType) { - - if (itemType == "Movie" || - itemType == "Trailer" || - itemType == "Series" || - itemType == "Game" || - itemType == "BoxSet" || - itemType == "Person" || - itemType == "Book" || - itemType == "MusicAlbum" || - itemType == "MusicArtist") { - - if (user.Policy.IsAdministrator) { - - return true; - } - } - - return false; - }, - deleteItems: function (itemIds) { return new Promise(function (resolve, reject) { @@ -1301,18 +1271,6 @@ return html; }, - enableSync: function (item, user) { - if (AppInfo.isNativeApp && !Dashboard.capabilities().SupportsSync) { - return false; - } - - if (user && !user.Policy.EnableSync) { - return false; - } - - return item.SupportsSync; - }, - getItemCommands: function (item, options) { var itemCommands = []; @@ -1321,9 +1279,7 @@ // itemCommands.push('playmenu'); //} - if (LibraryBrowser.supportsEditing(item.Type)) { - itemCommands.push('edit'); - } + itemCommands.push('edit'); if (item.LocalTrailerCount) { itemCommands.push('trailer'); @@ -1365,7 +1321,7 @@ itemCommands.push('delete'); } - if (LibraryBrowser.enableSync(item)) { + if (itemHelper.canSync({ Policy: {} }, item)) { itemCommands.push('sync'); } diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js index d3de88374e..4b16f67c19 100644 --- a/dashboard-ui/scripts/librarylist.js +++ b/dashboard-ui/scripts/librarylist.js @@ -1478,7 +1478,7 @@ var categorySyncButtons = page.querySelectorAll('.categorySyncButton'); for (var i = 0, length = categorySyncButtons.length; i < length; i++) { - if (LibraryBrowser.enableSync(item, user)) { + if (itemHelper.canSync(user, item)) { categorySyncButtons[i].classList.remove('hide'); } else { categorySyncButtons[i].classList.add('hide');