update components
This commit is contained in:
parent
9254ff721d
commit
3197c48232
162 changed files with 902 additions and 9728 deletions
|
@ -1,6 +1,7 @@
|
|||
button.listItem {
|
||||
background: transparent;
|
||||
border: 0 !important;
|
||||
border-bottom: 1px solid #2a2a2a !important;
|
||||
cursor: pointer;
|
||||
outline: none !important;
|
||||
color: inherit;
|
||||
|
@ -16,6 +17,7 @@ button.listItem {
|
|||
text-align: left;
|
||||
padding: 0 1em !important;
|
||||
line-height: 170%;
|
||||
border-bottom: 1px solid #2a2a2a;
|
||||
}
|
||||
|
||||
.listItem.largeImage {
|
||||
|
@ -33,7 +35,7 @@ button.listItem {
|
|||
|
||||
.listItemBody {
|
||||
flex-grow: 1;
|
||||
padding: 0 1.15em;
|
||||
padding: 0 1em;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
flex-direction: column;
|
||||
|
@ -82,6 +84,7 @@ button.listItem {
|
|||
background-size: contain;
|
||||
flex-shrink: 0;
|
||||
margin-left: -.75em;
|
||||
background-position: center center;
|
||||
}
|
||||
|
||||
.listItemIcon {
|
||||
|
@ -133,10 +136,17 @@ button.listItem {
|
|||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.listItemMediaInfo {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.listItemMediaInfo > * {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@supports (display: flex) {
|
||||
|
||||
.listItem, .listItemBody {
|
||||
.listItem, .listItemBody, .listItemMediaInfo {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,116 @@
|
|||
define(['itemHelper', 'mediaInfo', 'indicators', 'css!./listview'], function (itemHelper, mediaInfo, indicators) {
|
||||
define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutManager', 'userdataButtons', 'css!./listview'], function (itemHelper, mediaInfo, indicators, connectionManager, layoutManager, userdataButtons) {
|
||||
|
||||
function getIndex(item, options) {
|
||||
|
||||
if (options.index == 'disc') {
|
||||
|
||||
return item.ParentIndexNumber == null ? '' : Globalize.translate('sharedcomponents#ValueDiscNumber', item.ParentIndexNumber);
|
||||
}
|
||||
|
||||
var sortBy = (options.sortBy || '').toLowerCase();
|
||||
var code, name;
|
||||
|
||||
if (sortBy.indexOf('sortname') == 0) {
|
||||
|
||||
if (item.Type == 'Episode') return '';
|
||||
|
||||
// SortName
|
||||
name = (item.SortName || item.Name || '?')[0].toUpperCase();
|
||||
|
||||
code = name.charCodeAt(0);
|
||||
if (code < 65 || code > 90) {
|
||||
return '#';
|
||||
}
|
||||
|
||||
return name.toUpperCase();
|
||||
}
|
||||
if (sortBy.indexOf('officialrating') == 0) {
|
||||
|
||||
return item.OfficialRating || globalize.translate('sharedcomponents#Unrated');
|
||||
}
|
||||
if (sortBy.indexOf('communityrating') == 0) {
|
||||
|
||||
if (item.CommunityRating == null) {
|
||||
return globalize.translate('sharedcomponents#Unrated');
|
||||
}
|
||||
|
||||
return Math.floor(item.CommunityRating);
|
||||
}
|
||||
if (sortBy.indexOf('criticrating') == 0) {
|
||||
|
||||
if (item.CriticRating == null) {
|
||||
return globalize.translate('sharedcomponents#Unrated');
|
||||
}
|
||||
|
||||
return Math.floor(item.CriticRating);
|
||||
}
|
||||
if (sortBy.indexOf('metascore') == 0) {
|
||||
|
||||
if (item.Metascore == null) {
|
||||
return globalize.translate('sharedcomponents#Unrated');
|
||||
}
|
||||
|
||||
return Math.floor(item.Metascore);
|
||||
}
|
||||
if (sortBy.indexOf('albumartist') == 0) {
|
||||
|
||||
// SortName
|
||||
if (!item.AlbumArtist) return '';
|
||||
|
||||
name = item.AlbumArtist[0].toUpperCase();
|
||||
|
||||
code = name.charCodeAt(0);
|
||||
if (code < 65 || code > 90) {
|
||||
return '#';
|
||||
}
|
||||
|
||||
return name.toUpperCase();
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function getImageUrl(item, width) {
|
||||
|
||||
var apiClient = connectionManager.getApiClient(item.ServerId);
|
||||
|
||||
var options = {
|
||||
width: width,
|
||||
type: "Primary"
|
||||
};
|
||||
|
||||
if (item.ImageTags && item.ImageTags['Primary']) {
|
||||
|
||||
options.tag = item.ImageTags['Primary'];
|
||||
return apiClient.getScaledImageUrl(item.Id, options);
|
||||
}
|
||||
|
||||
if (item.AlbumId && item.AlbumPrimaryImageTag) {
|
||||
|
||||
options.tag = item.AlbumPrimaryImageTag;
|
||||
return apiClient.getScaledImageUrl(item.AlbumId, options);
|
||||
}
|
||||
|
||||
else if (item.SeriesId && item.SeriesPrimaryImageTag) {
|
||||
|
||||
options.tag = item.SeriesPrimaryImageTag;
|
||||
return apiClient.getScaledImageUrl(item.SeriesId, options);
|
||||
|
||||
}
|
||||
else if (item.ParentPrimaryImageTag) {
|
||||
|
||||
options.tag = item.ParentPrimaryImageTag;
|
||||
return apiClient.getScaledImageUrl(item.ParentPrimaryImageItemId, options);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function getListViewHtml(items, options) {
|
||||
|
||||
var outerHtml = "";
|
||||
if (arguments.length == 1) {
|
||||
options = items;
|
||||
items = options.items;
|
||||
}
|
||||
|
||||
var index = 0;
|
||||
var groupTitle = '';
|
||||
|
@ -11,10 +119,36 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'css!./listview'], function (it
|
|||
var isLargeStyle = options.imageSize == 'large';
|
||||
var enableOverview = options.enableOverview;
|
||||
|
||||
outerHtml += items.map(function (item) {
|
||||
var clickEntireItem = layoutManager.tv ? true : false;
|
||||
var outerTagName = clickEntireItem ? 'button' : 'div';
|
||||
|
||||
return items.map(function (item) {
|
||||
|
||||
var html = '';
|
||||
|
||||
//if (options.showIndex !== false) {
|
||||
|
||||
// var itemGroupTitle = LibraryBrowser.getListViewIndex(item, options);
|
||||
|
||||
// if (itemGroupTitle != groupTitle) {
|
||||
|
||||
// outerHtml += '</div>';
|
||||
|
||||
// if (index == 0) {
|
||||
// html += '<h1>';
|
||||
// }
|
||||
// else {
|
||||
// html += '<h1 style="margin-top:2em;">';
|
||||
// }
|
||||
// html += itemGroupTitle;
|
||||
// html += '</h1>';
|
||||
|
||||
// html += '<div class="paperList itemsListview">';
|
||||
|
||||
// groupTitle = itemGroupTitle;
|
||||
// }
|
||||
//}
|
||||
|
||||
var cssClass = "itemAction listItem";
|
||||
|
||||
var downloadWidth = 80;
|
||||
|
@ -24,19 +158,9 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'css!./listview'], function (it
|
|||
downloadWidth = 500;
|
||||
}
|
||||
|
||||
html += '<button class="' + cssClass + '" data-index="' + index + '" data-action="' + action + '" data-isfolder="' + item.IsFolder + '" data-id="' + item.Id + '" data-serverid="' + item.ServerId + '" data-type="' + item.Type + '">';
|
||||
html += '<' + outerTagName + ' class="' + cssClass + '" data-index="' + index + '" data-action="' + action + '" data-isfolder="' + item.IsFolder + '" data-id="' + item.Id + '" data-serverid="' + item.ServerId + '" data-type="' + item.Type + '">';
|
||||
|
||||
var imgUrl = Emby.Models.imageUrl(item, {
|
||||
width: downloadWidth,
|
||||
type: "Primary"
|
||||
});
|
||||
|
||||
if (!imgUrl) {
|
||||
imgUrl = Emby.Models.thumbImageUrl(item, {
|
||||
width: downloadWidth,
|
||||
type: "Thumb"
|
||||
});
|
||||
}
|
||||
var imgUrl = getImageUrl(item, downloadWidth);
|
||||
|
||||
if (imgUrl) {
|
||||
html += '<div class="listItemImage lazy" data-src="' + imgUrl + '" item-icon>';
|
||||
|
@ -122,18 +246,23 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'css!./listview'], function (it
|
|||
|
||||
html += '</div>';
|
||||
|
||||
if (!clickEntireItem) {
|
||||
html += '<button is="paper-icon-button-light" class="listviewMenuButton autoSize"><i class="md-icon"></i></button>';
|
||||
html += '<span class="listViewUserDataButtons">';
|
||||
html += userdataButtons.getIconsHtml(item);
|
||||
html += '</span>';
|
||||
}
|
||||
|
||||
if (options.enableSideMediaInfo) {
|
||||
html += '<div class="secondary listItemMediaInfo">' + mediaInfo.getPrimaryMediaInfoHtml(item) + '</div>';
|
||||
}
|
||||
|
||||
html += '</button>';
|
||||
html += '</' + outerTagName + '>';
|
||||
|
||||
index++;
|
||||
return html;
|
||||
|
||||
}).join('');
|
||||
|
||||
return outerHtml;
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue