diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-tabs/emby-tabs.js b/dashboard-ui/bower_components/emby-webcomponents/emby-tabs/emby-tabs.js index ac3bc542cc..5758200373 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-tabs/emby-tabs.js +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-tabs/emby-tabs.js @@ -1 +1 @@ -define(["dom","scroller","browser","layoutManager","focusManager","registerElement","css!./emby-tabs","scrollStyles"],function(dom,scroller,browser,layoutManager,focusManager){"use strict";function setActiveTabButton(tabs,newButton,oldButton,animate){newButton.classList.add(activeButtonClass)}function getFocusCallback(tabs,e){return function(){onClick.call(tabs,e)}}function onFocus(e){layoutManager.tv&&(this.focusTimeout&&clearTimeout(this.focusTimeout),this.focusTimeout=setTimeout(getFocusCallback(this,e),700))}function getTabPanel(tabs,index){var tabsContainer=dom.parentWithClass(tabs,"tabs-container");if(tabsContainer)return tabsContainer.querySelector('.tabContent[data-index="'+index+'"]')}function removeActivePanelClass(tabs,index){var tabPanel=getTabPanel(tabs,index);tabPanel&&tabPanel.classList.remove("is-active")}function fadeInRight(elem){var pct=browser.mobile?"4%":"0.5%",keyframes=[{opacity:"0",transform:"translate3d("+pct+", 0, 0)",offset:0},{opacity:"1",transform:"none",offset:1}];elem.animate(keyframes,{duration:160,iterations:1,easing:"ease-out"})}function triggerBeforeTabChange(tabs,index,previousIndex){tabs.dispatchEvent(new CustomEvent("beforetabchange",{detail:{selectedTabIndex:index,previousIndex:previousIndex}})),null!=previousIndex&&previousIndex!==index&&removeActivePanelClass(tabs,previousIndex);var newPanel=getTabPanel(tabs,index);newPanel&&(newPanel.animate&&fadeInRight(newPanel),newPanel.classList.add("is-active"))}function onClick(e){this.focusTimeout&&clearTimeout(this.focusTimeout);var tabs=this,current=tabs.querySelector("."+activeButtonClass),tabButton=dom.parentWithClass(e.target,buttonClass);if(tabButton&&tabButton!==current){current&¤t.classList.remove(activeButtonClass);var previousIndex=current?parseInt(current.getAttribute("data-index")):null;setActiveTabButton(tabs,tabButton,current,!0);var index=parseInt(tabButton.getAttribute("data-index"));triggerBeforeTabChange(tabs,index,previousIndex),setTimeout(function(){tabs.selectedTabIndex=index,tabs.dispatchEvent(new CustomEvent("tabchange",{detail:{selectedTabIndex:index,previousIndex:previousIndex}}))},120),tabs.scroller&&tabs.scroller.toCenter(tabButton,!1)}}function initScroller(tabs){if(!tabs.scroller){var contentScrollSlider=tabs.querySelector(".emby-tabs-slider");contentScrollSlider?(tabs.scroller=new scroller(tabs,{horizontal:1,itemNav:0,mouseDragging:1,touchDragging:1,slidee:contentScrollSlider,smart:!0,releaseSwing:!0,scrollBy:200,speed:120,elasticBounds:1,dragHandle:1,dynamicHandle:1,clickBar:1,hiddenScroll:!0,requireAnimation:!browser.safari}),tabs.scroller.init()):tabs.classList.add("hiddenScrollX")}}var EmbyTabs=Object.create(HTMLDivElement.prototype),buttonClass="emby-tab-button",activeButtonClass=buttonClass+"-active";EmbyTabs.createdCallback=function(){this.classList.contains("emby-tabs")||(this.classList.add("emby-tabs"),this.classList.add("focusable"),dom.addEventListener(this,"click",onClick,{passive:!0}),dom.addEventListener(this,"focus",onFocus,{passive:!0,capture:!0}),this.dispatchEvent(new CustomEvent("ready",{})))},EmbyTabs.focus=function(){var selected=this.querySelector("."+activeButtonClass);selected?focusManager.focus(selected):focusManager.autoFocus(this)},EmbyTabs.refresh=function(){this.scroller&&this.scroller.reload()},EmbyTabs.attachedCallback=function(){initScroller(this);var current=this.querySelector("."+activeButtonClass),currentIndex=current?parseInt(current.getAttribute("data-index")):parseInt(this.getAttribute("data-index")||"1");if(currentIndex!==-1){this.selectedTabIndex=currentIndex;var tabButtons=this.querySelectorAll("."+buttonClass),newTabButton=tabButtons[currentIndex];newTabButton&&setActiveTabButton(this,newTabButton,current,!1)}},EmbyTabs.detachedCallback=function(){this.scroller&&(this.scroller.destroy(),this.scroller=null),dom.removeEventListener(this,"click",onClick,{passive:!0}),dom.removeEventListener(this,"focus",onFocus,{passive:!0,capture:!0})},EmbyTabs.selectedIndex=function(selected,triggerEvent){var tabs=this;if(null==selected)return tabs.selectedTabIndex||0;var current=tabs.selectedIndex();tabs.selectedTabIndex=selected;var tabButtons=tabs.querySelectorAll("."+buttonClass);if(current===selected||triggerEvent===!1){triggerBeforeTabChange(tabs,selected,current),tabs.dispatchEvent(new CustomEvent("tabchange",{detail:{selectedTabIndex:selected}}));var currentTabButton=tabButtons[current];setActiveTabButton(tabs,tabButtons[selected],currentTabButton,!1),current!==selected&¤tTabButton&¤tTabButton.classList.remove(activeButtonClass)}else onClick.call(tabs,{target:tabButtons[selected]})},EmbyTabs.triggerBeforeTabChange=function(selected){var tabs=this;triggerBeforeTabChange(tabs,tabs.selectedIndex())},EmbyTabs.triggerTabChange=function(selected){var tabs=this;tabs.dispatchEvent(new CustomEvent("tabchange",{detail:{selectedTabIndex:tabs.selectedIndex()}}))},document.registerElement("emby-tabs",{prototype:EmbyTabs,extends:"div"})}); \ No newline at end of file +define(["dom","scroller","browser","layoutManager","focusManager","registerElement","css!./emby-tabs","scrollStyles"],function(dom,scroller,browser,layoutManager,focusManager){"use strict";function setActiveTabButton(tabs,newButton,oldButton,animate){newButton.classList.add(activeButtonClass)}function getFocusCallback(tabs,e){return function(){onClick.call(tabs,e)}}function onFocus(e){layoutManager.tv&&(this.focusTimeout&&clearTimeout(this.focusTimeout),this.focusTimeout=setTimeout(getFocusCallback(this,e),700))}function getTabPanel(tabs,index){var tabsContainer=dom.parentWithClass(tabs,"tabs-container");if(tabsContainer)return tabsContainer.querySelector('.tabContent[data-index="'+index+'"]')}function removeActivePanelClass(tabs,index){var tabPanel=getTabPanel(tabs,index);tabPanel&&tabPanel.classList.remove("is-active")}function fadeInRight(elem){var pct=browser.mobile?"4%":"0.5%",keyframes=[{opacity:"0",transform:"translate3d("+pct+", 0, 0)",offset:0},{opacity:"1",transform:"none",offset:1}];elem.animate(keyframes,{duration:160,iterations:1,easing:"ease-out"})}function triggerBeforeTabChange(tabs,index,previousIndex){tabs.dispatchEvent(new CustomEvent("beforetabchange",{detail:{selectedTabIndex:index,previousIndex:previousIndex}})),null!=previousIndex&&previousIndex!==index&&removeActivePanelClass(tabs,previousIndex);var newPanel=getTabPanel(tabs,index);newPanel&&(newPanel.animate&&fadeInRight(newPanel),newPanel.classList.add("is-active"))}function onClick(e){this.focusTimeout&&clearTimeout(this.focusTimeout);var tabs=this,current=tabs.querySelector("."+activeButtonClass),tabButton=dom.parentWithClass(e.target,buttonClass);if(tabButton&&tabButton!==current){current&¤t.classList.remove(activeButtonClass);var previousIndex=current?parseInt(current.getAttribute("data-index")):null;setActiveTabButton(tabs,tabButton,current,!0);var index=parseInt(tabButton.getAttribute("data-index"));triggerBeforeTabChange(tabs,index,previousIndex),setTimeout(function(){tabs.selectedTabIndex=index,tabs.dispatchEvent(new CustomEvent("tabchange",{detail:{selectedTabIndex:index,previousIndex:previousIndex}}))},120),tabs.scroller&&tabs.scroller.toCenter(tabButton,!1)}}function initScroller(tabs){if(!tabs.scroller){var contentScrollSlider=tabs.querySelector(".emby-tabs-slider");contentScrollSlider?(tabs.scroller=new scroller(tabs,{horizontal:1,itemNav:0,mouseDragging:1,touchDragging:1,slidee:contentScrollSlider,smart:!0,releaseSwing:!0,scrollBy:200,speed:120,elasticBounds:1,dragHandle:1,dynamicHandle:1,clickBar:1,hiddenScroll:!0,requireAnimation:!browser.safari}),tabs.scroller.init()):tabs.classList.add("hiddenScrollX")}}var EmbyTabs=Object.create(HTMLDivElement.prototype),buttonClass="emby-tab-button",activeButtonClass=buttonClass+"-active";EmbyTabs.createdCallback=function(){this.classList.contains("emby-tabs")||(this.classList.add("emby-tabs"),this.classList.add("focusable"),dom.addEventListener(this,"click",onClick,{passive:!0}),dom.addEventListener(this,"focus",onFocus,{passive:!0,capture:!0}))},EmbyTabs.focus=function(){var selected=this.querySelector("."+activeButtonClass);selected?focusManager.focus(selected):focusManager.autoFocus(this)},EmbyTabs.refresh=function(){this.scroller&&this.scroller.reload()},EmbyTabs.attachedCallback=function(){initScroller(this);var current=this.querySelector("."+activeButtonClass),currentIndex=current?parseInt(current.getAttribute("data-index")):parseInt(this.getAttribute("data-index")||"0");if(currentIndex!==-1){this.selectedTabIndex=currentIndex;var tabButtons=this.querySelectorAll("."+buttonClass),newTabButton=tabButtons[currentIndex];newTabButton&&setActiveTabButton(this,newTabButton,current,!1)}this.readyFired||(this.readyFired=!0,this.dispatchEvent(new CustomEvent("ready",{})))},EmbyTabs.detachedCallback=function(){this.scroller&&(this.scroller.destroy(),this.scroller=null),dom.removeEventListener(this,"click",onClick,{passive:!0}),dom.removeEventListener(this,"focus",onFocus,{passive:!0,capture:!0})},EmbyTabs.selectedIndex=function(selected,triggerEvent){var tabs=this;if(null==selected)return tabs.selectedTabIndex||0;var current=tabs.selectedIndex();tabs.selectedTabIndex=selected;var tabButtons=tabs.querySelectorAll("."+buttonClass);if(current===selected||triggerEvent===!1){triggerBeforeTabChange(tabs,selected,current),tabs.dispatchEvent(new CustomEvent("tabchange",{detail:{selectedTabIndex:selected}}));var currentTabButton=tabButtons[current];setActiveTabButton(tabs,tabButtons[selected],currentTabButton,!1),current!==selected&¤tTabButton&¤tTabButton.classList.remove(activeButtonClass)}else onClick.call(tabs,{target:tabButtons[selected]})},EmbyTabs.triggerBeforeTabChange=function(selected){var tabs=this;triggerBeforeTabChange(tabs,tabs.selectedIndex())},EmbyTabs.triggerTabChange=function(selected){var tabs=this;tabs.dispatchEvent(new CustomEvent("tabchange",{detail:{selectedTabIndex:tabs.selectedIndex()}}))},document.registerElement("emby-tabs",{prototype:EmbyTabs,extends:"div"})}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.js b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.js index d849cce9d5..b49fb83884 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.js +++ b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.js @@ -1 +1 @@ -define(["globalize","connectionManager","serverNotifications","require","loading","apphost","dom","recordingHelper","events","registrationServices","paper-icon-button-light","emby-button","css!./recordingfields"],function(globalize,connectionManager,serverNotifications,require,loading,appHost,dom,recordingHelper,events,registrationServices){"use strict";function getRegistration(apiClient,programId,feature){return loading.show(),apiClient.getJSON(apiClient.getUrl("LiveTv/Registration",{ProgramId:programId,Feature:feature})).then(function(result){return loading.hide(),result},function(){return loading.hide(),{TrialVersion:!0,IsValid:!0,IsRegistered:!1}})}function showConvertRecordingsUnlockMessage(context,apiClient){apiClient.getPluginSecurityInfo().then(function(regInfo){regInfo.IsMBSupporter?context.querySelector(".convertRecordingsContainer").classList.add("hide"):context.querySelector(".convertRecordingsContainer").classList.remove("hide")},function(){context.querySelector(".convertRecordingsContainer").classList.remove("hide")})}function showSeriesRecordingFields(context,programId,apiClient){getRegistration(apiClient,programId,"seriesrecordings").then(function(regInfo){regInfo.IsRegistered?(context.querySelector(".supporterContainer").classList.add("hide"),context.querySelector(".convertRecordingsContainer").classList.add("hide"),context.querySelector(".recordSeriesContainer").classList.remove("hide")):(context.querySelector(".supporterContainerText").innerHTML=globalize.translate("sharedcomponents#MessageActiveSubscriptionRequiredSeriesRecordings"),context.querySelector(".supporterContainer").classList.remove("hide"),context.querySelector(".recordSeriesContainer").classList.add("hide"),context.querySelector(".convertRecordingsContainer").classList.add("hide"))})}function getDvrFeatureCode(){return"dvr"}function showSingleRecordingFields(context,programId,apiClient){getRegistration(apiClient,programId,getDvrFeatureCode()).then(function(regInfo){regInfo.IsRegistered?(context.querySelector(".supporterContainer").classList.add("hide"),showConvertRecordingsUnlockMessage(context,apiClient)):(context.querySelector(".supporterContainerText").innerHTML=globalize.translate("sharedcomponents#DvrSubscriptionRequired"),context.querySelector(".supporterContainer").classList.remove("hide"),context.querySelector(".convertRecordingsContainer").classList.add("hide"))})}function showRecordingFieldsContainer(context,programId,apiClient){getRegistration(apiClient,programId,getDvrFeatureCode()).then(function(regInfo){regInfo.IsRegistered?context.querySelector(".recordingFields").classList.remove("hide"):context.querySelector(".recordingFields").classList.add("hide")})}function loadData(parent,program,apiClient){program.IsSeries?(parent.querySelector(".recordSeriesContainer").classList.remove("hide"),showSeriesRecordingFields(parent,program.Id,apiClient)):(parent.querySelector(".recordSeriesContainer").classList.add("hide"),showSingleRecordingFields(parent,program.Id,apiClient)),program.SeriesTimerId?(parent.querySelector(".btnManageSeriesRecording").classList.remove("hide"),parent.querySelector(".seriesRecordingButton .recordingIcon").classList.add("recordingIcon-active"),parent.querySelector(".seriesRecordingButton .buttonText").innerHTML=globalize.translate("sharedcomponents#CancelSeries")):(parent.querySelector(".btnManageSeriesRecording").classList.add("hide"),parent.querySelector(".seriesRecordingButton .recordingIcon").classList.remove("recordingIcon-active"),parent.querySelector(".seriesRecordingButton .buttonText").innerHTML=globalize.translate("sharedcomponents#RecordSeries")),program.TimerId&&"Cancelled"!==program.Status?(parent.querySelector(".btnManageRecording").classList.remove("hide"),parent.querySelector(".singleRecordingButton .recordingIcon").classList.add("recordingIcon-active"),parent.querySelector(".singleRecordingButton .buttonText").innerHTML=globalize.translate("sharedcomponents#DoNotRecord")):(parent.querySelector(".btnManageRecording").classList.add("hide"),parent.querySelector(".singleRecordingButton .recordingIcon").classList.remove("recordingIcon-active"),parent.querySelector(".singleRecordingButton .buttonText").innerHTML=globalize.translate("sharedcomponents#Record"))}function fetchData(instance){var options=instance.options,apiClient=connectionManager.getApiClient(options.serverId);return showRecordingFieldsContainer(options.parent,options.programId,apiClient),apiClient.getLiveTvProgram(options.programId,apiClient.getCurrentUserId()).then(function(program){instance.TimerId=program.TimerId,instance.Status=program.Status,instance.SeriesTimerId=program.SeriesTimerId,loadData(options.parent,program,apiClient)})}function onTimerChangedExternally(e,apiClient,data){var options=this.options,refresh=!1;data.Id&&this.TimerId===data.Id&&(refresh=!0),data.ProgramId&&options&&options.programId===data.ProgramId&&(refresh=!0),refresh&&this.refresh()}function onSeriesTimerChangedExternally(e,apiClient,data){var options=this.options,refresh=!1;data.Id&&this.SeriesTimerId===data.Id&&(refresh=!0),data.ProgramId&&options&&options.programId===data.ProgramId&&(refresh=!0),refresh&&this.refresh()}function RecordingEditor(options){this.options=options,this.embed();var timerChangedHandler=onTimerChangedExternally.bind(this);this.timerChangedHandler=timerChangedHandler,events.on(serverNotifications,"TimerCreated",timerChangedHandler),events.on(serverNotifications,"TimerCancelled",timerChangedHandler);var seriesTimerChangedHandler=onSeriesTimerChangedExternally.bind(this);this.seriesTimerChangedHandler=seriesTimerChangedHandler,events.on(serverNotifications,"SeriesTimerCreated",seriesTimerChangedHandler),events.on(serverNotifications,"SeriesTimerCancelled",seriesTimerChangedHandler)}function onSupporterButtonClick(){registrationServices.showPremiereInfo()}function onManageRecordingClick(e){var options=this.options;if(this.TimerId&&"Cancelled"!==this.Status){var self=this;require(["recordingEditor"],function(recordingEditor){recordingEditor.show(self.TimerId,options.serverId,{enableCancel:!1}).then(function(){self.changed=!0})})}}function onManageSeriesRecordingClick(e){var options=this.options;if(this.SeriesTimerId){var self=this;require(["seriesRecordingEditor"],function(seriesRecordingEditor){seriesRecordingEditor.show(self.SeriesTimerId,options.serverId,{enableCancel:!1}).then(function(){self.changed=!0})})}}function onRecordChange(e){this.changed=!0;var self=this,options=this.options,apiClient=connectionManager.getApiClient(options.serverId),button=dom.parentWithTag(e.target,"BUTTON"),isChecked=!button.querySelector("i").classList.contains("recordingIcon-active"),hasEnabledTimer=this.TimerId&&"Cancelled"!==this.Status;isChecked?hasEnabledTimer||(loading.show(),recordingHelper.createRecording(apiClient,options.programId,!1).then(function(){events.trigger(self,"recordingchanged"),fetchData(self),loading.hide()})):hasEnabledTimer&&(loading.show(),recordingHelper.cancelTimer(apiClient,this.TimerId,!0).then(function(){events.trigger(self,"recordingchanged"),fetchData(self),loading.hide()}))}function sendToast(msg){require(["toast"],function(toast){toast(msg)})}function onRecordSeriesChange(e){this.changed=!0;var self=this,options=this.options,apiClient=connectionManager.getApiClient(options.serverId),button=dom.parentWithTag(e.target,"BUTTON"),isChecked=!button.querySelector("i").classList.contains("recordingIcon-active");if(isChecked){if(showSeriesRecordingFields(options.parent,options.programId,apiClient),!this.SeriesTimerId){var promise=this.TimerId?recordingHelper.changeRecordingToSeries(apiClient,this.TimerId,options.programId):recordingHelper.createRecording(apiClient,options.programId,!0);promise.then(function(){fetchData(self)})}}else showSingleRecordingFields(options.parent,options.programId,apiClient),this.SeriesTimerId&&apiClient.cancelLiveTvSeriesTimer(this.SeriesTimerId).then(function(){sendToast(globalize.translate("sharedcomponents#RecordingCancelled")),fetchData(self)})}return RecordingEditor.prototype.embed=function(){var self=this;return new Promise(function(resolve,reject){require(["text!./recordingfields.template.html"],function(template){var options=self.options,context=options.parent;context.innerHTML=globalize.translateDocument(template,"sharedcomponents");for(var supporterButtons=context.querySelectorAll(".btnSupporter"),i=0,length=supporterButtons.length;i
'+builder().map(function(t){var tabHtml,tabClass="emby-tab-button";return tabHtml=t.href?'":'",index++,tabHtml}).join("")+"
",document.body.classList.add("withTallToolbar"),tabType=type,!0}return viewMenuBarTabs.querySelector('[is="emby-tabs"]').selectedIndex(selectedIndex),tabType=type,!1}function getTabsElement(){return document.querySelector(".tabs-viewmenubar")}var tabType,queryScope=document.querySelector(".skinHeader");return{setTabs:setTabs,getTabsElement:getTabsElement}}); \ No newline at end of file +define(["emby-tabs","emby-button"],function(){"use strict";function setTabs(view,selectedIndex,builder){var viewMenuBarTabs;if(!view)return void(tabOwnerView&&(document.body.classList.remove("withTallToolbar"),viewMenuBarTabs=queryScope.querySelector(".viewMenuBarTabs"),viewMenuBarTabs.innerHTML="",viewMenuBarTabs.classList.add("hide"),tabOwnerView=null));if(viewMenuBarTabs=queryScope.querySelector(".viewMenuBarTabs"),tabOwnerView||viewMenuBarTabs.classList.remove("hide"),tabOwnerView!==view){var index=0,indexAttribute=null==selectedIndex?"":' data-index="'+selectedIndex+'"';return viewMenuBarTabs.innerHTML='
'+builder().map(function(t){var tabHtml,tabClass="emby-tab-button";return tabHtml=t.href?'":'",index++,tabHtml}).join("")+"
",document.body.classList.add("withTallToolbar"),tabOwnerView=view,!0}return viewMenuBarTabs.querySelector('[is="emby-tabs"]').selectedIndex(selectedIndex),tabOwnerView=view,!1}function getTabsElement(){return document.querySelector(".tabs-viewmenubar")}var tabOwnerView,queryScope=document.querySelector(".skinHeader");return{setTabs:setTabs,getTabsElement:getTabsElement}}); \ No newline at end of file diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 6e81f29b51..9d0e6d7ce6 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -1 +1 @@ -.itemTag,.ui-body-b{color:#fff!important}.itemName,.itemTag{font-weight:400!important}.detailSectionHeader,.itemMiscInfo{-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow:hidden}.alphabetPicker,.itemLinks,.listPaging,.posterRibbon,.viewSettings{text-align:center}.hidingAnimatedTab{visibility:hidden}.headerArrowImage{height:20px;margin-left:.5em}.background-theme-b .backgroundContainer,.dialog.background-theme-b{background-color:#141414}.background-theme-b .backgroundContainer.withBackdrop{background-color:rgba(6,6,6,.94)!important;background:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.99)),color-stop(rgba(0,0,0,.94)),to(rgba(0,0,0,.5)))!important;background:-webkit-linear-gradient(left,rgba(0,0,0,.99),rgba(0,0,0,.94),rgba(0,0,0,.5))!important;background:-o-linear-gradient(left,rgba(0,0,0,.99),rgba(0,0,0,.94),rgba(0,0,0,.5))!important;background:linear-gradient(to right,rgba(0,0,0,.99),rgba(0,0,0,.94),rgba(0,0,0,.5))!important}.pageWithAbsoluteTabs{background-color:transparent!important}.backdropContainer{position:fixed;top:0;left:0;right:0;bottom:0;z-index:-1}.libraryPage .header{padding-bottom:0}.pageTabContent{contain:style}.libraryPage>.ui-content{padding-top:10px}.pageWithAbsoluteTabs .pageTabContent{padding-top:2.1em}.flexPageTabContent.is-active{display:-webkit-box!important;display:-webkit-flex!important;display:flex!important}@media all and (max-width:600px){.libraryPage>.ui-content{padding-left:.5em!important;padding-right:.5em!important}}.listHeader{margin:.25em 0;padding-left:2px;line-height:1.25em;line-height:initial}@media all and (max-width:500px){.listHeader{padding-left:5px}}.listHeader+button{margin-left:2em}.ehsContent,.ehsContent .pageTabContent{margin:0 auto}.homePageSection{margin-bottom:3.4em}.sectionHeaderButton{vertical-align:middle;margin:0 0 .25em 1.5em;position:relative;top:8px}.viewPanelTabs{margin-bottom:2em}@media all and (min-width:800px){.hiddenSectionOnNonMobile{display:none}}.ehsContent .pageTabContent,.ehsContent:not(.fullWidth){width:98%}@media all and (min-width:1200px){.paddedItemsContainer{padding:0 .8em}.ehsContent .pageTabContent,.ehsContent:not(.fullWidth){width:96%}}.homePageSection h1{padding-left:.5em}.homePageSection .itemsContainer{padding-left:.5em;padding-right:.5em}@media all and (min-width:1200px){.homePageSection h1{padding-left:2.2vw}.homePageSection .itemsContainer{padding-left:2vw;padding-right:2vw}}.viewSettings{margin:0 0 .25em}.viewControls+.listTopPaging{margin-left:.5em!important}.criticReview{margin:1.5em 0;background:#222;padding:.8em .8em .8em 55px;-webkit-border-radius:5px;border-radius:5px;position:relative}.criticReview:first-child{margin-top:.5em}.criticReview img{width:30px}.criticRatingScore{margin-bottom:.5em}.itemTag{display:inline-block;background-color:#333;-webkit-border-radius:4px;border-radius:4px;padding:5px 7px;margin:0 5px 5px 0;text-decoration:none}.detailSectionHeader,.detailUserDataIcons{display:-webkit-box;display:-webkit-flex;-webkit-box-align:center}.itemOverview{white-space:pre-wrap}a.itemTag:hover{background-color:#2489ce}.itemLinks{padding:0}.itemLinks p{margin:.5em 0}.reviewLink,.reviewerName{margin-top:.5em}.reviewerName{color:#ccc}.reviewDate{margin-left:1em}.reviewScore{position:absolute;left:.8em}span.itemCommunityRating:not(:empty)+.userDataIcons{margin-left:1.25em}.itemBackdrop{-webkit-background-size:cover;background-size:cover;background-position:center 15%;background-repeat:no-repeat;height:45vh;position:relative}.noSecondaryNavPage .itemBackdrop{margin-top:-50px}.noBackdrop{background:#181818;height:170px!important}.itemBackdropContent{position:absolute;bottom:0;left:0;right:0;background-color:rgba(0,0,0,.7);min-height:120px}.noBackdrop .itemBackdropContent{background-color:transparent}.desktopMiscInfoContainer{position:absolute;bottom:10px}.detailUserDataIcons{display:flex;-webkit-align-items:center;align-items:center}.detailImageContainer{margin-right:2em;width:280px;-webkit-flex-shrink:0;flex-shrink:0}.detailPagePrimaryContent{position:relative;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.detailLogo{width:300px;height:70px;position:absolute;top:13.5%;right:19.5%;background-repeat:no-repeat;background-position:center center;-webkit-background-size:contain;background-size:contain}@media all and (max-width:1400px){.detailLogo{right:5%}}@media all and (max-width:1100px){.detailLogo{display:none}}.itemDetailImage{border:1px solid transparent;width:100%}.thumbDetailImageContainer{width:400px}.itemDetailImage.loaded{-webkit-box-shadow:0 0 20px #000;box-shadow:0 0 20px #000;border:1px solid #222}.itemDetailGalleryLink img:hover{-webkit-box-shadow:0 0 20px 3px #52B54B;box-shadow:0 0 20px 3px #52B54B}@media all and (max-width:800px){.detailPageContent{position:relative}.detailImageContainer{position:absolute;top:-90px;left:5%;width:auto}.itemDetailImage{height:120px;width:auto!important}.btnPlaySimple{display:none!important}}@media all and (min-width:800px){.itemBackdrop{display:none}.detailPagePrimaryContainer{display:-webkit-box;display:-webkit-flex;display:flex;margin-bottom:3.6em}}@media all and (max-width:1200px){.detailLogo{right:2%}.lnkSibling{display:none!important}}.parentName{display:block;margin-bottom:.5em}.emby-button.detailFloatingButton{width:56px!important;height:56px!important;bottom:-28px;position:absolute;right:5%;background-color:#52B54B!important;z-index:1}.emby-button.btnFloatingRecord{background-color:#c33!important}@media all and (max-width:800px){.parentName{margin-bottom:1em}.itemBackdropContent{min-height:0}}@media all and (min-width:500px){.mobileDetails{display:none}}@media all and (max-width:500px){.desktopDetails{display:none!important}}.itemName{margin:.5em 0}.empty{margin:0}.detailSection{vertical-align:top;margin-bottom:3em}.detailCollapsibleSection:not(.hide)+.detailCollapsibleSection{margin-top:-2em}.detailPageCollabsible{margin-top:0}.detailSection h1{margin-bottom:.25em;position:relative}.detailSectionHeader{-webkit-background-clip:border-box;background-clip:border-box;padding:0 0 .25em .25em;background-color:transparent;-webkit-border-radius:0;border-radius:0;white-space:nowrap;position:relative;margin:1.5em 0 1em;display:flex;-webkit-align-items:center;align-items:center}.detailSectionHeader>h1{margin:0}.detailSectionHeaderButton{margin-left:1em}.mainDetailButtons{padding:.5em 0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-flex-wrap:wrap;flex-wrap:wrap}.mainDetailButtons button,.recordingFields button{margin-left:0;margin-right:.5em;-webkit-flex-shrink:0;flex-shrink:0}.mainDetailButtons.hide+.recordingFields{margin-top:1.5em!important}.mainDetailButtons>.raised{-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}@media all and (min-width:400px){.mainDetailButtons>.raised{padding-left:1.5em;padding-right:1.5em}}.detailImageProgressContainer{position:absolute;bottom:4px;right:1px;left:1px;text-align:center}.listTopPaging,.viewControls{display:inline-block}@media all and (max-width:800px){.editorMenuLink{display:none}}.itemMiscInfo{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-webkit-align-items:center;align-items:center}@media all and (max-width:500px){.mobileDetails .itemMiscInfo{text-align:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.itemMiscInfo .endsAt{display:none}}.detailPageContent{border-spacing:0;border-collapse:collapse;padding:3em 3% 0}@media all and (min-width:1200px){.detailPageContent{padding:3em 5% 0}}.detailPageParentLink{font-weight:inherit!important}.mediaInfoContent{line-height:1.5em}.mediaInfoStream{margin:1em 3em 1em 0;display:inline-block;color:#bbb;vertical-align:top}.mediaInfoStreamType{display:block;color:#fff;margin-bottom:1em}.mediaInfoAttribute{color:#fff;display:inline-block}.mediaInfoLabel{color:#aaa;margin-right:1em;display:inline-block}.posterRibbon{display:block;position:absolute;top:5px;right:5px;padding:5px 6px;-webkit-border-radius:10px;border-radius:10px;color:#fff;background:#008fbb;background:rgba(0,143,187,.8);line-height:initial}.offlinePosterRibbon{background:rgba(248,58,34,.8)}.unairedPosterRibbon{background:rgba(255,106,0,.8)}.missingPosterRibbon{background:rgba(248,58,34,.8)}.recordingProgressBar::-moz-progress-bar{background-color:#c33}.recordingProgressBar::-webkit-progress-value{background-color:#c33}.recordingProgressBar[aria-valuenow]:before{background-color:#c33}.timelineHeader{margin-bottom:.25em;line-height:1.25em;line-height:initial}.itemsContainer{margin:0 auto}.alphabetPicker{position:fixed;right:0;bottom:0;font-size:90%;display:none;line-height:1}.layout-desktop .absolutePageTabContent .alphabetPicker{right:20px}@media all and (max-height:500px){.alphabetPicker{display:none!important}}@media all and (min-height:500px){.itemsContainerWithAlphaPicker{margin-right:1em}.alphabetPicker{bottom:70px}}@media all and (min-width:1200px){.absolutePageTabContent .itemsContainerWithAlphaPicker,.itemsContainerWithAlphaPicker{margin-right:0}}@media all and (max-height:700px){.alphaPicker-vertical .alphaPickerButton{padding-top:1px!important;padding-bottom:1px!important}}@media all and (max-height:600px){.alphaPicker-vertical .alphaPickerButton{padding-top:0!important;padding-bottom:0!important}}@media all and (max-height:530px){.alphabetPicker{font-size:80%}}@media all and (max-height:480px){.alphabetPicker{font-size:76%}}@media all and (min-height:900px){.alphabetPicker{bottom:120px}}@media all and (min-height:1000px){.alphabetPicker{bottom:200px}}@media all and (max-width:1200px){.listViewUserDataButtons{display:none!important}}.userProfileSettingsForm{max-width:700px}@media all and (max-width:700px){.userProfileSettingsForm .detailSection{margin-left:.5em;margin-right:.5em}}@media all and (max-width:800px){.detailsHiddenOnMobile{display:none}}#criticReviewsContent.hiddenScrollX{white-space:nowrap}#criticReviewsContent.hiddenScrollX .paperList{min-width:240px;width:90%;max-width:500px;display:inline-block;vertical-align:top;margin:0 4px 0 0}.btnSyncComplete{background:#673AB7!important}.btnSyncComplete i{-webkit-border-radius:1000px;border-radius:1000px}.bulletSeparator{margin:0 .35em}.mediaInfoIcons{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;margin:1.5em 0 1em;-webkit-flex-wrap:wrap;flex-wrap:wrap}.mediaInfoText{padding:.3em .5em!important;margin-right:.5em;margin-bottom:.5em;font-size:94%!important}.mediaInfoText-upper{text-transform:uppercase}.padded-left,.padded-left-withalphapicker{padding-left:1em}.padded-right{padding-right:1em}.padded-top{padding-top:1em}.padded-bottom{padding-bottom:1em}.padded-top-focusscale{padding-top:1.6em;margin-top:-1.6em}.padded-bottom-focusscale{padding-bottom:1.6em;margin-bottom:-1.6em}@media all and (min-width:800px){.padded-left{padding-left:2%}.padded-left-withalphapicker{padding-left:4%}.padded-right{padding-right:2%}}@media all and (min-width:1280px){.padded-left{padding-left:4%}.padded-left-withalphapicker{padding-left:4.4%}.padded-right{padding-right:4%}} \ No newline at end of file +.itemTag,.ui-body-b{color:#fff!important}.itemName,.itemTag{font-weight:400!important}.detailSectionHeader,.itemMiscInfo{-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow:hidden}.alphabetPicker,.itemLinks,.listPaging,.posterRibbon,.viewSettings{text-align:center}.hidingAnimatedTab{visibility:hidden}.headerArrowImage{height:20px;margin-left:.5em}.background-theme-b .backgroundContainer,.dialog.background-theme-b{background-color:#141414}.background-theme-b .backgroundContainer.withBackdrop{background-color:rgba(6,6,6,.94)!important;background:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.99)),color-stop(rgba(0,0,0,.94)),to(rgba(0,0,0,.5)))!important;background:-webkit-linear-gradient(left,rgba(0,0,0,.99),rgba(0,0,0,.94),rgba(0,0,0,.5))!important;background:-o-linear-gradient(left,rgba(0,0,0,.99),rgba(0,0,0,.94),rgba(0,0,0,.5))!important;background:linear-gradient(to right,rgba(0,0,0,.99),rgba(0,0,0,.94),rgba(0,0,0,.5))!important}.pageWithAbsoluteTabs{background-color:transparent!important}.backdropContainer{position:fixed;top:0;left:0;right:0;bottom:0;z-index:-1}.libraryPage .header{padding-bottom:0}.pageTabContent{contain:style}.libraryPage>.ui-content{padding-top:10px}.pageWithAbsoluteTabs .pageTabContent{padding-top:2.1em}.flexPageTabContent.is-active{display:-webkit-box!important;display:-webkit-flex!important;display:flex!important}@media all and (max-width:600px){.libraryPage>.ui-content{padding-left:.5em!important;padding-right:.5em!important}}.listHeader{margin:.25em 0;padding-left:2px;line-height:1.25em;line-height:initial}@media all and (max-width:500px){.listHeader{padding-left:5px}}.listHeader+button{margin-left:2em}.ehsContent,.ehsContent .pageTabContent{margin:0 auto}.homePageSection{margin-bottom:3.4em}.sectionHeaderButton{vertical-align:middle;margin:0 0 .25em 1.5em;position:relative;top:8px}.viewPanelTabs{margin-bottom:2em}@media all and (min-width:800px){.hiddenSectionOnNonMobile{display:none}}.ehsContent .pageTabContent,.ehsContent:not(.fullWidth){width:98%}@media all and (min-width:1200px){.paddedItemsContainer{padding:0 .8em}.ehsContent .pageTabContent,.ehsContent:not(.fullWidth){width:96%}}.homePageSection h1{padding-left:.5em}.homePageSection .itemsContainer{padding-left:.5em;padding-right:.5em}@media all and (min-width:1200px){.homePageSection h1{padding-left:2.2vw}.homePageSection .itemsContainer{padding-left:2vw;padding-right:2vw}}.viewSettings{margin:0 0 .25em}.viewControls+.listTopPaging{margin-left:.5em!important}.criticReview{margin:1.5em 0;background:#222;padding:.8em .8em .8em 55px;-webkit-border-radius:5px;border-radius:5px;position:relative}.criticReview:first-child{margin-top:.5em}.criticReview img{width:30px}.criticRatingScore{margin-bottom:.5em}.itemTag{display:inline-block;background-color:#333;-webkit-border-radius:4px;border-radius:4px;padding:5px 7px;margin:0 5px 5px 0;text-decoration:none}.detailSectionHeader,.detailUserDataIcons{display:-webkit-box;display:-webkit-flex;-webkit-box-align:center}.itemOverview{white-space:pre-wrap}a.itemTag:hover{background-color:#2489ce}.itemLinks{padding:0}.itemLinks p{margin:.5em 0}.reviewLink,.reviewerName{margin-top:.5em}.reviewerName{color:#ccc}.reviewDate{margin-left:1em}.reviewScore{position:absolute;left:.8em}span.itemCommunityRating:not(:empty)+.userDataIcons{margin-left:1.25em}.itemBackdrop{-webkit-background-size:cover;background-size:cover;background-position:center 15%;background-repeat:no-repeat;height:45vh;position:relative}.noBackdrop{background:#181818}.itemBackdropContent{position:absolute;bottom:0;left:0;right:0;background-color:rgba(0,0,0,.7);min-height:120px}.noBackdrop .itemBackdropContent{background-color:transparent}.desktopMiscInfoContainer{position:absolute;bottom:10px}.detailUserDataIcons{display:flex;-webkit-align-items:center;align-items:center}.detailImageContainer{margin-right:2em;width:280px;-webkit-flex-shrink:0;flex-shrink:0}.detailPagePrimaryContent{position:relative;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.detailLogo{width:300px;height:70px;position:absolute;top:13.5%;right:19.5%;background-repeat:no-repeat;background-position:center center;-webkit-background-size:contain;background-size:contain}@media all and (max-width:1400px){.detailLogo{right:5%}}@media all and (max-width:1100px){.detailLogo{display:none}}.itemDetailImage{border:1px solid transparent;width:100%}.thumbDetailImageContainer{width:400px}.itemDetailImage.loaded{-webkit-box-shadow:0 0 20px #000;box-shadow:0 0 20px #000;border:1px solid #222}.itemDetailGalleryLink img:hover{-webkit-box-shadow:0 0 20px 3px #52B54B;box-shadow:0 0 20px 3px #52B54B}@media all and (max-width:800px){.detailPageContent{position:relative}.detailImageContainer{position:absolute;top:-90px;left:5%;width:auto}.itemDetailImage{height:120px;width:auto!important}.btnPlaySimple{display:none!important}}@media all and (min-width:800px){.itemBackdrop{display:none}.detailPagePrimaryContainer{display:-webkit-box;display:-webkit-flex;display:flex;margin-bottom:3.6em}}@media all and (max-width:1200px){.detailLogo{right:2%}.lnkSibling{display:none!important}}.parentName{display:block;margin-bottom:.5em}.emby-button.detailFloatingButton{position:absolute;background-color:rgba(0,0,0,.8)!important;z-index:1;top:50%;left:50%;margin:-2.4em 0 0 -2.4em;border:2.4px solid #eee;border:2.4px solid rgba(255,255,255,.7);padding:.4em!important;color:rgba(255,255,255,.8)}.emby-button.detailFloatingButton i{font-size:3.5em}.emby-button.btnFloatingRecord{background-color:#c33!important}@media all and (max-width:800px){.parentName{margin-bottom:1em}.itemBackdropContent{min-height:0}.itemDetailPage{padding-top:0!important}}@media all and (min-width:500px){.mobileDetails{display:none}}@media all and (max-width:500px){.desktopDetails{display:none!important}}.itemName{margin:.5em 0}.empty{margin:0}.detailSection{vertical-align:top;margin-bottom:3em}.detailCollapsibleSection:not(.hide)+.detailCollapsibleSection{margin-top:-2em}.detailPageCollabsible{margin-top:0}.detailSection h1{margin-bottom:.25em;position:relative}.detailSectionHeader{-webkit-background-clip:border-box;background-clip:border-box;padding:0 0 .25em .25em;background-color:transparent;-webkit-border-radius:0;border-radius:0;white-space:nowrap;position:relative;margin:1.5em 0 1em;display:flex;-webkit-align-items:center;align-items:center}.detailSectionHeader>h1{margin:0}.detailSectionHeaderButton{margin-left:1em}.mainDetailButtons{padding:.5em 0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-flex-wrap:wrap;flex-wrap:wrap}.mainDetailButtons button,.recordingFields button{margin-left:0;margin-right:.5em;-webkit-flex-shrink:0;flex-shrink:0}.mainDetailButtons.hide+.recordingFields{margin-top:1.5em!important}.mainDetailButtons>.raised{-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}@media all and (min-width:400px){.mainDetailButtons>.raised{padding-left:1.5em;padding-right:1.5em}}.detailImageProgressContainer{position:absolute;bottom:4px;right:1px;left:1px;text-align:center}.listTopPaging,.viewControls{display:inline-block}@media all and (max-width:800px){.editorMenuLink{display:none}}.itemMiscInfo{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-webkit-align-items:center;align-items:center}@media all and (max-width:500px){.mobileDetails .itemMiscInfo{text-align:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.itemMiscInfo .endsAt{display:none}}.detailPageContent{border-spacing:0;border-collapse:collapse;padding:3em 3% 0}@media all and (min-width:1200px){.detailPageContent{padding:3em 5% 0}}.detailPageParentLink{font-weight:inherit!important}.mediaInfoContent{line-height:1.5em}.mediaInfoStream{margin:1em 3em 1em 0;display:inline-block;color:#bbb;vertical-align:top}.mediaInfoStreamType{display:block;color:#fff;margin-bottom:1em}.mediaInfoAttribute{color:#fff;display:inline-block}.mediaInfoLabel{color:#aaa;margin-right:1em;display:inline-block}.posterRibbon{display:block;position:absolute;top:5px;right:5px;padding:5px 6px;-webkit-border-radius:10px;border-radius:10px;color:#fff;background:#008fbb;background:rgba(0,143,187,.8);line-height:initial}.offlinePosterRibbon{background:rgba(248,58,34,.8)}.unairedPosterRibbon{background:rgba(255,106,0,.8)}.missingPosterRibbon{background:rgba(248,58,34,.8)}.recordingProgressBar::-moz-progress-bar{background-color:#c33}.recordingProgressBar::-webkit-progress-value{background-color:#c33}.recordingProgressBar[aria-valuenow]:before{background-color:#c33}.timelineHeader{margin-bottom:.25em;line-height:1.25em;line-height:initial}.itemsContainer{margin:0 auto}.alphabetPicker{position:fixed;right:0;bottom:0;font-size:90%;display:none;line-height:1}.layout-desktop .absolutePageTabContent .alphabetPicker{right:20px}@media all and (max-height:500px){.alphabetPicker{display:none!important}.itemBackdrop{height:52vh}}@media all and (min-height:500px){.itemsContainerWithAlphaPicker{margin-right:1em}.alphabetPicker{bottom:70px}}@media all and (min-width:1200px){.absolutePageTabContent .itemsContainerWithAlphaPicker,.itemsContainerWithAlphaPicker{margin-right:0}}@media all and (max-height:700px){.alphaPicker-vertical .alphaPickerButton{padding-top:1px!important;padding-bottom:1px!important}}@media all and (max-height:600px){.alphaPicker-vertical .alphaPickerButton{padding-top:0!important;padding-bottom:0!important}}@media all and (max-height:530px){.alphabetPicker{font-size:80%}}@media all and (max-height:480px){.alphabetPicker{font-size:76%}}@media all and (min-height:900px){.alphabetPicker{bottom:120px}}@media all and (min-height:1000px){.alphabetPicker{bottom:200px}}@media all and (max-width:1200px){.listViewUserDataButtons{display:none!important}}.userProfileSettingsForm{max-width:700px}@media all and (max-width:700px){.userProfileSettingsForm .detailSection{margin-left:.5em;margin-right:.5em}}@media all and (max-width:800px){.detailsHiddenOnMobile{display:none}}#criticReviewsContent.hiddenScrollX{white-space:nowrap}#criticReviewsContent.hiddenScrollX .paperList{min-width:240px;width:90%;max-width:500px;display:inline-block;vertical-align:top;margin:0 4px 0 0}.btnSyncComplete{background:#673AB7!important}.btnSyncComplete i{-webkit-border-radius:1000px;border-radius:1000px}.bulletSeparator{margin:0 .35em}.mediaInfoIcons{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;margin:1.5em 0 1em;-webkit-flex-wrap:wrap;flex-wrap:wrap}.mediaInfoText{padding:.3em .5em!important;margin-right:.5em;margin-bottom:.5em;font-size:94%!important}.mediaInfoText-upper{text-transform:uppercase}.padded-left,.padded-left-withalphapicker{padding-left:1em}.padded-right{padding-right:1em}.padded-top{padding-top:1em}.padded-bottom{padding-bottom:1em}.padded-top-focusscale{padding-top:1.6em;margin-top:-1.6em}.padded-bottom-focusscale{padding-bottom:1.6em;margin-bottom:-1.6em}@media all and (min-width:800px){.padded-left{padding-left:2%}.padded-left-withalphapicker{padding-left:4%}.padded-right{padding-right:2%}}@media all and (min-width:1280px){.padded-left{padding-left:4%}.padded-left-withalphapicker{padding-left:4.4%}.padded-right{padding-right:4%}} \ No newline at end of file diff --git a/dashboard-ui/css/librarymenu.css b/dashboard-ui/css/librarymenu.css index bcefff3571..249b9daba7 100644 --- a/dashboard-ui/css/librarymenu.css +++ b/dashboard-ui/css/librarymenu.css @@ -1 +1 @@ -.libraryMenuButtonText,.viewMenuLink{vertical-align:middle;text-decoration:none}.drawerUserPanel,.viewMenuBar{-webkit-box-orient:vertical;-webkit-box-direction:normal}.libraryPage{padding-top:60px!important}.libraryPage:not(.noSecondaryNavPage){padding-top:87px!important}.pageWithAbsoluteTabs:not(.noSecondaryNavPage){padding-top:90px!important}.absolutePageTabContent{position:absolute;left:0;right:0;bottom:0;z-index:1;margin:0!important;top:94px!important;-webkit-transition:-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out;transition:transform .2s ease-out}.pageTabContent:not(.is-active){display:none!important}.sidebarDivider{height:1px;background:#eaeaea;margin:.5em 0}.headerUserImage{-webkit-background-size:contain;background-size:contain;background-repeat:no-repeat;background-position:center center;-webkit-border-radius:1000px;border-radius:1000px;vertical-align:middle;display:inline-block}.headerUserButtonRound img{-webkit-border-radius:1000px;border-radius:1000px}.headerButton{-webkit-flex-shrink:0;flex-shrink:0}.menuArrow{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAbklEQ…yGDxkLaBtENI9kPMk0gaoW0Dyj0aWowFLYNYzWB6MWMAAAq1H3+Mhu2hQAAAAASUVORK5CYII=);height:24px;width:24px;display:inline-block}.hideMainDrawer .mainDrawerButton{display:none}.libraryMenuButtonText{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;padding-left:0!important;cursor:default;white-space:nowrap;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;-webkit-box-align:center;-webkit-align-items:center;align-items:center;margin:0 0 0 .5em;-webkit-flex-shrink:1;flex-shrink:1}.libraryViewNav,.viewMenuBar{z-index:999;display:-webkit-box;display:-webkit-flex}.viewMenuBar{position:fixed;right:0;left:0;top:0;border:0;padding-top:3px;display:flex;-webkit-flex-direction:column;flex-direction:column}.hiddenViewMenuBar .viewMenuBar{display:none}.libraryViewNav{overflow:hidden;white-space:nowrap;padding:0;display:flex;display:block;text-align:center;margin:0 auto;-webkit-box-align:center;-webkit-align-items:center;align-items:center;font-size:92%}.ui-body-b .libraryViewNav{position:fixed;right:0;left:0;top:44px}.libraryViewNav.bottom{top:auto!important;bottom:0}.ui-body-b .libraryViewNav,.viewMenuBar{background-color:#101010;color:#fff}.viewMenuBar .primaryIcons{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;-webkit-flex-shrink:0;flex-shrink:0;width:100%;-webkit-box-align:center;-webkit-align-items:center;align-items:center;padding:.4em 0}@supports (backdrop-filter:blur(10px)) or (-webkit-backdrop-filter:blur(10px)){.viewMenuBar-blurred{background:rgba(24,24,24,.7);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}}.dashboardDocument{font-size:13px}.withTallToolbar .primaryIcons{padding-top:0!important;padding-bottom:0!important}.viewMenuBarTabs{width:100%;text-align:center}.viewMenuBar.semiTransparent{background-color:rgba(15,15,15,.3)}.viewMenuLink{color:#eee!important;padding:7px .5em 6px;display:inline-block}.viewMenuLink:hover{color:#fff}.viewMenuLink:hover img{opacity:.5}.viewMenuLink img{height:24px;vertical-align:top}.viewMenuSecondary{margin-left:auto;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.selectedMediaFolder{background-color:#f2f2f2!important}@media all and (max-width:800px){.editorViewMenu{display:none}}.sidebarLink{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;text-decoration:none;color:#111!important;font-weight:400!important;vertical-align:middle;padding:1em 0 1em 2.4em}.sidebarLink:hover{background:#f2f2f2}.sidebarLink.selectedSidebarLink{background:#f2f2f2!important}.sidebarLinkIcon{margin-right:1em;opacity:.7}.sidebarHeader{padding-left:1.4em;margin:1.2em 0 .7em;color:#666}body:not(.dashboardDocument) .btnNotifications{display:none!important}.darkDrawer{background-color:#181818!important}.darkDrawer .sidebarLink{color:#fff!important}.darkDrawer .sidebarHeader{color:#bbb!important}.darkDrawer .sidebarDivider{background:#262626!important}.darkDrawer .sidebarLink:hover{background:#252528}.darkDrawer .selectedMediaFolder,.darkDrawer .sidebarLink.selectedSidebarLink{background:#252528!important;color:#52B54B!important}body:not(.dashboardDocument) .headerAppsButton{display:none}.mainDrawer-scrollContainer{padding-bottom:10vh}.dashboardDocument .skinBody{-webkit-transition:left ease-in-out .3s,padding ease-in-out .3s;-o-transition:left ease-in-out .3s,padding ease-in-out .3s;transition:left ease-in-out .3s,padding ease-in-out .3s;position:absolute;top:0;right:0;bottom:0;left:0}@media all and (max-width:640px){.sidebarLink{font-size:110%}}@media all and (min-width:640px){.dashboardDocument .adminDrawerLogo,.dashboardDocument .mainDrawerButton,.dashboardDocument .tmla-mask{display:none!important}.dashboardDocument .viewMenuBarTabs{width:auto;padding-left:272px;text-align:left!important}.dashboardDocument .sidebarLink{padding-top:.7em;padding-bottom:.7em}.dashboardDocument .mainDrawer{z-index:inherit!important;left:0!important;top:0!important;-webkit-transform:none!important;transform:none!important;width:260px!important}.dashboardDocument .mainDrawer-scrollContainer{margin-top:50px!important}.dashboardDocument.withTallToolbar .mainDrawer-scrollContainer{margin-top:86px!important}.dashboardDocument .skinBody{left:260px}.dashboardDocument .darkDrawer{background-color:rgba(28,28,31,.3)!important}}.drawerUserPanel{height:7em;margin-bottom:.5em;color:#ccc;display:-webkit-box;display:-webkit-flex;display:flex;padding:1.5em;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.drawerUserName{padding-left:.25em} \ No newline at end of file +.libraryMenuButtonText,.viewMenuLink{vertical-align:middle;text-decoration:none}.drawerUserPanel,.viewMenuBar{-webkit-box-orient:vertical;-webkit-box-direction:normal}.libraryPage{padding-top:60px!important}.libraryPage:not(.noSecondaryNavPage){padding-top:87px!important}.pageWithAbsoluteTabs:not(.noSecondaryNavPage){padding-top:90px!important}.absolutePageTabContent{position:absolute;left:0;right:0;bottom:0;z-index:1;margin:0!important;top:94px!important;-webkit-transition:-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out;transition:transform .2s ease-out}.pageTabContent:not(.is-active){display:none!important}.sidebarDivider{height:1px;background:#eaeaea;margin:.5em 0}.headerUserImage{-webkit-background-size:contain;background-size:contain;background-repeat:no-repeat;background-position:center center;-webkit-border-radius:1000px;border-radius:1000px;vertical-align:middle;display:inline-block}.headerUserButtonRound img{-webkit-border-radius:1000px;border-radius:1000px}.headerButton{-webkit-flex-shrink:0;flex-shrink:0}.menuArrow{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAbklEQ…yGDxkLaBtENI9kPMk0gaoW0Dyj0aWowFLYNYzWB6MWMAAAq1H3+Mhu2hQAAAAASUVORK5CYII=);height:24px;width:24px;display:inline-block}.hideMainDrawer .mainDrawerButton{display:none}.libraryMenuButtonText{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;padding-left:0!important;cursor:default;white-space:nowrap;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;-webkit-box-align:center;-webkit-align-items:center;align-items:center;margin:0 0 0 .5em;-webkit-flex-shrink:1;flex-shrink:1}.libraryViewNav,.viewMenuBar{z-index:999;display:-webkit-box;display:-webkit-flex}.viewMenuBar{position:fixed;right:0;left:0;top:0;border:0;padding-top:3px;display:flex;-webkit-flex-direction:column;flex-direction:column;background-color:#101010;color:#fff}.hiddenViewMenuBar .viewMenuBar{display:none}.libraryViewNav{overflow:hidden;white-space:nowrap;padding:0;display:flex;display:block;text-align:center;margin:0 auto;-webkit-box-align:center;-webkit-align-items:center;align-items:center;font-size:92%}.ui-body-b .libraryViewNav{position:fixed;right:0;left:0;top:44px}.libraryViewNav.bottom{top:auto!important;bottom:0}.viewMenuBar .primaryIcons{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;-webkit-flex-shrink:0;flex-shrink:0;width:100%;-webkit-box-align:center;-webkit-align-items:center;align-items:center;padding:.4em 0}@supports (backdrop-filter:blur(10px)) or (-webkit-backdrop-filter:blur(10px)){.viewMenuBar-blurred{background:rgba(24,24,24,.7);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}}.dashboardDocument{font-size:13px}.withTallToolbar .primaryIcons{padding-top:0!important;padding-bottom:0!important}.viewMenuBarTabs{width:100%;text-align:center}.viewMenuBar.semiTransparent{background-color:rgba(15,15,15,.3)}.viewMenuLink{color:#eee!important;padding:7px .5em 6px;display:inline-block}.viewMenuLink:hover{color:#fff}.viewMenuLink:hover img{opacity:.5}.viewMenuLink img{height:24px;vertical-align:top}.viewMenuSecondary{margin-left:auto;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.selectedMediaFolder{background-color:#f2f2f2!important}@media all and (max-width:800px){.editorViewMenu{display:none}}.sidebarLink{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;text-decoration:none;color:#111!important;font-weight:400!important;vertical-align:middle;padding:1em 0 1em 2.4em}.sidebarLink:hover{background:#f2f2f2}.sidebarLink.selectedSidebarLink{background:#f2f2f2!important}.sidebarLinkIcon{margin-right:1em;opacity:.7}.sidebarHeader{padding-left:1.4em;margin:1.2em 0 .7em;color:#666}body:not(.dashboardDocument) .btnNotifications{display:none!important}.darkDrawer{background-color:#181818!important}.darkDrawer .sidebarLink{color:#fff!important}.darkDrawer .sidebarHeader{color:#bbb!important}.darkDrawer .sidebarDivider{background:#262626!important}.darkDrawer .sidebarLink:hover{background:#252528}.darkDrawer .selectedMediaFolder,.darkDrawer .sidebarLink.selectedSidebarLink{background:#252528!important;color:#52B54B!important}body:not(.dashboardDocument) .headerAppsButton{display:none}.mainDrawer-scrollContainer{padding-bottom:10vh}.dashboardDocument .skinBody{-webkit-transition:left ease-in-out .3s,padding ease-in-out .3s;-o-transition:left ease-in-out .3s,padding ease-in-out .3s;transition:left ease-in-out .3s,padding ease-in-out .3s;position:absolute;top:0;right:0;bottom:0;left:0}@media all and (max-width:640px){.sidebarLink{font-size:110%}}@media all and (min-width:640px){.dashboardDocument .adminDrawerLogo,.dashboardDocument .mainDrawerButton,.dashboardDocument .tmla-mask{display:none!important}.dashboardDocument .viewMenuBarTabs{width:auto;padding-left:272px;text-align:left!important}.dashboardDocument .sidebarLink{padding-top:.7em;padding-bottom:.7em}.dashboardDocument .mainDrawer{z-index:inherit!important;left:0!important;top:0!important;-webkit-transform:none!important;transform:none!important;width:260px!important}.dashboardDocument .mainDrawer-scrollContainer{margin-top:50px!important}.dashboardDocument.withTallToolbar .mainDrawer-scrollContainer{margin-top:86px!important}.dashboardDocument .skinBody{left:260px}.dashboardDocument .darkDrawer{background-color:rgba(28,28,31,.3)!important}}.drawerUserPanel{height:7em;margin-bottom:.5em;color:#ccc;display:-webkit-box;display:-webkit-flex;display:flex;padding:1.5em;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.drawerUserName{padding-left:.25em} \ No newline at end of file diff --git a/dashboard-ui/movies.html b/dashboard-ui/movies.html index 4c21b7972c..7c4726c338 100644 --- a/dashboard-ui/movies.html +++ b/dashboard-ui/movies.html @@ -1,6 +1,6 @@ 
-
+

${HeaderContinueWatching}

diff --git a/dashboard-ui/scripts/indexpage.js b/dashboard-ui/scripts/indexpage.js index f39385de2d..526de89048 100644 --- a/dashboard-ui/scripts/indexpage.js +++ b/dashboard-ui/scripts/indexpage.js @@ -1 +1 @@ -define(["libraryBrowser","libraryMenu","playbackManager","mainTabsManager","emby-button"],function(libraryBrowser,libraryMenu,playbackManager,mainTabsManager){"use strict";function getDefaultSection(index){switch(index){case 0:return defaultFirstSection;case 1:return"resume";case 2:return"resumeaudio";case 3:return"nextup";case 4:return"latestmedia";case 5:return"latesttvrecordings";default:return""}}function loadSection(page,user,userSettings,index){var userId=user.Id,section=userSettings.get("homesection"+index)||getDefaultSection(index);"folders"==section&&(section=defaultFirstSection);var elem=page.querySelector(".section"+index);return"latestmedia"==section?Sections.loadRecentlyAdded(elem,user):"librarytiles"==section?Sections.loadLibraryTiles(elem,user,"backdrop",index):"smalllibrarytiles"==section?Sections.loadLibraryTiles(elem,user,"smallBackdrop",index):"smalllibrarytiles-automobile"==section?Sections.loadLibraryTiles(elem,user,"smallBackdrop",index):"librarytiles-automobile"==section?Sections.loadLibraryTiles(elem,user,"backdrop",index):"librarybuttons"==section?Sections.loadlibraryButtons(elem,userId,index):"resume"==section?Sections.loadResumeVideo(elem,userId):"resumeaudio"==section?Sections.loadResumeAudio(elem,userId):"nextup"==section?Sections.loadNextUp(elem,userId):"latesttvrecordings"==section?Sections.loadLatestLiveTvRecordings(elem,userId):"latestchannelmedia"==section?Sections.loadLatestChannelMedia(elem,userId):(elem.innerHTML="",Promise.resolve())}function loadSections(page,user,userSettings){var i,length,sectionCount=6,elem=page.querySelector(".sections"),html="";for(i=0,length=sectionCount;i
';elem.innerHTML=html;var promises=[];for(i=0,length=sectionCount;i
';elem.innerHTML=html;var promises=[];for(i=0,length=sectionCount;i0&&tabs.selectedIndex(selected-1)}};require(["touchHelper"],function(TouchHelper){var touchHelper=new TouchHelper(ownerpage.parentNode.parentNode);Events.on(touchHelper,"swipeleft",onSwipeLeft),Events.on(touchHelper,"swiperight",onSwipeRight),ownerpage.addEventListener("viewdestroy",function(){touchHelper.destroy()})})}},configurePaperLibraryTabs:function(ownerpage,tabs,panels,animateTabs,enableSwipe){enableSwipe!==!1&&LibraryBrowser.configureSwipeTabs(ownerpage,tabs),tabs.addEventListener("beforetabchange",function(e){null!=e.detail.previousIndex&&panels[e.detail.previousIndex].classList.remove("is-active");var newPanel=panels[e.detail.selectedTabIndex];null!=e.detail.previousIndex&&e.detail.previousIndex!=e.detail.selectedTabIndex&&newPanel.animate&&(animateTabs||[]).indexOf(e.detail.selectedTabIndex)!=-1&&fadeInRight(newPanel),newPanel.classList.add("is-active")})},getArtistLinksHtml:function(artists,cssClass){for(var html=[],i=0,length=artists.length;i'+artist.Name+"")}return html=html.join(" / ")},getHref:function(item,context,topParentId){if(!item)throw new Error("item cannot be null");if(item.url)return item.url;var url,id=item.Id||item.ItemId;if("SeriesTimer"==item.Type)return"itemdetails.html?seriesTimerId="+id;if("livetv"==item.CollectionType)return"livetv.html";if("channels"==item.CollectionType)return"channels.html";if("folders"!=context){if("movies"==item.CollectionType)return"movies.html?topParentId="+item.Id;if("boxsets"==item.CollectionType)return"itemlist.html?topParentId="+item.Id+"&parentId="+item.Id;if("tvshows"==item.CollectionType)return"tv.html?topParentId="+item.Id;if("music"==item.CollectionType)return"music.html?topParentId="+item.Id;if("games"==item.CollectionType)return id?"itemlist.html?parentId="+id:"#";if("playlists"==item.CollectionType)return"playlists.html?topParentId="+item.Id;if("photos"==item.CollectionType)return"photos.html?topParentId="+item.Id}else if(item.IsFolder&&"BoxSet"!=item.Type&&"Series"!=item.Type)return id?"itemlist.html?parentId="+id:"#";if("CollectionFolder"==item.Type)return"itemlist.html?topParentId="+item.Id+"&parentId="+item.Id;if("PhotoAlbum"==item.Type)return"itemlist.html?context=photos&parentId="+id;if("Playlist"==item.Type)return"itemdetails.html?id="+id;if("TvChannel"==item.Type)return"itemdetails.html?id="+id;if("Channel"==item.Type)return"channelitems.html?id="+id;if(item.IsFolder&&"Channel"==item.SourceType||"ChannelFolderItem"==item.Type)return"channelitems.html?id="+item.ChannelId+"&folderId="+item.Id;if("Program"==item.Type)return"itemdetails.html?id="+id;if("BoxSet"==item.Type)return"itemdetails.html?id="+id;if("MusicAlbum"==item.Type)return"itemdetails.html?id="+id;if("GameSystem"==item.Type)return"itemdetails.html?id="+id;if("Genre"==item.Type){var type;switch(context){case"tvshows":type="Series";break;case"games":type="Game";break;default:type="Movie"}return url="secondaryitems.html?type="+type+"&genreId="+id,topParentId&&(url+="&parentId="+topParentId),url}if("MusicGenre"==item.Type)return"itemdetails.html?id="+id;if("GameGenre"==item.Type)return url="secondaryitems.html?type=Game&genreId="+id,topParentId&&(url+="&parentId="+topParentId),url;if("Studio"==item.Type){var type;switch(context){case"tvshows":type="Series";break;case"games":type="Game";break;default:type="Movie"}return url="secondaryitems.html?type="+type+"&studioId="+id,topParentId&&(url+="&parentId="+topParentId),url}if("Person"==item.Type)return"itemdetails.html?id="+id;if("Recording"==item.Type)return"itemdetails.html?id="+id;if("MusicArtist"==item.Type)return"itemdetails.html?id="+id;var contextSuffix=context?"&context="+context:"";return"Series"==item.Type||"Season"==item.Type||"Episode"==item.Type?"itemdetails.html?id="+id+contextSuffix:item.IsFolder?id?"itemlist.html?parentId="+id:"#":"itemdetails.html?id="+id},getListItemInfo:function(elem){for(var elemWithAttributes=elem;!elemWithAttributes.getAttribute("data-id");)elemWithAttributes=elemWithAttributes.parentNode;var itemId=elemWithAttributes.getAttribute("data-id"),index=elemWithAttributes.getAttribute("data-index"),mediaType=elemWithAttributes.getAttribute("data-mediatype");return{id:itemId,index:index,mediaType:mediaType,context:elemWithAttributes.getAttribute("data-context")}},getFutureDateText:function(date){var weekday=[];weekday[0]=Globalize.translate("OptionSunday"),weekday[1]=Globalize.translate("OptionMonday"),weekday[2]=Globalize.translate("OptionTuesday"),weekday[3]=Globalize.translate("OptionWednesday"),weekday[4]=Globalize.translate("OptionThursday"),weekday[5]=Globalize.translate("OptionFriday"),weekday[6]=Globalize.translate("OptionSaturday");var day=weekday[date.getDay()];return date=datetime.toLocaleDateString(date),date.toLowerCase().indexOf(day.toLowerCase())==-1?day+" "+date:date},renderName:function(item,nameElem,linkToElement,context){require(["itemHelper"],function(itemHelper){var name=itemHelper.getDisplayName(item,{includeParentInfo:!1});linkToElement?nameElem.innerHTML=''+name+"":nameElem.innerHTML=name})},renderParentName:function(item,parentNameElem,context){var html=[],contextParam=context?"&context="+context:"";item.AlbumArtists?html.push(LibraryBrowser.getArtistLinksHtml(item.AlbumArtists,"detailPageParentLink")):item.ArtistItems&&item.ArtistItems.length&&"MusicVideo"==item.Type?html.push(LibraryBrowser.getArtistLinksHtml(item.ArtistItems,"detailPageParentLink")):item.SeriesName&&"Episode"==item.Type&&html.push(''+item.SeriesName+""),item.SeriesName&&"Season"==item.Type?html.push(''+item.SeriesName+""):null!=item.ParentIndexNumber&&"Episode"==item.Type?html.push(''+item.SeasonName+""):item.Album&&"Audio"==item.Type&&(item.AlbumId||item.ParentId)?html.push(''+item.Album+""):item.Album&&"MusicVideo"==item.Type&&item.AlbumId?html.push(''+item.Album+""):item.Album?html.push(item.Album):"Program"==item.Type&&item.IsSeries&&html.push(item.Name),html.length?(parentNameElem.classList.remove("hide"),parentNameElem.innerHTML=html.join(" - ")):parentNameElem.classList.add("hide")},showLayoutMenu:function(button,currentLayout,views){var dispatchEvent=!0;views||(dispatchEvent=!1,views=button.getAttribute("data-layouts"),views=views?views.split(","):["List","Poster","PosterCard","Thumb","ThumbCard"]);var menuItems=views.map(function(v){return{name:Globalize.translate("Option"+v),id:v,selected:currentLayout==v}});require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:button,callback:function(id){button.dispatchEvent(new CustomEvent("layoutchange",{detail:{viewStyle:id},bubbles:!0,cancelable:!1})),dispatchEvent||window.$&&$(button).trigger("layoutchange",[id])}})})},getQueryPagingHtml:function(options){var startIndex=options.startIndex,limit=options.limit,totalRecordCount=options.totalRecordCount;if(limit&&options.updatePageSizeSetting!==!1)try{appSettings.set(options.pageSizeKey||pageSizeKey,limit)}catch(e){}var html="",recordsEnd=Math.min(startIndex+limit,totalRecordCount),showControls=totalRecordCount>20||limit',showControls){html+='';var startAtDisplay=totalRecordCount?startIndex+1:0;html+=startAtDisplay+"-"+recordsEnd+" of "+totalRecordCount,html+=""}if((showControls||options.viewButton||options.filterButton||options.sortButton||options.addLayoutButton)&&(html+='
',showControls&&(html+='',html+=''),options.addLayoutButton&&(html+=''),options.sortButton&&(html+=''),options.filterButton&&(html+=''),html+="
",showControls&&options.showLimit)){var id="selectPageSize",pageSizes=options.pageSizes||[20,50,100,200,300,400,500],optionsHtml=pageSizes.map(function(val){return limit==val?'":'"}).join("");html+='
"}return html+="
"},showSortMenu:function(options){require(["dialogHelper","emby-radio"],function(dialogHelper){function onSortByChange(){var newValue=this.value;if(this.checked){var changed=options.query.SortBy!=newValue;options.query.SortBy=newValue.replace("_",","),options.query.StartIndex=0,options.callback&&changed&&options.callback()}}function onSortOrderChange(){var newValue=this.value;if(this.checked){var changed=options.query.SortOrder!=newValue;options.query.SortOrder=newValue,options.query.StartIndex=0,options.callback&&changed&&options.callback()}}var dlg=dialogHelper.createDialog({removeOnClose:!0,modal:!1,entryAnimationDuration:160,exitAnimationDuration:200});dlg.classList.add("ui-body-a"),dlg.classList.add("background-theme-a"),dlg.classList.add("formDialog");var html="";html+='
',html+='

',html+=Globalize.translate("HeaderSortBy"),html+="

";var i,length,isChecked;for(html+="
",i=0,length=options.items.length;i"+option.name+""}html+="
",html+='

',html+=Globalize.translate("HeaderSortOrder"),html+="

",html+="
",isChecked="Ascending"==options.query.SortOrder?" checked":"",html+='",isChecked="Descending"==options.query.SortOrder?" checked":"",html+='",html+="
",html+="
",dlg.innerHTML=html,dialogHelper.open(dlg);var sortBys=dlg.querySelectorAll(".menuSortBy");for(i=0,length=sortBys.length;i',editable&&(html+=""),detectRatio&&item.PrimaryImageAspectRatio&&(item.PrimaryImageAspectRatio>=1.48?shape="thumb":item.PrimaryImageAspectRatio>=.85&&item.PrimaryImageAspectRatio<=1.34&&(shape="square")),html+="",editable&&(html+="");var progressHtml=item.IsFolder||!item.UserData?"":indicators.getProgressBarHtml(item);if(html+='
',progressHtml&&(html+=progressHtml),html+="
",html+="
",elem.innerHTML=html,"thumb"==shape?(elem.classList.add("thumbDetailImageContainer"),elem.classList.remove("portraitDetailImageContainer"),elem.classList.remove("squareDetailImageContainer")):"square"==shape?(elem.classList.remove("thumbDetailImageContainer"),elem.classList.remove("portraitDetailImageContainer"),elem.classList.add("squareDetailImageContainer")):(elem.classList.remove("thumbDetailImageContainer"),elem.classList.add("portraitDetailImageContainer"),elem.classList.remove("squareDetailImageContainer")),url){var img=elem.querySelector("img");img.onload=function(){img.src.indexOf("empty.png")==-1&&img.classList.add("loaded")},imageLoader.lazyImage(img,url)}},renderDetailPageBackdrop:function(page,item,imageLoader){var imgUrl,screenWidth=screen.availWidth,hasbackdrop=!1,itemBackdropElement=page.querySelector("#itemBackdrop");return item.BackdropImageTags&&item.BackdropImageTags.length?(imgUrl=ApiClient.getScaledImageUrl(item.Id,{type:"Backdrop",index:0,maxWidth:screenWidth,tag:item.BackdropImageTags[0]}),itemBackdropElement.classList.remove("noBackdrop"),imageLoader.lazyImage(itemBackdropElement,imgUrl,!1),hasbackdrop=!0):item.ParentBackdropItemId&&item.ParentBackdropImageTags&&item.ParentBackdropImageTags.length?(imgUrl=ApiClient.getScaledImageUrl(item.ParentBackdropItemId,{type:"Backdrop",index:0,tag:item.ParentBackdropImageTags[0],maxWidth:screenWidth}),itemBackdropElement.classList.remove("noBackdrop"),imageLoader.lazyImage(itemBackdropElement,imgUrl,!1),hasbackdrop=!0):(itemBackdropElement.classList.add("noBackdrop"),itemBackdropElement.style.backgroundImage=""),hasbackdrop}};return libraryBrowser}(window,document,screen);return window.LibraryBrowser=libraryBrowser,libraryBrowser}); \ No newline at end of file +define(["appSettings","dom","browser","datetime","scrollStyles"],function(appSettings,dom,browser,datetime){"use strict";function fadeInRight(elem){var pct=browser.mobile?"4%":"0.5%",keyframes=[{opacity:"0",transform:"translate3d("+pct+", 0, 0)",offset:0},{opacity:"1",transform:"none",offset:1}];elem.animate(keyframes,{duration:160,iterations:1,easing:"ease-out"})}var libraryBrowser=function(window,document,screen){var pageSizeKey="pagesize_v4",libraryBrowser={getDefaultPageSize:function(key,defaultValue){return 100},getSavedQueryKey:function(modifier){return window.location.href.split("#")[0]+(modifier||"")},loadSavedQueryValues:function(key,query){var values=appSettings.get(key+"_"+Dashboard.getCurrentUserId());return values?(values=JSON.parse(values),Object.assign(query,values)):query},saveQueryValues:function(key,query){var values={};query.SortBy&&(values.SortBy=query.SortBy),query.SortOrder&&(values.SortOrder=query.SortOrder);try{appSettings.set(key+"_"+Dashboard.getCurrentUserId(),JSON.stringify(values))}catch(e){}},saveViewSetting:function(key,value){try{appSettings.set(key+"_"+Dashboard.getCurrentUserId()+"_view",value)}catch(e){}},getSavedView:function(key){var val=appSettings.get(key+"_"+Dashboard.getCurrentUserId()+"_view");return val},getSavedViewSetting:function(key){return new Promise(function(resolve,reject){var val=LibraryBrowser.getSavedView(key);resolve(val)})},allowSwipe:function(target){function allowSwipeOn(elem){return!dom.parentWithTag(elem,"input")&&(!elem.classList||!elem.classList.contains("hiddenScrollX")&&!elem.classList.contains("smoothScrollX")&&!elem.classList.contains("animatedScrollX"))}for(var parent=target;null!=parent;){if(!allowSwipeOn(parent))return!1;parent=parent.parentNode}return!0},configureSwipeTabs:function(ownerpage,tabs){if(browser.touch){var pageCount=ownerpage.querySelectorAll(".pageTabContent").length,onSwipeLeft=function(e,target){if(LibraryBrowser.allowSwipe(target)&&ownerpage.contains(target)){var selected=parseInt(tabs.selectedIndex()||"0");selected0&&tabs.selectedIndex(selected-1)}};require(["touchHelper"],function(TouchHelper){var touchHelper=new TouchHelper(ownerpage.parentNode.parentNode);Events.on(touchHelper,"swipeleft",onSwipeLeft),Events.on(touchHelper,"swiperight",onSwipeRight),ownerpage.addEventListener("viewdestroy",function(){touchHelper.destroy()})})}},configurePaperLibraryTabs:function(ownerpage,tabs,panels,animateTabs,enableSwipe){enableSwipe!==!1&&LibraryBrowser.configureSwipeTabs(ownerpage,tabs),tabs.addEventListener("beforetabchange",function(e){null!=e.detail.previousIndex&&panels[e.detail.previousIndex].classList.remove("is-active");var newPanel=panels[e.detail.selectedTabIndex];null!=e.detail.previousIndex&&e.detail.previousIndex!=e.detail.selectedTabIndex&&newPanel.animate&&(animateTabs||[]).indexOf(e.detail.selectedTabIndex)!=-1&&fadeInRight(newPanel),newPanel.classList.add("is-active")})},getArtistLinksHtml:function(artists,cssClass){for(var html=[],i=0,length=artists.length;i'+artist.Name+"")}return html=html.join(" / ")},getHref:function(item,context,topParentId){if(!item)throw new Error("item cannot be null");if(item.url)return item.url;var url,id=item.Id||item.ItemId;if("SeriesTimer"==item.Type)return"itemdetails.html?seriesTimerId="+id;if("livetv"==item.CollectionType)return"livetv.html";if("channels"==item.CollectionType)return"channels.html";if("folders"!=context){if("movies"==item.CollectionType)return"movies.html?topParentId="+item.Id;if("boxsets"==item.CollectionType)return"itemlist.html?topParentId="+item.Id+"&parentId="+item.Id;if("tvshows"==item.CollectionType)return"tv.html?topParentId="+item.Id;if("music"==item.CollectionType)return"music.html?topParentId="+item.Id;if("games"==item.CollectionType)return id?"itemlist.html?parentId="+id:"#";if("playlists"==item.CollectionType)return"playlists.html?topParentId="+item.Id;if("photos"==item.CollectionType)return"photos.html?topParentId="+item.Id}else if(item.IsFolder&&"BoxSet"!=item.Type&&"Series"!=item.Type)return id?"itemlist.html?parentId="+id:"#";if("CollectionFolder"==item.Type)return"itemlist.html?topParentId="+item.Id+"&parentId="+item.Id;if("PhotoAlbum"==item.Type)return"itemlist.html?context=photos&parentId="+id;if("Playlist"==item.Type)return"itemdetails.html?id="+id;if("TvChannel"==item.Type)return"itemdetails.html?id="+id;if("Channel"==item.Type)return"channelitems.html?id="+id;if(item.IsFolder&&"Channel"==item.SourceType||"ChannelFolderItem"==item.Type)return"channelitems.html?id="+item.ChannelId+"&folderId="+item.Id;if("Program"==item.Type)return"itemdetails.html?id="+id;if("BoxSet"==item.Type)return"itemdetails.html?id="+id;if("MusicAlbum"==item.Type)return"itemdetails.html?id="+id;if("GameSystem"==item.Type)return"itemdetails.html?id="+id;if("Genre"==item.Type){var type;switch(context){case"tvshows":type="Series";break;case"games":type="Game";break;default:type="Movie"}return url="secondaryitems.html?type="+type+"&genreId="+id,topParentId&&(url+="&parentId="+topParentId),url}if("MusicGenre"==item.Type)return"itemdetails.html?id="+id;if("GameGenre"==item.Type)return url="secondaryitems.html?type=Game&genreId="+id,topParentId&&(url+="&parentId="+topParentId),url;if("Studio"==item.Type){var type;switch(context){case"tvshows":type="Series";break;case"games":type="Game";break;default:type="Movie"}return url="secondaryitems.html?type="+type+"&studioId="+id,topParentId&&(url+="&parentId="+topParentId),url}if("Person"==item.Type)return"itemdetails.html?id="+id;if("Recording"==item.Type)return"itemdetails.html?id="+id;if("MusicArtist"==item.Type)return"itemdetails.html?id="+id;var contextSuffix=context?"&context="+context:"";return"Series"==item.Type||"Season"==item.Type||"Episode"==item.Type?"itemdetails.html?id="+id+contextSuffix:item.IsFolder?id?"itemlist.html?parentId="+id:"#":"itemdetails.html?id="+id},getListItemInfo:function(elem){for(var elemWithAttributes=elem;!elemWithAttributes.getAttribute("data-id");)elemWithAttributes=elemWithAttributes.parentNode;var itemId=elemWithAttributes.getAttribute("data-id"),index=elemWithAttributes.getAttribute("data-index"),mediaType=elemWithAttributes.getAttribute("data-mediatype");return{id:itemId,index:index,mediaType:mediaType,context:elemWithAttributes.getAttribute("data-context")}},getFutureDateText:function(date){var weekday=[];weekday[0]=Globalize.translate("OptionSunday"),weekday[1]=Globalize.translate("OptionMonday"),weekday[2]=Globalize.translate("OptionTuesday"),weekday[3]=Globalize.translate("OptionWednesday"),weekday[4]=Globalize.translate("OptionThursday"),weekday[5]=Globalize.translate("OptionFriday"),weekday[6]=Globalize.translate("OptionSaturday");var day=weekday[date.getDay()];return date=datetime.toLocaleDateString(date),date.toLowerCase().indexOf(day.toLowerCase())==-1?day+" "+date:date},renderName:function(item,nameElem,linkToElement,context){require(["itemHelper"],function(itemHelper){var name=itemHelper.getDisplayName(item,{includeParentInfo:!1});linkToElement?nameElem.innerHTML=''+name+"":nameElem.innerHTML=name})},renderParentName:function(item,parentNameElem,context){var html=[],contextParam=context?"&context="+context:"";item.AlbumArtists?html.push(LibraryBrowser.getArtistLinksHtml(item.AlbumArtists,"detailPageParentLink")):item.ArtistItems&&item.ArtistItems.length&&"MusicVideo"==item.Type?html.push(LibraryBrowser.getArtistLinksHtml(item.ArtistItems,"detailPageParentLink")):item.SeriesName&&"Episode"==item.Type&&html.push(''+item.SeriesName+""),item.SeriesName&&"Season"==item.Type?html.push(''+item.SeriesName+""):null!=item.ParentIndexNumber&&"Episode"==item.Type?html.push(''+item.SeasonName+""):item.Album&&"Audio"==item.Type&&(item.AlbumId||item.ParentId)?html.push(''+item.Album+""):item.Album&&"MusicVideo"==item.Type&&item.AlbumId?html.push(''+item.Album+""):item.Album?html.push(item.Album):"Program"==item.Type&&item.IsSeries&&html.push(item.Name),html.length?(parentNameElem.classList.remove("hide"),parentNameElem.innerHTML=html.join(" - ")):parentNameElem.classList.add("hide")},showLayoutMenu:function(button,currentLayout,views){var dispatchEvent=!0;views||(dispatchEvent=!1,views=button.getAttribute("data-layouts"),views=views?views.split(","):["List","Poster","PosterCard","Thumb","ThumbCard"]);var menuItems=views.map(function(v){return{name:Globalize.translate("Option"+v),id:v,selected:currentLayout==v}});require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:button,callback:function(id){button.dispatchEvent(new CustomEvent("layoutchange",{detail:{viewStyle:id},bubbles:!0,cancelable:!1})),dispatchEvent||window.$&&$(button).trigger("layoutchange",[id])}})})},getQueryPagingHtml:function(options){var startIndex=options.startIndex,limit=options.limit,totalRecordCount=options.totalRecordCount;if(limit&&options.updatePageSizeSetting!==!1)try{appSettings.set(options.pageSizeKey||pageSizeKey,limit)}catch(e){}var html="",recordsEnd=Math.min(startIndex+limit,totalRecordCount),showControls=totalRecordCount>20||limit',showControls){html+='';var startAtDisplay=totalRecordCount?startIndex+1:0;html+=startAtDisplay+"-"+recordsEnd+" of "+totalRecordCount,html+=""}if((showControls||options.viewButton||options.filterButton||options.sortButton||options.addLayoutButton)&&(html+='
',showControls&&(html+='',html+=''),options.addLayoutButton&&(html+=''),options.sortButton&&(html+=''),options.filterButton&&(html+=''),html+="
",showControls&&options.showLimit)){var id="selectPageSize",pageSizes=options.pageSizes||[20,50,100,200,300,400,500],optionsHtml=pageSizes.map(function(val){return limit==val?'":'"}).join("");html+='
"}return html+="
"},showSortMenu:function(options){require(["dialogHelper","emby-radio"],function(dialogHelper){function onSortByChange(){var newValue=this.value;if(this.checked){var changed=options.query.SortBy!=newValue;options.query.SortBy=newValue.replace("_",","),options.query.StartIndex=0,options.callback&&changed&&options.callback()}}function onSortOrderChange(){var newValue=this.value;if(this.checked){var changed=options.query.SortOrder!=newValue;options.query.SortOrder=newValue,options.query.StartIndex=0,options.callback&&changed&&options.callback()}}var dlg=dialogHelper.createDialog({removeOnClose:!0,modal:!1,entryAnimationDuration:160,exitAnimationDuration:200});dlg.classList.add("ui-body-a"),dlg.classList.add("background-theme-a"),dlg.classList.add("formDialog");var html="";html+='
',html+='

',html+=Globalize.translate("HeaderSortBy"),html+="

";var i,length,isChecked;for(html+="
",i=0,length=options.items.length;i"+option.name+""}html+="
",html+='

',html+=Globalize.translate("HeaderSortOrder"),html+="

",html+="
",isChecked="Ascending"==options.query.SortOrder?" checked":"",html+='",isChecked="Descending"==options.query.SortOrder?" checked":"",html+='",html+="
",html+="
",dlg.innerHTML=html,dialogHelper.open(dlg);var sortBys=dlg.querySelectorAll(".menuSortBy");for(i=0,length=sortBys.length;i',editable&&(html+=""),detectRatio&&item.PrimaryImageAspectRatio&&(item.PrimaryImageAspectRatio>=1.48?shape="thumb":item.PrimaryImageAspectRatio>=.85&&item.PrimaryImageAspectRatio<=1.34&&(shape="square")),html+="",editable&&(html+="");var progressHtml=item.IsFolder||!item.UserData?"":indicators.getProgressBarHtml(item);if(html+='
',progressHtml&&(html+=progressHtml),html+="
",html+="",elem.innerHTML=html,"thumb"==shape?(elem.classList.add("thumbDetailImageContainer"),elem.classList.remove("portraitDetailImageContainer"),elem.classList.remove("squareDetailImageContainer")):"square"==shape?(elem.classList.remove("thumbDetailImageContainer"),elem.classList.remove("portraitDetailImageContainer"),elem.classList.add("squareDetailImageContainer")):(elem.classList.remove("thumbDetailImageContainer"),elem.classList.add("portraitDetailImageContainer"),elem.classList.remove("squareDetailImageContainer")),url){var img=elem.querySelector("img");img.onload=function(){img.src.indexOf("empty.png")==-1&&img.classList.add("loaded")},imageLoader.lazyImage(img,url)}},renderDetailPageBackdrop:function(page,item,imageLoader){var imgUrl,screenWidth=screen.availWidth,hasbackdrop=!1,itemBackdropElement=page.querySelector("#itemBackdrop"),usePrimaryImage="Episode"===item.Type;return usePrimaryImage=!1,usePrimaryImage&&item.ImageTags&&item.ImageTags.Primary?(imgUrl=ApiClient.getScaledImageUrl(item.Id,{type:"Primary",index:0,maxWidth:screenWidth,tag:item.ImageTags.Primary}),itemBackdropElement.classList.remove("noBackdrop"),imageLoader.lazyImage(itemBackdropElement,imgUrl,!1),hasbackdrop=!0):item.BackdropImageTags&&item.BackdropImageTags.length?(imgUrl=ApiClient.getScaledImageUrl(item.Id,{type:"Backdrop",index:0,maxWidth:screenWidth,tag:item.BackdropImageTags[0]}),itemBackdropElement.classList.remove("noBackdrop"),imageLoader.lazyImage(itemBackdropElement,imgUrl,!1),hasbackdrop=!0):item.ParentBackdropItemId&&item.ParentBackdropImageTags&&item.ParentBackdropImageTags.length?(imgUrl=ApiClient.getScaledImageUrl(item.ParentBackdropItemId,{type:"Backdrop",index:0,tag:item.ParentBackdropImageTags[0],maxWidth:screenWidth}),itemBackdropElement.classList.remove("noBackdrop"),imageLoader.lazyImage(itemBackdropElement,imgUrl,!1),hasbackdrop=!0):(itemBackdropElement.classList.add("noBackdrop"),itemBackdropElement.style.backgroundImage=""),hasbackdrop}};return libraryBrowser}(window,document,screen);return window.LibraryBrowser=libraryBrowser,libraryBrowser}); \ No newline at end of file diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js index a9a60fa62d..b73cd4250d 100644 --- a/dashboard-ui/scripts/librarymenu.js +++ b/dashboard-ui/scripts/librarymenu.js @@ -1 +1 @@ -define(["layoutManager","viewManager","libraryBrowser","embyRouter","playbackManager","browser","paper-icon-button-light","material-icons","scrollStyles"],function(layoutManager,viewManager,libraryBrowser,embyRouter,playbackManager,browser){"use strict";function renderHeader(){var html="";html+='
';var backIcon=browser.safari?"chevron_left":"";html+='",html+='',html+='',html+='

',html+='
',html+='',html+='',html+='',html+='',html+='',html+='',browser.mobile||(html+=''),html+="
",html+="
",html+='
',html+="
";var viewMenuBar=document.createElement("div");viewMenuBar.classList.add("viewMenuBar"),viewMenuBar.innerHTML=html,browser.chrome||viewMenuBar.classList.add("viewMenuBar-blurred"),document.querySelector(".skinHeader").appendChild(viewMenuBar),lazyLoadViewMenuBarImages(),bindMenuEvents()}function lazyLoadViewMenuBarImages(){require(["imageLoader"],function(imageLoader){imageLoader.lazyChildren(document.querySelector(".viewMenuBar"))})}function onBackClick(){embyRouter.back()}function updateUserInHeader(user){var header=document.querySelector(".viewMenuBar");if(header){var hasImage,headerUserButton=header.querySelector(".headerUserButton");if(user&&user.name&&user.imageUrl){var userButtonHeight=26,url=user.imageUrl;user.supportsImageParams&&(url+="&height="+Math.round(userButtonHeight*Math.max(window.devicePixelRatio||1,2))),headerUserButton&&(updateHeaderUserButton(headerUserButton,url),hasImage=!0)}headerUserButton&&!hasImage&&updateHeaderUserButton(headerUserButton,null),user&&updateLocalUser(user.localUser),requiresUserRefresh=!1}}function updateHeaderUserButton(headerUserButton,src){src?(headerUserButton.classList.add("headerUserButtonRound"),headerUserButton.classList.remove("autoSize"),headerUserButton.innerHTML=''):(headerUserButton.classList.remove("headerUserButtonRound"),headerUserButton.classList.add("autoSize"),headerUserButton.innerHTML='person')}function updateLocalUser(user){var header=document.querySelector(".viewMenuBar"),headerSearchButton=header.querySelector(".headerSearchButton"),btnCast=header.querySelector(".btnCast"),dashboardEntryHeaderButton=header.querySelector(".dashboardEntryHeaderButton");user?(btnCast.classList.remove("hide"),headerSearchButton&&headerSearchButton.classList.remove("hide"),dashboardEntryHeaderButton&&(user.Policy.IsAdministrator?dashboardEntryHeaderButton.classList.remove("hide"):dashboardEntryHeaderButton.classList.add("hide")),require(["apphost"],function(apphost){apphost.supports("voiceinput")?header.querySelector(".headerVoiceButton").classList.add("hide"):header.querySelector(".headerVoiceButton").classList.add("hide")})):(btnCast.classList.add("hide"),header.querySelector(".headerVoiceButton").classList.add("hide"),headerSearchButton&&headerSearchButton.classList.add("hide"),dashboardEntryHeaderButton&&dashboardEntryHeaderButton.classList.add("hide"))}function showVoice(){require(["voiceDialog"],function(voiceDialog){voiceDialog.showDialog()})}function showSearch(){Dashboard.navigate("search.html")}function onHeaderUserButtonClick(e){Dashboard.showUserFlyout(e.target)}function onHeaderAppsButtonClick(){Dashboard.navigate("home.html")}function bindMenuEvents(){mainDrawerButton=document.querySelector(".mainDrawerButton"),mainDrawerButton&&mainDrawerButton.addEventListener("click",toggleMainDrawer);var headerBackButton=document.querySelector(".headerBackButton");headerBackButton&&headerBackButton.addEventListener("click",onBackClick);var headerVoiceButton=document.querySelector(".headerVoiceButton");headerVoiceButton&&headerVoiceButton.addEventListener("click",showVoice);var headerSearchButton=document.querySelector(".headerSearchButton");headerSearchButton&&headerSearchButton.addEventListener("click",showSearch);var headerUserButton=document.querySelector(".headerUserButton");headerUserButton&&headerUserButton.addEventListener("click",onHeaderUserButtonClick);var headerAppsButton=document.querySelector(".headerAppsButton");headerAppsButton&&headerAppsButton.addEventListener("click",onHeaderAppsButtonClick);var viewMenuBar=document.querySelector(".viewMenuBar");initHeadRoom(viewMenuBar),viewMenuBar.querySelector(".btnNotifications").addEventListener("click",function(){Dashboard.navigate("notificationlist.html")});var btnCast=document.querySelector(".headerButton-btnCast");btnCast&&btnCast.addEventListener("click",onCastButtonClicked)}function onCastButtonClicked(){var btn=this;require(["playerSelectionMenu"],function(playerSelectionMenu){playerSelectionMenu.show(btn)})}function getItemHref(item,context){return libraryBrowser.getHref(item,context)}function toggleMainDrawer(){navDrawerInstance.isVisible?closeMainDrawer():openMainDrawer()}function openMainDrawer(){navDrawerInstance.open(),lastOpenTime=(new Date).getTime()}function onMainDrawerOpened(){browser.mobile&&document.body.classList.add("bodyWithPopupOpen")}function closeMainDrawer(){navDrawerInstance.close()}function onMainDrawerSelect(e){navDrawerInstance.isVisible?onMainDrawerOpened():document.body.classList.remove("bodyWithPopupOpen")}function getDrawerUserPanelHtml(user){var html="";return html}function refreshLibraryInfoInDrawer(user,drawer){var html="";html+='
';var homeHref=window.ApiClient?"home.html":"selectserver.html?showuser=1";html+=''+Globalize.translate("ButtonHome")+"",html+=''+Globalize.translate("ButtonRemote")+"",html+='
',html+='
',html+="
";var localUser=user.localUser;localUser&&localUser.Policy.IsAdministrator&&(html+='
',html+='
',html+='
',html+=Globalize.translate("HeaderAdmin"),html+="
",html+=''+Globalize.translate("ButtonManageServer")+"",html+=''+Globalize.translate("MetadataManager")+"",browser.mobile||(html+=''+Globalize.translate("ButtonReports")+""),html+="
"),html+='",navDrawerScrollContainer.innerHTML=getDrawerUserPanelHtml(user)+html;var lnkManageServer=navDrawerScrollContainer.querySelector(".lnkManageServer");lnkManageServer&&lnkManageServer.addEventListener("click",onManageServerClicked),layoutManager.desktop&&navDrawerScrollContainer.classList.add("darkScroller")}function refreshDashboardInfoInDrawer(page,user){loadNavDrawer().then(function(){navDrawerScrollContainer.querySelector(".adminDrawerLogo")?updateDashboardMenuSelectedItem():createDashboardMenu(page)})}function updateDashboardMenuSelectedItem(){for(var links=navDrawerScrollContainer.querySelectorAll(".sidebarLink"),i=0,length=links.length;i',html+=Globalize.translate("HeaderMedia"),html+="",html+=items.map(function(i){var icon="folder",color="inherit",itemId=i.Id;"channels"==i.CollectionType?itemId="channels":"livetv"==i.CollectionType&&(itemId="livetv"),"photos"==i.CollectionType?(icon="photo_library",color="#009688"):"music"==i.CollectionType||"musicvideos"==i.CollectionType?(icon="library_music",color="#FB8521"):"books"==i.CollectionType?(icon="library_books",color="#1AA1E1"):"playlists"==i.CollectionType?(icon="view_list",color="#795548"):"games"==i.CollectionType?(icon="games",color="#F44336"):"movies"==i.CollectionType?(icon="video_library",color="#CE5043"):"channels"==i.CollectionType||"Channel"==i.Type?(icon="videocam",color="#E91E63"):"tvshows"==i.CollectionType?(icon="tv",color="#4CAF50"):"livetv"==i.CollectionType&&(icon="live_tv",color="#293AAE"),icon=i.icon||icon;var onclick=i.onclick?" function(){"+i.onclick+"}":"null";return''+icon+''+i.Name+""}).join(""),libraryMenuOptions.innerHTML=html;for(var elem=libraryMenuOptions,sidebarLinks=elem.querySelectorAll(".sidebarLink"),i=0,length=sidebarLinks.length;i200&&setTimeout(function(){closeMainDrawer(),setTimeout(function(){action?action():Dashboard.navigate(link.href)},getNavigateDelay())},50),event.stopPropagation(),event.preventDefault(),!1)},onLogoutClicked:function(){return(new Date).getTime()-lastOpenTime>200&&(closeMainDrawer(),setTimeout(function(){Dashboard.logout()},getNavigateDelay())),!1},onHardwareMenuButtonClick:function(){toggleMainDrawer()},onSettingsClicked:function(event){return 1!=event.which||(Dashboard.navigate("dashboard.html"),!1)},setTabs:function(type,selectedIndex,builder){require(["mainTabsManager"],function(mainTabsManager){mainTabsManager.setTabs(type,selectedIndex,builder)})},setDefaultTitle:function(){var libraryMenuButtonText=document.querySelector(".libraryMenuButtonText");libraryMenuButtonText&&(libraryMenuButtonText.innerHTML=''),document.title="Emby"},setTitle:function(title){var html=title,page=viewManager.currentView();if(page){var helpUrl=page.getAttribute("data-helpurl");helpUrl&&(html+='")}var libraryMenuButtonText=document.querySelector(".libraryMenuButtonText");libraryMenuButtonText&&(libraryMenuButtonText.innerHTML=html),document.title=title||"Emby"},setTransparentMenu:function(transparent){var viewMenuBar=document.querySelector(".viewMenuBar");viewMenuBar&&(transparent?viewMenuBar.classList.add("semiTransparent"):viewMenuBar.classList.remove("semiTransparent"))}},pageClassOn("pagebeforeshow","page",function(e){var page=this;page.classList.contains("withTabs")||(LibraryMenu.setTabs(null),page.classList.contains("pageWithAbsoluteTabs")?document.body.classList.add("withTallToolbar"):document.body.classList.remove("withTallToolbar"))}),pageClassOn("pageshow","page",function(e){var page=this,isDashboardPage=page.classList.contains("type-interior");isDashboardPage?(mainDrawerButton&&mainDrawerButton.classList.remove("hide"),refreshDashboardInfoInDrawer(page)):(mainDrawerButton&&(enableLibraryNavDrawer?mainDrawerButton.classList.remove("hide"):mainDrawerButton.classList.add("hide")),(navDrawerElement&&navDrawerElement.classList.contains("adminDrawer")||!navDrawerElement)&&refreshLibraryDrawer()),setDrawerClass(page),updateViewMenuBar(page),e.detail.isRestored||window.scrollTo(0,0),updateTitle(page),updateBackButton(page),page.classList.contains("libraryPage")?(document.body.classList.add("libraryDocument"),document.body.classList.remove("dashboardDocument"),document.body.classList.remove("hideMainDrawer")):isDashboardPage?(document.body.classList.remove("libraryDocument"),document.body.classList.add("dashboardDocument"),document.body.classList.remove("hideMainDrawer")):(document.body.classList.remove("libraryDocument"),document.body.classList.remove("dashboardDocument"),document.body.classList.add("hideMainDrawer")),updateLibraryNavLinks(page)}),window.ApiClient&&initializeApiClient(window.ApiClient),renderHeader(),Events.on(ConnectionManager,"apiclientcreated",function(e,apiClient){initializeApiClient(apiClient)}),Events.on(ConnectionManager,"localusersignedin",function(e,user){setDrawerClass(),ConnectionManager.user(ConnectionManager.getApiClient(user.ServerId)).then(function(user){refreshLibraryDrawer(user),updateUserInHeader(user)})}),Events.on(ConnectionManager,"localusersignedout",updateUserInHeader),Events.on(playbackManager,"playerchange",updateCastIcon),setDrawerClass(),enableBottomTabs&&require(["appfooter-shared","dockedtabs"],function(footer,dockedtabs){new dockedtabs({appFooter:footer})}),LibraryMenu}); \ No newline at end of file +define(["layoutManager","viewManager","libraryBrowser","embyRouter","playbackManager","browser","paper-icon-button-light","material-icons","scrollStyles"],function(layoutManager,viewManager,libraryBrowser,embyRouter,playbackManager,browser){"use strict";function renderHeader(){var html="";html+='
';var backIcon=browser.safari?"chevron_left":"";html+='",html+='',html+='',html+='

',html+='
',html+='',html+='',html+='',html+='',html+='',html+='',browser.mobile||(html+=''),html+="
",html+="
",html+='
',html+="
";var viewMenuBar=document.createElement("div");viewMenuBar.classList.add("viewMenuBar"),viewMenuBar.innerHTML=html,browser.chrome||viewMenuBar.classList.add("viewMenuBar-blurred"),document.querySelector(".skinHeader").appendChild(viewMenuBar),lazyLoadViewMenuBarImages(),bindMenuEvents()}function lazyLoadViewMenuBarImages(){require(["imageLoader"],function(imageLoader){imageLoader.lazyChildren(document.querySelector(".viewMenuBar"))})}function onBackClick(){embyRouter.back()}function updateUserInHeader(user){var header=document.querySelector(".viewMenuBar");if(header){var hasImage,headerUserButton=header.querySelector(".headerUserButton");if(user&&user.name&&user.imageUrl){var userButtonHeight=26,url=user.imageUrl;user.supportsImageParams&&(url+="&height="+Math.round(userButtonHeight*Math.max(window.devicePixelRatio||1,2))),headerUserButton&&(updateHeaderUserButton(headerUserButton,url),hasImage=!0)}headerUserButton&&!hasImage&&updateHeaderUserButton(headerUserButton,null),user&&updateLocalUser(user.localUser),requiresUserRefresh=!1}}function updateHeaderUserButton(headerUserButton,src){src?(headerUserButton.classList.add("headerUserButtonRound"),headerUserButton.classList.remove("autoSize"),headerUserButton.innerHTML=''):(headerUserButton.classList.remove("headerUserButtonRound"),headerUserButton.classList.add("autoSize"),headerUserButton.innerHTML='person')}function updateLocalUser(user){var header=document.querySelector(".viewMenuBar"),headerSearchButton=header.querySelector(".headerSearchButton"),btnCast=header.querySelector(".btnCast"),dashboardEntryHeaderButton=header.querySelector(".dashboardEntryHeaderButton");user?(btnCast.classList.remove("hide"),headerSearchButton&&headerSearchButton.classList.remove("hide"),dashboardEntryHeaderButton&&(user.Policy.IsAdministrator?dashboardEntryHeaderButton.classList.remove("hide"):dashboardEntryHeaderButton.classList.add("hide")),require(["apphost"],function(apphost){apphost.supports("voiceinput")?header.querySelector(".headerVoiceButton").classList.add("hide"):header.querySelector(".headerVoiceButton").classList.add("hide")})):(btnCast.classList.add("hide"),header.querySelector(".headerVoiceButton").classList.add("hide"),headerSearchButton&&headerSearchButton.classList.add("hide"),dashboardEntryHeaderButton&&dashboardEntryHeaderButton.classList.add("hide"))}function showVoice(){require(["voiceDialog"],function(voiceDialog){voiceDialog.showDialog()})}function showSearch(){Dashboard.navigate("search.html")}function onHeaderUserButtonClick(e){Dashboard.showUserFlyout(e.target)}function onHeaderAppsButtonClick(){Dashboard.navigate("home.html")}function bindMenuEvents(){mainDrawerButton=document.querySelector(".mainDrawerButton"),mainDrawerButton&&mainDrawerButton.addEventListener("click",toggleMainDrawer);var headerBackButton=document.querySelector(".headerBackButton");headerBackButton&&headerBackButton.addEventListener("click",onBackClick);var headerVoiceButton=document.querySelector(".headerVoiceButton");headerVoiceButton&&headerVoiceButton.addEventListener("click",showVoice);var headerSearchButton=document.querySelector(".headerSearchButton");headerSearchButton&&headerSearchButton.addEventListener("click",showSearch);var headerUserButton=document.querySelector(".headerUserButton");headerUserButton&&headerUserButton.addEventListener("click",onHeaderUserButtonClick);var headerAppsButton=document.querySelector(".headerAppsButton");headerAppsButton&&headerAppsButton.addEventListener("click",onHeaderAppsButtonClick);var viewMenuBar=document.querySelector(".viewMenuBar");initHeadRoom(viewMenuBar),viewMenuBar.querySelector(".btnNotifications").addEventListener("click",function(){Dashboard.navigate("notificationlist.html")});var btnCast=document.querySelector(".headerButton-btnCast");btnCast&&btnCast.addEventListener("click",onCastButtonClicked)}function onCastButtonClicked(){var btn=this;require(["playerSelectionMenu"],function(playerSelectionMenu){playerSelectionMenu.show(btn)})}function getItemHref(item,context){return libraryBrowser.getHref(item,context)}function toggleMainDrawer(){navDrawerInstance.isVisible?closeMainDrawer():openMainDrawer()}function openMainDrawer(){navDrawerInstance.open(),lastOpenTime=(new Date).getTime()}function onMainDrawerOpened(){browser.mobile&&document.body.classList.add("bodyWithPopupOpen")}function closeMainDrawer(){navDrawerInstance.close()}function onMainDrawerSelect(e){navDrawerInstance.isVisible?onMainDrawerOpened():document.body.classList.remove("bodyWithPopupOpen")}function getDrawerUserPanelHtml(user){var html="";return html}function refreshLibraryInfoInDrawer(user,drawer){var html="";html+='
';var homeHref=window.ApiClient?"home.html":"selectserver.html?showuser=1";html+=''+Globalize.translate("ButtonHome")+"",html+=''+Globalize.translate("ButtonRemote")+"",html+='
',html+='
',html+="
";var localUser=user.localUser;localUser&&localUser.Policy.IsAdministrator&&(html+='
',html+='
',html+='
',html+=Globalize.translate("HeaderAdmin"),html+="
",html+=''+Globalize.translate("ButtonManageServer")+"",html+=''+Globalize.translate("MetadataManager")+"",browser.mobile||(html+=''+Globalize.translate("ButtonReports")+""),html+="
"),html+='",navDrawerScrollContainer.innerHTML=getDrawerUserPanelHtml(user)+html;var lnkManageServer=navDrawerScrollContainer.querySelector(".lnkManageServer");lnkManageServer&&lnkManageServer.addEventListener("click",onManageServerClicked),layoutManager.desktop&&navDrawerScrollContainer.classList.add("darkScroller")}function refreshDashboardInfoInDrawer(page,user){loadNavDrawer().then(function(){navDrawerScrollContainer.querySelector(".adminDrawerLogo")?updateDashboardMenuSelectedItem():createDashboardMenu(page)})}function updateDashboardMenuSelectedItem(){for(var links=navDrawerScrollContainer.querySelectorAll(".sidebarLink"),i=0,length=links.length;i',html+=Globalize.translate("HeaderMedia"),html+="",html+=items.map(function(i){var icon="folder",color="inherit",itemId=i.Id;"channels"==i.CollectionType?itemId="channels":"livetv"==i.CollectionType&&(itemId="livetv"),"photos"==i.CollectionType?(icon="photo_library",color="#009688"):"music"==i.CollectionType||"musicvideos"==i.CollectionType?(icon="library_music",color="#FB8521"):"books"==i.CollectionType?(icon="library_books",color="#1AA1E1"):"playlists"==i.CollectionType?(icon="view_list",color="#795548"):"games"==i.CollectionType?(icon="games",color="#F44336"):"movies"==i.CollectionType?(icon="video_library",color="#CE5043"):"channels"==i.CollectionType||"Channel"==i.Type?(icon="videocam",color="#E91E63"):"tvshows"==i.CollectionType?(icon="tv",color="#4CAF50"):"livetv"==i.CollectionType&&(icon="live_tv",color="#293AAE"),icon=i.icon||icon;var onclick=i.onclick?" function(){"+i.onclick+"}":"null";return''+icon+''+i.Name+""}).join(""),libraryMenuOptions.innerHTML=html;for(var elem=libraryMenuOptions,sidebarLinks=elem.querySelectorAll(".sidebarLink"),i=0,length=sidebarLinks.length;i200&&setTimeout(function(){closeMainDrawer(),setTimeout(function(){action?action():Dashboard.navigate(link.href)},getNavigateDelay())},50),event.stopPropagation(),event.preventDefault(),!1)},onLogoutClicked:function(){return(new Date).getTime()-lastOpenTime>200&&(closeMainDrawer(),setTimeout(function(){Dashboard.logout()},getNavigateDelay())),!1},onHardwareMenuButtonClick:function(){toggleMainDrawer()},onSettingsClicked:function(event){return 1!=event.which||(Dashboard.navigate("dashboard.html"),!1)},setTabs:function(type,selectedIndex,builder){require(["mainTabsManager"],function(mainTabsManager){type?mainTabsManager.setTabs(viewManager.currentView(),selectedIndex,builder):mainTabsManager.setTabs(null)})},setDefaultTitle:function(){var libraryMenuButtonText=document.querySelector(".libraryMenuButtonText");libraryMenuButtonText&&(libraryMenuButtonText.innerHTML=''),document.title="Emby"},setTitle:function(title){var html=title,page=viewManager.currentView();if(page){var helpUrl=page.getAttribute("data-helpurl");helpUrl&&(html+='")}var libraryMenuButtonText=document.querySelector(".libraryMenuButtonText");libraryMenuButtonText&&(libraryMenuButtonText.innerHTML=html),document.title=title||"Emby"},setTransparentMenu:function(transparent){var viewMenuBar=document.querySelector(".viewMenuBar");viewMenuBar&&(transparent?viewMenuBar.classList.add("semiTransparent"):viewMenuBar.classList.remove("semiTransparent"))}},pageClassOn("pagebeforeshow","page",function(e){var page=this;page.classList.contains("withTabs")||(LibraryMenu.setTabs(null),page.classList.contains("pageWithAbsoluteTabs")?document.body.classList.add("withTallToolbar"):document.body.classList.remove("withTallToolbar"))}),pageClassOn("pageshow","page",function(e){var page=this,isDashboardPage=page.classList.contains("type-interior");isDashboardPage?(mainDrawerButton&&mainDrawerButton.classList.remove("hide"),refreshDashboardInfoInDrawer(page)):(mainDrawerButton&&(enableLibraryNavDrawer?mainDrawerButton.classList.remove("hide"):mainDrawerButton.classList.add("hide")),(navDrawerElement&&navDrawerElement.classList.contains("adminDrawer")||!navDrawerElement)&&refreshLibraryDrawer()),setDrawerClass(page),updateViewMenuBar(page),e.detail.isRestored||window.scrollTo(0,0),updateTitle(page),updateBackButton(page),page.classList.contains("libraryPage")?(document.body.classList.add("libraryDocument"),document.body.classList.remove("dashboardDocument"),document.body.classList.remove("hideMainDrawer")):isDashboardPage?(document.body.classList.remove("libraryDocument"),document.body.classList.add("dashboardDocument"),document.body.classList.remove("hideMainDrawer")):(document.body.classList.remove("libraryDocument"),document.body.classList.remove("dashboardDocument"),document.body.classList.add("hideMainDrawer")),updateLibraryNavLinks(page)}),window.ApiClient&&initializeApiClient(window.ApiClient),renderHeader(),Events.on(ConnectionManager,"apiclientcreated",function(e,apiClient){initializeApiClient(apiClient)}),Events.on(ConnectionManager,"localusersignedin",function(e,user){setDrawerClass(),ConnectionManager.user(ConnectionManager.getApiClient(user.ServerId)).then(function(user){refreshLibraryDrawer(user),updateUserInHeader(user)})}),Events.on(ConnectionManager,"localusersignedout",updateUserInHeader),Events.on(playbackManager,"playerchange",updateCastIcon),setDrawerClass(),enableBottomTabs&&require(["appfooter-shared","dockedtabs"],function(footer,dockedtabs){new dockedtabs({appFooter:footer})}),LibraryMenu}); \ No newline at end of file diff --git a/dashboard-ui/scripts/livetvsuggested.js b/dashboard-ui/scripts/livetvsuggested.js index 89f497bbbd..fbf9bad9af 100644 --- a/dashboard-ui/scripts/livetvsuggested.js +++ b/dashboard-ui/scripts/livetvsuggested.js @@ -1 +1 @@ -define(["libraryBrowser","mainTabsManager","cardBuilder","apphost","imageLoader","scrollStyles","emby-itemscontainer","emby-tabs","emby-button"],function(libraryBrowser,mainTabsManager,cardBuilder,appHost,imageLoader){"use strict";function enableScrollX(){return browserInfo.mobile}function renderRecordings(elem,recordings,cardOptions){recordings.length?elem.classList.remove("hide"):elem.classList.add("hide");var recordingItems=elem.querySelector(".recordingItems");enableScrollX()?(recordingItems.classList.add("hiddenScrollX"),recordingItems.classList.remove("vertical-wrap")):(recordingItems.classList.remove("hiddenScrollX"),recordingItems.classList.add("vertical-wrap")),recordingItems.innerHTML=cardBuilder.getCardsHtml(Object.assign({items:recordings,shape:enableScrollX()?"autooverflow":"auto",showTitle:!0,showParentTitle:!0,coverImage:!0,lazy:!0,cardLayout:!0,allowBottomPadding:!enableScrollX(),preferThumb:"auto"},cardOptions||{})),imageLoader.lazyChildren(recordingItems)}function getBackdropShape(){return enableScrollX()?"overflowBackdrop":"backdrop"}function renderActiveRecordings(context,promise){promise.then(function(result){result.Items.length&&"InProgress"!=result.Items[0].Status&&(result.Items=[]),renderRecordings(context.querySelector("#activeRecordings"),result.Items,{shape:getBackdropShape(),showParentTitle:!1,showTitle:!0,showAirTime:!0,showAirEndTime:!0,showChannelName:!0,cardLayout:!0,preferThumb:!0,coverImage:!0,overlayText:!1})})}function getPortraitShape(){return enableScrollX()?"overflowPortrait":"portrait"}function getLimit(){return enableScrollX()?12:8}function loadRecommendedPrograms(page){Dashboard.showLoadingMsg();var limit=getLimit();enableScrollX()&&(limit*=2),ApiClient.getLiveTvRecommendedPrograms({userId:Dashboard.getCurrentUserId(),IsAiring:!0,limit:limit,ImageTypeLimit:1,EnableImageTypes:"Primary,Thumb,Backdrop",EnableTotalRecordCount:!1,Fields:"ChannelInfo"}).then(function(result){renderItems(page,result.Items,"activeProgramItems","play",{showAirDateTime:!1,showAirEndTime:!0}),Dashboard.hideLoadingMsg()})}function reload(page,enableFullRender){renderActiveRecordings(page,ApiClient.getLiveTvRecordings({UserId:Dashboard.getCurrentUserId(),IsInProgress:!0,Fields:"CanDelete,PrimaryImageAspectRatio,BasicSyncInfo",EnableTotalRecordCount:!1,EnableImageTypes:"Primary,Thumb,Backdrop"})),enableFullRender&&(loadRecommendedPrograms(page),ApiClient.getLiveTvRecommendedPrograms({userId:Dashboard.getCurrentUserId(),IsAiring:!1,HasAired:!1,limit:getLimit(),IsMovie:!1,IsSports:!1,IsKids:!1,IsNews:!1,IsSeries:!0,EnableTotalRecordCount:!1,Fields:"ChannelInfo",EnableImageTypes:"Primary,Thumb"}).then(function(result){renderItems(page,result.Items,"upcomingEpisodeItems")}),ApiClient.getLiveTvRecommendedPrograms({userId:Dashboard.getCurrentUserId(),IsAiring:!1,HasAired:!1,limit:getLimit(),IsMovie:!0,EnableTotalRecordCount:!1,Fields:"ChannelInfo",EnableImageTypes:"Primary,Thumb"}).then(function(result){renderItems(page,result.Items,"upcomingTvMovieItems",null,{shape:getPortraitShape(),preferThumb:null})}),ApiClient.getLiveTvRecommendedPrograms({userId:Dashboard.getCurrentUserId(),IsAiring:!1,HasAired:!1,limit:getLimit(),IsSports:!0,EnableTotalRecordCount:!1,Fields:"ChannelInfo",EnableImageTypes:"Primary,Thumb"}).then(function(result){renderItems(page,result.Items,"upcomingSportsItems")}),ApiClient.getLiveTvRecommendedPrograms({userId:Dashboard.getCurrentUserId(),IsAiring:!1,HasAired:!1,limit:getLimit(),IsKids:!0,EnableTotalRecordCount:!1,Fields:"ChannelInfo",EnableImageTypes:"Primary,Thumb"}).then(function(result){renderItems(page,result.Items,"upcomingKidsItems")}),ApiClient.getLiveTvRecommendedPrograms({userId:Dashboard.getCurrentUserId(),IsAiring:!1,HasAired:!1,limit:getLimit(),IsMovie:!1,IsSports:!1,IsKids:!1,IsSeries:!1,EnableTotalRecordCount:!1,Fields:"ChannelInfo",EnableImageTypes:"Primary,Thumb"}).then(function(result){result.Items.length?page.querySelector(".upcomingPrograms").classList.remove("hide"):page.querySelector(".upcomingPrograms").classList.add("hide"),renderItems(page,result.Items,"upcomingProgramItems")}))}function renderItems(page,items,sectionClass,overlayButton,cardOptions){cardOptions=cardOptions||{};var html=cardBuilder.getCardsHtml(Object.assign({items:items,preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowBackdrop":"backdrop",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,lazy:!0,overlayMoreButton:"play"!=overlayButton,overlayPlayButton:"play"==overlayButton,allowBottomPadding:!enableScrollX(),showAirTime:!0,showAirDateTime:!0,showChannelName:!0},cardOptions)),elem=page.querySelector("."+sectionClass);elem.innerHTML=html,imageLoader.lazyChildren(elem)}function getTabs(){return[{name:Globalize.translate("TabSuggestions")},{name:Globalize.translate("TabGuide")},{name:Globalize.translate("TabChannels")},{name:Globalize.translate("TabRecordings")},{name:Globalize.translate("HeaderSchedule")},{name:Globalize.translate("TabSeries")}]}return function(view,params){function enableFullRender(){return(new Date).getTime()-lastFullRender>3e5}function onBeforeTabChange(e){preLoadTab(view,parseInt(e.detail.selectedTabIndex))}function onTabChange(e){var previousTabController=tabControllers[parseInt(e.detail.previousIndex)];previousTabController&&previousTabController.onHide&&previousTabController.onHide(),loadTab(view,parseInt(e.detail.selectedTabIndex))}function initTabs(){var tabsReplaced=mainTabsManager.setTabs("livetv",currentTabIndex,getTabs);if(tabsReplaced){var viewTabs=document.querySelector(".tabs-viewmenubar");viewTabs.addEventListener("beforetabchange",onBeforeTabChange),viewTabs.addEventListener("tabchange",onTabChange),libraryBrowser.configurePaperLibraryTabs(view,viewTabs,view.querySelectorAll(".pageTabContent"),[0,2,3,4,5]),viewTabs.triggerBeforeTabChange||viewTabs.addEventListener("ready",function(){viewTabs.triggerBeforeTabChange()})}}function getTabController(page,index,callback){var depends=[];switch(index){case 0:break;case 1:depends.push("scripts/livetvguide");break;case 2:depends.push("scripts/livetvchannels");break;case 3:depends.push("scripts/livetvrecordings");break;case 4:depends.push("scripts/livetvschedule");break;case 5:depends.push("scripts/livetvseriestimers")}require(depends,function(controllerFactory){var tabContent;0==index&&(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),self.tabContent=tabContent);var controller=tabControllers[index];controller||(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),controller=index?new controllerFactory(view,params,tabContent):self,tabControllers[index]=controller,controller.initTab&&controller.initTab()),callback(controller)})}function preLoadTab(page,index){getTabController(page,index,function(controller){renderedTabs.indexOf(index)==-1&&controller.preRender&&controller.preRender()})}function loadTab(page,index){currentTabIndex=index,getTabController(page,index,function(controller){1===index?document.body.classList.add("autoScrollY"):document.body.classList.remove("autoScrollY"),renderedTabs.indexOf(index)==-1?(1===index&&renderedTabs.push(index),controller.renderTab()):controller.onShow&&controller.onShow(),currentTabController=controller})}var self=this,currentTabIndex=parseInt(params.tab||"0"),lastFullRender=0;self.initTab=function(){for(var tabContent=view.querySelector(".pageTabContent[data-index='0']"),containers=tabContent.querySelectorAll(".itemsContainer"),i=0,length=containers.length;i3e5}function onBeforeTabChange(e){preLoadTab(view,parseInt(e.detail.selectedTabIndex))}function onTabChange(e){var previousTabController=tabControllers[parseInt(e.detail.previousIndex)];previousTabController&&previousTabController.onHide&&previousTabController.onHide(),loadTab(view,parseInt(e.detail.selectedTabIndex))}function initTabs(){var tabsReplaced=mainTabsManager.setTabs(view,currentTabIndex,getTabs);if(tabsReplaced){var viewTabs=document.querySelector(".tabs-viewmenubar");viewTabs.addEventListener("beforetabchange",onBeforeTabChange),viewTabs.addEventListener("tabchange",onTabChange),libraryBrowser.configurePaperLibraryTabs(view,viewTabs,view.querySelectorAll(".pageTabContent"),[0,2,3,4,5]),viewTabs.triggerBeforeTabChange||viewTabs.addEventListener("ready",function(){viewTabs.triggerBeforeTabChange()})}}function getTabController(page,index,callback){var depends=[];switch(index){case 0:break;case 1:depends.push("scripts/livetvguide");break;case 2:depends.push("scripts/livetvchannels");break;case 3:depends.push("scripts/livetvrecordings");break;case 4:depends.push("scripts/livetvschedule");break;case 5:depends.push("scripts/livetvseriestimers")}require(depends,function(controllerFactory){var tabContent;0==index&&(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),self.tabContent=tabContent);var controller=tabControllers[index];controller||(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),controller=index?new controllerFactory(view,params,tabContent):self,tabControllers[index]=controller,controller.initTab&&controller.initTab()),callback(controller)})}function preLoadTab(page,index){getTabController(page,index,function(controller){renderedTabs.indexOf(index)==-1&&controller.preRender&&controller.preRender()})}function loadTab(page,index){currentTabIndex=index,getTabController(page,index,function(controller){1===index?document.body.classList.add("autoScrollY"):document.body.classList.remove("autoScrollY"),renderedTabs.indexOf(index)==-1?(1===index&&renderedTabs.push(index),controller.renderTab()):controller.onShow&&controller.onShow(),currentTabController=controller})}var self=this,currentTabIndex=parseInt(params.tab||"0"),lastFullRender=0;self.initTab=function(){for(var tabContent=view.querySelector(".pageTabContent[data-index='0']"),containers=tabContent.querySelectorAll(".itemsContainer"),i=0,length=containers.length;i=1920?5:screenWidth>=1600?5:3,Recursive:!0,Fields:"PrimaryImageAspectRatio,MediaSourceCount,BasicSyncInfo",CollapseBoxSetItems:!1,ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};ApiClient.getItems(userId,options).then(function(result){result.Items.length?page.querySelector("#resumableSection").classList.remove("hide"):page.querySelector("#resumableSection").classList.add("hide");var allowBottomPadding=!enableScrollX(),container=page.querySelector("#resumableItems"),cardLayout=!1;cardBuilder.buildCards(result.Items,{itemsContainer:container,preferThumb:!0,shape:getThumbShape(),scalable:!0,overlayPlayButton:!0,allowBottomPadding:allowBottomPadding,cardLayout:cardLayout,showTitle:!0,showYear:!0,centerText:!cardLayout})})}function getRecommendationHtml(recommendation){var html="",title="";switch(recommendation.RecommendationType){case"SimilarToRecentlyPlayed":title=Globalize.translate("RecommendationBecauseYouWatched").replace("{0}",recommendation.BaselineItemName);break;case"SimilarToLikedItem":title=Globalize.translate("RecommendationBecauseYouLike").replace("{0}",recommendation.BaselineItemName);break;case"HasDirectorFromRecentlyPlayed":case"HasLikedDirector":title=Globalize.translate("RecommendationDirectedBy").replace("{0}",recommendation.BaselineItemName);break;case"HasActorFromRecentlyPlayed":case"HasLikedActor":title=Globalize.translate("RecommendationStarring").replace("{0}",recommendation.BaselineItemName)}html+='
',html+='

'+title+"

";var allowBottomPadding=!0;return enableScrollX()?(allowBottomPadding=!1,html+='
'):html+='
',html+=cardBuilder.getCardsHtml(recommendation.Items,{shape:getPortraitShape(),scalable:!0,overlayPlayButton:!0,allowBottomPadding:allowBottomPadding}),html+="
",html+="
"}function loadSuggestions(page,userId,parentId){var screenWidth=dom.getWindowSize().innerWidth,url=ApiClient.getUrl("Movies/Recommendations",{userId:userId,categoryLimit:6,ItemLimit:screenWidth>=1920?8:screenWidth>=1600?8:screenWidth>=1200?6:5,Fields:"PrimaryImageAspectRatio,MediaSourceCount,BasicSyncInfo",ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb"});ApiClient.getJSON(url).then(function(recommendations){if(!recommendations.length)return page.querySelector(".noItemsMessage").classList.remove("hide"),void(page.querySelector(".recommendations").innerHTML="");var html=recommendations.map(getRecommendationHtml).join("");page.querySelector(".noItemsMessage").classList.add("hide");var recs=page.querySelector(".recommendations");recs.innerHTML=html,imageLoader.lazyChildren(recs)})}function initSuggestedTab(page,tabContent){for(var containers=tabContent.querySelectorAll(".itemsContainer"),i=0,length=containers.length;i=1920?5:screenWidth>=1600?5:3,Recursive:!0,Fields:"PrimaryImageAspectRatio,MediaSourceCount,BasicSyncInfo",CollapseBoxSetItems:!1,ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};ApiClient.getItems(userId,options).then(function(result){result.Items.length?page.querySelector("#resumableSection").classList.remove("hide"):page.querySelector("#resumableSection").classList.add("hide");var allowBottomPadding=!enableScrollX(),container=page.querySelector("#resumableItems"),cardLayout=!1;cardBuilder.buildCards(result.Items,{itemsContainer:container,preferThumb:!0,shape:getThumbShape(),scalable:!0,overlayPlayButton:!0,allowBottomPadding:allowBottomPadding,cardLayout:cardLayout,showTitle:!0,showYear:!0,centerText:!cardLayout})})}function getRecommendationHtml(recommendation){var html="",title="";switch(recommendation.RecommendationType){case"SimilarToRecentlyPlayed":title=Globalize.translate("RecommendationBecauseYouWatched").replace("{0}",recommendation.BaselineItemName);break;case"SimilarToLikedItem":title=Globalize.translate("RecommendationBecauseYouLike").replace("{0}",recommendation.BaselineItemName);break;case"HasDirectorFromRecentlyPlayed":case"HasLikedDirector":title=Globalize.translate("RecommendationDirectedBy").replace("{0}",recommendation.BaselineItemName);break;case"HasActorFromRecentlyPlayed":case"HasLikedActor":title=Globalize.translate("RecommendationStarring").replace("{0}",recommendation.BaselineItemName)}html+='
',html+='

'+title+"

";var allowBottomPadding=!0;return enableScrollX()?(allowBottomPadding=!1,html+='
'):html+='
',html+=cardBuilder.getCardsHtml(recommendation.Items,{shape:getPortraitShape(),scalable:!0,overlayPlayButton:!0,allowBottomPadding:allowBottomPadding}),html+="
",html+="
"}function loadSuggestions(page,userId,parentId){var screenWidth=dom.getWindowSize().innerWidth,url=ApiClient.getUrl("Movies/Recommendations",{userId:userId,categoryLimit:6,ItemLimit:screenWidth>=1920?8:screenWidth>=1600?8:screenWidth>=1200?6:5,Fields:"PrimaryImageAspectRatio,MediaSourceCount,BasicSyncInfo",ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb"});ApiClient.getJSON(url).then(function(recommendations){if(!recommendations.length)return page.querySelector(".noItemsMessage").classList.remove("hide"),void(page.querySelector(".recommendations").innerHTML="");var html=recommendations.map(getRecommendationHtml).join("");page.querySelector(".noItemsMessage").classList.add("hide");var recs=page.querySelector(".recommendations");recs.innerHTML=html,imageLoader.lazyChildren(recs)})}function initSuggestedTab(page,tabContent){for(var containers=tabContent.querySelectorAll(".itemsContainer"),i=0,length=containers.length;i=1920?9:screenWidth>=1200?12:screenWidth>=1e3?10:8}function enableScrollX(){return browserInfo.mobile}function getSquareShape(){return enableScrollX()?"overflowSquare":"square"}function loadLatest(page,parentId){Dashboard.showLoadingMsg();var userId=Dashboard.getCurrentUserId(),options={IncludeItemTypes:"Audio",Limit:itemsPerRow(),Fields:"PrimaryImageAspectRatio,BasicSyncInfo",ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};ApiClient.getJSON(ApiClient.getUrl("Users/"+userId+"/Items/Latest",options)).then(function(items){var elem=page.querySelector("#recentlyAddedSongs"),supportsImageAnalysis=appHost.supports("imageanalysis");elem.innerHTML=cardBuilder.getCardsHtml({items:items,showUnplayedIndicator:!1,showLatestItemsPopup:!1,shape:getSquareShape(),showTitle:!0,showParentTitle:!0,lazy:!0,centerText:!supportsImageAnalysis,overlayPlayButton:!supportsImageAnalysis,allowBottomPadding:!enableScrollX(),cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis}),imageLoader.lazyChildren(elem),Dashboard.hideLoadingMsg()})}function loadRecentlyPlayed(page,parentId){var options={SortBy:"DatePlayed",SortOrder:"Descending",IncludeItemTypes:"Audio",Limit:itemsPerRow(),Recursive:!0,Fields:"PrimaryImageAspectRatio,AudioInfo",Filters:"IsPlayed",ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};ApiClient.getItems(Dashboard.getCurrentUserId(),options).then(function(result){var elem=page.querySelector("#recentlyPlayed");result.Items.length?elem.classList.remove("hide"):elem.classList.add("hide");var itemsContainer=elem.querySelector(".itemsContainer"),supportsImageAnalysis=appHost.supports("imageanalysis");itemsContainer.innerHTML=cardBuilder.getCardsHtml({items:result.Items,showUnplayedIndicator:!1,shape:getSquareShape(),showTitle:!0,showParentTitle:!0,action:"instantmix",lazy:!0,centerText:!supportsImageAnalysis,overlayMoreButton:!supportsImageAnalysis,allowBottomPadding:!enableScrollX(),cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis}),imageLoader.lazyChildren(itemsContainer)})}function loadFrequentlyPlayed(page,parentId){var options={SortBy:"PlayCount",SortOrder:"Descending",IncludeItemTypes:"Audio",Limit:itemsPerRow(),Recursive:!0,Fields:"PrimaryImageAspectRatio,AudioInfo",Filters:"IsPlayed",ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};ApiClient.getItems(Dashboard.getCurrentUserId(),options).then(function(result){var elem=page.querySelector("#topPlayed");result.Items.length?elem.classList.remove("hide"):elem.classList.add("hide");var itemsContainer=elem.querySelector(".itemsContainer"),supportsImageAnalysis=appHost.supports("imageanalysis");itemsContainer.innerHTML=cardBuilder.getCardsHtml({items:result.Items,showUnplayedIndicator:!1,shape:getSquareShape(),showTitle:!0,showParentTitle:!0,action:"instantmix",lazy:!0,centerText:!supportsImageAnalysis,overlayMoreButton:!supportsImageAnalysis,allowBottomPadding:!enableScrollX(),cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis}),imageLoader.lazyChildren(itemsContainer)})}function loadPlaylists(page,parentId){var options={SortBy:"SortName",SortOrder:"Ascending",IncludeItemTypes:"Playlist",Recursive:!0,Fields:"PrimaryImageAspectRatio,SortName,CumulativeRunTimeTicks,CanDelete",StartIndex:0,Limit:itemsPerRow(),EnableTotalRecordCount:!1};ApiClient.getItems(Dashboard.getCurrentUserId(),options).then(function(result){var elem=page.querySelector("#playlists");result.Items.length?elem.classList.remove("hide"):elem.classList.add("hide");var itemsContainer=elem.querySelector(".itemsContainer"),supportsImageAnalysis=appHost.supports("imageanalysis");itemsContainer.innerHTML=cardBuilder.getCardsHtml({items:result.Items,shape:getSquareShape(),showTitle:!0,lazy:!0,coverImage:!0,centerText:!supportsImageAnalysis,overlayPlayButton:!supportsImageAnalysis,allowBottomPadding:!enableScrollX(),cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis}),imageLoader.lazyChildren(itemsContainer)})}function loadSuggestionsTab(page,tabContent,parentId){console.log("loadSuggestionsTab"),loadLatest(tabContent,parentId),loadPlaylists(tabContent,parentId),loadRecentlyPlayed(tabContent,parentId),loadFrequentlyPlayed(tabContent,parentId),require(["components/favoriteitems"],function(favoriteItems){favoriteItems.render(tabContent,Dashboard.getCurrentUserId(),parentId,["favoriteArtists","favoriteAlbums","favoriteSongs"])})}function getTabs(){return[{name:Globalize.translate("TabSuggestions")},{name:Globalize.translate("TabAlbums")},{name:Globalize.translate("TabAlbumArtists")},{name:Globalize.translate("TabArtists")},{name:Globalize.translate("TabSongs")},{name:Globalize.translate("TabGenres")},{name:Globalize.translate("TabFolders")}]}return function(view,params){function reload(){Dashboard.showLoadingMsg();var tabContent=view.querySelector(".pageTabContent[data-index='0']");loadSuggestionsTab(view,tabContent,params.topParentId)}function enableScrollX(){return browserInfo.mobile}function onBeforeTabChange(e){preLoadTab(view,parseInt(e.detail.selectedTabIndex))}function onTabChange(e){loadTab(view,parseInt(e.detail.selectedTabIndex))}function initTabs(){var tabsReplaced=mainTabsManager.setTabs("music",currentTabIndex,getTabs);if(tabsReplaced){var viewTabs=document.querySelector(".tabs-viewmenubar");viewTabs.addEventListener("beforetabchange",onBeforeTabChange),viewTabs.addEventListener("tabchange",onTabChange),libraryBrowser.configurePaperLibraryTabs(view,viewTabs,view.querySelectorAll(".pageTabContent"),[0,4,5,6]),viewTabs.triggerBeforeTabChange||viewTabs.addEventListener("ready",function(){viewTabs.triggerBeforeTabChange()})}}function getTabController(page,index,callback){var depends=[];switch(index){case 0:break;case 1:depends.push("scripts/musicalbums");break;case 2:depends.push("scripts/musicartists");break;case 3:depends.push("scripts/musicartists");break;case 4:depends.push("scripts/songs");break;case 5:depends.push("scripts/musicgenres");break;case 6:depends.push("scripts/musicfolders")}require(depends,function(controllerFactory){var tabContent;0==index&&(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),self.tabContent=tabContent);var controller=tabControllers[index];controller||(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),controller=index?new controllerFactory(view,params,tabContent):self,2==index?controller.mode="albumartists":3==index&&(controller.mode="artists"),tabControllers[index]=controller,controller.initTab&&controller.initTab()),callback(controller)})}function preLoadTab(page,index){getTabController(page,index,function(controller){renderedTabs.indexOf(index)==-1&&controller.preRender&&controller.preRender()})}function loadTab(page,index){currentTabIndex=index,getTabController(page,index,function(controller){renderedTabs.indexOf(index)==-1&&(renderedTabs.push(index),controller.renderTab())})}var self=this,currentTabIndex=parseInt(params.tab||"0");self.initTab=function(){for(var tabContent=view.querySelector(".pageTabContent[data-index='0']"),containers=tabContent.querySelectorAll(".itemsContainer"),i=0,length=containers.length;i=1920?9:screenWidth>=1200?12:screenWidth>=1e3?10:8}function enableScrollX(){return browserInfo.mobile}function getSquareShape(){return enableScrollX()?"overflowSquare":"square"}function loadLatest(page,parentId){Dashboard.showLoadingMsg();var userId=Dashboard.getCurrentUserId(),options={IncludeItemTypes:"Audio",Limit:itemsPerRow(),Fields:"PrimaryImageAspectRatio,BasicSyncInfo",ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};ApiClient.getJSON(ApiClient.getUrl("Users/"+userId+"/Items/Latest",options)).then(function(items){var elem=page.querySelector("#recentlyAddedSongs"),supportsImageAnalysis=appHost.supports("imageanalysis");elem.innerHTML=cardBuilder.getCardsHtml({items:items,showUnplayedIndicator:!1,showLatestItemsPopup:!1,shape:getSquareShape(),showTitle:!0,showParentTitle:!0,lazy:!0,centerText:!supportsImageAnalysis,overlayPlayButton:!supportsImageAnalysis,allowBottomPadding:!enableScrollX(),cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis}),imageLoader.lazyChildren(elem),Dashboard.hideLoadingMsg()})}function loadRecentlyPlayed(page,parentId){var options={SortBy:"DatePlayed",SortOrder:"Descending",IncludeItemTypes:"Audio",Limit:itemsPerRow(),Recursive:!0,Fields:"PrimaryImageAspectRatio,AudioInfo",Filters:"IsPlayed",ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};ApiClient.getItems(Dashboard.getCurrentUserId(),options).then(function(result){var elem=page.querySelector("#recentlyPlayed");result.Items.length?elem.classList.remove("hide"):elem.classList.add("hide");var itemsContainer=elem.querySelector(".itemsContainer"),supportsImageAnalysis=appHost.supports("imageanalysis");itemsContainer.innerHTML=cardBuilder.getCardsHtml({items:result.Items,showUnplayedIndicator:!1,shape:getSquareShape(),showTitle:!0,showParentTitle:!0,action:"instantmix",lazy:!0,centerText:!supportsImageAnalysis,overlayMoreButton:!supportsImageAnalysis,allowBottomPadding:!enableScrollX(),cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis}),imageLoader.lazyChildren(itemsContainer)})}function loadFrequentlyPlayed(page,parentId){var options={SortBy:"PlayCount",SortOrder:"Descending",IncludeItemTypes:"Audio",Limit:itemsPerRow(),Recursive:!0,Fields:"PrimaryImageAspectRatio,AudioInfo",Filters:"IsPlayed",ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};ApiClient.getItems(Dashboard.getCurrentUserId(),options).then(function(result){var elem=page.querySelector("#topPlayed");result.Items.length?elem.classList.remove("hide"):elem.classList.add("hide");var itemsContainer=elem.querySelector(".itemsContainer"),supportsImageAnalysis=appHost.supports("imageanalysis");itemsContainer.innerHTML=cardBuilder.getCardsHtml({items:result.Items,showUnplayedIndicator:!1,shape:getSquareShape(),showTitle:!0,showParentTitle:!0,action:"instantmix",lazy:!0,centerText:!supportsImageAnalysis,overlayMoreButton:!supportsImageAnalysis,allowBottomPadding:!enableScrollX(),cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis}),imageLoader.lazyChildren(itemsContainer)})}function loadPlaylists(page,parentId){var options={SortBy:"SortName",SortOrder:"Ascending",IncludeItemTypes:"Playlist",Recursive:!0,Fields:"PrimaryImageAspectRatio,SortName,CumulativeRunTimeTicks,CanDelete",StartIndex:0,Limit:itemsPerRow(),EnableTotalRecordCount:!1};ApiClient.getItems(Dashboard.getCurrentUserId(),options).then(function(result){var elem=page.querySelector("#playlists");result.Items.length?elem.classList.remove("hide"):elem.classList.add("hide");var itemsContainer=elem.querySelector(".itemsContainer"),supportsImageAnalysis=appHost.supports("imageanalysis");itemsContainer.innerHTML=cardBuilder.getCardsHtml({items:result.Items,shape:getSquareShape(),showTitle:!0,lazy:!0,coverImage:!0,centerText:!supportsImageAnalysis,overlayPlayButton:!supportsImageAnalysis,allowBottomPadding:!enableScrollX(),cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis}),imageLoader.lazyChildren(itemsContainer)})}function loadSuggestionsTab(page,tabContent,parentId){console.log("loadSuggestionsTab"),loadLatest(tabContent,parentId),loadPlaylists(tabContent,parentId),loadRecentlyPlayed(tabContent,parentId),loadFrequentlyPlayed(tabContent,parentId),require(["components/favoriteitems"],function(favoriteItems){favoriteItems.render(tabContent,Dashboard.getCurrentUserId(),parentId,["favoriteArtists","favoriteAlbums","favoriteSongs"])})}function getTabs(){return[{name:Globalize.translate("TabSuggestions")},{name:Globalize.translate("TabAlbums")},{name:Globalize.translate("TabAlbumArtists")},{name:Globalize.translate("TabArtists")},{name:Globalize.translate("TabSongs")},{name:Globalize.translate("TabGenres")},{name:Globalize.translate("TabFolders")}]}return function(view,params){function reload(){Dashboard.showLoadingMsg();var tabContent=view.querySelector(".pageTabContent[data-index='0']");loadSuggestionsTab(view,tabContent,params.topParentId)}function enableScrollX(){return browserInfo.mobile}function onBeforeTabChange(e){preLoadTab(view,parseInt(e.detail.selectedTabIndex))}function onTabChange(e){loadTab(view,parseInt(e.detail.selectedTabIndex))}function initTabs(){var tabsReplaced=mainTabsManager.setTabs(view,currentTabIndex,getTabs);if(tabsReplaced){var viewTabs=document.querySelector(".tabs-viewmenubar");viewTabs.addEventListener("beforetabchange",onBeforeTabChange),viewTabs.addEventListener("tabchange",onTabChange),libraryBrowser.configurePaperLibraryTabs(view,viewTabs,view.querySelectorAll(".pageTabContent"),[0,4,5,6]),viewTabs.triggerBeforeTabChange||viewTabs.addEventListener("ready",function(){viewTabs.triggerBeforeTabChange()})}}function getTabController(page,index,callback){var depends=[];switch(index){case 0:break;case 1:depends.push("scripts/musicalbums");break;case 2:depends.push("scripts/musicartists");break;case 3:depends.push("scripts/musicartists");break;case 4:depends.push("scripts/songs");break;case 5:depends.push("scripts/musicgenres");break;case 6:depends.push("scripts/musicfolders")}require(depends,function(controllerFactory){var tabContent;0==index&&(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),self.tabContent=tabContent);var controller=tabControllers[index];controller||(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),controller=index?new controllerFactory(view,params,tabContent):self,2==index?controller.mode="albumartists":3==index&&(controller.mode="artists"),tabControllers[index]=controller,controller.initTab&&controller.initTab()),callback(controller)})}function preLoadTab(page,index){getTabController(page,index,function(controller){renderedTabs.indexOf(index)==-1&&controller.preRender&&controller.preRender()})}function loadTab(page,index){currentTabIndex=index,getTabController(page,index,function(controller){renderedTabs.indexOf(index)==-1&&(renderedTabs.push(index),controller.renderTab())})}var self=this,currentTabIndex=parseInt(params.tab||"0");self.initTab=function(){for(var tabContent=view.querySelector(".pageTabContent[data-index='0']"),containers=tabContent.querySelectorAll(".itemsContainer"),i=0,length=containers.length;i=1600?5:6,options={SortBy:"DatePlayed",SortOrder:"Descending",IncludeItemTypes:"Episode",Filters:"IsResumable",Limit:limit,Recursive:!0,Fields:"PrimaryImageAspectRatio,SeriesInfo,UserData,BasicSyncInfo",ExcludeLocationTypes:"Virtual",ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Thumb",EnableTotalRecordCount:!1};ApiClient.getItems(Dashboard.getCurrentUserId(),options).then(function(result){result.Items.length?view.querySelector("#resumableSection").classList.remove("hide"):view.querySelector("#resumableSection").classList.add("hide");var allowBottomPadding=!enableScrollX(),container=view.querySelector("#resumableItems"),supportsImageAnalysis=appHost.supports("imageanalysis"),cardLayout=supportsImageAnalysis;cardBuilder.buildCards(result.Items,{itemsContainer:container,preferThumb:!0,shape:getThumbShape(),scalable:!0,showTitle:!0,showParentTitle:!0,overlayText:!1,centerText:!cardLayout,overlayPlayButton:!0,allowBottomPadding:allowBottomPadding,cardLayout:cardLayout,vibrant:supportsImageAnalysis})})}function onBeforeTabChange(e){preLoadTab(view,parseInt(e.detail.selectedTabIndex))}function onTabChange(e){loadTab(view,parseInt(e.detail.selectedTabIndex))}function initTabs(){var tabsReplaced=mainTabsManager.setTabs("tv",currentTabIndex,getTabs);if(tabsReplaced){var viewTabs=document.querySelector(".tabs-viewmenubar");viewTabs.addEventListener("beforetabchange",onBeforeTabChange),viewTabs.addEventListener("tabchange",onTabChange),libraryBrowser.configurePaperLibraryTabs(view,viewTabs,view.querySelectorAll(".pageTabContent"),[0,1,2,4,5,6]),viewTabs.triggerBeforeTabChange||viewTabs.addEventListener("ready",function(){viewTabs.triggerBeforeTabChange()})}}function getTabController(page,index,callback){var depends=[];switch(index){case 0:break;case 1:depends.push("scripts/tvlatest");break;case 2:depends.push("scripts/tvshows");break;case 3:depends.push("scripts/tvupcoming");break;case 4:depends.push("scripts/tvgenres");break;case 5:depends.push("scripts/tvstudios");break;case 6:depends.push("scripts/episodes")}require(depends,function(controllerFactory){var tabContent;0==index&&(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),self.tabContent=tabContent);var controller=tabControllers[index];controller||(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),controller=index?new controllerFactory(view,params,tabContent):self,tabControllers[index]=controller,controller.initTab&&controller.initTab()),callback(controller)})}function preLoadTab(page,index){getTabController(page,index,function(controller){renderedTabs.indexOf(index)==-1&&controller.preRender&&controller.preRender()})}function loadTab(page,index){currentTabIndex=index,getTabController(page,index,function(controller){renderedTabs.indexOf(index)==-1&&(renderedTabs.push(index),controller.renderTab())})}function onPlaybackStop(e,state){state.NowPlayingItem&&"Video"==state.NowPlayingItem.MediaType&&(renderedTabs=[],mainTabsManager.getTabsElement().triggerTabChange())}function onWebSocketMessage(e,data){var msg=data;"UserDataChanged"===msg.MessageType&&msg.Data.UserId==Dashboard.getCurrentUserId()&&(renderedTabs=[])}var self=this,currentTabIndex=parseInt(params.tab||"0");self.initTab=function(){var tabContent=self.tabContent,resumableItemsContainer=tabContent.querySelector("#resumableItems");enableScrollX()?(resumableItemsContainer.classList.add("hiddenScrollX"),resumableItemsContainer.classList.remove("vertical-wrap")):(resumableItemsContainer.classList.remove("hiddenScrollX"),resumableItemsContainer.classList.add("vertical-wrap")),categorysyncbuttons.init(tabContent)},self.renderTab=function(){reload()};var tabControllers=[],renderedTabs=[];enableScrollX()?view.querySelector("#resumableItems").classList.add("hiddenScrollX"):view.querySelector("#resumableItems").classList.remove("hiddenScrollX"),view.addEventListener("viewbeforeshow",function(e){if(initTabs(),!view.getAttribute("data-title")){var parentId=params.topParentId;parentId?ApiClient.getItem(Dashboard.getCurrentUserId(),parentId).then(function(item){view.setAttribute("data-title",item.Name),LibraryMenu.setTitle(item.Name)}):(view.setAttribute("data-title",Globalize.translate("TabShows")),LibraryMenu.setTitle(Globalize.translate("TabShows")))}var tabs=mainTabsManager.getTabsElement();tabs.triggerBeforeTabChange&&tabs.triggerBeforeTabChange(),Events.on(playbackManager,"playbackstop",onPlaybackStop),Events.on(ApiClient,"websocketmessage",onWebSocketMessage)}),view.addEventListener("viewshow",function(e){mainTabsManager.getTabsElement().triggerTabChange()}),view.addEventListener("viewbeforehide",function(e){Events.off(playbackManager,"playbackstop",onPlaybackStop),Events.off(ApiClient,"websocketmessage",onWebSocketMessage)}),view.addEventListener("viewdestroy",function(e){tabControllers.forEach(function(t){t.destroy&&t.destroy()})})}}); \ No newline at end of file +define(["libraryBrowser","dom","components/categorysyncbuttons","cardBuilder","apphost","playbackManager","mainTabsManager","scrollStyles","emby-itemscontainer","emby-button"],function(libraryBrowser,dom,categorysyncbuttons,cardBuilder,appHost,playbackManager,mainTabsManager){"use strict";function getTabs(){return[{name:Globalize.translate("TabSuggestions")},{name:Globalize.translate("TabLatest")},{name:Globalize.translate("TabShows")},{name:Globalize.translate("TabUpcoming")},{name:Globalize.translate("TabGenres")},{name:Globalize.translate("TabNetworks")},{name:Globalize.translate("TabEpisodes")}]}return function(view,params){function reload(){Dashboard.showLoadingMsg(),loadResume(),loadNextUp()}function loadNextUp(){var query={Limit:24,Fields:"PrimaryImageAspectRatio,SeriesInfo,DateCreated,BasicSyncInfo",UserId:Dashboard.getCurrentUserId(),ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Thumb",EnableTotalRecordCount:!1};query.ParentId=LibraryMenu.getTopParentId(),ApiClient.getNextUpEpisodes(query).then(function(result){result.Items.length?view.querySelector(".noNextUpItems").classList.add("hide"):view.querySelector(".noNextUpItems").classList.remove("hide");var container=view.querySelector("#nextUpItems"),supportsImageAnalysis=appHost.supports("imageanalysis");cardBuilder.buildCards(result.Items,{itemsContainer:container,preferThumb:!0,shape:"backdrop",scalable:!0,showTitle:!0,showParentTitle:!0,overlayText:!1,centerText:!supportsImageAnalysis,overlayPlayButton:!0,cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis}),Dashboard.hideLoadingMsg()})}function enableScrollX(){return browserInfo.mobile}function getThumbShape(){return enableScrollX()?"overflowBackdrop":"backdrop"}function loadResume(){var parentId=LibraryMenu.getTopParentId(),screenWidth=dom.getWindowSize().innerWidth,limit=screenWidth>=1600?5:6,options={SortBy:"DatePlayed",SortOrder:"Descending",IncludeItemTypes:"Episode",Filters:"IsResumable",Limit:limit,Recursive:!0,Fields:"PrimaryImageAspectRatio,SeriesInfo,UserData,BasicSyncInfo",ExcludeLocationTypes:"Virtual",ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Thumb",EnableTotalRecordCount:!1};ApiClient.getItems(Dashboard.getCurrentUserId(),options).then(function(result){result.Items.length?view.querySelector("#resumableSection").classList.remove("hide"):view.querySelector("#resumableSection").classList.add("hide");var allowBottomPadding=!enableScrollX(),container=view.querySelector("#resumableItems"),supportsImageAnalysis=appHost.supports("imageanalysis"),cardLayout=supportsImageAnalysis;cardBuilder.buildCards(result.Items,{itemsContainer:container,preferThumb:!0,shape:getThumbShape(),scalable:!0,showTitle:!0,showParentTitle:!0,overlayText:!1,centerText:!cardLayout,overlayPlayButton:!0,allowBottomPadding:allowBottomPadding,cardLayout:cardLayout,vibrant:supportsImageAnalysis})})}function onBeforeTabChange(e){preLoadTab(view,parseInt(e.detail.selectedTabIndex))}function onTabChange(e){loadTab(view,parseInt(e.detail.selectedTabIndex))}function initTabs(){var tabsReplaced=mainTabsManager.setTabs(view,currentTabIndex,getTabs);if(tabsReplaced){var viewTabs=document.querySelector(".tabs-viewmenubar");viewTabs.addEventListener("beforetabchange",onBeforeTabChange),viewTabs.addEventListener("tabchange",onTabChange),libraryBrowser.configurePaperLibraryTabs(view,viewTabs,view.querySelectorAll(".pageTabContent"),[0,1,2,4,5,6]),viewTabs.triggerBeforeTabChange||viewTabs.addEventListener("ready",function(){viewTabs.triggerBeforeTabChange()})}}function getTabController(page,index,callback){var depends=[];switch(index){case 0:break;case 1:depends.push("scripts/tvlatest");break;case 2:depends.push("scripts/tvshows");break;case 3:depends.push("scripts/tvupcoming");break;case 4:depends.push("scripts/tvgenres");break;case 5:depends.push("scripts/tvstudios");break;case 6:depends.push("scripts/episodes")}require(depends,function(controllerFactory){var tabContent;0==index&&(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),self.tabContent=tabContent);var controller=tabControllers[index];controller||(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),controller=index?new controllerFactory(view,params,tabContent):self,tabControllers[index]=controller,controller.initTab&&controller.initTab()),callback(controller)})}function preLoadTab(page,index){getTabController(page,index,function(controller){renderedTabs.indexOf(index)==-1&&controller.preRender&&controller.preRender()})}function loadTab(page,index){currentTabIndex=index,getTabController(page,index,function(controller){renderedTabs.indexOf(index)==-1&&(renderedTabs.push(index),controller.renderTab())})}function onPlaybackStop(e,state){state.NowPlayingItem&&"Video"==state.NowPlayingItem.MediaType&&(renderedTabs=[],mainTabsManager.getTabsElement().triggerTabChange())}function onWebSocketMessage(e,data){var msg=data;"UserDataChanged"===msg.MessageType&&msg.Data.UserId==Dashboard.getCurrentUserId()&&(renderedTabs=[])}var self=this,currentTabIndex=parseInt(params.tab||"0");self.initTab=function(){var tabContent=self.tabContent,resumableItemsContainer=tabContent.querySelector("#resumableItems");enableScrollX()?(resumableItemsContainer.classList.add("hiddenScrollX"),resumableItemsContainer.classList.remove("vertical-wrap")):(resumableItemsContainer.classList.remove("hiddenScrollX"),resumableItemsContainer.classList.add("vertical-wrap")),categorysyncbuttons.init(tabContent)},self.renderTab=function(){reload()};var tabControllers=[],renderedTabs=[];enableScrollX()?view.querySelector("#resumableItems").classList.add("hiddenScrollX"):view.querySelector("#resumableItems").classList.remove("hiddenScrollX"),view.addEventListener("viewbeforeshow",function(e){if(initTabs(),!view.getAttribute("data-title")){var parentId=params.topParentId;parentId?ApiClient.getItem(Dashboard.getCurrentUserId(),parentId).then(function(item){view.setAttribute("data-title",item.Name),LibraryMenu.setTitle(item.Name)}):(view.setAttribute("data-title",Globalize.translate("TabShows")),LibraryMenu.setTitle(Globalize.translate("TabShows")))}var tabs=mainTabsManager.getTabsElement();tabs.triggerBeforeTabChange&&tabs.triggerBeforeTabChange(),Events.on(playbackManager,"playbackstop",onPlaybackStop),Events.on(ApiClient,"websocketmessage",onWebSocketMessage)}),view.addEventListener("viewshow",function(e){mainTabsManager.getTabsElement().triggerTabChange()}),view.addEventListener("viewbeforehide",function(e){Events.off(playbackManager,"playbackstop",onPlaybackStop),Events.off(ApiClient,"websocketmessage",onWebSocketMessage)}),view.addEventListener("viewdestroy",function(e){tabControllers.forEach(function(t){t.destroy&&t.destroy()})})}}); \ No newline at end of file