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

add chapter image error handling

This commit is contained in:
Luke Pulverenti 2016-09-05 16:07:36 -04:00
parent 638fe11131
commit 3a5dad0e64
14 changed files with 123 additions and 190 deletions

View file

@ -104,10 +104,11 @@
} }
.btnCardOptions { .btnCardOptions {
text-align: right; position: absolute;
float: right; bottom: 0;
padding: 5px 0 2px; right: 0;
margin: 0 !important; margin: 0 !important;
z-index: 1;
} }
.mediaSourceIndicator { .mediaSourceIndicator {
@ -202,6 +203,7 @@
.cardFooter { .cardFooter {
padding: .5em .3em; padding: .5em .3em;
position: relative;
} }
.visualCardBox-cardScalable, .visualCardBox-cardFooter { .visualCardBox-cardScalable, .visualCardBox-cardFooter {
@ -253,10 +255,39 @@
opacity: .6; opacity: .6;
} }
.cardText-rightmargin {
margin-right: 2em;
}
.cardCenteredText { .cardCenteredText {
white-space: normal; white-space: normal;
} }
.textActionButton {
border: 0 !important;
background: transparent;
border: 0 !important;
padding: 0 !important;
cursor: pointer;
outline: none !important;
color: inherit;
vertical-align: middle;
font-family: inherit;
font-size: inherit;
/*display: flex;
align-items: center;
justify-content: center;*/
}
.textActionButton:hover {
text-decoration: underline;
opacity: 1;
}
.cardFooterLogo {
margin-right: 1em;
}
.cardImageIcon { .cardImageIcon {
width: 12vh; width: 12vh;
height: 12vh; height: 12vh;

View file

@ -669,7 +669,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
return 'defaultCardColor' + getDefaultColorIndex(str); return 'defaultCardColor' + getDefaultColorIndex(str);
} }
function getCardTextLines(lines, cssClass, forceLines, addSecondaryClass) { function getCardTextLines(lines, cssClass, forceLines, isOuterFooter, cardLayout) {
var html = ''; var html = '';
@ -680,10 +680,14 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
var text = lines[i]; var text = lines[i];
if (i == 1 && addSecondaryClass) { if (i == 1 && isOuterFooter) {
cssClass += ' cardText-secondary'; cssClass += ' cardText-secondary';
} }
if (isOuterFooter && cardLayout) {
cssClass += ' cardText-rightmargin';
}
if (text) { if (text) {
html += "<div class='" + cssClass + "'>"; html += "<div class='" + cssClass + "'>";
html += text; html += text;
@ -702,15 +706,21 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
return html; return html;
} }
function getCardFooterText(item, options, showTitle, forceName, overlayText, imgUrl, footerClass, progressHtml, isOuterFooter) { function getCardFooterText(item, apiClient, options, showTitle, forceName, overlayText, imgUrl, footerClass, progressHtml, isOuterFooter) {
var html = ''; var html = '';
var showOtherText = isOuterFooter ? !overlayText : overlayText; var showOtherText = isOuterFooter ? !overlayText : overlayText;
if (isOuterFooter && options.cardLayout && !layoutManager.tv) { if (isOuterFooter && options.cardLayout && !layoutManager.tv) {
var moreIcon = appHost.moreIcon == 'dots-horiz' ? '&#xE5D3;' : '&#xE5D4;';
html += '<button is="paper-icon-button-light" class="itemAction btnCardOptions autoSize" data-action="menu"><i class="md-icon">' + moreIcon + '</i></button>'; if (options.cardFooterAside == 'logo') {
}
else if (options.cardFooterAside != 'none') {
var moreIcon = appHost.moreIcon == 'dots-horiz' ? '&#xE5D3;' : '&#xE5D4;';
html += '<button is="paper-icon-button-light" class="itemAction btnCardOptions autoSize" data-action="menu"><i class="md-icon">' + moreIcon + '</i></button>';
}
} }
var cssClass = options.centerText && !options.cardLayout ? "cardText cardTextCentered" : "cardText"; var cssClass = options.centerText && !options.cardLayout ? "cardText cardTextCentered" : "cardText";
@ -867,7 +877,33 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
lines.push(text || '&nbsp;'); lines.push(text || '&nbsp;');
lines.push(item.ChannelName || '&nbsp;'); if (item.ChannelId) {
var channelText = item.ChannelName;
//var logoHeight = 32;
//if (item.ChannelPrimaryImageTag) {
// channelText = '<img src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" class="lazy cardFooterLogo" style="height:' + logoHeight + 'px" data-src="' + apiClient.getScaledImageUrl(item.ChannelId, {
// type: "Primary",
// height: logoHeight,
// tag: item.ChannelPrimaryImageTag
// }) + '" />' + channelText;
//} else {
// channelText += '<div style="height:' + logoHeight + 'px;width:0;"></div>';
//}
lines.push(getTextActionButton({
Id: item.ChannelId,
Name: item.ChannelName,
Type: 'TvChannel',
MediaType: item.MediaType,
IsFolder: false
}, channelText));
} else {
lines.push(item.ChannelName || '&nbsp;');
}
} }
} }
@ -875,7 +911,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
lines = []; lines = [];
} }
html += getCardTextLines(lines, cssClass, !options.overlayText, isOuterFooter); html += getCardTextLines(lines, cssClass, !options.overlayText, isOuterFooter, options.cardLayout);
if (progressHtml) { if (progressHtml) {
html += progressHtml; html += progressHtml;
@ -1062,7 +1098,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
if (overlayText) { if (overlayText) {
footerCssClass = progressHtml ? 'innerCardFooter fullInnerCardFooter' : 'innerCardFooter'; footerCssClass = progressHtml ? 'innerCardFooter fullInnerCardFooter' : 'innerCardFooter';
innerCardFooter += getCardFooterText(item, options, showTitle, forceName, overlayText, imgUrl, footerCssClass, progressHtml, false); innerCardFooter += getCardFooterText(item, apiClient, options, showTitle, forceName, overlayText, imgUrl, footerCssClass, progressHtml, false);
footerOverlayed = true; footerOverlayed = true;
} }
else if (progressHtml) { else if (progressHtml) {
@ -1081,7 +1117,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
var outerCardFooter = ''; var outerCardFooter = '';
if (!overlayText && !footerOverlayed) { if (!overlayText && !footerOverlayed) {
footerCssClass = options.cardLayout ? 'cardFooter visualCardBox-cardFooter' : 'cardFooter transparent'; footerCssClass = options.cardLayout ? 'cardFooter visualCardBox-cardFooter' : 'cardFooter transparent';
outerCardFooter = getCardFooterText(item, options, showTitle, forceName, overlayText, imgUrl, footerCssClass, progressHtml, true); outerCardFooter = getCardFooterText(item, apiClient, options, showTitle, forceName, overlayText, imgUrl, footerCssClass, progressHtml, true);
} }
if (outerCardFooter && !options.cardLayout && options.allowBottomPadding !== false) { if (outerCardFooter && !options.cardLayout && options.allowBottomPadding !== false) {

View file

@ -383,3 +383,22 @@
.timerIcon, .seriesTimerIcon { .timerIcon, .seriesTimerIcon {
color: #cc3333 !important; color: #cc3333 !important;
} }
.visibleGuideScroller::-webkit-scrollbar {
width: 10px;
height: 10px;
}
.visibleGuideScroller::-webkit-scrollbar-button:start:decrement,
.visibleGuideScroller::-webkit-scrollbar-button:end:increment {
display: none;
}
.visibleGuideScroller::-webkit-scrollbar-track-piece {
background-color: #3b3b3b;
}
.visibleGuideScroller::-webkit-scrollbar-thumb:vertical, .visibleGuideScroller::-webkit-scrollbar-thumb:horizontal {
-webkit-border-radius: 2px;
background: #888 no-repeat center;
}

View file

@ -2,13 +2,13 @@
<div class="channelTimeslotHeader"> <div class="channelTimeslotHeader">
<button class="btnSelectDate clearButton" style="display:block;"></button> <button class="btnSelectDate clearButton" style="display:block;"></button>
</div> </div>
<div class="timeslotHeaders smoothScrollX" style="scroll-behavior: auto;"></div> <div class="timeslotHeaders smoothScrollX visibleGuideScroller" style="scroll-behavior: auto;"></div>
</div> </div>
<div class="smoothScrollY guideVerticalScroller programContainer" style="flex-grow: 1;"> <div class="smoothScrollY guideVerticalScroller programContainer visibleGuideScroller" style="flex-grow: 1;">
<div class="channelList"></div> <div class="channelList"></div>
<div class="programGridContainer programGrid smoothScrollX" style="white-space: nowrap;"> <div class="programGridContainer programGrid smoothScrollX visibleGuideScroller" style="white-space: nowrap;">
</div> </div>
</div> </div>

View file

@ -43,24 +43,6 @@
contain: style; contain: style;
} }
.textActionButton {
border: 0 !important;
background: transparent;
border: 0 !important;
padding: 0 !important;
cursor: pointer;
outline: none !important;
color: inherit;
vertical-align: middle;
font-family: inherit;
font-size: inherit;
}
.textActionButton:hover {
text-decoration: underline;
opacity: 1;
}
.pageWithAbsoluteTabs .pageTabContent, .libraryPage > .ui-content { .pageWithAbsoluteTabs .pageTabContent, .libraryPage > .ui-content {
padding-top: 10px; padding-top: 10px;
} }

View file

@ -49,6 +49,12 @@
$('#fldEnableAutomaticRestart', page).hide(); $('#fldEnableAutomaticRestart', page).hide();
} }
if (systemInfo.CanSelfRestart || systemInfo.CanSelfUpdate) {
$('.autoUpdatesContainer', page).removeClass('hide');
} else {
$('.autoUpdatesContainer', page).addClass('hide');
}
$('#chkEnableDashboardResponseCache', page).checked(config.EnableDashboardResponseCaching); $('#chkEnableDashboardResponseCache', page).checked(config.EnableDashboardResponseCaching);
$('#chkEnableMinification', page).checked(config.EnableDashboardResourceMinification); $('#chkEnableMinification', page).checked(config.EnableDashboardResourceMinification);
$('#txtDashboardSourcePath', page).val(config.DashboardSourcePath).trigger('change'); $('#txtDashboardSourcePath', page).val(config.DashboardSourcePath).trigger('change');

View file

@ -58,7 +58,7 @@
</div> </div>
</div> </div>
<div is="emby-collapse" title="${HeaderAutomaticUpdates}"> <div is="emby-collapse" title="${HeaderAutomaticUpdates}" class="autoUpdatesContainer hide">
<div class="collapseContent"> <div class="collapseContent">
<br /> <br />
<label class="fldAutomaticUpdates checkboxContainer"> <label class="fldAutomaticUpdates checkboxContainer">

View file

@ -1,15 +0,0 @@
<div id="liveTvRecordingListPage" data-role="page" class="page libraryPage liveTvPage noSecondaryNavPage" data-title="${HeaderLiveTv}" data-require="scripts/livetvrecordinglist,livetvcss" data-menubutton="false">
<div data-role="content">
<div class="viewSettings" style="margin:.5em 0;">
<h1 class="listName" style="margin: 0 1em 0 0; display: inline-block; vertical-align: middle;"></h1>
<div class="viewControls">
</div>
<div class="listTopPaging">
</div>
</div>
<div is="emby-itemscontainer" id="items" class="itemsContainer vertical-wrap centered"></div>
</div>
</div>

View file

@ -638,13 +638,6 @@
return; return;
} }
if (browser.edge || browser.msie) {
fetchSubtitles(track).then(function (data) {
currentTrackEvents = data.TrackEvents;
});
return;
}
var trackElement = null; var trackElement = null;
var expectedId = 'manualTrack' + track.index; var expectedId = 'manualTrack' + track.index;

