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

Add icon on item context menu

This commit is contained in:
grafixeyehero 2019-10-12 21:32:05 +03:00
parent 3b7facd073
commit 6bf18d80e0

View file

@ -13,14 +13,16 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if (options.play !== false) { if (options.play !== false) {
commands.push({ commands.push({
name: globalize.translate('Play'), name: globalize.translate('Play'),
id: 'resume' id: 'resume',
icon: "play_arrow"
}); });
} }
if (options.playAllFromHere && item.Type !== 'Program' && item.Type !== 'TvChannel') { if (options.playAllFromHere && item.Type !== 'Program' && item.Type !== 'TvChannel') {
commands.push({ commands.push({
name: globalize.translate('PlayAllFromHere'), name: globalize.translate('PlayAllFromHere'),
id: 'playallfromhere' id: 'playallfromhere',
icon: "play_arrow"
}); });
} }
} }
@ -29,14 +31,16 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if (options.queue !== false) { if (options.queue !== false) {
commands.push({ commands.push({
name: globalize.translate('AddToPlayQueue'), name: globalize.translate('AddToPlayQueue'),
id: 'queue' id: 'queue',
icon: "playlist_add"
}); });
} }
if (options.queue !== false) { if (options.queue !== false) {
commands.push({ commands.push({
name: globalize.translate('PlayNext'), name: globalize.translate('PlayNext'),
id: 'queuenext' id: 'queuenext',
icon: "playlist_add"
}); });
} }
@ -55,7 +59,8 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if (options.shuffle !== false) { if (options.shuffle !== false) {
commands.push({ commands.push({
name: globalize.translate('Shuffle'), name: globalize.translate('Shuffle'),
id: 'shuffle' id: 'shuffle',
icon: "shuffle"
}); });
} }
} }
@ -65,7 +70,8 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if (options.instantMix !== false && !itemHelper.isLocalItem(item)) { if (options.instantMix !== false && !itemHelper.isLocalItem(item)) {
commands.push({ commands.push({
name: globalize.translate('InstantMix'), name: globalize.translate('InstantMix'),
id: 'instantmix' id: 'instantmix',
icon: "shuffle"
}); });
} }
} }
@ -80,14 +86,16 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if (itemHelper.supportsAddingToCollection(item)) { if (itemHelper.supportsAddingToCollection(item)) {
commands.push({ commands.push({
name: globalize.translate('AddToCollection'), name: globalize.translate('AddToCollection'),
id: 'addtocollection' id: 'addtocollection',
icon: "playlist_add"
}); });
} }
if (itemHelper.supportsAddingToPlaylist(item)) { if (itemHelper.supportsAddingToPlaylist(item)) {
commands.push({ commands.push({
name: globalize.translate('AddToPlaylist'), name: globalize.translate('AddToPlaylist'),
id: 'addtoplaylist' id: 'addtoplaylist',
icon: "playlist_add"
}); });
} }
} }
@ -95,21 +103,24 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if ((item.Type === 'Timer') && user.Policy.EnableLiveTvManagement && options.cancelTimer !== false) { if ((item.Type === 'Timer') && user.Policy.EnableLiveTvManagement && options.cancelTimer !== false) {
commands.push({ commands.push({
name: globalize.translate('CancelRecording'), name: globalize.translate('CancelRecording'),
id: 'canceltimer' id: 'canceltimer',
icon: "cancel"
}); });
} }
if ((item.Type === 'Recording' && item.Status === 'InProgress') && user.Policy.EnableLiveTvManagement && options.cancelTimer !== false) { if ((item.Type === 'Recording' && item.Status === 'InProgress') && user.Policy.EnableLiveTvManagement && options.cancelTimer !== false) {
commands.push({ commands.push({
name: globalize.translate('CancelRecording'), name: globalize.translate('CancelRecording'),
id: 'canceltimer' id: 'canceltimer',
icon: "cancel"
}); });
} }
if ((item.Type === 'SeriesTimer') && user.Policy.EnableLiveTvManagement && options.cancelTimer !== false) { if ((item.Type === 'SeriesTimer') && user.Policy.EnableLiveTvManagement && options.cancelTimer !== false) {
commands.push({ commands.push({
name: globalize.translate('CancelSeries'), name: globalize.translate('CancelSeries'),
id: 'cancelseriestimer' id: 'cancelseriestimer',
icon: "cancel"
}); });
} }
@ -118,12 +129,14 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if (item.Type === 'Playlist' || item.Type === 'BoxSet') { if (item.Type === 'Playlist' || item.Type === 'BoxSet') {
commands.push({ commands.push({
name: globalize.translate('Delete'), name: globalize.translate('Delete'),
id: 'delete' id: 'delete',
icon: "delete"
}); });
} else { } else {
commands.push({ commands.push({
name: globalize.translate('DeleteMedia'), name: globalize.translate('DeleteMedia'),
id: 'delete' id: 'delete',
icon: "delete"
}); });
} }
} }
@ -132,12 +145,20 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if ((item.CanDownload && appHost.supports('filedownload')) && item.Type !== "Book") { if ((item.CanDownload && appHost.supports('filedownload')) && item.Type !== "Book") {
commands.push({ commands.push({
name: globalize.translate('Download'), name: globalize.translate('Download'),
id: 'download' id: 'download',
icon: "file_download"
}); });
commands.push({ commands.push({
name: globalize.translate('CopyStreamURL'), name: globalize.translate('CopyStreamURL'),
id: 'copy-stream' id: 'copy-stream',
icon: "content_copy"
});
}
if (commands.length) {
commands.push({
divider: true
}); });
} }
@ -147,7 +168,8 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
var text = (item.Type === 'Timer' || item.Type === 'SeriesTimer') ? globalize.translate('Edit') : globalize.translate('EditMetadata'); var text = (item.Type === 'Timer' || item.Type === 'SeriesTimer') ? globalize.translate('Edit') : globalize.translate('EditMetadata');
commands.push({ commands.push({
name: text, name: text,
id: 'edit' id: 'edit',
icon: "edit"
}); });
} }
} }
@ -156,7 +178,8 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if (options.editImages !== false) { if (options.editImages !== false) {
commands.push({ commands.push({
name: globalize.translate('EditImages'), name: globalize.translate('EditImages'),
id: 'editimages' id: 'editimages',
icon: "edit"
}); });
} }
} }
@ -166,7 +189,8 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if (options.editSubtitles !== false) { if (options.editSubtitles !== false) {
commands.push({ commands.push({
name: globalize.translate('EditSubtitles'), name: globalize.translate('EditSubtitles'),
id: 'editsubtitles' id: 'editsubtitles',
icon: "closed_caption"
}); });
} }
} }
@ -176,7 +200,8 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if (itemHelper.canIdentify(user, item)) { if (itemHelper.canIdentify(user, item)) {
commands.push({ commands.push({
name: globalize.translate('Identify'), name: globalize.translate('Identify'),
id: 'identify' id: 'identify',
icon: "edit"
}); });
} }
} }
@ -185,7 +210,8 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if (options.moremediainfo !== false) { if (options.moremediainfo !== false) {
commands.push({ commands.push({
name: globalize.translate('MoreMediaInfo'), name: globalize.translate('MoreMediaInfo'),
id: 'moremediainfo' id: 'moremediainfo',
icon: "info"
}); });
} }
} }
@ -194,7 +220,8 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if (item.TimerId) { if (item.TimerId) {
commands.push({ commands.push({
name: Globalize.translate('ManageRecording'), name: Globalize.translate('ManageRecording'),
id: 'record' id: 'record',
icon: "fiber_manual_record"
}); });
} }
} }
@ -203,7 +230,8 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if (!item.TimerId) { if (!item.TimerId) {
commands.push({ commands.push({
name: Globalize.translate('Record'), name: Globalize.translate('Record'),
id: 'record' id: 'record',
icon: "fiber_manual_record"
}); });
} }
} }
@ -211,21 +239,24 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if (itemHelper.canRefreshMetadata(item, user)) { if (itemHelper.canRefreshMetadata(item, user)) {
commands.push({ commands.push({
name: globalize.translate('RefreshMetadata'), name: globalize.translate('RefreshMetadata'),
id: 'refresh' id: 'refresh',
icon: "refresh"
}); });
} }
if (item.PlaylistItemId && options.playlistId) { if (item.PlaylistItemId && options.playlistId) {
commands.push({ commands.push({
name: globalize.translate('RemoveFromPlaylist'), name: globalize.translate('RemoveFromPlaylist'),
id: 'removefromplaylist' id: 'removefromplaylist',
icon: "remove"
}); });
} }
if (options.collectionId) { if (options.collectionId) {
commands.push({ commands.push({
name: globalize.translate('RemoveFromCollection'), name: globalize.translate('RemoveFromCollection'),
id: 'removefromcollection' id: 'removefromcollection',
icon: "remove"
}); });
} }
@ -234,7 +265,8 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if (itemHelper.canShare(item, user)) { if (itemHelper.canShare(item, user)) {
commands.push({ commands.push({
name: globalize.translate('Share'), name: globalize.translate('Share'),
id: 'share' id: 'share',
icon: "share"
}); });
} }
} }
@ -244,7 +276,8 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if (itemHelper.canSync(user, item)) { if (itemHelper.canSync(user, item)) {
commands.push({ commands.push({
name: globalize.translate('Sync'), name: globalize.translate('Sync'),
id: 'sync' id: 'sync',
icon: "sync"
}); });
} }
} }
@ -252,14 +285,16 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
if (options.openAlbum !== false && item.AlbumId && item.MediaType !== 'Photo') { if (options.openAlbum !== false && item.AlbumId && item.MediaType !== 'Photo') {
commands.push({ commands.push({
name: Globalize.translate('ViewAlbum'), name: Globalize.translate('ViewAlbum'),
id: 'album' id: 'album',
icon: "album"
}); });
} }
if (options.openArtist !== false && item.ArtistItems && item.ArtistItems.length) { if (options.openArtist !== false && item.ArtistItems && item.ArtistItems.length) {
commands.push({ commands.push({
name: Globalize.translate('ViewArtist'), name: Globalize.translate('ViewArtist'),
id: 'artist' id: 'artist',
icon: "person"
}); });
} }