From a5579327cccdbeee194af269ba82a634afc112c9 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 18 Jul 2015 14:07:03 -0400 Subject: [PATCH] replace channel tabs --- dashboard-ui/channelitems.html | 11 +------ dashboard-ui/channels.html | 33 +++++++++++++++---- dashboard-ui/channelslatest.html | 21 ------------ dashboard-ui/css/card.css | 13 ++++++-- dashboard-ui/itemdetails.html | 15 --------- dashboard-ui/scripts/channelitems.js | 6 ++-- dashboard-ui/scripts/channels.js | 44 +++++++++++++++++++++++--- dashboard-ui/scripts/channelslatest.js | 23 ++++++++++++-- dashboard-ui/scripts/itemdetailpage.js | 17 +++++++--- dashboard-ui/scripts/librarybrowser.js | 6 +--- dashboard-ui/scripts/librarymenu.js | 26 +++++++++++++++ dashboard-ui/scripts/mediaplayer.js | 12 ++++--- 12 files changed, 146 insertions(+), 81 deletions(-) delete mode 100644 dashboard-ui/channelslatest.html diff --git a/dashboard-ui/channelitems.html b/dashboard-ui/channelitems.html index afa4493b2..a127ce9a6 100644 --- a/dashboard-ui/channelitems.html +++ b/dashboard-ui/channelitems.html @@ -4,20 +4,11 @@ Emby -
- - - -
+
-

-
diff --git a/dashboard-ui/channels.html b/dashboard-ui/channels.html index 200d8f203..87d8a023e 100644 --- a/dashboard-ui/channels.html +++ b/dashboard-ui/channels.html @@ -4,17 +4,36 @@ Emby -
+
-
- ${TabLatest} - ${TabChannels} +
+ + ${TabLatest} + ${TabChannels} + + +
+
+ + +
+
+
+
+ +
+
+
+
+
+
+
-
-
-
diff --git a/dashboard-ui/channelslatest.html b/dashboard-ui/channelslatest.html deleted file mode 100644 index 25d16ec21..000000000 --- a/dashboard-ui/channelslatest.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - Emby - - -
- - - -
-
-
-
-
-
- - diff --git a/dashboard-ui/css/card.css b/dashboard-ui/css/card.css index 82431844c..16e413b3b 100644 --- a/dashboard-ui/css/card.css +++ b/dashboard-ui/css/card.css @@ -341,7 +341,7 @@ } .overflowBackdropCard { - width: 70%; + width: 80%; } .cardProgress { @@ -358,7 +358,7 @@ width: 42%; } -@media all and (max-width: 500px) { +@media all and (max-width: 480px) { .backdropCard.fullWidthCardOnMobile { width: 100% !important; @@ -566,13 +566,20 @@ width: 50%; } -@media all and (min-width: 540px) { +@media all and (min-width: 700px) { .detailPage169Card { width: 33.3%; } } +@media all and (max-width: 480px) { + + .detailPage169Card.fullWidthCardOnMobile { + width: 100% !important; + } +} + /** detailPagePortrait */ .detailPagePortraitCard .cardPadder { diff --git a/dashboard-ui/itemdetails.html b/dashboard-ui/itemdetails.html index 6b054453c..4d9c32b86 100644 --- a/dashboard-ui/itemdetails.html +++ b/dashboard-ui/itemdetails.html @@ -15,13 +15,6 @@
- - - - -
diff --git a/dashboard-ui/scripts/channelitems.js b/dashboard-ui/scripts/channelitems.js index 0eee03b3d..ea69e6d25 100644 --- a/dashboard-ui/scripts/channelitems.js +++ b/dashboard-ui/scripts/channelitems.js @@ -106,16 +106,14 @@ ApiClient.getItem(query.UserId, folderId).done(function (item) { - $('.categoryTitle', page).show().html(item.Name); - $('.channelHeader', page).show().html('' + item.ChannelName + '').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('' + item.Name + ''); + LibraryMenu.setTitle(item.Name); }); } diff --git a/dashboard-ui/scripts/channels.js b/dashboard-ui/scripts/channels.js index aee1be30b..5ad8de4a0 100644 --- a/dashboard-ui/scripts/channels.js +++ b/dashboard-ui/scripts/channels.js @@ -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); \ No newline at end of file diff --git a/dashboard-ui/scripts/channelslatest.js b/dashboard-ui/scripts/channelslatest.js index af00880b7..68a7ece87 100644 --- a/dashboard-ui/scripts/channelslatest.js +++ b/dashboard-ui/scripts/channelslatest.js @@ -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)); + }); }); diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index b4dc8393d..e80d94259 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -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('' + item.ChannelName + '').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") { diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index cc8843ef1..5711c9fcc 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -751,11 +751,7 @@ if (item.CollectionType == 'channels') { - if (AppInfo.enableLatestChannelItems) { - return 'channelslatest.html'; - } else { - return 'channels.html'; - } + return 'channels.html'; } if (context != 'folders') { diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js index f556d9bb0..f6f232e16 100644 --- a/dashboard-ui/scripts/librarymenu.js +++ b/dashboard-ui/scripts/librarymenu.js @@ -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'); + } + } } }; diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index d6362faa3..65ba9f536 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -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',