View file

@ -47,12 +47,13 @@
html = cardBuilder.getCardsHtml({ html = cardBuilder.getCardsHtml({
items: result.Items, items: result.Items,
shape: query.IsMovie ? 'portrait' : "backdrop", shape: query.IsMovie ? 'portrait' : "backdrop",
preferThumb: !query.IsMovie,
context: 'livetv', context: 'livetv',
centerText: true, centerText: true,
lazy: true, lazy: true,
overlayText: false, overlayText: false,
showTitle: true, showTitle: true,
showParentTitle: query.IsSeries !== false && !query.IsMovie, //showParentTitle: query.IsSeries !== false && !query.IsMovie,
showProgramAirInfo: params.type != 'Recordings', showProgramAirInfo: params.type != 'Recordings',
overlayMoreButton: true, overlayMoreButton: true,
showYear: query.IsMovie && params.type == 'Recordings' showYear: query.IsMovie && params.type == 'Recordings'

View file

@ -1,122 +0,0 @@
define(['jQuery', 'cardBuilder', 'dom'], function ($, cardBuilder, dom) {
// The base query options
var query = {
UserId: Dashboard.getCurrentUserId(),
StartIndex: 0,
Fields: "CanDelete,PrimaryImageAspectRatio"
};
function reloadItems(page) {
Dashboard.showLoadingMsg();
ApiClient.getLiveTvRecordings(query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);
var html = '';
$('.listTopPaging', page).html(LibraryBrowser.getQueryPagingHtml({
startIndex: query.StartIndex,
limit: query.Limit,
totalRecordCount: result.TotalRecordCount,
showLimit: false,
updatePageSizeSetting: false
}));
updateFilterControls();
var screenWidth = dom.getWindowSize().innerWidth;
html += cardBuilder.getCardsHtml({
items: result.Items,
shape: "auto",
showTitle: true,
showParentTitle: true,
overlayText: screenWidth >= 600,
coverImage: true
});
html += LibraryBrowser.getQueryPagingHtml({
startIndex: query.StartIndex,
limit: query.Limit,
totalRecordCount: result.TotalRecordCount,
showLimit: false,
updatePageSizeSetting: false
});
var elem = page.querySelector('#items');
elem.innerHTML = html;
ImageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', page).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
if (getParameterByName('savequery') != 'false') {
LibraryBrowser.saveQueryValues('episodes', query);
}
Dashboard.hideLoadingMsg();
});
}
function updateFilterControls(page) {
}
$(document).on('pageinit', "#liveTvRecordingListPage", function () {
var page = this;
}).on('pagebeforeshow', "#liveTvRecordingListPage", function () {
var page = this;
var limit = LibraryBrowser.getDefaultPageSize();
// If the default page size has changed, the start index will have to be reset
if (limit != query.Limit) {
query.Limit = limit;
query.StartIndex = 0;
}
LibraryBrowser.loadSavedQueryValues('episodes', query);
var groupId = getParameterByName('groupid');
query.GroupId = groupId;
reloadItems(page);
if (query.GroupId) {
ApiClient.getLiveTvRecordingGroup(query.GroupId).then(function (group) {
$('.listName', page).html(group.Name);
});
} else {
$('.listName', page).html(Globalize.translate('HeaderAllRecordings'));
}
updateFilterControls(this);
});
});

View file

@ -24,7 +24,8 @@
limit: getLimit() * 2, limit: getLimit() * 2,
ImageTypeLimit: 1, ImageTypeLimit: 1,
EnableImageTypes: "Primary", EnableImageTypes: "Primary",
EnableTotalRecordCount: false EnableTotalRecordCount: false,
Fields: "ChannelInfo"
}).then(function (result) { }).then(function (result) {
@ -47,7 +48,8 @@
IsSports: false, IsSports: false,
IsKids: false, IsKids: false,
IsSeries: true, IsSeries: true,
EnableTotalRecordCount: false EnableTotalRecordCount: false,
Fields: "ChannelInfo"
}).then(function (result) { }).then(function (result) {
@ -61,7 +63,8 @@
HasAired: false, HasAired: false,
limit: getLimit(), limit: getLimit(),
IsMovie: true, IsMovie: true,
EnableTotalRecordCount: false EnableTotalRecordCount: false,
Fields: "ChannelInfo"
}).then(function (result) { }).then(function (result) {
@ -75,7 +78,8 @@
HasAired: false, HasAired: false,
limit: getLimit(), limit: getLimit(),
IsSports: true, IsSports: true,
EnableTotalRecordCount: false EnableTotalRecordCount: false,
Fields: "ChannelInfo"
}).then(function (result) { }).then(function (result) {
@ -89,7 +93,8 @@
HasAired: false, HasAired: false,
limit: getLimit(), limit: getLimit(),
IsKids: true, IsKids: true,
EnableTotalRecordCount: false EnableTotalRecordCount: false,
Fields: "ChannelInfo"
}).then(function (result) { }).then(function (result) {
@ -101,6 +106,7 @@
var html = cardBuilder.getCardsHtml({ var html = cardBuilder.getCardsHtml({
items: items, items: items,
preferThumb: !shape,
shape: shape || (enableScrollX() ? 'overflowBackdrop' : 'backdrop'), shape: shape || (enableScrollX() ? 'overflowBackdrop' : 'backdrop'),
showTitle: true, showTitle: true,
centerText: true, centerText: true,
@ -111,6 +117,7 @@
overlayPlayButton: overlayButton == 'play', overlayPlayButton: overlayButton == 'play',
allowBottomPadding: !enableScrollX(), allowBottomPadding: !enableScrollX(),
showProgramAirInfo: true showProgramAirInfo: true
//cardFooterAside: 'logo'
}); });
var elem = page.querySelector('.' + sectionClass); var elem = page.querySelector('.' + sectionClass);

View file

@ -455,6 +455,7 @@
shape: scrollX ? 'overflowBackdrop' : shape, shape: scrollX ? 'overflowBackdrop' : shape,
showTitle: showTitles, showTitle: showTitles,
centerText: true, centerText: true,
overlayText: false,
lazy: true, lazy: true,
autoThumb: true, autoThumb: true,
transition: false, transition: false,

View file

@ -2141,12 +2141,6 @@ var AppInfo = {};
controller: 'scripts/livetvitems' controller: 'scripts/livetvitems'
}); });
defineRoute({
path: '/livetvrecordinglist.html',
dependencies: [],
autoFocus: false
});
defineRoute({ defineRoute({
path: '/livetvseriestimer.html', path: '/livetvseriestimer.html',
dependencies: ['emby-checkbox', 'emby-input', 'emby-button', 'emby-collapse', 'scripts/livetvcomponents', 'scripts/livetvseriestimer', 'livetvcss'], dependencies: ['emby-checkbox', 'emby-input', 'emby-button', 'emby-collapse', 'scripts/livetvcomponents', 'scripts/livetvseriestimer', 'livetvcss'],