Further improvements to the details page

This commit is contained in:
MrTimscampi 2020-06-17 15:45:23 +02:00
parent 660e4a0a3c
commit e14f4315a8
10 changed files with 156 additions and 121 deletions

View File

@ -507,7 +507,23 @@
.parentName { .parentName {
display: block; display: block;
margin-bottom: 0.5em; margin: 0 0 0;
}
.layout-mobile .parentName {
margin: 0.6em 0 0;
}
.musicParentName {
margin: 0.15em 0 0.2em;
}
.layout-mobile .musicParentName {
margin: -0.25em 0 0.25em;
}
.layout-mobile .itemExternalLinks {
display: none;
} }
.mainDetailButtons { .mainDetailButtons {
@ -530,6 +546,35 @@
font-weight: 600; font-weight: 600;
} }
.itemName.originalTitle {
margin: 0.2em 0 0.2em;
}
.itemName.parentNameLast {
margin: 0 0 0;
}
.layout-mobile .itemName.parentNameLast {
margin: 0.4em 0 0.4em;
}
.layout-mobile h1.itemName,
.layout-mobile h1.parentName {
font-size: 1.6em;
}
.itemName.parentNameLast.withOriginalTitle {
margin: 0 0 0;
}
.layout-mobile .itemName.parentNameLast.withOriginalTitle {
margin: 0.6em 0 0;
}
.layout-mobile .itemName.originalTitle {
margin: 0.5em 0 0.5em;
}
.nameContainer { .nameContainer {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -557,10 +602,18 @@
} }
.layout-mobile .mainDetailButtons { .layout-mobile .mainDetailButtons {
margin-top: 2em; margin-top: 1em;
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
.subTitle {
margin: 0.15em 0 0.2em;
}
.layout-mobile .subTitle {
margin: 0.2em 0 0.2em;
}
.detailPagePrimaryContainer { .detailPagePrimaryContainer {
display: flex; display: flex;
align-items: center; align-items: center;
@ -571,7 +624,7 @@
.layout-mobile .detailPagePrimaryContainer { .layout-mobile .detailPagePrimaryContainer {
display: block; display: block;
position: relative; position: relative;
padding: 2.5em 3.3% 1em; padding: 0.5em 3.3% 0.5em;
} }
.layout-tv #itemDetailPage:not(.noBackdrop) .detailPagePrimaryContainer, .layout-tv #itemDetailPage:not(.noBackdrop) .detailPagePrimaryContainer,
@ -613,6 +666,10 @@
margin: 1.25em 0; margin: 1.25em 0;
} }
.layout-mobile .detailPageSecondaryContainer {
margin: 1em 0;
}
.detailImageContainer .card { .detailImageContainer .card {
position: absolute; position: absolute;
top: 50%; top: 50%;
@ -722,7 +779,7 @@ div.itemDetailGalleryLink.defaultCardBackground {
@media all and (max-width: 62.5em) { @media all and (max-width: 62.5em) {
.parentName { .parentName {
margin-bottom: 1em; margin-bottom: 0;
} }
.itemDetailPage { .itemDetailPage {
@ -983,6 +1040,10 @@ div.itemDetailGalleryLink.defaultCardBackground {
margin-bottom: 2.7em; margin-bottom: 2.7em;
} }
.layout-mobile .verticalSection-extrabottompadding {
margin-bottom: 1em;
}
.sectionTitleButton, .sectionTitleButton,
.sectionTitleIconButton { .sectionTitleIconButton {
margin-right: 0 !important; margin-right: 0 !important;
@ -1008,7 +1069,12 @@ div.itemDetailGalleryLink.defaultCardBackground {
div:not(.sectionTitleContainer-cards) > .sectionTitle-cards { div:not(.sectionTitleContainer-cards) > .sectionTitle-cards {
margin: 0; margin: 0;
padding-top: 1.25em; padding-top: 0.5em;
}
.layout-mobile :not(.sectionTitleContainer-cards) > .sectionTitle-cards {
margin: 0;
padding-top: 0.5em;
} }
.sectionTitleButton { .sectionTitleButton {

View File

@ -16,7 +16,7 @@ function getOffsets(elems) {
return results; return results;
} }
for (let elem of elems) { for (const elem of elems) {
let box = elem.getBoundingClientRect(); let box = elem.getBoundingClientRect();
results.push({ results.push({
@ -135,7 +135,7 @@ export function show(options) {
let renderIcon = false; let renderIcon = false;
let icons = []; let icons = [];
let itemIcon; let itemIcon;
for (let item of options.items) { for (const item of options.items) {
itemIcon = item.icon || (item.selected ? 'check' : null); itemIcon = item.icon || (item.selected ? 'check' : null);

View File

@ -22,7 +22,7 @@ define(['dom', 'appRouter', 'connectionManager'], function (dom, appRouter, conn
return void appRouter.showItem(items[0]); return void appRouter.showItem(items[0]);
} }
var url = 'itemdetails.html?id=' + itemId + '&serverId=' + serverId; var url = 'details?id=' + itemId + '&serverId=' + serverId;
Dashboard.navigate(url); Dashboard.navigate(url);
}); });
e.stopPropagation(); e.stopPropagation();

View File

@ -1,14 +1,12 @@
define(['apphost', 'globalize'], function (appHost, globalize) { define(['apphost', 'globalize'], function (appHost, globalize) {
'use strict'; 'use strict';
function getDisplayName(item, options) { function getDisplayName(item, options = {}) {
if (!item) { if (!item) {
throw new Error('null item passed into getDisplayName'); throw new Error('null item passed into getDisplayName');
} }
options = options || {};
if (item.Type === 'Timer') { if (item.Type === 'Timer') {
item = item.ProgramInfo || item; item = item.ProgramInfo || item;
} }

View File

@ -122,10 +122,10 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
var artistName; var artistName;
if (item.ArtistItems != null) { if (item.ArtistItems != null) {
artistName = item.ArtistItems[0].Name; artistName = item.ArtistItems[0].Name;
context.querySelector('.nowPlayingAlbum').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="itemdetails.html?id=' + item.AlbumId + `&amp;serverId=${nowPlayingServerId}">${albumName}</a>`; context.querySelector('.nowPlayingAlbum').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="details?id=' + item.AlbumId + `&amp;serverId=${nowPlayingServerId}">${albumName}</a>`;
context.querySelector('.nowPlayingArtist').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="itemdetails.html?id=' + item.ArtistItems[0].Id + `&amp;serverId=${nowPlayingServerId}">${artistName}</a>`; context.querySelector('.nowPlayingArtist').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="details?id=' + item.ArtistItems[0].Id + `&amp;serverId=${nowPlayingServerId}">${artistName}</a>`;
context.querySelector('.contextMenuAlbum').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="itemdetails.html?id=' + item.AlbumId + `&amp;serverId=${nowPlayingServerId}"><span class="actionsheetMenuItemIcon listItemIcon listItemIcon-transparent material-icons album"></span> ` + globalize.translate('ViewAlbum') + '</a>'; context.querySelector('.contextMenuAlbum').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="details?id=' + item.AlbumId + `&amp;serverId=${nowPlayingServerId}"><span class="actionsheetMenuItemIcon listItemIcon listItemIcon-transparent material-icons album"></span> ` + globalize.translate('ViewAlbum') + '</a>';
context.querySelector('.contextMenuArtist').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="itemdetails.html?id=' + item.ArtistItems[0].Id + `&amp;serverId=${nowPlayingServerId}"><span class="actionsheetMenuItemIcon listItemIcon listItemIcon-transparent material-icons person"></span> ` + globalize.translate('ViewArtist') + '</a>'; context.querySelector('.contextMenuArtist').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="details?id=' + item.ArtistItems[0].Id + `&amp;serverId=${nowPlayingServerId}"><span class="actionsheetMenuItemIcon listItemIcon listItemIcon-transparent material-icons person"></span> ` + globalize.translate('ViewArtist') + '</a>';
} else { } else {
artistName = item.Artists; artistName = item.Artists;
context.querySelector('.nowPlayingAlbum').innerHTML = albumName; context.querySelector('.nowPlayingAlbum').innerHTML = albumName;
@ -136,12 +136,12 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
} else if (item.Type == 'Episode') { } else if (item.Type == 'Episode') {
if (item.SeasonName != null) { if (item.SeasonName != null) {
var seasonName = item.SeasonName; var seasonName = item.SeasonName;
context.querySelector('.nowPlayingSeason').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="itemdetails.html?id=' + item.SeasonId + `&amp;serverId=${nowPlayingServerId}">${seasonName}</a>`; context.querySelector('.nowPlayingSeason').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="details?id=' + item.SeasonId + `&amp;serverId=${nowPlayingServerId}">${seasonName}</a>`;
} }
if (item.SeriesName != null) { if (item.SeriesName != null) {
var seriesName = item.SeriesName; var seriesName = item.SeriesName;
if (item.SeriesId != null) { if (item.SeriesId != null) {
context.querySelector('.nowPlayingSerie').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="itemdetails.html?id=' + item.SeriesId + `&amp;serverId=${nowPlayingServerId}">${seriesName}</a>`; context.querySelector('.nowPlayingSerie').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="details?id=' + item.SeriesId + `&amp;serverId=${nowPlayingServerId}">${seriesName}</a>`;
} else { } else {
context.querySelector('.nowPlayingSerie').innerHTML = seriesName; context.querySelector('.nowPlayingSerie').innerHTML = seriesName;
} }

View File

@ -1,8 +1,5 @@
<div id="itemDetailPage" data-role="page" class="page libraryPage itemDetailPage noSecondaryNavPage selfBackdropPage" data-backbutton="true"> <div id="itemDetailPage" data-role="page" class="page libraryPage itemDetailPage noSecondaryNavPage selfBackdropPage" data-backbutton="true">
<div id="itemBackdrop" class="itemBackdrop"> <div id="itemBackdrop" class="itemBackdrop">
<button is="emby-button" type="button" class="btnPlay detailFloatingButton hide fab autoSize" title="${ButtonPlay}" data-mode="resume">
<span class="material-icons play_arrow"></span>
</button>
</div> </div>
<div class="detailLogo"></div> <div class="detailLogo"></div>
@ -15,87 +12,75 @@
</div> </div>
<div class="mainDetailButtons"> <div class="mainDetailButtons">
<button is="emby-button" type="button" class="button-flat btnResume hide detailButton detailButtonHideonMobile" data-mode="resume"> <button is="emby-button" type="button" class="button-flat btnResume hide detailButton" data-mode="resume">
<div class="detailButton-content"> <div class="detailButton-content">
<span class="material-icons detailButton-icon play_arrow"></span> <span class="material-icons detailButton-icon play_arrow"></span>
<div class="detailButton-text">${ButtonResume}</div>
</div> </div>
</button> </button>
<button is="emby-button" type="button" class="button-flat btnPlay hide detailButton detailButtonHideonMobile" data-mode="play"> <button is="emby-button" type="button" class="button-flat btnPlay hide detailButton" data-mode="play">
<div class="detailButton-content"> <div class="detailButton-content">
<span class="material-icons detailButton-icon play_arrow"></span> <span class="material-icons detailButton-icon play_arrow"></span>
<div class="detailButton-text">${ButtonPlay}</div>
</div> </div>
</button> </button>
<button is="emby-button" type="button" class="button-flat btnDownload hide detailButton"> <button is="emby-button" type="button" class="button-flat btnDownload hide detailButton">
<div class="detailButton-content"> <div class="detailButton-content">
<span class="material-icons detailButton-icon get_app"></span> <span class="material-icons detailButton-icon get_app"></span>
<div class="detailButton-text">${ButtonDownload}</div>
</div> </div>
</button> </button>
<button is="emby-button" type="button" class="button-flat btnPlayTrailer hide detailButton"> <button is="emby-button" type="button" class="button-flat btnPlayTrailer hide detailButton">
<div class="detailButton-content"> <div class="detailButton-content">
<span class="material-icons detailButton-icon theaters"></span> <span class="material-icons detailButton-icon theaters"></span>
<div class="detailButton-text">${ButtonTrailer}</div>
</div> </div>
</button> </button>
<button is="emby-button" type="button" class="button-flat btnInstantMix hide detailButton"> <button is="emby-button" type="button" class="button-flat btnInstantMix hide detailButton">
<div class="detailButton-content"> <div class="detailButton-content">
<span class="material-icons detailButton-icon explore"></span> <span class="material-icons detailButton-icon explore"></span>
<div class="detailButton-text">${HeaderInstantMix}</div>
</div> </div>
</button> </button>
<button is="emby-button" type="button" class="button-flat btnShuffle hide detailButton"> <button is="emby-button" type="button" class="button-flat btnShuffle hide detailButton">
<div class="detailButton-content"> <div class="detailButton-content">
<span class="material-icons detailButton-icon shuffle"></span> <span class="material-icons detailButton-icon shuffle"></span>
<div class="detailButton-text">${ButtonShuffle}</div>
</div> </div>
</button> </button>
<button is="emby-button" type="button" class="button-flat btnCancelSeriesTimer hide detailButton"> <button is="emby-button" type="button" class="button-flat btnCancelSeriesTimer hide detailButton">
<div class="detailButton-content"> <div class="detailButton-content">
<span class="material-icons detailButton-icon delete"></span> <span class="material-icons detailButton-icon delete"></span>
<div class="detailButton-text">${CancelSeries}</div>
</div> </div>
</button> </button>
<button is="emby-button" type="button" class="button-flat btnCancelTimer hide detailButton"> <button is="emby-button" type="button" class="button-flat btnCancelTimer hide detailButton">
<div class="detailButton-content"> <div class="detailButton-content">
<span class="material-icons detailButton-icon stop"></span> <span class="material-icons detailButton-icon stop"></span>
<div class="detailButton-text">${StopRecording}</div>
</div> </div>
</button> </button>
<button is="emby-playstatebutton" type="button" class="button-flat btnPlaystate hide detailButton"> <button is="emby-playstatebutton" type="button" class="button-flat btnPlaystate hide detailButton">
<div class="detailButton-content"> <div class="detailButton-content">
<span class="material-icons detailButton-icon check"></span> <span class="material-icons detailButton-icon check"></span>
<div class="detailButton-text button-text"></div>
</div> </div>
</button> </button>
<button is="emby-ratingbutton" type="button" class="button-flat btnUserRating hide detailButton"> <button is="emby-ratingbutton" type="button" class="button-flat btnUserRating hide detailButton">
<div class="detailButton-content"> <div class="detailButton-content">
<span class="material-icons detailButton-icon favorite"></span> <span class="material-icons detailButton-icon favorite"></span>
<div class="detailButton-text button-text">${Rate}</div>
</div> </div>
</button> </button>
<button is="emby-button" type="button" class="button-flat btnSplitVersions hide detailButton"> <button is="emby-button" type="button" class="button-flat btnSplitVersions hide detailButton">
<div class="detailButton-content"> <div class="detailButton-content">
<span class="material-icons detailButton-icon call_split"></span> <span class="material-icons detailButton-icon call_split"></span>
<div class="detailButton-text">${ButtonSplit}</div>
</div> </div>
</button> </button>
<button is="emby-button" type="button" class="button-flat btnMoreCommands hide detailButton"> <button is="emby-button" type="button" class="button-flat btnMoreCommands hide detailButton">
<div class="detailButton-content"> <div class="detailButton-content">
<span class="material-icons detailButton-icon more_vert"></span> <span class="material-icons detailButton-icon more_vert"></span>
<div class="detailButton-text">${ButtonMore}</div>
</div> </div>
</button> </button>
</div> </div>
@ -166,7 +151,7 @@
<div class="seriesTimerSchedule padded-right"></div> <div class="seriesTimerSchedule padded-right"></div>
</div> </div>
<div class="collectionItems"></div> <div class="collectionItems hide"></div>
<div class="nextUpSection verticalSection detailVerticalSection hide"> <div class="nextUpSection verticalSection detailVerticalSection hide">
<h2 class="sectionTitle sectionTitle-cards">${HeaderNextUp}</h2> <h2 class="sectionTitle sectionTitle-cards">${HeaderNextUp}</h2>
@ -178,7 +163,7 @@
</div> </div>
<div id="childrenCollapsible" class="hide verticalSection detailVerticalSection"> <div id="childrenCollapsible" class="hide verticalSection detailVerticalSection">
<h2 class="childrenSectionHeader sectionTitle sectionTitle-cards"> <h2 class="childrenSectionHeader sectionTitle sectionTitle-cards hide">
<span id="childrenTitle"></span> <span id="childrenTitle"></span>
</h2> </h2>
<div id="childrenContent"> <div id="childrenContent">

View File

@ -28,15 +28,11 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
} }
function hideAll(page, className, show) { function hideAll(page, className, show) {
var i; for (const elem of page.querySelectorAll('.' + className)) {
var length;
var elems = page.querySelectorAll('.' + className);
for (i = 0, length = elems.length; i < length; i++) {
if (show) { if (show) {
elems[i].classList.remove('hide'); elem.classList.remove('hide');
} else { } else {
elems[i].classList.add('hide'); elem.classList.add('hide');
} }
} }
} }
@ -75,7 +71,9 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
moreButton: false, moreButton: false,
recordButton: false recordButton: false
}); });
return html += '</div>'; html += '</div>';
return html;
} }
function renderSeriesTimerSchedule(page, apiClient, seriesTimerId) { function renderSeriesTimerSchedule(page, apiClient, seriesTimerId) {
@ -143,9 +141,13 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
var mediaSources = item.MediaSources; var mediaSources = item.MediaSources;
instance._currentPlaybackMediaSources = mediaSources; instance._currentPlaybackMediaSources = mediaSources;
page.querySelector('.trackSelections').classList.remove('hide'); page.querySelector('.trackSelections').classList.remove('hide');
select.setLabel(globalize.translate('LabelVersion')); select.setLabel(globalize.translate('LabelVersion'));
var currentValue = select.value; var currentValue = select.value;
var selectedId = mediaSources[0].Id; var selectedId = mediaSources[0].Id;
select.innerHTML = mediaSources.map(function (v) { select.innerHTML = mediaSources.map(function (v) {
var selected = v.Id === selectedId ? ' selected' : ''; var selected = v.Id === selectedId ? ' selected' : '';
@ -242,12 +244,24 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
select.setLabel(globalize.translate('LabelSubtitles')); select.setLabel(globalize.translate('LabelSubtitles'));
var selectedId = null == mediaSource.DefaultSubtitleStreamIndex ? -1 : mediaSource.DefaultSubtitleStreamIndex; var selectedId = null == mediaSource.DefaultSubtitleStreamIndex ? -1 : mediaSource.DefaultSubtitleStreamIndex;
if (tracks.length) { var videoTracks = mediaSource.MediaStreams.filter(function (m) {
return 'Video' === m.Type;
});
// This only makes sence on Video items
if (videoTracks.length) {
var selected = -1 === selectedId ? ' selected' : ''; var selected = -1 === selectedId ? ' selected' : '';
select.innerHTML = '<option value="-1">' + globalize.translate('Off') + '</option>' + tracks.map(function (v) { select.innerHTML = '<option value="-1">' + globalize.translate('Off') + '</option>' + tracks.map(function (v) {
selected = v.Index === selectedId ? ' selected' : ''; selected = v.Index === selectedId ? ' selected' : '';
return '<option value="' + v.Index + '" ' + selected + '>' + v.DisplayTitle + '</option>'; return '<option value="' + v.Index + '" ' + selected + '>' + v.DisplayTitle + '</option>';
}).join(''); }).join('');
if (tracks.length > 1) {
select.removeAttribute('disabled');
} else {
select.setAttribute('disabled', 'disabled');
}
page.querySelector('.selectSubtitlesContainer').classList.remove('hide'); page.querySelector('.selectSubtitlesContainer').classList.remove('hide');
} else { } else {
select.innerHTML = ''; select.innerHTML = '';
@ -278,7 +292,12 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
var enableShuffle = item.IsFolder || -1 !== ['MusicAlbum', 'MusicGenre', 'MusicArtist'].indexOf(item.Type); var enableShuffle = item.IsFolder || -1 !== ['MusicAlbum', 'MusicGenre', 'MusicArtist'].indexOf(item.Type);
hideAll(page, 'btnShuffle', enableShuffle); hideAll(page, 'btnShuffle', enableShuffle);
canPlay = true; canPlay = true;
hideAll(page, 'btnResume', item.UserData && item.UserData.PlaybackPositionTicks > 0); if (item.UserData && item.UserData.PlaybackPositionTicks > 0) {
hideAll(page, 'btnResume', true);
for (const elem of page.querySelectorAll('.btnPlay')) {
elem.querySelector('.detailButton-icon').classList.replace('play_arrow', 'replay');
}
}
} else { } else {
hideAll(page, 'btnPlay'); hideAll(page, 'btnPlay');
hideAll(page, 'btnResume'); hideAll(page, 'btnResume');
@ -324,8 +343,7 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
function getArtistLinksHtml(artists, serverId, context) { function getArtistLinksHtml(artists, serverId, context) {
var html = []; var html = [];
for (var i = 0, length = artists.length; i < length; i++) { for (const artist of artists) {
var artist = artists[i];
var href = appRouter.getRouteUrl(artist, { var href = appRouter.getRouteUrl(artist, {
context: context, context: context,
itemType: 'MusicArtist', itemType: 'MusicArtist',
@ -333,8 +351,9 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
}); });
html.push('<a style="color:inherit;" class="button-link" is="emby-linkbutton" href="' + href + '">' + artist.Name + '</a>'); html.push('<a style="color:inherit;" class="button-link" is="emby-linkbutton" href="' + href + '">' + artist.Name + '</a>');
} }
html = html.join(' / ');
return html = html.join(' / '); return html;
} }
/** /**
@ -371,6 +390,8 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
if (item.SeriesName && 'Season' === item.Type) { if (item.SeriesName && 'Season' === item.Type) {
parentRoute = appRouter.getRouteUrl({ parentRoute = appRouter.getRouteUrl({
Id: item.SeriesId,
Name: item.SeriesName,
Type: 'Series', Type: 'Series',
IsFolder: true, IsFolder: true,
ServerId: item.ServerId ServerId: item.ServerId
@ -414,36 +435,33 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
if (parentNameLast) { if (parentNameLast) {
// Music // Music
if (layoutManager.mobile) { if (layoutManager.mobile) {
html = '<h3 class="parentName" style="margin: .25em 0;">' + parentNameHtml.join('</br>') + '</h3>'; html = '<h3 class="parentName musicParentName">' + parentNameHtml.join('</br>') + '</h3>';
} else { } else {
html = '<h3 class="parentName" style="margin: .25em 0;">' + parentNameHtml.join(' - ') + '</h3>'; html = '<h3 class="parentName musicParentName">' + parentNameHtml.join(' - ') + '</h3>';
} }
} else { } else {
if (layoutManager.mobile) { html = '<h1 class="parentName">' + tvShowHtml + '</h1>';
html = '<h1 class="parentName" style="margin: .1em 0 .25em;">' + parentNameHtml.join('</br>') + '</h1>';
} else {
html = '<h1 class="parentName" style="margin: .1em 0 .25em;">' + tvShowHtml + '</h1>';
}
} }
} }
var name = itemHelper.getDisplayName(item, { var name = itemHelper.getDisplayName(item, {
includeParentInfo: false includeParentInfo: false
}); });
var offset = parentNameLast ? '.25em' : '.5em';
if (html && !parentNameLast) { if (html && !parentNameLast) {
if (!layoutManager.mobile && tvSeasonHtml) { if (tvSeasonHtml) {
html += '<h3 class="itemName infoText" style="margin: .25em 0 .5em;">' + tvSeasonHtml + ' - ' + name + '</h3>'; html += '<h3 class="itemName infoText subTitle">' + tvSeasonHtml + ' - ' + name + '</h3>';
} else { } else {
html += '<h3 class="itemName infoText" style="margin: .25em 0 .5em;">' + name + '</h3>'; html += '<h3 class="itemName infoText subTitle">' + name + '</h3>';
} }
} else if (item.OriginalTitle && item.OriginalTitle != item.Name) {
html = '<h1 class="itemName infoText parentNameLast withOriginalTitle">' + name + '</h1>' + html;
} else { } else {
html = '<h1 class="itemName infoText" style="margin: .1em 0 ' + offset + ';">' + name + '</h1>' + html; html = '<h1 class="itemName infoText parentNameLast">' + name + '</h1>' + html;
} }
if (item.OriginalTitle && item.OriginalTitle != item.Name) { if (item.OriginalTitle && item.OriginalTitle != item.Name) {
html += '<h4 class="itemName infoText" style="margin: -0.75em 0 0.25em;">' + item.OriginalTitle + '</h4>'; html += '<h4 class="itemName infoText originalTitle">' + item.OriginalTitle + '</h4>';
} }
container.innerHTML = html; container.innerHTML = html;
@ -511,7 +529,7 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
Emby.Page.setTitle(''); Emby.Page.setTitle('');
// Start rendering the artwork first // Start rendering the artwork first
renderImage(page, item, apiClient, user); renderImage(page, item);
renderLogo(page, item, apiClient); renderLogo(page, item, apiClient);
renderBackdrop(item); renderBackdrop(item);
renderDetailPageBackdrop(page, item, apiClient); renderDetailPageBackdrop(page, item, apiClient);
@ -672,7 +690,7 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
} }
if (item.ExternalUrls) { if (item.ExternalUrls) {
for (let url of item.ExternalUrls) { for (const url of item.ExternalUrls) {
links.push(`<a is="emby-linkbutton" class="button-link" href="${url.Url}" target="_blank">${url.Name}</a>`); links.push(`<a is="emby-linkbutton" class="button-link" href="${url.Url}" target="_blank">${url.Name}</a>`);
} }
} }
@ -691,7 +709,7 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
} }
} }
function renderDetailImage(page, elem, item, apiClient, editable, imageLoader, indicators) { function renderDetailImage(elem, item, imageLoader) {
elem.classList.add('detailimg-hidemobile'); elem.classList.add('detailimg-hidemobile');
const itemArray = []; const itemArray = [];
@ -713,15 +731,11 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
imageLoader.lazyChildren(elem); imageLoader.lazyChildren(elem);
} }
function renderImage(page, item, apiClient, user) { function renderImage(page, item) {
renderDetailImage( renderDetailImage(
page,
page.querySelector('.detailImageContainer'), page.querySelector('.detailImageContainer'),
item, item,
apiClient, imageLoader
user.Policy.IsAdministrator && 'Photo' != item.MediaType,
imageLoader,
indicators
); );
} }
@ -840,7 +854,7 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
function renderOverview(page, item) { function renderOverview(page, item) {
var overviewElemnts = page.querySelectorAll('.overview'); var overviewElemnts = page.querySelectorAll('.overview');
for (let overviewElemnt of overviewElemnts) { for (const overviewElemnt of overviewElemnts) {
var overview = item.Overview || ''; var overview = item.Overview || '';
if (overview) { if (overview) {
@ -861,10 +875,7 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
expandButton.addEventListener('click', toggleLineClamp.bind(null, overviewElemnt)); expandButton.addEventListener('click', toggleLineClamp.bind(null, overviewElemnt));
var anchors = overviewElemnt.querySelectorAll('a'); for (const anchor of overviewElemnt.querySelectorAll('a')) {
var anchors = overviewElemnt.querySelectorAll('a');
for (let anchor of anchors) {
anchor.setAttribute('target', '_blank'); anchor.setAttribute('target', '_blank');
} }
} else { } else {
@ -874,19 +885,9 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
} }
} }
function renderGenres(page, item, context) { function renderGenres(page, item, context = inferContext(item)) {
context = context || inferContext(item);
var type;
var genres = item.GenreItems || []; var genres = item.GenreItems || [];
var type = context === 'music' ? 'MusicGenre' : 'Genre';
switch (context) {
case 'music':
type = 'MusicGenre';
break;
default:
type = 'Genre';
}
var html = genres.map(function (p) { var html = genres.map(function (p) {
return '<a style="color:inherit;" class="button-link" is="emby-linkbutton" href="' + appRouter.getRouteUrl({ return '<a style="color:inherit;" class="button-link" is="emby-linkbutton" href="' + appRouter.getRouteUrl({
@ -973,7 +974,7 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
function renderMiscInfo(page, item) { function renderMiscInfo(page, item) {
const primaryItemMiscInfo = page.querySelectorAll('.itemMiscInfo-primary'); const primaryItemMiscInfo = page.querySelectorAll('.itemMiscInfo-primary');
for (let miscInfo of primaryItemMiscInfo) { for (const miscInfo of primaryItemMiscInfo) {
mediaInfo.fillPrimaryMediaInfo(miscInfo, item, { mediaInfo.fillPrimaryMediaInfo(miscInfo, item, {
interactive: true, interactive: true,
episodeTitle: false, episodeTitle: false,
@ -989,7 +990,7 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
const secondaryItemMiscInfo = page.querySelectorAll('.itemMiscInfo-secondary'); const secondaryItemMiscInfo = page.querySelectorAll('.itemMiscInfo-secondary');
for (let miscInfo of secondaryItemMiscInfo) { for (const miscInfo of secondaryItemMiscInfo) {
mediaInfo.fillSecondaryMediaInfo(miscInfo, item, { mediaInfo.fillSecondaryMediaInfo(miscInfo, item, {
interactive: true interactive: true
}); });
@ -1313,8 +1314,7 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
action: 'playallfromhere', action: 'playallfromhere',
image: false, image: false,
artist: 'auto', artist: 'auto',
containerAlbumArtists: item.AlbumArtists, containerAlbumArtists: item.AlbumArtists
addToListButton: true
}); });
isList = true; isList = true;
} else if ('Series' == item.Type) { } else if ('Series' == item.Type) {
@ -1588,12 +1588,10 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
} }
function renderCollectionItems(page, parentItem, types, items) { function renderCollectionItems(page, parentItem, types, items) {
page.querySelector('.collectionItems').classList.remove('hide');
page.querySelector('.collectionItems').innerHTML = ''; page.querySelector('.collectionItems').innerHTML = '';
var i;
var length;
for (i = 0, length = types.length; i < length; i++) { for (const type of types) {
var type = types[i];
var typeItems = filterItemsByCollectionItemType(items, type); var typeItems = filterItemsByCollectionItemType(items, type);
if (typeItems.length) { if (typeItems.length) {
@ -1626,8 +1624,8 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
renderChildren(page, parentItem); renderChildren(page, parentItem);
}; };
for (i = 0, length = containers.length; i < length; i++) { for (const container of containers) {
containers[i].notifyRefreshNeeded = notifyRefreshNeeded; container.notifyRefreshNeeded = notifyRefreshNeeded;
} }
// if nothing in the collection can be played hide play and shuffle buttons // if nothing in the collection can be played hide play and shuffle buttons
@ -1794,7 +1792,7 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
function bindAll(view, selector, eventName, fn) { function bindAll(view, selector, eventName, fn) {
var elems = view.querySelectorAll(selector); var elems = view.querySelectorAll(selector);
for (let elem of elems) { for (const elem of elems) {
elem.addEventListener(eventName, fn); elem.addEventListener(eventName, fn);
} }
} }
@ -1814,10 +1812,6 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
Promise.all([getPromise(apiClient, params), apiClient.getCurrentUser()]).then(([item, user]) => { Promise.all([getPromise(apiClient, params), apiClient.getCurrentUser()]).then(([item, user]) => {
currentItem = item; currentItem = item;
reloadFromItem(instance, page, params, item, user); reloadFromItem(instance, page, params, item, user);
let detailImageContainer = page.querySelector('.detailImageContainer');
const overlayPlayButton = detailImageContainer.querySelector('.cardOverlayFab-primary');
overlayPlayButton.addEventListener('click', onPlayClick);
}).catch((error) => { }).catch((error) => {
console.error('failed to get item or current user: ', error); console.error('failed to get item or current user: ', error);
}); });
@ -1885,15 +1879,6 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
playbackManager.shuffle(currentItem); playbackManager.shuffle(currentItem);
} }
function onDeleteClick() {
require(['deleteHelper'], function (deleteHelper) {
deleteHelper.deleteItem({
item: currentItem,
navigate: true
});
});
}
function onCancelSeriesTimerClick() { function onCancelSeriesTimerClick() {
require(['recordingHelper'], function (recordingHelper) { require(['recordingHelper'], function (recordingHelper) {
recordingHelper.cancelSeriesTimerWithConfirmation(currentItem.Id, currentItem.ServerId).then(function () { recordingHelper.cancelSeriesTimerWithConfirmation(currentItem.Id, currentItem.ServerId).then(function () {

View File

@ -211,7 +211,7 @@
'MozAnimation': 'animationend', 'MozAnimation': 'animationend',
'WebkitAnimation': 'webkitAnimationEnd' 'WebkitAnimation': 'webkitAnimationEnd'
}; };
for (let t in animations) { for (const t in animations) {
if (el.style[t] !== undefined) { if (el.style[t] !== undefined) {
_animationEvent = animations[t]; _animationEvent = animations[t];
return animations[t]; return animations[t];
@ -251,7 +251,7 @@
'MozTransition': 'transitionend', 'MozTransition': 'transitionend',
'WebkitTransition': 'webkitTransitionEnd' 'WebkitTransition': 'webkitTransitionEnd'
}; };
for (let t in transitions) { for (const t in transitions) {
if (el.style[t] !== undefined) { if (el.style[t] !== undefined) {
_transitionEvent = transitions[t]; _transitionEvent = transitions[t];
return transitions[t]; return transitions[t];

View File

@ -15,7 +15,7 @@ define([
'detailtablecss'], function () { 'detailtablecss'], function () {
function defineRoute(newRoute) { function defineRoute(newRoute) {
var path = newRoute.path; var path = newRoute.alias ? newRoute.alias : newRoute.path;
console.debug('defining route: ' + path); console.debug('defining route: ' + path);
newRoute.dictionary = 'core'; newRoute.dictionary = 'core';
Emby.Page.addRoute(path, newRoute); Emby.Page.addRoute(path, newRoute);
@ -234,8 +234,9 @@ define([
transition: 'fade' transition: 'fade'
}); });
defineRoute({ defineRoute({
path: '/itemdetails.html', alias: '/details',
controller: 'itemDetails', path: '/controllers/itemDetails/itemDetails.html',
controller: 'itemDetails/itemDetails',
autoFocus: false, autoFocus: false,
transition: 'fade' transition: 'fade'
}); });

View File

@ -1059,7 +1059,7 @@ var AppInfo = {};
} }
if ('SeriesTimer' == itemType) { if ('SeriesTimer' == itemType) {
return 'itemdetails.html?seriesTimerId=' + id + '&serverId=' + serverId; return 'details?seriesTimerId=' + id + '&serverId=' + serverId;
} }
if ('livetv' == item.CollectionType) { if ('livetv' == item.CollectionType) {
@ -1129,13 +1129,13 @@ var AppInfo = {};
var itemTypes = ['Playlist', 'TvChannel', 'Program', 'BoxSet', 'MusicAlbum', 'MusicGenre', 'Person', 'Recording', 'MusicArtist']; var itemTypes = ['Playlist', 'TvChannel', 'Program', 'BoxSet', 'MusicAlbum', 'MusicGenre', 'Person', 'Recording', 'MusicArtist'];
if (itemTypes.indexOf(itemType) >= 0) { if (itemTypes.indexOf(itemType) >= 0) {
return 'itemdetails.html?id=' + id + '&serverId=' + serverId; return 'details?id=' + id + '&serverId=' + serverId;
} }
var contextSuffix = context ? '&context=' + context : ''; var contextSuffix = context ? '&context=' + context : '';
if ('Series' == itemType || 'Season' == itemType || 'Episode' == itemType) { if ('Series' == itemType || 'Season' == itemType || 'Episode' == itemType) {
return 'itemdetails.html?id=' + id + contextSuffix + '&serverId=' + serverId; return 'details?id=' + id + contextSuffix + '&serverId=' + serverId;
} }
if (item.IsFolder) { if (item.IsFolder) {
@ -1146,7 +1146,7 @@ var AppInfo = {};
return '#'; return '#';
} }
return 'itemdetails.html?id=' + id + '&serverId=' + serverId; return 'details?id=' + id + '&serverId=' + serverId;
}; };
appRouter.showItem = showItem; appRouter.showItem = showItem;