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

fix anonymous pages

This commit is contained in:
Luke Pulverenti 2016-03-17 01:04:32 -04:00
parent b53f6c1d3f
commit d004fd3960
6 changed files with 293 additions and 200 deletions

View file

@ -1,4 +1,4 @@
define(['libraryBrowser'], function (LibraryBrowser) {
define(['libraryBrowser'], function (libraryBrowser) {
var defaultFirstSection = 'smalllibrarytiles';
@ -212,7 +212,7 @@
function loadHomeTab(page, tabContent) {
if (LibraryBrowser.needsRefresh(tabContent)) {
if (libraryBrowser.needsRefresh(tabContent)) {
if (window.ApiClient) {
var userId = Dashboard.getCurrentUserId();
Dashboard.showLoadingMsg();
@ -228,7 +228,7 @@
}
Dashboard.hideLoadingMsg();
LibraryBrowser.setLastRefreshed(tabContent);
libraryBrowser.setLastRefreshed(tabContent);
});
});
@ -297,7 +297,7 @@
var pages = view.querySelector('neon-animated-pages');
LibraryBrowser.configurePaperLibraryTabs(view, view.querySelector('paper-tabs'), pages, 'home.html');
libraryBrowser.configurePaperLibraryTabs(view, view.querySelector('paper-tabs'), pages, 'home.html');
pages.addEventListener('tabchange', function (e) {
loadTab(view, parseInt(e.target.selected));
@ -322,5 +322,5 @@
view.addEventListener('viewbeforehide', function (e) {
Events.off(MediaController, 'playbackstop', onPlaybackStop);
});
}
};
});

View file

@ -1,4 +1,4 @@
define(['playlistManager', 'appSettings', 'appStorage', 'jQuery'], function (playlistManager, appSettings, appStorage, $) {
define(['playlistManager', 'appSettings', 'appStorage'], function (playlistManager, appSettings, appStorage) {
var libraryBrowser = (function (window, document, screen) {
@ -310,6 +310,7 @@
tabs.noink = true;
}
var libraryViewNav = ownerpage.querySelector('.libraryViewNav');
if (LibraryBrowser.enableFullPaperTabs()) {
if (browserInfo.safari) {
@ -319,22 +320,36 @@
LibraryBrowser.configureSwipeTabs(ownerpage, tabs, pages);
}
$('.libraryViewNav', ownerpage).addClass('paperLibraryViewNav').removeClass('libraryViewNavWithMinHeight');
if (libraryViewNav) {
libraryViewNav.classList.add('paperLibraryViewNav');
libraryViewNav.classList.remove('libraryViewNavWithMinHeight');
}
} else {
tabs.noSlide = true;
tabs.noBar = true;
var legacyTabs = $('.legacyTabs', ownerpage);
var legacyTabs = ownerpage.querySelector('.legacyTabs');
if (legacyTabs) {
pages.addEventListener('iron-select', function (e) {
var selected = pages.selected;
$('a', legacyTabs).removeClass('ui-btn-active')[selected].classList.add('ui-btn-active');
var anchors = legacyTabs.querySelectorAll('a');
for (var i = 0, length = anchors.length; i < length; i++) {
if (i == selected) {
anchors[i].classList.add('ui-btn-active');
} else {
anchors[i].classList.remove('ui-btn-active');
}
}
});
}
$('.libraryViewNav', ownerpage).removeClass('libraryViewNavWithMinHeight');
if (libraryViewNav) {
libraryViewNav.classList.remove('libraryViewNavWithMinHeight');
}
}
ownerpage.addEventListener('viewbeforeshow', LibraryBrowser.onTabbedpagebeforeshow);
@ -460,6 +475,8 @@
}
var afterNavigate = function () {
document.removeEventListener('pagebeforeshow', afterNavigate);
if (window.location.href.toLowerCase().indexOf(url.toLowerCase()) != -1) {
var pages = this.querySelector('neon-animated-pages');
@ -494,7 +511,7 @@
afterNavigate.call($.mobile.activePage);
} else {
$(document).one('pagebeforeshow', '.page', afterNavigate);
pageClassOn('pagebeforeshow', 'page', afterNavigate);
Dashboard.navigate(url);
}
},
@ -1662,19 +1679,48 @@
return itemCommands;
},
screenWidth: function () {
var screenWidth = $(window).width();
return screenWidth;
},
shapes: ['square', 'portrait', 'banner', 'smallBackdrop', 'homePageSmallBackdrop', 'backdrop', 'overflowBackdrop', 'overflowPortrait', 'overflowSquare'],
getPostersPerRow: function (screenWidth) {
var cache = true;
function getValue(shape) {
switch (shape) {
case 'portrait':
if (screenWidth >= 2200) return 10;
if (screenWidth >= 2100) return 9;
if (screenWidth >= 1600) return 8;
if (screenWidth >= 1400) return 7;
if (screenWidth >= 1200) return 6;
if (screenWidth >= 800) return 5;
if (screenWidth >= 640) return 4;
return 3;
case 'square':
if (screenWidth >= 2100) return 9;
if (screenWidth >= 1800) return 8;
if (screenWidth >= 1400) return 7;
if (screenWidth >= 1200) return 6;
if (screenWidth >= 900) return 5;
if (screenWidth >= 700) return 4;
if (screenWidth >= 500) return 3;
return 2;
case 'banner':
if (screenWidth >= 2200) return 4;
if (screenWidth >= 1200) return 3;
if (screenWidth >= 800) return 2;
return 1;
case 'backdrop':
if (screenWidth >= 2500) return 6;
if (screenWidth >= 2100) return 5;
if (screenWidth >= 1200) return 4;
if (screenWidth >= 770) return 3;
if (screenWidth >= 420) return 2;
return 1;
default:
break;
}
var div = $('<div class="card ' + shape + 'Card"><div class="cardBox"><div class="cardImage"></div></div></div>').appendTo(document.body);
var innerWidth = $('.cardImage', div).innerWidth();
@ -1702,7 +1748,7 @@
getPosterViewInfo: function () {
var screenWidth = LibraryBrowser.screenWidth();
var screenWidth = window.innerWidth;
var cachedResults = LibraryBrowser.posterSizes;
@ -2762,11 +2808,10 @@
html = Globalize.translate('ValueLinks', html);
linksElem.innerHTML = html;
$(linksElem);
$(linksElem).show();
linksElem.classList.remove('hide');
} else {
$(linksElem).hide();
linksElem.classList.add('hide');
}
},
@ -2797,7 +2842,10 @@
positionTo: button,
callback: function (id) {
// TODO: remove jQuery
require(['jQuery'], function ($) {
$(button).trigger('layoutchange', [id]);
});
}
});
@ -3102,6 +3150,8 @@
markFavorite: function (link) {
// TODO: remove jQuery
require(['jQuery'], function ($) {
var id = link.getAttribute('data-itemid');
var $link = $(link);
@ -3115,10 +3165,13 @@
} else {
$link.removeClass('btnUserItemRatingOn');
}
});
},
markLike: function (link) {
// TODO: remove jQuery
require(['jQuery'], function ($) {
var id = link.getAttribute('data-itemid');
var $link = $(link);
@ -3137,10 +3190,13 @@
}
$link.prev().removeClass('btnUserItemRatingOn');
});
},
markDislike: function (link) {
// TODO: remove jQuery
require(['jQuery'], function($) {
var id = link.getAttribute('data-itemid');
var $link = $(link);
@ -3159,6 +3215,7 @@
}
$link.next().removeClass('btnUserItemRatingOn');
});
},
renderDetailImage: function (elem, item, editable, preferThumb) {
@ -3548,25 +3605,26 @@
renderOverview: function (elems, item) {
$(elems).each(function () {
var elem = this;
for (var i = 0, length = elems.length; i < length; i++) {
var elem = elems[i];
var overview = item.Overview || '';
$('a', elem).each(function () {
this.setAttribute("target", "_blank");
});
if (overview) {
elem.innerHTML = overview;
elem.classList.remove('empty');
var anchors = elem.querySelectorAll('a');
for (var j = 0, length2 = anchors.length; j < length2; j++) {
anchors[j].setAttribute("target", "_blank");
}
} else {
elem.innerHTML = '';
elem.classList.add('empty');
}
});
}
},
renderStudios: function (elem, item, isStatic) {
@ -3665,6 +3723,8 @@
var imgUrl;
var hasbackdrop = false;
var itemBackdropElement = page.querySelector('#itemBackdrop');
if (item.BackdropImageTags && item.BackdropImageTags.length) {
imgUrl = ApiClient.getScaledImageUrl(item.Id, {
@ -3674,7 +3734,9 @@
tag: item.BackdropImageTags[0]
});
ImageLoader.lazyImage($('#itemBackdrop', page).addClass('noFade').removeClass('noBackdrop')[0], imgUrl);
itemBackdropElement.classList.add('noFade');
itemBackdropElement.classList.remove('noBackdrop');
ImageLoader.lazyImage(itemBackdropElement, imgUrl);
hasbackdrop = true;
}
else if (item.ParentBackdropItemId && item.ParentBackdropImageTags && item.ParentBackdropImageTags.length) {
@ -3686,12 +3748,15 @@
maxWidth: screenWidth
});
ImageLoader.lazyImage($('#itemBackdrop', page).addClass('noFade').removeClass('noBackdrop')[0], imgUrl);
itemBackdropElement.classList.add('noFade');
itemBackdropElement.classList.remove('noBackdrop');
ImageLoader.lazyImage(itemBackdropElement, imgUrl);
hasbackdrop = true;
}
else {
$('#itemBackdrop', page).addClass('noBackdrop').css('background-image', 'none');
itemBackdropElement.classList.add('noBackdrop');
itemBackdropElement.style.backgroundImage = '';
}
return hasbackdrop;

View file

@ -1541,10 +1541,6 @@ var AppInfo = {};
defineConnectionManager(window.ConnectionManager);
bindConnectionManagerEvents(window.ConnectionManager, Events);
if (window.location.href.toLowerCase().indexOf('wizardstart.html') != -1) {
window.ConnectionManager.clearData();
}
console.log('binding to apiclientcreated');
Events.on(ConnectionManager, 'apiclientcreated', onApiClientCreated);
@ -1565,6 +1561,7 @@ var AppInfo = {};
ConnectionManager.addApiClient(apiClient);
Dashboard.importCss(apiClient.getUrl('Branding/Css'));
window.ApiClient = apiClient;
localApiClient = apiClient;
console.log('loaded ApiClient singleton');
});
}
@ -2210,42 +2207,49 @@ var AppInfo = {};
path: '/about.html',
dependencies: ['jQuery'],
autoFocus: false,
controller: 'scripts/aboutpage'
controller: 'scripts/aboutpage',
roles: 'admin'
});
defineRoute({
path: '/addplugin.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/advanced.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/appservices.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/autoorganizelog.html',
dependencies: ['jQuery']
dependencies: ['jQuery'],
roles: 'admin'
});
defineRoute({
path: '/autoorganizesmart.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/autoorganizetv.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2263,13 +2267,15 @@ var AppInfo = {};
defineRoute({
path: '/channelsettings.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/cinemamodeconfiguration.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2288,61 +2294,71 @@ var AppInfo = {};
defineRoute({
path: '/dashboard.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/dashboardgeneral.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/dashboardhosting.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/device.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/devices.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/devicesupload.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/dlnaprofile.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/dlnaprofiles.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/dlnaserversettings.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/dlnasettings.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2354,7 +2370,8 @@ var AppInfo = {};
defineRoute({
path: '/encodingsettings.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2441,19 +2458,22 @@ var AppInfo = {};
defineRoute({
path: '/library.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/librarypathmapping.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/librarysettings.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2465,7 +2485,8 @@ var AppInfo = {};
defineRoute({
path: '/livetvguideprovider.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2495,7 +2516,8 @@ var AppInfo = {};
defineRoute({
path: '/livetvstatus.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2507,25 +2529,29 @@ var AppInfo = {};
defineRoute({
path: '/livetvtunerprovider-hdhomerun.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/livetvtunerprovider-m3u.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/livetvtunerprovider-satip.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/log.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2538,31 +2564,36 @@ var AppInfo = {};
defineRoute({
path: '/metadata.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/metadataadvanced.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/metadataimages.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/metadatanfo.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/metadatasubtitles.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2634,13 +2665,15 @@ var AppInfo = {};
defineRoute({
path: '/notificationsetting.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/notificationsettings.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2658,7 +2691,8 @@ var AppInfo = {};
defineRoute({
path: '/playbackconfiguration.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2670,13 +2704,15 @@ var AppInfo = {};
defineRoute({
path: '/plugincatalog.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/plugins.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2688,13 +2724,15 @@ var AppInfo = {};
defineRoute({
path: '/scheduledtask.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/scheduledtasks.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2719,7 +2757,8 @@ var AppInfo = {};
defineRoute({
path: '/serversecurity.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2732,19 +2771,22 @@ var AppInfo = {};
defineRoute({
path: '/streamingsettings.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/support.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/supporterkey.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2767,32 +2809,37 @@ var AppInfo = {};
defineRoute({
path: '/tv.html',
dependencies: ['jQuery'],
autoFocus: false
dependencies: ['paper-tabs', 'neon-animated-pages', 'paper-checkbox'],
autoFocus: false,
controller: 'scripts/tvrecommended'
});
defineRoute({
path: '/useredit.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/userlibraryaccess.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/usernew.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
path: '/userparentalcontrol.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2804,7 +2851,8 @@ var AppInfo = {};
defineRoute({
path: '/userprofiles.html',
dependencies: ['jQuery'],
autoFocus: false
autoFocus: false,
roles: 'admin'
});
defineRoute({
@ -2875,7 +2923,8 @@ var AppInfo = {};
dependencies: ['jQuery'],
autoFocus: false,
enableCache: false,
enableContentQueryString: true
enableContentQueryString: true,
roles: 'admin'
});
defineRoute({
@ -3241,18 +3290,9 @@ pageClassOn('viewshow', "page", function () {
if (apiClient && apiClient.isLoggedIn()) {
var isSettingsPage = page.classList.contains('type-interior');
if (isSettingsPage) {
if (page.classList.contains('type-interior')) {
Dashboard.ensureToolsMenu(page);
Dashboard.getCurrentUser().then(function (user) {
if (!user.Policy.IsAdministrator) {
Dashboard.logout();
}
});
}
}

View file

@ -1,4 +1,4 @@
(function ($, document) {
define(['libraryBrowser', 'scripts/alphapicker'], function (libraryBrowser) {
function getView() {
@ -14,16 +14,7 @@
Dashboard.showLoadingMsg();
if (LibraryMenu.getTopParentId()) {
$('.scopedContent', page).show();
loadResume(page);
} else {
$('.scopedContent', page).hide();
}
loadNextUp(page);
}
@ -47,9 +38,9 @@
ApiClient.getNextUpEpisodes(query).then(function (result) {
if (result.Items.length) {
$('.noNextUpItems', page).hide();
page.querySelector('.noNextUpItems').classList.add('hide');
} else {
$('.noNextUpItems', page).show();
page.querySelector('.noNextUpItems').classList.remove('hide');
}
var view = getView();
@ -57,7 +48,7 @@
if (view == 'ThumbCard') {
html += LibraryBrowser.getPosterViewHtml({
html += libraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "backdrop",
showTitle: true,
@ -70,7 +61,7 @@
} else if (view == 'Thumb') {
html += LibraryBrowser.getPosterViewHtml({
html += libraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "backdrop",
showTitle: true,
@ -89,7 +80,7 @@
ImageLoader.lazyChildren(elem);
Dashboard.hideLoadingMsg();
LibraryBrowser.setLastRefreshed(page);
libraryBrowser.setLastRefreshed(page);
});
}
@ -125,9 +116,9 @@
ApiClient.getItems(Dashboard.getCurrentUserId(), options).then(function (result) {
if (result.Items.length) {
$('#resumableSection', page).show();
page.querySelector('#resumableSection').classList.remove('hide');
} else {
$('#resumableSection', page).hide();
page.querySelector('#resumableSection').classList.add('hide');
}
var view = getResumeView();
@ -135,7 +126,7 @@
if (view == 'PosterCard') {
html += LibraryBrowser.getPosterViewHtml({
html += libraryBrowser.getPosterViewHtml({
items: result.Items,
shape: getThumbShape(),
showTitle: true,
@ -148,7 +139,7 @@
} else if (view == 'Poster') {
html += LibraryBrowser.getPosterViewHtml({
html += libraryBrowser.getPosterViewHtml({
items: result.Items,
shape: getThumbShape(),
showTitle: true,
@ -174,12 +165,12 @@
} else {
tabContent.querySelector('#resumableItems').classList.remove('hiddenScrollX');
}
$(tabContent.querySelector('#resumableItems')).createCardMenus();
libraryBrowser.createCardMenus(tabContent.querySelector('#resumableItems'));
}
function loadSuggestionsTab(page, tabContent) {
if (LibraryBrowser.needsRefresh(tabContent)) {
if (libraryBrowser.needsRefresh(tabContent)) {
reload(tabContent);
}
}
@ -245,15 +236,21 @@
window.TvPage.renderSuggestedTab = loadSuggestionsTab;
window.TvPage.initSuggestedTab = initSuggestedTab;
pageIdOn('pageinit', "tvRecommendedPage", function () {
function onPlaybackStop(e, state) {
var page = this;
$('.recommendations', page).createCardMenus();
var tabs = page.querySelector('paper-tabs');
if (state.NowPlayingItem && state.NowPlayingItem.MediaType == 'Video') {
var page = $.mobile.activePage;
var pages = page.querySelector('neon-animated-pages');
pages.dispatchEvent(new CustomEvent("tabchange", {}));
}
}
return function (view, params) {
var tabs = view.querySelector('paper-tabs');
var pages = view.querySelector('neon-animated-pages');
var baseUrl = 'tv.html';
var topParentId = LibraryMenu.getTopParentId();
if (topParentId) {
@ -261,20 +258,19 @@
}
if (enableScrollX()) {
page.querySelector('#resumableItems').classList.add('hiddenScrollX');
view.querySelector('#resumableItems').classList.add('hiddenScrollX');
} else {
page.querySelector('#resumableItems').classList.remove('hiddenScrollX');
view.querySelector('#resumableItems').classList.remove('hiddenScrollX');
}
$(page.querySelector('#resumableItems')).createCardMenus();
libraryBrowser.createCardMenus(view.querySelector('#resumableItems'));
LibraryBrowser.configurePaperLibraryTabs(page, tabs, pages, baseUrl);
libraryBrowser.configurePaperLibraryTabs(view, tabs, pages, baseUrl);
pages.addEventListener('tabchange', function (e) {
loadTab(page, parseInt(this.selected));
});
loadTab(view, parseInt(this.selected));
});
pageIdOn('pagebeforeshow', "tvRecommendedPage", function () {
view.addEventListener('viewbeforeshow', function (e) {
var page = this;
@ -300,21 +296,10 @@
Events.on(MediaController, 'playbackstop', onPlaybackStop);
});
pageIdOn('pagebeforehide', "tvRecommendedPage", function () {
view.addEventListener('viewbeforehide', function (e) {
var page = this;
Events.off(MediaController, 'playbackstop', onPlaybackStop);
});
function onPlaybackStop(e, state) {
if (state.NowPlayingItem && state.NowPlayingItem.MediaType == 'Video') {
var page = $($.mobile.activePage)[0];
var pages = page.querySelector('neon-animated-pages');
pages.dispatchEvent(new CustomEvent("tabchange", {}));
}
}
})(jQuery, document);
};
});

View file

@ -46,6 +46,9 @@
$('.wizardStartForm').off('submit', onSubmit).on('submit', onSubmit);
window.ConnectionManager.clearData();
}).on('pageshow', "#wizardStartPage", function () {
Dashboard.showLoadingMsg();

View file

@ -1,4 +1,4 @@
<div id="tvRecommendedPage" data-dom-cache="true" data-role="page" class="page libraryPage backdropPage pageWithAbsoluteTabs" data-backdroptype="series" data-require="scripts/tvrecommended,paper-tabs,neon-animated-pages,paper-checkbox,scripts/alphapicker">
<div id="tvRecommendedPage" data-dom-cache="true" data-role="page" class="page libraryPage backdropPage pageWithAbsoluteTabs" data-backdroptype="series">
<div class="libraryViewNav libraryViewNavWithMinHeight">
<paper-tabs hidescrollbuttons noink>
@ -25,7 +25,7 @@
<neon-animated-pages>
<neon-animatable>
<div class="pageTabContent" data-index="0">
<div id="resumableSection" style="display: none;" class="scopedContent homePageSection">
<div id="resumableSection" class="homePageSection">
<div>
<h1 class="listHeader" style="display: inline-block; vertical-align: middle;">${HeaderResume}</h1>
<paper-button raised class="submit mini categorySyncButton" data-category="Resume"><iron-icon icon="sync"></iron-icon><span>${ButtonSync}</span></paper-button>