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

update live tv pages

This commit is contained in:
Luke Pulverenti 2015-09-08 00:22:38 -04:00
parent ec67431a0e
commit a61e96accb
19 changed files with 172 additions and 216 deletions

View file

@ -1,5 +1,98 @@
(function () {
function getTimersHtml(timers) {
var html = '';
var index = '';
for (var i = 0, length = timers.length; i < length; i++) {
var timer = timers[i];
var startDateText = LibraryBrowser.getFutureDateText(parseISO8601Date(timer.StartDate, { toLocal: true }));
if (startDateText != index) {
if (index) {
html += '</div>';
html += '</div>';
}
html += '<div class="homePageSection">';
html += '<h1>' + startDateText + '</h1>';
html += '<div class="paperList">';
index = startDateText;
}
html += '<paper-icon-item>';
var program = timer.ProgramInfo || {};
var imgUrl;
if (program.ImageTags && program.ImageTags.Primary) {
imgUrl = ApiClient.getScaledImageUrl(program.Id, {
height: 80,
tag: program.ImageTags.Primary,
type: "Primary"
});
}
if (imgUrl) {
html += '<paper-fab class="listAvatar blue" style="background-image:url(\'' + imgUrl + '\');background-repeat:no-repeat;background-position:center center;background-size: cover;" item-icon></paper-fab>';
}
else if (program.IsKids) {
html += '<paper-fab class="listAvatar" style="background:#2196F3;" icon="person" item-icon></paper-fab>';
}
else if (program.IsSports) {
html += '<paper-fab class="listAvatar" style="background:#8BC34A;" icon="person" item-icon></paper-fab>';
}
else if (program.IsMovie) {
html += '<paper-fab class="listAvatar" icon="movie" item-icon></paper-fab>';
}
else if (program.IsNews) {
html += '<paper-fab class="listAvatar" style="background:#673AB7;" icon="new-releases" item-icon></paper-fab>';
}
else {
html += '<paper-fab class="listAvatar blue" icon="live-tv" item-icon></paper-fab>';
}
html += '<paper-item-body two-line>';
html += '<a class="clearLink" href="livetvtimer.html?id=' + timer.Id + '">';
html += '<div>';
html += timer.Name;
html += '</div>';
html += '<div secondary>';
html += LibraryBrowser.getDisplayTime(timer.StartDate);
html += ' - ' + LibraryBrowser.getDisplayTime(timer.EndDate);
html += '</div>';
html += '</a>';
html += '</paper-item-body>';
if (timer.SeriesTimerId) {
html += '<div class="ui-li-aside" style="right:0;">';
html += '<div class="timerCircle seriesTimerCircle"></div>';
html += '<div class="timerCircle seriesTimerCircle"></div>';
html += '<div class="timerCircle seriesTimerCircle"></div>';
html += '</div>';
}
html += '<paper-icon-button icon="cancel" data-timerid="' + timer.Id + '" title="' + Globalize.translate('ButonCancelRecording') + '" class="btnDeleteTimer"></paper-icon-button>';
html += '</paper-icon-item>';
}
if (timers.length) {
html += '</div>';
html += '</div>';
}
return html;
}
window.LiveTvHelpers = {
getDaysOfWeek: function () {
@ -42,7 +135,8 @@
} else {
elem.hide();
}
}
},
getTimersHtml: getTimersHtml
};
})();
@ -135,7 +229,7 @@
function onPlayClick() {
$('.itemFlyout').popup('close');
hideOverlay();
MediaController.play({
ids: [this.getAttribute('data-id')]
@ -143,7 +237,7 @@
}
function onRecordClick() {
$('.itemFlyout').popup('close');
hideOverlay();
Dashboard.navigate('livetvnewrecording.html?programid=' + this.getAttribute('data-id'));
}
@ -151,7 +245,7 @@
function showOverlay(elem, item) {
require(['jqmpopup'], function () {
$('.itemFlyout').popup('close').remove();
hideOverlay();
var html = '<div data-role="popup" class="itemFlyout" data-theme="b" data-arrow="true" data-history="false">';
@ -165,8 +259,6 @@
html += '</div>';
$('.itemFlyout').popup('close').popup('destroy').remove();
$(document.body).append(html);
var popup = $('.itemFlyout').on('mouseenter', onOverlayMouseOver).on('mouseleave', onOverlayMouseOut).popup({
@ -206,7 +298,11 @@
function hideOverlay() {
$('.itemFlyout').popup('close').remove();
var flyout = document.querySelectorAll('.itemFlyout');
if (flyout.length) {
$(flyout).popup('close').popup('destroy').remove();
}
if (currentPosterItem) {