mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add more live tv buttons
This commit is contained in:
parent
4094adb5a7
commit
f491228119
114 changed files with 1076 additions and 310 deletions
|
@ -24,11 +24,11 @@
|
|||
currentItem = item;
|
||||
|
||||
if (item.Type == "UserRootFolder") {
|
||||
$('.editPageInnerContent', page).hide();
|
||||
$('.editPageInnerContent', page)[0].style.visibility = 'hidden';
|
||||
Dashboard.hideLoadingMsg();
|
||||
return;
|
||||
} else {
|
||||
$('.editPageInnerContent', page).show();
|
||||
$('.editPageInnerContent', page)[0].style.visibility = 'visible';
|
||||
}
|
||||
|
||||
var languages = metadataEditorInfo.Cultures;
|
||||
|
|
|
@ -155,7 +155,7 @@
|
|||
|
||||
function loadLiveTvChannels(service, openItems, callback) {
|
||||
|
||||
ApiClient.getLiveTvChannels({ ServiceName: service }).done(function (result) {
|
||||
ApiClient.getLiveTvChannels({ ServiceName: service, AddCurrentProgram: false }).done(function (result) {
|
||||
|
||||
var nodes = result.Items.map(function (i) {
|
||||
|
||||
|
|
|
@ -677,10 +677,11 @@
|
|||
context: context,
|
||||
lazy: true,
|
||||
showDetailsMenu: true,
|
||||
coverImage: item.Type == "MusicAlbum" || item.Type == "MusicArtist"
|
||||
coverImage: item.Type == "MusicAlbum" || item.Type == "MusicArtist",
|
||||
overlayPlayButton: true
|
||||
});
|
||||
|
||||
$('#similarContent', page).html(html).lazyChildren();
|
||||
$('#similarContent', page).html(html).lazyChildren().createCardMenus();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
var pageSizeKey = 'pagesize_v4';
|
||||
|
||||
return {
|
||||
var libraryBrowser = {
|
||||
getDefaultPageSize: function (key, defaultValue) {
|
||||
|
||||
var saved = appStorage.getItem(key || pageSizeKey);
|
||||
|
@ -205,8 +205,6 @@
|
|||
|
||||
if (LibraryBrowser.enableFullPaperTabs()) {
|
||||
|
||||
$(tabs).show();
|
||||
|
||||
if ($.browser.safari) {
|
||||
|
||||
// Not very iOS-like I suppose
|
||||
|
@ -226,8 +224,7 @@
|
|||
tabs.noBar = true;
|
||||
tabs.scrollable = true;
|
||||
|
||||
var legacyTabs = $('.legacyTabs', ownerpage).show();
|
||||
document.body.classList.add('basicPaperLibraryTabs');
|
||||
var legacyTabs = $('.legacyTabs', ownerpage);
|
||||
|
||||
$(pages).on('iron-select', function (e) {
|
||||
|
||||
|
@ -242,6 +239,7 @@
|
|||
|
||||
$(pages).on('iron-select', function () {
|
||||
|
||||
console.log('iron-select');
|
||||
// When transition animations are used, add a content loading delay to allow the animations to finish
|
||||
// Otherwise with both operations happening at the same time, it can cause the animation to not run at full speed.
|
||||
var enablePaperTabs = LibraryBrowser.enableFullPaperTabs();
|
||||
|
@ -1258,6 +1256,11 @@
|
|||
itemCommands.push('sync');
|
||||
}
|
||||
|
||||
if (item.Type == 'Program' && (!item.TimerId && !item.SeriesTimerId)) {
|
||||
|
||||
itemCommands.push('record');
|
||||
}
|
||||
|
||||
return itemCommands;
|
||||
},
|
||||
|
||||
|
@ -3319,4 +3322,12 @@
|
|||
}
|
||||
};
|
||||
|
||||
if (libraryBrowser.enableFullPaperTabs()) {
|
||||
document.documentElement.classList.add('fullPaperLibraryTabs');
|
||||
} else {
|
||||
document.documentElement.classList.add('basicPaperLibraryTabs');
|
||||
}
|
||||
|
||||
return libraryBrowser;
|
||||
|
||||
})(window, document, jQuery, screen);
|
|
@ -315,6 +315,14 @@
|
|||
});
|
||||
}
|
||||
|
||||
if (commands.indexOf('record') != -1) {
|
||||
items.push({
|
||||
name: Globalize.translate('ButtonRecord'),
|
||||
id: 'record',
|
||||
ironIcon: 'videocam'
|
||||
});
|
||||
}
|
||||
|
||||
if (commands.indexOf('removefromplaylist') != -1) {
|
||||
items.push({
|
||||
name: Globalize.translate('ButtonRemoveFromPlaylist'),
|
||||
|
@ -415,6 +423,8 @@
|
|||
break;
|
||||
case 'album':
|
||||
Dashboard.navigate('itemdetails.html?id=' + albumid);
|
||||
case 'record':
|
||||
Dashboard.navigate('livetvnewrecording.html?programid=' + itemId);
|
||||
break;
|
||||
case 'artist':
|
||||
Dashboard.navigate('itemdetails.html?context=music&id=' + artistid);
|
||||
|
|
|
@ -95,11 +95,58 @@
|
|||
html += (item.Overview || '');
|
||||
html += '</p>';
|
||||
|
||||
html += '<div style="text-align:center;padding-bottom:.5em;">';
|
||||
|
||||
var endDate;
|
||||
var startDate;
|
||||
var now = new Date().getTime();
|
||||
|
||||
try {
|
||||
|
||||
endDate = parseISO8601Date(item.EndDate, { toLocal: true });
|
||||
|
||||
} catch (err) {
|
||||
endDate = now;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
startDate = parseISO8601Date(item.StartDate, { toLocal: true });
|
||||
|
||||
} catch (err) {
|
||||
startDate = now;
|
||||
}
|
||||
|
||||
|
||||
if (now < endDate && now >= startDate) {
|
||||
html += '<paper-button data-id="' + item.ChannelId + '" raised class="accent mini btnPlay"><iron-icon icon="play-arrow"></iron-icon><span>' + Globalize.translate('ButtonPlay') + '</span></paper-button>';
|
||||
}
|
||||
|
||||
if (!item.TimerId && !item.SeriesTimerId) {
|
||||
html += '<paper-button data-id="' + item.Id + '" raised class="mini btnRecord" style="background-color:#cc3333;"><iron-icon icon="videocam"></iron-icon><span>' + Globalize.translate('ButtonRecord') + '</span></paper-button>';
|
||||
}
|
||||
|
||||
html += '<div>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function onPlayClick() {
|
||||
|
||||
$('.itemFlyout').popup('close');
|
||||
|
||||
MediaController.play({
|
||||
ids: [this.getAttribute('data-id')]
|
||||
});
|
||||
}
|
||||
|
||||
function onRecordClick() {
|
||||
$('.itemFlyout').popup('close');
|
||||
Dashboard.navigate('livetvnewrecording.html?programid=' + this.getAttribute('data-id'));
|
||||
}
|
||||
|
||||
function showOverlay(elem, item) {
|
||||
|
||||
$('.itemFlyout').popup('close').remove();
|
||||
|
@ -107,7 +154,7 @@
|
|||
var html = '<div data-role="popup" class="itemFlyout" data-theme="b" data-arrow="true" data-history="false">';
|
||||
|
||||
html += '<div class="ui-bar-b" style="text-align:center;">';
|
||||
html += '<h3 style="margin: .5em 0;padding:0 1em;font-weight:normal;">' + item.Name + '</h3>';
|
||||
html += '<h3 style="margin: .5em 0;padding:.5em 1em;font-weight:normal;">' + item.Name + '</h3>';
|
||||
html += '</div>';
|
||||
|
||||
html += '<div style="padding: 0 1em;">';
|
||||
|
@ -129,6 +176,9 @@
|
|||
$(this).off("popupafterclose").off("mouseenter").off("mouseleave").remove();
|
||||
});
|
||||
|
||||
$('.btnPlay', popup).on('click', onPlayClick);
|
||||
$('.btnRecord', popup).on('click', onRecordClick);
|
||||
|
||||
LibraryBrowser.renderGenres($('.itemGenres', popup), item, 3);
|
||||
$('.miscTvProgramInfo', popup).html(LibraryBrowser.getMiscInfoHtml(item)).trigger('create');
|
||||
|
||||
|
|
|
@ -44,9 +44,10 @@
|
|||
|
||||
Dashboard.showModalLoadingMsg();
|
||||
|
||||
channelQuery.userId = Dashboard.getCurrentUserId();
|
||||
channelQuery.UserId = Dashboard.getCurrentUserId();
|
||||
|
||||
channelQuery.Limit = Math.min(channelQuery.Limit || defaultChannels, channelLimit);
|
||||
channelQuery.AddCurrentProgram = false;
|
||||
|
||||
channelsPromise = channelsPromise || ApiClient.getLiveTvChannels(channelQuery);
|
||||
|
||||
|
|
|
@ -57,7 +57,8 @@
|
|||
lazy: true,
|
||||
showStartDateIndex: true,
|
||||
overlayText: false,
|
||||
showProgramAirInfo: true
|
||||
showProgramAirInfo: true,
|
||||
overlayMoreButton: true
|
||||
});
|
||||
}
|
||||
else if (view == "PosterCard") {
|
||||
|
@ -69,7 +70,8 @@
|
|||
showStartDateIndex: true,
|
||||
lazy: true,
|
||||
cardLayout: true,
|
||||
showProgramAirInfo: true
|
||||
showProgramAirInfo: true,
|
||||
overlayMoreButton: true
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -244,6 +244,7 @@
|
|||
}
|
||||
|
||||
if (LibraryBrowser.needsRefresh(tabContent)) {
|
||||
console.log('loadSuggestionsTab');
|
||||
loadResume(tabContent, userId, parentId);
|
||||
loadLatest(tabContent, userId, parentId);
|
||||
|
||||
|
@ -330,10 +331,15 @@
|
|||
|
||||
if (LibraryBrowser.navigateOnLibraryTabSelect()) {
|
||||
|
||||
var url = 'movies.html';
|
||||
var topParentId = LibraryMenu.getTopParentId();
|
||||
if (topParentId) {
|
||||
url += '?topParentId=' + topParentId;
|
||||
}
|
||||
if (selected) {
|
||||
Dashboard.navigate('movies.html?tab=' + selected);
|
||||
Dashboard.navigate(url + '&tab=' + selected);
|
||||
} else {
|
||||
Dashboard.navigate('movies.html');
|
||||
Dashboard.navigate(url);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
|
@ -213,10 +213,15 @@
|
|||
var selected = this.selected;
|
||||
if (LibraryBrowser.navigateOnLibraryTabSelect()) {
|
||||
|
||||
var url = 'photos.html';
|
||||
var topParentId = LibraryMenu.getTopParentId();
|
||||
if (topParentId) {
|
||||
url += '?topParentId=' + topParentId;
|
||||
}
|
||||
if (selected) {
|
||||
Dashboard.navigate('photos.html?tab=' + selected + '&topParentId=' + LibraryMenu.getTopParentId());
|
||||
Dashboard.navigate(url + '&tab=' + selected);
|
||||
} else {
|
||||
Dashboard.navigate('photos.html?topParentId=' + LibraryMenu.getTopParentId());
|
||||
Dashboard.navigate(url);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
|
@ -2187,6 +2187,7 @@ $(document).on('pagecreate', ".page", function () {
|
|||
|
||||
var dependencies = this.getAttribute('data-require');
|
||||
dependencies = dependencies ? dependencies.split(',') : null;
|
||||
|
||||
Dashboard.firePageEvent(page, 'pageinitdepends', dependencies);
|
||||
|
||||
}).on('pagebeforeshow', ".page", function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue