mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
consolidate all library icons into a single method
This commit is contained in:
parent
f3707153a0
commit
752212413c
5 changed files with 42 additions and 137 deletions
|
@ -1,5 +1,5 @@
|
|||
define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusManager', 'indicators', 'globalize', 'layoutManager', 'apphost', 'dom', 'browser', 'playbackManager', 'itemShortcuts', 'css!./card', 'paper-icon-button-light', 'programStyles'],
|
||||
function (datetime, imageLoader, connectionManager, itemHelper, focusManager, indicators, globalize, layoutManager, appHost, dom, browser, playbackManager, itemShortcuts) {
|
||||
define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusManager', 'indicators', 'globalize', 'layoutManager', 'apphost', 'dom', 'browser', 'playbackManager', 'itemShortcuts', 'scripts/imagehelper', 'css!./card', 'paper-icon-button-light', 'programStyles'],
|
||||
function (datetime, imageLoader, connectionManager, itemHelper, focusManager, indicators, globalize, layoutManager, appHost, dom, browser, playbackManager, itemShortcuts, imageHelper) {
|
||||
'use strict';
|
||||
|
||||
var devicePixelRatio = window.devicePixelRatio || 1;
|
||||
|
@ -1546,28 +1546,8 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
|
|||
}
|
||||
|
||||
function getCardDefaultText(item, options) {
|
||||
|
||||
var collectionType = item.CollectionType;
|
||||
if (collectionType === 'livetv') {
|
||||
return '<i class="cardImageIcon md-icon"></i>';
|
||||
}
|
||||
if (collectionType === 'movies') {
|
||||
return '<i class="cardImageIcon md-icon"></i>';
|
||||
}
|
||||
if (collectionType === 'tvshows') {
|
||||
return '<i class="cardImageIcon md-icon"></i>';
|
||||
}
|
||||
if (collectionType === 'homevideos' || collectionType === 'photos') {
|
||||
return '<i class="cardImageIcon md-icon"></i>';
|
||||
}
|
||||
if (collectionType === 'music') {
|
||||
return '<i class="cardImageIcon md-icon"></i>';
|
||||
}
|
||||
if (collectionType === 'musicvideos') {
|
||||
return '<i class="cardImageIcon md-icon"></i>';
|
||||
}
|
||||
if (collectionType === 'books') {
|
||||
return '<i class="cardImageIcon md-icon"></i>';
|
||||
if (item.CollectionType) {
|
||||
return '<i class="cardImageIcon md-icon">' + imageHelper.getLibraryIcon(item.CollectionType) + '</i>'
|
||||
}
|
||||
if (item.Type === 'MusicAlbum') {
|
||||
return '<i class="cardImageIcon md-icon"></i>';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'layoutManager', 'imageLoader', 'globalize', 'itemShortcuts', 'itemHelper', 'appRouter', 'paper-icon-button-light', 'emby-itemscontainer', 'emby-scroller', 'emby-button', 'css!./homesections'], function (connectionManager, cardBuilder, appSettings, dom, appHost, layoutManager, imageLoader, globalize, itemShortcuts, itemHelper, appRouter) {
|
||||
define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'layoutManager', 'imageLoader', 'globalize', 'itemShortcuts', 'itemHelper', 'appRouter', 'scripts/imagehelper','paper-icon-button-light', 'emby-itemscontainer', 'emby-scroller', 'emby-button', 'css!./homesections'], function (connectionManager, cardBuilder, appSettings, dom, appHost, layoutManager, imageLoader, globalize, itemShortcuts, itemHelper, appRouter, imageHelper) {
|
||||
'use strict';
|
||||
|
||||
function getDefaultSection(index) {
|
||||
|
@ -156,49 +156,10 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
|
|||
|
||||
html += '<div is="emby-itemscontainer" class="itemsContainer padded-left padded-right vertical-wrap focuscontainer-x" data-multiselect="false">';
|
||||
|
||||
// "My Library" backgrounds
|
||||
// library card background images
|
||||
for (var i = 0, length = items.length; i < length; i++) {
|
||||
var item = items[i];
|
||||
var icon;
|
||||
switch (item.CollectionType) {
|
||||
case "movies":
|
||||
icon = "video_library";
|
||||
break;
|
||||
case "music":
|
||||
icon = "library_music";
|
||||
break;
|
||||
case "photos":
|
||||
icon = "photo_library";
|
||||
break;
|
||||
case "livetv":
|
||||
icon = "live_tv";
|
||||
break;
|
||||
case "tvshows":
|
||||
icon = "tv";
|
||||
break;
|
||||
case "trailers":
|
||||
icon = "local_movies";
|
||||
break;
|
||||
case "homevideos":
|
||||
icon = "photo_library";
|
||||
break;
|
||||
case "musicvideos":
|
||||
icon = "music_video";
|
||||
break;
|
||||
case "books":
|
||||
icon = "library_books";
|
||||
break;
|
||||
case "channels":
|
||||
icon = "videocam";
|
||||
break;
|
||||
case "playlists":
|
||||
icon = "view_list";
|
||||
break;
|
||||
default:
|
||||
icon = "folder";
|
||||
break;
|
||||
}
|
||||
|
||||
var icon = imageHelper.getLibraryIcon(item.CollectionType);
|
||||
html += '<a is="emby-linkbutton" href="' + appRouter.getRouteUrl(item) + '" class="raised homeLibraryButton"><i class="md-icon homeLibraryIcon">' + icon + '</i><span class="homeLibraryText">' + item.Name + '</span></a>';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue