From 78e374cf8532871563ccafa64332a36eeab3f4c6 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 4 Feb 2017 18:14:25 -0500 Subject: [PATCH 1/2] update channel mapping --- .../bower_components/emby-webcomponents/cardbuilder/card.css | 2 +- .../bower_components/emby-webcomponents/chromecastplayer.js | 2 +- .../emby-webcomponents/emby-tabs/emby-tabs.css | 2 +- .../emby-webcomponents/playback/playerselection.js | 2 +- dashboard-ui/components/channelmapper/channelmapper.js | 2 +- dashboard-ui/devices/ios/ios.css | 2 +- dashboard-ui/manifest.json | 2 +- dashboard-ui/scripts/nowplayingbar.js | 2 +- dashboard-ui/scripts/selectserver.js | 2 +- dashboard-ui/scripts/site.js | 4 ++-- dashboard-ui/videoosd.html | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/card.css b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/card.css index 09fb1ad7e7..880f477943 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/card.css +++ b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/card.css @@ -1 +1 @@ -.card,.card:focus{font-weight:inherit!important}.card,.cardImageContainer-button,.textActionButton{cursor:pointer;outline:0!important}button::-moz-focus-inner{padding:0;border:0}button{-webkit-border-fit:border!important}.card{border:0;font-size:inherit!important;font-family:inherit!important;text-transform:none;background:0 0!important;margin:0;padding:0;display:block;color:inherit!important;contain:style;-webkit-flex-shrink:0;flex-shrink:0}.itemsContainer,.vertical-list{display:-webkit-box;display:-webkit-flex}.itemsContainer{display:flex}.vertical-list{display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-flex-wrap:nowrap;flex-wrap:nowrap}.mediaSourceIndicator,.vertical-wrap{display:-webkit-box;display:-webkit-flex}.vertical-wrap{display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;flex-wrap:wrap}.vertical-wrap.centered{-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.vertical-wrap>.card{contain:layout style}.cardScalable{position:relative}.cardPadder-backdrop,.cardPadder-overflowBackdrop,.cardPadder-overflowSmallBackdrop,.cardPadder-smallBackdrop{padding-bottom:56.25%}.cardPadder-overflowSquare,.cardPadder-square{padding-bottom:100%}.cardPadder-overflowPortrait,.cardPadder-portrait{padding-bottom:150%}.cardPadder-banner{padding-bottom:18.5%}.cardBox{padding:0!important;margin:5px;-webkit-transition:none;-o-transition:none;transition:none;border:0 solid transparent;background-color:transparent}.cardBox-focustransform{will-change:transform}.cardBox-focustransform-transition{will-change:transform;-webkit-transition:-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out;transition:transform .2s ease-out}.card-focusscale:focus>.cardBox-focustransform{-webkit-transform:scale(1.16,1.16);transform:scale(1.16,1.16)}.card:focus{position:relative!important;z-index:10!important}.card:focus .cardBox{margin:2px;border-width:3px;border-color:transparent}.cardBox-bottompadded{margin-bottom:1em}.btnCardOptions{position:absolute;bottom:.25em;right:0;margin:0!important;z-index:1}.mediaSourceIndicator{display:flex;position:absolute;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;top:.3em;left:.3em;text-align:center;vertical-align:middle;width:24px;height:24px;-webkit-border-radius:50%;border-radius:50%;color:#fff;background:#38c}.cardText,.innerCardFooter{overflow:hidden;text-align:left}.cardImageContainer{-webkit-background-size:contain;background-size:contain;background-repeat:no-repeat;background-position:center center;display:-webkit-flex;display:-webkit-box;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;position:relative;-webkit-background-clip:content-box!important;background-clip:content-box!important;color:#fff;height:100%}.chapterCardImageContainer{background-color:#000;-webkit-border-radius:0;border-radius:0}.cardImageContainer-button{border:0;padding:0;background-color:transparent;-webkit-box-sizing:content-box;box-sizing:content-box}.forceRelative{position:relative}.cardContent,.cardImage{position:absolute;top:0;left:0;right:0;bottom:0}.cardContent{overflow:hidden;display:block;height:100%}.cardImage{-webkit-background-size:contain;background-size:contain;background-repeat:no-repeat;background-position:center bottom}.cardImage-img{max-height:100%;max-width:100%;min-height:70%;min-width:70%;margin:auto}.coveredImage-img{width:100%;height:100%}.coveredImage-noscale-img{max-height:none;max-width:none}.coveredImage{-webkit-background-size:100% 100%;background-size:100% 100%;background-position:center center}.coveredImage-noScale{-webkit-background-size:cover;background-size:cover}.cardFooter{padding:.5em .3em;position:relative}.visualCardBox{-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);background-color:#222326;-webkit-border-radius:2px;border-radius:2px}.innerCardFooter{background:rgba(0,0,0,.7);position:absolute;bottom:0;left:0;z-index:1;max-width:100%;color:#fff}.innerCardFooterClear{background-color:transparent}.fullInnerCardFooter{right:0}.cardText{padding:.3em .5em;white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis;color:inherit}.cardDefaultText,.cardTextCentered{text-align:center}.singleCardText{padding:.5em}.cardText-secondary{opacity:.6}.cardText-rightmargin{margin-right:2em}.cardDefaultText{white-space:normal}.textActionButton{background:0 0;border:0!important;padding:0!important;color:inherit;vertical-align:middle;font-family:inherit;font-size:inherit}.textActionButton:hover{text-decoration:underline;opacity:1}.cardFooterLogo{margin-right:1em}.cardImageIcon{width:12vh;height:12vh;font-size:12vh;color:#fff}.cardIndicators{right:2.5%;top:2.5%;position:absolute;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.portraitCardIndicators{right:3%;top:2%}.backdropCardIndicators{right:1.5%;top:2.8%}.cardOverlayButton{color:#fff!important;background-color:rgba(0,0,0,.8)!important;-webkit-border-radius:500px;border-radius:500px;position:absolute;bottom:0;right:0;margin:0 .35em .5em 0;z-index:1;padding:6px}.cardOverlayButton:hover{background-color:rgba(0,0,0,.9)!important;-webkit-transition:background-color .5s ease-out;-o-transition:background-color .5s ease-out;transition:background-color .5s ease-out}.defaultCardColor1{background-color:#009688}.defaultCardColor2{background-color:#D32F2F}.defaultCardColor3{background-color:#0288D1}.defaultCardColor4{background-color:#388E3C}.defaultCardColor5{background-color:#F57F17}.backdropCard-scalable,.bannerCard-scalable{width:100%}.smallBackdropCard-scalable,.squareCard-scalable{width:50%}.portraitCard-scalable{width:33.333333333333333333333333333333%}.overflowPortraitCard-scalable{width:42%;max-width:200px}.overflowBackdropCard-scalable{width:72%;max-width:400px}.overflowSmallBackdropCard-scalable{width:60%}.overflowSquareCard-scalable{width:42%;max-width:200px}@media all and (min-width:400px){.backdropCard-scalable{width:50%}}@media all and (min-width:500px){.smallBackdropCard-scalable,.squareCard-scalable{width:33.333333333333333333333333333333%}}@media all and (min-width:540px){.overflowPortraitCard-scalable{width:30%}.overflowBackdropCard-scalable{width:64%}.overflowSquareCard-scalable{width:30%}.overflowSmallBackdropCard-scalable{width:40%}}@media all and (min-width:640px){.portraitCard-scalable{width:25%}.overflowBackdropCard-scalable{width:56%}.overflowSmallBackdropCard-scalable{width:40%}}@media all and (min-width:700px){.squareCard-scalable{width:25%}}@media all and (min-width:770px){.backdropCard-scalable{width:33.333333333333333333333333333333%}.overflowSmallBackdropCard-scalable{width:30%}}@media all and (min-width:800px){.bannerCard-scalable{width:50%}.portraitCard-scalable{width:20%}.smallBackdropCard-scalable{width:25%}}@media all and (min-width:900px){.squareCard-scalable{width:20%}}@media all and (min-width:1000px){.smallBackdropCard-scalable{width:20%}.overflowPortraitCard-scalable{width:22%}.overflowBackdropCard-scalable{width:40%}.overflowSmallBackdropCard-scalable{width:24%}.overflowSquareCard-scalable{width:22%}}@media all and (min-width:1200px){.backdropCard-scalable{width:25%}.squareCard-scalable{width:16.666666666666666666666666666667%}.bannerCard-scalable{width:33.333333333333333333333333333333%}.portraitCard-scalable,.smallBackdropCard-scalable{width:16.666666666666666666666666666667%}.overflowSmallBackdropCard-scalable{width:18%}}@media all and (min-width:1400px){.portraitCard-scalable,.smallBackdropCard-scalable,.squareCard-scalable{width:14.285714285714285714285714285714%}}@media all and (min-width:1600px){.portraitCard-scalable,.smallBackdropCard-scalable{width:12.5%}.backdropCard-scalable{width:20%}.squareCard-scalable{width:12.5%}}@media all and (min-width:1800px){.smallBackdropCard-scalable{width:10%}}@media all and (min-width:1920px){.squareCard-scalable{width:11.111111111111111111111111111111%}.smallBackdropCard-scalable{width:10%}}@media all and (min-width:2100px){.backdropCard-scalable{width:20%}.portraitCard-scalable{width:11.111111111111111111111111111111%}}@media all and (min-width:2200px){.bannerCard-scalable{width:25%}.portraitCard-scalable{width:10%}}@media all and (min-width:2500px){.backdropCard-scalable{width:16.666666666666666666666666666667%}}.layout-tv .backdropCard-scalable{width:25%}.layout-tv .portraitCard-scalable,.layout-tv .squareCard-scalable{width:16.66666666666666667%}@media all and (min-width:1600px){.layout-tv .backdropCard-scalable{width:25%}} \ No newline at end of file +.card,.card:focus{font-weight:inherit!important}.card,.cardImageContainer-button,.textActionButton{cursor:pointer;outline:0!important}button::-moz-focus-inner{padding:0;border:0}button{-webkit-border-fit:border!important}.card{border:0;font-size:inherit!important;font-family:inherit!important;text-transform:none;background:0 0!important;margin:0;padding:0;display:block;color:inherit!important;contain:style;-webkit-flex-shrink:0;flex-shrink:0}.itemsContainer,.vertical-list{display:-webkit-box;display:-webkit-flex}.itemsContainer{display:flex}.vertical-list{display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-flex-wrap:nowrap;flex-wrap:nowrap}.mediaSourceIndicator,.vertical-wrap{display:-webkit-box;display:-webkit-flex}.vertical-wrap{display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;flex-wrap:wrap}.vertical-wrap.centered{-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.vertical-wrap>.card{contain:layout style}.cardScalable{position:relative}.cardPadder-backdrop,.cardPadder-overflowBackdrop,.cardPadder-overflowSmallBackdrop,.cardPadder-smallBackdrop{padding-bottom:56.25%}.cardPadder-overflowSquare,.cardPadder-square{padding-bottom:100%}.cardPadder-overflowPortrait,.cardPadder-portrait{padding-bottom:150%}.cardPadder-banner{padding-bottom:18.5%}.cardBox{padding:0!important;margin:6px;-webkit-transition:none;-o-transition:none;transition:none;border:0 solid transparent;background-color:transparent}.cardBox-focustransform{will-change:transform}.cardBox-focustransform-transition{will-change:transform;-webkit-transition:-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out;transition:transform .2s ease-out}.card-focusscale:focus>.cardBox-focustransform{-webkit-transform:scale(1.16,1.16);transform:scale(1.16,1.16)}.card:focus{position:relative!important;z-index:10!important}.card:focus .cardBox{margin:4px;border-width:2px;border-color:transparent}.cardBox-bottompadded{margin-bottom:1em}.btnCardOptions{position:absolute;bottom:.25em;right:0;margin:0!important;z-index:1}.mediaSourceIndicator{display:flex;position:absolute;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;top:.3em;left:.3em;text-align:center;vertical-align:middle;width:24px;height:24px;-webkit-border-radius:50%;border-radius:50%;color:#fff;background:#38c}.cardText,.innerCardFooter{overflow:hidden;text-align:left}.cardImageContainer{-webkit-background-size:contain;background-size:contain;background-repeat:no-repeat;background-position:center center;display:-webkit-flex;display:-webkit-box;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;position:relative;-webkit-background-clip:content-box!important;background-clip:content-box!important;color:#fff;height:100%}.chapterCardImageContainer{background-color:#000;-webkit-border-radius:0;border-radius:0}.cardImageContainer-button{border:0;padding:0;background-color:transparent;-webkit-box-sizing:content-box;box-sizing:content-box}.forceRelative{position:relative}.cardContent,.cardImage{position:absolute;top:0;left:0;right:0;bottom:0}.cardContent{overflow:hidden;display:block;height:100%}.cardImage{-webkit-background-size:contain;background-size:contain;background-repeat:no-repeat;background-position:center bottom}.cardImage-img{max-height:100%;max-width:100%;min-height:70%;min-width:70%;margin:auto}.coveredImage-img{width:100%;height:100%}.coveredImage-noscale-img{max-height:none;max-width:none}.coveredImage{-webkit-background-size:100% 100%;background-size:100% 100%;background-position:center center}.coveredImage-noScale{-webkit-background-size:cover;background-size:cover}.cardFooter{padding:.5em .3em;position:relative}.visualCardBox{-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);background-color:#222326;-webkit-border-radius:2px;border-radius:2px}.innerCardFooter{background:rgba(0,0,0,.7);position:absolute;bottom:0;left:0;z-index:1;max-width:100%;color:#fff}.innerCardFooterClear{background-color:transparent}.fullInnerCardFooter{right:0}.cardText{padding:.3em .5em;white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis;color:inherit}.cardDefaultText,.cardTextCentered{text-align:center}.singleCardText{padding:.5em}.cardText-secondary{opacity:.6}.cardText-rightmargin{margin-right:2em}.cardDefaultText{white-space:normal}.textActionButton{background:0 0;border:0!important;padding:0!important;color:inherit;vertical-align:middle;font-family:inherit;font-size:inherit}.textActionButton:hover{text-decoration:underline;opacity:1}.cardFooterLogo{margin-right:1em}.cardImageIcon{width:12vh;height:12vh;font-size:12vh;color:#fff}.cardIndicators{right:2.5%;top:2.5%;position:absolute;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.portraitCardIndicators{right:3%;top:2%}.backdropCardIndicators{right:1.5%;top:2.8%}.cardOverlayButton{color:#fff!important;background-color:rgba(0,0,0,.8)!important;-webkit-border-radius:500px;border-radius:500px;position:absolute;bottom:0;right:0;margin:0 .35em .5em 0;z-index:1;padding:6px}.cardOverlayButton:hover{background-color:rgba(0,0,0,.9)!important;-webkit-transition:background-color .5s ease-out;-o-transition:background-color .5s ease-out;transition:background-color .5s ease-out}.defaultCardColor1{background-color:#009688}.defaultCardColor2{background-color:#D32F2F}.defaultCardColor3{background-color:#0288D1}.defaultCardColor4{background-color:#388E3C}.defaultCardColor5{background-color:#F57F17}.backdropCard-scalable,.bannerCard-scalable{width:100%}.smallBackdropCard-scalable,.squareCard-scalable{width:50%}.portraitCard-scalable{width:33.333333333333333333333333333333%}.overflowPortraitCard-scalable{width:42%;max-width:200px}.overflowBackdropCard-scalable{width:72%;max-width:400px}.overflowSmallBackdropCard-scalable{width:60%}.overflowSquareCard-scalable{width:42%;max-width:200px}@media all and (min-width:400px){.backdropCard-scalable{width:50%}}@media all and (min-width:500px){.smallBackdropCard-scalable,.squareCard-scalable{width:33.333333333333333333333333333333%}}@media all and (min-width:540px){.overflowPortraitCard-scalable{width:30%}.overflowBackdropCard-scalable{width:64%}.overflowSquareCard-scalable{width:30%}.overflowSmallBackdropCard-scalable{width:40%}}@media all and (min-width:640px){.portraitCard-scalable{width:25%}.overflowBackdropCard-scalable{width:56%}.overflowSmallBackdropCard-scalable{width:40%}}@media all and (min-width:700px){.squareCard-scalable{width:25%}}@media all and (min-width:770px){.backdropCard-scalable{width:33.333333333333333333333333333333%}.overflowSmallBackdropCard-scalable{width:30%}}@media all and (min-width:800px){.bannerCard-scalable{width:50%}.portraitCard-scalable{width:20%}.smallBackdropCard-scalable{width:25%}}@media all and (min-width:900px){.squareCard-scalable{width:20%}}@media all and (min-width:1000px){.smallBackdropCard-scalable{width:20%}.overflowPortraitCard-scalable{width:22%}.overflowBackdropCard-scalable{width:40%}.overflowSmallBackdropCard-scalable{width:24%}.overflowSquareCard-scalable{width:22%}}@media all and (min-width:1200px){.backdropCard-scalable{width:25%}.squareCard-scalable{width:16.666666666666666666666666666667%}.bannerCard-scalable{width:33.333333333333333333333333333333%}.portraitCard-scalable,.smallBackdropCard-scalable{width:16.666666666666666666666666666667%}.overflowSmallBackdropCard-scalable{width:18%}}@media all and (min-width:1400px){.portraitCard-scalable,.smallBackdropCard-scalable,.squareCard-scalable{width:14.285714285714285714285714285714%}}@media all and (min-width:1600px){.portraitCard-scalable,.smallBackdropCard-scalable{width:12.5%}.backdropCard-scalable{width:20%}.squareCard-scalable{width:12.5%}}@media all and (min-width:1800px){.smallBackdropCard-scalable{width:10%}}@media all and (min-width:1920px){.squareCard-scalable{width:11.111111111111111111111111111111%}.smallBackdropCard-scalable{width:10%}}@media all and (min-width:2100px){.backdropCard-scalable{width:20%}.portraitCard-scalable{width:11.111111111111111111111111111111%}}@media all and (min-width:2200px){.bannerCard-scalable{width:25%}.portraitCard-scalable{width:10%}}@media all and (min-width:2500px){.backdropCard-scalable{width:16.666666666666666666666666666667%}}.layout-tv .backdropCard-scalable{width:25%}.layout-tv .portraitCard-scalable,.layout-tv .squareCard-scalable{width:16.66666666666666667%}@media all and (min-width:1600px){.layout-tv .backdropCard-scalable{width:25%}} \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/chromecastplayer.js b/dashboard-ui/bower_components/emby-webcomponents/chromecastplayer.js index cf16443809..a103e6f41f 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/chromecastplayer.js +++ b/dashboard-ui/bower_components/emby-webcomponents/chromecastplayer.js @@ -1 +1 @@ -define(["appSettings","playbackManager","connectionManager","globalize","events"],function(appSettings,playbackManager,connectionManager,globalize,events){"use strict";function sendConnectionResult(isOk){var resolve=currentResolve,reject=currentReject;currentResolve=null,currentReject=null,isOk?resolve&&resolve():reject?reject():playbackManager.removeActivePlayer(PlayerName)}function alertText(text,title){require(["alert"],function(alert){alert({text:text,title:title})})}function chromecastPlayer(){function initializeChromecast(){fileref.loaded=!0,castPlayer=new CastPlayer,document.dispatchEvent(new CustomEvent("chromecastloaded",{detail:{player:self}})),events.on(castPlayer,"connect",function(e){currentResolve?sendConnectionResult(!0):playbackManager.setActivePlayer(PlayerName,self.getCurrentTargetInfo()),console.log("cc: connect"),self.lastPlayerData=null}),events.on(castPlayer,"playbackstart",function(e,data){console.log("cc: playbackstart"),castPlayer.initializeCastPlayer();var state=self.getPlayerStateInternal(data);events.trigger(self,"playbackstart",[state])}),events.on(castPlayer,"playbackstop",function(e,data){console.log("cc: playbackstop");var state=self.getPlayerStateInternal(data);events.trigger(self,"playbackstop",[state]),self.lastPlayerData={}}),events.on(castPlayer,"playbackprogress",function(e,data){console.log("cc: positionchange");var state=self.getPlayerStateInternal(data);events.trigger(self,"timeupdate",[state])}),events.on(castPlayer,"volumechange",function(e,data){console.log("cc: volumechange");var state=self.getPlayerStateInternal(data);events.trigger(self,"volumechange",[state])}),events.on(castPlayer,"repeatmodechange",function(e,data){console.log("cc: repeatmodechange");var state=self.getPlayerStateInternal(data);events.trigger(self,"repeatmodechange",[state])}),events.on(castPlayer,"playstatechange",function(e,data){console.log("cc: playstatechange");var state=self.getPlayerStateInternal(data);events.trigger(self,"pause",[state])})}function normalizeImages(state){if(state&&state.NowPlayingItem){var item=state.NowPlayingItem;item.ImageTags&&item.ImageTags.Primary||item.PrimaryImageTag&&(item.ImageTags=item.ImageTags||{},item.ImageTags.Primary=item.PrimaryImageTag),item.BackdropImageTag&&item.BackdropItemId===item.Id&&(item.BackdropImageTags=[item.BackdropImageTag]),item.BackdropImageTag&&item.BackdropItemId!==item.Id&&(item.ParentBackdropImageTags=[item.BackdropImageTag],item.ParentBackdropItemId=item.BackdropItemId)}}var castPlayer,self=this;self.name=PlayerName,self.type="mediaplayer",self.id="chromecast",self.isLocalPlayer=!1,self.getItemsForPlayback=function(query){var userId=ApiClient.getCurrentUserId();return query.Ids&&1===query.Ids.split(",").length?ApiClient.getItem(userId,query.Ids.split(",")).then(function(item){return{Items:[item],TotalRecordCount:1}}):(query.Limit=query.Limit||100,query.ExcludeLocationTypes="Virtual",ApiClient.getItems(userId,query))},self.play=function(options){return ApiClient.getCurrentUser().then(function(user){return options.items?self.playWithCommand(options,"PlayNow"):self.getItemsForPlayback({Ids:options.ids.join(",")}).then(function(result){return options.items=result.Items,self.playWithCommand(options,"PlayNow")})})},self.playWithCommand=function(options,command){if(!options.items){var apiClient=connectionManager.getApiClient(options.serverId);return apiClient.getItem(apiClient.getCurrentUserId(),options.ids[0]).then(function(item){return options.items=[item],self.playWithCommand(options,command)})}return castPlayer.loadMedia(options,command)},self.unpause=function(){castPlayer.sendMessage({options:{},command:"Unpause"})},self.playPause=function(){castPlayer.sendMessage({options:{},command:"PlayPause"})},self.pause=function(){castPlayer.sendMessage({options:{},command:"Pause"})},self.shuffle=function(item){var apiClient=connectionManager.getApiClient(item.ServerId),userId=apiClient.getCurrentUserId();apiClient.getItem(userId,item.Id).then(function(item){self.playWithCommand({items:[item]},"Shuffle")})},self.instantMix=function(item){var apiClient=connectionManager.getApiClient(item.ServerId),userId=apiClient.getCurrentUserId();apiClient.getItem(userId,item.Id).then(function(item){self.playWithCommand({items:[item]},"InstantMix")})},self.canPlayMediaType=function(mediaType){return mediaType=(mediaType||"").toLowerCase(),"audio"===mediaType||"video"===mediaType},self.canQueueMediaType=function(mediaType){return self.canPlayMediaType(mediaType)},self.queue=function(options){self.playWithCommand(options,"PlayLast")},self.queueNext=function(options){self.playWithCommand(options,"PlayNext")},self.stop=function(){return castPlayer.sendMessage({options:{},command:"Stop"})},self.displayContent=function(options){castPlayer.sendMessage({options:options,command:"DisplayContent"})},self.isPlaying=function(){var state=self.lastPlayerData||{};return null!=state.NowPlayingItem},self.isPlayingVideo=function(){var state=self.lastPlayerData||{};return state=state.NowPlayingItem||{},"Video"===state.MediaType},self.isPlayingAudio=function(){var state=self.lastPlayerData||{};return state=state.NowPlayingItem||{},"Audio"===state.MediaType},self.currentTime=function(val){if(null!=val)return self.seek(val);var state=self.lastPlayerData||{};return state=state.PlayState||{},state.PositionTicks},self.duration=function(){var state=self.lastPlayerData||{};return state=state.NowPlayingItem||{},state.RunTimeTicks},self.paused=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.IsPaused},self.isMuted=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.IsMuted},self.setMute=function(isMuted){isMuted?castPlayer.sendMessage({options:{},command:"Mute"}):castPlayer.sendMessage({options:{},command:"Unmute"})},self.getRepeatMode=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.RepeatMode},self.setRepeatMode=function(mode){castPlayer.sendMessage({options:{RepeatMode:mode},command:"SetRepeatMode"})},self.toggleMute=function(){castPlayer.sendMessage({options:{},command:"ToggleMute"})},self.getTargets=function(){var targets=[];return castPlayer.hasReceivers&&targets.push(self.getCurrentTargetInfo()),Promise.resolve(targets)},self.getCurrentTargetInfo=function(){var appName=null;return castPlayer.session&&castPlayer.session.receiver&&castPlayer.session.receiver.friendlyName&&(appName=castPlayer.session.receiver.friendlyName),{name:PlayerName,id:PlayerName,playerName:PlayerName,playableMediaTypes:["Audio","Video"],isLocalPlayer:!1,appName:PlayerName,deviceName:appName,supportedCommands:["VolumeUp","VolumeDown","Mute","Unmute","ToggleMute","SetVolume","SetAudioStreamIndex","SetSubtitleStreamIndex","DisplayContent","SetRepeatMode","EndSession"]}},self.seek=function(position){position=parseInt(position),position/=1e7,castPlayer.sendMessage({options:{position:position},command:"Seek"})},self.audioTracks=function(){var state=self.lastPlayerData||{};state=state.NowPlayingItem||{};var streams=state.MediaStreams||[];return streams.filter(function(s){return"Audio"===s.Type})},self.setAudioStreamIndex=function(index){castPlayer.sendMessage({options:{index:index},command:"SetAudioStreamIndex"})},self.getAudioStreamIndex=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.AudioStreamIndex},self.subtitleTracks=function(){var state=self.lastPlayerData||{};state=state.NowPlayingItem||{};var streams=state.MediaStreams||[];return streams.filter(function(s){return"Subtitle"===s.Type})},self.getSubtitleStreamIndex=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.SubtitleStreamIndex},self.setSubtitleStreamIndex=function(index){castPlayer.sendMessage({options:{index:index},command:"SetSubtitleStreamIndex"})},self.getMaxStreamingBitrate=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.MaxStreamingBitrate},self.setMaxStreamingBitrate=function(options){castPlayer.sendMessage({options:options,command:"SetMaxStreamingBitrate"})},self.isFullscreen=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.IsFullscreen},self.toggleFullscreen=function(){},self.nextTrack=function(){castPlayer.sendMessage({options:{},command:"NextTrack"})},self.previousTrack=function(){castPlayer.sendMessage({options:{},command:"PreviousTrack"})},self.beginPlayerUpdates=function(){},self.endPlayerUpdates=function(){},self.getVolume=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},null==state.VolumeLevel?100:state.VolumeLevel},self.volumeDown=function(){castPlayer.sendMessage({options:{},command:"VolumeDown"})},self.endSession=function(){self.stop().then(function(){setTimeout(function(){castPlayer.stopApp()},1e3)})},self.volumeUp=function(){castPlayer.sendMessage({options:{},command:"VolumeUp"})},self.setVolume=function(vol){vol=Math.min(vol,100),vol=Math.max(vol,0),castPlayer.sendMessage({options:{volume:vol},command:"SetVolume"})},self.getPlaylist=function(){return Promise.resolve([])},self.getCurrentPlaylistItemId=function(){},self.setCurrentPlaylistItem=function(playlistItemId){return Promise.resolve()},self.removeFromPlaylist=function(playlistItemIds){return Promise.resolve()},self.getPlayerState=function(){return Promise.resolve(self.getPlayerStateInternal()||{})},self.lastPlayerData={},self.getPlayerStateInternal=function(data){var triggerStateChange=!1;return data&&!self.lastPlayerData&&(triggerStateChange=!0),data=data||self.lastPlayerData,self.lastPlayerData=data,normalizeImages(data),triggerStateChange&&events.trigger(self,"statechange",[data]),data},self.tryPair=function(target){return castPlayer.deviceState!==DEVICE_STATE.ACTIVE&&castPlayer.isInitialized?new Promise(function(resolve,reject){currentResolve=resolve,currentReject=reject,castPlayer.launchApp()}):(currentResolve=null,currentReject=null,Promise.reject())},fileref.loaded?initializeChromecast():fileref.onload=initializeChromecast}var currentResolve,currentReject,PlayerName="Chromecast",DEVICE_STATE={IDLE:0,ACTIVE:1,WARNING:2,ERROR:3},PLAYER_STATE={IDLE:"IDLE",LOADING:"LOADING",LOADED:"LOADED",PLAYING:"PLAYING",PAUSED:"PAUSED",STOPPED:"STOPPED",SEEKING:"SEEKING",ERROR:"ERROR"},applicationID="2D4B1DA3",messageNamespace="urn:x-cast:com.connectsdk",CastPlayer=function(){this.deviceState=DEVICE_STATE.IDLE,this.currentMediaSession=null,this.session=null,this.castPlayerState=PLAYER_STATE.IDLE,this.hasReceivers=!1,this.errorHandler=this.onError.bind(this),this.mediaStatusUpdateHandler=this.onMediaStatusUpdate.bind(this),this.initializeCastPlayer()};CastPlayer.prototype.initializeCastPlayer=function(){var chrome=window.chrome;if(chrome){if(!chrome.cast||!chrome.cast.isAvailable)return void setTimeout(this.initializeCastPlayer.bind(this),1e3);var sessionRequest=new chrome.cast.SessionRequest(applicationID),apiConfig=new chrome.cast.ApiConfig(sessionRequest,this.sessionListener.bind(this),this.receiverListener.bind(this),"origin_scoped");console.log("chromecast.initialize"),chrome.cast.initialize(apiConfig,this.onInitSuccess.bind(this),this.errorHandler)}},CastPlayer.prototype.onInitSuccess=function(){this.isInitialized=!0,console.log("chromecast init success")},CastPlayer.prototype.onError=function(){console.log("chromecast error")},CastPlayer.prototype.sessionListener=function(e){this.session=e,this.session&&(console.log("sessionListener "+JSON.stringify(e)),this.session.media[0]&&this.onMediaDiscovered("activeSession",this.session.media[0]),this.onSessionConnected(e))},CastPlayer.prototype.messageListener=function(namespace,message){if("string"==typeof message&&(message=JSON.parse(message)),"playbackerror"===message.type){var errorCode=message.data;setTimeout(function(){alertText(globalize.translate("MessagePlaybackError"+errorCode),globalize.translate("HeaderPlaybackError"))},300)}else"connectionerror"===message.type?setTimeout(function(){alertText(globalize.translate("MessageChromecastConnectionError"),globalize.translate("HeaderError"))},300):message.type&&events.trigger(this,message.type,[message.data])},CastPlayer.prototype.receiverListener=function(e){"available"===e?(console.log("chromecast receiver found"),this.hasReceivers=!0):(console.log("chromecast receiver list empty"),this.hasReceivers=!1)},CastPlayer.prototype.sessionUpdateListener=function(isAlive){console.log("sessionUpdateListener alive: "+isAlive),isAlive||(this.session=null,this.deviceState=DEVICE_STATE.IDLE,this.castPlayerState=PLAYER_STATE.IDLE,console.log("sessionUpdateListener: setting currentMediaSession to null"),this.currentMediaSession=null,sendConnectionResult(!1))},CastPlayer.prototype.launchApp=function(){console.log("chromecast launching app..."),chrome.cast.requestSession(this.onRequestSessionSuccess.bind(this),this.onLaunchError.bind(this))},CastPlayer.prototype.onRequestSessionSuccess=function(e){console.log("chromecast session success: "+e.sessionId),this.onSessionConnected(e)},CastPlayer.prototype.onSessionConnected=function(session){this.session=session,this.deviceState=DEVICE_STATE.ACTIVE,this.session.addMessageListener(messageNamespace,this.messageListener.bind(this)),this.session.addMediaListener(this.sessionMediaListener.bind(this)),this.session.addUpdateListener(this.sessionUpdateListener.bind(this)),events.trigger(this,"connect"),this.sendMessage({options:{},command:"Identify"})},CastPlayer.prototype.sessionMediaListener=function(e){console.log("sessionMediaListener"),this.currentMediaSession=e,this.currentMediaSession.addUpdateListener(this.mediaStatusUpdateHandler)},CastPlayer.prototype.onLaunchError=function(){console.log("chromecast launch error"),this.deviceState=DEVICE_STATE.ERROR,sendConnectionResult(!1)},CastPlayer.prototype.stopApp=function(){this.session&&this.session.stop(this.onStopAppSuccess.bind(this,"Session stopped"),this.errorHandler)},CastPlayer.prototype.onStopAppSuccess=function(message){console.log(message),this.deviceState=DEVICE_STATE.IDLE,this.castPlayerState=PLAYER_STATE.IDLE,console.log("onStopAppSuccess: setting currentMediaSession to null"),this.currentMediaSession=null},CastPlayer.prototype.loadMedia=function(options,command){return this.session?(options.items=options.items.map(function(i){return{Id:i.Id,Name:i.Name,Type:i.Type,MediaType:i.MediaType,IsFolder:i.IsFolder}}),this.sendMessage({options:options,command:command})):(console.log("no session"),Promise.reject())},CastPlayer.prototype.sendMessage=function(message){var player=this,receiverName=null,session=player.session;session&&session.receiver&&session.receiver.friendlyName&&(receiverName=session.receiver.friendlyName),message=Object.assign(message,{userId:ApiClient.getCurrentUserId(),deviceId:ApiClient.deviceId(),accessToken:ApiClient.accessToken(),serverAddress:ApiClient.serverAddress(),receiverName:receiverName});var bitrateSetting=appSettings.maxChromecastBitrate();return bitrateSetting&&(message.maxBitrate=bitrateSetting),new Promise(function(resolve,reject){require(["chromecasthelpers"],function(chromecasthelpers){chromecasthelpers.getServerAddress(ApiClient).then(function(serverAddress){message.serverAddress=serverAddress,player.sendMessageInternal(message).then(resolve,reject)},reject)})})},CastPlayer.prototype.sendMessageInternal=function(message){return message=JSON.stringify(message),this.session.sendMessage(messageNamespace,message,this.onPlayCommandSuccess.bind(this),this.errorHandler),Promise.resolve()},CastPlayer.prototype.onPlayCommandSuccess=function(){console.log("Message was sent to receiver ok.")},CastPlayer.prototype.onMediaDiscovered=function(how,mediaSession){console.log("chromecast new media session ID:"+mediaSession.mediaSessionId+" ("+how+")"),this.currentMediaSession=mediaSession,"loadMedia"===how&&(this.castPlayerState=PLAYER_STATE.PLAYING),"activeSession"===how&&(this.castPlayerState=mediaSession.playerState),this.currentMediaSession.addUpdateListener(this.mediaStatusUpdateHandler)},CastPlayer.prototype.onMediaStatusUpdate=function(e){e===!1&&(this.castPlayerState=PLAYER_STATE.IDLE),console.log("chromecast updating media: "+e)},CastPlayer.prototype.setReceiverVolume=function(mute,vol){return this.currentMediaSession?void(mute?this.session.setReceiverMuted(!0,this.mediaCommandSuccessCallback.bind(this),this.errorHandler):this.session.setReceiverVolumeLevel(vol||1,this.mediaCommandSuccessCallback.bind(this),this.errorHandler)):void console.log("this.currentMediaSession is null")},CastPlayer.prototype.mute=function(){this.setReceiverVolume(!0)},CastPlayer.prototype.mediaCommandSuccessCallback=function(info,e){console.log(info)};var fileref=document.createElement("script");return fileref.setAttribute("type","text/javascript"),fileref.onload=function(){fileref.loaded=!0},fileref.setAttribute("src","https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"),document.querySelector("head").appendChild(fileref),chromecastPlayer}); \ No newline at end of file +define(["appSettings","playbackManager","connectionManager","globalize","events","castSenderApiLoader"],function(appSettings,playbackManager,connectionManager,globalize,events,castSenderApiLoader){"use strict";function sendConnectionResult(isOk){var resolve=currentResolve,reject=currentReject;currentResolve=null,currentReject=null,isOk?resolve&&resolve():reject?reject():playbackManager.removeActivePlayer(PlayerName)}function alertText(text,title){require(["alert"],function(alert){alert({text:text,title:title})})}function chromecastPlayer(){function initializeChromecast(){castPlayer=new CastPlayer,document.dispatchEvent(new CustomEvent("chromecastloaded",{detail:{player:self}})),events.on(castPlayer,"connect",function(e){currentResolve?sendConnectionResult(!0):playbackManager.setActivePlayer(PlayerName,self.getCurrentTargetInfo()),console.log("cc: connect"),self.lastPlayerData=null}),events.on(castPlayer,"playbackstart",function(e,data){console.log("cc: playbackstart"),castPlayer.initializeCastPlayer();var state=self.getPlayerStateInternal(data);events.trigger(self,"playbackstart",[state])}),events.on(castPlayer,"playbackstop",function(e,data){console.log("cc: playbackstop");var state=self.getPlayerStateInternal(data);events.trigger(self,"playbackstop",[state]),self.lastPlayerData={}}),events.on(castPlayer,"playbackprogress",function(e,data){console.log("cc: positionchange");var state=self.getPlayerStateInternal(data);events.trigger(self,"timeupdate",[state])}),events.on(castPlayer,"volumechange",function(e,data){console.log("cc: volumechange");var state=self.getPlayerStateInternal(data);events.trigger(self,"volumechange",[state])}),events.on(castPlayer,"repeatmodechange",function(e,data){console.log("cc: repeatmodechange");var state=self.getPlayerStateInternal(data);events.trigger(self,"repeatmodechange",[state])}),events.on(castPlayer,"playstatechange",function(e,data){console.log("cc: playstatechange");var state=self.getPlayerStateInternal(data);events.trigger(self,"pause",[state])})}function normalizeImages(state){if(state&&state.NowPlayingItem){var item=state.NowPlayingItem;item.ImageTags&&item.ImageTags.Primary||item.PrimaryImageTag&&(item.ImageTags=item.ImageTags||{},item.ImageTags.Primary=item.PrimaryImageTag),item.BackdropImageTag&&item.BackdropItemId===item.Id&&(item.BackdropImageTags=[item.BackdropImageTag]),item.BackdropImageTag&&item.BackdropItemId!==item.Id&&(item.ParentBackdropImageTags=[item.BackdropImageTag],item.ParentBackdropItemId=item.BackdropItemId)}}var castPlayer,self=this;self.name=PlayerName,self.type="mediaplayer",self.id="chromecast",self.isLocalPlayer=!1,self.getItemsForPlayback=function(query){var userId=ApiClient.getCurrentUserId();return query.Ids&&1===query.Ids.split(",").length?ApiClient.getItem(userId,query.Ids.split(",")).then(function(item){return{Items:[item],TotalRecordCount:1}}):(query.Limit=query.Limit||100,query.ExcludeLocationTypes="Virtual",ApiClient.getItems(userId,query))},self.play=function(options){return ApiClient.getCurrentUser().then(function(user){return options.items?self.playWithCommand(options,"PlayNow"):self.getItemsForPlayback({Ids:options.ids.join(",")}).then(function(result){return options.items=result.Items,self.playWithCommand(options,"PlayNow")})})},self.playWithCommand=function(options,command){if(!options.items){var apiClient=connectionManager.getApiClient(options.serverId);return apiClient.getItem(apiClient.getCurrentUserId(),options.ids[0]).then(function(item){return options.items=[item],self.playWithCommand(options,command)})}return castPlayer.loadMedia(options,command)},self.unpause=function(){castPlayer.sendMessage({options:{},command:"Unpause"})},self.playPause=function(){castPlayer.sendMessage({options:{},command:"PlayPause"})},self.pause=function(){castPlayer.sendMessage({options:{},command:"Pause"})},self.shuffle=function(item){var apiClient=connectionManager.getApiClient(item.ServerId),userId=apiClient.getCurrentUserId();apiClient.getItem(userId,item.Id).then(function(item){self.playWithCommand({items:[item]},"Shuffle")})},self.instantMix=function(item){var apiClient=connectionManager.getApiClient(item.ServerId),userId=apiClient.getCurrentUserId();apiClient.getItem(userId,item.Id).then(function(item){self.playWithCommand({items:[item]},"InstantMix")})},self.canPlayMediaType=function(mediaType){return mediaType=(mediaType||"").toLowerCase(),"audio"===mediaType||"video"===mediaType},self.canQueueMediaType=function(mediaType){return self.canPlayMediaType(mediaType)},self.queue=function(options){self.playWithCommand(options,"PlayLast")},self.queueNext=function(options){self.playWithCommand(options,"PlayNext")},self.stop=function(){return castPlayer.sendMessage({options:{},command:"Stop"})},self.displayContent=function(options){castPlayer.sendMessage({options:options,command:"DisplayContent"})},self.isPlaying=function(){var state=self.lastPlayerData||{};return null!=state.NowPlayingItem},self.isPlayingVideo=function(){var state=self.lastPlayerData||{};return state=state.NowPlayingItem||{},"Video"===state.MediaType},self.isPlayingAudio=function(){var state=self.lastPlayerData||{};return state=state.NowPlayingItem||{},"Audio"===state.MediaType},self.currentTime=function(val){if(null!=val)return self.seek(val);var state=self.lastPlayerData||{};return state=state.PlayState||{},state.PositionTicks},self.duration=function(){var state=self.lastPlayerData||{};return state=state.NowPlayingItem||{},state.RunTimeTicks},self.paused=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.IsPaused},self.isMuted=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.IsMuted},self.setMute=function(isMuted){isMuted?castPlayer.sendMessage({options:{},command:"Mute"}):castPlayer.sendMessage({options:{},command:"Unmute"})},self.getRepeatMode=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.RepeatMode},self.setRepeatMode=function(mode){castPlayer.sendMessage({options:{RepeatMode:mode},command:"SetRepeatMode"})},self.toggleMute=function(){castPlayer.sendMessage({options:{},command:"ToggleMute"})},self.getTargets=function(){var targets=[];return castPlayer.hasReceivers&&targets.push(self.getCurrentTargetInfo()),Promise.resolve(targets)},self.getCurrentTargetInfo=function(){var appName=null;return castPlayer.session&&castPlayer.session.receiver&&castPlayer.session.receiver.friendlyName&&(appName=castPlayer.session.receiver.friendlyName),{name:PlayerName,id:PlayerName,playerName:PlayerName,playableMediaTypes:["Audio","Video"],isLocalPlayer:!1,appName:PlayerName,deviceName:appName,supportedCommands:["VolumeUp","VolumeDown","Mute","Unmute","ToggleMute","SetVolume","SetAudioStreamIndex","SetSubtitleStreamIndex","DisplayContent","SetRepeatMode","EndSession"]}},self.seek=function(position){position=parseInt(position),position/=1e7,castPlayer.sendMessage({options:{position:position},command:"Seek"})},self.audioTracks=function(){var state=self.lastPlayerData||{};state=state.NowPlayingItem||{};var streams=state.MediaStreams||[];return streams.filter(function(s){return"Audio"===s.Type})},self.setAudioStreamIndex=function(index){castPlayer.sendMessage({options:{index:index},command:"SetAudioStreamIndex"})},self.getAudioStreamIndex=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.AudioStreamIndex},self.subtitleTracks=function(){var state=self.lastPlayerData||{};state=state.NowPlayingItem||{};var streams=state.MediaStreams||[];return streams.filter(function(s){return"Subtitle"===s.Type})},self.getSubtitleStreamIndex=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.SubtitleStreamIndex},self.setSubtitleStreamIndex=function(index){castPlayer.sendMessage({options:{index:index},command:"SetSubtitleStreamIndex"})},self.getMaxStreamingBitrate=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.MaxStreamingBitrate},self.setMaxStreamingBitrate=function(options){castPlayer.sendMessage({options:options,command:"SetMaxStreamingBitrate"})},self.isFullscreen=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.IsFullscreen},self.toggleFullscreen=function(){},self.nextTrack=function(){castPlayer.sendMessage({options:{},command:"NextTrack"})},self.previousTrack=function(){castPlayer.sendMessage({options:{},command:"PreviousTrack"})},self.beginPlayerUpdates=function(){},self.endPlayerUpdates=function(){},self.getVolume=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},null==state.VolumeLevel?100:state.VolumeLevel},self.volumeDown=function(){castPlayer.sendMessage({options:{},command:"VolumeDown"})},self.endSession=function(){self.stop().then(function(){setTimeout(function(){castPlayer.stopApp()},1e3)})},self.volumeUp=function(){castPlayer.sendMessage({options:{},command:"VolumeUp"})},self.setVolume=function(vol){vol=Math.min(vol,100),vol=Math.max(vol,0),castPlayer.sendMessage({options:{volume:vol},command:"SetVolume"})},self.getPlaylist=function(){return Promise.resolve([])},self.getCurrentPlaylistItemId=function(){},self.setCurrentPlaylistItem=function(playlistItemId){return Promise.resolve()},self.removeFromPlaylist=function(playlistItemIds){return Promise.resolve()},self.getPlayerState=function(){return Promise.resolve(self.getPlayerStateInternal()||{})},self.lastPlayerData={},self.getPlayerStateInternal=function(data){var triggerStateChange=!1;return data&&!self.lastPlayerData&&(triggerStateChange=!0),data=data||self.lastPlayerData,self.lastPlayerData=data,normalizeImages(data),triggerStateChange&&events.trigger(self,"statechange",[data]),data},self.tryPair=function(target){return castPlayer.deviceState!==DEVICE_STATE.ACTIVE&&castPlayer.isInitialized?new Promise(function(resolve,reject){currentResolve=resolve,currentReject=reject,castPlayer.launchApp()}):(currentResolve=null,currentReject=null,Promise.reject())},castSenderApiLoader.load().then(initializeChromecast)}var currentResolve,currentReject,PlayerName="Chromecast",DEVICE_STATE={IDLE:0,ACTIVE:1,WARNING:2,ERROR:3},PLAYER_STATE={IDLE:"IDLE",LOADING:"LOADING",LOADED:"LOADED",PLAYING:"PLAYING",PAUSED:"PAUSED",STOPPED:"STOPPED",SEEKING:"SEEKING",ERROR:"ERROR"},applicationID="2D4B1DA3",messageNamespace="urn:x-cast:com.connectsdk",CastPlayer=function(){this.deviceState=DEVICE_STATE.IDLE,this.currentMediaSession=null,this.session=null,this.castPlayerState=PLAYER_STATE.IDLE,this.hasReceivers=!1,this.errorHandler=this.onError.bind(this),this.mediaStatusUpdateHandler=this.onMediaStatusUpdate.bind(this),this.initializeCastPlayer()};return CastPlayer.prototype.initializeCastPlayer=function(){var chrome=window.chrome;if(chrome){if(!chrome.cast||!chrome.cast.isAvailable)return void setTimeout(this.initializeCastPlayer.bind(this),1e3);var sessionRequest=new chrome.cast.SessionRequest(applicationID),apiConfig=new chrome.cast.ApiConfig(sessionRequest,this.sessionListener.bind(this),this.receiverListener.bind(this),"origin_scoped");console.log("chromecast.initialize"),chrome.cast.initialize(apiConfig,this.onInitSuccess.bind(this),this.errorHandler)}},CastPlayer.prototype.onInitSuccess=function(){this.isInitialized=!0,console.log("chromecast init success")},CastPlayer.prototype.onError=function(){console.log("chromecast error")},CastPlayer.prototype.sessionListener=function(e){this.session=e,this.session&&(console.log("sessionListener "+JSON.stringify(e)),this.session.media[0]&&this.onMediaDiscovered("activeSession",this.session.media[0]),this.onSessionConnected(e))},CastPlayer.prototype.messageListener=function(namespace,message){if("string"==typeof message&&(message=JSON.parse(message)),"playbackerror"===message.type){var errorCode=message.data;setTimeout(function(){alertText(globalize.translate("MessagePlaybackError"+errorCode),globalize.translate("HeaderPlaybackError"))},300)}else"connectionerror"===message.type?setTimeout(function(){alertText(globalize.translate("MessageChromecastConnectionError"),globalize.translate("HeaderError"))},300):message.type&&events.trigger(this,message.type,[message.data])},CastPlayer.prototype.receiverListener=function(e){"available"===e?(console.log("chromecast receiver found"),this.hasReceivers=!0):(console.log("chromecast receiver list empty"),this.hasReceivers=!1)},CastPlayer.prototype.sessionUpdateListener=function(isAlive){console.log("sessionUpdateListener alive: "+isAlive),isAlive||(this.session=null,this.deviceState=DEVICE_STATE.IDLE,this.castPlayerState=PLAYER_STATE.IDLE,console.log("sessionUpdateListener: setting currentMediaSession to null"),this.currentMediaSession=null,sendConnectionResult(!1))},CastPlayer.prototype.launchApp=function(){console.log("chromecast launching app..."),chrome.cast.requestSession(this.onRequestSessionSuccess.bind(this),this.onLaunchError.bind(this))},CastPlayer.prototype.onRequestSessionSuccess=function(e){console.log("chromecast session success: "+e.sessionId),this.onSessionConnected(e)},CastPlayer.prototype.onSessionConnected=function(session){this.session=session,this.deviceState=DEVICE_STATE.ACTIVE,this.session.addMessageListener(messageNamespace,this.messageListener.bind(this)),this.session.addMediaListener(this.sessionMediaListener.bind(this)),this.session.addUpdateListener(this.sessionUpdateListener.bind(this)),events.trigger(this,"connect"),this.sendMessage({options:{},command:"Identify"})},CastPlayer.prototype.sessionMediaListener=function(e){console.log("sessionMediaListener"),this.currentMediaSession=e,this.currentMediaSession.addUpdateListener(this.mediaStatusUpdateHandler)},CastPlayer.prototype.onLaunchError=function(){console.log("chromecast launch error"),this.deviceState=DEVICE_STATE.ERROR,sendConnectionResult(!1)},CastPlayer.prototype.stopApp=function(){this.session&&this.session.stop(this.onStopAppSuccess.bind(this,"Session stopped"),this.errorHandler)},CastPlayer.prototype.onStopAppSuccess=function(message){console.log(message),this.deviceState=DEVICE_STATE.IDLE,this.castPlayerState=PLAYER_STATE.IDLE,console.log("onStopAppSuccess: setting currentMediaSession to null"),this.currentMediaSession=null},CastPlayer.prototype.loadMedia=function(options,command){return this.session?(options.items=options.items.map(function(i){return{Id:i.Id,Name:i.Name,Type:i.Type,MediaType:i.MediaType,IsFolder:i.IsFolder}}),this.sendMessage({options:options,command:command})):(console.log("no session"),Promise.reject())},CastPlayer.prototype.sendMessage=function(message){var player=this,receiverName=null,session=player.session;session&&session.receiver&&session.receiver.friendlyName&&(receiverName=session.receiver.friendlyName),message=Object.assign(message,{userId:ApiClient.getCurrentUserId(),deviceId:ApiClient.deviceId(),accessToken:ApiClient.accessToken(),serverAddress:ApiClient.serverAddress(),receiverName:receiverName});var bitrateSetting=appSettings.maxChromecastBitrate();return bitrateSetting&&(message.maxBitrate=bitrateSetting),new Promise(function(resolve,reject){require(["chromecasthelpers"],function(chromecasthelpers){chromecasthelpers.getServerAddress(ApiClient).then(function(serverAddress){message.serverAddress=serverAddress,player.sendMessageInternal(message).then(resolve,reject)},reject)})})},CastPlayer.prototype.sendMessageInternal=function(message){return message=JSON.stringify(message),this.session.sendMessage(messageNamespace,message,this.onPlayCommandSuccess.bind(this),this.errorHandler),Promise.resolve()},CastPlayer.prototype.onPlayCommandSuccess=function(){console.log("Message was sent to receiver ok.")},CastPlayer.prototype.onMediaDiscovered=function(how,mediaSession){console.log("chromecast new media session ID:"+mediaSession.mediaSessionId+" ("+how+")"),this.currentMediaSession=mediaSession,"loadMedia"===how&&(this.castPlayerState=PLAYER_STATE.PLAYING),"activeSession"===how&&(this.castPlayerState=mediaSession.playerState),this.currentMediaSession.addUpdateListener(this.mediaStatusUpdateHandler)},CastPlayer.prototype.onMediaStatusUpdate=function(e){e===!1&&(this.castPlayerState=PLAYER_STATE.IDLE),console.log("chromecast updating media: "+e)},CastPlayer.prototype.setReceiverVolume=function(mute,vol){return this.currentMediaSession?void(mute?this.session.setReceiverMuted(!0,this.mediaCommandSuccessCallback.bind(this),this.errorHandler):this.session.setReceiverVolumeLevel(vol||1,this.mediaCommandSuccessCallback.bind(this),this.errorHandler)):void console.log("this.currentMediaSession is null")},CastPlayer.prototype.mute=function(){this.setReceiverVolume(!0)},CastPlayer.prototype.mediaCommandSuccessCallback=function(info,e){console.log(info)},chromecastPlayer}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-tabs/emby-tabs.css b/dashboard-ui/bower_components/emby-webcomponents/emby-tabs/emby-tabs.css index 6329cac5cb..11ebe899c7 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-tabs/emby-tabs.css +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-tabs/emby-tabs.css @@ -1 +1 @@ -.emby-tab-button,.emby-tabs-slider{position:relative}.emby-tab-button{background:0 0;-webkit-box-shadow:none;box-shadow:none;border:2px solid transparent;border-width:0 0 2px;cursor:pointer;outline:0!important;width:auto;font-family:inherit;font-size:inherit;color:#aaa;display:inline-block;vertical-align:middle;-webkit-flex-shrink:0;flex-shrink:0;margin:0;padding:1.2em .9em;text-transform:uppercase;font-weight:700;height:auto;min-width:initial;line-height:initial;-webkit-border-radius:0!important;border-radius:0!important;overflow:hidden}.emby-tab-button:focus{font-weight:700}.emby-tab-button-active{color:#52B54B;border-color:#52B54B}.emby-tabs-selection-bar{position:absolute;left:0;bottom:0;height:2px;z-index:1000;background:#52B54B;width:0}.emby-tab-button-selection-bar{position:absolute;left:0;border:0;bottom:1px;height:2px;right:0;-webkit-border-radius:0;border-radius:0;z-index:1000}.emby-tab-button-selection-bar-active{background:#52B54B}.emby-tab-button-ripple-effect{background:#141414!important} \ No newline at end of file +.emby-tab-button,.emby-tabs-slider{position:relative}.emby-tab-button{background:0 0;-webkit-box-shadow:none;box-shadow:none;border:2px solid transparent;border-width:0 0 2px;cursor:pointer;outline:0!important;width:auto;font-family:inherit;font-size:inherit;color:#aaa;display:inline-block;vertical-align:middle;-webkit-flex-shrink:0;flex-shrink:0;margin:0;padding:1.2em .9em;text-transform:uppercase;height:auto;min-width:initial;line-height:initial;-webkit-border-radius:0!important;border-radius:0!important;overflow:hidden}.emby-tab-button-active{color:#52B54B;border-color:#52B54B}.emby-tabs-selection-bar{position:absolute;left:0;bottom:0;height:2px;z-index:1000;background:#52B54B;width:0}.emby-tab-button-selection-bar{position:absolute;left:0;border:0;bottom:1px;height:2px;right:0;-webkit-border-radius:0;border-radius:0;z-index:1000}.emby-tab-button-selection-bar-active{background:#52B54B}.emby-tab-button-ripple-effect{background:#141414!important} \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/playback/playerselection.js b/dashboard-ui/bower_components/emby-webcomponents/playback/playerselection.js index 4056e477ad..432ff10182 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/playback/playerselection.js +++ b/dashboard-ui/bower_components/emby-webcomponents/playback/playerselection.js @@ -1 +1 @@ -define(["appSettings","events","browser","loading","playbackManager","embyRouter","globalize","apphost"],function(appSettings,events,browser,loading,playbackManager,embyRouter,globalize,appHost){"use strict";function mirrorItem(info,player){var item=info.item;playbackManager.displayContent({ItemName:item.Name,ItemId:item.Id,ItemType:item.Type,Context:info.context},player)}function mirrorIfEnabled(info){if(info=info||currentDisplayInfo,info&&playbackManager.enableDisplayMirroring()){var player=playbackManager.getPlayerInfo();player&&(player.isLocalPlayer||player.supportedCommands.indexOf("DisplayContent")===-1||mirrorItem(info,player))}}function showPlayerSelection(button){var currentPlayerInfo=playbackManager.getPlayerInfo();if(currentPlayerInfo&&!currentPlayerInfo.isLocalPlayer)return void showActivePlayerMenu(currentPlayerInfo);var currentPlayerId=currentPlayerInfo?currentPlayerInfo.id:null;loading.show(),playbackManager.getTargets().then(function(targets){var menuItems=targets.map(function(t){var name=t.name;return t.appName&&t.appName!==t.name&&(name+=" - "+t.appName),{name:name,id:t.id,selected:currentPlayerId===t.id}});require(["actionsheet"],function(actionsheet){loading.hide();var menuOptions={title:globalize.translate("sharedcomponents#HeaderSelectPlayer"),items:menuItems,positionTo:button,resolveOnClick:!0};browser.chrome&&!appHost.supports("castmenuhashchange")&&(menuOptions.enableHistory=!1),actionsheet.show(menuOptions).then(function(id){var target=targets.filter(function(t){return t.id===id})[0];playbackManager.trySetActivePlayer(target.playerName,target),mirrorIfEnabled()})})})}function showActivePlayerMenu(playerInfo){require(["dialogHelper","dialog","emby-checkbox","emby-button"],function(dialogHelper){showActivePlayerMenuInternal(dialogHelper,playerInfo)})}function showActivePlayerMenuInternal(dialogHelper,playerInfo){var html="",dialogOptions={removeOnClose:!0};dialogOptions.modal=!1,dialogOptions.entryAnimationDuration=160,dialogOptions.exitAnimationDuration=160,dialogOptions.autoFocus=!1;var dlg=dialogHelper.createDialog(dialogOptions);if(dlg.classList.add("promptDialog"),html+='
',html+='

',html+=playerInfo.deviceName||playerInfo.name,html+="

",html+="
",playerInfo.supportedCommands.indexOf("DisplayContent")!==-1){html+='"}html+="
",html+='
',html+='",html+='",html+='",html+="
",html+="
",dlg.innerHTML=html;var chkMirror=dlg.querySelector(".chkMirror");chkMirror&&chkMirror.addEventListener("change",onMirrorChange);var destination="",btnRemoteControl=dlg.querySelector(".btnRemoteControl");btnRemoteControl&&btnRemoteControl.addEventListener("click",function(){destination="nowplaying.html",dialogHelper.close(dlg)}),dlg.querySelector(".btnDisconnect").addEventListener("click",function(){playbackManager.disconnectFromPlayer(),dialogHelper.close(dlg)}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),dialogHelper.open(dlg).then(function(){destination&&embyRouter.show(destination)})}function onMirrorChange(){playbackManager.enableDisplayMirroring(this.checked)}var currentDisplayInfo;return document.addEventListener("viewbeforeshow",function(){currentDisplayInfo=null}),document.addEventListener("viewshow",function(e){var state=e.detail.state||{},item=state.item;if(item&&item.ServerId)return void mirrorIfEnabled({item:item})}),events.on(appSettings,"change",function(e,name){"displaymirror"===name&&mirrorIfEnabled()}),{show:showPlayerSelection}}); \ No newline at end of file +define(["appSettings","events","browser","loading","playbackManager","embyRouter","globalize","apphost"],function(appSettings,events,browser,loading,playbackManager,embyRouter,globalize,appHost){"use strict";function mirrorItem(info,player){var item=info.item;playbackManager.displayContent({ItemName:item.Name,ItemId:item.Id,ItemType:item.Type,Context:info.context},player)}function mirrorIfEnabled(info){if(info=info||currentDisplayInfo,info&&playbackManager.enableDisplayMirroring()){var player=playbackManager.getPlayerInfo();player&&(player.isLocalPlayer||player.supportedCommands.indexOf("DisplayContent")===-1||mirrorItem(info,player))}}function emptyCallback(){}function showPlayerSelection(button){var currentPlayerInfo=playbackManager.getPlayerInfo();if(currentPlayerInfo&&!currentPlayerInfo.isLocalPlayer)return void showActivePlayerMenu(currentPlayerInfo);var currentPlayerId=currentPlayerInfo?currentPlayerInfo.id:null;loading.show(),playbackManager.getTargets().then(function(targets){var menuItems=targets.map(function(t){var name=t.name;return t.appName&&t.appName!==t.name&&(name+=" - "+t.appName),{name:name,id:t.id,selected:currentPlayerId===t.id}});require(["actionsheet"],function(actionsheet){loading.hide();var menuOptions={title:globalize.translate("sharedcomponents#HeaderSelectPlayer"),items:menuItems,positionTo:button,resolveOnClick:!0};browser.chrome&&!appHost.supports("castmenuhashchange")&&(menuOptions.enableHistory=!1),actionsheet.show(menuOptions).then(function(id){var target=targets.filter(function(t){return t.id===id})[0];playbackManager.trySetActivePlayer(target.playerName,target),mirrorIfEnabled()},emptyCallback)})})}function showActivePlayerMenu(playerInfo){require(["dialogHelper","dialog","emby-checkbox","emby-button"],function(dialogHelper){showActivePlayerMenuInternal(dialogHelper,playerInfo)})}function showActivePlayerMenuInternal(dialogHelper,playerInfo){var html="",dialogOptions={removeOnClose:!0};dialogOptions.modal=!1,dialogOptions.entryAnimationDuration=160,dialogOptions.exitAnimationDuration=160,dialogOptions.autoFocus=!1;var dlg=dialogHelper.createDialog(dialogOptions);if(dlg.classList.add("promptDialog"),html+='
',html+='

',html+=playerInfo.deviceName||playerInfo.name,html+="

",html+="
",playerInfo.supportedCommands.indexOf("DisplayContent")!==-1){html+='"}html+="
",html+='
',html+='",html+='",html+='",html+="
",html+="
",dlg.innerHTML=html;var chkMirror=dlg.querySelector(".chkMirror");chkMirror&&chkMirror.addEventListener("change",onMirrorChange);var destination="",btnRemoteControl=dlg.querySelector(".btnRemoteControl");btnRemoteControl&&btnRemoteControl.addEventListener("click",function(){destination="nowplaying.html",dialogHelper.close(dlg)}),dlg.querySelector(".btnDisconnect").addEventListener("click",function(){playbackManager.disconnectFromPlayer(),dialogHelper.close(dlg)}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),dialogHelper.open(dlg).then(function(){destination&&embyRouter.show(destination)},emptyCallback)}function onMirrorChange(){playbackManager.enableDisplayMirroring(this.checked)}var currentDisplayInfo;return document.addEventListener("viewbeforeshow",function(){currentDisplayInfo=null}),document.addEventListener("viewshow",function(e){var state=e.detail.state||{},item=state.item;if(item&&item.ServerId)return void mirrorIfEnabled({item:item})}),events.on(appSettings,"change",function(e,name){"displaymirror"===name&&mirrorIfEnabled()}),{show:showPlayerSelection}}); \ No newline at end of file diff --git a/dashboard-ui/components/channelmapper/channelmapper.js b/dashboard-ui/components/channelmapper/channelmapper.js index fa13c619ab..faf0d4022f 100644 --- a/dashboard-ui/components/channelmapper/channelmapper.js +++ b/dashboard-ui/components/channelmapper/channelmapper.js @@ -1 +1 @@ -define(["dialogHelper","loading","connectionManager","globalize","actionsheet","emby-input","paper-icon-button-light","emby-button","listViewStyle","material-icons","formDialogStyle"],function(dialogHelper,loading,connectionManager,globalize,actionsheet){"use strict";return function(options){function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function mapChannel(button,tunerChannelNumber,providerChannelNumber){loading.show();var providerId=options.providerId,apiClient=connectionManager.getApiClient(options.serverId);apiClient.ajax({type:"POST",url:ApiClient.getUrl("LiveTv/ChannelMappings"),data:{providerId:providerId,tunerChannelNumber:tunerChannelNumber,providerChannelNumber:providerChannelNumber},dataType:"json"}).then(function(mapping){var listItem=parentWithClass(button,"listItem");button.setAttribute("data-providernumber",mapping.ProviderChannelNumber),listItem.querySelector(".secondary").innerHTML=getMappingSecondaryName(mapping,currentMappingOptions.ProviderName),loading.hide()})}function onChannelsElementClick(e){var btnMap=parentWithClass(e.target,"btnMap");if(btnMap){var tunerChannelNumber=btnMap.getAttribute("data-number"),providerChannelNumber=btnMap.getAttribute("data-providernumber"),menuItems=currentMappingOptions.ProviderChannels.map(function(m){return{name:m.Name,id:m.Id,selected:m.Id.toLowerCase()==providerChannelNumber.toLowerCase()}});actionsheet.show({positionTo:btnMap,items:menuItems}).then(function(newChannelNumber){mapChannel(btnMap,tunerChannelNumber,newChannelNumber)})}}function getChannelMappingOptions(serverId,providerId){var apiClient=connectionManager.getApiClient(serverId);return apiClient.getJSON(apiClient.getUrl("LiveTv/ChannelMappingOptions",{providerId:providerId}))}function getMappingSecondaryName(mapping,providerName){return(mapping.ProviderChannelNumber||"")+" "+(mapping.ProviderChannelName||"")+" - "+providerName}function getTunerChannelHtml(channel,providerName){var html="";return html+='
',html+='dvr',html+='
',html+='

',html+=channel.Name,html+="

",html+='
',(channel.ProviderChannelNumber||channel.ProviderChannelName)&&(html+=getMappingSecondaryName(channel,providerName)),html+="
",html+="
",html+='',html+="
"}function getEditorHtml(){var html="";return html+='
',html+='
',html+='
',html+="

"+globalize.translate("HeaderChannels")+"

",html+='
',html+="
",html+="
",html+="
",html+="
"}function initEditor(dlg,options){getChannelMappingOptions(options.serverId,options.providerId).then(function(result){currentMappingOptions=result;var channelsElement=dlg.querySelector(".channels");channelsElement.innerHTML=result.TunerChannels.map(function(channel){return getTunerChannelHtml(channel,result.ProviderName)}).join(""),channelsElement.addEventListener("click",onChannelsElementClick)})}var currentMappingOptions,self=this;self.show=function(){var dialogOptions={removeOnClose:!0};dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.classList.add("ui-body-a"),dlg.classList.add("background-theme-a");var html="",title=globalize.translate("MapChannels");return html+='
',html+='',html+='

',html+=title,html+="

",html+="
",html+=getEditorHtml(),dlg.innerHTML=html,initEditor(dlg,options),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),new Promise(function(resolve,reject){dlg.addEventListener("close",resolve),dialogHelper.open(dlg)})}}}); \ No newline at end of file +define(["dialogHelper","loading","connectionManager","globalize","actionsheet","emby-input","paper-icon-button-light","emby-button","listViewStyle","material-icons","formDialogStyle"],function(dialogHelper,loading,connectionManager,globalize,actionsheet){"use strict";return function(options){function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function mapChannel(button,tunerChannelId,providerChannelId){loading.show();var providerId=options.providerId,apiClient=connectionManager.getApiClient(options.serverId);apiClient.ajax({type:"POST",url:ApiClient.getUrl("LiveTv/ChannelMappings"),data:{providerId:providerId,tunerChannelId:tunerChannelId,providerChannelId:providerChannelId},dataType:"json"}).then(function(mapping){var listItem=parentWithClass(button,"listItem");button.setAttribute("data-providerid",mapping.ProviderChannelId),listItem.querySelector(".secondary").innerHTML=getMappingSecondaryName(mapping,currentMappingOptions.ProviderName),loading.hide()})}function onChannelsElementClick(e){var btnMap=parentWithClass(e.target,"btnMap");if(btnMap){var tunerChannelId=btnMap.getAttribute("data-id"),providerChannelId=btnMap.getAttribute("data-providerid"),menuItems=currentMappingOptions.ProviderChannels.map(function(m){return{name:m.Name,id:m.Id,selected:m.Id.toLowerCase()==providerChannelId.toLowerCase()}});actionsheet.show({positionTo:btnMap,items:menuItems}).then(function(newChannelId){mapChannel(btnMap,tunerChannelId,newChannelId)})}}function getChannelMappingOptions(serverId,providerId){var apiClient=connectionManager.getApiClient(serverId);return apiClient.getJSON(apiClient.getUrl("LiveTv/ChannelMappingOptions",{providerId:providerId}))}function getMappingSecondaryName(mapping,providerName){return(mapping.ProviderChannelName||"")+" - "+providerName}function getTunerChannelHtml(channel,providerName){var html="";return html+='
',html+='dvr',html+='
',html+='

',html+=channel.Name,html+="

",html+='
',channel.ProviderChannelName&&(html+=getMappingSecondaryName(channel,providerName)),html+="
",html+="
",html+='',html+="
"}function getEditorHtml(){var html="";return html+='
',html+='
',html+='
',html+="

"+globalize.translate("HeaderChannels")+"

",html+='
',html+="
",html+="
",html+="
",html+="
"}function initEditor(dlg,options){getChannelMappingOptions(options.serverId,options.providerId).then(function(result){currentMappingOptions=result;var channelsElement=dlg.querySelector(".channels");channelsElement.innerHTML=result.TunerChannels.map(function(channel){return getTunerChannelHtml(channel,result.ProviderName)}).join(""),channelsElement.addEventListener("click",onChannelsElementClick)})}var currentMappingOptions,self=this;self.show=function(){var dialogOptions={removeOnClose:!0};dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.classList.add("ui-body-a"),dlg.classList.add("background-theme-a");var html="",title=globalize.translate("MapChannels");return html+='
',html+='',html+='

',html+=title,html+="

",html+="
",html+=getEditorHtml(),dlg.innerHTML=html,initEditor(dlg,options),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),new Promise(function(resolve,reject){dlg.addEventListener("close",resolve),dialogHelper.open(dlg)})}}}); \ No newline at end of file diff --git a/dashboard-ui/devices/ios/ios.css b/dashboard-ui/devices/ios/ios.css index 35c59fdcca..d108a075df 100644 --- a/dashboard-ui/devices/ios/ios.css +++ b/dashboard-ui/devices/ios/ios.css @@ -1 +1 @@ -body:not(.dashboardDocument) .mainDrawerButton{display:none!important}.pageWithAbsoluteTabs:not(.noSecondaryNavPage){padding-top:88px!important}.libraryPage:not(.noSecondaryNavPage){padding-top:85px!important}.backdropContainer{background-attachment:initial}.viewMenuBar{height:50px}.ui-body-b .libraryViewNav{-webkit-box-shadow:none;box-shadow:none}.emby-tab-button{font-weight:400;text-transform:none!important;border-color:transparent!important;border-width:0!important}.criticReviewPaperList{background-color:#262626}.settingsMenuHeader{display:none}.libraryMenuButtonText{font-weight:500!important}.btnNotificationsInner{font-weight:400}.cardImageContainer{-webkit-border-radius:4px;border-radius:4px}.sidebarLinkText{font-weight:400!important}.videoSubtitles{font-size:200%!important}.txtSearch{padding-bottom:.5em!important;text-indent:0!important}.searchInputContainer{margin-left:5%;margin-right:5%}.btnSync,.categorySyncButton{display:none!important}.dialog.background-theme-b{background:rgba(28,28,28,.84);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.cardOverlayButton{-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)} \ No newline at end of file +body:not(.dashboardDocument) .mainDrawerButton{display:none!important}.pageWithAbsoluteTabs:not(.noSecondaryNavPage){padding-top:88px!important}.libraryPage:not(.noSecondaryNavPage){padding-top:85px!important}.backdropContainer{background-attachment:initial}.viewMenuBar{height:50px}.ui-body-b .libraryViewNav{-webkit-box-shadow:none;box-shadow:none}.emby-tab-button{text-transform:none!important;border-color:transparent!important;border-width:0!important}.settingsMenuHeader{display:none}.libraryMenuButtonText{font-weight:500!important}.txtSearch{padding-bottom:.5em!important;text-indent:0!important}.searchInputContainer{margin-left:5%;margin-right:5%}.btnSync,.categorySyncButton{display:none!important}.dialog.background-theme-b{background:rgba(28,28,28,.84);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)} \ No newline at end of file diff --git a/dashboard-ui/manifest.json b/dashboard-ui/manifest.json index 9b9d3f7228..9ee08b4afb 100644 --- a/dashboard-ui/manifest.json +++ b/dashboard-ui/manifest.json @@ -1,7 +1,7 @@ { "name": "Emby", "short_name": "Emby", - "start_url": "web/index.html", + "start_url": "/web/index.html", "description": "The open media solution.", "lang": "en-US", "related_applications": [ diff --git a/dashboard-ui/scripts/nowplayingbar.js b/dashboard-ui/scripts/nowplayingbar.js index be485aca3d..afcc9412e8 100644 --- a/dashboard-ui/scripts/nowplayingbar.js +++ b/dashboard-ui/scripts/nowplayingbar.js @@ -1 +1 @@ -define(["datetime","userdataButtons","itemHelper","events","browser","imageLoader","playbackManager","nowPlayingHelper","apphost","dom","connectionManager","paper-icon-button-light"],function(datetime,userdataButtons,itemHelper,events,browser,imageLoader,playbackManager,nowPlayingHelper,appHost,dom,connectionManager){"use strict";function getNowPlayingBarHtml(){var html="";return html+='
',html+='
',html+='
',html+='',html+="
",html+='
',html+='
',html+='
',html+="
",html+='
',html+='',html+='',html+='',html+='',html+='
',html+="
",html+='
',html+='',html+='
',html+='',html+="
",html+='',html+='
',html+="
",html+='',html+='',html+="
",html+="
",html+="
"}function onSlideDownComplete(){this.classList.add("hide")}function slideDown(elem){requestAnimationFrame(function(){void elem.offsetWidth,elem.classList.add("nowPlayingBar-hidden"),dom.addEventListener(elem,dom.whichTransitionEvent(),onSlideDownComplete,{once:!0})})}function slideUp(elem){elem.classList.remove("hide"),dom.removeEventListener(elem,dom.whichTransitionEvent(),onSlideDownComplete,{once:!0}),requestAnimationFrame(function(){void elem.offsetWidth,elem.classList.remove("nowPlayingBar-hidden")})}function onPlayPauseClick(){playbackManager.playPause(currentPlayer)}function bindEvents(elem){currentTimeElement=elem.querySelector(".nowPlayingBarCurrentTime"),nowPlayingImageElement=elem.querySelector(".nowPlayingImage"),nowPlayingTextElement=elem.querySelector(".nowPlayingBarText"),nowPlayingUserData=elem.querySelector(".nowPlayingBarUserDataButtons"),muteButton=elem.querySelector(".muteButton"),muteButton.addEventListener("click",function(){currentPlayer&&playbackManager.toggleMute(currentPlayer)}),elem.querySelector(".stopButton").addEventListener("click",function(){currentPlayer&&playbackManager.stop(currentPlayer)});var i,length;for(playPauseButtons=elem.querySelectorAll(".playPauseButton"),i=0,length=playPauseButtons.length;i';return html+=text,html+=""}function seriesImageUrl(item,options){if(!item)throw new Error("item cannot be null!");if("Episode"!==item.Type)return null;if(options=options||{},options.type=options.type||"Primary","Primary"===options.type&&item.SeriesPrimaryImageTag)return options.tag=item.SeriesPrimaryImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.SeriesId,options);if("Thumb"===options.type){if(item.SeriesThumbImageTag)return options.tag=item.SeriesThumbImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.SeriesId,options);if(item.ParentThumbImageTag)return options.tag=item.ParentThumbImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.ParentThumbItemId,options)}return null}function imageUrl(item,options){if(!item)throw new Error("item cannot be null!");return options=options||{},options.type=options.type||"Primary",item.ImageTags&&item.ImageTags[options.type]?(options.tag=item.ImageTags[options.type],connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.PrimaryImageItemId||item.Id,options)):item.AlbumId&&item.AlbumPrimaryImageTag?(options.tag=item.AlbumPrimaryImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.AlbumId,options)):null}function updateNowPlayingInfo(state){var nowPlayingItem=state.NowPlayingItem;nowPlayingTextElement.innerHTML=nowPlayingItem?nowPlayingHelper.getNowPlayingNames(nowPlayingItem).map(function(nowPlayingName){return nowPlayingName.item?"
"+getTextActionButton(nowPlayingName.item,nowPlayingName.text)+"
":"
"+nowPlayingName.text+"
"}).join(""):"";var imgHeight=70,url=nowPlayingItem?seriesImageUrl(nowPlayingItem,{height:imgHeight})||imageUrl(nowPlayingItem,{height:imgHeight}):null;url!==currentImgUrl&&(currentImgUrl=url,imageLoader.lazyImage(nowPlayingImageElement,url)),nowPlayingItem.Id?ApiClient.getItem(Dashboard.getCurrentUserId(),nowPlayingItem.Id).then(function(item){userdataButtons.fill({item:item,includePlayed:!1,element:nowPlayingUserData})}):userdataButtons.destroy({element:nowPlayingUserData})}function onPlaybackStart(e,state){console.log("nowplaying event: "+e.type);var player=this;onStateChanged.call(player,e,state)}function onRepeatModeChange(e){var player=this;updateRepeatModeDisplay(playbackManager.getRepeatMode(player))}function showNowPlayingBar(){getNowPlayingBar().then(slideUp)}function hideNowPlayingBar(){isEnabled=!1;var elem=document.getElementsByClassName("nowPlayingBar")[0];elem&&(document.body.classList.contains("hiddenNowPlayingBar")?(dom.removeEventListener(elem,dom.whichTransitionEvent(),onSlideDownComplete,{once:!0}),elem.classList.add("hide"),elem.classList.add("nowPlayingBar-hidden")):slideDown(elem))}function onPlaybackStopped(e,state){console.log("nowplaying event: "+e.type);var player=this;player.isLocalPlayer?"Audio"!==state.NextMediaType&&hideNowPlayingBar():state.NextMediaType||hideNowPlayingBar()}function onPlayPauseStateChanged(e){if(isEnabled){var player=this;updatePlayPauseState(player.paused())}}function onStateChanged(event,state){var player=this;return state.NowPlayingItem?player.isLocalPlayer&&state.NowPlayingItem&&"Video"==state.NowPlayingItem.MediaType?void hideNowPlayingBar():(isEnabled=!0,nowPlayingBarElement?void updatePlayerStateInternal(event,state):void getNowPlayingBar().then(function(){updatePlayerStateInternal(event,state)})):void hideNowPlayingBar()}function onTimeUpdate(e){if(isEnabled){var now=(new Date).getTime();if(!(now-lastUpdateTime<700)){lastUpdateTime=now;var player=this;currentRuntimeTicks=playbackManager.duration(player),updateTimeDisplay(playbackManager.currentTime(player),currentRuntimeTicks)}}}function releaseCurrentPlayer(){var player=currentPlayer;player&&(events.off(player,"playbackstart",onPlaybackStart),events.off(player,"statechange",onPlaybackStart),events.off(player,"repeatmodechange",onRepeatModeChange),events.off(player,"playbackstop",onPlaybackStopped),events.off(player,"volumechange",onVolumeChanged),events.off(player,"pause",onPlayPauseStateChanged),events.off(player,"playing",onPlayPauseStateChanged),events.off(player,"timeupdate",onTimeUpdate),currentPlayer=null,hideNowPlayingBar())}function onVolumeChanged(e){if(isEnabled){var player=this;updatePlayerVolumeState(player.isMuted(),player.getVolume())}}function bindToPlayer(player){player!==currentPlayer&&(releaseCurrentPlayer(),currentPlayer=player,player&&(playbackManager.getPlayerState(player).then(function(state){onStateChanged.call(player,{type:"init"},state)}),events.on(player,"playbackstart",onPlaybackStart),events.on(player,"statechange",onPlaybackStart),events.on(player,"repeatmodechange",onRepeatModeChange),events.on(player,"playbackstop",onPlaybackStopped),events.on(player,"volumechange",onVolumeChanged),events.on(player,"pause",onPlayPauseStateChanged),events.on(player,"playing",onPlayPauseStateChanged),events.on(player,"timeupdate",onTimeUpdate)))}var currentPlayer,currentTimeElement,nowPlayingImageElement,nowPlayingTextElement,nowPlayingUserData,muteButton,volumeSlider,volumeSliderContainer,playPauseButtons,positionSlider,toggleRepeatButton,toggleRepeatButtonIcon,isEnabled,nowPlayingBarElement,currentImgUrl,currentPlayerSupportedCommands=[],lastUpdateTime=0,lastPlayerState={},currentRuntimeTicks=0;events.on(playbackManager,"playerchange",function(){bindToPlayer(playbackManager.getCurrentPlayer())}),bindToPlayer(playbackManager.getCurrentPlayer())}); \ No newline at end of file +define(["datetime","userdataButtons","itemHelper","events","browser","imageLoader","playbackManager","nowPlayingHelper","apphost","dom","connectionManager","paper-icon-button-light"],function(datetime,userdataButtons,itemHelper,events,browser,imageLoader,playbackManager,nowPlayingHelper,appHost,dom,connectionManager){"use strict";function getNowPlayingBarHtml(){var html="";return html+='
',html+='
',html+='
',html+='',html+="
",html+='
',html+='
',html+='
',html+="
",html+='
',html+='',html+='',html+='',html+='',html+='
',html+="
",html+='
',html+='',html+='
',html+='',html+="
",html+='',html+='
',html+="
",html+='',html+='',html+="
",html+="
",html+="
"}function onSlideDownComplete(){this.classList.add("hide")}function slideDown(elem){void elem.offsetWidth,requestAnimationFrame(function(){elem.classList.add("nowPlayingBar-hidden"),dom.addEventListener(elem,dom.whichTransitionEvent(),onSlideDownComplete,{once:!0})})}function slideUp(elem){setTimeout(function(){dom.removeEventListener(elem,dom.whichTransitionEvent(),onSlideDownComplete,{once:!0}),elem.classList.remove("hide"),void elem.offsetWidth,requestAnimationFrame(function(){elem.classList.remove("nowPlayingBar-hidden")})},10)}function onPlayPauseClick(){playbackManager.playPause(currentPlayer)}function bindEvents(elem){currentTimeElement=elem.querySelector(".nowPlayingBarCurrentTime"),nowPlayingImageElement=elem.querySelector(".nowPlayingImage"),nowPlayingTextElement=elem.querySelector(".nowPlayingBarText"),nowPlayingUserData=elem.querySelector(".nowPlayingBarUserDataButtons"),muteButton=elem.querySelector(".muteButton"),muteButton.addEventListener("click",function(){currentPlayer&&playbackManager.toggleMute(currentPlayer)}),elem.querySelector(".stopButton").addEventListener("click",function(){currentPlayer&&playbackManager.stop(currentPlayer)});var i,length;for(playPauseButtons=elem.querySelectorAll(".playPauseButton"),i=0,length=playPauseButtons.length;i';return html+=text,html+=""}function seriesImageUrl(item,options){if(!item)throw new Error("item cannot be null!");if("Episode"!==item.Type)return null;if(options=options||{},options.type=options.type||"Primary","Primary"===options.type&&item.SeriesPrimaryImageTag)return options.tag=item.SeriesPrimaryImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.SeriesId,options);if("Thumb"===options.type){if(item.SeriesThumbImageTag)return options.tag=item.SeriesThumbImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.SeriesId,options);if(item.ParentThumbImageTag)return options.tag=item.ParentThumbImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.ParentThumbItemId,options)}return null}function imageUrl(item,options){if(!item)throw new Error("item cannot be null!");return options=options||{},options.type=options.type||"Primary",item.ImageTags&&item.ImageTags[options.type]?(options.tag=item.ImageTags[options.type],connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.PrimaryImageItemId||item.Id,options)):item.AlbumId&&item.AlbumPrimaryImageTag?(options.tag=item.AlbumPrimaryImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.AlbumId,options)):null}function updateNowPlayingInfo(state){var nowPlayingItem=state.NowPlayingItem;nowPlayingTextElement.innerHTML=nowPlayingItem?nowPlayingHelper.getNowPlayingNames(nowPlayingItem).map(function(nowPlayingName){return nowPlayingName.item?"
"+getTextActionButton(nowPlayingName.item,nowPlayingName.text)+"
":"
"+nowPlayingName.text+"
"}).join(""):"";var imgHeight=70,url=nowPlayingItem?seriesImageUrl(nowPlayingItem,{height:imgHeight})||imageUrl(nowPlayingItem,{height:imgHeight}):null;url!==currentImgUrl&&(currentImgUrl=url,imageLoader.lazyImage(nowPlayingImageElement,url)),nowPlayingItem.Id?ApiClient.getItem(Dashboard.getCurrentUserId(),nowPlayingItem.Id).then(function(item){userdataButtons.fill({item:item,includePlayed:!1,element:nowPlayingUserData})}):userdataButtons.destroy({element:nowPlayingUserData})}function onPlaybackStart(e,state){console.log("nowplaying event: "+e.type);var player=this;onStateChanged.call(player,e,state)}function onRepeatModeChange(e){var player=this;updateRepeatModeDisplay(playbackManager.getRepeatMode(player))}function showNowPlayingBar(){getNowPlayingBar().then(slideUp)}function hideNowPlayingBar(){isEnabled=!1;var elem=document.getElementsByClassName("nowPlayingBar")[0];elem&&(document.body.classList.contains("hiddenNowPlayingBar")?(dom.removeEventListener(elem,dom.whichTransitionEvent(),onSlideDownComplete,{once:!0}),elem.classList.add("hide"),elem.classList.add("nowPlayingBar-hidden")):slideDown(elem))}function onPlaybackStopped(e,state){console.log("nowplaying event: "+e.type);var player=this;player.isLocalPlayer?"Audio"!==state.NextMediaType&&hideNowPlayingBar():state.NextMediaType||hideNowPlayingBar()}function onPlayPauseStateChanged(e){if(isEnabled){var player=this;updatePlayPauseState(player.paused())}}function onStateChanged(event,state){var player=this;return state.NowPlayingItem?player.isLocalPlayer&&state.NowPlayingItem&&"Video"==state.NowPlayingItem.MediaType?void hideNowPlayingBar():(isEnabled=!0,nowPlayingBarElement?void updatePlayerStateInternal(event,state):void getNowPlayingBar().then(function(){updatePlayerStateInternal(event,state)})):void hideNowPlayingBar()}function onTimeUpdate(e){if(isEnabled){var now=(new Date).getTime();if(!(now-lastUpdateTime<700)){lastUpdateTime=now;var player=this;currentRuntimeTicks=playbackManager.duration(player),updateTimeDisplay(playbackManager.currentTime(player),currentRuntimeTicks)}}}function releaseCurrentPlayer(){var player=currentPlayer;player&&(events.off(player,"playbackstart",onPlaybackStart),events.off(player,"statechange",onPlaybackStart),events.off(player,"repeatmodechange",onRepeatModeChange),events.off(player,"playbackstop",onPlaybackStopped),events.off(player,"volumechange",onVolumeChanged),events.off(player,"pause",onPlayPauseStateChanged),events.off(player,"playing",onPlayPauseStateChanged),events.off(player,"timeupdate",onTimeUpdate),currentPlayer=null,hideNowPlayingBar())}function onVolumeChanged(e){if(isEnabled){var player=this;updatePlayerVolumeState(player.isMuted(),player.getVolume())}}function bindToPlayer(player){player!==currentPlayer&&(releaseCurrentPlayer(),currentPlayer=player,player&&(playbackManager.getPlayerState(player).then(function(state){onStateChanged.call(player,{type:"init"},state)}),events.on(player,"playbackstart",onPlaybackStart),events.on(player,"statechange",onPlaybackStart),events.on(player,"repeatmodechange",onRepeatModeChange),events.on(player,"playbackstop",onPlaybackStopped),events.on(player,"volumechange",onVolumeChanged),events.on(player,"pause",onPlayPauseStateChanged),events.on(player,"playing",onPlayPauseStateChanged),events.on(player,"timeupdate",onTimeUpdate)))}var currentPlayer,currentTimeElement,nowPlayingImageElement,nowPlayingTextElement,nowPlayingUserData,muteButton,volumeSlider,volumeSliderContainer,playPauseButtons,positionSlider,toggleRepeatButton,toggleRepeatButtonIcon,isEnabled,nowPlayingBarElement,currentImgUrl,currentPlayerSupportedCommands=[],lastUpdateTime=0,lastPlayerState={},currentRuntimeTicks=0;events.on(playbackManager,"playerchange",function(){bindToPlayer(playbackManager.getCurrentPlayer())}),bindToPlayer(playbackManager.getCurrentPlayer())}); \ No newline at end of file diff --git a/dashboard-ui/scripts/selectserver.js b/dashboard-ui/scripts/selectserver.js index 2dbbdeec01..4ed939f5ec 100644 --- a/dashboard-ui/scripts/selectserver.js +++ b/dashboard-ui/scripts/selectserver.js @@ -1 +1 @@ -define(["appSettings","paper-icon-button-light"],function(appSettings){"use strict";function updatePageStyle(page){"1"==getParameterByName("showuser")?(page.classList.add("libraryPage"),page.classList.add("noSecondaryNavPage"),page.classList.remove("standalonePage")):(page.classList.add("standalonePage"),page.classList.remove("noSecondaryNavPage"),page.classList.remove("libraryPage"))}function showServerConnectionFailure(){alertText(Globalize.translate("MessageUnableToConnectToServer"),Globalize.translate("HeaderConnectionFailure"))}function getServerHtml(server){var html="";return html+='
',html+='',html+='",server.Id&&(html+='"),html+="
"}function renderServers(page,servers){servers.length?(page.querySelector(".noServersMessage").classList.add("hide"),page.querySelector(".serverList").classList.remove("hide")):(page.querySelector(".serverList").classList.add("hide"),page.querySelector(".noServersMessage").classList.remove("hide"));var html="";html+=servers.map(getServerHtml).join(""),page.querySelector(".serverList").innerHTML=html}function alertText(text,title){alertTextWithOptions({title:title,text:text})}function alertTextWithOptions(options){require(["alert"],function(alert){alert(options)})}function showGeneralError(){Dashboard.hideLoadingMsg(),alertText(Globalize.translate("DefaultErrorMessage"))}function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}return function(view,params){function connectToServer(page,server){Dashboard.showLoadingMsg(),ConnectionManager.connectToServer(server,{enableAutoLogin:appSettings.enableAutoLogin()}).then(function(result){Dashboard.hideLoadingMsg();var apiClient=result.ApiClient;switch(result.State){case MediaBrowser.ConnectionState.SignedIn:Dashboard.onServerChanged(apiClient.getCurrentUserId(),apiClient.accessToken(),apiClient),Dashboard.navigate("home.html");break;case MediaBrowser.ConnectionState.ServerSignIn:Dashboard.onServerChanged(null,null,apiClient),Dashboard.navigate("login.html?serverid="+result.Servers[0].Id);break;case MediaBrowser.ConnectionState.ServerUpdateNeeded:alertTextWithOptions({text:Globalize.translate("core#ServerUpdateNeeded","https://emby.media"),html:Globalize.translate("core#ServerUpdateNeeded",'https://emby.media')});break;default:showServerConnectionFailure()}})}function acceptInvitation(page,id){Dashboard.showLoadingMsg(),ConnectionManager.acceptServer(id).then(function(){Dashboard.hideLoadingMsg(),loadPage(page)},function(){showGeneralError()})}function deleteServer(page,serverId){Dashboard.showLoadingMsg(),ConnectionManager.deleteServer(serverId).then(function(){Dashboard.hideLoadingMsg(),loadPage(page)},function(){showGeneralError()})}function rejectInvitation(page,id){Dashboard.showLoadingMsg(),ConnectionManager.rejectServer(id).then(function(){Dashboard.hideLoadingMsg(),loadPage(page)},function(){showGeneralError()})}function showServerMenu(elem){var card=parentWithClass(elem,"serverItem"),page=parentWithClass(elem,"page"),serverId=card.getAttribute("data-id"),menuItems=[];menuItems.push({name:Globalize.translate("ButtonDelete"),id:"delete"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:elem,callback:function(id){switch(id){case"delete":deleteServer(page,serverId)}}})})}function showPendingInviteMenu(elem){var card=parentWithClass(elem,"inviteItem"),page=parentWithClass(elem,"page"),invitationId=card.getAttribute("data-id"),menuItems=[];menuItems.push({name:Globalize.translate("ButtonAccept"),id:"accept"}),menuItems.push({name:Globalize.translate("ButtonReject"),id:"reject"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:elem,callback:function(id){switch(id){case"accept":acceptInvitation(page,invitationId);break;case"reject":rejectInvitation(page,invitationId)}}})})}function getPendingInviteHtml(invite){var html="";return html+='
',html+='',html+='
',html+="
",html+=invite.Name,html+="
",html+="
",html+='",html+="
"}function renderInvitations(page,list){list.length?page.querySelector(".invitationSection").classList.remove("hide"):page.querySelector(".invitationSection").classList.add("hide");var html=list.map(getPendingInviteHtml).join("");page.querySelector(".invitationList").innerHTML=html}function loadInvitations(page){ConnectionManager.isLoggedIntoConnect()?ConnectionManager.getUserInvitations().then(function(list){renderInvitations(page,list)}):renderInvitations(page,[])}function loadPage(page){Dashboard.showLoadingMsg(),ConnectionManager.getAvailableServers().then(function(servers){servers=servers.slice(0),cachedServers=servers,renderServers(page,servers),Dashboard.hideLoadingMsg()}),loadInvitations(page),ConnectionManager.isLoggedIntoConnect()?page.querySelector(".connectLogin").classList.add("hide"):page.querySelector(".connectLogin").classList.remove("hide")}var cachedServers;view.querySelector(".invitationList").addEventListener("click",function(e){var btnInviteMenu=parentWithClass(e.target,"btnInviteMenu");btnInviteMenu&&showPendingInviteMenu(btnInviteMenu)}),view.querySelector(".serverList").addEventListener("click",function(e){var lnkServer=parentWithClass(e.target,"lnkServer");if(lnkServer){var item=parentWithClass(lnkServer,"serverItem"),id=item.getAttribute("data-id"),server=cachedServers.filter(function(s){return s.Id==id})[0];connectToServer(view,server)}var btnServerMenu=parentWithClass(e.target,"btnServerMenu");btnServerMenu&&showServerMenu(btnServerMenu)}),view.addEventListener("viewbeforeshow",function(){updatePageStyle(this)}),view.addEventListener("viewshow",function(){loadPage(this)})}}); \ No newline at end of file +define(["appSettings","paper-icon-button-light"],function(appSettings){"use strict";function updatePageStyle(page){"1"==getParameterByName("showuser")?(page.classList.add("libraryPage"),page.classList.add("noSecondaryNavPage"),page.classList.remove("standalonePage")):(page.classList.add("standalonePage"),page.classList.remove("noSecondaryNavPage"),page.classList.remove("libraryPage"))}function showServerConnectionFailure(){alertText(Globalize.translate("MessageUnableToConnectToServer"),Globalize.translate("HeaderConnectionFailure"))}function getServerHtml(server){var html="";return html+='
',html+='',html+='",server.Id&&(html+=''),html+="
"}function renderServers(page,servers){servers.length?(page.querySelector(".noServersMessage").classList.add("hide"),page.querySelector(".serverList").classList.remove("hide")):(page.querySelector(".serverList").classList.add("hide"),page.querySelector(".noServersMessage").classList.remove("hide"));var html="";html+=servers.map(getServerHtml).join(""),page.querySelector(".serverList").innerHTML=html}function alertText(text,title){alertTextWithOptions({title:title,text:text})}function alertTextWithOptions(options){require(["alert"],function(alert){alert(options)})}function showGeneralError(){Dashboard.hideLoadingMsg(),alertText(Globalize.translate("DefaultErrorMessage"))}function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}return function(view,params){function connectToServer(page,server){Dashboard.showLoadingMsg(),ConnectionManager.connectToServer(server,{enableAutoLogin:appSettings.enableAutoLogin()}).then(function(result){Dashboard.hideLoadingMsg();var apiClient=result.ApiClient;switch(result.State){case MediaBrowser.ConnectionState.SignedIn:Dashboard.onServerChanged(apiClient.getCurrentUserId(),apiClient.accessToken(),apiClient),Dashboard.navigate("home.html");break;case MediaBrowser.ConnectionState.ServerSignIn:Dashboard.onServerChanged(null,null,apiClient),Dashboard.navigate("login.html?serverid="+result.Servers[0].Id);break;case MediaBrowser.ConnectionState.ServerUpdateNeeded:alertTextWithOptions({text:Globalize.translate("core#ServerUpdateNeeded","https://emby.media"),html:Globalize.translate("core#ServerUpdateNeeded",'https://emby.media')});break;default:showServerConnectionFailure()}})}function acceptInvitation(page,id){Dashboard.showLoadingMsg(),ConnectionManager.acceptServer(id).then(function(){Dashboard.hideLoadingMsg(),loadPage(page)},function(){showGeneralError()})}function deleteServer(page,serverId){Dashboard.showLoadingMsg(),ConnectionManager.deleteServer(serverId).then(function(){Dashboard.hideLoadingMsg(),loadPage(page)},function(){showGeneralError()})}function rejectInvitation(page,id){Dashboard.showLoadingMsg(),ConnectionManager.rejectServer(id).then(function(){Dashboard.hideLoadingMsg(),loadPage(page)},function(){showGeneralError()})}function showServerMenu(elem){var card=parentWithClass(elem,"serverItem"),page=parentWithClass(elem,"page"),serverId=card.getAttribute("data-id"),menuItems=[];menuItems.push({name:Globalize.translate("ButtonDelete"),id:"delete"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:elem,callback:function(id){switch(id){case"delete":deleteServer(page,serverId)}}})})}function showPendingInviteMenu(elem){var card=parentWithClass(elem,"inviteItem"),page=parentWithClass(elem,"page"),invitationId=card.getAttribute("data-id"),menuItems=[];menuItems.push({name:Globalize.translate("ButtonAccept"),id:"accept"}),menuItems.push({name:Globalize.translate("ButtonReject"),id:"reject"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:elem,callback:function(id){switch(id){case"accept":acceptInvitation(page,invitationId);break;case"reject":rejectInvitation(page,invitationId)}}})})}function getPendingInviteHtml(invite){var html="";return html+='
',html+='',html+='
',html+="
",html+=invite.Name,html+="
",html+="
",html+='",html+="
"}function renderInvitations(page,list){list.length?page.querySelector(".invitationSection").classList.remove("hide"):page.querySelector(".invitationSection").classList.add("hide");var html=list.map(getPendingInviteHtml).join("");page.querySelector(".invitationList").innerHTML=html}function loadInvitations(page){ConnectionManager.isLoggedIntoConnect()?ConnectionManager.getUserInvitations().then(function(list){renderInvitations(page,list)}):renderInvitations(page,[])}function loadPage(page){Dashboard.showLoadingMsg(),ConnectionManager.getAvailableServers().then(function(servers){servers=servers.slice(0),cachedServers=servers,renderServers(page,servers),Dashboard.hideLoadingMsg()}),loadInvitations(page),ConnectionManager.isLoggedIntoConnect()?page.querySelector(".connectLogin").classList.add("hide"):page.querySelector(".connectLogin").classList.remove("hide")}var cachedServers;view.querySelector(".invitationList").addEventListener("click",function(e){var btnInviteMenu=parentWithClass(e.target,"btnInviteMenu");btnInviteMenu&&showPendingInviteMenu(btnInviteMenu)}),view.querySelector(".serverList").addEventListener("click",function(e){var lnkServer=parentWithClass(e.target,"lnkServer");if(lnkServer){var item=parentWithClass(lnkServer,"serverItem"),id=item.getAttribute("data-id"),server=cachedServers.filter(function(s){return s.Id==id})[0];connectToServer(view,server)}var btnServerMenu=parentWithClass(e.target,"btnServerMenu");btnServerMenu&&showServerMenu(btnServerMenu)}),view.addEventListener("viewbeforeshow",function(){updatePageStyle(this)}),view.addEventListener("viewshow",function(){loadPage(this)})}}); \ No newline at end of file diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 79080551ae..9f7450c968 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1,2 +1,2 @@ -function getWindowLocationSearch(win){"use strict";var search=(win||window).location.search;if(!search){var index=window.location.href.indexOf("?");index!=-1&&(search=window.location.href.substring(index))}return search||""}function getParameterByName(name,url){"use strict";name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)",regex=new RegExp(regexS,"i"),results=regex.exec(url||getWindowLocationSearch());return null==results?"":decodeURIComponent(results[1].replace(/\+/g," "))}function pageClassOn(eventName,className,fn){"use strict";document.addEventListener(eventName,function(e){var target=e.target;target.classList.contains(className)&&fn.call(target,e)})}function pageIdOn(eventName,id,fn){"use strict";document.addEventListener(eventName,function(e){var target=e.target;target.id==id&&fn.call(target,e)})}var Dashboard={isConnectMode:function(){if(AppInfo.isNativeApp)return!0;var url=window.location.href.toLowerCase();return url.indexOf("mediabrowser.tv")!=-1||url.indexOf("emby.media")!=-1},isRunningInCordova:function(){return"cordova"==window.appMode},onRequestFail:function(e,data){if(401==data.status&&"ParentalControl"==data.errorCode){var currentView=ViewManager.currentView();currentView&&!currentView.classList.contains(".standalonePage")&&Dashboard.alert({message:Globalize.translate("MessageLoggedOutParentalControl"),callback:function(){Dashboard.logout(!1)}})}},getCurrentUser:function(){return window.ApiClient.getCurrentUser()},serverAddress:function(){if(Dashboard.isConnectMode()){var apiClient=window.ApiClient;return apiClient?apiClient.serverAddress():null}var urlLower=window.location.href.toLowerCase(),index=urlLower.lastIndexOf("/web");if(index!=-1)return urlLower.substring(0,index);var loc=window.location,address=loc.protocol+"//"+loc.hostname;return loc.port&&(address+=":"+loc.port),address},getCurrentUserId:function(){var apiClient=window.ApiClient;return apiClient?apiClient.getCurrentUserId():null},onServerChanged:function(userId,accessToken,apiClient){apiClient=apiClient||window.ApiClient,window.ApiClient=apiClient},logout:function(logoutWithServer){function onLogoutDone(){var loginPage;Dashboard.isConnectMode()?(loginPage="connectlogin.html",window.ApiClient=null):loginPage="login.html",Dashboard.navigate(loginPage)}logoutWithServer===!1?onLogoutDone():ConnectionManager.logout().then(onLogoutDone)},getConfigurationPageUrl:function(name){return"configurationpage?name="+encodeURIComponent(name)},navigate:function(url,preserveQueryString){if(!url)throw new Error("url cannot be null or empty");var queryString=getWindowLocationSearch();return preserveQueryString&&queryString&&(url+=queryString),Emby.Page.show(url)},showLoadingMsg:function(){Dashboard.loadingVisible=!0,require(["loading"],function(loading){Dashboard.loadingVisible?loading.show():loading.hide()})},hideLoadingMsg:function(){Dashboard.loadingVisible=!1,require(["loading"],function(loading){Dashboard.loadingVisible?loading.show():loading.hide()})},processPluginConfigurationUpdateResult:function(){Dashboard.hideLoadingMsg(),require(["toast"],function(toast){toast(Globalize.translate("MessageSettingsSaved"))})},processServerConfigurationUpdateResult:function(result){Dashboard.hideLoadingMsg(),require(["toast"],function(toast){toast(Globalize.translate("MessageSettingsSaved"))})},processErrorResponse:function(response){Dashboard.hideLoadingMsg();var status=""+response.status;response.statusText&&(status=response.statusText),Dashboard.alert({title:status,message:response.headers?response.headers.get("X-Application-Error-Code"):null})},alert:function(options){return"string"==typeof options?void require(["toast"],function(toast){toast({text:options})}):void require(["alert"],function(alert){alert({title:options.title||Globalize.translate("HeaderAlert"),text:options.message}).then(options.callback||function(){})})},restartServer:function(){var apiClient=window.ApiClient;apiClient&&(Dashboard.suppressAjaxErrors=!0,Dashboard.showLoadingMsg(),apiClient.restartServer().then(function(){setTimeout(function(){Dashboard.reloadPageWhenServerAvailable()},250)},function(){Dashboard.suppressAjaxErrors=!1}))},reloadPageWhenServerAvailable:function(retryCount){var apiClient=window.ApiClient;apiClient&&apiClient.getJSON(apiClient.getUrl("System/Info")).then(function(info){info.HasPendingRestart?Dashboard.retryReload(retryCount):window.location.reload(!0)},function(){Dashboard.retryReload(retryCount)})},retryReload:function(retryCount){setTimeout(function(){retryCount=retryCount||0,retryCount++,retryCount<10?Dashboard.reloadPageWhenServerAvailable(retryCount):Dashboard.suppressAjaxErrors=!1},500)},showUserFlyout:function(){Dashboard.navigate("mypreferencesmenu.html")},getPluginSecurityInfo:function(){var apiClient=window.ApiClient;if(!apiClient)return Promise.reject();var cachedInfo=Dashboard.pluginSecurityInfo;return cachedInfo?Promise.resolve(cachedInfo):apiClient.ajax({type:"GET",url:apiClient.getUrl("Plugins/SecurityInfo"),dataType:"json",error:function(){}}).then(function(result){return Dashboard.pluginSecurityInfo=result,result})},resetPluginSecurityInfo:function(){Dashboard.pluginSecurityInfo=null},ensureHeader:function(page){page.classList.contains("standalonePage")&&!page.classList.contains("noHeaderPage")&&Dashboard.renderHeader(page)},renderHeader:function(page){var header=page.querySelector(".header");if(!header){var headerHtml="";headerHtml+='",page.insertAdjacentHTML("afterbegin",headerHtml)}},getToolsLinkHtml:function(item){var menuHtml="",pageIds=item.pageIds?item.pageIds.join(","):"";return pageIds=pageIds?' data-pageids="'+pageIds+'"':"",menuHtml+='",menuHtml+='',menuHtml+=item.name,menuHtml+="",menuHtml+=""},getToolsMenuHtml:function(page){var i,length,item,items=Dashboard.getToolsMenuLinks(page),menuHtml="";for(menuHtml+='
',i=0,length=items.length;i
"),item.href?menuHtml+=Dashboard.getToolsLinkHtml(item):(menuHtml+='
',menuHtml+=item.name,menuHtml+="
");return menuHtml+=""},getToolsMenuLinks:function(){return[{name:Globalize.translate("TabServer")},{name:Globalize.translate("TabDashboard"),href:"dashboard.html",pageIds:["dashboardPage"],icon:"dashboard"},{name:Globalize.translate("TabSettings"),href:"dashboardgeneral.html",pageIds:["dashboardGeneralPage"],icon:"settings"},{name:Globalize.translate("TabDevices"),href:"devices.html",pageIds:["devicesPage","devicePage","devicesUploadPage"],icon:"tablet"},{name:Globalize.translate("TabUsers"),href:"userprofiles.html",pageIds:["userProfilesPage","newUserPage","editUserPage","userLibraryAccessPage","userParentalControlPage","userPasswordPage"],icon:"people"},{name:"Emby Premiere",href:"supporterkey.html",pageIds:["supporterKeyPage"],icon:"star"},{divider:!0,name:Globalize.translate("TabLibrary"),href:"library.html",pageIds:["mediaLibraryPage","librarySettingsPage","libraryDisplayPage","metadataImagesConfigurationPage","metadataNfoPage"],icon:"folder",color:"#38c"},{name:Globalize.translate("TabSubtitles"),href:"metadatasubtitles.html",pageIds:["metadataSubtitlesPage"],icon:"closed_caption"},{name:Globalize.translate("TabPlayback"),icon:"play_circle_filled",color:"#E5342E",href:"cinemamodeconfiguration.html",pageIds:["cinemaModeConfigurationPage","playbackConfigurationPage","streamingSettingsPage"]},{name:Globalize.translate("TabSync"),icon:"sync",href:"syncactivity.html",pageIds:["syncActivityPage","syncJobPage","syncSettingsPage"],color:"#009688"},{name:Globalize.translate("TabTranscoding"),icon:"transform",href:"encodingsettings.html",pageIds:["encodingSettingsPage"]},{divider:!0,name:Globalize.translate("TabExtras")},{name:Globalize.translate("TabAutoOrganize"),color:"#01C0DD",href:"autoorganizelog.html",pageIds:["libraryFileOrganizerPage","libraryFileOrganizerSmartMatchPage","libraryFileOrganizerLogPage"],icon:"folder"},{name:Globalize.translate("DLNA"),href:"dlnasettings.html",pageIds:["dlnaSettingsPage","dlnaProfilesPage","dlnaProfilePage"],icon:"settings"},{name:Globalize.translate("TabLiveTV"),href:"livetvstatus.html",pageIds:["liveTvStatusPage","liveTvSettingsPage","liveTvTunerProviderHdHomerunPage","liveTvTunerProviderM3UPage","liveTvTunerProviderSatPage"],icon:"dvr"},{name:Globalize.translate("TabNotifications"),icon:"notifications",color:"brown",href:"notificationsettings.html",pageIds:["notificationSettingsPage","notificationSettingPage"]},{name:Globalize.translate("TabPlugins"),icon:"add_shopping_cart",color:"#9D22B1",href:"plugins.html",pageIds:["pluginsPage","pluginCatalogPage"]},{divider:!0,name:Globalize.translate("TabExpert")},{name:Globalize.translate("TabAdvanced"),icon:"settings",href:"dashboardhosting.html",color:"#F16834",pageIds:["dashboardHostingPage","serverSecurityPage"]},{name:Globalize.translate("TabLogs"),href:"log.html",pageIds:["logPage"],icon:"folder_open"},{name:Globalize.translate("TabScheduledTasks"),href:"scheduledtasks.html",pageIds:["scheduledTasksPage","scheduledTaskPage"],icon:"schedule"},{name:Globalize.translate("MetadataManager"),href:"edititemmetadata.html",pageIds:[],icon:"mode_edit"},{name:Globalize.translate("ButtonReports"),href:"reports.html",pageIds:[],icon:"insert_chart"}]},getSupportedRemoteCommands:function(){return["GoHome","GoToSettings","VolumeUp","VolumeDown","Mute","Unmute","ToggleMute","SetVolume","SetAudioStreamIndex","SetSubtitleStreamIndex","DisplayContent","GoToSearch","DisplayMessage","SetRepeatMode"]},capabilities:function(){var caps={PlayableMediaTypes:["Audio","Video"],SupportedCommands:Dashboard.getSupportedRemoteCommands(),SupportsPersistentIdentifier:Dashboard.isRunningInCordova(),SupportsMediaControl:!0,SupportedLiveMediaTypes:["Audio","Video"]};return Dashboard.isRunningInCordova()&&!browserInfo.safari&&(caps.SupportsSync=!0,caps.SupportsContentUploading=!0),caps},normalizeImageOptions:function(options){AppInfo.hasLowImageBandwidth&&(options.enableImageEnhancers=!1);var setQuality;if(options.maxWidth&&(setQuality=!0),options.width&&(setQuality=!0),options.maxHeight&&(setQuality=!0),options.height&&(setQuality=!0),setQuality){var quality=90,isBackdrop="backdrop"==(options.type||"").toLowerCase();isBackdrop&&(quality-=10),browserInfo.slow&&(quality-=40),AppInfo.hasLowImageBandwidth&&!isBackdrop&&(quality-=10),options.quality=quality}}},AppInfo={};!function(){"use strict";function setAppInfo(){var isCordova=Dashboard.isRunningInCordova();AppInfo.enableHomeTabs=!0,AppInfo.enableAutoSave=browserInfo.touch,AppInfo.enableAppStorePolicy=isCordova;var isIOS=browserInfo.ipad||browserInfo.iphone,isAndroid=browserInfo.android;isIOS&&(AppInfo.hasLowImageBandwidth=!0),isCordova?(AppInfo.isNativeApp=!0,AppInfo.enableHomeTabs=!1,isAndroid&&(AppInfo.supportsExternalPlayers=!0)):AppInfo.enableSupporterMembership=!0,AppInfo.supportsFileInput=!(AppInfo.isNativeApp&&isAndroid),isCordova&&isIOS?AppInfo.moreIcon="more-horiz":AppInfo.moreIcon="more-vert",AppInfo.supportsUserDisplayLanguageSetting=Dashboard.isConnectMode()}function initializeApiClient(apiClient){AppInfo.enableAppStorePolicy&&(apiClient.getAvailablePlugins=function(){return Promise.resolve([])},apiClient.getInstalledPlugins=function(){return Promise.resolve([])}),apiClient.normalizeImageOptions=Dashboard.normalizeImageOptions,Events.off(apiClient,"requestfail",Dashboard.onRequestFail),Events.on(apiClient,"requestfail",Dashboard.onRequestFail)}function onApiClientCreated(e,newApiClient){initializeApiClient(newApiClient),window.$&&($.ajax=newApiClient.ajax)}function defineConnectionManager(connectionManager){window.ConnectionManager=connectionManager,define("connectionManager",[],function(){return connectionManager})}function bindConnectionManagerEvents(connectionManager,events,userSettings){window.Events=events,events.on(ConnectionManager,"apiclientcreated",onApiClientCreated),connectionManager.currentApiClient=function(){if(!localApiClient){var server=connectionManager.getLastUsedServer();server&&(localApiClient=connectionManager.getApiClient(server.Id))}return localApiClient},connectionManager.onLocalUserSignedIn=function(user){return localApiClient=connectionManager.getApiClient(user.ServerId),window.ApiClient=localApiClient,userSettings.setUserInfo(user.Id,localApiClient)},events.on(connectionManager,"localusersignedout",function(){userSettings.setUserInfo(null,null)})}function createConnectionManager(){return new Promise(function(resolve,reject){require(["connectionManagerFactory","apphost","credentialprovider","events","userSettings"],function(connectionManagerExports,apphost,credentialProvider,events,userSettings){window.MediaBrowser=Object.assign(window.MediaBrowser||{},connectionManagerExports);var credentialProviderInstance=new credentialProvider,promises=[apphost.getSyncProfile(),apphost.appInfo()];Promise.all(promises).then(function(responses){var deviceProfile=responses[0],appInfo=responses[1],capabilities=Dashboard.capabilities();capabilities.DeviceProfile=deviceProfile;var connectionManager=new MediaBrowser.ConnectionManager(credentialProviderInstance,appInfo.appName,appInfo.appVersion,appInfo.deviceName,appInfo.deviceId,capabilities,window.devicePixelRatio);return defineConnectionManager(connectionManager),bindConnectionManagerEvents(connectionManager,events,userSettings),Dashboard.isConnectMode()?void resolve():(console.log("loading ApiClient singleton"),getRequirePromise(["apiclient"]).then(function(apiClientFactory){console.log("creating ApiClient singleton");var apiClient=new apiClientFactory(Dashboard.serverAddress(),appInfo.appName,appInfo.appVersion,appInfo.deviceName,appInfo.deviceId,window.devicePixelRatio);apiClient.enableAutomaticNetworking=!1,connectionManager.addApiClient(apiClient),require(["css!"+apiClient.getUrl("Branding/Css")]),window.ApiClient=apiClient,localApiClient=apiClient,console.log("loaded ApiClient singleton"),resolve()}))})})})}function setDocumentClasses(browser){var elem=document.documentElement;AppInfo.enableSupporterMembership||elem.classList.add("supporterMembershipDisabled")}function loadTheme(){var name=getParameterByName("theme");if(name)return void require(["themes/"+name+"/theme"]);if(!AppInfo.isNativeApp){var date=new Date,month=date.getMonth(),day=date.getDate();return 9==month&&day>=30?void require(["themes/halloween/theme"]):void 0}}function returnFirstDependency(obj){return obj}function getBowerPath(){return"bower_components"}function getLayoutManager(layoutManager){return layoutManager.init(),layoutManager}function getAppStorage(basePath){try{return localStorage.setItem("_test","0"),localStorage.removeItem("_test"),basePath+"/appstorage-localstorage"}catch(e){return basePath+"/appstorage-memory"}}function createWindowHeadroom(){var headroom=new Headroom([],{tolerance:{down:0,up:0},classes:{}});return headroom.init(),headroom}function createMainContentHammer(Hammer){var hammer=new Hammer(document.querySelector(".skinBody"),null);return hammer}function createSharedAppFooter(appFooter){var footer=new appFooter({});return footer}function initRequire(){var urlArgs="v="+(window.dashboardVersion||(new Date).getDate()),bowerPath=getBowerPath(),apiClientBowerPath=bowerPath+"/emby-apiclient",embyWebComponentsBowerPath=bowerPath+"/emby-webcomponents",paths={velocity:bowerPath+"/velocity/velocity.min",vibrant:bowerPath+"/vibrant/dist/vibrant",ironCardList:"components/ironcardlist/ironcardlist",scrollThreshold:"components/scrollthreshold",playlisteditor:"components/playlisteditor/playlisteditor",medialibrarycreator:"components/medialibrarycreator/medialibrarycreator",medialibraryeditor:"components/medialibraryeditor/medialibraryeditor",howler:bowerPath+"/howlerjs/howler.min",sortable:bowerPath+"/Sortable/Sortable.min",isMobile:bowerPath+"/isMobile/isMobile.min",headroom:bowerPath+"/headroomjs/dist/headroom",masonry:bowerPath+"/masonry/dist/masonry.pkgd.min",humanedate:"components/humanedate",libraryBrowser:"scripts/librarybrowser",chromecasthelpers:"components/chromecasthelpers",events:apiClientBowerPath+"/events",credentialprovider:apiClientBowerPath+"/credentials",apiclient:apiClientBowerPath+"/apiclient",connectionManagerFactory:bowerPath+"/emby-apiclient/connectionmanager",visibleinviewport:embyWebComponentsBowerPath+"/visibleinviewport",browserdeviceprofile:embyWebComponentsBowerPath+"/browserdeviceprofile",browser:embyWebComponentsBowerPath+"/browser",inputManager:embyWebComponentsBowerPath+"/inputmanager",qualityoptions:embyWebComponentsBowerPath+"/qualityoptions",hammer:bowerPath+"/hammerjs/hammer.min",pageJs:embyWebComponentsBowerPath+"/pagejs/page",focusManager:embyWebComponentsBowerPath+"/focusmanager",datetime:embyWebComponentsBowerPath+"/datetime",globalize:embyWebComponentsBowerPath+"/globalize",itemHelper:embyWebComponentsBowerPath+"/itemhelper",itemShortcuts:embyWebComponentsBowerPath+"/shortcuts",serverNotifications:embyWebComponentsBowerPath+"/servernotifications",playbackManager:embyWebComponentsBowerPath+"/playback/playbackmanager",autoPlayDetect:embyWebComponentsBowerPath+"/playback/autoplaydetect",nowPlayingHelper:embyWebComponentsBowerPath+"/playback/nowplayinghelper",pluginManager:embyWebComponentsBowerPath+"/pluginmanager",packageManager:embyWebComponentsBowerPath+"/packagemanager",webAnimations:bowerPath+"/web-animations-js/web-animations-next-lite.min"};paths.hlsjs=bowerPath+"/hlsjs/dist/hls.min",define("webActionSheet",[embyWebComponentsBowerPath+"/actionsheet/actionsheet"],returnFirstDependency),Dashboard.isRunningInCordova()?paths.sharingMenu="cordova/sharingwidget":define("sharingMenu",[embyWebComponentsBowerPath+"/sharing/sharingmenu"],returnFirstDependency),paths.wakeonlan=apiClientBowerPath+"/wakeonlan",define("libjass",[bowerPath+"/libjass/libjass.min","css!"+bowerPath+"/libjass/libjass"],returnFirstDependency),window.IntersectionObserver?define("lazyLoader",[embyWebComponentsBowerPath+"/lazyloader/lazyloader-intersectionobserver"],returnFirstDependency):define("lazyLoader",[embyWebComponentsBowerPath+"/lazyloader/lazyloader-scroll"],returnFirstDependency),define("imageLoader",[embyWebComponentsBowerPath+"/images/imagehelper"],returnFirstDependency),define("appfooter",["components/appfooter/appfooter"],returnFirstDependency),define("dockedtabs",["components/dockedtabs/dockedtabs"],returnFirstDependency),define("directorybrowser",["components/directorybrowser/directorybrowser"],returnFirstDependency),define("metadataEditor",[embyWebComponentsBowerPath+"/metadataeditor/metadataeditor"],returnFirstDependency),define("personEditor",[embyWebComponentsBowerPath+"/metadataeditor/personeditor"],returnFirstDependency),define("playerSelectionMenu",[embyWebComponentsBowerPath+"/playback/playerselection"],returnFirstDependency),define("playerSettingsMenu",[embyWebComponentsBowerPath+"/playback/playersettingsmenu"],returnFirstDependency),define("libraryMenu",["scripts/librarymenu"],returnFirstDependency),define("emby-collapse",[embyWebComponentsBowerPath+"/emby-collapse/emby-collapse"],returnFirstDependency),define("emby-button",[embyWebComponentsBowerPath+"/emby-button/emby-button"],returnFirstDependency),define("emby-itemscontainer",[embyWebComponentsBowerPath+"/emby-itemscontainer/emby-itemscontainer"],returnFirstDependency),define("emby-tabs",[embyWebComponentsBowerPath+"/emby-tabs/emby-tabs"],returnFirstDependency),define("itemHoverMenu",[embyWebComponentsBowerPath+"/itemhovermenu/itemhovermenu"],returnFirstDependency),define("multiSelect",[embyWebComponentsBowerPath+"/multiselect/multiselect"],returnFirstDependency),define("alphaPicker",[embyWebComponentsBowerPath+"/alphapicker/alphapicker"],returnFirstDependency),define("paper-icon-button-light",[embyWebComponentsBowerPath+"/emby-button/paper-icon-button-light"]),define("connectHelper",[embyWebComponentsBowerPath+"/emby-connect/connecthelper"],returnFirstDependency),define("emby-input",[embyWebComponentsBowerPath+"/emby-input/emby-input"],returnFirstDependency),define("emby-select",[embyWebComponentsBowerPath+"/emby-select/emby-select"],returnFirstDependency),define("emby-slider",[embyWebComponentsBowerPath+"/emby-slider/emby-slider"],returnFirstDependency),define("emby-checkbox",[embyWebComponentsBowerPath+"/emby-checkbox/emby-checkbox"],returnFirstDependency),define("emby-toggle",[embyWebComponentsBowerPath+"/emby-toggle/emby-toggle"],returnFirstDependency),define("emby-radio",[embyWebComponentsBowerPath+"/emby-radio/emby-radio"],returnFirstDependency),define("emby-textarea",[embyWebComponentsBowerPath+"/emby-textarea/emby-textarea"],returnFirstDependency),define("collectionEditor",[embyWebComponentsBowerPath+"/collectioneditor/collectioneditor"],returnFirstDependency),define("playlistEditor",[embyWebComponentsBowerPath+"/playlisteditor/playlisteditor"],returnFirstDependency),define("recordingCreator",[embyWebComponentsBowerPath+"/recordingcreator/recordingcreator"],returnFirstDependency),define("recordingEditor",[embyWebComponentsBowerPath+"/recordingcreator/recordingeditor"],returnFirstDependency),define("seriesRecordingEditor",[embyWebComponentsBowerPath+"/recordingcreator/seriesrecordingeditor"],returnFirstDependency),define("recordingFields",[embyWebComponentsBowerPath+"/recordingcreator/recordingfields"],returnFirstDependency),define("recordingHelper",[embyWebComponentsBowerPath+"/recordingcreator/recordinghelper"],returnFirstDependency),define("subtitleEditor",[embyWebComponentsBowerPath+"/subtitleeditor/subtitleeditor"],returnFirstDependency),define("itemIdentifier",[embyWebComponentsBowerPath+"/itemidentifier/itemidentifier"],returnFirstDependency),define("mediaInfo",[embyWebComponentsBowerPath+"/mediainfo/mediainfo"],returnFirstDependency),define("itemContextMenu",[embyWebComponentsBowerPath+"/itemcontextmenu"],returnFirstDependency),define("imageEditor",[embyWebComponentsBowerPath+"/imageeditor/imageeditor"],returnFirstDependency),define("dom",[embyWebComponentsBowerPath+"/dom"],returnFirstDependency),define("fullscreen-doubleclick",[embyWebComponentsBowerPath+"/fullscreen/fullscreen-doubleclick"],returnFirstDependency),define("fullscreenManager",[embyWebComponentsBowerPath+"/fullscreen/fullscreenmanager","events"],returnFirstDependency),define("layoutManager",[embyWebComponentsBowerPath+"/layoutmanager"],getLayoutManager),define("playMenu",[embyWebComponentsBowerPath+"/playmenu"],returnFirstDependency),define("refreshDialog",[embyWebComponentsBowerPath+"/refreshdialog/refreshdialog"],returnFirstDependency),define("backdrop",[embyWebComponentsBowerPath+"/backdrop/backdrop"],returnFirstDependency),define("fetchHelper",[embyWebComponentsBowerPath+"/fetchhelper"],returnFirstDependency),define("roundCardStyle",["cardStyle","css!"+embyWebComponentsBowerPath+"/cardbuilder/roundcard"],returnFirstDependency),define("cardStyle",["css!"+embyWebComponentsBowerPath+"/cardbuilder/card"],returnFirstDependency),define("cardBuilder",[embyWebComponentsBowerPath+"/cardbuilder/cardbuilder"],returnFirstDependency),define("peoplecardbuilder",[embyWebComponentsBowerPath+"/cardbuilder/peoplecardbuilder"],returnFirstDependency),define("chaptercardbuilder",[embyWebComponentsBowerPath+"/cardbuilder/chaptercardbuilder"],returnFirstDependency),define("mouseManager",[embyWebComponentsBowerPath+"/input/mouse"],returnFirstDependency),define("deleteHelper",[embyWebComponentsBowerPath+"/deletehelper"],returnFirstDependency),define("tvguide",[embyWebComponentsBowerPath+"/guide/guide"],returnFirstDependency),define("programStyles",["css!"+embyWebComponentsBowerPath+"/guide/programs"],returnFirstDependency),define("guide-settings-dialog",[embyWebComponentsBowerPath+"/guide/guide-settings"],returnFirstDependency),define("syncDialog",[embyWebComponentsBowerPath+"/sync/sync"],returnFirstDependency),define("syncToggle",[embyWebComponentsBowerPath+"/sync/synctoggle"],returnFirstDependency),define("syncJobEditor",[embyWebComponentsBowerPath+"/sync/syncjobeditor"],returnFirstDependency),define("syncJobList",[embyWebComponentsBowerPath+"/sync/syncjoblist"],returnFirstDependency),define("voiceDialog",[embyWebComponentsBowerPath+"/voice/voicedialog"],returnFirstDependency),define("voiceReceiver",[embyWebComponentsBowerPath+"/voice/voicereceiver"],returnFirstDependency),define("voiceProcessor",[embyWebComponentsBowerPath+"/voice/voiceprocessor"],returnFirstDependency),define("viewManager",[embyWebComponentsBowerPath+"/viewmanager/viewmanager"],function(viewManager){return window.ViewManager=viewManager,viewManager.dispatchPageEvents(!0),viewManager}),Dashboard.isRunningInCordova()&&window.MainActivity?define("shell",["cordova/shell"],returnFirstDependency):define("shell",[embyWebComponentsBowerPath+"/shell"],returnFirstDependency),define("sharingmanager",[embyWebComponentsBowerPath+"/sharing/sharingmanager"],returnFirstDependency),Dashboard.isRunningInCordova()?paths.apphost="cordova/apphost":paths.apphost="components/apphost",Dashboard.isRunningInCordova()&&window.MainActivity?(paths.appStorage="cordova/appstorage",paths.filesystem="cordova/filesystem"):(paths.appStorage=getAppStorage(apiClientBowerPath),paths.filesystem=embyWebComponentsBowerPath+"/filesystem");var sha1Path=bowerPath+"/cryptojslib/components/sha1-min",md5Path=bowerPath+"/cryptojslib/components/md5-min",shim={};shim[sha1Path]={deps:[bowerPath+"/cryptojslib/components/core-min"]},shim[md5Path]={deps:[bowerPath+"/cryptojslib/components/core-min"]},requirejs.config({waitSeconds:0,map:{"*":{css:bowerPath+"/emby-webcomponents/require/requirecss",html:bowerPath+"/emby-webcomponents/require/requirehtml",text:bowerPath+"/emby-webcomponents/require/requiretext"}},urlArgs:urlArgs,paths:paths,shim:shim}),define("cryptojs-sha1",[sha1Path]),define("cryptojs-md5",[md5Path]),define("jstree",[bowerPath+"/jstree/dist/jstree","css!thirdparty/jstree/themes/default/style.min.css"]),define("dashboardcss",["css!css/dashboard"]),define("jqmtable",["thirdparty/jquerymobile-1.4.5/jqm.table","css!thirdparty/jquerymobile-1.4.5/jqm.table.css"]),define("jqmwidget",["thirdparty/jquerymobile-1.4.5/jqm.widget"]),define("jqmslider",["thirdparty/jquerymobile-1.4.5/jqm.slider","css!thirdparty/jquerymobile-1.4.5/jqm.slider.css"]),define("jqmpopup",["thirdparty/jquerymobile-1.4.5/jqm.popup","css!thirdparty/jquerymobile-1.4.5/jqm.popup.css"]),define("jqmlistview",["css!thirdparty/jquerymobile-1.4.5/jqm.listview.css"]),define("jqmpanel",["thirdparty/jquerymobile-1.4.5/jqm.panel","css!thirdparty/jquerymobile-1.4.5/jqm.panel.css"]),define("slideshow",[embyWebComponentsBowerPath+"/slideshow/slideshow"],returnFirstDependency),define("fetch",[bowerPath+"/fetch/fetch"]),define("raf",[embyWebComponentsBowerPath+"/polyfills/raf"]),define("functionbind",[embyWebComponentsBowerPath+"/polyfills/bind"]),define("arraypolyfills",[embyWebComponentsBowerPath+"/polyfills/array"]),define("objectassign",[embyWebComponentsBowerPath+"/polyfills/objectassign"]),define("clearButtonStyle",["css!"+embyWebComponentsBowerPath+"/clearbutton"]),define("userdataButtons",[embyWebComponentsBowerPath+"/userdatabuttons/userdatabuttons"],returnFirstDependency),define("listView",[embyWebComponentsBowerPath+"/listview/listview"],returnFirstDependency),define("listViewStyle",["css!"+embyWebComponentsBowerPath+"/listview/listview"],returnFirstDependency),define("formDialogStyle",["css!"+embyWebComponentsBowerPath+"/formdialog"],returnFirstDependency),define("indicators",[embyWebComponentsBowerPath+"/indicators/indicators"],returnFirstDependency),define("registrationServices",[embyWebComponentsBowerPath+"/registrationservices/registrationservices"],returnFirstDependency),Dashboard.isRunningInCordova()?(define("iapManager",["cordova/iap"],returnFirstDependency),define("fileupload",["cordova/fileupload"],returnFirstDependency)):(define("iapManager",["components/iap"],returnFirstDependency),define("fileupload",[apiClientBowerPath+"/fileupload"],returnFirstDependency)),define("connectionmanager",[apiClientBowerPath+"/connectionmanager"]),define("cameraRoll",[apiClientBowerPath+"/cameraroll"],returnFirstDependency),define("contentuploader",[apiClientBowerPath+"/sync/contentuploader"]),define("serversync",[apiClientBowerPath+"/sync/serversync"]),define("multiserversync",[apiClientBowerPath+"/sync/multiserversync"]),define("offlineusersync",[apiClientBowerPath+"/sync/offlineusersync"]),define("mediasync",[apiClientBowerPath+"/sync/mediasync"]),define("swiper",[bowerPath+"/Swiper/dist/js/swiper.min","css!"+bowerPath+"/Swiper/dist/css/swiper.min"],returnFirstDependency),define("scroller",[embyWebComponentsBowerPath+"/scroller/smoothscroller"],returnFirstDependency),define("toast",[embyWebComponentsBowerPath+"/toast/toast"],returnFirstDependency),define("scrollHelper",[embyWebComponentsBowerPath+"/scrollhelper"],returnFirstDependency),define("appSettings",[embyWebComponentsBowerPath+"/appsettings"],updateAppSettings),define("userSettings",[embyWebComponentsBowerPath+"/usersettings/usersettings"],returnFirstDependency),define("userSettingsBuilder",[embyWebComponentsBowerPath+"/usersettings/usersettingsbuilder"],returnFirstDependency),define("material-icons",["css!"+embyWebComponentsBowerPath+"/fonts/material-icons/style"]),define("robotoFont",["css!"+embyWebComponentsBowerPath+"/fonts/roboto/style"]),define("scrollStyles",["css!"+embyWebComponentsBowerPath+"/scrollstyles"]),define("navdrawer",["components/navdrawer/navdrawer"],returnFirstDependency),define("viewcontainer",["components/viewcontainer-lite","css!"+embyWebComponentsBowerPath+"/viewmanager/viewcontainer-lite"],returnFirstDependency),define("queryString",[bowerPath+"/query-string/index"],function(){return queryString}),define("jQuery",[bowerPath+"/jquery/dist/jquery.slim.min"],function(){return window.ApiClient&&(jQuery.ajax=ApiClient.ajax),jQuery}),define("fnchecked",["legacy/fnchecked"]),define("dialogHelper",[embyWebComponentsBowerPath+"/dialoghelper/dialoghelper"],function(dialoghelper){return dialoghelper.setOnOpen(onDialogOpen),dialoghelper}),define("inputmanager",["inputManager"],returnFirstDependency),define("historyManager",["embyRouter"],returnFirstDependency),define("headroom-window",["headroom"],createWindowHeadroom),define("hammer-main",["hammer"],createMainContentHammer),define("appfooter-shared",["appfooter"],createSharedAppFooter),define("skinManager",[],function(){return{loadUserSkin:function(){Emby.Page.show("/home.html")}}}),define("connectionManager",[],function(){return ConnectionManager}),define("apiClientResolver",[],function(){return function(){return window.ApiClient}}),define("embyRouter",[embyWebComponentsBowerPath+"/router"],function(embyRouter){function showItem(item,serverId,options){if("string"==typeof item)require(["connectionManager"],function(connectionManager){var apiClient=connectionManager.currentApiClient();apiClient.getItem(apiClient.getCurrentUserId(),item).then(function(item){embyRouter.showItem(item,options)})});else{2==arguments.length&&(options=arguments[1]);var context=options?options.context:null;Emby.Page.show("/"+LibraryBrowser.getHref(item,context),{item:item})}}return embyRouter.showLocalLogin=function(apiClient,serverId,manualLogin){Dashboard.navigate("login.html?serverid="+serverId)},embyRouter.showVideoOsd=function(){return Dashboard.navigate("videoosd.html")},embyRouter.showSelectServer=function(){Dashboard.navigate("selectserver.html")},embyRouter.showWelcome=function(){Dashboard.isConnectMode()?Dashboard.navigate("connectlogin.html?mode=welcome"):Dashboard.navigate("login.html")},embyRouter.showSettings=function(){Dashboard.navigate("mypreferencesmenu.html")},embyRouter.showGuide=function(){Dashboard.navigate("livetv.html?tab=1"); -},embyRouter.goHome=function(){Dashboard.navigate("home.html")},embyRouter.showSearch=function(){Dashboard.navigate("search.html")},embyRouter.showLiveTV=function(){Dashboard.navigate("livetv.html")},embyRouter.showRecordedTV=function(){Dashboard.navigate("livetv.html?tab=3")},embyRouter.showFavorites=function(){Dashboard.navigate("favorites.html")},embyRouter.showSettings=function(){Dashboard.navigate("mypreferencesmenu.html")},embyRouter.setTitle=function(){},embyRouter.showItem=showItem,embyRouter})}function updateAppSettings(appSettings){return appSettings.enableExternalPlayers=function(val){return null!=val&&appSettings.set("externalplayers",val.toString()),"true"===appSettings.get("externalplayers")},appSettings}function onDialogOpen(dlg){dlg.classList.contains("background-theme-a")||dlg.classList.contains("actionSheet")||(dlg.classList.add("background-theme-b"),dlg.classList.add("ui-body-b"))}function initRequireWithBrowser(browser){var bowerPath=getBowerPath(),apiClientBowerPath=bowerPath+"/emby-apiclient",embyWebComponentsBowerPath=bowerPath+"/emby-webcomponents";Dashboard.isRunningInCordova()&&browser.safari?define("actionsheet",["cordova/actionsheet"],returnFirstDependency):define("actionsheet",["webActionSheet"],returnFirstDependency),"registerElement"in document?define("registerElement",[]):browser.msie?define("registerElement",[bowerPath+"/webcomponentsjs/webcomponents-lite.min.js"]):define("registerElement",[bowerPath+"/document-register-element/build/document-register-element"]),window.chrome&&window.chrome.sockets?define("serverdiscovery",[apiClientBowerPath+"/serverdiscovery-chrome"],returnFirstDependency):Dashboard.isRunningInCordova()&&browser.android?define("serverdiscovery",["cordova/serverdiscovery"],returnFirstDependency):Dashboard.isRunningInCordova()&&browser.safari?define("serverdiscovery",[apiClientBowerPath+"/serverdiscovery-chrome"],returnFirstDependency):define("serverdiscovery",[apiClientBowerPath+"/serverdiscovery"],returnFirstDependency),Dashboard.isRunningInCordova()&&browser.safari?define("imageFetcher",["cordova/imagestore"],returnFirstDependency):define("imageFetcher",[embyWebComponentsBowerPath+"/images/basicimagefetcher"],returnFirstDependency);var preferNativeAlerts=browser.tv;preferNativeAlerts&&window.alert?define("alert",[embyWebComponentsBowerPath+"/alert/nativealert"],returnFirstDependency):define("alert",[embyWebComponentsBowerPath+"/alert/alert"],returnFirstDependency),define("dialog",[embyWebComponentsBowerPath+"/dialog/dialog"],returnFirstDependency),preferNativeAlerts&&window.confirm?define("confirm",[embyWebComponentsBowerPath+"/confirm/nativeconfirm"],returnFirstDependency):define("confirm",[embyWebComponentsBowerPath+"/confirm/confirm"],returnFirstDependency);var preferNativePrompt=preferNativeAlerts||browser.xboxOne;preferNativePrompt&&window.confirm?define("prompt",[embyWebComponentsBowerPath+"/prompt/nativeprompt"],returnFirstDependency):define("prompt",[embyWebComponentsBowerPath+"/prompt/prompt"],returnFirstDependency),browser.tizen||browser.operaTv?define("loading",[embyWebComponentsBowerPath+"/loading/loading-legacy"],returnFirstDependency):define("loading",[embyWebComponentsBowerPath+"/loading/loading-lite"],returnFirstDependency),define("multi-download",[embyWebComponentsBowerPath+"/multidownload"],returnFirstDependency),Dashboard.isRunningInCordova()&&browser.android?(define("fileDownloader",["cordova/filedownloader"],returnFirstDependency),define("localassetmanager",["cordova/localassetmanager"],returnFirstDependency)):(define("fileDownloader",[embyWebComponentsBowerPath+"/filedownloader"],returnFirstDependency),define("localassetmanager",[apiClientBowerPath+"/localassetmanager"],returnFirstDependency)),define("screenLock",[embyWebComponentsBowerPath+"/resourcelocks/nullresourcelock"],returnFirstDependency),Dashboard.isRunningInCordova()&&browser.android?(define("resourceLockManager",[embyWebComponentsBowerPath+"/resourcelocks/resourcelockmanager"],returnFirstDependency),define("wakeLock",["cordova/wakelock"],returnFirstDependency),define("networkLock",["cordova/networklock"],returnFirstDependency)):(define("resourceLockManager",[embyWebComponentsBowerPath+"/resourcelocks/resourcelockmanager"],returnFirstDependency),define("wakeLock",[embyWebComponentsBowerPath+"/resourcelocks/nullresourcelock"],returnFirstDependency),define("networkLock",[embyWebComponentsBowerPath+"/resourcelocks/nullresourcelock"],returnFirstDependency))}function init(){Dashboard.isRunningInCordova()&&browserInfo.android&&define("nativedirectorychooser",["cordova/nativedirectorychooser"]),Dashboard.isRunningInCordova()&&browserInfo.android?define("localsync",["cordova/localsync"],returnFirstDependency):define("localsync",["scripts/localsync"],returnFirstDependency),define("livetvcss",["css!css/livetv.css"]),define("detailtablecss",["css!css/detailtable.css"]),define("autoorganizetablecss",["css!css/autoorganizetable.css"]),define("buttonenabled",["legacy/buttonenabled"]),initAfterDependencies()}function getRequirePromise(deps){return new Promise(function(resolve,reject){require(deps,resolve)})}function initAfterDependencies(){var list=[];window.fetch||list.push("fetch"),"function"!=typeof Object.assign&&list.push("objectassign"),Array.prototype.filter||list.push("arraypolyfills"),Function.prototype.bind||list.push("functionbind"),window.requestAnimationFrame||list.push("raf"),require(list,function(){createConnectionManager().then(function(){console.log("initAfterDependencies promises resolved"),require(["globalize"],function(globalize){window.Globalize=globalize,Promise.all([loadCoreDictionary(globalize),loadSharedComponentsDictionary(globalize)]).then(onGlobalizeInit)})})})}function loadSharedComponentsDictionary(globalize){var baseUrl="bower_components/emby-webcomponents/strings/",languages=["ar","bg-bg","ca","cs","da","de","el","en-gb","en-us","es-ar","es-mx","es","fi","fr","gsw","he","hr","hu","id","it","kk","ko","ms","nb","nl","pl","pt-br","pt-pt","ro","ru","sk","sl-si","sv","tr","uk","vi","zh-cn","zh-hk","zh-tw"],translations=languages.map(function(i){return{lang:i,path:baseUrl+i+".json"}});globalize.loadStrings({name:"sharedcomponents",translations:translations})}function loadCoreDictionary(globalize){var baseUrl="strings/",languages=["ar","bg-bg","ca","cs","da","de","el","en-gb","en-us","es-ar","es-mx","es","fi","fr","gsw","he","hr","hu","id","it","kk","ko","ms","nb","nl","pl","pt-br","pt-pt","ro","ru","sl-si","sv","tr","uk","vi","zh-cn","zh-hk","zh-tw"],translations=languages.map(function(i){return{lang:i,path:baseUrl+i+".json"}});return globalize.defaultModule("core"),globalize.loadStrings({name:"core",translations:translations})}function onGlobalizeInit(){document.title=Globalize.translateDocument(document.title,"core"),require(["apphost"],function(appHost){loadPlugins([],appHost,browserInfo).then(onAppReady)})}function defineRoute(newRoute,dictionary){var baseRoute=Emby.Page.baseUrl(),path=newRoute.path;path=path.replace(baseRoute,""),console.log("Defining route: "+path),newRoute.dictionary=newRoute.dictionary||dictionary||"core",Emby.Page.addRoute(path,newRoute)}function defineCoreRoutes(){console.log("Defining core routes"),defineRoute({path:"/addplugin.html",dependencies:[],autoFocus:!1,roles:"admin",controller:"scripts/addpluginpage"}),defineRoute({path:"/appservices.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/autoorganizelog.html",dependencies:["scripts/taskbutton","autoorganizetablecss"],controller:"dashboard/autoorganizelog",roles:"admin"}),defineRoute({path:"/autoorganizesmart.html",dependencies:["emby-button"],controller:"dashboard/autoorganizesmart",autoFocus:!1,roles:"admin"}),defineRoute({path:"/autoorganizetv.html",dependencies:["emby-checkbox","emby-input","emby-button","emby-select","emby-collapse"],controller:"dashboard/autoorganizetv",autoFocus:!1,roles:"admin"}),defineRoute({path:"/channelitems.html",dependencies:[],autoFocus:!1,transition:"fade"}),defineRoute({path:"/channels.html",dependencies:[],autoFocus:!1,transition:"fade",controller:"scripts/channels"}),defineRoute({path:"/channelsettings.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/cinemamodeconfiguration.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/connectlogin.html",dependencies:["emby-button","emby-input"],autoFocus:!1,anonymous:!0,startup:!0,controller:"scripts/connectlogin"}),defineRoute({path:"/dashboard.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/dashboardgeneral.html",controller:"dashboard/dashboardgeneral",autoFocus:!1,roles:"admin"}),defineRoute({path:"/dashboardhosting.html",dependencies:["emby-input","emby-button"],autoFocus:!1,roles:"admin",controller:"dashboard/dashboardhosting"}),defineRoute({path:"/device.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/devices.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/devicesupload.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/dlnaprofile.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/dlnaprofiles.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/dlnaserversettings.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/dlnasettings.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/edititemmetadata.html",dependencies:[],controller:"scripts/edititemmetadata",autoFocus:!1}),defineRoute({path:"/encodingsettings.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/favorites.html",dependencies:[],autoFocus:!1,controller:"scripts/favorites"}),defineRoute({path:"/forgotpassword.html",dependencies:["emby-input","emby-button"],anonymous:!0,startup:!0,controller:"scripts/forgotpassword"}),defineRoute({path:"/forgotpasswordpin.html",dependencies:["emby-input","emby-button"],autoFocus:!1,anonymous:!0,startup:!0,controller:"scripts/forgotpasswordpin"}),defineRoute({path:"/gamegenres.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/games.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/gamesrecommended.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/gamestudios.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/gamesystems.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/home.html",dependencies:[],autoFocus:!1,controller:"scripts/indexpage",transition:"fade",type:"home"}),defineRoute({path:"/index.html",dependencies:[],autoFocus:!1,isDefaultRoute:!0}),defineRoute({path:"/itemdetails.html",dependencies:["emby-button","scripts/livetvcomponents","paper-icon-button-light","emby-itemscontainer"],controller:"scripts/itemdetailpage",autoFocus:!1,transition:"fade"}),defineRoute({path:"/itemlist.html",dependencies:[],autoFocus:!1,controller:"scripts/itemlistpage",transition:"fade"}),defineRoute({path:"/kids.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/library.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/librarydisplay.html",dependencies:[],autoFocus:!1,roles:"admin",controller:"dashboard/librarydisplay"}),defineRoute({path:"/librarysettings.html",dependencies:["emby-collapse","emby-input","emby-button","emby-select"],autoFocus:!1,roles:"admin",controller:"dashboard/librarysettings"}),defineRoute({path:"/livetv.html",dependencies:["emby-button","livetvcss"],controller:"scripts/livetvsuggested",autoFocus:!1,transition:"fade"}),defineRoute({path:"/livetvguideprovider.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/livetvitems.html",dependencies:[],autoFocus:!1,controller:"scripts/livetvitems"}),defineRoute({path:"/livetvseriestimer.html",dependencies:["emby-checkbox","emby-input","emby-button","emby-collapse","scripts/livetvcomponents","scripts/livetvseriestimer","livetvcss"],autoFocus:!1,controller:"scripts/livetvseriestimer"}),defineRoute({path:"/livetvsettings.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/livetvstatus.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/livetvtunerprovider-hdhomerun.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/livetvtunerprovider-m3u.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/livetvtunerprovider-satip.html",dependencies:["emby-input"],autoFocus:!1,roles:"admin",controller:"dashboard/livetvtunerprovider-satip"}),defineRoute({path:"/log.html",dependencies:["emby-checkbox"],roles:"admin",controller:"dashboard/logpage"}),defineRoute({path:"/login.html",dependencies:["emby-button","emby-input"],autoFocus:!1,anonymous:!0,startup:!0,controller:"scripts/loginpage"}),defineRoute({path:"/metadataadvanced.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/metadataimages.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/metadatanfo.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/metadatasubtitles.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/movies.html",dependencies:["emby-button"],autoFocus:!1,controller:"scripts/moviesrecommended",transition:"fade"}),defineRoute({path:"/music.html",dependencies:[],controller:"scripts/musicrecommended",autoFocus:!1,transition:"fade"}),defineRoute({path:"/mypreferencesdisplay.html",dependencies:["emby-checkbox","emby-button","emby-select"],autoFocus:!1,transition:"fade",controller:"scripts/mypreferencesdisplay"}),defineRoute({path:"/mypreferenceshome.html",dependencies:["emby-checkbox","emby-button","emby-select"],autoFocus:!1,transition:"fade",controller:"scripts/mypreferenceshome"}),defineRoute({path:"/mypreferenceslanguages.html",dependencies:["emby-button","emby-checkbox","emby-select"],autoFocus:!1,transition:"fade",controller:"scripts/mypreferenceslanguages"}),defineRoute({path:"/mypreferencesmenu.html",dependencies:["emby-button"],autoFocus:!1,transition:"fade",controller:"scripts/mypreferencescommon"}),defineRoute({path:"/myprofile.html",dependencies:["emby-button","emby-collapse","emby-checkbox","emby-input"],autoFocus:!1,transition:"fade",controller:"scripts/myprofile"}),defineRoute({path:"/mysync.html",dependencies:[],autoFocus:!1,transition:"fade",controller:"scripts/mysync"}),defineRoute({path:"/camerauploadsettings.html",dependencies:[],autoFocus:!1,transition:"fade",controller:"scripts/camerauploadsettings"}),defineRoute({path:"/mysyncjob.html",dependencies:[],autoFocus:!1,transition:"fade",controller:"scripts/syncjob"}),defineRoute({path:"/mysyncsettings.html",dependencies:["emby-checkbox","emby-input","emby-button","paper-icon-button-light"],autoFocus:!1,transition:"fade",controller:"scripts/mysyncsettings"}),defineRoute({path:"/notificationlist.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/notificationsetting.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/notificationsettings.html",controller:"scripts/notificationsettings",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/nowplaying.html",dependencies:["paper-icon-button-light","emby-slider","emby-button","emby-input","emby-itemscontainer"],controller:"scripts/nowplayingpage",autoFocus:!1,transition:"fade",fullscreen:!0,supportsThemeMedia:!0}),defineRoute({path:"/photos.html",dependencies:[],autoFocus:!1,transition:"fade"}),defineRoute({path:"/playbackconfiguration.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/playlists.html",dependencies:[],autoFocus:!1,transition:"fade",controller:"scripts/playlists"}),defineRoute({path:"/plugincatalog.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/plugins.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/reports.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/scheduledtask.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/scheduledtasks.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/search.html",dependencies:[],controller:"scripts/searchpage"}),defineRoute({path:"/secondaryitems.html",dependencies:[],autoFocus:!1,controller:"scripts/secondaryitems"}),defineRoute({path:"/selectserver.html",dependencies:["listViewStyle","emby-button"],autoFocus:!1,anonymous:!0,startup:!0,controller:"scripts/selectserver"}),defineRoute({path:"/serversecurity.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/shared.html",dependencies:[],autoFocus:!1,anonymous:!0}),defineRoute({path:"/streamingsettings.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/support.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/supporterkey.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/syncactivity.html",dependencies:[],autoFocus:!1,controller:"scripts/syncactivity"}),defineRoute({path:"/syncsettings.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/tv.html",dependencies:["paper-icon-button-light","emby-button"],autoFocus:!1,controller:"scripts/tvrecommended",transition:"fade"}),defineRoute({path:"/useredit.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/userlibraryaccess.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/usernew.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/userparentalcontrol.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/userpassword.html",dependencies:["emby-input","emby-button","emby-checkbox"],autoFocus:!1,controller:"scripts/userpasswordpage"}),defineRoute({path:"/userprofiles.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/wizardagreement.html",dependencies:["dashboardcss"],autoFocus:!1,anonymous:!0}),defineRoute({path:"/wizardcomponents.html",dependencies:["dashboardcss","emby-button","emby-input","emby-select"],autoFocus:!1,anonymous:!0,controller:"dashboard/wizardcomponents"}),defineRoute({path:"/wizardfinish.html",dependencies:["emby-button","dashboardcss"],autoFocus:!1,anonymous:!0,controller:"dashboard/wizardfinishpage"}),defineRoute({path:"/wizardlibrary.html",dependencies:["dashboardcss"],autoFocus:!1,anonymous:!0}),defineRoute({path:"/wizardlivetvguide.html",dependencies:["dashboardcss"],autoFocus:!1,anonymous:!0}),defineRoute({path:"/wizardlivetvtuner.html",dependencies:["dashboardcss"],autoFocus:!1,anonymous:!0}),defineRoute({path:"/wizardsettings.html",dependencies:["dashboardcss"],autoFocus:!1,anonymous:!0}),defineRoute({path:"/wizardstart.html",dependencies:["dashboardcss"],autoFocus:!1,anonymous:!0}),defineRoute({path:"/wizarduser.html",dependencies:["dashboardcss","emby-input"],autoFocus:!1,anonymous:!0}),defineRoute({path:"/videoosd.html",dependencies:[],transition:"fade",controller:"scripts/videoosd",autoFocus:!1,type:"video-osd",supportsThemeMedia:!0,fullscreen:!0}),defineRoute({path:"/configurationpage",dependencies:["jQuery"],autoFocus:!1,enableCache:!1,enableContentQueryString:!0,roles:"admin"}),defineRoute({path:"/",isDefaultRoute:!0,autoFocus:!1,dependencies:[]})}function loadPlugins(externalPlugins,appHost,browser,shell){console.log("Loading installed plugins");var list=["bower_components/emby-webcomponents/playback/playbackvalidation"];Dashboard.isRunningInCordova()&&browser.android?(document.createElement("audio").canPlayType("audio/flac").replace(/no/,"")&&document.createElement("audio").canPlayType('audio/ogg; codecs="opus"').replace(/no/,"")||(window.VlcAudio=!0),list.push("cordova/vlcplayer")):Dashboard.isRunningInCordova()&&browser.safari&&list.push("cordova/audioplayer"),list.push("bower_components/emby-webcomponents/htmlaudioplayer/plugin"),Dashboard.isRunningInCordova()&&browser.safari&&list.push("cordova/chromecast"),Dashboard.isRunningInCordova()&&browser.android&&list.push("cordova/externalplayer"),list.push("bower_components/emby-webcomponents/htmlvideoplayer/plugin"),appHost.supports("remotecontrol")&&(list.push("bower_components/emby-webcomponents/sessionplayer"),browser.chrome&&list.push("bower_components/emby-webcomponents/chromecastplayer")),list.push("bower_components/emby-webcomponents/youtubeplayer/plugin");for(var i=0,length=externalPlugins.length;i",menuHtml+='',menuHtml+=item.name,menuHtml+="",menuHtml+=""},getToolsMenuHtml:function(page){var i,length,item,items=Dashboard.getToolsMenuLinks(page),menuHtml="";for(menuHtml+='
',i=0,length=items.length;i
"),item.href?menuHtml+=Dashboard.getToolsLinkHtml(item):(menuHtml+='
',menuHtml+=item.name,menuHtml+="
");return menuHtml+=""},getToolsMenuLinks:function(){return[{name:Globalize.translate("TabServer")},{name:Globalize.translate("TabDashboard"),href:"dashboard.html",pageIds:["dashboardPage"],icon:"dashboard"},{name:Globalize.translate("TabSettings"),href:"dashboardgeneral.html",pageIds:["dashboardGeneralPage"],icon:"settings"},{name:Globalize.translate("TabDevices"),href:"devices.html",pageIds:["devicesPage","devicePage","devicesUploadPage"],icon:"tablet"},{name:Globalize.translate("TabUsers"),href:"userprofiles.html",pageIds:["userProfilesPage","newUserPage","editUserPage","userLibraryAccessPage","userParentalControlPage","userPasswordPage"],icon:"people"},{name:"Emby Premiere",href:"supporterkey.html",pageIds:["supporterKeyPage"],icon:"star"},{divider:!0,name:Globalize.translate("TabLibrary"),href:"library.html",pageIds:["mediaLibraryPage","librarySettingsPage","libraryDisplayPage","metadataImagesConfigurationPage","metadataNfoPage"],icon:"folder",color:"#38c"},{name:Globalize.translate("TabSubtitles"),href:"metadatasubtitles.html",pageIds:["metadataSubtitlesPage"],icon:"closed_caption"},{name:Globalize.translate("TabPlayback"),icon:"play_circle_filled",color:"#E5342E",href:"cinemamodeconfiguration.html",pageIds:["cinemaModeConfigurationPage","playbackConfigurationPage","streamingSettingsPage"]},{name:Globalize.translate("TabSync"),icon:"sync",href:"syncactivity.html",pageIds:["syncActivityPage","syncJobPage","syncSettingsPage"],color:"#009688"},{name:Globalize.translate("TabTranscoding"),icon:"transform",href:"encodingsettings.html",pageIds:["encodingSettingsPage"]},{divider:!0,name:Globalize.translate("TabExtras")},{name:Globalize.translate("TabAutoOrganize"),color:"#01C0DD",href:"autoorganizelog.html",pageIds:["libraryFileOrganizerPage","libraryFileOrganizerSmartMatchPage","libraryFileOrganizerLogPage"],icon:"folder"},{name:Globalize.translate("DLNA"),href:"dlnasettings.html",pageIds:["dlnaSettingsPage","dlnaProfilesPage","dlnaProfilePage"],icon:"settings"},{name:Globalize.translate("TabLiveTV"),href:"livetvstatus.html",pageIds:["liveTvStatusPage","liveTvSettingsPage","liveTvTunerProviderHdHomerunPage","liveTvTunerProviderM3UPage","liveTvTunerProviderSatPage"],icon:"dvr"},{name:Globalize.translate("TabNotifications"),icon:"notifications",color:"brown",href:"notificationsettings.html",pageIds:["notificationSettingsPage","notificationSettingPage"]},{name:Globalize.translate("TabPlugins"),icon:"add_shopping_cart",color:"#9D22B1",href:"plugins.html",pageIds:["pluginsPage","pluginCatalogPage"]},{divider:!0,name:Globalize.translate("TabExpert")},{name:Globalize.translate("TabAdvanced"),icon:"settings",href:"dashboardhosting.html",color:"#F16834",pageIds:["dashboardHostingPage","serverSecurityPage"]},{name:Globalize.translate("TabLogs"),href:"log.html",pageIds:["logPage"],icon:"folder_open"},{name:Globalize.translate("TabScheduledTasks"),href:"scheduledtasks.html",pageIds:["scheduledTasksPage","scheduledTaskPage"],icon:"schedule"},{name:Globalize.translate("MetadataManager"),href:"edititemmetadata.html",pageIds:[],icon:"mode_edit"},{name:Globalize.translate("ButtonReports"),href:"reports.html",pageIds:[],icon:"insert_chart"}]},getSupportedRemoteCommands:function(){return["GoHome","GoToSettings","VolumeUp","VolumeDown","Mute","Unmute","ToggleMute","SetVolume","SetAudioStreamIndex","SetSubtitleStreamIndex","DisplayContent","GoToSearch","DisplayMessage","SetRepeatMode"]},capabilities:function(){var caps={PlayableMediaTypes:["Audio","Video"],SupportedCommands:Dashboard.getSupportedRemoteCommands(),SupportsPersistentIdentifier:Dashboard.isRunningInCordova(),SupportsMediaControl:!0,SupportedLiveMediaTypes:["Audio","Video"]};return Dashboard.isRunningInCordova()&&!browserInfo.safari&&(caps.SupportsSync=!0,caps.SupportsContentUploading=!0),caps},normalizeImageOptions:function(options){var setQuality;if(options.maxWidth&&(setQuality=!0),options.width&&(setQuality=!0),options.maxHeight&&(setQuality=!0),options.height&&(setQuality=!0),setQuality){var quality=90,isBackdrop="backdrop"==(options.type||"").toLowerCase();isBackdrop&&(quality-=10),browserInfo.slow&&(quality-=40),AppInfo.hasLowImageBandwidth&&!isBackdrop&&(quality-=10),options.quality=quality}}},AppInfo={};!function(){"use strict";function setAppInfo(){var isCordova=Dashboard.isRunningInCordova();AppInfo.enableHomeTabs=!0,AppInfo.enableAutoSave=browserInfo.touch,AppInfo.enableAppStorePolicy=isCordova,browserInfo.iOS&&(AppInfo.hasLowImageBandwidth=!0),isCordova?(AppInfo.isNativeApp=!0,AppInfo.enableHomeTabs=!1,browserInfo.android&&(AppInfo.supportsExternalPlayers=!0)):AppInfo.enableSupporterMembership=!0,AppInfo.supportsFileInput=!(AppInfo.isNativeApp&&browserInfo.android),AppInfo.supportsUserDisplayLanguageSetting=Dashboard.isConnectMode()}function initializeApiClient(apiClient){AppInfo.enableAppStorePolicy&&(apiClient.getAvailablePlugins=function(){return Promise.resolve([])},apiClient.getInstalledPlugins=function(){return Promise.resolve([])}),apiClient.normalizeImageOptions=Dashboard.normalizeImageOptions,Events.off(apiClient,"requestfail",Dashboard.onRequestFail),Events.on(apiClient,"requestfail",Dashboard.onRequestFail)}function onApiClientCreated(e,newApiClient){initializeApiClient(newApiClient),window.$&&($.ajax=newApiClient.ajax)}function defineConnectionManager(connectionManager){window.ConnectionManager=connectionManager,define("connectionManager",[],function(){return connectionManager})}function bindConnectionManagerEvents(connectionManager,events,userSettings){window.Events=events,events.on(ConnectionManager,"apiclientcreated",onApiClientCreated),connectionManager.currentApiClient=function(){if(!localApiClient){var server=connectionManager.getLastUsedServer();server&&(localApiClient=connectionManager.getApiClient(server.Id))}return localApiClient},connectionManager.onLocalUserSignedIn=function(user){return localApiClient=connectionManager.getApiClient(user.ServerId),window.ApiClient=localApiClient,userSettings.setUserInfo(user.Id,localApiClient)},events.on(connectionManager,"localusersignedout",function(){userSettings.setUserInfo(null,null)})}function createConnectionManager(){return new Promise(function(resolve,reject){require(["connectionManagerFactory","apphost","credentialprovider","events","userSettings"],function(connectionManagerExports,apphost,credentialProvider,events,userSettings){window.MediaBrowser=Object.assign(window.MediaBrowser||{},connectionManagerExports);var credentialProviderInstance=new credentialProvider,promises=[apphost.getSyncProfile(),apphost.appInfo()];Promise.all(promises).then(function(responses){var deviceProfile=responses[0],appInfo=responses[1],capabilities=Dashboard.capabilities();capabilities.DeviceProfile=deviceProfile;var connectionManager=new MediaBrowser.ConnectionManager(credentialProviderInstance,appInfo.appName,appInfo.appVersion,appInfo.deviceName,appInfo.deviceId,capabilities,window.devicePixelRatio);return defineConnectionManager(connectionManager),bindConnectionManagerEvents(connectionManager,events,userSettings),Dashboard.isConnectMode()?void resolve():(console.log("loading ApiClient singleton"),getRequirePromise(["apiclient"]).then(function(apiClientFactory){console.log("creating ApiClient singleton");var apiClient=new apiClientFactory(Dashboard.serverAddress(),appInfo.appName,appInfo.appVersion,appInfo.deviceName,appInfo.deviceId,window.devicePixelRatio);apiClient.enableAutomaticNetworking=!1,connectionManager.addApiClient(apiClient),require(["css!"+apiClient.getUrl("Branding/Css")]),window.ApiClient=apiClient,localApiClient=apiClient,console.log("loaded ApiClient singleton"),resolve()}))})})})}function setDocumentClasses(browser){var elem=document.documentElement;AppInfo.enableSupporterMembership||elem.classList.add("supporterMembershipDisabled")}function loadTheme(){var name=getParameterByName("theme");if(name)return void require(["themes/"+name+"/theme"]);if(!AppInfo.isNativeApp){var date=new Date,month=date.getMonth(),day=date.getDate();return 9==month&&day>=30?void require(["themes/halloween/theme"]):void 0}}function returnFirstDependency(obj){return obj}function getBowerPath(){return"bower_components"}function getLayoutManager(layoutManager){return layoutManager.init(),layoutManager}function getAppStorage(basePath){try{return localStorage.setItem("_test","0"),localStorage.removeItem("_test"),basePath+"/appstorage-localstorage"}catch(e){return basePath+"/appstorage-memory"}}function createWindowHeadroom(){var headroom=new Headroom([],{tolerance:{down:0,up:0},classes:{}});return headroom.init(),headroom}function getCastSenderApiLoader(){var ccLoaded=!1;return{load:function(){return ccLoaded?Promise.resolve():new Promise(function(resolve,reject){var fileref=document.createElement("script");fileref.setAttribute("type","text/javascript"),fileref.onload=function(){ccLoaded=!0,resolve()},fileref.setAttribute("src","https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"),document.querySelector("head").appendChild(fileref)})}}}function getDummyCastSenderApiLoader(){return{load:function(){return window.chrome=window.chrome||{},Promise.resolve()}}}function createMainContentHammer(Hammer){var hammer=new Hammer(document.querySelector(".skinBody"),null);return hammer}function createSharedAppFooter(appFooter){var footer=new appFooter({});return footer}function initRequire(){var urlArgs="v="+(window.dashboardVersion||(new Date).getDate()),bowerPath=getBowerPath(),apiClientBowerPath=bowerPath+"/emby-apiclient",embyWebComponentsBowerPath=bowerPath+"/emby-webcomponents",paths={velocity:bowerPath+"/velocity/velocity.min",vibrant:bowerPath+"/vibrant/dist/vibrant",ironCardList:"components/ironcardlist/ironcardlist",scrollThreshold:"components/scrollthreshold",playlisteditor:"components/playlisteditor/playlisteditor",medialibrarycreator:"components/medialibrarycreator/medialibrarycreator",medialibraryeditor:"components/medialibraryeditor/medialibraryeditor",howler:bowerPath+"/howlerjs/howler.min",sortable:bowerPath+"/Sortable/Sortable.min",isMobile:bowerPath+"/isMobile/isMobile.min",headroom:bowerPath+"/headroomjs/dist/headroom",masonry:bowerPath+"/masonry/dist/masonry.pkgd.min",humanedate:"components/humanedate",libraryBrowser:"scripts/librarybrowser",chromecasthelpers:"components/chromecasthelpers",events:apiClientBowerPath+"/events",credentialprovider:apiClientBowerPath+"/credentials",apiclient:apiClientBowerPath+"/apiclient",connectionManagerFactory:bowerPath+"/emby-apiclient/connectionmanager",visibleinviewport:embyWebComponentsBowerPath+"/visibleinviewport",browserdeviceprofile:embyWebComponentsBowerPath+"/browserdeviceprofile",browser:embyWebComponentsBowerPath+"/browser",inputManager:embyWebComponentsBowerPath+"/inputmanager",qualityoptions:embyWebComponentsBowerPath+"/qualityoptions",hammer:bowerPath+"/hammerjs/hammer.min",pageJs:embyWebComponentsBowerPath+"/pagejs/page",focusManager:embyWebComponentsBowerPath+"/focusmanager",datetime:embyWebComponentsBowerPath+"/datetime",globalize:embyWebComponentsBowerPath+"/globalize",itemHelper:embyWebComponentsBowerPath+"/itemhelper",itemShortcuts:embyWebComponentsBowerPath+"/shortcuts",serverNotifications:embyWebComponentsBowerPath+"/servernotifications",playbackManager:embyWebComponentsBowerPath+"/playback/playbackmanager",autoPlayDetect:embyWebComponentsBowerPath+"/playback/autoplaydetect",nowPlayingHelper:embyWebComponentsBowerPath+"/playback/nowplayinghelper",pluginManager:embyWebComponentsBowerPath+"/pluginmanager",packageManager:embyWebComponentsBowerPath+"/packagemanager",webAnimations:bowerPath+"/web-animations-js/web-animations-next-lite.min"};paths.hlsjs=bowerPath+"/hlsjs/dist/hls.min",define("webActionSheet",[embyWebComponentsBowerPath+"/actionsheet/actionsheet"],returnFirstDependency),Dashboard.isRunningInCordova()?paths.sharingMenu="cordova/sharingwidget":define("sharingMenu",[embyWebComponentsBowerPath+"/sharing/sharingmenu"],returnFirstDependency),paths.wakeonlan=apiClientBowerPath+"/wakeonlan",define("libjass",[bowerPath+"/libjass/libjass.min","css!"+bowerPath+"/libjass/libjass"],returnFirstDependency),window.IntersectionObserver?define("lazyLoader",[embyWebComponentsBowerPath+"/lazyloader/lazyloader-intersectionobserver"],returnFirstDependency):define("lazyLoader",[embyWebComponentsBowerPath+"/lazyloader/lazyloader-scroll"],returnFirstDependency),define("imageLoader",[embyWebComponentsBowerPath+"/images/imagehelper"],returnFirstDependency),define("appfooter",["components/appfooter/appfooter"],returnFirstDependency),define("dockedtabs",["components/dockedtabs/dockedtabs"],returnFirstDependency),define("directorybrowser",["components/directorybrowser/directorybrowser"],returnFirstDependency),define("metadataEditor",[embyWebComponentsBowerPath+"/metadataeditor/metadataeditor"],returnFirstDependency),define("personEditor",[embyWebComponentsBowerPath+"/metadataeditor/personeditor"],returnFirstDependency),define("playerSelectionMenu",[embyWebComponentsBowerPath+"/playback/playerselection"],returnFirstDependency),define("playerSettingsMenu",[embyWebComponentsBowerPath+"/playback/playersettingsmenu"],returnFirstDependency),define("libraryMenu",["scripts/librarymenu"],returnFirstDependency),define("emby-collapse",[embyWebComponentsBowerPath+"/emby-collapse/emby-collapse"],returnFirstDependency),define("emby-button",[embyWebComponentsBowerPath+"/emby-button/emby-button"],returnFirstDependency),define("emby-itemscontainer",[embyWebComponentsBowerPath+"/emby-itemscontainer/emby-itemscontainer"],returnFirstDependency),define("emby-tabs",[embyWebComponentsBowerPath+"/emby-tabs/emby-tabs"],returnFirstDependency),define("itemHoverMenu",[embyWebComponentsBowerPath+"/itemhovermenu/itemhovermenu"],returnFirstDependency),define("multiSelect",[embyWebComponentsBowerPath+"/multiselect/multiselect"],returnFirstDependency),define("alphaPicker",[embyWebComponentsBowerPath+"/alphapicker/alphapicker"],returnFirstDependency),define("paper-icon-button-light",[embyWebComponentsBowerPath+"/emby-button/paper-icon-button-light"]),define("connectHelper",[embyWebComponentsBowerPath+"/emby-connect/connecthelper"],returnFirstDependency),define("emby-input",[embyWebComponentsBowerPath+"/emby-input/emby-input"],returnFirstDependency),define("emby-select",[embyWebComponentsBowerPath+"/emby-select/emby-select"],returnFirstDependency),define("emby-slider",[embyWebComponentsBowerPath+"/emby-slider/emby-slider"],returnFirstDependency),define("emby-checkbox",[embyWebComponentsBowerPath+"/emby-checkbox/emby-checkbox"],returnFirstDependency),define("emby-toggle",[embyWebComponentsBowerPath+"/emby-toggle/emby-toggle"],returnFirstDependency),define("emby-radio",[embyWebComponentsBowerPath+"/emby-radio/emby-radio"],returnFirstDependency),define("emby-textarea",[embyWebComponentsBowerPath+"/emby-textarea/emby-textarea"],returnFirstDependency),define("collectionEditor",[embyWebComponentsBowerPath+"/collectioneditor/collectioneditor"],returnFirstDependency),define("playlistEditor",[embyWebComponentsBowerPath+"/playlisteditor/playlisteditor"],returnFirstDependency),define("recordingCreator",[embyWebComponentsBowerPath+"/recordingcreator/recordingcreator"],returnFirstDependency),define("recordingEditor",[embyWebComponentsBowerPath+"/recordingcreator/recordingeditor"],returnFirstDependency),define("seriesRecordingEditor",[embyWebComponentsBowerPath+"/recordingcreator/seriesrecordingeditor"],returnFirstDependency),define("recordingFields",[embyWebComponentsBowerPath+"/recordingcreator/recordingfields"],returnFirstDependency),define("recordingHelper",[embyWebComponentsBowerPath+"/recordingcreator/recordinghelper"],returnFirstDependency),define("subtitleEditor",[embyWebComponentsBowerPath+"/subtitleeditor/subtitleeditor"],returnFirstDependency),define("itemIdentifier",[embyWebComponentsBowerPath+"/itemidentifier/itemidentifier"],returnFirstDependency),define("mediaInfo",[embyWebComponentsBowerPath+"/mediainfo/mediainfo"],returnFirstDependency),define("itemContextMenu",[embyWebComponentsBowerPath+"/itemcontextmenu"],returnFirstDependency),define("imageEditor",[embyWebComponentsBowerPath+"/imageeditor/imageeditor"],returnFirstDependency),define("dom",[embyWebComponentsBowerPath+"/dom"],returnFirstDependency),define("fullscreen-doubleclick",[embyWebComponentsBowerPath+"/fullscreen/fullscreen-doubleclick"],returnFirstDependency),define("fullscreenManager",[embyWebComponentsBowerPath+"/fullscreen/fullscreenmanager","events"],returnFirstDependency),define("layoutManager",[embyWebComponentsBowerPath+"/layoutmanager"],getLayoutManager),define("playMenu",[embyWebComponentsBowerPath+"/playmenu"],returnFirstDependency),define("refreshDialog",[embyWebComponentsBowerPath+"/refreshdialog/refreshdialog"],returnFirstDependency),define("backdrop",[embyWebComponentsBowerPath+"/backdrop/backdrop"],returnFirstDependency),define("fetchHelper",[embyWebComponentsBowerPath+"/fetchhelper"],returnFirstDependency),define("roundCardStyle",["cardStyle","css!"+embyWebComponentsBowerPath+"/cardbuilder/roundcard"],returnFirstDependency),define("cardStyle",["css!"+embyWebComponentsBowerPath+"/cardbuilder/card"],returnFirstDependency),define("cardBuilder",[embyWebComponentsBowerPath+"/cardbuilder/cardbuilder"],returnFirstDependency),define("peoplecardbuilder",[embyWebComponentsBowerPath+"/cardbuilder/peoplecardbuilder"],returnFirstDependency),define("chaptercardbuilder",[embyWebComponentsBowerPath+"/cardbuilder/chaptercardbuilder"],returnFirstDependency),define("mouseManager",[embyWebComponentsBowerPath+"/input/mouse"],returnFirstDependency),define("deleteHelper",[embyWebComponentsBowerPath+"/deletehelper"],returnFirstDependency),define("tvguide",[embyWebComponentsBowerPath+"/guide/guide"],returnFirstDependency),define("programStyles",["css!"+embyWebComponentsBowerPath+"/guide/programs"],returnFirstDependency),define("guide-settings-dialog",[embyWebComponentsBowerPath+"/guide/guide-settings"],returnFirstDependency),define("syncDialog",[embyWebComponentsBowerPath+"/sync/sync"],returnFirstDependency),define("syncToggle",[embyWebComponentsBowerPath+"/sync/synctoggle"],returnFirstDependency),define("syncJobEditor",[embyWebComponentsBowerPath+"/sync/syncjobeditor"],returnFirstDependency),define("syncJobList",[embyWebComponentsBowerPath+"/sync/syncjoblist"],returnFirstDependency),define("voiceDialog",[embyWebComponentsBowerPath+"/voice/voicedialog"],returnFirstDependency),define("voiceReceiver",[embyWebComponentsBowerPath+"/voice/voicereceiver"],returnFirstDependency),define("voiceProcessor",[embyWebComponentsBowerPath+"/voice/voiceprocessor"],returnFirstDependency),define("viewManager",[embyWebComponentsBowerPath+"/viewmanager/viewmanager"],function(viewManager){return window.ViewManager=viewManager,viewManager.dispatchPageEvents(!0),viewManager}),Dashboard.isRunningInCordova()&&window.MainActivity?define("shell",["cordova/shell"],returnFirstDependency):define("shell",[embyWebComponentsBowerPath+"/shell"],returnFirstDependency),define("sharingmanager",[embyWebComponentsBowerPath+"/sharing/sharingmanager"],returnFirstDependency),Dashboard.isRunningInCordova()?paths.apphost="cordova/apphost":paths.apphost="components/apphost",Dashboard.isRunningInCordova()&&window.MainActivity?(paths.appStorage="cordova/appstorage",paths.filesystem="cordova/filesystem"):(paths.appStorage=getAppStorage(apiClientBowerPath),paths.filesystem=embyWebComponentsBowerPath+"/filesystem");var sha1Path=bowerPath+"/cryptojslib/components/sha1-min",md5Path=bowerPath+"/cryptojslib/components/md5-min",shim={};shim[sha1Path]={deps:[bowerPath+"/cryptojslib/components/core-min"]},shim[md5Path]={deps:[bowerPath+"/cryptojslib/components/core-min"]},requirejs.config({waitSeconds:0,map:{"*":{css:bowerPath+"/emby-webcomponents/require/requirecss",html:bowerPath+"/emby-webcomponents/require/requirehtml",text:bowerPath+"/emby-webcomponents/require/requiretext"}},urlArgs:urlArgs,paths:paths,shim:shim}),define("cryptojs-sha1",[sha1Path]),define("cryptojs-md5",[md5Path]),define("jstree",[bowerPath+"/jstree/dist/jstree","css!thirdparty/jstree/themes/default/style.min.css"]),define("dashboardcss",["css!css/dashboard"]),define("jqmtable",["thirdparty/jquerymobile-1.4.5/jqm.table","css!thirdparty/jquerymobile-1.4.5/jqm.table.css"]),define("jqmwidget",["thirdparty/jquerymobile-1.4.5/jqm.widget"]),define("jqmslider",["thirdparty/jquerymobile-1.4.5/jqm.slider","css!thirdparty/jquerymobile-1.4.5/jqm.slider.css"]),define("jqmpopup",["thirdparty/jquerymobile-1.4.5/jqm.popup","css!thirdparty/jquerymobile-1.4.5/jqm.popup.css"]),define("jqmlistview",["css!thirdparty/jquerymobile-1.4.5/jqm.listview.css"]),define("jqmpanel",["thirdparty/jquerymobile-1.4.5/jqm.panel","css!thirdparty/jquerymobile-1.4.5/jqm.panel.css"]),define("slideshow",[embyWebComponentsBowerPath+"/slideshow/slideshow"],returnFirstDependency),define("fetch",[bowerPath+"/fetch/fetch"]),define("raf",[embyWebComponentsBowerPath+"/polyfills/raf"]),define("functionbind",[embyWebComponentsBowerPath+"/polyfills/bind"]),define("arraypolyfills",[embyWebComponentsBowerPath+"/polyfills/array"]),define("objectassign",[embyWebComponentsBowerPath+"/polyfills/objectassign"]),define("clearButtonStyle",["css!"+embyWebComponentsBowerPath+"/clearbutton"]),define("userdataButtons",[embyWebComponentsBowerPath+"/userdatabuttons/userdatabuttons"],returnFirstDependency),define("listView",[embyWebComponentsBowerPath+"/listview/listview"],returnFirstDependency),define("listViewStyle",["css!"+embyWebComponentsBowerPath+"/listview/listview"],returnFirstDependency),define("formDialogStyle",["css!"+embyWebComponentsBowerPath+"/formdialog"],returnFirstDependency),define("indicators",[embyWebComponentsBowerPath+"/indicators/indicators"],returnFirstDependency),define("registrationServices",[embyWebComponentsBowerPath+"/registrationservices/registrationservices"],returnFirstDependency),Dashboard.isRunningInCordova()?(define("iapManager",["cordova/iap"],returnFirstDependency),define("fileupload",["cordova/fileupload"],returnFirstDependency)):(define("iapManager",["components/iap"],returnFirstDependency),define("fileupload",[apiClientBowerPath+"/fileupload"],returnFirstDependency)),define("connectionmanager",[apiClientBowerPath+"/connectionmanager"]),define("cameraRoll",[apiClientBowerPath+"/cameraroll"],returnFirstDependency),define("contentuploader",[apiClientBowerPath+"/sync/contentuploader"]),define("serversync",[apiClientBowerPath+"/sync/serversync"]),define("multiserversync",[apiClientBowerPath+"/sync/multiserversync"]),define("offlineusersync",[apiClientBowerPath+"/sync/offlineusersync"]),define("mediasync",[apiClientBowerPath+"/sync/mediasync"]),define("swiper",[bowerPath+"/Swiper/dist/js/swiper.min","css!"+bowerPath+"/Swiper/dist/css/swiper.min"],returnFirstDependency),define("scroller",[embyWebComponentsBowerPath+"/scroller/smoothscroller"],returnFirstDependency),define("toast",[embyWebComponentsBowerPath+"/toast/toast"],returnFirstDependency),define("scrollHelper",[embyWebComponentsBowerPath+"/scrollhelper"],returnFirstDependency),define("appSettings",[embyWebComponentsBowerPath+"/appsettings"],updateAppSettings),define("userSettings",[embyWebComponentsBowerPath+"/usersettings/usersettings"],returnFirstDependency),define("userSettingsBuilder",[embyWebComponentsBowerPath+"/usersettings/usersettingsbuilder"],returnFirstDependency),define("material-icons",["css!"+embyWebComponentsBowerPath+"/fonts/material-icons/style"]),define("robotoFont",["css!"+embyWebComponentsBowerPath+"/fonts/roboto/style"]),define("scrollStyles",["css!"+embyWebComponentsBowerPath+"/scrollstyles"]),define("navdrawer",["components/navdrawer/navdrawer"],returnFirstDependency),define("viewcontainer",["components/viewcontainer-lite","css!"+embyWebComponentsBowerPath+"/viewmanager/viewcontainer-lite"],returnFirstDependency),define("queryString",[bowerPath+"/query-string/index"],function(){return queryString}),define("jQuery",[bowerPath+"/jquery/dist/jquery.slim.min"],function(){return window.ApiClient&&(jQuery.ajax=ApiClient.ajax),jQuery}),define("fnchecked",["legacy/fnchecked"]),define("dialogHelper",[embyWebComponentsBowerPath+"/dialoghelper/dialoghelper"],function(dialoghelper){return dialoghelper.setOnOpen(onDialogOpen),dialoghelper}),define("inputmanager",["inputManager"],returnFirstDependency),define("historyManager",["embyRouter"],returnFirstDependency),define("headroom-window",["headroom"],createWindowHeadroom),define("hammer-main",["hammer"],createMainContentHammer),define("appfooter-shared",["appfooter"],createSharedAppFooter),define("skinManager",[],function(){return{loadUserSkin:function(){Emby.Page.show("/home.html")}}}),define("connectionManager",[],function(){return ConnectionManager}),define("apiClientResolver",[],function(){return function(){return window.ApiClient}}),define("embyRouter",[embyWebComponentsBowerPath+"/router"],function(embyRouter){function showItem(item,serverId,options){if("string"==typeof item)require(["connectionManager"],function(connectionManager){var apiClient=connectionManager.currentApiClient();apiClient.getItem(apiClient.getCurrentUserId(),item).then(function(item){embyRouter.showItem(item,options)})});else{2==arguments.length&&(options=arguments[1]);var context=options?options.context:null;Emby.Page.show("/"+LibraryBrowser.getHref(item,context),{item:item})}}return embyRouter.showLocalLogin=function(apiClient,serverId,manualLogin){Dashboard.navigate("login.html?serverid="+serverId)},embyRouter.showVideoOsd=function(){return Dashboard.navigate("videoosd.html")},embyRouter.showSelectServer=function(){ +Dashboard.navigate("selectserver.html")},embyRouter.showWelcome=function(){Dashboard.isConnectMode()?Dashboard.navigate("connectlogin.html?mode=welcome"):Dashboard.navigate("login.html")},embyRouter.showSettings=function(){Dashboard.navigate("mypreferencesmenu.html")},embyRouter.showGuide=function(){Dashboard.navigate("livetv.html?tab=1")},embyRouter.goHome=function(){Dashboard.navigate("home.html")},embyRouter.showSearch=function(){Dashboard.navigate("search.html")},embyRouter.showLiveTV=function(){Dashboard.navigate("livetv.html")},embyRouter.showRecordedTV=function(){Dashboard.navigate("livetv.html?tab=3")},embyRouter.showFavorites=function(){Dashboard.navigate("favorites.html")},embyRouter.showSettings=function(){Dashboard.navigate("mypreferencesmenu.html")},embyRouter.setTitle=function(){},embyRouter.showItem=showItem,embyRouter})}function updateAppSettings(appSettings){return appSettings.enableExternalPlayers=function(val){return null!=val&&appSettings.set("externalplayers",val.toString()),"true"===appSettings.get("externalplayers")},appSettings}function onDialogOpen(dlg){dlg.classList.contains("background-theme-a")||dlg.classList.contains("actionSheet")||(dlg.classList.add("background-theme-b"),dlg.classList.add("ui-body-b"))}function initRequireWithBrowser(browser){var bowerPath=getBowerPath(),apiClientBowerPath=bowerPath+"/emby-apiclient",embyWebComponentsBowerPath=bowerPath+"/emby-webcomponents";Dashboard.isRunningInCordova()&&browser.safari?define("actionsheet",["cordova/actionsheet"],returnFirstDependency):define("actionsheet",["webActionSheet"],returnFirstDependency),"registerElement"in document?define("registerElement",[]):browser.msie?define("registerElement",[bowerPath+"/webcomponentsjs/webcomponents-lite.min.js"]):define("registerElement",[bowerPath+"/document-register-element/build/document-register-element"]),window.chrome&&window.chrome.sockets?define("serverdiscovery",[apiClientBowerPath+"/serverdiscovery-chrome"],returnFirstDependency):Dashboard.isRunningInCordova()&&browser.android?define("serverdiscovery",["cordova/serverdiscovery"],returnFirstDependency):Dashboard.isRunningInCordova()&&browser.safari?define("serverdiscovery",[apiClientBowerPath+"/serverdiscovery-chrome"],returnFirstDependency):define("serverdiscovery",[apiClientBowerPath+"/serverdiscovery"],returnFirstDependency),Dashboard.isRunningInCordova()&&browser.safari?define("imageFetcher",["cordova/imagestore"],returnFirstDependency):define("imageFetcher",[embyWebComponentsBowerPath+"/images/basicimagefetcher"],returnFirstDependency);var preferNativeAlerts=browser.tv;preferNativeAlerts&&window.alert?define("alert",[embyWebComponentsBowerPath+"/alert/nativealert"],returnFirstDependency):define("alert",[embyWebComponentsBowerPath+"/alert/alert"],returnFirstDependency),define("dialog",[embyWebComponentsBowerPath+"/dialog/dialog"],returnFirstDependency),preferNativeAlerts&&window.confirm?define("confirm",[embyWebComponentsBowerPath+"/confirm/nativeconfirm"],returnFirstDependency):define("confirm",[embyWebComponentsBowerPath+"/confirm/confirm"],returnFirstDependency);var preferNativePrompt=preferNativeAlerts||browser.xboxOne;preferNativePrompt&&window.confirm?define("prompt",[embyWebComponentsBowerPath+"/prompt/nativeprompt"],returnFirstDependency):define("prompt",[embyWebComponentsBowerPath+"/prompt/prompt"],returnFirstDependency),browser.tizen||browser.operaTv?define("loading",[embyWebComponentsBowerPath+"/loading/loading-legacy"],returnFirstDependency):define("loading",[embyWebComponentsBowerPath+"/loading/loading-lite"],returnFirstDependency),define("multi-download",[embyWebComponentsBowerPath+"/multidownload"],returnFirstDependency),Dashboard.isRunningInCordova()&&browser.android?(define("fileDownloader",["cordova/filedownloader"],returnFirstDependency),define("localassetmanager",["cordova/localassetmanager"],returnFirstDependency)):(define("fileDownloader",[embyWebComponentsBowerPath+"/filedownloader"],returnFirstDependency),define("localassetmanager",[apiClientBowerPath+"/localassetmanager"],returnFirstDependency)),define("screenLock",[embyWebComponentsBowerPath+"/resourcelocks/nullresourcelock"],returnFirstDependency),Dashboard.isRunningInCordova()&&browser.android?(define("resourceLockManager",[embyWebComponentsBowerPath+"/resourcelocks/resourcelockmanager"],returnFirstDependency),define("wakeLock",["cordova/wakelock"],returnFirstDependency),define("networkLock",["cordova/networklock"],returnFirstDependency)):(define("resourceLockManager",[embyWebComponentsBowerPath+"/resourcelocks/resourcelockmanager"],returnFirstDependency),define("wakeLock",[embyWebComponentsBowerPath+"/resourcelocks/nullresourcelock"],returnFirstDependency),define("networkLock",[embyWebComponentsBowerPath+"/resourcelocks/nullresourcelock"],returnFirstDependency)),Dashboard.isRunningInCordova()?define("castSenderApiLoader",[],getDummyCastSenderApiLoader):define("castSenderApiLoader",[],getCastSenderApiLoader)}function init(){Dashboard.isRunningInCordova()&&browserInfo.android&&define("nativedirectorychooser",["cordova/nativedirectorychooser"]),Dashboard.isRunningInCordova()&&browserInfo.android?define("localsync",["cordova/localsync"],returnFirstDependency):define("localsync",["scripts/localsync"],returnFirstDependency),define("livetvcss",["css!css/livetv.css"]),define("detailtablecss",["css!css/detailtable.css"]),define("autoorganizetablecss",["css!css/autoorganizetable.css"]),define("buttonenabled",["legacy/buttonenabled"]),initAfterDependencies()}function getRequirePromise(deps){return new Promise(function(resolve,reject){require(deps,resolve)})}function initAfterDependencies(){var list=[];window.fetch||list.push("fetch"),"function"!=typeof Object.assign&&list.push("objectassign"),Array.prototype.filter||list.push("arraypolyfills"),Function.prototype.bind||list.push("functionbind"),window.requestAnimationFrame||list.push("raf"),require(list,function(){createConnectionManager().then(function(){console.log("initAfterDependencies promises resolved"),require(["globalize"],function(globalize){window.Globalize=globalize,Promise.all([loadCoreDictionary(globalize),loadSharedComponentsDictionary(globalize)]).then(onGlobalizeInit)})})})}function loadSharedComponentsDictionary(globalize){var baseUrl="bower_components/emby-webcomponents/strings/",languages=["ar","bg-bg","ca","cs","da","de","el","en-gb","en-us","es-ar","es-mx","es","fi","fr","gsw","he","hr","hu","id","it","kk","ko","ms","nb","nl","pl","pt-br","pt-pt","ro","ru","sk","sl-si","sv","tr","uk","vi","zh-cn","zh-hk","zh-tw"],translations=languages.map(function(i){return{lang:i,path:baseUrl+i+".json"}});globalize.loadStrings({name:"sharedcomponents",translations:translations})}function loadCoreDictionary(globalize){var baseUrl="strings/",languages=["ar","bg-bg","ca","cs","da","de","el","en-gb","en-us","es-ar","es-mx","es","fi","fr","gsw","he","hr","hu","id","it","kk","ko","ms","nb","nl","pl","pt-br","pt-pt","ro","ru","sl-si","sv","tr","uk","vi","zh-cn","zh-hk","zh-tw"],translations=languages.map(function(i){return{lang:i,path:baseUrl+i+".json"}});return globalize.defaultModule("core"),globalize.loadStrings({name:"core",translations:translations})}function onGlobalizeInit(){document.title=Globalize.translateDocument(document.title,"core"),require(["apphost"],function(appHost){loadPlugins([],appHost,browserInfo).then(onAppReady)})}function defineRoute(newRoute,dictionary){var baseRoute=Emby.Page.baseUrl(),path=newRoute.path;path=path.replace(baseRoute,""),console.log("Defining route: "+path),newRoute.dictionary=newRoute.dictionary||dictionary||"core",Emby.Page.addRoute(path,newRoute)}function defineCoreRoutes(){console.log("Defining core routes"),defineRoute({path:"/addplugin.html",dependencies:[],autoFocus:!1,roles:"admin",controller:"scripts/addpluginpage"}),defineRoute({path:"/appservices.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/autoorganizelog.html",dependencies:["scripts/taskbutton","autoorganizetablecss"],controller:"dashboard/autoorganizelog",roles:"admin"}),defineRoute({path:"/autoorganizesmart.html",dependencies:["emby-button"],controller:"dashboard/autoorganizesmart",autoFocus:!1,roles:"admin"}),defineRoute({path:"/autoorganizetv.html",dependencies:["emby-checkbox","emby-input","emby-button","emby-select","emby-collapse"],controller:"dashboard/autoorganizetv",autoFocus:!1,roles:"admin"}),defineRoute({path:"/channelitems.html",dependencies:[],autoFocus:!1,transition:"fade"}),defineRoute({path:"/channels.html",dependencies:[],autoFocus:!1,transition:"fade",controller:"scripts/channels"}),defineRoute({path:"/channelsettings.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/cinemamodeconfiguration.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/connectlogin.html",dependencies:["emby-button","emby-input"],autoFocus:!1,anonymous:!0,startup:!0,controller:"scripts/connectlogin"}),defineRoute({path:"/dashboard.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/dashboardgeneral.html",controller:"dashboard/dashboardgeneral",autoFocus:!1,roles:"admin"}),defineRoute({path:"/dashboardhosting.html",dependencies:["emby-input","emby-button"],autoFocus:!1,roles:"admin",controller:"dashboard/dashboardhosting"}),defineRoute({path:"/device.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/devices.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/devicesupload.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/dlnaprofile.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/dlnaprofiles.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/dlnaserversettings.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/dlnasettings.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/edititemmetadata.html",dependencies:[],controller:"scripts/edititemmetadata",autoFocus:!1}),defineRoute({path:"/encodingsettings.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/favorites.html",dependencies:[],autoFocus:!1,controller:"scripts/favorites"}),defineRoute({path:"/forgotpassword.html",dependencies:["emby-input","emby-button"],anonymous:!0,startup:!0,controller:"scripts/forgotpassword"}),defineRoute({path:"/forgotpasswordpin.html",dependencies:["emby-input","emby-button"],autoFocus:!1,anonymous:!0,startup:!0,controller:"scripts/forgotpasswordpin"}),defineRoute({path:"/gamegenres.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/games.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/gamesrecommended.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/gamestudios.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/gamesystems.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/home.html",dependencies:[],autoFocus:!1,controller:"scripts/indexpage",transition:"fade",type:"home"}),defineRoute({path:"/index.html",dependencies:[],autoFocus:!1,isDefaultRoute:!0}),defineRoute({path:"/itemdetails.html",dependencies:["emby-button","scripts/livetvcomponents","paper-icon-button-light","emby-itemscontainer"],controller:"scripts/itemdetailpage",autoFocus:!1,transition:"fade"}),defineRoute({path:"/itemlist.html",dependencies:[],autoFocus:!1,controller:"scripts/itemlistpage",transition:"fade"}),defineRoute({path:"/kids.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/library.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/librarydisplay.html",dependencies:[],autoFocus:!1,roles:"admin",controller:"dashboard/librarydisplay"}),defineRoute({path:"/librarysettings.html",dependencies:["emby-collapse","emby-input","emby-button","emby-select"],autoFocus:!1,roles:"admin",controller:"dashboard/librarysettings"}),defineRoute({path:"/livetv.html",dependencies:["emby-button","livetvcss"],controller:"scripts/livetvsuggested",autoFocus:!1,transition:"fade"}),defineRoute({path:"/livetvguideprovider.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/livetvitems.html",dependencies:[],autoFocus:!1,controller:"scripts/livetvitems"}),defineRoute({path:"/livetvseriestimer.html",dependencies:["emby-checkbox","emby-input","emby-button","emby-collapse","scripts/livetvcomponents","scripts/livetvseriestimer","livetvcss"],autoFocus:!1,controller:"scripts/livetvseriestimer"}),defineRoute({path:"/livetvsettings.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/livetvstatus.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/livetvtunerprovider-hdhomerun.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/livetvtunerprovider-m3u.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/livetvtunerprovider-satip.html",dependencies:["emby-input"],autoFocus:!1,roles:"admin",controller:"dashboard/livetvtunerprovider-satip"}),defineRoute({path:"/log.html",dependencies:["emby-checkbox"],roles:"admin",controller:"dashboard/logpage"}),defineRoute({path:"/login.html",dependencies:["emby-button","emby-input"],autoFocus:!1,anonymous:!0,startup:!0,controller:"scripts/loginpage"}),defineRoute({path:"/metadataadvanced.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/metadataimages.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/metadatanfo.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/metadatasubtitles.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/movies.html",dependencies:["emby-button"],autoFocus:!1,controller:"scripts/moviesrecommended",transition:"fade"}),defineRoute({path:"/music.html",dependencies:[],controller:"scripts/musicrecommended",autoFocus:!1,transition:"fade"}),defineRoute({path:"/mypreferencesdisplay.html",dependencies:["emby-checkbox","emby-button","emby-select"],autoFocus:!1,transition:"fade",controller:"scripts/mypreferencesdisplay"}),defineRoute({path:"/mypreferenceshome.html",dependencies:["emby-checkbox","emby-button","emby-select"],autoFocus:!1,transition:"fade",controller:"scripts/mypreferenceshome"}),defineRoute({path:"/mypreferenceslanguages.html",dependencies:["emby-button","emby-checkbox","emby-select"],autoFocus:!1,transition:"fade",controller:"scripts/mypreferenceslanguages"}),defineRoute({path:"/mypreferencesmenu.html",dependencies:["emby-button"],autoFocus:!1,transition:"fade",controller:"scripts/mypreferencescommon"}),defineRoute({path:"/myprofile.html",dependencies:["emby-button","emby-collapse","emby-checkbox","emby-input"],autoFocus:!1,transition:"fade",controller:"scripts/myprofile"}),defineRoute({path:"/mysync.html",dependencies:[],autoFocus:!1,transition:"fade",controller:"scripts/mysync"}),defineRoute({path:"/camerauploadsettings.html",dependencies:[],autoFocus:!1,transition:"fade",controller:"scripts/camerauploadsettings"}),defineRoute({path:"/mysyncjob.html",dependencies:[],autoFocus:!1,transition:"fade",controller:"scripts/syncjob"}),defineRoute({path:"/mysyncsettings.html",dependencies:["emby-checkbox","emby-input","emby-button","paper-icon-button-light"],autoFocus:!1,transition:"fade",controller:"scripts/mysyncsettings"}),defineRoute({path:"/notificationlist.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/notificationsetting.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/notificationsettings.html",controller:"scripts/notificationsettings",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/nowplaying.html",dependencies:["paper-icon-button-light","emby-slider","emby-button","emby-input","emby-itemscontainer"],controller:"scripts/nowplayingpage",autoFocus:!1,transition:"fade",fullscreen:!0,supportsThemeMedia:!0}),defineRoute({path:"/photos.html",dependencies:[],autoFocus:!1,transition:"fade"}),defineRoute({path:"/playbackconfiguration.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/playlists.html",dependencies:[],autoFocus:!1,transition:"fade",controller:"scripts/playlists"}),defineRoute({path:"/plugincatalog.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/plugins.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/reports.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/scheduledtask.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/scheduledtasks.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/search.html",dependencies:[],controller:"scripts/searchpage"}),defineRoute({path:"/secondaryitems.html",dependencies:[],autoFocus:!1,controller:"scripts/secondaryitems"}),defineRoute({path:"/selectserver.html",dependencies:["listViewStyle","emby-button"],autoFocus:!1,anonymous:!0,startup:!0,controller:"scripts/selectserver"}),defineRoute({path:"/serversecurity.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/shared.html",dependencies:[],autoFocus:!1,anonymous:!0}),defineRoute({path:"/streamingsettings.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/support.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/supporterkey.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/syncactivity.html",dependencies:[],autoFocus:!1,controller:"scripts/syncactivity"}),defineRoute({path:"/syncsettings.html",dependencies:[],autoFocus:!1}),defineRoute({path:"/tv.html",dependencies:["paper-icon-button-light","emby-button"],autoFocus:!1,controller:"scripts/tvrecommended",transition:"fade"}),defineRoute({path:"/useredit.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/userlibraryaccess.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/usernew.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/userparentalcontrol.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/userpassword.html",dependencies:["emby-input","emby-button","emby-checkbox"],autoFocus:!1,controller:"scripts/userpasswordpage"}),defineRoute({path:"/userprofiles.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/wizardagreement.html",dependencies:["dashboardcss"],autoFocus:!1,anonymous:!0}),defineRoute({path:"/wizardcomponents.html",dependencies:["dashboardcss","emby-button","emby-input","emby-select"],autoFocus:!1,anonymous:!0,controller:"dashboard/wizardcomponents"}),defineRoute({path:"/wizardfinish.html",dependencies:["emby-button","dashboardcss"],autoFocus:!1,anonymous:!0,controller:"dashboard/wizardfinishpage"}),defineRoute({path:"/wizardlibrary.html",dependencies:["dashboardcss"],autoFocus:!1,anonymous:!0}),defineRoute({path:"/wizardlivetvguide.html",dependencies:["dashboardcss"],autoFocus:!1,anonymous:!0}),defineRoute({path:"/wizardlivetvtuner.html",dependencies:["dashboardcss"],autoFocus:!1,anonymous:!0}),defineRoute({path:"/wizardsettings.html",dependencies:["dashboardcss"],autoFocus:!1,anonymous:!0}),defineRoute({path:"/wizardstart.html",dependencies:["dashboardcss"],autoFocus:!1,anonymous:!0}),defineRoute({path:"/wizarduser.html",dependencies:["dashboardcss","emby-input"],autoFocus:!1,anonymous:!0}),defineRoute({path:"/videoosd.html",dependencies:[],transition:"fade",controller:"scripts/videoosd",autoFocus:!1,type:"video-osd",supportsThemeMedia:!0,fullscreen:!0}),defineRoute({path:"/configurationpage",dependencies:["jQuery"],autoFocus:!1,enableCache:!1,enableContentQueryString:!0,roles:"admin"}),defineRoute({path:"/",isDefaultRoute:!0,autoFocus:!1,dependencies:[]})}function loadPlugins(externalPlugins,appHost,browser,shell){console.log("Loading installed plugins");var list=["bower_components/emby-webcomponents/playback/playbackvalidation"];Dashboard.isRunningInCordova()&&browser.android?(document.createElement("audio").canPlayType("audio/flac").replace(/no/,"")&&document.createElement("audio").canPlayType('audio/ogg; codecs="opus"').replace(/no/,"")?window.VlcAudio=!0:window.VlcAudio=!0,list.push("cordova/vlcplayer")):Dashboard.isRunningInCordova()&&browser.safari&&list.push("cordova/audioplayer"),list.push("bower_components/emby-webcomponents/htmlaudioplayer/plugin"),Dashboard.isRunningInCordova()&&browser.safari&&list.push("cordova/chromecast"),Dashboard.isRunningInCordova()&&browser.android&&list.push("cordova/externalplayer"),list.push("bower_components/emby-webcomponents/htmlvideoplayer/plugin"),appHost.supports("remotecontrol")&&(list.push("bower_components/emby-webcomponents/sessionplayer"),browser.chrome&&list.push("bower_components/emby-webcomponents/chromecastplayer")),list.push("bower_components/emby-webcomponents/youtubeplayer/plugin");for(var i=0,length=externalPlugins.length;i Date: Sat, 4 Feb 2017 18:32:16 -0500 Subject: [PATCH 2/2] rework guide mappings --- dashboard-ui/bower_components/emby-webcomponents/guide/guide.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js b/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js index e22288f082..044e143b07 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js +++ b/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js @@ -1 +1 @@ -define(["require","browser","globalize","connectionManager","serverNotifications","loading","datetime","focusManager","userSettings","imageLoader","events","layoutManager","itemShortcuts","registrationServices","dom","clearButtonStyle","css!./guide.css","programStyles","material-icons","scrollStyles","emby-button","paper-icon-button-light","emby-tabs"],function(require,browser,globalize,connectionManager,serverNotifications,loading,datetime,focusManager,userSettings,imageLoader,events,layoutManager,itemShortcuts,registrationServices,dom){"use strict";function showViewSettings(instance){require(["guide-settings-dialog"],function(guideSettingsDialog){guideSettingsDialog.show(instance.categoryOptions).then(function(){instance.refresh()})})}function Guide(options){function restartAutoRefresh(){stopAutoRefresh();var intervalMs=9e5;autoRefreshInterval=setInterval(function(){self.refresh()},intervalMs)}function stopAutoRefresh(){autoRefreshInterval&&(clearInterval(autoRefreshInterval),autoRefreshInterval=null)}function normalizeDateToTimeslot(date){var minutesOffset=date.getMinutes()-cellCurationMinutes;return minutesOffset>=0?date.setHours(date.getHours(),cellCurationMinutes,0,0):date.setHours(date.getHours(),0,0,0),date}function showLoading(){loading.show()}function hideLoading(){loading.hide()}function startCurrentTimeUpdateInterval(){clearCurrentTimeUpdateInterval(),currentTimeUpdateInterval=setInterval(updateCurrentTimeIndicator,6e4),updateCurrentTimeIndicator()}function clearCurrentTimeUpdateInterval(){var interval=currentTimeUpdateInterval;interval&&clearInterval(interval),currentTimeUpdateInterval=null,currentTimeIndicatorBar=null,currentTimeIndicatorArrow=null}function updateCurrentTimeIndicator(){currentTimeIndicatorBar||(currentTimeIndicatorBar=options.element.querySelector(".currentTimeIndicatorBar")),currentTimeIndicatorArrow||(currentTimeIndicatorArrow=options.element.querySelector(".currentTimeIndicatorArrowContainer"));var dateDifference=(new Date).getTime()-currentDate.getTime(),pct=dateDifference>0?dateDifference/totalRendererdMs:0;pct=Math.min(pct,1),pct<=0||pct>=1?(currentTimeIndicatorBar.classList.add("hide"),currentTimeIndicatorArrow.classList.add("hide")):(currentTimeIndicatorBar.classList.remove("hide"),currentTimeIndicatorArrow.classList.remove("hide"),currentTimeIndicatorBar.style.transform="scaleX("+pct+")",currentTimeIndicatorArrow.style.transform="translateX("+100*pct+"%)")}function getChannelLimit(context){return registrationServices.validateFeature("livetv").then(function(){var limit=browser.slow?100:500;return context.querySelector(".guideRequiresUnlock").classList.add("hide"),limit},function(){var limit=5;return context.querySelector(".guideRequiresUnlock").classList.remove("hide"),context.querySelector(".unlockText").innerHTML=globalize.translate("sharedcomponents#LiveTvGuideRequiresUnlock",limit),limit})}function reloadGuide(context,newStartDate,focusProgramOnRender){var apiClient=connectionManager.currentApiClient(),channelQuery={StartIndex:0,EnableFavoriteSorting:"false"!==userSettings.get("livetv-favoritechannelsattop")};channelQuery.UserId=apiClient.getCurrentUserId(),getChannelLimit(context).then(function(channelLimit){currentChannelLimit=channelLimit,showLoading(),channelQuery.StartIndex=currentStartIndex,channelQuery.Limit=channelLimit,channelQuery.AddCurrentProgram=!1,channelQuery.EnableUserData=!1,channelQuery.EnableImageTypes="Primary";var categories=self.categoryOptions.categories||[],displayMovieContent=!categories.length||categories.indexOf("movies")!==-1,displaySportsContent=!categories.length||categories.indexOf("sports")!==-1,displayNewsContent=!categories.length||categories.indexOf("news")!==-1,displayKidsContent=!categories.length||categories.indexOf("kids")!==-1,displaySeriesContent=!categories.length||categories.indexOf("series")!==-1;displayMovieContent&&displaySportsContent&&displayNewsContent&&displayKidsContent?(channelQuery.IsMovie=null,channelQuery.IsSports=null,channelQuery.IsKids=null,channelQuery.IsNews=null,channelQuery.IsSeries=null):(displayNewsContent&&(channelQuery.IsNews=!0),displaySportsContent&&(channelQuery.IsSports=!0),displayKidsContent&&(channelQuery.IsKids=!0),displayMovieContent&&(channelQuery.IsMovie=!0),displaySeriesContent&&(channelQuery.IsSeries=!0)),"DatePlayed"===userSettings.get("livetv-channelorder")?(channelQuery.SortBy="DatePlayed",channelQuery.SortOrder="Descending"):(channelQuery.SortBy=null,channelQuery.SortOrder=null);var date=newStartDate;date=new Date(date.getTime()+1e3);var nextDay=new Date(date.getTime()+msPerDay-2e3);console.log(nextDay),apiClient.getLiveTvChannels(channelQuery).then(function(channelsResult){var btnPreviousPage=context.querySelector(".btnPreviousPage"),btnNextPage=context.querySelector(".btnNextPage");channelsResult.TotalRecordCount>channelLimit?(context.querySelector(".guideOptions").classList.remove("hide"),btnPreviousPage.classList.remove("hide"),btnNextPage.classList.remove("hide"),channelQuery.StartIndex?context.querySelector(".btnPreviousPage").disabled=!1:context.querySelector(".btnPreviousPage").disabled=!0,channelQuery.StartIndex+channelLimit",startDate.setTime(startDate.getTime()+cellDurationMs);return html+='
',html+="
",html+='
',html+='arrow_drop_down',html+="
"}function parseDates(program){if(!program.StartDateLocal)try{program.StartDateLocal=datetime.parseISO8601Date(program.StartDate,{toLocal:!0})}catch(err){}if(!program.EndDateLocal)try{program.EndDateLocal=datetime.parseISO8601Date(program.EndDate,{toLocal:!0})}catch(err){}return null}function getTimerIndicator(item){var status;if("SeriesTimer"===item.Type)return'';if(item.TimerId||item.SeriesTimerId)status=item.Status||"Cancelled";else{if("Timer"!==item.Type)return"";status=item.Status}return item.SeriesTimerId?"Cancelled"!==status?'':'':''}function getChannelProgramsHtml(context,date,channel,programs,options,index){var html="",startMs=date.getTime(),endMs=startMs+msPerDay-1;programs=programs.filter(function(curr){return curr.ChannelId===channel.Id});var outerCssClass=layoutManager.tv?"channelPrograms channelPrograms-tv":"channelPrograms";html+='
';for(var clickAction=layoutManager.tv?"link":"programdialog",categories=self.categoryOptions.categories||[],displayMovieContent=!categories.length||categories.indexOf("movies")!==-1,displaySportsContent=!categories.length||categories.indexOf("sports")!==-1,displayNewsContent=!categories.length||categories.indexOf("news")!==-1,displayKidsContent=!categories.length||categories.indexOf("kids")!==-1,displaySeriesContent=!categories.length||categories.indexOf("series")!==-1,enableColorCodedBackgrounds="true"===userSettings.get("guide-colorcodedbackgrounds"),i=0,length=programs.length;iendMs)break;items[program.Id]=program;var renderStartMs=Math.max(program.StartDateLocal.getTime(),startMs),startPercent=(program.StartDateLocal.getTime()-startMs)/msPerDay;startPercent*=100,startPercent=Math.max(startPercent,0);var renderEndMs=Math.min(program.EndDateLocal.getTime(),endMs),endPercent=(renderEndMs-renderStartMs)/msPerDay;endPercent*=100;var cssClass="programCell clearButton itemAction",accentCssClass=null,displayInnerContent=!0;program.IsKids?(cssClass+=" childProgramInfo",displayInnerContent=displayKidsContent,accentCssClass="childAccent"):program.IsSports?(cssClass+=" sportsProgramInfo",displayInnerContent=displaySportsContent,accentCssClass="sportsAccent"):program.IsNews?(cssClass+=" newsProgramInfo",displayInnerContent=displayNewsContent,accentCssClass="newsAccent"):program.IsMovie?(cssClass+=" movieProgramInfo",displayInnerContent=displayMovieContent,accentCssClass="movieAccent"):program.IsSeries?(cssClass+=" plainProgramInfo",displayInnerContent=displaySeriesContent):(cssClass+=" plainProgramInfo",displayInnerContent=displayMovieContent&&displayNewsContent&&displaySportsContent&&displayKidsContent&&displaySeriesContent),displayInnerContent||(accentCssClass=null),enableColorCodedBackgrounds&&accentCssClass?(cssClass+=" "+accentCssClass,accentCssClass=null):accentCssClass=null;var timerAttributes="";if(program.TimerId&&(timerAttributes+=' data-timerid="'+program.TimerId+'"'),program.SeriesTimerId&&(timerAttributes+=' data-seriestimerid="'+program.SeriesTimerId+'"'),html+='"}}return html+="
"}function renderPrograms(context,date,channels,programs){for(var html=[],allowIndicators=dom.getWindowSize().innerWidth>=600,options={showHdIcon:allowIndicators&&"true"===userSettings.get("guide-indicator-hd"),showLiveIndicator:allowIndicators&&"false"!==userSettings.get("guide-indicator-live"),showPremiereIndicator:allowIndicators&&"false"!==userSettings.get("guide-indicator-premiere"),showNewIndicator:allowIndicators&&"true"===userSettings.get("guide-indicator-new"),showRepeatIndicator:allowIndicators&&"true"===userSettings.get("guide-indicator-repeat"),showEpisodeTitle:!layoutManager.tv},i=0,length=channels.length;i',cssClass="guideChannelNumber",html+='

'+channel.Number+"

",!hasChannelImage&&channel.Name&&(html+='
'+channel.Name+"
"),html+=""}var channelList=context.querySelector(".channelsContainer");channelList.innerHTML=html,imageLoader.lazyChildren(channelList)}function renderGuide(context,date,channels,programs,apiClient,focusProgramOnRender){var activeElement=document.activeElement,itemId=activeElement&&activeElement.getAttribute?activeElement.getAttribute("data-id"):null,channelRowId=null;activeElement&&(channelRowId=dom.parentWithClass(activeElement,"channelPrograms"),channelRowId=channelRowId&&channelRowId.getAttribute?channelRowId.getAttribute("data-channelid"):null),renderChannelHeaders(context,channels,apiClient);var startDate=date,endDate=new Date(startDate.getTime()+msPerDay);if(context.querySelector(".timeslotHeaders").innerHTML=getTimeslotHeadersHtml(startDate,endDate),startCurrentTimeUpdateInterval(),items={},renderPrograms(context,date,channels,programs),focusProgramOnRender){var focusElem;if(itemId&&(focusElem=context.querySelector('[data-id="'+itemId+'"]')),focusElem)focusManager.focus(focusElem);else{var autoFocusParent;channelRowId&&(autoFocusParent=context.querySelector('[data-channelid="'+channelRowId+'"]')),autoFocusParent||(autoFocusParent=context.querySelector(".programGrid")),focusManager.autoFocus(autoFocusParent,!0)}}}function nativeScrollTo(container,pos,horizontal){container.scrollTo?horizontal?container.scrollTo(pos,0):container.scrollTo(0,pos):horizontal?container.scrollLeft=Math.round(pos):container.scrollTop=Math.round(pos)}function onProgramGridScroll(context,elem,timeslotHeaders){(new Date).getTime()-lastHeaderScroll>=1e3&&(lastGridScroll=(new Date).getTime(),nativeScrollTo(timeslotHeaders,elem.scrollLeft,!0))}function onTimeslotHeadersScroll(context,elem,programGrid){(new Date).getTime()-lastGridScroll>=1e3&&(lastHeaderScroll=(new Date).getTime(),nativeScrollTo(programGrid,elem.scrollLeft,!0))}function changeDate(page,date,focusProgramOnRender){clearCurrentTimeUpdateInterval();var newStartDate=normalizeDateToTimeslot(date);currentDate=newStartDate,reloadGuide(page,newStartDate,focusProgramOnRender)}function getDateTabText(date,isActive,tabIndex){var cssClass=isActive?"emby-tab-button guide-date-tab-button emby-tab-button-active":"emby-tab-button guide-date-tab-button",html='"}function setDateRange(page,guideInfo){var today=new Date;today.setHours(today.getHours(),0,0,0);var start=datetime.parseISO8601Date(guideInfo.StartDate,{toLocal:!0}),end=datetime.parseISO8601Date(guideInfo.EndDate,{toLocal:!0});start.setHours(0,0,0,0),end.setHours(0,0,0,0),start.getTime()>=end.getTime()&&end.setDate(start.getDate()+1),start=new Date(Math.max(today,start));var dateTabsHtml="",tabIndex=0,date=new Date;for(currentDate&&date.setTime(currentDate.getTime());start<=end;){var isActive=date.getDate()===start.getDate()&&date.getMonth()===start.getMonth()&&date.getFullYear()===start.getFullYear();dateTabsHtml+=getDateTabText(start,isActive,tabIndex),start.setDate(start.getDate()+1),start.setHours(0,0,0,0),tabIndex++}page.querySelector(".emby-tabs-slider").innerHTML=dateTabsHtml,page.querySelector(".guideDateTabs").refresh(),changeDate(page,date,layoutManager.tv)}function reloadPage(page){showLoading();var apiClient=connectionManager.currentApiClient();apiClient.getLiveTvGuideInfo().then(function(guideInfo){setDateRange(page,guideInfo)})}function setScrollEvents(view,enabled){layoutManager.tv&&require(["scrollHelper"],function(scrollHelper){var fn=enabled?"on":"off";scrollHelper.centerFocus[fn](view.querySelector(".guideVerticalScroller"),!1),scrollHelper.centerFocus[fn](view.querySelector(".programGrid"),!0)})}function onProgramGridFocus(e){var programCell=dom.parentWithClass(e.target,"programCell");if(programCell){var focused=e.target,id=focused.getAttribute("data-id"),item=items[id];item&&events.trigger(self,"focus",[{item:item}])}}function onTimerCreated(e,apiClient,data){for(var programId=data.ProgramId,newTimerId=data.Id,cells=options.element.querySelectorAll('.programCell[data-id="'+programId+'"]'),i=0,length=cells.length;i'),newTimerId&&cell.setAttribute("data-timerid",newTimerId)}}function onSeriesTimerCreated(e,apiClient,data){}function onTimerCancelled(e,apiClient,data){for(var id=data.Id,cells=options.element.querySelectorAll('.programCell[data-timerid="'+id+'"]'),i=0,length=cells.length;i=0?date.setHours(date.getHours(),cellCurationMinutes,0,0):date.setHours(date.getHours(),0,0,0),date}function showLoading(){loading.show()}function hideLoading(){loading.hide()}function startCurrentTimeUpdateInterval(){clearCurrentTimeUpdateInterval(),currentTimeUpdateInterval=setInterval(updateCurrentTimeIndicator,6e4),updateCurrentTimeIndicator()}function clearCurrentTimeUpdateInterval(){var interval=currentTimeUpdateInterval;interval&&clearInterval(interval),currentTimeUpdateInterval=null,currentTimeIndicatorBar=null,currentTimeIndicatorArrow=null}function updateCurrentTimeIndicator(){currentTimeIndicatorBar||(currentTimeIndicatorBar=options.element.querySelector(".currentTimeIndicatorBar")),currentTimeIndicatorArrow||(currentTimeIndicatorArrow=options.element.querySelector(".currentTimeIndicatorArrowContainer"));var dateDifference=(new Date).getTime()-currentDate.getTime(),pct=dateDifference>0?dateDifference/totalRendererdMs:0;pct=Math.min(pct,1),pct<=0||pct>=1?(currentTimeIndicatorBar.classList.add("hide"),currentTimeIndicatorArrow.classList.add("hide")):(currentTimeIndicatorBar.classList.remove("hide"),currentTimeIndicatorArrow.classList.remove("hide"),currentTimeIndicatorBar.style.transform="scaleX("+pct+")",currentTimeIndicatorArrow.style.transform="translateX("+100*pct+"%)")}function getChannelLimit(context){return registrationServices.validateFeature("livetv").then(function(){var limit=browser.slow?100:500;return context.querySelector(".guideRequiresUnlock").classList.add("hide"),limit},function(){var limit=5;return context.querySelector(".guideRequiresUnlock").classList.remove("hide"),context.querySelector(".unlockText").innerHTML=globalize.translate("sharedcomponents#LiveTvGuideRequiresUnlock",limit),limit})}function reloadGuide(context,newStartDate,focusProgramOnRender){var apiClient=connectionManager.currentApiClient(),channelQuery={StartIndex:0,EnableFavoriteSorting:"false"!==userSettings.get("livetv-favoritechannelsattop")};channelQuery.UserId=apiClient.getCurrentUserId(),getChannelLimit(context).then(function(channelLimit){currentChannelLimit=channelLimit,showLoading(),channelQuery.StartIndex=currentStartIndex,channelQuery.Limit=channelLimit,channelQuery.AddCurrentProgram=!1,channelQuery.EnableUserData=!1,channelQuery.EnableImageTypes="Primary";var categories=self.categoryOptions.categories||[],displayMovieContent=!categories.length||categories.indexOf("movies")!==-1,displaySportsContent=!categories.length||categories.indexOf("sports")!==-1,displayNewsContent=!categories.length||categories.indexOf("news")!==-1,displayKidsContent=!categories.length||categories.indexOf("kids")!==-1,displaySeriesContent=!categories.length||categories.indexOf("series")!==-1;displayMovieContent&&displaySportsContent&&displayNewsContent&&displayKidsContent?(channelQuery.IsMovie=null,channelQuery.IsSports=null,channelQuery.IsKids=null,channelQuery.IsNews=null,channelQuery.IsSeries=null):(displayNewsContent&&(channelQuery.IsNews=!0),displaySportsContent&&(channelQuery.IsSports=!0),displayKidsContent&&(channelQuery.IsKids=!0),displayMovieContent&&(channelQuery.IsMovie=!0),displaySeriesContent&&(channelQuery.IsSeries=!0)),"DatePlayed"===userSettings.get("livetv-channelorder")?(channelQuery.SortBy="DatePlayed",channelQuery.SortOrder="Descending"):(channelQuery.SortBy=null,channelQuery.SortOrder=null);var date=newStartDate;date=new Date(date.getTime()+1e3);var nextDay=new Date(date.getTime()+msPerDay-2e3);console.log(nextDay),apiClient.getLiveTvChannels(channelQuery).then(function(channelsResult){var btnPreviousPage=context.querySelector(".btnPreviousPage"),btnNextPage=context.querySelector(".btnNextPage");channelsResult.TotalRecordCount>channelLimit?(context.querySelector(".guideOptions").classList.remove("hide"),btnPreviousPage.classList.remove("hide"),btnNextPage.classList.remove("hide"),channelQuery.StartIndex?context.querySelector(".btnPreviousPage").disabled=!1:context.querySelector(".btnPreviousPage").disabled=!0,channelQuery.StartIndex+channelLimit",startDate.setTime(startDate.getTime()+cellDurationMs);return html+='
',html+="
",html+='
',html+='arrow_drop_down',html+="
"}function parseDates(program){if(!program.StartDateLocal)try{program.StartDateLocal=datetime.parseISO8601Date(program.StartDate,{toLocal:!0})}catch(err){}if(!program.EndDateLocal)try{program.EndDateLocal=datetime.parseISO8601Date(program.EndDate,{toLocal:!0})}catch(err){}return null}function getTimerIndicator(item){var status;if("SeriesTimer"===item.Type)return'';if(item.TimerId||item.SeriesTimerId)status=item.Status||"Cancelled";else{if("Timer"!==item.Type)return"";status=item.Status}return item.SeriesTimerId?"Cancelled"!==status?'':'':''}function getChannelProgramsHtml(context,date,channel,programs,options,index){var html="",startMs=date.getTime(),endMs=startMs+msPerDay-1;programs=programs.filter(function(curr){return curr.ChannelId===channel.Id});var outerCssClass=layoutManager.tv?"channelPrograms channelPrograms-tv":"channelPrograms";html+='
';for(var clickAction=layoutManager.tv?"link":"programdialog",categories=self.categoryOptions.categories||[],displayMovieContent=!categories.length||categories.indexOf("movies")!==-1,displaySportsContent=!categories.length||categories.indexOf("sports")!==-1,displayNewsContent=!categories.length||categories.indexOf("news")!==-1,displayKidsContent=!categories.length||categories.indexOf("kids")!==-1,displaySeriesContent=!categories.length||categories.indexOf("series")!==-1,enableColorCodedBackgrounds="true"===userSettings.get("guide-colorcodedbackgrounds"),i=0,length=programs.length;iendMs)break;items[program.Id]=program;var renderStartMs=Math.max(program.StartDateLocal.getTime(),startMs),startPercent=(program.StartDateLocal.getTime()-startMs)/msPerDay;startPercent*=100,startPercent=Math.max(startPercent,0);var renderEndMs=Math.min(program.EndDateLocal.getTime(),endMs),endPercent=(renderEndMs-renderStartMs)/msPerDay;endPercent*=100;var cssClass="programCell clearButton itemAction",accentCssClass=null,displayInnerContent=!0;program.IsKids?(cssClass+=" childProgramInfo",displayInnerContent=displayKidsContent,accentCssClass="childAccent"):program.IsSports?(cssClass+=" sportsProgramInfo",displayInnerContent=displaySportsContent,accentCssClass="sportsAccent"):program.IsNews?(cssClass+=" newsProgramInfo",displayInnerContent=displayNewsContent,accentCssClass="newsAccent"):program.IsMovie?(cssClass+=" movieProgramInfo",displayInnerContent=displayMovieContent,accentCssClass="movieAccent"):program.IsSeries?(cssClass+=" plainProgramInfo",displayInnerContent=displaySeriesContent):(cssClass+=" plainProgramInfo",displayInnerContent=displayMovieContent&&displayNewsContent&&displaySportsContent&&displayKidsContent&&displaySeriesContent),displayInnerContent||(accentCssClass=null),enableColorCodedBackgrounds&&accentCssClass?(cssClass+=" "+accentCssClass,accentCssClass=null):accentCssClass=null;var timerAttributes="";if(program.TimerId&&(timerAttributes+=' data-timerid="'+program.TimerId+'"'),program.SeriesTimerId&&(timerAttributes+=' data-seriestimerid="'+program.SeriesTimerId+'"'),html+='"}}return html+="
"}function renderPrograms(context,date,channels,programs){for(var html=[],allowIndicators=dom.getWindowSize().innerWidth>=600,options={showHdIcon:allowIndicators&&"true"===userSettings.get("guide-indicator-hd"),showLiveIndicator:allowIndicators&&"false"!==userSettings.get("guide-indicator-live"),showPremiereIndicator:allowIndicators&&"false"!==userSettings.get("guide-indicator-premiere"),showNewIndicator:allowIndicators&&"true"===userSettings.get("guide-indicator-new"),showRepeatIndicator:allowIndicators&&"true"===userSettings.get("guide-indicator-repeat"),showEpisodeTitle:!layoutManager.tv},i=0,length=channels.length;i',channel.Number&&(html+='

'+channel.Number+"

"),!hasChannelImage&&channel.Name&&(html+='
'+channel.Name+"
"),html+=""}var channelList=context.querySelector(".channelsContainer");channelList.innerHTML=html,imageLoader.lazyChildren(channelList)}function renderGuide(context,date,channels,programs,apiClient,focusProgramOnRender){var activeElement=document.activeElement,itemId=activeElement&&activeElement.getAttribute?activeElement.getAttribute("data-id"):null,channelRowId=null;activeElement&&(channelRowId=dom.parentWithClass(activeElement,"channelPrograms"),channelRowId=channelRowId&&channelRowId.getAttribute?channelRowId.getAttribute("data-channelid"):null),renderChannelHeaders(context,channels,apiClient);var startDate=date,endDate=new Date(startDate.getTime()+msPerDay);if(context.querySelector(".timeslotHeaders").innerHTML=getTimeslotHeadersHtml(startDate,endDate),startCurrentTimeUpdateInterval(),items={},renderPrograms(context,date,channels,programs),focusProgramOnRender){var focusElem;if(itemId&&(focusElem=context.querySelector('[data-id="'+itemId+'"]')),focusElem)focusManager.focus(focusElem);else{var autoFocusParent;channelRowId&&(autoFocusParent=context.querySelector('[data-channelid="'+channelRowId+'"]')),autoFocusParent||(autoFocusParent=context.querySelector(".programGrid")),focusManager.autoFocus(autoFocusParent,!0)}}}function nativeScrollTo(container,pos,horizontal){container.scrollTo?horizontal?container.scrollTo(pos,0):container.scrollTo(0,pos):horizontal?container.scrollLeft=Math.round(pos):container.scrollTop=Math.round(pos)}function onProgramGridScroll(context,elem,timeslotHeaders){(new Date).getTime()-lastHeaderScroll>=1e3&&(lastGridScroll=(new Date).getTime(),nativeScrollTo(timeslotHeaders,elem.scrollLeft,!0))}function onTimeslotHeadersScroll(context,elem,programGrid){(new Date).getTime()-lastGridScroll>=1e3&&(lastHeaderScroll=(new Date).getTime(),nativeScrollTo(programGrid,elem.scrollLeft,!0))}function changeDate(page,date,focusProgramOnRender){clearCurrentTimeUpdateInterval();var newStartDate=normalizeDateToTimeslot(date);currentDate=newStartDate,reloadGuide(page,newStartDate,focusProgramOnRender)}function getDateTabText(date,isActive,tabIndex){var cssClass=isActive?"emby-tab-button guide-date-tab-button emby-tab-button-active":"emby-tab-button guide-date-tab-button",html='"}function setDateRange(page,guideInfo){var today=new Date;today.setHours(today.getHours(),0,0,0);var start=datetime.parseISO8601Date(guideInfo.StartDate,{toLocal:!0}),end=datetime.parseISO8601Date(guideInfo.EndDate,{toLocal:!0});start.setHours(0,0,0,0),end.setHours(0,0,0,0),start.getTime()>=end.getTime()&&end.setDate(start.getDate()+1),start=new Date(Math.max(today,start));var dateTabsHtml="",tabIndex=0,date=new Date;for(currentDate&&date.setTime(currentDate.getTime());start<=end;){var isActive=date.getDate()===start.getDate()&&date.getMonth()===start.getMonth()&&date.getFullYear()===start.getFullYear();dateTabsHtml+=getDateTabText(start,isActive,tabIndex),start.setDate(start.getDate()+1),start.setHours(0,0,0,0),tabIndex++}page.querySelector(".emby-tabs-slider").innerHTML=dateTabsHtml,page.querySelector(".guideDateTabs").refresh(),changeDate(page,date,layoutManager.tv)}function reloadPage(page){showLoading();var apiClient=connectionManager.currentApiClient();apiClient.getLiveTvGuideInfo().then(function(guideInfo){setDateRange(page,guideInfo)})}function setScrollEvents(view,enabled){layoutManager.tv&&require(["scrollHelper"],function(scrollHelper){var fn=enabled?"on":"off";scrollHelper.centerFocus[fn](view.querySelector(".guideVerticalScroller"),!1),scrollHelper.centerFocus[fn](view.querySelector(".programGrid"),!0)})}function onProgramGridFocus(e){var programCell=dom.parentWithClass(e.target,"programCell");if(programCell){var focused=e.target,id=focused.getAttribute("data-id"),item=items[id];item&&events.trigger(self,"focus",[{item:item}])}}function onTimerCreated(e,apiClient,data){for(var programId=data.ProgramId,newTimerId=data.Id,cells=options.element.querySelectorAll('.programCell[data-id="'+programId+'"]'),i=0,length=cells.length;i'),newTimerId&&cell.setAttribute("data-timerid",newTimerId)}}function onSeriesTimerCreated(e,apiClient,data){}function onTimerCancelled(e,apiClient,data){for(var id=data.Id,cells=options.element.querySelectorAll('.programCell[data-timerid="'+id+'"]'),i=0,length=cells.length;i