diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/card.css b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/card.css index fb86177a5c..c14846e1e8 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,.cardBox,.cardContent,.textActionButton{-webkit-tap-highlight-color:transparent}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;outline:0!important;cursor:pointer;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-smallBackdrop{padding-bottom:56.25%}.cardPadder-overflowSquare,.cardPadder-square{padding-bottom:100%}.cardPadder-overflowPortrait,.cardPadder-portrait,.overflowPortraitCard-textCardPadder{padding-bottom:150%}.cardPadder-banner{padding-bottom:18.5%}.cardBox{padding:0!important;margin:.28em .4em;-webkit-transition:none;-o-transition:none;transition:none;border:0 solid transparent;outline:0!important}.layout-tv .cardBox{margin:.28em .45em}@media all and (max-width:50em){.cardBox{margin:.28em}}.card-focuscontent{border:.12em solid transparent;-webkit-border-radius:.12em;border-radius:.12em}.card-focuscontent-large{border-width:.24em}.cardBox-focustransform{will-change:transform;-webkit-transition:-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out;transition:transform .2s ease-out}.card:focus>.cardBox-focustransform{-webkit-transform:scale(1.16,1.16);transform:scale(1.16,1.16)}.cardBox-bottompadded{margin-bottom:1.9em!important}.layout-mobile .cardBox-bottompadded{margin-bottom:1.2em!important}.card:focus{position:relative!important;z-index:10!important}.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:1.6em;height:1.6em;-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:inherit;height:100%}.cardContent,.cardImage{position:absolute;right:0;top:0;left:0;bottom:0}.chapterCardImageContainer{background-color:#000;-webkit-border-radius:0;border-radius:0}.textCardImageContainer{background-color:#444}.cardContent{overflow:hidden;display:block;margin:0!important;height:100%;-webkit-border-radius:.12em;border-radius:.12em;outline:0!important}.visualCardBox .cardContent{-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0}.cardContent-shadow{-webkit-box-shadow:0 .0725em .29em 0 rgba(0,0,0,.37);box-shadow:0 .0725em .29em 0 rgba(0,0,0,.37)}.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}.cardFooter-transparent{padding-top:.26em}.layout-tv .cardFooter-transparent{padding-top:.1em}.visualCardBox{-webkit-box-shadow:0 .0725em .29em 0 rgba(0,0,0,.37);box-shadow:0 .0725em .29em 0 rgba(0,0,0,.37);-webkit-border-radius:.145em;border-radius:.145em}.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:.06em .5em;white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis}.cardDefaultText,.cardTextCentered{text-align:center}.innerCardFooter>.cardText{padding:.3em .5em}.cardFooter-withlogo{padding-left:4em;position:relative}.cardFooterLogo{position:absolute;top:0;bottom:0;left:0;width:4.5em;-webkit-background-size:70% auto;background-size:70% auto;background-repeat:no-repeat;background-position:center center}.card:focus .cardText{color:inherit}.cardText-rightmargin{margin-right:2em}.cardDefaultText{white-space:normal}.textActionButton{background:0 0;border:0!important;padding:0!important;cursor:pointer;outline:0!important;color:inherit;vertical-align:middle;font-family:inherit;font-size:inherit}.textActionButton:hover{text-decoration:underline}.cardImageIcon{width:auto;height:auto;font-size:5em;color:inherit}.cardIndicators{right:1.25%;top:1.25%;position:absolute;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.portraitCardIndicators{right:1.5%;top:1%}.backdropCardIndicators{right:.75%;top:1.4%}.cardProgramAttributeIndicators{top:0;left:0;position:absolute;display:-webkit-box;display:-webkit-flex;display:flex;text-transform:uppercase;font-size:92%}.programAttributeIndicator{padding:.18em .5em;color:#fff;font-weight:500}.cardOverlayButton{color:rgba(255,255,255,.76)!important;-webkit-border-radius:100em;border-radius:100em;position:absolute;bottom:0;right:0;margin:0 .35em .65em 0;z-index:1;padding:.5em;background-color:rgba(0,0,0,.7)!important;font-size:86%}.cardOverlayButton-centered{bottom:initial;right:initial;position:static;position:absolute;display:-webkit-box;display:-webkit-flex;display:flex;font-size:112%;margin:-1.3em 0 0 -1.3em;width:2.6em;height:2.6em;top:50%;left:50%;background-color:rgba(0,0,0,.5)!important;border:2.4px solid rgba(255,255,255,.6);padding:.38em!important;color:rgba(255,255,255,.76);-webkit-transition:-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out;transition:transform .2s ease-out}.cardOverlayButton-centered:hover{-webkit-transform:scale(1.2,1.2);transform:scale(1.2,1.2)}.cardOverlayButton-texticon{line-height:1;background-color:rgba(0,0,0,.4)!important}.cardOverlayButton-texticon-icon{font-style:normal}.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%}@media all and (min-width:400px){.backdropCard-scalable{width:50%}}@media all and (min-width:500px){.portraitCard-scalable,.smallBackdropCard-scalable,.squareCard-scalable{width:33.333333333333333333333333333333%}}@media all and (min-width:700px){.portraitCard-scalable,.squareCard-scalable{width:25%}}@media all and (min-width:770px){.backdropCard-scalable{width:33.333333333333333333333333333333%}}@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%}}@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%}}@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:1920px){.squareCard-scalable{width:11.111111111111111111111111111111%}}@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%}}.itemsContainer-tv>.backdropCard-scalable{width:25%}.itemsContainer-tv>.portraitCard-scalable,.itemsContainer-tv>.squareCard-scalable{width:16.666666666666666666666666666667%}@media all and (orientation:portrait){.overflowPortraitCard{width:42vw}.overflowBackdropCard{width:72vw}.overflowSquareCard{width:42vw}}@media all and (orientation:landscape){.overflowBackdropCard{width:23.3vw}.overflowPortraitCard,.overflowSquareCard{width:15.5vw}}@media all and (orientation:landscape) and (min-width:1700px){.overflowBackdropCard{width:18.5vw}.overflowPortraitCard,.overflowSquareCard{width:11.6vw}}@media all and (orientation:portrait) and (min-width:400px){.overflowPortraitCard{width:31.5vw}}@media all and (orientation:portrait) and (min-width:540px){.overflowBackdropCard{width:64vw}.overflowSquareCard{width:31.5vw}}@media all and (orientation:portrait) and (min-width:640px){.overflowBackdropCard{width:56vw}}@media all and (orientation:portrait) and (min-width:760px){.overflowPortraitCard{width:23vw}.overflowBackdropCard{width:40vw}.overflowSquareCard{width:23vw}}@media all and (orientation:portrait) and (min-width:1200px){.overflowPortraitCard,.overflowSquareCard{width:18vw}}@media all and (orientation:portrait) and (min-width:1400px){.overflowPortraitCard,.overflowSquareCard{width:15vw}.overflowBackdropCard{width:30vw}}@media all and (orientation:portrait) and (min-width:1800px){.overflowBackdropCard{width:23.5vw}}.itemsContainer-tv>.overflowBackdropCard{width:23.3vw}.overflowBackdropCard-textCard{width:15.5vw!important}.overflowBackdropCard-textCardPadder{padding-bottom:87.75%}.itemsContainer-tv>.overflowPortraitCard,.itemsContainer-tv>.overflowSquareCard{width:15.5vw} \ No newline at end of file +.card,.card:focus{font-weight:inherit!important}.card,.cardBox,.cardContent,.textActionButton{-webkit-tap-highlight-color:transparent}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;outline:0!important;cursor:pointer;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-mixedBackdrop,.cardPadder-overflowBackdrop,.cardPadder-smallBackdrop{padding-bottom:56.25%}.cardPadder-mixedSquare,.cardPadder-overflowSquare,.cardPadder-square{padding-bottom:100%}.cardPadder-mixedPortrait,.cardPadder-overflowPortrait,.cardPadder-portrait,.overflowPortraitCard-textCardPadder{padding-bottom:150%}.cardPadder-banner{padding-bottom:18.5%}.cardBox{padding:0!important;margin:.28em .4em;-webkit-transition:none;-o-transition:none;transition:none;border:0 solid transparent;outline:0!important}.layout-tv .cardBox{margin:.28em .45em}@media all and (max-width:50em){.cardBox{margin:.28em}}.card-focuscontent{border:.12em solid transparent;-webkit-border-radius:.12em;border-radius:.12em}.card-focuscontent-large{border-width:.24em}.cardBox-focustransform{will-change:transform;-webkit-transition:-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out;transition:transform .2s ease-out}.card:focus>.cardBox-focustransform{-webkit-transform:scale(1.16,1.16);transform:scale(1.16,1.16)}.cardBox-bottompadded{margin-bottom:1.9em!important}.layout-mobile .cardBox-bottompadded{margin-bottom:1.2em!important}.card:focus{position:relative!important;z-index:10!important}.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:1.6em;height:1.6em;-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:inherit;height:100%}.cardContent,.cardImage{position:absolute;right:0;top:0;left:0;bottom:0}.chapterCardImageContainer{background-color:#000;-webkit-border-radius:0;border-radius:0}.textCardImageContainer{background-color:#444}.cardContent{overflow:hidden;display:block;margin:0!important;height:100%;-webkit-border-radius:.12em;border-radius:.12em;outline:0!important}.visualCardBox .cardContent{-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0}.cardContent-shadow{-webkit-box-shadow:0 .0725em .29em 0 rgba(0,0,0,.37);box-shadow:0 .0725em .29em 0 rgba(0,0,0,.37)}.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}.cardFooter-transparent{padding-top:.26em}.layout-tv .cardFooter-transparent{padding-top:.1em}.visualCardBox{-webkit-box-shadow:0 .0725em .29em 0 rgba(0,0,0,.37);box-shadow:0 .0725em .29em 0 rgba(0,0,0,.37);-webkit-border-radius:.145em;border-radius:.145em}.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:.06em .5em;white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis}.cardDefaultText,.cardTextCentered{text-align:center}.innerCardFooter>.cardText{padding:.3em .5em}.cardFooter-withlogo{padding-left:4em;position:relative}.cardFooterLogo{position:absolute;top:0;bottom:0;left:0;width:4.5em;-webkit-background-size:70% auto;background-size:70% auto;background-repeat:no-repeat;background-position:center center}.card:focus .cardText{color:inherit}.cardText-rightmargin{margin-right:2em}.cardDefaultText{white-space:normal}.textActionButton{background:0 0;border:0!important;padding:0!important;cursor:pointer;outline:0!important;color:inherit;vertical-align:middle;font-family:inherit;font-size:inherit}.textActionButton:hover{text-decoration:underline}.cardImageIcon{width:auto;height:auto;font-size:5em;color:inherit}.cardIndicators{right:.225em;top:.225em;position:absolute;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.cardProgramAttributeIndicators{top:0;left:0;position:absolute;display:-webkit-box;display:-webkit-flex;display:flex;text-transform:uppercase;font-size:92%}.programAttributeIndicator{padding:.18em .5em;color:#fff;font-weight:500}.cardOverlayButton{color:rgba(255,255,255,.76)!important;-webkit-border-radius:100em;border-radius:100em;position:absolute;bottom:0;right:0;margin:0 .35em .65em 0;z-index:1;padding:.5em;background-color:rgba(0,0,0,.7)!important;font-size:86%}.cardOverlayButton-centered{bottom:initial;right:initial;position:static;position:absolute;display:-webkit-box;display:-webkit-flex;display:flex;font-size:112%;margin:-1.3em 0 0 -1.3em;width:2.6em;height:2.6em;top:50%;left:50%;background-color:rgba(0,0,0,.5)!important;border:2.4px solid rgba(255,255,255,.6);padding:.38em!important;color:rgba(255,255,255,.76);-webkit-transition:-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out;transition:transform .2s ease-out}.cardOverlayButton-centered:hover{-webkit-transform:scale(1.2,1.2);transform:scale(1.2,1.2)}.cardOverlayButton-texticon{line-height:1;background-color:rgba(0,0,0,.4)!important}.cardOverlayButton-texticon-icon{font-style:normal}.defaultCardColor1{background-color:#009688}.defaultCardColor2{background-color:#D32F2F}.defaultCardColor3{background-color:#0288D1}.defaultCardColor4{background-color:#388E3C}.defaultCardColor5{background-color:#F57F17}.backdropCard,.bannerCard{width:100%}.smallBackdropCard,.squareCard{width:50%}.portraitCard{width:33.333333333333333333333333333333%}.mixedPortraitCard{width:12em}.mixedSquareCard{width:18em}.mixedBackdropCard{width:32em}@media all and (min-width:400px){.backdropCard{width:50%}}@media all and (min-width:500px){.portraitCard,.smallBackdropCard,.squareCard{width:33.333333333333333333333333333333%}}@media all and (min-width:700px){.portraitCard,.squareCard{width:25%}}@media all and (min-width:770px){.backdropCard{width:33.333333333333333333333333333333%}}@media all and (min-width:800px){.bannerCard{width:50%}.portraitCard{width:20%}.smallBackdropCard{width:25%}}@media all and (min-width:900px){.squareCard{width:20%}}@media all and (min-width:1000px){.smallBackdropCard{width:20%}}@media all and (min-width:1200px){.backdropCard{width:25%}.squareCard{width:16.666666666666666666666666666667%}.bannerCard{width:33.333333333333333333333333333333%}.portraitCard,.smallBackdropCard{width:16.666666666666666666666666666667%}}@media all and (min-width:1400px){.portraitCard,.smallBackdropCard,.squareCard{width:14.285714285714285714285714285714%}}@media all and (min-width:1600px){.portraitCard,.smallBackdropCard{width:12.5%}.backdropCard{width:20%}.squareCard{width:12.5%}}@media all and (min-width:1920px){.squareCard{width:11.111111111111111111111111111111%}}@media all and (min-width:2100px){.backdropCard{width:20%}.portraitCard{width:11.111111111111111111111111111111%}}@media all and (min-width:2200px){.bannerCard{width:25%}.portraitCard{width:10%}}@media all and (min-width:2500px){.backdropCard{width:16.666666666666666666666666666667%}}.itemsContainer-tv>.backdropCard{width:25%}.itemsContainer-tv>.portraitCard,.itemsContainer-tv>.squareCard{width:16.666666666666666666666666666667%}@media all and (orientation:portrait){.overflowPortraitCard{width:42vw}.overflowBackdropCard{width:72vw}.overflowSquareCard{width:42vw}}@media all and (orientation:landscape){.overflowBackdropCard{width:23.3vw}.overflowPortraitCard,.overflowSquareCard{width:15.5vw}}@media all and (orientation:landscape) and (min-width:1700px){.overflowBackdropCard{width:18.5vw}.overflowPortraitCard,.overflowSquareCard{width:11.6vw}}@media all and (orientation:portrait) and (min-width:400px){.overflowPortraitCard{width:31.5vw}}@media all and (orientation:portrait) and (min-width:540px){.overflowBackdropCard{width:64vw}.overflowSquareCard{width:31.5vw}}@media all and (orientation:portrait) and (min-width:640px){.overflowBackdropCard{width:56vw}}@media all and (orientation:portrait) and (min-width:760px){.overflowPortraitCard{width:23vw}.overflowBackdropCard{width:40vw}.overflowSquareCard{width:23vw}}@media all and (orientation:portrait) and (min-width:1200px){.overflowPortraitCard,.overflowSquareCard{width:18vw}}@media all and (orientation:portrait) and (min-width:1400px){.overflowPortraitCard,.overflowSquareCard{width:15vw}.overflowBackdropCard{width:30vw}}@media all and (orientation:portrait) and (min-width:1800px){.overflowBackdropCard{width:23.5vw}}.itemsContainer-tv>.overflowBackdropCard{width:23.3vw}.overflowBackdropCard-textCard{width:15.5vw!important}.overflowBackdropCard-textCardPadder{padding-bottom:87.75%}.itemsContainer-tv>.overflowPortraitCard,.itemsContainer-tv>.overflowSquareCard{width:15.5vw} \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js index 43f84894da..dd6a0db2ff 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js +++ b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js @@ -1,2 +1,2 @@ -define(["datetime","imageLoader","connectionManager","itemHelper","focusManager","indicators","globalize","layoutManager","apphost","dom","browser","itemShortcuts","css!./card","paper-icon-button-light","clearButtonStyle","programStyles"],function(datetime,imageLoader,connectionManager,itemHelper,focusManager,indicators,globalize,layoutManager,appHost,dom,browser,itemShortcuts){"use strict";function getCardsHtml(items,options){1===arguments.length&&(options=arguments[0],items=options.items);var html=buildCardsHtmlInternal(items,options);return html}function getPostersPerRow(shape,screenWidth){switch(shape){case"portrait":return screenWidth>=2200?10:screenWidth>=2100?9:screenWidth>=1600?8:screenWidth>=1400?7:screenWidth>=1200?6:screenWidth>=800?5:screenWidth>=640?4:3;case"square":return screenWidth>=2100?9:screenWidth>=1800?8:screenWidth>=1400?7:screenWidth>=1200?6:screenWidth>=900?5:screenWidth>=700?4:screenWidth>=500?3:2;case"banner":return screenWidth>=2200?4:screenWidth>=1200?3:screenWidth>=800?2:1;case"backdrop":return screenWidth>=2500?6:screenWidth>=1600?5:screenWidth>=1200?4:screenWidth>=770?3:screenWidth>=420?2:1;case"smallBackdrop":return screenWidth>=1440?8:screenWidth>=1100?6:screenWidth>=800?5:screenWidth>=600?4:screenWidth>=540?3:screenWidth>=420?2:1;case"overflowPortrait":return screenWidth>=1e3?100/22:screenWidth>=540?100/30:100/42;case"overflowSquare":return screenWidth>=1e3?100/22:screenWidth>=540?100/30:100/42;case"overflowBackdrop":return screenWidth>=1e3?2.5:screenWidth>=640?100/56:screenWidth>=540?1.5625:100/72;default:return 4}}function isResizable(windowWidth){var screen=window.screen;if(screen){var screenWidth=screen.availWidth;if(screenWidth-windowWidth>20)return!0}return!1}function getImageWidth(shape){var screenWidth=dom.getWindowSize().innerWidth;if(isResizable(screenWidth)){var roundScreenTo=100;screenWidth=Math.floor(screenWidth/roundScreenTo)*roundScreenTo}window.screen&&(screenWidth=Math.min(screenWidth,screen.availWidth||screenWidth));var imagesPerRow=getPostersPerRow(shape,screenWidth),shapeWidth=screenWidth/imagesPerRow;return Math.round(shapeWidth)}function setCardData(items,options){options.shape=options.shape||"auto";var primaryImageAspectRatio=imageLoader.getPrimaryImageAspectRatio(items),isThumbAspectRatio=primaryImageAspectRatio&&Math.abs(primaryImageAspectRatio-1.777777778)<.3,isSquareAspectRatio=primaryImageAspectRatio&&Math.abs(primaryImageAspectRatio-1)<.33||primaryImageAspectRatio&&Math.abs(primaryImageAspectRatio-1.3333334)<.01;"auto"!==options.shape&&"autohome"!==options.shape&&"autooverflow"!==options.shape&&"autoVertical"!==options.shape||(options.preferThumb===!0||isThumbAspectRatio?options.shape="autooverflow"===options.shape?"overflowBackdrop":"backdrop":isSquareAspectRatio?(options.coverImage=!0,options.shape="autooverflow"===options.shape?"overflowSquare":"square"):primaryImageAspectRatio&&primaryImageAspectRatio>1.9?(options.shape="banner",options.coverImage=!0):primaryImageAspectRatio&&Math.abs(primaryImageAspectRatio-.6666667)<.2?options.shape="autooverflow"===options.shape?"overflowPortrait":"portrait":options.shape=options.defaultShape||("autooverflow"===options.shape?"overflowSquare":"square")),"auto"===options.preferThumb&&(options.preferThumb="backdrop"===options.shape||"overflowBackdrop"===options.shape),options.uiAspect=getDesiredAspect(options.shape),options.primaryImageAspectRatio=primaryImageAspectRatio,!options.width&&options.widths&&(options.width=options.widths[options.shape]),options.rows&&"number"!=typeof options.rows&&(options.rows=options.rows[options.shape]),layoutManager.tv&&("backdrop"===options.shape?options.width=options.width||500:"portrait"===options.shape?options.width=options.width||256:"square"===options.shape?options.width=options.width||256:"banner"===options.shape&&(options.width=options.width||800)),options.width=options.width||getImageWidth(options.shape)}function buildCardsHtmlInternal(items,options){var isVertical;"autoVertical"===options.shape&&(isVertical=!0),options.vibrant&&!appHost.supports("imageanalysis")&&(options.vibrant=!1),setCardData(items,options);var className="card";options.shape&&(className+=" "+options.shape+"Card"),options.cardCssClass&&(className+=" "+options.cardCssClass);var currentIndexValue,hasOpenRow,hasOpenSection,apiClient,lastServerId,i,length,html="",itemsInRow=0,sectionTitleTagName=options.sectionTitleTagName||"div";for(i=0,length=items.length;i=.5?.5:0)+"+":null);newIndexValue!==currentIndexValue&&(hasOpenRow&&(html+="",hasOpenRow=!1,itemsInRow=0),hasOpenSection&&(html+="",isVertical&&(html+=""),hasOpenSection=!1),html+=isVertical?'
':'
',html+="<"+sectionTitleTagName+' class="sectionTitle">'+newIndexValue+"",isVertical&&(html+='
'),currentIndexValue=newIndexValue,hasOpenSection=!0)}options.rows&&0===itemsInRow&&(hasOpenRow&&(html+="
",hasOpenRow=!1),html+='
',hasOpenRow=!0);var cardClass=className;html+=buildCard(i,item,apiClient,options,cardClass),itemsInRow++,options.rows&&itemsInRow>=options.rows&&(html+="
",hasOpenRow=!1,itemsInRow=0)}hasOpenRow&&(html+="
"),hasOpenSection&&(html+="
",isVertical&&(html+=""));var cardFooterHtml='
';for(i=0,length=options.lines;i 
';if(cardFooterHtml+="",options.leadingButtons)for(i=0,length=options.leadingButtons.length;i
'+options.leadingButtons[i].name+"
"+cardFooterHtml+"
"+html;if(options.trailingButtons)for(i=0,length=options.trailingButtons.length;i
'+options.trailingButtons[i].name+"
"+cardFooterHtml+"
";return html}function getDesiredAspect(shape){if(shape){if(shape=shape.toLowerCase(),shape.indexOf("portrait")!==-1)return 2/3;if(shape.indexOf("backdrop")!==-1)return 16/9;if(shape.indexOf("square")!==-1)return 1;if(shape.indexOf("banner")!==-1)return 1e3/185}return null}function getCardImageUrl(item,apiClient,options){var imageItem=item.ProgramInfo||item;item=imageItem;var width=options.width,height=null,primaryImageAspectRatio=imageLoader.getPrimaryImageAspectRatio([item]),forceName=!1,imgUrl=null,coverImage=!1,uiAspect=null;return options.preferThumb&&item.ImageTags&&item.ImageTags.Thumb?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Thumb",maxWidth:width,tag:item.ImageTags.Thumb}):options.preferBanner&&item.ImageTags&&item.ImageTags.Banner?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Banner",maxWidth:width,tag:item.ImageTags.Banner}):options.preferThumb&&item.SeriesThumbImageTag&&options.inheritThumb!==!1?imgUrl=apiClient.getScaledImageUrl(item.SeriesId,{type:"Thumb",maxWidth:width,tag:item.SeriesThumbImageTag}):options.preferThumb&&item.ParentThumbItemId&&options.inheritThumb!==!1&&"Photo"!==item.MediaType?imgUrl=apiClient.getScaledImageUrl(item.ParentThumbItemId,{type:"Thumb",maxWidth:width,tag:item.ParentThumbImageTag}):options.preferThumb&&item.BackdropImageTags&&item.BackdropImageTags.length?(imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Backdrop",maxWidth:width,tag:item.BackdropImageTags[0]}),forceName=!0):options.preferThumb&&item.ParentBackdropImageTags&&item.ParentBackdropImageTags.length&&options.inheritThumb!==!1&&"Episode"===item.Type?imgUrl=apiClient.getScaledImageUrl(item.ParentBackdropItemId,{type:"Backdrop",maxWidth:width,tag:item.ParentBackdropImageTags[0]}):item.ImageTags&&item.ImageTags.Primary?(height=width&&primaryImageAspectRatio?Math.round(width/primaryImageAspectRatio):null,imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Primary",maxHeight:height,maxWidth:width,tag:item.ImageTags.Primary}),options.preferThumb&&options.showTitle!==!1&&(forceName=!0),primaryImageAspectRatio&&(uiAspect=getDesiredAspect(options.shape),uiAspect&&(coverImage=Math.abs(primaryImageAspectRatio-uiAspect)<=.2))):item.PrimaryImageTag?(height=width&&primaryImageAspectRatio?Math.round(width/primaryImageAspectRatio):null,imgUrl=apiClient.getScaledImageUrl(item.PrimaryImageItemId||item.Id||item.ItemId,{type:"Primary",maxHeight:height,maxWidth:width,tag:item.PrimaryImageTag}),options.preferThumb&&options.showTitle!==!1&&(forceName=!0),primaryImageAspectRatio&&(uiAspect=getDesiredAspect(options.shape),uiAspect&&(coverImage=Math.abs(primaryImageAspectRatio-uiAspect)<=.2))):item.ParentPrimaryImageTag?imgUrl=apiClient.getScaledImageUrl(item.ParentPrimaryImageItemId,{type:"Primary",maxWidth:width,tag:item.ParentPrimaryImageTag}):item.SeriesPrimaryImageTag?imgUrl=apiClient.getScaledImageUrl(item.SeriesId,{type:"Primary",maxWidth:width,tag:item.SeriesPrimaryImageTag}):item.AlbumId&&item.AlbumPrimaryImageTag?(width=primaryImageAspectRatio?Math.round(height*primaryImageAspectRatio):null,imgUrl=apiClient.getScaledImageUrl(item.AlbumId,{type:"Primary",maxHeight:height,maxWidth:width,tag:item.AlbumPrimaryImageTag}),primaryImageAspectRatio&&(uiAspect=getDesiredAspect(options.shape),uiAspect&&(coverImage=Math.abs(primaryImageAspectRatio-uiAspect)<=.2))):"Season"===item.Type&&item.ImageTags&&item.ImageTags.Thumb?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Thumb",maxWidth:width,tag:item.ImageTags.Thumb}):item.BackdropImageTags&&item.BackdropImageTags.length?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Backdrop",maxWidth:width,tag:item.BackdropImageTags[0]}):item.ImageTags&&item.ImageTags.Thumb?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Thumb",maxWidth:width,tag:item.ImageTags.Thumb}):item.SeriesThumbImageTag&&options.inheritThumb!==!1?imgUrl=apiClient.getScaledImageUrl(item.SeriesId,{type:"Thumb",maxWidth:width,tag:item.SeriesThumbImageTag}):item.ParentThumbItemId&&options.inheritThumb!==!1?imgUrl=apiClient.getScaledImageUrl(item.ParentThumbItemId,{type:"Thumb",maxWidth:width,tag:item.ParentThumbImageTag}):item.ParentBackdropImageTags&&item.ParentBackdropImageTags.length&&options.inheritThumb!==!1&&(imgUrl=apiClient.getScaledImageUrl(item.ParentBackdropItemId,{type:"Backdrop",maxWidth:width,tag:item.ParentBackdropImageTags[0]})),{imgUrl:imgUrl,forceName:forceName,coverImage:coverImage}}function getRandomInt(min,max){return Math.floor(Math.random()*(max-min+1))+min}function getDefaultColorIndex(str){if(str){for(var charIndex=Math.floor(str.length/2),character=String(str.substr(charIndex,1).charCodeAt()),sum=0,i=0;i0&&isOuterFooter&&(currentCssClass+=" cardText-secondary"),addRightMargin&&(currentCssClass+=" cardText-rightmargin"),text&&(html+="
",html+=text,html+="
",valid++,maxLines&&valid>=maxLines))break}if(forceLines)for(length=maxLines||Math.min(lines.length,maxLines||lines.length);valid ",valid++;return html}function isUsingLiveTvNaming(item){return"Program"===item.Type||"Timer"===item.Type||"Recording"===item.Type}function getAirTimeText(item,showAirDateTime,showAirEndTime){var airTimeText="";if(item.StartDate)try{var date=datetime.parseISO8601Date(item.StartDate);showAirDateTime&&(airTimeText+=datetime.toLocaleDateString(date,{weekday:"short",month:"short",day:"numeric"})+" "),airTimeText+=datetime.getDisplayTime(date),item.EndDate&&showAirEndTime&&(date=datetime.parseISO8601Date(item.EndDate),airTimeText+=" - "+datetime.getDisplayTime(date))}catch(e){console.log("Error parsing date: "+item.StartDate)}return airTimeText}function getCardFooterText(item,apiClient,options,showTitle,forceName,overlayText,imgUrl,footerClass,progressHtml,isOuterFooter,cardFooterId,vibrantSwatch){var html="";if(options.showChannelLogo&&item.ChannelPrimaryImageTag){var logoHeight=40;html+=''}var showOtherText=isOuterFooter?!overlayText:overlayText;if(isOuterFooter&&options.cardLayout&&!layoutManager.tv&&"none"!==options.cardFooterAside){var moreIcon="dots-horiz"===appHost.moreIcon?"":"";html+='"}var titleAdded,cssClass=options.centerText?"cardText cardTextCentered":"cardText",lines=[],parentTitleUnderneath="MusicAlbum"===item.Type||"Audio"===item.Type||"MusicVideo"===item.Type;if(showOtherText&&(options.showParentTitle||options.showParentTitleOrTitle)&&!parentTitleUnderneath)if(isOuterFooter&&"Episode"===item.Type&&item.SeriesName&&item.SeriesId)lines.push(getTextActionButton({Id:item.SeriesId,ServerId:item.ServerId,Name:item.SeriesName,Type:"Series",IsFolder:!0}));else if(isUsingLiveTvNaming(item))lines.push(item.Name),item.EpisodeTitle||(titleAdded=!0);else{var parentTitle=item.SeriesName||item.Series||item.Album||item.AlbumArtist||item.GameSystem||"";(parentTitle||showTitle)&&lines.push(parentTitle)}var showMediaTitle=showTitle&&!titleAdded||options.showParentTitleOrTitle&&!lines.length;if(showMediaTitle||titleAdded||!showTitle&&!forceName||(showMediaTitle=!0),showMediaTitle){var name="auto"!==options.showTitle||item.IsFolder||"Photo"!==item.MediaType?itemHelper.getDisplayName(item,{includeParentInfo:options.includeParentInfoInTitle}):"";lines.push(name)}if(showOtherText){if(options.showParentTitle&&parentTitleUnderneath&&(isOuterFooter&&item.AlbumArtists&&item.AlbumArtists.length?(item.AlbumArtists[0].Type="MusicArtist",item.AlbumArtists[0].IsFolder=!0,lines.push(getTextActionButton(item.AlbumArtists[0],null,item.ServerId))):lines.push(isUsingLiveTvNaming(item)?item.Name:item.SeriesName||item.Series||item.Album||item.AlbumArtist||item.GameSystem||"")),options.showItemCounts){var itemCountHtml=getItemCountsHtml(options,item);lines.push(itemCountHtml)}if(options.textLines)for(var additionalLines=options.textLines(item),i=0,length=additionalLines.length;i"+html,html+=""}return html}function getTextActionButton(item,text,serverId){if(text||(text=itemHelper.getDisplayName(item)),layoutManager.tv)return text;var html=""}function getItemCountsHtml(options,item){var childText,counts=[];if("Playlist"===item.Type){if(childText="",item.RunTimeTicks){var minutes=item.RunTimeTicks/6e8;minutes=minutes||1,childText+=globalize.translate("sharedcomponents#ValueMinutes",Math.round(minutes))}else childText+=globalize.translate("sharedcomponents#ValueMinutes",0);counts.push(childText)}else"Genre"===item.Type||"Studio"===item.Type?(item.MovieCount&&(childText=1===item.MovieCount?globalize.translate("sharedcomponents#ValueOneMovie"):globalize.translate("sharedcomponents#ValueMovieCount",item.MovieCount),counts.push(childText)),item.SeriesCount&&(childText=1===item.SeriesCount?globalize.translate("sharedcomponents#ValueOneSeries"):globalize.translate("sharedcomponents#ValueSeriesCount",item.SeriesCount),counts.push(childText)),item.EpisodeCount&&(childText=1===item.EpisodeCount?globalize.translate("sharedcomponents#ValueOneEpisode"):globalize.translate("sharedcomponents#ValueEpisodeCount",item.EpisodeCount),counts.push(childText)),item.GameCount&&(childText=1===item.GameCount?globalize.translate("sharedcomponents#ValueOneGame"):globalize.translate("sharedcomponents#ValueGameCount",item.GameCount),counts.push(childText))):"GameGenre"===item.Type?item.GameCount&&(childText=1===item.GameCount?globalize.translate("sharedcomponents#ValueOneGame"):globalize.translate("sharedcomponents#ValueGameCount",item.GameCount),counts.push(childText)):"MusicGenre"===item.Type||"MusicArtist"===options.context?(item.AlbumCount&&(childText=1===item.AlbumCount?globalize.translate("sharedcomponents#ValueOneAlbum"):globalize.translate("sharedcomponents#ValueAlbumCount",item.AlbumCount),counts.push(childText)),item.SongCount&&(childText=1===item.SongCount?globalize.translate("sharedcomponents#ValueOneSong"):globalize.translate("sharedcomponents#ValueSongCount",item.SongCount),counts.push(childText)),item.MusicVideoCount&&(childText=1===item.MusicVideoCount?globalize.translate("sharedcomponents#ValueOneMusicVideo"):globalize.translate("sharedcomponents#ValueMusicVideoCount",item.MusicVideoCount),counts.push(childText))):"Series"===item.Type&&(childText=1===item.RecursiveItemCount?globalize.translate("sharedcomponents#ValueOneEpisode"):globalize.translate("sharedcomponents#ValueEpisodeCount",item.RecursiveItemCount),counts.push(childText));return counts.join(", ")}function requireRefreshIndicator(){refreshIndicatorLoaded||(refreshIndicatorLoaded=!0,require(["emby-itemrefreshindicator"]))}function buildCard(index,item,apiClient,options,className){var action=options.action||"link";"play"===action&&item.IsFolder?action="link":"Photo"===item.MediaType&&(action="play"),className+=" scalableCard "+options.shape+"Card-scalable",options.cardClass&&(className+=" "+options.cardClass);var imgInfo=getCardImageUrl(item,apiClient,options),imgUrl=imgInfo.imgUrl,forceName=imgInfo.forceName,showTitle="auto"===options.showTitle||(options.showTitle||"PhotoAlbum"===item.Type||"Folder"===item.Type),overlayText=options.overlayText;forceName&&!options.cardLayout&&null==overlayText&&(overlayText=!0);var cardImageContainerClass="cardImageContainer",coveredImage=options.coverImage||imgInfo.coverImage;coveredImage&&(cardImageContainerClass+=" coveredImage",("Photo"===item.MediaType||"PhotoAlbum"===item.Type||"Folder"===item.Type||item.ProgramInfo||"Program"===item.Type||"Recording"===item.Type)&&(cardImageContainerClass+=" coveredImage-noScale")),imgUrl||(cardImageContainerClass+=" "+getDefaultColorClass(item.Name));var cardBoxClass=options.cardLayout?"cardBox visualCardBox":"cardBox",enableFocusTransfrom=!browser.slow&&!browser.xboxOne&&!browser.edgeUwp;layoutManager.tv&&(enableFocusTransfrom&&(cardBoxClass+=" cardBox-focustransform"),options.cardLayout&&(cardBoxClass+=" card-focuscontent",enableFocusTransfrom||(cardBoxClass+=" card-focuscontent-large")));var footerCssClass,progressHtml=indicators.getProgressBarHtml(item),innerCardFooter="",footerOverlayed=!1,cardFooterId="cardFooter"+uniqueFooterIndex;uniqueFooterIndex++,overlayText?(footerCssClass=progressHtml?"innerCardFooter fullInnerCardFooter":"innerCardFooter",innerCardFooter+=getCardFooterText(item,apiClient,options,showTitle,forceName,overlayText,imgUrl,footerCssClass,progressHtml,!1,cardFooterId),footerOverlayed=!0):progressHtml&&(innerCardFooter+='
',innerCardFooter+=progressHtml,innerCardFooter+="
",progressHtml="");var mediaSourceCount=item.MediaSourceCount||1;mediaSourceCount>1&&(innerCardFooter+='
'+mediaSourceCount+"
");var vibrantSwatch=options.vibrant&&imgUrl?imageLoader.getCachedVibrantInfo(imgUrl):null,outerCardFooter="";overlayText||footerOverlayed||(footerCssClass=options.cardLayout?"cardFooter":"cardFooter cardFooter-transparent",options.showChannelLogo&&item.ChannelPrimaryImageTag&&(footerCssClass+=" cardFooter-withlogo"),outerCardFooter=getCardFooterText(item,apiClient,options,showTitle,forceName,overlayText,imgUrl,footerCssClass,progressHtml,!0,cardFooterId,vibrantSwatch)),outerCardFooter&&!options.cardLayout&&(cardBoxClass+=" cardBox-bottompadded");var overlayButtons="";if(!layoutManager.tv){var overlayPlayButton=options.overlayPlayButton;null!=overlayPlayButton||options.overlayMoreButton||options.overlayInfoButton||options.cardLayout||(overlayPlayButton="Video"===item.MediaType);var btnCssClass="cardOverlayButton itemAction";if(options.centerPlayButton&&(overlayButtons+=''),!overlayPlayButton||item.IsPlaceHolder||"Virtual"===item.LocationType&&item.MediaType&&"Program"!==item.Type||"Person"===item.Type||(overlayButtons+=''),options.overlayMoreButton){var moreIcon="dots-horiz"===appHost.moreIcon?"":"";overlayButtons+='"}options.overlayInfoButton&&(overlayButtons+='')}options.showChildCountIndicator&&item.ChildCount&&(className+=" groupedCard");var cardImageContainerOpen,cardContentOpen,cardImageContainerClose="",cardBoxClose="",cardContentClose="",cardScalableClose="",cardContentClass="cardContent";options.cardLayout||(cardContentClass+=" cardContent-shadow"),layoutManager.tv?(cardContentOpen='
',cardContentClose="
"):(cardContentOpen='");var vibrantAttributes=options.vibrant&&imgUrl&&!vibrantSwatch?' data-vibrant="'+cardFooterId+'" data-swatch="db"':"";if(vibrantAttributes&&!browser.safari){cardImageContainerOpen='
';var imgClass="cardImage cardImage-img lazy";coveredImage&&(imgClass+=1===devicePixelRatio?" coveredImage-noscale-img":" coveredImage-img"),cardImageContainerOpen+=''}else cardImageContainerOpen=imgUrl?'
':'
';var cardScalableClass="cardScalable";layoutManager.tv&&!options.cardLayout&&(cardScalableClass+=" card-focuscontent",enableFocusTransfrom||(cardScalableClass+=" card-focuscontent-large")),cardImageContainerOpen='
'+cardContentOpen+cardImageContainerOpen,cardBoxClose="
",cardScalableClose="
",cardImageContainerClose="
";var indicatorsHtml="";if(indicatorsHtml+=indicators.getSyncIndicator(item),indicatorsHtml+=indicators.getTimerIndicator(item),indicatorsHtml+=indicators.getTypeIndicator(item),indicatorsHtml+=options.showGroupCount?indicators.getChildCountIndicatorHtml(item,{minCount:1}):indicators.getPlayedIndicatorHtml(item),"CollectionFolder"===item.Type||item.CollectionType){var refreshClass=item.RefreshProgress||item.RefreshStatus&&"Idle"!==virtualFolder.item?"":' class="hide"';indicatorsHtml+='
',requireRefreshIndicator()}if(indicatorsHtml&&(cardImageContainerOpen+='
'+indicatorsHtml+"
"),!imgUrl){var defaultName=isUsingLiveTvNaming(item)?item.Name:itemHelper.getDisplayName(item);cardImageContainerOpen+='
'+defaultName+"
"}var tagName=layoutManager.tv&&!overlayButtons?"button":"div",nameWithPrefix=item.SortName||item.Name||"",prefix=nameWithPrefix.substring(0,Math.min(3,nameWithPrefix.length));prefix&&(prefix=prefix.toUpperCase());var timerAttributes="";item.TimerId&&(timerAttributes+=' data-timerid="'+item.TimerId+'"'),item.SeriesTimerId&&(timerAttributes+=' data-seriestimerid="'+item.SeriesTimerId+'"');var actionAttribute;"button"===tagName?(className+=" itemAction",actionAttribute=' data-action="'+action+'"'):actionAttribute="","MusicAlbum"!==item.Type&&"MusicArtist"!==item.Type&&"Audio"!==item.Type&&(className+=" card-withuserdata");var positionTicksData=item.UserData&&item.UserData.PlaybackPositionTicks?' data-positionticks="'+item.UserData.PlaybackPositionTicks+'"':"",collectionIdData=options.collectionId?' data-collectionid="'+options.collectionId+'"':"",playlistIdData=options.playlistId?' data-playlistid="'+options.playlistId+'"':"",mediaTypeData=item.MediaType?' data-mediatype="'+item.MediaType+'"':"",collectionTypeData=item.CollectionType?' data-collectiontype="'+item.CollectionType+'"':"",channelIdData=item.ChannelId?' data-channelid="'+item.ChannelId+'"':"",contextData=options.context?' data-context="'+options.context+'"':"",parentIdData=options.parentId?' data-parentid="'+options.parentId+'"':"";return"<"+tagName+' data-index="'+index+'"'+timerAttributes+actionAttribute+' data-isfolder="'+(item.IsFolder||!1)+'" data-serverid="'+(item.ServerId||options.serverId)+'" data-id="'+(item.Id||item.ItemId)+'" data-type="'+item.Type+'"'+mediaTypeData+collectionTypeData+channelIdData+positionTicksData+collectionIdData+playlistIdData+contextData+parentIdData+' data-prefix="'+prefix+'" class="'+className+'">'+cardImageContainerOpen+innerCardFooter+cardImageContainerClose+cardContentClose+overlayButtons+cardScalableClose+outerCardFooter+cardBoxClose+""}function buildCards(items,options){if(document.body.contains(options.itemsContainer)){if(options.parentContainer){if(!items.length)return void options.parentContainer.classList.add("hide");options.parentContainer.classList.remove("hide")}var html=buildCardsHtmlInternal(items,options);html?(options.itemsContainer.cardBuilderHtml!==html&&(options.itemsContainer.innerHTML=html,items.length<50?options.itemsContainer.cardBuilderHtml=html:options.itemsContainer.cardBuilderHtml=null),imageLoader.lazyChildren(options.itemsContainer)):(options.itemsContainer.innerHTML=html,options.itemsContainer.cardBuilderHtml=null),options.autoFocus&&focusManager.autoFocus(options.itemsContainer,!0)}}function ensureIndicators(card,indicatorsElem){if(indicatorsElem)return indicatorsElem;if(indicatorsElem=card.querySelector(".cardIndicators"),!indicatorsElem){var cardImageContainer=card.querySelector(".cardImageContainer");indicatorsElem=document.createElement("div"),indicatorsElem.classList.add("cardIndicators"),cardImageContainer.appendChild(indicatorsElem)}return indicatorsElem}function updateUserData(card,userData){var type=card.getAttribute("data-type"),enableCountIndicator="Series"===type||"BoxSet"===type||"Season"===type,indicatorsElem=null,playedIndicator=null,countIndicator=null,itemProgressBar=null;userData.Played?(playedIndicator=card.querySelector(".playedIndicator"),playedIndicator||(playedIndicator=document.createElement("div"),playedIndicator.classList.add("playedIndicator"),playedIndicator.classList.add("indicator"),indicatorsElem=ensureIndicators(card,indicatorsElem),indicatorsElem.appendChild(playedIndicator)),playedIndicator.innerHTML=''):(playedIndicator=card.querySelector(".playedIndicator"), -playedIndicator&&playedIndicator.parentNode.removeChild(playedIndicator)),userData.UnplayedItemCount?(countIndicator=card.querySelector(".countIndicator"),countIndicator||(countIndicator=document.createElement("div"),countIndicator.classList.add("countIndicator"),indicatorsElem=ensureIndicators(card,indicatorsElem),indicatorsElem.appendChild(countIndicator)),countIndicator.innerHTML=userData.UnplayedItemCount):enableCountIndicator&&(countIndicator=card.querySelector(".countIndicator"),countIndicator&&countIndicator.parentNode.removeChild(countIndicator));var progressHtml=indicators.getProgressBarHtml({Type:type,UserData:userData,MediaType:"Video"});if(progressHtml){if(itemProgressBar=card.querySelector(".itemProgressBar"),!itemProgressBar){itemProgressBar=document.createElement("div"),itemProgressBar.classList.add("itemProgressBar");var innerCardFooter=card.querySelector(".innerCardFooter");if(!innerCardFooter){innerCardFooter=document.createElement("div"),innerCardFooter.classList.add("innerCardFooter");var cardImageContainer=card.querySelector(".cardImageContainer");cardImageContainer.appendChild(innerCardFooter)}innerCardFooter.appendChild(itemProgressBar)}itemProgressBar.innerHTML=progressHtml}else itemProgressBar=card.querySelector(".itemProgressBar"),itemProgressBar&&itemProgressBar.parentNode.removeChild(itemProgressBar)}function onUserDataChanged(userData,scope){for(var cards=(scope||document.body).querySelectorAll('.card-withuserdata[data-id="'+userData.ItemId+'"]'),i=0,length=cards.length;i')}cell.setAttribute("data-timerid",newTimerId)}}function onTimerCancelled(id,itemsContainer){for(var cells=itemsContainer.querySelectorAll('.card[data-timerid="'+id+'"]'),i=0,length=cells.length;i=2200?10:screenWidth>=2100?9:screenWidth>=1600?8:screenWidth>=1400?7:screenWidth>=1200?6:screenWidth>=800?5:screenWidth>=640?4:3;case"square":return screenWidth>=2100?9:screenWidth>=1800?8:screenWidth>=1400?7:screenWidth>=1200?6:screenWidth>=900?5:screenWidth>=700?4:screenWidth>=500?3:2;case"banner":return screenWidth>=2200?4:screenWidth>=1200?3:screenWidth>=800?2:1;case"backdrop":return screenWidth>=2500?6:screenWidth>=1600?5:screenWidth>=1200?4:screenWidth>=770?3:screenWidth>=420?2:1;case"smallBackdrop":return screenWidth>=1440?8:screenWidth>=1100?6:screenWidth>=800?5:screenWidth>=600?4:screenWidth>=540?3:screenWidth>=420?2:1;case"overflowPortrait":return screenWidth>=1e3?100/22:screenWidth>=540?100/30:100/42;case"overflowSquare":return screenWidth>=1e3?100/22:screenWidth>=540?100/30:100/42;case"overflowBackdrop":return screenWidth>=1e3?2.5:screenWidth>=640?100/56:screenWidth>=540?1.5625:100/72;default:return 4}}function isResizable(windowWidth){var screen=window.screen;if(screen){var screenWidth=screen.availWidth;if(screenWidth-windowWidth>20)return!0}return!1}function getImageWidth(shape){var screenWidth=dom.getWindowSize().innerWidth;if(isResizable(screenWidth)){var roundScreenTo=100;screenWidth=Math.floor(screenWidth/roundScreenTo)*roundScreenTo}window.screen&&(screenWidth=Math.min(screenWidth,screen.availWidth||screenWidth));var imagesPerRow=getPostersPerRow(shape,screenWidth),shapeWidth=screenWidth/imagesPerRow;return Math.round(shapeWidth)}function setCardData(items,options){options.shape=options.shape||"auto";var primaryImageAspectRatio=imageLoader.getPrimaryImageAspectRatio(items);"auto"!==options.shape&&"autohome"!==options.shape&&"autooverflow"!==options.shape&&"autoVertical"!==options.shape||(options.shape=null,primaryImageAspectRatio&&(primaryImageAspectRatio>1.9?(options.shape="banner",options.coverImage=!0):primaryImageAspectRatio>=1.33?options.shape="autooverflow"===options.shape?"overflowBackdrop":"backdrop":primaryImageAspectRatio>.71?options.shape="autooverflow"===options.shape?"overflowSquare":"square":options.shape="autooverflow"===options.shape?"overflowPortrait":"portrait"),options.shape||(options.shape=options.defaultShape||("autooverflow"===options.shape?"overflowSquare":"square"))),"auto"===options.preferThumb&&(options.preferThumb="backdrop"===options.shape||"overflowBackdrop"===options.shape),options.uiAspect=getDesiredAspect(options.shape),options.primaryImageAspectRatio=primaryImageAspectRatio,!options.width&&options.widths&&(options.width=options.widths[options.shape]),options.rows&&"number"!=typeof options.rows&&(options.rows=options.rows[options.shape]),layoutManager.tv&&("backdrop"===options.shape?options.width=options.width||500:"portrait"===options.shape?options.width=options.width||256:"square"===options.shape?options.width=options.width||256:"banner"===options.shape&&(options.width=options.width||800)),options.width=options.width||getImageWidth(options.shape)}function buildCardsHtmlInternal(items,options){var isVertical;"autoVertical"===options.shape&&(isVertical=!0),options.vibrant&&!appHost.supports("imageanalysis")&&(options.vibrant=!1),setCardData(items,options);var currentIndexValue,hasOpenRow,hasOpenSection,apiClient,lastServerId,i,length,html="",itemsInRow=0,sectionTitleTagName=options.sectionTitleTagName||"div";for(i=0,length=items.length;i=.5?.5:0)+"+":null);newIndexValue!==currentIndexValue&&(hasOpenRow&&(html+="
",hasOpenRow=!1,itemsInRow=0),hasOpenSection&&(html+="
",isVertical&&(html+=""),hasOpenSection=!1),html+=isVertical?'
':'
',html+="<"+sectionTitleTagName+' class="sectionTitle">'+newIndexValue+"",isVertical&&(html+='
'),currentIndexValue=newIndexValue,hasOpenSection=!0)}options.rows&&0===itemsInRow&&(hasOpenRow&&(html+="
",hasOpenRow=!1),html+='
',hasOpenRow=!0),html+=buildCard(i,item,apiClient,options),itemsInRow++,options.rows&&itemsInRow>=options.rows&&(html+="
",hasOpenRow=!1,itemsInRow=0)}hasOpenRow&&(html+="
"),hasOpenSection&&(html+="
",isVertical&&(html+=""));var cardFooterHtml='
';for(i=0,length=options.lines;i 
';if(cardFooterHtml+="",options.leadingButtons)for(i=0,length=options.leadingButtons.length;i
'+options.leadingButtons[i].name+"
"+cardFooterHtml+"
"+html;if(options.trailingButtons)for(i=0,length=options.trailingButtons.length;i
'+options.trailingButtons[i].name+"
"+cardFooterHtml+"
";return html}function getDesiredAspect(shape){if(shape){if(shape=shape.toLowerCase(),shape.indexOf("portrait")!==-1)return 2/3;if(shape.indexOf("backdrop")!==-1)return 16/9;if(shape.indexOf("square")!==-1)return 1;if(shape.indexOf("banner")!==-1)return 1e3/185}return null}function getCardImageUrl(item,apiClient,options,shape){var imageItem=item.ProgramInfo||item;item=imageItem;var width=options.width,height=null,primaryImageAspectRatio=item.PrimaryImageAspectRatio,forceName=!1,imgUrl=null,coverImage=!1,uiAspect=null;return options.preferThumb&&item.ImageTags&&item.ImageTags.Thumb?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Thumb",maxWidth:width,tag:item.ImageTags.Thumb}):options.preferBanner&&item.ImageTags&&item.ImageTags.Banner?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Banner",maxWidth:width,tag:item.ImageTags.Banner}):options.preferThumb&&item.SeriesThumbImageTag&&options.inheritThumb!==!1?imgUrl=apiClient.getScaledImageUrl(item.SeriesId,{type:"Thumb",maxWidth:width,tag:item.SeriesThumbImageTag}):options.preferThumb&&item.ParentThumbItemId&&options.inheritThumb!==!1&&"Photo"!==item.MediaType?imgUrl=apiClient.getScaledImageUrl(item.ParentThumbItemId,{type:"Thumb",maxWidth:width,tag:item.ParentThumbImageTag}):options.preferThumb&&item.BackdropImageTags&&item.BackdropImageTags.length?(imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Backdrop",maxWidth:width,tag:item.BackdropImageTags[0]}),forceName=!0):options.preferThumb&&item.ParentBackdropImageTags&&item.ParentBackdropImageTags.length&&options.inheritThumb!==!1&&"Episode"===item.Type?imgUrl=apiClient.getScaledImageUrl(item.ParentBackdropItemId,{type:"Backdrop",maxWidth:width,tag:item.ParentBackdropImageTags[0]}):item.ImageTags&&item.ImageTags.Primary?(height=width&&primaryImageAspectRatio?Math.round(width/primaryImageAspectRatio):null,imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Primary",maxHeight:height,maxWidth:width,tag:item.ImageTags.Primary}),options.preferThumb&&options.showTitle!==!1&&(forceName=!0),primaryImageAspectRatio&&(uiAspect=getDesiredAspect(shape),uiAspect&&(coverImage=Math.abs(primaryImageAspectRatio-uiAspect)/uiAspect<=.2))):item.PrimaryImageTag?(height=width&&primaryImageAspectRatio?Math.round(width/primaryImageAspectRatio):null,imgUrl=apiClient.getScaledImageUrl(item.PrimaryImageItemId||item.Id||item.ItemId,{type:"Primary",maxHeight:height,maxWidth:width,tag:item.PrimaryImageTag}),options.preferThumb&&options.showTitle!==!1&&(forceName=!0),primaryImageAspectRatio&&(uiAspect=getDesiredAspect(shape),uiAspect&&(coverImage=Math.abs(primaryImageAspectRatio-uiAspect)/uiAspect<=.2))):item.ParentPrimaryImageTag?imgUrl=apiClient.getScaledImageUrl(item.ParentPrimaryImageItemId,{type:"Primary",maxWidth:width,tag:item.ParentPrimaryImageTag}):item.SeriesPrimaryImageTag?imgUrl=apiClient.getScaledImageUrl(item.SeriesId,{type:"Primary",maxWidth:width,tag:item.SeriesPrimaryImageTag}):item.AlbumId&&item.AlbumPrimaryImageTag?(width=primaryImageAspectRatio?Math.round(height*primaryImageAspectRatio):null,imgUrl=apiClient.getScaledImageUrl(item.AlbumId,{type:"Primary",maxHeight:height,maxWidth:width,tag:item.AlbumPrimaryImageTag}),primaryImageAspectRatio&&(uiAspect=getDesiredAspect(shape),uiAspect&&(coverImage=Math.abs(primaryImageAspectRatio-uiAspect)/uiAspect<=.2))):"Season"===item.Type&&item.ImageTags&&item.ImageTags.Thumb?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Thumb",maxWidth:width,tag:item.ImageTags.Thumb}):item.BackdropImageTags&&item.BackdropImageTags.length?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Backdrop",maxWidth:width,tag:item.BackdropImageTags[0]}):item.ImageTags&&item.ImageTags.Thumb?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Thumb",maxWidth:width,tag:item.ImageTags.Thumb}):item.SeriesThumbImageTag&&options.inheritThumb!==!1?imgUrl=apiClient.getScaledImageUrl(item.SeriesId,{type:"Thumb",maxWidth:width,tag:item.SeriesThumbImageTag}):item.ParentThumbItemId&&options.inheritThumb!==!1?imgUrl=apiClient.getScaledImageUrl(item.ParentThumbItemId,{type:"Thumb",maxWidth:width,tag:item.ParentThumbImageTag}):item.ParentBackdropImageTags&&item.ParentBackdropImageTags.length&&options.inheritThumb!==!1&&(imgUrl=apiClient.getScaledImageUrl(item.ParentBackdropItemId,{type:"Backdrop",maxWidth:width,tag:item.ParentBackdropImageTags[0]})),{imgUrl:imgUrl,forceName:forceName,coverImage:coverImage}}function getRandomInt(min,max){return Math.floor(Math.random()*(max-min+1))+min}function getDefaultColorIndex(str){if(str){for(var charIndex=Math.floor(str.length/2),character=String(str.substr(charIndex,1).charCodeAt()),sum=0,i=0;i0&&isOuterFooter&&(currentCssClass+=" cardText-secondary"),addRightMargin&&(currentCssClass+=" cardText-rightmargin"),text&&(html+="
",html+=text,html+="
",valid++,maxLines&&valid>=maxLines))break}if(forceLines)for(length=maxLines||Math.min(lines.length,maxLines||lines.length);valid ",valid++;return html}function isUsingLiveTvNaming(item){return"Program"===item.Type||"Timer"===item.Type||"Recording"===item.Type}function getAirTimeText(item,showAirDateTime,showAirEndTime){var airTimeText="";if(item.StartDate)try{var date=datetime.parseISO8601Date(item.StartDate);showAirDateTime&&(airTimeText+=datetime.toLocaleDateString(date,{weekday:"short",month:"short",day:"numeric"})+" "),airTimeText+=datetime.getDisplayTime(date),item.EndDate&&showAirEndTime&&(date=datetime.parseISO8601Date(item.EndDate),airTimeText+=" - "+datetime.getDisplayTime(date))}catch(e){console.log("Error parsing date: "+item.StartDate)}return airTimeText}function getCardFooterText(item,apiClient,options,showTitle,forceName,overlayText,imgUrl,footerClass,progressHtml,isOuterFooter,cardFooterId,vibrantSwatch){var html="";if(options.showChannelLogo&&item.ChannelPrimaryImageTag){var logoHeight=40;html+=''}var showOtherText=isOuterFooter?!overlayText:overlayText;if(isOuterFooter&&options.cardLayout&&!layoutManager.tv&&"none"!==options.cardFooterAside){var moreIcon="dots-horiz"===appHost.moreIcon?"":"";html+='"}var titleAdded,cssClass=options.centerText?"cardText cardTextCentered":"cardText",lines=[],parentTitleUnderneath="MusicAlbum"===item.Type||"Audio"===item.Type||"MusicVideo"===item.Type;if(showOtherText&&(options.showParentTitle||options.showParentTitleOrTitle)&&!parentTitleUnderneath)if(isOuterFooter&&"Episode"===item.Type&&item.SeriesName&&item.SeriesId)lines.push(getTextActionButton({Id:item.SeriesId,ServerId:item.ServerId,Name:item.SeriesName,Type:"Series",IsFolder:!0}));else if(isUsingLiveTvNaming(item))lines.push(item.Name),item.EpisodeTitle||(titleAdded=!0);else{var parentTitle=item.SeriesName||item.Series||item.Album||item.AlbumArtist||item.GameSystem||"";(parentTitle||showTitle)&&lines.push(parentTitle)}var showMediaTitle=showTitle&&!titleAdded||options.showParentTitleOrTitle&&!lines.length;if(showMediaTitle||titleAdded||!showTitle&&!forceName||(showMediaTitle=!0),showMediaTitle){var name="auto"!==options.showTitle||item.IsFolder||"Photo"!==item.MediaType?itemHelper.getDisplayName(item,{includeParentInfo:options.includeParentInfoInTitle}):"";lines.push(name)}if(showOtherText){if(options.showParentTitle&&parentTitleUnderneath&&(isOuterFooter&&item.AlbumArtists&&item.AlbumArtists.length?(item.AlbumArtists[0].Type="MusicArtist",item.AlbumArtists[0].IsFolder=!0,lines.push(getTextActionButton(item.AlbumArtists[0],null,item.ServerId))):lines.push(isUsingLiveTvNaming(item)?item.Name:item.SeriesName||item.Series||item.Album||item.AlbumArtist||item.GameSystem||"")),options.showItemCounts){var itemCountHtml=getItemCountsHtml(options,item);lines.push(itemCountHtml)}if(options.textLines)for(var additionalLines=options.textLines(item),i=0,length=additionalLines.length;i"+html,html+=""}return html}function getTextActionButton(item,text,serverId){if(text||(text=itemHelper.getDisplayName(item)),layoutManager.tv)return text;var html=""}function getItemCountsHtml(options,item){var childText,counts=[];if("Playlist"===item.Type){if(childText="",item.RunTimeTicks){var minutes=item.RunTimeTicks/6e8;minutes=minutes||1,childText+=globalize.translate("sharedcomponents#ValueMinutes",Math.round(minutes))}else childText+=globalize.translate("sharedcomponents#ValueMinutes",0);counts.push(childText)}else"Genre"===item.Type||"Studio"===item.Type?(item.MovieCount&&(childText=1===item.MovieCount?globalize.translate("sharedcomponents#ValueOneMovie"):globalize.translate("sharedcomponents#ValueMovieCount",item.MovieCount),counts.push(childText)),item.SeriesCount&&(childText=1===item.SeriesCount?globalize.translate("sharedcomponents#ValueOneSeries"):globalize.translate("sharedcomponents#ValueSeriesCount",item.SeriesCount),counts.push(childText)),item.EpisodeCount&&(childText=1===item.EpisodeCount?globalize.translate("sharedcomponents#ValueOneEpisode"):globalize.translate("sharedcomponents#ValueEpisodeCount",item.EpisodeCount),counts.push(childText)),item.GameCount&&(childText=1===item.GameCount?globalize.translate("sharedcomponents#ValueOneGame"):globalize.translate("sharedcomponents#ValueGameCount",item.GameCount),counts.push(childText))):"GameGenre"===item.Type?item.GameCount&&(childText=1===item.GameCount?globalize.translate("sharedcomponents#ValueOneGame"):globalize.translate("sharedcomponents#ValueGameCount",item.GameCount),counts.push(childText)):"MusicGenre"===item.Type||"MusicArtist"===options.context?(item.AlbumCount&&(childText=1===item.AlbumCount?globalize.translate("sharedcomponents#ValueOneAlbum"):globalize.translate("sharedcomponents#ValueAlbumCount",item.AlbumCount),counts.push(childText)),item.SongCount&&(childText=1===item.SongCount?globalize.translate("sharedcomponents#ValueOneSong"):globalize.translate("sharedcomponents#ValueSongCount",item.SongCount),counts.push(childText)),item.MusicVideoCount&&(childText=1===item.MusicVideoCount?globalize.translate("sharedcomponents#ValueOneMusicVideo"):globalize.translate("sharedcomponents#ValueMusicVideoCount",item.MusicVideoCount),counts.push(childText))):"Series"===item.Type&&(childText=1===item.RecursiveItemCount?globalize.translate("sharedcomponents#ValueOneEpisode"):globalize.translate("sharedcomponents#ValueEpisodeCount",item.RecursiveItemCount),counts.push(childText));return counts.join(", ")}function requireRefreshIndicator(){refreshIndicatorLoaded||(refreshIndicatorLoaded=!0,require(["emby-itemrefreshindicator"]))}function buildCard(index,item,apiClient,options){var action=options.action||"link";"play"===action&&item.IsFolder?action="link":"Photo"===item.MediaType&&(action="play");var shape=options.shape;if("mixed"===shape){shape=null;var primaryImageAspectRatio=item.PrimaryImageAspectRatio;primaryImageAspectRatio&&(shape=primaryImageAspectRatio>=1.33?"mixedBackdrop":primaryImageAspectRatio>.71?"mixedSquare":"mixedPortrait"),shape=shape||"mixedSquare"}var className="card";shape&&(className+=" "+shape+"Card"),options.cardCssClass&&(className+=" "+options.cardCssClass),options.cardClass&&(className+=" "+options.cardClass);var imgInfo=getCardImageUrl(item,apiClient,options,shape),imgUrl=imgInfo.imgUrl,forceName=imgInfo.forceName,showTitle="auto"===options.showTitle||(options.showTitle||"PhotoAlbum"===item.Type||"Folder"===item.Type),overlayText=options.overlayText;forceName&&!options.cardLayout&&null==overlayText&&(overlayText=!0);var cardImageContainerClass="cardImageContainer",coveredImage=options.coverImage||imgInfo.coverImage;coveredImage&&(cardImageContainerClass+=" coveredImage",("Photo"===item.MediaType||"PhotoAlbum"===item.Type||"Folder"===item.Type||item.ProgramInfo||"Program"===item.Type||"Recording"===item.Type)&&(cardImageContainerClass+=" coveredImage-noScale")),imgUrl||(cardImageContainerClass+=" "+getDefaultColorClass(item.Name));var cardBoxClass=options.cardLayout?"cardBox visualCardBox":"cardBox",enableFocusTransfrom=!browser.slow&&!browser.xboxOne&&!browser.edgeUwp;layoutManager.tv&&(enableFocusTransfrom&&(cardBoxClass+=" cardBox-focustransform"),options.cardLayout&&(cardBoxClass+=" card-focuscontent",enableFocusTransfrom||(cardBoxClass+=" card-focuscontent-large")));var footerCssClass,progressHtml=indicators.getProgressBarHtml(item),innerCardFooter="",footerOverlayed=!1,cardFooterId="cardFooter"+uniqueFooterIndex;uniqueFooterIndex++,overlayText?(footerCssClass=progressHtml?"innerCardFooter fullInnerCardFooter":"innerCardFooter",innerCardFooter+=getCardFooterText(item,apiClient,options,showTitle,forceName,overlayText,imgUrl,footerCssClass,progressHtml,!1,cardFooterId),footerOverlayed=!0):progressHtml&&(innerCardFooter+='
',innerCardFooter+=progressHtml,innerCardFooter+="
",progressHtml="");var mediaSourceCount=item.MediaSourceCount||1;mediaSourceCount>1&&(innerCardFooter+='
'+mediaSourceCount+"
");var vibrantSwatch=options.vibrant&&imgUrl?imageLoader.getCachedVibrantInfo(imgUrl):null,outerCardFooter="";overlayText||footerOverlayed||(footerCssClass=options.cardLayout?"cardFooter":"cardFooter cardFooter-transparent",options.showChannelLogo&&item.ChannelPrimaryImageTag&&(footerCssClass+=" cardFooter-withlogo"),outerCardFooter=getCardFooterText(item,apiClient,options,showTitle,forceName,overlayText,imgUrl,footerCssClass,progressHtml,!0,cardFooterId,vibrantSwatch)),outerCardFooter&&!options.cardLayout&&(cardBoxClass+=" cardBox-bottompadded");var overlayButtons="";if(!layoutManager.tv){var overlayPlayButton=options.overlayPlayButton;null!=overlayPlayButton||options.overlayMoreButton||options.overlayInfoButton||options.cardLayout||(overlayPlayButton="Video"===item.MediaType);var btnCssClass="cardOverlayButton itemAction";if(options.centerPlayButton&&(overlayButtons+=''),!overlayPlayButton||item.IsPlaceHolder||"Virtual"===item.LocationType&&item.MediaType&&"Program"!==item.Type||"Person"===item.Type||(overlayButtons+=''),options.overlayMoreButton){var moreIcon="dots-horiz"===appHost.moreIcon?"":"";overlayButtons+='"}options.overlayInfoButton&&(overlayButtons+='')}options.showChildCountIndicator&&item.ChildCount&&(className+=" groupedCard");var cardImageContainerOpen,cardContentOpen,cardImageContainerClose="",cardBoxClose="",cardContentClose="",cardScalableClose="",cardContentClass="cardContent";options.cardLayout||(cardContentClass+=" cardContent-shadow"),layoutManager.tv?(cardContentOpen='
',cardContentClose="
"):(cardContentOpen='");var vibrantAttributes=options.vibrant&&imgUrl&&!vibrantSwatch?' data-vibrant="'+cardFooterId+'" data-swatch="db"':"";if(vibrantAttributes&&!browser.safari){cardImageContainerOpen='
';var imgClass="cardImage cardImage-img lazy";coveredImage&&(imgClass+=1===devicePixelRatio?" coveredImage-noscale-img":" coveredImage-img"),cardImageContainerOpen+=''}else cardImageContainerOpen=imgUrl?'
':'
';var cardScalableClass="cardScalable";layoutManager.tv&&!options.cardLayout&&(cardScalableClass+=" card-focuscontent",enableFocusTransfrom||(cardScalableClass+=" card-focuscontent-large")),cardImageContainerOpen='
'+cardContentOpen+cardImageContainerOpen,cardBoxClose="
",cardScalableClose="
",cardImageContainerClose="
";var indicatorsHtml="";if(indicatorsHtml+=indicators.getSyncIndicator(item),indicatorsHtml+=indicators.getTimerIndicator(item),indicatorsHtml+=indicators.getTypeIndicator(item),indicatorsHtml+=options.showGroupCount?indicators.getChildCountIndicatorHtml(item,{minCount:1}):indicators.getPlayedIndicatorHtml(item),"CollectionFolder"===item.Type||item.CollectionType){var refreshClass=item.RefreshProgress||item.RefreshStatus&&"Idle"!==virtualFolder.item?"":' class="hide"';indicatorsHtml+='
',requireRefreshIndicator()}if(indicatorsHtml&&(cardImageContainerOpen+='
'+indicatorsHtml+"
"),!imgUrl){var defaultName=isUsingLiveTvNaming(item)?item.Name:itemHelper.getDisplayName(item);cardImageContainerOpen+='
'+defaultName+"
"}var tagName=layoutManager.tv&&!overlayButtons?"button":"div",nameWithPrefix=item.SortName||item.Name||"",prefix=nameWithPrefix.substring(0,Math.min(3,nameWithPrefix.length));prefix&&(prefix=prefix.toUpperCase());var timerAttributes="";item.TimerId&&(timerAttributes+=' data-timerid="'+item.TimerId+'"'),item.SeriesTimerId&&(timerAttributes+=' data-seriestimerid="'+item.SeriesTimerId+'"');var actionAttribute;"button"===tagName?(className+=" itemAction",actionAttribute=' data-action="'+action+'"'):actionAttribute="","MusicAlbum"!==item.Type&&"MusicArtist"!==item.Type&&"Audio"!==item.Type&&(className+=" card-withuserdata");var positionTicksData=item.UserData&&item.UserData.PlaybackPositionTicks?' data-positionticks="'+item.UserData.PlaybackPositionTicks+'"':"",collectionIdData=options.collectionId?' data-collectionid="'+options.collectionId+'"':"",playlistIdData=options.playlistId?' data-playlistid="'+options.playlistId+'"':"",mediaTypeData=item.MediaType?' data-mediatype="'+item.MediaType+'"':"",collectionTypeData=item.CollectionType?' data-collectiontype="'+item.CollectionType+'"':"",channelIdData=item.ChannelId?' data-channelid="'+item.ChannelId+'"':"",contextData=options.context?' data-context="'+options.context+'"':"",parentIdData=options.parentId?' data-parentid="'+options.parentId+'"':"";return"<"+tagName+' data-index="'+index+'"'+timerAttributes+actionAttribute+' data-isfolder="'+(item.IsFolder||!1)+'" data-serverid="'+(item.ServerId||options.serverId)+'" data-id="'+(item.Id||item.ItemId)+'" data-type="'+item.Type+'"'+mediaTypeData+collectionTypeData+channelIdData+positionTicksData+collectionIdData+playlistIdData+contextData+parentIdData+' data-prefix="'+prefix+'" class="'+className+'">'+cardImageContainerOpen+innerCardFooter+cardImageContainerClose+cardContentClose+overlayButtons+cardScalableClose+outerCardFooter+cardBoxClose+""}function buildCards(items,options){if(document.body.contains(options.itemsContainer)){if(options.parentContainer){if(!items.length)return void options.parentContainer.classList.add("hide");options.parentContainer.classList.remove("hide")}var html=buildCardsHtmlInternal(items,options);html?(options.itemsContainer.cardBuilderHtml!==html&&(options.itemsContainer.innerHTML=html,items.length<50?options.itemsContainer.cardBuilderHtml=html:options.itemsContainer.cardBuilderHtml=null),imageLoader.lazyChildren(options.itemsContainer)):(options.itemsContainer.innerHTML=html,options.itemsContainer.cardBuilderHtml=null),options.autoFocus&&focusManager.autoFocus(options.itemsContainer,!0)}}function ensureIndicators(card,indicatorsElem){if(indicatorsElem)return indicatorsElem;if(indicatorsElem=card.querySelector(".cardIndicators"),!indicatorsElem){var cardImageContainer=card.querySelector(".cardImageContainer");indicatorsElem=document.createElement("div"),indicatorsElem.classList.add("cardIndicators"),cardImageContainer.appendChild(indicatorsElem)}return indicatorsElem}function updateUserData(card,userData){var type=card.getAttribute("data-type"),enableCountIndicator="Series"===type||"BoxSet"===type||"Season"===type,indicatorsElem=null,playedIndicator=null,countIndicator=null,itemProgressBar=null;userData.Played?(playedIndicator=card.querySelector(".playedIndicator"),playedIndicator||(playedIndicator=document.createElement("div"),playedIndicator.classList.add("playedIndicator"),playedIndicator.classList.add("indicator"),indicatorsElem=ensureIndicators(card,indicatorsElem),indicatorsElem.appendChild(playedIndicator)),playedIndicator.innerHTML=''):(playedIndicator=card.querySelector(".playedIndicator"),playedIndicator&&playedIndicator.parentNode.removeChild(playedIndicator)),userData.UnplayedItemCount?(countIndicator=card.querySelector(".countIndicator"),countIndicator||(countIndicator=document.createElement("div"), +countIndicator.classList.add("countIndicator"),indicatorsElem=ensureIndicators(card,indicatorsElem),indicatorsElem.appendChild(countIndicator)),countIndicator.innerHTML=userData.UnplayedItemCount):enableCountIndicator&&(countIndicator=card.querySelector(".countIndicator"),countIndicator&&countIndicator.parentNode.removeChild(countIndicator));var progressHtml=indicators.getProgressBarHtml({Type:type,UserData:userData,MediaType:"Video"});if(progressHtml){if(itemProgressBar=card.querySelector(".itemProgressBar"),!itemProgressBar){itemProgressBar=document.createElement("div"),itemProgressBar.classList.add("itemProgressBar");var innerCardFooter=card.querySelector(".innerCardFooter");if(!innerCardFooter){innerCardFooter=document.createElement("div"),innerCardFooter.classList.add("innerCardFooter");var cardImageContainer=card.querySelector(".cardImageContainer");cardImageContainer.appendChild(innerCardFooter)}innerCardFooter.appendChild(itemProgressBar)}itemProgressBar.innerHTML=progressHtml}else itemProgressBar=card.querySelector(".itemProgressBar"),itemProgressBar&&itemProgressBar.parentNode.removeChild(itemProgressBar)}function onUserDataChanged(userData,scope){for(var cards=(scope||document.body).querySelectorAll('.card-withuserdata[data-id="'+userData.ItemId+'"]'),i=0,length=cards.length;i')}cell.setAttribute("data-timerid",newTimerId)}}function onTimerCancelled(id,itemsContainer){for(var cells=itemsContainer.querySelectorAll('.card[data-timerid="'+id+'"]'),i=0,length=cells.length;i -
+
-

${HeaderSettings}

-
+ -
-

+
+

-
-

${HeaderAdmin}

+
+

${HeaderAdmin}

diff --git a/dashboard-ui/scripts/itemlistpage.js b/dashboard-ui/scripts/itemlistpage.js index d5763a3162..d5d68724b9 100644 --- a/dashboard-ui/scripts/itemlistpage.js +++ b/dashboard-ui/scripts/itemlistpage.js @@ -1 +1 @@ -define(["events","layoutManager","loading","libraryMenu","libraryBrowser","connectionManager","alphaPicker","listView","cardBuilder","imageLoader","emby-itemscontainer"],function(events,layoutManager,loading,libraryMenu,libraryBrowser,connectionManager,alphaPicker,listView,cardBuilder,imageLoader){"use strict";return function(view,params){function getPageData(){var pageData=data;if(!pageData){pageData=data={query:{SortBy:"IsFolder,SortName",SortOrder:"Ascending",Fields:"DateCreated,PrimaryImageAspectRatio,MediaSourceCount",ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",StartIndex:0,Limit:libraryBrowser.getDefaultPageSize()}},pageData.query.Filters="",pageData.query.NameStartsWithOrGreater="";var key=getSavedQueryKey();pageData.view=libraryBrowser.getSavedView(key)||"Poster",pageData.query.ParentId=params.parentId||null,libraryBrowser.loadSavedQueryValues(key,pageData.query)}return pageData}function getQuery(){return getPageData().query}function getSavedQueryKey(){return view.savedQueryKey||(view.savedQueryKey=libraryBrowser.getSavedQueryKey("itemsv1")),view.savedQueryKey}function onViewStyleChange(){var viewStyle=getPageData(view).view,itemsContainer=view.querySelector("#items");"List"==viewStyle?(itemsContainer.classList.add("vertical-list"),itemsContainer.classList.remove("vertical-wrap")):(itemsContainer.classList.remove("vertical-list"),itemsContainer.classList.add("vertical-wrap"),itemsContainer.classList.add("centered")),itemsContainer.innerHTML=""}function reloadItems(){loading.show();var query=getQuery(),userId=apiClient.getCurrentUserId(),parentItemPromise=query.ParentId?apiClient.getItem(userId,query.ParentId):apiClient.getRootFolder(userId),itemsPromise=apiClient.getItems(userId,query);Promise.all([parentItemPromise,itemsPromise]).then(function(responses){function onNextPageClick(){query.StartIndex+=query.Limit,reloadItems(view)}function onPreviousPageClick(){query.StartIndex-=query.Limit,reloadItems(view)}var item=responses[0];currentItem=item;var result=responses[1];window.scrollTo(0,0);var viewStyle=getPageData(view).view,html="",pagingHtml=libraryBrowser.getQueryPagingHtml({startIndex:query.StartIndex,limit:query.Limit,totalRecordCount:result.TotalRecordCount,showLimit:!1,addLayoutButton:!1,currentLayout:viewStyle,sortButton:!1,filterButton:!1});updateFilterControls();var context=params.context,posterOptions={items:result.Items,shape:"auto",centerText:!0,lazy:!0,coverImage:"PhotoAlbum"==item.Type,context:"folders",action:"PhotoAlbum"===item.Type?"play":null};"PosterCard"==viewStyle?(posterOptions.showTitle=!0,posterOptions.showYear=!0,posterOptions.cardLayout=!0,posterOptions.centerText=!1,posterOptions.vibrant=!0,html=cardBuilder.getCardsHtml(posterOptions)):"List"==viewStyle?html=listView.getListViewHtml({items:result.Items,sortBy:query.SortBy}):"Thumb"==viewStyle?(posterOptions.preferThumb=!0,posterOptions.showTitle=!0,posterOptions.shape="backdrop",posterOptions.centerText=!0,posterOptions.overlayText=!1,posterOptions.overlayMoreButton=!0,html=cardBuilder.getCardsHtml(posterOptions)):(posterOptions.showTitle="photos"!=context||"auto",posterOptions.overlayText="photos"==context,posterOptions.overlayMoreButton=!0,html=cardBuilder.getCardsHtml(posterOptions)),"boxsets"==currentItem.CollectionType?(view.querySelector(".btnNewCollection").classList.remove("hide"),result.Items.length||(html='

'+Globalize.translate("MessageNoCollectionsAvailable")+"

")):view.querySelector(".btnNewCollection").classList.add("hide");var elem=view.querySelector("#items");elem.innerHTML=html,imageLoader.lazyChildren(elem);var i,length,elems=view.querySelectorAll(".paging");for(i=0,length=elems.length;i'+Globalize.translate("MessageNoCollectionsAvailable")+"

")):view.querySelector(".btnNewCollection").classList.add("hide");var elem=view.querySelector("#items");elem.innerHTML=html,imageLoader.lazyChildren(elem);var i,length,elems=view.querySelectorAll(".paging");for(i=0,length=elems.length;i

${Invitations}

-
+