mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
replace channel tabs
This commit is contained in:
parent
bfb177618f
commit
a5579327cc
12 changed files with 146 additions and 81 deletions
|
@ -106,16 +106,14 @@
|
|||
|
||||
ApiClient.getItem(query.UserId, folderId).done(function (item) {
|
||||
|
||||
$('.categoryTitle', page).show().html(item.Name);
|
||||
$('.channelHeader', page).show().html('<a href="channelitems.html?id=' + item.ChannelId + '">' + item.ChannelName + '</a>').trigger('create');
|
||||
LibraryMenu.setTitle(item.Name);
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
ApiClient.getItem(query.UserId, channelId).done(function (item) {
|
||||
|
||||
$('.categoryTitle', page).hide().html(item.Name);
|
||||
$('.channelHeader', page).show().html('<a href="channelitems.html?id=' + item.Id + '">' + item.Name + '</a>');
|
||||
LibraryMenu.setTitle(item.Name);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -63,13 +63,49 @@
|
|||
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshowready', "#channelsPage", function () {
|
||||
function loadTab(page, index) {
|
||||
|
||||
LibraryBrowser.loadSavedQueryValues('channels', query);
|
||||
switch (index) {
|
||||
|
||||
reloadItems(this);
|
||||
case 1:
|
||||
LibraryBrowser.loadSavedQueryValues('channels', query);
|
||||
reloadItems(page);
|
||||
updateFilterControls(page);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('pageinitdepends', "#channelsPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
var tabs = page.querySelector('paper-tabs');
|
||||
var pages = page.querySelector('neon-animated-pages');
|
||||
|
||||
LibraryBrowser.configurePaperLibraryTabs(page, tabs, pages);
|
||||
|
||||
$(tabs).on('iron-select', function () {
|
||||
var selected = this.selected;
|
||||
|
||||
if (LibraryBrowser.navigateOnLibraryTabSelect()) {
|
||||
|
||||
if (selected) {
|
||||
Dashboard.navigate('channels.html?tab=' + selected);
|
||||
} else {
|
||||
Dashboard.navigate('channels.html');
|
||||
}
|
||||
|
||||
} else {
|
||||
page.querySelector('neon-animated-pages').selected = selected;
|
||||
}
|
||||
});
|
||||
|
||||
$(pages).on('tabchange', function () {
|
||||
loadTab(page, parseInt(this.selected));
|
||||
});
|
||||
|
||||
updateFilterControls(this);
|
||||
});
|
||||
|
||||
})(jQuery, document);
|
|
@ -2,12 +2,29 @@
|
|||
|
||||
function reloadItems(page) {
|
||||
|
||||
Sections.loadLatestChannelItems(page.querySelector('.items'), Dashboard.getCurrentUserId());
|
||||
Sections.loadLatestChannelItems(page.querySelector('.latestItems'), Dashboard.getCurrentUserId());
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshowready', "#channelsLatestPage", function () {
|
||||
function loadTab(page, index) {
|
||||
|
||||
reloadItems(this);
|
||||
switch (index) {
|
||||
|
||||
case 0:
|
||||
reloadItems(page);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('pageinitdepends', "#channelsPage", function () {
|
||||
|
||||
var page = this;
|
||||
var pages = page.querySelector('neon-animated-pages');
|
||||
|
||||
$(pages).on('tabchange', function () {
|
||||
loadTab(page, parseInt(this.selected));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -209,7 +209,9 @@
|
|||
function renderHeader(page, item, context) {
|
||||
|
||||
$('.itemTabs', page).hide();
|
||||
$('.channelHeader', page).hide();
|
||||
|
||||
$(page).removeClass('noSecondaryNavPage');
|
||||
|
||||
var elem;
|
||||
|
||||
if (context == 'home') {
|
||||
|
@ -264,7 +266,9 @@
|
|||
}
|
||||
}
|
||||
else if (context == 'channels') {
|
||||
elem = $('.channelTabs', page).show();
|
||||
$(page).addClass('noSecondaryNavPage');
|
||||
LibraryMenu.setBackButtonVisible(true);
|
||||
LibraryMenu.setMenuButtonVisible(false);
|
||||
}
|
||||
else if (item.Type == "MusicAlbum") {
|
||||
$('#albumTabs', page).show();
|
||||
|
@ -279,8 +283,9 @@
|
|||
}
|
||||
|
||||
else if (item.Type == "ChannelVideoItem" || item.Type == "ChannelAudioItem" || item.Type == "ChannelFolderItem") {
|
||||
$('#channelTabs', page).show();
|
||||
$('.channelHeader', page).show().html('<a href="channelitems.html?id=' + item.ChannelId + '">' + item.ChannelName + '</a>').trigger('create');
|
||||
$(page).addClass('noSecondaryNavPage');
|
||||
LibraryMenu.setBackButtonVisible(true);
|
||||
LibraryMenu.setMenuButtonVisible(false);
|
||||
}
|
||||
|
||||
else if (item.Type == "BoxSet") {
|
||||
|
@ -849,7 +854,9 @@
|
|||
playFromHere: true,
|
||||
overlayText: true,
|
||||
lazy: true,
|
||||
showDetailsMenu: true
|
||||
showDetailsMenu: true,
|
||||
overlayPlayButton: AppInfo.enableAppLayouts,
|
||||
fullWidthOnMobile: AppInfo.enableAppLayouts
|
||||
});
|
||||
}
|
||||
else if (item.Type == "GameSystem") {
|
||||
|
|
|
@ -751,11 +751,7 @@
|
|||
|
||||
if (item.CollectionType == 'channels') {
|
||||
|
||||
if (AppInfo.enableLatestChannelItems) {
|
||||
return 'channelslatest.html';
|
||||
} else {
|
||||
return 'channels.html';
|
||||
}
|
||||
return 'channels.html';
|
||||
}
|
||||
|
||||
if (context != 'folders') {
|
||||
|
|
|
@ -548,6 +548,32 @@
|
|||
|
||||
setTitle: function (title) {
|
||||
document.querySelector('.libraryMenuButtonText').innerHTML = title;
|
||||
},
|
||||
|
||||
setBackButtonVisible: function (visible) {
|
||||
|
||||
var backButton = document.querySelector('.headerBackButton');
|
||||
|
||||
if (backButton) {
|
||||
if (visible) {
|
||||
backButton.classList.remove('hide');
|
||||
} else {
|
||||
backButton.classList.add('hide');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
setMenuButtonVisible: function (visible) {
|
||||
|
||||
var mainDrawerButton = document.querySelector('.mainDrawerButton');
|
||||
|
||||
if (mainDrawerButton) {
|
||||
if (!visible && $.browser.mobile) {
|
||||
mainDrawerButton.classList.add('hide');
|
||||
} else {
|
||||
mainDrawerButton.classList.remove('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -407,10 +407,10 @@
|
|||
if (self.supportsTextTracks()) {
|
||||
|
||||
if (isVlc) {
|
||||
profile.SubtitleProfiles.push({
|
||||
Format: 'srt',
|
||||
Method: 'External'
|
||||
});
|
||||
//profile.SubtitleProfiles.push({
|
||||
// Format: 'srt',
|
||||
// Method: 'External'
|
||||
//});
|
||||
profile.SubtitleProfiles.push({
|
||||
Format: 'srt',
|
||||
Method: 'Embed'
|
||||
|
@ -427,6 +427,10 @@
|
|||
Format: 'pgs',
|
||||
Method: 'Embed'
|
||||
});
|
||||
profile.SubtitleProfiles.push({
|
||||
Format: 'vtt',
|
||||
Method: 'Embed'
|
||||
});
|
||||
} else {
|
||||
profile.SubtitleProfiles.push({
|
||||
Format: 'vtt',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue