From 8234c5ffa03c272ecd996665a97e9ae08d146426 Mon Sep 17 00:00:00 2001 From: Bradmu <37090258+Bradmu@users.noreply.github.com> Date: Fri, 16 Mar 2018 09:13:33 -0700 Subject: [PATCH 1/6] Update EncodingHelper.cs --- .../MediaEncoding/EncodingHelper.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 1575ed2a9d..d89c76a282 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -668,7 +668,18 @@ public string GetVideoQualityParam(EncodingJobInfo state, string videoEncoder, E // h264 (h264_qsv) else if (string.Equals(videoEncoder, "h264_qsv", StringComparison.OrdinalIgnoreCase)) { - param += "-preset 7 -look_ahead 0"; + string[] valid_h264_qsv = new string [] {"veryslow", "slower", "slow", "medium", "fast", "faster", "veryfast" }; + + if(Array.IndexOf(valid_h264_qsv,encodingOptions.H264Preset.ToLower()) != -1) + { + param += "-preset " + encodingOptions.H264Preset; + } + else + { + param += "-preset 7"; + } + + param += " -look_ahead 0"; } @@ -2449,4 +2460,4 @@ public string GetProgressiveAudioFullCommandLine(EncodingJobInfo state, Encoding } } -} \ No newline at end of file +} From 75acff36e5058c9324567501d915d7707b554608 Mon Sep 17 00:00:00 2001 From: Bradmu <37090258+Bradmu@users.noreply.github.com> Date: Fri, 16 Mar 2018 09:18:34 -0700 Subject: [PATCH 2/6] Update EncodingHelper.cs --- .../MediaEncoding/EncodingHelper.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index d89c76a282..ffc31a429c 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -670,16 +670,16 @@ public string GetVideoQualityParam(EncodingJobInfo state, string videoEncoder, E { string[] valid_h264_qsv = new string [] {"veryslow", "slower", "slow", "medium", "fast", "faster", "veryfast" }; - if(Array.IndexOf(valid_h264_qsv,encodingOptions.H264Preset.ToLower()) != -1) - { - param += "-preset " + encodingOptions.H264Preset; - } - else - { - param += "-preset 7"; - } + if(Array.IndexOf(valid_h264_qsv,encodingOptions.H264Preset.ToLower()) != -1) + { + param += "-preset " + encodingOptions.H264Preset; + } + else + { + param += "-preset 7"; + } - param += " -look_ahead 0"; + param += " -look_ahead 0"; } From 0708cc3c30866aed96c7639382bffa503ec0c60f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 16 Mar 2018 14:15:34 -0400 Subject: [PATCH 3/6] update controller --- .../Session/FirebaseSessionController.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Emby.Server.Implementations/Session/FirebaseSessionController.cs b/Emby.Server.Implementations/Session/FirebaseSessionController.cs index 83b3e4244a..321fbed2ff 100644 --- a/Emby.Server.Implementations/Session/FirebaseSessionController.cs +++ b/Emby.Server.Implementations/Session/FirebaseSessionController.cs @@ -1,5 +1,6 @@ -using MediaBrowser.Common.Net; -using MediaBrowser.Controller.Session; +using MediaBrowser.Controller.Session; +using MediaBrowser.Model.Net; +using MediaBrowser.Common.Net; using MediaBrowser.Model.Serialization; using System; using System.Threading; @@ -70,13 +71,19 @@ public async Task SendMessage(string name, string messageId, T data, ISession return; } - string strData = _json.SerializeToString(data); + var msg = new WebSocketMessage + { + Data = data, + MessageType = name, + MessageId = messageId + }; + var req = new FirebaseBody { to = _token, data = new FirebaseData { - msgdata = strData + msgdata = _json.SerializeToString(data) } }; From 49cde88be3687dbb9d6f12bda5f97708c3f68582 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 18 Mar 2018 15:07:11 -0400 Subject: [PATCH 4/6] update naming project --- .../Emby.Server.Implementations.csproj | 4 ++-- .../Library/Resolvers/Audio/AudioResolver.cs | 2 +- Emby.Server.Implementations/packages.config | 1 + ThirdParty/emby/Emby.Naming.dll | Bin 60416 -> 0 bytes .../MediaBrowser.Naming.1.1.0.nupkg | Bin 0 -> 26118 bytes .../lib/netstandard1.3/Emby.Naming.dll | Bin 0 -> 60416 bytes 6 files changed, 4 insertions(+), 3 deletions(-) delete mode 100644 ThirdParty/emby/Emby.Naming.dll create mode 100644 packages/MediaBrowser.Naming.1.1.0/MediaBrowser.Naming.1.1.0.nupkg create mode 100644 packages/MediaBrowser.Naming.1.1.0/lib/netstandard1.3/Emby.Naming.dll diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj index f7f98fb54d..c4bb4545b3 100644 --- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj +++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj @@ -626,8 +626,8 @@ {1d74413b-e7cf-455b-b021-f52bdf881542} SocketHttpListener - - ..\ThirdParty\emby\Emby.Naming.dll + + ..\packages\MediaBrowser.Naming.1.1.0\lib\netstandard1.3\Emby.Naming.dll ..\ThirdParty\emby\Emby.Server.MediaEncoding.dll diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs index 9fe9f982bf..c380449131 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs @@ -232,7 +232,7 @@ private MultiItemResolverResult ResolveMultipleAudio(Folder parent, IEnumerab { Path = firstMedia.Path, IsInMixedFolder = isInMixedFolder, - ProductionYear = resolvedItem.Year, + //ProductionYear = resolvedItem.Year, Name = parseName ? resolvedItem.Name : Path.GetFileNameWithoutExtension(firstMedia.Path), diff --git a/Emby.Server.Implementations/packages.config b/Emby.Server.Implementations/packages.config index 9d341cf232..1d44f07978 100644 --- a/Emby.Server.Implementations/packages.config +++ b/Emby.Server.Implementations/packages.config @@ -1,5 +1,6 @@  + diff --git a/ThirdParty/emby/Emby.Naming.dll b/ThirdParty/emby/Emby.Naming.dll deleted file mode 100644 index 8edff0058dd8d5f753caf5903c88c598ee6bed5a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 60416 zcmeFa34B%M@i#u_+?#WkBqTQ>2?&x_t`*#^+Pc+h)e0`P*1fhat=gcqF5R>)t=i)MJM%o}o^z9c?eA?r|M&g8FPb?s z^UO2PJoC)6p64X9zi|=yh{%thuf8I>A5Z?*Byj(r2g!p{lp4Lw_azj5TVnNKscV5{VdwIMrJ3D-UR(;e=q9Y9-y?fu- zN1f7osiG{?7(?_sa4g0Bxz8Xf173zFQLf;ovYQ!fzx-Q*bny9~kDAV8QU2e3YLZ#_ zw-$QmG6KC9u_OBaYcePcyw^>GCiP9*A6-Ti^rQztALgO!y5j4*K!5l)0Mewc+HO$t zuZ(C(T_TxS21;y$jZ)Fyt8@o8p}Fc3@pc=6Y%9TL@xcdNqo6h^Oh>f^z((e+x%K)zC41ItC07 zk>p&1tgvNnxdthgZ_8Eu*u*eXJ)%WWP+4n@+ByVCwz-Kl+30T^zEN+I&JuwtYp-<_9?4;>5N1_xy%wcZ))tN0`duJWQ2;e zs)JJzhbHk?(a+yO{_|bJB9_d;(wDuH1$wIwTSXzLo=Q* zG$L8xf3|Kw{};j;tjJdwua62Euk~<%afk%`* zC*cVjBFW&;#NqWo_FCWI)GWGeEjY^`gu`{^t@1rc38WA4a0P$tj7N}B^!=bNmePiJtqxnIWp*PnnJR@N)ACvN!E7%V7e%`u z@VMU}4IPMNM@Kd+vL{0>Ts=IGqEmoj4huw4RUW%xmsR5rX1`gA#6yr+`|CFc<t14Pjd1U?lss`7 zC!v>6Vb@CeG_ zEUJ@bMKX#`$j^vmMEu`utG_M~tjP>XtzcobQK*azDf@XC$0(qpOAs*7Ull_TFort} zLDJ(7jU}B4U0P)l1er=5h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ufhafHcSsaQ89!^B@|g znn;mu_(phJdJ)&$5eE#UcCta(6@gs=EbBanuo$cFlj^BU4bYDWeT@^sDGDB<;_TH* z6W8gWSVF0JQ^80o0lIgc;DLlpEQ=lP7qcvi6?}s+ncFck-N~A!4&dPsL~s&RHyjp~ z#<0^=yW3QIJe49m6>+r$woTOnfu)RKY0QkpVqiaHu0_7!yI6ouB#FA*tIXoW1p#^x z@+>A10@gsYstgAmfkNIfod{9d1lN*k5;oZ&3!ng!fL3YQ1Y+mVe6Yq=;0K96*~C+h z4fkqiK-|ymg@NM+qs9%^j4~QPq@k;3kvf2;EN{U`T82i`*kTr$%OcYqpmv1A#pyor z^ntHY)%{%`y?FM*$@6QS12AyP3l5_607u`7pStkO12ZR&*YQ2IwUx6MSE}iOA4jho zm^laxc4y}lp7c0me4BF>XP28Czq*d!XYfpjgKzNl@l}JP!p*+<_>=g$Uc4q>`iyZ> z3l6@EFJD?+iO*e)StsU~>TwjN);%!u@XYKC-qR|2CVyZCNrUsw&1laTj8 zdS$t%k-qr(bDvpGnOa_3eHLF<6yZQ5y&GfR*bTkEW|WH7pMERR?~i@$72wz8=?vxE0RV6!_i{ z_o?*ra_)H`^*|F>j&xyp7}EuT;hTo~$IWcW0QlaGy2pU8B`ZFB+Xy zqb;r{Def36JzTtIY86m?-GQ$h#K3qJ_v3)n*pjRXU6DJC9WCWMZEFGTxJ%r`pTT+&e*XZ!qsTXzS(6gI0RE_vPhs^7FB?EMv@f>v;WVGr z5;~((fg_6s7N#WTZYPYLTxfIZTf4xEJP&O(b{5p)taURmAmZ{mM fXnCtTz48PL_u+$IkU*=i9lQ@s|G&xmE`fgopPV)w diff --git a/packages/MediaBrowser.Naming.1.1.0/MediaBrowser.Naming.1.1.0.nupkg b/packages/MediaBrowser.Naming.1.1.0/MediaBrowser.Naming.1.1.0.nupkg new file mode 100644 index 0000000000000000000000000000000000000000..7500c87a3bb3d15454dd87e3235cd49c78c921ae GIT binary patch literal 26118 zcmb5U19W6vw>Fx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`g8Rv#t;5( XuqnwRBK<6ecz;CQk4XcQpLhQUm@`-s literal 0 HcmV?d00001 diff --git a/packages/MediaBrowser.Naming.1.1.0/lib/netstandard1.3/Emby.Naming.dll b/packages/MediaBrowser.Naming.1.1.0/lib/netstandard1.3/Emby.Naming.dll new file mode 100644 index 0000000000000000000000000000000000000000..b83aaba0384b82c6a5394d9fd97cee017b72d380 GIT binary patch literal 60416 zcmeFa2Yg)B@h?92?&_{~C0SZYR&!CYW!7rgmYcA#+SX=wlr4>w#XH-|TH4B{&z)Dc%3c<$%gPE3)v6DfK{U(ok$LY~*Epr^ zqKdK%V+7Hg;8=Zy@Bx_e|RxT}G7dNlyoTpogyOh^^}YJ>m@jq)A=1-Js;BjA%(+ zJP~gOCAPsvsp#7(-GPm0uDW=v)rKJ3O0Zdc@V+CVo{dCPQ#nNMqh9>OwwaVhe_BB_ z{bC};m82g8@iAy28{62VPJp=CuSRD zg)DRPrAV=Sn^7gdwUJ?ldPEALpt9B)wxtM2mbsBN*@!YL7%2uP0=l}kPV+xOAbR-) zmeLZ3RC{Cqr1X@`epbN``o=6tBn=e7SwUHq^ z)~ZFWRD93T-O=XaF6(j(pH<S)Ru226Lz!|K_R}ir4P>A$F*rG}i-vpeR3j$ZbhsrmCIIeIzAHtG5AB=%Vls(7b z2^+$R`3NNLf7_9W{d87(3!4+=?Tu0;kPH_q5QBgP=AU7YObIa2-xGDJOz6U_7uh)wz2_zl>%I4L?3Hl<)QKD zB~*}^pJi?2a`XHJd1=*0g#F>Pi}S4XnsH7BHbgS0ykXsaYU;yQmLro?T0JO?GB}Is zWSQZ#!lUxi!f9duk6T7v5lFAe2uiJBVYN}9j0`IKc^JniprT6W?L^ zKR6`<*HuTLw>nelva=zORgmW&&kHIAB0OE^a!bs6Do5t;!ZGo0gE77mAHVbxH=mW6v+maBPQ%knhO zYgxYLc`fT7&Isq~>G5VnW;ipPr^wp1;jD1J!fTd<`-S^!e12Gkk$nii(3aXX|{k9LKJyXasS%~PHX zX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_2Bd&V6Z#8 zN9&|#9OEmRD>#JQ`6g$K<5zH+U3}%z z%5r?}TFf>vzbTLNEw$~z=|`t$rtyka(KGpj)3`J^xZI5PecN3KHD5SX{hjfiTp-=& z@M-uU@3!8{(o$AP^QTYEpLztpVtweFFMQxj$4~t5%+>F%a9}xhWN~@r>SA9Xo66_U zeQGh~X>oPsGQNN)vVlbU!KN=PpEJJ#71`fgEXUc^=KK$RaK+mYCe|9|a@zj0ykdln|y%o)wvVAX24 zo^Vg#(~LcH81XLqI~*KF@w7Pw37*DY>(eOJ@e2(naa~7x9A*A}FZbtv=;`b1AwoaQ z4c2e;FNaKhCapj=kBOZ&PAp_uh1Z|H2Ut89y_?{NF@68+xi0>b9Ei6V~TnSU$ zF>1K%&MV&IiyC}cA_m55NFN8JmQJCbZ{sqBucD`Xw=b>ge$ zbzAqt{p}Y14OY7FI}G^UM!tj1mXzoP@JEe&0_%2oO#-r^eX*YpruC$j&>5X7XG-Hv z{mqDc7J!GZ!d$`Y6_@*{-L5_5Qb7Nk+YL&GvQhcq_i03qbC5o@OwG1L%UiYSmnT?w W0Dt%;3-mg6=mB*7|1KZ61pWo-C Date: Sun, 18 Mar 2018 16:39:28 -0400 Subject: [PATCH 5/6] add secure connection mode setting to hosting page --- .../Sortable/knockout-sortable.js | 2 +- .../bower_components/Sortable/ng-sortable.js | 2 +- .../Sortable/react-sortable-mixin.js | 2 +- .../bower_components/Swiper/gulpfile.js | 2 +- .../bower_components/alameda/alameda.js | 2 +- .../emby-apiclient/apiclient.js | 4 +- .../emby-apiclient/apiclientex.js | 2 +- .../emby-apiclient/appstorage-cache.js | 2 +- .../emby-apiclient/appstorage-localstorage.js | 2 +- .../emby-apiclient/connectionmanager.js | 2 +- .../bower_components/emby-apiclient/events.js | 2 +- .../emby-apiclient/fileupload.js | 2 +- .../emby-apiclient/localassetmanager.js | 2 +- .../emby-apiclient/serverdiscovery-chrome.js | 2 +- .../emby-apiclient/serverdiscovery-winjs.js | 2 +- .../emby-apiclient/sync/contentuploader.js | 2 +- .../emby-apiclient/sync/itemrepository.js | 2 +- .../emby-apiclient/sync/localsync.js | 2 +- .../emby-apiclient/sync/mediasync.js | 2 +- .../emby-apiclient/sync/serversync.js | 2 +- .../sync/useractionrepository.js | 2 +- .../actionsheet/actionsheet.js | 2 +- .../alphapicker/alphapicker.js | 2 +- .../emby-webcomponents/appfooter/appfooter.js | 2 +- .../emby-webcomponents/backdrop/backdrop.js | 2 +- .../emby-webcomponents/browser.js | 2 +- .../browserdeviceprofile.js | 2 +- .../cardbuilder/cardbuilder.js | 4 +- .../cardbuilder/chaptercardbuilder.js | 2 +- .../chromecast/chromecasthelpers.js | 2 +- .../chromecast/chromecastplayer.js | 2 +- .../collectioneditor/collectioneditor.js | 2 +- .../confirm/nativeconfirm.js | 2 +- .../emby-webcomponents/datetime.js | 2 +- .../emby-webcomponents/dialog/dialog.js | 2 +- .../dialoghelper/dialoghelper.js | 2 +- .../displaysettings/displaysettings.js | 2 +- .../emby-webcomponents/dom.js | 2 +- .../emby-button/emby-button.js | 2 +- .../emby-checkbox/emby-checkbox.js | 2 +- .../emby-collapse/emby-collapse.js | 2 +- .../emby-connect/connecthelper.js | 2 +- .../emby-input/emby-input.js | 2 +- .../emby-itemscontainer.js | 2 +- .../emby-progressring/emby-progressring.js | 2 +- .../emby-scrollbuttons/emby-scrollbuttons.js | 2 +- .../emby-select/emby-select.js | 2 +- .../emby-webcomponents/emby-tabs/emby-tabs.js | 2 +- .../emby-textarea/emby-textarea.js | 2 +- .../filtermenu/filtermenu.js | 2 +- .../emby-webcomponents/focusmanager.js | 2 +- .../emby-webcomponents/globalize.js | 2 +- .../guide/guide-settings.js | 2 +- .../emby-webcomponents/guide/guide.js | 2 +- .../emby-webcomponents/headroom/headroom.js | 2 +- .../homescreensettings/homescreensettings.js | 2 +- .../homesections/homesections.js | 2 +- .../htmlaudioplayer/plugin.js | 2 +- .../htmlvideoplayer/htmlmediahelper.js | 2 +- .../htmlvideoplayer/plugin.js | 2 +- .../imagedownloader/imagedownloader.js | 2 +- .../imageeditor/imageeditor.js | 2 +- .../emby-webcomponents/images/imagehelper.js | 2 +- .../indicators/indicators.js | 2 +- .../emby-webcomponents/input/api.js | 2 +- .../emby-webcomponents/input/gamepadtokey.js | 2 +- .../emby-webcomponents/input/mouse.js | 2 +- .../emby-webcomponents/inputmanager.js | 2 +- .../emby-webcomponents/itemcontextmenu.js | 2 +- .../emby-webcomponents/itemhelper.js | 2 +- .../itemhovermenu/itemhovermenu.js | 2 +- .../itemidentifier/itemidentifier.js | 2 +- .../emby-webcomponents/itemsrefresher.js | 2 +- .../emby-webcomponents/layoutmanager.js | 2 +- .../lazyloader-intersectionobserver.js | 2 +- .../lazyloader/lazyloader-scroll.js | 2 +- .../emby-webcomponents/listview/listview.js | 2 +- .../loadingdialog/loadingdialog.js | 1 + .../emby-webcomponents/maintabsmanager.js | 2 +- .../emby-webcomponents/mediainfo/mediainfo.js | 2 +- .../metadataeditor/metadataeditor.js | 2 +- .../emby-webcomponents/multidownload.js | 2 +- .../multiselect/multiselect.js | 2 +- .../native-promise-only/lib/npo.src.js | 2 +- .../notifications/notifications.js | 2 +- .../nowplayingbar/nowplayingbar.js | 2 +- .../emby-webcomponents/packagemanager.js | 2 +- .../emby-webcomponents/pagejs/page.js | 2 +- .../emby-webcomponents/photoplayer/plugin.js | 2 +- .../playback/brightnessosd.js | 2 +- .../playback/experimentalwarnings.js | 2 +- .../playback/mediasession.js | 2 +- .../playback/nowplayinghelper.js | 2 +- .../playback/playbackmanager.js | 6 +-- .../playback/playbackorientation.js | 2 +- .../playback/playerselection.js | 2 +- .../playback/playersettingsmenu.js | 2 +- .../playback/playqueuemanager.js | 2 +- .../emby-webcomponents/playback/volumeosd.js | 2 +- .../playbacksettings/playbacksettings.js | 2 +- .../playerstats/playerstats.js | 2 +- .../playlisteditor/playlisteditor.js | 2 +- .../emby-webcomponents/pluginmanager.js | 2 +- .../polyfills/objectassign.js | 2 +- .../emby-webcomponents/prompt/prompt.js | 2 +- .../emby-webcomponents/qualityoptions.js | 2 +- .../recordingcreator/recordingeditor.js | 2 +- .../recordingcreator/recordingfields.js | 2 +- .../recordingcreator/recordinghelper.js | 2 +- .../recordingcreator/seriesrecordingeditor.js | 2 +- .../refreshdialog/refreshdialog.js | 2 +- .../registrationservices.js | 2 +- .../emby-webcomponents/require/requirecss.js | 2 +- .../emby-webcomponents/require/requirehtml.js | 2 +- .../emby-webcomponents/require/requiretext.js | 2 +- .../emby-webcomponents/router.js | 2 +- .../emby-webcomponents/sanitizefilename.js | 2 +- .../scroller/smoothscroller.js | 2 +- .../emby-webcomponents/scrollhelper.js | 2 +- .../emby-webcomponents/search/searchfields.js | 2 +- .../search/searchresults.js | 2 +- .../serverrestartdialog.js | 2 +- .../serviceworker/notifications.js | 2 +- .../emby-webcomponents/serviceworker/sync.js | 2 +- .../emby-webcomponents/sessionplayer.js | 2 +- .../emby-webcomponents/shortcuts.js | 2 +- .../emby-webcomponents/skinmanager.js | 2 +- .../emby-webcomponents/slideshow/slideshow.js | 2 +- .../emby-webcomponents/sortmenu/sortmenu.js | 2 +- .../emby-webcomponents/staticbackdrops.js | 2 +- .../emby-webcomponents/strings/ar.json | 4 ++ .../emby-webcomponents/strings/be-by.json | 4 ++ .../emby-webcomponents/strings/bg-bg.json | 4 ++ .../emby-webcomponents/strings/ca.json | 4 ++ .../emby-webcomponents/strings/cs.json | 4 ++ .../emby-webcomponents/strings/da.json | 4 ++ .../emby-webcomponents/strings/de.json | 4 ++ .../emby-webcomponents/strings/el.json | 4 ++ .../emby-webcomponents/strings/en-gb.json | 4 ++ .../emby-webcomponents/strings/en-us.json | 4 ++ .../emby-webcomponents/strings/es-ar.json | 4 ++ .../emby-webcomponents/strings/es-mx.json | 4 ++ .../emby-webcomponents/strings/es.json | 4 ++ .../emby-webcomponents/strings/fi.json | 4 ++ .../emby-webcomponents/strings/fr-ca.json | 4 ++ .../emby-webcomponents/strings/fr.json | 4 ++ .../emby-webcomponents/strings/gsw.json | 4 ++ .../emby-webcomponents/strings/he.json | 4 ++ .../emby-webcomponents/strings/hr.json | 4 ++ .../emby-webcomponents/strings/hu.json | 4 ++ .../emby-webcomponents/strings/id.json | 4 ++ .../emby-webcomponents/strings/it.json | 18 ++++---- .../emby-webcomponents/strings/kk.json | 4 ++ .../emby-webcomponents/strings/ko.json | 4 ++ .../emby-webcomponents/strings/lt-lt.json | 4 ++ .../emby-webcomponents/strings/ms.json | 4 ++ .../emby-webcomponents/strings/nb.json | 8 +++- .../emby-webcomponents/strings/nl.json | 4 ++ .../emby-webcomponents/strings/pl.json | 8 +++- .../emby-webcomponents/strings/pt-br.json | 4 ++ .../emby-webcomponents/strings/pt-pt.json | 4 ++ .../emby-webcomponents/strings/ro.json | 4 ++ .../emby-webcomponents/strings/ru.json | 18 ++++---- .../emby-webcomponents/strings/sk.json | 6 ++- .../emby-webcomponents/strings/sl-si.json | 4 ++ .../emby-webcomponents/strings/sv.json | 4 ++ .../emby-webcomponents/strings/tr.json | 4 ++ .../emby-webcomponents/strings/uk.json | 4 ++ .../emby-webcomponents/strings/vi.json | 4 ++ .../emby-webcomponents/strings/zh-cn.json | 42 ++++++++++--------- .../emby-webcomponents/strings/zh-hk.json | 4 ++ .../emby-webcomponents/strings/zh-tw.json | 4 ++ .../subtitleeditor/subtitleeditor.js | 2 +- .../emby-webcomponents/sync/sync.js | 2 +- .../emby-webcomponents/sync/syncjobeditor.js | 2 +- .../emby-webcomponents/sync/syncjoblist.js | 2 +- .../emby-webcomponents/tabbedview/itemstab.js | 2 +- .../emby-webcomponents/thememediaplayer.js | 2 +- .../emby-webcomponents/touchhelper.js | 2 +- .../upnextdialog/upnextdialog.js | 2 +- .../userdatabuttons/emby-playstatebutton.js | 2 +- .../userdatabuttons/emby-ratingbutton.js | 2 +- .../userdatabuttons/userdatabuttons.js | 2 +- .../usersettings/usersettingsbuilder.js | 2 +- .../viewmanager/viewcontainer-lite.js | 2 +- .../viewmanager/viewmanager.js | 2 +- .../viewsettings/viewsettings.js | 2 +- .../youtubeplayer/plugin.js | 2 +- .../bower_components/fetch/fetch.js | 2 +- .../bower_components/jquery/dist/core.js | 2 +- .../bower_components/jquery/dist/jquery.js | 10 ++--- .../jquery/dist/jquery.slim.js | 8 ++-- .../bower_components/jstree/dist/jstree.js | 10 ++--- .../bower_components/requirejs/require.js | 2 +- .../dist/ResizeObserver.js | 2 +- .../accessschedule/accessschedule.js | 2 +- .../dashboard-ui/components/activitylog.js | 2 +- .../dashboard-ui/components/apphost.js | 2 +- .../components/channelmapper/channelmapper.js | 2 +- .../directorybrowser/directorybrowser.js | 2 +- .../dashboard-ui/components/favoriteitems.js | 2 +- .../components/filterdialog/filterdialog.js | 2 +- .../components/guestinviter/guestinviter.js | 2 +- .../dashboard-ui/components/humanedate.js | 2 +- .../libraryoptionseditor.js | 2 +- .../medialibrarycreator.js | 2 +- .../medialibraryeditor/medialibraryeditor.js | 2 +- .../components/navdrawer/navdrawer.js | 2 +- .../dashboard-ui/components/remotecontrol.js | 2 +- .../dashboard-ui/components/tunerpicker.js | 2 +- .../components/tvproviders/schedulesdirect.js | 2 +- .../components/tvproviders/xmltv.js | 2 +- .../components/viewcontainer-lite.js | 2 +- .../dashboard-ui/css/videoosd.css | 2 +- .../dashboard/dashboardgeneral.js | 2 +- .../dashboard/dashboardhosting.js | 2 +- .../dashboard-ui/dashboard/devicesupload.js | 2 +- .../dashboard-ui/dashboard/livetvtuner.js | 2 +- .../dashboard/wizardremoteaccess.js | 2 +- .../dashboard-ui/dashboard/wizardsettings.js | 2 +- .../dashboard-ui/dashboardhosting.html | 15 ++++--- .../dashboard-ui/encodingsettings.html | 7 ---- .../dashboard-ui/home/favorites.js | 2 +- .../dashboard-ui/home/home.js | 2 +- .../dashboard-ui/legacy/fnchecked.js | 2 +- .../dashboard-ui/list/list.js | 2 +- .../dashboard-ui/offline/offline.js | 2 +- .../dashboard-ui/scripts/addpluginpage.js | 2 +- .../dashboard-ui/scripts/apploader.js | 2 +- .../dashboard-ui/scripts/appservices.js | 2 +- .../scripts/camerauploadsettings.js | 2 +- .../dashboard-ui/scripts/connectlogin.js | 2 +- .../dashboard-ui/scripts/dashboardpage.js | 4 +- .../dashboard-ui/scripts/device.js | 2 +- .../dashboard-ui/scripts/devices.js | 2 +- .../dashboard-ui/scripts/dlnaprofile.js | 2 +- .../dashboard-ui/scripts/dlnaprofiles.js | 2 +- .../dashboard-ui/scripts/editorsidebar.js | 2 +- .../dashboard-ui/scripts/encodingsettings.js | 2 +- .../dashboard-ui/scripts/episodes.js | 2 +- .../dashboard-ui/scripts/itemdetailpage.js | 4 +- .../dashboard-ui/scripts/librarybrowser.js | 2 +- .../dashboard-ui/scripts/librarymenu.js | 2 +- .../dashboard-ui/scripts/livetvcomponents.js | 2 +- .../scripts/livetvguideprovider.js | 2 +- .../dashboard-ui/scripts/livetvrecordings.js | 2 +- .../scripts/livetvseriestimers.js | 2 +- .../dashboard-ui/scripts/livetvsuggested.js | 2 +- .../dashboard-ui/scripts/loginpage.js | 2 +- .../dashboard-ui/scripts/managedownloads.js | 2 +- .../dashboard-ui/scripts/medialibrarypage.js | 2 +- .../scripts/metadataimagespage.js | 2 +- .../dashboard-ui/scripts/metadatasubtitles.js | 2 +- .../dashboard-ui/scripts/moviecollections.js | 2 +- .../dashboard-ui/scripts/movies.js | 2 +- .../dashboard-ui/scripts/moviesrecommended.js | 2 +- .../dashboard-ui/scripts/movietrailers.js | 2 +- .../dashboard-ui/scripts/musicalbums.js | 2 +- .../dashboard-ui/scripts/musicartists.js | 2 +- .../dashboard-ui/scripts/musicplaylists.js | 2 +- .../dashboard-ui/scripts/musicrecommended.js | 2 +- .../scripts/mypreferencescommon.js | 2 +- .../scripts/mypreferencesdisplay.js | 2 +- .../dashboard-ui/scripts/mypreferenceshome.js | 2 +- .../scripts/mypreferenceslanguages.js | 2 +- .../scripts/mypreferencessubtitles.js | 2 +- .../dashboard-ui/scripts/myprofile.js | 2 +- .../scripts/notificationindicator.js | 2 +- .../dashboard-ui/scripts/notifications.js | 2 +- .../scripts/notificationsetting.js | 2 +- .../scripts/notificationsettings.js | 2 +- .../dashboard-ui/scripts/plugincatalogpage.js | 2 +- .../dashboard-ui/scripts/scheduledtaskpage.js | 2 +- .../scripts/scheduledtaskspage.js | 2 +- .../dashboard-ui/scripts/selectserver.js | 2 +- .../dashboard-ui/scripts/serversecurity.js | 2 +- .../dashboard-ui/scripts/site.js | 4 +- .../dashboard-ui/scripts/songs.js | 2 +- .../dashboard-ui/scripts/supporterkeypage.js | 2 +- .../dashboard-ui/scripts/taskbutton.js | 2 +- .../dashboard-ui/scripts/tvlatest.js | 2 +- .../dashboard-ui/scripts/tvrecommended.js | 2 +- .../dashboard-ui/scripts/tvshows.js | 2 +- .../dashboard-ui/scripts/tvupcoming.js | 2 +- .../dashboard-ui/scripts/useredit.js | 2 +- .../dashboard-ui/scripts/userlibraryaccess.js | 2 +- .../dashboard-ui/scripts/usernew.js | 2 +- .../scripts/userparentalcontrol.js | 2 +- .../dashboard-ui/scripts/userpassword.js | 2 +- .../dashboard-ui/scripts/userprofilespage.js | 2 +- .../dashboard-ui/scripts/videoosd.js | 2 +- .../dashboard-ui/scripts/wizardagreement.js | 2 +- .../dashboard-ui/scripts/wizarduserpage.js | 2 +- .../dashboard-ui/strings/ar.json | 15 +++---- .../dashboard-ui/strings/be-BY.json | 19 +++++---- .../dashboard-ui/strings/bg-BG.json | 15 +++---- .../dashboard-ui/strings/ca.json | 15 +++---- .../dashboard-ui/strings/cs.json | 15 +++---- .../dashboard-ui/strings/da.json | 15 +++---- .../dashboard-ui/strings/de.json | 15 +++---- .../dashboard-ui/strings/el.json | 15 +++---- .../dashboard-ui/strings/en-GB.json | 15 +++---- .../dashboard-ui/strings/en-US.json | 9 +++- .../dashboard-ui/strings/es-AR.json | 19 +++++---- .../dashboard-ui/strings/es-MX.json | 15 +++---- .../dashboard-ui/strings/es.json | 15 +++---- .../dashboard-ui/strings/fa.json | 17 ++++---- .../dashboard-ui/strings/fi.json | 15 +++---- .../dashboard-ui/strings/fr-CA.json | 19 +++++---- .../dashboard-ui/strings/fr.json | 19 +++++---- .../dashboard-ui/strings/gsw.json | 15 +++---- .../dashboard-ui/strings/he.json | 15 +++---- .../dashboard-ui/strings/hi-IN.json | 19 +++++---- .../dashboard-ui/strings/hr.json | 15 +++---- .../dashboard-ui/strings/hu.json | 19 +++++---- .../dashboard-ui/strings/id.json | 15 +++---- .../dashboard-ui/strings/it.json | 15 +++---- .../dashboard-ui/strings/kk.json | 15 +++---- .../dashboard-ui/strings/ko.json | 15 +++---- .../dashboard-ui/strings/lt-LT.json | 15 +++---- .../dashboard-ui/strings/ms.json | 19 +++++---- .../dashboard-ui/strings/nb.json | 15 +++---- .../dashboard-ui/strings/nl.json | 15 +++---- .../dashboard-ui/strings/pl.json | 15 +++---- .../dashboard-ui/strings/pt-BR.json | 15 +++---- .../dashboard-ui/strings/pt-PT.json | 15 +++---- .../dashboard-ui/strings/ro.json | 15 +++---- .../dashboard-ui/strings/ru.json | 21 +++++----- .../dashboard-ui/strings/sk.json | 17 ++++---- .../dashboard-ui/strings/sl-SI.json | 19 +++++---- .../dashboard-ui/strings/sv.json | 15 +++---- .../dashboard-ui/strings/tr.json | 15 +++---- .../dashboard-ui/strings/uk.json | 19 +++++---- .../dashboard-ui/strings/vi.json | 15 +++---- .../dashboard-ui/strings/zh-CN.json | 23 +++++----- .../dashboard-ui/strings/zh-HK.json | 15 +++---- .../dashboard-ui/strings/zh-TW.json | 15 +++---- .../thirdparty/jquerymobile/jqm.panel.js | 2 +- .../thirdparty/jquerymobile/jqm.popup.js | 2 +- .../thirdparty/jquerymobile/jqm.widget.js | 2 +- .../dashboard-ui/videoosd.html | 3 -- 341 files changed, 863 insertions(+), 653 deletions(-) create mode 100644 MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/loadingdialog/loadingdialog.js diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/Sortable/knockout-sortable.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/Sortable/knockout-sortable.js index ca4657f18e..387aa64e67 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/Sortable/knockout-sortable.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/Sortable/knockout-sortable.js @@ -1 +1 @@ -!function(factory){"use strict";if("function"==typeof define&&define.amd)define(["knockout"],factory);else if("function"==typeof require&&"object"==typeof exports&&"object"==typeof module){var ko=require("knockout");factory(ko)}else factory(window.ko)}(function(ko){"use strict";var init=function(element,valueAccessor,allBindings,viewModel,bindingContext,sortableOptions){var options=buildOptions(valueAccessor,sortableOptions);["onStart","onEnd","onRemove","onAdd","onUpdate","onSort","onFilter"].forEach(function(e){(options[e]||eventHandlers[e])&&(options[e]=function(eventType,parentVM,parentBindings,handler,e){var itemVM=ko.dataFor(e.item),bindings=ko.utils.peekObservable(parentBindings()),bindingHandlerBinding=bindings.sortable||bindings.draggable,collection=bindingHandlerBinding.collection||bindingHandlerBinding.foreach;handler&&handler(e,itemVM,parentVM,collection,bindings),eventHandlers[eventType]&&eventHandlers[eventType](e,itemVM,parentVM,collection,bindings)}.bind(void 0,e,viewModel,allBindings,options[e]))});var sortableElement=Sortable.create(element,options);return ko.utils.domNodeDisposal.addDisposeCallback(element,function(){sortableElement.destroy()}),ko.bindingHandlers.template.init(element,valueAccessor)},update=function(element,valueAccessor,allBindings,viewModel,bindingContext,sortableOptions){return ko.bindingHandlers.template.update(element,valueAccessor,allBindings,viewModel,bindingContext)},eventHandlers=function(handlers){var moveOperations=[],tryMoveOperation=function(e,itemVM,parentVM,collection,parentBindings){var currentOperation={event:e,itemVM:itemVM,parentVM:parentVM,collection:collection,parentBindings:parentBindings},existingOperation=moveOperations.filter(function(op){return op.itemVM===currentOperation.itemVM})[0];if(existingOperation){moveOperations.splice(moveOperations.indexOf(existingOperation),1);var removeOperation="remove"===currentOperation.event.type?currentOperation:existingOperation,addOperation="add"===currentOperation.event.type?currentOperation:existingOperation;moveItem(itemVM,removeOperation.collection,addOperation.collection,addOperation.event.clone,addOperation.event)}else moveOperations.push(currentOperation)},moveItem=function(itemVM,from,to,clone,e){var fromArray=from(),originalIndex=fromArray.indexOf(itemVM),newIndex=e.newIndex;e.item.previousElementSibling&&(newIndex=fromArray.indexOf(ko.dataFor(e.item.previousElementSibling)),originalIndex>newIndex&&(newIndex+=1)),e.item.parentNode.removeChild(e.item),fromArray.splice(originalIndex,1),from.valueHasMutated(),clone&&from!==to&&(fromArray.splice(originalIndex,0,itemVM),from.valueHasMutated()),to().splice(newIndex,0,itemVM),to.valueHasMutated()};return handlers.onRemove=tryMoveOperation,handlers.onAdd=tryMoveOperation,handlers.onUpdate=function(e,itemVM,parentVM,collection,parentBindings){moveItem(itemVM,collection,collection,!1,e)},handlers}({}),buildOptions=function(bindingOptions,options){var merge=function(into,from){for(var prop in from)"[object Object]"===Object.prototype.toString.call(from[prop])?("[object Object]"!==Object.prototype.toString.call(into[prop])&&(into[prop]={}),into[prop]=merge(into[prop],from[prop])):into[prop]=from[prop];return into},unwrappedOptions=ko.utils.peekObservable(bindingOptions()).options||{};return options=merge({},options),unwrappedOptions.group&&"[object Object]"!==Object.prototype.toString.call(unwrappedOptions.group)&&(unwrappedOptions.group={name:unwrappedOptions.group}),merge(options,unwrappedOptions)};ko.bindingHandlers.draggable={sortableOptions:{group:{pull:"clone",put:!1},sort:!1},init:function(element,valueAccessor,allBindings,viewModel,bindingContext){return init(element,valueAccessor,allBindings,viewModel,bindingContext,ko.bindingHandlers.draggable.sortableOptions)},update:function(element,valueAccessor,allBindings,viewModel,bindingContext){return update(element,valueAccessor,allBindings,viewModel,bindingContext,ko.bindingHandlers.draggable.sortableOptions)}},ko.bindingHandlers.sortable={sortableOptions:{group:{pull:!0,put:!0}},init:function(element,valueAccessor,allBindings,viewModel,bindingContext){return init(element,valueAccessor,allBindings,viewModel,bindingContext,ko.bindingHandlers.sortable.sortableOptions)},update:function(element,valueAccessor,allBindings,viewModel,bindingContext){return update(element,valueAccessor,allBindings,viewModel,bindingContext,ko.bindingHandlers.sortable.sortableOptions)}}}); \ No newline at end of file +!function(factory){"use strict";if("function"==typeof define&&define.amd)define(["knockout"],factory);else if("function"==typeof require&&"object"==typeof exports&&"object"==typeof module){var ko=require("knockout");factory(ko)}else factory(window.ko)}(function(ko){"use strict";var init=function(element,valueAccessor,allBindings,viewModel,bindingContext,sortableOptions){var options=buildOptions(valueAccessor,sortableOptions);["onStart","onEnd","onRemove","onAdd","onUpdate","onSort","onFilter"].forEach(function(e){(options[e]||eventHandlers[e])&&(options[e]=function(eventType,parentVM,parentBindings,handler,e){var itemVM=ko.dataFor(e.item),bindings=ko.utils.peekObservable(parentBindings()),bindingHandlerBinding=bindings.sortable||bindings.draggable,collection=bindingHandlerBinding.collection||bindingHandlerBinding.foreach;handler&&handler(e,itemVM,parentVM,collection,bindings),eventHandlers[eventType]&&eventHandlers[eventType](e,itemVM,parentVM,collection,bindings)}.bind(void 0,e,viewModel,allBindings,options[e]))});var sortableElement=Sortable.create(element,options);return ko.utils.domNodeDisposal.addDisposeCallback(element,function(){sortableElement.destroy()}),ko.bindingHandlers.template.init(element,valueAccessor)},update=function(element,valueAccessor,allBindings,viewModel,bindingContext,sortableOptions){return ko.bindingHandlers.template.update(element,valueAccessor,allBindings,viewModel,bindingContext)},eventHandlers=function(handlers){var moveOperations=[],tryMoveOperation=function(e,itemVM,parentVM,collection,parentBindings){var currentOperation={event:e,itemVM:itemVM,parentVM:parentVM,collection:collection,parentBindings:parentBindings},existingOperation=moveOperations.filter(function(op){return op.itemVM===currentOperation.itemVM})[0];if(existingOperation){moveOperations.splice(moveOperations.indexOf(existingOperation),1);var removeOperation="remove"===currentOperation.event.type?currentOperation:existingOperation,addOperation="add"===currentOperation.event.type?currentOperation:existingOperation;moveItem(itemVM,removeOperation.collection,addOperation.collection,addOperation.event.clone,addOperation.event)}else moveOperations.push(currentOperation)},moveItem=function(itemVM,from,to,clone,e){var fromArray=from(),originalIndex=fromArray.indexOf(itemVM),newIndex=e.newIndex;e.item.previousElementSibling&&(newIndex=fromArray.indexOf(ko.dataFor(e.item.previousElementSibling)),originalIndex>newIndex&&(newIndex+=1)),e.item.parentNode.removeChild(e.item),fromArray.splice(originalIndex,1),from.valueHasMutated(),clone&&from!==to&&(fromArray.splice(originalIndex,0,itemVM),from.valueHasMutated()),to().splice(newIndex,0,itemVM),to.valueHasMutated()};return handlers.onRemove=tryMoveOperation,handlers.onAdd=tryMoveOperation,handlers.onUpdate=function(e,itemVM,parentVM,collection,parentBindings){moveItem(itemVM,collection,collection,!1,e)},handlers}({}),buildOptions=function(bindingOptions,options){var merge=function(into,from){for(var prop in from)"[object Object]"===Object.prototype.toString.call(from[prop])?("[object Object]"!==Object.prototype.toString.call(into[prop])&&(into[prop]={}),into[prop]=merge(into[prop],from[prop])):into[prop]=from[prop];return into},unwrappedOptions=ko.utils.peekObservable(bindingOptions()).options||{};return options=merge({},options),unwrappedOptions.group&&"[object Object]"!==Object.prototype.toString.call(unwrappedOptions.group)&&(unwrappedOptions.group={name:unwrappedOptions.group}),merge(options,unwrappedOptions)};ko.bindingHandlers.draggable={sortableOptions:{group:{pull:"clone",put:!1},sort:!1},init:function(element,valueAccessor,allBindings,viewModel,bindingContext){return init(element,valueAccessor,allBindings,viewModel,0,ko.bindingHandlers.draggable.sortableOptions)},update:function(element,valueAccessor,allBindings,viewModel,bindingContext){return update(element,valueAccessor,allBindings,viewModel,bindingContext,ko.bindingHandlers.draggable.sortableOptions)}},ko.bindingHandlers.sortable={sortableOptions:{group:{pull:!0,put:!0}},init:function(element,valueAccessor,allBindings,viewModel,bindingContext){return init(element,valueAccessor,allBindings,viewModel,0,ko.bindingHandlers.sortable.sortableOptions)},update:function(element,valueAccessor,allBindings,viewModel,bindingContext){return update(element,valueAccessor,allBindings,viewModel,bindingContext,ko.bindingHandlers.sortable.sortableOptions)}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/Sortable/ng-sortable.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/Sortable/ng-sortable.js index 9ad7b459d9..47890a3b49 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/Sortable/ng-sortable.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/Sortable/ng-sortable.js @@ -1 +1 @@ -!function(factory){"use strict";"function"==typeof define&&define.amd?define(["angular","./Sortable"],factory):"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?(require("angular"),factory(angular,require("./Sortable")),module.exports="ng-sortable"):window.angular&&window.Sortable&&factory(angular,Sortable)}(function(angular,Sortable){"use strict";var expando="Sortable:ng-sortable";angular.module("ng-sortable",[]).constant("ngSortableVersion","0.4.0").constant("ngSortableConfig",{}).directive("ngSortable",["$parse","ngSortableConfig",function($parse,ngSortableConfig){var removed,nextSibling,getSourceFactory=function(el,scope){var ngRepeat=[].filter.call(el.childNodes,function(node){return 8===node.nodeType&&node.nodeValue.indexOf("ngRepeat:")!==-1})[0];if(!ngRepeat)return function(){return null};ngRepeat=ngRepeat.nodeValue.match(/ngRepeat:\s*(?:\(.*?,\s*)?([^\s)]+)[\s)]+in\s+([^\s|]+)/);var itemsExpr=$parse(ngRepeat[2]);return function(){return itemsExpr(scope.$parent)||[]}};return{restrict:"AC",scope:{ngSortable:"=?"},link:function(scope,$el){function _emitEvent(evt,item){var name="on"+evt.type.charAt(0).toUpperCase()+evt.type.substr(1),source=getSource();options[name]&&options[name]({model:item||source[evt.newIndex],models:source,oldIndex:evt.oldIndex,newIndex:evt.newIndex})}function _sync(evt){var items=getSource();if(items){var oldIndex=evt.oldIndex,newIndex=evt.newIndex;if(el!==evt.from){var prevItems=evt.from[expando]();removed=prevItems[oldIndex],evt.clone?(removed=angular.copy(removed),prevItems.splice(Sortable.utils.index(evt.clone),0,prevItems.splice(oldIndex,1)[0]),evt.from.removeChild(evt.clone)):prevItems.splice(oldIndex,1),items.splice(newIndex,0,removed),evt.from.insertBefore(evt.item,nextSibling)}else items.splice(newIndex,0,items.splice(oldIndex,1)[0]);scope.$apply()}}var sortable,el=$el[0],options=angular.extend(scope.ngSortable||{},ngSortableConfig),watchers=[],getSource=getSourceFactory(el,scope);el[expando]=getSource,sortable=Sortable.create(el,Object.keys(options).reduce(function(opts,name){return opts[name]=opts[name]||options[name],opts},{onStart:function(evt){nextSibling=evt.item.nextSibling,_emitEvent(evt),scope.$apply()},onEnd:function(evt){_emitEvent(evt,removed),scope.$apply()},onAdd:function(evt){_sync(evt),_emitEvent(evt,removed),scope.$apply()},onUpdate:function(evt){_sync(evt),_emitEvent(evt)},onRemove:function(evt){_emitEvent(evt,removed)},onSort:function(evt){_emitEvent(evt)}})),$el.on("$destroy",function(){angular.forEach(watchers,function(unwatch){unwatch()}),sortable.destroy(),el[expando]=null,el=null,watchers=null,sortable=null,nextSibling=null}),angular.forEach(["sort","disabled","draggable","handle","animation","group","ghostClass","filter","onStart","onEnd","onAdd","onUpdate","onRemove","onSort"],function(name){watchers.push(scope.$watch("ngSortable."+name,function(value){void 0!==value&&(options[name]=value,/^on[A-Z]/.test(name)||sortable.option(name,value))}))})}}}])}); \ No newline at end of file +!function(factory){"use strict";"function"==typeof define&&define.amd?define(["angular","./Sortable"],factory):"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?(require("angular"),factory(angular,require("./Sortable")),module.exports="ng-sortable"):window.angular&&window.Sortable&&factory(angular,Sortable)}(function(angular,Sortable){"use strict";var expando="Sortable:ng-sortable";angular.module("ng-sortable",[]).constant("ngSortableVersion","0.4.0").constant("ngSortableConfig",{}).directive("ngSortable",["$parse","ngSortableConfig",function($parse,ngSortableConfig){var removed,nextSibling,getSourceFactory=function(el,scope){var ngRepeat=[].filter.call(el.childNodes,function(node){return 8===node.nodeType&&-1!==node.nodeValue.indexOf("ngRepeat:")})[0];if(!ngRepeat)return function(){return null};ngRepeat=ngRepeat.nodeValue.match(/ngRepeat:\s*(?:\(.*?,\s*)?([^\s)]+)[\s)]+in\s+([^\s|]+)/);var itemsExpr=$parse(ngRepeat[2]);return function(){return itemsExpr(scope.$parent)||[]}};return{restrict:"AC",scope:{ngSortable:"=?"},link:function(scope,$el){function _emitEvent(evt,item){var name="on"+evt.type.charAt(0).toUpperCase()+evt.type.substr(1),source=getSource();options[name]&&options[name]({model:item||source[evt.newIndex],models:source,oldIndex:evt.oldIndex,newIndex:evt.newIndex})}function _sync(evt){var items=getSource();if(items){var oldIndex=evt.oldIndex,newIndex=evt.newIndex;if(el!==evt.from){var prevItems=evt.from[expando]();removed=prevItems[oldIndex],evt.clone?(removed=angular.copy(removed),prevItems.splice(Sortable.utils.index(evt.clone),0,prevItems.splice(oldIndex,1)[0]),evt.from.removeChild(evt.clone)):prevItems.splice(oldIndex,1),items.splice(newIndex,0,removed),evt.from.insertBefore(evt.item,nextSibling)}else items.splice(newIndex,0,items.splice(oldIndex,1)[0]);scope.$apply()}}var sortable,el=$el[0],options=angular.extend(scope.ngSortable||{},ngSortableConfig),watchers=[],getSource=getSourceFactory(el,scope);el[expando]=getSource,sortable=Sortable.create(el,Object.keys(options).reduce(function(opts,name){return opts[name]=opts[name]||options[name],opts},{onStart:function(evt){nextSibling=evt.item.nextSibling,_emitEvent(evt),scope.$apply()},onEnd:function(evt){_emitEvent(evt,removed),scope.$apply()},onAdd:function(evt){_sync(evt),_emitEvent(evt,removed),scope.$apply()},onUpdate:function(evt){_sync(evt),_emitEvent(evt)},onRemove:function(evt){_emitEvent(evt,removed)},onSort:function(evt){_emitEvent(evt)}})),$el.on("$destroy",function(){angular.forEach(watchers,function(unwatch){unwatch()}),sortable.destroy(),el[expando]=null,el=null,watchers=null,sortable=null,nextSibling=null}),angular.forEach(["sort","disabled","draggable","handle","animation","group","ghostClass","filter","onStart","onEnd","onAdd","onUpdate","onRemove","onSort"],function(name){watchers.push(scope.$watch("ngSortable."+name,function(value){void 0!==value&&(options[name]=value,/^on[A-Z]/.test(name)||sortable.option(name,value))}))})}}}])}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/Sortable/react-sortable-mixin.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/Sortable/react-sortable-mixin.js index 4492ee7c84..ec578ed833 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/Sortable/react-sortable-mixin.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/Sortable/react-sortable-mixin.js @@ -1 +1 @@ -!function(factory){"use strict";"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=factory(require("./Sortable")):"function"==typeof define&&define.amd?define(["./Sortable"],factory):window.SortableMixin=factory(Sortable)}(function(Sortable){"use strict";function _getModelName(component){return component.sortableOptions&&component.sortableOptions.model||_defaultOptions.model}function _getModelItems(component){var name=_getModelName(component),items=component.state&&component.state[name]||component.props[name];return items.slice()}function _extend(dst,src){for(var key in src)src.hasOwnProperty(key)&&(dst[key]=src[key]);return dst}var _nextSibling,_activeComponent,_defaultOptions={ref:"list",model:"items",animation:100,onStart:"handleStart",onEnd:"handleEnd",onAdd:"handleAdd",onUpdate:"handleUpdate",onRemove:"handleRemove",onSort:"handleSort",onFilter:"handleFilter",onMove:"handleMove"},SortableMixin={sortableMixinVersion:"0.1.1",_sortableInstance:null,componentDidMount:function(){var DOMNode,options=_extend(_extend({},_defaultOptions),this.sortableOptions||{}),copyOptions=_extend({},options),emitEvent=function(type,evt){var method=this[options[type]];method&&method.call(this,evt,this._sortableInstance)}.bind(this);"onStart onEnd onAdd onSort onUpdate onRemove onFilter onMove".split(" ").forEach(function(name){copyOptions[name]=function(evt){if("onStart"===name)_nextSibling=evt.item.nextElementSibling,_activeComponent=this;else if("onAdd"===name||"onUpdate"===name){evt.from.insertBefore(evt.item,_nextSibling);var remoteItems,item,newState={},remoteState={},oldIndex=evt.oldIndex,newIndex=evt.newIndex,items=_getModelItems(this);"onAdd"===name?(remoteItems=_getModelItems(_activeComponent),item=remoteItems.splice(oldIndex,1)[0],items.splice(newIndex,0,item),remoteState[_getModelName(_activeComponent)]=remoteItems):items.splice(newIndex,0,items.splice(oldIndex,1)[0]),newState[_getModelName(this)]=items,copyOptions.stateHandler?this[copyOptions.stateHandler](newState):this.setState(newState),this!==_activeComponent&&_activeComponent.setState(remoteState)}setTimeout(function(){emitEvent(name,evt)},0)}.bind(this)},this),DOMNode=this.getDOMNode()?(this.refs[options.ref]||this).getDOMNode():this.refs[options.ref]||this,this._sortableInstance=Sortable.create(DOMNode,copyOptions)},componentWillReceiveProps:function(nextProps){var newState={},modelName=_getModelName(this),items=nextProps[modelName];items&&(newState[modelName]=items,this.setState(newState))},componentWillUnmount:function(){this._sortableInstance.destroy(),this._sortableInstance=null}};return SortableMixin}); \ No newline at end of file +!function(factory){"use strict";"undefined"!=typeof module&&void 0!==module.exports?module.exports=factory(require("./Sortable")):"function"==typeof define&&define.amd?define(["./Sortable"],factory):window.SortableMixin=factory(Sortable)}(function(Sortable){"use strict";function _getModelName(component){return component.sortableOptions&&component.sortableOptions.model||_defaultOptions.model}function _getModelItems(component){var name=_getModelName(component);return(component.state&&component.state[name]||component.props[name]).slice()}function _extend(dst,src){for(var key in src)src.hasOwnProperty(key)&&(dst[key]=src[key]);return dst}var _nextSibling,_activeComponent,_defaultOptions={ref:"list",model:"items",animation:100,onStart:"handleStart",onEnd:"handleEnd",onAdd:"handleAdd",onUpdate:"handleUpdate",onRemove:"handleRemove",onSort:"handleSort",onFilter:"handleFilter",onMove:"handleMove"};return{sortableMixinVersion:"0.1.1",_sortableInstance:null,componentDidMount:function(){var DOMNode,options=_extend(_extend({},_defaultOptions),this.sortableOptions||{}),copyOptions=_extend({},options),emitEvent=function(type,evt){var method=this[options[type]];method&&method.call(this,evt,this._sortableInstance)}.bind(this);"onStart onEnd onAdd onSort onUpdate onRemove onFilter onMove".split(" ").forEach(function(name){copyOptions[name]=function(evt){if("onStart"===name)_nextSibling=evt.item.nextElementSibling,_activeComponent=this;else if("onAdd"===name||"onUpdate"===name){evt.from.insertBefore(evt.item,_nextSibling);var remoteItems,item,newState={},remoteState={},oldIndex=evt.oldIndex,newIndex=evt.newIndex,items=_getModelItems(this);"onAdd"===name?(remoteItems=_getModelItems(_activeComponent),item=remoteItems.splice(oldIndex,1)[0],items.splice(newIndex,0,item),remoteState[_getModelName(_activeComponent)]=remoteItems):items.splice(newIndex,0,items.splice(oldIndex,1)[0]),newState[_getModelName(this)]=items,copyOptions.stateHandler?this[copyOptions.stateHandler](newState):this.setState(newState),this!==_activeComponent&&_activeComponent.setState(remoteState)}setTimeout(function(){emitEvent(name,evt)},0)}.bind(this)},this),DOMNode=this.getDOMNode()?(this.refs[options.ref]||this).getDOMNode():this.refs[options.ref]||this,this._sortableInstance=Sortable.create(DOMNode,copyOptions)},componentWillReceiveProps:function(nextProps){var newState={},modelName=_getModelName(this),items=nextProps[modelName];items&&(newState[modelName]=items,this.setState(newState))},componentWillUnmount:function(){this._sortableInstance.destroy(),this._sortableInstance=null}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/Swiper/gulpfile.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/Swiper/gulpfile.js index 9125c87dc8..82db03a400 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/Swiper/gulpfile.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/Swiper/gulpfile.js @@ -1 +1 @@ -!function(){"use strict";function addJSIndent(file,t,minusIndent){var addIndent=" ",filename=file.path.split("src/js/")[1];if(["wrap-start.js","wrap-start-umd.js","wrap-end.js","wrap-end-umd.js","amd.js"].indexOf(filename)!==-1&&(addIndent=""),"swiper-intro.js"!==filename&&"swiper-intro-f7.js"!==filename&&"swiper-outro.js"!==filename&&"dom.js"!==filename&&"get-dom-lib.js"!==filename&&"get-jquery.js"!==filename&&"dom-plugins.js"!==filename&&"swiper-proto.js"!==filename||(addIndent=" "),minusIndent&&(addIndent=addIndent.substring(4)),""!==addIndent){for(var fileLines=fs.readFileSync(file.path).toString().split("\n"),newFileContents="",i=0;i"," * <%= pkg.description %>"," * "," * <%= pkg.homepage %>"," * "," * Copyright <%= date.year %>, <%= pkg.author %>"," * The iDangero.us"," * http://www.idangero.us/"," * ",' * Licensed under <%= pkg.license.join(" & ") %>'," * "," * Released on: <%= date.month %> <%= date.day %>, <%= date.year %>"," */",""].join("\n"),date:{year:(new Date).getFullYear(),month:"January February March April May June July August September October November December".split(" ")[(new Date).getMonth()],day:(new Date).getDate()}};gulp.task("scripts",function(cb){gulp.src(swiper.jsFiles).pipe(tap(function(file,t){addJSIndent(file,t)})).pipe(sourcemaps.init()).pipe(concat(swiper.filename+".js")).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(jshint()).pipe(jshint.reporter(stylish)).pipe(sourcemaps.write("./maps/")).pipe(gulp.dest(paths.build.scripts)),gulp.src(swiper.jQueryFiles).pipe(tap(function(file,t){addJSIndent(file,t)})).pipe(sourcemaps.init()).pipe(concat(swiper.filename+".jquery.js")).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(sourcemaps.write("./maps/")).pipe(gulp.dest(paths.build.scripts)),gulp.src(swiper.jQueryUMDFiles).pipe(tap(function(file,t){addJSIndent(file,t)})).pipe(sourcemaps.init()).pipe(concat(swiper.filename+".jquery.umd.js")).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(sourcemaps.write("./maps/")).pipe(gulp.dest(paths.build.scripts)),gulp.src(swiper.Framework7Files).pipe(tap(function(file,t){addJSIndent(file,t,!0)})).pipe(sourcemaps.init()).pipe(concat(swiper.filename+".framework7.js")).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(sourcemaps.write("./maps/")).pipe(gulp.dest(paths.build.scripts)).pipe(connect.reload()),cb()}),gulp.task("styles",function(cb){gulp.src(paths.source.styles+"swiper.less").pipe(less({paths:[path.join(__dirname,"less","includes")]})).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(rename(function(path){path.basename=swiper.filename})).pipe(gulp.dest(paths.build.styles)).pipe(connect.reload()),gulp.src([paths.source.styles+"core.less",paths.source.styles+"navigation-f7.less",paths.source.styles+"effects.less",paths.source.styles+"scrollbar.less",paths.source.styles+"preloader-f7.less"]).pipe(concat(swiper.filename+".framework7.less")).pipe(header("/* === Swiper === */\n")).pipe(gulp.dest(paths.build.styles)),cb()}),gulp.task("build",["scripts","styles"],function(cb){cb()}),gulp.task("dist",function(){gulp.src([paths.build.scripts+swiper.filename+".js"]).pipe(gulp.dest(paths.dist.scripts)).pipe(sourcemaps.init()).pipe(uglify()).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(rename(function(path){path.basename=swiper.filename+".min"})).pipe(sourcemaps.write("./maps")).pipe(gulp.dest(paths.dist.scripts)),gulp.src([paths.build.scripts+swiper.filename+".jquery.js"]).pipe(gulp.dest(paths.dist.scripts)).pipe(sourcemaps.init()).pipe(uglify()).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(rename(function(path){path.basename=swiper.filename+".jquery.min"})).pipe(sourcemaps.write("./maps")).pipe(gulp.dest(paths.dist.scripts)),gulp.src([paths.build.scripts+swiper.filename+".jquery.umd.js"]).pipe(gulp.dest(paths.dist.scripts)).pipe(sourcemaps.init()).pipe(uglify()).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(rename(function(path){path.basename=swiper.filename+".jquery.umd.min"})).pipe(sourcemaps.write("./maps")).pipe(gulp.dest(paths.dist.scripts)),gulp.src(paths.build.styles+"*.css").pipe(gulp.dest(paths.dist.styles)).pipe(minifyCSS({advanced:!1,aggressiveMerging:!1})).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(rename(function(path){path.basename=swiper.filename+".min"})).pipe(gulp.dest(paths.dist.styles))}),gulp.task("watch",function(){gulp.watch(paths.source.scripts,["scripts"]),gulp.watch(paths.source.styles+"*.less",["styles"])}),gulp.task("connect",function(){return connect.server({root:[paths.root],livereload:!0,port:"3000"})}),gulp.task("open",function(){return gulp.src(paths.playground.root+"index.html").pipe(open({uri:"http://localhost:3000/"+paths.playground.root+"index.html"}))}),gulp.task("server",["watch","connect","open"]),gulp.task("default",["server"])}(); \ No newline at end of file +!function(){"use strict";function addJSIndent(file,t,minusIndent){var addIndent=" ",filename=file.path.split("src/js/")[1];if(-1!==["wrap-start.js","wrap-start-umd.js","wrap-end.js","wrap-end-umd.js","amd.js"].indexOf(filename)&&(addIndent=""),"swiper-intro.js"!==filename&&"swiper-intro-f7.js"!==filename&&"swiper-outro.js"!==filename&&"dom.js"!==filename&&"get-dom-lib.js"!==filename&&"get-jquery.js"!==filename&&"dom-plugins.js"!==filename&&"swiper-proto.js"!==filename||(addIndent=" "),minusIndent&&(addIndent=addIndent.substring(4)),""!==addIndent){for(var fileLines=fs.readFileSync(file.path).toString().split("\n"),newFileContents="",i=0;i"," * <%= pkg.description %>"," * "," * <%= pkg.homepage %>"," * "," * Copyright <%= date.year %>, <%= pkg.author %>"," * The iDangero.us"," * http://www.idangero.us/"," * ",' * Licensed under <%= pkg.license.join(" & ") %>'," * "," * Released on: <%= date.month %> <%= date.day %>, <%= date.year %>"," */",""].join("\n"),date:{year:(new Date).getFullYear(),month:"January February March April May June July August September October November December".split(" ")[(new Date).getMonth()],day:(new Date).getDate()}};gulp.task("scripts",function(cb){gulp.src(swiper.jsFiles).pipe(tap(function(file,t){addJSIndent(file,t)})).pipe(sourcemaps.init()).pipe(concat(swiper.filename+".js")).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(jshint()).pipe(jshint.reporter(stylish)).pipe(sourcemaps.write("./maps/")).pipe(gulp.dest(paths.build.scripts)),gulp.src(swiper.jQueryFiles).pipe(tap(function(file,t){addJSIndent(file,t)})).pipe(sourcemaps.init()).pipe(concat(swiper.filename+".jquery.js")).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(sourcemaps.write("./maps/")).pipe(gulp.dest(paths.build.scripts)),gulp.src(swiper.jQueryUMDFiles).pipe(tap(function(file,t){addJSIndent(file,t)})).pipe(sourcemaps.init()).pipe(concat(swiper.filename+".jquery.umd.js")).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(sourcemaps.write("./maps/")).pipe(gulp.dest(paths.build.scripts)),gulp.src(swiper.Framework7Files).pipe(tap(function(file,t){addJSIndent(file,t,!0)})).pipe(sourcemaps.init()).pipe(concat(swiper.filename+".framework7.js")).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(sourcemaps.write("./maps/")).pipe(gulp.dest(paths.build.scripts)).pipe(connect.reload()),cb()}),gulp.task("styles",function(cb){gulp.src(paths.source.styles+"swiper.less").pipe(less({paths:[path.join(__dirname,"less","includes")]})).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(rename(function(path){path.basename=swiper.filename})).pipe(gulp.dest(paths.build.styles)).pipe(connect.reload()),gulp.src([paths.source.styles+"core.less",paths.source.styles+"navigation-f7.less",paths.source.styles+"effects.less",paths.source.styles+"scrollbar.less",paths.source.styles+"preloader-f7.less"]).pipe(concat(swiper.filename+".framework7.less")).pipe(header("/* === Swiper === */\n")).pipe(gulp.dest(paths.build.styles)),cb()}),gulp.task("build",["scripts","styles"],function(cb){cb()}),gulp.task("dist",function(){gulp.src([paths.build.scripts+swiper.filename+".js"]).pipe(gulp.dest(paths.dist.scripts)).pipe(sourcemaps.init()).pipe(uglify()).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(rename(function(path){path.basename=swiper.filename+".min"})).pipe(sourcemaps.write("./maps")).pipe(gulp.dest(paths.dist.scripts)),gulp.src([paths.build.scripts+swiper.filename+".jquery.js"]).pipe(gulp.dest(paths.dist.scripts)).pipe(sourcemaps.init()).pipe(uglify()).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(rename(function(path){path.basename=swiper.filename+".jquery.min"})).pipe(sourcemaps.write("./maps")).pipe(gulp.dest(paths.dist.scripts)),gulp.src([paths.build.scripts+swiper.filename+".jquery.umd.js"]).pipe(gulp.dest(paths.dist.scripts)).pipe(sourcemaps.init()).pipe(uglify()).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(rename(function(path){path.basename=swiper.filename+".jquery.umd.min"})).pipe(sourcemaps.write("./maps")).pipe(gulp.dest(paths.dist.scripts)),gulp.src(paths.build.styles+"*.css").pipe(gulp.dest(paths.dist.styles)).pipe(minifyCSS({advanced:!1,aggressiveMerging:!1})).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(rename(function(path){path.basename=swiper.filename+".min"})).pipe(gulp.dest(paths.dist.styles))}),gulp.task("watch",function(){gulp.watch(paths.source.scripts,["scripts"]),gulp.watch(paths.source.styles+"*.less",["styles"])}),gulp.task("connect",function(){return connect.server({root:[paths.root],livereload:!0,port:"3000"})}),gulp.task("open",function(){return gulp.src(paths.playground.root+"index.html").pipe(open({uri:"http://localhost:3000/"+paths.playground.root+"index.html"}))}),gulp.task("server",["watch","connect","open"]),gulp.task("default",["server"])}(); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/alameda/alameda.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/alameda/alameda.js index eeb8362f8d..8f8d95207a 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/alameda/alameda.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/alameda/alameda.js @@ -1 +1 @@ -var requirejs,require,define;!function(global,Promise,undef){function commentReplace(match,singlePrefix){return singlePrefix||""}function hasProp(obj,prop){return hasOwn.call(obj,prop)}function getOwn(obj,prop){return obj&&hasProp(obj,prop)&&obj[prop]}function obj(){return Object.create(null)}function eachProp(obj,func){var prop;for(prop in obj)if(hasProp(obj,prop)&&func(obj[prop],prop))break}function mixin(target,source,force,deepStringMixin){return source&&eachProp(source,function(value,prop){!force&&hasProp(target,prop)||(!deepStringMixin||"object"!=typeof value||!value||Array.isArray(value)||"function"==typeof value||value instanceof RegExp?target[prop]=value:(target[prop]||(target[prop]={}),mixin(target[prop],value,force,deepStringMixin)))}),target}function getGlobal(value){if(!value)return value;var g=global;return value.split(".").forEach(function(part){g=g[part]}),g}function newContext(contextName){function trimDots(ary){var i,part,length=ary.length;for(i=0;i0&&(ary.splice(i-1,2),i-=2)}}function normalize(name,baseName,applyMap){var pkgMain,mapValue,nameParts,i,j,nameSegment,lastIndex,foundMap,foundI,foundStarMap,starI,baseParts=baseName&&baseName.split("/"),normalizedBaseParts=baseParts,map=config.map,starMap=map&&map["*"];if(name&&(name=name.split("/"),lastIndex=name.length-1,config.nodeIdCompat&&jsSuffixRegExp.test(name[lastIndex])&&(name[lastIndex]=name[lastIndex].replace(jsSuffixRegExp,"")),"."===name[0].charAt(0)&&baseParts&&(normalizedBaseParts=baseParts.slice(0,baseParts.length-1),name=normalizedBaseParts.concat(name)),trimDots(name),name=name.join("/")),applyMap&&map&&(baseParts||starMap)){nameParts=name.split("/");outerLoop:for(i=nameParts.length;i>0;i-=1){if(nameSegment=nameParts.slice(0,i).join("/"),baseParts)for(j=baseParts.length;j>0;j-=1)if(mapValue=getOwn(map,baseParts.slice(0,j).join("/")),mapValue&&(mapValue=getOwn(mapValue,nameSegment))){foundMap=mapValue,foundI=i;break outerLoop}!foundStarMap&&starMap&&getOwn(starMap,nameSegment)&&(foundStarMap=getOwn(starMap,nameSegment),starI=i)}!foundMap&&foundStarMap&&(foundMap=foundStarMap,foundI=starI),foundMap&&(nameParts.splice(0,foundI,foundMap),name=nameParts.join("/"))}return pkgMain=getOwn(config.pkgs,name),pkgMain?pkgMain:name}function makeShimExports(value){function fn(){var ret;return value.init&&(ret=value.init.apply(global,arguments)),ret||value.exports&&getGlobal(value.exports)}return fn}function takeQueue(anonId){var i,id,args,shim;for(i=0;i0;i-=1)if(parentModule=syms.slice(0,i).join("/"),parentPath=getOwn(paths,parentModule)){Array.isArray(parentPath)&&(parentPath=parentPath[0]),syms.splice(0,i,parentPath);break}url=syms.join("/"),url+=ext||(/^data\:|^blob\:|\?/.test(url)||skipExt?"":".js"),url=("/"===url.charAt(0)||url.match(/^[\w\+\.\-]+:/)?"":config.baseUrl)+url}return config.urlArgs&&!/^blob\:/.test(url)?url+config.urlArgs(moduleName,url):url},req.toUrl=function(moduleNamePlusExt){var ext,index=moduleNamePlusExt.lastIndexOf("."),segment=moduleNamePlusExt.split("/")[0],isRelative="."===segment||".."===segment;return index!==-1&&(!isRelative||index>1)&&(ext=moduleNamePlusExt.substring(index,moduleNamePlusExt.length),moduleNamePlusExt=moduleNamePlusExt.substring(0,index)),req.nameToUrl(normalize(moduleNamePlusExt,relName),ext,!0)},req.defined=function(id){return makeMap(id,relName,!0).id in defined},req.specified=function(id){return id=makeMap(id,relName,!0).id,id in defined||id in deferreds},req}function resolve(name,d,value){name&&(defined[name]=value,requirejs.onResourceLoad&&requirejs.onResourceLoad(context,d.map,d.deps)),d.finished=!0,d.resolve(value)}function reject(d,err){d.finished=!0,d.rejected=!0,d.reject(err)}function makeNormalize(relName){return function(name){return normalize(name,relName,!0)}}function defineModule(d){d.factoryCalled=!0;var ret,name=d.map.id;try{ret=context.execCb(name,d.factory,d.values,defined[name])}catch(err){return reject(d,err)}name?ret===undef&&(d.cjsModule?ret=d.cjsModule.exports:d.usingExports&&(ret=defined[name])):requireDeferreds.splice(requireDeferreds.indexOf(d),1),resolve(name,d,ret)}function depFinished(val,i){this.rejected||this.depDefined[i]||(this.depDefined[i]=!0,this.depCount+=1,this.values[i]=val,this.depending||this.depCount!==this.depMax||defineModule(this))}function makeDefer(name,calculatedMap){var d={};return d.promise=new Promise(function(resolve,reject){d.resolve=resolve,d.reject=function(err){name||requireDeferreds.splice(requireDeferreds.indexOf(d),1),reject(err)}}),d.map=name?calculatedMap||makeMap(name):{},d.depCount=0,d.depMax=0,d.values=[],d.depDefined=[],d.depFinished=depFinished,d.map.pr&&(d.deps=[makeMap(d.map.pr)]),d}function getDefer(name,calculatedMap){var d;return name?(d=name in deferreds&&deferreds[name],d||(d=deferreds[name]=makeDefer(name,calculatedMap))):(d=makeDefer(),requireDeferreds.push(d)),d}function makeErrback(d,name){return function(err){d.rejected||(err.dynaId||(err.dynaId="id"+(errCount+=1),err.requireModules=[name]),reject(d,err))}}function waitForDep(depMap,relName,d,i){d.depMax+=1,callDep(depMap,relName).then(function(val){d.depFinished(val,i)},makeErrback(d,depMap.id)).catch(makeErrback(d,d.map.id))}function makeLoad(id){function load(value){fromTextCalled||resolve(id,getDefer(id),value)}var fromTextCalled;return load.error=function(err){reject(getDefer(id),err)},load.fromText=function(text,textAlt){var execError,d=getDefer(id),map=makeMap(makeMap(id).n),plainId=map.id;fromTextCalled=!0,d.factory=function(p,val){return val},textAlt&&(text=textAlt),hasProp(config.config,id)&&(config.config[plainId]=config.config[id]);try{req.exec(text)}catch(e){execError=new Error("fromText eval for "+plainId+" failed: "+e),execError.requireType="fromtexteval",reject(d,execError)}takeQueue(plainId),d.deps=[map],waitForDep(map,null,d,d.deps.length)},load}function callPlugin(plugin,map,relName){plugin.load(map.n,makeRequire(relName),makeLoad(map.id),config)}function splitPrefix(name){var prefix,index=name?name.indexOf("!"):-1;return index>-1&&(prefix=name.substring(0,index),name=name.substring(index+1,name.length)),[prefix,name]}function breakCycle(d,traced,processed){var id=d.map.id;traced[id]=!0,!d.finished&&d.deps&&d.deps.forEach(function(depMap){var depId=depMap.id,dep=!hasProp(handlers,depId)&&getDefer(depId,depMap);!dep||dep.finished||processed[depId]||(hasProp(traced,depId)?d.deps.forEach(function(depMap,i){depMap.id===depId&&d.depFinished(defined[depId],i)}):breakCycle(dep,traced,processed))}),processed[id]=!0}function check(d){var err,mid,dfd,notFinished=[],waitInterval=1e3*config.waitSeconds,expired=waitInterval&&startTime+waitInterval<(new Date).getTime();if(0===loadCount&&(d?d.finished||breakCycle(d,{},{}):requireDeferreds.length&&requireDeferreds.forEach(function(d){breakCycle(d,{},{})})),expired){for(mid in deferreds)dfd=deferreds[mid],dfd.finished||notFinished.push(dfd.map.id);err=new Error("Timeout for modules: "+notFinished),err.requireModules=notFinished,err.requireType="timeout",notFinished.forEach(function(id){reject(getDefer(id),err)})}else(loadCount||requireDeferreds.length)&&(checkingLater||(checkingLater=!0,setTimeout(function(){checkingLater=!1,check()},70)))}function delayedError(e){return setTimeout(function(){e.dynaId&&trackedErrors[e.dynaId]||(trackedErrors[e.dynaId]=!0,req.onError(e))}),e}var req,main,makeMap,callDep,handlers,checkingLater,load,context,defined=obj(),waiting=obj(),config={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},mapCache=obj(),requireDeferreds=[],deferreds=obj(),calledDefine=obj(),calledPlugin=obj(),loadCount=0,startTime=(new Date).getTime(),errCount=0,trackedErrors=obj(),urlFetched=obj(),bundlesMap=obj(),asyncResolve=Promise.resolve();return load="function"==typeof importScripts?function(map){var url=map.url;urlFetched[url]||(urlFetched[url]=!0,getDefer(map.id),importScripts(url),takeQueue(map.id))}:function(map){var script,id=map.id,url=map.url;urlFetched[url]||(urlFetched[url]=!0,script=document.createElement("script"),script.setAttribute("data-requiremodule",id),script.type=config.scriptType||"text/javascript",script.charset="utf-8",script.async=!0,loadCount+=1,script.addEventListener("load",function(){loadCount-=1,takeQueue(id)},!1),script.addEventListener("error",function(){loadCount-=1;var err,pathConfig=getOwn(config.paths,id);if(pathConfig&&Array.isArray(pathConfig)&&pathConfig.length>1){script.parentNode.removeChild(script),pathConfig.shift();var d=getDefer(id);d.map=makeMap(id),d.map.url=req.nameToUrl(id),load(d.map)}else err=new Error("Load failed: "+id+": "+script.src),err.requireModules=[id],err.requireType="scripterror",reject(getDefer(id),err)},!1),script.src=url,10===document.documentMode?asap.then(function(){document.head.appendChild(script)}):document.head.appendChild(script))},callDep=function(map,relName){var args,bundleId,name=map.id,shim=config.shim[name];if(name in waiting)args=waiting[name],delete waiting[name],main.apply(undef,args);else if(!(name in deferreds))if(map.pr){if(!(bundleId=getOwn(bundlesMap,name)))return callDep(makeMap(map.pr)).then(function(plugin){var newMap=map.prn?map:makeMap(name,relName,!0),newId=newMap.id,shim=getOwn(config.shim,newId);return newId in calledPlugin||(calledPlugin[newId]=!0,shim&&shim.deps?req(shim.deps,function(){callPlugin(plugin,newMap,relName)}):callPlugin(plugin,newMap,relName)),getDefer(newId).promise});map.url=req.nameToUrl(bundleId),load(map)}else shim&&shim.deps?req(shim.deps,function(){load(map)}):load(map);return getDefer(name).promise},makeMap=function(name,relName,applyMap){if("string"!=typeof name)return name;var plugin,url,parts,prefix,result,prefixNormalized,cacheKey=name+" & "+(relName||"")+" & "+!!applyMap;return parts=splitPrefix(name),prefix=parts[0],name=parts[1],!prefix&&cacheKey in mapCache?mapCache[cacheKey]:(prefix&&(prefix=normalize(prefix,relName,applyMap),plugin=prefix in defined&&defined[prefix]),prefix?plugin&&plugin.normalize?(name=plugin.normalize(name,makeNormalize(relName)),prefixNormalized=!0):name=name.indexOf("!")===-1?normalize(name,relName,applyMap):name:(name=normalize(name,relName,applyMap),parts=splitPrefix(name),prefix=parts[0],name=parts[1],url=req.nameToUrl(name)),result={id:prefix?prefix+"!"+name:name,n:name,pr:prefix,url:url,prn:prefix&&prefixNormalized},prefix||(mapCache[cacheKey]=result),result)},handlers={require:function(name){return makeRequire(name)},exports:function(name){var e=defined[name];return"undefined"!=typeof e?e:defined[name]={}},module:function(name){return{id:name,uri:"",exports:handlers.exports(name),config:function(){return getOwn(config.config,name)||{}}}}},main=function(name,deps,factory,errback,relName){if(name){if(name in calledDefine)return;calledDefine[name]=!0}var d=getDefer(name);return deps&&!Array.isArray(deps)&&(factory=deps,deps=[]),deps=deps?slice.call(deps,0):null,errback||(hasProp(config,"defaultErrback")?config.defaultErrback&&(errback=config.defaultErrback):errback=delayedError),errback&&d.promise.catch(errback),relName=relName||name,"function"==typeof factory?(!deps.length&&factory.length&&(factory.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(match,dep){deps.push(dep)}),deps=(1===factory.length?["require"]:["require","exports","module"]).concat(deps)),d.factory=factory,d.deps=deps,d.depending=!0,deps.forEach(function(depName,i){var depMap;deps[i]=depMap=makeMap(depName,relName,!0),depName=depMap.id,"require"===depName?d.values[i]=handlers.require(name):"exports"===depName?(d.values[i]=handlers.exports(name),d.usingExports=!0):"module"===depName?d.values[i]=d.cjsModule=handlers.module(name):void 0===depName?d.values[i]=void 0:waitForDep(depMap,relName,d,i)}),d.depending=!1,d.depCount===d.depMax&&defineModule(d)):name&&resolve(name,d,factory),startTime=(new Date).getTime(),name||check(d),d.promise},req=makeRequire(null,!0),req.config=function(cfg){if(cfg.context&&cfg.context!==contextName){var existingContext=getOwn(contexts,cfg.context);return existingContext?existingContext.req.config(cfg):newContext(cfg.context).config(cfg)}if(mapCache=obj(),cfg.baseUrl&&"/"!==cfg.baseUrl.charAt(cfg.baseUrl.length-1)&&(cfg.baseUrl+="/"),"string"==typeof cfg.urlArgs){var urlArgs=cfg.urlArgs;cfg.urlArgs=function(id,url){return(url.indexOf("?")===-1?"?":"&")+urlArgs}}var shim=config.shim,objs={paths:!0,bundles:!0,config:!0,map:!0};return eachProp(cfg,function(value,prop){objs[prop]?(config[prop]||(config[prop]={}),mixin(config[prop],value,!0,!0)):config[prop]=value}),cfg.bundles&&eachProp(cfg.bundles,function(value,prop){value.forEach(function(v){v!==prop&&(bundlesMap[v]=prop)})}),cfg.shim&&(eachProp(cfg.shim,function(value,id){Array.isArray(value)&&(value={deps:value}),!value.exports&&!value.init||value.exportsFn||(value.exportsFn=makeShimExports(value)),shim[id]=value}),config.shim=shim),cfg.packages&&cfg.packages.forEach(function(pkgObj){var location,name;pkgObj="string"==typeof pkgObj?{name:pkgObj}:pkgObj,name=pkgObj.name,location=pkgObj.location,location&&(config.paths[name]=pkgObj.location),config.pkgs[name]=pkgObj.name+"/"+(pkgObj.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),(cfg.deps||cfg.callback)&&req(cfg.deps,cfg.callback),req},req.onError=function(err){throw err},context={id:contextName,defined:defined,waiting:waiting,config:config,deferreds:deferreds,req:req,execCb:function(name,callback,args,exports){return callback.apply(exports,args)}},contexts[contextName]=context,req}if(!Promise)throw new Error("No Promise implementation available");var topReq,dataMain,src,subPath,bootstrapConfig=requirejs||require,hasOwn=Object.prototype.hasOwnProperty,contexts={},queue=[],currDirRegExp=/^\.\//,urlRegExp=/^\/|\:|\?|\.js$/,commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,slice=Array.prototype.slice;if("function"!=typeof requirejs){var asap=Promise.resolve(void 0);requirejs=topReq=newContext("_"),"function"!=typeof require&&(require=topReq),topReq.exec=function(text){return eval(text)},topReq.contexts=contexts,define=function(){queue.push(slice.call(arguments,0))},define.amd={jQuery:!0},bootstrapConfig&&topReq.config(bootstrapConfig),topReq.isBrowser&&!contexts._.config.skipDataMain&&(dataMain=document.querySelectorAll("script[data-main]")[0],dataMain=dataMain&&dataMain.getAttribute("data-main"),dataMain&&(dataMain=dataMain.replace(jsSuffixRegExp,""),bootstrapConfig&&bootstrapConfig.baseUrl||dataMain.indexOf("!")!==-1||(src=dataMain.split("/"),dataMain=src.pop(),subPath=src.length?src.join("/")+"/":"./",topReq.config({baseUrl:subPath})),topReq([dataMain])))}}(this,"undefined"!=typeof Promise?Promise:void 0); \ No newline at end of file +var requirejs,require,define;!function(global,Promise,undef){function commentReplace(match,singlePrefix){return singlePrefix||""}function hasProp(obj,prop){return hasOwn.call(obj,prop)}function getOwn(obj,prop){return obj&&hasProp(obj,prop)&&obj[prop]}function obj(){return Object.create(null)}function eachProp(obj,func){var prop;for(prop in obj)if(hasProp(obj,prop)&&func(obj[prop],prop))break}function mixin(target,source,force,deepStringMixin){return source&&eachProp(source,function(value,prop){!force&&hasProp(target,prop)||(!deepStringMixin||"object"!=typeof value||!value||Array.isArray(value)||"function"==typeof value||value instanceof RegExp?target[prop]=value:(target[prop]||(target[prop]={}),mixin(target[prop],value,force,deepStringMixin)))}),target}function getGlobal(value){if(!value)return value;var g=global;return value.split(".").forEach(function(part){g=g[part]}),g}function newContext(contextName){function trimDots(ary){var i,part,length=ary.length;for(i=0;i0&&(ary.splice(i-1,2),i-=2)}}function normalize(name,baseName,applyMap){var mapValue,nameParts,i,j,nameSegment,lastIndex,foundMap,foundI,foundStarMap,starI,baseParts=baseName&&baseName.split("/"),normalizedBaseParts=baseParts,map=config.map,starMap=map&&map["*"];if(name&&(name=name.split("/"),lastIndex=name.length-1,config.nodeIdCompat&&jsSuffixRegExp.test(name[lastIndex])&&(name[lastIndex]=name[lastIndex].replace(jsSuffixRegExp,"")),"."===name[0].charAt(0)&&baseParts&&(normalizedBaseParts=baseParts.slice(0,baseParts.length-1),name=normalizedBaseParts.concat(name)),trimDots(name),name=name.join("/")),applyMap&&map&&(baseParts||starMap)){nameParts=name.split("/");outerLoop:for(i=nameParts.length;i>0;i-=1){if(nameSegment=nameParts.slice(0,i).join("/"),baseParts)for(j=baseParts.length;j>0;j-=1)if((mapValue=getOwn(map,baseParts.slice(0,j).join("/")))&&(mapValue=getOwn(mapValue,nameSegment))){foundMap=mapValue,foundI=i;break outerLoop}!foundStarMap&&starMap&&getOwn(starMap,nameSegment)&&(foundStarMap=getOwn(starMap,nameSegment),starI=i)}!foundMap&&foundStarMap&&(foundMap=foundStarMap,foundI=starI),foundMap&&(nameParts.splice(0,foundI,foundMap),name=nameParts.join("/"))}return getOwn(config.pkgs,name)||name}function makeShimExports(value){function fn(){var ret;return value.init&&(ret=value.init.apply(global,arguments)),ret||value.exports&&getGlobal(value.exports)}return fn}function takeQueue(anonId){var i,id,args,shim;for(i=0;i0;i-=1)if(parentModule=syms.slice(0,i).join("/"),parentPath=getOwn(paths,parentModule)){Array.isArray(parentPath)&&(parentPath=parentPath[0]),syms.splice(0,i,parentPath);break}url=syms.join("/"),url+=ext||(/^data\:|^blob\:|\?/.test(url)||skipExt?"":".js"),url=("/"===url.charAt(0)||url.match(/^[\w\+\.\-]+:/)?"":config.baseUrl)+url}return config.urlArgs&&!/^blob\:/.test(url)?url+config.urlArgs(moduleName,url):url},req.toUrl=function(moduleNamePlusExt){var ext,index=moduleNamePlusExt.lastIndexOf("."),segment=moduleNamePlusExt.split("/")[0],isRelative="."===segment||".."===segment;return-1!==index&&(!isRelative||index>1)&&(ext=moduleNamePlusExt.substring(index,moduleNamePlusExt.length),moduleNamePlusExt=moduleNamePlusExt.substring(0,index)),req.nameToUrl(normalize(moduleNamePlusExt,relName),ext,!0)},req.defined=function(id){return makeMap(id,relName,!0).id in defined},req.specified=function(id){return(id=makeMap(id,relName,!0).id)in defined||id in deferreds},req}function resolve(name,d,value){name&&(defined[name]=value,requirejs.onResourceLoad&&requirejs.onResourceLoad(context,d.map,d.deps)),d.finished=!0,d.resolve(value)}function reject(d,err){d.finished=!0,d.rejected=!0,d.reject(err)}function makeNormalize(relName){return function(name){return normalize(name,relName,!0)}}function defineModule(d){d.factoryCalled=!0;var ret,name=d.map.id;try{ret=context.execCb(name,d.factory,d.values,defined[name])}catch(err){return reject(d,err)}name?ret===undef&&(d.cjsModule?ret=d.cjsModule.exports:d.usingExports&&(ret=defined[name])):requireDeferreds.splice(requireDeferreds.indexOf(d),1),resolve(name,d,ret)}function depFinished(val,i){this.rejected||this.depDefined[i]||(this.depDefined[i]=!0,this.depCount+=1,this.values[i]=val,this.depending||this.depCount!==this.depMax||defineModule(this))}function makeDefer(name,calculatedMap){var d={};return d.promise=new Promise(function(resolve,reject){d.resolve=resolve,d.reject=function(err){name||requireDeferreds.splice(requireDeferreds.indexOf(d),1),reject(err)}}),d.map=name?calculatedMap||makeMap(name):{},d.depCount=0,d.depMax=0,d.values=[],d.depDefined=[],d.depFinished=depFinished,d.map.pr&&(d.deps=[makeMap(d.map.pr)]),d}function getDefer(name,calculatedMap){var d;return name?(d=name in deferreds&&deferreds[name])||(d=deferreds[name]=makeDefer(name,calculatedMap)):(d=makeDefer(),requireDeferreds.push(d)),d}function makeErrback(d,name){return function(err){d.rejected||(err.dynaId||(err.dynaId="id"+(errCount+=1),err.requireModules=[name]),reject(d,err))}}function waitForDep(depMap,relName,d,i){d.depMax+=1,callDep(depMap,relName).then(function(val){d.depFinished(val,i)},makeErrback(d,depMap.id)).catch(makeErrback(d,d.map.id))}function makeLoad(id){function load(value){fromTextCalled||resolve(id,getDefer(id),value)}var fromTextCalled;return load.error=function(err){reject(getDefer(id),err)},load.fromText=function(text,textAlt){var execError,d=getDefer(id),map=makeMap(makeMap(id).n),plainId=map.id;fromTextCalled=!0,d.factory=function(p,val){return val},textAlt&&(text=textAlt),hasProp(config.config,id)&&(config.config[plainId]=config.config[id]);try{req.exec(text)}catch(e){execError=new Error("fromText eval for "+plainId+" failed: "+e),execError.requireType="fromtexteval",reject(d,execError)}takeQueue(plainId),d.deps=[map],waitForDep(map,null,d,d.deps.length)},load}function callPlugin(plugin,map,relName){plugin.load(map.n,makeRequire(relName),makeLoad(map.id),config)}function splitPrefix(name){var prefix,index=name?name.indexOf("!"):-1;return index>-1&&(prefix=name.substring(0,index),name=name.substring(index+1,name.length)),[prefix,name]}function breakCycle(d,traced,processed){var id=d.map.id;traced[id]=!0,!d.finished&&d.deps&&d.deps.forEach(function(depMap){var depId=depMap.id,dep=!hasProp(handlers,depId)&&getDefer(depId,depMap);!dep||dep.finished||processed[depId]||(hasProp(traced,depId)?d.deps.forEach(function(depMap,i){depMap.id===depId&&d.depFinished(defined[depId],i)}):breakCycle(dep,traced,processed))}),processed[id]=!0}function check(d){var err,mid,dfd,notFinished=[],waitInterval=1e3*config.waitSeconds,expired=waitInterval&&startTime+waitInterval<(new Date).getTime();if(0===loadCount&&(d?d.finished||breakCycle(d,{},{}):requireDeferreds.length&&requireDeferreds.forEach(function(d){breakCycle(d,{},{})})),expired){for(mid in deferreds)dfd=deferreds[mid],dfd.finished||notFinished.push(dfd.map.id);err=new Error("Timeout for modules: "+notFinished),err.requireModules=notFinished,err.requireType="timeout",notFinished.forEach(function(id){reject(getDefer(id),err)})}else(loadCount||requireDeferreds.length)&&(checkingLater||(checkingLater=!0,setTimeout(function(){checkingLater=!1,check()},70)))}function delayedError(e){return setTimeout(function(){e.dynaId&&trackedErrors[e.dynaId]||(trackedErrors[e.dynaId]=!0,req.onError(e))}),e}var req,main,makeMap,callDep,handlers,checkingLater,load,context,defined=obj(),waiting=obj(),config={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},mapCache=obj(),requireDeferreds=[],deferreds=obj(),calledDefine=obj(),calledPlugin=obj(),loadCount=0,startTime=(new Date).getTime(),errCount=0,trackedErrors=obj(),urlFetched=obj(),bundlesMap=obj(),asyncResolve=Promise.resolve();return load="function"==typeof importScripts?function(map){var url=map.url;urlFetched[url]||(urlFetched[url]=!0,getDefer(map.id),importScripts(url),takeQueue(map.id))}:function(map){var script,id=map.id,url=map.url;urlFetched[url]||(urlFetched[url]=!0,script=document.createElement("script"),script.setAttribute("data-requiremodule",id),script.type=config.scriptType||"text/javascript",script.charset="utf-8",script.async=!0,loadCount+=1,script.addEventListener("load",function(){loadCount-=1,takeQueue(id)},!1),script.addEventListener("error",function(){loadCount-=1;var err,pathConfig=getOwn(config.paths,id);if(pathConfig&&Array.isArray(pathConfig)&&pathConfig.length>1){script.parentNode.removeChild(script),pathConfig.shift();var d=getDefer(id);d.map=makeMap(id),d.map.url=req.nameToUrl(id),load(d.map)}else err=new Error("Load failed: "+id+": "+script.src),err.requireModules=[id],err.requireType="scripterror",reject(getDefer(id),err)},!1),script.src=url,10===document.documentMode?asap.then(function(){document.head.appendChild(script)}):document.head.appendChild(script))},callDep=function(map,relName){var args,bundleId,name=map.id,shim=config.shim[name];if(name in waiting)args=waiting[name],delete waiting[name],main.apply(undef,args);else if(!(name in deferreds))if(map.pr){if(!(bundleId=getOwn(bundlesMap,name)))return callDep(makeMap(map.pr)).then(function(plugin){var newMap=map.prn?map:makeMap(name,relName,!0),newId=newMap.id,shim=getOwn(config.shim,newId);return newId in calledPlugin||(calledPlugin[newId]=!0,shim&&shim.deps?req(shim.deps,function(){callPlugin(plugin,newMap,relName)}):callPlugin(plugin,newMap,relName)),getDefer(newId).promise});map.url=req.nameToUrl(bundleId),load(map)}else shim&&shim.deps?req(shim.deps,function(){load(map)}):load(map);return getDefer(name).promise},makeMap=function(name,relName,applyMap){if("string"!=typeof name)return name;var plugin,url,parts,prefix,result,prefixNormalized,cacheKey=name+" & "+(relName||"")+" & "+!!applyMap;return parts=splitPrefix(name),prefix=parts[0],name=parts[1],!prefix&&cacheKey in mapCache?mapCache[cacheKey]:(prefix&&(prefix=normalize(prefix,relName,applyMap),plugin=prefix in defined&&defined[prefix]),prefix?plugin&&plugin.normalize?(name=plugin.normalize(name,makeNormalize(relName)),prefixNormalized=!0):name=-1===name.indexOf("!")?normalize(name,relName,applyMap):name:(name=normalize(name,relName,applyMap),parts=splitPrefix(name),prefix=parts[0],name=parts[1],url=req.nameToUrl(name)),result={id:prefix?prefix+"!"+name:name,n:name,pr:prefix,url:url,prn:prefix&&prefixNormalized},prefix||(mapCache[cacheKey]=result),result)},handlers={require:function(name){return makeRequire(name)},exports:function(name){var e=defined[name];return void 0!==e?e:defined[name]={}},module:function(name){return{id:name,uri:"",exports:handlers.exports(name),config:function(){return getOwn(config.config,name)||{}}}}},main=function(name,deps,factory,errback,relName){if(name){if(name in calledDefine)return;calledDefine[name]=!0}var d=getDefer(name);return deps&&!Array.isArray(deps)&&(factory=deps,deps=[]),deps=deps?slice.call(deps,0):null,errback||(hasProp(config,"defaultErrback")?config.defaultErrback&&(errback=config.defaultErrback):errback=delayedError),errback&&d.promise.catch(errback),relName=relName||name,"function"==typeof factory?(!deps.length&&factory.length&&(factory.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(match,dep){deps.push(dep)}),deps=(1===factory.length?["require"]:["require","exports","module"]).concat(deps)),d.factory=factory,d.deps=deps,d.depending=!0,deps.forEach(function(depName,i){var depMap;deps[i]=depMap=makeMap(depName,relName,!0),depName=depMap.id,"require"===depName?d.values[i]=handlers.require(name):"exports"===depName?(d.values[i]=handlers.exports(name),d.usingExports=!0):"module"===depName?d.values[i]=d.cjsModule=handlers.module(name):void 0===depName?d.values[i]=void 0:waitForDep(depMap,relName,d,i)}),d.depending=!1,d.depCount===d.depMax&&defineModule(d)):name&&resolve(name,d,factory),startTime=(new Date).getTime(),name||check(d),d.promise},req=makeRequire(null,!0),req.config=function(cfg){if(cfg.context&&cfg.context!==contextName){var existingContext=getOwn(contexts,cfg.context);return existingContext?existingContext.req.config(cfg):newContext(cfg.context).config(cfg)}if(mapCache=obj(),cfg.baseUrl&&"/"!==cfg.baseUrl.charAt(cfg.baseUrl.length-1)&&(cfg.baseUrl+="/"),"string"==typeof cfg.urlArgs){var urlArgs=cfg.urlArgs;cfg.urlArgs=function(id,url){return(-1===url.indexOf("?")?"?":"&")+urlArgs}}var shim=config.shim,objs={paths:!0,bundles:!0,config:!0,map:!0};return eachProp(cfg,function(value,prop){objs[prop]?(config[prop]||(config[prop]={}),mixin(config[prop],value,!0,!0)):config[prop]=value}),cfg.bundles&&eachProp(cfg.bundles,function(value,prop){value.forEach(function(v){v!==prop&&(bundlesMap[v]=prop)})}),cfg.shim&&(eachProp(cfg.shim,function(value,id){Array.isArray(value)&&(value={deps:value}),!value.exports&&!value.init||value.exportsFn||(value.exportsFn=makeShimExports(value)),shim[id]=value}),config.shim=shim),cfg.packages&&cfg.packages.forEach(function(pkgObj){var location,name;pkgObj="string"==typeof pkgObj?{name:pkgObj}:pkgObj,name=pkgObj.name,location=pkgObj.location,location&&(config.paths[name]=pkgObj.location),config.pkgs[name]=pkgObj.name+"/"+(pkgObj.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),(cfg.deps||cfg.callback)&&req(cfg.deps,cfg.callback),req},req.onError=function(err){throw err},context={id:contextName,defined:defined,waiting:waiting,config:config,deferreds:deferreds,req:req,execCb:function(name,callback,args,exports){return callback.apply(exports,args)}},contexts[contextName]=context,req}if(!Promise)throw new Error("No Promise implementation available");var topReq,dataMain,src,subPath,bootstrapConfig=requirejs||require,hasOwn=Object.prototype.hasOwnProperty,contexts={},queue=[],currDirRegExp=/^\.\//,urlRegExp=/^\/|\:|\?|\.js$/,commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,slice=Array.prototype.slice;if("function"!=typeof requirejs){var asap=Promise.resolve(void 0);requirejs=topReq=newContext("_"),"function"!=typeof require&&(require=topReq),topReq.exec=function(text){return eval(text)},topReq.contexts=contexts,define=function(){queue.push(slice.call(arguments,0))},define.amd={jQuery:!0},bootstrapConfig&&topReq.config(bootstrapConfig),topReq.isBrowser&&!contexts._.config.skipDataMain&&(dataMain=document.querySelectorAll("script[data-main]")[0],(dataMain=dataMain&&dataMain.getAttribute("data-main"))&&(dataMain=dataMain.replace(jsSuffixRegExp,""),bootstrapConfig&&bootstrapConfig.baseUrl||-1!==dataMain.indexOf("!")||(src=dataMain.split("/"),dataMain=src.pop(),subPath=src.length?src.join("/")+"/":"./",topReq.config({baseUrl:subPath})),topReq([dataMain])))}}(this,"undefined"!=typeof Promise?Promise:void 0); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/apiclient.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/apiclient.js index 1302dc2256..aae37db91f 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/apiclient.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/apiclient.js @@ -1,2 +1,2 @@ -define(["events","appStorage","wakeOnLan"],function(events,appStorage,wakeOnLan){"use strict";function redetectBitrate(instance){stopBitrateDetection(instance),instance.accessToken()&&instance.enableAutomaticBitrateDetection!==!1&&setTimeout(redetectBitrateInternal.bind(instance),6e3)}function redetectBitrateInternal(){this.accessToken()&&this.detectBitrate()}function stopBitrateDetection(instance){instance.detectTimeout&&clearTimeout(instance.detectTimeout)}function replaceAll(originalString,strReplace,strWith){var reg=new RegExp(strReplace,"ig");return originalString.replace(reg,strWith)}function onFetchFail(instance,url,response){events.trigger(instance,"requestfail",[{url:url,status:response.status,errorCode:response.headers?response.headers.get("X-Application-Error-Code"):null}])}function paramsToString(params){var values=[];for(var key in params){var value=params[key];null!==value&&void 0!==value&&""!==value&&values.push(encodeURIComponent(key)+"="+encodeURIComponent(value))}return values.join("&")}function fetchWithTimeout(url,options,timeoutMs){return new Promise(function(resolve,reject){var timeout=setTimeout(reject,timeoutMs);options=options||{},options.credentials="same-origin",fetch(url,options).then(function(response){clearTimeout(timeout),resolve(response)},function(error){clearTimeout(timeout),reject(error)})})}function getFetchPromise(request){var headers=request.headers||{};"json"===request.dataType&&(headers.accept="application/json");var fetchRequest={headers:headers,method:request.type,credentials:"same-origin"},contentType=request.contentType;return request.data&&("string"==typeof request.data?fetchRequest.body=request.data:(fetchRequest.body=paramsToString(request.data),contentType=contentType||"application/x-www-form-urlencoded; charset=UTF-8")),contentType&&(headers["Content-Type"]=contentType),request.timeout?fetchWithTimeout(request.url,fetchRequest,request.timeout):fetch(request.url,fetchRequest)}function getServerAddress(server,mode){switch(mode){case 0:case"local":return server.LocalAddress;case 2:case"manual":return server.ManualAddress;case 1:case"remote":return server.RemoteAddress;default:return server.ManualAddress||server.LocalAddress||server.RemoteAddress}}function ApiClient(serverAddress,appName,appVersion,deviceName,deviceId,devicePixelRatio){if(!serverAddress)throw new Error("Must supply a serverAddress");console.log("ApiClient serverAddress: "+serverAddress),console.log("ApiClient appName: "+appName),console.log("ApiClient appVersion: "+appVersion),console.log("ApiClient deviceName: "+deviceName),console.log("ApiClient deviceId: "+deviceId),this._serverInfo={},this._serverAddress=serverAddress,this._deviceId=deviceId,this._deviceName=deviceName,this._appName=appName,this._appVersion=appVersion,this._devicePixelRatio=devicePixelRatio}function setSavedEndpointInfo(instance,info){instance._endPointInfo=info}function switchConnectionMode(instance,connectionMode){var currentServerInfo=instance.serverInfo(),newConnectionMode=connectionMode;return newConnectionMode--,newConnectionMode<0&&(newConnectionMode="manual"),getServerAddress(currentServerInfo,newConnectionMode)?newConnectionMode:(newConnectionMode--,newConnectionMode<0&&(newConnectionMode="manual"),getServerAddress(currentServerInfo,newConnectionMode)?newConnectionMode:connectionMode)}function tryReconnectInternal(instance,resolve,reject,connectionMode,currentRetryCount){connectionMode=switchConnectionMode(instance,connectionMode);var url=getServerAddress(instance.serverInfo(),connectionMode);console.log("Attempting reconnection to "+url);var timeout="local"===connectionMode?7e3:15e3;fetchWithTimeout(url+"/system/info/public",{method:"GET",accept:"application/json"},timeout).then(function(){console.log("Reconnect succeeded to "+url),instance.serverInfo().LastConnectionMode=connectionMode,instance.serverAddress(url),resolve()},function(){if(console.log("Reconnect attempt failed to "+url),currentRetryCount<4){var newConnectionMode=switchConnectionMode(instance,connectionMode);setTimeout(function(){tryReconnectInternal(instance,resolve,reject,newConnectionMode,currentRetryCount+1)},300)}else reject()})}function tryReconnect(instance){return new Promise(function(resolve,reject){setTimeout(function(){tryReconnectInternal(instance,resolve,reject,instance.serverInfo().LastConnectionMode,0)},300)})}function getCachedUser(instance,userId){var serverId=instance.serverId();if(!serverId)return null;var json=appStorage.getItem("user-"+userId+"-"+serverId);return json?JSON.parse(json):null}function onWebSocketMessage(msg){var instance=this;msg=JSON.parse(msg.data),onMessageReceivedInternal(instance,msg)}function onMessageReceivedInternal(instance,msg){var messageId=msg.MessageId;if(messageId){if(messageIdsReceived[messageId])return;messageIdsReceived[messageId]=!0}if("UserDeleted"===msg.MessageType)instance._currentUser=null;else if("UserUpdated"===msg.MessageType||"UserConfigurationUpdated"===msg.MessageType){var user=msg.Data;user.Id===instance.getCurrentUserId()&&(instance._currentUser=null)}events.trigger(instance,"message",[msg])}function onWebSocketOpen(){var instance=this;console.log("web socket connection opened"),events.trigger(instance,"websocketopen")}function onWebSocketError(){var instance=this;events.trigger(instance,"websocketerror")}function setSocketOnClose(apiClient,socket){socket.onclose=function(){console.log("web socket closed"),apiClient._webSocket===socket&&(console.log("nulling out web socket"),apiClient._webSocket=null),setTimeout(function(){events.trigger(apiClient,"websocketclose")},0)}}function normalizeReturnBitrate(instance,bitrate){if(!bitrate)return instance.lastDetectedBitrate?instance.lastDetectedBitrate:Promise.reject();var result=Math.round(.7*bitrate);if(instance.getMaxBandwidth){var maxRate=instance.getMaxBandwidth();maxRate&&(result=Math.min(result,maxRate))}return instance.lastDetectedBitrate=result,instance.lastDetectedBitrateTime=(new Date).getTime(),result}function detectBitrateInternal(instance,tests,index,currentBitrate){if(index>=tests.length)return normalizeReturnBitrate(instance,currentBitrate);var test=tests[index];return instance.getDownloadSpeed(test.bytes).then(function(bitrate){return bitrate=infos.length)return void resolve();var info=infos[index];console.log("sending wakeonlan to "+info.MacAddress),wakeOnLan.send(info).then(function(result){sendNextWakeOnLan(infos,index+1,resolve)},function(){sendNextWakeOnLan(infos,index+1,resolve)})}function compareVersions(a,b){a=a.split("."),b=b.split(".");for(var i=0,length=Math.max(a.length,b.length);ibVal)return 1}return 0}ApiClient.prototype.appName=function(){return this._appName},ApiClient.prototype.setRequestHeaders=function(headers){var currentServerInfo=this.serverInfo(),appName=this._appName,accessToken=currentServerInfo.AccessToken,values=[];if(appName&&values.push('Client="'+appName+'"'),this._deviceName&&values.push('Device="'+this._deviceName+'"'),this._deviceId&&values.push('DeviceId="'+this._deviceId+'"'),this._appVersion&&values.push('Version="'+this._appVersion+'"'),accessToken&&values.push('Token="'+accessToken+'"'),values.length){var auth="MediaBrowser "+values.join(", ");headers["X-Emby-Authorization"]=auth}},ApiClient.prototype.appVersion=function(){return this._appVersion},ApiClient.prototype.deviceName=function(){return this._deviceName},ApiClient.prototype.deviceId=function(){return this._deviceId},ApiClient.prototype.serverAddress=function(val){if(null!=val){if(0!==val.toLowerCase().indexOf("http"))throw new Error("Invalid url: "+val);var changed=val!==this._serverAddress;this._serverAddress=val,this.onNetworkChange(),changed&&events.trigger(this,"serveraddresschanged")}return this._serverAddress},ApiClient.prototype.onNetworkChange=function(){this.lastDetectedBitrate=0,this.lastDetectedBitrateTime=0,setSavedEndpointInfo(this,null),redetectBitrate(this),refreshWakeOnLanInfoIfNeeded(this)},ApiClient.prototype.getUrl=function(name,params){if(!name)throw new Error("Url name cannot be empty");var url=this._serverAddress;if(!url)throw new Error("serverAddress is yet not set");var lowered=url.toLowerCase();return lowered.indexOf("/emby")===-1&&lowered.indexOf("/mediabrowser")===-1&&(url+="/emby"),"/"!==name.charAt(0)&&(url+="/"),url+=name,params&&(params=paramsToString(params),params&&(url+="?"+params)),url},ApiClient.prototype.fetchWithFailover=function(request,enableReconnection){console.log("Requesting "+request.url),request.timeout=3e4;var instance=this;return getFetchPromise(request).then(function(response){return instance.lastFetch=(new Date).getTime(),response.status<400?"json"===request.dataType||"application/json"===request.headers.accept?response.json():"text"===request.dataType||0===(response.headers.get("Content-Type")||"").toLowerCase().indexOf("text/")?response.text():response:(onFetchFail(instance,request.url,response),Promise.reject(response))},function(error){if(error?console.log("Request failed to "+request.url+" "+error.toString()):console.log("Request timed out to "+request.url),!error&&enableReconnection){console.log("Attempting reconnection");var previousServerAddress=instance.serverAddress();return tryReconnect(instance).then(function(){return console.log("Reconnect succeesed"),request.url=request.url.replace(previousServerAddress,instance.serverAddress()),instance.fetchWithFailover(request,!1)},function(innerError){throw console.log("Reconnect failed"),onFetchFail(instance,request.url,{}),innerError})}throw console.log("Reporting request failure"),onFetchFail(instance,request.url,{}),error})},ApiClient.prototype.fetch=function(request,includeAuthorization){if(!request)throw new Error("Request cannot be null");if(request.headers=request.headers||{},includeAuthorization!==!1&&this.setRequestHeaders(request.headers),this.enableAutomaticNetworking===!1||"GET"!==request.type){console.log("Requesting url without automatic networking: "+request.url);var instance=this;return getFetchPromise(request).then(function(response){return instance.lastFetch=(new Date).getTime(),response.status<400?"json"===request.dataType||"application/json"===request.headers.accept?response.json():"text"===request.dataType||0===(response.headers.get("Content-Type")||"").toLowerCase().indexOf("text/")?response.text():response:(onFetchFail(instance,request.url,response),Promise.reject(response))},function(error){throw onFetchFail(instance,request.url,{}),error})}return this.fetchWithFailover(request,!0)},ApiClient.prototype.setAuthenticationInfo=function(accessKey,userId){this._currentUser=null,this._serverInfo.AccessToken=accessKey,this._serverInfo.UserId=userId,redetectBitrate(this),refreshWakeOnLanInfoIfNeeded(this)},ApiClient.prototype.serverInfo=function(info){return info&&(this._serverInfo=info),this._serverInfo},ApiClient.prototype.getCurrentUserId=function(){return this._serverInfo.UserId},ApiClient.prototype.accessToken=function(){return this._serverInfo.AccessToken},ApiClient.prototype.serverId=function(){return this.serverInfo().Id},ApiClient.prototype.serverName=function(){return this.serverInfo().Name},ApiClient.prototype.ajax=function(request,includeAuthorization){if(!request)throw new Error("Request cannot be null");return this.fetch(request,includeAuthorization)},ApiClient.prototype.getCurrentUser=function(enableCache){if(this._currentUser)return Promise.resolve(this._currentUser);var userId=this.getCurrentUserId();if(!userId)return Promise.reject();var user,instance=this,serverPromise=this.getUser(userId).then(function(user){return appStorage.setItem("user-"+user.Id+"-"+user.ServerId,JSON.stringify(user)),instance._currentUser=user,user},function(response){if(!response.status&&userId&&instance.accessToken()&&(user=getCachedUser(instance,userId)))return Promise.resolve(user);throw response});return!this.lastFetch&&enableCache!==!1&&(user=getCachedUser(instance,userId))?Promise.resolve(user):serverPromise},ApiClient.prototype.isLoggedIn=function(){var info=this.serverInfo();return!!(info&&info.UserId&&info.AccessToken)},ApiClient.prototype.logout=function(){stopBitrateDetection(this),this.closeWebSocket();var done=function(){this.setAuthenticationInfo(null,null)}.bind(this);if(this.accessToken()){var url=this.getUrl("Sessions/Logout");return this.ajax({type:"POST",url:url}).then(done,done)}return done(),Promise.resolve()},ApiClient.prototype.authenticateUserByName=function(name,password){if(!name)return Promise.reject();var url=this.getUrl("Users/authenticatebyname"),instance=this;return new Promise(function(resolve,reject){var postData={Username:name,Pw:password||""};instance.ajax({type:"POST",url:url,data:JSON.stringify(postData),dataType:"json",contentType:"application/json"}).then(function(result){var afterOnAuthenticated=function(){redetectBitrate(instance),refreshWakeOnLanInfoIfNeeded(instance),resolve(result)};instance.onAuthenticated?instance.onAuthenticated(instance,result).then(afterOnAuthenticated):afterOnAuthenticated()},reject)})},ApiClient.prototype.ensureWebSocket=function(){if(!this.isWebSocketOpenOrConnecting()&&this.isWebSocketSupported())try{this.openWebSocket()}catch(err){console.log("Error opening web socket: "+err)}};var messageIdsReceived={};return ApiClient.prototype.openWebSocket=function(){var accessToken=this.accessToken();if(!accessToken)throw new Error("Cannot open web socket without access token.");var url=this.getUrl("socket");url=replaceAll(url,"emby/socket","embywebsocket"),url=replaceAll(url,"https:","wss:"),url=replaceAll(url,"http:","ws:"),url+="?api_key="+accessToken,url+="&deviceId="+this.deviceId(),console.log("opening web socket with url: "+url);var webSocket=new WebSocket(url);webSocket.onmessage=onWebSocketMessage.bind(this),webSocket.onopen=onWebSocketOpen.bind(this),webSocket.onerror=onWebSocketError.bind(this),setSocketOnClose(this,webSocket),this._webSocket=webSocket},ApiClient.prototype.closeWebSocket=function(){var socket=this._webSocket;socket&&socket.readyState===WebSocket.OPEN&&socket.close()},ApiClient.prototype.sendWebSocketMessage=function(name,data){console.log("Sending web socket message: "+name);var msg={MessageType:name};data&&(msg.Data=data),msg=JSON.stringify(msg),this._webSocket.send(msg)},ApiClient.prototype.sendMessage=function(name,data){this.isWebSocketOpen()&&this.sendWebSocketMessage(name,data)},ApiClient.prototype.isMessageChannelOpen=function(){return this.isWebSocketOpen()},ApiClient.prototype.isWebSocketOpen=function(){var socket=this._webSocket;return!!socket&&socket.readyState===WebSocket.OPEN},ApiClient.prototype.isWebSocketOpenOrConnecting=function(){var socket=this._webSocket;return!!socket&&(socket.readyState===WebSocket.OPEN||socket.readyState===WebSocket.CONNECTING)},ApiClient.prototype.get=function(url){return this.ajax({type:"GET",url:url})},ApiClient.prototype.getJSON=function(url,includeAuthorization){return this.fetch({url:url,type:"GET",dataType:"json",headers:{accept:"application/json"}},includeAuthorization)},ApiClient.prototype.updateServerInfo=function(server,connectionMode){if(null==server)throw new Error("server cannot be null");if(null==connectionMode)throw new Error("connectionMode cannot be null");console.log("Begin updateServerInfo. connectionMode: "+connectionMode),this.serverInfo(server);var serverUrl=getServerAddress(server,connectionMode);if(!serverUrl)throw new Error("serverUrl cannot be null. serverInfo: "+JSON.stringify(server));console.log("Setting server address to "+serverUrl),this.serverAddress(serverUrl)},ApiClient.prototype.isWebSocketSupported=function(){try{return null!=WebSocket}catch(err){return!1}},ApiClient.prototype.clearAuthenticationInfo=function(){this.setAuthenticationInfo(null,null)},ApiClient.prototype.encodeName=function(name){name=name.split("/").join("-"),name=name.split("&").join("-"),name=name.split("?").join("-");var val=paramsToString({name:name});return val.substring(val.indexOf("=")+1).replace("'","%27")},ApiClient.prototype.getProductNews=function(options){options=options||{};var url=this.getUrl("News/Product",options);return this.getJSON(url)},ApiClient.prototype.getDownloadSpeed=function(byteSize){var url=this.getUrl("Playback/BitrateTest",{Size:byteSize}),now=(new Date).getTime();return this.ajax({type:"GET",url:url,timeout:5e3}).then(function(){var responseTimeSeconds=((new Date).getTime()-now)/1e3,bytesPerSecond=byteSize/responseTimeSeconds,bitrate=Math.round(8*bytesPerSecond);return bitrate})},ApiClient.prototype.detectBitrate=function(force){if(!force&&this.lastDetectedBitrate&&(new Date).getTime()-(this.lastDetectedBitrateTime||0)<=36e5)return Promise.resolve(this.lastDetectedBitrate);var instance=this;return this.getEndpointInfo().then(function(info){return detectBitrateWithEndpointInfo(instance,info)},function(info){return detectBitrateWithEndpointInfo(instance,{})})},ApiClient.prototype.getItem=function(userId,itemId){if(!itemId)throw new Error("null itemId");var url=userId?this.getUrl("Users/"+userId+"/Items/"+itemId):this.getUrl("Items/"+itemId);return this.getJSON(url)},ApiClient.prototype.getRootFolder=function(userId){if(!userId)throw new Error("null userId");var url=this.getUrl("Users/"+userId+"/Items/Root");return this.getJSON(url)},ApiClient.prototype.getNotificationSummary=function(userId){if(!userId)throw new Error("null userId");var url=this.getUrl("Notifications/"+userId+"/Summary");return this.getJSON(url)},ApiClient.prototype.getNotifications=function(userId,options){if(!userId)throw new Error("null userId");var url=this.getUrl("Notifications/"+userId,options||{});return this.getJSON(url)},ApiClient.prototype.markNotificationsRead=function(userId,idList,isRead){if(!userId)throw new Error("null userId");if(!idList)throw new Error("null idList");var suffix=isRead?"Read":"Unread",params={UserId:userId,Ids:idList.join(",")},url=this.getUrl("Notifications/"+userId+"/"+suffix,params);return this.ajax({type:"POST",url:url})},ApiClient.prototype.getRemoteImageProviders=function(options){if(!options)throw new Error("null options");var urlPrefix=getRemoteImagePrefix(this,options),url=this.getUrl(urlPrefix+"/RemoteImages/Providers",options);return this.getJSON(url)},ApiClient.prototype.getAvailableRemoteImages=function(options){if(!options)throw new Error("null options");var urlPrefix=getRemoteImagePrefix(this,options),url=this.getUrl(urlPrefix+"/RemoteImages",options);return this.getJSON(url)},ApiClient.prototype.downloadRemoteImage=function(options){if(!options)throw new Error("null options");var urlPrefix=getRemoteImagePrefix(this,options),url=this.getUrl(urlPrefix+"/RemoteImages/Download",options);return this.ajax({type:"POST",url:url})},ApiClient.prototype.getLiveTvInfo=function(options){var url=this.getUrl("LiveTv/Info",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvGuideInfo=function(options){var url=this.getUrl("LiveTv/GuideInfo",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvChannel=function(id,userId){if(!id)throw new Error("null id");var options={};userId&&(options.userId=userId);var url=this.getUrl("LiveTv/Channels/"+id,options);return this.getJSON(url)},ApiClient.prototype.getLiveTvChannels=function(options){var url=this.getUrl("LiveTv/Channels",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvPrograms=function(options){return options=options||{},options.channelIds&&options.channelIds.length>1800?this.ajax({type:"POST",url:this.getUrl("LiveTv/Programs"),data:JSON.stringify(options),contentType:"application/json",dataType:"json"}):this.ajax({type:"GET",url:this.getUrl("LiveTv/Programs",options),dataType:"json"})},ApiClient.prototype.getLiveTvRecommendedPrograms=function(options){return options=options||{},this.ajax({type:"GET",url:this.getUrl("LiveTv/Programs/Recommended",options),dataType:"json"})},ApiClient.prototype.getLiveTvRecordings=function(options){var url=this.getUrl("LiveTv/Recordings",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvRecordingSeries=function(options){var url=this.getUrl("LiveTv/Recordings/Series",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvRecordingGroups=function(options){var url=this.getUrl("LiveTv/Recordings/Groups",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvRecordingGroup=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/Recordings/Groups/"+id);return this.getJSON(url)},ApiClient.prototype.getLiveTvRecording=function(id,userId){if(!id)throw new Error("null id");var options={};userId&&(options.userId=userId);var url=this.getUrl("LiveTv/Recordings/"+id,options);return this.getJSON(url)},ApiClient.prototype.getLiveTvProgram=function(id,userId){if(!id)throw new Error("null id");var options={};userId&&(options.userId=userId);var url=this.getUrl("LiveTv/Programs/"+id,options);return this.getJSON(url)},ApiClient.prototype.deleteLiveTvRecording=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/Recordings/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.cancelLiveTvTimer=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/Timers/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.getLiveTvTimers=function(options){var url=this.getUrl("LiveTv/Timers",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvTimer=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/Timers/"+id);return this.getJSON(url)},ApiClient.prototype.getNewLiveTvTimerDefaults=function(options){options=options||{};var url=this.getUrl("LiveTv/Timers/Defaults",options);return this.getJSON(url)},ApiClient.prototype.createLiveTvTimer=function(item){if(!item)throw new Error("null item");var url=this.getUrl("LiveTv/Timers");return this.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},ApiClient.prototype.updateLiveTvTimer=function(item){if(!item)throw new Error("null item");var url=this.getUrl("LiveTv/Timers/"+item.Id);return this.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},ApiClient.prototype.resetLiveTvTuner=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/Tuners/"+id+"/Reset");return this.ajax({type:"POST",url:url})},ApiClient.prototype.getLiveTvSeriesTimers=function(options){var url=this.getUrl("LiveTv/SeriesTimers",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvSeriesTimer=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/SeriesTimers/"+id);return this.getJSON(url)},ApiClient.prototype.cancelLiveTvSeriesTimer=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/SeriesTimers/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.createLiveTvSeriesTimer=function(item){if(!item)throw new Error("null item");var url=this.getUrl("LiveTv/SeriesTimers");return this.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},ApiClient.prototype.updateLiveTvSeriesTimer=function(item){if(!item)throw new Error("null item");var url=this.getUrl("LiveTv/SeriesTimers/"+item.Id);return this.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},ApiClient.prototype.getRegistrationInfo=function(feature){var url=this.getUrl("Registrations/"+feature);return this.getJSON(url)},ApiClient.prototype.getSystemInfo=function(){var url=this.getUrl("System/Info"),instance=this;return this.getJSON(url).then(function(info){return instance.setSystemInfo(info),Promise.resolve(info)})},ApiClient.prototype.getPublicSystemInfo=function(){var url=this.getUrl("System/Info/Public"),instance=this;return this.getJSON(url).then(function(info){return instance.setSystemInfo(info),Promise.resolve(info)})},ApiClient.prototype.getInstantMixFromItem=function(itemId,options){var url=this.getUrl("Items/"+itemId+"/InstantMix",options);return this.getJSON(url)},ApiClient.prototype.getEpisodes=function(itemId,options){var url=this.getUrl("Shows/"+itemId+"/Episodes",options);return this.getJSON(url)},ApiClient.prototype.getDisplayPreferences=function(id,userId,app){var url=this.getUrl("DisplayPreferences/"+id,{userId:userId,client:app});return this.getJSON(url)},ApiClient.prototype.updateDisplayPreferences=function(id,obj,userId,app){var url=this.getUrl("DisplayPreferences/"+id,{userId:userId,client:app});return this.ajax({type:"POST",url:url,data:JSON.stringify(obj),contentType:"application/json"})},ApiClient.prototype.getSeasons=function(itemId,options){var url=this.getUrl("Shows/"+itemId+"/Seasons",options);return this.getJSON(url)},ApiClient.prototype.getSimilarItems=function(itemId,options){var url=this.getUrl("Items/"+itemId+"/Similar",options);return this.getJSON(url)},ApiClient.prototype.getCultures=function(){var url=this.getUrl("Localization/cultures");return this.getJSON(url)},ApiClient.prototype.getCountries=function(){var url=this.getUrl("Localization/countries");return this.getJSON(url)},ApiClient.prototype.getPlaybackInfo=function(itemId,options,deviceProfile){var postData={DeviceProfile:deviceProfile};return this.ajax({url:this.getUrl("Items/"+itemId+"/PlaybackInfo",options),type:"POST",data:JSON.stringify(postData),contentType:"application/json",dataType:"json"})},ApiClient.prototype.getLiveStreamMediaInfo=function(liveStreamId){var postData={LiveStreamId:liveStreamId};return this.ajax({url:this.getUrl("LiveStreams/MediaInfo"),type:"POST",data:JSON.stringify(postData),contentType:"application/json",dataType:"json"})},ApiClient.prototype.getIntros=function(itemId){return this.getJSON(this.getUrl("Users/"+this.getCurrentUserId()+"/Items/"+itemId+"/Intros"))},ApiClient.prototype.getDirectoryContents=function(path,options){if(!path)throw new Error("null path");if("string"!=typeof path)throw new Error("invalid path");options=options||{},options.path=path;var url=this.getUrl("Environment/DirectoryContents",options);return this.getJSON(url)},ApiClient.prototype.getNetworkShares=function(path){if(!path)throw new Error("null path");var options={};options.path=path;var url=this.getUrl("Environment/NetworkShares",options);return this.getJSON(url)},ApiClient.prototype.getParentPath=function(path){if(!path)throw new Error("null path");var options={};options.path=path;var url=this.getUrl("Environment/ParentPath",options);return this.ajax({type:"GET",url:url,dataType:"text"})},ApiClient.prototype.getDrives=function(){var url=this.getUrl("Environment/Drives");return this.getJSON(url)},ApiClient.prototype.getNetworkDevices=function(){var url=this.getUrl("Environment/NetworkDevices");return this.getJSON(url)},ApiClient.prototype.cancelPackageInstallation=function(installationId){if(!installationId)throw new Error("null installationId");var url=this.getUrl("Packages/Installing/"+installationId);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.refreshItem=function(itemId,options){if(!itemId)throw new Error("null itemId");var url=this.getUrl("Items/"+itemId+"/Refresh",options||{});return this.ajax({type:"POST",url:url})},ApiClient.prototype.installPlugin=function(name,guid,updateClass,version){if(!name)throw new Error("null name");if(!updateClass)throw new Error("null updateClass");var options={updateClass:updateClass,AssemblyGuid:guid};version&&(options.version=version);var url=this.getUrl("Packages/Installed/"+name,options);return this.ajax({type:"POST",url:url})},ApiClient.prototype.restartServer=function(){var url=this.getUrl("System/Restart");return this.ajax({type:"POST",url:url})},ApiClient.prototype.shutdownServer=function(){var url=this.getUrl("System/Shutdown");return this.ajax({type:"POST",url:url})},ApiClient.prototype.getPackageInfo=function(name,guid){if(!name)throw new Error("null name");var options={AssemblyGuid:guid},url=this.getUrl("Packages/"+name,options);return this.getJSON(url)},ApiClient.prototype.getAvailableApplicationUpdate=function(){var url=this.getUrl("Packages/Updates",{PackageType:"System"});return this.getJSON(url)},ApiClient.prototype.getAvailablePluginUpdates=function(){var url=this.getUrl("Packages/Updates",{PackageType:"UserInstalled"});return this.getJSON(url)},ApiClient.prototype.getVirtualFolders=function(){var url="Library/VirtualFolders";return url=this.getUrl(url),this.getJSON(url)},ApiClient.prototype.getPhysicalPaths=function(){var url=this.getUrl("Library/PhysicalPaths");return this.getJSON(url)},ApiClient.prototype.getServerConfiguration=function(){var url=this.getUrl("System/Configuration");return this.getJSON(url)},ApiClient.prototype.getDevicesOptions=function(){var url=this.getUrl("System/Configuration/devices");return this.getJSON(url)},ApiClient.prototype.getContentUploadHistory=function(){var url=this.getUrl("Devices/CameraUploads",{DeviceId:this.deviceId()});return this.getJSON(url)},ApiClient.prototype.getNamedConfiguration=function(name){var url=this.getUrl("System/Configuration/"+name);return this.getJSON(url)},ApiClient.prototype.getScheduledTasks=function(options){options=options||{};var url=this.getUrl("ScheduledTasks",options);return this.getJSON(url)},ApiClient.prototype.startScheduledTask=function(id){if(!id)throw new Error("null id");var url=this.getUrl("ScheduledTasks/Running/"+id);return this.ajax({type:"POST",url:url})},ApiClient.prototype.getScheduledTask=function(id){if(!id)throw new Error("null id"); -var url=this.getUrl("ScheduledTasks/"+id);return this.getJSON(url)},ApiClient.prototype.getNextUpEpisodes=function(options){var url=this.getUrl("Shows/NextUp",options);return this.getJSON(url)},ApiClient.prototype.stopScheduledTask=function(id){if(!id)throw new Error("null id");var url=this.getUrl("ScheduledTasks/Running/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.getPluginConfiguration=function(id){if(!id)throw new Error("null Id");var url=this.getUrl("Plugins/"+id+"/Configuration");return this.getJSON(url)},ApiClient.prototype.getAvailablePlugins=function(options){options=options||{},options.PackageType="UserInstalled";var url=this.getUrl("Packages",options);return this.getJSON(url)},ApiClient.prototype.uninstallPlugin=function(id){if(!id)throw new Error("null Id");var url=this.getUrl("Plugins/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.removeVirtualFolder=function(name,refreshLibrary){if(!name)throw new Error("null name");var url="Library/VirtualFolders";return url=this.getUrl(url,{refreshLibrary:!!refreshLibrary,name:name}),this.ajax({type:"DELETE",url:url})},ApiClient.prototype.addVirtualFolder=function(name,type,refreshLibrary,libraryOptions){if(!name)throw new Error("null name");var options={};type&&(options.collectionType=type),options.refreshLibrary=!!refreshLibrary,options.name=name;var url="Library/VirtualFolders";return url=this.getUrl(url,options),this.ajax({type:"POST",url:url,data:JSON.stringify({LibraryOptions:libraryOptions}),contentType:"application/json"})},ApiClient.prototype.updateVirtualFolderOptions=function(id,libraryOptions){if(!id)throw new Error("null name");var url="Library/VirtualFolders/LibraryOptions";return url=this.getUrl(url),this.ajax({type:"POST",url:url,data:JSON.stringify({Id:id,LibraryOptions:libraryOptions}),contentType:"application/json"})},ApiClient.prototype.renameVirtualFolder=function(name,newName,refreshLibrary){if(!name)throw new Error("null name");var url="Library/VirtualFolders/Name";return url=this.getUrl(url,{refreshLibrary:!!refreshLibrary,newName:newName,name:name}),this.ajax({type:"POST",url:url})},ApiClient.prototype.addMediaPath=function(virtualFolderName,mediaPath,networkSharePath,refreshLibrary){if(!virtualFolderName)throw new Error("null virtualFolderName");if(!mediaPath)throw new Error("null mediaPath");var url="Library/VirtualFolders/Paths",pathInfo={Path:mediaPath};return networkSharePath&&(pathInfo.NetworkPath=networkSharePath),url=this.getUrl(url,{refreshLibrary:!!refreshLibrary}),this.ajax({type:"POST",url:url,data:JSON.stringify({Name:virtualFolderName,PathInfo:pathInfo}),contentType:"application/json"})},ApiClient.prototype.updateMediaPath=function(virtualFolderName,pathInfo){if(!virtualFolderName)throw new Error("null virtualFolderName");if(!pathInfo)throw new Error("null pathInfo");var url="Library/VirtualFolders/Paths/Update";return url=this.getUrl(url),this.ajax({type:"POST",url:url,data:JSON.stringify({Name:virtualFolderName,PathInfo:pathInfo}),contentType:"application/json"})},ApiClient.prototype.removeMediaPath=function(virtualFolderName,mediaPath,refreshLibrary){if(!virtualFolderName)throw new Error("null virtualFolderName");if(!mediaPath)throw new Error("null mediaPath");var url="Library/VirtualFolders/Paths";return url=this.getUrl(url,{refreshLibrary:!!refreshLibrary,path:mediaPath,name:virtualFolderName}),this.ajax({type:"DELETE",url:url})},ApiClient.prototype.deleteUser=function(id){if(!id)throw new Error("null id");var url=this.getUrl("Users/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.deleteUserImage=function(userId,imageType,imageIndex){if(!userId)throw new Error("null userId");if(!imageType)throw new Error("null imageType");var url=this.getUrl("Users/"+userId+"/Images/"+imageType);return null!=imageIndex&&(url+="/"+imageIndex),this.ajax({type:"DELETE",url:url})},ApiClient.prototype.deleteItemImage=function(itemId,imageType,imageIndex){if(!imageType)throw new Error("null imageType");var url=this.getUrl("Items/"+itemId+"/Images");return url+="/"+imageType,null!=imageIndex&&(url+="/"+imageIndex),this.ajax({type:"DELETE",url:url})},ApiClient.prototype.deleteItem=function(itemId){if(!itemId)throw new Error("null itemId");var url=this.getUrl("Items/"+itemId);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.stopActiveEncodings=function(playSessionId){var options={deviceId:this.deviceId()};playSessionId&&(options.PlaySessionId=playSessionId);var url=this.getUrl("Videos/ActiveEncodings",options);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.reportCapabilities=function(options){var url=this.getUrl("Sessions/Capabilities/Full");return this.ajax({type:"POST",url:url,data:JSON.stringify(options),contentType:"application/json"})},ApiClient.prototype.updateItemImageIndex=function(itemId,imageType,imageIndex,newIndex){if(!imageType)throw new Error("null imageType");var options={newIndex:newIndex},url=this.getUrl("Items/"+itemId+"/Images/"+imageType+"/"+imageIndex+"/Index",options);return this.ajax({type:"POST",url:url})},ApiClient.prototype.getItemImageInfos=function(itemId){var url=this.getUrl("Items/"+itemId+"/Images");return this.getJSON(url)},ApiClient.prototype.getCriticReviews=function(itemId,options){if(!itemId)throw new Error("null itemId");var url=this.getUrl("Items/"+itemId+"/CriticReviews",options);return this.getJSON(url)},ApiClient.prototype.getItemDownloadUrl=function(itemId){if(!itemId)throw new Error("itemId cannot be empty");var url="Items/"+itemId+"/Download";return this.getUrl(url,{api_key:this.accessToken()})},ApiClient.prototype.getSessions=function(options){var url=this.getUrl("Sessions",options);return this.getJSON(url)},ApiClient.prototype.uploadUserImage=function(userId,imageType,file){if(!userId)throw new Error("null userId");if(!imageType)throw new Error("null imageType");if(!file)throw new Error("File must be an image.");if("image/png"!==file.type&&"image/jpeg"!==file.type&&"image/jpeg"!==file.type)throw new Error("File must be an image.");var instance=this;return new Promise(function(resolve,reject){var reader=new FileReader;reader.onerror=function(){reject()},reader.onabort=function(){reject()},reader.onload=function(e){var data=e.target.result.split(",")[1],url=instance.getUrl("Users/"+userId+"/Images/"+imageType);instance.ajax({type:"POST",url:url,data:data,contentType:"image/"+file.name.substring(file.name.lastIndexOf(".")+1)}).then(resolve,reject)},reader.readAsDataURL(file)})},ApiClient.prototype.uploadItemImage=function(itemId,imageType,file){if(!itemId)throw new Error("null itemId");if(!imageType)throw new Error("null imageType");if(!file)throw new Error("File must be an image.");if("image/png"!==file.type&&"image/jpeg"!==file.type&&"image/jpeg"!==file.type)throw new Error("File must be an image.");var url=this.getUrl("Items/"+itemId+"/Images");url+="/"+imageType;var instance=this;return new Promise(function(resolve,reject){var reader=new FileReader;reader.onerror=function(){reject()},reader.onabort=function(){reject()},reader.onload=function(e){var data=e.target.result.split(",")[1];instance.ajax({type:"POST",url:url,data:data,contentType:"image/"+file.name.substring(file.name.lastIndexOf(".")+1)}).then(resolve,reject)},reader.readAsDataURL(file)})},ApiClient.prototype.getInstalledPlugins=function(){var options={},url=this.getUrl("Plugins",options);return this.getJSON(url)},ApiClient.prototype.getUser=function(id){if(!id)throw new Error("Must supply a userId");var url=this.getUrl("Users/"+id);return this.getJSON(url)},ApiClient.prototype.getStudio=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("Studios/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getGenre=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("Genres/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getMusicGenre=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("MusicGenres/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getGameGenre=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("GameGenres/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getArtist=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("Artists/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getPerson=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("Persons/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getPublicUsers=function(){var url=this.getUrl("users/public");return this.ajax({type:"GET",url:url,dataType:"json"},!1)},ApiClient.prototype.getUsers=function(options){var url=this.getUrl("users",options||{});return this.getJSON(url)},ApiClient.prototype.getParentalRatings=function(){var url=this.getUrl("Localization/ParentalRatings");return this.getJSON(url)},ApiClient.prototype.getDefaultImageQuality=function(imageType){return"backdrop"===imageType.toLowerCase()?80:90},ApiClient.prototype.getUserImageUrl=function(userId,options){if(!userId)throw new Error("null userId");options=options||{};var url="Users/"+userId+"/Images/"+options.type;return null!=options.index&&(url+="/"+options.index),normalizeImageOptions(this,options),delete options.type,delete options.index,this.getUrl(url,options)},ApiClient.prototype.getImageUrl=function(itemId,options){if(!itemId)throw new Error("itemId cannot be empty");options=options||{};var url="Items/"+itemId+"/Images/"+options.type;return null!=options.index&&(url+="/"+options.index),options.quality=options.quality||this.getDefaultImageQuality(options.type),this.normalizeImageOptions&&this.normalizeImageOptions(options),delete options.type,delete options.index,this.getUrl(url,options)},ApiClient.prototype.getScaledImageUrl=function(itemId,options){if(!itemId)throw new Error("itemId cannot be empty");options=options||{};var url="Items/"+itemId+"/Images/"+options.type;return null!=options.index&&(url+="/"+options.index),normalizeImageOptions(this,options),delete options.type,delete options.index,delete options.minScale,this.getUrl(url,options)},ApiClient.prototype.getThumbImageUrl=function(item,options){if(!item)throw new Error("null item");return options=options||{},options.imageType="thumb",item.ImageTags&&item.ImageTags.Thumb?(options.tag=item.ImageTags.Thumb,this.getImageUrl(item.Id,options)):item.ParentThumbItemId?(options.tag=item.ImageTags.ParentThumbImageTag,this.getImageUrl(item.ParentThumbItemId,options)):null},ApiClient.prototype.updateUserPassword=function(userId,currentPassword,newPassword){if(!userId)return Promise.reject();var url=this.getUrl("Users/"+userId+"/Password");return this.ajax({type:"POST",url:url,data:JSON.stringify({CurrentPw:currentPassword||"",NewPw:newPassword}),contentType:"application/json"})},ApiClient.prototype.updateEasyPassword=function(userId,newPassword){if(!userId)return void Promise.reject();var url=this.getUrl("Users/"+userId+"/EasyPassword");return this.ajax({type:"POST",url:url,data:{NewPw:newPassword}})},ApiClient.prototype.resetUserPassword=function(userId){if(!userId)throw new Error("null userId");var url=this.getUrl("Users/"+userId+"/Password"),postData={};return postData.resetPassword=!0,this.ajax({type:"POST",url:url,data:postData})},ApiClient.prototype.resetEasyPassword=function(userId){if(!userId)throw new Error("null userId");var url=this.getUrl("Users/"+userId+"/EasyPassword"),postData={};return postData.resetPassword=!0,this.ajax({type:"POST",url:url,data:postData})},ApiClient.prototype.updateServerConfiguration=function(configuration){if(!configuration)throw new Error("null configuration");var url=this.getUrl("System/Configuration");return this.ajax({type:"POST",url:url,data:JSON.stringify(configuration),contentType:"application/json"})},ApiClient.prototype.updateNamedConfiguration=function(name,configuration){if(!configuration)throw new Error("null configuration");var url=this.getUrl("System/Configuration/"+name);return this.ajax({type:"POST",url:url,data:JSON.stringify(configuration),contentType:"application/json"})},ApiClient.prototype.updateItem=function(item){if(!item)throw new Error("null item");var url=this.getUrl("Items/"+item.Id);return this.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},ApiClient.prototype.updatePluginSecurityInfo=function(info){var url=this.getUrl("Plugins/SecurityInfo");return this.ajax({type:"POST",url:url,data:JSON.stringify(info),contentType:"application/json"})},ApiClient.prototype.createUser=function(name){var url=this.getUrl("Users/New");return this.ajax({type:"POST",url:url,data:{Name:name},dataType:"json"})},ApiClient.prototype.updateUser=function(user){if(!user)throw new Error("null user");var url=this.getUrl("Users/"+user.Id);return this.ajax({type:"POST",url:url,data:JSON.stringify(user),contentType:"application/json"})},ApiClient.prototype.updateUserPolicy=function(userId,policy){if(!userId)throw new Error("null userId");if(!policy)throw new Error("null policy");var url=this.getUrl("Users/"+userId+"/Policy");return this.ajax({type:"POST",url:url,data:JSON.stringify(policy),contentType:"application/json"})},ApiClient.prototype.updateUserConfiguration=function(userId,configuration){if(!userId)throw new Error("null userId");if(!configuration)throw new Error("null configuration");var url=this.getUrl("Users/"+userId+"/Configuration");return this.ajax({type:"POST",url:url,data:JSON.stringify(configuration),contentType:"application/json"})},ApiClient.prototype.updateScheduledTaskTriggers=function(id,triggers){if(!id)throw new Error("null id");if(!triggers)throw new Error("null triggers");var url=this.getUrl("ScheduledTasks/"+id+"/Triggers");return this.ajax({type:"POST",url:url,data:JSON.stringify(triggers),contentType:"application/json"})},ApiClient.prototype.updatePluginConfiguration=function(id,configuration){if(!id)throw new Error("null Id");if(!configuration)throw new Error("null configuration");var url=this.getUrl("Plugins/"+id+"/Configuration");return this.ajax({type:"POST",url:url,data:JSON.stringify(configuration),contentType:"application/json"})},ApiClient.prototype.getAncestorItems=function(itemId,userId){if(!itemId)throw new Error("null itemId");var options={};userId&&(options.userId=userId);var url=this.getUrl("Items/"+itemId+"/Ancestors",options);return this.getJSON(url)},ApiClient.prototype.getItems=function(userId,options){var url;return url="string"===(typeof userId).toString().toLowerCase()?this.getUrl("Users/"+userId+"/Items",options):this.getUrl("Items",options),this.getJSON(url)},ApiClient.prototype.getResumableItems=function(userId,options){return this.isMinServerVersion("3.2.33")?this.getJSON(this.getUrl("Users/"+userId+"/Items/Resume",options)):this.getItems(userId,Object.assign({SortBy:"DatePlayed",SortOrder:"Descending",Filters:"IsResumable",Recursive:!0,CollapseBoxSetItems:!1,ExcludeLocationTypes:"Virtual"},options))},ApiClient.prototype.getMovieRecommendations=function(options){return this.getJSON(this.getUrl("Movies/Recommendations",options))},ApiClient.prototype.getUpcomingEpisodes=function(options){return this.getJSON(this.getUrl("Shows/Upcoming",options))},ApiClient.prototype.getUserViews=function(options,userId){options=options||{};var url=this.getUrl("Users/"+(userId||this.getCurrentUserId())+"/Views",options);return this.getJSON(url)},ApiClient.prototype.getArtists=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("Artists",options);return this.getJSON(url)},ApiClient.prototype.getAlbumArtists=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("Artists/AlbumArtists",options);return this.getJSON(url)},ApiClient.prototype.getGenres=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("Genres",options);return this.getJSON(url)},ApiClient.prototype.getMusicGenres=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("MusicGenres",options);return this.getJSON(url)},ApiClient.prototype.getGameGenres=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("GameGenres",options);return this.getJSON(url)},ApiClient.prototype.getPeople=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("Persons",options);return this.getJSON(url)},ApiClient.prototype.getStudios=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("Studios",options);return this.getJSON(url)},ApiClient.prototype.getLocalTrailers=function(userId,itemId){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/Items/"+itemId+"/LocalTrailers");return this.getJSON(url)},ApiClient.prototype.getGameSystems=function(){var options={},userId=this.getCurrentUserId();userId&&(options.userId=userId);var url=this.getUrl("Games/SystemSummaries",options);return this.getJSON(url)},ApiClient.prototype.getAdditionalVideoParts=function(userId,itemId){if(!itemId)throw new Error("null itemId");var options={};userId&&(options.userId=userId);var url=this.getUrl("Videos/"+itemId+"/AdditionalParts",options);return this.getJSON(url)},ApiClient.prototype.getThemeMedia=function(userId,itemId,inherit){if(!itemId)throw new Error("null itemId");var options={};userId&&(options.userId=userId),options.InheritFromParent=inherit||!1;var url=this.getUrl("Items/"+itemId+"/ThemeMedia",options);return this.getJSON(url)},ApiClient.prototype.getSearchHints=function(options){var url=this.getUrl("Search/Hints",options),serverId=this.serverId();return this.getJSON(url).then(function(result){return result.SearchHints.forEach(function(i){i.ServerId=serverId}),result})},ApiClient.prototype.getSpecialFeatures=function(userId,itemId){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/Items/"+itemId+"/SpecialFeatures");return this.getJSON(url)},ApiClient.prototype.getDateParamValue=function(date){function formatDigit(i){return i<10?"0"+i:i}var d=date;return""+d.getFullYear()+formatDigit(d.getMonth()+1)+formatDigit(d.getDate())+formatDigit(d.getHours())+formatDigit(d.getMinutes())+formatDigit(d.getSeconds())},ApiClient.prototype.markPlayed=function(userId,itemId,date){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var options={};date&&(options.DatePlayed=this.getDateParamValue(date));var url=this.getUrl("Users/"+userId+"/PlayedItems/"+itemId,options);return this.ajax({type:"POST",url:url,dataType:"json"})},ApiClient.prototype.markUnplayed=function(userId,itemId){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/PlayedItems/"+itemId);return this.ajax({type:"DELETE",url:url,dataType:"json"})},ApiClient.prototype.updateFavoriteStatus=function(userId,itemId,isFavorite){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/FavoriteItems/"+itemId),method=isFavorite?"POST":"DELETE";return this.ajax({type:method,url:url,dataType:"json"})},ApiClient.prototype.updateUserItemRating=function(userId,itemId,likes){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/Items/"+itemId+"/Rating",{likes:likes});return this.ajax({type:"POST",url:url,dataType:"json"})},ApiClient.prototype.getItemCounts=function(userId){var options={};userId&&(options.userId=userId);var url=this.getUrl("Items/Counts",options);return this.getJSON(url)},ApiClient.prototype.clearUserItemRating=function(userId,itemId){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/Items/"+itemId+"/Rating");return this.ajax({type:"DELETE",url:url,dataType:"json"})},ApiClient.prototype.reportPlaybackStart=function(options){if(!options)throw new Error("null options");this.lastPlaybackProgressReport=0,this.lastPlaybackProgressReportTicks=null,stopBitrateDetection(this);var url=this.getUrl("Sessions/Playing");return this.ajax({type:"POST",data:JSON.stringify(options),contentType:"application/json",url:url})},ApiClient.prototype.reportPlaybackProgress=function(options){if(!options)throw new Error("null options");var newPositionTicks=options.PositionTicks;if("timeupdate"===(options.EventName||"timeupdate")){var now=(new Date).getTime(),msSinceLastReport=now-(this.lastPlaybackProgressReport||0);if(msSinceLastReport<=1e4){if(!newPositionTicks)return Promise.resolve();var expectedReportTicks=1e4*msSinceLastReport+(this.lastPlaybackProgressReportTicks||0);if(Math.abs((newPositionTicks||0)-expectedReportTicks)<5e7)return Promise.resolve()}this.lastPlaybackProgressReport=now}else this.lastPlaybackProgressReport=0;this.lastPlaybackProgressReportTicks=newPositionTicks;var url=this.getUrl("Sessions/Playing/Progress");return this.ajax({type:"POST",data:JSON.stringify(options),contentType:"application/json",url:url})},ApiClient.prototype.reportOfflineActions=function(actions){if(!actions)throw new Error("null actions");var url=this.getUrl("Sync/OfflineActions");return this.ajax({type:"POST",data:JSON.stringify(actions),contentType:"application/json",url:url})},ApiClient.prototype.syncData=function(data){if(!data)throw new Error("null data");var url=this.getUrl("Sync/Data");return this.ajax({type:"POST",data:JSON.stringify(data),contentType:"application/json",url:url,dataType:"json"})},ApiClient.prototype.getReadySyncItems=function(deviceId){if(!deviceId)throw new Error("null deviceId");var url=this.getUrl("Sync/Items/Ready",{TargetId:deviceId});return this.getJSON(url)},ApiClient.prototype.reportSyncJobItemTransferred=function(syncJobItemId){if(!syncJobItemId)throw new Error("null syncJobItemId");var url=this.getUrl("Sync/JobItems/"+syncJobItemId+"/Transferred");return this.ajax({type:"POST",url:url})},ApiClient.prototype.cancelSyncItems=function(itemIds,targetId){if(!itemIds)throw new Error("null itemIds");var url=this.getUrl("Sync/"+(targetId||this.deviceId())+"/Items",{ItemIds:itemIds.join(",")});return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.reportPlaybackStopped=function(options){if(!options)throw new Error("null options");this.lastPlaybackProgressReport=0,this.lastPlaybackProgressReportTicks=null,redetectBitrate(this);var url=this.getUrl("Sessions/Playing/Stopped");return this.ajax({type:"POST",data:JSON.stringify(options),contentType:"application/json",url:url})},ApiClient.prototype.sendPlayCommand=function(sessionId,options){if(!sessionId)throw new Error("null sessionId");if(!options)throw new Error("null options");var url=this.getUrl("Sessions/"+sessionId+"/Playing",options);return this.ajax({type:"POST",url:url})},ApiClient.prototype.sendCommand=function(sessionId,command){if(!sessionId)throw new Error("null sessionId");if(!command)throw new Error("null command");var url=this.getUrl("Sessions/"+sessionId+"/Command"),ajaxOptions={type:"POST",url:url};return ajaxOptions.data=JSON.stringify(command),ajaxOptions.contentType="application/json",this.ajax(ajaxOptions)},ApiClient.prototype.sendMessageCommand=function(sessionId,options){if(!sessionId)throw new Error("null sessionId");if(!options)throw new Error("null options");var url=this.getUrl("Sessions/"+sessionId+"/Message"),ajaxOptions={type:"POST",url:url};return ajaxOptions.data=JSON.stringify(options),ajaxOptions.contentType="application/json",this.ajax(ajaxOptions)},ApiClient.prototype.sendPlayStateCommand=function(sessionId,command,options){if(!sessionId)throw new Error("null sessionId");if(!command)throw new Error("null command");var url=this.getUrl("Sessions/"+sessionId+"/Playing/"+command,options||{});return this.ajax({type:"POST",url:url})},ApiClient.prototype.createPackageReview=function(review){var url=this.getUrl("Packages/Reviews/"+review.id,review);return this.ajax({type:"POST",url:url})},ApiClient.prototype.getPackageReviews=function(packageId,minRating,maxRating,limit){if(!packageId)throw new Error("null packageId");var options={};minRating&&(options.MinRating=minRating),maxRating&&(options.MaxRating=maxRating),limit&&(options.Limit=limit);var url=this.getUrl("Packages/"+packageId+"/Reviews",options);return this.getJSON(url)},ApiClient.prototype.getSavedEndpointInfo=function(){return this._endPointInfo},ApiClient.prototype.getEndpointInfo=function(){var savedValue=this._endPointInfo;if(savedValue)return Promise.resolve(savedValue);var instance=this;return this.getJSON(this.getUrl("System/Endpoint")).then(function(endPointInfo){return setSavedEndpointInfo(instance,endPointInfo),endPointInfo})},ApiClient.prototype.getWakeOnLanInfo=function(){return this.getJSON(this.getUrl("System/WakeOnLanInfo"))},ApiClient.prototype.getLatestItems=function(options){return options=options||{},this.getJSON(this.getUrl("Users/"+this.getCurrentUserId()+"/Items/Latest",options))},ApiClient.prototype.getFilters=function(options){return this.getJSON(this.getUrl("Items/Filters2",options))},ApiClient.prototype.supportsWakeOnLan=function(){return!!wakeOnLan.isSupported()&&getCachedWakeOnLanInfo(this).length>0},ApiClient.prototype.wakeOnLan=function(){var infos=getCachedWakeOnLanInfo(this);return new Promise(function(resolve,reject){sendNextWakeOnLan(infos,0,resolve)})},ApiClient.prototype.setSystemInfo=function(info){this._serverVersion=info.Version},ApiClient.prototype.serverVersion=function(){return this._serverVersion},ApiClient.prototype.isMinServerVersion=function(version){var serverVersion=this.serverVersion();return!!serverVersion&&compareVersions(serverVersion,version)>=0},ApiClient.prototype.handleMessageReceived=function(msg){onMessageReceivedInternal(this,msg)},ApiClient}); \ No newline at end of file +define(["events","appStorage","wakeOnLan"],function(events,appStorage,wakeOnLan){"use strict";function redetectBitrate(instance){stopBitrateDetection(instance),instance.accessToken()&&!1!==instance.enableAutomaticBitrateDetection&&setTimeout(redetectBitrateInternal.bind(instance),6e3)}function redetectBitrateInternal(){this.accessToken()&&this.detectBitrate()}function stopBitrateDetection(instance){instance.detectTimeout&&clearTimeout(instance.detectTimeout)}function replaceAll(originalString,strReplace,strWith){var reg=new RegExp(strReplace,"ig");return originalString.replace(reg,strWith)}function onFetchFail(instance,url,response){events.trigger(instance,"requestfail",[{url:url,status:response.status,errorCode:response.headers?response.headers.get("X-Application-Error-Code"):null}])}function paramsToString(params){var values=[];for(var key in params){var value=params[key];null!==value&&void 0!==value&&""!==value&&values.push(encodeURIComponent(key)+"="+encodeURIComponent(value))}return values.join("&")}function fetchWithTimeout(url,options,timeoutMs){return new Promise(function(resolve,reject){var timeout=setTimeout(reject,timeoutMs);options=options||{},options.credentials="same-origin",fetch(url,options).then(function(response){clearTimeout(timeout),resolve(response)},function(error){clearTimeout(timeout),reject(error)})})}function getFetchPromise(request){var headers=request.headers||{};"json"===request.dataType&&(headers.accept="application/json");var fetchRequest={headers:headers,method:request.type,credentials:"same-origin"},contentType=request.contentType;return request.data&&("string"==typeof request.data?fetchRequest.body=request.data:(fetchRequest.body=paramsToString(request.data),contentType=contentType||"application/x-www-form-urlencoded; charset=UTF-8")),contentType&&(headers["Content-Type"]=contentType),request.timeout?fetchWithTimeout(request.url,fetchRequest,request.timeout):fetch(request.url,fetchRequest)}function getServerAddress(server,mode){switch(mode){case 0:case"local":return server.LocalAddress;case 2:case"manual":return server.ManualAddress;case 1:case"remote":return server.RemoteAddress;default:return server.ManualAddress||server.LocalAddress||server.RemoteAddress}}function ApiClient(serverAddress,appName,appVersion,deviceName,deviceId,devicePixelRatio){if(!serverAddress)throw new Error("Must supply a serverAddress");console.log("ApiClient serverAddress: "+serverAddress),console.log("ApiClient appName: "+appName),console.log("ApiClient appVersion: "+appVersion),console.log("ApiClient deviceName: "+deviceName),console.log("ApiClient deviceId: "+deviceId),this._serverInfo={},this._serverAddress=serverAddress,this._deviceId=deviceId,this._deviceName=deviceName,this._appName=appName,this._appVersion=appVersion,this._devicePixelRatio=devicePixelRatio}function setSavedEndpointInfo(instance,info){instance._endPointInfo=info}function switchConnectionMode(instance,connectionMode){var currentServerInfo=instance.serverInfo(),newConnectionMode=connectionMode;return newConnectionMode--,newConnectionMode<0&&(newConnectionMode="manual"),getServerAddress(currentServerInfo,newConnectionMode)?newConnectionMode:(newConnectionMode--,newConnectionMode<0&&(newConnectionMode="manual"),getServerAddress(currentServerInfo,newConnectionMode)?newConnectionMode:connectionMode)}function tryReconnectInternal(instance,resolve,reject,connectionMode,currentRetryCount){connectionMode=switchConnectionMode(instance,connectionMode);var url=getServerAddress(instance.serverInfo(),connectionMode);console.log("Attempting reconnection to "+url),fetchWithTimeout(url+"/system/info/public",{method:"GET",accept:"application/json"},"local"===connectionMode?7e3:15e3).then(function(){console.log("Reconnect succeeded to "+url),instance.serverInfo().LastConnectionMode=connectionMode,instance.serverAddress(url),resolve()},function(){if(console.log("Reconnect attempt failed to "+url),currentRetryCount<4){var newConnectionMode=switchConnectionMode(instance,connectionMode);setTimeout(function(){tryReconnectInternal(instance,resolve,reject,newConnectionMode,currentRetryCount+1)},300)}else reject()})}function tryReconnect(instance){return new Promise(function(resolve,reject){setTimeout(function(){tryReconnectInternal(instance,resolve,reject,instance.serverInfo().LastConnectionMode,0)},300)})}function getCachedUser(instance,userId){var serverId=instance.serverId();if(!serverId)return null;var json=appStorage.getItem("user-"+userId+"-"+serverId);return json?JSON.parse(json):null}function onWebSocketMessage(msg){var instance=this;msg=JSON.parse(msg.data),onMessageReceivedInternal(instance,msg)}function onMessageReceivedInternal(instance,msg){var messageId=msg.MessageId;if(messageId){if(messageIdsReceived[messageId])return;messageIdsReceived[messageId]=!0}if("UserDeleted"===msg.MessageType)instance._currentUser=null;else if("UserUpdated"===msg.MessageType||"UserConfigurationUpdated"===msg.MessageType){var user=msg.Data;user.Id===instance.getCurrentUserId()&&(instance._currentUser=null)}events.trigger(instance,"message",[msg])}function onWebSocketOpen(){var instance=this;console.log("web socket connection opened"),events.trigger(instance,"websocketopen")}function onWebSocketError(){var instance=this;events.trigger(instance,"websocketerror")}function setSocketOnClose(apiClient,socket){socket.onclose=function(){console.log("web socket closed"),apiClient._webSocket===socket&&(console.log("nulling out web socket"),apiClient._webSocket=null),setTimeout(function(){events.trigger(apiClient,"websocketclose")},0)}}function normalizeReturnBitrate(instance,bitrate){if(!bitrate)return instance.lastDetectedBitrate?instance.lastDetectedBitrate:Promise.reject();var result=Math.round(.7*bitrate);if(instance.getMaxBandwidth){var maxRate=instance.getMaxBandwidth();maxRate&&(result=Math.min(result,maxRate))}return instance.lastDetectedBitrate=result,instance.lastDetectedBitrateTime=(new Date).getTime(),result}function detectBitrateInternal(instance,tests,index,currentBitrate){if(index>=tests.length)return normalizeReturnBitrate(instance,currentBitrate);var test=tests[index];return instance.getDownloadSpeed(test.bytes).then(function(bitrate){return bitrate=infos.length)return void resolve();var info=infos[index];console.log("sending wakeonlan to "+info.MacAddress),wakeOnLan.send(info).then(function(result){sendNextWakeOnLan(infos,index+1,resolve)},function(){sendNextWakeOnLan(infos,index+1,resolve)})}function compareVersions(a,b){a=a.split("."),b=b.split(".");for(var i=0,length=Math.max(a.length,b.length);ibVal)return 1}return 0}ApiClient.prototype.appName=function(){return this._appName},ApiClient.prototype.setRequestHeaders=function(headers){var currentServerInfo=this.serverInfo(),appName=this._appName,accessToken=currentServerInfo.AccessToken,values=[];if(appName&&values.push('Client="'+appName+'"'),this._deviceName&&values.push('Device="'+this._deviceName+'"'),this._deviceId&&values.push('DeviceId="'+this._deviceId+'"'),this._appVersion&&values.push('Version="'+this._appVersion+'"'),accessToken&&values.push('Token="'+accessToken+'"'),values.length){var auth="MediaBrowser "+values.join(", ");headers["X-Emby-Authorization"]=auth}},ApiClient.prototype.appVersion=function(){return this._appVersion},ApiClient.prototype.deviceName=function(){return this._deviceName},ApiClient.prototype.deviceId=function(){return this._deviceId},ApiClient.prototype.serverAddress=function(val){if(null!=val){if(0!==val.toLowerCase().indexOf("http"))throw new Error("Invalid url: "+val);var changed=val!==this._serverAddress;this._serverAddress=val,this.onNetworkChange(),changed&&events.trigger(this,"serveraddresschanged")}return this._serverAddress},ApiClient.prototype.onNetworkChange=function(){this.lastDetectedBitrate=0,this.lastDetectedBitrateTime=0,setSavedEndpointInfo(this,null),redetectBitrate(this),refreshWakeOnLanInfoIfNeeded(this)},ApiClient.prototype.getUrl=function(name,params){if(!name)throw new Error("Url name cannot be empty");var url=this._serverAddress;if(!url)throw new Error("serverAddress is yet not set");var lowered=url.toLowerCase();return-1===lowered.indexOf("/emby")&&-1===lowered.indexOf("/mediabrowser")&&(url+="/emby"),"/"!==name.charAt(0)&&(url+="/"),url+=name,params&&(params=paramsToString(params))&&(url+="?"+params),url},ApiClient.prototype.fetchWithFailover=function(request,enableReconnection){console.log("Requesting "+request.url),request.timeout=3e4;var instance=this;return getFetchPromise(request).then(function(response){return instance.lastFetch=(new Date).getTime(),response.status<400?"json"===request.dataType||"application/json"===request.headers.accept?response.json():"text"===request.dataType||0===(response.headers.get("Content-Type")||"").toLowerCase().indexOf("text/")?response.text():response:(onFetchFail(instance,request.url,response),Promise.reject(response))},function(error){if(error?console.log("Request failed to "+request.url+" "+error.toString()):console.log("Request timed out to "+request.url),!error&&enableReconnection){console.log("Attempting reconnection");var previousServerAddress=instance.serverAddress();return tryReconnect(instance).then(function(){return console.log("Reconnect succeesed"),request.url=request.url.replace(previousServerAddress,instance.serverAddress()),instance.fetchWithFailover(request,!1)},function(innerError){throw console.log("Reconnect failed"),onFetchFail(instance,request.url,{}),innerError})}throw console.log("Reporting request failure"),onFetchFail(instance,request.url,{}),error})},ApiClient.prototype.fetch=function(request,includeAuthorization){if(!request)throw new Error("Request cannot be null");if(request.headers=request.headers||{},!1!==includeAuthorization&&this.setRequestHeaders(request.headers),!1===this.enableAutomaticNetworking||"GET"!==request.type){console.log("Requesting url without automatic networking: "+request.url);var instance=this;return getFetchPromise(request).then(function(response){return instance.lastFetch=(new Date).getTime(),response.status<400?"json"===request.dataType||"application/json"===request.headers.accept?response.json():"text"===request.dataType||0===(response.headers.get("Content-Type")||"").toLowerCase().indexOf("text/")?response.text():response:(onFetchFail(instance,request.url,response),Promise.reject(response))},function(error){throw onFetchFail(instance,request.url,{}),error})}return this.fetchWithFailover(request,!0)},ApiClient.prototype.setAuthenticationInfo=function(accessKey,userId){this._currentUser=null,this._serverInfo.AccessToken=accessKey,this._serverInfo.UserId=userId,redetectBitrate(this),refreshWakeOnLanInfoIfNeeded(this)},ApiClient.prototype.serverInfo=function(info){return info&&(this._serverInfo=info),this._serverInfo},ApiClient.prototype.getCurrentUserId=function(){return this._serverInfo.UserId},ApiClient.prototype.accessToken=function(){return this._serverInfo.AccessToken},ApiClient.prototype.serverId=function(){return this.serverInfo().Id},ApiClient.prototype.serverName=function(){return this.serverInfo().Name},ApiClient.prototype.ajax=function(request,includeAuthorization){if(!request)throw new Error("Request cannot be null");return this.fetch(request,includeAuthorization)},ApiClient.prototype.getCurrentUser=function(enableCache){if(this._currentUser)return Promise.resolve(this._currentUser);var userId=this.getCurrentUserId();if(!userId)return Promise.reject();var user,instance=this,serverPromise=this.getUser(userId).then(function(user){return appStorage.setItem("user-"+user.Id+"-"+user.ServerId,JSON.stringify(user)),instance._currentUser=user,user},function(response){if(!response.status&&userId&&instance.accessToken()&&(user=getCachedUser(instance,userId)))return Promise.resolve(user);throw response});return!this.lastFetch&&!1!==enableCache&&(user=getCachedUser(instance,userId))?Promise.resolve(user):serverPromise},ApiClient.prototype.isLoggedIn=function(){var info=this.serverInfo();return!!(info&&info.UserId&&info.AccessToken)},ApiClient.prototype.logout=function(){stopBitrateDetection(this),this.closeWebSocket();var done=function(){this.setAuthenticationInfo(null,null)}.bind(this);if(this.accessToken()){var url=this.getUrl("Sessions/Logout");return this.ajax({type:"POST",url:url}).then(done,done)}return done(),Promise.resolve()},ApiClient.prototype.authenticateUserByName=function(name,password){if(!name)return Promise.reject();var url=this.getUrl("Users/authenticatebyname"),instance=this;return new Promise(function(resolve,reject){var postData={Username:name,Pw:password||""};instance.ajax({type:"POST",url:url,data:JSON.stringify(postData),dataType:"json",contentType:"application/json"}).then(function(result){var afterOnAuthenticated=function(){redetectBitrate(instance),refreshWakeOnLanInfoIfNeeded(instance),resolve(result)};instance.onAuthenticated?instance.onAuthenticated(instance,result).then(afterOnAuthenticated):afterOnAuthenticated()},reject)})},ApiClient.prototype.ensureWebSocket=function(){if(!this.isWebSocketOpenOrConnecting()&&this.isWebSocketSupported())try{this.openWebSocket()}catch(err){console.log("Error opening web socket: "+err)}};var messageIdsReceived={};return ApiClient.prototype.openWebSocket=function(){var accessToken=this.accessToken();if(!accessToken)throw new Error("Cannot open web socket without access token.");var url=this.getUrl("socket");url=replaceAll(url,"emby/socket","embywebsocket"),url=replaceAll(url,"https:","wss:"),url=replaceAll(url,"http:","ws:"),url+="?api_key="+accessToken,url+="&deviceId="+this.deviceId(),console.log("opening web socket with url: "+url);var webSocket=new WebSocket(url);webSocket.onmessage=onWebSocketMessage.bind(this),webSocket.onopen=onWebSocketOpen.bind(this),webSocket.onerror=onWebSocketError.bind(this),setSocketOnClose(this,webSocket),this._webSocket=webSocket},ApiClient.prototype.closeWebSocket=function(){var socket=this._webSocket;socket&&socket.readyState===WebSocket.OPEN&&socket.close()},ApiClient.prototype.sendWebSocketMessage=function(name,data){console.log("Sending web socket message: "+name);var msg={MessageType:name};data&&(msg.Data=data),msg=JSON.stringify(msg),this._webSocket.send(msg)},ApiClient.prototype.sendMessage=function(name,data){this.isWebSocketOpen()&&this.sendWebSocketMessage(name,data)},ApiClient.prototype.isMessageChannelOpen=function(){return this.isWebSocketOpen()},ApiClient.prototype.isWebSocketOpen=function(){var socket=this._webSocket;return!!socket&&socket.readyState===WebSocket.OPEN},ApiClient.prototype.isWebSocketOpenOrConnecting=function(){var socket=this._webSocket;return!!socket&&(socket.readyState===WebSocket.OPEN||socket.readyState===WebSocket.CONNECTING)},ApiClient.prototype.get=function(url){return this.ajax({type:"GET",url:url})},ApiClient.prototype.getJSON=function(url,includeAuthorization){return this.fetch({url:url,type:"GET",dataType:"json",headers:{accept:"application/json"}},includeAuthorization)},ApiClient.prototype.updateServerInfo=function(server,connectionMode){if(null==server)throw new Error("server cannot be null");if(null==connectionMode)throw new Error("connectionMode cannot be null");console.log("Begin updateServerInfo. connectionMode: "+connectionMode),this.serverInfo(server);var serverUrl=getServerAddress(server,connectionMode);if(!serverUrl)throw new Error("serverUrl cannot be null. serverInfo: "+JSON.stringify(server));console.log("Setting server address to "+serverUrl),this.serverAddress(serverUrl)},ApiClient.prototype.isWebSocketSupported=function(){try{return null!=WebSocket}catch(err){return!1}},ApiClient.prototype.clearAuthenticationInfo=function(){this.setAuthenticationInfo(null,null)},ApiClient.prototype.encodeName=function(name){name=name.split("/").join("-"),name=name.split("&").join("-"),name=name.split("?").join("-");var val=paramsToString({name:name});return val.substring(val.indexOf("=")+1).replace("'","%27")},ApiClient.prototype.getProductNews=function(options){options=options||{};var url=this.getUrl("News/Product",options);return this.getJSON(url)},ApiClient.prototype.getDownloadSpeed=function(byteSize){var url=this.getUrl("Playback/BitrateTest",{Size:byteSize}),now=(new Date).getTime();return this.ajax({type:"GET",url:url,timeout:5e3}).then(function(){var responseTimeSeconds=((new Date).getTime()-now)/1e3,bytesPerSecond=byteSize/responseTimeSeconds;return Math.round(8*bytesPerSecond)})},ApiClient.prototype.detectBitrate=function(force){if(!force&&this.lastDetectedBitrate&&(new Date).getTime()-(this.lastDetectedBitrateTime||0)<=36e5)return Promise.resolve(this.lastDetectedBitrate);var instance=this;return this.getEndpointInfo().then(function(info){return detectBitrateWithEndpointInfo(instance,info)},function(info){return detectBitrateWithEndpointInfo(instance,{})})},ApiClient.prototype.getItem=function(userId,itemId){if(!itemId)throw new Error("null itemId");var url=userId?this.getUrl("Users/"+userId+"/Items/"+itemId):this.getUrl("Items/"+itemId);return this.getJSON(url)},ApiClient.prototype.getRootFolder=function(userId){if(!userId)throw new Error("null userId");var url=this.getUrl("Users/"+userId+"/Items/Root");return this.getJSON(url)},ApiClient.prototype.getNotificationSummary=function(userId){if(!userId)throw new Error("null userId");var url=this.getUrl("Notifications/"+userId+"/Summary");return this.getJSON(url)},ApiClient.prototype.getNotifications=function(userId,options){if(!userId)throw new Error("null userId");var url=this.getUrl("Notifications/"+userId,options||{});return this.getJSON(url)},ApiClient.prototype.markNotificationsRead=function(userId,idList,isRead){if(!userId)throw new Error("null userId");if(!idList)throw new Error("null idList");var suffix=isRead?"Read":"Unread",params={UserId:userId,Ids:idList.join(",")},url=this.getUrl("Notifications/"+userId+"/"+suffix,params);return this.ajax({type:"POST",url:url})},ApiClient.prototype.getRemoteImageProviders=function(options){if(!options)throw new Error("null options");var urlPrefix=getRemoteImagePrefix(this,options),url=this.getUrl(urlPrefix+"/RemoteImages/Providers",options);return this.getJSON(url)},ApiClient.prototype.getAvailableRemoteImages=function(options){if(!options)throw new Error("null options");var urlPrefix=getRemoteImagePrefix(this,options),url=this.getUrl(urlPrefix+"/RemoteImages",options);return this.getJSON(url)},ApiClient.prototype.downloadRemoteImage=function(options){if(!options)throw new Error("null options");var urlPrefix=getRemoteImagePrefix(this,options),url=this.getUrl(urlPrefix+"/RemoteImages/Download",options);return this.ajax({type:"POST",url:url})},ApiClient.prototype.getLiveTvInfo=function(options){var url=this.getUrl("LiveTv/Info",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvGuideInfo=function(options){var url=this.getUrl("LiveTv/GuideInfo",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvChannel=function(id,userId){if(!id)throw new Error("null id");var options={};userId&&(options.userId=userId);var url=this.getUrl("LiveTv/Channels/"+id,options);return this.getJSON(url)},ApiClient.prototype.getLiveTvChannels=function(options){var url=this.getUrl("LiveTv/Channels",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvPrograms=function(options){return options=options||{},options.channelIds&&options.channelIds.length>1800?this.ajax({type:"POST",url:this.getUrl("LiveTv/Programs"),data:JSON.stringify(options),contentType:"application/json",dataType:"json"}):this.ajax({type:"GET",url:this.getUrl("LiveTv/Programs",options),dataType:"json"})},ApiClient.prototype.getLiveTvRecommendedPrograms=function(options){return options=options||{},this.ajax({type:"GET",url:this.getUrl("LiveTv/Programs/Recommended",options),dataType:"json"})},ApiClient.prototype.getLiveTvRecordings=function(options){var url=this.getUrl("LiveTv/Recordings",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvRecordingSeries=function(options){var url=this.getUrl("LiveTv/Recordings/Series",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvRecordingGroups=function(options){var url=this.getUrl("LiveTv/Recordings/Groups",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvRecordingGroup=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/Recordings/Groups/"+id);return this.getJSON(url)},ApiClient.prototype.getLiveTvRecording=function(id,userId){if(!id)throw new Error("null id");var options={};userId&&(options.userId=userId);var url=this.getUrl("LiveTv/Recordings/"+id,options);return this.getJSON(url)},ApiClient.prototype.getLiveTvProgram=function(id,userId){if(!id)throw new Error("null id");var options={};userId&&(options.userId=userId);var url=this.getUrl("LiveTv/Programs/"+id,options);return this.getJSON(url)},ApiClient.prototype.deleteLiveTvRecording=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/Recordings/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.cancelLiveTvTimer=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/Timers/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.getLiveTvTimers=function(options){var url=this.getUrl("LiveTv/Timers",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvTimer=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/Timers/"+id);return this.getJSON(url)},ApiClient.prototype.getNewLiveTvTimerDefaults=function(options){options=options||{};var url=this.getUrl("LiveTv/Timers/Defaults",options);return this.getJSON(url)},ApiClient.prototype.createLiveTvTimer=function(item){if(!item)throw new Error("null item");var url=this.getUrl("LiveTv/Timers");return this.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},ApiClient.prototype.updateLiveTvTimer=function(item){if(!item)throw new Error("null item");var url=this.getUrl("LiveTv/Timers/"+item.Id);return this.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},ApiClient.prototype.resetLiveTvTuner=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/Tuners/"+id+"/Reset");return this.ajax({type:"POST",url:url})},ApiClient.prototype.getLiveTvSeriesTimers=function(options){var url=this.getUrl("LiveTv/SeriesTimers",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvSeriesTimer=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/SeriesTimers/"+id);return this.getJSON(url)},ApiClient.prototype.cancelLiveTvSeriesTimer=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/SeriesTimers/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.createLiveTvSeriesTimer=function(item){if(!item)throw new Error("null item");var url=this.getUrl("LiveTv/SeriesTimers");return this.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},ApiClient.prototype.updateLiveTvSeriesTimer=function(item){if(!item)throw new Error("null item");var url=this.getUrl("LiveTv/SeriesTimers/"+item.Id);return this.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},ApiClient.prototype.getRegistrationInfo=function(feature){var url=this.getUrl("Registrations/"+feature);return this.getJSON(url)},ApiClient.prototype.getSystemInfo=function(){var url=this.getUrl("System/Info"),instance=this;return this.getJSON(url).then(function(info){return instance.setSystemInfo(info),Promise.resolve(info)})},ApiClient.prototype.getPublicSystemInfo=function(){var url=this.getUrl("System/Info/Public"),instance=this;return this.getJSON(url).then(function(info){return instance.setSystemInfo(info),Promise.resolve(info)})},ApiClient.prototype.getInstantMixFromItem=function(itemId,options){var url=this.getUrl("Items/"+itemId+"/InstantMix",options);return this.getJSON(url)},ApiClient.prototype.getEpisodes=function(itemId,options){var url=this.getUrl("Shows/"+itemId+"/Episodes",options);return this.getJSON(url)},ApiClient.prototype.getDisplayPreferences=function(id,userId,app){var url=this.getUrl("DisplayPreferences/"+id,{userId:userId,client:app});return this.getJSON(url)},ApiClient.prototype.updateDisplayPreferences=function(id,obj,userId,app){var url=this.getUrl("DisplayPreferences/"+id,{userId:userId,client:app});return this.ajax({type:"POST",url:url,data:JSON.stringify(obj),contentType:"application/json"})},ApiClient.prototype.getSeasons=function(itemId,options){var url=this.getUrl("Shows/"+itemId+"/Seasons",options);return this.getJSON(url)},ApiClient.prototype.getSimilarItems=function(itemId,options){var url=this.getUrl("Items/"+itemId+"/Similar",options);return this.getJSON(url)},ApiClient.prototype.getCultures=function(){var url=this.getUrl("Localization/cultures");return this.getJSON(url)},ApiClient.prototype.getCountries=function(){var url=this.getUrl("Localization/countries");return this.getJSON(url)},ApiClient.prototype.getPlaybackInfo=function(itemId,options,deviceProfile){var postData={DeviceProfile:deviceProfile};return this.ajax({url:this.getUrl("Items/"+itemId+"/PlaybackInfo",options),type:"POST",data:JSON.stringify(postData),contentType:"application/json",dataType:"json"})},ApiClient.prototype.getLiveStreamMediaInfo=function(liveStreamId){var postData={LiveStreamId:liveStreamId};return this.ajax({url:this.getUrl("LiveStreams/MediaInfo"),type:"POST",data:JSON.stringify(postData),contentType:"application/json",dataType:"json"})},ApiClient.prototype.getIntros=function(itemId){return this.getJSON(this.getUrl("Users/"+this.getCurrentUserId()+"/Items/"+itemId+"/Intros"))},ApiClient.prototype.getDirectoryContents=function(path,options){if(!path)throw new Error("null path");if("string"!=typeof path)throw new Error("invalid path");options=options||{},options.path=path;var url=this.getUrl("Environment/DirectoryContents",options);return this.getJSON(url)},ApiClient.prototype.getNetworkShares=function(path){if(!path)throw new Error("null path");var options={};options.path=path;var url=this.getUrl("Environment/NetworkShares",options);return this.getJSON(url)},ApiClient.prototype.getParentPath=function(path){if(!path)throw new Error("null path");var options={};options.path=path;var url=this.getUrl("Environment/ParentPath",options);return this.ajax({type:"GET",url:url,dataType:"text"})},ApiClient.prototype.getDrives=function(){var url=this.getUrl("Environment/Drives");return this.getJSON(url)},ApiClient.prototype.getNetworkDevices=function(){var url=this.getUrl("Environment/NetworkDevices");return this.getJSON(url)},ApiClient.prototype.cancelPackageInstallation=function(installationId){if(!installationId)throw new Error("null installationId");var url=this.getUrl("Packages/Installing/"+installationId);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.refreshItem=function(itemId,options){if(!itemId)throw new Error("null itemId");var url=this.getUrl("Items/"+itemId+"/Refresh",options||{});return this.ajax({type:"POST",url:url})},ApiClient.prototype.installPlugin=function(name,guid,updateClass,version){if(!name)throw new Error("null name");if(!updateClass)throw new Error("null updateClass");var options={updateClass:updateClass,AssemblyGuid:guid};version&&(options.version=version);var url=this.getUrl("Packages/Installed/"+name,options);return this.ajax({type:"POST",url:url})},ApiClient.prototype.restartServer=function(){var url=this.getUrl("System/Restart");return this.ajax({type:"POST",url:url})},ApiClient.prototype.shutdownServer=function(){var url=this.getUrl("System/Shutdown");return this.ajax({type:"POST",url:url})},ApiClient.prototype.getPackageInfo=function(name,guid){if(!name)throw new Error("null name");var options={AssemblyGuid:guid},url=this.getUrl("Packages/"+name,options);return this.getJSON(url)},ApiClient.prototype.getAvailableApplicationUpdate=function(){var url=this.getUrl("Packages/Updates",{PackageType:"System"});return this.getJSON(url)},ApiClient.prototype.getAvailablePluginUpdates=function(){var url=this.getUrl("Packages/Updates",{PackageType:"UserInstalled"});return this.getJSON(url)},ApiClient.prototype.getVirtualFolders=function(){var url="Library/VirtualFolders";return url=this.getUrl(url),this.getJSON(url)},ApiClient.prototype.getPhysicalPaths=function(){var url=this.getUrl("Library/PhysicalPaths");return this.getJSON(url)},ApiClient.prototype.getServerConfiguration=function(){var url=this.getUrl("System/Configuration");return this.getJSON(url)},ApiClient.prototype.getDevicesOptions=function(){var url=this.getUrl("System/Configuration/devices");return this.getJSON(url)},ApiClient.prototype.getContentUploadHistory=function(){var url=this.getUrl("Devices/CameraUploads",{DeviceId:this.deviceId()});return this.getJSON(url)},ApiClient.prototype.getNamedConfiguration=function(name){var url=this.getUrl("System/Configuration/"+name);return this.getJSON(url)},ApiClient.prototype.getScheduledTasks=function(options){options=options||{};var url=this.getUrl("ScheduledTasks",options);return this.getJSON(url)},ApiClient.prototype.startScheduledTask=function(id){if(!id)throw new Error("null id");var url=this.getUrl("ScheduledTasks/Running/"+id);return this.ajax({type:"POST",url:url})},ApiClient.prototype.getScheduledTask=function(id){if(!id)throw new Error("null id");var url=this.getUrl("ScheduledTasks/"+id) +;return this.getJSON(url)},ApiClient.prototype.getNextUpEpisodes=function(options){var url=this.getUrl("Shows/NextUp",options);return this.getJSON(url)},ApiClient.prototype.stopScheduledTask=function(id){if(!id)throw new Error("null id");var url=this.getUrl("ScheduledTasks/Running/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.getPluginConfiguration=function(id){if(!id)throw new Error("null Id");var url=this.getUrl("Plugins/"+id+"/Configuration");return this.getJSON(url)},ApiClient.prototype.getAvailablePlugins=function(options){options=options||{},options.PackageType="UserInstalled";var url=this.getUrl("Packages",options);return this.getJSON(url)},ApiClient.prototype.uninstallPlugin=function(id){if(!id)throw new Error("null Id");var url=this.getUrl("Plugins/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.removeVirtualFolder=function(name,refreshLibrary){if(!name)throw new Error("null name");var url="Library/VirtualFolders";return url=this.getUrl(url,{refreshLibrary:!!refreshLibrary,name:name}),this.ajax({type:"DELETE",url:url})},ApiClient.prototype.addVirtualFolder=function(name,type,refreshLibrary,libraryOptions){if(!name)throw new Error("null name");var options={};type&&(options.collectionType=type),options.refreshLibrary=!!refreshLibrary,options.name=name;var url="Library/VirtualFolders";return url=this.getUrl(url,options),this.ajax({type:"POST",url:url,data:JSON.stringify({LibraryOptions:libraryOptions}),contentType:"application/json"})},ApiClient.prototype.updateVirtualFolderOptions=function(id,libraryOptions){if(!id)throw new Error("null name");var url="Library/VirtualFolders/LibraryOptions";return url=this.getUrl(url),this.ajax({type:"POST",url:url,data:JSON.stringify({Id:id,LibraryOptions:libraryOptions}),contentType:"application/json"})},ApiClient.prototype.renameVirtualFolder=function(name,newName,refreshLibrary){if(!name)throw new Error("null name");var url="Library/VirtualFolders/Name";return url=this.getUrl(url,{refreshLibrary:!!refreshLibrary,newName:newName,name:name}),this.ajax({type:"POST",url:url})},ApiClient.prototype.addMediaPath=function(virtualFolderName,mediaPath,networkSharePath,refreshLibrary){if(!virtualFolderName)throw new Error("null virtualFolderName");if(!mediaPath)throw new Error("null mediaPath");var url="Library/VirtualFolders/Paths",pathInfo={Path:mediaPath};return networkSharePath&&(pathInfo.NetworkPath=networkSharePath),url=this.getUrl(url,{refreshLibrary:!!refreshLibrary}),this.ajax({type:"POST",url:url,data:JSON.stringify({Name:virtualFolderName,PathInfo:pathInfo}),contentType:"application/json"})},ApiClient.prototype.updateMediaPath=function(virtualFolderName,pathInfo){if(!virtualFolderName)throw new Error("null virtualFolderName");if(!pathInfo)throw new Error("null pathInfo");var url="Library/VirtualFolders/Paths/Update";return url=this.getUrl(url),this.ajax({type:"POST",url:url,data:JSON.stringify({Name:virtualFolderName,PathInfo:pathInfo}),contentType:"application/json"})},ApiClient.prototype.removeMediaPath=function(virtualFolderName,mediaPath,refreshLibrary){if(!virtualFolderName)throw new Error("null virtualFolderName");if(!mediaPath)throw new Error("null mediaPath");var url="Library/VirtualFolders/Paths";return url=this.getUrl(url,{refreshLibrary:!!refreshLibrary,path:mediaPath,name:virtualFolderName}),this.ajax({type:"DELETE",url:url})},ApiClient.prototype.deleteUser=function(id){if(!id)throw new Error("null id");var url=this.getUrl("Users/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.deleteUserImage=function(userId,imageType,imageIndex){if(!userId)throw new Error("null userId");if(!imageType)throw new Error("null imageType");var url=this.getUrl("Users/"+userId+"/Images/"+imageType);return null!=imageIndex&&(url+="/"+imageIndex),this.ajax({type:"DELETE",url:url})},ApiClient.prototype.deleteItemImage=function(itemId,imageType,imageIndex){if(!imageType)throw new Error("null imageType");var url=this.getUrl("Items/"+itemId+"/Images");return url+="/"+imageType,null!=imageIndex&&(url+="/"+imageIndex),this.ajax({type:"DELETE",url:url})},ApiClient.prototype.deleteItem=function(itemId){if(!itemId)throw new Error("null itemId");var url=this.getUrl("Items/"+itemId);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.stopActiveEncodings=function(playSessionId){var options={deviceId:this.deviceId()};playSessionId&&(options.PlaySessionId=playSessionId);var url=this.getUrl("Videos/ActiveEncodings",options);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.reportCapabilities=function(options){var url=this.getUrl("Sessions/Capabilities/Full");return this.ajax({type:"POST",url:url,data:JSON.stringify(options),contentType:"application/json"})},ApiClient.prototype.updateItemImageIndex=function(itemId,imageType,imageIndex,newIndex){if(!imageType)throw new Error("null imageType");var options={newIndex:newIndex},url=this.getUrl("Items/"+itemId+"/Images/"+imageType+"/"+imageIndex+"/Index",options);return this.ajax({type:"POST",url:url})},ApiClient.prototype.getItemImageInfos=function(itemId){var url=this.getUrl("Items/"+itemId+"/Images");return this.getJSON(url)},ApiClient.prototype.getCriticReviews=function(itemId,options){if(!itemId)throw new Error("null itemId");var url=this.getUrl("Items/"+itemId+"/CriticReviews",options);return this.getJSON(url)},ApiClient.prototype.getItemDownloadUrl=function(itemId){if(!itemId)throw new Error("itemId cannot be empty");var url="Items/"+itemId+"/Download";return this.getUrl(url,{api_key:this.accessToken()})},ApiClient.prototype.getSessions=function(options){var url=this.getUrl("Sessions",options);return this.getJSON(url)},ApiClient.prototype.uploadUserImage=function(userId,imageType,file){if(!userId)throw new Error("null userId");if(!imageType)throw new Error("null imageType");if(!file)throw new Error("File must be an image.");if("image/png"!==file.type&&"image/jpeg"!==file.type&&"image/jpeg"!==file.type)throw new Error("File must be an image.");var instance=this;return new Promise(function(resolve,reject){var reader=new FileReader;reader.onerror=function(){reject()},reader.onabort=function(){reject()},reader.onload=function(e){var data=e.target.result.split(",")[1],url=instance.getUrl("Users/"+userId+"/Images/"+imageType);instance.ajax({type:"POST",url:url,data:data,contentType:"image/"+file.name.substring(file.name.lastIndexOf(".")+1)}).then(resolve,reject)},reader.readAsDataURL(file)})},ApiClient.prototype.uploadItemImage=function(itemId,imageType,file){if(!itemId)throw new Error("null itemId");if(!imageType)throw new Error("null imageType");if(!file)throw new Error("File must be an image.");if("image/png"!==file.type&&"image/jpeg"!==file.type&&"image/jpeg"!==file.type)throw new Error("File must be an image.");var url=this.getUrl("Items/"+itemId+"/Images");url+="/"+imageType;var instance=this;return new Promise(function(resolve,reject){var reader=new FileReader;reader.onerror=function(){reject()},reader.onabort=function(){reject()},reader.onload=function(e){var data=e.target.result.split(",")[1];instance.ajax({type:"POST",url:url,data:data,contentType:"image/"+file.name.substring(file.name.lastIndexOf(".")+1)}).then(resolve,reject)},reader.readAsDataURL(file)})},ApiClient.prototype.getInstalledPlugins=function(){var options={},url=this.getUrl("Plugins",options);return this.getJSON(url)},ApiClient.prototype.getUser=function(id){if(!id)throw new Error("Must supply a userId");var url=this.getUrl("Users/"+id);return this.getJSON(url)},ApiClient.prototype.getStudio=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("Studios/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getGenre=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("Genres/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getMusicGenre=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("MusicGenres/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getGameGenre=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("GameGenres/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getArtist=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("Artists/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getPerson=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("Persons/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getPublicUsers=function(){var url=this.getUrl("users/public");return this.ajax({type:"GET",url:url,dataType:"json"},!1)},ApiClient.prototype.getUsers=function(options){var url=this.getUrl("users",options||{});return this.getJSON(url)},ApiClient.prototype.getParentalRatings=function(){var url=this.getUrl("Localization/ParentalRatings");return this.getJSON(url)},ApiClient.prototype.getDefaultImageQuality=function(imageType){return"backdrop"===imageType.toLowerCase()?80:90},ApiClient.prototype.getUserImageUrl=function(userId,options){if(!userId)throw new Error("null userId");options=options||{};var url="Users/"+userId+"/Images/"+options.type;return null!=options.index&&(url+="/"+options.index),normalizeImageOptions(this,options),delete options.type,delete options.index,this.getUrl(url,options)},ApiClient.prototype.getImageUrl=function(itemId,options){if(!itemId)throw new Error("itemId cannot be empty");options=options||{};var url="Items/"+itemId+"/Images/"+options.type;return null!=options.index&&(url+="/"+options.index),options.quality=options.quality||this.getDefaultImageQuality(options.type),this.normalizeImageOptions&&this.normalizeImageOptions(options),delete options.type,delete options.index,this.getUrl(url,options)},ApiClient.prototype.getScaledImageUrl=function(itemId,options){if(!itemId)throw new Error("itemId cannot be empty");options=options||{};var url="Items/"+itemId+"/Images/"+options.type;return null!=options.index&&(url+="/"+options.index),normalizeImageOptions(this,options),delete options.type,delete options.index,delete options.minScale,this.getUrl(url,options)},ApiClient.prototype.getThumbImageUrl=function(item,options){if(!item)throw new Error("null item");return options=options||{},options.imageType="thumb",item.ImageTags&&item.ImageTags.Thumb?(options.tag=item.ImageTags.Thumb,this.getImageUrl(item.Id,options)):item.ParentThumbItemId?(options.tag=item.ImageTags.ParentThumbImageTag,this.getImageUrl(item.ParentThumbItemId,options)):null},ApiClient.prototype.updateUserPassword=function(userId,currentPassword,newPassword){if(!userId)return Promise.reject();var url=this.getUrl("Users/"+userId+"/Password");return this.ajax({type:"POST",url:url,data:JSON.stringify({CurrentPw:currentPassword||"",NewPw:newPassword}),contentType:"application/json"})},ApiClient.prototype.updateEasyPassword=function(userId,newPassword){if(!userId)return void Promise.reject();var url=this.getUrl("Users/"+userId+"/EasyPassword");return this.ajax({type:"POST",url:url,data:{NewPw:newPassword}})},ApiClient.prototype.resetUserPassword=function(userId){if(!userId)throw new Error("null userId");var url=this.getUrl("Users/"+userId+"/Password"),postData={};return postData.resetPassword=!0,this.ajax({type:"POST",url:url,data:postData})},ApiClient.prototype.resetEasyPassword=function(userId){if(!userId)throw new Error("null userId");var url=this.getUrl("Users/"+userId+"/EasyPassword"),postData={};return postData.resetPassword=!0,this.ajax({type:"POST",url:url,data:postData})},ApiClient.prototype.updateServerConfiguration=function(configuration){if(!configuration)throw new Error("null configuration");var url=this.getUrl("System/Configuration");return this.ajax({type:"POST",url:url,data:JSON.stringify(configuration),contentType:"application/json"})},ApiClient.prototype.updateNamedConfiguration=function(name,configuration){if(!configuration)throw new Error("null configuration");var url=this.getUrl("System/Configuration/"+name);return this.ajax({type:"POST",url:url,data:JSON.stringify(configuration),contentType:"application/json"})},ApiClient.prototype.updateItem=function(item){if(!item)throw new Error("null item");var url=this.getUrl("Items/"+item.Id);return this.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},ApiClient.prototype.updatePluginSecurityInfo=function(info){var url=this.getUrl("Plugins/SecurityInfo");return this.ajax({type:"POST",url:url,data:JSON.stringify(info),contentType:"application/json"})},ApiClient.prototype.createUser=function(name){var url=this.getUrl("Users/New");return this.ajax({type:"POST",url:url,data:{Name:name},dataType:"json"})},ApiClient.prototype.updateUser=function(user){if(!user)throw new Error("null user");var url=this.getUrl("Users/"+user.Id);return this.ajax({type:"POST",url:url,data:JSON.stringify(user),contentType:"application/json"})},ApiClient.prototype.updateUserPolicy=function(userId,policy){if(!userId)throw new Error("null userId");if(!policy)throw new Error("null policy");var url=this.getUrl("Users/"+userId+"/Policy");return this.ajax({type:"POST",url:url,data:JSON.stringify(policy),contentType:"application/json"})},ApiClient.prototype.updateUserConfiguration=function(userId,configuration){if(!userId)throw new Error("null userId");if(!configuration)throw new Error("null configuration");var url=this.getUrl("Users/"+userId+"/Configuration");return this.ajax({type:"POST",url:url,data:JSON.stringify(configuration),contentType:"application/json"})},ApiClient.prototype.updateScheduledTaskTriggers=function(id,triggers){if(!id)throw new Error("null id");if(!triggers)throw new Error("null triggers");var url=this.getUrl("ScheduledTasks/"+id+"/Triggers");return this.ajax({type:"POST",url:url,data:JSON.stringify(triggers),contentType:"application/json"})},ApiClient.prototype.updatePluginConfiguration=function(id,configuration){if(!id)throw new Error("null Id");if(!configuration)throw new Error("null configuration");var url=this.getUrl("Plugins/"+id+"/Configuration");return this.ajax({type:"POST",url:url,data:JSON.stringify(configuration),contentType:"application/json"})},ApiClient.prototype.getAncestorItems=function(itemId,userId){if(!itemId)throw new Error("null itemId");var options={};userId&&(options.userId=userId);var url=this.getUrl("Items/"+itemId+"/Ancestors",options);return this.getJSON(url)},ApiClient.prototype.getItems=function(userId,options){var url;return url="string"===(typeof userId).toString().toLowerCase()?this.getUrl("Users/"+userId+"/Items",options):this.getUrl("Items",options),this.getJSON(url)},ApiClient.prototype.getResumableItems=function(userId,options){return this.isMinServerVersion("3.2.33")?this.getJSON(this.getUrl("Users/"+userId+"/Items/Resume",options)):this.getItems(userId,Object.assign({SortBy:"DatePlayed",SortOrder:"Descending",Filters:"IsResumable",Recursive:!0,CollapseBoxSetItems:!1,ExcludeLocationTypes:"Virtual"},options))},ApiClient.prototype.getMovieRecommendations=function(options){return this.getJSON(this.getUrl("Movies/Recommendations",options))},ApiClient.prototype.getUpcomingEpisodes=function(options){return this.getJSON(this.getUrl("Shows/Upcoming",options))},ApiClient.prototype.getUserViews=function(options,userId){options=options||{};var url=this.getUrl("Users/"+(userId||this.getCurrentUserId())+"/Views",options);return this.getJSON(url)},ApiClient.prototype.getArtists=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("Artists",options);return this.getJSON(url)},ApiClient.prototype.getAlbumArtists=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("Artists/AlbumArtists",options);return this.getJSON(url)},ApiClient.prototype.getGenres=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("Genres",options);return this.getJSON(url)},ApiClient.prototype.getMusicGenres=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("MusicGenres",options);return this.getJSON(url)},ApiClient.prototype.getGameGenres=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("GameGenres",options);return this.getJSON(url)},ApiClient.prototype.getPeople=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("Persons",options);return this.getJSON(url)},ApiClient.prototype.getStudios=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("Studios",options);return this.getJSON(url)},ApiClient.prototype.getLocalTrailers=function(userId,itemId){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/Items/"+itemId+"/LocalTrailers");return this.getJSON(url)},ApiClient.prototype.getGameSystems=function(){var options={},userId=this.getCurrentUserId();userId&&(options.userId=userId);var url=this.getUrl("Games/SystemSummaries",options);return this.getJSON(url)},ApiClient.prototype.getAdditionalVideoParts=function(userId,itemId){if(!itemId)throw new Error("null itemId");var options={};userId&&(options.userId=userId);var url=this.getUrl("Videos/"+itemId+"/AdditionalParts",options);return this.getJSON(url)},ApiClient.prototype.getThemeMedia=function(userId,itemId,inherit){if(!itemId)throw new Error("null itemId");var options={};userId&&(options.userId=userId),options.InheritFromParent=inherit||!1;var url=this.getUrl("Items/"+itemId+"/ThemeMedia",options);return this.getJSON(url)},ApiClient.prototype.getSearchHints=function(options){var url=this.getUrl("Search/Hints",options),serverId=this.serverId();return this.getJSON(url).then(function(result){return result.SearchHints.forEach(function(i){i.ServerId=serverId}),result})},ApiClient.prototype.getSpecialFeatures=function(userId,itemId){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/Items/"+itemId+"/SpecialFeatures");return this.getJSON(url)},ApiClient.prototype.getDateParamValue=function(date){function formatDigit(i){return i<10?"0"+i:i}var d=date;return""+d.getFullYear()+formatDigit(d.getMonth()+1)+formatDigit(d.getDate())+formatDigit(d.getHours())+formatDigit(d.getMinutes())+formatDigit(d.getSeconds())},ApiClient.prototype.markPlayed=function(userId,itemId,date){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var options={};date&&(options.DatePlayed=this.getDateParamValue(date));var url=this.getUrl("Users/"+userId+"/PlayedItems/"+itemId,options);return this.ajax({type:"POST",url:url,dataType:"json"})},ApiClient.prototype.markUnplayed=function(userId,itemId){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/PlayedItems/"+itemId);return this.ajax({type:"DELETE",url:url,dataType:"json"})},ApiClient.prototype.updateFavoriteStatus=function(userId,itemId,isFavorite){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/FavoriteItems/"+itemId),method=isFavorite?"POST":"DELETE";return this.ajax({type:method,url:url,dataType:"json"})},ApiClient.prototype.updateUserItemRating=function(userId,itemId,likes){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/Items/"+itemId+"/Rating",{likes:likes});return this.ajax({type:"POST",url:url,dataType:"json"})},ApiClient.prototype.getItemCounts=function(userId){var options={};userId&&(options.userId=userId);var url=this.getUrl("Items/Counts",options);return this.getJSON(url)},ApiClient.prototype.clearUserItemRating=function(userId,itemId){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/Items/"+itemId+"/Rating");return this.ajax({type:"DELETE",url:url,dataType:"json"})},ApiClient.prototype.reportPlaybackStart=function(options){if(!options)throw new Error("null options");this.lastPlaybackProgressReport=0,this.lastPlaybackProgressReportTicks=null,stopBitrateDetection(this);var url=this.getUrl("Sessions/Playing");return this.ajax({type:"POST",data:JSON.stringify(options),contentType:"application/json",url:url})},ApiClient.prototype.reportPlaybackProgress=function(options){if(!options)throw new Error("null options");var newPositionTicks=options.PositionTicks;if("timeupdate"===(options.EventName||"timeupdate")){var now=(new Date).getTime(),msSinceLastReport=now-(this.lastPlaybackProgressReport||0);if(msSinceLastReport<=1e4){if(!newPositionTicks)return Promise.resolve();var expectedReportTicks=1e4*msSinceLastReport+(this.lastPlaybackProgressReportTicks||0);if(Math.abs((newPositionTicks||0)-expectedReportTicks)<5e7)return Promise.resolve()}this.lastPlaybackProgressReport=now}else this.lastPlaybackProgressReport=0;this.lastPlaybackProgressReportTicks=newPositionTicks;var url=this.getUrl("Sessions/Playing/Progress");return this.ajax({type:"POST",data:JSON.stringify(options),contentType:"application/json",url:url})},ApiClient.prototype.reportOfflineActions=function(actions){if(!actions)throw new Error("null actions");var url=this.getUrl("Sync/OfflineActions");return this.ajax({type:"POST",data:JSON.stringify(actions),contentType:"application/json",url:url})},ApiClient.prototype.syncData=function(data){if(!data)throw new Error("null data");var url=this.getUrl("Sync/Data");return this.ajax({type:"POST",data:JSON.stringify(data),contentType:"application/json",url:url,dataType:"json"})},ApiClient.prototype.getReadySyncItems=function(deviceId){if(!deviceId)throw new Error("null deviceId");var url=this.getUrl("Sync/Items/Ready",{TargetId:deviceId});return this.getJSON(url)},ApiClient.prototype.reportSyncJobItemTransferred=function(syncJobItemId){if(!syncJobItemId)throw new Error("null syncJobItemId");var url=this.getUrl("Sync/JobItems/"+syncJobItemId+"/Transferred");return this.ajax({type:"POST",url:url})},ApiClient.prototype.cancelSyncItems=function(itemIds,targetId){if(!itemIds)throw new Error("null itemIds");var url=this.getUrl("Sync/"+(targetId||this.deviceId())+"/Items",{ItemIds:itemIds.join(",")});return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.reportPlaybackStopped=function(options){if(!options)throw new Error("null options");this.lastPlaybackProgressReport=0,this.lastPlaybackProgressReportTicks=null,redetectBitrate(this);var url=this.getUrl("Sessions/Playing/Stopped");return this.ajax({type:"POST",data:JSON.stringify(options),contentType:"application/json",url:url})},ApiClient.prototype.sendPlayCommand=function(sessionId,options){if(!sessionId)throw new Error("null sessionId");if(!options)throw new Error("null options");var url=this.getUrl("Sessions/"+sessionId+"/Playing",options);return this.ajax({type:"POST",url:url})},ApiClient.prototype.sendCommand=function(sessionId,command){if(!sessionId)throw new Error("null sessionId");if(!command)throw new Error("null command");var url=this.getUrl("Sessions/"+sessionId+"/Command"),ajaxOptions={type:"POST",url:url};return ajaxOptions.data=JSON.stringify(command),ajaxOptions.contentType="application/json",this.ajax(ajaxOptions)},ApiClient.prototype.sendMessageCommand=function(sessionId,options){if(!sessionId)throw new Error("null sessionId");if(!options)throw new Error("null options");var url=this.getUrl("Sessions/"+sessionId+"/Message"),ajaxOptions={type:"POST",url:url};return ajaxOptions.data=JSON.stringify(options),ajaxOptions.contentType="application/json",this.ajax(ajaxOptions)},ApiClient.prototype.sendPlayStateCommand=function(sessionId,command,options){if(!sessionId)throw new Error("null sessionId");if(!command)throw new Error("null command");var url=this.getUrl("Sessions/"+sessionId+"/Playing/"+command,options||{});return this.ajax({type:"POST",url:url})},ApiClient.prototype.createPackageReview=function(review){var url=this.getUrl("Packages/Reviews/"+review.id,review);return this.ajax({type:"POST",url:url})},ApiClient.prototype.getPackageReviews=function(packageId,minRating,maxRating,limit){if(!packageId)throw new Error("null packageId");var options={};minRating&&(options.MinRating=minRating),maxRating&&(options.MaxRating=maxRating),limit&&(options.Limit=limit);var url=this.getUrl("Packages/"+packageId+"/Reviews",options);return this.getJSON(url)},ApiClient.prototype.getSavedEndpointInfo=function(){return this._endPointInfo},ApiClient.prototype.getEndpointInfo=function(){var savedValue=this._endPointInfo;if(savedValue)return Promise.resolve(savedValue);var instance=this;return this.getJSON(this.getUrl("System/Endpoint")).then(function(endPointInfo){return setSavedEndpointInfo(instance,endPointInfo),endPointInfo})},ApiClient.prototype.getWakeOnLanInfo=function(){return this.getJSON(this.getUrl("System/WakeOnLanInfo"))},ApiClient.prototype.getLatestItems=function(options){return options=options||{},this.getJSON(this.getUrl("Users/"+this.getCurrentUserId()+"/Items/Latest",options))},ApiClient.prototype.getFilters=function(options){return this.getJSON(this.getUrl("Items/Filters2",options))},ApiClient.prototype.supportsWakeOnLan=function(){return!!wakeOnLan.isSupported()&&getCachedWakeOnLanInfo(this).length>0},ApiClient.prototype.wakeOnLan=function(){var infos=getCachedWakeOnLanInfo(this);return new Promise(function(resolve,reject){sendNextWakeOnLan(infos,0,resolve)})},ApiClient.prototype.setSystemInfo=function(info){this._serverVersion=info.Version},ApiClient.prototype.serverVersion=function(){return this._serverVersion},ApiClient.prototype.isMinServerVersion=function(version){var serverVersion=this.serverVersion();return!!serverVersion&&compareVersions(serverVersion,version)>=0},ApiClient.prototype.handleMessageReceived=function(msg){onMessageReceivedInternal(this,msg)},ApiClient}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/apiclientex.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/apiclientex.js index 69f598ebb3..600193d36a 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/apiclientex.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/apiclientex.js @@ -1 +1 @@ -define(["apiclientcore","localassetmanager"],function(ApiClient,localassetmanager){"use strict";function isLocalId(str){return startsWith(str,localPrefix)}function isLocalViewId(str){return startsWith(str,localViewPrefix)}function isTopLevelLocalViewId(str){return"localview"===str}function stripLocalPrefix(str){var res=stripStart(str,localPrefix);return res=stripStart(res,localViewPrefix)}function startsWith(str,find){return!!(str&&find&&str.length>find.length&&0===str.indexOf(find))}function stripStart(str,find){return startsWith(str,find)?str.substr(find.length):str}function createEmptyList(){var result={Items:[],TotalRecordCount:0};return result}function convertGuidToLocal(guid){return guid?isLocalId(guid)?guid:"local:"+guid:null}function adjustGuidProperties(downloadedItem){downloadedItem.Id=convertGuidToLocal(downloadedItem.Id),downloadedItem.SeriesId=convertGuidToLocal(downloadedItem.SeriesId),downloadedItem.SeasonId=convertGuidToLocal(downloadedItem.SeasonId),downloadedItem.AlbumId=convertGuidToLocal(downloadedItem.AlbumId),downloadedItem.ParentId=convertGuidToLocal(downloadedItem.ParentId),downloadedItem.ParentThumbItemId=convertGuidToLocal(downloadedItem.ParentThumbItemId),downloadedItem.ParentPrimaryImageItemId=convertGuidToLocal(downloadedItem.ParentPrimaryImageItemId),downloadedItem.PrimaryImageItemId=convertGuidToLocal(downloadedItem.PrimaryImageItemId),downloadedItem.ParentLogoItemId=convertGuidToLocal(downloadedItem.ParentLogoItemId),downloadedItem.ParentBackdropItemId=convertGuidToLocal(downloadedItem.ParentBackdropItemId),downloadedItem.ParentBackdropImageTags=null}function getLocalView(instance,serverId,userId){return instance.getLocalFolders(serverId,userId).then(function(views){var localView=null;return views.length>0&&(localView={Name:instance.downloadsTitleText||"Downloads",ServerId:serverId,Id:"localview",Type:"localview",IsFolder:!0}),Promise.resolve(localView)})}function ApiClientEx(serverAddress,clientName,applicationVersion,deviceName,deviceId,devicePixelRatio){ApiClient.call(this,serverAddress,clientName,applicationVersion,deviceName,deviceId,devicePixelRatio)}var localPrefix="local:",localViewPrefix="localview:";return Object.assign(ApiClientEx.prototype,ApiClient.prototype),ApiClientEx.prototype.getPlaybackInfo=function(itemId,options,deviceProfile){var onFailure=function(){return ApiClient.prototype.getPlaybackInfo.call(instance,itemId,options,deviceProfile)};if(isLocalId(itemId))return localassetmanager.getLocalItem(this.serverId(),stripLocalPrefix(itemId)).then(function(item){var mediaSources=item.Item.MediaSources.map(function(m){return m.SupportsDirectPlay=!0,m.SupportsDirectStream=!1,m.SupportsTranscoding=!1,m.IsLocal=!0,m});return{MediaSources:mediaSources}},onFailure);var instance=this;return localassetmanager.getLocalItem(this.serverId(),itemId).then(function(item){if(item){var mediaSources=item.Item.MediaSources.map(function(m){return m.SupportsDirectPlay=!0,m.SupportsDirectStream=!1,m.SupportsTranscoding=!1,m.IsLocal=!0,m});return localassetmanager.fileExists(item.LocalPath).then(function(exists){if(exists){var res={MediaSources:mediaSources};return Promise.resolve(res)}return ApiClient.prototype.getPlaybackInfo.call(instance,itemId,options,deviceProfile)},onFailure)}return ApiClient.prototype.getPlaybackInfo.call(instance,itemId,options,deviceProfile)},onFailure)},ApiClientEx.prototype.getItems=function(userId,options){var i,serverInfo=this.serverInfo();if(serverInfo&&"localview"===options.ParentId)return this.getLocalFolders(serverInfo.Id,userId).then(function(items){var result={Items:items,TotalRecordCount:items.length};return Promise.resolve(result)});if(serverInfo&&options&&(isLocalId(options.ParentId)||isLocalId(options.SeriesId)||isLocalId(options.SeasonId)||isLocalViewId(options.ParentId)))return localassetmanager.getViewItems(serverInfo.Id,userId,options).then(function(items){items.forEach(function(item){adjustGuidProperties(item)}),items.sort(function(a,b){return a.SortName.toLowerCase().localeCompare(b.SortName.toLowerCase())});var result={Items:items,TotalRecordCount:items.length};return Promise.resolve(result)});if(options&&options.ExcludeItemIds&&options.ExcludeItemIds.length){var exItems=options.ExcludeItemIds.split(",");for(i=0;i0?Promise.resolve(views[0]):Promise.reject()}):isLocalId(itemId)&&(serverInfo=this.serverInfo())?localassetmanager.getLocalItem(serverInfo.Id,stripLocalPrefix(itemId)).then(function(item){return adjustGuidProperties(item.Item),Promise.resolve(item.Item)}):ApiClient.prototype.getItem.call(this,userId,itemId)},ApiClientEx.prototype.getLocalFolders=function(userId){var serverInfo=this.serverInfo();return userId=userId||serverInfo.UserId,localassetmanager.getViews(serverInfo.Id,userId)},ApiClientEx.prototype.getNextUpEpisodes=function(options){return options.SeriesId&&isLocalId(options.SeriesId)?Promise.resolve(createEmptyList()):ApiClient.prototype.getNextUpEpisodes.call(this,options)},ApiClientEx.prototype.getSeasons=function(itemId,options){return isLocalId(itemId)?(options.SeriesId=itemId,options.IncludeItemTypes="Season",this.getItems(this.getCurrentUserId(),options)):ApiClient.prototype.getSeasons.call(this,itemId,options)},ApiClientEx.prototype.getEpisodes=function(itemId,options){return isLocalId(options.SeasonId)||isLocalId(options.seasonId)?(options.SeriesId=itemId,options.IncludeItemTypes="Episode",this.getItems(this.getCurrentUserId(),options)):isLocalId(itemId)?(options.SeriesId=itemId,options.IncludeItemTypes="Episode",this.getItems(this.getCurrentUserId(),options)):ApiClient.prototype.getEpisodes.call(this,itemId,options)},ApiClientEx.prototype.getLatestOfflineItems=function(options){options.SortBy="DateCreated",options.SortOrder="Descending";var serverInfo=this.serverInfo();return serverInfo?localassetmanager.getViewItems(serverInfo.Id,null,options).then(function(items){return items.forEach(function(item){adjustGuidProperties(item)}),Promise.resolve(items)}):Promise.resolve([])},ApiClientEx.prototype.getThemeMedia=function(userId,itemId,inherit){return isLocalViewId(itemId)||isLocalId(itemId)||isTopLevelLocalViewId(itemId)?Promise.reject():ApiClient.prototype.getThemeMedia.call(this,userId,itemId,inherit)},ApiClientEx.prototype.getSpecialFeatures=function(userId,itemId){return isLocalId(itemId)?Promise.resolve([]):ApiClient.prototype.getSpecialFeatures.call(this,userId,itemId)},ApiClientEx.prototype.getSimilarItems=function(itemId,options){return isLocalId(itemId)?Promise.resolve(createEmptyList()):ApiClient.prototype.getSimilarItems.call(this,itemId,options)},ApiClientEx.prototype.updateFavoriteStatus=function(userId,itemId,isFavorite){return isLocalId(itemId)?Promise.resolve():ApiClient.prototype.updateFavoriteStatus.call(this,userId,itemId,isFavorite)},ApiClientEx.prototype.getScaledImageUrl=function(itemId,options){if(isLocalId(itemId)||options&&options.itemid&&isLocalId(options.itemid)){var serverInfo=this.serverInfo(),id=stripLocalPrefix(itemId);return localassetmanager.getImageUrl(serverInfo.Id,id,options)}return ApiClient.prototype.getScaledImageUrl.call(this,itemId,options)},ApiClientEx.prototype.reportPlaybackStart=function(options){if(!options)throw new Error("null options");return isLocalId(options.ItemId)?Promise.resolve():ApiClient.prototype.reportPlaybackStart.call(this,options)},ApiClientEx.prototype.reportPlaybackProgress=function(options){if(!options)throw new Error("null options");if(isLocalId(options.ItemId)){var serverInfo=this.serverInfo();return serverInfo?localassetmanager.getLocalItem(serverInfo.Id,stripLocalPrefix(options.ItemId)).then(function(item){var libraryItem=item.Item;return"Video"===libraryItem.MediaType||"AudioBook"===libraryItem.Type?(libraryItem.UserData=libraryItem.UserData||{},libraryItem.UserData.PlaybackPositionTicks=options.PositionTicks,libraryItem.UserData.PlayedPercentage=Math.min(libraryItem.RunTimeTicks?100*((options.PositionTicks||0)/libraryItem.RunTimeTicks):0,100),localassetmanager.addOrUpdateLocalItem(item)):Promise.resolve()}):Promise.resolve()}return ApiClient.prototype.reportPlaybackProgress.call(this,options)},ApiClientEx.prototype.reportPlaybackStopped=function(options){if(!options)throw new Error("null options");if(isLocalId(options.ItemId)){var serverInfo=this.serverInfo(),action={Date:(new Date).getTime(),ItemId:stripLocalPrefix(options.ItemId),PositionTicks:options.PositionTicks,ServerId:serverInfo.Id,Type:0,UserId:this.getCurrentUserId()};return localassetmanager.recordUserAction(action)}return ApiClient.prototype.reportPlaybackStopped.call(this,options)},ApiClientEx.prototype.getIntros=function(itemId){return isLocalId(itemId)?Promise.resolve({Items:[],TotalRecordCount:0}):ApiClient.prototype.getIntros.call(this,itemId)},ApiClientEx.prototype.getInstantMixFromItem=function(itemId,options){return isLocalId(itemId)?Promise.resolve({Items:[],TotalRecordCount:0}):ApiClient.prototype.getInstantMixFromItem.call(this,itemId,options)},ApiClientEx.prototype.getItemDownloadUrl=function(itemId){if(isLocalId(itemId)){var serverInfo=this.serverInfo();if(serverInfo)return localassetmanager.getLocalItem(serverInfo.Id,stripLocalPrefix(itemId)).then(function(item){return Promise.resolve(item.LocalPath)})}return ApiClient.prototype.getItemDownloadUrl.call(this,itemId)},ApiClientEx}); \ No newline at end of file +define(["apiclientcore","localassetmanager"],function(ApiClient,localassetmanager){"use strict";function isLocalId(str){return startsWith(str,localPrefix)}function isLocalViewId(str){return startsWith(str,localViewPrefix)}function isTopLevelLocalViewId(str){return"localview"===str}function stripLocalPrefix(str){var res=stripStart(str,localPrefix);return res=stripStart(res,localViewPrefix)}function startsWith(str,find){return!!(str&&find&&str.length>find.length&&0===str.indexOf(find))}function stripStart(str,find){return startsWith(str,find)?str.substr(find.length):str}function createEmptyList(){return{Items:[],TotalRecordCount:0}}function convertGuidToLocal(guid){return guid?isLocalId(guid)?guid:"local:"+guid:null}function adjustGuidProperties(downloadedItem){downloadedItem.Id=convertGuidToLocal(downloadedItem.Id),downloadedItem.SeriesId=convertGuidToLocal(downloadedItem.SeriesId),downloadedItem.SeasonId=convertGuidToLocal(downloadedItem.SeasonId),downloadedItem.AlbumId=convertGuidToLocal(downloadedItem.AlbumId),downloadedItem.ParentId=convertGuidToLocal(downloadedItem.ParentId),downloadedItem.ParentThumbItemId=convertGuidToLocal(downloadedItem.ParentThumbItemId),downloadedItem.ParentPrimaryImageItemId=convertGuidToLocal(downloadedItem.ParentPrimaryImageItemId),downloadedItem.PrimaryImageItemId=convertGuidToLocal(downloadedItem.PrimaryImageItemId),downloadedItem.ParentLogoItemId=convertGuidToLocal(downloadedItem.ParentLogoItemId),downloadedItem.ParentBackdropItemId=convertGuidToLocal(downloadedItem.ParentBackdropItemId),downloadedItem.ParentBackdropImageTags=null}function getLocalView(instance,serverId,userId){return instance.getLocalFolders(serverId,userId).then(function(views){var localView=null;return views.length>0&&(localView={Name:instance.downloadsTitleText||"Downloads",ServerId:serverId,Id:"localview",Type:"localview",IsFolder:!0}),Promise.resolve(localView)})}function ApiClientEx(serverAddress,clientName,applicationVersion,deviceName,deviceId,devicePixelRatio){ApiClient.call(this,serverAddress,clientName,applicationVersion,deviceName,deviceId,devicePixelRatio)}var localPrefix="local:",localViewPrefix="localview:";return Object.assign(ApiClientEx.prototype,ApiClient.prototype),ApiClientEx.prototype.getPlaybackInfo=function(itemId,options,deviceProfile){var onFailure=function(){return ApiClient.prototype.getPlaybackInfo.call(instance,itemId,options,deviceProfile)};if(isLocalId(itemId))return localassetmanager.getLocalItem(this.serverId(),stripLocalPrefix(itemId)).then(function(item){return{MediaSources:item.Item.MediaSources.map(function(m){return m.SupportsDirectPlay=!0,m.SupportsDirectStream=!1,m.SupportsTranscoding=!1,m.IsLocal=!0,m})}},onFailure);var instance=this;return localassetmanager.getLocalItem(this.serverId(),itemId).then(function(item){if(item){var mediaSources=item.Item.MediaSources.map(function(m){return m.SupportsDirectPlay=!0,m.SupportsDirectStream=!1,m.SupportsTranscoding=!1,m.IsLocal=!0,m});return localassetmanager.fileExists(item.LocalPath).then(function(exists){if(exists){var res={MediaSources:mediaSources};return Promise.resolve(res)}return ApiClient.prototype.getPlaybackInfo.call(instance,itemId,options,deviceProfile)},onFailure)}return ApiClient.prototype.getPlaybackInfo.call(instance,itemId,options,deviceProfile)},onFailure)},ApiClientEx.prototype.getItems=function(userId,options){var i,serverInfo=this.serverInfo();if(serverInfo&&"localview"===options.ParentId)return this.getLocalFolders(serverInfo.Id,userId).then(function(items){var result={Items:items,TotalRecordCount:items.length};return Promise.resolve(result)});if(serverInfo&&options&&(isLocalId(options.ParentId)||isLocalId(options.SeriesId)||isLocalId(options.SeasonId)||isLocalViewId(options.ParentId)))return localassetmanager.getViewItems(serverInfo.Id,userId,options).then(function(items){items.forEach(function(item){adjustGuidProperties(item)}),items.sort(function(a,b){return a.SortName.toLowerCase().localeCompare(b.SortName.toLowerCase())});var result={Items:items,TotalRecordCount:items.length};return Promise.resolve(result)});if(options&&options.ExcludeItemIds&&options.ExcludeItemIds.length){var exItems=options.ExcludeItemIds.split(",");for(i=0;i0?Promise.resolve(views[0]):Promise.reject()}):isLocalId(itemId)&&(serverInfo=this.serverInfo())?localassetmanager.getLocalItem(serverInfo.Id,stripLocalPrefix(itemId)).then(function(item){return adjustGuidProperties(item.Item),Promise.resolve(item.Item)}):ApiClient.prototype.getItem.call(this,userId,itemId)},ApiClientEx.prototype.getLocalFolders=function(userId){var serverInfo=this.serverInfo();return userId=userId||serverInfo.UserId,localassetmanager.getViews(serverInfo.Id,userId)},ApiClientEx.prototype.getNextUpEpisodes=function(options){return options.SeriesId&&isLocalId(options.SeriesId)?Promise.resolve(createEmptyList()):ApiClient.prototype.getNextUpEpisodes.call(this,options)},ApiClientEx.prototype.getSeasons=function(itemId,options){return isLocalId(itemId)?(options.SeriesId=itemId,options.IncludeItemTypes="Season",this.getItems(this.getCurrentUserId(),options)):ApiClient.prototype.getSeasons.call(this,itemId,options)},ApiClientEx.prototype.getEpisodes=function(itemId,options){return isLocalId(options.SeasonId)||isLocalId(options.seasonId)?(options.SeriesId=itemId,options.IncludeItemTypes="Episode",this.getItems(this.getCurrentUserId(),options)):isLocalId(itemId)?(options.SeriesId=itemId,options.IncludeItemTypes="Episode",this.getItems(this.getCurrentUserId(),options)):ApiClient.prototype.getEpisodes.call(this,itemId,options)},ApiClientEx.prototype.getLatestOfflineItems=function(options){options.SortBy="DateCreated",options.SortOrder="Descending";var serverInfo=this.serverInfo();return serverInfo?localassetmanager.getViewItems(serverInfo.Id,null,options).then(function(items){return items.forEach(function(item){adjustGuidProperties(item)}),Promise.resolve(items)}):Promise.resolve([])},ApiClientEx.prototype.getThemeMedia=function(userId,itemId,inherit){return isLocalViewId(itemId)||isLocalId(itemId)||isTopLevelLocalViewId(itemId)?Promise.reject():ApiClient.prototype.getThemeMedia.call(this,userId,itemId,inherit)},ApiClientEx.prototype.getSpecialFeatures=function(userId,itemId){return isLocalId(itemId)?Promise.resolve([]):ApiClient.prototype.getSpecialFeatures.call(this,userId,itemId)},ApiClientEx.prototype.getSimilarItems=function(itemId,options){return isLocalId(itemId)?Promise.resolve(createEmptyList()):ApiClient.prototype.getSimilarItems.call(this,itemId,options)},ApiClientEx.prototype.updateFavoriteStatus=function(userId,itemId,isFavorite){return isLocalId(itemId)?Promise.resolve():ApiClient.prototype.updateFavoriteStatus.call(this,userId,itemId,isFavorite)},ApiClientEx.prototype.getScaledImageUrl=function(itemId,options){if(isLocalId(itemId)||options&&options.itemid&&isLocalId(options.itemid)){var serverInfo=this.serverInfo(),id=stripLocalPrefix(itemId);return localassetmanager.getImageUrl(serverInfo.Id,id,options)}return ApiClient.prototype.getScaledImageUrl.call(this,itemId,options)},ApiClientEx.prototype.reportPlaybackStart=function(options){if(!options)throw new Error("null options");return isLocalId(options.ItemId)?Promise.resolve():ApiClient.prototype.reportPlaybackStart.call(this,options)},ApiClientEx.prototype.reportPlaybackProgress=function(options){if(!options)throw new Error("null options");if(isLocalId(options.ItemId)){var serverInfo=this.serverInfo();return serverInfo?localassetmanager.getLocalItem(serverInfo.Id,stripLocalPrefix(options.ItemId)).then(function(item){var libraryItem=item.Item;return"Video"===libraryItem.MediaType||"AudioBook"===libraryItem.Type?(libraryItem.UserData=libraryItem.UserData||{},libraryItem.UserData.PlaybackPositionTicks=options.PositionTicks,libraryItem.UserData.PlayedPercentage=Math.min(libraryItem.RunTimeTicks?(options.PositionTicks||0)/libraryItem.RunTimeTicks*100:0,100),localassetmanager.addOrUpdateLocalItem(item)):Promise.resolve()}):Promise.resolve()}return ApiClient.prototype.reportPlaybackProgress.call(this,options)},ApiClientEx.prototype.reportPlaybackStopped=function(options){if(!options)throw new Error("null options");if(isLocalId(options.ItemId)){var serverInfo=this.serverInfo(),action={Date:(new Date).getTime(),ItemId:stripLocalPrefix(options.ItemId),PositionTicks:options.PositionTicks,ServerId:serverInfo.Id,Type:0,UserId:this.getCurrentUserId()};return localassetmanager.recordUserAction(action)}return ApiClient.prototype.reportPlaybackStopped.call(this,options)},ApiClientEx.prototype.getIntros=function(itemId){return isLocalId(itemId)?Promise.resolve({Items:[],TotalRecordCount:0}):ApiClient.prototype.getIntros.call(this,itemId)},ApiClientEx.prototype.getInstantMixFromItem=function(itemId,options){return isLocalId(itemId)?Promise.resolve({Items:[],TotalRecordCount:0}):ApiClient.prototype.getInstantMixFromItem.call(this,itemId,options)},ApiClientEx.prototype.getItemDownloadUrl=function(itemId){if(isLocalId(itemId)){var serverInfo=this.serverInfo();if(serverInfo)return localassetmanager.getLocalItem(serverInfo.Id,stripLocalPrefix(itemId)).then(function(item){return Promise.resolve(item.LocalPath)})}return ApiClient.prototype.getItemDownloadUrl.call(this,itemId)},ApiClientEx}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/appstorage-cache.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/appstorage-cache.js index 73711b3125..bbad4e1ffe 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/appstorage-cache.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/appstorage-cache.js @@ -1 +1 @@ -define([],function(){"use strict";function MyStore(){}function updateCache(instance){instance.cache.put("data",new Response(JSON.stringify(instance.localData)))}return MyStore.prototype.init=function(){var instance=this;return caches.open("embydata").then(function(result){instance.cache=result,instance.localData={}})},MyStore.prototype.setItem=function(name,value){if(this.localData){var changed=this.localData[name]!==value;changed&&(this.localData[name]=value,updateCache(this))}},MyStore.prototype.getItem=function(name){if(this.localData)return this.localData[name]},MyStore.prototype.removeItem=function(name){this.localData&&(this.localData[name]=null,delete this.localData[name],updateCache(this))},new MyStore}); \ No newline at end of file +define([],function(){"use strict";function MyStore(){}function updateCache(instance){instance.cache.put("data",new Response(JSON.stringify(instance.localData)))}return MyStore.prototype.init=function(){var instance=this;return caches.open("embydata").then(function(result){instance.cache=result,instance.localData={}})},MyStore.prototype.setItem=function(name,value){if(this.localData){this.localData[name]!==value&&(this.localData[name]=value,updateCache(this))}},MyStore.prototype.getItem=function(name){if(this.localData)return this.localData[name]},MyStore.prototype.removeItem=function(name){this.localData&&(this.localData[name]=null,delete this.localData[name],updateCache(this))},new MyStore}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/appstorage-localstorage.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/appstorage-localstorage.js index daf431aa63..5f23b2bb6e 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/appstorage-localstorage.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/appstorage-localstorage.js @@ -1 +1 @@ -define([],function(){"use strict";function onCachePutFail(e){console.log(e)}function updateCache(instance){var cache=instance.cache;cache&&cache.put("data",new Response(JSON.stringify(instance.localData))).catch(onCachePutFail)}function onCacheOpened(result){this.cache=result,this.localData={}}function MyStore(){try{self.caches&&caches.open("embydata").then(onCacheOpened.bind(this))}catch(err){console.log("Error opening cache: "+err)}}return MyStore.prototype.setItem=function(name,value){localStorage.setItem(name,value);var localData=this.localData;if(localData){var changed=localData[name]!==value;changed&&(localData[name]=value,updateCache(this))}},MyStore.prototype.getItem=function(name){return localStorage.getItem(name)},MyStore.prototype.removeItem=function(name){localStorage.removeItem(name);var localData=this.localData;localData&&(localData[name]=null,delete localData[name],updateCache(this))},new MyStore}); \ No newline at end of file +define([],function(){"use strict";function onCachePutFail(e){console.log(e)}function updateCache(instance){var cache=instance.cache;cache&&cache.put("data",new Response(JSON.stringify(instance.localData))).catch(onCachePutFail)}function onCacheOpened(result){this.cache=result,this.localData={}}function MyStore(){try{self.caches&&caches.open("embydata").then(onCacheOpened.bind(this))}catch(err){console.log("Error opening cache: "+err)}}return MyStore.prototype.setItem=function(name,value){localStorage.setItem(name,value);var localData=this.localData;if(localData){localData[name]!==value&&(localData[name]=value,updateCache(this))}},MyStore.prototype.getItem=function(name){return localStorage.getItem(name)},MyStore.prototype.removeItem=function(name){localStorage.removeItem(name);var localData=this.localData;localData&&(localData[name]=null,delete localData[name],updateCache(this))},new MyStore}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/connectionmanager.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/connectionmanager.js index 79940a7719..aec9375d78 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/connectionmanager.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/connectionmanager.js @@ -1 +1 @@ -define(["events","apiclient","appStorage"],function(events,apiClientFactory,appStorage){"use strict";function getServerAddress(server,mode){switch(mode){case ConnectionMode.Local:return server.LocalAddress;case ConnectionMode.Manual:return server.ManualAddress;case ConnectionMode.Remote:return server.RemoteAddress;default:return server.ManualAddress||server.LocalAddress||server.RemoteAddress}}function paramsToString(params){var values=[];for(var key in params){var value=params[key];null!==value&&void 0!==value&&""!==value&&values.push(encodeURIComponent(key)+"="+encodeURIComponent(value))}return values.join("&")}function resolveFailure(instance,resolve){resolve({State:"Unavailable",ConnectUser:instance.connectUser()})}function mergeServers(credentialProvider,list1,list2){for(var i=0,length=list2.length;ibVal)return 1}return 0}var defaultTimeout=2e4,ConnectionMode={Local:0,Remote:1,Manual:2},ConnectionManager=function(credentialProvider,appName,appVersion,deviceName,deviceId,capabilities,devicePixelRatio){function onConnectUserSignIn(user){appStorage.removeItem("lastLocalServerId"),connectUser=user,events.trigger(self,"connectusersignedin",[user])}function onAuthenticated(apiClient,result,options,saveCredentials){var credentials=credentialProvider.credentials(),servers=credentials.Servers.filter(function(s){return s.Id===result.ServerId}),server=servers.length?servers[0]:apiClient.serverInfo();return options.updateDateLastAccessed!==!1&&(server.DateLastAccessed=(new Date).getTime()),server.Id=result.ServerId,saveCredentials?(server.UserId=result.User.Id,server.AccessToken=result.AccessToken):(server.UserId=null,server.AccessToken=null),credentialProvider.addOrUpdateServer(credentials.Servers,server),credentialProvider.credentials(credentials),apiClient.serverInfo(server),afterConnected(apiClient,options),onLocalUserSignIn(server,server.LastConnectionMode,result.User)}function afterConnected(apiClient,options){options=options||{},options.reportCapabilities!==!1&&apiClient.reportCapabilities(capabilities),apiClient.enableAutomaticBitrateDetection=options.enableAutomaticBitrateDetection,options.enableWebSocket!==!1&&(console.log("calling apiClient.ensureWebSocket"),apiClient.ensureWebSocket())}function onLocalUserSignIn(server,connectionMode,user){self.connectUserId()?appStorage.removeItem("lastLocalServerId"):appStorage.setItem("lastLocalServerId",server.Id),self._getOrAddApiClient(server,connectionMode);var promise=self.onLocalUserSignedIn?self.onLocalUserSignedIn.call(self,user):Promise.resolve();return promise.then(function(){events.trigger(self,"localusersignedin",[user])})}function ensureConnectUser(credentials){return connectUser&&connectUser.Id===credentials.ConnectUserId?Promise.resolve():credentials.ConnectUserId&&credentials.ConnectAccessToken?(connectUser=null,getConnectUser(credentials.ConnectUserId,credentials.ConnectAccessToken).then(function(user){return onConnectUserSignIn(user),Promise.resolve()},function(){return Promise.resolve()})):Promise.resolve()}function getConnectUser(userId,accessToken){if(!userId)throw new Error("null userId");if(!accessToken)throw new Error("null accessToken");var url="https://connect.emby.media/service/user?id="+userId;return ajax({type:"GET",url:url,dataType:"json",headers:{"X-Application":appName+"/"+appVersion,"X-Connect-UserToken":accessToken}})}function addAuthenticationInfoFromConnect(server,connectionMode,credentials){if(!server.ExchangeToken)throw new Error("server.ExchangeToken cannot be null");if(!credentials.ConnectUserId)throw new Error("credentials.ConnectUserId cannot be null");var url=getServerAddress(server,connectionMode);url=getEmbyServerUrl(url,"Connect/Exchange?format=json&ConnectUserId="+credentials.ConnectUserId);var auth='MediaBrowser Client="'+appName+'", Device="'+deviceName+'", DeviceId="'+deviceId+'", Version="'+appVersion+'"';return ajax({type:"GET",url:url,dataType:"json",headers:{"X-MediaBrowser-Token":server.ExchangeToken,"X-Emby-Authorization":auth}}).then(function(auth){return server.UserId=auth.LocalUserId,server.AccessToken=auth.AccessToken,auth},function(){return server.UserId=null,server.AccessToken=null,Promise.reject()})}function validateAuthentication(server,connectionMode){var url=getServerAddress(server,connectionMode);return ajax({type:"GET",url:getEmbyServerUrl(url,"System/Info"),dataType:"json",headers:{"X-MediaBrowser-Token":server.AccessToken}}).then(function(systemInfo){return updateServerInfo(server,systemInfo),server.UserId?ajax({type:"GET",url:getEmbyServerUrl(url,"users/"+server.UserId),dataType:"json",headers:{"X-MediaBrowser-Token":server.AccessToken}}).then(function(user){return onLocalUserSignIn(server,connectionMode,user),Promise.resolve()},function(){return server.UserId=null,server.AccessToken=null,Promise.resolve()}):Promise.resolve()},function(){return server.UserId=null,server.AccessToken=null,Promise.resolve()})}function getImageUrl(localUser){if(connectUser&&connectUser.ImageUrl)return{url:connectUser.ImageUrl};if(localUser&&localUser.PrimaryImageTag){var apiClient=self.getApiClient(localUser),url=apiClient.getUserImageUrl(localUser.Id,{tag:localUser.PrimaryImageTag,type:"Primary"});return{url:url,supportsParams:!0}}return{url:null,supportsParams:!1}}function logoutOfServer(apiClient){var serverInfo=apiClient.serverInfo()||{},logoutInfo={serverId:serverInfo.Id};return apiClient.logout().then(function(){events.trigger(self,"localusersignedout",[logoutInfo])},function(){events.trigger(self,"localusersignedout",[logoutInfo])})}function getConnectServers(credentials){if(console.log("Begin getConnectServers"),!credentials.ConnectAccessToken||!credentials.ConnectUserId)return Promise.resolve([]);var url="https://connect.emby.media/service/servers?userId="+credentials.ConnectUserId;return ajax({type:"GET",url:url,dataType:"json",headers:{"X-Application":appName+"/"+appVersion,"X-Connect-UserToken":credentials.ConnectAccessToken}}).then(function(servers){return servers.map(function(i){return{ExchangeToken:i.AccessKey,ConnectServerId:i.Id,Id:i.SystemId,Name:i.Name,RemoteAddress:i.Url,LocalAddress:i.LocalAddress,UserLinkType:"guest"===(i.UserType||"").toLowerCase()?"Guest":"LinkedUser"}})},function(){return credentials.Servers.slice(0).filter(function(s){return s.ExchangeToken})})}function filterServers(servers,connectServers){return servers.filter(function(server){return!server.ExchangeToken||connectServers.filter(function(connectServer){return server.Id===connectServer.Id}).length>0})}function findServers(){return new Promise(function(resolve,reject){var onFinish=function(foundServers){var servers=foundServers.map(function(foundServer){var info={Id:foundServer.Id,LocalAddress:convertEndpointAddressToManualAddress(foundServer)||foundServer.Address,Name:foundServer.Name};return info.LastConnectionMode=info.ManualAddress?ConnectionMode.Manual:ConnectionMode.Local,info});resolve(servers)};require(["serverdiscovery"],function(serverDiscovery){serverDiscovery.findServers(1e3).then(onFinish,function(){onFinish([])})})})}function convertEndpointAddressToManualAddress(info){if(info.Address&&info.EndpointAddress){var address=info.EndpointAddress.split(":")[0],parts=info.Address.split(":");if(parts.length>1){var portString=parts[parts.length-1];isNaN(parseInt(portString))||(address+=":"+portString)}return normalizeAddress(address)}return null}function testNextConnectionMode(tests,index,server,options,resolve){if(index>=tests.length)return console.log("Tested all connection modes. Failing server connection."),void resolveFailure(self,resolve);var mode=tests[index],address=getServerAddress(server,mode),enableRetry=!1,skipTest=!1,timeout=defaultTimeout;return mode===ConnectionMode.Local?(enableRetry=!0,timeout=8e3,stringEqualsIgnoreCase(address,server.ManualAddress)&&(console.log("skipping LocalAddress test because it is the same as ManualAddress"),skipTest=!0)):mode===ConnectionMode.Manual&&stringEqualsIgnoreCase(address,server.LocalAddress)&&(enableRetry=!0,timeout=8e3),skipTest||!address?(console.log("skipping test at index "+index),void testNextConnectionMode(tests,index+1,server,options,resolve)):(console.log("testing connection mode "+mode+" with server "+server.Name),void tryConnect(address,timeout).then(function(result){1===compareVersions(self.minServerVersion(),result.Version)?(console.log("minServerVersion requirement not met. Server version: "+result.Version),resolve({State:"ServerUpdateNeeded",Servers:[server]})):server.Id&&result.Id!==server.Id?(console.log("http request succeeded, but found a different server Id than what was expected"),resolveFailure(self,resolve)):(console.log("calling onSuccessfulConnection with connection mode "+mode+" with server "+server.Name),onSuccessfulConnection(server,result,mode,options,resolve))},function(){console.log("test failed for connection mode "+mode+" with server "+server.Name),enableRetry?testNextConnectionMode(tests,index+1,server,options,resolve):testNextConnectionMode(tests,index+1,server,options,resolve)}))}function onSuccessfulConnection(server,systemInfo,connectionMode,options,resolve){var credentials=credentialProvider.credentials();options=options||{},credentials.ConnectAccessToken&&options.enableAutoLogin!==!1?ensureConnectUser(credentials).then(function(){server.ExchangeToken?addAuthenticationInfoFromConnect(server,connectionMode,credentials).then(function(){afterConnectValidated(server,credentials,systemInfo,connectionMode,!0,options,resolve)},function(){afterConnectValidated(server,credentials,systemInfo,connectionMode,!0,options,resolve)}):afterConnectValidated(server,credentials,systemInfo,connectionMode,!0,options,resolve)}):afterConnectValidated(server,credentials,systemInfo,connectionMode,!0,options,resolve)}function afterConnectValidated(server,credentials,systemInfo,connectionMode,verifyLocalAuthentication,options,resolve){if(options=options||{},options.enableAutoLogin===!1)server.UserId=null,server.AccessToken=null;else if(verifyLocalAuthentication&&server.AccessToken&&options.enableAutoLogin!==!1)return void validateAuthentication(server,connectionMode).then(function(){afterConnectValidated(server,credentials,systemInfo,connectionMode,!1,options,resolve)});updateServerInfo(server,systemInfo),server.LastConnectionMode=connectionMode,options.updateDateLastAccessed!==!1&&(server.DateLastAccessed=(new Date).getTime()),credentialProvider.addOrUpdateServer(credentials.Servers,server),credentialProvider.credentials(credentials);var result={Servers:[]};result.ApiClient=self._getOrAddApiClient(server,connectionMode),result.ApiClient.setSystemInfo(systemInfo),result.State=server.AccessToken&&options.enableAutoLogin!==!1?"SignedIn":"ServerSignIn",result.Servers.push(server),result.ApiClient.updateServerInfo(server,connectionMode),"SignedIn"===result.State&&afterConnected(result.ApiClient,options),resolve(result),events.trigger(self,"connected",[result])}function getCacheKey(feature,apiClient,options){options=options||{};var viewOnly=options.viewOnly,cacheKey="regInfo-"+apiClient.serverId();return viewOnly&&(cacheKey+="-viewonly"),cacheKey}function addAppInfoToConnectRequest(request){request.headers=request.headers||{},request.headers["X-Application"]=appName+"/"+appVersion}function exchangePin(pinInfo){if(!pinInfo)throw new Error("pinInfo cannot be null");var request={type:"POST",url:getConnectUrl("pin/authenticate"),data:{deviceId:pinInfo.DeviceId,pin:pinInfo.Pin},dataType:"json"};return addAppInfoToConnectRequest(request),ajax(request)}console.log("Begin ConnectionManager constructor");var self=this;this._apiClients=[];var connectUser;self.connectUser=function(){return connectUser},self._minServerVersion="3.2.33",self.appVersion=function(){return appVersion},self.appName=function(){return appName},self.capabilities=function(){return capabilities},self.deviceId=function(){return deviceId},self.credentialProvider=function(){return credentialProvider},self.connectUserId=function(){return credentialProvider.credentials().ConnectUserId},self.connectToken=function(){return credentialProvider.credentials().ConnectAccessToken},self.getServerInfo=function(id){var servers=credentialProvider.credentials().Servers;return servers.filter(function(s){return s.Id===id})[0]},self.getLastUsedServer=function(){var servers=credentialProvider.credentials().Servers;return servers.sort(function(a,b){return(b.DateLastAccessed||0)-(a.DateLastAccessed||0)}),servers.length?servers[0]:null},self.getLastUsedApiClient=function(){var servers=credentialProvider.credentials().Servers;if(servers.sort(function(a,b){return(b.DateLastAccessed||0)-(a.DateLastAccessed||0)}),!servers.length)return null;var server=servers[0];return self._getOrAddApiClient(server,server.LastConnectionMode)},self.addApiClient=function(apiClient){self._apiClients.push(apiClient);var existingServers=credentialProvider.credentials().Servers.filter(function(s){return stringEqualsIgnoreCase(s.ManualAddress,apiClient.serverAddress())||stringEqualsIgnoreCase(s.LocalAddress,apiClient.serverAddress())||stringEqualsIgnoreCase(s.RemoteAddress,apiClient.serverAddress())}),existingServer=existingServers.length?existingServers[0]:apiClient.serverInfo();if(existingServer.DateLastAccessed=(new Date).getTime(),existingServer.LastConnectionMode=ConnectionMode.Manual,existingServer.ManualAddress=apiClient.serverAddress(),apiClient.serverInfo(existingServer),apiClient.onAuthenticated=function(instance,result){return onAuthenticated(instance,result,{},!0)},!existingServers.length){var credentials=credentialProvider.credentials();credentials.Servers=[existingServer],credentialProvider.credentials(credentials)}events.trigger(self,"apiclientcreated",[apiClient])},self.clearData=function(){console.log("connection manager clearing data"),connectUser=null;var credentials=credentialProvider.credentials();credentials.ConnectAccessToken=null,credentials.ConnectUserId=null,credentials.Servers=[],credentialProvider.credentials(credentials)},self._getOrAddApiClient=function(server,connectionMode){var apiClient=self.getApiClient(server.Id);if(!apiClient){var url=getServerAddress(server,connectionMode);apiClient=new apiClientFactory(url,appName,appVersion,deviceName,deviceId,devicePixelRatio),self._apiClients.push(apiClient),apiClient.serverInfo(server),apiClient.onAuthenticated=function(instance,result){return onAuthenticated(instance,result,{},!0)},events.trigger(self,"apiclientcreated",[apiClient])}return console.log("returning instance from getOrAddApiClient"),apiClient},self.getOrCreateApiClient=function(serverId){var credentials=credentialProvider.credentials(),servers=credentials.Servers.filter(function(s){return stringEqualsIgnoreCase(s.Id,serverId)});if(!servers.length)throw new Error("Server not found: "+serverId);var server=servers[0];return self._getOrAddApiClient(server,server.LastConnectionMode)},self.user=function(apiClient){return new Promise(function(resolve,reject){function onLocalUserDone(e){var image=getImageUrl(localUser);resolve({localUser:localUser,name:connectUser?connectUser.Name:localUser?localUser.Name:null,imageUrl:image.url,supportsImageParams:image.supportsParams,connectUser:connectUser})}function onEnsureConnectUserDone(){apiClient&&apiClient.getCurrentUserId()?apiClient.getCurrentUser().then(function(u){localUser=u,onLocalUserDone()},onLocalUserDone):onLocalUserDone()}var localUser,credentials=credentialProvider.credentials();!credentials.ConnectUserId||!credentials.ConnectAccessToken||apiClient&&apiClient.getCurrentUserId()?onEnsureConnectUserDone():ensureConnectUser(credentials).then(onEnsureConnectUserDone,onEnsureConnectUserDone)})},self.logout=function(){console.log("begin connectionManager loguot");for(var promises=[],i=0,length=self._apiClients.length;ibVal)return 1}return 0}var defaultTimeout=2e4,ConnectionMode={Local:0,Remote:1,Manual:2},ConnectionManager=function(credentialProvider,appName,appVersion,deviceName,deviceId,capabilities,devicePixelRatio){function onConnectUserSignIn(user){appStorage.removeItem("lastLocalServerId"),connectUser=user,events.trigger(self,"connectusersignedin",[user])}function onAuthenticated(apiClient,result,options,saveCredentials){var credentials=credentialProvider.credentials(),servers=credentials.Servers.filter(function(s){return s.Id===result.ServerId}),server=servers.length?servers[0]:apiClient.serverInfo();return!1!==options.updateDateLastAccessed&&(server.DateLastAccessed=(new Date).getTime()),server.Id=result.ServerId,saveCredentials?(server.UserId=result.User.Id,server.AccessToken=result.AccessToken):(server.UserId=null,server.AccessToken=null),credentialProvider.addOrUpdateServer(credentials.Servers,server),credentialProvider.credentials(credentials),apiClient.enableAutomaticBitrateDetection=options.enableAutomaticBitrateDetection,apiClient.serverInfo(server),afterConnected(apiClient,options),onLocalUserSignIn(server,server.LastConnectionMode,result.User)}function afterConnected(apiClient,options){options=options||{},!1!==options.reportCapabilities&&apiClient.reportCapabilities(capabilities),apiClient.enableAutomaticBitrateDetection=options.enableAutomaticBitrateDetection,!1!==options.enableWebSocket&&(console.log("calling apiClient.ensureWebSocket"),apiClient.ensureWebSocket())}function onLocalUserSignIn(server,connectionMode,user){return self.connectUserId()?appStorage.removeItem("lastLocalServerId"):appStorage.setItem("lastLocalServerId",server.Id),self._getOrAddApiClient(server,connectionMode),(self.onLocalUserSignedIn?self.onLocalUserSignedIn.call(self,user):Promise.resolve()).then(function(){events.trigger(self,"localusersignedin",[user])})}function ensureConnectUser(credentials){return connectUser&&connectUser.Id===credentials.ConnectUserId?Promise.resolve():credentials.ConnectUserId&&credentials.ConnectAccessToken?(connectUser=null,getConnectUser(credentials.ConnectUserId,credentials.ConnectAccessToken).then(function(user){return onConnectUserSignIn(user),Promise.resolve()},function(){return Promise.resolve()})):Promise.resolve()}function getConnectUser(userId,accessToken){if(!userId)throw new Error("null userId");if(!accessToken)throw new Error("null accessToken");return ajax({type:"GET",url:"https://connect.emby.media/service/user?id="+userId,dataType:"json",headers:{"X-Application":appName+"/"+appVersion,"X-Connect-UserToken":accessToken}})}function addAuthenticationInfoFromConnect(server,connectionMode,credentials){if(!server.ExchangeToken)throw new Error("server.ExchangeToken cannot be null");if(!credentials.ConnectUserId)throw new Error("credentials.ConnectUserId cannot be null");var url=getServerAddress(server,connectionMode);url=getEmbyServerUrl(url,"Connect/Exchange?format=json&ConnectUserId="+credentials.ConnectUserId);var auth='MediaBrowser Client="'+appName+'", Device="'+deviceName+'", DeviceId="'+deviceId+'", Version="'+appVersion+'"';return ajax({type:"GET",url:url,dataType:"json",headers:{"X-MediaBrowser-Token":server.ExchangeToken,"X-Emby-Authorization":auth}}).then(function(auth){return server.UserId=auth.LocalUserId,server.AccessToken=auth.AccessToken,auth},function(){return server.UserId=null,server.AccessToken=null,Promise.reject()})}function validateAuthentication(server,connectionMode){var url=getServerAddress(server,connectionMode);return ajax({type:"GET",url:getEmbyServerUrl(url,"System/Info"),dataType:"json",headers:{"X-MediaBrowser-Token":server.AccessToken}}).then(function(systemInfo){return updateServerInfo(server,systemInfo),server.UserId?ajax({type:"GET",url:getEmbyServerUrl(url,"users/"+server.UserId),dataType:"json",headers:{"X-MediaBrowser-Token":server.AccessToken}}).then(function(user){return onLocalUserSignIn(server,connectionMode,user),Promise.resolve()},function(){return server.UserId=null,server.AccessToken=null,Promise.resolve()}):Promise.resolve()},function(){return server.UserId=null,server.AccessToken=null,Promise.resolve()})}function getImageUrl(localUser){if(connectUser&&connectUser.ImageUrl)return{url:connectUser.ImageUrl};if(localUser&&localUser.PrimaryImageTag){return{url:self.getApiClient(localUser).getUserImageUrl(localUser.Id,{tag:localUser.PrimaryImageTag,type:"Primary"}),supportsParams:!0}}return{url:null,supportsParams:!1}}function logoutOfServer(apiClient){var serverInfo=apiClient.serverInfo()||{},logoutInfo={serverId:serverInfo.Id};return apiClient.logout().then(function(){events.trigger(self,"localusersignedout",[logoutInfo])},function(){events.trigger(self,"localusersignedout",[logoutInfo])})}function getConnectServers(credentials){return console.log("Begin getConnectServers"),credentials.ConnectAccessToken&&credentials.ConnectUserId?ajax({type:"GET",url:"https://connect.emby.media/service/servers?userId="+credentials.ConnectUserId,dataType:"json",headers:{"X-Application":appName+"/"+appVersion,"X-Connect-UserToken":credentials.ConnectAccessToken}}).then(function(servers){return servers.map(function(i){return{ExchangeToken:i.AccessKey,ConnectServerId:i.Id,Id:i.SystemId,Name:i.Name,RemoteAddress:i.Url,LocalAddress:i.LocalAddress,UserLinkType:"guest"===(i.UserType||"").toLowerCase()?"Guest":"LinkedUser"}})},function(){return credentials.Servers.slice(0).filter(function(s){return s.ExchangeToken})}):Promise.resolve([])}function filterServers(servers,connectServers){return servers.filter(function(server){return!server.ExchangeToken||connectServers.filter(function(connectServer){return server.Id===connectServer.Id}).length>0})}function findServers(){return new Promise(function(resolve,reject){var onFinish=function(foundServers){var servers=foundServers.map(function(foundServer){var info={Id:foundServer.Id,LocalAddress:convertEndpointAddressToManualAddress(foundServer)||foundServer.Address,Name:foundServer.Name};return info.LastConnectionMode=info.ManualAddress?ConnectionMode.Manual:ConnectionMode.Local,info});resolve(servers)};require(["serverdiscovery"],function(serverDiscovery){serverDiscovery.findServers(1e3).then(onFinish,function(){onFinish([])})})})}function convertEndpointAddressToManualAddress(info){if(info.Address&&info.EndpointAddress){var address=info.EndpointAddress.split(":")[0],parts=info.Address.split(":");if(parts.length>1){var portString=parts[parts.length-1];isNaN(parseInt(portString))||(address+=":"+portString)}return normalizeAddress(address)}return null}function testNextConnectionMode(tests,index,server,options,resolve){if(index>=tests.length)return console.log("Tested all connection modes. Failing server connection."),void resolveFailure(self,resolve);var mode=tests[index],address=getServerAddress(server,mode),skipTest=!1,timeout=defaultTimeout;if(mode===ConnectionMode.Local?(!0,timeout=8e3,stringEqualsIgnoreCase(address,server.ManualAddress)&&(console.log("skipping LocalAddress test because it is the same as ManualAddress"),skipTest=!0)):mode===ConnectionMode.Manual&&stringEqualsIgnoreCase(address,server.LocalAddress)&&(!0,timeout=8e3),skipTest||!address)return console.log("skipping test at index "+index),void testNextConnectionMode(tests,index+1,server,options,resolve);console.log("testing connection mode "+mode+" with server "+server.Name),tryConnect(address,timeout).then(function(result){1===compareVersions(self.minServerVersion(),result.Version)?(console.log("minServerVersion requirement not met. Server version: "+result.Version),resolve({State:"ServerUpdateNeeded",Servers:[server]})):server.Id&&result.Id!==server.Id?(console.log("http request succeeded, but found a different server Id than what was expected"),resolveFailure(self,resolve)):(console.log("calling onSuccessfulConnection with connection mode "+mode+" with server "+server.Name),onSuccessfulConnection(server,result,mode,options,resolve))},function(){console.log("test failed for connection mode "+mode+" with server "+server.Name),testNextConnectionMode(tests,index+1,server,options,resolve)})}function onSuccessfulConnection(server,systemInfo,connectionMode,options,resolve){var credentials=credentialProvider.credentials();options=options||{},credentials.ConnectAccessToken&&!1!==options.enableAutoLogin?ensureConnectUser(credentials).then(function(){server.ExchangeToken?addAuthenticationInfoFromConnect(server,connectionMode,credentials).then(function(){afterConnectValidated(server,credentials,systemInfo,connectionMode,!0,options,resolve)},function(){afterConnectValidated(server,credentials,systemInfo,connectionMode,!0,options,resolve)}):afterConnectValidated(server,credentials,systemInfo,connectionMode,!0,options,resolve)}):afterConnectValidated(server,credentials,systemInfo,connectionMode,!0,options,resolve)}function afterConnectValidated(server,credentials,systemInfo,connectionMode,verifyLocalAuthentication,options,resolve){if(options=options||{},!1===options.enableAutoLogin)server.UserId=null,server.AccessToken=null;else if(verifyLocalAuthentication&&server.AccessToken&&!1!==options.enableAutoLogin)return void validateAuthentication(server,connectionMode).then(function(){afterConnectValidated(server,credentials,systemInfo,connectionMode,!1,options,resolve)});updateServerInfo(server,systemInfo),server.LastConnectionMode=connectionMode,!1!==options.updateDateLastAccessed&&(server.DateLastAccessed=(new Date).getTime()),credentialProvider.addOrUpdateServer(credentials.Servers,server),credentialProvider.credentials(credentials);var result={Servers:[]};result.ApiClient=self._getOrAddApiClient(server,connectionMode),result.ApiClient.setSystemInfo(systemInfo),result.State=server.AccessToken&&!1!==options.enableAutoLogin?"SignedIn":"ServerSignIn",result.Servers.push(server),result.ApiClient.enableAutomaticBitrateDetection=options.enableAutomaticBitrateDetection,result.ApiClient.updateServerInfo(server,connectionMode),"SignedIn"===result.State&&afterConnected(result.ApiClient,options),resolve(result),events.trigger(self,"connected",[result])}function getCacheKey(feature,apiClient,options){options=options||{};var viewOnly=options.viewOnly,cacheKey="regInfo-"+apiClient.serverId();return viewOnly&&(cacheKey+="-viewonly"),cacheKey}function addAppInfoToConnectRequest(request){request.headers=request.headers||{},request.headers["X-Application"]=appName+"/"+appVersion}function exchangePin(pinInfo){if(!pinInfo)throw new Error("pinInfo cannot be null");var request={type:"POST",url:getConnectUrl("pin/authenticate"),data:{deviceId:pinInfo.DeviceId,pin:pinInfo.Pin},dataType:"json"};return addAppInfoToConnectRequest(request),ajax(request)}console.log("Begin ConnectionManager constructor");var self=this;this._apiClients=[];var connectUser;self.connectUser=function(){return connectUser},self._minServerVersion="3.2.33",self.appVersion=function(){return appVersion},self.appName=function(){return appName},self.capabilities=function(){return capabilities},self.deviceId=function(){return deviceId},self.credentialProvider=function(){return credentialProvider},self.connectUserId=function(){return credentialProvider.credentials().ConnectUserId},self.connectToken=function(){return credentialProvider.credentials().ConnectAccessToken},self.getServerInfo=function(id){return credentialProvider.credentials().Servers.filter(function(s){return s.Id===id})[0]},self.getLastUsedServer=function(){var servers=credentialProvider.credentials().Servers;return servers.sort(function(a,b){return(b.DateLastAccessed||0)-(a.DateLastAccessed||0)}),servers.length?servers[0]:null},self.getLastUsedApiClient=function(){var servers=credentialProvider.credentials().Servers;if(servers.sort(function(a,b){return(b.DateLastAccessed||0)-(a.DateLastAccessed||0)}),!servers.length)return null;var server=servers[0];return self._getOrAddApiClient(server,server.LastConnectionMode)},self.addApiClient=function(apiClient){self._apiClients.push(apiClient);var existingServers=credentialProvider.credentials().Servers.filter(function(s){return stringEqualsIgnoreCase(s.ManualAddress,apiClient.serverAddress())||stringEqualsIgnoreCase(s.LocalAddress,apiClient.serverAddress())||stringEqualsIgnoreCase(s.RemoteAddress,apiClient.serverAddress())}),existingServer=existingServers.length?existingServers[0]:apiClient.serverInfo();if(existingServer.DateLastAccessed=(new Date).getTime(),existingServer.LastConnectionMode=ConnectionMode.Manual,existingServer.ManualAddress=apiClient.serverAddress(),apiClient.serverInfo(existingServer),apiClient.onAuthenticated=function(instance,result){return onAuthenticated(instance,result,{},!0)},!existingServers.length){var credentials=credentialProvider.credentials();credentials.Servers=[existingServer],credentialProvider.credentials(credentials)}events.trigger(self,"apiclientcreated",[apiClient])},self.clearData=function(){console.log("connection manager clearing data"),connectUser=null;var credentials=credentialProvider.credentials();credentials.ConnectAccessToken=null,credentials.ConnectUserId=null,credentials.Servers=[],credentialProvider.credentials(credentials)},self._getOrAddApiClient=function(server,connectionMode){var apiClient=self.getApiClient(server.Id);if(!apiClient){var url=getServerAddress(server,connectionMode);apiClient=new apiClientFactory(url,appName,appVersion,deviceName,deviceId,devicePixelRatio),self._apiClients.push(apiClient),apiClient.serverInfo(server),apiClient.onAuthenticated=function(instance,result){return onAuthenticated(instance,result,{},!0)},events.trigger(self,"apiclientcreated",[apiClient])}return console.log("returning instance from getOrAddApiClient"),apiClient},self.getOrCreateApiClient=function(serverId){var credentials=credentialProvider.credentials(),servers=credentials.Servers.filter(function(s){return stringEqualsIgnoreCase(s.Id,serverId)});if(!servers.length)throw new Error("Server not found: "+serverId);var server=servers[0];return self._getOrAddApiClient(server,server.LastConnectionMode)},self.user=function(apiClient){return new Promise(function(resolve,reject){function onLocalUserDone(e){var image=getImageUrl(localUser);resolve({localUser:localUser,name:connectUser?connectUser.Name:localUser?localUser.Name:null,imageUrl:image.url,supportsImageParams:image.supportsParams,connectUser:connectUser})}function onEnsureConnectUserDone(){apiClient&&apiClient.getCurrentUserId()?apiClient.getCurrentUser().then(function(u){localUser=u,onLocalUserDone()},onLocalUserDone):onLocalUserDone()}var localUser,credentials=credentialProvider.credentials();!credentials.ConnectUserId||!credentials.ConnectAccessToken||apiClient&&apiClient.getCurrentUserId()?onEnsureConnectUserDone():ensureConnectUser(credentials).then(onEnsureConnectUserDone,onEnsureConnectUserDone)})},self.logout=function(){console.log("begin connectionManager loguot");for(var promises=[],i=0,length=self._apiClients.length;i-1&&(item={Name:"Music",ServerId:serverId,Id:"localview:MusicView",Type:"MusicView",CollectionType:"music",IsFolder:!0},list.push(item)),types.indexOf("Photo")>-1&&(item={Name:"Photos",ServerId:serverId,Id:"localview:PhotosView",Type:"PhotosView",CollectionType:"photos",IsFolder:!0},list.push(item)),types.indexOf("Episode")>-1&&(item={Name:"TV",ServerId:serverId,Id:"localview:TVView",Type:"TVView",CollectionType:"tvshows",IsFolder:!0},list.push(item)),types.indexOf("Movie")>-1&&(item={Name:"Movies",ServerId:serverId,Id:"localview:MoviesView",Type:"MoviesView",CollectionType:"movies",IsFolder:!0},list.push(item)),types.indexOf("Video")>-1&&(item={Name:"Videos",ServerId:serverId,Id:"localview:VideosView",Type:"VideosView",CollectionType:"videos",IsFolder:!0},list.push(item)),types.indexOf("MusicVideo")>-1&&(item={Name:"Music Videos",ServerId:serverId,Id:"localview:MusicVideosView",Type:"MusicVideosView",CollectionType:"videos",IsFolder:!0},list.push(item)),Promise.resolve(list)})}function getTypeFilterForTopLevelView(parentId){var typeFilter=null;switch(parentId){case"localview:MusicView":typeFilter="MusicAlbum";break;case"localview:PhotosView":typeFilter="PhotoAlbum";break;case"localview:TVView":typeFilter="Series";break;case"localview:VideosView":typeFilter="Video";break;case"localview:MoviesView":typeFilter="Movie";break;case"localview:MusicVideosView":typeFilter="MusicVideo"}return typeFilter}function normalizeId(id){return id?(id=stripStart(id,"localview:"),id=stripStart(id,"local:")):null}function getViewItems(serverId,userId,options){var parentId=options.ParentId,typeFilter=getTypeFilterForTopLevelView(parentId);parentId=normalizeId(parentId);var seasonId=normalizeId(options.SeasonId||options.seasonId),seriesId=normalizeId(options.SeriesId||options.seriesId),includeItemTypes=options.IncludeItemTypes?options.IncludeItemTypes.split(","):[];return typeFilter&&(parentId=null,includeItemTypes.push(typeFilter)),getServerItems(serverId).then(function(items){var resultItems=items.filter(function(item){if(item.SyncStatus&&"synced"!==item.SyncStatus)return!1;if(options.MediaType&&item.Item.MediaType!==options.MediaType)return!1;if(seriesId&&item.Item.SeriesId!==seriesId)return!1;if(seasonId&&item.Item.SeasonId!==seasonId)return!1;if("IsNotFolder"===options.Filters&&item.Item.IsFolder)return!1;if("IsFolder"===options.Filters&&!item.Item.IsFolder)return!1;if(includeItemTypes.length&&includeItemTypes.indexOf(item.Item.Type||"")===-1)return!1;if(options.Recursive);else if(parentId&&item.Item.ParentId!==parentId)return!1;return!0}).map(function(item2){return item2.Item});return"DateCreated"===options.SortBy&&resultItems.sort(function(a,b){return compareDates(a.DateCreated,b.DateCreated)}),options.Limit&&(resultItems=resultItems.slice(0,options.Limit)),Promise.resolve(resultItems)})}function removeObsoleteContainerItems(serverId){return getServerItems(serverId).then(function(items){var seriesItems=items.filter(function(item){var type=(item.Item.Type||"").toLowerCase();return"series"===type}),seasonItems=items.filter(function(item){var type=(item.Item.Type||"").toLowerCase();return"season"===type}),albumItems=items.filter(function(item){var type=(item.Item.Type||"").toLowerCase();return"musicalbum"===type||"photoalbum"===type}),requiredSeriesIds=items.filter(function(item){var type=(item.Item.Type||"").toLowerCase();return"episode"===type}).map(function(item2){return item2.Item.SeriesId}).filter(filterDistinct),requiredSeasonIds=items.filter(function(item){var type=(item.Item.Type||"").toLowerCase();return"episode"===type}).map(function(item2){return item2.Item.SeasonId}).filter(filterDistinct),requiredAlbumIds=items.filter(function(item){var type=(item.Item.Type||"").toLowerCase();return"audio"===type||"photo"===type}).map(function(item2){return item2.Item.AlbumId}).filter(filterDistinct),obsoleteItems=[];seriesItems.forEach(function(item){requiredSeriesIds.indexOf(item.Item.Id)<0&&obsoleteItems.push(item)}),seasonItems.forEach(function(item){requiredSeasonIds.indexOf(item.Item.Id)<0&&obsoleteItems.push(item)}),albumItems.forEach(function(item){requiredAlbumIds.indexOf(item.Item.Id)<0&&obsoleteItems.push(item)});var p=Promise.resolve();return obsoleteItems.forEach(function(item){p=p.then(function(){return itemrepository.remove(item.ServerId,item.Id)})}),p})}function removeLocalItem(localItem){return itemrepository.get(localItem.ServerId,localItem.Id).then(function(item){return filerepository.deleteFile(item.LocalPath).then(function(){var p=Promise.resolve(!0);return item.AdditionalFiles&&item.AdditionalFiles.forEach(function(file){p=p.then(function(){return filerepository.deleteFile(file.Path)})}),p.then(function(file){return itemrepository.remove(localItem.ServerId,localItem.Id)})},function(error){var p=Promise.resolve(!0);return item.AdditionalFiles&&item.AdditionalFiles.forEach(function(file){p=p.then(function(item){return filerepository.deleteFile(file.Path)})}),p.then(function(file){return itemrepository.remove(localItem.ServerId,localItem.Id)})})})}function addOrUpdateLocalItem(localItem){return itemrepository.set(localItem.ServerId,localItem.Id,localItem)}function createLocalItem(libraryItem,serverInfo,jobItem){console.log("[lcoalassetmanager] Begin createLocalItem");var localPath,path=getDirectoryPath(libraryItem,serverInfo),localFolder=filerepository.getFullLocalPath(path);if(jobItem&&(path.push(getLocalFileName(libraryItem,jobItem.OriginalFileName)),localPath=filerepository.getFullLocalPath(path)),libraryItem.MediaSources)for(var i=0;i0&&(fileName=fileName.substring(0,pos)),fileName}function downloadFile(url,localItem){var imageUrl=getImageUrl(localItem.Item.ServerId,localItem.Item.Id,{type:"Primary",index:0});return transfermanager.downloadFile(url,localItem,imageUrl)}function downloadSubtitles(url,fileName){return transfermanager.downloadSubtitles(url,fileName)}function getImageUrl(serverId,itemId,imageOptions){var imageType=imageOptions.type,index=imageOptions.index,pathArray=getImagePath(serverId,itemId,imageType,index);return filerepository.getImageUrl(pathArray)}function hasImage(serverId,itemId,imageType,index){var pathArray=getImagePath(serverId,itemId,imageType,index),localFilePath=filerepository.getFullMetadataPath(pathArray);return filerepository.fileExists(localFilePath).then(function(exists){return Promise.resolve(exists)},function(err){return Promise.resolve(!1)})}function fileExists(localFilePath){return filerepository.fileExists(localFilePath)}function downloadImage(localItem,url,serverId,itemId,imageType,index){var pathArray=getImagePath(serverId,itemId,imageType,index),localFilePath=filerepository.getFullMetadataPath(pathArray);localItem.AdditionalFiles||(localItem.AdditionalFiles=[]);var fileInfo={Path:localFilePath,Type:"Image",Name:imageType+index.toString(),ImageType:imageType};return localItem.AdditionalFiles.push(fileInfo),transfermanager.downloadImage(url,localFilePath)}function isDownloadFileInQueue(path){return transfermanager.isDownloadFileInQueue(path)}function getDownloadItemCount(){return transfermanager.getDownloadItemCount()}function getDirectoryPath(item,server){var parts=[];parts.push(server.Name);var itemtype=item.Type.toLowerCase();if("episode"===itemtype){parts.push("TV");var seriesName=item.SeriesName;seriesName&&parts.push(seriesName);var seasonName=item.SeasonName;seasonName&&parts.push(seasonName)}else if("video"===itemtype)parts.push("Videos"),parts.push(item.Name);else if("audio"===itemtype){parts.push("Music");var albumArtist=item.AlbumArtist;albumArtist&&parts.push(albumArtist),item.AlbumId&&item.Album&&parts.push(item.Album)}else"photo"===itemtype&&(parts.push("Photos"),item.AlbumId&&item.Album&&parts.push(item.Album));for(var finalParts=[],i=0;ifind.length&&0===str.indexOf(find))}function stripStart(str,find){return startsWith(str,find)?str.substr(find.length):str}function filterDistinct(value,index,self){return self.indexOf(value)===index}function compareDates(a,b){return isFinite(a=a.valueOf())&&isFinite(b=b.valueOf())?(a>b)-(a-1&&(item={Name:"Music",ServerId:serverId,Id:"localview:MusicView",Type:"MusicView",CollectionType:"music",IsFolder:!0},list.push(item)),types.indexOf("Photo")>-1&&(item={Name:"Photos",ServerId:serverId,Id:"localview:PhotosView",Type:"PhotosView",CollectionType:"photos",IsFolder:!0},list.push(item)),types.indexOf("Episode")>-1&&(item={Name:"TV",ServerId:serverId,Id:"localview:TVView",Type:"TVView",CollectionType:"tvshows",IsFolder:!0},list.push(item)),types.indexOf("Movie")>-1&&(item={Name:"Movies",ServerId:serverId,Id:"localview:MoviesView",Type:"MoviesView",CollectionType:"movies",IsFolder:!0},list.push(item)),types.indexOf("Video")>-1&&(item={Name:"Videos",ServerId:serverId,Id:"localview:VideosView",Type:"VideosView",CollectionType:"videos",IsFolder:!0},list.push(item)),types.indexOf("MusicVideo")>-1&&(item={Name:"Music Videos",ServerId:serverId,Id:"localview:MusicVideosView",Type:"MusicVideosView",CollectionType:"videos",IsFolder:!0},list.push(item)),Promise.resolve(list)})}function getTypeFilterForTopLevelView(parentId){var typeFilter=null;switch(parentId){case"localview:MusicView":typeFilter="MusicAlbum";break;case"localview:PhotosView":typeFilter="PhotoAlbum";break;case"localview:TVView":typeFilter="Series";break;case"localview:VideosView":typeFilter="Video";break;case"localview:MoviesView":typeFilter="Movie";break;case"localview:MusicVideosView":typeFilter="MusicVideo"}return typeFilter}function normalizeId(id){return id?(id=stripStart(id,"localview:"),id=stripStart(id,"local:")):null}function getViewItems(serverId,userId,options){var parentId=options.ParentId,typeFilter=getTypeFilterForTopLevelView(parentId);parentId=normalizeId(parentId);var seasonId=normalizeId(options.SeasonId||options.seasonId),seriesId=normalizeId(options.SeriesId||options.seriesId),includeItemTypes=options.IncludeItemTypes?options.IncludeItemTypes.split(","):[];return typeFilter&&(parentId=null,includeItemTypes.push(typeFilter)),getServerItems(serverId).then(function(items){var resultItems=items.filter(function(item){if(item.SyncStatus&&"synced"!==item.SyncStatus)return!1;if(options.MediaType&&item.Item.MediaType!==options.MediaType)return!1;if(seriesId&&item.Item.SeriesId!==seriesId)return!1;if(seasonId&&item.Item.SeasonId!==seasonId)return!1;if("IsNotFolder"===options.Filters&&item.Item.IsFolder)return!1;if("IsFolder"===options.Filters&&!item.Item.IsFolder)return!1;if(includeItemTypes.length&&-1===includeItemTypes.indexOf(item.Item.Type||""))return!1;if(options.Recursive);else if(parentId&&item.Item.ParentId!==parentId)return!1;return!0}).map(function(item2){return item2.Item});return"DateCreated"===options.SortBy&&resultItems.sort(function(a,b){return compareDates(a.DateCreated,b.DateCreated)}),options.Limit&&(resultItems=resultItems.slice(0,options.Limit)),Promise.resolve(resultItems)})}function removeObsoleteContainerItems(serverId){return getServerItems(serverId).then(function(items){var seriesItems=items.filter(function(item){return"series"===(item.Item.Type||"").toLowerCase()}),seasonItems=items.filter(function(item){return"season"===(item.Item.Type||"").toLowerCase()}),albumItems=items.filter(function(item){var type=(item.Item.Type||"").toLowerCase();return"musicalbum"===type||"photoalbum"===type}),requiredSeriesIds=items.filter(function(item){return"episode"===(item.Item.Type||"").toLowerCase()}).map(function(item2){return item2.Item.SeriesId}).filter(filterDistinct),requiredSeasonIds=items.filter(function(item){return"episode"===(item.Item.Type||"").toLowerCase()}).map(function(item2){return item2.Item.SeasonId}).filter(filterDistinct),requiredAlbumIds=items.filter(function(item){var type=(item.Item.Type||"").toLowerCase();return"audio"===type||"photo"===type}).map(function(item2){return item2.Item.AlbumId}).filter(filterDistinct),obsoleteItems=[];seriesItems.forEach(function(item){requiredSeriesIds.indexOf(item.Item.Id)<0&&obsoleteItems.push(item)}),seasonItems.forEach(function(item){requiredSeasonIds.indexOf(item.Item.Id)<0&&obsoleteItems.push(item)}),albumItems.forEach(function(item){requiredAlbumIds.indexOf(item.Item.Id)<0&&obsoleteItems.push(item)});var p=Promise.resolve();return obsoleteItems.forEach(function(item){p=p.then(function(){return itemrepository.remove(item.ServerId,item.Id)})}),p})}function removeLocalItem(localItem){return itemrepository.get(localItem.ServerId,localItem.Id).then(function(item){return filerepository.deleteFile(item.LocalPath).then(function(){var p=Promise.resolve(!0);return item.AdditionalFiles&&item.AdditionalFiles.forEach(function(file){p=p.then(function(){return filerepository.deleteFile(file.Path)})}),p.then(function(file){return itemrepository.remove(localItem.ServerId,localItem.Id)})},function(error){var p=Promise.resolve(!0);return item.AdditionalFiles&&item.AdditionalFiles.forEach(function(file){p=p.then(function(item){return filerepository.deleteFile(file.Path)})}),p.then(function(file){return itemrepository.remove(localItem.ServerId,localItem.Id)})})})}function addOrUpdateLocalItem(localItem){return itemrepository.set(localItem.ServerId,localItem.Id,localItem)}function createLocalItem(libraryItem,serverInfo,jobItem){console.log("[lcoalassetmanager] Begin createLocalItem");var localPath,path=getDirectoryPath(libraryItem,serverInfo),localFolder=filerepository.getFullLocalPath(path);if(jobItem&&(path.push(getLocalFileName(libraryItem,jobItem.OriginalFileName)),localPath=filerepository.getFullLocalPath(path)),libraryItem.MediaSources)for(var i=0;i0&&(fileName=fileName.substring(0,pos)),fileName}function downloadFile(url,localItem){var imageUrl=getImageUrl(localItem.Item.ServerId,localItem.Item.Id,{type:"Primary",index:0});return transfermanager.downloadFile(url,localItem,imageUrl)}function downloadSubtitles(url,fileName){return transfermanager.downloadSubtitles(url,fileName)}function getImageUrl(serverId,itemId,imageOptions){var imageType=imageOptions.type,index=imageOptions.index,pathArray=getImagePath(serverId,itemId,imageType,index);return filerepository.getImageUrl(pathArray)}function hasImage(serverId,itemId,imageType,index){var pathArray=getImagePath(serverId,itemId,imageType,index),localFilePath=filerepository.getFullMetadataPath(pathArray);return filerepository.fileExists(localFilePath).then(function(exists){return Promise.resolve(exists)},function(err){return Promise.resolve(!1)})}function fileExists(localFilePath){return filerepository.fileExists(localFilePath)}function downloadImage(localItem,url,serverId,itemId,imageType,index){var pathArray=getImagePath(serverId,itemId,imageType,index),localFilePath=filerepository.getFullMetadataPath(pathArray);localItem.AdditionalFiles||(localItem.AdditionalFiles=[]);var fileInfo={Path:localFilePath,Type:"Image",Name:imageType+index.toString(),ImageType:imageType};return localItem.AdditionalFiles.push(fileInfo),transfermanager.downloadImage(url,localFilePath)}function isDownloadFileInQueue(path){return transfermanager.isDownloadFileInQueue(path)}function getDownloadItemCount(){return transfermanager.getDownloadItemCount()}function getDirectoryPath(item,server){var parts=[];parts.push(server.Name);var itemtype=item.Type.toLowerCase();if("episode"===itemtype){parts.push("TV");var seriesName=item.SeriesName;seriesName&&parts.push(seriesName);var seasonName=item.SeasonName;seasonName&&parts.push(seasonName)}else if("video"===itemtype)parts.push("Videos"),parts.push(item.Name);else if("audio"===itemtype){parts.push("Music");var albumArtist=item.AlbumArtist;albumArtist&&parts.push(albumArtist),item.AlbumId&&item.Album&&parts.push(item.Album)}else"photo"===itemtype&&(parts.push("Photos"),item.AlbumId&&item.Album&&parts.push(item.Album));for(var finalParts=[],i=0;ifind.length&&0===str.indexOf(find))}function stripStart(str,find){return startsWith(str,find)?str.substr(find.length):str}function filterDistinct(value,index,self){return self.indexOf(value)===index}function compareDates(a,b){return isFinite(a=a.valueOf())&&isFinite(b=b.valueOf())?(a>b)-(a=length?void resolve():void uploadFile(files[index],apiClient).then(function(){uploadNext(files,index+1,server,apiClient,resolve,reject)},function(){uploadNext(files,index+1,server,apiClient,resolve,reject)})}function uploadFile(file,apiClient){return new Promise(function(resolve,reject){require(["fileupload","cryptojs-sha1"],function(FileUpload){var name="camera image "+(new Date).getTime(),url=apiClient.getUrl("Devices/CameraUploads",{DeviceId:apiClient.deviceId(),Name:name,Album:"Camera Roll",Id:getUploadId(file),api_key:apiClient.accessToken()});console.log("Uploading file to "+url),(new FileUpload).upload(file,name,url).then(resolve,reject)})})}function ContentUploader(){}return ContentUploader.prototype.uploadImages=function(connectionManager,server){return cameraRoll.getFiles().then(function(photos){if(!photos.length)return Promise.resolve();var apiClient=connectionManager.getApiClient(server.Id);return apiClient.getContentUploadHistory().then(function(uploadHistory){return photos=getFilesToUpload(photos,uploadHistory),console.log("Found "+photos.length+" files to upload"),new Promise(function(resolve,reject){uploadNext(photos,0,server,apiClient,resolve,reject)})},function(){return Promise.resolve()})})},ContentUploader}); \ No newline at end of file +define(["localassetmanager","cameraRoll"],function(localAssetManager,cameraRoll){"use strict";function getFilesToUpload(files,uploadHistory){return files.filter(function(file){if(!file)return!1;var uploadId=getUploadId(file);return 0===uploadHistory.FilesUploaded.filter(function(u){return uploadId===u.Id}).length})}function getUploadId(file){return btoa(file.Id+"1")}function uploadNext(files,index,server,apiClient,resolve,reject){var length=files.length;if(index>=length)return void resolve();uploadFile(files[index],apiClient).then(function(){uploadNext(files,index+1,server,apiClient,resolve,reject)},function(){uploadNext(files,index+1,server,apiClient,resolve,reject)})}function uploadFile(file,apiClient){return new Promise(function(resolve,reject){require(["fileupload"],function(FileUpload){var url=apiClient.getUrl("Devices/CameraUploads",{DeviceId:apiClient.deviceId(),Name:file.Name,Album:"Camera Roll",Id:getUploadId(file),api_key:apiClient.accessToken()});console.log("Uploading file to "+url),(new FileUpload).upload(file,url).then(resolve,reject)})})}function ContentUploader(){}return ContentUploader.prototype.uploadImages=function(connectionManager,server){return cameraRoll.getFiles().then(function(photos){if(!photos.length)return Promise.resolve();var apiClient=connectionManager.getApiClient(server.Id);return apiClient.getContentUploadHistory().then(function(uploadHistory){return photos=getFilesToUpload(photos,uploadHistory),console.log("Found "+photos.length+" files to upload"),new Promise(function(resolve,reject){uploadNext(photos,0,server,apiClient,resolve,reject)})},function(){return Promise.resolve()})})},ContentUploader}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/itemrepository.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/itemrepository.js index fc3c911b2f..1685367fe0 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/itemrepository.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/itemrepository.js @@ -1 +1 @@ -define([],function(){"use strict";function ServerDatabase(dbName,readyCallback){var request=indexedDB.open(dbName,dbVersion);request.onerror=function(event){},request.onupgradeneeded=function(event){var db=event.target.result,objectStore=db.createObjectStore(dbName);objectStore.transaction.oncomplete=function(event){readyCallback(db)}},request.onsuccess=function(event){var db=event.target.result;readyCallback(db)}}function getDbName(serverId){return"items_"+serverId}function getDb(serverId,callback){var dbName=getDbName(serverId),db=databases[dbName];return db?void callback(db):void new ServerDatabase(dbName,function(db){databases[dbName]=db,callback(db)})}function getServerItemTypes(serverId,userId){return getAll(serverId,userId).then(function(all){return all.map(function(item2){return item2.Item.Type||""}).filter(filterDistinct)})}function getAll(serverId,userId){return new Promise(function(resolve,reject){getDb(serverId,function(db){var request,storeName=getDbName(serverId),transaction=db.transaction([storeName],"readonly"),objectStore=transaction.objectStore(storeName);if("getAll"in objectStore)request=objectStore.getAll(null,1e4),request.onsuccess=function(event){resolve(event.target.result)};else{var results=[];request=objectStore.openCursor(),request.onsuccess=function(event){var cursor=event.target.result;cursor?(results.push(cursor.value),cursor.continue()):resolve(results)}}request.onerror=reject})})}function get(serverId,key){return new Promise(function(resolve,reject){getDb(serverId,function(db){var storeName=getDbName(serverId),transaction=db.transaction([storeName],"readonly"),objectStore=transaction.objectStore(storeName),request=objectStore.get(key);request.onerror=reject,request.onsuccess=function(event){resolve(request.result)}})})}function set(serverId,key,val){return new Promise(function(resolve,reject){getDb(serverId,function(db){var storeName=getDbName(serverId),transaction=db.transaction([storeName],"readwrite"),objectStore=transaction.objectStore(storeName),request=objectStore.put(val,key);request.onerror=reject,request.onsuccess=resolve})})}function remove(serverId,key){return new Promise(function(resolve,reject){getDb(serverId,function(db){var storeName=getDbName(serverId),transaction=db.transaction([storeName],"readwrite"),objectStore=transaction.objectStore(storeName),request=objectStore.delete(key);request.onerror=reject,request.onsuccess=resolve})})}function clear(serverId){return new Promise(function(resolve,reject){getDb(serverId,function(db){var storeName=getDbName(serverId),transaction=db.transaction([storeName],"readwrite"),objectStore=transaction.objectStore(storeName),request=objectStore.clear();request.onerror=reject,request.onsuccess=resolve})})}function filterDistinct(value,index,self){return self.indexOf(value)===index}var indexedDB=self.indexedDB||self.mozIndexedDB||self.webkitIndexedDB||self.msIndexedDB,dbVersion=(self.IDBTransaction||self.webkitIDBTransaction||self.msIDBTransaction||{READ_WRITE:"readwrite"},self.IDBKeyRange||self.webkitIDBKeyRange||self.msIDBKeyRange,1),databases={};return{get:get,set:set,remove:remove,clear:clear,getAll:getAll,getServerItemTypes:getServerItemTypes}}); \ No newline at end of file +define([],function(){"use strict";function ServerDatabase(dbName,readyCallback){var request=indexedDB.open(dbName,dbVersion);request.onerror=function(event){},request.onupgradeneeded=function(event){var db=event.target.result;db.createObjectStore(dbName).transaction.oncomplete=function(event){readyCallback(db)}},request.onsuccess=function(event){var db=event.target.result;readyCallback(db)}}function getDbName(serverId){return"items_"+serverId}function getDb(serverId,callback){var dbName=getDbName(serverId),db=databases[dbName];if(db)return void callback(db);new ServerDatabase(dbName,function(db){databases[dbName]=db,callback(db)})}function getServerItemTypes(serverId,userId){return getAll(serverId,userId).then(function(all){return all.map(function(item2){return item2.Item.Type||""}).filter(filterDistinct)})}function getAll(serverId,userId){return new Promise(function(resolve,reject){getDb(serverId,function(db){var request,storeName=getDbName(serverId),transaction=db.transaction([storeName],"readonly"),objectStore=transaction.objectStore(storeName);if("getAll"in objectStore)request=objectStore.getAll(null,1e4),request.onsuccess=function(event){resolve(event.target.result)};else{var results=[];request=objectStore.openCursor(),request.onsuccess=function(event){var cursor=event.target.result;cursor?(results.push(cursor.value),cursor.continue()):resolve(results)}}request.onerror=reject})})}function get(serverId,key){return new Promise(function(resolve,reject){getDb(serverId,function(db){var storeName=getDbName(serverId),transaction=db.transaction([storeName],"readonly"),objectStore=transaction.objectStore(storeName),request=objectStore.get(key);request.onerror=reject,request.onsuccess=function(event){resolve(request.result)}})})}function set(serverId,key,val){return new Promise(function(resolve,reject){getDb(serverId,function(db){var storeName=getDbName(serverId),transaction=db.transaction([storeName],"readwrite"),objectStore=transaction.objectStore(storeName),request=objectStore.put(val,key);request.onerror=reject,request.onsuccess=resolve})})}function remove(serverId,key){return new Promise(function(resolve,reject){getDb(serverId,function(db){var storeName=getDbName(serverId),transaction=db.transaction([storeName],"readwrite"),objectStore=transaction.objectStore(storeName),request=objectStore.delete(key);request.onerror=reject,request.onsuccess=resolve})})}function clear(serverId){return new Promise(function(resolve,reject){getDb(serverId,function(db){var storeName=getDbName(serverId),transaction=db.transaction([storeName],"readwrite"),objectStore=transaction.objectStore(storeName),request=objectStore.clear();request.onerror=reject,request.onsuccess=resolve})})}function filterDistinct(value,index,self){return self.indexOf(value)===index}var indexedDB=self.indexedDB||self.mozIndexedDB||self.webkitIndexedDB||self.msIndexedDB,dbVersion=(self.IDBTransaction||self.webkitIDBTransaction||self.msIDBTransaction,self.IDBKeyRange||self.webkitIDBKeyRange||self.msIDBKeyRange,1),databases={};return{get:get,set:set,remove:remove,clear:clear,getAll:getAll,getServerItemTypes:getServerItemTypes}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/localsync.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/localsync.js index 910987ce25..2f855bfc39 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/localsync.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/localsync.js @@ -1 +1 @@ -define(["connectionManager"],function(connectionManager){"use strict";var isSyncing;return{sync:function(options){return console.log("localSync.sync starting..."),isSyncing?Promise.resolve():(isSyncing=!0,new Promise(function(resolve,reject){require(["multiserversync"],function(MultiServerSync){options=options||{},options.cameraUploadServers=[],(new MultiServerSync).sync(connectionManager,options).then(function(){isSyncing=null,resolve()},function(err){isSyncing=null,reject(err)})})}))}}}); \ No newline at end of file +define(["connectionManager"],function(connectionManager){"use strict";var isSyncing;return{sync:function(options){return console.log("localSync.sync starting..."),isSyncing?Promise.resolve():(isSyncing=!0,new Promise(function(resolve,reject){require(["multiserversync","appSettings"],function(MultiServerSync,appSettings){options=options||{},options.cameraUploadServers=appSettings.cameraUploadServers(),(new MultiServerSync).sync(connectionManager,options).then(function(){isSyncing=null,resolve()},function(err){isSyncing=null,reject(err)})})}))}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/mediasync.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/mediasync.js index 337501a04f..7b198ae2cf 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/mediasync.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/mediasync.js @@ -1 +1 @@ -define(["localassetmanager"],function(localassetmanager){"use strict";function processDownloadStatus(apiClient,serverInfo,options){return console.log("[mediasync] Begin processDownloadStatus"),localassetmanager.resyncTransfers().then(function(){return localassetmanager.getServerItems(serverInfo.Id).then(function(items){console.log("[mediasync] Begin processDownloadStatus getServerItems completed");var p=Promise.resolve(),cnt=0,progressItems=items.filter(function(item){return"transferring"===item.SyncStatus||"queued"===item.SyncStatus});return progressItems.forEach(function(item){p=p.then(function(){return reportTransfer(apiClient,item)}),cnt++}),p.then(function(){return console.log("[mediasync] Exit processDownloadStatus. Items reported: "+cnt.toString()),Promise.resolve()})})})}function reportTransfer(apiClient,item){return localassetmanager.getItemFileSize(item.LocalPath).then(function(size){return size>0?apiClient.reportSyncJobItemTransferred(item.SyncJobItemId).then(function(){return item.SyncStatus="synced",localassetmanager.addOrUpdateLocalItem(item)},function(error){return console.error("[mediasync] Mediasync error on reportSyncJobItemTransferred",error),item.SyncStatus="error",localassetmanager.addOrUpdateLocalItem(item)}):localassetmanager.isDownloadFileInQueue(item.LocalPath).then(function(result){return result?Promise.resolve():(console.log("[mediasync] reportTransfer: Size is 0 and download no longer in queue. Deleting item."),localassetmanager.removeLocalItem(item).then(function(){return console.log("[mediasync] reportTransfer: Item deleted."),Promise.resolve()},function(err2){return console.log("[mediasync] reportTransfer: Failed to delete item.",err2),Promise.resolve()}))})},function(error){return console.error("[mediasync] reportTransfer: error on getItemFileSize. Deleting item.",error),localassetmanager.removeLocalItem(item).then(function(){return console.log("[mediasync] reportTransfer: Item deleted."),Promise.resolve()},function(err2){return console.log("[mediasync] reportTransfer: Failed to delete item.",error),Promise.resolve()})})}function reportOfflineActions(apiClient,serverInfo){return console.log("[mediasync] Begin reportOfflineActions"),localassetmanager.getUserActions(serverInfo.Id).then(function(actions){return actions.length?apiClient.reportOfflineActions(actions).then(function(){return localassetmanager.deleteUserActions(actions).then(function(){return console.log("[mediasync] Exit reportOfflineActions (actions reported and deleted.)"),Promise.resolve()})},function(err){return console.error("[mediasync] error on apiClient.reportOfflineActions: "+err.toString()),localassetmanager.deleteUserActions(actions)}):(console.log("[mediasync] Exit reportOfflineActions (no actions)"),Promise.resolve())})}function syncData(apiClient,serverInfo,syncUserItemAccess){return console.log("[mediasync] Begin syncData"),localassetmanager.getServerItems(serverInfo.Id).then(function(items){var completedItems=items.filter(function(item){return item&&("synced"===item.SyncStatus||"error"===item.SyncStatus)}),request={TargetId:apiClient.deviceId(),LocalItemIds:completedItems.map(function(xitem){return xitem.ItemId})};return apiClient.syncData(request).then(function(result){return afterSyncData(apiClient,serverInfo,syncUserItemAccess,result).then(function(){return console.log("[mediasync] Exit syncData"),Promise.resolve()},function(err){return console.error("[mediasync] Error in syncData: "+err.toString()),Promise.resolve()})})})}function afterSyncData(apiClient,serverInfo,enableSyncUserItemAccess,syncDataResult){console.log("[mediasync] Begin afterSyncData");var p=Promise.resolve();return syncDataResult.ItemIdsToRemove&&syncDataResult.ItemIdsToRemove.length>0&&syncDataResult.ItemIdsToRemove.forEach(function(itemId){p=p.then(function(){return removeLocalItem(itemId,serverInfo.Id)})}),enableSyncUserItemAccess&&(p=p.then(function(){return syncUserItemAccess(syncDataResult,serverInfo.Id)})),p=p.then(function(){return removeObsoleteContainerItems(serverInfo.Id)}),p.then(function(){return console.log("[mediasync] Exit afterSyncData"),Promise.resolve()})}function removeObsoleteContainerItems(serverId){return console.log("[mediasync] Begin removeObsoleteContainerItems"),localassetmanager.removeObsoleteContainerItems(serverId)}function removeLocalItem(itemId,serverId){return console.log("[mediasync] Begin removeLocalItem"),localassetmanager.getLocalItem(serverId,itemId).then(function(item){return item?localassetmanager.removeLocalItem(item):Promise.resolve()})}function getNewMedia(apiClient,serverInfo,options,downloadCount){return console.log("[mediasync] Begin getNewMedia"),apiClient.getReadySyncItems(apiClient.deviceId()).then(function(jobItems){var p=Promise.resolve(),maxDownloads=10,currentCount=downloadCount;return jobItems.forEach(function(jobItem){currentCount++<=maxDownloads&&(p=p.then(function(){return getNewItem(jobItem,apiClient,serverInfo,options)}))}),p.then(function(){return console.log("[mediasync] Exit getNewMedia"),Promise.resolve()})})}function getNewItem(jobItem,apiClient,serverInfo,options){console.log("[mediasync] Begin getNewItem");var libraryItem=jobItem.Item;return localassetmanager.getLocalItem(serverInfo.Id,libraryItem.Id).then(function(existingItem){var onDownloadParentItemsDone=function(localItem){return downloadMedia(apiClient,jobItem,localItem,options).then(function(){return getImages(apiClient,jobItem,localItem).then(function(){return getSubtitles(apiClient,jobItem,localItem)})})};return!existingItem||"queued"!==existingItem.SyncStatus&&"transferring"!==existingItem.SyncStatus&&"synced"!==existingItem.SyncStatus?(libraryItem.CanDelete=!1,libraryItem.CanDownload=!1,libraryItem.SupportsSync=!1,libraryItem.People=[],libraryItem.Chapters=[],libraryItem.Studios=[],libraryItem.SpecialFeatureCount=null,libraryItem.LocalTrailerCount=null,libraryItem.RemoteTrailers=[],localassetmanager.createLocalItem(libraryItem,serverInfo,jobItem).then(function(localItem){return console.log("[mediasync] getNewItem: createLocalItem completed"),localItem.SyncStatus="queued",downloadParentItems(apiClient,jobItem,localItem,serverInfo,options).then(function(){return onDownloadParentItemsDone(localItem)})})):(console.log("[mediasync] getNewItem: getLocalItem found existing item"),localassetmanager.enableRepeatDownloading()?onDownloadParentItemsDone(existingItem):Promise.resolve())})}function downloadParentItems(apiClient,jobItem,localItem,serverInfo,options){var p=Promise.resolve(),libraryItem=localItem.Item;(libraryItem.Type||"").toLowerCase();return libraryItem.SeriesId&&(p=p.then(function(){return downloadItem(apiClient,libraryItem,libraryItem.SeriesId,serverInfo)})),libraryItem.SeasonId&&(p=p.then(function(){return downloadItem(apiClient,libraryItem,libraryItem.SeasonId,serverInfo).then(function(seasonItem){return libraryItem.SeasonPrimaryImageTag=(seasonItem.Item.ImageTags||{}).Primary,Promise.resolve()})})),libraryItem.AlbumId&&(p=p.then(function(){return downloadItem(apiClient,libraryItem,libraryItem.AlbumId,serverInfo)})),p}function downloadItem(apiClient,libraryItem,itemId,serverInfo){return apiClient.getItem(apiClient.getCurrentUserId(),itemId).then(function(downloadedItem){return downloadedItem.CanDelete=!1,downloadedItem.CanDownload=!1,downloadedItem.SupportsSync=!1,downloadedItem.People=[],downloadedItem.SpecialFeatureCount=null,downloadedItem.BackdropImageTags=null,downloadedItem.ParentBackdropImageTags=null,downloadedItem.ParentArtImageTag=null,downloadedItem.ParentLogoImageTag=null,localassetmanager.createLocalItem(downloadedItem,serverInfo,null).then(function(localItem){return localassetmanager.addOrUpdateLocalItem(localItem).then(function(){return Promise.resolve(localItem)})})},function(err){return console.error("[mediasync] downloadItem failed: "+err.toString()),Promise.resolve(null)})}function downloadMedia(apiClient,jobItem,localItem,options){var url=apiClient.getUrl("Sync/JobItems/"+jobItem.SyncJobItemId+"/File",{api_key:apiClient.accessToken()}),localPath=localItem.LocalPath;return console.log("[mediasync] Downloading media. Url: "+url+". Local path: "+localPath),options=options||{},localassetmanager.downloadFile(url,localItem).then(function(result){return localItem.SyncStatus=result.isComplete?"synced":"transferring",localassetmanager.addOrUpdateLocalItem(localItem)})}function getImages(apiClient,jobItem,localItem){console.log("[mediasync] Begin getImages");var p=Promise.resolve(),libraryItem=localItem.Item,serverId=libraryItem.ServerId,mainImageTag=(libraryItem.ImageTags||{}).Primary;libraryItem.Id&&mainImageTag&&(p=p.then(function(){return downloadImage(localItem,apiClient,serverId,libraryItem.Id,mainImageTag,"Primary")}));var logoImageTag=(libraryItem.ImageTags||{}).Logo;libraryItem.Id&&logoImageTag&&(p=p.then(function(){return downloadImage(localItem,apiClient,serverId,libraryItem.Id,logoImageTag,"Logo")}));var artImageTag=(libraryItem.ImageTags||{}).Art;libraryItem.Id&&artImageTag&&(p=p.then(function(){return downloadImage(localItem,apiClient,serverId,libraryItem.Id,artImageTag,"Art")}));var bannerImageTag=(libraryItem.ImageTags||{}).Banner;libraryItem.Id&&bannerImageTag&&(p=p.then(function(){return downloadImage(localItem,apiClient,serverId,libraryItem.Id,bannerImageTag,"Banner")}));var thumbImageTag=(libraryItem.ImageTags||{}).Thumb;if(libraryItem.Id&&thumbImageTag&&(p=p.then(function(){return downloadImage(localItem,apiClient,serverId,libraryItem.Id,thumbImageTag,"Thumb")})),libraryItem.Id&&libraryItem.BackdropImageTags)for(var i=0;i2?Promise.resolve():reportOfflineActions(apiClient,serverInfo).then(function(){return getNewMedia(apiClient,serverInfo,options,downloadCount).then(function(){return syncData(apiClient,serverInfo,!1).then(function(){return console.log("[mediasync]************************************* Exit sync"),Promise.resolve()})})})})})},function(err){console.error(err.toString())})}}}); \ No newline at end of file +define(["localassetmanager"],function(localassetmanager){"use strict";function processDownloadStatus(apiClient,serverInfo,options){return console.log("[mediasync] Begin processDownloadStatus"),localassetmanager.resyncTransfers().then(function(){return localassetmanager.getServerItems(serverInfo.Id).then(function(items){console.log("[mediasync] Begin processDownloadStatus getServerItems completed");var p=Promise.resolve(),cnt=0;return items.filter(function(item){return"transferring"===item.SyncStatus||"queued"===item.SyncStatus}).forEach(function(item){p=p.then(function(){return reportTransfer(apiClient,item)}),cnt++}),p.then(function(){return console.log("[mediasync] Exit processDownloadStatus. Items reported: "+cnt.toString()),Promise.resolve()})})})}function reportTransfer(apiClient,item){return localassetmanager.getItemFileSize(item.LocalPath).then(function(size){return size>0?apiClient.reportSyncJobItemTransferred(item.SyncJobItemId).then(function(){return item.SyncStatus="synced",localassetmanager.addOrUpdateLocalItem(item)},function(error){return console.error("[mediasync] Mediasync error on reportSyncJobItemTransferred",error),item.SyncStatus="error",localassetmanager.addOrUpdateLocalItem(item)}):localassetmanager.isDownloadFileInQueue(item.LocalPath).then(function(result){return result?Promise.resolve():(console.log("[mediasync] reportTransfer: Size is 0 and download no longer in queue. Deleting item."),localassetmanager.removeLocalItem(item).then(function(){return console.log("[mediasync] reportTransfer: Item deleted."),Promise.resolve()},function(err2){return console.log("[mediasync] reportTransfer: Failed to delete item.",err2),Promise.resolve()}))})},function(error){return console.error("[mediasync] reportTransfer: error on getItemFileSize. Deleting item.",error),localassetmanager.removeLocalItem(item).then(function(){return console.log("[mediasync] reportTransfer: Item deleted."),Promise.resolve()},function(err2){return console.log("[mediasync] reportTransfer: Failed to delete item.",error),Promise.resolve()})})}function reportOfflineActions(apiClient,serverInfo){return console.log("[mediasync] Begin reportOfflineActions"),localassetmanager.getUserActions(serverInfo.Id).then(function(actions){return actions.length?apiClient.reportOfflineActions(actions).then(function(){return localassetmanager.deleteUserActions(actions).then(function(){return console.log("[mediasync] Exit reportOfflineActions (actions reported and deleted.)"),Promise.resolve()})},function(err){return console.error("[mediasync] error on apiClient.reportOfflineActions: "+err.toString()),localassetmanager.deleteUserActions(actions)}):(console.log("[mediasync] Exit reportOfflineActions (no actions)"),Promise.resolve())})}function syncData(apiClient,serverInfo,syncUserItemAccess){return console.log("[mediasync] Begin syncData"),localassetmanager.getServerItems(serverInfo.Id).then(function(items){var completedItems=items.filter(function(item){return item&&("synced"===item.SyncStatus||"error"===item.SyncStatus)}),request={TargetId:apiClient.deviceId(),LocalItemIds:completedItems.map(function(xitem){return xitem.ItemId})};return apiClient.syncData(request).then(function(result){return afterSyncData(apiClient,serverInfo,syncUserItemAccess,result).then(function(){return console.log("[mediasync] Exit syncData"),Promise.resolve()},function(err){return console.error("[mediasync] Error in syncData: "+err.toString()),Promise.resolve()})})})}function afterSyncData(apiClient,serverInfo,enableSyncUserItemAccess,syncDataResult){console.log("[mediasync] Begin afterSyncData");var p=Promise.resolve();return syncDataResult.ItemIdsToRemove&&syncDataResult.ItemIdsToRemove.length>0&&syncDataResult.ItemIdsToRemove.forEach(function(itemId){p=p.then(function(){return removeLocalItem(itemId,serverInfo.Id)})}),enableSyncUserItemAccess&&(p=p.then(function(){return syncUserItemAccess(syncDataResult,serverInfo.Id)})),p=p.then(function(){return removeObsoleteContainerItems(serverInfo.Id)}),p.then(function(){return console.log("[mediasync] Exit afterSyncData"),Promise.resolve()})}function removeObsoleteContainerItems(serverId){return console.log("[mediasync] Begin removeObsoleteContainerItems"),localassetmanager.removeObsoleteContainerItems(serverId)}function removeLocalItem(itemId,serverId){return console.log("[mediasync] Begin removeLocalItem"),localassetmanager.getLocalItem(serverId,itemId).then(function(item){return item?localassetmanager.removeLocalItem(item):Promise.resolve()})}function getNewMedia(apiClient,serverInfo,options,downloadCount){return console.log("[mediasync] Begin getNewMedia"),apiClient.getReadySyncItems(apiClient.deviceId()).then(function(jobItems){var p=Promise.resolve(),currentCount=downloadCount;return jobItems.forEach(function(jobItem){currentCount++<=10&&(p=p.then(function(){return getNewItem(jobItem,apiClient,serverInfo,options)}))}),p.then(function(){return console.log("[mediasync] Exit getNewMedia"),Promise.resolve()})})}function getNewItem(jobItem,apiClient,serverInfo,options){console.log("[mediasync] Begin getNewItem");var libraryItem=jobItem.Item;return localassetmanager.getLocalItem(serverInfo.Id,libraryItem.Id).then(function(existingItem){var onDownloadParentItemsDone=function(localItem){return downloadMedia(apiClient,jobItem,localItem,options).then(function(){return getImages(apiClient,jobItem,localItem).then(function(){return getSubtitles(apiClient,jobItem,localItem)})})};return!existingItem||"queued"!==existingItem.SyncStatus&&"transferring"!==existingItem.SyncStatus&&"synced"!==existingItem.SyncStatus?(libraryItem.CanDelete=!1,libraryItem.CanDownload=!1,libraryItem.SupportsSync=!1,libraryItem.People=[],libraryItem.Chapters=[],libraryItem.Studios=[],libraryItem.SpecialFeatureCount=null,libraryItem.LocalTrailerCount=null,libraryItem.RemoteTrailers=[],localassetmanager.createLocalItem(libraryItem,serverInfo,jobItem).then(function(localItem){return console.log("[mediasync] getNewItem: createLocalItem completed"),localItem.SyncStatus="queued",downloadParentItems(apiClient,jobItem,localItem,serverInfo,options).then(function(){return onDownloadParentItemsDone(localItem)})})):(console.log("[mediasync] getNewItem: getLocalItem found existing item"),localassetmanager.enableRepeatDownloading()?onDownloadParentItemsDone(existingItem):Promise.resolve())})}function downloadParentItems(apiClient,jobItem,localItem,serverInfo,options){var p=Promise.resolve(),libraryItem=localItem.Item;(libraryItem.Type||"").toLowerCase();return libraryItem.SeriesId&&(p=p.then(function(){return downloadItem(apiClient,libraryItem,libraryItem.SeriesId,serverInfo)})),libraryItem.SeasonId&&(p=p.then(function(){return downloadItem(apiClient,libraryItem,libraryItem.SeasonId,serverInfo).then(function(seasonItem){return libraryItem.SeasonPrimaryImageTag=(seasonItem.Item.ImageTags||{}).Primary,Promise.resolve()})})),libraryItem.AlbumId&&(p=p.then(function(){return downloadItem(apiClient,libraryItem,libraryItem.AlbumId,serverInfo)})),p}function downloadItem(apiClient,libraryItem,itemId,serverInfo){return apiClient.getItem(apiClient.getCurrentUserId(),itemId).then(function(downloadedItem){return downloadedItem.CanDelete=!1,downloadedItem.CanDownload=!1,downloadedItem.SupportsSync=!1,downloadedItem.People=[],downloadedItem.SpecialFeatureCount=null,downloadedItem.BackdropImageTags=null,downloadedItem.ParentBackdropImageTags=null,downloadedItem.ParentArtImageTag=null,downloadedItem.ParentLogoImageTag=null,localassetmanager.createLocalItem(downloadedItem,serverInfo,null).then(function(localItem){return localassetmanager.addOrUpdateLocalItem(localItem).then(function(){return Promise.resolve(localItem)})})},function(err){return console.error("[mediasync] downloadItem failed: "+err.toString()),Promise.resolve(null)})}function downloadMedia(apiClient,jobItem,localItem,options){var url=apiClient.getUrl("Sync/JobItems/"+jobItem.SyncJobItemId+"/File",{api_key:apiClient.accessToken()}),localPath=localItem.LocalPath;return console.log("[mediasync] Downloading media. Url: "+url+". Local path: "+localPath),options=options||{},localassetmanager.downloadFile(url,localItem).then(function(result){return localItem.SyncStatus=result.isComplete?"synced":"transferring",localassetmanager.addOrUpdateLocalItem(localItem)})}function getImages(apiClient,jobItem,localItem){console.log("[mediasync] Begin getImages");var p=Promise.resolve(),libraryItem=localItem.Item,serverId=libraryItem.ServerId,mainImageTag=(libraryItem.ImageTags||{}).Primary;libraryItem.Id&&mainImageTag&&(p=p.then(function(){return downloadImage(localItem,apiClient,serverId,libraryItem.Id,mainImageTag,"Primary")}));var logoImageTag=(libraryItem.ImageTags||{}).Logo;libraryItem.Id&&logoImageTag&&(p=p.then(function(){return downloadImage(localItem,apiClient,serverId,libraryItem.Id,logoImageTag,"Logo")}));var artImageTag=(libraryItem.ImageTags||{}).Art;libraryItem.Id&&artImageTag&&(p=p.then(function(){return downloadImage(localItem,apiClient,serverId,libraryItem.Id,artImageTag,"Art")}));var bannerImageTag=(libraryItem.ImageTags||{}).Banner;libraryItem.Id&&bannerImageTag&&(p=p.then(function(){return downloadImage(localItem,apiClient,serverId,libraryItem.Id,bannerImageTag,"Banner")}));var thumbImageTag=(libraryItem.ImageTags||{}).Thumb;if(libraryItem.Id&&thumbImageTag&&(p=p.then(function(){return downloadImage(localItem,apiClient,serverId,libraryItem.Id,thumbImageTag,"Thumb")})),libraryItem.Id&&libraryItem.BackdropImageTags)for(var i=0;i2?Promise.resolve():reportOfflineActions(apiClient,serverInfo).then(function(){return getNewMedia(apiClient,serverInfo,options,downloadCount).then(function(){return syncData(apiClient,serverInfo,!1).then(function(){return console.log("[mediasync]************************************* Exit sync"),Promise.resolve()})})})})})},function(err){console.error(err.toString())})}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/serversync.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/serversync.js index 970f390037..870d21fc06 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/serversync.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/serversync.js @@ -1 +1 @@ -define([],function(){"use strict";function performSync(connectionManager,server,options){console.log("ServerSync.performSync to server: "+server.Id),options=options||{};var uploadPhotos=options.uploadPhotos!==!1;options.cameraUploadServers&&options.cameraUploadServers.indexOf(server.Id)===-1&&(uploadPhotos=!1);var promise=uploadPhotos?uploadContent(connectionManager,server,options):Promise.resolve();return promise.then(function(){return syncMedia(connectionManager,server,options)})}function uploadContent(connectionManager,server,options){return new Promise(function(resolve,reject){require(["contentuploader"],function(ContentUploader){var uploader=new ContentUploader;uploader.uploadImages(connectionManager,server).then(resolve,reject)})})}function syncMedia(connectionManager,server,options){return new Promise(function(resolve,reject){require(["mediasync"],function(MediaSync){var apiClient=connectionManager.getApiClient(server.Id);(new MediaSync).sync(apiClient,server,options).then(resolve,reject)})})}function ServerSync(){}return ServerSync.prototype.sync=function(connectionManager,server,options){if(!server.AccessToken&&!server.ExchangeToken)return console.log("Skipping sync to server "+server.Id+" because there is no saved authentication information."),Promise.resolve();var connectionOptions={updateDateLastAccessed:!1,enableWebSocket:!1,reportCapabilities:!1,enableAutomaticBitrateDetection:!1};return connectionManager.connectToServer(server,connectionOptions).then(function(result){return"SignedIn"===result.State?performSync(connectionManager,server,options):(console.log("Unable to connect to server id: "+server.Id),Promise.reject())},function(err){throw console.log("Unable to connect to server id: "+server.Id),err})},ServerSync}); \ No newline at end of file +define([],function(){"use strict";function performSync(connectionManager,server,options){console.log("ServerSync.performSync to server: "+server.Id),options=options||{};var cameraUploadServers=options.cameraUploadServers||[];console.log("ServerSync cameraUploadServers: "+JSON.stringify(cameraUploadServers));var uploadPhotos=-1!==cameraUploadServers.indexOf(server.Id);return console.log("ServerSync uploadPhotos: "+uploadPhotos),(uploadPhotos?uploadContent(connectionManager,server,options):Promise.resolve()).then(function(){return syncMedia(connectionManager,server,options)})}function uploadContent(connectionManager,server,options){return new Promise(function(resolve,reject){require(["contentuploader"],function(ContentUploader){(new ContentUploader).uploadImages(connectionManager,server).then(resolve,reject)})})}function syncMedia(connectionManager,server,options){return new Promise(function(resolve,reject){require(["mediasync"],function(MediaSync){var apiClient=connectionManager.getApiClient(server.Id);(new MediaSync).sync(apiClient,server,options).then(resolve,reject)})})}function ServerSync(){}return ServerSync.prototype.sync=function(connectionManager,server,options){if(!server.AccessToken&&!server.ExchangeToken)return console.log("Skipping sync to server "+server.Id+" because there is no saved authentication information."),Promise.resolve();var connectionOptions={updateDateLastAccessed:!1,enableWebSocket:!1,reportCapabilities:!1,enableAutomaticBitrateDetection:!1};return connectionManager.connectToServer(server,connectionOptions).then(function(result){return"SignedIn"===result.State?performSync(connectionManager,server,options):(console.log("Unable to connect to server id: "+server.Id),Promise.reject())},function(err){throw console.log("Unable to connect to server id: "+server.Id),err})},ServerSync}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/useractionrepository.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/useractionrepository.js index a48bf8a896..106d0b3925 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/useractionrepository.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/sync/useractionrepository.js @@ -1 +1 @@ -define([],function(){"use strict";function getDb(callback){var db=databaseInstance;if(db)return void callback(db);var request=indexedDB.open(dbName,dbVersion);request.onerror=function(event){},request.onupgradeneeded=function(event){var db=event.target.result,objectStore=db.createObjectStore(dbName);objectStore.transaction.oncomplete=function(event){callback(db)}},request.onsuccess=function(event){var db=event.target.result;callback(db)}}function getByServerId(serverId){return getAll().then(function(items){return items.filter(function(item){return item.ServerId===serverId})})}function getAll(){return new Promise(function(resolve,reject){getDb(function(db){var request,storeName=dbName,transaction=db.transaction([storeName],"readonly"),objectStore=transaction.objectStore(storeName);if("getAll"in objectStore)request=objectStore.getAll(null,1e4),request.onsuccess=function(event){resolve(event.target.result)};else{var results=[];request=objectStore.openCursor(),request.onsuccess=function(event){var cursor=event.target.result;cursor?(results.push(cursor.value),cursor.continue()):resolve(results)}}request.onerror=reject})})}function get(key){return new Promise(function(resolve,reject){getDb(function(db){var storeName=dbName,transaction=db.transaction([storeName],"readonly"),objectStore=transaction.objectStore(storeName),request=objectStore.get(key);request.onerror=reject,request.onsuccess=function(event){resolve(request.result)}})})}function set(key,val){return new Promise(function(resolve,reject){getDb(function(db){var storeName=dbName,transaction=db.transaction([storeName],"readwrite"),objectStore=transaction.objectStore(storeName),request=objectStore.put(val,key);request.onerror=reject,request.onsuccess=resolve})})}function remove(key){return new Promise(function(resolve,reject){getDb(function(db){var storeName=dbName,transaction=db.transaction([storeName],"readwrite"),objectStore=transaction.objectStore(storeName),request=objectStore.delete(key);request.onerror=reject,request.onsuccess=resolve})})}function clear(){return new Promise(function(resolve,reject){getDb(function(db){var storeName=dbName,transaction=db.transaction([storeName],"readwrite"),objectStore=transaction.objectStore(storeName),request=objectStore.clear();request.onerror=reject,request.onsuccess=resolve})})}var databaseInstance,indexedDB=self.indexedDB||self.mozIndexedDB||self.webkitIndexedDB||self.msIndexedDB,dbName=(self.IDBTransaction||self.webkitIDBTransaction||self.msIDBTransaction||{READ_WRITE:"readwrite"},self.IDBKeyRange||self.webkitIDBKeyRange||self.msIDBKeyRange,"useractions"),dbVersion=1;return{get:get,set:set,remove:remove,clear:clear,getAll:getAll,getByServerId:getByServerId}}); \ No newline at end of file +define([],function(){"use strict";function getDb(callback){var db=databaseInstance;if(db)return void callback(db);var request=indexedDB.open(dbName,dbVersion);request.onerror=function(event){},request.onupgradeneeded=function(event){var db=event.target.result;db.createObjectStore(dbName).transaction.oncomplete=function(event){callback(db)}},request.onsuccess=function(event){var db=event.target.result;callback(db)}}function getByServerId(serverId){return getAll().then(function(items){return items.filter(function(item){return item.ServerId===serverId})})}function getAll(){return new Promise(function(resolve,reject){getDb(function(db){var request,storeName=dbName,transaction=db.transaction([storeName],"readonly"),objectStore=transaction.objectStore(storeName);if("getAll"in objectStore)request=objectStore.getAll(null,1e4),request.onsuccess=function(event){resolve(event.target.result)};else{var results=[];request=objectStore.openCursor(),request.onsuccess=function(event){var cursor=event.target.result;cursor?(results.push(cursor.value),cursor.continue()):resolve(results)}}request.onerror=reject})})}function get(key){return new Promise(function(resolve,reject){getDb(function(db){var storeName=dbName,transaction=db.transaction([storeName],"readonly"),objectStore=transaction.objectStore(storeName),request=objectStore.get(key);request.onerror=reject,request.onsuccess=function(event){resolve(request.result)}})})}function set(key,val){return new Promise(function(resolve,reject){getDb(function(db){var storeName=dbName,transaction=db.transaction([storeName],"readwrite"),objectStore=transaction.objectStore(storeName),request=objectStore.put(val,key);request.onerror=reject,request.onsuccess=resolve})})}function remove(key){return new Promise(function(resolve,reject){getDb(function(db){var storeName=dbName,transaction=db.transaction([storeName],"readwrite"),objectStore=transaction.objectStore(storeName),request=objectStore.delete(key);request.onerror=reject,request.onsuccess=resolve})})}function clear(){return new Promise(function(resolve,reject){getDb(function(db){var storeName=dbName,transaction=db.transaction([storeName],"readwrite"),objectStore=transaction.objectStore(storeName),request=objectStore.clear();request.onerror=reject,request.onsuccess=resolve})})}var databaseInstance,indexedDB=self.indexedDB||self.mozIndexedDB||self.webkitIndexedDB||self.msIndexedDB,dbName=(self.IDBTransaction||self.webkitIDBTransaction||self.msIDBTransaction,self.IDBKeyRange||self.webkitIDBKeyRange||self.msIDBKeyRange,"useractions"),dbVersion=1;return{get:get,set:set,remove:remove,clear:clear,getAll:getAll,getByServerId:getByServerId}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js index d5260626b3..e63a5b5734 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js @@ -1 +1 @@ -define(["dialogHelper","layoutManager","globalize","browser","dom","emby-button","css!./actionsheet","material-icons","scrollStyles","listViewStyle"],function(dialogHelper,layoutManager,globalize,browser,dom){"use strict";function getOffsets(elems){var doc=document,results=[];if(!doc)return results;for(var box,elem,i=0,length=elems.length;i0&&(pos.left-=overflowX+20),overflowY>0&&(pos.top-=overflowY+20),pos.top+=options.offsetTop||0,pos.left+=options.offsetLeft||0,pos.top=Math.max(pos.top,10),pos.left=Math.max(pos.left,10),pos}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function show(options){var isFullscreen,dialogOptions={removeOnClose:!0,enableHistory:options.enableHistory,scrollY:!1},backButton=!1;layoutManager.tv?(dialogOptions.size="fullscreen",isFullscreen=!0,backButton=!0,dialogOptions.autoFocus=!0):(dialogOptions.modal=!1,dialogOptions.entryAnimation=options.entryAnimation,dialogOptions.exitAnimation=options.exitAnimation,dialogOptions.entryAnimationDuration=options.entryAnimationDuration||140,dialogOptions.exitAnimationDuration=options.exitAnimationDuration||100,dialogOptions.autoFocus=!1);var dlg=dialogHelper.createDialog(dialogOptions);isFullscreen?dlg.classList.add("actionsheet-fullscreen"):dlg.classList.add("actionsheet-not-fullscreen"),dlg.classList.add("actionSheet"),options.dialogClass&&dlg.classList.add(options.dialogClass);var html="",scrollClassName=layoutManager.tv?"scrollY smoothScrollY hiddenScrollY":"scrollY",style="";if(options.items.length>20){var minWidth=dom.getWindowSize().innerWidth>=300?240:200;style+="min-width:"+minWidth+"px;"}var i,length,option,renderIcon=!1;for(i=0,length=options.items.length;i');var center=options.title&&!renderIcon;html+=center||layoutManager.tv?'
':'
',options.title&&(html+='

',html+=options.title,html+="

"),options.text&&(html+='

',html+=options.text,html+="

");var scrollerClassName="actionSheetScroller";layoutManager.tv&&(scrollerClassName+=" actionSheetScroller-tv focuscontainer-x focuscontainer-y"),html+='
';var menuItemClass="listItem listItem-button actionSheetMenuItem";for(options.shaded&&(menuItemClass+=" listItem-shaded"),options.border&&(menuItemClass+=" listItem-border"),options.menuItemClass&&(menuItemClass+=" "+options.menuItemClass),layoutManager.tv&&(menuItemClass+=" listItem-focusscale"),layoutManager.mobile&&(menuItemClass+=" actionsheet-xlargeFont"),i=0,length=options.items.length;i
';else{var autoFocus=option.selected&&layoutManager.tv?" autoFocus":"",optionId=null==option.id||""===option.id?option.value:option.id;html+="',option.icon?html+=''+option.icon+"":renderIcon&&!center&&(html+=''),html+='
',html+='
',html+=option.name||option.textContent||option.innerText,html+="
",option.secondaryText&&(html+='
',html+=option.secondaryText,html+="
"),html+="
",option.asideText&&(html+='
',html+=option.asideText,html+="
"),html+=""}options.showCancel&&(html+='
',html+='",html+="
"),html+="
",dlg.innerHTML=html,layoutManager.tv&¢erFocus(dlg.querySelector(".actionSheetScroller"),!1,!0);var btnCloseActionSheet=dlg.querySelector(".btnCloseActionSheet");btnCloseActionSheet&&dlg.querySelector(".btnCloseActionSheet").addEventListener("click",function(){dialogHelper.close(dlg)});var selectedId,timeout;return options.timeout&&(timeout=setTimeout(function(){dialogHelper.close(dlg)},options.timeout)),new Promise(function(resolve,reject){var isResolved;dlg.addEventListener("click",function(e){var actionSheetMenuItem=dom.parentWithClass(e.target,"actionSheetMenuItem");actionSheetMenuItem&&(selectedId=actionSheetMenuItem.getAttribute("data-id"),options.resolveOnClick&&(options.resolveOnClick.indexOf?options.resolveOnClick.indexOf(selectedId)!==-1&&(resolve(selectedId),isResolved=!0):(resolve(selectedId),isResolved=!0)),dialogHelper.close(dlg))}),dlg.addEventListener("close",function(){layoutManager.tv&¢erFocus(dlg.querySelector(".actionSheetScroller"),!1,!1),timeout&&(clearTimeout(timeout),timeout=null),isResolved||(null!=selectedId?(options.callback&&options.callback(selectedId),resolve(selectedId)):reject())}),dialogHelper.open(dlg);var setPositions=function(){var pos=options.positionTo&&"fullscreen"!==dialogOptions.size?getPosition(options,dlg):null;pos&&(dlg.style.position="fixed",dlg.style.margin=0,dlg.style.left=pos.left+"px",dlg.style.top=pos.top+"px")};browser.safari?setTimeout(setPositions,0):setPositions()})}return{show:show}}); \ No newline at end of file +define(["dialogHelper","layoutManager","globalize","browser","dom","emby-button","css!./actionsheet","material-icons","scrollStyles","listViewStyle"],function(dialogHelper,layoutManager,globalize,browser,dom){"use strict";function getOffsets(elems){var doc=document,results=[];if(!doc)return results;for(var box,elem,i=0,length=elems.length;i0&&(pos.left-=overflowX+20),overflowY>0&&(pos.top-=overflowY+20),pos.top+=options.offsetTop||0,pos.left+=options.offsetLeft||0,pos.top=Math.max(pos.top,10),pos.left=Math.max(pos.left,10),pos}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function show(options){var isFullscreen,dialogOptions={removeOnClose:!0,enableHistory:options.enableHistory,scrollY:!1};layoutManager.tv?(dialogOptions.size="fullscreen",isFullscreen=!0,!0,dialogOptions.autoFocus=!0):(dialogOptions.modal=!1,dialogOptions.entryAnimation=options.entryAnimation,dialogOptions.exitAnimation=options.exitAnimation,dialogOptions.entryAnimationDuration=options.entryAnimationDuration||140,dialogOptions.exitAnimationDuration=options.exitAnimationDuration||100,dialogOptions.autoFocus=!1);var dlg=dialogHelper.createDialog(dialogOptions);isFullscreen?dlg.classList.add("actionsheet-fullscreen"):dlg.classList.add("actionsheet-not-fullscreen"),dlg.classList.add("actionSheet"),options.dialogClass&&dlg.classList.add(options.dialogClass);var html="",scrollClassName=layoutManager.tv?"scrollY smoothScrollY hiddenScrollY":"scrollY",style="";if(options.items.length>20){style+="min-width:"+(dom.getWindowSize().innerWidth>=300?240:200)+"px;"}var i,length,option,itemIcon,renderIcon=!1,icons=[];for(i=0,length=options.items.length;i');var center=options.title&&!renderIcon;center||layoutManager.tv?html+='
':html+='
',options.title&&(html+='

',html+=options.title,html+="

"),options.text&&(html+='

',html+=options.text,html+="

");var scrollerClassName="actionSheetScroller";layoutManager.tv&&(scrollerClassName+=" actionSheetScroller-tv focuscontainer-x focuscontainer-y"),html+='
';var menuItemClass="listItem listItem-button actionSheetMenuItem";for(options.shaded&&(menuItemClass+=" listItem-shaded"),options.border&&(menuItemClass+=" listItem-border"),options.menuItemClass&&(menuItemClass+=" "+options.menuItemClass),layoutManager.tv&&(menuItemClass+=" listItem-focusscale"),layoutManager.mobile&&(menuItemClass+=" actionsheet-xlargeFont"),i=0,length=options.items.length;i
';else{var autoFocus=option.selected&&layoutManager.tv?" autoFocus":"",optionId=null==option.id||""===option.id?option.value:option.id;html+="',itemIcon=icons[i],itemIcon?html+=''+itemIcon+"":renderIcon&&!center&&(html+=''),html+='
',html+='
',html+=option.name||option.textContent||option.innerText,html+="
",option.secondaryText&&(html+='
',html+=option.secondaryText,html+="
"),html+="
",option.asideText&&(html+='
',html+=option.asideText,html+="
"),html+=""}options.showCancel&&(html+='
',html+='",html+="
"),html+="
",dlg.innerHTML=html,layoutManager.tv&¢erFocus(dlg.querySelector(".actionSheetScroller"),!1,!0),dlg.querySelector(".btnCloseActionSheet")&&dlg.querySelector(".btnCloseActionSheet").addEventListener("click",function(){dialogHelper.close(dlg)});var selectedId,timeout;return options.timeout&&(timeout=setTimeout(function(){dialogHelper.close(dlg)},options.timeout)),new Promise(function(resolve,reject){var isResolved;dlg.addEventListener("click",function(e){var actionSheetMenuItem=dom.parentWithClass(e.target,"actionSheetMenuItem");actionSheetMenuItem&&(selectedId=actionSheetMenuItem.getAttribute("data-id"),options.resolveOnClick&&(options.resolveOnClick.indexOf?-1!==options.resolveOnClick.indexOf(selectedId)&&(resolve(selectedId),isResolved=!0):(resolve(selectedId),isResolved=!0)),dialogHelper.close(dlg))}),dlg.addEventListener("close",function(){layoutManager.tv&¢erFocus(dlg.querySelector(".actionSheetScroller"),!1,!1),timeout&&(clearTimeout(timeout),timeout=null),isResolved||(null!=selectedId?(options.callback&&options.callback(selectedId),resolve(selectedId)):reject())}),dialogHelper.open(dlg);var setPositions=function(){var pos=options.positionTo&&"fullscreen"!==dialogOptions.size?getPosition(options,dlg):null;pos&&(dlg.style.position="fixed",dlg.style.margin=0,dlg.style.left=pos.left+"px",dlg.style.top=pos.top+"px")};browser.safari?setTimeout(setPositions,0):setPositions()})}return{show:show}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/alphapicker/alphapicker.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/alphapicker/alphapicker.js index ddf3be76dd..34980ad8cc 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/alphapicker/alphapicker.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/alphapicker/alphapicker.js @@ -1 +1 @@ -define(["focusManager","layoutManager","dom","css!./style.css","paper-icon-button-light","material-icons"],function(focusManager,layoutManager,dom){"use strict";function focus(){var scope=this,selected=scope.querySelector("."+selectedButtonClass);selected?focusManager.focus(selected):focusManager.autoFocus(scope,!0)}function getAlphaPickerButtonClassName(vertical){var alphaPickerButtonClassName="alphaPickerButton";return layoutManager.tv&&(alphaPickerButtonClassName+=" alphaPickerButton-tv"),vertical&&(alphaPickerButtonClassName+=" alphaPickerButton-vertical"),alphaPickerButtonClassName}function getLetterButton(l,vertical){return'"}function mapLetters(letters,vertical){return letters.map(function(l){return getLetterButton(l,vertical)})}function render(element,options){element.classList.add("alphaPicker"),layoutManager.tv&&element.classList.add("alphaPicker-tv");var vertical=element.classList.contains("alphaPicker-vertical");vertical||element.classList.add("focuscontainer-x");var letters,html="",alphaPickerButtonClassName=getAlphaPickerButtonClassName(vertical),rowClassName="alphaPickerRow";vertical&&(rowClassName+=" alphaPickerRow-vertical"),html+='
',"keyboard"===options.mode?html+='':(letters=["#"],html+=mapLetters(letters,vertical).join("")),letters=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],html+=mapLetters(letters,vertical).join(""),"keyboard"===options.mode?(html+='',html+="
",letters=["0","1","2","3","4","5","6","7","8","9"],html+='
',html+="
",html+=mapLetters(letters,vertical).join(""),html+="
"):html+="
",element.innerHTML=html,element.classList.add("focusable"),element.focus=focus}function AlphaPicker(options){function onItemFocusTimeout(){itemFocusTimeout=null,self.value(itemFocusValue)}function onAlphaFocusTimeout(){if(alphaFocusTimeout=null,document.activeElement===alphaFocusedElement){var value=alphaFocusedElement.getAttribute("data-value");self.value(value,!0)}}function onAlphaPickerInKeyboardModeClick(e){var alphaPickerButton=dom.parentWithClass(e.target,"alphaPickerButton");if(alphaPickerButton){var value=alphaPickerButton.getAttribute("data-value");element.dispatchEvent(new CustomEvent("alphavalueclicked",{cancelable:!1,detail:{value:value}}))}}function onAlphaPickerClick(e){var alphaPickerButton=dom.parentWithClass(e.target,"alphaPickerButton");if(alphaPickerButton){var value=alphaPickerButton.getAttribute("data-value");(this._currentValue||"").toUpperCase()===value.toUpperCase()?self.value(null,!0):self.value(value,!0)}}function onAlphaPickerFocusIn(e){alphaFocusTimeout&&(clearTimeout(alphaFocusTimeout),alphaFocusTimeout=null);var alphaPickerButton=dom.parentWithClass(e.target,"alphaPickerButton");alphaPickerButton&&(alphaFocusedElement=alphaPickerButton,alphaFocusTimeout=setTimeout(onAlphaFocusTimeout,600))}function onItemsFocusIn(e){var item=dom.parentWithClass(e.target,itemClass);if(item){var prefix=item.getAttribute("data-prefix");prefix&&prefix.length&&(itemFocusValue=prefix[0],itemFocusTimeout&&clearTimeout(itemFocusTimeout),itemFocusTimeout=setTimeout(onItemFocusTimeout,100))}}var self=this;this.options=options;var itemFocusValue,itemFocusTimeout,alphaFocusedElement,alphaFocusTimeout,element=options.element,itemsContainer=options.itemsContainer,itemClass=options.itemClass;self.enabled=function(enabled){enabled?(itemsContainer&&itemsContainer.addEventListener("focus",onItemsFocusIn,!0),"keyboard"===options.mode&&element.addEventListener("click",onAlphaPickerInKeyboardModeClick),"click"!==options.valueChangeEvent?element.addEventListener("focus",onAlphaPickerFocusIn,!0):element.addEventListener("click",onAlphaPickerClick.bind(this))):(itemsContainer&&itemsContainer.removeEventListener("focus",onItemsFocusIn,!0),element.removeEventListener("click",onAlphaPickerInKeyboardModeClick),element.removeEventListener("focus",onAlphaPickerFocusIn,!0),element.removeEventListener("click",onAlphaPickerClick.bind(this)))},render(element,options),this.enabled(!0),this.visible(!0)}var selectedButtonClass="alphaPickerButton-selected";return AlphaPicker.prototype.value=function(value,applyValue){var btn,selected,element=this.options.element;if(void 0!==value)if(null!=value){if(value=value.toUpperCase(),this._currentValue=value,"keyboard"!==this.options.mode){selected=element.querySelector("."+selectedButtonClass);try{btn=element.querySelector(".alphaPickerButton[data-value='"+value+"']")}catch(err){console.log("Error in querySelector: "+err)}btn&&btn!==selected&&btn.classList.add(selectedButtonClass),selected&&selected!==btn&&selected.classList.remove(selectedButtonClass)}}else this._currentValue=value,selected=element.querySelector("."+selectedButtonClass),selected&&selected.classList.remove(selectedButtonClass);return applyValue&&element.dispatchEvent(new CustomEvent("alphavaluechanged",{cancelable:!1,detail:{value:value}})),this._currentValue},AlphaPicker.prototype.on=function(name,fn){var element=this.options.element;element.addEventListener(name,fn)},AlphaPicker.prototype.off=function(name,fn){var element=this.options.element;element.removeEventListener(name,fn)},AlphaPicker.prototype.visible=function(visible){var element=this.options.element;element.style.visibility=visible?"visible":"hidden"},AlphaPicker.prototype.values=function(){for(var element=this.options.element,elems=element.querySelectorAll(".alphaPickerButton"),values=[],i=0,length=elems.length;i'+l+""}function mapLetters(letters,vertical){return letters.map(function(l){return getLetterButton(l,vertical)})}function render(element,options){element.classList.add("alphaPicker"),layoutManager.tv&&element.classList.add("alphaPicker-tv");var vertical=element.classList.contains("alphaPicker-vertical");vertical||element.classList.add("focuscontainer-x");var letters,html="",alphaPickerButtonClassName=getAlphaPickerButtonClassName(vertical),rowClassName="alphaPickerRow";vertical&&(rowClassName+=" alphaPickerRow-vertical"),html+='
',"keyboard"===options.mode?html+='':(letters=["#"],html+=mapLetters(letters,vertical).join("")),letters=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],html+=mapLetters(letters,vertical).join(""),"keyboard"===options.mode?(html+='',html+="
",letters=["0","1","2","3","4","5","6","7","8","9"],html+='
',html+="
",html+=mapLetters(letters,vertical).join(""),html+="
"):html+="
",element.innerHTML=html,element.classList.add("focusable"),element.focus=focus}function AlphaPicker(options){function onItemFocusTimeout(){itemFocusTimeout=null,self.value(itemFocusValue)}function onAlphaFocusTimeout(){if(alphaFocusTimeout=null,document.activeElement===alphaFocusedElement){var value=alphaFocusedElement.getAttribute("data-value");self.value(value,!0)}}function onAlphaPickerInKeyboardModeClick(e){var alphaPickerButton=dom.parentWithClass(e.target,"alphaPickerButton");if(alphaPickerButton){var value=alphaPickerButton.getAttribute("data-value");element.dispatchEvent(new CustomEvent("alphavalueclicked",{cancelable:!1,detail:{value:value}}))}}function onAlphaPickerClick(e){var alphaPickerButton=dom.parentWithClass(e.target,"alphaPickerButton");if(alphaPickerButton){var value=alphaPickerButton.getAttribute("data-value");(this._currentValue||"").toUpperCase()===value.toUpperCase()?self.value(null,!0):self.value(value,!0)}}function onAlphaPickerFocusIn(e){alphaFocusTimeout&&(clearTimeout(alphaFocusTimeout),alphaFocusTimeout=null);var alphaPickerButton=dom.parentWithClass(e.target,"alphaPickerButton");alphaPickerButton&&(alphaFocusedElement=alphaPickerButton,alphaFocusTimeout=setTimeout(onAlphaFocusTimeout,600))}function onItemsFocusIn(e){var item=dom.parentWithClass(e.target,itemClass);if(item){var prefix=item.getAttribute("data-prefix");prefix&&prefix.length&&(itemFocusValue=prefix[0],itemFocusTimeout&&clearTimeout(itemFocusTimeout),itemFocusTimeout=setTimeout(onItemFocusTimeout,100))}}var self=this;this.options=options;var itemFocusValue,itemFocusTimeout,alphaFocusedElement,alphaFocusTimeout,element=options.element,itemsContainer=options.itemsContainer,itemClass=options.itemClass;self.enabled=function(enabled){enabled?(itemsContainer&&itemsContainer.addEventListener("focus",onItemsFocusIn,!0),"keyboard"===options.mode&&element.addEventListener("click",onAlphaPickerInKeyboardModeClick),"click"!==options.valueChangeEvent?element.addEventListener("focus",onAlphaPickerFocusIn,!0):element.addEventListener("click",onAlphaPickerClick.bind(this))):(itemsContainer&&itemsContainer.removeEventListener("focus",onItemsFocusIn,!0),element.removeEventListener("click",onAlphaPickerInKeyboardModeClick),element.removeEventListener("focus",onAlphaPickerFocusIn,!0),element.removeEventListener("click",onAlphaPickerClick.bind(this)))},render(element,options),this.enabled(!0),this.visible(!0)}var selectedButtonClass="alphaPickerButton-selected";return AlphaPicker.prototype.value=function(value,applyValue){var btn,selected,element=this.options.element;if(void 0!==value)if(null!=value){if(value=value.toUpperCase(),this._currentValue=value,"keyboard"!==this.options.mode){selected=element.querySelector("."+selectedButtonClass);try{btn=element.querySelector(".alphaPickerButton[data-value='"+value+"']")}catch(err){console.log("Error in querySelector: "+err)}btn&&btn!==selected&&btn.classList.add(selectedButtonClass),selected&&selected!==btn&&selected.classList.remove(selectedButtonClass)}}else this._currentValue=value,(selected=element.querySelector("."+selectedButtonClass))&&selected.classList.remove(selectedButtonClass);return applyValue&&element.dispatchEvent(new CustomEvent("alphavaluechanged",{cancelable:!1,detail:{value:value}})),this._currentValue},AlphaPicker.prototype.on=function(name,fn){this.options.element.addEventListener(name,fn)},AlphaPicker.prototype.off=function(name,fn){this.options.element.removeEventListener(name,fn)},AlphaPicker.prototype.visible=function(visible){this.options.element.style.visibility=visible?"visible":"hidden"},AlphaPicker.prototype.values=function(){for(var element=this.options.element,elems=element.querySelectorAll(".alphaPickerButton"),values=[],i=0,length=elems.length;i0?item.BackdropImageTags.map(function(imgTag,index){return apiClient.getScaledImageUrl(item.BackdropItemId||item.Id,Object.assign(imageOptions,{type:"Backdrop",tag:imgTag,maxWidth:getBackdropMaxWidth(),index:index}))}):item.ParentBackdropItemId&&item.ParentBackdropImageTags&&item.ParentBackdropImageTags.length?item.ParentBackdropImageTags.map(function(imgTag,index){return apiClient.getScaledImageUrl(item.ParentBackdropItemId,Object.assign(imageOptions,{type:"Backdrop",tag:imgTag,maxWidth:getBackdropMaxWidth(),index:index}))}):[]}function getImageUrls(items,imageOptions){for(var list=[],onImg=function(img){list.push(img)},i=0,length=items.length;i1&&enableImageRotation!==!1&&enableRotation()&&(rotationInterval=setInterval(onRotationInterval,24e3)),onRotationInterval())}function onRotationInterval(){if(!playbackManager.isPlayingLocally(["Video"])){var newIndex=currentRotationIndex+1;newIndex>=currentRotatingImages.length&&(newIndex=0),currentRotationIndex=newIndex,setBackdropImage(currentRotatingImages[newIndex])}}function clearRotation(){var interval=rotationInterval;interval&&clearInterval(interval),rotationInterval=null,currentRotatingImages=[],currentRotationIndex=-1}function setBackdrop(url,imageOptions){url&&"string"!=typeof url&&(url=getImageUrls([url],imageOptions)[0]),url?(clearRotation(),setBackdropImage(url)):clearBackdrop()}Backdrop.prototype.load=function(url,parent,existingBackdropImage){var img=new Image,self=this;img.onload=function(){if(!self.isDestroyed){var backdropImage=document.createElement("div");if(backdropImage.classList.add("backdropImage"),backdropImage.classList.add("displayingBackdropImage"),backdropImage.style.backgroundImage="url('"+url+"')",backdropImage.setAttribute("data-url",url),backdropImage.classList.add("backdropImageFadeIn"),parent.appendChild(backdropImage),!enableAnimation(backdropImage))return existingBackdropImage&&existingBackdropImage.parentNode&&existingBackdropImage.parentNode.removeChild(existingBackdropImage),void internalBackdrop(!0);var onAnimationComplete=function(){dom.removeEventListener(backdropImage,dom.whichAnimationEvent(),onAnimationComplete,{once:!0}),backdropImage===self.currentAnimatingElement&&(self.currentAnimatingElement=null),existingBackdropImage&&existingBackdropImage.parentNode&&existingBackdropImage.parentNode.removeChild(existingBackdropImage)};dom.addEventListener(backdropImage,dom.whichAnimationEvent(),onAnimationComplete,{once:!0}),internalBackdrop(!0)}},img.src=url},Backdrop.prototype.cancelAnimation=function(){var elem=this.currentAnimatingElement;elem&&(elem.classList.remove("backdropImageFadeIn"),this.currentAnimatingElement=null)},Backdrop.prototype.destroy=function(){this.isDestroyed=!0,this.cancelAnimation()};var backdropContainer,backgroundContainer,hasInternalBackdrop,hasExternalBackdrop,currentLoadingBackdrop,rotationInterval,standardWidths=[480,720,1280,1440,1920],currentRotatingImages=[],currentRotationIndex=-1;return{setBackdrops:setBackdrops,setBackdrop:setBackdrop,clear:clearBackdrop,externalBackdrop:externalBackdrop}}); \ No newline at end of file +define(["browser","connectionManager","playbackManager","dom","css!./style"],function(browser,connectionManager,playbackManager,dom){"use strict";function enableAnimation(elem){return!browser.slow}function enableRotation(){return!browser.tv&&!browser.firefox}function Backdrop(){}function getBackdropContainer(){return backdropContainer||(backdropContainer=document.querySelector(".backdropContainer")),backdropContainer||(backdropContainer=document.createElement("div"),backdropContainer.classList.add("backdropContainer"),document.body.insertBefore(backdropContainer,document.body.firstChild)),backdropContainer}function clearBackdrop(clearAll){clearRotation(),currentLoadingBackdrop&&(currentLoadingBackdrop.destroy(),currentLoadingBackdrop=null),getBackdropContainer().innerHTML="",clearAll&&(hasExternalBackdrop=!1),internalBackdrop(!1)}function getBackgroundContainer(){return backgroundContainer||(backgroundContainer=document.querySelector(".backgroundContainer")),backgroundContainer}function setBackgroundContainerBackgroundEnabled(){hasInternalBackdrop||hasExternalBackdrop?getBackgroundContainer().classList.add("withBackdrop"):getBackgroundContainer().classList.remove("withBackdrop")}function internalBackdrop(enabled){hasInternalBackdrop=enabled,setBackgroundContainerBackgroundEnabled()}function externalBackdrop(enabled){hasExternalBackdrop=enabled,setBackgroundContainerBackgroundEnabled()}function setBackdropImage(url){currentLoadingBackdrop&&(currentLoadingBackdrop.destroy(),currentLoadingBackdrop=null);var elem=getBackdropContainer(),existingBackdropImage=elem.querySelector(".displayingBackdropImage");if(existingBackdropImage&&existingBackdropImage.getAttribute("data-url")===url){if(existingBackdropImage.getAttribute("data-url")===url)return;existingBackdropImage.classList.remove("displayingBackdropImage")}var instance=new Backdrop;instance.load(url,elem,existingBackdropImage),currentLoadingBackdrop=instance}function getBackdropMaxWidth(){var width=dom.getWindowSize().innerWidth;if(-1!==standardWidths.indexOf(width))return width;return width=100*Math.floor(width/100),Math.min(width,1920)}function getItemImageUrls(item,imageOptions){imageOptions=imageOptions||{};var apiClient=connectionManager.getApiClient(item.ServerId);return item.BackdropImageTags&&item.BackdropImageTags.length>0?item.BackdropImageTags.map(function(imgTag,index){return apiClient.getScaledImageUrl(item.BackdropItemId||item.Id,Object.assign(imageOptions,{type:"Backdrop",tag:imgTag,maxWidth:getBackdropMaxWidth(),index:index}))}):item.ParentBackdropItemId&&item.ParentBackdropImageTags&&item.ParentBackdropImageTags.length?item.ParentBackdropImageTags.map(function(imgTag,index){return apiClient.getScaledImageUrl(item.ParentBackdropItemId,Object.assign(imageOptions,{type:"Backdrop",tag:imgTag,maxWidth:getBackdropMaxWidth(),index:index}))}):[]}function getImageUrls(items,imageOptions){for(var list=[],onImg=function(img){list.push(img)},i=0,length=items.length;i1&&!1!==enableImageRotation&&enableRotation()&&(rotationInterval=setInterval(onRotationInterval,24e3)),onRotationInterval())}function onRotationInterval(){if(!playbackManager.isPlayingLocally(["Video"])){var newIndex=currentRotationIndex+1;newIndex>=currentRotatingImages.length&&(newIndex=0),currentRotationIndex=newIndex,setBackdropImage(currentRotatingImages[newIndex])}}function clearRotation(){var interval=rotationInterval;interval&&clearInterval(interval),rotationInterval=null,currentRotatingImages=[],currentRotationIndex=-1}function setBackdrop(url,imageOptions){url&&"string"!=typeof url&&(url=getImageUrls([url],imageOptions)[0]),url?(clearRotation(),setBackdropImage(url)):clearBackdrop()}Backdrop.prototype.load=function(url,parent,existingBackdropImage){var img=new Image,self=this;img.onload=function(){if(!self.isDestroyed){var backdropImage=document.createElement("div");if(backdropImage.classList.add("backdropImage"),backdropImage.classList.add("displayingBackdropImage"),backdropImage.style.backgroundImage="url('"+url+"')",backdropImage.setAttribute("data-url",url),backdropImage.classList.add("backdropImageFadeIn"),parent.appendChild(backdropImage),!enableAnimation(backdropImage))return existingBackdropImage&&existingBackdropImage.parentNode&&existingBackdropImage.parentNode.removeChild(existingBackdropImage),void internalBackdrop(!0);var onAnimationComplete=function(){dom.removeEventListener(backdropImage,dom.whichAnimationEvent(),onAnimationComplete,{once:!0}),backdropImage===self.currentAnimatingElement&&(self.currentAnimatingElement=null),existingBackdropImage&&existingBackdropImage.parentNode&&existingBackdropImage.parentNode.removeChild(existingBackdropImage)};dom.addEventListener(backdropImage,dom.whichAnimationEvent(),onAnimationComplete,{once:!0}),internalBackdrop(!0)}},img.src=url},Backdrop.prototype.cancelAnimation=function(){var elem=this.currentAnimatingElement;elem&&(elem.classList.remove("backdropImageFadeIn"),this.currentAnimatingElement=null)},Backdrop.prototype.destroy=function(){this.isDestroyed=!0,this.cancelAnimation()};var backdropContainer,backgroundContainer,hasInternalBackdrop,hasExternalBackdrop,currentLoadingBackdrop,rotationInterval,standardWidths=[480,720,1280,1440,1920],currentRotatingImages=[],currentRotationIndex=-1;return{setBackdrops:setBackdrops,setBackdrop:setBackdrop,clear:clearBackdrop,externalBackdrop:externalBackdrop}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/browser.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/browser.js index 1e6ea52a68..4d15001876 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/browser.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/browser.js @@ -1 +1 @@ -define([],function(){"use strict";function isTv(){var userAgent=navigator.userAgent.toLowerCase();return userAgent.indexOf("tv")!==-1||(userAgent.indexOf("samsungbrowser")!==-1||(userAgent.indexOf("nintendo")!==-1||(userAgent.indexOf("viera")!==-1||userAgent.indexOf("webos")!==-1)))}function isMobile(userAgent){for(var terms=["mobi","ipad","iphone","ipod","silk","gt-p1000","nexus 7","kindle fire","opera mini"],lower=userAgent.toLowerCase(),i=0,length=terms.length;i2&&(version=versionMatch[2]),version=version||match[2]||"0";var versionMajor=parseInt(version.split(".")[0]);return isNaN(versionMajor)&&(versionMajor=0),{browser:browser,version:version,platform:platform_match[0]||"",versionMajor:versionMajor}},userAgent=navigator.userAgent,matched=uaMatch(userAgent),browser={};return matched.browser&&(browser[matched.browser]=!0,browser.version=matched.version,browser.versionMajor=matched.versionMajor),matched.platform&&(browser[matched.platform]=!0),browser.chrome||browser.msie||browser.edge||browser.opera||userAgent.toLowerCase().indexOf("webkit")===-1||(browser.safari=!0),userAgent.toLowerCase().indexOf("playstation 4")!==-1&&(browser.ps4=!0,browser.tv=!0),isMobile(userAgent)&&(browser.mobile=!0),browser.xboxOne=userAgent.toLowerCase().indexOf("xbox")!==-1,browser.animate="undefined"!=typeof document&&null!=document.documentElement.animate,browser.tizen=userAgent.toLowerCase().indexOf("tizen")!==-1||null!=self.tizen,browser.web0s=userAgent.toLowerCase().indexOf("Web0S".toLowerCase())!==-1,browser.edgeUwp=browser.edge&&(userAgent.toLowerCase().indexOf("msapphost")!==-1||userAgent.toLowerCase().indexOf("webview")!==-1),browser.tizen||(browser.orsay=userAgent.toLowerCase().indexOf("smarthub")!==-1),browser.edgeUwp&&(browser.edge=!0),browser.tv=isTv(),browser.operaTv=browser.tv&&userAgent.toLowerCase().indexOf("opr/")!==-1,isStyleSupported("display","flex")||(browser.noFlex=!0),(browser.mobile||browser.tv)&&(browser.slow=!0),"undefined"!=typeof document&&("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&(browser.touch=!0),browser.keyboard=hasKeyboard(browser),browser.supportsCssAnimation=supportsCssAnimation,browser.osx=userAgent.toLowerCase().indexOf("os x")!==-1,browser.iOS=browser.ipad||browser.iphone||browser.ipod,browser.iOS&&(browser.iOSVersion=iOSversion(),browser.iOSVersion=browser.iOSVersion[0]+browser.iOSVersion[1]/10),browser.chromecast=browser.chrome&&userAgent.toLowerCase().indexOf("crkey")!==-1,browser}); \ No newline at end of file +define([],function(){"use strict";function supportsCssAnimation(allowPrefix){if(allowPrefix){if(!0===_supportsCssAnimationWithPrefix||!1===_supportsCssAnimationWithPrefix)return _supportsCssAnimationWithPrefix}else if(!0===_supportsCssAnimation||!1===_supportsCssAnimation)return _supportsCssAnimation;var animation=!1,domPrefixes=["Webkit","O","Moz"],pfx="",elm=document.createElement("div");if(void 0!==elm.style.animationName&&(animation=!0),!1===animation&&allowPrefix)for(var i=0;i2&&(version=versionMatch[2]),version=version||match[2]||"0";var versionMajor=parseInt(version.split(".")[0]);return isNaN(versionMajor)&&(versionMajor=0),{browser:browser,version:version,platform:platform_match[0]||"",versionMajor:versionMajor}}(userAgent),browser={};return matched.browser&&(browser[matched.browser]=!0,browser.version=matched.version,browser.versionMajor=matched.versionMajor),matched.platform&&(browser[matched.platform]=!0),browser.chrome||browser.msie||browser.edge||browser.opera||-1===userAgent.toLowerCase().indexOf("webkit")||(browser.safari=!0),-1!==userAgent.toLowerCase().indexOf("playstation 4")&&(browser.ps4=!0,browser.tv=!0),function(userAgent){for(var terms=["mobi","ipad","iphone","ipod","silk","gt-p1000","nexus 7","kindle fire","opera mini"],lower=userAgent.toLowerCase(),i=0,length=terms.length;i=11)||!(!videoTestElement.canPlayType||!videoTestElement.canPlayType('video/hevc; codecs="hevc, aac"').replace(/no/,""))}function supportsTextTracks(){return!(!browser.tizen&&!browser.orsay)||(null==_supportsTextTracks&&(_supportsTextTracks=null!=document.createElement("video").textTracks),_supportsTextTracks)}function canPlayHls(src){return null==_canPlayHls&&(_canPlayHls=canPlayNativeHls()||canPlayHlsWithMSE()),_canPlayHls}function canPlayNativeHls(){if(browser.tizen||browser.orsay)return!0;var media=document.createElement("video");return!(!media.canPlayType("application/x-mpegURL").replace(/no/,"")&&!media.canPlayType("application/vnd.apple.mpegURL").replace(/no/,""))}function canPlayHlsWithMSE(){return null!=window.MediaSource}function canPlayAudioFormat(format){var typeString;if("flac"===format){if(browser.tizen||browser.orsay)return!0;if(browser.edgeUwp)return!0}else if("wma"===format){if(browser.tizen||browser.orsay)return!0;if(browser.edgeUwp)return!0}else{if("opus"===format)return typeString='audio/ogg; codecs="opus"',!!document.createElement("audio").canPlayType(typeString).replace(/no/,"");if("mp2"===format)return!1}if("webma"===format)typeString="audio/webm";else if("mp2"===format)typeString="audio/mpeg";else if("ogg"===format||"oga"===format){if(browser.chrome)return!1;typeString="audio/"+format}else typeString="audio/"+format;return!!document.createElement("audio").canPlayType(typeString).replace(/no/,"")}function testCanPlayMkv(videoTestElement){if(browser.tizen||browser.orsay||browser.web0s)return!0;if(videoTestElement.canPlayType("video/x-matroska").replace(/no/,"")||videoTestElement.canPlayType("video/mkv").replace(/no/,""))return!0;var userAgent=navigator.userAgent.toLowerCase();return browser.chrome?!browser.operaTv&&(userAgent.indexOf("vivaldi")===-1&&userAgent.indexOf("opera")===-1):!!browser.edgeUwp}function testCanPlayTs(){return browser.tizen||browser.orsay||browser.web0s||browser.edgeUwp}function supportsMpeg2Video(){return browser.orsay||browser.tizen||browser.edgeUwp||browser.web0s}function supportsVc1(){return browser.orsay||browser.tizen||browser.edgeUwp}function getDirectPlayProfileForVideoContainer(container,videoAudioCodecs,videoTestElement,options){var supported=!1,profileContainer=container,videoCodecs=[];switch(container){case"asf":supported=browser.tizen||browser.orsay||browser.edgeUwp,videoAudioCodecs=[];break;case"avi":supported=browser.tizen||browser.orsay||browser.edgeUwp;break;case"mpg":case"mpeg":supported=browser.edgeUwp||browser.tizen||browser.orsay;break;case"flv":supported=browser.tizen||browser.orsay;break;case"3gp":case"mts":case"trp":case"vob":case"vro":supported=browser.tizen||browser.orsay;break;case"mov":supported=browser.tizen||browser.orsay||browser.chrome||browser.edgeUwp,videoCodecs.push("h264");break;case"m2ts":supported=browser.tizen||browser.orsay||browser.web0s||browser.edgeUwp,videoCodecs.push("h264"),supportsVc1()&&videoCodecs.push("vc1"),supportsMpeg2Video()&&videoCodecs.push("mpeg2video");break;case"wmv":supported=browser.tizen||browser.orsay||browser.web0s||browser.edgeUwp,videoAudioCodecs=[];break;case"ts":supported=testCanPlayTs(),videoCodecs.push("h264"),canPlayH265(videoTestElement,options)&&(videoCodecs.push("h265"),videoCodecs.push("hevc")),supportsVc1()&&videoCodecs.push("vc1"),supportsMpeg2Video()&&videoCodecs.push("mpeg2video"),profileContainer="ts,mpegts"}return supported?{Container:profileContainer,Type:"Video",VideoCodec:videoCodecs.join(","),AudioCodec:videoAudioCodecs.join(",")}:null}function getMaxBitrate(){return 12e7}function getGlobalMaxVideoBitrate(){var userAgent=navigator.userAgent.toLowerCase();if(browser.chromecast){var isChromecastUltra=userAgent.indexOf("aarch64")!==-1;return isChromecastUltra?null:self.screen&&self.screen.width>=3800?null:3e7}var isTizenFhd=!1;if(browser.tizen)try{var isTizenUhd=webapis.productinfo.isUdPanelSupported();isTizenFhd=!isTizenUhd,console.log("isTizenFhd = "+isTizenFhd)}catch(error){console.log("isUdPanelSupported() error code = "+error.code)}return browser.ps4?8e6:browser.xboxOne?12e6:browser.edgeUwp?null:browser.tizen&&isTizenFhd?2e7:null}function supportsAc3(videoTestElement){return!!(browser.edgeUwp||browser.tizen||browser.orsay||browser.web0s)||videoTestElement.canPlayType('audio/mp4; codecs="ac-3"').replace(/no/,"")&&!browser.osx&&!browser.iOS}function supportsEac3(videoTestElement){return!!(browser.tizen||browser.orsay||browser.web0s)||videoTestElement.canPlayType('audio/mp4; codecs="ec-3"').replace(/no/,"")}var _supportsTextTracks,_canPlayHls;return function(options){options=options||{};var physicalAudioChannels=options.audioChannels||(browser.tv||browser.ps4||browser.xboxOne||browser.chromecast?6:2),bitrateSetting=getMaxBitrate(),videoTestElement=document.createElement("video"),canPlayVp8=videoTestElement.canPlayType('video/webm; codecs="vp8"').replace(/no/,""),canPlayVp9=videoTestElement.canPlayType('video/webm; codecs="vp9"').replace(/no/,""),canPlayMkv=testCanPlayMkv(videoTestElement),profile={};profile.MaxStreamingBitrate=bitrateSetting,profile.MaxStaticBitrate=1e8,profile.MusicStreamingTranscodingBitrate=Math.min(bitrateSetting,192e3),profile.DirectPlayProfiles=[];var videoAudioCodecs=[],hlsVideoAudioCodecs=[],supportsMp3VideoAudio=videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.69"').replace(/no/,"")||videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.6B"').replace(/no/,""),supportsMp2VideoAudio=browser.edgeUwp||browser.tizen||browser.orsay||browser.web0s,maxVideoWidth=browser.xboxOne&&self.screen?self.screen.width:null;options.maxVideoWidth&&(maxVideoWidth=options.maxVideoWidth);var canPlayAacVideoAudio=videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.40.2"').replace(/no/,"");if(canPlayAacVideoAudio&&browser.chromecast&&videoAudioCodecs.push("aac"),supportsAc3(videoTestElement)){videoAudioCodecs.push("ac3");var eAc3=supportsEac3(videoTestElement);eAc3&&videoAudioCodecs.push("eac3");var supportsAc3InHls=!browser.edge||!browser.touch||browser.edgeUwp;supportsAc3InHls&&(hlsVideoAudioCodecs.push("ac3"),eAc3&&hlsVideoAudioCodecs.push("eac3"))}supportsMp3VideoAudio&&(videoAudioCodecs.push("mp3"),browser.ps4||physicalAudioChannels<=2&&hlsVideoAudioCodecs.push("mp3")),canPlayAacVideoAudio&&(videoAudioCodecs.indexOf("aac")===-1&&videoAudioCodecs.push("aac"),hlsVideoAudioCodecs.push("aac")),supportsMp3VideoAudio&&(browser.ps4||hlsVideoAudioCodecs.indexOf("mp3")===-1&&hlsVideoAudioCodecs.push("mp3")),supportsMp2VideoAudio&&videoAudioCodecs.push("mp2"),(browser.tizen||browser.orsay||browser.web0s||options.supportsDts)&&(videoAudioCodecs.push("dca"),videoAudioCodecs.push("dts")),(browser.tizen||browser.orsay)&&(videoAudioCodecs.push("pcm_s16le"),videoAudioCodecs.push("pcm_s24le")),options.supportsTrueHd&&videoAudioCodecs.push("truehd"),(browser.tizen||browser.orsay)&&videoAudioCodecs.push("aac_latm"),canPlayAudioFormat("opus")&&(videoAudioCodecs.push("opus"),hlsVideoAudioCodecs.push("opus")),canPlayAudioFormat("flac")&&videoAudioCodecs.push("flac"),videoAudioCodecs=videoAudioCodecs.filter(function(c){return(options.disableVideoAudioCodecs||[]).indexOf(c)===-1}),hlsVideoAudioCodecs=hlsVideoAudioCodecs.filter(function(c){return(options.disableHlsVideoAudioCodecs||[]).indexOf(c)===-1});var mp4VideoCodecs=[],hlsVideoCodecs=[];canPlayH264(videoTestElement)&&(mp4VideoCodecs.push("h264"),hlsVideoCodecs.push("h264")),canPlayH265(videoTestElement,options)&&(mp4VideoCodecs.push("h265"),mp4VideoCodecs.push("hevc"),browser.tizen&&(hlsVideoCodecs.push("h265"),hlsVideoCodecs.push("hevc"))),supportsMpeg2Video()&&mp4VideoCodecs.push("mpeg2video"),supportsVc1()&&mp4VideoCodecs.push("vc1"),(browser.tizen||browser.orsay)&&mp4VideoCodecs.push("msmpeg4v2"),canPlayVp8&&mp4VideoCodecs.push("vp8"),canPlayVp9&&mp4VideoCodecs.push("vp9"),(canPlayVp8||browser.tizen||browser.orsay)&&videoAudioCodecs.push("vorbis"),mp4VideoCodecs.length&&profile.DirectPlayProfiles.push({Container:"mp4,m4v",Type:"Video",VideoCodec:mp4VideoCodecs.join(","),AudioCodec:videoAudioCodecs.join(",")}),canPlayMkv&&mp4VideoCodecs.length&&profile.DirectPlayProfiles.push({Container:"mkv",Type:"Video",VideoCodec:mp4VideoCodecs.join(","),AudioCodec:videoAudioCodecs.join(",")}),["m2ts","wmv","ts","asf","avi","mpg","mpeg","flv","3gp","mts","trp","vob","vro","mov"].map(function(container){return getDirectPlayProfileForVideoContainer(container,videoAudioCodecs,videoTestElement,options)}).filter(function(i){return null!=i}).forEach(function(i){profile.DirectPlayProfiles.push(i)}),["opus","mp3","mp2","aac","flac","alac","webma","wma","wav","ogg","oga"].filter(canPlayAudioFormat).forEach(function(audioFormat){"mp2"===audioFormat?profile.DirectPlayProfiles.push({Container:"mp2,mp3",Type:"Audio",AudioCodec:audioFormat}):"mp3"===audioFormat?profile.DirectPlayProfiles.push({Container:audioFormat,Type:"Audio",AudioCodec:audioFormat}):profile.DirectPlayProfiles.push({Container:"webma"===audioFormat?"webma,webm":audioFormat,Type:"Audio"}),"aac"!==audioFormat&&"alac"!==audioFormat||profile.DirectPlayProfiles.push({Container:"m4a",AudioCodec:audioFormat,Type:"Audio"})}),canPlayVp8&&profile.DirectPlayProfiles.push({Container:"webm",Type:"Video",AudioCodec:"vorbis",VideoCodec:"VP8"}),canPlayVp9&&profile.DirectPlayProfiles.push({Container:"webm",Type:"Video",AudioCodec:"vorbis",VideoCodec:"VP9"}),profile.TranscodingProfiles=[];var hlsBreakOnNonKeyFrames=!(!(browser.iOS||browser.osx||browser.edge)&&canPlayNativeHls());canPlayHls()&&browser.enableHlsAudio!==!1&&profile.TranscodingProfiles.push({Container:!canPlayNativeHls()||browser.edge||browser.android?"ts":"aac",Type:"Audio",AudioCodec:"aac",Context:"Streaming",Protocol:"hls",MaxAudioChannels:physicalAudioChannels.toString(),MinSegments:browser.iOS||browser.osx?"2":"1",BreakOnNonKeyFrames:hlsBreakOnNonKeyFrames}),["aac","mp3","opus","wav"].filter(canPlayAudioFormat).forEach(function(audioFormat){profile.TranscodingProfiles.push({Container:audioFormat,Type:"Audio",AudioCodec:audioFormat,Context:"Streaming",Protocol:"http",MaxAudioChannels:physicalAudioChannels.toString()})}),["opus","mp3","aac","wav"].filter(canPlayAudioFormat).forEach(function(audioFormat){profile.TranscodingProfiles.push({Container:audioFormat,Type:"Audio",AudioCodec:audioFormat,Context:"Static",Protocol:"http",MaxAudioChannels:physicalAudioChannels.toString()})}),!canPlayMkv||browser.tizen||browser.orsay||options.enableMkvProgressive===!1||profile.TranscodingProfiles.push({Container:"mkv",Type:"Video",AudioCodec:videoAudioCodecs.join(","),VideoCodec:mp4VideoCodecs.join(","),Context:"Streaming",MaxAudioChannels:physicalAudioChannels.toString(),CopyTimestamps:!0}),canPlayMkv&&profile.TranscodingProfiles.push({Container:"mkv",Type:"Video",AudioCodec:videoAudioCodecs.join(","),VideoCodec:mp4VideoCodecs.join(","),Context:"Static",MaxAudioChannels:physicalAudioChannels.toString(),CopyTimestamps:!0}),canPlayHls()&&options.enableHls!==!1&&profile.TranscodingProfiles.push({Container:"ts",Type:"Video",AudioCodec:hlsVideoAudioCodecs.join(","),VideoCodec:hlsVideoCodecs.join(","),Context:"Streaming",Protocol:"hls",MaxAudioChannels:physicalAudioChannels.toString(),MinSegments:browser.iOS||browser.osx?"2":"1",BreakOnNonKeyFrames:hlsBreakOnNonKeyFrames}),canPlayVp8&&profile.TranscodingProfiles.push({Container:"webm",Type:"Video",AudioCodec:"vorbis",VideoCodec:"vpx",Context:"Streaming",Protocol:"http",MaxAudioChannels:physicalAudioChannels.toString()}),profile.TranscodingProfiles.push({Container:"mp4",Type:"Video",AudioCodec:videoAudioCodecs.join(","),VideoCodec:"h264",Context:"Static",Protocol:"http"}),profile.ContainerProfiles=[],profile.CodecProfiles=[];var supportsSecondaryAudio=browser.tizen||browser.orsay||browser.edge||browser.msie,aacCodecProfileConditions=[];videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.40.5"').replace(/no/,"")||aacCodecProfileConditions.push({Condition:"NotEquals",Property:"AudioProfile",Value:"HE-AAC"}),supportsSecondaryAudio||aacCodecProfileConditions.push({Condition:"Equals",Property:"IsSecondaryAudio",Value:"false",IsRequired:"false"}),browser.chromecast&&aacCodecProfileConditions.push({Condition:"LessThanEqual",Property:"AudioChannels",Value:"2",IsRequired:!0}),aacCodecProfileConditions.length&&profile.CodecProfiles.push({Type:"VideoAudio",Codec:"aac",Conditions:aacCodecProfileConditions}),supportsSecondaryAudio||profile.CodecProfiles.push({Type:"VideoAudio",Conditions:[{Condition:"Equals",Property:"IsSecondaryAudio",Value:"false",IsRequired:"false"}]});var maxH264Level=browser.chromecast?42:51,h264Profiles="high|main|baseline|constrained baseline";maxH264Level>=51&&browser.chrome&&!browser.osx&&(h264Profiles+="|high 10"),profile.CodecProfiles.push({Type:"Video",Codec:"h264",Conditions:[{Condition:"NotEquals",Property:"IsAnamorphic",Value:"true",IsRequired:!1},{Condition:"EqualsAny",Property:"VideoProfile",Value:h264Profiles},{Condition:"LessThanEqual",Property:"VideoLevel",Value:maxH264Level.toString()}]}),browser.edgeUwp||browser.tizen||browser.orsay||browser.web0s||(profile.CodecProfiles[profile.CodecProfiles.length-1].Conditions.push({Condition:"NotEquals",Property:"IsAVC",Value:"false",IsRequired:!1}),profile.CodecProfiles[profile.CodecProfiles.length-1].Conditions.push({Condition:"NotEquals",Property:"IsInterlaced",Value:"true",IsRequired:!1})),maxVideoWidth&&profile.CodecProfiles[profile.CodecProfiles.length-1].Conditions.push({Condition:"LessThanEqual",Property:"Width",Value:maxVideoWidth.toString(),IsRequired:!1});var globalMaxVideoBitrate=(getGlobalMaxVideoBitrate()||"").toString(),h264MaxVideoBitrate=globalMaxVideoBitrate;h264MaxVideoBitrate&&profile.CodecProfiles[profile.CodecProfiles.length-1].Conditions.push({Condition:"LessThanEqual",Property:"VideoBitrate",Value:h264MaxVideoBitrate,IsRequired:!0});var globalVideoConditions=[];return globalMaxVideoBitrate&&globalVideoConditions.push({Condition:"LessThanEqual",Property:"VideoBitrate",Value:globalMaxVideoBitrate}),maxVideoWidth&&globalVideoConditions.push({Condition:"LessThanEqual",Property:"Width",Value:maxVideoWidth.toString(),IsRequired:!1}),globalVideoConditions.length&&profile.CodecProfiles.push({Type:"Video",Conditions:globalVideoConditions}),browser.chromecast&&profile.CodecProfiles.push({Type:"Audio",Codec:"flac",Conditions:[{Condition:"LessThanEqual",Property:"AudioSampleRate",Value:"96000"}]}),profile.SubtitleProfiles=[],supportsTextTracks()&&profile.SubtitleProfiles.push({Format:"vtt",Method:"External"}),profile.ResponseProfiles=[],profile.ResponseProfiles.push({Type:"Video",Container:"m4v",MimeType:"video/mp4"}),profile}}); \ No newline at end of file +define(["browser"],function(browser){"use strict";function canPlayH264(videoTestElement){return!(!videoTestElement.canPlayType||!videoTestElement.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/,""))}function canPlayH265(videoTestElement,options){if(browser.tizen||browser.orsay||browser.xboxOne||browser.web0s||options.supportsHevc)return!0;var userAgent=navigator.userAgent.toLowerCase();if(browser.chromecast){if(-1!==userAgent.indexOf("aarch64"))return!0}return!!(browser.iOS&&(browser.iOSVersion||0)>=11)||!(!videoTestElement.canPlayType||!videoTestElement.canPlayType('video/hevc; codecs="hevc, aac"').replace(/no/,""))}function supportsTextTracks(){return!(!browser.tizen&&!browser.orsay)||(null==_supportsTextTracks&&(_supportsTextTracks=null!=document.createElement("video").textTracks),_supportsTextTracks)}function canPlayHls(src){return null==_canPlayHls&&(_canPlayHls=canPlayNativeHls()||canPlayHlsWithMSE()),_canPlayHls}function canPlayNativeHls(){if(browser.tizen||browser.orsay)return!0;var media=document.createElement("video");return!(!media.canPlayType("application/x-mpegURL").replace(/no/,"")&&!media.canPlayType("application/vnd.apple.mpegURL").replace(/no/,""))}function canPlayHlsWithMSE(){return null!=window.MediaSource}function canPlayAudioFormat(format){var typeString;if("flac"===format){if(browser.tizen||browser.orsay)return!0;if(browser.edgeUwp)return!0}else if("wma"===format){if(browser.tizen||browser.orsay)return!0;if(browser.edgeUwp)return!0}else{if("opus"===format)return typeString='audio/ogg; codecs="opus"',!!document.createElement("audio").canPlayType(typeString).replace(/no/,"");if("mp2"===format)return!1}if("webma"===format)typeString="audio/webm";else if("mp2"===format)typeString="audio/mpeg";else if("ogg"===format||"oga"===format){if(browser.chrome)return!1;typeString="audio/"+format}else typeString="audio/"+format;return!!document.createElement("audio").canPlayType(typeString).replace(/no/,"")}function testCanPlayMkv(videoTestElement){if(browser.tizen||browser.orsay||browser.web0s)return!0;if(videoTestElement.canPlayType("video/x-matroska").replace(/no/,"")||videoTestElement.canPlayType("video/mkv").replace(/no/,""))return!0;var userAgent=navigator.userAgent.toLowerCase();return browser.chrome?!browser.operaTv&&(-1===userAgent.indexOf("vivaldi")&&-1===userAgent.indexOf("opera")):!!browser.edgeUwp}function testCanPlayTs(){return browser.tizen||browser.orsay||browser.web0s||browser.edgeUwp}function supportsMpeg2Video(){return browser.orsay||browser.tizen||browser.edgeUwp||browser.web0s}function supportsVc1(){return browser.orsay||browser.tizen||browser.edgeUwp}function getDirectPlayProfileForVideoContainer(container,videoAudioCodecs,videoTestElement,options){var supported=!1,profileContainer=container,videoCodecs=[];switch(container){case"asf":supported=browser.tizen||browser.orsay||browser.edgeUwp,videoAudioCodecs=[];break;case"avi":supported=browser.tizen||browser.orsay||browser.edgeUwp;break;case"mpg":case"mpeg":supported=browser.edgeUwp||browser.tizen||browser.orsay;break;case"flv":supported=browser.tizen||browser.orsay;break;case"3gp":case"mts":case"trp":case"vob":case"vro":supported=browser.tizen||browser.orsay;break;case"mov":supported=browser.tizen||browser.orsay||browser.chrome||browser.edgeUwp,videoCodecs.push("h264");break;case"m2ts":supported=browser.tizen||browser.orsay||browser.web0s||browser.edgeUwp,videoCodecs.push("h264"),supportsVc1()&&videoCodecs.push("vc1"),supportsMpeg2Video()&&videoCodecs.push("mpeg2video");break;case"wmv":supported=browser.tizen||browser.orsay||browser.web0s||browser.edgeUwp,videoAudioCodecs=[];break;case"ts":supported=testCanPlayTs(),videoCodecs.push("h264"),canPlayH265(videoTestElement,options)&&(videoCodecs.push("h265"),videoCodecs.push("hevc")),supportsVc1()&&videoCodecs.push("vc1"),supportsMpeg2Video()&&videoCodecs.push("mpeg2video"),profileContainer="ts,mpegts"}return supported?{Container:profileContainer,Type:"Video",VideoCodec:videoCodecs.join(","),AudioCodec:videoAudioCodecs.join(",")}:null}function getGlobalMaxVideoBitrate(){var userAgent=navigator.userAgent.toLowerCase();if(browser.chromecast){return-1!==userAgent.indexOf("aarch64")?null:self.screen&&self.screen.width>=3800?null:3e7}var isTizenFhd=!1;if(browser.tizen)try{isTizenFhd=!webapis.productinfo.isUdPanelSupported(),console.log("isTizenFhd = "+isTizenFhd)}catch(error){console.log("isUdPanelSupported() error code = "+error.code)}return browser.ps4?8e6:browser.xboxOne?12e6:browser.edgeUwp?null:browser.tizen&&isTizenFhd?2e7:null}function supportsAc3(videoTestElement){return!!(browser.edgeUwp||browser.tizen||browser.orsay||browser.web0s)||videoTestElement.canPlayType('audio/mp4; codecs="ac-3"').replace(/no/,"")&&!browser.osx&&!browser.iOS}function supportsEac3(videoTestElement){return!!(browser.tizen||browser.orsay||browser.web0s)||videoTestElement.canPlayType('audio/mp4; codecs="ec-3"').replace(/no/,"")}var _supportsTextTracks,_canPlayHls;return function(options){options=options||{};var physicalAudioChannels=options.audioChannels||(browser.tv||browser.ps4||browser.xboxOne||browser.chromecast?6:2),videoTestElement=document.createElement("video"),canPlayVp8=videoTestElement.canPlayType('video/webm; codecs="vp8"').replace(/no/,""),canPlayVp9=videoTestElement.canPlayType('video/webm; codecs="vp9"').replace(/no/,""),canPlayMkv=testCanPlayMkv(videoTestElement),profile={};profile.MaxStreamingBitrate=12e7,profile.MaxStaticBitrate=1e8,profile.MusicStreamingTranscodingBitrate=Math.min(12e7,192e3),profile.DirectPlayProfiles=[];var videoAudioCodecs=[],hlsVideoAudioCodecs=[],supportsMp3VideoAudio=videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.69"').replace(/no/,"")||videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.6B"').replace(/no/,""),supportsMp2VideoAudio=browser.edgeUwp||browser.tizen||browser.orsay||browser.web0s,maxVideoWidth=browser.xboxOne&&self.screen?self.screen.width:null;options.maxVideoWidth&&(maxVideoWidth=options.maxVideoWidth);var canPlayAacVideoAudio=videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.40.2"').replace(/no/,"");if(canPlayAacVideoAudio&&browser.chromecast&&videoAudioCodecs.push("aac"),supportsAc3(videoTestElement)){videoAudioCodecs.push("ac3");var eAc3=supportsEac3(videoTestElement);eAc3&&videoAudioCodecs.push("eac3");(!browser.edge||!browser.touch||browser.edgeUwp)&&(hlsVideoAudioCodecs.push("ac3"),eAc3&&hlsVideoAudioCodecs.push("eac3"))}supportsMp3VideoAudio&&(videoAudioCodecs.push("mp3"),browser.ps4||physicalAudioChannels<=2&&hlsVideoAudioCodecs.push("mp3")),canPlayAacVideoAudio&&(-1===videoAudioCodecs.indexOf("aac")&&videoAudioCodecs.push("aac"),hlsVideoAudioCodecs.push("aac")),supportsMp3VideoAudio&&(browser.ps4||-1===hlsVideoAudioCodecs.indexOf("mp3")&&hlsVideoAudioCodecs.push("mp3")),supportsMp2VideoAudio&&videoAudioCodecs.push("mp2"),(browser.tizen||browser.orsay||browser.web0s||options.supportsDts)&&(videoAudioCodecs.push("dca"),videoAudioCodecs.push("dts")),(browser.tizen||browser.orsay)&&(videoAudioCodecs.push("pcm_s16le"),videoAudioCodecs.push("pcm_s24le")),options.supportsTrueHd&&videoAudioCodecs.push("truehd"),(browser.tizen||browser.orsay)&&videoAudioCodecs.push("aac_latm"),canPlayAudioFormat("opus")&&(videoAudioCodecs.push("opus"),hlsVideoAudioCodecs.push("opus")),canPlayAudioFormat("flac")&&videoAudioCodecs.push("flac"),videoAudioCodecs=videoAudioCodecs.filter(function(c){return-1===(options.disableVideoAudioCodecs||[]).indexOf(c)}),hlsVideoAudioCodecs=hlsVideoAudioCodecs.filter(function(c){return-1===(options.disableHlsVideoAudioCodecs||[]).indexOf(c)});var mp4VideoCodecs=[],hlsVideoCodecs=[];canPlayH264(videoTestElement)&&(mp4VideoCodecs.push("h264"),hlsVideoCodecs.push("h264")),canPlayH265(videoTestElement,options)&&(mp4VideoCodecs.push("h265"),mp4VideoCodecs.push("hevc"),browser.tizen&&(hlsVideoCodecs.push("h265"),hlsVideoCodecs.push("hevc"))),supportsMpeg2Video()&&mp4VideoCodecs.push("mpeg2video"),supportsVc1()&&mp4VideoCodecs.push("vc1"),(browser.tizen||browser.orsay)&&mp4VideoCodecs.push("msmpeg4v2"),canPlayVp8&&mp4VideoCodecs.push("vp8"),canPlayVp9&&mp4VideoCodecs.push("vp9"),(canPlayVp8||browser.tizen||browser.orsay)&&videoAudioCodecs.push("vorbis"),mp4VideoCodecs.length&&profile.DirectPlayProfiles.push({Container:"mp4,m4v",Type:"Video",VideoCodec:mp4VideoCodecs.join(","),AudioCodec:videoAudioCodecs.join(",")}),canPlayMkv&&mp4VideoCodecs.length&&profile.DirectPlayProfiles.push({Container:"mkv",Type:"Video",VideoCodec:mp4VideoCodecs.join(","),AudioCodec:videoAudioCodecs.join(",")}),["m2ts","wmv","ts","asf","avi","mpg","mpeg","flv","3gp","mts","trp","vob","vro","mov"].map(function(container){return getDirectPlayProfileForVideoContainer(container,videoAudioCodecs,videoTestElement,options)}).filter(function(i){return null!=i}).forEach(function(i){profile.DirectPlayProfiles.push(i)}),["opus","mp3","mp2","aac","flac","alac","webma","wma","wav","ogg","oga"].filter(canPlayAudioFormat).forEach(function(audioFormat){"mp2"===audioFormat?profile.DirectPlayProfiles.push({Container:"mp2,mp3",Type:"Audio",AudioCodec:audioFormat}):"mp3"===audioFormat?profile.DirectPlayProfiles.push({Container:audioFormat,Type:"Audio",AudioCodec:audioFormat}):profile.DirectPlayProfiles.push({Container:"webma"===audioFormat?"webma,webm":audioFormat,Type:"Audio"}),"aac"!==audioFormat&&"alac"!==audioFormat||profile.DirectPlayProfiles.push({Container:"m4a",AudioCodec:audioFormat,Type:"Audio"})}),canPlayVp8&&profile.DirectPlayProfiles.push({Container:"webm",Type:"Video",AudioCodec:"vorbis",VideoCodec:"VP8"}),canPlayVp9&&profile.DirectPlayProfiles.push({Container:"webm",Type:"Video",AudioCodec:"vorbis",VideoCodec:"VP9"}),profile.TranscodingProfiles=[];var hlsBreakOnNonKeyFrames=!(!(browser.iOS||browser.osx||browser.edge)&&canPlayNativeHls());canPlayHls()&&!1!==browser.enableHlsAudio&&profile.TranscodingProfiles.push({Container:!canPlayNativeHls()||browser.edge||browser.android?"ts":"aac",Type:"Audio",AudioCodec:"aac",Context:"Streaming",Protocol:"hls",MaxAudioChannels:physicalAudioChannels.toString(),MinSegments:browser.iOS||browser.osx?"2":"1",BreakOnNonKeyFrames:hlsBreakOnNonKeyFrames}),["aac","mp3","opus","wav"].filter(canPlayAudioFormat).forEach(function(audioFormat){profile.TranscodingProfiles.push({Container:audioFormat,Type:"Audio",AudioCodec:audioFormat,Context:"Streaming",Protocol:"http",MaxAudioChannels:physicalAudioChannels.toString()})}),["opus","mp3","aac","wav"].filter(canPlayAudioFormat).forEach(function(audioFormat){profile.TranscodingProfiles.push({Container:audioFormat,Type:"Audio",AudioCodec:audioFormat,Context:"Static",Protocol:"http",MaxAudioChannels:physicalAudioChannels.toString()})}),!canPlayMkv||browser.tizen||browser.orsay||!1===options.enableMkvProgressive||profile.TranscodingProfiles.push({Container:"mkv",Type:"Video",AudioCodec:videoAudioCodecs.join(","),VideoCodec:mp4VideoCodecs.join(","),Context:"Streaming",MaxAudioChannels:physicalAudioChannels.toString(),CopyTimestamps:!0}),canPlayMkv&&profile.TranscodingProfiles.push({Container:"mkv",Type:"Video",AudioCodec:videoAudioCodecs.join(","),VideoCodec:mp4VideoCodecs.join(","),Context:"Static",MaxAudioChannels:physicalAudioChannels.toString(),CopyTimestamps:!0}),canPlayHls()&&!1!==options.enableHls&&profile.TranscodingProfiles.push({Container:"ts",Type:"Video",AudioCodec:hlsVideoAudioCodecs.join(","),VideoCodec:hlsVideoCodecs.join(","),Context:"Streaming",Protocol:"hls",MaxAudioChannels:physicalAudioChannels.toString(),MinSegments:browser.iOS||browser.osx?"2":"1",BreakOnNonKeyFrames:hlsBreakOnNonKeyFrames}),canPlayVp8&&profile.TranscodingProfiles.push({Container:"webm",Type:"Video",AudioCodec:"vorbis",VideoCodec:"vpx",Context:"Streaming",Protocol:"http",MaxAudioChannels:physicalAudioChannels.toString()}),profile.TranscodingProfiles.push({Container:"mp4",Type:"Video",AudioCodec:videoAudioCodecs.join(","),VideoCodec:"h264",Context:"Static",Protocol:"http"}),profile.ContainerProfiles=[],profile.CodecProfiles=[];var supportsSecondaryAudio=browser.tizen||browser.orsay||browser.edge||browser.msie,aacCodecProfileConditions=[];videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.40.5"').replace(/no/,"")||aacCodecProfileConditions.push({Condition:"NotEquals",Property:"AudioProfile",Value:"HE-AAC"}),supportsSecondaryAudio||aacCodecProfileConditions.push({Condition:"Equals",Property:"IsSecondaryAudio",Value:"false",IsRequired:"false"}),browser.chromecast&&aacCodecProfileConditions.push({Condition:"LessThanEqual",Property:"AudioChannels",Value:"2",IsRequired:!0}),aacCodecProfileConditions.length&&profile.CodecProfiles.push({Type:"VideoAudio",Codec:"aac",Conditions:aacCodecProfileConditions}),supportsSecondaryAudio||profile.CodecProfiles.push({Type:"VideoAudio",Conditions:[{Condition:"Equals",Property:"IsSecondaryAudio",Value:"false",IsRequired:"false"}]});var maxH264Level=browser.chromecast?42:51,h264Profiles="high|main|baseline|constrained baseline";maxH264Level>=51&&browser.chrome&&!browser.osx&&(h264Profiles+="|high 10"),profile.CodecProfiles.push({Type:"Video",Codec:"h264",Conditions:[{Condition:"NotEquals",Property:"IsAnamorphic",Value:"true",IsRequired:!1},{Condition:"EqualsAny",Property:"VideoProfile",Value:h264Profiles},{Condition:"LessThanEqual",Property:"VideoLevel",Value:maxH264Level.toString()}]}),browser.edgeUwp||browser.tizen||browser.orsay||browser.web0s||(profile.CodecProfiles[profile.CodecProfiles.length-1].Conditions.push({Condition:"NotEquals",Property:"IsAVC",Value:"false",IsRequired:!1}),profile.CodecProfiles[profile.CodecProfiles.length-1].Conditions.push({Condition:"NotEquals",Property:"IsInterlaced",Value:"true",IsRequired:!1})),maxVideoWidth&&profile.CodecProfiles[profile.CodecProfiles.length-1].Conditions.push({Condition:"LessThanEqual",Property:"Width",Value:maxVideoWidth.toString(),IsRequired:!1});var globalMaxVideoBitrate=(getGlobalMaxVideoBitrate()||"").toString(),h264MaxVideoBitrate=globalMaxVideoBitrate;h264MaxVideoBitrate&&profile.CodecProfiles[profile.CodecProfiles.length-1].Conditions.push({Condition:"LessThanEqual",Property:"VideoBitrate",Value:h264MaxVideoBitrate,IsRequired:!0});var globalVideoConditions=[];return globalMaxVideoBitrate&&globalVideoConditions.push({Condition:"LessThanEqual",Property:"VideoBitrate",Value:globalMaxVideoBitrate}),maxVideoWidth&&globalVideoConditions.push({Condition:"LessThanEqual",Property:"Width",Value:maxVideoWidth.toString(),IsRequired:!1}),globalVideoConditions.length&&profile.CodecProfiles.push({Type:"Video",Conditions:globalVideoConditions}),browser.chromecast&&profile.CodecProfiles.push({Type:"Audio",Codec:"flac",Conditions:[{Condition:"LessThanEqual",Property:"AudioSampleRate",Value:"96000"}]}),profile.SubtitleProfiles=[],supportsTextTracks()&&profile.SubtitleProfiles.push({Format:"vtt",Method:"External"}),profile.ResponseProfiles=[],profile.ResponseProfiles.push({Type:"Video",Container:"m4v",MimeType:"video/mp4"}),profile}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js index 5fc116a754..cda5577916 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js +++ b/MediaBrowser.WebDashboard/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","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,isOrientationLandscape){switch(shape){case"portrait":return layoutManager.tv?5.9999999988:screenWidth>=2200?10:screenWidth>=1920?9.000000000009:screenWidth>=1600?8:screenWidth>=1400?7.0000000000021:screenWidth>=1200?5.9999999988:screenWidth>=800?5:screenWidth>=700?4:3.0000000003;case"square":return layoutManager.tv?5.9999999988:screenWidth>=2200?10:screenWidth>=1920?9.000000000009:screenWidth>=1600?8:screenWidth>=1400?7.0000000000021:screenWidth>=1200?5.9999999988:screenWidth>=800?5:screenWidth>=700?4:screenWidth>=500?3.0000000003:2;case"banner":return screenWidth>=2200?4:screenWidth>=1200?3.0000000003:screenWidth>=800?2:1;case"backdrop":return layoutManager.tv?4:screenWidth>=2500?6:screenWidth>=1600?5:screenWidth>=1200?4:screenWidth>=770?3:screenWidth>=420?2:1;case"smallBackdrop":return screenWidth>=1600?8:screenWidth>=1400?7.000000000007001:screenWidth>=1200?6:screenWidth>=1e3?5:screenWidth>=800?4:screenWidth>=500?3.0000000003:2;case"overflowSmallBackdrop":return layoutManager.tv?100/18.9:isOrientationLandscape?screenWidth>=800?100/15.5:100/23.3:screenWidth>=540?100/30:100/72;case"overflowPortrait":return layoutManager.tv?100/15.5:isOrientationLandscape?screenWidth>=1700?100/11.6:100/15.5:screenWidth>=1400?100/15:screenWidth>=1200?100/18:screenWidth>=760?100/23:screenWidth>=400?100/31.5:100/42;case"overflowSquare":return layoutManager.tv?100/15.5:isOrientationLandscape?screenWidth>=1700?100/11.6:100/15.5:screenWidth>=1400?100/15:screenWidth>=1200?100/18:screenWidth>=760?100/23:screenWidth>=540?100/31.5:100/42;case"overflowBackdrop":return layoutManager.tv?100/23.3:isOrientationLandscape?screenWidth>=1700?100/18.5:100/23.3:screenWidth>=1800?100/23.5:screenWidth>=1400?100/30:screenWidth>=760?2.5:screenWidth>=640?100/56: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,screenWidth,isOrientationLandscape){var imagesPerRow=getPostersPerRow(shape,screenWidth,isOrientationLandscape),shapeWidth=screenWidth/imagesPerRow;return Math.round(shapeWidth)}function setCardData(items,options){options.shape=options.shape||"auto";var primaryImageAspectRatio=imageLoader.getPrimaryImageAspectRatio(items);if("auto"===options.shape||"autohome"===options.shape||"autooverflow"===options.shape||"autoVertical"===options.shape){var requestedShape=options.shape;options.shape=null,primaryImageAspectRatio&&(primaryImageAspectRatio>=3?(options.shape="banner",options.coverImage=!0):primaryImageAspectRatio>=1.33?options.shape="autooverflow"===requestedShape?"overflowBackdrop":"backdrop":primaryImageAspectRatio>.71?options.shape="autooverflow"===requestedShape?"overflowSquare":"square":options.shape="autooverflow"===requestedShape?"overflowPortrait":"portrait"),options.shape||(options.shape=options.defaultShape||("autooverflow"===requestedShape?"overflowSquare":"square"))}if("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]),!options.width){var screenWidth=dom.getWindowSize().innerWidth,screenHeight=dom.getWindowSize().innerHeight;if(isResizable(screenWidth)){var roundScreenTo=100;screenWidth=Math.floor(screenWidth/roundScreenTo)*roundScreenTo}options.width=getImageWidth(options.shape,screenWidth,screenWidth>1.3*screenHeight)}}function buildCardsHtmlInternal(items,options){var isVertical;"autoVertical"===options.shape&&(isVertical=!0),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||0;i ':'
 
';if(options.leadingButtons)for(i=0,length=options.leadingButtons.length;i',cardBoxClass="cardBox";enableFocusTransfrom&&(cardBoxClass+=" cardBox-focustransform"),cardFooterHtml&&(cardBoxClass+=" cardBox-bottompadded");var cardScalableClass="cardScalable card-focuscontent";cardScalableClass+=" card-focuscontent",enableFocusTransfrom||(cardScalableClass+=" card-focuscontent-large"),html+='
';var icon="";return buttonInfo.icon&&(icon=''+buttonInfo.icon+""),html+='
'+icon+'
'+buttonInfo.name+"
",html+=cardFooterHtml,html+="
",html+=buttonInfo.routeUrl?"
":""}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||"banner"===shape)&&item.ImageTags&&item.ImageTags.Banner?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Banner",maxWidth:width,tag:item.ImageTags.Banner}):options.preferDisc&&item.ImageTags&&item.ImageTags.Disc?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Disc",maxWidth:width,tag:item.ImageTags.Disc}):options.preferLogo&&item.ImageTags&&item.ImageTags.Logo?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Logo",maxWidth:width,tag:item.ImageTags.Logo}):options.preferLogo&&item.ParentLogoImageTag&&item.ParentLogoItemId?imgUrl=apiClient.getScaledImageUrl(item.ParentLogoItemId,{type:"Logo",maxWidth:width,tag:item.ParentLogoImageTag}):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":0===valid&&isOuterFooter&&(currentCssClass+=" cardText-first"),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,logoUrl,isOuterFooter){var html="";logoUrl&&(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})):lines.push(item.SeriesName);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+=""),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 getDefaultBackgroundClass(str){return"defaultCardBackground defaultCardBackground"+getDefaultColorIndex(str)}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),enableFocusTransfrom&&layoutManager.tv||(className+=" card-nofocustransform");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+=" "+getDefaultBackgroundClass(item.Name));var cardBoxClass=options.cardLayout?"cardBox visualCardBox":"cardBox";layoutManager.tv&&(enableFocusTransfrom&&(cardBoxClass+=" cardBox-focustransform"),options.cardLayout&&(cardBoxClass+=" card-focuscontent",enableFocusTransfrom||(cardBoxClass+=" card-focuscontent-large")));var footerCssClass,logoUrl,progressHtml=indicators.getProgressBarHtml(item),innerCardFooter="",footerOverlayed=!1,logoHeight=40;options.showChannelLogo&&item.ChannelPrimaryImageTag?logoUrl=apiClient.getScaledImageUrl(item.ChannelId,{type:"Primary",height:logoHeight,tag:item.ChannelPrimaryImageTag}):options.showLogo&&item.ParentLogoImageTag&&(logoUrl=apiClient.getScaledImageUrl(item.ParentLogoItemId,{type:"Logo",height:logoHeight,tag:item.ParentLogoImageTag})),overlayText?(logoUrl=null,footerCssClass=progressHtml?"innerCardFooter fullInnerCardFooter":"innerCardFooter",innerCardFooter+=getCardFooterText(item,apiClient,options,showTitle,forceName,overlayText,imgUrl,footerCssClass,progressHtml,logoUrl,!1),footerOverlayed=!0):progressHtml&&(innerCardFooter+='
',innerCardFooter+=progressHtml,innerCardFooter+="
",progressHtml="");var mediaSourceCount=item.MediaSourceCount||1;mediaSourceCount>1&&(innerCardFooter+='
'+mediaSourceCount+"
");var outerCardFooter="";overlayText||footerOverlayed||(footerCssClass=options.cardLayout?"cardFooter":"cardFooter cardFooter-transparent",logoUrl&&(footerCssClass+=" cardFooter-withlogo"),options.cardLayout||(logoUrl=null),outerCardFooter=getCardFooterText(item,apiClient,options,showTitle,forceName,overlayText,imgUrl,footerCssClass,progressHtml,logoUrl,!0)),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,cardImageContainerClose="",cardBoxClose="",cardScalableClose="",cardContentClass="cardContent";options.cardLayout||(cardContentClass+=" cardContent-shadow"),layoutManager.tv?(cardImageContainerOpen=imgUrl?'
",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||0;i ':'
 
';if(options.leadingButtons)for(i=0,length=options.leadingButtons.length;i',cardBoxClass="cardBox";enableFocusTransfrom&&(cardBoxClass+=" cardBox-focustransform"),cardFooterHtml&&(cardBoxClass+=" cardBox-bottompadded");var cardScalableClass="cardScalable card-focuscontent";cardScalableClass+=" card-focuscontent",enableFocusTransfrom||(cardScalableClass+=" card-focuscontent-large"),html+='
';var icon="";return buttonInfo.icon&&(icon=''+buttonInfo.icon+""),html+='
'+icon+'
'+buttonInfo.name+"
",html+=cardFooterHtml,html+="
",buttonInfo.routeUrl?html+="":html+="",html}function getDesiredAspect(shape){if(shape){if(shape=shape.toLowerCase(),-1!==shape.indexOf("portrait"))return 2/3;if(-1!==shape.indexOf("backdrop"))return 16/9;if(-1!==shape.indexOf("square"))return 1;if(-1!==shape.indexOf("banner"))return 1e3/185}return null}function getCardImageUrl(item,apiClient,options,shape){item=item.ProgramInfo||item;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||"banner"===shape)&&item.ImageTags&&item.ImageTags.Banner?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Banner",maxWidth:width,tag:item.ImageTags.Banner}):options.preferDisc&&item.ImageTags&&item.ImageTags.Disc?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Disc",maxWidth:width,tag:item.ImageTags.Disc}):options.preferLogo&&item.ImageTags&&item.ImageTags.Logo?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Logo",maxWidth:width,tag:item.ImageTags.Logo}):options.preferLogo&&item.ParentLogoImageTag&&item.ParentLogoItemId?imgUrl=apiClient.getScaledImageUrl(item.ParentLogoItemId,{type:"Logo",maxWidth:width,tag:item.ParentLogoImageTag}):options.preferThumb&&item.SeriesThumbImageTag&&!1!==options.inheritThumb?imgUrl=apiClient.getScaledImageUrl(item.SeriesId,{type:"Thumb",maxWidth:width,tag:item.SeriesThumbImageTag}):options.preferThumb&&item.ParentThumbItemId&&!1!==options.inheritThumb&&"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&&!1!==options.inheritThumb&&"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&&!1!==options.showTitle&&(forceName=!0),primaryImageAspectRatio&&(uiAspect=getDesiredAspect(shape))&&(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&&!1!==options.showTitle&&(forceName=!0),primaryImageAspectRatio&&(uiAspect=getDesiredAspect(shape))&&(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))&&(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&&!1!==options.inheritThumb?imgUrl=apiClient.getScaledImageUrl(item.SeriesId,{type:"Thumb",maxWidth:width,tag:item.SeriesThumbImageTag}):item.ParentThumbItemId&&!1!==options.inheritThumb?imgUrl=apiClient.getScaledImageUrl(item.ParentThumbItemId,{type:"Thumb",maxWidth:width,tag:item.ParentThumbImageTag}):item.ParentBackdropImageTags&&item.ParentBackdropImageTags.length&&!1!==options.inheritThumb&&(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":0===valid&&isOuterFooter&&(currentCssClass+=" cardText-first"),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,logoUrl,isOuterFooter){var html="";logoUrl&&(html+='');var showOtherText=isOuterFooter?!overlayText:overlayText;if(isOuterFooter&&options.cardLayout&&!layoutManager.tv&&"none"!==options.cardFooterAside){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})):lines.push(item.SeriesName);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+=""),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 getDefaultBackgroundClass(str){return"defaultCardBackground defaultCardBackground"+getDefaultColorIndex(str)}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),enableFocusTransfrom&&layoutManager.tv||(className+=" card-nofocustransform");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";(options.coverImage||imgInfo.coverImage)&&(cardImageContainerClass+=" coveredImage",("Photo"===item.MediaType||"PhotoAlbum"===item.Type||"Folder"===item.Type||item.ProgramInfo||"Program"===item.Type||"Recording"===item.Type)&&(cardImageContainerClass+=" coveredImage-noScale")),imgUrl||(cardImageContainerClass+=" "+getDefaultBackgroundClass(item.Name));var cardBoxClass=options.cardLayout?"cardBox visualCardBox":"cardBox";layoutManager.tv&&(enableFocusTransfrom&&(cardBoxClass+=" cardBox-focustransform"),options.cardLayout&&(cardBoxClass+=" card-focuscontent",enableFocusTransfrom||(cardBoxClass+=" card-focuscontent-large")));var footerCssClass,logoUrl,progressHtml=indicators.getProgressBarHtml(item),innerCardFooter="",footerOverlayed=!1;options.showChannelLogo&&item.ChannelPrimaryImageTag?logoUrl=apiClient.getScaledImageUrl(item.ChannelId,{type:"Primary",height:40,tag:item.ChannelPrimaryImageTag}):options.showLogo&&item.ParentLogoImageTag&&(logoUrl=apiClient.getScaledImageUrl(item.ParentLogoItemId,{type:"Logo",height:40,tag:item.ParentLogoImageTag})),overlayText?(logoUrl=null,footerCssClass=progressHtml?"innerCardFooter fullInnerCardFooter":"innerCardFooter",innerCardFooter+=getCardFooterText(item,apiClient,options,showTitle,forceName,overlayText,imgUrl,footerCssClass,progressHtml,logoUrl,!1),footerOverlayed=!0):progressHtml&&(innerCardFooter+='
',innerCardFooter+=progressHtml,innerCardFooter+="
",progressHtml="");var mediaSourceCount=item.MediaSourceCount||1;mediaSourceCount>1&&(innerCardFooter+='
'+mediaSourceCount+"
");var outerCardFooter="";overlayText||footerOverlayed||(footerCssClass=options.cardLayout?"cardFooter":"cardFooter cardFooter-transparent",logoUrl&&(footerCssClass+=" cardFooter-withlogo"),options.cardLayout||(logoUrl=null),outerCardFooter=getCardFooterText(item,apiClient,options,showTitle,forceName,overlayText,imgUrl,footerCssClass,progressHtml,logoUrl,!0)),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){overlayButtons+='"}options.overlayInfoButton&&(overlayButtons+='')}options.showChildCountIndicator&&item.ChildCount&&(className+=" groupedCard");var cardImageContainerOpen,cardImageContainerClose="",cardBoxClose="",cardScalableClose="",cardContentClass="cardContent";options.cardLayout||(cardContentClass+=" cardContent-shadow"),layoutManager.tv?(cardImageContainerOpen=imgUrl?'
':'
',cardImageContainerClose="
"):(cardImageContainerOpen=imgUrl?'");var cardScalableClass="cardScalable";layoutManager.tv&&!options.cardLayout&&(cardScalableClass+=" card-focuscontent",enableFocusTransfrom||(cardScalableClass+=" card-focuscontent-large")),cardImageContainerOpen='
'+cardImageContainerOpen,cardBoxClose="
",cardScalableClose="
";var indicatorsHtml="";if(!1!==options.missingIndicator&&(indicatorsHtml+=indicators.getMissingIndicator(item)),indicatorsHtml+=indicators.getSyncIndicator(item),indicatorsHtml+=indicators.getTimerIndicator(item),indicatorsHtml+=indicators.getTypeIndicator(item),options.showGroupCount?indicatorsHtml+=indicators.getChildCountIndicatorHtml(item,{minCount:1}):indicatorsHtml+=indicators.getPlayedIndicatorHtml(item),"CollectionFolder"===item.Type||item.CollectionType){indicatorsHtml+='
',requireRefreshIndicator()}indicatorsHtml&&(cardImageContainerOpen+='
'+indicatorsHtml+"
"),imgUrl||(cardImageContainerOpen+=getCardDefaultText(item,options));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+overlayButtons+cardScalableClose+outerCardFooter+cardBoxClose+""}function getCardDefaultText(item,options){var collectionType=item.CollectionType;return"livetv"===collectionType?'':"homevideos"===collectionType||"photos"===collectionType?'':"music"===collectionType?'':"MusicAlbum"===item.Type?'':"MusicArtist"===item.Type||"Person"===item.Type?'':options.defaultCardImageIcon?''+options.defaultCardImageIcon+"":'
'+(isUsingLiveTvNaming(item)?item.Name:itemHelper.getDisplayName(item))+"
"}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"))){ +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.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.parentNode.removeChild(countIndicator);var progressHtml=indicators.getProgressBarHtml({Type:type,UserData:userData,MediaType:"Video"});if(progressHtml){if(!(itemProgressBar=card.querySelector(".itemProgressBar"))){itemProgressBar=document.createElement("div"),itemProgressBar.classList.add("itemProgressBar");var innerCardFooter=card.querySelector(".innerCardFooter");if(!innerCardFooter){innerCardFooter=document.createElement("div"),innerCardFooter.classList.add("innerCardFooter");card.querySelector(".cardImageContainer").appendChild(innerCardFooter)}innerCardFooter.appendChild(itemProgressBar)}itemProgressBar.innerHTML=progressHtml}else(itemProgressBar=card.querySelector(".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');var chapter=chapters[i];html+=buildChapterCard(item,apiClient,chapter,i,options,className,shape),itemsInRow++,options.rows&&itemsInRow>=options.rows&&(itemsInRow=0,html+="
")}return html}function getImgUrl(item,chapter,index,maxWidth,apiClient){return chapter.ImageTag?apiClient.getScaledImageUrl(item.Id,{maxWidth:maxWidth,tag:chapter.ImageTag,type:"Chapter",index:index}):null}function buildChapterCard(item,apiClient,chapter,index,options,className,shape){var imgUrl=getImgUrl(item,chapter,index,options.width||400,apiClient),cardImageContainerClass="cardContent cardContent-shadow cardImageContainer chapterCardImageContainer";options.coverImage&&(cardImageContainerClass+=" coveredImage");var dataAttributes=' data-action="play" data-isfolder="'+item.IsFolder+'" data-id="'+item.Id+'" data-serverid="'+item.ServerId+'" data-type="'+item.Type+'" data-mediatype="'+item.MediaType+'" data-positionticks="'+chapter.StartPositionTicks+'"',cardImageContainer=imgUrl?'
':'
';imgUrl||(cardImageContainer+='local_movies');var nameHtml="";nameHtml+='
'+chapter.Name+"
",nameHtml+='
'+datetime.getDisplayRunningTime(chapter.StartPositionTicks)+"
";var cardBoxCssClass="cardBox",cardScalableClass="cardScalable";if(layoutManager.tv){var enableFocusTransfrom=!browser.slow&&!browser.xboxOne&&!browser.edgeUwp;cardScalableClass+=" card-focuscontent",enableFocusTransfrom?cardBoxCssClass+=" cardBox-focustransform":cardScalableClass+=" card-focuscontent-large"}var html='
";return html}function buildChapterCards(item,chapters,options){if(options.parentContainer){if(!document.body.contains(options.parentContainer))return;if(!chapters.length)return void options.parentContainer.classList.add("hide");options.parentContainer.classList.remove("hide")}var html=buildChapterCardsHtml(item,chapters,options);options.itemsContainer.innerHTML=html,imageLoader.lazyChildren(options.itemsContainer)}return{buildChapterCards:buildChapterCards}}); \ No newline at end of file +define(["datetime","imageLoader","connectionManager","layoutManager","browser"],function(datetime,imageLoader,connectionManager,layoutManager,browser){"use strict";function buildChapterCardsHtml(item,chapters,options){var className="card itemAction chapterCard";layoutManager.tv&&(browser.animate||browser.edge)&&(className+=" card-focusscale");var mediaStreams=((item.MediaSources||[])[0]||{}).MediaStreams||[],videoStream=mediaStreams.filter(function(i){return"Video"===i.Type})[0]||{},shape=options.backdropShape||"backdrop";videoStream.Width&&videoStream.Height&&videoStream.Width/videoStream.Height<=1.2&&(shape=options.squareShape||"square"),className+=" "+shape+"Card",(options.block||options.rows)&&(className+=" block");for(var html="",itemsInRow=0,apiClient=connectionManager.getApiClient(item.ServerId),i=0,length=chapters.length;i');html+=buildChapterCard(item,apiClient,chapters[i],i,options,className,shape),itemsInRow++,options.rows&&itemsInRow>=options.rows&&(itemsInRow=0,html+="
")}return html}function getImgUrl(item,chapter,index,maxWidth,apiClient){return chapter.ImageTag?apiClient.getScaledImageUrl(item.Id,{maxWidth:maxWidth,tag:chapter.ImageTag,type:"Chapter",index:index}):null}function buildChapterCard(item,apiClient,chapter,index,options,className,shape){var imgUrl=getImgUrl(item,chapter,index,options.width||400,apiClient),cardImageContainerClass="cardContent cardContent-shadow cardImageContainer chapterCardImageContainer";options.coverImage&&(cardImageContainerClass+=" coveredImage");var dataAttributes=' data-action="play" data-isfolder="'+item.IsFolder+'" data-id="'+item.Id+'" data-serverid="'+item.ServerId+'" data-type="'+item.Type+'" data-mediatype="'+item.MediaType+'" data-positionticks="'+chapter.StartPositionTicks+'"',cardImageContainer=imgUrl?'
':'
';imgUrl||(cardImageContainer+='local_movies');var nameHtml="";nameHtml+='
'+chapter.Name+"
",nameHtml+='
'+datetime.getDisplayRunningTime(chapter.StartPositionTicks)+"
";var cardBoxCssClass="cardBox",cardScalableClass="cardScalable";if(layoutManager.tv){var enableFocusTransfrom=!browser.slow&&!browser.edge;cardScalableClass+=" card-focuscontent",enableFocusTransfrom?cardBoxCssClass+=" cardBox-focustransform":cardScalableClass+=" card-focuscontent-large"}return'
"}function buildChapterCards(item,chapters,options){if(options.parentContainer){if(!document.body.contains(options.parentContainer))return;if(!chapters.length)return void options.parentContainer.classList.add("hide");options.parentContainer.classList.remove("hide")}var html=buildChapterCardsHtml(item,chapters,options);options.itemsContainer.innerHTML=html,imageLoader.lazyChildren(options.itemsContainer)}return{buildChapterCards:buildChapterCards}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/chromecast/chromecasthelpers.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/chromecast/chromecasthelpers.js index 5fa9a600d3..45b034b1e6 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/chromecast/chromecasthelpers.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/chromecast/chromecasthelpers.js @@ -1 +1 @@ -define(["events"],function(events){"use strict";function isValidIpAddress(address){var links=LinkParser.parse(address);return 1==links.length}function isLocalIpAddress(address){return address=address.toLowerCase(),address.indexOf("127.0.0.1")!==-1||address.indexOf("localhost")!==-1}function getServerAddress(apiClient){var serverAddress=apiClient.serverAddress();if(isValidIpAddress(serverAddress)&&!isLocalIpAddress(serverAddress))return Promise.resolve(serverAddress);var cachedValue=getCachedValue(serverAddress);return cachedValue?Promise.resolve(cachedValue):apiClient.getEndpointInfo().then(function(endpoint){return endpoint.IsInNetwork?apiClient.getPublicSystemInfo().then(function(info){return addToCache(serverAddress,info.LocalAddress),info.LocalAddress}):(addToCache(serverAddress,serverAddress),serverAddress)})}function clearCache(){cache={}}function addToCache(key,value){cache[key]={value:value,time:(new Date).getTime()}}function getCachedValue(key){var obj=cache[key];return obj&&(new Date).getTime()-obj.time<18e4?obj.value:null}!function(){function ensureProtocol(url){return url.match(protocolRegExp)||(url="http://"+url),url}var protocols="(?:(?:http|https|rtsp|ftp):\\/\\/)",credentials="(?:(?:[a-z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-f0-9]{2})){1,64}(?:\\:(?:[a-z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-f0-9]{2})){1,25})?\\@)",ipv6="((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?",ipv4="(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])",linkRegExpString="(?:"+protocols+"?"+credentials+"?(?:"+ipv6+"|"+ipv4+"))(?:\\:\\d{1,5})?(?:\\/(?:(?:[a-z0-9\\/\\@\\&\\#\\~\\*\\_\\-\\+])|(?:\\%[a-f0-9]{2})|(?:[\\;\\?\\:\\.\\!\\'\\(\\)\\,\\=]+(?=(?:[a-z0-9\\/\\@\\&\\#\\~\\*\\_\\-\\+])|(?:\\%[a-f0-9]{2}))))*|\\b|$)",linkRegExp=RegExp(linkRegExpString,"gi"),protocolRegExp=RegExp("^"+protocols,"i"),LinkParser={parse:function(text){for(var match,links=[];match=linkRegExp.exec(text);){var txt=match[0],pos=match.index,len=txt.length,url=ensureProtocol(text);links.push({pos:pos,text:txt,len:len,url:url})}return links}};window.LinkParser=LinkParser}();var cache={};return events.on(ConnectionManager,"localusersignedin",clearCache),events.on(ConnectionManager,"localusersignedout",clearCache),{getServerAddress:getServerAddress}}); \ No newline at end of file +define(["events"],function(events){"use strict";function isValidIpAddress(address){return 1==LinkParser.parse(address).length}function isLocalIpAddress(address){return address=address.toLowerCase(),-1!==address.indexOf("127.0.0.1")||-1!==address.indexOf("localhost")}function getServerAddress(apiClient){var serverAddress=apiClient.serverAddress();if(isValidIpAddress(serverAddress)&&!isLocalIpAddress(serverAddress))return Promise.resolve(serverAddress);var cachedValue=getCachedValue(serverAddress);return cachedValue?Promise.resolve(cachedValue):apiClient.getEndpointInfo().then(function(endpoint){return endpoint.IsInNetwork?apiClient.getPublicSystemInfo().then(function(info){return addToCache(serverAddress,info.LocalAddress),info.LocalAddress}):(addToCache(serverAddress,serverAddress),serverAddress)})}function clearCache(){cache={}}function addToCache(key,value){cache[key]={value:value,time:(new Date).getTime()}}function getCachedValue(key){var obj=cache[key];return obj&&(new Date).getTime()-obj.time<18e4?obj.value:null}!function(){function ensureProtocol(url){return url.match(protocolRegExp)||(url="http://"+url),url}var protocols="(?:(?:http|https|rtsp|ftp):\\/\\/)",linkRegExp=RegExp("(?:(?:(?:http|https|rtsp|ftp):\\/\\/)?(?:(?:[a-z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-f0-9]{2})){1,64}(?:\\:(?:[a-z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-f0-9]{2})){1,25})?\\@)?(?:((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})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Exp("^"+protocols,"i"),LinkParser={parse:function(text){for(var match,links=[];match=linkRegExp.exec(text);){var txt=match[0],pos=match.index,len=txt.length,url=ensureProtocol(text);links.push({pos:pos,text:txt,len:len,url:url})}return links}};window.LinkParser=LinkParser}();var cache={};return events.on(ConnectionManager,"localusersignedin",clearCache),events.on(ConnectionManager,"localusersignedout",clearCache),{getServerAddress:getServerAddress}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/chromecast/chromecastplayer.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/chromecast/chromecastplayer.js index e0a1434b8f..83ee3062e5 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/chromecast/chromecastplayer.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/chromecast/chromecastplayer.js @@ -1 +1 @@ -define(["appSettings","userSettings","playbackManager","connectionManager","globalize","events","require","castSenderApiLoader"],function(appSettings,userSettings,playbackManager,connectionManager,globalize,events,require,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 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)}}function getItemsForPlayback(apiClient,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",query.EnableTotalRecordCount=!1,apiClient.getItems(userId,query))}function bindEventForRelay(instance,eventName){events.on(instance._castPlayer,eventName,function(e,data){var state=instance.getPlayerStateInternal(data);events.trigger(instance,eventName,[state])})}function initializeChromecast(){var instance=this;instance._castPlayer=new CastPlayer,document.dispatchEvent(new CustomEvent("chromecastloaded",{detail:{player:instance}})),events.on(instance._castPlayer,"connect",function(e){currentResolve?sendConnectionResult(!0):playbackManager.setActivePlayer(PlayerName,instance.getCurrentTargetInfo()),console.log("cc: connect"),instance.lastPlayerData=null}),events.on(instance._castPlayer,"playbackstart",function(e,data){console.log("cc: playbackstart"),instance._castPlayer.initializeCastPlayer();var state=instance.getPlayerStateInternal(data);events.trigger(instance,"playbackstart",[state])}),events.on(instance._castPlayer,"playbackstop",function(e,data){console.log("cc: playbackstop");var state=instance.getPlayerStateInternal(data);events.trigger(instance,"playbackstop",[state]),instance.lastPlayerData={}}),events.on(instance._castPlayer,"playbackprogress",function(e,data){var state=instance.getPlayerStateInternal(data);events.trigger(instance,"timeupdate",[state])}),bindEventForRelay(instance,"timeupdate"),bindEventForRelay(instance,"pause"),bindEventForRelay(instance,"unpause"),bindEventForRelay(instance,"volumechange"),bindEventForRelay(instance,"repeatmodechange"),events.on(instance._castPlayer,"playstatechange",function(e,data){var state=instance.getPlayerStateInternal(data);events.trigger(instance,"pause",[state])})}function ChromecastPlayer(){this.name=PlayerName,this.type="mediaplayer",this.id="chromecast",this.isLocalPlayer=!1,this.lastPlayerData={},castSenderApiLoader.load().then(initializeChromecast.bind(this))}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,ServerId:i.ServerId,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);var apiClient;apiClient=message.options&&message.options.ServerId?connectionManager.getApiClient(message.options.ServerId):message.options&&message.options.items&&message.options.items.length?connectionManager.getApiClient(message.options.items[0].ServerId):connectionManager.currentApiClient(),message=Object.assign(message,{userId:apiClient.getCurrentUserId(),deviceId:apiClient.deviceId(),accessToken:apiClient.accessToken(),serverAddress:apiClient.serverAddress(),serverId:apiClient.serverId(),receiverName:receiverName});var bitrateSetting=appSettings.maxChromecastBitrate();return bitrateSetting&&(message.maxBitrate=bitrateSetting),message.options&&message.options.items&&(message.subtitleAppearance=userSettings.getSubtitleAppearanceSettings(),message.subtitleBurnIn=appSettings.get("subtitleburnin")||""),new Promise(function(resolve,reject){require(["chromecastHelper"],function(chromecastHelper){chromecastHelper.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)},CastPlayer.prototype.setReceiverVolume=function(mute,vol){this.currentMediaSession&&(mute?this.session.setReceiverMuted(!0,this.mediaCommandSuccessCallback.bind(this),this.errorHandler):this.session.setReceiverVolumeLevel(vol||1,this.mediaCommandSuccessCallback.bind(this),this.errorHandler))},CastPlayer.prototype.mute=function(){this.setReceiverVolume(!0)},CastPlayer.prototype.mediaCommandSuccessCallback=function(info,e){console.log(info)},ChromecastPlayer.prototype.tryPair=function(target){var castPlayer=this._castPlayer;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())},ChromecastPlayer.prototype.getTargets=function(){var targets=[];return this._castPlayer&&this._castPlayer.hasReceivers&&targets.push(this.getCurrentTargetInfo()),Promise.resolve(targets)},ChromecastPlayer.prototype.getCurrentTargetInfo=function(){var appName=null,castPlayer=this._castPlayer;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","PlayMediaSource"]}},ChromecastPlayer.prototype.getPlayerStateInternal=function(data){var triggerStateChange=!1;return data&&!this.lastPlayerData&&(triggerStateChange=!0),data=data||this.lastPlayerData,this.lastPlayerData=data,normalizeImages(data),triggerStateChange&&events.trigger(this,"statechange",[data]),data},ChromecastPlayer.prototype.playWithCommand=function(options,command){if(!options.items){var apiClient=connectionManager.getApiClient(options.serverId),instance=this;return apiClient.getItem(apiClient.getCurrentUserId(),options.ids[0]).then(function(item){return options.items=[item],instance.playWithCommand(options,command)})}return this._castPlayer.loadMedia(options,command)},ChromecastPlayer.prototype.seek=function(position){position=parseInt(position),position/=1e7,this._castPlayer.sendMessage({options:{position:position},command:"Seek"})},ChromecastPlayer.prototype.setAudioStreamIndex=function(index){this._castPlayer.sendMessage({options:{index:index},command:"SetAudioStreamIndex"})},ChromecastPlayer.prototype.setSubtitleStreamIndex=function(index){this._castPlayer.sendMessage({options:{index:index},command:"SetSubtitleStreamIndex"})},ChromecastPlayer.prototype.setMaxStreamingBitrate=function(options){this._castPlayer.sendMessage({options:options,command:"SetMaxStreamingBitrate"})},ChromecastPlayer.prototype.isFullscreen=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.IsFullscreen},ChromecastPlayer.prototype.nextTrack=function(){this._castPlayer.sendMessage({options:{},command:"NextTrack"})},ChromecastPlayer.prototype.previousTrack=function(){this._castPlayer.sendMessage({options:{},command:"PreviousTrack"})},ChromecastPlayer.prototype.volumeDown=function(){this._castPlayer.sendMessage({options:{},command:"VolumeDown"})},ChromecastPlayer.prototype.endSession=function(){var instance=this;this.stop().then(function(){setTimeout(function(){instance._castPlayer.stopApp()},1e3)})},ChromecastPlayer.prototype.volumeUp=function(){this._castPlayer.sendMessage({options:{},command:"VolumeUp"})},ChromecastPlayer.prototype.setVolume=function(vol){vol=Math.min(vol,100),vol=Math.max(vol,0),this._castPlayer.sendMessage({options:{volume:vol},command:"SetVolume"})},ChromecastPlayer.prototype.unpause=function(){this._castPlayer.sendMessage({options:{},command:"Unpause"})},ChromecastPlayer.prototype.playPause=function(){this._castPlayer.sendMessage({options:{},command:"PlayPause"})},ChromecastPlayer.prototype.pause=function(){this._castPlayer.sendMessage({options:{},command:"Pause"})},ChromecastPlayer.prototype.stop=function(){return this._castPlayer.sendMessage({options:{},command:"Stop"})},ChromecastPlayer.prototype.displayContent=function(options){this._castPlayer.sendMessage({options:options,command:"DisplayContent"})},ChromecastPlayer.prototype.setMute=function(isMuted){var castPlayer=this._castPlayer;isMuted?castPlayer.sendMessage({options:{},command:"Mute"}):castPlayer.sendMessage({options:{},command:"Unmute"})},ChromecastPlayer.prototype.getRepeatMode=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.RepeatMode},ChromecastPlayer.prototype.setRepeatMode=function(mode){this._castPlayer.sendMessage({options:{RepeatMode:mode},command:"SetRepeatMode"})},ChromecastPlayer.prototype.toggleMute=function(){this._castPlayer.sendMessage({options:{},command:"ToggleMute"})},ChromecastPlayer.prototype.audioTracks=function(){var state=this.lastPlayerData||{};state=state.NowPlayingItem||{};var streams=state.MediaStreams||[];return streams.filter(function(s){return"Audio"===s.Type})},ChromecastPlayer.prototype.getAudioStreamIndex=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.AudioStreamIndex},ChromecastPlayer.prototype.subtitleTracks=function(){var state=this.lastPlayerData||{};state=state.NowPlayingItem||{};var streams=state.MediaStreams||[];return streams.filter(function(s){return"Subtitle"===s.Type})},ChromecastPlayer.prototype.getSubtitleStreamIndex=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.SubtitleStreamIndex},ChromecastPlayer.prototype.getMaxStreamingBitrate=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.MaxStreamingBitrate},ChromecastPlayer.prototype.getVolume=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},null==state.VolumeLevel?100:state.VolumeLevel},ChromecastPlayer.prototype.isPlaying=function(){var state=this.lastPlayerData||{};return null!=state.NowPlayingItem},ChromecastPlayer.prototype.isPlayingVideo=function(){var state=this.lastPlayerData||{};return state=state.NowPlayingItem||{},"Video"===state.MediaType},ChromecastPlayer.prototype.isPlayingAudio=function(){var state=this.lastPlayerData||{};return state=state.NowPlayingItem||{},"Audio"===state.MediaType},ChromecastPlayer.prototype.currentTime=function(val){if(null!=val)return this.seek(val);var state=this.lastPlayerData||{};return state=state.PlayState||{},state.PositionTicks},ChromecastPlayer.prototype.duration=function(){var state=this.lastPlayerData||{};return state=state.NowPlayingItem||{},state.RunTimeTicks},ChromecastPlayer.prototype.getBufferedRanges=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.BufferedRanges||[]},ChromecastPlayer.prototype.paused=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.IsPaused},ChromecastPlayer.prototype.isMuted=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.IsMuted},ChromecastPlayer.prototype.shuffle=function(item){var apiClient=connectionManager.getApiClient(item.ServerId),userId=apiClient.getCurrentUserId(),instance=this;apiClient.getItem(userId,item.Id).then(function(item){instance.playWithCommand({items:[item]},"Shuffle")})},ChromecastPlayer.prototype.instantMix=function(item){var apiClient=connectionManager.getApiClient(item.ServerId),userId=apiClient.getCurrentUserId(),instance=this;apiClient.getItem(userId,item.Id).then(function(item){instance.playWithCommand({items:[item]},"InstantMix")})},ChromecastPlayer.prototype.canPlayMediaType=function(mediaType){return mediaType=(mediaType||"").toLowerCase(),"audio"===mediaType||"video"===mediaType},ChromecastPlayer.prototype.canQueueMediaType=function(mediaType){return this.canPlayMediaType(mediaType)},ChromecastPlayer.prototype.queue=function(options){this.playWithCommand(options,"PlayLast")},ChromecastPlayer.prototype.queueNext=function(options){this.playWithCommand(options,"PlayNext")},ChromecastPlayer.prototype.play=function(options){if(options.items)return this.playWithCommand(options,"PlayNow");if(!options.serverId)throw new Error("serverId required!");var instance=this,apiClient=connectionManager.getApiClient(options.serverId);return getItemsForPlayback(apiClient,{Ids:options.ids.join(",")}).then(function(result){return options.items=result.Items,instance.playWithCommand(options,"PlayNow")})},ChromecastPlayer.prototype.toggleFullscreen=function(){},ChromecastPlayer.prototype.beginPlayerUpdates=function(){},ChromecastPlayer.prototype.endPlayerUpdates=function(){},ChromecastPlayer.prototype.getPlaylist=function(){return Promise.resolve([])},ChromecastPlayer.prototype.getCurrentPlaylistItemId=function(){},ChromecastPlayer.prototype.setCurrentPlaylistItem=function(playlistItemId){return Promise.resolve()},ChromecastPlayer.prototype.removeFromPlaylist=function(playlistItemIds){return Promise.resolve()},ChromecastPlayer.prototype.getPlayerState=function(){return this.getPlayerStateInternal()||{}},ChromecastPlayer}); \ No newline at end of file +define(["appSettings","userSettings","playbackManager","connectionManager","globalize","events","require","castSenderApiLoader"],function(appSettings,userSettings,playbackManager,connectionManager,globalize,events,require,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 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)}}function getItemsForPlayback(apiClient,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",query.EnableTotalRecordCount=!1,apiClient.getItems(userId,query))}function bindEventForRelay(instance,eventName){events.on(instance._castPlayer,eventName,function(e,data){var state=instance.getPlayerStateInternal(data);events.trigger(instance,eventName,[state])})}function initializeChromecast(){var instance=this;instance._castPlayer=new CastPlayer,document.dispatchEvent(new CustomEvent("chromecastloaded",{detail:{player:instance}})),events.on(instance._castPlayer,"connect",function(e){currentResolve?sendConnectionResult(!0):playbackManager.setActivePlayer(PlayerName,instance.getCurrentTargetInfo()),console.log("cc: connect"),instance.lastPlayerData=null}),events.on(instance._castPlayer,"playbackstart",function(e,data){console.log("cc: playbackstart"),instance._castPlayer.initializeCastPlayer();var state=instance.getPlayerStateInternal(data);events.trigger(instance,"playbackstart",[state])}),events.on(instance._castPlayer,"playbackstop",function(e,data){console.log("cc: playbackstop");var state=instance.getPlayerStateInternal(data);events.trigger(instance,"playbackstop",[state]),instance.lastPlayerData={}}),events.on(instance._castPlayer,"playbackprogress",function(e,data){var state=instance.getPlayerStateInternal(data);events.trigger(instance,"timeupdate",[state])}),bindEventForRelay(instance,"timeupdate"),bindEventForRelay(instance,"pause"),bindEventForRelay(instance,"unpause"),bindEventForRelay(instance,"volumechange"),bindEventForRelay(instance,"repeatmodechange"),events.on(instance._castPlayer,"playstatechange",function(e,data){var state=instance.getPlayerStateInternal(data);events.trigger(instance,"pause",[state])})}function ChromecastPlayer(){this.name=PlayerName,this.type="mediaplayer",this.id="chromecast",this.isLocalPlayer=!1,this.lastPlayerData={},castSenderApiLoader.load().then(initializeChromecast.bind(this))}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"},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("2D4B1DA3"),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("urn:x-cast:com.connectsdk",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,ServerId:i.ServerId,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);var apiClient;apiClient=message.options&&message.options.ServerId?connectionManager.getApiClient(message.options.ServerId):message.options&&message.options.items&&message.options.items.length?connectionManager.getApiClient(message.options.items[0].ServerId):connectionManager.currentApiClient(),message=Object.assign(message,{userId:apiClient.getCurrentUserId(),deviceId:apiClient.deviceId(),accessToken:apiClient.accessToken(),serverAddress:apiClient.serverAddress(),serverId:apiClient.serverId(),receiverName:receiverName});var bitrateSetting=appSettings.maxChromecastBitrate();return bitrateSetting&&(message.maxBitrate=bitrateSetting),message.options&&message.options.items&&(message.subtitleAppearance=userSettings.getSubtitleAppearanceSettings(),message.subtitleBurnIn=appSettings.get("subtitleburnin")||""),new Promise(function(resolve,reject){require(["chromecastHelper"],function(chromecastHelper){chromecastHelper.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("urn:x-cast:com.connectsdk",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){!1===e&&(this.castPlayerState=PLAYER_STATE.IDLE)},CastPlayer.prototype.setReceiverVolume=function(mute,vol){this.currentMediaSession&&(mute?this.session.setReceiverMuted(!0,this.mediaCommandSuccessCallback.bind(this),this.errorHandler):this.session.setReceiverVolumeLevel(vol||1,this.mediaCommandSuccessCallback.bind(this),this.errorHandler))},CastPlayer.prototype.mute=function(){this.setReceiverVolume(!0)},CastPlayer.prototype.mediaCommandSuccessCallback=function(info,e){console.log(info)},ChromecastPlayer.prototype.tryPair=function(target){var castPlayer=this._castPlayer;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())},ChromecastPlayer.prototype.getTargets=function(){var targets=[];return this._castPlayer&&this._castPlayer.hasReceivers&&targets.push(this.getCurrentTargetInfo()),Promise.resolve(targets)},ChromecastPlayer.prototype.getCurrentTargetInfo=function(){var appName=null,castPlayer=this._castPlayer;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","PlayMediaSource"]}},ChromecastPlayer.prototype.getPlayerStateInternal=function(data){var triggerStateChange=!1;return data&&!this.lastPlayerData&&(triggerStateChange=!0),data=data||this.lastPlayerData,this.lastPlayerData=data,normalizeImages(data),triggerStateChange&&events.trigger(this,"statechange",[data]),data},ChromecastPlayer.prototype.playWithCommand=function(options,command){if(!options.items){var apiClient=connectionManager.getApiClient(options.serverId),instance=this;return apiClient.getItem(apiClient.getCurrentUserId(),options.ids[0]).then(function(item){return options.items=[item],instance.playWithCommand(options,command)})}return this._castPlayer.loadMedia(options,command)},ChromecastPlayer.prototype.seek=function(position){position=parseInt(position),position/=1e7,this._castPlayer.sendMessage({options:{position:position},command:"Seek"})},ChromecastPlayer.prototype.setAudioStreamIndex=function(index){this._castPlayer.sendMessage({options:{index:index},command:"SetAudioStreamIndex"})},ChromecastPlayer.prototype.setSubtitleStreamIndex=function(index){this._castPlayer.sendMessage({options:{index:index},command:"SetSubtitleStreamIndex"})},ChromecastPlayer.prototype.setMaxStreamingBitrate=function(options){this._castPlayer.sendMessage({options:options,command:"SetMaxStreamingBitrate"})},ChromecastPlayer.prototype.isFullscreen=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.IsFullscreen},ChromecastPlayer.prototype.nextTrack=function(){this._castPlayer.sendMessage({options:{},command:"NextTrack"})},ChromecastPlayer.prototype.previousTrack=function(){this._castPlayer.sendMessage({options:{},command:"PreviousTrack"})},ChromecastPlayer.prototype.volumeDown=function(){this._castPlayer.sendMessage({options:{},command:"VolumeDown"})},ChromecastPlayer.prototype.endSession=function(){var instance=this;this.stop().then(function(){setTimeout(function(){instance._castPlayer.stopApp()},1e3)})},ChromecastPlayer.prototype.volumeUp=function(){this._castPlayer.sendMessage({options:{},command:"VolumeUp"})},ChromecastPlayer.prototype.setVolume=function(vol){vol=Math.min(vol,100),vol=Math.max(vol,0),this._castPlayer.sendMessage({options:{volume:vol},command:"SetVolume"})},ChromecastPlayer.prototype.unpause=function(){this._castPlayer.sendMessage({options:{},command:"Unpause"})},ChromecastPlayer.prototype.playPause=function(){this._castPlayer.sendMessage({options:{},command:"PlayPause"})},ChromecastPlayer.prototype.pause=function(){this._castPlayer.sendMessage({options:{},command:"Pause"})},ChromecastPlayer.prototype.stop=function(){return this._castPlayer.sendMessage({options:{},command:"Stop"})},ChromecastPlayer.prototype.displayContent=function(options){this._castPlayer.sendMessage({options:options,command:"DisplayContent"})},ChromecastPlayer.prototype.setMute=function(isMuted){var castPlayer=this._castPlayer;isMuted?castPlayer.sendMessage({options:{},command:"Mute"}):castPlayer.sendMessage({options:{},command:"Unmute"})},ChromecastPlayer.prototype.getRepeatMode=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.RepeatMode},ChromecastPlayer.prototype.setRepeatMode=function(mode){this._castPlayer.sendMessage({options:{RepeatMode:mode},command:"SetRepeatMode"})},ChromecastPlayer.prototype.toggleMute=function(){this._castPlayer.sendMessage({options:{},command:"ToggleMute"})},ChromecastPlayer.prototype.audioTracks=function(){var state=this.lastPlayerData||{};return state=state.NowPlayingItem||{},(state.MediaStreams||[]).filter(function(s){return"Audio"===s.Type})},ChromecastPlayer.prototype.getAudioStreamIndex=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.AudioStreamIndex},ChromecastPlayer.prototype.subtitleTracks=function(){var state=this.lastPlayerData||{};return state=state.NowPlayingItem||{},(state.MediaStreams||[]).filter(function(s){return"Subtitle"===s.Type})},ChromecastPlayer.prototype.getSubtitleStreamIndex=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.SubtitleStreamIndex},ChromecastPlayer.prototype.getMaxStreamingBitrate=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.MaxStreamingBitrate},ChromecastPlayer.prototype.getVolume=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},null==state.VolumeLevel?100:state.VolumeLevel},ChromecastPlayer.prototype.isPlaying=function(){return null!=(this.lastPlayerData||{}).NowPlayingItem},ChromecastPlayer.prototype.isPlayingVideo=function(){var state=this.lastPlayerData||{};return state=state.NowPlayingItem||{},"Video"===state.MediaType},ChromecastPlayer.prototype.isPlayingAudio=function(){var state=this.lastPlayerData||{};return state=state.NowPlayingItem||{},"Audio"===state.MediaType},ChromecastPlayer.prototype.currentTime=function(val){if(null!=val)return this.seek(val);var state=this.lastPlayerData||{};return state=state.PlayState||{},state.PositionTicks},ChromecastPlayer.prototype.duration=function(){var state=this.lastPlayerData||{};return state=state.NowPlayingItem||{},state.RunTimeTicks},ChromecastPlayer.prototype.getBufferedRanges=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.BufferedRanges||[]},ChromecastPlayer.prototype.paused=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.IsPaused},ChromecastPlayer.prototype.isMuted=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.IsMuted},ChromecastPlayer.prototype.shuffle=function(item){var apiClient=connectionManager.getApiClient(item.ServerId),userId=apiClient.getCurrentUserId(),instance=this;apiClient.getItem(userId,item.Id).then(function(item){instance.playWithCommand({items:[item]},"Shuffle")})},ChromecastPlayer.prototype.instantMix=function(item){var apiClient=connectionManager.getApiClient(item.ServerId),userId=apiClient.getCurrentUserId(),instance=this;apiClient.getItem(userId,item.Id).then(function(item){instance.playWithCommand({items:[item]},"InstantMix")})},ChromecastPlayer.prototype.canPlayMediaType=function(mediaType){return"audio"===(mediaType=(mediaType||"").toLowerCase())||"video"===mediaType},ChromecastPlayer.prototype.canQueueMediaType=function(mediaType){return this.canPlayMediaType(mediaType)},ChromecastPlayer.prototype.queue=function(options){this.playWithCommand(options,"PlayLast")},ChromecastPlayer.prototype.queueNext=function(options){this.playWithCommand(options,"PlayNext")},ChromecastPlayer.prototype.play=function(options){if(options.items)return this.playWithCommand(options,"PlayNow");if(!options.serverId)throw new Error("serverId required!");var instance=this;return getItemsForPlayback(connectionManager.getApiClient(options.serverId),{Ids:options.ids.join(",")}).then(function(result){return options.items=result.Items,instance.playWithCommand(options,"PlayNow")})},ChromecastPlayer.prototype.toggleFullscreen=function(){},ChromecastPlayer.prototype.beginPlayerUpdates=function(){},ChromecastPlayer.prototype.endPlayerUpdates=function(){},ChromecastPlayer.prototype.getPlaylist=function(){return Promise.resolve([])},ChromecastPlayer.prototype.getCurrentPlaylistItemId=function(){},ChromecastPlayer.prototype.setCurrentPlaylistItem=function(playlistItemId){return Promise.resolve()},ChromecastPlayer.prototype.removeFromPlaylist=function(playlistItemIds){return Promise.resolve()},ChromecastPlayer.prototype.getPlayerState=function(){return this.getPlayerStateInternal()||{}},ChromecastPlayer}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/collectioneditor/collectioneditor.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/collectioneditor/collectioneditor.js index 6deb1800fa..1d626c301e 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/collectioneditor/collectioneditor.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/collectioneditor/collectioneditor.js @@ -1 +1 @@ -define(["dialogHelper","loading","apphost","layoutManager","connectionManager","appRouter","globalize","emby-checkbox","emby-input","paper-icon-button-light","emby-select","material-icons","css!./../formdialog","emby-button","emby-linkbutton","flexStyles"],function(dialogHelper,loading,appHost,layoutManager,connectionManager,appRouter,globalize){"use strict";function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function onSubmit(e){loading.show();var panel=parentWithClass(this,"dialog"),collectionId=panel.querySelector("#selectCollectionToAddTo").value,apiClient=connectionManager.getApiClient(currentServerId);return collectionId?addToCollection(apiClient,panel,collectionId):createCollection(apiClient,panel),e.preventDefault(),!1}function createCollection(apiClient,dlg){var url=apiClient.getUrl("Collections",{Name:dlg.querySelector("#txtNewCollectionName").value,IsLocked:!dlg.querySelector("#chkEnableInternetMetadata").checked,Ids:dlg.querySelector(".fldSelectedItemIds").value||""});apiClient.ajax({type:"POST",url:url,dataType:"json"}).then(function(result){loading.hide();var id=result.Id;dlg.submitted=!0,dialogHelper.close(dlg),redirectToCollection(apiClient,id)})}function redirectToCollection(apiClient,id){appRouter.showItem(id,apiClient.serverId())}function addToCollection(apiClient,dlg,id){var url=apiClient.getUrl("Collections/"+id+"/Items",{Ids:dlg.querySelector(".fldSelectedItemIds").value||""});apiClient.ajax({type:"POST",url:url}).then(function(){loading.hide(),dlg.submitted=!0,dialogHelper.close(dlg),require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#MessageItemsAdded"))})})}function triggerChange(select){select.dispatchEvent(new CustomEvent("change",{}))}function populateCollections(panel){loading.show();var select=panel.querySelector("#selectCollectionToAddTo");panel.querySelector(".newCollectionInfo").classList.add("hide");var options={Recursive:!0,IncludeItemTypes:"BoxSet",SortBy:"SortName",EnableTotalRecordCount:!1},apiClient=connectionManager.getApiClient(currentServerId);apiClient.getItems(apiClient.getCurrentUserId(),options).then(function(result){var html="";html+='",html+=result.Items.map(function(i){return'"}),select.innerHTML=html,select.value="",triggerChange(select),loading.hide()})}function getEditorHtml(){var html="";return html+='
',html+='
',html+='
',html+="
",html+=globalize.translate("sharedcomponents#NewCollectionHelp"),html+="
",html+='
',html+="
",html+="
",html+='
',html+='',html+="
",html+="
",html+='
',html+='
',html+='',html+='
'+globalize.translate("sharedcomponents#NewCollectionNameExample")+"
",html+="
",html+='",html+="
",html+='
',html+='",html+="
",html+='',html+="
",html+="
",html+="
"}function initEditor(content,items){if(content.querySelector("#selectCollectionToAddTo").addEventListener("change",function(){this.value?(content.querySelector(".newCollectionInfo").classList.add("hide"),content.querySelector("#txtNewCollectionName").removeAttribute("required")):(content.querySelector(".newCollectionInfo").classList.remove("hide"),content.querySelector("#txtNewCollectionName").setAttribute("required","required"))}),content.querySelector("form").addEventListener("submit",onSubmit),content.querySelector(".fldSelectedItemIds",content).value=items.join(","),items.length)content.querySelector(".fldSelectCollection").classList.remove("hide"),populateCollections(content);else{content.querySelector(".fldSelectCollection").classList.add("hide");var selectCollectionToAddTo=content.querySelector("#selectCollectionToAddTo");selectCollectionToAddTo.innerHTML="",selectCollectionToAddTo.value="",triggerChange(selectCollectionToAddTo)}}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function CollectionEditor(){}var currentServerId;return CollectionEditor.prototype.show=function(options){var items=options.items||{};currentServerId=options.serverId;var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="",title=items.length?globalize.translate("sharedcomponents#HeaderAddToCollection"):globalize.translate("sharedcomponents#NewCollection");return html+='
',html+='',html+='

',html+=title,html+="

",appHost.supports("externallinks")&&(html+=''+globalize.translate("sharedcomponents#Help")+""),html+="
",html+=getEditorHtml(),dlg.innerHTML=html,initEditor(dlg,items),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),dialogHelper.open(dlg).then(function(){return layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),dlg.submitted?Promise.resolve():Promise.reject()})},CollectionEditor}); \ No newline at end of file +define(["dialogHelper","loading","apphost","layoutManager","connectionManager","appRouter","globalize","emby-checkbox","emby-input","paper-icon-button-light","emby-select","material-icons","css!./../formdialog","emby-button","emby-linkbutton","flexStyles"],function(dialogHelper,loading,appHost,layoutManager,connectionManager,appRouter,globalize){"use strict";function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(!(elem=elem.parentNode))return null;return elem}function onSubmit(e){loading.show();var panel=parentWithClass(this,"dialog"),collectionId=panel.querySelector("#selectCollectionToAddTo").value,apiClient=connectionManager.getApiClient(currentServerId);return collectionId?addToCollection(apiClient,panel,collectionId):createCollection(apiClient,panel),e.preventDefault(),!1}function createCollection(apiClient,dlg){var url=apiClient.getUrl("Collections",{Name:dlg.querySelector("#txtNewCollectionName").value,IsLocked:!dlg.querySelector("#chkEnableInternetMetadata").checked,Ids:dlg.querySelector(".fldSelectedItemIds").value||""});apiClient.ajax({type:"POST",url:url,dataType:"json"}).then(function(result){loading.hide();var id=result.Id;dlg.submitted=!0,dialogHelper.close(dlg),redirectToCollection(apiClient,id)})}function redirectToCollection(apiClient,id){appRouter.showItem(id,apiClient.serverId())}function addToCollection(apiClient,dlg,id){var url=apiClient.getUrl("Collections/"+id+"/Items",{Ids:dlg.querySelector(".fldSelectedItemIds").value||""});apiClient.ajax({type:"POST",url:url}).then(function(){loading.hide(),dlg.submitted=!0,dialogHelper.close(dlg),require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#MessageItemsAdded"))})})}function triggerChange(select){select.dispatchEvent(new CustomEvent("change",{}))}function populateCollections(panel){loading.show();var select=panel.querySelector("#selectCollectionToAddTo");panel.querySelector(".newCollectionInfo").classList.add("hide");var options={Recursive:!0,IncludeItemTypes:"BoxSet",SortBy:"SortName",EnableTotalRecordCount:!1},apiClient=connectionManager.getApiClient(currentServerId);apiClient.getItems(apiClient.getCurrentUserId(),options).then(function(result){var html="";html+='",html+=result.Items.map(function(i){return'"}),select.innerHTML=html,select.value="",triggerChange(select),loading.hide()})}function getEditorHtml(){var html="";return html+='
',html+='
',html+='
',html+="
",html+=globalize.translate("sharedcomponents#NewCollectionHelp"),html+="
",html+='
',html+="
",html+="
",html+='
',html+='',html+="
",html+="
",html+='
',html+='
',html+='',html+='
'+globalize.translate("sharedcomponents#NewCollectionNameExample")+"
",html+="
",html+='",html+="
",html+='
',html+='",html+="
",html+='',html+="
",html+="
",html+="
"}function initEditor(content,items){if(content.querySelector("#selectCollectionToAddTo").addEventListener("change",function(){this.value?(content.querySelector(".newCollectionInfo").classList.add("hide"),content.querySelector("#txtNewCollectionName").removeAttribute("required")):(content.querySelector(".newCollectionInfo").classList.remove("hide"),content.querySelector("#txtNewCollectionName").setAttribute("required","required"))}),content.querySelector("form").addEventListener("submit",onSubmit),content.querySelector(".fldSelectedItemIds",content).value=items.join(","),items.length)content.querySelector(".fldSelectCollection").classList.remove("hide"),populateCollections(content);else{content.querySelector(".fldSelectCollection").classList.add("hide");var selectCollectionToAddTo=content.querySelector("#selectCollectionToAddTo");selectCollectionToAddTo.innerHTML="",selectCollectionToAddTo.value="",triggerChange(selectCollectionToAddTo)}}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function CollectionEditor(){}var currentServerId;return CollectionEditor.prototype.show=function(options){var items=options.items||{};currentServerId=options.serverId;var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="",title=items.length?globalize.translate("sharedcomponents#HeaderAddToCollection"):globalize.translate("sharedcomponents#NewCollection");return html+='
',html+='',html+='

',html+=title,html+="

",appHost.supports("externallinks")&&(html+=''+globalize.translate("sharedcomponents#Help")+""),html+="
",html+=getEditorHtml(),dlg.innerHTML=html,initEditor(dlg,items),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),dialogHelper.open(dlg).then(function(){return layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),dlg.submitted?Promise.resolve():Promise.reject()})},CollectionEditor}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/confirm/nativeconfirm.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/confirm/nativeconfirm.js index f906682c1f..a816c416a3 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/confirm/nativeconfirm.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/confirm/nativeconfirm.js @@ -1 +1 @@ -define([],function(){"use strict";function replaceAll(str,find,replace){return str.split(find).join(replace)}return function(options){"string"==typeof options&&(options={title:"",text:options});var text=replaceAll(options.text||"","
","\n"),result=confirm(text);return result?Promise.resolve():Promise.reject()}}); \ No newline at end of file +define([],function(){"use strict";function replaceAll(str,find,replace){return str.split(find).join(replace)}return function(options){"string"==typeof options&&(options={title:"",text:options});var text=replaceAll(options.text||"","
","\n");return confirm(text)?Promise.resolve():Promise.reject()}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/datetime.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/datetime.js index ec7a048eba..516ff794e8 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/datetime.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/datetime.js @@ -1 +1 @@ -define(["globalize"],function(globalize){"use strict";function parseISO8601Date(s,toLocal){var re=/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+)?(Z|([+-])(\d{2}):(\d{2}))?/,d=s.match(re);if(!d)throw"Couldn't parse ISO 8601 date string '"+s+"'";var a=[1,2,3,4,5,6,10,11];for(var i in a)d[a[i]]=parseInt(d[a[i]],10);d[7]=parseFloat(d[7]);var ms=Date.UTC(d[1],d[2]-1,d[3],d[4],d[5],d[6]);if(d[7]>0&&(ms+=Math.round(1e3*d[7])),"Z"!==d[8]&&d[10]){var offset=60*d[10]*60*1e3;d[11]&&(offset+=60*d[11]*1e3),"-"===d[9]?ms-=offset:ms+=offset}else toLocal===!1&&(ms+=6e4*(new Date).getTimezoneOffset());return new Date(ms)}function getDisplayRunningTime(ticks){var ticksPerHour=36e9,ticksPerMinute=6e8,ticksPerSecond=1e7,parts=[],hours=ticks/ticksPerHour;hours=Math.floor(hours),hours&&parts.push(hours),ticks-=hours*ticksPerHour;var minutes=ticks/ticksPerMinute;minutes=Math.floor(minutes),ticks-=minutes*ticksPerMinute,minutes<10&&hours&&(minutes="0"+minutes),parts.push(minutes);var seconds=ticks/ticksPerSecond;return seconds=Math.floor(seconds),seconds<10&&(seconds="0"+seconds),parts.push(seconds),parts.join(":")}function getOptionList(options){var list=[];for(var i in options)list.push({name:i,value:options[i]});return list}function toLocaleString(date,options){if(!date)throw new Error("date cannot be null");if(options=options||{},toLocaleTimeStringSupportsLocales){var currentLocale=globalize.getCurrentDateTimeLocale();if(currentLocale)return date.toLocaleString(currentLocale,options)}return date.toLocaleString()}function toLocaleDateString(date,options){if(!date)throw new Error("date cannot be null");if(options=options||{},toLocaleTimeStringSupportsLocales){var currentLocale=globalize.getCurrentDateTimeLocale();if(currentLocale)return date.toLocaleDateString(currentLocale,options)}var optionList=getOptionList(options);if(1===optionList.length&&"weekday"===optionList[0].name){var weekday=[];return weekday[0]="Sun",weekday[1]="Mon",weekday[2]="Tue",weekday[3]="Wed",weekday[4]="Thu",weekday[5]="Fri",weekday[6]="Sat",weekday[date.getDay()]}return date.toLocaleDateString()}function toLocaleTimeString(date,options){if(!date)throw new Error("date cannot be null");if(options=options||{},toLocaleTimeStringSupportsLocales){var currentLocale=globalize.getCurrentDateTimeLocale();if(currentLocale)return date.toLocaleTimeString(currentLocale,options)}return date.toLocaleTimeString()}function getDisplayTime(date){if(!date)throw new Error("date cannot be null");if("string"===(typeof date).toString().toLowerCase())try{date=parseISO8601Date(date,!0)}catch(err){return date}if(toLocaleTimeStringSupportsLocales)return toLocaleTimeString(date,{hour:"numeric",minute:"2-digit"});var time=toLocaleTimeString(date),timeLower=time.toLowerCase();if(timeLower.indexOf("am")!==-1||timeLower.indexOf("pm")!==-1){time=timeLower;var hour=date.getHours()%12,suffix=date.getHours()>11?"pm":"am";hour||(hour=12);var minutes=date.getMinutes();minutes<10&&(minutes="0"+minutes),minutes=":"+minutes,time=hour+minutes+suffix}else{var timeParts=time.split(":");timeParts.length>2&&(timeParts.length=2,time=timeParts.join(":"))}return time}function isRelativeDay(date,offsetInDays){if(!date)throw new Error("date cannot be null");var yesterday=new Date,day=yesterday.getDate()+offsetInDays;return yesterday.setDate(day),date.getFullYear()===yesterday.getFullYear()&&date.getMonth()===yesterday.getMonth()&&date.getDate()===day}var toLocaleTimeStringSupportsLocales=function(){try{(new Date).toLocaleTimeString("i")}catch(e){return"RangeError"===e.name}return!1}();return{parseISO8601Date:parseISO8601Date,getDisplayRunningTime:getDisplayRunningTime,toLocaleDateString:toLocaleDateString,toLocaleString:toLocaleString,getDisplayTime:getDisplayTime,isRelativeDay:isRelativeDay,toLocaleTimeString:toLocaleTimeString,supportsLocalization:function(){return toLocaleTimeStringSupportsLocales}}}); \ No newline at end of file +define(["globalize"],function(globalize){"use strict";function parseISO8601Date(s,toLocal){var re=/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+)?(Z|([+-])(\d{2}):(\d{2}))?/,d=s.match(re);if(!d)throw"Couldn't parse ISO 8601 date string '"+s+"'";var a=[1,2,3,4,5,6,10,11];for(var i in a)d[a[i]]=parseInt(d[a[i]],10);d[7]=parseFloat(d[7]);var ms=Date.UTC(d[1],d[2]-1,d[3],d[4],d[5],d[6]);if(d[7]>0&&(ms+=Math.round(1e3*d[7])),"Z"!==d[8]&&d[10]){var offset=60*d[10]*60*1e3;d[11]&&(offset+=60*d[11]*1e3),"-"===d[9]?ms-=offset:ms+=offset}else!1===toLocal&&(ms+=6e4*(new Date).getTimezoneOffset());return new Date(ms)}function getDisplayRunningTime(ticks){var parts=[],hours=ticks/36e9;hours=Math.floor(hours),hours&&parts.push(hours),ticks-=36e9*hours;var minutes=ticks/6e8;minutes=Math.floor(minutes),ticks-=6e8*minutes,minutes<10&&hours&&(minutes="0"+minutes),parts.push(minutes);var seconds=ticks/1e7;return seconds=Math.floor(seconds),seconds<10&&(seconds="0"+seconds),parts.push(seconds),parts.join(":")}function getOptionList(options){var list=[];for(var i in options)list.push({name:i,value:options[i]});return list}function toLocaleString(date,options){if(!date)throw new Error("date cannot be null");if(options=options||{},toLocaleTimeStringSupportsLocales){var currentLocale=globalize.getCurrentDateTimeLocale();if(currentLocale)return date.toLocaleString(currentLocale,options)}return date.toLocaleString()}function toLocaleDateString(date,options){if(!date)throw new Error("date cannot be null");if(options=options||{},toLocaleTimeStringSupportsLocales){var currentLocale=globalize.getCurrentDateTimeLocale();if(currentLocale)return date.toLocaleDateString(currentLocale,options)}var optionList=getOptionList(options);if(1===optionList.length&&"weekday"===optionList[0].name){var weekday=[];return weekday[0]="Sun",weekday[1]="Mon",weekday[2]="Tue",weekday[3]="Wed",weekday[4]="Thu",weekday[5]="Fri",weekday[6]="Sat",weekday[date.getDay()]}return date.toLocaleDateString()}function toLocaleTimeString(date,options){if(!date)throw new Error("date cannot be null");if(options=options||{},toLocaleTimeStringSupportsLocales){var currentLocale=globalize.getCurrentDateTimeLocale();if(currentLocale)return date.toLocaleTimeString(currentLocale,options)}return date.toLocaleTimeString()}function getDisplayTime(date){if(!date)throw new Error("date cannot be null");if("string"===(typeof date).toString().toLowerCase())try{date=parseISO8601Date(date,!0)}catch(err){return date}if(toLocaleTimeStringSupportsLocales)return toLocaleTimeString(date,{hour:"numeric",minute:"2-digit"});var time=toLocaleTimeString(date),timeLower=time.toLowerCase();if(-1!==timeLower.indexOf("am")||-1!==timeLower.indexOf("pm")){time=timeLower;var hour=date.getHours()%12,suffix=date.getHours()>11?"pm":"am";hour||(hour=12);var minutes=date.getMinutes();minutes<10&&(minutes="0"+minutes),minutes=":"+minutes,time=hour+minutes+suffix}else{var timeParts=time.split(":");timeParts.length>2&&(timeParts.length=2,time=timeParts.join(":"))}return time}function isRelativeDay(date,offsetInDays){if(!date)throw new Error("date cannot be null");var yesterday=new Date,day=yesterday.getDate()+offsetInDays;return yesterday.setDate(day),date.getFullYear()===yesterday.getFullYear()&&date.getMonth()===yesterday.getMonth()&&date.getDate()===day}var toLocaleTimeStringSupportsLocales=function(){try{(new Date).toLocaleTimeString("i")}catch(e){return"RangeError"===e.name}return!1}();return{parseISO8601Date:parseISO8601Date,getDisplayRunningTime:getDisplayRunningTime,toLocaleDateString:toLocaleDateString,toLocaleString:toLocaleString,getDisplayTime:getDisplayTime,isRelativeDay:isRelativeDay,toLocaleTimeString:toLocaleTimeString,supportsLocalization:function(){return toLocaleTimeStringSupportsLocales}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/dialog/dialog.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/dialog/dialog.js index 13a8e6421d..7ccdfb1096 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/dialog/dialog.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/dialog/dialog.js @@ -1 +1 @@ -define(["dialogHelper","dom","layoutManager","scrollHelper","globalize","require","material-icons","emby-button","paper-icon-button-light","emby-input","formDialogStyle","flexStyles"],function(dialogHelper,dom,layoutManager,scrollHelper,globalize,require){"use strict";function showDialog(options,template){function onButtonClick(){dialogResult=this.getAttribute("data-id"),dialogHelper.close(dlg)}var dialogOptions={removeOnClose:!0,scrollY:!1},enableTvLayout=layoutManager.tv;enableTvLayout&&(dialogOptions.size="fullscreen");var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.innerHTML=globalize.translateHtml(template,"sharedcomponents"),dlg.classList.add("align-items-center"),dlg.classList.add("justify-content-center");var formDialogContent=dlg.querySelector(".formDialogContent");formDialogContent.classList.add("no-grow"),enableTvLayout?(formDialogContent.style["max-width"]="50%",formDialogContent.style["max-height"]="60%",scrollHelper.centerFocus.on(formDialogContent,!1)):(formDialogContent.style.maxWidth=Math.min(150*options.buttons.length+200,dom.getWindowSize().innerWidth-50)+"px",dlg.classList.add("dialog-fullscreen-lowres")),options.title?dlg.querySelector(".formDialogHeaderTitle").innerHTML=options.title||"":dlg.querySelector(".formDialogHeaderTitle").classList.add("hide"),dlg.querySelector(".text").innerHTML=options.html||options.text||"";var i,length,html="";for(i=0,length=options.buttons.length;i"+item.name+""}dlg.querySelector(".formDialogFooter").innerHTML=html;var dialogResult,buttons=dlg.querySelectorAll(".btnOption");for(i=0,length=buttons.length;i"+item.name+""}dlg.querySelector(".formDialogFooter").innerHTML=html;var dialogResult,buttons=dlg.querySelectorAll(".btnOption");for(i=0,length=buttons.length;i'+t.name+""}).join("")}function loadScreensavers(context,userSettings){var selectScreensaver=context.querySelector(".selectScreensaver"),options=pluginManager.ofType("screensaver").map(function(plugin){return{name:plugin.name,value:plugin.id}});options.unshift({name:globalize.translate("sharedcomponents#None"),value:"none"}),selectScreensaver.innerHTML=options.map(function(o){return'"}).join(""),selectScreensaver.value=userSettings.screensaver(),selectScreensaver.value||(selectScreensaver.value="none")}function loadSoundEffects(context,userSettings){var selectSoundEffects=context.querySelector(".selectSoundEffects"),options=pluginManager.ofType("soundeffects").map(function(plugin){return{name:plugin.name,value:plugin.id}});options.unshift({name:globalize.translate("sharedcomponents#None"),value:"none"}),selectSoundEffects.innerHTML=options.map(function(o){return'"}).join(""),selectSoundEffects.value=userSettings.soundEffects(),selectSoundEffects.value||(selectSoundEffects.value="none")}function loadSkins(context,userSettings){var selectSkin=context.querySelector(".selectSkin"),options=pluginManager.ofType("skin").map(function(plugin){return{name:plugin.name,value:plugin.id}});selectSkin.innerHTML=options.map(function(o){return'"}).join(""),selectSkin.value=userSettings.skin(),!selectSkin.value&&options.length&&(selectSkin.value=options[0].value),options.length>1&&appHost.supports("skins")?context.querySelector(".selectSkinContainer").classList.remove("hide"):context.querySelector(".selectSkinContainer").classList.add("hide")}function showOrHideMissingEpisodesField(context,user,apiClient){return browser.tizen||browser.web0s?void context.querySelector(".fldDisplayMissingEpisodes").classList.add("hide"):void context.querySelector(".fldDisplayMissingEpisodes").classList.remove("hide")}function loadForm(context,user,userSettings,apiClient){apiClient.getCurrentUserId(),user.Id;user.Policy.IsAdministrator?context.querySelector(".selectDashboardThemeContainer").classList.remove("hide"):context.querySelector(".selectDashboardThemeContainer").classList.add("hide"),appHost.supports("displaylanguage")?context.querySelector(".languageSection").classList.remove("hide"):context.querySelector(".languageSection").classList.add("hide"),appHost.supports("displaymode")?context.querySelector(".fldDisplayMode").classList.remove("hide"):context.querySelector(".fldDisplayMode").classList.add("hide"),appHost.supports("displaymode")||layoutManager.tv?context.querySelector(".selectTVHomeScreenContainer").classList.remove("hide"):context.querySelector(".selectTVHomeScreenContainer").classList.add("hide"),appHost.supports("externallinks")?context.querySelector(".learnHowToContributeContainer").classList.remove("hide"):context.querySelector(".learnHowToContributeContainer").classList.add("hide"),appHost.supports("runatstartup")?context.querySelector(".fldAutorun").classList.remove("hide"):context.querySelector(".fldAutorun").classList.add("hide"),appHost.supports("soundeffects")?context.querySelector(".fldSoundEffects").classList.remove("hide"):context.querySelector(".fldSoundEffects").classList.add("hide"),appHost.supports("screensaver")?context.querySelector(".selectScreensaverContainer").classList.remove("hide"):context.querySelector(".selectScreensaverContainer").classList.add("hide"),datetime.supportsLocalization()?context.querySelector(".fldDateTimeLocale").classList.remove("hide"):context.querySelector(".fldDateTimeLocale").classList.add("hide"),browser.tizen||browser.web0s?(context.querySelector(".fldSeasonalThemes").classList.add("hide"),context.querySelector(".fldBackdrops").classList.add("hide"),context.querySelector(".fldThemeSong").classList.add("hide"),context.querySelector(".fldThemeVideo").classList.add("hide")):(context.querySelector(".fldSeasonalThemes").classList.remove("hide"),context.querySelector(".fldBackdrops").classList.remove("hide"),context.querySelector(".fldThemeSong").classList.remove("hide"),context.querySelector(".fldThemeVideo").classList.remove("hide")),context.querySelector(".chkRunAtStartup").checked=appSettings.runAtStartup();var selectTheme=context.querySelector("#selectTheme"),selectDashboardTheme=context.querySelector("#selectDashboardTheme");fillThemes(selectTheme),fillThemes(selectDashboardTheme,!0),loadScreensavers(context,userSettings),loadSoundEffects(context,userSettings),loadSkins(context,userSettings),context.querySelector(".chkDisplayMissingEpisodes").checked=user.Configuration.DisplayMissingEpisodes||!1,context.querySelector("#chkThemeSong").checked=userSettings.enableThemeSongs(),context.querySelector("#chkThemeVideo").checked=userSettings.enableThemeVideos(),context.querySelector("#chkBackdrops").checked=userSettings.enableBackdrops(),context.querySelector("#chkSeasonalThemes").checked=userSettings.enableSeasonalThemes(),context.querySelector(".selectTVHomeScreen").value=userSettings.get("tvhome")||"",context.querySelector("#selectLanguage").value=userSettings.language()||"",context.querySelector(".selectDateTimeLocale").value=userSettings.dateTimeLocale()||"",selectDashboardTheme.value=userSettings.dashboardTheme()||"",selectTheme.value=userSettings.theme()||"",context.querySelector(".selectLayout").value=layoutManager.getSavedLayout()||"",showOrHideMissingEpisodesField(context,user,apiClient),loading.hide()}function saveUser(context,user,userSettingsInstance,apiClient){return appSettings.runAtStartup(context.querySelector(".chkRunAtStartup").checked),user.Configuration.DisplayMissingEpisodes=context.querySelector(".chkDisplayMissingEpisodes").checked,appHost.supports("displaylanguage")&&userSettingsInstance.language(context.querySelector("#selectLanguage").value),userSettingsInstance.dateTimeLocale(context.querySelector(".selectDateTimeLocale").value),userSettingsInstance.enableThemeSongs(context.querySelector("#chkThemeSong").checked),userSettingsInstance.enableThemeVideos(context.querySelector("#chkThemeVideo").checked),userSettingsInstance.dashboardTheme(context.querySelector("#selectDashboardTheme").value),userSettingsInstance.theme(context.querySelector("#selectTheme").value),userSettingsInstance.soundEffects(context.querySelector(".selectSoundEffects").value),userSettingsInstance.screensaver(context.querySelector(".selectScreensaver").value),userSettingsInstance.set("tvhome",context.querySelector(".selectTVHomeScreen").value),userSettingsInstance.skin(context.querySelector(".selectSkin").value),userSettingsInstance.enableBackdrops(context.querySelector("#chkBackdrops").checked),userSettingsInstance.enableSeasonalThemes(context.querySelector("#chkSeasonalThemes").checked),user.Id===apiClient.getCurrentUserId()&&skinManager.setTheme(userSettingsInstance.theme()),layoutManager.setLayout(context.querySelector(".selectLayout").value),apiClient.updateUserConfiguration(user.Id,user.Configuration)}function save(instance,context,userId,userSettings,apiClient,enableSaveConfirmation){loading.show(),apiClient.getUser(userId).then(function(user){saveUser(context,user,userSettings,apiClient).then(function(){loading.hide(),enableSaveConfirmation&&require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#SettingsSaved"))}),events.trigger(instance,"saved")},function(){loading.hide()})})}function onSubmit(e){var self=this,apiClient=connectionManager.getApiClient(self.options.serverId),userId=self.options.userId,userSettings=self.options.userSettings;return userSettings.setUserInfo(userId,apiClient).then(function(){var enableSaveConfirmation=self.options.enableSaveConfirmation;save(self,self.options.element,userId,userSettings,apiClient,enableSaveConfirmation)}),e&&e.preventDefault(),!1}function embed(options,self){require(["text!./displaysettings.template.html"],function(template){options.element.innerHTML=globalize.translateDocument(template,"sharedcomponents"),options.element.querySelector("form").addEventListener("submit",onSubmit.bind(self)),options.enableSaveButton&&options.element.querySelector(".btnSave").classList.remove("hide"),self.loadData(options.autoFocus)})}function DisplaySettings(options){this.options=options,embed(options,this)}return DisplaySettings.prototype.loadData=function(autoFocus){var self=this,context=self.options.element;loading.show();var userId=self.options.userId,apiClient=connectionManager.getApiClient(self.options.serverId),userSettings=self.options.userSettings;return apiClient.getUser(userId).then(function(user){return userSettings.setUserInfo(userId,apiClient).then(function(){self.dataLoaded=!0,loadForm(context,user,userSettings,apiClient),autoFocus&&focusManager.autoFocus(context)})})},DisplaySettings.prototype.submit=function(){onSubmit.call(this)},DisplaySettings.prototype.destroy=function(){this.options=null},DisplaySettings}); \ No newline at end of file +define(["require","browser","layoutManager","appSettings","pluginManager","apphost","focusManager","datetime","globalize","loading","connectionManager","skinManager","dom","events","emby-select","emby-checkbox","emby-linkbutton"],function(require,browser,layoutManager,appSettings,pluginManager,appHost,focusManager,datetime,globalize,loading,connectionManager,skinManager,dom,events){"use strict";function fillThemes(select,isDashboard){select.innerHTML=skinManager.getThemes().map(function(t){var value=t.id;return t.isDefault&&!isDashboard?value="":t.isDefaultServerDashboard&&isDashboard&&(value=""),'"}).join("")}function loadScreensavers(context,userSettings){var selectScreensaver=context.querySelector(".selectScreensaver"),options=pluginManager.ofType("screensaver").map(function(plugin){return{name:plugin.name,value:plugin.id}});options.unshift({name:globalize.translate("sharedcomponents#None"),value:"none"}),selectScreensaver.innerHTML=options.map(function(o){return'"}).join(""),selectScreensaver.value=userSettings.screensaver(),selectScreensaver.value||(selectScreensaver.value="none")}function loadSoundEffects(context,userSettings){var selectSoundEffects=context.querySelector(".selectSoundEffects"),options=pluginManager.ofType("soundeffects").map(function(plugin){return{name:plugin.name,value:plugin.id}});options.unshift({name:globalize.translate("sharedcomponents#None"),value:"none"}),selectSoundEffects.innerHTML=options.map(function(o){return'"}).join(""),selectSoundEffects.value=userSettings.soundEffects(),selectSoundEffects.value||(selectSoundEffects.value="none")}function loadSkins(context,userSettings){var selectSkin=context.querySelector(".selectSkin"),options=pluginManager.ofType("skin").map(function(plugin){return{name:plugin.name,value:plugin.id}});selectSkin.innerHTML=options.map(function(o){return'"}).join(""),selectSkin.value=userSettings.skin(),!selectSkin.value&&options.length&&(selectSkin.value=options[0].value),options.length>1&&appHost.supports("skins")?context.querySelector(".selectSkinContainer").classList.remove("hide"):context.querySelector(".selectSkinContainer").classList.add("hide")}function showOrHideMissingEpisodesField(context,user,apiClient){if(browser.tizen||browser.web0s)return void context.querySelector(".fldDisplayMissingEpisodes").classList.add("hide");context.querySelector(".fldDisplayMissingEpisodes").classList.remove("hide")}function loadForm(context,user,userSettings,apiClient){apiClient.getCurrentUserId(),user.Id;user.Policy.IsAdministrator?context.querySelector(".selectDashboardThemeContainer").classList.remove("hide"):context.querySelector(".selectDashboardThemeContainer").classList.add("hide"),appHost.supports("displaylanguage")?context.querySelector(".languageSection").classList.remove("hide"):context.querySelector(".languageSection").classList.add("hide"),appHost.supports("displaymode")?context.querySelector(".fldDisplayMode").classList.remove("hide"):context.querySelector(".fldDisplayMode").classList.add("hide"),appHost.supports("displaymode")||layoutManager.tv?context.querySelector(".selectTVHomeScreenContainer").classList.remove("hide"):context.querySelector(".selectTVHomeScreenContainer").classList.add("hide"),appHost.supports("externallinks")?context.querySelector(".learnHowToContributeContainer").classList.remove("hide"):context.querySelector(".learnHowToContributeContainer").classList.add("hide"),appHost.supports("runatstartup")?context.querySelector(".fldAutorun").classList.remove("hide"):context.querySelector(".fldAutorun").classList.add("hide"),appHost.supports("soundeffects")?context.querySelector(".fldSoundEffects").classList.remove("hide"):context.querySelector(".fldSoundEffects").classList.add("hide"),appHost.supports("screensaver")?context.querySelector(".selectScreensaverContainer").classList.remove("hide"):context.querySelector(".selectScreensaverContainer").classList.add("hide"),datetime.supportsLocalization()?context.querySelector(".fldDateTimeLocale").classList.remove("hide"):context.querySelector(".fldDateTimeLocale").classList.add("hide"),browser.tizen||browser.web0s?(context.querySelector(".fldSeasonalThemes").classList.add("hide"),context.querySelector(".fldBackdrops").classList.add("hide"),context.querySelector(".fldThemeSong").classList.add("hide"),context.querySelector(".fldThemeVideo").classList.add("hide")):(context.querySelector(".fldSeasonalThemes").classList.remove("hide"),context.querySelector(".fldBackdrops").classList.remove("hide"),context.querySelector(".fldThemeSong").classList.remove("hide"),context.querySelector(".fldThemeVideo").classList.remove("hide")),context.querySelector(".chkRunAtStartup").checked=appSettings.runAtStartup();var selectTheme=context.querySelector("#selectTheme"),selectDashboardTheme=context.querySelector("#selectDashboardTheme");fillThemes(selectTheme),fillThemes(selectDashboardTheme,!0),loadScreensavers(context,userSettings),loadSoundEffects(context,userSettings),loadSkins(context,userSettings),context.querySelector(".chkDisplayMissingEpisodes").checked=user.Configuration.DisplayMissingEpisodes||!1,context.querySelector("#chkThemeSong").checked=userSettings.enableThemeSongs(),context.querySelector("#chkThemeVideo").checked=userSettings.enableThemeVideos(),context.querySelector("#chkBackdrops").checked=userSettings.enableBackdrops(),context.querySelector("#chkSeasonalThemes").checked=userSettings.enableSeasonalThemes(),context.querySelector(".selectTVHomeScreen").value=userSettings.get("tvhome")||"",context.querySelector("#selectLanguage").value=userSettings.language()||"",context.querySelector(".selectDateTimeLocale").value=userSettings.dateTimeLocale()||"",selectDashboardTheme.value=userSettings.dashboardTheme()||"",selectTheme.value=userSettings.theme()||"",context.querySelector(".selectLayout").value=layoutManager.getSavedLayout()||"",showOrHideMissingEpisodesField(context,user,apiClient),loading.hide()}function saveUser(context,user,userSettingsInstance,apiClient){return appSettings.runAtStartup(context.querySelector(".chkRunAtStartup").checked),user.Configuration.DisplayMissingEpisodes=context.querySelector(".chkDisplayMissingEpisodes").checked,appHost.supports("displaylanguage")&&userSettingsInstance.language(context.querySelector("#selectLanguage").value),userSettingsInstance.dateTimeLocale(context.querySelector(".selectDateTimeLocale").value),userSettingsInstance.enableThemeSongs(context.querySelector("#chkThemeSong").checked),userSettingsInstance.enableThemeVideos(context.querySelector("#chkThemeVideo").checked),userSettingsInstance.dashboardTheme(context.querySelector("#selectDashboardTheme").value),userSettingsInstance.theme(context.querySelector("#selectTheme").value),userSettingsInstance.soundEffects(context.querySelector(".selectSoundEffects").value),userSettingsInstance.screensaver(context.querySelector(".selectScreensaver").value),userSettingsInstance.set("tvhome",context.querySelector(".selectTVHomeScreen").value),userSettingsInstance.skin(context.querySelector(".selectSkin").value),userSettingsInstance.enableBackdrops(context.querySelector("#chkBackdrops").checked),userSettingsInstance.enableSeasonalThemes(context.querySelector("#chkSeasonalThemes").checked),user.Id===apiClient.getCurrentUserId()&&skinManager.setTheme(userSettingsInstance.theme()),layoutManager.setLayout(context.querySelector(".selectLayout").value),apiClient.updateUserConfiguration(user.Id,user.Configuration)}function save(instance,context,userId,userSettings,apiClient,enableSaveConfirmation){loading.show(),apiClient.getUser(userId).then(function(user){saveUser(context,user,userSettings,apiClient).then(function(){loading.hide(),enableSaveConfirmation&&require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#SettingsSaved"))}),events.trigger(instance,"saved")},function(){loading.hide()})})}function onSubmit(e){var self=this,apiClient=connectionManager.getApiClient(self.options.serverId),userId=self.options.userId,userSettings=self.options.userSettings;return userSettings.setUserInfo(userId,apiClient).then(function(){var enableSaveConfirmation=self.options.enableSaveConfirmation;save(self,self.options.element,userId,userSettings,apiClient,enableSaveConfirmation)}),e&&e.preventDefault(),!1}function embed(options,self){require(["text!./displaysettings.template.html"],function(template){options.element.innerHTML=globalize.translateDocument(template,"sharedcomponents"),options.element.querySelector("form").addEventListener("submit",onSubmit.bind(self)),options.enableSaveButton&&options.element.querySelector(".btnSave").classList.remove("hide"),self.loadData(options.autoFocus)})}function DisplaySettings(options){this.options=options,embed(options,this)}return DisplaySettings.prototype.loadData=function(autoFocus){var self=this,context=self.options.element;loading.show();var userId=self.options.userId,apiClient=connectionManager.getApiClient(self.options.serverId),userSettings=self.options.userSettings;return apiClient.getUser(userId).then(function(user){return userSettings.setUserInfo(userId,apiClient).then(function(){self.dataLoaded=!0,loadForm(context,user,userSettings,apiClient),autoFocus&&focusManager.autoFocus(context)})})},DisplaySettings.prototype.submit=function(){onSubmit.call(this)},DisplaySettings.prototype.destroy=function(){this.options=null},DisplaySettings}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/dom.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/dom.js index 553975c2e9..2ddf5f0779 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/dom.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/dom.js @@ -1 +1 @@ -define([],function(){"use strict";function parentWithAttribute(elem,name,value){for(;value?elem.getAttribute(name)!==value:!elem.getAttribute(name);)if(elem=elem.parentNode,!elem||!elem.getAttribute)return null;return elem}function parentWithTag(elem,tagNames){for(Array.isArray(tagNames)||(tagNames=[tagNames]);tagNames.indexOf(elem.tagName||"")===-1;)if(elem=elem.parentNode,!elem)return null;return elem}function containsAnyClass(classList,classNames){for(var i=0,length=classNames.length;i0&&offsetY>0&&(div.style.left=offsetX+"px",div.style.top=offsetY+"px");var firstChild=btn.firstChild;firstChild?btn.insertBefore(div,btn.firstChild):btn.appendChild(div),div.addEventListener(dom.whichAnimationEvent(),function(){div.parentNode.removeChild(div)},!1)}function animateButton(e,btn){requestAnimationFrame(function(){animateButtonInternal(e,btn)})}function onKeyDown(e){13===e.keyCode&&animateButton(e,this)}function onMouseDown(e){0===e.button&&animateButton(e,this)}function onClick(e){animateButton(e,this)}function enableAnimation(){return!browser.tv}function openPremiumInfo(){require(["registrationServices"],function(registrationServices){registrationServices.showPremiereInfo()})}function onAnchorClick(e){var href=this.getAttribute("href")||"";"#"!==href?this.getAttribute("target")?href.indexOf("emby.media/premiere")===-1||appHost.supports("externalpremium")?appHost.supports("targetblank")||(e.preventDefault(),shell.openUrl(href)):(e.preventDefault(),openPremiumInfo()):appRouter.handleAnchorClick(e):e.preventDefault()}var EmbyButtonPrototype=Object.create(HTMLButtonElement.prototype),EmbyLinkButtonPrototype=Object.create(HTMLAnchorElement.prototype);return EmbyButtonPrototype.createdCallback=function(){this.classList.contains("emby-button")||(this.classList.add("emby-button"),browser.firefox&&this.classList.add("button-link-inline"),layoutManager.tv&&("false"!==this.getAttribute("data-focusscale")&&this.classList.add("emby-button-focusscale"),this.classList.add("emby-button-tv")),enableAnimation()&&"false"!==this.getAttribute("data-ripple")&&!this.classList.contains("button-link")&&(this.classList.add("emby-button-withripple"),dom.addEventListener(this,"keydown",onKeyDown,{passive:!0}),browser.safari||browser.firefox&&"A"===this.tagName?dom.addEventListener(this,"click",onClick,{passive:!0}):dom.addEventListener(this,"mousedown",onMouseDown,{passive:!0})))},EmbyButtonPrototype.attachedCallback=function(){"A"===this.tagName&&(dom.removeEventListener(this,"click",onAnchorClick,{}),dom.addEventListener(this,"click",onAnchorClick,{}),"true"===this.getAttribute("data-autohide")&&(appHost.supports("externallinks")?this.classList.remove("hide"):this.classList.add("hide")))},EmbyButtonPrototype.detachedCallback=function(){dom.removeEventListener(this,"click",onAnchorClick,{})},EmbyLinkButtonPrototype.createdCallback=EmbyButtonPrototype.createdCallback,EmbyLinkButtonPrototype.attachedCallback=EmbyButtonPrototype.attachedCallback,document.registerElement("emby-button",{prototype:EmbyButtonPrototype,extends:"button"}),document.registerElement("emby-linkbutton",{prototype:EmbyLinkButtonPrototype,extends:"a"}),EmbyButtonPrototype}); \ No newline at end of file +define(["browser","dom","layoutManager","shell","appRouter","apphost","css!./emby-button","registerElement"],function(browser,dom,layoutManager,shell,appRouter,appHost){"use strict";function animateButtonInternal(e,btn){for(var div=document.createElement("div"),i=0,length=btn.classList.length;i0&&offsetY>0&&(div.style.left=offsetX+"px",div.style.top=offsetY+"px"),btn.firstChild?btn.insertBefore(div,btn.firstChild):btn.appendChild(div),div.addEventListener(dom.whichAnimationEvent(),function(){div.parentNode.removeChild(div)},!1)}function animateButton(e,btn){requestAnimationFrame(function(){animateButtonInternal(e,btn)})}function onKeyDown(e){13===e.keyCode&&animateButton(e,this)}function onMouseDown(e){0===e.button&&animateButton(e,this)}function onClick(e){animateButton(e,this)}function enableAnimation(){return!browser.tv}function openPremiumInfo(){require(["registrationServices"],function(registrationServices){registrationServices.showPremiereInfo()})}function onAnchorClick(e){var href=this.getAttribute("href")||"";"#"!==href?this.getAttribute("target")?-1===href.indexOf("emby.media/premiere")||appHost.supports("externalpremium")?appHost.supports("targetblank")||(e.preventDefault(),shell.openUrl(href)):(e.preventDefault(),openPremiumInfo()):appRouter.handleAnchorClick(e):e.preventDefault()}var EmbyButtonPrototype=Object.create(HTMLButtonElement.prototype),EmbyLinkButtonPrototype=Object.create(HTMLAnchorElement.prototype);return EmbyButtonPrototype.createdCallback=function(){this.classList.contains("emby-button")||(this.classList.add("emby-button"),browser.firefox&&this.classList.add("button-link-inline"),layoutManager.tv&&("false"!==this.getAttribute("data-focusscale")&&this.classList.add("emby-button-focusscale"),this.classList.add("emby-button-tv")),enableAnimation()&&"false"!==this.getAttribute("data-ripple")&&!this.classList.contains("button-link")&&(this.classList.add("emby-button-withripple"),dom.addEventListener(this,"keydown",onKeyDown,{passive:!0}),browser.safari||browser.firefox&&"A"===this.tagName?dom.addEventListener(this,"click",onClick,{passive:!0}):dom.addEventListener(this,"mousedown",onMouseDown,{passive:!0})))},EmbyButtonPrototype.attachedCallback=function(){"A"===this.tagName&&(dom.removeEventListener(this,"click",onAnchorClick,{}),dom.addEventListener(this,"click",onAnchorClick,{}),"true"===this.getAttribute("data-autohide")&&(appHost.supports("externallinks")?this.classList.remove("hide"):this.classList.add("hide")))},EmbyButtonPrototype.detachedCallback=function(){dom.removeEventListener(this,"click",onAnchorClick,{})},EmbyLinkButtonPrototype.createdCallback=EmbyButtonPrototype.createdCallback,EmbyLinkButtonPrototype.attachedCallback=EmbyButtonPrototype.attachedCallback,document.registerElement("emby-button",{prototype:EmbyButtonPrototype,extends:"button"}),document.registerElement("emby-linkbutton",{prototype:EmbyLinkButtonPrototype,extends:"a"}),EmbyButtonPrototype}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-checkbox/emby-checkbox.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-checkbox/emby-checkbox.js index 92a63b76e6..81a5286ed3 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-checkbox/emby-checkbox.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-checkbox/emby-checkbox.js @@ -1 +1 @@ -define(["browser","dom","css!./emby-checkbox","registerElement"],function(browser,dom){"use strict";function onKeyDown(e){if(13===e.keyCode)return e.preventDefault(),this.checked=!this.checked,this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),!1}function forceRefresh(loading){var elem=this.parentNode;elem.style.webkitAnimationName="repaintChrome",elem.style.webkitAnimationDelay=loading===!0?"500ms":"",elem.style.webkitAnimationDuration="10ms",elem.style.webkitAnimationIterationCount="1",setTimeout(function(){elem.style.webkitAnimationName=""},loading===!0?520:20)}var EmbyCheckboxPrototype=Object.create(HTMLInputElement.prototype),enableRefreshHack=!!(browser.tizen||browser.orsay||browser.operaTv||browser.web0s);EmbyCheckboxPrototype.attachedCallback=function(){if("true"!==this.getAttribute("data-embycheckbox")){this.setAttribute("data-embycheckbox","true"),this.classList.add("emby-checkbox");var labelElement=this.parentNode;labelElement.classList.add("emby-checkbox-label");var labelTextElement=labelElement.querySelector("span"),outlineClass="checkboxOutline",customClass=this.getAttribute("data-outlineclass");customClass&&(outlineClass+=" "+customClass);var checkedIcon=this.getAttribute("data-checkedicon")||"",uncheckedIcon=this.getAttribute("data-uncheckedicon")||"",checkHtml=''+checkedIcon+"",uncheckedHtml=''+uncheckedIcon+"";labelElement.insertAdjacentHTML("beforeend",''+checkHtml+uncheckedHtml+""),labelTextElement.classList.add("checkboxLabel"),this.addEventListener("keydown",onKeyDown),enableRefreshHack&&(forceRefresh.call(this,!0),dom.addEventListener(this,"click",forceRefresh,{passive:!0}),dom.addEventListener(this,"blur",forceRefresh,{passive:!0}),dom.addEventListener(this,"focus",forceRefresh,{passive:!0}),dom.addEventListener(this,"change",forceRefresh,{passive:!0}))}},EmbyCheckboxPrototype.detachedCallback=function(){this.removeEventListener("keydown",onKeyDown),dom.removeEventListener(this,"click",forceRefresh,{passive:!0}),dom.removeEventListener(this,"blur",forceRefresh,{passive:!0}),dom.removeEventListener(this,"focus",forceRefresh,{passive:!0}),dom.removeEventListener(this,"change",forceRefresh,{passive:!0})},document.registerElement("emby-checkbox",{prototype:EmbyCheckboxPrototype,extends:"input"})}); \ No newline at end of file +define(["browser","dom","css!./emby-checkbox","registerElement"],function(browser,dom){"use strict";function onKeyDown(e){if(13===e.keyCode)return e.preventDefault(),this.checked=!this.checked,this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),!1}function forceRefresh(loading){var elem=this.parentNode;elem.style.webkitAnimationName="repaintChrome",elem.style.webkitAnimationDelay=!0===loading?"500ms":"",elem.style.webkitAnimationDuration="10ms",elem.style.webkitAnimationIterationCount="1",setTimeout(function(){elem.style.webkitAnimationName=""},!0===loading?520:20)}var EmbyCheckboxPrototype=Object.create(HTMLInputElement.prototype),enableRefreshHack=!!(browser.tizen||browser.orsay||browser.operaTv||browser.web0s);EmbyCheckboxPrototype.attachedCallback=function(){if("true"!==this.getAttribute("data-embycheckbox")){this.setAttribute("data-embycheckbox","true"),this.classList.add("emby-checkbox");var labelElement=this.parentNode;labelElement.classList.add("emby-checkbox-label");var labelTextElement=labelElement.querySelector("span"),outlineClass="checkboxOutline",customClass=this.getAttribute("data-outlineclass");customClass&&(outlineClass+=" "+customClass);var checkedIcon=this.getAttribute("data-checkedicon")||"",uncheckedIcon=this.getAttribute("data-uncheckedicon")||"",checkHtml=''+checkedIcon+"",uncheckedHtml=''+uncheckedIcon+"";labelElement.insertAdjacentHTML("beforeend",''+checkHtml+uncheckedHtml+""),labelTextElement.classList.add("checkboxLabel"),this.addEventListener("keydown",onKeyDown),enableRefreshHack&&(forceRefresh.call(this,!0),dom.addEventListener(this,"click",forceRefresh,{passive:!0}),dom.addEventListener(this,"blur",forceRefresh,{passive:!0}),dom.addEventListener(this,"focus",forceRefresh,{passive:!0}),dom.addEventListener(this,"change",forceRefresh,{passive:!0}))}},EmbyCheckboxPrototype.detachedCallback=function(){this.removeEventListener("keydown",onKeyDown),dom.removeEventListener(this,"click",forceRefresh,{passive:!0}),dom.removeEventListener(this,"blur",forceRefresh,{passive:!0}),dom.removeEventListener(this,"focus",forceRefresh,{passive:!0}),dom.removeEventListener(this,"change",forceRefresh,{passive:!0})},document.registerElement("emby-checkbox",{prototype:EmbyCheckboxPrototype,extends:"input"})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-collapse/emby-collapse.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-collapse/emby-collapse.js index 39fed5e1e9..913f1d0797 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-collapse/emby-collapse.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-collapse/emby-collapse.js @@ -1 +1 @@ -define(["browser","css!./emby-collapse","registerElement","emby-button"],function(browser){"use strict";function slideDownToShow(button,elem){elem.classList.remove("hide"),elem.classList.add("expanded"),elem.style.height="auto";var height=elem.offsetHeight+"px";elem.style.height="0";elem.offsetHeight;elem.style.height=height,setTimeout(function(){elem.classList.contains("expanded")?elem.classList.remove("hide"):elem.classList.add("hide"),elem.style.height="auto"},300);var icon=button.querySelector("i");icon.classList.add("emby-collapse-expandIconExpanded")}function slideUpToHide(button,elem){elem.style.height=elem.offsetHeight+"px";elem.offsetHeight;elem.classList.remove("expanded"),elem.style.height="0",setTimeout(function(){elem.classList.contains("expanded")?elem.classList.remove("hide"):elem.classList.add("hide")},300);var icon=button.querySelector("i");icon.classList.remove("emby-collapse-expandIconExpanded")}function onButtonClick(e){var button=this,collapseContent=button.parentNode.querySelector(".collapseContent");collapseContent.expanded?(collapseContent.expanded=!1,slideUpToHide(button,collapseContent)):(collapseContent.expanded=!0,slideDownToShow(button,collapseContent))}var EmbyButtonPrototype=Object.create(HTMLDivElement.prototype);EmbyButtonPrototype.attachedCallback=function(){if(!this.classList.contains("emby-collapse")){this.classList.add("emby-collapse");var collapseContent=this.querySelector(".collapseContent");collapseContent&&collapseContent.classList.add("hide");var title=this.getAttribute("title"),html='';this.insertAdjacentHTML("afterbegin",html);var button=this.querySelector(".emby-collapsible-button");button.addEventListener("click",onButtonClick),"true"===this.getAttribute("data-expanded")&&onButtonClick.call(button)}},document.registerElement("emby-collapse",{prototype:EmbyButtonPrototype,extends:"div"})}); \ No newline at end of file +define(["browser","css!./emby-collapse","registerElement","emby-button"],function(browser){"use strict";function slideDownToShow(button,elem){elem.classList.remove("hide"),elem.classList.add("expanded"),elem.style.height="auto";var height=elem.offsetHeight+"px";elem.style.height="0";elem.offsetHeight;elem.style.height=height,setTimeout(function(){elem.classList.contains("expanded")?elem.classList.remove("hide"):elem.classList.add("hide"),elem.style.height="auto"},300),button.querySelector("i").classList.add("emby-collapse-expandIconExpanded")}function slideUpToHide(button,elem){elem.style.height=elem.offsetHeight+"px";elem.offsetHeight;elem.classList.remove("expanded"),elem.style.height="0",setTimeout(function(){elem.classList.contains("expanded")?elem.classList.remove("hide"):elem.classList.add("hide")},300),button.querySelector("i").classList.remove("emby-collapse-expandIconExpanded")}function onButtonClick(e){var button=this,collapseContent=button.parentNode.querySelector(".collapseContent");collapseContent.expanded?(collapseContent.expanded=!1,slideUpToHide(button,collapseContent)):(collapseContent.expanded=!0,slideDownToShow(button,collapseContent))}var EmbyButtonPrototype=Object.create(HTMLDivElement.prototype);EmbyButtonPrototype.attachedCallback=function(){if(!this.classList.contains("emby-collapse")){this.classList.add("emby-collapse");var collapseContent=this.querySelector(".collapseContent");collapseContent&&collapseContent.classList.add("hide");var title=this.getAttribute("title"),html='';this.insertAdjacentHTML("afterbegin",html);var button=this.querySelector(".emby-collapsible-button");button.addEventListener("click",onButtonClick),"true"===this.getAttribute("data-expanded")&&onButtonClick.call(button)}},document.registerElement("emby-collapse",{prototype:EmbyButtonPrototype,extends:"div"})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-connect/connecthelper.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-connect/connecthelper.js index cdf9edc8fc..2105bddcf4 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-connect/connecthelper.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-connect/connecthelper.js @@ -1 +1 @@ -define(["globalize","apphost","loading","alert","emby-linkbutton"],function(globalize,appHost,loading,alert){"use strict";function resolvePromise(){return Promise.resolve()}function rejectPromise(){return Promise.reject()}function showNewUserInviteMessage(result){if(!result.IsNewUserInvitation&&!result.IsPending)return Promise.resolve();var message=result.IsNewUserInvitation?globalize.translate("sharedcomponents#MessageInvitationSentToNewUser",result.GuestDisplayName):globalize.translate("sharedcomponents#MessageInvitationSentToUser",result.GuestDisplayName);return alert({text:message,title:globalize.translate("sharedcomponents#HeaderInvitationSent")}).then(resolvePromise,resolvePromise)}function inviteGuest(options){var apiClient=options.apiClient;return loading.show(),apiClient.ajax({type:"POST",url:apiClient.getUrl("Connect/Invite"),dataType:"json",data:options.guestOptions||{}}).then(function(result){return loading.hide(),showNewUserInviteMessage(result)},function(response){loading.hide();var statusCode=response?response.status:0;return 502===statusCode?showConnectServerUnreachableErrorMessage().then(rejectPromise,rejectPromise):404===statusCode?alert({text:globalize.translate("sharedcomponents#GuestUserNotFound")}).then(rejectPromise,rejectPromise):(statusCode||0)>=500?alert({text:globalize.translate("sharedcomponents#ErrorReachingEmbyConnect")}).then(rejectPromise,rejectPromise):showGuestGeneralErrorMessage().then(rejectPromise,rejectPromise)})}function showGuestGeneralErrorMessage(){var html;appHost.supports("externallinks")&&(html=globalize.translate("sharedcomponents#ErrorAddingGuestAccount1",'https://emby.media/connect'),html+="

"+globalize.translate("sharedcomponents#ErrorAddingGuestAccount2","apps@emby.media"));var text=globalize.translate("sharedcomponents#ErrorAddingGuestAccount1","https://emby.media/connect");return text+="\n\n"+globalize.translate("sharedcomponents#ErrorAddingGuestAccount2","apps@emby.media"),alert({text:text,html:html})}function showConnectServerUnreachableErrorMessage(){var text=globalize.translate("sharedcomponents#ErrorConnectServerUnreachable","https://connect.emby.media");return alert({text:text})}function showLinkUserErrorMessage(username,statusCode){var html,text;return 502===statusCode?showConnectServerUnreachableErrorMessage():(username?(appHost.supports("externallinks")&&(html=globalize.translate("sharedcomponents#ErrorAddingEmbyConnectAccount1",'https://emby.media/connect'),html+="

"+globalize.translate("sharedcomponents#ErrorAddingEmbyConnectAccount2","apps@emby.media")),text=globalize.translate("sharedcomponents#ErrorAddingEmbyConnectAccount1","https://emby.media/connect"),text+="\n\n"+globalize.translate("sharedcomponents#ErrorAddingEmbyConnectAccount2","apps@emby.media")):html=text=globalize.translate("sharedcomponents#DefaultErrorMessage"),alert({text:text,html:html}))}function updateUserLink(apiClient,user,newConnectUsername){var currentConnectUsername=user.ConnectUserName||"",enteredConnectUsername=newConnectUsername,linkUrl=apiClient.getUrl("Users/"+user.Id+"/Connect/Link");return currentConnectUsername&&!enteredConnectUsername?apiClient.ajax({type:"DELETE",url:linkUrl}).then(function(){return alert({text:globalize.translate("sharedcomponents#MessageEmbyAccontRemoved"),title:globalize.translate("sharedcomponents#HeaderEmbyAccountRemoved")}).catch(resolvePromise)},function(response){var statusCode=response?response.status:0;return 502===statusCode?showConnectServerUnreachableErrorMessage().then(rejectPromise):alert({text:globalize.translate("sharedcomponents#ErrorRemovingEmbyConnectAccount")}).then(rejectPromise)}):currentConnectUsername!==enteredConnectUsername?apiClient.ajax({type:"POST",url:linkUrl,data:{ConnectUsername:enteredConnectUsername},dataType:"json"}).then(function(result){var msgKey=result.IsPending?"sharedcomponents#MessagePendingEmbyAccountAdded":"sharedcomponents#MessageEmbyAccountAdded";return alert({text:globalize.translate(msgKey),title:globalize.translate("sharedcomponents#HeaderEmbyAccountAdded")}).catch(resolvePromise)},function(response){var statusCode=response?response.status:0;return 502===statusCode?showConnectServerUnreachableErrorMessage().then(rejectPromise):showLinkUserErrorMessage(".",statusCode).then(rejectPromise)}):Promise.reject()}return{inviteGuest:inviteGuest,updateUserLink:updateUserLink,showLinkUserErrorMessage:showLinkUserErrorMessage,showConnectServerUnreachableErrorMessage:showConnectServerUnreachableErrorMessage}}); \ No newline at end of file +define(["globalize","apphost","loading","alert","emby-linkbutton"],function(globalize,appHost,loading,alert){"use strict";function resolvePromise(){return Promise.resolve()}function rejectPromise(){return Promise.reject()}function showNewUserInviteMessage(result){if(!result.IsNewUserInvitation&&!result.IsPending)return Promise.resolve();var message=result.IsNewUserInvitation?globalize.translate("sharedcomponents#MessageInvitationSentToNewUser",result.GuestDisplayName):globalize.translate("sharedcomponents#MessageInvitationSentToUser",result.GuestDisplayName);return alert({text:message,title:globalize.translate("sharedcomponents#HeaderInvitationSent")}).then(resolvePromise,resolvePromise)}function inviteGuest(options){var apiClient=options.apiClient;return loading.show(),apiClient.ajax({type:"POST",url:apiClient.getUrl("Connect/Invite"),dataType:"json",data:options.guestOptions||{}}).then(function(result){return loading.hide(),showNewUserInviteMessage(result)},function(response){loading.hide();var statusCode=response?response.status:0;return 502===statusCode?showConnectServerUnreachableErrorMessage().then(rejectPromise,rejectPromise):404===statusCode?alert({text:globalize.translate("sharedcomponents#GuestUserNotFound")}).then(rejectPromise,rejectPromise):(statusCode||0)>=500?alert({text:globalize.translate("sharedcomponents#ErrorReachingEmbyConnect")}).then(rejectPromise,rejectPromise):showGuestGeneralErrorMessage().then(rejectPromise,rejectPromise)})}function showGuestGeneralErrorMessage(){var html;appHost.supports("externallinks")&&(html=globalize.translate("sharedcomponents#ErrorAddingGuestAccount1",'https://emby.media/connect'),html+="

"+globalize.translate("sharedcomponents#ErrorAddingGuestAccount2","apps@emby.media"));var text=globalize.translate("sharedcomponents#ErrorAddingGuestAccount1","https://emby.media/connect");return text+="\n\n"+globalize.translate("sharedcomponents#ErrorAddingGuestAccount2","apps@emby.media"),alert({text:text,html:html})}function showConnectServerUnreachableErrorMessage(){var text=globalize.translate("sharedcomponents#ErrorConnectServerUnreachable","https://connect.emby.media");return alert({text:text})}function showLinkUserErrorMessage(username,statusCode){var html,text;return 502===statusCode?showConnectServerUnreachableErrorMessage():(username?(appHost.supports("externallinks")&&(html=globalize.translate("sharedcomponents#ErrorAddingEmbyConnectAccount1",'https://emby.media/connect'),html+="

"+globalize.translate("sharedcomponents#ErrorAddingEmbyConnectAccount2","apps@emby.media")),text=globalize.translate("sharedcomponents#ErrorAddingEmbyConnectAccount1","https://emby.media/connect"),text+="\n\n"+globalize.translate("sharedcomponents#ErrorAddingEmbyConnectAccount2","apps@emby.media")):html=text=globalize.translate("sharedcomponents#DefaultErrorMessage"),alert({text:text,html:html}))}function updateUserLink(apiClient,user,newConnectUsername){var currentConnectUsername=user.ConnectUserName||"",enteredConnectUsername=newConnectUsername,linkUrl=apiClient.getUrl("Users/"+user.Id+"/Connect/Link");return currentConnectUsername&&!enteredConnectUsername?apiClient.ajax({type:"DELETE",url:linkUrl}).then(function(){return alert({text:globalize.translate("sharedcomponents#MessageEmbyAccontRemoved"),title:globalize.translate("sharedcomponents#HeaderEmbyAccountRemoved")}).catch(resolvePromise)},function(response){return 502===(response?response.status:0)?showConnectServerUnreachableErrorMessage().then(rejectPromise):alert({text:globalize.translate("sharedcomponents#ErrorRemovingEmbyConnectAccount")}).then(rejectPromise)}):currentConnectUsername!==enteredConnectUsername?apiClient.ajax({type:"POST",url:linkUrl,data:{ConnectUsername:enteredConnectUsername},dataType:"json"}).then(function(result){var msgKey=result.IsPending?"sharedcomponents#MessagePendingEmbyAccountAdded":"sharedcomponents#MessageEmbyAccountAdded";return alert({text:globalize.translate(msgKey),title:globalize.translate("sharedcomponents#HeaderEmbyAccountAdded")}).catch(resolvePromise)},function(response){var statusCode=response?response.status:0;return 502===statusCode?showConnectServerUnreachableErrorMessage().then(rejectPromise):showLinkUserErrorMessage(".",statusCode).then(rejectPromise)}):Promise.reject()}return{inviteGuest:inviteGuest,updateUserLink:updateUserLink,showLinkUserErrorMessage:showLinkUserErrorMessage,showConnectServerUnreachableErrorMessage:showConnectServerUnreachableErrorMessage}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-input/emby-input.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-input/emby-input.js index 1cd6fbe343..ea0fba310a 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-input/emby-input.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-input/emby-input.js @@ -1 +1 @@ -define(["layoutManager","browser","dom","css!./emby-input","registerElement"],function(layoutManager,browser,dom){"use strict";function onChange(){var label=this.labelElement;if(this.value)label.classList.remove("inputLabel-float");else{var instanceSupportsFloat=supportsFloatingLabel&&"date"!==this.type&&"time"!==this.type;instanceSupportsFloat&&label.classList.add("inputLabel-float")}}var EmbyInputPrototype=Object.create(HTMLInputElement.prototype),inputId=0,supportsFloatingLabel=!1;if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var descriptor=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");if(descriptor&&descriptor.configurable){var baseSetMethod=descriptor.set;descriptor.set=function(value){baseSetMethod.call(this,value),this.dispatchEvent(new CustomEvent("valueset",{bubbles:!1,cancelable:!1}))},Object.defineProperty(HTMLInputElement.prototype,"value",descriptor),supportsFloatingLabel=!0}}EmbyInputPrototype.createdCallback=function(){if(this.id||(this.id="embyinput"+inputId,inputId++),!this.classList.contains("emby-input")){this.classList.add("emby-input");var parentNode=this.parentNode,document=this.ownerDocument,label=document.createElement("label");label.innerHTML=this.getAttribute("label")||"",label.classList.add("inputLabel"),label.classList.add("inputLabelUnfocused"),label.htmlFor=this.id,parentNode.insertBefore(label,this),this.labelElement=label,dom.addEventListener(this,"focus",function(){onChange.call(this),document.attachIME&&document.attachIME(this),label.classList.add("inputLabelFocused"),label.classList.remove("inputLabelUnfocused")},{passive:!0}),dom.addEventListener(this,"blur",function(){onChange.call(this),label.classList.remove("inputLabelFocused"),label.classList.add("inputLabelUnfocused")},{passive:!0}),dom.addEventListener(this,"change",onChange,{passive:!0}),dom.addEventListener(this,"input",onChange,{passive:!0}),dom.addEventListener(this,"valueset",onChange,{passive:!0}),browser.orsay&&this===document.activeElement&&document.attachIME&&document.attachIME(this)}},EmbyInputPrototype.attachedCallback=function(){this.labelElement.htmlFor=this.id,onChange.call(this)},EmbyInputPrototype.label=function(text){this.labelElement.innerHTML=text},document.registerElement("emby-input",{prototype:EmbyInputPrototype,extends:"input"})}); \ No newline at end of file +define(["layoutManager","browser","dom","css!./emby-input","registerElement"],function(layoutManager,browser,dom){"use strict";function onChange(){var label=this.labelElement;if(this.value)label.classList.remove("inputLabel-float");else{supportsFloatingLabel&&"date"!==this.type&&"time"!==this.type&&label.classList.add("inputLabel-float")}}var EmbyInputPrototype=Object.create(HTMLInputElement.prototype),inputId=0,supportsFloatingLabel=!1;if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var descriptor=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");if(descriptor&&descriptor.configurable){var baseSetMethod=descriptor.set;descriptor.set=function(value){baseSetMethod.call(this,value),this.dispatchEvent(new CustomEvent("valueset",{bubbles:!1,cancelable:!1}))},Object.defineProperty(HTMLInputElement.prototype,"value",descriptor),supportsFloatingLabel=!0}}EmbyInputPrototype.createdCallback=function(){if(this.id||(this.id="embyinput"+inputId,inputId++),!this.classList.contains("emby-input")){this.classList.add("emby-input");var parentNode=this.parentNode,document=this.ownerDocument,label=document.createElement("label");label.innerHTML=this.getAttribute("label")||"",label.classList.add("inputLabel"),label.classList.add("inputLabelUnfocused"),label.htmlFor=this.id,parentNode.insertBefore(label,this),this.labelElement=label,dom.addEventListener(this,"focus",function(){onChange.call(this),document.attachIME&&document.attachIME(this),label.classList.add("inputLabelFocused"),label.classList.remove("inputLabelUnfocused")},{passive:!0}),dom.addEventListener(this,"blur",function(){onChange.call(this),label.classList.remove("inputLabelFocused"),label.classList.add("inputLabelUnfocused")},{passive:!0}),dom.addEventListener(this,"change",onChange,{passive:!0}),dom.addEventListener(this,"input",onChange,{passive:!0}),dom.addEventListener(this,"valueset",onChange,{passive:!0}),browser.orsay&&this===document.activeElement&&document.attachIME&&document.attachIME(this)}},EmbyInputPrototype.attachedCallback=function(){this.labelElement.htmlFor=this.id,onChange.call(this)},EmbyInputPrototype.label=function(text){this.labelElement.innerHTML=text},document.registerElement("emby-input",{prototype:EmbyInputPrototype,extends:"input"})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-itemscontainer/emby-itemscontainer.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-itemscontainer/emby-itemscontainer.js index 2eb2db2781..752c7c060f 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-itemscontainer/emby-itemscontainer.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-itemscontainer/emby-itemscontainer.js @@ -1 +1 @@ -define(["itemShortcuts","inputManager","connectionManager","playbackManager","imageLoader","layoutManager","browser","dom","loading","focusManager","serverNotifications","events","registerElement"],function(itemShortcuts,inputManager,connectionManager,playbackManager,imageLoader,layoutManager,browser,dom,loading,focusManager,serverNotifications,events){"use strict";function onClick(e){var itemsContainer=this,multiSelect=(e.target,itemsContainer.multiSelect);multiSelect&&multiSelect.onContainerClick.call(itemsContainer,e)===!1||itemShortcuts.onClick.call(itemsContainer,e)}function disableEvent(e){return e.preventDefault(),e.stopPropagation(),!1}function onContextMenu(e){var target=e.target,card=dom.parentWithAttribute(target,"data-id");if(card&&card.getAttribute("data-serverid"))return inputManager.trigger("menu",card),e.preventDefault(),e.stopPropagation(),!1}function getShortcutOptions(){return{click:!1}}function onDrop(evt,itemsContainer){var el=evt.item,newIndex=evt.newIndex,itemId=el.getAttribute("data-playlistitemid"),playlistId=el.getAttribute("data-playlistid");if(!playlistId){var oldIndex=evt.oldIndex;return void el.dispatchEvent(new CustomEvent("itemdrop",{detail:{oldIndex:oldIndex,newIndex:newIndex,playlistItemId:itemId},bubbles:!0,cancelable:!1}))}var serverId=el.getAttribute("data-serverid"),apiClient=connectionManager.getApiClient(serverId);loading.show(),apiClient.ajax({url:apiClient.getUrl("Playlists/"+playlistId+"/Items/"+itemId+"/Move/"+newIndex),type:"POST"}).then(function(){loading.hide()},function(){loading.hide(),itemsContainer.refreshItems()})}function onUserDataChanged(e,apiClient,userData){var itemsContainer=this;require(["cardBuilder"],function(cardBuilder){cardBuilder.onUserDataChanged(userData,itemsContainer)});var eventsToMonitor=getEventsToMonitor(itemsContainer);eventsToMonitor.indexOf("markfavorite")!==-1?itemsContainer.notifyRefreshNeeded():eventsToMonitor.indexOf("markplayed")!==-1&&itemsContainer.notifyRefreshNeeded()}function getEventsToMonitor(itemsContainer){var monitor=itemsContainer.getAttribute("data-monitor");return monitor?monitor.split(","):[]}function onTimerCreated(e,apiClient,data){var itemsContainer=this;if(getEventsToMonitor(itemsContainer).indexOf("timers")!==-1)return void itemsContainer.notifyRefreshNeeded();var programId=data.ProgramId,newTimerId=data.Id;require(["cardBuilder"],function(cardBuilder){cardBuilder.onTimerCreated(programId,newTimerId,itemsContainer)})}function onSeriesTimerCreated(e,apiClient,data){var itemsContainer=this;if(getEventsToMonitor(itemsContainer).indexOf("seriestimers")!==-1)return void itemsContainer.notifyRefreshNeeded()}function onTimerCancelled(e,apiClient,data){var itemsContainer=this;if(getEventsToMonitor(itemsContainer).indexOf("timers")!==-1)return void itemsContainer.notifyRefreshNeeded();var id=data.Id;require(["cardBuilder"],function(cardBuilder){cardBuilder.onTimerCancelled(id,itemsContainer)})}function onSeriesTimerCancelled(e,apiClient,data){var itemsContainer=this;if(getEventsToMonitor(itemsContainer).indexOf("seriestimers")!==-1)return void itemsContainer.notifyRefreshNeeded();var id=data.Id;require(["cardBuilder"],function(cardBuilder){cardBuilder.onSeriesTimerCancelled(id,itemsContainer)})}function onLibraryChanged(e,apiClient,data){var itemsContainer=this,eventsToMonitor=getEventsToMonitor(itemsContainer);if(eventsToMonitor.indexOf("seriestimers")===-1&&eventsToMonitor.indexOf("timers")===-1){var itemsAdded=data.ItemsAdded||[],itemsRemoved=data.ItemsRemoved||[];if(itemsAdded.length||itemsRemoved.length){var parentId=itemsContainer.getAttribute("data-parentid");if(parentId){var foldersAddedTo=data.FoldersAddedTo||[],foldersRemovedFrom=data.FoldersRemovedFrom||[],collectionFolders=data.CollectionFolders||[];if(foldersAddedTo.indexOf(parentId)===-1&&foldersRemovedFrom.indexOf(parentId)===-1&&collectionFolders.indexOf(parentId)===-1)return}itemsContainer.notifyRefreshNeeded()}}}function onPlaybackStopped(e,stopInfo){var itemsContainer=this,state=stopInfo.state,eventsToMonitor=getEventsToMonitor(itemsContainer);if(state.NowPlayingItem&&"Video"===state.NowPlayingItem.MediaType){if(eventsToMonitor.indexOf("videoplayback")!==-1)return void itemsContainer.notifyRefreshNeeded(!0)}else if(state.NowPlayingItem&&"Audio"===state.NowPlayingItem.MediaType&&eventsToMonitor.indexOf("audioplayback")!==-1)return void itemsContainer.notifyRefreshNeeded(!0)}function addNotificationEvent(instance,name,handler,owner){var localHandler=handler.bind(instance);owner=owner||serverNotifications,events.on(owner,name,localHandler),instance["event_"+name]=localHandler}function removeNotificationEvent(instance,name,owner){var handler=instance["event_"+name];handler&&(owner=owner||serverNotifications,events.off(owner,name,handler),instance["event_"+name]=null)}function clearRefreshInterval(itemsContainer,isPausing){itemsContainer.refreshInterval&&(clearInterval(itemsContainer.refreshInterval),itemsContainer.refreshInterval=null,isPausing||(itemsContainer.refreshIntervalEndTime=null))}function resetRefreshInterval(itemsContainer,intervalMs){clearRefreshInterval(itemsContainer),intervalMs||(intervalMs=parseInt(itemsContainer.getAttribute("data-refreshinterval")||"0")),intervalMs&&(itemsContainer.refreshInterval=setInterval(itemsContainer.notifyRefreshNeeded.bind(itemsContainer),intervalMs),itemsContainer.refreshIntervalEndTime=(new Date).getTime()+intervalMs)}function onDataFetched(result){var items=result.Items||result,parentContainer=this.parentContainer;parentContainer&&(items.length?parentContainer.classList.remove("hide"):parentContainer.classList.add("hide"));var focusId,hasActiveElement,activeElement=document.activeElement;this.contains(activeElement)&&(hasActiveElement=!0,focusId=activeElement.getAttribute("data-id")),this.innerHTML=this.getItemsHtml(items),imageLoader.lazyChildren(this),hasActiveElement&&setFocus(this,focusId),resetRefreshInterval(this),this.afterRefresh&&this.afterRefresh(result)}function setFocus(itemsContainer,focusId){if(focusId){var newElement=itemsContainer.querySelector('[data-id="'+focusId+'"]');if(newElement)try{return void focusManager.focus(newElement)}catch(err){}}focusManager.autoFocus(itemsContainer)}var ItemsContainerProtoType=Object.create(HTMLDivElement.prototype);ItemsContainerProtoType.enableHoverMenu=function(enabled){var current=this.hoverMenu;if(!enabled)return void(current&&(current.destroy(),this.hoverMenu=null));if(!current){var self=this;require(["itemHoverMenu"],function(ItemHoverMenu){self.hoverMenu=new ItemHoverMenu(self)})}},ItemsContainerProtoType.enableMultiSelect=function(enabled){var current=this.multiSelect;if(!enabled)return void(current&&(current.destroy(),this.multiSelect=null));if(!current){var self=this;require(["multiSelect"],function(MultiSelect){self.multiSelect=new MultiSelect({container:self,bindOnClick:!1})})}},ItemsContainerProtoType.enableDragReordering=function(enabled){var current=this.sortable;if(!enabled)return void(current&&(current.destroy(),this.sortable=null));if(!current){var self=this;require(["sortable"],function(Sortable){self.sortable=new Sortable(self,{draggable:".listItem",handle:".listViewDragHandle",onEnd:function(evt){return onDrop(evt,self)}})})}},ItemsContainerProtoType.createdCallback=function(){this.classList.add("itemsContainer")},ItemsContainerProtoType.attachedCallback=function(){this.addEventListener("click",onClick),browser.touch?this.addEventListener("contextmenu",disableEvent):"false"!==this.getAttribute("data-contextmenu")&&this.addEventListener("contextmenu",onContextMenu),layoutManager.desktop&&"false"!==this.getAttribute("data-hovermenu")&&this.enableHoverMenu(!0),(layoutManager.desktop||layoutManager.mobile)&&"false"!==this.getAttribute("data-multiselect")&&this.enableMultiSelect(!0),layoutManager.tv&&this.classList.add("itemsContainer-tv"),itemShortcuts.on(this,getShortcutOptions()),addNotificationEvent(this,"UserDataChanged",onUserDataChanged),addNotificationEvent(this,"TimerCreated",onTimerCreated),addNotificationEvent(this,"SeriesTimerCreated",onSeriesTimerCreated),addNotificationEvent(this,"TimerCancelled",onTimerCancelled),addNotificationEvent(this,"SeriesTimerCancelled",onSeriesTimerCancelled),addNotificationEvent(this,"LibraryChanged",onLibraryChanged),addNotificationEvent(this,"playbackstop",onPlaybackStopped,playbackManager),"true"===this.getAttribute("data-dragreorder")&&this.enableDragReordering(!0)},ItemsContainerProtoType.detachedCallback=function(){clearRefreshInterval(this),this.enableHoverMenu(!1),this.enableMultiSelect(!1),this.enableDragReordering(!1),this.removeEventListener("click",onClick),this.removeEventListener("contextmenu",onContextMenu),this.removeEventListener("contextmenu",disableEvent),itemShortcuts.off(this,getShortcutOptions()),removeNotificationEvent(this,"UserDataChanged"),removeNotificationEvent(this,"TimerCreated"),removeNotificationEvent(this,"SeriesTimerCreated"),removeNotificationEvent(this,"TimerCancelled"),removeNotificationEvent(this,"SeriesTimerCancelled"),removeNotificationEvent(this,"LibraryChanged"),removeNotificationEvent(this,"playbackstop",playbackManager),this.fetchData=null,this.getItemsHtml=null,this.parentContainer=null},ItemsContainerProtoType.pause=function(){clearRefreshInterval(this,!0),this.paused=!0},ItemsContainerProtoType.resume=function(options){this.paused=!1;var refreshIntervalEndTime=this.refreshIntervalEndTime;if(refreshIntervalEndTime){var remainingMs=refreshIntervalEndTime-(new Date).getTime();remainingMs>0&&!this.needsRefresh?resetRefreshInterval(this,remainingMs):(this.needsRefresh=!0,this.refreshIntervalEndTime=null)}return this.needsRefresh||options&&options.refresh?this.refreshItems():Promise.resolve()},ItemsContainerProtoType.refreshItems=function(){return this.fetchData?this.paused?(this.needsRefresh=!0,Promise.resolve()):(this.needsRefresh=!1,this.fetchData().then(onDataFetched.bind(this))):Promise.resolve()},ItemsContainerProtoType.notifyRefreshNeeded=function(isInForeground){if(this.paused)return void(this.needsRefresh=!0);var timeout=this.refreshTimeout;timeout&&clearTimeout(timeout),isInForeground===!0?this.refreshItems():this.refreshTimeout=setTimeout(this.refreshItems.bind(this),1e4)},document.registerElement("emby-itemscontainer",{prototype:ItemsContainerProtoType,extends:"div"})}); \ No newline at end of file +define(["itemShortcuts","inputManager","connectionManager","playbackManager","imageLoader","layoutManager","browser","dom","loading","focusManager","serverNotifications","events","registerElement"],function(itemShortcuts,inputManager,connectionManager,playbackManager,imageLoader,layoutManager,browser,dom,loading,focusManager,serverNotifications,events){"use strict";function onClick(e){var itemsContainer=this,multiSelect=(e.target,itemsContainer.multiSelect);multiSelect&&!1===multiSelect.onContainerClick.call(itemsContainer,e)||itemShortcuts.onClick.call(itemsContainer,e)}function disableEvent(e){return e.preventDefault(),e.stopPropagation(),!1}function onContextMenu(e){var target=e.target,card=dom.parentWithAttribute(target,"data-id");if(card&&card.getAttribute("data-serverid"))return inputManager.trigger("menu",card),e.preventDefault(),e.stopPropagation(),!1}function getShortcutOptions(){return{click:!1}}function onDrop(evt,itemsContainer){var el=evt.item,newIndex=evt.newIndex,itemId=el.getAttribute("data-playlistitemid"),playlistId=el.getAttribute("data-playlistid");if(!playlistId){var oldIndex=evt.oldIndex;return void el.dispatchEvent(new CustomEvent("itemdrop",{detail:{oldIndex:oldIndex,newIndex:newIndex,playlistItemId:itemId},bubbles:!0,cancelable:!1}))}var serverId=el.getAttribute("data-serverid"),apiClient=connectionManager.getApiClient(serverId);loading.show(),apiClient.ajax({url:apiClient.getUrl("Playlists/"+playlistId+"/Items/"+itemId+"/Move/"+newIndex),type:"POST"}).then(function(){loading.hide()},function(){loading.hide(),itemsContainer.refreshItems()})}function onUserDataChanged(e,apiClient,userData){var itemsContainer=this;require(["cardBuilder"],function(cardBuilder){cardBuilder.onUserDataChanged(userData,itemsContainer)});var eventsToMonitor=getEventsToMonitor(itemsContainer);-1!==eventsToMonitor.indexOf("markfavorite")?itemsContainer.notifyRefreshNeeded():-1!==eventsToMonitor.indexOf("markplayed")&&itemsContainer.notifyRefreshNeeded()}function getEventsToMonitor(itemsContainer){var monitor=itemsContainer.getAttribute("data-monitor");return monitor?monitor.split(","):[]}function onTimerCreated(e,apiClient,data){var itemsContainer=this;if(-1!==getEventsToMonitor(itemsContainer).indexOf("timers"))return void itemsContainer.notifyRefreshNeeded();var programId=data.ProgramId,newTimerId=data.Id;require(["cardBuilder"],function(cardBuilder){cardBuilder.onTimerCreated(programId,newTimerId,itemsContainer)})}function onSeriesTimerCreated(e,apiClient,data){var itemsContainer=this;if(-1!==getEventsToMonitor(itemsContainer).indexOf("seriestimers"))return void itemsContainer.notifyRefreshNeeded()}function onTimerCancelled(e,apiClient,data){var itemsContainer=this;if(-1!==getEventsToMonitor(itemsContainer).indexOf("timers"))return void itemsContainer.notifyRefreshNeeded();var id=data.Id;require(["cardBuilder"],function(cardBuilder){cardBuilder.onTimerCancelled(id,itemsContainer)})}function onSeriesTimerCancelled(e,apiClient,data){var itemsContainer=this;if(-1!==getEventsToMonitor(itemsContainer).indexOf("seriestimers"))return void itemsContainer.notifyRefreshNeeded();var id=data.Id;require(["cardBuilder"],function(cardBuilder){cardBuilder.onSeriesTimerCancelled(id,itemsContainer)})}function onLibraryChanged(e,apiClient,data){var itemsContainer=this,eventsToMonitor=getEventsToMonitor(itemsContainer);if(-1===eventsToMonitor.indexOf("seriestimers")&&-1===eventsToMonitor.indexOf("timers")){var itemsAdded=data.ItemsAdded||[],itemsRemoved=data.ItemsRemoved||[];if(itemsAdded.length||itemsRemoved.length){var parentId=itemsContainer.getAttribute("data-parentid");if(parentId){var foldersAddedTo=data.FoldersAddedTo||[],foldersRemovedFrom=data.FoldersRemovedFrom||[],collectionFolders=data.CollectionFolders||[];if(-1===foldersAddedTo.indexOf(parentId)&&-1===foldersRemovedFrom.indexOf(parentId)&&-1===collectionFolders.indexOf(parentId))return}itemsContainer.notifyRefreshNeeded()}}}function onPlaybackStopped(e,stopInfo){var itemsContainer=this,state=stopInfo.state,eventsToMonitor=getEventsToMonitor(itemsContainer);if(state.NowPlayingItem&&"Video"===state.NowPlayingItem.MediaType){if(-1!==eventsToMonitor.indexOf("videoplayback"))return void itemsContainer.notifyRefreshNeeded(!0)}else if(state.NowPlayingItem&&"Audio"===state.NowPlayingItem.MediaType&&-1!==eventsToMonitor.indexOf("audioplayback"))return void itemsContainer.notifyRefreshNeeded(!0)}function addNotificationEvent(instance,name,handler,owner){var localHandler=handler.bind(instance);owner=owner||serverNotifications,events.on(owner,name,localHandler),instance["event_"+name]=localHandler}function removeNotificationEvent(instance,name,owner){var handler=instance["event_"+name];handler&&(owner=owner||serverNotifications,events.off(owner,name,handler),instance["event_"+name]=null)}function clearRefreshInterval(itemsContainer,isPausing){itemsContainer.refreshInterval&&(clearInterval(itemsContainer.refreshInterval),itemsContainer.refreshInterval=null,isPausing||(itemsContainer.refreshIntervalEndTime=null))}function resetRefreshInterval(itemsContainer,intervalMs){clearRefreshInterval(itemsContainer),intervalMs||(intervalMs=parseInt(itemsContainer.getAttribute("data-refreshinterval")||"0")),intervalMs&&(itemsContainer.refreshInterval=setInterval(itemsContainer.notifyRefreshNeeded.bind(itemsContainer),intervalMs),itemsContainer.refreshIntervalEndTime=(new Date).getTime()+intervalMs)}function onDataFetched(result){var items=result.Items||result,parentContainer=this.parentContainer;parentContainer&&(items.length?parentContainer.classList.remove("hide"):parentContainer.classList.add("hide"));var focusId,hasActiveElement,activeElement=document.activeElement;this.contains(activeElement)&&(hasActiveElement=!0,focusId=activeElement.getAttribute("data-id")),this.innerHTML=this.getItemsHtml(items),imageLoader.lazyChildren(this),hasActiveElement&&setFocus(this,focusId),resetRefreshInterval(this),this.afterRefresh&&this.afterRefresh(result)}function setFocus(itemsContainer,focusId){if(focusId){var newElement=itemsContainer.querySelector('[data-id="'+focusId+'"]');if(newElement)try{return void focusManager.focus(newElement)}catch(err){}}focusManager.autoFocus(itemsContainer)}var ItemsContainerProtoType=Object.create(HTMLDivElement.prototype);ItemsContainerProtoType.enableHoverMenu=function(enabled){var current=this.hoverMenu;if(!enabled)return void(current&&(current.destroy(),this.hoverMenu=null));if(!current){var self=this;require(["itemHoverMenu"],function(ItemHoverMenu){self.hoverMenu=new ItemHoverMenu(self)})}},ItemsContainerProtoType.enableMultiSelect=function(enabled){var current=this.multiSelect;if(!enabled)return void(current&&(current.destroy(),this.multiSelect=null));if(!current){var self=this;require(["multiSelect"],function(MultiSelect){self.multiSelect=new MultiSelect({container:self,bindOnClick:!1})})}},ItemsContainerProtoType.enableDragReordering=function(enabled){var current=this.sortable;if(!enabled)return void(current&&(current.destroy(),this.sortable=null));if(!current){var self=this;require(["sortable"],function(Sortable){self.sortable=new Sortable(self,{draggable:".listItem",handle:".listViewDragHandle",onEnd:function(evt){return onDrop(evt,self)}})})}},ItemsContainerProtoType.createdCallback=function(){this.classList.add("itemsContainer")},ItemsContainerProtoType.attachedCallback=function(){this.addEventListener("click",onClick),browser.touch?this.addEventListener("contextmenu",disableEvent):"false"!==this.getAttribute("data-contextmenu")&&this.addEventListener("contextmenu",onContextMenu),layoutManager.desktop&&"false"!==this.getAttribute("data-hovermenu")&&this.enableHoverMenu(!0),(layoutManager.desktop||layoutManager.mobile)&&"false"!==this.getAttribute("data-multiselect")&&this.enableMultiSelect(!0),layoutManager.tv&&this.classList.add("itemsContainer-tv"),itemShortcuts.on(this,getShortcutOptions()),addNotificationEvent(this,"UserDataChanged",onUserDataChanged),addNotificationEvent(this,"TimerCreated",onTimerCreated),addNotificationEvent(this,"SeriesTimerCreated",onSeriesTimerCreated),addNotificationEvent(this,"TimerCancelled",onTimerCancelled),addNotificationEvent(this,"SeriesTimerCancelled",onSeriesTimerCancelled),addNotificationEvent(this,"LibraryChanged",onLibraryChanged),addNotificationEvent(this,"playbackstop",onPlaybackStopped,playbackManager),"true"===this.getAttribute("data-dragreorder")&&this.enableDragReordering(!0)},ItemsContainerProtoType.detachedCallback=function(){clearRefreshInterval(this),this.enableHoverMenu(!1),this.enableMultiSelect(!1),this.enableDragReordering(!1),this.removeEventListener("click",onClick),this.removeEventListener("contextmenu",onContextMenu),this.removeEventListener("contextmenu",disableEvent),itemShortcuts.off(this,getShortcutOptions()),removeNotificationEvent(this,"UserDataChanged"),removeNotificationEvent(this,"TimerCreated"),removeNotificationEvent(this,"SeriesTimerCreated"),removeNotificationEvent(this,"TimerCancelled"),removeNotificationEvent(this,"SeriesTimerCancelled"),removeNotificationEvent(this,"LibraryChanged"),removeNotificationEvent(this,"playbackstop",playbackManager),this.fetchData=null,this.getItemsHtml=null,this.parentContainer=null},ItemsContainerProtoType.pause=function(){clearRefreshInterval(this,!0),this.paused=!0},ItemsContainerProtoType.resume=function(options){this.paused=!1;var refreshIntervalEndTime=this.refreshIntervalEndTime;if(refreshIntervalEndTime){var remainingMs=refreshIntervalEndTime-(new Date).getTime();remainingMs>0&&!this.needsRefresh?resetRefreshInterval(this,remainingMs):(this.needsRefresh=!0,this.refreshIntervalEndTime=null)}return this.needsRefresh||options&&options.refresh?this.refreshItems():Promise.resolve()},ItemsContainerProtoType.refreshItems=function(){return this.fetchData?this.paused?(this.needsRefresh=!0,Promise.resolve()):(this.needsRefresh=!1,this.fetchData().then(onDataFetched.bind(this))):Promise.resolve()},ItemsContainerProtoType.notifyRefreshNeeded=function(isInForeground){if(this.paused)return void(this.needsRefresh=!0);var timeout=this.refreshTimeout;timeout&&clearTimeout(timeout),!0===isInForeground?this.refreshItems():this.refreshTimeout=setTimeout(this.refreshItems.bind(this),1e4)},document.registerElement("emby-itemscontainer",{prototype:ItemsContainerProtoType,extends:"div"})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-progressring/emby-progressring.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-progressring/emby-progressring.js index 75f995c9d2..1db2139085 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-progressring/emby-progressring.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-progressring/emby-progressring.js @@ -1 +1 @@ -define(["require","css!./emby-progressring","registerElement"],function(require){"use strict";var EmbyProgressRing=Object.create(HTMLDivElement.prototype);return EmbyProgressRing.createdCallback=function(){this.classList.add("progressring");var instance=this;require(["text!./emby-progressring.template.html"],function(template){instance.innerHTML=template,instance.setProgress(parseFloat(instance.getAttribute("data-progress")||"0"))})},EmbyProgressRing.setProgress=function(progress){progress=Math.floor(progress);var angle;progress<25?(angle=-90+progress/100*360,this.querySelector(".animate-0-25-b").style.transform="rotate("+angle+"deg)",this.querySelector(".animate-25-50-b").style.transform="rotate(-90deg)",this.querySelector(".animate-50-75-b").style.transform="rotate(-90deg)",this.querySelector(".animate-75-100-b").style.transform="rotate(-90deg)"):progress>=25&&progress<50?(angle=-90+(progress-25)/100*360,this.querySelector(".animate-0-25-b").style.transform="none",this.querySelector(".animate-25-50-b").style.transform="rotate("+angle+"deg)",this.querySelector(".animate-50-75-b").style.transform="rotate(-90deg)",this.querySelector(".animate-75-100-b").style.transform="rotate(-90deg)"):progress>=50&&progress<75?(angle=-90+(progress-50)/100*360,this.querySelector(".animate-0-25-b").style.transform="none",this.querySelector(".animate-25-50-b").style.transform="none",this.querySelector(".animate-50-75-b").style.transform="rotate("+angle+"deg)",this.querySelector(".animate-75-100-b").style.transform="rotate(-90deg)"):progress>=75&&progress<=100&&(angle=-90+(progress-75)/100*360,this.querySelector(".animate-0-25-b").style.transform="none",this.querySelector(".animate-25-50-b").style.transform="none",this.querySelector(".animate-50-75-b").style.transform="none",this.querySelector(".animate-75-100-b").style.transform="rotate("+angle+"deg)"),this.querySelector(".progressring-text").innerHTML=progress+"%"},EmbyProgressRing.attachedCallback=function(){},EmbyProgressRing.detachedCallback=function(){var observer=this.observer;observer&&(observer.disconnect(),this.observer=null)},document.registerElement("emby-progressring",{prototype:EmbyProgressRing,extends:"div"}),EmbyProgressRing}); \ No newline at end of file +define(["require","css!./emby-progressring","registerElement"],function(require){"use strict";var EmbyProgressRing=Object.create(HTMLDivElement.prototype);return EmbyProgressRing.createdCallback=function(){this.classList.add("progressring");var instance=this;require(["text!./emby-progressring.template.html"],function(template){instance.innerHTML=template,instance.setProgress(parseFloat(instance.getAttribute("data-progress")||"0"))})},EmbyProgressRing.setProgress=function(progress){progress=Math.floor(progress);var angle;progress<25?(angle=progress/100*360-90,this.querySelector(".animate-0-25-b").style.transform="rotate("+angle+"deg)",this.querySelector(".animate-25-50-b").style.transform="rotate(-90deg)",this.querySelector(".animate-50-75-b").style.transform="rotate(-90deg)",this.querySelector(".animate-75-100-b").style.transform="rotate(-90deg)"):progress>=25&&progress<50?(angle=(progress-25)/100*360-90,this.querySelector(".animate-0-25-b").style.transform="none",this.querySelector(".animate-25-50-b").style.transform="rotate("+angle+"deg)",this.querySelector(".animate-50-75-b").style.transform="rotate(-90deg)",this.querySelector(".animate-75-100-b").style.transform="rotate(-90deg)"):progress>=50&&progress<75?(angle=(progress-50)/100*360-90,this.querySelector(".animate-0-25-b").style.transform="none",this.querySelector(".animate-25-50-b").style.transform="none",this.querySelector(".animate-50-75-b").style.transform="rotate("+angle+"deg)",this.querySelector(".animate-75-100-b").style.transform="rotate(-90deg)"):progress>=75&&progress<=100&&(angle=(progress-75)/100*360-90,this.querySelector(".animate-0-25-b").style.transform="none",this.querySelector(".animate-25-50-b").style.transform="none",this.querySelector(".animate-50-75-b").style.transform="none",this.querySelector(".animate-75-100-b").style.transform="rotate("+angle+"deg)"),this.querySelector(".progressring-text").innerHTML=progress+"%"},EmbyProgressRing.attachedCallback=function(){},EmbyProgressRing.detachedCallback=function(){var observer=this.observer;observer&&(observer.disconnect(),this.observer=null)},document.registerElement("emby-progressring",{prototype:EmbyProgressRing,extends:"div"}),EmbyProgressRing}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-scrollbuttons/emby-scrollbuttons.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-scrollbuttons/emby-scrollbuttons.js index f961238f92..2fabc5df06 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-scrollbuttons/emby-scrollbuttons.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-scrollbuttons/emby-scrollbuttons.js @@ -1 +1 @@ -define(["layoutManager","dom","css!./emby-scrollbuttons","registerElement","paper-icon-button-light"],function(layoutManager,dom){"use strict";function getScrollButtonContainerHtml(direction){var html="",hide="left"===direction?" hide":"";html+='
';var icon="left"===direction?"":"";return html+='",html+="
"}function getScrollPosition(parent){return parent.getScrollPosition?parent.getScrollPosition():0}function getScrollWidth(parent){return parent.getScrollSize?parent.getScrollSize():0}function onScrolledToPosition(scrollButtons,pos,scrollWidth){pos>0?scrollButtons.scrollButtonsLeft.classList.remove("hide"):scrollButtons.scrollButtonsLeft.classList.add("hide"),scrollWidth>0&&(pos+=scrollButtons.offsetWidth,pos>=scrollWidth?scrollButtons.scrollButtonsRight.classList.add("hide"):scrollButtons.scrollButtonsRight.classList.remove("hide"))}function onScroll(e){var scrollButtons=this,scroller=this.scroller,pos=getScrollPosition(scroller),scrollWidth=getScrollWidth(scroller);onScrolledToPosition(scrollButtons,pos,scrollWidth)}function getStyleValue(style,name){var value=style.getPropertyValue(name);return value&&(value=value.replace("px",""))?(value=parseInt(value),isNaN(value)?0:value):0}function getScrollSize(elem){var scrollSize=elem.offsetWidth,style=window.getComputedStyle(elem,null),paddingLeft=getStyleValue(style,"padding-left");paddingLeft&&(scrollSize-=paddingLeft);var paddingRight=getStyleValue(style,"padding-right");paddingRight&&(scrollSize-=paddingRight);var slider=elem.getScrollSlider();return style=window.getComputedStyle(slider,null),paddingLeft=getStyleValue(style,"padding-left"),paddingLeft&&(scrollSize-=paddingLeft),paddingRight=getStyleValue(style,"padding-right"),paddingRight&&(scrollSize-=paddingRight),scrollSize}function onScrollButtonClick(e){var newPos,parent=dom.parentWithAttribute(this,"is","emby-scroller"),direction=this.getAttribute("data-direction"),scrollSize=getScrollSize(parent),pos=getScrollPosition(parent);newPos="left"===direction?Math.max(0,pos-scrollSize):pos+scrollSize,parent.scrollToPosition(newPos,!1)}var EmbyScrollButtonsPrototype=Object.create(HTMLDivElement.prototype);EmbyScrollButtonsPrototype.createdCallback=function(){},EmbyScrollButtonsPrototype.attachedCallback=function(){var parent=dom.parentWithAttribute(this,"is","emby-scroller");this.scroller=parent,parent.classList.add("emby-scrollbuttons-scroller"),this.innerHTML=getScrollButtonContainerHtml("left")+getScrollButtonContainerHtml("right");var scrollHandler=onScroll.bind(this);this.scrollHandler=scrollHandler;var buttons=this.querySelectorAll(".emby-scrollbuttons-scrollbutton");buttons[0].addEventListener("click",onScrollButtonClick),buttons[1].addEventListener("click",onScrollButtonClick),buttons=this.querySelectorAll(".scrollbuttoncontainer"),this.scrollButtonsLeft=buttons[0],this.scrollButtonsRight=buttons[1],parent.addScrollEventListener(scrollHandler,{capture:!1,passive:!0})},EmbyScrollButtonsPrototype.detachedCallback=function(){var parent=this.scroller;this.scroller=null;var scrollHandler=this.scrollHandler;parent&&scrollHandler&&parent.removeScrollEventListener(scrollHandler,{capture:!1,passive:!0}),this.scrollHandler=null,this.scrollButtonsLeft=null,this.scrollButtonsRight=null},document.registerElement("emby-scrollbuttons",{prototype:EmbyScrollButtonsPrototype,extends:"div"})}); \ No newline at end of file +define(["layoutManager","dom","css!./emby-scrollbuttons","registerElement","paper-icon-button-light"],function(layoutManager,dom){"use strict";function getScrollButtonContainerHtml(direction){var html="";html+='
';var icon="left"===direction?"":"";return html+='",html+="
"}function getScrollPosition(parent){return parent.getScrollPosition?parent.getScrollPosition():0}function getScrollWidth(parent){return parent.getScrollSize?parent.getScrollSize():0}function onScrolledToPosition(scrollButtons,pos,scrollWidth){pos>0?scrollButtons.scrollButtonsLeft.classList.remove("hide"):scrollButtons.scrollButtonsLeft.classList.add("hide"),scrollWidth>0&&(pos+=scrollButtons.offsetWidth,pos>=scrollWidth?scrollButtons.scrollButtonsRight.classList.add("hide"):scrollButtons.scrollButtonsRight.classList.remove("hide"))}function onScroll(e){var scrollButtons=this,scroller=this.scroller;onScrolledToPosition(scrollButtons,getScrollPosition(scroller),getScrollWidth(scroller))}function getStyleValue(style,name){var value=style.getPropertyValue(name);return value&&(value=value.replace("px",""))?(value=parseInt(value),isNaN(value)?0:value):0}function getScrollSize(elem){var scrollSize=elem.offsetWidth,style=window.getComputedStyle(elem,null),paddingLeft=getStyleValue(style,"padding-left");paddingLeft&&(scrollSize-=paddingLeft);var paddingRight=getStyleValue(style,"padding-right");paddingRight&&(scrollSize-=paddingRight);var slider=elem.getScrollSlider();return style=window.getComputedStyle(slider,null),paddingLeft=getStyleValue(style,"padding-left"),paddingLeft&&(scrollSize-=paddingLeft),paddingRight=getStyleValue(style,"padding-right"),paddingRight&&(scrollSize-=paddingRight),scrollSize}function onScrollButtonClick(e){var newPos,parent=dom.parentWithAttribute(this,"is","emby-scroller"),direction=this.getAttribute("data-direction"),scrollSize=getScrollSize(parent),pos=getScrollPosition(parent);newPos="left"===direction?Math.max(0,pos-scrollSize):pos+scrollSize,parent.scrollToPosition(newPos,!1)}var EmbyScrollButtonsPrototype=Object.create(HTMLDivElement.prototype);EmbyScrollButtonsPrototype.createdCallback=function(){},EmbyScrollButtonsPrototype.attachedCallback=function(){var parent=dom.parentWithAttribute(this,"is","emby-scroller");this.scroller=parent,parent.classList.add("emby-scrollbuttons-scroller"),this.innerHTML=getScrollButtonContainerHtml("left")+getScrollButtonContainerHtml("right");var scrollHandler=onScroll.bind(this);this.scrollHandler=scrollHandler;var buttons=this.querySelectorAll(".emby-scrollbuttons-scrollbutton");buttons[0].addEventListener("click",onScrollButtonClick),buttons[1].addEventListener("click",onScrollButtonClick),buttons=this.querySelectorAll(".scrollbuttoncontainer"),this.scrollButtonsLeft=buttons[0],this.scrollButtonsRight=buttons[1],parent.addScrollEventListener(scrollHandler,{capture:!1,passive:!0})},EmbyScrollButtonsPrototype.detachedCallback=function(){var parent=this.scroller;this.scroller=null;var scrollHandler=this.scrollHandler;parent&&scrollHandler&&parent.removeScrollEventListener(scrollHandler,{capture:!1,passive:!0}),this.scrollHandler=null,this.scrollButtonsLeft=null,this.scrollButtonsRight=null},document.registerElement("emby-scrollbuttons",{prototype:EmbyScrollButtonsPrototype,extends:"div"})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-select/emby-select.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-select/emby-select.js index ddc9317232..348dba221a 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-select/emby-select.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-select/emby-select.js @@ -1 +1 @@ -define(["layoutManager","browser","actionsheet","css!./emby-select","registerElement"],function(layoutManager,browser,actionsheet){"use strict";function enableNativeMenu(){return!(!browser.edgeUwp&&!browser.xboxOne)||!browser.tizen&&!browser.orsay&&(!!browser.tv||!layoutManager.tv)}function triggerChange(select){var evt=document.createEvent("HTMLEvents");evt.initEvent("change",!1,!0),select.dispatchEvent(evt)}function setValue(select,value){select.value=value}function showActionSheet(select){var labelElem=getLabel(select),title=labelElem?labelElem.textContent||labelElem.innerText:null;actionsheet.show({items:select.options,positionTo:select,title:title}).then(function(value){setValue(select,value),triggerChange(select)})}function getLabel(select){for(var elem=select.previousSibling;elem&&"LABEL"!==elem.tagName;)elem=elem.previousSibling;return elem}function onFocus(e){var label=getLabel(this);label&&label.classList.add("selectLabelFocused")}function onBlur(e){var label=getLabel(this);label&&label.classList.remove("selectLabelFocused")}function onMouseDown(e){e.button||enableNativeMenu()||(e.preventDefault(),showActionSheet(this))}function onKeyDown(e){switch(e.keyCode){case 13:return void(enableNativeMenu()||(e.preventDefault(),showActionSheet(this)));case 37:case 38:case 39:case 40:return void(layoutManager.tv&&e.preventDefault())}}var EmbySelectPrototype=Object.create(HTMLSelectElement.prototype),inputId=0;EmbySelectPrototype.createdCallback=function(){this.id||(this.id="embyselect"+inputId,inputId++),browser.firefox||(this.classList.add("emby-select-withcolor"),layoutManager.tv&&this.classList.add("emby-select-tv-withcolor")),layoutManager.tv&&this.classList.add("emby-select-focusscale"),this.addEventListener("mousedown",onMouseDown),this.addEventListener("keydown",onKeyDown),this.addEventListener("focus",onFocus),this.addEventListener("blur",onBlur)},EmbySelectPrototype.attachedCallback=function(){if(!this.classList.contains("emby-select")){this.classList.add("emby-select");var label=this.ownerDocument.createElement("label");label.innerHTML=this.getAttribute("label")||"",label.classList.add("selectLabel"),label.htmlFor=this.id,this.parentNode.insertBefore(label,this),this.classList.contains("emby-select-withcolor")&&this.parentNode.insertAdjacentHTML("beforeend",'
0
')}},EmbySelectPrototype.setLabel=function(text){var label=this.parentNode.querySelector("label");label.innerHTML=text},document.registerElement("emby-select",{prototype:EmbySelectPrototype,extends:"select"})}); \ No newline at end of file +define(["layoutManager","browser","actionsheet","css!./emby-select","registerElement"],function(layoutManager,browser,actionsheet){"use strict";function enableNativeMenu(){return!(!browser.edgeUwp&&!browser.xboxOne)||!browser.tizen&&!browser.orsay&&(!!browser.tv||!layoutManager.tv)}function triggerChange(select){var evt=document.createEvent("HTMLEvents");evt.initEvent("change",!1,!0),select.dispatchEvent(evt)}function setValue(select,value){select.value=value}function showActionSheet(select){var labelElem=getLabel(select),title=labelElem?labelElem.textContent||labelElem.innerText:null;actionsheet.show({items:select.options,positionTo:select,title:title}).then(function(value){setValue(select,value),triggerChange(select)})}function getLabel(select){for(var elem=select.previousSibling;elem&&"LABEL"!==elem.tagName;)elem=elem.previousSibling;return elem}function onFocus(e){var label=getLabel(this);label&&label.classList.add("selectLabelFocused")}function onBlur(e){var label=getLabel(this);label&&label.classList.remove("selectLabelFocused")}function onMouseDown(e){e.button||enableNativeMenu()||(e.preventDefault(),showActionSheet(this))}function onKeyDown(e){switch(e.keyCode){case 13:return void(enableNativeMenu()||(e.preventDefault(),showActionSheet(this)));case 37:case 38:case 39:case 40:return void(layoutManager.tv&&e.preventDefault())}}var EmbySelectPrototype=Object.create(HTMLSelectElement.prototype),inputId=0;EmbySelectPrototype.createdCallback=function(){this.id||(this.id="embyselect"+inputId,inputId++),browser.firefox||(this.classList.add("emby-select-withcolor"),layoutManager.tv&&this.classList.add("emby-select-tv-withcolor")),layoutManager.tv&&this.classList.add("emby-select-focusscale"),this.addEventListener("mousedown",onMouseDown),this.addEventListener("keydown",onKeyDown),this.addEventListener("focus",onFocus),this.addEventListener("blur",onBlur)},EmbySelectPrototype.attachedCallback=function(){if(!this.classList.contains("emby-select")){this.classList.add("emby-select");var label=this.ownerDocument.createElement("label");label.innerHTML=this.getAttribute("label")||"",label.classList.add("selectLabel"),label.htmlFor=this.id,this.parentNode.insertBefore(label,this),this.classList.contains("emby-select-withcolor")&&this.parentNode.insertAdjacentHTML("beforeend",'
0
')}},EmbySelectPrototype.setLabel=function(text){this.parentNode.querySelector("label").innerHTML=text},document.registerElement("emby-select",{prototype:EmbySelectPrototype,extends:"select"})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-tabs/emby-tabs.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-tabs/emby-tabs.js index f7f38a7d58..bbaca2277e 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-tabs/emby-tabs.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-tabs/emby-tabs.js @@ -1 +1 @@ -define(["dom","scroller","browser","layoutManager","focusManager","registerElement","css!./emby-tabs","scrollStyles"],function(dom,scroller,browser,layoutManager,focusManager){"use strict";function setActiveTabButton(tabs,newButton,oldButton,animate){newButton.classList.add(activeButtonClass)}function getFocusCallback(tabs,e){return function(){onClick.call(tabs,e)}}function onFocus(e){layoutManager.tv&&(this.focusTimeout&&clearTimeout(this.focusTimeout),this.focusTimeout=setTimeout(getFocusCallback(this,e),700))}function getTabPanel(tabs,index){return null}function removeActivePanelClass(tabs,index){var tabPanel=getTabPanel(tabs,index);tabPanel&&tabPanel.classList.remove("is-active")}function fadeInRight(elem){var pct=browser.mobile?"4%":"0.5%",keyframes=[{opacity:"0",transform:"translate3d("+pct+", 0, 0)",offset:0},{opacity:"1",transform:"none",offset:1}];elem.animate(keyframes,{duration:160,iterations:1,easing:"ease-out"})}function triggerBeforeTabChange(tabs,index,previousIndex){tabs.dispatchEvent(new CustomEvent("beforetabchange",{detail:{selectedTabIndex:index,previousIndex:previousIndex}})),null!=previousIndex&&previousIndex!==index&&removeActivePanelClass(tabs,previousIndex);var newPanel=getTabPanel(tabs,index);newPanel&&(newPanel.animate&&fadeInRight(newPanel),newPanel.classList.add("is-active"))}function onClick(e){this.focusTimeout&&clearTimeout(this.focusTimeout);var tabs=this,current=tabs.querySelector("."+activeButtonClass),tabButton=dom.parentWithClass(e.target,buttonClass);if(tabButton&&tabButton!==current){current&¤t.classList.remove(activeButtonClass);var previousIndex=current?parseInt(current.getAttribute("data-index")):null;setActiveTabButton(tabs,tabButton,current,!0);var index=parseInt(tabButton.getAttribute("data-index"));triggerBeforeTabChange(tabs,index,previousIndex),setTimeout(function(){tabs.selectedTabIndex=index,tabs.dispatchEvent(new CustomEvent("tabchange",{detail:{selectedTabIndex:index,previousIndex:previousIndex}}))},120),tabs.scroller&&tabs.scroller.toCenter(tabButton,!1)}}function initScroller(tabs){if(!tabs.scroller){var contentScrollSlider=tabs.querySelector(".emby-tabs-slider");contentScrollSlider?(tabs.scroller=new scroller(tabs,{horizontal:1,itemNav:0,mouseDragging:1,touchDragging:1,slidee:contentScrollSlider,smart:!0,releaseSwing:!0,scrollBy:200,speed:120,elasticBounds:1,dragHandle:1,dynamicHandle:1,clickBar:1,hiddenScroll:!0,requireAnimation:!browser.safari,allowNativeSmoothScroll:!0}),tabs.scroller.init()):(tabs.classList.add("scrollX"),tabs.classList.add("hiddenScrollX"),tabs.classList.add("smoothScrollX"))}}function getSelectedTabButton(elem){return elem.querySelector("."+activeButtonClass)}function getSibling(elem,method){for(var sibling=elem[method];sibling;){if(sibling.classList.contains(buttonClass)&&!sibling.classList.contains("hide"))return sibling;sibling=sibling[method]}return null}var EmbyTabs=Object.create(HTMLDivElement.prototype),buttonClass="emby-tab-button",activeButtonClass=buttonClass+"-active";EmbyTabs.createdCallback=function(){this.classList.contains("emby-tabs")||(this.classList.add("emby-tabs"),this.classList.add("focusable"),dom.addEventListener(this,"click",onClick,{passive:!0}),dom.addEventListener(this,"focus",onFocus,{passive:!0,capture:!0}))},EmbyTabs.focus=function(){var selected=this.querySelector("."+activeButtonClass);selected?focusManager.focus(selected):focusManager.autoFocus(this)},EmbyTabs.refresh=function(){this.scroller&&this.scroller.reload()},EmbyTabs.attachedCallback=function(){initScroller(this);var current=this.querySelector("."+activeButtonClass),currentIndex=current?parseInt(current.getAttribute("data-index")):parseInt(this.getAttribute("data-index")||"0");if(currentIndex!==-1){this.selectedTabIndex=currentIndex;var tabButtons=this.querySelectorAll("."+buttonClass),newTabButton=tabButtons[currentIndex];newTabButton&&setActiveTabButton(this,newTabButton,current,!1)}this.readyFired||(this.readyFired=!0,this.dispatchEvent(new CustomEvent("ready",{})))},EmbyTabs.detachedCallback=function(){this.scroller&&(this.scroller.destroy(),this.scroller=null),dom.removeEventListener(this,"click",onClick,{passive:!0}),dom.removeEventListener(this,"focus",onFocus,{passive:!0,capture:!0})},EmbyTabs.selectedIndex=function(selected,triggerEvent){var tabs=this;if(null==selected)return tabs.selectedTabIndex||0;var current=tabs.selectedIndex();tabs.selectedTabIndex=selected;var tabButtons=tabs.querySelectorAll("."+buttonClass);if(current===selected||triggerEvent===!1){triggerBeforeTabChange(tabs,selected,current),tabs.dispatchEvent(new CustomEvent("tabchange",{detail:{selectedTabIndex:selected}}));var currentTabButton=tabButtons[current];setActiveTabButton(tabs,tabButtons[selected],currentTabButton,!1),current!==selected&¤tTabButton&¤tTabButton.classList.remove(activeButtonClass)}else onClick.call(tabs,{target:tabButtons[selected]})},EmbyTabs.selectNext=function(){var current=getSelectedTabButton(this),sibling=getSibling(current,"nextSibling");sibling&&onClick.call(this,{target:sibling})},EmbyTabs.selectPrevious=function(){var current=getSelectedTabButton(this),sibling=getSibling(current,"previousSibling");sibling&&onClick.call(this,{target:sibling})},EmbyTabs.triggerBeforeTabChange=function(selected){var tabs=this;triggerBeforeTabChange(tabs,tabs.selectedIndex())},EmbyTabs.triggerTabChange=function(selected){var tabs=this;tabs.dispatchEvent(new CustomEvent("tabchange",{detail:{selectedTabIndex:tabs.selectedIndex()}}))},EmbyTabs.setTabEnabled=function(index,enabled){var btn=this.querySelector('.emby-tab-button[data-index="'+index+'"]');enabled?btn.classList.remove("hide"):btn.classList.remove("add")},document.registerElement("emby-tabs",{prototype:EmbyTabs,extends:"div"})}); \ No newline at end of file +define(["dom","scroller","browser","layoutManager","focusManager","registerElement","css!./emby-tabs","scrollStyles"],function(dom,scroller,browser,layoutManager,focusManager){"use strict";function setActiveTabButton(tabs,newButton,oldButton,animate){newButton.classList.add(activeButtonClass)}function getFocusCallback(tabs,e){return function(){onClick.call(tabs,e)}}function onFocus(e){layoutManager.tv&&(this.focusTimeout&&clearTimeout(this.focusTimeout),this.focusTimeout=setTimeout(getFocusCallback(this,e),700))}function getTabPanel(tabs,index){return null}function removeActivePanelClass(tabs,index){var tabPanel=getTabPanel(tabs,index);tabPanel&&tabPanel.classList.remove("is-active")}function fadeInRight(elem){var pct=browser.mobile?"4%":"0.5%",keyframes=[{opacity:"0",transform:"translate3d("+pct+", 0, 0)",offset:0},{opacity:"1",transform:"none",offset:1}];elem.animate(keyframes,{duration:160,iterations:1,easing:"ease-out"})}function triggerBeforeTabChange(tabs,index,previousIndex){tabs.dispatchEvent(new CustomEvent("beforetabchange",{detail:{selectedTabIndex:index,previousIndex:previousIndex}})),null!=previousIndex&&previousIndex!==index&&removeActivePanelClass(tabs,previousIndex);var newPanel=getTabPanel(tabs,index);newPanel&&(newPanel.animate&&fadeInRight(newPanel),newPanel.classList.add("is-active"))}function onClick(e){this.focusTimeout&&clearTimeout(this.focusTimeout);var tabs=this,current=tabs.querySelector("."+activeButtonClass),tabButton=dom.parentWithClass(e.target,buttonClass);if(tabButton&&tabButton!==current){current&¤t.classList.remove(activeButtonClass);var previousIndex=current?parseInt(current.getAttribute("data-index")):null;setActiveTabButton(tabs,tabButton,current,!0);var index=parseInt(tabButton.getAttribute("data-index"));triggerBeforeTabChange(tabs,index,previousIndex),setTimeout(function(){tabs.selectedTabIndex=index,tabs.dispatchEvent(new CustomEvent("tabchange",{detail:{selectedTabIndex:index,previousIndex:previousIndex}}))},120),tabs.scroller&&tabs.scroller.toCenter(tabButton,!1)}}function initScroller(tabs){if(!tabs.scroller){var contentScrollSlider=tabs.querySelector(".emby-tabs-slider");contentScrollSlider?(tabs.scroller=new scroller(tabs,{horizontal:1,itemNav:0,mouseDragging:1,touchDragging:1,slidee:contentScrollSlider,smart:!0,releaseSwing:!0,scrollBy:200,speed:120,elasticBounds:1,dragHandle:1,dynamicHandle:1,clickBar:1,hiddenScroll:!0,requireAnimation:!browser.safari,allowNativeSmoothScroll:!0}),tabs.scroller.init()):(tabs.classList.add("scrollX"),tabs.classList.add("hiddenScrollX"),tabs.classList.add("smoothScrollX"))}}function getSelectedTabButton(elem){return elem.querySelector("."+activeButtonClass)}function getSibling(elem,method){for(var sibling=elem[method];sibling;){if(sibling.classList.contains(buttonClass)&&!sibling.classList.contains("hide"))return sibling;sibling=sibling[method]}return null}var EmbyTabs=Object.create(HTMLDivElement.prototype),buttonClass="emby-tab-button",activeButtonClass=buttonClass+"-active";EmbyTabs.createdCallback=function(){this.classList.contains("emby-tabs")||(this.classList.add("emby-tabs"),this.classList.add("focusable"),dom.addEventListener(this,"click",onClick,{passive:!0}),dom.addEventListener(this,"focus",onFocus,{passive:!0,capture:!0}))},EmbyTabs.focus=function(){var selected=this.querySelector("."+activeButtonClass);selected?focusManager.focus(selected):focusManager.autoFocus(this)},EmbyTabs.refresh=function(){this.scroller&&this.scroller.reload()},EmbyTabs.attachedCallback=function(){initScroller(this);var current=this.querySelector("."+activeButtonClass),currentIndex=current?parseInt(current.getAttribute("data-index")):parseInt(this.getAttribute("data-index")||"0");if(-1!==currentIndex){this.selectedTabIndex=currentIndex;var tabButtons=this.querySelectorAll("."+buttonClass),newTabButton=tabButtons[currentIndex];newTabButton&&setActiveTabButton(this,newTabButton,current,!1)}this.readyFired||(this.readyFired=!0,this.dispatchEvent(new CustomEvent("ready",{})))},EmbyTabs.detachedCallback=function(){this.scroller&&(this.scroller.destroy(),this.scroller=null),dom.removeEventListener(this,"click",onClick,{passive:!0}),dom.removeEventListener(this,"focus",onFocus,{passive:!0,capture:!0})},EmbyTabs.selectedIndex=function(selected,triggerEvent){var tabs=this;if(null==selected)return tabs.selectedTabIndex||0;var current=tabs.selectedIndex();tabs.selectedTabIndex=selected;var tabButtons=tabs.querySelectorAll("."+buttonClass);if(current===selected||!1===triggerEvent){triggerBeforeTabChange(tabs,selected,current),tabs.dispatchEvent(new CustomEvent("tabchange",{detail:{selectedTabIndex:selected}}));var currentTabButton=tabButtons[current];setActiveTabButton(tabs,tabButtons[selected],currentTabButton,!1),current!==selected&¤tTabButton&¤tTabButton.classList.remove(activeButtonClass)}else onClick.call(tabs,{target:tabButtons[selected]})},EmbyTabs.selectNext=function(){var current=getSelectedTabButton(this),sibling=getSibling(current,"nextSibling");sibling&&onClick.call(this,{target:sibling})},EmbyTabs.selectPrevious=function(){var current=getSelectedTabButton(this),sibling=getSibling(current,"previousSibling");sibling&&onClick.call(this,{target:sibling})},EmbyTabs.triggerBeforeTabChange=function(selected){var tabs=this;triggerBeforeTabChange(tabs,tabs.selectedIndex())},EmbyTabs.triggerTabChange=function(selected){var tabs=this;tabs.dispatchEvent(new CustomEvent("tabchange",{detail:{selectedTabIndex:tabs.selectedIndex()}}))},EmbyTabs.setTabEnabled=function(index,enabled){var btn=this.querySelector('.emby-tab-button[data-index="'+index+'"]');enabled?btn.classList.remove("hide"):btn.classList.remove("add")},document.registerElement("emby-tabs",{prototype:EmbyTabs,extends:"div"})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-textarea/emby-textarea.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-textarea/emby-textarea.js index 5c705318d2..70108e0143 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-textarea/emby-textarea.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/emby-textarea/emby-textarea.js @@ -1 +1 @@ -define(["layoutManager","browser","css!./emby-textarea","registerElement","emby-input"],function(layoutManager,browser){"use strict";function autoGrow(textarea,maxLines){function reset(){textarea.rows=1,offset=self.getOffset(textarea),self.rows=textarea.rows||1,self.lineHeight=textarea.scrollHeight/self.rows-offset/self.rows,self.maxAllowedHeight=self.lineHeight*maxLines-offset}function autogrowFn(){if((!self.lineHeight||self.lineHeight<=0)&&reset(),self.lineHeight<=0)return textarea.style.overflowY="scroll",textarea.style.height="auto",void(textarea.rows=3);var newHeight=0,hasGrown=!1;textarea.scrollHeight-offset>self.maxAllowedHeight?(textarea.style.overflowY="scroll",newHeight=self.maxAllowedHeight):(textarea.style.overflowY="hidden",textarea.style.height="auto",newHeight=textarea.scrollHeight,hasGrown=!0),textarea.style.height=newHeight+"px"}var self=this;void 0===maxLines&&(maxLines=999),self.getOffset=function(textarea){for(var style=window.getComputedStyle(textarea,null),props=["paddingTop","paddingBottom"],offset=0,i=0;iself.maxAllowedHeight?(textarea.style.overflowY="scroll",newHeight=self.maxAllowedHeight):(textarea.style.overflowY="hidden",textarea.style.height="auto",newHeight=textarea.scrollHeight),textarea.style.height=newHeight+"px"}var self=this;void 0===maxLines&&(maxLines=999),self.getOffset=function(textarea){for(var style=window.getComputedStyle(textarea,null),props=["paddingTop","paddingBottom"],offset=0,i=0;i',itemHtml+=""+filter.Name+"",itemHtml+=""}).join(""),elem.querySelector(".filterOptions").innerHTML=html}function renderDynamicFilters(context,result,options){renderOptions(context,".genreFilters","chkGenreFilter",result.Genres,function(i){var delimeter="|";return(delimeter+(options.settings.GenreIds||"")+delimeter).indexOf(delimeter+i.Id+delimeter)!==-1})}function loadDynamicFilters(context,options){var apiClient=connectionManager.getApiClient(options.serverId),filterMenuOptions=Object.assign(options.filterMenuOptions,{UserId:apiClient.getCurrentUserId(),ParentId:options.parentId,IncludeItemTypes:options.itemTypes.join(",")});apiClient.getFilters(filterMenuOptions).then(function(result){renderDynamicFilters(context,result,options)},function(){})}function initEditor(context,settings){context.querySelector("form").addEventListener("submit",onSubmit);var i,length,elems=context.querySelectorAll(".simpleFilter");for(i=0,length=elems.length;i',itemHtml+=""+filter.Name+"",itemHtml+=""}).join(""),elem.querySelector(".filterOptions").innerHTML=html}function renderDynamicFilters(context,result,options){renderOptions(context,".genreFilters","chkGenreFilter",result.Genres,function(i){return-1!==("|"+(options.settings.GenreIds||"")+"|").indexOf("|"+i.Id+"|")})}function loadDynamicFilters(context,options){var apiClient=connectionManager.getApiClient(options.serverId),filterMenuOptions=Object.assign(options.filterMenuOptions,{UserId:apiClient.getCurrentUserId(),ParentId:options.parentId,IncludeItemTypes:options.itemTypes.join(",")});apiClient.getFilters(filterMenuOptions).then(function(result){renderDynamicFilters(context,result,options)},function(){})}function initEditor(context,settings){context.querySelector("form").addEventListener("submit",onSubmit);var i,length,elems=context.querySelectorAll(".simpleFilter");for(i=0,length=elems.length;i=limit))break}return focusableElements}function isFocusContainer(elem,direction){if(focusableContainerTagNames.indexOf(elem.tagName)!==-1)return!0;var classList=elem.classList;if(classList.contains("focuscontainer"))return!0;if(0===direction){if(classList.contains("focuscontainer-x"))return!0;if(classList.contains("focuscontainer-left"))return!0}else if(1===direction){if(classList.contains("focuscontainer-x"))return!0;if(classList.contains("focuscontainer-right"))return!0}else if(2===direction){if(classList.contains("focuscontainer-y"))return!0}else if(3===direction){if(classList.contains("focuscontainer-y"))return!0;if(classList.contains("focuscontainer-down"))return!0}return!1}function getFocusContainer(elem,direction){for(;!isFocusContainer(elem,direction);)if(elem=elem.parentNode,!elem)return getDefaultScope();return elem}function getOffset(elem){var box;if(box=elem.getBoundingClientRect?elem.getBoundingClientRect():{top:0,left:0,width:0,height:0},null===box.right){var newBox={top:box.top,left:box.left,width:box.width,height:box.height};box=newBox,box.right=box.left+box.width,box.bottom=box.top+box.height}return box}function nav(activeElement,direction,container,focusableElements){if(activeElement=activeElement||document.activeElement,activeElement&&(activeElement=focusableParent(activeElement)),container=container||(activeElement?getFocusContainer(activeElement,direction):getDefaultScope()),!activeElement)return void autoFocus(container,!0,!1);for(var nearestElement,focusableContainer=dom.parentWithClass(activeElement,"focusable"),rect=getOffset(activeElement),point1x=parseFloat(rect.left)||0,point1y=parseFloat(rect.top)||0,point2x=parseFloat(point1x+rect.width-1)||point1x,point2y=parseFloat(point1y+rect.height-1)||point1y,sourceMidX=(Math.min,Math.max,rect.left+rect.width/2),sourceMidY=rect.top+rect.height/2,focusable=focusableElements||container.querySelectorAll(focusableQuery),maxDistance=1/0,minDistance=maxDistance,i=0,length=focusable.length;i=rect.left)continue;if(elementRect.right===rect.right)continue;break;case 1:if(elementRect.right<=rect.right)continue;if(elementRect.left===rect.left)continue;break;case 2:if(elementRect.top>=rect.top)continue;if(elementRect.bottom>=rect.bottom)continue;break;case 3:if(elementRect.bottom<=rect.bottom)continue;if(elementRect.top<=rect.top)continue}var distX,distY,x=elementRect.left,y=elementRect.top,x2=x+elementRect.width-1,y2=y+elementRect.height-1,intersectX=intersects(point1x,point2x,x,x2),intersectY=intersects(point1y,point2y,y,y2),midX=elementRect.left+elementRect.width/2,midY=elementRect.top+elementRect.height/2;switch(direction){case 0:distX=Math.abs(point1x-Math.min(point1x,x2)),distY=intersectY?0:Math.abs(sourceMidY-midY);break;case 1:distX=Math.abs(point2x-Math.max(point2x,x)),distY=intersectY?0:Math.abs(sourceMidY-midY);break;case 2:distY=Math.abs(point1y-Math.min(point1y,y2)),distX=intersectX?0:Math.abs(sourceMidX-midX);break;case 3:distY=Math.abs(point2y-Math.max(point2y,y)),distX=intersectX?0:Math.abs(sourceMidX-midX)}var dist=Math.sqrt(distX*distX+distY*distY);dist=a1&&b1<=a2||b2>=a1&&b2<=a2}function intersects(a1,a2,b1,b2){return intersectsInternal(a1,a2,b1,b2)||intersectsInternal(b1,b2,a1,a2)}function sendText(text){var elem=document.activeElement;elem.value=text}function focusFirst(container,focusableSelector){for(var elems=container.querySelectorAll(focusableSelector),i=0,length=elems.length;i=limit)))break}return focusableElements}function isFocusContainer(elem,direction){if(-1!==focusableContainerTagNames.indexOf(elem.tagName))return!0;var classList=elem.classList;if(classList.contains("focuscontainer"))return!0;if(0===direction){if(classList.contains("focuscontainer-x"))return!0;if(classList.contains("focuscontainer-left"))return!0}else if(1===direction){if(classList.contains("focuscontainer-x"))return!0;if(classList.contains("focuscontainer-right"))return!0}else if(2===direction){if(classList.contains("focuscontainer-y"))return!0}else if(3===direction){if(classList.contains("focuscontainer-y"))return!0;if(classList.contains("focuscontainer-down"))return!0}return!1}function getFocusContainer(elem,direction){for(;!isFocusContainer(elem,direction);)if(!(elem=elem.parentNode))return getDefaultScope();return elem}function getOffset(elem){var box;if(box=elem.getBoundingClientRect?elem.getBoundingClientRect():{top:0,left:0,width:0,height:0},null===box.right){box={top:box.top,left:box.left,width:box.width,height:box.height},box.right=box.left+box.width,box.bottom=box.top+box.height}return box}function nav(activeElement,direction,container,focusableElements){if(activeElement=activeElement||document.activeElement,activeElement&&(activeElement=focusableParent(activeElement)),container=container||(activeElement?getFocusContainer(activeElement,direction):getDefaultScope()),!activeElement)return void autoFocus(container,!0,!1);for(var nearestElement,focusableContainer=dom.parentWithClass(activeElement,"focusable"),rect=getOffset(activeElement),point1x=parseFloat(rect.left)||0,point1y=parseFloat(rect.top)||0,point2x=parseFloat(point1x+rect.width-1)||point1x,point2y=parseFloat(point1y+rect.height-1)||point1y,sourceMidX=(Math.min,Math.max,rect.left+rect.width/2),sourceMidY=rect.top+rect.height/2,focusable=focusableElements||container.querySelectorAll(focusableQuery),minDistance=1/0,i=0,length=focusable.length;i=rect.left)continue;if(elementRect.right===rect.right)continue;break;case 1:if(elementRect.right<=rect.right)continue;if(elementRect.left===rect.left)continue;break;case 2:if(elementRect.top>=rect.top)continue;if(elementRect.bottom>=rect.bottom)continue;break;case 3:if(elementRect.bottom<=rect.bottom)continue;if(elementRect.top<=rect.top)continue}var distX,distY,x=elementRect.left,y=elementRect.top,x2=x+elementRect.width-1,y2=y+elementRect.height-1,intersectX=intersects(point1x,point2x,x,x2),intersectY=intersects(point1y,point2y,y,y2),midX=elementRect.left+elementRect.width/2,midY=elementRect.top+elementRect.height/2;switch(direction){case 0:distX=Math.abs(point1x-Math.min(point1x,x2)),distY=intersectY?0:Math.abs(sourceMidY-midY);break;case 1:distX=Math.abs(point2x-Math.max(point2x,x)),distY=intersectY?0:Math.abs(sourceMidY-midY);break;case 2:distY=Math.abs(point1y-Math.min(point1y,y2)),distX=intersectX?0:Math.abs(sourceMidX-midX);break;case 3:distY=Math.abs(point2y-Math.max(point2y,y)),distX=intersectX?0:Math.abs(sourceMidX-midX)}var dist=Math.sqrt(distX*distX+distY*distY);dist=a1&&b1<=a2||b2>=a1&&b2<=a2}function intersects(a1,a2,b1,b2){return intersectsInternal(a1,a2,b1,b2)||intersectsInternal(b1,b2,a1,a2)}function sendText(text){document.activeElement.value=text}function focusFirst(container,focusableSelector){for(var elems=container.querySelectorAll(focusableSelector),i=0,length=elems.length;i1&&(module=parts[0],key=parts[1]),translateKeyFromModule(key,module)}function translateKeyFromModule(key,module){var dictionary=getDictionary(module);return dictionary?dictionary[key]||key:key}function replaceAll(str,find,replace){return str.split(find).join(replace)}function translate(key){for(var val=translateKey(key),i=1;i1&&(module=parts[0],key=parts[1]),translateKeyFromModule(key,module)}function translateKeyFromModule(key,module){var dictionary=getDictionary(module);return dictionary?dictionary[key]||key:key}function replaceAll(str,find,replace){return str.split(find).join(replace)}function translate(key){for(var val=translateKey(key),i=1;i=4&&categories.push("series"),categories.push("all"),options.categories=categories}function loadCategories(context,options){for(var selectedCategories=options.categories||[],chkCategorys=context.querySelectorAll(".chkCategory"),i=0,length=chkCategorys.length;i=4&&categories.push("series"),categories.push("all"),options.categories=categories}function loadCategories(context,options){for(var selectedCategories=options.categories||[],chkCategorys=context.querySelectorAll(".chkCategory"),i=0,length=chkCategorys.length;i0&&pctOfWidth<=100?(guideProgramName.style.transform="translateX("+pctOfWidth+"%)",caret.classList.remove("hide")):(guideProgramName.style.transform="none",caret.classList.add("hide")))}function updateProgramCellsOnScroll(programGrid,programCells){isUpdatingProgramCellScroll||(isUpdatingProgramCellScroll=!0,requestAnimationFrame(function(){for(var scrollLeft=programGrid.scrollLeft,scrollPct=scrollLeft?scrollLeft/programGrid.scrollWidth*100:0,i=0,length=programCells.length;i=startDate&&now=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 reloadGuide(context,newStartDate,scrollToTimeMs,focusToTimeMs,startTimeOfDayMs,focusProgramOnRender){var apiClient=connectionManager.getApiClient(options.serverId),channelQuery={StartIndex:0,EnableFavoriteSorting:"false"!==userSettings.get("livetv-favoritechannelsattop")};channelQuery.UserId=apiClient.getCurrentUserId();var channelLimit=500;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);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}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,listInfo){var html="",startMs=date.getTime(),endMs=startMs+msPerDay-1,outerCssClass=layoutManager.tv?"channelPrograms channelPrograms-tv":"channelPrograms";html+='
';for(var programsFound,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"),now=(new Date).getTime(),i=listInfo.startIndex,length=programs.length;iendMs)break;items[program.Id]=program;var renderStartMs=Math.max(startDateLocalMs,startMs),startPercent=(startDateLocalMs-startMs)/msPerDay;startPercent*=100,startPercent=Math.max(startPercent,0);var renderEndMs=Math.min(endDateLocalMs,endMs),endPercent=(renderEndMs-renderStartMs)/msPerDay;endPercent*=100;var cssClass="programCell itemAction",accentCssClass=null,displayInnerContent=!0;program.IsKids?(displayInnerContent=displayKidsContent,accentCssClass="kids"):program.IsSports?(displayInnerContent=displaySportsContent,accentCssClass="sports"):program.IsNews?(displayInnerContent=displayNewsContent,accentCssClass="news"):program.IsMovie?(displayInnerContent=displayMovieContent,accentCssClass="movie"):displayInnerContent=program.IsSeries?displaySeriesContent:displayMovieContent&&displayNewsContent&&displaySportsContent&&displayKidsContent&&displaySeriesContent,displayInnerContent&&enableColorCodedBackgrounds&&accentCssClass&&(cssClass+=" programCell-"+accentCssClass),now>=startDateLocalMs&&now=2?' is="emby-programcell"':"";if(html+="',displayInnerContent){var guideProgramNameClass="guideProgramName";html+='
',html+='
',html+='
'+program.Name;var indicatorHtml=null;program.IsLive&&options.showLiveIndicator?indicatorHtml=''+globalize.translate("sharedcomponents#Live")+"":program.IsPremiere&&options.showPremiereIndicator?indicatorHtml=''+globalize.translate("sharedcomponents#Premiere")+"":program.IsSeries&&!program.IsRepeat&&options.showNewIndicator?indicatorHtml=''+globalize.translate("sharedcomponents#AttributeNew")+"":program.IsSeries&&program.IsRepeat&&options.showRepeatIndicator&&(indicatorHtml=''+globalize.translate("sharedcomponents#Repeat")+""),html+=indicatorHtml||"",program.EpisodeTitle&&options.showEpisodeTitle&&(html+='
',program.EpisodeTitle&&options.showEpisodeTitle&&(html+=''+program.EpisodeTitle+""),html+="
"),html+="
",program.IsHD&&options.showHdIcon&&(html+=layoutManager.tv?'
HD
':'
HD
'),html+=getTimerIndicator(program),html+="
"}html+=""}}else if(programsFound)break}return html+="
"}function renderChannelHeaders(context,channels,apiClient){for(var html="",i=0,length=channels.length;i',hasChannelImage){var url=apiClient.getScaledImageUrl(channel.Id,{maxHeight:220,tag:channel.ImageTags.Primary,type:"Primary"});html+='
'}channel.ChannelNumber&&(html+='

'+channel.ChannelNumber+"

"),!hasChannelImage&&channel.Name&&(html+='
'+channel.Name+"
"),html+=""}var channelList=context.querySelector(".channelsContainer");channelList.innerHTML=html,imageLoader.lazyChildren(channelList)}function renderPrograms(context,date,channels,programs){for(var 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},listInfo={startIndex:0},html=[],i=0,length=channels.length;i=pct||left+width>=pct)break;programCell=programCell.nextSibling}programCell?focusManager.focus(programCell):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){if((new Date).getTime()-lastHeaderScroll>=1e3){lastGridScroll=(new Date).getTime();var scrollLeft=elem.scrollLeft;scrollXPct=100*scrollLeft/elem.scrollWidth,nativeScrollTo(timeslotHeaders,scrollLeft,!0)}updateProgramCellsOnScroll(elem,programCells)}function onTimeslotHeadersScroll(context,elem){(new Date).getTime()-lastGridScroll>=1e3&&(lastHeaderScroll=(new Date).getTime(),nativeScrollTo(programGrid,elem.scrollLeft,!0))}function changeDate(page,date,scrollToTimeMs,focusToTimeMs,startTimeOfDayMs,focusProgramOnRender){var newStartDate=normalizeDateToTimeslot(date);currentDate=newStartDate,reloadGuide(page,newStartDate,scrollToTimeMs,focusToTimeMs,startTimeOfDayMs,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,nowHours=today.getHours();today.setHours(nowHours,0,0,0);var start=datetime.parseISO8601Date(guideInfo.StartDate,{toLocal:!0}),end=datetime.parseISO8601Date(guideInfo.EndDate,{toLocal:!0});start.setHours(nowHours,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;currentDate&&date.setTime(currentDate.getTime()),date.setHours(nowHours,0,0,0);var startTimeOfDayMs=60*start.getHours()*60*1e3;for(startTimeOfDayMs+=60*start.getMinutes()*1e3;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();var newDate=new Date,newDateHours=newDate.getHours(),scrollToTimeMs=60*newDateHours*60*1e3,minutes=newDate.getMinutes();minutes>=30&&(scrollToTimeMs+=18e5);var focusToTimeMs=60*(60*newDateHours+minutes)*1e3;changeDate(page,date,scrollToTimeMs,focusToTimeMs,startTimeOfDayMs,layoutManager.tv)}function reloadPage(page){showLoading();var apiClient=connectionManager.getApiClient(options.serverId);apiClient.getLiveTvGuideInfo().then(function(guideInfo){setDateRange(page,guideInfo)})}function getChannelProgramsFocusableElements(container){for(var elements=container.querySelectorAll(".programCell"),list=[],currentScrollXPct=scrollXPct+1,i=0,length=elements.length;i=currentScrollXPct&&list.push(elem)}return list}function onInputCommand(e){var container,channelPrograms,focusableElements,newRow,target=e.target,programCell=dom.parentWithClass(target,"programCell"),scrollX=!1;switch(e.detail.command){case"up":programCell?(container=programGrid,channelPrograms=dom.parentWithClass(programCell,"channelPrograms"),newRow=channelPrograms.previousSibling,newRow?(focusableElements=getChannelProgramsFocusableElements(newRow),focusableElements.length?container=newRow:focusableElements=null):container=null):container=null,lastFocusDirection=e.detail.command,focusManager.moveUp(target,{container:container,focusableElements:focusableElements});break;case"down":programCell?(container=programGrid,channelPrograms=dom.parentWithClass(programCell,"channelPrograms"),newRow=channelPrograms.nextSibling,newRow?(focusableElements=getChannelProgramsFocusableElements(newRow),focusableElements.length?container=newRow:focusableElements=null):container=null):container=null,lastFocusDirection=e.detail.command,focusManager.moveDown(target,{container:container,focusableElements:focusableElements});break;case"left":container=programCell?dom.parentWithClass(programCell,"channelPrograms"):null,container&&!programCell.previousSibling&&(container=null),lastFocusDirection=e.detail.command,focusManager.moveLeft(target,{container:container}),scrollX=!0;break;case"right":container=programCell?dom.parentWithClass(programCell,"channelPrograms"):null,lastFocusDirection=e.detail.command,focusManager.moveRight(target,{container:container}),scrollX=!0;break;default:return}e.preventDefault(),e.stopPropagation()}function onScrollerFocus(e){var target=e.target,programCell=dom.parentWithClass(target,"programCell");if(programCell){var focused=target,id=focused.getAttribute("data-id"),item=items[id];item&&events.trigger(self,"focus",[{item:item}])}if("left"===lastFocusDirection)programCell&&scrollHelper.toStart(programGrid,programCell,!0,!0);else if("right"===lastFocusDirection)programCell&&scrollHelper.toCenter(programGrid,programCell,!0,!0);else if("up"===lastFocusDirection||"down"===lastFocusDirection){var verticalScroller=dom.parentWithClass(target,"guideVerticalScroller");if(verticalScroller){var focusedElement=programCell||dom.parentWithTag(target,"BUTTON");verticalScroller.toCenter(focusedElement,!0)}}}function setScrollEvents(view,enabled){if(layoutManager.tv){var guideVerticalScroller=view.querySelector(".guideVerticalScroller");enabled?inputManager.on(guideVerticalScroller,onInputCommand):inputManager.off(guideVerticalScroller,onInputCommand)}}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;i0&&pctOfWidth<=100?(guideProgramName.style.transform="translateX("+pctOfWidth+"%)",caret.classList.remove("hide")):(guideProgramName.style.transform="none",caret.classList.add("hide")))}function updateProgramCellsOnScroll(programGrid,programCells){isUpdatingProgramCellScroll||(isUpdatingProgramCellScroll=!0,requestAnimationFrame(function(){for(var scrollLeft=programGrid.scrollLeft,scrollPct=scrollLeft?scrollLeft/programGrid.scrollWidth*100:0,i=0,length=programCells.length;i=startDate&&now=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 reloadGuide(context,newStartDate,scrollToTimeMs,focusToTimeMs,startTimeOfDayMs,focusProgramOnRender){var apiClient=connectionManager.getApiClient(options.serverId),channelQuery={StartIndex:0,EnableFavoriteSorting:"false"!==userSettings.get("livetv-favoritechannelsattop")};channelQuery.UserId=apiClient.getCurrentUserId();currentChannelLimit=500,showLoading(),channelQuery.StartIndex=currentStartIndex,channelQuery.Limit=500,channelQuery.AddCurrentProgram=!1,channelQuery.EnableUserData=!1,channelQuery.EnableImageTypes="Primary";var categories=self.categoryOptions.categories||[],displayMovieContent=!categories.length||-1!==categories.indexOf("movies"),displaySportsContent=!categories.length||-1!==categories.indexOf("sports"),displayNewsContent=!categories.length||-1!==categories.indexOf("news"),displayKidsContent=!categories.length||-1!==categories.indexOf("kids"),displaySeriesContent=!categories.length||-1!==categories.indexOf("series");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);apiClient.getLiveTvChannels(channelQuery).then(function(channelsResult){var btnPreviousPage=context.querySelector(".btnPreviousPage"),btnNextPage=context.querySelector(".btnNextPage");channelsResult.TotalRecordCount>500?(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+500",startDate.setTime(startDate.getTime()+cellDurationMs);return 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,listInfo){var html="",startMs=date.getTime(),endMs=startMs+msPerDay-1;html+='
';for(var programsFound,clickAction=layoutManager.tv?"link":"programdialog",categories=self.categoryOptions.categories||[],displayMovieContent=!categories.length||-1!==categories.indexOf("movies"),displaySportsContent=!categories.length||-1!==categories.indexOf("sports"),displayNewsContent=!categories.length||-1!==categories.indexOf("news"),displayKidsContent=!categories.length||-1!==categories.indexOf("kids"),displaySeriesContent=!categories.length||-1!==categories.indexOf("series"),enableColorCodedBackgrounds="true"===userSettings.get("guide-colorcodedbackgrounds"),now=(new Date).getTime(),i=listInfo.startIndex,length=programs.length;iendMs)break;items[program.Id]=program;var renderStartMs=Math.max(startDateLocalMs,startMs),startPercent=(startDateLocalMs-startMs)/msPerDay;startPercent*=100,startPercent=Math.max(startPercent,0);var renderEndMs=Math.min(endDateLocalMs,endMs),endPercent=(renderEndMs-renderStartMs)/msPerDay;endPercent*=100;var cssClass="programCell itemAction",accentCssClass=null,displayInnerContent=!0;program.IsKids?(displayInnerContent=displayKidsContent,accentCssClass="kids"):program.IsSports?(displayInnerContent=displaySportsContent,accentCssClass="sports"):program.IsNews?(displayInnerContent=displayNewsContent,accentCssClass="news"):program.IsMovie?(displayInnerContent=displayMovieContent,accentCssClass="movie"):displayInnerContent=program.IsSeries?displaySeriesContent:displayMovieContent&&displayNewsContent&&displaySportsContent&&displayKidsContent&&displaySeriesContent,displayInnerContent&&enableColorCodedBackgrounds&&accentCssClass&&(cssClass+=" programCell-"+accentCssClass),now>=startDateLocalMs&&now=2?' is="emby-programcell"':"")+' data-action="'+clickAction+'"'+timerAttributes+' data-channelid="'+program.ChannelId+'" data-id="'+program.Id+'" data-serverid="'+program.ServerId+'" data-startdate="'+program.StartDate+'" data-enddate="'+program.EndDate+'" data-type="'+program.Type+'" class="'+cssClass+'" style="left:'+startPercent+"%;width:"+endPercent+'%;">',displayInnerContent){html+='
',html+='
',html+='
'+program.Name;var indicatorHtml=null;program.IsLive&&options.showLiveIndicator?indicatorHtml=''+globalize.translate("sharedcomponents#Live")+"":program.IsPremiere&&options.showPremiereIndicator?indicatorHtml=''+globalize.translate("sharedcomponents#Premiere")+"":program.IsSeries&&!program.IsRepeat&&options.showNewIndicator?indicatorHtml=''+globalize.translate("sharedcomponents#AttributeNew")+"":program.IsSeries&&program.IsRepeat&&options.showRepeatIndicator&&(indicatorHtml=''+globalize.translate("sharedcomponents#Repeat")+""),html+=indicatorHtml||"",program.EpisodeTitle&&options.showEpisodeTitle&&(html+='
',program.EpisodeTitle&&options.showEpisodeTitle&&(html+=''+program.EpisodeTitle+""),html+="
"),html+="
",program.IsHD&&options.showHdIcon&&(layoutManager.tv?html+='
HD
':html+='
HD
'),html+=getTimerIndicator(program),html+="
"}html+=""}}else if(programsFound)break}return html+="
"}function renderChannelHeaders(context,channels,apiClient){for(var html="",i=0,length=channels.length;i',hasChannelImage){html+='
'}channel.ChannelNumber&&(html+='

'+channel.ChannelNumber+"

"),!hasChannelImage&&channel.Name&&(html+='
'+channel.Name+"
"),html+=""}var channelList=context.querySelector(".channelsContainer");channelList.innerHTML=html,imageLoader.lazyChildren(channelList)}function renderPrograms(context,date,channels,programs){for(var 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},listInfo={startIndex:0},html=[],i=0,length=channels.length;i=pct||left+width>=pct)break;programCell=programCell.nextSibling}programCell?focusManager.focus(programCell):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){if((new Date).getTime()-lastHeaderScroll>=1e3){lastGridScroll=(new Date).getTime();var scrollLeft=elem.scrollLeft;scrollXPct=100*scrollLeft/elem.scrollWidth,nativeScrollTo(timeslotHeaders,scrollLeft,!0)}updateProgramCellsOnScroll(elem,programCells)}function onTimeslotHeadersScroll(context,elem){(new Date).getTime()-lastGridScroll>=1e3&&(lastHeaderScroll=(new Date).getTime(),nativeScrollTo(programGrid,elem.scrollLeft,!0))}function changeDate(page,date,scrollToTimeMs,focusToTimeMs,startTimeOfDayMs,focusProgramOnRender){var newStartDate=normalizeDateToTimeslot(date);currentDate=newStartDate,reloadGuide(page,newStartDate,scrollToTimeMs,focusToTimeMs,startTimeOfDayMs,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,nowHours=today.getHours();today.setHours(nowHours,0,0,0);var start=datetime.parseISO8601Date(guideInfo.StartDate,{toLocal:!0}),end=datetime.parseISO8601Date(guideInfo.EndDate,{toLocal:!0});start.setHours(nowHours,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;currentDate&&date.setTime(currentDate.getTime()),date.setHours(nowHours,0,0,0);var startTimeOfDayMs=60*start.getHours()*60*1e3;for(startTimeOfDayMs+=60*start.getMinutes()*1e3;start<=end;){dateTabsHtml+=getDateTabText(start,date.getDate()===start.getDate()&&date.getMonth()===start.getMonth()&&date.getFullYear()===start.getFullYear(),tabIndex),start.setDate(start.getDate()+1),start.setHours(0,0,0,0),tabIndex++}page.querySelector(".emby-tabs-slider").innerHTML=dateTabsHtml,page.querySelector(".guideDateTabs").refresh();var newDate=new Date,newDateHours=newDate.getHours(),scrollToTimeMs=60*newDateHours*60*1e3,minutes=newDate.getMinutes();minutes>=30&&(scrollToTimeMs+=18e5),changeDate(page,date,scrollToTimeMs,60*(60*newDateHours+minutes)*1e3,startTimeOfDayMs,layoutManager.tv)}function reloadPage(page){showLoading(),connectionManager.getApiClient(options.serverId).getLiveTvGuideInfo().then(function(guideInfo){setDateRange(page,guideInfo)})}function getChannelProgramsFocusableElements(container){for(var elements=container.querySelectorAll(".programCell"),list=[],currentScrollXPct=scrollXPct+1,i=0,length=elements.length;i=currentScrollXPct&&list.push(elem)}return list}function onInputCommand(e){var container,channelPrograms,focusableElements,newRow,target=e.target,programCell=dom.parentWithClass(target,"programCell");switch(e.detail.command){case"up":programCell?(container=programGrid,channelPrograms=dom.parentWithClass(programCell,"channelPrograms"),newRow=channelPrograms.previousSibling,newRow?(focusableElements=getChannelProgramsFocusableElements(newRow),focusableElements.length?container=newRow:focusableElements=null):container=null):container=null,lastFocusDirection=e.detail.command,focusManager.moveUp(target,{container:container,focusableElements:focusableElements});break;case"down":programCell?(container=programGrid,channelPrograms=dom.parentWithClass(programCell,"channelPrograms"),newRow=channelPrograms.nextSibling,newRow?(focusableElements=getChannelProgramsFocusableElements(newRow),focusableElements.length?container=newRow:focusableElements=null):container=null):container=null,lastFocusDirection=e.detail.command,focusManager.moveDown(target,{container:container,focusableElements:focusableElements});break;case"left":container=programCell?dom.parentWithClass(programCell,"channelPrograms"):null,container&&!programCell.previousSibling&&(container=null),lastFocusDirection=e.detail.command,focusManager.moveLeft(target,{container:container}),!0;break;case"right":container=programCell?dom.parentWithClass(programCell,"channelPrograms"):null,lastFocusDirection=e.detail.command,focusManager.moveRight(target,{container:container}),!0;break;default:return}e.preventDefault(),e.stopPropagation()}function onScrollerFocus(e){var target=e.target,programCell=dom.parentWithClass(target,"programCell");if(programCell){var focused=target,id=focused.getAttribute("data-id"),item=items[id];item&&events.trigger(self,"focus",[{item:item}])}if("left"===lastFocusDirection)programCell&&scrollHelper.toStart(programGrid,programCell,!0,!0);else if("right"===lastFocusDirection)programCell&&scrollHelper.toCenter(programGrid,programCell,!0,!0);else if("up"===lastFocusDirection||"down"===lastFocusDirection){var verticalScroller=dom.parentWithClass(target,"guideVerticalScroller");if(verticalScroller){var focusedElement=programCell||dom.parentWithTag(target,"BUTTON");verticalScroller.toCenter(focusedElement,!0)}}}function setScrollEvents(view,enabled){if(layoutManager.tv){var guideVerticalScroller=view.querySelector(".guideVerticalScroller");enabled?inputManager.on(guideVerticalScroller,onInputCommand):inputManager.off(guideVerticalScroller,onInputCommand)}}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;ithis.lastKnownScrollY,pastOffset=currentScrollY>=this.offset;return scrollingDown&&pastOffset},shouldPin:function(currentScrollY){var scrollingUp=currentScrollY=14;currentScrollY&&isTv?this.unpin():toleranceExceeded&&this.clear()}this.lastKnownScrollY=currentScrollY}}},Headroom.options={offset:0,scroller:window,initialClass:"headroom",unPinnedClass:"headroom--unpinned",pinnedClass:"headroom--pinned"},Headroom}); \ No newline at end of file +define(["dom","layoutManager","browser","css!./headroom"],function(dom,layoutManager,browser){"use strict";function Debouncer(callback){this.callback=callback,this.ticking=!1}function onHeadroomClearedExternally(){this.state=null}function Headroom(elems,options){options=Object.assign(Headroom.options,options||{}),this.lastKnownScrollY=0,this.elems=elems,this.scroller=options.scroller,this.debouncer=onScroll.bind(this),this.offset=options.offset,this.initialised=!1,this.initialClass=options.initialClass,this.unPinnedClass=options.unPinnedClass,this.pinnedClass=options.pinnedClass,this.state="clear"}function onScroll(){this.paused||requestAnimationFrame(this.rafCallback||(this.rafCallback=this.update.bind(this)))}var requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;return Debouncer.prototype={constructor:Debouncer,update:function(){this.callback&&this.callback(),this.ticking=!1},handleEvent:function(){this.ticking||(requestAnimationFrame(this.rafCallback||(this.rafCallback=this.update.bind(this))),this.ticking=!0)}},Headroom.prototype={constructor:Headroom,init:function(){if(browser.supportsCssAnimation()){for(var i=0,length=this.elems.length;ithis.lastKnownScrollY,pastOffset=currentScrollY>=this.offset;return scrollingDown&&pastOffset},shouldPin:function(currentScrollY){var scrollingUp=currentScrollY=14;currentScrollY&&isTv?this.unpin():toleranceExceeded&&this.clear()}this.lastKnownScrollY=currentScrollY}}},Headroom.options={offset:0,scroller:window,initialClass:"headroom",unPinnedClass:"headroom--unpinned",pinnedClass:"headroom--pinned"},Headroom}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/homescreensettings/homescreensettings.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/homescreensettings/homescreensettings.js index 13a878c238..5757919c62 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/homescreensettings/homescreensettings.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/homescreensettings/homescreensettings.js @@ -1 +1 @@ -define(["require","globalize","loading","connectionManager","homeSections","dom","events","listViewStyle","emby-select","emby-checkbox"],function(require,globalize,loading,connectionManager,homeSections,dom,events){"use strict";function renderLatestItems(context,user,result){var folderHtml="";folderHtml+='
';var excludeViewTypes=["playlists","livetv","boxsets","channels"];folderHtml+=result.Items.map(function(i){if(excludeViewTypes.indexOf(i.CollectionType||[])!==-1)return"";var currentHtml="",id="chkIncludeInLatest"+i.Id,isChecked=user.Configuration.LatestItemsExcludes.indexOf(i.Id)===-1,checkedHtml=isChecked?' checked="checked"':"";return currentHtml+=""}).join(""),folderHtml+="
",context.querySelector(".latestItemsList").innerHTML=folderHtml}function renderViews(page,user,result){var folderHtml="";folderHtml+='
',folderHtml+=result.map(function(i){var currentHtml="",id="chkGroupFolder"+i.Id,isChecked=user.Configuration.GroupedFolders.indexOf(i.Id)!==-1,checkedHtml=isChecked?' checked="checked"':"";return currentHtml+=""}).join(""),folderHtml+="
",page.querySelector(".folderGroupList").innerHTML=folderHtml}function getLandingScreenOptions(type){var list=[];return"movies"===type?(list.push({name:globalize.translate("sharedcomponents#Movies"),value:"movies",isDefault:!0}),list.push({name:globalize.translate("sharedcomponents#Suggestions"),value:"suggestions"}),list.push({name:globalize.translate("sharedcomponents#Favorites"),value:"favorites"}),list.push({name:globalize.translate("sharedcomponents#Collections"),value:"collections"})):"tvshows"===type?(list.push({name:globalize.translate("sharedcomponents#Shows"),value:"shows",isDefault:!0}),list.push({name:globalize.translate("sharedcomponents#Suggestions"),value:"suggestions"}),list.push({name:globalize.translate("sharedcomponents#Latest"),value:"latest"}),list.push({name:globalize.translate("sharedcomponents#Favorites"),value:"favorites"})):"music"===type&&(list.push({name:globalize.translate("sharedcomponents#Suggestions"),value:"suggestions"}),list.push({name:globalize.translate("sharedcomponents#Albums"),value:"albums"}),list.push({name:globalize.translate("sharedcomponents#HeaderAlbumArtists"),value:"albumartists"}),list.push({name:globalize.translate("sharedcomponents#Artists"),value:"artists"}),list.push({name:globalize.translate("sharedcomponents#Playlists"),value:"playlists"}),list.push({name:globalize.translate("sharedcomponents#Genres"),value:"genres"})),list}function getLandingScreenOptionsHtml(type,userValue){return getLandingScreenOptions(type).map(function(o){var selected=userValue===o.value||o.isDefault&&!userValue,selectedHtml=selected?" selected":"",optionValue=o.isDefault?"":o.value;return'"}).join("")}function renderLandingScreens(context,user,userSettings,result){for(var html="",i=0,length=result.Items.length;i',html+='",html+="
"}}context.querySelector(".landingScreens").innerHTML=html,html?context.querySelector(".landingScreensSection").classList.remove("hide"):context.querySelector(".landingScreensSection").classList.add("hide")}function renderViewOrder(context,user,result){var html="",index=0;html+=result.Items.map(function(view){var currentHtml="";return currentHtml+='
',currentHtml+='',currentHtml+='
',currentHtml+="
",currentHtml+=view.Name,currentHtml+="
",currentHtml+="
",currentHtml+='',currentHtml+='',currentHtml+="
",index++,currentHtml}).join(""),context.querySelector(".viewOrderList").innerHTML=html}function updateHomeSectionValues(context,userSettings){for(var i=1;i<=7;i++){var select=context.querySelector("#selectHomeSection"+i),defaultValue=homeSections.getDefaultSection(i-1),option=select.querySelector("option[value="+defaultValue+"]")||select.querySelector('option[value=""]'),userValue=userSettings.get("homesection"+(i-1));option.value="",userValue!==defaultValue&&userValue?select.value=userValue:select.value=""}}function loadForm(context,user,userSettings,apiClient){context.querySelector(".chkHidePlayedFromLatest").checked=user.Configuration.HidePlayedInLatest||!1,updateHomeSectionValues(context,userSettings);var promise1=apiClient.getUserViews({},user.Id),promise2=apiClient.getJSON(apiClient.getUrl("Users/"+user.Id+"/GroupingOptions"));Promise.all([promise1,promise2]).then(function(responses){renderViews(context,user,responses[1]),renderLatestItems(context,user,responses[0]),renderViewOrder(context,user,responses[0]),renderLandingScreens(context,user,userSettings,responses[0]),loading.hide()})}function onSectionOrderListClick(e){var target=dom.parentWithClass(e.target,"btnViewItemMove");if(target){var viewItem=dom.parentWithClass(target,"viewItem");if(viewItem){dom.parentWithClass(viewItem,"paperList");if(target.classList.contains("btnViewItemDown")){var next=viewItem.nextSibling;next&&(viewItem.parentNode.removeChild(viewItem),next.parentNode.insertBefore(viewItem,next.nextSibling))}else{var prev=viewItem.previousSibling;prev&&(viewItem.parentNode.removeChild(viewItem),prev.parentNode.insertBefore(viewItem,prev))}}}}function getCheckboxItems(selector,context,isChecked){for(var inputs=context.querySelectorAll(selector),list=[],i=0,length=inputs.length;i",currentHtml+=""+i.Name+"",currentHtml+=""}).join(""),folderHtml+="",context.querySelector(".latestItemsList").innerHTML=folderHtml}function renderViews(page,user,result){var folderHtml="";folderHtml+='
',folderHtml+=result.map(function(i){var currentHtml="",id="chkGroupFolder"+i.Id,isChecked=-1!==user.Configuration.GroupedFolders.indexOf(i.Id),checkedHtml=isChecked?' checked="checked"':"";return currentHtml+=""}).join(""),folderHtml+="
",page.querySelector(".folderGroupList").innerHTML=folderHtml}function getLandingScreenOptions(type){var list=[];return"movies"===type?(list.push({name:globalize.translate("sharedcomponents#Movies"),value:"movies",isDefault:!0}),list.push({name:globalize.translate("sharedcomponents#Suggestions"),value:"suggestions"}),list.push({name:globalize.translate("sharedcomponents#Favorites"),value:"favorites"}),list.push({name:globalize.translate("sharedcomponents#Collections"),value:"collections"})):"tvshows"===type?(list.push({name:globalize.translate("sharedcomponents#Shows"),value:"shows",isDefault:!0}),list.push({name:globalize.translate("sharedcomponents#Suggestions"),value:"suggestions"}),list.push({name:globalize.translate("sharedcomponents#Latest"),value:"latest"}),list.push({name:globalize.translate("sharedcomponents#Favorites"),value:"favorites"})):"music"===type&&(list.push({name:globalize.translate("sharedcomponents#Suggestions"),value:"suggestions"}),list.push({name:globalize.translate("sharedcomponents#Albums"),value:"albums"}),list.push({name:globalize.translate("sharedcomponents#HeaderAlbumArtists"),value:"albumartists"}),list.push({name:globalize.translate("sharedcomponents#Artists"),value:"artists"}),list.push({name:globalize.translate("sharedcomponents#Playlists"),value:"playlists"}),list.push({name:globalize.translate("sharedcomponents#Genres"),value:"genres"})),list}function getLandingScreenOptionsHtml(type,userValue){return getLandingScreenOptions(type).map(function(o){var selected=userValue===o.value||o.isDefault&&!userValue,selectedHtml=selected?" selected":"";return'"}).join("")}function renderLandingScreens(context,user,userSettings,result){for(var html="",i=0,length=result.Items.length;i',html+='",html+=""}}context.querySelector(".landingScreens").innerHTML=html,html?context.querySelector(".landingScreensSection").classList.remove("hide"):context.querySelector(".landingScreensSection").classList.add("hide")}function renderViewOrder(context,user,result){var html="",index=0;html+=result.Items.map(function(view){var currentHtml="";return currentHtml+='
',currentHtml+='',currentHtml+='
',currentHtml+="
",currentHtml+=view.Name,currentHtml+="
",currentHtml+="
",currentHtml+='',currentHtml+='',currentHtml+="
",index++,currentHtml}).join(""),context.querySelector(".viewOrderList").innerHTML=html}function updateHomeSectionValues(context,userSettings){for(var i=1;i<=7;i++){var select=context.querySelector("#selectHomeSection"+i),defaultValue=homeSections.getDefaultSection(i-1),option=select.querySelector("option[value="+defaultValue+"]")||select.querySelector('option[value=""]'),userValue=userSettings.get("homesection"+(i-1));option.value="",select.value=userValue!==defaultValue&&userValue?userValue:""}}function loadForm(context,user,userSettings,apiClient){context.querySelector(".chkHidePlayedFromLatest").checked=user.Configuration.HidePlayedInLatest||!1,updateHomeSectionValues(context,userSettings);var promise1=apiClient.getUserViews({},user.Id),promise2=apiClient.getJSON(apiClient.getUrl("Users/"+user.Id+"/GroupingOptions"));Promise.all([promise1,promise2]).then(function(responses){renderViews(context,user,responses[1]),renderLatestItems(context,user,responses[0]),renderViewOrder(context,user,responses[0]),renderLandingScreens(context,user,userSettings,responses[0]),loading.hide()})}function onSectionOrderListClick(e){var target=dom.parentWithClass(e.target,"btnViewItemMove");if(target){var viewItem=dom.parentWithClass(target,"viewItem");if(viewItem){dom.parentWithClass(viewItem,"paperList");if(target.classList.contains("btnViewItemDown")){var next=viewItem.nextSibling;next&&(viewItem.parentNode.removeChild(viewItem),next.parentNode.insertBefore(viewItem,next.nextSibling))}else{var prev=viewItem.previousSibling;prev&&(viewItem.parentNode.removeChild(viewItem),prev.parentNode.insertBefore(viewItem,prev))}}}}function getCheckboxItems(selector,context,isChecked){for(var inputs=context.querySelectorAll(selector),list=[],i=0,length=inputs.length;i';elem.innerHTML=html,elem.classList.add("homeSectionsContainer");var promises=[],sections=getAllSectionsToShow(userSettings,sectionCount);for(i=0,length=sections.length;i",layoutManager.tv||(html+=''),html+="",html+='
';for(var i=0,length=items.length;i'+icon+""+item.Name+""}return html+="
",html+=""}function loadlibraryButtons(elem,apiClient,user,userSettings,userViews){return Promise.all([getAppInfo(apiClient),getDownloadsSectionHtml(apiClient,user,userSettings)]).then(function(responses){var infoHtml=responses[0],downloadsHtml=responses[1];elem.classList.remove("verticalSection");var html=getLibraryButtonsHtml(userViews);elem.innerHTML=html+downloadsHtml+infoHtml,bindHomeScreenSettingsIcon(elem,apiClient,user.Id,userSettings),infoHtml&&bindAppInfoEvents(elem),imageLoader.lazyChildren(elem)})}function bindAppInfoEvents(elem){elem.querySelector(".appInfoSection").addEventListener("click",function(e){dom.parentWithClass(e.target,"card")&®istrationServices.showPremiereInfo()})}function getRandomInt(min,max){return Math.floor(Math.random()*(max-min+1))+min}function getAppInfo(apiClient){var frequency=1728e5,cacheKey="lastappinfopresent5",lastDatePresented=parseInt(appSettings.get(cacheKey)||"0");return lastDatePresented?(new Date).getTime()-lastDatePresented
';return html+='
',html+='
',html+="
",html+="
"}function getTheaterInfo(){var html="";html+='
',html+='
',html+='

Discover Emby Theater

',html+='',html+="
";var nameText="Emby Theater";return html+='
',html+='

A beautiful app for your TV and large screen tablet. '+nameText+" runs on Windows, Xbox One, Raspberry Pi, Samsung Smart TVs, Sony PS4, Web Browsers, and more.

",html+='
',html+=getCard("https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater1.png"),html+=getCard("https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater2.png"),html+=getCard("https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater3.png"),html+="
",html+="
",html+="
"}function getPremiereInfo(){var html="";return html+='
',html+='
',html+='

Discover Emby Premiere

',html+='',html+="
",html+='
',html+='

Enjoy Emby DVR, get free access to Emby apps, and more.

',html+='
',html+=getCard("https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater1.png"),html+=getCard("https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater2.png"),html+=getCard("https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater3.png"),html+="
",html+="
",html+="
"}function getFetchLatestItemsFn(serverId,parentId,collectionType){return function(){var apiClient=connectionManager.getApiClient(serverId),limit=16;enableScrollX()?"music"===collectionType&&(limit=30):limit="tvshows"===collectionType?5:"music"===collectionType?9:8;var options={Limit:limit,Fields:"PrimaryImageAspectRatio,BasicSyncInfo",ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Thumb",ParentId:parentId};return apiClient.getLatestItems(options)}}function getLatestItemsHtmlFn(itemType,viewType){return function(items){var shape="Channel"===itemType||"movies"===viewType?getPortraitShape():"music"===viewType?getSquareShape():getThumbShape(),cardLayout=!1;return cardBuilder.getCardsHtml({items:items,shape:shape,preferThumb:"movies"!==viewType&&"Channel"!==itemType&&"music"!==viewType?"auto":null,showUnplayedIndicator:!1,showChildCountIndicator:!0,context:"home",overlayText:!1,centerText:!cardLayout,overlayPlayButton:"photos"!==viewType,allowBottomPadding:!enableScrollX()&&!cardLayout,cardLayout:cardLayout,showTitle:"photos"!==viewType,showYear:"movies"===viewType||"tvshows"===viewType||!viewType,showParentTitle:"music"===viewType||"tvshows"===viewType||!viewType||cardLayout&&"tvshows"===viewType,lines:2})}}function renderLatestSection(elem,apiClient,user,parent){var html="";html+='
',layoutManager.tv?html+='

'+globalize.translate("sharedcomponents#LatestFromLibrary",parent.Name)+"

":(html+='',html+='

',html+=globalize.translate("sharedcomponents#LatestFromLibrary",parent.Name),html+="

",html+='',html+="
"),html+="
",html+=enableScrollX()?'
':'
',enableScrollX()&&(html+="
"),html+="
",elem.innerHTML=html;var itemsContainer=elem.querySelector(".itemsContainer");itemsContainer.fetchData=getFetchLatestItemsFn(apiClient.serverId(),parent.Id,parent.CollectionType),itemsContainer.getItemsHtml=getLatestItemsHtmlFn(parent.Type,parent.CollectionType),itemsContainer.parentContainer=elem}function loadRecentlyAdded(elem,apiClient,user,userViews){elem.classList.remove("verticalSection");for(var excludeViewTypes=["playlists","livetv","boxsets","channels"],i=0,length=userViews.length;i":(html+='',html+='

',html+=globalize.translate("sharedcomponents#HeaderMyDownloads"),html+="

",html+='',html+="
",html+=''),html+="
",html+='
';var cardLayout=!1;return html+=cardBuilder.getCardsHtml({items:items,preferThumb:"auto",shape:"autooverflow",overlayText:!1,showTitle:!0,showParentTitle:!0,lazy:!0,showDetailsMenu:!0,overlayPlayButton:!0,context:"home",centerText:!cardLayout,allowBottomPadding:!1,cardLayout:cardLayout,showYear:!0,lines:2}),html+="
",html+="
"})}function loadLibraryTiles(elem,apiClient,user,userSettings,shape,userViews,allSections){elem.classList.remove("verticalSection");var html="",scrollX=!layoutManager.desktop;return userViews.length&&(html+='
',html+='
',html+='

'+globalize.translate("sharedcomponents#HeaderMyMedia")+"

",layoutManager.tv||(html+=''),html+="
",html+=scrollX?'
':'
',html+=cardBuilder.getCardsHtml({items:userViews,shape:scrollX?"overflowSmallBackdrop":shape,showTitle:!0,centerText:!0,overlayText:!1,lazy:!0,transition:!1,allowBottomPadding:!scrollX}),scrollX&&(html+="
"),html+="
",html+="
"),Promise.all([getAppInfo(apiClient),getDownloadsSectionHtml(apiClient,user,userSettings)]).then(function(responses){var infoHtml=responses[0],downloadsHtml=responses[1];elem.innerHTML=html+downloadsHtml+infoHtml,bindHomeScreenSettingsIcon(elem,apiClient,user.Id,userSettings),infoHtml&&bindAppInfoEvents(elem),imageLoader.lazyChildren(elem)})}function getContinueWatchingFetchFn(serverId){return function(){var limit,apiClient=connectionManager.getApiClient(serverId),screenWidth=dom.getWindowSize().innerWidth;enableScrollX()?limit=12:(limit=screenWidth>=1920?8:screenWidth>=1600?8:screenWidth>=1200?9:6,limit=Math.min(limit,5));var options={Limit:limit,Recursive:!0,Fields:"PrimaryImageAspectRatio,BasicSyncInfo",ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Thumb",EnableTotalRecordCount:!1,MediaTypes:"Video"};return apiClient.getResumableItems(apiClient.getCurrentUserId(),options)}}function getContinueWatchingItemsHtml(items){var cardLayout=!1;return cardBuilder.getCardsHtml({items:items,preferThumb:!0,shape:getThumbShape(),overlayText:!1,showTitle:!0,showParentTitle:!0,lazy:!0,showDetailsMenu:!0,overlayPlayButton:!0,context:"home",centerText:!cardLayout,allowBottomPadding:!1,cardLayout:cardLayout,showYear:!0,lines:2})}function loadResumeVideo(elem,apiClient,userId){var html="";html+='

'+globalize.translate("sharedcomponents#HeaderContinueWatching")+"

",html+=enableScrollX()?'
':'
',enableScrollX()&&(html+="
"),html+="
",elem.classList.add("hide"),elem.innerHTML=html;var itemsContainer=elem.querySelector(".itemsContainer");itemsContainer.fetchData=getContinueWatchingFetchFn(apiClient.serverId()),itemsContainer.getItemsHtml=getContinueWatchingItemsHtml,itemsContainer.parentContainer=elem}function getContinueListeningFetchFn(serverId){return function(){var limit,apiClient=connectionManager.getApiClient(serverId),screenWidth=dom.getWindowSize().innerWidth;enableScrollX()?limit=12:(limit=screenWidth>=1920?8:screenWidth>=1600?8:screenWidth>=1200?9:6,limit=Math.min(limit,5));var options={Limit:limit,Recursive:!0,Fields:"PrimaryImageAspectRatio,BasicSyncInfo",ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Thumb",EnableTotalRecordCount:!1,MediaTypes:"Audio"};return apiClient.getResumableItems(apiClient.getCurrentUserId(),options)}}function getContinueListeningItemsHtml(items){var cardLayout=!1;return cardBuilder.getCardsHtml({items:items,preferThumb:!0,shape:getThumbShape(),overlayText:!1,showTitle:!0,showParentTitle:!0,lazy:!0,showDetailsMenu:!0,overlayPlayButton:!0,context:"home",centerText:!cardLayout,allowBottomPadding:!1,cardLayout:cardLayout,showYear:!0,lines:2})}function loadResumeAudio(elem,apiClient,userId){var html="";html+='

'+globalize.translate("sharedcomponents#HeaderContinueWatching")+"

",html+=enableScrollX()?'
':'
',enableScrollX()&&(html+="
"),html+="
",elem.classList.add("hide"),elem.innerHTML=html;var itemsContainer=elem.querySelector(".itemsContainer");itemsContainer.fetchData=getContinueListeningFetchFn(apiClient.serverId()),itemsContainer.getItemsHtml=getContinueListeningItemsHtml,itemsContainer.parentContainer=elem}function bindUnlockClick(elem){var btnUnlock=elem.querySelector(".btnUnlock");btnUnlock&&btnUnlock.addEventListener("click",function(e){registrationServices.validateFeature("livetv",{viewOnly:!0}).then(function(){dom.parentWithClass(elem,"homeSectionsContainer").dispatchEvent(new CustomEvent("settingschange",{cancelable:!1}))})})}function getOnNowFetchFn(serverId){return function(){var apiClient=connectionManager.getApiClient(serverId);return apiClient.getLiveTvRecommendedPrograms({userId:apiClient.getCurrentUserId(),IsAiring:!0,limit:24,ImageTypeLimit:1,EnableImageTypes:"Primary,Thumb,Backdrop",EnableTotalRecordCount:!1,Fields:"ChannelInfo,PrimaryImageAspectRatio"})}}function getOnNowItemsHtml(items){return cardBuilder.getCardsHtml({items:items,preferThumb:"auto",inheritThumb:!1,shape:enableScrollX()?"autooverflow":"auto",showParentTitleOrTitle:!0,showTitle:!0,centerText:!0,coverImage:!0,overlayText:!1,allowBottomPadding:!enableScrollX(),showAirTime:!0,showChannelName:!1,showAirDateTime:!1,showAirEndTime:!0,defaultShape:getThumbShape(),lines:3,overlayPlayButton:!0})}function loadOnNow(elem,apiClient,user){if(!user.Policy.EnableLiveTvAccess)return Promise.resolve();var promises=[];promises.push(registrationServices.validateFeature("livetv",{viewOnly:!0,showDialog:!1}).then(function(){return!0},function(){return!1}));user.Id;return promises.push(apiClient.getLiveTvRecommendedPrograms({userId:apiClient.getCurrentUserId(),IsAiring:!0,limit:1,ImageTypeLimit:1,EnableImageTypes:"Primary,Thumb,Backdrop",EnableTotalRecordCount:!1,Fields:"ChannelInfo,PrimaryImageAspectRatio"})),Promise.all(promises).then(function(responses){var registered=responses[0],result=responses[1],html="";if(result.Items.length&®istered){elem.classList.remove("padded-left"),elem.classList.remove("padded-right"),elem.classList.remove("padded-bottom"),elem.classList.remove("verticalSection"),html+='
',html+='
',html+='

'+globalize.translate("sharedcomponents#LiveTV")+"

",html+="
",enableScrollX()?(html+='",html+="
",html+='
',html+='
',layoutManager.tv?html+='

'+globalize.translate("sharedcomponents#HeaderOnNow")+"

":(html+='',html+='

',html+=globalize.translate("sharedcomponents#HeaderOnNow"),html+="

",html+='',html+="
"),html+="
",html+=enableScrollX()?'
':'
',enableScrollX()&&(html+="
"),html+="
",html+="
",elem.innerHTML=html;var itemsContainer=elem.querySelector(".itemsContainer");itemsContainer.parentContainer=elem,itemsContainer.fetchData=getOnNowFetchFn(apiClient.serverId()),itemsContainer.getItemsHtml=getOnNowItemsHtml}else result.Items.length&&!registered&&(elem.classList.add("padded-left"),elem.classList.add("padded-right"),elem.classList.add("padded-bottom"),html+='

'+globalize.translate("sharedcomponents#LiveTvRequiresUnlock")+"

",html+='",elem.innerHTML=html);bindUnlockClick(elem)})}function getNextUpFetchFn(serverId){return function(){var apiClient=connectionManager.getApiClient(serverId);return apiClient.getNextUpEpisodes({Limit:enableScrollX()?24:15,Fields:"PrimaryImageAspectRatio,SeriesInfo,DateCreated,BasicSyncInfo",UserId:apiClient.getCurrentUserId(),ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1})}}function getNextUpItemsHtml(items){var cardLayout=!1;return cardBuilder.getCardsHtml({items:items,preferThumb:!0,shape:getThumbShape(),overlayText:!1,showTitle:!0,showParentTitle:!0,lazy:!0,overlayPlayButton:!0,context:"home",centerText:!cardLayout,allowBottomPadding:!enableScrollX(),cardLayout:cardLayout})}function loadNextUp(elem,apiClient,userId){var html="";html+='
',layoutManager.tv?html+='

'+globalize.translate("sharedcomponents#HeaderNextUp")+"

":(html+='',html+='

',html+=globalize.translate("sharedcomponents#HeaderNextUp"),html+="

",html+='',html+="
"),html+="
",html+=enableScrollX()?'
':'
',enableScrollX()&&(html+="
"),html+="
",elem.classList.add("hide"),elem.innerHTML=html;var itemsContainer=elem.querySelector(".itemsContainer");itemsContainer.fetchData=getNextUpFetchFn(apiClient.serverId()),itemsContainer.getItemsHtml=getNextUpItemsHtml,itemsContainer.parentContainer=elem}function getLatestRecordingsFetchFn(serverId,activeRecordingsOnly){return function(){var apiClient=connectionManager.getApiClient(serverId);return apiClient.getLiveTvRecordings({userId:apiClient.getCurrentUserId(),Limit:enableScrollX()?12:5,Fields:"PrimaryImageAspectRatio,BasicSyncInfo",EnableTotalRecordCount:!1,IsLibraryItem:!!activeRecordingsOnly&&null,IsInProgress:!!activeRecordingsOnly||null})}}function getLatestRecordingItemsHtml(activeRecordingsOnly){return function(items){return cardBuilder.getCardsHtml({items:items,shape:enableScrollX()?"autooverflow":"auto",showTitle:!0,showParentTitle:!0,coverImage:!0,lazy:!0,showDetailsMenu:!0,centerText:!0,overlayText:!1,showYear:!0,lines:2,overlayPlayButton:!activeRecordingsOnly,allowBottomPadding:!enableScrollX(),preferThumb:!0,cardLayout:!1,overlayMoreButton:activeRecordingsOnly,action:activeRecordingsOnly?"none":null,centerPlayButton:activeRecordingsOnly})}}function loadLatestLiveTvRecordings(elem,activeRecordingsOnly,apiClient,userId){var title=activeRecordingsOnly?globalize.translate("sharedcomponents#HeaderActiveRecordings"):globalize.translate("sharedcomponents#HeaderLatestRecordings"),html="";html+='
',html+='

'+title+"

",!layoutManager.tv,html+="
",html+=enableScrollX()?'
':'
',enableScrollX()&&(html+="
"),html+="
",elem.classList.add("hide"),elem.innerHTML=html;var itemsContainer=elem.querySelector(".itemsContainer");itemsContainer.fetchData=getLatestRecordingsFetchFn(apiClient.serverId(),activeRecordingsOnly),itemsContainer.getItemsHtml=getLatestRecordingItemsHtml(activeRecordingsOnly),itemsContainer.parentContainer=elem}return{loadLibraryTiles:loadLibraryTiles,getDefaultSection:getDefaultSection,loadSections:loadSections,destroySections:destroySections,pause:pause,resume:resume}}); \ No newline at end of file +define(["connectionManager","cardBuilder","registrationServices","appSettings","dom","apphost","layoutManager","imageLoader","globalize","itemShortcuts","itemHelper","appRouter","emby-button","paper-icon-button-light","emby-itemscontainer","emby-scroller","emby-linkbutton","css!./homesections"],function(connectionManager,cardBuilder,registrationServices,appSettings,dom,appHost,layoutManager,imageLoader,globalize,itemShortcuts,itemHelper,appRouter){"use strict";function getDefaultSection(index){switch(index){case 0:return"smalllibrarytiles";case 1:return"resume";case 2:return"resumeaudio";case 3:return"livetv";case 4:return"nextup";case 5:return"latestmedia";case 6:return"none";default:return""}}function getAllSectionsToShow(userSettings,sectionCount){for(var sections=[],i=0,length=sectionCount;i
';elem.innerHTML=html,elem.classList.add("homeSectionsContainer");var promises=[],sections=getAllSectionsToShow(userSettings,7);for(i=0,length=sections.length;i",layoutManager.tv||(html+=''),html+="
",html+='
';for(var i=0,length=items.length;i'+icon+""+item.Name+""}return html+="
",html+="
"}function loadlibraryButtons(elem,apiClient,user,userSettings,userViews){return Promise.all([getAppInfo(apiClient),getDownloadsSectionHtml(apiClient,user,userSettings)]).then(function(responses){var infoHtml=responses[0],downloadsHtml=responses[1];elem.classList.remove("verticalSection");var html=getLibraryButtonsHtml(userViews);elem.innerHTML=html+downloadsHtml+infoHtml,bindHomeScreenSettingsIcon(elem,apiClient,user.Id,userSettings),infoHtml&&bindAppInfoEvents(elem),imageLoader.lazyChildren(elem)})}function bindAppInfoEvents(elem){elem.querySelector(".appInfoSection").addEventListener("click",function(e){dom.parentWithClass(e.target,"card")&®istrationServices.showPremiereInfo()})}function getRandomInt(min,max){return Math.floor(Math.random()*(max-min+1))+min}function getAppInfo(apiClient){var cacheKey="lastappinfopresent5",lastDatePresented=parseInt(appSettings.get(cacheKey)||"0");return lastDatePresented?(new Date).getTime()-lastDatePresented<1728e5?Promise.resolve(""):registrationServices.validateFeature("dvr",{showDialog:!1,viewOnly:!0}).then(function(){return appSettings.set(cacheKey,(new Date).getTime()),""},function(){appSettings.set(cacheKey,(new Date).getTime());var infos=[getPremiereInfo];return appHost.supports("otherapppromotions")&&infos.push(getTheaterInfo),infos[getRandomInt(0,infos.length-1)]()}):(appSettings.set(cacheKey,(new Date).getTime()),Promise.resolve(""))}function getCard(img,shape){shape=shape||"backdropCard";var html='
';return html+='
',html+='
',html+="
",html+="
"}function getTheaterInfo(){var html="";html+='
',html+='
',html+='

Discover Emby Theater

',html+='',html+="
";return html+='
',html+='

A beautiful app for your TV and large screen tablet. Emby Theater runs on Windows, Xbox One, Raspberry Pi, Samsung Smart TVs, Sony PS4, Web Browsers, and more.

',html+='
',html+=getCard("https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater1.png"),html+=getCard("https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater2.png"),html+=getCard("https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater3.png"),html+="
",html+="
",html+="
"}function getPremiereInfo(){var html="";return html+='
',html+='
',html+='

Discover Emby Premiere

',html+='',html+="
",html+='
',html+='

Enjoy Emby DVR, get free access to Emby apps, and more.

',html+='
',html+=getCard("https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater1.png"),html+=getCard("https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater2.png"),html+=getCard("https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater3.png"),html+="
",html+="
",html+="
"}function getFetchLatestItemsFn(serverId,parentId,collectionType){return function(){var apiClient=connectionManager.getApiClient(serverId),limit=16;enableScrollX()?"music"===collectionType&&(limit=30):limit="tvshows"===collectionType?5:"music"===collectionType?9:8;var options={Limit:limit,Fields:"PrimaryImageAspectRatio,BasicSyncInfo",ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Thumb",ParentId:parentId};return apiClient.getLatestItems(options)}}function getLatestItemsHtmlFn(itemType,viewType){return function(items){var shape="Channel"===itemType||"movies"===viewType?getPortraitShape():"music"===viewType?getSquareShape():getThumbShape();return cardBuilder.getCardsHtml({items:items,shape:shape,preferThumb:"movies"!==viewType&&"Channel"!==itemType&&"music"!==viewType?"auto":null,showUnplayedIndicator:!1,showChildCountIndicator:!0,context:"home",overlayText:!1,centerText:!0,overlayPlayButton:"photos"!==viewType,allowBottomPadding:!enableScrollX()&&!0,cardLayout:!1,showTitle:"photos"!==viewType,showYear:"movies"===viewType||"tvshows"===viewType||!viewType,showParentTitle:"music"===viewType||"tvshows"===viewType||!viewType||!1,lines:2})}}function renderLatestSection(elem,apiClient,user,parent){var html="";html+='
',layoutManager.tv?html+='

'+globalize.translate("sharedcomponents#LatestFromLibrary",parent.Name)+"

":(html+='',html+='

',html+=globalize.translate("sharedcomponents#LatestFromLibrary",parent.Name),html+="

",html+='',html+="
"),html+="
",enableScrollX()?html+='
':html+='
',enableScrollX()&&(html+="
"),html+="
",elem.innerHTML=html;var itemsContainer=elem.querySelector(".itemsContainer");itemsContainer.fetchData=getFetchLatestItemsFn(apiClient.serverId(),parent.Id,parent.CollectionType),itemsContainer.getItemsHtml=getLatestItemsHtmlFn(parent.Type,parent.CollectionType),itemsContainer.parentContainer=elem}function loadRecentlyAdded(elem,apiClient,user,userViews){elem.classList.remove("verticalSection");for(var excludeViewTypes=["playlists","livetv","boxsets","channels"],i=0,length=userViews.length;i":(html+='',html+='

',html+=globalize.translate("sharedcomponents#HeaderMyDownloads"),html+="

",html+='',html+="
",html+=''),html+="
",html+='
',html+=cardBuilder.getCardsHtml({items:items,preferThumb:"auto",shape:"autooverflow",overlayText:!1,showTitle:!0,showParentTitle:!0,lazy:!0,showDetailsMenu:!0,overlayPlayButton:!0,context:"home",centerText:!0,allowBottomPadding:!1,cardLayout:!1,showYear:!0,lines:2}),html+="
",html+="
"}):Promise.resolve("")}function loadLibraryTiles(elem,apiClient,user,userSettings,shape,userViews,allSections){elem.classList.remove("verticalSection");var html="",scrollX=!layoutManager.desktop;return userViews.length&&(html+='
',html+='
',html+='

'+globalize.translate("sharedcomponents#HeaderMyMedia")+"

",layoutManager.tv||(html+=''),html+="
",html+=scrollX?'
':'
',html+=cardBuilder.getCardsHtml({items:userViews,shape:scrollX?"overflowSmallBackdrop":shape,showTitle:!0,centerText:!0,overlayText:!1,lazy:!0,transition:!1,allowBottomPadding:!scrollX}),scrollX&&(html+="
"),html+="
",html+="
"),Promise.all([getAppInfo(apiClient),getDownloadsSectionHtml(apiClient,user,userSettings)]).then(function(responses){var infoHtml=responses[0],downloadsHtml=responses[1];elem.innerHTML=html+downloadsHtml+infoHtml,bindHomeScreenSettingsIcon(elem,apiClient,user.Id,userSettings),infoHtml&&bindAppInfoEvents(elem),imageLoader.lazyChildren(elem)})}function getContinueWatchingFetchFn(serverId){return function(){var limit,apiClient=connectionManager.getApiClient(serverId),screenWidth=dom.getWindowSize().innerWidth;enableScrollX()?limit=12:(limit=screenWidth>=1920?8:screenWidth>=1600?8:screenWidth>=1200?9:6,limit=Math.min(limit,5));var options={Limit:limit,Recursive:!0,Fields:"PrimaryImageAspectRatio,BasicSyncInfo",ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Thumb",EnableTotalRecordCount:!1,MediaTypes:"Video"};return apiClient.getResumableItems(apiClient.getCurrentUserId(),options)}}function getContinueWatchingItemsHtml(items){return cardBuilder.getCardsHtml({items:items,preferThumb:!0,shape:getThumbShape(),overlayText:!1,showTitle:!0,showParentTitle:!0,lazy:!0,showDetailsMenu:!0,overlayPlayButton:!0,context:"home",centerText:!0,allowBottomPadding:!1,cardLayout:!1,showYear:!0,lines:2})}function loadResumeVideo(elem,apiClient,userId){var html="";html+='

'+globalize.translate("sharedcomponents#HeaderContinueWatching")+"

",enableScrollX()?html+='
':html+='
',enableScrollX()&&(html+="
"),html+="
",elem.classList.add("hide"),elem.innerHTML=html;var itemsContainer=elem.querySelector(".itemsContainer");itemsContainer.fetchData=getContinueWatchingFetchFn(apiClient.serverId()),itemsContainer.getItemsHtml=getContinueWatchingItemsHtml,itemsContainer.parentContainer=elem}function getContinueListeningFetchFn(serverId){return function(){var limit,apiClient=connectionManager.getApiClient(serverId),screenWidth=dom.getWindowSize().innerWidth;enableScrollX()?limit=12:(limit=screenWidth>=1920?8:screenWidth>=1600?8:screenWidth>=1200?9:6,limit=Math.min(limit,5));var options={Limit:limit,Recursive:!0,Fields:"PrimaryImageAspectRatio,BasicSyncInfo",ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Thumb",EnableTotalRecordCount:!1,MediaTypes:"Audio"};return apiClient.getResumableItems(apiClient.getCurrentUserId(),options)}}function getContinueListeningItemsHtml(items){return cardBuilder.getCardsHtml({items:items,preferThumb:!0,shape:getThumbShape(),overlayText:!1,showTitle:!0,showParentTitle:!0,lazy:!0,showDetailsMenu:!0,overlayPlayButton:!0,context:"home",centerText:!0,allowBottomPadding:!1,cardLayout:!1,showYear:!0,lines:2})}function loadResumeAudio(elem,apiClient,userId){var html="";html+='

'+globalize.translate("sharedcomponents#HeaderContinueWatching")+"

",enableScrollX()?html+='
':html+='
',enableScrollX()&&(html+="
"),html+="
",elem.classList.add("hide"),elem.innerHTML=html;var itemsContainer=elem.querySelector(".itemsContainer");itemsContainer.fetchData=getContinueListeningFetchFn(apiClient.serverId()),itemsContainer.getItemsHtml=getContinueListeningItemsHtml,itemsContainer.parentContainer=elem}function bindUnlockClick(elem){var btnUnlock=elem.querySelector(".btnUnlock");btnUnlock&&btnUnlock.addEventListener("click",function(e){registrationServices.validateFeature("livetv",{viewOnly:!0}).then(function(){dom.parentWithClass(elem,"homeSectionsContainer").dispatchEvent(new CustomEvent("settingschange",{cancelable:!1}))})})}function getOnNowFetchFn(serverId){return function(){var apiClient=connectionManager.getApiClient(serverId);return apiClient.getLiveTvRecommendedPrograms({userId:apiClient.getCurrentUserId(),IsAiring:!0,limit:24,ImageTypeLimit:1,EnableImageTypes:"Primary,Thumb,Backdrop",EnableTotalRecordCount:!1,Fields:"ChannelInfo,PrimaryImageAspectRatio"})}}function getOnNowItemsHtml(items){return cardBuilder.getCardsHtml({items:items,preferThumb:"auto",inheritThumb:!1,shape:enableScrollX()?"autooverflow":"auto",showParentTitleOrTitle:!0,showTitle:!0,centerText:!0,coverImage:!0,overlayText:!1,allowBottomPadding:!enableScrollX(),showAirTime:!0,showChannelName:!1,showAirDateTime:!1,showAirEndTime:!0,defaultShape:getThumbShape(),lines:3,overlayPlayButton:!0})}function loadOnNow(elem,apiClient,user){if(!user.Policy.EnableLiveTvAccess)return Promise.resolve();var promises=[];promises.push(registrationServices.validateFeature("livetv",{viewOnly:!0,showDialog:!1}).then(function(){return!0},function(){return!1}));user.Id;return promises.push(apiClient.getLiveTvRecommendedPrograms({userId:apiClient.getCurrentUserId(),IsAiring:!0,limit:1,ImageTypeLimit:1,EnableImageTypes:"Primary,Thumb,Backdrop",EnableTotalRecordCount:!1,Fields:"ChannelInfo,PrimaryImageAspectRatio"})),Promise.all(promises).then(function(responses){var registered=responses[0],result=responses[1],html="";if(result.Items.length&®istered){elem.classList.remove("padded-left"),elem.classList.remove("padded-right"),elem.classList.remove("padded-bottom"),elem.classList.remove("verticalSection"),html+='
',html+='
',html+='

'+globalize.translate("sharedcomponents#LiveTV")+"

",html+="
",enableScrollX()?(html+='",html+="
",html+='
',html+='
',layoutManager.tv?html+='

'+globalize.translate("sharedcomponents#HeaderOnNow")+"

":(html+='',html+='

',html+=globalize.translate("sharedcomponents#HeaderOnNow"),html+="

",html+='',html+="
"),html+="
",enableScrollX()?html+='
':html+='
',enableScrollX()&&(html+="
"),html+="
",html+="
",elem.innerHTML=html;var itemsContainer=elem.querySelector(".itemsContainer");itemsContainer.parentContainer=elem,itemsContainer.fetchData=getOnNowFetchFn(apiClient.serverId()),itemsContainer.getItemsHtml=getOnNowItemsHtml}else result.Items.length&&!registered&&(elem.classList.add("padded-left"),elem.classList.add("padded-right"),elem.classList.add("padded-bottom"),html+='

'+globalize.translate("sharedcomponents#LiveTvRequiresUnlock")+"

",html+='",elem.innerHTML=html);bindUnlockClick(elem)})}function getNextUpFetchFn(serverId){return function(){var apiClient=connectionManager.getApiClient(serverId);return apiClient.getNextUpEpisodes({Limit:enableScrollX()?24:15,Fields:"PrimaryImageAspectRatio,SeriesInfo,DateCreated,BasicSyncInfo",UserId:apiClient.getCurrentUserId(),ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1})}}function getNextUpItemsHtml(items){return cardBuilder.getCardsHtml({items:items,preferThumb:!0,shape:getThumbShape(),overlayText:!1,showTitle:!0,showParentTitle:!0,lazy:!0,overlayPlayButton:!0,context:"home",centerText:!0,allowBottomPadding:!enableScrollX(),cardLayout:!1})}function loadNextUp(elem,apiClient,userId){var html="";html+='
',layoutManager.tv?html+='

'+globalize.translate("sharedcomponents#HeaderNextUp")+"

":(html+='',html+='

',html+=globalize.translate("sharedcomponents#HeaderNextUp"),html+="

",html+='',html+="
"),html+="
",enableScrollX()?html+='
':html+='
',enableScrollX()&&(html+="
"),html+="
",elem.classList.add("hide"),elem.innerHTML=html;var itemsContainer=elem.querySelector(".itemsContainer");itemsContainer.fetchData=getNextUpFetchFn(apiClient.serverId()),itemsContainer.getItemsHtml=getNextUpItemsHtml,itemsContainer.parentContainer=elem}function getLatestRecordingsFetchFn(serverId,activeRecordingsOnly){return function(){var apiClient=connectionManager.getApiClient(serverId);return apiClient.getLiveTvRecordings({userId:apiClient.getCurrentUserId(),Limit:enableScrollX()?12:5,Fields:"PrimaryImageAspectRatio,BasicSyncInfo",EnableTotalRecordCount:!1,IsLibraryItem:!!activeRecordingsOnly&&null,IsInProgress:!!activeRecordingsOnly||null})}}function getLatestRecordingItemsHtml(activeRecordingsOnly){return function(items){return cardBuilder.getCardsHtml({items:items,shape:enableScrollX()?"autooverflow":"auto",showTitle:!0,showParentTitle:!0,coverImage:!0,lazy:!0,showDetailsMenu:!0,centerText:!0,overlayText:!1,showYear:!0,lines:2,overlayPlayButton:!activeRecordingsOnly,allowBottomPadding:!enableScrollX(),preferThumb:!0,cardLayout:!1,overlayMoreButton:activeRecordingsOnly,action:activeRecordingsOnly?"none":null,centerPlayButton:activeRecordingsOnly})}}function loadLatestLiveTvRecordings(elem,activeRecordingsOnly,apiClient,userId){var title=activeRecordingsOnly?globalize.translate("sharedcomponents#HeaderActiveRecordings"):globalize.translate("sharedcomponents#HeaderLatestRecordings"),html="";html+='
',html+='

'+title+"

",layoutManager.tv,html+="
",enableScrollX()?html+='
':html+='
',enableScrollX()&&(html+="
"),html+="
",elem.classList.add("hide"),elem.innerHTML=html;var itemsContainer=elem.querySelector(".itemsContainer");itemsContainer.fetchData=getLatestRecordingsFetchFn(apiClient.serverId(),activeRecordingsOnly),itemsContainer.getItemsHtml=getLatestRecordingItemsHtml(activeRecordingsOnly),itemsContainer.parentContainer=elem}return{loadLibraryTiles:loadLibraryTiles,getDefaultSection:getDefaultSection,loadSections:loadSections,destroySections:destroySections,pause:pause,resume:resume}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/htmlaudioplayer/plugin.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/htmlaudioplayer/plugin.js index 117b778588..7ba843ad92 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/htmlaudioplayer/plugin.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/htmlaudioplayer/plugin.js @@ -1 +1 @@ -define(["events","browser","require","apphost","appSettings","htmlMediaHelper"],function(events,browser,require,appHost,appSettings,htmlMediaHelper){"use strict";function getDefaultProfile(){return new Promise(function(resolve,reject){require(["browserdeviceprofile"],function(profileBuilder){resolve(profileBuilder({}))})})}function fade(instance,elem,startingVolume){instance._isFadingOut=!0;var newVolume=Math.max(0,startingVolume-.15);return console.log("fading volume to "+newVolume),elem.volume=newVolume,newVolume<=0?(instance._isFadingOut=!1,Promise.resolve()):new Promise(function(resolve,reject){cancelFadeTimeout(),fadeTimeout=setTimeout(function(){fade(instance,elem,newVolume).then(resolve,reject)},100)})}function cancelFadeTimeout(){var timeout=fadeTimeout;timeout&&(clearTimeout(timeout),fadeTimeout=null)}function supportsFade(){return!browser.tv}function requireHlsPlayer(callback){require(["hlsjs"],function(hls){window.Hls=hls,callback()})}function enableHlsPlayer(url,item,mediaSource,mediaType){return htmlMediaHelper.enableHlsJsPlayer(mediaSource.RunTimeTicks,mediaType)?url.indexOf(".m3u8")!==-1?Promise.resolve():new Promise(function(resolve,reject){require(["fetchHelper"],function(fetchHelper){fetchHelper.ajax({url:url,type:"HEAD"}).then(function(response){var contentType=(response.headers.get("Content-Type")||"").toLowerCase();"application/x-mpegurl"===contentType?resolve():reject()},reject)})}):Promise.reject()}function HtmlAudioPlayer(){function setCurrentSrc(elem,options){elem.removeEventListener("error",onError),unBindEvents(elem),bindEvents(elem);var val=options.url;console.log("playing url: "+val);var seconds=(options.playerStartPositionTicks||0)/1e7;seconds&&(val+="#t="+seconds),htmlMediaHelper.destroyHlsPlayer(self),self._currentPlayOptions=options;var crossOrigin=htmlMediaHelper.getCrossOriginValue(options.mediaSource);return crossOrigin&&(elem.crossOrigin=crossOrigin),enableHlsPlayer(val,options.item,options.mediaSource,"Audio").then(function(){return new Promise(function(resolve,reject){requireHlsPlayer(function(){var hls=new Hls({manifestLoadingTimeOut:2e4});hls.loadSource(val),hls.attachMedia(elem),htmlMediaHelper.bindEventsToHlsPlayer(self,hls,elem,onError,resolve,reject),self._hlsPlayer=hls,self._currentSrc=val})})},function(){return elem.autoplay=!0,htmlMediaHelper.applySrc(elem,val,options).then(function(){return self._currentSrc=val,htmlMediaHelper.playWithPromise(elem,onError)})})}function bindEvents(elem){elem.addEventListener("timeupdate",onTimeUpdate),elem.addEventListener("ended",onEnded),elem.addEventListener("volumechange",onVolumeChange),elem.addEventListener("pause",onPause),elem.addEventListener("playing",onPlaying),elem.addEventListener("play",onPlay)}function unBindEvents(elem){elem.removeEventListener("timeupdate",onTimeUpdate),elem.removeEventListener("ended",onEnded),elem.removeEventListener("volumechange",onVolumeChange),elem.removeEventListener("pause",onPause),elem.removeEventListener("playing",onPlaying),elem.removeEventListener("play",onPlay)}function createMediaElement(){var elem=self._mediaElement;return elem?elem:(elem=document.querySelector(".mediaPlayerAudio"),elem||(elem=document.createElement("audio"),elem.classList.add("mediaPlayerAudio"),elem.classList.add("hide"),document.body.appendChild(elem)),elem.volume=htmlMediaHelper.getSavedVolume(),self._mediaElement=elem,elem)}function onEnded(){htmlMediaHelper.onEndedInternal(self,this,onError)}function onTimeUpdate(){var time=this.currentTime;self._isFadingOut||(self._currentTime=time,events.trigger(self,"timeupdate"))}function onVolumeChange(){self._isFadingOut||(htmlMediaHelper.saveVolume(this.volume),events.trigger(self,"volumechange"))}function onPlaying(e){self._started||(self._started=!0,this.removeAttribute("controls"),htmlMediaHelper.seekOnPlaybackStart(self,e.target,self._currentPlayOptions.playerStartPositionTicks)),events.trigger(self,"playing")}function onPlay(e){events.trigger(self,"unpause")}function onPause(){events.trigger(self,"pause")}function onError(){var errorCode=this.error?this.error.code||0:0,errorMessage=this.error?this.error.message||"":"";console.log("Media element error: "+errorCode.toString()+" "+errorMessage);var type;switch(errorCode){case 1:return;case 2:type="network";break;case 3:if(self._hlsPlayer)return void htmlMediaHelper.handleHlsJsMediaError(self);type="mediadecodeerror";break;case 4:type="medianotsupported";break;default:return}htmlMediaHelper.onErrorInternal(self,type)}var self=this;self.name="Html Audio Player",self.type="mediaplayer",self.id="htmlaudioplayer",self.priority=1,self.play=function(options){self._started=!1,self._timeUpdated=!1,self._currentTime=null;var elem=createMediaElement(options);return setCurrentSrc(elem,options)},self.stop=function(destroyPlayer){cancelFadeTimeout();var elem=self._mediaElement,src=self._currentSrc;if(elem&&src){if(!destroyPlayer||!supportsFade())return elem.pause(),htmlMediaHelper.onEndedInternal(self,elem,onError),destroyPlayer&&self.destroy(),Promise.resolve();var originalVolume=elem.volume;return fade(self,elem,elem.volume).then(function(){elem.pause(),elem.volume=originalVolume,htmlMediaHelper.onEndedInternal(self,elem,onError),destroyPlayer&&self.destroy()})}return Promise.resolve()},self.destroy=function(){unBindEvents(self._mediaElement)}}var fadeTimeout;return HtmlAudioPlayer.prototype.currentSrc=function(){return this._currentSrc},HtmlAudioPlayer.prototype.canPlayMediaType=function(mediaType){return"audio"===(mediaType||"").toLowerCase()},HtmlAudioPlayer.prototype.getDeviceProfile=function(item){return appHost.getDeviceProfile?appHost.getDeviceProfile(item):getDefaultProfile()},HtmlAudioPlayer.prototype.currentTime=function(val){var mediaElement=this._mediaElement;if(mediaElement){if(null!=val)return void(mediaElement.currentTime=val/1e3);var currentTime=this._currentTime;return currentTime?1e3*currentTime:1e3*(mediaElement.currentTime||0)}},HtmlAudioPlayer.prototype.duration=function(val){var mediaElement=this._mediaElement;if(mediaElement){var duration=mediaElement.duration;if(htmlMediaHelper.isValidDuration(duration))return 1e3*duration}return null},HtmlAudioPlayer.prototype.seekable=function(){var mediaElement=this._mediaElement;if(mediaElement){var seekable=mediaElement.seekable;if(seekable&&seekable.length){var start=seekable.start(0),end=seekable.end(0);return htmlMediaHelper.isValidDuration(start)||(start=0),htmlMediaHelper.isValidDuration(end)||(end=0),end-start>0}return!1}},HtmlAudioPlayer.prototype.getBufferedRanges=function(){var mediaElement=this._mediaElement;return mediaElement?htmlMediaHelper.getBufferedRanges(this,mediaElement):[]},HtmlAudioPlayer.prototype.pause=function(){var mediaElement=this._mediaElement;mediaElement&&mediaElement.pause()},HtmlAudioPlayer.prototype.resume=function(){var mediaElement=this._mediaElement;mediaElement&&mediaElement.play()},HtmlAudioPlayer.prototype.unpause=function(){var mediaElement=this._mediaElement;mediaElement&&mediaElement.play()},HtmlAudioPlayer.prototype.paused=function(){var mediaElement=this._mediaElement;return!!mediaElement&&mediaElement.paused},HtmlAudioPlayer.prototype.setVolume=function(val){var mediaElement=this._mediaElement;mediaElement&&(mediaElement.volume=val/100)},HtmlAudioPlayer.prototype.getVolume=function(){var mediaElement=this._mediaElement;if(mediaElement)return Math.min(Math.round(100*mediaElement.volume),100)},HtmlAudioPlayer.prototype.volumeUp=function(){this.setVolume(Math.min(this.getVolume()+2,100))},HtmlAudioPlayer.prototype.volumeDown=function(){this.setVolume(Math.max(this.getVolume()-2,0))},HtmlAudioPlayer.prototype.setMute=function(mute){var mediaElement=this._mediaElement;mediaElement&&(mediaElement.muted=mute)},HtmlAudioPlayer.prototype.isMuted=function(){var mediaElement=this._mediaElement;return!!mediaElement&&mediaElement.muted},HtmlAudioPlayer.prototype.destroy=function(){},HtmlAudioPlayer}); \ No newline at end of file +define(["events","browser","require","apphost","appSettings","htmlMediaHelper"],function(events,browser,require,appHost,appSettings,htmlMediaHelper){"use strict";function getDefaultProfile(){return new Promise(function(resolve,reject){require(["browserdeviceprofile"],function(profileBuilder){resolve(profileBuilder({}))})})}function fade(instance,elem,startingVolume){instance._isFadingOut=!0;var newVolume=Math.max(0,startingVolume-.15);return console.log("fading volume to "+newVolume),elem.volume=newVolume,newVolume<=0?(instance._isFadingOut=!1,Promise.resolve()):new Promise(function(resolve,reject){cancelFadeTimeout(),fadeTimeout=setTimeout(function(){fade(instance,elem,newVolume).then(resolve,reject)},100)})}function cancelFadeTimeout(){var timeout=fadeTimeout;timeout&&(clearTimeout(timeout),fadeTimeout=null)}function supportsFade(){return!browser.tv}function requireHlsPlayer(callback){require(["hlsjs"],function(hls){window.Hls=hls,callback()})}function enableHlsPlayer(url,item,mediaSource,mediaType){return htmlMediaHelper.enableHlsJsPlayer(mediaSource.RunTimeTicks,mediaType)?-1!==url.indexOf(".m3u8")?Promise.resolve():new Promise(function(resolve,reject){require(["fetchHelper"],function(fetchHelper){fetchHelper.ajax({url:url,type:"HEAD"}).then(function(response){"application/x-mpegurl"===(response.headers.get("Content-Type")||"").toLowerCase()?resolve():reject()},reject)})}):Promise.reject()}function HtmlAudioPlayer(){function setCurrentSrc(elem,options){elem.removeEventListener("error",onError),unBindEvents(elem),bindEvents(elem);var val=options.url;console.log("playing url: "+val);var seconds=(options.playerStartPositionTicks||0)/1e7;seconds&&(val+="#t="+seconds),htmlMediaHelper.destroyHlsPlayer(self),self._currentPlayOptions=options;var crossOrigin=htmlMediaHelper.getCrossOriginValue(options.mediaSource);return crossOrigin&&(elem.crossOrigin=crossOrigin),enableHlsPlayer(val,options.item,options.mediaSource,"Audio").then(function(){return new Promise(function(resolve,reject){requireHlsPlayer(function(){var hls=new Hls({manifestLoadingTimeOut:2e4});hls.loadSource(val),hls.attachMedia(elem),htmlMediaHelper.bindEventsToHlsPlayer(self,hls,elem,onError,resolve,reject),self._hlsPlayer=hls,self._currentSrc=val})})},function(){return elem.autoplay=!0,htmlMediaHelper.applySrc(elem,val,options).then(function(){return self._currentSrc=val,htmlMediaHelper.playWithPromise(elem,onError)})})}function bindEvents(elem){elem.addEventListener("timeupdate",onTimeUpdate),elem.addEventListener("ended",onEnded),elem.addEventListener("volumechange",onVolumeChange),elem.addEventListener("pause",onPause),elem.addEventListener("playing",onPlaying),elem.addEventListener("play",onPlay)}function unBindEvents(elem){elem.removeEventListener("timeupdate",onTimeUpdate),elem.removeEventListener("ended",onEnded),elem.removeEventListener("volumechange",onVolumeChange),elem.removeEventListener("pause",onPause),elem.removeEventListener("playing",onPlaying),elem.removeEventListener("play",onPlay)}function createMediaElement(){var elem=self._mediaElement;return elem||(elem=document.querySelector(".mediaPlayerAudio"),elem||(elem=document.createElement("audio"),elem.classList.add("mediaPlayerAudio"),elem.classList.add("hide"),document.body.appendChild(elem)),elem.volume=htmlMediaHelper.getSavedVolume(),self._mediaElement=elem,elem)}function onEnded(){htmlMediaHelper.onEndedInternal(self,this,onError)}function onTimeUpdate(){var time=this.currentTime;self._isFadingOut||(self._currentTime=time,events.trigger(self,"timeupdate"))}function onVolumeChange(){self._isFadingOut||(htmlMediaHelper.saveVolume(this.volume),events.trigger(self,"volumechange"))}function onPlaying(e){self._started||(self._started=!0,this.removeAttribute("controls"),htmlMediaHelper.seekOnPlaybackStart(self,e.target,self._currentPlayOptions.playerStartPositionTicks)),events.trigger(self,"playing")}function onPlay(e){events.trigger(self,"unpause")}function onPause(){events.trigger(self,"pause")}function onError(){var errorCode=this.error?this.error.code||0:0,errorMessage=this.error?this.error.message||"":"";console.log("Media element error: "+errorCode.toString()+" "+errorMessage);var type;switch(errorCode){case 1:return;case 2:type="network";break;case 3:if(self._hlsPlayer)return void htmlMediaHelper.handleHlsJsMediaError(self);type="mediadecodeerror";break;case 4:type="medianotsupported";break;default:return}htmlMediaHelper.onErrorInternal(self,type)}var self=this;self.name="Html Audio Player",self.type="mediaplayer",self.id="htmlaudioplayer",self.priority=1,self.play=function(options){return self._started=!1,self._timeUpdated=!1,self._currentTime=null,setCurrentSrc(createMediaElement(),options)},self.stop=function(destroyPlayer){cancelFadeTimeout();var elem=self._mediaElement,src=self._currentSrc;if(elem&&src){if(!destroyPlayer||!supportsFade())return elem.pause(),htmlMediaHelper.onEndedInternal(self,elem,onError),destroyPlayer&&self.destroy(),Promise.resolve();var originalVolume=elem.volume;return fade(self,elem,elem.volume).then(function(){elem.pause(),elem.volume=originalVolume,htmlMediaHelper.onEndedInternal(self,elem,onError),destroyPlayer&&self.destroy()})}return Promise.resolve()},self.destroy=function(){unBindEvents(self._mediaElement)}}var fadeTimeout;return HtmlAudioPlayer.prototype.currentSrc=function(){return this._currentSrc},HtmlAudioPlayer.prototype.canPlayMediaType=function(mediaType){return"audio"===(mediaType||"").toLowerCase()},HtmlAudioPlayer.prototype.getDeviceProfile=function(item){return appHost.getDeviceProfile?appHost.getDeviceProfile(item):getDefaultProfile()},HtmlAudioPlayer.prototype.currentTime=function(val){var mediaElement=this._mediaElement;if(mediaElement){if(null!=val)return void(mediaElement.currentTime=val/1e3);var currentTime=this._currentTime;return currentTime?1e3*currentTime:1e3*(mediaElement.currentTime||0)}},HtmlAudioPlayer.prototype.duration=function(val){var mediaElement=this._mediaElement;if(mediaElement){var duration=mediaElement.duration;if(htmlMediaHelper.isValidDuration(duration))return 1e3*duration}return null},HtmlAudioPlayer.prototype.seekable=function(){var mediaElement=this._mediaElement;if(mediaElement){var seekable=mediaElement.seekable;if(seekable&&seekable.length){var start=seekable.start(0),end=seekable.end(0);return htmlMediaHelper.isValidDuration(start)||(start=0),htmlMediaHelper.isValidDuration(end)||(end=0),end-start>0}return!1}},HtmlAudioPlayer.prototype.getBufferedRanges=function(){var mediaElement=this._mediaElement;return mediaElement?htmlMediaHelper.getBufferedRanges(this,mediaElement):[]},HtmlAudioPlayer.prototype.pause=function(){var mediaElement=this._mediaElement;mediaElement&&mediaElement.pause()},HtmlAudioPlayer.prototype.resume=function(){var mediaElement=this._mediaElement;mediaElement&&mediaElement.play()},HtmlAudioPlayer.prototype.unpause=function(){var mediaElement=this._mediaElement;mediaElement&&mediaElement.play()},HtmlAudioPlayer.prototype.paused=function(){var mediaElement=this._mediaElement;return!!mediaElement&&mediaElement.paused},HtmlAudioPlayer.prototype.setVolume=function(val){var mediaElement=this._mediaElement;mediaElement&&(mediaElement.volume=val/100)},HtmlAudioPlayer.prototype.getVolume=function(){var mediaElement=this._mediaElement;if(mediaElement)return Math.min(Math.round(100*mediaElement.volume),100)},HtmlAudioPlayer.prototype.volumeUp=function(){this.setVolume(Math.min(this.getVolume()+2,100))},HtmlAudioPlayer.prototype.volumeDown=function(){this.setVolume(Math.max(this.getVolume()-2,0))},HtmlAudioPlayer.prototype.setMute=function(mute){var mediaElement=this._mediaElement;mediaElement&&(mediaElement.muted=mute)},HtmlAudioPlayer.prototype.isMuted=function(){var mediaElement=this._mediaElement;return!!mediaElement&&mediaElement.muted},HtmlAudioPlayer.prototype.destroy=function(){},HtmlAudioPlayer}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/htmlvideoplayer/htmlmediahelper.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/htmlvideoplayer/htmlmediahelper.js index 2fa4c43ef1..c3d66abbf2 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/htmlvideoplayer/htmlmediahelper.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/htmlvideoplayer/htmlmediahelper.js @@ -1 +1 @@ -define(["appSettings","browser","events"],function(appSettings,browser,events){"use strict";function getSavedVolume(){return appSettings.get("volume")||1}function saveVolume(value){value&&appSettings.set("volume",value)}function getCrossOriginValue(mediaSource){return mediaSource.IsRemote?null:"anonymous"}function canPlayNativeHls(){var media=document.createElement("video");return!(!media.canPlayType("application/x-mpegURL").replace(/no/,"")&&!media.canPlayType("application/vnd.apple.mpegURL").replace(/no/,""))}function enableHlsShakaPlayer(item,mediaSource,mediaType){if(window.MediaSource&&MediaSource.isTypeSupported){if(canPlayNativeHls()){if(browser.edge&&"Video"===mediaType)return!0;mediaSource.RunTimeTicks}return!0}return!1}function enableHlsJsPlayer(runTimeTicks,mediaType){if(null==window.MediaSource)return!1;if(browser.iOS)return!1;if(browser.tizen||browser.web0s)return!1;if(canPlayNativeHls()){if(browser.android&&"Audio"===mediaType)return!0;if(browser.edge&&"Video"===mediaType,runTimeTicks)return!1}return!0}function handleHlsJsMediaError(instance,reject){var hlsPlayer=instance._hlsPlayer;if(hlsPlayer){var now=Date.now();window.performance&&window.performance.now&&(now=performance.now()),!recoverDecodingErrorDate||now-recoverDecodingErrorDate>3e3?(recoverDecodingErrorDate=now,console.log("try to recover media Error ..."),hlsPlayer.recoverMediaError()):!recoverSwapAudioCodecDate||now-recoverSwapAudioCodecDate>3e3?(recoverSwapAudioCodecDate=now,console.log("try to swap Audio Codec and recover media Error ..."),hlsPlayer.swapAudioCodec(),hlsPlayer.recoverMediaError()):(console.error("cannot recover, last media error recovery failed ..."),reject?reject():onErrorInternal(instance,"mediadecodeerror"))}}function onErrorInternal(instance,type){instance.destroyCustomTrack&&instance.destroyCustomTrack(instance._mediaElement),events.trigger(instance,"error",[{type:type}])}function isValidDuration(duration){return!(!duration||isNaN(duration)||duration===Number.POSITIVE_INFINITY||duration===Number.NEGATIVE_INFINITY)}function setCurrentTimeIfNeeded(element,seconds){Math.abs(element.currentTime||0,seconds)<=1&&(element.currentTime=seconds)}function seekOnPlaybackStart(instance,element,ticks){var seconds=(ticks||0)/1e7;if(seconds){var delay=((instance.currentSrc()||"").toLowerCase(),browser.safari?2500:0);delay?setTimeout(function(){setCurrentTimeIfNeeded(element,seconds)},delay):setCurrentTimeIfNeeded(element,seconds)}}function applySrc(elem,src,options){return window.Windows&&options.mediaSource&&options.mediaSource.IsLocal?Windows.Storage.StorageFile.getFileFromPathAsync(options.url).then(function(file){var playlist=new Windows.Media.Playback.MediaPlaybackList,source1=Windows.Media.Core.MediaSource.createFromStorageFile(file),startTime=(options.playerStartPositionTicks||0)/1e4;return playlist.items.append(new Windows.Media.Playback.MediaPlaybackItem(source1,startTime)),elem.src=URL.createObjectURL(playlist,{oneTimeOnly:!0}),Promise.resolve()}):(elem.src=src,Promise.resolve())}function onSuccessfulPlay(elem,onErrorFn){elem.addEventListener("error",onErrorFn)}function playWithPromise(elem,onErrorFn){try{var promise=elem.play();return promise&&promise.then?promise.catch(function(e){var errorName=(e.name||"").toLowerCase();return"notallowederror"===errorName||"aborterror"===errorName?(onSuccessfulPlay(elem,onErrorFn),Promise.resolve()):Promise.reject()}):(onSuccessfulPlay(elem,onErrorFn),Promise.resolve())}catch(err){return console.log("error calling video.play: "+err),Promise.reject()}}function destroyCastPlayer(instance){var player=instance._castPlayer;if(player){try{player.unload()}catch(err){console.log(err)}instance._castPlayer=null}}function destroyShakaPlayer(instance){var player=instance._shakaPlayer;if(player){try{player.destroy()}catch(err){console.log(err)}instance._shakaPlayer=null}}function destroyHlsPlayer(instance){var player=instance._hlsPlayer;if(player){try{player.destroy()}catch(err){console.log(err)}instance._hlsPlayer=null}}function destroyFlvPlayer(instance){var player=instance._flvPlayer;if(player){try{player.unload(),player.detachMediaElement(),player.destroy()}catch(err){console.log(err)}instance._flvPlayer=null}}function bindEventsToHlsPlayer(instance,hls,elem,onErrorFn,resolve,reject){hls.on(Hls.Events.MANIFEST_PARSED,function(){playWithPromise(elem,onErrorFn).then(resolve,function(){reject&&(reject(),reject=null)})}),hls.on(Hls.Events.ERROR,function(event,data){switch(console.log("HLS Error: Type: "+data.type+" Details: "+(data.details||"")+" Fatal: "+(data.fatal||!1)),data.type){case Hls.ErrorTypes.NETWORK_ERROR:if(data.response&&data.response.code&&data.response.code>=400)return console.log("hls.js response error code: "+data.response.code),hls.destroy(),void(reject?(reject("servererror"),reject=null):onErrorInternal(instance,"servererror"))}if(data.fatal)switch(data.type){case Hls.ErrorTypes.NETWORK_ERROR:data.response&&0===data.response.code?(console.log("hls.js response error code: "+data.response.code),hls.destroy(),reject?(reject("network"),reject=null):onErrorInternal(instance,"network")):(console.log("fatal network error encountered, try to recover"),hls.startLoad());break;case Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover");var currentReject=reject;reject=null,handleHlsJsMediaError(instance,currentReject);break;default:console.log("Cannot recover from hls error - destroy and trigger error"),hls.destroy(),reject?(reject(),reject=null):onErrorInternal(instance,"mediadecodeerror")}})}function onEndedInternal(instance,elem,onErrorFn){elem.removeEventListener("error",onErrorFn),elem.src="",elem.innerHTML="",elem.removeAttribute("src"),destroyHlsPlayer(instance),destroyFlvPlayer(instance),destroyShakaPlayer(instance),destroyCastPlayer(instance),instance.originalDocumentTitle&&(document.title=instance.originalDocumentTitle,instance.originalDocumentTitle=null);var stopInfo={src:instance._currentSrc};events.trigger(instance,"stopped",[stopInfo]),instance._currentTime=null,instance._currentSrc=null,instance._currentPlayOptions=null}function getBufferedRanges(instance,elem){var offset,ranges=[],seekable=elem.buffered||[],currentPlayOptions=instance._currentPlayOptions;currentPlayOptions&&(offset=currentPlayOptions.transcodingOffsetTicks),offset=offset||0;for(var i=0,length=seekable.length;i3e3?(recoverDecodingErrorDate=now,console.log("try to recover media Error ..."),hlsPlayer.recoverMediaError()):!recoverSwapAudioCodecDate||now-recoverSwapAudioCodecDate>3e3?(recoverSwapAudioCodecDate=now,console.log("try to swap Audio Codec and recover media Error ..."),hlsPlayer.swapAudioCodec(),hlsPlayer.recoverMediaError()):(console.error("cannot recover, last media error recovery failed ..."),reject?reject():onErrorInternal(instance,"mediadecodeerror"))}}function onErrorInternal(instance,type){instance.destroyCustomTrack&&instance.destroyCustomTrack(instance._mediaElement),events.trigger(instance,"error",[{type:type}])}function isValidDuration(duration){return!(!duration||isNaN(duration)||duration===Number.POSITIVE_INFINITY||duration===Number.NEGATIVE_INFINITY)}function setCurrentTimeIfNeeded(element,seconds){Math.abs(element.currentTime||0,seconds)<=1&&(element.currentTime=seconds)}function seekOnPlaybackStart(instance,element,ticks){var seconds=(ticks||0)/1e7;if(seconds){var delay=((instance.currentSrc()||"").toLowerCase(),browser.safari?2500:0);delay?setTimeout(function(){setCurrentTimeIfNeeded(element,seconds)},delay):setCurrentTimeIfNeeded(element,seconds)}}function applySrc(elem,src,options){return window.Windows&&options.mediaSource&&options.mediaSource.IsLocal?Windows.Storage.StorageFile.getFileFromPathAsync(options.url).then(function(file){var playlist=new Windows.Media.Playback.MediaPlaybackList,source1=Windows.Media.Core.MediaSource.createFromStorageFile(file),startTime=(options.playerStartPositionTicks||0)/1e4;return playlist.items.append(new Windows.Media.Playback.MediaPlaybackItem(source1,startTime)),elem.src=URL.createObjectURL(playlist,{oneTimeOnly:!0}),Promise.resolve()}):(elem.src=src,Promise.resolve())}function onSuccessfulPlay(elem,onErrorFn){elem.addEventListener("error",onErrorFn)}function playWithPromise(elem,onErrorFn){try{var promise=elem.play();return promise&&promise.then?promise.catch(function(e){var errorName=(e.name||"").toLowerCase();return"notallowederror"===errorName||"aborterror"===errorName?(onSuccessfulPlay(elem,onErrorFn),Promise.resolve()):Promise.reject()}):(onSuccessfulPlay(elem,onErrorFn),Promise.resolve())}catch(err){return console.log("error calling video.play: "+err),Promise.reject()}}function destroyCastPlayer(instance){var player=instance._castPlayer;if(player){try{player.unload()}catch(err){console.log(err)}instance._castPlayer=null}}function destroyShakaPlayer(instance){var player=instance._shakaPlayer;if(player){try{player.destroy()}catch(err){console.log(err)}instance._shakaPlayer=null}}function destroyHlsPlayer(instance){var player=instance._hlsPlayer;if(player){try{player.destroy()}catch(err){console.log(err)}instance._hlsPlayer=null}}function destroyFlvPlayer(instance){var player=instance._flvPlayer;if(player){try{player.unload(),player.detachMediaElement(),player.destroy()}catch(err){console.log(err)}instance._flvPlayer=null}}function bindEventsToHlsPlayer(instance,hls,elem,onErrorFn,resolve,reject){hls.on(Hls.Events.MANIFEST_PARSED,function(){playWithPromise(elem,onErrorFn).then(resolve,function(){reject&&(reject(),reject=null)})}),hls.on(Hls.Events.ERROR,function(event,data){switch(console.log("HLS Error: Type: "+data.type+" Details: "+(data.details||"")+" Fatal: "+(data.fatal||!1)),data.type){case Hls.ErrorTypes.NETWORK_ERROR:if(data.response&&data.response.code&&data.response.code>=400)return console.log("hls.js response error code: "+data.response.code),hls.destroy(),void(reject?(reject("servererror"),reject=null):onErrorInternal(instance,"servererror"))}if(data.fatal)switch(data.type){case Hls.ErrorTypes.NETWORK_ERROR:data.response&&0===data.response.code?(console.log("hls.js response error code: "+data.response.code),hls.destroy(),reject?(reject("network"),reject=null):onErrorInternal(instance,"network")):(console.log("fatal network error encountered, try to recover"),hls.startLoad());break;case Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover");var currentReject=reject;reject=null,handleHlsJsMediaError(instance,currentReject);break;default:console.log("Cannot recover from hls error - destroy and trigger error"),hls.destroy(),reject?(reject(),reject=null):onErrorInternal(instance,"mediadecodeerror")}})}function onEndedInternal(instance,elem,onErrorFn){elem.removeEventListener("error",onErrorFn),elem.src="",elem.innerHTML="",elem.removeAttribute("src"),destroyHlsPlayer(instance),destroyFlvPlayer(instance),destroyShakaPlayer(instance),destroyCastPlayer(instance),instance.originalDocumentTitle&&(document.title=instance.originalDocumentTitle,instance.originalDocumentTitle=null);var stopInfo={src:instance._currentSrc};events.trigger(instance,"stopped",[stopInfo]),instance._currentTime=null,instance._currentSrc=null,instance._currentPlayOptions=null}function getBufferedRanges(instance,elem){var offset,ranges=[],seekable=elem.buffered||[],currentPlayOptions=instance._currentPlayOptions;currentPlayOptions&&(offset=currentPlayOptions.transcodingOffsetTicks),offset=offset||0;for(var i=0,length=seekable.length;i"}).join("")}function getDefaultProfile(){return new Promise(function(resolve,reject){require(["browserdeviceprofile"],function(profileBuilder){resolve(profileBuilder({}))})})}function HtmlVideoPlayer(){function updateVideoUrl(streamInfo){var isHls=streamInfo.url.toLowerCase().indexOf(".m3u8")!==-1,mediaSource=streamInfo.mediaSource,item=streamInfo.item;if(mediaSource&&item&&!mediaSource.RunTimeTicks&&isHls&&"Transcode"===streamInfo.playMethod&&(browser.iOS||browser.osx)){var hlsPlaylistUrl=streamInfo.url.replace("master.m3u8","live.m3u8");return loading.show(),console.log("prefetching hls playlist: "+hlsPlaylistUrl),connectionManager.getApiClient(item.ServerId).ajax({type:"GET",url:hlsPlaylistUrl}).then(function(){return console.log("completed prefetching hls playlist: "+hlsPlaylistUrl),loading.hide(),streamInfo.url=hlsPlaylistUrl,Promise.resolve()},function(){return console.log("error prefetching hls playlist: "+hlsPlaylistUrl),loading.hide(),Promise.resolve()})}return Promise.resolve()}function setSrcWithFlvJs(instance,elem,options,url){return new Promise(function(resolve,reject){require(["flvjs"],function(flvjs){var flvPlayer=flvjs.createPlayer({type:"flv",url:url},{seekType:"range",lazyLoad:!1});flvPlayer.attachMediaElement(elem),flvPlayer.load(),flvPlayer.play().then(resolve,reject),instance._flvPlayer=flvPlayer,self._currentSrc=url})})}function setSrcWithHlsJs(instance,elem,options,url){return new Promise(function(resolve,reject){requireHlsPlayer(function(){var hls=new Hls({manifestLoadingTimeOut:2e4});hls.loadSource(url),hls.attachMedia(elem),htmlMediaHelper.bindEventsToHlsPlayer(self,hls,elem,onError,resolve,reject),self._hlsPlayer=hls,self._currentSrc=url})})}function setCurrentSrcChromecast(instance,elem,options,url){elem.autoplay=!0;var lrd=new cast.receiver.MediaManager.LoadRequestData;lrd.currentTime=(options.playerStartPositionTicks||0)/1e7,lrd.autoplay=!0,lrd.media=new cast.receiver.media.MediaInformation,lrd.media.contentId=url,lrd.media.contentType=options.mimeType,lrd.media.streamType=cast.receiver.media.StreamType.OTHER,lrd.media.customData=options,console.log("loading media url into mediaManager");try{return mediaManager.load(lrd),self._currentSrc=url,Promise.resolve()}catch(err){return console.log("mediaManager error: "+err),Promise.reject()}}function onMediaManagerLoadMedia(event){self._castPlayer&&self._castPlayer.unload(),self._castPlayer=null;var protocol,data=event.data,media=event.data.media||{},url=media.contentId,contentType=media.contentType.toLowerCase(),ext=(media.customData,"m3u8"),mediaElement=self._mediaElement,host=new cast.player.api.Host({url:url,mediaElement:mediaElement});"m3u8"===ext||"application/x-mpegurl"===contentType||"application/vnd.apple.mpegurl"===contentType?protocol=cast.player.api.CreateHlsStreamingProtocol(host):"mpd"===ext||"application/dash+xml"===contentType?protocol=cast.player.api.CreateDashStreamingProtocol(host):(url.indexOf(".ism")>-1||"application/vnd.ms-sstr+xml"===contentType)&&(protocol=cast.player.api.CreateSmoothStreamingProtocol(host)),console.log("loading playback url: "+url),console.log("contentType: "+contentType),host.onError=function(errorCode){console.log("Fatal Error - "+errorCode)},mediaElement.autoplay=!1,self._castPlayer=new cast.player.api.Player(host),self._castPlayer.load(protocol,data.currentTime||0),self._castPlayer.playWhenHaveEnoughData()}function initMediaManager(){mediaManager.defaultOnLoad=mediaManager.onLoad.bind(mediaManager),mediaManager.onLoad=onMediaManagerLoadMedia.bind(self),mediaManager.defaultOnStop=mediaManager.onStop.bind(mediaManager),mediaManager.onStop=function(event){playbackManager.stop(),mediaManager.defaultOnStop(event)}}function setCurrentSrc(elem,options){elem.removeEventListener("error",onError);var val=options.url;console.log("playing url: "+val);var seconds=(options.playerStartPositionTicks||0)/1e7;seconds&&(val+="#t="+seconds),htmlMediaHelper.destroyHlsPlayer(self),htmlMediaHelper.destroyFlvPlayer(self),htmlMediaHelper.destroyCastPlayer(self);var tracks=getMediaStreamTextTracks(options.mediaSource);subtitleTrackIndexToSetOnPlaying=null==options.mediaSource.DefaultSubtitleStreamIndex?-1:options.mediaSource.DefaultSubtitleStreamIndex,audioTrackIndexToSetOnPlaying="Transcode"===options.playMethod?null:options.mediaSource.DefaultAudioStreamIndex,self._currentPlayOptions=options;var crossOrigin=htmlMediaHelper.getCrossOriginValue(options.mediaSource);return crossOrigin&&(elem.crossOrigin=crossOrigin),browser.chromecast&&val.indexOf(".m3u8")!==-1&&options.mediaSource.RunTimeTicks?(setTracks(elem,tracks,options.item,options.mediaSource),setCurrentSrcChromecast(self,elem,options,val)):htmlMediaHelper.enableHlsJsPlayer(options.mediaSource.RunTimeTicks,"Video")&&val.indexOf(".m3u8")!==-1?(setTracks(elem,tracks,options.item,options.mediaSource),setSrcWithHlsJs(self,elem,options,val)):"Transcode"!==options.playMethod&&"flv"===options.mediaSource.Container?(setTracks(elem,tracks,options.item,options.mediaSource),setSrcWithFlvJs(self,elem,options,val)):(elem.autoplay=!0,htmlMediaHelper.applySrc(elem,val,options).then(function(){return setTracks(elem,tracks,options.item,options.mediaSource),self._currentSrc=val,htmlMediaHelper.playWithPromise(elem,onError)}))}function onEnded(){destroyCustomTrack(this),htmlMediaHelper.onEndedInternal(self,this,onError)}function onTimeUpdate(e){var time=this.currentTime;time&&!self._timeUpdated&&(self._timeUpdated=!0,ensureValidVideo(this)),self._currentTime=time;var currentPlayOptions=self._currentPlayOptions;if(currentPlayOptions){var timeMs=1e3*time;timeMs+=(currentPlayOptions.transcodingOffsetTicks||0)/1e4,updateSubtitleText(timeMs)}events.trigger(self,"timeupdate")}function onVolumeChange(){htmlMediaHelper.saveVolume(this.volume),events.trigger(self,"volumechange")}function onNavigatedToOsd(){var dlg=videoDialog;dlg&&(dlg.classList.remove("videoPlayerContainer-withBackdrop"),dlg.classList.remove("videoPlayerContainer-onTop"),onStartedAndNavigatedToOsd())}function onStartedAndNavigatedToOsd(){setCurrentTrackElement(subtitleTrackIndexToSetOnPlaying),null!=audioTrackIndexToSetOnPlaying&&self.canSetAudioStreamIndex()&&self.setAudioStreamIndex(audioTrackIndexToSetOnPlaying)}function onPlaying(e){self._started||(self._started=!0,this.removeAttribute("controls"),self._currentPlayOptions.title?(self.originalDocumentTitle=document.title,document.title=self._currentPlayOptions.title):self.originalDocumentTitle=null,loading.hide(),htmlMediaHelper.seekOnPlaybackStart(self,e.target,self._currentPlayOptions.playerStartPositionTicks),self._currentPlayOptions.fullscreen?appRouter.showVideoOsd().then(onNavigatedToOsd):(appRouter.setTransparency("backdrop"),videoDialog.classList.remove("videoPlayerContainer-withBackdrop"),videoDialog.classList.remove("videoPlayerContainer-onTop"),onStartedAndNavigatedToOsd())),events.trigger(self,"playing")}function onPlay(e){events.trigger(self,"unpause")}function ensureValidVideo(elem){if(elem===self._mediaElement&&0===elem.videoWidth&&0===elem.videoHeight){var mediaSource=(self._currentPlayOptions||{}).mediaSource;if(!mediaSource||mediaSource.RunTimeTicks)return void htmlMediaHelper.onErrorInternal(self,"mediadecodeerror")}}function onClick(){events.trigger(self,"click")}function onDblClick(){events.trigger(self,"dblclick")}function onPause(){events.trigger(self,"pause")}function onError(){var errorCode=this.error?this.error.code||0:0,errorMessage=this.error?this.error.message||"":"";console.log("Media element error: "+errorCode.toString()+" "+errorMessage);var type;switch(errorCode){case 1:return;case 2:type="network";break;case 3:if(self._hlsPlayer)return void htmlMediaHelper.handleHlsJsMediaError(self);type="mediadecodeerror";break;case 4:type="medianotsupported";break;default:return}htmlMediaHelper.onErrorInternal(self,type)}function destroyCustomTrack(videoElement){if(self._resizeObserver&&(self._resizeObserver.disconnect(),self._resizeObserver=null),window.removeEventListener("orientationchange",onVideoResize),videoSubtitlesElem){var subtitlesContainer=videoSubtitlesElem.parentNode;subtitlesContainer&&tryRemoveElement(subtitlesContainer),videoSubtitlesElem=null}if(currentTrackEvents=null,videoElement)for(var allTracks=videoElement.textTracks||[],i=0;i
',videoSubtitlesElem=subtitlesContainer.querySelector(".videoSubtitlesInner"),setSubtitleAppearance(subtitlesContainer,videoSubtitlesElem),videoElement.parentNode.appendChild(subtitlesContainer),currentTrackEvents=data.TrackEvents}})}function setSubtitleAppearance(elem,innerElem){require(["userSettings","subtitleAppearanceHelper"],function(userSettings,subtitleAppearanceHelper){subtitleAppearanceHelper.applyStyles({text:innerElem,window:elem},userSettings.getSubtitleAppearanceSettings())})}function getCueCss(appearance,selector){var html=selector+"::cue {";return html+=appearance.text.map(function(s){return s.name+":"+s.value+"!important;"}).join(""),html+="}"}function setCueAppearance(){require(["userSettings","subtitleAppearanceHelper"],function(userSettings,subtitleAppearanceHelper){var elementId=self.id+"-cuestyle",styleElem=document.querySelector("#"+elementId);styleElem||(styleElem=document.createElement("style"),styleElem.id=elementId,styleElem.type="text/css",document.getElementsByTagName("head")[0].appendChild(styleElem)),styleElem.innerHTML=getCueCss(subtitleAppearanceHelper.getStyles(userSettings.getSubtitleAppearanceSettings(),!0),".htmlvideoplayer")})}function renderTracksEvents(videoElement,track,item){if(!itemHelper.isLocalItem(item)||track.IsExternal){var format=(track.Codec||"").toLowerCase();if("ssa"===format||"ass"===format)return void renderWithLibjass(videoElement,track,item);if(requiresCustomSubtitlesElement())return void renderSubtitlesWithCustomElement(videoElement,track,item)}for(var trackElement=null,expectedId="manualTrack"+track.Index,allTracks=videoElement.textTracks,i=0;i=ticks){selectedTrackEvent=currentTrackEvent;break}}selectedTrackEvent&&selectedTrackEvent.Text?(subtitleTextElement.innerHTML=normalizeTrackEventText(selectedTrackEvent.Text),subtitleTextElement.classList.remove("hide")):subtitleTextElement.classList.add("hide")}}}function setCurrentTrackElement(streamIndex){console.log("Setting new text track index to: "+streamIndex);var mediaStreamTextTracks=getMediaStreamTextTracks(self._currentPlayOptions.mediaSource),track=streamIndex===-1?null:mediaStreamTextTracks.filter(function(t){return t.Index===streamIndex})[0];enableNativeTrackSupport(self._currentSrc,track)?(setTrackForCustomDisplay(self._mediaElement,null),streamIndex!==-1&&setCueAppearance()):(setTrackForCustomDisplay(self._mediaElement,track),streamIndex=-1,track=null);for(var expectedId="textTrack"+streamIndex,trackIndex=streamIndex!==-1&&track?mediaStreamTextTracks.indexOf(track):-1,modes=["disabled","showing","hidden"],allTracks=self._mediaElement.textTracks,i=0;i':'",dlg.innerHTML=html;var videoElement=dlg.querySelector("video");videoElement.volume=htmlMediaHelper.getSavedVolume(),videoElement.addEventListener("timeupdate",onTimeUpdate),videoElement.addEventListener("ended",onEnded),videoElement.addEventListener("volumechange",onVolumeChange),videoElement.addEventListener("pause",onPause),videoElement.addEventListener("playing",onPlaying),videoElement.addEventListener("play",onPlay),videoElement.addEventListener("click",onClick),videoElement.addEventListener("dblclick",onDblClick),document.body.insertBefore(dlg,document.body.firstChild),videoDialog=dlg,self._mediaElement=videoElement,mediaManager&&(mediaManager.embyInit||(initMediaManager(),mediaManager.embyInit=!0),mediaManager.setMediaElement(videoElement)),options.fullscreen&&browser.supportsCssAnimation()&&!browser.slow?zoomIn(dlg).then(function(){resolve(videoElement)}):resolve(videoElement)})})}browser.edgeUwp?this.name="Windows Video Player":this.name="Html Video Player",this.type="mediaplayer",this.id="htmlvideoplayer",this.priority=1;var videoDialog,subtitleTrackIndexToSetOnPlaying,audioTrackIndexToSetOnPlaying,currentClock,currentAssRenderer,videoSubtitlesElem,currentTrackEvents,lastCustomTrackMs=0,customTrackIndex=-1,self=this;self.currentSrc=function(){return self._currentSrc},self.play=function(options){return browser.msie&&"Transcode"===options.playMethod&&!window.MediaSource?(alert("Playback of this content is not supported in Internet Explorer. For a better experience, try a modern browser such as Microsoft Edge, Google Chrome, Firefox or Opera."),Promise.reject()):(self._started=!1,self._timeUpdated=!1,self._currentTime=null,createMediaElement(options).then(function(elem){return updateVideoUrl(options,options.mediaSource).then(function(){return setCurrentSrc(elem,options)})}))},self.setSubtitleStreamIndex=function(index){setCurrentTrackElement(index)},self.setAudioStreamIndex=function(index){var i,length,audioStreams=getMediaStreamAudioTracks(self._currentPlayOptions.mediaSource),audioTrackOffset=-1;for(i=0,length=audioStreams.length;i=100?"none":rawValue/100;elem.style["-webkit-filter"]="brightness("+cssValue+");",elem.style.filter="brightness("+cssValue+")",elem.brightnessValue=val,events.trigger(this,"brightnesschange")}},HtmlVideoPlayer.prototype.getBrightness=function(){var elem=this._mediaElement;if(elem){var val=elem.brightnessValue;return null==val?100:val}},HtmlVideoPlayer.prototype.seekable=function(){var mediaElement=this._mediaElement;if(mediaElement){var seekable=mediaElement.seekable;if(seekable&&seekable.length){var start=seekable.start(0),end=seekable.end(0);return htmlMediaHelper.isValidDuration(start)||(start=0),htmlMediaHelper.isValidDuration(end)||(end=0),end-start>0}return!1}},HtmlVideoPlayer.prototype.pause=function(){var mediaElement=this._mediaElement;mediaElement&&mediaElement.pause()},HtmlVideoPlayer.prototype.resume=function(){var mediaElement=this._mediaElement;mediaElement&&mediaElement.play()},HtmlVideoPlayer.prototype.unpause=function(){var mediaElement=this._mediaElement;mediaElement&&mediaElement.play()},HtmlVideoPlayer.prototype.paused=function(){var mediaElement=this._mediaElement;return!!mediaElement&&mediaElement.paused},HtmlVideoPlayer.prototype.setVolume=function(val){var mediaElement=this._mediaElement;mediaElement&&(mediaElement.volume=val/100)},HtmlVideoPlayer.prototype.getVolume=function(){var mediaElement=this._mediaElement;if(mediaElement)return Math.min(Math.round(100*mediaElement.volume),100)},HtmlVideoPlayer.prototype.volumeUp=function(){this.setVolume(Math.min(this.getVolume()+2,100))},HtmlVideoPlayer.prototype.volumeDown=function(){this.setVolume(Math.max(this.getVolume()-2,0))},HtmlVideoPlayer.prototype.setMute=function(mute){var mediaElement=this._mediaElement;mediaElement&&(mediaElement.muted=mute)},HtmlVideoPlayer.prototype.isMuted=function(){var mediaElement=this._mediaElement;return!!mediaElement&&mediaElement.muted},HtmlVideoPlayer.prototype.setAspectRatio=function(val){},HtmlVideoPlayer.prototype.getAspectRatio=function(){return this._currentAspectRatio},HtmlVideoPlayer.prototype.getSupportedAspectRatios=function(){return[]},HtmlVideoPlayer.prototype.togglePictureInPicture=function(){return this.setPictureInPictureEnabled(!this.isPictureInPictureEnabled())},HtmlVideoPlayer.prototype.getBufferedRanges=function(){var mediaElement=this._mediaElement;return mediaElement?htmlMediaHelper.getBufferedRanges(this,mediaElement):[]},HtmlVideoPlayer.prototype.getStats=function(){var mediaElement=this._mediaElement,playOptions=this._currentPlayOptions||[],categories=[];if(!mediaElement)return Promise.resolve({categories:categories});var mediaCategory={stats:[],type:"media"};if(categories.push(mediaCategory),playOptions.url){var link=document.createElement("a");link.setAttribute("href",playOptions.url);var protocol=(link.protocol||"").replace(":","");protocol&&mediaCategory.stats.push({label:"Protocol:",value:protocol}),link=null}this._hlsPlayer||this._shakaPlayer?mediaCategory.stats.push({label:"Stream type:",value:"HLS"}):mediaCategory.stats.push({label:"Stream type:",value:"Video"});var videoCategory={stats:[],type:"video"};categories.push(videoCategory);var rect=mediaElement.getBoundingClientRect?mediaElement.getBoundingClientRect():{},height=rect.height,width=rect.width;if(width&&height&&videoCategory.stats.push({label:"Player dimensions:",value:width+"x"+height}),height=mediaElement.videoHeight,width=mediaElement.videoWidth,width&&height&&videoCategory.stats.push({label:"Video resolution:",value:width+"x"+height}),mediaElement.getVideoPlaybackQuality){var playbackQuality=mediaElement.getVideoPlaybackQuality(),droppedVideoFrames=playbackQuality.droppedVideoFrames||0;videoCategory.stats.push({label:"Dropped frames:",value:droppedVideoFrames});var corruptedVideoFrames=playbackQuality.corruptedVideoFrames||0;videoCategory.stats.push({label:"Corrupted frames:",value:corruptedVideoFrames})}var audioCategory={stats:[],type:"audio"};categories.push(audioCategory);var sinkId=mediaElement.sinkId;return sinkId&&audioCategory.stats.push({label:"Sink Id:",value:sinkId}),Promise.resolve({categories:categories})},browser.chromecast&&(mediaManager=new cast.receiver.MediaManager(document.createElement("video"))),HtmlVideoPlayer}); \ No newline at end of file +define(["browser","require","events","apphost","loading","dom","playbackManager","appRouter","appSettings","connectionManager","htmlMediaHelper","itemHelper"],function(browser,require,events,appHost,loading,dom,playbackManager,appRouter,appSettings,connectionManager,htmlMediaHelper,itemHelper){"use strict";function tryRemoveElement(elem){var parentNode=elem.parentNode;if(parentNode)try{parentNode.removeChild(elem)}catch(err){console.log("Error removing dialog element: "+err)}}function enableNativeTrackSupport(currentSrc,track){if(track&&"Embed"===track.DeliveryMethod)return!0;if(browser.firefox&&-1!==(currentSrc||"").toLowerCase().indexOf(".m3u8"))return!1;if(browser.chromecast&&-1!==(currentSrc||"").toLowerCase().indexOf(".m3u8"))return!1;if(browser.ps4)return!1;if(browser.web0s)return!1;if(browser.edge)return!1;if(browser.iOS&&(browser.iosVersion||10)<10)return!1;if(track){var format=(track.Codec||"").toLowerCase();if("ssa"===format||"ass"===format)return!1}return!0}function requireHlsPlayer(callback){require(["hlsjs"],function(hls){window.Hls=hls,callback()})}function getMediaStreamAudioTracks(mediaSource){return mediaSource.MediaStreams.filter(function(s){return"Audio"===s.Type})}function getMediaStreamTextTracks(mediaSource){return mediaSource.MediaStreams.filter(function(s){return"Subtitle"===s.Type})}function zoomIn(elem){return new Promise(function(resolve,reject){elem.style.animation="htmlvideoplayer-zoomin 240ms ease-in normal",dom.addEventListener(elem,dom.whichAnimationEvent(),resolve,{once:!0})})}function normalizeTrackEventText(text){return text.replace(/\\N/gi,"\n")}function setTracks(elem,tracks,item,mediaSource){elem.innerHTML=getTracksHtml(tracks,item,mediaSource)}function getTextTrackUrl(track,item,format){if(itemHelper.isLocalItem(item)&&track.Path)return track.Path;var url=playbackManager.getSubtitleUrl(track,item.ServerId);return format&&(url=url.replace(".vtt",format)),url}function getTracksHtml(tracks,item,mediaSource){return tracks.map(function(t){if("External"!==t.DeliveryMethod)return"";var defaultAttribute=mediaSource.DefaultSubtitleStreamIndex===t.Index?" default":"",language=t.Language||"und",label=t.Language||"und";return'"}).join("")}function getDefaultProfile(){return new Promise(function(resolve,reject){require(["browserdeviceprofile"],function(profileBuilder){resolve(profileBuilder({}))})})}function HtmlVideoPlayer(){function updateVideoUrl(streamInfo){var isHls=-1!==streamInfo.url.toLowerCase().indexOf(".m3u8"),mediaSource=streamInfo.mediaSource,item=streamInfo.item;if(mediaSource&&item&&!mediaSource.RunTimeTicks&&isHls&&"Transcode"===streamInfo.playMethod&&(browser.iOS||browser.osx)){var hlsPlaylistUrl=streamInfo.url.replace("master.m3u8","live.m3u8");return loading.show(),console.log("prefetching hls playlist: "+hlsPlaylistUrl),connectionManager.getApiClient(item.ServerId).ajax({type:"GET",url:hlsPlaylistUrl}).then(function(){return console.log("completed prefetching hls playlist: "+hlsPlaylistUrl),loading.hide(),streamInfo.url=hlsPlaylistUrl,Promise.resolve()},function(){return console.log("error prefetching hls playlist: "+hlsPlaylistUrl),loading.hide(),Promise.resolve()})}return Promise.resolve()}function setSrcWithFlvJs(instance,elem,options,url){return new Promise(function(resolve,reject){require(["flvjs"],function(flvjs){var flvPlayer=flvjs.createPlayer({type:"flv",url:url},{seekType:"range",lazyLoad:!1});flvPlayer.attachMediaElement(elem),flvPlayer.load(),flvPlayer.play().then(resolve,reject),instance._flvPlayer=flvPlayer,self._currentSrc=url})})}function setSrcWithHlsJs(instance,elem,options,url){return new Promise(function(resolve,reject){requireHlsPlayer(function(){var hls=new Hls({manifestLoadingTimeOut:2e4});hls.loadSource(url),hls.attachMedia(elem),htmlMediaHelper.bindEventsToHlsPlayer(self,hls,elem,onError,resolve,reject),self._hlsPlayer=hls,self._currentSrc=url})})}function setCurrentSrcChromecast(instance,elem,options,url){elem.autoplay=!0;var lrd=new cast.receiver.MediaManager.LoadRequestData;lrd.currentTime=(options.playerStartPositionTicks||0)/1e7,lrd.autoplay=!0,lrd.media=new cast.receiver.media.MediaInformation,lrd.media.contentId=url,lrd.media.contentType=options.mimeType,lrd.media.streamType=cast.receiver.media.StreamType.OTHER,lrd.media.customData=options,console.log("loading media url into mediaManager");try{return mediaManager.load(lrd),self._currentSrc=url,Promise.resolve()}catch(err){return console.log("mediaManager error: "+err),Promise.reject()}}function onMediaManagerLoadMedia(event){self._castPlayer&&self._castPlayer.unload(),self._castPlayer=null;var protocol,data=event.data,media=event.data.media||{},url=media.contentId,contentType=media.contentType.toLowerCase(),mediaElement=(media.customData,self._mediaElement),host=new cast.player.api.Host({url:url,mediaElement:mediaElement});protocol=cast.player.api.CreateHlsStreamingProtocol(host),console.log("loading playback url: "+url),console.log("contentType: "+contentType),host.onError=function(errorCode){console.log("Fatal Error - "+errorCode)},mediaElement.autoplay=!1,self._castPlayer=new cast.player.api.Player(host),self._castPlayer.load(protocol,data.currentTime||0),self._castPlayer.playWhenHaveEnoughData()}function initMediaManager(){mediaManager.defaultOnLoad=mediaManager.onLoad.bind(mediaManager),mediaManager.onLoad=onMediaManagerLoadMedia.bind(self),mediaManager.defaultOnStop=mediaManager.onStop.bind(mediaManager),mediaManager.onStop=function(event){playbackManager.stop(),mediaManager.defaultOnStop(event)}}function setCurrentSrc(elem,options){elem.removeEventListener("error",onError);var val=options.url;console.log("playing url: "+val);var seconds=(options.playerStartPositionTicks||0)/1e7;seconds&&(val+="#t="+seconds),htmlMediaHelper.destroyHlsPlayer(self),htmlMediaHelper.destroyFlvPlayer(self),htmlMediaHelper.destroyCastPlayer(self);var tracks=getMediaStreamTextTracks(options.mediaSource);subtitleTrackIndexToSetOnPlaying=null==options.mediaSource.DefaultSubtitleStreamIndex?-1:options.mediaSource.DefaultSubtitleStreamIndex,audioTrackIndexToSetOnPlaying="Transcode"===options.playMethod?null:options.mediaSource.DefaultAudioStreamIndex,self._currentPlayOptions=options;var crossOrigin=htmlMediaHelper.getCrossOriginValue(options.mediaSource);return crossOrigin&&(elem.crossOrigin=crossOrigin),browser.chromecast&&-1!==val.indexOf(".m3u8")&&options.mediaSource.RunTimeTicks?(setTracks(elem,tracks,options.item,options.mediaSource),setCurrentSrcChromecast(self,elem,options,val)):htmlMediaHelper.enableHlsJsPlayer(options.mediaSource.RunTimeTicks,"Video")&&-1!==val.indexOf(".m3u8")?(setTracks(elem,tracks,options.item,options.mediaSource),setSrcWithHlsJs(self,elem,options,val)):"Transcode"!==options.playMethod&&"flv"===options.mediaSource.Container?(setTracks(elem,tracks,options.item,options.mediaSource),setSrcWithFlvJs(self,elem,options,val)):(elem.autoplay=!0,htmlMediaHelper.applySrc(elem,val,options).then(function(){return setTracks(elem,tracks,options.item,options.mediaSource),self._currentSrc=val,htmlMediaHelper.playWithPromise(elem,onError)}))}function onEnded(){destroyCustomTrack(this),htmlMediaHelper.onEndedInternal(self,this,onError)}function onTimeUpdate(e){var time=this.currentTime;time&&!self._timeUpdated&&(self._timeUpdated=!0,ensureValidVideo(this)),self._currentTime=time;var currentPlayOptions=self._currentPlayOptions;if(currentPlayOptions){var timeMs=1e3*time;timeMs+=(currentPlayOptions.transcodingOffsetTicks||0)/1e4,updateSubtitleText(timeMs)}events.trigger(self,"timeupdate")}function onVolumeChange(){htmlMediaHelper.saveVolume(this.volume),events.trigger(self,"volumechange")}function onNavigatedToOsd(){var dlg=videoDialog;dlg&&(dlg.classList.remove("videoPlayerContainer-withBackdrop"),dlg.classList.remove("videoPlayerContainer-onTop"),onStartedAndNavigatedToOsd())}function onStartedAndNavigatedToOsd(){setCurrentTrackElement(subtitleTrackIndexToSetOnPlaying),null!=audioTrackIndexToSetOnPlaying&&self.canSetAudioStreamIndex()&&self.setAudioStreamIndex(audioTrackIndexToSetOnPlaying)}function onPlaying(e){self._started||(self._started=!0,this.removeAttribute("controls"),self._currentPlayOptions.title?(self.originalDocumentTitle=document.title,document.title=self._currentPlayOptions.title):self.originalDocumentTitle=null,loading.hide(),htmlMediaHelper.seekOnPlaybackStart(self,e.target,self._currentPlayOptions.playerStartPositionTicks),self._currentPlayOptions.fullscreen?appRouter.showVideoOsd().then(onNavigatedToOsd):(appRouter.setTransparency("backdrop"),videoDialog.classList.remove("videoPlayerContainer-withBackdrop"),videoDialog.classList.remove("videoPlayerContainer-onTop"),onStartedAndNavigatedToOsd())),events.trigger(self,"playing")}function onPlay(e){events.trigger(self,"unpause")}function ensureValidVideo(elem){if(elem===self._mediaElement&&0===elem.videoWidth&&0===elem.videoHeight){var mediaSource=(self._currentPlayOptions||{}).mediaSource;if(!mediaSource||mediaSource.RunTimeTicks)return void htmlMediaHelper.onErrorInternal(self,"mediadecodeerror")}}function onClick(){events.trigger(self,"click")}function onDblClick(){events.trigger(self,"dblclick")}function onPause(){events.trigger(self,"pause")}function onError(){var errorCode=this.error?this.error.code||0:0,errorMessage=this.error?this.error.message||"":"";console.log("Media element error: "+errorCode.toString()+" "+errorMessage);var type;switch(errorCode){case 1:return;case 2:type="network";break;case 3:if(self._hlsPlayer)return void htmlMediaHelper.handleHlsJsMediaError(self);type="mediadecodeerror";break;case 4:type="medianotsupported";break;default:return}htmlMediaHelper.onErrorInternal(self,type)}function destroyCustomTrack(videoElement){if(self._resizeObserver&&(self._resizeObserver.disconnect(),self._resizeObserver=null),window.removeEventListener("orientationchange",onVideoResize),videoSubtitlesElem){var subtitlesContainer=videoSubtitlesElem.parentNode;subtitlesContainer&&tryRemoveElement(subtitlesContainer),videoSubtitlesElem=null}if(currentTrackEvents=null,videoElement)for(var allTracks=videoElement.textTracks||[],i=0;i
',videoSubtitlesElem=subtitlesContainer.querySelector(".videoSubtitlesInner"),setSubtitleAppearance(subtitlesContainer,videoSubtitlesElem),videoElement.parentNode.appendChild(subtitlesContainer),currentTrackEvents=data.TrackEvents}})}function setSubtitleAppearance(elem,innerElem){require(["userSettings","subtitleAppearanceHelper"],function(userSettings,subtitleAppearanceHelper){subtitleAppearanceHelper.applyStyles({text:innerElem,window:elem},userSettings.getSubtitleAppearanceSettings())})}function getCueCss(appearance,selector){var html=selector+"::cue {";return html+=appearance.text.map(function(s){return s.name+":"+s.value+"!important;"}).join(""),html+="}"}function setCueAppearance(){require(["userSettings","subtitleAppearanceHelper"],function(userSettings,subtitleAppearanceHelper){var elementId=self.id+"-cuestyle",styleElem=document.querySelector("#"+elementId);styleElem||(styleElem=document.createElement("style"),styleElem.id=elementId,styleElem.type="text/css",document.getElementsByTagName("head")[0].appendChild(styleElem)),styleElem.innerHTML=getCueCss(subtitleAppearanceHelper.getStyles(userSettings.getSubtitleAppearanceSettings(),!0),".htmlvideoplayer")})}function renderTracksEvents(videoElement,track,item){if(!itemHelper.isLocalItem(item)||track.IsExternal){var format=(track.Codec||"").toLowerCase();if("ssa"===format||"ass"===format)return void renderWithLibjass(videoElement,track,item);if(requiresCustomSubtitlesElement())return void renderSubtitlesWithCustomElement(videoElement,track,item)}for(var trackElement=null,expectedId="manualTrack"+track.Index,allTracks=videoElement.textTracks,i=0;i=ticks){selectedTrackEvent=currentTrackEvent;break}}selectedTrackEvent&&selectedTrackEvent.Text?(subtitleTextElement.innerHTML=normalizeTrackEventText(selectedTrackEvent.Text),subtitleTextElement.classList.remove("hide")):subtitleTextElement.classList.add("hide")}}}function setCurrentTrackElement(streamIndex){console.log("Setting new text track index to: "+streamIndex);var mediaStreamTextTracks=getMediaStreamTextTracks(self._currentPlayOptions.mediaSource),track=-1===streamIndex?null:mediaStreamTextTracks.filter(function(t){return t.Index===streamIndex})[0];enableNativeTrackSupport(self._currentSrc,track)?(setTrackForCustomDisplay(self._mediaElement,null),-1!==streamIndex&&setCueAppearance()):(setTrackForCustomDisplay(self._mediaElement,track),streamIndex=-1,track=null);for(var expectedId="textTrack"+streamIndex,trackIndex=-1!==streamIndex&&track?mediaStreamTextTracks.indexOf(track):-1,modes=["disabled","showing","hidden"],allTracks=self._mediaElement.textTracks,i=0;i':html+='",dlg.innerHTML=html;var videoElement=dlg.querySelector("video");videoElement.volume=htmlMediaHelper.getSavedVolume(),videoElement.addEventListener("timeupdate",onTimeUpdate),videoElement.addEventListener("ended",onEnded),videoElement.addEventListener("volumechange",onVolumeChange),videoElement.addEventListener("pause",onPause),videoElement.addEventListener("playing",onPlaying),videoElement.addEventListener("play",onPlay),videoElement.addEventListener("click",onClick),videoElement.addEventListener("dblclick",onDblClick),document.body.insertBefore(dlg,document.body.firstChild),videoDialog=dlg,self._mediaElement=videoElement,mediaManager&&(mediaManager.embyInit||(initMediaManager(),mediaManager.embyInit=!0),mediaManager.setMediaElement(videoElement)),options.fullscreen&&browser.supportsCssAnimation()&&!browser.slow?zoomIn(dlg).then(function(){resolve(videoElement)}):resolve(videoElement)})})}browser.edgeUwp?this.name="Windows Video Player":this.name="Html Video Player",this.type="mediaplayer",this.id="htmlvideoplayer",this.priority=1;var videoDialog,subtitleTrackIndexToSetOnPlaying,audioTrackIndexToSetOnPlaying,currentClock,currentAssRenderer,videoSubtitlesElem,currentTrackEvents,lastCustomTrackMs=0,customTrackIndex=-1,self=this;self.currentSrc=function(){return self._currentSrc},self.play=function(options){return browser.msie&&"Transcode"===options.playMethod&&!window.MediaSource?(alert("Playback of this content is not supported in Internet Explorer. For a better experience, try a modern browser such as Microsoft Edge, Google Chrome, Firefox or Opera."),Promise.reject()):(self._started=!1,self._timeUpdated=!1,self._currentTime=null,createMediaElement(options).then(function(elem){return updateVideoUrl(options,options.mediaSource).then(function(){return setCurrentSrc(elem,options)})}))},self.setSubtitleStreamIndex=function(index){setCurrentTrackElement(index)},self.setAudioStreamIndex=function(index){var i,length,audioStreams=getMediaStreamAudioTracks(self._currentPlayOptions.mediaSource),audioTrackOffset=-1;for(i=0,length=audioStreams.length;i=100?"none":rawValue/100;elem.style["-webkit-filter"]="brightness("+cssValue+");",elem.style.filter="brightness("+cssValue+")",elem.brightnessValue=val,events.trigger(this,"brightnesschange")}},HtmlVideoPlayer.prototype.getBrightness=function(){var elem=this._mediaElement;if(elem){var val=elem.brightnessValue;return null==val?100:val}},HtmlVideoPlayer.prototype.seekable=function(){var mediaElement=this._mediaElement;if(mediaElement){var seekable=mediaElement.seekable;if(seekable&&seekable.length){var start=seekable.start(0),end=seekable.end(0);return htmlMediaHelper.isValidDuration(start)||(start=0),htmlMediaHelper.isValidDuration(end)||(end=0),end-start>0}return!1}},HtmlVideoPlayer.prototype.pause=function(){var mediaElement=this._mediaElement;mediaElement&&mediaElement.pause()},HtmlVideoPlayer.prototype.resume=function(){var mediaElement=this._mediaElement;mediaElement&&mediaElement.play()},HtmlVideoPlayer.prototype.unpause=function(){var mediaElement=this._mediaElement;mediaElement&&mediaElement.play()},HtmlVideoPlayer.prototype.paused=function(){var mediaElement=this._mediaElement;return!!mediaElement&&mediaElement.paused},HtmlVideoPlayer.prototype.setVolume=function(val){var mediaElement=this._mediaElement;mediaElement&&(mediaElement.volume=val/100)},HtmlVideoPlayer.prototype.getVolume=function(){var mediaElement=this._mediaElement;if(mediaElement)return Math.min(Math.round(100*mediaElement.volume),100)},HtmlVideoPlayer.prototype.volumeUp=function(){this.setVolume(Math.min(this.getVolume()+2,100))},HtmlVideoPlayer.prototype.volumeDown=function(){this.setVolume(Math.max(this.getVolume()-2,0))},HtmlVideoPlayer.prototype.setMute=function(mute){var mediaElement=this._mediaElement;mediaElement&&(mediaElement.muted=mute)},HtmlVideoPlayer.prototype.isMuted=function(){var mediaElement=this._mediaElement;return!!mediaElement&&mediaElement.muted},HtmlVideoPlayer.prototype.setAspectRatio=function(val){},HtmlVideoPlayer.prototype.getAspectRatio=function(){return this._currentAspectRatio},HtmlVideoPlayer.prototype.getSupportedAspectRatios=function(){return[]},HtmlVideoPlayer.prototype.togglePictureInPicture=function(){return this.setPictureInPictureEnabled(!this.isPictureInPictureEnabled())},HtmlVideoPlayer.prototype.getBufferedRanges=function(){var mediaElement=this._mediaElement;return mediaElement?htmlMediaHelper.getBufferedRanges(this,mediaElement):[]},HtmlVideoPlayer.prototype.getStats=function(){var mediaElement=this._mediaElement,playOptions=this._currentPlayOptions||[],categories=[];if(!mediaElement)return Promise.resolve({categories:categories});var mediaCategory={stats:[],type:"media"};if(categories.push(mediaCategory),playOptions.url){var link=document.createElement("a");link.setAttribute("href",playOptions.url);var protocol=(link.protocol||"").replace(":","");protocol&&mediaCategory.stats.push({label:"Protocol:",value:protocol}),link=null}this._hlsPlayer||this._shakaPlayer?mediaCategory.stats.push({label:"Stream type:",value:"HLS"}):mediaCategory.stats.push({label:"Stream type:",value:"Video"});var videoCategory={stats:[],type:"video"};categories.push(videoCategory);var rect=mediaElement.getBoundingClientRect?mediaElement.getBoundingClientRect():{},height=rect.height,width=rect.width;if(width&&height&&videoCategory.stats.push({label:"Player dimensions:",value:width+"x"+height}),height=mediaElement.videoHeight,width=mediaElement.videoWidth,width&&height&&videoCategory.stats.push({label:"Video resolution:",value:width+"x"+height}),mediaElement.getVideoPlaybackQuality){var playbackQuality=mediaElement.getVideoPlaybackQuality(),droppedVideoFrames=playbackQuality.droppedVideoFrames||0;videoCategory.stats.push({label:"Dropped frames:",value:droppedVideoFrames});var corruptedVideoFrames=playbackQuality.corruptedVideoFrames||0;videoCategory.stats.push({label:"Corrupted frames:",value:corruptedVideoFrames})}var audioCategory={stats:[],type:"audio"};categories.push(audioCategory);var sinkId=mediaElement.sinkId;return sinkId&&audioCategory.stats.push({label:"Sink Id:",value:sinkId}),Promise.resolve({categories:categories})},browser.chromecast&&(mediaManager=new cast.receiver.MediaManager(document.createElement("video"))),HtmlVideoPlayer}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/imagedownloader/imagedownloader.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/imagedownloader/imagedownloader.js index 34fedc5923..7b97f230f9 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/imagedownloader/imagedownloader.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/imagedownloader/imagedownloader.js @@ -1 +1 @@ -define(["loading","apphost","dialogHelper","connectionManager","imageLoader","browser","layoutManager","scrollHelper","globalize","require","emby-checkbox","emby-button","paper-icon-button-light","emby-linkbutton","formDialogStyle","cardStyle"],function(loading,appHost,dialogHelper,connectionManager,imageLoader,browser,layoutManager,scrollHelper,globalize,require){"use strict";function getBaseRemoteOptions(){var options={};return options.itemId=currentItemId,options}function reloadBrowsableImages(page,apiClient){loading.show();var options=getBaseRemoteOptions();options.type=browsableImageType,options.startIndex=browsableImageStartIndex,options.limit=browsableImagePageSize,options.IncludeAllLanguages=page.querySelector("#chkAllLanguages").checked;var provider=selectedProvider||"";provider&&(options.ProviderName=provider),apiClient.getAvailableRemoteImages(options).then(function(result){renderRemoteImages(page,apiClient,result,browsableImageType,options.startIndex,options.limit),page.querySelector("#selectBrowsableImageType").value=browsableImageType;var providersHtml=result.Providers.map(function(p){return'"}),selectImageProvider=page.querySelector("#selectImageProvider");selectImageProvider.innerHTML='"+providersHtml,selectImageProvider.value=provider,loading.hide()})}function renderRemoteImages(page,apiClient,imagesResult,imageType,startIndex,limit){page.querySelector(".availableImagesPaging").innerHTML=getPagingHtml(startIndex,limit,imagesResult.TotalRecordCount);for(var html="",i=0,length=imagesResult.Images.length;ilimit;html+='
',html+='';var startAtDisplay=totalRecordCount?startIndex+1:0;return html+=startAtDisplay+"-"+recordsEnd+" of "+totalRecordCount,html+="",showControls&&(html+='
',html+='',html+='',html+="
"),html+="
"}function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function downloadRemoteImage(page,apiClient,url,type,provider){var options=getBaseRemoteOptions();options.Type=type,options.ImageUrl=url,options.ProviderName=provider,loading.show(),apiClient.downloadRemoteImage(options).then(function(){hasChanges=!0;var dlg=parentWithClass(page,"dialog");dialogHelper.close(dlg)})}function getDisplayUrl(url,apiClient){return apiClient.getUrl("Images/Remote",{imageUrl:url})}function getRemoteImageHtml(image,imageType,apiClient){var tagName=layoutManager.tv?"button":"div",enableFooterButtons=!layoutManager.tv,html="",cssClass="card scalableCard imageEditorCard",cardBoxCssClass="cardBox visualCardBox",shape="backdrop";return shape="Backdrop"===imageType||"Art"===imageType||"Thumb"===imageType||"Logo"===imageType?"backdrop":"Banner"===imageType?"banner":"Disc"===imageType?"square":"Episode"===currentItemType?"backdrop":"MusicAlbum"===currentItemType||"MusicArtist"===currentItemType?"square":"portrait",cssClass+=" "+shape+"Card "+shape+"Card-scalable","button"===tagName?(cssClass+=" btnImageCard",layoutManager.tv&&!browser.slow&&(cardBoxCssClass+=" cardBox-focustransform"),cardBoxCssClass+=" card-focuscontent",html+='',html+="
"),html+="
",html+="
",html+=""}function initEditor(page,apiClient){page.querySelector("#selectBrowsableImageType").addEventListener("change",function(){browsableImageType=this.value,browsableImageStartIndex=0,selectedProvider=null,reloadBrowsableImages(page,apiClient)}),page.querySelector("#selectImageProvider").addEventListener("change",function(){browsableImageStartIndex=0,selectedProvider=this.value,reloadBrowsableImages(page,apiClient)}),page.querySelector("#chkAllLanguages").addEventListener("change",function(){browsableImageStartIndex=0,reloadBrowsableImages(page,apiClient)}),page.addEventListener("click",function(e){var btnDownloadRemoteImage=parentWithClass(e.target,"btnDownloadRemoteImage");if(btnDownloadRemoteImage){var card=parentWithClass(btnDownloadRemoteImage,"card");return void downloadRemoteImage(page,apiClient,card.getAttribute("data-imageurl"),card.getAttribute("data-imagetype"),card.getAttribute("data-imageprovider"))}var btnImageCard=parentWithClass(e.target,"btnImageCard");btnImageCard&&downloadRemoteImage(page,apiClient,btnImageCard.getAttribute("data-imageurl"),btnImageCard.getAttribute("data-imagetype"),btnImageCard.getAttribute("data-imageprovider"))})}function showEditor(itemId,serverId,itemType){loading.show(),require(["text!./imagedownloader.template.html"],function(template){var apiClient=connectionManager.getApiClient(serverId);currentItemId=itemId,currentItemType=itemType;var dialogOptions={removeOnClose:!0};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="fullscreen-border";var dlg=dialogHelper.createDialog(dialogOptions);dlg.innerHTML=globalize.translateDocument(template,"sharedcomponents"),layoutManager.tv&&scrollHelper.centerFocus.on(dlg,!1),dlg.addEventListener("close",onDialogClosed),dialogHelper.open(dlg);var editorContent=dlg.querySelector(".formDialogContent");initEditor(editorContent,apiClient),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),reloadBrowsableImages(editorContent,apiClient)})}function onDialogClosed(){var dlg=this;layoutManager.tv&&scrollHelper.centerFocus.off(dlg,!1),loading.hide(),hasChanges?currentResolve():currentReject()}var currentItemId,currentItemType,currentResolve,currentReject,selectedProvider,hasChanges=!1,browsableImagePageSize=browser.slow?6:30,browsableImageStartIndex=0,browsableImageType="Primary";return{show:function(itemId,serverId,itemType,imageType){return new Promise(function(resolve,reject){currentResolve=resolve,currentReject=reject,hasChanges=!1,browsableImageStartIndex=0,browsableImageType=imageType||"Primary",selectedProvider=null,showEditor(itemId,serverId,itemType)})}}}); \ No newline at end of file +define(["loading","apphost","dialogHelper","connectionManager","imageLoader","browser","layoutManager","scrollHelper","globalize","require","emby-checkbox","emby-button","paper-icon-button-light","emby-linkbutton","formDialogStyle","cardStyle"],function(loading,appHost,dialogHelper,connectionManager,imageLoader,browser,layoutManager,scrollHelper,globalize,require){"use strict";function getBaseRemoteOptions(){var options={};return options.itemId=currentItemId,options}function reloadBrowsableImages(page,apiClient){loading.show();var options=getBaseRemoteOptions();options.type=browsableImageType,options.startIndex=browsableImageStartIndex,options.limit=browsableImagePageSize,options.IncludeAllLanguages=page.querySelector("#chkAllLanguages").checked;var provider=selectedProvider||"";provider&&(options.ProviderName=provider),apiClient.getAvailableRemoteImages(options).then(function(result){renderRemoteImages(page,apiClient,result,browsableImageType,options.startIndex,options.limit),page.querySelector("#selectBrowsableImageType").value=browsableImageType;var providersHtml=result.Providers.map(function(p){return'"}),selectImageProvider=page.querySelector("#selectImageProvider");selectImageProvider.innerHTML='"+providersHtml,selectImageProvider.value=provider,loading.hide()})}function renderRemoteImages(page,apiClient,imagesResult,imageType,startIndex,limit){page.querySelector(".availableImagesPaging").innerHTML=getPagingHtml(startIndex,limit,imagesResult.TotalRecordCount);for(var html="",i=0,length=imagesResult.Images.length;ilimit;return html+='
',html+='',html+=(totalRecordCount?startIndex+1:0)+"-"+recordsEnd+" of "+totalRecordCount,html+="",showControls&&(html+='
',html+='',html+='',html+="
"),html+="
"}function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(!(elem=elem.parentNode))return null;return elem}function downloadRemoteImage(page,apiClient,url,type,provider){var options=getBaseRemoteOptions();options.Type=type,options.ImageUrl=url,options.ProviderName=provider,loading.show(),apiClient.downloadRemoteImage(options).then(function(){hasChanges=!0;var dlg=parentWithClass(page,"dialog");dialogHelper.close(dlg)})}function getDisplayUrl(url,apiClient){return apiClient.getUrl("Images/Remote",{imageUrl:url})}function getRemoteImageHtml(image,imageType,apiClient){var tagName=layoutManager.tv?"button":"div",enableFooterButtons=!layoutManager.tv,html="",cssClass="card scalableCard imageEditorCard",cardBoxCssClass="cardBox visualCardBox",shape="backdrop";return shape="Backdrop"===imageType||"Art"===imageType||"Thumb"===imageType||"Logo"===imageType?"backdrop":"Banner"===imageType?"banner":"Disc"===imageType?"square":"Episode"===currentItemType?"backdrop":"MusicAlbum"===currentItemType||"MusicArtist"===currentItemType?"square":"portrait",cssClass+=" "+shape+"Card "+shape+"Card-scalable","button"===tagName?(cssClass+=" btnImageCard",layoutManager.tv&&!browser.slow&&(cardBoxCssClass+=" cardBox-focustransform"),cardBoxCssClass+=" card-focuscontent",html+='',html+="
"),html+="
",html+="
",html+=""}function initEditor(page,apiClient){page.querySelector("#selectBrowsableImageType").addEventListener("change",function(){browsableImageType=this.value,browsableImageStartIndex=0,selectedProvider=null,reloadBrowsableImages(page,apiClient)}),page.querySelector("#selectImageProvider").addEventListener("change",function(){browsableImageStartIndex=0,selectedProvider=this.value,reloadBrowsableImages(page,apiClient)}),page.querySelector("#chkAllLanguages").addEventListener("change",function(){browsableImageStartIndex=0,reloadBrowsableImages(page,apiClient)}),page.addEventListener("click",function(e){var btnDownloadRemoteImage=parentWithClass(e.target,"btnDownloadRemoteImage");if(btnDownloadRemoteImage){var card=parentWithClass(btnDownloadRemoteImage,"card");return void downloadRemoteImage(page,apiClient,card.getAttribute("data-imageurl"),card.getAttribute("data-imagetype"),card.getAttribute("data-imageprovider"))}var btnImageCard=parentWithClass(e.target,"btnImageCard");btnImageCard&&downloadRemoteImage(page,apiClient,btnImageCard.getAttribute("data-imageurl"),btnImageCard.getAttribute("data-imagetype"),btnImageCard.getAttribute("data-imageprovider"))})}function showEditor(itemId,serverId,itemType){loading.show(),require(["text!./imagedownloader.template.html"],function(template){var apiClient=connectionManager.getApiClient(serverId);currentItemId=itemId,currentItemType=itemType;var dialogOptions={removeOnClose:!0};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="fullscreen-border";var dlg=dialogHelper.createDialog(dialogOptions);dlg.innerHTML=globalize.translateDocument(template,"sharedcomponents"),layoutManager.tv&&scrollHelper.centerFocus.on(dlg,!1),dlg.addEventListener("close",onDialogClosed),dialogHelper.open(dlg);var editorContent=dlg.querySelector(".formDialogContent");initEditor(editorContent,apiClient),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),reloadBrowsableImages(editorContent,apiClient)})}function onDialogClosed(){var dlg=this;layoutManager.tv&&scrollHelper.centerFocus.off(dlg,!1),loading.hide(),hasChanges?currentResolve():currentReject()}var currentItemId,currentItemType,currentResolve,currentReject,selectedProvider,hasChanges=!1,browsableImagePageSize=browser.slow?6:30,browsableImageStartIndex=0,browsableImageType="Primary";return{show:function(itemId,serverId,itemType,imageType){return new Promise(function(resolve,reject){currentResolve=resolve,currentReject=reject,hasChanges=!1,browsableImageStartIndex=0,browsableImageType=imageType||"Primary",selectedProvider=null,showEditor(itemId,serverId,itemType)})}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/imageeditor/imageeditor.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/imageeditor/imageeditor.js index 9e2640acc1..9418807854 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/imageeditor/imageeditor.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/imageeditor/imageeditor.js @@ -1 +1 @@ -define(["dialogHelper","connectionManager","loading","dom","layoutManager","focusManager","globalize","scrollHelper","imageLoader","require","browser","apphost","cardStyle","formDialogStyle","emby-button","paper-icon-button-light","css!./imageeditor"],function(dialogHelper,connectionManager,loading,dom,layoutManager,focusManager,globalize,scrollHelper,imageLoader,require,browser,appHost){"use strict";function getBaseRemoteOptions(){var options={};return options.itemId=currentItem.Id,options}function reload(page,item,focusContext){loading.show();var apiClient;item?(apiClient=connectionManager.getApiClient(item.ServerId),reloadItem(page,item,apiClient,focusContext)):(apiClient=connectionManager.getApiClient(currentItem.ServerId),apiClient.getItem(apiClient.getCurrentUserId(),currentItem.Id).then(function(item){reloadItem(page,item,apiClient,focusContext)}))}function addListeners(container,className,eventName,fn){container.addEventListener(eventName,function(e){var elem=dom.parentWithClass(e.target,className);elem&&fn.call(elem,e)})}function reloadItem(page,item,apiClient,focusContext){currentItem=item,apiClient.getRemoteImageProviders(getBaseRemoteOptions()).then(function(providers){for(var btnBrowseAllImages=page.querySelectorAll(".btnBrowseAllImages"),i=0,length=btnBrowseAllImages.length;i',html+='
',html+='
',html+='
';var imageUrl=getImageUrl(currentItem,apiClient,image.ImageType,image.ImageIndex,{maxWidth:imageSize});return html+='
",html+="
",html+="
",html+='
',html+='

'+globalize.translate("sharedcomponents#"+image.ImageType)+"

",html+='
',html+=image.Width&&image.Height?image.Width+" X "+image.Height:" ",html+="
",enableFooterButtons&&(html+='
',"Backdrop"===image.ImageType||"Screenshot"===image.ImageType?(html+=index>0?'':'',html+=indexchevron_right':''):imageProviders.length&&(html+=''),html+='',html+="
"),html+="
",html+="
",html+=""}function deleteImage(context,itemId,type,index,apiClient,enableConfirmation){var afterConfirm=function(){apiClient.deleteItemImage(itemId,type,index).then(function(){hasChanges=!0,reload(context)})};return enableConfirmation?void require(["confirm"],function(confirm){confirm({text:globalize.translate("sharedcomponents#ConfirmDeleteImage"),confirmText:globalize.translate("sharedcomponents#Delete"),primary:"cancel"}).then(afterConfirm)}):void afterConfirm()}function moveImage(context,apiClient,itemId,type,index,newIndex,focusContext){apiClient.updateItemImageIndex(itemId,type,index,newIndex).then(function(){hasChanges=!0,reload(context,null,focusContext)},function(){require(["alert"],function(alert){alert(globalize.translate("sharedcomponents#DefaultErrorMessage"))})})}function renderImages(page,item,apiClient,images,imageProviders,elem){var html="",imageSize=300,windowSize=dom.getWindowSize();windowSize.innerWidth>=1280&&(imageSize=Math.round(windowSize.innerWidth/4));for(var tagName=layoutManager.tv?"button":"div",enableFooterButtons=!layoutManager.tv,i=0,length=images.length;i0&&commands.push({name:globalize.translate("sharedcomponents#MoveLeft"),id:"moveleft"}),index',html+='
',html+='
',html+='
',html+='
",html+="
",html+="
",html+='
',html+='

'+globalize.translate("sharedcomponents#"+image.ImageType)+"

",html+='
',image.Width&&image.Height?html+=image.Width+" X "+image.Height:html+=" ",html+="
",enableFooterButtons&&(html+='
',"Backdrop"===image.ImageType||"Screenshot"===image.ImageType?(html+=index>0?'':'',html+=indexchevron_right':''):imageProviders.length&&(html+=''),html+='',html+="
"),html+="
",html+="",html+=""}function deleteImage(context,itemId,type,index,apiClient,enableConfirmation){var afterConfirm=function(){apiClient.deleteItemImage(itemId,type,index).then(function(){hasChanges=!0,reload(context)})};if(!enableConfirmation)return void afterConfirm();require(["confirm"],function(confirm){confirm({text:globalize.translate("sharedcomponents#ConfirmDeleteImage"),confirmText:globalize.translate("sharedcomponents#Delete"),primary:"cancel"}).then(afterConfirm)})}function moveImage(context,apiClient,itemId,type,index,newIndex,focusContext){apiClient.updateItemImageIndex(itemId,type,index,newIndex).then(function(){hasChanges=!0,reload(context,null,focusContext)},function(){require(["alert"],function(alert){alert(globalize.translate("sharedcomponents#DefaultErrorMessage"))})})}function renderImages(page,item,apiClient,images,imageProviders,elem){var html="",imageSize=300,windowSize=dom.getWindowSize();windowSize.innerWidth>=1280&&(imageSize=Math.round(windowSize.innerWidth/4));for(var tagName=layoutManager.tv?"button":"div",enableFooterButtons=!layoutManager.tv,i=0,length=images.length;i0&&commands.push({name:globalize.translate("sharedcomponents#MoveLeft"),id:"moveleft"}),index
'}function getAutoTimeProgressHtml(pct,options,isRecording,start,end){var containerClass="itemProgressBar";options&&options.containerClass&&(containerClass+=" "+options.containerClass);var foregroundClass="itemProgressBarForeground";return isRecording&&(foregroundClass+=" itemProgressBarForeground-recording"),'
'}function getProgressBarHtml(item,options){var pct;if(enableProgressIndicator(item)&&"Recording"!==item.Type){var userData=options?options.userData||item.UserData:item.UserData;if(userData&&(pct=userData.PlayedPercentage,pct&&pct<100))return getProgressHtml(pct,options)}if(("Program"===item.Type||"Timer"===item.Type||"Recording"===item.Type)&&item.StartDate&&item.EndDate){var startDate=0,endDate=1;try{startDate=datetime.parseISO8601Date(item.StartDate).getTime()}catch(err){}try{endDate=datetime.parseISO8601Date(item.EndDate).getTime()}catch(err){}var now=(new Date).getTime(),total=endDate-startDate;if(pct=100*((now-startDate)/total),pct>0&&pct<100){var isRecording="Timer"===item.Type||"Recording"===item.Type||item.TimerId;return getAutoTimeProgressHtml(pct,options,isRecording,startDate,endDate)}}return""}function enablePlayedIndicator(item){return itemHelper.canMarkPlayed(item)}function getPlayedIndicator(item){if(enablePlayedIndicator(item)){var userData=item.UserData||{};if(userData.UnplayedItemCount)return'
'+userData.UnplayedItemCount+"
";if(userData.PlayedPercentage&&userData.PlayedPercentage>=100||userData.Played)return'
'}return""}function getCountIndicatorHtml(count){return'
'+count+"
"}function getChildCountIndicatorHtml(item,options){var minCount=0;return options&&(minCount=options.minCount||minCount),item.ChildCount&&item.ChildCount>minCount?getCountIndicatorHtml(item.ChildCount):""}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 getSyncIndicator(item){return 100===item.SyncPercent?'
':null!=item.SyncPercent?'
':""}function getTypeIndicator(item){return"Video"===item.Type?'
':"Folder"===item.Type||"PhotoAlbum"===item.Type?'
':"Photo"===item.Type?'
':""}function getMissingIndicator(item){if("Episode"===item.Type&&"Virtual"===item.LocationType){if(item.PremiereDate)try{var premiereDate=datetime.parseISO8601Date(item.PremiereDate).getTime();if(premiereDate>(new Date).getTime())return'
Unaired
'}catch(err){}return'
Missing
'}return""}function onAutoTimeProgress(){var start=parseInt(this.getAttribute("data-starttime")),end=parseInt(this.getAttribute("data-endtime")),now=(new Date).getTime(),total=end-start,pct=100*((now-start)/total);pct=Math.min(100,pct),pct=Math.max(0,pct);var itemProgressBarForeground=this.querySelector(".itemProgressBarForeground");itemProgressBarForeground.style.width=pct+"%"}var ProgressBarPrototype=Object.create(HTMLDivElement.prototype);return ProgressBarPrototype.attachedCallback=function(){this.timeInterval&&clearInterval(this.timeInterval),"time"===this.getAttribute("data-automode")&&(this.timeInterval=setInterval(onAutoTimeProgress.bind(this),6e4))},ProgressBarPrototype.detachedCallback=function(){this.timeInterval&&(clearInterval(this.timeInterval),this.timeInterval=null)},document.registerElement("emby-progressbar",{prototype:ProgressBarPrototype,extends:"div"}),{getProgressBarHtml:getProgressBarHtml,getPlayedIndicatorHtml:getPlayedIndicator,getChildCountIndicatorHtml:getChildCountIndicatorHtml,enableProgressIndicator:enableProgressIndicator,getTimerIndicator:getTimerIndicator,enablePlayedIndicator:enablePlayedIndicator,getSyncIndicator:getSyncIndicator,getTypeIndicator:getTypeIndicator,getMissingIndicator:getMissingIndicator}}); \ No newline at end of file +define(["datetime","itemHelper","css!./indicators.css","material-icons"],function(datetime,itemHelper){"use strict";function enableProgressIndicator(item){return"Video"===item.MediaType&&"TvChannel"!==item.Type||("AudioBook"===item.Type||"AudioPodcast"===item.Type)}function getProgressHtml(pct,options){var containerClass="itemProgressBar";return options&&options.containerClass&&(containerClass+=" "+options.containerClass),'
'}function getAutoTimeProgressHtml(pct,options,isRecording,start,end){var containerClass="itemProgressBar";options&&options.containerClass&&(containerClass+=" "+options.containerClass);var foregroundClass="itemProgressBarForeground";return isRecording&&(foregroundClass+=" itemProgressBarForeground-recording"),'
'}function getProgressBarHtml(item,options){var pct;if(enableProgressIndicator(item)&&"Recording"!==item.Type){var userData=options?options.userData||item.UserData:item.UserData;if(userData&&(pct=userData.PlayedPercentage)&&pct<100)return getProgressHtml(pct,options)}if(("Program"===item.Type||"Timer"===item.Type||"Recording"===item.Type)&&item.StartDate&&item.EndDate){var startDate=0,endDate=1;try{startDate=datetime.parseISO8601Date(item.StartDate).getTime()}catch(err){}try{endDate=datetime.parseISO8601Date(item.EndDate).getTime()}catch(err){}if((pct=((new Date).getTime()-startDate)/(endDate-startDate)*100)>0&&pct<100){return getAutoTimeProgressHtml(pct,options,"Timer"===item.Type||"Recording"===item.Type||item.TimerId,startDate,endDate)}}return""}function enablePlayedIndicator(item){return itemHelper.canMarkPlayed(item)}function getPlayedIndicator(item){if(enablePlayedIndicator(item)){var userData=item.UserData||{};if(userData.UnplayedItemCount)return'
'+userData.UnplayedItemCount+"
";if(userData.PlayedPercentage&&userData.PlayedPercentage>=100||userData.Played)return'
'}return""}function getCountIndicatorHtml(count){return'
'+count+"
"}function getChildCountIndicatorHtml(item,options){var minCount=0;return options&&(minCount=options.minCount||minCount),item.ChildCount&&item.ChildCount>minCount?getCountIndicatorHtml(item.ChildCount):""}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 getSyncIndicator(item){return 100===item.SyncPercent?'
':null!=item.SyncPercent?'
':""}function getTypeIndicator(item){return"Video"===item.Type?'
':"Folder"===item.Type||"PhotoAlbum"===item.Type?'
':"Photo"===item.Type?'
':""}function getMissingIndicator(item){if("Episode"===item.Type&&"Virtual"===item.LocationType){if(item.PremiereDate)try{if(datetime.parseISO8601Date(item.PremiereDate).getTime()>(new Date).getTime())return'
Unaired
'}catch(err){}return'
Missing
'}return""}function onAutoTimeProgress(){var start=parseInt(this.getAttribute("data-starttime")),end=parseInt(this.getAttribute("data-endtime")),now=(new Date).getTime(),total=end-start,pct=(now-start)/total*100;pct=Math.min(100,pct),pct=Math.max(0,pct),this.querySelector(".itemProgressBarForeground").style.width=pct+"%"}var ProgressBarPrototype=Object.create(HTMLDivElement.prototype);return ProgressBarPrototype.attachedCallback=function(){this.timeInterval&&clearInterval(this.timeInterval),"time"===this.getAttribute("data-automode")&&(this.timeInterval=setInterval(onAutoTimeProgress.bind(this),6e4))},ProgressBarPrototype.detachedCallback=function(){this.timeInterval&&(clearInterval(this.timeInterval),this.timeInterval=null)},document.registerElement("emby-progressbar",{prototype:ProgressBarPrototype,extends:"div"}),{getProgressBarHtml:getProgressBarHtml,getPlayedIndicatorHtml:getPlayedIndicator,getChildCountIndicatorHtml:getChildCountIndicatorHtml,enableProgressIndicator:enableProgressIndicator,getTimerIndicator:getTimerIndicator,enablePlayedIndicator:enablePlayedIndicator,getSyncIndicator:getSyncIndicator,getTypeIndicator:getTypeIndicator,getMissingIndicator:getMissingIndicator}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/input/api.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/input/api.js index 70029bac16..5d9c484ee0 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/input/api.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/input/api.js @@ -1 +1 @@ -define(["connectionManager","playbackManager","events","inputManager","focusManager","appRouter"],function(connectionManager,playbackManager,events,inputManager,focusManager,appRouter){"use strict";function notifyApp(){inputManager.notify()}function displayMessage(cmd){var args=cmd.Arguments;args.TimeoutMs?require(["toast"],function(toast){toast({title:args.Header,text:args.Text})}):require(["alert"],function(alert){alert({title:args.Header,text:args.Text})})}function displayContent(cmd,apiClient){playbackManager.isPlayingLocally(["Video","Book","Game"])||appRouter.showItem(cmd.Arguments.ItemId,apiClient.serverId())}function processGeneralCommand(cmd,apiClient){switch(cmd.Name){case"Select":return void inputManager.trigger("select");case"Back":return void inputManager.trigger("back");case"MoveUp":return void inputManager.trigger("up");case"MoveDown":return void inputManager.trigger("down");case"MoveLeft":return void inputManager.trigger("left");case"MoveRight":return void inputManager.trigger("right");case"PageUp":return void inputManager.trigger("pageup");case"PageDown":return void inputManager.trigger("pagedown");case"SetRepeatMode":playbackManager.setRepeatMode(cmd.Arguments.RepeatMode);break;case"VolumeUp":return void inputManager.trigger("volumeup");case"VolumeDown":return void inputManager.trigger("volumedown");case"ChannelUp":return void inputManager.trigger("channelup");case"ChannelDown":return void inputManager.trigger("channeldown");case"Mute":return void inputManager.trigger("mute");case"Unmute":return void inputManager.trigger("unmute");case"ToggleMute":return void inputManager.trigger("togglemute");case"SetVolume":notifyApp(),playbackManager.setVolume(cmd.Arguments.Volume);break;case"SetAudioStreamIndex":notifyApp(),playbackManager.setAudioStreamIndex(parseInt(cmd.Arguments.Index));break;case"SetSubtitleStreamIndex":notifyApp(),playbackManager.setSubtitleStreamIndex(parseInt(cmd.Arguments.Index));break;case"ToggleFullscreen":return void inputManager.trigger("togglefullscreen");case"GoHome":return void inputManager.trigger("home");case"GoToSettings":return void inputManager.trigger("settings");case"DisplayContent":displayContent(cmd,apiClient);break;case"GoToSearch":return void inputManager.trigger("search");case"DisplayMessage":displayMessage(cmd);break;case"ToggleOsd":break;case"ToggleContextMenu":break;case"TakeScreenShot":break;case"SendKey":break;case"SendString":focusManager.sendText(cmd.Arguments.String);break;default:console.log("processGeneralCommand does not recognize: "+cmd.Name)}notifyApp()}function onMessageReceived(e,msg){var apiClient=this;if("Play"===msg.MessageType){notifyApp();var serverId=apiClient.serverInfo().Id;"PlayNext"===msg.Data.PlayCommand?playbackManager.queueNext({ids:msg.Data.ItemIds,serverId:serverId}):"PlayLast"===msg.Data.PlayCommand?playbackManager.queue({ids:msg.Data.ItemIds,serverId:serverId}):playbackManager.play({ids:msg.Data.ItemIds,startPositionTicks:msg.Data.StartPositionTicks,mediaSourceId:msg.Data.MediaSourceId,audioStreamIndex:msg.Data.AudioStreamIndex,subtitleStreamIndex:msg.Data.SubtitleStreamIndex,startIndex:msg.Data.StartIndex,serverId:serverId})}else if("Playstate"===msg.MessageType)"Stop"===msg.Data.Command?inputManager.trigger("stop"):"Pause"===msg.Data.Command?inputManager.trigger("pause"):"Unpause"===msg.Data.Command?inputManager.trigger("play"):"PlayPause"===msg.Data.Command?inputManager.trigger("playpause"):"Seek"===msg.Data.Command?playbackManager.seek(msg.Data.SeekPositionTicks):"NextTrack"===msg.Data.Command?inputManager.trigger("next"):"PreviousTrack"===msg.Data.Command?inputManager.trigger("previous"):notifyApp();else if("GeneralCommand"===msg.MessageType){var cmd=msg.Data;processGeneralCommand(cmd,apiClient)}else if("UserDataChanged"===msg.MessageType){if(msg.Data.UserId===apiClient.getCurrentUserId())for(var i=0,length=msg.Data.UserDataList.length;i=200}function resetThrottle(key){times[key]=(new Date).getTime()}function allowInput(){return!(!isElectron&&document.hidden)&&"Minimized"!==appHost.getWindowState()}function raiseEvent(name,key,keyCode){if(allowInput()){var event=document.createEvent("Event");event.initEvent(name,!0,!0),event.key=key,event.keyCode=keyCode,(document.activeElement||document.body).dispatchEvent(event)}}function clickElement(elem){allowInput()&&elem.click()}function raiseKeyEvent(oldPressedState,newPressedState,key,keyCode,enableRepeatKeyDown,clickonKeyUp){if(newPressedState===!0){var fire=!1;oldPressedState===!1?(fire=!0,resetThrottle(key)):enableRepeatKeyDown&&(fire=throttle(key)),fire&&keyCode&&raiseEvent("keydown",key,keyCode)}else newPressedState===!1&&oldPressedState===!0&&(resetThrottle(key),keyCode&&raiseEvent("keyup",key,keyCode),clickonKeyUp&&clickElement(document.activeElement||window))}function runInputLoop(){var gamepads;navigator.getGamepads?gamepads=navigator.getGamepads():navigator.webkitGetGamepads&&(gamepads=navigator.webkitGetGamepads()),gamepads=gamepads||[];var i,j,len;for(i=0,len=gamepads.length;i_THUMB_STICK_THRESHOLD?_ButtonPressedState.setleftThumbstickRight(!0):leftStickX<-_THUMB_STICK_THRESHOLD?_ButtonPressedState.setleftThumbstickLeft(!0):leftStickY<-_THUMB_STICK_THRESHOLD?_ButtonPressedState.setleftThumbstickUp(!0):leftStickY>_THUMB_STICK_THRESHOLD?_ButtonPressedState.setleftThumbstickDown(!0):(_ButtonPressedState.setleftThumbstickLeft(!1),_ButtonPressedState.setleftThumbstickRight(!1),_ButtonPressedState.setleftThumbstickUp(!1),_ButtonPressedState.setleftThumbstickDown(!1));var buttons=gamepad.buttons;for(j=0,len=buttons.length;j=200}function resetThrottle(key){times[key]=(new Date).getTime()}function allowInput(){return!(!isElectron&&document.hidden)&&"Minimized"!==appHost.getWindowState()}function raiseEvent(name,key,keyCode){if(allowInput()){var event=document.createEvent("Event");event.initEvent(name,!0,!0),event.key=key,event.keyCode=keyCode,(document.activeElement||document.body).dispatchEvent(event)}}function clickElement(elem){allowInput()&&elem.click()}function raiseKeyEvent(oldPressedState,newPressedState,key,keyCode,enableRepeatKeyDown,clickonKeyUp){if(!0===newPressedState){var fire=!1;!1===oldPressedState?(fire=!0,resetThrottle(key)):enableRepeatKeyDown&&(fire=throttle(key)),fire&&keyCode&&raiseEvent("keydown",key,keyCode)}else!1===newPressedState&&!0===oldPressedState&&(resetThrottle(key),keyCode&&raiseEvent("keyup",key,keyCode),clickonKeyUp&&clickElement(document.activeElement||window))}function runInputLoop(){var gamepads;navigator.getGamepads?gamepads=navigator.getGamepads():navigator.webkitGetGamepads&&(gamepads=navigator.webkitGetGamepads()),gamepads=gamepads||[];var i,j,len;for(i=0,len=gamepads.length;i_THUMB_STICK_THRESHOLD?_ButtonPressedState.setleftThumbstickRight(!0):leftStickX<-_THUMB_STICK_THRESHOLD?_ButtonPressedState.setleftThumbstickLeft(!0):leftStickY<-_THUMB_STICK_THRESHOLD?_ButtonPressedState.setleftThumbstickUp(!0):leftStickY>_THUMB_STICK_THRESHOLD?_ButtonPressedState.setleftThumbstickDown(!0):(_ButtonPressedState.setleftThumbstickLeft(!1),_ButtonPressedState.setleftThumbstickRight(!1),_ButtonPressedState.setleftThumbstickUp(!1),_ButtonPressedState.setleftThumbstickDown(!1));var buttons=gamepad.buttons;for(j=0,len=buttons.length;j=5e3&&(isMouseIdle=!0,addIdleClasses(),events.trigger(self,"mouseidle"))}function startMouseInterval(){mouseInterval||(mouseInterval=setInterval(onMouseInterval,5e3))}function stopMouseInterval(){var interval=mouseInterval;interval&&(clearInterval(interval),mouseInterval=null),removeIdleClasses()}function initMouse(){stopMouseInterval(),dom.removeEventListener(document,window.PointerEvent?"pointermove":"mousemove",onPointerMove,{passive:!0}),layoutManager.mobile||(startMouseInterval(),dom.addEventListener(document,window.PointerEvent?"pointermove":"mousemove",onPointerMove,{passive:!0})),dom.removeEventListener(document,window.PointerEvent?"pointerenter":"mouseenter",onPointerEnter,{capture:!0,passive:!0}),enableFocusWithMouse()&&dom.addEventListener(document,window.PointerEvent?"pointerenter":"mouseenter",onPointerEnter,{capture:!0,passive:!0})}var isMouseIdle,lastPointerMoveData,mouseInterval,self={},lastMouseInputTime=(new Date).getTime();return initMouse(),events.on(layoutManager,"modechange",initMouse),self}); \ No newline at end of file +define(["inputManager","focusManager","browser","layoutManager","events","dom"],function(inputmanager,focusManager,browser,layoutManager,events,dom){"use strict";function mouseIdleTime(){return(new Date).getTime()-lastMouseInputTime}function notifyApp(){inputmanager.notifyMouseMove()}function removeIdleClasses(){var classList=document.body.classList;classList.remove("mouseIdle"),classList.remove("mouseIdle-tv")}function addIdleClasses(){var classList=document.body.classList;classList.add("mouseIdle"),layoutManager.tv&&classList.add("mouseIdle-tv")}function onPointerMove(e){var eventX=e.screenX,eventY=e.screenY;if(void 0!==eventX||void 0!==eventY){var obj=lastPointerMoveData;if(!obj)return void(lastPointerMoveData={x:eventX,y:eventY});Math.abs(eventX-obj.x)<10&&Math.abs(eventY-obj.y)<10||(obj.x=eventX,obj.y=eventY,lastMouseInputTime=(new Date).getTime(),notifyApp(),isMouseIdle&&(isMouseIdle=!1,removeIdleClasses(),events.trigger(self,"mouseactive")))}}function onPointerEnter(e){"mouse"!==(e.pointerType||(layoutManager.mobile?"touch":"mouse"))||isMouseIdle||focusManager.focusableParent(e.target)&&focusManager.focus(e.target)}function enableFocusWithMouse(){return!!layoutManager.tv&&(!browser.web0s&&!!browser.tv)}function onMouseInterval(){!isMouseIdle&&mouseIdleTime()>=5e3&&(isMouseIdle=!0,addIdleClasses(),events.trigger(self,"mouseidle"))}function startMouseInterval(){mouseInterval||(mouseInterval=setInterval(onMouseInterval,5e3))}function stopMouseInterval(){var interval=mouseInterval;interval&&(clearInterval(interval),mouseInterval=null),removeIdleClasses()}function initMouse(){stopMouseInterval(),dom.removeEventListener(document,window.PointerEvent?"pointermove":"mousemove",onPointerMove,{passive:!0}),layoutManager.mobile||(startMouseInterval(),dom.addEventListener(document,window.PointerEvent?"pointermove":"mousemove",onPointerMove,{passive:!0})),dom.removeEventListener(document,window.PointerEvent?"pointerenter":"mouseenter",onPointerEnter,{capture:!0,passive:!0}),enableFocusWithMouse()&&dom.addEventListener(document,window.PointerEvent?"pointerenter":"mouseenter",onPointerEnter,{capture:!0,passive:!0})}var isMouseIdle,lastPointerMoveData,mouseInterval,self={},lastMouseInputTime=(new Date).getTime();return initMouse(),events.on(layoutManager,"modechange",initMouse),self}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/inputmanager.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/inputmanager.js index 41f6e9475f..84587b470e 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/inputmanager.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/inputmanager.js @@ -1 +1 @@ -define(["playbackManager","focusManager","appRouter","dom"],function(playbackManager,focusManager,appRouter,dom){"use strict";function notify(){lastInputTime=(new Date).getTime(),handleCommand("unknown")}function notifyMouseMove(){lastInputTime=(new Date).getTime()}function idleTime(){return(new Date).getTime()-lastInputTime}function select(sourceElement){sourceElement.click()}function on(scope,fn){eventListenerCount++,dom.addEventListener(scope,"command",fn,{})}function off(scope,fn){eventListenerCount&&eventListenerCount--,dom.removeEventListener(scope,"command",fn,{})}function checkCommandTime(command){var last=commandTimes[command]||0,now=(new Date).getTime();return!(now-last<1e3)&&(commandTimes[command]=now,!0)}function handleCommand(name,options){lastInputTime=(new Date).getTime();var sourceElement=options?options.sourceElement:null;if(sourceElement&&(sourceElement=focusManager.focusableParent(sourceElement)),sourceElement=sourceElement||document.activeElement||window,eventListenerCount){var customEvent=new CustomEvent("command",{detail:{command:name},bubbles:!0,cancelable:!0}),eventResult=sourceElement.dispatchEvent(customEvent);if(!eventResult)return}switch(name){case"up":focusManager.moveUp(sourceElement);break;case"down":focusManager.moveDown(sourceElement);break;case"left":focusManager.moveLeft(sourceElement);break;case"right":focusManager.moveRight(sourceElement);break;case"home":appRouter.goHome();break;case"settings":appRouter.showSettings();break;case"back":appRouter.back();break;case"forward":break;case"select":select(sourceElement);break;case"pageup":break;case"pagedown":break;case"end":break;case"menu":case"info":break;case"next":case"nexttrack":playbackManager.nextTrack();break;case"previous":case"previoustrack":playbackManager.previousTrack();break;case"guide":appRouter.showGuide();break;case"recordedtv":appRouter.showRecordedTV();break;case"record":break;case"livetv":appRouter.showLiveTV();break;case"mute":playbackManager.setMute(!0);break;case"unmute":playbackManager.setMute(!1);break;case"togglemute":playbackManager.toggleMute();break;case"channelup":playbackManager.nextTrack();break;case"channeldown":playbackManager.previousTrack();break;case"volumedown":playbackManager.volumeDown();break;case"volumeup":playbackManager.volumeUp();break;case"play":playbackManager.unpause();break;case"pause":playbackManager.pause();break;case"playpause":playbackManager.playPause();break;case"stop":checkCommandTime("stop")&&playbackManager.stop();break;case"changezoom":playbackManager.toggleAspectRatio();break;case"changeaudiotrack":playbackManager.changeAudioStream();break;case"changesubtitletrack":playbackManager.changeSubtitleStream();break;case"search":appRouter.showSearch();break;case"favorites":appRouter.showFavorites();break;case"fastforward":playbackManager.fastForward();break;case"rewind":playbackManager.rewind();break;case"togglefullscreen":playbackManager.toggleFullscreen();break;case"disabledisplaymirror":playbackManager.enableDisplayMirroring(!1);break;case"enabledisplaymirror":playbackManager.enableDisplayMirroring(!0);break;case"toggledisplaymirror":playbackManager.toggleDisplayMirroring();break;case"togglestats":break;case"movies":appRouter.goHome();break;case"music":appRouter.goHome();break;case"tv":appRouter.goHome();break;case"nowplaying":appRouter.showNowPlaying();break;case"save":break;case"screensaver":break;case"refresh":break;case"changebrightness":break;case"red":break;case"green":break;case"yellow":break;case"blue":break;case"grey":break;case"brown":break;case"repeatnone":playbackManager.setRepeatMode("RepeatNone");break;case"repeatall":playbackManager.setRepeatMode("RepeatAll");break;case"repeatone":playbackManager.setRepeatMode("RepeatOne")}}var lastInputTime=(new Date).getTime(),eventListenerCount=0,commandTimes={};return dom.addEventListener(document,"click",notify,{passive:!0}),{trigger:handleCommand,handle:handleCommand,notify:notify,notifyMouseMove:notifyMouseMove,idleTime:idleTime,on:on,off:off}}); \ No newline at end of file +define(["playbackManager","focusManager","appRouter","dom"],function(playbackManager,focusManager,appRouter,dom){"use strict";function notify(){lastInputTime=(new Date).getTime(),handleCommand("unknown")}function notifyMouseMove(){lastInputTime=(new Date).getTime()}function idleTime(){return(new Date).getTime()-lastInputTime}function select(sourceElement){sourceElement.click()}function on(scope,fn){eventListenerCount++,dom.addEventListener(scope,"command",fn,{})}function off(scope,fn){eventListenerCount&&eventListenerCount--,dom.removeEventListener(scope,"command",fn,{})}function checkCommandTime(command){var last=commandTimes[command]||0,now=(new Date).getTime();return!(now-last<1e3)&&(commandTimes[command]=now,!0)}function handleCommand(name,options){lastInputTime=(new Date).getTime();var sourceElement=options?options.sourceElement:null;if(sourceElement&&(sourceElement=focusManager.focusableParent(sourceElement)),sourceElement=sourceElement||document.activeElement||window,eventListenerCount){var customEvent=new CustomEvent("command",{detail:{command:name},bubbles:!0,cancelable:!0});if(!sourceElement.dispatchEvent(customEvent))return}switch(name){case"up":focusManager.moveUp(sourceElement);break;case"down":focusManager.moveDown(sourceElement);break;case"left":focusManager.moveLeft(sourceElement);break;case"right":focusManager.moveRight(sourceElement);break;case"home":appRouter.goHome();break;case"settings":appRouter.showSettings();break;case"back":appRouter.back();break;case"forward":break;case"select":select(sourceElement);break;case"pageup":case"pagedown":case"end":break;case"menu":case"info":break;case"next":case"nexttrack":playbackManager.nextTrack();break;case"previous":case"previoustrack":playbackManager.previousTrack();break;case"guide":appRouter.showGuide();break;case"recordedtv":appRouter.showRecordedTV();break;case"record":break;case"livetv":appRouter.showLiveTV();break;case"mute":playbackManager.setMute(!0);break;case"unmute":playbackManager.setMute(!1);break;case"togglemute":playbackManager.toggleMute();break;case"channelup":playbackManager.nextTrack();break;case"channeldown":playbackManager.previousTrack();break;case"volumedown":playbackManager.volumeDown();break;case"volumeup":playbackManager.volumeUp();break;case"play":playbackManager.unpause();break;case"pause":playbackManager.pause();break;case"playpause":playbackManager.playPause();break;case"stop":checkCommandTime("stop")&&playbackManager.stop();break;case"changezoom":playbackManager.toggleAspectRatio();break;case"changeaudiotrack":playbackManager.changeAudioStream();break;case"changesubtitletrack":playbackManager.changeSubtitleStream();break;case"search":appRouter.showSearch();break;case"favorites":appRouter.showFavorites();break;case"fastforward":playbackManager.fastForward();break;case"rewind":playbackManager.rewind();break;case"togglefullscreen":playbackManager.toggleFullscreen();break;case"disabledisplaymirror":playbackManager.enableDisplayMirroring(!1);break;case"enabledisplaymirror":playbackManager.enableDisplayMirroring(!0);break;case"toggledisplaymirror":playbackManager.toggleDisplayMirroring();break;case"togglestats":break;case"movies":case"music":case"tv":appRouter.goHome();break;case"nowplaying":appRouter.showNowPlaying();break;case"save":case"screensaver":case"refresh":case"changebrightness":case"red":case"green":case"yellow":case"blue":case"grey":case"brown":break;case"repeatnone":playbackManager.setRepeatMode("RepeatNone");break;case"repeatall":playbackManager.setRepeatMode("RepeatAll");break;case"repeatone":playbackManager.setRepeatMode("RepeatOne")}}var lastInputTime=(new Date).getTime(),eventListenerCount=0,commandTimes={};return dom.addEventListener(document,"click",notify,{passive:!0}),{trigger:handleCommand,handle:handleCommand,notify:notify,notifyMouseMove:notifyMouseMove,idleTime:idleTime,on:on,off:off}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js index 36935464cf..8b958a5db3 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js @@ -1 +1 @@ -define(["apphost","globalize","connectionManager","itemHelper","appRouter","playbackManager","loading","appSettings","browser","actionsheet"],function(appHost,globalize,connectionManager,itemHelper,appRouter,playbackManager,loading,appSettings,browser,actionsheet){"use strict";function getCommands(options){var item=options.item,canPlay=playbackManager.canPlay(item),commands=[];if(browser.operaTv||browser.web0s)return commands;var user=options.user;canPlay&&"Photo"!==item.MediaType&&(options.play!==!1&&commands.push({name:globalize.translate("sharedcomponents#Play"),id:"resume"}),options.playAllFromHere&&"Program"!==item.Type&&"TvChannel"!==item.Type&&commands.push({name:globalize.translate("sharedcomponents#PlayAllFromHere"),id:"playallfromhere"})),playbackManager.canQueue(item)&&(options.queue!==!1&&commands.push({name:globalize.translate("sharedcomponents#AddToPlayQueue"),id:"queue"}),options.queue!==!1&&commands.push({name:globalize.translate("sharedcomponents#PlayNext"),id:"queuenext"})),(item.IsFolder||"MusicArtist"===item.Type||"MusicGenre"===item.Type)&&options.shuffle!==!1&&commands.push({name:globalize.translate("sharedcomponents#Shuffle"),id:"shuffle"}),"Audio"!==item.MediaType&&"MusicAlbum"!==item.Type&&"MusicArtist"!==item.Type&&"MusicGenre"!==item.Type||options.instantMix!==!1&&commands.push({name:globalize.translate("sharedcomponents#InstantMix"),id:"instantmix"}),commands.length&&commands.push({divider:!0}),itemHelper.supportsAddingToCollection(item)&&commands.push({name:globalize.translate("sharedcomponents#AddToCollection"),id:"addtocollection"}),itemHelper.supportsAddingToPlaylist(item)&&commands.push({name:globalize.translate("sharedcomponents#AddToPlaylist"),id:"addtoplaylist"}),"Timer"===item.Type&&user.Policy.EnableLiveTvManagement&&options.cancelTimer!==!1&&commands.push({name:globalize.translate("sharedcomponents#CancelRecording"),id:"canceltimer"}),"Recording"===item.Type&&"InProgress"===item.Status&&user.Policy.EnableLiveTvManagement&&options.cancelTimer!==!1&&commands.push({name:globalize.translate("sharedcomponents#CancelRecording"),id:"canceltimer"}),"SeriesTimer"===item.Type&&user.Policy.EnableLiveTvManagement&&options.cancelTimer!==!1&&commands.push({name:globalize.translate("sharedcomponents#CancelSeries"),id:"cancelseriestimer"}),item.CanDelete&&options.deleteItem!==!1&&("Playlist"===item.Type||"BoxSet"===item.Type?commands.push({name:globalize.translate("sharedcomponents#Delete"),id:"delete"}):commands.push({name:globalize.translate("sharedcomponents#DeleteMedia"),id:"delete"})),item.CanDownload&&appHost.supports("filedownload")&&commands.push({name:globalize.translate("sharedcomponents#Download"),id:"download"}),appHost.supports("sync")&&options.syncLocal!==!1&&itemHelper.canSync(user,item)&&commands.push({name:globalize.translate("sharedcomponents#Download"),id:"synclocal"});var canEdit=itemHelper.canEdit(user,item);if(canEdit&&options.edit!==!1&&"SeriesTimer"!==item.Type){var text="Timer"===item.Type||"SeriesTimer"===item.Type?globalize.translate("sharedcomponents#Edit"):globalize.translate("sharedcomponents#EditInfo");commands.push({name:text,id:"edit"})}return itemHelper.canEditImages(user,item)&&options.editImages!==!1&&commands.push({name:globalize.translate("sharedcomponents#EditImages"),id:"editimages"}),canEdit&&("Video"!==item.MediaType||"TvChannel"===item.Type||"Program"===item.Type||"Virtual"===item.LocationType||"Recording"===item.Type&&"Completed"!==item.Status||options.editSubtitles!==!1&&commands.push({name:globalize.translate("sharedcomponents#EditSubtitles"),id:"editsubtitles"})),options.identify!==!1&&itemHelper.canIdentify(user,item)&&commands.push({name:globalize.translate("sharedcomponents#Identify"),id:"identify"}),"Program"===item.Type&&options.record!==!1&&item.TimerId&&commands.push({name:Globalize.translate("sharedcomponents#ManageRecording"),id:"record"}),"Program"===item.Type&&options.record!==!1&&(item.TimerId||commands.push({name:Globalize.translate("sharedcomponents#Record"),id:"record"})),itemHelper.canRefreshMetadata(item,user)&&commands.push({name:globalize.translate("sharedcomponents#RefreshMetadata"),id:"refresh"}),item.PlaylistItemId&&options.playlistId&&commands.push({name:globalize.translate("sharedcomponents#RemoveFromPlaylist"),id:"removefromplaylist"}),options.collectionId&&commands.push({name:globalize.translate("sharedcomponents#RemoveFromCollection"),id:"removefromcollection"}),options.share===!0&&itemHelper.canShare(item,user)&&commands.push({name:globalize.translate("sharedcomponents#Share"),id:"share"}),options.sync!==!1&&itemHelper.canSync(user,item)&&commands.push({name:globalize.translate("sharedcomponents#Sync"),id:"sync"}),options.openAlbum!==!1&&item.AlbumId&&"Photo"!==item.MediaType&&commands.push({name:Globalize.translate("sharedcomponents#ViewAlbum"),id:"album"}),options.openArtist!==!1&&item.ArtistItems&&item.ArtistItems.length&&commands.push({name:Globalize.translate("sharedcomponents#ViewArtist"),id:"artist"}),commands}function getResolveFunction(resolve,id,changed,deleted){return function(){resolve({command:id,updated:changed,deleted:deleted})}}function executeCommand(item,id,options){var itemId=item.Id,serverId=item.ServerId,apiClient=connectionManager.getApiClient(serverId);return new Promise(function(resolve,reject){switch(id){case"addtocollection":require(["collectionEditor"],function(collectionEditor){(new collectionEditor).show({items:[itemId],serverId:serverId}).then(getResolveFunction(resolve,id,!0),getResolveFunction(resolve,id))});break;case"addtoplaylist":require(["playlistEditor"],function(playlistEditor){(new playlistEditor).show({items:[itemId],serverId:serverId}).then(getResolveFunction(resolve,id,!0),getResolveFunction(resolve,id))});break;case"download":require(["fileDownloader"],function(fileDownloader){var downloadHref=apiClient.getItemDownloadUrl(itemId);fileDownloader.download([{url:downloadHref,itemId:itemId,serverId:serverId}]),getResolveFunction(getResolveFunction(resolve,id),id)()});break;case"editsubtitles":require(["subtitleEditor"],function(subtitleEditor){subtitleEditor.show(itemId,serverId).then(getResolveFunction(resolve,id,!0),getResolveFunction(resolve,id))});break;case"edit":editItem(apiClient,item).then(getResolveFunction(resolve,id,!0),getResolveFunction(resolve,id));break;case"editimages":require(["imageEditor"],function(imageEditor){imageEditor.show({itemId:itemId,serverId:serverId}).then(getResolveFunction(resolve,id,!0),getResolveFunction(resolve,id))});break;case"identify":require(["itemIdentifier"],function(itemIdentifier){itemIdentifier.show(itemId,serverId).then(getResolveFunction(resolve,id,!0),getResolveFunction(resolve,id))});break;case"refresh":refresh(apiClient,item),getResolveFunction(resolve,id)();break;case"open":appRouter.showItem(item),getResolveFunction(resolve,id)();break;case"play":play(item,!1),getResolveFunction(resolve,id)();break;case"resume":play(item,!0),getResolveFunction(resolve,id)();break;case"queue":play(item,!1,!0),getResolveFunction(resolve,id)();break;case"queuenext":play(item,!1,!0,!0),getResolveFunction(resolve,id)();break;case"record":require(["recordingCreator"],function(recordingCreator){recordingCreator.show(itemId,serverId).then(getResolveFunction(resolve,id,!0),getResolveFunction(resolve,id))});break;case"shuffle":playbackManager.shuffle(item),getResolveFunction(resolve,id)();break;case"instantmix":playbackManager.instantMix(item),getResolveFunction(resolve,id)();break;case"delete":deleteItem(apiClient,item).then(getResolveFunction(resolve,id,!0,!0),getResolveFunction(resolve,id));break;case"share":navigator.share({title:item.Name,text:item.Overview});break;case"album":appRouter.showItem(item.AlbumId,item.ServerId),getResolveFunction(resolve,id)();break;case"artist":appRouter.showItem(item.ArtistItems[0].Id,item.ServerId),getResolveFunction(resolve,id)();break;case"playallfromhere":getResolveFunction(resolve,id)();break;case"queueallfromhere":getResolveFunction(resolve,id)();break;case"sync":require(["syncDialog"],function(syncDialog){syncDialog.showMenu({items:[item],serverId:serverId})}),getResolveFunction(resolve,id)();break;case"synclocal":require(["syncDialog"],function(syncDialog){syncDialog.showMenu({items:[item],isLocalSync:!0,serverId:serverId})}),getResolveFunction(resolve,id)();break;case"removefromplaylist":apiClient.ajax({url:apiClient.getUrl("Playlists/"+options.playlistId+"/Items",{EntryIds:[item.PlaylistItemId].join(",")}),type:"DELETE"}).then(function(){getResolveFunction(resolve,id,!0)()});break;case"removefromcollection":apiClient.ajax({type:"DELETE",url:apiClient.getUrl("Collections/"+options.collectionId+"/Items",{Ids:[item.Id].join(",")})}).then(function(){getResolveFunction(resolve,id,!0)()});break;case"canceltimer":deleteTimer(apiClient,item,resolve,id);break;case"cancelseriestimer":deleteSeriesTimer(apiClient,item,resolve,id);break;default:reject()}})}function deleteTimer(apiClient,item,resolve,command){require(["recordingHelper"],function(recordingHelper){var timerId=item.TimerId||item.Id;recordingHelper.cancelTimerWithConfirmation(timerId,item.ServerId).then(function(){getResolveFunction(resolve,command,!0)()})})}function deleteSeriesTimer(apiClient,item,resolve,command){require(["recordingHelper"],function(recordingHelper){recordingHelper.cancelSeriesTimerWithConfirmation(item.Id,item.ServerId).then(function(){getResolveFunction(resolve,command,!0)()})})}function play(item,resume,queue,queueNext){var method=queue?queueNext?"queueNext":"queue":"play",startPosition=0;resume&&item.UserData&&item.UserData.PlaybackPositionTicks&&(startPosition=item.UserData.PlaybackPositionTicks),"Program"===item.Type?playbackManager[method]({ids:[item.ChannelId],startPositionTicks:startPosition,serverId:item.ServerId}):playbackManager[method]({items:[item],startPositionTicks:startPosition})}function editItem(apiClient,item){return new Promise(function(resolve,reject){var serverId=apiClient.serverInfo().Id;"Timer"===item.Type?require(["recordingEditor"],function(recordingEditor){recordingEditor.show(item.Id,serverId).then(resolve,reject)}):"SeriesTimer"===item.Type?require(["seriesRecordingEditor"],function(recordingEditor){recordingEditor.show(item.Id,serverId).then(resolve,reject)}):require(["metadataEditor"],function(metadataEditor){metadataEditor.show(item.Id,serverId).then(resolve,reject)})})}function deleteItem(apiClient,item){return new Promise(function(resolve,reject){require(["deleteHelper"],function(deleteHelper){deleteHelper.deleteItem({item:item,navigate:!1}).then(function(){resolve(!0)},reject)})})}function refresh(apiClient,item){require(["refreshDialog"],function(refreshDialog){new refreshDialog({itemIds:[item.Id],serverId:apiClient.serverInfo().Id,mode:"CollectionFolder"===item.Type?"scan":null}).show()})}function show(options){var commands=getCommands(options);return commands.length?actionsheet.show({items:commands,positionTo:options.positionTo,resolveOnClick:["share"]}).then(function(id){return executeCommand(options.item,id,options)}):Promise.reject()}return{getCommands:getCommands,show:show}}); \ No newline at end of file +define(["apphost","globalize","connectionManager","itemHelper","appRouter","playbackManager","loading","appSettings","browser","actionsheet"],function(appHost,globalize,connectionManager,itemHelper,appRouter,playbackManager,loading,appSettings,browser,actionsheet){"use strict";function getCommands(options){var item=options.item,canPlay=playbackManager.canPlay(item),commands=[];if(browser.operaTv||browser.web0s)return commands;var user=options.user;canPlay&&"Photo"!==item.MediaType&&(!1!==options.play&&commands.push({name:globalize.translate("sharedcomponents#Play"),id:"resume"}),options.playAllFromHere&&"Program"!==item.Type&&"TvChannel"!==item.Type&&commands.push({name:globalize.translate("sharedcomponents#PlayAllFromHere"),id:"playallfromhere"})),playbackManager.canQueue(item)&&(!1!==options.queue&&commands.push({name:globalize.translate("sharedcomponents#AddToPlayQueue"),id:"queue"}),!1!==options.queue&&commands.push({name:globalize.translate("sharedcomponents#PlayNext"),id:"queuenext"})),(item.IsFolder||"MusicArtist"===item.Type||"MusicGenre"===item.Type)&&!1!==options.shuffle&&commands.push({name:globalize.translate("sharedcomponents#Shuffle"),id:"shuffle"}),"Audio"!==item.MediaType&&"MusicAlbum"!==item.Type&&"MusicArtist"!==item.Type&&"MusicGenre"!==item.Type||!1!==options.instantMix&&commands.push({name:globalize.translate("sharedcomponents#InstantMix"),id:"instantmix"}),commands.length&&commands.push({divider:!0}),itemHelper.supportsAddingToCollection(item)&&commands.push({name:globalize.translate("sharedcomponents#AddToCollection"),id:"addtocollection"}),itemHelper.supportsAddingToPlaylist(item)&&commands.push({name:globalize.translate("sharedcomponents#AddToPlaylist"),id:"addtoplaylist"}),"Timer"===item.Type&&user.Policy.EnableLiveTvManagement&&!1!==options.cancelTimer&&commands.push({name:globalize.translate("sharedcomponents#CancelRecording"),id:"canceltimer"}),"Recording"===item.Type&&"InProgress"===item.Status&&user.Policy.EnableLiveTvManagement&&!1!==options.cancelTimer&&commands.push({name:globalize.translate("sharedcomponents#CancelRecording"),id:"canceltimer"}),"SeriesTimer"===item.Type&&user.Policy.EnableLiveTvManagement&&!1!==options.cancelTimer&&commands.push({name:globalize.translate("sharedcomponents#CancelSeries"),id:"cancelseriestimer"}),item.CanDelete&&!1!==options.deleteItem&&("Playlist"===item.Type||"BoxSet"===item.Type?commands.push({name:globalize.translate("sharedcomponents#Delete"),id:"delete"}):commands.push({name:globalize.translate("sharedcomponents#DeleteMedia"),id:"delete"})),item.CanDownload&&appHost.supports("filedownload")&&commands.push({name:globalize.translate("sharedcomponents#Download"),id:"download"}),appHost.supports("sync")&&!1!==options.syncLocal&&itemHelper.canSync(user,item)&&commands.push({name:globalize.translate("sharedcomponents#Download"),id:"synclocal"});var canEdit=itemHelper.canEdit(user,item);if(canEdit&&!1!==options.edit&&"SeriesTimer"!==item.Type){var text="Timer"===item.Type||"SeriesTimer"===item.Type?globalize.translate("sharedcomponents#Edit"):globalize.translate("sharedcomponents#EditInfo");commands.push({name:text,id:"edit"})}return itemHelper.canEditImages(user,item)&&!1!==options.editImages&&commands.push({name:globalize.translate("sharedcomponents#EditImages"),id:"editimages"}),canEdit&&("Video"!==item.MediaType||"TvChannel"===item.Type||"Program"===item.Type||"Virtual"===item.LocationType||"Recording"===item.Type&&"Completed"!==item.Status||!1!==options.editSubtitles&&commands.push({name:globalize.translate("sharedcomponents#EditSubtitles"),id:"editsubtitles"})),!1!==options.identify&&itemHelper.canIdentify(user,item)&&commands.push({name:globalize.translate("sharedcomponents#Identify"),id:"identify"}),"Program"===item.Type&&!1!==options.record&&item.TimerId&&commands.push({name:Globalize.translate("sharedcomponents#ManageRecording"),id:"record"}),"Program"===item.Type&&!1!==options.record&&(item.TimerId||commands.push({name:Globalize.translate("sharedcomponents#Record"),id:"record"})),itemHelper.canRefreshMetadata(item,user)&&commands.push({name:globalize.translate("sharedcomponents#RefreshMetadata"),id:"refresh"}),item.PlaylistItemId&&options.playlistId&&commands.push({name:globalize.translate("sharedcomponents#RemoveFromPlaylist"),id:"removefromplaylist"}),options.collectionId&&commands.push({name:globalize.translate("sharedcomponents#RemoveFromCollection"),id:"removefromcollection"}),!0===options.share&&itemHelper.canShare(item,user)&&commands.push({name:globalize.translate("sharedcomponents#Share"),id:"share"}),!1!==options.sync&&itemHelper.canSync(user,item)&&commands.push({name:globalize.translate("sharedcomponents#Sync"),id:"sync"}),!1!==options.openAlbum&&item.AlbumId&&"Photo"!==item.MediaType&&commands.push({name:Globalize.translate("sharedcomponents#ViewAlbum"),id:"album"}),!1!==options.openArtist&&item.ArtistItems&&item.ArtistItems.length&&commands.push({name:Globalize.translate("sharedcomponents#ViewArtist"),id:"artist"}),commands}function getResolveFunction(resolve,id,changed,deleted){return function(){resolve({command:id,updated:changed,deleted:deleted})}}function executeCommand(item,id,options){var itemId=item.Id,serverId=item.ServerId,apiClient=connectionManager.getApiClient(serverId);return new Promise(function(resolve,reject){switch(id){case"addtocollection":require(["collectionEditor"],function(collectionEditor){(new collectionEditor).show({items:[itemId],serverId:serverId}).then(getResolveFunction(resolve,id,!0),getResolveFunction(resolve,id))});break;case"addtoplaylist":require(["playlistEditor"],function(playlistEditor){(new playlistEditor).show({items:[itemId],serverId:serverId}).then(getResolveFunction(resolve,id,!0),getResolveFunction(resolve,id))});break;case"download":require(["fileDownloader"],function(fileDownloader){var downloadHref=apiClient.getItemDownloadUrl(itemId);fileDownloader.download([{url:downloadHref,itemId:itemId,serverId:serverId}]),getResolveFunction(getResolveFunction(resolve,id),id)()});break;case"editsubtitles":require(["subtitleEditor"],function(subtitleEditor){subtitleEditor.show(itemId,serverId).then(getResolveFunction(resolve,id,!0),getResolveFunction(resolve,id))});break;case"edit":editItem(apiClient,item).then(getResolveFunction(resolve,id,!0),getResolveFunction(resolve,id));break;case"editimages":require(["imageEditor"],function(imageEditor){imageEditor.show({itemId:itemId,serverId:serverId}).then(getResolveFunction(resolve,id,!0),getResolveFunction(resolve,id))});break;case"identify":require(["itemIdentifier"],function(itemIdentifier){itemIdentifier.show(itemId,serverId).then(getResolveFunction(resolve,id,!0),getResolveFunction(resolve,id))});break;case"refresh":refresh(apiClient,item),getResolveFunction(resolve,id)();break;case"open":appRouter.showItem(item),getResolveFunction(resolve,id)();break;case"play":play(item,!1),getResolveFunction(resolve,id)();break;case"resume":play(item,!0),getResolveFunction(resolve,id)();break;case"queue":play(item,!1,!0),getResolveFunction(resolve,id)();break;case"queuenext":play(item,!1,!0,!0),getResolveFunction(resolve,id)();break;case"record":require(["recordingCreator"],function(recordingCreator){recordingCreator.show(itemId,serverId).then(getResolveFunction(resolve,id,!0),getResolveFunction(resolve,id))});break;case"shuffle":playbackManager.shuffle(item),getResolveFunction(resolve,id)();break;case"instantmix":playbackManager.instantMix(item),getResolveFunction(resolve,id)();break;case"delete":deleteItem(apiClient,item).then(getResolveFunction(resolve,id,!0,!0),getResolveFunction(resolve,id));break;case"share":navigator.share({title:item.Name,text:item.Overview});break;case"album":appRouter.showItem(item.AlbumId,item.ServerId),getResolveFunction(resolve,id)();break;case"artist":appRouter.showItem(item.ArtistItems[0].Id,item.ServerId),getResolveFunction(resolve,id)();break;case"playallfromhere":case"queueallfromhere":getResolveFunction(resolve,id)();break;case"sync":require(["syncDialog"],function(syncDialog){syncDialog.showMenu({items:[item],serverId:serverId})}),getResolveFunction(resolve,id)();break;case"synclocal":require(["syncDialog"],function(syncDialog){syncDialog.showMenu({items:[item],isLocalSync:!0,serverId:serverId})}),getResolveFunction(resolve,id)();break;case"removefromplaylist":apiClient.ajax({url:apiClient.getUrl("Playlists/"+options.playlistId+"/Items",{EntryIds:[item.PlaylistItemId].join(",")}),type:"DELETE"}).then(function(){getResolveFunction(resolve,id,!0)()});break;case"removefromcollection":apiClient.ajax({type:"DELETE",url:apiClient.getUrl("Collections/"+options.collectionId+"/Items",{Ids:[item.Id].join(",")})}).then(function(){getResolveFunction(resolve,id,!0)()});break;case"canceltimer":deleteTimer(apiClient,item,resolve,id);break;case"cancelseriestimer":deleteSeriesTimer(apiClient,item,resolve,id);break;default:reject()}})}function deleteTimer(apiClient,item,resolve,command){require(["recordingHelper"],function(recordingHelper){var timerId=item.TimerId||item.Id;recordingHelper.cancelTimerWithConfirmation(timerId,item.ServerId).then(function(){getResolveFunction(resolve,command,!0)()})})}function deleteSeriesTimer(apiClient,item,resolve,command){require(["recordingHelper"],function(recordingHelper){recordingHelper.cancelSeriesTimerWithConfirmation(item.Id,item.ServerId).then(function(){getResolveFunction(resolve,command,!0)()})})}function play(item,resume,queue,queueNext){var method=queue?queueNext?"queueNext":"queue":"play",startPosition=0;resume&&item.UserData&&item.UserData.PlaybackPositionTicks&&(startPosition=item.UserData.PlaybackPositionTicks),"Program"===item.Type?playbackManager[method]({ids:[item.ChannelId],startPositionTicks:startPosition,serverId:item.ServerId}):playbackManager[method]({items:[item],startPositionTicks:startPosition})}function editItem(apiClient,item){return new Promise(function(resolve,reject){var serverId=apiClient.serverInfo().Id;"Timer"===item.Type?require(["recordingEditor"],function(recordingEditor){recordingEditor.show(item.Id,serverId).then(resolve,reject)}):"SeriesTimer"===item.Type?require(["seriesRecordingEditor"],function(recordingEditor){recordingEditor.show(item.Id,serverId).then(resolve,reject)}):require(["metadataEditor"],function(metadataEditor){metadataEditor.show(item.Id,serverId).then(resolve,reject)})})}function deleteItem(apiClient,item){return new Promise(function(resolve,reject){require(["deleteHelper"],function(deleteHelper){deleteHelper.deleteItem({item:item,navigate:!1}).then(function(){resolve(!0)},reject)})})}function refresh(apiClient,item){require(["refreshDialog"],function(refreshDialog){new refreshDialog({itemIds:[item.Id],serverId:apiClient.serverInfo().Id,mode:"CollectionFolder"===item.Type?"scan":null}).show()})}function show(options){var commands=getCommands(options);return commands.length?actionsheet.show({items:commands,positionTo:options.positionTo,resolveOnClick:["share"]}).then(function(id){return executeCommand(options.item,id,options)}):Promise.reject()}return{getCommands:getCommands,show:show}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js index d67c0890e5..8692550a41 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js @@ -1 +1 @@ -define(["apphost","globalize"],function(appHost,globalize){"use strict";function getDisplayName(item,options){if(!item)throw new Error("null item passed into getDisplayName");options=options||{},"Timer"===item.Type&&(item=item.ProgramInfo||item);var name=("Program"!==item.Type&&"Recording"!==item.Type||!item.IsSeries&&!item.EpisodeTitle?item.Name:item.EpisodeTitle)||"";if("TvChannel"===item.Type)return item.ChannelNumber?item.ChannelNumber+" "+name:name;if("Episode"===item.Type&&0===item.ParentIndexNumber)name=globalize.translate("sharedcomponents#ValueSpecialEpisodeName",name);else if(("Episode"===item.Type||"Program"===item.Type)&&null!=item.IndexNumber&&null!=item.ParentIndexNumber&&options.includeIndexNumber!==!1){var displayIndexNumber=item.IndexNumber,number=displayIndexNumber,nameSeparator=" - ";options.includeParentInfo!==!1?number="S"+item.ParentIndexNumber+":E"+number:nameSeparator=". ",item.IndexNumberEnd&&(displayIndexNumber=item.IndexNumberEnd,number+="-"+displayIndexNumber),number&&(name=name?number+nameSeparator+name:number)}return name}function supportsAddingToCollection(item){var invalidTypes=["Person","Genre","MusicGenre","Studio","GameGenre","BoxSet","Playlist","UserView","CollectionFolder","Audio","Program","Timer","SeriesTimer"];return("Recording"!==item.Type||"Completed"===item.Status)&&(!item.CollectionType&&invalidTypes.indexOf(item.Type)===-1&&"Photo"!==item.MediaType&&!isLocalItem(item))}function supportsAddingToPlaylist(item){return"Program"!==item.Type&&("TvChannel"!==item.Type&&("Timer"!==item.Type&&("SeriesTimer"!==item.Type&&("Photo"!==item.MediaType&&(("Recording"!==item.Type||"Completed"===item.Status)&&(!isLocalItem(item)&&(item.MediaType||item.IsFolder||"Genre"===item.Type||"MusicGenre"===item.Type||"MusicArtist"===item.Type)))))))}function canEdit(user,item){var itemType=item.Type;return"UserRootFolder"!==itemType&&"UserView"!==itemType&&("Program"!==itemType&&(("Recording"!==item.Type||"Completed"===item.Status)&&(!isLocalItem(item)&&user.Policy.IsAdministrator)))}function isLocalItem(item){return!(!item||!item.Id||0!==item.Id.indexOf("local"))}return{getDisplayName:getDisplayName,supportsAddingToCollection:supportsAddingToCollection,supportsAddingToPlaylist:supportsAddingToPlaylist,isLocalItem:isLocalItem,canIdentify:function(user,item){var itemType=item.Type;return!("Movie"!==itemType&&"Trailer"!==itemType&&"Series"!==itemType&&"Game"!==itemType&&"BoxSet"!==itemType&&"Person"!==itemType&&"Book"!==itemType&&"MusicAlbum"!==itemType&&"MusicArtist"!==itemType||!user.Policy.IsAdministrator||isLocalItem(item))},canEdit:canEdit,canEditImages:function(user,item){var itemType=item.Type;return"Photo"!==item.MediaType&&("UserView"===itemType?!!user.Policy.IsAdministrator:("Recording"!==item.Type||"Completed"===item.Status)&&("Timer"!==itemType&&"SeriesTimer"!==itemType&&canEdit(user,item)&&!isLocalItem(item)))},canSync:function(user,item){return!(user&&!user.Policy.EnableContentDownloading)&&(!isLocalItem(item)&&item.SupportsSync)},canShare:function(item,user){return"Program"!==item.Type&&("TvChannel"!==item.Type&&("Timer"!==item.Type&&("SeriesTimer"!==item.Type&&(("Recording"!==item.Type||"Completed"===item.Status)&&(!isLocalItem(item)&&(user.Policy.EnablePublicSharing&&appHost.supports("sharing")))))))},enableDateAddedDisplay:function(item){return!item.IsFolder&&item.MediaType&&"Program"!==item.Type&&"TvChannel"!==item.Type&&"Trailer"!==item.Type},canMarkPlayed:function(item){if("Program"===item.Type)return!1;if("Video"===item.MediaType){if("TvChannel"!==item.Type)return!0}else if("Audio"===item.MediaType){if("AudioPodcast"===item.Type)return!0;if("AudioBook"===item.Type)return!0}return"Series"===item.Type||"Season"===item.Type||"BoxSet"===item.Type||"Game"===item.MediaType||"Book"===item.MediaType||"Recording"===item.MediaType},canRate:function(item){return"Program"!==item.Type&&"Timer"!==item.Type&&"SeriesTimer"!==item.Type},canRefreshMetadata:function(item,user){return!(!user.Policy.IsAdministrator||"Timer"===item.Type||"SeriesTimer"===item.Type||"Program"===item.Type||"TvChannel"===item.Type||"Recording"===item.Type&&"Completed"!==item.Status||isLocalItem(item))},supportsMediaSourceSelection:function(item){return"Video"===item.MediaType&&("TvChannel"!==item.Type&&(!(!item.MediaSources||1===item.MediaSources.length&&"Placeholder"===item.MediaSources[0].Type)&&(item.EnableMediaSourceDisplay!==!1&&(null!=item.EnableMediaSourceDisplay||!item.SourceType||"Library"===item.SourceType))))}}}); \ No newline at end of file +define(["apphost","globalize"],function(appHost,globalize){"use strict";function getDisplayName(item,options){if(!item)throw new Error("null item passed into getDisplayName");options=options||{},"Timer"===item.Type&&(item=item.ProgramInfo||item);var name=("Program"!==item.Type&&"Recording"!==item.Type||!item.IsSeries&&!item.EpisodeTitle?item.Name:item.EpisodeTitle)||"";if("TvChannel"===item.Type)return item.ChannelNumber?item.ChannelNumber+" "+name:name;if("Episode"===item.Type&&0===item.ParentIndexNumber)name=globalize.translate("sharedcomponents#ValueSpecialEpisodeName",name);else if(("Episode"===item.Type||"Program"===item.Type)&&null!=item.IndexNumber&&null!=item.ParentIndexNumber&&!1!==options.includeIndexNumber){var displayIndexNumber=item.IndexNumber,number=displayIndexNumber,nameSeparator=" - ";!1!==options.includeParentInfo?number="S"+item.ParentIndexNumber+":E"+number:nameSeparator=". ",item.IndexNumberEnd&&(displayIndexNumber=item.IndexNumberEnd,number+="-"+displayIndexNumber),number&&(name=name?number+nameSeparator+name:number)}return name}function supportsAddingToCollection(item){var invalidTypes=["Person","Genre","MusicGenre","Studio","GameGenre","BoxSet","Playlist","UserView","CollectionFolder","Audio","Program","Timer","SeriesTimer"];return("Recording"!==item.Type||"Completed"===item.Status)&&(!item.CollectionType&&-1===invalidTypes.indexOf(item.Type)&&"Photo"!==item.MediaType&&!isLocalItem(item))}function supportsAddingToPlaylist(item){return"Program"!==item.Type&&("TvChannel"!==item.Type&&("Timer"!==item.Type&&("SeriesTimer"!==item.Type&&("Photo"!==item.MediaType&&(("Recording"!==item.Type||"Completed"===item.Status)&&(!isLocalItem(item)&&(item.MediaType||item.IsFolder||"Genre"===item.Type||"MusicGenre"===item.Type||"MusicArtist"===item.Type)))))))}function canEdit(user,item){var itemType=item.Type;return"UserRootFolder"!==itemType&&"UserView"!==itemType&&("Program"!==itemType&&(("Recording"!==item.Type||"Completed"===item.Status)&&(!isLocalItem(item)&&user.Policy.IsAdministrator)))}function isLocalItem(item){return!(!item||!item.Id||0!==item.Id.indexOf("local"))}return{getDisplayName:getDisplayName,supportsAddingToCollection:supportsAddingToCollection,supportsAddingToPlaylist:supportsAddingToPlaylist,isLocalItem:isLocalItem,canIdentify:function(user,item){var itemType=item.Type;return!("Movie"!==itemType&&"Trailer"!==itemType&&"Series"!==itemType&&"Game"!==itemType&&"BoxSet"!==itemType&&"Person"!==itemType&&"Book"!==itemType&&"MusicAlbum"!==itemType&&"MusicArtist"!==itemType||!user.Policy.IsAdministrator||isLocalItem(item))},canEdit:canEdit,canEditImages:function(user,item){var itemType=item.Type;return"Photo"!==item.MediaType&&("UserView"===itemType?!!user.Policy.IsAdministrator:("Recording"!==item.Type||"Completed"===item.Status)&&("Timer"!==itemType&&"SeriesTimer"!==itemType&&canEdit(user,item)&&!isLocalItem(item)))},canSync:function(user,item){return!(user&&!user.Policy.EnableContentDownloading)&&(!isLocalItem(item)&&item.SupportsSync)},canShare:function(item,user){return"Program"!==item.Type&&("TvChannel"!==item.Type&&("Timer"!==item.Type&&("SeriesTimer"!==item.Type&&(("Recording"!==item.Type||"Completed"===item.Status)&&(!isLocalItem(item)&&(user.Policy.EnablePublicSharing&&appHost.supports("sharing")))))))},enableDateAddedDisplay:function(item){return!item.IsFolder&&item.MediaType&&"Program"!==item.Type&&"TvChannel"!==item.Type&&"Trailer"!==item.Type},canMarkPlayed:function(item){if("Program"===item.Type)return!1;if("Video"===item.MediaType){if("TvChannel"!==item.Type)return!0}else if("Audio"===item.MediaType){if("AudioPodcast"===item.Type)return!0;if("AudioBook"===item.Type)return!0}return"Series"===item.Type||"Season"===item.Type||"BoxSet"===item.Type||"Game"===item.MediaType||"Book"===item.MediaType||"Recording"===item.MediaType},canRate:function(item){return"Program"!==item.Type&&"Timer"!==item.Type&&"SeriesTimer"!==item.Type},canRefreshMetadata:function(item,user){return!(!user.Policy.IsAdministrator||"Timer"===item.Type||"SeriesTimer"===item.Type||"Program"===item.Type||"TvChannel"===item.Type||"Recording"===item.Type&&"Completed"!==item.Status||isLocalItem(item))},supportsMediaSourceSelection:function(item){return"Video"===item.MediaType&&("TvChannel"!==item.Type&&(!(!item.MediaSources||1===item.MediaSources.length&&"Placeholder"===item.MediaSources[0].Type)&&(!1!==item.EnableMediaSourceDisplay&&(null!=item.EnableMediaSourceDisplay||!item.SourceType||"Library"===item.SourceType))))}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemhovermenu/itemhovermenu.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemhovermenu/itemhovermenu.js index 3fc3db063b..7798e90025 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemhovermenu/itemhovermenu.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemhovermenu/itemhovermenu.js @@ -1 +1 @@ -define(["layoutManager","connectionManager","itemHelper","mediaInfo","playbackManager","globalize","dom","apphost","css!./itemhovermenu","emby-button","emby-playstatebutton","emby-ratingbutton"],function(layoutManager,connectionManager,itemHelper,mediaInfo,playbackManager,globalize,dom,appHost){"use strict";function onPointerLeave(e){var pointerType=e.pointerType||(layoutManager.mobile?"touch":"mouse");if("mouse"===pointerType){var elem=e.target;showOverlayTimeout&&(clearTimeout(showOverlayTimeout),showOverlayTimeout=null),elem=elem.classList.contains("cardOverlayTarget")?elem:elem.querySelector(".cardOverlayTarget"),elem&&slideDownToHide(elem)}}function onSlideTransitionComplete(){this.classList.add("hide")}function slideDownToHide(elem){elem.classList.contains("hide")||(dom.addEventListener(elem,dom.whichTransitionEvent(),onSlideTransitionComplete,{once:!0}),elem.classList.remove("cardOverlayTarget-open"))}function slideUpToShow(elem){dom.removeEventListener(elem,dom.whichTransitionEvent(),onSlideTransitionComplete,{once:!0}),elem.classList.remove("hide"),void elem.offsetWidth,elem.classList.add("cardOverlayTarget-open")}function getOverlayHtml(apiClient,item,card){var html="";html+='
';var className=card.className.toLowerCase(),isMiniItem=className.indexOf("mini")!==-1,isSmallItem=isMiniItem||className.indexOf("small")!==-1,isPortrait=className.indexOf("portrait")!==-1,parentName=isSmallItem||isMiniItem||isPortrait?null:item.SeriesName,name=item.EpisodeTitle?item.Name:itemHelper.getDisplayName(item);html+="
";var imgUrl,logoHeight=26;parentName&&item.ParentLogoItemId?(imgUrl=apiClient.getScaledImageUrl(item.ParentLogoItemId,{maxHeight:logoHeight,type:"logo",tag:item.ParentLogoImageTag}),html+=''):item.ImageTags.Logo?(imgUrl=apiClient.getScaledImageUrl(item.Id,{maxHeight:logoHeight,type:"logo",tag:item.ImageTags.Logo}),html+=''):html+=parentName||name,html+="
",parentName?(html+="

",html+=name,html+="

"):isSmallItem||isMiniItem||(html+='
',html+=mediaInfo.getPrimaryMediaInfoHtml(item,{endsAt:!1}),html+="
"),html+='
',playbackManager.canPlay(item)&&(html+=''),item.LocalTrailerCount&&(html+='');var moreIcon="dots-horiz"===appHost.moreIcon?"":"";html+='";var userData=item.UserData||{};if(itemHelper.canMarkPlayed(item)&&(html+=''),itemHelper.canRate(item)){var likes=null==userData.Likes?"":userData.Likes;html+=''}return html+="
",html+="
"}function onCardOverlayButtonsClick(e){var button=dom.parentWithClass(e.target,"btnUserData");button&&e.stopPropagation()}function onShowTimerExpired(elem){var innerElem=elem.querySelector(".cardOverlayTarget");if(!innerElem){innerElem=document.createElement("div"),innerElem.classList.add("hide"),innerElem.classList.add("cardOverlayTarget"),innerElem.classList.add("itemAction"),innerElem.setAttribute("data-action","link");var appendTo=elem.querySelector("div.cardContent")||elem.querySelector(".cardScalable")||elem.querySelector(".cardBox");appendTo||(appendTo=elem),appendTo.classList.add("withHoverMenu"),appendTo.appendChild(innerElem)}var dataElement=dom.parentWithAttribute(elem,"data-id");if(dataElement){var id=dataElement.getAttribute("data-id"),type=dataElement.getAttribute("data-type");if("Timer"!==type&&"SeriesTimer"!==type&&"Program"!==type){var serverId=dataElement.getAttribute("data-serverid"),apiClient=connectionManager.getApiClient(serverId);apiClient.getItem(apiClient.getCurrentUserId(),id).then(function(item){innerElem.innerHTML=getOverlayHtml(apiClient,item,dataElement),innerElem.querySelector(".cardOverlayButtons").addEventListener("click",onCardOverlayButtonsClick)}),slideUpToShow(innerElem)}}}function onPointerEnter(e){var pointerType=e.pointerType||(layoutManager.mobile?"touch":"mouse");if("mouse"===pointerType){var elem=e.target,card=dom.parentWithClass(elem,"cardBox");if(!card)return;if(preventHover===!0)return void(preventHover=!1);showOverlayTimeout&&(clearTimeout(showOverlayTimeout),showOverlayTimeout=null),showOverlayTimeout=setTimeout(function(){onShowTimerExpired(card)},1600)}}function preventTouchHover(){preventHover=!0}function ItemHoverMenu(parentElement){this.parent=parentElement,dom.addEventListener(this.parent,window.PointerEvent?"pointerenter":"mouseenter",onPointerEnter,{passive:!0,capture:!0}),dom.addEventListener(this.parent,window.PointerEvent?"pointerleave":"mouseleave",onPointerLeave,{passive:!0,capture:!0}),window.PointerEvent||dom.addEventListener(this.parent,"touchstart",preventTouchHover,{passive:!0})}var showOverlayTimeout,preventHover=!1;return ItemHoverMenu.prototype={constructor:ItemHoverMenu,destroy:function(){dom.removeEventListener(this.parent,window.PointerEvent?"pointerenter":"mouseenter",onPointerEnter,{passive:!0,capture:!0}),dom.removeEventListener(this.parent,window.PointerEvent?"pointerleave":"mouseleave",onPointerLeave,{passive:!0,capture:!0}),dom.removeEventListener(this.parent,"touchstart",preventTouchHover,{passive:!0})}},ItemHoverMenu}); \ No newline at end of file +define(["layoutManager","connectionManager","itemHelper","mediaInfo","playbackManager","globalize","dom","apphost","css!./itemhovermenu","emby-button","emby-playstatebutton","emby-ratingbutton"],function(layoutManager,connectionManager,itemHelper,mediaInfo,playbackManager,globalize,dom,appHost){"use strict";function onPointerLeave(e){if("mouse"===(e.pointerType||(layoutManager.mobile?"touch":"mouse"))){var elem=e.target;showOverlayTimeout&&(clearTimeout(showOverlayTimeout),showOverlayTimeout=null),(elem=elem.classList.contains("cardOverlayTarget")?elem:elem.querySelector(".cardOverlayTarget"))&&slideDownToHide(elem)}}function onSlideTransitionComplete(){this.classList.add("hide")}function slideDownToHide(elem){elem.classList.contains("hide")||(dom.addEventListener(elem,dom.whichTransitionEvent(),onSlideTransitionComplete,{once:!0}),elem.classList.remove("cardOverlayTarget-open"))}function slideUpToShow(elem){dom.removeEventListener(elem,dom.whichTransitionEvent(),onSlideTransitionComplete,{once:!0}),elem.classList.remove("hide"),elem.offsetWidth,elem.classList.add("cardOverlayTarget-open")}function getOverlayHtml(apiClient,item,card){var html="";html+='
';var className=card.className.toLowerCase(),isMiniItem=-1!==className.indexOf("mini"),isSmallItem=isMiniItem||-1!==className.indexOf("small"),isPortrait=-1!==className.indexOf("portrait"),parentName=isSmallItem||isMiniItem||isPortrait?null:item.SeriesName,name=item.EpisodeTitle?item.Name:itemHelper.getDisplayName(item);html+="
";var imgUrl;parentName&&item.ParentLogoItemId?(imgUrl=apiClient.getScaledImageUrl(item.ParentLogoItemId,{maxHeight:26,type:"logo",tag:item.ParentLogoImageTag}),html+=''):item.ImageTags.Logo?(imgUrl=apiClient.getScaledImageUrl(item.Id,{maxHeight:26,type:"logo",tag:item.ImageTags.Logo}),html+=''):html+=parentName||name,html+="
",parentName?(html+="

",html+=name,html+="

"):isSmallItem||isMiniItem||(html+='
',html+=mediaInfo.getPrimaryMediaInfoHtml(item,{endsAt:!1}),html+="
"),html+='
',playbackManager.canPlay(item)&&(html+=''),item.LocalTrailerCount&&(html+=''),html+='";var userData=item.UserData||{};if(itemHelper.canMarkPlayed(item)&&(html+=''),itemHelper.canRate(item)){var likes=null==userData.Likes?"":userData.Likes;html+=''}return html+="
",html+="
"}function onCardOverlayButtonsClick(e){dom.parentWithClass(e.target,"btnUserData")&&e.stopPropagation()}function onShowTimerExpired(elem){var innerElem=elem.querySelector(".cardOverlayTarget");if(!innerElem){innerElem=document.createElement("div"),innerElem.classList.add("hide"),innerElem.classList.add("cardOverlayTarget"),innerElem.classList.add("itemAction"),innerElem.setAttribute("data-action","link");var appendTo=elem.querySelector("div.cardContent")||elem.querySelector(".cardScalable")||elem.querySelector(".cardBox");appendTo||(appendTo=elem),appendTo.classList.add("withHoverMenu"),appendTo.appendChild(innerElem)}var dataElement=dom.parentWithAttribute(elem,"data-id");if(dataElement){var id=dataElement.getAttribute("data-id"),type=dataElement.getAttribute("data-type");if("Timer"!==type&&"SeriesTimer"!==type&&"Program"!==type){var serverId=dataElement.getAttribute("data-serverid"),apiClient=connectionManager.getApiClient(serverId);apiClient.getItem(apiClient.getCurrentUserId(),id).then(function(item){innerElem.innerHTML=getOverlayHtml(apiClient,item,dataElement),innerElem.querySelector(".cardOverlayButtons").addEventListener("click",onCardOverlayButtonsClick)}),slideUpToShow(innerElem)}}}function onPointerEnter(e){if("mouse"===(e.pointerType||(layoutManager.mobile?"touch":"mouse"))){var elem=e.target,card=dom.parentWithClass(elem,"cardBox");if(!card)return;if(!0===preventHover)return void(preventHover=!1);showOverlayTimeout&&(clearTimeout(showOverlayTimeout),showOverlayTimeout=null),showOverlayTimeout=setTimeout(function(){onShowTimerExpired(card)},1600)}}function preventTouchHover(){preventHover=!0}function ItemHoverMenu(parentElement){this.parent=parentElement,dom.addEventListener(this.parent,window.PointerEvent?"pointerenter":"mouseenter",onPointerEnter,{passive:!0,capture:!0}),dom.addEventListener(this.parent,window.PointerEvent?"pointerleave":"mouseleave",onPointerLeave,{passive:!0,capture:!0}),window.PointerEvent||dom.addEventListener(this.parent,"touchstart",preventTouchHover,{passive:!0})}var showOverlayTimeout,preventHover=!1;return ItemHoverMenu.prototype={constructor:ItemHoverMenu,destroy:function(){dom.removeEventListener(this.parent,window.PointerEvent?"pointerenter":"mouseenter",onPointerEnter,{passive:!0,capture:!0}),dom.removeEventListener(this.parent,window.PointerEvent?"pointerleave":"mouseleave",onPointerLeave,{passive:!0,capture:!0}),dom.removeEventListener(this.parent,"touchstart",preventTouchHover,{passive:!0})}},ItemHoverMenu}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemidentifier/itemidentifier.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemidentifier/itemidentifier.js index 120b27e662..991fa86300 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemidentifier/itemidentifier.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemidentifier/itemidentifier.js @@ -1 +1 @@ -define(["dialogHelper","loading","connectionManager","require","globalize","scrollHelper","layoutManager","focusManager","browser","emby-input","emby-checkbox","paper-icon-button-light","css!./../formdialog","material-icons","cardStyle"],function(dialogHelper,loading,connectionManager,require,globalize,scrollHelper,layoutManager,focusManager,browser){"use strict";function getApiClient(){return connectionManager.getApiClient(currentServerId)}function searchForIdentificationResults(page){var i,length,value,lookupInfo={ProviderIds:{}},identifyField=page.querySelectorAll(".identifyField");for(i=0,length=identifyField.length;i");if(identifyResult.ImageUrl){var displayUrl=getSearchImageDisplayUrl(identifyResult.ImageUrl,identifyResult.SearchProviderName);resultHtml='
'+resultHtml+"
"}page.querySelector(".selectedSearchResult").innerHTML=resultHtml,focusManager.focus(identifyOptionsForm.querySelector(".btnSubmit"))}function getSearchResultHtml(result,index){var padderClass,html="",cssClass="card scalableCard",cardBoxCssClass="cardBox";if("Episode"===currentItemType?(cssClass+=" backdropCard backdropCard-scalable",padderClass="cardPadder-backdrop"):"MusicAlbum"===currentItemType||"MusicArtist"===currentItemType?(cssClass+=" squareCard squareCard-scalable",padderClass="cardPadder-square"):(cssClass+=" portraitCard portraitCard-scalable",padderClass="cardPadder-portrait"),layoutManager.tv&&!browser.slow&&(cardBoxCssClass+=" cardBox-focustransform"),cardBoxCssClass+=" card-focuscontent cardBox-bottompadded",html+='"}function getSearchImageDisplayUrl(url,provider){var apiClient=getApiClient();return apiClient.getUrl("Items/RemoteSearch/Image",{imageUrl:url,ProviderName:provider})}function submitIdentficationResult(page){loading.show();var options={ReplaceAllImages:page.querySelector("#chkIdentifyReplaceImages").checked},apiClient=getApiClient();apiClient.ajax({type:"POST",url:apiClient.getUrl("Items/RemoteSearch/Apply/"+currentItem.Id,options),data:JSON.stringify(currentSearchResult),contentType:"application/json"}).then(function(){hasChanges=!0,loading.hide(),dialogHelper.close(page)},function(){loading.hide(),dialogHelper.close(page)})}function showIdentificationForm(page,item){var apiClient=getApiClient();apiClient.getJSON(apiClient.getUrl("Items/"+item.Id+"/ExternalIdInfos")).then(function(idList){for(var html="",providerIds=item.ProviderIds||{},i=0,length=idList.length;i';var idLabel=globalize.translate("sharedcomponents#LabelDynamicExternalId").replace("{0}",idInfo.Name);providerIds[idInfo.Key]||"";html+='',html+="
"}page.querySelector("#txtLookupName").value="","Person"===item.Type||"BoxSet"===item.Type?(page.querySelector(".fldLookupYear").classList.add("hide"),page.querySelector("#txtLookupYear").value=""):(page.querySelector(".fldLookupYear").classList.remove("hide"),page.querySelector("#txtLookupYear").value=""),page.querySelector(".identifyProviderIds").innerHTML=html,page.querySelector(".formDialogHeaderTitle").innerHTML=globalize.translate("sharedcomponents#Identify")})}function showEditor(itemId){loading.show(),require(["text!./itemidentifier.template.html"],function(template){var apiClient=getApiClient();apiClient.getItem(apiClient.getCurrentUserId(),itemId).then(function(item){currentItem=item,currentItemType=currentItem.Type;var dialogOptions={size:"fullscreen-border",removeOnClose:!0,scrollY:!1};layoutManager.tv&&(dialogOptions.size="fullscreen");var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.classList.add("recordingDialog");var html="";html+=globalize.translateDocument(template,"sharedcomponents"),dlg.innerHTML=html,dlg.addEventListener("close",onDialogClosed),layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1),dialogHelper.open(dlg),dlg.querySelector(".popupIdentifyForm").addEventListener("submit",function(e){return e.preventDefault(),searchForIdentificationResults(dlg),!1}),dlg.querySelector(".identifyOptionsForm").addEventListener("submit",function(e){return e.preventDefault(),submitIdentficationResult(dlg),!1}),dlg.querySelector(".btnCancel").addEventListener("click",function(e){dialogHelper.close(dlg)}),dlg.classList.add("identifyDialog"),showIdentificationForm(dlg,item),loading.hide()})})}function onDialogClosed(){loading.hide(),hasChanges?currentResolve():currentReject()}function showEditorFindNew(itemName,itemYear,itemType,resolveFunc){currentItem=null,currentItemType=itemType,require(["text!./itemidentifier.template.html"],function(template){var dialogOptions={size:"fullscreen-border",removeOnClose:!0,scrollY:!1};layoutManager.tv&&(dialogOptions.size="fullscreen");var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.classList.add("recordingDialog");var html="";html+=globalize.translateDocument(template,"sharedcomponents"),dlg.innerHTML=html,layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1),dialogHelper.open(dlg),dlg.querySelector(".btnCancel").addEventListener("click",function(e){dialogHelper.close(dlg)}),dlg.querySelector(".popupIdentifyForm").addEventListener("submit",function(e){return e.preventDefault(),searchForIdentificationResults(dlg),!1}),dlg.addEventListener("close",function(){loading.hide();var foundItem=hasChanges?currentSearchResult:null;resolveFunc(foundItem)}),dlg.classList.add("identifyDialog"),showIdentificationFormFindNew(dlg,itemName,itemYear,itemType)})}function showIdentificationFormFindNew(dlg,itemName,itemYear,itemType){dlg.querySelector("#txtLookupName").value=itemName,"Person"===itemType||"BoxSet"===itemType?(dlg.querySelector(".fldLookupYear").classList.add("hide"),dlg.querySelector("#txtLookupYear").value=""):(dlg.querySelector(".fldLookupYear").classList.remove("hide"),dlg.querySelector("#txtLookupYear").value=itemYear),dlg.querySelector(".formDialogHeaderTitle").innerHTML=globalize.translate("sharedcomponents#Search")}var currentItem,currentItemType,currentServerId,currentResolve,currentReject,currentSearchResult,hasChanges=!1;return{show:function(itemId,serverId){return new Promise(function(resolve,reject){currentResolve=resolve,currentReject=reject,currentServerId=serverId,hasChanges=!1,showEditor(itemId)})},showFindNew:function(itemName,itemYear,itemType,serverId){return new Promise(function(resolve,reject){currentServerId=serverId,hasChanges=!1,showEditorFindNew(itemName,itemYear,itemType,resolve)})}}}); \ No newline at end of file +define(["dialogHelper","loading","connectionManager","require","globalize","scrollHelper","layoutManager","focusManager","browser","emby-input","emby-checkbox","paper-icon-button-light","css!./../formdialog","material-icons","cardStyle"],function(dialogHelper,loading,connectionManager,require,globalize,scrollHelper,layoutManager,focusManager,browser){"use strict";function getApiClient(){return connectionManager.getApiClient(currentServerId)}function searchForIdentificationResults(page){var i,length,value,lookupInfo={ProviderIds:{}},identifyField=page.querySelectorAll(".identifyField");for(i=0,length=identifyField.length;i");if(identifyResult.ImageUrl){resultHtml='
'+resultHtml+"
"}page.querySelector(".selectedSearchResult").innerHTML=resultHtml,focusManager.focus(identifyOptionsForm.querySelector(".btnSubmit"))}function getSearchResultHtml(result,index){var padderClass,html="",cssClass="card scalableCard",cardBoxCssClass="cardBox";if("Episode"===currentItemType?(cssClass+=" backdropCard backdropCard-scalable",padderClass="cardPadder-backdrop"):"MusicAlbum"===currentItemType||"MusicArtist"===currentItemType?(cssClass+=" squareCard squareCard-scalable",padderClass="cardPadder-square"):(cssClass+=" portraitCard portraitCard-scalable",padderClass="cardPadder-portrait"),layoutManager.tv&&!browser.slow&&(cardBoxCssClass+=" cardBox-focustransform"),cardBoxCssClass+=" card-focuscontent cardBox-bottompadded",html+='"}function getSearchImageDisplayUrl(url,provider){return getApiClient().getUrl("Items/RemoteSearch/Image",{imageUrl:url,ProviderName:provider})}function submitIdentficationResult(page){loading.show();var options={ReplaceAllImages:page.querySelector("#chkIdentifyReplaceImages").checked},apiClient=getApiClient();apiClient.ajax({type:"POST",url:apiClient.getUrl("Items/RemoteSearch/Apply/"+currentItem.Id,options),data:JSON.stringify(currentSearchResult),contentType:"application/json"}).then(function(){hasChanges=!0,loading.hide(),dialogHelper.close(page)},function(){loading.hide(),dialogHelper.close(page)})}function showIdentificationForm(page,item){var apiClient=getApiClient();apiClient.getJSON(apiClient.getUrl("Items/"+item.Id+"/ExternalIdInfos")).then(function(idList){for(var html="",providerIds=item.ProviderIds||{},i=0,length=idList.length;i';var idLabel=globalize.translate("sharedcomponents#LabelDynamicExternalId").replace("{0}",idInfo.Name);idInfo.Key;html+='',html+="
"}page.querySelector("#txtLookupName").value="","Person"===item.Type||"BoxSet"===item.Type?(page.querySelector(".fldLookupYear").classList.add("hide"),page.querySelector("#txtLookupYear").value=""):(page.querySelector(".fldLookupYear").classList.remove("hide"),page.querySelector("#txtLookupYear").value=""),page.querySelector(".identifyProviderIds").innerHTML=html,page.querySelector(".formDialogHeaderTitle").innerHTML=globalize.translate("sharedcomponents#Identify")})}function showEditor(itemId){loading.show(),require(["text!./itemidentifier.template.html"],function(template){var apiClient=getApiClient();apiClient.getItem(apiClient.getCurrentUserId(),itemId).then(function(item){currentItem=item,currentItemType=currentItem.Type;var dialogOptions={size:"fullscreen-border",removeOnClose:!0,scrollY:!1};layoutManager.tv&&(dialogOptions.size="fullscreen");var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.classList.add("recordingDialog");var html="";html+=globalize.translateDocument(template,"sharedcomponents"),dlg.innerHTML=html,dlg.addEventListener("close",onDialogClosed),layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1),dialogHelper.open(dlg),dlg.querySelector(".popupIdentifyForm").addEventListener("submit",function(e){return e.preventDefault(),searchForIdentificationResults(dlg),!1}),dlg.querySelector(".identifyOptionsForm").addEventListener("submit",function(e){return e.preventDefault(),submitIdentficationResult(dlg),!1}),dlg.querySelector(".btnCancel").addEventListener("click",function(e){dialogHelper.close(dlg)}),dlg.classList.add("identifyDialog"),showIdentificationForm(dlg,item),loading.hide()})})}function onDialogClosed(){loading.hide(),hasChanges?currentResolve():currentReject()}function showEditorFindNew(itemName,itemYear,itemType,resolveFunc){currentItem=null,currentItemType=itemType,require(["text!./itemidentifier.template.html"],function(template){var dialogOptions={size:"fullscreen-border",removeOnClose:!0,scrollY:!1};layoutManager.tv&&(dialogOptions.size="fullscreen");var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.classList.add("recordingDialog");var html="";html+=globalize.translateDocument(template,"sharedcomponents"),dlg.innerHTML=html,layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1),dialogHelper.open(dlg),dlg.querySelector(".btnCancel").addEventListener("click",function(e){dialogHelper.close(dlg)}),dlg.querySelector(".popupIdentifyForm").addEventListener("submit",function(e){return e.preventDefault(),searchForIdentificationResults(dlg),!1}),dlg.addEventListener("close",function(){loading.hide(),resolveFunc(hasChanges?currentSearchResult:null)}),dlg.classList.add("identifyDialog"),showIdentificationFormFindNew(dlg,itemName,itemYear,itemType)})}function showIdentificationFormFindNew(dlg,itemName,itemYear,itemType){dlg.querySelector("#txtLookupName").value=itemName,"Person"===itemType||"BoxSet"===itemType?(dlg.querySelector(".fldLookupYear").classList.add("hide"),dlg.querySelector("#txtLookupYear").value=""):(dlg.querySelector(".fldLookupYear").classList.remove("hide"),dlg.querySelector("#txtLookupYear").value=itemYear),dlg.querySelector(".formDialogHeaderTitle").innerHTML=globalize.translate("sharedcomponents#Search")}var currentItem,currentItemType,currentServerId,currentResolve,currentReject,currentSearchResult,hasChanges=!1;return{show:function(itemId,serverId){return new Promise(function(resolve,reject){currentResolve=resolve,currentReject=reject,currentServerId=serverId,hasChanges=!1,showEditor(itemId)})},showFindNew:function(itemName,itemYear,itemType,serverId){return new Promise(function(resolve,reject){currentServerId=serverId,hasChanges=!1,showEditorFindNew(itemName,itemYear,itemType,resolve)})}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemsrefresher.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemsrefresher.js index 8d2e9a603e..39eb3cca77 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemsrefresher.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/itemsrefresher.js @@ -1 +1 @@ -define(["playbackManager","serverNotifications","events"],function(playbackManager,serverNotifications,events){"use strict";function onUserDataChanged(e,apiClient,userData){var instance=this,eventsToMonitor=getEventsToMonitor(instance);eventsToMonitor.indexOf("markfavorite")!==-1?instance.notifyRefreshNeeded():eventsToMonitor.indexOf("markplayed")!==-1&&instance.notifyRefreshNeeded()}function getEventsToMonitor(instance){var options=instance.options,monitor=options?options.monitorEvents:null;return monitor?monitor.split(","):[]}function onTimerCreated(e,apiClient,data){var instance=this;if(getEventsToMonitor(instance).indexOf("timers")!==-1)return void instance.notifyRefreshNeeded()}function onSeriesTimerCreated(e,apiClient,data){var instance=this;if(getEventsToMonitor(instance).indexOf("seriestimers")!==-1)return void instance.notifyRefreshNeeded()}function onTimerCancelled(e,apiClient,data){var instance=this;if(getEventsToMonitor(instance).indexOf("timers")!==-1)return void instance.notifyRefreshNeeded()}function onSeriesTimerCancelled(e,apiClient,data){var instance=this;if(getEventsToMonitor(instance).indexOf("seriestimers")!==-1)return void instance.notifyRefreshNeeded()}function onLibraryChanged(e,apiClient,data){var instance=this,eventsToMonitor=getEventsToMonitor(instance);if(eventsToMonitor.indexOf("seriestimers")===-1&&eventsToMonitor.indexOf("timers")===-1){var itemsAdded=data.ItemsAdded||[],itemsRemoved=data.ItemsRemoved||[];if(itemsAdded.length||itemsRemoved.length){var options=instance.options||{},parentId=options.parentId;if(parentId){var foldersAddedTo=data.FoldersAddedTo||[],foldersRemovedFrom=data.FoldersRemovedFrom||[],collectionFolders=data.CollectionFolders||[];if(foldersAddedTo.indexOf(parentId)===-1&&foldersRemovedFrom.indexOf(parentId)===-1&&collectionFolders.indexOf(parentId)===-1)return}instance.notifyRefreshNeeded()}}}function onPlaybackStopped(e,stopInfo){var instance=this,state=stopInfo.state,eventsToMonitor=getEventsToMonitor(instance);if(state.NowPlayingItem&&"Video"===state.NowPlayingItem.MediaType){if(eventsToMonitor.indexOf("videoplayback")!==-1)return void instance.notifyRefreshNeeded(!0)}else if(state.NowPlayingItem&&"Audio"===state.NowPlayingItem.MediaType&&eventsToMonitor.indexOf("audioplayback")!==-1)return void instance.notifyRefreshNeeded(!0)}function addNotificationEvent(instance,name,handler,owner){var localHandler=handler.bind(instance);owner=owner||serverNotifications,events.on(owner,name,localHandler),instance["event_"+name]=localHandler}function removeNotificationEvent(instance,name,owner){var handler=instance["event_"+name];handler&&(owner=owner||serverNotifications,events.off(owner,name,handler),instance["event_"+name]=null)}function ItemsRefresher(options){this.options=options||{},addNotificationEvent(this,"UserDataChanged",onUserDataChanged),addNotificationEvent(this,"TimerCreated",onTimerCreated),addNotificationEvent(this,"SeriesTimerCreated",onSeriesTimerCreated),addNotificationEvent(this,"TimerCancelled",onTimerCancelled),addNotificationEvent(this,"SeriesTimerCancelled",onSeriesTimerCancelled),addNotificationEvent(this,"LibraryChanged",onLibraryChanged),addNotificationEvent(this,"playbackstop",onPlaybackStopped,playbackManager)}function clearRefreshInterval(instance,isPausing){instance.refreshInterval&&(clearInterval(instance.refreshInterval),instance.refreshInterval=null,isPausing||(instance.refreshIntervalEndTime=null))}function resetRefreshInterval(instance,intervalMs){if(clearRefreshInterval(instance),!intervalMs){var options=instance.options;options&&(intervalMs=options.refreshIntervalMs)}intervalMs&&(instance.refreshInterval=setInterval(instance.notifyRefreshNeeded.bind(instance),intervalMs),instance.refreshIntervalEndTime=(new Date).getTime()+intervalMs)}function onDataFetched(result){resetRefreshInterval(this),this.afterRefresh&&this.afterRefresh(result)}return ItemsRefresher.prototype.pause=function(){clearRefreshInterval(this,!0),this.paused=!0},ItemsRefresher.prototype.resume=function(options){this.paused=!1;var refreshIntervalEndTime=this.refreshIntervalEndTime;if(refreshIntervalEndTime){var remainingMs=refreshIntervalEndTime-(new Date).getTime();remainingMs>0&&!this.needsRefresh?resetRefreshInterval(this,remainingMs):(this.needsRefresh=!0,this.refreshIntervalEndTime=null)}return this.needsRefresh||options&&options.refresh?this.refreshItems():Promise.resolve()},ItemsRefresher.prototype.refreshItems=function(){return this.fetchData?this.paused?(this.needsRefresh=!0,Promise.resolve()):(this.needsRefresh=!1,this.fetchData().then(onDataFetched.bind(this))):Promise.resolve()},ItemsRefresher.prototype.notifyRefreshNeeded=function(isInForeground){if(this.paused)return void(this.needsRefresh=!0);var timeout=this.refreshTimeout;timeout&&clearTimeout(timeout),isInForeground===!0?this.refreshItems():this.refreshTimeout=setTimeout(this.refreshItems.bind(this),1e4)},ItemsRefresher.prototype.destroy=function(){clearRefreshInterval(this),removeNotificationEvent(this,"UserDataChanged"),removeNotificationEvent(this,"TimerCreated"),removeNotificationEvent(this,"SeriesTimerCreated"),removeNotificationEvent(this,"TimerCancelled"),removeNotificationEvent(this,"SeriesTimerCancelled"),removeNotificationEvent(this,"LibraryChanged"),removeNotificationEvent(this,"playbackstop",playbackManager),this.fetchData=null,this.options=null},ItemsRefresher}); \ No newline at end of file +define(["playbackManager","serverNotifications","events"],function(playbackManager,serverNotifications,events){"use strict";function onUserDataChanged(e,apiClient,userData){var instance=this,eventsToMonitor=getEventsToMonitor(instance);-1!==eventsToMonitor.indexOf("markfavorite")?instance.notifyRefreshNeeded():-1!==eventsToMonitor.indexOf("markplayed")&&instance.notifyRefreshNeeded()}function getEventsToMonitor(instance){var options=instance.options,monitor=options?options.monitorEvents:null;return monitor?monitor.split(","):[]}function onTimerCreated(e,apiClient,data){var instance=this;if(-1!==getEventsToMonitor(instance).indexOf("timers"))return void instance.notifyRefreshNeeded()}function onSeriesTimerCreated(e,apiClient,data){var instance=this;if(-1!==getEventsToMonitor(instance).indexOf("seriestimers"))return void instance.notifyRefreshNeeded()}function onTimerCancelled(e,apiClient,data){var instance=this;if(-1!==getEventsToMonitor(instance).indexOf("timers"))return void instance.notifyRefreshNeeded()}function onSeriesTimerCancelled(e,apiClient,data){var instance=this;if(-1!==getEventsToMonitor(instance).indexOf("seriestimers"))return void instance.notifyRefreshNeeded()}function onLibraryChanged(e,apiClient,data){var instance=this,eventsToMonitor=getEventsToMonitor(instance);if(-1===eventsToMonitor.indexOf("seriestimers")&&-1===eventsToMonitor.indexOf("timers")){var itemsAdded=data.ItemsAdded||[],itemsRemoved=data.ItemsRemoved||[];if(itemsAdded.length||itemsRemoved.length){var options=instance.options||{},parentId=options.parentId;if(parentId){var foldersAddedTo=data.FoldersAddedTo||[],foldersRemovedFrom=data.FoldersRemovedFrom||[],collectionFolders=data.CollectionFolders||[];if(-1===foldersAddedTo.indexOf(parentId)&&-1===foldersRemovedFrom.indexOf(parentId)&&-1===collectionFolders.indexOf(parentId))return}instance.notifyRefreshNeeded()}}}function onPlaybackStopped(e,stopInfo){var instance=this,state=stopInfo.state,eventsToMonitor=getEventsToMonitor(instance);if(state.NowPlayingItem&&"Video"===state.NowPlayingItem.MediaType){if(-1!==eventsToMonitor.indexOf("videoplayback"))return void instance.notifyRefreshNeeded(!0)}else if(state.NowPlayingItem&&"Audio"===state.NowPlayingItem.MediaType&&-1!==eventsToMonitor.indexOf("audioplayback"))return void instance.notifyRefreshNeeded(!0)}function addNotificationEvent(instance,name,handler,owner){var localHandler=handler.bind(instance);owner=owner||serverNotifications,events.on(owner,name,localHandler),instance["event_"+name]=localHandler}function removeNotificationEvent(instance,name,owner){var handler=instance["event_"+name];handler&&(owner=owner||serverNotifications,events.off(owner,name,handler),instance["event_"+name]=null)}function ItemsRefresher(options){this.options=options||{},addNotificationEvent(this,"UserDataChanged",onUserDataChanged),addNotificationEvent(this,"TimerCreated",onTimerCreated),addNotificationEvent(this,"SeriesTimerCreated",onSeriesTimerCreated),addNotificationEvent(this,"TimerCancelled",onTimerCancelled),addNotificationEvent(this,"SeriesTimerCancelled",onSeriesTimerCancelled),addNotificationEvent(this,"LibraryChanged",onLibraryChanged),addNotificationEvent(this,"playbackstop",onPlaybackStopped,playbackManager)}function clearRefreshInterval(instance,isPausing){instance.refreshInterval&&(clearInterval(instance.refreshInterval),instance.refreshInterval=null,isPausing||(instance.refreshIntervalEndTime=null))}function resetRefreshInterval(instance,intervalMs){if(clearRefreshInterval(instance),!intervalMs){var options=instance.options;options&&(intervalMs=options.refreshIntervalMs)}intervalMs&&(instance.refreshInterval=setInterval(instance.notifyRefreshNeeded.bind(instance),intervalMs),instance.refreshIntervalEndTime=(new Date).getTime()+intervalMs)}function onDataFetched(result){resetRefreshInterval(this),this.afterRefresh&&this.afterRefresh(result)}return ItemsRefresher.prototype.pause=function(){clearRefreshInterval(this,!0),this.paused=!0},ItemsRefresher.prototype.resume=function(options){this.paused=!1;var refreshIntervalEndTime=this.refreshIntervalEndTime;if(refreshIntervalEndTime){var remainingMs=refreshIntervalEndTime-(new Date).getTime();remainingMs>0&&!this.needsRefresh?resetRefreshInterval(this,remainingMs):(this.needsRefresh=!0,this.refreshIntervalEndTime=null)}return this.needsRefresh||options&&options.refresh?this.refreshItems():Promise.resolve()},ItemsRefresher.prototype.refreshItems=function(){return this.fetchData?this.paused?(this.needsRefresh=!0,Promise.resolve()):(this.needsRefresh=!1,this.fetchData().then(onDataFetched.bind(this))):Promise.resolve()},ItemsRefresher.prototype.notifyRefreshNeeded=function(isInForeground){if(this.paused)return void(this.needsRefresh=!0);var timeout=this.refreshTimeout;timeout&&clearTimeout(timeout),!0===isInForeground?this.refreshItems():this.refreshTimeout=setTimeout(this.refreshItems.bind(this),1e4)},ItemsRefresher.prototype.destroy=function(){clearRefreshInterval(this),removeNotificationEvent(this,"UserDataChanged"),removeNotificationEvent(this,"TimerCreated"),removeNotificationEvent(this,"SeriesTimerCreated"),removeNotificationEvent(this,"TimerCancelled"),removeNotificationEvent(this,"SeriesTimerCancelled"),removeNotificationEvent(this,"LibraryChanged"),removeNotificationEvent(this,"playbackstop",playbackManager),this.fetchData=null,this.options=null},ItemsRefresher}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/layoutmanager.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/layoutmanager.js index 228dcfc2f1..b7576ab69a 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/layoutmanager.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/layoutmanager.js @@ -1 +1 @@ -define(["browser","appSettings","events"],function(browser,appSettings,events){"use strict";function setLayout(instance,layout,selectedLayout){layout===selectedLayout?(instance[layout]=!0,document.documentElement.classList.add("layout-"+layout)):(instance[layout]=!1,document.documentElement.classList.remove("layout-"+layout))}function LayoutManager(){}return LayoutManager.prototype.setLayout=function(layout,save){layout&&"auto"!==layout?(setLayout(this,"mobile",layout),setLayout(this,"tv",layout),setLayout(this,"desktop",layout),save!==!1&&appSettings.set("layout",layout)):(this.autoLayout(),save!==!1&&appSettings.set("layout","")),events.trigger(this,"modechange")},LayoutManager.prototype.getSavedLayout=function(layout){return appSettings.get("layout")},LayoutManager.prototype.autoLayout=function(){browser.mobile?this.setLayout("mobile",!1):browser.tv||browser.xboxOne?this.setLayout("tv",!1):this.setLayout(this.defaultLayout||"tv",!1)},LayoutManager.prototype.init=function(){var saved=this.getSavedLayout();saved?this.setLayout(saved,!1):this.autoLayout()},new LayoutManager}); \ No newline at end of file +define(["browser","appSettings","events"],function(browser,appSettings,events){"use strict";function setLayout(instance,layout,selectedLayout){layout===selectedLayout?(instance[layout]=!0,document.documentElement.classList.add("layout-"+layout)):(instance[layout]=!1,document.documentElement.classList.remove("layout-"+layout))}function LayoutManager(){}return LayoutManager.prototype.setLayout=function(layout,save){layout&&"auto"!==layout?(setLayout(this,"mobile",layout),setLayout(this,"tv",layout),setLayout(this,"desktop",layout),!1!==save&&appSettings.set("layout",layout)):(this.autoLayout(),!1!==save&&appSettings.set("layout","")),events.trigger(this,"modechange")},LayoutManager.prototype.getSavedLayout=function(layout){return appSettings.get("layout")},LayoutManager.prototype.autoLayout=function(){browser.mobile?this.setLayout("mobile",!1):browser.tv||browser.xboxOne?this.setLayout("tv",!1):this.setLayout(this.defaultLayout||"tv",!1)},LayoutManager.prototype.init=function(){var saved=this.getSavedLayout();saved?this.setLayout(saved,!1):this.autoLayout()},new LayoutManager}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/lazyloader/lazyloader-intersectionobserver.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/lazyloader/lazyloader-intersectionobserver.js index 76a92b5669..c165d67ec9 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/lazyloader/lazyloader-intersectionobserver.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/lazyloader/lazyloader-intersectionobserver.js @@ -1 +1 @@ -define(["require","browser"],function(require,browser){"use strict";function LazyLoader(options){this.options=options}function unveilElements(elements,root,callback){if(elements.length){var lazyLoader=new LazyLoader({callback:callback});lazyLoader.addElements(elements)}}return browser.edge&&require(["css!./lazyedgehack"]),LazyLoader.prototype.createObserver=function(){var observerOptions={},options=this.options,loadedCount=0,callback=options.callback;observerOptions.rootMargin="10%";var observerId="obs"+(new Date).getTime(),self=this,observer=new IntersectionObserver(function(entries){for(var j=0,length2=entries.length;j0){var target=entry.target;observer.unobserve(target),target[observerId]||(target[observerId]=1,callback(target),loadedCount++,loadedCount>=self.elementCount&&self.destroyObserver())}}},observerOptions);this.observer=observer},LazyLoader.prototype.addElements=function(elements){var observer=this.observer;observer||(this.createObserver(),observer=this.observer),this.elementCount=(this.elementCount||0)+elements.length;for(var i=0,length=elements.length;i0){var target=entry.target;observer.unobserve(target),target[observerId]||(target[observerId]=1,callback(target),++loadedCount>=self.elementCount&&self.destroyObserver())}}},observerOptions);this.observer=observer},LazyLoader.prototype.addElements=function(elements){var observer=this.observer;observer||(this.createObserver(),observer=this.observer),this.elementCount=(this.elementCount||0)+elements.length;for(var i=0,length=elements.length;i=elements.length&&(dom.removeEventListener(document,"focus",unveil,{capture:!0,passive:!0}),dom.removeEventListener(document,"scroll",unveil,{capture:!0,passive:!0}),dom.removeEventListener(document,wheelEvent,unveil,{capture:!0,passive:!0}),dom.removeEventListener(window,"resize",unveil,{capture:!0,passive:!0}))}function unveil(){cancelAll(cancellationTokens);var index=cancellationTokens.length;cancellationTokens.length++,setTimeout(function(){unveilInternal(index)},1)}var unveiledElements=[],cancellationTokens=[],loadedCount=0;dom.addEventListener(document,"focus",unveil,{capture:!0,passive:!0}),dom.addEventListener(document,"scroll",unveil,{capture:!0,passive:!0}),dom.addEventListener(document,wheelEvent,unveil,{capture:!0,passive:!0}),dom.addEventListener(window,"resize",unveil,{capture:!0,passive:!0}),unveil()}function LazyLoader(options){this.options=options}function unveilElements(elements,root,callback){if(elements.length){var lazyLoader=new LazyLoader({callback:callback});lazyLoader.addElements(elements)}}var thresholdX,thresholdY;window.requestIdleCallback||function(fn){fn()};browser.iOS?(dom.addEventListener(window,"orientationchange",resetThresholdsOnTimer,{passive:!0}),dom.addEventListener(window,"resize",resetThresholdsOnTimer,{passive:!0})):(dom.addEventListener(window,"orientationchange",resetThresholds,{passive:!0}),dom.addEventListener(window,"resize",resetThresholds,{passive:!0})),resetThresholds();var wheelEvent=document.implementation.hasFeature("Event.wheel","3.0")?"wheel":"mousewheel";return LazyLoader.prototype.createObserver=function(){unveilElementsInternal(this,this.options.callback),this.observer=1},LazyLoader.prototype.addElements=function(elements){this.elements=this.elements||[];for(var i=0,length=elements.length;i=elements.length&&(dom.removeEventListener(document,"focus",unveil,{capture:!0,passive:!0}),dom.removeEventListener(document,"scroll",unveil,{capture:!0,passive:!0}),dom.removeEventListener(document,wheelEvent,unveil,{capture:!0,passive:!0}),dom.removeEventListener(window,"resize",unveil,{capture:!0,passive:!0}))}function unveil(){cancelAll(cancellationTokens);var index=cancellationTokens.length;cancellationTokens.length++,setTimeout(function(){unveilInternal(index)},1)}var unveiledElements=[],cancellationTokens=[],loadedCount=0;dom.addEventListener(document,"focus",unveil,{capture:!0,passive:!0}),dom.addEventListener(document,"scroll",unveil,{capture:!0,passive:!0}),dom.addEventListener(document,wheelEvent,unveil,{capture:!0,passive:!0}),dom.addEventListener(window,"resize",unveil,{capture:!0,passive:!0}),unveil()}function LazyLoader(options){this.options=options}function unveilElements(elements,root,callback){if(elements.length){new LazyLoader({callback:callback}).addElements(elements)}}var thresholdX,thresholdY;window.requestIdleCallback;browser.iOS?(dom.addEventListener(window,"orientationchange",resetThresholdsOnTimer,{passive:!0}),dom.addEventListener(window,"resize",resetThresholdsOnTimer,{passive:!0})):(dom.addEventListener(window,"orientationchange",resetThresholds,{passive:!0}),dom.addEventListener(window,"resize",resetThresholds,{passive:!0})),resetThresholds();var wheelEvent=document.implementation.hasFeature("Event.wheel","3.0")?"wheel":"mousewheel";return LazyLoader.prototype.createObserver=function(){unveilElementsInternal(this,this.options.callback),this.observer=1},LazyLoader.prototype.addElements=function(elements){this.elements=this.elements||[];for(var i=0,length=elements.length;i90?"#":name.toUpperCase()):0===sortBy.indexOf("officialrating")?item.OfficialRating||globalize.translate("sharedcomponents#Unrated"):0===sortBy.indexOf("communityrating")?null==item.CommunityRating?globalize.translate("sharedcomponents#Unrated"):Math.floor(item.CommunityRating):0===sortBy.indexOf("criticrating")?null==item.CriticRating?globalize.translate("sharedcomponents#Unrated"):Math.floor(item.CriticRating):0===sortBy.indexOf("albumartist")&&item.AlbumArtist?(name=item.AlbumArtist[0].toUpperCase(),code=name.charCodeAt(0),code<65||code>90?"#":name.toUpperCase()):""}function getImageUrl(item,width){var apiClient=connectionManager.getApiClient(item.ServerId),options={width:width,type:"Primary"};return item.ImageTags&&item.ImageTags.Primary?(options.tag=item.ImageTags.Primary,apiClient.getScaledImageUrl(item.Id,options)):item.AlbumId&&item.AlbumPrimaryImageTag?(options.tag=item.AlbumPrimaryImageTag,apiClient.getScaledImageUrl(item.AlbumId,options)):item.SeriesId&&item.SeriesPrimaryImageTag?(options.tag=item.SeriesPrimaryImageTag,apiClient.getScaledImageUrl(item.SeriesId,options)):item.ParentPrimaryImageTag?(options.tag=item.ParentPrimaryImageTag,apiClient.getScaledImageUrl(item.ParentPrimaryImageItemId,options)):null}function getChannelImageUrl(item,width){var apiClient=connectionManager.getApiClient(item.ServerId),options={width:width,type:"Primary"};return item.ChannelId&&item.ChannelPrimaryImageTag?(options.tag=item.ChannelPrimaryImageTag,apiClient.getScaledImageUrl(item.ChannelId,options)):null}function getTextLinesHtml(textlines,isLargeStyle){for(var html="",largeTitleTagName=layoutManager.tv?"h2":"div",i=0,length=textlines.length;i':'
':'
',html+=textlines[i]||" ",html+=0===i&&isLargeStyle?"":"
")}return html}function getRightButtonsHtml(options){for(var html="",i=0,length=options.rightButtons.length;i'+button.icon+""}return html}function getListViewHtml(options){for(var items=options.items,groupTitle="",action=options.action||"link",isLargeStyle="large"===options.imageSize,enableOverview=options.enableOverview,clickEntireItem=!!layoutManager.tv,outerTagName=clickEntireItem?"button":"div",enableSideMediaInfo=null==options.enableSideMediaInfo||options.enableSideMediaInfo,outerHtml="",enableContentWrapper=options.enableOverview&&!layoutManager.tv,containerAlbumArtists=options.containerAlbumArtists||[],i=0,length=items.length;i"),html+=0===i?'

':'

',html+=itemGroupTitle,html+="

",html+="
",groupTitle=itemGroupTitle)}var cssClass="listItem";options.highlight!==!1&&(cssClass+=" listItem-shaded"),options.border&&(cssClass+=" listItem-border"),clickEntireItem&&(cssClass+=" itemAction listItem-button"),layoutManager.tv&&(cssClass+=" listItem-focusscale");var downloadWidth=80;isLargeStyle&&(cssClass+=" listItem-largeImage",downloadWidth=500);var playlistItemId=item.PlaylistItemId?' data-playlistitemid="'+item.PlaylistItemId+'"':"",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+'"':"";if(enableContentWrapper&&(cssClass+=" listItem-withContentWrapper"),html+="<"+outerTagName+' class="'+cssClass+'"'+playlistItemId+' data-action="'+action+'" data-isfolder="'+item.IsFolder+'" data-id="'+item.Id+'" data-serverid="'+item.ServerId+'" data-type="'+item.Type+'"'+mediaTypeData+collectionTypeData+channelIdData+positionTicksData+collectionIdData+playlistIdData+">",enableContentWrapper&&(html+='
'),!clickEntireItem&&options.dragHandle&&(html+=''),options.image!==!1){var imgUrl="channel"===options.imageSource?getChannelImageUrl(item,downloadWidth):getImageUrl(item,downloadWidth);console.log(imgUrl);var imageClass=isLargeStyle?"listItemImage listItemImage-large":"listItemImage";isLargeStyle&&layoutManager.tv&&(imageClass+=" listItemImage-large-tv");var playOnImageClick=options.imagePlayButton&&!layoutManager.tv;clickEntireItem||(imageClass+=" itemAction");var imageAction=playOnImageClick?"resume":action;html+=imgUrl?'
':'
';var indicatorsHtml="";indicatorsHtml+=indicators.getPlayedIndicatorHtml(item),indicatorsHtml&&(html+='
'+indicatorsHtml+"
"),playOnImageClick&&(html+='');var progressHtml=indicators.getProgressBarHtml(item,{containerClass:"listItemProgressBar"});progressHtml&&(html+=progressHtml),html+="
"}var textlines=[];options.showProgramDateTime&&textlines.push(datetime.toLocaleString(datetime.parseISO8601Date(item.StartDate),{weekday:"long",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})),options.showProgramTime&&textlines.push(datetime.getDisplayTime(datetime.parseISO8601Date(item.StartDate))),options.showChannel&&item.ChannelName&&textlines.push(item.ChannelName);var parentTitle=null;options.showParentTitle&&("Episode"===item.Type?parentTitle=item.SeriesName:(item.IsSeries||item.EpisodeTitle&&item.Name)&&(parentTitle=item.Name));var displayName=itemHelper.getDisplayName(item,{includeParentInfo:options.includeParentInfoInTitle});if(options.showIndexNumber&&null!=item.IndexNumber&&(displayName=item.IndexNumber+". "+displayName),options.showParentTitle&&options.parentTitleWithTitle?(displayName&&(parentTitle&&(parentTitle+=" - "),parentTitle=(parentTitle||"")+displayName),textlines.push(parentTitle||"")):options.showParentTitle&&textlines.push(parentTitle||""),displayName&&!options.parentTitleWithTitle&&textlines.push(displayName),item.IsFolder)options.artist!==!1&&item.AlbumArtist&&"MusicAlbum"===item.Type&&textlines.push(item.AlbumArtist);else{var showArtist=options.artist===!0;showArtist||options.artist===!1||(showArtist=containerAlbumArtists.length>1||(item.Artists||[])[0]!==containerAlbumArtists[0]),showArtist&&item.ArtistItems&&"MusicAlbum"!==item.Type&&textlines.push(item.ArtistItems.map(function(a){return a.Name}).join(", "))}"Game"===item.Type&&textlines.push(item.GameSystem),"TvChannel"===item.Type&&item.CurrentProgram&&textlines.push(itemHelper.getDisplayName(item.CurrentProgram)),cssClass="listItemBody",clickEntireItem||(cssClass+=" itemAction"),options.image===!1&&(cssClass+=" itemAction listItemBody-noleftpadding"),html+='
';var moreIcon="dots-horiz"===appHost.moreIcon?"":"";if(html+=getTextLinesHtml(textlines,isLargeStyle),options.mediaInfo!==!1&&!enableSideMediaInfo){var mediaInfoClass="secondary listItemMediaInfo listItemBodyText";html+='
'+mediaInfo.getPrimaryMediaInfoHtml(item,{episodeTitle:!1,originalAirDate:!1,subtitles:!1})+"
"}if(enableOverview&&item.Overview&&(html+='
',html+=item.Overview,html+="
"),html+="
",options.mediaInfo!==!1&&enableSideMediaInfo&&(html+='
'+mediaInfo.getPrimaryMediaInfoHtml(item,{year:!1,container:!1,episodeTitle:!1,criticRating:!1,endsAt:!1})+"
"),options.recordButton||"Timer"!==item.Type&&"Program"!==item.Type||(html+=indicators.getTimerIndicator(item).replace("indicatorIcon","indicatorIcon listItemAside")),!clickEntireItem&&(options.addToListButton&&(html+=''),options.moreButton!==!1&&(html+='"),options.infoButton&&(html+=''),options.rightButtons&&(html+=getRightButtonsHtml(options)),options.enableUserDataButtons!==!1)){html+='';var userData=item.UserData||{},likes=null==userData.Likes?"":userData.Likes;itemHelper.canMarkPlayed(item)&&(html+=''),itemHelper.canRate(item)&&(html+=''),html+=""}enableContentWrapper&&(html+="
",enableOverview&&item.Overview&&(html+='
',html+=item.Overview,html+="
")),html+="",outerHtml+=html}return outerHtml}return{getListViewHtml:getListViewHtml}}); \ No newline at end of file +define(["itemHelper","mediaInfo","indicators","connectionManager","layoutManager","globalize","datetime","apphost","css!./listview","emby-ratingbutton","emby-playstatebutton"],function(itemHelper,mediaInfo,indicators,connectionManager,layoutManager,globalize,datetime,appHost){"use strict";function getIndex(item,options){if("disc"===options.index)return null==item.ParentIndexNumber?"":globalize.translate("sharedcomponents#ValueDiscNumber",item.ParentIndexNumber);var code,name,sortBy=(options.sortBy||"").toLowerCase();return 0===sortBy.indexOf("sortname")?"Episode"===item.Type?"":(name=(item.SortName||item.Name||"?")[0].toUpperCase(),code=name.charCodeAt(0),code<65||code>90?"#":name.toUpperCase()):0===sortBy.indexOf("officialrating")?item.OfficialRating||globalize.translate("sharedcomponents#Unrated"):0===sortBy.indexOf("communityrating")?null==item.CommunityRating?globalize.translate("sharedcomponents#Unrated"):Math.floor(item.CommunityRating):0===sortBy.indexOf("criticrating")?null==item.CriticRating?globalize.translate("sharedcomponents#Unrated"):Math.floor(item.CriticRating):0===sortBy.indexOf("albumartist")&&item.AlbumArtist?(name=item.AlbumArtist[0].toUpperCase(),code=name.charCodeAt(0),code<65||code>90?"#":name.toUpperCase()):""}function getImageUrl(item,width){var apiClient=connectionManager.getApiClient(item.ServerId),options={width:width,type:"Primary"};return item.ImageTags&&item.ImageTags.Primary?(options.tag=item.ImageTags.Primary,apiClient.getScaledImageUrl(item.Id,options)):item.AlbumId&&item.AlbumPrimaryImageTag?(options.tag=item.AlbumPrimaryImageTag,apiClient.getScaledImageUrl(item.AlbumId,options)):item.SeriesId&&item.SeriesPrimaryImageTag?(options.tag=item.SeriesPrimaryImageTag,apiClient.getScaledImageUrl(item.SeriesId,options)):item.ParentPrimaryImageTag?(options.tag=item.ParentPrimaryImageTag,apiClient.getScaledImageUrl(item.ParentPrimaryImageItemId,options)):null}function getChannelImageUrl(item,width){var apiClient=connectionManager.getApiClient(item.ServerId),options={width:width,type:"Primary"};return item.ChannelId&&item.ChannelPrimaryImageTag?(options.tag=item.ChannelPrimaryImageTag,apiClient.getScaledImageUrl(item.ChannelId,options)):null}function getTextLinesHtml(textlines,isLargeStyle){for(var html="",largeTitleTagName=layoutManager.tv?"h2":"div",i=0,length=textlines.length;i':'
':'
',html+=textlines[i]||" ",html+=0===i&&isLargeStyle?"":"
")}return html}function getRightButtonsHtml(options){for(var html="",i=0,length=options.rightButtons.length;i'+button.icon+""}return html}function getListViewHtml(options){for(var items=options.items,groupTitle="",action=options.action||"link",isLargeStyle="large"===options.imageSize,enableOverview=options.enableOverview,clickEntireItem=!!layoutManager.tv,outerTagName=clickEntireItem?"button":"div",enableSideMediaInfo=null==options.enableSideMediaInfo||options.enableSideMediaInfo,outerHtml="",enableContentWrapper=options.enableOverview&&!layoutManager.tv,containerAlbumArtists=options.containerAlbumArtists||[],i=0,length=items.length;i"),html+=0===i?'

':'

',html+=itemGroupTitle,html+="

",html+="
",groupTitle=itemGroupTitle)}var cssClass="listItem";!1!==options.highlight&&(cssClass+=" listItem-shaded"),options.border&&(cssClass+=" listItem-border"),clickEntireItem&&(cssClass+=" itemAction listItem-button"),layoutManager.tv&&(cssClass+=" listItem-focusscale");var downloadWidth=80;isLargeStyle&&(cssClass+=" listItem-largeImage",downloadWidth=500);var playlistItemId=item.PlaylistItemId?' data-playlistitemid="'+item.PlaylistItemId+'"':"",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+'"':"";if(enableContentWrapper&&(cssClass+=" listItem-withContentWrapper"),html+="<"+outerTagName+' class="'+cssClass+'"'+playlistItemId+' data-action="'+action+'" data-isfolder="'+item.IsFolder+'" data-id="'+item.Id+'" data-serverid="'+item.ServerId+'" data-type="'+item.Type+'"'+mediaTypeData+collectionTypeData+channelIdData+positionTicksData+collectionIdData+playlistIdData+">",enableContentWrapper&&(html+='
'),!clickEntireItem&&options.dragHandle&&(html+=''),!1!==options.image){var imgUrl="channel"===options.imageSource?getChannelImageUrl(item,downloadWidth):getImageUrl(item,downloadWidth);console.log(imgUrl);var imageClass=isLargeStyle?"listItemImage listItemImage-large":"listItemImage";isLargeStyle&&layoutManager.tv&&(imageClass+=" listItemImage-large-tv");var playOnImageClick=options.imagePlayButton&&!layoutManager.tv;clickEntireItem||(imageClass+=" itemAction");var imageAction=playOnImageClick?"resume":action;html+=imgUrl?'
':'
';var indicatorsHtml="";indicatorsHtml+=indicators.getPlayedIndicatorHtml(item),indicatorsHtml&&(html+='
'+indicatorsHtml+"
"),playOnImageClick&&(html+='');var progressHtml=indicators.getProgressBarHtml(item,{containerClass:"listItemProgressBar"});progressHtml&&(html+=progressHtml),html+="
"}var textlines=[];options.showProgramDateTime&&textlines.push(datetime.toLocaleString(datetime.parseISO8601Date(item.StartDate),{weekday:"long",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})),options.showProgramTime&&textlines.push(datetime.getDisplayTime(datetime.parseISO8601Date(item.StartDate))),options.showChannel&&item.ChannelName&&textlines.push(item.ChannelName);var parentTitle=null;options.showParentTitle&&("Episode"===item.Type?parentTitle=item.SeriesName:(item.IsSeries||item.EpisodeTitle&&item.Name)&&(parentTitle=item.Name));var displayName=itemHelper.getDisplayName(item,{includeParentInfo:options.includeParentInfoInTitle});if(options.showIndexNumber&&null!=item.IndexNumber&&(displayName=item.IndexNumber+". "+displayName),options.showParentTitle&&options.parentTitleWithTitle?(displayName&&(parentTitle&&(parentTitle+=" - "),parentTitle=(parentTitle||"")+displayName),textlines.push(parentTitle||"")):options.showParentTitle&&textlines.push(parentTitle||""),displayName&&!options.parentTitleWithTitle&&textlines.push(displayName),item.IsFolder)!1!==options.artist&&item.AlbumArtist&&"MusicAlbum"===item.Type&&textlines.push(item.AlbumArtist);else{var showArtist=!0===options.artist;showArtist||!1===options.artist||(showArtist=containerAlbumArtists.length>1||(item.Artists||[])[0]!==containerAlbumArtists[0]),showArtist&&item.ArtistItems&&"MusicAlbum"!==item.Type&&textlines.push(item.ArtistItems.map(function(a){return a.Name}).join(", "))}"Game"===item.Type&&textlines.push(item.GameSystem),"TvChannel"===item.Type&&item.CurrentProgram&&textlines.push(itemHelper.getDisplayName(item.CurrentProgram)),cssClass="listItemBody",clickEntireItem||(cssClass+=" itemAction"),!1===options.image&&(cssClass+=" itemAction listItemBody-noleftpadding"),html+='
';var moreIcon="dots-horiz"===appHost.moreIcon?"":"";if(html+=getTextLinesHtml(textlines,isLargeStyle),!1!==options.mediaInfo&&!enableSideMediaInfo){html+='
'+mediaInfo.getPrimaryMediaInfoHtml(item,{episodeTitle:!1,originalAirDate:!1,subtitles:!1})+"
"}if(enableOverview&&item.Overview&&(html+='
',html+=item.Overview,html+="
"),html+="
",!1!==options.mediaInfo&&enableSideMediaInfo&&(html+='
'+mediaInfo.getPrimaryMediaInfoHtml(item,{year:!1,container:!1,episodeTitle:!1,criticRating:!1,endsAt:!1})+"
"),options.recordButton||"Timer"!==item.Type&&"Program"!==item.Type||(html+=indicators.getTimerIndicator(item).replace("indicatorIcon","indicatorIcon listItemAside")),!clickEntireItem&&(options.addToListButton&&(html+=''),!1!==options.moreButton&&(html+='"),options.infoButton&&(html+=''),options.rightButtons&&(html+=getRightButtonsHtml(options)),!1!==options.enableUserDataButtons)){html+='';var userData=item.UserData||{},likes=null==userData.Likes?"":userData.Likes;itemHelper.canMarkPlayed(item)&&(html+=''),itemHelper.canRate(item)&&(html+=''),html+=""}enableContentWrapper&&(html+="
",enableOverview&&item.Overview&&(html+='
',html+=item.Overview,html+="
")),html+="",outerHtml+=html}return outerHtml}return{getListViewHtml:getListViewHtml}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/loadingdialog/loadingdialog.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/loadingdialog/loadingdialog.js new file mode 100644 index 0000000000..f2f01fe2fc --- /dev/null +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/loadingdialog/loadingdialog.js @@ -0,0 +1 @@ +define(["loading","events","dialogHelper","dom","layoutManager","scrollHelper","globalize","require","material-icons","emby-button","paper-icon-button-light","emby-input","formDialogStyle","flexStyles"],function(loading,events,dialogHelper,dom,layoutManager,scrollHelper,globalize,require){"use strict";function showDialog(instance,options,template){var dialogOptions={removeOnClose:!0,scrollY:!1},enableTvLayout=layoutManager.tv;enableTvLayout&&(dialogOptions.size="fullscreen");var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.innerHTML=globalize.translateHtml(template,"sharedcomponents"),dlg.classList.add("align-items-center"),dlg.classList.add("justify-items-center");var formDialogContent=dlg.querySelector(".formDialogContent");return formDialogContent.style["flex-grow"]="initial",formDialogContent.style["max-width"]="50%",formDialogContent.style["max-height"]="60%",enableTvLayout?(scrollHelper.centerFocus.on(formDialogContent,!1),dlg.querySelector(".formDialogHeader").style.marginTop="15%"):dlg.classList.add("dialog-fullscreen-lowres"),dlg.querySelector(".formDialogHeaderTitle").innerHTML=options.title,dlg.querySelector(".text").innerHTML=options.text,instance.dlg=dlg,dialogHelper.open(dlg).then(function(){enableTvLayout&&scrollHelper.centerFocus.off(dlg.querySelector(".formDialogContent"),!1),loading.hide()})}function LoadingDialog(options){this.options=options}return LoadingDialog.prototype.show=function(){var instance=this;return loading.show(),new Promise(function(resolve,reject){require(["text!./../dialog/dialog.template.html"],function(template){showDialog(instance,instance.options,template),resolve()})})},LoadingDialog.prototype.setTitle=function(title){},LoadingDialog.prototype.setText=function(text){},LoadingDialog.prototype.hide=function(){this.dlg&&(dialogHelper.close(this.dlg),this.dlg=null)},LoadingDialog.prototype.destroy=function(){this.dlg=null,this.options=null},LoadingDialog}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/maintabsmanager.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/maintabsmanager.js index 5ad19669fb..b5049b5c72 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/maintabsmanager.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/maintabsmanager.js @@ -1 +1 @@ -define(["dom","browser","events","emby-tabs","emby-button","emby-linkbutton"],function(dom,browser,events){"use strict";function enableTabsInFooter(){return!1}function ensureElements(enableInFooter){enableInFooter&&(footerTabsContainer||(footerTabsContainer=document.createElement("div"),footerTabsContainer.classList.add("footerTabs"),footerTabsContainer.classList.add("sectionTabs"),footerTabsContainer.classList.add("hide"))),headerTabsContainer||(headerTabsContainer=queryScope.querySelector(".headerTabs"))}function onViewTabsReady(){this.selectedIndex(this.readySelectedIndex),this.readySelectedIndex=null}function allowSwipe(target){function allowSwipeOn(elem){if(dom.parentWithTag(elem,"input"))return!1;var classList=elem.classList;return!classList||!classList.contains("scrollX")&&!classList.contains("animatedScrollX")}for(var parent=target;null!=parent;){if(!allowSwipeOn(parent))return!1;parent=parent.parentNode}return!0}function configureSwipeTabs(view,tabsElem,getTabContainersFn){if(browser.touch){var onSwipeLeft=(getTabContainersFn().length,function(e,target){allowSwipe(target)&&view.contains(target)&&tabsElem.selectNext()}),onSwipeRight=function(e,target){allowSwipe(target)&&view.contains(target)&&tabsElem.selectPrevious()};require(["touchHelper"],function(TouchHelper){var touchHelper=new TouchHelper(view.parentNode.parentNode);events.on(touchHelper,"swipeleft",onSwipeLeft),events.on(touchHelper,"swiperight",onSwipeRight),view.addEventListener("viewdestroy",function(){touchHelper.destroy()})})}}function setTabs(view,selectedIndex,getTabsFn,getTabContainersFn,onBeforeTabChange,onTabChange,setSelectedIndex){var enableInFooter=enableTabsInFooter();if(!view)return tabOwnerView&&(headerTabsContainer||(headerTabsContainer=queryScope.querySelector(".headerTabs")),ensureElements(enableInFooter),document.body.classList.remove("withSectionTabs"),headerTabsContainer.innerHTML="",headerTabsContainer.classList.add("hide"),footerTabsContainer&&(footerTabsContainer.innerHTML="",footerTabsContainer.classList.add("hide")),tabOwnerView=null),{tabsContainer:headerTabsContainer,replaced:!1};ensureElements(enableInFooter);var tabsContainerElem=enableInFooter?footerTabsContainer:headerTabsContainer;if(tabOwnerView||tabsContainerElem.classList.remove("hide"),tabOwnerView!==view){var index=0,indexAttribute=null==selectedIndex?"":' data-index="'+selectedIndex+'"',tabsHtml='
'+getTabsFn().map(function(t){var tabClass="emby-tab-button";t.enabled===!1&&(tabClass+=" hide");var tabHtml;return t.cssClass&&(tabClass+=" "+t.cssClass),tabHtml=t.href?'
'+t.name+"
":'",index++,tabHtml}).join("")+"
";return tabsContainerElem.innerHTML=tabsHtml,document.body.classList.add("withSectionTabs"),tabOwnerView=view,tabsElem=tabsContainerElem.querySelector('[is="emby-tabs"]'),configureSwipeTabs(view,tabsElem,getTabContainersFn),tabsElem.addEventListener("beforetabchange",function(e){var tabContainers=getTabContainersFn();if(null!=e.detail.previousIndex){var previousPanel=tabContainers[e.detail.previousIndex];previousPanel&&previousPanel.classList.remove("is-active")}var newPanel=tabContainers[e.detail.selectedTabIndex];newPanel&&newPanel.classList.add("is-active")}),onBeforeTabChange&&tabsElem.addEventListener("beforetabchange",onBeforeTabChange),onTabChange&&tabsElem.addEventListener("tabchange",onTabChange),setSelectedIndex!==!1&&(tabsElem.selectedIndex?tabsElem.selectedIndex(selectedIndex):(tabsElem.readySelectedIndex=selectedIndex,tabsElem.addEventListener("ready",onViewTabsReady))),{tabsContainer:tabsContainerElem,tabs:tabsContainerElem.querySelector('[is="emby-tabs"]'),replaced:!0}}return tabsElem||(tabsElem=tabsContainerElem.querySelector('[is="emby-tabs"]')),tabsElem.selectedIndex(selectedIndex),tabOwnerView=view,{tabsContainer:tabsContainerElem,tabs:tabsElem,replaced:!1}}function selectedTabIndex(index){var tabsContainerElem=headerTabsContainer;tabsElem||(tabsElem=tabsContainerElem.querySelector('[is="emby-tabs"]')),null!=index?tabsElem.selectedIndex(index):tabsElem.triggerTabChange()}function getTabsElement(){return document.querySelector(".tabs-viewmenubar")}var tabOwnerView,footerTabsContainer,headerTabsContainer,tabsElem,queryScope=document.querySelector(".skinHeader");return{setTabs:setTabs,getTabsElement:getTabsElement,selectedTabIndex:selectedTabIndex}}); \ No newline at end of file +define(["dom","browser","events","emby-tabs","emby-button","emby-linkbutton"],function(dom,browser,events){"use strict";function enableTabsInFooter(){return!1}function ensureElements(enableInFooter){enableInFooter&&(footerTabsContainer||(footerTabsContainer=document.createElement("div"),footerTabsContainer.classList.add("footerTabs"),footerTabsContainer.classList.add("sectionTabs"),footerTabsContainer.classList.add("hide"))),headerTabsContainer||(headerTabsContainer=queryScope.querySelector(".headerTabs"))}function onViewTabsReady(){this.selectedIndex(this.readySelectedIndex),this.readySelectedIndex=null}function allowSwipe(target){for(var parent=target;null!=parent;){if(!function(elem){if(dom.parentWithTag(elem,"input"))return!1;var classList=elem.classList;return!classList||!classList.contains("scrollX")&&!classList.contains("animatedScrollX")}(parent))return!1;parent=parent.parentNode}return!0}function configureSwipeTabs(view,tabsElem,getTabContainersFn){if(browser.touch){var onSwipeLeft=(getTabContainersFn().length,function(e,target){allowSwipe(target)&&view.contains(target)&&tabsElem.selectNext()}),onSwipeRight=function(e,target){allowSwipe(target)&&view.contains(target)&&tabsElem.selectPrevious()};require(["touchHelper"],function(TouchHelper){var touchHelper=new TouchHelper(view.parentNode.parentNode);events.on(touchHelper,"swipeleft",onSwipeLeft),events.on(touchHelper,"swiperight",onSwipeRight),view.addEventListener("viewdestroy",function(){touchHelper.destroy()})})}}function setTabs(view,selectedIndex,getTabsFn,getTabContainersFn,onBeforeTabChange,onTabChange,setSelectedIndex){var enableInFooter=enableTabsInFooter();if(!view)return tabOwnerView&&(headerTabsContainer||(headerTabsContainer=queryScope.querySelector(".headerTabs")),ensureElements(enableInFooter),document.body.classList.remove("withSectionTabs"),headerTabsContainer.innerHTML="",headerTabsContainer.classList.add("hide"),footerTabsContainer&&(footerTabsContainer.innerHTML="",footerTabsContainer.classList.add("hide")),tabOwnerView=null),{tabsContainer:headerTabsContainer,replaced:!1};ensureElements(enableInFooter);var tabsContainerElem=enableInFooter?footerTabsContainer:headerTabsContainer;if(tabOwnerView||tabsContainerElem.classList.remove("hide"),tabOwnerView!==view){var index=0,indexAttribute=null==selectedIndex?"":' data-index="'+selectedIndex+'"',tabsHtml='
'+getTabsFn().map(function(t){var tabClass="emby-tab-button";!1===t.enabled&&(tabClass+=" hide");var tabHtml;return t.cssClass&&(tabClass+=" "+t.cssClass),tabHtml=t.href?'
'+t.name+"
":'",index++,tabHtml}).join("")+"
";return tabsContainerElem.innerHTML=tabsHtml,document.body.classList.add("withSectionTabs"),tabOwnerView=view,tabsElem=tabsContainerElem.querySelector('[is="emby-tabs"]'),configureSwipeTabs(view,tabsElem,getTabContainersFn),tabsElem.addEventListener("beforetabchange",function(e){var tabContainers=getTabContainersFn();if(null!=e.detail.previousIndex){var previousPanel=tabContainers[e.detail.previousIndex];previousPanel&&previousPanel.classList.remove("is-active")}var newPanel=tabContainers[e.detail.selectedTabIndex];newPanel&&newPanel.classList.add("is-active")}),onBeforeTabChange&&tabsElem.addEventListener("beforetabchange",onBeforeTabChange),onTabChange&&tabsElem.addEventListener("tabchange",onTabChange),!1!==setSelectedIndex&&(tabsElem.selectedIndex?tabsElem.selectedIndex(selectedIndex):(tabsElem.readySelectedIndex=selectedIndex,tabsElem.addEventListener("ready",onViewTabsReady))),{tabsContainer:tabsContainerElem,tabs:tabsContainerElem.querySelector('[is="emby-tabs"]'),replaced:!0}}return tabsElem||(tabsElem=tabsContainerElem.querySelector('[is="emby-tabs"]')),tabsElem.selectedIndex(selectedIndex),tabOwnerView=view,{tabsContainer:tabsContainerElem,tabs:tabsElem,replaced:!1}}function selectedTabIndex(index){var tabsContainerElem=headerTabsContainer;tabsElem||(tabsElem=tabsContainerElem.querySelector('[is="emby-tabs"]')),null!=index?tabsElem.selectedIndex(index):tabsElem.triggerTabChange()}function getTabsElement(){return document.querySelector(".tabs-viewmenubar")}var tabOwnerView,footerTabsContainer,headerTabsContainer,tabsElem,queryScope=document.querySelector(".skinHeader");return{setTabs:setTabs,getTabsElement:getTabsElement,selectedTabIndex:selectedTabIndex}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/mediainfo/mediainfo.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/mediainfo/mediainfo.js index dada7b97c0..39151de2b7 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/mediainfo/mediainfo.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/mediainfo/mediainfo.js @@ -1 +1 @@ -define(["datetime","globalize","appRouter","itemHelper","indicators","material-icons","css!./mediainfo.css","programStyles","emby-linkbutton"],function(datetime,globalize,appRouter,itemHelper,indicators){"use strict";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 getProgramInfoHtml(item,options){var text,date,html="",miscInfo=[];if(item.StartDate&&options.programTime!==!1)try{text="",date=datetime.parseISO8601Date(item.StartDate),options.startDate!==!1&&(text+=datetime.toLocaleDateString(date,{weekday:"short",month:"short",day:"numeric"})),text+=" "+datetime.getDisplayTime(date),item.EndDate&&(date=datetime.parseISO8601Date(item.EndDate),text+=" - "+datetime.getDisplayTime(date)),miscInfo.push(text)}catch(e){console.log("Error parsing date: "+item.StartDate)}if(item.ChannelNumber&&miscInfo.push("CH "+item.ChannelNumber),item.ChannelName&&(options.interactive&&item.ChannelId?miscInfo.push({html:''+item.ChannelName+""}):miscInfo.push(item.ChannelName)),options.timerIndicator!==!1){var timerHtml=getTimerIndicator(item);timerHtml&&miscInfo.push({html:timerHtml})}return html+=miscInfo.map(function(m){return getMediaInfoItem(m)}).join("")}function getMediaInfoHtml(item,options){var html="",miscInfo=[];options=options||{};var text,date,minutes,count,showFolderRuntime="MusicAlbum"===item.Type||"MusicArtist"===item.MediaType||"Playlist"===item.MediaType||"MusicGenre"===item.MediaType;if(showFolderRuntime?(count=item.SongCount||item.ChildCount,count&&miscInfo.push(globalize.translate("sharedcomponents#TrackCount",count)),item.RunTimeTicks&&miscInfo.push(datetime.getDisplayRunningTime(item.RunTimeTicks))):"PhotoAlbum"!==item.Type&&"BoxSet"!==item.Type||(count=item.ChildCount,count&&miscInfo.push(globalize.translate("sharedcomponents#ItemCount",count))),("Episode"===item.Type||"Photo"===item.MediaType)&&options.originalAirDate!==!1&&item.PremiereDate)try{date=datetime.parseISO8601Date(item.PremiereDate),text=datetime.toLocaleDateString(date),miscInfo.push(text)}catch(e){console.log("Error parsing date: "+item.PremiereDate)}if("SeriesTimer"===item.Type&&(item.RecordAnyTime?miscInfo.push(globalize.translate("sharedcomponents#Anytime")):miscInfo.push(datetime.getDisplayTime(item.StartDate)),item.RecordAnyChannel?miscInfo.push(globalize.translate("sharedcomponents#AllChannels")):miscInfo.push(item.ChannelName||globalize.translate("sharedcomponents#OneChannel"))),item.StartDate&&"Program"!==item.Type&&"SeriesTimer"!==item.Type)try{date=datetime.parseISO8601Date(item.StartDate),text=datetime.toLocaleDateString(date),miscInfo.push(text),"Recording"!==item.Type&&(text=datetime.getDisplayTime(date),miscInfo.push(text))}catch(e){console.log("Error parsing date: "+item.StartDate)}if(options.year!==!1&&item.ProductionYear&&"Series"===item.Type)if("Continuing"===item.Status)miscInfo.push(globalize.translate("sharedcomponents#SeriesYearToPresent",item.ProductionYear));else if(item.ProductionYear){if(text=item.ProductionYear,item.EndDate)try{var endYear=datetime.parseISO8601Date(item.EndDate).getFullYear();endYear!==item.ProductionYear&&(text+="-"+datetime.parseISO8601Date(item.EndDate).getFullYear())}catch(e){console.log("Error parsing date: "+item.EndDate)}miscInfo.push(text)}if("Program"===item.Type)if(options.programIndicator!==!1&&(item.IsLive?miscInfo.push({html:'
'+globalize.translate("sharedcomponents#Live")+"
"}):item.IsPremiere?miscInfo.push({html:'
'+globalize.translate("sharedcomponents#Premiere")+"
"}):item.IsSeries&&!item.IsRepeat?miscInfo.push({html:'
'+globalize.translate("sharedcomponents#AttributeNew")+"
"}):item.IsSeries&&item.IsRepeat&&miscInfo.push({html:'
'+globalize.translate("sharedcomponents#Repeat")+"
"})),(item.IsSeries||item.EpisodeTitle)&&options.episodeTitle!==!1)text=itemHelper.getDisplayName(item,{includeIndexNumber:options.episodeTitleIndexNumber}),text&&miscInfo.push(text);else if(item.IsMovie&&item.ProductionYear&&options.originalAirDate!==!1)miscInfo.push(item.ProductionYear);else if(item.PremiereDate&&options.originalAirDate!==!1)try{date=datetime.parseISO8601Date(item.PremiereDate),text=globalize.translate("sharedcomponents#OriginalAirDateValue",datetime.toLocaleDateString(date)),miscInfo.push(text)}catch(e){console.log("Error parsing date: "+item.PremiereDate)}else item.ProductionYear&&miscInfo.push(item.ProductionYear);if(options.year!==!1&&"Series"!==item.Type&&"Episode"!==item.Type&&"Person"!==item.Type&&"Photo"!==item.MediaType&&"Program"!==item.Type&&"Season"!==item.Type)if(item.ProductionYear)miscInfo.push(item.ProductionYear);else if(item.PremiereDate)try{text=datetime.parseISO8601Date(item.PremiereDate).getFullYear(),miscInfo.push(text)}catch(e){console.log("Error parsing date: "+item.PremiereDate)}if(item.RunTimeTicks&&"Series"!==item.Type&&"Program"!==item.Type&&!showFolderRuntime&&options.runtime!==!1&&("Audio"===item.Type?miscInfo.push(datetime.getDisplayRunningTime(item.RunTimeTicks)):(minutes=item.RunTimeTicks/6e8,minutes=minutes||1,miscInfo.push(Math.round(minutes)+" mins"))),item.OfficialRating&&"Season"!==item.Type&&"Episode"!==item.Type&&miscInfo.push({text:item.OfficialRating,cssClass:"mediaInfoOfficialRating"}),item.Video3DFormat&&miscInfo.push("3D"),"Photo"===item.MediaType&&item.Width&&item.Height&&miscInfo.push(item.Width+"x"+item.Height),options.container!==!1&&"Audio"===item.Type&&item.Container&&miscInfo.push(item.Container),html+=miscInfo.map(function(m){return getMediaInfoItem(m)}).join(""),html+=getStarIconsHtml(item),item.HasSubtitles&&options.subtitles!==!1&&(html+='
CC
'),item.CriticRating&&options.criticRating!==!1&&(html+=item.CriticRating>=60?'
'+item.CriticRating+"
":'
'+item.CriticRating+"
"),options.endsAt!==!1){var endsAt=getEndsAt(item);endsAt&&(html+=getMediaInfoItem(endsAt,"endsAt"))}return html+=indicators.getMissingIndicator(item)}function getEndsAt(item){if("Video"===item.MediaType&&item.RunTimeTicks&&!item.StartDate){var endDate=(new Date).getTime()+item.RunTimeTicks/1e4;endDate=new Date(endDate);var displayTime=datetime.getDisplayTime(endDate);return globalize.translate("sharedcomponents#EndsAtValue",displayTime)}return null}function getEndsAtFromPosition(runtimeTicks,positionTicks,includeText){var endDate=(new Date).getTime()+(runtimeTicks-(positionTicks||0))/1e4;endDate=new Date(endDate);var displayTime=datetime.getDisplayTime(endDate);return includeText===!1?displayTime:globalize.translate("sharedcomponents#EndsAtValue",displayTime)}function getMediaInfoItem(m,cssClass){cssClass=cssClass?cssClass+" mediaInfoItem":"mediaInfoItem";var mediaInfoText=m;if("string"!=typeof m&&"number"!=typeof m){if(m.html)return m.html;mediaInfoText=m.text,cssClass+=" "+m.cssClass}return'
'+mediaInfoText+"
"}function getStarIconsHtml(item){var html="",rating=item.CommunityRating;return rating&&(html+='
',html+='',html+=rating,html+="
"),html}function dynamicEndTime(elem,item){var interval=setInterval(function(){return document.body.contains(elem)?void(elem.innerHTML=getEndsAt(item)):void clearInterval(interval)},6e4)}function fillPrimaryMediaInfo(elem,item,options){var html=getPrimaryMediaInfoHtml(item,options);elem.innerHTML=html,afterFill(elem,item,options)}function fillSecondaryMediaInfo(elem,item,options){var html=getSecondaryMediaInfoHtml(item,options);elem.innerHTML=html,afterFill(elem,item,options)}function afterFill(elem,item,options){if(options.endsAt!==!1){var endsAtElem=elem.querySelector(".endsAt");endsAtElem&&dynamicEndTime(endsAtElem,item)}var lnkChannel=elem.querySelector(".lnkChannel");lnkChannel&&lnkChannel.addEventListener("click",onChannelLinkClick)}function onChannelLinkClick(e){var channelId=this.getAttribute("data-id"),serverId=this.getAttribute("data-serverid");return appRouter.showItem(channelId,serverId),e.preventDefault(),!1}function getPrimaryMediaInfoHtml(item,options){return options=options||{},null==options.interactive&&(options.interactive=!1),getMediaInfoHtml(item,options)}function getSecondaryMediaInfoHtml(item,options){return options=options||{},null==options.interactive&&(options.interactive=!1),"Program"===item.Type?getProgramInfoHtml(item,options):""}function getResolutionText(i){var width=i.Width,height=i.Height;if(width&&height){if(width>=3800||height>=2e3)return"4K";if(width>=2500||height>=1400)return i.IsInterlaced?"1440i":"1440P";if(width>=1880||height>=1e3)return i.IsInterlaced?"1080i":"1080P";if(width>=1200||height>=700)return i.IsInterlaced?"720i":"720P";if(width>=700||height>=400)return i.IsInterlaced?"480i":"480P"}return null}function getAudioStreamForDisplay(item){if(!item.MediaSources)return null;var mediaSource=item.MediaSources[0];return mediaSource?(mediaSource.MediaStreams||[]).filter(function(i){return"Audio"===i.Type&&(i.Index===mediaSource.DefaultAudioStreamIndex||null==mediaSource.DefaultAudioStreamIndex)})[0]:null}function getMediaInfoStats(item,options){options=options||{};var list=[],mediaSource=(item.MediaSources||[])[0]||{},videoStream=(mediaSource.MediaStreams||[]).filter(function(i){return"Video"===i.Type})[0]||{},audioStream=getAudioStreamForDisplay(item)||{};"Dvd"===item.VideoType&&list.push({type:"mediainfo",text:"Dvd"}),"BluRay"===item.VideoType&&list.push({type:"mediainfo",text:"BluRay"});var resolutionText=getResolutionText(videoStream);resolutionText&&list.push({type:"mediainfo",text:resolutionText}),videoStream.Codec&&list.push({type:"mediainfo",text:videoStream.Codec});var channelText,channels=audioStream.Channels;8===channels?channelText="7.1":7===channels?channelText="6.1":6===channels?channelText="5.1":2===channels&&(channelText="2.0"),channelText&&list.push({type:"mediainfo",text:channelText});var audioCodec=(audioStream.Codec||"").toLowerCase();if("dca"!==audioCodec&&"dts"!==audioCodec||!audioStream.Profile?audioStream.Codec&&list.push({type:"mediainfo",text:audioStream.Codec}):list.push({type:"mediainfo",text:audioStream.Profile}),item.DateCreated&&itemHelper.enableDateAddedDisplay(item)){var dateCreated=datetime.parseISO8601Date(item.DateCreated);list.push({type:"added",text:globalize.translate("sharedcomponents#AddedOnValue",datetime.toLocaleDateString(dateCreated)+" "+datetime.getDisplayTime(dateCreated))})}return list}return{getMediaInfoHtml:getPrimaryMediaInfoHtml,fill:fillPrimaryMediaInfo,getEndsAt:getEndsAt,getEndsAtFromPosition:getEndsAtFromPosition,getPrimaryMediaInfoHtml:getPrimaryMediaInfoHtml,getSecondaryMediaInfoHtml:getSecondaryMediaInfoHtml,fillPrimaryMediaInfo:fillPrimaryMediaInfo,fillSecondaryMediaInfo:fillSecondaryMediaInfo,getMediaInfoStats:getMediaInfoStats,getResolutionText:getResolutionText}}); \ No newline at end of file +define(["datetime","globalize","appRouter","itemHelper","indicators","material-icons","css!./mediainfo.css","programStyles","emby-linkbutton"],function(datetime,globalize,appRouter,itemHelper,indicators){"use strict";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 getProgramInfoHtml(item,options){var text,date,html="",miscInfo=[];if(item.StartDate&&!1!==options.programTime)try{text="",date=datetime.parseISO8601Date(item.StartDate),!1!==options.startDate&&(text+=datetime.toLocaleDateString(date,{weekday:"short",month:"short",day:"numeric"})),text+=" "+datetime.getDisplayTime(date),item.EndDate&&(date=datetime.parseISO8601Date(item.EndDate),text+=" - "+datetime.getDisplayTime(date)),miscInfo.push(text)}catch(e){console.log("Error parsing date: "+item.StartDate)}if(item.ChannelNumber&&miscInfo.push("CH "+item.ChannelNumber),item.ChannelName&&(options.interactive&&item.ChannelId?miscInfo.push({html:''+item.ChannelName+""}):miscInfo.push(item.ChannelName)),!1!==options.timerIndicator){var timerHtml=getTimerIndicator(item);timerHtml&&miscInfo.push({html:timerHtml})}return html+=miscInfo.map(function(m){return getMediaInfoItem(m)}).join("")}function getMediaInfoHtml(item,options){var html="",miscInfo=[];options=options||{};var text,date,minutes,count,showFolderRuntime="MusicAlbum"===item.Type||"MusicArtist"===item.MediaType||"Playlist"===item.MediaType||"MusicGenre"===item.MediaType;if(showFolderRuntime?(count=item.SongCount||item.ChildCount,count&&miscInfo.push(globalize.translate("sharedcomponents#TrackCount",count)),item.RunTimeTicks&&miscInfo.push(datetime.getDisplayRunningTime(item.RunTimeTicks))):"PhotoAlbum"!==item.Type&&"BoxSet"!==item.Type||(count=item.ChildCount)&&miscInfo.push(globalize.translate("sharedcomponents#ItemCount",count)),("Episode"===item.Type||"Photo"===item.MediaType)&&!1!==options.originalAirDate&&item.PremiereDate)try{date=datetime.parseISO8601Date(item.PremiereDate),text=datetime.toLocaleDateString(date),miscInfo.push(text)}catch(e){console.log("Error parsing date: "+item.PremiereDate)}if("SeriesTimer"===item.Type&&(item.RecordAnyTime?miscInfo.push(globalize.translate("sharedcomponents#Anytime")):miscInfo.push(datetime.getDisplayTime(item.StartDate)),item.RecordAnyChannel?miscInfo.push(globalize.translate("sharedcomponents#AllChannels")):miscInfo.push(item.ChannelName||globalize.translate("sharedcomponents#OneChannel"))),item.StartDate&&"Program"!==item.Type&&"SeriesTimer"!==item.Type)try{date=datetime.parseISO8601Date(item.StartDate),text=datetime.toLocaleDateString(date),miscInfo.push(text),"Recording"!==item.Type&&(text=datetime.getDisplayTime(date),miscInfo.push(text))}catch(e){console.log("Error parsing date: "+item.StartDate)}if(!1!==options.year&&item.ProductionYear&&"Series"===item.Type)if("Continuing"===item.Status)miscInfo.push(globalize.translate("sharedcomponents#SeriesYearToPresent",item.ProductionYear));else if(item.ProductionYear){if(text=item.ProductionYear,item.EndDate)try{var endYear=datetime.parseISO8601Date(item.EndDate).getFullYear();endYear!==item.ProductionYear&&(text+="-"+datetime.parseISO8601Date(item.EndDate).getFullYear())}catch(e){console.log("Error parsing date: "+item.EndDate)}miscInfo.push(text)}if("Program"===item.Type)if(!1!==options.programIndicator&&(item.IsLive?miscInfo.push({html:'
'+globalize.translate("sharedcomponents#Live")+"
"}):item.IsPremiere?miscInfo.push({html:'
'+globalize.translate("sharedcomponents#Premiere")+"
"}):item.IsSeries&&!item.IsRepeat?miscInfo.push({html:'
'+globalize.translate("sharedcomponents#AttributeNew")+"
"}):item.IsSeries&&item.IsRepeat&&miscInfo.push({html:'
'+globalize.translate("sharedcomponents#Repeat")+"
"})),(item.IsSeries||item.EpisodeTitle)&&!1!==options.episodeTitle)(text=itemHelper.getDisplayName(item,{includeIndexNumber:options.episodeTitleIndexNumber}))&&miscInfo.push(text);else if(item.IsMovie&&item.ProductionYear&&!1!==options.originalAirDate)miscInfo.push(item.ProductionYear);else if(item.PremiereDate&&!1!==options.originalAirDate)try{date=datetime.parseISO8601Date(item.PremiereDate),text=globalize.translate("sharedcomponents#OriginalAirDateValue",datetime.toLocaleDateString(date)),miscInfo.push(text)}catch(e){console.log("Error parsing date: "+item.PremiereDate)}else item.ProductionYear&&miscInfo.push(item.ProductionYear);if(!1!==options.year&&"Series"!==item.Type&&"Episode"!==item.Type&&"Person"!==item.Type&&"Photo"!==item.MediaType&&"Program"!==item.Type&&"Season"!==item.Type)if(item.ProductionYear)miscInfo.push(item.ProductionYear);else if(item.PremiereDate)try{text=datetime.parseISO8601Date(item.PremiereDate).getFullYear(),miscInfo.push(text)}catch(e){console.log("Error parsing date: "+item.PremiereDate)}if(item.RunTimeTicks&&"Series"!==item.Type&&"Program"!==item.Type&&!showFolderRuntime&&!1!==options.runtime&&("Audio"===item.Type?miscInfo.push(datetime.getDisplayRunningTime(item.RunTimeTicks)):(minutes=item.RunTimeTicks/6e8,minutes=minutes||1,miscInfo.push(Math.round(minutes)+" mins"))),item.OfficialRating&&"Season"!==item.Type&&"Episode"!==item.Type&&miscInfo.push({text:item.OfficialRating,cssClass:"mediaInfoOfficialRating"}),item.Video3DFormat&&miscInfo.push("3D"),"Photo"===item.MediaType&&item.Width&&item.Height&&miscInfo.push(item.Width+"x"+item.Height),!1!==options.container&&"Audio"===item.Type&&item.Container&&miscInfo.push(item.Container),html+=miscInfo.map(function(m){return getMediaInfoItem(m)}).join(""),html+=getStarIconsHtml(item),item.HasSubtitles&&!1!==options.subtitles&&(html+='
CC
'),item.CriticRating&&!1!==options.criticRating&&(item.CriticRating>=60?html+='
'+item.CriticRating+"
":html+='
'+item.CriticRating+"
"),!1!==options.endsAt){var endsAt=getEndsAt(item);endsAt&&(html+=getMediaInfoItem(endsAt,"endsAt"))}return html+=indicators.getMissingIndicator(item)}function getEndsAt(item){if("Video"===item.MediaType&&item.RunTimeTicks&&!item.StartDate){var endDate=(new Date).getTime()+item.RunTimeTicks/1e4;endDate=new Date(endDate);var displayTime=datetime.getDisplayTime(endDate);return globalize.translate("sharedcomponents#EndsAtValue",displayTime)}return null}function getEndsAtFromPosition(runtimeTicks,positionTicks,includeText){var endDate=(new Date).getTime()+(runtimeTicks-(positionTicks||0))/1e4;endDate=new Date(endDate);var displayTime=datetime.getDisplayTime(endDate);return!1===includeText?displayTime:globalize.translate("sharedcomponents#EndsAtValue",displayTime)}function getMediaInfoItem(m,cssClass){cssClass=cssClass?cssClass+" mediaInfoItem":"mediaInfoItem";var mediaInfoText=m;if("string"!=typeof m&&"number"!=typeof m){if(m.html)return m.html;mediaInfoText=m.text,cssClass+=" "+m.cssClass}return'
'+mediaInfoText+"
"}function getStarIconsHtml(item){var html="",rating=item.CommunityRating;return rating&&(html+='
',html+='',html+=rating,html+="
"),html}function dynamicEndTime(elem,item){var interval=setInterval(function(){if(!document.body.contains(elem))return void clearInterval(interval);elem.innerHTML=getEndsAt(item)},6e4)}function fillPrimaryMediaInfo(elem,item,options){var html=getPrimaryMediaInfoHtml(item,options);elem.innerHTML=html,afterFill(elem,item,options)}function fillSecondaryMediaInfo(elem,item,options){var html=getSecondaryMediaInfoHtml(item,options);elem.innerHTML=html,afterFill(elem,item,options)}function afterFill(elem,item,options){if(!1!==options.endsAt){var endsAtElem=elem.querySelector(".endsAt");endsAtElem&&dynamicEndTime(endsAtElem,item)}var lnkChannel=elem.querySelector(".lnkChannel");lnkChannel&&lnkChannel.addEventListener("click",onChannelLinkClick)}function onChannelLinkClick(e){var channelId=this.getAttribute("data-id"),serverId=this.getAttribute("data-serverid");return appRouter.showItem(channelId,serverId),e.preventDefault(),!1}function getPrimaryMediaInfoHtml(item,options){return options=options||{},null==options.interactive&&(options.interactive=!1),getMediaInfoHtml(item,options)}function getSecondaryMediaInfoHtml(item,options){return options=options||{},null==options.interactive&&(options.interactive=!1),"Program"===item.Type?getProgramInfoHtml(item,options):""}function getResolutionText(i){var width=i.Width,height=i.Height;if(width&&height){if(width>=3800||height>=2e3)return"4K";if(width>=2500||height>=1400)return i.IsInterlaced?"1440i":"1440P";if(width>=1880||height>=1e3)return i.IsInterlaced?"1080i":"1080P";if(width>=1200||height>=700)return i.IsInterlaced?"720i":"720P";if(width>=700||height>=400)return i.IsInterlaced?"480i":"480P"}return null}function getAudioStreamForDisplay(item){if(!item.MediaSources)return null;var mediaSource=item.MediaSources[0];return mediaSource?(mediaSource.MediaStreams||[]).filter(function(i){return"Audio"===i.Type&&(i.Index===mediaSource.DefaultAudioStreamIndex||null==mediaSource.DefaultAudioStreamIndex)})[0]:null}function getMediaInfoStats(item,options){options=options||{};var list=[],mediaSource=(item.MediaSources||[])[0]||{},videoStream=(mediaSource.MediaStreams||[]).filter(function(i){return"Video"===i.Type})[0]||{},audioStream=getAudioStreamForDisplay(item)||{};"Dvd"===item.VideoType&&list.push({type:"mediainfo",text:"Dvd"}),"BluRay"===item.VideoType&&list.push({type:"mediainfo",text:"BluRay"});var resolutionText=getResolutionText(videoStream);resolutionText&&list.push({type:"mediainfo",text:resolutionText}),videoStream.Codec&&list.push({type:"mediainfo",text:videoStream.Codec});var channelText,channels=audioStream.Channels;8===channels?channelText="7.1":7===channels?channelText="6.1":6===channels?channelText="5.1":2===channels&&(channelText="2.0"),channelText&&list.push({type:"mediainfo",text:channelText});var audioCodec=(audioStream.Codec||"").toLowerCase();if("dca"!==audioCodec&&"dts"!==audioCodec||!audioStream.Profile?audioStream.Codec&&list.push({type:"mediainfo",text:audioStream.Codec}):list.push({type:"mediainfo",text:audioStream.Profile}),item.DateCreated&&itemHelper.enableDateAddedDisplay(item)){var dateCreated=datetime.parseISO8601Date(item.DateCreated);list.push({type:"added",text:globalize.translate("sharedcomponents#AddedOnValue",datetime.toLocaleDateString(dateCreated)+" "+datetime.getDisplayTime(dateCreated))})}return list}return{getMediaInfoHtml:getPrimaryMediaInfoHtml,fill:fillPrimaryMediaInfo,getEndsAt:getEndsAt,getEndsAtFromPosition:getEndsAtFromPosition,getPrimaryMediaInfoHtml:getPrimaryMediaInfoHtml,getSecondaryMediaInfoHtml:getSecondaryMediaInfoHtml,fillPrimaryMediaInfo:fillPrimaryMediaInfo,fillSecondaryMediaInfo:fillSecondaryMediaInfo,getMediaInfoStats:getMediaInfoStats,getResolutionText:getResolutionText}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.js index e43d1ef16a..314ead8509 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.js @@ -1 +1 @@ -define(["itemHelper","dom","layoutManager","dialogHelper","datetime","loading","focusManager","connectionManager","globalize","require","shell","emby-checkbox","emby-input","emby-select","listViewStyle","emby-textarea","emby-button","paper-icon-button-light","css!./../formdialog","clearButtonStyle","flexStyles"],function(itemHelper,dom,layoutManager,dialogHelper,datetime,loading,focusManager,connectionManager,globalize,require,shell){"use strict";function isDialog(){return currentContext.classList.contains("dialog")}function closeDialog(isSubmitted){isDialog()&&dialogHelper.close(currentContext)}function submitUpdatedItem(form,item){function afterContentTypeUpdated(){require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#MessageItemSaved"))}),loading.hide(),closeDialog(!0)}var apiClient=getApiClient();apiClient.updateItem(item).then(function(){var newContentType=form.querySelector("#selectContentType").value||"";(metadataEditorInfo.ContentType||"")!==newContentType?apiClient.ajax({url:apiClient.getUrl("Items/"+item.Id+"/ContentType",{ContentType:newContentType}),type:"POST"}).then(function(){afterContentTypeUpdated()}):afterContentTypeUpdated()})}function getSelectedAirDays(form){var checkedItems=form.querySelectorAll(".chkAirDay:checked")||[];return Array.prototype.map.call(checkedItems,function(c){return c.getAttribute("data-day")})}function getAlbumArtists(form){return form.querySelector("#txtAlbumArtist").value.trim().split(";").filter(function(s){return s.length>0}).map(function(a){return{Name:a}})}function getArtists(form){return form.querySelector("#txtArtist").value.trim().split(";").filter(function(s){return s.length>0}).map(function(a){return{Name:a}})}function getDateValue(form,element,property){var val=form.querySelector(element).value;if(!val)return null;if(currentItem[property]){var date=datetime.parseISO8601Date(currentItem[property],!0),parts=date.toISOString().split("T");if(0===parts[0].indexOf(val)){var iso=parts[1];val+="T"+iso}}return val}function onSubmit(e){loading.show();var form=this,item={Id:currentItem.Id,Name:form.querySelector("#txtName").value,OriginalTitle:form.querySelector("#txtOriginalName").value,ForcedSortName:form.querySelector("#txtSortName").value,CommunityRating:form.querySelector("#txtCommunityRating").value,HomePageUrl:form.querySelector("#txtHomePageUrl").value,CriticRating:form.querySelector("#txtCriticRating").value,IndexNumber:form.querySelector("#txtIndexNumber").value||null,AbsoluteEpisodeNumber:form.querySelector("#txtAbsoluteEpisodeNumber").value,DvdEpisodeNumber:form.querySelector("#txtDvdEpisodeNumber").value,DvdSeasonNumber:form.querySelector("#txtDvdSeasonNumber").value,AirsBeforeSeasonNumber:form.querySelector("#txtAirsBeforeSeason").value,AirsAfterSeasonNumber:form.querySelector("#txtAirsAfterSeason").value,AirsBeforeEpisodeNumber:form.querySelector("#txtAirsBeforeEpisode").value,ParentIndexNumber:form.querySelector("#txtParentIndexNumber").value||null,DisplayOrder:form.querySelector("#selectDisplayOrder").value,Album:form.querySelector("#txtAlbum").value,AlbumArtists:getAlbumArtists(form),ArtistItems:getArtists(form),Overview:form.querySelector("#txtOverview").value,Status:form.querySelector("#selectStatus").value,AirDays:getSelectedAirDays(form),AirTime:form.querySelector("#txtAirTime").value,Genres:getListValues(form.querySelector("#listGenres")),Tags:getListValues(form.querySelector("#listTags")),Studios:getListValues(form.querySelector("#listStudios")).map(function(element){return{Name:element}}),PremiereDate:getDateValue(form,"#txtPremiereDate","PremiereDate"),DateCreated:getDateValue(form,"#txtDateAdded","DateCreated"),EndDate:getDateValue(form,"#txtEndDate","EndDate"),ProductionYear:form.querySelector("#txtProductionYear").value,AspectRatio:form.querySelector("#txtOriginalAspectRatio").value,Video3DFormat:form.querySelector("#select3dFormat").value,OfficialRating:form.querySelector("#selectOfficialRating").value,CustomRating:form.querySelector("#selectCustomRating").value,People:currentItem.People,LockData:form.querySelector("#chkLockData").checked,LockedFields:Array.prototype.filter.call(form.querySelectorAll(".selectLockedField"),function(c){return!c.checked}).map(function(c){return c.getAttribute("data-value")})};item.ProviderIds=Object.assign({},currentItem.ProviderIds);var idElements=form.querySelectorAll(".txtExternalId");if(Array.prototype.map.call(idElements,function(idElem){var providerKey=idElem.getAttribute("data-providerkey");item.ProviderIds[providerKey]=idElem.value}),item.PreferredMetadataLanguage=form.querySelector("#selectLanguage").value,item.PreferredMetadataCountryCode=form.querySelector("#selectCountry").value,"Person"===currentItem.Type){var placeOfBirth=form.querySelector("#txtPlaceOfBirth").value;item.ProductionLocations=placeOfBirth?[placeOfBirth]:[]}if("Series"===currentItem.Type){var seriesRuntime=form.querySelector("#txtSeriesRuntime").value;item.RunTimeTicks=seriesRuntime?6e8*seriesRuntime:null}var tagline=form.querySelector("#txtTagline").value;return item.Taglines=tagline?[tagline]:[],submitUpdatedItem(form,item),e.preventDefault(),e.stopPropagation(),!1}function getListValues(list){return Array.prototype.map.call(list.querySelectorAll(".textValue"),function(el){return el.textContent})}function addElementToList(source,sortCallback){require(["prompt"],function(prompt){prompt({label:"Value:"}).then(function(text){var list=dom.parentWithClass(source,"editableListviewContainer").querySelector(".paperList"),items=getListValues(list);items.push(text),populateListView(list,items,sortCallback)})})}function removeElementFromList(source){var el=dom.parentWithClass(source,"listItem");el.parentNode.removeChild(el)}function editPerson(context,person,index){require(["personEditor"],function(personEditor){personEditor.show(person).then(function(updatedPerson){var isNew=index===-1;isNew&¤tItem.People.push(updatedPerson),populatePeople(context,currentItem.People)})})}function showMoreMenu(context,button,user){require(["itemContextMenu"],function(itemContextMenu){var item=currentItem;itemContextMenu.show({item:item,positionTo:button,edit:!1,editImages:!0,editSubtitles:!0,sync:!1,share:!1,play:!1,queue:!1,user:user}).then(function(result){result.deleted?afterDeleted(context,item):result.updated&&reload(context,item.Id,item.ServerId)})})}function afterDeleted(context,item){var parentId=item.ParentId||item.SeasonId||item.SeriesId;parentId?reload(context,parentId,item.ServerId):require(["appRouter"],function(appRouter){appRouter.goHome()})}function onEditorClick(e){var btnRemoveFromEditorList=dom.parentWithClass(e.target,"btnRemoveFromEditorList");if(btnRemoveFromEditorList)return void removeElementFromList(btnRemoveFromEditorList);var btnAddTextItem=dom.parentWithClass(e.target,"btnAddTextItem");btnAddTextItem&&addElementToList(btnAddTextItem)}function getApiClient(){return connectionManager.getApiClient(currentItem.ServerId)}function init(context,apiClient){context.querySelector(".externalIds").addEventListener("click",function(e){var btnOpenExternalId=dom.parentWithClass(e.target,"btnOpenExternalId");if(btnOpenExternalId){var field=context.querySelector("#"+btnOpenExternalId.getAttribute("data-fieldid")),formatString=field.getAttribute("data-formatstring");field.value&&shell.openUrl(formatString.replace("{0}",field.value))}}),context.querySelector(".btnCancel").addEventListener("click",function(){closeDialog(!1)}),context.querySelector(".btnMore").addEventListener("click",function(e){getApiClient().getCurrentUser().then(function(user){showMoreMenu(context,e.target,user)})}),context.querySelector(".btnHeaderSave").addEventListener("click",function(e){context.querySelector(".btnSave").click()}),context.querySelector("#chkLockData").addEventListener("click",function(e){e.target.checked?hideElement(".providerSettingsContainer"):showElement(".providerSettingsContainer")}),context.removeEventListener("click",onEditorClick),context.addEventListener("click",onEditorClick);var form=context.querySelector("form");form.removeEventListener("submit",onSubmit),form.addEventListener("submit",onSubmit),context.querySelector("#btnAddPerson").addEventListener("click",function(event,data){editPerson(context,{},-1)}),context.querySelector("#peopleList").addEventListener("click",function(e){var index,btnDeletePerson=dom.parentWithClass(e.target,"btnDeletePerson");btnDeletePerson&&(index=parseInt(btnDeletePerson.getAttribute("data-index")),currentItem.People.splice(index,1),populatePeople(context,currentItem.People));var btnEditPerson=dom.parentWithClass(e.target,"btnEditPerson");btnEditPerson&&(index=parseInt(btnEditPerson.getAttribute("data-index")),editPerson(context,currentItem.People[index],index))})}function getItem(itemId,serverId){var apiClient=connectionManager.getApiClient(serverId);return itemId?apiClient.getItem(apiClient.getCurrentUserId(),itemId):apiClient.getRootFolder(apiClient.getCurrentUserId())}function getEditorConfig(itemId,serverId){var apiClient=connectionManager.getApiClient(serverId);return itemId?apiClient.getJSON(apiClient.getUrl("Items/"+itemId+"/MetadataEditor")):Promise.resolve({})}function populateCountries(select,allCountries){var html="";html+="";for(var i=0,length=allCountries.length;i"+culture.DisplayName+""}select.innerHTML=html}function populateLanguages(select,languages){var html="";html+="";for(var i=0,length=languages.length;i"+culture.DisplayName+""}select.innerHTML=html}function renderContentTypeOptions(context,metadataInfo){metadataInfo.ContentTypeOptions.length?showElement("#fldContentType",context):hideElement("#fldContentType",context);var html=metadataInfo.ContentTypeOptions.map(function(i){return'"}).join(""),selectEl=context.querySelector("#selectContentType");selectEl.innerHTML=html,selectEl.value=metadataInfo.ContentType||""}function loadExternalIds(context,item,externalIds){for(var html="",providerIds=item.ProviderIds||{},i=0,length=externalIds.length;i',html+='
';var value=providerIds[idInfo.Key]||"";html+='
',html+='',html+="
",formatString&&(html+=''),html+="
",html+="
"}var elem=context.querySelector(".externalIds",context);elem.innerHTML=html,externalIds.length?context.querySelector(".externalIdsSection").classList.remove("hide"):context.querySelector(".externalIdsSection").classList.add("hide")}function hideElement(selector,context,multiple){if(context=context||document,"string"==typeof selector){var elements=multiple?context.querySelectorAll(selector):[context.querySelector(selector)];Array.prototype.forEach.call(elements,function(el){el&&el.classList.add("hide")})}else selector.classList.add("hide")}function showElement(selector,context,multiple){if(context=context||document,"string"==typeof selector){var elements=multiple?context.querySelectorAll(selector):[context.querySelector(selector)];Array.prototype.forEach.call(elements,function(el){el&&el.classList.remove("hide")})}else selector.classList.remove("hide")}function setFieldVisibilities(context,item){item.Path&&item.EnableMediaSourceDisplay!==!1?showElement("#fldPath",context):hideElement("#fldPath",context),"Series"===item.Type||"Movie"===item.Type||"Trailer"===item.Type?showElement("#fldOriginalName",context):hideElement("#fldOriginalName",context),"Series"===item.Type?showElement("#fldSeriesRuntime",context):hideElement("#fldSeriesRuntime",context),"Series"===item.Type||"Person"===item.Type?showElement("#fldEndDate",context):hideElement("#fldEndDate",context),"MusicAlbum"===item.Type?showElement("#albumAssociationMessage",context):hideElement("#albumAssociationMessage",context),"Movie"===item.Type||"Trailer"===item.Type?showElement("#fldCriticRating",context):hideElement("#fldCriticRating",context),"Series"===item.Type?(showElement("#fldStatus",context),showElement("#fldAirDays",context),showElement("#fldAirTime",context)):(hideElement("#fldStatus",context),hideElement("#fldAirDays",context),hideElement("#fldAirTime",context)),"Video"===item.MediaType&&"TvChannel"!==item.Type?showElement("#fld3dFormat",context):hideElement("#fld3dFormat",context),"Audio"===item.Type?showElement("#fldAlbumArtist",context):hideElement("#fldAlbumArtist",context),"Audio"===item.Type||"MusicVideo"===item.Type?(showElement("#fldArtist",context),showElement("#fldAlbum",context)):(hideElement("#fldArtist",context),hideElement("#fldAlbum",context)),"Episode"===item.Type?showElement("#collapsibleDvdEpisodeInfo",context):hideElement("#collapsibleDvdEpisodeInfo",context),"Episode"===item.Type&&0===item.ParentIndexNumber?showElement("#collapsibleSpecialEpisodeInfo",context):hideElement("#collapsibleSpecialEpisodeInfo",context),"Person"===item.Type||"Genre"===item.Type||"Studio"===item.Type||"GameGenre"===item.Type||"MusicGenre"===item.Type||"TvChannel"===item.Type||"Book"===item.Type?hideElement("#peopleCollapsible",context):showElement("#peopleCollapsible",context),"Person"===item.Type||"Genre"===item.Type||"Studio"===item.Type||"GameGenre"===item.Type||"MusicGenre"===item.Type||"TvChannel"===item.Type?(hideElement("#fldCommunityRating",context),hideElement("#genresCollapsible",context),hideElement("#studiosCollapsible",context),"TvChannel"===item.Type?showElement("#fldOfficialRating",context):hideElement("#fldOfficialRating",context),hideElement("#fldCustomRating",context)):(showElement("#fldCommunityRating",context),showElement("#genresCollapsible",context),showElement("#studiosCollapsible",context),showElement("#fldOfficialRating",context),showElement("#fldCustomRating",context)),showElement("#tagsCollapsible",context),"TvChannel"===item.Type?(hideElement("#metadataSettingsCollapsible",context),hideElement("#fldPremiereDate",context),hideElement("#fldDateAdded",context),hideElement("#fldYear",context)):(showElement("#metadataSettingsCollapsible",context),showElement("#fldPremiereDate",context),showElement("#fldDateAdded",context),showElement("#fldYear",context)),"TvChannel"===item.Type?hideElement(".overviewContainer",context):showElement(".overviewContainer",context),"TvChannel"===item.Type?hideElement(".websiteFieldContainer",context):showElement(".websiteFieldContainer",context),"Person"===item.Type?(context.querySelector("#txtProductionYear").label(globalize.translate("sharedcomponents#LabelBirthYear")),context.querySelector("#txtPremiereDate").label(globalize.translate("sharedcomponents#LabelBirthDate")),context.querySelector("#txtEndDate").label(globalize.translate("sharedcomponents#LabelDeathDate")),showElement("#fldPlaceOfBirth")):(context.querySelector("#txtProductionYear").label(globalize.translate("sharedcomponents#LabelYear")),context.querySelector("#txtPremiereDate").label(globalize.translate("sharedcomponents#LabelReleaseDate")),context.querySelector("#txtEndDate").label(globalize.translate("sharedcomponents#LabelEndDate")),hideElement("#fldPlaceOfBirth")),"Video"===item.MediaType&&"TvChannel"!==item.Type?showElement("#fldOriginalAspectRatio"):hideElement("#fldOriginalAspectRatio"),"Audio"===item.Type||"Episode"===item.Type||"Season"===item.Type?(showElement("#fldIndexNumber"),"Episode"===item.Type?context.querySelector("#txtIndexNumber").label(globalize.translate("sharedcomponents#LabelEpisodeNumber")):"Season"===item.Type?context.querySelector("#txtIndexNumber").label(globalize.translate("sharedcomponents#LabelSeasonNumber")):"Audio"===item.Type?context.querySelector("#txtIndexNumber").label(globalize.translate("sharedcomponents#LabelTrackNumber")):context.querySelector("#txtIndexNumber").label(globalize.translate("sharedcomponents#LabelNumber"))):hideElement("#fldIndexNumber"),"Audio"===item.Type||"Episode"===item.Type?(showElement("#fldParentIndexNumber"),"Episode"===item.Type?context.querySelector("#txtParentIndexNumber").label(globalize.translate("sharedcomponents#LabelSeasonNumber")):"Audio"===item.Type?context.querySelector("#txtParentIndexNumber").label(globalize.translate("sharedcomponents#LabelDiscNumber")):context.querySelector("#txtParentIndexNumber").label(globalize.translate("sharedcomponents#LabelParentNumber"))):hideElement("#fldParentIndexNumber",context),"BoxSet"===item.Type?(showElement("#fldDisplayOrder",context),hideElement(".seriesDisplayOrderDescription",context),context.querySelector("#selectDisplayOrder").innerHTML='"):"Series"===item.Type?(showElement("#fldDisplayOrder",context),showElement(".seriesDisplayOrderDescription",context),context.querySelector("#selectDisplayOrder").innerHTML=''):(context.querySelector("#selectDisplayOrder").innerHTML="",hideElement("#fldDisplayOrder",context))}function fillItemInfo(context,item,parentalRatingOptions){var select=context.querySelector("#selectOfficialRating");populateRatings(parentalRatingOptions,select,item.OfficialRating),select.value=item.OfficialRating||"",select=context.querySelector("#selectCustomRating"),populateRatings(parentalRatingOptions,select,item.CustomRating),select.value=item.CustomRating||"";var selectStatus=context.querySelector("#selectStatus");populateStatus(selectStatus),selectStatus.value=item.Status||"",context.querySelector("#select3dFormat",context).value=item.Video3DFormat||"",Array.prototype.forEach.call(context.querySelectorAll(".chkAirDay",context),function(el){el.checked=(item.AirDays||[]).indexOf(el.getAttribute("data-day"))!==-1}),populateListView(context.querySelector("#listGenres"),item.Genres),populatePeople(context,item.People||[]),populateListView(context.querySelector("#listStudios"),(item.Studios||[]).map(function(element){return element.Name||""})),populateListView(context.querySelector("#listTags"),item.Tags);var lockData=item.LockData||!1,chkLockData=context.querySelector("#chkLockData");chkLockData.checked=lockData,chkLockData.checked?hideElement(".providerSettingsContainer",context):showElement(".providerSettingsContainer",context),fillMetadataSettings(context,item,item.LockedFields),context.querySelector("#txtPath").value=item.Path||"",context.querySelector("#txtName").value=item.Name||"",context.querySelector("#txtOriginalName").value=item.OriginalTitle||"",context.querySelector("#txtOverview").value=item.Overview||"",context.querySelector("#txtTagline").value=item.Taglines&&item.Taglines.length?item.Taglines[0]:"",context.querySelector("#txtSortName").value=item.ForcedSortName||"",context.querySelector("#txtCommunityRating").value=item.CommunityRating||"",context.querySelector("#txtHomePageUrl").value=item.HomePageUrl||"",context.querySelector("#txtCriticRating").value=item.CriticRating||"",context.querySelector("#txtIndexNumber").value=null==item.IndexNumber?"":item.IndexNumber,context.querySelector("#txtParentIndexNumber").value=null==item.ParentIndexNumber?"":item.ParentIndexNumber,context.querySelector("#txtAbsoluteEpisodeNumber").value="AbsoluteEpisodeNumber"in item?item.AbsoluteEpisodeNumber:"",context.querySelector("#txtDvdEpisodeNumber").value="DvdEpisodeNumber"in item?item.DvdEpisodeNumber:"",context.querySelector("#txtDvdSeasonNumber").value="DvdSeasonNumber"in item?item.DvdSeasonNumber:"",context.querySelector("#txtAirsBeforeSeason").value="AirsBeforeSeasonNumber"in item?item.AirsBeforeSeasonNumber:"",context.querySelector("#txtAirsAfterSeason").value="AirsAfterSeasonNumber"in item?item.AirsAfterSeasonNumber:"",context.querySelector("#txtAirsBeforeEpisode").value="AirsBeforeEpisodeNumber"in item?item.AirsBeforeEpisodeNumber:"",context.querySelector("#txtAlbum").value=item.Album||"",context.querySelector("#txtAlbumArtist").value=(item.AlbumArtists||[]).map(function(a){return a.Name}).join(";"),"Series"===item.Type?context.querySelector("#selectDisplayOrder").value=item.DisplayOrder||"":context.querySelector("#selectDisplayOrder").value=item.DisplayOrder||"",context.querySelector("#txtArtist").value=(item.ArtistItems||[]).map(function(a){return a.Name}).join(";");var date;if(item.DateCreated)try{date=datetime.parseISO8601Date(item.DateCreated,!0),context.querySelector("#txtDateAdded").value=date.toISOString().slice(0,10)}catch(e){context.querySelector("#txtDateAdded").value=""}else context.querySelector("#txtDateAdded").value="";if(item.PremiereDate)try{date=datetime.parseISO8601Date(item.PremiereDate,!0),context.querySelector("#txtPremiereDate").value=date.toISOString().slice(0,10)}catch(e){context.querySelector("#txtPremiereDate").value=""}else context.querySelector("#txtPremiereDate").value="";if(item.EndDate)try{date=datetime.parseISO8601Date(item.EndDate,!0),context.querySelector("#txtEndDate").value=date.toISOString().slice(0,10)}catch(e){context.querySelector("#txtEndDate").value=""}else context.querySelector("#txtEndDate").value="";context.querySelector("#txtProductionYear").value=item.ProductionYear||"",context.querySelector("#txtAirTime").value=item.AirTime||"";var placeofBirth=item.ProductionLocations&&item.ProductionLocations.length?item.ProductionLocations[0]:"";if(context.querySelector("#txtPlaceOfBirth").value=placeofBirth,context.querySelector("#txtOriginalAspectRatio").value=item.AspectRatio||"",context.querySelector("#selectLanguage").value=item.PreferredMetadataLanguage||"",context.querySelector("#selectCountry").value=item.PreferredMetadataCountryCode||"",item.RunTimeTicks){var minutes=item.RunTimeTicks/6e8;context.querySelector("#txtSeriesRuntime").value=Math.round(minutes)}else context.querySelector("#txtSeriesRuntime",context).value=""}function populateRatings(allParentalRatings,select,currentValue){var html="";html+="";var i,length,rating,ratings=[],currentValueFound=!1;for(i=0,length=allParentalRatings.length;i"+rating.Name+"";select.innerHTML=html}function populateStatus(select){var html="";html+="",html+="",html+="",select.innerHTML=html}function populateListView(list,items,sortCallback){items=items||[],"undefined"==typeof sortCallback?items.sort(function(a,b){return a.toLowerCase().localeCompare(b.toLowerCase())}):items=sortCallback(items);for(var html="",i=0;i',html+='live_tv',html+='
',html+='
',html+=items[i],html+="
",html+="
",html+='',html+="
";list.innerHTML=html}function populatePeople(context,people){for(var lastType="",html="",elem=context.querySelector("#peopleList"),i=0,length=people.length;i',html+='person',html+='
',html+='",html+="
",html+='',html+="
"}elem.innerHTML=html}function getLockedFieldsHtml(fields,currentFields){for(var html="",i=0;i",html+=""+name+"",html+=""}return html}function fillMetadataSettings(context,item,lockedFields){var container=context.querySelector(".providerSettingsContainer");lockedFields=lockedFields||[];var lockedFieldsList=[{name:globalize.translate("sharedcomponents#Name"),value:"Name"},{name:globalize.translate("sharedcomponents#Overview"),value:"Overview"},{name:globalize.translate("sharedcomponents#Genres"),value:"Genres"},{name:globalize.translate("sharedcomponents#ParentalRating"),value:"OfficialRating"},{name:globalize.translate("sharedcomponents#People"),value:"Cast"}];"Person"===item.Type?lockedFieldsList.push({name:globalize.translate("sharedcomponents#BirthLocation"),value:"ProductionLocations"}):lockedFieldsList.push({name:globalize.translate("sharedcomponents#ProductionLocations"),value:"ProductionLocations"}),"Series"===item.Type&&lockedFieldsList.push({name:globalize.translate("Runtime"),value:"Runtime"}),lockedFieldsList.push({name:globalize.translate("sharedcomponents#Studios"),value:"Studios"}),lockedFieldsList.push({name:globalize.translate("sharedcomponents#Tags"),value:"Tags"});var html="";html+="

"+globalize.translate("sharedcomponents#HeaderEnabledFields")+"

",html+="

"+globalize.translate("sharedcomponents#HeaderEnabledFieldsHelp")+"

",html+=getLockedFieldsHtml(lockedFieldsList,lockedFields),container.innerHTML=html}function reload(context,itemId,serverId){loading.show(),Promise.all([getItem(itemId,serverId),getEditorConfig(itemId,serverId)]).then(function(responses){var item=responses[0];metadataEditorInfo=responses[1],currentItem=item;var languages=metadataEditorInfo.Cultures,countries=metadataEditorInfo.Countries;renderContentTypeOptions(context,metadataEditorInfo),loadExternalIds(context,item,metadataEditorInfo.ExternalIdInfos),populateLanguages(context.querySelector("#selectLanguage"),languages),populateCountries(context.querySelector("#selectCountry"),countries),setFieldVisibilities(context,item),fillItemInfo(context,item,metadataEditorInfo.ParentalRatingOptions),"Video"===item.MediaType&&"Episode"!==item.Type&&"TvChannel"!==item.Type?showElement("#fldTagline",context):hideElement("#fldTagline",context),loading.hide()})}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function show(itemId,serverId,resolve,reject){loading.show(),require(["text!./metadataeditor.template.html"],function(template){var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="medium-tall";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="";html+=globalize.translateDocument(template,"sharedcomponents"),dlg.innerHTML=html,layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),dialogHelper.open(dlg),dlg.addEventListener("close",function(){layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),resolve()}),currentContext=dlg,init(dlg,connectionManager.getApiClient(serverId)),reload(dlg,itemId,serverId)})}var currentContext,metadataEditorInfo,currentItem;return{show:function(itemId,serverId){return new Promise(function(resolve,reject){return show(itemId,serverId,resolve,reject)})},embed:function(elem,itemId,serverId){return new Promise(function(resolve,reject){loading.show(),require(["text!./metadataeditor.template.html"],function(template){elem.innerHTML=globalize.translateDocument(template,"sharedcomponents"),elem.querySelector(".formDialogFooter").classList.remove("formDialogFooter"),elem.querySelector(".btnHeaderSave").classList.remove("hide"),elem.querySelector(".btnCancel").classList.add("hide"),currentContext=elem,init(elem,connectionManager.getApiClient(serverId)),reload(elem,itemId,serverId),focusManager.autoFocus(elem)})})}}}); \ No newline at end of file +define(["itemHelper","dom","layoutManager","dialogHelper","datetime","loading","focusManager","connectionManager","globalize","require","shell","emby-checkbox","emby-input","emby-select","listViewStyle","emby-textarea","emby-button","paper-icon-button-light","css!./../formdialog","clearButtonStyle","flexStyles"],function(itemHelper,dom,layoutManager,dialogHelper,datetime,loading,focusManager,connectionManager,globalize,require,shell){"use strict";function isDialog(){return currentContext.classList.contains("dialog")}function closeDialog(isSubmitted){isDialog()&&dialogHelper.close(currentContext)}function submitUpdatedItem(form,item){function afterContentTypeUpdated(){require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#MessageItemSaved"))}),loading.hide(),closeDialog(!0)}var apiClient=getApiClient();apiClient.updateItem(item).then(function(){var newContentType=form.querySelector("#selectContentType").value||"";(metadataEditorInfo.ContentType||"")!==newContentType?apiClient.ajax({url:apiClient.getUrl("Items/"+item.Id+"/ContentType",{ContentType:newContentType}),type:"POST"}).then(function(){afterContentTypeUpdated()}):afterContentTypeUpdated()})}function getSelectedAirDays(form){var checkedItems=form.querySelectorAll(".chkAirDay:checked")||[];return Array.prototype.map.call(checkedItems,function(c){return c.getAttribute("data-day")})}function getAlbumArtists(form){return form.querySelector("#txtAlbumArtist").value.trim().split(";").filter(function(s){return s.length>0}).map(function(a){return{Name:a}})}function getArtists(form){return form.querySelector("#txtArtist").value.trim().split(";").filter(function(s){return s.length>0}).map(function(a){return{Name:a}})}function getDateValue(form,element,property){var val=form.querySelector(element).value;if(!val)return null;if(currentItem[property]){var date=datetime.parseISO8601Date(currentItem[property],!0),parts=date.toISOString().split("T");if(0===parts[0].indexOf(val)){val+="T"+parts[1]}}return val}function onSubmit(e){loading.show();var form=this,item={Id:currentItem.Id,Name:form.querySelector("#txtName").value,OriginalTitle:form.querySelector("#txtOriginalName").value,ForcedSortName:form.querySelector("#txtSortName").value,CommunityRating:form.querySelector("#txtCommunityRating").value,HomePageUrl:form.querySelector("#txtHomePageUrl").value,CriticRating:form.querySelector("#txtCriticRating").value,IndexNumber:form.querySelector("#txtIndexNumber").value||null,AbsoluteEpisodeNumber:form.querySelector("#txtAbsoluteEpisodeNumber").value,DvdEpisodeNumber:form.querySelector("#txtDvdEpisodeNumber").value,DvdSeasonNumber:form.querySelector("#txtDvdSeasonNumber").value,AirsBeforeSeasonNumber:form.querySelector("#txtAirsBeforeSeason").value,AirsAfterSeasonNumber:form.querySelector("#txtAirsAfterSeason").value,AirsBeforeEpisodeNumber:form.querySelector("#txtAirsBeforeEpisode").value,ParentIndexNumber:form.querySelector("#txtParentIndexNumber").value||null,DisplayOrder:form.querySelector("#selectDisplayOrder").value,Album:form.querySelector("#txtAlbum").value,AlbumArtists:getAlbumArtists(form),ArtistItems:getArtists(form),Overview:form.querySelector("#txtOverview").value,Status:form.querySelector("#selectStatus").value,AirDays:getSelectedAirDays(form),AirTime:form.querySelector("#txtAirTime").value,Genres:getListValues(form.querySelector("#listGenres")),Tags:getListValues(form.querySelector("#listTags")),Studios:getListValues(form.querySelector("#listStudios")).map(function(element){return{Name:element}}),PremiereDate:getDateValue(form,"#txtPremiereDate","PremiereDate"),DateCreated:getDateValue(form,"#txtDateAdded","DateCreated"),EndDate:getDateValue(form,"#txtEndDate","EndDate"),ProductionYear:form.querySelector("#txtProductionYear").value,AspectRatio:form.querySelector("#txtOriginalAspectRatio").value,Video3DFormat:form.querySelector("#select3dFormat").value,OfficialRating:form.querySelector("#selectOfficialRating").value,CustomRating:form.querySelector("#selectCustomRating").value,People:currentItem.People,LockData:form.querySelector("#chkLockData").checked,LockedFields:Array.prototype.filter.call(form.querySelectorAll(".selectLockedField"),function(c){return!c.checked}).map(function(c){return c.getAttribute("data-value")})};item.ProviderIds=Object.assign({},currentItem.ProviderIds);var idElements=form.querySelectorAll(".txtExternalId");if(Array.prototype.map.call(idElements,function(idElem){var providerKey=idElem.getAttribute("data-providerkey");item.ProviderIds[providerKey]=idElem.value}),item.PreferredMetadataLanguage=form.querySelector("#selectLanguage").value,item.PreferredMetadataCountryCode=form.querySelector("#selectCountry").value,"Person"===currentItem.Type){var placeOfBirth=form.querySelector("#txtPlaceOfBirth").value;item.ProductionLocations=placeOfBirth?[placeOfBirth]:[]}if("Series"===currentItem.Type){var seriesRuntime=form.querySelector("#txtSeriesRuntime").value;item.RunTimeTicks=seriesRuntime?6e8*seriesRuntime:null}var tagline=form.querySelector("#txtTagline").value;return item.Taglines=tagline?[tagline]:[],submitUpdatedItem(form,item),e.preventDefault(),e.stopPropagation(),!1}function getListValues(list){return Array.prototype.map.call(list.querySelectorAll(".textValue"),function(el){return el.textContent})}function addElementToList(source,sortCallback){require(["prompt"],function(prompt){prompt({label:"Value:"}).then(function(text){var list=dom.parentWithClass(source,"editableListviewContainer").querySelector(".paperList"),items=getListValues(list);items.push(text),populateListView(list,items,sortCallback)})})}function removeElementFromList(source){var el=dom.parentWithClass(source,"listItem");el.parentNode.removeChild(el)}function editPerson(context,person,index){require(["personEditor"],function(personEditor){personEditor.show(person).then(function(updatedPerson){-1===index&¤tItem.People.push(updatedPerson),populatePeople(context,currentItem.People)})})}function showMoreMenu(context,button,user){require(["itemContextMenu"],function(itemContextMenu){var item=currentItem;itemContextMenu.show({item:item,positionTo:button,edit:!1,editImages:!0,editSubtitles:!0,sync:!1,share:!1,play:!1,queue:!1,user:user}).then(function(result){result.deleted?afterDeleted(context,item):result.updated&&reload(context,item.Id,item.ServerId)})})}function afterDeleted(context,item){var parentId=item.ParentId||item.SeasonId||item.SeriesId;parentId?reload(context,parentId,item.ServerId):require(["appRouter"],function(appRouter){appRouter.goHome()})}function onEditorClick(e){var btnRemoveFromEditorList=dom.parentWithClass(e.target,"btnRemoveFromEditorList");if(btnRemoveFromEditorList)return void removeElementFromList(btnRemoveFromEditorList);var btnAddTextItem=dom.parentWithClass(e.target,"btnAddTextItem");btnAddTextItem&&addElementToList(btnAddTextItem)}function getApiClient(){return connectionManager.getApiClient(currentItem.ServerId)}function init(context,apiClient){context.querySelector(".externalIds").addEventListener("click",function(e){var btnOpenExternalId=dom.parentWithClass(e.target,"btnOpenExternalId");if(btnOpenExternalId){var field=context.querySelector("#"+btnOpenExternalId.getAttribute("data-fieldid")),formatString=field.getAttribute("data-formatstring");field.value&&shell.openUrl(formatString.replace("{0}",field.value))}}),context.querySelector(".btnCancel").addEventListener("click",function(){closeDialog(!1)}),context.querySelector(".btnMore").addEventListener("click",function(e){getApiClient().getCurrentUser().then(function(user){showMoreMenu(context,e.target,user)})}),context.querySelector(".btnHeaderSave").addEventListener("click",function(e){context.querySelector(".btnSave").click()}),context.querySelector("#chkLockData").addEventListener("click",function(e){e.target.checked?hideElement(".providerSettingsContainer"):showElement(".providerSettingsContainer")}),context.removeEventListener("click",onEditorClick),context.addEventListener("click",onEditorClick);var form=context.querySelector("form");form.removeEventListener("submit",onSubmit),form.addEventListener("submit",onSubmit),context.querySelector("#btnAddPerson").addEventListener("click",function(event,data){editPerson(context,{},-1)}),context.querySelector("#peopleList").addEventListener("click",function(e){var index,btnDeletePerson=dom.parentWithClass(e.target,"btnDeletePerson");btnDeletePerson&&(index=parseInt(btnDeletePerson.getAttribute("data-index")),currentItem.People.splice(index,1),populatePeople(context,currentItem.People));var btnEditPerson=dom.parentWithClass(e.target,"btnEditPerson");btnEditPerson&&(index=parseInt(btnEditPerson.getAttribute("data-index")),editPerson(context,currentItem.People[index],index))})}function getItem(itemId,serverId){var apiClient=connectionManager.getApiClient(serverId);return itemId?apiClient.getItem(apiClient.getCurrentUserId(),itemId):apiClient.getRootFolder(apiClient.getCurrentUserId())}function getEditorConfig(itemId,serverId){var apiClient=connectionManager.getApiClient(serverId);return itemId?apiClient.getJSON(apiClient.getUrl("Items/"+itemId+"/MetadataEditor")):Promise.resolve({})}function populateCountries(select,allCountries){var html="";html+="";for(var i=0,length=allCountries.length;i"+culture.DisplayName+""}select.innerHTML=html}function populateLanguages(select,languages){var html="";html+="";for(var i=0,length=languages.length;i"+culture.DisplayName+""}select.innerHTML=html}function renderContentTypeOptions(context,metadataInfo){metadataInfo.ContentTypeOptions.length?showElement("#fldContentType",context):hideElement("#fldContentType",context);var html=metadataInfo.ContentTypeOptions.map(function(i){return'"}).join(""),selectEl=context.querySelector("#selectContentType");selectEl.innerHTML=html,selectEl.value=metadataInfo.ContentType||""}function loadExternalIds(context,item,externalIds){for(var html="",providerIds=item.ProviderIds||{},i=0,length=externalIds.length;i',html+='
';var value=providerIds[idInfo.Key]||"";html+='
',html+='',html+="
",formatString&&(html+=''),html+="
",html+="
"}context.querySelector(".externalIds",context).innerHTML=html,externalIds.length?context.querySelector(".externalIdsSection").classList.remove("hide"):context.querySelector(".externalIdsSection").classList.add("hide")}function hideElement(selector,context,multiple){if(context=context||document,"string"==typeof selector){var elements=multiple?context.querySelectorAll(selector):[context.querySelector(selector)];Array.prototype.forEach.call(elements,function(el){el&&el.classList.add("hide")})}else selector.classList.add("hide")}function showElement(selector,context,multiple){if(context=context||document,"string"==typeof selector){var elements=multiple?context.querySelectorAll(selector):[context.querySelector(selector)];Array.prototype.forEach.call(elements,function(el){el&&el.classList.remove("hide")})}else selector.classList.remove("hide")}function setFieldVisibilities(context,item){item.Path&&!1!==item.EnableMediaSourceDisplay?showElement("#fldPath",context):hideElement("#fldPath",context),"Series"===item.Type||"Movie"===item.Type||"Trailer"===item.Type?showElement("#fldOriginalName",context):hideElement("#fldOriginalName",context),"Series"===item.Type?showElement("#fldSeriesRuntime",context):hideElement("#fldSeriesRuntime",context),"Series"===item.Type||"Person"===item.Type?showElement("#fldEndDate",context):hideElement("#fldEndDate",context),"MusicAlbum"===item.Type?showElement("#albumAssociationMessage",context):hideElement("#albumAssociationMessage",context),"Movie"===item.Type||"Trailer"===item.Type?showElement("#fldCriticRating",context):hideElement("#fldCriticRating",context),"Series"===item.Type?(showElement("#fldStatus",context),showElement("#fldAirDays",context),showElement("#fldAirTime",context)):(hideElement("#fldStatus",context),hideElement("#fldAirDays",context),hideElement("#fldAirTime",context)),"Video"===item.MediaType&&"TvChannel"!==item.Type?showElement("#fld3dFormat",context):hideElement("#fld3dFormat",context),"Audio"===item.Type?showElement("#fldAlbumArtist",context):hideElement("#fldAlbumArtist",context),"Audio"===item.Type||"MusicVideo"===item.Type?(showElement("#fldArtist",context),showElement("#fldAlbum",context)):(hideElement("#fldArtist",context),hideElement("#fldAlbum",context)),"Episode"===item.Type?showElement("#collapsibleDvdEpisodeInfo",context):hideElement("#collapsibleDvdEpisodeInfo",context),"Episode"===item.Type&&0===item.ParentIndexNumber?showElement("#collapsibleSpecialEpisodeInfo",context):hideElement("#collapsibleSpecialEpisodeInfo",context),"Person"===item.Type||"Genre"===item.Type||"Studio"===item.Type||"GameGenre"===item.Type||"MusicGenre"===item.Type||"TvChannel"===item.Type||"Book"===item.Type?hideElement("#peopleCollapsible",context):showElement("#peopleCollapsible",context),"Person"===item.Type||"Genre"===item.Type||"Studio"===item.Type||"GameGenre"===item.Type||"MusicGenre"===item.Type||"TvChannel"===item.Type?(hideElement("#fldCommunityRating",context),hideElement("#genresCollapsible",context),hideElement("#studiosCollapsible",context),"TvChannel"===item.Type?showElement("#fldOfficialRating",context):hideElement("#fldOfficialRating",context),hideElement("#fldCustomRating",context)):(showElement("#fldCommunityRating",context),showElement("#genresCollapsible",context),showElement("#studiosCollapsible",context),showElement("#fldOfficialRating",context),showElement("#fldCustomRating",context)),showElement("#tagsCollapsible",context),"TvChannel"===item.Type?(hideElement("#metadataSettingsCollapsible",context),hideElement("#fldPremiereDate",context),hideElement("#fldDateAdded",context),hideElement("#fldYear",context)):(showElement("#metadataSettingsCollapsible",context),showElement("#fldPremiereDate",context),showElement("#fldDateAdded",context),showElement("#fldYear",context)),"TvChannel"===item.Type?hideElement(".overviewContainer",context):showElement(".overviewContainer",context),"TvChannel"===item.Type?hideElement(".websiteFieldContainer",context):showElement(".websiteFieldContainer",context),"Person"===item.Type?(context.querySelector("#txtProductionYear").label(globalize.translate("sharedcomponents#LabelBirthYear")),context.querySelector("#txtPremiereDate").label(globalize.translate("sharedcomponents#LabelBirthDate")),context.querySelector("#txtEndDate").label(globalize.translate("sharedcomponents#LabelDeathDate")),showElement("#fldPlaceOfBirth")):(context.querySelector("#txtProductionYear").label(globalize.translate("sharedcomponents#LabelYear")),context.querySelector("#txtPremiereDate").label(globalize.translate("sharedcomponents#LabelReleaseDate")),context.querySelector("#txtEndDate").label(globalize.translate("sharedcomponents#LabelEndDate")),hideElement("#fldPlaceOfBirth")),"Video"===item.MediaType&&"TvChannel"!==item.Type?showElement("#fldOriginalAspectRatio"):hideElement("#fldOriginalAspectRatio"),"Audio"===item.Type||"Episode"===item.Type||"Season"===item.Type?(showElement("#fldIndexNumber"),"Episode"===item.Type?context.querySelector("#txtIndexNumber").label(globalize.translate("sharedcomponents#LabelEpisodeNumber")):"Season"===item.Type?context.querySelector("#txtIndexNumber").label(globalize.translate("sharedcomponents#LabelSeasonNumber")):"Audio"===item.Type?context.querySelector("#txtIndexNumber").label(globalize.translate("sharedcomponents#LabelTrackNumber")):context.querySelector("#txtIndexNumber").label(globalize.translate("sharedcomponents#LabelNumber"))):hideElement("#fldIndexNumber"),"Audio"===item.Type||"Episode"===item.Type?(showElement("#fldParentIndexNumber"),"Episode"===item.Type?context.querySelector("#txtParentIndexNumber").label(globalize.translate("sharedcomponents#LabelSeasonNumber")):"Audio"===item.Type?context.querySelector("#txtParentIndexNumber").label(globalize.translate("sharedcomponents#LabelDiscNumber")):context.querySelector("#txtParentIndexNumber").label(globalize.translate("sharedcomponents#LabelParentNumber"))):hideElement("#fldParentIndexNumber",context),"BoxSet"===item.Type?(showElement("#fldDisplayOrder",context),hideElement(".seriesDisplayOrderDescription",context),context.querySelector("#selectDisplayOrder").innerHTML='"):"Series"===item.Type?(showElement("#fldDisplayOrder",context),showElement(".seriesDisplayOrderDescription",context),context.querySelector("#selectDisplayOrder").innerHTML=''):(context.querySelector("#selectDisplayOrder").innerHTML="",hideElement("#fldDisplayOrder",context))}function fillItemInfo(context,item,parentalRatingOptions){var select=context.querySelector("#selectOfficialRating");populateRatings(parentalRatingOptions,select,item.OfficialRating),select.value=item.OfficialRating||"",select=context.querySelector("#selectCustomRating"),populateRatings(parentalRatingOptions,select,item.CustomRating),select.value=item.CustomRating||"";var selectStatus=context.querySelector("#selectStatus");populateStatus(selectStatus),selectStatus.value=item.Status||"",context.querySelector("#select3dFormat",context).value=item.Video3DFormat||"",Array.prototype.forEach.call(context.querySelectorAll(".chkAirDay",context),function(el){el.checked=-1!==(item.AirDays||[]).indexOf(el.getAttribute("data-day"))}),populateListView(context.querySelector("#listGenres"),item.Genres),populatePeople(context,item.People||[]),populateListView(context.querySelector("#listStudios"),(item.Studios||[]).map(function(element){return element.Name||""})),populateListView(context.querySelector("#listTags"),item.Tags);var lockData=item.LockData||!1,chkLockData=context.querySelector("#chkLockData");chkLockData.checked=lockData,chkLockData.checked?hideElement(".providerSettingsContainer",context):showElement(".providerSettingsContainer",context),fillMetadataSettings(context,item,item.LockedFields),context.querySelector("#txtPath").value=item.Path||"",context.querySelector("#txtName").value=item.Name||"",context.querySelector("#txtOriginalName").value=item.OriginalTitle||"",context.querySelector("#txtOverview").value=item.Overview||"",context.querySelector("#txtTagline").value=item.Taglines&&item.Taglines.length?item.Taglines[0]:"",context.querySelector("#txtSortName").value=item.ForcedSortName||"",context.querySelector("#txtCommunityRating").value=item.CommunityRating||"",context.querySelector("#txtHomePageUrl").value=item.HomePageUrl||"",context.querySelector("#txtCriticRating").value=item.CriticRating||"",context.querySelector("#txtIndexNumber").value=null==item.IndexNumber?"":item.IndexNumber,context.querySelector("#txtParentIndexNumber").value=null==item.ParentIndexNumber?"":item.ParentIndexNumber,context.querySelector("#txtAbsoluteEpisodeNumber").value="AbsoluteEpisodeNumber"in item?item.AbsoluteEpisodeNumber:"",context.querySelector("#txtDvdEpisodeNumber").value="DvdEpisodeNumber"in item?item.DvdEpisodeNumber:"",context.querySelector("#txtDvdSeasonNumber").value="DvdSeasonNumber"in item?item.DvdSeasonNumber:"",context.querySelector("#txtAirsBeforeSeason").value="AirsBeforeSeasonNumber"in item?item.AirsBeforeSeasonNumber:"",context.querySelector("#txtAirsAfterSeason").value="AirsAfterSeasonNumber"in item?item.AirsAfterSeasonNumber:"",context.querySelector("#txtAirsBeforeEpisode").value="AirsBeforeEpisodeNumber"in item?item.AirsBeforeEpisodeNumber:"",context.querySelector("#txtAlbum").value=item.Album||"",context.querySelector("#txtAlbumArtist").value=(item.AlbumArtists||[]).map(function(a){return a.Name}).join(";"),item.Type,context.querySelector("#selectDisplayOrder").value=item.DisplayOrder||"",context.querySelector("#txtArtist").value=(item.ArtistItems||[]).map(function(a){return a.Name}).join(";");var date;if(item.DateCreated)try{date=datetime.parseISO8601Date(item.DateCreated,!0),context.querySelector("#txtDateAdded").value=date.toISOString().slice(0,10)}catch(e){context.querySelector("#txtDateAdded").value=""}else context.querySelector("#txtDateAdded").value="";if(item.PremiereDate)try{date=datetime.parseISO8601Date(item.PremiereDate,!0),context.querySelector("#txtPremiereDate").value=date.toISOString().slice(0,10)}catch(e){context.querySelector("#txtPremiereDate").value=""}else context.querySelector("#txtPremiereDate").value="";if(item.EndDate)try{date=datetime.parseISO8601Date(item.EndDate,!0),context.querySelector("#txtEndDate").value=date.toISOString().slice(0,10)}catch(e){context.querySelector("#txtEndDate").value=""}else context.querySelector("#txtEndDate").value="";context.querySelector("#txtProductionYear").value=item.ProductionYear||"",context.querySelector("#txtAirTime").value=item.AirTime||"";var placeofBirth=item.ProductionLocations&&item.ProductionLocations.length?item.ProductionLocations[0]:"";if(context.querySelector("#txtPlaceOfBirth").value=placeofBirth,context.querySelector("#txtOriginalAspectRatio").value=item.AspectRatio||"",context.querySelector("#selectLanguage").value=item.PreferredMetadataLanguage||"",context.querySelector("#selectCountry").value=item.PreferredMetadataCountryCode||"",item.RunTimeTicks){var minutes=item.RunTimeTicks/6e8;context.querySelector("#txtSeriesRuntime").value=Math.round(minutes)}else context.querySelector("#txtSeriesRuntime",context).value=""}function populateRatings(allParentalRatings,select,currentValue){var html="";html+="";var i,length,rating,ratings=[],currentValueFound=!1;for(i=0,length=allParentalRatings.length;i"+rating.Name+"";select.innerHTML=html}function populateStatus(select){var html="";html+="",html+="",html+="",select.innerHTML=html}function populateListView(list,items,sortCallback){items=items||[],void 0===sortCallback?items.sort(function(a,b){return a.toLowerCase().localeCompare(b.toLowerCase())}):items=sortCallback(items);for(var html="",i=0;i',html+='live_tv',html+='
',html+='
',html+=items[i],html+="
",html+="
",html+='',html+="
";list.innerHTML=html}function populatePeople(context,people){for(var html="",elem=context.querySelector("#peopleList"),i=0,length=people.length;i',html+='person',html+='
',html+='",html+="
",html+='',html+="
"}elem.innerHTML=html}function getLockedFieldsHtml(fields,currentFields){for(var html="",i=0;i",html+=""+name+"",html+=""}return html}function fillMetadataSettings(context,item,lockedFields){var container=context.querySelector(".providerSettingsContainer");lockedFields=lockedFields||[];var lockedFieldsList=[{name:globalize.translate("sharedcomponents#Name"),value:"Name"},{name:globalize.translate("sharedcomponents#Overview"),value:"Overview"},{name:globalize.translate("sharedcomponents#Genres"),value:"Genres"},{name:globalize.translate("sharedcomponents#ParentalRating"),value:"OfficialRating"},{name:globalize.translate("sharedcomponents#People"),value:"Cast"}];"Person"===item.Type?lockedFieldsList.push({name:globalize.translate("sharedcomponents#BirthLocation"),value:"ProductionLocations"}):lockedFieldsList.push({name:globalize.translate("sharedcomponents#ProductionLocations"),value:"ProductionLocations"}),"Series"===item.Type&&lockedFieldsList.push({name:globalize.translate("Runtime"),value:"Runtime"}),lockedFieldsList.push({name:globalize.translate("sharedcomponents#Studios"),value:"Studios"}),lockedFieldsList.push({name:globalize.translate("sharedcomponents#Tags"),value:"Tags"});var html="";html+="

"+globalize.translate("sharedcomponents#HeaderEnabledFields")+"

",html+="

"+globalize.translate("sharedcomponents#HeaderEnabledFieldsHelp")+"

",html+=getLockedFieldsHtml(lockedFieldsList,lockedFields),container.innerHTML=html}function reload(context,itemId,serverId){loading.show(),Promise.all([getItem(itemId,serverId),getEditorConfig(itemId,serverId)]).then(function(responses){var item=responses[0];metadataEditorInfo=responses[1],currentItem=item;var languages=metadataEditorInfo.Cultures,countries=metadataEditorInfo.Countries;renderContentTypeOptions(context,metadataEditorInfo),loadExternalIds(context,item,metadataEditorInfo.ExternalIdInfos),populateLanguages(context.querySelector("#selectLanguage"),languages),populateCountries(context.querySelector("#selectCountry"),countries),setFieldVisibilities(context,item),fillItemInfo(context,item,metadataEditorInfo.ParentalRatingOptions),"Video"===item.MediaType&&"Episode"!==item.Type&&"TvChannel"!==item.Type?showElement("#fldTagline",context):hideElement("#fldTagline",context),loading.hide()})}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function show(itemId,serverId,resolve,reject){loading.show(),require(["text!./metadataeditor.template.html"],function(template){var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="medium-tall";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="";html+=globalize.translateDocument(template,"sharedcomponents"),dlg.innerHTML=html,layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),dialogHelper.open(dlg),dlg.addEventListener("close",function(){layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),resolve()}),currentContext=dlg,init(dlg,connectionManager.getApiClient(serverId)),reload(dlg,itemId,serverId)})}var currentContext,metadataEditorInfo,currentItem;return{show:function(itemId,serverId){return new Promise(function(resolve,reject){return show(itemId,serverId,resolve,reject)})},embed:function(elem,itemId,serverId){return new Promise(function(resolve,reject){loading.show(),require(["text!./metadataeditor.template.html"],function(template){elem.innerHTML=globalize.translateDocument(template,"sharedcomponents"),elem.querySelector(".formDialogFooter").classList.remove("formDialogFooter"),elem.querySelector(".btnHeaderSave").classList.remove("hide"),elem.querySelector(".btnCancel").classList.add("hide"),currentContext=elem,init(elem,connectionManager.getApiClient(serverId)),reload(elem,itemId,serverId),focusManager.autoFocus(elem)})})}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/multidownload.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/multidownload.js index 49f10cfaab..f47128cdd2 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/multidownload.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/multidownload.js @@ -1 +1 @@ -define(["browser"],function(browser){"use strict";function fallback(urls){var i=0;!function createIframe(){var frame=document.createElement("iframe");frame.style.display="none",frame.src=urls[i++],document.documentElement.appendChild(frame);var interval=setInterval(function(){"complete"!==frame.contentWindow.document.readyState&&"interactive"!==frame.contentWindow.document.readyState||(clearInterval(interval),setTimeout(function(){frame.parentNode.removeChild(frame)},1e3),i";var chkItemSelect=itemSelectionPanel.querySelector(".chkItemSelect");chkItemSelect.addEventListener("change",onSelectionChange)}}function showSelectionCommands(){var selectionCommandsPanel=currentSelectionCommandsPanel;if(!selectionCommandsPanel){selectionCommandsPanel=document.createElement("div"),selectionCommandsPanel.classList.add("selectionCommandsPanel"),document.body.appendChild(selectionCommandsPanel),currentSelectionCommandsPanel=selectionCommandsPanel;var html="";html+='',html+='

';var moreIcon="dots-horiz"===appHost.moreIcon?"":"";html+='",selectionCommandsPanel.innerHTML=html,selectionCommandsPanel.querySelector(".btnCloseSelectionPanel").addEventListener("click",hideSelections);var btnSelectionPanelOptions=selectionCommandsPanel.querySelector(".btnSelectionPanelOptions");dom.addEventListener(btnSelectionPanelOptions,"click",showMenuForSelectedItems,{passive:!0})}}function alertText(options){return new Promise(function(resolve,reject){require(["alert"],function(alert){alert(options).then(resolve,resolve)})})}function deleteItems(apiClient,itemIds){return new Promise(function(resolve,reject){var msg=globalize.translate("sharedcomponents#ConfirmDeleteItem"),title=globalize.translate("sharedcomponents#HeaderDeleteItem");itemIds.length>1&&(msg=globalize.translate("sharedcomponents#ConfirmDeleteItems"),title=globalize.translate("sharedcomponents#HeaderDeleteItems")),require(["confirm"],function(confirm){confirm(msg,title).then(function(){var promises=itemIds.map(function(itemId){apiClient.deleteItem(itemId)});Promise.all(promises).then(resolve,function(){alertText(globalize.translate("sharedcomponents#ErrorDeletingItem")).then(reject,reject)})},reject)})})}function showMenuForSelectedItems(e){var apiClient=connectionManager.currentApiClient();apiClient.getCurrentUser().then(function(user){var menuItems=[];menuItems.push({name:globalize.translate("sharedcomponents#AddToCollection"),id:"addtocollection",ironIcon:"add"}),menuItems.push({name:globalize.translate("sharedcomponents#AddToPlaylist"),id:"playlist",ironIcon:"playlist-add"}),user.Policy.EnableContentDeletion&&menuItems.push({name:globalize.translate("sharedcomponents#Delete"),id:"delete",ironIcon:"delete"}),user.Policy.EnableContentDownloading&&appHost.supports("filedownload"),user.Policy.EnableContentDownloading&&appHost.supports("sync")&&menuItems.push({name:globalize.translate("sharedcomponents#Download"),id:"synclocal"}),menuItems.push({name:globalize.translate("sharedcomponents#GroupVersions"),id:"groupvideos",ironIcon:"call-merge"}),menuItems.push({name:globalize.translate("sharedcomponents#MarkPlayed"),id:"markplayed"}),menuItems.push({name:globalize.translate("sharedcomponents#MarkUnplayed"),id:"markunplayed"}),menuItems.push({name:globalize.translate("sharedcomponents#RefreshMetadata"),id:"refresh"}),user.Policy.EnableContentDownloading&&menuItems.push({name:globalize.translate("sharedcomponents#Sync"),id:"sync"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:e.target,callback:function(id){var items=selectedItems.slice(0),serverId=apiClient.serverInfo().Id;switch(id){case"addtocollection":require(["collectionEditor"],function(collectionEditor){(new collectionEditor).show({items:items,serverId:serverId})}),hideSelections(),dispatchNeedsRefresh();break;case"playlist":require(["playlistEditor"],function(playlistEditor){(new playlistEditor).show({items:items,serverId:serverId})}),hideSelections(),dispatchNeedsRefresh();break;case"delete":deleteItems(apiClient,items).then(dispatchNeedsRefresh),hideSelections(),dispatchNeedsRefresh();break;case"groupvideos":combineVersions(apiClient,items);break;case"markplayed":items.forEach(function(itemId){apiClient.markPlayed(apiClient.getCurrentUserId(),itemId)}),hideSelections(),dispatchNeedsRefresh();break;case"markunplayed":items.forEach(function(itemId){apiClient.markUnplayed(apiClient.getCurrentUserId(),itemId)}),hideSelections(),dispatchNeedsRefresh();break;case"refresh":require(["refreshDialog"],function(refreshDialog){new refreshDialog({itemIds:items,serverId:serverId}).show()}),hideSelections(),dispatchNeedsRefresh();break;case"sync":require(["syncDialog"],function(syncDialog){syncDialog.showMenu({items:items.map(function(i){return{Id:i}}),serverId:serverId})}),hideSelections(),dispatchNeedsRefresh();break;case"synclocal":require(["syncDialog"],function(syncDialog){syncDialog.showMenu({items:items.map(function(i){return{Id:i}}),isLocalSync:!0,serverId:serverId})}),hideSelections(),dispatchNeedsRefresh()}}})})})}function dispatchNeedsRefresh(){var elems=[];[].forEach.call(selectedElements,function(i){var container=dom.parentWithAttribute(i,"is","emby-itemscontainer");container&&elems.indexOf(container)===-1&&elems.push(container)});for(var i=0,length=elems.length;i=5||deltaY>=5)&&onMouseOut(e)}}function onTouchEnd(e){onMouseOut(e)}function onMouseDown(e){touchStartTimeout&&(clearTimeout(touchStartTimeout),touchStartTimeout=null),touchTarget=e.target,touchStartTimeout=setTimeout(onTouchStartTimerFired,550)}function onMouseOut(e){touchStartTimeout&&(clearTimeout(touchStartTimeout),touchStartTimeout=null),touchTarget=null}function onTouchStartTimerFired(){if(touchTarget){var card=dom.parentWithClass(touchTarget,"card");touchTarget=null,card&&showSelections(card)}}function initTapHold(element){browser.touch&&!browser.safari?element.addEventListener("contextmenu",onTapHold):(dom.addEventListener(element,"touchstart",onTouchStart,{passive:!0}),dom.addEventListener(element,"touchmove",onTouchMove,{passive:!0}),dom.addEventListener(element,"touchend",onTouchEnd,{passive:!0}),dom.addEventListener(element,"touchcancel",onTouchEnd,{passive:!0}),dom.addEventListener(element,"mousedown",onMouseDown,{passive:!0}),dom.addEventListener(element,"mouseleave",onMouseOut,{passive:!0}),dom.addEventListener(element,"mouseup",onMouseOut,{passive:!0}))}var touchTarget,touchStartTimeout,touchStartX,touchStartY,self=this,container=options.container;initTapHold(container),options.bindOnClick!==!1&&container.addEventListener("click",onContainerClick),self.onContainerClick=onContainerClick,self.destroy=function(){container.removeEventListener("click",onContainerClick),container.removeEventListener("contextmenu",onTapHold);var element=container;dom.removeEventListener(element,"touchstart",onTouchStart,{passive:!0}),dom.removeEventListener(element,"touchmove",onTouchMove,{passive:!0}),dom.removeEventListener(element,"touchend",onTouchEnd,{passive:!0}),dom.removeEventListener(element,"mousedown",onMouseDown,{passive:!0}),dom.removeEventListener(element,"mouseleave",onMouseOut,{passive:!0}),dom.removeEventListener(element,"mouseup",onMouseOut,{passive:!0})}}}); \ No newline at end of file +define(["browser","appStorage","apphost","loading","connectionManager","globalize","appRouter","dom","css!./multiselect"],function(browser,appStorage,appHost,loading,connectionManager,globalize,appRouter,dom){"use strict";function hideSelections(){var selectionCommandsPanel=currentSelectionCommandsPanel;if(selectionCommandsPanel){selectionCommandsPanel.parentNode.removeChild(selectionCommandsPanel),currentSelectionCommandsPanel=null,selectedItems=[],selectedElements=[];for(var elems=document.querySelectorAll(".itemSelectionPanel"),i=0,length=elems.length;i";itemSelectionPanel.querySelector(".chkItemSelect").addEventListener("change",onSelectionChange)}}function showSelectionCommands(){var selectionCommandsPanel=currentSelectionCommandsPanel;if(!selectionCommandsPanel){selectionCommandsPanel=document.createElement("div"),selectionCommandsPanel.classList.add("selectionCommandsPanel"),document.body.appendChild(selectionCommandsPanel),currentSelectionCommandsPanel=selectionCommandsPanel;var html="";html+='',html+='

';html+='",selectionCommandsPanel.innerHTML=html,selectionCommandsPanel.querySelector(".btnCloseSelectionPanel").addEventListener("click",hideSelections);var btnSelectionPanelOptions=selectionCommandsPanel.querySelector(".btnSelectionPanelOptions");dom.addEventListener(btnSelectionPanelOptions,"click",showMenuForSelectedItems,{passive:!0})}}function alertText(options){return new Promise(function(resolve,reject){require(["alert"],function(alert){alert(options).then(resolve,resolve)})})}function deleteItems(apiClient,itemIds){return new Promise(function(resolve,reject){var msg=globalize.translate("sharedcomponents#ConfirmDeleteItem"),title=globalize.translate("sharedcomponents#HeaderDeleteItem");itemIds.length>1&&(msg=globalize.translate("sharedcomponents#ConfirmDeleteItems"),title=globalize.translate("sharedcomponents#HeaderDeleteItems")),require(["confirm"],function(confirm){confirm(msg,title).then(function(){var promises=itemIds.map(function(itemId){apiClient.deleteItem(itemId)});Promise.all(promises).then(resolve,function(){alertText(globalize.translate("sharedcomponents#ErrorDeletingItem")).then(reject,reject)})},reject)})})}function showMenuForSelectedItems(e){var apiClient=connectionManager.currentApiClient();apiClient.getCurrentUser().then(function(user){var menuItems=[];menuItems.push({name:globalize.translate("sharedcomponents#AddToCollection"),id:"addtocollection",ironIcon:"add"}),menuItems.push({name:globalize.translate("sharedcomponents#AddToPlaylist"),id:"playlist",ironIcon:"playlist-add"}),user.Policy.EnableContentDeletion&&menuItems.push({name:globalize.translate("sharedcomponents#Delete"),id:"delete",ironIcon:"delete"}),user.Policy.EnableContentDownloading&&appHost.supports("filedownload"),user.Policy.EnableContentDownloading&&appHost.supports("sync")&&menuItems.push({name:globalize.translate("sharedcomponents#Download"),id:"synclocal"}),menuItems.push({name:globalize.translate("sharedcomponents#GroupVersions"),id:"groupvideos",ironIcon:"call-merge"}),menuItems.push({name:globalize.translate("sharedcomponents#MarkPlayed"),id:"markplayed"}),menuItems.push({name:globalize.translate("sharedcomponents#MarkUnplayed"),id:"markunplayed"}),menuItems.push({name:globalize.translate("sharedcomponents#RefreshMetadata"),id:"refresh"}),user.Policy.EnableContentDownloading&&menuItems.push({name:globalize.translate("sharedcomponents#Sync"),id:"sync"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:e.target,callback:function(id){var items=selectedItems.slice(0),serverId=apiClient.serverInfo().Id;switch(id){case"addtocollection":require(["collectionEditor"],function(collectionEditor){(new collectionEditor).show({items:items,serverId:serverId})}),hideSelections(),dispatchNeedsRefresh();break;case"playlist":require(["playlistEditor"],function(playlistEditor){(new playlistEditor).show({items:items,serverId:serverId})}),hideSelections(),dispatchNeedsRefresh();break;case"delete":deleteItems(apiClient,items).then(dispatchNeedsRefresh),hideSelections(),dispatchNeedsRefresh();break;case"groupvideos":combineVersions(apiClient,items);break;case"markplayed":items.forEach(function(itemId){apiClient.markPlayed(apiClient.getCurrentUserId(),itemId)}),hideSelections(),dispatchNeedsRefresh();break;case"markunplayed":items.forEach(function(itemId){apiClient.markUnplayed(apiClient.getCurrentUserId(),itemId)}),hideSelections(),dispatchNeedsRefresh();break;case"refresh":require(["refreshDialog"],function(refreshDialog){new refreshDialog({itemIds:items,serverId:serverId}).show()}),hideSelections(),dispatchNeedsRefresh();break;case"sync":require(["syncDialog"],function(syncDialog){syncDialog.showMenu({items:items.map(function(i){return{Id:i}}),serverId:serverId})}),hideSelections(),dispatchNeedsRefresh();break;case"synclocal":require(["syncDialog"],function(syncDialog){syncDialog.showMenu({items:items.map(function(i){return{Id:i}}),isLocalSync:!0,serverId:serverId})}),hideSelections(),dispatchNeedsRefresh()}}})})})}function dispatchNeedsRefresh(){var elems=[];[].forEach.call(selectedElements,function(i){var container=dom.parentWithAttribute(i,"is","emby-itemscontainer");container&&-1===elems.indexOf(container)&&elems.push(container)});for(var i=0,length=elems.length;i=5||deltaY>=5)&&onMouseOut(e)}}function onTouchEnd(e){onMouseOut(e)}function onMouseDown(e){touchStartTimeout&&(clearTimeout(touchStartTimeout),touchStartTimeout=null),touchTarget=e.target,touchStartTimeout=setTimeout(onTouchStartTimerFired,550)}function onMouseOut(e){touchStartTimeout&&(clearTimeout(touchStartTimeout),touchStartTimeout=null),touchTarget=null}function onTouchStartTimerFired(){if(touchTarget){var card=dom.parentWithClass(touchTarget,"card");touchTarget=null,card&&showSelections(card)}}var touchTarget,touchStartTimeout,touchStartX,touchStartY,self=this,container=options.container;!function(element){browser.touch&&!browser.safari?element.addEventListener("contextmenu",onTapHold):(dom.addEventListener(element,"touchstart",onTouchStart,{passive:!0}),dom.addEventListener(element,"touchmove",onTouchMove,{passive:!0}),dom.addEventListener(element,"touchend",onTouchEnd,{passive:!0}),dom.addEventListener(element,"touchcancel",onTouchEnd,{passive:!0}),dom.addEventListener(element,"mousedown",onMouseDown,{passive:!0}),dom.addEventListener(element,"mouseleave",onMouseOut,{passive:!0}),dom.addEventListener(element,"mouseup",onMouseOut,{passive:!0}))}(container),!1!==options.bindOnClick&&container.addEventListener("click",onContainerClick),self.onContainerClick=onContainerClick,self.destroy=function(){container.removeEventListener("click",onContainerClick),container.removeEventListener("contextmenu",onTapHold);var element=container;dom.removeEventListener(element,"touchstart",onTouchStart,{passive:!0}),dom.removeEventListener(element,"touchmove",onTouchMove,{passive:!0}),dom.removeEventListener(element,"touchend",onTouchEnd,{passive:!0}),dom.removeEventListener(element,"mousedown",onMouseDown,{passive:!0}),dom.removeEventListener(element,"mouseleave",onMouseOut,{passive:!0}),dom.removeEventListener(element,"mouseup",onMouseOut,{passive:!0})}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/native-promise-only/lib/npo.src.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/native-promise-only/lib/npo.src.js index 9378074fbc..a0c48d0ece 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/native-promise-only/lib/npo.src.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/native-promise-only/lib/npo.src.js @@ -1 +1 @@ -!function(name,context,definition){context[name]=definition(),"undefined"!=typeof module&&module.exports?module.exports=context[name]:"function"==typeof define&&define.amd&&define(function(){return context[name]})}("Promise","undefined"!=typeof global?global:this,function(){"use strict";function schedule(fn,self){scheduling_queue.add(fn,self),cycle||(cycle=timer(scheduling_queue.drain))}function isThenable(o){var _then,o_type=typeof o;return null==o||"object"!=o_type&&"function"!=o_type||(_then=o.then),"function"==typeof _then&&_then}function notify(){for(var i=0;i0&&schedule(notify,self))}catch(err){reject.call(new MakeDefWrapper(self),err)}}}function reject(msg){var self=this;self.triggered||(self.triggered=!0,self.def&&(self=self.def),self.msg=msg,self.state=2,self.chain.length>0&&schedule(notify,self))}function iteratePromises(Constructor,arr,resolver,rejecter){for(var idx=0;idx0&&schedule(notify,self))}catch(err){reject.call(new MakeDefWrapper(self),err)}}}function reject(msg){var self=this;self.triggered||(self.triggered=!0,self.def&&(self=self.def),self.msg=msg,self.state=2,self.chain.length>0&&schedule(notify,self))}function iteratePromises(Constructor,arr,resolver,rejecter){for(var idx=0;idx12&&(newItems.length=12),apiClient.getItems(apiClient.getCurrentUserId(),{Recursive:!0,Limit:3,Filters:"IsNotFolder",SortBy:"DateCreated",SortOrder:"Descending",Ids:newItems.join(","),MediaTypes:"Audio,Video",EnableTotalRecordCount:!1}).then(function(result){for(var items=result.Items,i=0,length=items.length;i12&&(newItems.length=12),apiClient.getItems(apiClient.getCurrentUserId(),{Recursive:!0,Limit:3,Filters:"IsNotFolder",SortBy:"DateCreated",SortOrder:"Descending",Ids:newItems.join(","),MediaTypes:"Audio,Video",EnableTotalRecordCount:!1}).then(function(result){for(var items=result.Items,i=0,length=items.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,textLines=nowPlayingItem?nowPlayingHelper.getNowPlayingNames(nowPlayingItem):[];textLines.length>1&&(textLines[1].secondary=!0);var serverId=nowPlayingItem?nowPlayingItem.ServerId:null;nowPlayingTextElement.innerHTML=textLines.map(function(nowPlayingName){var cssClass=nowPlayingName.secondary?' class="nowPlayingBarSecondaryText"':"";return nowPlayingName.item?""+getTextActionButton(nowPlayingName.item,nowPlayingName.text,serverId)+"":""+nowPlayingName.text+""}).join("");var imgHeight=70,url=nowPlayingItem?seriesImageUrl(nowPlayingItem,{height:imgHeight})||imageUrl(nowPlayingItem,{height:imgHeight}):null,isRefreshing=!1;if(url!==currentImgUrl&&(currentImgUrl=url,isRefreshing=!0,imageLoader.lazyImage(nowPlayingImageElement,url)),nowPlayingItem.Id){if(isRefreshing){var apiClient=connectionManager.getApiClient(nowPlayingItem.ServerId);apiClient.getItem(apiClient.getCurrentUserId(),nowPlayingItem.Id).then(function(item){var userData=item.UserData||{},likes=null==userData.Likes?"":userData.Likes;nowPlayingUserData.innerHTML=''})}}else nowPlayingUserData.innerHTML=""}function onPlaybackStart(e,state){var player=this;onStateChanged.call(player,e,state)}function onRepeatModeChange(e){if(isEnabled){var player=this;updateRepeatModeDisplay(playbackManager.getRepeatMode(player))}}function showNowPlayingBar(){return isVisibilityAllowed?void getNowPlayingBar().then(slideUp):void hideNowPlayingBar()}function hideNowPlayingBar(){isEnabled=!1;var elem=document.getElementsByClassName("nowPlayingBar")[0];elem&&slideDown(elem)}function onPlaybackStopped(e,state){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||layoutManager.tv?void hideNowPlayingBar():player.isLocalPlayer&&state.NowPlayingItem&&"Video"===state.NowPlayingItem.MediaType?void hideNowPlayingBar():(isEnabled=!0,nowPlayingBarElement?void updatePlayerStateInternal(event,state,player):void getNowPlayingBar().then(function(){updatePlayerStateInternal(event,state,player)}))}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,playbackManager.getBufferedRanges(player))}}}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,"unpause",onPlayPauseStateChanged),events.off(player,"timeupdate",onTimeUpdate),currentPlayer=null,hideNowPlayingBar())}function onVolumeChanged(e){if(isEnabled){var player=this;updatePlayerVolumeState(player.isMuted(),player.getVolume())}}function refreshFromPlayer(player){var state=playbackManager.getPlayerState(player);onStateChanged.call(player,{type:"init"},state)}function bindToPlayer(player){player!==currentPlayer&&(releaseCurrentPlayer(),currentPlayer=player,player&&(refreshFromPlayer(player),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,"unpause",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,isVisibilityAllowed=!0;events.on(playbackManager,"playerchange",function(){bindToPlayer(playbackManager.getCurrentPlayer())}),bindToPlayer(playbackManager.getCurrentPlayer()),document.addEventListener("viewbeforeshow",function(e){e.detail.options.enableMediaControl?isVisibilityAllowed||(isVisibilityAllowed=!0,currentPlayer?refreshFromPlayer(currentPlayer):hideNowPlayingBar()):isVisibilityAllowed&&(isVisibilityAllowed=!1,hideNowPlayingBar())})}); \ No newline at end of file +define(["require","datetime","itemHelper","events","browser","imageLoader","layoutManager","playbackManager","nowPlayingHelper","apphost","dom","connectionManager","paper-icon-button-light","emby-ratingbutton"],function(require,datetime,itemHelper,events,browser,imageLoader,layoutManager,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){elem.offsetWidth,elem.classList.add("nowPlayingBar-hidden"),dom.addEventListener(elem,dom.whichTransitionEvent(),onSlideDownComplete,{once:!0})}function slideUp(elem){dom.removeEventListener(elem,dom.whichTransitionEvent(),onSlideDownComplete,{once:!0}),elem.classList.remove("hide"),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,textLines=nowPlayingItem?nowPlayingHelper.getNowPlayingNames(nowPlayingItem):[];textLines.length>1&&(textLines[1].secondary=!0);var serverId=nowPlayingItem?nowPlayingItem.ServerId:null;nowPlayingTextElement.innerHTML=textLines.map(function(nowPlayingName){var cssClass=nowPlayingName.secondary?' class="nowPlayingBarSecondaryText"':"";return nowPlayingName.item?""+getTextActionButton(nowPlayingName.item,nowPlayingName.text,serverId)+"":""+nowPlayingName.text+""}).join("");var url=nowPlayingItem?seriesImageUrl(nowPlayingItem,{height:70})||imageUrl(nowPlayingItem,{height:70}):null,isRefreshing=!1;if(url!==currentImgUrl&&(currentImgUrl=url,isRefreshing=!0,imageLoader.lazyImage(nowPlayingImageElement,url)),nowPlayingItem.Id){if(isRefreshing){var apiClient=connectionManager.getApiClient(nowPlayingItem.ServerId);apiClient.getItem(apiClient.getCurrentUserId(),nowPlayingItem.Id).then(function(item){var userData=item.UserData||{},likes=null==userData.Likes?"":userData.Likes;nowPlayingUserData.innerHTML=''})}}else nowPlayingUserData.innerHTML=""}function onPlaybackStart(e,state){var player=this;onStateChanged.call(player,e,state)}function onRepeatModeChange(e){if(isEnabled){var player=this;updateRepeatModeDisplay(playbackManager.getRepeatMode(player))}}function showNowPlayingBar(){if(!isVisibilityAllowed)return void hideNowPlayingBar();getNowPlayingBar().then(slideUp)}function hideNowPlayingBar(){isEnabled=!1;var elem=document.getElementsByClassName("nowPlayingBar")[0];elem&&slideDown(elem)}function onPlaybackStopped(e,state){this.isLocalPlayer?"Audio"!==state.NextMediaType&&hideNowPlayingBar():state.NextMediaType||hideNowPlayingBar()}function onPlayPauseStateChanged(e){if(isEnabled){updatePlayPauseState(this.paused())}}function onStateChanged(event,state){var player=this;return!state.NowPlayingItem||layoutManager.tv?void hideNowPlayingBar():player.isLocalPlayer&&state.NowPlayingItem&&"Video"===state.NowPlayingItem.MediaType?void hideNowPlayingBar():(isEnabled=!0,nowPlayingBarElement?void updatePlayerStateInternal(event,state,player):void getNowPlayingBar().then(function(){updatePlayerStateInternal(event,state,player)}))}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,playbackManager.getBufferedRanges(player))}}}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,"unpause",onPlayPauseStateChanged),events.off(player,"timeupdate",onTimeUpdate),currentPlayer=null,hideNowPlayingBar())}function onVolumeChanged(e){if(isEnabled){var player=this;updatePlayerVolumeState(player.isMuted(),player.getVolume())}}function refreshFromPlayer(player){var state=playbackManager.getPlayerState(player);onStateChanged.call(player,{type:"init"},state)}function bindToPlayer(player){player!==currentPlayer&&(releaseCurrentPlayer(),currentPlayer=player,player&&(refreshFromPlayer(player),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,"unpause",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,isVisibilityAllowed=!0;events.on(playbackManager,"playerchange",function(){bindToPlayer(playbackManager.getCurrentPlayer())}),bindToPlayer(playbackManager.getCurrentPlayer()),document.addEventListener("viewbeforeshow",function(e){e.detail.options.enableMediaControl?isVisibilityAllowed||(isVisibilityAllowed=!0,currentPlayer?refreshFromPlayer(currentPlayer):hideNowPlayingBar()):isVisibilityAllowed&&(isVisibilityAllowed=!1,hideNowPlayingBar())})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/packagemanager.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/packagemanager.js index 18bc41b82a..9da2a3cddc 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/packagemanager.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/packagemanager.js @@ -1 +1 @@ -define(["appSettings","pluginManager"],function(appSettings,pluginManager){"use strict";function addPackage(packageManager,pkg){packageManager.packagesList=packageManager.packagesList.filter(function(p){return p.name!==pkg.name}),packageManager.packagesList.push(pkg)}function removeUrl(url){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]");manifestUrls=manifestUrls.filter(function(i){return i!==url}),appSettings.set(settingsKey,JSON.stringify(manifestUrls))}function loadPackage(packageManager,url,throwError){return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest,originalUrl=url;url+=url.indexOf("?")===-1?"?":"&",url+="t="+(new Date).getTime(),xhr.open("GET",url,!0);var onError=function(){throwError===!0?reject():(removeUrl(originalUrl),resolve())};xhr.onload=function(e){if(this.status<400){var pkg=JSON.parse(this.response);pkg.url=originalUrl,addPackage(packageManager,pkg);var plugins=pkg.plugins||[];pkg.plugin&&plugins.push(pkg.plugin);var promises=plugins.map(function(pluginUrl){return pluginManager.loadPlugin(packageManager.mapPath(pkg,pluginUrl))});Promise.all(promises).then(resolve,resolve)}else onError()},xhr.onerror=onError,xhr.send()})}function PackageManager(){this.packagesList=[]}var settingsKey="installedpackages1";return PackageManager.prototype.init=function(){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]"),instance=this;return Promise.all(manifestUrls.map(function(u){return loadPackage(instance,u)})).then(function(){return Promise.resolve()},function(){return Promise.resolve()})},PackageManager.prototype.packages=function(){return this.packagesList.slice(0)},PackageManager.prototype.install=function(url){return loadPackage(this,url,!0).then(function(pkg){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]");return manifestUrls.indexOf(url)===-1&&(manifestUrls.push(url),appSettings.set(settingsKey,JSON.stringify(manifestUrls))),pkg})},PackageManager.prototype.uninstall=function(name){var pkg=this.packagesList.filter(function(p){return p.name===name})[0];return pkg&&(this.packagesList=this.packagesList.filter(function(p){return p.name!==name}),removeUrl(pkg.url)),Promise.resolve()},PackageManager.prototype.mapPath=function(pkg,pluginUrl){var urlLower=pluginUrl.toLowerCase();if(0===urlLower.indexOf("http:")||0===urlLower.indexOf("https:")||0===urlLower.indexOf("file:"))return pluginUrl;var packageUrl=pkg.url;return packageUrl=packageUrl.substring(0,packageUrl.lastIndexOf("/")),packageUrl+="/",packageUrl+=pluginUrl},new PackageManager}); \ No newline at end of file +define(["appSettings","pluginManager"],function(appSettings,pluginManager){"use strict";function addPackage(packageManager,pkg){packageManager.packagesList=packageManager.packagesList.filter(function(p){return p.name!==pkg.name}),packageManager.packagesList.push(pkg)}function removeUrl(url){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]");manifestUrls=manifestUrls.filter(function(i){return i!==url}),appSettings.set(settingsKey,JSON.stringify(manifestUrls))}function loadPackage(packageManager,url,throwError){return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest,originalUrl=url;url+=-1===url.indexOf("?")?"?":"&",url+="t="+(new Date).getTime(),xhr.open("GET",url,!0);var onError=function(){!0===throwError?reject():(removeUrl(originalUrl),resolve())};xhr.onload=function(e){if(this.status<400){var pkg=JSON.parse(this.response);pkg.url=originalUrl,addPackage(packageManager,pkg);var plugins=pkg.plugins||[];pkg.plugin&&plugins.push(pkg.plugin);var promises=plugins.map(function(pluginUrl){return pluginManager.loadPlugin(packageManager.mapPath(pkg,pluginUrl))});Promise.all(promises).then(resolve,resolve)}else onError()},xhr.onerror=onError,xhr.send()})}function PackageManager(){this.packagesList=[]}var settingsKey="installedpackages1";return PackageManager.prototype.init=function(){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]"),instance=this;return Promise.all(manifestUrls.map(function(u){return loadPackage(instance,u)})).then(function(){return Promise.resolve()},function(){return Promise.resolve()})},PackageManager.prototype.packages=function(){return this.packagesList.slice(0)},PackageManager.prototype.install=function(url){return loadPackage(this,url,!0).then(function(pkg){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]");return-1===manifestUrls.indexOf(url)&&(manifestUrls.push(url),appSettings.set(settingsKey,JSON.stringify(manifestUrls))),pkg})},PackageManager.prototype.uninstall=function(name){var pkg=this.packagesList.filter(function(p){return p.name===name})[0];return pkg&&(this.packagesList=this.packagesList.filter(function(p){return p.name!==name}),removeUrl(pkg.url)),Promise.resolve()},PackageManager.prototype.mapPath=function(pkg,pluginUrl){var urlLower=pluginUrl.toLowerCase();if(0===urlLower.indexOf("http:")||0===urlLower.indexOf("https:")||0===urlLower.indexOf("file:"))return pluginUrl;var packageUrl=pkg.url;return packageUrl=packageUrl.substring(0,packageUrl.lastIndexOf("/")),packageUrl+="/",packageUrl+=pluginUrl},new PackageManager}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/pagejs/page.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/pagejs/page.js index 44b123dada..a511e7593b 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/pagejs/page.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/pagejs/page.js @@ -1 +1 @@ -define([],function(){"use strict";function page(path,fn){if("function"==typeof path)return page("*",path);if("function"==typeof fn)for(var route=new Route(path),i=1;i0){if(enableHistory)history.back();else if(backStack.length>2){backStack.length--;var previousState=backStack[backStack.length-1];page.show(previousState.path,previousState.state,!0,!1,!0)}page.len--}else path?setTimeout(function(){page.show(path,state)}):setTimeout(function(){page.show(base,state)})},page.enableNativeHistory=function(){return enableHistory},page.canGoBack=function(){return enableHistory?history.length>1:(page.len||0)>0},page.redirect=function(from,to){"string"==typeof from&&"string"==typeof to&&page(from,function(e){setTimeout(function(){page.replace(to)},0)}),"string"==typeof from&&"undefined"==typeof to&&setTimeout(function(){page.replace(from)},0)},page.replace=function(path,state,init,dispatch,isBack){var ctx=new Context(path,state);return ctx.isBack=isBack,page.current=ctx.path,ctx.init=init,ctx.save(),!1!==dispatch&&page.dispatch(ctx),ctx},page.dispatch=function(ctx){function nextExit(){var fn=page.exits[j++];return fn?void fn(prev,nextExit):nextEnter()}function nextEnter(){var fn=page.callbacks[i++];return ctx.path!==page.current?void(ctx.handled=!1):fn?void fn(ctx,nextEnter):unhandled(ctx)}var prev=prevContext,i=0,j=0;prevPageContext=prevContext,prevContext=ctx,prev?nextExit():nextEnter()},page.exit=function(path,fn){if("function"==typeof path)return page.exit("*",path);for(var route=new Route(path),i=1;i0){if(enableHistory)history.back();else if(backStack.length>2){backStack.length--;var previousState=backStack[backStack.length-1];page.show(previousState.path,previousState.state,!0,!1,!0)}page.len--}else path?setTimeout(function(){page.show(path,state)}):setTimeout(function(){page.show(base,state)})},page.enableNativeHistory=function(){return enableHistory},page.canGoBack=function(){return enableHistory?history.length>1:(page.len||0)>0},page.redirect=function(from,to){"string"==typeof from&&"string"==typeof to&&page(from,function(e){setTimeout(function(){page.replace(to)},0)}),"string"==typeof from&&void 0===to&&setTimeout(function(){page.replace(from)},0)},page.replace=function(path,state,init,dispatch,isBack){var ctx=new Context(path,state);return ctx.isBack=isBack,page.current=ctx.path,ctx.init=init,ctx.save(),!1!==dispatch&&page.dispatch(ctx),ctx},page.dispatch=function(ctx){function nextExit(){var fn=page.exits[j++];if(!fn)return nextEnter();fn(prev,nextExit)}function nextEnter(){var fn=page.callbacks[i++];return ctx.path!==page.current?void(ctx.handled=!1):fn?void fn(ctx,nextEnter):unhandled(ctx)}var prev=prevContext,i=0,j=0;prevPageContext=prevContext,prevContext=ctx,prev?nextExit():nextEnter()},page.exit=function(path,fn){if("function"==typeof path)return page.exit("*",path);for(var route=new Route(path),i=1;i=80?iconElement.innerHTML="":brightness>=20?iconElement.innerHTML="":iconElement.innerHTML=""),progressElement&&(progressElement.style.width=(brightness||0)+"%")}function releaseCurrentPlayer(){var player=currentPlayer;player&&(events.off(player,"brightnesschange",onBrightnessChanged),events.off(player,"playbackstop",hideOsd),currentPlayer=null)}function onBrightnessChanged(e){var player=this;ensureOsdElement(),updateElementsFromPlayer(playbackManager.getBrightness(player)),showOsd()}function bindToPlayer(player){player!==currentPlayer&&(releaseCurrentPlayer(),currentPlayer=player,player&&(hideOsd(),events.on(player,"brightnesschange",onBrightnessChanged),events.on(player,"playbackstop",hideOsd)))}var currentPlayer,osdElement,iconElement,progressElement,enableAnimation,hideTimeout;events.on(playbackManager,"playerchange",function(){bindToPlayer(playbackManager.getCurrentPlayer())}),bindToPlayer(playbackManager.getCurrentPlayer())}); \ No newline at end of file +define(["events","playbackManager","dom","browser","css!./iconosd","material-icons"],function(events,playbackManager,dom,browser){"use strict";function getOsdElementHtml(){var html="";return html+='',html+='
'}function ensureOsdElement(){var elem=osdElement;elem||(enableAnimation=browser.supportsCssAnimation(),elem=document.createElement("div"),elem.classList.add("hide"),elem.classList.add("iconOsd"),elem.classList.add("iconOsd-hidden"),elem.classList.add("brightnessOsd"),elem.innerHTML=getOsdElementHtml(),iconElement=elem.querySelector("i"),progressElement=elem.querySelector(".iconOsdProgressInner"),document.body.appendChild(elem),osdElement=elem)}function onHideComplete(){this.classList.add("hide")}function showOsd(){clearHideTimeout();var elem=osdElement;dom.removeEventListener(elem,dom.whichTransitionEvent(),onHideComplete,{once:!0}),elem.classList.remove("hide"),elem.offsetWidth,requestAnimationFrame(function(){elem.classList.remove("iconOsd-hidden"),hideTimeout=setTimeout(hideOsd,3e3)})}function clearHideTimeout(){hideTimeout&&(clearTimeout(hideTimeout),hideTimeout=null)}function hideOsd(){clearHideTimeout();var elem=osdElement;elem&&(enableAnimation?(elem.offsetWidth,requestAnimationFrame(function(){elem.classList.add("iconOsd-hidden"),dom.addEventListener(elem,dom.whichTransitionEvent(),onHideComplete,{once:!0})})):onHideComplete.call(elem))}function updateElementsFromPlayer(brightness){iconElement&&(iconElement.innerHTML=brightness>=80?"":brightness>=20?"":""),progressElement&&(progressElement.style.width=(brightness||0)+"%")}function releaseCurrentPlayer(){var player=currentPlayer;player&&(events.off(player,"brightnesschange",onBrightnessChanged),events.off(player,"playbackstop",hideOsd),currentPlayer=null)}function onBrightnessChanged(e){var player=this;ensureOsdElement(),updateElementsFromPlayer(playbackManager.getBrightness(player)),showOsd()}function bindToPlayer(player){player!==currentPlayer&&(releaseCurrentPlayer(),currentPlayer=player,player&&(hideOsd(),events.on(player,"brightnesschange",onBrightnessChanged),events.on(player,"playbackstop",hideOsd)))}var currentPlayer,osdElement,iconElement,progressElement,enableAnimation,hideTimeout;events.on(playbackManager,"playerchange",function(){bindToPlayer(playbackManager.getCurrentPlayer())}),bindToPlayer(playbackManager.getCurrentPlayer())}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/experimentalwarnings.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/experimentalwarnings.js index 5d1c1238e6..9b7dc4784c 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/experimentalwarnings.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/experimentalwarnings.js @@ -1 +1 @@ -define(["connectionManager","globalize","userSettings","apphost"],function(connectionManager,globalize,userSettings,appHost){"use strict";function showMessage(text,userSettingsKey,appHostFeature){return userSettingsKey+=(new Date).getMonth(),appHost.supports(appHostFeature)?Promise.resolve():"1"===userSettings.get(userSettingsKey,!1)?Promise.resolve():new Promise(function(resolve,reject){userSettings.set(userSettingsKey,"1",!1),require(["alert"],function(alert){return alert(text).then(resolve,resolve)})})}function showBlurayMessage(){var message="Playback of Bluray folders in this app is experimental. Some titles may not work at all. For a better experience, consider converting to mkv video files, or use an Emby app with native Bluray folder support.";return showMessage(message,"blurayexpirementalinfo","nativeblurayplayback")}function showDvdMessage(){var message="Playback of Dvd folders in this app is experimental. Some titles may not work at all. For a better experience, consider converting to mkv video files, or use an Emby app with native Dvd folder support.";return showMessage(message,"dvdexpirementalinfo","nativedvdplayback")}function showIsoMessage(){var message="Playback of ISO files in this app is experimental. Some titles may not work at all. For a better experience, consider converting to mkv video files, or use an Emby app with native ISO support.";return showMessage(message,"isoexpirementalinfo","nativeisoplayback")}function ExpirementalPlaybackWarnings(){this.name="Experimental playback warnings",this.type="preplayintercept",this.id="expirementalplaybackwarnings"}return ExpirementalPlaybackWarnings.prototype.intercept=function(options){var item=options.item;return item?"Iso"===item.VideoType?showIsoMessage():"BluRay"===item.VideoType?showBlurayMessage():"Dvd"===item.VideoType?showDvdMessage():Promise.resolve():Promise.resolve()},ExpirementalPlaybackWarnings}); \ No newline at end of file +define(["connectionManager","globalize","userSettings","apphost"],function(connectionManager,globalize,userSettings,appHost){"use strict";function showMessage(text,userSettingsKey,appHostFeature){return userSettingsKey+=(new Date).getMonth(),appHost.supports(appHostFeature)?Promise.resolve():"1"===userSettings.get(userSettingsKey,!1)?Promise.resolve():new Promise(function(resolve,reject){userSettings.set(userSettingsKey,"1",!1),require(["alert"],function(alert){return alert(text).then(resolve,resolve)})})}function showBlurayMessage(){return showMessage("Playback of Bluray folders in this app is experimental. Some titles may not work at all. For a better experience, consider converting to mkv video files, or use an Emby app with native Bluray folder support.","blurayexpirementalinfo","nativeblurayplayback")}function showDvdMessage(){return showMessage("Playback of Dvd folders in this app is experimental. Some titles may not work at all. For a better experience, consider converting to mkv video files, or use an Emby app with native Dvd folder support.","dvdexpirementalinfo","nativedvdplayback")}function showIsoMessage(){return showMessage("Playback of ISO files in this app is experimental. Some titles may not work at all. For a better experience, consider converting to mkv video files, or use an Emby app with native ISO support.","isoexpirementalinfo","nativeisoplayback")}function ExpirementalPlaybackWarnings(){this.name="Experimental playback warnings",this.type="preplayintercept",this.id="expirementalplaybackwarnings"}return ExpirementalPlaybackWarnings.prototype.intercept=function(options){var item=options.item;return item?"Iso"===item.VideoType?showIsoMessage():"BluRay"===item.VideoType?showBlurayMessage():"Dvd"===item.VideoType?showDvdMessage():Promise.resolve():Promise.resolve()},ExpirementalPlaybackWarnings}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/mediasession.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/mediasession.js index 21858520ea..3bdb53cf31 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/mediasession.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/mediasession.js @@ -1 +1 @@ -define(["playbackManager","nowPlayingHelper","events","connectionManager"],function(playbackManager,nowPlayingHelper,events,connectionManager){"use strict";function seriesImageUrl(item,options){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){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.Id,options)):item.AlbumId&&item.AlbumPrimaryImageTag?(options.tag=item.AlbumPrimaryImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.AlbumId,options)):null}function pushImageUrl(item,height,list){var imageOptions={height:height},url=seriesImageUrl(item,imageOptions)||imageUrl(item,imageOptions);url&&list.push({src:url,sizes:height+"x"+height})}function getImageUrls(item){var list=[];return pushImageUrl(item,96,list),pushImageUrl(item,128,list),pushImageUrl(item,192,list),pushImageUrl(item,256,list),pushImageUrl(item,384,list),pushImageUrl(item,512,list),list}function updatePlayerState(player,state,eventName){var item=state.NowPlayingItem;if(!item)return void hideMediaControls();var playState=state.PlayState||{},parts=nowPlayingHelper.getNowPlayingNames(item),artist=1===parts.length?"":parts[0].text,title=parts[parts.length-1].text,isVideo="Video"===item.MediaType;if(isVideo&&parts.length>1){var temp=artist;artist=title,title=temp}var albumArtist;item.AlbumArtists&&item.AlbumArtists[0]&&(albumArtist=item.AlbumArtists[0].Name);var album=item.Album||"",itemId=item.Id,duration=parseInt(item.RunTimeTicks?item.RunTimeTicks/1e4:0),currentTime=parseInt(playState.PositionTicks?playState.PositionTicks/1e4:0),isPaused=playState.IsPaused||!1;playState.CanSeek||!1;navigator.mediaSession.metadata=new MediaMetadata({title:title,artist:artist,album:album,artwork:getImageUrls(item),albumArtist:albumArtist,currentTime:currentTime,duration:duration,paused:isPaused,itemId:itemId,mediaType:item.MediaType})}function onGeneralEvent(e){var player=this,state=playbackManager.getPlayerState(player);updatePlayerState(player,state,e.type)}function onStateChanged(e,state){var player=this;updatePlayerState(player,state,"statechange")}function onPlaybackStart(e,state){console.log("nowplaying event: "+e.type);var player=this;updatePlayerState(player,state,e.type)}function onPlaybackStopped(e,state){console.log("nowplaying event: "+e.type);hideMediaControls()}function releaseCurrentPlayer(){currentPlayer&&(events.off(currentPlayer,"playbackstart",onPlaybackStart),events.off(currentPlayer,"playbackstop",onPlaybackStopped),events.off(currentPlayer,"unpause",onGeneralEvent),events.off(currentPlayer,"pause",onGeneralEvent),events.off(currentPlayer,"statechange",onStateChanged),events.off(currentPlayer,"timeupdate",onGeneralEvent),currentPlayer=null,hideMediaControls())}function hideMediaControls(){navigator.mediaSession.metadata=null}function bindToPlayer(player){if(releaseCurrentPlayer(),player){currentPlayer=player,console.log("binding remotecontrols to "+player.name);var state=playbackManager.getPlayerState(player);updatePlayerState(player,state,"init"),events.on(currentPlayer,"playbackstart",onPlaybackStart),events.on(currentPlayer,"playbackstop",onPlaybackStopped),events.on(currentPlayer,"unpause",onGeneralEvent),events.on(currentPlayer,"pause",onGeneralEvent),events.on(currentPlayer,"statechange",onStateChanged),events.on(currentPlayer,"timeupdate",onGeneralEvent)}}function execute(name){playbackManager[name](currentPlayer)}var currentPlayer;console.log("binding remotecontrols to playbackManager"),navigator.mediaSession.setActionHandler("previoustrack",function(){execute("previousTrack")}),navigator.mediaSession.setActionHandler("nexttrack",function(){execute("nextTrack")}),navigator.mediaSession.setActionHandler("play",function(){execute("unpause")}),navigator.mediaSession.setActionHandler("pause",function(){execute("pause")}),navigator.mediaSession.setActionHandler("seekbackward",function(){execute("rewind")}),navigator.mediaSession.setActionHandler("seekforward",function(){execute("fastForward")}),events.on(playbackManager,"playerchange",function(){bindToPlayer(playbackManager.getCurrentPlayer())}),bindToPlayer(playbackManager.getCurrentPlayer())}); \ No newline at end of file +define(["playbackManager","nowPlayingHelper","events","connectionManager"],function(playbackManager,nowPlayingHelper,events,connectionManager){"use strict";function seriesImageUrl(item,options){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){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.Id,options)):item.AlbumId&&item.AlbumPrimaryImageTag?(options.tag=item.AlbumPrimaryImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.AlbumId,options)):null}function pushImageUrl(item,height,list){var imageOptions={height:height},url=seriesImageUrl(item,imageOptions)||imageUrl(item,imageOptions);url&&list.push({src:url,sizes:height+"x"+height})}function getImageUrls(item){var list=[];return pushImageUrl(item,96,list),pushImageUrl(item,128,list),pushImageUrl(item,192,list),pushImageUrl(item,256,list),pushImageUrl(item,384,list),pushImageUrl(item,512,list),list}function updatePlayerState(player,state,eventName){var item=state.NowPlayingItem;if(!item)return void hideMediaControls();var playState=state.PlayState||{},parts=nowPlayingHelper.getNowPlayingNames(item),artist=1===parts.length?"":parts[0].text,title=parts[parts.length-1].text;if("Video"===item.MediaType&&parts.length>1){var temp=artist;artist=title,title=temp}var albumArtist;item.AlbumArtists&&item.AlbumArtists[0]&&(albumArtist=item.AlbumArtists[0].Name);var album=item.Album||"",itemId=item.Id,duration=parseInt(item.RunTimeTicks?item.RunTimeTicks/1e4:0),currentTime=parseInt(playState.PositionTicks?playState.PositionTicks/1e4:0),isPaused=playState.IsPaused||!1;navigator.mediaSession.metadata=new MediaMetadata({title:title,artist:artist,album:album,artwork:getImageUrls(item),albumArtist:albumArtist,currentTime:currentTime,duration:duration,paused:isPaused,itemId:itemId,mediaType:item.MediaType})}function onGeneralEvent(e){var player=this;updatePlayerState(player,playbackManager.getPlayerState(player),e.type)}function onStateChanged(e,state){updatePlayerState(this,state,"statechange")}function onPlaybackStart(e,state){console.log("nowplaying event: "+e.type),updatePlayerState(this,state,e.type)}function onPlaybackStopped(e,state){console.log("nowplaying event: "+e.type);hideMediaControls()}function releaseCurrentPlayer(){currentPlayer&&(events.off(currentPlayer,"playbackstart",onPlaybackStart),events.off(currentPlayer,"playbackstop",onPlaybackStopped),events.off(currentPlayer,"unpause",onGeneralEvent),events.off(currentPlayer,"pause",onGeneralEvent),events.off(currentPlayer,"statechange",onStateChanged),events.off(currentPlayer,"timeupdate",onGeneralEvent),currentPlayer=null,hideMediaControls())}function hideMediaControls(){navigator.mediaSession.metadata=null}function bindToPlayer(player){if(releaseCurrentPlayer(),player){currentPlayer=player,console.log("binding remotecontrols to "+player.name);updatePlayerState(player,playbackManager.getPlayerState(player),"init"),events.on(currentPlayer,"playbackstart",onPlaybackStart),events.on(currentPlayer,"playbackstop",onPlaybackStopped),events.on(currentPlayer,"unpause",onGeneralEvent),events.on(currentPlayer,"pause",onGeneralEvent),events.on(currentPlayer,"statechange",onStateChanged),events.on(currentPlayer,"timeupdate",onGeneralEvent)}}function execute(name){playbackManager[name](currentPlayer)}var currentPlayer;console.log("binding remotecontrols to playbackManager"),navigator.mediaSession.setActionHandler("previoustrack",function(){execute("previousTrack")}),navigator.mediaSession.setActionHandler("nexttrack",function(){execute("nextTrack")}),navigator.mediaSession.setActionHandler("play",function(){execute("unpause")}),navigator.mediaSession.setActionHandler("pause",function(){execute("pause")}),navigator.mediaSession.setActionHandler("seekbackward",function(){execute("rewind")}),navigator.mediaSession.setActionHandler("seekforward",function(){execute("fastForward")}),events.on(playbackManager,"playerchange",function(){bindToPlayer(playbackManager.getCurrentPlayer())}),bindToPlayer(playbackManager.getCurrentPlayer())}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/nowplayinghelper.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/nowplayinghelper.js index d4bbf0b1b7..56781729c1 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/nowplayinghelper.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/nowplayinghelper.js @@ -1 +1 @@ -define([],function(){"use strict";function getNowPlayingNames(nowPlayingItem,includeNonNameInfo){var topItem=nowPlayingItem,bottomItem=null,topText=nowPlayingItem.Name;nowPlayingItem.AlbumId&&"Audio"===nowPlayingItem.MediaType&&(topItem={Id:nowPlayingItem.AlbumId,Name:nowPlayingItem.Album,Type:"MusicAlbum",IsFolder:!0}),"Video"===nowPlayingItem.MediaType&&(null!=nowPlayingItem.IndexNumber&&(topText=nowPlayingItem.IndexNumber+" - "+topText),null!=nowPlayingItem.ParentIndexNumber&&(topText=nowPlayingItem.ParentIndexNumber+"."+topText));var bottomText="";nowPlayingItem.ArtistItems&&nowPlayingItem.ArtistItems.length?(bottomItem={Id:nowPlayingItem.ArtistItems[0].Id,Name:nowPlayingItem.ArtistItems[0].Name,Type:"MusicArtist",IsFolder:!0},bottomText=nowPlayingItem.ArtistItems.map(function(a){return a.Name}).join(", ")):nowPlayingItem.Artists&&nowPlayingItem.Artists.length?bottomText=nowPlayingItem.Artists.join(", "):nowPlayingItem.SeriesName||nowPlayingItem.Album?(bottomText=topText,topText=nowPlayingItem.SeriesName||nowPlayingItem.Album,bottomItem=topItem,topItem=nowPlayingItem.SeriesId?{Id:nowPlayingItem.SeriesId,Name:nowPlayingItem.SeriesName,Type:"Series",IsFolder:!0}:null):nowPlayingItem.ProductionYear&&includeNonNameInfo!==!1&&(bottomText=nowPlayingItem.ProductionYear);var list=[];return list.push({text:topText,item:topItem}),bottomText&&list.push({text:bottomText,item:bottomItem}),list}return{getNowPlayingNames:getNowPlayingNames}}); \ No newline at end of file +define([],function(){"use strict";function getNowPlayingNames(nowPlayingItem,includeNonNameInfo){var topItem=nowPlayingItem,bottomItem=null,topText=nowPlayingItem.Name;nowPlayingItem.AlbumId&&"Audio"===nowPlayingItem.MediaType&&(topItem={Id:nowPlayingItem.AlbumId,Name:nowPlayingItem.Album,Type:"MusicAlbum",IsFolder:!0}),"Video"===nowPlayingItem.MediaType&&(null!=nowPlayingItem.IndexNumber&&(topText=nowPlayingItem.IndexNumber+" - "+topText),null!=nowPlayingItem.ParentIndexNumber&&(topText=nowPlayingItem.ParentIndexNumber+"."+topText));var bottomText="";nowPlayingItem.ArtistItems&&nowPlayingItem.ArtistItems.length?(bottomItem={Id:nowPlayingItem.ArtistItems[0].Id,Name:nowPlayingItem.ArtistItems[0].Name,Type:"MusicArtist",IsFolder:!0},bottomText=nowPlayingItem.ArtistItems.map(function(a){return a.Name}).join(", ")):nowPlayingItem.Artists&&nowPlayingItem.Artists.length?bottomText=nowPlayingItem.Artists.join(", "):nowPlayingItem.SeriesName||nowPlayingItem.Album?(bottomText=topText,topText=nowPlayingItem.SeriesName||nowPlayingItem.Album,bottomItem=topItem,topItem=nowPlayingItem.SeriesId?{Id:nowPlayingItem.SeriesId,Name:nowPlayingItem.SeriesName,Type:"Series",IsFolder:!0}:null):nowPlayingItem.ProductionYear&&!1!==includeNonNameInfo&&(bottomText=nowPlayingItem.ProductionYear);var list=[];return list.push({text:topText,item:topItem}),bottomText&&list.push({text:bottomText,item:bottomItem}),list}return{getNowPlayingNames:getNowPlayingNames}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playbackmanager.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playbackmanager.js index 1d63194b47..e78e02577b 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playbackmanager.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playbackmanager.js @@ -1,3 +1,3 @@ -define(["events","datetime","appSettings","itemHelper","pluginManager","playQueueManager","userSettings","globalize","connectionManager","loading","apphost","fullscreenManager"],function(events,datetime,appSettings,itemHelper,pluginManager,PlayQueueManager,userSettings,globalize,connectionManager,loading,apphost,fullscreenManager){"use strict";function enableLocalPlaylistManagement(player){return!player.getPlaylist&&!!player.isLocalPlayer}function bindToFullscreenChange(player){events.on(fullscreenManager,"fullscreenchange",function(){events.trigger(player,"fullscreenchange")})}function triggerPlayerChange(playbackManagerInstance,newPlayer,newTarget,previousPlayer,previousTargetInfo){(newPlayer||previousPlayer)&&(newTarget&&previousTargetInfo&&newTarget.id===previousTargetInfo.id||events.trigger(playbackManagerInstance,"playerchange",[newPlayer,newTarget,previousPlayer]))}function reportPlayback(state,serverId,method,progressEventName){if(serverId){var info=Object.assign({},state.PlayState);info.ItemId=state.NowPlayingItem.Id,progressEventName&&(info.EventName=progressEventName);var apiClient=connectionManager.getApiClient(serverId);apiClient[method](info)}}function normalizeName(t){return t.toLowerCase().replace(" ","")}function getItemsForPlayback(serverId,query){var apiClient=connectionManager.getApiClient(serverId);if(query.Ids&&1===query.Ids.split(",").length){var itemId=query.Ids.split(",");return apiClient.getItem(apiClient.getCurrentUserId(),itemId).then(function(item){return{Items:[item],TotalRecordCount:1}})}return query.Limit=query.Limit||200,query.Fields="MediaSources,Chapters",query.ExcludeLocationTypes="Virtual",query.EnableTotalRecordCount=!1,query.CollapseBoxSetItems=!1,apiClient.getItems(apiClient.getCurrentUserId(),query)}function createStreamInfoFromUrlItem(item){return{url:item.Url||item.Path,playMethod:"DirectPlay",item:item,textTracks:[],mediaType:item.MediaType}}function mergePlaybackQueries(obj1,obj2){var query=Object.assign(obj1,obj2),filters=query.Filters?query.Filters.split(","):[];return filters.indexOf("IsNotFolder")===-1&&filters.push("IsNotFolder"),query.Filters=filters.join(","),query}function backdropImageUrl(apiClient,item,options){return options=options||{},options.type=options.type||"Backdrop",options.maxWidth||options.width||options.maxHeight||options.height||(options.quality=100),item.BackdropImageTags&&item.BackdropImageTags.length?(options.tag=item.BackdropImageTags[0],apiClient.getScaledImageUrl(item.Id,options)):item.ParentBackdropImageTags&&item.ParentBackdropImageTags.length?(options.tag=item.ParentBackdropImageTags[0],apiClient.getScaledImageUrl(item.ParentBackdropItemId,options)):null}function getMimeType(type,container){if(container=(container||"").toLowerCase(),"audio"===type){if("opus"===container)return"audio/ogg";if("webma"===container)return"audio/webm";if("m4a"===container)return"audio/mp4"}else if("video"===type){if("mkv"===container)return"video/x-matroska";if("m4v"===container)return"video/mp4";if("mov"===container)return"video/quicktime";if("mpg"===container)return"video/mpeg";if("flv"===container)return"video/x-flv"}return type+"/"+container}function getParam(name,url){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)",regex=new RegExp(regexS,"i"),results=regex.exec(url);return null==results?"":decodeURIComponent(results[1].replace(/\+/g," "))}function isAutomaticPlayer(player){return!!player.isLocalPlayer}function getAutomaticPlayers(instance){var player=instance._currentPlayer;return player&&!isAutomaticPlayer(player)?[player]:instance.getPlayers().filter(isAutomaticPlayer)}function isServerItem(item){return!!item.Id}function enableIntros(item){return"Video"===item.MediaType&&("TvChannel"!==item.Type&&("InProgress"!==item.Status&&isServerItem(item)))}function getIntros(firstItem,apiClient,options){return options.startPositionTicks||options.startIndex||options.fullscreen===!1||!enableIntros(firstItem)||!userSettings.enableCinemaMode()?Promise.resolve({Items:[]}):apiClient.getIntros(firstItem.Id)}function getAudioMaxValues(deviceProfile){var maxAudioSampleRate=null,maxAudioBitDepth=null;return deviceProfile.CodecProfiles.map(function(codecProfile){"Audio"===codecProfile.Type&&(codecProfile.Conditions||[]).map(function(condition){"LessThanEqual"===condition.Condition&&"AudioBitDepth"===condition.Property&&(maxAudioBitDepth=condition.Value),"LessThanEqual"===condition.Condition&&"AudioSampleRate"===condition.Property&&(maxAudioSampleRate=condition.Value)})}),{maxAudioSampleRate:maxAudioSampleRate,maxAudioBitDepth:maxAudioBitDepth}}function getAudioStreamUrl(item,transcodingProfile,directPlayContainers,maxBitrate,apiClient,maxAudioSampleRate,maxAudioBitDepth,startPosition){var url="Audio/"+item.Id+"/universal";return startingPlaySession++,apiClient.getUrl(url,{UserId:apiClient.getCurrentUserId(),DeviceId:apiClient.deviceId(),MaxStreamingBitrate:maxBitrate,Container:directPlayContainers,TranscodingContainer:transcodingProfile.Container||null,TranscodingProtocol:transcodingProfile.Protocol||null,AudioCodec:transcodingProfile.AudioCodec,MaxAudioSampleRate:maxAudioSampleRate,MaxAudioBitDepth:maxAudioBitDepth,api_key:apiClient.accessToken(),PlaySessionId:startingPlaySession,StartTimeTicks:startPosition||0,EnableRedirection:!0,EnableRemoteMedia:apphost.supports("remoteaudio")})}function getAudioStreamUrlFromDeviceProfile(item,deviceProfile,maxBitrate,apiClient,startPosition){var transcodingProfile=deviceProfile.TranscodingProfiles.filter(function(p){return"Audio"===p.Type&&"Streaming"===p.Context})[0],directPlayContainers="";deviceProfile.DirectPlayProfiles.map(function(p){"Audio"===p.Type&&(directPlayContainers?directPlayContainers+=","+p.Container:directPlayContainers=p.Container,p.AudioCodec&&(directPlayContainers+="|"+p.AudioCodec))});var maxValues=getAudioMaxValues(deviceProfile);return getAudioStreamUrl(item,transcodingProfile,directPlayContainers,maxBitrate,apiClient,maxValues.maxAudioSampleRate,maxValues.maxAudioBitDepth,startPosition)}function getStreamUrls(items,deviceProfile,maxBitrate,apiClient,startPosition){var audioTranscodingProfile=deviceProfile.TranscodingProfiles.filter(function(p){return"Audio"===p.Type&&"Streaming"===p.Context})[0],audioDirectPlayContainers="";deviceProfile.DirectPlayProfiles.map(function(p){"Audio"===p.Type&&(audioDirectPlayContainers?audioDirectPlayContainers+=","+p.Container:audioDirectPlayContainers=p.Container,p.AudioCodec&&(audioDirectPlayContainers+="|"+p.AudioCodec))});for(var maxValues=getAudioMaxValues(deviceProfile),streamUrls=[],i=0,length=items.length;i=interceptors.length)return void resolve();var interceptor=interceptors[index];interceptor.intercept(options).then(function(){runNextPrePlay(interceptors,index+1,options,resolve,reject)},reject)}function sendPlaybackListToPlayer(player,items,deviceProfile,maxBitrate,apiClient,startPositionTicks,mediaSourceId,audioStreamIndex,subtitleStreamIndex,startIndex){return setStreamUrls(items,deviceProfile,maxBitrate,apiClient,startPositionTicks).then(function(){return loading.hide(),player.play({items:items,startPositionTicks:startPositionTicks||0,mediaSourceId:mediaSourceId,audioStreamIndex:audioStreamIndex,subtitleStreamIndex:subtitleStreamIndex,startIndex:startIndex})})}function playAfterBitrateDetect(maxBitrate,item,playOptions,onPlaybackStartedFn){var promise,startPosition=playOptions.startPositionTicks,player=getPlayer(item,playOptions),activePlayer=self._currentPlayer;return activePlayer?(self._playNextAfterEnded=!1,promise=onPlaybackChanging(activePlayer,player,item)):promise=Promise.resolve(),isServerItem(item)&&"Game"!==item.MediaType?Promise.all([promise,player.getDeviceProfile(item)]).then(function(responses){var deviceProfile=responses[1],apiClient=connectionManager.getApiClient(item.ServerId),mediaSourceId=playOptions.mediaSourceId,audioStreamIndex=playOptions.audioStreamIndex,subtitleStreamIndex=playOptions.subtitleStreamIndex;return player&&!enableLocalPlaylistManagement(player)?sendPlaybackListToPlayer(player,playOptions.items,deviceProfile,maxBitrate,apiClient,startPosition,mediaSourceId,audioStreamIndex,subtitleStreamIndex,playOptions.startIndex):(playOptions.items=null,getPlaybackMediaSource(player,apiClient,deviceProfile,maxBitrate,item,startPosition,mediaSourceId,audioStreamIndex,subtitleStreamIndex).then(function(mediaSource){var streamInfo=createStreamInfo(apiClient,item.MediaType,item,mediaSource,startPosition);return streamInfo.fullscreen=playOptions.fullscreen,getPlayerData(player).isChangingStream=!1,getPlayerData(player).maxStreamingBitrate=maxBitrate,player.play(streamInfo).then(function(){loading.hide(),onPlaybackStartedFn(),onPlaybackStarted(player,playOptions,streamInfo,mediaSource)},function(err){onPlaybackStartedFn(),onPlaybackStarted(player,playOptions,streamInfo,mediaSource),setTimeout(function(){onPlaybackError.call(player,err,{type:"mediadecodeerror",streamInfo:streamInfo})},100)})}))}):promise.then(function(){var streamInfo=createStreamInfoFromUrlItem(item);return streamInfo.fullscreen=playOptions.fullscreen,getPlayerData(player).isChangingStream=!1,player.play(streamInfo).then(function(){loading.hide(),onPlaybackStartedFn(),onPlaybackStarted(player,playOptions,streamInfo)},function(){self.stop(player)})})}function createStreamInfo(apiClient,type,item,mediaSource,startPosition,forceTranscoding){var mediaUrl,contentType,directOptions,transcodingOffsetTicks=0,playerStartPositionTicks=startPosition,liveStreamId=mediaSource.LiveStreamId,playMethod="Transcode",mediaSourceContainer=(mediaSource.Container||"").toLowerCase();"Video"===type?(contentType=getMimeType("video",mediaSourceContainer),mediaSource.enableDirectPlay&&!forceTranscoding?(mediaUrl=mediaSource.Path,playMethod="DirectPlay"):mediaSource.SupportsDirectStream&&!forceTranscoding?(directOptions={Static:!0,mediaSourceId:mediaSource.Id,deviceId:apiClient.deviceId(),api_key:apiClient.accessToken()},mediaSource.ETag&&(directOptions.Tag=mediaSource.ETag),mediaSource.LiveStreamId&&(directOptions.LiveStreamId=mediaSource.LiveStreamId),mediaUrl=apiClient.getUrl("Videos/"+item.Id+"/stream."+mediaSourceContainer,directOptions),playMethod="DirectStream"):mediaSource.SupportsTranscoding&&(mediaUrl=apiClient.getUrl(mediaSource.TranscodingUrl),"hls"===mediaSource.TranscodingSubProtocol?contentType="application/x-mpegURL":(playerStartPositionTicks=null,contentType=getMimeType("video",mediaSource.TranscodingContainer),mediaUrl.toLowerCase().indexOf("copytimestamps=true")===-1&&(transcodingOffsetTicks=startPosition||0)))):"Audio"===type?(contentType=getMimeType("audio",mediaSourceContainer),mediaSource.enableDirectPlay&&!forceTranscoding?(mediaUrl=mediaSource.Path,playMethod="DirectPlay"):mediaSource.StreamUrl?(playMethod="Transcode",mediaUrl=mediaSource.StreamUrl):mediaSource.SupportsDirectStream&&!forceTranscoding?(directOptions={Static:!0,mediaSourceId:mediaSource.Id,deviceId:apiClient.deviceId(),api_key:apiClient.accessToken()},mediaSource.ETag&&(directOptions.Tag=mediaSource.ETag),mediaSource.LiveStreamId&&(directOptions.LiveStreamId=mediaSource.LiveStreamId),mediaUrl=apiClient.getUrl("Audio/"+item.Id+"/stream."+mediaSourceContainer,directOptions),playMethod="DirectStream"):mediaSource.SupportsTranscoding&&(mediaUrl=apiClient.getUrl(mediaSource.TranscodingUrl),"hls"===mediaSource.TranscodingSubProtocol?contentType="application/x-mpegURL":(transcodingOffsetTicks=startPosition||0,playerStartPositionTicks=null,contentType=getMimeType("audio",mediaSource.TranscodingContainer)))):"Game"===type&&(mediaUrl=mediaSource.Path,playMethod="DirectPlay"),!mediaUrl&&mediaSource.SupportsDirectPlay&&(mediaUrl=mediaSource.Path,playMethod="DirectPlay");var resultInfo={url:mediaUrl,mimeType:contentType,transcodingOffsetTicks:transcodingOffsetTicks,playMethod:playMethod,playerStartPositionTicks:playerStartPositionTicks,item:item,mediaSource:mediaSource,textTracks:getTextTracks(apiClient,item,mediaSource),tracks:getTextTracks(apiClient,item,mediaSource),mediaType:type,liveStreamId:liveStreamId,playSessionId:getParam("playSessionId",mediaUrl),title:item.Name},backdropUrl=backdropImageUrl(apiClient,item,{});return backdropUrl&&(resultInfo.backdropUrl=backdropUrl),resultInfo}function getTextTracks(apiClient,item,mediaSource){for(var subtitleStreams=mediaSource.MediaStreams.filter(function(s){return"Subtitle"===s.Type}),textStreams=subtitleStreams.filter(function(s){return"External"===s.DeliveryMethod}),tracks=[],i=0,length=textStreams.length;i=6e5&&getLiveStreamMediaInfo(player,streamInfo,self.currentMediaSource(player),streamInfo.liveStreamId,serverId)}}function getLiveStreamMediaInfo(player,streamInfo,mediaSource,liveStreamId,serverId){console.log("getLiveStreamMediaInfo"),streamInfo.lastMediaInfoQuery=(new Date).getTime();var apiClient=connectionManager.getApiClient(serverId);apiClient.isMinServerVersion("3.2.70.7")&&connectionManager.getApiClient(serverId).getLiveStreamMediaInfo(liveStreamId).then(function(info){mediaSource.MediaStreams=info.MediaStreams,events.trigger(player,"mediastreamschange")},function(){})}var currentTargetInfo,lastLocalPlayer,self=this,players=[],currentPairingId=null;this._playNextAfterEnded=!0;var playerStates={};this._playQueueManager=new PlayQueueManager,self.currentItem=function(player){if(!player)throw new Error("player cannot be null");if(player.currentItem)return player.currentItem();var data=getPlayerData(player);return data.streamInfo?data.streamInfo.item:null},self.currentMediaSource=function(player){if(!player)throw new Error("player cannot be null");if(player.currentMediaSource)return player.currentMediaSource();var data=getPlayerData(player);return data.streamInfo?data.streamInfo.mediaSource:null},self.playMethod=function(player){if(!player)throw new Error("player cannot be null");if(player.playMethod)return player.playMethod();var data=getPlayerData(player);return data.streamInfo?data.streamInfo.playMethod:null},self.playSessionId=function(player){if(!player)throw new Error("player cannot be null");if(player.playSessionId)return player.playSessionId();var data=getPlayerData(player);return data.streamInfo?data.streamInfo.playSessionId:null},self.getPlayerInfo=function(){var player=self._currentPlayer;if(!player)return null;var target=currentTargetInfo||{};return{name:player.name,isLocalPlayer:player.isLocalPlayer,id:target.id,deviceName:target.deviceName,playableMediaTypes:target.playableMediaTypes,supportedCommands:target.supportedCommands}},self.setActivePlayer=function(player,targetInfo){if("localplayer"===player||"localplayer"===player.name){if(self._currentPlayer&&self._currentPlayer.isLocalPlayer)return;return void setCurrentPlayerInternal(null,null)}if("string"==typeof player&&(player=players.filter(function(p){return p.name===player})[0]),!player)throw new Error("null player");setCurrentPlayerInternal(player,targetInfo)},self.trySetActivePlayer=function(player,targetInfo){if("localplayer"===player||"localplayer"===player.name)return void(self._currentPlayer&&self._currentPlayer.isLocalPlayer);if("string"==typeof player&&(player=players.filter(function(p){return p.name===player})[0]),!player)throw new Error("null player");if(currentPairingId!==targetInfo.id){currentPairingId=targetInfo.id;var promise=player.tryPair?player.tryPair(targetInfo):Promise.resolve();events.trigger(self,"pairing"),promise.then(function(){events.trigger(self,"paired"),setCurrentPlayerInternal(player,targetInfo)},function(){events.trigger(self,"pairerror"),currentPairingId===targetInfo.id&&(currentPairingId=null)})}},self.getTargets=function(){var promises=players.filter(displayPlayerIndividually).map(getPlayerTargets);return Promise.all(promises).then(function(responses){return connectionManager.currentApiClient().getCurrentUser().then(function(user){var targets=[];targets.push({name:globalize.translate("sharedcomponents#HeaderMyDevice"),id:"localplayer",playerName:"localplayer",playableMediaTypes:["Audio","Video","Game","Photo","Book"],isLocalPlayer:!0,supportedCommands:self.getSupportedCommands({isLocalPlayer:!0}),user:user});for(var i=0;i0},self.isPlayingVideo=function(player){return self.isPlayingMediaType("Video",player)},self.isPlayingAudio=function(player){return self.isPlayingMediaType("Audio",player)},self.getPlayers=function(){return players},self.canPlay=function(item){var itemType=item.Type;if("PhotoAlbum"===itemType||"MusicGenre"===itemType||"Season"===itemType||"Series"===itemType||"BoxSet"===itemType||"MusicAlbum"===itemType||"MusicArtist"===itemType||"Playlist"===itemType)return!0;if("Virtual"===item.LocationType&&"Program"!==itemType)return!1;if("Program"===itemType){if(!item.EndDate||!item.StartDate)return!1;if((new Date).getTime()>datetime.parseISO8601Date(item.EndDate).getTime()||(new Date).getTime()=supported.length&&(index=0),self.setAspectRatio(supported[index].id,player)}},self.setAspectRatio=function(val,player){player=player||self._currentPlayer,player&&player.setAspectRatio&&player.setAspectRatio(val)},self.getSupportedAspectRatios=function(player){return player=player||self._currentPlayer,player&&player.getSupportedAspectRatios?player.getSupportedAspectRatios():[]},self.getAspectRatio=function(player){if(player=player||self._currentPlayer,player&&player.getAspectRatio)return player.getAspectRatio()};var brightnessOsdLoaded;self.setBrightness=function(val,player){player=player||self._currentPlayer,player&&(brightnessOsdLoaded||(brightnessOsdLoaded=!0,require(["brightnessOsd"])),player.setBrightness(val))},self.getBrightness=function(player){if(player=player||self._currentPlayer)return player.getBrightness()},self.setVolume=function(val,player){player=player||self._currentPlayer,player&&player.setVolume(val)},self.getVolume=function(player){if(player=player||self._currentPlayer)return player.getVolume()},self.volumeUp=function(player){player=player||self._currentPlayer,player&&player.volumeUp()},self.volumeDown=function(player){player=player||self._currentPlayer,player&&player.volumeDown()},self.changeAudioStream=function(player){if(player=player||self._currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.changeAudioStream();if(player){var i,length,currentMediaSource=self.currentMediaSource(player),mediaStreams=[];for(i=0,length=currentMediaSource.MediaStreams.length;i=mediaStreams.length&&(nextIndex=0),nextIndex=nextIndex===-1?-1:mediaStreams[nextIndex].Index,self.setAudioStreamIndex(nextIndex,player)}}},self.changeSubtitleStream=function(player){if(player=player||self._currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.changeSubtitleStream();if(player){var i,length,currentMediaSource=self.currentMediaSource(player),mediaStreams=[];for(i=0,length=currentMediaSource.MediaStreams.length;i=mediaStreams.length&&(nextIndex=-1),nextIndex=nextIndex===-1?-1:mediaStreams[nextIndex].Index,self.setSubtitleStreamIndex(nextIndex,player)}}},self.getAudioStreamIndex=function(player){return player=player||self._currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.getAudioStreamIndex():getPlayerData(player).audioStreamIndex},self.setAudioStreamIndex=function(index,player){return player=player||self._currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.setAudioStreamIndex(index):void("Transcode"!==self.playMethod(player)&&player.canSetAudioStreamIndex()?(player.setAudioStreamIndex(index),getPlayerData(player).audioStreamIndex=index):(changeStream(player,getCurrentTicks(player),{AudioStreamIndex:index}),getPlayerData(player).audioStreamIndex=index))},self.getMaxStreamingBitrate=function(player){if(player=player||self._currentPlayer,player&&player.getMaxStreamingBitrate)return player.getMaxStreamingBitrate();var playerData=getPlayerData(player);if(playerData.maxStreamingBitrate)return playerData.maxStreamingBitrate;var mediaType=playerData.streamInfo?playerData.streamInfo.mediaType:null,currentItem=self.currentItem(player),apiClient=currentItem?connectionManager.getApiClient(currentItem.ServerId):connectionManager.currentApiClient();return getSavedMaxStreamingBitrate(apiClient,mediaType)},self.enableAutomaticBitrateDetection=function(player){if(player=player||self._currentPlayer,player&&player.enableAutomaticBitrateDetection)return player.enableAutomaticBitrateDetection();var playerData=getPlayerData(player),mediaType=playerData.streamInfo?playerData.streamInfo.mediaType:null,currentItem=self.currentItem(player),apiClient=currentItem?connectionManager.getApiClient(currentItem.ServerId):connectionManager.currentApiClient(),endpointInfo=apiClient.getSavedEndpointInfo()||{};return appSettings.enableAutomaticBitrateDetection(endpointInfo.IsInNetwork,mediaType)},self.setMaxStreamingBitrate=function(options,player){if(player=player||self._currentPlayer,player&&player.setMaxStreamingBitrate)return player.setMaxStreamingBitrate(options);var apiClient=connectionManager.getApiClient(self.currentItem(player).ServerId);apiClient.getEndpointInfo().then(function(endpointInfo){var promise,playerData=getPlayerData(player),mediaType=playerData.streamInfo?playerData.streamInfo.mediaType:null;options.enableAutomaticBitrateDetection?(appSettings.enableAutomaticBitrateDetection(endpointInfo.IsInNetwork,mediaType,!0),promise=apiClient.detectBitrate(!0)):(appSettings.enableAutomaticBitrateDetection(endpointInfo.IsInNetwork,mediaType,!1),promise=Promise.resolve(options.maxBitrate)),promise.then(function(bitrate){appSettings.maxStreamingBitrate(endpointInfo.IsInNetwork,mediaType,bitrate),changeStream(player,getCurrentTicks(player),{MaxStreamingBitrate:bitrate})})})},self.isFullscreen=function(player){return player=player||self._currentPlayer,!player.isLocalPlayer||player.isFullscreen?player.isFullscreen():fullscreenManager.isFullScreen()},self.toggleFullscreen=function(player){return player=player||self._currentPlayer,!player.isLocalPlayer||player.toggleFulscreen?player.toggleFulscreen():void(fullscreenManager.isFullScreen()?fullscreenManager.exitFullscreen():fullscreenManager.requestFullscreen())},self.togglePictureInPicture=function(player){return player=player||self._currentPlayer,player.togglePictureInPicture()},self.getSubtitleStreamIndex=function(player){if(player=player||self._currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.getSubtitleStreamIndex();if(!player)throw new Error("player cannot be null");return getPlayerData(player).subtitleStreamIndex},self.setSubtitleStreamIndex=function(index,player){if(player=player||self._currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.setSubtitleStreamIndex(index);var currentStream=getCurrentSubtitleStream(player),newStream=getSubtitleStream(player,index);if(currentStream||newStream){var selectedTrackElementIndex=-1,currentPlayMethod=self.playMethod(player);currentStream&&!newStream?("Encode"===getDeliveryMethod(currentStream)||"Embed"===getDeliveryMethod(currentStream)&&"Transcode"===currentPlayMethod)&&changeStream(player,getCurrentTicks(player),{SubtitleStreamIndex:-1}):!currentStream&&newStream?"External"===getDeliveryMethod(newStream)?selectedTrackElementIndex=index:"Embed"===getDeliveryMethod(newStream)&&"Transcode"!==currentPlayMethod?selectedTrackElementIndex=index:changeStream(player,getCurrentTicks(player),{SubtitleStreamIndex:index}):currentStream&&newStream&&("External"===getDeliveryMethod(newStream)||"Embed"===getDeliveryMethod(newStream)&&"Transcode"!==currentPlayMethod?(selectedTrackElementIndex=index,"External"!==getDeliveryMethod(currentStream)&&"Embed"!==getDeliveryMethod(currentStream)&&changeStream(player,getCurrentTicks(player),{SubtitleStreamIndex:-1})):changeStream(player,getCurrentTicks(player),{SubtitleStreamIndex:index})),player.setSubtitleStreamIndex(selectedTrackElementIndex),getPlayerData(player).subtitleStreamIndex=index}},self.seek=function(ticks,player){return ticks=Math.max(0,ticks),player=player||self._currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.isLocalPlayer?player.seek((ticks||0)/1e4):player.seek(ticks):void changeStream(player,ticks)},self.seekRelative=function(offsetTicks,player){if(player=player||self._currentPlayer,player&&!enableLocalPlaylistManagement(player)&&player.seekRelative)return player.isLocalPlayer?player.seekRelative((ticks||0)/1e4):player.seekRelative(ticks);var ticks=getCurrentTicks(player)+offsetTicks;return this.seek(ticks,player)},self.play=function(options){if(normalizePlayOptions(options),self._currentPlayer){if(options.enableRemotePlayers===!1&&!self._currentPlayer.isLocalPlayer)return Promise.reject();if(!self._currentPlayer.isLocalPlayer)return self._currentPlayer.play(options)}if(options.fullscreen&&loading.show(),options.items)return translateItemsForPlayback(options.items,options).then(function(items){return playWithIntros(items,options)});if(!options.serverId)throw new Error("serverId required!");return getItemsForPlayback(options.serverId,{Ids:options.ids.join(",")}).then(function(result){return translateItemsForPlayback(result.Items,options).then(function(items){return playWithIntros(items,options)})})},self.getPlayerState=function(player,item,mediaSource){if(player=player||self._currentPlayer,!player)throw new Error("player cannot be null");if(!enableLocalPlaylistManagement(player)&&player.getPlayerState)return player.getPlayerState();item=item||self.currentItem(player),mediaSource=mediaSource||self.currentMediaSource(player);var state={PlayState:{}};return player&&(state.PlayState.VolumeLevel=player.getVolume(),state.PlayState.IsMuted=player.isMuted(),state.PlayState.IsPaused=player.paused(),state.PlayState.RepeatMode=self.getRepeatMode(player),state.PlayState.MaxStreamingBitrate=self.getMaxStreamingBitrate(player),state.PlayState.PositionTicks=getCurrentTicks(player),state.PlayState.PlaybackStartTimeTicks=self.playbackStartTime(player),state.PlayState.SubtitleStreamIndex=self.getSubtitleStreamIndex(player),state.PlayState.AudioStreamIndex=self.getAudioStreamIndex(player),state.PlayState.BufferedRanges=self.getBufferedRanges(player),state.PlayState.PlayMethod=self.playMethod(player),mediaSource&&(state.PlayState.LiveStreamId=mediaSource.LiveStreamId),state.PlayState.PlaySessionId=self.playSessionId(player)),mediaSource&&(state.PlayState.MediaSourceId=mediaSource.Id,state.NowPlayingItem={RunTimeTicks:mediaSource.RunTimeTicks},state.PlayState.CanSeek=(mediaSource.RunTimeTicks||0)>0||canPlayerSeek(player)),item&&(state.NowPlayingItem=getNowPlayingItemForReporting(player,item,mediaSource)),state.MediaSource=mediaSource,state},self.duration=function(player){if(player=player||self._currentPlayer,player&&!enableLocalPlaylistManagement(player)&&!player.isLocalPlayer)return player.duration();if(!player)throw new Error("player cannot be null");var mediaSource=self.currentMediaSource(player);if(mediaSource&&mediaSource.RunTimeTicks)return mediaSource.RunTimeTicks;var playerDuration=player.duration();return playerDuration&&(playerDuration*=1e4),playerDuration},self.getCurrentTicks=getCurrentTicks,self.getPlaybackInfo=function(item,options){options=options||{};var startPosition=options.startPositionTicks||0,mediaType=options.mediaType||item.MediaType,player=getPlayer(item,options),apiClient=connectionManager.getApiClient(item.ServerId),maxBitrate=getSavedMaxStreamingBitrate(connectionManager.getApiClient(item.ServerId),mediaType);return player.getDeviceProfile(item).then(function(deviceProfile){return getPlaybackMediaSource(player,apiClient,deviceProfile,maxBitrate,item,startPosition,options.mediaSourceId,options.audioStreamIndex,options.subtitleStreamIndex).then(function(mediaSource){return createStreamInfo(apiClient,item.MediaType,item,mediaSource,startPosition)})})},self.setCurrentPlaylistItem=function(playlistItemId,player){if(player=player||self._currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.setCurrentPlaylistItem(playlistItemId);for(var newItem,newItemIndex,playlist=self._playQueueManager.getPlaylist(),i=0,length=playlist.length;i=0){var playlist=self._playQueueManager.getPlaylist(),newItem=playlist[newIndex];if(newItem){var newItemPlayOptions=newItem.playOptions||{};newItemPlayOptions.startPositionTicks=0,playInternal(newItem,newItemPlayOptions,function(){setPlaylistState(newItem.PlaylistItemId,newIndex)})}}},self.queue=function(options,player){queue(options,"",player)},self.queueNext=function(options,player){queue(options,"next",player)},events.on(pluginManager,"registered",function(e,plugin){"mediaplayer"===plugin.type&&initMediaPlayer(plugin)}),pluginManager.ofType("mediaplayer").map(initMediaPlayer),self.onAppClose=function(){var player=this._currentPlayer;player&&this.isPlaying(player)&&(this._playNextAfterEnded=!1,onPlaybackStopped.call(player))},self.playbackStartTime=function(player){if(player=player||this._currentPlayer,player&&!enableLocalPlaylistManagement(player)&&!player.isLocalPlayer)return player.playbackStartTime();var streamInfo=getPlayerData(player).streamInfo;return streamInfo?streamInfo.playbackStartTimeTicks:null},apphost.supports("remotecontrol")&&require(["serverNotifications"],function(serverNotifications){events.on(serverNotifications,"ServerShuttingDown",self.setDefaultPlayerActive.bind(self)),events.on(serverNotifications,"ServerRestarting",self.setDefaultPlayerActive.bind(self))})}var startingPlaySession=(new Date).getTime();return PlaybackManager.prototype.getCurrentPlayer=function(){return this._currentPlayer},PlaybackManager.prototype.currentTime=function(player){return player=player||this._currentPlayer,!player||enableLocalPlaylistManagement(player)||player.isLocalPlayer?this.getCurrentTicks(player):player.currentTime()},PlaybackManager.prototype.nextItem=function(player){if(player=player||this._currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.nextItem();var nextItem=this._playQueueManager.getNextItemInfo();if(!nextItem||!nextItem.item)return Promise.reject();var apiClient=connectionManager.getApiClient(nextItem.item.ServerId); -return apiClient.getItem(apiClient.getCurrentUserId(),nextItem.item.Id)},PlaybackManager.prototype.canQueue=function(item){return"MusicAlbum"===item.Type||"MusicArtist"===item.Type||"MusicGenre"===item.Type?this.canQueueMediaType("Audio"):this.canQueueMediaType(item.MediaType)},PlaybackManager.prototype.canQueueMediaType=function(mediaType){return!!this._currentPlayer&&this._currentPlayer.canPlayMediaType(mediaType)},PlaybackManager.prototype.isMuted=function(player){return player=player||this._currentPlayer,!!player&&player.isMuted()},PlaybackManager.prototype.setMute=function(mute,player){player=player||this._currentPlayer,player&&player.setMute(mute)},PlaybackManager.prototype.toggleMute=function(mute,player){player=player||this._currentPlayer,player&&(player.toggleMute?player.toggleMute():player.setMute(!player.isMuted()))},PlaybackManager.prototype.toggleDisplayMirroring=function(){this.enableDisplayMirroring(!this.enableDisplayMirroring())},PlaybackManager.prototype.enableDisplayMirroring=function(enabled){if(null!=enabled){var val=enabled?"1":"0";return void appSettings.set("displaymirror",val)}return"0"!==(appSettings.get("displaymirror")||"")},PlaybackManager.prototype.nextChapter=function(player){player=player||this._currentPlayer;var item=this.currentItem(player),ticks=this.getCurrentTicks(player),nextChapter=(item.Chapters||[]).filter(function(i){return i.StartPositionTicks>ticks})[0];nextChapter?this.seek(nextChapter.StartPositionTicks,player):this.nextTrack(player)},PlaybackManager.prototype.previousChapter=function(player){player=player||this._currentPlayer;var item=this.currentItem(player),ticks=this.getCurrentTicks(player);ticks-=1e8,0===this.getCurrentPlaylistIndex(player)&&(ticks=Math.max(ticks,0));var previousChapters=(item.Chapters||[]).filter(function(i){return i.StartPositionTicks<=ticks});previousChapters.length?this.seek(previousChapters[previousChapters.length-1].StartPositionTicks,player):this.previousTrack(player)},PlaybackManager.prototype.fastForward=function(player){if(player=player||this._currentPlayer,null!=player.fastForward)return void player.fastForward(userSettings.skipForwardLength());var offsetTicks=1e4*userSettings.skipForwardLength();this.seekRelative(offsetTicks,player)},PlaybackManager.prototype.rewind=function(player){if(player=player||this._currentPlayer,null!=player.rewind)return void player.rewind(userSettings.skipBackLength());var offsetTicks=0-1e4*userSettings.skipBackLength();this.seekRelative(offsetTicks,player)},PlaybackManager.prototype.seekPercent=function(percent,player){player=player||this._currentPlayer;var ticks=this.duration(player)||0;percent/=100,ticks*=percent,this.seek(parseInt(ticks),player)},PlaybackManager.prototype.playTrailers=function(item){var apiClient=connectionManager.getApiClient(item.ServerId),instance=this;if(item.LocalTrailerCount)return apiClient.getLocalTrailers(apiClient.getCurrentUserId(),item.Id).then(function(result){return instance.play({items:result})});var remoteTrailers=item.RemoteTrailers||[];return remoteTrailers.length?this.play({items:remoteTrailers.map(function(t){return{Name:t.Name||item.Name+" Trailer",Url:t.Url,MediaType:"Video",Type:"Trailer",ServerId:apiClient.serverId()}})}):Promise.reject()},PlaybackManager.prototype.getSubtitleUrl=function(textStream,serverId){var apiClient=connectionManager.getApiClient(serverId),textStreamUrl=textStream.IsExternalUrl?textStream.DeliveryUrl:apiClient.getUrl(textStream.DeliveryUrl);return textStreamUrl},PlaybackManager.prototype.stop=function(player){return player=player||this._currentPlayer,player?(enableLocalPlaylistManagement(player)&&(this._playNextAfterEnded=!1),player.stop(!0,!0)):Promise.resolve()},PlaybackManager.prototype.getBufferedRanges=function(player){return player=player||this._currentPlayer,player&&player.getBufferedRanges?player.getBufferedRanges():[]},PlaybackManager.prototype.playPause=function(player){if(player=player||this._currentPlayer)return player.playPause?player.playPause():player.paused()?this.unpause(player):this.pause(player)},PlaybackManager.prototype.paused=function(player){if(player=player||this._currentPlayer)return player.paused()},PlaybackManager.prototype.pause=function(player){player=player||this._currentPlayer,player&&player.pause()},PlaybackManager.prototype.unpause=function(player){player=player||this._currentPlayer,player&&player.unpause()},PlaybackManager.prototype.instantMix=function(item,player){if(player=player||this._currentPlayer,player&&player.instantMix)return player.instantMix(item);var apiClient=connectionManager.getApiClient(item.ServerId),options={};options.UserId=apiClient.getCurrentUserId(),options.Fields="MediaSources",options.Limit=200;var instance=this;apiClient.getInstantMixFromItem(item.Id,options).then(function(result){instance.play({items:result.Items})})},PlaybackManager.prototype.shuffle=function(shuffleItem,player,queryOptions){return player=player||this._currentPlayer,player&&player.shuffle?player.shuffle(shuffleItem):this.play({items:[shuffleItem],shuffle:!0})},PlaybackManager.prototype.audioTracks=function(player){if(player=player||this._currentPlayer,player.audioTracks){var result=player.audioTracks();if(result)return result}var mediaSource=this.currentMediaSource(player),mediaStreams=(mediaSource||{}).MediaStreams||[];return mediaStreams.filter(function(s){return"Audio"===s.Type})},PlaybackManager.prototype.subtitleTracks=function(player){if(player=player||this._currentPlayer,player.subtitleTracks){var result=player.subtitleTracks();if(result)return result}var mediaSource=this.currentMediaSource(player),mediaStreams=(mediaSource||{}).MediaStreams||[];return mediaStreams.filter(function(s){return"Subtitle"===s.Type})},PlaybackManager.prototype.getSupportedCommands=function(player){if(player=player||this._currentPlayer||{isLocalPlayer:!0},player.isLocalPlayer){var list=["GoHome","GoToSettings","VolumeUp","VolumeDown","Mute","Unmute","ToggleMute","SetVolume","SetAudioStreamIndex","SetSubtitleStreamIndex","SetMaxStreamingBitrate","DisplayContent","GoToSearch","DisplayMessage","SetRepeatMode","PlayMediaSource"];return apphost.supports("fullscreenchange")&&list.push("ToggleFullscreen"),player.supports&&(player.supports("PictureInPicture")&&list.push("PictureInPicture"),player.supports("SetBrightness")&&list.push("SetBrightness"),player.supports("SetAspectRatio")&&list.push("SetAspectRatio")),list}var info=this.getPlayerInfo();return info?info.supportedCommands:[]},PlaybackManager.prototype.setRepeatMode=function(value,player){return player=player||this._currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.setRepeatMode(value):(this._playQueueManager.setRepeatMode(value),void events.trigger(player,"repeatmodechange"))},PlaybackManager.prototype.getRepeatMode=function(player){return player=player||this._currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.getRepeatMode():this._playQueueManager.getRepeatMode()},PlaybackManager.prototype.trySetActiveDeviceName=function(name){name=normalizeName(name);var instance=this;instance.getTargets().then(function(result){var target=result.filter(function(p){return normalizeName(p.name)===name})[0];target&&instance.trySetActivePlayer(target.playerName,target)})},PlaybackManager.prototype.displayContent=function(options,player){player=player||this._currentPlayer,player&&player.displayContent&&player.displayContent(options)},PlaybackManager.prototype.beginPlayerUpdates=function(player){player.beginPlayerUpdates&&player.beginPlayerUpdates()},PlaybackManager.prototype.endPlayerUpdates=function(player){player.endPlayerUpdates&&player.endPlayerUpdates()},PlaybackManager.prototype.setDefaultPlayerActive=function(){this.setActivePlayer("localplayer")},PlaybackManager.prototype.removeActivePlayer=function(name){var playerInfo=this.getPlayerInfo();playerInfo&&playerInfo.name===name&&this.setDefaultPlayerActive()},PlaybackManager.prototype.removeActiveTarget=function(id){var playerInfo=this.getPlayerInfo();playerInfo&&playerInfo.id===id&&this.setDefaultPlayerActive()},PlaybackManager.prototype.sendCommand=function(cmd,player){switch(console.log("MediaController received command: "+cmd.Name),cmd.Name){case"SetRepeatMode":this.setRepeatMode(cmd.Arguments.RepeatMode,player);break;case"VolumeUp":this.volumeUp(player);break;case"VolumeDown":this.volumeDown(player);break;case"Mute":this.setMute(!0,player);break;case"Unmute":this.setMute(!1,player);break;case"ToggleMute":this.toggleMute(player);break;case"SetVolume":this.setVolume(cmd.Arguments.Volume,player);break;case"SetAspectRatio":this.setAspectRatio(cmd.Arguments.AspectRatio,player);break;case"SetBrightness":this.setBrightness(cmd.Arguments.Brightness,player);break;case"SetAudioStreamIndex":this.setAudioStreamIndex(parseInt(cmd.Arguments.Index),player);break;case"SetSubtitleStreamIndex":this.setSubtitleStreamIndex(parseInt(cmd.Arguments.Index),player);break;case"SetMaxStreamingBitrate":break;case"ToggleFullscreen":this.toggleFullscreen(player);break;default:player.sendCommand&&player.sendCommand(cmd)}},new PlaybackManager}); \ No newline at end of file +define(["events","datetime","appSettings","itemHelper","pluginManager","playQueueManager","userSettings","globalize","connectionManager","loading","apphost","fullscreenManager"],function(events,datetime,appSettings,itemHelper,pluginManager,PlayQueueManager,userSettings,globalize,connectionManager,loading,apphost,fullscreenManager){"use strict";function enableLocalPlaylistManagement(player){return!player.getPlaylist&&!!player.isLocalPlayer}function bindToFullscreenChange(player){events.on(fullscreenManager,"fullscreenchange",function(){events.trigger(player,"fullscreenchange")})}function triggerPlayerChange(playbackManagerInstance,newPlayer,newTarget,previousPlayer,previousTargetInfo){(newPlayer||previousPlayer)&&(newTarget&&previousTargetInfo&&newTarget.id===previousTargetInfo.id||events.trigger(playbackManagerInstance,"playerchange",[newPlayer,newTarget,previousPlayer]))}function reportPlayback(state,serverId,method,progressEventName){if(serverId){var info=Object.assign({},state.PlayState);info.ItemId=state.NowPlayingItem.Id,progressEventName&&(info.EventName=progressEventName);connectionManager.getApiClient(serverId)[method](info)}}function normalizeName(t){return t.toLowerCase().replace(" ","")}function getItemsForPlayback(serverId,query){var apiClient=connectionManager.getApiClient(serverId);if(query.Ids&&1===query.Ids.split(",").length){var itemId=query.Ids.split(",");return apiClient.getItem(apiClient.getCurrentUserId(),itemId).then(function(item){return{Items:[item],TotalRecordCount:1}})}return query.Limit=query.Limit||200,query.Fields="MediaSources,Chapters",query.ExcludeLocationTypes="Virtual",query.EnableTotalRecordCount=!1,query.CollapseBoxSetItems=!1,apiClient.getItems(apiClient.getCurrentUserId(),query)}function createStreamInfoFromUrlItem(item){return{url:item.Url||item.Path,playMethod:"DirectPlay",item:item,textTracks:[],mediaType:item.MediaType}}function mergePlaybackQueries(obj1,obj2){var query=Object.assign(obj1,obj2),filters=query.Filters?query.Filters.split(","):[];return-1===filters.indexOf("IsNotFolder")&&filters.push("IsNotFolder"),query.Filters=filters.join(","),query}function backdropImageUrl(apiClient,item,options){return options=options||{},options.type=options.type||"Backdrop",options.maxWidth||options.width||options.maxHeight||options.height||(options.quality=100),item.BackdropImageTags&&item.BackdropImageTags.length?(options.tag=item.BackdropImageTags[0],apiClient.getScaledImageUrl(item.Id,options)):item.ParentBackdropImageTags&&item.ParentBackdropImageTags.length?(options.tag=item.ParentBackdropImageTags[0],apiClient.getScaledImageUrl(item.ParentBackdropItemId,options)):null}function getMimeType(type,container){if(container=(container||"").toLowerCase(),"audio"===type){if("opus"===container)return"audio/ogg";if("webma"===container)return"audio/webm";if("m4a"===container)return"audio/mp4"}else if("video"===type){if("mkv"===container)return"video/x-matroska";if("m4v"===container)return"video/mp4";if("mov"===container)return"video/quicktime";if("mpg"===container)return"video/mpeg";if("flv"===container)return"video/x-flv"}return type+"/"+container}function getParam(name,url){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)",regex=new RegExp(regexS,"i"),results=regex.exec(url);return null==results?"":decodeURIComponent(results[1].replace(/\+/g," "))}function isAutomaticPlayer(player){return!!player.isLocalPlayer}function getAutomaticPlayers(instance){var player=instance._currentPlayer;return player&&!isAutomaticPlayer(player)?[player]:instance.getPlayers().filter(isAutomaticPlayer)}function isServerItem(item){return!!item.Id}function enableIntros(item){return"Video"===item.MediaType&&("TvChannel"!==item.Type&&("InProgress"!==item.Status&&isServerItem(item)))}function getIntros(firstItem,apiClient,options){return options.startPositionTicks||options.startIndex||!1===options.fullscreen||!enableIntros(firstItem)||!userSettings.enableCinemaMode()?Promise.resolve({Items:[]}):apiClient.getIntros(firstItem.Id)}function getAudioMaxValues(deviceProfile){var maxAudioSampleRate=null,maxAudioBitDepth=null;return deviceProfile.CodecProfiles.map(function(codecProfile){"Audio"===codecProfile.Type&&(codecProfile.Conditions||[]).map(function(condition){"LessThanEqual"===condition.Condition&&"AudioBitDepth"===condition.Property&&(maxAudioBitDepth=condition.Value),"LessThanEqual"===condition.Condition&&"AudioSampleRate"===condition.Property&&(maxAudioSampleRate=condition.Value)})}),{maxAudioSampleRate:maxAudioSampleRate,maxAudioBitDepth:maxAudioBitDepth}}function getAudioStreamUrl(item,transcodingProfile,directPlayContainers,maxBitrate,apiClient,maxAudioSampleRate,maxAudioBitDepth,startPosition){var url="Audio/"+item.Id+"/universal";return startingPlaySession++,apiClient.getUrl(url,{UserId:apiClient.getCurrentUserId(),DeviceId:apiClient.deviceId(),MaxStreamingBitrate:maxBitrate,Container:directPlayContainers,TranscodingContainer:transcodingProfile.Container||null,TranscodingProtocol:transcodingProfile.Protocol||null,AudioCodec:transcodingProfile.AudioCodec,MaxAudioSampleRate:maxAudioSampleRate,MaxAudioBitDepth:maxAudioBitDepth,api_key:apiClient.accessToken(),PlaySessionId:startingPlaySession,StartTimeTicks:startPosition||0,EnableRedirection:!0,EnableRemoteMedia:apphost.supports("remoteaudio")})}function getAudioStreamUrlFromDeviceProfile(item,deviceProfile,maxBitrate,apiClient,startPosition){var transcodingProfile=deviceProfile.TranscodingProfiles.filter(function(p){return"Audio"===p.Type&&"Streaming"===p.Context})[0],directPlayContainers="";deviceProfile.DirectPlayProfiles.map(function(p){"Audio"===p.Type&&(directPlayContainers?directPlayContainers+=","+p.Container:directPlayContainers=p.Container,p.AudioCodec&&(directPlayContainers+="|"+p.AudioCodec))});var maxValues=getAudioMaxValues(deviceProfile);return getAudioStreamUrl(item,transcodingProfile,directPlayContainers,maxBitrate,apiClient,maxValues.maxAudioSampleRate,maxValues.maxAudioBitDepth,startPosition)}function getStreamUrls(items,deviceProfile,maxBitrate,apiClient,startPosition){var audioTranscodingProfile=deviceProfile.TranscodingProfiles.filter(function(p){return"Audio"===p.Type&&"Streaming"===p.Context})[0],audioDirectPlayContainers="";deviceProfile.DirectPlayProfiles.map(function(p){"Audio"===p.Type&&(audioDirectPlayContainers?audioDirectPlayContainers+=","+p.Container:audioDirectPlayContainers=p.Container,p.AudioCodec&&(audioDirectPlayContainers+="|"+p.AudioCodec))});for(var maxValues=getAudioMaxValues(deviceProfile),streamUrls=[],i=0,length=items.length;i=interceptors.length)return void resolve();interceptors[index].intercept(options).then(function(){runNextPrePlay(interceptors,index+1,options,resolve,reject)},reject)}function sendPlaybackListToPlayer(player,items,deviceProfile,maxBitrate,apiClient,startPositionTicks,mediaSourceId,audioStreamIndex,subtitleStreamIndex,startIndex){return setStreamUrls(items,deviceProfile,maxBitrate,apiClient,startPositionTicks).then(function(){return loading.hide(),player.play({items:items,startPositionTicks:startPositionTicks||0,mediaSourceId:mediaSourceId,audioStreamIndex:audioStreamIndex,subtitleStreamIndex:subtitleStreamIndex,startIndex:startIndex})})}function playAfterBitrateDetect(maxBitrate,item,playOptions,onPlaybackStartedFn){var promise,startPosition=playOptions.startPositionTicks,player=getPlayer(item,playOptions),activePlayer=self._currentPlayer;return activePlayer?(self._playNextAfterEnded=!1,promise=onPlaybackChanging(activePlayer,player,item)):promise=Promise.resolve(),isServerItem(item)&&"Game"!==item.MediaType?Promise.all([promise,player.getDeviceProfile(item)]).then(function(responses){var deviceProfile=responses[1],apiClient=connectionManager.getApiClient(item.ServerId),mediaSourceId=playOptions.mediaSourceId,audioStreamIndex=playOptions.audioStreamIndex,subtitleStreamIndex=playOptions.subtitleStreamIndex;return player&&!enableLocalPlaylistManagement(player)?sendPlaybackListToPlayer(player,playOptions.items,deviceProfile,maxBitrate,apiClient,startPosition,mediaSourceId,audioStreamIndex,subtitleStreamIndex,playOptions.startIndex):(playOptions.items=null,getPlaybackMediaSource(player,apiClient,deviceProfile,maxBitrate,item,startPosition,mediaSourceId,audioStreamIndex,subtitleStreamIndex).then(function(mediaSource){var streamInfo=createStreamInfo(apiClient,item.MediaType,item,mediaSource,startPosition);return streamInfo.fullscreen=playOptions.fullscreen,getPlayerData(player).isChangingStream=!1,getPlayerData(player).maxStreamingBitrate=maxBitrate,player.play(streamInfo).then(function(){loading.hide(),onPlaybackStartedFn(),onPlaybackStarted(player,playOptions,streamInfo,mediaSource)},function(err){onPlaybackStartedFn(),onPlaybackStarted(player,playOptions,streamInfo,mediaSource),setTimeout(function(){onPlaybackError.call(player,err,{type:"mediadecodeerror",streamInfo:streamInfo})},100)})}))}):promise.then(function(){var streamInfo=createStreamInfoFromUrlItem(item);return streamInfo.fullscreen=playOptions.fullscreen,getPlayerData(player).isChangingStream=!1,player.play(streamInfo).then(function(){loading.hide(),onPlaybackStartedFn(),onPlaybackStarted(player,playOptions,streamInfo)},function(){self.stop(player)})})}function createStreamInfo(apiClient,type,item,mediaSource,startPosition,forceTranscoding){var mediaUrl,contentType,directOptions,transcodingOffsetTicks=0,playerStartPositionTicks=startPosition,liveStreamId=mediaSource.LiveStreamId,playMethod="Transcode",mediaSourceContainer=(mediaSource.Container||"").toLowerCase();"Video"===type?(contentType=getMimeType("video",mediaSourceContainer),mediaSource.enableDirectPlay&&!forceTranscoding?(mediaUrl=mediaSource.Path,playMethod="DirectPlay"):mediaSource.SupportsDirectStream&&!forceTranscoding?(directOptions={Static:!0,mediaSourceId:mediaSource.Id,deviceId:apiClient.deviceId(),api_key:apiClient.accessToken()},mediaSource.ETag&&(directOptions.Tag=mediaSource.ETag),mediaSource.LiveStreamId&&(directOptions.LiveStreamId=mediaSource.LiveStreamId),mediaUrl=apiClient.getUrl("Videos/"+item.Id+"/stream."+mediaSourceContainer,directOptions),playMethod="DirectStream"):mediaSource.SupportsTranscoding&&(mediaUrl=apiClient.getUrl(mediaSource.TranscodingUrl),"hls"===mediaSource.TranscodingSubProtocol?contentType="application/x-mpegURL":(playerStartPositionTicks=null,contentType=getMimeType("video",mediaSource.TranscodingContainer),-1===mediaUrl.toLowerCase().indexOf("copytimestamps=true")&&(transcodingOffsetTicks=startPosition||0)))):"Audio"===type?(contentType=getMimeType("audio",mediaSourceContainer),mediaSource.enableDirectPlay&&!forceTranscoding?(mediaUrl=mediaSource.Path,playMethod="DirectPlay"):mediaSource.StreamUrl?(playMethod="Transcode",mediaUrl=mediaSource.StreamUrl):mediaSource.SupportsDirectStream&&!forceTranscoding?(directOptions={Static:!0,mediaSourceId:mediaSource.Id,deviceId:apiClient.deviceId(),api_key:apiClient.accessToken()},mediaSource.ETag&&(directOptions.Tag=mediaSource.ETag),mediaSource.LiveStreamId&&(directOptions.LiveStreamId=mediaSource.LiveStreamId),mediaUrl=apiClient.getUrl("Audio/"+item.Id+"/stream."+mediaSourceContainer,directOptions),playMethod="DirectStream"):mediaSource.SupportsTranscoding&&(mediaUrl=apiClient.getUrl(mediaSource.TranscodingUrl),"hls"===mediaSource.TranscodingSubProtocol?contentType="application/x-mpegURL":(transcodingOffsetTicks=startPosition||0,playerStartPositionTicks=null,contentType=getMimeType("audio",mediaSource.TranscodingContainer)))):"Game"===type&&(mediaUrl=mediaSource.Path,playMethod="DirectPlay"),!mediaUrl&&mediaSource.SupportsDirectPlay&&(mediaUrl=mediaSource.Path,playMethod="DirectPlay");var resultInfo={url:mediaUrl,mimeType:contentType,transcodingOffsetTicks:transcodingOffsetTicks,playMethod:playMethod,playerStartPositionTicks:playerStartPositionTicks,item:item,mediaSource:mediaSource,textTracks:getTextTracks(apiClient,item,mediaSource),tracks:getTextTracks(apiClient,item,mediaSource),mediaType:type,liveStreamId:liveStreamId,playSessionId:getParam("playSessionId",mediaUrl),title:item.Name},backdropUrl=backdropImageUrl(apiClient,item,{});return backdropUrl&&(resultInfo.backdropUrl=backdropUrl),resultInfo}function getTextTracks(apiClient,item,mediaSource){for(var subtitleStreams=mediaSource.MediaStreams.filter(function(s){return"Subtitle"===s.Type}),textStreams=subtitleStreams.filter(function(s){return"External"===s.DeliveryMethod}),tracks=[],i=0,length=textStreams.length;i=6e5&&getLiveStreamMediaInfo(player,streamInfo,self.currentMediaSource(player),streamInfo.liveStreamId,serverId)}}function getLiveStreamMediaInfo(player,streamInfo,mediaSource,liveStreamId,serverId){console.log("getLiveStreamMediaInfo"),streamInfo.lastMediaInfoQuery=(new Date).getTime(),connectionManager.getApiClient(serverId).isMinServerVersion("3.2.70.7")&&connectionManager.getApiClient(serverId).getLiveStreamMediaInfo(liveStreamId).then(function(info){mediaSource.MediaStreams=info.MediaStreams,events.trigger(player,"mediastreamschange")},function(){})}var currentTargetInfo,lastLocalPlayer,self=this,players=[],currentPairingId=null;this._playNextAfterEnded=!0;var playerStates={};this._playQueueManager=new PlayQueueManager,self.currentItem=function(player){if(!player)throw new Error("player cannot be null");if(player.currentItem)return player.currentItem();var data=getPlayerData(player);return data.streamInfo?data.streamInfo.item:null},self.currentMediaSource=function(player){if(!player)throw new Error("player cannot be null");if(player.currentMediaSource)return player.currentMediaSource();var data=getPlayerData(player);return data.streamInfo?data.streamInfo.mediaSource:null},self.playMethod=function(player){if(!player)throw new Error("player cannot be null");if(player.playMethod)return player.playMethod();var data=getPlayerData(player);return data.streamInfo?data.streamInfo.playMethod:null},self.playSessionId=function(player){if(!player)throw new Error("player cannot be null");if(player.playSessionId)return player.playSessionId();var data=getPlayerData(player);return data.streamInfo?data.streamInfo.playSessionId:null},self.getPlayerInfo=function(){var player=self._currentPlayer;if(!player)return null;var target=currentTargetInfo||{};return{name:player.name,isLocalPlayer:player.isLocalPlayer,id:target.id,deviceName:target.deviceName,playableMediaTypes:target.playableMediaTypes,supportedCommands:target.supportedCommands}},self.setActivePlayer=function(player,targetInfo){if("localplayer"===player||"localplayer"===player.name){if(self._currentPlayer&&self._currentPlayer.isLocalPlayer)return;return void setCurrentPlayerInternal(null,null)}if("string"==typeof player&&(player=players.filter(function(p){return p.name===player})[0]),!player)throw new Error("null player");setCurrentPlayerInternal(player,targetInfo)},self.trySetActivePlayer=function(player,targetInfo){if("localplayer"===player||"localplayer"===player.name)return void(self._currentPlayer&&self._currentPlayer.isLocalPlayer);if("string"==typeof player&&(player=players.filter(function(p){return p.name===player})[0]),!player)throw new Error("null player");if(currentPairingId!==targetInfo.id){currentPairingId=targetInfo.id;var promise=player.tryPair?player.tryPair(targetInfo):Promise.resolve();events.trigger(self,"pairing"),promise.then(function(){events.trigger(self,"paired"),setCurrentPlayerInternal(player,targetInfo)},function(){events.trigger(self,"pairerror"),currentPairingId===targetInfo.id&&(currentPairingId=null)})}},self.getTargets=function(){var promises=players.filter(displayPlayerIndividually).map(getPlayerTargets);return Promise.all(promises).then(function(responses){return connectionManager.currentApiClient().getCurrentUser().then(function(user){var targets=[];targets.push({name:globalize.translate("sharedcomponents#HeaderMyDevice"),id:"localplayer",playerName:"localplayer",playableMediaTypes:["Audio","Video","Game","Photo","Book"],isLocalPlayer:!0,supportedCommands:self.getSupportedCommands({isLocalPlayer:!0}),user:user});for(var i=0;i0},self.isPlayingVideo=function(player){return self.isPlayingMediaType("Video",player)},self.isPlayingAudio=function(player){return self.isPlayingMediaType("Audio",player)},self.getPlayers=function(){return players},self.canPlay=function(item){var itemType=item.Type;if("PhotoAlbum"===itemType||"MusicGenre"===itemType||"Season"===itemType||"Series"===itemType||"BoxSet"===itemType||"MusicAlbum"===itemType||"MusicArtist"===itemType||"Playlist"===itemType)return!0;if("Virtual"===item.LocationType&&"Program"!==itemType)return!1;if("Program"===itemType){if(!item.EndDate||!item.StartDate)return!1;if((new Date).getTime()>datetime.parseISO8601Date(item.EndDate).getTime()||(new Date).getTime()=supported.length&&(index=0),self.setAspectRatio(supported[index].id,player)}},self.setAspectRatio=function(val,player){(player=player||self._currentPlayer)&&player.setAspectRatio&&player.setAspectRatio(val)},self.getSupportedAspectRatios=function(player){return player=player||self._currentPlayer,player&&player.getSupportedAspectRatios?player.getSupportedAspectRatios():[]},self.getAspectRatio=function(player){if((player=player||self._currentPlayer)&&player.getAspectRatio)return player.getAspectRatio()};var brightnessOsdLoaded;self.setBrightness=function(val,player){(player=player||self._currentPlayer)&&(brightnessOsdLoaded||(brightnessOsdLoaded=!0,require(["brightnessOsd"])),player.setBrightness(val))},self.getBrightness=function(player){if(player=player||self._currentPlayer)return player.getBrightness()},self.setVolume=function(val,player){(player=player||self._currentPlayer)&&player.setVolume(val)},self.getVolume=function(player){if(player=player||self._currentPlayer)return player.getVolume()},self.volumeUp=function(player){(player=player||self._currentPlayer)&&player.volumeUp()},self.volumeDown=function(player){(player=player||self._currentPlayer)&&player.volumeDown()},self.changeAudioStream=function(player){if((player=player||self._currentPlayer)&&!enableLocalPlaylistManagement(player))return player.changeAudioStream();if(player){var i,length,currentMediaSource=self.currentMediaSource(player),mediaStreams=[];for(i=0,length=currentMediaSource.MediaStreams.length;i=mediaStreams.length&&(nextIndex=0),nextIndex=-1===nextIndex?-1:mediaStreams[nextIndex].Index,self.setAudioStreamIndex(nextIndex,player)}}},self.changeSubtitleStream=function(player){if((player=player||self._currentPlayer)&&!enableLocalPlaylistManagement(player))return player.changeSubtitleStream();if(player){var i,length,currentMediaSource=self.currentMediaSource(player),mediaStreams=[];for(i=0,length=currentMediaSource.MediaStreams.length;i=mediaStreams.length&&(nextIndex=-1),nextIndex=-1===nextIndex?-1:mediaStreams[nextIndex].Index,self.setSubtitleStreamIndex(nextIndex,player)}}},self.getAudioStreamIndex=function(player){return player=player||self._currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.getAudioStreamIndex():getPlayerData(player).audioStreamIndex},self.setAudioStreamIndex=function(index,player){if((player=player||self._currentPlayer)&&!enableLocalPlaylistManagement(player))return player.setAudioStreamIndex(index);"Transcode"!==self.playMethod(player)&&player.canSetAudioStreamIndex()?(player.setAudioStreamIndex(index),getPlayerData(player).audioStreamIndex=index):(changeStream(player,getCurrentTicks(player),{AudioStreamIndex:index}),getPlayerData(player).audioStreamIndex=index)},self.getMaxStreamingBitrate=function(player){if((player=player||self._currentPlayer)&&player.getMaxStreamingBitrate)return player.getMaxStreamingBitrate();var playerData=getPlayerData(player);if(playerData.maxStreamingBitrate)return playerData.maxStreamingBitrate;var mediaType=playerData.streamInfo?playerData.streamInfo.mediaType:null,currentItem=self.currentItem(player);return getSavedMaxStreamingBitrate(currentItem?connectionManager.getApiClient(currentItem.ServerId):connectionManager.currentApiClient(),mediaType)},self.enableAutomaticBitrateDetection=function(player){if((player=player||self._currentPlayer)&&player.enableAutomaticBitrateDetection)return player.enableAutomaticBitrateDetection();var playerData=getPlayerData(player),mediaType=playerData.streamInfo?playerData.streamInfo.mediaType:null,currentItem=self.currentItem(player),apiClient=currentItem?connectionManager.getApiClient(currentItem.ServerId):connectionManager.currentApiClient(),endpointInfo=apiClient.getSavedEndpointInfo()||{};return appSettings.enableAutomaticBitrateDetection(endpointInfo.IsInNetwork,mediaType)},self.setMaxStreamingBitrate=function(options,player){if((player=player||self._currentPlayer)&&player.setMaxStreamingBitrate)return player.setMaxStreamingBitrate(options);var apiClient=connectionManager.getApiClient(self.currentItem(player).ServerId);apiClient.getEndpointInfo().then(function(endpointInfo){var promise,playerData=getPlayerData(player),mediaType=playerData.streamInfo?playerData.streamInfo.mediaType:null;options.enableAutomaticBitrateDetection?(appSettings.enableAutomaticBitrateDetection(endpointInfo.IsInNetwork,mediaType,!0),promise=apiClient.detectBitrate(!0)):(appSettings.enableAutomaticBitrateDetection(endpointInfo.IsInNetwork,mediaType,!1),promise=Promise.resolve(options.maxBitrate)),promise.then(function(bitrate){appSettings.maxStreamingBitrate(endpointInfo.IsInNetwork,mediaType,bitrate),changeStream(player,getCurrentTicks(player),{MaxStreamingBitrate:bitrate})})})},self.isFullscreen=function(player){return player=player||self._currentPlayer,!player.isLocalPlayer||player.isFullscreen?player.isFullscreen():fullscreenManager.isFullScreen()},self.toggleFullscreen=function(player){if(player=player||self._currentPlayer,!player.isLocalPlayer||player.toggleFulscreen)return player.toggleFulscreen();fullscreenManager.isFullScreen()?fullscreenManager.exitFullscreen():fullscreenManager.requestFullscreen()},self.togglePictureInPicture=function(player){return player=player||self._currentPlayer,player.togglePictureInPicture()},self.getSubtitleStreamIndex=function(player){if((player=player||self._currentPlayer)&&!enableLocalPlaylistManagement(player))return player.getSubtitleStreamIndex();if(!player)throw new Error("player cannot be null");return getPlayerData(player).subtitleStreamIndex},self.setSubtitleStreamIndex=function(index,player){if((player=player||self._currentPlayer)&&!enableLocalPlaylistManagement(player))return player.setSubtitleStreamIndex(index);var currentStream=getCurrentSubtitleStream(player),newStream=getSubtitleStream(player,index);if(currentStream||newStream){var selectedTrackElementIndex=-1,currentPlayMethod=self.playMethod(player);currentStream&&!newStream?("Encode"===getDeliveryMethod(currentStream)||"Embed"===getDeliveryMethod(currentStream)&&"Transcode"===currentPlayMethod)&&changeStream(player,getCurrentTicks(player),{SubtitleStreamIndex:-1}):!currentStream&&newStream?"External"===getDeliveryMethod(newStream)?selectedTrackElementIndex=index:"Embed"===getDeliveryMethod(newStream)&&"Transcode"!==currentPlayMethod?selectedTrackElementIndex=index:changeStream(player,getCurrentTicks(player),{SubtitleStreamIndex:index}):currentStream&&newStream&&("External"===getDeliveryMethod(newStream)||"Embed"===getDeliveryMethod(newStream)&&"Transcode"!==currentPlayMethod?(selectedTrackElementIndex=index,"External"!==getDeliveryMethod(currentStream)&&"Embed"!==getDeliveryMethod(currentStream)&&changeStream(player,getCurrentTicks(player),{SubtitleStreamIndex:-1})):changeStream(player,getCurrentTicks(player),{SubtitleStreamIndex:index})),player.setSubtitleStreamIndex(selectedTrackElementIndex),getPlayerData(player).subtitleStreamIndex=index}},self.seek=function(ticks,player){if(ticks=Math.max(0,ticks),(player=player||self._currentPlayer)&&!enableLocalPlaylistManagement(player))return player.isLocalPlayer?player.seek((ticks||0)/1e4):player.seek(ticks);changeStream(player,ticks)},self.seekRelative=function(offsetTicks,player){if((player=player||self._currentPlayer)&&!enableLocalPlaylistManagement(player)&&player.seekRelative)return player.isLocalPlayer?player.seekRelative((ticks||0)/1e4):player.seekRelative(ticks);var ticks=getCurrentTicks(player)+offsetTicks;return this.seek(ticks,player)},self.play=function(options){if(normalizePlayOptions(options),self._currentPlayer){if(!1===options.enableRemotePlayers&&!self._currentPlayer.isLocalPlayer)return Promise.reject();if(!self._currentPlayer.isLocalPlayer)return self._currentPlayer.play(options)}if(options.fullscreen&&loading.show(),options.items)return translateItemsForPlayback(options.items,options).then(function(items){return playWithIntros(items,options)});if(!options.serverId)throw new Error("serverId required!");return getItemsForPlayback(options.serverId,{Ids:options.ids.join(",")}).then(function(result){return translateItemsForPlayback(result.Items,options).then(function(items){return playWithIntros(items,options)})})},self.getPlayerState=function(player,item,mediaSource){if(!(player=player||self._currentPlayer))throw new Error("player cannot be null");if(!enableLocalPlaylistManagement(player)&&player.getPlayerState)return player.getPlayerState();item=item||self.currentItem(player),mediaSource=mediaSource||self.currentMediaSource(player);var state={PlayState:{}};return player&&(state.PlayState.VolumeLevel=player.getVolume(),state.PlayState.IsMuted=player.isMuted(),state.PlayState.IsPaused=player.paused(),state.PlayState.RepeatMode=self.getRepeatMode(player),state.PlayState.MaxStreamingBitrate=self.getMaxStreamingBitrate(player),state.PlayState.PositionTicks=getCurrentTicks(player),state.PlayState.PlaybackStartTimeTicks=self.playbackStartTime(player),state.PlayState.SubtitleStreamIndex=self.getSubtitleStreamIndex(player),state.PlayState.AudioStreamIndex=self.getAudioStreamIndex(player),state.PlayState.BufferedRanges=self.getBufferedRanges(player),state.PlayState.PlayMethod=self.playMethod(player),mediaSource&&(state.PlayState.LiveStreamId=mediaSource.LiveStreamId),state.PlayState.PlaySessionId=self.playSessionId(player)),mediaSource&&(state.PlayState.MediaSourceId=mediaSource.Id,state.NowPlayingItem={RunTimeTicks:mediaSource.RunTimeTicks},state.PlayState.CanSeek=(mediaSource.RunTimeTicks||0)>0||canPlayerSeek(player)),item&&(state.NowPlayingItem=getNowPlayingItemForReporting(player,item,mediaSource)),state.MediaSource=mediaSource,state},self.duration=function(player){if((player=player||self._currentPlayer)&&!enableLocalPlaylistManagement(player)&&!player.isLocalPlayer)return player.duration();if(!player)throw new Error("player cannot be null");var mediaSource=self.currentMediaSource(player);if(mediaSource&&mediaSource.RunTimeTicks)return mediaSource.RunTimeTicks;var playerDuration=player.duration();return playerDuration&&(playerDuration*=1e4),playerDuration},self.getCurrentTicks=getCurrentTicks,self.getPlaybackInfo=function(item,options){options=options||{};var startPosition=options.startPositionTicks||0,mediaType=options.mediaType||item.MediaType,player=getPlayer(item,options),apiClient=connectionManager.getApiClient(item.ServerId),maxBitrate=getSavedMaxStreamingBitrate(connectionManager.getApiClient(item.ServerId),mediaType);return player.getDeviceProfile(item).then(function(deviceProfile){return getPlaybackMediaSource(player,apiClient,deviceProfile,maxBitrate,item,startPosition,options.mediaSourceId,options.audioStreamIndex,options.subtitleStreamIndex).then(function(mediaSource){return createStreamInfo(apiClient,item.MediaType,item,mediaSource,startPosition)})})},self.setCurrentPlaylistItem=function(playlistItemId,player){if((player=player||self._currentPlayer)&&!enableLocalPlaylistManagement(player))return player.setCurrentPlaylistItem(playlistItemId);for(var newItem,newItemIndex,playlist=self._playQueueManager.getPlaylist(),i=0,length=playlist.length;i=0){var playlist=self._playQueueManager.getPlaylist(),newItem=playlist[newIndex];if(newItem){var newItemPlayOptions=newItem.playOptions||{};newItemPlayOptions.startPositionTicks=0,playInternal(newItem,newItemPlayOptions,function(){setPlaylistState(newItem.PlaylistItemId,newIndex)})}}},self.queue=function(options,player){queue(options,"",player)},self.queueNext=function(options,player){queue(options,"next",player)},events.on(pluginManager,"registered",function(e,plugin){"mediaplayer"===plugin.type&&initMediaPlayer(plugin)}),pluginManager.ofType("mediaplayer").map(initMediaPlayer),self.onAppClose=function(){var player=this._currentPlayer;player&&this.isPlaying(player)&&(this._playNextAfterEnded=!1,onPlaybackStopped.call(player))},self.playbackStartTime=function(player){if((player=player||this._currentPlayer)&&!enableLocalPlaylistManagement(player)&&!player.isLocalPlayer)return player.playbackStartTime();var streamInfo=getPlayerData(player).streamInfo;return streamInfo?streamInfo.playbackStartTimeTicks:null},apphost.supports("remotecontrol")&&require(["serverNotifications"],function(serverNotifications){events.on(serverNotifications,"ServerShuttingDown",self.setDefaultPlayerActive.bind(self)),events.on(serverNotifications,"ServerRestarting",self.setDefaultPlayerActive.bind(self))})}var startingPlaySession=(new Date).getTime();return PlaybackManager.prototype.getCurrentPlayer=function(){return this._currentPlayer},PlaybackManager.prototype.currentTime=function(player){return player=player||this._currentPlayer,!player||enableLocalPlaylistManagement(player)||player.isLocalPlayer?this.getCurrentTicks(player):player.currentTime()},PlaybackManager.prototype.nextItem=function(player){if((player=player||this._currentPlayer)&&!enableLocalPlaylistManagement(player))return player.nextItem();var nextItem=this._playQueueManager.getNextItemInfo();if(!nextItem||!nextItem.item)return Promise.reject();var apiClient=connectionManager.getApiClient(nextItem.item.ServerId);return apiClient.getItem(apiClient.getCurrentUserId(),nextItem.item.Id)},PlaybackManager.prototype.canQueue=function(item){return"MusicAlbum"===item.Type||"MusicArtist"===item.Type||"MusicGenre"===item.Type?this.canQueueMediaType("Audio"):this.canQueueMediaType(item.MediaType)},PlaybackManager.prototype.canQueueMediaType=function(mediaType){return!!this._currentPlayer&&this._currentPlayer.canPlayMediaType(mediaType)},PlaybackManager.prototype.isMuted=function(player){return!!(player=player||this._currentPlayer)&&player.isMuted()},PlaybackManager.prototype.setMute=function(mute,player){(player=player||this._currentPlayer)&&player.setMute(mute)}, +PlaybackManager.prototype.toggleMute=function(mute,player){(player=player||this._currentPlayer)&&(player.toggleMute?player.toggleMute():player.setMute(!player.isMuted()))},PlaybackManager.prototype.toggleDisplayMirroring=function(){this.enableDisplayMirroring(!this.enableDisplayMirroring())},PlaybackManager.prototype.enableDisplayMirroring=function(enabled){if(null!=enabled){var val=enabled?"1":"0";return void appSettings.set("displaymirror",val)}return"0"!==(appSettings.get("displaymirror")||"")},PlaybackManager.prototype.nextChapter=function(player){player=player||this._currentPlayer;var item=this.currentItem(player),ticks=this.getCurrentTicks(player),nextChapter=(item.Chapters||[]).filter(function(i){return i.StartPositionTicks>ticks})[0];nextChapter?this.seek(nextChapter.StartPositionTicks,player):this.nextTrack(player)},PlaybackManager.prototype.previousChapter=function(player){player=player||this._currentPlayer;var item=this.currentItem(player),ticks=this.getCurrentTicks(player);ticks-=1e8,0===this.getCurrentPlaylistIndex(player)&&(ticks=Math.max(ticks,0));var previousChapters=(item.Chapters||[]).filter(function(i){return i.StartPositionTicks<=ticks});previousChapters.length?this.seek(previousChapters[previousChapters.length-1].StartPositionTicks,player):this.previousTrack(player)},PlaybackManager.prototype.fastForward=function(player){if(player=player||this._currentPlayer,null!=player.fastForward)return void player.fastForward(userSettings.skipForwardLength());var offsetTicks=1e4*userSettings.skipForwardLength();this.seekRelative(offsetTicks,player)},PlaybackManager.prototype.rewind=function(player){if(player=player||this._currentPlayer,null!=player.rewind)return void player.rewind(userSettings.skipBackLength());var offsetTicks=0-1e4*userSettings.skipBackLength();this.seekRelative(offsetTicks,player)},PlaybackManager.prototype.seekPercent=function(percent,player){player=player||this._currentPlayer;var ticks=this.duration(player)||0;percent/=100,ticks*=percent,this.seek(parseInt(ticks),player)},PlaybackManager.prototype.playTrailers=function(item){var apiClient=connectionManager.getApiClient(item.ServerId),instance=this;if(item.LocalTrailerCount)return apiClient.getLocalTrailers(apiClient.getCurrentUserId(),item.Id).then(function(result){return instance.play({items:result})});var remoteTrailers=item.RemoteTrailers||[];return remoteTrailers.length?this.play({items:remoteTrailers.map(function(t){return{Name:t.Name||item.Name+" Trailer",Url:t.Url,MediaType:"Video",Type:"Trailer",ServerId:apiClient.serverId()}})}):Promise.reject()},PlaybackManager.prototype.getSubtitleUrl=function(textStream,serverId){var apiClient=connectionManager.getApiClient(serverId);return textStream.IsExternalUrl?textStream.DeliveryUrl:apiClient.getUrl(textStream.DeliveryUrl)},PlaybackManager.prototype.stop=function(player){return player=player||this._currentPlayer,player?(enableLocalPlaylistManagement(player)&&(this._playNextAfterEnded=!1),player.stop(!0,!0)):Promise.resolve()},PlaybackManager.prototype.getBufferedRanges=function(player){return player=player||this._currentPlayer,player&&player.getBufferedRanges?player.getBufferedRanges():[]},PlaybackManager.prototype.playPause=function(player){if(player=player||this._currentPlayer)return player.playPause?player.playPause():player.paused()?this.unpause(player):this.pause(player)},PlaybackManager.prototype.paused=function(player){if(player=player||this._currentPlayer)return player.paused()},PlaybackManager.prototype.pause=function(player){(player=player||this._currentPlayer)&&player.pause()},PlaybackManager.prototype.unpause=function(player){(player=player||this._currentPlayer)&&player.unpause()},PlaybackManager.prototype.instantMix=function(item,player){if((player=player||this._currentPlayer)&&player.instantMix)return player.instantMix(item);var apiClient=connectionManager.getApiClient(item.ServerId),options={};options.UserId=apiClient.getCurrentUserId(),options.Fields="MediaSources",options.Limit=200;var instance=this;apiClient.getInstantMixFromItem(item.Id,options).then(function(result){instance.play({items:result.Items})})},PlaybackManager.prototype.shuffle=function(shuffleItem,player,queryOptions){return player=player||this._currentPlayer,player&&player.shuffle?player.shuffle(shuffleItem):this.play({items:[shuffleItem],shuffle:!0})},PlaybackManager.prototype.audioTracks=function(player){if(player=player||this._currentPlayer,player.audioTracks){var result=player.audioTracks();if(result)return result}return((this.currentMediaSource(player)||{}).MediaStreams||[]).filter(function(s){return"Audio"===s.Type})},PlaybackManager.prototype.subtitleTracks=function(player){if(player=player||this._currentPlayer,player.subtitleTracks){var result=player.subtitleTracks();if(result)return result}return((this.currentMediaSource(player)||{}).MediaStreams||[]).filter(function(s){return"Subtitle"===s.Type})},PlaybackManager.prototype.getSupportedCommands=function(player){if(player=player||this._currentPlayer||{isLocalPlayer:!0},player.isLocalPlayer){var list=["GoHome","GoToSettings","VolumeUp","VolumeDown","Mute","Unmute","ToggleMute","SetVolume","SetAudioStreamIndex","SetSubtitleStreamIndex","SetMaxStreamingBitrate","DisplayContent","GoToSearch","DisplayMessage","SetRepeatMode","PlayMediaSource"];return apphost.supports("fullscreenchange")&&list.push("ToggleFullscreen"),player.supports&&(player.supports("PictureInPicture")&&list.push("PictureInPicture"),player.supports("SetBrightness")&&list.push("SetBrightness"),player.supports("SetAspectRatio")&&list.push("SetAspectRatio")),list}var info=this.getPlayerInfo();return info?info.supportedCommands:[]},PlaybackManager.prototype.setRepeatMode=function(value,player){if((player=player||this._currentPlayer)&&!enableLocalPlaylistManagement(player))return player.setRepeatMode(value);this._playQueueManager.setRepeatMode(value),events.trigger(player,"repeatmodechange")},PlaybackManager.prototype.getRepeatMode=function(player){return player=player||this._currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.getRepeatMode():this._playQueueManager.getRepeatMode()},PlaybackManager.prototype.trySetActiveDeviceName=function(name){name=normalizeName(name);var instance=this;instance.getTargets().then(function(result){var target=result.filter(function(p){return normalizeName(p.name)===name})[0];target&&instance.trySetActivePlayer(target.playerName,target)})},PlaybackManager.prototype.displayContent=function(options,player){(player=player||this._currentPlayer)&&player.displayContent&&player.displayContent(options)},PlaybackManager.prototype.beginPlayerUpdates=function(player){player.beginPlayerUpdates&&player.beginPlayerUpdates()},PlaybackManager.prototype.endPlayerUpdates=function(player){player.endPlayerUpdates&&player.endPlayerUpdates()},PlaybackManager.prototype.setDefaultPlayerActive=function(){this.setActivePlayer("localplayer")},PlaybackManager.prototype.removeActivePlayer=function(name){var playerInfo=this.getPlayerInfo();playerInfo&&playerInfo.name===name&&this.setDefaultPlayerActive()},PlaybackManager.prototype.removeActiveTarget=function(id){var playerInfo=this.getPlayerInfo();playerInfo&&playerInfo.id===id&&this.setDefaultPlayerActive()},PlaybackManager.prototype.sendCommand=function(cmd,player){switch(console.log("MediaController received command: "+cmd.Name),cmd.Name){case"SetRepeatMode":this.setRepeatMode(cmd.Arguments.RepeatMode,player);break;case"VolumeUp":this.volumeUp(player);break;case"VolumeDown":this.volumeDown(player);break;case"Mute":this.setMute(!0,player);break;case"Unmute":this.setMute(!1,player);break;case"ToggleMute":this.toggleMute(player);break;case"SetVolume":this.setVolume(cmd.Arguments.Volume,player);break;case"SetAspectRatio":this.setAspectRatio(cmd.Arguments.AspectRatio,player);break;case"SetBrightness":this.setBrightness(cmd.Arguments.Brightness,player);break;case"SetAudioStreamIndex":this.setAudioStreamIndex(parseInt(cmd.Arguments.Index),player);break;case"SetSubtitleStreamIndex":this.setSubtitleStreamIndex(parseInt(cmd.Arguments.Index),player);break;case"SetMaxStreamingBitrate":break;case"ToggleFullscreen":this.toggleFullscreen(player);break;default:player.sendCommand&&player.sendCommand(cmd)}},new PlaybackManager}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playbackorientation.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playbackorientation.js index 5731a616bb..9eced4dc0c 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playbackorientation.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playbackorientation.js @@ -1 +1 @@ -define(["playbackManager","layoutManager","events"],function(playbackManager,layoutManager,events){"use strict";function onOrientationChangeSuccess(){orientationLocked=!0}function onOrientationChangeError(err){orientationLocked=!1,console.log("error locking orientation: "+err)}var orientationLocked;events.on(playbackManager,"playbackstart",function(e,player,state){var isLocalVideo=player.isLocalPlayer&&!player.isExternalPlayer&&playbackManager.isPlayingVideo(player);if(isLocalVideo&&layoutManager.mobile){var lockOrientation=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation||screen.orientation&&screen.orientation.lock;if(lockOrientation)try{var promise=lockOrientation("landscape");promise.then?promise.then(onOrientationChangeSuccess,onOrientationChangeError):orientationLocked=promise}catch(err){onOrientationChangeError(err)}}}),events.on(playbackManager,"playbackstop",function(e,playbackStopInfo){if(orientationLocked&&!playbackStopInfo.nextMediaType){var unlockOrientation=screen.unlockOrientation||screen.mozUnlockOrientation||screen.msUnlockOrientation||screen.orientation&&screen.orientation.unlock;if(unlockOrientation){try{unlockOrientation()}catch(err){console.log("error unlocking orientation: "+err)}orientationLocked=!1}}})}); \ No newline at end of file +define(["playbackManager","layoutManager","events"],function(playbackManager,layoutManager,events){"use strict";function onOrientationChangeSuccess(){orientationLocked=!0}function onOrientationChangeError(err){orientationLocked=!1,console.log("error locking orientation: "+err)}var orientationLocked;events.on(playbackManager,"playbackstart",function(e,player,state){if(player.isLocalPlayer&&!player.isExternalPlayer&&playbackManager.isPlayingVideo(player)&&layoutManager.mobile){var lockOrientation=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation||screen.orientation&&screen.orientation.lock;if(lockOrientation)try{var promise=lockOrientation("landscape");promise.then?promise.then(onOrientationChangeSuccess,onOrientationChangeError):orientationLocked=promise}catch(err){onOrientationChangeError(err)}}}),events.on(playbackManager,"playbackstop",function(e,playbackStopInfo){if(orientationLocked&&!playbackStopInfo.nextMediaType){var unlockOrientation=screen.unlockOrientation||screen.mozUnlockOrientation||screen.msUnlockOrientation||screen.orientation&&screen.orientation.unlock;if(unlockOrientation){try{unlockOrientation()}catch(err){console.log("error unlocking orientation: "+err)}orientationLocked=!1}}})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playerselection.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playerselection.js index 8b82f1093f..e270355bc9 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playerselection.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playerselection.js @@ -1 +1 @@ -define(["appSettings","events","browser","loading","playbackManager","appRouter","globalize","apphost"],function(appSettings,events,browser,loading,playbackManager,appRouter,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&&playbackManager.enableDisplayMirroring()){var getPlayerInfo=playbackManager.getPlayerInfo();getPlayerInfo&&(getPlayerInfo.isLocalPlayer||getPlayerInfo.supportedCommands.indexOf("DisplayContent")===-1||mirrorItem(info,playbackManager.getCurrentPlayer()))}}function emptyCallback(){}function getTargetSecondaryText(target){return target.user?target.user.Name:null}function getIcon(target){var deviceType=target.deviceType;switch(!deviceType&&target.isLocalPlayer&&(deviceType=browser.tv?"tv":browser.mobile?"smartphone":"desktop"),deviceType||(deviceType="tv"),deviceType){case"smartphone":return"";case"tablet":return"";case"tv":return"";case"cast":return"";case"desktop":return"";default:return""}}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,secondaryText:getTargetSecondaryText(t),icon:getIcon(t)}});require(["actionsheet"],function(actionsheet){loading.hide();var menuOptions={title:globalize.translate("sharedcomponents#HeaderPlayOn"),items:menuItems,positionTo:button,resolveOnClick:!0,border:!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 disconnectFromPlayer(currentDeviceName){playbackManager.getSupportedCommands().indexOf("EndSession")!==-1?require(["dialog"],function(dialog){var menuItems=[];menuItems.push({name:globalize.translate("sharedcomponents#Yes"),id:"yes"}),menuItems.push({name:globalize.translate("sharedcomponents#No"),id:"no"}),dialog({buttons:menuItems,text:globalize.translate("sharedcomponents#ConfirmEndPlayerSession",currentDeviceName)}).then(function(id){switch(id){case"yes":playbackManager.getCurrentPlayer().endSession(),playbackManager.setDefaultPlayerActive();break;case"no":playbackManager.setDefaultPlayerActive()}})}):playbackManager.setDefaultPlayerActive()}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);dlg.classList.add("promptDialog");var currentDeviceName=playerInfo.deviceName||playerInfo.name;if(html+='
',html+='

',html+=currentDeviceName,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",dialogHelper.close(dlg)}),dlg.querySelector(".btnDisconnect").addEventListener("click",function(){destination="disconnectFromPlayer",dialogHelper.close(dlg)}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),dialogHelper.open(dlg).then(function(){"nowplaying"===destination?appRouter.showNowPlaying():"disconnectFromPlayer"===destination&&disconnectFromPlayer(currentDeviceName)},emptyCallback)}function onMirrorChange(){playbackManager.enableDisplayMirroring(this.checked)}return 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()}),events.on(playbackManager,"pairing",function(e){loading.show()}),events.on(playbackManager,"paired",function(e){loading.hide()}),events.on(playbackManager,"pairerror",function(e){loading.hide()}),{show:showPlayerSelection}}); \ No newline at end of file +define(["appSettings","events","browser","loading","playbackManager","appRouter","globalize","apphost"],function(appSettings,events,browser,loading,playbackManager,appRouter,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&&playbackManager.enableDisplayMirroring()){var getPlayerInfo=playbackManager.getPlayerInfo();getPlayerInfo&&(getPlayerInfo.isLocalPlayer||-1===getPlayerInfo.supportedCommands.indexOf("DisplayContent")||mirrorItem(info,playbackManager.getCurrentPlayer()))}}function emptyCallback(){}function getTargetSecondaryText(target){return target.user?target.user.Name:null}function getIcon(target){var deviceType=target.deviceType;switch(!deviceType&&target.isLocalPlayer&&(deviceType=browser.tv?"tv":browser.mobile?"smartphone":"desktop"),deviceType||(deviceType="tv"),deviceType){case"smartphone":return"";case"tablet":return"";case"tv":return"";case"cast":return"";case"desktop":return"";default:return""}}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,secondaryText:getTargetSecondaryText(t),icon:getIcon(t)}});require(["actionsheet"],function(actionsheet){loading.hide();var menuOptions={title:globalize.translate("sharedcomponents#HeaderPlayOn"),items:menuItems,positionTo:button,resolveOnClick:!0,border:!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 disconnectFromPlayer(currentDeviceName){-1!==playbackManager.getSupportedCommands().indexOf("EndSession")?require(["dialog"],function(dialog){var menuItems=[];menuItems.push({name:globalize.translate("sharedcomponents#Yes"),id:"yes"}),menuItems.push({name:globalize.translate("sharedcomponents#No"),id:"no"}),dialog({buttons:menuItems,text:globalize.translate("sharedcomponents#ConfirmEndPlayerSession",currentDeviceName)}).then(function(id){switch(id){case"yes":playbackManager.getCurrentPlayer().endSession(),playbackManager.setDefaultPlayerActive();break;case"no":playbackManager.setDefaultPlayerActive()}})}):playbackManager.setDefaultPlayerActive()}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);dlg.classList.add("promptDialog");var currentDeviceName=playerInfo.deviceName||playerInfo.name;if(html+='
',html+='

',html+=currentDeviceName,html+="

",html+="
",-1!==playerInfo.supportedCommands.indexOf("DisplayContent")){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",dialogHelper.close(dlg)}),dlg.querySelector(".btnDisconnect").addEventListener("click",function(){destination="disconnectFromPlayer",dialogHelper.close(dlg)}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),dialogHelper.open(dlg).then(function(){"nowplaying"===destination?appRouter.showNowPlaying():"disconnectFromPlayer"===destination&&disconnectFromPlayer(currentDeviceName)},emptyCallback)}function onMirrorChange(){playbackManager.enableDisplayMirroring(this.checked)}return 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()}),events.on(playbackManager,"pairing",function(e){loading.show()}),events.on(playbackManager,"paired",function(e){loading.hide()}),events.on(playbackManager,"pairerror",function(e){loading.hide()}),{show:showPlayerSelection}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playersettingsmenu.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playersettingsmenu.js index 794ce8554e..c97bdbcd4a 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playersettingsmenu.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playersettingsmenu.js @@ -1 +1 @@ -define(["connectionManager","actionsheet","datetime","playbackManager","globalize","appSettings","qualityoptions"],function(connectionManager,actionsheet,datetime,playbackManager,globalize,appSettings,qualityoptions){"use strict";function showQualityMenu(player,btn){var videoStream=playbackManager.currentMediaSource(player).MediaStreams.filter(function(stream){return"Video"===stream.Type})[0],videoWidth=videoStream?videoStream.Width:null,options=qualityoptions.getVideoQualityOptions({currentMaxBitrate:playbackManager.getMaxStreamingBitrate(player),isAutomaticBitrateEnabled:playbackManager.enableAutomaticBitrateDetection(player),videoWidth:videoWidth,enableAuto:!0}),menuItems=options.map(function(o){var opt={name:o.name,id:o.bitrate,asideText:o.secondaryText};return o.selected&&(opt.selected=!0),opt}),selectedId=options.filter(function(o){return o.selected});return selectedId=selectedId.length?selectedId[0].bitrate:null,actionsheet.show({items:menuItems,positionTo:btn}).then(function(id){var bitrate=parseInt(id);bitrate!==selectedId&&playbackManager.setMaxStreamingBitrate({enableAutomaticBitrateDetection:!bitrate,maxBitrate:bitrate},player)})}function showRepeatModeMenu(player,btn){var menuItems=[],currentValue=playbackManager.getRepeatMode(player);return menuItems.push({name:globalize.translate("sharedcomponents#RepeatAll"),id:"RepeatAll",selected:"RepeatAll"===currentValue}),menuItems.push({name:globalize.translate("sharedcomponents#RepeatOne"),id:"RepeatOne",selected:"RepeatOne"===currentValue}),menuItems.push({name:globalize.translate("sharedcomponents#None"),id:"RepeatNone",selected:"RepeatNone"===currentValue}),actionsheet.show({items:menuItems,positionTo:btn}).then(function(mode){mode&&playbackManager.setRepeatMode(mode,player)})}function getQualitySecondaryText(player){var state=playbackManager.getPlayerState(player),videoStream=(playbackManager.enableAutomaticBitrateDetection(player),playbackManager.getMaxStreamingBitrate(player),playbackManager.currentMediaSource(player).MediaStreams.filter(function(stream){return"Video"===stream.Type})[0]),videoWidth=videoStream?videoStream.Width:null,options=qualityoptions.getVideoQualityOptions({currentMaxBitrate:playbackManager.getMaxStreamingBitrate(player),isAutomaticBitrateEnabled:playbackManager.enableAutomaticBitrateDetection(player),videoWidth:videoWidth,enableAuto:!0}),selectedOption=(options.map(function(o){var opt={name:o.name,id:o.bitrate,asideText:o.secondaryText};return o.selected&&(opt.selected=!0),opt}),options.filter(function(o){return o.selected}));if(!selectedOption.length)return null;selectedOption=selectedOption[0];var text=selectedOption.name;return selectedOption.autoText&&(text+=state.PlayState&&"Transcode"!==state.PlayState.PlayMethod?" - Direct":" "+selectedOption.autoText),text}function showAspectRatioMenu(player,btn){var currentId=playbackManager.getAspectRatio(player),menuItems=playbackManager.getSupportedAspectRatios(player).map(function(i){return{id:i.id,name:i.name,selected:i.id===currentId}});return actionsheet.show({items:menuItems,positionTo:btn}).then(function(id){return id?(playbackManager.setAspectRatio(id,player),Promise.resolve()):Promise.reject()})}function showWithUser(options,player,user){var supportedCommands=playbackManager.getSupportedCommands(player),menuItems=(options.mediaType,[]);if(supportedCommands.indexOf("SetAspectRatio")!==-1){var currentAspectRatioId=playbackManager.getAspectRatio(player),currentAspectRatio=playbackManager.getSupportedAspectRatios(player).filter(function(i){return i.id===currentAspectRatioId})[0];menuItems.push({name:globalize.translate("sharedcomponents#AspectRatio"),id:"aspectratio",asideText:currentAspectRatio?currentAspectRatio.name:null})}if(user&&user.Policy.EnableVideoPlaybackTranscoding){var secondaryQualityText=getQualitySecondaryText(player);menuItems.push({name:globalize.translate("sharedcomponents#Quality"),id:"quality",asideText:secondaryQualityText})}var repeatMode=playbackManager.getRepeatMode(player);return supportedCommands.indexOf("SetRepeatMode")!==-1&&playbackManager.currentMediaSource(player).RunTimeTicks&&menuItems.push({name:globalize.translate("sharedcomponents#RepeatMode"),id:"repeatmode",asideText:"RepeatNone"===repeatMode?globalize.translate("sharedcomponents#None"):globalize.translate("sharedcomponents#"+repeatMode)}),options.stats&&menuItems.push({name:globalize.translate("sharedcomponents#StatsForNerds"),id:"stats",asideText:null}),actionsheet.show({items:menuItems,positionTo:options.positionTo}).then(function(id){return handleSelectedOption(id,options,player)})}function show(options){var player=options.player,currentItem=playbackManager.currentItem(player);if(!currentItem||!currentItem.ServerId)return showWithUser(options,player,null);var apiClient=connectionManager.getApiClient(currentItem.ServerId);return apiClient.getCurrentUser().then(function(user){return showWithUser(options,player,user)})}function handleSelectedOption(id,options,player){switch(id){case"quality":return showQualityMenu(player,options.positionTo);case"aspectratio":return showAspectRatioMenu(player,options.positionTo);case"repeatmode":return showRepeatModeMenu(player,options.positionTo);case"stats":return options.onOption&&options.onOption("stats"),Promise.resolve()}return Promise.reject()}return{show:show}}); \ No newline at end of file +define(["connectionManager","actionsheet","datetime","playbackManager","globalize","appSettings","qualityoptions"],function(connectionManager,actionsheet,datetime,playbackManager,globalize,appSettings,qualityoptions){"use strict";function showQualityMenu(player,btn){var videoStream=playbackManager.currentMediaSource(player).MediaStreams.filter(function(stream){return"Video"===stream.Type})[0],videoWidth=videoStream?videoStream.Width:null,options=qualityoptions.getVideoQualityOptions({currentMaxBitrate:playbackManager.getMaxStreamingBitrate(player),isAutomaticBitrateEnabled:playbackManager.enableAutomaticBitrateDetection(player),videoWidth:videoWidth,enableAuto:!0}),menuItems=options.map(function(o){var opt={name:o.name,id:o.bitrate,asideText:o.secondaryText};return o.selected&&(opt.selected=!0),opt}),selectedId=options.filter(function(o){return o.selected});return selectedId=selectedId.length?selectedId[0].bitrate:null,actionsheet.show({items:menuItems,positionTo:btn}).then(function(id){var bitrate=parseInt(id);bitrate!==selectedId&&playbackManager.setMaxStreamingBitrate({enableAutomaticBitrateDetection:!bitrate,maxBitrate:bitrate},player)})}function showRepeatModeMenu(player,btn){var menuItems=[],currentValue=playbackManager.getRepeatMode(player);return menuItems.push({name:globalize.translate("sharedcomponents#RepeatAll"),id:"RepeatAll",selected:"RepeatAll"===currentValue}),menuItems.push({name:globalize.translate("sharedcomponents#RepeatOne"),id:"RepeatOne",selected:"RepeatOne"===currentValue}),menuItems.push({name:globalize.translate("sharedcomponents#None"),id:"RepeatNone",selected:"RepeatNone"===currentValue}),actionsheet.show({items:menuItems,positionTo:btn}).then(function(mode){mode&&playbackManager.setRepeatMode(mode,player)})}function getQualitySecondaryText(player){var state=playbackManager.getPlayerState(player),videoStream=(playbackManager.enableAutomaticBitrateDetection(player),playbackManager.getMaxStreamingBitrate(player),playbackManager.currentMediaSource(player).MediaStreams.filter(function(stream){return"Video"===stream.Type})[0]),videoWidth=videoStream?videoStream.Width:null,options=qualityoptions.getVideoQualityOptions({currentMaxBitrate:playbackManager.getMaxStreamingBitrate(player),isAutomaticBitrateEnabled:playbackManager.enableAutomaticBitrateDetection(player),videoWidth:videoWidth,enableAuto:!0}),selectedOption=(options.map(function(o){var opt={name:o.name,id:o.bitrate,asideText:o.secondaryText};return o.selected&&(opt.selected=!0),opt}),options.filter(function(o){return o.selected}));if(!selectedOption.length)return null;selectedOption=selectedOption[0];var text=selectedOption.name;return selectedOption.autoText&&(state.PlayState&&"Transcode"!==state.PlayState.PlayMethod?text+=" - Direct":text+=" "+selectedOption.autoText),text}function showAspectRatioMenu(player,btn){var currentId=playbackManager.getAspectRatio(player),menuItems=playbackManager.getSupportedAspectRatios(player).map(function(i){return{id:i.id,name:i.name,selected:i.id===currentId}});return actionsheet.show({items:menuItems,positionTo:btn}).then(function(id){return id?(playbackManager.setAspectRatio(id,player),Promise.resolve()):Promise.reject()})}function showWithUser(options,player,user){var supportedCommands=playbackManager.getSupportedCommands(player),menuItems=(options.mediaType,[]);if(-1!==supportedCommands.indexOf("SetAspectRatio")){var currentAspectRatioId=playbackManager.getAspectRatio(player),currentAspectRatio=playbackManager.getSupportedAspectRatios(player).filter(function(i){return i.id===currentAspectRatioId})[0];menuItems.push({name:globalize.translate("sharedcomponents#AspectRatio"),id:"aspectratio",asideText:currentAspectRatio?currentAspectRatio.name:null})}if(user&&user.Policy.EnableVideoPlaybackTranscoding){var secondaryQualityText=getQualitySecondaryText(player);menuItems.push({name:globalize.translate("sharedcomponents#Quality"),id:"quality",asideText:secondaryQualityText})}var repeatMode=playbackManager.getRepeatMode(player);return-1!==supportedCommands.indexOf("SetRepeatMode")&&playbackManager.currentMediaSource(player).RunTimeTicks&&menuItems.push({name:globalize.translate("sharedcomponents#RepeatMode"),id:"repeatmode",asideText:"RepeatNone"===repeatMode?globalize.translate("sharedcomponents#None"):globalize.translate("sharedcomponents#"+repeatMode)}),options.stats&&menuItems.push({name:globalize.translate("sharedcomponents#StatsForNerds"),id:"stats",asideText:null}),actionsheet.show({items:menuItems,positionTo:options.positionTo}).then(function(id){return handleSelectedOption(id,options,player)})}function show(options){var player=options.player,currentItem=playbackManager.currentItem(player);return currentItem&¤tItem.ServerId?connectionManager.getApiClient(currentItem.ServerId).getCurrentUser().then(function(user){return showWithUser(options,player,user)}):showWithUser(options,player,null)}function handleSelectedOption(id,options,player){switch(id){case"quality":return showQualityMenu(player,options.positionTo);case"aspectratio":return showAspectRatioMenu(player,options.positionTo);case"repeatmode":return showRepeatModeMenu(player,options.positionTo);case"stats":return options.onOption&&options.onOption("stats"),Promise.resolve()}return Promise.reject()}return{show:show}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playqueuemanager.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playqueuemanager.js index d80f397658..36375c225d 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playqueuemanager.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/playqueuemanager.js @@ -1 +1 @@ -define([],function(){"use strict";function addUniquePlaylistItemId(item){item.PlaylistItemId||(item.PlaylistItemId="playlistItem"+currentId,currentId++)}function findPlaylistIndex(playlistItemId,list){for(var i=0,length=list.length;i=playlist.length)throw new Error("newIndex out of bounds");return moveInArray(playlist,oldIndex,newIndex),this._playlist=playlist,{result:"moved",playlistItemId:playlistItemId,newIndex:newIndex}},PlayQueueManager.prototype.reset=function(){this._playlist=[],this._currentPlaylistItemId=null,this._repeatMode="RepeatNone"},PlayQueueManager.prototype.setRepeatMode=function(value){this._repeatMode=value},PlayQueueManager.prototype.getRepeatMode=function(){return this._repeatMode},PlayQueueManager.prototype.getNextItemInfo=function(){var newIndex,playlist=this.getPlaylist(),playlistLength=playlist.length;switch(this.getRepeatMode()){case"RepeatOne":newIndex=this.getCurrentPlaylistIndex();break;case"RepeatAll":newIndex=this.getCurrentPlaylistIndex()+1,newIndex>=playlistLength&&(newIndex=0);break;default:newIndex=this.getCurrentPlaylistIndex()+1}if(newIndex<0||newIndex>=playlistLength)return null;var item=playlist[newIndex];return item?{item:item,index:newIndex}:null},PlayQueueManager}); \ No newline at end of file +define([],function(){"use strict";function addUniquePlaylistItemId(item){item.PlaylistItemId||(item.PlaylistItemId="playlistItem"+currentId,currentId++)}function findPlaylistIndex(playlistItemId,list){for(var i=0,length=list.length;i=playlist.length)throw new Error("newIndex out of bounds");return moveInArray(playlist,oldIndex,newIndex),this._playlist=playlist,{result:"moved",playlistItemId:playlistItemId,newIndex:newIndex}},PlayQueueManager.prototype.reset=function(){this._playlist=[],this._currentPlaylistItemId=null,this._repeatMode="RepeatNone"},PlayQueueManager.prototype.setRepeatMode=function(value){this._repeatMode=value},PlayQueueManager.prototype.getRepeatMode=function(){return this._repeatMode},PlayQueueManager.prototype.getNextItemInfo=function(){var newIndex,playlist=this.getPlaylist(),playlistLength=playlist.length;switch(this.getRepeatMode()){case"RepeatOne":newIndex=this.getCurrentPlaylistIndex();break;case"RepeatAll":newIndex=this.getCurrentPlaylistIndex()+1,newIndex>=playlistLength&&(newIndex=0);break;default:newIndex=this.getCurrentPlaylistIndex()+1}if(newIndex<0||newIndex>=playlistLength)return null;var item=playlist[newIndex];return item?{item:item,index:newIndex}:null},PlayQueueManager}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/volumeosd.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/volumeosd.js index 39563309f4..b33ed54cd1 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/volumeosd.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playback/volumeosd.js @@ -1 +1 @@ -define(["events","playbackManager","dom","browser","css!./iconosd","material-icons"],function(events,playbackManager,dom,browser){"use strict";function getOsdElementHtml(){var html="";return html+='',html+='
'}function ensureOsdElement(){var elem=osdElement;elem||(enableAnimation=browser.supportsCssAnimation(),elem=document.createElement("div"),elem.classList.add("hide"),elem.classList.add("iconOsd"),elem.classList.add("iconOsd-hidden"),elem.classList.add("volumeOsd"),elem.innerHTML=getOsdElementHtml(),iconElement=elem.querySelector("i"),progressElement=elem.querySelector(".iconOsdProgressInner"),document.body.appendChild(elem),osdElement=elem)}function onHideComplete(){this.classList.add("hide")}function showOsd(){clearHideTimeout();var elem=osdElement;dom.removeEventListener(elem,dom.whichTransitionEvent(),onHideComplete,{once:!0}),elem.classList.remove("hide"),void elem.offsetWidth,requestAnimationFrame(function(){elem.classList.remove("iconOsd-hidden"),hideTimeout=setTimeout(hideOsd,3e3)})}function clearHideTimeout(){hideTimeout&&(clearTimeout(hideTimeout),hideTimeout=null)}function hideOsd(){clearHideTimeout();var elem=osdElement;elem&&(enableAnimation?(void elem.offsetWidth,requestAnimationFrame(function(){elem.classList.add("iconOsd-hidden"),dom.addEventListener(elem,dom.whichTransitionEvent(),onHideComplete,{once:!0})})):onHideComplete.call(elem))}function updatePlayerVolumeState(isMuted,volume){iconElement&&(iconElement.innerHTML=isMuted?"":""),progressElement&&(progressElement.style.width=(volume||0)+"%")}function releaseCurrentPlayer(){var player=currentPlayer;player&&(events.off(player,"volumechange",onVolumeChanged),events.off(player,"playbackstop",hideOsd),currentPlayer=null)}function onVolumeChanged(e){var player=this;ensureOsdElement(),updatePlayerVolumeState(player.isMuted(),player.getVolume()),showOsd()}function bindToPlayer(player){player!==currentPlayer&&(releaseCurrentPlayer(),currentPlayer=player,player&&(hideOsd(),events.on(player,"volumechange",onVolumeChanged),events.on(player,"playbackstop",hideOsd)))}var currentPlayer,osdElement,iconElement,progressElement,enableAnimation,hideTimeout;events.on(playbackManager,"playerchange",function(){bindToPlayer(playbackManager.getCurrentPlayer())}),bindToPlayer(playbackManager.getCurrentPlayer())}); \ No newline at end of file +define(["events","playbackManager","dom","browser","css!./iconosd","material-icons"],function(events,playbackManager,dom,browser){"use strict";function getOsdElementHtml(){var html="";return html+='',html+='
'}function ensureOsdElement(){var elem=osdElement;elem||(enableAnimation=browser.supportsCssAnimation(),elem=document.createElement("div"),elem.classList.add("hide"),elem.classList.add("iconOsd"),elem.classList.add("iconOsd-hidden"),elem.classList.add("volumeOsd"),elem.innerHTML=getOsdElementHtml(),iconElement=elem.querySelector("i"),progressElement=elem.querySelector(".iconOsdProgressInner"),document.body.appendChild(elem),osdElement=elem)}function onHideComplete(){this.classList.add("hide")}function showOsd(){clearHideTimeout();var elem=osdElement;dom.removeEventListener(elem,dom.whichTransitionEvent(),onHideComplete,{once:!0}),elem.classList.remove("hide"),elem.offsetWidth,requestAnimationFrame(function(){elem.classList.remove("iconOsd-hidden"),hideTimeout=setTimeout(hideOsd,3e3)})}function clearHideTimeout(){hideTimeout&&(clearTimeout(hideTimeout),hideTimeout=null)}function hideOsd(){clearHideTimeout();var elem=osdElement;elem&&(enableAnimation?(elem.offsetWidth,requestAnimationFrame(function(){elem.classList.add("iconOsd-hidden"),dom.addEventListener(elem,dom.whichTransitionEvent(),onHideComplete,{once:!0})})):onHideComplete.call(elem))}function updatePlayerVolumeState(isMuted,volume){iconElement&&(iconElement.innerHTML=isMuted?"":""),progressElement&&(progressElement.style.width=(volume||0)+"%")}function releaseCurrentPlayer(){var player=currentPlayer;player&&(events.off(player,"volumechange",onVolumeChanged),events.off(player,"playbackstop",hideOsd),currentPlayer=null)}function onVolumeChanged(e){var player=this;ensureOsdElement(),updatePlayerVolumeState(player.isMuted(),player.getVolume()),showOsd()}function bindToPlayer(player){player!==currentPlayer&&(releaseCurrentPlayer(),currentPlayer=player,player&&(hideOsd(),events.on(player,"volumechange",onVolumeChanged),events.on(player,"playbackstop",hideOsd)))}var currentPlayer,osdElement,iconElement,progressElement,enableAnimation,hideTimeout;events.on(playbackManager,"playerchange",function(){bindToPlayer(playbackManager.getCurrentPlayer())}),bindToPlayer(playbackManager.getCurrentPlayer())}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playbacksettings/playbacksettings.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playbacksettings/playbacksettings.js index 262ae57b64..0999d1db89 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playbacksettings/playbacksettings.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playbacksettings/playbacksettings.js @@ -1 +1 @@ -define(["require","browser","appSettings","apphost","focusManager","qualityoptions","globalize","loading","connectionManager","dom","events","emby-select","emby-checkbox"],function(require,browser,appSettings,appHost,focusManager,qualityoptions,globalize,loading,connectionManager,dom,events){"use strict";function fillSkipLengths(select){var options=[5,10,15,20,25,30];select.innerHTML=options.map(function(option){return{name:globalize.translate("sharedcomponents#ValueSeconds",option),value:1e3*option}}).map(function(o){return'"}).join("")}function populateLanguages(select,languages){var html="";html+="";for(var i=0,length=languages.length;i"+culture.DisplayName+""}select.innerHTML=html}function setMaxBitrateIntoField(select,isInNetwork,mediatype){var options="Audio"===mediatype?qualityoptions.getAudioQualityOptions({currentMaxBitrate:appSettings.maxStreamingBitrate(isInNetwork,mediatype),isAutomaticBitrateEnabled:appSettings.enableAutomaticBitrateDetection(isInNetwork,mediatype),enableAuto:!0}):qualityoptions.getVideoQualityOptions({currentMaxBitrate:appSettings.maxStreamingBitrate(isInNetwork,mediatype),isAutomaticBitrateEnabled:appSettings.enableAutomaticBitrateDetection(isInNetwork,mediatype),enableAuto:!0});select.innerHTML=options.map(function(i){return'"}).join(""),appSettings.enableAutomaticBitrateDetection(isInNetwork,mediatype)?select.value="":select.value=appSettings.maxStreamingBitrate(isInNetwork,mediatype)}function fillChromecastQuality(select){var options=qualityoptions.getVideoQualityOptions({currentMaxBitrate:appSettings.maxChromecastBitrate(),isAutomaticBitrateEnabled:!appSettings.maxChromecastBitrate(),enableAuto:!0});select.innerHTML=options.map(function(i){return'"}).join(""),select.value=appSettings.maxChromecastBitrate()||""}function setMaxBitrateFromField(select,isInNetwork,mediatype,value){select.value?(appSettings.maxStreamingBitrate(isInNetwork,mediatype,select.value),appSettings.enableAutomaticBitrateDetection(isInNetwork,mediatype,!1)):appSettings.enableAutomaticBitrateDetection(isInNetwork,mediatype,!0)}function showHideQualityFields(context,user,apiClient){return user.Policy.EnableVideoPlaybackTranscoding?context.querySelector(".videoQualitySection").classList.remove("hide"):context.querySelector(".videoQualitySection").classList.add("hide"),appHost.supports("multiserver")?(context.querySelector(".fldVideoInNetworkQuality").classList.remove("hide"),context.querySelector(".fldVideoInternetQuality").classList.remove("hide"),void(user.Policy.EnableAudioPlaybackTranscoding?context.querySelector(".musicQualitySection").classList.remove("hide"):context.querySelector(".musicQualitySection").classList.add("hide"))):void apiClient.getEndpointInfo().then(function(endpointInfo){endpointInfo.IsInNetwork?(context.querySelector(".fldVideoInNetworkQuality").classList.remove("hide"),context.querySelector(".fldVideoInternetQuality").classList.add("hide"),context.querySelector(".musicQualitySection").classList.add("hide")):(context.querySelector(".fldVideoInNetworkQuality").classList.add("hide"),context.querySelector(".fldVideoInternetQuality").classList.remove("hide"),user.Policy.EnableAudioPlaybackTranscoding?context.querySelector(".musicQualitySection").classList.remove("hide"):context.querySelector(".musicQualitySection").classList.add("hide"))})}function showOrHideEpisodesField(context,user,apiClient){return browser.tizen||browser.web0s?void context.querySelector(".fldEpisodeAutoPlay").classList.add("hide"):void context.querySelector(".fldEpisodeAutoPlay").classList.remove("hide")}function loadForm(context,user,userSettings,apiClient){var loggedInUserId=apiClient.getCurrentUserId(),userId=user.Id;showHideQualityFields(context,user,apiClient),apiClient.getCultures().then(function(allCultures){populateLanguages(context.querySelector("#selectAudioLanguage"),allCultures),context.querySelector("#selectAudioLanguage",context).value=user.Configuration.AudioLanguagePreference||"",context.querySelector(".chkEpisodeAutoPlay").checked=user.Configuration.EnableNextEpisodeAutoPlay||!1}),apiClient.getNamedConfiguration("cinemamode").then(function(cinemaConfig){cinemaConfig.EnableIntrosForMovies||cinemaConfig.EnableIntrosForEpisodes?context.querySelector(".cinemaModeOptions").classList.remove("hide"):context.querySelector(".cinemaModeOptions").classList.add("hide")}),appHost.supports("externalplayerintent")&&userId===loggedInUserId?context.querySelector(".fldExternalPlayer").classList.remove("hide"):context.querySelector(".fldExternalPlayer").classList.add("hide"),userId===loggedInUserId&&(user.Policy.EnableVideoPlaybackTranscoding||user.Policy.EnableAudioPlaybackTranscoding)?(context.querySelector(".qualitySections").classList.remove("hide"),appHost.supports("chromecast")&&user.Policy.EnableVideoPlaybackTranscoding?context.querySelector(".fldChromecastQuality").classList.remove("hide"):context.querySelector(".fldChromecastQuality").classList.add("hide")):(context.querySelector(".qualitySections").classList.add("hide"),context.querySelector(".fldChromecastQuality").classList.add("hide")),browser.tizen||browser.web0s?context.querySelector(".fldEnableNextVideoOverlay").classList.add("hide"):context.querySelector(".fldEnableNextVideoOverlay").classList.remove("hide"),context.querySelector(".chkPlayDefaultAudioTrack").checked=user.Configuration.PlayDefaultAudioTrack||!1,context.querySelector(".chkEnableCinemaMode").checked=userSettings.enableCinemaMode(),context.querySelector(".chkEnableNextVideoOverlay").checked=userSettings.enableNextVideoInfoOverlay(),context.querySelector(".chkExternalVideoPlayer").checked=appSettings.enableSystemExternalPlayers(),setMaxBitrateIntoField(context.querySelector(".selectVideoInNetworkQuality"),!0,"Video"),setMaxBitrateIntoField(context.querySelector(".selectVideoInternetQuality"),!1,"Video"),setMaxBitrateIntoField(context.querySelector(".selectMusicInternetQuality"),!1,"Audio"),fillChromecastQuality(context.querySelector(".selectChromecastVideoQuality"));var selectSkipForwardLength=context.querySelector(".selectSkipForwardLength");fillSkipLengths(selectSkipForwardLength),selectSkipForwardLength.value=userSettings.skipForwardLength();var selectSkipBackLength=context.querySelector(".selectSkipBackLength");fillSkipLengths(selectSkipBackLength),selectSkipBackLength.value=userSettings.skipBackLength(),showOrHideEpisodesField(context,user,apiClient),loading.hide()}function saveUser(context,user,userSettingsInstance,apiClient){return appSettings.enableSystemExternalPlayers(context.querySelector(".chkExternalVideoPlayer").checked),appSettings.maxChromecastBitrate(context.querySelector(".selectChromecastVideoQuality").value),setMaxBitrateFromField(context.querySelector(".selectVideoInNetworkQuality"),!0,"Video"),setMaxBitrateFromField(context.querySelector(".selectVideoInternetQuality"),!1,"Video"),setMaxBitrateFromField(context.querySelector(".selectMusicInternetQuality"),!1,"Audio"),user.Configuration.AudioLanguagePreference=context.querySelector("#selectAudioLanguage").value,user.Configuration.PlayDefaultAudioTrack=context.querySelector(".chkPlayDefaultAudioTrack").checked,user.Configuration.EnableNextEpisodeAutoPlay=context.querySelector(".chkEpisodeAutoPlay").checked,userSettingsInstance.enableCinemaMode(context.querySelector(".chkEnableCinemaMode").checked),userSettingsInstance.enableNextVideoInfoOverlay(context.querySelector(".chkEnableNextVideoOverlay").checked),userSettingsInstance.skipForwardLength(context.querySelector(".selectSkipForwardLength").value),userSettingsInstance.skipBackLength(context.querySelector(".selectSkipBackLength").value),apiClient.updateUserConfiguration(user.Id,user.Configuration)}function save(instance,context,userId,userSettings,apiClient,enableSaveConfirmation){loading.show(),apiClient.getUser(userId).then(function(user){saveUser(context,user,userSettings,apiClient).then(function(){loading.hide(),enableSaveConfirmation&&require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#SettingsSaved"))}),events.trigger(instance,"saved")},function(){loading.hide()})})}function onSubmit(e){var self=this,apiClient=connectionManager.getApiClient(self.options.serverId),userId=self.options.userId,userSettings=self.options.userSettings;return userSettings.setUserInfo(userId,apiClient).then(function(){var enableSaveConfirmation=self.options.enableSaveConfirmation;save(self,self.options.element,userId,userSettings,apiClient,enableSaveConfirmation)}),e&&e.preventDefault(),!1}function embed(options,self){require(["text!./playbacksettings.template.html"],function(template){options.element.innerHTML=globalize.translateDocument(template,"sharedcomponents"),options.element.querySelector("form").addEventListener("submit",onSubmit.bind(self)),options.enableSaveButton&&options.element.querySelector(".btnSave").classList.remove("hide"),self.loadData(),options.autoFocus&&focusManager.autoFocus(options.element)})}function PlaybackSettings(options){this.options=options,embed(options,this)}return PlaybackSettings.prototype.loadData=function(){var self=this,context=self.options.element;loading.show();var userId=self.options.userId,apiClient=connectionManager.getApiClient(self.options.serverId),userSettings=self.options.userSettings;apiClient.getUser(userId).then(function(user){userSettings.setUserInfo(userId,apiClient).then(function(){self.dataLoaded=!0,loadForm(context,user,userSettings,apiClient)})})},PlaybackSettings.prototype.submit=function(){onSubmit.call(this)},PlaybackSettings.prototype.destroy=function(){this.options=null},PlaybackSettings}); \ No newline at end of file +define(["require","browser","appSettings","apphost","focusManager","qualityoptions","globalize","loading","connectionManager","dom","events","emby-select","emby-checkbox"],function(require,browser,appSettings,appHost,focusManager,qualityoptions,globalize,loading,connectionManager,dom,events){"use strict";function fillSkipLengths(select){var options=[5,10,15,20,25,30];select.innerHTML=options.map(function(option){return{name:globalize.translate("sharedcomponents#ValueSeconds",option),value:1e3*option}}).map(function(o){return'"}).join("")}function populateLanguages(select,languages){var html="";html+="";for(var i=0,length=languages.length;i"+culture.DisplayName+""}select.innerHTML=html}function setMaxBitrateIntoField(select,isInNetwork,mediatype){var options="Audio"===mediatype?qualityoptions.getAudioQualityOptions({currentMaxBitrate:appSettings.maxStreamingBitrate(isInNetwork,mediatype),isAutomaticBitrateEnabled:appSettings.enableAutomaticBitrateDetection(isInNetwork,mediatype),enableAuto:!0}):qualityoptions.getVideoQualityOptions({currentMaxBitrate:appSettings.maxStreamingBitrate(isInNetwork,mediatype),isAutomaticBitrateEnabled:appSettings.enableAutomaticBitrateDetection(isInNetwork,mediatype),enableAuto:!0});select.innerHTML=options.map(function(i){return'"}).join(""),appSettings.enableAutomaticBitrateDetection(isInNetwork,mediatype)?select.value="":select.value=appSettings.maxStreamingBitrate(isInNetwork,mediatype)}function fillChromecastQuality(select){var options=qualityoptions.getVideoQualityOptions({currentMaxBitrate:appSettings.maxChromecastBitrate(),isAutomaticBitrateEnabled:!appSettings.maxChromecastBitrate(),enableAuto:!0});select.innerHTML=options.map(function(i){return'"}).join(""),select.value=appSettings.maxChromecastBitrate()||""}function setMaxBitrateFromField(select,isInNetwork,mediatype,value){select.value?(appSettings.maxStreamingBitrate(isInNetwork,mediatype,select.value),appSettings.enableAutomaticBitrateDetection(isInNetwork,mediatype,!1)):appSettings.enableAutomaticBitrateDetection(isInNetwork,mediatype,!0)}function showHideQualityFields(context,user,apiClient){if(user.Policy.EnableVideoPlaybackTranscoding?context.querySelector(".videoQualitySection").classList.remove("hide"):context.querySelector(".videoQualitySection").classList.add("hide"),appHost.supports("multiserver"))return context.querySelector(".fldVideoInNetworkQuality").classList.remove("hide"),context.querySelector(".fldVideoInternetQuality").classList.remove("hide"),void(user.Policy.EnableAudioPlaybackTranscoding?context.querySelector(".musicQualitySection").classList.remove("hide"):context.querySelector(".musicQualitySection").classList.add("hide"));apiClient.getEndpointInfo().then(function(endpointInfo){endpointInfo.IsInNetwork?(context.querySelector(".fldVideoInNetworkQuality").classList.remove("hide"),context.querySelector(".fldVideoInternetQuality").classList.add("hide"),context.querySelector(".musicQualitySection").classList.add("hide")):(context.querySelector(".fldVideoInNetworkQuality").classList.add("hide"),context.querySelector(".fldVideoInternetQuality").classList.remove("hide"),user.Policy.EnableAudioPlaybackTranscoding?context.querySelector(".musicQualitySection").classList.remove("hide"):context.querySelector(".musicQualitySection").classList.add("hide"))})}function showOrHideEpisodesField(context,user,apiClient){if(browser.tizen||browser.web0s)return void context.querySelector(".fldEpisodeAutoPlay").classList.add("hide");context.querySelector(".fldEpisodeAutoPlay").classList.remove("hide")}function loadForm(context,user,userSettings,apiClient){var loggedInUserId=apiClient.getCurrentUserId(),userId=user.Id;showHideQualityFields(context,user,apiClient),apiClient.getCultures().then(function(allCultures){populateLanguages(context.querySelector("#selectAudioLanguage"),allCultures),context.querySelector("#selectAudioLanguage",context).value=user.Configuration.AudioLanguagePreference||"",context.querySelector(".chkEpisodeAutoPlay").checked=user.Configuration.EnableNextEpisodeAutoPlay||!1}),apiClient.getNamedConfiguration("cinemamode").then(function(cinemaConfig){cinemaConfig.EnableIntrosForMovies||cinemaConfig.EnableIntrosForEpisodes?context.querySelector(".cinemaModeOptions").classList.remove("hide"):context.querySelector(".cinemaModeOptions").classList.add("hide")}),appHost.supports("externalplayerintent")&&userId===loggedInUserId?context.querySelector(".fldExternalPlayer").classList.remove("hide"):context.querySelector(".fldExternalPlayer").classList.add("hide"),userId===loggedInUserId&&(user.Policy.EnableVideoPlaybackTranscoding||user.Policy.EnableAudioPlaybackTranscoding)?(context.querySelector(".qualitySections").classList.remove("hide"),appHost.supports("chromecast")&&user.Policy.EnableVideoPlaybackTranscoding?context.querySelector(".fldChromecastQuality").classList.remove("hide"):context.querySelector(".fldChromecastQuality").classList.add("hide")):(context.querySelector(".qualitySections").classList.add("hide"),context.querySelector(".fldChromecastQuality").classList.add("hide")),browser.tizen||browser.web0s?context.querySelector(".fldEnableNextVideoOverlay").classList.add("hide"):context.querySelector(".fldEnableNextVideoOverlay").classList.remove("hide"),context.querySelector(".chkPlayDefaultAudioTrack").checked=user.Configuration.PlayDefaultAudioTrack||!1,context.querySelector(".chkEnableCinemaMode").checked=userSettings.enableCinemaMode(),context.querySelector(".chkEnableNextVideoOverlay").checked=userSettings.enableNextVideoInfoOverlay(),context.querySelector(".chkExternalVideoPlayer").checked=appSettings.enableSystemExternalPlayers(),setMaxBitrateIntoField(context.querySelector(".selectVideoInNetworkQuality"),!0,"Video"),setMaxBitrateIntoField(context.querySelector(".selectVideoInternetQuality"),!1,"Video"),setMaxBitrateIntoField(context.querySelector(".selectMusicInternetQuality"),!1,"Audio"),fillChromecastQuality(context.querySelector(".selectChromecastVideoQuality"));var selectSkipForwardLength=context.querySelector(".selectSkipForwardLength");fillSkipLengths(selectSkipForwardLength),selectSkipForwardLength.value=userSettings.skipForwardLength();var selectSkipBackLength=context.querySelector(".selectSkipBackLength");fillSkipLengths(selectSkipBackLength),selectSkipBackLength.value=userSettings.skipBackLength(),showOrHideEpisodesField(context,user,apiClient),loading.hide()}function saveUser(context,user,userSettingsInstance,apiClient){return appSettings.enableSystemExternalPlayers(context.querySelector(".chkExternalVideoPlayer").checked),appSettings.maxChromecastBitrate(context.querySelector(".selectChromecastVideoQuality").value),setMaxBitrateFromField(context.querySelector(".selectVideoInNetworkQuality"),!0,"Video"),setMaxBitrateFromField(context.querySelector(".selectVideoInternetQuality"),!1,"Video"),setMaxBitrateFromField(context.querySelector(".selectMusicInternetQuality"),!1,"Audio"),user.Configuration.AudioLanguagePreference=context.querySelector("#selectAudioLanguage").value,user.Configuration.PlayDefaultAudioTrack=context.querySelector(".chkPlayDefaultAudioTrack").checked,user.Configuration.EnableNextEpisodeAutoPlay=context.querySelector(".chkEpisodeAutoPlay").checked,userSettingsInstance.enableCinemaMode(context.querySelector(".chkEnableCinemaMode").checked),userSettingsInstance.enableNextVideoInfoOverlay(context.querySelector(".chkEnableNextVideoOverlay").checked),userSettingsInstance.skipForwardLength(context.querySelector(".selectSkipForwardLength").value),userSettingsInstance.skipBackLength(context.querySelector(".selectSkipBackLength").value),apiClient.updateUserConfiguration(user.Id,user.Configuration)}function save(instance,context,userId,userSettings,apiClient,enableSaveConfirmation){loading.show(),apiClient.getUser(userId).then(function(user){saveUser(context,user,userSettings,apiClient).then(function(){loading.hide(),enableSaveConfirmation&&require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#SettingsSaved"))}),events.trigger(instance,"saved")},function(){loading.hide()})})}function onSubmit(e){var self=this,apiClient=connectionManager.getApiClient(self.options.serverId),userId=self.options.userId,userSettings=self.options.userSettings;return userSettings.setUserInfo(userId,apiClient).then(function(){var enableSaveConfirmation=self.options.enableSaveConfirmation;save(self,self.options.element,userId,userSettings,apiClient,enableSaveConfirmation)}),e&&e.preventDefault(),!1}function embed(options,self){require(["text!./playbacksettings.template.html"],function(template){options.element.innerHTML=globalize.translateDocument(template,"sharedcomponents"),options.element.querySelector("form").addEventListener("submit",onSubmit.bind(self)),options.enableSaveButton&&options.element.querySelector(".btnSave").classList.remove("hide"),self.loadData(),options.autoFocus&&focusManager.autoFocus(options.element)})}function PlaybackSettings(options){this.options=options,embed(options,this)}return PlaybackSettings.prototype.loadData=function(){var self=this,context=self.options.element;loading.show();var userId=self.options.userId,apiClient=connectionManager.getApiClient(self.options.serverId),userSettings=self.options.userSettings;apiClient.getUser(userId).then(function(user){userSettings.setUserInfo(userId,apiClient).then(function(){self.dataLoaded=!0,loadForm(context,user,userSettings,apiClient)})})},PlaybackSettings.prototype.submit=function(){onSubmit.call(this)},PlaybackSettings.prototype.destroy=function(){this.options=null},PlaybackSettings}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playerstats/playerstats.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playerstats/playerstats.js index a45cdd212d..d9a2b5440e 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playerstats/playerstats.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/playerstats/playerstats.js @@ -1 +1 @@ -define(["events","globalize","playbackManager","connectionManager","playMethodHelper","layoutManager","serverNotifications","paper-icon-button-light","css!./playerstats"],function(events,globalize,playbackManager,connectionManager,playMethodHelper,layoutManager,serverNotifications){"use strict";function init(instance){var parent=document.createElement("div");parent.classList.add("playerStats"),layoutManager.tv&&parent.classList.add("playerStats-tv"),parent.classList.add("hide");var button;button=layoutManager.tv?"":'';var contentClass=layoutManager.tv?"playerStats-content playerStats-content-tv":"playerStats-content";parent.innerHTML='
'+button+'
',button=parent.querySelector(".playerStats-closeButton"),button&&button.addEventListener("click",onCloseButtonClick.bind(instance)),document.body.appendChild(parent),instance.element=parent}function onCloseButtonClick(){this.enabled(!1)}function renderStats(elem,categories){elem.querySelector(".playerStats-stats").innerHTML=categories.map(function(category){var categoryHtml="",stats=category.stats;stats.length&&category.name&&(categoryHtml+='
',categoryHtml+='
',categoryHtml+=category.name,categoryHtml+="
",categoryHtml+='
',categoryHtml+=category.subText||"",categoryHtml+="
",categoryHtml+="
");for(var i=0,length=stats.length;i';var stat=stats[i];categoryHtml+='
',categoryHtml+=stat.label,categoryHtml+="
",categoryHtml+='
',categoryHtml+=stat.value,categoryHtml+="
",categoryHtml+=""}return categoryHtml}).join("")}function getSession(instance,player){var now=(new Date).getTime();if(now-(instance.lastSessionTime||0)<1e4)return Promise.resolve(instance.lastSession);var apiClient=connectionManager.getApiClient(playbackManager.currentItem(player).ServerId);return apiClient.getSessions({deviceId:apiClient.deviceId()}).then(function(sessions){return instance.lastSession=sessions[0]||{},instance.lastSessionTime=(new Date).getTime(),Promise.resolve(instance.lastSession)},function(){return Promise.resolve({})})}function translateReason(reason){return globalize.translate("sharedcomponents#"+reason)}function getTranscodingStats(session,player,displayPlayMethod){var videoCodec,audioCodec,totalBitrate,audioChannels,sessionStats=[];return session.TranscodingInfo&&(videoCodec=session.TranscodingInfo.VideoCodec,audioCodec=session.TranscodingInfo.AudioCodec,totalBitrate=session.TranscodingInfo.Bitrate,audioChannels=session.TranscodingInfo.AudioChannels),videoCodec&&sessionStats.push({label:"Video codec:",value:session.TranscodingInfo.IsVideoDirect?videoCodec.toUpperCase()+" (direct)":videoCodec.toUpperCase()}),audioCodec&&sessionStats.push({label:"Audio codec:",value:session.TranscodingInfo.IsAudioDirect?audioCodec.toUpperCase()+" (direct)":audioCodec.toUpperCase()}),"Transcode"===displayPlayMethod&&(totalBitrate&&sessionStats.push({label:"Bitrate:",value:getDisplayBitrate(totalBitrate)}),session.TranscodingInfo.CompletionPercentage&&sessionStats.push({label:"Transcoding progress:",value:session.TranscodingInfo.CompletionPercentage.toFixed(1)+"%"}),session.TranscodingInfo.Framerate&&sessionStats.push({label:"Transcoding framerate:",value:session.TranscodingInfo.Framerate+" fps"}),session.TranscodingInfo.TranscodeReasons&&session.TranscodingInfo.TranscodeReasons.length&&sessionStats.push({label:"Reason for transcoding:",value:session.TranscodingInfo.TranscodeReasons.map(translateReason).join("
")})),sessionStats}function getDisplayBitrate(bitrate){return bitrate>1e6?(bitrate/1e6).toFixed(1)+" Mbps":Math.floor(bitrate/1e3)+" kbps"}function getMediaSourceStats(session,player,displayPlayMethod){var sessionStats=[],mediaSource=playbackManager.currentMediaSource(player)||{},totalBitrate=mediaSource.Bitrate;mediaSource.Container&&sessionStats.push({label:"Container:",value:mediaSource.Container}),totalBitrate&&sessionStats.push({label:"Bitrate:",value:getDisplayBitrate(totalBitrate)});var mediaStreams=mediaSource.MediaStreams||[],videoStream=mediaStreams.filter(function(s){return"Video"===s.Type})[0]||{},videoCodec=videoStream.Codec,audioStreamIndex=playbackManager.getAudioStreamIndex(player),audioStream=playbackManager.audioTracks(player).filter(function(s){return"Audio"===s.Type&&s.Index===audioStreamIndex})[0]||{},audioCodec=audioStream.Codec,audioChannels=audioStream.Channels,videoInfos=[];videoCodec&&videoInfos.push(videoCodec.toUpperCase()),videoStream.Profile&&videoInfos.push(videoStream.Profile),videoInfos.length&&sessionStats.push({label:"Video codec:",value:videoInfos.join(" ")}),videoStream.BitRate&&sessionStats.push({label:"Video bitrate:",value:getDisplayBitrate(videoStream.BitRate)});var audioInfos=[];return audioCodec&&audioInfos.push(audioCodec.toUpperCase()),audioStream.Profile&&audioInfos.push(audioStream.Profile),audioInfos.length&&sessionStats.push({label:"Audio codec:",value:audioInfos.join(" ")}),audioStream.BitRate&&sessionStats.push({label:"Audio bitrate:",value:getDisplayBitrate(audioStream.BitRate)}),audioChannels&&sessionStats.push({label:"Audio channels:",value:audioChannels}),audioStream.SampleRate&&sessionStats.push({label:"Audio sample rate:",value:audioStream.SampleRate+" Hz"}),audioStream.BitDepth&&sessionStats.push({label:"Audio bit depth:",value:audioStream.BitDepth}),sessionStats}function getStats(instance,player){var statsPromise=player.getStats?player.getStats():Promise.resolve({}),sessionPromise=getSession(instance,player);return Promise.all([statsPromise,sessionPromise]).then(function(responses){var playerStatsResult=responses[0],playerStats=playerStatsResult.categories||[],session=responses[1],displayPlayMethod=playMethodHelper.getDisplayPlayMethod(session),baseCategory={stats:[],name:"Playback Info"};baseCategory.stats.unshift({label:"Play method:",value:displayPlayMethod}),baseCategory.stats.unshift({label:"Player:",value:player.name});var categories=[];categories.push(baseCategory);for(var i=0,length=playerStats.length;iclose';var contentClass=layoutManager.tv?"playerStats-content playerStats-content-tv":"playerStats-content";parent.innerHTML='
'+button+'
',button=parent.querySelector(".playerStats-closeButton"),button&&button.addEventListener("click",onCloseButtonClick.bind(instance)),document.body.appendChild(parent),instance.element=parent}function onCloseButtonClick(){this.enabled(!1)}function renderStats(elem,categories){elem.querySelector(".playerStats-stats").innerHTML=categories.map(function(category){var categoryHtml="",stats=category.stats;stats.length&&category.name&&(categoryHtml+='
',categoryHtml+='
',categoryHtml+=category.name,categoryHtml+="
",categoryHtml+='
',categoryHtml+=category.subText||"",categoryHtml+="
",categoryHtml+="
");for(var i=0,length=stats.length;i';var stat=stats[i];categoryHtml+='
',categoryHtml+=stat.label,categoryHtml+="
",categoryHtml+='
',categoryHtml+=stat.value,categoryHtml+="
",categoryHtml+=""}return categoryHtml}).join("")}function getSession(instance,player){if((new Date).getTime()-(instance.lastSessionTime||0)<1e4)return Promise.resolve(instance.lastSession);var apiClient=connectionManager.getApiClient(playbackManager.currentItem(player).ServerId);return apiClient.getSessions({deviceId:apiClient.deviceId()}).then(function(sessions){return instance.lastSession=sessions[0]||{},instance.lastSessionTime=(new Date).getTime(),Promise.resolve(instance.lastSession)},function(){return Promise.resolve({})})}function translateReason(reason){return globalize.translate("sharedcomponents#"+reason)}function getTranscodingStats(session,player,displayPlayMethod){var videoCodec,audioCodec,totalBitrate,sessionStats=[];return session.TranscodingInfo&&(videoCodec=session.TranscodingInfo.VideoCodec,audioCodec=session.TranscodingInfo.AudioCodec,totalBitrate=session.TranscodingInfo.Bitrate,session.TranscodingInfo.AudioChannels),videoCodec&&sessionStats.push({label:"Video codec:",value:session.TranscodingInfo.IsVideoDirect?videoCodec.toUpperCase()+" (direct)":videoCodec.toUpperCase()}),audioCodec&&sessionStats.push({label:"Audio codec:",value:session.TranscodingInfo.IsAudioDirect?audioCodec.toUpperCase()+" (direct)":audioCodec.toUpperCase()}),"Transcode"===displayPlayMethod&&(totalBitrate&&sessionStats.push({label:"Bitrate:",value:getDisplayBitrate(totalBitrate)}),session.TranscodingInfo.CompletionPercentage&&sessionStats.push({label:"Transcoding progress:",value:session.TranscodingInfo.CompletionPercentage.toFixed(1)+"%"}),session.TranscodingInfo.Framerate&&sessionStats.push({label:"Transcoding framerate:",value:session.TranscodingInfo.Framerate+" fps"}),session.TranscodingInfo.TranscodeReasons&&session.TranscodingInfo.TranscodeReasons.length&&sessionStats.push({label:"Reason for transcoding:",value:session.TranscodingInfo.TranscodeReasons.map(translateReason).join("
")})),sessionStats}function getDisplayBitrate(bitrate){return bitrate>1e6?(bitrate/1e6).toFixed(1)+" Mbps":Math.floor(bitrate/1e3)+" kbps"}function getMediaSourceStats(session,player,displayPlayMethod){var sessionStats=[],mediaSource=playbackManager.currentMediaSource(player)||{},totalBitrate=mediaSource.Bitrate;mediaSource.Container&&sessionStats.push({label:"Container:",value:mediaSource.Container}),totalBitrate&&sessionStats.push({label:"Bitrate:",value:getDisplayBitrate(totalBitrate)});var mediaStreams=mediaSource.MediaStreams||[],videoStream=mediaStreams.filter(function(s){return"Video"===s.Type})[0]||{},videoCodec=videoStream.Codec,audioStreamIndex=playbackManager.getAudioStreamIndex(player),audioStream=playbackManager.audioTracks(player).filter(function(s){return"Audio"===s.Type&&s.Index===audioStreamIndex})[0]||{},audioCodec=audioStream.Codec,audioChannels=audioStream.Channels,videoInfos=[];videoCodec&&videoInfos.push(videoCodec.toUpperCase()),videoStream.Profile&&videoInfos.push(videoStream.Profile),videoInfos.length&&sessionStats.push({label:"Video codec:",value:videoInfos.join(" ")}),videoStream.BitRate&&sessionStats.push({label:"Video bitrate:",value:getDisplayBitrate(videoStream.BitRate)});var audioInfos=[];return audioCodec&&audioInfos.push(audioCodec.toUpperCase()),audioStream.Profile&&audioInfos.push(audioStream.Profile),audioInfos.length&&sessionStats.push({label:"Audio codec:",value:audioInfos.join(" ")}),audioStream.BitRate&&sessionStats.push({label:"Audio bitrate:",value:getDisplayBitrate(audioStream.BitRate)}),audioChannels&&sessionStats.push({label:"Audio channels:",value:audioChannels}),audioStream.SampleRate&&sessionStats.push({label:"Audio sample rate:",value:audioStream.SampleRate+" Hz"}),audioStream.BitDepth&&sessionStats.push({label:"Audio bit depth:",value:audioStream.BitDepth}),sessionStats}function getStats(instance,player){var statsPromise=player.getStats?player.getStats():Promise.resolve({}),sessionPromise=getSession(instance,player);return Promise.all([statsPromise,sessionPromise]).then(function(responses){var playerStatsResult=responses[0],playerStats=playerStatsResult.categories||[],session=responses[1],displayPlayMethod=playMethodHelper.getDisplayPlayMethod(session),baseCategory={stats:[],name:"Playback Info"};baseCategory.stats.unshift({label:"Play method:",value:displayPlayMethod}),baseCategory.stats.unshift({label:"Player:",value:player.name});var categories=[];categories.push(baseCategory);for(var i=0,length=playerStats.length;i'+globalize.translate("sharedcomponents#AddToPlayQueue")+""),html+='",html+=result.Items.map(function(i){return'"}),select.innerHTML=html;var defaultValue=editorOptions.defaultValue;defaultValue||(defaultValue=userSettings.get("playlisteditor-lastplaylistid")||""),select.value="new"===defaultValue?"":defaultValue,select.value||(select.value=""),triggerChange(select),loading.hide()})}function getEditorHtml(items){var html="";html+='
',html+='
',html+='
',html+='
';var autoFocus=items.length?" autofocus":"";return html+='",html+="
",html+='
',html+='
',autoFocus=items.length?"":" autofocus",html+='",html+="
",html+="
",html+='
',html+='",html+="
",html+='',html+="
",html+="
",html+="
"}function initEditor(content,options,items){if(content.querySelector("#selectPlaylistToAddTo").addEventListener("change",function(){this.value?(content.querySelector(".newPlaylistInfo").classList.add("hide"),content.querySelector("#txtNewPlaylistName").removeAttribute("required")):(content.querySelector(".newPlaylistInfo").classList.remove("hide"),content.querySelector("#txtNewPlaylistName").setAttribute("required","required"))}),content.querySelector("form").addEventListener("submit",onSubmit),content.querySelector(".fldSelectedItemIds",content).value=items.join(","),items.length)content.querySelector(".fldSelectPlaylist").classList.remove("hide"),populatePlaylists(options,content);else{content.querySelector(".fldSelectPlaylist").classList.add("hide");var selectPlaylistToAddTo=content.querySelector("#selectPlaylistToAddTo");selectPlaylistToAddTo.innerHTML="",selectPlaylistToAddTo.value="",triggerChange(selectPlaylistToAddTo)}}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function PlaylistEditor(){}var currentServerId;return PlaylistEditor.prototype.show=function(options){var items=options.items||{};currentServerId=options.serverId;var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="",title=globalize.translate("sharedcomponents#HeaderAddToPlaylist");return html+='
',html+='',html+='

',html+=title,html+="

",html+="
",html+=getEditorHtml(items),dlg.innerHTML=html,initEditor(dlg,options,items),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),dialogHelper.open(dlg).then(function(){return layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),dlg.submitted?Promise.resolve():Promise.reject()})},PlaylistEditor}); \ No newline at end of file +define(["shell","dialogHelper","loading","layoutManager","playbackManager","connectionManager","userSettings","appRouter","globalize","emby-input","paper-icon-button-light","emby-select","material-icons","css!./../formdialog","emby-button"],function(shell,dialogHelper,loading,layoutManager,playbackManager,connectionManager,userSettings,appRouter,globalize){"use strict";function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(!(elem=elem.parentNode))return null;return elem}function onSubmit(e){var panel=parentWithClass(this,"dialog"),playlistId=panel.querySelector("#selectPlaylistToAddTo").value,apiClient=connectionManager.getApiClient(currentServerId);return playlistId?(userSettings.set("playlisteditor-lastplaylistid",playlistId),addToPlaylist(apiClient,panel,playlistId)):createPlaylist(apiClient,panel),e.preventDefault(),!1}function createPlaylist(apiClient,dlg){loading.show();var url=apiClient.getUrl("Playlists",{Name:dlg.querySelector("#txtNewPlaylistName").value,Ids:dlg.querySelector(".fldSelectedItemIds").value||"",userId:apiClient.getCurrentUserId()});apiClient.ajax({type:"POST",url:url,dataType:"json"}).then(function(result){loading.hide();var id=result.Id;dlg.submitted=!0,dialogHelper.close(dlg),redirectToPlaylist(apiClient,id)})}function redirectToPlaylist(apiClient,id){appRouter.showItem(id,apiClient.serverId())}function addToPlaylist(apiClient,dlg,id){var itemIds=dlg.querySelector(".fldSelectedItemIds").value||"";if("queue"===id)return playbackManager.queue({serverId:apiClient.serverId(),ids:itemIds.split(",")}),dlg.submitted=!0,void dialogHelper.close(dlg);loading.show();var url=apiClient.getUrl("Playlists/"+id+"/Items",{Ids:itemIds,userId:apiClient.getCurrentUserId()});apiClient.ajax({type:"POST",url:url}).then(function(){loading.hide(),dlg.submitted=!0,dialogHelper.close(dlg)})}function triggerChange(select){select.dispatchEvent(new CustomEvent("change",{}))}function populatePlaylists(editorOptions,panel){var select=panel.querySelector("#selectPlaylistToAddTo");loading.hide(),panel.querySelector(".newPlaylistInfo").classList.add("hide");var options={Recursive:!0,IncludeItemTypes:"Playlist",SortBy:"SortName",EnableTotalRecordCount:!1},apiClient=connectionManager.getApiClient(currentServerId);apiClient.getItems(apiClient.getCurrentUserId(),options).then(function(result){var html="";!1!==editorOptions.enableAddToPlayQueue&&playbackManager.isPlaying()&&(html+='"),html+='",html+=result.Items.map(function(i){return'"}),select.innerHTML=html;var defaultValue=editorOptions.defaultValue;defaultValue||(defaultValue=userSettings.get("playlisteditor-lastplaylistid")||""),select.value="new"===defaultValue?"":defaultValue,select.value||(select.value=""),triggerChange(select),loading.hide()})}function getEditorHtml(items){var html="";html+='
',html+='
',html+='
',html+='
';var autoFocus=items.length?" autofocus":"";return html+='",html+="
",html+='
',html+='
',autoFocus=items.length?"":" autofocus",html+='",html+="
",html+="
",html+='
',html+='",html+="
",html+='',html+="
",html+="
",html+="
"}function initEditor(content,options,items){if(content.querySelector("#selectPlaylistToAddTo").addEventListener("change",function(){this.value?(content.querySelector(".newPlaylistInfo").classList.add("hide"),content.querySelector("#txtNewPlaylistName").removeAttribute("required")):(content.querySelector(".newPlaylistInfo").classList.remove("hide"),content.querySelector("#txtNewPlaylistName").setAttribute("required","required"))}),content.querySelector("form").addEventListener("submit",onSubmit),content.querySelector(".fldSelectedItemIds",content).value=items.join(","),items.length)content.querySelector(".fldSelectPlaylist").classList.remove("hide"),populatePlaylists(options,content);else{content.querySelector(".fldSelectPlaylist").classList.add("hide");var selectPlaylistToAddTo=content.querySelector("#selectPlaylistToAddTo");selectPlaylistToAddTo.innerHTML="",selectPlaylistToAddTo.value="",triggerChange(selectPlaylistToAddTo)}}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function PlaylistEditor(){}var currentServerId;return PlaylistEditor.prototype.show=function(options){var items=options.items||{};currentServerId=options.serverId;var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="",title=globalize.translate("sharedcomponents#HeaderAddToPlaylist");return html+='
',html+='',html+='

',html+=title,html+="

",html+="
",html+=getEditorHtml(items),dlg.innerHTML=html,initEditor(dlg,options,items),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),dialogHelper.open(dlg).then(function(){return layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),dlg.submitted?Promise.resolve():Promise.reject()})},PlaylistEditor}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/pluginmanager.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/pluginmanager.js index f2f02e4a12..a4674d541e 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/pluginmanager.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/pluginmanager.js @@ -1 +1 @@ -define(["events"],function(events){"use strict";function loadStrings(plugin,globalize){var strings=plugin.getTranslations?plugin.getTranslations():[];return globalize.loadStrings({name:plugin.id||plugin.packageName,strings:strings})}function definePluginRoute(pluginManager,route,plugin){route.contentPath=pluginManager.mapPath(plugin,route.path),route.path=pluginManager.mapRoute(plugin,route),Emby.App.defineRoute(route,plugin.id)}function PluginManager(){this.pluginsList=[]}var cacheParam=(new Date).getTime();return PluginManager.prototype.loadPlugin=function(url){console.log("Loading plugin: "+url);var instance=this;return new Promise(function(resolve,reject){require([url,"globalize","appRouter"],function(pluginFactory,globalize,appRouter){var plugin=new pluginFactory,existing=instance.pluginsList.filter(function(p){return p.id===plugin.id})[0];if(existing)return void resolve(url);plugin.installUrl=url;var urlLower=url.toLowerCase();urlLower.indexOf("http:")===-1&&urlLower.indexOf("https:")===-1&&urlLower.indexOf("file:")===-1&&0!==url.indexOf(appRouter.baseUrl())&&(url=appRouter.baseUrl()+"/"+url);var separatorIndex=Math.max(url.lastIndexOf("/"),url.lastIndexOf("\\"));plugin.baseUrl=url.substring(0,separatorIndex);var paths={};paths[plugin.id]=plugin.baseUrl,requirejs.config({waitSeconds:0,paths:paths}),instance.register(plugin),plugin.getRoutes&&plugin.getRoutes().forEach(function(route){definePluginRoute(instance,route,plugin)}),"skin"===plugin.type?resolve(plugin):loadStrings(plugin,globalize).then(function(){resolve(plugin)},reject)})})},PluginManager.prototype.register=function(obj){this.pluginsList.push(obj),events.trigger(this,"registered",[obj])},PluginManager.prototype.ofType=function(type){return this.pluginsList.filter(function(o){return o.type===type})},PluginManager.prototype.plugins=function(){return this.pluginsList},PluginManager.prototype.mapRoute=function(plugin,route){return"string"==typeof plugin&&(plugin=this.pluginsList.filter(function(p){return(p.id||p.packageName)===plugin})[0]),route=route.path||route,0===route.toLowerCase().indexOf("http")?route:"/plugins/"+plugin.id+"/"+route},PluginManager.prototype.mapPath=function(plugin,path,addCacheParam){"string"==typeof plugin&&(plugin=this.pluginsList.filter(function(p){return(p.id||p.packageName)===plugin})[0]);var url=plugin.baseUrl+"/"+path;return addCacheParam&&(url+=url.indexOf("?")===-1?"?":"&",url+="v="+cacheParam),url},new PluginManager}); \ No newline at end of file +define(["events"],function(events){"use strict";function loadStrings(plugin,globalize){var strings=plugin.getTranslations?plugin.getTranslations():[];return globalize.loadStrings({name:plugin.id||plugin.packageName,strings:strings})}function definePluginRoute(pluginManager,route,plugin){route.contentPath=pluginManager.mapPath(plugin,route.path),route.path=pluginManager.mapRoute(plugin,route),Emby.App.defineRoute(route,plugin.id)}function PluginManager(){this.pluginsList=[]}var cacheParam=(new Date).getTime();return PluginManager.prototype.loadPlugin=function(url){console.log("Loading plugin: "+url);var instance=this;return new Promise(function(resolve,reject){require([url,"globalize","appRouter"],function(pluginFactory,globalize,appRouter){var plugin=new pluginFactory;if(instance.pluginsList.filter(function(p){return p.id===plugin.id})[0])return void resolve(url);plugin.installUrl=url;var urlLower=url.toLowerCase();-1===urlLower.indexOf("http:")&&-1===urlLower.indexOf("https:")&&-1===urlLower.indexOf("file:")&&0!==url.indexOf(appRouter.baseUrl())&&(url=appRouter.baseUrl()+"/"+url);var separatorIndex=Math.max(url.lastIndexOf("/"),url.lastIndexOf("\\"));plugin.baseUrl=url.substring(0,separatorIndex);var paths={};paths[plugin.id]=plugin.baseUrl,requirejs.config({waitSeconds:0,paths:paths}),instance.register(plugin),plugin.getRoutes&&plugin.getRoutes().forEach(function(route){definePluginRoute(instance,route,plugin)}),"skin"===plugin.type?resolve(plugin):loadStrings(plugin,globalize).then(function(){resolve(plugin)},reject)})})},PluginManager.prototype.register=function(obj){this.pluginsList.push(obj),events.trigger(this,"registered",[obj])},PluginManager.prototype.ofType=function(type){return this.pluginsList.filter(function(o){return o.type===type})},PluginManager.prototype.plugins=function(){return this.pluginsList},PluginManager.prototype.mapRoute=function(plugin,route){return"string"==typeof plugin&&(plugin=this.pluginsList.filter(function(p){return(p.id||p.packageName)===plugin})[0]),route=route.path||route,0===route.toLowerCase().indexOf("http")?route:"/plugins/"+plugin.id+"/"+route},PluginManager.prototype.mapPath=function(plugin,path,addCacheParam){"string"==typeof plugin&&(plugin=this.pluginsList.filter(function(p){return(p.id||p.packageName)===plugin})[0]);var url=plugin.baseUrl+"/"+path;return addCacheParam&&(url+=-1===url.indexOf("?")?"?":"&",url+="v="+cacheParam),url},new PluginManager}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/polyfills/objectassign.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/polyfills/objectassign.js index 66118a7510..468eda183e 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/polyfills/objectassign.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/polyfills/objectassign.js @@ -1 +1 @@ -"function"!=typeof Object.assign&&!function(){Object.assign=function(target){"use strict";if(void 0===target||null===target)throw new TypeError("Cannot convert undefined or null to object");for(var output=Object(target),index=1;index=3800&&(qualityOptions.push({name:"4K - 120 Mbps",maxHeight:2160,bitrate:12e7}),qualityOptions.push({name:"4K - 100 Mbps",maxHeight:2160,bitrate:1e8}),qualityOptions.push({name:"4K - 80 Mbps",maxHeight:2160,bitrate:8e7})),maxAllowedWidth>=1900?(qualityOptions.push({name:"1080p - 60 Mbps",maxHeight:1080,bitrate:6e7}),qualityOptions.push({name:"1080p - 50 Mbps",maxHeight:1080,bitrate:5e7}),qualityOptions.push({name:"1080p - 40 Mbps",maxHeight:1080,bitrate:4e7}),qualityOptions.push({name:"1080p - 30 Mbps",maxHeight:1080,bitrate:3e7}),qualityOptions.push({name:"1080p - 25 Mbps",maxHeight:1080,bitrate:25e6}),qualityOptions.push({name:"1080p - 20 Mbps",maxHeight:1080,bitrate:2e7}),qualityOptions.push({name:"1080p - 15 Mbps",maxHeight:1080,bitrate:15e6}),qualityOptions.push({name:"1080p - 10 Mbps",maxHeight:1080,bitrate:10000001}),qualityOptions.push({name:"1080p - 8 Mbps",maxHeight:1080,bitrate:8000001}),qualityOptions.push({name:"1080p - 6 Mbps",maxHeight:1080,bitrate:6000001}),qualityOptions.push({name:"1080p - 5 Mbps",maxHeight:1080,bitrate:5000001}),qualityOptions.push({name:"1080p - 4 Mbps",maxHeight:1080,bitrate:4000002})):maxAllowedWidth>=1260?(qualityOptions.push({name:"720p - 10 Mbps",maxHeight:720,bitrate:1e7}),qualityOptions.push({name:"720p - 8 Mbps",maxHeight:720,bitrate:8e6}),qualityOptions.push({name:"720p - 6 Mbps",maxHeight:720,bitrate:6e6}),qualityOptions.push({name:"720p - 5 Mbps",maxHeight:720,bitrate:5e6})):maxAllowedWidth>=620&&(qualityOptions.push({name:"480p - 4 Mbps",maxHeight:480,bitrate:4000001}),qualityOptions.push({name:"480p - 3 Mbps",maxHeight:480,bitrate:3000001}),qualityOptions.push({name:"480p - 2.5 Mbps",maxHeight:480,bitrate:25e5}),qualityOptions.push({name:"480p - 2 Mbps",maxHeight:480,bitrate:2000001}),qualityOptions.push({name:"480p - 1.5 Mbps",maxHeight:480,bitrate:1500001})),maxAllowedWidth>=1260&&(qualityOptions.push({name:"720p - 4 Mbps",maxHeight:720,bitrate:4e6}),qualityOptions.push({name:"720p - 3 Mbps",maxHeight:720,bitrate:3e6}),qualityOptions.push({name:"720p - 2 Mbps",maxHeight:720,bitrate:2e6}),qualityOptions.push({name:"720p - 1.5 Mbps",maxHeight:720,bitrate:15e5}),qualityOptions.push({name:"720p - 1 Mbps",maxHeight:720,bitrate:1000001})),qualityOptions.push({name:"480p - 1 Mbps",maxHeight:480,bitrate:1e6}),qualityOptions.push({name:"480p - 720 kbps",maxHeight:480,bitrate:72e4}),qualityOptions.push({name:"480p - 420 kbps",maxHeight:480,bitrate:42e4}),qualityOptions.push({name:"360p",maxHeight:360,bitrate:4e5}),qualityOptions.push({name:"240p",maxHeight:240,bitrate:32e4}),qualityOptions.push({name:"144p",maxHeight:144,bitrate:192e3});var autoQualityOption={name:globalize.translate("sharedcomponents#Auto"),bitrate:0,selected:options.isAutomaticBitrateEnabled};if(options.enableAuto&&qualityOptions.push(autoQualityOption),maxStreamingBitrate){for(var selectedIndex=-1,i=0,length=qualityOptions.length;i=3800&&(qualityOptions.push({name:"4K - 120 Mbps",maxHeight:2160,bitrate:12e7}),qualityOptions.push({name:"4K - 100 Mbps",maxHeight:2160,bitrate:1e8}),qualityOptions.push({name:"4K - 80 Mbps",maxHeight:2160,bitrate:8e7})),maxAllowedWidth>=1900?(qualityOptions.push({name:"1080p - 60 Mbps",maxHeight:1080,bitrate:6e7}),qualityOptions.push({name:"1080p - 50 Mbps",maxHeight:1080,bitrate:5e7}),qualityOptions.push({name:"1080p - 40 Mbps",maxHeight:1080,bitrate:4e7}),qualityOptions.push({name:"1080p - 30 Mbps",maxHeight:1080,bitrate:3e7}),qualityOptions.push({name:"1080p - 25 Mbps",maxHeight:1080,bitrate:25e6}),qualityOptions.push({name:"1080p - 20 Mbps",maxHeight:1080,bitrate:2e7}),qualityOptions.push({name:"1080p - 15 Mbps",maxHeight:1080,bitrate:15e6}),qualityOptions.push({name:"1080p - 10 Mbps",maxHeight:1080,bitrate:10000001}),qualityOptions.push({name:"1080p - 8 Mbps",maxHeight:1080,bitrate:8000001}),qualityOptions.push({name:"1080p - 6 Mbps",maxHeight:1080,bitrate:6000001}),qualityOptions.push({name:"1080p - 5 Mbps",maxHeight:1080,bitrate:5000001}),qualityOptions.push({name:"1080p - 4 Mbps",maxHeight:1080,bitrate:4000002})):maxAllowedWidth>=1260?(qualityOptions.push({name:"720p - 10 Mbps",maxHeight:720,bitrate:1e7}),qualityOptions.push({name:"720p - 8 Mbps",maxHeight:720,bitrate:8e6}),qualityOptions.push({name:"720p - 6 Mbps",maxHeight:720,bitrate:6e6}),qualityOptions.push({name:"720p - 5 Mbps",maxHeight:720,bitrate:5e6})):maxAllowedWidth>=620&&(qualityOptions.push({name:"480p - 4 Mbps",maxHeight:480,bitrate:4000001}),qualityOptions.push({name:"480p - 3 Mbps",maxHeight:480,bitrate:3000001}),qualityOptions.push({name:"480p - 2.5 Mbps",maxHeight:480,bitrate:25e5}),qualityOptions.push({name:"480p - 2 Mbps",maxHeight:480,bitrate:2000001}),qualityOptions.push({name:"480p - 1.5 Mbps",maxHeight:480,bitrate:1500001})),maxAllowedWidth>=1260&&(qualityOptions.push({name:"720p - 4 Mbps",maxHeight:720,bitrate:4e6}),qualityOptions.push({name:"720p - 3 Mbps",maxHeight:720,bitrate:3e6}),qualityOptions.push({name:"720p - 2 Mbps",maxHeight:720,bitrate:2e6}),qualityOptions.push({name:"720p - 1.5 Mbps",maxHeight:720,bitrate:15e5}),qualityOptions.push({name:"720p - 1 Mbps",maxHeight:720,bitrate:1000001})),qualityOptions.push({name:"480p - 1 Mbps",maxHeight:480,bitrate:1e6}),qualityOptions.push({name:"480p - 720 kbps",maxHeight:480,bitrate:72e4}),qualityOptions.push({name:"480p - 420 kbps",maxHeight:480,bitrate:42e4}),qualityOptions.push({name:"360p",maxHeight:360,bitrate:4e5}),qualityOptions.push({name:"240p",maxHeight:240,bitrate:32e4}),qualityOptions.push({name:"144p",maxHeight:144,bitrate:192e3});var autoQualityOption={name:globalize.translate("sharedcomponents#Auto"),bitrate:0,selected:options.isAutomaticBitrateEnabled};if(options.enableAuto&&qualityOptions.push(autoQualityOption),maxStreamingBitrate){for(var selectedIndex=-1,i=0,length=qualityOptions.length;i'+text+""}context.querySelector(".selectKeepUpTo").innerHTML=html}function onFieldChange(e){this.querySelector(".btnSubmit").click()}function embed(itemId,serverId,options){recordingUpdated=!1,recordingDeleted=!1,currentServerId=serverId,loading.show(),options=options||{},require(["text!./seriesrecordingeditor.template.html"],function(template){var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=options.context;dlg.classList.add("hide"),dlg.innerHTML=globalize.translateDocument(template,"sharedcomponents"),dlg.querySelector(".formDialogHeader").classList.add("hide"),dlg.querySelector(".formDialogFooter").classList.add("hide"),dlg.querySelector(".formDialogContent").className="",dlg.querySelector(".dialogContentInner").className="",dlg.classList.remove("hide"),dlg.removeEventListener("change",onFieldChange),dlg.addEventListener("change",onFieldChange),currentDialog=dlg,init(dlg),reload(dlg,itemId)})}function showEditor(itemId,serverId,options){return new Promise(function(resolve,reject){recordingUpdated=!1,recordingDeleted=!1,currentServerId=serverId,loading.show(),options=options||{},require(["text!./seriesrecordingeditor.template.html"],function(template){var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.classList.add("recordingDialog"),layoutManager.tv||(dlg.style["min-width"]="20%");var html="";html+=globalize.translateDocument(template,"sharedcomponents"),dlg.innerHTML=html,options.enableCancel===!1&&dlg.querySelector(".formDialogFooter").classList.add("hide"),currentDialog=dlg,dlg.addEventListener("closing",function(){recordingDeleted||this.querySelector(".btnSubmit").click()}),dlg.addEventListener("close",function(){recordingUpdated?resolve({updated:!0,deleted:recordingDeleted}):reject()}),layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1),init(dlg),reload(dlg,itemId),dialogHelper.open(dlg)})})}var currentDialog,currentItemId,currentServerId,recordingUpdated=!1,recordingDeleted=!1;return{show:showEditor,embed:embed}}); \ No newline at end of file +define(["dialogHelper","globalize","layoutManager","mediaInfo","apphost","connectionManager","require","loading","scrollHelper","imageLoader","datetime","scrollStyles","emby-button","emby-checkbox","emby-input","emby-select","paper-icon-button-light","css!./../formdialog","css!./recordingcreator","material-icons","flexStyles"],function(dialogHelper,globalize,layoutManager,mediaInfo,appHost,connectionManager,require,loading,scrollHelper,imageLoader,datetime){"use strict";function deleteTimer(apiClient,timerId){return new Promise(function(resolve,reject){require(["recordingHelper"],function(recordingHelper){recordingHelper.cancelSeriesTimerWithConfirmation(timerId,apiClient.serverId()).then(resolve,reject)})})}function renderTimer(context,item,apiClient){item.ProgramInfo;context.querySelector("#txtPrePaddingMinutes").value=item.PrePaddingSeconds/60,context.querySelector("#txtPostPaddingMinutes").value=item.PostPaddingSeconds/60,context.querySelector(".selectChannels").value=item.RecordAnyChannel?"all":"one",context.querySelector(".selectAirTime").value=item.RecordAnyTime?"any":"original",context.querySelector(".selectShowType").value=item.RecordNewOnly?"new":"all",context.querySelector(".chkSkipEpisodesInLibrary").checked=item.SkipEpisodesInLibrary,context.querySelector(".selectKeepUpTo").value=item.KeepUpTo||0,item.ChannelName||item.ChannelNumber?context.querySelector(".optionChannelOnly").innerHTML=globalize.translate("sharedcomponents#ChannelNameOnly",item.ChannelName||item.ChannelNumber):context.querySelector(".optionChannelOnly").innerHTML=globalize.translate("sharedcomponents#OneChannel"),context.querySelector(".optionAroundTime").innerHTML=globalize.translate("sharedcomponents#AroundTime",datetime.getDisplayTime(datetime.parseISO8601Date(item.StartDate))),loading.hide()}function closeDialog(isDeleted){recordingUpdated=!0,recordingDeleted=isDeleted,dialogHelper.close(currentDialog)}function onSubmit(e){var form=this,apiClient=connectionManager.getApiClient(currentServerId);return apiClient.getLiveTvSeriesTimer(currentItemId).then(function(item){item.PrePaddingSeconds=60*form.querySelector("#txtPrePaddingMinutes").value,item.PostPaddingSeconds=60*form.querySelector("#txtPostPaddingMinutes").value,item.RecordAnyChannel="all"===form.querySelector(".selectChannels").value,item.RecordAnyTime="any"===form.querySelector(".selectAirTime").value,item.RecordNewOnly="new"===form.querySelector(".selectShowType").value,item.SkipEpisodesInLibrary=form.querySelector(".chkSkipEpisodesInLibrary").checked,item.KeepUpTo=form.querySelector(".selectKeepUpTo").value,apiClient.updateLiveTvSeriesTimer(item)}),e.preventDefault(),!1}function init(context){fillKeepUpTo(context),context.querySelector(".btnCancel").addEventListener("click",function(){closeDialog(!1)}),context.querySelector(".btnCancelRecording").addEventListener("click",function(){deleteTimer(connectionManager.getApiClient(currentServerId),currentItemId).then(function(){closeDialog(!0)})}),context.querySelector("form").addEventListener("submit",onSubmit)}function reload(context,id){var apiClient=connectionManager.getApiClient(currentServerId);loading.show(),"string"==typeof id?(currentItemId=id,apiClient.getLiveTvSeriesTimer(id).then(function(result){renderTimer(context,result,apiClient),loading.hide()})):id&&(currentItemId=id.Id,renderTimer(context,id,apiClient),loading.hide())}function fillKeepUpTo(context){for(var html="",i=0;i<=50;i++){var text;text=0===i?globalize.translate("sharedcomponents#AsManyAsPossible"):1===i?globalize.translate("sharedcomponents#ValueOneEpisode"):globalize.translate("sharedcomponents#ValueEpisodeCount",i),html+='"}context.querySelector(".selectKeepUpTo").innerHTML=html}function onFieldChange(e){this.querySelector(".btnSubmit").click()}function embed(itemId,serverId,options){recordingUpdated=!1,recordingDeleted=!1,currentServerId=serverId,loading.show(),options=options||{},require(["text!./seriesrecordingeditor.template.html"],function(template){var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=options.context;dlg.classList.add("hide"),dlg.innerHTML=globalize.translateDocument(template,"sharedcomponents"),dlg.querySelector(".formDialogHeader").classList.add("hide"),dlg.querySelector(".formDialogFooter").classList.add("hide"),dlg.querySelector(".formDialogContent").className="",dlg.querySelector(".dialogContentInner").className="",dlg.classList.remove("hide"),dlg.removeEventListener("change",onFieldChange),dlg.addEventListener("change",onFieldChange),currentDialog=dlg,init(dlg),reload(dlg,itemId)})}function showEditor(itemId,serverId,options){return new Promise(function(resolve,reject){recordingUpdated=!1,recordingDeleted=!1,currentServerId=serverId,loading.show(),options=options||{},require(["text!./seriesrecordingeditor.template.html"],function(template){var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.classList.add("recordingDialog"),layoutManager.tv||(dlg.style["min-width"]="20%");var html="";html+=globalize.translateDocument(template,"sharedcomponents"),dlg.innerHTML=html,!1===options.enableCancel&&dlg.querySelector(".formDialogFooter").classList.add("hide"),currentDialog=dlg,dlg.addEventListener("closing",function(){recordingDeleted||this.querySelector(".btnSubmit").click()}),dlg.addEventListener("close",function(){recordingUpdated?resolve({updated:!0,deleted:recordingDeleted}):reject()}),layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1),init(dlg),reload(dlg,itemId),dialogHelper.open(dlg)})})}var currentDialog,currentItemId,currentServerId,recordingUpdated=!1,recordingDeleted=!1;return{show:showEditor,embed:embed}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/refreshdialog/refreshdialog.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/refreshdialog/refreshdialog.js index 8e1c09aa1c..d2ccd47197 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/refreshdialog/refreshdialog.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/refreshdialog/refreshdialog.js @@ -1 +1 @@ -define(["shell","dialogHelper","loading","layoutManager","connectionManager","appRouter","globalize","emby-input","emby-checkbox","paper-icon-button-light","emby-select","material-icons","css!./../formdialog","emby-button"],function(shell,dialogHelper,loading,layoutManager,connectionManager,appRouter,globalize){"use strict";function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function getEditorHtml(){var html="";return html+='
',html+='
',html+='
',html+='
',html+='",html+="
",html+='",html+='
',html+=globalize.translate("sharedcomponents#RefreshDialogHelp"),html+="
",html+='',html+="
",html+='
',html+='",html+="
",html+="
",html+="
",html+="
"}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function onSubmit(e){loading.show();var instance=this,dlg=parentWithClass(e.target,"dialog"),options=instance.options,apiClient=connectionManager.getApiClient(options.serverId),replaceAllMetadata="all"===dlg.querySelector("#selectMetadataRefreshMode").value,mode="scan"===dlg.querySelector("#selectMetadataRefreshMode").value?"Default":"FullRefresh",replaceAllImages="FullRefresh"===mode&&dlg.querySelector(".chkReplaceImages").checked;return options.itemIds.forEach(function(itemId){apiClient.refreshItem(itemId,{Recursive:!0,ImageRefreshMode:mode,MetadataRefreshMode:mode,ReplaceAllImages:replaceAllImages,ReplaceAllMetadata:replaceAllMetadata})}),dialogHelper.close(dlg),require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#RefreshQueued"))}),loading.hide(),e.preventDefault(),!1}function RefreshDialog(options){this.options=options}return RefreshDialog.prototype.show=function(){var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="",title=globalize.translate("sharedcomponents#RefreshMetadata");return html+='
',html+='',html+='

',html+=title,html+="

",html+="
",html+=getEditorHtml(),dlg.innerHTML=html,dlg.querySelector("form").addEventListener("submit",onSubmit.bind(this)),dlg.querySelector("#selectMetadataRefreshMode").addEventListener("change",function(){"scan"===this.value?dlg.querySelector(".fldReplaceExistingImages").classList.add("hide"):dlg.querySelector(".fldReplaceExistingImages").classList.remove("hide")}),this.options.mode&&(dlg.querySelector("#selectMetadataRefreshMode").value=this.options.mode),dlg.querySelector("#selectMetadataRefreshMode").dispatchEvent(new CustomEvent("change")),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),new Promise(function(resolve,reject){layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),dlg.addEventListener("close",resolve),dialogHelper.open(dlg)})},RefreshDialog}); \ No newline at end of file +define(["shell","dialogHelper","loading","layoutManager","connectionManager","appRouter","globalize","emby-input","emby-checkbox","paper-icon-button-light","emby-select","material-icons","css!./../formdialog","emby-button"],function(shell,dialogHelper,loading,layoutManager,connectionManager,appRouter,globalize){"use strict";function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(!(elem=elem.parentNode))return null;return elem}function getEditorHtml(){var html="";return html+='
',html+='
',html+='
',html+='
',html+='",html+="
",html+='",html+='
',html+=globalize.translate("sharedcomponents#RefreshDialogHelp"),html+="
",html+='',html+="
",html+='
',html+='",html+="
",html+="
",html+="
",html+="
"}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function onSubmit(e){loading.show();var instance=this,dlg=parentWithClass(e.target,"dialog"),options=instance.options,apiClient=connectionManager.getApiClient(options.serverId),replaceAllMetadata="all"===dlg.querySelector("#selectMetadataRefreshMode").value,mode="scan"===dlg.querySelector("#selectMetadataRefreshMode").value?"Default":"FullRefresh",replaceAllImages="FullRefresh"===mode&&dlg.querySelector(".chkReplaceImages").checked;return options.itemIds.forEach(function(itemId){apiClient.refreshItem(itemId,{Recursive:!0,ImageRefreshMode:mode,MetadataRefreshMode:mode,ReplaceAllImages:replaceAllImages,ReplaceAllMetadata:replaceAllMetadata})}),dialogHelper.close(dlg),require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#RefreshQueued"))}),loading.hide(),e.preventDefault(),!1}function RefreshDialog(options){this.options=options}return RefreshDialog.prototype.show=function(){var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="",title=globalize.translate("sharedcomponents#RefreshMetadata");return html+='
',html+='',html+='

',html+=title,html+="

",html+="
",html+=getEditorHtml(),dlg.innerHTML=html,dlg.querySelector("form").addEventListener("submit",onSubmit.bind(this)),dlg.querySelector("#selectMetadataRefreshMode").addEventListener("change",function(){"scan"===this.value?dlg.querySelector(".fldReplaceExistingImages").classList.add("hide"):dlg.querySelector(".fldReplaceExistingImages").classList.remove("hide")}),this.options.mode&&(dlg.querySelector("#selectMetadataRefreshMode").value=this.options.mode),dlg.querySelector("#selectMetadataRefreshMode").dispatchEvent(new CustomEvent("change")),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),new Promise(function(resolve,reject){layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),dlg.addEventListener("close",resolve),dialogHelper.open(dlg)})},RefreshDialog}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/registrationservices/registrationservices.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/registrationservices/registrationservices.js index e40422b7b5..1daf465c83 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/registrationservices/registrationservices.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/registrationservices/registrationservices.js @@ -1 +1 @@ -define(["appSettings","loading","apphost","iapManager","events","shell","globalize","dialogHelper","connectionManager","layoutManager","emby-button","emby-linkbutton"],function(appSettings,loading,appHost,iapManager,events,shell,globalize,dialogHelper,connectionManager,layoutManager){"use strict";function alertText(options){return new Promise(function(resolve,reject){require(["alert"],function(alert){alert(options).then(resolve,reject)})})}function showInAppPurchaseInfo(subscriptionOptions,unlockableProductInfo,dialogOptions){return new Promise(function(resolve,reject){require(["listViewStyle","formDialogStyle"],function(){showInAppPurchaseElement(subscriptionOptions,unlockableProductInfo,dialogOptions,resolve,reject),currentDisplayingResolve=resolve})})}function showPeriodicMessage(feature,settingsKey){return new Promise(function(resolve,reject){require(["listViewStyle","emby-button","formDialogStyle"],function(){var dlg=dialogHelper.createDialog({size:layoutManager.tv?"fullscreen":"fullscreen-border",removeOnClose:!0,scrollY:!1});dlg.classList.add("formDialog");var html="";html+='
',html+='',html+='

Emby Premiere',html+="

",html+="
",html+='
',html+='
',html+="

"+globalize.translate("sharedcomponents#HeaderDiscoverEmbyPremiere")+"

",html+="

"+globalize.translate("sharedcomponents#MessageDidYouKnowCinemaMode")+"

",html+="

"+globalize.translate("sharedcomponents#MessageDidYouKnowCinemaMode2")+"

",html+='

'+globalize.translate("sharedcomponents#HeaderBenefitsEmbyPremiere")+"

",html+='
',html+=getSubscriptionBenefits().map(getSubscriptionBenefitHtml).join(""),html+="
",html+="
",html+='
',html+='";var seconds=11;html+='
'+globalize.translate("sharedcomponents#ContinueInSecondsValue",seconds)+"
",html+='",html+="
",html+="
",html+="
",dlg.innerHTML=html;var i,length,isRejected=!0,timeTextInterval=setInterval(function(){seconds-=1,seconds<=0?(dlg.querySelector(".continueTimeText").classList.add("hide"),dlg.querySelector(".btnContinue").classList.remove("hide")):dlg.querySelector(".continueTimeText").innerHTML=globalize.translate("sharedcomponents#ContinueInSecondsValue",seconds)},1e3),btnPurchases=dlg.querySelectorAll(".buttonPremiereInfo");for(i=0,length=btnPurchases.length;iintervalMs){var apiClient=connectionManager.currentApiClient();if("6da60dd6edfc4508bca2c434d4400816"===apiClient.serverId())return Promise.resolve();var registrationOptions={viewOnly:!0};return connectionManager.getRegistrationInfo(iapManager.getAdminFeatureName(feature),apiClient,registrationOptions).catch(function(errorResult){return"overlimit"===errorResult?(appSettings.set(settingsKey,(new Date).getTime()),Promise.resolve()):showPeriodicMessage(feature,settingsKey)})}return Promise.resolve()}function validateFeature(feature,options){return options=options||{},console.log("validateFeature: "+feature),iapManager.isUnlockedByDefault(feature,options).then(function(){return showPeriodicMessageIfNeeded(feature)},function(){var unlockableFeatureCacheKey="featurepurchased-"+feature;if("1"===appSettings.get(unlockableFeatureCacheKey))return showPeriodicMessageIfNeeded(feature);var unlockableProduct=iapManager.getProductInfo(feature);if(unlockableProduct){var unlockableCacheKey="productpurchased-"+unlockableProduct.id;if(unlockableProduct.owned)return appSettings.set(unlockableFeatureCacheKey,"1"),appSettings.set(unlockableCacheKey,"1"),showPeriodicMessageIfNeeded(feature);if("1"===appSettings.get(unlockableCacheKey))return showPeriodicMessageIfNeeded(feature)}var unlockableProductInfo=unlockableProduct?{enableAppUnlock:!0,id:unlockableProduct.id,price:unlockableProduct.price,feature:feature}:null;return iapManager.getSubscriptionOptions().then(function(subscriptionOptions){if(subscriptionOptions.filter(function(p){return p.owned}).length>0)return Promise.resolve();var registrationOptions={viewOnly:options.viewOnly};return connectionManager.getRegistrationInfo(iapManager.getAdminFeatureName(feature),connectionManager.currentApiClient(),registrationOptions).catch(function(errorResult){if(options.showDialog===!1)return Promise.reject();var alertPromise;return"overlimit"===errorResult&&(alertPromise=showOverLimitAlert()),alertPromise||(alertPromise=Promise.resolve()),alertPromise.then(function(){var dialogOptions={title:globalize.translate("sharedcomponents#HeaderUnlockFeature"),feature:feature};return currentValidatingFeature=feature,showInAppPurchaseInfo(subscriptionOptions,unlockableProductInfo,dialogOptions)})})})})}function showOverLimitAlert(){return alertText("Your Emby Premiere device limit has been exceeded. Please check with the owner of your Emby Server and have them contact Emby support at apps@emby.media if necessary.").catch(function(){return Promise.resolve()})}function cancelInAppPurchase(){var elem=document.querySelector(".inAppPurchaseOverlay");elem&&dialogHelper.close(elem)}function clearCurrentDisplayingInfo(){currentDisplayingProductInfos=[],currentDisplayingResolve=null,currentValidatingFeature=null,isCurrentDialogRejected=null}function showExternalPremiereInfo(){shell.openUrl(iapManager.getPremiumInfoUrl())}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function getPurchaseTermHtml(term){return"
  • "+term+"
  • "}function getTermsOfPurchaseHtml(){var html="",termsOfPurchase=iapManager.getTermsOfPurchase?iapManager.getTermsOfPurchase():[];return termsOfPurchase.length?(html+="

    "+globalize.translate("sharedcomponents#HeaderTermsOfPurchase")+"

    ",termsOfPurchase.push(''+globalize.translate("sharedcomponents#PrivacyPolicy")+""),termsOfPurchase.push(''+globalize.translate("sharedcomponents#TermsOfUse")+""),html+="
      ",html+=termsOfPurchase.map(getPurchaseTermHtml).join(""),html+="
    "):html}function showInAppPurchaseElement(subscriptionOptions,unlockableProductInfo,dialogOptions,resolve,reject){function onCloseButtonClick(){dialogHelper.close(dlg)}cancelInAppPurchase(),currentDisplayingProductInfos=subscriptionOptions.slice(0),unlockableProductInfo&¤tDisplayingProductInfos.push(unlockableProductInfo);var dlg=dialogHelper.createDialog({size:layoutManager.tv?"fullscreen":"fullscreen-border",removeOnClose:!0,scrollY:!1});dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ',html+=dialogOptions.title||"",html+="

    ",html+="
    ",html+='
    ',html+='
    ',html+='
    ',html+='

    ',html+=unlockableProductInfo?globalize.translate("sharedcomponents#MessageUnlockAppWithPurchaseOrSupporter"):globalize.translate("sharedcomponents#MessageUnlockAppWithSupporter"),html+="

    ",html+='

    ',html+=globalize.translate("sharedcomponents#MessageToValidateSupporter"),html+="

    ";var i,length,hasProduct=!1;for(i=0,length=subscriptionOptions.length;i",html+='",html+="

    ";if(unlockableProductInfo){hasProduct=!0;var unlockText=globalize.translate("sharedcomponents#ButtonUnlockWithPurchase");unlockableProductInfo.price&&(unlockText=globalize.translate("sharedcomponents#ButtonUnlockPrice",unlockableProductInfo.price)),html+="

    ",html+='",html+="

    "}html+="

    ",html+='",html+="

    ",subscriptionOptions.length&&(html+='

    '+globalize.translate("sharedcomponents#HeaderBenefitsEmbyPremiere")+"

    ",html+='
    ',html+=getSubscriptionBenefits().map(getSubscriptionBenefitHtml).join(""),html+="
    "),"playback"===dialogOptions.feature&&(html+="

    ",html+='",html+="

    "),html+=getTermsOfPurchaseHtml(),html+="",html+="
    ",html+="
    ",dlg.innerHTML=html,document.body.appendChild(dlg);var btnPurchases=dlg.querySelectorAll(".btnPurchase");for(i=0,length=btnPurchases.length;i'):html+='
    ',html+=''+item.icon+"",html+='
    ',html+='

    ',html+=item.name,html+="

    ",html+='
    ',html+=item.text,html+="
    ",html+="
    ",html+=enableLink?"":"
    "}function onPurchaseButtonClick(){var featureId=this.getAttribute("data-featureid");"true"===this.getAttribute("data-email")?getUserEmail().then(function(email){iapManager.beginPurchase(featureId,email)}):iapManager.beginPurchase(featureId)}function restorePurchase(unlockableProductInfo){var dlg=dialogHelper.createDialog({size:layoutManager.tv?"fullscreen":"fullscreen-border",removeOnClose:!0,scrollY:!1});dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ',html+=iapManager.getRestoreButtonText(),html+="

    ",html+="
    ",html+='
    ',html+='
    ',html+='

    ',html+=globalize.translate("sharedcomponents#HowDidYouPay"),html+="

    ",html+="

    ",html+='",html+="

    ",unlockableProductInfo&&(html+="

    ",html+='",html+="

    "),html+="
    ",html+="
    ",dlg.innerHTML=html,document.body.appendChild(dlg),loading.hide(),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),dlg.querySelector(".btnCloseDialog").addEventListener("click",function(){dialogHelper.close(dlg)}),dlg.querySelector(".btnRestoreSub").addEventListener("click",function(){dialogHelper.close(dlg),alertText({text:globalize.translate("sharedcomponents#MessageToValidateSupporter"),title:"Emby Premiere"})});var btnRestoreUnlock=dlg.querySelector(".btnRestoreUnlock");btnRestoreUnlock&&btnRestoreUnlock.addEventListener("click",function(){dialogHelper.close(dlg),iapManager.restorePurchase()}),dialogHelper.open(dlg).then(function(){layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1)})}function getUserEmail(){if(connectionManager.isLoggedIntoConnect()){var connectUser=connectionManager.connectUser();if(connectUser&&connectUser.Email)return Promise.resolve(connectUser.Email)}return new Promise(function(resolve,reject){require(["prompt"],function(prompt){prompt({label:globalize.translate("sharedcomponents#LabelEmailAddress")}).then(resolve,reject)})})}function onProductUpdated(e,product){if(product.owned){var resolve=currentDisplayingResolve;if(resolve&¤tDisplayingProductInfos.filter(function(p){return product.id===p.id}).length)return isCurrentDialogRejected=!1,cancelInAppPurchase(),void resolve()}var feature=currentValidatingFeature;feature&&iapManager.isUnlockedByDefault(feature).then(function(){isCurrentDialogRejected=!1,cancelInAppPurchase(),resolve()})}function showPremiereInfo(){return appHost.supports("externalpremium")?(showExternalPremiereInfo(),Promise.resolve()):iapManager.getSubscriptionOptions().then(function(subscriptionOptions){var dialogOptions={title:"Emby Premiere",feature:"sync"};return showInAppPurchaseInfo(subscriptionOptions,null,dialogOptions)})}var currentDisplayingProductInfos=[],currentDisplayingResolve=null,currentValidatingFeature=null,isCurrentDialogRejected=null;return events.on(iapManager,"productupdated",onProductUpdated),{validateFeature:validateFeature,showPremiereInfo:showPremiereInfo}}); \ No newline at end of file +define(["appSettings","loading","apphost","iapManager","events","shell","globalize","dialogHelper","connectionManager","layoutManager","emby-button","emby-linkbutton"],function(appSettings,loading,appHost,iapManager,events,shell,globalize,dialogHelper,connectionManager,layoutManager){"use strict";function alertText(options){return new Promise(function(resolve,reject){require(["alert"],function(alert){alert(options).then(resolve,reject)})})}function showInAppPurchaseInfo(subscriptionOptions,unlockableProductInfo,dialogOptions){return new Promise(function(resolve,reject){require(["listViewStyle","formDialogStyle"],function(){showInAppPurchaseElement(subscriptionOptions,unlockableProductInfo,dialogOptions,resolve,reject),currentDisplayingResolve=resolve})})}function showPeriodicMessage(feature,settingsKey){return new Promise(function(resolve,reject){require(["listViewStyle","emby-button","formDialogStyle"],function(){var dlg=dialogHelper.createDialog({size:layoutManager.tv?"fullscreen":"fullscreen-border",removeOnClose:!0,scrollY:!1});dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    Emby Premiere',html+="

    ",html+="
    ",html+='
    ',html+='
    ',html+="

    "+globalize.translate("sharedcomponents#HeaderDiscoverEmbyPremiere")+"

    ",html+="

    "+globalize.translate("sharedcomponents#MessageDidYouKnowCinemaMode")+"

    ",html+="

    "+globalize.translate("sharedcomponents#MessageDidYouKnowCinemaMode2")+"

    ",html+='

    '+globalize.translate("sharedcomponents#HeaderBenefitsEmbyPremiere")+"

    ",html+='
    ',html+=getSubscriptionBenefits().map(getSubscriptionBenefitHtml).join(""),html+="
    ",html+="
    ",html+='
    ',html+='";var seconds=11;html+='
    '+globalize.translate("sharedcomponents#ContinueInSecondsValue",seconds)+"
    ",html+='",html+="
    ",html+="
    ",html+="
    ",dlg.innerHTML=html;var i,length,isRejected=!0,timeTextInterval=setInterval(function(){seconds-=1,seconds<=0?(dlg.querySelector(".continueTimeText").classList.add("hide"),dlg.querySelector(".btnContinue").classList.remove("hide")):dlg.querySelector(".continueTimeText").innerHTML=globalize.translate("sharedcomponents#ContinueInSecondsValue",seconds)},1e3),btnPurchases=dlg.querySelectorAll(".buttonPremiereInfo");for(i=0,length=btnPurchases.length;iintervalMs){var apiClient=connectionManager.currentApiClient();if("6da60dd6edfc4508bca2c434d4400816"===apiClient.serverId())return Promise.resolve();var registrationOptions={viewOnly:!0};return connectionManager.getRegistrationInfo(iapManager.getAdminFeatureName(feature),apiClient,registrationOptions).catch(function(errorResult){return"overlimit"===errorResult?(appSettings.set(settingsKey,(new Date).getTime()),Promise.resolve()):showPeriodicMessage(feature,settingsKey)})}return Promise.resolve()}function validateFeature(feature,options){return options=options||{},console.log("validateFeature: "+feature),iapManager.isUnlockedByDefault(feature,options).then(function(){return showPeriodicMessageIfNeeded(feature)},function(){var unlockableFeatureCacheKey="featurepurchased-"+feature;if("1"===appSettings.get(unlockableFeatureCacheKey))return showPeriodicMessageIfNeeded(feature);var unlockableProduct=iapManager.getProductInfo(feature);if(unlockableProduct){var unlockableCacheKey="productpurchased-"+unlockableProduct.id;if(unlockableProduct.owned)return appSettings.set(unlockableFeatureCacheKey,"1"),appSettings.set(unlockableCacheKey,"1"),showPeriodicMessageIfNeeded(feature);if("1"===appSettings.get(unlockableCacheKey))return showPeriodicMessageIfNeeded(feature)}var unlockableProductInfo=unlockableProduct?{enableAppUnlock:!0,id:unlockableProduct.id,price:unlockableProduct.price,feature:feature}:null;return iapManager.getSubscriptionOptions().then(function(subscriptionOptions){if(subscriptionOptions.filter(function(p){return p.owned}).length>0)return Promise.resolve();var registrationOptions={viewOnly:options.viewOnly};return connectionManager.getRegistrationInfo(iapManager.getAdminFeatureName(feature),connectionManager.currentApiClient(),registrationOptions).catch(function(errorResult){if(!1===options.showDialog)return Promise.reject();var alertPromise;return"overlimit"===errorResult&&(alertPromise=showOverLimitAlert()),alertPromise||(alertPromise=Promise.resolve()),alertPromise.then(function(){var dialogOptions={title:globalize.translate("sharedcomponents#HeaderUnlockFeature"),feature:feature};return currentValidatingFeature=feature,showInAppPurchaseInfo(subscriptionOptions,unlockableProductInfo,dialogOptions)})})})})}function showOverLimitAlert(){return alertText("Your Emby Premiere device limit has been exceeded. Please check with the owner of your Emby Server and have them contact Emby support at apps@emby.media if necessary.").catch(function(){return Promise.resolve()})}function cancelInAppPurchase(){var elem=document.querySelector(".inAppPurchaseOverlay");elem&&dialogHelper.close(elem)}function clearCurrentDisplayingInfo(){currentDisplayingProductInfos=[],currentDisplayingResolve=null,currentValidatingFeature=null,isCurrentDialogRejected=null}function showExternalPremiereInfo(){shell.openUrl(iapManager.getPremiumInfoUrl())}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function getPurchaseTermHtml(term){return"
  • "+term+"
  • "}function getTermsOfPurchaseHtml(){var html="",termsOfPurchase=iapManager.getTermsOfPurchase?iapManager.getTermsOfPurchase():[];return termsOfPurchase.length?(html+="

    "+globalize.translate("sharedcomponents#HeaderTermsOfPurchase")+"

    ",termsOfPurchase.push(''+globalize.translate("sharedcomponents#PrivacyPolicy")+""),termsOfPurchase.push(''+globalize.translate("sharedcomponents#TermsOfUse")+""),html+="
      ",html+=termsOfPurchase.map(getPurchaseTermHtml).join(""),html+="
    "):html}function showInAppPurchaseElement(subscriptionOptions,unlockableProductInfo,dialogOptions,resolve,reject){function onCloseButtonClick(){dialogHelper.close(dlg)}cancelInAppPurchase(),currentDisplayingProductInfos=subscriptionOptions.slice(0),unlockableProductInfo&¤tDisplayingProductInfos.push(unlockableProductInfo);var dlg=dialogHelper.createDialog({size:layoutManager.tv?"fullscreen":"fullscreen-border",removeOnClose:!0,scrollY:!1});dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ',html+=dialogOptions.title||"",html+="

    ",html+="
    ",html+='
    ',html+='
    ',html+='
    ',html+='

    ',html+=unlockableProductInfo?globalize.translate("sharedcomponents#MessageUnlockAppWithPurchaseOrSupporter"):globalize.translate("sharedcomponents#MessageUnlockAppWithSupporter"),html+="

    ",html+='

    ',html+=globalize.translate("sharedcomponents#MessageToValidateSupporter"),html+="

    ";var i,length;for(i=0,length=subscriptionOptions.length;i",html+='",html+="

    ";if(unlockableProductInfo){!0;var unlockText=globalize.translate("sharedcomponents#ButtonUnlockWithPurchase");unlockableProductInfo.price&&(unlockText=globalize.translate("sharedcomponents#ButtonUnlockPrice",unlockableProductInfo.price)),html+="

    ",html+='",html+="

    "}html+="

    ",html+='",html+="

    ",subscriptionOptions.length&&(html+='

    '+globalize.translate("sharedcomponents#HeaderBenefitsEmbyPremiere")+"

    ",html+='
    ',html+=getSubscriptionBenefits().map(getSubscriptionBenefitHtml).join(""),html+="
    "),"playback"===dialogOptions.feature&&(html+="

    ",html+='",html+="

    "),html+=getTermsOfPurchaseHtml(),html+="",html+="
    ",html+="
    ",dlg.innerHTML=html,document.body.appendChild(dlg);var btnPurchases=dlg.querySelectorAll(".btnPurchase");for(i=0,length=btnPurchases.length;i'):html+='
    ',html+=''+item.icon+"",html+='
    ',html+='

    ',html+=item.name,html+="

    ",html+='
    ',html+=item.text,html+="
    ",html+="
    ",html+=enableLink?"":"
    "}function onPurchaseButtonClick(){var featureId=this.getAttribute("data-featureid");"true"===this.getAttribute("data-email")?getUserEmail().then(function(email){iapManager.beginPurchase(featureId,email)}):iapManager.beginPurchase(featureId)}function restorePurchase(unlockableProductInfo){var dlg=dialogHelper.createDialog({size:layoutManager.tv?"fullscreen":"fullscreen-border",removeOnClose:!0,scrollY:!1});dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ',html+=iapManager.getRestoreButtonText(),html+="

    ",html+="
    ",html+='
    ',html+='
    ',html+='

    ',html+=globalize.translate("sharedcomponents#HowDidYouPay"),html+="

    ",html+="

    ",html+='",html+="

    ",unlockableProductInfo&&(html+="

    ",html+='",html+="

    "),html+="
    ",html+="
    ",dlg.innerHTML=html,document.body.appendChild(dlg),loading.hide(),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),dlg.querySelector(".btnCloseDialog").addEventListener("click",function(){dialogHelper.close(dlg)}),dlg.querySelector(".btnRestoreSub").addEventListener("click",function(){dialogHelper.close(dlg),alertText({text:globalize.translate("sharedcomponents#MessageToValidateSupporter"),title:"Emby Premiere"})});var btnRestoreUnlock=dlg.querySelector(".btnRestoreUnlock");btnRestoreUnlock&&btnRestoreUnlock.addEventListener("click",function(){dialogHelper.close(dlg),iapManager.restorePurchase()}),dialogHelper.open(dlg).then(function(){layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1)})}function getUserEmail(){if(connectionManager.isLoggedIntoConnect()){var connectUser=connectionManager.connectUser();if(connectUser&&connectUser.Email)return Promise.resolve(connectUser.Email)}return new Promise(function(resolve,reject){require(["prompt"],function(prompt){prompt({label:globalize.translate("sharedcomponents#LabelEmailAddress")}).then(resolve,reject)})})}function onProductUpdated(e,product){if(product.owned){var resolve=currentDisplayingResolve;if(resolve&¤tDisplayingProductInfos.filter(function(p){return product.id===p.id}).length)return isCurrentDialogRejected=!1,cancelInAppPurchase(),void resolve()}var feature=currentValidatingFeature;feature&&iapManager.isUnlockedByDefault(feature).then(function(){isCurrentDialogRejected=!1,cancelInAppPurchase(),resolve()})}function showPremiereInfo(){return appHost.supports("externalpremium")?(showExternalPremiereInfo(),Promise.resolve()):iapManager.getSubscriptionOptions().then(function(subscriptionOptions){return showInAppPurchaseInfo(subscriptionOptions,null,{title:"Emby Premiere",feature:"sync"})})}var currentDisplayingProductInfos=[],currentDisplayingResolve=null,currentValidatingFeature=null,isCurrentDialogRejected=null;return events.on(iapManager,"productupdated",onProductUpdated),{validateFeature:validateFeature,showPremiereInfo:showPremiereInfo}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/require/requirecss.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/require/requirecss.js index 3ddbe9037a..1448c6fa8e 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/require/requirecss.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/require/requirecss.js @@ -1 +1 @@ -define(function(){"use strict";function isLoaded(url){return importedCss.indexOf(url)!==-1}function removeFromLoadHistory(url){url=url.toLowerCase(),importedCss=importedCss.filter(function(c){return url.indexOf(c.toLowerCase())===-1})}var requireCss={};requireCss.normalize=function(name,normalize){return".css"===name.substr(name.length-4,4)&&(name=name.substr(0,name.length-4)),normalize(name)};var importedCss=[];return requireCss.load=function(cssId,req,load,config){var srch="/emby-webcomponents/require/requirecss",index=cssId.indexOf(srch);index!==-1&&(cssId="css"+cssId.substring(index+srch.length));var url=cssId+".css";if(url.indexOf("://")===-1&&(url=config.baseUrl+url),isLoaded(url))load();else{importedCss.push(url);var link=document.createElement("link");link.setAttribute("rel","stylesheet"),link.setAttribute("type","text/css"),link.onload=load;var linkUrl=url;config.urlArgs&&(linkUrl+=config.urlArgs(cssId,url)),link.setAttribute("href",linkUrl),document.head.appendChild(link)}},window.requireCss={removeStylesheet:function(stylesheet){stylesheet.parentNode.removeChild(stylesheet),removeFromLoadHistory(stylesheet.href)}},requireCss}); \ No newline at end of file +define(function(){"use strict";function isLoaded(url){return-1!==importedCss.indexOf(url)}function removeFromLoadHistory(url){url=url.toLowerCase(),importedCss=importedCss.filter(function(c){return-1===url.indexOf(c.toLowerCase())})}var requireCss={};requireCss.normalize=function(name,normalize){return".css"===name.substr(name.length-4,4)&&(name=name.substr(0,name.length-4)),normalize(name)};var importedCss=[];return requireCss.load=function(cssId,req,load,config){var srch="/emby-webcomponents/require/requirecss",index=cssId.indexOf(srch);-1!==index&&(cssId="css"+cssId.substring(index+srch.length));var url=cssId+".css";if(-1===url.indexOf("://")&&(url=config.baseUrl+url),isLoaded(url))load();else{importedCss.push(url);var link=document.createElement("link");link.setAttribute("rel","stylesheet"),link.setAttribute("type","text/css"),link.onload=load;var linkUrl=url;config.urlArgs&&(linkUrl+=config.urlArgs(cssId,url)),link.setAttribute("href",linkUrl),document.head.appendChild(link)}},window.requireCss={removeStylesheet:function(stylesheet){stylesheet.parentNode.removeChild(stylesheet),removeFromLoadHistory(stylesheet.href)}},requireCss}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/require/requirehtml.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/require/requirehtml.js index 16e5ea49ef..d28b35c2e4 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/require/requirehtml.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/require/requirehtml.js @@ -1 +1 @@ -define(function(){"use strict";var importedFiles=[];return{load:function(cssId,req,load,config){cssId=cssId.replace("js/requirehtml","html");var url=cssId+".html";if(url.indexOf("://")===-1&&(url=config.baseUrl+url),importedFiles.indexOf(url)===-1){importedFiles.push(url);var link=document.createElement("link");return link.rel="import",config.urlArgs&&(url.toLowerCase().indexOf("bower_")!==-1&&url.toLowerCase().indexOf("emby-webcomponents")===-1||(url+=config.urlArgs(cssId,url))),link.onload=load,link.href=url,void document.head.appendChild(link)}load()},normalize:function(name,normalize){return".html"===name.substr(name.length-5,5)&&(name=name.substr(0,name.length-5)),normalize(name)}}}); \ No newline at end of file +define(function(){"use strict";var importedFiles=[];return{load:function(cssId,req,load,config){cssId=cssId.replace("js/requirehtml","html");var url=cssId+".html";if(-1===url.indexOf("://")&&(url=config.baseUrl+url),-1===importedFiles.indexOf(url)){importedFiles.push(url);var link=document.createElement("link");return link.rel="import",config.urlArgs&&(-1!==url.toLowerCase().indexOf("bower_")&&-1===url.toLowerCase().indexOf("emby-webcomponents")||(url+=config.urlArgs(cssId,url))),link.onload=load,link.href=url,void document.head.appendChild(link)}load()},normalize:function(name,normalize){return".html"===name.substr(name.length-5,5)&&(name=name.substr(0,name.length-5)),normalize(name)}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/require/requiretext.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/require/requiretext.js index b1feac2604..d871b07097 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/require/requiretext.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/require/requiretext.js @@ -1 +1 @@ -define(function(){"use strict";return{load:function(url,req,load,config){url.indexOf("://")===-1&&(url=config.baseUrl+url),config.urlArgs&&(url+=config.urlArgs(url,url));var xhr=new XMLHttpRequest;xhr.open("GET",url,!0),xhr.onload=function(e){load(this.response)},xhr.send()},normalize:function(name,normalize){return normalize(name)}}}); \ No newline at end of file +define(function(){"use strict";return{load:function(url,req,load,config){-1===url.indexOf("://")&&(url=config.baseUrl+url),config.urlArgs&&(url+=config.urlArgs(url,url));var xhr=new XMLHttpRequest;xhr.open("GET",url,!0),xhr.onload=function(e){load(this.response)},xhr.send()},normalize:function(name,normalize){return normalize(name)}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/router.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/router.js index 57b8ca483c..a7fe99d941 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/router.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/router.js @@ -1 +1 @@ -define(["loading","globalize","events","viewManager","layoutManager","skinManager","pluginManager","backdrop","browser","pageJs","appSettings","apphost","connectionManager"],function(loading,globalize,events,viewManager,layoutManager,skinManager,pluginManager,backdrop,browser,page,appSettings,appHost,connectionManager){"use strict";function beginConnectionWizard(){backdrop.clear(),loading.show(),connectionManager.connect({enableAutoLogin:appSettings.enableAutoLogin()}).then(function(result){handleConnectionResult(result,loading)})}function handleConnectionResult(result,loading){switch(result.State){case"SignedIn":loading.hide(),skinManager.loadUserSkin();break;case"ServerSignIn":result.ApiClient.getPublicUsers().then(function(users){users.length?appRouter.showLocalLogin(result.Servers[0].Id):appRouter.showLocalLogin(result.Servers[0].Id,!0)});break;case"ServerSelection":appRouter.showSelectServer();break;case"ConnectSignIn":appRouter.showWelcome();break;case"ServerUpdateNeeded":require(["alert"],function(alert){alert({text:globalize.translate("sharedcomponents#ServerUpdateNeeded","https://emby.media"),html:globalize.translate("sharedcomponents#ServerUpdateNeeded",'https://emby.media')}).then(function(){appRouter.showSelectServer()})})}}function loadContentUrl(ctx,next,route,request){var url;url=route.contentPath&&"function"==typeof route.contentPath?route.contentPath(ctx.querystring):route.contentPath||route.path,url.indexOf("://")===-1&&(0!==url.indexOf("/")&&(url="/"+url),url=baseUrl()+url),ctx.querystring&&route.enableContentQueryString&&(url+="?"+ctx.querystring),require(["text!"+url],function(html){loadContent(ctx,route,html,request)})}function handleRoute(ctx,next,route){authenticate(ctx,route,function(){initRoute(ctx,next,route)})}function initRoute(ctx,next,route){var onInitComplete=function(controllerFactory){sendRouteToViewManager(ctx,next,route,controllerFactory)};require(route.dependencies||[],function(){route.controller?require([route.controller],onInitComplete):onInitComplete()})}function cancelCurrentLoadRequest(){var currentRequest=currentViewLoadRequest;currentRequest&&(currentRequest.cancel=!0)}function sendRouteToViewManager(ctx,next,route,controllerFactory){if(isDummyBackToHome&&"home"===route.type)return void(isDummyBackToHome=!1);cancelCurrentLoadRequest();var isBackNav=ctx.isBack,currentRequest={url:baseUrl()+ctx.path,transition:route.transition,isBack:isBackNav,state:ctx.state,type:route.type,fullscreen:route.fullscreen,controllerFactory:controllerFactory,options:{supportsThemeMedia:route.supportsThemeMedia||!1,enableMediaControl:route.enableMediaControl!==!1},autoFocus:route.autoFocus};currentViewLoadRequest=currentRequest;var onNewViewNeeded=function(){"string"==typeof route.path?loadContentUrl(ctx,next,route,currentRequest):next()};return isBackNav?void viewManager.tryRestoreView(currentRequest,function(){currentRouteInfo={route:route,path:ctx.path}}).catch(function(result){result&&result.cancelled||onNewViewNeeded()}):void onNewViewNeeded()}function onForcedLogoutMessageTimeout(){var msg=forcedLogoutMsg;forcedLogoutMsg=null,msg&&require(["alert"],function(alert){alert(msg)})}function showForcedLogoutMessage(msg){forcedLogoutMsg=msg,msgTimeout&&clearTimeout(msgTimeout),msgTimeout=setTimeout(onForcedLogoutMessageTimeout,100)}function onRequestFail(e,data){var apiClient=this;if(401===data.status&&"ParentalControl"===data.errorCode){var isCurrentAllowed=!currentRouteInfo||(currentRouteInfo.route.anonymous||currentRouteInfo.route.startup);isCurrentAllowed||(showForcedLogoutMessage(globalize.translate("sharedcomponents#AccessRestrictedTryAgainLater")),connectionManager.isLoggedIntoConnect()?appRouter.showConnectLogin():appRouter.showLocalLogin(apiClient.serverId()))}}function onBeforeExit(e){browser.web0s&&page.restorePreviousState()}function normalizeImageOptions(options){var setQuality,scaleFactor=browser.tv?.8:1;if(options.maxWidth&&(options.maxWidth=Math.round(options.maxWidth*scaleFactor),setQuality=!0),options.width&&(options.width=Math.round(options.width*scaleFactor),setQuality=!0),options.maxHeight&&(options.maxHeight=Math.round(options.maxHeight*scaleFactor),setQuality=!0),options.height&&(options.height=Math.round(options.height*scaleFactor),setQuality=!0),setQuality){var quality=100,type=options.type||"Primary";quality=browser.tv||browser.slow?browser.chrome?"Primary"===type?40:50:"Backdrop"===type?60:50:"Backdrop"===type?70:90,options.quality=quality}}function getMaxBandwidth(){if(navigator.connection){var max=navigator.connection.downlinkMax;if(max&&max>0&&maxhttps://emby.media')}).then(function(){appRouter.showSelectServer()})})}}function loadContentUrl(ctx,next,route,request){var url;url=route.contentPath&&"function"==typeof route.contentPath?route.contentPath(ctx.querystring):route.contentPath||route.path,-1===url.indexOf("://")&&(0!==url.indexOf("/")&&(url="/"+url),url=baseUrl()+url),ctx.querystring&&route.enableContentQueryString&&(url+="?"+ctx.querystring),require(["text!"+url],function(html){loadContent(ctx,route,html,request)})}function handleRoute(ctx,next,route){authenticate(ctx,route,function(){initRoute(ctx,next,route)})}function initRoute(ctx,next,route){var onInitComplete=function(controllerFactory){sendRouteToViewManager(ctx,next,route,controllerFactory)};require(route.dependencies||[],function(){route.controller?require([route.controller],onInitComplete):onInitComplete()})}function cancelCurrentLoadRequest(){var currentRequest=currentViewLoadRequest;currentRequest&&(currentRequest.cancel=!0)}function sendRouteToViewManager(ctx,next,route,controllerFactory){if(isDummyBackToHome&&"home"===route.type)return void(isDummyBackToHome=!1);cancelCurrentLoadRequest();var isBackNav=ctx.isBack,currentRequest={url:baseUrl()+ctx.path,transition:route.transition,isBack:isBackNav,state:ctx.state,type:route.type,fullscreen:route.fullscreen,controllerFactory:controllerFactory,options:{supportsThemeMedia:route.supportsThemeMedia||!1,enableMediaControl:!1!==route.enableMediaControl},autoFocus:route.autoFocus};currentViewLoadRequest=currentRequest;var onNewViewNeeded=function(){"string"==typeof route.path?loadContentUrl(ctx,next,route,currentRequest):next()};if(!isBackNav)return void onNewViewNeeded();viewManager.tryRestoreView(currentRequest,function(){currentRouteInfo={route:route,path:ctx.path}}).catch(function(result){result&&result.cancelled||onNewViewNeeded()})}function onForcedLogoutMessageTimeout(){var msg=forcedLogoutMsg;forcedLogoutMsg=null,msg&&require(["alert"],function(alert){alert(msg)})}function showForcedLogoutMessage(msg){forcedLogoutMsg=msg,msgTimeout&&clearTimeout(msgTimeout),msgTimeout=setTimeout(onForcedLogoutMessageTimeout,100)}function onRequestFail(e,data){var apiClient=this;if(401===data.status&&"ParentalControl"===data.errorCode){!currentRouteInfo||(currentRouteInfo.route.anonymous||currentRouteInfo.route.startup)||(showForcedLogoutMessage(globalize.translate("sharedcomponents#AccessRestrictedTryAgainLater")),connectionManager.isLoggedIntoConnect()?appRouter.showConnectLogin():appRouter.showLocalLogin(apiClient.serverId()))}}function onBeforeExit(e){browser.web0s&&page.restorePreviousState()}function normalizeImageOptions(options){var setQuality,scaleFactor=browser.tv?.8:1;if(options.maxWidth&&(options.maxWidth=Math.round(options.maxWidth*scaleFactor),setQuality=!0),options.width&&(options.width=Math.round(options.width*scaleFactor),setQuality=!0),options.maxHeight&&(options.maxHeight=Math.round(options.maxHeight*scaleFactor),setQuality=!0),options.height&&(options.height=Math.round(options.height*scaleFactor),setQuality=!0),setQuality){var quality=100,type=options.type||"Primary";quality=browser.tv||browser.slow?browser.chrome?"Primary"===type?40:50:"Backdrop"===type?60:50:"Backdrop"===type?70:90,options.quality=quality}}function getMaxBandwidth(){if(navigator.connection){var max=navigator.connection.downlinkMax;if(max&&max>0&&max=55296&&codePoint<=56319}function isLowSurrogate(codePoint){return codePoint>=56320&&codePoint<=57343}function getByteLength(string){if("string"!=typeof string)throw new Error("Input must be string");for(var charLength=string.length,byteLength=0,codePoint=null,prevCodePoint=null,i=0;i=128&&codePoint<=2047?byteLength+=2:codePoint>=2048&&codePoint<=65535&&(byteLength+=3),prevCodePoint=codePoint;return byteLength}function truncate(string,byteLength){if("string"!=typeof string)throw new Error("Input must be string");for(var codePoint,segment,charLength=string.length,curByteLength=0,i=0;ibyteLength)return string.slice(0,i-segment.length+1)}return string}var illegalRe=/[\/\?<>\\:\*\|":]/g,controlRe=/[\x00-\x1f\x80-\x9f]/g,reservedRe=/^\.+$/,windowsReservedRe=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,windowsTrailingRe=/[\. ]+$/;return{sanitize:function(input,replacement){var sanitized=input.replace(illegalRe,replacement).replace(controlRe,replacement).replace(reservedRe,replacement).replace(windowsReservedRe,replacement).replace(windowsTrailingRe,replacement);return truncate(sanitized,255)}}}); \ No newline at end of file +define([],function(){"use strict";function isHighSurrogate(codePoint){return codePoint>=55296&&codePoint<=56319}function isLowSurrogate(codePoint){return codePoint>=56320&&codePoint<=57343}function getByteLength(string){if("string"!=typeof string)throw new Error("Input must be string");for(var charLength=string.length,byteLength=0,codePoint=null,prevCodePoint=null,i=0;i=128&&codePoint<=2047?byteLength+=2:codePoint>=2048&&codePoint<=65535&&(byteLength+=3),prevCodePoint=codePoint;return byteLength}function truncate(string,byteLength){if("string"!=typeof string)throw new Error("Input must be string");for(var codePoint,segment,charLength=string.length,curByteLength=0,i=0;ibyteLength)return string.slice(0,i-segment.length+1)}return string}var illegalRe=/[\/\?<>\\:\*\|":]/g,controlRe=/[\x00-\x1f\x80-\x9f]/g,reservedRe=/^\.+$/,windowsReservedRe=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,windowsTrailingRe=/[\. ]+$/;return{sanitize:function(input,replacement){return truncate(input.replace(illegalRe,replacement).replace(controlRe,replacement).replace(reservedRe,replacement).replace(windowsReservedRe,replacement).replace(windowsTrailingRe,replacement),255)}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/scroller/smoothscroller.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/scroller/smoothscroller.js index 5d7abffbcd..2ab1136203 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/scroller/smoothscroller.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/scroller/smoothscroller.js @@ -1 +1 @@ -define(["browser","layoutManager","dom","focusManager","ResizeObserver","scrollStyles"],function(browser,layoutManager,dom,focusManager,ResizeObserver){"use strict";function type(value){return null==value?String(value):"object"==typeof value||"function"==typeof value?Object.prototype.toString.call(value).match(/\s([a-z]+)/i)[1].toLowerCase()||"object":typeof value}function disableOneEvent(event){event.preventDefault(),event.stopPropagation(),this.removeEventListener(event.type,disableOneEvent)}function within(number,min,max){return numbermax?max:number}var dragMouseEvents=["mousemove","mouseup"],dragTouchEvents=["touchmove","touchend"],wheelEvent=document.implementation.hasFeature("Event.wheel","3.0")?"wheel":"mousewheel",interactiveElements=["INPUT","SELECT","TEXTAREA"],abs=Math.abs,sqrt=Math.sqrt,pow=Math.pow,round=Math.round,max=Math.max,scrollerFactory=(Math.min,function(frame,options){function sibling(n,elem){for(var matched=[];n;n=n.nextSibling)1===n.nodeType&&n!==elem&&matched.push(n);return matched}function ensureSizeInfo(){requiresReflow&&(requiresReflow=!1,frameSize=o.horizontal?frame.offsetWidth:frame.offsetHeight,slideeSize=o.scrollWidth||Math.max(slideeElement[o.horizontal?"offsetWidth":"offsetHeight"],slideeElement[o.horizontal?"scrollWidth":"scrollHeight"]),self._pos.end=max(slideeSize-frameSize,0))}function load(isInit){if(requiresReflow=!0,!isInit){ensureSizeInfo();var pos=self._pos;self.slideTo(within(pos.dest,pos.start,pos.end))}}function initFrameResizeObserver(){var observerOptions={};self.frameResizeObserver=new ResizeObserver(onResize,observerOptions),self.frameResizeObserver.observe(frame)}function nativeScrollTo(container,pos,immediate){container.scroll?o.horizontal?container.scroll({left:pos,behavior:immediate?"instant":"smooth"}):container.scroll({top:pos,behavior:immediate?"instant":"smooth"}):!immediate&&container.scrollTo?o.horizontal?container.scrollTo(Math.round(pos),0):container.scrollTo(0,Math.round(pos)):o.horizontal?container.scrollLeft=Math.round(pos):container.scrollTop=Math.round(pos)}function setStyleProperty(elem,name,value,speed,resetTransition){var style=elem.style;(resetTransition||browser.edge)&&(style.transition="none",void elem.offsetWidth),style.transition="transform "+speed+"ms ease-out",style[name]=value}function dispatchScrollEventIfNeeded(){o.dispatchScrollEvent&&frame.dispatchEvent(new CustomEvent(self.getScrollEventName(),{bubbles:!0,cancelable:!1}))}function renderAnimateWithTransform(fromPosition,toPosition,immediate){var speed=o.speed;immediate&&(speed=o.immediateSpeed||50),o.horizontal?setStyleProperty(slideeElement,"transform","translateX("+-round(toPosition)+"px)",speed):setStyleProperty(slideeElement,"transform","translateY("+-round(toPosition)+"px)",speed),self._pos.cur=toPosition,dispatchScrollEventIfNeeded()}function getBoundingClientRect(elem){return elem.getBoundingClientRect?elem.getBoundingClientRect():{top:0,left:0}}function dragInitSlidee(event){var isTouch="touchstart"===event.type;if(!(dragging.init||!isTouch&&isInteractive(event.target))&&(isTouch?o.touchDragging:o.mouseDragging&&event.which<2)){isTouch||event.preventDefault(),dragging.released=0,dragging.init=0,dragging.source=event.target,dragging.touch=isTouch;var pointer=isTouch?event.touches[0]:event;dragging.initX=pointer.pageX,dragging.initY=pointer.pageY,dragging.initPos=self._pos.cur,dragging.start=+new Date,dragging.time=0,dragging.path=0,dragging.delta=0,dragging.locked=0,dragging.pathToLock=isTouch?30:10,transform&&(isTouch?dragTouchEvents.forEach(function(eventName){dom.addEventListener(document,eventName,dragHandler,{passive:!0})}):dragMouseEvents.forEach(function(eventName){dom.addEventListener(document,eventName,dragHandler,{passive:!0})}))}}function dragHandler(event){dragging.released="mouseup"===event.type||"touchend"===event.type;var pointer=dragging.touch?event[dragging.released?"changedTouches":"touches"][0]:event;if(dragging.pathX=pointer.pageX-dragging.initX,dragging.pathY=pointer.pageY-dragging.initY,dragging.path=sqrt(pow(dragging.pathX,2)+pow(dragging.pathY,2)),dragging.delta=o.horizontal?dragging.pathX:dragging.pathY,dragging.released||!(dragging.path<1)){if(!dragging.init){if(dragging.pathabs(dragging.pathY):abs(dragging.pathX)dragging.pathToLock&&(dragging.locked=1,dragging.source.addEventListener("click",disableOneEvent)),dragging.released&&dragEnd(),self.slideTo(round(dragging.initPos-dragging.delta))}}function dragEnd(){dragging.released=!0,dragTouchEvents.forEach(function(eventName){dom.removeEventListener(document,eventName,dragHandler,{passive:!0})}),dragMouseEvents.forEach(function(eventName){dom.removeEventListener(document,eventName,dragHandler,{passive:!0})}),setTimeout(function(){dragging.source.removeEventListener("click",disableOneEvent)}),dragging.init=0}function isInteractive(element){for(;element;){if(interactiveElements.indexOf(element.tagName)!==-1)return!0;element=element.parentNode}return!1}function normalizeWheelDelta(event){return scrolling.curDelta=(o.horizontal?event.deltaY||event.deltaX:event.deltaY)||-event.wheelDelta,transform&&(scrolling.curDelta/=1===event.deltaMode?3:100),scrolling.curDelta}function scrollHandler(event){ensureSizeInfo();var pos=self._pos;if(o.scrollBy&&pos.start!==pos.end){var delta=normalizeWheelDelta(event);transform?(delta>0&&pos.destpos.start,self.slideBy(o.scrollBy*delta)):(isSmoothScrollSupported&&(delta*=12),o.horizontal?nativeScrollElement.scrollLeft+=delta:nativeScrollElement.scrollTop+=delta)}}function onResize(entries){var entry=entries[0];if(entry){var newRect=entry.contentRect;if(0===newRect.width||0===newRect.height)return;newRect.width===contentRect.width&&newRect.height===contentRect.height||(contentRect=newRect,load(!1))}}function resetScroll(){o.horizontal?this.scrollLeft=0:this.scrollTop=0}function onFrameClick(e){if(1===e.which){var focusableParent=focusManager.focusableParent(e.target);focusableParent&&focusableParent!==document.activeElement&&focusableParent.focus()}}var o=Object.assign({},{slidee:null,horizontal:!1,mouseWheel:!0,scrollBy:0,dragSource:null,mouseDragging:1,touchDragging:1,dragThreshold:3,intervactive:null,speed:0},options),isSmoothScrollSupported="scrollBehavior"in document.documentElement.style;options.allowNativeScroll===!1?options.enableNativeScroll=!1:isSmoothScrollSupported&&(browser.firefox&&!layoutManager.tv||options.allowNativeSmoothScroll)?options.enableNativeScroll=!0:options.requireAnimation&&(browser.animate||browser.supportsCssAnimation())?options.enableNativeScroll=!1:layoutManager.tv&&browser.animate||(options.enableNativeScroll=!0),browser.web0s&&(options.enableNativeScroll=!0);var self=this;self.options=o;var slideeElement=o.slidee?o.slidee:sibling(frame.firstChild)[0];self._pos={start:0,center:0,end:0,cur:0,dest:0};var transform=!options.enableNativeScroll,scrollSource=frame,dragSourceElement=o.dragSource?o.dragSource:frame,dragging={released:1},scrolling={last:0,delta:0,resetTime:200};self.initialized=0,self.slidee=slideeElement,self.options=o,self.dragging=dragging;var nativeScrollElement=frame,requiresReflow=!0,frameSize=0,slideeSize=0;self.reload=function(){load()},self.getScrollEventName=function(){return transform?"scrollanimate":"scroll"},self.getScrollSlider=function(){return slideeElement},self.getScrollFrame=function(){return frame};var lastAnimate;self.slideTo=function(newPos,immediate,fullItemPos){ensureSizeInfo();var pos=self._pos;if(newPos=within(newPos,pos.start,pos.end),!transform)return void nativeScrollTo(nativeScrollElement,newPos,immediate);var from=pos.cur;immediate=immediate||dragging.init||!o.speed;var now=(new Date).getTime();o.autoImmediate&&!immediate&&now-(lastAnimate||0)<=50&&(immediate=!0),!immediate&&o.skipSlideToWhenVisible&&fullItemPos&&fullItemPos.isVisible||newPos!==pos.dest&&(pos.dest=newPos,renderAnimateWithTransform(from,newPos,immediate),lastAnimate=now)},self.getPos=function(item){var scrollElement=transform?slideeElement:nativeScrollElement,slideeOffset=getBoundingClientRect(scrollElement),itemOffset=getBoundingClientRect(item),offset=(o.horizontal?slideeOffset.left:slideeOffset.top,o.horizontal?slideeOffset.right:slideeOffset.bottom,o.horizontal?itemOffset.left-slideeOffset.left:itemOffset.top-slideeOffset.top),size=o.horizontal?itemOffset.width:itemOffset.height;size||0===size||(size=item[o.horizontal?"offsetWidth":"offsetHeight"]);var centerOffset=o.centerOffset||0;transform||(centerOffset=0,offset+=o.horizontal?nativeScrollElement.scrollLeft:nativeScrollElement.scrollTop),ensureSizeInfo();var currentStart=self._pos.cur,currentEnd=currentStart+frameSize,isVisible=offset>=currentStart&&offset+size<=currentEnd;return{start:offset,center:offset+centerOffset-frameSize/2+size/2,end:offset-frameSize+size,size:size,isVisible:isVisible}},self.getCenterPosition=function(item){ensureSizeInfo();var pos=self.getPos(item);return within(pos.center,pos.start,pos.end)},self.destroy=function(){return self.frameResizeObserver&&(self.frameResizeObserver.disconnect(),self.frameResizeObserver=null),dom.removeEventListener(frame,"scroll",resetScroll,{passive:!0}),dom.removeEventListener(scrollSource,wheelEvent,scrollHandler,{passive:!0}),dom.removeEventListener(dragSourceElement,"touchstart",dragInitSlidee,{passive:!0}),dom.removeEventListener(frame,"click",onFrameClick,{passive:!0,capture:!0}),dom.removeEventListener(dragSourceElement,"mousedown",dragInitSlidee,{}),self.initialized=0,self};var contentRect={};self.getScrollPosition=function(){return transform?self._pos.cur:o.horizontal?nativeScrollElement.scrollLeft:nativeScrollElement.scrollTop},self.getScrollSize=function(){return transform?slideeSize:o.horizontal?nativeScrollElement.scrollWidth:nativeScrollElement.scrollHeight},self.init=function(){if(!self.initialized)return transform?(frame.style.overflow="hidden",slideeElement.style["will-change"]="transform",slideeElement.style.transition="transform "+o.speed+"ms ease-out",o.horizontal?slideeElement.classList.add("animatedScrollX"):slideeElement.classList.add("animatedScrollY")):o.horizontal?(layoutManager.desktop&&!o.hideScrollbar?nativeScrollElement.classList.add("scrollX"):(nativeScrollElement.classList.add("scrollX"),nativeScrollElement.classList.add("hiddenScrollX"),layoutManager.tv&&o.allowNativeSmoothScroll!==!1&&nativeScrollElement.classList.add("smoothScrollX")),o.forceHideScrollbars&&nativeScrollElement.classList.add("hiddenScrollX-forced")):(layoutManager.desktop&&!o.hideScrollbar?nativeScrollElement.classList.add("scrollY"):(nativeScrollElement.classList.add("scrollY"),nativeScrollElement.classList.add("hiddenScrollY"),layoutManager.tv&&o.allowNativeSmoothScroll!==!1&&nativeScrollElement.classList.add("smoothScrollY")),o.forceHideScrollbars&&nativeScrollElement.classList.add("hiddenScrollY-forced")),(transform||layoutManager.tv)&&dom.addEventListener(dragSourceElement,"mousedown",dragInitSlidee,{}),initFrameResizeObserver(),transform?(dom.addEventListener(dragSourceElement,"touchstart",dragInitSlidee,{passive:!0}),o.horizontal||dom.addEventListener(frame,"scroll",resetScroll,{passive:!0}),o.mouseWheel&&dom.addEventListener(scrollSource,wheelEvent,scrollHandler,{passive:!0})):o.horizontal&&o.mouseWheel&&dom.addEventListener(scrollSource,wheelEvent,scrollHandler,{passive:!0}),dom.addEventListener(frame,"click",onFrameClick,{passive:!0,capture:!0}),self.initialized=1,load(!0),self}});return scrollerFactory.prototype.slideBy=function(delta,immediate){delta&&this.slideTo(this._pos.dest+delta,immediate)},scrollerFactory.prototype.to=function(location,item,immediate){if("boolean"===type(item)&&(immediate=item,item=void 0),void 0===item)this.slideTo(this._pos[location],immediate);else{var itemPos=this.getPos(item);itemPos&&this.slideTo(itemPos[location],immediate,itemPos)}},scrollerFactory.prototype.toStart=function(item,immediate){this.to("start",item,immediate)},scrollerFactory.prototype.toEnd=function(item,immediate){this.to("end",item,immediate)},scrollerFactory.prototype.toCenter=function(item,immediate){this.to("center",item,immediate)},scrollerFactory.create=function(frame,options){var instance=new scrollerFactory(frame,options);return Promise.resolve(instance)},scrollerFactory}); \ No newline at end of file +define(["browser","layoutManager","dom","focusManager","ResizeObserver","scrollStyles"],function(browser,layoutManager,dom,focusManager,ResizeObserver){"use strict";function type(value){return null==value?String(value):"object"==typeof value||"function"==typeof value?Object.prototype.toString.call(value).match(/\s([a-z]+)/i)[1].toLowerCase()||"object":typeof value}function disableOneEvent(event){event.preventDefault(),event.stopPropagation(),this.removeEventListener(event.type,disableOneEvent)}function within(number,min,max){return numbermax?max:number}var dragMouseEvents=["mousemove","mouseup"],dragTouchEvents=["touchmove","touchend"],wheelEvent=document.implementation.hasFeature("Event.wheel","3.0")?"wheel":"mousewheel",interactiveElements=["INPUT","SELECT","TEXTAREA"],abs=Math.abs,sqrt=Math.sqrt,pow=Math.pow,round=Math.round,max=Math.max,scrollerFactory=(Math.min,function(frame,options){function ensureSizeInfo(){requiresReflow&&(requiresReflow=!1,frameSize=o.horizontal?frame.offsetWidth:frame.offsetHeight,slideeSize=o.scrollWidth||Math.max(slideeElement[o.horizontal?"offsetWidth":"offsetHeight"],slideeElement[o.horizontal?"scrollWidth":"scrollHeight"]),self._pos.end=max(slideeSize-frameSize,0))}function load(isInit){if(requiresReflow=!0,!isInit){ensureSizeInfo();var pos=self._pos;self.slideTo(within(pos.dest,pos.start,pos.end))}}function initFrameResizeObserver(){var observerOptions={};self.frameResizeObserver=new ResizeObserver(onResize,observerOptions),self.frameResizeObserver.observe(frame)}function nativeScrollTo(container,pos,immediate){container.scroll?o.horizontal?container.scroll({left:pos,behavior:immediate?"instant":"smooth"}):container.scroll({top:pos,behavior:immediate?"instant":"smooth"}):!immediate&&container.scrollTo?o.horizontal?container.scrollTo(Math.round(pos),0):container.scrollTo(0,Math.round(pos)):o.horizontal?container.scrollLeft=Math.round(pos):container.scrollTop=Math.round(pos)}function setStyleProperty(elem,name,value,speed,resetTransition){var style=elem.style;(resetTransition||browser.edge)&&(style.transition="none",elem.offsetWidth),style.transition="transform "+speed+"ms ease-out",style[name]=value}function dispatchScrollEventIfNeeded(){o.dispatchScrollEvent&&frame.dispatchEvent(new CustomEvent(self.getScrollEventName(),{bubbles:!0,cancelable:!1}))}function renderAnimateWithTransform(fromPosition,toPosition,immediate){var speed=o.speed;immediate&&(speed=o.immediateSpeed||50),o.horizontal?setStyleProperty(slideeElement,"transform","translateX("+-round(toPosition)+"px)",speed):setStyleProperty(slideeElement,"transform","translateY("+-round(toPosition)+"px)",speed),self._pos.cur=toPosition,dispatchScrollEventIfNeeded()}function getBoundingClientRect(elem){return elem.getBoundingClientRect?elem.getBoundingClientRect():{top:0,left:0}}function dragInitSlidee(event){var isTouch="touchstart"===event.type;if(!(dragging.init||!isTouch&&isInteractive(event.target))&&(isTouch?o.touchDragging:o.mouseDragging&&event.which<2)){isTouch||event.preventDefault(),dragging.released=0,dragging.init=0,dragging.source=event.target,dragging.touch=isTouch;var pointer=isTouch?event.touches[0]:event;dragging.initX=pointer.pageX,dragging.initY=pointer.pageY,dragging.initPos=self._pos.cur,dragging.start=+new Date,dragging.time=0,dragging.path=0,dragging.delta=0,dragging.locked=0,dragging.pathToLock=isTouch?30:10,transform&&(isTouch?dragTouchEvents.forEach(function(eventName){dom.addEventListener(document,eventName,dragHandler,{passive:!0})}):dragMouseEvents.forEach(function(eventName){dom.addEventListener(document,eventName,dragHandler,{passive:!0})}))}}function dragHandler(event){dragging.released="mouseup"===event.type||"touchend"===event.type;var pointer=dragging.touch?event[dragging.released?"changedTouches":"touches"][0]:event;if(dragging.pathX=pointer.pageX-dragging.initX,dragging.pathY=pointer.pageY-dragging.initY,dragging.path=sqrt(pow(dragging.pathX,2)+pow(dragging.pathY,2)),dragging.delta=o.horizontal?dragging.pathX:dragging.pathY,dragging.released||!(dragging.path<1)){if(!dragging.init){if(dragging.pathabs(dragging.pathY):abs(dragging.pathX)dragging.pathToLock&&(dragging.locked=1,dragging.source.addEventListener("click",disableOneEvent)),dragging.released&&dragEnd(),self.slideTo(round(dragging.initPos-dragging.delta))}}function dragEnd(){dragging.released=!0,dragTouchEvents.forEach(function(eventName){dom.removeEventListener(document,eventName,dragHandler,{passive:!0})}),dragMouseEvents.forEach(function(eventName){dom.removeEventListener(document,eventName,dragHandler,{passive:!0})}),setTimeout(function(){dragging.source.removeEventListener("click",disableOneEvent)}),dragging.init=0}function isInteractive(element){for(;element;){if(-1!==interactiveElements.indexOf(element.tagName))return!0;element=element.parentNode}return!1}function normalizeWheelDelta(event){return scrolling.curDelta=(o.horizontal?event.deltaY||event.deltaX:event.deltaY)||-event.wheelDelta,transform&&(scrolling.curDelta/=1===event.deltaMode?3:100),scrolling.curDelta}function scrollHandler(event){ensureSizeInfo();var pos=self._pos;if(o.scrollBy&&pos.start!==pos.end){var delta=normalizeWheelDelta(event);transform?(delta>0&&pos.dest=currentStart&&offset+size<=currentEnd}},self.getCenterPosition=function(item){ensureSizeInfo();var pos=self.getPos(item);return within(pos.center,pos.start,pos.end)},self.destroy=function(){return self.frameResizeObserver&&(self.frameResizeObserver.disconnect(),self.frameResizeObserver=null),dom.removeEventListener(frame,"scroll",resetScroll,{passive:!0}),dom.removeEventListener(scrollSource,wheelEvent,scrollHandler,{passive:!0}),dom.removeEventListener(dragSourceElement,"touchstart",dragInitSlidee,{passive:!0}),dom.removeEventListener(frame,"click",onFrameClick,{passive:!0,capture:!0}),dom.removeEventListener(dragSourceElement,"mousedown",dragInitSlidee,{}),self.initialized=0,self};var contentRect={};self.getScrollPosition=function(){return transform?self._pos.cur:o.horizontal?nativeScrollElement.scrollLeft:nativeScrollElement.scrollTop},self.getScrollSize=function(){return transform?slideeSize:o.horizontal?nativeScrollElement.scrollWidth:nativeScrollElement.scrollHeight},self.init=function(){if(!self.initialized)return transform?(frame.style.overflow="hidden",slideeElement.style["will-change"]="transform",slideeElement.style.transition="transform "+o.speed+"ms ease-out",o.horizontal?slideeElement.classList.add("animatedScrollX"):slideeElement.classList.add("animatedScrollY")):o.horizontal?(layoutManager.desktop&&!o.hideScrollbar?nativeScrollElement.classList.add("scrollX"):(nativeScrollElement.classList.add("scrollX"),nativeScrollElement.classList.add("hiddenScrollX"),layoutManager.tv&&!1!==o.allowNativeSmoothScroll&&nativeScrollElement.classList.add("smoothScrollX")),o.forceHideScrollbars&&nativeScrollElement.classList.add("hiddenScrollX-forced")):(layoutManager.desktop&&!o.hideScrollbar?nativeScrollElement.classList.add("scrollY"):(nativeScrollElement.classList.add("scrollY"),nativeScrollElement.classList.add("hiddenScrollY"),layoutManager.tv&&!1!==o.allowNativeSmoothScroll&&nativeScrollElement.classList.add("smoothScrollY")),o.forceHideScrollbars&&nativeScrollElement.classList.add("hiddenScrollY-forced")),(transform||layoutManager.tv)&&dom.addEventListener(dragSourceElement,"mousedown",dragInitSlidee,{}),initFrameResizeObserver(),transform?(dom.addEventListener(dragSourceElement,"touchstart",dragInitSlidee,{passive:!0}),o.horizontal||dom.addEventListener(frame,"scroll",resetScroll,{passive:!0}),o.mouseWheel&&dom.addEventListener(scrollSource,wheelEvent,scrollHandler,{passive:!0})):o.horizontal&&o.mouseWheel&&dom.addEventListener(scrollSource,wheelEvent,scrollHandler,{passive:!0}),dom.addEventListener(frame,"click",onFrameClick,{passive:!0,capture:!0}),self.initialized=1,load(!0),self}});return scrollerFactory.prototype.slideBy=function(delta,immediate){delta&&this.slideTo(this._pos.dest+delta,immediate)},scrollerFactory.prototype.to=function(location,item,immediate){if("boolean"===type(item)&&(immediate=item,item=void 0),void 0===item)this.slideTo(this._pos[location],immediate);else{var itemPos=this.getPos(item);itemPos&&this.slideTo(itemPos[location],immediate,itemPos)}},scrollerFactory.prototype.toStart=function(item,immediate){this.to("start",item,immediate)},scrollerFactory.prototype.toEnd=function(item,immediate){this.to("end",item,immediate)},scrollerFactory.prototype.toCenter=function(item,immediate){this.to("center",item,immediate)},scrollerFactory.create=function(frame,options){var instance=new scrollerFactory(frame,options);return Promise.resolve(instance)},scrollerFactory}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/scrollhelper.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/scrollhelper.js index 411919893d..6e397f060f 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/scrollhelper.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/scrollhelper.js @@ -1 +1 @@ -define(["focusManager","dom","scrollStyles"],function(focusManager,dom){"use strict";function getBoundingClientRect(elem){return elem.getBoundingClientRect?elem.getBoundingClientRect():{top:0,left:0}}function getPosition(scrollContainer,item,horizontal){var slideeOffset=getBoundingClientRect(scrollContainer),itemOffset=getBoundingClientRect(item),offset=horizontal?itemOffset.left-slideeOffset.left:itemOffset.top-slideeOffset.top,size=horizontal?itemOffset.width:itemOffset.height;size||0===size||(size=item[horizontal?"offsetWidth":"offsetHeight"]);var currentStart=horizontal?scrollContainer.scrollLeft:scrollContainer.scrollTop;offset+=currentStart;var frameSize=horizontal?scrollContainer.offsetWidth:scrollContainer.offsetHeight,currentEnd=currentStart+frameSize,isVisible=offset>=currentStart&&offset+size<=currentEnd;return{start:offset,center:offset-frameSize/2+size/2,end:offset-frameSize+size,size:size,isVisible:isVisible}}function toCenter(container,elem,horizontal,skipWhenVisible){var pos=getPosition(container,elem,horizontal);skipWhenVisible&&pos.isVisible||(container.scrollTo?horizontal?container.scrollTo(pos.center,0):container.scrollTo(0,pos.center):horizontal?container.scrollLeft=Math.round(pos.center):container.scrollTop=Math.round(pos.center))}function toStart(container,elem,horizontal,skipWhenVisible){var pos=getPosition(container,elem,horizontal);skipWhenVisible&&pos.isVisible||(container.scrollTo?horizontal?container.scrollTo(pos.start,0):container.scrollTo(0,pos.start):horizontal?container.scrollLeft=Math.round(pos.start):container.scrollTop=Math.round(pos.start))}function centerOnFocus(e,scrollSlider,horizontal){var focused=focusManager.focusableParent(e.target);focused&&toCenter(scrollSlider,focused,horizontal)}function centerOnFocusHorizontal(e){centerOnFocus(e,this,!0)}function centerOnFocusVertical(e){centerOnFocus(e,this,!1)}return{getPosition:getPosition,centerFocus:{on:function(element,horizontal){horizontal?dom.addEventListener(element,"focus",centerOnFocusHorizontal,{capture:!0,passive:!0}):dom.addEventListener(element,"focus",centerOnFocusVertical,{capture:!0,passive:!0})},off:function(element,horizontal){horizontal?dom.removeEventListener(element,"focus",centerOnFocusHorizontal,{capture:!0,passive:!0}):dom.removeEventListener(element,"focus",centerOnFocusVertical,{capture:!0,passive:!0})}},toCenter:toCenter,toStart:toStart}}); \ No newline at end of file +define(["focusManager","dom","scrollStyles"],function(focusManager,dom){"use strict";function getBoundingClientRect(elem){return elem.getBoundingClientRect?elem.getBoundingClientRect():{top:0,left:0}}function getPosition(scrollContainer,item,horizontal){var slideeOffset=getBoundingClientRect(scrollContainer),itemOffset=getBoundingClientRect(item),offset=horizontal?itemOffset.left-slideeOffset.left:itemOffset.top-slideeOffset.top,size=horizontal?itemOffset.width:itemOffset.height;size||0===size||(size=item[horizontal?"offsetWidth":"offsetHeight"]);var currentStart=horizontal?scrollContainer.scrollLeft:scrollContainer.scrollTop;offset+=currentStart;var frameSize=horizontal?scrollContainer.offsetWidth:scrollContainer.offsetHeight,currentEnd=currentStart+frameSize;return{start:offset,center:offset-frameSize/2+size/2,end:offset-frameSize+size,size:size,isVisible:offset>=currentStart&&offset+size<=currentEnd}}function toCenter(container,elem,horizontal,skipWhenVisible){var pos=getPosition(container,elem,horizontal);skipWhenVisible&&pos.isVisible||(container.scrollTo?horizontal?container.scrollTo(pos.center,0):container.scrollTo(0,pos.center):horizontal?container.scrollLeft=Math.round(pos.center):container.scrollTop=Math.round(pos.center))}function toStart(container,elem,horizontal,skipWhenVisible){var pos=getPosition(container,elem,horizontal);skipWhenVisible&&pos.isVisible||(container.scrollTo?horizontal?container.scrollTo(pos.start,0):container.scrollTo(0,pos.start):horizontal?container.scrollLeft=Math.round(pos.start):container.scrollTop=Math.round(pos.start))}function centerOnFocus(e,scrollSlider,horizontal){var focused=focusManager.focusableParent(e.target);focused&&toCenter(scrollSlider,focused,horizontal)}function centerOnFocusHorizontal(e){centerOnFocus(e,this,!0)}function centerOnFocusVertical(e){centerOnFocus(e,this,!1)}return{getPosition:getPosition,centerFocus:{on:function(element,horizontal){horizontal?dom.addEventListener(element,"focus",centerOnFocusHorizontal,{capture:!0,passive:!0}):dom.addEventListener(element,"focus",centerOnFocusVertical,{capture:!0,passive:!0})},off:function(element,horizontal){horizontal?dom.removeEventListener(element,"focus",centerOnFocusHorizontal,{capture:!0,passive:!0}):dom.removeEventListener(element,"focus",centerOnFocusVertical,{capture:!0,passive:!0})}},toCenter:toCenter,toStart:toStart}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/search/searchfields.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/search/searchfields.js index b44a1c0ff9..e1bb9d6718 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/search/searchfields.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/search/searchfields.js @@ -1 +1 @@ -define(["layoutManager","globalize","require","events","browser","alphaPicker","emby-input","flexStyles","material-icons","css!./searchfields"],function(layoutManager,globalize,require,events,browser,AlphaPicker){"use strict";function onSearchTimeout(){var instance=this,value=instance.nextSearchValue;value=(value||"").trim(),events.trigger(instance,"search",[value])}function triggerSearch(instance,value){instance.searchTimeout&&clearTimeout(instance.searchTimeout),instance.nextSearchValue=value,instance.searchTimeout=setTimeout(onSearchTimeout.bind(instance),300)}function onAlphaValueClicked(e){var value=e.detail.value,searchFieldsInstance=this,txtSearch=searchFieldsInstance.options.element.querySelector(".searchfields-txtSearch");if("backspace"===value){var val=txtSearch.value;txtSearch.value=val.length?val.substring(0,val.length-1):""}else txtSearch.value+=value;txtSearch.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}function initAlphaPicker(alphaPickerElement,instance){instance.alphaPicker=new AlphaPicker({element:alphaPickerElement,mode:"keyboard"}),alphaPickerElement.addEventListener("alphavalueclicked",onAlphaValueClicked.bind(instance))}function onSearchInput(e){var value=e.target.value,searchFieldsInstance=this;triggerSearch(searchFieldsInstance,value)}function embed(elem,instance,options){require(["text!./searchfields.template.html"],function(template){var html=globalize.translateDocument(template,"sharedcomponents");(browser.tizen||browser.orsay)&&(html=html.replace("';return itemHtml+=i.Name,itemHtml+=""}).join(""),searchSuggestions=context.querySelector(".searchSuggestions");searchSuggestions.querySelector(".searchSuggestionsList").innerHTML=html,result.Items.length&&searchSuggestions.classList.remove("hide")})}function getSearchHints(instance,apiClient,query){if(!query.searchTerm)return Promise.resolve({SearchHints:[]});var allowSearch=!0,queryIncludeItemTypes=query.IncludeItemTypes;return"tvshows"===instance.options.collectionType?query.IncludeArtists?allowSearch=!1:"Movie"!==queryIncludeItemTypes&&"LiveTvProgram"!==queryIncludeItemTypes&&"MusicAlbum"!==queryIncludeItemTypes&&"Audio"!==queryIncludeItemTypes&&"Book"!==queryIncludeItemTypes&&"AudioBook"!==queryIncludeItemTypes&&"Video"!==query.MediaTypes&&"Photo"!==query.MediaTypes||(allowSearch=!1):"movies"===instance.options.collectionType?query.IncludeArtists?allowSearch=!1:"Series"!==queryIncludeItemTypes&&"Episode"!==queryIncludeItemTypes&&"LiveTvProgram"!==queryIncludeItemTypes&&"MusicAlbum"!==queryIncludeItemTypes&&"Audio"!==queryIncludeItemTypes&&"Book"!==queryIncludeItemTypes&&"AudioBook"!==queryIncludeItemTypes&&"Video"!==query.MediaTypes&&"Photo"!==query.MediaTypes||(allowSearch=!1):"music"===instance.options.collectionType?query.People?allowSearch=!1:"Series"!==queryIncludeItemTypes&&"Episode"!==queryIncludeItemTypes&&"LiveTvProgram"!==queryIncludeItemTypes&&"Movie"!==queryIncludeItemTypes||(allowSearch=!1):"livetv"===instance.options.collectionType&&(query.IncludeArtists||query.IncludePeople?allowSearch=!1:"Series"!==queryIncludeItemTypes&&"Episode"!==queryIncludeItemTypes&&"MusicAlbum"!==queryIncludeItemTypes&&"Audio"!==queryIncludeItemTypes&&"Book"!==queryIncludeItemTypes&&"AudioBook"!==queryIncludeItemTypes&&"Movie"!==queryIncludeItemTypes&&"Video"!==query.MediaTypes&&"Photo"!==query.MediaTypes||(allowSearch=!1)),"NullType"===queryIncludeItemTypes&&(allowSearch=!1),allowSearch?apiClient.getSearchHints(query):Promise.resolve({SearchHints:[]})}function search(instance,apiClient,context,value){value||layoutManager.tv?(instance.mode="search",context.querySelector(".searchSuggestions").classList.add("hide")):(instance.mode="suggestions",loadSuggestions(instance,context,apiClient)),"livetv"===instance.options.collectionType?searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"LiveTvProgram",IsMovie:!0,IsKids:!1,IsNews:!1},context,".movieResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowPortrait":"portrait",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}):searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"Movie"},context,".movieResults",{showTitle:!0,overlayText:!1,centerText:!0,showYear:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"Series"},context,".seriesResults",{showTitle:!0,overlayText:!1,centerText:!0,showYear:!0}),"livetv"===instance.options.collectionType?searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"LiveTvProgram",IsSeries:!0,IsSports:!1,IsKids:!1,IsNews:!1},context,".episodeResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowBackdrop":"backdrop",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}):searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"Episode"},context,".episodeResults",{coverImage:!0,showTitle:!0,showParentTitle:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"livetv"===instance.options.collectionType?"LiveTvProgram":"NullType",IsSports:!0},context,".sportsResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowBackdrop":"backdrop",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"livetv"===instance.options.collectionType?"LiveTvProgram":"NullType",IsKids:!0},context,".kidsResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowBackdrop":"backdrop",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"livetv"===instance.options.collectionType?"LiveTvProgram":"NullType",IsNews:!0},context,".newsResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowBackdrop":"backdrop",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"LiveTvProgram",IsMovie:"livetv"!==instance.options.collectionType&&null,IsSeries:"livetv"!==instance.options.collectionType&&null,IsSports:"livetv"!==instance.options.collectionType&&null,IsKids:"livetv"!==instance.options.collectionType&&null,IsNews:"livetv"!==instance.options.collectionType&&null},context,".programResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowBackdrop":"backdrop",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,MediaTypes:"Video",ExcludeItemTypes:"Movie,Episode"},context,".videoResults",{showParentTitle:!0,showTitle:!0,overlayText:!1,centerText:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!0,IncludeMedia:!1,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1},context,".peopleResults",{coverImage:!0,showTitle:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!1,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!0},context,".artistResults",{coverImage:!0,showTitle:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"MusicAlbum"},context,".albumResults",{showParentTitle:!0,showTitle:!0,overlayText:!1,centerText:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"Audio"},context,".songResults",{showParentTitle:!0,showTitle:!0,overlayText:!1,centerText:!0,action:"play"}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,MediaTypes:"Photo"},context,".photoResults",{showParentTitle:!1,showTitle:!0,overlayText:!1,centerText:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"Book"},context,".bookResults",{showTitle:!0,overlayText:!1,centerText:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"AudioBook"},context,".audioBookResults",{showTitle:!0,overlayText:!1,centerText:!0})}function searchType(instance,apiClient,query,context,section,cardOptions){query.UserId=apiClient.getCurrentUserId(),query.Limit=enableScrollX()?24:16,query.ParentId=instance.options.parentId,getSearchHints(instance,apiClient,query).then(function(result){populateResults(result,context,section,cardOptions)})}function populateResults(result,context,section,cardOptions){section=context.querySelector(section);var items=result.SearchHints,itemsContainer=section.querySelector(".itemsContainer");cardBuilder.buildCards(items,Object.assign({itemsContainer:itemsContainer,parentContainer:section,shape:enableScrollX()?"autooverflow":"auto",scalable:!0,overlayText:!1,centerText:!0,allowBottomPadding:!enableScrollX()},cardOptions||{})),section.querySelector(".emby-scroller").scrollToBeginning(!0)}function enableScrollX(){return!0}function replaceAll(originalString,strReplace,strWith){var reg=new RegExp(strReplace,"ig");return originalString.replace(reg,strWith)}function embed(elem,instance,options){require(["text!./searchresults.template.html"],function(template){enableScrollX()||(template=replaceAll(template,'data-horizontal="true"','data-horizontal="false"'),template=replaceAll(template,"itemsContainer scrollSlider","itemsContainer scrollSlider vertical-wrap"));var html=globalize.translateDocument(template,"sharedcomponents");elem.innerHTML=html,elem.classList.add("searchResults"),instance.search("")})}function SearchResults(options){this.options=options,embed(options.element,this,options)}return SearchResults.prototype.search=function(value){var apiClient=connectionManager.getApiClient(this.options.serverId);search(this,apiClient,this.options.element,value)},SearchResults.prototype.destroy=function(){var options=this.options;options&&options.element.classList.remove("searchFields"),this.options=null},SearchResults}); \ No newline at end of file +define(["layoutManager","globalize","require","events","connectionManager","cardBuilder","appRouter","emby-scroller","emby-itemscontainer","emby-linkbutton"],function(layoutManager,globalize,require,events,connectionManager,cardBuilder,appRouter){"use strict";function loadSuggestions(instance,context,apiClient){var options={SortBy:"IsFavoriteOrLiked,Random",IncludeItemTypes:"Movie,Series,MusicArtist",Limit:20,Recursive:!0,ImageTypeLimit:0,EnableImages:!1,ParentId:instance.options.parentId};apiClient.getItems(apiClient.getCurrentUserId(),options).then(function(result){"suggestions"!==instance.mode&&(result.Items=[]);var html=result.Items.map(function(i){var href=appRouter.getRouteUrl(i),itemHtml='"}).join(""),searchSuggestions=context.querySelector(".searchSuggestions");searchSuggestions.querySelector(".searchSuggestionsList").innerHTML=html,result.Items.length&&searchSuggestions.classList.remove("hide")})}function getSearchHints(instance,apiClient,query){if(!query.searchTerm)return Promise.resolve({SearchHints:[]});var allowSearch=!0,queryIncludeItemTypes=query.IncludeItemTypes;return"tvshows"===instance.options.collectionType?query.IncludeArtists?allowSearch=!1:"Movie"!==queryIncludeItemTypes&&"LiveTvProgram"!==queryIncludeItemTypes&&"MusicAlbum"!==queryIncludeItemTypes&&"Audio"!==queryIncludeItemTypes&&"Book"!==queryIncludeItemTypes&&"AudioBook"!==queryIncludeItemTypes&&"Video"!==query.MediaTypes&&"Photo"!==query.MediaTypes||(allowSearch=!1):"movies"===instance.options.collectionType?query.IncludeArtists?allowSearch=!1:"Series"!==queryIncludeItemTypes&&"Episode"!==queryIncludeItemTypes&&"LiveTvProgram"!==queryIncludeItemTypes&&"MusicAlbum"!==queryIncludeItemTypes&&"Audio"!==queryIncludeItemTypes&&"Book"!==queryIncludeItemTypes&&"AudioBook"!==queryIncludeItemTypes&&"Video"!==query.MediaTypes&&"Photo"!==query.MediaTypes||(allowSearch=!1):"music"===instance.options.collectionType?query.People?allowSearch=!1:"Series"!==queryIncludeItemTypes&&"Episode"!==queryIncludeItemTypes&&"LiveTvProgram"!==queryIncludeItemTypes&&"Movie"!==queryIncludeItemTypes||(allowSearch=!1):"livetv"===instance.options.collectionType&&(query.IncludeArtists||query.IncludePeople?allowSearch=!1:"Series"!==queryIncludeItemTypes&&"Episode"!==queryIncludeItemTypes&&"MusicAlbum"!==queryIncludeItemTypes&&"Audio"!==queryIncludeItemTypes&&"Book"!==queryIncludeItemTypes&&"AudioBook"!==queryIncludeItemTypes&&"Movie"!==queryIncludeItemTypes&&"Video"!==query.MediaTypes&&"Photo"!==query.MediaTypes||(allowSearch=!1)),"NullType"===queryIncludeItemTypes&&(allowSearch=!1),allowSearch?apiClient.getSearchHints(query):Promise.resolve({SearchHints:[]})}function search(instance,apiClient,context,value){value||layoutManager.tv?(instance.mode="search",context.querySelector(".searchSuggestions").classList.add("hide")):(instance.mode="suggestions",loadSuggestions(instance,context,apiClient)),"livetv"===instance.options.collectionType?searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"LiveTvProgram",IsMovie:!0,IsKids:!1,IsNews:!1},context,".movieResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowPortrait":"portrait",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}):searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"Movie"},context,".movieResults",{showTitle:!0,overlayText:!1,centerText:!0,showYear:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"Series"},context,".seriesResults",{showTitle:!0,overlayText:!1,centerText:!0,showYear:!0}),"livetv"===instance.options.collectionType?searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"LiveTvProgram",IsSeries:!0,IsSports:!1,IsKids:!1,IsNews:!1},context,".episodeResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowBackdrop":"backdrop",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}):searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"Episode"},context,".episodeResults",{coverImage:!0,showTitle:!0,showParentTitle:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"livetv"===instance.options.collectionType?"LiveTvProgram":"NullType",IsSports:!0},context,".sportsResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowBackdrop":"backdrop",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"livetv"===instance.options.collectionType?"LiveTvProgram":"NullType",IsKids:!0},context,".kidsResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowBackdrop":"backdrop",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"livetv"===instance.options.collectionType?"LiveTvProgram":"NullType",IsNews:!0},context,".newsResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowBackdrop":"backdrop",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"LiveTvProgram",IsMovie:"livetv"!==instance.options.collectionType&&null,IsSeries:"livetv"!==instance.options.collectionType&&null,IsSports:"livetv"!==instance.options.collectionType&&null,IsKids:"livetv"!==instance.options.collectionType&&null,IsNews:"livetv"!==instance.options.collectionType&&null},context,".programResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowBackdrop":"backdrop",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,MediaTypes:"Video",ExcludeItemTypes:"Movie,Episode"},context,".videoResults",{showParentTitle:!0,showTitle:!0,overlayText:!1,centerText:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!0,IncludeMedia:!1,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1},context,".peopleResults",{coverImage:!0,showTitle:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!1,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!0},context,".artistResults",{coverImage:!0,showTitle:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"MusicAlbum"},context,".albumResults",{showParentTitle:!0,showTitle:!0,overlayText:!1,centerText:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"Audio"},context,".songResults",{showParentTitle:!0,showTitle:!0,overlayText:!1,centerText:!0,action:"play"}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,MediaTypes:"Photo"},context,".photoResults",{showParentTitle:!1,showTitle:!0,overlayText:!1,centerText:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"Book"},context,".bookResults",{showTitle:!0,overlayText:!1,centerText:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"AudioBook"},context,".audioBookResults",{showTitle:!0,overlayText:!1,centerText:!0})}function searchType(instance,apiClient,query,context,section,cardOptions){query.UserId=apiClient.getCurrentUserId(),query.Limit=enableScrollX()?24:16,query.ParentId=instance.options.parentId,getSearchHints(instance,apiClient,query).then(function(result){populateResults(result,context,section,cardOptions)})}function populateResults(result,context,section,cardOptions){section=context.querySelector(section);var items=result.SearchHints,itemsContainer=section.querySelector(".itemsContainer");cardBuilder.buildCards(items,Object.assign({itemsContainer:itemsContainer,parentContainer:section,shape:enableScrollX()?"autooverflow":"auto",scalable:!0,overlayText:!1,centerText:!0,allowBottomPadding:!enableScrollX()},cardOptions||{})),section.querySelector(".emby-scroller").scrollToBeginning(!0)}function enableScrollX(){return!0}function replaceAll(originalString,strReplace,strWith){var reg=new RegExp(strReplace,"ig");return originalString.replace(reg,strWith)}function embed(elem,instance,options){require(["text!./searchresults.template.html"],function(template){enableScrollX()||(template=replaceAll(template,'data-horizontal="true"','data-horizontal="false"'),template=replaceAll(template,"itemsContainer scrollSlider","itemsContainer scrollSlider vertical-wrap"));var html=globalize.translateDocument(template,"sharedcomponents");elem.innerHTML=html,elem.classList.add("searchResults"),instance.search("")})}function SearchResults(options){this.options=options,embed(options.element,this,options)}return SearchResults.prototype.search=function(value){search(this,connectionManager.getApiClient(this.options.serverId),this.options.element,value)},SearchResults.prototype.destroy=function(){var options=this.options;options&&options.element.classList.remove("searchFields"),this.options=null},SearchResults}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/serverrestartdialog/serverrestartdialog.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/serverrestartdialog/serverrestartdialog.js index 117512cc56..07a308114e 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/serverrestartdialog/serverrestartdialog.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/serverrestartdialog/serverrestartdialog.js @@ -1 +1 @@ -define(["loading","events","dialogHelper","dom","layoutManager","scrollHelper","globalize","require","material-icons","emby-button","paper-icon-button-light","emby-input","formDialogStyle","flexStyles"],function(loading,events,dialogHelper,dom,layoutManager,scrollHelper,globalize,require){"use strict";function reloadPageWhenServerAvailable(retryCount){var apiClient=currentApiClient;apiClient&&apiClient.getJSON(apiClient.getUrl("System/Info")).then(function(info){info.IsShuttingDown?retryReload(retryCount):(currentInstance.restarted=!0,dialogHelper.close(currentDlg))},function(){retryReload(retryCount)})}function retryReload(retryCount){setTimeout(function(){retryCount=retryCount||0,retryCount++,retryCount<150&&reloadPageWhenServerAvailable(retryCount)},500)}function startRestart(instance,apiClient,dlg){currentApiClient=apiClient,currentDlg=dlg,currentInstance=instance,apiClient.restartServer().then(function(){setTimeout(reloadPageWhenServerAvailable,250)})}function showDialog(instance,options,template){function onButtonClick(){dialogHelper.close(dlg)}var dialogOptions={removeOnClose:!0,scrollY:!1},enableTvLayout=layoutManager.tv;enableTvLayout&&(dialogOptions.size="fullscreen");var dlg=dialogHelper.createDialog(dialogOptions),configuredButtons=[];dlg.classList.add("formDialog"),dlg.innerHTML=globalize.translateHtml(template,"sharedcomponents"),dlg.classList.add("align-items-center"),dlg.classList.add("justify-items-center");var formDialogContent=dlg.querySelector(".formDialogContent");formDialogContent.style["flex-grow"]="initial",enableTvLayout?(formDialogContent.style["max-width"]="50%",formDialogContent.style["max-height"]="60%",scrollHelper.centerFocus.on(formDialogContent,!1)):(formDialogContent.style.maxWidth=Math.min(150*configuredButtons.length+200,dom.getWindowSize().innerWidth-50)+"px",dlg.classList.add("dialog-fullscreen-lowres")),dlg.querySelector(".formDialogHeaderTitle").innerHTML=globalize.translate("sharedcomponents#HeaderRestartingEmbyServer"),dlg.querySelector(".text").innerHTML=globalize.translate("sharedcomponents#RestartPleaseWaitMessage");var i,length,html="";for(i=0,length=configuredButtons.length;i"+item.name+""}dlg.querySelector(".formDialogFooter").innerHTML=html;var buttons=dlg.querySelectorAll(".btnOption");for(i=0,length=buttons.length;i"+item.name+""}dlg.querySelector(".formDialogFooter").innerHTML=html;var buttons=dlg.querySelectorAll(".btnOption");for(i=0,length=buttons.length;i=30?"halloween":id}function loadThemeResources(id){return lastSound=0,currentSound&&(currentSound.stop(),currentSound=null),backdrop.clear(),"halloween"===id?void(themeResources={themeSong:"https://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/monsterparadefade.mp3",effect:"https://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/howl.wav",backdrop:"https://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/bg.jpg"}):void(themeResources={})}function onViewBeforeShow(e){e.detail&&"video-osd"===e.detail.type||(themeResources.backdrop&&backdrop.setBackdrop(themeResources.backdrop),!browser.mobile&&userSettings.enableThemeSongs()&&(0===lastSound?themeResources.themeSong&&playSound(themeResources.themeSong):(new Date).getTime()-lastSound>3e4&&themeResources.effect&&playSound(themeResources.effect)))}function playSound(path,volume){lastSound=(new Date).getTime(),require(["howler"],function(howler){try{var sound=new Howl({src:[path],volume:volume||.1});sound.play(),currentSound=sound}catch(err){console.log("Error playing sound: "+err)}})}var currentSkin,cacheParam=(new Date).getTime();events.on(userSettings,"change",function(e,name){"skin"!==name&&"language"!==name||loadUserSkin()});var themeStyleElement,currentThemeId,currentSound,skinManager={getCurrentSkin:getCurrentSkin,loadSkin:loadSkin,loadUserSkin:loadUserSkin,getThemes:getThemes},themeResources={},lastSound=0;return skinManager.setTheme=function(id,context){return new Promise(function(resolve,reject){var requiresRegistration=!0;if("serverdashboard"!==context){var newId=modifyThemeForSeasonal(id);newId!==id&&(requiresRegistration=!1),id=newId}if(currentThemeId&¤tThemeId===id)return void resolve();var isDefaultProperty="serverdashboard"===context?"isDefaultServerDashboard":"isDefault",info=getThemeStylesheetInfo(id,requiresRegistration,isDefaultProperty);if(currentThemeId&¤tThemeId===info.themeId)return void resolve();var linkUrl=info.stylesheetPath;unloadTheme();var link=document.createElement("link");link.setAttribute("rel","stylesheet"),link.setAttribute("type","text/css"),link.onload=resolve,link.setAttribute("href",linkUrl),document.head.appendChild(link),themeStyleElement=link,currentThemeId=info.themeId,loadThemeResources(info.themeId),onViewBeforeShow({})})},document.addEventListener("viewshow",onViewBeforeShow),skinManager}); \ No newline at end of file +define(["userSettings","browser","events","pluginManager","backdrop","globalize","require","appSettings"],function(userSettings,browser,events,pluginManager,backdrop,globalize,require,appSettings){"use strict";function getCurrentSkin(){return currentSkin}function getRequirePromise(deps){return new Promise(function(resolve,reject){require(deps,resolve)})}function loadSkin(id){var newSkin=pluginManager.plugins().filter(function(p){return p.id===id})[0];newSkin||(newSkin=pluginManager.plugins().filter(function(p){return"defaultskin"===p.id})[0]);var unloadPromise;if(currentSkin){if(currentSkin.id===newSkin.id)return Promise.resolve(currentSkin);unloadPromise=unloadSkin(currentSkin)}else unloadPromise=Promise.resolve();return unloadPromise.then(function(){var deps=newSkin.getDependencies();return console.log("Loading skin dependencies"),getRequirePromise(deps).then(function(){console.log("Skin dependencies loaded");var strings=newSkin.getTranslations?newSkin.getTranslations():[];return globalize.loadStrings({name:newSkin.id,strings:strings}).then(function(){return globalize.defaultModule(newSkin.id),loadSkinHeader(newSkin)})})})}function unloadSkin(skin){return unloadTheme(),backdrop.clear(),console.log("Unloading skin: "+skin.name),skin.unload().then(function(){document.dispatchEvent(new CustomEvent("skinunload",{detail:{name:skin.name}}))})}function loadSkinHeader(skin){return getSkinHeader(skin).then(function(headerHtml){return document.querySelector(".skinHeader").innerHTML=headerHtml,currentSkin=skin,skin.load(),skin})}function getSkinHeader(skin){return new Promise(function(resolve,reject){if(!skin.getHeaderTemplate)return void resolve("");var xhr=new XMLHttpRequest,url=skin.getHeaderTemplate();url+=-1===url.indexOf("?")?"?":"&",url+="v="+cacheParam,xhr.open("GET",url,!0),xhr.onload=function(e){resolve(this.status<400?this.response:"")},xhr.send()})}function loadUserSkin(options){loadSkin(userSettings.get("skin",!1)||"defaultskin").then(function(skin){options=options||{},options.start?Emby.Page.invokeShortcut(options.start):Emby.Page.goHome()})}function unloadTheme(){var elem=themeStyleElement;elem&&(elem.parentNode.removeChild(elem),themeStyleElement=null,currentThemeId=null)}function getThemes(){return currentSkin.getThemes?currentSkin.getThemes():[]}function onRegistrationSuccess(){appSettings.set("appthemesregistered","true")}function onRegistrationFailure(){appSettings.set("appthemesregistered","false")}function isRegistered(){return getRequirePromise(["registrationServices"]).then(function(registrationServices){registrationServices.validateFeature("themes",{showDialog:!1}).then(onRegistrationSuccess,onRegistrationFailure)}),"false"!==appSettings.get("appthemesregistered")}function getThemeStylesheetInfo(id,requiresRegistration,isDefaultProperty){for(var defaultTheme,selectedTheme,themes=skinManager.getThemes(),i=0,length=themes.length;i=30?"halloween":id}function loadThemeResources(id){if(lastSound=0,currentSound&&(currentSound.stop(),currentSound=null),backdrop.clear(),"halloween"===id)return void(themeResources={themeSong:"https://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/monsterparadefade.mp3",effect:"https://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/howl.wav",backdrop:"https://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/bg.jpg"});themeResources={}}function onViewBeforeShow(e){e.detail&&"video-osd"===e.detail.type||(themeResources.backdrop&&backdrop.setBackdrop(themeResources.backdrop),!browser.mobile&&userSettings.enableThemeSongs()&&(0===lastSound?themeResources.themeSong&&playSound(themeResources.themeSong):(new Date).getTime()-lastSound>3e4&&themeResources.effect&&playSound(themeResources.effect)))}function playSound(path,volume){lastSound=(new Date).getTime(),require(["howler"],function(howler){try{var sound=new Howl({src:[path],volume:volume||.1});sound.play(),currentSound=sound}catch(err){console.log("Error playing sound: "+err)}})}var currentSkin,cacheParam=(new Date).getTime();events.on(userSettings,"change",function(e,name){"skin"!==name&&"language"!==name||loadUserSkin()});var themeStyleElement,currentThemeId,currentSound,skinManager={getCurrentSkin:getCurrentSkin,loadSkin:loadSkin,loadUserSkin:loadUserSkin,getThemes:getThemes},themeResources={},lastSound=0;return skinManager.setTheme=function(id,context){return new Promise(function(resolve,reject){var requiresRegistration=!0;if("serverdashboard"!==context){var newId=modifyThemeForSeasonal(id);newId!==id&&(requiresRegistration=!1),id=newId}if(currentThemeId&¤tThemeId===id)return void resolve();var isDefaultProperty="serverdashboard"===context?"isDefaultServerDashboard":"isDefault",info=getThemeStylesheetInfo(id,requiresRegistration,isDefaultProperty);if(currentThemeId&¤tThemeId===info.themeId)return void resolve();var linkUrl=info.stylesheetPath;unloadTheme();var link=document.createElement("link");link.setAttribute("rel","stylesheet"),link.setAttribute("type","text/css"),link.onload=resolve,link.setAttribute("href",linkUrl),document.head.appendChild(link),themeStyleElement=link,currentThemeId=info.themeId,loadThemeResources(info.themeId),onViewBeforeShow({})})},document.addEventListener("viewshow",onViewBeforeShow),skinManager}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/slideshow/slideshow.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/slideshow/slideshow.js index 6e0c316f85..92417b2a4a 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/slideshow/slideshow.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/slideshow/slideshow.js @@ -1 +1 @@ -define(["dialogHelper","inputManager","connectionManager","layoutManager","focusManager","browser","apphost","loading","css!./style","material-icons","paper-icon-button-light"],function(dialogHelper,inputmanager,connectionManager,layoutManager,focusManager,browser,appHost,loading){"use strict";function getImageUrl(item,options,apiClient){return options=options||{},options.type=options.type||"Primary","string"==typeof item?apiClient.getScaledImageUrl(item,options):item.ImageTags&&item.ImageTags[options.type]?(options.tag=item.ImageTags[options.type],apiClient.getScaledImageUrl(item.Id,options)):"Primary"===options.type&&item.AlbumId&&item.AlbumPrimaryImageTag?(options.tag=item.AlbumPrimaryImageTag,apiClient.getScaledImageUrl(item.AlbumId,options)):null}function getBackdropImageUrl(item,options,apiClient){return options=options||{},options.type=options.type||"Backdrop",options.maxWidth||options.width||options.maxHeight||options.height||(options.quality=100),item.BackdropImageTags&&item.BackdropImageTags.length?(options.tag=item.BackdropImageTags[0],apiClient.getScaledImageUrl(item.Id,options)):null}function getImgUrl(item,original){var apiClient=connectionManager.getApiClient(item.ServerId),imageOptions={};return original||(imageOptions.maxWidth=screen.availWidth),item.BackdropImageTags&&item.BackdropImageTags.length?getBackdropImageUrl(item,imageOptions,apiClient):"Photo"===item.MediaType&&original?apiClient.getItemDownloadUrl(item.Id):(imageOptions.type="Primary",getImageUrl(item,imageOptions,apiClient))}function getIcon(icon,cssClass,canFocus,autoFocus){var tabIndex=canFocus?"":' tabindex="-1"';return autoFocus=autoFocus?" autofocus":"",'"}return function(options){function createElements(options){dlg=dialogHelper.createDialog({exitAnimationDuration:options.interactive?400:800,size:"fullscreen",autoFocus:!1,scrollY:!1,exitAnimation:"fadeout",removeOnClose:!0}),dlg.classList.add("slideshowDialog");var html="";if(options.interactive){var actionButtonsOnTop=layoutManager.mobile;html+="
    ",html+='
    ',html+=getIcon("keyboard_arrow_left","btnSlideshowPrevious slideshowButton hide-mouse-idle-tv",!1),html+=getIcon("keyboard_arrow_right","btnSlideshowNext slideshowButton hide-mouse-idle-tv",!1),html+='
    ',actionButtonsOnTop&&(appHost.supports("filedownload")&&(html+=getIcon("file_download","btnDownload slideshowButton",!0)),appHost.supports("sharing")&&(html+=getIcon("share","btnShare slideshowButton",!0))),html+=getIcon("close","slideshowButton btnSlideshowExit hide-mouse-idle-tv",!1),html+="
    ",actionButtonsOnTop||(html+='
    ',html+=getIcon("pause","btnSlideshowPause slideshowButton",!0,!0),appHost.supports("filedownload")&&(html+=getIcon("file_download","btnDownload slideshowButton",!0)),appHost.supports("sharing")&&(html+=getIcon("share","btnShare slideshowButton",!0)),html+="
    "),html+="
    "}else html+='

    ';if(dlg.innerHTML=html,options.interactive){dlg.querySelector(".btnSlideshowExit").addEventListener("click",function(e){dialogHelper.close(dlg)}),dlg.querySelector(".btnSlideshowNext").addEventListener("click",nextImage),dlg.querySelector(".btnSlideshowPrevious").addEventListener("click",previousImage);var btnPause=dlg.querySelector(".btnSlideshowPause");btnPause&&btnPause.addEventListener("click",playPause);var btnDownload=dlg.querySelector(".btnDownload");btnDownload&&btnDownload.addEventListener("click",download);var btnShare=dlg.querySelector(".btnShare");btnShare&&btnShare.addEventListener("click",share)}dialogHelper.open(dlg).then(function(){stopInterval()}),inputmanager.on(window,onInputCommand),document.addEventListener(window.PointerEvent?"pointermove":"mousemove",onPointerMove),dlg.addEventListener("close",onDialogClosed),options.interactive&&loadSwiper(dlg)}function loadSwiper(dlg){currentOptions.slides?dlg.querySelector(".swiper-wrapper").innerHTML=currentOptions.slides.map(getSwiperSlideHtmlFromSlide).join(""):dlg.querySelector(".swiper-wrapper").innerHTML=currentOptions.items.map(getSwiperSlideHtmlFromItem).join(""),require(["swiper"],function(swiper){swiperInstance=new Swiper(dlg.querySelector(".slideshowSwiperContainer"),{direction:"horizontal",loop:options.loop!==!1,autoplay:options.interval||8e3,preloadImages:!1,lazyLoading:!0,lazyLoadingInPrevNext:!0,autoplayDisableOnInteraction:!1,initialSlide:options.startIndex||0,speed:240}),layoutManager.mobile?pause():play()})}function getSwiperSlideHtmlFromItem(item){return getSwiperSlideHtmlFromSlide({imageUrl:getImgUrl(item),originalImage:getImgUrl(item,!0),Id:item.Id,ServerId:item.ServerId})}function getSwiperSlideHtmlFromSlide(item){var html="";return html+='
    ',html+='',(item.title||item.subtitle)&&(html+='
    ',html+='
    ',item.title&&(html+='

    ',html+=item.title,html+="

    "),item.description&&(html+='
    ',html+=item.description,html+="
    "),html+="
    ",html+="
    "),html+="
    "}function previousImage(){swiperInstance?swiperInstance.slidePrev():(stopInterval(),showNextImage(currentIndex-1))}function nextImage(){if(swiperInstance){if(options.loop===!1&&swiperInstance.activeIndex>=swiperInstance.slides.length-1)return void dialogHelper.close(dlg);swiperInstance.slideNext()}else stopInterval(),showNextImage(currentIndex+1)}function getCurrentImageInfo(){if(swiperInstance){var slide=document.querySelector(".swiper-slide-active");return slide?{url:slide.getAttribute("data-original"),shareUrl:slide.getAttribute("data-imageurl"),itemId:slide.getAttribute("data-itemid"),serverId:slide.getAttribute("data-serverid")}:null}return null}function download(){var imageInfo=getCurrentImageInfo();require(["fileDownloader"],function(fileDownloader){fileDownloader.download([imageInfo])})}function share(){var imageInfo=getCurrentImageInfo();navigator.share({url:imageInfo.shareUrl})}function play(){var btnSlideshowPause=dlg.querySelector(".btnSlideshowPause i");btnSlideshowPause&&(btnSlideshowPause.innerHTML="pause"),swiperInstance.startAutoplay()}function pause(){var btnSlideshowPause=dlg.querySelector(".btnSlideshowPause i");btnSlideshowPause&&(btnSlideshowPause.innerHTML="play_arrow"),swiperInstance.stopAutoplay()}function playPause(){var paused="pause"!==dlg.querySelector(".btnSlideshowPause i").innerHTML;paused?play():pause()}function onDialogClosed(){var swiper=swiperInstance;swiper&&(swiper.destroy(!0,!0),swiperInstance=null),inputmanager.off(window,onInputCommand),document.removeEventListener(window.PointerEvent?"pointermove":"mousemove",onPointerMove)}function startInterval(options){currentOptions=options,stopInterval(),createElements(options),options.interactive||(currentIntervalMs=options.interval||11e3,showNextImage(options.startIndex||0,!0))}function isOsdOpen(){return _osdOpen}function getOsdBottom(){return dlg.querySelector(".slideshowBottomBar")}function showOsd(){var bottom=getOsdBottom();bottom&&(slideUpToShow(bottom),startHideTimer())}function hideOsd(){var bottom=getOsdBottom();bottom&&slideDownToHide(bottom)}function startHideTimer(){stopHideTimer(),hideTimeout=setTimeout(hideOsd,4e3)}function stopHideTimer(){hideTimeout&&(clearTimeout(hideTimeout),hideTimeout=null)}function slideUpToShow(elem){if(elem.classList.contains("hide")){_osdOpen=!0,elem.classList.remove("hide");var onFinish=function(){focusManager.focus(elem.querySelector(".btnSlideshowPause"))};return elem.animate?void requestAnimationFrame(function(){var keyframes=[{transform:"translate3d(0,"+elem.offsetHeight+"px,0)",opacity:".3",offset:0},{transform:"translate3d(0,0,0)",opacity:"1",offset:1}],timing={duration:300,iterations:1,easing:"ease-out"};elem.animate(keyframes,timing).onfinish=onFinish}):void onFinish()}}function slideDownToHide(elem){if(!elem.classList.contains("hide")){var onFinish=function(){elem.classList.add("hide"),_osdOpen=!1};return elem.animate?void requestAnimationFrame(function(){var keyframes=[{transform:"translate3d(0,0,0)",opacity:"1",offset:0},{transform:"translate3d(0,"+elem.offsetHeight+"px,0)",opacity:".3",offset:1}],timing={duration:300,iterations:1,easing:"ease-out"};elem.animate(keyframes,timing).onfinish=onFinish}):void onFinish()}}function onPointerMove(e){var pointerType=e.pointerType||(layoutManager.mobile?"touch":"mouse");if("mouse"===pointerType){var eventX=e.screenX||0,eventY=e.screenY||0,obj=lastMouseMoveData;if(!obj)return void(lastMouseMoveData={x:eventX,y:eventY});if(Math.abs(eventX-obj.x)<10&&Math.abs(eventY-obj.y)<10)return;obj.x=eventX,obj.y=eventY,showOsd()}}function onInputCommand(e){switch(e.detail.command){case"left":isOsdOpen()||(e.preventDefault(),e.stopPropagation(),previousImage());break;case"right":isOsdOpen()||(e.preventDefault(),e.stopPropagation(),nextImage());break;case"up":case"down":case"select":case"menu":case"info":case"play":case"playpause":case"pause":case"fastforward":case"rewind":case"next":case"previous":showOsd()}}function showNextImage(index,skipPreload){index=Math.max(0,index),index>=currentOptions.items.length&&(index=0),currentIndex=index;var options=currentOptions,items=options.items,item=items[index],imgUrl=getImgUrl(item),onSrcLoaded=function(){var cardImageContainer=dlg.querySelector(".slideshowImage"),newCardImageContainer=document.createElement("div");newCardImageContainer.className=cardImageContainer.className,options.cover&&newCardImageContainer.classList.add("slideshowImage-cover"),newCardImageContainer.style.backgroundImage="url('"+imgUrl+"')",newCardImageContainer.classList.add("hide"),cardImageContainer.parentNode.appendChild(newCardImageContainer),options.showTitle?dlg.querySelector(".slideshowImageText").innerHTML=item.Name:dlg.querySelector(".slideshowImageText").innerHTML="",newCardImageContainer.classList.remove("hide");var onAnimationFinished=function(){var parentNode=cardImageContainer.parentNode;parentNode&&parentNode.removeChild(cardImageContainer)};if(newCardImageContainer.animate){var keyframes=[{opacity:"0",offset:0},{opacity:"1",offset:1}],timing={duration:1200,iterations:1};newCardImageContainer.animate(keyframes,timing).onfinish=onAnimationFinished}else onAnimationFinished();stopInterval(),currentTimeout=setTimeout(function(){showNextImage(index+1,!0)},currentIntervalMs)};if(skipPreload)onSrcLoaded();else{var img=new Image;img.onload=onSrcLoaded,img.src=imgUrl}}function stopInterval(){currentTimeout&&(clearTimeout(currentTimeout),currentTimeout=null)}var swiperInstance,dlg,currentTimeout,currentIntervalMs,currentOptions,currentIndex,hideTimeout,lastMouseMoveData,self=this,_osdOpen=!1;self.show=function(){startInterval(options)},self.hide=function(){var dialog=dlg;dialog&&dialogHelper.close(dialog)}}}); \ No newline at end of file +define(["dialogHelper","inputManager","connectionManager","layoutManager","focusManager","browser","apphost","loading","css!./style","material-icons","paper-icon-button-light"],function(dialogHelper,inputmanager,connectionManager,layoutManager,focusManager,browser,appHost,loading){"use strict";function getImageUrl(item,options,apiClient){return options=options||{},options.type=options.type||"Primary","string"==typeof item?apiClient.getScaledImageUrl(item,options):item.ImageTags&&item.ImageTags[options.type]?(options.tag=item.ImageTags[options.type],apiClient.getScaledImageUrl(item.Id,options)):"Primary"===options.type&&item.AlbumId&&item.AlbumPrimaryImageTag?(options.tag=item.AlbumPrimaryImageTag,apiClient.getScaledImageUrl(item.AlbumId,options)):null}function getBackdropImageUrl(item,options,apiClient){return options=options||{},options.type=options.type||"Backdrop",options.maxWidth||options.width||options.maxHeight||options.height||(options.quality=100),item.BackdropImageTags&&item.BackdropImageTags.length?(options.tag=item.BackdropImageTags[0],apiClient.getScaledImageUrl(item.Id,options)):null}function getImgUrl(item,original){var apiClient=connectionManager.getApiClient(item.ServerId),imageOptions={};return original||(imageOptions.maxWidth=screen.availWidth),item.BackdropImageTags&&item.BackdropImageTags.length?getBackdropImageUrl(item,imageOptions,apiClient):"Photo"===item.MediaType&&original?apiClient.getItemDownloadUrl(item.Id):(imageOptions.type="Primary",getImageUrl(item,imageOptions,apiClient))}function getIcon(icon,cssClass,canFocus,autoFocus){var tabIndex=canFocus?"":' tabindex="-1"';return autoFocus=autoFocus?" autofocus":"",'"}return function(options){function createElements(options){dlg=dialogHelper.createDialog({exitAnimationDuration:options.interactive?400:800,size:"fullscreen",autoFocus:!1,scrollY:!1,exitAnimation:"fadeout",removeOnClose:!0}),dlg.classList.add("slideshowDialog");var html="";if(options.interactive){var actionButtonsOnTop=layoutManager.mobile;html+="
    ",html+='
    ',html+=getIcon("keyboard_arrow_left","btnSlideshowPrevious slideshowButton hide-mouse-idle-tv",!1),html+=getIcon("keyboard_arrow_right","btnSlideshowNext slideshowButton hide-mouse-idle-tv",!1),html+='
    ',actionButtonsOnTop&&(appHost.supports("filedownload")&&(html+=getIcon("file_download","btnDownload slideshowButton",!0)),appHost.supports("sharing")&&(html+=getIcon("share","btnShare slideshowButton",!0))),html+=getIcon("close","slideshowButton btnSlideshowExit hide-mouse-idle-tv",!1),html+="
    ",actionButtonsOnTop||(html+='
    ',html+=getIcon("pause","btnSlideshowPause slideshowButton",!0,!0),appHost.supports("filedownload")&&(html+=getIcon("file_download","btnDownload slideshowButton",!0)),appHost.supports("sharing")&&(html+=getIcon("share","btnShare slideshowButton",!0)),html+="
    "),html+="
    "}else html+='

    ';if(dlg.innerHTML=html,options.interactive){dlg.querySelector(".btnSlideshowExit").addEventListener("click",function(e){dialogHelper.close(dlg)}),dlg.querySelector(".btnSlideshowNext").addEventListener("click",nextImage),dlg.querySelector(".btnSlideshowPrevious").addEventListener("click",previousImage);var btnPause=dlg.querySelector(".btnSlideshowPause");btnPause&&btnPause.addEventListener("click",playPause);var btnDownload=dlg.querySelector(".btnDownload");btnDownload&&btnDownload.addEventListener("click",download);var btnShare=dlg.querySelector(".btnShare");btnShare&&btnShare.addEventListener("click",share)}dialogHelper.open(dlg).then(function(){stopInterval()}),inputmanager.on(window,onInputCommand),document.addEventListener(window.PointerEvent?"pointermove":"mousemove",onPointerMove),dlg.addEventListener("close",onDialogClosed),options.interactive&&loadSwiper(dlg)}function loadSwiper(dlg){currentOptions.slides?dlg.querySelector(".swiper-wrapper").innerHTML=currentOptions.slides.map(getSwiperSlideHtmlFromSlide).join(""):dlg.querySelector(".swiper-wrapper").innerHTML=currentOptions.items.map(getSwiperSlideHtmlFromItem).join(""),require(["swiper"],function(swiper){swiperInstance=new Swiper(dlg.querySelector(".slideshowSwiperContainer"),{direction:"horizontal",loop:!1!==options.loop,autoplay:options.interval||8e3,preloadImages:!1,lazyLoading:!0,lazyLoadingInPrevNext:!0,autoplayDisableOnInteraction:!1,initialSlide:options.startIndex||0,speed:240}),layoutManager.mobile?pause():play()})}function getSwiperSlideHtmlFromItem(item){return getSwiperSlideHtmlFromSlide({imageUrl:getImgUrl(item),originalImage:getImgUrl(item,!0),Id:item.Id,ServerId:item.ServerId})}function getSwiperSlideHtmlFromSlide(item){var html="";return html+='
    ',html+='',(item.title||item.subtitle)&&(html+='
    ',html+='
    ',item.title&&(html+='

    ',html+=item.title,html+="

    "),item.description&&(html+='
    ',html+=item.description,html+="
    "),html+="
    ",html+="
    "),html+="
    "}function previousImage(){swiperInstance?swiperInstance.slidePrev():(stopInterval(),showNextImage(currentIndex-1))}function nextImage(){if(swiperInstance){if(!1===options.loop&&swiperInstance.activeIndex>=swiperInstance.slides.length-1)return void dialogHelper.close(dlg);swiperInstance.slideNext()}else stopInterval(),showNextImage(currentIndex+1)}function getCurrentImageInfo(){if(swiperInstance){var slide=document.querySelector(".swiper-slide-active");return slide?{url:slide.getAttribute("data-original"),shareUrl:slide.getAttribute("data-imageurl"),itemId:slide.getAttribute("data-itemid"),serverId:slide.getAttribute("data-serverid")}:null}return null}function download(){var imageInfo=getCurrentImageInfo();require(["fileDownloader"],function(fileDownloader){fileDownloader.download([imageInfo])})}function share(){var imageInfo=getCurrentImageInfo();navigator.share({url:imageInfo.shareUrl})}function play(){var btnSlideshowPause=dlg.querySelector(".btnSlideshowPause i");btnSlideshowPause&&(btnSlideshowPause.innerHTML="pause"),swiperInstance.startAutoplay()}function pause(){var btnSlideshowPause=dlg.querySelector(".btnSlideshowPause i");btnSlideshowPause&&(btnSlideshowPause.innerHTML="play_arrow"),swiperInstance.stopAutoplay()}function playPause(){"pause"!==dlg.querySelector(".btnSlideshowPause i").innerHTML?play():pause()}function onDialogClosed(){var swiper=swiperInstance;swiper&&(swiper.destroy(!0,!0),swiperInstance=null),inputmanager.off(window,onInputCommand),document.removeEventListener(window.PointerEvent?"pointermove":"mousemove",onPointerMove)}function startInterval(options){currentOptions=options,stopInterval(),createElements(options),options.interactive||(currentIntervalMs=options.interval||11e3,showNextImage(options.startIndex||0,!0))}function isOsdOpen(){return _osdOpen}function getOsdBottom(){return dlg.querySelector(".slideshowBottomBar")}function showOsd(){var bottom=getOsdBottom();bottom&&(slideUpToShow(bottom),startHideTimer())}function hideOsd(){var bottom=getOsdBottom();bottom&&slideDownToHide(bottom)}function startHideTimer(){stopHideTimer(),hideTimeout=setTimeout(hideOsd,4e3)}function stopHideTimer(){hideTimeout&&(clearTimeout(hideTimeout),hideTimeout=null)}function slideUpToShow(elem){if(elem.classList.contains("hide")){_osdOpen=!0,elem.classList.remove("hide");var onFinish=function(){focusManager.focus(elem.querySelector(".btnSlideshowPause"))};if(!elem.animate)return void onFinish();requestAnimationFrame(function(){var keyframes=[{transform:"translate3d(0,"+elem.offsetHeight+"px,0)",opacity:".3",offset:0},{transform:"translate3d(0,0,0)",opacity:"1",offset:1}],timing={duration:300,iterations:1,easing:"ease-out"};elem.animate(keyframes,timing).onfinish=onFinish})}}function slideDownToHide(elem){if(!elem.classList.contains("hide")){var onFinish=function(){elem.classList.add("hide"),_osdOpen=!1};if(!elem.animate)return void onFinish();requestAnimationFrame(function(){var keyframes=[{transform:"translate3d(0,0,0)",opacity:"1",offset:0},{transform:"translate3d(0,"+elem.offsetHeight+"px,0)",opacity:".3",offset:1}],timing={duration:300,iterations:1,easing:"ease-out"};elem.animate(keyframes,timing).onfinish=onFinish})}}function onPointerMove(e){if("mouse"===(e.pointerType||(layoutManager.mobile?"touch":"mouse"))){var eventX=e.screenX||0,eventY=e.screenY||0,obj=lastMouseMoveData;if(!obj)return void(lastMouseMoveData={x:eventX,y:eventY});if(Math.abs(eventX-obj.x)<10&&Math.abs(eventY-obj.y)<10)return;obj.x=eventX,obj.y=eventY,showOsd()}}function onInputCommand(e){switch(e.detail.command){case"left":isOsdOpen()||(e.preventDefault(),e.stopPropagation(),previousImage());break;case"right":isOsdOpen()||(e.preventDefault(),e.stopPropagation(),nextImage());break;case"up":case"down":case"select":case"menu":case"info":case"play":case"playpause":case"pause":case"fastforward":case"rewind":case"next":case"previous":showOsd()}}function showNextImage(index,skipPreload){index=Math.max(0,index),index>=currentOptions.items.length&&(index=0),currentIndex=index;var options=currentOptions,items=options.items,item=items[index],imgUrl=getImgUrl(item),onSrcLoaded=function(){var cardImageContainer=dlg.querySelector(".slideshowImage"),newCardImageContainer=document.createElement("div");newCardImageContainer.className=cardImageContainer.className,options.cover&&newCardImageContainer.classList.add("slideshowImage-cover"),newCardImageContainer.style.backgroundImage="url('"+imgUrl+"')",newCardImageContainer.classList.add("hide"),cardImageContainer.parentNode.appendChild(newCardImageContainer),options.showTitle?dlg.querySelector(".slideshowImageText").innerHTML=item.Name:dlg.querySelector(".slideshowImageText").innerHTML="",newCardImageContainer.classList.remove("hide");var onAnimationFinished=function(){var parentNode=cardImageContainer.parentNode;parentNode&&parentNode.removeChild(cardImageContainer)};if(newCardImageContainer.animate){var keyframes=[{opacity:"0",offset:0},{opacity:"1",offset:1}],timing={duration:1200,iterations:1};newCardImageContainer.animate(keyframes,timing).onfinish=onAnimationFinished}else onAnimationFinished();stopInterval(),currentTimeout=setTimeout(function(){showNextImage(index+1,!0)},currentIntervalMs)};if(skipPreload)onSrcLoaded();else{var img=new Image;img.onload=onSrcLoaded,img.src=imgUrl}}function stopInterval(){currentTimeout&&(clearTimeout(currentTimeout),currentTimeout=null)}var swiperInstance,dlg,currentTimeout,currentIntervalMs,currentOptions,currentIndex,hideTimeout,lastMouseMoveData,self=this,_osdOpen=!1;self.show=function(){startInterval(options)},self.hide=function(){var dialog=dlg;dialog&&dialogHelper.close(dialog)}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/sortmenu/sortmenu.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/sortmenu/sortmenu.js index cde17fb993..81757dcc82 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/sortmenu/sortmenu.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/sortmenu/sortmenu.js @@ -1 +1 @@ -define(["require","dom","focusManager","dialogHelper","loading","layoutManager","connectionManager","globalize","userSettings","emby-select","paper-icon-button-light","material-icons","css!./../formdialog","emby-button","emby-linkbutton","flexStyles"],function(require,dom,focusManager,dialogHelper,loading,layoutManager,connectionManager,globalize,userSettings){"use strict";function onSubmit(e){return e.preventDefault(),!1}function initEditor(context,settings){context.querySelector("form").addEventListener("submit",onSubmit),context.querySelector(".selectSortOrder").value=settings.sortOrder,context.querySelector(".selectSortBy").value=settings.sortBy}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function fillSortBy(context,options){var selectSortBy=context.querySelector(".selectSortBy");selectSortBy.innerHTML=options.map(function(o){return'"}).join("")}function saveValues(context,settings,settingsKey){userSettings.setFilter(settingsKey+"-sortorder",context.querySelector(".selectSortOrder").value),userSettings.setFilter(settingsKey+"-sortby",context.querySelector(".selectSortBy").value)}function SortMenu(){}return SortMenu.prototype.show=function(options){return new Promise(function(resolve,reject){require(["text!./sortmenu.template.html"],function(template){var dialogOptions={removeOnClose:!0,scrollY:!1};dialogOptions.size="fullscreen-border";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ${Sort}

    ',html+="
    ",html+=template,dlg.innerHTML=globalize.translateDocument(html,"sharedcomponents"),fillSortBy(dlg,options.sortOptions),initEditor(dlg,options.settings),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0);var submitted;dlg.querySelector("form").addEventListener("change",function(){submitted=!0},!0),dialogHelper.open(dlg).then(function(){return layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),submitted?(saveValues(dlg,options.settings,options.settingsKey),void resolve()):void reject()})})})},SortMenu}); \ No newline at end of file +define(["require","dom","focusManager","dialogHelper","loading","layoutManager","connectionManager","globalize","userSettings","emby-select","paper-icon-button-light","material-icons","css!./../formdialog","emby-button","emby-linkbutton","flexStyles"],function(require,dom,focusManager,dialogHelper,loading,layoutManager,connectionManager,globalize,userSettings){"use strict";function onSubmit(e){return e.preventDefault(),!1}function initEditor(context,settings){context.querySelector("form").addEventListener("submit",onSubmit),context.querySelector(".selectSortOrder").value=settings.sortOrder,context.querySelector(".selectSortBy").value=settings.sortBy}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function fillSortBy(context,options){context.querySelector(".selectSortBy").innerHTML=options.map(function(o){return'"}).join("")}function saveValues(context,settings,settingsKey){userSettings.setFilter(settingsKey+"-sortorder",context.querySelector(".selectSortOrder").value),userSettings.setFilter(settingsKey+"-sortby",context.querySelector(".selectSortBy").value)}function SortMenu(){}return SortMenu.prototype.show=function(options){return new Promise(function(resolve,reject){require(["text!./sortmenu.template.html"],function(template){var dialogOptions={removeOnClose:!0,scrollY:!1};dialogOptions.size="fullscreen-border";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ${Sort}

    ',html+="
    ",html+=template,dlg.innerHTML=globalize.translateDocument(html,"sharedcomponents"),fillSortBy(dlg,options.sortOptions),initEditor(dlg,options.settings),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0);var submitted;dlg.querySelector("form").addEventListener("change",function(){submitted=!0},!0),dialogHelper.open(dlg).then(function(){if(layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),submitted)return saveValues(dlg,options.settings,options.settingsKey),void resolve();reject()})})})},SortMenu}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/staticbackdrops.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/staticbackdrops.js index 163606a44d..d7269beab9 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/staticbackdrops.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/staticbackdrops.js @@ -1 +1 @@ -define([],function(){"use strict";function getStaticBackdrops(){var list=[];return list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg1-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg2-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg3-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg4-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg5-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg6-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg7-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg8-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg9-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg10-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg11-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg12-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg13-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg14-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg15-1920.jpg",width:1920}]),list}function getRandomInt(min,max){return Math.floor(Math.random()*(max-min+1))+min}function getRandomImageUrl(){var images=getStaticBackdrops(),index=getRandomInt(0,images.length-1);return images[index][0].url}return{getStaticBackdrops:getStaticBackdrops,getRandomImageUrl:getRandomImageUrl}}); \ No newline at end of file +define([],function(){"use strict";function getStaticBackdrops(){var list=[];return list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg1-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg2-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg3-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg4-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg5-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg6-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg7-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg8-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg9-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg10-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg11-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg12-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg13-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg14-1920.jpg",width:1920}]),list.push([{url:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/images/wallpaper/bg15-1920.jpg",width:1920}]),list}function getRandomInt(min,max){return Math.floor(Math.random()*(max-min+1))+min}function getRandomImageUrl(){var images=getStaticBackdrops();return images[getRandomInt(0,images.length-1)][0].url}return{getStaticBackdrops:getStaticBackdrops,getRandomImageUrl:getRandomImageUrl}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ar.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ar.json index 6e55b3b144..7d391cb2e4 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ar.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ar.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/be-by.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/be-by.json index 08a429fa49..f5b6f37e27 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/be-by.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/be-by.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/bg-bg.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/bg-bg.json index f2697e0cb7..a9ea54d182 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/bg-bg.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/bg-bg.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ca.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ca.json index f28ad37a93..e0dd9d57d0 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ca.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ca.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Activa aquesta funcionalitat amb un \u00fanic pagament, o amb una subscripci\u00f3 activa d'Emby Premiere.", "MessageUnlockAppWithSupporter": "Activa aquesta funcionalitat amb una subscripci\u00f3 activa d'Emby Premiere.", "MessageToValidateSupporter": "Si tens una subscripci\u00f3 activa d'Emby Premiere assegura't que l'has configurat al teu tauler de control de l'Emby Server, on pots accedir clicant a l'opci\u00f3 d'Emby Premiere al men\u00fa principal.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/cs.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/cs.json index 1ed434e37e..12e08e7c0b 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/cs.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/cs.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Odemknout tuto funkci pomoc\u00ed jednor\u00e1zov\u00e9 platby, nebo pomoc\u00ed aktivace p\u0159edplatn\u00e9ho Emby Premiere.", "MessageUnlockAppWithSupporter": "Odemknout tuto funkci pomoc\u00ed aktivn\u00edho p\u0159edplatn\u00e9ho Emby Premiere.", "MessageToValidateSupporter": "Pokud m\u00e1te aktivn\u00ed p\u0159edplatn\u00e9 Emby Premiere, ujist\u011bte se, \u017ee m\u00e1te nastaven Emby Premiere v panelu Nastaven\u00ed pod N\u00e1pov\u011bda -> Emby Premiere.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/da.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/da.json index b267a9ce6c..4057c7f8e8 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/da.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/da.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "L\u00e5s op for dette feature med en lille enkeltst\u00e5ende betaling, eller med et aktivt Emby Premiere abonnement.", "MessageUnlockAppWithSupporter": "L\u00e5s op for dette feature med et aktivt Emby Premiere abonnement.", "MessageToValidateSupporter": "Hvis du har et aktivt Emby Premiere abonnement, skal du v\u00e6re sikker p\u00e5 at Emby Premiere er konfigureret i dit Emby Server-kontrolpanel, som kan tilg\u00e5es ved at klikke p\u00e5 Emby Premiere i hovedmenuen.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/de.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/de.json index 33a69cdac9..a90555da98 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/de.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/de.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Schalte diese Funktion mit einer kleinen einmaligen Geb\u00fchr oder einem aktiven Emby Premium Abo frei.", "MessageUnlockAppWithSupporter": "Schalte diese Funktion mit einem aktiven Emby Premium Abo frei.", "MessageToValidateSupporter": "Wenn du eine aktive Emby Premiere Mitgliedschaft hast, stelle bitte sicher, dass du diese \u00fcber das Emby Server Dashboard eingerichtet hast (Hauptmenu -> Emby Premiere).", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/el.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/el.json index 0cc359467a..fc2476c436 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/el.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/el.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "\u039e\u03b5\u03ba\u03bb\u03b5\u03b9\u03b4\u03ce\u03c3\u03c4\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03b7\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03cc \u03ba\u03b1\u03c4\u03b1\u03b2\u03ac\u03bb\u03bf\u03bd\u03c4\u03b1\u03c2 \u03ad\u03bd\u03b1 \u03c0\u03bf\u03bb\u03cd \u03bc\u03b9\u03ba\u03c1\u03cc \u03ba\u03cc\u03c3\u03c4\u03bf\u03c2 \u03ae \u03bc\u03b5 \u03bc\u03af\u03b1 \u03b5\u03bd\u03b5\u03c1\u03b3\u03ae \u03c3\u03c5\u03bd\u03b4\u03c1\u03bf\u03bc\u03ae \u03c3\u03c4\u03bf Emby Premiere.", "MessageUnlockAppWithSupporter": "\u039e\u03b5\u03ba\u03bb\u03b5\u03b9\u03b4\u03ce\u03c3\u03c4\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03b7\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03cc \u03bc\u03b5 \u03bc\u03af\u03b1 \u03b5\u03bd\u03b5\u03c1\u03b3\u03ae \u03c3\u03c5\u03bd\u03b4\u03c1\u03bf\u03bc\u03ae \u03c3\u03c4\u03bf Emby Premiere.", "MessageToValidateSupporter": "\u0391\u03bd \u03ad\u03c7\u03b5\u03c4\u03b5 \u03b5\u03bd\u03b5\u03c1\u03b3\u03ae \u03c3\u03c5\u03bd\u03b4\u03c1\u03bf\u03bc\u03ae Emby Premiere, \u03b2\u03b5\u03b2\u03b1\u03b9\u03c9\u03b8\u03b5\u03af\u03c4\u03b5 \u03cc\u03c4\u03b9 \u03ad\u03c7\u03b5\u03c4\u03b5 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03b9 \u03c4\u03bf Emby Premiere \u03c3\u03c4\u03bf\u03bd \u03c0\u03af\u03bd\u03b1\u03ba\u03b1 \u03b5\u03bb\u03ad\u03b3\u03c7\u03bf\u03c5 \u03c4\u03bf\u03c5 Emby Server, \u03c3\u03c4\u03bf\u03bd \u03bf\u03c0\u03bf\u03af\u03bf \u03bc\u03c0\u03bf\u03c1\u03b5\u03af\u03c4\u03b5 \u03bd\u03b1 \u03ad\u03c7\u03b5\u03c4\u03b5 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03ba\u03ac\u03bd\u03bf\u03bd\u03c4\u03b1\u03c2 \u03ba\u03bb\u03b9\u03ba \u03c3\u03c4\u03bf Emby Premiere \u03c3\u03c4\u03bf \u03ba\u03cd\u03c1\u03b9\u03bf \u03bc\u03b5\u03bd\u03bf\u03cd.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/en-gb.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/en-gb.json index e0c2d41deb..2c87f07e75 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/en-gb.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/en-gb.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/en-us.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/en-us.json index 3e31d02bf7..9248d87e3a 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/en-us.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/en-us.json @@ -30,6 +30,10 @@ "SeriesRecordingScheduled": "Series recording scheduled.", "HeaderNewRecording": "New Recording", "WakeServer": "Wake server", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "Sunday": "Sunday", "Monday": "Monday", "Tuesday": "Tuesday", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/es-ar.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/es-ar.json index 05856c3b2e..11355c922c 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/es-ar.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/es-ar.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/es-mx.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/es-mx.json index c117cd8d4b..b52cc9dee5 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/es-mx.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/es-mx.json @@ -7,6 +7,10 @@ "ColorTransfer": "Transferencia de color", "VideoRange": "Rango de video", "SeriesDisplayOrderHelp": "Ordenar los episodios por fecha transmisi\u00f3n, orden del dvd o por su numeraci\u00f3n absoluta.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Desbloquee esta caracter\u00edstica con una peque\u00f1a compra \u00fanica, o con una suscripci\u00f3n activa de Emby Premier.", "MessageUnlockAppWithSupporter": "Desbloquee esta caracter\u00edstica con una suscripci\u00f3n activa de Emby Premier.", "MessageToValidateSupporter": "Si tiene una subscripci\u00f3n de Emby Premiere activa, aseg\u00farese de que ha configurado Emby Premiere en el Panel de Control del Servidor Emby, al cual puede acceder dando click en Emby Premiere dentro del men\u00fa principal.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/es.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/es.json index 6067f4a176..419a30e386 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/es.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/es.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Desbloquea esta caracter\u00edstica con una peque\u00f1a compra una vez o con una suscripci\u00f3n a Emby Premiere.", "MessageUnlockAppWithSupporter": "Desbloquea esta caracter\u00edstica con una suscripci\u00f3n a Emby Premiere.", "MessageToValidateSupporter": "Si tienes una suscripci\u00f3n a Emby Premiere aseg\u00farate de que la has configurado en el Panel de Control de tu servidor Emby en Ayuda -> Emby Premiere.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/fi.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/fi.json index 069074a80f..2db3194170 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/fi.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/fi.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/fr-ca.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/fr-ca.json index 2441dc382c..9fe4e8ac5f 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/fr-ca.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/fr-ca.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "D\u00e9verrouillez cette fonctionnalit\u00e9 avec un petit achat unique ou avec un abonnement Emby Premiere actif.", "MessageUnlockAppWithSupporter": "D\u00e9verrouillez cette fonctionnalit\u00e9 avec un abonnement Emby Premi\u00e8re actif.", "MessageToValidateSupporter": "Si vous avez un abonnement Emby Premi\u00e8re actif, assurez-vous d'avoir install\u00e9 Emby Premi\u00e8re sur le tableau de bord de votre serveur Emby, auquel vous pouvez acc\u00e9der en cliquant sur Emby Premi\u00e8re dans le menu principal.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/fr.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/fr.json index 9b4d5e3196..3e067424ef 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/fr.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/fr.json @@ -7,6 +7,10 @@ "ColorTransfer": "Transfert de couleur", "VideoRange": "Gamme vid\u00e9o", "SeriesDisplayOrderHelp": "Ranger les \u00e9pisodes par date de diffusion, par ordre de DVD ou par num\u00e9ro absolu.", + "HeaderWakeServer": "R\u00e9veiller le serveur", + "AttemptingWakeServer": "Essai de r\u00e9veil du serveur. Veuillez patienter...", + "WakeServerSuccess": "R\u00e9ussi\u00a0!", + "WakeServerError": "Des paquets Wake-On-LAN on \u00e9t\u00e9 envoy\u00e9 \u00e0 votre serveur, mais nous ne pouvons pas nous connecter \u00e0 votre serveur Emby. Votre machine a peut-\u00eatre besoin de plus de temps pour se r\u00e9veiller, ou le serveur Emby n'est peut-\u00eatre pas lanc\u00e9 sur la machine.", "MessageUnlockAppWithPurchaseOrSupporter": "D\u00e9verrouillez cette fonctionnalit\u00e9 avec un petit achat unique, ou avec un abonnement Emby Premiere.", "MessageUnlockAppWithSupporter": "D\u00e9verrouillez cette fonctionnalit\u00e9 avec un abonnement Emby Premiere.", "MessageToValidateSupporter": "Si vous avez un abonnement Emby Premiere, veuillez vous assurer que vous avez configur\u00e9 Emby Premiere dans le tableau de bord de votre serveur Emby auquel vous pouvez acc\u00e9der en cliquant sur Emby Premiere dans le menu principal", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/gsw.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/gsw.json index ee5655cdfc..d540051e52 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/gsw.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/gsw.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/he.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/he.json index 722f5180a5..997390adde 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/he.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/he.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "\u05e0\u05e2\u05d9\u05dc\u05ea \u05ea\u05db\u05d5\u05e0\u05d4 \u05d6\u05d5 \u05e2\u05dd \u05e8\u05db\u05d9\u05e9\u05d4 \u05d7\u05d3 \u05e4\u05e2\u05de\u05d9\u05ea \u05e7\u05d8\u05e0\u05d4, \u05d0\u05d5 \u05e2\u05dd \u05de\u05e0\u05d5\u05d9 \u05e4\u05e2\u05d9\u05dc Premiere \u05d0\u05de\u05d1\u05d9.", "MessageUnlockAppWithSupporter": "\u05d1\u05d9\u05d8\u05d5\u05dc \u05e0\u05e2\u05d9\u05dc\u05d4 \u05e9\u05dc \u05ea\u05db\u05d5\u05e0\u05d4 \u05d6\u05d5 \u05e2\u05dd \u05de\u05e0\u05d5\u05d9 \u05e4\u05e2\u05d9\u05dc \u05e9\u05dc Emby Premiere.", "MessageToValidateSupporter": "\u05d0\u05dd \u05d9\u05e9 \u05dc\u05da \u05de\u05e0\u05d5\u05d9 \u05e4\u05e2\u05d9\u05dc \u05e9\u05dc Emby Premiere, \u05d5\u05d3\u05d0 \u05e9\u05d4\u05d2\u05d3\u05e8\u05ea \u05d0\u05ea Emby Premiere \u05d1\u05de\u05e8\u05db\u05d6 \u05d4\u05e9\u05dc\u05d9\u05d8\u05d4 \u05e9\u05dc \u200b\u200b\u05d0\u05de\u05d1\u05d9 \u05e9\u05e8\u05ea, \u05e9\u05d1\u05d5 \u05d1\u05d0\u05e4\u05e9\u05e8\u05d5\u05ea\u05da \u05dc\u05d2\u05e9\u05ea \u05e2\u05dc-\u05d9\u05d3\u05d9 \u05dc\u05d7\u05d9\u05e6\u05d4 \u05e2\u05dc Emby Premiere \u05d1\u05ea\u05e4\u05e8\u05d9\u05d8 \u05d4\u05e8\u05d0\u05e9\u05d9.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/hr.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/hr.json index e160aa2559..092bc4b4e2 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/hr.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/hr.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Otklju\u010daj ovu mogu\u0107nost s malom jednokratnom kupnjom ili s aktivnom pretplatom Emby Premijere.", "MessageUnlockAppWithSupporter": "Otklju\u010daj ovu mogu\u0107nost sa pretplatom Emby Premijere.", "MessageToValidateSupporter": "Ako imate aktivnu pretplatu Emby Premijere provjerite dali ste postavili Emby Premijeru u svojoj nadzornoj plo\u010di Emby Server-a kojoj mo\u017eete pristupiti klikom Emby Premijera u glavnom izborniku.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/hu.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/hu.json index 395255d1a3..b8986b2061 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/hu.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/hu.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/id.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/id.json index 337768f3d6..d805bf779c 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/id.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/id.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/it.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/it.json index 4b6b9dd5f9..70a80574dc 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/it.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/it.json @@ -1,12 +1,16 @@ { "WakeServer": "Sveglia il server", - "Aired": "Aired", - "Absolute": "Absolute", - "ColorPrimaries": "Color primaries", - "ColorSpace": "Color space", - "ColorTransfer": "Color transfer", - "VideoRange": "Video range", - "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "Aired": "In onda", + "Absolute": "Assoluto", + "ColorPrimaries": "Colori primari", + "ColorSpace": "Spazio Colore", + "ColorTransfer": "Trasferimento Colore", + "VideoRange": "Range del Video", + "SeriesDisplayOrderHelp": "Ordina gli episodi per data messa in onda, ordine dvd o numerazione assoluta.", + "HeaderWakeServer": "Sveglia il server", + "AttemptingWakeServer": "Tentando di svegliare il server. Per piacere aspetta...", + "WakeServerSuccess": "Successo!", + "WakeServerError": "I pacchetti Wake On LAN sono stati inviati al computer server, ma non siamo in grado di connettersi al server Emby. Potrebbe essere necessario un po 'pi\u00f9 di tempo per riattivare la macchina, oppure il server Emby potrebbe non essere attivo sulla macchina.", "MessageUnlockAppWithPurchaseOrSupporter": "Sblocca questa funzionalit\u00e0 con un piccolo acquisto singolo, o con un abbonamento Emby Premiere.", "MessageUnlockAppWithSupporter": "Sblocca questa funzionalit\u00e0 con un abbonamento Emby Premiere", "MessageToValidateSupporter": "Se hai un abbonamento Emby Premiere, assicurati di averlo configurato nel Pannello di Controllo del Server, a cui puoi accedere cliccando su Emby Premiere dal menu principale.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/kk.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/kk.json index e5e23fa4d1..4dc4a26e2f 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/kk.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/kk.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "\u041e\u0441\u044b \u049b\u04b1\u0440\u0430\u043c\u0434\u0430\u0441\u0442\u044b \u0431\u0456\u0440 \u0436\u043e\u043b\u0493\u044b \u0441\u0430\u0442\u044b\u043f \u0430\u043b\u0443, \u043d\u0435\u043c\u0435\u0441\u0435 \u0431\u0435\u043b\u0441\u0435\u043d\u0434\u0456 Emby Premiere \u0436\u0430\u0437\u044b\u043b\u044b\u043c\u044b \u0430\u0440\u049b\u044b\u043b\u044b \u049b\u04b1\u0440\u0441\u0430\u0443\u0434\u0430\u043d \u0431\u043e\u0441\u0430\u0442\u0443.", "MessageUnlockAppWithSupporter": "\u041e\u0441\u044b \u049b\u04b1\u0440\u0430\u043c\u0434\u0430\u0441\u0442\u044b \u0431\u0435\u043b\u0441\u0435\u043d\u0434\u0456 Emby Premiere \u0436\u0430\u0437\u044b\u043b\u044b\u043c\u044b \u0430\u0440\u049b\u044b\u043b\u044b \u049b\u04b1\u0440\u0441\u0430\u0443\u0434\u0430\u043d \u0431\u043e\u0441\u0430\u0442\u0443.", "MessageToValidateSupporter": "\u0415\u0433\u0435\u0440 \u0441\u0456\u0437\u0434\u0435 \u0431\u0435\u043b\u0441\u0435\u043d\u0434\u0456 Emby Premiere \u0436\u0430\u0437\u044b\u043b\u044b\u043c\u044b \u0431\u043e\u043b\u0441\u0430, Emby Server \u0442\u0430\u049b\u0442\u0430\u0441\u044b\u043d\u0434\u0430\u0493\u044b Emby Premiere \u043e\u0440\u043d\u0430\u0442\u044b\u043b\u044b\u043f \u0442\u0435\u04a3\u0448\u0435\u043b\u0433\u0435\u043d\u0456\u043d\u0435 \u043a\u04e9\u0437 \u0436\u0435\u0442\u043a\u0456\u0437\u0456\u04a3\u0456\u0437. \u0411\u04b1\u043b \u0431\u0430\u0441\u0442\u044b \u043c\u04d9\u0437\u0456\u0440\u0434\u0435 Emby Premiere \u0434\u0435\u0433\u0435\u043d\u0434\u0456 \u043d\u04b1\u049b\u044b\u043f \u049b\u0430\u0442\u044b\u043d\u0430\u0443\u043b\u044b.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ko.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ko.json index 12e00e3f5e..6e75dae9e1 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ko.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ko.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/lt-lt.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/lt-lt.json index b1373554db..25529e38de 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/lt-lt.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/lt-lt.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Atrakinkite \u0161i\u0105 funkcij\u0105 nedideliu vienkartiniu mokes\u010diu arba \u012fsigij\u0119 Emby Premiere prenumerat\u0105.", "MessageUnlockAppWithSupporter": "Atrakinkite \u0161i\u0105 funkcij\u0105 \u012fsigij\u0119 Emby Premiere prenumerat\u0105.", "MessageToValidateSupporter": "Jei turite aktyvi\u0105 Emby Premiere prenumerat\u0105, sutvarkykite Emby Premiere savo Emby Serverio skydelyje. Tai galite atlikti paspaud\u0117 Emby Premiere u\u017era\u0161\u0105 pagrindiniame meniu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ms.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ms.json index 7cd28b9887..daa2438dde 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ms.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ms.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/nb.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/nb.json index c8a069d73e..940045cc6c 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/nb.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/nb.json @@ -1,12 +1,16 @@ { - "WakeServer": "Vekk server", + "WakeServer": "Vekk opp server", "Aired": "Sendt tidligere", "Absolute": "Absolutt", "ColorPrimaries": "Prim\u00e6rfarger", "ColorSpace": "Fargeutvalg", "ColorTransfer": "Overf\u00f8ring av farger", - "VideoRange": "Video range", + "VideoRange": "Videoomr\u00e5de", "SeriesDisplayOrderHelp": "Sorter episoder etter sendt dato, DVD-rekkef\u00f8lge eller nummerering.", + "HeaderWakeServer": "Vekk opp server", + "AttemptingWakeServer": "Pr\u00f8ver \u00e5 vekke opp server. Vennligst vent,..", + "WakeServerSuccess": "Suksess!", + "WakeServerError": "Wake On LAN-pakker ble sendt til servermaskinen din, men tilkobling til din Emby Server mislyktes. Serveren din kan trenge litt mer tid til \u00e5 v\u00e5kne, eller s\u00e5 kj\u00f8rer ikke Emby Server p\u00e5 maskinen.", "MessageUnlockAppWithPurchaseOrSupporter": "L\u00e5s opp denne funksjonen med et engangskj\u00f8p, eller med et aktivt Emby Premiere-abonnement.", "MessageUnlockAppWithSupporter": "L\u00e5s opp denne funksjonen med et aktivt Emby Premiere-abonnement.", "MessageToValidateSupporter": "Hvis du har et aktivt Emby Premiere-abonnement, m\u00e5 du s\u00f8rge for at du har konfigurert Emby Premiere i Emby Server Dashboard, som du f\u00e5r tilgang til ved \u00e5 klikke Emby Premiere i hovedmenyen.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/nl.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/nl.json index 8f5ea35946..c2b493d37b 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/nl.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/nl.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Ontgrendel deze functie met een kleine eenmalige aankoop, of met een actief Emby Premiere abonnement.", "MessageUnlockAppWithSupporter": "Ontgrendel deze functie met een actief Emby Premiere abonnement.", "MessageToValidateSupporter": "Als u een actieve Emby Premiere abonnement heeft, zorg er dan voor dat u deze activeert in uw Emby Server Dashboard door te klikken op Emby Premiere in het hoofdmenu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/pl.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/pl.json index 84f4ae1873..dce24bee3f 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/pl.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/pl.json @@ -7,6 +7,10 @@ "ColorTransfer": "Transfer kolor\u00f3w", "VideoRange": "Zakres wideo", "SeriesDisplayOrderHelp": "Sortuje odcinki po dacie emisji, kolejno\u015bci na DVD lub bezwzgl\u0119dnej numeracji.", + "HeaderWakeServer": "Wybudzaj serwer", + "AttemptingWakeServer": "Trwa pr\u00f3ba wybudzenia serwera. Prosz\u0119 czeka\u0107...", + "WakeServerSuccess": "Powodzenie!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Odblokuj t\u0119 funkcj\u0119, za niewielk\u0105 jednorazow\u0105 op\u0142at\u0105 lub przy u\u017cyciu aktywnej subskrypcji Emby Premium.", "MessageUnlockAppWithSupporter": "Odblokuj t\u0119 funkcj\u0119 przy u\u017cyciu subskrypcji Emby Premium.", "MessageToValidateSupporter": "Je\u015bli posiadasz aktywn\u0105 subskrypcj\u0119 Emby Premium, upewnij si\u0119, \u017ce j\u0105 poprawnie skonfigurowa\u0142e\u015b przy pomocy Kokpitu serwera Emby, do kt\u00f3rego mo\u017cesz uzyska\u0107 dost\u0119p, klikaj\u0105c na pozycj\u0119 Premium menu startowego.", @@ -163,7 +167,7 @@ "ResumeAt": "Wzn\u00f3w odtwarzanie od {0}", "RemoveFromPlaylist": "Usu\u0144 z listy", "RemoveFromCollection": "Usu\u0144 z kolekcji", - "Sort": "Sort", + "Sort": "Sortuj", "Trailer": "Zwiastun", "MarkPlayed": "Oznacz jako obejrzane", "MarkUnplayed": "Oznacz jako nieobejrzane", @@ -482,7 +486,7 @@ "Collections": "Kolekcje", "LabelSelectFolderGroups": "Grupuj zawarto\u015b\u0107 z nast\u0119puj\u0105cych folder\u00f3w w widokach taki, jak Filmy, Muzyka i Seriale:", "LabelSelectFolderGroupsHelp": "Foldery, kt\u00f3re nie zosta\u0142y zaznaczone, b\u0119d\u0105 wy\u015bwietlane w swoich w\u0142asnych, osobnych widokach.", - "Folders": "Folders", + "Folders": "Foldery", "Shows": "Seriale", "HeaderLibraryFolders": "Foldery biblioteki", "HeaderLandingScreens": "Ekrany pocz\u0105tkowe", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/pt-br.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/pt-br.json index 0a71fbe9c0..31b0150fd2 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/pt-br.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/pt-br.json @@ -7,6 +7,10 @@ "ColorTransfer": "Transfer\u00eancia da cor", "VideoRange": "Faixa de v\u00eddeo", "SeriesDisplayOrderHelp": "Ordenar epis\u00f3dios por data de exibi\u00e7\u00e3o, ordem de dvd ou n\u00fameros absolutos.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Desbloqueie esta funcionalidade com uma pequena compra \u00fanica, ou com uma assinatura ativa do Emby Premiere.", "MessageUnlockAppWithSupporter": "Desbloqueie esta funcionalidade com uma assinatura ativa do Emby Premiere.", "MessageToValidateSupporter": "Se tiver uma assinatura ativa do Emby Premiere, assegure-se que configurou o Emby Premiere no Painel do Servidor Emby, que pode ser acessado clicando Emby Premiere no menu principal.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/pt-pt.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/pt-pt.json index 067f4bd1b6..f5b8737c49 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/pt-pt.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/pt-pt.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ro.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ro.json index a8e7575ef3..7954fa558a 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ro.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ro.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ru.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ru.json index 390448604b..54f3280957 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ru.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/ru.json @@ -1,12 +1,16 @@ { "WakeServer": "\u0420\u0430\u0437\u0431\u0443\u0434\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440", - "Aired": "Aired", - "Absolute": "Absolute", - "ColorPrimaries": "Color primaries", - "ColorSpace": "Color space", - "ColorTransfer": "Color transfer", - "VideoRange": "Video range", - "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "Aired": "\u042d\u0444\u0438\u0440\u043d\u044b\u0439", + "Absolute": "\u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439", + "ColorPrimaries": "\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430", + "ColorSpace": "\u0426\u0432\u0435\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e", + "ColorTransfer": "\u0426\u0432\u0435\u0442\u043e\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430", + "VideoRange": "\u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0432\u0438\u0434\u0435\u043e", + "SeriesDisplayOrderHelp": "\u0423\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u044d\u043f\u0438\u0437\u043e\u0434\u043e\u0432 \u043f\u043e \u0434\u0430\u0442\u0435 \u044d\u0444\u0438\u0440\u0430, \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u043d\u0430 DVD \u0438\u043b\u0438 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0439 \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438.", + "HeaderWakeServer": "\u041f\u0440\u043e\u0431\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430", + "AttemptingWakeServer": "\u0418\u0434\u0451\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0440\u0430\u0437\u0431\u0443\u0434\u0438\u0442\u044c \u0432\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440. \u0416\u0434\u0438\u0442\u0435...", + "WakeServerSuccess": "\u0423\u0441\u043f\u0435\u0448\u043d\u043e!", + "WakeServerError": "\u041f\u0430\u043a\u0435\u0442\u044b Wake On LAN \u0431\u044b\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u0432\u0430\u0448\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443, \u043e\u0434\u043d\u0430\u043a\u043e, \u043c\u044b \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u0441 Emby Server. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0430\u0448\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0431\u0443\u0436\u0434\u0435\u043d\u0438\u044f, \u0438\u043b\u0438 Emby Server \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435.", "MessageUnlockAppWithPurchaseOrSupporter": "\u0420\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0439\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0439 \u043e\u043f\u043b\u0430\u0442\u044b, \u0438\u043b\u0438 \u0441 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u043e\u0439 Emby Premiere .", "MessageUnlockAppWithSupporter": "\u0420\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0439\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u043e\u0439 Emby Premiere.", "MessageToValidateSupporter": "\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0430 Emby Premiere, \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e Emby Premiere \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432 \u0432\u0430\u0448\u0435\u0439 \u041f\u0430\u043d\u0435\u043b\u0438 Emby Server, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043f\u043e \u0449\u0435\u043b\u0447\u043a\u0443 \u043f\u043e Emby Premiere \u0432 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u043c\u0435\u043d\u044e.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/sk.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/sk.json index 9972b32edb..98f86e72cc 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/sk.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/sk.json @@ -1,5 +1,5 @@ { - "WakeServer": "Wake server", + "WakeServer": "Zobudi\u0165 server", "Aired": "Aired", "Absolute": "Absolute", "ColorPrimaries": "Color primaries", @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/sl-si.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/sl-si.json index 920dc51cf3..6f2f363b41 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/sl-si.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/sl-si.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/sv.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/sv.json index 85f95e60fa..7293850574 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/sv.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/sv.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "L\u00e5s upp denna feature med ett eng\u00e5ngsk\u00f6p, eller med ett aktivt Emby Premium-medlemskap.", "MessageUnlockAppWithSupporter": "L\u00e5s upp den h\u00e4r funktionen med en aktiv Emby Premium prenumeration.", "MessageToValidateSupporter": "Om du har ett aktivt Emby Premium-medlemskap, se till att du har st\u00e4llt in Emby Premium i Emby Server Dashboard, som du kommer \u00e5t genom att klicka p\u00e5 Emby Premium i huvudmenyn.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/tr.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/tr.json index 3d50a8eea7..e947fe81fc 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/tr.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/tr.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/uk.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/uk.json index 1320429123..60107692e7 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/uk.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/uk.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/vi.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/vi.json index a3100b6c8d..753b49354d 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/vi.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/vi.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/zh-cn.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/zh-cn.json index 4fd4f0665b..44bc49f366 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/zh-cn.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/zh-cn.json @@ -1,5 +1,5 @@ { - "WakeServer": "Wake server", + "WakeServer": "\u5524\u9192\u670d\u52a1\u5668", "Aired": "Aired", "Absolute": "Absolute", "ColorPrimaries": "Color primaries", @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "\u901a\u8fc7\u4e00\u6b21\u6027\u4ed8\u8d39\u6216\u4e00\u4e2a\u6709\u6548\u7684 Emby Premiere \u8ba2\u9605\u6765\u89e3\u9501\u8fd9\u9879\u529f\u80fd\u3002", "MessageUnlockAppWithSupporter": "\u901a\u8fc7\u4e00\u4e2a\u6709\u6548\u7684 Emby Premiere \u8ba2\u9605\u6765\u89e3\u9501\u8fd9\u9879\u529f\u80fd\u3002", "MessageToValidateSupporter": "\u5982\u679c\u4f60\u5df2\u7ecf\u62e5\u6709\u4e00\u4e2a\u6709\u6548\u7684 Emby Premiere \u8ba2\u9605\uff0c\u8bf7\u786e\u4fdd\u4f60\u5df2\u7ecf\u5728\u4f60 Emby \u670d\u52a1\u5668\u63a7\u5236\u53f0\u7684\u201cEmby Premiere\u201d\u9009\u9879\u4e2d\u914d\u7f6e\u4e86\u4f60\u7684 Emby Premiere\uff0c\u4f60\u53ef\u4ee5\u5728 Emby \u670d\u52a1\u5668\u63a7\u5236\u53f0\u4e3b\u83dc\u5355\u4e2d\u627e\u5230\u201cEmby Premiere\u201d\u9009\u9879\u3002", @@ -45,11 +49,11 @@ "Friday": "\u661f\u671f\u4e94", "Saturday": "\u661f\u671f\u516d", "Days": "\u5929", - "SortByValue": "Sort by {0}", - "LabelSortBy": "Sort by:", - "LabelSortOrder": "Sort order:", + "SortByValue": "\u6392\u5e8f\u65b9\u5f0f\uff1a{0}", + "LabelSortBy": "\u6392\u5e8f\u65b9\u5f0f", + "LabelSortOrder": "\u6392\u5e8f\u987a\u5e8f", "Photos": "Photos", - "List": "List", + "List": "\u5217\u8868", "RecordSeries": "Record series", "HeaderCinemaMode": "\u5f71\u9662\u6a21\u5f0f", "HeaderCloudSync": "\u4e91\u540c\u6b65", @@ -163,7 +167,7 @@ "ResumeAt": "\u6062\u590d\u64ad\u653e\u4e8e{0}", "RemoveFromPlaylist": "\u4ece\u64ad\u653e\u5217\u8868\u4e2d\u79fb\u9664", "RemoveFromCollection": "Remove from collection", - "Sort": "Sort", + "Sort": "\u6392\u5e8f", "Trailer": "\u9884\u544a\u7247", "MarkPlayed": "\u6807\u4e3a\u5df2\u64ad\u653e", "MarkUnplayed": "\u6807\u4e3a\u672a\u64ad\u653e", @@ -172,7 +176,7 @@ "TryMultiSelect": "Try Multi-Select", "TryMultiSelectMessage": "To edit multiple media items, just click and hold any poster and select the items you want to manage. Try it!", "HeaderConfirmRecordingCancellation": "\u786e\u8ba4\u53d6\u6d88\u5f55\u5236", - "MessageConfirmRecordingCancellation": "\u4f60\u786e\u5b9a\u5e0c\u671b\u53d6\u6d88\u5f55\u5236\uff1f", + "MessageConfirmRecordingCancellation": "\u53d6\u6d88\u5f55\u5236\uff1f", "Error": "\u9519\u8bef", "VoiceInput": "\u8bed\u97f3\u8f93\u5165", "LabelContentType": "\u5185\u5bb9\u7c7b\u578b", @@ -380,7 +384,7 @@ "Movies": "\u7535\u5f71", "Kids": "\u513f\u7ae5", "EnableColorCodedBackgrounds": "Enable color coded backgrounds", - "SortChannelsBy": "Sort channels by:", + "SortChannelsBy": "\u9891\u9053\u6392\u5e8f\u65b9\u5f0f\uff1a", "RecentlyWatched": "\u6700\u8fd1\u89c2\u770b", "ChannelNumber": "Channel number", "HeaderBenefitsEmbyPremiere": "Benefits of Emby Premiere", @@ -400,7 +404,7 @@ "MessageDidYouKnowCinemaMode": "Did you know that with Emby Premiere, you can enhance your experience with features like Cinema Mode?", "MessageDidYouKnowCinemaMode2": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the main feature.", "HeaderPlayMyMedia": "\u64ad\u653e\u6211\u7684\u5a92\u4f53", - "HeaderDiscoverEmbyPremiere": "Discover Emby Premiere", + "HeaderDiscoverEmbyPremiere": "\u53d1\u73b0 Emby Premiere", "Items": "Items", "OneChannel": "\u4e00\u4e2a\u9891\u9053", "ConfirmRemoveDownload": "\u5220\u9664\u4e0b\u8f7d\uff1f", @@ -424,7 +428,7 @@ "Continue": "Continue", "ContinueInSecondsValue": "Continue in {0} seconds.", "HeaderRemoteControl": "Remote Control", - "Disconnect": "Disconnect", + "Disconnect": "\u65ad\u5f00\u8fde\u63a5", "EnableDisplayMirroring": "Enable display mirroring", "HeaderPlayOn": "Play On", "Quality": "Quality", @@ -474,7 +478,7 @@ "HeaderPlaybackError": "Playback Error", "PlaybackErrorNotAllowed": "You're currently not authorized to play this content. Please contact your system administrator for details.", "PlaybackErrorNoCompatibleStream": "No compatible streams are currently available. Please try again later or contact your system administrator for details.", - "PlaybackErrorPlaceHolder": "Please insert the disc in order to play this video.", + "PlaybackErrorPlaceHolder": "\u8bf7\u63d2\u5165\u5149\u76d8\u4ee5\u64ad\u653e\u6b64\u89c6\u9891\u3002", "Guide": "Guide", "Suggestions": "Suggestions", "HeaderFavoriteCollections": "Favorite Collections", @@ -569,7 +573,7 @@ "Uniform": "Uniform", "DropShadow": "Drop shadow", "SmallCaps": "Small caps", - "SubtitleAppearanceSettingsDisclaimer": "These settings will not apply to graphical subtitles (PGS, DVD, etc), or subtitles that have their own styles embedded (ASS\/SSA).", + "SubtitleAppearanceSettingsDisclaimer": "\u8fd9\u4e9b\u8bbe\u7f6e\u5c06\u4e0d\u4f1a\u5e94\u7528\u4e8e\u56fe\u5f62\u5b57\u5e55\uff08\u5982 PGS,DVD\uff09\uff0c\u6216\u8005\u4e00\u4e9b\u6709\u7740\u81ea\u5df1\u7684\u5185\u7f6e\u5f0f\u6837\u7684\u5b57\u5e55\uff08ASS\/SSA)\u3002", "LabelBurnSubtitles": "Burn subtitles:", "OnlyImageFormats": "Only image formats (VOBSUB, PGS, SUB\/IDX, etc.)", "Normal": "Normal", @@ -598,19 +602,19 @@ "Browse": "Browse", "HeaderUploadImage": "Upload Image", "HeaderAddUpdateImage": "Add\/Update Image", - "LabelImageType": "Image type:", + "LabelImageType": "\u56fe\u7247\u7c7b\u578b\uff1a", "Upload": "Upload", - "Primary": "Primary", + "Primary": "\u5c01\u9762\u56fe", "Art": "Art", "Backdrop": "Backdrop", - "Banner": "Banner", + "Banner": "\u6a2a\u5e45", "Box": "Box", "BoxRear": "Box (rear)", - "Disc": "Disc", + "Disc": "\u5149\u76d8", "Logo": "Logo", "Menu": "Menu", "Screenshot": "Screenshot", - "Thumb": "Thumb", + "Thumb": "\u7f29\u7565\u56fe", "ValueSeconds": "{0} seconds", "HeaderAudioSettings": "Audio Settings", "LabelAudioLanguagePreference": "\u9996\u9009\u97f3\u9891\u8bed\u8a00\uff1a", @@ -668,6 +672,6 @@ "HeaderFavoriteArtists": "Favorite Artists", "HeaderFavoriteAlbums": "Favorite Albums", "HeaderFavoriteSongs": "Favorite Songs", - "Ascending": "Ascending", - "Descending": "Descending" + "Ascending": "\u5347\u5e8f", + "Descending": "\u964d\u5e8f" } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/zh-hk.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/zh-hk.json index d0fcd1dbaa..c6f7fa96e3 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/zh-hk.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/zh-hk.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/zh-tw.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/zh-tw.json index d37f441d5b..86c1061154 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/zh-tw.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/strings/zh-tw.json @@ -7,6 +7,10 @@ "ColorTransfer": "Color transfer", "VideoRange": "Video range", "SeriesDisplayOrderHelp": "Order episodes by air date, dvd order, or absolute numbering.", + "HeaderWakeServer": "Wake Server", + "AttemptingWakeServer": "Attempting to wake server. Please wait...", + "WakeServerSuccess": "Success!", + "WakeServerError": "Wake On LAN packets were sent to your server machine, but we're unable to connect to your Emby Server. Your machine may need a little more time to wake, or Emby Server may not be actively running on the machine.", "MessageUnlockAppWithPurchaseOrSupporter": "Unlock this feature with a small one-time purchase, or with an active Emby Premiere subscription.", "MessageUnlockAppWithSupporter": "Unlock this feature with an active Emby Premiere subscription.", "MessageToValidateSupporter": "If you have an active Emby Premiere subscription, ensure you've setup Emby Premiere in your Emby Server Dashboard, which you can access by clicking Emby Premiere within the main menu.", diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/subtitleeditor/subtitleeditor.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/subtitleeditor/subtitleeditor.js index a63dd97907..d9ff1efc88 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/subtitleeditor/subtitleeditor.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/subtitleeditor/subtitleeditor.js @@ -1 +1 @@ -define(["dialogHelper","require","layoutManager","globalize","userSettings","connectionManager","loading","focusManager","dom","apphost","emby-select","listViewStyle","paper-icon-button-light","css!./../formdialog","material-icons","css!./subtitleeditor","emby-button","flexStyles"],function(dialogHelper,require,layoutManager,globalize,userSettings,connectionManager,loading,focusManager,dom,appHost){"use strict";function downloadRemoteSubtitles(context,id){var url="Items/"+currentItem.Id+"/RemoteSearch/Subtitles/"+id,apiClient=connectionManager.getApiClient(currentItem.ServerId);apiClient.ajax({type:"POST",url:apiClient.getUrl(url)}).then(function(){hasChanges=!0,require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#MessageDownloadQueued"))}),focusManager.autoFocus(context)})}function deleteLocalSubtitle(context,index){var msg=globalize.translate("sharedcomponents#MessageAreYouSureDeleteSubtitles");require(["confirm"],function(confirm){confirm({title:globalize.translate("sharedcomponents#ConfirmDeletion"),text:msg,confirmText:globalize.translate("sharedcomponents#Delete"),primary:"cancel"}).then(function(){loading.show();var itemId=currentItem.Id,url="Videos/"+itemId+"/Subtitles/"+index,apiClient=connectionManager.getApiClient(currentItem.ServerId);apiClient.ajax({type:"DELETE",url:apiClient.getUrl(url)}).then(function(){hasChanges=!0,reload(context,apiClient,itemId)})})})}function fillSubtitleList(context,item){var streams=item.MediaStreams||[],subs=streams.filter(function(s){return"Subtitle"===s.Type}),html="";subs.length&&(html+="

    "+globalize.translate("sharedcomponents#MySubtitles")+"

    ",html+=layoutManager.tv?'
    ':'
    ',html+=subs.map(function(s){var itemHtml="",tagName=layoutManager.tv?"button":"div",className=layoutManager.tv&&s.Path?"listItem btnDelete":"listItem";return layoutManager.tv&&(className+=" listItem-focusscale listItem-button"),className+=" listItem-noborder",itemHtml+="<"+tagName+' class="'+className+'" data-index="'+s.Index+'">',itemHtml+='closed_caption',itemHtml+='
    ',itemHtml+="
    ",itemHtml+=s.DisplayTitle||"",itemHtml+="
    ",s.Path&&(itemHtml+='
    '+s.Path+"
    "),itemHtml+="",itemHtml+="
    ",layoutManager.tv||s.Path&&(itemHtml+=''),itemHtml+=""}).join(""),html+="
    ");var elem=context.querySelector(".subtitleList");subs.length?elem.classList.remove("hide"):elem.classList.add("hide"),elem.innerHTML=html}function fillLanguages(context,apiClient,languages){var selectLanguage=context.querySelector("#selectLanguage");selectLanguage.innerHTML=languages.map(function(l){return'"});var lastLanguage=userSettings.get("subtitleeditor-language");lastLanguage?selectLanguage.value=lastLanguage:apiClient.getCurrentUser().then(function(user){var lang=user.Configuration.SubtitleLanguagePreference;lang&&(selectLanguage.value=lang)})}function renderSearchResults(context,results){var lastProvider="",html="";if(!results.length)return context.querySelector(".noSearchResults").classList.remove("hide"),context.querySelector(".subtitleResults").innerHTML="",void loading.hide();context.querySelector(".noSearchResults").classList.add("hide");for(var i=0,length=results.length;i0&&(html+="
    "),html+="

    "+provider+"

    ",html+=layoutManager.tv?'
    ':'
    ',lastProvider=provider);var tagName=layoutManager.tv?"button":"div",className=layoutManager.tv?"listItem btnOptions":"listItem";layoutManager.tv&&(className+=" listItem-focusscale listItem-button"),html+="<"+tagName+' class="'+className+'" data-subid="'+result.Id+'">',html+='closed_caption';var bodyClass=result.Comment||result.IsHashMatch?"three-line":"two-line";html+='
    ',html+="
    "+result.Name+"
    ",html+='
    ',result.Format&&(html+=''+globalize.translate("sharedcomponents#FormatValue",result.Format)+""),null!=result.DownloadCount&&(html+=""+globalize.translate("sharedcomponents#DownloadsValue",result.DownloadCount)+""),html+="
    ",result.Comment&&(html+='
    '+result.Comment+"
    "),result.IsHashMatch&&(html+='
    '+globalize.translate("sharedcomponents#PerfectMatch")+"
    "),html+="
    ",layoutManager.tv||(html+=''),html+=""}results.length&&(html+="
    ");var elem=context.querySelector(".subtitleResults");elem.innerHTML=html,loading.hide()}function searchForSubtitles(context,language){userSettings.set("subtitleeditor-language",language),loading.show();var apiClient=connectionManager.getApiClient(currentItem.ServerId),url=apiClient.getUrl("Items/"+currentItem.Id+"/RemoteSearch/Subtitles/"+language);apiClient.getJSON(url).then(function(results){renderSearchResults(context,results)})}function reload(context,apiClient,itemId){function onGetItem(item){currentItem=item,fillSubtitleList(context,item);var file=item.Path||"",index=Math.max(file.lastIndexOf("/"),file.lastIndexOf("\\"));index>-1&&(file=file.substring(index+1)),file?(context.querySelector(".pathValue").innerHTML=file,context.querySelector(".originalFile").classList.remove("hide")):(context.querySelector(".pathValue").innerHTML="",context.querySelector(".originalFile").classList.add("hide")),loading.hide()}context.querySelector(".noSearchResults").classList.add("hide"),"string"==typeof itemId?apiClient.getItem(apiClient.getCurrentUserId(),itemId).then(onGetItem):onGetItem(itemId)}function onSearchSubmit(e){var form=this,lang=form.querySelector("#selectLanguage",form).value;return searchForSubtitles(dom.parentWithClass(form,"formDialogContent"),lang),e.preventDefault(),!1}function onSubtitleListClick(e){var btnDelete=dom.parentWithClass(e.target,"btnDelete");if(btnDelete){var index=btnDelete.getAttribute("data-index"),context=dom.parentWithClass(btnDelete,"subtitleEditorDialog");deleteLocalSubtitle(context,index)}}function onSubtitleResultsClick(e){var subtitleId,context,btnOptions=dom.parentWithClass(e.target,"btnOptions");btnOptions&&(subtitleId=btnOptions.getAttribute("data-subid"),context=dom.parentWithClass(btnOptions,"subtitleEditorDialog"),showDownloadOptions(btnOptions,context,subtitleId));var btnDownload=dom.parentWithClass(e.target,"btnDownload");btnDownload&&(subtitleId=btnDownload.getAttribute("data-subid"),context=dom.parentWithClass(btnDownload,"subtitleEditorDialog"),downloadRemoteSubtitles(context,subtitleId))}function showDownloadOptions(button,context,subtitleId){var items=[];items.push({name:Globalize.translate("sharedcomponents#Download"),id:"download"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:items,positionTo:button}).then(function(id){switch(id){case"download":downloadRemoteSubtitles(context,subtitleId)}})})}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function showEditorInternal(itemId,serverId,template){hasChanges=!1;var apiClient=connectionManager.getApiClient(serverId);return apiClient.getItem(apiClient.getCurrentUserId(),itemId).then(function(item){var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.classList.add("subtitleEditorDialog"),dlg.innerHTML=globalize.translateDocument(template,"sharedcomponents"),dlg.querySelector(".originalSubtitleFileLabel").innerHTML=globalize.translate("sharedcomponents#File"),dlg.querySelector(".subtitleSearchForm").addEventListener("submit",onSearchSubmit);var btnSubmit=dlg.querySelector(".btnSubmit");layoutManager.tv?(centerFocus(dlg.querySelector(".formDialogContent"),!1,!0),dlg.querySelector(".btnSearchSubtitles").classList.add("hide")):btnSubmit.classList.add("hide");var editorContent=dlg.querySelector(".formDialogContent");return dlg.querySelector(".subtitleList").addEventListener("click",onSubtitleListClick),dlg.querySelector(".subtitleResults").addEventListener("click",onSubtitleResultsClick),apiClient.getCultures().then(function(languages){fillLanguages(editorContent,apiClient,languages)}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),new Promise(function(resolve,reject){dlg.addEventListener("close",function(){layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),hasChanges?resolve():reject()}),dialogHelper.open(dlg),reload(editorContent,apiClient,item)})})}function showEditor(itemId,serverId){return loading.show(),new Promise(function(resolve,reject){require(["text!./subtitleeditor.template.html"],function(template){showEditorInternal(itemId,serverId,template).then(resolve,reject)})})}var currentItem,hasChanges;return{show:showEditor}}); \ No newline at end of file +define(["dialogHelper","require","layoutManager","globalize","userSettings","connectionManager","loading","focusManager","dom","apphost","emby-select","listViewStyle","paper-icon-button-light","css!./../formdialog","material-icons","css!./subtitleeditor","emby-button","flexStyles"],function(dialogHelper,require,layoutManager,globalize,userSettings,connectionManager,loading,focusManager,dom,appHost){"use strict";function downloadRemoteSubtitles(context,id){var url="Items/"+currentItem.Id+"/RemoteSearch/Subtitles/"+id,apiClient=connectionManager.getApiClient(currentItem.ServerId);apiClient.ajax({type:"POST",url:apiClient.getUrl(url)}).then(function(){hasChanges=!0,require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#MessageDownloadQueued"))}),focusManager.autoFocus(context)})}function deleteLocalSubtitle(context,index){var msg=globalize.translate("sharedcomponents#MessageAreYouSureDeleteSubtitles");require(["confirm"],function(confirm){confirm({title:globalize.translate("sharedcomponents#ConfirmDeletion"),text:msg,confirmText:globalize.translate("sharedcomponents#Delete"),primary:"cancel"}).then(function(){loading.show();var itemId=currentItem.Id,url="Videos/"+itemId+"/Subtitles/"+index,apiClient=connectionManager.getApiClient(currentItem.ServerId);apiClient.ajax({type:"DELETE",url:apiClient.getUrl(url)}).then(function(){hasChanges=!0,reload(context,apiClient,itemId)})})})}function fillSubtitleList(context,item){var streams=item.MediaStreams||[],subs=streams.filter(function(s){return"Subtitle"===s.Type}),html="";subs.length&&(html+="

    "+globalize.translate("sharedcomponents#MySubtitles")+"

    ",layoutManager.tv?html+='
    ':html+='
    ',html+=subs.map(function(s){var itemHtml="",tagName=layoutManager.tv?"button":"div",className=layoutManager.tv&&s.Path?"listItem btnDelete":"listItem";return layoutManager.tv&&(className+=" listItem-focusscale listItem-button"),className+=" listItem-noborder",itemHtml+="<"+tagName+' class="'+className+'" data-index="'+s.Index+'">',itemHtml+='closed_caption',itemHtml+='
    ',itemHtml+="
    ",itemHtml+=s.DisplayTitle||"",itemHtml+="
    ",s.Path&&(itemHtml+='
    '+s.Path+"
    "),itemHtml+="",itemHtml+="
    ",layoutManager.tv||s.Path&&(itemHtml+=''),itemHtml+=""}).join(""),html+="
    ");var elem=context.querySelector(".subtitleList");subs.length?elem.classList.remove("hide"):elem.classList.add("hide"),elem.innerHTML=html}function fillLanguages(context,apiClient,languages){var selectLanguage=context.querySelector("#selectLanguage");selectLanguage.innerHTML=languages.map(function(l){return'"});var lastLanguage=userSettings.get("subtitleeditor-language");lastLanguage?selectLanguage.value=lastLanguage:apiClient.getCurrentUser().then(function(user){var lang=user.Configuration.SubtitleLanguagePreference;lang&&(selectLanguage.value=lang)})}function renderSearchResults(context,results){var lastProvider="",html="";if(!results.length)return context.querySelector(".noSearchResults").classList.remove("hide"),context.querySelector(".subtitleResults").innerHTML="",void loading.hide();context.querySelector(".noSearchResults").classList.add("hide");for(var i=0,length=results.length;i0&&(html+="
    "),html+="

    "+provider+"

    ",layoutManager.tv?html+='
    ':html+='
    ',lastProvider=provider);var tagName=layoutManager.tv?"button":"div",className=layoutManager.tv?"listItem btnOptions":"listItem";layoutManager.tv&&(className+=" listItem-focusscale listItem-button"),html+="<"+tagName+' class="'+className+'" data-subid="'+result.Id+'">',html+='closed_caption';html+='
    ',html+="
    "+result.Name+"
    ",html+='
    ',result.Format&&(html+=''+globalize.translate("sharedcomponents#FormatValue",result.Format)+""),null!=result.DownloadCount&&(html+=""+globalize.translate("sharedcomponents#DownloadsValue",result.DownloadCount)+""),html+="
    ",result.Comment&&(html+='
    '+result.Comment+"
    "),result.IsHashMatch&&(html+='
    '+globalize.translate("sharedcomponents#PerfectMatch")+"
    "),html+="
    ",layoutManager.tv||(html+=''),html+=""}results.length&&(html+="
    "),context.querySelector(".subtitleResults").innerHTML=html,loading.hide()}function searchForSubtitles(context,language){userSettings.set("subtitleeditor-language",language),loading.show();var apiClient=connectionManager.getApiClient(currentItem.ServerId),url=apiClient.getUrl("Items/"+currentItem.Id+"/RemoteSearch/Subtitles/"+language);apiClient.getJSON(url).then(function(results){renderSearchResults(context,results)})}function reload(context,apiClient,itemId){function onGetItem(item){currentItem=item,fillSubtitleList(context,item);var file=item.Path||"",index=Math.max(file.lastIndexOf("/"),file.lastIndexOf("\\"));index>-1&&(file=file.substring(index+1)),file?(context.querySelector(".pathValue").innerHTML=file,context.querySelector(".originalFile").classList.remove("hide")):(context.querySelector(".pathValue").innerHTML="",context.querySelector(".originalFile").classList.add("hide")),loading.hide()}context.querySelector(".noSearchResults").classList.add("hide"),"string"==typeof itemId?apiClient.getItem(apiClient.getCurrentUserId(),itemId).then(onGetItem):onGetItem(itemId)}function onSearchSubmit(e){var form=this,lang=form.querySelector("#selectLanguage",form).value;return searchForSubtitles(dom.parentWithClass(form,"formDialogContent"),lang),e.preventDefault(),!1}function onSubtitleListClick(e){var btnDelete=dom.parentWithClass(e.target,"btnDelete");if(btnDelete){var index=btnDelete.getAttribute("data-index");deleteLocalSubtitle(dom.parentWithClass(btnDelete,"subtitleEditorDialog"),index)}}function onSubtitleResultsClick(e){var subtitleId,context,btnOptions=dom.parentWithClass(e.target,"btnOptions");btnOptions&&(subtitleId=btnOptions.getAttribute("data-subid"),context=dom.parentWithClass(btnOptions,"subtitleEditorDialog"),showDownloadOptions(btnOptions,context,subtitleId));var btnDownload=dom.parentWithClass(e.target,"btnDownload");btnDownload&&(subtitleId=btnDownload.getAttribute("data-subid"),context=dom.parentWithClass(btnDownload,"subtitleEditorDialog"),downloadRemoteSubtitles(context,subtitleId))}function showDownloadOptions(button,context,subtitleId){var items=[];items.push({name:Globalize.translate("sharedcomponents#Download"),id:"download"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:items,positionTo:button}).then(function(id){switch(id){case"download":downloadRemoteSubtitles(context,subtitleId)}})})}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function showEditorInternal(itemId,serverId,template){hasChanges=!1;var apiClient=connectionManager.getApiClient(serverId);return apiClient.getItem(apiClient.getCurrentUserId(),itemId).then(function(item){var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.classList.add("subtitleEditorDialog"),dlg.innerHTML=globalize.translateDocument(template,"sharedcomponents"),dlg.querySelector(".originalSubtitleFileLabel").innerHTML=globalize.translate("sharedcomponents#File"),dlg.querySelector(".subtitleSearchForm").addEventListener("submit",onSearchSubmit);var btnSubmit=dlg.querySelector(".btnSubmit");layoutManager.tv?(centerFocus(dlg.querySelector(".formDialogContent"),!1,!0),dlg.querySelector(".btnSearchSubtitles").classList.add("hide")):btnSubmit.classList.add("hide");var editorContent=dlg.querySelector(".formDialogContent");return dlg.querySelector(".subtitleList").addEventListener("click",onSubtitleListClick),dlg.querySelector(".subtitleResults").addEventListener("click",onSubtitleResultsClick),apiClient.getCultures().then(function(languages){fillLanguages(editorContent,apiClient,languages)}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),new Promise(function(resolve,reject){dlg.addEventListener("close",function(){layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),hasChanges?resolve():reject()}),dialogHelper.open(dlg),reload(editorContent,apiClient,item)})})}function showEditor(itemId,serverId){return loading.show(),new Promise(function(resolve,reject){require(["text!./subtitleeditor.template.html"],function(template){showEditorInternal(itemId,serverId,template).then(resolve,reject)})})}var currentItem,hasChanges;return{show:showEditor}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/sync/sync.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/sync/sync.js index e961202955..9a7322f359 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/sync/sync.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/sync/sync.js @@ -1 +1 @@ -define(["apphost","globalize","connectionManager","layoutManager","focusManager","scrollHelper","appSettings","registrationServices","dialogHelper","paper-icon-button-light","formDialogStyle"],function(appHost,globalize,connectionManager,layoutManager,focusManager,scrollHelper,appSettings,registrationServices,dialogHelper){"use strict";function submitJob(dlg,apiClient,userId,syncOptions,form){if(!userId)throw new Error("userId cannot be null");if(!syncOptions)throw new Error("syncOptions cannot be null");if(!form)throw new Error("form cannot be null");var selectSyncTarget=form.querySelector("#selectSyncTarget"),target=selectSyncTarget?selectSyncTarget.value:null;if(!target)return require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#PleaseSelectDeviceToSyncTo"))}),!1;var options={userId:userId,TargetId:target,ParentId:syncOptions.ParentId,Category:syncOptions.Category};return setJobValues(options,form),syncOptions.items&&syncOptions.items.length&&(options.ItemIds=(syncOptions.items||[]).map(function(i){return i.Id||i}).join(",")),apiClient.ajax({type:"POST",url:apiClient.getUrl("Sync/Jobs"),data:JSON.stringify(options),contentType:"application/json",dataType:"json"}).then(function(){dialogHelper.close(dlg),require(["toast"],function(toast){var msg=target===apiClient.deviceId()?globalize.translate("sharedcomponents#DownloadingDots"):globalize.translate("sharedcomponents#SyncJobCreated");toast(msg),syncOptions.isLocalSync&&syncNow()})}),!0}function syncNow(){require(["localsync"],function(localSync){localSync.sync()})}function submitQuickSyncJob(apiClient,userId,targetId,syncOptions){if(!userId)throw new Error("userId cannot be null");if(!syncOptions)throw new Error("syncOptions cannot be null");if(!targetId)throw new Error("targetId cannot be null");var options={userId:userId,TargetId:targetId,ParentId:syncOptions.ParentId,Category:syncOptions.Category,Quality:syncOptions.Quality,Bitrate:syncOptions.Bitrate};return syncOptions.items&&syncOptions.items.length&&(options.ItemIds=(syncOptions.items||[]).map(function(i){return i.Id||i}).join(",")),apiClient.ajax({type:"POST",url:apiClient.getUrl("Sync/Jobs"),data:JSON.stringify(options),contentType:"application/json",dataType:"json"}).then(function(){require(["toast"],function(toast){var msg=targetId===apiClient.deviceId()?globalize.translate("sharedcomponents#DownloadingDots"):globalize.translate("sharedcomponents#SyncJobCreated");toast(msg),syncOptions.isLocalSync&&syncNow()})})}function setJobValues(job,form){var txtBitrate=form.querySelector("#txtBitrate"),bitrate=txtBitrate?txtBitrate.value:null;bitrate&&(bitrate=1e6*parseFloat(bitrate)),job.Bitrate=bitrate;var selectQuality=form.querySelector("#selectQuality");selectQuality&&(job.Quality=selectQuality.value,appSettings.set("sync-lastquality",job.Quality||""));var selectProfile=form.querySelector("#selectProfile");selectProfile&&(job.Profile=selectProfile.value);var txtItemLimit=form.querySelector("#txtItemLimit");txtItemLimit&&(job.ItemLimit=txtItemLimit.value||null);var chkSyncNewContent=form.querySelector("#chkSyncNewContent");chkSyncNewContent&&(job.SyncNewContent=chkSyncNewContent.checked);var chkUnwatchedOnly=form.querySelector("#chkUnwatchedOnly");chkUnwatchedOnly&&(job.UnwatchedOnly=chkUnwatchedOnly.checked)}function renderForm(options){return new Promise(function(resolve,reject){require(["emby-checkbox","emby-input","emby-select"],function(){appHost.appInfo().then(function(appInfo){renderFormInternal(options,appInfo,resolve)})})})}function renderFormInternal(options,appInfo,resolve){var elem=options.elem,dialogOptions=options.dialogOptions,targets=dialogOptions.Targets,html="",targetContainerClass=options.isLocalSync?" hide":"",syncTargetLabel=globalize.translate("sharedcomponents#LabelSyncTo");options.readOnlySyncTarget?(html+='
    ',html+='',html+="
    "):(html+='
    ',html+='",targets.length||(html+='
    '+globalize.translate("sharedcomponents#LabelSyncNoTargetsHelp")+"
    "),appHost.supports("externallinks")&&(html+='"),html+="
    "),html+='
    ',html+='",html+='
    ',html+="
    ",html+='
    ',html+='",html+='
    ',html+="
    ",html+='
    ',html+='',html+="
    ",dialogOptions.Options.indexOf("UnwatchedOnly")!==-1&&(html+='
    ',html+="",html+='
    '+globalize.translate("sharedcomponents#SyncUnwatchedVideosOnlyHelp")+"
    ",html+="
    "),dialogOptions.Options.indexOf("SyncNewContent")!==-1&&(html+='
    ',html+="",html+='
    '+globalize.translate("sharedcomponents#AutomaticallySyncNewContentHelp")+"
    ",html+="
    "),dialogOptions.Options.indexOf("ItemLimit")!==-1&&(html+='
    ',html+='',html+='
    '+globalize.translate("sharedcomponents#LabelItemLimitHelp")+"
    ",html+="
    "),elem.innerHTML=html;var selectSyncTarget=elem.querySelector("#selectSyncTarget");selectSyncTarget&&(selectSyncTarget.addEventListener("change",function(){loadQualityOptions(elem,this.value,options.dialogOptionsFn).then(resolve)}),selectSyncTarget.dispatchEvent(new CustomEvent("change",{bubbles:!0})));var selectProfile=elem.querySelector("#selectProfile");selectProfile&&(selectProfile.addEventListener("change",function(){onProfileChange(elem,this.value)}),dialogOptions.ProfileOptions.length&&selectProfile.dispatchEvent(new CustomEvent("change",{bubbles:!0})));var selectQuality=elem.querySelector("#selectQuality");selectQuality&&(selectQuality.addEventListener("change",function(){onQualityChange(elem,this.value)}),selectQuality.dispatchEvent(new CustomEvent("change",{bubbles:!0}))),setTimeout(function(){focusManager.autoFocus(elem)},100)}function showWifiMessage(){require(["dialog","appRouter"],function(dialog,appRouter){var options={title:globalize.translate("sharedcomponents#HeaderWaitingForWifi"),text:globalize.translate("sharedcomponents#WifiRequiredToDownload")},items=[];items.push({name:options.confirmText||globalize.translate("sharedcomponents#ButtonOk"),id:"ok",type:"submit"}),items.push({name:options.cancelText||globalize.translate("sharedcomponents#HeaderDownloadSettings"),id:"downloadsettings",type:"cancel"}),options.buttons=items,dialog(options).then(function(result){return"ok"===result?Promise.resolve():"downloadsettings"===result?(appRouter.show(appRouter.getRouteUrl("downloadsettings")),Promise.resolve()):Promise.reject()})})}function validateNetwork(){var network=navigator.connection?navigator.connection.type:null;switch(network){case"cellular":case"bluetooth":return showWifiMessage(),!1;default:return!0}}function showSyncMenu(options){return options.isLocalSync&&appSettings.syncOnlyOnWifi()&&!validateNetwork()?Promise.reject():registrationServices.validateFeature("sync").then(function(){return showSyncMenuInternal(options)})}function enableAutoSync(options){if(!options.isLocalSync)return!1;var firstItem=(options.items||[])[0]||{};return"Audio"===firstItem.Type||("MusicAlbum"===firstItem.Type||("MusicArtist"===firstItem.Type||("MusicGenre"===firstItem.Type||"Playlist"===firstItem.Type&&"Audio"===firstItem.MediaType)))}function showSyncMenuInternal(options){var apiClient=connectionManager.getApiClient(options.serverId),userId=apiClient.getCurrentUserId();if(enableAutoSync(options))return submitQuickSyncJob(apiClient,userId,apiClient.deviceId(),{items:options.items,Quality:"custom",Bitrate:appSettings.maxStaticMusicBitrate()});var dialogOptionsFn=getTargetDialogOptionsFn(apiClient,{UserId:userId,ItemIds:(options.items||[]).map(function(i){return i.Id||i}).join(","),ParentId:options.ParentId,Category:options.Category});return dialogOptionsFn().then(function(dialogOptions){currentDialogOptions=dialogOptions;var dlgElementOptions={removeOnClose:!0,scrollY:!1,autoFocus:!1};layoutManager.tv?dlgElementOptions.size="fullscreen":dlgElementOptions.size="small";var dlg=dialogHelper.createDialog(dlgElementOptions);dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ';var syncButtonLabel=options.isLocalSync?globalize.translate("sharedcomponents#Download"):globalize.translate("sharedcomponents#Sync");html+=syncButtonLabel,html+="

    ",appHost.supports("externallinks")&&(html+='info'+globalize.translate("sharedcomponents#Help")+""),html+="
    ",html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='",html+="
    ",html+="
    ",html+="
    ",html+="
    ",dlg.innerHTML=html;var submitted=!1;dlg.querySelector("form").addEventListener("submit",function(e){return submitted=submitJob(dlg,apiClient,userId,options,this),e.preventDefault(),!1}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1);var promise=dialogHelper.open(dlg);return renderForm({elem:dlg.querySelector(".formFields"),dialogOptions:dialogOptions,dialogOptionsFn:dialogOptionsFn,isLocalSync:options.isLocalSync}),promise.then(function(){return layoutManager.tv&&scrollHelper.centerFocus.off(dlg.querySelector(".formDialogContent"),!1),submitted?Promise.resolve():Promise.reject()})})}function getTargetDialogOptionsFn(apiClient,query){return function(targetId){return query.TargetId=targetId,apiClient.getJSON(apiClient.getUrl("Sync/Options",query))}}function setQualityFieldVisible(form,visible){var fldQuality=form.querySelector(".fldQuality"),selectQuality=form.querySelector("#selectQuality");visible?(fldQuality&&fldQuality.classList.remove("hide"),selectQuality&&selectQuality.removeAttribute("required")):(fldQuality&&fldQuality.classList.add("hide"),selectQuality&&selectQuality.removeAttribute("required"))}function onProfileChange(form,profileId){var options=currentDialogOptions||{},profileOptions=options.ProfileOptions||[];if(profileOptions.length){var option=profileOptions.filter(function(o){return o.Id===profileId})[0],qualityOptions=options.QualityOptions||[];option?(form.querySelector(".profileDescription").innerHTML=option.Description||"",setQualityFieldVisible(form,qualityOptions.length>0&&option.EnableQualityOptions&&options.Options.indexOf("Quality")!==-1)):(form.querySelector(".profileDescription").innerHTML="",setQualityFieldVisible(form,qualityOptions.length>0&&options.Options.indexOf("Quality")!==-1))}}function onQualityChange(form,qualityId){var options=currentDialogOptions||{},option=(options.QualityOptions||[]).filter(function(o){return o.Id===qualityId})[0],qualityDescription=form.querySelector(".qualityDescription");option?qualityDescription.innerHTML=option.Description||"":qualityDescription.innerHTML="";var fldBitrate=form.querySelector(".fldBitrate"),txtBitrate=form.querySelector("#txtBitrate");"custom"===qualityId?(fldBitrate&&fldBitrate.classList.remove("hide"),txtBitrate&&txtBitrate.setAttribute("required","required")):(fldBitrate&&fldBitrate.classList.add("hide"),txtBitrate&&txtBitrate.removeAttribute("required"))}function renderTargetDialogOptions(form,options){currentDialogOptions=options;var fldProfile=form.querySelector(".fldProfile"),selectProfile=form.querySelector("#selectProfile");options.ProfileOptions.length&&options.Options.indexOf("Profile")!==-1?(fldProfile&&fldProfile.classList.remove("hide"),selectProfile&&selectProfile.setAttribute("required","required")):(fldProfile&&fldProfile.classList.add("hide"),selectProfile&&selectProfile.removeAttribute("required")),setQualityFieldVisible(form,options.QualityOptions.length>0),selectProfile&&(selectProfile.innerHTML=options.ProfileOptions.map(function(o){var selectedAttribute=o.IsDefault?' selected="selected"':"";return'"}).join(""),selectProfile.dispatchEvent(new CustomEvent("change",{bubbles:!0})));var selectQuality=form.querySelector("#selectQuality");if(selectQuality){selectQuality.innerHTML=options.QualityOptions.map(function(o){var selectedAttribute=o.IsDefault?' selected="selected"':"";return'"}).join("");var lastQuality=appSettings.get("sync-lastquality");lastQuality&&options.QualityOptions.filter(function(i){return i.Id===lastQuality}).length&&(selectQuality.value=lastQuality),selectQuality.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}}function loadQualityOptions(form,targetId,dialogOptionsFn){return dialogOptionsFn(targetId).then(function(options){return renderTargetDialogOptions(form,options)})}var currentDialogOptions;return{showMenu:showSyncMenu,renderForm:renderForm,setJobValues:setJobValues}}); \ No newline at end of file +define(["apphost","globalize","connectionManager","layoutManager","focusManager","scrollHelper","appSettings","registrationServices","dialogHelper","paper-icon-button-light","formDialogStyle"],function(appHost,globalize,connectionManager,layoutManager,focusManager,scrollHelper,appSettings,registrationServices,dialogHelper){"use strict";function submitJob(dlg,apiClient,userId,syncOptions,form){if(!userId)throw new Error("userId cannot be null");if(!syncOptions)throw new Error("syncOptions cannot be null");if(!form)throw new Error("form cannot be null");var selectSyncTarget=form.querySelector("#selectSyncTarget"),target=selectSyncTarget?selectSyncTarget.value:null;if(!target)return require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#PleaseSelectDeviceToSyncTo"))}),!1;var options={userId:userId,TargetId:target,ParentId:syncOptions.ParentId,Category:syncOptions.Category};return setJobValues(options,form),syncOptions.items&&syncOptions.items.length&&(options.ItemIds=(syncOptions.items||[]).map(function(i){return i.Id||i}).join(",")),apiClient.ajax({type:"POST",url:apiClient.getUrl("Sync/Jobs"),data:JSON.stringify(options),contentType:"application/json",dataType:"json"}).then(function(){dialogHelper.close(dlg),require(["toast"],function(toast){toast(target===apiClient.deviceId()?globalize.translate("sharedcomponents#DownloadingDots"):globalize.translate("sharedcomponents#SyncJobCreated")),syncOptions.isLocalSync&&syncNow()})}),!0}function syncNow(){require(["localsync"],function(localSync){localSync.sync()})}function submitQuickSyncJob(apiClient,userId,targetId,syncOptions){if(!userId)throw new Error("userId cannot be null");if(!syncOptions)throw new Error("syncOptions cannot be null");if(!targetId)throw new Error("targetId cannot be null");var options={userId:userId,TargetId:targetId,ParentId:syncOptions.ParentId,Category:syncOptions.Category,Quality:syncOptions.Quality,Bitrate:syncOptions.Bitrate};return syncOptions.items&&syncOptions.items.length&&(options.ItemIds=(syncOptions.items||[]).map(function(i){return i.Id||i}).join(",")),apiClient.ajax({type:"POST",url:apiClient.getUrl("Sync/Jobs"),data:JSON.stringify(options),contentType:"application/json",dataType:"json"}).then(function(){require(["toast"],function(toast){toast(targetId===apiClient.deviceId()?globalize.translate("sharedcomponents#DownloadingDots"):globalize.translate("sharedcomponents#SyncJobCreated")),syncOptions.isLocalSync&&syncNow()})})}function setJobValues(job,form){var txtBitrate=form.querySelector("#txtBitrate"),bitrate=txtBitrate?txtBitrate.value:null;bitrate&&(bitrate=1e6*parseFloat(bitrate)),job.Bitrate=bitrate;var selectQuality=form.querySelector("#selectQuality");selectQuality&&(job.Quality=selectQuality.value,appSettings.set("sync-lastquality",job.Quality||""));var selectProfile=form.querySelector("#selectProfile");selectProfile&&(job.Profile=selectProfile.value);var txtItemLimit=form.querySelector("#txtItemLimit");txtItemLimit&&(job.ItemLimit=txtItemLimit.value||null);var chkSyncNewContent=form.querySelector("#chkSyncNewContent");chkSyncNewContent&&(job.SyncNewContent=chkSyncNewContent.checked);var chkUnwatchedOnly=form.querySelector("#chkUnwatchedOnly");chkUnwatchedOnly&&(job.UnwatchedOnly=chkUnwatchedOnly.checked)}function renderForm(options){return new Promise(function(resolve,reject){require(["emby-checkbox","emby-input","emby-select"],function(){appHost.appInfo().then(function(appInfo){renderFormInternal(options,appInfo,resolve)})})})}function renderFormInternal(options,appInfo,resolve){var elem=options.elem,dialogOptions=options.dialogOptions,targets=dialogOptions.Targets,html="",targetContainerClass=options.isLocalSync?" hide":"",syncTargetLabel=globalize.translate("sharedcomponents#LabelSyncTo");options.readOnlySyncTarget?(html+='
    ',html+='',html+="
    "):(html+='
    ',html+='",targets.length||(html+='
    '+globalize.translate("sharedcomponents#LabelSyncNoTargetsHelp")+"
    "),appHost.supports("externallinks")&&(html+='"),html+="
    "),html+='
    ',html+='",html+='
    ',html+="
    ",html+='
    ',html+='",html+='
    ',html+="
    ",html+='
    ',html+='',html+="
    ",-1!==dialogOptions.Options.indexOf("UnwatchedOnly")&&(html+='
    ',html+="",html+='
    '+globalize.translate("sharedcomponents#SyncUnwatchedVideosOnlyHelp")+"
    ",html+="
    "),-1!==dialogOptions.Options.indexOf("SyncNewContent")&&(html+='
    ',html+="",html+='
    '+globalize.translate("sharedcomponents#AutomaticallySyncNewContentHelp")+"
    ",html+="
    "),-1!==dialogOptions.Options.indexOf("ItemLimit")&&(html+='
    ',html+='',html+='
    '+globalize.translate("sharedcomponents#LabelItemLimitHelp")+"
    ",html+="
    "),elem.innerHTML=html;var selectSyncTarget=elem.querySelector("#selectSyncTarget");selectSyncTarget&&(selectSyncTarget.addEventListener("change",function(){loadQualityOptions(elem,this.value,options.dialogOptionsFn).then(resolve)}),selectSyncTarget.dispatchEvent(new CustomEvent("change",{bubbles:!0})));var selectProfile=elem.querySelector("#selectProfile");selectProfile&&(selectProfile.addEventListener("change",function(){onProfileChange(elem,this.value)}),dialogOptions.ProfileOptions.length&&selectProfile.dispatchEvent(new CustomEvent("change",{bubbles:!0})));var selectQuality=elem.querySelector("#selectQuality");selectQuality&&(selectQuality.addEventListener("change",function(){onQualityChange(elem,this.value)}),selectQuality.dispatchEvent(new CustomEvent("change",{bubbles:!0}))),setTimeout(function(){focusManager.autoFocus(elem)},100)}function showWifiMessage(){require(["dialog","appRouter"],function(dialog,appRouter){var options={title:globalize.translate("sharedcomponents#HeaderWaitingForWifi"),text:globalize.translate("sharedcomponents#WifiRequiredToDownload")},items=[];items.push({name:options.confirmText||globalize.translate("sharedcomponents#ButtonOk"),id:"ok",type:"submit"}),items.push({name:options.cancelText||globalize.translate("sharedcomponents#HeaderDownloadSettings"),id:"downloadsettings",type:"cancel"}),options.buttons=items,dialog(options).then(function(result){return"ok"===result?Promise.resolve():"downloadsettings"===result?(appRouter.show(appRouter.getRouteUrl("downloadsettings")),Promise.resolve()):Promise.reject()})})}function validateNetwork(){switch(navigator.connection?navigator.connection.type:null){case"cellular":case"bluetooth":return showWifiMessage(),!1;default:return!0}}function showSyncMenu(options){return options.isLocalSync&&appSettings.syncOnlyOnWifi()&&!validateNetwork()?Promise.reject():registrationServices.validateFeature("sync").then(function(){return showSyncMenuInternal(options)})}function enableAutoSync(options){if(!options.isLocalSync)return!1;var firstItem=(options.items||[])[0]||{};return"Audio"===firstItem.Type||("MusicAlbum"===firstItem.Type||("MusicArtist"===firstItem.Type||("MusicGenre"===firstItem.Type||"Playlist"===firstItem.Type&&"Audio"===firstItem.MediaType)))}function showSyncMenuInternal(options){var apiClient=connectionManager.getApiClient(options.serverId),userId=apiClient.getCurrentUserId();if(enableAutoSync(options))return submitQuickSyncJob(apiClient,userId,apiClient.deviceId(),{items:options.items,Quality:"custom",Bitrate:appSettings.maxStaticMusicBitrate()});var dialogOptionsFn=getTargetDialogOptionsFn(apiClient,{UserId:userId,ItemIds:(options.items||[]).map(function(i){return i.Id||i}).join(","),ParentId:options.ParentId,Category:options.Category});return dialogOptionsFn().then(function(dialogOptions){currentDialogOptions=dialogOptions;var dlgElementOptions={removeOnClose:!0,scrollY:!1,autoFocus:!1};layoutManager.tv?dlgElementOptions.size="fullscreen":dlgElementOptions.size="small";var dlg=dialogHelper.createDialog(dlgElementOptions);dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ';var syncButtonLabel=options.isLocalSync?globalize.translate("sharedcomponents#Download"):globalize.translate("sharedcomponents#Sync");html+=syncButtonLabel,html+="

    ",appHost.supports("externallinks")&&(html+='info'+globalize.translate("sharedcomponents#Help")+""),html+="
    ",html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='",html+="
    ",html+="
    ",html+="
    ",html+="
    ",dlg.innerHTML=html;var submitted=!1;dlg.querySelector("form").addEventListener("submit",function(e){return submitted=submitJob(dlg,apiClient,userId,options,this),e.preventDefault(),!1}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1);var promise=dialogHelper.open(dlg);return renderForm({elem:dlg.querySelector(".formFields"),dialogOptions:dialogOptions,dialogOptionsFn:dialogOptionsFn,isLocalSync:options.isLocalSync}),promise.then(function(){return layoutManager.tv&&scrollHelper.centerFocus.off(dlg.querySelector(".formDialogContent"),!1),submitted?Promise.resolve():Promise.reject()})})}function getTargetDialogOptionsFn(apiClient,query){return function(targetId){return query.TargetId=targetId,apiClient.getJSON(apiClient.getUrl("Sync/Options",query))}}function setQualityFieldVisible(form,visible){var fldQuality=form.querySelector(".fldQuality"),selectQuality=form.querySelector("#selectQuality");visible?(fldQuality&&fldQuality.classList.remove("hide"),selectQuality&&selectQuality.removeAttribute("required")):(fldQuality&&fldQuality.classList.add("hide"),selectQuality&&selectQuality.removeAttribute("required"))}function onProfileChange(form,profileId){var options=currentDialogOptions||{},profileOptions=options.ProfileOptions||[];if(profileOptions.length){var option=profileOptions.filter(function(o){return o.Id===profileId})[0],qualityOptions=options.QualityOptions||[];option?(form.querySelector(".profileDescription").innerHTML=option.Description||"",setQualityFieldVisible(form,qualityOptions.length>0&&option.EnableQualityOptions&&-1!==options.Options.indexOf("Quality"))):(form.querySelector(".profileDescription").innerHTML="",setQualityFieldVisible(form,qualityOptions.length>0&&-1!==options.Options.indexOf("Quality")))}}function onQualityChange(form,qualityId){var options=currentDialogOptions||{},option=(options.QualityOptions||[]).filter(function(o){return o.Id===qualityId})[0],qualityDescription=form.querySelector(".qualityDescription");qualityDescription.innerHTML=option?option.Description||"":"";var fldBitrate=form.querySelector(".fldBitrate"),txtBitrate=form.querySelector("#txtBitrate");"custom"===qualityId?(fldBitrate&&fldBitrate.classList.remove("hide"),txtBitrate&&txtBitrate.setAttribute("required","required")):(fldBitrate&&fldBitrate.classList.add("hide"),txtBitrate&&txtBitrate.removeAttribute("required"))}function renderTargetDialogOptions(form,options){currentDialogOptions=options;var fldProfile=form.querySelector(".fldProfile"),selectProfile=form.querySelector("#selectProfile");options.ProfileOptions.length&&-1!==options.Options.indexOf("Profile")?(fldProfile&&fldProfile.classList.remove("hide"),selectProfile&&selectProfile.setAttribute("required","required")):(fldProfile&&fldProfile.classList.add("hide"),selectProfile&&selectProfile.removeAttribute("required")),setQualityFieldVisible(form,options.QualityOptions.length>0),selectProfile&&(selectProfile.innerHTML=options.ProfileOptions.map(function(o){var selectedAttribute=o.IsDefault?' selected="selected"':"";return'"}).join(""),selectProfile.dispatchEvent(new CustomEvent("change",{bubbles:!0})));var selectQuality=form.querySelector("#selectQuality");if(selectQuality){selectQuality.innerHTML=options.QualityOptions.map(function(o){var selectedAttribute=o.IsDefault?' selected="selected"':"";return'"}).join("");var lastQuality=appSettings.get("sync-lastquality");lastQuality&&options.QualityOptions.filter(function(i){return i.Id===lastQuality}).length&&(selectQuality.value=lastQuality),selectQuality.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}}function loadQualityOptions(form,targetId,dialogOptionsFn){return dialogOptionsFn(targetId).then(function(options){return renderTargetDialogOptions(form,options)})}var currentDialogOptions;return{showMenu:showSyncMenu,renderForm:renderForm,setJobValues:setJobValues}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/sync/syncjobeditor.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/sync/syncjobeditor.js index 0ab16fef66..c0415a5883 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/sync/syncjobeditor.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/sync/syncjobeditor.js @@ -1 +1 @@ -define(["connectionManager","serverNotifications","events","datetime","dom","imageLoader","loading","globalize","apphost","layoutManager","scrollHelper","dialogHelper","listViewStyle","paper-icon-button-light","emby-button","formDialogStyle","emby-linkbutton"],function(connectionManager,serverNotifications,events,datetime,dom,imageLoader,loading,globalize,appHost,layoutManager,scrollHelper,dialogHelper){"use strict";function syncNow(){require(["localsync"],function(localSync){localSync.sync()})}function renderJob(context,job,dialogOptions){require(["syncDialog"],function(syncDialog){syncDialog.renderForm({elem:context.querySelector(".syncJobFormContent"),dialogOptions:dialogOptions,dialogOptionsFn:getTargetDialogOptionsFn(dialogOptions),readOnlySyncTarget:!0}).then(function(){fillJobValues(context,job,dialogOptions)})})}function getTargetDialogOptionsFn(dialogOptions){return function(targetId){return Promise.resolve(dialogOptions)}}function getJobItemHtml(jobItem,apiClient,index){var nextAction,html="",status=jobItem.Status;"Failed"===status?nextAction="retry":"Cancelled"===status?nextAction="retry":"Queued"===status||"Transferring"===status||"Converting"===status||"ReadyToTransfer"===status?nextAction="cancel":"Synced"!==status||jobItem.IsMarkedForRemoval||(nextAction="remove");var listItemClass="listItem listItem-shaded";layoutManager.tv&&nextAction&&(listItemClass+=" btnJobItemMenu"),layoutManager.tv&&(listItemClass+=" listItem-button");var tagName=layoutManager.tv?"button":"div";html+="<"+tagName+' type="button" class="'+listItemClass+'" data-itemid="'+jobItem.Id+'" data-status="'+jobItem.Status+'" data-action="'+nextAction+'">';var imgUrl;jobItem.PrimaryImageItemId&&(imgUrl=apiClient.getImageUrl(jobItem.PrimaryImageItemId,{type:"Primary",width:80,tag:jobItem.PrimaryImageTag,minScale:1.5})),html+=imgUrl?'
    ":'sync',html+='
    ',html+='

    ',html+=jobItem.ItemName,html+="

    ",html+="Failed"===jobItem.Status?'
    ':'
    ',html+=globalize.translate("sharedcomponents#SyncJobItemStatus"+jobItem.Status),"Synced"===jobItem.Status&&jobItem.IsMarkedForRemoval&&(html+="
    ",html+=globalize.translate("sharedcomponents#RemovingFromDevice")),html+="
    ",html+='
    ',html+='
    ',html+="
    ",html+="
    ";"dots-horiz"===appHost.moreIcon?"":"";return layoutManager.tv||("retry"===nextAction?html+='':"cancel"===nextAction?html+='':"remove"===nextAction&&(html+='')),html+=""}function renderJobItems(context,items,apiClient){var html="";html+="

    "+globalize.translate("sharedcomponents#Items")+"

    ",html+='
    ';var index=0;html+=items.map(function(i){return getJobItemHtml(i,apiClient,index++)}).join(""),html+="
    ";var elem=context.querySelector(".jobItems");elem.innerHTML=html,imageLoader.lazyChildren(elem)}function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function showJobItemMenu(elem,jobId,apiClient){var action=elem.getAttribute("data-action"),context=parentWithClass(elem,"formDialog"),listItem=parentWithClass(elem,"listItem"),jobItemId=listItem.getAttribute("data-itemid");"retry"===action?retryJobItem(context,jobId,jobItemId,apiClient):"cancel"!==action&&"remove"!==action||cancelJobItem(context,jobId,jobItemId,apiClient)}function cancelJobItem(context,jobId,jobItemId,apiClient){showRemoveConfirm(function(){loading.show(),apiClient.ajax({type:"DELETE",url:apiClient.getUrl("Sync/JobItems/"+jobItemId)}).then(function(){appHost.supports("sync")&&syncNow(),loadJob(context,jobId,apiClient)})})}function retryJobItem(context,jobId,jobItemId,apiClient){showRetryConfirm(function(){apiClient.ajax({type:"POST",url:apiClient.getUrl("Sync/JobItems/"+jobItemId+"/Enable")}).then(function(){appHost.supports("sync")&&syncNow(),loadJob(context,jobId,apiClient)})})}function showRetryConfirm(callback){require(["confirm"],function(confirm){confirm({text:globalize.translate("sharedcomponents#ConfirmRemoveDownload"),confirmText:globalize.translate("sharedcomponents#RemoveDownload"),cancelText:globalize.translate("sharedcomponents#KeepDownload"),primary:"cancel"}).then(callback)})}function showRemoveConfirm(callback){require(["confirm"],function(confirm){confirm({text:globalize.translate("sharedcomponents#ConfirmRemoveDownload"),confirmText:globalize.translate("sharedcomponents#RemoveDownload"),cancelText:globalize.translate("sharedcomponents#KeepDownload"),primary:"cancel"}).then(callback)})}function fillJobValues(context,job,editOptions){var selectProfile=context.querySelector("#selectProfile");selectProfile&&(selectProfile.value=job.Profile||"");var selectQuality=context.querySelector("#selectQuality");selectQuality&&(selectQuality.value=job.Quality||"");var chkUnwatchedOnly=context.querySelector("#chkUnwatchedOnly");chkUnwatchedOnly&&(chkUnwatchedOnly.checked=job.UnwatchedOnly);var chkSyncNewContent=context.querySelector("#chkSyncNewContent");chkSyncNewContent&&(chkSyncNewContent.checked=job.SyncNewContent);var txtItemLimit=context.querySelector("#txtItemLimit");txtItemLimit&&(txtItemLimit.value=job.ItemLimit);var txtBitrate=context.querySelector("#txtBitrate");job.Bitrate?txtBitrate.value=job.Bitrate/1e6:txtBitrate.value="";var target=editOptions.Targets.filter(function(t){return t.Id===job.TargetId})[0],targetName=target?target.Name:"",selectSyncTarget=context.querySelector("#selectSyncTarget");selectSyncTarget&&(selectSyncTarget.value=targetName)}function loadJob(context,id,apiClient){loading.show(),apiClient.getJSON(apiClient.getUrl("Sync/Jobs/"+id)).then(function(job){apiClient.getJSON(apiClient.getUrl("Sync/Options",{UserId:job.UserId,ItemIds:job.RequestedItemIds&&job.RequestedItemIds.length?job.RequestedItemIds.join(""):null,ParentId:job.ParentId,Category:job.Category,TargetId:job.TargetId})).then(function(options){_jobOptions=options,renderJob(context,job,options),loading.hide()})}),apiClient.getJSON(apiClient.getUrl("Sync/JobItems",{JobId:id,AddMetadata:!0})).then(function(result){renderJobItems(context,result.Items,apiClient),loading.hide()})}function loadJobInfo(context,job,jobItems,apiClient){renderJobItems(context,jobItems,apiClient),loading.hide()}function saveJob(context,id,apiClient){loading.show(),apiClient.getJSON(apiClient.getUrl("Sync/Jobs/"+id)).then(function(job){require(["syncDialog"],function(syncDialog){syncDialog.setJobValues(job,context),apiClient.ajax({url:apiClient.getUrl("Sync/Jobs/"+id),type:"POST",data:JSON.stringify(job),contentType:"application/json"}).then(function(){appHost.supports("sync")&&syncNow(),loading.hide(),dialogHelper.close(context)})})})}function startListening(apiClient,jobId){var startParams="0,1500";startParams+=","+jobId,apiClient.sendMessage("SyncJobStart",startParams)}function stopListening(apiClient){apiClient.sendMessage("SyncJobStop","")}function bindEvents(context,jobId,apiClient){context.querySelector(".jobItems").addEventListener("click",function(e){var btnJobItemMenu=dom.parentWithClass(e.target,"btnJobItemMenu");btnJobItemMenu&&showJobItemMenu(btnJobItemMenu,jobId,apiClient)})}function showEditor(options){function onSyncJobMessage(e,apiClient,msg){loadJobInfo(dlg,msg.Job,msg.JobItems,apiClient)}var apiClient=connectionManager.getApiClient(options.serverId),id=options.jobId,dlgElementOptions={removeOnClose:!0,scrollY:!1,autoFocus:!1};layoutManager.tv?dlgElementOptions.size="fullscreen":dlgElementOptions.size="medium";var dlg=dialogHelper.createDialog(dlgElementOptions);dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ',html+=globalize.translate("sharedcomponents#Sync"),html+="

    ",appHost.supports("externallinks")&&(html+='info'+globalize.translate("sharedcomponents#Help")+""),html+="
    ",html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='",html+="
    ",html+="
    ",html+="
    ",html+="
    ",dlg.innerHTML=html;var submitted=!1;dlg.querySelector("form").addEventListener("submit",function(e){return saveJob(dlg,id,apiClient),e.preventDefault(),!1}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1),loadJob(dlg,id,apiClient),bindEvents(dlg,id,apiClient);var promise=dialogHelper.open(dlg);return startListening(apiClient,id),events.on(serverNotifications,"SyncJob",onSyncJobMessage),promise.then(function(){return stopListening(apiClient),events.off(serverNotifications,"SyncJob",onSyncJobMessage),layoutManager.tv&&scrollHelper.centerFocus.off(dlg.querySelector(".formDialogContent"),!1),submitted?Promise.resolve():Promise.reject()})}var _jobOptions;return{show:showEditor}}); \ No newline at end of file +define(["connectionManager","serverNotifications","events","datetime","dom","imageLoader","loading","globalize","apphost","layoutManager","scrollHelper","dialogHelper","listViewStyle","paper-icon-button-light","emby-button","formDialogStyle","emby-linkbutton"],function(connectionManager,serverNotifications,events,datetime,dom,imageLoader,loading,globalize,appHost,layoutManager,scrollHelper,dialogHelper){"use strict";function syncNow(){require(["localsync"],function(localSync){localSync.sync()})}function renderJob(context,job,dialogOptions){require(["syncDialog"],function(syncDialog){syncDialog.renderForm({elem:context.querySelector(".syncJobFormContent"),dialogOptions:dialogOptions,dialogOptionsFn:getTargetDialogOptionsFn(dialogOptions),readOnlySyncTarget:!0}).then(function(){fillJobValues(context,job,dialogOptions)})})}function getTargetDialogOptionsFn(dialogOptions){return function(targetId){return Promise.resolve(dialogOptions)}}function getJobItemHtml(jobItem,apiClient,index){var nextAction,html="",status=jobItem.Status;"Failed"===status?nextAction="retry":"Cancelled"===status?nextAction="retry":"Queued"===status||"Transferring"===status||"Converting"===status||"ReadyToTransfer"===status?nextAction="cancel":"Synced"!==status||jobItem.IsMarkedForRemoval||(nextAction="remove");var listItemClass="listItem listItem-shaded";layoutManager.tv&&nextAction&&(listItemClass+=" btnJobItemMenu"),layoutManager.tv&&(listItemClass+=" listItem-button");var tagName=layoutManager.tv?"button":"div";html+="<"+tagName+' type="button" class="'+listItemClass+'" data-itemid="'+jobItem.Id+'" data-status="'+jobItem.Status+'" data-action="'+nextAction+'">';var imgUrl;jobItem.PrimaryImageItemId&&(imgUrl=apiClient.getImageUrl(jobItem.PrimaryImageItemId,{type:"Primary",width:80,tag:jobItem.PrimaryImageTag,minScale:1.5})),html+=imgUrl?'
    ":'sync',html+='
    ',html+='

    ',html+=jobItem.ItemName,html+="

    ","Failed"===jobItem.Status?html+='
    ':html+='
    ',html+=globalize.translate("sharedcomponents#SyncJobItemStatus"+jobItem.Status),"Synced"===jobItem.Status&&jobItem.IsMarkedForRemoval&&(html+="
    ",html+=globalize.translate("sharedcomponents#RemovingFromDevice")),html+="
    ",html+='
    ',html+='
    ',html+="
    ",html+="
    ";appHost.moreIcon;return layoutManager.tv||("retry"===nextAction?html+='':"cancel"===nextAction?html+='':"remove"===nextAction&&(html+='')),html+=""}function renderJobItems(context,items,apiClient){var html="";html+="

    "+globalize.translate("sharedcomponents#Items")+"

    ",html+='
    ';var index=0;html+=items.map(function(i){return getJobItemHtml(i,apiClient,index++)}).join(""),html+="
    ";var elem=context.querySelector(".jobItems");elem.innerHTML=html,imageLoader.lazyChildren(elem)}function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(!(elem=elem.parentNode))return null;return elem}function showJobItemMenu(elem,jobId,apiClient){var action=elem.getAttribute("data-action"),context=parentWithClass(elem,"formDialog"),listItem=parentWithClass(elem,"listItem"),jobItemId=listItem.getAttribute("data-itemid");"retry"===action?retryJobItem(context,jobId,jobItemId,apiClient):"cancel"!==action&&"remove"!==action||cancelJobItem(context,jobId,jobItemId,apiClient)}function cancelJobItem(context,jobId,jobItemId,apiClient){showRemoveConfirm(function(){loading.show(),apiClient.ajax({type:"DELETE",url:apiClient.getUrl("Sync/JobItems/"+jobItemId)}).then(function(){appHost.supports("sync")&&syncNow(),loadJob(context,jobId,apiClient)})})}function retryJobItem(context,jobId,jobItemId,apiClient){showRetryConfirm(function(){apiClient.ajax({type:"POST",url:apiClient.getUrl("Sync/JobItems/"+jobItemId+"/Enable")}).then(function(){appHost.supports("sync")&&syncNow(),loadJob(context,jobId,apiClient)})})}function showRetryConfirm(callback){require(["confirm"],function(confirm){confirm({text:globalize.translate("sharedcomponents#ConfirmRemoveDownload"),confirmText:globalize.translate("sharedcomponents#RemoveDownload"),cancelText:globalize.translate("sharedcomponents#KeepDownload"),primary:"cancel"}).then(callback)})}function showRemoveConfirm(callback){require(["confirm"],function(confirm){confirm({text:globalize.translate("sharedcomponents#ConfirmRemoveDownload"),confirmText:globalize.translate("sharedcomponents#RemoveDownload"),cancelText:globalize.translate("sharedcomponents#KeepDownload"),primary:"cancel"}).then(callback)})}function fillJobValues(context,job,editOptions){var selectProfile=context.querySelector("#selectProfile");selectProfile&&(selectProfile.value=job.Profile||"");var selectQuality=context.querySelector("#selectQuality");selectQuality&&(selectQuality.value=job.Quality||"");var chkUnwatchedOnly=context.querySelector("#chkUnwatchedOnly");chkUnwatchedOnly&&(chkUnwatchedOnly.checked=job.UnwatchedOnly);var chkSyncNewContent=context.querySelector("#chkSyncNewContent");chkSyncNewContent&&(chkSyncNewContent.checked=job.SyncNewContent);var txtItemLimit=context.querySelector("#txtItemLimit");txtItemLimit&&(txtItemLimit.value=job.ItemLimit);var txtBitrate=context.querySelector("#txtBitrate");job.Bitrate?txtBitrate.value=job.Bitrate/1e6:txtBitrate.value="";var target=editOptions.Targets.filter(function(t){return t.Id===job.TargetId})[0],targetName=target?target.Name:"",selectSyncTarget=context.querySelector("#selectSyncTarget");selectSyncTarget&&(selectSyncTarget.value=targetName)}function loadJob(context,id,apiClient){loading.show(),apiClient.getJSON(apiClient.getUrl("Sync/Jobs/"+id)).then(function(job){apiClient.getJSON(apiClient.getUrl("Sync/Options",{UserId:job.UserId,ItemIds:job.RequestedItemIds&&job.RequestedItemIds.length?job.RequestedItemIds.join(""):null,ParentId:job.ParentId,Category:job.Category,TargetId:job.TargetId})).then(function(options){_jobOptions=options,renderJob(context,job,options),loading.hide()})}),apiClient.getJSON(apiClient.getUrl("Sync/JobItems",{JobId:id,AddMetadata:!0})).then(function(result){renderJobItems(context,result.Items,apiClient),loading.hide()})}function loadJobInfo(context,job,jobItems,apiClient){renderJobItems(context,jobItems,apiClient),loading.hide()}function saveJob(context,id,apiClient){loading.show(),apiClient.getJSON(apiClient.getUrl("Sync/Jobs/"+id)).then(function(job){require(["syncDialog"],function(syncDialog){syncDialog.setJobValues(job,context),apiClient.ajax({url:apiClient.getUrl("Sync/Jobs/"+id),type:"POST",data:JSON.stringify(job),contentType:"application/json"}).then(function(){appHost.supports("sync")&&syncNow(),loading.hide(),dialogHelper.close(context)})})})}function startListening(apiClient,jobId){var startParams="0,1500";startParams+=","+jobId,apiClient.sendMessage("SyncJobStart",startParams)}function stopListening(apiClient){apiClient.sendMessage("SyncJobStop","")}function bindEvents(context,jobId,apiClient){context.querySelector(".jobItems").addEventListener("click",function(e){var btnJobItemMenu=dom.parentWithClass(e.target,"btnJobItemMenu");btnJobItemMenu&&showJobItemMenu(btnJobItemMenu,jobId,apiClient)})}function showEditor(options){function onSyncJobMessage(e,apiClient,msg){loadJobInfo(dlg,msg.Job,msg.JobItems,apiClient)}var apiClient=connectionManager.getApiClient(options.serverId),id=options.jobId,dlgElementOptions={removeOnClose:!0,scrollY:!1,autoFocus:!1};layoutManager.tv?dlgElementOptions.size="fullscreen":dlgElementOptions.size="medium";var dlg=dialogHelper.createDialog(dlgElementOptions);dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ',html+=globalize.translate("sharedcomponents#Sync"),html+="

    ",appHost.supports("externallinks")&&(html+='info'+globalize.translate("sharedcomponents#Help")+""),html+="
    ",html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='",html+="
    ",html+="
    ",html+="
    ",html+="
    ",dlg.innerHTML=html;dlg.querySelector("form").addEventListener("submit",function(e){return saveJob(dlg,id,apiClient),e.preventDefault(),!1}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1),loadJob(dlg,id,apiClient),bindEvents(dlg,id,apiClient);var promise=dialogHelper.open(dlg);return startListening(apiClient,id),events.on(serverNotifications,"SyncJob",onSyncJobMessage),promise.then(function(){return stopListening(apiClient),events.off(serverNotifications,"SyncJob",onSyncJobMessage),layoutManager.tv&&scrollHelper.centerFocus.off(dlg.querySelector(".formDialogContent"),!1),Promise.reject()})}var _jobOptions;return{show:showEditor}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/sync/syncjoblist.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/sync/syncjoblist.js index 2e2f37afc8..90a3196bb3 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/sync/syncjoblist.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/sync/syncjoblist.js @@ -1 +1 @@ -define(["serverNotifications","events","loading","connectionManager","imageLoader","dom","globalize","registrationServices","layoutManager","listViewStyle"],function(serverNotifications,events,loading,connectionManager,imageLoader,dom,globalize,registrationServices,layoutManager){"use strict";function onSyncJobsUpdated(e,apiClient,data){var listInstance=this;renderList(listInstance,data,apiClient)}function refreshList(listInstance,jobs){for(var i=0,length=jobs.length;i0&&progress<100&&(progress=progress.toFixed(1)),html+=progress+"%"}return html}function getSyncJobHtml(listInstance,job,apiClient){var html="",tagName=layoutManager.tv?"button":"div",typeAttribute="button"===tagName?' type="button"':"",listItemClass="listItem listItem-shaded";layoutManager.tv&&(listItemClass+=" listItem-button listItem-focusscale",listItemClass+=" btnJobMenu");var canEdit=(job.ItemCount||1)>1||"Queued"===job.Status;html+="<"+tagName+typeAttribute+' class="'+listItemClass+'" data-canedit="'+canEdit+'" data-id="'+job.Id+'" data-status="'+job.Status+'">';var imgUrl;job.PrimaryImageItemId&&(imgUrl=apiClient.getImageUrl(job.PrimaryImageItemId,{type:"Primary",width:80,tag:job.PrimaryImageTag,minScale:1.5})),imgUrl?(html+='
    ',html+="
    "):html+='file_download';var textLines=[],name=job.Name;job.ParentName&&(name+=" - "+job.ParentName),textLines.push(name),1===job.ItemCount||textLines.push(globalize.translate("sharedcomponents#ItemCount",job.ItemCount)),html+='
    ';for(var i=0,length=textLines.length;i',html+=textLines[i],html+=""):(html+='
    ',html+=textLines[i],html+="
    ");return html+='
    ',html+=getProgressText(job),html+="
    ",html+="
    ",layoutManager.tv||(html+=canEdit?'':''),html+=""}function renderList(listInstance,jobs,apiClient){if((new Date).getTime()-listInstance.lastDataLoad<6e4)return void refreshList(listInstance,jobs);listInstance.lastDataLoad=(new Date).getTime();for(var html="",lastTargetName="",isLocalSync=listInstance.options.isLocalSync,showTargetName=!isLocalSync,hasOpenSection=!1,i=0,length=jobs.length;i",html+="
    ",hasOpenSection=!1),lastTargetName=targetName,html+='
    ',html+='
    ',html+='

    '+targetName+"

    ",html+="
    ",html+='
    ',hasOpenSection=!0)}html+=getSyncJobHtml(listInstance,job,apiClient)}hasOpenSection&&(html+="
    ",html+="
    ");var elem=listInstance.options.element.querySelector(".syncJobListContent");html||(html=isLocalSync?'
    '+globalize.translate("sharedcomponents#MessageNoDownloadsFound")+"
    ":'
    '+globalize.translate("sharedcomponents#MessageNoSyncJobsFound")+"
    "),elem.innerHTML=html,imageLoader.lazyChildren(elem)}function fetchData(listInstance){listInstance.lastDataLoad=0,loading.show();var options={},apiClient=getApiClient(listInstance);return listInstance.options.userId&&(options.UserId=listInstance.options.userId),listInstance.options.isLocalSync&&(options.TargetId=apiClient.deviceId()),apiClient.getJSON(apiClient.getUrl("Sync/Jobs",options)).then(function(response){renderList(listInstance,response.Items,apiClient),loading.hide()})}function startListening(listInstance){var startParams="0,1500",apiClient=getApiClient(listInstance);listInstance.options.userId&&(startParams+=","+listInstance.options.userId),listInstance.options.isLocalSync?startParams+=","+apiClient.deviceId():listInstance.options.enableRemoteSyncManagement===!1&&(startParams+=",true"),apiClient.sendMessage("SyncJobsStart",startParams)}function stopListening(listInstance){var apiClient=getApiClient(listInstance);apiClient.sendMessage("SyncJobsStop","")}function getApiClient(listInstance){return connectionManager.getApiClient(listInstance.options.serverId)}function showJobMenu(listInstance,elem){var item=dom.parentWithClass(elem,"listItem"),jobId=item.getAttribute("data-id"),menuItems=(item.getAttribute("data-status"),[]);"true"===item.getAttribute("data-canedit")&&menuItems.push({name:globalize.translate("sharedcomponents#Edit"),id:"edit"});var txt=globalize.translate("sharedcomponents#RemoveDownload");menuItems.push({name:txt,id:"cancel"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:elem,callback:function(id){switch(id){case"delete":cancelJob(listInstance,jobId);break;case"cancel":cancelJob(listInstance,jobId);break;case"edit":showJobEditor(listInstance,elem)}}})})}function onElementClick(e){var listInstance=this,btnJobMenu=dom.parentWithClass(e.target,"btnJobMenu");if(btnJobMenu)return void showJobMenu(listInstance,btnJobMenu);var btnCancelJob=dom.parentWithClass(e.target,"btnCancelJob");if(btnCancelJob){var listItem=dom.parentWithClass(btnCancelJob,"listItem");if(listItem){var jobId=listItem.getAttribute("data-id");cancelJob(listInstance,jobId)}}else showJobEditor(listInstance,e.target)}function showJobEditor(listInstance,elem){var listItem=dom.parentWithClass(elem,"listItem");if(listItem&&"true"===listItem.getAttribute("data-canedit")){var jobId=listItem.getAttribute("data-id");require(["syncJobEditor"],function(syncJobEditor){syncJobEditor.show({serverId:listInstance.options.serverId,jobId:jobId,isLocalSync:listInstance.options.isLocalSync}).then(function(){fetchData(listInstance)})})}}function syncJobList(options){this.options=options;var onSyncJobsUpdatedHandler=onSyncJobsUpdated.bind(this);this.onSyncJobsUpdatedHandler=onSyncJobsUpdatedHandler,events.on(serverNotifications,"SyncJobs",onSyncJobsUpdatedHandler);var onClickHandler=onElementClick.bind(this);options.element.addEventListener("click",onClickHandler),this.onClickHandler=onClickHandler,options.element.innerHTML='
    ',fetchData(this),startListening(this),initSupporterInfo(options.element,getApiClient(this))}function showSupporterInfo(context){var html='':''),html+=""}function renderList(listInstance,jobs,apiClient){if((new Date).getTime()-listInstance.lastDataLoad<6e4)return void refreshList(listInstance,jobs);listInstance.lastDataLoad=(new Date).getTime();for(var html="",lastTargetName="",isLocalSync=listInstance.options.isLocalSync,showTargetName=!isLocalSync,hasOpenSection=!1,i=0,length=jobs.length;i",html+="
    ",hasOpenSection=!1),lastTargetName=targetName,html+='
    ',html+='
    ',html+='

    '+targetName+"

    ",html+="
    ",html+='
    ',hasOpenSection=!0)}html+=getSyncJobHtml(listInstance,job,apiClient)}hasOpenSection&&(html+="
    ",html+="
    ");var elem=listInstance.options.element.querySelector(".syncJobListContent");html||(html=isLocalSync?'
    '+globalize.translate("sharedcomponents#MessageNoDownloadsFound")+"
    ":'
    '+globalize.translate("sharedcomponents#MessageNoSyncJobsFound")+"
    "),elem.innerHTML=html,imageLoader.lazyChildren(elem)}function fetchData(listInstance){listInstance.lastDataLoad=0,loading.show();var options={},apiClient=getApiClient(listInstance);return listInstance.options.userId&&(options.UserId=listInstance.options.userId),listInstance.options.isLocalSync&&(options.TargetId=apiClient.deviceId()),apiClient.getJSON(apiClient.getUrl("Sync/Jobs",options)).then(function(response){renderList(listInstance,response.Items,apiClient),loading.hide()})}function startListening(listInstance){var startParams="0,1500",apiClient=getApiClient(listInstance);listInstance.options.userId&&(startParams+=","+listInstance.options.userId),listInstance.options.isLocalSync?startParams+=","+apiClient.deviceId():!1===listInstance.options.enableRemoteSyncManagement&&(startParams+=",true"),apiClient.sendMessage("SyncJobsStart",startParams)}function stopListening(listInstance){getApiClient(listInstance).sendMessage("SyncJobsStop","")}function getApiClient(listInstance){return connectionManager.getApiClient(listInstance.options.serverId)}function showJobMenu(listInstance,elem){var item=dom.parentWithClass(elem,"listItem"),jobId=item.getAttribute("data-id"),menuItems=(item.getAttribute("data-status"),[]);"true"===item.getAttribute("data-canedit")&&menuItems.push({name:globalize.translate("sharedcomponents#Edit"),id:"edit"});var txt=globalize.translate("sharedcomponents#RemoveDownload");menuItems.push({name:txt,id:"cancel"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:elem,callback:function(id){switch(id){case"delete":case"cancel":cancelJob(listInstance,jobId);break;case"edit":showJobEditor(listInstance,elem)}}})})}function onElementClick(e){var listInstance=this,btnJobMenu=dom.parentWithClass(e.target,"btnJobMenu");if(btnJobMenu)return void showJobMenu(listInstance,btnJobMenu);var btnCancelJob=dom.parentWithClass(e.target,"btnCancelJob");if(btnCancelJob){var listItem=dom.parentWithClass(btnCancelJob,"listItem");if(listItem){cancelJob(listInstance,listItem.getAttribute("data-id"))}}else showJobEditor(listInstance,e.target)}function showJobEditor(listInstance,elem){var listItem=dom.parentWithClass(elem,"listItem");if(listItem&&"true"===listItem.getAttribute("data-canedit")){var jobId=listItem.getAttribute("data-id");require(["syncJobEditor"],function(syncJobEditor){syncJobEditor.show({serverId:listInstance.options.serverId,jobId:jobId,isLocalSync:listInstance.options.isLocalSync}).then(function(){fetchData(listInstance)})})}}function syncJobList(options){this.options=options;var onSyncJobsUpdatedHandler=onSyncJobsUpdated.bind(this);this.onSyncJobsUpdatedHandler=onSyncJobsUpdatedHandler,events.on(serverNotifications,"SyncJobs",onSyncJobsUpdatedHandler);var onClickHandler=onElementClick.bind(this);options.element.addEventListener("click",onClickHandler),this.onClickHandler=onClickHandler,options.element.innerHTML='
    ',fetchData(this),startListening(this),initSupporterInfo(options.element,getApiClient(this))}function showSupporterInfo(context){var html='
    '),btnFilter.classList.add("btnFilterWithBubble"),bubble=btnFilter.querySelector(".filterButtonBubble")}hasFilters?bubble.classList.remove("hide"):bubble.classList.add("hide")}},ItemsTab.prototype.onPause=function(){var scroller=this.scroller;scroller&&scroller.pause&&scroller.pause();var alphaNumericShortcuts=this.alphaNumericShortcuts;alphaNumericShortcuts&&(alphaNumericShortcuts.destroy(),this.alphaNumericShortcuts=null)},ItemsTab.prototype.destroy=function(){this.view=null,this.itemsContainer=null,this.params=null,this.apiClient=null,this.scroller=null,this.btnFilter=null,this.alphaPicker&&(this.alphaPicker.destroy(),this.alphaPicker=null),this.btnSortText=null,this.btnSortIcon=null,this.alphaPickerElement=null},ItemsTab}); \ No newline at end of file +define(["userSettings","alphaPicker","alphaNumericShortcuts","connectionManager","focusManager","loading","globalize"],function(userSettings,AlphaPicker,AlphaNumericShortcuts,connectionManager,focusManager,loading,globalize){"use strict";function trySelectValue(instance,scroller,view,value){var card;if("#"===value&&(card=view.querySelector(".card")))return void scroller.toStart(card,!1);if(card=view.querySelector(".card[data-prefix^='"+value+"']"))return void scroller.toStart(card,!1);var values=instance.alphaPicker.values(),index=values.indexOf(value);if(index!
    '),btnFilter.classList.add("btnFilterWithBubble"),bubble=btnFilter.querySelector(".filterButtonBubble")}hasFilters?bubble.classList.remove("hide"):bubble.classList.add("hide")}},ItemsTab.prototype.onPause=function(){var scroller=this.scroller;scroller&&scroller.pause&&scroller.pause();var alphaNumericShortcuts=this.alphaNumericShortcuts;alphaNumericShortcuts&&(alphaNumericShortcuts.destroy(),this.alphaNumericShortcuts=null)},ItemsTab.prototype.destroy=function(){this.view=null,this.itemsContainer=null,this.params=null,this.apiClient=null,this.scroller=null,this.btnFilter=null,this.alphaPicker&&(this.alphaPicker.destroy(),this.alphaPicker=null),this.btnSortText=null,this.btnSortIcon=null,this.alphaPickerElement=null},ItemsTab}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/thememediaplayer.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/thememediaplayer.js index 69b0d7c6fb..0fa942869a 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/thememediaplayer.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/thememediaplayer.js @@ -1 +1 @@ -define(["playbackManager","userSettings","connectionManager"],function(playbackManager,userSettings,connectionManager){"use strict";function playThemeMedia(items,ownerId){var currentThemeItems=items.filter(function(i){return enabled(i.MediaType)});if(currentThemeItems.length){if(!currentOwnerId&&playbackManager.isPlaying())return;currentThemeIds=currentThemeItems.map(function(i){return i.Id}),playbackManager.play({items:currentThemeItems,fullscreen:!1,enableRemotePlayers:!1}).then(function(){currentOwnerId=ownerId})}else currentOwnerId&&playbackManager.stop(),currentOwnerId=null}function enabled(mediaType){return"Video"===mediaType?userSettings.enableThemeVideos():userSettings.enableThemeSongs()}function loadThemeMedia(item){if(!item.CollectionType&&excludeTypes.indexOf(item.Type)===-1){var apiClient=connectionManager.getApiClient(item.ServerId);apiClient.getThemeMedia(apiClient.getCurrentUserId(),item.Id,!0).then(function(themeMediaResult){var ownerId=themeMediaResult.ThemeVideosResult.Items.length?themeMediaResult.ThemeVideosResult.OwnerId:themeMediaResult.ThemeSongsResult.OwnerId;if(ownerId!==currentOwnerId){var items=themeMediaResult.ThemeVideosResult.Items.length?themeMediaResult.ThemeVideosResult.Items:themeMediaResult.ThemeSongsResult.Items;playThemeMedia(items,ownerId)}})}}var currentOwnerId,currentThemeIds=[],excludeTypes=["CollectionFolder","UserView","Program","SeriesTimer","Person","TvChannel","Channel"];document.addEventListener("viewshow",function(e){var state=e.detail.state||{},item=state.item;if(item&&item.ServerId)return void loadThemeMedia(item);var viewOptions=e.detail.options||{};viewOptions.supportsThemeMedia||playThemeMedia([],null)},!0)}); \ No newline at end of file +define(["playbackManager","userSettings","connectionManager"],function(playbackManager,userSettings,connectionManager){"use strict";function playThemeMedia(items,ownerId){var currentThemeItems=items.filter(function(i){return enabled(i.MediaType)});if(currentThemeItems.length){if(!currentOwnerId&&playbackManager.isPlaying())return;currentThemeIds=currentThemeItems.map(function(i){return i.Id}),playbackManager.play({items:currentThemeItems,fullscreen:!1,enableRemotePlayers:!1}).then(function(){currentOwnerId=ownerId})}else currentOwnerId&&playbackManager.stop(),currentOwnerId=null}function enabled(mediaType){return"Video"===mediaType?userSettings.enableThemeVideos():userSettings.enableThemeSongs()}function loadThemeMedia(item){if(!item.CollectionType&&-1===excludeTypes.indexOf(item.Type)){var apiClient=connectionManager.getApiClient(item.ServerId);apiClient.getThemeMedia(apiClient.getCurrentUserId(),item.Id,!0).then(function(themeMediaResult){var ownerId=themeMediaResult.ThemeVideosResult.Items.length?themeMediaResult.ThemeVideosResult.OwnerId:themeMediaResult.ThemeSongsResult.OwnerId;if(ownerId!==currentOwnerId){playThemeMedia(themeMediaResult.ThemeVideosResult.Items.length?themeMediaResult.ThemeVideosResult.Items:themeMediaResult.ThemeSongsResult.Items,ownerId)}})}}var currentOwnerId,currentThemeIds=[],excludeTypes=["CollectionFolder","UserView","Program","SeriesTimer","Person","TvChannel","Channel"];document.addEventListener("viewshow",function(e){var state=e.detail.state||{},item=state.item;if(item&&item.ServerId)return void loadThemeMedia(item);(e.detail.options||{}).supportsThemeMedia||playThemeMedia([],null)},!0)}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/touchhelper.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/touchhelper.js index 874a0c2263..c9f068c752 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/touchhelper.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/touchhelper.js @@ -1 +1 @@ -define(["dom","events"],function(dom,events){"use strict";function getTouches(e){return e.changedTouches||e.targetTouches||e.touches}function TouchHelper(elem,options){options=options||{};var touchTarget,touchStartX,touchStartY,lastDeltaX,lastDeltaY,thresholdYMet,self=this,swipeXThreshold=options.swipeXThreshold||50,swipeYThreshold=options.swipeYThreshold||50,swipeXMaxY=30,excludeTagNames=options.ignoreTagNames||[],touchStart=function(e){var touch=getTouches(e)[0];if(touchTarget=null,touchStartX=0,touchStartY=0,lastDeltaX=null,lastDeltaY=null,thresholdYMet=!1,touch){var currentTouchTarget=touch.target;if(dom.parentWithTag(currentTouchTarget,excludeTagNames))return;touchTarget=currentTouchTarget,touchStartX=touch.clientX,touchStartY=touch.clientY}},touchEnd=function(e){var isTouchMove="touchmove"===e.type;if(touchTarget){var deltaX,deltaY,clientX,clientY,touch=getTouches(e)[0];touch?(clientX=touch.clientX||0,clientY=touch.clientY||0,deltaX=clientX-(touchStartX||0),deltaY=clientY-(touchStartY||0)):(deltaX=0,deltaY=0);var currentDeltaX=null==lastDeltaX?deltaX:deltaX-lastDeltaX,currentDeltaY=null==lastDeltaY?deltaY:deltaY-lastDeltaY;lastDeltaX=deltaX,lastDeltaY=deltaY,deltaX>swipeXThreshold&&Math.abs(deltaY)swipeYThreshold||thresholdYMet)&&Math.abs(deltaX)swipeXThreshold&&Math.abs(deltaY)<30?events.trigger(self,"swiperight",[touchTarget]):deltaX<0-swipeXThreshold&&Math.abs(deltaY)<30?events.trigger(self,"swipeleft",[touchTarget]):(deltaY<0-swipeYThreshold||thresholdYMet)&&Math.abs(deltaX)<30?(thresholdYMet=!0,events.trigger(self,"swipeup",[touchTarget,{deltaY:deltaY,deltaX:deltaX,clientX:clientX,clientY:clientY,currentDeltaX:currentDeltaX,currentDeltaY:currentDeltaY}])):(deltaY>swipeYThreshold||thresholdYMet)&&Math.abs(deltaX)<30&&(thresholdYMet=!0,events.trigger(self,"swipedown",[touchTarget,{deltaY:deltaY,deltaX:deltaX,clientX:clientX,clientY:clientY,currentDeltaX:currentDeltaX,currentDeltaY:currentDeltaY}])),isTouchMove&&options.preventDefaultOnMove&&e.preventDefault()}isTouchMove||(touchTarget=null,touchStartX=0,touchStartY=0,lastDeltaX=null,lastDeltaY=null,thresholdYMet=!1)};this.touchStart=touchStart,this.touchEnd=touchEnd,dom.addEventListener(elem,"touchstart",touchStart,{passive:!0}),options.triggerOnMove&&dom.addEventListener(elem,"touchmove",touchEnd,{passive:!options.preventDefaultOnMove}),dom.addEventListener(elem,"touchend",touchEnd,{passive:!0}),dom.addEventListener(elem,"touchcancel",touchEnd,{passive:!0})}return TouchHelper.prototype.destroy=function(){var elem=this.elem;if(elem){var touchStart=this.touchStart,touchEnd=this.touchEnd;dom.removeEventListener(elem,"touchstart",touchStart,{passive:!0}),dom.removeEventListener(elem,"touchmove",touchEnd,{passive:!0}),dom.removeEventListener(elem,"touchend",touchEnd,{passive:!0}),dom.removeEventListener(elem,"touchcancel",touchEnd,{passive:!0})}this.touchStart=null,this.touchEnd=null,this.elem=null},TouchHelper}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/upnextdialog/upnextdialog.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/upnextdialog/upnextdialog.js index 4890acca2c..d01a8ad1c6 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/upnextdialog/upnextdialog.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/upnextdialog/upnextdialog.js @@ -1 +1 @@ -define(["dom","playbackManager","connectionManager","events","mediaInfo","layoutManager","focusManager","globalize","itemHelper","css!./upnextdialog","emby-button","flexStyles"],function(dom,playbackManager,connectionManager,events,mediaInfo,layoutManager,focusManager,globalize,itemHelper){"use strict";function seriesImageUrl(item,options){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){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)):"Primary"===options.type&&item.AlbumId&&item.AlbumPrimaryImageTag?(options.tag=item.AlbumPrimaryImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.AlbumId,options)):null}function setPoster(osdPoster,item,secondaryItem){if(item){var imgUrl=seriesImageUrl(item,{type:"Primary"})||seriesImageUrl(item,{type:"Thumb"})||imageUrl(item,{type:"Primary"});if(!imgUrl&&secondaryItem&&(imgUrl=seriesImageUrl(secondaryItem,{type:"Primary"})||seriesImageUrl(secondaryItem,{type:"Thumb"})||imageUrl(secondaryItem,{type:"Primary"})),imgUrl)return void(osdPoster.innerHTML='')}osdPoster.innerHTML=""}function getHtml(){var html="";return html+='
    ',html+="
    ",html+='
    ',html+='

     

    ',html+='

    ',html+='
    ',html+="
    ",html+='
    ',html+='
    ',html+='",html+='",html+="
    ",html+="
    "}function setNextVideoText(){var instance=this,elem=instance.options.parent,secondsRemaining=Math.max(Math.round(getTimeRemainingMs(instance)/1e3),0);console.log("up next seconds remaining: "+secondsRemaining);var timeText=''+globalize.translate("sharedcomponents#HeaderSecondsValue",secondsRemaining)+"",nextVideoText="Episode"===instance.itemType?globalize.translate("sharedcomponents#HeaderNextEpisodePlayingInValue",timeText):globalize.translate("sharedcomponents#HeaderNextVideoPlayingInValue",timeText);elem.querySelector(".upNextDialog-nextVideoText").innerHTML=nextVideoText}function fillItem(item){var instance=this,elem=instance.options.parent;setPoster(elem.querySelector(".upNextDialog-poster"),item),elem.querySelector(".upNextDialog-overview").innerHTML=item.Overview||"",elem.querySelector(".upNextDialog-mediainfo").innerHTML=mediaInfo.getPrimaryMediaInfoHtml(item,{});var title=itemHelper.getDisplayName(item);item.SeriesName&&(title=item.SeriesName+" - "+title),elem.querySelector(".upNextDialog-title").innerHTML=title||"",instance.itemType=item.Type,instance.show()}function clearCountdownTextTimeout(instance){instance._countdownTextTimeout&&(clearInterval(instance._countdownTextTimeout),instance._countdownTextTimeout=null)}function onStartNowClick(){var options=this.options;if(options){var player=options.player;this.hide(),playbackManager.nextTrack(player)}}function init(instance,options){options.parent.innerHTML=getHtml(),options.parent.classList.add("hide"),options.parent.classList.add("upNextDialog"),options.parent.classList.add("upNextDialog-hidden"),fillItem.call(instance,options.nextItem),options.parent.querySelector(".btnHide").addEventListener("click",instance.hide.bind(instance)),options.parent.querySelector(".btnStartNow").addEventListener("click",onStartNowClick.bind(instance))}function clearHideAnimationEventListeners(instance,elem){var fn=instance._onHideAnimationComplete;fn&&dom.removeEventListener(elem,transitionEndEventName,fn,{once:!0})}function onHideAnimationComplete(e){var instance=this,elem=e.target;elem.classList.add("hide"),clearHideAnimationEventListeners(instance,elem),events.trigger(instance,"hide")}function hideComingUpNext(){var instance=this;if(clearCountdownTextTimeout(this),instance.options){var elem=instance.options.parent;if(elem&&(clearHideAnimationEventListeners(this,elem),!elem.classList.contains("upNextDialog-hidden"))){void elem.offsetWidth,elem.classList.add("upNextDialog-hidden");var fn=onHideAnimationComplete.bind(instance);instance._onHideAnimationComplete=fn,dom.addEventListener(elem,transitionEndEventName,fn,{once:!0})}}}function getTimeRemainingMs(instance){var options=instance.options;if(options){var runtimeTicks=playbackManager.duration(options.player);if(runtimeTicks){var timeRemainingTicks=runtimeTicks-playbackManager.currentTime(options.player);return Math.round(timeRemainingTicks/1e4)}}return 0}function startComingUpNextHideTimer(instance){var timeRemainingMs=getTimeRemainingMs(instance);timeRemainingMs<=0||(setNextVideoText.call(instance),clearCountdownTextTimeout(instance),instance._countdownTextTimeout=setInterval(setNextVideoText.bind(instance),400))}function UpNextDialog(options){this.options=options,init(this,options)}var transitionEndEventName=dom.whichTransitionEvent();return UpNextDialog.prototype.show=function(){var elem=this.options.parent;clearHideAnimationEventListeners(this,elem),elem.classList.remove("hide"),void elem.offsetWidth,elem.classList.remove("upNextDialog-hidden"),layoutManager.tv&&setTimeout(function(){focusManager.focus(elem.querySelector(".btnStartNow"))},50),startComingUpNextHideTimer(this)},UpNextDialog.prototype.hide=function(){hideComingUpNext.call(this)},UpNextDialog.prototype.destroy=function(){hideComingUpNext.call(this),this.options=null,this.itemType=null},UpNextDialog}); \ No newline at end of file +define(["dom","playbackManager","connectionManager","events","mediaInfo","layoutManager","focusManager","globalize","itemHelper","css!./upnextdialog","emby-button","flexStyles"],function(dom,playbackManager,connectionManager,events,mediaInfo,layoutManager,focusManager,globalize,itemHelper){"use strict";function seriesImageUrl(item,options){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){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)):"Primary"===options.type&&item.AlbumId&&item.AlbumPrimaryImageTag?(options.tag=item.AlbumPrimaryImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.AlbumId,options)):null}function setPoster(osdPoster,item,secondaryItem){if(item){var imgUrl=seriesImageUrl(item,{type:"Primary"})||seriesImageUrl(item,{type:"Thumb"})||imageUrl(item,{type:"Primary"});if(!imgUrl&&secondaryItem&&(imgUrl=seriesImageUrl(secondaryItem,{type:"Primary"})||seriesImageUrl(secondaryItem,{type:"Thumb"})||imageUrl(secondaryItem,{type:"Primary"})),imgUrl)return void(osdPoster.innerHTML='')}osdPoster.innerHTML=""}function getHtml(){var html="";return html+='
    ',html+="
    ",html+='
    ',html+='

     

    ',html+='

    ',html+='
    ',html+="
    ",html+='
    ',html+='
    ',html+='",html+='",html+="
    ",html+="
    "}function setNextVideoText(){var instance=this,elem=instance.options.parent,secondsRemaining=Math.max(Math.round(getTimeRemainingMs(instance)/1e3),0);console.log("up next seconds remaining: "+secondsRemaining);var timeText=''+globalize.translate("sharedcomponents#HeaderSecondsValue",secondsRemaining)+"",nextVideoText="Episode"===instance.itemType?globalize.translate("sharedcomponents#HeaderNextEpisodePlayingInValue",timeText):globalize.translate("sharedcomponents#HeaderNextVideoPlayingInValue",timeText);elem.querySelector(".upNextDialog-nextVideoText").innerHTML=nextVideoText}function fillItem(item){var instance=this,elem=instance.options.parent;setPoster(elem.querySelector(".upNextDialog-poster"),item),elem.querySelector(".upNextDialog-overview").innerHTML=item.Overview||"",elem.querySelector(".upNextDialog-mediainfo").innerHTML=mediaInfo.getPrimaryMediaInfoHtml(item,{});var title=itemHelper.getDisplayName(item);item.SeriesName&&(title=item.SeriesName+" - "+title),elem.querySelector(".upNextDialog-title").innerHTML=title||"",instance.itemType=item.Type,instance.show()}function clearCountdownTextTimeout(instance){instance._countdownTextTimeout&&(clearInterval(instance._countdownTextTimeout),instance._countdownTextTimeout=null)}function onStartNowClick(){var options=this.options;if(options){var player=options.player;this.hide(),playbackManager.nextTrack(player)}}function init(instance,options){options.parent.innerHTML=getHtml(),options.parent.classList.add("hide"),options.parent.classList.add("upNextDialog"),options.parent.classList.add("upNextDialog-hidden"),fillItem.call(instance,options.nextItem),options.parent.querySelector(".btnHide").addEventListener("click",instance.hide.bind(instance)),options.parent.querySelector(".btnStartNow").addEventListener("click",onStartNowClick.bind(instance))}function clearHideAnimationEventListeners(instance,elem){var fn=instance._onHideAnimationComplete;fn&&dom.removeEventListener(elem,transitionEndEventName,fn,{once:!0})}function onHideAnimationComplete(e){var instance=this,elem=e.target;elem.classList.add("hide"),clearHideAnimationEventListeners(instance,elem),events.trigger(instance,"hide")}function hideComingUpNext(){var instance=this;if(clearCountdownTextTimeout(this),instance.options){var elem=instance.options.parent;if(elem&&(clearHideAnimationEventListeners(this,elem),!elem.classList.contains("upNextDialog-hidden"))){elem.offsetWidth,elem.classList.add("upNextDialog-hidden");var fn=onHideAnimationComplete.bind(instance);instance._onHideAnimationComplete=fn,dom.addEventListener(elem,transitionEndEventName,fn,{once:!0})}}}function getTimeRemainingMs(instance){var options=instance.options;if(options){var runtimeTicks=playbackManager.duration(options.player);if(runtimeTicks){var timeRemainingTicks=runtimeTicks-playbackManager.currentTime(options.player);return Math.round(timeRemainingTicks/1e4)}}return 0}function startComingUpNextHideTimer(instance){getTimeRemainingMs(instance)<=0||(setNextVideoText.call(instance),clearCountdownTextTimeout(instance),instance._countdownTextTimeout=setInterval(setNextVideoText.bind(instance),400))}function UpNextDialog(options){this.options=options,init(this,options)}var transitionEndEventName=dom.whichTransitionEvent();return UpNextDialog.prototype.show=function(){var elem=this.options.parent;clearHideAnimationEventListeners(this,elem),elem.classList.remove("hide"),elem.offsetWidth,elem.classList.remove("upNextDialog-hidden"),layoutManager.tv&&setTimeout(function(){focusManager.focus(elem.querySelector(".btnStartNow"))},50),startComingUpNextHideTimer(this)},UpNextDialog.prototype.hide=function(){hideComingUpNext.call(this)},UpNextDialog.prototype.destroy=function(){hideComingUpNext.call(this),this.options=null,this.itemType=null},UpNextDialog}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/userdatabuttons/emby-playstatebutton.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/userdatabuttons/emby-playstatebutton.js index dfcf8e0e41..6d09939206 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/userdatabuttons/emby-playstatebutton.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/userdatabuttons/emby-playstatebutton.js @@ -1 +1 @@ -define(["connectionManager","serverNotifications","events","globalize","emby-button"],function(connectionManager,serverNotifications,events,globalize,EmbyButtonPrototype){"use strict";function addNotificationEvent(instance,name,handler){var localHandler=handler.bind(instance);events.on(serverNotifications,name,localHandler),instance[name]=localHandler}function removeNotificationEvent(instance,name){var handler=instance[name];handler&&(events.off(serverNotifications,name,handler),instance[name]=null)}function onClick(e){var button=this,id=button.getAttribute("data-id"),serverId=button.getAttribute("data-serverid"),apiClient=connectionManager.getApiClient(serverId);button.classList.contains("playstatebutton-played")?(apiClient.markUnplayed(apiClient.getCurrentUserId(),id,new Date),setState(button,!1)):(apiClient.markPlayed(apiClient.getCurrentUserId(),id,new Date),setState(button,!0))}function onUserDataChanged(e,apiClient,userData){var button=this;userData.ItemId===button.getAttribute("data-id")&&setState(button,userData.Played)}function setState(button,played,updateAttribute){var icon=button.iconElement;icon||(button.iconElement=button.querySelector("i"),icon=button.iconElement),played?(button.classList.add("playstatebutton-played"),icon&&(icon.classList.add("playstatebutton-icon-played"),icon.classList.remove("playstatebutton-icon-unplayed"))):(button.classList.remove("playstatebutton-played"),icon&&(icon.classList.remove("playstatebutton-icon-played"),icon.classList.add("playstatebutton-icon-unplayed"))),updateAttribute!==!1&&button.setAttribute("data-played",played)}function setTitle(button,itemType){"AudioBook"!==itemType&&"AudioPodcast"!==itemType?button.title=globalize.translate("sharedcomponents#Watched"):button.title=globalize.translate("sharedcomponents#Played");var text=button.querySelector(".button-text");text&&(text.innerHTML=button.title)}function clearEvents(button){button.removeEventListener("click",onClick),removeNotificationEvent(button,"UserDataChanged")}function bindEvents(button){clearEvents(button),button.addEventListener("click",onClick),addNotificationEvent(button,"UserDataChanged",onUserDataChanged)}var EmbyPlaystateButtonPrototype=Object.create(EmbyButtonPrototype);EmbyPlaystateButtonPrototype.createdCallback=function(){EmbyButtonPrototype.createdCallback&&EmbyButtonPrototype.createdCallback.call(this)},EmbyPlaystateButtonPrototype.attachedCallback=function(){EmbyButtonPrototype.attachedCallback&&EmbyButtonPrototype.attachedCallback.call(this);var itemId=this.getAttribute("data-id"),serverId=this.getAttribute("data-serverid");itemId&&serverId&&(setState(this,"true"===this.getAttribute("data-played"),!1),bindEvents(this),setTitle(this,this.getAttribute("data-type")))},EmbyPlaystateButtonPrototype.detachedCallback=function(){EmbyButtonPrototype.detachedCallback&&EmbyButtonPrototype.detachedCallback.call(this),clearEvents(this),this.iconElement=null},EmbyPlaystateButtonPrototype.setItem=function(item){if(item){this.setAttribute("data-id",item.Id),this.setAttribute("data-serverid",item.ServerId);var played=item.UserData&&item.UserData.Played;setState(this,played),bindEvents(this),setTitle(this,item.Type)}else this.removeAttribute("data-id"),this.removeAttribute("data-serverid"),this.removeAttribute("data-played"),clearEvents(this)},document.registerElement("emby-playstatebutton",{prototype:EmbyPlaystateButtonPrototype,extends:"button"})}); \ No newline at end of file +define(["connectionManager","serverNotifications","events","globalize","emby-button"],function(connectionManager,serverNotifications,events,globalize,EmbyButtonPrototype){"use strict";function addNotificationEvent(instance,name,handler){var localHandler=handler.bind(instance);events.on(serverNotifications,name,localHandler),instance[name]=localHandler}function removeNotificationEvent(instance,name){var handler=instance[name];handler&&(events.off(serverNotifications,name,handler),instance[name]=null)}function onClick(e){var button=this,id=button.getAttribute("data-id"),serverId=button.getAttribute("data-serverid"),apiClient=connectionManager.getApiClient(serverId);button.classList.contains("playstatebutton-played")?(apiClient.markUnplayed(apiClient.getCurrentUserId(),id,new Date),setState(button,!1)):(apiClient.markPlayed(apiClient.getCurrentUserId(),id,new Date),setState(button,!0))}function onUserDataChanged(e,apiClient,userData){var button=this;userData.ItemId===button.getAttribute("data-id")&&setState(button,userData.Played)}function setState(button,played,updateAttribute){var icon=button.iconElement;icon||(button.iconElement=button.querySelector("i"),icon=button.iconElement),played?(button.classList.add("playstatebutton-played"),icon&&(icon.classList.add("playstatebutton-icon-played"),icon.classList.remove("playstatebutton-icon-unplayed"))):(button.classList.remove("playstatebutton-played"),icon&&(icon.classList.remove("playstatebutton-icon-played"),icon.classList.add("playstatebutton-icon-unplayed"))),!1!==updateAttribute&&button.setAttribute("data-played",played)}function setTitle(button,itemType){button.title="AudioBook"!==itemType&&"AudioPodcast"!==itemType?globalize.translate("sharedcomponents#Watched"):globalize.translate("sharedcomponents#Played");var text=button.querySelector(".button-text");text&&(text.innerHTML=button.title)}function clearEvents(button){button.removeEventListener("click",onClick),removeNotificationEvent(button,"UserDataChanged")}function bindEvents(button){clearEvents(button),button.addEventListener("click",onClick),addNotificationEvent(button,"UserDataChanged",onUserDataChanged)}var EmbyPlaystateButtonPrototype=Object.create(EmbyButtonPrototype);EmbyPlaystateButtonPrototype.createdCallback=function(){EmbyButtonPrototype.createdCallback&&EmbyButtonPrototype.createdCallback.call(this)},EmbyPlaystateButtonPrototype.attachedCallback=function(){EmbyButtonPrototype.attachedCallback&&EmbyButtonPrototype.attachedCallback.call(this);var itemId=this.getAttribute("data-id"),serverId=this.getAttribute("data-serverid");itemId&&serverId&&(setState(this,"true"===this.getAttribute("data-played"),!1),bindEvents(this),setTitle(this,this.getAttribute("data-type")))},EmbyPlaystateButtonPrototype.detachedCallback=function(){EmbyButtonPrototype.detachedCallback&&EmbyButtonPrototype.detachedCallback.call(this),clearEvents(this),this.iconElement=null},EmbyPlaystateButtonPrototype.setItem=function(item){if(item){this.setAttribute("data-id",item.Id),this.setAttribute("data-serverid",item.ServerId);setState(this,item.UserData&&item.UserData.Played),bindEvents(this),setTitle(this,item.Type)}else this.removeAttribute("data-id"),this.removeAttribute("data-serverid"),this.removeAttribute("data-played"),clearEvents(this)},document.registerElement("emby-playstatebutton",{prototype:EmbyPlaystateButtonPrototype,extends:"button"})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/userdatabuttons/emby-ratingbutton.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/userdatabuttons/emby-ratingbutton.js index e9f4f0ae26..f4dc1ee821 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/userdatabuttons/emby-ratingbutton.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/userdatabuttons/emby-ratingbutton.js @@ -1 +1 @@ -define(["connectionManager","serverNotifications","events","globalize","emby-button"],function(connectionManager,serverNotifications,events,globalize,EmbyButtonPrototype){"use strict";function addNotificationEvent(instance,name,handler){var localHandler=handler.bind(instance);events.on(serverNotifications,name,localHandler),instance[name]=localHandler}function removeNotificationEvent(instance,name){var handler=instance[name];handler&&(events.off(serverNotifications,name,handler),instance[name]=null)}function showPicker(button,apiClient,itemId,likes,isFavorite){return apiClient.updateFavoriteStatus(apiClient.getCurrentUserId(),itemId,!isFavorite)}function onClick(e){var button=this,id=button.getAttribute("data-id"),serverId=button.getAttribute("data-serverid"),apiClient=connectionManager.getApiClient(serverId),likes=this.getAttribute("data-likes"),isFavorite="true"===this.getAttribute("data-isfavorite");likes="true"===likes||"false"!==likes&&null,showPicker(button,apiClient,id,likes,isFavorite).then(function(userData){setState(button,userData.Likes,userData.IsFavorite)})}function onUserDataChanged(e,apiClient,userData){var button=this;userData.ItemId===button.getAttribute("data-id")&&setState(button,userData.Likes,userData.IsFavorite)}function setState(button,likes,isFavorite,updateAttribute){var icon=button.querySelector("i");isFavorite?(icon&&(icon.innerHTML="",icon.classList.add("ratingbutton-icon-withrating")),button.classList.add("ratingbutton-withrating")):likes?(icon&&(icon.innerHTML="",icon.classList.remove("ratingbutton-icon-withrating")),button.classList.remove("ratingbutton-withrating")):likes===!1?(icon&&(icon.innerHTML="",icon.classList.remove("ratingbutton-icon-withrating")),button.classList.remove("ratingbutton-withrating")):(icon&&(icon.innerHTML="",icon.classList.remove("ratingbutton-icon-withrating")),button.classList.remove("ratingbutton-withrating")),updateAttribute!==!1&&(button.setAttribute("data-isfavorite",isFavorite),button.setAttribute("data-likes",null===likes?"":likes))}function setTitle(button){button.title=globalize.translate("sharedcomponents#Favorite");var text=button.querySelector(".button-text");text&&(text.innerHTML=button.title)}function clearEvents(button){button.removeEventListener("click",onClick),removeNotificationEvent(button,"UserDataChanged")}function bindEvents(button){clearEvents(button),button.addEventListener("click",onClick),addNotificationEvent(button,"UserDataChanged",onUserDataChanged)}var EmbyRatingButtonPrototype=Object.create(EmbyButtonPrototype);EmbyRatingButtonPrototype.createdCallback=function(){EmbyButtonPrototype.createdCallback&&EmbyButtonPrototype.createdCallback.call(this)},EmbyRatingButtonPrototype.attachedCallback=function(){EmbyButtonPrototype.attachedCallback&&EmbyButtonPrototype.attachedCallback.call(this);var itemId=this.getAttribute("data-id"),serverId=this.getAttribute("data-serverid");if(itemId&&serverId){var likes=this.getAttribute("data-likes"),isFavorite="true"===this.getAttribute("data-isfavorite");likes="true"===likes||"false"!==likes&&null,setState(this,likes,isFavorite,!1),bindEvents(this)}setTitle(this)},EmbyRatingButtonPrototype.detachedCallback=function(){EmbyButtonPrototype.detachedCallback&&EmbyButtonPrototype.detachedCallback.call(this),clearEvents(this)},EmbyRatingButtonPrototype.setItem=function(item){if(item){this.setAttribute("data-id",item.Id),this.setAttribute("data-serverid",item.ServerId);var userData=item.UserData||{};setState(this,userData.Likes,userData.IsFavorite),bindEvents(this)}else this.removeAttribute("data-id"),this.removeAttribute("data-serverid"),this.removeAttribute("data-likes"),this.removeAttribute("data-isfavorite"),clearEvents(this)},document.registerElement("emby-ratingbutton",{prototype:EmbyRatingButtonPrototype,extends:"button"})}); \ No newline at end of file +define(["connectionManager","serverNotifications","events","globalize","emby-button"],function(connectionManager,serverNotifications,events,globalize,EmbyButtonPrototype){"use strict";function addNotificationEvent(instance,name,handler){var localHandler=handler.bind(instance);events.on(serverNotifications,name,localHandler),instance[name]=localHandler}function removeNotificationEvent(instance,name){var handler=instance[name];handler&&(events.off(serverNotifications,name,handler),instance[name]=null)}function showPicker(button,apiClient,itemId,likes,isFavorite){return apiClient.updateFavoriteStatus(apiClient.getCurrentUserId(),itemId,!isFavorite)}function onClick(e){var button=this,id=button.getAttribute("data-id"),serverId=button.getAttribute("data-serverid"),apiClient=connectionManager.getApiClient(serverId),likes=this.getAttribute("data-likes"),isFavorite="true"===this.getAttribute("data-isfavorite");likes="true"===likes||"false"!==likes&&null,showPicker(button,apiClient,id,likes,isFavorite).then(function(userData){setState(button,userData.Likes,userData.IsFavorite)})}function onUserDataChanged(e,apiClient,userData){var button=this;userData.ItemId===button.getAttribute("data-id")&&setState(button,userData.Likes,userData.IsFavorite)}function setState(button,likes,isFavorite,updateAttribute){var icon=button.querySelector("i");isFavorite?(icon&&(icon.innerHTML="",icon.classList.add("ratingbutton-icon-withrating")),button.classList.add("ratingbutton-withrating")):(icon&&(icon.innerHTML="",icon.classList.remove("ratingbutton-icon-withrating")),button.classList.remove("ratingbutton-withrating")),!1!==updateAttribute&&(button.setAttribute("data-isfavorite",isFavorite),button.setAttribute("data-likes",null===likes?"":likes))}function setTitle(button){button.title=globalize.translate("sharedcomponents#Favorite");var text=button.querySelector(".button-text");text&&(text.innerHTML=button.title)}function clearEvents(button){button.removeEventListener("click",onClick),removeNotificationEvent(button,"UserDataChanged")}function bindEvents(button){clearEvents(button),button.addEventListener("click",onClick),addNotificationEvent(button,"UserDataChanged",onUserDataChanged)}var EmbyRatingButtonPrototype=Object.create(EmbyButtonPrototype);EmbyRatingButtonPrototype.createdCallback=function(){EmbyButtonPrototype.createdCallback&&EmbyButtonPrototype.createdCallback.call(this)},EmbyRatingButtonPrototype.attachedCallback=function(){EmbyButtonPrototype.attachedCallback&&EmbyButtonPrototype.attachedCallback.call(this);var itemId=this.getAttribute("data-id"),serverId=this.getAttribute("data-serverid");if(itemId&&serverId){var likes=this.getAttribute("data-likes"),isFavorite="true"===this.getAttribute("data-isfavorite");likes="true"===likes||"false"!==likes&&null,setState(this,likes,isFavorite,!1),bindEvents(this)}setTitle(this)},EmbyRatingButtonPrototype.detachedCallback=function(){EmbyButtonPrototype.detachedCallback&&EmbyButtonPrototype.detachedCallback.call(this),clearEvents(this)},EmbyRatingButtonPrototype.setItem=function(item){if(item){this.setAttribute("data-id",item.Id),this.setAttribute("data-serverid",item.ServerId);var userData=item.UserData||{};setState(this,userData.Likes,userData.IsFavorite),bindEvents(this)}else this.removeAttribute("data-id"),this.removeAttribute("data-serverid"),this.removeAttribute("data-likes"),this.removeAttribute("data-isfavorite"),clearEvents(this)},document.registerElement("emby-ratingbutton",{prototype:EmbyRatingButtonPrototype,extends:"button"})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/userdatabuttons/userdatabuttons.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/userdatabuttons/userdatabuttons.js index 78825b1134..76aa83d176 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/userdatabuttons/userdatabuttons.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/userdatabuttons/userdatabuttons.js @@ -1 +1 @@ -define(["connectionManager","globalize","dom","itemHelper","paper-icon-button-light","material-icons","emby-button","css!./userdatabuttons"],function(connectionManager,globalize,dom,itemHelper){"use strict";function getUserDataButtonHtml(method,itemId,serverId,buttonCssClass,iconCssClass,icon,tooltip,style){"fab-mini"===style&&(style="fab",buttonCssClass=buttonCssClass?buttonCssClass+" mini":"mini");var is="fab"===style?"emby-button":"paper-icon-button-light",className="fab"===style?"autoSize fab":"autoSize";return buttonCssClass&&(className+=" "+buttonCssClass),iconCssClass?iconCssClass+=" ":iconCssClass="",iconCssClass+="md-icon",'"}function onContainerClick(e){var btnUserData=dom.parentWithClass(e.target,"btnUserData");if(btnUserData){var method=btnUserData.getAttribute("data-method");userDataMethods[method](btnUserData)}}function fill(options){var html=getIconsHtml(options);"insertAdjacent"===options.fillMode?options.element.insertAdjacentHTML(options.insertLocation||"beforeend",html):options.element.innerHTML=html,dom.removeEventListener(options.element,"click",onContainerClick,{passive:!0}),dom.addEventListener(options.element,"click",onContainerClick,{passive:!0})}function destroy(options){options.element.innerHTML="",dom.removeEventListener(options.element,"click",onContainerClick,{passive:!0})}function getIconsHtml(options){var item=options.item,includePlayed=options.includePlayed,cssClass=options.cssClass,style=options.style,html="",userData=item.UserData||{},itemId=item.Id;if(itemHelper.isLocalItem(item))return html;var btnCssClass="btnUserData";cssClass&&(btnCssClass+=" "+cssClass);var iconCssClass=options.iconCssClass,serverId=item.ServerId;if(includePlayed!==!1){var tooltipPlayed=globalize.translate("sharedcomponents#MarkPlayed");itemHelper.canMarkPlayed(item)&&(html+=userData.Played?getUserDataButtonHtml("markPlayed",itemId,serverId,btnCssClass+" btnUserDataOn",iconCssClass,"",tooltipPlayed,style):getUserDataButtonHtml("markPlayed",itemId,serverId,btnCssClass,iconCssClass,"",tooltipPlayed,style))}var tooltipFavorite=globalize.translate("sharedcomponents#Favorite");return html+=userData.IsFavorite?getUserDataButtonHtml("markFavorite",itemId,serverId,btnCssClass+" btnUserData btnUserDataOn",iconCssClass,"",tooltipFavorite,style):getUserDataButtonHtml("markFavorite",itemId,serverId,btnCssClass+" btnUserData",iconCssClass,"",tooltipFavorite,style)}function markFavorite(link){var id=link.getAttribute("data-itemid"),serverId=link.getAttribute("data-serverid"),markAsFavorite=!link.classList.contains("btnUserDataOn");favorite(id,serverId,markAsFavorite),markAsFavorite?link.classList.add("btnUserDataOn"):link.classList.remove("btnUserDataOn")}function markLike(link){var id=link.getAttribute("data-itemid"),serverId=link.getAttribute("data-serverid");link.classList.contains("btnUserDataOn")?(clearLike(id,serverId),link.classList.remove("btnUserDataOn")):(likes(id,serverId,!0),link.classList.add("btnUserDataOn")),link.parentNode.querySelector(".btnDislike").classList.remove("btnUserDataOn")}function markDislike(link){var id=link.getAttribute("data-itemid"),serverId=link.getAttribute("data-serverid");link.classList.contains("btnUserDataOn")?(clearLike(id,serverId),link.classList.remove("btnUserDataOn")):(likes(id,serverId,!1),link.classList.add("btnUserDataOn")),link.parentNode.querySelector(".btnLike").classList.remove("btnUserDataOn")}function markPlayed(link){var id=link.getAttribute("data-itemid"),serverId=link.getAttribute("data-serverid");link.classList.contains("btnUserDataOn")?(played(id,serverId,!1),link.classList.remove("btnUserDataOn")):(played(id,serverId,!0),link.classList.add("btnUserDataOn"))}function likes(id,serverId,isLiked){var apiClient=connectionManager.getApiClient(serverId);return apiClient.updateUserItemRating(apiClient.getCurrentUserId(),id,isLiked)}function played(id,serverId,isPlayed){var apiClient=connectionManager.getApiClient(serverId),method=isPlayed?"markPlayed":"markUnplayed";return apiClient[method](apiClient.getCurrentUserId(),id,new Date)}function favorite(id,serverId,isFavorite){var apiClient=connectionManager.getApiClient(serverId);return apiClient.updateFavoriteStatus(apiClient.getCurrentUserId(),id,isFavorite)}function clearLike(id,serverId){var apiClient=connectionManager.getApiClient(serverId);return apiClient.clearUserItemRating(apiClient.getCurrentUserId(),id)}var userDataMethods={markPlayed:markPlayed,markDislike:markDislike,markLike:markLike,markFavorite:markFavorite};return{fill:fill,destroy:destroy,getIconsHtml:getIconsHtml}}); \ No newline at end of file +define(["connectionManager","globalize","dom","itemHelper","paper-icon-button-light","material-icons","emby-button","css!./userdatabuttons"],function(connectionManager,globalize,dom,itemHelper){"use strict";function getUserDataButtonHtml(method,itemId,serverId,buttonCssClass,iconCssClass,icon,tooltip,style){"fab-mini"===style&&(style="fab",buttonCssClass=buttonCssClass?buttonCssClass+" mini":"mini");var is="fab"===style?"emby-button":"paper-icon-button-light",className="fab"===style?"autoSize fab":"autoSize";return buttonCssClass&&(className+=" "+buttonCssClass),iconCssClass?iconCssClass+=" ":iconCssClass="",iconCssClass+="md-icon",'"}function onContainerClick(e){var btnUserData=dom.parentWithClass(e.target,"btnUserData");if(btnUserData){var method=btnUserData.getAttribute("data-method");userDataMethods[method](btnUserData)}}function fill(options){var html=getIconsHtml(options);"insertAdjacent"===options.fillMode?options.element.insertAdjacentHTML(options.insertLocation||"beforeend",html):options.element.innerHTML=html,dom.removeEventListener(options.element,"click",onContainerClick,{passive:!0}),dom.addEventListener(options.element,"click",onContainerClick,{passive:!0})}function destroy(options){options.element.innerHTML="",dom.removeEventListener(options.element,"click",onContainerClick,{passive:!0})}function getIconsHtml(options){var item=options.item,includePlayed=options.includePlayed,cssClass=options.cssClass,style=options.style,html="",userData=item.UserData||{},itemId=item.Id;if(itemHelper.isLocalItem(item))return html;var btnCssClass="btnUserData";cssClass&&(btnCssClass+=" "+cssClass);var iconCssClass=options.iconCssClass,serverId=item.ServerId;if(!1!==includePlayed){var tooltipPlayed=globalize.translate("sharedcomponents#MarkPlayed");itemHelper.canMarkPlayed(item)&&(html+=userData.Played?getUserDataButtonHtml("markPlayed",itemId,serverId,btnCssClass+" btnUserDataOn",iconCssClass,"",tooltipPlayed,style):getUserDataButtonHtml("markPlayed",itemId,serverId,btnCssClass,iconCssClass,"",tooltipPlayed,style))}var tooltipFavorite=globalize.translate("sharedcomponents#Favorite");return html+=userData.IsFavorite?getUserDataButtonHtml("markFavorite",itemId,serverId,btnCssClass+" btnUserData btnUserDataOn",iconCssClass,"",tooltipFavorite,style):getUserDataButtonHtml("markFavorite",itemId,serverId,btnCssClass+" btnUserData",iconCssClass,"",tooltipFavorite,style)}function markFavorite(link){var id=link.getAttribute("data-itemid"),serverId=link.getAttribute("data-serverid"),markAsFavorite=!link.classList.contains("btnUserDataOn");favorite(id,serverId,markAsFavorite),markAsFavorite?link.classList.add("btnUserDataOn"):link.classList.remove("btnUserDataOn")}function markLike(link){var id=link.getAttribute("data-itemid"),serverId=link.getAttribute("data-serverid");link.classList.contains("btnUserDataOn")?(clearLike(id,serverId),link.classList.remove("btnUserDataOn")):(likes(id,serverId,!0),link.classList.add("btnUserDataOn")),link.parentNode.querySelector(".btnDislike").classList.remove("btnUserDataOn")}function markDislike(link){var id=link.getAttribute("data-itemid"),serverId=link.getAttribute("data-serverid");link.classList.contains("btnUserDataOn")?(clearLike(id,serverId),link.classList.remove("btnUserDataOn")):(likes(id,serverId,!1),link.classList.add("btnUserDataOn")),link.parentNode.querySelector(".btnLike").classList.remove("btnUserDataOn")}function markPlayed(link){var id=link.getAttribute("data-itemid"),serverId=link.getAttribute("data-serverid");link.classList.contains("btnUserDataOn")?(played(id,serverId,!1),link.classList.remove("btnUserDataOn")):(played(id,serverId,!0),link.classList.add("btnUserDataOn"))}function likes(id,serverId,isLiked){var apiClient=connectionManager.getApiClient(serverId);return apiClient.updateUserItemRating(apiClient.getCurrentUserId(),id,isLiked)}function played(id,serverId,isPlayed){var apiClient=connectionManager.getApiClient(serverId);return apiClient[isPlayed?"markPlayed":"markUnplayed"](apiClient.getCurrentUserId(),id,new Date)}function favorite(id,serverId,isFavorite){var apiClient=connectionManager.getApiClient(serverId);return apiClient.updateFavoriteStatus(apiClient.getCurrentUserId(),id,isFavorite)}function clearLike(id,serverId){var apiClient=connectionManager.getApiClient(serverId);return apiClient.clearUserItemRating(apiClient.getCurrentUserId(),id)}var userDataMethods={markPlayed:markPlayed,markDislike:markDislike,markLike:markLike,markFavorite:markFavorite};return{fill:fill,destroy:destroy,getIconsHtml:getIconsHtml}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/usersettings/usersettingsbuilder.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/usersettings/usersettingsbuilder.js index 450df5325f..a07cc82b3e 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/usersettings/usersettingsbuilder.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/usersettings/usersettingsbuilder.js @@ -1 +1 @@ -define(["appSettings","events"],function(appsettings,events){"use strict";function onSaveTimeout(){var self=this;self.saveTimeout=null,self.currentApiClient.updateDisplayPreferences("usersettings",self.displayPrefs,self.currentUserId,"emby")}function saveServerPreferences(instance){instance.saveTimeout&&clearTimeout(instance.saveTimeout),instance.saveTimeout=setTimeout(onSaveTimeout.bind(instance),50)}function UserSettings(){}return UserSettings.prototype.setUserInfo=function(userId,apiClient){if(this.saveTimeout&&clearTimeout(this.saveTimeout),this.currentUserId=userId,this.currentApiClient=apiClient,!userId)return this.displayPrefs=null,Promise.resolve();var self=this;return apiClient.getDisplayPreferences("usersettings",userId,"emby").then(function(result){result.CustomPrefs=result.CustomPrefs||{},self.displayPrefs=result})},UserSettings.prototype.getData=function(){return this.displayPrefs},UserSettings.prototype.importFrom=function(instance){this.displayPrefs=instance.getData()},UserSettings.prototype.set=function(name,value,enableOnServer){var userId=this.currentUserId;if(!userId)throw new Error("userId cannot be null");var currentValue=this.get(name,enableOnServer),result=appsettings.set(name,value,userId);return enableOnServer!==!1&&this.displayPrefs&&(this.displayPrefs.CustomPrefs[name]=null==value?value:value.toString(),saveServerPreferences(this)),currentValue!==value&&events.trigger(this,"change",[name]),result},UserSettings.prototype.get=function(name,enableOnServer){var userId=this.currentUserId;return userId?enableOnServer!==!1&&this.displayPrefs?this.displayPrefs.CustomPrefs[name]:appsettings.get(name,userId):null},UserSettings.prototype.serverConfig=function(config){var apiClient=this.currentApiClient;return config?apiClient.updateUserConfiguration(this.currentUserId,config):apiClient.getUser(this.currentUserId).then(function(user){return user.Configuration})},UserSettings.prototype.enableCinemaMode=function(val){return null!=val?this.set("enableCinemaMode",val.toString(),!1):(val=this.get("enableCinemaMode",!1),!val||"false"!==val)},UserSettings.prototype.enableNextVideoInfoOverlay=function(val){return null!=val?this.set("enableNextVideoInfoOverlay",val.toString()):(val=this.get("enableNextVideoInfoOverlay"),"false"!==val)},UserSettings.prototype.enableThemeSongs=function(val){return null!=val?this.set("enableThemeSongs",val.toString(),!1):(val=this.get("enableThemeSongs",!1),"false"!==val)},UserSettings.prototype.enableThemeVideos=function(val){return null!=val?this.set("enableThemeVideos",val.toString(),!1):(val=this.get("enableThemeVideos",!1),val?"false"!==val:UserSettings.defaults.enableThemeVideos)},UserSettings.prototype.enableBackdrops=function(val){return null!=val?this.set("enableBackdrops",val.toString(),!1):(val=this.get("enableBackdrops",!1),val?"false"!==val:UserSettings.defaults.enableBackdrops)},UserSettings.prototype.language=function(val){return null!=val?this.set("language",val.toString(),!1):this.get("language",!1)},UserSettings.prototype.dateTimeLocale=function(val){return null!=val?this.set("datetimelocale",val.toString(),!1):this.get("datetimelocale",!1)},UserSettings.prototype.skipBackLength=function(val){return null!=val?this.set("skipBackLength",val.toString()):parseInt(this.get("skipBackLength")||"10000")},UserSettings.prototype.skipForwardLength=function(val){return null!=val?this.set("skipForwardLength",val.toString()):parseInt(this.get("skipForwardLength")||"30000")},UserSettings.prototype.dashboardTheme=function(val){return null!=val?this.set("dashboardTheme",val):this.get("dashboardTheme")},UserSettings.prototype.skin=function(val){return null!=val?this.set("skin",val,!1):this.get("skin",!1)||UserSettings.defaults.skin},UserSettings.prototype.theme=function(val){return null!=val?this.set("appTheme",val,!1):this.get("appTheme",!1)||UserSettings.defaults.theme},UserSettings.prototype.enableSeasonalThemes=function(val){return null!=val?this.set("enableSeasonalThemes",val,!1):"false"!==this.get("enableSeasonalThemes",!1)},UserSettings.prototype.screensaver=function(val){return null!=val?this.set("screensaver",val,!1):this.get("screensaver",!1)||UserSettings.defaults.screensaver},UserSettings.prototype.soundEffects=function(val){return null!=val?this.set("soundeffects",val,!1):this.get("soundeffects",!1)||UserSettings.defaults.soundEffects},UserSettings.defaults={theme:null,enableThemeVideos:!0},UserSettings.prototype.loadQuerySettings=function(key,query){var values=this.get(key);return values?(values=JSON.parse(values),Object.assign(query,values)):query},UserSettings.prototype.saveQuerySettings=function(key,query){var values={};return query.SortBy&&(values.SortBy=query.SortBy),query.SortOrder&&(values.SortOrder=query.SortOrder),this.set(key,JSON.stringify(values))},UserSettings.prototype.getSubtitleAppearanceSettings=function(key){return key=key||"localplayersubtitleappearance3",JSON.parse(this.get(key,!1)||"{}")},UserSettings.prototype.setSubtitleAppearanceSettings=function(value,key){return key=key||"localplayersubtitleappearance3",this.set(key,JSON.stringify(value),!1)},UserSettings.prototype.setFilter=function(key,value){return this.set(key,value,!0)},UserSettings.prototype.getFilter=function(key){return this.get(key,!0)},UserSettings}); \ No newline at end of file +define(["appSettings","events"],function(appsettings,events){"use strict";function onSaveTimeout(){var self=this;self.saveTimeout=null,self.currentApiClient.updateDisplayPreferences("usersettings",self.displayPrefs,self.currentUserId,"emby")}function saveServerPreferences(instance){instance.saveTimeout&&clearTimeout(instance.saveTimeout),instance.saveTimeout=setTimeout(onSaveTimeout.bind(instance),50)}function UserSettings(){}return UserSettings.prototype.setUserInfo=function(userId,apiClient){if(this.saveTimeout&&clearTimeout(this.saveTimeout),this.currentUserId=userId,this.currentApiClient=apiClient,!userId)return this.displayPrefs=null,Promise.resolve();var self=this;return apiClient.getDisplayPreferences("usersettings",userId,"emby").then(function(result){result.CustomPrefs=result.CustomPrefs||{},self.displayPrefs=result})},UserSettings.prototype.getData=function(){return this.displayPrefs},UserSettings.prototype.importFrom=function(instance){this.displayPrefs=instance.getData()},UserSettings.prototype.set=function(name,value,enableOnServer){var userId=this.currentUserId;if(!userId)throw new Error("userId cannot be null");var currentValue=this.get(name,enableOnServer),result=appsettings.set(name,value,userId);return!1!==enableOnServer&&this.displayPrefs&&(this.displayPrefs.CustomPrefs[name]=null==value?value:value.toString(),saveServerPreferences(this)),currentValue!==value&&events.trigger(this,"change",[name]),result},UserSettings.prototype.get=function(name,enableOnServer){var userId=this.currentUserId;return userId?!1!==enableOnServer&&this.displayPrefs?this.displayPrefs.CustomPrefs[name]:appsettings.get(name,userId):null},UserSettings.prototype.serverConfig=function(config){var apiClient=this.currentApiClient;return config?apiClient.updateUserConfiguration(this.currentUserId,config):apiClient.getUser(this.currentUserId).then(function(user){return user.Configuration})},UserSettings.prototype.enableCinemaMode=function(val){return null!=val?this.set("enableCinemaMode",val.toString(),!1):!(val=this.get("enableCinemaMode",!1))||"false"!==val},UserSettings.prototype.enableNextVideoInfoOverlay=function(val){return null!=val?this.set("enableNextVideoInfoOverlay",val.toString()):"false"!==(val=this.get("enableNextVideoInfoOverlay"))},UserSettings.prototype.enableThemeSongs=function(val){return null!=val?this.set("enableThemeSongs",val.toString(),!1):"false"!==(val=this.get("enableThemeSongs",!1))},UserSettings.prototype.enableThemeVideos=function(val){return null!=val?this.set("enableThemeVideos",val.toString(),!1):(val=this.get("enableThemeVideos",!1),val?"false"!==val:UserSettings.defaults.enableThemeVideos)},UserSettings.prototype.enableBackdrops=function(val){return null!=val?this.set("enableBackdrops",val.toString(),!1):(val=this.get("enableBackdrops",!1),val?"false"!==val:UserSettings.defaults.enableBackdrops)},UserSettings.prototype.language=function(val){return null!=val?this.set("language",val.toString(),!1):this.get("language",!1)},UserSettings.prototype.dateTimeLocale=function(val){return null!=val?this.set("datetimelocale",val.toString(),!1):this.get("datetimelocale",!1)},UserSettings.prototype.skipBackLength=function(val){return null!=val?this.set("skipBackLength",val.toString()):parseInt(this.get("skipBackLength")||"10000")},UserSettings.prototype.skipForwardLength=function(val){return null!=val?this.set("skipForwardLength",val.toString()):parseInt(this.get("skipForwardLength")||"30000")},UserSettings.prototype.dashboardTheme=function(val){return null!=val?this.set("dashboardTheme",val):this.get("dashboardTheme")},UserSettings.prototype.skin=function(val){return null!=val?this.set("skin",val,!1):this.get("skin",!1)||UserSettings.defaults.skin},UserSettings.prototype.theme=function(val){return null!=val?this.set("appTheme",val,!1):this.get("appTheme",!1)||UserSettings.defaults.theme},UserSettings.prototype.enableSeasonalThemes=function(val){return null!=val?this.set("enableSeasonalThemes",val,!1):"false"!==this.get("enableSeasonalThemes",!1)},UserSettings.prototype.screensaver=function(val){return null!=val?this.set("screensaver",val,!1):this.get("screensaver",!1)||UserSettings.defaults.screensaver},UserSettings.prototype.soundEffects=function(val){return null!=val?this.set("soundeffects",val,!1):this.get("soundeffects",!1)||UserSettings.defaults.soundEffects},UserSettings.defaults={theme:null,enableThemeVideos:!0},UserSettings.prototype.loadQuerySettings=function(key,query){var values=this.get(key);return values?(values=JSON.parse(values),Object.assign(query,values)):query},UserSettings.prototype.saveQuerySettings=function(key,query){var values={};return query.SortBy&&(values.SortBy=query.SortBy),query.SortOrder&&(values.SortOrder=query.SortOrder),this.set(key,JSON.stringify(values))},UserSettings.prototype.getSubtitleAppearanceSettings=function(key){return key=key||"localplayersubtitleappearance3",JSON.parse(this.get(key,!1)||"{}")},UserSettings.prototype.setSubtitleAppearanceSettings=function(value,key){return key=key||"localplayersubtitleappearance3",this.set(key,JSON.stringify(value),!1)},UserSettings.prototype.setFilter=function(key,value){return this.set(key,value,!0)},UserSettings.prototype.getFilter=function(key){return this.get(key,!0)},UserSettings}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/viewmanager/viewcontainer-lite.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/viewmanager/viewcontainer-lite.js index 09809225b8..fc20b90078 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/viewmanager/viewcontainer-lite.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/viewmanager/viewcontainer-lite.js @@ -1 +1 @@ -define(["browser","dom","layoutManager","css!./viewcontainer-lite"],function(browser,dom,layoutManager){"use strict";function enableAnimation(){return!browser.tv&&browser.supportsCssAnimation()}function findLastView(parent,className){for(var nodes=parent.childNodes,i=nodes.length-1;i>=0;i--){var node=nodes[i],classList=node.classList;if(classList&&classList.contains(className))return node}}function findViewBefore(elem,className){for(var node=elem.previousSibling;node;){var classList=node.classList;if(classList&&classList.contains(className))return node;node=node.previousSibling}}function loadView(options){if(!options.cancel){cancelActiveAnimations();var selected=selectedPageIndex,previousAnimatable=selected===-1?null:allPages[selected],pageIndex=selected+1;pageIndex>=pageContainerCount&&(pageIndex=0);var viewHtml=options.view,properties=[];options.fullscreen&&properties.push("fullscreen");var view,currentPage=allPages[pageIndex];return currentPage?(triggerDestroy(currentPage),currentPage.insertAdjacentHTML("beforebegin",viewHtml),view=findViewBefore(currentPage,"view"),mainAnimatedPages.removeChild(currentPage)):(mainAnimatedPages.insertAdjacentHTML("beforeend",viewHtml),view=findLastView(mainAnimatedPages,"view")),view.classList.add("mainAnimatedPage"),properties.length&&view.setAttribute("data-properties",properties.join(",")),options.type&&view.setAttribute("data-type",options.type),allPages[pageIndex]=view,onBeforeChange&&onBeforeChange(view,!1,options),beforeAnimate(allPages,pageIndex,selected),animate(view,previousAnimatable,options.transition,options.isBack).then(function(){return selectedPageIndex=pageIndex,currentUrls[pageIndex]=options.url,!options.cancel&&previousAnimatable&&afterAnimate(allPages,pageIndex),view})}}function beforeAnimate(allPages,newPageIndex,oldPageIndex){for(var i=0,length=allPages.length;i=0;i--){var node=nodes[i],classList=node.classList;if(classList&&classList.contains(className))return node}}function findViewBefore(elem,className){for(var node=elem.previousSibling;node;){var classList=node.classList;if(classList&&classList.contains(className))return node;node=node.previousSibling}}function loadView(options){if(!options.cancel){cancelActiveAnimations();var selected=selectedPageIndex,previousAnimatable=-1===selected?null:allPages[selected],pageIndex=selected+1;pageIndex>=pageContainerCount&&(pageIndex=0);var viewHtml=options.view,properties=[];options.fullscreen&&properties.push("fullscreen");var view,currentPage=allPages[pageIndex];return currentPage?(triggerDestroy(currentPage),currentPage.insertAdjacentHTML("beforebegin",viewHtml),view=findViewBefore(currentPage,"view"),mainAnimatedPages.removeChild(currentPage)):(mainAnimatedPages.insertAdjacentHTML("beforeend",viewHtml),view=findLastView(mainAnimatedPages,"view")),view.classList.add("mainAnimatedPage"),properties.length&&view.setAttribute("data-properties",properties.join(",")),options.type&&view.setAttribute("data-type",options.type),allPages[pageIndex]=view,onBeforeChange&&onBeforeChange(view,!1,options),beforeAnimate(allPages,pageIndex,selected),animate(view,previousAnimatable,options.transition,options.isBack).then(function(){return selectedPageIndex=pageIndex,currentUrls[pageIndex]=options.url,!options.cancel&&previousAnimatable&&afterAnimate(allPages,pageIndex),view})}}function beforeAnimate(allPages,newPageIndex,oldPageIndex){for(var i=0,length=allPages.length;i
    ';var videoElement=dlg.querySelector("#player");document.body.insertBefore(dlg,document.body.firstChild),instance.videoDialog=dlg,options.fullscreen&&dlg.animate&&!browser.slow?zoomIn(dlg,1).onfinish=function(){resolve(videoElement)}:resolve(videoElement)})})}function onVideoResize(){var instance=this,player=instance.currentYoutubePlayer,dlg=instance.videoDialog;player&&dlg&&player.setSize(dlg.offsetWidth,dlg.offsetHeight)}function clearTimeUpdateInterval(instance){instance.timeUpdateInterval&&clearInterval(instance.timeUpdateInterval),instance.timeUpdateInterval=null}function onEndedInternal(instance){clearTimeUpdateInterval(instance);var resizeListener=instance.resizeListener;resizeListener&&(window.removeEventListener("resize",resizeListener),window.removeEventListener("orientationChange",resizeListener),instance.resizeListener=null);var stopInfo={src:instance._currentSrc};events.trigger(instance,"stopped",[stopInfo]),instance._currentSrc=null,instance.currentYoutubePlayer&&instance.currentYoutubePlayer.destroy(),instance.currentYoutubePlayer=null}function onPlayerReady(event){event.target.playVideo()}function onTimeUpdate(e){events.trigger(this,"timeupdate")}function onPlaying(instance,playOptions,resolve){instance.started||(instance.started=!0,resolve(),clearTimeUpdateInterval(instance),instance.timeUpdateInterval=setInterval(onTimeUpdate.bind(instance),500),playOptions.fullscreen?appRouter.showVideoOsd().then(function(){instance.videoDialog.classList.remove("onTop")}):(appRouter.setTransparency("backdrop"),instance.videoDialog.classList.remove("onTop")),require(["loading"],function(loading){loading.hide()}))}function setCurrentSrc(instance,elem,options){return new Promise(function(resolve,reject){require(["queryString"],function(queryString){instance._currentSrc=options.url;var params=queryString.parse(options.url.split("?")[1]);if(window.onYouTubeIframeAPIReady=function(){instance.currentYoutubePlayer=new YT.Player("player",{height:instance.videoDialog.offsetHeight,width:instance.videoDialog.offsetWidth,videoId:params.v,events:{onReady:onPlayerReady,onStateChange:function(event){event.data===YT.PlayerState.PLAYING?onPlaying(instance,options,resolve):event.data===YT.PlayerState.ENDED?onEndedInternal(instance):event.data===YT.PlayerState.PAUSED&&events.trigger(instance,"pause")}},playerVars:{controls:0,enablejsapi:1,modestbranding:1,rel:0,showinfo:0,fs:0,playsinline:1}});var resizeListener=instance.resizeListener;resizeListener?(window.removeEventListener("resize",resizeListener),window.addEventListener("resize",resizeListener)):(resizeListener=instance.resizeListener=onVideoResize.bind(instance),window.addEventListener("resize",resizeListener)),window.removeEventListener("orientationChange",resizeListener),window.addEventListener("orientationChange",resizeListener)},window.YT)window.onYouTubeIframeAPIReady();else{var tag=document.createElement("script");tag.src="https://www.youtube.com/iframe_api";var firstScriptTag=document.getElementsByTagName("script")[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}})})}function YoutubePlayer(){this.name="Youtube Player",this.type="mediaplayer",this.id="youtubeplayer",this.priority=1}return YoutubePlayer.prototype.play=function(options){this.started=!1;var instance=this;return createMediaElement(this,options).then(function(elem){return setCurrentSrc(instance,elem,options)})},YoutubePlayer.prototype.stop=function(destroyPlayer){var src=this._currentSrc;return src&&(this.currentYoutubePlayer&&this.currentYoutubePlayer.stopVideo(),onEndedInternal(this),destroyPlayer&&this.destroy()),Promise.resolve()},YoutubePlayer.prototype.destroy=function(){appRouter.setTransparency("none");var dlg=this.videoDialog;dlg&&(this.videoDialog=null,dlg.parentNode.removeChild(dlg))},YoutubePlayer.prototype.canPlayMediaType=function(mediaType){return mediaType=(mediaType||"").toLowerCase(),"audio"===mediaType||"video"===mediaType},YoutubePlayer.prototype.canPlayItem=function(item){return!1},YoutubePlayer.prototype.canPlayUrl=function(url){return url.toLowerCase().indexOf("youtube.com")!==-1},YoutubePlayer.prototype.getDeviceProfile=function(){return Promise.resolve({})},YoutubePlayer.prototype.currentSrc=function(){return this._currentSrc},YoutubePlayer.prototype.setSubtitleStreamIndex=function(index){},YoutubePlayer.prototype.canSetAudioStreamIndex=function(){return!1},YoutubePlayer.prototype.setAudioStreamIndex=function(index){},YoutubePlayer.prototype.currentTime=function(val){var currentYoutubePlayer=this.currentYoutubePlayer;if(currentYoutubePlayer)return null!=val?void currentYoutubePlayer.seekTo(val/1e3,!0):1e3*currentYoutubePlayer.getCurrentTime()},YoutubePlayer.prototype.duration=function(val){var currentYoutubePlayer=this.currentYoutubePlayer;return currentYoutubePlayer?1e3*currentYoutubePlayer.getDuration():null},YoutubePlayer.prototype.pause=function(){var currentYoutubePlayer=this.currentYoutubePlayer;if(currentYoutubePlayer){currentYoutubePlayer.pauseVideo();var instance=this;setTimeout(function(){events.trigger(instance,"pause")},200)}},YoutubePlayer.prototype.unpause=function(){var currentYoutubePlayer=this.currentYoutubePlayer;if(currentYoutubePlayer){currentYoutubePlayer.playVideo();var instance=this;setTimeout(function(){events.trigger(instance,"unpause")},200)}},YoutubePlayer.prototype.paused=function(){var currentYoutubePlayer=this.currentYoutubePlayer;return!!currentYoutubePlayer&&2===currentYoutubePlayer.getPlayerState()},YoutubePlayer.prototype.volume=function(val){return null!=val?this.setVolume(val):this.getVolume()},YoutubePlayer.prototype.setVolume=function(val){var currentYoutubePlayer=this.currentYoutubePlayer;currentYoutubePlayer&&null!=val&¤tYoutubePlayer.setVolume(val)},YoutubePlayer.prototype.getVolume=function(){var currentYoutubePlayer=this.currentYoutubePlayer;if(currentYoutubePlayer)return currentYoutubePlayer.getVolume()},YoutubePlayer.prototype.setMute=function(mute){var currentYoutubePlayer=this.currentYoutubePlayer;mute?currentYoutubePlayer&¤tYoutubePlayer.mute():currentYoutubePlayer&¤tYoutubePlayer.unMute()},YoutubePlayer.prototype.isMuted=function(){var currentYoutubePlayer=this.currentYoutubePlayer;if(currentYoutubePlayer)return currentYoutubePlayer.isMuted()},YoutubePlayer}); \ No newline at end of file +define(["require","events","browser","appRouter","loading"],function(require,events,browser,appRouter,loading){"use strict";function zoomIn(elem,iterations){var keyframes=[{transform:"scale3d(.2, .2, .2) ",opacity:".6",offset:0},{transform:"none",opacity:"1",offset:1}],timing={duration:240,iterations:iterations};return elem.animate(keyframes,timing)}function createMediaElement(instance,options){return new Promise(function(resolve,reject){var dlg=document.querySelector(".youtubePlayerContainer");dlg?resolve(dlg.querySelector("#player")):require(["css!./style"],function(){loading.show();var dlg=document.createElement("div");dlg.classList.add("youtubePlayerContainer"),options.fullscreen&&dlg.classList.add("onTop"),dlg.innerHTML='
    ';var videoElement=dlg.querySelector("#player");document.body.insertBefore(dlg,document.body.firstChild),instance.videoDialog=dlg,options.fullscreen&&dlg.animate&&!browser.slow?zoomIn(dlg,1).onfinish=function(){resolve(videoElement)}:resolve(videoElement)})})}function onVideoResize(){var instance=this,player=instance.currentYoutubePlayer,dlg=instance.videoDialog;player&&dlg&&player.setSize(dlg.offsetWidth,dlg.offsetHeight)}function clearTimeUpdateInterval(instance){instance.timeUpdateInterval&&clearInterval(instance.timeUpdateInterval),instance.timeUpdateInterval=null}function onEndedInternal(instance){clearTimeUpdateInterval(instance);var resizeListener=instance.resizeListener;resizeListener&&(window.removeEventListener("resize",resizeListener),window.removeEventListener("orientationChange",resizeListener),instance.resizeListener=null);var stopInfo={src:instance._currentSrc};events.trigger(instance,"stopped",[stopInfo]),instance._currentSrc=null,instance.currentYoutubePlayer&&instance.currentYoutubePlayer.destroy(),instance.currentYoutubePlayer=null}function onPlayerReady(event){event.target.playVideo()}function onTimeUpdate(e){events.trigger(this,"timeupdate")}function onPlaying(instance,playOptions,resolve){instance.started||(instance.started=!0,resolve(),clearTimeUpdateInterval(instance),instance.timeUpdateInterval=setInterval(onTimeUpdate.bind(instance),500),playOptions.fullscreen?appRouter.showVideoOsd().then(function(){instance.videoDialog.classList.remove("onTop")}):(appRouter.setTransparency("backdrop"),instance.videoDialog.classList.remove("onTop")),require(["loading"],function(loading){loading.hide()}))}function setCurrentSrc(instance,elem,options){return new Promise(function(resolve,reject){require(["queryString"],function(queryString){instance._currentSrc=options.url;var params=queryString.parse(options.url.split("?")[1]);if(window.onYouTubeIframeAPIReady=function(){instance.currentYoutubePlayer=new YT.Player("player",{height:instance.videoDialog.offsetHeight,width:instance.videoDialog.offsetWidth,videoId:params.v,events:{onReady:onPlayerReady,onStateChange:function(event){event.data===YT.PlayerState.PLAYING?onPlaying(instance,options,resolve):event.data===YT.PlayerState.ENDED?onEndedInternal(instance):event.data===YT.PlayerState.PAUSED&&events.trigger(instance,"pause")}},playerVars:{controls:0,enablejsapi:1,modestbranding:1,rel:0,showinfo:0,fs:0,playsinline:1}});var resizeListener=instance.resizeListener;resizeListener?(window.removeEventListener("resize",resizeListener),window.addEventListener("resize",resizeListener)):(resizeListener=instance.resizeListener=onVideoResize.bind(instance),window.addEventListener("resize",resizeListener)),window.removeEventListener("orientationChange",resizeListener),window.addEventListener("orientationChange",resizeListener)},window.YT)window.onYouTubeIframeAPIReady();else{var tag=document.createElement("script");tag.src="https://www.youtube.com/iframe_api";var firstScriptTag=document.getElementsByTagName("script")[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}})})}function YoutubePlayer(){this.name="Youtube Player",this.type="mediaplayer",this.id="youtubeplayer",this.priority=1}return YoutubePlayer.prototype.play=function(options){this.started=!1;var instance=this;return createMediaElement(this,options).then(function(elem){return setCurrentSrc(instance,elem,options)})},YoutubePlayer.prototype.stop=function(destroyPlayer){return this._currentSrc&&(this.currentYoutubePlayer&&this.currentYoutubePlayer.stopVideo(),onEndedInternal(this),destroyPlayer&&this.destroy()),Promise.resolve()},YoutubePlayer.prototype.destroy=function(){appRouter.setTransparency("none");var dlg=this.videoDialog;dlg&&(this.videoDialog=null,dlg.parentNode.removeChild(dlg))},YoutubePlayer.prototype.canPlayMediaType=function(mediaType){return"audio"===(mediaType=(mediaType||"").toLowerCase())||"video"===mediaType},YoutubePlayer.prototype.canPlayItem=function(item){return!1},YoutubePlayer.prototype.canPlayUrl=function(url){return-1!==url.toLowerCase().indexOf("youtube.com")},YoutubePlayer.prototype.getDeviceProfile=function(){return Promise.resolve({})},YoutubePlayer.prototype.currentSrc=function(){return this._currentSrc},YoutubePlayer.prototype.setSubtitleStreamIndex=function(index){},YoutubePlayer.prototype.canSetAudioStreamIndex=function(){return!1},YoutubePlayer.prototype.setAudioStreamIndex=function(index){},YoutubePlayer.prototype.currentTime=function(val){var currentYoutubePlayer=this.currentYoutubePlayer;if(currentYoutubePlayer)return null!=val?void currentYoutubePlayer.seekTo(val/1e3,!0):1e3*currentYoutubePlayer.getCurrentTime()},YoutubePlayer.prototype.duration=function(val){var currentYoutubePlayer=this.currentYoutubePlayer;return currentYoutubePlayer?1e3*currentYoutubePlayer.getDuration():null},YoutubePlayer.prototype.pause=function(){var currentYoutubePlayer=this.currentYoutubePlayer;if(currentYoutubePlayer){currentYoutubePlayer.pauseVideo();var instance=this;setTimeout(function(){events.trigger(instance,"pause")},200)}},YoutubePlayer.prototype.unpause=function(){var currentYoutubePlayer=this.currentYoutubePlayer;if(currentYoutubePlayer){currentYoutubePlayer.playVideo();var instance=this;setTimeout(function(){events.trigger(instance,"unpause")},200)}},YoutubePlayer.prototype.paused=function(){var currentYoutubePlayer=this.currentYoutubePlayer;return!!currentYoutubePlayer&&2===currentYoutubePlayer.getPlayerState()},YoutubePlayer.prototype.volume=function(val){return null!=val?this.setVolume(val):this.getVolume()},YoutubePlayer.prototype.setVolume=function(val){var currentYoutubePlayer=this.currentYoutubePlayer;currentYoutubePlayer&&null!=val&¤tYoutubePlayer.setVolume(val)},YoutubePlayer.prototype.getVolume=function(){var currentYoutubePlayer=this.currentYoutubePlayer;if(currentYoutubePlayer)return currentYoutubePlayer.getVolume()},YoutubePlayer.prototype.setMute=function(mute){var currentYoutubePlayer=this.currentYoutubePlayer;mute?currentYoutubePlayer&¤tYoutubePlayer.mute():currentYoutubePlayer&¤tYoutubePlayer.unMute()},YoutubePlayer.prototype.isMuted=function(){var currentYoutubePlayer=this.currentYoutubePlayer;if(currentYoutubePlayer)return currentYoutubePlayer.isMuted()},YoutubePlayer}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/fetch/fetch.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/fetch/fetch.js index 507e2d01ce..7d540d3071 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/fetch/fetch.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/fetch/fetch.js @@ -1 +1 @@ -!function(self){"use strict";function normalizeName(name){if("string"!=typeof name&&(name=String(name)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name))throw new TypeError("Invalid character in header field name");return name.toLowerCase()}function normalizeValue(value){return"string"!=typeof value&&(value=String(value)),value}function iteratorFor(items){var iterator={next:function(){var value=items.shift();return{done:void 0===value,value:value}}};return support.iterable&&(iterator[Symbol.iterator]=function(){return iterator}),iterator}function Headers(headers){this.map={},headers instanceof Headers?headers.forEach(function(value,name){this.append(name,value)},this):headers&&Object.getOwnPropertyNames(headers).forEach(function(name){this.append(name,headers[name])},this)}function consumed(body){return body.bodyUsed?Promise.reject(new TypeError("Already read")):void(body.bodyUsed=!0)}function fileReaderReady(reader){return new Promise(function(resolve,reject){reader.onload=function(){resolve(reader.result)},reader.onerror=function(){reject(reader.error)}})}function readBlobAsArrayBuffer(blob){var reader=new FileReader,promise=fileReaderReady(reader);return reader.readAsArrayBuffer(blob),promise}function readBlobAsText(blob){var reader=new FileReader,promise=fileReaderReady(reader);return reader.readAsText(blob),promise}function readArrayBufferAsText(buf){for(var view=new Uint8Array(buf),chars=new Array(view.length),i=0;i-1?upcased:method}function Request(input,options){options=options||{};var body=options.body;if("string"==typeof input)this.url=input;else{if(input.bodyUsed)throw new TypeError("Already read");this.url=input.url,this.credentials=input.credentials,options.headers||(this.headers=new Headers(input.headers)),this.method=input.method,this.mode=input.mode,body||null==input._bodyInit||(body=input._bodyInit,input.bodyUsed=!0)}if(this.credentials=options.credentials||this.credentials||"omit",!options.headers&&this.headers||(this.headers=new Headers(options.headers)),this.method=normalizeMethod(options.method||this.method||"GET"),this.mode=options.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&body)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(body)}function decode(body){var form=new FormData;return body.trim().split("&").forEach(function(bytes){if(bytes){var split=bytes.split("="),name=split.shift().replace(/\+/g," "),value=split.join("=").replace(/\+/g," ");form.append(decodeURIComponent(name),decodeURIComponent(value))}}),form}function parseHeaders(rawHeaders){var headers=new Headers;return rawHeaders.split("\r\n").forEach(function(line){var parts=line.split(":"),key=parts.shift().trim();if(key){var value=parts.join(":").trim();headers.append(key,value)}}),headers}function Response(bodyInit,options){options||(options={}),this.type="default",this.status="status"in options?options.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in options?options.statusText:"OK",this.headers=new Headers(options.headers),this.url=options.url||"",this._initBody(bodyInit)}if(!self.fetch){var support={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(support.arrayBuffer)var viewClasses=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],isDataView=function(obj){return obj&&DataView.prototype.isPrototypeOf(obj)},isArrayBufferView=ArrayBuffer.isView||function(obj){return obj&&viewClasses.indexOf(Object.prototype.toString.call(obj))>-1};Headers.prototype.append=function(name,value){name=normalizeName(name),value=normalizeValue(value);var list=this.map[name];list||(list=[],this.map[name]=list),list.push(value)},Headers.prototype.delete=function(name){delete this.map[normalizeName(name)]},Headers.prototype.get=function(name){var values=this.map[normalizeName(name)];return values?values[0]:null},Headers.prototype.getAll=function(name){return this.map[normalizeName(name)]||[]},Headers.prototype.has=function(name){return this.map.hasOwnProperty(normalizeName(name))},Headers.prototype.set=function(name,value){this.map[normalizeName(name)]=[normalizeValue(value)]},Headers.prototype.forEach=function(callback,thisArg){Object.getOwnPropertyNames(this.map).forEach(function(name){this.map[name].forEach(function(value){callback.call(thisArg,value,name,this)},this)},this)},Headers.prototype.keys=function(){var items=[];return this.forEach(function(value,name){items.push(name)}),iteratorFor(items)},Headers.prototype.values=function(){var items=[];return this.forEach(function(value){items.push(value)}),iteratorFor(items)},Headers.prototype.entries=function(){var items=[];return this.forEach(function(value,name){items.push([name,value])}),iteratorFor(items)},support.iterable&&(Headers.prototype[Symbol.iterator]=Headers.prototype.entries);var methods=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];Request.prototype.clone=function(){return new Request(this,{body:this._bodyInit})},Body.call(Request.prototype),Body.call(Response.prototype),Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers(this.headers),url:this.url})},Response.error=function(){var response=new Response(null,{status:0,statusText:""});return response.type="error",response};var redirectStatuses=[301,302,303,307,308];Response.redirect=function(url,status){if(redirectStatuses.indexOf(status)===-1)throw new RangeError("Invalid status code");return new Response(null,{status:status,headers:{location:url}})},self.Headers=Headers,self.Request=Request,self.Response=Response,self.fetch=function(input,init){return new Promise(function(resolve,reject){var request=new Request(input,init),xhr=new XMLHttpRequest;xhr.onload=function(){var options={status:xhr.status,statusText:xhr.statusText,headers:parseHeaders(xhr.getAllResponseHeaders()||"")};options.url="responseURL"in xhr?xhr.responseURL:options.headers.get("X-Request-URL");var body="response"in xhr?xhr.response:xhr.responseText;resolve(new Response(body,options))},xhr.onerror=function(){reject(new TypeError("Network request failed"))},xhr.ontimeout=function(){reject(new TypeError("Network request failed"))},xhr.open(request.method,request.url,!0),"include"===request.credentials&&(xhr.withCredentials=!0),"responseType"in xhr&&support.blob&&(xhr.responseType="blob"),request.headers.forEach(function(value,name){xhr.setRequestHeader(name,value)}),xhr.send("undefined"==typeof request._bodyInit?null:request._bodyInit)})},self.fetch.polyfill=!0}}("undefined"!=typeof self?self:this); \ No newline at end of file +!function(self){"use strict";function normalizeName(name){if("string"!=typeof name&&(name=String(name)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name))throw new TypeError("Invalid character in header field name");return name.toLowerCase()}function normalizeValue(value){return"string"!=typeof value&&(value=String(value)),value}function iteratorFor(items){var iterator={next:function(){var value=items.shift();return{done:void 0===value,value:value}}};return support.iterable&&(iterator[Symbol.iterator]=function(){return iterator}),iterator}function Headers(headers){this.map={},headers instanceof Headers?headers.forEach(function(value,name){this.append(name,value)},this):headers&&Object.getOwnPropertyNames(headers).forEach(function(name){this.append(name,headers[name])},this)}function consumed(body){if(body.bodyUsed)return Promise.reject(new TypeError("Already read"));body.bodyUsed=!0}function fileReaderReady(reader){return new Promise(function(resolve,reject){reader.onload=function(){resolve(reader.result)},reader.onerror=function(){reject(reader.error)}})}function readBlobAsArrayBuffer(blob){var reader=new FileReader,promise=fileReaderReady(reader);return reader.readAsArrayBuffer(blob),promise}function readBlobAsText(blob){var reader=new FileReader,promise=fileReaderReady(reader);return reader.readAsText(blob),promise}function readArrayBufferAsText(buf){for(var view=new Uint8Array(buf),chars=new Array(view.length),i=0;i-1?upcased:method}function Request(input,options){options=options||{};var body=options.body;if("string"==typeof input)this.url=input;else{if(input.bodyUsed)throw new TypeError("Already read");this.url=input.url,this.credentials=input.credentials,options.headers||(this.headers=new Headers(input.headers)),this.method=input.method,this.mode=input.mode,body||null==input._bodyInit||(body=input._bodyInit,input.bodyUsed=!0)}if(this.credentials=options.credentials||this.credentials||"omit",!options.headers&&this.headers||(this.headers=new Headers(options.headers)),this.method=normalizeMethod(options.method||this.method||"GET"),this.mode=options.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&body)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(body)}function decode(body){var form=new FormData;return body.trim().split("&").forEach(function(bytes){if(bytes){var split=bytes.split("="),name=split.shift().replace(/\+/g," "),value=split.join("=").replace(/\+/g," ");form.append(decodeURIComponent(name),decodeURIComponent(value))}}),form}function parseHeaders(rawHeaders){var headers=new Headers;return rawHeaders.split("\r\n").forEach(function(line){var parts=line.split(":"),key=parts.shift().trim();if(key){var value=parts.join(":").trim();headers.append(key,value)}}),headers}function Response(bodyInit,options){options||(options={}),this.type="default",this.status="status"in options?options.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in options?options.statusText:"OK",this.headers=new Headers(options.headers),this.url=options.url||"",this._initBody(bodyInit)}if(!self.fetch){var support={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(support.arrayBuffer)var viewClasses=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],isDataView=function(obj){return obj&&DataView.prototype.isPrototypeOf(obj)},isArrayBufferView=ArrayBuffer.isView||function(obj){return obj&&viewClasses.indexOf(Object.prototype.toString.call(obj))>-1};Headers.prototype.append=function(name,value){name=normalizeName(name),value=normalizeValue(value);var list=this.map[name];list||(list=[],this.map[name]=list),list.push(value)},Headers.prototype.delete=function(name){delete this.map[normalizeName(name)]},Headers.prototype.get=function(name){var values=this.map[normalizeName(name)];return values?values[0]:null},Headers.prototype.getAll=function(name){return this.map[normalizeName(name)]||[]},Headers.prototype.has=function(name){return this.map.hasOwnProperty(normalizeName(name))},Headers.prototype.set=function(name,value){this.map[normalizeName(name)]=[normalizeValue(value)]},Headers.prototype.forEach=function(callback,thisArg){Object.getOwnPropertyNames(this.map).forEach(function(name){this.map[name].forEach(function(value){callback.call(thisArg,value,name,this)},this)},this)},Headers.prototype.keys=function(){var items=[];return this.forEach(function(value,name){items.push(name)}),iteratorFor(items)},Headers.prototype.values=function(){var items=[];return this.forEach(function(value){items.push(value)}),iteratorFor(items)},Headers.prototype.entries=function(){var items=[];return this.forEach(function(value,name){items.push([name,value])}),iteratorFor(items)},support.iterable&&(Headers.prototype[Symbol.iterator]=Headers.prototype.entries);var methods=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];Request.prototype.clone=function(){return new Request(this,{body:this._bodyInit})},Body.call(Request.prototype),Body.call(Response.prototype),Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers(this.headers),url:this.url})},Response.error=function(){var response=new Response(null,{status:0,statusText:""});return response.type="error",response};var redirectStatuses=[301,302,303,307,308];Response.redirect=function(url,status){if(-1===redirectStatuses.indexOf(status))throw new RangeError("Invalid status code");return new Response(null,{status:status,headers:{location:url}})},self.Headers=Headers,self.Request=Request,self.Response=Response,self.fetch=function(input,init){return new Promise(function(resolve,reject){var request=new Request(input,init),xhr=new XMLHttpRequest;xhr.onload=function(){var options={status:xhr.status,statusText:xhr.statusText,headers:parseHeaders(xhr.getAllResponseHeaders()||"")};options.url="responseURL"in xhr?xhr.responseURL:options.headers.get("X-Request-URL");var body="response"in xhr?xhr.response:xhr.responseText;resolve(new Response(body,options))},xhr.onerror=function(){reject(new TypeError("Network request failed"))},xhr.ontimeout=function(){reject(new TypeError("Network request failed"))},xhr.open(request.method,request.url,!0),"include"===request.credentials&&(xhr.withCredentials=!0),"responseType"in xhr&&support.blob&&(xhr.responseType="blob"),request.headers.forEach(function(value,name){xhr.setRequestHeader(name,value)}),xhr.send(void 0===request._bodyInit?null:request._bodyInit)})},self.fetch.polyfill=!0}}("undefined"!=typeof self?self:this); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/jquery/dist/core.js b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/jquery/dist/core.js index bae335dc1b..4565e5b9c1 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/jquery/dist/core.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/jquery/dist/core.js @@ -1 +1 @@ -define(["./var/arr","./var/document","./var/getProto","./var/slice","./var/concat","./var/push","./var/indexOf","./var/class2type","./var/toString","./var/hasOwn","./var/fnToString","./var/ObjectFunctionString","./var/support","./var/isFunction","./var/isWindow","./core/DOMEval","./core/toType"],function(arr,document,getProto,slice,concat,push,indexOf,class2type,toString,hasOwn,fnToString,ObjectFunctionString,support,isFunction,isWindow,DOMEval,toType){"use strict";function isArrayLike(obj){var length=!!obj&&"length"in obj&&obj.length,type=toType(obj);return!isFunction(obj)&&!isWindow(obj)&&("array"===type||0===length||"number"==typeof length&&length>0&&length-1 in obj)}var version="3.3.1",jQuery=function(selector,context){return new jQuery.fn.init(selector,context)},rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;return jQuery.fn=jQuery.prototype={jquery:version,constructor:jQuery,length:0,toArray:function(){return slice.call(this)},get:function(num){return null==num?slice.call(this):num<0?this[num+this.length]:this[num]},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);return ret.prevObject=this,ret},each:function(callback){return jQuery.each(this,callback)},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},slice:function(){return this.pushStack(slice.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j0&&length-1 in obj)}var jQuery=function(selector,context){return new jQuery.fn.init(selector,context)},rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;return jQuery.fn=jQuery.prototype={jquery:"3.3.1",constructor:jQuery,length:0,toArray:function(){return slice.call(this)},get:function(num){return null==num?slice.call(this):num<0?this[num+this.length]:this[num]},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);return ret.prevObject=this,ret},each:function(callback){return jQuery.each(this,callback)},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},slice:function(){return this.pushStack(slice.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j0&&length-1 in obj)}function nodeName(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase()}function winnow(elements,qualifier,not){return isFunction(qualifier)?jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not}):qualifier.nodeType?jQuery.grep(elements,function(elem){return elem===qualifier!==not}):"string"!=typeof qualifier?jQuery.grep(elements,function(elem){return indexOf.call(qualifier,elem)>-1!==not}):jQuery.filter(qualifier,elements,not)}function sibling(cur,dir){for(;(cur=cur[dir])&&1!==cur.nodeType;);return cur}function createOptions(options){var object={};return jQuery.each(options.match(rnothtmlwhite)||[],function(_,flag){object[flag]=!0}),object}function Identity(v){return v}function Thrower(ex){throw ex}function adoptValue(value,resolve,reject,noValue){var method;try{value&&isFunction(method=value.promise)?method.call(value).done(resolve).fail(reject):value&&isFunction(method=value.then)?method.call(value,resolve,reject):resolve.apply(void 0,[value].slice(noValue))}catch(value){reject.apply(void 0,[value])}}function completed(){document.removeEventListener("DOMContentLoaded",completed),window.removeEventListener("load",completed),jQuery.ready()}function fcamelCase(all,letter){return letter.toUpperCase()}function camelCase(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)}function Data(){this.expando=jQuery.expando+Data.uid++}function getData(data){return"true"===data||"false"!==data&&("null"===data?null:data===+data+""?+data:rbrace.test(data)?JSON.parse(data):data)}function dataAttr(elem,key,data){var name;if(void 0===data&&1===elem.nodeType)if(name="data-"+key.replace(rmultiDash,"-$&").toLowerCase(),data=elem.getAttribute(name),"string"==typeof data){try{data=getData(data)}catch(e){}dataUser.set(elem,key,data)}else data=void 0;return data}function adjustCSS(elem,prop,valueParts,tween){var adjusted,scale,maxIterations=20,currentValue=tween?function(){return tween.cur()}:function(){return jQuery.css(elem,prop,"")},initial=currentValue(),unit=valueParts&&valueParts[3]||(jQuery.cssNumber[prop]?"":"px"),initialInUnit=(jQuery.cssNumber[prop]||"px"!==unit&&+initial)&&rcssNum.exec(jQuery.css(elem,prop));if(initialInUnit&&initialInUnit[3]!==unit){for(initial/=2,unit=unit||initialInUnit[3],initialInUnit=+initial||1;maxIterations--;)jQuery.style(elem,prop,initialInUnit+unit),(1-scale)*(1-(scale=currentValue()/initial||.5))<=0&&(maxIterations=0),initialInUnit/=scale;initialInUnit=2*initialInUnit,jQuery.style(elem,prop,initialInUnit+unit),valueParts=valueParts||[]}return valueParts&&(initialInUnit=+initialInUnit||+initial||0,adjusted=valueParts[1]?initialInUnit+(valueParts[1]+1)*valueParts[2]:+valueParts[2],tween&&(tween.unit=unit,tween.start=initialInUnit,tween.end=adjusted)),adjusted}function getDefaultDisplay(elem){var temp,doc=elem.ownerDocument,nodeName=elem.nodeName,display=defaultDisplayMap[nodeName];return display?display:(temp=doc.body.appendChild(doc.createElement(nodeName)),display=jQuery.css(temp,"display"),temp.parentNode.removeChild(temp),"none"===display&&(display="block"),defaultDisplayMap[nodeName]=display,display)}function showHide(elements,show){for(var display,elem,values=[],index=0,length=elements.length;index-1)ignored&&ignored.push(elem);else if(contains=jQuery.contains(elem.ownerDocument,elem),tmp=getAll(fragment.appendChild(elem),"script"),contains&&setGlobalEval(tmp),scripts)for(j=0;elem=tmp[j++];)rscriptType.test(elem.type||"")&&scripts.push(elem);return fragment}function returnTrue(){return!0}function returnFalse(){return!1}function safeActiveElement(){try{return document.activeElement}catch(err){}}function on(elem,types,selector,data,fn,one){var origFn,type;if("object"==typeof types){"string"!=typeof selector&&(data=data||selector,selector=void 0);for(type in types)on(elem,type,selector,data,types[type],one);return elem}if(null==data&&null==fn?(fn=selector,data=selector=void 0):null==fn&&("string"==typeof selector?(fn=data,data=void 0):(fn=data,data=selector,selector=void 0)),fn===!1)fn=returnFalse;else if(!fn)return elem;return 1===one&&(origFn=fn,fn=function(event){return jQuery().off(event),origFn.apply(this,arguments)},fn.guid=origFn.guid||(origFn.guid=jQuery.guid++)),elem.each(function(){jQuery.event.add(this,types,fn,data,selector)})}function manipulationTarget(elem,content){return nodeName(elem,"table")&&nodeName(11!==content.nodeType?content:content.firstChild,"tr")?jQuery(elem).children("tbody")[0]||elem:elem}function disableScript(elem){return elem.type=(null!==elem.getAttribute("type"))+"/"+elem.type,elem}function restoreScript(elem){return"true/"===(elem.type||"").slice(0,5)?elem.type=elem.type.slice(5):elem.removeAttribute("type"),elem}function cloneCopyEvent(src,dest){var i,l,type,pdataOld,pdataCur,udataOld,udataCur,events;if(1===dest.nodeType){if(dataPriv.hasData(src)&&(pdataOld=dataPriv.access(src),pdataCur=dataPriv.set(dest,pdataOld),events=pdataOld.events)){delete pdataCur.handle,pdataCur.events={};for(type in events)for(i=0,l=events[type].length;i1&&"string"==typeof value&&!support.checkClone&&rchecked.test(value))return collection.each(function(index){var self=collection.eq(index);valueIsFunction&&(args[0]=value.call(this,index,self.html())),domManip(self,args,callback,ignored)});if(l&&(fragment=buildFragment(args,collection[0].ownerDocument,!1,collection,ignored),first=fragment.firstChild,1===fragment.childNodes.length&&(fragment=first),first||ignored)){for(scripts=jQuery.map(getAll(fragment,"script"),disableScript),hasScripts=scripts.length;i=0&&(delta+=Math.max(0,Math.ceil(elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)]-computedVal-delta-extra-.5))),delta}function getWidthOrHeight(elem,dimension,extra){var styles=getStyles(elem),val=curCSS(elem,dimension,styles),isBorderBox="border-box"===jQuery.css(elem,"boxSizing",!1,styles),valueIsBorderBox=isBorderBox;if(rnumnonpx.test(val)){if(!extra)return val;val="auto"}return valueIsBorderBox=valueIsBorderBox&&(support.boxSizingReliable()||val===elem.style[dimension]),("auto"===val||!parseFloat(val)&&"inline"===jQuery.css(elem,"display",!1,styles))&&(val=elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)],valueIsBorderBox=!0),val=parseFloat(val)||0,val+boxModelAdjustment(elem,dimension,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles,val)+"px"}function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing)}function schedule(){inProgress&&(document.hidden===!1&&window.requestAnimationFrame?window.requestAnimationFrame(schedule):window.setTimeout(schedule,jQuery.fx.interval),jQuery.fx.tick())}function createFxNow(){return window.setTimeout(function(){fxNow=void 0}),fxNow=Date.now()}function genFx(type,includeWidth){var which,i=0,attrs={height:type};for(includeWidth=includeWidth?1:0;i<4;i+=2-includeWidth)which=cssExpand[i],attrs["margin"+which]=attrs["padding"+which]=type;return includeWidth&&(attrs.opacity=attrs.width=type),attrs}function createTween(value,prop,animation){for(var tween,collection=(Animation.tweeners[prop]||[]).concat(Animation.tweeners["*"]),index=0,length=collection.length;index=0&&jExpr.cacheLength&&delete cache[keys.shift()],cache[key+" "]=value}var keys=[];return cache}function markFunction(fn){return fn[expando]=!0,fn}function assert(fn){var el=document.createElement("fieldset");try{return!!fn(el)}catch(e){return!1}finally{el.parentNode&&el.parentNode.removeChild(el),el=null}}function addHandle(attrs,handler){for(var arr=attrs.split("|"),i=arr.length;i--;)Expr.attrHandle[arr[i]]=handler}function siblingCheck(a,b){var cur=b&&a,diff=cur&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(diff)return diff;if(cur)for(;cur=cur.nextSibling;)if(cur===b)return-1;return a?1:-1}function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&elem.type===type}}function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return("input"===name||"button"===name)&&elem.type===type}}function createDisabledPseudo(disabled){return function(elem){return"form"in elem?elem.parentNode&&elem.disabled===!1?"label"in elem?"label"in elem.parentNode?elem.parentNode.disabled===disabled:elem.disabled===disabled:elem.isDisabled===disabled||elem.isDisabled!==!disabled&&disabledAncestor(elem)===disabled:elem.disabled===disabled:"label"in elem&&elem.disabled===disabled}}function createPositionalPseudo(fn){return markFunction(function(argument){return argument=+argument,markFunction(function(seed,matches){for(var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;i--;)seed[j=matchIndexes[i]]&&(seed[j]=!(matches[j]=seed[j]))})})}function testContext(context){return context&&"undefined"!=typeof context.getElementsByTagName&&context}function setFilters(){}function toSelector(tokens){for(var i=0,len=tokens.length,selector="";i1?function(elem,context,xml){for(var i=matchers.length;i--;)if(!matchers[i](elem,context,xml))return!1;return!0}:matchers[0]}function multipleContexts(selector,contexts,results){for(var i=0,len=contexts.length;i-1&&(seed[temp]=!(results[temp]=elem))}}else matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut),postFinder?postFinder(null,results,matcherOut,xml):push.apply(results,matcherOut)})}function matcherFromTokens(tokens){for(var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext},implicitRelative,!0),matchAnyContext=addCombinator(function(elem){return indexOf(checkContext,elem)>-1},implicitRelative,!0),matchers=[function(elem,context,xml){var ret=!leadingRelative&&(xml||context!==outermostContext)||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml));return checkContext=null,ret}];i1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:" "===tokens[i-2].type?"*":""})).replace(rtrim,"$1"),matcher,i0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,outermost){var elem,j,matcher,matchedCount=0,i="0",unmatched=seed&&[],setMatched=[],contextBackup=outermostContext,elems=seed||byElement&&Expr.find.TAG("*",outermost),dirrunsUnique=dirruns+=null==contextBackup?1:Math.random()||.1,len=elems.length;for(outermost&&(outermostContext=context===document||context||outermost);i!==len&&null!=(elem=elems[i]);i++){if(byElement&&elem){for(j=0,context||elem.ownerDocument===document||(setDocument(elem),xml=!documentIsHTML);matcher=elementMatchers[j++];)if(matcher(elem,context||document,xml)){results.push(elem);break}outermost&&(dirruns=dirrunsUnique)}bySet&&((elem=!matcher&&elem)&&matchedCount--,seed&&unmatched.push(elem))}if(matchedCount+=i,bySet&&i!==matchedCount){for(j=0;matcher=setMatchers[j++];)matcher(unmatched,setMatched,context,xml);if(seed){if(matchedCount>0)for(;i--;)unmatched[i]||setMatched[i]||(setMatched[i]=pop.call(results));setMatched=condense(setMatched)}push.apply(results,setMatched),outermost&&!seed&&setMatched.length>0&&matchedCount+setMatchers.length>1&&Sizzle.uniqueSort(results)}return outermost&&(dirruns=dirrunsUnique,outermostContext=contextBackup),unmatched};return bySet?markFunction(superMatcher):superMatcher}var i,support,Expr,getText,isXML,tokenize,compile,select,outermostContext,sortInput,hasDuplicate,setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+1*new Date,preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),sortOrder=function(a,b){return a===b&&(hasDuplicate=!0),0},hasOwn={}.hasOwnProperty,arr=[],pop=arr.pop,push_native=arr.push,push=arr.push,slice=arr.slice,indexOf=function(list,elem){for(var i=0,len=list.length;i+~]|"+whitespace+")"+whitespace+"*"),rattributeQuotes=new RegExp("="+whitespace+"*([^\\]'\"]*?)"+whitespace+"*\\]","g"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={ID:new RegExp("^#("+identifier+")"),CLASS:new RegExp("^\\.("+identifier+")"),TAG:new RegExp("^("+identifier+"|[*])"),ATTR:new RegExp("^"+attributes),PSEUDO:new RegExp("^"+pseudos),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),bool:new RegExp("^(?:"+booleans+")$","i"),needsContext:new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,runescape=new RegExp("\\\\([\\da-f]{1,6}"+whitespace+"?|("+whitespace+")|.)","ig"),funescape=function(_,escaped,escapedWhitespace){var high="0x"+escaped-65536;return high!==high||escapedWhitespace?escaped:high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,1023&high|56320)},rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,fcssescape=function(ch,asCodePoint){return asCodePoint?"\0"===ch?"�":ch.slice(0,-1)+"\\"+ch.charCodeAt(ch.length-1).toString(16)+" ":"\\"+ch},unloadHandler=function(){setDocument()},disabledAncestor=addCombinator(function(elem){return elem.disabled===!0&&("form"in elem||"label"in elem)},{dir:"parentNode",next:"legend"});try{push.apply(arr=slice.call(preferredDoc.childNodes),preferredDoc.childNodes),arr[preferredDoc.childNodes.length].nodeType}catch(e){push={apply:arr.length?function(target,els){push_native.apply(target,slice.call(els))}:function(target,els){for(var j=target.length,i=0;target[j++]=els[i++];);target.length=j-1}}}support=Sizzle.support={},isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return!!documentElement&&"HTML"!==documentElement.nodeName},setDocument=Sizzle.setDocument=function(node){var hasCompare,subWindow,doc=node?node.ownerDocument||node:preferredDoc;return doc!==document&&9===doc.nodeType&&doc.documentElement?(document=doc,docElem=document.documentElement,documentIsHTML=!isXML(document),preferredDoc!==document&&(subWindow=document.defaultView)&&subWindow.top!==subWindow&&(subWindow.addEventListener?subWindow.addEventListener("unload",unloadHandler,!1):subWindow.attachEvent&&subWindow.attachEvent("onunload",unloadHandler)),support.attributes=assert(function(el){return el.className="i",!el.getAttribute("className")}),support.getElementsByTagName=assert(function(el){return el.appendChild(document.createComment("")),!el.getElementsByTagName("*").length}),support.getElementsByClassName=rnative.test(document.getElementsByClassName),support.getById=assert(function(el){return docElem.appendChild(el).id=expando,!document.getElementsByName||!document.getElementsByName(expando).length}),support.getById?(Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId}},Expr.find.ID=function(id,context){if("undefined"!=typeof context.getElementById&&documentIsHTML){var elem=context.getElementById(id);return elem?[elem]:[]}}):(Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node="undefined"!=typeof elem.getAttributeNode&&elem.getAttributeNode("id");return node&&node.value===attrId}},Expr.find.ID=function(id,context){if("undefined"!=typeof context.getElementById&&documentIsHTML){var node,i,elems,elem=context.getElementById(id);if(elem){if(node=elem.getAttributeNode("id"),node&&node.value===id)return[elem];for(elems=context.getElementsByName(id),i=0;elem=elems[i++];)if(node=elem.getAttributeNode("id"),node&&node.value===id)return[elem]}return[]}}),Expr.find.TAG=support.getElementsByTagName?function(tag,context){return"undefined"!=typeof context.getElementsByTagName?context.getElementsByTagName(tag):support.qsa?context.querySelectorAll(tag):void 0}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if("*"===tag){for(;elem=results[i++];)1===elem.nodeType&&tmp.push(elem);return tmp}return results},Expr.find.CLASS=support.getElementsByClassName&&function(className,context){if("undefined"!=typeof context.getElementsByClassName&&documentIsHTML)return context.getElementsByClassName(className)},rbuggyMatches=[],rbuggyQSA=[],(support.qsa=rnative.test(document.querySelectorAll))&&(assert(function(el){docElem.appendChild(el).innerHTML="",el.querySelectorAll("[msallowcapture^='']").length&&rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")"),el.querySelectorAll("[selected]").length||rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")"),el.querySelectorAll("[id~="+expando+"-]").length||rbuggyQSA.push("~="),el.querySelectorAll(":checked").length||rbuggyQSA.push(":checked"),el.querySelectorAll("a#"+expando+"+*").length||rbuggyQSA.push(".#.+[+~]")}),assert(function(el){el.innerHTML="";var input=document.createElement("input");input.setAttribute("type","hidden"),el.appendChild(input).setAttribute("name","D"),el.querySelectorAll("[name=d]").length&&rbuggyQSA.push("name"+whitespace+"*[*^$|!~]?="),2!==el.querySelectorAll(":enabled").length&&rbuggyQSA.push(":enabled",":disabled"),docElem.appendChild(el).disabled=!0,2!==el.querySelectorAll(":disabled").length&&rbuggyQSA.push(":enabled",":disabled"),el.querySelectorAll("*,:x"),rbuggyQSA.push(",.*:")})),(support.matchesSelector=rnative.test(matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector))&&assert(function(el){support.disconnectedMatch=matches.call(el,"*"),matches.call(el,"[s!='']:x"),rbuggyMatches.push("!=",pseudos)}),rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|")),rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|")),hasCompare=rnative.test(docElem.compareDocumentPosition),contains=hasCompare||rnative.test(docElem.contains)?function(a,b){var adown=9===a.nodeType?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!(!bup||1!==bup.nodeType||!(adown.contains?adown.contains(bup):a.compareDocumentPosition&&16&a.compareDocumentPosition(bup)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},sortOrder=hasCompare?function(a,b){if(a===b)return hasDuplicate=!0,0;var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;return compare?compare:(compare=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&compare||!support.sortDetached&&b.compareDocumentPosition(a)===compare?a===document||a.ownerDocument===preferredDoc&&contains(preferredDoc,a)?-1:b===document||b.ownerDocument===preferredDoc&&contains(preferredDoc,b)?1:sortInput?indexOf(sortInput,a)-indexOf(sortInput,b):0:4&compare?-1:1)}:function(a,b){if(a===b)return hasDuplicate=!0,0;var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(!aup||!bup)return a===document?-1:b===document?1:aup?-1:bup?1:sortInput?indexOf(sortInput,a)-indexOf(sortInput,b):0;if(aup===bup)return siblingCheck(a,b);for(cur=a;cur=cur.parentNode;)ap.unshift(cur);for(cur=b;cur=cur.parentNode;)bp.unshift(cur);for(;ap[i]===bp[i];)i++;return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0},document):document},Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements)},Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document&&setDocument(elem),expr=expr.replace(rattributeQuotes,"='$1']"),support.matchesSelector&&documentIsHTML&&!compilerCache[expr+" "]&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr)))try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&11!==elem.document.nodeType)return ret}catch(e){}return Sizzle(expr,document,null,[elem]).length>0},Sizzle.contains=function(context,elem){return(context.ownerDocument||context)!==document&&setDocument(context),contains(context,elem)},Sizzle.attr=function(elem,name){(elem.ownerDocument||elem)!==document&&setDocument(elem);var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):void 0;return void 0!==val?val:support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null},Sizzle.escape=function(sel){return(sel+"").replace(rcssescape,fcssescape)},Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg)},Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;if(hasDuplicate=!support.detectDuplicates,sortInput=!support.sortStable&&results.slice(0),results.sort(sortOrder),hasDuplicate){for(;elem=results[i++];)elem===results[i]&&(j=duplicates.push(i));for(;j--;)results.splice(duplicates[j],1)}return sortInput=null,results},getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(nodeType){if(1===nodeType||9===nodeType||11===nodeType){if("string"==typeof elem.textContent)return elem.textContent;for(elem=elem.firstChild;elem;elem=elem.nextSibling)ret+=getText(elem)}else if(3===nodeType||4===nodeType)return elem.nodeValue}else for(;node=elem[i++];)ret+=getText(node);return ret},Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(match){return match[1]=match[1].replace(runescape,funescape),match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape),"~="===match[2]&&(match[3]=" "+match[3]+" "),match.slice(0,4)},CHILD:function(match){return match[1]=match[1].toLowerCase(),"nth"===match[1].slice(0,3)?(match[3]||Sizzle.error(match[0]),match[4]=+(match[4]?match[5]+(match[6]||1):2*("even"===match[3]||"odd"===match[3])),match[5]=+(match[7]+match[8]||"odd"===match[3])):match[3]&&Sizzle.error(match[0]),match},PSEUDO:function(match){var excess,unquoted=!match[6]&&match[2];return matchExpr.CHILD.test(match[0])?null:(match[3]?match[2]=match[4]||match[5]||"":unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,!0))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)&&(match[0]=match[0].slice(0,excess),match[2]=unquoted.slice(0,excess)),match.slice(0,3))}},filter:{TAG:function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return"*"===nodeNameSelector?function(){return!0}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName}},CLASS:function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test("string"==typeof elem.className&&elem.className||"undefined"!=typeof elem.getAttribute&&elem.getAttribute("class")||"")})},ATTR:function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);return null==result?"!="===operator:!operator||(result+="","="===operator?result===check:"!="===operator?result!==check:"^="===operator?check&&0===result.indexOf(check):"*="===operator?check&&result.indexOf(check)>-1:"$="===operator?check&&result.slice(-check.length)===check:"~="===operator?(" "+result.replace(rwhitespace," ")+" ").indexOf(check)>-1:"|="===operator&&(result===check||result.slice(0,check.length+1)===check+"-"))}},CHILD:function(type,what,argument,first,last){var simple="nth"!==type.slice(0,3),forward="last"!==type.slice(-4),ofType="of-type"===what;return 1===first&&0===last?function(elem){return!!elem.parentNode}:function(elem,context,xml){var cache,uniqueCache,outerCache,node,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType,diff=!1;if(parent){if(simple){for(;dir;){for(node=elem;node=node[dir];)if(ofType?node.nodeName.toLowerCase()===name:1===node.nodeType)return!1;start=dir="only"===type&&!start&&"nextSibling"}return!0}if(start=[forward?parent.firstChild:parent.lastChild],forward&&useCache){for(node=parent,outerCache=node[expando]||(node[expando]={}),uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={}),cache=uniqueCache[type]||[],nodeIndex=cache[0]===dirruns&&cache[1],diff=nodeIndex&&cache[2],node=nodeIndex&&parent.childNodes[nodeIndex];node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop();)if(1===node.nodeType&&++diff&&node===elem){uniqueCache[type]=[dirruns,nodeIndex,diff];break}}else if(useCache&&(node=elem,outerCache=node[expando]||(node[expando]={}),uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={}),cache=uniqueCache[type]||[],nodeIndex=cache[0]===dirruns&&cache[1],diff=nodeIndex),diff===!1)for(;(node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())&&((ofType?node.nodeName.toLowerCase()!==name:1!==node.nodeType)||!++diff||(useCache&&(outerCache=node[expando]||(node[expando]={}),uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={}),uniqueCache[type]=[dirruns,diff]),node!==elem)););return diff-=last,diff===first||diff%first===0&&diff/first>=0}}},PSEUDO:function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);return fn[expando]?fn(argument):fn.length>1?(args=[pseudo,pseudo,"",argument],Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){for(var idx,matched=fn(seed,argument),i=matched.length;i--;)idx=indexOf(seed,matched[i]),seed[idx]=!(matches[idx]=matched[i])}):function(elem){return fn(elem,0,args)}):fn}},pseudos:{not:markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){for(var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;i--;)(elem=unmatched[i])&&(seed[i]=!(matches[i]=elem))}):function(elem,context,xml){return input[0]=elem,matcher(input,null,xml,results),input[0]=null,!results.pop()}}),has:markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0}}),contains:markFunction(function(text){return text=text.replace(runescape,funescape),function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1}}),lang:markFunction(function(lang){return ridentifier.test(lang||"")||Sizzle.error("unsupported lang: "+lang),lang=lang.replace(runescape,funescape).toLowerCase(),function(elem){var elemLang;do if(elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))return elemLang=elemLang.toLowerCase(),elemLang===lang||0===elemLang.indexOf(lang+"-");while((elem=elem.parentNode)&&1===elem.nodeType);return!1}}),target:function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id},root:function(elem){return elem===docElem},focus:function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex)},enabled:createDisabledPseudo(!1),disabled:createDisabledPseudo(!0),checked:function(elem){var nodeName=elem.nodeName.toLowerCase();return"input"===nodeName&&!!elem.checked||"option"===nodeName&&!!elem.selected},selected:function(elem){return elem.parentNode&&elem.parentNode.selectedIndex,elem.selected===!0},empty:function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling)if(elem.nodeType<6)return!1;return!0},parent:function(elem){return!Expr.pseudos.empty(elem)},header:function(elem){return rheader.test(elem.nodeName)},input:function(elem){return rinputs.test(elem.nodeName)},button:function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&"button"===elem.type||"button"===name},text:function(elem){var attr;return"input"===elem.nodeName.toLowerCase()&&"text"===elem.type&&(null==(attr=elem.getAttribute("type"))||"text"===attr.toLowerCase())},first:createPositionalPseudo(function(){return[0]}),last:createPositionalPseudo(function(matchIndexes,length){return[length-1]}),eq:createPositionalPseudo(function(matchIndexes,length,argument){return[argument<0?argument+length:argument]}),even:createPositionalPseudo(function(matchIndexes,length){for(var i=0;i=0;)matchIndexes.push(i);return matchIndexes}),gt:createPositionalPseudo(function(matchIndexes,length,argument){for(var i=argument<0?argument+length:argument;++i2&&"ID"===(token=tokens[0]).type&&9===context.nodeType&&documentIsHTML&&Expr.relative[tokens[1].type]){if(context=(Expr.find.ID(token.matches[0].replace(runescape,funescape),context)||[])[0],!context)return results;compiled&&(context=context.parentNode),selector=selector.slice(tokens.shift().value.length)}for(i=matchExpr.needsContext.test(selector)?0:tokens.length;i--&&(token=tokens[i],!Expr.relative[type=token.type]);)if((find=Expr.find[type])&&(seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&testContext(context.parentNode)||context))){if(tokens.splice(i,1),selector=seed.length&&toSelector(tokens),!selector)return push.apply(results,seed),results;break}}return(compiled||compile(selector,match))(seed,context,!documentIsHTML,results,!context||rsibling.test(selector)&&testContext(context.parentNode)||context),results},support.sortStable=expando.split("").sort(sortOrder).join("")===expando,support.detectDuplicates=!!hasDuplicate,setDocument(),support.sortDetached=assert(function(el){return 1&el.compareDocumentPosition(document.createElement("fieldset"))}),assert(function(el){return el.innerHTML="","#"===el.firstChild.getAttribute("href")})||addHandle("type|href|height|width",function(elem,name,isXML){if(!isXML)return elem.getAttribute(name,"type"===name.toLowerCase()?1:2)}),support.attributes&&assert(function(el){return el.innerHTML="",el.firstChild.setAttribute("value",""),""===el.firstChild.getAttribute("value")})||addHandle("value",function(elem,name,isXML){if(!isXML&&"input"===elem.nodeName.toLowerCase())return elem.defaultValue}),assert(function(el){return null==el.getAttribute("disabled")})||addHandle(booleans,function(elem,name,isXML){var val;if(!isXML)return elem[name]===!0?name.toLowerCase():(val=elem.getAttributeNode(name))&&val.specified?val.value:null}),Sizzle}(window);jQuery.find=Sizzle,jQuery.expr=Sizzle.selectors,jQuery.expr[":"]=jQuery.expr.pseudos,jQuery.uniqueSort=jQuery.unique=Sizzle.uniqueSort,jQuery.text=Sizzle.getText,jQuery.isXMLDoc=Sizzle.isXML,jQuery.contains=Sizzle.contains,jQuery.escapeSelector=Sizzle.escape;var dir=function(elem,dir,until){for(var matched=[],truncate=void 0!==until;(elem=elem[dir])&&9!==elem.nodeType;)if(1===elem.nodeType){if(truncate&&jQuery(elem).is(until))break;matched.push(elem)}return matched},siblings=function(n,elem){for(var matched=[];n;n=n.nextSibling)1===n.nodeType&&n!==elem&&matched.push(n);return matched},rneedsContext=jQuery.expr.match.needsContext,rsingleTag=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;jQuery.filter=function(expr,elems,not){var elem=elems[0];return not&&(expr=":not("+expr+")"),1===elems.length&&1===elem.nodeType?jQuery.find.matchesSelector(elem,expr)?[elem]:[]:jQuery.find.matches(expr,jQuery.grep(elems,function(elem){return 1===elem.nodeType}))},jQuery.fn.extend({find:function(selector){var i,ret,len=this.length,self=this;if("string"!=typeof selector)return this.pushStack(jQuery(selector).filter(function(){for(i=0;i1?jQuery.uniqueSort(ret):ret},filter:function(selector){return this.pushStack(winnow(this,selector||[],!1))},not:function(selector){return this.pushStack(winnow(this,selector||[],!0))},is:function(selector){return!!winnow(this,"string"==typeof selector&&rneedsContext.test(selector)?jQuery(selector):selector||[],!1).length}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,init=jQuery.fn.init=function(selector,context,root){var match,elem;if(!selector)return this;if(root=root||rootjQuery,"string"==typeof selector){if(match="<"===selector[0]&&">"===selector[selector.length-1]&&selector.length>=3?[null,selector,null]:rquickExpr.exec(selector),!match||!match[1]&&context)return!context||context.jquery?(context||root).find(selector):this.constructor(context).find(selector);if(match[1]){if(context=context instanceof jQuery?context[0]:context,jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,!0)),rsingleTag.test(match[1])&&jQuery.isPlainObject(context))for(match in context)isFunction(this[match])?this[match](context[match]):this.attr(match,context[match]);return this}return elem=document.getElementById(match[2]),elem&&(this[0]=elem,this.length=1),this}return selector.nodeType?(this[0]=selector,this.length=1,this):isFunction(selector)?void 0!==root.ready?root.ready(selector):selector(jQuery):jQuery.makeArray(selector,this)};init.prototype=jQuery.fn,rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:!0,contents:!0,next:!0,prev:!0};jQuery.fn.extend({has:function(target){var targets=jQuery(target,this),l=targets.length;return this.filter(function(){for(var i=0;i-1:1===cur.nodeType&&jQuery.find.matchesSelector(cur,selectors))){matched.push(cur);break}return this.pushStack(matched.length>1?jQuery.uniqueSort(matched):matched)},index:function(elem){return elem?"string"==typeof elem?indexOf.call(jQuery(elem),this[0]):indexOf.call(this,elem.jquery?elem[0]:elem):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(selector,context){return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(),jQuery(selector,context))))},addBack:function(selector){return this.add(null==selector?this.prevObject:this.prevObject.filter(selector))}}),jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&11!==parent.nodeType?parent:null},parents:function(elem){return dir(elem,"parentNode")},parentsUntil:function(elem,i,until){return dir(elem,"parentNode",until)},next:function(elem){return sibling(elem,"nextSibling")},prev:function(elem){return sibling(elem,"previousSibling")},nextAll:function(elem){return dir(elem,"nextSibling")},prevAll:function(elem){return dir(elem,"previousSibling")},nextUntil:function(elem,i,until){return dir(elem,"nextSibling",until)},prevUntil:function(elem,i,until){return dir(elem,"previousSibling",until)},siblings:function(elem){return siblings((elem.parentNode||{}).firstChild,elem)},children:function(elem){return siblings(elem.firstChild)},contents:function(elem){return nodeName(elem,"iframe")?elem.contentDocument:(nodeName(elem,"template")&&(elem=elem.content||elem),jQuery.merge([],elem.childNodes))}},function(name,fn){jQuery.fn[name]=function(until,selector){var matched=jQuery.map(this,fn,until);return"Until"!==name.slice(-5)&&(selector=until),selector&&"string"==typeof selector&&(matched=jQuery.filter(selector,matched)),this.length>1&&(guaranteedUnique[name]||jQuery.uniqueSort(matched),rparentsprev.test(name)&&matched.reverse()),this.pushStack(matched)}});var rnothtmlwhite=/[^\x20\t\r\n\f]+/g;jQuery.Callbacks=function(options){options="string"==typeof options?createOptions(options):jQuery.extend({},options);var firing,memory,fired,locked,list=[],queue=[],firingIndex=-1,fire=function(){for(locked=locked||options.once,fired=firing=!0;queue.length;firingIndex=-1)for(memory=queue.shift();++firingIndex-1;)list.splice(index,1),index<=firingIndex&&firingIndex--}),this},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:list.length>0},empty:function(){return list&&(list=[]),this},disable:function(){return locked=queue=[],list=memory="",this},disabled:function(){return!list},lock:function(){ -return locked=queue=[],memory||firing||(list=memory=""),this},locked:function(){return!!locked},fireWith:function(context,args){return locked||(args=args||[],args=[context,args.slice?args.slice():args],queue.push(args),firing||fire()),this},fire:function(){return self.fireWith(this,arguments),this},fired:function(){return!!fired}};return self},jQuery.extend({Deferred:function(func){var tuples=[["notify","progress",jQuery.Callbacks("memory"),jQuery.Callbacks("memory"),2],["resolve","done",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),0,"resolved"],["reject","fail",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),1,"rejected"]],state="pending",promise={state:function(){return state},always:function(){return deferred.done(arguments).fail(arguments),this},catch:function(fn){return promise.then(null,fn)},pipe:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(i,tuple){var fn=isFunction(fns[tuple[4]])&&fns[tuple[4]];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);returned&&isFunction(returned.promise)?returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject):newDefer[tuple[0]+"With"](this,fn?[returned]:arguments)})}),fns=null}).promise()},then:function(onFulfilled,onRejected,onProgress){function resolve(depth,deferred,handler,special){return function(){var that=this,args=arguments,mightThrow=function(){var returned,then;if(!(depth=maxDepth&&(handler!==Thrower&&(that=void 0,args=[e]),deferred.rejectWith(that,args))}};depth?process():(jQuery.Deferred.getStackHook&&(process.stackTrace=jQuery.Deferred.getStackHook()),window.setTimeout(process))}}var maxDepth=0;return jQuery.Deferred(function(newDefer){tuples[0][3].add(resolve(0,newDefer,isFunction(onProgress)?onProgress:Identity,newDefer.notifyWith)),tuples[1][3].add(resolve(0,newDefer,isFunction(onFulfilled)?onFulfilled:Identity)),tuples[2][3].add(resolve(0,newDefer,isFunction(onRejected)?onRejected:Thrower))}).promise()},promise:function(obj){return null!=obj?jQuery.extend(obj,promise):promise}},deferred={};return jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[5];promise[tuple[1]]=list.add,stateString&&list.add(function(){state=stateString},tuples[3-i][2].disable,tuples[3-i][3].disable,tuples[0][2].lock,tuples[0][3].lock),list.add(tuple[3].fire),deferred[tuple[0]]=function(){return deferred[tuple[0]+"With"](this===deferred?void 0:this,arguments),this},deferred[tuple[0]+"With"]=list.fireWith}),promise.promise(deferred),func&&func.call(deferred,deferred),deferred},when:function(singleValue){var remaining=arguments.length,i=remaining,resolveContexts=Array(i),resolveValues=slice.call(arguments),master=jQuery.Deferred(),updateFunc=function(i){return function(value){resolveContexts[i]=this,resolveValues[i]=arguments.length>1?slice.call(arguments):value,--remaining||master.resolveWith(resolveContexts,resolveValues)}};if(remaining<=1&&(adoptValue(singleValue,master.done(updateFunc(i)).resolve,master.reject,!remaining),"pending"===master.state()||isFunction(resolveValues[i]&&resolveValues[i].then)))return master.then();for(;i--;)adoptValue(resolveValues[i],updateFunc(i),master.reject);return master.promise()}});var rerrorNames=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;jQuery.Deferred.exceptionHook=function(error,stack){window.console&&window.console.warn&&error&&rerrorNames.test(error.name)&&window.console.warn("jQuery.Deferred exception: "+error.message,error.stack,stack)},jQuery.readyException=function(error){window.setTimeout(function(){throw error})};var readyList=jQuery.Deferred();jQuery.fn.ready=function(fn){return readyList.then(fn).catch(function(error){jQuery.readyException(error)}),this},jQuery.extend({isReady:!1,readyWait:1,ready:function(wait){(wait===!0?--jQuery.readyWait:jQuery.isReady)||(jQuery.isReady=!0,wait!==!0&&--jQuery.readyWait>0||readyList.resolveWith(document,[jQuery]))}}),jQuery.ready.then=readyList.then,"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(jQuery.ready):(document.addEventListener("DOMContentLoaded",completed),window.addEventListener("load",completed));var access=function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,len=elems.length,bulk=null==key;if("object"===toType(key)){chainable=!0;for(i in key)access(elems,fn,i,key[i],!0,emptyGet,raw)}else if(void 0!==value&&(chainable=!0,isFunction(value)||(raw=!0),bulk&&(raw?(fn.call(elems,value),fn=null):(bulk=fn,fn=function(elem,key,value){return bulk.call(jQuery(elem),value)})),fn))for(;i1,null,!0)},removeData:function(key){return this.each(function(){dataUser.remove(this,key)})}}),jQuery.extend({queue:function(elem,type,data){var queue;if(elem)return type=(type||"fx")+"queue",queue=dataPriv.get(elem,type),data&&(!queue||Array.isArray(data)?queue=dataPriv.access(elem,type,jQuery.makeArray(data)):queue.push(data)),queue||[]},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type)};"inprogress"===fn&&(fn=queue.shift(),startLength--),fn&&("fx"===type&&queue.unshift("inprogress"),delete hooks.stop,fn.call(elem,next,hooks)),!startLength&&hooks&&hooks.empty.fire()},_queueHooks:function(elem,type){var key=type+"queueHooks";return dataPriv.get(elem,key)||dataPriv.access(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){dataPriv.remove(elem,[type+"queue",key])})})}}),jQuery.fn.extend({queue:function(type,data){var setter=2;return"string"!=typeof type&&(data=type,type="fx",setter--),arguments.length\x20\t\r\n\f]+)/i,rscriptType=/^$|^module$|\/(?:java|ecma)script/i,wrapMap={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option,wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead,wrapMap.th=wrapMap.td;var rhtml=/<|&#?\w+;/;!function(){var fragment=document.createDocumentFragment(),div=fragment.appendChild(document.createElement("div")),input=document.createElement("input");input.setAttribute("type","radio"),input.setAttribute("checked","checked"),input.setAttribute("name","t"),div.appendChild(input),support.checkClone=div.cloneNode(!0).cloneNode(!0).lastChild.checked,div.innerHTML="",support.noCloneChecked=!!div.cloneNode(!0).lastChild.defaultValue}();var documentElement=document.documentElement,rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rtypenamespace=/^([^.]*)(?:\.(.+)|)/;jQuery.event={global:{},add:function(elem,types,handler,data,selector){var handleObjIn,eventHandle,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.get(elem);if(elemData)for(handler.handler&&(handleObjIn=handler,handler=handleObjIn.handler,selector=handleObjIn.selector),selector&&jQuery.find.matchesSelector(documentElement,selector),handler.guid||(handler.guid=jQuery.guid++),(events=elemData.events)||(events=elemData.events={}),(eventHandle=elemData.handle)||(eventHandle=elemData.handle=function(e){return"undefined"!=typeof jQuery&&jQuery.event.triggered!==e.type?jQuery.event.dispatch.apply(elem,arguments):void 0}),types=(types||"").match(rnothtmlwhite)||[""],t=types.length;t--;)tmp=rtypenamespace.exec(types[t])||[],type=origType=tmp[1],namespaces=(tmp[2]||"").split(".").sort(),type&&(special=jQuery.event.special[type]||{},type=(selector?special.delegateType:special.bindType)||type,special=jQuery.event.special[type]||{},handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn),(handlers=events[type])||(handlers=events[type]=[],handlers.delegateCount=0,special.setup&&special.setup.call(elem,data,namespaces,eventHandle)!==!1||elem.addEventListener&&elem.addEventListener(type,eventHandle)),special.add&&(special.add.call(elem,handleObj),handleObj.handler.guid||(handleObj.handler.guid=handler.guid)),selector?handlers.splice(handlers.delegateCount++,0,handleObj):handlers.push(handleObj),jQuery.event.global[type]=!0)},remove:function(elem,types,handler,selector,mappedTypes){var j,origCount,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.hasData(elem)&&dataPriv.get(elem);if(elemData&&(events=elemData.events)){for(types=(types||"").match(rnothtmlwhite)||[""],t=types.length;t--;)if(tmp=rtypenamespace.exec(types[t])||[],type=origType=tmp[1],namespaces=(tmp[2]||"").split(".").sort(),type){for(special=jQuery.event.special[type]||{},type=(selector?special.delegateType:special.bindType)||type,handlers=events[type]||[],tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"),origCount=j=handlers.length;j--;)handleObj=handlers[j],!mappedTypes&&origType!==handleObj.origType||handler&&handler.guid!==handleObj.guid||tmp&&!tmp.test(handleObj.namespace)||selector&&selector!==handleObj.selector&&("**"!==selector||!handleObj.selector)||(handlers.splice(j,1),handleObj.selector&&handlers.delegateCount--,special.remove&&special.remove.call(elem,handleObj));origCount&&!handlers.length&&(special.teardown&&special.teardown.call(elem,namespaces,elemData.handle)!==!1||jQuery.removeEvent(elem,type,elemData.handle),delete events[type])}else for(type in events)jQuery.event.remove(elem,type+types[t],handler,selector,!0);jQuery.isEmptyObject(events)&&dataPriv.remove(elem,"handle events")}},dispatch:function(nativeEvent){var i,j,ret,matched,handleObj,handlerQueue,event=jQuery.event.fix(nativeEvent),args=new Array(arguments.length),handlers=(dataPriv.get(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};for(args[0]=event,i=1;i=1))for(;cur!==this;cur=cur.parentNode||this)if(1===cur.nodeType&&("click"!==event.type||cur.disabled!==!0)){for(matchedHandlers=[],matchedSelectors={},i=0;i-1:jQuery.find(sel,this,null,[cur]).length),matchedSelectors[sel]&&matchedHandlers.push(handleObj);matchedHandlers.length&&handlerQueue.push({elem:cur,handlers:matchedHandlers})}return cur=this,delegateCount\x20\t\r\n\f]*)[^>]*)\/>/gi,rnoInnerhtml=/\s*$/g;jQuery.extend({htmlPrefilter:function(html){return html.replace(rxhtmlTag,"<$1>")},clone:function(elem,dataAndEvents,deepDataAndEvents){var i,l,srcElements,destElements,clone=elem.cloneNode(!0),inPage=jQuery.contains(elem.ownerDocument,elem);if(!(support.noCloneChecked||1!==elem.nodeType&&11!==elem.nodeType||jQuery.isXMLDoc(elem)))for(destElements=getAll(clone),srcElements=getAll(elem),i=0,l=srcElements.length;i0&&setGlobalEval(destElements,!inPage&&getAll(elem,"script")),clone},cleanData:function(elems){for(var data,elem,type,special=jQuery.event.special,i=0;void 0!==(elem=elems[i]);i++)if(acceptData(elem)){if(data=elem[dataPriv.expando]){if(data.events)for(type in data.events)special[type]?jQuery.event.remove(elem,type):jQuery.removeEvent(elem,type,data.handle);elem[dataPriv.expando]=void 0}elem[dataUser.expando]&&(elem[dataUser.expando]=void 0)}}}),jQuery.fn.extend({detach:function(selector){return remove(this,selector,!0)},remove:function(selector){return remove(this,selector)},text:function(value){return access(this,function(value){return void 0===value?jQuery.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=value)})},null,value,arguments.length)},append:function(){return domManip(this,arguments,function(elem){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var target=manipulationTarget(this,elem);target.appendChild(elem)}})},prepend:function(){return domManip(this,arguments,function(elem){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild)}})},before:function(){return domManip(this,arguments,function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this)})},after:function(){return domManip(this,arguments,function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this.nextSibling)})},empty:function(){for(var elem,i=0;null!=(elem=this[i]);i++)1===elem.nodeType&&(jQuery.cleanData(getAll(elem,!1)),elem.textContent="");return this},clone:function(dataAndEvents,deepDataAndEvents){return dataAndEvents=null!=dataAndEvents&&dataAndEvents,deepDataAndEvents=null==deepDataAndEvents?dataAndEvents:deepDataAndEvents,this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents)})},html:function(value){return access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(void 0===value&&1===elem.nodeType)return elem.innerHTML;if("string"==typeof value&&!rnoInnerhtml.test(value)&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=jQuery.htmlPrefilter(value);try{for(;i1)}}),jQuery.Tween=Tween,Tween.prototype={constructor:Tween,init:function(elem,options,prop,end,easing,unit){this.elem=elem,this.prop=prop,this.easing=easing||jQuery.easing._default,this.options=options,this.start=this.now=this.cur(),this.end=end,this.unit=unit||(jQuery.cssNumber[prop]?"":"px")},cur:function(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this):Tween.propHooks._default.get(this)},run:function(percent){var eased,hooks=Tween.propHooks[this.prop];return this.options.duration?this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration):this.pos=eased=percent,this.now=(this.end-this.start)*eased+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),hooks&&hooks.set?hooks.set(this):Tween.propHooks._default.set(this),this}},Tween.prototype.init.prototype=Tween.prototype,Tween.propHooks={_default:{get:function(tween){var result;return 1!==tween.elem.nodeType||null!=tween.elem[tween.prop]&&null==tween.elem.style[tween.prop]?tween.elem[tween.prop]:(result=jQuery.css(tween.elem,tween.prop,""),result&&"auto"!==result?result:0)},set:function(tween){jQuery.fx.step[tween.prop]?jQuery.fx.step[tween.prop](tween):1!==tween.elem.nodeType||null==tween.elem.style[jQuery.cssProps[tween.prop]]&&!jQuery.cssHooks[tween.prop]?tween.elem[tween.prop]=tween.now:jQuery.style(tween.elem,tween.prop,tween.now+tween.unit); -}}},Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){tween.elem.nodeType&&tween.elem.parentNode&&(tween.elem[tween.prop]=tween.now)}},jQuery.easing={linear:function(p){return p},swing:function(p){return.5-Math.cos(p*Math.PI)/2},_default:"swing"},jQuery.fx=Tween.prototype.init,jQuery.fx.step={};var fxNow,inProgress,rfxtypes=/^(?:toggle|show|hide)$/,rrun=/queueHooks$/;jQuery.Animation=jQuery.extend(Animation,{tweeners:{"*":[function(prop,value){var tween=this.createTween(prop,value);return adjustCSS(tween.elem,prop,rcssNum.exec(value),tween),tween}]},tweener:function(props,callback){isFunction(props)?(callback=props,props=["*"]):props=props.match(rnothtmlwhite);for(var prop,index=0,length=props.length;index1)},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name)})}}),jQuery.extend({attr:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(3!==nType&&8!==nType&&2!==nType)return"undefined"==typeof elem.getAttribute?jQuery.prop(elem,name,value):(1===nType&&jQuery.isXMLDoc(elem)||(hooks=jQuery.attrHooks[name.toLowerCase()]||(jQuery.expr.match.bool.test(name)?boolHook:void 0)),void 0!==value?null===value?void jQuery.removeAttr(elem,name):hooks&&"set"in hooks&&void 0!==(ret=hooks.set(elem,value,name))?ret:(elem.setAttribute(name,value+""),value):hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:(ret=jQuery.find.attr(elem,name),null==ret?void 0:ret))},attrHooks:{type:{set:function(elem,value){if(!support.radioValue&&"radio"===value&&nodeName(elem,"input")){var val=elem.value;return elem.setAttribute("type",value),val&&(elem.value=val),value}}}},removeAttr:function(elem,value){var name,i=0,attrNames=value&&value.match(rnothtmlwhite);if(attrNames&&1===elem.nodeType)for(;name=attrNames[i++];)elem.removeAttribute(name)}}),boolHook={set:function(elem,value,name){return value===!1?jQuery.removeAttr(elem,name):elem.setAttribute(name,name),name}},jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(i,name){var getter=attrHandle[name]||jQuery.find.attr;attrHandle[name]=function(elem,name,isXML){var ret,handle,lowercaseName=name.toLowerCase();return isXML||(handle=attrHandle[lowercaseName],attrHandle[lowercaseName]=ret,ret=null!=getter(elem,name,isXML)?lowercaseName:null,attrHandle[lowercaseName]=handle),ret}});var rfocusable=/^(?:input|select|textarea|button)$/i,rclickable=/^(?:a|area)$/i;jQuery.fn.extend({prop:function(name,value){return access(this,jQuery.prop,name,value,arguments.length>1)},removeProp:function(name){return this.each(function(){delete this[jQuery.propFix[name]||name]})}}),jQuery.extend({prop:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(3!==nType&&8!==nType&&2!==nType)return 1===nType&&jQuery.isXMLDoc(elem)||(name=jQuery.propFix[name]||name,hooks=jQuery.propHooks[name]),void 0!==value?hooks&&"set"in hooks&&void 0!==(ret=hooks.set(elem,value,name))?ret:elem[name]=value:hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:elem[name]},propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");return tabindex?parseInt(tabindex,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),support.optSelected||(jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;return parent&&parent.parentNode&&parent.parentNode.selectedIndex,null},set:function(elem){var parent=elem.parentNode;parent&&(parent.selectedIndex,parent.parentNode&&parent.parentNode.selectedIndex)}}),jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this}),jQuery.fn.extend({addClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(isFunction(value))return this.each(function(j){jQuery(this).addClass(value.call(this,j,getClass(this)))});if(classes=classesToArray(value),classes.length)for(;elem=this[i++];)if(curValue=getClass(elem),cur=1===elem.nodeType&&" "+stripAndCollapse(curValue)+" "){for(j=0;clazz=classes[j++];)cur.indexOf(" "+clazz+" ")<0&&(cur+=clazz+" ");finalValue=stripAndCollapse(cur),curValue!==finalValue&&elem.setAttribute("class",finalValue)}return this},removeClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(isFunction(value))return this.each(function(j){jQuery(this).removeClass(value.call(this,j,getClass(this)))});if(!arguments.length)return this.attr("class","");if(classes=classesToArray(value),classes.length)for(;elem=this[i++];)if(curValue=getClass(elem),cur=1===elem.nodeType&&" "+stripAndCollapse(curValue)+" "){for(j=0;clazz=classes[j++];)for(;cur.indexOf(" "+clazz+" ")>-1;)cur=cur.replace(" "+clazz+" "," ");finalValue=stripAndCollapse(cur),curValue!==finalValue&&elem.setAttribute("class",finalValue)}return this},toggleClass:function(value,stateVal){var type=typeof value,isValidValue="string"===type||Array.isArray(value);return"boolean"==typeof stateVal&&isValidValue?stateVal?this.addClass(value):this.removeClass(value):isFunction(value)?this.each(function(i){jQuery(this).toggleClass(value.call(this,i,getClass(this),stateVal),stateVal)}):this.each(function(){var className,i,self,classNames;if(isValidValue)for(i=0,self=jQuery(this),classNames=classesToArray(value);className=classNames[i++];)self.hasClass(className)?self.removeClass(className):self.addClass(className);else void 0!==value&&"boolean"!==type||(className=getClass(this),className&&dataPriv.set(this,"__className__",className),this.setAttribute&&this.setAttribute("class",className||value===!1?"":dataPriv.get(this,"__className__")||""))})},hasClass:function(selector){var className,elem,i=0;for(className=" "+selector+" ";elem=this[i++];)if(1===elem.nodeType&&(" "+stripAndCollapse(getClass(elem))+" ").indexOf(className)>-1)return!0;return!1}});var rreturn=/\r/g;jQuery.fn.extend({val:function(value){var hooks,ret,valueIsFunction,elem=this[0];{if(arguments.length)return valueIsFunction=isFunction(value),this.each(function(i){var val;1===this.nodeType&&(val=valueIsFunction?value.call(this,i,jQuery(this).val()):value,null==val?val="":"number"==typeof val?val+="":Array.isArray(val)&&(val=jQuery.map(val,function(value){return null==value?"":value+""})),hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()],hooks&&"set"in hooks&&void 0!==hooks.set(this,val,"value")||(this.value=val))});if(elem)return hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()],hooks&&"get"in hooks&&void 0!==(ret=hooks.get(elem,"value"))?ret:(ret=elem.value,"string"==typeof ret?ret.replace(rreturn,""):null==ret?"":ret)}}}),jQuery.extend({valHooks:{option:{get:function(elem){var val=jQuery.find.attr(elem,"value");return null!=val?val:stripAndCollapse(jQuery.text(elem))}},select:{get:function(elem){var value,option,i,options=elem.options,index=elem.selectedIndex,one="select-one"===elem.type,values=one?null:[],max=one?index+1:options.length;for(i=index<0?max:one?index:0;i-1)&&(optionSet=!0);return optionSet||(elem.selectedIndex=-1),values}}}}),jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(elem,value){if(Array.isArray(value))return elem.checked=jQuery.inArray(jQuery(elem).val(),value)>-1}},support.checkOn||(jQuery.valHooks[this].get=function(elem){return null===elem.getAttribute("value")?"on":elem.value})}),support.focusin="onfocusin"in window;var rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,stopPropagationCallback=function(e){e.stopPropagation()};jQuery.extend(jQuery.event,{trigger:function(event,data,elem,onlyHandlers){var i,cur,tmp,bubbleType,ontype,handle,special,lastElement,eventPath=[elem||document],type=hasOwn.call(event,"type")?event.type:event,namespaces=hasOwn.call(event,"namespace")?event.namespace.split("."):[];if(cur=lastElement=tmp=elem=elem||document,3!==elem.nodeType&&8!==elem.nodeType&&!rfocusMorph.test(type+jQuery.event.triggered)&&(type.indexOf(".")>-1&&(namespaces=type.split("."),type=namespaces.shift(),namespaces.sort()),ontype=type.indexOf(":")<0&&"on"+type,event=event[jQuery.expando]?event:new jQuery.Event(type,"object"==typeof event&&event),event.isTrigger=onlyHandlers?2:3,event.namespace=namespaces.join("."),event.rnamespace=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,event.result=void 0,event.target||(event.target=elem),data=null==data?[event]:jQuery.makeArray(data,[event]),special=jQuery.event.special[type]||{},onlyHandlers||!special.trigger||special.trigger.apply(elem,data)!==!1)){if(!onlyHandlers&&!special.noBubble&&!isWindow(elem)){for(bubbleType=special.delegateType||type,rfocusMorph.test(bubbleType+type)||(cur=cur.parentNode);cur;cur=cur.parentNode)eventPath.push(cur),tmp=cur;tmp===(elem.ownerDocument||document)&&eventPath.push(tmp.defaultView||tmp.parentWindow||window)}for(i=0;(cur=eventPath[i++])&&!event.isPropagationStopped();)lastElement=cur,event.type=i>1?bubbleType:special.bindType||type,handle=(dataPriv.get(cur,"events")||{})[event.type]&&dataPriv.get(cur,"handle"),handle&&handle.apply(cur,data),handle=ontype&&cur[ontype],handle&&handle.apply&&acceptData(cur)&&(event.result=handle.apply(cur,data),event.result===!1&&event.preventDefault());return event.type=type,onlyHandlers||event.isDefaultPrevented()||special._default&&special._default.apply(eventPath.pop(),data)!==!1||!acceptData(elem)||ontype&&isFunction(elem[type])&&!isWindow(elem)&&(tmp=elem[ontype],tmp&&(elem[ontype]=null),jQuery.event.triggered=type,event.isPropagationStopped()&&lastElement.addEventListener(type,stopPropagationCallback),elem[type](),event.isPropagationStopped()&&lastElement.removeEventListener(type,stopPropagationCallback),jQuery.event.triggered=void 0,tmp&&(elem[ontype]=tmp)),event.result}},simulate:function(type,elem,event){var e=jQuery.extend(new jQuery.Event,event,{type:type,isSimulated:!0});jQuery.event.trigger(e,null,elem)}}),jQuery.fn.extend({trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this)})},triggerHandler:function(type,data){var elem=this[0];if(elem)return jQuery.event.trigger(type,data,elem,!0)}}),support.focusin||jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){var handler=function(event){jQuery.event.simulate(fix,event.target,jQuery.event.fix(event))};jQuery.event.special[fix]={setup:function(){var doc=this.ownerDocument||this,attaches=dataPriv.access(doc,fix);attaches||doc.addEventListener(orig,handler,!0),dataPriv.access(doc,fix,(attaches||0)+1)},teardown:function(){var doc=this.ownerDocument||this,attaches=dataPriv.access(doc,fix)-1;attaches?dataPriv.access(doc,fix,attaches):(doc.removeEventListener(orig,handler,!0),dataPriv.remove(doc,fix))}}});var location=window.location,nonce=Date.now(),rquery=/\?/;jQuery.parseXML=function(data){var xml;if(!data||"string"!=typeof data)return null;try{xml=(new window.DOMParser).parseFromString(data,"text/xml")}catch(e){xml=void 0}return xml&&!xml.getElementsByTagName("parsererror").length||jQuery.error("Invalid XML: "+data),xml};var rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,valueOrFunction){var value=isFunction(valueOrFunction)?valueOrFunction():valueOrFunction;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(null==value?"":value)};if(Array.isArray(a)||a.jquery&&!jQuery.isPlainObject(a))jQuery.each(a,function(){add(this.name,this.value)});else for(prefix in a)buildParams(prefix,a[prefix],traditional,add);return s.join("&")},jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!rcheckableType.test(type))}).map(function(i,elem){var val=jQuery(this).val();return null==val?null:Array.isArray(val)?jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")}}):{name:elem.name,value:val.replace(rCRLF,"\r\n")}}).get()}});var r20=/%20/g,rhash=/#.*$/,rantiCache=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/gm,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,prefilters={},transports={},allTypes="*/".concat("*"),originAnchor=document.createElement("a");originAnchor.href=location.href,jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:location.href,type:"GET",isLocal:rlocalProtocol.test(location.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":jQuery.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target)},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;completed||(completed=!0,timeoutTimer&&window.clearTimeout(timeoutTimer),transport=void 0,responseHeadersString=headers||"",jqXHR.readyState=status>0?4:0,isSuccess=status>=200&&status<300||304===status,responses&&(response=ajaxHandleResponses(s,jqXHR,responses)),response=ajaxConvert(s,response,jqXHR,isSuccess),isSuccess?(s.ifModified&&(modified=jqXHR.getResponseHeader("Last-Modified"),modified&&(jQuery.lastModified[cacheURL]=modified),modified=jqXHR.getResponseHeader("etag"),modified&&(jQuery.etag[cacheURL]=modified)),204===status||"HEAD"===s.type?statusText="nocontent":304===status?statusText="notmodified":(statusText=response.state,success=response.data,error=response.error,isSuccess=!error)):(error=statusText,!status&&statusText||(statusText="error",status<0&&(status=0))),jqXHR.status=status,jqXHR.statusText=(nativeStatusText||statusText)+"",isSuccess?deferred.resolveWith(callbackContext,[success,statusText,jqXHR]):deferred.rejectWith(callbackContext,[jqXHR,statusText,error]),jqXHR.statusCode(statusCode),statusCode=void 0,fireGlobals&&globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]),completeDeferred.fireWith(callbackContext,[jqXHR,statusText]),fireGlobals&&(globalEventContext.trigger("ajaxComplete",[jqXHR,s]),--jQuery.active||jQuery.event.trigger("ajaxStop")))}"object"==typeof url&&(options=url,url=void 0),options=options||{};var transport,cacheURL,responseHeadersString,responseHeaders,timeoutTimer,urlAnchor,completed,fireGlobals,i,uncached,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(completed){if(!responseHeaders)for(responseHeaders={};match=rheaders.exec(responseHeadersString);)responseHeaders[match[1].toLowerCase()]=match[2];match=responseHeaders[key.toLowerCase()]}return null==match?null:match},getAllResponseHeaders:function(){return completed?responseHeadersString:null},setRequestHeader:function(name,value){return null==completed&&(name=requestHeadersNames[name.toLowerCase()]=requestHeadersNames[name.toLowerCase()]||name,requestHeaders[name]=value),this},overrideMimeType:function(type){return null==completed&&(s.mimeType=type),this},statusCode:function(map){var code;if(map)if(completed)jqXHR.always(map[jqXHR.status]);else for(code in map)statusCode[code]=[statusCode[code],map[code]];return this},abort:function(statusText){var finalText=statusText||strAbort;return transport&&transport.abort(finalText),done(0,finalText),this}};if(deferred.promise(jqXHR),s.url=((url||s.url||location.href)+"").replace(rprotocol,location.protocol+"//"),s.type=options.method||options.type||s.method||s.type,s.dataTypes=(s.dataType||"*").toLowerCase().match(rnothtmlwhite)||[""],null==s.crossDomain){urlAnchor=document.createElement("a");try{urlAnchor.href=s.url,urlAnchor.href=urlAnchor.href,s.crossDomain=originAnchor.protocol+"//"+originAnchor.host!=urlAnchor.protocol+"//"+urlAnchor.host}catch(e){s.crossDomain=!0}}if(s.data&&s.processData&&"string"!=typeof s.data&&(s.data=jQuery.param(s.data,s.traditional)),inspectPrefiltersOrTransports(prefilters,s,options,jqXHR),completed)return jqXHR;fireGlobals=jQuery.event&&s.global,fireGlobals&&0===jQuery.active++&&jQuery.event.trigger("ajaxStart"),s.type=s.type.toUpperCase(),s.hasContent=!rnoContent.test(s.type),cacheURL=s.url.replace(rhash,""),s.hasContent?s.data&&s.processData&&0===(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&(s.data=s.data.replace(r20,"+")):(uncached=s.url.slice(cacheURL.length),s.data&&(s.processData||"string"==typeof s.data)&&(cacheURL+=(rquery.test(cacheURL)?"&":"?")+s.data,delete s.data),s.cache===!1&&(cacheURL=cacheURL.replace(rantiCache,"$1"),uncached=(rquery.test(cacheURL)?"&":"?")+"_="+nonce++ +uncached),s.url=cacheURL+uncached),s.ifModified&&(jQuery.lastModified[cacheURL]&&jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]),jQuery.etag[cacheURL]&&jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL])),(s.data&&s.hasContent&&s.contentType!==!1||options.contentType)&&jqXHR.setRequestHeader("Content-Type",s.contentType),jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+("*"!==s.dataTypes[0]?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers)jqXHR.setRequestHeader(i,s.headers[i]);if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===!1||completed))return jqXHR.abort();if(strAbort="abort",completeDeferred.add(s.complete),jqXHR.done(s.success),jqXHR.fail(s.error),transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR)){if(jqXHR.readyState=1,fireGlobals&&globalEventContext.trigger("ajaxSend",[jqXHR,s]),completed)return jqXHR;s.async&&s.timeout>0&&(timeoutTimer=window.setTimeout(function(){jqXHR.abort("timeout")},s.timeout));try{completed=!1,transport.send(requestHeaders,done)}catch(e){if(completed)throw e;done(-1,e)}}else done(-1,"No Transport");return jqXHR},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},getScript:function(url,callback){return jQuery.get(url,void 0,callback,"script")}}),jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){return isFunction(data)&&(type=type||callback,callback=data,data=void 0),jQuery.ajax(jQuery.extend({url:url,type:method,dataType:type,data:data,success:callback},jQuery.isPlainObject(url)&&url))}}),jQuery._evalUrl=function(url){return jQuery.ajax({url:url,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},jQuery.fn.extend({wrapAll:function(html){var wrap;return this[0]&&(isFunction(html)&&(html=html.call(this[0])),wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&wrap.insertBefore(this[0]),wrap.map(function(){for(var elem=this;elem.firstElementChild;)elem=elem.firstElementChild;return elem}).append(this)),this},wrapInner:function(html){return isFunction(html)?this.each(function(i){jQuery(this).wrapInner(html.call(this,i))}):this.each(function(){var self=jQuery(this),contents=self.contents();contents.length?contents.wrapAll(html):self.append(html)})},wrap:function(html){var htmlIsFunction=isFunction(html);return this.each(function(i){jQuery(this).wrapAll(htmlIsFunction?html.call(this,i):html)})},unwrap:function(selector){return this.parent(selector).not("body").each(function(){jQuery(this).replaceWith(this.childNodes)}),this}}),jQuery.expr.pseudos.hidden=function(elem){return!jQuery.expr.pseudos.visible(elem)},jQuery.expr.pseudos.visible=function(elem){return!!(elem.offsetWidth||elem.offsetHeight||elem.getClientRects().length)},jQuery.ajaxSettings.xhr=function(){try{return new window.XMLHttpRequest}catch(e){}};var xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();support.cors=!!xhrSupported&&"withCredentials"in xhrSupported,support.ajax=xhrSupported=!!xhrSupported,jQuery.ajaxTransport(function(options){var callback,errorCallback;if(support.cors||xhrSupported&&!options.crossDomain)return{send:function(headers,complete){var i,xhr=options.xhr();if(xhr.open(options.type,options.url,options.async,options.username,options.password),options.xhrFields)for(i in options.xhrFields)xhr[i]=options.xhrFields[i];options.mimeType&&xhr.overrideMimeType&&xhr.overrideMimeType(options.mimeType),options.crossDomain||headers["X-Requested-With"]||(headers["X-Requested-With"]="XMLHttpRequest");for(i in headers)xhr.setRequestHeader(i,headers[i]);callback=function(type){return function(){callback&&(callback=errorCallback=xhr.onload=xhr.onerror=xhr.onabort=xhr.ontimeout=xhr.onreadystatechange=null,"abort"===type?xhr.abort():"error"===type?"number"!=typeof xhr.status?complete(0,"error"):complete(xhr.status,xhr.statusText):complete(xhrSuccessStatus[xhr.status]||xhr.status,xhr.statusText,"text"!==(xhr.responseType||"text")||"string"!=typeof xhr.responseText?{binary:xhr.response}:{text:xhr.responseText},xhr.getAllResponseHeaders()))}},xhr.onload=callback(),errorCallback=xhr.onerror=xhr.ontimeout=callback("error"),void 0!==xhr.onabort?xhr.onabort=errorCallback:xhr.onreadystatechange=function(){4===xhr.readyState&&window.setTimeout(function(){callback&&errorCallback()})},callback=callback("abort");try{xhr.send(options.hasContent&&options.data||null)}catch(e){if(callback)throw e}},abort:function(){callback&&callback()}}}),jQuery.ajaxPrefilter(function(s){s.crossDomain&&(s.contents.script=!1)}),jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(text){return jQuery.globalEval(text),text}}}),jQuery.ajaxPrefilter("script",function(s){void 0===s.cache&&(s.cache=!1),s.crossDomain&&(s.type="GET")}),jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,callback;return{send:function(_,complete){script=jQuery("-->",""));var wrapper=document.createElement("div");return wrapper.innerHTML=html,wrapper.querySelector('div[data-role="page"]')}function normalizeNewView(options){if(options.view.indexOf('data-role="page"')===-1)return options.view;var hasScript=options.view.indexOf("=pageContainerCount&&(pageIndex=0);var newViewInfo=normalizeNewView(options),newView=newViewInfo.elem,dependencies="string"==typeof newView?null:newView.getAttribute("data-require");dependencies=dependencies?dependencies.split(","):[];var isPluginpage=-1!==options.url.toLowerCase().indexOf("/configurationpage");return isPluginpage&&(dependencies.push("jqmpopup"),dependencies.push("legacy/dashboard"),dependencies.push("legacy/selectmenu"),dependencies.push("fnchecked")),(isPluginpage||newView.classList&&newView.classList.contains("type-interior"))&&(dependencies.push("scripts/notificationindicator"),dependencies.push("css!css/notifications.css"),dependencies.push("dashboardcss")),new Promise(function(resolve,reject){var dependencyNames=dependencies.join(",");require(dependencies,function(){var currentPage=allPages[pageIndex];currentPage&&triggerDestroy(currentPage);var view=newView;"string"==typeof view&&(view=document.createElement("div"),view.innerHTML=newView),view.classList.add("mainAnimatedPage"),currentPage?newViewInfo.hasScript&&window.$?(view=$(view).appendTo(mainAnimatedPages)[0],mainAnimatedPages.removeChild(currentPage)):mainAnimatedPages.replaceChild(view,currentPage):newViewInfo.hasScript&&window.$?view=$(view).appendTo(mainAnimatedPages)[0]:mainAnimatedPages.appendChild(view),"string"!=typeof newView&&enhanceNewView(dependencyNames,view),options.type&&view.setAttribute("data-type",options.type);var properties=[];options.fullscreen&&properties.push("fullscreen"),properties.length&&view.setAttribute("data-properties",properties.join(","));allPages[pageIndex]=view,setControllerClass(view,options).then(function(){onBeforeChange&&onBeforeChange(view,!1,options),beforeAnimate(allPages,pageIndex,selected),selectedPageIndex=pageIndex,currentUrls[pageIndex]=options.url,!options.cancel&&previousAnimatable&&afterAnimate(allPages,pageIndex),window.$&&($.mobile=$.mobile||{},$.mobile.activePage=view),resolve(view)})})})}}function enhanceNewView(dependencyNames,newView){-1!==dependencyNames.indexOf("jqm")&&window.$&&$(newView).trigger("create")}function replaceAll(str,find,replace){return str.split(find).join(replace)}function parseHtml(html,hasScript){hasScript&&(html=replaceAll(html,"\x3c!----\x3e","<\/script>"));var wrapper=document.createElement("div");return wrapper.innerHTML=html,wrapper.querySelector('div[data-role="page"]')}function normalizeNewView(options){if(-1===options.view.indexOf('data-role="page"'))return options.view;var hasScript=-1!==options.view.indexOf("'+l.Name+""})).val(config.UICulture),currentLanguage=config.UICulture,$("#chkUsageData",page).checked(config.EnableAnonymousUsageReporting),$("#chkRunAtStartup",page).checked(config.RunAtStartup),$("#chkRunWebAppAtStartup",page).checked(config.AutoRunWebApp||!1),systemInfo.CanSelfUpdate?page.querySelector(".fldAutomaticUpdates").classList.remove("hide"):page.querySelector(".fldAutomaticUpdates").classList.add("hide"),$("#chkEnableAutomaticServerUpdates",page).checked(config.EnableAutoUpdate),$("#chkEnableAutomaticRestart",page).checked(config.EnableAutomaticRestart),systemInfo.CanSelfRestart?page.querySelector("#fldEnableAutomaticRestart").classList.remove("hide"):page.querySelector("#fldEnableAutomaticRestart").classList.add("hide"),systemInfo.CanSelfRestart||systemInfo.CanSelfUpdate?$(".autoUpdatesContainer",page).removeClass("hide"):$(".autoUpdatesContainer",page).addClass("hide"),loading.hide()}function onSubmit(){loading.show();var form=this;$(form).parents(".page");return ApiClient.getServerConfiguration().then(function(config){config.UICulture=$("#selectLocalizationLanguage",form).val(),config.CachePath=form.querySelector("#txtCachePath").value;var requiresReload=!1;config.UICulture!==currentLanguage&&(requiresReload=!0),config.EnableAnonymousUsageReporting=$("#chkUsageData",form).checked(),config.RunAtStartup=$("#chkRunAtStartup",form).checked(),config.AutoRunWebApp=$("#chkRunWebAppAtStartup",form).checked(),config.EnableAutomaticRestart=$("#chkEnableAutomaticRestart",form).checked(),config.EnableAutoUpdate=$("#chkEnableAutomaticServerUpdates",form).checked(),ApiClient.updateServerConfiguration(config).then(function(){ApiClient.getNamedConfiguration(brandingConfigKey).then(function(brandingConfig){brandingConfig.LoginDisclaimer=form.querySelector("#txtLoginDisclaimer").value,brandingConfig.CustomCss=form.querySelector("#txtCustomCss").value,currentBrandingOptions&&brandingConfig.CustomCss!==currentBrandingOptions.CustomCss&&(requiresReload=!0),ApiClient.updateNamedConfiguration(brandingConfigKey,brandingConfig).then(function(){Dashboard.processServerConfigurationUpdateResult(),requiresReload&&!AppInfo.isNativeApp&&window.location.reload(!0)})})})}),!1}var currentBrandingOptions,currentLanguage,brandingConfigKey="branding";return function(view,params){$("#btnSelectCachePath",view).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({callback:function(path){path&&(view.querySelector("#txtCachePath").value=path),picker.close()},validateWriteable:!0,header:Globalize.translate("HeaderSelectServerCachePath"),instruction:Globalize.translate("HeaderSelectServerCachePathHelp")})})}),$(".dashboardGeneralForm",view).off("submit",onSubmit).on("submit",onSubmit),view.addEventListener("viewshow",function(){var promise1=ApiClient.getServerConfiguration(),promise2=ApiClient.getJSON(ApiClient.getUrl("Localization/Options")),promise3=ApiClient.getSystemInfo();Promise.all([promise1,promise2,promise3]).then(function(responses){loadPage(view,responses[0],responses[1],responses[2])}),ApiClient.getNamedConfiguration(brandingConfigKey).then(function(config){currentBrandingOptions=config,view.querySelector("#txtLoginDisclaimer").value=config.LoginDisclaimer||"",view.querySelector("#txtCustomCss").value=config.CustomCss||""})})}}); \ No newline at end of file +define(["jQuery","loading","fnchecked","emby-checkbox","emby-collapse","emby-textarea","emby-input","emby-select","emby-linkbutton"],function($,loading){"use strict";function loadPage(page,config,languageOptions,systemInfo){-1!==systemInfo.OperatingSystem.toLowerCase().indexOf("windows")?page.querySelector("#windowsStartupDescription").classList.remove("hide"):page.querySelector("#windowsStartupDescription").classList.add("hide"),systemInfo.SupportsAutoRunAtStartup?page.querySelector("#fldRunAtStartup").classList.remove("hide"):page.querySelector("#fldRunAtStartup").classList.add("hide"),systemInfo.CanLaunchWebBrowser?page.querySelector("#fldRunWebAppAtStartup").classList.remove("hide"):page.querySelector("#fldRunWebAppAtStartup").classList.add("hide"),page.querySelector("#txtCachePath").value=config.CachePath||"",$("#selectLocalizationLanguage",page).html(languageOptions.map(function(l){return'"})).val(config.UICulture),currentLanguage=config.UICulture,$("#chkUsageData",page).checked(config.EnableAnonymousUsageReporting),$("#chkRunAtStartup",page).checked(config.RunAtStartup),$("#chkRunWebAppAtStartup",page).checked(config.AutoRunWebApp||!1),systemInfo.CanSelfUpdate?page.querySelector(".fldAutomaticUpdates").classList.remove("hide"):page.querySelector(".fldAutomaticUpdates").classList.add("hide"),$("#chkEnableAutomaticServerUpdates",page).checked(config.EnableAutoUpdate),$("#chkEnableAutomaticRestart",page).checked(config.EnableAutomaticRestart),systemInfo.CanSelfRestart?page.querySelector("#fldEnableAutomaticRestart").classList.remove("hide"):page.querySelector("#fldEnableAutomaticRestart").classList.add("hide"),systemInfo.CanSelfRestart||systemInfo.CanSelfUpdate?$(".autoUpdatesContainer",page).removeClass("hide"):$(".autoUpdatesContainer",page).addClass("hide"),loading.hide()}function onSubmit(){loading.show();var form=this;$(form).parents(".page");return ApiClient.getServerConfiguration().then(function(config){config.UICulture=$("#selectLocalizationLanguage",form).val(),config.CachePath=form.querySelector("#txtCachePath").value;var requiresReload=!1;config.UICulture!==currentLanguage&&(requiresReload=!0),config.EnableAnonymousUsageReporting=$("#chkUsageData",form).checked(),config.RunAtStartup=$("#chkRunAtStartup",form).checked(),config.AutoRunWebApp=$("#chkRunWebAppAtStartup",form).checked(),config.EnableAutomaticRestart=$("#chkEnableAutomaticRestart",form).checked(),config.EnableAutoUpdate=$("#chkEnableAutomaticServerUpdates",form).checked(),ApiClient.updateServerConfiguration(config).then(function(){ApiClient.getNamedConfiguration(brandingConfigKey).then(function(brandingConfig){brandingConfig.LoginDisclaimer=form.querySelector("#txtLoginDisclaimer").value,brandingConfig.CustomCss=form.querySelector("#txtCustomCss").value,currentBrandingOptions&&brandingConfig.CustomCss!==currentBrandingOptions.CustomCss&&(requiresReload=!0),ApiClient.updateNamedConfiguration(brandingConfigKey,brandingConfig).then(function(){Dashboard.processServerConfigurationUpdateResult(),requiresReload&&!AppInfo.isNativeApp&&window.location.reload(!0)})})})}),!1}var currentBrandingOptions,currentLanguage,brandingConfigKey="branding";return function(view,params){$("#btnSelectCachePath",view).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({callback:function(path){path&&(view.querySelector("#txtCachePath").value=path),picker.close()},validateWriteable:!0,header:Globalize.translate("HeaderSelectServerCachePath"),instruction:Globalize.translate("HeaderSelectServerCachePathHelp")})})}),$(".dashboardGeneralForm",view).off("submit",onSubmit).on("submit",onSubmit),view.addEventListener("viewshow",function(){var promise1=ApiClient.getServerConfiguration(),promise2=ApiClient.getJSON(ApiClient.getUrl("Localization/Options")),promise3=ApiClient.getSystemInfo();Promise.all([promise1,promise2,promise3]).then(function(responses){loadPage(view,responses[0],responses[1],responses[2])}),ApiClient.getNamedConfiguration(brandingConfigKey).then(function(config){currentBrandingOptions=config,view.querySelector("#txtLoginDisclaimer").value=config.LoginDisclaimer||"",view.querySelector("#txtCustomCss").value=config.CustomCss||""})})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/dashboard/dashboardhosting.js b/MediaBrowser.WebDashboard/dashboard-ui/dashboard/dashboardhosting.js index c9266a9b2c..0253853952 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/dashboard/dashboardhosting.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/dashboard/dashboardhosting.js @@ -1 +1 @@ -define(["loading","libraryMenu","globalize","emby-checkbox","emby-select"],function(loading,libraryMenu,globalize){"use strict";function onSubmit(e){var form=this,localAddress=form.querySelector("#txtLocalAddress").value,enableUpnp=form.querySelector("#chkEnableUpnp").checked;confirmSelections(localAddress,enableUpnp,function(){var enableHttps=form.querySelector("#chkEnableHttps").checked,certPath=form.querySelector("#txtCertificatePath").value||null,validationResult=getValidationAlert(form);return validationResult?void alertText(validationResult):void validateHttps(enableHttps,certPath).then(function(){loading.show(),ApiClient.getServerConfiguration().then(function(config){config.RequireHttps=enableHttps,config.LocalNetworkSubnets=form.querySelector("#txtLanNetworks").value.split(",").map(function(s){return s.trim()}).filter(function(s){return s.length>0}),config.RemoteIPFilter=form.querySelector("#txtExternalAddressFilter").value.split(",").map(function(s){return s.trim()}).filter(function(s){return s.length>0}),config.IsRemoteIPFilterBlacklist="blacklist"===form.querySelector("#selectExternalAddressFilterMode").value,config.PublicPort=form.querySelector("#txtPublicPort").value,config.PublicHttpsPort=form.querySelector("#txtPublicHttpsPort").value,config.EnableHttps=enableHttps,config.RequireHttps=enableHttps,config.HttpsPortNumber=form.querySelector("#txtHttpsPort").value,config.HttpServerPortNumber=form.querySelector("#txtPortNumber").value,config.EnableUPnP=enableUpnp,config.WanDdns=form.querySelector("#txtDdns").value,config.EnableRemoteAccess=form.querySelector("#chkRemoteAccess").checked,config.CertificatePath=certPath,config.CertificatePassword=form.querySelector("#txtCertPassword").value||null,config.LocalNetworkAddresses=localAddress?[localAddress]:[],ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult,Dashboard.processErrorResponse)})})}),e.preventDefault()}function triggerChange(select){var evt=document.createEvent("HTMLEvents");evt.initEvent("change",!1,!0),select.dispatchEvent(evt)}function getValidationAlert(form){return form.querySelector("#txtPublicPort").value===form.querySelector("#txtPublicHttpsPort").value?"The public http and https ports must be different.":form.querySelector("#txtPortNumber").value===form.querySelector("#txtHttpsPort").value?"The http and https ports must be different.":null}function validateHttps(enableHttps,certPath){return!enableHttps||certPath?Promise.resolve():new Promise(function(resolve,reject){return alertText({title:globalize.translate("TitleHostingSettings"),text:globalize.translate("HttpsRequiresCert")}).then(reject,reject)})}function alertText(options){return new Promise(function(resolve,reject){require(["alert"],function(alert){alert(options).then(resolve,reject)})})}function confirmSelections(localAddress,enableUpnp,callback){localAddress||!enableUpnp?alertText({title:globalize.translate("TitleHostingSettings"),text:globalize.translate("SettingsWarning")}).then(callback):callback()}function getTabs(){return[{href:"dashboardhosting.html",name:globalize.translate("TabHosting")},{href:"serversecurity.html",name:globalize.translate("TabSecurity")}]}return function(view,params){function loadPage(page,config){page.querySelector("#txtPortNumber").value=config.HttpServerPortNumber,page.querySelector("#txtPublicPort").value=config.PublicPort,page.querySelector("#txtPublicHttpsPort").value=config.PublicHttpsPort,page.querySelector("#txtLocalAddress").value=config.LocalNetworkAddresses[0]||"",page.querySelector("#txtLanNetworks").value=(config.LocalNetworkSubnets||[]).join(", "),page.querySelector("#txtExternalAddressFilter").value=(config.RemoteIPFilter||[]).join(", "),page.querySelector("#selectExternalAddressFilterMode").value=config.IsRemoteIPFilterBlacklist?"blacklist":"whitelist",page.querySelector("#chkRemoteAccess").checked=null==config.EnableRemoteAccess||config.EnableRemoteAccess;var chkEnableHttps=page.querySelector("#chkEnableHttps");chkEnableHttps.checked=null==config.RequireHttps?config.EnableHttps:config.RequireHttps,page.querySelector("#txtHttpsPort").value=config.HttpsPortNumber,page.querySelector("#txtDdns").value=config.WanDdns||"";var txtCertificatePath=page.querySelector("#txtCertificatePath");txtCertificatePath.value=config.CertificatePath||"",page.querySelector("#txtCertPassword").value=config.CertificatePassword||"",page.querySelector("#chkEnableUpnp").checked=config.EnableUPnP,onCertPathChange.call(txtCertificatePath),triggerChange(page.querySelector("#chkRemoteAccess")),loading.hide()}function onCertPathChange(){this.value?view.querySelector("#txtDdns").setAttribute("required","required"):view.querySelector("#txtDdns").removeAttribute("required")}view.querySelector("#chkRemoteAccess").addEventListener("change",function(){this.checked?(view.querySelector(".fldExternalAddressFilter").classList.remove("hide"),view.querySelector(".fldExternalAddressFilterMode").classList.remove("hide"),view.querySelector(".fldPublicPort").classList.remove("hide"),view.querySelector(".fldPublicHttpsPort").classList.remove("hide"),view.querySelector(".fldDdns").classList.remove("hide"),view.querySelector(".fldCertificatePath").classList.remove("hide"),view.querySelector(".fldCertPassword").classList.remove("hide"),view.querySelector(".fldEnableHttps").classList.remove("hide"),view.querySelector(".fldEnableUpnp").classList.remove("hide")):(view.querySelector(".fldExternalAddressFilter").classList.add("hide"),view.querySelector(".fldExternalAddressFilterMode").classList.add("hide"),view.querySelector(".fldPublicPort").classList.add("hide"),view.querySelector(".fldPublicHttpsPort").classList.add("hide"),view.querySelector(".fldDdns").classList.add("hide"),view.querySelector(".fldCertificatePath").classList.add("hide"),view.querySelector(".fldCertPassword").classList.add("hide"),view.querySelector(".fldEnableHttps").classList.add("hide"),view.querySelector(".fldEnableUpnp").classList.add("hide"))}),view.querySelector("#btnSelectCertPath").addEventListener("click",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({includeFiles:!0,includeDirectories:!0,callback:function(path){path&&(view.querySelector("#txtCertificatePath").value=path),picker.close()},header:globalize.translate("HeaderSelectCertificatePath")})})}),view.querySelector(".dashboardHostingForm").addEventListener("submit",onSubmit),view.querySelector("#txtCertificatePath").addEventListener("change",onCertPathChange),view.addEventListener("viewshow",function(e){libraryMenu.setTabs("adminadvanced",0,getTabs),loading.show(),ApiClient.getServerConfiguration().then(function(config){loadPage(view,config)})})}}); \ No newline at end of file +define(["loading","libraryMenu","globalize","emby-checkbox","emby-select"],function(loading,libraryMenu,globalize){"use strict";function onSubmit(e){var form=this,localAddress=form.querySelector("#txtLocalAddress").value,enableUpnp=form.querySelector("#chkEnableUpnp").checked;confirmSelections(localAddress,enableUpnp,function(){var validationResult=getValidationAlert(form);if(validationResult)return void alertText(validationResult);validateHttps(form).then(function(){loading.show(),ApiClient.getServerConfiguration().then(function(config){config.LocalNetworkSubnets=form.querySelector("#txtLanNetworks").value.split(",").map(function(s){return s.trim()}).filter(function(s){return s.length>0}),config.RemoteIPFilter=form.querySelector("#txtExternalAddressFilter").value.split(",").map(function(s){return s.trim()}).filter(function(s){return s.length>0}),config.IsRemoteIPFilterBlacklist="blacklist"===form.querySelector("#selectExternalAddressFilterMode").value,config.PublicPort=form.querySelector("#txtPublicPort").value,config.PublicHttpsPort=form.querySelector("#txtPublicHttpsPort").value;var httpsMode=form.querySelector("#selectHttpsMode").value;"proxy"===httpsMode?(config.EnableHttps=!0,config.RequireHttps=!1,config.IsBehindProxy=!0):"required"===httpsMode?(config.EnableHttps=!0,config.RequireHttps=!0,config.IsBehindProxy=!1):"enabled"===httpsMode?(config.EnableHttps=!0,config.RequireHttps=!1,config.IsBehindProxy=!1):(config.EnableHttps=!1,config.RequireHttps=!1,config.IsBehindProxy=!1),config.HttpsPortNumber=form.querySelector("#txtHttpsPort").value,config.HttpServerPortNumber=form.querySelector("#txtPortNumber").value,config.EnableUPnP=enableUpnp,config.WanDdns=form.querySelector("#txtDdns").value,config.EnableRemoteAccess=form.querySelector("#chkRemoteAccess").checked,config.CertificatePath=form.querySelector("#txtCertificatePath").value||null,config.CertificatePassword=form.querySelector("#txtCertPassword").value||null,config.LocalNetworkAddresses=localAddress?[localAddress]:[],ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult,Dashboard.processErrorResponse)})})}),e.preventDefault()}function triggerChange(select){var evt=document.createEvent("HTMLEvents");evt.initEvent("change",!1,!0),select.dispatchEvent(evt)}function getValidationAlert(form){return form.querySelector("#txtPublicPort").value===form.querySelector("#txtPublicHttpsPort").value?"The public http and https ports must be different.":form.querySelector("#txtPortNumber").value===form.querySelector("#txtHttpsPort").value?"The http and https ports must be different.":null}function validateHttps(form){var certPath=form.querySelector("#txtCertificatePath").value||null,httpsMode=form.querySelector("#selectHttpsMode").value;return"enabled"!==httpsMode&&"required"!==httpsMode||certPath?Promise.resolve():new Promise(function(resolve,reject){return alertText({title:globalize.translate("TitleHostingSettings"),text:globalize.translate("HttpsRequiresCert")}).then(reject,reject)})}function alertText(options){return new Promise(function(resolve,reject){require(["alert"],function(alert){alert(options).then(resolve,reject)})})}function confirmSelections(localAddress,enableUpnp,callback){localAddress||!enableUpnp?alertText({title:globalize.translate("TitleHostingSettings"),text:globalize.translate("SettingsWarning")}).then(callback):callback()}function getTabs(){return[{href:"dashboardhosting.html",name:globalize.translate("TabHosting")},{href:"serversecurity.html",name:globalize.translate("TabSecurity")}]}return function(view,params){function loadPage(page,config){page.querySelector("#txtPortNumber").value=config.HttpServerPortNumber,page.querySelector("#txtPublicPort").value=config.PublicPort,page.querySelector("#txtPublicHttpsPort").value=config.PublicHttpsPort,page.querySelector("#txtLocalAddress").value=config.LocalNetworkAddresses[0]||"",page.querySelector("#txtLanNetworks").value=(config.LocalNetworkSubnets||[]).join(", "),page.querySelector("#txtExternalAddressFilter").value=(config.RemoteIPFilter||[]).join(", "),page.querySelector("#selectExternalAddressFilterMode").value=config.IsRemoteIPFilterBlacklist?"blacklist":"whitelist",page.querySelector("#chkRemoteAccess").checked=null==config.EnableRemoteAccess||config.EnableRemoteAccess;var selectHttpsMode=page.querySelector("#selectHttpsMode");config.IsBehindProxy?selectHttpsMode.value="proxy":config.RequireHttps?selectHttpsMode.value="required":config.EnableHttps?selectHttpsMode.value="enabled":selectHttpsMode.value="disabled",page.querySelector("#txtHttpsPort").value=config.HttpsPortNumber,page.querySelector("#txtDdns").value=config.WanDdns||"";var txtCertificatePath=page.querySelector("#txtCertificatePath");txtCertificatePath.value=config.CertificatePath||"",page.querySelector("#txtCertPassword").value=config.CertificatePassword||"",page.querySelector("#chkEnableUpnp").checked=config.EnableUPnP,onCertPathChange.call(txtCertificatePath),triggerChange(page.querySelector("#chkRemoteAccess")),loading.hide()}function onCertPathChange(){this.value?view.querySelector("#txtDdns").setAttribute("required","required"):view.querySelector("#txtDdns").removeAttribute("required")}view.querySelector("#chkRemoteAccess").addEventListener("change",function(){this.checked?(view.querySelector(".fldExternalAddressFilter").classList.remove("hide"),view.querySelector(".fldExternalAddressFilterMode").classList.remove("hide"),view.querySelector(".fldPublicPort").classList.remove("hide"),view.querySelector(".fldPublicHttpsPort").classList.remove("hide"),view.querySelector(".fldDdns").classList.remove("hide"),view.querySelector(".fldCertificatePath").classList.remove("hide"),view.querySelector(".fldCertPassword").classList.remove("hide"),view.querySelector(".fldHttpsMode").classList.remove("hide"),view.querySelector(".fldEnableUpnp").classList.remove("hide")):(view.querySelector(".fldExternalAddressFilter").classList.add("hide"),view.querySelector(".fldExternalAddressFilterMode").classList.add("hide"),view.querySelector(".fldPublicPort").classList.add("hide"),view.querySelector(".fldPublicHttpsPort").classList.add("hide"),view.querySelector(".fldDdns").classList.add("hide"),view.querySelector(".fldCertificatePath").classList.add("hide"),view.querySelector(".fldCertPassword").classList.add("hide"),view.querySelector(".fldHttpsMode").classList.add("hide"),view.querySelector(".fldEnableUpnp").classList.add("hide"))}),view.querySelector("#btnSelectCertPath").addEventListener("click",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({includeFiles:!0,includeDirectories:!0,callback:function(path){path&&(view.querySelector("#txtCertificatePath").value=path),picker.close()},header:globalize.translate("HeaderSelectCertificatePath")})})}),view.querySelector(".dashboardHostingForm").addEventListener("submit",onSubmit),view.querySelector("#txtCertificatePath").addEventListener("change",onCertPathChange),view.addEventListener("viewshow",function(e){libraryMenu.setTabs("adminadvanced",0,getTabs),loading.show(),ApiClient.getServerConfiguration().then(function(config){loadPage(view,config)})})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/dashboard/devicesupload.js b/MediaBrowser.WebDashboard/dashboard-ui/dashboard/devicesupload.js index c3c13158d2..c24e7923cb 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/dashboard/devicesupload.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/dashboard/devicesupload.js @@ -1 +1 @@ -define(["jQuery","loading","libraryMenu","fnchecked"],function($,loading,libraryMenu){"use strict";function load(page,config){$("#txtUploadPath",page).val(config.CameraUploadPath||""),$("#chkSubfolder",page).checked(config.EnableCameraUploadSubfolders)}function loadData(page){loading.show(),ApiClient.getNamedConfiguration("devices").then(function(config){load(page,config),loading.hide()})}function save(page){ApiClient.getNamedConfiguration("devices").then(function(config){config.CameraUploadPath=$("#txtUploadPath",page).val(),config.EnableCameraUploadSubfolders=$("#chkSubfolder",page).checked(),ApiClient.updateNamedConfiguration("devices",config).then(Dashboard.processServerConfigurationUpdateResult)})}function onSubmit(){var form=this,page=$(form).parents(".page");return save(page),!1}$(document).on("pageinit","#devicesUploadPage",function(){var page=this;$("#btnSelectUploadPath",page).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({callback:function(path){path&&$("#txtUploadPath",page).val(path),picker.close()},validateWriteable:!0,header:Globalize.translate("HeaderSelectUploadPath")})})}),$(".devicesUploadForm").off("submit",onSubmit).on("submit",onSubmit)}).on("pageshow","#devicesUploadPage",function(){var page=this;loadData(page)})}); \ No newline at end of file +define(["jQuery","loading","libraryMenu","fnchecked"],function($,loading,libraryMenu){"use strict";function load(page,config){$("#txtUploadPath",page).val(config.CameraUploadPath||""),$("#chkSubfolder",page).checked(config.EnableCameraUploadSubfolders)}function loadData(page){loading.show(),ApiClient.getNamedConfiguration("devices").then(function(config){load(page,config),loading.hide()})}function save(page){ApiClient.getNamedConfiguration("devices").then(function(config){config.CameraUploadPath=$("#txtUploadPath",page).val(),config.EnableCameraUploadSubfolders=$("#chkSubfolder",page).checked(),ApiClient.updateNamedConfiguration("devices",config).then(Dashboard.processServerConfigurationUpdateResult)})}function onSubmit(){return save($(this).parents(".page")),!1}$(document).on("pageinit","#devicesUploadPage",function(){var page=this;$("#btnSelectUploadPath",page).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({callback:function(path){path&&$("#txtUploadPath",page).val(path),picker.close()},validateWriteable:!0,header:Globalize.translate("HeaderSelectUploadPath")})})}),$(".devicesUploadForm").off("submit",onSubmit).on("submit",onSubmit)}).on("pageshow","#devicesUploadPage",function(){loadData(this)})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/dashboard/livetvtuner.js b/MediaBrowser.WebDashboard/dashboard-ui/dashboard/livetvtuner.js index dc0ed9984c..743bcbb070 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/dashboard/livetvtuner.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/dashboard/livetvtuner.js @@ -1 +1 @@ -define(["globalize","loading","libraryMenu","emby-input","emby-button","emby-checkbox","emby-select"],function(globalize,loading,libraryMenu){"use strict";function isM3uVariant(type){return["nextpvr"].indexOf(type||"")!==-1}function triggerChange(select){var evt=document.createEvent("HTMLEvents");evt.initEvent("change",!1,!0),select.dispatchEvent(evt)}function fillTypes(view,currentId){return ApiClient.getJSON(ApiClient.getUrl("LiveTv/TunerHosts/Types")).then(function(types){var selectType=view.querySelector(".selectType");selectType.innerHTML=types.map(function(t){return'"}).join("")+'",selectType.disabled=null!=currentId,selectType.value="",triggerChange(selectType)})}function reload(view,providerId){view.querySelector(".txtDevicePath").value="",view.querySelector(".chkFavorite").checked=!1,view.querySelector(".txtDevicePath").value="",providerId&&ApiClient.getNamedConfiguration("livetv").then(function(config){var info=config.TunerHosts.filter(function(i){return i.Id===providerId})[0];fillTunerHostInfo(view,info)})}function fillTunerHostInfo(view,info){var selectType=view.querySelector(".selectType"),type=info.Type||"";info.Source&&isM3uVariant(info.Source)&&(type=info.Source),selectType.value=type,triggerChange(selectType),view.querySelector(".txtDevicePath").value=info.Url||"",view.querySelector(".txtFriendlyName").value=info.FriendlyName||"",view.querySelector(".txtUserAgent").value=info.UserAgent||"",view.querySelector(".fldDeviceId").value=info.DeviceId||"",view.querySelector(".chkFavorite").checked=info.ImportFavoritesOnly,view.querySelector(".chkTranscode").checked=info.AllowHWTranscoding,view.querySelector(".chkStreamLoop").checked=info.EnableStreamLooping,view.querySelector(".txtTunerCount").value=info.TunerCount||"0"}function submitForm(page){loading.show();var info={Type:page.querySelector(".selectType").value,Url:page.querySelector(".txtDevicePath").value||null,UserAgent:page.querySelector(".txtUserAgent").value||null,FriendlyName:page.querySelector(".txtFriendlyName").value||null,DeviceId:page.querySelector(".fldDeviceId").value||null,TunerCount:page.querySelector(".txtTunerCount").value||0,ImportFavoritesOnly:page.querySelector(".chkFavorite").checked,AllowHWTranscoding:page.querySelector(".chkTranscode").checked,EnableStreamLooping:page.querySelector(".chkStreamLoop").checked};isM3uVariant(info.Type)&&(info.Source=info.Type,info.Type="m3u");var id=getParameterByName("id");id&&(info.Id=id);var originalId=info.Id;ApiClient.ajax({type:"POST",url:ApiClient.getUrl("LiveTv/TunerHosts"),data:JSON.stringify(info),contentType:"application/json"}).then(function(result){Dashboard.processServerConfigurationUpdateResult(),originalId?Dashboard.navigate("livetvstatus.html"):Dashboard.navigate("livetvstatus.html")},function(){loading.hide(),Dashboard.alert({message:globalize.translate("ErrorSavingTvProvider")})})}function getRequirePromise(deps){return new Promise(function(resolve,reject){require(deps,resolve)})}function getDetectedDevice(){return getRequirePromise(["tunerPicker"]).then(function(tunerPicker){return(new tunerPicker).show({serverId:ApiClient.serverId()})})}function getTabs(){return[{href:"livetvstatus.html",name:globalize.translate("TabDevices")},{href:"livetvsettings.html",name:globalize.translate("TabSettings")},{href:"appservices.html?context=livetv",name:globalize.translate("TabServices")}]}return function(view,params){function onTypeChange(){var value=this.value,mayIncludeUnsupportedDrmChannels="hdhomerun"===value,supportsTranscoding="hdhomerun"===value,supportsFavorites="hdhomerun"===value,supportsTunerIpAddress="hdhomerun"===value,supportsTunerFileOrUrl="m3u"===value,supportsStreamLooping="m3u"===value,supportsTunerCount="m3u"===value,supportsUserAgent="m3u"===value,suppportsSubmit="other"!==value,supportsSelectablePath=supportsTunerFileOrUrl,txtDevicePath=view.querySelector(".txtDevicePath");supportsTunerIpAddress?(txtDevicePath.label(globalize.translate("LabelTunerIpAddress")),view.querySelector(".fldPath").classList.remove("hide")):supportsTunerFileOrUrl?(txtDevicePath.label(globalize.translate("LabelFileOrUrl")),view.querySelector(".fldPath").classList.remove("hide")):view.querySelector(".fldPath").classList.add("hide"),supportsSelectablePath?(view.querySelector(".btnSelectPath").classList.remove("hide"),view.querySelector(".txtDevicePath").setAttribute("required","required")):(view.querySelector(".btnSelectPath").classList.add("hide"),view.querySelector(".txtDevicePath").removeAttribute("required")),supportsUserAgent?view.querySelector(".fldUserAgent").classList.remove("hide"):view.querySelector(".fldUserAgent").classList.add("hide"),supportsFavorites?view.querySelector(".fldFavorites").classList.remove("hide"):view.querySelector(".fldFavorites").classList.add("hide"),supportsTranscoding?view.querySelector(".fldTranscode").classList.remove("hide"):view.querySelector(".fldTranscode").classList.add("hide"),supportsStreamLooping?view.querySelector(".fldStreamLoop").classList.remove("hide"):view.querySelector(".fldStreamLoop").classList.add("hide"),supportsTunerCount?(view.querySelector(".fldTunerCount").classList.remove("hide"),view.querySelector(".txtTunerCount").setAttribute("required","required")):(view.querySelector(".fldTunerCount").classList.add("hide"),view.querySelector(".txtTunerCount").removeAttribute("required")),mayIncludeUnsupportedDrmChannels?view.querySelector(".drmMessage").classList.remove("hide"):view.querySelector(".drmMessage").classList.add("hide"),suppportsSubmit?(view.querySelector(".button-submit").classList.remove("hide"),view.querySelector(".otherOptionsMessage").classList.add("hide")):(view.querySelector(".button-submit").classList.add("hide"),view.querySelector(".otherOptionsMessage").classList.remove("hide"))}params.id||view.querySelector(".btnDetect").classList.remove("hide"),view.addEventListener("viewshow",function(){libraryMenu.setTabs("livetvadmin",0,getTabs);var currentId=params.id;fillTypes(view,currentId).then(function(){reload(view,currentId)})}),view.querySelector("form").addEventListener("submit",function(e){return submitForm(view),e.preventDefault(),e.stopPropagation(),!1}),view.querySelector(".selectType").addEventListener("change",onTypeChange),view.querySelector(".btnDetect").addEventListener("click",function(){getDetectedDevice().then(function(info){fillTunerHostInfo(view,info)})}),view.querySelector(".btnSelectPath").addEventListener("click",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({includeFiles:!0,callback:function(path){path&&(view.querySelector(".txtDevicePath").value=path),picker.close()}})})})}}); \ No newline at end of file +define(["globalize","loading","libraryMenu","emby-input","emby-button","emby-checkbox","emby-select"],function(globalize,loading,libraryMenu){"use strict";function isM3uVariant(type){return-1!==["nextpvr"].indexOf(type||"")}function triggerChange(select){var evt=document.createEvent("HTMLEvents");evt.initEvent("change",!1,!0),select.dispatchEvent(evt)}function fillTypes(view,currentId){return ApiClient.getJSON(ApiClient.getUrl("LiveTv/TunerHosts/Types")).then(function(types){var selectType=view.querySelector(".selectType");selectType.innerHTML=types.map(function(t){return'"}).join("")+'",selectType.disabled=null!=currentId,selectType.value="",triggerChange(selectType)})}function reload(view,providerId){view.querySelector(".txtDevicePath").value="",view.querySelector(".chkFavorite").checked=!1,view.querySelector(".txtDevicePath").value="",providerId&&ApiClient.getNamedConfiguration("livetv").then(function(config){var info=config.TunerHosts.filter(function(i){return i.Id===providerId})[0];fillTunerHostInfo(view,info)})}function fillTunerHostInfo(view,info){var selectType=view.querySelector(".selectType"),type=info.Type||"";info.Source&&isM3uVariant(info.Source)&&(type=info.Source),selectType.value=type,triggerChange(selectType),view.querySelector(".txtDevicePath").value=info.Url||"",view.querySelector(".txtFriendlyName").value=info.FriendlyName||"",view.querySelector(".txtUserAgent").value=info.UserAgent||"",view.querySelector(".fldDeviceId").value=info.DeviceId||"",view.querySelector(".chkFavorite").checked=info.ImportFavoritesOnly,view.querySelector(".chkTranscode").checked=info.AllowHWTranscoding,view.querySelector(".chkStreamLoop").checked=info.EnableStreamLooping,view.querySelector(".txtTunerCount").value=info.TunerCount||"0"}function submitForm(page){loading.show();var info={Type:page.querySelector(".selectType").value,Url:page.querySelector(".txtDevicePath").value||null,UserAgent:page.querySelector(".txtUserAgent").value||null,FriendlyName:page.querySelector(".txtFriendlyName").value||null,DeviceId:page.querySelector(".fldDeviceId").value||null,TunerCount:page.querySelector(".txtTunerCount").value||0,ImportFavoritesOnly:page.querySelector(".chkFavorite").checked,AllowHWTranscoding:page.querySelector(".chkTranscode").checked,EnableStreamLooping:page.querySelector(".chkStreamLoop").checked};isM3uVariant(info.Type)&&(info.Source=info.Type,info.Type="m3u");var id=getParameterByName("id");id&&(info.Id=id);info.Id;ApiClient.ajax({type:"POST",url:ApiClient.getUrl("LiveTv/TunerHosts"),data:JSON.stringify(info),contentType:"application/json"}).then(function(result){Dashboard.processServerConfigurationUpdateResult(),Dashboard.navigate("livetvstatus.html")},function(){loading.hide(),Dashboard.alert({message:globalize.translate("ErrorSavingTvProvider")})})}function getRequirePromise(deps){return new Promise(function(resolve,reject){require(deps,resolve)})}function getDetectedDevice(){return getRequirePromise(["tunerPicker"]).then(function(tunerPicker){return(new tunerPicker).show({serverId:ApiClient.serverId()})})}function getTabs(){return[{href:"livetvstatus.html",name:globalize.translate("TabDevices")},{href:"livetvsettings.html",name:globalize.translate("TabSettings")},{href:"appservices.html?context=livetv",name:globalize.translate("TabServices")}]}return function(view,params){function onTypeChange(){var value=this.value,mayIncludeUnsupportedDrmChannels="hdhomerun"===value,supportsTranscoding="hdhomerun"===value,supportsFavorites="hdhomerun"===value,supportsTunerIpAddress="hdhomerun"===value,supportsTunerFileOrUrl="m3u"===value,supportsStreamLooping="m3u"===value,supportsTunerCount="m3u"===value,supportsUserAgent="m3u"===value,suppportsSubmit="other"!==value,supportsSelectablePath=supportsTunerFileOrUrl,txtDevicePath=view.querySelector(".txtDevicePath");supportsTunerIpAddress?(txtDevicePath.label(globalize.translate("LabelTunerIpAddress")),view.querySelector(".fldPath").classList.remove("hide")):supportsTunerFileOrUrl?(txtDevicePath.label(globalize.translate("LabelFileOrUrl")),view.querySelector(".fldPath").classList.remove("hide")):view.querySelector(".fldPath").classList.add("hide"),supportsSelectablePath?(view.querySelector(".btnSelectPath").classList.remove("hide"),view.querySelector(".txtDevicePath").setAttribute("required","required")):(view.querySelector(".btnSelectPath").classList.add("hide"),view.querySelector(".txtDevicePath").removeAttribute("required")),supportsUserAgent?view.querySelector(".fldUserAgent").classList.remove("hide"):view.querySelector(".fldUserAgent").classList.add("hide"),supportsFavorites?view.querySelector(".fldFavorites").classList.remove("hide"):view.querySelector(".fldFavorites").classList.add("hide"),supportsTranscoding?view.querySelector(".fldTranscode").classList.remove("hide"):view.querySelector(".fldTranscode").classList.add("hide"),supportsStreamLooping?view.querySelector(".fldStreamLoop").classList.remove("hide"):view.querySelector(".fldStreamLoop").classList.add("hide"),supportsTunerCount?(view.querySelector(".fldTunerCount").classList.remove("hide"),view.querySelector(".txtTunerCount").setAttribute("required","required")):(view.querySelector(".fldTunerCount").classList.add("hide"),view.querySelector(".txtTunerCount").removeAttribute("required")),mayIncludeUnsupportedDrmChannels?view.querySelector(".drmMessage").classList.remove("hide"):view.querySelector(".drmMessage").classList.add("hide"),suppportsSubmit?(view.querySelector(".button-submit").classList.remove("hide"),view.querySelector(".otherOptionsMessage").classList.add("hide")):(view.querySelector(".button-submit").classList.add("hide"),view.querySelector(".otherOptionsMessage").classList.remove("hide"))}params.id||view.querySelector(".btnDetect").classList.remove("hide"),view.addEventListener("viewshow",function(){libraryMenu.setTabs("livetvadmin",0,getTabs);var currentId=params.id;fillTypes(view,currentId).then(function(){reload(view,currentId)})}),view.querySelector("form").addEventListener("submit",function(e){return submitForm(view),e.preventDefault(),e.stopPropagation(),!1}),view.querySelector(".selectType").addEventListener("change",onTypeChange),view.querySelector(".btnDetect").addEventListener("click",function(){getDetectedDevice().then(function(info){fillTunerHostInfo(view,info)})}),view.querySelector(".btnSelectPath").addEventListener("click",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({includeFiles:!0,callback:function(path){path&&(view.querySelector(".txtDevicePath").value=path),picker.close()}})})})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/dashboard/wizardremoteaccess.js b/MediaBrowser.WebDashboard/dashboard-ui/dashboard/wizardremoteaccess.js index 3ac6a5dd31..3767b54d6e 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/dashboard/wizardremoteaccess.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/dashboard/wizardremoteaccess.js @@ -1 +1 @@ -define(["loading","emby-checkbox","emby-button","emby-select"],function(loading){"use strict";function save(page){loading.show();var apiClient=ApiClient,config={};config.EnableRemoteAccess=page.querySelector("#chkRemoteAccess").checked,config.EnableAutomaticPortMapping=page.querySelector("#chkEnableUpnp").checked,apiClient.ajax({type:"POST",data:config,url:apiClient.getUrl("Startup/RemoteAccess")}).then(function(){loading.hide(),navigateToNextPage()})}function navigateToNextPage(){Dashboard.navigate("wizardagreement.html")}function onSubmit(e){var form=this;return save(form),e.preventDefault(),!1}return function(view,params){view.querySelector(".wizardSettingsForm").addEventListener("submit",onSubmit),view.addEventListener("viewshow",function(){document.querySelector(".skinHeader").classList.add("noHomeButtonHeader")}),view.addEventListener("viewhide",function(){document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader")})}}); \ No newline at end of file +define(["loading","emby-checkbox","emby-button","emby-select"],function(loading){"use strict";function save(page){loading.show();var apiClient=ApiClient,config={};config.EnableRemoteAccess=page.querySelector("#chkRemoteAccess").checked,config.EnableAutomaticPortMapping=page.querySelector("#chkEnableUpnp").checked,apiClient.ajax({type:"POST",data:config,url:apiClient.getUrl("Startup/RemoteAccess")}).then(function(){loading.hide(),navigateToNextPage()})}function navigateToNextPage(){Dashboard.navigate("wizardagreement.html")}function onSubmit(e){return save(this),e.preventDefault(),!1}return function(view,params){view.querySelector(".wizardSettingsForm").addEventListener("submit",onSubmit),view.addEventListener("viewshow",function(){document.querySelector(".skinHeader").classList.add("noHomeButtonHeader")}),view.addEventListener("viewhide",function(){document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader")})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/dashboard/wizardsettings.js b/MediaBrowser.WebDashboard/dashboard-ui/dashboard/wizardsettings.js index 100d3a2d52..e66a2e4fcd 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/dashboard/wizardsettings.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/dashboard/wizardsettings.js @@ -1 +1 @@ -define(["loading","emby-checkbox","emby-button","emby-select"],function(loading){"use strict";function save(page){loading.show();var apiClient=ApiClient;apiClient.getJSON(apiClient.getUrl("Startup/Configuration")).then(function(config){config.PreferredMetadataLanguage=page.querySelector("#selectLanguage").value,config.MetadataCountryCode=page.querySelector("#selectCountry").value,apiClient.ajax({type:"POST",data:config,url:apiClient.getUrl("Startup/Configuration")}).then(function(){loading.hide(),navigateToNextPage()})})}function populateLanguages(select,languages){var html="";html+="";for(var i=0,length=languages.length;i"+culture.DisplayName+""}select.innerHTML=html}function populateCountries(select,allCountries){var html="";html+="";for(var i=0,length=allCountries.length;i"+culture.DisplayName+""}select.innerHTML=html}function reloadData(page,config,cultures,countries){populateLanguages(page.querySelector("#selectLanguage"),cultures),populateCountries(page.querySelector("#selectCountry"),countries),page.querySelector("#selectLanguage").value=config.PreferredMetadataLanguage,page.querySelector("#selectCountry").value=config.MetadataCountryCode,loading.hide()}function reload(page){loading.show();var apiClient=ApiClient,promise1=apiClient.getJSON(apiClient.getUrl("Startup/Configuration")),promise2=apiClient.getCultures(),promise3=apiClient.getCountries();Promise.all([promise1,promise2,promise3]).then(function(responses){reloadData(page,responses[0],responses[1],responses[2])})}function navigateToNextPage(){require(["scripts/wizardcontroller"],function(wizardcontroller){wizardcontroller.navigateToComponents()})}function onSubmit(e){var form=this;return save(form),e.preventDefault(),!1}return function(view,params){view.querySelector(".wizardSettingsForm").addEventListener("submit",onSubmit),view.addEventListener("viewshow",function(){document.querySelector(".skinHeader").classList.add("noHomeButtonHeader"),reload(this)}),view.addEventListener("viewhide",function(){document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader")})}}); \ No newline at end of file +define(["loading","emby-checkbox","emby-button","emby-select"],function(loading){"use strict";function save(page){loading.show();var apiClient=ApiClient;apiClient.getJSON(apiClient.getUrl("Startup/Configuration")).then(function(config){config.PreferredMetadataLanguage=page.querySelector("#selectLanguage").value,config.MetadataCountryCode=page.querySelector("#selectCountry").value,apiClient.ajax({type:"POST",data:config,url:apiClient.getUrl("Startup/Configuration")}).then(function(){loading.hide(),navigateToNextPage()})})}function populateLanguages(select,languages){var html="";html+="";for(var i=0,length=languages.length;i"+culture.DisplayName+""}select.innerHTML=html}function populateCountries(select,allCountries){var html="";html+="";for(var i=0,length=allCountries.length;i"+culture.DisplayName+""}select.innerHTML=html}function reloadData(page,config,cultures,countries){populateLanguages(page.querySelector("#selectLanguage"),cultures),populateCountries(page.querySelector("#selectCountry"),countries),page.querySelector("#selectLanguage").value=config.PreferredMetadataLanguage,page.querySelector("#selectCountry").value=config.MetadataCountryCode,loading.hide()}function reload(page){loading.show();var apiClient=ApiClient,promise1=apiClient.getJSON(apiClient.getUrl("Startup/Configuration")),promise2=apiClient.getCultures(),promise3=apiClient.getCountries();Promise.all([promise1,promise2,promise3]).then(function(responses){reloadData(page,responses[0],responses[1],responses[2])})}function navigateToNextPage(){require(["scripts/wizardcontroller"],function(wizardcontroller){wizardcontroller.navigateToComponents()})}function onSubmit(e){return save(this),e.preventDefault(),!1}return function(view,params){view.querySelector(".wizardSettingsForm").addEventListener("submit",onSubmit),view.addEventListener("viewshow",function(){document.querySelector(".skinHeader").classList.add("noHomeButtonHeader"),reload(this)}),view.addEventListener("viewhide",function(){document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader")})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/dashboardhosting.html b/MediaBrowser.WebDashboard/dashboard-ui/dashboardhosting.html index 4c86993c98..129f387da6 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/dashboardhosting.html +++ b/MediaBrowser.WebDashboard/dashboard-ui/dashboardhosting.html @@ -21,6 +21,7 @@
    ${LabelHttpsPortHelp}
    +
    -
    - -
    ${RequireHttpsHelp}
    +
    +
    +
    -
    - -
    -
    "}elem.innerHTML=html;var elems=elem.querySelectorAll(".itemsContainer");for(i=0,length=elems.length;i',html+='
    ',layoutManager.tv?html+='

    '+globalize.translate(section.name)+"

    ":(html+='',html+='

    ',html+=globalize.translate(section.name),html+="

    ",html+='',html+="
    "),html+="
    ",html+='
    ',html+="
    "}elem.innerHTML=html;var elems=elem.querySelectorAll(".itemsContainer");for(i=0,length=elems.length;i40?(alphaPicker.classList.remove("hide"),layoutManager.tv?instance.itemsContainer.parentNode.classList.add("padded-left-withalphapicker"):instance.itemsContainer.parentNode.classList.add("padded-right-withalphapicker")):(alphaPicker.classList.add("hide"),instance.itemsContainer.parentNode.classList.remove("padded-left-withalphapicker"),instance.itemsContainer.parentNode.classList.remove("padded-right-withalphapicker"))}}}function getItems(instance,params,item,sortBy,startIndex,limit){var apiClient=connectionManager.getApiClient(params.serverId);if(instance.queryRecursive=!1,"Recordings"===params.type)return apiClient.getLiveTvRecordings(getInitialLiveTvQuery(instance,params));if("Programs"===params.type)return"true"===params.IsAiring?apiClient.getLiveTvRecommendedPrograms(getInitialLiveTvQuery(instance,params)):apiClient.getLiveTvPrograms(getInitialLiveTvQuery(instance,params));if("nextup"===params.type)return apiClient.getNextUpEpisodes(modifyQueryWithFilters(instance,{Limit:limit,Fields:"PrimaryImageAspectRatio,SeriesInfo,DateCreated,BasicSyncInfo",UserId:apiClient.getCurrentUserId(),ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Thumb",EnableTotalRecordCount:!1,SortBy:sortBy}));if(!item)return instance.queryRecursive=!0,apiClient.getItems(apiClient.getCurrentUserId(),modifyQueryWithFilters(instance,{StartIndex:startIndex,Limit:limit,Fields:"PrimaryImageAspectRatio,SortName",ImageTypeLimit:1,IncludeItemTypes:params.type,Recursive:!0,IsFavorite:"true"===params.IsFavorite||null,ArtistIds:params.artistId||null,SortBy:sortBy}));if("Genre"===item.Type||"GameGenre"===item.Type||"MusicGenre"===item.Type||"Studio"===item.Type||"Person"===item.Type){instance.queryRecursive=!0;var query={StartIndex:startIndex,Limit:limit,Fields:"PrimaryImageAspectRatio,SortName",Recursive:!0,parentId:params.parentId,SortBy:sortBy};return"Studio"===item.Type?query.StudioIds=item.Id:"Genre"===item.Type||"GameGenre"===item.Type||"MusicGenre"===item.Type?query.GenreIds=item.Id:"Person"===item.Type&&(query.PersonIds=item.Id),"MusicGenre"===item.Type?query.IncludeItemTypes="MusicAlbum":"GameGenre"===item.Type?query.IncludeItemTypes="Game":"movies"===item.CollectionType?query.IncludeItemTypes="Movie":"tvshows"===item.CollectionType?query.IncludeItemTypes="Series":"Genre"===item.Type?query.IncludeItemTypes="Movie,Series":"Person"===item.Type&&(query.IncludeItemTypes=params.type),apiClient.getItems(apiClient.getCurrentUserId(),modifyQueryWithFilters(instance,query))}return apiClient.getItems(apiClient.getCurrentUserId(),modifyQueryWithFilters(instance,{StartIndex:startIndex,Limit:limit,Fields:"PrimaryImageAspectRatio,SortName",ImageTypeLimit:1,ParentId:item.Id,SortBy:sortBy}))}function getItem(params){if("Recordings"===params.type)return Promise.resolve(null);if("Programs"===params.type)return Promise.resolve(null);if("nextup"===params.type)return Promise.resolve(null);var apiClient=connectionManager.getApiClient(params.serverId),itemId=params.genreId||params.gameGenreId||params.musicGenreId||params.studioId||params.personId||params.parentId;return itemId?apiClient.getItem(apiClient.getCurrentUserId(),itemId):Promise.resolve(null)}function showViewSettingsMenu(){var instance=this;require(["viewSettings"],function(ViewSettings){(new ViewSettings).show({settingsKey:instance.getSettingsKey(),settings:instance.getViewSettings(),visibleSettings:instance.getVisibleViewSettings()}).then(function(){updateItemsContainerForViewType(instance),instance.itemsContainer.refreshItems()})})}function showFilterMenu(){var instance=this;require(["filterMenu"],function(FilterMenu){(new FilterMenu).show({settingsKey:instance.getSettingsKey(),settings:instance.getFilters(),visibleSettings:instance.getVisibleFilters(),onChange:instance.itemsContainer.refreshItems.bind(instance.itemsContainer),parentId:instance.params.parentId,itemTypes:instance.getItemTypes(),serverId:instance.params.serverId,filterMenuOptions:instance.getFilterMenuOptions()}).then(function(){instance.itemsContainer.refreshItems()})})}function showSortMenu(){var instance=this;require(["sortMenu"],function(SortMenu){(new SortMenu).show({settingsKey:instance.getSettingsKey(),settings:instance.getSortValues(),onChange:instance.itemsContainer.refreshItems.bind(instance.itemsContainer),serverId:instance.params.serverId,sortOptions:instance.getSortMenuOptions()}).then(function(){updateSortText(instance),updateAlphaPickerState(instance),instance.itemsContainer.refreshItems()})})}function onNewItemClick(){var instance=this;require(["playlistEditor"],function(playlistEditor){(new playlistEditor).show({items:[],serverId:instance.params.serverId})})}function hideOrShowAll(elems,hide){for(var i=0,length=elems.length;i!'),btnFilter.classList.add("btnFilterWithBubble"),bubble=btnFilter.querySelector(".filterButtonBubble")}hasFilters?bubble.classList.remove("hide"):bubble.classList.add("hide")}},ItemsView.prototype.getFilterMenuOptions=function(){var params=this.params;return{IsAiring:params.IsAiring,IsMovie:params.IsMovie,IsSports:params.IsSports,IsKids:params.IsKids,IsNews:params.IsNews,IsSeries:params.IsSeries,Recursive:this.queryRecursive}},ItemsView.prototype.getVisibleViewSettings=function(){var item=(this.params,this.currentItem),fields=["showTitle"];return(!item||"PhotoAlbum"!==item.Type&&"ChannelFolderItem"!==item.Type)&&fields.push("imageType"),fields.push("viewType"),fields},ItemsView.prototype.getViewSettings=function(){var basekey=this.getSettingsKey(),params=this.params,item=this.currentItem,showTitle=userSettings.get(basekey+"-showTitle");"true"===showTitle?showTitle=!0:"false"===showTitle?showTitle=!1:"Programs"===params.type||"Recordings"===params.type||"nextup"===params.type||"Audio"===params.type||"MusicAlbum"===params.type||"MusicArtist"===params.type?showTitle=!0:item&&"PhotoAlbum"!==item.Type&&(showTitle=!0);var imageType=userSettings.get(basekey+"-imageType");return imageType||"nextup"===params.type&&(imageType="thumb"),{showTitle:showTitle,showYear:"false"!==userSettings.get(basekey+"-showYear"),imageType:imageType||"primary",viewType:userSettings.get(basekey+"-viewType")||"images"}},ItemsView.prototype.getItemTypes=function(){var params=this.params;return"nextup"===params.type?["Episode"]:"Programs"===params.type?["Program"]:[]},ItemsView.prototype.getSettingsKey=function(){var values=[];values.push("items");var params=this.params;return params.type?values.push(params.type):params.parentId&&values.push(params.parentId),params.IsAiring&&values.push("IsAiring"),params.IsMovie&&values.push("IsMovie"),params.IsKids&&values.push("IsKids"),params.IsSports&&values.push("IsSports"),params.IsNews&&values.push("IsNews"),params.IsSeries&&values.push("IsSeries"),params.IsFavorite&&values.push("IsFavorite"),params.genreId&&values.push("Genre"),params.gameGenreId&&values.push("GameGenre"),params.musicGenreId&&values.push("MusicGenre"),params.studioId&&values.push("Studio"),params.personId&&values.push("Person"),params.parentId&&values.push("Folder"),values.join("-")},ItemsView}); \ No newline at end of file +define(["globalize","listView","layoutManager","userSettings","focusManager","cardBuilder","loading","connectionManager","alphaNumericShortcuts","scroller","playbackManager","alphaPicker","emby-itemscontainer","emby-scroller"],function(globalize,listView,layoutManager,userSettings,focusManager,cardBuilder,loading,connectionManager,AlphaNumericShortcuts,scroller,playbackManager,alphaPicker){"use strict";function getInitialLiveTvQuery(instance,params){var query={UserId:connectionManager.getApiClient(params.serverId).getCurrentUserId(),StartIndex:0,Fields:"ChannelInfo,PrimaryImageAspectRatio",Limit:300};return"Recordings"===params.type?(query.IsInProgress=!1,params.groupId&&(query.GroupId=params.groupId)):query.HasAired=!1,"true"===params.IsMovie?query.IsMovie=!0:"false"===params.IsMovie&&(query.IsMovie=!1),"true"===params.IsSeries?query.IsSeries=!0:"false"===params.IsSeries&&(query.IsSeries=!1),"true"===params.IsNews?query.IsNews=!0:"false"===params.IsNews&&(query.IsNews=!1),"true"===params.IsSports?query.IsSports=!0:"false"===params.IsSports&&(query.IsSports=!1),"true"===params.IsKids?query.IsKids=!0:"false"===params.IsKids&&(query.IsKids=!1),"true"===params.IsAiring?query.IsAiring=!0:"false"===params.IsAiring&&(query.IsAiring=!1),modifyQueryWithFilters(instance,query)}function modifyQueryWithFilters(instance,query){var sortValues=instance.getSortValues();query.SortBy||(query.SortBy=sortValues.sortBy,query.SortOrder=sortValues.sortOrder),query.Fields=query.Fields?query.Fields+",PrimaryImageAspectRatio":"PrimaryImageAspectRatio",query.ImageTypeLimit=1;var hasFilters,queryFilters=[],filters=instance.getFilters();return filters.IsPlayed&&(queryFilters.push("IsPlayed"),hasFilters=!0),filters.IsUnplayed&&(queryFilters.push("IsUnplayed"),hasFilters=!0),filters.IsFavorite&&(queryFilters.push("IsFavorite"),hasFilters=!0),filters.IsResumable&&(queryFilters.push("IsResumable"),hasFilters=!0),filters.VideoTypes&&(hasFilters=!0,query.VideoTypes=filters.VideoTypes),filters.GenreIds&&(hasFilters=!0,query.GenreIds=filters.GenreIds),filters.IsHD&&(query.IsHD=!0,hasFilters=!0),filters.IsSD&&(query.IsHD=!1,hasFilters=!0),filters.Is3D&&(query.Is3D=!0,hasFilters=!0),filters.HasSubtitles&&(query.HasSubtitles=!0,hasFilters=!0),filters.HasTrailer&&(query.HasTrailer=!0,hasFilters=!0),filters.HasSpecialFeature&&(query.HasSpecialFeature=!0,hasFilters=!0),filters.HasThemeSong&&(query.HasThemeSong=!0,hasFilters=!0),filters.HasThemeVideo&&(query.HasThemeVideo=!0,hasFilters=!0),query.Filters=queryFilters.length?queryFilters.join(","):null,instance.setFilterStatus(hasFilters),instance.alphaPicker&&(query.NameStartsWithOrGreater=instance.alphaPicker.value()),query}function updateSortText(instance){var btnSortText=instance.btnSortText;if(btnSortText){for(var options=instance.getSortMenuOptions(),values=instance.getSortValues(),sortBy=values.sortBy,i=0,length=options.length;i40?(alphaPicker.classList.remove("hide"),layoutManager.tv?instance.itemsContainer.parentNode.classList.add("padded-left-withalphapicker"):instance.itemsContainer.parentNode.classList.add("padded-right-withalphapicker")):(alphaPicker.classList.add("hide"),instance.itemsContainer.parentNode.classList.remove("padded-left-withalphapicker"),instance.itemsContainer.parentNode.classList.remove("padded-right-withalphapicker"))}}}function getItems(instance,params,item,sortBy,startIndex,limit){var apiClient=connectionManager.getApiClient(params.serverId);if(instance.queryRecursive=!1,"Recordings"===params.type)return apiClient.getLiveTvRecordings(getInitialLiveTvQuery(instance,params));if("Programs"===params.type)return"true"===params.IsAiring?apiClient.getLiveTvRecommendedPrograms(getInitialLiveTvQuery(instance,params)):apiClient.getLiveTvPrograms(getInitialLiveTvQuery(instance,params));if("nextup"===params.type)return apiClient.getNextUpEpisodes(modifyQueryWithFilters(instance,{Limit:limit,Fields:"PrimaryImageAspectRatio,SeriesInfo,DateCreated,BasicSyncInfo",UserId:apiClient.getCurrentUserId(),ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Thumb",EnableTotalRecordCount:!1,SortBy:sortBy}));if(!item)return instance.queryRecursive=!0,apiClient.getItems(apiClient.getCurrentUserId(),modifyQueryWithFilters(instance,{StartIndex:startIndex,Limit:limit,Fields:"PrimaryImageAspectRatio,SortName",ImageTypeLimit:1,IncludeItemTypes:params.type,Recursive:!0,IsFavorite:"true"===params.IsFavorite||null,ArtistIds:params.artistId||null,SortBy:sortBy}));if("Genre"===item.Type||"GameGenre"===item.Type||"MusicGenre"===item.Type||"Studio"===item.Type||"Person"===item.Type){instance.queryRecursive=!0;var query={StartIndex:startIndex,Limit:limit,Fields:"PrimaryImageAspectRatio,SortName",Recursive:!0,parentId:params.parentId,SortBy:sortBy};return"Studio"===item.Type?query.StudioIds=item.Id:"Genre"===item.Type||"GameGenre"===item.Type||"MusicGenre"===item.Type?query.GenreIds=item.Id:"Person"===item.Type&&(query.PersonIds=item.Id),"MusicGenre"===item.Type?query.IncludeItemTypes="MusicAlbum":"GameGenre"===item.Type?query.IncludeItemTypes="Game":"movies"===item.CollectionType?query.IncludeItemTypes="Movie":"tvshows"===item.CollectionType?query.IncludeItemTypes="Series":"Genre"===item.Type?query.IncludeItemTypes="Movie,Series":"Person"===item.Type&&(query.IncludeItemTypes=params.type),apiClient.getItems(apiClient.getCurrentUserId(),modifyQueryWithFilters(instance,query))}return apiClient.getItems(apiClient.getCurrentUserId(),modifyQueryWithFilters(instance,{StartIndex:startIndex,Limit:limit,Fields:"PrimaryImageAspectRatio,SortName",ImageTypeLimit:1,ParentId:item.Id,SortBy:sortBy}))}function getItem(params){if("Recordings"===params.type)return Promise.resolve(null);if("Programs"===params.type)return Promise.resolve(null);if("nextup"===params.type)return Promise.resolve(null);var apiClient=connectionManager.getApiClient(params.serverId),itemId=params.genreId||params.gameGenreId||params.musicGenreId||params.studioId||params.personId||params.parentId;return itemId?apiClient.getItem(apiClient.getCurrentUserId(),itemId):Promise.resolve(null)}function showViewSettingsMenu(){var instance=this;require(["viewSettings"],function(ViewSettings){(new ViewSettings).show({settingsKey:instance.getSettingsKey(),settings:instance.getViewSettings(),visibleSettings:instance.getVisibleViewSettings()}).then(function(){updateItemsContainerForViewType(instance),instance.itemsContainer.refreshItems()})})}function showFilterMenu(){var instance=this;require(["filterMenu"],function(FilterMenu){(new FilterMenu).show({settingsKey:instance.getSettingsKey(),settings:instance.getFilters(),visibleSettings:instance.getVisibleFilters(),onChange:instance.itemsContainer.refreshItems.bind(instance.itemsContainer),parentId:instance.params.parentId,itemTypes:instance.getItemTypes(),serverId:instance.params.serverId,filterMenuOptions:instance.getFilterMenuOptions()}).then(function(){instance.itemsContainer.refreshItems()})})}function showSortMenu(){var instance=this;require(["sortMenu"],function(SortMenu){(new SortMenu).show({settingsKey:instance.getSettingsKey(),settings:instance.getSortValues(),onChange:instance.itemsContainer.refreshItems.bind(instance.itemsContainer),serverId:instance.params.serverId,sortOptions:instance.getSortMenuOptions()}).then(function(){updateSortText(instance),updateAlphaPickerState(instance),instance.itemsContainer.refreshItems()})})}function onNewItemClick(){var instance=this;require(["playlistEditor"],function(playlistEditor){(new playlistEditor).show({items:[],serverId:instance.params.serverId})})}function hideOrShowAll(elems,hide){for(var i=0,length=elems.length;i!'),btnFilter.classList.add("btnFilterWithBubble"),bubble=btnFilter.querySelector(".filterButtonBubble")}hasFilters?bubble.classList.remove("hide"):bubble.classList.add("hide")}},ItemsView.prototype.getFilterMenuOptions=function(){var params=this.params;return{IsAiring:params.IsAiring,IsMovie:params.IsMovie,IsSports:params.IsSports,IsKids:params.IsKids,IsNews:params.IsNews,IsSeries:params.IsSeries,Recursive:this.queryRecursive}},ItemsView.prototype.getVisibleViewSettings=function(){var item=(this.params,this.currentItem),fields=["showTitle"];return(!item||"PhotoAlbum"!==item.Type&&"ChannelFolderItem"!==item.Type)&&fields.push("imageType"),fields.push("viewType"),fields},ItemsView.prototype.getViewSettings=function(){var basekey=this.getSettingsKey(),params=this.params,item=this.currentItem,showTitle=userSettings.get(basekey+"-showTitle");"true"===showTitle?showTitle=!0:"false"===showTitle?showTitle=!1:"Programs"===params.type||"Recordings"===params.type||"nextup"===params.type||"Audio"===params.type||"MusicAlbum"===params.type||"MusicArtist"===params.type?showTitle=!0:item&&"PhotoAlbum"!==item.Type&&(showTitle=!0);var imageType=userSettings.get(basekey+"-imageType");return imageType||"nextup"===params.type&&(imageType="thumb"),{showTitle:showTitle,showYear:"false"!==userSettings.get(basekey+"-showYear"),imageType:imageType||"primary",viewType:userSettings.get(basekey+"-viewType")||"images"}},ItemsView.prototype.getItemTypes=function(){var params=this.params;return"nextup"===params.type?["Episode"]:"Programs"===params.type?["Program"]:[]},ItemsView.prototype.getSettingsKey=function(){var values=[];values.push("items");var params=this.params;return params.type?values.push(params.type):params.parentId&&values.push(params.parentId),params.IsAiring&&values.push("IsAiring"),params.IsMovie&&values.push("IsMovie"),params.IsKids&&values.push("IsKids"),params.IsSports&&values.push("IsSports"),params.IsNews&&values.push("IsNews"),params.IsSeries&&values.push("IsSeries"),params.IsFavorite&&values.push("IsFavorite"),params.genreId&&values.push("Genre"),params.gameGenreId&&values.push("GameGenre"),params.musicGenreId&&values.push("MusicGenre"),params.studioId&&values.push("Studio"),params.personId&&values.push("Person"),params.parentId&&values.push("Folder"),values.join("-")},ItemsView}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/offline/offline.js b/MediaBrowser.WebDashboard/dashboard-ui/offline/offline.js index 04bf3c0a0d..4b58dea684 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/offline/offline.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/offline/offline.js @@ -1 +1 @@ -define(["globalize","connectionManager","focusManager","cardBuilder","emby-itemscontainer","flexStyles","scrollStyles"],function(globalize,connectionManager,focusManager,cardBuilder){"use strict";return function(view,params){function mergeInto(list1,list2){for(var i=0,length=list2.length;i";var id="section"+(new Date).getTime();html+='
    ',html+="",parentElement.insertAdjacentHTML("beforeend",html),cardBuilder.buildCards(items,{itemsContainer:parentElement.querySelector("#"+id),shape:"backdrop",preferThumb:!0,showTitle:!0,centerText:!0,overlayText:!1})}function loadServerFolders(parentElement,apiClient){return apiClient.getLocalFolders().then(function(items){return items.length&&renderLocalFolders(parentElement,items,apiClient.serverName()),Promise.resolve()})}function loadAllServerFolders(){var offlineServers=view.querySelector(".offlineServers");offlineServers.innerHTML="";var promises=connectionManager.getApiClients().map(function(apiClient){return loadServerFolders(offlineServers,apiClient)});return Promise.all(promises)}function loadOfflineCategories(){var promises=[];return promises.push(loadLatest()),promises.push(loadAllServerFolders()),Promise.all(promises)}function autoFocus(){focusManager.autoFocus(view)}view.addEventListener("viewshow",function(e){Emby.Page.setTitle(globalize.translate("sharedcomponents#Downloads"));var isRestored=e.detail.isRestored;isRestored||loadOfflineCategories().then(autoFocus)})}}); \ No newline at end of file +define(["globalize","connectionManager","focusManager","cardBuilder","emby-itemscontainer","flexStyles","scrollStyles"],function(globalize,connectionManager,focusManager,cardBuilder){"use strict";return function(view,params){function mergeInto(list1,list2){for(var i=0,length=list2.length;i";var id="section"+(new Date).getTime();html+='
    ',html+="",parentElement.insertAdjacentHTML("beforeend",html),cardBuilder.buildCards(items,{itemsContainer:parentElement.querySelector("#"+id),shape:"backdrop",preferThumb:!0,showTitle:!0,centerText:!0,overlayText:!1})}function loadServerFolders(parentElement,apiClient){return apiClient.getLocalFolders().then(function(items){return items.length&&renderLocalFolders(parentElement,items,apiClient.serverName()),Promise.resolve()})}function loadAllServerFolders(){var offlineServers=view.querySelector(".offlineServers");offlineServers.innerHTML="";var promises=connectionManager.getApiClients().map(function(apiClient){return loadServerFolders(offlineServers,apiClient)});return Promise.all(promises)}function loadOfflineCategories(){var promises=[];return promises.push(loadLatest()),promises.push(loadAllServerFolders()),Promise.all(promises)}function autoFocus(){focusManager.autoFocus(view)}view.addEventListener("viewshow",function(e){Emby.Page.setTitle(globalize.translate("sharedcomponents#Downloads")),e.detail.isRestored||loadOfflineCategories().then(autoFocus)})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/addpluginpage.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/addpluginpage.js index d14a5ba87f..0c0e161225 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/addpluginpage.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/addpluginpage.js @@ -1 +1 @@ -define(["jQuery","loading","libraryMenu","globalize","connectionManager","emby-linkbutton"],function($,loading,libraryMenu,globalize,connectionManager){"use strict";function populateHistory(packageInfo,page){for(var html="",i=0,length=Math.min(packageInfo.versions.length,10);i'+version.versionStr+" ("+version.classification+")",html+='
    '+version.description+"
    "}$("#revisionHistory",page).html(html)}function populateVersions(packageInfo,page,installedPlugin){for(var html="",i=0,length=packageInfo.versions.length;i'+version.versionStr+" ("+version.classification+")"}var selectmenu=$("#selectVersion",page).html(html);installedPlugin||$("#pCurrentVersion",page).hide().html("");var packageVersion=packageInfo.versions.filter(function(current){return"Release"==current.classification})[0];if(packageVersion||(packageVersion=packageInfo.versions.filter(function(current){return"Beta"==current.classification})[0]),packageVersion){var val=packageVersion.versionStr+"|"+packageVersion.classification;selectmenu.val(val)}}function renderPluginInfo(page,pkg,pluginSecurityInfo){if(!AppInfo.isNativeApp)if(pkg.isPremium){$(".premiumPackage",page).show();var regStatus="";if(pkg.isRegistered)regStatus+="

    ",regStatus+=globalize.translate("MessageFeatureIncludedWithSupporter");else{var expDateTime=new Date(pkg.expDate).getTime(),nowTime=(new Date).getTime();expDateTime<=nowTime?(regStatus+="

    ",regStatus+=globalize.translate("MessageTrialExpired")):expDateTime>new Date(1970,1,1).getTime()&&(regStatus+="

    ",regStatus+=globalize.translate("MessageTrialWillExpireIn").replace("{0}",Math.round(expDateTime-nowTime)/864e5))}if(regStatus+="

    ",$("#regStatus",page).html(regStatus),pluginSecurityInfo.IsMBSupporter)if($(".premiumDescription",page).hide(),$(".supporterDescription",page).hide(),pkg.price>0){$(".premiumHasPrice",page).show(),$("#featureId",page).val(pkg.featureId),$("#featureName",page).val(pkg.name),$("#amount",page).val(pkg.price),$("#regPrice",page).html("

    "+globalize.translate("ValuePriceUSD").replace("{0}","$"+pkg.price.toFixed(2))+"

    "),$("#ppButton",page).hide();var url="https://mb3admin.com/admin/service/user/getPayPalEmail?id="+pkg.owner;fetch(url).then(function(response){return response.json()}).then(function(dev){dev.payPalEmail&&($("#payPalEmail",page).val(dev.payPalEmail),$("#ppButton",page).show())})}else $(".premiumHasPrice",page).hide();else pkg.price?($(".premiumDescription",page).show(),$(".supporterDescription",page).hide()):($(".premiumDescription",page).hide(),$(".supporterDescription",page).show()),$("#ppButton",page).hide()}else $(".premiumPackage",page).hide()}function renderPackage(pkg,installedPlugins,pluginSecurityInfo,page){var installedPlugin=installedPlugins.filter(function(ip){return ip.Name==pkg.name})[0];if(populateVersions(pkg,page,installedPlugin),populateHistory(pkg,page),$(".pluginName",page).html(pkg.name),"Server"==pkg.targetSystem)$("#btnInstallDiv",page).removeClass("hide"),$("#nonServerMsg",page).hide(),$("#pSelectVersion",page).removeClass("hide");else{$("#btnInstallDiv",page).addClass("hide"),$("#pSelectVersion",page).addClass("hide");var msg=globalize.translate("MessageInstallPluginFromApp");$("#nonServerMsg",page).html(msg).show()}if(pkg.shortDescription?$("#tagline",page).show().html(pkg.shortDescription):$("#tagline",page).hide(),$("#overview",page).html(pkg.overview||""),$("#developer",page).html(pkg.owner),renderPluginInfo(page,pkg,pluginSecurityInfo),pkg.richDescUrl?($("#pViewWebsite",page).show(),$("#pViewWebsite a",page).attr("href",pkg.richDescUrl)):$("#pViewWebsite",page).hide(),pkg.previewImage||pkg.thumbImage){var color=pkg.tileColor||"#38c",img=pkg.previewImage?pkg.previewImage:pkg.thumbImage;$("#pPreviewImage",page).show().html("")}else $("#pPreviewImage",page).hide().html("");if(installedPlugin){var currentVersionText=globalize.translate("MessageYouHaveVersionInstalled").replace("{0}",""+installedPlugin.Version+"");$("#pCurrentVersion",page).show().html(currentVersionText)}else $("#pCurrentVersion",page).hide().html("");loading.hide()}function alertText(options){require(["alert"],function(alert){alert(options)})}function performInstallation(page,packageName,guid,updateClass,version){var developer=$("#developer",page).html().toLowerCase(),alertCallback=function(confirmed){confirmed&&(loading.show(),page.querySelector("#btnInstall").disabled=!0,ApiClient.installPlugin(packageName,guid,updateClass,version).then(function(){loading.hide(),alertText(globalize.translate("PluginInstalledMessage"))}))};if("luke"!=developer&&"ebr"!=developer){loading.hide();var msg=globalize.translate("MessagePluginInstallDisclaimer");msg+="
    ",msg+="
    ",msg+=globalize.translate("PleaseConfirmPluginInstallation"),require(["confirm"],function(confirm){confirm(msg,globalize.translate("HeaderConfirmPluginInstallation")).then(function(){alertCallback(!0)},function(){alertCallback(!1)})})}else alertCallback(!0)}function updateHelpUrl(page,params){var context=params.context;"sync"==context?(page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Sync"),libraryMenu.setTitle(globalize.translate("TitleSync"))):"livetv"==context?(libraryMenu.setTitle(globalize.translate("TitleLiveTV")),page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Live%20TV")):"notifications"==context?(libraryMenu.setTitle(globalize.translate("TitleNotifications")),page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Notifications")):(page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Plugins"),libraryMenu.setTitle(globalize.translate("TitlePlugins")))}return function(view,params){var onSubmit=function(){loading.show();var page=$(this).parents("#addPluginPage")[0],name=params.name,guid=params.guid;return ApiClient.getInstalledPlugins().then(function(plugins){var installedPlugin=plugins.filter(function(ip){return ip.Name==name})[0],vals=$("#selectVersion",page).val().split("|"),version=vals[0];installedPlugin&&installedPlugin.Version==version?(loading.hide(),Dashboard.alert({message:globalize.translate("MessageAlreadyInstalled"),title:globalize.translate("HeaderPluginInstallation")})):performInstallation(page,name,guid,vals[1],version)}),!1};$(".addPluginForm",view).on("submit",onSubmit),updateHelpUrl(view,params),view.addEventListener("viewbeforeshow",function(){var page=this;updateHelpUrl(page,params)}),view.addEventListener("viewshow",function(){var page=this;loading.show();var name=params.name,guid=params.guid,promise1=ApiClient.getPackageInfo(name,guid),promise2=ApiClient.getInstalledPlugins();connectionManager.getRegistrationInfo("themes",ApiClient,{viewOnly:!0}),Promise.all([promise1,promise2]).then(function(responses){connectionManager.getRegistrationInfo("themes",ApiClient,{viewOnly:!0}).then(function(){renderPackage(responses[0],responses[1],{IsMBSupporter:!0},page)},function(){renderPackage(responses[0],responses[1],{},page)})}),updateHelpUrl(page,params)})}}); \ No newline at end of file +define(["jQuery","loading","libraryMenu","globalize","connectionManager","emby-linkbutton"],function($,loading,libraryMenu,globalize,connectionManager){"use strict";function populateHistory(packageInfo,page){for(var html="",i=0,length=Math.min(packageInfo.versions.length,10);i'+version.versionStr+" ("+version.classification+")",html+='
    '+version.description+"
    "}$("#revisionHistory",page).html(html)}function populateVersions(packageInfo,page,installedPlugin){for(var html="",i=0,length=packageInfo.versions.length;i'+version.versionStr+" ("+version.classification+")"}var selectmenu=$("#selectVersion",page).html(html);installedPlugin||$("#pCurrentVersion",page).hide().html("");var packageVersion=packageInfo.versions.filter(function(current){return"Release"==current.classification})[0];if(packageVersion||(packageVersion=packageInfo.versions.filter(function(current){return"Beta"==current.classification})[0]),packageVersion){var val=packageVersion.versionStr+"|"+packageVersion.classification;selectmenu.val(val)}}function renderPluginInfo(page,pkg,pluginSecurityInfo){if(!AppInfo.isNativeApp)if(pkg.isPremium){$(".premiumPackage",page).show();var regStatus="";if(pkg.isRegistered)regStatus+="

    ",regStatus+=globalize.translate("MessageFeatureIncludedWithSupporter");else{var expDateTime=new Date(pkg.expDate).getTime(),nowTime=(new Date).getTime();expDateTime<=nowTime?(regStatus+="

    ",regStatus+=globalize.translate("MessageTrialExpired")):expDateTime>new Date(1970,1,1).getTime()&&(regStatus+="

    ",regStatus+=globalize.translate("MessageTrialWillExpireIn").replace("{0}",Math.round(expDateTime-nowTime)/864e5))}if(regStatus+="

    ",$("#regStatus",page).html(regStatus),pluginSecurityInfo.IsMBSupporter)if($(".premiumDescription",page).hide(),$(".supporterDescription",page).hide(),pkg.price>0){$(".premiumHasPrice",page).show(),$("#featureId",page).val(pkg.featureId),$("#featureName",page).val(pkg.name),$("#amount",page).val(pkg.price),$("#regPrice",page).html("

    "+globalize.translate("ValuePriceUSD").replace("{0}","$"+pkg.price.toFixed(2))+"

    "),$("#ppButton",page).hide();var url="https://mb3admin.com/admin/service/user/getPayPalEmail?id="+pkg.owner;fetch(url).then(function(response){return response.json()}).then(function(dev){dev.payPalEmail&&($("#payPalEmail",page).val(dev.payPalEmail),$("#ppButton",page).show())})}else $(".premiumHasPrice",page).hide();else pkg.price?($(".premiumDescription",page).show(),$(".supporterDescription",page).hide()):($(".premiumDescription",page).hide(),$(".supporterDescription",page).show()),$("#ppButton",page).hide()}else $(".premiumPackage",page).hide()}function renderPackage(pkg,installedPlugins,pluginSecurityInfo,page){var installedPlugin=installedPlugins.filter(function(ip){return ip.Name==pkg.name})[0];if(populateVersions(pkg,page,installedPlugin),populateHistory(pkg,page),$(".pluginName",page).html(pkg.name),"Server"==pkg.targetSystem)$("#btnInstallDiv",page).removeClass("hide"),$("#nonServerMsg",page).hide(),$("#pSelectVersion",page).removeClass("hide");else{$("#btnInstallDiv",page).addClass("hide"),$("#pSelectVersion",page).addClass("hide");var msg=globalize.translate("MessageInstallPluginFromApp");$("#nonServerMsg",page).html(msg).show()}if(pkg.shortDescription?$("#tagline",page).show().html(pkg.shortDescription):$("#tagline",page).hide(),$("#overview",page).html(pkg.overview||""),$("#developer",page).html(pkg.owner),renderPluginInfo(page,pkg,pluginSecurityInfo),pkg.richDescUrl?($("#pViewWebsite",page).show(),$("#pViewWebsite a",page).attr("href",pkg.richDescUrl)):$("#pViewWebsite",page).hide(),pkg.previewImage||pkg.thumbImage){var color=pkg.tileColor||"#38c",img=pkg.previewImage?pkg.previewImage:pkg.thumbImage;$("#pPreviewImage",page).show().html("")}else $("#pPreviewImage",page).hide().html("");if(installedPlugin){var currentVersionText=globalize.translate("MessageYouHaveVersionInstalled").replace("{0}",""+installedPlugin.Version+"");$("#pCurrentVersion",page).show().html(currentVersionText)}else $("#pCurrentVersion",page).hide().html("");loading.hide()}function alertText(options){require(["alert"],function(alert){alert(options)})}function performInstallation(page,packageName,guid,updateClass,version){var developer=$("#developer",page).html().toLowerCase(),alertCallback=function(confirmed){confirmed&&(loading.show(),page.querySelector("#btnInstall").disabled=!0,ApiClient.installPlugin(packageName,guid,updateClass,version).then(function(){loading.hide(),alertText(globalize.translate("PluginInstalledMessage"))}))};if("luke"!=developer&&"ebr"!=developer){loading.hide();var msg=globalize.translate("MessagePluginInstallDisclaimer");msg+="
    ",msg+="
    ",msg+=globalize.translate("PleaseConfirmPluginInstallation"),require(["confirm"],function(confirm){confirm(msg,globalize.translate("HeaderConfirmPluginInstallation")).then(function(){alertCallback(!0)},function(){alertCallback(!1)})})}else alertCallback(!0)}function updateHelpUrl(page,params){var context=params.context;"sync"==context?(page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Sync"),libraryMenu.setTitle(globalize.translate("TitleSync"))):"livetv"==context?(libraryMenu.setTitle(globalize.translate("TitleLiveTV")),page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Live%20TV")):"notifications"==context?(libraryMenu.setTitle(globalize.translate("TitleNotifications")),page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Notifications")):(page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Plugins"),libraryMenu.setTitle(globalize.translate("TitlePlugins")))}return function(view,params){var onSubmit=function(){loading.show();var page=$(this).parents("#addPluginPage")[0],name=params.name,guid=params.guid;return ApiClient.getInstalledPlugins().then(function(plugins){var installedPlugin=plugins.filter(function(ip){return ip.Name==name})[0],vals=$("#selectVersion",page).val().split("|"),version=vals[0];installedPlugin&&installedPlugin.Version==version?(loading.hide(),Dashboard.alert({message:globalize.translate("MessageAlreadyInstalled"),title:globalize.translate("HeaderPluginInstallation")})):performInstallation(page,name,guid,vals[1],version)}),!1};$(".addPluginForm",view).on("submit",onSubmit),updateHelpUrl(view,params),view.addEventListener("viewbeforeshow",function(){updateHelpUrl(this,params)}),view.addEventListener("viewshow",function(){var page=this;loading.show();var name=params.name,guid=params.guid,promise1=ApiClient.getPackageInfo(name,guid),promise2=ApiClient.getInstalledPlugins();connectionManager.getRegistrationInfo("themes",ApiClient,{viewOnly:!0}),Promise.all([promise1,promise2]).then(function(responses){connectionManager.getRegistrationInfo("themes",ApiClient,{viewOnly:!0}).then(function(){renderPackage(responses[0],responses[1],{IsMBSupporter:!0},page)},function(){renderPackage(responses[0],responses[1],{},page)})}),updateHelpUrl(page,params)})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/apploader.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/apploader.js index 64c299beb9..a9ce1ebfec 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/apploader.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/apploader.js @@ -1 +1 @@ -!function(){"use strict";function loadRequire(){var src,script=document.createElement("script");src=self.Promise?"./bower_components/alameda/alameda.js":"./bower_components/requirejs/require.js",self.dashboardVersion&&(src+="?v="+self.dashboardVersion),script.src=src,script.onload=loadApp,document.head.appendChild(script)}function loadApp(){var script=document.createElement("script"),src="./scripts/site.js";self.dashboardVersion&&(src+="?v="+self.dashboardVersion),script.src=src,document.head.appendChild(script)}loadRequire()}(); \ No newline at end of file +!function(){"use strict";function loadApp(){var script=document.createElement("script"),src="./scripts/site.js";self.dashboardVersion&&(src+="?v="+self.dashboardVersion),script.src=src,document.head.appendChild(script)}!function(){var src,script=document.createElement("script");src=self.Promise?"./bower_components/alameda/alameda.js":"./bower_components/requirejs/require.js",self.dashboardVersion&&(src+="?v="+self.dashboardVersion),script.src=src,script.onload=loadApp,document.head.appendChild(script)}()}(); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/appservices.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/appservices.js index 3d0dde7061..ed43b9439e 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/appservices.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/appservices.js @@ -1 +1 @@ -define(["loading","libraryMenu"],function(loading,libraryMenu){"use strict";function reloadList(page){loading.show();var promise1=ApiClient.getAvailablePlugins({TargetSystems:"Server"}),promise2=ApiClient.getInstalledPlugins();Promise.all([promise1,promise2]).then(function(responses){renderInstalled(page,responses[0],responses[1]),renderCatalog(page,responses[0],responses[1])})}function getCategories(){var context=getParameterByName("context"),categories=[];return"sync"==context?categories.push("Sync"):"livetv"==context?categories.push("Live TV"):"notifications"==context&&categories.push("Notifications"),categories}function renderInstalled(page,availablePlugins,installedPlugins){requirejs(["scripts/pluginspage"],function(){var category=getCategories()[0];installedPlugins=installedPlugins.filter(function(i){var catalogEntry=availablePlugins.filter(function(a){return(a.guid||"").toLowerCase()==(i.Id||"").toLowerCase()})[0];return!!catalogEntry&&catalogEntry.category==category}),PluginsPage.renderPlugins(page,installedPlugins)})}function renderCatalog(page,availablePlugins,installedPlugins){requirejs(["scripts/plugincatalogpage"],function(){var categories=getCategories();PluginCatalog.renderCatalog({catalogElement:page.querySelector(".catalog"),availablePlugins:availablePlugins,installedPlugins:installedPlugins,categories:categories,showCategory:!1,context:getParameterByName("context"),targetSystem:"Server"})})}function onPageShow(){var page=this,context=getParameterByName("context");"sync"==context?(libraryMenu.setTitle(Globalize.translate("TitleSync")),page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Sync")):"livetv"==context?(libraryMenu.setTitle(Globalize.translate("TitleLiveTV")),page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Live%20TV")):"notifications"==context&&(libraryMenu.setTitle(Globalize.translate("TitleNotifications")),page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Notifications"))}pageIdOn("pagebeforeshow","appServicesPage",onPageShow),pageIdOn("pageshow","appServicesPage",onPageShow),pageIdOn("pageshow","appServicesPage",function(){var page=this;reloadList(page)})}); \ No newline at end of file +define(["loading","libraryMenu"],function(loading,libraryMenu){"use strict";function reloadList(page){loading.show();var promise1=ApiClient.getAvailablePlugins({TargetSystems:"Server"}),promise2=ApiClient.getInstalledPlugins();Promise.all([promise1,promise2]).then(function(responses){renderInstalled(page,responses[0],responses[1]),renderCatalog(page,responses[0],responses[1])})}function getCategories(){var context=getParameterByName("context"),categories=[];return"sync"==context?categories.push("Sync"):"livetv"==context?categories.push("Live TV"):"notifications"==context&&categories.push("Notifications"),categories}function renderInstalled(page,availablePlugins,installedPlugins){requirejs(["scripts/pluginspage"],function(){var category=getCategories()[0];installedPlugins=installedPlugins.filter(function(i){var catalogEntry=availablePlugins.filter(function(a){return(a.guid||"").toLowerCase()==(i.Id||"").toLowerCase()})[0];return!!catalogEntry&&catalogEntry.category==category}),PluginsPage.renderPlugins(page,installedPlugins)})}function renderCatalog(page,availablePlugins,installedPlugins){requirejs(["scripts/plugincatalogpage"],function(){var categories=getCategories();PluginCatalog.renderCatalog({catalogElement:page.querySelector(".catalog"),availablePlugins:availablePlugins,installedPlugins:installedPlugins,categories:categories,showCategory:!1,context:getParameterByName("context"),targetSystem:"Server"})})}function onPageShow(){var page=this,context=getParameterByName("context");"sync"==context?(libraryMenu.setTitle(Globalize.translate("TitleSync")),page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Sync")):"livetv"==context?(libraryMenu.setTitle(Globalize.translate("TitleLiveTV")),page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Live%20TV")):"notifications"==context&&(libraryMenu.setTitle(Globalize.translate("TitleNotifications")),page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Notifications"))}pageIdOn("pagebeforeshow","appServicesPage",onPageShow),pageIdOn("pageshow","appServicesPage",onPageShow),pageIdOn("pageshow","appServicesPage",function(){reloadList(this)})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/camerauploadsettings.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/camerauploadsettings.js index 2c4c828ba5..3dc0b97322 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/camerauploadsettings.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/camerauploadsettings.js @@ -1 +1 @@ -define(["appSettings","loading","emby-checkbox"],function(appSettings,loading){"use strict";function loadForm(page,user){var uploadServers=appSettings.cameraUploadServers();page.querySelector(".uploadServerList").innerHTML=ConnectionManager.getSavedServers().map(function(s){var checkedHtml=uploadServers.indexOf(s.Id)==-1?"":" checked",html='";return html}).join(""),loading.hide()}function saveUser(page){for(var chkUploadServer=page.querySelectorAll(".chkUploadServer"),cameraUploadServers=[],i=0,length=chkUploadServer.length;i'+s.Name+""}).join(""),loading.hide()}function saveUser(page){for(var chkUploadServer=page.querySelectorAll(".chkUploadServer"),cameraUploadServers=[],i=0,length=chkUploadServer.length;ihttps://emby.media')});break;case"Unavailable":Dashboard.alert({message:Globalize.translate("MessageUnableToConnectToServer"),title:Globalize.translate("HeaderConnectionFailure")})}}function loadAppConnection(page){loading.show(),ConnectionManager.connect({enableAutoLogin:appSettings.enableAutoLogin()}).then(function(result){handleConnectionResult(page,result)})}function loadPage(page,params){var mode=params.mode||"auto";if("auto"==mode){if(AppInfo.isNativeApp)return void loadAppConnection(page);mode="connect"}loadMode(page,mode)}function loadMode(page,mode){"welcome"==mode?(page.querySelector(".connectLoginForm").classList.add("hide"),page.querySelector(".welcomeContainer").classList.remove("hide"),page.querySelector(".manualServerForm").classList.add("hide"),page.querySelector(".signupForm").classList.add("hide")):"connect"==mode?(page.querySelector(".connectLoginForm").classList.remove("hide"),page.querySelector(".welcomeContainer").classList.add("hide"),page.querySelector(".manualServerForm").classList.add("hide"),page.querySelector(".signupForm").classList.add("hide")):"manualserver"==mode?(page.querySelector(".manualServerForm").classList.remove("hide"),page.querySelector(".connectLoginForm").classList.add("hide"),page.querySelector(".welcomeContainer").classList.add("hide"),page.querySelector(".signupForm").classList.add("hide")):"signup"==mode&&(page.querySelector(".manualServerForm").classList.add("hide"),page.querySelector(".connectLoginForm").classList.add("hide"),page.querySelector(".welcomeContainer").classList.add("hide"),page.querySelector(".signupForm").classList.remove("hide"),initSignup(page))}function skip(){Dashboard.navigate("selectserver.html")}function requireCaptcha(){return!AppInfo.isNativeApp&&0==window.location.href.toLowerCase().indexOf("https")}function supportInAppSignup(){return AppInfo.isNativeApp||0==window.location.href.toLowerCase().indexOf("https")}function initSignup(page){supportInAppSignup()&&requireCaptcha()&&require(["https://www.google.com/recaptcha/api.js?render=explicit"],function(){setTimeout(function(){var recaptchaContainer=page.querySelector(".recaptchaContainer");greWidgetId=grecaptcha.render(recaptchaContainer,{sitekey:"6Le2LAgTAAAAAK06Wvttt_yUnbISTy6q3Azqp9po",theme:"dark"})},100)})}function submitManualServer(page){var host=page.querySelector("#txtServerHost").value,port=page.querySelector("#txtServerPort").value;port&&(host+=":"+port),loading.show(),ConnectionManager.connectToAddress(host,{enableAutoLogin:appSettings.enableAutoLogin()}).then(function(result){handleConnectionResult(page,result)},function(){handleConnectionResult(page,{State:"Unavailable"})})}function submit(page){var user=page.querySelector("#txtManualName").value,password=page.querySelector("#txtManualPassword").value;login(page,user,password)}var greWidgetId;return function(view,params){function onSubmit(e){return submit(view),e.preventDefault(),!1}function onManualServerSubmit(e){return submitManualServer(view),e.preventDefault(),!1}function onSignupFormSubmit(e){if(!supportInAppSignup())return e.preventDefault(),!1;var page=view,greResponse=greWidgetId?grecaptcha.getResponse(greWidgetId):null;return ConnectionManager.signupForConnect({email:page.querySelector("#txtSignupEmail",page).value,username:page.querySelector("#txtSignupUsername",page).value,password:page.querySelector("#txtSignupPassword",page).value,passwordConfirm:page.querySelector("#txtSignupPasswordConfirm",page).value,grecaptcha:greResponse}).then(function(result){var msg=result.Validated?Globalize.translate("MessageThankYouForConnectSignUpNoValidation"):Globalize.translate("MessageThankYouForConnectSignUp");Dashboard.alert({message:msg,callback:function(){Dashboard.navigate("connectlogin.html?mode=welcome")}})},function(result){"passwordmatch"==result.errorCode?Dashboard.alert({message:Globalize.translate("ErrorMessagePasswordNotMatchConfirm")}):"USERNAME_IN_USE"==result.errorCode?Dashboard.alert({message:Globalize.translate("ErrorMessageUsernameInUse")}):"EMAIL_IN_USE"==result.errorCode?Dashboard.alert({message:Globalize.translate("ErrorMessageEmailInUse")}):Dashboard.alert({message:Globalize.translate("DefaultErrorMessage")})}),e.preventDefault(),!1}function goBack(){require(["appRouter"],function(appRouter){appRouter.back()})}view.querySelector(".btnSkipConnect").addEventListener("click",skip),view.querySelector(".connectLoginForm").addEventListener("submit",onSubmit),view.querySelector(".manualServerForm").addEventListener("submit",onManualServerSubmit),view.querySelector(".signupForm").addEventListener("submit",onSignupFormSubmit),view.querySelector(".btnSignupForConnect").addEventListener("click",function(e){if(supportInAppSignup())return e.preventDefault(),e.stopPropagation(),Dashboard.navigate("connectlogin.html?mode=signup"),!1}),view.querySelector(".btnCancelSignup").addEventListener("click",goBack),view.querySelector(".btnCancelManualServer").addEventListener("click",goBack),view.querySelector(".btnWelcomeNext").addEventListener("click",function(){Dashboard.navigate("connectlogin.html?mode=connect")});var terms=view.querySelector(".terms");terms.innerHTML=Globalize.translate("LoginDisclaimer")+"",AppInfo.isNativeApp?(terms.classList.add("hide"),view.querySelector(".tvAppInfo").classList.add("hide")):(terms.classList.remove("hide"),view.querySelector(".tvAppInfo").classList.remove("hide")),view.addEventListener("viewbeforeshow",function(){var page=this;if(page.querySelector("#txtSignupEmail").value="",page.querySelector("#txtSignupUsername").value="",page.querySelector("#txtSignupPassword").value="",page.querySelector("#txtSignupPasswordConfirm").value="",browserInfo.safari&&AppInfo.isNativeApp)page.querySelector(".embyIntroDownloadMessage").innerHTML=Globalize.translate("EmbyIntroDownloadMessageWithoutLink");else{var link='http://emby.media';page.querySelector(".embyIntroDownloadMessage").innerHTML=Globalize.translate("EmbyIntroDownloadMessage",link)}}),view.addEventListener("viewshow",function(){loadPage(view,params)})}}); \ No newline at end of file +define(["appSettings","loading","emby-linkbutton"],function(appSettings,loading){"use strict";function login(page,username,password){loading.show(),appSettings.enableAutoLogin(!0),ConnectionManager.loginToConnect(username,password).then(function(){loading.hide(),Dashboard.navigate("selectserver.html")},function(){loading.hide(),Dashboard.alert({message:Globalize.translate("MessageInvalidUser"),title:Globalize.translate("HeaderLoginFailure")}),page.querySelector("#txtManualPassword").value=""})}function handleConnectionResult(page,result){switch(loading.hide(),result.State){case"SignedIn":var apiClient=result.ApiClient;Dashboard.onServerChanged(apiClient.getCurrentUserId(),apiClient.accessToken(),apiClient),Dashboard.navigate("home.html");break;case"ServerSignIn":Dashboard.navigate("login.html?serverid="+result.Servers[0].Id,!1,"none");break;case"ServerSelection":Dashboard.navigate("selectserver.html",!1,"none");break;case"ConnectSignIn":loadMode(page,"welcome");break;case"ServerUpdateNeeded":Dashboard.alert({message:Globalize.translate("ServerUpdateNeeded",'https://emby.media')});break;case"Unavailable":Dashboard.alert({message:Globalize.translate("MessageUnableToConnectToServer"),title:Globalize.translate("HeaderConnectionFailure")})}}function loadAppConnection(page){loading.show(),ConnectionManager.connect({enableAutoLogin:appSettings.enableAutoLogin()}).then(function(result){handleConnectionResult(page,result)})}function loadPage(page,params){var mode=params.mode||"auto";if("auto"==mode){if(AppInfo.isNativeApp)return void loadAppConnection(page);mode="connect"}loadMode(page,mode)}function loadMode(page,mode){"welcome"==mode?(page.querySelector(".connectLoginForm").classList.add("hide"),page.querySelector(".welcomeContainer").classList.remove("hide"),page.querySelector(".manualServerForm").classList.add("hide"),page.querySelector(".signupForm").classList.add("hide")):"connect"==mode?(page.querySelector(".connectLoginForm").classList.remove("hide"),page.querySelector(".welcomeContainer").classList.add("hide"),page.querySelector(".manualServerForm").classList.add("hide"),page.querySelector(".signupForm").classList.add("hide")):"manualserver"==mode?(page.querySelector(".manualServerForm").classList.remove("hide"),page.querySelector(".connectLoginForm").classList.add("hide"),page.querySelector(".welcomeContainer").classList.add("hide"),page.querySelector(".signupForm").classList.add("hide")):"signup"==mode&&(page.querySelector(".manualServerForm").classList.add("hide"),page.querySelector(".connectLoginForm").classList.add("hide"),page.querySelector(".welcomeContainer").classList.add("hide"),page.querySelector(".signupForm").classList.remove("hide"),initSignup(page))}function skip(){Dashboard.navigate("selectserver.html")}function requireCaptcha(){return!AppInfo.isNativeApp&&0==window.location.href.toLowerCase().indexOf("https")}function supportInAppSignup(){return AppInfo.isNativeApp||0==window.location.href.toLowerCase().indexOf("https")}function initSignup(page){supportInAppSignup()&&requireCaptcha()&&require(["https://www.google.com/recaptcha/api.js?render=explicit"],function(){setTimeout(function(){var recaptchaContainer=page.querySelector(".recaptchaContainer");greWidgetId=grecaptcha.render(recaptchaContainer,{sitekey:"6Le2LAgTAAAAAK06Wvttt_yUnbISTy6q3Azqp9po",theme:"dark"})},100)})}function submitManualServer(page){var host=page.querySelector("#txtServerHost").value,port=page.querySelector("#txtServerPort").value;port&&(host+=":"+port),loading.show(),ConnectionManager.connectToAddress(host,{enableAutoLogin:appSettings.enableAutoLogin()}).then(function(result){handleConnectionResult(page,result)},function(){handleConnectionResult(page,{State:"Unavailable"})})}function submit(page){login(page,page.querySelector("#txtManualName").value,page.querySelector("#txtManualPassword").value)}var greWidgetId;return function(view,params){function onSubmit(e){return submit(view),e.preventDefault(),!1}function onManualServerSubmit(e){return submitManualServer(view),e.preventDefault(),!1}function onSignupFormSubmit(e){if(!supportInAppSignup())return e.preventDefault(),!1;var page=view,greResponse=greWidgetId?grecaptcha.getResponse(greWidgetId):null;return ConnectionManager.signupForConnect({email:page.querySelector("#txtSignupEmail",page).value,username:page.querySelector("#txtSignupUsername",page).value,password:page.querySelector("#txtSignupPassword",page).value,passwordConfirm:page.querySelector("#txtSignupPasswordConfirm",page).value,grecaptcha:greResponse}).then(function(result){var msg=result.Validated?Globalize.translate("MessageThankYouForConnectSignUpNoValidation"):Globalize.translate("MessageThankYouForConnectSignUp");Dashboard.alert({message:msg,callback:function(){Dashboard.navigate("connectlogin.html?mode=welcome")}})},function(result){"passwordmatch"==result.errorCode?Dashboard.alert({message:Globalize.translate("ErrorMessagePasswordNotMatchConfirm")}):"USERNAME_IN_USE"==result.errorCode?Dashboard.alert({message:Globalize.translate("ErrorMessageUsernameInUse")}):"EMAIL_IN_USE"==result.errorCode?Dashboard.alert({message:Globalize.translate("ErrorMessageEmailInUse")}):Dashboard.alert({message:Globalize.translate("DefaultErrorMessage")})}),e.preventDefault(),!1}function goBack(){require(["appRouter"],function(appRouter){appRouter.back()})}view.querySelector(".btnSkipConnect").addEventListener("click",skip),view.querySelector(".connectLoginForm").addEventListener("submit",onSubmit),view.querySelector(".manualServerForm").addEventListener("submit",onManualServerSubmit),view.querySelector(".signupForm").addEventListener("submit",onSignupFormSubmit),view.querySelector(".btnSignupForConnect").addEventListener("click",function(e){if(supportInAppSignup())return e.preventDefault(),e.stopPropagation(),Dashboard.navigate("connectlogin.html?mode=signup"),!1}),view.querySelector(".btnCancelSignup").addEventListener("click",goBack),view.querySelector(".btnCancelManualServer").addEventListener("click",goBack),view.querySelector(".btnWelcomeNext").addEventListener("click",function(){Dashboard.navigate("connectlogin.html?mode=connect")});var terms=view.querySelector(".terms");terms.innerHTML=Globalize.translate("LoginDisclaimer")+"",AppInfo.isNativeApp?(terms.classList.add("hide"),view.querySelector(".tvAppInfo").classList.add("hide")):(terms.classList.remove("hide"),view.querySelector(".tvAppInfo").classList.remove("hide")),view.addEventListener("viewbeforeshow",function(){var page=this;if(page.querySelector("#txtSignupEmail").value="",page.querySelector("#txtSignupUsername").value="",page.querySelector("#txtSignupPassword").value="",page.querySelector("#txtSignupPasswordConfirm").value="",browserInfo.safari&&AppInfo.isNativeApp)page.querySelector(".embyIntroDownloadMessage").innerHTML=Globalize.translate("EmbyIntroDownloadMessageWithoutLink");else{page.querySelector(".embyIntroDownloadMessage").innerHTML=Globalize.translate("EmbyIntroDownloadMessage",'http://emby.media')}}),view.addEventListener("viewshow",function(){loadPage(view,params)})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/dashboardpage.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/dashboardpage.js index ecb021bd45..e1ba3b217b 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/dashboardpage.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/dashboardpage.js @@ -1,2 +1,2 @@ -define(["datetime","jQuery","events","itemHelper","serverNotifications","dom","globalize","loading","connectionManager","playMethodHelper","libraryBrowser","cardBuilder","imageLoader","components/activitylog","humanedate","listViewStyle","emby-linkbutton","flexStyles","buttonenabled","emby-button","emby-itemscontainer"],function(datetime,$,events,itemHelper,serverNotifications,dom,globalize,loading,connectionManager,playMethodHelper,libraryBrowser,cardBuilder,imageLoader,ActivityLog){"use strict";function onConnectionHelpClick(e){return e.preventDefault(),!1}function onEditServerNameClick(e){var page=dom.parentWithClass(this,"page");return require(["prompt"],function(prompt){prompt({label:globalize.translate("LabelFriendlyServerName"),description:globalize.translate("LabelFriendlyServerNameHelp"),value:page.querySelector(".serverNameHeader").innerHTML,confirmText:globalize.translate("ButtonSave")}).then(function(value){loading.show(),ApiClient.getServerConfiguration().then(function(config){config.ServerName=value,ApiClient.updateServerConfiguration(config).then(function(){page.querySelector(".serverNameHeader").innerHTML=value,loading.hide()})})})}),e.preventDefault(),!1}function showPlaybackInfo(btn,session){require(["alert"],function(alert){var showTranscodeReasons,title,text=[],displayPlayMethod=playMethodHelper.getDisplayPlayMethod(session),isDirectStream="DirectStream"===displayPlayMethod,isTranscode="Transcode"===displayPlayMethod;isDirectStream?(title=globalize.translate("sharedcomponents#DirectStreaming"),text.push(globalize.translate("sharedcomponents#DirectStreamHelp1")),text.push("
    "),text.push(globalize.translate("sharedcomponents#DirectStreamHelp2"))):isTranscode&&(title=globalize.translate("sharedcomponents#Transcoding"),text.push(globalize.translate("sharedcomponents#MediaIsBeingConverted")),session.TranscodingInfo&&session.TranscodingInfo.TranscodeReasons&&session.TranscodingInfo.TranscodeReasons.length&&(text.push("
    "),text.push(globalize.translate("sharedcomponents#LabelReasonForTranscoding")),showTranscodeReasons=!0)),showTranscodeReasons&&session.TranscodingInfo.TranscodeReasons.forEach(function(t){text.push(globalize.translate("sharedcomponents#"+t))}),alert({text:text.join("
    "),title:title})})}function showSendMessageForm(btn,session){require(["prompt"],function(prompt){prompt({title:globalize.translate("HeaderSendMessage"),label:globalize.translate("LabelMessageText"),confirmText:globalize.translate("ButtonSend")}).then(function(text){if(text){var apiClient=connectionManager.getApiClient(session.ServerId);apiClient.sendMessageCommand(session.Id,{Text:text,TimeoutMs:5e3})}})})}function showOptionsMenu(btn,session){require(["actionsheet"],function(actionsheet){var menuItems=[];return session.ServerId&&session.DeviceId!==connectionManager.deviceId()&&menuItems.push({name:globalize.translate("SendMessage"),id:"sendmessage"}),session.TranscodingInfo&&session.TranscodingInfo.TranscodeReasons&&session.TranscodingInfo.TranscodeReasons.length&&menuItems.push({name:globalize.translate("ViewPlaybackInfo"),id:"transcodinginfo"}),actionsheet.show({items:menuItems,positionTo:btn}).then(function(id){switch(id){case"sendmessage":showSendMessageForm(btn,session);break;case"transcodinginfo":showPlaybackInfo(btn,session)}})})}function onActiveDevicesClick(e){var btn=dom.parentWithClass(e.target,"sessionCardButton");if(btn){var card=dom.parentWithClass(btn,"card");if(card){var sessionId=card.id,session=(DashboardPage.sessionsList||[]).filter(function(s){return"session"+s.Id===sessionId})[0];session&&(btn.classList.contains("btnCardOptions")?showOptionsMenu(btn,session):btn.classList.contains("btnSessionInfo")?showPlaybackInfo(btn,session):btn.classList.contains("btnSessionSendMessage")?showSendMessageForm(btn,session):btn.classList.contains("btnSessionStop")?connectionManager.getApiClient(session.ServerId).sendPlayStateCommand(session.Id,"Stop"):btn.classList.contains("btnSessionPlayPause")&&session.PlayState&&connectionManager.getApiClient(session.ServerId).sendPlayStateCommand(session.Id,"PlayPause"))}}}function filterSessions(sessions){for(var list=[],i=0,length=sessions.length;i'+globalize.translate("PleaseUpdateManually")+""),DashboardPage.renderPaths(view,systemInfo),renderHasPendingRestart(view,apiClient,systemInfo.HasPendingRestart)})}function renderInfo(view,sessions,forceUpdate){sessions=filterSessions(sessions),renderActiveConnections(view,sessions),DashboardPage.renderPluginUpdateInfo(view,forceUpdate),loading.hide()}function pollForInfo(view,apiClient,forceUpdate){apiClient.getSessions().then(function(sessions){renderInfo(view,sessions,forceUpdate)}),apiClient.getScheduledTasks().then(function(tasks){renderRunningTasks(view,tasks)})}function renderActiveConnections(view,sessions){var html="";DashboardPage.sessionsList=sessions;var parentElement=view.querySelector(".activeDevices");$(".card",parentElement).addClass("deadSession");for(var i=0,length=sessions.length;i',html+='
    ',html+='
    ',html+='
    ',html+='
    ';var imgUrl=DashboardPage.getNowPlayingImageUrl(nowPlayingItem);imgUrl?(html+='
    ',html+='
    '+session.DeviceName+"
    ",html+='
    '+DashboardPage.getAppSecondaryText(session)+"
    ",html+="
    ",html+="
    ",html+='
    '+DashboardPage.getSessionNowPlayingTime(session)+"
    ",html+=session.TranscodingInfo&&session.TranscodingInfo.Framerate?'
    '+session.TranscodingInfo.Framerate+" fps
    ":'
    ';var nowPlayingName=DashboardPage.getNowPlayingName(session);if(html+='
    ',html+=nowPlayingName.html,html+="
    ",nowPlayingItem&&nowPlayingItem.RunTimeTicks){var position=session.PlayState.PositionTicks||0,value=100*position/nowPlayingItem.RunTimeTicks;html+=''}else html+='';html+=session.TranscodingInfo&&session.TranscodingInfo.CompletionPercentage?'':'',html+="
    ",html+="
    ",html+="",html+='
    ',html+='
    ';var btnCssClass;btnCssClass=session.ServerId&&session.NowPlayingItem&&session.SupportsRemoteControl&&session.DeviceId!==connectionManager.deviceId()?"":" hide",html+='',html+='',btnCssClass=session.TranscodingInfo&&session.TranscodingInfo.TranscodeReasons&&session.TranscodingInfo&&session.TranscodingInfo.TranscodeReasons.length?"":" hide",html+='',btnCssClass=session.ServerId&&session.SupportedCommands.indexOf("DisplayMessage")!==-1&&session.DeviceId!==connectionManager.deviceId()?"":" hide",html+='',html+="
    ",html+='
    ',html+=DashboardPage.getSessionNowPlayingStreamInfo(session),html+="
    ",html+='
    ';var userImage=DashboardPage.getUserImage(session);html+=userImage?'':'
    ',html+='
    ',html+=DashboardPage.getUsersHtml(session)||" ",html+="
    ",html+="
    ",html+="
    ",html+="",html+=""}}parentElement.insertAdjacentHTML("beforeend",html),$(".deadSession",parentElement).remove()}function renderRunningTasks(view,tasks){var html="";tasks=tasks.filter(function(t){return"Idle"!=t.State&&!t.IsHidden}),tasks.length?view.querySelector(".runningTasksContainer").classList.remove("hide"):view.querySelector(".runningTasksContainer").classList.add("hide"),tasks.filter(function(t){return t.Key==DashboardPage.systemUpdateTaskKey}).length?$("#btnUpdateApplication",view).buttonEnabled(!1):$("#btnUpdateApplication",view).buttonEnabled(!0);for(var i=0,length=tasks.length;i",html+=task.Name+"
    ","Running"==task.State){var progress=(task.CurrentProgressPercentage||0).toFixed(1);html+='',html+=""+progress+"%",html+="",html+=""+progress+"%",html+=''}else"Cancelling"==task.State&&(html+=''+globalize.translate("LabelStopping")+"");html+="

    "}view.querySelector("#divRunningTasks").innerHTML=html}return window.DashboardPage={newsStartIndex:0,renderPaths:function(page,systemInfo){$("#cachePath",page).html(systemInfo.CachePath),$("#logPath",page).html(systemInfo.LogPath),$("#transcodingTemporaryPath",page).html(systemInfo.TranscodingTempPath),$("#metadataPath",page).html(systemInfo.InternalMetadataPath)},reloadNews:function(page){var query={StartIndex:DashboardPage.newsStartIndex,Limit:4};ApiClient.getProductNews(query).then(function(result){var html=result.Items.map(function(item){var itemHtml="";itemHtml+='',itemHtml+='
    ',itemHtml+='dvr',itemHtml+='
    ',itemHtml+='
    ',itemHtml+=item.Title,itemHtml+="
    ",itemHtml+='
    ';var date=datetime.parseISO8601Date(item.Date,!0);return itemHtml+=datetime.toLocaleDateString(date),itemHtml+="
    ",itemHtml+="
    ",itemHtml+="
    ",itemHtml+="
    "}),pagingHtml="";pagingHtml+="
    ",pagingHtml+=libraryBrowser.getQueryPagingHtml({startIndex:query.StartIndex,limit:query.Limit,totalRecordCount:result.TotalRecordCount,showLimit:!1,updatePageSizeSetting:!1}),pagingHtml+="
    ",html=html.join("")+pagingHtml;var elem=$(".latestNewsItems",page).html(html);$(".btnNextPage",elem).on("click",function(){DashboardPage.newsStartIndex+=query.Limit,DashboardPage.reloadNews(page)}),$(".btnPreviousPage",elem).on("click",function(){DashboardPage.newsStartIndex-=query.Limit,DashboardPage.reloadNews(page)})})},startInterval:function(apiClient){apiClient.sendMessage("SessionsStart","0,1500"),apiClient.sendMessage("ScheduledTasksInfoStart","0,1000")},stopInterval:function(apiClient){apiClient.sendMessage("SessionsStop"),apiClient.sendMessage("ScheduledTasksInfoStop")},getSessionNowPlayingStreamInfo:function(session){var html="",showTranscodingInfo=!1,showMoreInfoButton=!1,displayPlayMethod=playMethodHelper.getDisplayPlayMethod(session);if("DirectStream"===displayPlayMethod?(html+=globalize.translate("sharedcomponents#DirectStreaming"),showMoreInfoButton=!0):"Transcode"==displayPlayMethod?(html+=globalize.translate("sharedcomponents#Transcoding"),session.TranscodingInfo&&session.TranscodingInfo.Framerate&&(html+=" ("+session.TranscodingInfo.Framerate+" fps)"),showTranscodingInfo=!0,showMoreInfoButton=!0):"DirectPlay"==displayPlayMethod&&(html+=globalize.translate("sharedcomponents#DirectPlaying")),showTranscodingInfo){var line=[];session.TranscodingInfo&&(session.TranscodingInfo.Bitrate&&(session.TranscodingInfo.Bitrate>1e6?line.push((session.TranscodingInfo.Bitrate/1e6).toFixed(1)+" Mbps"):line.push(Math.floor(session.TranscodingInfo.Bitrate/1e3)+" kbps")),session.TranscodingInfo.Container&&line.push(session.TranscodingInfo.Container),session.TranscodingInfo.VideoCodec&&line.push(session.TranscodingInfo.VideoCodec),session.TranscodingInfo.AudioCodec&&session.TranscodingInfo.AudioCodec!=session.TranscodingInfo.Container&&line.push(session.TranscodingInfo.AudioCodec)),line.length&&(html+=" - "+line.join(" "))}return html||" "},getSessionNowPlayingTime:function(session){var nowPlayingItem=session.NowPlayingItem,html="";return nowPlayingItem?(html+=session.PlayState.PositionTicks?datetime.getDisplayRunningTime(session.PlayState.PositionTicks):"--:--:--",html+=" / ",html+=nowPlayingItem&&nowPlayingItem.RunTimeTicks?datetime.getDisplayRunningTime(nowPlayingItem.RunTimeTicks):"--:--:--"):html},getAppSecondaryText:function(session){return session.Client+" "+session.ApplicationVersion},getNowPlayingName:function(session){var imgUrl="",nowPlayingItem=session.NowPlayingItem;if(!nowPlayingItem)return{html:"Last seen "+humane_date(session.LastActivityDate),image:imgUrl};var topText=itemHelper.getDisplayName(nowPlayingItem),bottomText="";nowPlayingItem.Artists&&nowPlayingItem.Artists.length?(bottomText=topText,topText=nowPlayingItem.Artists[0]):nowPlayingItem.SeriesName||nowPlayingItem.Album?(bottomText=topText,topText=nowPlayingItem.SeriesName||nowPlayingItem.Album):nowPlayingItem.ProductionYear&&(bottomText=nowPlayingItem.ProductionYear),nowPlayingItem.ImageTags&&nowPlayingItem.ImageTags.Logo?imgUrl=ApiClient.getScaledImageUrl(nowPlayingItem.Id,{tag:nowPlayingItem.ImageTags.Logo,maxHeight:24,maxWidth:130,type:"Logo"}):nowPlayingItem.ParentLogoImageTag&&(imgUrl=ApiClient.getScaledImageUrl(nowPlayingItem.ParentLogoItemId,{tag:nowPlayingItem.ParentLogoImageTag,maxHeight:24,maxWidth:130,type:"Logo"})),imgUrl&&(topText='');var text=bottomText?topText+"
    "+bottomText:topText;return{html:text,image:imgUrl}},getUsersHtml:function(session){var html=[];session.UserId&&html.push(session.UserName);for(var i=0,length=session.AdditionalUsers.length;i";if("dashboard"==clientLowered||"emby web client"==clientLowered){var imgUrl;return imgUrl=device.indexOf("chrome")!=-1?"css/images/clients/chrome.png":"css/images/clients/html5.png","Emby Web Client"}return clientLowered.indexOf("android")!=-1?"":clientLowered.indexOf("ios")!=-1?"":"mb-classic"==clientLowered?"":"roku"==clientLowered?"":"dlna"==clientLowered?"":"kodi"==clientLowered||"xbmc"==clientLowered?"":"chromecast"==clientLowered?"":null},getNowPlayingImageUrl:function(item){if(item&&item.BackdropImageTags&&item.BackdropImageTags.length)return ApiClient.getScaledImageUrl(item.Id,{type:"Backdrop",width:275,tag:item.BackdropImageTags[0]});if(item&&item.ParentBackdropImageTags&&item.ParentBackdropImageTags.length)return ApiClient.getScaledImageUrl(item.ParentBackdropItemId,{type:"Backdrop",width:275,tag:item.ParentBackdropImageTags[0]});if(item&&item.BackdropImageTag)return ApiClient.getScaledImageUrl(item.BackdropItemId,{type:"Backdrop",width:275,tag:item.BackdropImageTag});var imageTags=(item||{}).ImageTags||{};return item&&imageTags.Thumb?ApiClient.getScaledImageUrl(item.Id,{type:"Thumb",width:275,tag:imageTags.Thumb}):item&&item.ParentThumbImageTag?ApiClient.getScaledImageUrl(item.ParentThumbItemId,{type:"Thumb",width:275,tag:item.ParentThumbImageTag}):item&&item.ThumbImageTag?ApiClient.getScaledImageUrl(item.ThumbItemId,{type:"Thumb",width:275,tag:item.ThumbImageTag}):item&&imageTags.Primary?ApiClient.getScaledImageUrl(item.Id,{type:"Primary",width:275,tag:imageTags.Primary}):item&&item.PrimaryImageTag?ApiClient.getScaledImageUrl(item.PrimaryImageItemId,{type:"Primary",width:275,tag:item.PrimaryImageTag}):null},systemUpdateTaskKey:"SystemUpdateTask",renderUrls:function(page,systemInfo){var helpButton=''+globalize.translate("ButtonHelp")+"";if(systemInfo.LocalAddress){var localAccessHtml=globalize.translate("LabelLocalAccessUrl",''+systemInfo.LocalAddress+"");$(".localUrl",page).html(localAccessHtml+helpButton).show()}else $(".externalUrl",page).hide();if(systemInfo.WanAddress){var externalUrl=systemInfo.WanAddress,remoteAccessHtml=globalize.translate("LabelRemoteAccessUrl",''+externalUrl+"");$(".externalUrl",page).html(remoteAccessHtml+helpButton).show()}else $(".externalUrl",page).hide()},renderSupporterIcon:function(page,pluginSecurityInfo){var imgUrl,text,supporterIconContainer=page.querySelector(".supporterIconContainer");pluginSecurityInfo.IsMBSupporter?(supporterIconContainer.classList.remove("hide"),imgUrl="css/images/supporter/supporterbadge.png",text=globalize.translate("MessageThankYouForSupporting"),supporterIconContainer.innerHTML=''+text+""):supporterIconContainer.classList.add("hide")},renderPendingInstallations:function(page,systemInfo){if(!systemInfo.CompletedInstallations.length)return void page.querySelector("#collapsiblePendingInstallations").classList.add("hide");page.querySelector("#collapsiblePendingInstallations").classList.remove("hide");for(var html="",i=0,length=systemInfo.CompletedInstallations.length;i"+update.Name+" ("+update.Version+")"}$("#pendingInstallations",page).html(html)},renderPluginUpdateInfo:function(page,forceUpdate){!forceUpdate&&DashboardPage.lastPluginUpdateCheck&&(new Date).getTime()-DashboardPage.lastPluginUpdateCheck<18e5||(DashboardPage.lastPluginUpdateCheck=(new Date).getTime(),ApiClient.getAvailablePluginUpdates().then(function(updates){var elem=page.querySelector("#pPluginUpdates");if(!updates.length)return void $(elem).hide();$(elem).show();for(var html="",i=0,length=updates.length;i"+globalize.translate("NewVersionOfSomethingAvailable").replace("{0}",update.name)+"

    ",html+='"}elem.innerHTML=html}))},installPluginUpdate:function(button){$(button).buttonEnabled(!1);var name=button.getAttribute("data-name"),guid=button.getAttribute("data-guid"),version=button.getAttribute("data-version"),classification=button.getAttribute("data-classification");loading.show(),ApiClient.installPlugin(name,guid,classification,version).then(function(){loading.hide()})},updateApplication:function(){var page=$($.mobile.activePage)[0];$("#btnUpdateApplication",page).buttonEnabled(!1),loading.show(),ApiClient.getScheduledTasks().then(function(tasks){var task=tasks.filter(function(t){return t.Key==DashboardPage.systemUpdateTaskKey})[0];ApiClient.startScheduledTask(task.Id).then(function(){pollForInfo(page,ApiClient),loading.hide()})})},stopTask:function(id){var page=$($.mobile.activePage)[0];ApiClient.stopScheduledTask(id).then(function(){pollForInfo(page,ApiClient)})},restart:function(){require(["confirm"],function(confirm){confirm({title:globalize.translate("HeaderRestart"),text:globalize.translate("MessageConfirmRestart"),confirmText:globalize.translate("ButtonRestart"),primary:"cancel"}).then(function(){$("#btnRestartServer").buttonEnabled(!1),$("#btnShutdown").buttonEnabled(!1),Dashboard.restartServer()})})},shutdown:function(){require(["confirm"],function(confirm){confirm({title:globalize.translate("HeaderShutdown"),text:globalize.translate("MessageConfirmShutdown"),confirmText:globalize.translate("ButtonShutdown"),primary:"cancel"}).then(function(){$("#btnRestartServer").buttonEnabled(!1),$("#btnShutdown").buttonEnabled(!1),ApiClient.shutdownServer()})})}},pageClassOn("pageshow","type-interior",function(){var page=this;getPluginSecurityInfo().then(function(pluginSecurityInfo){if(!page.querySelector(".customSupporterPromotion")&&($(".supporterPromotion",page).remove(),!pluginSecurityInfo.IsMBSupporter)){var html='",page.querySelector(".content-primary").insertAdjacentHTML("afterbegin",html)}})}),function(view,params){function onRestartRequired(e,apiClient){apiClient.serverId()===serverId&&renderHasPendingRestart(view,apiClient,!0)}function onServerShuttingDown(e,apiClient){apiClient.serverId()===serverId&&renderHasPendingRestart(view,apiClient,!0)}function onServerRestarting(e,apiClient){apiClient.serverId()===serverId&&renderHasPendingRestart(view,apiClient,!0)}function onPackageInstalling(e,apiClient){apiClient.serverId()===serverId&&(pollForInfo(view,apiClient,!0),reloadSystemInfo(view,apiClient))}function onPackageInstallationCompleted(e,apiClient){apiClient.serverId()===serverId&&(pollForInfo(view,apiClient,!0),reloadSystemInfo(view,apiClient))}function onSessionsUpdate(e,apiClient,info){apiClient.serverId()===serverId&&renderInfo(view,info)}function onScheduledTasksUpdate(e,apiClient,info){apiClient.serverId()===serverId&&renderRunningTasks(view,info)}var serverId=ApiClient.serverId();view.querySelector(".btnConnectionHelp").addEventListener("click",onConnectionHelpClick),view.querySelector(".btnEditServerName").addEventListener("click",onEditServerNameClick),view.querySelector(".activeDevices").addEventListener("click",onActiveDevicesClick),view.addEventListener("viewshow",function(){var page=this,apiClient=ApiClient;apiClient&&(DashboardPage.newsStartIndex=0,loading.show(),pollForInfo(page,apiClient),DashboardPage.startInterval(apiClient),events.on(serverNotifications,"RestartRequired",onRestartRequired),events.on(serverNotifications,"ServerShuttingDown",onServerShuttingDown),events.on(serverNotifications,"ServerRestarting",onServerRestarting),events.on(serverNotifications,"PackageInstalling",onPackageInstalling),events.on(serverNotifications,"PackageInstallationCompleted",onPackageInstallationCompleted),events.on(serverNotifications,"Sessions",onSessionsUpdate),events.on(serverNotifications,"ScheduledTasksInfo",onScheduledTasksUpdate), -DashboardPage.lastAppUpdateCheck=null,DashboardPage.lastPluginUpdateCheck=null,getPluginSecurityInfo().then(function(pluginSecurityInfo){DashboardPage.renderSupporterIcon(page,pluginSecurityInfo)}),reloadSystemInfo(page,ApiClient),DashboardPage.reloadNews(page),page.activityLog||(page.activityLog=new ActivityLog({serverId:ApiClient.serverId(),element:page.querySelector(".activityItems")})),page.querySelector(".swaggerLink").setAttribute("href","http://swagger.emby.media?url="+ApiClient.getUrl("swagger")),refreshActiveRecordings(view,apiClient))}),view.addEventListener("viewbeforehide",function(){var page=this,activityLog=page.activityLog;activityLog&&activityLog.destroy(),page.activityLog=null;var apiClient=ApiClient;events.off(serverNotifications,"RestartRequired",onRestartRequired),events.off(serverNotifications,"ServerShuttingDown",onServerShuttingDown),events.off(serverNotifications,"ServerRestarting",onServerRestarting),events.off(serverNotifications,"PackageInstalling",onPackageInstalling),events.off(serverNotifications,"PackageInstallationCompleted",onPackageInstallationCompleted),events.off(serverNotifications,"Sessions",onSessionsUpdate),events.off(serverNotifications,"ScheduledTasksInfo",onScheduledTasksUpdate),apiClient&&DashboardPage.stopInterval(apiClient)})}}); \ No newline at end of file +define(["datetime","jQuery","events","itemHelper","serverNotifications","dom","globalize","loading","connectionManager","playMethodHelper","libraryBrowser","cardBuilder","imageLoader","components/activitylog","humanedate","listViewStyle","emby-linkbutton","flexStyles","buttonenabled","emby-button","emby-itemscontainer"],function(datetime,$,events,itemHelper,serverNotifications,dom,globalize,loading,connectionManager,playMethodHelper,libraryBrowser,cardBuilder,imageLoader,ActivityLog){"use strict";function onConnectionHelpClick(e){return e.preventDefault(),!1}function onEditServerNameClick(e){var page=dom.parentWithClass(this,"page");return require(["prompt"],function(prompt){prompt({label:globalize.translate("LabelFriendlyServerName"),description:globalize.translate("LabelFriendlyServerNameHelp"),value:page.querySelector(".serverNameHeader").innerHTML,confirmText:globalize.translate("ButtonSave")}).then(function(value){loading.show(),ApiClient.getServerConfiguration().then(function(config){config.ServerName=value,ApiClient.updateServerConfiguration(config).then(function(){page.querySelector(".serverNameHeader").innerHTML=value,loading.hide()})})})}),e.preventDefault(),!1}function showPlaybackInfo(btn,session){require(["alert"],function(alert){var showTranscodeReasons,title,text=[],displayPlayMethod=playMethodHelper.getDisplayPlayMethod(session),isDirectStream="DirectStream"===displayPlayMethod,isTranscode="Transcode"===displayPlayMethod;isDirectStream?(title=globalize.translate("sharedcomponents#DirectStreaming"),text.push(globalize.translate("sharedcomponents#DirectStreamHelp1")),text.push("
    "),text.push(globalize.translate("sharedcomponents#DirectStreamHelp2"))):isTranscode&&(title=globalize.translate("sharedcomponents#Transcoding"),text.push(globalize.translate("sharedcomponents#MediaIsBeingConverted")),session.TranscodingInfo&&session.TranscodingInfo.TranscodeReasons&&session.TranscodingInfo.TranscodeReasons.length&&(text.push("
    "),text.push(globalize.translate("sharedcomponents#LabelReasonForTranscoding")),showTranscodeReasons=!0)),showTranscodeReasons&&session.TranscodingInfo.TranscodeReasons.forEach(function(t){text.push(globalize.translate("sharedcomponents#"+t))}),alert({text:text.join("
    "),title:title})})}function showSendMessageForm(btn,session){require(["prompt"],function(prompt){prompt({title:globalize.translate("HeaderSendMessage"),label:globalize.translate("LabelMessageText"),confirmText:globalize.translate("ButtonSend")}).then(function(text){if(text){connectionManager.getApiClient(session.ServerId).sendMessageCommand(session.Id,{Text:text,TimeoutMs:5e3})}})})}function showOptionsMenu(btn,session){require(["actionsheet"],function(actionsheet){var menuItems=[];return session.ServerId&&session.DeviceId!==connectionManager.deviceId()&&menuItems.push({name:globalize.translate("SendMessage"),id:"sendmessage"}),session.TranscodingInfo&&session.TranscodingInfo.TranscodeReasons&&session.TranscodingInfo.TranscodeReasons.length&&menuItems.push({name:globalize.translate("ViewPlaybackInfo"),id:"transcodinginfo"}),actionsheet.show({items:menuItems,positionTo:btn}).then(function(id){switch(id){case"sendmessage":showSendMessageForm(btn,session);break;case"transcodinginfo":showPlaybackInfo(btn,session)}})})}function onActiveDevicesClick(e){var btn=dom.parentWithClass(e.target,"sessionCardButton");if(btn){var card=dom.parentWithClass(btn,"card");if(card){var sessionId=card.id,session=(DashboardPage.sessionsList||[]).filter(function(s){return"session"+s.Id===sessionId})[0];session&&(btn.classList.contains("btnCardOptions")?showOptionsMenu(btn,session):btn.classList.contains("btnSessionInfo")?showPlaybackInfo(btn,session):btn.classList.contains("btnSessionSendMessage")?showSendMessageForm(btn,session):btn.classList.contains("btnSessionStop")?connectionManager.getApiClient(session.ServerId).sendPlayStateCommand(session.Id,"Stop"):btn.classList.contains("btnSessionPlayPause")&&session.PlayState&&connectionManager.getApiClient(session.ServerId).sendPlayStateCommand(session.Id,"PlayPause"))}}}function filterSessions(sessions){for(var list=[],i=0,length=sessions.length;i'+globalize.translate("PleaseUpdateManually")+""),DashboardPage.renderPaths(view,systemInfo),renderHasPendingRestart(view,apiClient,systemInfo.HasPendingRestart)})}function renderInfo(view,sessions,forceUpdate){sessions=filterSessions(sessions),renderActiveConnections(view,sessions),DashboardPage.renderPluginUpdateInfo(view,forceUpdate),loading.hide()}function pollForInfo(view,apiClient,forceUpdate){apiClient.getSessions().then(function(sessions){renderInfo(view,sessions,forceUpdate)}),apiClient.getScheduledTasks().then(function(tasks){renderRunningTasks(view,tasks)})}function renderActiveConnections(view,sessions){var html="";DashboardPage.sessionsList=sessions;var parentElement=view.querySelector(".activeDevices");$(".card",parentElement).addClass("deadSession");for(var i=0,length=sessions.length;i',html+='
    ',html+='
    ',html+='
    ',html+='
    ';var imgUrl=DashboardPage.getNowPlayingImageUrl(nowPlayingItem);imgUrl?(html+='
    ',html+='
    '+session.DeviceName+"
    ",html+='
    '+DashboardPage.getAppSecondaryText(session)+"
    ",html+="
    ",html+="
    ",html+='
    '+DashboardPage.getSessionNowPlayingTime(session)+"
    ",session.TranscodingInfo&&session.TranscodingInfo.Framerate?html+='
    '+session.TranscodingInfo.Framerate+" fps
    ":html+='
    ';var nowPlayingName=DashboardPage.getNowPlayingName(session);if(html+='
    ',html+=nowPlayingName.html,html+="
    ",nowPlayingItem&&nowPlayingItem.RunTimeTicks){html+=''}else html+='';session.TranscodingInfo&&session.TranscodingInfo.CompletionPercentage?html+='':html+='',html+="
    ",html+="
    ",html+="",html+='
    ',html+='
    ';var btnCssClass;btnCssClass=session.ServerId&&session.NowPlayingItem&&session.SupportsRemoteControl&&session.DeviceId!==connectionManager.deviceId()?"":" hide",html+='',html+='',btnCssClass=session.TranscodingInfo&&session.TranscodingInfo.TranscodeReasons&&session.TranscodingInfo&&session.TranscodingInfo.TranscodeReasons.length?"":" hide",html+='',btnCssClass=session.ServerId&&-1!==session.SupportedCommands.indexOf("DisplayMessage")&&session.DeviceId!==connectionManager.deviceId()?"":" hide",html+='',html+="
    ",html+='
    ',html+=DashboardPage.getSessionNowPlayingStreamInfo(session),html+="
    ",html+='
    ';var userImage=DashboardPage.getUserImage(session);html+=userImage?'':'
    ',html+='
    ',html+=DashboardPage.getUsersHtml(session)||" ",html+="
    ",html+="
    ",html+="
    ",html+="",html+=""}}parentElement.insertAdjacentHTML("beforeend",html),$(".deadSession",parentElement).remove()}function renderRunningTasks(view,tasks){var html="";tasks=tasks.filter(function(t){return"Idle"!=t.State&&!t.IsHidden}),tasks.length?view.querySelector(".runningTasksContainer").classList.remove("hide"):view.querySelector(".runningTasksContainer").classList.add("hide"),tasks.filter(function(t){return t.Key==DashboardPage.systemUpdateTaskKey}).length?$("#btnUpdateApplication",view).buttonEnabled(!1):$("#btnUpdateApplication",view).buttonEnabled(!0);for(var i=0,length=tasks.length;i",html+=task.Name+"
    ","Running"==task.State){var progress=(task.CurrentProgressPercentage||0).toFixed(1);html+='',html+=progress+"%",html+="",html+=""+progress+"%",html+=''}else"Cancelling"==task.State&&(html+=''+globalize.translate("LabelStopping")+"");html+="

    "}view.querySelector("#divRunningTasks").innerHTML=html}return window.DashboardPage={newsStartIndex:0,renderPaths:function(page,systemInfo){$("#cachePath",page).html(systemInfo.CachePath),$("#logPath",page).html(systemInfo.LogPath),$("#transcodingTemporaryPath",page).html(systemInfo.TranscodingTempPath),$("#metadataPath",page).html(systemInfo.InternalMetadataPath)},reloadNews:function(page){var query={StartIndex:DashboardPage.newsStartIndex,Limit:4};ApiClient.getProductNews(query).then(function(result){var html=result.Items.map(function(item){var itemHtml="";itemHtml+='',itemHtml+='
    ',itemHtml+='dvr',itemHtml+='
    ',itemHtml+='
    ',itemHtml+=item.Title,itemHtml+="
    ",itemHtml+='
    ';var date=datetime.parseISO8601Date(item.Date,!0);return itemHtml+=datetime.toLocaleDateString(date),itemHtml+="
    ",itemHtml+="
    ",itemHtml+="
    ",itemHtml+="
    "}),pagingHtml="";pagingHtml+="
    ",pagingHtml+=libraryBrowser.getQueryPagingHtml({startIndex:query.StartIndex,limit:query.Limit,totalRecordCount:result.TotalRecordCount,showLimit:!1,updatePageSizeSetting:!1}),pagingHtml+="
    ",html=html.join("")+pagingHtml;var elem=$(".latestNewsItems",page).html(html);$(".btnNextPage",elem).on("click",function(){DashboardPage.newsStartIndex+=query.Limit,DashboardPage.reloadNews(page)}),$(".btnPreviousPage",elem).on("click",function(){DashboardPage.newsStartIndex-=query.Limit,DashboardPage.reloadNews(page)})})},startInterval:function(apiClient){apiClient.sendMessage("SessionsStart","0,1500"),apiClient.sendMessage("ScheduledTasksInfoStart","0,1000")},stopInterval:function(apiClient){apiClient.sendMessage("SessionsStop"),apiClient.sendMessage("ScheduledTasksInfoStop")},getSessionNowPlayingStreamInfo:function(session){var html="",showTranscodingInfo=!1,displayPlayMethod=playMethodHelper.getDisplayPlayMethod(session);if("DirectStream"===displayPlayMethod?(html+=globalize.translate("sharedcomponents#DirectStreaming"),!0):"Transcode"==displayPlayMethod?(html+=globalize.translate("sharedcomponents#Transcoding"),session.TranscodingInfo&&session.TranscodingInfo.Framerate&&(html+=" ("+session.TranscodingInfo.Framerate+" fps)"),showTranscodingInfo=!0,!0):"DirectPlay"==displayPlayMethod&&(html+=globalize.translate("sharedcomponents#DirectPlaying")),showTranscodingInfo){var line=[];session.TranscodingInfo&&(session.TranscodingInfo.Bitrate&&(session.TranscodingInfo.Bitrate>1e6?line.push((session.TranscodingInfo.Bitrate/1e6).toFixed(1)+" Mbps"):line.push(Math.floor(session.TranscodingInfo.Bitrate/1e3)+" kbps")),session.TranscodingInfo.Container&&line.push(session.TranscodingInfo.Container),session.TranscodingInfo.VideoCodec&&line.push(session.TranscodingInfo.VideoCodec),session.TranscodingInfo.AudioCodec&&session.TranscodingInfo.AudioCodec!=session.TranscodingInfo.Container&&line.push(session.TranscodingInfo.AudioCodec)),line.length&&(html+=" - "+line.join(" "))}return html||" "},getSessionNowPlayingTime:function(session){var nowPlayingItem=session.NowPlayingItem,html="";return nowPlayingItem?(session.PlayState.PositionTicks?html+=datetime.getDisplayRunningTime(session.PlayState.PositionTicks):html+="--:--:--",html+=" / ",nowPlayingItem&&nowPlayingItem.RunTimeTicks?html+=datetime.getDisplayRunningTime(nowPlayingItem.RunTimeTicks):html+="--:--:--",html):html},getAppSecondaryText:function(session){return session.Client+" "+session.ApplicationVersion},getNowPlayingName:function(session){var imgUrl="",nowPlayingItem=session.NowPlayingItem;if(!nowPlayingItem)return{html:"Last seen "+humane_date(session.LastActivityDate),image:imgUrl};var topText=itemHelper.getDisplayName(nowPlayingItem),bottomText="";return nowPlayingItem.Artists&&nowPlayingItem.Artists.length?(bottomText=topText,topText=nowPlayingItem.Artists[0]):nowPlayingItem.SeriesName||nowPlayingItem.Album?(bottomText=topText,topText=nowPlayingItem.SeriesName||nowPlayingItem.Album):nowPlayingItem.ProductionYear&&(bottomText=nowPlayingItem.ProductionYear),nowPlayingItem.ImageTags&&nowPlayingItem.ImageTags.Logo?imgUrl=ApiClient.getScaledImageUrl(nowPlayingItem.Id,{tag:nowPlayingItem.ImageTags.Logo,maxHeight:24,maxWidth:130,type:"Logo"}):nowPlayingItem.ParentLogoImageTag&&(imgUrl=ApiClient.getScaledImageUrl(nowPlayingItem.ParentLogoItemId,{tag:nowPlayingItem.ParentLogoImageTag,maxHeight:24,maxWidth:130,type:"Logo"})),imgUrl&&(topText=''),{html:bottomText?topText+"
    "+bottomText:topText,image:imgUrl}},getUsersHtml:function(session){var html=[];session.UserId&&html.push(session.UserName);for(var i=0,length=session.AdditionalUsers.length;i";if("dashboard"==clientLowered||"emby web client"==clientLowered){return"Emby Web Client"}return-1!=clientLowered.indexOf("android")?"":-1!=clientLowered.indexOf("ios")?"":"mb-classic"==clientLowered?"":"roku"==clientLowered?"":"dlna"==clientLowered?"":"kodi"==clientLowered||"xbmc"==clientLowered?"":"chromecast"==clientLowered?"":null},getNowPlayingImageUrl:function(item){if(item&&item.BackdropImageTags&&item.BackdropImageTags.length)return ApiClient.getScaledImageUrl(item.Id,{type:"Backdrop",width:275,tag:item.BackdropImageTags[0]});if(item&&item.ParentBackdropImageTags&&item.ParentBackdropImageTags.length)return ApiClient.getScaledImageUrl(item.ParentBackdropItemId,{type:"Backdrop",width:275,tag:item.ParentBackdropImageTags[0]});if(item&&item.BackdropImageTag)return ApiClient.getScaledImageUrl(item.BackdropItemId,{type:"Backdrop",width:275,tag:item.BackdropImageTag});var imageTags=(item||{}).ImageTags||{};return item&&imageTags.Thumb?ApiClient.getScaledImageUrl(item.Id,{type:"Thumb",width:275,tag:imageTags.Thumb}):item&&item.ParentThumbImageTag?ApiClient.getScaledImageUrl(item.ParentThumbItemId,{type:"Thumb",width:275,tag:item.ParentThumbImageTag}):item&&item.ThumbImageTag?ApiClient.getScaledImageUrl(item.ThumbItemId,{type:"Thumb",width:275,tag:item.ThumbImageTag}):item&&imageTags.Primary?ApiClient.getScaledImageUrl(item.Id,{type:"Primary",width:275,tag:imageTags.Primary}):item&&item.PrimaryImageTag?ApiClient.getScaledImageUrl(item.PrimaryImageItemId,{type:"Primary",width:275,tag:item.PrimaryImageTag}):null},systemUpdateTaskKey:"SystemUpdateTask",renderUrls:function(page,systemInfo){var helpButton=''+globalize.translate("ButtonHelp")+"";if(systemInfo.LocalAddress){var localAccessHtml=globalize.translate("LabelLocalAccessUrl",''+systemInfo.LocalAddress+"");$(".localUrl",page).html(localAccessHtml+helpButton).show()}else $(".externalUrl",page).hide();if(systemInfo.WanAddress){var externalUrl=systemInfo.WanAddress,remoteAccessHtml=globalize.translate("LabelRemoteAccessUrl",''+externalUrl+"");$(".externalUrl",page).html(remoteAccessHtml+helpButton).show()}else $(".externalUrl",page).hide()},renderSupporterIcon:function(page,pluginSecurityInfo){var imgUrl,text,supporterIconContainer=page.querySelector(".supporterIconContainer");pluginSecurityInfo.IsMBSupporter?(supporterIconContainer.classList.remove("hide"),imgUrl="css/images/supporter/supporterbadge.png",text=globalize.translate("MessageThankYouForSupporting"),supporterIconContainer.innerHTML=''+text+""):supporterIconContainer.classList.add("hide")},renderPendingInstallations:function(page,systemInfo){if(!systemInfo.CompletedInstallations.length)return void page.querySelector("#collapsiblePendingInstallations").classList.add("hide");page.querySelector("#collapsiblePendingInstallations").classList.remove("hide");for(var html="",i=0,length=systemInfo.CompletedInstallations.length;i"+update.Name+" ("+update.Version+")"}$("#pendingInstallations",page).html(html)},renderPluginUpdateInfo:function(page,forceUpdate){!forceUpdate&&DashboardPage.lastPluginUpdateCheck&&(new Date).getTime()-DashboardPage.lastPluginUpdateCheck<18e5||(DashboardPage.lastPluginUpdateCheck=(new Date).getTime(),ApiClient.getAvailablePluginUpdates().then(function(updates){var elem=page.querySelector("#pPluginUpdates");if(!updates.length)return void $(elem).hide();$(elem).show();for(var html="",i=0,length=updates.length;i"+globalize.translate("NewVersionOfSomethingAvailable").replace("{0}",update.name)+"

    ",html+='"}elem.innerHTML=html}))},installPluginUpdate:function(button){$(button).buttonEnabled(!1);var name=button.getAttribute("data-name"),guid=button.getAttribute("data-guid"),version=button.getAttribute("data-version"),classification=button.getAttribute("data-classification");loading.show(),ApiClient.installPlugin(name,guid,classification,version).then(function(){loading.hide()})},updateApplication:function(){var page=$($.mobile.activePage)[0];$("#btnUpdateApplication",page).buttonEnabled(!1),loading.show(),ApiClient.getScheduledTasks().then(function(tasks){var task=tasks.filter(function(t){return t.Key==DashboardPage.systemUpdateTaskKey})[0];ApiClient.startScheduledTask(task.Id).then(function(){pollForInfo(page,ApiClient),loading.hide()})})},stopTask:function(id){var page=$($.mobile.activePage)[0];ApiClient.stopScheduledTask(id).then(function(){pollForInfo(page,ApiClient)})},restart:function(){require(["confirm"],function(confirm){confirm({title:globalize.translate("HeaderRestart"),text:globalize.translate("MessageConfirmRestart"),confirmText:globalize.translate("ButtonRestart"),primary:"cancel"}).then(function(){$("#btnRestartServer").buttonEnabled(!1),$("#btnShutdown").buttonEnabled(!1),Dashboard.restartServer()})})},shutdown:function(){require(["confirm"],function(confirm){confirm({title:globalize.translate("HeaderShutdown"),text:globalize.translate("MessageConfirmShutdown"),confirmText:globalize.translate("ButtonShutdown"),primary:"cancel"}).then(function(){$("#btnRestartServer").buttonEnabled(!1),$("#btnShutdown").buttonEnabled(!1),ApiClient.shutdownServer()})})}},pageClassOn("pageshow","type-interior",function(){var page=this;getPluginSecurityInfo().then(function(pluginSecurityInfo){if(!page.querySelector(".customSupporterPromotion")&&($(".supporterPromotion",page).remove(),!pluginSecurityInfo.IsMBSupporter)){var html='",page.querySelector(".content-primary").insertAdjacentHTML("afterbegin",html)}})}),function(view,params){function onRestartRequired(e,apiClient){apiClient.serverId()===serverId&&renderHasPendingRestart(view,apiClient,!0)}function onServerShuttingDown(e,apiClient){apiClient.serverId()===serverId&&renderHasPendingRestart(view,apiClient,!0)}function onServerRestarting(e,apiClient){apiClient.serverId()===serverId&&renderHasPendingRestart(view,apiClient,!0)}function onPackageInstalling(e,apiClient){apiClient.serverId()===serverId&&(pollForInfo(view,apiClient,!0),reloadSystemInfo(view,apiClient))}function onPackageInstallationCompleted(e,apiClient){apiClient.serverId()===serverId&&(pollForInfo(view,apiClient,!0),reloadSystemInfo(view,apiClient))}function onSessionsUpdate(e,apiClient,info){apiClient.serverId()===serverId&&renderInfo(view,info)}function onScheduledTasksUpdate(e,apiClient,info){apiClient.serverId()===serverId&&renderRunningTasks(view,info)}var serverId=ApiClient.serverId();view.querySelector(".btnConnectionHelp").addEventListener("click",onConnectionHelpClick),view.querySelector(".btnEditServerName").addEventListener("click",onEditServerNameClick),view.querySelector(".activeDevices").addEventListener("click",onActiveDevicesClick),view.addEventListener("viewshow",function(){var page=this,apiClient=ApiClient;apiClient&&(DashboardPage.newsStartIndex=0,loading.show(),pollForInfo(page,apiClient),DashboardPage.startInterval(apiClient),events.on(serverNotifications,"RestartRequired",onRestartRequired),events.on(serverNotifications,"ServerShuttingDown",onServerShuttingDown),events.on(serverNotifications,"ServerRestarting",onServerRestarting),events.on(serverNotifications,"PackageInstalling",onPackageInstalling),events.on(serverNotifications,"PackageInstallationCompleted",onPackageInstallationCompleted),events.on(serverNotifications,"Sessions",onSessionsUpdate),events.on(serverNotifications,"ScheduledTasksInfo",onScheduledTasksUpdate),DashboardPage.lastAppUpdateCheck=null,DashboardPage.lastPluginUpdateCheck=null, +getPluginSecurityInfo().then(function(pluginSecurityInfo){DashboardPage.renderSupporterIcon(page,pluginSecurityInfo)}),reloadSystemInfo(page,ApiClient),DashboardPage.reloadNews(page),page.activityLog||(page.activityLog=new ActivityLog({serverId:ApiClient.serverId(),element:page.querySelector(".activityItems")})),page.querySelector(".swaggerLink").setAttribute("href","http://swagger.emby.media?url="+ApiClient.getUrl("swagger")),refreshActiveRecordings(view,apiClient))}),view.addEventListener("viewbeforehide",function(){var page=this,activityLog=page.activityLog;activityLog&&activityLog.destroy(),page.activityLog=null;var apiClient=ApiClient;events.off(serverNotifications,"RestartRequired",onRestartRequired),events.off(serverNotifications,"ServerShuttingDown",onServerShuttingDown),events.off(serverNotifications,"ServerRestarting",onServerRestarting),events.off(serverNotifications,"PackageInstalling",onPackageInstalling),events.off(serverNotifications,"PackageInstallationCompleted",onPackageInstallationCompleted),events.off(serverNotifications,"Sessions",onSessionsUpdate),events.off(serverNotifications,"ScheduledTasksInfo",onScheduledTasksUpdate),apiClient&&DashboardPage.stopInterval(apiClient)})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/device.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/device.js index 2fff6e45ff..76529dfa65 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/device.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/device.js @@ -1 +1 @@ -define(["jQuery","loading","libraryMenu"],function($,loading,libraryMenu){"use strict";function load(page,device,capabilities){capabilities.SupportsContentUploading?$("#fldCameraUploadPath",page).removeClass("hide"):$("#fldCameraUploadPath",page).addClass("hide"),$("#txtCustomName",page).val(device.CustomName||""),$("#txtUploadPath",page).val(device.CameraUploadPath||""),$(".reportedName",page).html(device.ReportedName||"")}function loadData(page){loading.show();var id=getParameterByName("id"),promise1=ApiClient.getJSON(ApiClient.getUrl("Devices/Info",{Id:id})),promise2=ApiClient.getJSON(ApiClient.getUrl("Devices/Capabilities",{Id:id}));Promise.all([promise1,promise2]).then(function(responses){load(page,responses[0],responses[1]),loading.hide()})}function save(page){var id=getParameterByName("id");ApiClient.ajax({url:ApiClient.getUrl("Devices/Options",{Id:id}),type:"POST",data:JSON.stringify({CustomName:$("#txtCustomName",page).val(),CameraUploadPath:$("#txtUploadPath",page).val()}),contentType:"application/json"}).then(Dashboard.processServerConfigurationUpdateResult)}function onSubmit(){var form=this,page=$(form).parents(".page");return save(page),!1}$(document).on("pageinit","#devicePage",function(){var page=this;$("#btnSelectUploadPath",page).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({callback:function(path){path&&$("#txtUploadPath",page).val(path),picker.close()},validateWriteable:!0,header:Globalize.translate("HeaderSelectUploadPath")})})}),$(".deviceForm").off("submit",onSubmit).on("submit",onSubmit)}).on("pageshow","#devicePage",function(){var page=this;loadData(page)})}); \ No newline at end of file +define(["jQuery","loading","libraryMenu"],function($,loading,libraryMenu){"use strict";function load(page,device,capabilities){capabilities.SupportsContentUploading?$("#fldCameraUploadPath",page).removeClass("hide"):$("#fldCameraUploadPath",page).addClass("hide"),$("#txtCustomName",page).val(device.CustomName||""),$("#txtUploadPath",page).val(device.CameraUploadPath||""),$(".reportedName",page).html(device.ReportedName||"")}function loadData(page){loading.show();var id=getParameterByName("id"),promise1=ApiClient.getJSON(ApiClient.getUrl("Devices/Info",{Id:id})),promise2=ApiClient.getJSON(ApiClient.getUrl("Devices/Capabilities",{Id:id}));Promise.all([promise1,promise2]).then(function(responses){load(page,responses[0],responses[1]),loading.hide()})}function save(page){var id=getParameterByName("id");ApiClient.ajax({url:ApiClient.getUrl("Devices/Options",{Id:id}),type:"POST",data:JSON.stringify({CustomName:$("#txtCustomName",page).val(),CameraUploadPath:$("#txtUploadPath",page).val()}),contentType:"application/json"}).then(Dashboard.processServerConfigurationUpdateResult)}function onSubmit(){return save($(this).parents(".page")),!1}$(document).on("pageinit","#devicePage",function(){var page=this;$("#btnSelectUploadPath",page).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({callback:function(path){path&&$("#txtUploadPath",page).val(path),picker.close()},validateWriteable:!0,header:Globalize.translate("HeaderSelectUploadPath")})})}),$(".deviceForm").off("submit",onSubmit).on("submit",onSubmit)}).on("pageshow","#devicePage",function(){loadData(this)})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/devices.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/devices.js index d3746ddbb8..1f2d0f843d 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/devices.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/devices.js @@ -1 +1 @@ -define(["jQuery","loading","libraryMenu","listViewStyle","emby-linkbutton"],function($,loading,libraryMenu){"use strict";function deleteDevice(page,id){var msg=Globalize.translate("DeleteDeviceConfirmation");require(["confirm"],function(confirm){confirm(msg,Globalize.translate("HeaderDeleteDevice")).then(function(){loading.show(),ApiClient.ajax({type:"DELETE",url:ApiClient.getUrl("Devices",{Id:id})}).then(function(){loadData(page)})})})}function load(page,devices){var html="";devices.length&&(html+='
    '),html+=devices.map(function(d){var deviceHtml="";return deviceHtml+='
    ',deviceHtml+='tablet_android',deviceHtml+=d.AppName&&d.LastUserName?'"}).join(""),devices.length&&(html+="
    ");var elem=$(".devicesList",page).html(html).trigger("create");$(".btnDeleteDevice",elem).on("click",function(){deleteDevice(page,this.getAttribute("data-id"))})}function loadData(page){loading.show(),ApiClient.getJSON(ApiClient.getUrl("Devices",{SupportsPersistentIdentifier:!0})).then(function(result){load(page,result.Items),loading.hide()})}$(document).on("pageshow","#devicesPage",function(){var page=this;loadData(page)})}); \ No newline at end of file +define(["jQuery","loading","libraryMenu","listViewStyle","emby-linkbutton"],function($,loading,libraryMenu){"use strict";function deleteDevice(page,id){var msg=Globalize.translate("DeleteDeviceConfirmation");require(["confirm"],function(confirm){confirm(msg,Globalize.translate("HeaderDeleteDevice")).then(function(){loading.show(),ApiClient.ajax({type:"DELETE",url:ApiClient.getUrl("Devices",{Id:id})}).then(function(){loadData(page)})})})}function load(page,devices){var html="";devices.length&&(html+='
    '),html+=devices.map(function(d){var deviceHtml="";return deviceHtml+='
    ',deviceHtml+='tablet_android',d.AppName&&d.LastUserName?deviceHtml+='"}).join(""),devices.length&&(html+="
    ");var elem=$(".devicesList",page).html(html).trigger("create");$(".btnDeleteDevice",elem).on("click",function(){deleteDevice(page,this.getAttribute("data-id"))})}function loadData(page){loading.show(),ApiClient.getJSON(ApiClient.getUrl("Devices",{SupportsPersistentIdentifier:!0})).then(function(result){load(page,result.Items),loading.hide()})}$(document).on("pageshow","#devicesPage",function(){loadData(this)})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/dlnaprofile.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/dlnaprofile.js index c4ce0572f5..839f122842 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/dlnaprofile.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/dlnaprofile.js @@ -1 +1 @@ -define(["jQuery","loading","fnchecked","jqmlistview","emby-select","emby-button","emby-input","emby-checkbox","listViewStyle","emby-linkbutton"],function($,loading){"use strict";function loadProfile(page){loading.show();var promise1=getProfile(),promise2=ApiClient.getUsers();Promise.all([promise1,promise2]).then(function(responses){currentProfile=responses[0],renderProfile(page,currentProfile,responses[1]),loading.hide()})}function getProfile(){var id=getParameterByName("id"),url=id?"Dlna/Profiles/"+id:"Dlna/Profiles/Default";return ApiClient.getJSON(ApiClient.getUrl(url))}function renderProfile(page,profile,users){$("#txtName",page).val(profile.Name),$(".chkMediaType",page).each(function(){this.checked=(profile.SupportedMediaTypes||"").split(",").indexOf(this.getAttribute("data-value"))!=-1}),$("#chkEnableAlbumArtInDidl",page).checked(profile.EnableAlbumArtInDidl),$("#chkEnableSingleImageLimit",page).checked(profile.EnableSingleAlbumArtLimit),renderXmlDocumentAttributes(page,profile.XmlRootAttributes||[]);var idInfo=profile.Identification||{};renderIdentificationHeaders(page,idInfo.Headers||[]),renderSubtitleProfiles(page,profile.SubtitleProfiles||[]),$("#txtInfoFriendlyName",page).val(profile.FriendlyName||""),$("#txtInfoModelName",page).val(profile.ModelName||""),$("#txtInfoModelNumber",page).val(profile.ModelNumber||""),$("#txtInfoModelDescription",page).val(profile.ModelDescription||""),$("#txtInfoModelUrl",page).val(profile.ModelUrl||""),$("#txtInfoManufacturer",page).val(profile.Manufacturer||""),$("#txtInfoManufacturerUrl",page).val(profile.ManufacturerUrl||""),$("#txtInfoSerialNumber",page).val(profile.SerialNumber||""),$("#txtIdFriendlyName",page).val(idInfo.FriendlyName||""),$("#txtIdModelName",page).val(idInfo.ModelName||""),$("#txtIdModelNumber",page).val(idInfo.ModelNumber||""),$("#txtIdModelDescription",page).val(idInfo.ModelDescription||""),$("#txtIdModelUrl",page).val(idInfo.ModelUrl||""),$("#txtIdManufacturer",page).val(idInfo.Manufacturer||""),$("#txtIdManufacturerUrl",page).val(idInfo.ManufacturerUrl||""),$("#txtIdSerialNumber",page).val(idInfo.SerialNumber||""),$("#txtIdDeviceDescription",page).val(idInfo.DeviceDescription||""),$("#txtAlbumArtPn",page).val(profile.AlbumArtPn||""),$("#txtAlbumArtMaxWidth",page).val(profile.MaxAlbumArtWidth||""),$("#txtAlbumArtMaxHeight",page).val(profile.MaxAlbumArtHeight||""),$("#txtIconMaxWidth",page).val(profile.MaxIconWidth||""),$("#txtIconMaxHeight",page).val(profile.MaxIconHeight||""),$("#chkIgnoreTranscodeByteRangeRequests",page).checked(profile.IgnoreTranscodeByteRangeRequests),$("#txtMaxAllowedBitrate",page).val(profile.MaxStreamingBitrate||""),$("#txtMusicStreamingTranscodingBitrate",page).val(profile.MusicStreamingTranscodingBitrate||""),$("#chkRequiresPlainFolders",page).checked(profile.RequiresPlainFolders),$("#chkRequiresPlainVideoItems",page).checked(profile.RequiresPlainVideoItems),$("#txtProtocolInfo",page).val(profile.ProtocolInfo||""),$("#txtXDlnaCap",page).val(profile.XDlnaCap||""),$("#txtXDlnaDoc",page).val(profile.XDlnaDoc||""),$("#txtSonyAggregationFlags",page).val(profile.SonyAggregationFlags||""),profile.DirectPlayProfiles=profile.DirectPlayProfiles||[],profile.TranscodingProfiles=profile.TranscodingProfiles||[],profile.ContainerProfiles=profile.ContainerProfiles||[],profile.CodecProfiles=profile.CodecProfiles||[],profile.ResponseProfiles=profile.ResponseProfiles||[];var usersHtml=""+users.map(function(u){return'"}).join("");$("#selectUser",page).html(usersHtml).val(profile.UserId||""),renderSubProfiles(page,profile)}function renderIdentificationHeaders(page,headers){var index=0,html='
    '+headers.map(function(h){var li='
    ';return li+='info',li+='
    ',li+='

    '+h.Name+": "+(h.Value||"")+"

    ",li+='
    '+(h.Match||"")+"
    ",li+="
    ",li+='',li+="
    ",index++,li}).join("")+"
    ",elem=$(".httpHeaderIdentificationList",page).html(html).trigger("create");$(".btnDeleteIdentificationHeader",elem).on("click",function(){var itemIndex=parseInt(this.getAttribute("data-index"));currentProfile.Identification.Headers.splice(itemIndex,1),renderIdentificationHeaders(page,currentProfile.Identification.Headers)})}function editIdentificationHeader(page,header){isSubProfileNew=null==header,header=header||{},currentSubProfile=header;var popup=$("#identificationHeaderPopup",page);$("#txtIdentificationHeaderName",popup).val(header.Name||""),$("#txtIdentificationHeaderValue",popup).val(header.Value||""),$("#selectMatchType",popup).val(header.Match||"Equals"),popup.popup("open")}function saveIdentificationHeader(page){currentSubProfile.Name=$("#txtIdentificationHeaderName",page).val(),currentSubProfile.Value=$("#txtIdentificationHeaderValue",page).val(),currentSubProfile.Match=$("#selectMatchType",page).val(),isSubProfileNew&&(currentProfile.Identification=currentProfile.Identification||{},currentProfile.Identification.Headers=currentProfile.Identification.Headers||[],currentProfile.Identification.Headers.push(currentSubProfile)),renderIdentificationHeaders(page,currentProfile.Identification.Headers),currentSubProfile=null,$("#identificationHeaderPopup",page).popup("close")}function renderXmlDocumentAttributes(page,attribute){var index=0,html='
    '+attribute.map(function(h){var li='
    ';return li+='info',li+='
    ',li+='

    '+h.Name+" = "+(h.Value||"")+"

    ",li+="
    ",li+='',li+="
    "}).join("")+"
    ",elem=$(".xmlDocumentAttributeList",page).html(html).trigger("create");$(".btnDeleteXmlAttribute",elem).on("click",function(){var itemIndex=parseInt(this.getAttribute("data-index"));currentProfile.XmlRootAttributes.splice(itemIndex,1),renderXmlDocumentAttributes(page,currentProfile.XmlRootAttributes)})}function editXmlDocumentAttribute(page,attribute){isSubProfileNew=null==attribute,attribute=attribute||{},currentSubProfile=attribute;var popup=$("#xmlAttributePopup",page);$("#txtXmlAttributeName",popup).val(attribute.Name||""),$("#txtXmlAttributeValue",popup).val(attribute.Value||""),popup.popup("open")}function saveXmlDocumentAttribute(page){currentSubProfile.Name=$("#txtXmlAttributeName",page).val(),currentSubProfile.Value=$("#txtXmlAttributeValue",page).val(),isSubProfileNew&¤tProfile.XmlRootAttributes.push(currentSubProfile),renderXmlDocumentAttributes(page,currentProfile.XmlRootAttributes),currentSubProfile=null,$("#xmlAttributePopup",page).popup("close")}function renderSubtitleProfiles(page,profiles){var index=0,html='
    '+profiles.map(function(h){var li='
    ';return li+='info',li+='
    ',li+='

    '+(h.Format||"")+"

    ",li+="
    ",li+='',li+="
    ",index++,li}).join("")+"
    ",elem=$(".subtitleProfileList",page).html(html).trigger("create");$(".btnDeleteProfile",elem).on("click",function(){var itemIndex=parseInt(this.getAttribute("data-index"));currentProfile.SubtitleProfiles.splice(itemIndex,1),renderSubtitleProfiles(page,currentProfile.SubtitleProfiles)}),$(".lnkEditSubProfile",elem).on("click",function(){var itemIndex=parseInt(this.getAttribute("data-index"));editSubtitleProfile(page,currentProfile.SubtitleProfiles[itemIndex])})}function editSubtitleProfile(page,profile){isSubProfileNew=null==profile,profile=profile||{},currentSubProfile=profile;var popup=$("#subtitleProfilePopup",page);$("#txtSubtitleProfileFormat",popup).val(profile.Format||""),$("#selectSubtitleProfileMethod",popup).val(profile.Method||""),$("#selectSubtitleProfileDidlMode",popup).val(profile.DidlMode||""),popup.popup("open")}function saveSubtitleProfile(page){currentSubProfile.Format=$("#txtSubtitleProfileFormat",page).val(),currentSubProfile.Method=$("#selectSubtitleProfileMethod",page).val(),currentSubProfile.DidlMode=$("#selectSubtitleProfileDidlMode",page).val(),isSubProfileNew&¤tProfile.SubtitleProfiles.push(currentSubProfile),renderSubtitleProfiles(page,currentProfile.SubtitleProfiles),currentSubProfile=null,$("#subtitleProfilePopup",page).popup("close")}function renderSubProfiles(page,profile){renderDirectPlayProfiles(page,profile.DirectPlayProfiles),renderTranscodingProfiles(page,profile.TranscodingProfiles),renderContainerProfiles(page,profile.ContainerProfiles),renderCodecProfiles(page,profile.CodecProfiles),renderResponseProfiles(page,profile.ResponseProfiles)}function saveDirectPlayProfile(page){currentSubProfile.Type=$("#selectDirectPlayProfileType",page).val(),currentSubProfile.Container=$("#txtDirectPlayContainer",page).val(),currentSubProfile.AudioCodec=$("#txtDirectPlayAudioCodec",page).val(),currentSubProfile.VideoCodec=$("#txtDirectPlayVideoCodec",page).val(),isSubProfileNew&¤tProfile.DirectPlayProfiles.push(currentSubProfile),renderSubProfiles(page,currentProfile),currentSubProfile=null,$("#popupEditDirectPlayProfile",page).popup("close")}function renderDirectPlayProfiles(page,profiles){var html="";html+='";var elem=$(".directPlayProfiles",page).html(html).trigger("create");$(".btnDeleteProfile",elem).on("click",function(){var index=this.getAttribute("data-profileindex");deleteDirectPlayProfile(page,index)}),$(".lnkEditSubProfile",elem).on("click",function(){var index=parseInt(this.getAttribute("data-profileindex"));editDirectPlayProfile(page,currentProfile.DirectPlayProfiles[index])})}function deleteDirectPlayProfile(page,index){currentProfile.DirectPlayProfiles.splice(index,1),renderDirectPlayProfiles(page,currentProfile.DirectPlayProfiles)}function editDirectPlayProfile(page,directPlayProfile){isSubProfileNew=null==directPlayProfile,directPlayProfile=directPlayProfile||{},currentSubProfile=directPlayProfile;var popup=$("#popupEditDirectPlayProfile",page);$("#selectDirectPlayProfileType",popup).val(directPlayProfile.Type||"Video").trigger("change"),$("#txtDirectPlayContainer",popup).val(directPlayProfile.Container||""),$("#txtDirectPlayAudioCodec",popup).val(directPlayProfile.AudioCodec||""),$("#txtDirectPlayVideoCodec",popup).val(directPlayProfile.VideoCodec||""),popup.popup("open")}function renderTranscodingProfiles(page,profiles){var html="";html+='";var elem=$(".transcodingProfiles",page).html(html).trigger("create");$(".btnDeleteProfile",elem).on("click",function(){var index=this.getAttribute("data-profileindex");deleteTranscodingProfile(page,index)}),$(".lnkEditSubProfile",elem).on("click",function(){var index=parseInt(this.getAttribute("data-profileindex"));editTranscodingProfile(page,currentProfile.TranscodingProfiles[index])})}function editTranscodingProfile(page,transcodingProfile){isSubProfileNew=null==transcodingProfile,transcodingProfile=transcodingProfile||{},currentSubProfile=transcodingProfile;var popup=$("#transcodingProfilePopup",page);$("#selectTranscodingProfileType",popup).val(transcodingProfile.Type||"Video").trigger("change"),$("#txtTranscodingContainer",popup).val(transcodingProfile.Container||""),$("#txtTranscodingAudioCodec",popup).val(transcodingProfile.AudioCodec||""),$("#txtTranscodingVideoCodec",popup).val(transcodingProfile.VideoCodec||""),$("#selectTranscodingProtocol",popup).val(transcodingProfile.Protocol||"Http"),$("#chkEnableMpegtsM2TsMode",popup).checked(transcodingProfile.EnableMpegtsM2TsMode||!1),$("#chkEstimateContentLength",popup).checked(transcodingProfile.EstimateContentLength||!1),$("#chkReportByteRangeRequests",popup).checked("Bytes"==transcodingProfile.TranscodeSeekInfo),$(".radioTabButton:first",popup).trigger("click"),popup.popup("open")}function deleteTranscodingProfile(page,index){currentProfile.TranscodingProfiles.splice(index,1),renderTranscodingProfiles(page,currentProfile.TranscodingProfiles)}function saveTranscodingProfile(page){currentSubProfile.Type=$("#selectTranscodingProfileType",page).val(),currentSubProfile.Container=$("#txtTranscodingContainer",page).val(),currentSubProfile.AudioCodec=$("#txtTranscodingAudioCodec",page).val(),currentSubProfile.VideoCodec=$("#txtTranscodingVideoCodec",page).val(),currentSubProfile.Protocol=$("#selectTranscodingProtocol",page).val(),currentSubProfile.Context="Streaming",currentSubProfile.EnableMpegtsM2TsMode=$("#chkEnableMpegtsM2TsMode",page).checked(),currentSubProfile.EstimateContentLength=$("#chkEstimateContentLength",page).checked(),currentSubProfile.TranscodeSeekInfo=$("#chkReportByteRangeRequests",page).checked()?"Bytes":"Auto",isSubProfileNew&¤tProfile.TranscodingProfiles.push(currentSubProfile),renderSubProfiles(page,currentProfile),currentSubProfile=null,$("#transcodingProfilePopup",page).popup("close")}function renderContainerProfiles(page,profiles){var html="";html+='";var elem=$(".containerProfiles",page).html(html).trigger("create");$(".btnDeleteProfile",elem).on("click",function(){var index=this.getAttribute("data-profileindex");deleteContainerProfile(page,index)}),$(".lnkEditSubProfile",elem).on("click",function(){var index=parseInt(this.getAttribute("data-profileindex"));editContainerProfile(page,currentProfile.ContainerProfiles[index])})}function deleteContainerProfile(page,index){currentProfile.ContainerProfiles.splice(index,1),renderContainerProfiles(page,currentProfile.ContainerProfiles)}function editContainerProfile(page,containerProfile){isSubProfileNew=null==containerProfile,containerProfile=containerProfile||{},currentSubProfile=containerProfile;var popup=$("#containerProfilePopup",page);$("#selectContainerProfileType",popup).val(containerProfile.Type||"Video").trigger("change"),$("#txtContainerProfileContainer",popup).val(containerProfile.Container||""),$(".radioTabButton:first",popup).trigger("click"),popup.popup("open")}function saveContainerProfile(page){currentSubProfile.Type=$("#selectContainerProfileType",page).val(),currentSubProfile.Container=$("#txtContainerProfileContainer",page).val(),isSubProfileNew&¤tProfile.ContainerProfiles.push(currentSubProfile),renderSubProfiles(page,currentProfile),currentSubProfile=null,$("#containerProfilePopup",page).popup("close")}function renderCodecProfiles(page,profiles){var html="";html+='";var elem=$(".codecProfiles",page).html(html).trigger("create");$(".btnDeleteProfile",elem).on("click",function(){var index=this.getAttribute("data-profileindex");deleteCodecProfile(page,index)}),$(".lnkEditSubProfile",elem).on("click",function(){var index=parseInt(this.getAttribute("data-profileindex"));editCodecProfile(page,currentProfile.CodecProfiles[index])})}function deleteCodecProfile(page,index){currentProfile.CodecProfiles.splice(index,1),renderCodecProfiles(page,currentProfile.CodecProfiles)}function editCodecProfile(page,codecProfile){isSubProfileNew=null==codecProfile,codecProfile=codecProfile||{},currentSubProfile=codecProfile;var popup=$("#codecProfilePopup",page);$("#selectCodecProfileType",popup).val(codecProfile.Type||"Video").trigger("change"),$("#txtCodecProfileCodec",popup).val(codecProfile.Codec||""),$(".radioTabButton:first",popup).trigger("click"),popup.popup("open")}function saveCodecProfile(page){currentSubProfile.Type=$("#selectCodecProfileType",page).val(),currentSubProfile.Codec=$("#txtCodecProfileCodec",page).val(),isSubProfileNew&¤tProfile.CodecProfiles.push(currentSubProfile),renderSubProfiles(page,currentProfile),currentSubProfile=null,$("#codecProfilePopup",page).popup("close")}function renderResponseProfiles(page,profiles){var html="";html+='";var elem=$(".mediaProfiles",page).html(html).trigger("create");$(".btnDeleteProfile",elem).on("click",function(){var index=this.getAttribute("data-profileindex");deleteResponseProfile(page,index)}),$(".lnkEditSubProfile",elem).on("click",function(){var index=parseInt(this.getAttribute("data-profileindex"));editResponseProfile(page,currentProfile.ResponseProfiles[index])})}function deleteResponseProfile(page,index){currentProfile.ResponseProfiles.splice(index,1),renderResponseProfiles(page,currentProfile.ResponseProfiles)}function editResponseProfile(page,responseProfile){isSubProfileNew=null==responseProfile,responseProfile=responseProfile||{},currentSubProfile=responseProfile;var popup=$("#responseProfilePopup",page);$("#selectResponseProfileType",popup).val(responseProfile.Type||"Video").trigger("change"),$("#txtResponseProfileContainer",popup).val(responseProfile.Container||""),$("#txtResponseProfileAudioCodec",popup).val(responseProfile.AudioCodec||""),$("#txtResponseProfileVideoCodec",popup).val(responseProfile.VideoCodec||""),$(".radioTabButton:first",popup).trigger("click"),popup.popup("open")}function saveResponseProfile(page){currentSubProfile.Type=$("#selectResponseProfileType",page).val(),currentSubProfile.Container=$("#txtResponseProfileContainer",page).val(),currentSubProfile.AudioCodec=$("#txtResponseProfileAudioCodec",page).val(),currentSubProfile.VideoCodec=$("#txtResponseProfileVideoCodec",page).val(),isSubProfileNew&¤tProfile.ResponseProfiles.push(currentSubProfile),renderSubProfiles(page,currentProfile),currentSubProfile=null,$("#responseProfilePopup",page).popup("close")}function saveProfile(page,profile){updateProfile(page,profile);var id=getParameterByName("id");id?ApiClient.ajax({type:"POST",url:ApiClient.getUrl("Dlna/Profiles/"+id),data:JSON.stringify(profile),contentType:"application/json"}).then(function(){require(["toast"],function(toast){toast("Settings saved.")})},Dashboard.processErrorResponse):ApiClient.ajax({type:"POST",url:ApiClient.getUrl("Dlna/Profiles"),data:JSON.stringify(profile),contentType:"application/json"}).then(function(){Dashboard.navigate("dlnaprofiles.html")},Dashboard.processErrorResponse),loading.hide()}function updateProfile(page,profile){profile.Name=$("#txtName",page).val(),profile.EnableAlbumArtInDidl=$("#chkEnableAlbumArtInDidl",page).checked(),profile.EnableSingleAlbumArtLimit=$("#chkEnableSingleImageLimit",page).checked(),profile.SupportedMediaTypes=$(".chkMediaType:checked",page).get().map(function(c){return c.getAttribute("data-value")}).join(","),profile.Identification=profile.Identification||{},profile.FriendlyName=$("#txtInfoFriendlyName",page).val(),profile.ModelName=$("#txtInfoModelName",page).val(),profile.ModelNumber=$("#txtInfoModelNumber",page).val(),profile.ModelDescription=$("#txtInfoModelDescription",page).val(),profile.ModelUrl=$("#txtInfoModelUrl",page).val(),profile.Manufacturer=$("#txtInfoManufacturer",page).val(),profile.ManufacturerUrl=$("#txtInfoManufacturerUrl",page).val(),profile.SerialNumber=$("#txtInfoSerialNumber",page).val(),profile.Identification.FriendlyName=$("#txtIdFriendlyName",page).val(),profile.Identification.ModelName=$("#txtIdModelName",page).val(),profile.Identification.ModelNumber=$("#txtIdModelNumber",page).val(),profile.Identification.ModelDescription=$("#txtIdModelDescription",page).val(),profile.Identification.ModelUrl=$("#txtIdModelUrl",page).val(),profile.Identification.Manufacturer=$("#txtIdManufacturer",page).val(),profile.Identification.ManufacturerUrl=$("#txtIdManufacturerUrl",page).val(),profile.Identification.SerialNumber=$("#txtIdSerialNumber",page).val(),profile.Identification.DeviceDescription=$("#txtIdDeviceDescription",page).val(),profile.AlbumArtPn=$("#txtAlbumArtPn",page).val(),profile.MaxAlbumArtWidth=$("#txtAlbumArtMaxWidth",page).val(),profile.MaxAlbumArtHeight=$("#txtAlbumArtMaxHeight",page).val(),profile.MaxIconWidth=$("#txtIconMaxWidth",page).val(),profile.MaxIconHeight=$("#txtIconMaxHeight",page).val(),profile.RequiresPlainFolders=$("#chkRequiresPlainFolders",page).checked(),profile.RequiresPlainVideoItems=$("#chkRequiresPlainVideoItems",page).checked(),profile.IgnoreTranscodeByteRangeRequests=$("#chkIgnoreTranscodeByteRangeRequests",page).checked(),profile.MaxStreamingBitrate=$("#txtMaxAllowedBitrate",page).val(),profile.MusicStreamingTranscodingBitrate=$("#txtMusicStreamingTranscodingBitrate",page).val(),profile.ProtocolInfo=$("#txtProtocolInfo",page).val(),profile.XDlnaCap=$("#txtXDlnaCap",page).val(),profile.XDlnaDoc=$("#txtXDlnaDoc",page).val(),profile.SonyAggregationFlags=$("#txtSonyAggregationFlags",page).val(),profile.UserId=$("#selectUser",page).val()}var currentProfile,currentSubProfile,isSubProfileNew,allText=Globalize.translate("LabelAll");$(document).on("pageinit","#dlnaProfilePage",function(){var page=this;$(".radioTabButton",page).on("click",function(){$(this).siblings().removeClass("ui-btn-active"),$(this).addClass("ui-btn-active");var value="A"==this.tagName?this.getAttribute("data-value"):this.value,elem=$("."+value,page);elem.siblings(".tabContent").hide(),elem.show()}),$("#selectDirectPlayProfileType",page).on("change",function(){"Video"==this.value?$("#fldDirectPlayVideoCodec",page).show():$("#fldDirectPlayVideoCodec",page).hide(),"Photo"==this.value?$("#fldDirectPlayAudioCodec",page).hide():$("#fldDirectPlayAudioCodec",page).show()}),$("#selectTranscodingProfileType",page).on("change",function(){"Video"==this.value?($("#fldTranscodingVideoCodec",page).show(),$("#fldTranscodingProtocol",page).show(),$("#fldEnableMpegtsM2TsMode",page).show()):($("#fldTranscodingVideoCodec",page).hide(),$("#fldTranscodingProtocol",page).hide(),$("#fldEnableMpegtsM2TsMode",page).hide()),"Photo"==this.value?($("#fldTranscodingAudioCodec",page).hide(),$("#fldEstimateContentLength",page).hide(),$("#fldReportByteRangeRequests",page).hide()):($("#fldTranscodingAudioCodec",page).show(),$("#fldEstimateContentLength",page).show(),$("#fldReportByteRangeRequests",page).show())}),$("#selectResponseProfileType",page).on("change",function(){"Video"==this.value?$("#fldResponseProfileVideoCodec",page).show():$("#fldResponseProfileVideoCodec",page).hide(),"Photo"==this.value?$("#fldResponseProfileAudioCodec",page).hide():$("#fldResponseProfileAudioCodec",page).show()}),$(".btnAddDirectPlayProfile",page).on("click",function(){editDirectPlayProfile(page)}),$(".btnAddTranscodingProfile",page).on("click",function(){editTranscodingProfile(page)}),$(".btnAddContainerProfile",page).on("click",function(){editContainerProfile(page)}),$(".btnAddCodecProfile",page).on("click",function(){editCodecProfile(page)}),$(".btnAddResponseProfile",page).on("click",function(){editResponseProfile(page)}),$(".btnAddIdentificationHttpHeader",page).on("click",function(){editIdentificationHeader(page)}),$(".btnAddXmlDocumentAttribute",page).on("click",function(){editXmlDocumentAttribute(page)}),$(".btnAddSubtitleProfile",page).on("click",function(){editSubtitleProfile(page)}),$(".dlnaProfileForm").off("submit",DlnaProfilePage.onSubmit).on("submit",DlnaProfilePage.onSubmit),$(".editDirectPlayProfileForm").off("submit",DlnaProfilePage.onDirectPlayFormSubmit).on("submit",DlnaProfilePage.onDirectPlayFormSubmit),$(".transcodingProfileForm").off("submit",DlnaProfilePage.onTranscodingProfileFormSubmit).on("submit",DlnaProfilePage.onTranscodingProfileFormSubmit),$(".containerProfileForm").off("submit",DlnaProfilePage.onContainerProfileFormSubmit).on("submit",DlnaProfilePage.onContainerProfileFormSubmit),$(".codecProfileForm").off("submit",DlnaProfilePage.onCodecProfileFormSubmit).on("submit",DlnaProfilePage.onCodecProfileFormSubmit),$(".editResponseProfileForm").off("submit",DlnaProfilePage.onResponseProfileFormSubmit).on("submit",DlnaProfilePage.onResponseProfileFormSubmit),$(".identificationHeaderForm").off("submit",DlnaProfilePage.onIdentificationHeaderFormSubmit).on("submit",DlnaProfilePage.onIdentificationHeaderFormSubmit),$(".xmlAttributeForm").off("submit",DlnaProfilePage.onXmlAttributeFormSubmit).on("submit",DlnaProfilePage.onXmlAttributeFormSubmit),$(".subtitleProfileForm").off("submit",DlnaProfilePage.onSubtitleProfileFormSubmit).on("submit",DlnaProfilePage.onSubtitleProfileFormSubmit)}).on("pageshow","#dlnaProfilePage",function(){var page=this;$("#radioInfo",page).trigger("click"),loadProfile(page)}),window.DlnaProfilePage={onSubmit:function(){loading.show();var form=this,page=$(form).parents(".page");return saveProfile(page,currentProfile),!1},onDirectPlayFormSubmit:function(){var form=this,page=$(form).parents(".page");return saveDirectPlayProfile(page),!1},onTranscodingProfileFormSubmit:function(){var form=this,page=$(form).parents(".page");return saveTranscodingProfile(page),!1},onContainerProfileFormSubmit:function(){var form=this,page=$(form).parents(".page");return saveContainerProfile(page),!1},onCodecProfileFormSubmit:function(){var form=this,page=$(form).parents(".page");return saveCodecProfile(page),!1},onResponseProfileFormSubmit:function(){var form=this,page=$(form).parents(".page");return saveResponseProfile(page),!1},onIdentificationHeaderFormSubmit:function(){var form=this,page=$(form).parents(".page");return saveIdentificationHeader(page),!1},onXmlAttributeFormSubmit:function(){var form=this,page=$(form).parents(".page");return saveXmlDocumentAttribute(page),!1},onSubtitleProfileFormSubmit:function(){var form=this,page=$(form).parents(".page");return saveSubtitleProfile(page),!1}}}); \ No newline at end of file +define(["jQuery","loading","fnchecked","jqmlistview","emby-select","emby-button","emby-input","emby-checkbox","listViewStyle","emby-linkbutton"],function($,loading){"use strict";function loadProfile(page){loading.show();var promise1=getProfile(),promise2=ApiClient.getUsers();Promise.all([promise1,promise2]).then(function(responses){currentProfile=responses[0],renderProfile(page,currentProfile,responses[1]),loading.hide()})}function getProfile(){var id=getParameterByName("id"),url=id?"Dlna/Profiles/"+id:"Dlna/Profiles/Default";return ApiClient.getJSON(ApiClient.getUrl(url))}function renderProfile(page,profile,users){$("#txtName",page).val(profile.Name),$(".chkMediaType",page).each(function(){this.checked=-1!=(profile.SupportedMediaTypes||"").split(",").indexOf(this.getAttribute("data-value"))}),$("#chkEnableAlbumArtInDidl",page).checked(profile.EnableAlbumArtInDidl),$("#chkEnableSingleImageLimit",page).checked(profile.EnableSingleAlbumArtLimit),renderXmlDocumentAttributes(page,profile.XmlRootAttributes||[]);var idInfo=profile.Identification||{};renderIdentificationHeaders(page,idInfo.Headers||[]),renderSubtitleProfiles(page,profile.SubtitleProfiles||[]),$("#txtInfoFriendlyName",page).val(profile.FriendlyName||""),$("#txtInfoModelName",page).val(profile.ModelName||""),$("#txtInfoModelNumber",page).val(profile.ModelNumber||""),$("#txtInfoModelDescription",page).val(profile.ModelDescription||""),$("#txtInfoModelUrl",page).val(profile.ModelUrl||""),$("#txtInfoManufacturer",page).val(profile.Manufacturer||""),$("#txtInfoManufacturerUrl",page).val(profile.ManufacturerUrl||""),$("#txtInfoSerialNumber",page).val(profile.SerialNumber||""),$("#txtIdFriendlyName",page).val(idInfo.FriendlyName||""),$("#txtIdModelName",page).val(idInfo.ModelName||""),$("#txtIdModelNumber",page).val(idInfo.ModelNumber||""),$("#txtIdModelDescription",page).val(idInfo.ModelDescription||""),$("#txtIdModelUrl",page).val(idInfo.ModelUrl||""),$("#txtIdManufacturer",page).val(idInfo.Manufacturer||""),$("#txtIdManufacturerUrl",page).val(idInfo.ManufacturerUrl||""),$("#txtIdSerialNumber",page).val(idInfo.SerialNumber||""),$("#txtIdDeviceDescription",page).val(idInfo.DeviceDescription||""),$("#txtAlbumArtPn",page).val(profile.AlbumArtPn||""),$("#txtAlbumArtMaxWidth",page).val(profile.MaxAlbumArtWidth||""),$("#txtAlbumArtMaxHeight",page).val(profile.MaxAlbumArtHeight||""),$("#txtIconMaxWidth",page).val(profile.MaxIconWidth||""),$("#txtIconMaxHeight",page).val(profile.MaxIconHeight||""),$("#chkIgnoreTranscodeByteRangeRequests",page).checked(profile.IgnoreTranscodeByteRangeRequests),$("#txtMaxAllowedBitrate",page).val(profile.MaxStreamingBitrate||""),$("#txtMusicStreamingTranscodingBitrate",page).val(profile.MusicStreamingTranscodingBitrate||""),$("#chkRequiresPlainFolders",page).checked(profile.RequiresPlainFolders),$("#chkRequiresPlainVideoItems",page).checked(profile.RequiresPlainVideoItems),$("#txtProtocolInfo",page).val(profile.ProtocolInfo||""),$("#txtXDlnaCap",page).val(profile.XDlnaCap||""),$("#txtXDlnaDoc",page).val(profile.XDlnaDoc||""),$("#txtSonyAggregationFlags",page).val(profile.SonyAggregationFlags||""),profile.DirectPlayProfiles=profile.DirectPlayProfiles||[],profile.TranscodingProfiles=profile.TranscodingProfiles||[],profile.ContainerProfiles=profile.ContainerProfiles||[],profile.CodecProfiles=profile.CodecProfiles||[],profile.ResponseProfiles=profile.ResponseProfiles||[];var usersHtml=""+users.map(function(u){return'"}).join("");$("#selectUser",page).html(usersHtml).val(profile.UserId||""),renderSubProfiles(page,profile)}function renderIdentificationHeaders(page,headers){var index=0,html='
    '+headers.map(function(h){var li='
    ';return li+='info',li+='
    ',li+='

    '+h.Name+": "+(h.Value||"")+"

    ",li+='
    '+(h.Match||"")+"
    ",li+="
    ",li+='',li+="
    ",index++,li}).join("")+"
    ",elem=$(".httpHeaderIdentificationList",page).html(html).trigger("create");$(".btnDeleteIdentificationHeader",elem).on("click",function(){var itemIndex=parseInt(this.getAttribute("data-index"));currentProfile.Identification.Headers.splice(itemIndex,1),renderIdentificationHeaders(page,currentProfile.Identification.Headers)})}function editIdentificationHeader(page,header){isSubProfileNew=null==header,header=header||{},currentSubProfile=header;var popup=$("#identificationHeaderPopup",page);$("#txtIdentificationHeaderName",popup).val(header.Name||""),$("#txtIdentificationHeaderValue",popup).val(header.Value||""),$("#selectMatchType",popup).val(header.Match||"Equals"),popup.popup("open")}function saveIdentificationHeader(page){currentSubProfile.Name=$("#txtIdentificationHeaderName",page).val(),currentSubProfile.Value=$("#txtIdentificationHeaderValue",page).val(),currentSubProfile.Match=$("#selectMatchType",page).val(),isSubProfileNew&&(currentProfile.Identification=currentProfile.Identification||{},currentProfile.Identification.Headers=currentProfile.Identification.Headers||[],currentProfile.Identification.Headers.push(currentSubProfile)),renderIdentificationHeaders(page,currentProfile.Identification.Headers),currentSubProfile=null,$("#identificationHeaderPopup",page).popup("close")}function renderXmlDocumentAttributes(page,attribute){var html='
    '+attribute.map(function(h){var li='
    ';return li+='info',li+='
    ',li+='

    '+h.Name+" = "+(h.Value||"")+"

    ",li+="
    ",li+='',li+="
    "}).join("")+"
    ",elem=$(".xmlDocumentAttributeList",page).html(html).trigger("create");$(".btnDeleteXmlAttribute",elem).on("click",function(){var itemIndex=parseInt(this.getAttribute("data-index"));currentProfile.XmlRootAttributes.splice(itemIndex,1),renderXmlDocumentAttributes(page,currentProfile.XmlRootAttributes)})}function editXmlDocumentAttribute(page,attribute){isSubProfileNew=null==attribute,attribute=attribute||{},currentSubProfile=attribute;var popup=$("#xmlAttributePopup",page);$("#txtXmlAttributeName",popup).val(attribute.Name||""),$("#txtXmlAttributeValue",popup).val(attribute.Value||""),popup.popup("open")}function saveXmlDocumentAttribute(page){currentSubProfile.Name=$("#txtXmlAttributeName",page).val(),currentSubProfile.Value=$("#txtXmlAttributeValue",page).val(),isSubProfileNew&¤tProfile.XmlRootAttributes.push(currentSubProfile),renderXmlDocumentAttributes(page,currentProfile.XmlRootAttributes),currentSubProfile=null,$("#xmlAttributePopup",page).popup("close")}function renderSubtitleProfiles(page,profiles){var index=0,html='
    '+profiles.map(function(h){var li='
    ';return li+='info',li+='
    ',li+='

    '+(h.Format||"")+"

    ",li+="
    ",li+='',li+="
    ",index++,li}).join("")+"
    ",elem=$(".subtitleProfileList",page).html(html).trigger("create");$(".btnDeleteProfile",elem).on("click",function(){var itemIndex=parseInt(this.getAttribute("data-index"));currentProfile.SubtitleProfiles.splice(itemIndex,1),renderSubtitleProfiles(page,currentProfile.SubtitleProfiles)}),$(".lnkEditSubProfile",elem).on("click",function(){var itemIndex=parseInt(this.getAttribute("data-index"));editSubtitleProfile(page,currentProfile.SubtitleProfiles[itemIndex])})}function editSubtitleProfile(page,profile){isSubProfileNew=null==profile,profile=profile||{},currentSubProfile=profile;var popup=$("#subtitleProfilePopup",page);$("#txtSubtitleProfileFormat",popup).val(profile.Format||""),$("#selectSubtitleProfileMethod",popup).val(profile.Method||""),$("#selectSubtitleProfileDidlMode",popup).val(profile.DidlMode||""),popup.popup("open")}function saveSubtitleProfile(page){currentSubProfile.Format=$("#txtSubtitleProfileFormat",page).val(),currentSubProfile.Method=$("#selectSubtitleProfileMethod",page).val(),currentSubProfile.DidlMode=$("#selectSubtitleProfileDidlMode",page).val(),isSubProfileNew&¤tProfile.SubtitleProfiles.push(currentSubProfile),renderSubtitleProfiles(page,currentProfile.SubtitleProfiles),currentSubProfile=null,$("#subtitleProfilePopup",page).popup("close")}function renderSubProfiles(page,profile){renderDirectPlayProfiles(page,profile.DirectPlayProfiles),renderTranscodingProfiles(page,profile.TranscodingProfiles),renderContainerProfiles(page,profile.ContainerProfiles),renderCodecProfiles(page,profile.CodecProfiles),renderResponseProfiles(page,profile.ResponseProfiles)}function saveDirectPlayProfile(page){currentSubProfile.Type=$("#selectDirectPlayProfileType",page).val(),currentSubProfile.Container=$("#txtDirectPlayContainer",page).val(),currentSubProfile.AudioCodec=$("#txtDirectPlayAudioCodec",page).val(),currentSubProfile.VideoCodec=$("#txtDirectPlayVideoCodec",page).val(),isSubProfileNew&¤tProfile.DirectPlayProfiles.push(currentSubProfile),renderSubProfiles(page,currentProfile),currentSubProfile=null,$("#popupEditDirectPlayProfile",page).popup("close")}function renderDirectPlayProfiles(page,profiles){var html="";html+='";var elem=$(".directPlayProfiles",page).html(html).trigger("create");$(".btnDeleteProfile",elem).on("click",function(){var index=this.getAttribute("data-profileindex");deleteDirectPlayProfile(page,index)}),$(".lnkEditSubProfile",elem).on("click",function(){var index=parseInt(this.getAttribute("data-profileindex"));editDirectPlayProfile(page,currentProfile.DirectPlayProfiles[index])})}function deleteDirectPlayProfile(page,index){currentProfile.DirectPlayProfiles.splice(index,1),renderDirectPlayProfiles(page,currentProfile.DirectPlayProfiles)}function editDirectPlayProfile(page,directPlayProfile){isSubProfileNew=null==directPlayProfile,directPlayProfile=directPlayProfile||{},currentSubProfile=directPlayProfile;var popup=$("#popupEditDirectPlayProfile",page);$("#selectDirectPlayProfileType",popup).val(directPlayProfile.Type||"Video").trigger("change"),$("#txtDirectPlayContainer",popup).val(directPlayProfile.Container||""),$("#txtDirectPlayAudioCodec",popup).val(directPlayProfile.AudioCodec||""),$("#txtDirectPlayVideoCodec",popup).val(directPlayProfile.VideoCodec||""),popup.popup("open")}function renderTranscodingProfiles(page,profiles){var html="";html+='";var elem=$(".transcodingProfiles",page).html(html).trigger("create");$(".btnDeleteProfile",elem).on("click",function(){var index=this.getAttribute("data-profileindex");deleteTranscodingProfile(page,index)}),$(".lnkEditSubProfile",elem).on("click",function(){var index=parseInt(this.getAttribute("data-profileindex"));editTranscodingProfile(page,currentProfile.TranscodingProfiles[index])})}function editTranscodingProfile(page,transcodingProfile){isSubProfileNew=null==transcodingProfile,transcodingProfile=transcodingProfile||{},currentSubProfile=transcodingProfile;var popup=$("#transcodingProfilePopup",page);$("#selectTranscodingProfileType",popup).val(transcodingProfile.Type||"Video").trigger("change"),$("#txtTranscodingContainer",popup).val(transcodingProfile.Container||""),$("#txtTranscodingAudioCodec",popup).val(transcodingProfile.AudioCodec||""),$("#txtTranscodingVideoCodec",popup).val(transcodingProfile.VideoCodec||""),$("#selectTranscodingProtocol",popup).val(transcodingProfile.Protocol||"Http"),$("#chkEnableMpegtsM2TsMode",popup).checked(transcodingProfile.EnableMpegtsM2TsMode||!1),$("#chkEstimateContentLength",popup).checked(transcodingProfile.EstimateContentLength||!1),$("#chkReportByteRangeRequests",popup).checked("Bytes"==transcodingProfile.TranscodeSeekInfo),$(".radioTabButton:first",popup).trigger("click"),popup.popup("open")}function deleteTranscodingProfile(page,index){currentProfile.TranscodingProfiles.splice(index,1),renderTranscodingProfiles(page,currentProfile.TranscodingProfiles)}function saveTranscodingProfile(page){currentSubProfile.Type=$("#selectTranscodingProfileType",page).val(),currentSubProfile.Container=$("#txtTranscodingContainer",page).val(),currentSubProfile.AudioCodec=$("#txtTranscodingAudioCodec",page).val(),currentSubProfile.VideoCodec=$("#txtTranscodingVideoCodec",page).val(),currentSubProfile.Protocol=$("#selectTranscodingProtocol",page).val(),currentSubProfile.Context="Streaming",currentSubProfile.EnableMpegtsM2TsMode=$("#chkEnableMpegtsM2TsMode",page).checked(),currentSubProfile.EstimateContentLength=$("#chkEstimateContentLength",page).checked(),currentSubProfile.TranscodeSeekInfo=$("#chkReportByteRangeRequests",page).checked()?"Bytes":"Auto",isSubProfileNew&¤tProfile.TranscodingProfiles.push(currentSubProfile),renderSubProfiles(page,currentProfile),currentSubProfile=null,$("#transcodingProfilePopup",page).popup("close")}function renderContainerProfiles(page,profiles){var html="";html+='";var elem=$(".containerProfiles",page).html(html).trigger("create");$(".btnDeleteProfile",elem).on("click",function(){var index=this.getAttribute("data-profileindex");deleteContainerProfile(page,index)}),$(".lnkEditSubProfile",elem).on("click",function(){var index=parseInt(this.getAttribute("data-profileindex"));editContainerProfile(page,currentProfile.ContainerProfiles[index])})}function deleteContainerProfile(page,index){currentProfile.ContainerProfiles.splice(index,1),renderContainerProfiles(page,currentProfile.ContainerProfiles)}function editContainerProfile(page,containerProfile){isSubProfileNew=null==containerProfile,containerProfile=containerProfile||{},currentSubProfile=containerProfile;var popup=$("#containerProfilePopup",page);$("#selectContainerProfileType",popup).val(containerProfile.Type||"Video").trigger("change"),$("#txtContainerProfileContainer",popup).val(containerProfile.Container||""),$(".radioTabButton:first",popup).trigger("click"),popup.popup("open")}function saveContainerProfile(page){currentSubProfile.Type=$("#selectContainerProfileType",page).val(),currentSubProfile.Container=$("#txtContainerProfileContainer",page).val(),isSubProfileNew&¤tProfile.ContainerProfiles.push(currentSubProfile),renderSubProfiles(page,currentProfile),currentSubProfile=null,$("#containerProfilePopup",page).popup("close")}function renderCodecProfiles(page,profiles){var html="";html+='";var elem=$(".codecProfiles",page).html(html).trigger("create");$(".btnDeleteProfile",elem).on("click",function(){var index=this.getAttribute("data-profileindex");deleteCodecProfile(page,index)}),$(".lnkEditSubProfile",elem).on("click",function(){var index=parseInt(this.getAttribute("data-profileindex"));editCodecProfile(page,currentProfile.CodecProfiles[index])})}function deleteCodecProfile(page,index){currentProfile.CodecProfiles.splice(index,1),renderCodecProfiles(page,currentProfile.CodecProfiles)}function editCodecProfile(page,codecProfile){isSubProfileNew=null==codecProfile,codecProfile=codecProfile||{},currentSubProfile=codecProfile;var popup=$("#codecProfilePopup",page);$("#selectCodecProfileType",popup).val(codecProfile.Type||"Video").trigger("change"),$("#txtCodecProfileCodec",popup).val(codecProfile.Codec||""),$(".radioTabButton:first",popup).trigger("click"),popup.popup("open")}function saveCodecProfile(page){currentSubProfile.Type=$("#selectCodecProfileType",page).val(),currentSubProfile.Codec=$("#txtCodecProfileCodec",page).val(),isSubProfileNew&¤tProfile.CodecProfiles.push(currentSubProfile),renderSubProfiles(page,currentProfile),currentSubProfile=null,$("#codecProfilePopup",page).popup("close")}function renderResponseProfiles(page,profiles){var html="";html+='";var elem=$(".mediaProfiles",page).html(html).trigger("create");$(".btnDeleteProfile",elem).on("click",function(){var index=this.getAttribute("data-profileindex");deleteResponseProfile(page,index)}),$(".lnkEditSubProfile",elem).on("click",function(){var index=parseInt(this.getAttribute("data-profileindex"));editResponseProfile(page,currentProfile.ResponseProfiles[index])})}function deleteResponseProfile(page,index){currentProfile.ResponseProfiles.splice(index,1),renderResponseProfiles(page,currentProfile.ResponseProfiles)}function editResponseProfile(page,responseProfile){isSubProfileNew=null==responseProfile,responseProfile=responseProfile||{},currentSubProfile=responseProfile;var popup=$("#responseProfilePopup",page);$("#selectResponseProfileType",popup).val(responseProfile.Type||"Video").trigger("change"),$("#txtResponseProfileContainer",popup).val(responseProfile.Container||""),$("#txtResponseProfileAudioCodec",popup).val(responseProfile.AudioCodec||""),$("#txtResponseProfileVideoCodec",popup).val(responseProfile.VideoCodec||""),$(".radioTabButton:first",popup).trigger("click"),popup.popup("open")}function saveResponseProfile(page){currentSubProfile.Type=$("#selectResponseProfileType",page).val(),currentSubProfile.Container=$("#txtResponseProfileContainer",page).val(),currentSubProfile.AudioCodec=$("#txtResponseProfileAudioCodec",page).val(),currentSubProfile.VideoCodec=$("#txtResponseProfileVideoCodec",page).val(),isSubProfileNew&¤tProfile.ResponseProfiles.push(currentSubProfile),renderSubProfiles(page,currentProfile),currentSubProfile=null,$("#responseProfilePopup",page).popup("close")}function saveProfile(page,profile){updateProfile(page,profile);var id=getParameterByName("id");id?ApiClient.ajax({type:"POST",url:ApiClient.getUrl("Dlna/Profiles/"+id),data:JSON.stringify(profile),contentType:"application/json"}).then(function(){require(["toast"],function(toast){toast("Settings saved.")})},Dashboard.processErrorResponse):ApiClient.ajax({type:"POST",url:ApiClient.getUrl("Dlna/Profiles"),data:JSON.stringify(profile),contentType:"application/json"}).then(function(){Dashboard.navigate("dlnaprofiles.html")},Dashboard.processErrorResponse),loading.hide()}function updateProfile(page,profile){profile.Name=$("#txtName",page).val(),profile.EnableAlbumArtInDidl=$("#chkEnableAlbumArtInDidl",page).checked(),profile.EnableSingleAlbumArtLimit=$("#chkEnableSingleImageLimit",page).checked(),profile.SupportedMediaTypes=$(".chkMediaType:checked",page).get().map(function(c){return c.getAttribute("data-value")}).join(","),profile.Identification=profile.Identification||{},profile.FriendlyName=$("#txtInfoFriendlyName",page).val(),profile.ModelName=$("#txtInfoModelName",page).val(),profile.ModelNumber=$("#txtInfoModelNumber",page).val(),profile.ModelDescription=$("#txtInfoModelDescription",page).val(),profile.ModelUrl=$("#txtInfoModelUrl",page).val(),profile.Manufacturer=$("#txtInfoManufacturer",page).val(),profile.ManufacturerUrl=$("#txtInfoManufacturerUrl",page).val(),profile.SerialNumber=$("#txtInfoSerialNumber",page).val(),profile.Identification.FriendlyName=$("#txtIdFriendlyName",page).val(),profile.Identification.ModelName=$("#txtIdModelName",page).val(),profile.Identification.ModelNumber=$("#txtIdModelNumber",page).val(),profile.Identification.ModelDescription=$("#txtIdModelDescription",page).val(),profile.Identification.ModelUrl=$("#txtIdModelUrl",page).val(),profile.Identification.Manufacturer=$("#txtIdManufacturer",page).val(),profile.Identification.ManufacturerUrl=$("#txtIdManufacturerUrl",page).val(),profile.Identification.SerialNumber=$("#txtIdSerialNumber",page).val(),profile.Identification.DeviceDescription=$("#txtIdDeviceDescription",page).val(),profile.AlbumArtPn=$("#txtAlbumArtPn",page).val(),profile.MaxAlbumArtWidth=$("#txtAlbumArtMaxWidth",page).val(),profile.MaxAlbumArtHeight=$("#txtAlbumArtMaxHeight",page).val(),profile.MaxIconWidth=$("#txtIconMaxWidth",page).val(),profile.MaxIconHeight=$("#txtIconMaxHeight",page).val(),profile.RequiresPlainFolders=$("#chkRequiresPlainFolders",page).checked(),profile.RequiresPlainVideoItems=$("#chkRequiresPlainVideoItems",page).checked(),profile.IgnoreTranscodeByteRangeRequests=$("#chkIgnoreTranscodeByteRangeRequests",page).checked(),profile.MaxStreamingBitrate=$("#txtMaxAllowedBitrate",page).val(),profile.MusicStreamingTranscodingBitrate=$("#txtMusicStreamingTranscodingBitrate",page).val(),profile.ProtocolInfo=$("#txtProtocolInfo",page).val(),profile.XDlnaCap=$("#txtXDlnaCap",page).val(),profile.XDlnaDoc=$("#txtXDlnaDoc",page).val(),profile.SonyAggregationFlags=$("#txtSonyAggregationFlags",page).val(),profile.UserId=$("#selectUser",page).val()}var currentProfile,currentSubProfile,isSubProfileNew,allText=Globalize.translate("LabelAll");$(document).on("pageinit","#dlnaProfilePage",function(){var page=this;$(".radioTabButton",page).on("click",function(){$(this).siblings().removeClass("ui-btn-active"),$(this).addClass("ui-btn-active");var value="A"==this.tagName?this.getAttribute("data-value"):this.value,elem=$("."+value,page);elem.siblings(".tabContent").hide(),elem.show()}),$("#selectDirectPlayProfileType",page).on("change",function(){"Video"==this.value?$("#fldDirectPlayVideoCodec",page).show():$("#fldDirectPlayVideoCodec",page).hide(),"Photo"==this.value?$("#fldDirectPlayAudioCodec",page).hide():$("#fldDirectPlayAudioCodec",page).show()}),$("#selectTranscodingProfileType",page).on("change",function(){"Video"==this.value?($("#fldTranscodingVideoCodec",page).show(),$("#fldTranscodingProtocol",page).show(),$("#fldEnableMpegtsM2TsMode",page).show()):($("#fldTranscodingVideoCodec",page).hide(),$("#fldTranscodingProtocol",page).hide(),$("#fldEnableMpegtsM2TsMode",page).hide()),"Photo"==this.value?($("#fldTranscodingAudioCodec",page).hide(),$("#fldEstimateContentLength",page).hide(),$("#fldReportByteRangeRequests",page).hide()):($("#fldTranscodingAudioCodec",page).show(),$("#fldEstimateContentLength",page).show(),$("#fldReportByteRangeRequests",page).show())}),$("#selectResponseProfileType",page).on("change",function(){"Video"==this.value?$("#fldResponseProfileVideoCodec",page).show():$("#fldResponseProfileVideoCodec",page).hide(),"Photo"==this.value?$("#fldResponseProfileAudioCodec",page).hide():$("#fldResponseProfileAudioCodec",page).show()}),$(".btnAddDirectPlayProfile",page).on("click",function(){editDirectPlayProfile(page)}),$(".btnAddTranscodingProfile",page).on("click",function(){editTranscodingProfile(page)}),$(".btnAddContainerProfile",page).on("click",function(){editContainerProfile(page)}),$(".btnAddCodecProfile",page).on("click",function(){editCodecProfile(page)}),$(".btnAddResponseProfile",page).on("click",function(){editResponseProfile(page)}),$(".btnAddIdentificationHttpHeader",page).on("click",function(){editIdentificationHeader(page)}),$(".btnAddXmlDocumentAttribute",page).on("click",function(){editXmlDocumentAttribute(page)}),$(".btnAddSubtitleProfile",page).on("click",function(){editSubtitleProfile(page)}),$(".dlnaProfileForm").off("submit",DlnaProfilePage.onSubmit).on("submit",DlnaProfilePage.onSubmit),$(".editDirectPlayProfileForm").off("submit",DlnaProfilePage.onDirectPlayFormSubmit).on("submit",DlnaProfilePage.onDirectPlayFormSubmit),$(".transcodingProfileForm").off("submit",DlnaProfilePage.onTranscodingProfileFormSubmit).on("submit",DlnaProfilePage.onTranscodingProfileFormSubmit),$(".containerProfileForm").off("submit",DlnaProfilePage.onContainerProfileFormSubmit).on("submit",DlnaProfilePage.onContainerProfileFormSubmit),$(".codecProfileForm").off("submit",DlnaProfilePage.onCodecProfileFormSubmit).on("submit",DlnaProfilePage.onCodecProfileFormSubmit),$(".editResponseProfileForm").off("submit",DlnaProfilePage.onResponseProfileFormSubmit).on("submit",DlnaProfilePage.onResponseProfileFormSubmit),$(".identificationHeaderForm").off("submit",DlnaProfilePage.onIdentificationHeaderFormSubmit).on("submit",DlnaProfilePage.onIdentificationHeaderFormSubmit),$(".xmlAttributeForm").off("submit",DlnaProfilePage.onXmlAttributeFormSubmit).on("submit",DlnaProfilePage.onXmlAttributeFormSubmit),$(".subtitleProfileForm").off("submit",DlnaProfilePage.onSubtitleProfileFormSubmit).on("submit",DlnaProfilePage.onSubtitleProfileFormSubmit)}).on("pageshow","#dlnaProfilePage",function(){var page=this;$("#radioInfo",page).trigger("click"),loadProfile(page)}),window.DlnaProfilePage={onSubmit:function(){return loading.show(),saveProfile($(this).parents(".page"),currentProfile),!1},onDirectPlayFormSubmit:function(){return saveDirectPlayProfile($(this).parents(".page")),!1},onTranscodingProfileFormSubmit:function(){return saveTranscodingProfile($(this).parents(".page")),!1},onContainerProfileFormSubmit:function(){return saveContainerProfile($(this).parents(".page")),!1},onCodecProfileFormSubmit:function(){return saveCodecProfile($(this).parents(".page")),!1},onResponseProfileFormSubmit:function(){return saveResponseProfile($(this).parents(".page")),!1},onIdentificationHeaderFormSubmit:function(){return saveIdentificationHeader($(this).parents(".page")),!1},onXmlAttributeFormSubmit:function(){return saveXmlDocumentAttribute($(this).parents(".page")),!1},onSubtitleProfileFormSubmit:function(){return saveSubtitleProfile($(this).parents(".page")),!1}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/dlnaprofiles.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/dlnaprofiles.js index e17b203f76..2ccfab6760 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/dlnaprofiles.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/dlnaprofiles.js @@ -1 +1 @@ -define(["jQuery","globalize","loading","libraryMenu","listViewStyle","emby-linkbutton"],function($,globalize,loading,libraryMenu){"use strict";function loadProfiles(page){loading.show(),ApiClient.getJSON(ApiClient.getUrl("Dlna/ProfileInfos")).then(function(result){renderUserProfiles(page,result),renderSystemProfiles(page,result),loading.hide()})}function renderUserProfiles(page,profiles){renderProfiles(page,page.querySelector(".customProfiles"),profiles.filter(function(p){return"User"==p.Type}))}function renderSystemProfiles(page,profiles){renderProfiles(page,page.querySelector(".systemProfiles"),profiles.filter(function(p){return"System"==p.Type}))}function renderProfiles(page,element,profiles){var html="";profiles.length&&(html+='
    ');for(var i=0,length=profiles.length;i',html+="",html+='dvr',html+="",html+='","User"==profile.Type&&(html+=''),html+="
    "}profiles.length&&(html+="
    "),element.innerHTML=html,$(".btnDeleteProfile",element).on("click",function(){var id=this.getAttribute("data-profileid");deleteProfile(page,id)})}function deleteProfile(page,id){require(["confirm"],function(confirm){confirm(globalize.translate("MessageConfirmProfileDeletion"),globalize.translate("HeaderConfirmProfileDeletion")).then(function(){loading.show(),ApiClient.ajax({type:"DELETE",url:ApiClient.getUrl("Dlna/Profiles/"+id)}).then(function(){loading.hide(),loadProfiles(page)})})})}function getTabs(){return[{href:"dlnasettings.html",name:globalize.translate("TabSettings")},{href:"dlnaprofiles.html",name:globalize.translate("TabProfiles")}]}$(document).on("pageshow","#dlnaProfilesPage",function(){libraryMenu.setTabs("dlna",1,getTabs);var page=this;loadProfiles(page)})}); \ No newline at end of file +define(["jQuery","globalize","loading","libraryMenu","listViewStyle","emby-linkbutton"],function($,globalize,loading,libraryMenu){"use strict";function loadProfiles(page){loading.show(),ApiClient.getJSON(ApiClient.getUrl("Dlna/ProfileInfos")).then(function(result){renderUserProfiles(page,result),renderSystemProfiles(page,result),loading.hide()})}function renderUserProfiles(page,profiles){renderProfiles(page,page.querySelector(".customProfiles"),profiles.filter(function(p){return"User"==p.Type}))}function renderSystemProfiles(page,profiles){renderProfiles(page,page.querySelector(".systemProfiles"),profiles.filter(function(p){return"System"==p.Type}))}function renderProfiles(page,element,profiles){var html="";profiles.length&&(html+='
    ');for(var i=0,length=profiles.length;i',html+="",html+='dvr',html+="",html+='","User"==profile.Type&&(html+=''),html+="
    "}profiles.length&&(html+="
    "),element.innerHTML=html,$(".btnDeleteProfile",element).on("click",function(){var id=this.getAttribute("data-profileid");deleteProfile(page,id)})}function deleteProfile(page,id){require(["confirm"],function(confirm){confirm(globalize.translate("MessageConfirmProfileDeletion"),globalize.translate("HeaderConfirmProfileDeletion")).then(function(){loading.show(),ApiClient.ajax({type:"DELETE",url:ApiClient.getUrl("Dlna/Profiles/"+id)}).then(function(){loading.hide(),loadProfiles(page)})})})}function getTabs(){return[{href:"dlnasettings.html",name:globalize.translate("TabSettings")},{href:"dlnaprofiles.html",name:globalize.translate("TabProfiles")}]}$(document).on("pageshow","#dlnaProfilesPage",function(){libraryMenu.setTabs("dlna",1,getTabs),loadProfiles(this)})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/editorsidebar.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/editorsidebar.js index 67fec74d3a..c4fa74dcc0 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/editorsidebar.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/editorsidebar.js @@ -1 +1 @@ -define(["datetime","jQuery","material-icons"],function(datetime,$){"use strict";function getNode(item,folderState,selected){var htmlName=getNodeInnerHtml(item),node={id:item.Id,text:htmlName,state:{opened:item.IsFolder&&"open"==folderState,selected:selected},li_attr:{serveritemtype:item.Type,collectiontype:item.CollectionType}};return item.IsFolder?(node.children=[{text:"Loading...",icon:!1}],node.icon=!1):node.icon=!1,node.state.opened&&(node.li_attr.loadedFromServer=!0),selected&&(selectedNodeId=item.Id),node}function getNodeInnerHtml(item){var name=item.Name;item.Number&&(name=item.Number+" - "+name),null!=item.IndexNumber&&"Season"!=item.Type&&(name=item.IndexNumber+" - "+name);var cssClass="editorNode",htmlName="
    ";if(item.LockData&&(htmlName+='lock'),htmlName+=name,item.ImageTags&&item.ImageTags.Primary||(htmlName+=''),item.BackdropImageTags&&item.BackdropImageTags.length||"Episode"!==item.Type&&"Season"!==item.Type&&"Audio"!==item.MediaType&&"TvChannel"!==item.Type&&"MusicAlbum"!==item.Type&&(htmlName+=''),item.ImageTags&&item.ImageTags.Logo||"Movie"!=item.Type&&"Trailer"!=item.Type&&"Series"!=item.Type&&"MusicArtist"!=item.Type&&"BoxSet"!=item.Type||(htmlName+=''),"Episode"==item.Type&&"Virtual"==item.LocationType)try{item.PremiereDate&&(new Date).getTime()>=datetime.parseISO8601Date(item.PremiereDate,!0).getTime()&&(htmlName+='')}catch(err){}return htmlName+="
    "}function loadChildrenOfRootNode(page,scope,callback){ApiClient.getLiveTvChannels({limit:0}).then(function(result){var nodes=[];nodes.push({id:"MediaFolders",text:Globalize.translate("HeaderMediaFolders"),state:{opened:!0},li_attr:{itemtype:"mediafolders",loadedFromServer:!0},icon:!1}),result.TotalRecordCount&&nodes.push({id:"livetv",text:Globalize.translate("HeaderLiveTV"),state:{opened:!1},li_attr:{itemtype:"livetv"},children:[{text:"Loading...",icon:!1}],icon:!1}),callback.call(scope,nodes),nodesToLoad.push("MediaFolders")})}function loadLiveTvChannels(service,openItems,callback){ApiClient.getLiveTvChannels({ServiceName:service,AddCurrentProgram:!1}).then(function(result){var nodes=result.Items.map(function(i){var state=openItems.indexOf(i.Id)==-1?"closed":"open";return getNode(i,state,!1)});callback(nodes)})}function loadMediaFolders(page,scope,openItems,callback){ApiClient.getJSON(ApiClient.getUrl("Library/MediaFolders")).then(function(result){var nodes=result.Items.map(function(n){var state=openItems.indexOf(n.Id)==-1?"closed":"open";return getNode(n,state,!1)});callback.call(scope,nodes);for(var i=0,length=nodes.length;ia",page)[0];if(null!=elem&&($(".editorNode",elem).remove(),$(elem).append(getNodeInnerHtml(item)),item.IsFolder)){var tree=jQuery.jstree._reference(".libraryTree"),currentNode=tree._get_node(null,!1);tree.refresh(currentNode)}}function setCurrentItemId(id){itemId=id}function getCurrentItemId(){if(itemId)return itemId;var url=window.location.hash||window.location.href;return getParameterByName("id",url)}var selectedNodeId,nodesToLoad=[];$(document).on("itemsaved",".metadataEditorPage",function(e,item){updateEditorNode(this,item)}).on("pagebeforeshow",".metadataEditorPage",function(){require(["css!css/metadataeditor.css"])}).on("pagebeforeshow",".metadataEditorPage",function(){var page=this;Dashboard.getCurrentUser().then(function(user){var id=getCurrentItemId();id?ApiClient.getAncestorItems(id,user.Id).then(function(ancestors){var ids=ancestors.map(function(i){return i.Id});initializeTree(page,user,ids,id)}):initializeTree(page,user,[])})}).on("pagebeforehide",".metadataEditorPage",function(){var page=this;$(".libraryTree",page).off("select_node.jstree",onNodeSelect).off("open_node.jstree",onNodeOpen).off("load_node.jstree",onNodeLoad)});var itemId;window.MetadataEditor={getItemPromise:function(){var currentItemId=getCurrentItemId();return currentItemId?ApiClient.getItem(Dashboard.getCurrentUserId(),currentItemId):ApiClient.getRootFolder(Dashboard.getCurrentUserId())},getCurrentItemId:getCurrentItemId,setCurrentItemId:setCurrentItemId}}); \ No newline at end of file +define(["datetime","jQuery","material-icons"],function(datetime,$){"use strict";function getNode(item,folderState,selected){var htmlName=getNodeInnerHtml(item),node={id:item.Id,text:htmlName,state:{opened:item.IsFolder&&"open"==folderState,selected:selected},li_attr:{serveritemtype:item.Type,collectiontype:item.CollectionType}};return item.IsFolder?(node.children=[{text:"Loading...",icon:!1}],node.icon=!1):node.icon=!1,node.state.opened&&(node.li_attr.loadedFromServer=!0),selected&&(selectedNodeId=item.Id),node}function getNodeInnerHtml(item){var name=item.Name;item.Number&&(name=item.Number+" - "+name),null!=item.IndexNumber&&"Season"!=item.Type&&(name=item.IndexNumber+" - "+name);var htmlName="
    ";if(item.LockData&&(htmlName+='lock'),htmlName+=name,item.ImageTags&&item.ImageTags.Primary||(htmlName+=''),item.BackdropImageTags&&item.BackdropImageTags.length||"Episode"!==item.Type&&"Season"!==item.Type&&"Audio"!==item.MediaType&&"TvChannel"!==item.Type&&"MusicAlbum"!==item.Type&&(htmlName+=''),item.ImageTags&&item.ImageTags.Logo||"Movie"!=item.Type&&"Trailer"!=item.Type&&"Series"!=item.Type&&"MusicArtist"!=item.Type&&"BoxSet"!=item.Type||(htmlName+=''),"Episode"==item.Type&&"Virtual"==item.LocationType)try{item.PremiereDate&&(new Date).getTime()>=datetime.parseISO8601Date(item.PremiereDate,!0).getTime()&&(htmlName+='')}catch(err){}return htmlName+="
    "}function loadChildrenOfRootNode(page,scope,callback){ApiClient.getLiveTvChannels({limit:0}).then(function(result){var nodes=[];nodes.push({id:"MediaFolders",text:Globalize.translate("HeaderMediaFolders"),state:{opened:!0},li_attr:{itemtype:"mediafolders",loadedFromServer:!0},icon:!1}),result.TotalRecordCount&&nodes.push({id:"livetv",text:Globalize.translate("HeaderLiveTV"),state:{opened:!1},li_attr:{itemtype:"livetv"},children:[{text:"Loading...",icon:!1}],icon:!1}),callback.call(scope,nodes),nodesToLoad.push("MediaFolders")})}function loadLiveTvChannels(service,openItems,callback){ApiClient.getLiveTvChannels({ServiceName:service,AddCurrentProgram:!1}).then(function(result){var nodes=result.Items.map(function(i){return getNode(i,-1==openItems.indexOf(i.Id)?"closed":"open",!1)});callback(nodes)})}function loadMediaFolders(page,scope,openItems,callback){ApiClient.getJSON(ApiClient.getUrl("Library/MediaFolders")).then(function(result){var nodes=result.Items.map(function(n){return getNode(n,-1==openItems.indexOf(n.Id)?"closed":"open",!1)});callback.call(scope,nodes);for(var i=0,length=nodes.length;ia",page)[0];if(null!=elem&&($(".editorNode",elem).remove(),$(elem).append(getNodeInnerHtml(item)),item.IsFolder)){var tree=jQuery.jstree._reference(".libraryTree"),currentNode=tree._get_node(null,!1);tree.refresh(currentNode)}}function setCurrentItemId(id){itemId=id}function getCurrentItemId(){if(itemId)return itemId;var url=window.location.hash||window.location.href;return getParameterByName("id",url)}var selectedNodeId,nodesToLoad=[];$(document).on("itemsaved",".metadataEditorPage",function(e,item){updateEditorNode(this,item)}).on("pagebeforeshow",".metadataEditorPage",function(){require(["css!css/metadataeditor.css"])}).on("pagebeforeshow",".metadataEditorPage",function(){var page=this;Dashboard.getCurrentUser().then(function(user){var id=getCurrentItemId();id?ApiClient.getAncestorItems(id,user.Id).then(function(ancestors){var ids=ancestors.map(function(i){return i.Id});initializeTree(page,user,ids,id)}):initializeTree(page,user,[])})}).on("pagebeforehide",".metadataEditorPage",function(){$(".libraryTree",this).off("select_node.jstree",onNodeSelect).off("open_node.jstree",onNodeOpen).off("load_node.jstree",onNodeLoad)});var itemId;window.MetadataEditor={getItemPromise:function(){var currentItemId=getCurrentItemId();return currentItemId?ApiClient.getItem(Dashboard.getCurrentUserId(),currentItemId):ApiClient.getRootFolder(Dashboard.getCurrentUserId())},getCurrentItemId:getCurrentItemId,setCurrentItemId:setCurrentItemId}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/encodingsettings.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/encodingsettings.js index 33cd5270ee..b341cba2d1 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/encodingsettings.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/encodingsettings.js @@ -1 +1 @@ -define(["jQuery","loading","globalize","dom"],function($,loading,globalize,dom){"use strict";function loadPage(page,config,systemInfo){Array.prototype.forEach.call(page.querySelectorAll(".chkDecodeCodec"),function(c){c.checked=(config.HardwareDecodingCodecs||[]).indexOf(c.getAttribute("data-codec"))!==-1}),page.querySelector("#chkHardwareEncoding").checked=config.EnableHardwareEncoding,$("#selectVideoDecoder",page).val(config.HardwareAccelerationType),$("#selectThreadCount",page).val(config.EncodingThreadCount),$("#txtDownMixAudioBoost",page).val(config.DownMixAudioBoost),page.querySelector(".txtEncoderPath").value=config.EncoderAppPath||"",$("#txtTranscodingTempPath",page).val(config.TranscodingTempPath||""),$("#txtVaapiDevice",page).val(config.VaapiDevice||""),page.querySelector("#selectH264Preset").value=config.H264Preset||"",page.querySelector("#txtH264Crf").value=config.H264Crf||"",page.querySelector("#chkEnableSubtitleExtraction").checked=config.EnableSubtitleExtraction||!1,page.querySelector("#selectDeinterlaceMethod").value=config.DeinterlaceMethod||"",page.querySelector("#selectVideoDecoder").dispatchEvent(new CustomEvent("change",{bubbles:!0})),loading.hide()}function onSaveEncodingPathFailure(response){loading.hide();var msg="";msg=globalize.translate("FFmpegSavePathNotFound"),require(["alert"],function(alert){alert(msg)})}function updateEncoder(form){return ApiClient.getSystemInfo().then(function(systemInfo){return ApiClient.ajax({url:ApiClient.getUrl("System/MediaEncoder/Path"),type:"POST",data:{Path:form.querySelector(".txtEncoderPath").value,PathType:"Custom"}}).then(Dashboard.processServerConfigurationUpdateResult,onSaveEncodingPathFailure)})}function onSubmit(){var form=this,onDecoderConfirmed=function(){loading.show(),ApiClient.getNamedConfiguration("encoding").then(function(config){config.DownMixAudioBoost=$("#txtDownMixAudioBoost",form).val(),config.TranscodingTempPath=$("#txtTranscodingTempPath",form).val(),config.EncodingThreadCount=$("#selectThreadCount",form).val(),config.HardwareAccelerationType=$("#selectVideoDecoder",form).val(),config.VaapiDevice=$("#txtVaapiDevice",form).val(),config.H264Preset=form.querySelector("#selectH264Preset").value,config.H264Crf=parseInt(form.querySelector("#txtH264Crf").value||"0"),config.EnableSubtitleExtraction=form.querySelector("#chkEnableSubtitleExtraction").checked,config.DeinterlaceMethod=form.querySelector("#selectDeinterlaceMethod").value||null,config.HardwareDecodingCodecs=Array.prototype.map.call(Array.prototype.filter.call(form.querySelectorAll(".chkDecodeCodec"),function(c){return c.checked}),function(c){return c.getAttribute("data-codec")}),config.EnableHardwareEncoding=form.querySelector("#chkHardwareEncoding").checked,ApiClient.updateNamedConfiguration("encoding",config).then(function(){updateEncoder(form)})})};return $("#selectVideoDecoder",form).val()?require(["alert"],function(alert){alert({title:globalize.translate("TitleHardwareAcceleration"),text:globalize.translate("HardwareAccelerationWarning")}).then(onDecoderConfirmed)}):onDecoderConfirmed(),!1}function setDecodingCodecsVisible(context,value){value=value||"";var any;Array.prototype.forEach.call(context.querySelectorAll(".chkDecodeCodec"),function(c){c.getAttribute("data-types").split(",").indexOf(value)===-1?dom.parentWithTag(c,"LABEL").classList.add("hide"):(dom.parentWithTag(c,"LABEL").classList.remove("hide"),any=!0)}),any?context.querySelector(".decodingCodecsList").classList.remove("hide"):context.querySelector(".decodingCodecsList").classList.add("hide")}$(document).on("pageinit","#encodingSettingsPage",function(){var page=this;page.querySelector("#selectVideoDecoder").addEventListener("change",function(){"vaapi"==this.value?(page.querySelector(".fldVaapiDevice").classList.remove("hide"),page.querySelector("#txtVaapiDevice").setAttribute("required","required")):(page.querySelector(".fldVaapiDevice").classList.add("hide"),page.querySelector("#txtVaapiDevice").removeAttribute("required")),this.value?page.querySelector(".hardwareAccelerationOptions").classList.remove("hide"):page.querySelector(".hardwareAccelerationOptions").classList.add("hide"),setDecodingCodecsVisible(page,this.value)}),$("#btnSelectEncoderPath",page).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({includeFiles:!0,callback:function(path){path&&$(".txtEncoderPath",page).val(path),picker.close()}})})}),$("#btnSelectTranscodingTempPath",page).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({callback:function(path){path&&$("#txtTranscodingTempPath",page).val(path),picker.close()},validateWriteable:!0,header:globalize.translate("HeaderSelectTranscodingPath"),instruction:globalize.translate("HeaderSelectTranscodingPathHelp")})})}),$(".encodingSettingsForm").off("submit",onSubmit).on("submit",onSubmit)}).on("pageshow","#encodingSettingsPage",function(){loading.show();var page=this;ApiClient.getNamedConfiguration("encoding").then(function(config){ApiClient.getSystemInfo().then(function(systemInfo){"External"==systemInfo.EncoderLocationType?(page.querySelector(".fldEncoderPath").classList.add("hide"),page.querySelector(".txtEncoderPath").removeAttribute("required")):(page.querySelector(".fldEncoderPath").classList.remove("hide"),page.querySelector(".txtEncoderPath").setAttribute("required","required")),loadPage(page,config,systemInfo)})})})}); \ No newline at end of file +define(["jQuery","loading","globalize","dom"],function($,loading,globalize,dom){"use strict";function loadPage(page,config,systemInfo){Array.prototype.forEach.call(page.querySelectorAll(".chkDecodeCodec"),function(c){c.checked=-1!==(config.HardwareDecodingCodecs||[]).indexOf(c.getAttribute("data-codec"))}),page.querySelector("#chkHardwareEncoding").checked=config.EnableHardwareEncoding,$("#selectVideoDecoder",page).val(config.HardwareAccelerationType),$("#selectThreadCount",page).val(config.EncodingThreadCount),$("#txtDownMixAudioBoost",page).val(config.DownMixAudioBoost),page.querySelector(".txtEncoderPath").value=config.EncoderAppPath||"",$("#txtTranscodingTempPath",page).val(config.TranscodingTempPath||""),$("#txtVaapiDevice",page).val(config.VaapiDevice||""),page.querySelector("#selectH264Preset").value=config.H264Preset||"",page.querySelector("#txtH264Crf").value=config.H264Crf||"",page.querySelector("#chkEnableSubtitleExtraction").checked=config.EnableSubtitleExtraction||!1,page.querySelector("#selectVideoDecoder").dispatchEvent(new CustomEvent("change",{bubbles:!0})),loading.hide()}function onSaveEncodingPathFailure(response){loading.hide();var msg="";msg=globalize.translate("FFmpegSavePathNotFound"),require(["alert"],function(alert){alert(msg)})}function updateEncoder(form){return ApiClient.getSystemInfo().then(function(systemInfo){return ApiClient.ajax({url:ApiClient.getUrl("System/MediaEncoder/Path"),type:"POST",data:{Path:form.querySelector(".txtEncoderPath").value,PathType:"Custom"}}).then(Dashboard.processServerConfigurationUpdateResult,onSaveEncodingPathFailure)})}function onSubmit(){var form=this,onDecoderConfirmed=function(){loading.show(),ApiClient.getNamedConfiguration("encoding").then(function(config){config.DownMixAudioBoost=$("#txtDownMixAudioBoost",form).val(),config.TranscodingTempPath=$("#txtTranscodingTempPath",form).val(),config.EncodingThreadCount=$("#selectThreadCount",form).val(),config.HardwareAccelerationType=$("#selectVideoDecoder",form).val(),config.VaapiDevice=$("#txtVaapiDevice",form).val(),config.H264Preset=form.querySelector("#selectH264Preset").value,config.H264Crf=parseInt(form.querySelector("#txtH264Crf").value||"0"),config.EnableSubtitleExtraction=form.querySelector("#chkEnableSubtitleExtraction").checked,config.HardwareDecodingCodecs=Array.prototype.map.call(Array.prototype.filter.call(form.querySelectorAll(".chkDecodeCodec"),function(c){return c.checked}),function(c){return c.getAttribute("data-codec")}),config.EnableHardwareEncoding=form.querySelector("#chkHardwareEncoding").checked,ApiClient.updateNamedConfiguration("encoding",config).then(function(){updateEncoder(form)})})};return $("#selectVideoDecoder",form).val()?require(["alert"],function(alert){alert({title:globalize.translate("TitleHardwareAcceleration"),text:globalize.translate("HardwareAccelerationWarning")}).then(onDecoderConfirmed)}):onDecoderConfirmed(),!1}function setDecodingCodecsVisible(context,value){value=value||"";var any;Array.prototype.forEach.call(context.querySelectorAll(".chkDecodeCodec"),function(c){-1===c.getAttribute("data-types").split(",").indexOf(value)?dom.parentWithTag(c,"LABEL").classList.add("hide"):(dom.parentWithTag(c,"LABEL").classList.remove("hide"),any=!0)}),any?context.querySelector(".decodingCodecsList").classList.remove("hide"):context.querySelector(".decodingCodecsList").classList.add("hide")}$(document).on("pageinit","#encodingSettingsPage",function(){var page=this;page.querySelector("#selectVideoDecoder").addEventListener("change",function(){"vaapi"==this.value?(page.querySelector(".fldVaapiDevice").classList.remove("hide"),page.querySelector("#txtVaapiDevice").setAttribute("required","required")):(page.querySelector(".fldVaapiDevice").classList.add("hide"),page.querySelector("#txtVaapiDevice").removeAttribute("required")),this.value?page.querySelector(".hardwareAccelerationOptions").classList.remove("hide"):page.querySelector(".hardwareAccelerationOptions").classList.add("hide"),setDecodingCodecsVisible(page,this.value)}),$("#btnSelectEncoderPath",page).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({includeFiles:!0,callback:function(path){path&&$(".txtEncoderPath",page).val(path),picker.close()}})})}),$("#btnSelectTranscodingTempPath",page).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({callback:function(path){path&&$("#txtTranscodingTempPath",page).val(path),picker.close()},validateWriteable:!0,header:globalize.translate("HeaderSelectTranscodingPath"),instruction:globalize.translate("HeaderSelectTranscodingPathHelp")})})}),$(".encodingSettingsForm").off("submit",onSubmit).on("submit",onSubmit)}).on("pageshow","#encodingSettingsPage",function(){loading.show();var page=this;ApiClient.getNamedConfiguration("encoding").then(function(config){ApiClient.getSystemInfo().then(function(systemInfo){"External"==systemInfo.EncoderLocationType?(page.querySelector(".fldEncoderPath").classList.add("hide"),page.querySelector(".txtEncoderPath").removeAttribute("required")):(page.querySelector(".fldEncoderPath").classList.remove("hide"),page.querySelector(".txtEncoderPath").setAttribute("required","required")),loadPage(page,config,systemInfo)})})})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/episodes.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/episodes.js index d32209b482..9407a50a50 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/episodes.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/episodes.js @@ -1 +1 @@ -define(["loading","events","libraryBrowser","imageLoader","listView","cardBuilder","emby-itemscontainer"],function(loading,events,libraryBrowser,imageLoader,listView,cardBuilder){"use strict";return function(view,params,tabContent){function getPageData(context){var key=getSavedQueryKey(context),pageData=data[key];return pageData||(pageData=data[key]={query:{SortBy:"SeriesSortName,SortName",SortOrder:"Ascending",IncludeItemTypes:"Episode",Recursive:!0,Fields:"PrimaryImageAspectRatio,MediaSourceCount,UserData",IsMissing:!1,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Thumb",StartIndex:0,Limit:pageSize},view:libraryBrowser.getSavedView(key)||"Poster"},pageData.query.ParentId=params.topParentId,libraryBrowser.loadSavedQueryValues(key,pageData.query)),pageData}function getQuery(context){return getPageData(context).query}function getSavedQueryKey(context){return context.savedQueryKey||(context.savedQueryKey=libraryBrowser.getSavedQueryKey("episodes")),context.savedQueryKey}function onViewStyleChange(){var viewStyle=self.getCurrentViewStyle(),itemsContainer=tabContent.querySelector(".itemsContainer");"List"==viewStyle?(itemsContainer.classList.add("vertical-list"),itemsContainer.classList.remove("vertical-wrap")):(itemsContainer.classList.remove("vertical-list"),itemsContainer.classList.add("vertical-wrap")),itemsContainer.innerHTML=""}function reloadItems(page){loading.show();var query=getQuery(page);ApiClient.getItems(Dashboard.getCurrentUserId(),query).then(function(result){function onNextPageClick(){query.StartIndex+=query.Limit,reloadItems(tabContent)}function onPreviousPageClick(){query.StartIndex-=query.Limit,reloadItems(tabContent)}window.scrollTo(0,0);var html,pagingHtml=libraryBrowser.getQueryPagingHtml({startIndex:query.StartIndex,limit:query.Limit,totalRecordCount:result.TotalRecordCount,showLimit:!1,updatePageSizeSetting:!1,addLayoutButton:!1,sortButton:!1,filterButton:!1}),viewStyle=self.getCurrentViewStyle(),itemsContainer=tabContent.querySelector(".itemsContainer");html="List"==viewStyle?listView.getListViewHtml({items:result.Items,sortBy:query.SortBy,showParentTitle:!0}):"PosterCard"==viewStyle?cardBuilder.getCardsHtml({items:result.Items,shape:"backdrop",showTitle:!0,showParentTitle:!0,scalable:!0,cardLayout:!0}):cardBuilder.getCardsHtml({items:result.Items,shape:"backdrop",showTitle:!0,showParentTitle:!0,overlayText:!1,centerText:!0,scalable:!0,overlayPlayButton:!0});var i,length,elems=tabContent.querySelectorAll(".paging");for(i=0,length=elems.length;i"}function renderSeriesTimerSchedule(page,apiClient,seriesTimerId){apiClient.getLiveTvTimers({UserId:apiClient.getCurrentUserId(),ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Thumb",SortBy:"StartDate",EnableTotalRecordCount:!1,EnableUserData:!1,SeriesTimerId:seriesTimerId,Fields:"ChannelInfo,ChannelImage"}).then(function(result){result.Items.length&&result.Items[0].SeriesTimerId!=seriesTimerId&&(result.Items=[]);var html=getProgramScheduleHtml(result.Items),scheduleTab=page.querySelector(".seriesTimerSchedule");scheduleTab.innerHTML=html,imageLoader.lazyChildren(scheduleTab)})}function renderTimerEditor(page,item,apiClient,user){return"Recording"===item.Type&&user.Policy.EnableLiveTvManagement&&item.TimerId&&"InProgress"===item.Status?void hideAll(page,"btnCancelTimer",!0):void hideAll(page,"btnCancelTimer")}function renderSeriesTimerEditor(page,item,apiClient,user){return"SeriesTimer"!==item.Type?void hideAll(page,"btnCancelSeriesTimer"):user.Policy.EnableLiveTvManagement?(require(["seriesRecordingEditor"],function(seriesRecordingEditor){seriesRecordingEditor.embed(item,apiClient.serverId(),{context:page.querySelector(".seriesRecordingEditor")})}),page.querySelector(".seriesTimerScheduleSection").classList.remove("hide"),hideAll(page,"btnCancelSeriesTimer",!0),void renderSeriesTimerSchedule(page,apiClient,item.Id)):(page.querySelector(".seriesTimerScheduleSection").classList.add("hide"),void hideAll(page,"btnCancelSeriesTimer"))}function renderTrackSelections(page,item){var select=page.querySelector(".selectSource");if(!item.MediaSources||!itemHelper.supportsMediaSourceSelection(item)||playbackManager.getSupportedCommands().indexOf("PlayMediaSource")===-1||!playbackManager.canPlay(item))return page.querySelector(".trackSelections").classList.add("hide"),select.innerHTML="",page.querySelector(".selectVideo").innerHTML="",page.querySelector(".selectAudio").innerHTML="",void(page.querySelector(".selectSubtitles").innerHTML="");page.querySelector(".trackSelections").classList.remove("hide"),select.setLabel(globalize.translate("sharedcomponents#LabelVersion"));var currentValue=select.value,selectedId=item.MediaSources[0].Id;select.innerHTML=item.MediaSources.map(function(v){var selected=v.Id===selectedId?" selected":"";return'"}).join(""),item.MediaSources.length>1?page.querySelector(".selectSourceContainer").classList.remove("hide"):page.querySelector(".selectSourceContainer").classList.add("hide"),select.value!==currentValue&&(renderVideoSelections(page,item),renderAudioSelections(page,item),renderSubtitleSelections(page,item))}function renderVideoSelections(page,item){var mediaSourceId=page.querySelector(".selectSource").value,mediaSource=item.MediaSources.filter(function(m){return m.Id===mediaSourceId})[0],tracks=mediaSource.MediaStreams.filter(function(m){return"Video"===m.Type}),select=page.querySelector(".selectVideo");select.setLabel(globalize.translate("sharedcomponents#LabelVideo"));var selectedId=tracks.length?tracks[0].Index:-1;select.innerHTML=tracks.map(function(v){var selected=v.Index===selectedId?" selected":"",titleParts=[],resolutionText=mediaInfo.getResolutionText(v);return resolutionText&&titleParts.push(resolutionText),v.Codec&&titleParts.push(v.Codec.toUpperCase()),'"}).join(""),select.setAttribute("disabled","disabled"),tracks.length?page.querySelector(".selectVideoContainer").classList.remove("hide"):page.querySelector(".selectVideoContainer").classList.add("hide")}function renderAudioSelections(page,item){var mediaSourceId=page.querySelector(".selectSource").value,mediaSource=item.MediaSources.filter(function(m){return m.Id===mediaSourceId})[0],tracks=mediaSource.MediaStreams.filter(function(m){return"Audio"===m.Type}),select=page.querySelector(".selectAudio");select.setLabel(globalize.translate("sharedcomponents#LabelAudio"));var selectedId=mediaSource.DefaultAudioStreamIndex;select.innerHTML=tracks.map(function(v){var selected=v.Index===selectedId?" selected":"";return'"}).join(""),tracks.length>1?select.removeAttribute("disabled"):select.setAttribute("disabled","disabled"),tracks.length?page.querySelector(".selectAudioContainer").classList.remove("hide"):page.querySelector(".selectAudioContainer").classList.add("hide")}function renderSubtitleSelections(page,item){var mediaSourceId=page.querySelector(".selectSource").value,mediaSource=item.MediaSources.filter(function(m){return m.Id===mediaSourceId})[0],tracks=mediaSource.MediaStreams.filter(function(m){return"Subtitle"===m.Type}),select=page.querySelector(".selectSubtitles");select.setLabel(globalize.translate("sharedcomponents#LabelSubtitles"));var selectedId=null==mediaSource.DefaultSubtitleStreamIndex?-1:mediaSource.DefaultSubtitleStreamIndex;if(tracks.length){var selected=selectedId===-1?" selected":"";select.innerHTML='"+tracks.map(function(v){return selected=v.Index===selectedId?" selected":"",'"}).join(""),page.querySelector(".selectSubtitlesContainer").classList.remove("hide")}else select.innerHTML="",page.querySelector(".selectSubtitlesContainer").classList.add("hide")}function reloadPlayButtons(page,item){var canPlay=!1;if("Program"==item.Type){var now=new Date;now>=datetime.parseISO8601Date(item.StartDate,!0)&&now0)}else hideAll(page,"btnPlay"),hideAll(page,"btnResume"),hideAll(page,"btnInstantMix"),hideAll(page,"btnShuffle");return canPlay}function reloadUserDataButtons(page,item){var i,length,btnPlaystates=page.querySelectorAll(".btnPlaystate");for(i=0,length=btnPlaystates.length;i'+artist.Name+"")}return html=html.join(" / ")}function renderName(item,container,isStatic,context){var parentRoute,parentNameHtml=[],parentNameLast=!1;item.AlbumArtists?(parentNameHtml.push(getArtistLinksHtml(item.AlbumArtists,item.ServerId,context)),parentNameLast=!0):item.ArtistItems&&item.ArtistItems.length&&"MusicVideo"===item.Type?(parentNameHtml.push(getArtistLinksHtml(item.ArtistItems,item.ServerId,context)),parentNameLast=!0):item.SeriesName&&"Episode"===item.Type?(parentRoute=appRouter.getRouteUrl({Id:item.SeriesId,Name:item.SeriesName,Type:"Series",IsFolder:!0,ServerId:item.ServerId},{context:context}),parentNameHtml.push(''+item.SeriesName+"")):(item.IsSeries||item.EpisodeTitle)&&parentNameHtml.push(item.Name),item.SeriesName&&"Season"===item.Type?(parentRoute=appRouter.getRouteUrl({Id:item.SeriesId,Name:item.SeriesName,Type:"Series",IsFolder:!0,ServerId:item.ServerId},{context:context}),parentNameHtml.push(''+item.SeriesName+"")):null!=item.ParentIndexNumber&&"Episode"===item.Type?(parentRoute=appRouter.getRouteUrl({Id:item.SeasonId,Name:item.SeasonName,Type:"Season",IsFolder:!0,ServerId:item.ServerId},{context:context}),parentNameHtml.push(''+item.SeasonName+"")):null!=item.ParentIndexNumber&&item.IsSeries?parentNameHtml.push(item.SeasonName||"S"+item.ParentIndexNumber):item.Album&&"Audio"===item.Type&&(item.AlbumId||item.ParentId)?(parentRoute=appRouter.getRouteUrl({Id:item.AlbumId||item.ParentId,Name:item.Album,Type:"MusicAlbum",IsFolder:!0,ServerId:item.ServerId},{context:context}),parentNameHtml.push(''+item.Album+"")):item.Album&&"MusicVideo"===item.Type&&item.AlbumId?(parentRoute=appRouter.getRouteUrl({Id:item.Albumid,Name:item.Album,Type:"MusicAlbum",IsFolder:!0,ServerId:item.ServerId},{context:context}),parentNameHtml.push(''+item.Album+"")):item.Album&&parentNameHtml.push(item.Album);var html="";parentNameHtml.length&&(html=parentNameLast?'

    '+parentNameHtml.join(" - ")+"

    ":'

    '+parentNameHtml.join(" - ")+"

    ");var name=itemHelper.getDisplayName(item,{includeParentInfo:!1});html&&!parentNameLast?html+='

    '+name+"

    ":html=parentNameLast?'

    '+name+"

    "+html:'

    '+name+"

    "+html,container.innerHTML=html,html.length?container.classList.remove("hide"):container.classList.add("hide")}function reloadFromItem(instance,page,params,item,user){var context=params.context;renderName(item,page.querySelector(".nameContainer"),!1,context);var apiClient=connectionManager.getApiClient(item.ServerId);renderSeriesTimerEditor(page,item,apiClient,user),renderTimerEditor(page,item,apiClient,user),renderImage(page,item,apiClient,user),renderLogo(page,item,apiClient),setTitle(item,apiClient),setInitialCollapsibleState(page,item,apiClient,context,user),renderDetails(page,item,apiClient,context),renderTrackSelections(page,item),dom.getWindowSize().innerWidth>=1e3?backdrop.setBackdrops([item]):backdrop.clear(),libraryBrowser.renderDetailPageBackdrop(page,item,apiClient,imageLoader,indicators);var canPlay=reloadPlayButtons(page,item),hasAnyButton=canPlay;item.LocalTrailerCount||item.RemoteTrailers&&item.RemoteTrailers.length?(hideAll(page,"btnPlayTrailer",!0),hasAnyButton=!0):hideAll(page,"btnPlayTrailer"),item.CanDelete&&!item.IsFolder?(hideAll(page,"btnDeleteItem",!0),hasAnyButton=!0):hideAll(page,"btnDeleteItem"),renderSyncLocalContainer(page,params,user,item),hasAnyButton||"Program"!==item.Type?hideAll(page,"mainDetailButtons",!0):hideAll(page,"mainDetailButtons"),showRecordingFields(instance,page,item,user);var groupedVersions=(item.MediaSources||[]).filter(function(g){return"Grouping"==g.Type});user.Policy.IsAdministrator&&groupedVersions.length?page.querySelector(".splitVersionContainer").classList.remove("hide"):page.querySelector(".splitVersionContainer").classList.add("hide");var commands=itemContextMenu.getCommands(getContextMenuOptions(item,user));commands.length?hideAll(page,"btnMoreCommands",!0):hideAll(page,"btnMoreCommands");var itemBirthday=page.querySelector("#itemBirthday");if("Person"==item.Type&&item.PremiereDate)try{var birthday=datetime.parseISO8601Date(item.PremiereDate,!0).toDateString();itemBirthday.classList.remove("hide"),itemBirthday.innerHTML=globalize.translate("BirthDateValue").replace("{0}",birthday)}catch(err){itemBirthday.classList.add("hide")}else itemBirthday.classList.add("hide");var itemDeathDate=page.querySelector("#itemDeathDate");if("Person"==item.Type&&item.EndDate)try{var deathday=datetime.parseISO8601Date(item.EndDate,!0).toDateString();itemDeathDate.classList.remove("hide"),itemDeathDate.innerHTML=globalize.translate("DeathDateValue").replace("{0}",deathday)}catch(err){itemDeathDate.classList.add("hide")}var itemBirthLocation=page.querySelector("#itemBirthLocation");if("Person"==item.Type&&item.ProductionLocations&&item.ProductionLocations.length){var gmap=''+item.ProductionLocations[0]+"";itemBirthLocation.classList.remove("hide"),itemBirthLocation.innerHTML=globalize.translate("BirthPlaceValue").replace("{0}",gmap)}else itemBirthLocation.classList.add("hide");setPeopleHeader(page,item),loading.hide()}function logoImageUrl(item,apiClient,options){return options=options||{},options.type="Logo",item.ImageTags&&item.ImageTags.Logo?(options.tag=item.ImageTags.Logo,apiClient.getScaledImageUrl(item.Id,options)):item.ParentLogoImageTag?(options.tag=item.ParentLogoImageTag,apiClient.getScaledImageUrl(item.ParentLogoItemId,options)):null}function setTitle(item,apiClient){var url=logoImageUrl(item,apiClient,{});if(url=null){var pageTitle=document.querySelector(".pageTitle");pageTitle.style.backgroundImage="url('"+url+"')",pageTitle.classList.add("pageTitleWithLogo"),pageTitle.innerHTML=""}else Emby.Page.setTitle("")}function renderLogo(page,item,apiClient){var url=logoImageUrl(item,apiClient,{maxWidth:300}),detailLogo=page.querySelector(".detailLogo");url?(detailLogo.classList.remove("hide"),detailLogo.classList.add("lazy"),detailLogo.setAttribute("data-src",url),imageLoader.lazyImage(detailLogo)):detailLogo.classList.add("hide")}function showRecordingFields(instance,page,item,user){if(!instance.currentRecordingFields){var recordingFieldsElement=page.querySelector(".recordingFields");"Program"==item.Type&&user.Policy.EnableLiveTvManagement?require(["recordingFields"],function(recordingFields){instance.currentRecordingFields=new recordingFields({parent:recordingFieldsElement,programId:item.Id,serverId:item.ServerId}),recordingFieldsElement.classList.remove("hide")}):(recordingFieldsElement.classList.add("hide"),recordingFieldsElement.innerHTML="")}}function renderLinks(linksElem,item){var html=[];if(item.DateCreated&&itemHelper.enableDateAddedDisplay(item)){var dateCreated=datetime.parseISO8601Date(item.DateCreated);html.push(globalize.translate("sharedcomponents#AddedOnValue",datetime.toLocaleDateString(dateCreated)+" "+datetime.getDisplayTime(dateCreated)))}var links=[];if(!layoutManager.tv&&(item.HomePageUrl&&links.push(''+globalize.translate("ButtonWebsite")+""),item.ExternalUrls))for(var i=0,length=item.ExternalUrls.length;i'+url.Name+"")}links.length&&html.push(globalize.translate("sharedcomponents#LinksValue",links.join(", "))),linksElem.innerHTML=html.join(", "),html.length?linksElem.classList.remove("hide"):linksElem.classList.add("hide")}function renderImage(page,item,apiClient,user){var container=page.querySelector(".detailImageContainer");libraryBrowser.renderDetailImage(page,container,item,apiClient,user.Policy.IsAdministrator&&"Photo"!=item.MediaType,imageLoader,indicators)}function refreshDetailImageUserData(elem,item){var detailImageProgressContainer=elem.querySelector(".detailImageProgressContainer");detailImageProgressContainer.innerHTML=indicators.getProgressBarHtml(item)}function refreshImage(page,item,user){refreshDetailImageUserData(page.querySelector(".detailImageContainer"),item)}function setPeopleHeader(page,item){"Audio"==item.MediaType||"MusicAlbum"==item.Type||"Book"==item.MediaType||"Photo"==item.MediaType?page.querySelector("#peopleHeader").innerHTML=globalize.translate("HeaderPeople"):page.querySelector("#peopleHeader").innerHTML=globalize.translate("HeaderCastAndCrew")}function renderNextUp(page,item,user){var section=page.querySelector(".nextUpSection");return"Series"!=item.Type?void section.classList.add("hide"):void connectionManager.getApiClient(item.ServerId).getNextUpEpisodes({SeriesId:item.Id,UserId:user.Id}).then(function(result){result.Items.length?section.classList.remove("hide"):section.classList.add("hide");var html=cardBuilder.getCardsHtml({items:result.Items,shape:getThumbShape(!1),showTitle:!0,displayAsSpecial:"Season"==item.Type&&item.IndexNumber,overlayText:!1,centerText:!0,overlayPlayButton:!0}),itemsContainer=section.querySelector(".nextUpItems");itemsContainer.innerHTML=html,imageLoader.lazyChildren(itemsContainer)})}function setInitialCollapsibleState(page,item,apiClient,context,user){page.querySelector(".collectionItems").innerHTML="","Playlist"==item.Type?(page.querySelector("#childrenCollapsible").classList.remove("hide"),renderPlaylistItems(page,item,user)):"Studio"==item.Type||"Person"==item.Type||"Genre"==item.Type||"MusicGenre"==item.Type||"GameGenre"==item.Type||"MusicArtist"==item.Type?(page.querySelector("#childrenCollapsible").classList.remove("hide"),renderItemsByName(page,item,user)):item.IsFolder?("BoxSet"==item.Type&&page.querySelector("#childrenCollapsible").classList.add("hide"),renderChildren(page,item)):page.querySelector("#childrenCollapsible").classList.add("hide"),"Series"==item.Type&&renderSeriesSchedule(page,item,user),"Series"==item.Type?renderNextUp(page,item,user):page.querySelector(".nextUpSection").classList.add("hide"),item.MediaSources&&item.MediaSources.length&&(null==item.EnableMediaSourceDisplay?"Channel"!==item.SourceType:item.EnableMediaSourceDisplay)?renderMediaSources(page,user,item):page.querySelector(".audioVideoMediaInfo").classList.add("hide"),renderScenes(page,item),item.SpecialFeatureCount&&0!=item.SpecialFeatureCount&&"Series"!=item.Type?(page.querySelector("#specialsCollapsible").classList.remove("hide"),renderSpecials(page,item,user,6)):page.querySelector("#specialsCollapsible").classList.add("hide"),renderCast(page,item,context,enableScrollX()?null:12),item.PartCount&&item.PartCount>1?(page.querySelector("#additionalPartsCollapsible").classList.remove("hide"),renderAdditionalParts(page,item,user)):page.querySelector("#additionalPartsCollapsible").classList.add("hide"),page.querySelector("#themeSongsCollapsible").classList.add("hide"),page.querySelector("#themeVideosCollapsible").classList.add("hide"),"MusicAlbum"==item.Type?renderMusicVideos(page,item,user):page.querySelector("#musicVideosCollapsible").classList.add("hide"),renderThemeMedia(page,item,user)}function renderOverview(elems,item){for(var i=0,length=elems.length;i'+p.Name+""}).join(", "),elem=page.querySelector(".genres");elem.innerHTML=genres.length>1?globalize.translate("sharedcomponents#GenresValue",html):globalize.translate("sharedcomponents#GenreValue",html),genres.length?elem.classList.remove("hide"):elem.classList.add("hide")}function renderDirector(page,item,apiClient,context,isStatic){var directors=(item.People||[]).filter(function(p){return"Director"===p.Type}),html=directors.map(function(p){return''+p.Name+""}).join(", "),elem=page.querySelector(".directors");elem.innerHTML=directors.length>1?globalize.translate("sharedcomponents#DirectorsValue",html):globalize.translate("sharedcomponents#DirectorValue",html),directors.length?elem.classList.remove("hide"):elem.classList.add("hide")}function renderDetails(page,item,apiClient,context,isStatic){renderSimilarItems(page,item,context),renderMoreFromSeason(page,item,apiClient),renderMoreFromArtist(page,item,apiClient),renderDirector(page,item,apiClient,context,isStatic),renderGenres(page,item,apiClient,context,isStatic),renderChannelGuide(page,apiClient,item);var taglineElement=page.querySelector(".tagline");item.Taglines&&item.Taglines.length?(taglineElement.classList.remove("hide"),taglineElement.innerHTML=item.Taglines[0]):taglineElement.classList.add("hide");var overview=page.querySelector(".overview"),externalLinksElem=page.querySelector(".itemExternalLinks");"Season"!==item.Type&&"MusicAlbum"!==item.Type&&"MusicArtist"!==item.Type||(overview.classList.add("detailsHiddenOnMobile"),externalLinksElem.classList.add("detailsHiddenOnMobile")),renderOverview([overview],item);var i,length,itemMiscInfo=page.querySelectorAll(".itemMiscInfo-primary");for(i=0,length=itemMiscInfo.length;i"),page.querySelector(".photoInfoContent").innerHTML=html}function enableScrollX(){return browserInfo.mobile&&screen.availWidth<=1e3}function getPortraitShape(scrollX){return null==scrollX&&(scrollX=enableScrollX()),scrollX?"overflowPortrait":"portrait"}function getSquareShape(scrollX){return null==scrollX&&(scrollX=enableScrollX()),scrollX?"overflowSquare":"square"}function getThumbShape(scrollX){return null==scrollX&&(scrollX=enableScrollX()),scrollX?"overflowBackdrop":"backdrop"}function renderMoreFromSeason(view,item,apiClient){var section=view.querySelector(".moreFromSeasonSection");if(section){if("Episode"!==item.Type||!item.SeasonId||!item.SeriesId)return void section.classList.add("hide");var userId=apiClient.getCurrentUserId(),fields="ItemCounts,PrimaryImageAspectRatio,BasicSyncInfo,CanDelete";apiClient.getEpisodes(item.SeriesId,{SeasonId:item.SeasonId,UserId:userId,Fields:fields}).then(function(result){if(result.Items.length<2)return void section.classList.add("hide");section.classList.remove("hide"),section.querySelector("h2").innerHTML=globalize.translate("MoreFromValue",item.SeasonName);var itemsContainer=section.querySelector(".itemsContainer");cardBuilder.buildCards(result.Items,{parentContainer:section,itemsContainer:itemsContainer,shape:"autoVertical",sectionTitleTagName:"h2",scalable:!0,showTitle:!0,overlayText:!1,centerText:!0,includeParentInfoInTitle:!1,allowBottomPadding:!1});var card=itemsContainer.querySelector('.card[data-id="'+item.Id+'"]');card&&setTimeout(function(){section.querySelector(".emby-scroller").toStart(card.previousSibling||card,!0)},100)})}}function renderMoreFromArtist(view,item,apiClient){var section=view.querySelector(".moreFromArtistSection");if(section)return"MusicAlbum"===item.Type&&item.AlbumArtists&&item.AlbumArtists.length?void apiClient.getItems(apiClient.getCurrentUserId(),{IncludeItemTypes:"MusicAlbum",ArtistIds:item.AlbumArtists[0].Id,Recursive:!0,ExcludeItemIds:item.Id,SortBy:"ProductionYear,SortName",SortOrder:"Descending"}).then(function(result){return result.Items.length?(section.classList.remove("hide"),section.querySelector("h2").innerHTML=globalize.translate("MoreFromValue",item.AlbumArtists[0].Name),void cardBuilder.buildCards(result.Items,{parentContainer:section,itemsContainer:section.querySelector(".itemsContainer"),shape:"autoVertical",sectionTitleTagName:"h2",scalable:!0,coverImage:"MusicArtist"===item.Type||"MusicAlbum"===item.Type})):void section.classList.add("hide")}):void section.classList.add("hide")}function renderSimilarItems(page,item,context){var similarCollapsible=page.querySelector("#similarCollapsible");if(similarCollapsible){if("Movie"!=item.Type&&"Trailer"!=item.Type&&"Series"!=item.Type&&"Program"!=item.Type&&"Recording"!=item.Type&&"Game"!=item.Type&&"MusicAlbum"!=item.Type&&"MusicArtist"!=item.Type&&"ChannelVideoItem"!=item.Type)return void similarCollapsible.classList.add("hide");similarCollapsible.classList.remove("hide");var shape="MusicAlbum"==item.Type||"MusicArtist"==item.Type?"square":"portrait",apiClient=connectionManager.getApiClient(item.ServerId),options={userId:apiClient.getCurrentUserId(),limit:"MusicAlbum"==item.Type||"MusicArtist"==item.Type?8:10,fields:"PrimaryImageAspectRatio,UserData,CanDelete"};"MusicAlbum"==item.Type&&item.AlbumArtists&&item.AlbumArtists.length&&(options.ExcludeArtistIds=item.AlbumArtists[0].Id),apiClient.getSimilarItems(item.Id,options).then(function(result){if(!result.Items.length)return void similarCollapsible.classList.add("hide");similarCollapsible.classList.remove("hide");var html="";html+='
    ';var supportsImageAnalysis=appHost.supports("imageanalysis"),cardLayout=supportsImageAnalysis&&("MusicAlbum"==item.Type||"Game"==item.Type||"MusicArtist"==item.Type);cardLayout=!1,html+=cardBuilder.getCardsHtml({items:result.Items,shape:shape,showParentTitle:"MusicAlbum"==item.Type,centerText:!cardLayout,showTitle:"MusicAlbum"==item.Type||"Game"==item.Type||"MusicArtist"==item.Type,context:context,lazy:!0,showDetailsMenu:!0,coverImage:"MusicAlbum"==item.Type||"MusicArtist"==item.Type,overlayPlayButton:!0,cardLayout:cardLayout,vibrant:cardLayout&&supportsImageAnalysis}),html+="
    ";var similarContent=similarCollapsible.querySelector(".similarContent");similarContent.innerHTML=html,imageLoader.lazyChildren(similarContent)})}}function renderSeriesAirTime(page,item,isStatic){var seriesAirTime=page.querySelector("#seriesAirTime");if("Series"!=item.Type)return void seriesAirTime.classList.add("hide");var html="";if(item.AirDays&&item.AirDays.length&&(html+=7==item.AirDays.length?"daily":item.AirDays.map(function(a){return a+"s"}).join(",")),item.AirTime&&(html+=" at "+item.AirTime),item.Studios.length)if(isStatic)html+=" on "+item.Studios[0].Name;else{var context=inferContext(item),href=appRouter.getRouteUrl(item.Studios[0],{context:context,itemType:"Studio",serverId:item.ServerId});html+=' on '+item.Studios[0].Name+""}html?(html=("Ended"==item.Status?"Aired ":"Airs ")+html,seriesAirTime.innerHTML=html,seriesAirTime.classList.remove("hide")):seriesAirTime.classList.add("hide"); -}function renderTags(page,item){for(var itemTags=page.querySelector(".itemTags"),tagElements=[],tags=item.Tags||[],i=0,length=tags.length;i',html+='

    '+datetime.toLocaleDateString(currentStartDate,{weekday:"long",month:"long",day:"numeric"})+"

    ",html+='
    '+listView.getListViewHtml({items:currentItems,enableUserDataButtons:!1,showParentTitle:!0,image:!1,showProgramTime:!0,mediaInfo:!1,parentTitleWithTitle:!0})+"
    "),currentStartDate=itemStartDate,currentItems=[]),currentItems.push(item)}currentItems.length&&(html+='
    ',html+='

    '+datetime.toLocaleDateString(currentStartDate,{weekday:"long",month:"long",day:"numeric"})+"

    ",html+='
    '+listView.getListViewHtml({items:currentItems,enableUserDataButtons:!1,showParentTitle:!0,image:!1,showProgramTime:!0,mediaInfo:!1,parentTitleWithTitle:!0})+"
    "),page.querySelector(".programGuide").innerHTML=html}function renderChannelGuide(page,apiClient,item){"TvChannel"===item.Type&&(page.querySelector(".programGuideSection").classList.remove("hide"),apiClient.getLiveTvPrograms({ChannelIds:item.Id,UserId:apiClient.getCurrentUserId(),HasAired:!1,SortBy:"StartDate",EnableTotalRecordCount:!1,EnableImages:!1,ImageTypeLimit:0,EnableUserData:!1}).then(function(result){renderProgramsForChannel(page,result)}))}function renderSeriesSchedule(page,item,user){return}function inferContext(item){return"Movie"===item.Type||"BoxSet"===item.Type?"movies":"Series"===item.Type||"Season"===item.Type||"Episode"===item.Type?"tvshows":"Game"===item.Type||"GameSystem"===item.Type?"games":"Game"===item.Type||"GameSystem"===item.Type?"games":"MusicArtist"===item.Type||"MusicAlbum"===item.Type?"music":null}function filterItemsByCollectionItemType(items,typeInfo){return items.filter(function(item){return typeInfo.mediaType?item.MediaType==typeInfo.mediaType:item.Type==typeInfo.type})}function renderCollectionItems(page,parentItem,types,items){page.querySelector(".collectionItems").innerHTML="";var i,length;for(i=0,length=types.length;i0}).length});otherTypeItems.length&&renderCollectionItemType(page,parentItem,otherType,otherTypeItems),items.length||renderCollectionItemType(page,parentItem,{name:globalize.translate("HeaderItems")},items)}function renderCollectionItemType(page,parentItem,type,items){var html="";html+='
    ',html+='
    ',html+='

    ',html+=""+type.name+"",html+="

    ",html+='',html+="
    ",html+='
    ';var shape="MusicAlbum"==type.type?getSquareShape(!1):getPortraitShape(!1);html+=cardBuilder.getCardsHtml({items:items,shape:shape,showTitle:!0,centerText:!0,lazy:!0,showDetailsMenu:!0,overlayMoreButton:!0,showAddToCollection:!1,showRemoveFromCollection:!0,collectionId:parentItem.Id}),html+="
    ",html+="
    ";var collectionItems=page.querySelector(".collectionItems");collectionItems.insertAdjacentHTML("beforeend",html),imageLoader.lazyChildren(collectionItems),collectionItems.querySelector(".btnAddToCollection").addEventListener("click",function(){require(["alert"],function(alert){alert({text:globalize.translate("AddItemToCollectionHelp"),html:globalize.translate("AddItemToCollectionHelp")+'

    '+globalize.translate("ButtonLearnMore")+""})})})}function renderThemeMedia(page,item){if("SeriesTimer"!==item.Type&&"Timer"!==item.Type&&"Genre"!==item.Type&&"MusicGenre"!==item.Type&&"GameGenre"!==item.Type&&"Studio"!==item.Type&&"Person"!==item.Type){var apiClient=connectionManager.getApiClient(item.ServerId);apiClient.getThemeMedia(apiClient.getCurrentUserId(),item.Id,!0).then(function(result){var themeSongs=result.ThemeSongsResult.OwnerId==item.Id?result.ThemeSongsResult.Items:[],themeVideos=result.ThemeVideosResult.OwnerId==item.Id?result.ThemeVideosResult.Items:[];renderThemeSongs(page,themeSongs),renderThemeVideos(page,themeVideos)})}}function renderThemeSongs(page,items){if(items.length){page.querySelector("#themeSongsCollapsible").classList.remove("hide");var html=listView.getListViewHtml({items:items});page.querySelector("#themeSongsContent").innerHTML=html}else page.querySelector("#themeSongsCollapsible").classList.add("hide")}function renderThemeVideos(page,items,user){if(items.length){page.querySelector("#themeVideosCollapsible").classList.remove("hide");var themeVideosContent=page.querySelector("#themeVideosContent");themeVideosContent.innerHTML=getVideosHtml(items,user),imageLoader.lazyChildren(themeVideosContent)}else page.querySelector("#themeVideosCollapsible").classList.add("hide")}function renderMusicVideos(page,item,user){connectionManager.getApiClient(item.ServerId).getItems(user.Id,{SortBy:"SortName",SortOrder:"Ascending",IncludeItemTypes:"MusicVideo",Recursive:!0,Fields:"DateCreated,CanDelete",AlbumIds:item.Id}).then(function(result){if(result.Items.length){page.querySelector("#musicVideosCollapsible").classList.remove("hide");var musicVideosContent=page.querySelector(".musicVideosContent");musicVideosContent.innerHTML=getVideosHtml(result.Items,user),imageLoader.lazyChildren(musicVideosContent)}else page.querySelector("#musicVideosCollapsible").classList.add("hide")})}function renderAdditionalParts(page,item,user){connectionManager.getApiClient(item.ServerId).getAdditionalVideoParts(user.Id,item.Id).then(function(result){if(result.Items.length){page.querySelector("#additionalPartsCollapsible").classList.remove("hide");var additionalPartsContent=page.querySelector("#additionalPartsContent");additionalPartsContent.innerHTML=getVideosHtml(result.Items,user),imageLoader.lazyChildren(additionalPartsContent)}else page.querySelector("#additionalPartsCollapsible").classList.add("hide")})}function renderScenes(page,item){var chapters=item.Chapters||[];if(chapters.length&&!chapters[0].ImageTag&&(chapters=[]),chapters.length){page.querySelector("#scenesCollapsible").classList.remove("hide");var scenesContent=page.querySelector("#scenesContent");enableScrollX()?scenesContent.classList.add("scrollX"):scenesContent.classList.add("vertical-wrap"),require(["chaptercardbuilder"],function(chaptercardbuilder){chaptercardbuilder.buildChapterCards(item,chapters,{itemsContainer:scenesContent,width:400,backdropShape:getThumbShape(),squareShape:getSquareShape()})})}else page.querySelector("#scenesCollapsible").classList.add("hide")}function renderMediaSources(page,user,item){var html=item.MediaSources.map(function(v){return getMediaSourceHtml(user,item,v)}).join('
    ');item.MediaSources.length>1&&(html="
    "+html);var mediaInfoContent=page.querySelector("#mediaInfoContent");mediaInfoContent.innerHTML=html,html?page.querySelector(".audioVideoMediaInfo").classList.remove("hide"):page.querySelector(".audioVideoMediaInfo").classList.add("hide")}function getMediaSourceHtml(user,item,version){var html="";version.Name&&item.MediaSources.length>1&&(html+='
    '+version.Name+"

    ");for(var i=0,length=version.MediaStreams.length;i';var displayType=globalize.translate("MediaInfoStreamType"+stream.Type);html+='

    '+displayType+"

    ";var attributes=[];stream.DisplayTitle&&attributes.push(createAttribute("Title",stream.DisplayTitle)),stream.Language&&"Video"!=stream.Type&&attributes.push(createAttribute(globalize.translate("MediaInfoLanguage"),stream.Language)),stream.Codec&&attributes.push(createAttribute(globalize.translate("MediaInfoCodec"),stream.Codec.toUpperCase())),stream.CodecTag&&attributes.push(createAttribute(globalize.translate("MediaInfoCodecTag"),stream.CodecTag)),null!=stream.IsAVC&&attributes.push(createAttribute("AVC",stream.IsAVC?"Yes":"No")),stream.Profile&&attributes.push(createAttribute(globalize.translate("MediaInfoProfile"),stream.Profile)),stream.Level&&attributes.push(createAttribute(globalize.translate("MediaInfoLevel"),stream.Level)),(stream.Width||stream.Height)&&attributes.push(createAttribute(globalize.translate("MediaInfoResolution"),stream.Width+"x"+stream.Height)),stream.AspectRatio&&"mjpeg"!=stream.Codec&&attributes.push(createAttribute(globalize.translate("MediaInfoAspectRatio"),stream.AspectRatio)),"Video"==stream.Type&&(null!=stream.IsAnamorphic&&attributes.push(createAttribute(globalize.translate("MediaInfoAnamorphic"),stream.IsAnamorphic?"Yes":"No")),attributes.push(createAttribute(globalize.translate("MediaInfoInterlaced"),stream.IsInterlaced?"Yes":"No"))),(stream.AverageFrameRate||stream.RealFrameRate)&&attributes.push(createAttribute(globalize.translate("MediaInfoFramerate"),stream.AverageFrameRate||stream.RealFrameRate)),stream.ChannelLayout&&attributes.push(createAttribute(globalize.translate("MediaInfoLayout"),stream.ChannelLayout)),stream.Channels&&attributes.push(createAttribute(globalize.translate("MediaInfoChannels"),stream.Channels+" ch")),stream.BitRate&&"mjpeg"!=stream.Codec&&attributes.push(createAttribute(globalize.translate("MediaInfoBitrate"),parseInt(stream.BitRate/1e3)+" kbps")),stream.SampleRate&&attributes.push(createAttribute(globalize.translate("MediaInfoSampleRate"),stream.SampleRate+" Hz")),stream.VideoRange&&"SDR"!==stream.VideoRange&&attributes.push(createAttribute(globalize.translate("sharedcomponents#VideoRange"),stream.VideoRange)),stream.ColorPrimaries&&attributes.push(createAttribute(globalize.translate("sharedcomponents#ColorPrimaries"),stream.ColorPrimaries)),stream.ColorSpace&&attributes.push(createAttribute(globalize.translate("sharedcomponents#ColorSpace"),stream.ColorSpace)),stream.ColorTransfer&&attributes.push(createAttribute(globalize.translate("sharedcomponents#ColorTransfer"),stream.ColorTransfer)),stream.BitDepth&&attributes.push(createAttribute(globalize.translate("MediaInfoBitDepth"),stream.BitDepth+" bit")),stream.PixelFormat&&attributes.push(createAttribute(globalize.translate("MediaInfoPixelFormat"),stream.PixelFormat)),stream.RefFrames&&attributes.push(createAttribute(globalize.translate("MediaInfoRefFrames"),stream.RefFrames)),stream.NalLengthSize&&attributes.push(createAttribute("NAL",stream.NalLengthSize)),"Video"!=stream.Type&&attributes.push(createAttribute(globalize.translate("MediaInfoDefault"),stream.IsDefault?"Yes":"No")),"Subtitle"==stream.Type&&(attributes.push(createAttribute(globalize.translate("MediaInfoForced"),stream.IsForced?"Yes":"No")),attributes.push(createAttribute(globalize.translate("MediaInfoExternal"),stream.IsExternal?"Yes":"No"))),"Video"==stream.Type&&version.Timestamp&&attributes.push(createAttribute(globalize.translate("MediaInfoTimestamp"),version.Timestamp)),html+=attributes.join("
    "),html+=""}}if(version.Container&&(html+='
    '+globalize.translate("MediaInfoContainer")+''+version.Container+"
    "),version.Formats&&version.Formats.length,version.Path&&"Http"!=version.Protocol&&user&&user.Policy.IsAdministrator&&(html+='
    '+globalize.translate("MediaInfoPath")+''+version.Path+"
    "),version.Size){var size=(version.Size/1048576).toFixed(0);html+='
    '+globalize.translate("MediaInfoSize")+''+size+" MB
    "}return html}function createAttribute(label,value){return''+label+''+value+""}function getVideosHtml(items,user,limit,moreButtonClass){var html=cardBuilder.getCardsHtml({items:items,shape:"auto",showTitle:!0,action:"play",overlayText:!1,centerText:!0,showRuntime:!0});return limit&&items.length>limit&&(html+='

    "),html}function renderSpecials(page,item,user,limit){connectionManager.getApiClient(item.ServerId).getSpecialFeatures(user.Id,item.Id).then(function(specials){var specialsContent=page.querySelector("#specialsContent");specialsContent.innerHTML=getVideosHtml(specials,user,limit,"moreSpecials"),imageLoader.lazyChildren(specialsContent)})}function renderCast(page,item,context,limit,isStatic){var people=(item.People||[]).filter(function(p){return"Director"!==p.Type});if(!people.length)return void page.querySelector("#castCollapsible").classList.add("hide");page.querySelector("#castCollapsible").classList.remove("hide");var castContent=page.querySelector("#castContent");enableScrollX()?(castContent.classList.add("scrollX"),limit=32):castContent.classList.add("vertical-wrap");var limitExceeded=limit&&people.length>limit;limitExceeded&&(people=people.slice(0),people.length=Math.min(limit,people.length)),require(["peoplecardbuilder"],function(peoplecardbuilder){peoplecardbuilder.buildPeopleCards(people,{itemsContainer:castContent,coverImage:!0,serverId:item.ServerId,width:160,shape:getPortraitShape()})});var morePeopleButton=page.querySelector(".morePeople");morePeopleButton&&(limitExceeded&&!enableScrollX()?morePeopleButton.classList.remove("hide"):morePeopleButton.classList.add("hide"))}function itemDetailPage(){var self=this;self.setInitialCollapsibleState=setInitialCollapsibleState,self.renderDetails=renderDetails,self.renderCast=renderCast,self.renderMediaSources=renderMediaSources}function bindAll(view,selector,eventName,fn){var i,length,elems=view.querySelectorAll(selector);for(i=0,length=elems.length;i"}function renderSeriesTimerSchedule(page,apiClient,seriesTimerId){apiClient.getLiveTvTimers({UserId:apiClient.getCurrentUserId(),ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Thumb",SortBy:"StartDate",EnableTotalRecordCount:!1,EnableUserData:!1,SeriesTimerId:seriesTimerId,Fields:"ChannelInfo,ChannelImage"}).then(function(result){result.Items.length&&result.Items[0].SeriesTimerId!=seriesTimerId&&(result.Items=[]);var html=getProgramScheduleHtml(result.Items),scheduleTab=page.querySelector(".seriesTimerSchedule");scheduleTab.innerHTML=html,imageLoader.lazyChildren(scheduleTab)})}function renderTimerEditor(page,item,apiClient,user){if("Recording"!==item.Type||!user.Policy.EnableLiveTvManagement||!item.TimerId||"InProgress"!==item.Status)return void hideAll(page,"btnCancelTimer");hideAll(page,"btnCancelTimer",!0)}function renderSeriesTimerEditor(page,item,apiClient,user){return"SeriesTimer"!==item.Type?void hideAll(page,"btnCancelSeriesTimer"):user.Policy.EnableLiveTvManagement?(require(["seriesRecordingEditor"],function(seriesRecordingEditor){seriesRecordingEditor.embed(item,apiClient.serverId(),{context:page.querySelector(".seriesRecordingEditor")})}),page.querySelector(".seriesTimerScheduleSection").classList.remove("hide"),hideAll(page,"btnCancelSeriesTimer",!0),void renderSeriesTimerSchedule(page,apiClient,item.Id)):(page.querySelector(".seriesTimerScheduleSection").classList.add("hide"),void hideAll(page,"btnCancelSeriesTimer"))}function renderTrackSelections(page,item){var select=page.querySelector(".selectSource");if(!item.MediaSources||!itemHelper.supportsMediaSourceSelection(item)||-1===playbackManager.getSupportedCommands().indexOf("PlayMediaSource")||!playbackManager.canPlay(item))return page.querySelector(".trackSelections").classList.add("hide"),select.innerHTML="",page.querySelector(".selectVideo").innerHTML="",page.querySelector(".selectAudio").innerHTML="",void(page.querySelector(".selectSubtitles").innerHTML="");page.querySelector(".trackSelections").classList.remove("hide"),select.setLabel(globalize.translate("sharedcomponents#LabelVersion"));var currentValue=select.value,selectedId=item.MediaSources[0].Id;select.innerHTML=item.MediaSources.map(function(v){var selected=v.Id===selectedId?" selected":"";return'"}).join(""),item.MediaSources.length>1?page.querySelector(".selectSourceContainer").classList.remove("hide"):page.querySelector(".selectSourceContainer").classList.add("hide"),select.value!==currentValue&&(renderVideoSelections(page,item),renderAudioSelections(page,item),renderSubtitleSelections(page,item))}function renderVideoSelections(page,item){var mediaSourceId=page.querySelector(".selectSource").value,mediaSource=item.MediaSources.filter(function(m){return m.Id===mediaSourceId})[0],tracks=mediaSource.MediaStreams.filter(function(m){return"Video"===m.Type}),select=page.querySelector(".selectVideo");select.setLabel(globalize.translate("sharedcomponents#LabelVideo"));var selectedId=tracks.length?tracks[0].Index:-1;select.innerHTML=tracks.map(function(v){var selected=v.Index===selectedId?" selected":"",titleParts=[],resolutionText=mediaInfo.getResolutionText(v);return resolutionText&&titleParts.push(resolutionText),v.Codec&&titleParts.push(v.Codec.toUpperCase()),'"}).join(""),select.setAttribute("disabled","disabled"),tracks.length?page.querySelector(".selectVideoContainer").classList.remove("hide"):page.querySelector(".selectVideoContainer").classList.add("hide")}function renderAudioSelections(page,item){var mediaSourceId=page.querySelector(".selectSource").value,mediaSource=item.MediaSources.filter(function(m){return m.Id===mediaSourceId})[0],tracks=mediaSource.MediaStreams.filter(function(m){return"Audio"===m.Type}),select=page.querySelector(".selectAudio");select.setLabel(globalize.translate("sharedcomponents#LabelAudio"));var selectedId=mediaSource.DefaultAudioStreamIndex;select.innerHTML=tracks.map(function(v){var selected=v.Index===selectedId?" selected":"";return'"}).join(""),tracks.length>1?select.removeAttribute("disabled"):select.setAttribute("disabled","disabled"),tracks.length?page.querySelector(".selectAudioContainer").classList.remove("hide"):page.querySelector(".selectAudioContainer").classList.add("hide")}function renderSubtitleSelections(page,item){var mediaSourceId=page.querySelector(".selectSource").value,mediaSource=item.MediaSources.filter(function(m){return m.Id===mediaSourceId})[0],tracks=mediaSource.MediaStreams.filter(function(m){return"Subtitle"===m.Type}),select=page.querySelector(".selectSubtitles");select.setLabel(globalize.translate("sharedcomponents#LabelSubtitles"));var selectedId=null==mediaSource.DefaultSubtitleStreamIndex?-1:mediaSource.DefaultSubtitleStreamIndex;if(tracks.length){var selected=-1===selectedId?" selected":"";select.innerHTML='"+tracks.map(function(v){return selected=v.Index===selectedId?" selected":"",'"}).join(""),page.querySelector(".selectSubtitlesContainer").classList.remove("hide")}else select.innerHTML="",page.querySelector(".selectSubtitlesContainer").classList.add("hide")}function reloadPlayButtons(page,item){var canPlay=!1;if("Program"==item.Type){var now=new Date;now>=datetime.parseISO8601Date(item.StartDate,!0)&&now0)}else hideAll(page,"btnPlay"),hideAll(page,"btnResume"),hideAll(page,"btnInstantMix"),hideAll(page,"btnShuffle");return canPlay}function reloadUserDataButtons(page,item){var i,length,btnPlaystates=page.querySelectorAll(".btnPlaystate");for(i=0,length=btnPlaystates.length;i'+artist.Name+"")}return html=html.join(" / ")}function renderName(item,container,isStatic,context){var parentRoute,parentNameHtml=[],parentNameLast=!1;item.AlbumArtists?(parentNameHtml.push(getArtistLinksHtml(item.AlbumArtists,item.ServerId,context)),parentNameLast=!0):item.ArtistItems&&item.ArtistItems.length&&"MusicVideo"===item.Type?(parentNameHtml.push(getArtistLinksHtml(item.ArtistItems,item.ServerId,context)),parentNameLast=!0):item.SeriesName&&"Episode"===item.Type?(parentRoute=appRouter.getRouteUrl({Id:item.SeriesId,Name:item.SeriesName,Type:"Series",IsFolder:!0,ServerId:item.ServerId},{context:context}),parentNameHtml.push(''+item.SeriesName+"")):(item.IsSeries||item.EpisodeTitle)&&parentNameHtml.push(item.Name),item.SeriesName&&"Season"===item.Type?(parentRoute=appRouter.getRouteUrl({Id:item.SeriesId,Name:item.SeriesName,Type:"Series",IsFolder:!0,ServerId:item.ServerId},{context:context}),parentNameHtml.push(''+item.SeriesName+"")):null!=item.ParentIndexNumber&&"Episode"===item.Type?(parentRoute=appRouter.getRouteUrl({Id:item.SeasonId,Name:item.SeasonName,Type:"Season",IsFolder:!0,ServerId:item.ServerId},{context:context}),parentNameHtml.push(''+item.SeasonName+"")):null!=item.ParentIndexNumber&&item.IsSeries?parentNameHtml.push(item.SeasonName||"S"+item.ParentIndexNumber):item.Album&&"Audio"===item.Type&&(item.AlbumId||item.ParentId)?(parentRoute=appRouter.getRouteUrl({Id:item.AlbumId||item.ParentId,Name:item.Album,Type:"MusicAlbum",IsFolder:!0,ServerId:item.ServerId},{context:context}),parentNameHtml.push(''+item.Album+"")):item.Album&&"MusicVideo"===item.Type&&item.AlbumId?(parentRoute=appRouter.getRouteUrl({Id:item.Albumid,Name:item.Album,Type:"MusicAlbum",IsFolder:!0,ServerId:item.ServerId},{context:context}),parentNameHtml.push(''+item.Album+"")):item.Album&&parentNameHtml.push(item.Album);var html="";parentNameHtml.length&&(html=parentNameLast?'

    '+parentNameHtml.join(" - ")+"

    ":'

    '+parentNameHtml.join(" - ")+"

    ");var name=itemHelper.getDisplayName(item,{includeParentInfo:!1});html&&!parentNameLast?html+='

    '+name+"

    ":html=parentNameLast?'

    '+name+"

    "+html:'

    '+name+"

    "+html,container.innerHTML=html,html.length?container.classList.remove("hide"):container.classList.add("hide")}function reloadFromItem(instance,page,params,item,user){var context=params.context;renderName(item,page.querySelector(".nameContainer"),!1,context);var apiClient=connectionManager.getApiClient(item.ServerId);renderSeriesTimerEditor(page,item,apiClient,user),renderTimerEditor(page,item,apiClient,user),renderImage(page,item,apiClient,user),renderLogo(page,item,apiClient),setTitle(item,apiClient),setInitialCollapsibleState(page,item,apiClient,context,user),renderDetails(page,item,apiClient,context),renderTrackSelections(page,item),dom.getWindowSize().innerWidth>=1e3?backdrop.setBackdrops([item]):backdrop.clear(),libraryBrowser.renderDetailPageBackdrop(page,item,apiClient,imageLoader,indicators);var canPlay=reloadPlayButtons(page,item),hasAnyButton=canPlay;item.LocalTrailerCount||item.RemoteTrailers&&item.RemoteTrailers.length?(hideAll(page,"btnPlayTrailer",!0),hasAnyButton=!0):hideAll(page,"btnPlayTrailer"),item.CanDelete&&!item.IsFolder?(hideAll(page,"btnDeleteItem",!0),hasAnyButton=!0):hideAll(page,"btnDeleteItem"),renderSyncLocalContainer(page,params,user,item),hasAnyButton||"Program"!==item.Type?hideAll(page,"mainDetailButtons",!0):hideAll(page,"mainDetailButtons"),showRecordingFields(instance,page,item,user);var groupedVersions=(item.MediaSources||[]).filter(function(g){return"Grouping"==g.Type});user.Policy.IsAdministrator&&groupedVersions.length?page.querySelector(".splitVersionContainer").classList.remove("hide"):page.querySelector(".splitVersionContainer").classList.add("hide"),itemContextMenu.getCommands(getContextMenuOptions(item,user)).length?hideAll(page,"btnMoreCommands",!0):hideAll(page,"btnMoreCommands");var itemBirthday=page.querySelector("#itemBirthday");if("Person"==item.Type&&item.PremiereDate)try{var birthday=datetime.parseISO8601Date(item.PremiereDate,!0).toDateString();itemBirthday.classList.remove("hide"),itemBirthday.innerHTML=globalize.translate("BirthDateValue").replace("{0}",birthday)}catch(err){itemBirthday.classList.add("hide")}else itemBirthday.classList.add("hide");var itemDeathDate=page.querySelector("#itemDeathDate");if("Person"==item.Type&&item.EndDate)try{var deathday=datetime.parseISO8601Date(item.EndDate,!0).toDateString();itemDeathDate.classList.remove("hide"),itemDeathDate.innerHTML=globalize.translate("DeathDateValue").replace("{0}",deathday)}catch(err){itemDeathDate.classList.add("hide")}var itemBirthLocation=page.querySelector("#itemBirthLocation");if("Person"==item.Type&&item.ProductionLocations&&item.ProductionLocations.length){var gmap=''+item.ProductionLocations[0]+"";itemBirthLocation.classList.remove("hide"),itemBirthLocation.innerHTML=globalize.translate("BirthPlaceValue").replace("{0}",gmap)}else itemBirthLocation.classList.add("hide");setPeopleHeader(page,item),loading.hide()}function logoImageUrl(item,apiClient,options){return options=options||{},options.type="Logo",item.ImageTags&&item.ImageTags.Logo?(options.tag=item.ImageTags.Logo,apiClient.getScaledImageUrl(item.Id,options)):item.ParentLogoImageTag?(options.tag=item.ParentLogoImageTag,apiClient.getScaledImageUrl(item.ParentLogoItemId,options)):null}function setTitle(item,apiClient){var url=logoImageUrl(item,apiClient,{});if(url=null){var pageTitle=document.querySelector(".pageTitle");pageTitle.style.backgroundImage="url('"+url+"')",pageTitle.classList.add("pageTitleWithLogo"),pageTitle.innerHTML=""}else Emby.Page.setTitle("")}function renderLogo(page,item,apiClient){var url=logoImageUrl(item,apiClient,{maxWidth:300}),detailLogo=page.querySelector(".detailLogo");url?(detailLogo.classList.remove("hide"),detailLogo.classList.add("lazy"),detailLogo.setAttribute("data-src",url),imageLoader.lazyImage(detailLogo)):detailLogo.classList.add("hide")}function showRecordingFields(instance,page,item,user){if(!instance.currentRecordingFields){var recordingFieldsElement=page.querySelector(".recordingFields");"Program"==item.Type&&user.Policy.EnableLiveTvManagement?require(["recordingFields"],function(recordingFields){instance.currentRecordingFields=new recordingFields({parent:recordingFieldsElement,programId:item.Id,serverId:item.ServerId}),recordingFieldsElement.classList.remove("hide")}):(recordingFieldsElement.classList.add("hide"),recordingFieldsElement.innerHTML="")}}function renderLinks(linksElem,item){var html=[];if(item.DateCreated&&itemHelper.enableDateAddedDisplay(item)){var dateCreated=datetime.parseISO8601Date(item.DateCreated);html.push(globalize.translate("sharedcomponents#AddedOnValue",datetime.toLocaleDateString(dateCreated)+" "+datetime.getDisplayTime(dateCreated)))}var links=[];if(!layoutManager.tv&&(item.HomePageUrl&&links.push(''+globalize.translate("ButtonWebsite")+""),item.ExternalUrls))for(var i=0,length=item.ExternalUrls.length;i'+url.Name+"")}links.length&&html.push(globalize.translate("sharedcomponents#LinksValue",links.join(", "))),linksElem.innerHTML=html.join(", "),html.length?linksElem.classList.remove("hide"):linksElem.classList.add("hide")}function renderImage(page,item,apiClient,user){var container=page.querySelector(".detailImageContainer");libraryBrowser.renderDetailImage(page,container,item,apiClient,user.Policy.IsAdministrator&&"Photo"!=item.MediaType,imageLoader,indicators)}function refreshDetailImageUserData(elem,item){elem.querySelector(".detailImageProgressContainer").innerHTML=indicators.getProgressBarHtml(item)}function refreshImage(page,item,user){refreshDetailImageUserData(page.querySelector(".detailImageContainer"),item)}function setPeopleHeader(page,item){"Audio"==item.MediaType||"MusicAlbum"==item.Type||"Book"==item.MediaType||"Photo"==item.MediaType?page.querySelector("#peopleHeader").innerHTML=globalize.translate("HeaderPeople"):page.querySelector("#peopleHeader").innerHTML=globalize.translate("HeaderCastAndCrew")}function renderNextUp(page,item,user){var section=page.querySelector(".nextUpSection");if("Series"!=item.Type)return void section.classList.add("hide");connectionManager.getApiClient(item.ServerId).getNextUpEpisodes({SeriesId:item.Id,UserId:user.Id}).then(function(result){result.Items.length?section.classList.remove("hide"):section.classList.add("hide");var html=cardBuilder.getCardsHtml({items:result.Items,shape:getThumbShape(!1),showTitle:!0,displayAsSpecial:"Season"==item.Type&&item.IndexNumber,overlayText:!1,centerText:!0,overlayPlayButton:!0}),itemsContainer=section.querySelector(".nextUpItems");itemsContainer.innerHTML=html,imageLoader.lazyChildren(itemsContainer)})}function setInitialCollapsibleState(page,item,apiClient,context,user){page.querySelector(".collectionItems").innerHTML="","Playlist"==item.Type?(page.querySelector("#childrenCollapsible").classList.remove("hide"),renderPlaylistItems(page,item,user)):"Studio"==item.Type||"Person"==item.Type||"Genre"==item.Type||"MusicGenre"==item.Type||"GameGenre"==item.Type||"MusicArtist"==item.Type?(page.querySelector("#childrenCollapsible").classList.remove("hide"),renderItemsByName(page,item,user)):item.IsFolder?("BoxSet"==item.Type&&page.querySelector("#childrenCollapsible").classList.add("hide"),renderChildren(page,item)):page.querySelector("#childrenCollapsible").classList.add("hide"),item.Type,"Series"==item.Type?renderNextUp(page,item,user):page.querySelector(".nextUpSection").classList.add("hide"),item.MediaSources&&item.MediaSources.length&&(null==item.EnableMediaSourceDisplay?"Channel"!==item.SourceType:item.EnableMediaSourceDisplay)?renderMediaSources(page,user,item):page.querySelector(".audioVideoMediaInfo").classList.add("hide"),renderScenes(page,item),item.SpecialFeatureCount&&0!=item.SpecialFeatureCount&&"Series"!=item.Type?(page.querySelector("#specialsCollapsible").classList.remove("hide"),renderSpecials(page,item,user,6)):page.querySelector("#specialsCollapsible").classList.add("hide"),renderCast(page,item,context,enableScrollX()?null:12),item.PartCount&&item.PartCount>1?(page.querySelector("#additionalPartsCollapsible").classList.remove("hide"),renderAdditionalParts(page,item,user)):page.querySelector("#additionalPartsCollapsible").classList.add("hide"),page.querySelector("#themeSongsCollapsible").classList.add("hide"),page.querySelector("#themeVideosCollapsible").classList.add("hide"),"MusicAlbum"==item.Type?renderMusicVideos(page,item,user):page.querySelector("#musicVideosCollapsible").classList.add("hide"),renderThemeMedia(page,item)}function renderOverview(elems,item){for(var i=0,length=elems.length;i'+p.Name+""}).join(", "),elem=page.querySelector(".genres");elem.innerHTML=genres.length>1?globalize.translate("sharedcomponents#GenresValue",html):globalize.translate("sharedcomponents#GenreValue",html),genres.length?elem.classList.remove("hide"):elem.classList.add("hide")}function renderDirector(page,item,apiClient,context,isStatic){var directors=(item.People||[]).filter(function(p){return"Director"===p.Type}),html=directors.map(function(p){return''+p.Name+""}).join(", "),elem=page.querySelector(".directors");elem.innerHTML=directors.length>1?globalize.translate("sharedcomponents#DirectorsValue",html):globalize.translate("sharedcomponents#DirectorValue",html),directors.length?elem.classList.remove("hide"):elem.classList.add("hide")}function renderDetails(page,item,apiClient,context,isStatic){renderSimilarItems(page,item,context),renderMoreFromSeason(page,item,apiClient),renderMoreFromArtist(page,item,apiClient),renderDirector(page,item,apiClient,context,isStatic),renderGenres(page,item,apiClient,context,isStatic),renderChannelGuide(page,apiClient,item);var taglineElement=page.querySelector(".tagline");item.Taglines&&item.Taglines.length?(taglineElement.classList.remove("hide"),taglineElement.innerHTML=item.Taglines[0]):taglineElement.classList.add("hide");var overview=page.querySelector(".overview"),externalLinksElem=page.querySelector(".itemExternalLinks");"Season"!==item.Type&&"MusicAlbum"!==item.Type&&"MusicArtist"!==item.Type||(overview.classList.add("detailsHiddenOnMobile"),externalLinksElem.classList.add("detailsHiddenOnMobile")),renderOverview([overview],item);var i,length,itemMiscInfo=page.querySelectorAll(".itemMiscInfo-primary");for(i=0,length=itemMiscInfo.length;i"),page.querySelector(".photoInfoContent").innerHTML=html}function enableScrollX(){return browserInfo.mobile&&screen.availWidth<=1e3}function getPortraitShape(scrollX){return null==scrollX&&(scrollX=enableScrollX()),scrollX?"overflowPortrait":"portrait"}function getSquareShape(scrollX){return null==scrollX&&(scrollX=enableScrollX()),scrollX?"overflowSquare":"square"}function getThumbShape(scrollX){return null==scrollX&&(scrollX=enableScrollX()),scrollX?"overflowBackdrop":"backdrop"}function renderMoreFromSeason(view,item,apiClient){var section=view.querySelector(".moreFromSeasonSection");if(section){if("Episode"!==item.Type||!item.SeasonId||!item.SeriesId)return void section.classList.add("hide");var userId=apiClient.getCurrentUserId();apiClient.getEpisodes(item.SeriesId,{SeasonId:item.SeasonId,UserId:userId,Fields:"ItemCounts,PrimaryImageAspectRatio,BasicSyncInfo,CanDelete"}).then(function(result){if(result.Items.length<2)return void section.classList.add("hide");section.classList.remove("hide"),section.querySelector("h2").innerHTML=globalize.translate("MoreFromValue",item.SeasonName);var itemsContainer=section.querySelector(".itemsContainer");cardBuilder.buildCards(result.Items,{parentContainer:section,itemsContainer:itemsContainer,shape:"autoVertical",sectionTitleTagName:"h2",scalable:!0,showTitle:!0,overlayText:!1,centerText:!0,includeParentInfoInTitle:!1,allowBottomPadding:!1});var card=itemsContainer.querySelector('.card[data-id="'+item.Id+'"]');card&&setTimeout(function(){section.querySelector(".emby-scroller").toStart(card.previousSibling||card,!0)},100)})}}function renderMoreFromArtist(view,item,apiClient){var section=view.querySelector(".moreFromArtistSection");if(section)return"MusicAlbum"===item.Type&&item.AlbumArtists&&item.AlbumArtists.length?void apiClient.getItems(apiClient.getCurrentUserId(),{IncludeItemTypes:"MusicAlbum",ArtistIds:item.AlbumArtists[0].Id,Recursive:!0,ExcludeItemIds:item.Id,SortBy:"ProductionYear,SortName",SortOrder:"Descending"}).then(function(result){if(!result.Items.length)return void section.classList.add("hide");section.classList.remove("hide"),section.querySelector("h2").innerHTML=globalize.translate("MoreFromValue",item.AlbumArtists[0].Name),cardBuilder.buildCards(result.Items,{parentContainer:section,itemsContainer:section.querySelector(".itemsContainer"),shape:"autoVertical",sectionTitleTagName:"h2",scalable:!0,coverImage:"MusicArtist"===item.Type||"MusicAlbum"===item.Type})}):void section.classList.add("hide")}function renderSimilarItems(page,item,context){var similarCollapsible=page.querySelector("#similarCollapsible");if(similarCollapsible){if("Movie"!=item.Type&&"Trailer"!=item.Type&&"Series"!=item.Type&&"Program"!=item.Type&&"Recording"!=item.Type&&"Game"!=item.Type&&"MusicAlbum"!=item.Type&&"MusicArtist"!=item.Type&&"ChannelVideoItem"!=item.Type)return void similarCollapsible.classList.add("hide");similarCollapsible.classList.remove("hide");var shape="MusicAlbum"==item.Type||"MusicArtist"==item.Type?"square":"portrait",apiClient=connectionManager.getApiClient(item.ServerId),options={userId:apiClient.getCurrentUserId(),limit:"MusicAlbum"==item.Type||"MusicArtist"==item.Type?8:10,fields:"PrimaryImageAspectRatio,UserData,CanDelete"};"MusicAlbum"==item.Type&&item.AlbumArtists&&item.AlbumArtists.length&&(options.ExcludeArtistIds=item.AlbumArtists[0].Id),apiClient.getSimilarItems(item.Id,options).then(function(result){if(!result.Items.length)return void similarCollapsible.classList.add("hide");similarCollapsible.classList.remove("hide");var html="";html+='
    ';var supportsImageAnalysis=appHost.supports("imageanalysis"),cardLayout=supportsImageAnalysis&&("MusicAlbum"==item.Type||"Game"==item.Type||"MusicArtist"==item.Type);cardLayout=!1,html+=cardBuilder.getCardsHtml({items:result.Items,shape:shape,showParentTitle:"MusicAlbum"==item.Type,centerText:!cardLayout,showTitle:"MusicAlbum"==item.Type||"Game"==item.Type||"MusicArtist"==item.Type,context:context,lazy:!0,showDetailsMenu:!0,coverImage:"MusicAlbum"==item.Type||"MusicArtist"==item.Type,overlayPlayButton:!0,cardLayout:cardLayout,vibrant:cardLayout&&supportsImageAnalysis}),html+="
    ";var similarContent=similarCollapsible.querySelector(".similarContent");similarContent.innerHTML=html,imageLoader.lazyChildren(similarContent)})}}function renderSeriesAirTime(page,item,isStatic){var seriesAirTime=page.querySelector("#seriesAirTime");if("Series"!=item.Type)return void seriesAirTime.classList.add("hide");var html="";if(item.AirDays&&item.AirDays.length&&(html+=7==item.AirDays.length?"daily":item.AirDays.map(function(a){return a+"s"}).join(",")),item.AirTime&&(html+=" at "+item.AirTime),item.Studios.length)if(isStatic)html+=" on "+item.Studios[0].Name;else{var context=inferContext(item),href=appRouter.getRouteUrl(item.Studios[0],{context:context,itemType:"Studio",serverId:item.ServerId});html+=' on '+item.Studios[0].Name+""}html?(html=("Ended"==item.Status?"Aired ":"Airs ")+html,seriesAirTime.innerHTML=html,seriesAirTime.classList.remove("hide")):seriesAirTime.classList.add("hide")}function renderTags(page,item){ +for(var itemTags=page.querySelector(".itemTags"),tagElements=[],tags=item.Tags||[],i=0,length=tags.length;i',html+='

    '+datetime.toLocaleDateString(currentStartDate,{weekday:"long",month:"long",day:"numeric"})+"

    ",html+='
    '+listView.getListViewHtml({items:currentItems,enableUserDataButtons:!1,showParentTitle:!0,image:!1,showProgramTime:!0,mediaInfo:!1,parentTitleWithTitle:!0})+"
    "),currentStartDate=itemStartDate,currentItems=[]),currentItems.push(item)}currentItems.length&&(html+='
    ',html+='

    '+datetime.toLocaleDateString(currentStartDate,{weekday:"long",month:"long",day:"numeric"})+"

    ",html+='
    '+listView.getListViewHtml({items:currentItems,enableUserDataButtons:!1,showParentTitle:!0,image:!1,showProgramTime:!0,mediaInfo:!1,parentTitleWithTitle:!0})+"
    "),page.querySelector(".programGuide").innerHTML=html}function renderChannelGuide(page,apiClient,item){"TvChannel"===item.Type&&(page.querySelector(".programGuideSection").classList.remove("hide"),apiClient.getLiveTvPrograms({ChannelIds:item.Id,UserId:apiClient.getCurrentUserId(),HasAired:!1,SortBy:"StartDate",EnableTotalRecordCount:!1,EnableImages:!1,ImageTypeLimit:0,EnableUserData:!1}).then(function(result){renderProgramsForChannel(page,result)}))}function inferContext(item){return"Movie"===item.Type||"BoxSet"===item.Type?"movies":"Series"===item.Type||"Season"===item.Type||"Episode"===item.Type?"tvshows":"Game"===item.Type||"GameSystem"===item.Type?"games":"Game"===item.Type||"GameSystem"===item.Type?"games":"MusicArtist"===item.Type||"MusicAlbum"===item.Type?"music":null}function filterItemsByCollectionItemType(items,typeInfo){return items.filter(function(item){return typeInfo.mediaType?item.MediaType==typeInfo.mediaType:item.Type==typeInfo.type})}function renderCollectionItems(page,parentItem,types,items){page.querySelector(".collectionItems").innerHTML="";var i,length;for(i=0,length=types.length;i0}).length});otherTypeItems.length&&renderCollectionItemType(page,parentItem,otherType,otherTypeItems),items.length||renderCollectionItemType(page,parentItem,{name:globalize.translate("HeaderItems")},items)}function renderCollectionItemType(page,parentItem,type,items){var html="";html+='
    ',html+='
    ',html+='

    ',html+=""+type.name+"",html+="

    ",html+='',html+="
    ",html+='
    ';var shape="MusicAlbum"==type.type?getSquareShape(!1):getPortraitShape(!1);html+=cardBuilder.getCardsHtml({items:items,shape:shape,showTitle:!0,centerText:!0,lazy:!0,showDetailsMenu:!0,overlayMoreButton:!0,showAddToCollection:!1,showRemoveFromCollection:!0,collectionId:parentItem.Id}),html+="
    ",html+="
    ";var collectionItems=page.querySelector(".collectionItems");collectionItems.insertAdjacentHTML("beforeend",html),imageLoader.lazyChildren(collectionItems),collectionItems.querySelector(".btnAddToCollection").addEventListener("click",function(){require(["alert"],function(alert){alert({text:globalize.translate("AddItemToCollectionHelp"),html:globalize.translate("AddItemToCollectionHelp")+'

    '+globalize.translate("ButtonLearnMore")+""})})})}function renderThemeMedia(page,item){if("SeriesTimer"!==item.Type&&"Timer"!==item.Type&&"Genre"!==item.Type&&"MusicGenre"!==item.Type&&"GameGenre"!==item.Type&&"Studio"!==item.Type&&"Person"!==item.Type){var apiClient=connectionManager.getApiClient(item.ServerId);apiClient.getThemeMedia(apiClient.getCurrentUserId(),item.Id,!0).then(function(result){var themeSongs=result.ThemeSongsResult.OwnerId==item.Id?result.ThemeSongsResult.Items:[],themeVideos=result.ThemeVideosResult.OwnerId==item.Id?result.ThemeVideosResult.Items:[];renderThemeSongs(page,themeSongs),renderThemeVideos(page,themeVideos)})}}function renderThemeSongs(page,items){if(items.length){page.querySelector("#themeSongsCollapsible").classList.remove("hide");var html=listView.getListViewHtml({items:items});page.querySelector("#themeSongsContent").innerHTML=html}else page.querySelector("#themeSongsCollapsible").classList.add("hide")}function renderThemeVideos(page,items,user){if(items.length){page.querySelector("#themeVideosCollapsible").classList.remove("hide");var themeVideosContent=page.querySelector("#themeVideosContent");themeVideosContent.innerHTML=getVideosHtml(items,user),imageLoader.lazyChildren(themeVideosContent)}else page.querySelector("#themeVideosCollapsible").classList.add("hide")}function renderMusicVideos(page,item,user){connectionManager.getApiClient(item.ServerId).getItems(user.Id,{SortBy:"SortName",SortOrder:"Ascending",IncludeItemTypes:"MusicVideo",Recursive:!0,Fields:"DateCreated,CanDelete",AlbumIds:item.Id}).then(function(result){if(result.Items.length){page.querySelector("#musicVideosCollapsible").classList.remove("hide");var musicVideosContent=page.querySelector(".musicVideosContent");musicVideosContent.innerHTML=getVideosHtml(result.Items,user),imageLoader.lazyChildren(musicVideosContent)}else page.querySelector("#musicVideosCollapsible").classList.add("hide")})}function renderAdditionalParts(page,item,user){connectionManager.getApiClient(item.ServerId).getAdditionalVideoParts(user.Id,item.Id).then(function(result){if(result.Items.length){page.querySelector("#additionalPartsCollapsible").classList.remove("hide");var additionalPartsContent=page.querySelector("#additionalPartsContent");additionalPartsContent.innerHTML=getVideosHtml(result.Items,user),imageLoader.lazyChildren(additionalPartsContent)}else page.querySelector("#additionalPartsCollapsible").classList.add("hide")})}function renderScenes(page,item){var chapters=item.Chapters||[];if(chapters.length&&!chapters[0].ImageTag&&(chapters=[]),chapters.length){page.querySelector("#scenesCollapsible").classList.remove("hide");var scenesContent=page.querySelector("#scenesContent");enableScrollX()?scenesContent.classList.add("scrollX"):scenesContent.classList.add("vertical-wrap"),require(["chaptercardbuilder"],function(chaptercardbuilder){chaptercardbuilder.buildChapterCards(item,chapters,{itemsContainer:scenesContent,width:400,backdropShape:getThumbShape(),squareShape:getSquareShape()})})}else page.querySelector("#scenesCollapsible").classList.add("hide")}function renderMediaSources(page,user,item){var html=item.MediaSources.map(function(v){return getMediaSourceHtml(user,item,v)}).join('
    ');item.MediaSources.length>1&&(html="
    "+html),page.querySelector("#mediaInfoContent").innerHTML=html,html?page.querySelector(".audioVideoMediaInfo").classList.remove("hide"):page.querySelector(".audioVideoMediaInfo").classList.add("hide")}function getMediaSourceHtml(user,item,version){var html="";version.Name&&item.MediaSources.length>1&&(html+='
    '+version.Name+"

    ");for(var i=0,length=version.MediaStreams.length;i';html+='

    '+globalize.translate("MediaInfoStreamType"+stream.Type)+"

    ";var attributes=[];stream.DisplayTitle&&attributes.push(createAttribute("Title",stream.DisplayTitle)),stream.Language&&"Video"!=stream.Type&&attributes.push(createAttribute(globalize.translate("MediaInfoLanguage"),stream.Language)),stream.Codec&&attributes.push(createAttribute(globalize.translate("MediaInfoCodec"),stream.Codec.toUpperCase())),stream.CodecTag&&attributes.push(createAttribute(globalize.translate("MediaInfoCodecTag"),stream.CodecTag)),null!=stream.IsAVC&&attributes.push(createAttribute("AVC",stream.IsAVC?"Yes":"No")),stream.Profile&&attributes.push(createAttribute(globalize.translate("MediaInfoProfile"),stream.Profile)),stream.Level&&attributes.push(createAttribute(globalize.translate("MediaInfoLevel"),stream.Level)),(stream.Width||stream.Height)&&attributes.push(createAttribute(globalize.translate("MediaInfoResolution"),stream.Width+"x"+stream.Height)),stream.AspectRatio&&"mjpeg"!=stream.Codec&&attributes.push(createAttribute(globalize.translate("MediaInfoAspectRatio"),stream.AspectRatio)),"Video"==stream.Type&&(null!=stream.IsAnamorphic&&attributes.push(createAttribute(globalize.translate("MediaInfoAnamorphic"),stream.IsAnamorphic?"Yes":"No")),attributes.push(createAttribute(globalize.translate("MediaInfoInterlaced"),stream.IsInterlaced?"Yes":"No"))),(stream.AverageFrameRate||stream.RealFrameRate)&&attributes.push(createAttribute(globalize.translate("MediaInfoFramerate"),stream.AverageFrameRate||stream.RealFrameRate)),stream.ChannelLayout&&attributes.push(createAttribute(globalize.translate("MediaInfoLayout"),stream.ChannelLayout)),stream.Channels&&attributes.push(createAttribute(globalize.translate("MediaInfoChannels"),stream.Channels+" ch")),stream.BitRate&&"mjpeg"!=stream.Codec&&attributes.push(createAttribute(globalize.translate("MediaInfoBitrate"),parseInt(stream.BitRate/1e3)+" kbps")),stream.SampleRate&&attributes.push(createAttribute(globalize.translate("MediaInfoSampleRate"),stream.SampleRate+" Hz")),stream.VideoRange&&"SDR"!==stream.VideoRange&&attributes.push(createAttribute(globalize.translate("sharedcomponents#VideoRange"),stream.VideoRange)),stream.ColorPrimaries&&attributes.push(createAttribute(globalize.translate("sharedcomponents#ColorPrimaries"),stream.ColorPrimaries)),stream.ColorSpace&&attributes.push(createAttribute(globalize.translate("sharedcomponents#ColorSpace"),stream.ColorSpace)),stream.ColorTransfer&&attributes.push(createAttribute(globalize.translate("sharedcomponents#ColorTransfer"),stream.ColorTransfer)),stream.BitDepth&&attributes.push(createAttribute(globalize.translate("MediaInfoBitDepth"),stream.BitDepth+" bit")),stream.PixelFormat&&attributes.push(createAttribute(globalize.translate("MediaInfoPixelFormat"),stream.PixelFormat)),stream.RefFrames&&attributes.push(createAttribute(globalize.translate("MediaInfoRefFrames"),stream.RefFrames)),stream.NalLengthSize&&attributes.push(createAttribute("NAL",stream.NalLengthSize)),"Video"!=stream.Type&&attributes.push(createAttribute(globalize.translate("MediaInfoDefault"),stream.IsDefault?"Yes":"No")),"Subtitle"==stream.Type&&(attributes.push(createAttribute(globalize.translate("MediaInfoForced"),stream.IsForced?"Yes":"No")),attributes.push(createAttribute(globalize.translate("MediaInfoExternal"),stream.IsExternal?"Yes":"No"))),"Video"==stream.Type&&version.Timestamp&&attributes.push(createAttribute(globalize.translate("MediaInfoTimestamp"),version.Timestamp)),html+=attributes.join("
    "),html+=""}}if(version.Container&&(html+='
    '+globalize.translate("MediaInfoContainer")+''+version.Container+"
    "),version.Formats&&version.Formats.length,version.Path&&"Http"!=version.Protocol&&user&&user.Policy.IsAdministrator&&(html+='
    '+globalize.translate("MediaInfoPath")+''+version.Path+"
    "),version.Size){var size=(version.Size/1048576).toFixed(0);html+='
    '+globalize.translate("MediaInfoSize")+''+size+" MB
    "}return html}function createAttribute(label,value){return''+label+''+value+""}function getVideosHtml(items,user,limit,moreButtonClass){var html=cardBuilder.getCardsHtml({items:items,shape:"auto",showTitle:!0,action:"play",overlayText:!1,centerText:!0,showRuntime:!0});return limit&&items.length>limit&&(html+='

    "),html}function renderSpecials(page,item,user,limit){connectionManager.getApiClient(item.ServerId).getSpecialFeatures(user.Id,item.Id).then(function(specials){var specialsContent=page.querySelector("#specialsContent");specialsContent.innerHTML=getVideosHtml(specials,user,limit,"moreSpecials"),imageLoader.lazyChildren(specialsContent)})}function renderCast(page,item,context,limit,isStatic){var people=(item.People||[]).filter(function(p){return"Director"!==p.Type});if(!people.length)return void page.querySelector("#castCollapsible").classList.add("hide");page.querySelector("#castCollapsible").classList.remove("hide");var castContent=page.querySelector("#castContent");enableScrollX()?(castContent.classList.add("scrollX"),limit=32):castContent.classList.add("vertical-wrap");var limitExceeded=limit&&people.length>limit;limitExceeded&&(people=people.slice(0),people.length=Math.min(limit,people.length)),require(["peoplecardbuilder"],function(peoplecardbuilder){peoplecardbuilder.buildPeopleCards(people,{itemsContainer:castContent,coverImage:!0,serverId:item.ServerId,width:160,shape:getPortraitShape()})});var morePeopleButton=page.querySelector(".morePeople");morePeopleButton&&(limitExceeded&&!enableScrollX()?morePeopleButton.classList.remove("hide"):morePeopleButton.classList.add("hide"))}function itemDetailPage(){var self=this;self.setInitialCollapsibleState=setInitialCollapsibleState,self.renderDetails=renderDetails,self.renderCast=renderCast,self.renderMediaSources=renderMediaSources}function bindAll(view,selector,eventName,fn){var i,length,elems=view.querySelectorAll(selector);for(i=0,length=elems.length;i',showControls){html+='';var startAtDisplay=totalRecordCount?startIndex+1:0;html+=startAtDisplay+"-"+recordsEnd+" of "+totalRecordCount,html+=""}return(showControls||options.viewButton||options.filterButton||options.sortButton||options.addLayoutButton)&&(html+='
    ',showControls&&(html+='',html+=''),options.addLayoutButton&&(html+=''),options.sortButton&&(html+=''),options.filterButton&&(html+=''),html+="
    "),html+=""},showSortMenu:function(options){require(["dialogHelper","emby-radio"],function(dialogHelper){function onSortByChange(){var newValue=this.value;if(this.checked){var changed=options.query.SortBy!=newValue;options.query.SortBy=newValue.replace("_",","),options.query.StartIndex=0,options.callback&&changed&&options.callback()}}function onSortOrderChange(){var newValue=this.value;if(this.checked){var changed=options.query.SortOrder!=newValue;options.query.SortOrder=newValue,options.query.StartIndex=0,options.callback&&changed&&options.callback()}}var dlg=dialogHelper.createDialog({removeOnClose:!0,modal:!1,entryAnimationDuration:160,exitAnimationDuration:200});dlg.classList.add("ui-body-a"),dlg.classList.add("background-theme-a"),dlg.classList.add("formDialog");var html="";html+='
    ',html+='

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

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

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

    ",html+="
    ",isChecked="Ascending"==options.query.SortOrder?" checked":"",html+='",isChecked="Descending"==options.query.SortOrder?" checked":"",html+='",html+="
    ",html+="
    ",dlg.innerHTML=html,dialogHelper.open(dlg);var sortBys=dlg.querySelectorAll(".menuSortBy");for(i=0,length=sortBys.length;i',editable&&(html+=""),detectRatio&&item.PrimaryImageAspectRatio&&(item.PrimaryImageAspectRatio>=1.48?shape="thumb":item.PrimaryImageAspectRatio>=.85&&item.PrimaryImageAspectRatio<=1.34&&(shape="square")),html+="",editable&&(html+="");var progressHtml=item.IsFolder||!item.UserData?"":indicators.getProgressBarHtml(item);if(html+='
    ',progressHtml&&(html+=progressHtml),html+="
    ",html+="",elem.innerHTML=html,"thumb"==shape?(elem.classList.add("thumbDetailImageContainer"),elem.classList.remove("portraitDetailImageContainer"),elem.classList.remove("squareDetailImageContainer")):"square"==shape?(elem.classList.remove("thumbDetailImageContainer"),elem.classList.remove("portraitDetailImageContainer"),elem.classList.add("squareDetailImageContainer")):(elem.classList.remove("thumbDetailImageContainer"),elem.classList.add("portraitDetailImageContainer"),elem.classList.remove("squareDetailImageContainer")),url){var img=elem.querySelector("img");img.onload=function(){img.src.indexOf("empty.png")==-1&&img.classList.add("loaded")},imageLoader.lazyImage(img,url)}},renderDetailPageBackdrop:function(page,item,apiClient,imageLoader,indicators){var imgUrl,screenWidth=screen.availWidth,hasbackdrop=!1,itemBackdropElement=page.querySelector("#itemBackdrop"),usePrimaryImage="Video"===item.MediaType&&"Movie"!==item.Type&&"Trailer"!==item.Type||item.MediaType&&"Video"!==item.MediaType,useThumbImage="Program"===item.Type;return useThumbImage&&item.ImageTags&&item.ImageTags.Thumb?(imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Thumb",index:0,maxWidth:screenWidth,tag:item.ImageTags.Thumb}),itemBackdropElement.classList.remove("noBackdrop"),imageLoader.lazyImage(itemBackdropElement,imgUrl,!1),hasbackdrop=!0):usePrimaryImage&&item.ImageTags&&item.ImageTags.Primary?(imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Primary",index:0,maxWidth:screenWidth,tag:item.ImageTags.Primary}),itemBackdropElement.classList.remove("noBackdrop"),imageLoader.lazyImage(itemBackdropElement,imgUrl,!1),hasbackdrop=!0):item.BackdropImageTags&&item.BackdropImageTags.length?(imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Backdrop",index:0,maxWidth:screenWidth,tag:item.BackdropImageTags[0]}),itemBackdropElement.classList.remove("noBackdrop"),imageLoader.lazyImage(itemBackdropElement,imgUrl,!1),hasbackdrop=!0):item.ParentBackdropItemId&&item.ParentBackdropImageTags&&item.ParentBackdropImageTags.length?(imgUrl=apiClient.getScaledImageUrl(item.ParentBackdropItemId,{type:"Backdrop",index:0,tag:item.ParentBackdropImageTags[0],maxWidth:screenWidth}),itemBackdropElement.classList.remove("noBackdrop"),imageLoader.lazyImage(itemBackdropElement,imgUrl,!1),hasbackdrop=!0):item.ImageTags&&item.ImageTags.Thumb?(imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Thumb",index:0,maxWidth:screenWidth,tag:item.ImageTags.Thumb}),itemBackdropElement.classList.remove("noBackdrop"),imageLoader.lazyImage(itemBackdropElement,imgUrl,!1),hasbackdrop=!0):(itemBackdropElement.classList.add("noBackdrop"),itemBackdropElement.style.backgroundImage=""),hasbackdrop}};return window.LibraryBrowser=libraryBrowser,libraryBrowser}); \ No newline at end of file +define(["appSettings","userSettings","dom","browser","datetime","appRouter","events","scrollStyles"],function(appSettings,userSettings,dom,browser,datetime,appRouter,events){"use strict";var libraryBrowser={getDefaultPageSize:function(key,defaultValue){return 100},getSavedQueryKey:function(modifier){return window.location.href.split("#")[0]+(modifier||"")},loadSavedQueryValues:function(key,query){var values=userSettings.get(key);return values?(values=JSON.parse(values),Object.assign(query,values)):query},saveQueryValues:function(key,query){var values={};query.SortBy&&(values.SortBy=query.SortBy),query.SortOrder&&(values.SortOrder=query.SortOrder),userSettings.set(key,JSON.stringify(values))},saveViewSetting:function(key,value){userSettings.set(key+"-_view",value)},getSavedView:function(key){return userSettings.get(key+"-_view")},getSavedViewSetting:function(key){return new Promise(function(resolve,reject){resolve(libraryBrowser.getSavedView(key))})},showLayoutMenu:function(button,currentLayout,views){var dispatchEvent=!0;views||(dispatchEvent=!1,views=button.getAttribute("data-layouts"),views=views?views.split(","):["List","Poster","PosterCard","Thumb","ThumbCard"]);var menuItems=views.map(function(v){return{name:Globalize.translate("Option"+v),id:v,selected:currentLayout==v}});require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:button,callback:function(id){button.dispatchEvent(new CustomEvent("layoutchange",{detail:{viewStyle:id},bubbles:!0,cancelable:!1})),dispatchEvent||window.$&&$(button).trigger("layoutchange",[id])}})})},getQueryPagingHtml:function(options){var startIndex=options.startIndex,limit=options.limit,totalRecordCount=options.totalRecordCount,html="",recordsEnd=Math.min(startIndex+limit,totalRecordCount),showControls=limit',showControls){html+='';html+=(totalRecordCount?startIndex+1:0)+"-"+recordsEnd+" of "+totalRecordCount,html+=""}return(showControls||options.viewButton||options.filterButton||options.sortButton||options.addLayoutButton)&&(html+='
    ',showControls&&(html+='',html+=''),options.addLayoutButton&&(html+=''),options.sortButton&&(html+=''),options.filterButton&&(html+=''),html+="
    "),html+=""},showSortMenu:function(options){require(["dialogHelper","emby-radio"],function(dialogHelper){function onSortByChange(){var newValue=this.value;if(this.checked){var changed=options.query.SortBy!=newValue;options.query.SortBy=newValue.replace("_",","),options.query.StartIndex=0,options.callback&&changed&&options.callback()}}function onSortOrderChange(){var newValue=this.value;if(this.checked){var changed=options.query.SortOrder!=newValue;options.query.SortOrder=newValue,options.query.StartIndex=0,options.callback&&changed&&options.callback()}}var dlg=dialogHelper.createDialog({removeOnClose:!0,modal:!1,entryAnimationDuration:160,exitAnimationDuration:200});dlg.classList.add("ui-body-a"),dlg.classList.add("background-theme-a"),dlg.classList.add("formDialog");var html="";html+='
    ',html+='

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

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

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

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

    ',html+="
    ",html+='
    ',html+='',html+='',html+='',html+='',html+='',layoutManager.mobile||(html+=''),html+="
    ",html+="
    ",html+='
    ',html+="
    ",skinHeader.classList.add("skinHeader-withBackground"),skinHeader.innerHTML=html,headerHomeButton=skinHeader.querySelector(".headerHomeButton"),headerUserButton=skinHeader.querySelector(".headerUserButton"),headerSettingsButton=skinHeader.querySelector(".headerSettingsButton"),headerCastButton=skinHeader.querySelector(".headerCastButton"),headerSearchButton=skinHeader.querySelector(".headerSearchButton"),browser.chrome||skinHeader.classList.add("skinHeader-blurred"),lazyLoadViewMenuBarImages(),bindMenuEvents()}function lazyLoadViewMenuBarImages(){require(["imageLoader"],function(imageLoader){imageLoader.lazyChildren(skinHeader)})}function onBackClick(){appRouter.back()}function updateUserInHeader(user){var hasImage;if(user&&user.name){if(user.imageUrl){var userButtonHeight=26,url=user.imageUrl;user.supportsImageParams&&(url+="&height="+Math.round(userButtonHeight*Math.max(window.devicePixelRatio||1,2))),updateHeaderUserButton(url),hasImage=!0}headerUserButton.classList.remove("hide")}else headerUserButton.classList.add("hide");hasImage||updateHeaderUserButton(null),user&&user.localUser?(headerHomeButton&&headerHomeButton.classList.remove("hide"),headerSearchButton&&headerSearchButton.classList.remove("hide"),headerSettingsButton&&(user.localUser.Policy.IsAdministrator?headerSettingsButton.classList.remove("hide"):headerSettingsButton.classList.add("hide")),headerCastButton.classList.remove("hide")):(headerHomeButton.classList.add("hide"),headerCastButton.classList.add("hide"),headerSearchButton&&headerSearchButton.classList.add("hide"),headerSettingsButton&&headerSettingsButton.classList.add("hide")),requiresUserRefresh=!1}function updateHeaderUserButton(src){src?(headerUserButton.classList.add("headerUserButtonRound"),headerUserButton.innerHTML=''):(headerUserButton.classList.remove("headerUserButtonRound"),headerUserButton.innerHTML='')}function showSearch(){inputManager.trigger("search")}function onHeaderUserButtonClick(e){Dashboard.showUserFlyout(e.target)}function onHeaderHomeButtonClick(){Dashboard.navigate("home.html")}function bindMenuEvents(){mainDrawerButton=document.querySelector(".mainDrawerButton"),mainDrawerButton&&mainDrawerButton.addEventListener("click",toggleMainDrawer);var headerBackButton=document.querySelector(".headerBackButton");headerBackButton&&headerBackButton.addEventListener("click",onBackClick),headerSearchButton&&headerSearchButton.addEventListener("click",showSearch),headerUserButton.addEventListener("click",onHeaderUserButtonClick),headerHomeButton.addEventListener("click",onHeaderHomeButtonClick),initHeadRoom(skinHeader),skinHeader.querySelector(".btnNotifications").addEventListener("click",function(){Dashboard.navigate("notifications.html")}),headerCastButton.addEventListener("click",onCastButtonClicked)}function onCastButtonClicked(){var btn=this;require(["playerSelectionMenu"],function(playerSelectionMenu){playerSelectionMenu.show(btn)})}function getItemHref(item,context){return appRouter.getRouteUrl(item,{context:context})}function toggleMainDrawer(){navDrawerInstance.isVisible?closeMainDrawer():openMainDrawer()}function openMainDrawer(){navDrawerInstance.open(),lastOpenTime=(new Date).getTime()}function onMainDrawerOpened(){layoutManager.mobile&&document.body.classList.add("bodyWithPopupOpen")}function closeMainDrawer(){navDrawerInstance.close()}function onMainDrawerSelect(e){navDrawerInstance.isVisible?onMainDrawerOpened():document.body.classList.remove("bodyWithPopupOpen")}function refreshLibraryInfoInDrawer(user,drawer){var html="";html+='
    ',html+=''+globalize.translate("ButtonHome")+"",html+='
    ',html+='',html+='

    ',html+=globalize.translate("sharedcomponents#HeaderMyDownloads"),html+="

    ",html+=''+globalize.translate("sharedcomponents#Browse")+"",html+=''+globalize.translate("sharedcomponents#Manage")+"",html+="
    ",html+='',html+='
    ',html+="
    ";var localUser=user.localUser;localUser&&localUser.Policy.IsAdministrator&&(html+='
    ',html+='',html+='

    ',html+=globalize.translate("HeaderAdmin"),html+="

    ",html+=''+globalize.translate("ButtonManageServer")+"",html+=''+globalize.translate("MetadataManager")+"",html+="
    "),html+='
    ',html+='',user.localUser&&(html+=''+globalize.translate("ButtonSettings")+""),html+=''+globalize.translate("sharedcomponents#Sync")+"",Dashboard.isConnectMode()&&(html+=''+globalize.translate("ButtonSelectServer")+""),!user.localUser||user.localUser.EnableAutoLogin&&!user.connectUser||(html+=''+globalize.translate("ButtonSignOut")+""),html+="
    ",navDrawerScrollContainer.innerHTML=html;var lnkManageServer=navDrawerScrollContainer.querySelector(".lnkManageServer");lnkManageServer&&lnkManageServer.addEventListener("click",onManageServerClicked)}function refreshDashboardInfoInDrawer(apiClient){currentDrawerType="admin",loadNavDrawer(),navDrawerScrollContainer.querySelector(".adminDrawerLogo")?updateDashboardMenuSelectedItem():createDashboardMenu(apiClient)}function isUrlInCurrentView(url){return window.location.href.toString().toLowerCase().indexOf(url.toLowerCase())!==-1}function updateDashboardMenuSelectedItem(){for(var links=navDrawerScrollContainer.querySelectorAll(".navMenuOption"),currentViewId=viewManager.currentView().id,i=0,length=links.length;i0),selected){link.classList.add("navMenuOption-selected");var title="";link=link.querySelector("span")||link;var secondaryTitle=(link.innerText||link.textContent).trim();title+=secondaryTitle,LibraryMenu.setTitle(title)}else link.classList.remove("navMenuOption-selected")}}function createToolsMenuList(pluginItems){var links=[{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("TabUsers"),href:"userprofiles.html",pageIds:["userProfilesPage","newUserPage","editUserPage","userLibraryAccessPage","userParentalControlPage","userPasswordPage"],icon:"people"},{name:"Emby Premiere",href:"supporterkey.html",pageIds:["supporterKeyPage"],icon:"star"},{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("TabTranscoding"),icon:"transform",href:"encodingsettings.html",pageIds:["encodingSettingsPage"]},{divider:!0,name:globalize.translate("TabDevices")},{name:globalize.translate("TabDevices"),href:"devices.html",pageIds:["devicesPage","devicePage"],icon:"tablet"},{name:globalize.translate("HeaderDownloadSync"),icon:"file_download",href:"syncactivity.html",pageIds:["syncActivityPage","syncJobPage","syncSettingsPage"],color:"#009688"},{name:globalize.translate("TabCameraUpload"),href:"devicesupload.html",pageIds:["devicesUploadPage"],icon:"photo_camera"},{name:globalize.translate("DLNA"),href:"dlnasettings.html",pageIds:["dlnaSettingsPage","dlnaProfilesPage","dlnaProfilePage"],icon:""},{divider:!0,name:globalize.translate("HeaderLiveTV")},{name:globalize.translate("TabLiveTV"),href:"livetvstatus.html",pageIds:["liveTvStatusPage","liveTvTunerPage"],icon:""},{name:globalize.translate("DVR"),href:"livetvsettings.html",pageIds:["liveTvSettingsPage"],icon:"dvr"}];links.push({divider:!0,name:globalize.translate("TabExpert")}),links.push({name:globalize.translate("TabAdvanced"),icon:"settings",href:"dashboardhosting.html",color:"#F16834",pageIds:["dashboardHostingPage","serverSecurityPage"]}),links.push({name:globalize.translate("TabLogs"),href:"log.html",pageIds:["logPage"],icon:"folder_open"}),links.push({name:globalize.translate("TabNotifications"),icon:"notifications",color:"brown",href:"notificationsettings.html",pageIds:["notificationSettingsPage","notificationSettingPage"]}),links.push({name:globalize.translate("TabPlugins"),icon:"add_shopping_cart",color:"#9D22B1",href:"plugins.html",pageIds:["pluginsPage","pluginCatalogPage"]}),links.push({name:globalize.translate("TabScheduledTasks"),href:"scheduledtasks.html",pageIds:["scheduledTasksPage","scheduledTaskPage"],icon:"schedule"}),links.push({name:globalize.translate("MetadataManager"),href:"edititemmetadata.html",pageIds:[],icon:"mode_edit"});for(var i=0,length=pluginItems.length;i",item.icon&&(menuHtml+=''+item.icon+""),menuHtml+="",menuHtml+=item.name,menuHtml+="",menuHtml+=""}function getToolsMenuHtml(apiClient){return getToolsMenuLinks(apiClient).then(function(items){var i,length,item,menuHtml="";for(menuHtml+='
    ',i=0,length=items.length;i
    "),item.href?menuHtml+=getToolsLinkHtml(item):item.name&&(menuHtml+='

    ',menuHtml+=item.name,menuHtml+="

    ");return menuHtml+=""})}function createDashboardMenu(apiClient){return getToolsMenuHtml(apiClient).then(function(toolsMenuHtml){var html="";html+='",html+=toolsMenuHtml,html=html.split("href=").join('onclick="return LibraryMenu.onLinkClicked(event, this);" href='),navDrawerScrollContainer.innerHTML=html,updateDashboardMenuSelectedItem()})}function onSidebarLinkClick(){var section=this.getElementsByClassName("sectionName")[0],text=section?section.innerHTML:this.innerHTML;LibraryMenu.setTitle(text)}function getUserViews(apiClient,userId){return apiClient.getUserViews({},userId).then(function(result){for(var items=result.Items,list=[],i=0,length=items.length;i',html+=globalize.translate("HeaderMedia"),html+="",html+=items.map(function(i){var icon="folder",color="inherit",itemId=i.Id;"channels"==i.CollectionType?itemId="channels":"livetv"==i.CollectionType&&(itemId="livetv"),"photos"==i.CollectionType?(icon="photo_library",color="#009688"):"music"==i.CollectionType||"musicvideos"==i.CollectionType?(icon="library_music",color="#FB8521"):"books"==i.CollectionType?(icon="library_books",color="#1AA1E1"):"playlists"==i.CollectionType?(icon="view_list",color="#795548"):"games"==i.CollectionType?(icon="games",color="#F44336"):"movies"==i.CollectionType?(icon="video_library",color="#CE5043"):"channels"==i.CollectionType||"Channel"==i.Type?(icon="videocam",color="#E91E63"):"tvshows"==i.CollectionType?(icon="tv",color="#4CAF50"):"livetv"==i.CollectionType&&(icon="live_tv",color="#293AAE"),icon=i.icon||icon;var onclick=i.onclick?" function(){"+i.onclick+"}":"null";return''+icon+''+i.Name+""}).join(""),libraryMenuOptions.innerHTML=html;for(var elem=libraryMenuOptions,sidebarLinks=elem.querySelectorAll(".navMenuOption"),i=0,length=sidebarLinks.length;i200&&setTimeout(function(){closeMainDrawer(),setTimeout(function(){action?action():Dashboard.navigate(link.href)},getNavigateDelay())},50),event.stopPropagation(),event.preventDefault(),!1)},onLogoutClicked:function(){return(new Date).getTime()-lastOpenTime>200&&(closeMainDrawer(),setTimeout(function(){Dashboard.logout()},getNavigateDelay())),!1},onHardwareMenuButtonClick:function(){toggleMainDrawer()},onSettingsClicked:function(event){return 1!=event.which||(Dashboard.navigate("dashboard.html"),!1)},setTabs:function(type,selectedIndex,builder){require(["mainTabsManager"],function(mainTabsManager){type?mainTabsManager.setTabs(viewManager.currentView(),selectedIndex,builder,function(){return[]}):mainTabsManager.setTabs(null)})},setDefaultTitle:function(){pageTitleElement||(pageTitleElement=document.querySelector(".pageTitle")),pageTitleElement&&(pageTitleElement.classList.add("pageTitleWithLogo"),pageTitleElement.classList.add("pageTitleWithDefaultLogo"),pageTitleElement.style.backgroundImage=null,pageTitleElement.innerHTML=""),document.title="Emby"},setTitle:function(title){if(null==title)return void LibraryMenu.setDefaultTitle();var html=title,page=viewManager.currentView();if(page){var helpUrl=page.getAttribute("data-helpurl");helpUrl&&(html+=''+globalize.translate("ButtonHelp")+"")}pageTitleElement||(pageTitleElement=document.querySelector(".pageTitle")),pageTitleElement&&(pageTitleElement.classList.remove("pageTitleWithLogo"),pageTitleElement.classList.remove("pageTitleWithDefaultLogo"),pageTitleElement.style.backgroundImage=null,pageTitleElement.innerHTML=html),document.title=title||"Emby"},setTransparentMenu:function(transparent){transparent?skinHeader.classList.add("semiTransparent"):skinHeader.classList.remove("semiTransparent")}};var currentPageType;return pageClassOn("pagebeforeshow","page",function(e){var page=this;page.classList.contains("withTabs")||LibraryMenu.setTabs(null)}),pageClassOn("pageshow","page",function(e){var page=this,isDashboardPage=page.classList.contains("type-interior"),isLibraryPage=!isDashboardPage&&page.classList.contains("libraryPage"),apiClient=getCurrentApiClient();isDashboardPage?(mainDrawerButton&&mainDrawerButton.classList.remove("hide"),refreshDashboardInfoInDrawer(apiClient)):(mainDrawerButton&&(enableLibraryNavDrawer?mainDrawerButton.classList.remove("hide"):mainDrawerButton.classList.add("hide")),"library"!==currentDrawerType&&refreshLibraryDrawer()),updateMenuForPageType(isDashboardPage,isLibraryPage),e.detail.isRestored||window.scrollTo(0,0),updateTitle(page),updateBackButton(page),updateLibraryNavLinks(page)}),renderHeader(),events.on(connectionManager,"localusersignedin",function(e,user){currentDrawerType=null,currentUser={localUser:user},loadNavDrawer(),connectionManager.user(connectionManager.getApiClient(user.ServerId)).then(function(user){currentUser=user,updateUserInHeader(user)})}),events.on(connectionManager,"localusersignedout",function(){currentUser={},updateUserInHeader()}),events.on(playbackManager,"playerchange",updateCastIcon),loadNavDrawer(),LibraryMenu}); \ No newline at end of file +define(["layoutManager","inputManager","connectionManager","events","viewManager","libraryBrowser","appRouter","apphost","playbackManager","browser","globalize","paper-icon-button-light","material-icons","scrollStyles","flexStyles"],function(layoutManager,inputManager,connectionManager,events,viewManager,libraryBrowser,appRouter,appHost,playbackManager,browser,globalize){"use strict";function getCurrentApiClient(){return currentUser&¤tUser.localUser?connectionManager.getApiClient(currentUser.localUser.ServerId):connectionManager.currentApiClient()}function lazyLoadViewMenuBarImages(){require(["imageLoader"],function(imageLoader){imageLoader.lazyChildren(skinHeader)})}function onBackClick(){appRouter.back()}function updateUserInHeader(user){var hasImage;if(user&&user.name){if(user.imageUrl){var url=user.imageUrl;user.supportsImageParams&&(url+="&height="+Math.round(26*Math.max(window.devicePixelRatio||1,2))),updateHeaderUserButton(url),hasImage=!0}headerUserButton.classList.remove("hide")}else headerUserButton.classList.add("hide");hasImage||updateHeaderUserButton(null),user&&user.localUser?(headerHomeButton&&headerHomeButton.classList.remove("hide"),headerSearchButton&&headerSearchButton.classList.remove("hide"),headerSettingsButton&&(user.localUser.Policy.IsAdministrator?headerSettingsButton.classList.remove("hide"):headerSettingsButton.classList.add("hide")),headerCastButton.classList.remove("hide")):(headerHomeButton.classList.add("hide"),headerCastButton.classList.add("hide"),headerSearchButton&&headerSearchButton.classList.add("hide"),headerSettingsButton&&headerSettingsButton.classList.add("hide")),requiresUserRefresh=!1}function updateHeaderUserButton(src){src?(headerUserButton.classList.add("headerUserButtonRound"),headerUserButton.innerHTML=''):(headerUserButton.classList.remove("headerUserButtonRound"),headerUserButton.innerHTML='')}function showSearch(){inputManager.trigger("search")}function onHeaderUserButtonClick(e){Dashboard.showUserFlyout(e.target)}function onHeaderHomeButtonClick(){Dashboard.navigate("home.html")}function bindMenuEvents(){(mainDrawerButton=document.querySelector(".mainDrawerButton"))&&mainDrawerButton.addEventListener("click",toggleMainDrawer);var headerBackButton=document.querySelector(".headerBackButton");headerBackButton&&headerBackButton.addEventListener("click",onBackClick),headerSearchButton&&headerSearchButton.addEventListener("click",showSearch),headerUserButton.addEventListener("click",onHeaderUserButtonClick),headerHomeButton.addEventListener("click",onHeaderHomeButtonClick),initHeadRoom(skinHeader),skinHeader.querySelector(".btnNotifications").addEventListener("click",function(){Dashboard.navigate("notifications.html")}),headerCastButton.addEventListener("click",onCastButtonClicked)}function onCastButtonClicked(){var btn=this;require(["playerSelectionMenu"],function(playerSelectionMenu){playerSelectionMenu.show(btn)})}function getItemHref(item,context){return appRouter.getRouteUrl(item,{context:context})}function toggleMainDrawer(){navDrawerInstance.isVisible?closeMainDrawer():openMainDrawer()}function openMainDrawer(){navDrawerInstance.open(),lastOpenTime=(new Date).getTime()}function onMainDrawerOpened(){layoutManager.mobile&&document.body.classList.add("bodyWithPopupOpen")}function closeMainDrawer(){navDrawerInstance.close()}function onMainDrawerSelect(e){navDrawerInstance.isVisible?onMainDrawerOpened():document.body.classList.remove("bodyWithPopupOpen")}function refreshLibraryInfoInDrawer(user,drawer){var html="";html+='
    ',html+=''+globalize.translate("ButtonHome")+"",html+='
    ',html+='',html+='

    ',html+=globalize.translate("sharedcomponents#HeaderMyDownloads"),html+="

    ",html+=''+globalize.translate("sharedcomponents#Browse")+"",html+=''+globalize.translate("sharedcomponents#Manage")+"",html+="
    ",html+='',html+='
    ',html+="
    ";var localUser=user.localUser;localUser&&localUser.Policy.IsAdministrator&&(html+='
    ',html+='',html+='

    ',html+=globalize.translate("HeaderAdmin"),html+="

    ",html+=''+globalize.translate("ButtonManageServer")+"",html+=''+globalize.translate("MetadataManager")+"",html+="
    "),html+='
    ',html+='',user.localUser&&(html+=''+globalize.translate("ButtonSettings")+""),html+=''+globalize.translate("sharedcomponents#Sync")+"",Dashboard.isConnectMode()&&(html+=''+globalize.translate("ButtonSelectServer")+""),!user.localUser||user.localUser.EnableAutoLogin&&!user.connectUser||(html+=''+globalize.translate("ButtonSignOut")+""),html+="
    ",navDrawerScrollContainer.innerHTML=html;var lnkManageServer=navDrawerScrollContainer.querySelector(".lnkManageServer");lnkManageServer&&lnkManageServer.addEventListener("click",onManageServerClicked)}function refreshDashboardInfoInDrawer(apiClient){currentDrawerType="admin",loadNavDrawer(),navDrawerScrollContainer.querySelector(".adminDrawerLogo")?updateDashboardMenuSelectedItem():createDashboardMenu(apiClient)}function isUrlInCurrentView(url){return-1!==window.location.href.toString().toLowerCase().indexOf(url.toLowerCase())}function updateDashboardMenuSelectedItem(){for(var links=navDrawerScrollContainer.querySelectorAll(".navMenuOption"),currentViewId=viewManager.currentView().id,i=0,length=links.length;i0),selected){link.classList.add("navMenuOption-selected");var title="";link=link.querySelector("span")||link;title+=(link.innerText||link.textContent).trim(),LibraryMenu.setTitle(title)}else link.classList.remove("navMenuOption-selected")}}function createToolsMenuList(pluginItems){var links=[{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("TabUsers"),href:"userprofiles.html",pageIds:["userProfilesPage","newUserPage","editUserPage","userLibraryAccessPage","userParentalControlPage","userPasswordPage"],icon:"people"},{name:"Emby Premiere",href:"supporterkey.html",pageIds:["supporterKeyPage"],icon:"star"},{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("TabTranscoding"),icon:"transform",href:"encodingsettings.html",pageIds:["encodingSettingsPage"]},{divider:!0,name:globalize.translate("TabDevices")},{name:globalize.translate("TabDevices"),href:"devices.html",pageIds:["devicesPage","devicePage"],icon:"tablet"},{name:globalize.translate("HeaderDownloadSync"),icon:"file_download",href:"syncactivity.html",pageIds:["syncActivityPage","syncJobPage","syncSettingsPage"],color:"#009688"},{name:globalize.translate("TabCameraUpload"),href:"devicesupload.html",pageIds:["devicesUploadPage"],icon:"photo_camera"},{name:globalize.translate("DLNA"),href:"dlnasettings.html",pageIds:["dlnaSettingsPage","dlnaProfilesPage","dlnaProfilePage"],icon:""},{divider:!0,name:globalize.translate("HeaderLiveTV")},{name:globalize.translate("TabLiveTV"),href:"livetvstatus.html",pageIds:["liveTvStatusPage","liveTvTunerPage"],icon:""},{name:globalize.translate("DVR"),href:"livetvsettings.html",pageIds:["liveTvSettingsPage"],icon:"dvr"}];links.push({divider:!0,name:globalize.translate("TabExpert")}),links.push({name:globalize.translate("TabAdvanced"),icon:"settings",href:"dashboardhosting.html",color:"#F16834",pageIds:["dashboardHostingPage","serverSecurityPage"]}),links.push({name:globalize.translate("TabLogs"),href:"log.html",pageIds:["logPage"],icon:"folder_open"}),links.push({name:globalize.translate("TabNotifications"),icon:"notifications",color:"brown",href:"notificationsettings.html",pageIds:["notificationSettingsPage","notificationSettingPage"]}),links.push({name:globalize.translate("TabPlugins"),icon:"add_shopping_cart",color:"#9D22B1",href:"plugins.html",pageIds:["pluginsPage","pluginCatalogPage"]}),links.push({name:globalize.translate("TabScheduledTasks"),href:"scheduledtasks.html",pageIds:["scheduledTasksPage","scheduledTaskPage"],icon:"schedule"}),links.push({name:globalize.translate("MetadataManager"),href:"edititemmetadata.html",pageIds:[],icon:"mode_edit"});for(var i=0,length=pluginItems.length;i",item.icon&&(menuHtml+=''+item.icon+""),menuHtml+="",menuHtml+=item.name,menuHtml+="",menuHtml+=""}function getToolsMenuHtml(apiClient){return getToolsMenuLinks(apiClient).then(function(items){var i,length,item,menuHtml="";for(menuHtml+='
    ',i=0,length=items.length;i
    "),item.href?menuHtml+=getToolsLinkHtml(item):item.name&&(menuHtml+='

    ',menuHtml+=item.name,menuHtml+="

    ");return menuHtml+=""})}function createDashboardMenu(apiClient){return getToolsMenuHtml(apiClient).then(function(toolsMenuHtml){var html="";html+='",html+=toolsMenuHtml,html=html.split("href=").join('onclick="return LibraryMenu.onLinkClicked(event, this);" href='),navDrawerScrollContainer.innerHTML=html,updateDashboardMenuSelectedItem()})}function onSidebarLinkClick(){var section=this.getElementsByClassName("sectionName")[0],text=section?section.innerHTML:this.innerHTML;LibraryMenu.setTitle(text)}function getUserViews(apiClient,userId){return apiClient.getUserViews({},userId).then(function(result){for(var items=result.Items,list=[],i=0,length=items.length;i',html+=globalize.translate("HeaderMedia"),html+="",html+=items.map(function(i){var icon="folder",itemId=i.Id;return"channels"==i.CollectionType?itemId="channels":"livetv"==i.CollectionType&&(itemId="livetv"),"photos"==i.CollectionType?(icon="photo_library","#009688"):"music"==i.CollectionType||"musicvideos"==i.CollectionType?(icon="library_music","#FB8521"):"books"==i.CollectionType?(icon="library_books","#1AA1E1"):"playlists"==i.CollectionType?(icon="view_list","#795548"):"games"==i.CollectionType?(icon="games","#F44336"):"movies"==i.CollectionType?(icon="video_library","#CE5043"):"channels"==i.CollectionType||"Channel"==i.Type?(icon="videocam","#E91E63"):"tvshows"==i.CollectionType?(icon="tv","#4CAF50"):"livetv"==i.CollectionType&&(icon="live_tv","#293AAE"),icon=i.icon||icon,''+icon+''+i.Name+""}).join(""),libraryMenuOptions.innerHTML=html;for(var elem=libraryMenuOptions,sidebarLinks=elem.querySelectorAll(".navMenuOption"),i=0,length=sidebarLinks.length;i200&&setTimeout(function(){closeMainDrawer(),setTimeout(function(){action?action():Dashboard.navigate(link.href)},getNavigateDelay())},50),event.stopPropagation(),event.preventDefault(),!1)},onLogoutClicked:function(){return(new Date).getTime()-lastOpenTime>200&&(closeMainDrawer(),setTimeout(function(){Dashboard.logout()},getNavigateDelay())),!1},onHardwareMenuButtonClick:function(){toggleMainDrawer()},onSettingsClicked:function(event){return 1!=event.which||(Dashboard.navigate("dashboard.html"),!1)},setTabs:function(type,selectedIndex,builder){require(["mainTabsManager"],function(mainTabsManager){type?mainTabsManager.setTabs(viewManager.currentView(),selectedIndex,builder,function(){return[]}):mainTabsManager.setTabs(null)})},setDefaultTitle:function(){pageTitleElement||(pageTitleElement=document.querySelector(".pageTitle")),pageTitleElement&&(pageTitleElement.classList.add("pageTitleWithLogo"),pageTitleElement.classList.add("pageTitleWithDefaultLogo"),pageTitleElement.style.backgroundImage=null,pageTitleElement.innerHTML=""),document.title="Emby"},setTitle:function(title){if(null==title)return void LibraryMenu.setDefaultTitle();var html=title,page=viewManager.currentView();if(page){var helpUrl=page.getAttribute("data-helpurl");helpUrl&&(html+=''+globalize.translate("ButtonHelp")+"")}pageTitleElement||(pageTitleElement=document.querySelector(".pageTitle")),pageTitleElement&&(pageTitleElement.classList.remove("pageTitleWithLogo"),pageTitleElement.classList.remove("pageTitleWithDefaultLogo"),pageTitleElement.style.backgroundImage=null,pageTitleElement.innerHTML=html),document.title=title||"Emby"},setTransparentMenu:function(transparent){transparent?skinHeader.classList.add("semiTransparent"):skinHeader.classList.remove("semiTransparent")}};var currentPageType;return pageClassOn("pagebeforeshow","page",function(e){this.classList.contains("withTabs")||LibraryMenu.setTabs(null)}),pageClassOn("pageshow","page",function(e){var page=this,isDashboardPage=page.classList.contains("type-interior"),isLibraryPage=!isDashboardPage&&page.classList.contains("libraryPage"),apiClient=getCurrentApiClient();isDashboardPage?(mainDrawerButton&&mainDrawerButton.classList.remove("hide"),refreshDashboardInfoInDrawer(apiClient)):(mainDrawerButton&&(enableLibraryNavDrawer?mainDrawerButton.classList.remove("hide"):mainDrawerButton.classList.add("hide")),"library"!==currentDrawerType&&refreshLibraryDrawer()),updateMenuForPageType(isDashboardPage,isLibraryPage),e.detail.isRestored||window.scrollTo(0,0),updateTitle(page),updateBackButton(page),updateLibraryNavLinks(page)}),function(){var html="";html+='
    ',html+='
    ',html+='",html+='',html+='',html+='

    ',html+="
    ",html+='
    ',html+='',html+='',html+='',html+='',html+='',layoutManager.mobile||(html+=''),html+="
    ",html+="
    ",html+='
    ',html+="
    ",skinHeader.classList.add("skinHeader-withBackground"),skinHeader.innerHTML=html,headerHomeButton=skinHeader.querySelector(".headerHomeButton"),headerUserButton=skinHeader.querySelector(".headerUserButton"),headerSettingsButton=skinHeader.querySelector(".headerSettingsButton"),headerCastButton=skinHeader.querySelector(".headerCastButton"),headerSearchButton=skinHeader.querySelector(".headerSearchButton"),browser.chrome||skinHeader.classList.add("skinHeader-blurred"),lazyLoadViewMenuBarImages(),bindMenuEvents()}(),events.on(connectionManager,"localusersignedin",function(e,user){currentDrawerType=null,currentUser={localUser:user},loadNavDrawer(),connectionManager.user(connectionManager.getApiClient(user.ServerId)).then(function(user){currentUser=user,updateUserInHeader(user)})}),events.on(connectionManager,"localusersignedout",function(){currentUser={},updateUserInHeader()}),events.on(playbackManager,"playerchange",updateCastIcon),loadNavDrawer(),LibraryMenu}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/livetvcomponents.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/livetvcomponents.js index 46edf98920..c9fb5d0201 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/livetvcomponents.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/livetvcomponents.js @@ -1 +1 @@ -define(["layoutManager","datetime","cardBuilder","apphost"],function(layoutManager,datetime,cardBuilder,appHost){"use strict";function enableScrollX(){return!layoutManager.desktop}function getBackdropShape(){return enableScrollX()?"overflowBackdrop":"backdrop"}function getTimersHtml(timers,options){options=options||{};var i,length,items=timers.map(function(t){return t.Type="Timer",t}),groups=[],currentGroupName="",currentGroup=[];for(i=0,length=items.length;i':'
    ',html+='

    '+group.name+"

    "),enableScrollX()){var scrollXClass="scrollX hiddenScrollX";layoutManager.tv&&(scrollXClass+=" smoothScrollX"),html+='
    '}else html+='
    ';html+=cardBuilder.getCardsHtml({items:group.items,shape:cardLayout?getBackdropShape():enableScrollX()?"autoOverflow":"autoVertical",showParentTitleOrTitle:!0,showAirTime:!0,showAirEndTime:!0,showChannelName:!cardLayout,cardLayout:cardLayout,centerText:!cardLayout,action:"edit",cardFooterAside:"none",preferThumb:!!cardLayout||"auto",defaultShape:cardLayout?null:"portrait",coverImage:!0,allowBottomPadding:!1,overlayText:!1,showChannelLogo:cardLayout}),html+="
    ",group.name&&(html+="
    ")}return Promise.resolve(html)}window.LiveTvHelpers={getTimersHtml:getTimersHtml}}); \ No newline at end of file +define(["layoutManager","datetime","cardBuilder","apphost"],function(layoutManager,datetime,cardBuilder,appHost){"use strict";function enableScrollX(){return!layoutManager.desktop}function getBackdropShape(){return enableScrollX()?"overflowBackdrop":"backdrop"}function getTimersHtml(timers,options){options=options||{};var i,length,items=timers.map(function(t){return t.Type="Timer",t}),groups=[],currentGroupName="",currentGroup=[];for(i=0,length=items.length;i':'
    ',html+='

    '+group.name+"

    "),enableScrollX()){var scrollXClass="scrollX hiddenScrollX";layoutManager.tv&&(scrollXClass+=" smoothScrollX"),html+='
    '}else html+='
    ';html+=cardBuilder.getCardsHtml({items:group.items,shape:cardLayout?getBackdropShape():enableScrollX()?"autoOverflow":"autoVertical",showParentTitleOrTitle:!0,showAirTime:!0,showAirEndTime:!0,showChannelName:!cardLayout,cardLayout:cardLayout,centerText:!cardLayout,action:"edit",cardFooterAside:"none",preferThumb:!!cardLayout||"auto",defaultShape:cardLayout?null:"portrait",coverImage:!0,allowBottomPadding:!1,overlayText:!1,showChannelLogo:cardLayout}),html+="
    ",group.name&&(html+="
    ")}return Promise.resolve(html)}window.LiveTvHelpers={getTimersHtml:getTimersHtml}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/livetvguideprovider.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/livetvguideprovider.js index 7bf6d8b3cb..87a5ea98df 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/livetvguideprovider.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/livetvguideprovider.js @@ -1 +1 @@ -define(["events","loading"],function(events,loading){"use strict";function onListingsSubmitted(){Dashboard.navigate("livetvstatus.html")}function init(page,type,providerId){var url="components/tvproviders/"+type+".js";require([url],function(factory){var instance=new factory(page,providerId,{});events.on(instance,"submitted",onListingsSubmitted),instance.init()})}function loadTemplate(page,type,providerId){var xhr=new XMLHttpRequest;xhr.open("GET","components/tvproviders/"+type+".template.html",!0),xhr.onload=function(e){var html=this.response,elem=page.querySelector(".providerTemplate");elem.innerHTML=Globalize.translateDocument(html),init(page,type,providerId)},xhr.send()}pageIdOn("pageshow","liveTvGuideProviderPage",function(){loading.show();var providerId=getParameterByName("id"),type=getParameterByName("type"),page=this;loadTemplate(page,type,providerId)})}); \ No newline at end of file +define(["events","loading"],function(events,loading){"use strict";function onListingsSubmitted(){Dashboard.navigate("livetvstatus.html")}function init(page,type,providerId){var url="components/tvproviders/"+type+".js";require([url],function(factory){var instance=new factory(page,providerId,{});events.on(instance,"submitted",onListingsSubmitted),instance.init()})}function loadTemplate(page,type,providerId){var xhr=new XMLHttpRequest;xhr.open("GET","components/tvproviders/"+type+".template.html",!0),xhr.onload=function(e){var html=this.response;page.querySelector(".providerTemplate").innerHTML=Globalize.translateDocument(html),init(page,type,providerId)},xhr.send()}pageIdOn("pageshow","liveTvGuideProviderPage",function(){loading.show();var providerId=getParameterByName("id");loadTemplate(this,getParameterByName("type"),providerId)})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/livetvrecordings.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/livetvrecordings.js index 8886dc4fc0..02da8ba63d 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/livetvrecordings.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/livetvrecordings.js @@ -1 +1 @@ -define(["layoutManager","loading","components/categorysyncbuttons","cardBuilder","apphost","imageLoader","scripts/livetvcomponents","listViewStyle","emby-itemscontainer"],function(layoutManager,loading,categorysyncbuttons,cardBuilder,appHost,imageLoader){"use strict";function getRecordingGroupHtml(group){var html="";return html+='"}function renderRecordingGroups(context,groups){groups.length?context.querySelector("#recordingGroups").classList.remove("hide"):context.querySelector("#recordingGroups").classList.add("hide");var html="";html+='
    ';for(var i=0,length=groups.length;i",context.querySelector("#recordingGroupItems").innerHTML=html,loading.hide()}function renderRecordings(elem,recordings,cardOptions,scrollX){recordings.length?elem.classList.remove("hide"):elem.classList.add("hide");var recordingItems=elem.querySelector(".recordingItems");scrollX?(recordingItems.classList.add("scrollX"),recordingItems.classList.add("hiddenScrollX"),recordingItems.classList.remove("vertical-wrap")):(recordingItems.classList.remove("scrollX"),recordingItems.classList.remove("hiddenScrollX"),recordingItems.classList.add("vertical-wrap"));var supportsImageAnalysis=appHost.supports("imageanalysis"),cardLayout=!1;recordingItems.innerHTML=cardBuilder.getCardsHtml(Object.assign({items:recordings,shape:scrollX?"autooverflow":"auto",defaultShape:scrollX?"overflowBackdrop":"backdrop",showTitle:!0,showParentTitle:!0,coverImage:!0,cardLayout:cardLayout,centerText:!cardLayout,vibrant:cardLayout&&supportsImageAnalysis,allowBottomPadding:!scrollX,preferThumb:"auto",overlayText:!1},cardOptions||{})),imageLoader.lazyChildren(recordingItems)}function renderLatestRecordings(context,promise){promise.then(function(result){renderRecordings(context.querySelector("#latestRecordings"),result.Items,{showYear:!0,lines:2},!1),loading.hide()})}function renderRecordingFolders(context,promise){promise.then(function(result){renderRecordings(context.querySelector("#recordingFolders"),result.Items,{showYear:!1,showParentTitle:!1},!1)})}function onMoreClick(e){var type=this.getAttribute("data-type"),serverId=ApiClient.serverId();switch(type){case"latest":Dashboard.navigate("list.html?type=Recordings&serverId="+serverId)}}return function(view,params,tabContent){function enableFullRender(){return(new Date).getTime()-lastFullRender>3e5}var foldersPromise,latestPromise,self=this,lastFullRender=0;categorysyncbuttons.init(tabContent);for(var moreButtons=tabContent.querySelectorAll(".more"),i=0,length=moreButtons.length;i',html+="
    ",html+=group.Name,html+="
    ",html+='
    ',1==group.RecordingCount?html+=Globalize.translate("ValueItemCount",group.RecordingCount):html+=Globalize.translate("ValueItemCountPlural",group.RecordingCount),html+="
    ",html+="",html+="
    ",html+="
    "}function renderRecordingGroups(context,groups){groups.length?context.querySelector("#recordingGroups").classList.remove("hide"):context.querySelector("#recordingGroups").classList.add("hide");var html="";html+='
    ';for(var i=0,length=groups.length;i",context.querySelector("#recordingGroupItems").innerHTML=html,loading.hide()}function renderRecordings(elem,recordings,cardOptions,scrollX){recordings.length?elem.classList.remove("hide"):elem.classList.add("hide");var recordingItems=elem.querySelector(".recordingItems");scrollX?(recordingItems.classList.add("scrollX"),recordingItems.classList.add("hiddenScrollX"),recordingItems.classList.remove("vertical-wrap")):(recordingItems.classList.remove("scrollX"),recordingItems.classList.remove("hiddenScrollX"),recordingItems.classList.add("vertical-wrap"));appHost.supports("imageanalysis");recordingItems.innerHTML=cardBuilder.getCardsHtml(Object.assign({items:recordings,shape:scrollX?"autooverflow":"auto",defaultShape:scrollX?"overflowBackdrop":"backdrop",showTitle:!0,showParentTitle:!0,coverImage:!0,cardLayout:!1,centerText:!0,vibrant:!1,allowBottomPadding:!scrollX,preferThumb:"auto",overlayText:!1},cardOptions||{})),imageLoader.lazyChildren(recordingItems)}function renderLatestRecordings(context,promise){promise.then(function(result){renderRecordings(context.querySelector("#latestRecordings"),result.Items,{showYear:!0,lines:2},!1),loading.hide()})}function renderRecordingFolders(context,promise){promise.then(function(result){renderRecordings(context.querySelector("#recordingFolders"),result.Items,{showYear:!1,showParentTitle:!1},!1)})}function onMoreClick(e){var type=this.getAttribute("data-type"),serverId=ApiClient.serverId();switch(type){case"latest":Dashboard.navigate("list.html?type=Recordings&serverId="+serverId)}}return function(view,params,tabContent){function enableFullRender(){return(new Date).getTime()-lastFullRender>3e5}var foldersPromise,latestPromise,self=this,lastFullRender=0;categorysyncbuttons.init(tabContent);for(var moreButtons=tabContent.querySelectorAll(".more"),i=0,length=moreButtons.length;i3e5}function onBeforeTabChange(e){preLoadTab(view,parseInt(e.detail.selectedTabIndex))}function onTabChange(e){var previousTabController=tabControllers[parseInt(e.detail.previousIndex)];previousTabController&&previousTabController.onHide&&previousTabController.onHide(),loadTab(view,parseInt(e.detail.selectedTabIndex))}function getTabContainers(){return view.querySelectorAll(".pageTabContent")}function initTabs(){mainTabsManager.setTabs(view,currentTabIndex,getTabs,getTabContainers,onBeforeTabChange,onTabChange)}function getTabController(page,index,callback){var depends=[];switch(index){case 0:break;case 1:depends.push("scripts/livetvguide");break;case 2:depends.push("scripts/livetvchannels");break;case 3:depends.push("scripts/livetvrecordings");break;case 4:depends.push("scripts/livetvschedule");break;case 5:depends.push("scripts/livetvseriestimers");break;case 6:depends.push("scripts/searchtab")}require(depends,function(controllerFactory){var tabContent;0==index&&(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),self.tabContent=tabContent);var controller=tabControllers[index];controller||(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),controller=0===index?self:6===index?new controllerFactory(view,tabContent,{collectionType:"livetv"}):new controllerFactory(view,params,tabContent),tabControllers[index]=controller,controller.initTab&&controller.initTab()),callback(controller)})}function preLoadTab(page,index){getTabController(page,index,function(controller){renderedTabs.indexOf(index)==-1&&controller.preRender&&controller.preRender()})}function loadTab(page,index){currentTabIndex=index,getTabController(page,index,function(controller){initialTabIndex=null,1===index?document.body.classList.add("autoScrollY"):document.body.classList.remove("autoScrollY"),renderedTabs.indexOf(index)==-1?(1===index&&renderedTabs.push(index),controller.renderTab()):controller.onShow&&controller.onShow(),currentTabController=controller})}function onInputCommand(e){switch(e.detail.command){case"search":e.preventDefault(),Dashboard.navigate("search.html?collectionType=livetv")}}var isViewRestored,self=this,currentTabIndex=parseInt(params.tab||"0"),initialTabIndex=currentTabIndex,lastFullRender=0;[].forEach.call(view.querySelectorAll(".sectionTitleTextButton-programs"),function(link){var href=link.href;href&&(link.href=href+"&serverId="+ApiClient.serverId())}),view.querySelector(".unlockText").innerHTML=globalize.translate("sharedcomponents#LiveTvRequiresUnlock"),validateUnlock(view,!1),self.initTab=function(){for(var tabContent=view.querySelector(".pageTabContent[data-index='0']"),containers=tabContent.querySelectorAll(".itemsContainer"),i=0,length=containers.length;i3e5}function onBeforeTabChange(e){preLoadTab(view,parseInt(e.detail.selectedTabIndex))}function onTabChange(e){var previousTabController=tabControllers[parseInt(e.detail.previousIndex)];previousTabController&&previousTabController.onHide&&previousTabController.onHide(),loadTab(view,parseInt(e.detail.selectedTabIndex))}function getTabContainers(){return view.querySelectorAll(".pageTabContent")}function initTabs(){mainTabsManager.setTabs(view,currentTabIndex,getTabs,getTabContainers,onBeforeTabChange,onTabChange)}function getTabController(page,index,callback){var depends=[];switch(index){case 0:break;case 1:depends.push("scripts/livetvguide");break;case 2:depends.push("scripts/livetvchannels");break;case 3:depends.push("scripts/livetvrecordings");break;case 4:depends.push("scripts/livetvschedule");break;case 5:depends.push("scripts/livetvseriestimers");break;case 6:depends.push("scripts/searchtab")}require(depends,function(controllerFactory){var tabContent;0==index&&(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),self.tabContent=tabContent);var controller=tabControllers[index];controller||(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),controller=0===index?self:6===index?new controllerFactory(view,tabContent,{collectionType:"livetv"}):new controllerFactory(view,params,tabContent),tabControllers[index]=controller,controller.initTab&&controller.initTab()),callback(controller)})}function preLoadTab(page,index){getTabController(page,index,function(controller){-1==renderedTabs.indexOf(index)&&controller.preRender&&controller.preRender()})}function loadTab(page,index){currentTabIndex=index,getTabController(page,index,function(controller){initialTabIndex=null,1===index?document.body.classList.add("autoScrollY"):document.body.classList.remove("autoScrollY"),-1==renderedTabs.indexOf(index)?(1===index&&renderedTabs.push(index),controller.renderTab()):controller.onShow&&controller.onShow(),currentTabController=controller})}function onInputCommand(e){switch(e.detail.command){case"search":e.preventDefault(),Dashboard.navigate("search.html?collectionType=livetv")}}var isViewRestored,self=this,currentTabIndex=parseInt(params.tab||"0"),initialTabIndex=currentTabIndex,lastFullRender=0;[].forEach.call(view.querySelectorAll(".sectionTitleTextButton-programs"),function(link){var href=link.href;href&&(link.href=href+"&serverId="+ApiClient.serverId())}),view.querySelector(".unlockText").innerHTML=globalize.translate("sharedcomponents#LiveTvRequiresUnlock"),validateUnlock(view,!1),self.initTab=function(){for(var tabContent=view.querySelector(".pageTabContent[data-index='0']"),containers=tabContent.querySelectorAll(".itemsContainer"),i=0,length=containers.length;i
    ',html+='
    ',html+='
    ',html+='
    ';var imgUrl;if(user.PrimaryImageTag)imgUrl=apiClient.getUserImageUrl(user.Id,{width:300,tag:user.PrimaryImageTag,type:"Primary"}),html+='
    ";else{var background=getMetroColor(user.Id);imgUrl="css/images/logindefault.png",html+='
    '}html+="
    ",html+="
    ",html+='
    ',html+='
    '+user.Name+"
    ",html+="
    ",html+="
    ",html+=""}var container=context.querySelector("#divUsers");container.innerHTML=html}var metroColors=["#6FBD45","#4BB3DD","#4164A5","#E12026","#800080","#E1B222","#008040","#0094FF","#FF00C7","#FF870F","#7F0037"];return function(view,params){function getApiClient(){var serverId=params.serverid;return serverId?connectionManager.getOrCreateApiClient(serverId):ApiClient}function showVisualForm(){view.querySelector(".visualLoginForm").classList.remove("hide"),view.querySelector(".manualLoginForm").classList.add("hide")}view.querySelector("#divUsers").addEventListener("click",function(e){var card=dom.parentWithClass(e.target,"card"),cardContent=card?card.querySelector(".cardContent"):null;if(cardContent){var context=view,id=cardContent.getAttribute("data-userid"),name=cardContent.getAttribute("data-username"),haspw=cardContent.getAttribute("data-haspw");"manual"==id?(context.querySelector("#txtManualName").value="",showManualForm(context,!0)):"false"==haspw?authenticateUserByName(context,getApiClient(),name,""):(context.querySelector("#txtManualName").value=name,context.querySelector("#txtManualPassword").value="",showManualForm(context,!0,!0))}}),view.querySelector(".manualLoginForm").addEventListener("submit",function(e){appSettings.enableAutoLogin(view.querySelector(".chkRememberLogin").checked);var apiClient=getApiClient();return authenticateUserByName(view,apiClient,view.querySelector("#txtManualName").value,view.querySelector("#txtManualPassword").value),e.preventDefault(),!1}),view.querySelector(".btnForgotPassword").addEventListener("click",function(){Dashboard.navigate("forgotpassword.html")}),view.querySelector(".btnCancel").addEventListener("click",showVisualForm),view.querySelector(".btnManual").addEventListener("click",function(){view.querySelector("#txtManualName").value="",showManualForm(view,!0)}),view.addEventListener("viewshow",function(e){loading.show();var apiClient=getApiClient();apiClient.getPublicUsers().then(function(users){users.length?users.length&&users[0].EnableAutoLogin?authenticateUserByName(view,apiClient,users[0].Name,""):(showVisualForm(),loadUserList(view,apiClient,users)):(view.querySelector("#txtManualName").value="",showManualForm(view,!1,!1)),loading.hide()}),apiClient.getJSON(apiClient.getUrl("Branding/Configuration")).then(function(options){view.querySelector(".disclaimer").textContent=options.LoginDisclaimer||""}),Dashboard.isConnectMode()?view.querySelector(".connectButtons").classList.remove("hide"):view.querySelector(".connectButtons").classList.add("hide")})}}); \ No newline at end of file +define(["appSettings","dom","connectionManager","loading","cardStyle","emby-checkbox"],function(appSettings,dom,connectionManager,loading){"use strict";function authenticateUserByName(page,apiClient,username,password){loading.show(),apiClient.authenticateUserByName(username,password).then(function(result){var newUrl,user=result.User,serverId=getParameterByName("serverid");newUrl=user.Policy.IsAdministrator&&!serverId?"dashboard.html":"home.html",loading.hide(),Dashboard.onServerChanged(user.Id,result.AccessToken,apiClient),Dashboard.navigate(newUrl)},function(response){page.querySelector("#txtManualName").value="",page.querySelector("#txtManualPassword").value="",loading.hide(),401==response.status?require(["toast"],function(toast){toast(Globalize.translate("MessageInvalidUser"))}):showServerConnectionFailure()})}function showServerConnectionFailure(){Dashboard.alert({message:Globalize.translate("MessageUnableToConnectToServer"),title:Globalize.translate("HeaderConnectionFailure")})}function showManualForm(context,showCancel,focusPassword){context.querySelector(".chkRememberLogin").checked=appSettings.enableAutoLogin(),context.querySelector(".manualLoginForm").classList.remove("hide"),context.querySelector(".visualLoginForm").classList.add("hide"),focusPassword?context.querySelector("#txtManualPassword").focus():context.querySelector("#txtManualName").focus(),showCancel?context.querySelector(".btnCancel").classList.remove("hide"):context.querySelector(".btnCancel").classList.add("hide")}function getRandomMetroColor(){var index=Math.floor(Math.random()*(metroColors.length-1));return metroColors[index]}function getMetroColor(str){if(str){for(var character=String(str.substr(0,1).charCodeAt()),sum=0,i=0;i
    ',html+='
    ',html+='
    ',html+='
    ';var imgUrl;if(user.PrimaryImageTag)imgUrl=apiClient.getUserImageUrl(user.Id,{width:300,tag:user.PrimaryImageTag,type:"Primary"}),html+='
    ";else{var background=getMetroColor(user.Id);imgUrl="css/images/logindefault.png",html+='
    '}html+="
    ",html+="
    ",html+='
    ',html+='
    '+user.Name+"
    ",html+="
    ",html+="
    ",html+=""}context.querySelector("#divUsers").innerHTML=html}var metroColors=["#6FBD45","#4BB3DD","#4164A5","#E12026","#800080","#E1B222","#008040","#0094FF","#FF00C7","#FF870F","#7F0037"];return function(view,params){function getApiClient(){var serverId=params.serverid;return serverId?connectionManager.getOrCreateApiClient(serverId):ApiClient}function showVisualForm(){view.querySelector(".visualLoginForm").classList.remove("hide"),view.querySelector(".manualLoginForm").classList.add("hide")}view.querySelector("#divUsers").addEventListener("click",function(e){var card=dom.parentWithClass(e.target,"card"),cardContent=card?card.querySelector(".cardContent"):null;if(cardContent){var context=view,id=cardContent.getAttribute("data-userid"),name=cardContent.getAttribute("data-username"),haspw=cardContent.getAttribute("data-haspw");"manual"==id?(context.querySelector("#txtManualName").value="",showManualForm(context,!0)):"false"==haspw?authenticateUserByName(context,getApiClient(),name,""):(context.querySelector("#txtManualName").value=name,context.querySelector("#txtManualPassword").value="",showManualForm(context,!0,!0))}}),view.querySelector(".manualLoginForm").addEventListener("submit",function(e){appSettings.enableAutoLogin(view.querySelector(".chkRememberLogin").checked);var apiClient=getApiClient();return authenticateUserByName(view,apiClient,view.querySelector("#txtManualName").value,view.querySelector("#txtManualPassword").value),e.preventDefault(),!1}),view.querySelector(".btnForgotPassword").addEventListener("click",function(){Dashboard.navigate("forgotpassword.html")}),view.querySelector(".btnCancel").addEventListener("click",showVisualForm),view.querySelector(".btnManual").addEventListener("click",function(){view.querySelector("#txtManualName").value="",showManualForm(view,!0)}),view.addEventListener("viewshow",function(e){loading.show();var apiClient=getApiClient();apiClient.getPublicUsers().then(function(users){users.length?users.length&&users[0].EnableAutoLogin?authenticateUserByName(view,apiClient,users[0].Name,""):(showVisualForm(),loadUserList(view,apiClient,users)):(view.querySelector("#txtManualName").value="",showManualForm(view,!1,!1)),loading.hide()}),apiClient.getJSON(apiClient.getUrl("Branding/Configuration")).then(function(options){view.querySelector(".disclaimer").textContent=options.LoginDisclaimer||""}),Dashboard.isConnectMode()?view.querySelector(".connectButtons").classList.remove("hide"):view.querySelector(".connectButtons").classList.add("hide")})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/managedownloads.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/managedownloads.js index 072338eba9..c13ef3ddd2 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/managedownloads.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/managedownloads.js @@ -1 +1 @@ -define(["syncJobList"],function(syncJobList){"use strict";return function(view,params){var mode="offline",apiClient=ApiClient,mySyncJobList=new syncJobList({isLocalSync:"offline"===mode,serverId:apiClient.serverId(),userId:"offline"===mode?null:apiClient.getCurrentUserId(),element:view.querySelector(".syncActivity"),mode:mode});view.addEventListener("viewdestroy",function(){mySyncJobList&&(mySyncJobList.destroy(),mySyncJobList=null)})}}); \ No newline at end of file +define(["syncJobList"],function(syncJobList){"use strict";return function(view,params){var apiClient=ApiClient,mySyncJobList=new syncJobList({isLocalSync:!0,serverId:apiClient.serverId(),userId:null,element:view.querySelector(".syncActivity"),mode:"offline"});view.addEventListener("viewdestroy",function(){mySyncJobList&&(mySyncJobList.destroy(),mySyncJobList=null)})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/medialibrarypage.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/medialibrarypage.js index d181cc4226..04ebbfdf43 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/medialibrarypage.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/medialibrarypage.js @@ -1 +1 @@ -define(["jQuery","apphost","scripts/taskbutton","loading","libraryMenu","globalize","dom","indicators","cardStyle","emby-itemrefreshindicator"],function($,appHost,taskButton,loading,libraryMenu,globalize,dom,indicators){"use strict";function changeCollectionType(page,virtualFolder){require(["alert"],function(alert){alert({title:globalize.translate("HeaderChangeFolderType"),text:globalize.translate("HeaderChangeFolderTypeHelp")})})}function addVirtualFolder(page){require(["medialibrarycreator"],function(medialibrarycreator){(new medialibrarycreator).show({collectionTypeOptions:getCollectionTypeOptions().filter(function(f){return!f.hidden}),refresh:shouldRefreshLibraryAfterChanges(page)}).then(function(hasChanges){hasChanges&&reloadLibrary(page)})})}function editVirtualFolder(page,virtualFolder){require(["medialibraryeditor"],function(medialibraryeditor){(new medialibraryeditor).show({refresh:shouldRefreshLibraryAfterChanges(page),library:virtualFolder}).then(function(hasChanges){hasChanges&&reloadLibrary(page)})})}function deleteVirtualFolder(page,virtualFolder){var msg=globalize.translate("MessageAreYouSureYouWishToRemoveMediaFolder");virtualFolder.Locations.length&&(msg+="

    "+globalize.translate("MessageTheFollowingLocationWillBeRemovedFromLibrary")+"

    ",msg+=virtualFolder.Locations.join("
    ")),require(["confirm"],function(confirm){confirm(msg,globalize.translate("HeaderRemoveMediaFolder")).then(function(){var refreshAfterChange=shouldRefreshLibraryAfterChanges(page);ApiClient.removeVirtualFolder(virtualFolder.Name,refreshAfterChange).then(function(){reloadLibrary(page)})})})}function refreshVirtualFolder(page,virtualFolder){require(["refreshDialog"],function(refreshDialog){new refreshDialog({itemIds:[virtualFolder.ItemId],serverId:ApiClient.serverId(),mode:"scan"}).show()})}function renameVirtualFolder(page,virtualFolder){require(["prompt"],function(prompt){prompt({label:globalize.translate("LabelNewName"),confirmText:globalize.translate("ButtonRename")}).then(function(newName){if(newName&&newName!=virtualFolder.Name){var refreshAfterChange=shouldRefreshLibraryAfterChanges(page);ApiClient.renameVirtualFolder(virtualFolder.Name,newName,refreshAfterChange).then(function(){reloadLibrary(page)})}})})}function showCardMenu(page,elem,virtualFolders){var card=dom.parentWithClass(elem,"card"),index=parseInt(card.getAttribute("data-index")),virtualFolder=virtualFolders[index],menuItems=[];menuItems.push({name:globalize.translate("ButtonChangeContentType"),id:"changetype",ironIcon:"videocam"}),menuItems.push({name:globalize.translate("ButtonEditImages"),id:"editimages",ironIcon:"photo"}),menuItems.push({name:globalize.translate("ButtonManageFolders"),id:"edit",ironIcon:"folder_open"}),menuItems.push({name:globalize.translate("ButtonRemove"),id:"delete",ironIcon:"remove"}),menuItems.push({name:globalize.translate("ButtonRename"),id:"rename",ironIcon:"mode_edit"}),menuItems.push({name:globalize.translate("ScanLibrary"),id:"refresh",ironIcon:"refresh"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:elem,callback:function(resultId){switch(resultId){case"changetype":changeCollectionType(page,virtualFolder);break;case"edit":editVirtualFolder(page,virtualFolder);break;case"editimages":editImages(page,virtualFolder);break;case"rename":renameVirtualFolder(page,virtualFolder);break;case"delete":deleteVirtualFolder(page,virtualFolder);break;case"refresh":refreshVirtualFolder(page,virtualFolder)}}})})}function reloadLibrary(page){loading.show(),ApiClient.getVirtualFolders().then(function(result){reloadVirtualFolders(page,result)})}function shouldRefreshLibraryAfterChanges(page){return"mediaLibraryPage"===page.id}function reloadVirtualFolders(page,virtualFolders){var html="";virtualFolders.push({Name:globalize.translate("ButtonAddMediaLibrary"),icon:"add_circle",Locations:[],showType:!1,showLocations:!1,showMenu:!1,showNameWithIcon:!0});for(var i=0,length=virtualFolders.length;i',"")}function getCollectionTypeOptions(){return[{name:"",value:""},{name:globalize.translate("FolderTypeMovies"),value:"movies",message:getLink("MovieLibraryHelp","https://github.com/MediaBrowser/Wiki/wiki/Movie%20naming")},{name:globalize.translate("FolderTypeMusic"),value:"music"},{name:globalize.translate("FolderTypeTvShows"),value:"tvshows",message:getLink("TvLibraryHelp","https://github.com/MediaBrowser/Wiki/wiki/TV%20naming")},{name:globalize.translate("FolderTypeBooks"),value:"books",message:getLink("BookLibraryHelp","https://github.com/MediaBrowser/Wiki/wiki/Book%20naming")},{name:globalize.translate("FolderTypeGames"),value:"games",message:globalize.translate("MessageGamePluginRequired")},{name:globalize.translate("OptionHomeVideos"),value:"homevideos"},{name:globalize.translate("FolderTypeMusicVideos"),value:"musicvideos"},{name:globalize.translate("FolderTypeUnset"),value:"mixed",message:globalize.translate("MessageUnsetContentHelp")}]}function getIcon(type){switch(type){case"movies":return"local_movies";case"music":return"library_music";case"photos":return"photo";case"livetv":return"live_tv";case"tvshows":return"live_tv";case"games":return"folder";case"trailers":return"local_movies";case"homevideos":return"video_library";case"musicvideos":return"video_library";case"books":return"folder";case"channels":return"folder";case"playlists":return"folder";default:return"folder"}}function getVirtualFolderHtml(page,virtualFolder,index){var html="",style="";page.classList.contains("wizardPage")&&(style+="min-width:33.3%;"),html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='
    ';var imgUrl="";virtualFolder.PrimaryImageItemId&&(imgUrl=ApiClient.getScaledImageUrl(virtualFolder.PrimaryImageItemId,{type:"Primary"}));var hasCardImageContainer;if(imgUrl?(html+='
    ",hasCardImageContainer=!0):virtualFolder.showNameWithIcon||(html+='
    ',html+=''+(virtualFolder.icon||getIcon(virtualFolder.CollectionType))+"",hasCardImageContainer=!0),hasCardImageContainer){html+='
    ';var refreshClass=virtualFolder.RefreshProgress||virtualFolder.RefreshStatus&&"Idle"!==virtualFolder.RefreshStatus?"":' class="hide"';html+='
    ',html+="
    ",html+="
    "}if(!imgUrl&&virtualFolder.showNameWithIcon&&(html+='

    ',html+=''+(virtualFolder.icon||getIcon(virtualFolder.CollectionType))+"",virtualFolder.showNameWithIcon&&(html+='
    ',html+=virtualFolder.Name,html+="
    "),html+="

    "),html+="
    ",html+="
    ",html+='
    ',virtualFolder.showMenu!==!1){var moreIcon="dots-horiz"==appHost.moreIcon?"":"";html+='
    ',html+='",html+="
    "}html+="
    ",html+=virtualFolder.showNameWithIcon?" ":virtualFolder.Name,html+="
    ";var typeName=getCollectionTypeOptions().filter(function(t){return t.value==virtualFolder.CollectionType})[0];return typeName=typeName?typeName.name:globalize.translate("FolderTypeUnset"),html+="
    ",html+=virtualFolder.showType===!1?" ":typeName,html+="
    ",virtualFolder.showLocations===!1?(html+="
    ",html+=" ",html+="
    "):virtualFolder.Locations.length&&1==virtualFolder.Locations.length?(html+="
    ",html+=virtualFolder.Locations[0],html+="
    "):(html+="
    ",html+=globalize.translate("NumLocationsValue",virtualFolder.Locations.length),html+="
    "),html+="
    ",html+="
    ",html+="
    "}function getTabs(){return[{href:"library.html",name:globalize.translate("HeaderLibraries")},{href:"librarydisplay.html",name:globalize.translate("TabDisplay")},{href:"metadataimages.html",name:globalize.translate("TabMetadata")},{href:"metadatanfo.html",name:globalize.translate("TabNfoSettings")},{href:"librarysettings.html",name:globalize.translate("TabAdvanced")}]}window.WizardLibraryPage={next:function(){loading.show();var apiClient=ApiClient;apiClient.ajax({type:"POST",url:apiClient.getUrl("System/Configuration/MetadataPlugins/Autoset")}).then(function(){loading.hide(),Dashboard.navigate("wizardsettings.html")})}},pageClassOn("pageshow","mediaLibraryPage",function(){var page=this;reloadLibrary(page)}),pageIdOn("pageshow","mediaLibraryPage",function(){libraryMenu.setTabs("librarysetup",0,getTabs);var page=this;taskButton({mode:"on",progressElem:page.querySelector(".refreshProgress"),taskKey:"RefreshLibrary",button:page.querySelector(".btnRefresh")})}),pageIdOn("pagebeforehide","mediaLibraryPage",function(){var page=this;taskButton({mode:"off",progressElem:page.querySelector(".refreshProgress"),taskKey:"RefreshLibrary",button:page.querySelector(".btnRefresh")})})}); \ No newline at end of file +define(["jQuery","apphost","scripts/taskbutton","loading","libraryMenu","globalize","dom","indicators","cardStyle","emby-itemrefreshindicator"],function($,appHost,taskButton,loading,libraryMenu,globalize,dom,indicators){"use strict";function changeCollectionType(page,virtualFolder){require(["alert"],function(alert){alert({title:globalize.translate("HeaderChangeFolderType"),text:globalize.translate("HeaderChangeFolderTypeHelp")})})}function addVirtualFolder(page){require(["medialibrarycreator"],function(medialibrarycreator){(new medialibrarycreator).show({collectionTypeOptions:getCollectionTypeOptions().filter(function(f){return!f.hidden}),refresh:shouldRefreshLibraryAfterChanges(page)}).then(function(hasChanges){hasChanges&&reloadLibrary(page)})})}function editVirtualFolder(page,virtualFolder){require(["medialibraryeditor"],function(medialibraryeditor){(new medialibraryeditor).show({refresh:shouldRefreshLibraryAfterChanges(page),library:virtualFolder}).then(function(hasChanges){hasChanges&&reloadLibrary(page)})})}function deleteVirtualFolder(page,virtualFolder){var msg=globalize.translate("MessageAreYouSureYouWishToRemoveMediaFolder");virtualFolder.Locations.length&&(msg+="

    "+globalize.translate("MessageTheFollowingLocationWillBeRemovedFromLibrary")+"

    ",msg+=virtualFolder.Locations.join("
    ")),require(["confirm"],function(confirm){confirm(msg,globalize.translate("HeaderRemoveMediaFolder")).then(function(){var refreshAfterChange=shouldRefreshLibraryAfterChanges(page);ApiClient.removeVirtualFolder(virtualFolder.Name,refreshAfterChange).then(function(){reloadLibrary(page)})})})}function refreshVirtualFolder(page,virtualFolder){require(["refreshDialog"],function(refreshDialog){new refreshDialog({itemIds:[virtualFolder.ItemId],serverId:ApiClient.serverId(),mode:"scan"}).show()})}function renameVirtualFolder(page,virtualFolder){require(["prompt"],function(prompt){prompt({label:globalize.translate("LabelNewName"),confirmText:globalize.translate("ButtonRename")}).then(function(newName){if(newName&&newName!=virtualFolder.Name){var refreshAfterChange=shouldRefreshLibraryAfterChanges(page);ApiClient.renameVirtualFolder(virtualFolder.Name,newName,refreshAfterChange).then(function(){reloadLibrary(page)})}})})}function showCardMenu(page,elem,virtualFolders){var card=dom.parentWithClass(elem,"card"),index=parseInt(card.getAttribute("data-index")),virtualFolder=virtualFolders[index],menuItems=[];menuItems.push({name:globalize.translate("ButtonChangeContentType"),id:"changetype",ironIcon:"videocam"}),menuItems.push({name:globalize.translate("ButtonEditImages"),id:"editimages",ironIcon:"photo"}),menuItems.push({name:globalize.translate("ButtonManageFolders"),id:"edit",ironIcon:"folder_open"}),menuItems.push({name:globalize.translate("ButtonRemove"),id:"delete",ironIcon:"remove"}),menuItems.push({name:globalize.translate("ButtonRename"),id:"rename",ironIcon:"mode_edit"}),menuItems.push({name:globalize.translate("ScanLibrary"),id:"refresh",ironIcon:"refresh"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:elem,callback:function(resultId){switch(resultId){case"changetype":changeCollectionType(page,virtualFolder);break;case"edit":editVirtualFolder(page,virtualFolder);break;case"editimages":editImages(page,virtualFolder);break;case"rename":renameVirtualFolder(page,virtualFolder);break;case"delete":deleteVirtualFolder(page,virtualFolder);break;case"refresh":refreshVirtualFolder(page,virtualFolder)}}})})}function reloadLibrary(page){loading.show(),ApiClient.getVirtualFolders().then(function(result){reloadVirtualFolders(page,result)})}function shouldRefreshLibraryAfterChanges(page){return"mediaLibraryPage"===page.id}function reloadVirtualFolders(page,virtualFolders){var html="";virtualFolders.push({Name:globalize.translate("ButtonAddMediaLibrary"),icon:"add_circle",Locations:[],showType:!1,showLocations:!1,showMenu:!1,showNameWithIcon:!0});for(var i=0,length=virtualFolders.length;i',"")}function getCollectionTypeOptions(){return[{name:"",value:""},{name:globalize.translate("FolderTypeMovies"),value:"movies",message:getLink("MovieLibraryHelp","https://github.com/MediaBrowser/Wiki/wiki/Movie%20naming")},{name:globalize.translate("FolderTypeMusic"),value:"music"},{name:globalize.translate("FolderTypeTvShows"),value:"tvshows",message:getLink("TvLibraryHelp","https://github.com/MediaBrowser/Wiki/wiki/TV%20naming")},{name:globalize.translate("FolderTypeBooks"),value:"books",message:getLink("BookLibraryHelp","https://github.com/MediaBrowser/Wiki/wiki/Book%20naming")},{name:globalize.translate("FolderTypeGames"),value:"games",message:globalize.translate("MessageGamePluginRequired")},{name:globalize.translate("OptionHomeVideos"),value:"homevideos"},{name:globalize.translate("FolderTypeMusicVideos"),value:"musicvideos"},{name:globalize.translate("FolderTypeUnset"),value:"mixed",message:globalize.translate("MessageUnsetContentHelp")}]}function getIcon(type){switch(type){case"movies":return"local_movies";case"music":return"library_music";case"photos":return"photo";case"livetv":case"tvshows":return"live_tv";case"games":return"folder";case"trailers":return"local_movies";case"homevideos":case"musicvideos":return"video_library";case"books":case"channels":case"playlists":default:return"folder"}}function getVirtualFolderHtml(page,virtualFolder,index){var html="",style="";page.classList.contains("wizardPage")&&(style+="min-width:33.3%;"),html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='
    ';var imgUrl="";virtualFolder.PrimaryImageItemId&&(imgUrl=ApiClient.getScaledImageUrl(virtualFolder.PrimaryImageItemId,{type:"Primary"}));var hasCardImageContainer;if(imgUrl?(html+='
    ",hasCardImageContainer=!0):virtualFolder.showNameWithIcon||(html+='
    ',html+=''+(virtualFolder.icon||getIcon(virtualFolder.CollectionType))+"",hasCardImageContainer=!0),hasCardImageContainer){html+='
    ';html+='
    ',html+="
    ",html+="
    "}if(!imgUrl&&virtualFolder.showNameWithIcon&&(html+='

    ',html+=''+(virtualFolder.icon||getIcon(virtualFolder.CollectionType))+"",virtualFolder.showNameWithIcon&&(html+='
    ',html+=virtualFolder.Name,html+="
    "),html+="

    "),html+="
    ",html+="
    ",html+='
    ',!1!==virtualFolder.showMenu){var moreIcon="dots-horiz"==appHost.moreIcon?"":"";html+='
    ',html+='",html+="
    "}html+="
    ",virtualFolder.showNameWithIcon?html+=" ":html+=virtualFolder.Name,html+="
    ";var typeName=getCollectionTypeOptions().filter(function(t){return t.value==virtualFolder.CollectionType})[0];return typeName=typeName?typeName.name:globalize.translate("FolderTypeUnset"),html+="
    ",!1===virtualFolder.showType?html+=" ":html+=typeName,html+="
    ",!1===virtualFolder.showLocations?(html+="
    ",html+=" ",html+="
    "):virtualFolder.Locations.length&&1==virtualFolder.Locations.length?(html+="
    ",html+=virtualFolder.Locations[0],html+="
    "):(html+="
    ",html+=globalize.translate("NumLocationsValue",virtualFolder.Locations.length),html+="
    "),html+="
    ",html+="
    ",html+="
    "}function getTabs(){return[{href:"library.html",name:globalize.translate("HeaderLibraries")},{href:"librarydisplay.html",name:globalize.translate("TabDisplay")},{href:"metadataimages.html",name:globalize.translate("TabMetadata")},{href:"metadatanfo.html",name:globalize.translate("TabNfoSettings")},{href:"librarysettings.html",name:globalize.translate("TabAdvanced")}]}window.WizardLibraryPage={next:function(){loading.show();var apiClient=ApiClient;apiClient.ajax({type:"POST",url:apiClient.getUrl("System/Configuration/MetadataPlugins/Autoset")}).then(function(){loading.hide(),Dashboard.navigate("wizardsettings.html")})}},pageClassOn("pageshow","mediaLibraryPage",function(){reloadLibrary(this)}),pageIdOn("pageshow","mediaLibraryPage",function(){libraryMenu.setTabs("librarysetup",0,getTabs);var page=this;taskButton({mode:"on",progressElem:page.querySelector(".refreshProgress"),taskKey:"RefreshLibrary",button:page.querySelector(".btnRefresh")})}),pageIdOn("pagebeforehide","mediaLibraryPage",function(){var page=this;taskButton({mode:"off",progressElem:page.querySelector(".refreshProgress"),taskKey:"RefreshLibrary",button:page.querySelector(".btnRefresh")})})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/metadataimagespage.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/metadataimagespage.js index b13ba71c2b..9a53959a86 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/metadataimagespage.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/metadataimagespage.js @@ -1 +1 @@ -define(["jQuery","dom","loading","libraryMenu","listViewStyle"],function($,dom,loading,libraryMenu){"use strict";function populateLanguages(select){return ApiClient.getCultures().then(function(languages){var html="";html+="";for(var i=0,length=languages.length;i"+culture.DisplayName+""}select.innerHTML=html})}function populateCountries(select){return ApiClient.getCountries().then(function(allCountries){var html="";html+="";for(var i=0,length=allCountries.length;i"+culture.DisplayName+""}select.innerHTML=html})}function loadTabs(page,tabs){for(var html="",i=0,length=tabs.length;i"+Globalize.translate(tab.name)+""}$("#selectItemType",page).html(html).trigger("change"),loading.hide()}function loadType(page,type){loading.show(),currentType=type;var promise1=ApiClient.getServerConfiguration(),promise2=ApiClient.getJSON(ApiClient.getUrl("System/Configuration/MetadataPlugins"));Promise.all([promise1,promise2]).then(function(responses){var config=responses[0],metadataPlugins=responses[1];config=config.MetadataOptions.filter(function(c){return c.ItemType==type})[0],config?(renderType(page,type,config,metadataPlugins),loading.hide()):ApiClient.getJSON(ApiClient.getUrl("System/Configuration/MetadataOptions/Default")).then(function(defaultConfig){config=defaultConfig,renderType(page,type,config,metadataPlugins),loading.hide()})})}function setVisibilityOfBackdrops(elem,visible){visible?(elem.show(),$("input",elem).attr("required","required")):(elem.hide(),$("input",elem).attr("required","").removeAttr("required"))}function renderType(page,type,config,metadataPlugins){var metadataInfo=metadataPlugins.filter(function(f){return type==f.ItemType})[0];setVisibilityOfBackdrops($(".backdropFields",page),metadataInfo.SupportedImageTypes.indexOf("Backdrop")!=-1),setVisibilityOfBackdrops($(".screenshotFields",page),metadataInfo.SupportedImageTypes.indexOf("Screenshot")!=-1),$(".imageType",page).each(function(){var imageType=this.getAttribute("data-imagetype"),container=dom.parentWithTag(this,"LABEL");metadataInfo.SupportedImageTypes.indexOf(imageType)==-1?container.classList.add("hide"):container.classList.remove("hide"),getImageConfig(config,imageType).Limit?this.checked=!0:this.checked=!1});var backdropConfig=getImageConfig(config,"Backdrop");$("#txtMaxBackdrops",page).val(backdropConfig.Limit),$("#txtMinBackdropDownloadWidth",page).val(backdropConfig.MinWidth);var screenshotConfig=getImageConfig(config,"Screenshot");$("#txtMaxScreenshots",page).val(screenshotConfig.Limit),$("#txtMinScreenshotDownloadWidth",page).val(screenshotConfig.MinWidth),renderMetadataFetchers(page,type,config,metadataInfo),renderImageFetchers(page,type,config,metadataInfo)}function getImageConfig(config,type){return config.ImageOptions.filter(function(i){return i.Type==type})[0]||{Type:type,MinWidth:"Backdrop"==type?1280:0,Limit:"Backdrop"==type?3:1}}function renderImageFetchers(page,type,config,metadataInfo){var plugins=metadataInfo.Plugins.filter(function(p){return"ImageFetcher"==p.Type}),html="";if(!plugins.length)return void $(".imageFetchers",page).html(html).hide();var i,length,plugin;for(html+='

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

    ",html+='
    ',i=0,length=plugins.length;i',html+='",html+='
    ',html+='

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

    ",html+="
    ",html+='',html+='',html+="
    "}html+="
    ",html+='
    '+Globalize.translate("LabelImageFetchersHelp")+"
    ";var elem=$(".imageFetchers",page).html(html).show();$(".btnDown",elem).on("click",function(){var elemToMove=$(this).parents(".imageFetcherItem")[0],insertAfter=$(elemToMove).next(".imageFetcherItem")[0];insertAfter&&(elemToMove.parentNode.removeChild(elemToMove),$(elemToMove).insertAfter(insertAfter))}),$(".btnUp",elem).on("click",function(){var elemToMove=$(this).parents(".imageFetcherItem")[0],insertBefore=$(elemToMove).prev(".imageFetcherItem")[0];insertBefore&&(elemToMove.parentNode.removeChild(elemToMove),$(elemToMove).insertBefore(insertBefore))})}function renderMetadataFetchers(page,type,config,metadataInfo){var plugins=metadataInfo.Plugins.filter(function(p){return"MetadataFetcher"==p.Type}),html="";if(!plugins.length)return void $(".metadataFetchers",page).html(html).hide();var i,length,plugin;for(html+='

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

    ",html+='
    ',i=0,length=plugins.length;i',html+='",html+='
    ',html+='

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

    ",html+="
    ",html+='',html+='',html+="
    "}html+="
    ",html+='
    '+Globalize.translate("LabelMetadataDownloadersHelp")+"
    ";var elem=$(".metadataFetchers",page).html(html).show();$(".btnDown",elem).on("click",function(){var elemToMove=$(this).parents(".metadataFetcherItem")[0],insertAfter=$(elemToMove).next(".metadataFetcherItem")[0];insertAfter&&(elemToMove.parentNode.removeChild(elemToMove),$(elemToMove).insertAfter(insertAfter))}),$(".btnUp",elem).on("click",function(){var elemToMove=$(this).parents(".metadataFetcherItem")[0],insertBefore=$(elemToMove).prev(".metadataFetcherItem")[0];insertBefore&&(elemToMove.parentNode.removeChild(elemToMove),$(elemToMove).insertBefore(insertBefore))})}function loadPage(page){var promises=[ApiClient.getServerConfiguration(),populateLanguages(page.querySelector("#selectLanguage")),populateCountries(page.querySelector("#selectCountry"))];Promise.all(promises).then(function(responses){var config=responses[0];page.querySelector("#selectLanguage").value=config.PreferredMetadataLanguage||"",page.querySelector("#selectCountry").value=config.MetadataCountryCode||""}),loadTabs(page,[{name:"OptionMovies",type:"Movie"},{name:"OptionCollections",type:"BoxSet"},{name:"OptionSeries",type:"Series"},{name:"OptionSeasons",type:"Season"},{name:"OptionEpisodes",type:"Episode"},{name:"OptionGames",type:"Game"},{name:"OptionGameSystems",type:"GameSystem"},{name:"OptionMusicArtists",type:"MusicArtist"},{name:"OptionMusicAlbums",type:"MusicAlbum"},{name:"OptionMusicVideos",type:"MusicVideo"},{name:"OptionSongs",type:"Audio"},{name:"OptionHomeVideos",type:"Video"},{name:"OptionBooks",type:"Book"},{name:"OptionPeople",type:"Person"}])}function saveSettingsIntoConfig(form,config){config.DisabledMetadataFetchers=$(".chkMetadataFetcher",form).get().filter(function(c){return!c.checked}).map(function(c){return c.getAttribute("data-pluginname")}),config.MetadataFetcherOrder=$(".chkMetadataFetcher",form).get().map(function(c){return c.getAttribute("data-pluginname")}),config.DisabledImageFetchers=$(".chkImageFetcher",form).get().filter(function(c){return!c.checked}).map(function(c){return c.getAttribute("data-pluginname")}),config.ImageFetcherOrder=$(".chkImageFetcher",form).get().map(function(c){return c.getAttribute("data-pluginname")}),config.ImageOptions=$(".imageType:not(.hide)",form).get().map(function(c){return{Type:c.getAttribute("data-imagetype"),Limit:c.checked?1:0,MinWidth:0}}),config.ImageOptions.push({Type:"Backdrop",Limit:$("#txtMaxBackdrops",form).val(),MinWidth:$("#txtMinBackdropDownloadWidth",form).val()}),config.ImageOptions.push({Type:"Screenshot",Limit:$("#txtMaxScreenshots",form).val(),MinWidth:$("#txtMinScreenshotDownloadWidth",form).val()})}function onSubmit(){var form=this;return loading.show(),ApiClient.getServerConfiguration().then(function(config){var type=currentType,metadataOptions=config.MetadataOptions.filter(function(c){return c.ItemType==type})[0];metadataOptions?(config.PreferredMetadataLanguage=form.querySelector("#selectLanguage").value,config.MetadataCountryCode=form.querySelector("#selectCountry").value,saveSettingsIntoConfig(form,metadataOptions),ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult)):ApiClient.getJSON(ApiClient.getUrl("System/Configuration/MetadataOptions/Default")).then(function(defaultOptions){defaultOptions.ItemType=type,config.MetadataOptions.push(defaultOptions),saveSettingsIntoConfig(form,defaultOptions),ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult)})}),!1}function getTabs(){return[{href:"library.html",name:Globalize.translate("HeaderLibraries")},{href:"librarydisplay.html",name:Globalize.translate("TabDisplay")},{href:"metadataimages.html",name:Globalize.translate("TabMetadata")},{href:"metadatanfo.html",name:Globalize.translate("TabNfoSettings")},{href:"librarysettings.html",name:Globalize.translate("TabAdvanced")}]}var currentType;$(document).on("pageinit","#metadataImagesConfigurationPage",function(){var page=this;$("#selectItemType",page).on("change",function(){loadType(page,this.value)}),$(".metadataImagesConfigurationForm").off("submit",onSubmit).on("submit",onSubmit)}).on("pageshow","#metadataImagesConfigurationPage",function(){libraryMenu.setTabs("metadata",2,getTabs),loading.show();var page=this;loadPage(page)})}); \ No newline at end of file +define(["jQuery","dom","loading","libraryMenu","listViewStyle"],function($,dom,loading,libraryMenu){"use strict";function populateLanguages(select){return ApiClient.getCultures().then(function(languages){var html="";html+="";for(var i=0,length=languages.length;i"+culture.DisplayName+""}select.innerHTML=html})}function populateCountries(select){return ApiClient.getCountries().then(function(allCountries){var html="";html+="";for(var i=0,length=allCountries.length;i"+culture.DisplayName+""}select.innerHTML=html})}function loadTabs(page,tabs){for(var html="",i=0,length=tabs.length;i"+Globalize.translate(tab.name)+""}$("#selectItemType",page).html(html).trigger("change"),loading.hide()}function loadType(page,type){loading.show(),currentType=type;var promise1=ApiClient.getServerConfiguration(),promise2=ApiClient.getJSON(ApiClient.getUrl("System/Configuration/MetadataPlugins"));Promise.all([promise1,promise2]).then(function(responses){var config=responses[0],metadataPlugins=responses[1];config=config.MetadataOptions.filter(function(c){return c.ItemType==type})[0],config?(renderType(page,type,config,metadataPlugins),loading.hide()):ApiClient.getJSON(ApiClient.getUrl("System/Configuration/MetadataOptions/Default")).then(function(defaultConfig){config=defaultConfig,renderType(page,type,config,metadataPlugins),loading.hide()})})}function setVisibilityOfBackdrops(elem,visible){visible?(elem.show(),$("input",elem).attr("required","required")):(elem.hide(),$("input",elem).attr("required","").removeAttr("required"))}function renderType(page,type,config,metadataPlugins){var metadataInfo=metadataPlugins.filter(function(f){return type==f.ItemType})[0];setVisibilityOfBackdrops($(".backdropFields",page),-1!=metadataInfo.SupportedImageTypes.indexOf("Backdrop")),setVisibilityOfBackdrops($(".screenshotFields",page),-1!=metadataInfo.SupportedImageTypes.indexOf("Screenshot")),$(".imageType",page).each(function(){var imageType=this.getAttribute("data-imagetype"),container=dom.parentWithTag(this,"LABEL");-1==metadataInfo.SupportedImageTypes.indexOf(imageType)?container.classList.add("hide"):container.classList.remove("hide"),getImageConfig(config,imageType).Limit?this.checked=!0:this.checked=!1});var backdropConfig=getImageConfig(config,"Backdrop");$("#txtMaxBackdrops",page).val(backdropConfig.Limit),$("#txtMinBackdropDownloadWidth",page).val(backdropConfig.MinWidth);var screenshotConfig=getImageConfig(config,"Screenshot");$("#txtMaxScreenshots",page).val(screenshotConfig.Limit),$("#txtMinScreenshotDownloadWidth",page).val(screenshotConfig.MinWidth),renderMetadataFetchers(page,type,config,metadataInfo),renderImageFetchers(page,type,config,metadataInfo)}function getImageConfig(config,type){return config.ImageOptions.filter(function(i){return i.Type==type})[0]||{Type:type,MinWidth:"Backdrop"==type?1280:0,Limit:"Backdrop"==type?3:1}}function renderImageFetchers(page,type,config,metadataInfo){var plugins=metadataInfo.Plugins.filter(function(p){return"ImageFetcher"==p.Type}),html="";if(!plugins.length)return void $(".imageFetchers",page).html(html).hide();var i,length,plugin;for(html+='

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

    ",html+='
    ',i=0,length=plugins.length;i',html+='",html+='
    ',html+='

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

    ",html+="
    ",html+='',html+='',html+="
    "}html+="
    ",html+='
    '+Globalize.translate("LabelImageFetchersHelp")+"
    ";var elem=$(".imageFetchers",page).html(html).show();$(".btnDown",elem).on("click",function(){var elemToMove=$(this).parents(".imageFetcherItem")[0],insertAfter=$(elemToMove).next(".imageFetcherItem")[0];insertAfter&&(elemToMove.parentNode.removeChild(elemToMove),$(elemToMove).insertAfter(insertAfter))}),$(".btnUp",elem).on("click",function(){var elemToMove=$(this).parents(".imageFetcherItem")[0],insertBefore=$(elemToMove).prev(".imageFetcherItem")[0];insertBefore&&(elemToMove.parentNode.removeChild(elemToMove),$(elemToMove).insertBefore(insertBefore))})}function renderMetadataFetchers(page,type,config,metadataInfo){var plugins=metadataInfo.Plugins.filter(function(p){return"MetadataFetcher"==p.Type}),html="";if(!plugins.length)return void $(".metadataFetchers",page).html(html).hide();var i,length,plugin;for(html+='

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

    ",html+='
    ',i=0,length=plugins.length;i',html+='",html+='
    ',html+='

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

    ",html+="
    ",html+='',html+='',html+="
    "}html+="
    ",html+='
    '+Globalize.translate("LabelMetadataDownloadersHelp")+"
    ";var elem=$(".metadataFetchers",page).html(html).show();$(".btnDown",elem).on("click",function(){var elemToMove=$(this).parents(".metadataFetcherItem")[0],insertAfter=$(elemToMove).next(".metadataFetcherItem")[0];insertAfter&&(elemToMove.parentNode.removeChild(elemToMove),$(elemToMove).insertAfter(insertAfter))}),$(".btnUp",elem).on("click",function(){var elemToMove=$(this).parents(".metadataFetcherItem")[0],insertBefore=$(elemToMove).prev(".metadataFetcherItem")[0];insertBefore&&(elemToMove.parentNode.removeChild(elemToMove),$(elemToMove).insertBefore(insertBefore))})}function loadPage(page){var promises=[ApiClient.getServerConfiguration(),populateLanguages(page.querySelector("#selectLanguage")),populateCountries(page.querySelector("#selectCountry"))];Promise.all(promises).then(function(responses){var config=responses[0];page.querySelector("#selectLanguage").value=config.PreferredMetadataLanguage||"",page.querySelector("#selectCountry").value=config.MetadataCountryCode||""}),loadTabs(page,[{name:"OptionMovies",type:"Movie"},{name:"OptionCollections",type:"BoxSet"},{name:"OptionSeries",type:"Series"},{name:"OptionSeasons",type:"Season"},{name:"OptionEpisodes",type:"Episode"},{name:"OptionGames",type:"Game"},{name:"OptionGameSystems",type:"GameSystem"},{name:"OptionMusicArtists",type:"MusicArtist"},{name:"OptionMusicAlbums",type:"MusicAlbum"},{name:"OptionMusicVideos",type:"MusicVideo"},{name:"OptionSongs",type:"Audio"},{name:"OptionHomeVideos",type:"Video"},{name:"OptionBooks",type:"Book"},{name:"OptionPeople",type:"Person"}])}function saveSettingsIntoConfig(form,config){config.DisabledMetadataFetchers=$(".chkMetadataFetcher",form).get().filter(function(c){return!c.checked}).map(function(c){return c.getAttribute("data-pluginname")}),config.MetadataFetcherOrder=$(".chkMetadataFetcher",form).get().map(function(c){return c.getAttribute("data-pluginname")}),config.DisabledImageFetchers=$(".chkImageFetcher",form).get().filter(function(c){return!c.checked}).map(function(c){return c.getAttribute("data-pluginname")}),config.ImageFetcherOrder=$(".chkImageFetcher",form).get().map(function(c){return c.getAttribute("data-pluginname")}),config.ImageOptions=$(".imageType:not(.hide)",form).get().map(function(c){return{Type:c.getAttribute("data-imagetype"),Limit:c.checked?1:0,MinWidth:0}}),config.ImageOptions.push({Type:"Backdrop",Limit:$("#txtMaxBackdrops",form).val(),MinWidth:$("#txtMinBackdropDownloadWidth",form).val()}),config.ImageOptions.push({Type:"Screenshot",Limit:$("#txtMaxScreenshots",form).val(),MinWidth:$("#txtMinScreenshotDownloadWidth",form).val()})}function onSubmit(){var form=this;return loading.show(),ApiClient.getServerConfiguration().then(function(config){var type=currentType,metadataOptions=config.MetadataOptions.filter(function(c){return c.ItemType==type})[0];metadataOptions?(config.PreferredMetadataLanguage=form.querySelector("#selectLanguage").value,config.MetadataCountryCode=form.querySelector("#selectCountry").value,saveSettingsIntoConfig(form,metadataOptions),ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult)):ApiClient.getJSON(ApiClient.getUrl("System/Configuration/MetadataOptions/Default")).then(function(defaultOptions){defaultOptions.ItemType=type,config.MetadataOptions.push(defaultOptions),saveSettingsIntoConfig(form,defaultOptions),ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult)})}),!1}function getTabs(){return[{href:"library.html",name:Globalize.translate("HeaderLibraries")},{href:"librarydisplay.html",name:Globalize.translate("TabDisplay")},{href:"metadataimages.html",name:Globalize.translate("TabMetadata")},{href:"metadatanfo.html",name:Globalize.translate("TabNfoSettings")},{href:"librarysettings.html",name:Globalize.translate("TabAdvanced")}]}var currentType;$(document).on("pageinit","#metadataImagesConfigurationPage",function(){var page=this;$("#selectItemType",page).on("change",function(){loadType(page,this.value)}),$(".metadataImagesConfigurationForm").off("submit",onSubmit).on("submit",onSubmit)}).on("pageshow","#metadataImagesConfigurationPage",function(){libraryMenu.setTabs("metadata",2,getTabs),loading.show(),loadPage(this)})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/metadatasubtitles.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/metadatasubtitles.js index 2491b24f07..3dd9d6e6f0 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/metadatasubtitles.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/metadatasubtitles.js @@ -1 +1 @@ -define(["jQuery","loading","fnchecked","emby-linkbutton"],function($,loading){"use strict";function loadPage(page,config,languages){$("#chkSubtitlesMovies",page).checked(config.DownloadMovieSubtitles),$("#chkSubtitlesEpisodes",page).checked(config.DownloadEpisodeSubtitles),$("#chkSkipIfGraphicalSubsPresent",page).checked(config.SkipIfEmbeddedSubtitlesPresent),$("#chkSkipIfAudioTrackPresent",page).checked(config.SkipIfAudioTrackMatches),$("#chkRequirePerfectMatch",page).checked(config.RequirePerfectMatch),$("#txtOpenSubtitleUsername",page).val(config.OpenSubtitlesUsername),$("#txtOpenSubtitlePassword",page).val(config.OpenSubtitlesPasswordHash||""),populateLanguages(page,config,languages),loading.hide()}function populateLanguages(page,config,languages){for(var html="",i=0,length=languages.length;i'+culture.DisplayName+""}$(".downloadLanguages",page).html(html);var langs=config.DownloadLanguages||[];$(".chkLang",page).each(function(){this.checked=langs.indexOf(this.getAttribute("data-lang"))!=-1})}function onSubmit(){loading.show();var form=this;return ApiClient.getNamedConfiguration("subtitles").then(function(config){config.DownloadMovieSubtitles=$("#chkSubtitlesMovies",form).checked(),config.DownloadEpisodeSubtitles=$("#chkSubtitlesEpisodes",form).checked(),config.SkipIfEmbeddedSubtitlesPresent=$("#chkSkipIfGraphicalSubsPresent",form).checked(),config.SkipIfAudioTrackMatches=$("#chkSkipIfAudioTrackPresent",form).checked(),config.RequirePerfectMatch=$("#chkRequirePerfectMatch",form).checked(),config.OpenSubtitlesUsername=$("#txtOpenSubtitleUsername",form).val();var newPassword=$("#txtOpenSubtitlePassword",form).val();newPassword&&(config.OpenSubtitlesPasswordHash=newPassword),config.DownloadLanguages=$(".chkLang",form).get().filter(function(c){return c.checked}).map(function(c){return c.getAttribute("data-lang")}),ApiClient.updateNamedConfiguration("subtitles",config).then(Dashboard.processServerConfigurationUpdateResult)}),!1}$(document).on("pageinit","#metadataSubtitlesPage",function(){$(".metadataSubtitlesForm").off("submit",onSubmit).on("submit",onSubmit)}).on("pageshow","#metadataSubtitlesPage",function(){loading.show();var page=this,promise1=ApiClient.getNamedConfiguration("subtitles"),promise2=ApiClient.getCultures();Promise.all([promise1,promise2]).then(function(responses){loadPage(page,responses[0],responses[1])})})}); \ No newline at end of file +define(["jQuery","loading","fnchecked","emby-linkbutton"],function($,loading){"use strict";function loadPage(page,config,languages){$("#chkSubtitlesMovies",page).checked(config.DownloadMovieSubtitles),$("#chkSubtitlesEpisodes",page).checked(config.DownloadEpisodeSubtitles),$("#chkSkipIfGraphicalSubsPresent",page).checked(config.SkipIfEmbeddedSubtitlesPresent),$("#chkSkipIfAudioTrackPresent",page).checked(config.SkipIfAudioTrackMatches),$("#chkRequirePerfectMatch",page).checked(config.RequirePerfectMatch),$("#txtOpenSubtitleUsername",page).val(config.OpenSubtitlesUsername),$("#txtOpenSubtitlePassword",page).val(config.OpenSubtitlesPasswordHash||""),populateLanguages(page,config,languages),loading.hide()}function populateLanguages(page,config,languages){for(var html="",i=0,length=languages.length;i'+culture.DisplayName+""}$(".downloadLanguages",page).html(html);var langs=config.DownloadLanguages||[];$(".chkLang",page).each(function(){this.checked=-1!=langs.indexOf(this.getAttribute("data-lang"))})}function onSubmit(){loading.show();var form=this;return ApiClient.getNamedConfiguration("subtitles").then(function(config){config.DownloadMovieSubtitles=$("#chkSubtitlesMovies",form).checked(),config.DownloadEpisodeSubtitles=$("#chkSubtitlesEpisodes",form).checked(),config.SkipIfEmbeddedSubtitlesPresent=$("#chkSkipIfGraphicalSubsPresent",form).checked(),config.SkipIfAudioTrackMatches=$("#chkSkipIfAudioTrackPresent",form).checked(),config.RequirePerfectMatch=$("#chkRequirePerfectMatch",form).checked(),config.OpenSubtitlesUsername=$("#txtOpenSubtitleUsername",form).val();var newPassword=$("#txtOpenSubtitlePassword",form).val();newPassword&&(config.OpenSubtitlesPasswordHash=newPassword),config.DownloadLanguages=$(".chkLang",form).get().filter(function(c){return c.checked}).map(function(c){return c.getAttribute("data-lang")}),ApiClient.updateNamedConfiguration("subtitles",config).then(Dashboard.processServerConfigurationUpdateResult)}),!1}$(document).on("pageinit","#metadataSubtitlesPage",function(){$(".metadataSubtitlesForm").off("submit",onSubmit).on("submit",onSubmit)}).on("pageshow","#metadataSubtitlesPage",function(){loading.show();var page=this,promise1=ApiClient.getNamedConfiguration("subtitles"),promise2=ApiClient.getCultures();Promise.all([promise1,promise2]).then(function(responses){loadPage(page,responses[0],responses[1])})})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/moviecollections.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/moviecollections.js index 7edca53f40..a663b46cb0 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/moviecollections.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/moviecollections.js @@ -1 +1 @@ -define(["loading","events","libraryBrowser","imageLoader","listView","cardBuilder","apphost","emby-itemscontainer"],function(loading,events,libraryBrowser,imageLoader,listView,cardBuilder,appHost){"use strict";return function(view,params,tabContent){function getPageData(context){var key=getSavedQueryKey(context),pageData=data[key];return pageData||(pageData=data[key]={query:{SortBy:"SortName",SortOrder:"Ascending",IncludeItemTypes:"BoxSet",Recursive:!0,Fields:"PrimaryImageAspectRatio,SortName",ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",StartIndex:0,Limit:pageSize},view:libraryBrowser.getSavedView(key)||"Poster"},pageData.query.ParentId=params.topParentId,libraryBrowser.loadSavedQueryValues(key,pageData.query)),pageData}function getQuery(context){return getPageData(context).query}function getSavedQueryKey(context){return context.savedQueryKey||(context.savedQueryKey=libraryBrowser.getSavedQueryKey("moviecollections")),context.savedQueryKey}function onViewStyleChange(){var viewStyle=self.getCurrentViewStyle(),itemsContainer=tabContent.querySelector(".itemsContainer");"List"==viewStyle?(itemsContainer.classList.add("vertical-list"),itemsContainer.classList.remove("vertical-wrap")):(itemsContainer.classList.remove("vertical-list"),itemsContainer.classList.add("vertical-wrap")),itemsContainer.innerHTML=""}function reloadItems(page){loading.show();var query=getQuery(page);ApiClient.getItems(ApiClient.getCurrentUserId(),query).then(function(result){function onNextPageClick(){query.StartIndex+=query.Limit,reloadItems(tabContent)}function onPreviousPageClick(){query.StartIndex-=query.Limit,reloadItems(tabContent)}window.scrollTo(0,0),updateFilterControls(page);var html,pagingHtml=libraryBrowser.getQueryPagingHtml({startIndex:query.StartIndex,limit:query.Limit,totalRecordCount:result.TotalRecordCount,showLimit:!1,updatePageSizeSetting:!1,addLayoutButton:!1,sortButton:!1,filterButton:!1}),viewStyle=self.getCurrentViewStyle();html="Thumb"==viewStyle?cardBuilder.getCardsHtml({items:result.Items,shape:"backdrop",preferThumb:!0,context:"movies",overlayPlayButton:!0,centerText:!0,showTitle:!0}):"ThumbCard"==viewStyle?cardBuilder.getCardsHtml({items:result.Items,shape:"backdrop",preferThumb:!0,context:"movies",lazy:!0,cardLayout:!0,showTitle:!0,vibrant:!0}):"Banner"==viewStyle?cardBuilder.getCardsHtml({items:result.Items,shape:"banner",preferBanner:!0,context:"movies",lazy:!0}):"List"==viewStyle?listView.getListViewHtml({items:result.Items,context:"movies",sortBy:query.SortBy}):"PosterCard"==viewStyle?cardBuilder.getCardsHtml({items:result.Items,shape:"auto",context:"movies",showTitle:!0,centerText:!1,cardLayout:!0,vibrant:!0}):cardBuilder.getCardsHtml({items:result.Items,shape:"auto",context:"movies",centerText:!0,overlayPlayButton:!0,showTitle:!0});var i,length,elems=tabContent.querySelectorAll(".paging");for(i=0,length=elems.length;i'+Globalize.translate("MessageNoCollectionsAvailable")+"

    ");var itemsContainer=tabContent.querySelector(".itemsContainer");itemsContainer.innerHTML=html,imageLoader.lazyChildren(itemsContainer),libraryBrowser.saveQueryValues(getSavedQueryKey(page),query),loading.hide()})}function updateFilterControls(tabContent){}function initPage(tabContent){tabContent.querySelector(".btnSort").addEventListener("click",function(e){libraryBrowser.showSortMenu({items:[{name:Globalize.translate("OptionNameSort"),id:"SortName"},{name:Globalize.translate("OptionImdbRating"),id:"CommunityRating,SortName"},{name:Globalize.translate("OptionDateAdded"),id:"DateCreated,SortName"},{name:Globalize.translate("OptionParentalRating"),id:"OfficialRating,SortName"},{name:Globalize.translate("OptionReleaseDate"),id:"PremiereDate,SortName"}],callback:function(){getQuery(tabContent).StartIndex=0,reloadItems(tabContent)},query:getQuery(tabContent),button:e.target})});var btnSelectView=tabContent.querySelector(".btnSelectView");btnSelectView.addEventListener("click",function(e){libraryBrowser.showLayoutMenu(e.target,self.getCurrentViewStyle(),"List,Poster,PosterCard,Thumb,ThumbCard".split(","))}),btnSelectView.addEventListener("layoutchange",function(e){var viewStyle=e.detail.viewStyle;getPageData(tabContent).view=viewStyle,libraryBrowser.saveViewSetting(getSavedQueryKey(tabContent),viewStyle),getQuery(tabContent).StartIndex=0,onViewStyleChange(),reloadItems(tabContent)}),tabContent.querySelector(".btnNewCollection").addEventListener("click",function(){require(["collectionEditor"],function(collectionEditor){var serverId=ApiClient.serverInfo().Id;(new collectionEditor).show({items:[],serverId:serverId})})})}var self=this,pageSize=libraryBrowser.getDefaultPageSize(),data={};self.getCurrentViewStyle=function(){return getPageData(tabContent).view},initPage(tabContent),onViewStyleChange(),self.renderTab=function(){reloadItems(tabContent),updateFilterControls(tabContent)},self.destroy=function(){}}}); \ No newline at end of file +define(["loading","events","libraryBrowser","imageLoader","listView","cardBuilder","apphost","emby-itemscontainer"],function(loading,events,libraryBrowser,imageLoader,listView,cardBuilder,appHost){"use strict";return function(view,params,tabContent){function getPageData(context){var key=getSavedQueryKey(context),pageData=data[key];return pageData||(pageData=data[key]={query:{SortBy:"SortName",SortOrder:"Ascending",IncludeItemTypes:"BoxSet",Recursive:!0,Fields:"PrimaryImageAspectRatio,SortName",ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",StartIndex:0,Limit:pageSize},view:libraryBrowser.getSavedView(key)||"Poster"},pageData.query.ParentId=params.topParentId,libraryBrowser.loadSavedQueryValues(key,pageData.query)),pageData}function getQuery(context){return getPageData(context).query}function getSavedQueryKey(context){return context.savedQueryKey||(context.savedQueryKey=libraryBrowser.getSavedQueryKey("moviecollections")),context.savedQueryKey}function onViewStyleChange(){var viewStyle=self.getCurrentViewStyle(),itemsContainer=tabContent.querySelector(".itemsContainer");"List"==viewStyle?(itemsContainer.classList.add("vertical-list"),itemsContainer.classList.remove("vertical-wrap")):(itemsContainer.classList.remove("vertical-list"),itemsContainer.classList.add("vertical-wrap")),itemsContainer.innerHTML=""}function reloadItems(page){loading.show();var query=getQuery(page);ApiClient.getItems(ApiClient.getCurrentUserId(),query).then(function(result){function onNextPageClick(){query.StartIndex+=query.Limit,reloadItems(tabContent)}function onPreviousPageClick(){query.StartIndex-=query.Limit,reloadItems(tabContent)}window.scrollTo(0,0);var html,pagingHtml=libraryBrowser.getQueryPagingHtml({startIndex:query.StartIndex,limit:query.Limit,totalRecordCount:result.TotalRecordCount,showLimit:!1,updatePageSizeSetting:!1,addLayoutButton:!1,sortButton:!1,filterButton:!1}),viewStyle=self.getCurrentViewStyle();html="Thumb"==viewStyle?cardBuilder.getCardsHtml({items:result.Items,shape:"backdrop",preferThumb:!0,context:"movies",overlayPlayButton:!0,centerText:!0,showTitle:!0}):"ThumbCard"==viewStyle?cardBuilder.getCardsHtml({items:result.Items,shape:"backdrop",preferThumb:!0,context:"movies",lazy:!0,cardLayout:!0,showTitle:!0,vibrant:!0}):"Banner"==viewStyle?cardBuilder.getCardsHtml({items:result.Items,shape:"banner",preferBanner:!0,context:"movies",lazy:!0}):"List"==viewStyle?listView.getListViewHtml({items:result.Items,context:"movies",sortBy:query.SortBy}):"PosterCard"==viewStyle?cardBuilder.getCardsHtml({items:result.Items,shape:"auto",context:"movies",showTitle:!0,centerText:!1,cardLayout:!0,vibrant:!0}):cardBuilder.getCardsHtml({items:result.Items,shape:"auto",context:"movies",centerText:!0,overlayPlayButton:!0,showTitle:!0});var i,length,elems=tabContent.querySelectorAll(".paging");for(i=0,length=elems.length;i'+Globalize.translate("MessageNoCollectionsAvailable")+"

    ");var itemsContainer=tabContent.querySelector(".itemsContainer");itemsContainer.innerHTML=html,imageLoader.lazyChildren(itemsContainer),libraryBrowser.saveQueryValues(getSavedQueryKey(page),query),loading.hide()})}var self=this,pageSize=libraryBrowser.getDefaultPageSize(),data={};self.getCurrentViewStyle=function(){return getPageData(tabContent).view},function(tabContent){tabContent.querySelector(".btnSort").addEventListener("click",function(e){libraryBrowser.showSortMenu({items:[{name:Globalize.translate("OptionNameSort"),id:"SortName"},{name:Globalize.translate("OptionImdbRating"),id:"CommunityRating,SortName"},{name:Globalize.translate("OptionDateAdded"),id:"DateCreated,SortName"},{name:Globalize.translate("OptionParentalRating"),id:"OfficialRating,SortName"},{name:Globalize.translate("OptionReleaseDate"),id:"PremiereDate,SortName"}],callback:function(){getQuery(tabContent).StartIndex=0,reloadItems(tabContent)},query:getQuery(tabContent),button:e.target})});var btnSelectView=tabContent.querySelector(".btnSelectView");btnSelectView.addEventListener("click",function(e){libraryBrowser.showLayoutMenu(e.target,self.getCurrentViewStyle(),"List,Poster,PosterCard,Thumb,ThumbCard".split(","))}),btnSelectView.addEventListener("layoutchange",function(e){var viewStyle=e.detail.viewStyle;getPageData(tabContent).view=viewStyle,libraryBrowser.saveViewSetting(getSavedQueryKey(tabContent),viewStyle),getQuery(tabContent).StartIndex=0,onViewStyleChange(),reloadItems(tabContent)}),tabContent.querySelector(".btnNewCollection").addEventListener("click",function(){require(["collectionEditor"],function(collectionEditor){var serverId=ApiClient.serverInfo().Id;(new collectionEditor).show({items:[],serverId:serverId})})})}(tabContent),onViewStyleChange(),self.renderTab=function(){reloadItems(tabContent)},self.destroy=function(){}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/movies.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/movies.js index 430fe5dc26..fb8e0897ee 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/movies.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/movies.js @@ -1 +1 @@ -define(["layoutManager","userSettings","events","libraryBrowser","alphaPicker","listView","cardBuilder","emby-itemscontainer"],function(layoutManager,userSettings,events,libraryBrowser,alphaPicker,listView,cardBuilder){"use strict";return function(view,params,tabContent,options){function onViewStyleChange(){var viewStyle=self.getCurrentViewStyle();"List"==viewStyle?(itemsContainer.classList.add("vertical-list"),itemsContainer.classList.remove("vertical-wrap")):(itemsContainer.classList.remove("vertical-list"),itemsContainer.classList.add("vertical-wrap")),itemsContainer.innerHTML=""}function updateFilterControls(){self.alphaPicker&&self.alphaPicker.value(query.NameStartsWithOrGreater)}function fetchData(){return ApiClient.getItems(ApiClient.getCurrentUserId(),query)}function afterRefresh(result){function onNextPageClick(){query.StartIndex+=query.Limit,itemsContainer.refreshItems()}function onPreviousPageClick(){query.StartIndex-=query.Limit,itemsContainer.refreshItems()}updateFilterControls();var i,length,pagingHtml=libraryBrowser.getQueryPagingHtml({startIndex:query.StartIndex,limit:query.Limit,totalRecordCount:result.TotalRecordCount,showLimit:!1,updatePageSizeSetting:!1,addLayoutButton:!1,sortButton:!1,filterButton:!1}),elems=tabContent.querySelectorAll(".paging");for(i=0,length=elems.length;i=1920?5:screenWidth>=1600?5:3,Recursive:!0,Fields:"PrimaryImageAspectRatio,MediaSourceCount,BasicSyncInfo",CollapseBoxSetItems:!1,ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};ApiClient.getItems(userId,options).then(function(result){result.Items.length?page.querySelector("#resumableSection").classList.remove("hide"):page.querySelector("#resumableSection").classList.add("hide");var allowBottomPadding=!enableScrollX(),container=page.querySelector("#resumableItems"),cardLayout=!1;cardBuilder.buildCards(result.Items,{itemsContainer:container,preferThumb:!0,shape:getThumbShape(),scalable:!0,overlayPlayButton:!0,allowBottomPadding:allowBottomPadding,cardLayout:cardLayout,showTitle:!0,showYear:!0,centerText:!cardLayout})})}function getRecommendationHtml(recommendation){var html="",title="";switch(recommendation.RecommendationType){case"SimilarToRecentlyPlayed":title=Globalize.translate("RecommendationBecauseYouWatched").replace("{0}",recommendation.BaselineItemName);break;case"SimilarToLikedItem":title=Globalize.translate("RecommendationBecauseYouLike").replace("{0}",recommendation.BaselineItemName);break;case"HasDirectorFromRecentlyPlayed":case"HasLikedDirector":title=Globalize.translate("RecommendationDirectedBy").replace("{0}",recommendation.BaselineItemName);break;case"HasActorFromRecentlyPlayed":case"HasLikedActor":title=Globalize.translate("RecommendationStarring").replace("{0}",recommendation.BaselineItemName)}html+='
    ',html+='

    '+title+"

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

    '+title+"

    ";var allowBottomPadding=!0;return enableScrollX()?(allowBottomPadding=!1,html+='
    '):html+='
    ',html+=cardBuilder.getCardsHtml(recommendation.Items,{shape:getPortraitShape(),scalable:!0,overlayPlayButton:!0,allowBottomPadding:allowBottomPadding}),html+="
    ",html+="
    "}function loadSuggestions(page,userId,parentId){var screenWidth=dom.getWindowSize().innerWidth,url=ApiClient.getUrl("Movies/Recommendations",{userId:userId,categoryLimit:6,ItemLimit:screenWidth>=1920?8:screenWidth>=1600?8:screenWidth>=1200?6:5,Fields:"PrimaryImageAspectRatio,MediaSourceCount,BasicSyncInfo",ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb"});ApiClient.getJSON(url).then(function(recommendations){if(!recommendations.length)return page.querySelector(".noItemsMessage").classList.remove("hide"),void(page.querySelector(".recommendations").innerHTML="");var html=recommendations.map(getRecommendationHtml).join("");page.querySelector(".noItemsMessage").classList.add("hide");var recs=page.querySelector(".recommendations");recs.innerHTML=html,imageLoader.lazyChildren(recs)})}function setScrollClasses(elem,scrollX){scrollX?(elem.classList.add("hiddenScrollX"),layoutManager.tv&&elem.classList.add("smoothScrollX"),elem.classList.add("scrollX"),elem.classList.remove("vertical-wrap")):(elem.classList.remove("hiddenScrollX"),elem.classList.remove("smoothScrollX"),elem.classList.remove("scrollX"),elem.classList.add("vertical-wrap"))}function initSuggestedTab(page,tabContent){for(var containers=tabContent.querySelectorAll(".itemsContainer"),i=0,length=containers.length;i'+Globalize.translate("MessageNoTrailersFound")+"

    ");var itemsContainer=tabContent.querySelector(".itemsContainer");itemsContainer.innerHTML=html,imageLoader.lazyChildren(itemsContainer),libraryBrowser.saveQueryValues(getSavedQueryKey(tabContent),query),loading.hide()})}function updateFilterControls(tabContent){var query=getQuery(tabContent);self.alphaPicker.value(query.NameStartsWithOrGreater)}function initPage(tabContent){var alphaPickerElement=tabContent.querySelector(".alphaPicker");if(alphaPickerElement.addEventListener("alphavaluechanged",function(e){var newValue=e.detail.value,query=getQuery(tabContent);query.NameStartsWithOrGreater=newValue,query.StartIndex=0,reloadItems()}),self.alphaPicker=new alphaPicker({element:alphaPickerElement,valueChangeEvent:"click"}),layoutManager.desktop||layoutManager.mobile){tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right");var itemsContainer=tabContent.querySelector(".itemsContainer");itemsContainer.classList.remove("padded-left-withalphapicker"),itemsContainer.classList.add("padded-right-withalphapicker")}tabContent.querySelector(".btnFilter").addEventListener("click",function(){self.showFilterMenu()}),tabContent.querySelector(".btnSort").addEventListener("click",function(e){libraryBrowser.showSortMenu({items:[{name:Globalize.translate("OptionNameSort"),id:"SortName"},{name:Globalize.translate("OptionImdbRating"),id:"CommunityRating,SortName"},{name:Globalize.translate("OptionDateAdded"),id:"DateCreated,SortName"},{name:Globalize.translate("OptionDatePlayed"),id:"DatePlayed,SortName"},{name:Globalize.translate("OptionParentalRating"),id:"OfficialRating,SortName"},{name:Globalize.translate("OptionPlayCount"),id:"PlayCount,SortName"},{name:Globalize.translate("OptionReleaseDate"),id:"PremiereDate,SortName"}],callback:function(){getQuery(tabContent).StartIndex=0,reloadItems()},query:getQuery(tabContent),button:e.target})})}var self=this,pageSize=libraryBrowser.getDefaultPageSize(),data={};self.showFilterMenu=function(){require(["components/filterdialog/filterdialog"],function(filterDialogFactory){var filterDialog=new filterDialogFactory({query:getQuery(tabContent),mode:"movies",serverId:ApiClient.serverId()});events.on(filterDialog,"filterchange",function(){getQuery(tabContent).StartIndex=0,reloadItems()}),filterDialog.show()})},self.getCurrentViewStyle=function(){return getPageData(tabContent).view},initPage(tabContent),self.renderTab=function(){reloadItems(),updateFilterControls(tabContent)},self.destroy=function(){}}}); \ No newline at end of file +define(["layoutManager","loading","events","libraryBrowser","imageLoader","alphaPicker","listView","cardBuilder","apphost","emby-itemscontainer"],function(layoutManager,loading,events,libraryBrowser,imageLoader,alphaPicker,listView,cardBuilder,appHost){"use strict";return function(view,params,tabContent){function getPageData(context){var key=getSavedQueryKey(context),pageData=data[key];return pageData||(pageData=data[key]={query:{SortBy:"SortName",SortOrder:"Ascending",IncludeItemTypes:"Trailer",Recursive:!0,Fields:"PrimaryImageAspectRatio,SortName,BasicSyncInfo",ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",StartIndex:0,Limit:pageSize},view:libraryBrowser.getSavedView(key)||"Poster"},libraryBrowser.loadSavedQueryValues(key,pageData.query)),pageData}function getQuery(context){return getPageData(context).query}function getSavedQueryKey(context){return context.savedQueryKey||(context.savedQueryKey=libraryBrowser.getSavedQueryKey("trailers")),context.savedQueryKey}function reloadItems(){loading.show();var query=getQuery(tabContent);ApiClient.getItems(ApiClient.getCurrentUserId(),query).then(function(result){function onNextPageClick(){query.StartIndex+=query.Limit,reloadItems()}function onPreviousPageClick(){query.StartIndex-=query.Limit,reloadItems()}window.scrollTo(0,0),updateFilterControls(tabContent);var html,pagingHtml=libraryBrowser.getQueryPagingHtml({startIndex:query.StartIndex,limit:query.Limit,totalRecordCount:result.TotalRecordCount,showLimit:!1,updatePageSizeSetting:!1,addLayoutButton:!1,sortButton:!1,filterButton:!1}),viewStyle=self.getCurrentViewStyle();html="Thumb"==viewStyle?cardBuilder.getCardsHtml({items:result.Items,shape:"backdrop",preferThumb:!0,context:"movies",overlayPlayButton:!0}):"ThumbCard"==viewStyle?cardBuilder.getCardsHtml({items:result.Items,shape:"backdrop",preferThumb:!0,context:"movies",cardLayout:!0,showTitle:!0,showYear:!0,vibrant:!0}):"Banner"==viewStyle?cardBuilder.getCardsHtml({items:result.Items,shape:"banner",preferBanner:!0,context:"movies"}):"List"==viewStyle?listView.getListViewHtml({items:result.Items,context:"movies",sortBy:query.SortBy}):"PosterCard"==viewStyle?cardBuilder.getCardsHtml({items:result.Items,shape:"portrait",context:"movies",showTitle:!0,showYear:!0,cardLayout:!0,vibrant:!0}):cardBuilder.getCardsHtml({items:result.Items,shape:"portrait",context:"movies",centerText:!0,overlayPlayButton:!0,showTitle:!0,showYear:!0});var i,length,elems=tabContent.querySelectorAll(".paging");for(i=0,length=elems.length;i'+Globalize.translate("MessageNoTrailersFound")+"

    ");var itemsContainer=tabContent.querySelector(".itemsContainer");itemsContainer.innerHTML=html,imageLoader.lazyChildren(itemsContainer),libraryBrowser.saveQueryValues(getSavedQueryKey(tabContent),query),loading.hide()})}function updateFilterControls(tabContent){var query=getQuery(tabContent);self.alphaPicker.value(query.NameStartsWithOrGreater)}var self=this,pageSize=libraryBrowser.getDefaultPageSize(),data={};self.showFilterMenu=function(){require(["components/filterdialog/filterdialog"],function(filterDialogFactory){var filterDialog=new filterDialogFactory({query:getQuery(tabContent),mode:"movies",serverId:ApiClient.serverId()});events.on(filterDialog,"filterchange",function(){getQuery(tabContent).StartIndex=0,reloadItems()}),filterDialog.show()})},self.getCurrentViewStyle=function(){return getPageData(tabContent).view},function(tabContent){var alphaPickerElement=tabContent.querySelector(".alphaPicker");if(alphaPickerElement.addEventListener("alphavaluechanged",function(e){var newValue=e.detail.value,query=getQuery(tabContent);query.NameStartsWithOrGreater=newValue,query.StartIndex=0,reloadItems()}),self.alphaPicker=new alphaPicker({element:alphaPickerElement,valueChangeEvent:"click"}),layoutManager.desktop||layoutManager.mobile){tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right");var itemsContainer=tabContent.querySelector(".itemsContainer");itemsContainer.classList.remove("padded-left-withalphapicker"),itemsContainer.classList.add("padded-right-withalphapicker")}tabContent.querySelector(".btnFilter").addEventListener("click",function(){self.showFilterMenu()}),tabContent.querySelector(".btnSort").addEventListener("click",function(e){libraryBrowser.showSortMenu({items:[{name:Globalize.translate("OptionNameSort"),id:"SortName"},{name:Globalize.translate("OptionImdbRating"),id:"CommunityRating,SortName"},{name:Globalize.translate("OptionDateAdded"),id:"DateCreated,SortName"},{name:Globalize.translate("OptionDatePlayed"),id:"DatePlayed,SortName"},{name:Globalize.translate("OptionParentalRating"),id:"OfficialRating,SortName"},{name:Globalize.translate("OptionPlayCount"),id:"PlayCount,SortName"},{name:Globalize.translate("OptionReleaseDate"),id:"PremiereDate,SortName"}],callback:function(){getQuery(tabContent).StartIndex=0,reloadItems()},query:getQuery(tabContent),button:e.target})})}(tabContent),self.renderTab=function(){reloadItems(),updateFilterControls(tabContent)},self.destroy=function(){}}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/musicalbums.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/musicalbums.js index b0fd6b8202..b1dbb22dc1 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/musicalbums.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/musicalbums.js @@ -1 +1 @@ -define(["layoutManager","playbackManager","loading","events","libraryBrowser","imageLoader","alphaPicker","listView","cardBuilder","apphost","emby-itemscontainer"],function(layoutManager,playbackManager,loading,events,libraryBrowser,imageLoader,alphaPicker,listView,cardBuilder,appHost){"use strict";return function(view,params,tabContent){function playAll(){ApiClient.getItem(ApiClient.getCurrentUserId(),params.topParentId).then(function(item){playbackManager.play({items:[item]})})}function shuffle(){ApiClient.getItem(ApiClient.getCurrentUserId(),params.topParentId).then(function(item){getQuery();playbackManager.shuffle(item,null)})}function getPageData(){var key=getSavedQueryKey();return pageData||(pageData={query:{SortBy:"SortName",SortOrder:"Ascending",IncludeItemTypes:"MusicAlbum",Recursive:!0,Fields:"PrimaryImageAspectRatio,SortName,BasicSyncInfo",ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",StartIndex:0,Limit:pageSize},view:libraryBrowser.getSavedView(key)||"Poster"},pageData.query.ParentId=params.topParentId,libraryBrowser.loadSavedQueryValues(key,pageData.query)),pageData}function getQuery(){return getPageData().query}function getSavedQueryKey(){return savedQueryKey||(savedQueryKey=libraryBrowser.getSavedQueryKey("musicalbums")),savedQueryKey}function onViewStyleChange(){var viewStyle=self.getCurrentViewStyle(),itemsContainer=tabContent.querySelector(".itemsContainer");"List"==viewStyle?(itemsContainer.classList.add("vertical-list"),itemsContainer.classList.remove("vertical-wrap")):(itemsContainer.classList.remove("vertical-list"),itemsContainer.classList.add("vertical-wrap")),itemsContainer.innerHTML=""}function reloadItems(page){loading.show();var query=getQuery();ApiClient.getItems(ApiClient.getCurrentUserId(),query).then(function(result){function onNextPageClick(){query.StartIndex+=query.Limit,reloadItems(tabContent)}function onPreviousPageClick(){query.StartIndex-=query.Limit,reloadItems(tabContent)}window.scrollTo(0,0),updateFilterControls(page);var html,pagingHtml=libraryBrowser.getQueryPagingHtml({startIndex:query.StartIndex,limit:query.Limit,totalRecordCount:result.TotalRecordCount,showLimit:!1,updatePageSizeSetting:!1,addLayoutButton:!1,sortButton:!1,filterButton:!1}),viewStyle=self.getCurrentViewStyle();html="List"==viewStyle?listView.getListViewHtml({items:result.Items,context:"music",sortBy:query.SortBy,addToListButton:!0}):"PosterCard"==viewStyle?cardBuilder.getCardsHtml({items:result.Items,shape:"square",context:"music",showTitle:!0,coverImage:!0,showParentTitle:!0,lazy:!0,cardLayout:!0}):cardBuilder.getCardsHtml({items:result.Items,shape:"square",context:"music",showTitle:!0,showParentTitle:!0,lazy:!0,centerText:!0,overlayPlayButton:!0});var i,length,elems=tabContent.querySelectorAll(".paging");for(i=0,length=elems.length;i=1920?9:screenWidth>=1200?12:screenWidth>=1e3?10:8}function enableScrollX(){return!layoutManager.desktop}function getSquareShape(){return enableScrollX()?"overflowSquare":"square"}function loadLatest(page,parentId){loading.show();var userId=ApiClient.getCurrentUserId(),options={IncludeItemTypes:"Audio",Limit:enableScrollX()?3*itemsPerRow():2*itemsPerRow(),Fields:"PrimaryImageAspectRatio,BasicSyncInfo",ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};ApiClient.getJSON(ApiClient.getUrl("Users/"+userId+"/Items/Latest",options)).then(function(items){var elem=page.querySelector("#recentlyAddedSongs"),supportsImageAnalysis=appHost.supports("imageanalysis");supportsImageAnalysis=!1,elem.innerHTML=cardBuilder.getCardsHtml({items:items,showUnplayedIndicator:!1,showLatestItemsPopup:!1,shape:getSquareShape(),showTitle:!0,showParentTitle:!0,lazy:!0,centerText:!supportsImageAnalysis,overlayPlayButton:!supportsImageAnalysis,allowBottomPadding:!enableScrollX(),cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis,coverImage:!0}),imageLoader.lazyChildren(elem),loading.hide()})}function loadRecentlyPlayed(page,parentId){var options={SortBy:"DatePlayed",SortOrder:"Descending",IncludeItemTypes:"Audio",Limit:itemsPerRow(),Recursive:!0,Fields:"PrimaryImageAspectRatio,AudioInfo",Filters:"IsPlayed",ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};ApiClient.getItems(ApiClient.getCurrentUserId(),options).then(function(result){var elem=page.querySelector("#recentlyPlayed");result.Items.length?elem.classList.remove("hide"):elem.classList.add("hide");var itemsContainer=elem.querySelector(".itemsContainer"),supportsImageAnalysis=appHost.supports("imageanalysis");supportsImageAnalysis=!1,itemsContainer.innerHTML=cardBuilder.getCardsHtml({items:result.Items,showUnplayedIndicator:!1,shape:getSquareShape(),showTitle:!0,showParentTitle:!0,action:"instantmix",lazy:!0,centerText:!supportsImageAnalysis,overlayMoreButton:!supportsImageAnalysis,allowBottomPadding:!enableScrollX(),cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis,coverImage:!0}),imageLoader.lazyChildren(itemsContainer)})}function loadFrequentlyPlayed(page,parentId){var options={SortBy:"PlayCount",SortOrder:"Descending",IncludeItemTypes:"Audio",Limit:itemsPerRow(),Recursive:!0,Fields:"PrimaryImageAspectRatio,AudioInfo",Filters:"IsPlayed",ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};ApiClient.getItems(ApiClient.getCurrentUserId(),options).then(function(result){var elem=page.querySelector("#topPlayed");result.Items.length?elem.classList.remove("hide"):elem.classList.add("hide");var itemsContainer=elem.querySelector(".itemsContainer"),supportsImageAnalysis=appHost.supports("imageanalysis");supportsImageAnalysis=!1,itemsContainer.innerHTML=cardBuilder.getCardsHtml({items:result.Items,showUnplayedIndicator:!1,shape:getSquareShape(),showTitle:!0,showParentTitle:!0,action:"instantmix",lazy:!0,centerText:!supportsImageAnalysis,overlayMoreButton:!supportsImageAnalysis,allowBottomPadding:!enableScrollX(),cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis,coverImage:!0}),imageLoader.lazyChildren(itemsContainer)})}function loadSuggestionsTab(page,tabContent,parentId){console.log("loadSuggestionsTab"),loadLatest(tabContent,parentId),loadRecentlyPlayed(tabContent,parentId),loadFrequentlyPlayed(tabContent,parentId),require(["components/favoriteitems"],function(favoriteItems){favoriteItems.render(tabContent,ApiClient.getCurrentUserId(),parentId,["favoriteArtists","favoriteAlbums","favoriteSongs"])})}function getTabs(){return[{name:Globalize.translate("TabSuggestions")},{name:Globalize.translate("TabAlbums")},{name:Globalize.translate("TabAlbumArtists")},{name:Globalize.translate("TabArtists")},{name:Globalize.translate("TabPlaylists")},{name:Globalize.translate("TabSongs")},{name:Globalize.translate("TabGenres")},{name:Globalize.translate("ButtonSearch"),cssClass:"searchTabButton"}]}function getDefaultTabIndex(folderId){switch(userSettings.get("landing-"+folderId)){case"albums":return 1;case"albumartists":return 2;case"artists":return 3;case"playlists":return 4;case"songs":return 5;case"genres":return 6;default:return 0}}return function(view,params){function reload(){loading.show();var tabContent=view.querySelector(".pageTabContent[data-index='0']");loadSuggestionsTab(view,tabContent,params.topParentId)}function enableScrollX(){return browserInfo.mobile}function setScrollClasses(elem,scrollX){scrollX?(elem.classList.add("hiddenScrollX"),layoutManager.tv&&elem.classList.add("smoothScrollX"),elem.classList.add("scrollX"),elem.classList.remove("vertical-wrap")):(elem.classList.remove("hiddenScrollX"),elem.classList.remove("smoothScrollX"),elem.classList.remove("scrollX"),elem.classList.add("vertical-wrap"))}function onBeforeTabChange(e){preLoadTab(view,parseInt(e.detail.selectedTabIndex))}function onTabChange(e){loadTab(view,parseInt(e.detail.selectedTabIndex))}function getTabContainers(){return view.querySelectorAll(".pageTabContent")}function initTabs(){mainTabsManager.setTabs(view,currentTabIndex,getTabs,getTabContainers,onBeforeTabChange,onTabChange)}function getTabController(page,index,callback){var depends=[];switch(index){case 0:break;case 1:depends.push("scripts/musicalbums");break;case 2:depends.push("scripts/musicartists");break;case 3:depends.push("scripts/musicartists");break;case 4:depends.push("scripts/musicplaylists");break;case 5:depends.push("scripts/songs");break;case 6:depends.push("scripts/musicgenres");break;case 7:depends.push("scripts/searchtab")}require(depends,function(controllerFactory){var tabContent;0==index&&(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),self.tabContent=tabContent);var controller=tabControllers[index];controller||(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),controller=0===index?self:7===index?new controllerFactory(view,tabContent,{collectionType:"music",parentId:params.topParentId}):new controllerFactory(view,params,tabContent),2==index?controller.mode="albumartists":3==index&&(controller.mode="artists"),tabControllers[index]=controller,controller.initTab&&controller.initTab()),callback(controller)})}function preLoadTab(page,index){getTabController(page,index,function(controller){renderedTabs.indexOf(index)==-1&&controller.preRender&&controller.preRender()})}function loadTab(page,index){currentTabIndex=index,getTabController(page,index,function(controller){initialTabIndex=null,renderedTabs.indexOf(index)==-1&&(renderedTabs.push(index),controller.renderTab())})}function onInputCommand(e){switch(e.detail.command){case"search":e.preventDefault(),Dashboard.navigate("search.html?collectionType=music&parentId="+params.topParentId)}}var isViewRestored,self=this,currentTabIndex=parseInt(params.tab||getDefaultTabIndex(params.topParentId)),initialTabIndex=currentTabIndex;self.initTab=function(){for(var tabContent=view.querySelector(".pageTabContent[data-index='0']"),containers=tabContent.querySelectorAll(".itemsContainer"),i=0,length=containers.length;i=1920?9:screenWidth>=1200?12:screenWidth>=1e3?10:8}function enableScrollX(){return!layoutManager.desktop}function getSquareShape(){return enableScrollX()?"overflowSquare":"square"}function loadLatest(page,parentId){loading.show();var userId=ApiClient.getCurrentUserId(),options={IncludeItemTypes:"Audio",Limit:enableScrollX()?3*itemsPerRow():2*itemsPerRow(),Fields:"PrimaryImageAspectRatio,BasicSyncInfo",ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};ApiClient.getJSON(ApiClient.getUrl("Users/"+userId+"/Items/Latest",options)).then(function(items){var elem=page.querySelector("#recentlyAddedSongs"),supportsImageAnalysis=appHost.supports("imageanalysis");supportsImageAnalysis=!1,elem.innerHTML=cardBuilder.getCardsHtml({items:items,showUnplayedIndicator:!1,showLatestItemsPopup:!1,shape:getSquareShape(),showTitle:!0,showParentTitle:!0,lazy:!0,centerText:!supportsImageAnalysis,overlayPlayButton:!supportsImageAnalysis,allowBottomPadding:!enableScrollX(),cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis,coverImage:!0}),imageLoader.lazyChildren(elem),loading.hide()})}function loadRecentlyPlayed(page,parentId){var options={SortBy:"DatePlayed",SortOrder:"Descending",IncludeItemTypes:"Audio",Limit:itemsPerRow(),Recursive:!0,Fields:"PrimaryImageAspectRatio,AudioInfo",Filters:"IsPlayed",ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};ApiClient.getItems(ApiClient.getCurrentUserId(),options).then(function(result){var elem=page.querySelector("#recentlyPlayed");result.Items.length?elem.classList.remove("hide"):elem.classList.add("hide");var itemsContainer=elem.querySelector(".itemsContainer"),supportsImageAnalysis=appHost.supports("imageanalysis");supportsImageAnalysis=!1,itemsContainer.innerHTML=cardBuilder.getCardsHtml({items:result.Items,showUnplayedIndicator:!1,shape:getSquareShape(),showTitle:!0,showParentTitle:!0,action:"instantmix",lazy:!0,centerText:!supportsImageAnalysis,overlayMoreButton:!supportsImageAnalysis,allowBottomPadding:!enableScrollX(),cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis,coverImage:!0}),imageLoader.lazyChildren(itemsContainer)})}function loadFrequentlyPlayed(page,parentId){var options={SortBy:"PlayCount",SortOrder:"Descending",IncludeItemTypes:"Audio",Limit:itemsPerRow(),Recursive:!0,Fields:"PrimaryImageAspectRatio,AudioInfo",Filters:"IsPlayed",ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};ApiClient.getItems(ApiClient.getCurrentUserId(),options).then(function(result){var elem=page.querySelector("#topPlayed");result.Items.length?elem.classList.remove("hide"):elem.classList.add("hide");var itemsContainer=elem.querySelector(".itemsContainer"),supportsImageAnalysis=appHost.supports("imageanalysis");supportsImageAnalysis=!1,itemsContainer.innerHTML=cardBuilder.getCardsHtml({items:result.Items,showUnplayedIndicator:!1,shape:getSquareShape(),showTitle:!0,showParentTitle:!0,action:"instantmix",lazy:!0,centerText:!supportsImageAnalysis,overlayMoreButton:!supportsImageAnalysis,allowBottomPadding:!enableScrollX(),cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis,coverImage:!0}),imageLoader.lazyChildren(itemsContainer)})}function loadSuggestionsTab(page,tabContent,parentId){console.log("loadSuggestionsTab"),loadLatest(tabContent,parentId),loadRecentlyPlayed(tabContent,parentId),loadFrequentlyPlayed(tabContent,parentId),require(["components/favoriteitems"],function(favoriteItems){favoriteItems.render(tabContent,ApiClient.getCurrentUserId(),parentId,["favoriteArtists","favoriteAlbums","favoriteSongs"])})}function getTabs(){return[{name:Globalize.translate("TabSuggestions")},{name:Globalize.translate("TabAlbums")},{name:Globalize.translate("TabAlbumArtists")},{name:Globalize.translate("TabArtists")},{name:Globalize.translate("TabPlaylists")},{name:Globalize.translate("TabSongs")},{name:Globalize.translate("TabGenres")},{name:Globalize.translate("ButtonSearch"),cssClass:"searchTabButton"}]}function getDefaultTabIndex(folderId){switch(userSettings.get("landing-"+folderId)){case"albums":return 1;case"albumartists":return 2;case"artists":return 3;case"playlists":return 4;case"songs":return 5;case"genres":return 6;default:return 0}}return function(view,params){function reload(){loading.show();var tabContent=view.querySelector(".pageTabContent[data-index='0']");loadSuggestionsTab(view,tabContent,params.topParentId)}function enableScrollX(){return browserInfo.mobile}function setScrollClasses(elem,scrollX){scrollX?(elem.classList.add("hiddenScrollX"),layoutManager.tv&&elem.classList.add("smoothScrollX"),elem.classList.add("scrollX"),elem.classList.remove("vertical-wrap")):(elem.classList.remove("hiddenScrollX"),elem.classList.remove("smoothScrollX"),elem.classList.remove("scrollX"),elem.classList.add("vertical-wrap"))}function onBeforeTabChange(e){preLoadTab(view,parseInt(e.detail.selectedTabIndex))}function onTabChange(e){loadTab(view,parseInt(e.detail.selectedTabIndex))}function getTabContainers(){return view.querySelectorAll(".pageTabContent")}function initTabs(){mainTabsManager.setTabs(view,currentTabIndex,getTabs,getTabContainers,onBeforeTabChange,onTabChange)}function getTabController(page,index,callback){var depends=[];switch(index){case 0:break;case 1:depends.push("scripts/musicalbums");break;case 2:case 3:depends.push("scripts/musicartists");break;case 4:depends.push("scripts/musicplaylists");break;case 5:depends.push("scripts/songs");break;case 6:depends.push("scripts/musicgenres");break;case 7:depends.push("scripts/searchtab")}require(depends,function(controllerFactory){var tabContent;0==index&&(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),self.tabContent=tabContent);var controller=tabControllers[index];controller||(tabContent=view.querySelector(".pageTabContent[data-index='"+index+"']"),controller=0===index?self:7===index?new controllerFactory(view,tabContent,{collectionType:"music",parentId:params.topParentId}):new controllerFactory(view,params,tabContent),2==index?controller.mode="albumartists":3==index&&(controller.mode="artists"),tabControllers[index]=controller,controller.initTab&&controller.initTab()),callback(controller)})}function preLoadTab(page,index){getTabController(page,index,function(controller){-1==renderedTabs.indexOf(index)&&controller.preRender&&controller.preRender()})}function loadTab(page,index){currentTabIndex=index,getTabController(page,index,function(controller){initialTabIndex=null,-1==renderedTabs.indexOf(index)&&(renderedTabs.push(index),controller.renderTab())})}function onInputCommand(e){switch(e.detail.command){case"search":e.preventDefault(),Dashboard.navigate("search.html?collectionType=music&parentId="+params.topParentId)}}var isViewRestored,self=this,currentTabIndex=parseInt(params.tab||getDefaultTabIndex(params.topParentId)),initialTabIndex=currentTabIndex;self.initTab=function(){for(var tabContent=view.querySelector(".pageTabContent[data-index='0']"),containers=tabContent.querySelectorAll(".itemsContainer"),i=0,length=containers.length;i";var showImageEditing=!1;"Guest"==user.ConnectLinkType?page.querySelector(".connectMessage").classList.remove("hide"):user.PrimaryImageTag?(showImageEditing=!0,page.querySelector(".connectMessage").classList.add("hide")):(showImageEditing=!0,page.querySelector(".connectMessage").classList.add("hide")),Dashboard.getCurrentUser().then(function(loggedInUser){showImageEditing&&appHost.supports("fileinput")&&(loggedInUser.Policy.IsAdministrator||user.Policy.EnableUserPreferenceAccess)?(page.querySelector(".newImageForm").classList.remove("hide"),user.PrimaryImageTag?page.querySelector("#btnDeleteImage").classList.remove("hide"):page.querySelector("#btnDeleteImage").classList.add("hide")):(page.querySelector(".newImageForm").classList.add("hide"),page.querySelector("#btnDeleteImage").classList.add("hide"))}),loading.hide()})}function onFileReaderError(evt){switch(loading.hide(),evt.target.error.code){case evt.target.error.NOT_FOUND_ERR:require(["toast"],function(toast){toast(Globalize.translate("FileNotFound"))});break;case evt.target.error.NOT_READABLE_ERR:require(["toast"],function(toast){toast(Globalize.translate("FileReadError"))});break;case evt.target.error.ABORT_ERR:break;default:require(["toast"],function(toast){toast(Globalize.translate("FileReadError"))})}}function onFileReaderAbort(evt){loading.hide(),require(["toast"],function(toast){toast(Globalize.translate("FileReadCancelled"))})}function setFiles(page,files){var file=files[0];if(!file||!file.type.match("image.*"))return page.querySelector("#userImageOutput").innerHTML="",page.querySelector("#fldUpload").classList.add("hide"),void(currentFile=null);currentFile=file;var reader=new FileReader;reader.onerror=onFileReaderError,reader.onloadstart=function(){page.querySelector("#fldUpload").classList.add("hide")},reader.onabort=onFileReaderAbort,reader.onload=function(e){var html=[''].join("");page.querySelector("#userImageOutput").innerHTML=html,page.querySelector("#fldUpload").classList.remove("hide")},reader.readAsDataURL(file)}function onImageDragOver(e){return e.preventDefault(),e.originalEvent.dataTransfer.dropEffect="Copy",!1}var currentFile;return function(view,params){reloadUser(view);var userImageDropZone=(new Userpasswordpage(view,params),view.querySelector("#userImageDropZone"));userImageDropZone.addEventListener("dragOver",onImageDragOver),view.querySelector("#btnDeleteImage").addEventListener("click",function(){require(["confirm"],function(confirm){confirm(Globalize.translate("DeleteImageConfirmation"),Globalize.translate("DeleteImage")).then(function(){loading.show();var userId=getParameterByName("userId");ApiClient.deleteUserImage(userId,"primary").then(function(){loading.hide(),reloadUser(view)})})})}),view.querySelector(".btnBrowse").addEventListener("click",function(){view.querySelector("#uploadUserImage").click()}),view.querySelector(".newImageForm").addEventListener("submit",function(e){var file=currentFile;if(!file)return!1;if("image/png"!=file.type&&"image/jpeg"!=file.type&&"image/jpeg"!=file.type)return!1;loading.show();var userId=getParameterByName("userId");return ApiClient.uploadUserImage(userId,"Primary",file).then(function(){loading.hide(),reloadUser(view)}),e.preventDefault(),!1}),view.querySelector("#uploadUserImage").addEventListener("change",function(e){setFiles(view,e.target.files)})}}); \ No newline at end of file +define(["scripts/userpasswordpage","loading","libraryMenu","apphost","emby-linkbutton"],function(Userpasswordpage,loading,libraryMenu,appHost){"use strict";function reloadUser(page){var userId=getParameterByName("userId");loading.show(),ApiClient.getUser(userId).then(function(user){page.querySelector(".username").innerHTML=user.Name;var uploadUserImage=page.querySelector("#uploadUserImage");uploadUserImage.value="",uploadUserImage.dispatchEvent(new CustomEvent("change",{})),libraryMenu.setTitle(user.Name);var imageUrl,fldImage=page.querySelector("#fldImage");imageUrl=user.PrimaryImageTag?ApiClient.getUserImageUrl(user.Id,{height:200,tag:user.PrimaryImageTag,type:"Primary"}):"css/images/logindefault.png",fldImage.classList.remove("hide"),fldImage.innerHTML="";var showImageEditing=!1;"Guest"==user.ConnectLinkType?page.querySelector(".connectMessage").classList.remove("hide"):(user.PrimaryImageTag,showImageEditing=!0,page.querySelector(".connectMessage").classList.add("hide")),Dashboard.getCurrentUser().then(function(loggedInUser){showImageEditing&&appHost.supports("fileinput")&&(loggedInUser.Policy.IsAdministrator||user.Policy.EnableUserPreferenceAccess)?(page.querySelector(".newImageForm").classList.remove("hide"),user.PrimaryImageTag?page.querySelector("#btnDeleteImage").classList.remove("hide"):page.querySelector("#btnDeleteImage").classList.add("hide")):(page.querySelector(".newImageForm").classList.add("hide"),page.querySelector("#btnDeleteImage").classList.add("hide"))}),loading.hide()})}function onFileReaderError(evt){switch(loading.hide(),evt.target.error.code){case evt.target.error.NOT_FOUND_ERR:require(["toast"],function(toast){toast(Globalize.translate("FileNotFound"))});break;case evt.target.error.NOT_READABLE_ERR:require(["toast"],function(toast){toast(Globalize.translate("FileReadError"))});break;case evt.target.error.ABORT_ERR:break;default:require(["toast"],function(toast){toast(Globalize.translate("FileReadError"))})}}function onFileReaderAbort(evt){loading.hide(),require(["toast"],function(toast){toast(Globalize.translate("FileReadCancelled"))})}function setFiles(page,files){var file=files[0];if(!file||!file.type.match("image.*"))return page.querySelector("#userImageOutput").innerHTML="",page.querySelector("#fldUpload").classList.add("hide"),void(currentFile=null);currentFile=file;var reader=new FileReader;reader.onerror=onFileReaderError,reader.onloadstart=function(){page.querySelector("#fldUpload").classList.add("hide")},reader.onabort=onFileReaderAbort,reader.onload=function(e){var html=[''].join("");page.querySelector("#userImageOutput").innerHTML=html,page.querySelector("#fldUpload").classList.remove("hide")},reader.readAsDataURL(file)}function onImageDragOver(e){return e.preventDefault(),e.originalEvent.dataTransfer.dropEffect="Copy",!1}var currentFile;return function(view,params){reloadUser(view);new Userpasswordpage(view,params);view.querySelector("#userImageDropZone").addEventListener("dragOver",onImageDragOver),view.querySelector("#btnDeleteImage").addEventListener("click",function(){require(["confirm"],function(confirm){confirm(Globalize.translate("DeleteImageConfirmation"),Globalize.translate("DeleteImage")).then(function(){loading.show();var userId=getParameterByName("userId");ApiClient.deleteUserImage(userId,"primary").then(function(){loading.hide(),reloadUser(view)})})})}),view.querySelector(".btnBrowse").addEventListener("click",function(){view.querySelector("#uploadUserImage").click()}),view.querySelector(".newImageForm").addEventListener("submit",function(e){var file=currentFile;if(!file)return!1;if("image/png"!=file.type&&"image/jpeg"!=file.type&&"image/jpeg"!=file.type)return!1;loading.show();var userId=getParameterByName("userId");return ApiClient.uploadUserImage(userId,"Primary",file).then(function(){loading.hide(),reloadUser(view)}),e.preventDefault(),!1}),view.querySelector("#uploadUserImage").addEventListener("change",function(e){setFiles(view,e.target.files)})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/notificationindicator.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/notificationindicator.js index 0f91f54181..79825d7cf9 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/notificationindicator.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/notificationindicator.js @@ -1 +1 @@ -define(["libraryBrowser","events","serverNotifications","connectionManager","globalize","listViewStyle"],function(libraryBrowser,events,serverNotifications,connectionManager,globalize){"use strict";function updateNotificationCount(apiClient){var userId=apiClient.getCurrentUserId();userId&&apiClient.getNotificationSummary(userId).then(function(summary){var btnNotificationsInner=document.querySelector(".btnNotificationsInner");btnNotificationsInner&&(btnNotificationsInner.classList.remove("levelNormal"),btnNotificationsInner.classList.remove("levelWarning"),btnNotificationsInner.classList.remove("levelError"),btnNotificationsInner.innerHTML=summary.UnreadCount,summary.UnreadCount?(btnNotificationsInner.classList.add("level"+summary.MaxUnreadNotificationLevel),btnNotificationsInner.classList.remove("hide")):btnNotificationsInner.classList.add("hide"))},function(){})}function notifications(){var self=this;self.total=0,self.markNotificationsRead=function(ids,callback){ApiClient.markNotificationsRead(ApiClient.getCurrentUserId(),ids,!0).then(function(){updateNotificationCount(ApiClient),callback&&callback()})},self.showNotificationsList=function(startIndex,limit,elem){refreshNotifications(startIndex,limit,elem,!0)}}function refreshNotifications(startIndex,limit,elem,showPaging){var apiClient=window.ApiClient;if(apiClient)return apiClient.getNotifications(apiClient.getCurrentUserId(),{StartIndex:startIndex,Limit:limit}).then(function(result){listUnreadNotifications(result.Notifications,result.TotalRecordCount,startIndex,limit,elem,showPaging)})}function listUnreadNotifications(list,totalRecordCount,startIndex,limit,elem,showPaging){if(!totalRecordCount)return void(elem.innerHTML='

    '+globalize.translate("LabelNoUnreadNotifications")+"

    ");Notifications.total=totalRecordCount;var html="";if(totalRecordCount>limit&&showPaging===!0){var query={StartIndex:startIndex,Limit:limit};html+=libraryBrowser.getQueryPagingHtml({startIndex:query.StartIndex,limit:query.Limit,totalRecordCount:totalRecordCount,showLimit:!1,updatePageSizeSetting:!1})}require(["humanedate"],function(){for(var i=0,length=list.length;i'),itemHtml+='
    ',itemHtml+="Error"==notification.Level?'error':'dvr',itemHtml+='
    ',itemHtml+='

    ',itemHtml+=notification.Name,itemHtml+="

    ",itemHtml+='
    ',itemHtml+=humane_date(notification.Date),itemHtml+="
    ",notification.Description&&(itemHtml+='
    ',itemHtml+=notification.Description,itemHtml+="
    "),itemHtml+="
    ",itemHtml+="
    ",notification.Url&&(itemHtml+=""),itemHtml}function onServerNotificationEvent(e,apiClient){updateNotificationCount(apiClient)}window.Notifications=new notifications,events.on(connectionManager,"localusersignedin",function(e,user){var apiClient=connectionManager.getApiClient(user.ServerId);updateNotificationCount(apiClient)}),events.on(serverNotifications,"NotificationUpdated",onServerNotificationEvent),events.on(serverNotifications,"NotificationAdded",onServerNotificationEvent),events.on(serverNotifications,"NotificationsMarkedRead",onServerNotificationEvent),connectionManager.currentApiClient()&&updateNotificationCount(connectionManager.currentApiClient())}); \ No newline at end of file +define(["libraryBrowser","events","serverNotifications","connectionManager","globalize","listViewStyle"],function(libraryBrowser,events,serverNotifications,connectionManager,globalize){"use strict";function updateNotificationCount(apiClient){var userId=apiClient.getCurrentUserId();userId&&apiClient.getNotificationSummary(userId).then(function(summary){var btnNotificationsInner=document.querySelector(".btnNotificationsInner");btnNotificationsInner&&(btnNotificationsInner.classList.remove("levelNormal"),btnNotificationsInner.classList.remove("levelWarning"),btnNotificationsInner.classList.remove("levelError"),btnNotificationsInner.innerHTML=summary.UnreadCount,summary.UnreadCount?(btnNotificationsInner.classList.add("level"+summary.MaxUnreadNotificationLevel),btnNotificationsInner.classList.remove("hide")):btnNotificationsInner.classList.add("hide"))},function(){})}function notifications(){var self=this;self.total=0,self.markNotificationsRead=function(ids,callback){ApiClient.markNotificationsRead(ApiClient.getCurrentUserId(),ids,!0).then(function(){updateNotificationCount(ApiClient),callback&&callback()})},self.showNotificationsList=function(startIndex,limit,elem){refreshNotifications(startIndex,limit,elem,!0)}}function refreshNotifications(startIndex,limit,elem,showPaging){var apiClient=window.ApiClient;if(apiClient)return apiClient.getNotifications(apiClient.getCurrentUserId(),{StartIndex:startIndex,Limit:limit}).then(function(result){listUnreadNotifications(result.Notifications,result.TotalRecordCount,startIndex,limit,elem,showPaging)})}function listUnreadNotifications(list,totalRecordCount,startIndex,limit,elem,showPaging){if(!totalRecordCount)return void(elem.innerHTML='

    '+globalize.translate("LabelNoUnreadNotifications")+"

    ");Notifications.total=totalRecordCount;var html="";if(totalRecordCount>limit&&!0===showPaging){var query={StartIndex:startIndex,Limit:limit};html+=libraryBrowser.getQueryPagingHtml({startIndex:query.StartIndex,limit:query.Limit,totalRecordCount:totalRecordCount,showLimit:!1,updatePageSizeSetting:!1})}require(["humanedate"],function(){for(var i=0,length=list.length;i'),itemHtml+='
    ',"Error"==notification.Level?itemHtml+='error':itemHtml+='dvr',itemHtml+='
    ',itemHtml+='

    ',itemHtml+=notification.Name,itemHtml+="

    ",itemHtml+='
    ',itemHtml+=humane_date(notification.Date),itemHtml+="
    ",notification.Description&&(itemHtml+='
    ',itemHtml+=notification.Description,itemHtml+="
    "),itemHtml+="
    ",itemHtml+="
    ",notification.Url&&(itemHtml+=""),itemHtml}function onServerNotificationEvent(e,apiClient){updateNotificationCount(apiClient)}window.Notifications=new notifications,events.on(connectionManager,"localusersignedin",function(e,user){updateNotificationCount(connectionManager.getApiClient(user.ServerId))}),events.on(serverNotifications,"NotificationUpdated",onServerNotificationEvent),events.on(serverNotifications,"NotificationAdded",onServerNotificationEvent),events.on(serverNotifications,"NotificationsMarkedRead",onServerNotificationEvent),connectionManager.currentApiClient()&&updateNotificationCount(connectionManager.currentApiClient())}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/notifications.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/notifications.js index 32bfe8147f..78233ea816 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/notifications.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/notifications.js @@ -1 +1 @@ -define(["dom"],function(dom){"use strict";function onListClick(e){var elem=dom.parentWithClass(e.target,"notificationsList"),btnPreviousPage=dom.parentWithClass(e.target,"btnPreviousPage");btnPreviousPage&&(e.preventDefault(),startIndex-=limit,startIndex<0&&(startIndex=0),Notifications.showNotificationsList(startIndex,limit,elem));var btnNextPage=dom.parentWithClass(e.target,"btnNextPage");btnNextPage&&(e.preventDefault(),startIndex+=limit,Notifications.showNotificationsList(startIndex,limit,elem))}var startIndex=0,limit=10;return function(view,params){view.addEventListener("viewshow",function(){startIndex=0;var elem=view.querySelector(".notificationsList");Notifications.showNotificationsList(startIndex,limit,elem),elem.addEventListener("click",onListClick),Notifications.markNotificationsRead([])})}}); \ No newline at end of file +define(["dom"],function(dom){"use strict";function onListClick(e){var elem=dom.parentWithClass(e.target,"notificationsList");dom.parentWithClass(e.target,"btnPreviousPage")&&(e.preventDefault(),startIndex-=limit,startIndex<0&&(startIndex=0),Notifications.showNotificationsList(startIndex,limit,elem)),dom.parentWithClass(e.target,"btnNextPage")&&(e.preventDefault(),startIndex+=limit,Notifications.showNotificationsList(startIndex,limit,elem))}var startIndex=0,limit=10;return function(view,params){view.addEventListener("viewshow",function(){startIndex=0;var elem=view.querySelector(".notificationsList");Notifications.showNotificationsList(startIndex,limit,elem),elem.addEventListener("click",onListClick),Notifications.markNotificationsRead([])})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/notificationsetting.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/notificationsetting.js index 8dbc8d5e87..74a6a36ca8 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/notificationsetting.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/notificationsetting.js @@ -1 +1 @@ -define(["jQuery","emby-checkbox","fnchecked"],function($){"use strict";function fillItems(elem,items,cssClass,idPrefix,currentList,isEnabledList){var html='
    ';html+=items.map(function(u){var isChecked=isEnabledList?currentList.indexOf(u.Id)!=-1:currentList.indexOf(u.Id)==-1,checkedHtml=isChecked?' checked="checked"':"";return'"}).join(""),html+="
    ",elem.html(html).trigger("create")}function reload(page){var type=getParameterByName("type"),promise1=ApiClient.getUsers(),promise2=ApiClient.getNamedConfiguration(notificationsConfigurationKey),promise3=ApiClient.getJSON(ApiClient.getUrl("Notifications/Types")),promise4=ApiClient.getJSON(ApiClient.getUrl("Notifications/Services"));Promise.all([promise1,promise2,promise3,promise4]).then(function(responses){var users=responses[0],notificationOptions=responses[1],types=responses[2],services=responses[3],notificationConfig=notificationOptions.Options.filter(function(n){return n.Type==type})[0],typeInfo=types.filter(function(n){return n.Type==type})[0]||{};typeInfo.IsBasedOnUserEvent?$(".monitorUsers",page).show():$(".monitorUsers",page).hide(),typeInfo.Variables.length?($(".tokenHelp",page).show(),$(".tokenList",page).html(typeInfo.Variables.map(function(v){return"{"+v+"}"}).join(", "))):$(".tokenHelp",page).hide(),$(".notificationType",page).html(typeInfo.Name||"Unknown Notification"),notificationConfig||(notificationConfig={DisabledMonitorUsers:[],SendToUsers:[],DisabledServices:[],SendToUserMode:"Admins"}),fillItems($(".monitorUsersList",page),users,"chkMonitor","chkMonitor",notificationConfig.DisabledMonitorUsers),fillItems($(".sendToUsersList",page),users,"chkSendTo","chkSendTo",notificationConfig.SendToUsers,!0),fillItems($(".servicesList",page),services,"chkService","chkService",notificationConfig.DisabledServices),$("#chkEnabled",page).checked(notificationConfig.Enabled||!1),$("#txtTitle",page).val(notificationConfig.Title||typeInfo.DefaultTitle),$("#selectUsers",page).val(notificationConfig.SendToUserMode).trigger("change")})}function save(page){var type=getParameterByName("type"),promise1=ApiClient.getNamedConfiguration(notificationsConfigurationKey),promise2=ApiClient.getJSON(ApiClient.getUrl("Notifications/Types"));Promise.all([promise1,promise2]).then(function(responses){var notificationOptions=responses[0],types=responses[1],notificationConfig=notificationOptions.Options.filter(function(n){return n.Type==type})[0];notificationConfig||(notificationConfig={Type:type},notificationOptions.Options.push(notificationConfig));var typeInfo=types.filter(function(n){return n.Type==type})[0]||{};notificationConfig.Enabled=$("#chkEnabled",page).checked(),notificationConfig.Title=$("#txtTitle",page).val(),notificationConfig.SendToUserMode=$("#selectUsers",page).val(),notificationConfig.Title==typeInfo.DefaultTitle&&(notificationConfig.Title=null),notificationConfig.DisabledMonitorUsers=$(".chkMonitor",page).get().filter(function(c){return!c.checked}).map(function(c){return c.getAttribute("data-itemid")}),notificationConfig.SendToUsers=$(".chkSendTo",page).get().filter(function(c){return c.checked}).map(function(c){return c.getAttribute("data-itemid")}),notificationConfig.DisabledServices=$(".chkService",page).get().filter(function(c){return!c.checked}).map(function(c){return c.getAttribute("data-itemid")}),ApiClient.updateNamedConfiguration(notificationsConfigurationKey,notificationOptions).then(function(r){Dashboard.processServerConfigurationUpdateResult(),Dashboard.navigate("notificationsettings.html")})})}function onSubmit(){var page=$(this).parents(".page");return save(page),!1}var notificationsConfigurationKey="notifications";$(document).on("pageinit","#notificationSettingPage",function(){var page=this;$("#selectUsers",page).on("change",function(){"Custom"==this.value?$(".selectCustomUsers",page).show():$(".selectCustomUsers",page).hide()}),$(".notificationSettingForm").off("submit",onSubmit).on("submit",onSubmit)}).on("pageshow","#notificationSettingPage",function(){var page=this;reload(page)})}); \ No newline at end of file +define(["jQuery","emby-checkbox","fnchecked"],function($){"use strict";function fillItems(elem,items,cssClass,idPrefix,currentList,isEnabledList){var html='
    ';html+=items.map(function(u){var isChecked=isEnabledList?-1!=currentList.indexOf(u.Id):-1==currentList.indexOf(u.Id),checkedHtml=isChecked?' checked="checked"':"";return'"}).join(""),html+="
    ",elem.html(html).trigger("create")}function reload(page){var type=getParameterByName("type"),promise1=ApiClient.getUsers(),promise2=ApiClient.getNamedConfiguration(notificationsConfigurationKey),promise3=ApiClient.getJSON(ApiClient.getUrl("Notifications/Types")),promise4=ApiClient.getJSON(ApiClient.getUrl("Notifications/Services"));Promise.all([promise1,promise2,promise3,promise4]).then(function(responses){var users=responses[0],notificationOptions=responses[1],types=responses[2],services=responses[3],notificationConfig=notificationOptions.Options.filter(function(n){return n.Type==type})[0],typeInfo=types.filter(function(n){return n.Type==type})[0]||{};typeInfo.IsBasedOnUserEvent?$(".monitorUsers",page).show():$(".monitorUsers",page).hide(),typeInfo.Variables.length?($(".tokenHelp",page).show(),$(".tokenList",page).html(typeInfo.Variables.map(function(v){return"{"+v+"}"}).join(", "))):$(".tokenHelp",page).hide(),$(".notificationType",page).html(typeInfo.Name||"Unknown Notification"),notificationConfig||(notificationConfig={DisabledMonitorUsers:[],SendToUsers:[],DisabledServices:[],SendToUserMode:"Admins"}),fillItems($(".monitorUsersList",page),users,"chkMonitor","chkMonitor",notificationConfig.DisabledMonitorUsers),fillItems($(".sendToUsersList",page),users,"chkSendTo","chkSendTo",notificationConfig.SendToUsers,!0),fillItems($(".servicesList",page),services,"chkService","chkService",notificationConfig.DisabledServices),$("#chkEnabled",page).checked(notificationConfig.Enabled||!1),$("#txtTitle",page).val(notificationConfig.Title||typeInfo.DefaultTitle),$("#selectUsers",page).val(notificationConfig.SendToUserMode).trigger("change")})}function save(page){var type=getParameterByName("type"),promise1=ApiClient.getNamedConfiguration(notificationsConfigurationKey),promise2=ApiClient.getJSON(ApiClient.getUrl("Notifications/Types"));Promise.all([promise1,promise2]).then(function(responses){var notificationOptions=responses[0],types=responses[1],notificationConfig=notificationOptions.Options.filter(function(n){return n.Type==type})[0];notificationConfig||(notificationConfig={Type:type},notificationOptions.Options.push(notificationConfig));var typeInfo=types.filter(function(n){return n.Type==type})[0]||{};notificationConfig.Enabled=$("#chkEnabled",page).checked(),notificationConfig.Title=$("#txtTitle",page).val(),notificationConfig.SendToUserMode=$("#selectUsers",page).val(),notificationConfig.Title==typeInfo.DefaultTitle&&(notificationConfig.Title=null),notificationConfig.DisabledMonitorUsers=$(".chkMonitor",page).get().filter(function(c){return!c.checked}).map(function(c){return c.getAttribute("data-itemid")}),notificationConfig.SendToUsers=$(".chkSendTo",page).get().filter(function(c){return c.checked}).map(function(c){return c.getAttribute("data-itemid")}),notificationConfig.DisabledServices=$(".chkService",page).get().filter(function(c){return!c.checked}).map(function(c){return c.getAttribute("data-itemid")}),ApiClient.updateNamedConfiguration(notificationsConfigurationKey,notificationOptions).then(function(r){Dashboard.processServerConfigurationUpdateResult(),Dashboard.navigate("notificationsettings.html")})})}function onSubmit(){return save($(this).parents(".page")),!1}var notificationsConfigurationKey="notifications";$(document).on("pageinit","#notificationSettingPage",function(){var page=this;$("#selectUsers",page).on("change",function(){"Custom"==this.value?$(".selectCustomUsers",page).show():$(".selectCustomUsers",page).hide()}),$(".notificationSettingForm").off("submit",onSubmit).on("submit",onSubmit)}).on("pageshow","#notificationSettingPage",function(){reload(this)})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/notificationsettings.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/notificationsettings.js index fc7fd19713..b6a927818a 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/notificationsettings.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/notificationsettings.js @@ -1 +1 @@ -define(["loading","libraryMenu","listViewStyle","emby-linkbutton"],function(loading,libraryMenu){"use strict";function reload(page){loading.show(),ApiClient.getJSON(ApiClient.getUrl("Notifications/Types")).then(function(list){var html="",lastCategory="";html+=list.map(function(i){var itemHtml="";return i.Category!=lastCategory&&(lastCategory=i.Category,lastCategory&&(itemHtml+="
    "),itemHtml+="

    ",itemHtml+=i.Category,itemHtml+="

    ",itemHtml+='"),page.querySelector(".notificationList").innerHTML=html,loading.hide()})}function getTabs(){return[{href:"notificationsettings.html",name:Globalize.translate("TabNotifications")},{href:"appservices.html?context=notifications",name:Globalize.translate("TabServices")}]}return function(view,params){view.addEventListener("viewshow",function(){libraryMenu.setTabs("notifications",0,getTabs),reload(view)})}}); \ No newline at end of file +define(["loading","libraryMenu","listViewStyle","emby-linkbutton"],function(loading,libraryMenu){"use strict";function reload(page){loading.show(),ApiClient.getJSON(ApiClient.getUrl("Notifications/Types")).then(function(list){var html="",lastCategory="";html+=list.map(function(i){var itemHtml="";return i.Category!=lastCategory&&(lastCategory=i.Category,lastCategory&&(itemHtml+="
    "),itemHtml+="

    ",itemHtml+=i.Category,itemHtml+="

    ",itemHtml+='"),page.querySelector(".notificationList").innerHTML=html,loading.hide()})}function getTabs(){return[{href:"notificationsettings.html",name:Globalize.translate("TabNotifications")},{href:"appservices.html?context=notifications",name:Globalize.translate("TabServices")}]}return function(view,params){view.addEventListener("viewshow",function(){libraryMenu.setTabs("notifications",0,getTabs),reload(view)})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/plugincatalogpage.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/plugincatalogpage.js index ee5661211f..82821c303f 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/plugincatalogpage.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/plugincatalogpage.js @@ -1 +1 @@ -define(["jQuery","loading","libraryMenu","cardStyle","emby-linkbutton"],function($,loading,libraryMenu){"use strict";function reloadList(page){loading.show(),query.IsAppStoreSafe=!0;var promise1=ApiClient.getAvailablePlugins(query),promise2=ApiClient.getInstalledPlugins();Promise.all([promise1,promise2]).then(function(responses){populateList({catalogElement:$("#pluginTiles",page),noItemsElement:$("#noPlugins",page),availablePlugins:responses[0],installedPlugins:responses[1]})})}function populateList(options){populateListInternal(options)}function populateListInternal(options){var availablePlugins=options.availablePlugins,installedPlugins=options.installedPlugins,allPlugins=availablePlugins.filter(function(p){return p.category=p.category||"General",p.categoryDisplayName=Globalize.translate("PluginCategory"+p.category.replace(" ","")),(!options.categories||options.categories.indexOf(p.category)!=-1)&&((!options.targetSystem||p.targetSystem==options.targetSystem)&&"UserInstalled"==p.type)});availablePlugins=allPlugins.sort(function(a,b){var aName=a.category,bName=b.category;return aName>bName?1:bName>aName?-1:(aName=a.name,bName=b.name,aName>bName?1:bName>aName?-1:0)});var i,length,plugin,currentCategory,html="";if(!options.categories){currentCategory=Globalize.translate("HeaderTopPlugins"),html+='

    '+currentCategory+"

    ";var topPlugins=allPlugins.slice(0).sort(function(a,b){if(a.installs>b.installs)return-1;if(b.installs>a.installs)return 1;var aName=a.name,bName=b.name;return aName>bName?1:bName>aName?-1:0});html+='
    ';var limit=screen.availWidth>=1920?15:12;for(i=0,length=Math.min(topPlugins.length,limit);i",html+="
    ",html+="
    "}var hasOpenTag=!1;for(currentCategory=null,options.showCategory===!1&&(html+='
    ',hasOpenTag=!0),i=0,length=availablePlugins.length;i",html+="
    ",html+="
    "),html+='

    '+category+"

    ",html+='
    ',hasOpenTag=!0),currentCategory=category),html+=getPluginHtml(plugin,options,installedPlugins)}hasOpenTag&&(html+="
    "),!availablePlugins.length&&options.noItemsElement&&$(options.noItemsElement).hide(),$(options.catalogElement).html(html),loading.hide()}function getPluginHtml(plugin,options,installedPlugins){var html="",href=plugin.externalUrl?plugin.externalUrl:"addplugin.html?name="+encodeURIComponent(plugin.name)+"&guid="+plugin.guid;options.context&&(href+="&context="+options.context);var target=plugin.externalUrl?' target="_blank"':"";html+="
    ",html+='
    ',html+='",html+='
    ',html+="
    ",html+=plugin.name,html+="
    ";var installedPlugin=plugin.isApp?null:installedPlugins.filter(function(ip){return ip.Id==plugin.guid})[0];return html+="
    ",html+=installedPlugin?Globalize.translate("LabelVersionInstalled").replace("{0}",installedPlugin.Version):" ",html+="
    ",html+="
    ",html+="
    ",html+="
    "}function getTabs(){return[{href:"plugins.html",name:Globalize.translate("TabMyPlugins")},{href:"plugincatalog.html",name:Globalize.translate("TabCatalog")}]}var query={TargetSystems:"Server",IsAdult:!1};$(document).on("pageinit","#pluginCatalogPage",function(){var page=this;$("#selectSystem",page).on("change",function(){query.TargetSystems=this.value,reloadList(page)})}).on("pageshow","#pluginCatalogPage",function(){libraryMenu.setTabs("plugins",1,getTabs);var page=this;reloadList(page)}),window.PluginCatalog={renderCatalog:populateList}}); \ No newline at end of file +define(["jQuery","loading","libraryMenu","cardStyle","emby-linkbutton"],function($,loading,libraryMenu){"use strict";function reloadList(page){loading.show(),query.IsAppStoreSafe=!0;var promise1=ApiClient.getAvailablePlugins(query),promise2=ApiClient.getInstalledPlugins();Promise.all([promise1,promise2]).then(function(responses){populateList({catalogElement:$("#pluginTiles",page),noItemsElement:$("#noPlugins",page),availablePlugins:responses[0],installedPlugins:responses[1]})})}function populateList(options){populateListInternal(options)}function populateListInternal(options){var availablePlugins=options.availablePlugins,installedPlugins=options.installedPlugins,allPlugins=availablePlugins.filter(function(p){return p.category=p.category||"General",p.categoryDisplayName=Globalize.translate("PluginCategory"+p.category.replace(" ","")),(!options.categories||-1!=options.categories.indexOf(p.category))&&((!options.targetSystem||p.targetSystem==options.targetSystem)&&"UserInstalled"==p.type)});availablePlugins=allPlugins.sort(function(a,b){var aName=a.category,bName=b.category;return aName>bName?1:bName>aName?-1:(aName=a.name,bName=b.name,aName>bName?1:bName>aName?-1:0)});var i,length,plugin,currentCategory,html="";if(!options.categories){currentCategory=Globalize.translate("HeaderTopPlugins"),html+='

    '+currentCategory+"

    ";var topPlugins=allPlugins.slice(0).sort(function(a,b){if(a.installs>b.installs)return-1;if(b.installs>a.installs)return 1;var aName=a.name,bName=b.name;return aName>bName?1:bName>aName?-1:0});html+='
    ';var limit=screen.availWidth>=1920?15:12;for(i=0,length=Math.min(topPlugins.length,limit);i",html+="
    ",html+="
    "}var hasOpenTag=!1;for(currentCategory=null,!1===options.showCategory&&(html+='
    ',hasOpenTag=!0),i=0,length=availablePlugins.length;i",html+="
    ",html+="
    "),html+='

    '+category+"

    ",html+='
    ',hasOpenTag=!0),currentCategory=category),html+=getPluginHtml(plugin,options,installedPlugins)}hasOpenTag&&(html+="
    "),!availablePlugins.length&&options.noItemsElement&&$(options.noItemsElement).hide(),$(options.catalogElement).html(html),loading.hide()}function getPluginHtml(plugin,options,installedPlugins){var html="",href=plugin.externalUrl?plugin.externalUrl:"addplugin.html?name="+encodeURIComponent(plugin.name)+"&guid="+plugin.guid;options.context&&(href+="&context="+options.context);var target=plugin.externalUrl?' target="_blank"':"";html+="
    ",html+='
    ',html+='",html+='
    ',html+="
    ",html+=plugin.name,html+="
    ";var installedPlugin=plugin.isApp?null:installedPlugins.filter(function(ip){return ip.Id==plugin.guid})[0];return html+="
    ",html+=installedPlugin?Globalize.translate("LabelVersionInstalled").replace("{0}",installedPlugin.Version):" ",html+="
    ",html+="
    ",html+="
    ",html+="
    "}function getTabs(){return[{href:"plugins.html",name:Globalize.translate("TabMyPlugins")},{href:"plugincatalog.html",name:Globalize.translate("TabCatalog")}]}var query={TargetSystems:"Server",IsAdult:!1};$(document).on("pageinit","#pluginCatalogPage",function(){var page=this;$("#selectSystem",page).on("change",function(){query.TargetSystems=this.value,reloadList(page)})}).on("pageshow","#pluginCatalogPage",function(){libraryMenu.setTabs("plugins",1,getTabs),reloadList(this)}),window.PluginCatalog={renderCatalog:populateList}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/scheduledtaskpage.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/scheduledtaskpage.js index b385c2f40b..6c1eb51e31 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/scheduledtaskpage.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/scheduledtaskpage.js @@ -1 +1 @@ -define(["jQuery","loading","datetime","dom","globalize","jqmpopup","emby-input","emby-button","emby-select"],function($,loading,datetime,dom,globalize){"use strict";function fillTimeOfDay(select){for(var options=[],i=0;i<864e5;i+=9e5)options.push({name:ScheduledTaskPage.getDisplayTime(1e4*i),value:1e4*i});select.innerHTML=options.map(function(o){return'"}).join("")}Array.prototype.remove=function(from,to){var rest=this.slice((to||from)+1||this.length);return this.length=from<0?this.length+from:from,this.push.apply(this,rest)};var ScheduledTaskPage={refreshScheduledTask:function(view){loading.show();var id=getParameterByName("id");ApiClient.getScheduledTask(id).then(function(task){ScheduledTaskPage.loadScheduledTask(view,task)})},loadScheduledTask:function(view,task){$(".taskName",view).html(task.Name),$("#pTaskDescription",view).html(task.Description),require(["listViewStyle"],function(){ScheduledTaskPage.loadTaskTriggers(view,task)}),loading.hide()},loadTaskTriggers:function(context,task){var html="";html+='
    ';for(var i=0,length=task.Triggers.length;i',html+='schedule',html+=trigger.MaxRuntimeTicks?'
    ':'
    ',html+="
    "+ScheduledTaskPage.getTriggerFriendlyName(trigger)+"
    ",trigger.MaxRuntimeTicks){html+='
    ';var hours=trigger.MaxRuntimeTicks/36e9;html+=1==hours?globalize.translate("ValueTimeLimitSingleHour"):globalize.translate("ValueTimeLimitMultiHour",hours),html+="
    "}html+="
    ",html+='',html+="
    "}html+="
    ",context.querySelector(".taskTriggers").innerHTML=html},getTriggerFriendlyName:function(trigger){if("DailyTrigger"==trigger.Type)return"Daily at "+ScheduledTaskPage.getDisplayTime(trigger.TimeOfDayTicks);if("WeeklyTrigger"==trigger.Type)return trigger.DayOfWeek+"s at "+ScheduledTaskPage.getDisplayTime(trigger.TimeOfDayTicks);if("SystemEventTrigger"==trigger.Type&&"WakeFromSleep"==trigger.SystemEvent)return"On wake from sleep";if("IntervalTrigger"==trigger.Type){var hours=trigger.IntervalTicks/36e9;return.25==hours?"Every 15 minutes":.5==hours?"Every 30 minutes":.75==hours?"Every 45 minutes":1==hours?"Every hour":"Every "+hours+" hours"}return"StartupTrigger"==trigger.Type?"On application startup":trigger.Type},getDisplayTime:function(ticks){var ms=ticks/1e4,now=new Date;return now.setHours(0,0,0,0),now.setTime(now.getTime()+ms),datetime.getDisplayTime(now)},showAddTriggerPopup:function(view){$("#selectTriggerType",view).val("DailyTrigger"),view.querySelector("#selectTriggerType").dispatchEvent(new CustomEvent("change",{})),$("#popupAddTrigger",view).on("popupafteropen",function(){$("#addTriggerForm input:first",this).focus()}).popup("open").on("popupafterclose",function(){$("#addTriggerForm",view).off("submit"),$(this).off("popupafterclose")})},confirmDeleteTrigger:function(view,index){require(["confirm"],function(confirm){confirm(globalize.translate("MessageDeleteTaskTrigger"),globalize.translate("HeaderDeleteTaskTrigger")).then(function(){ScheduledTaskPage.deleteTrigger(view,index)})})},deleteTrigger:function(view,index){loading.show();var id=getParameterByName("id");ApiClient.getScheduledTask(id).then(function(task){task.Triggers.remove(index),ApiClient.updateScheduledTaskTriggers(task.Id,task.Triggers).then(function(){ScheduledTaskPage.refreshScheduledTask(view)})})},refreshTriggerFields:function(page,triggerType){"DailyTrigger"==triggerType?($("#fldTimeOfDay",page).show(),$("#fldDayOfWeek",page).hide(),$("#fldSelectSystemEvent",page).hide(),$("#fldSelectInterval",page).hide(),$("#selectTimeOfDay",page).attr("required","required")):"WeeklyTrigger"==triggerType?($("#fldTimeOfDay",page).show(),$("#fldDayOfWeek",page).show(),$("#fldSelectSystemEvent",page).hide(),$("#fldSelectInterval",page).hide(),$("#selectTimeOfDay",page).attr("required","required")):"SystemEventTrigger"==triggerType?($("#fldTimeOfDay",page).hide(),$("#fldDayOfWeek",page).hide(),$("#fldSelectSystemEvent",page).show(),$("#fldSelectInterval",page).hide(),$("#selectTimeOfDay",page).removeAttr("required")):"IntervalTrigger"==triggerType?($("#fldTimeOfDay",page).hide(),$("#fldDayOfWeek",page).hide(),$("#fldSelectSystemEvent",page).hide(),$("#fldSelectInterval",page).show(),$("#selectTimeOfDay",page).removeAttr("required")):"StartupTrigger"==triggerType&&($("#fldTimeOfDay",page).hide(),$("#fldDayOfWeek",page).hide(),$("#fldSelectSystemEvent",page).hide(),$("#fldSelectInterval",page).hide(),$("#selectTimeOfDay",page).removeAttr("required"))},getTriggerToAdd:function(page){var trigger={Type:$("#selectTriggerType",page).val()};"DailyTrigger"==trigger.Type?trigger.TimeOfDayTicks=$("#selectTimeOfDay",page).val():"WeeklyTrigger"==trigger.Type?(trigger.DayOfWeek=$("#selectDayOfWeek",page).val(),trigger.TimeOfDayTicks=$("#selectTimeOfDay",page).val()):"SystemEventTrigger"==trigger.Type?trigger.SystemEvent=$("#selectSystemEvent",page).val():"IntervalTrigger"==trigger.Type&&(trigger.IntervalTicks=$("#selectInterval",page).val());var timeLimit=$("#txtTimeLimit",page).val()||"0";return timeLimit=36e5*parseFloat(timeLimit),trigger.MaxRuntimeMs=timeLimit||null,trigger}};return function(view,params){function onSubmit(e){loading.show();var id=getParameterByName("id");ApiClient.getScheduledTask(id).then(function(task){task.Triggers.push(ScheduledTaskPage.getTriggerToAdd(view)),ApiClient.updateScheduledTaskTriggers(task.Id,task.Triggers).then(function(){$("#popupAddTrigger").popup("close"),ScheduledTaskPage.refreshScheduledTask(view)})}),e.preventDefault()}view.querySelector(".addTriggerForm").addEventListener("submit",onSubmit),fillTimeOfDay(view.querySelector("#selectTimeOfDay")),$(view.querySelector("#popupAddTrigger").parentNode).trigger("create"),view.querySelector(".selectTriggerType").addEventListener("change",function(){ScheduledTaskPage.refreshTriggerFields(view,this.value)}),view.querySelector(".btnAddTrigger").addEventListener("click",function(){ScheduledTaskPage.showAddTriggerPopup(view)}),view.addEventListener("click",function(e){var btnDeleteTrigger=dom.parentWithClass(e.target,"btnDeleteTrigger");btnDeleteTrigger&&ScheduledTaskPage.confirmDeleteTrigger(view,parseInt(btnDeleteTrigger.getAttribute("data-index")))}),view.addEventListener("viewshow",function(){ScheduledTaskPage.refreshScheduledTask(view)})}}); \ No newline at end of file +define(["jQuery","loading","datetime","dom","globalize","jqmpopup","emby-input","emby-button","emby-select"],function($,loading,datetime,dom,globalize){"use strict";function fillTimeOfDay(select){for(var options=[],i=0;i<864e5;i+=9e5)options.push({name:ScheduledTaskPage.getDisplayTime(1e4*i),value:1e4*i});select.innerHTML=options.map(function(o){return'"}).join("")}Array.prototype.remove=function(from,to){var rest=this.slice((to||from)+1||this.length);return this.length=from<0?this.length+from:from,this.push.apply(this,rest)};var ScheduledTaskPage={refreshScheduledTask:function(view){loading.show();var id=getParameterByName("id");ApiClient.getScheduledTask(id).then(function(task){ScheduledTaskPage.loadScheduledTask(view,task)})},loadScheduledTask:function(view,task){$(".taskName",view).html(task.Name),$("#pTaskDescription",view).html(task.Description),require(["listViewStyle"],function(){ScheduledTaskPage.loadTaskTriggers(view,task)}),loading.hide()},loadTaskTriggers:function(context,task){var html="";html+='
    ';for(var i=0,length=task.Triggers.length;i',html+='schedule',trigger.MaxRuntimeTicks?html+='
    ':html+='
    ',html+="
    "+ScheduledTaskPage.getTriggerFriendlyName(trigger)+"
    ",trigger.MaxRuntimeTicks){html+='
    ';var hours=trigger.MaxRuntimeTicks/36e9;html+=1==hours?globalize.translate("ValueTimeLimitSingleHour"):globalize.translate("ValueTimeLimitMultiHour",hours),html+="
    "}html+="
    ",html+='',html+="
    "}html+="
    ",context.querySelector(".taskTriggers").innerHTML=html},getTriggerFriendlyName:function(trigger){if("DailyTrigger"==trigger.Type)return"Daily at "+ScheduledTaskPage.getDisplayTime(trigger.TimeOfDayTicks);if("WeeklyTrigger"==trigger.Type)return trigger.DayOfWeek+"s at "+ScheduledTaskPage.getDisplayTime(trigger.TimeOfDayTicks);if("SystemEventTrigger"==trigger.Type&&"WakeFromSleep"==trigger.SystemEvent)return"On wake from sleep";if("IntervalTrigger"==trigger.Type){var hours=trigger.IntervalTicks/36e9;return.25==hours?"Every 15 minutes":.5==hours?"Every 30 minutes":.75==hours?"Every 45 minutes":1==hours?"Every hour":"Every "+hours+" hours"}return"StartupTrigger"==trigger.Type?"On application startup":trigger.Type},getDisplayTime:function(ticks){var ms=ticks/1e4,now=new Date;return now.setHours(0,0,0,0),now.setTime(now.getTime()+ms),datetime.getDisplayTime(now)},showAddTriggerPopup:function(view){$("#selectTriggerType",view).val("DailyTrigger"),view.querySelector("#selectTriggerType").dispatchEvent(new CustomEvent("change",{})),$("#popupAddTrigger",view).on("popupafteropen",function(){$("#addTriggerForm input:first",this).focus()}).popup("open").on("popupafterclose",function(){$("#addTriggerForm",view).off("submit"),$(this).off("popupafterclose")})},confirmDeleteTrigger:function(view,index){require(["confirm"],function(confirm){confirm(globalize.translate("MessageDeleteTaskTrigger"),globalize.translate("HeaderDeleteTaskTrigger")).then(function(){ScheduledTaskPage.deleteTrigger(view,index)})})},deleteTrigger:function(view,index){loading.show();var id=getParameterByName("id");ApiClient.getScheduledTask(id).then(function(task){task.Triggers.remove(index),ApiClient.updateScheduledTaskTriggers(task.Id,task.Triggers).then(function(){ScheduledTaskPage.refreshScheduledTask(view)})})},refreshTriggerFields:function(page,triggerType){"DailyTrigger"==triggerType?($("#fldTimeOfDay",page).show(),$("#fldDayOfWeek",page).hide(),$("#fldSelectSystemEvent",page).hide(),$("#fldSelectInterval",page).hide(),$("#selectTimeOfDay",page).attr("required","required")):"WeeklyTrigger"==triggerType?($("#fldTimeOfDay",page).show(),$("#fldDayOfWeek",page).show(),$("#fldSelectSystemEvent",page).hide(),$("#fldSelectInterval",page).hide(),$("#selectTimeOfDay",page).attr("required","required")):"SystemEventTrigger"==triggerType?($("#fldTimeOfDay",page).hide(),$("#fldDayOfWeek",page).hide(),$("#fldSelectSystemEvent",page).show(),$("#fldSelectInterval",page).hide(),$("#selectTimeOfDay",page).removeAttr("required")):"IntervalTrigger"==triggerType?($("#fldTimeOfDay",page).hide(),$("#fldDayOfWeek",page).hide(),$("#fldSelectSystemEvent",page).hide(),$("#fldSelectInterval",page).show(),$("#selectTimeOfDay",page).removeAttr("required")):"StartupTrigger"==triggerType&&($("#fldTimeOfDay",page).hide(),$("#fldDayOfWeek",page).hide(),$("#fldSelectSystemEvent",page).hide(),$("#fldSelectInterval",page).hide(),$("#selectTimeOfDay",page).removeAttr("required"))},getTriggerToAdd:function(page){var trigger={Type:$("#selectTriggerType",page).val()};"DailyTrigger"==trigger.Type?trigger.TimeOfDayTicks=$("#selectTimeOfDay",page).val():"WeeklyTrigger"==trigger.Type?(trigger.DayOfWeek=$("#selectDayOfWeek",page).val(),trigger.TimeOfDayTicks=$("#selectTimeOfDay",page).val()):"SystemEventTrigger"==trigger.Type?trigger.SystemEvent=$("#selectSystemEvent",page).val():"IntervalTrigger"==trigger.Type&&(trigger.IntervalTicks=$("#selectInterval",page).val());var timeLimit=$("#txtTimeLimit",page).val()||"0";return timeLimit=36e5*parseFloat(timeLimit),trigger.MaxRuntimeMs=timeLimit||null,trigger}};return function(view,params){function onSubmit(e){loading.show();var id=getParameterByName("id");ApiClient.getScheduledTask(id).then(function(task){task.Triggers.push(ScheduledTaskPage.getTriggerToAdd(view)),ApiClient.updateScheduledTaskTriggers(task.Id,task.Triggers).then(function(){$("#popupAddTrigger").popup("close"),ScheduledTaskPage.refreshScheduledTask(view)})}),e.preventDefault()}view.querySelector(".addTriggerForm").addEventListener("submit",onSubmit),fillTimeOfDay(view.querySelector("#selectTimeOfDay")),$(view.querySelector("#popupAddTrigger").parentNode).trigger("create"),view.querySelector(".selectTriggerType").addEventListener("change",function(){ScheduledTaskPage.refreshTriggerFields(view,this.value)}),view.querySelector(".btnAddTrigger").addEventListener("click",function(){ScheduledTaskPage.showAddTriggerPopup(view)}),view.addEventListener("click",function(e){var btnDeleteTrigger=dom.parentWithClass(e.target,"btnDeleteTrigger");btnDeleteTrigger&&ScheduledTaskPage.confirmDeleteTrigger(view,parseInt(btnDeleteTrigger.getAttribute("data-index")))}),view.addEventListener("viewshow",function(){ScheduledTaskPage.refreshScheduledTask(view)})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/scheduledtaskspage.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/scheduledtaskspage.js index cc4300c45c..77c756bee4 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/scheduledtaskspage.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/scheduledtaskspage.js @@ -1 +1 @@ -define(["jQuery","loading","events","globalize","serverNotifications","humanedate","listViewStyle","emby-linkbutton"],function($,loading,events,globalize,serverNotifications){"use strict";function reloadList(page){ApiClient.getScheduledTasks({isHidden:!1}).then(function(tasks){populateList(page,tasks),loading.hide()})}function populateList(page,tasks){tasks=tasks.sort(function(a,b){return a=a.Category+" "+a.Name,b=b.Category+" "+b.Name,a==b?0:a",html+="
    "),html+='
    ',html+="

    ",html+=currentCategory,html+="

    ",html+='
    '),html+='
    ',html+="",html+='schedule',html+="",html+='",html+="Idle"==task.State?'':"Running"==task.State?'':'',html+="
    "}tasks.length&&(html+="
    ",html+="
    ");var divScheduledTasks=page.querySelector(".divScheduledTasks");divScheduledTasks.innerHTML=html}function humane_elapsed(firstDateStr,secondDateStr){var dt1=new Date(firstDateStr),dt2=new Date(secondDateStr),seconds=(dt2.getTime()-dt1.getTime())/1e3,numdays=Math.floor(seconds%31536e3/86400),numhours=Math.floor(seconds%31536e3%86400/3600),numminutes=Math.floor(seconds%31536e3%86400%3600/60),numseconds=Math.round(seconds%31536e3%86400%3600%60),elapsedStr="";return elapsedStr+=1==numdays?numdays+" day ":"",elapsedStr+=numdays>1?numdays+" days ":"",elapsedStr+=1==numhours?numhours+" hour ":"",elapsedStr+=numhours>1?numhours+" hours ":"",elapsedStr+=1==numminutes?numminutes+" minute ":"",elapsedStr+=numminutes>1?numminutes+" minutes ":"",elapsedStr+=elapsedStr.length>0?"and ":"",elapsedStr+=1==numseconds?numseconds+" second":"",elapsedStr+=0==numseconds||numseconds>1?numseconds+" seconds":""}function getTaskProgressHtml(task){var html="";if("Idle"==task.State)task.LastExecutionResult&&(html+=globalize.translate("LabelScheduledTaskLastRan").replace("{0}",humane_date(task.LastExecutionResult.EndTimeUtc)).replace("{1}",humane_elapsed(task.LastExecutionResult.StartTimeUtc,task.LastExecutionResult.EndTimeUtc)),"Failed"==task.LastExecutionResult.Status?html+=" ("+globalize.translate("LabelFailed")+")":"Cancelled"==task.LastExecutionResult.Status?html+=" ("+globalize.translate("LabelCancelled")+")":"Aborted"==task.LastExecutionResult.Status&&(html+=" "+globalize.translate("LabelAbortedByServerShutdown")+""));else if("Running"==task.State){var progress=(task.CurrentProgressPercentage||0).toFixed(1);html+='
    ',html+='
    ',html+='
    ',html+="
    ",html+="
    ",html+=""+progress+"%",html+="
    "}else html+=""+globalize.translate("LabelStopping")+"";return html}function updateTaskButton(elem,state){"Idle"==state?(elem.classList.add("btnStartTask"),elem.classList.remove("btnStopTask"),elem.classList.remove("hide"),elem.querySelector("i").innerHTML="play_arrow",elem.title=globalize.translate("ButtonStart")):"Running"==state?(elem.classList.remove("btnStartTask"),elem.classList.add("btnStopTask"),elem.classList.remove("hide"),elem.querySelector("i").innerHTML="stop",elem.title=globalize.translate("ButtonStop")):(elem.classList.add("btnStartTask"),elem.classList.remove("btnStopTask"),elem.classList.add("hide"),elem.querySelector("i").innerHTML="play_arrow",elem.title=globalize.translate("ButtonStart"));var item=$(elem).parents(".listItem")[0];item.setAttribute("data-status",state)}return function(view,params){function updateTasks(tasks){for(var i=0,length=tasks.length;i",html+="
    "),html+='
    ',html+="

    ",html+=currentCategory,html+="

    ",html+='
    '),html+='
    ',html+="",html+='schedule',html+="",html+='","Idle"==task.State?html+='':"Running"==task.State?html+='':html+='',html+="
    "}tasks.length&&(html+="
    ",html+="
    "),page.querySelector(".divScheduledTasks").innerHTML=html}function humane_elapsed(firstDateStr,secondDateStr){var dt1=new Date(firstDateStr),dt2=new Date(secondDateStr),seconds=(dt2.getTime()-dt1.getTime())/1e3,numdays=Math.floor(seconds%31536e3/86400),numhours=Math.floor(seconds%31536e3%86400/3600),numminutes=Math.floor(seconds%31536e3%86400%3600/60),numseconds=Math.round(seconds%31536e3%86400%3600%60),elapsedStr="";return elapsedStr+=1==numdays?numdays+" day ":"",elapsedStr+=numdays>1?numdays+" days ":"",elapsedStr+=1==numhours?numhours+" hour ":"",elapsedStr+=numhours>1?numhours+" hours ":"",elapsedStr+=1==numminutes?numminutes+" minute ":"",elapsedStr+=numminutes>1?numminutes+" minutes ":"",elapsedStr+=elapsedStr.length>0?"and ":"",elapsedStr+=1==numseconds?numseconds+" second":"",elapsedStr+=0==numseconds||numseconds>1?numseconds+" seconds":""}function getTaskProgressHtml(task){var html="";if("Idle"==task.State)task.LastExecutionResult&&(html+=globalize.translate("LabelScheduledTaskLastRan").replace("{0}",humane_date(task.LastExecutionResult.EndTimeUtc)).replace("{1}",humane_elapsed(task.LastExecutionResult.StartTimeUtc,task.LastExecutionResult.EndTimeUtc)),"Failed"==task.LastExecutionResult.Status?html+=" ("+globalize.translate("LabelFailed")+")":"Cancelled"==task.LastExecutionResult.Status?html+=" ("+globalize.translate("LabelCancelled")+")":"Aborted"==task.LastExecutionResult.Status&&(html+=" "+globalize.translate("LabelAbortedByServerShutdown")+""));else if("Running"==task.State){var progress=(task.CurrentProgressPercentage||0).toFixed(1);html+='
    ',html+='
    ',html+='
    ',html+="
    ",html+="
    ",html+=""+progress+"%",html+="
    "}else html+=""+globalize.translate("LabelStopping")+"";return html}function updateTaskButton(elem,state){"Idle"==state?(elem.classList.add("btnStartTask"),elem.classList.remove("btnStopTask"),elem.classList.remove("hide"),elem.querySelector("i").innerHTML="play_arrow",elem.title=globalize.translate("ButtonStart")):"Running"==state?(elem.classList.remove("btnStartTask"),elem.classList.add("btnStopTask"),elem.classList.remove("hide"),elem.querySelector("i").innerHTML="stop",elem.title=globalize.translate("ButtonStop")):(elem.classList.add("btnStartTask"),elem.classList.remove("btnStopTask"),elem.classList.add("hide"),elem.querySelector("i").innerHTML="play_arrow",elem.title=globalize.translate("ButtonStart")),$(elem).parents(".listItem")[0].setAttribute("data-status",state)}return function(view,params){function updateTasks(tasks){for(var i=0,length=tasks.length;i'+item.icon+"":'
    ';var cardBoxCssClass="cardBox";layoutManager.tv&&(cardBoxCssClass+=" cardBox-focustransform");var tagName="button",innerOpening='
    ',innerClosing="
    ";return"<"+tagName+' raised class="card overflowSquareCard loginSquareCard scalableCard overflowSquareCard-scalable" style="display:inline-block;" data-id="'+item.id+'" data-url="'+(item.url||"")+'" data-cardtype="'+item.cardType+'">'+innerOpening+'
    '+cardImageContainer+'
    '+item.name+"
    "+innerClosing+""}).join(""),itemsContainer=view.querySelector(".servers");items.length||(html="

    "+globalize.translate("sharedcomponents#MessageNoServersAvailableToConnect")+"

    "),itemsContainer.innerHTML=html,loading.hide()}function updatePageStyle(view,params){"1"==params.showuser?(view.classList.add("libraryPage"),view.classList.remove("standalonePage"),view.classList.add("noSecondaryNavPage")):(view.classList.add("standalonePage"),view.classList.remove("libraryPage"),view.classList.remove("noSecondaryNavPage"))}function showGeneralError(){loading.hide(),alertText(globalize.translate("sharedcomponents#DefaultErrorMessage"))}function alertText(text){alertTextWithOptions({text:text})}function alertTextWithOptions(options){require(["alert"],function(alert){alert(options)})}function showServerConnectionFailure(){alertText(globalize.translate("MessageUnableToConnectToServer"),globalize.translate("HeaderConnectionFailure"))}return function(view,params){function connectToServer(server){loading.show(),connectionManager.connectToServer(server,{enableAutoLogin:appSettings.enableAutoLogin()}).then(function(result){loading.hide();var apiClient=result.ApiClient;switch(result.State){case"SignedIn":Dashboard.onServerChanged(apiClient.getCurrentUserId(),apiClient.accessToken(),apiClient),Dashboard.navigate("home.html");break;case"ServerSignIn":Dashboard.onServerChanged(null,null,apiClient),Dashboard.navigate("login.html?serverid="+result.Servers[0].Id);break;case"ServerUpdateNeeded":alertTextWithOptions({text:globalize.translate("core#ServerUpdateNeeded","https://emby.media"),html:globalize.translate("core#ServerUpdateNeeded",'https://emby.media')});break;default:showServerConnectionFailure()}})}function deleteServer(server){loading.show(),connectionManager.deleteServer(server.Id).then(function(){loading.hide(),loadServers()},function(){loading.hide(),loadServers()})}function acceptInvitation(id){loading.show(),connectionManager.acceptServer(id).then(function(){loading.hide(),loadServers(),loadInvitations()},showGeneralError)}function rejectInvitation(id){loading.show(),connectionManager.rejectServer(id).then(function(){loading.hide(),loadServers(),loadInvitations()},showGeneralError)}function showPendingInviteMenu(elem){var card=dom.parentWithClass(elem,"inviteItem"),invitationId=card.getAttribute("data-id"),menuItems=[];menuItems.push({name:globalize.translate("sharedcomponents#Accept"),id:"accept"}),menuItems.push({name:globalize.translate("sharedcomponents#Reject"),id:"reject"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:elem,callback:function(id){switch(id){case"accept":acceptInvitation(invitationId);break;case"reject":rejectInvitation(invitationId)}}})})}function getPendingInviteHtml(item){var cardImageContainer='',cardBoxCssClass="cardBox";layoutManager.tv&&(cardBoxCssClass+=" cardBox-focustransform");var tagName="button",innerOpening='
    ',innerClosing="
    ";return"<"+tagName+' raised class="card overflowSquareCard loginSquareCard scalableCard overflowSquareCard-scalable btnInviteMenu inviteItem" style="display:inline-block;" data-id="'+item.Id+'">'+innerOpening+'
    '+cardImageContainer+'
    '+item.Name+"
    "+innerClosing+""}function renderInvitations(list){list.length?view.querySelector(".invitationSection").classList.remove("hide"):view.querySelector(".invitationSection").classList.add("hide");var html=list.map(getPendingInviteHtml).join("");view.querySelector(".invitations").innerHTML=html}function loadInvitations(){connectionManager.isLoggedIntoConnect()?connectionManager.getUserInvitations().then(renderInvitations):renderInvitations([])}function onServerClick(server){var menuItems=[];menuItems.push({name:globalize.translate("sharedcomponents#Connect"),id:"connect"}),menuItems.push({name:globalize.translate("sharedcomponents#Delete"),id:"delete"});var apiClient=connectionManager.getApiClient(server.Id);apiClient&&apiClient.supportsWakeOnLan()&&menuItems.push({name:globalize.translate("sharedcomponents#WakeServer"),id:"wol"}),actionSheet.show({items:menuItems,title:server.Name}).then(function(id){switch(id){case"connect":connectToServer(server);break;case"delete":deleteServer(server);break;case"wol":sendWolPacket(server)}})}function sendWolPacket(server){var apiClient=connectionManager.getApiClient(server.Id);loading.show(),apiClient.wakeOnLan().then(function(result){loading.hide()})}function onServersRetrieved(result){servers=result,renderSelectServerItems(view,result),layoutManager.tv&&focusManager.autoFocus(view)}function loadServers(){loading.show(),connectionManager.getAvailableServers().then(onServersRetrieved,function(result){onServersRetrieved([])})}function initContent(){updatePageStyle(view,params),view.querySelector(".btnOfflineText").innerHTML=globalize.translate("sharedcomponents#HeaderMyDownloads"),appHost.supports("sync")&&view.querySelector(".btnOffline").classList.remove("hide")}var servers,scrollX=!layoutManager.desktop;scrollX=!1,initContent();var backdropUrl=staticBackdrops.getRandomImageUrl();view.addEventListener("viewshow",function(e){var isRestored=e.detail.isRestored;appRouter.setTitle(null),backdrop.setBackdrop(backdropUrl),isRestored||(loadServers(),loadInvitations())}),view.querySelector(".btnConnect").addEventListener("click",function(e){appRouter.show("/connectlogin.html?mode=connect")}),view.querySelector(".btnOffline").addEventListener("click",function(e){appRouter.show("/offline/offline.html")}),view.querySelector(".servers").addEventListener("click",function(e){var card=dom.parentWithClass(e.target,"card");if(card){var url=card.getAttribute("data-url");if(url)appRouter.show(url);else{var id=card.getAttribute("data-id"),server=servers.filter(function(s){return s.Id===id})[0];onServerClick(server)}}}),view.querySelector(".invitations").addEventListener("click",function(e){var btnInviteMenu=dom.parentWithClass(e.target,"btnInviteMenu");btnInviteMenu&&showPendingInviteMenu(btnInviteMenu)})}}); \ No newline at end of file +define(["loading","appRouter","layoutManager","appSettings","apphost","focusManager","connectionManager","backdrop","globalize","staticBackdrops","actionsheet","dom","material-icons","flexStyles","emby-scroller","emby-itemscontainer","cardStyle","emby-button"],function(loading,appRouter,layoutManager,appSettings,appHost,focusManager,connectionManager,backdrop,globalize,staticBackdrops,actionSheet,dom){"use strict";function renderSelectServerItems(view,servers){var items=servers.map(function(server){return{name:server.Name,showIcon:!0,icon:"",cardType:"",id:server.Id,server:server}}),html=items.map(function(item){var cardImageContainer;cardImageContainer=item.showIcon?''+item.icon+"":'
    ';var cardBoxCssClass="cardBox";layoutManager.tv&&(cardBoxCssClass+=" cardBox-focustransform");var innerOpening='
    ';return'
    "}).join(""),itemsContainer=view.querySelector(".servers");items.length||(html="

    "+globalize.translate("sharedcomponents#MessageNoServersAvailableToConnect")+"

    "),itemsContainer.innerHTML=html,loading.hide()}function updatePageStyle(view,params){"1"==params.showuser?(view.classList.add("libraryPage"),view.classList.remove("standalonePage"),view.classList.add("noSecondaryNavPage")):(view.classList.add("standalonePage"),view.classList.remove("libraryPage"),view.classList.remove("noSecondaryNavPage"))}function showGeneralError(){loading.hide(),alertText(globalize.translate("sharedcomponents#DefaultErrorMessage"))}function alertText(text){alertTextWithOptions({text:text})}function alertTextWithOptions(options){require(["alert"],function(alert){alert(options)})}function showServerConnectionFailure(){alertText(globalize.translate("MessageUnableToConnectToServer"),globalize.translate("HeaderConnectionFailure"))}return function(view,params){function connectToServer(server){loading.show(),connectionManager.connectToServer(server,{enableAutoLogin:appSettings.enableAutoLogin()}).then(function(result){loading.hide();var apiClient=result.ApiClient;switch(result.State){case"SignedIn":Dashboard.onServerChanged(apiClient.getCurrentUserId(),apiClient.accessToken(),apiClient),Dashboard.navigate("home.html");break;case"ServerSignIn":Dashboard.onServerChanged(null,null,apiClient),Dashboard.navigate("login.html?serverid="+result.Servers[0].Id);break;case"ServerUpdateNeeded":alertTextWithOptions({text:globalize.translate("core#ServerUpdateNeeded","https://emby.media"),html:globalize.translate("core#ServerUpdateNeeded",'https://emby.media')});break;default:showServerConnectionFailure()}})}function deleteServer(server){loading.show(),connectionManager.deleteServer(server.Id).then(function(){loading.hide(),loadServers()},function(){loading.hide(),loadServers()})}function acceptInvitation(id){loading.show(),connectionManager.acceptServer(id).then(function(){loading.hide(),loadServers(),loadInvitations()},showGeneralError)}function rejectInvitation(id){loading.show(),connectionManager.rejectServer(id).then(function(){loading.hide(),loadServers(),loadInvitations()},showGeneralError)}function showPendingInviteMenu(elem){var card=dom.parentWithClass(elem,"inviteItem"),invitationId=card.getAttribute("data-id"),menuItems=[];menuItems.push({name:globalize.translate("sharedcomponents#Accept"),id:"accept"}),menuItems.push({name:globalize.translate("sharedcomponents#Reject"),id:"reject"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:elem,callback:function(id){switch(id){case"accept":acceptInvitation(invitationId);break;case"reject":rejectInvitation(invitationId)}}})})}function getPendingInviteHtml(item){var cardBoxCssClass="cardBox";layoutManager.tv&&(cardBoxCssClass+=" cardBox-focustransform");var innerOpening='
    ';return'
    "}function renderInvitations(list){list.length?view.querySelector(".invitationSection").classList.remove("hide"):view.querySelector(".invitationSection").classList.add("hide");var html=list.map(getPendingInviteHtml).join("");view.querySelector(".invitations").innerHTML=html}function loadInvitations(){connectionManager.isLoggedIntoConnect()?connectionManager.getUserInvitations().then(renderInvitations):renderInvitations([])}function onServerClick(server){var menuItems=[];menuItems.push({name:globalize.translate("sharedcomponents#Connect"),id:"connect"}),menuItems.push({name:globalize.translate("sharedcomponents#Delete"),id:"delete"});var apiClient=connectionManager.getApiClient(server.Id);apiClient&&apiClient.supportsWakeOnLan()&&menuItems.push({name:globalize.translate("sharedcomponents#WakeServer"),id:"wol"}),actionSheet.show({items:menuItems,title:server.Name}).then(function(id){switch(id){case"connect":connectToServer(server);break;case"delete":deleteServer(server);break;case"wol":sendWolPacket(server)}})}function sendWolPacket(server){var apiClient=connectionManager.getApiClient(server.Id);require(["loadingDialog"],function(LoadingDialog){var dlg=new LoadingDialog({title:globalize.translate("sharedcomponents#HeaderWakeServer"),text:globalize.translate("sharedcomponents#AttemptingWakeServer")});dlg.show();var afterWol=function(){setTimeout(function(){apiClient.getPublicSystemInfo().then(onWolSuccess.bind(dlg),onWolFail.bind(dlg))},12e3)};apiClient.wakeOnLan().then(afterWol,afterWol)})}function onWolSuccess(){var dlg=this;dlg.hide(),dlg.destroy(),require(["alert"],function(alert){alert({text:globalize.translate("sharedcomponents#WakeServerSuccess"),title:globalize.translate("sharedcomponents#HeaderWakeServer")})})}function onWolFail(){var dlg=this;dlg.hide(),dlg.destroy(),require(["alert"],function(alert){alert({text:globalize.translate("sharedcomponents#WakeServerError"),title:globalize.translate("sharedcomponents#HeaderWakeServer")})})}function onServersRetrieved(result){servers=result,renderSelectServerItems(view,result),layoutManager.tv&&focusManager.autoFocus(view)}function loadServers(){loading.show(),connectionManager.getAvailableServers().then(onServersRetrieved,function(result){onServersRetrieved([])})}var servers;layoutManager.desktop;(function(){updatePageStyle(view,params),view.querySelector(".btnOfflineText").innerHTML=globalize.translate("sharedcomponents#HeaderMyDownloads"),appHost.supports("sync")&&view.querySelector(".btnOffline").classList.remove("hide")})();var backdropUrl=staticBackdrops.getRandomImageUrl();view.addEventListener("viewshow",function(e){var isRestored=e.detail.isRestored;appRouter.setTitle(null),backdrop.setBackdrop(backdropUrl),isRestored||(loadServers(),loadInvitations())}),view.querySelector(".btnConnect").addEventListener("click",function(e){appRouter.show("/connectlogin.html?mode=connect")}),view.querySelector(".btnOffline").addEventListener("click",function(e){appRouter.show("/offline/offline.html")}),view.querySelector(".servers").addEventListener("click",function(e){var card=dom.parentWithClass(e.target,"card");if(card){var url=card.getAttribute("data-url");if(url)appRouter.show(url);else{var id=card.getAttribute("data-id");onServerClick(servers.filter(function(s){return s.Id===id})[0])}}}),view.querySelector(".invitations").addEventListener("click",function(e){var btnInviteMenu=dom.parentWithClass(e.target,"btnInviteMenu");btnInviteMenu&&showPendingInviteMenu(btnInviteMenu)})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/serversecurity.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/serversecurity.js index ea7684fcb9..f38eb57699 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/serversecurity.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/serversecurity.js @@ -1 +1 @@ -define(["datetime","loading","libraryMenu","dom","globalize","emby-button"],function(datetime,loading,libraryMenu,dom,globalize){"use strict";function revoke(page,key){require(["confirm"],function(confirm){confirm(globalize.translate("MessageConfirmRevokeApiKey"),globalize.translate("HeaderConfirmRevokeApiKey")).then(function(){loading.show(),ApiClient.ajax({type:"DELETE",url:ApiClient.getUrl("Auth/Keys/"+key)}).then(function(){loadData(page)})})})}function renderKeys(page,keys,users){var rows=keys.map(function(item){var html="";html+='',html+='',html+='",html+="",html+='',html+=item.AccessToken,html+="",html+='',html+=item.AppName||"",html+="",html+='',html+=item.DeviceName||"",html+="",html+='';var user=users.filter(function(u){return u.Id==item.UserId})[0];user&&(html+=user.Name),html+="",html+='';var date=datetime.parseISO8601Date(item.DateCreated,!0);return html+=datetime.toLocaleDateString(date)+" "+datetime.getDisplayTime(date),html+="",html+=""}).join(""),resultBody=page.querySelector(".resultBody");resultBody.innerHTML=rows,loading.hide()}function loadData(page){loading.show(),ApiClient.getUsers().then(function(users){ApiClient.getJSON(ApiClient.getUrl("Auth/Keys")).then(function(result){renderKeys(page,result.Items,users)})})}function showNewKeyPrompt(page){require(["prompt"],function(prompt){prompt({title:globalize.translate("HeaderNewApiKey"),label:globalize.translate("LabelAppName"),description:globalize.translate("LabelAppNameExample")}).then(function(value){ApiClient.ajax({type:"POST",url:ApiClient.getUrl("Auth/Keys",{App:value})}).then(function(){loadData(page)})})})}function getTabs(){return[{href:"dashboardhosting.html",name:globalize.translate("TabHosting")},{href:"serversecurity.html",name:globalize.translate("TabSecurity")}]}pageIdOn("pageinit","serverSecurityPage",function(){var page=this;page.querySelector(".btnNewKey").addEventListener("click",function(){showNewKeyPrompt(page)}),page.querySelector(".tblApiKeys").addEventListener("click",function(e){var btnRevoke=dom.parentWithClass(e.target,"btnRevoke");btnRevoke&&revoke(page,btnRevoke.getAttribute("data-token"))})}),pageIdOn("pagebeforeshow","serverSecurityPage",function(){libraryMenu.setTabs("adminadvanced",1,getTabs);var page=this;loadData(page)})}); \ No newline at end of file +define(["datetime","loading","libraryMenu","dom","globalize","emby-button"],function(datetime,loading,libraryMenu,dom,globalize){"use strict";function revoke(page,key){require(["confirm"],function(confirm){confirm(globalize.translate("MessageConfirmRevokeApiKey"),globalize.translate("HeaderConfirmRevokeApiKey")).then(function(){loading.show(),ApiClient.ajax({type:"DELETE",url:ApiClient.getUrl("Auth/Keys/"+key)}).then(function(){loadData(page)})})})}function renderKeys(page,keys,users){var rows=keys.map(function(item){var html="";html+='',html+='',html+='",html+="",html+='',html+=item.AccessToken,html+="",html+='',html+=item.AppName||"",html+="",html+='',html+=item.DeviceName||"",html+="",html+='';var user=users.filter(function(u){return u.Id==item.UserId})[0];user&&(html+=user.Name),html+="",html+='';var date=datetime.parseISO8601Date(item.DateCreated,!0);return html+=datetime.toLocaleDateString(date)+" "+datetime.getDisplayTime(date),html+="",html+=""}).join("");page.querySelector(".resultBody").innerHTML=rows,loading.hide()}function loadData(page){loading.show(),ApiClient.getUsers().then(function(users){ApiClient.getJSON(ApiClient.getUrl("Auth/Keys")).then(function(result){renderKeys(page,result.Items,users)})})}function showNewKeyPrompt(page){require(["prompt"],function(prompt){prompt({title:globalize.translate("HeaderNewApiKey"),label:globalize.translate("LabelAppName"),description:globalize.translate("LabelAppNameExample")}).then(function(value){ApiClient.ajax({type:"POST",url:ApiClient.getUrl("Auth/Keys",{App:value})}).then(function(){loadData(page)})})})}function getTabs(){return[{href:"dashboardhosting.html",name:globalize.translate("TabHosting")},{href:"serversecurity.html",name:globalize.translate("TabSecurity")}]}pageIdOn("pageinit","serverSecurityPage",function(){var page=this;page.querySelector(".btnNewKey").addEventListener("click",function(){showNewKeyPrompt(page)}),page.querySelector(".tblApiKeys").addEventListener("click",function(e){var btnRevoke=dom.parentWithClass(e.target,"btnRevoke");btnRevoke&&revoke(page,btnRevoke.getAttribute("data-token"))})}),pageIdOn("pagebeforeshow","serverSecurityPage",function(){libraryMenu.setTabs("adminadvanced",1,getTabs),loadData(this)})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/site.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/site.js index 81f3db47b6..9de84a780d 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/site.js +++ b/MediaBrowser.WebDashboard/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},allowPluginPages:function(pluginId){var allowedPluginConfigs=["14f5f69e-4c8d-491b-8917-8e90e8317530","e711475e-efad-431b-8527-033ba9873a34","dc372f99-4e0e-4c6b-8c18-2b887ca4530c","0417264b-5a93-4ad0-a1f0-b87569b7cf80","899c12c7-5b40-4c4e-9afd-afd74a685eb1","830fc68f-b964-4d2f-b139-48e22cd143c7","b9f0c474-e9a8-4292-ae41-eb3c1542f4cd","b0daa30f-2e09-4083-a6ce-459d9fecdd80","7cfbb821-e8fd-40ab-b64e-a7749386a6b2","4C2FDA1C-FD5E-433A-AD2B-718E0B73E9A9","cd5a19be-7676-48ef-b64f-a17c98f2b889","b2ff6a63-303a-4a84-b937-6e12f87e3eb9","9574ac10-bf23-49bc-949f-924f23cfa48f","66fd72a4-7e8e-4f22-8d1c-022ce4b9b0d5","8e791e2a-058a-4b12-8493-8bf69d92d685","577f89eb-58a7-4013-be06-9a970ddb1377","6153FDF0-40CC-4457-8730-3B4A19512BAE","de228f12-e43e-4bd9-9fc0-2830819c3b92","6C3B6965-C257-47C2-AA02-64457AE21D91","2FE79C34-C9DC-4D94-9DF2-2F3F36764414","AB95885A-1D0E-445E-BDBF-80C1912C98C5","986a7283-205a-4436-862d-23135c067f8a","8abc6789-fde2-4705-8592-4028806fa343","2850d40d-9c66-4525-aa46-968e8ef04e97"],disallowPlugins=AppInfo.isNativeApp&&allowedPluginConfigs.indexOf((pluginId||"").toLowerCase())===-1;return!disallowPlugins},getCurrentUser:function(){return window.ApiClient.getCurrentUser(!1)},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 Dashboard.isConnectMode()?"configurationpageext?name="+encodeURIComponent(name):"configurationpage?name="+encodeURIComponent(name)},getConfigurationResourceUrl:function(name){return Dashboard.isConnectMode()?ApiClient.getUrl("web/ConfigurationPage",{name:name}):Dashboard.getConfigurationPageUrl(name)},navigate:function(url,preserveQueryString){if(!url)throw new Error("url cannot be null or empty");var queryString=getWindowLocationSearch();return preserveQueryString&&queryString&&(url+=queryString),new Promise(function(resolve,reject){require(["appRouter"],function(appRouter){return appRouter.show(url).then(resolve,reject)})})},processPluginConfigurationUpdateResult:function(){require(["loading","toast"],function(loading,toast){loading.hide(),toast(Globalize.translate("MessageSettingsSaved"))})},processServerConfigurationUpdateResult:function(result){require(["loading","toast"],function(loading,toast){loading.hide(),toast(Globalize.translate("MessageSettingsSaved"))})},processErrorResponse:function(response){require(["loading"],function(loading){loading.hide()});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&&require(["serverRestartDialog","events"],function(ServerRestartDialog,events){var dialog=new ServerRestartDialog({apiClient:apiClient});events.on(dialog,"restarted",function(){Dashboard.isConnectMode()?apiClient.ensureWebSocket():window.location.reload(!0)}),dialog.show()})},showUserFlyout:function(){Dashboard.navigate("mypreferencesmenu.html")},capabilities:function(appHost){var caps={PlayableMediaTypes:["Audio","Video"],SupportedCommands:["MoveUp","MoveDown","MoveLeft","MoveRight","PageUp","PageDown","PreviousLetter","NextLetter","ToggleOsd","ToggleContextMenu","Select","Back","SendKey","SendString","GoHome","GoToSettings","VolumeUp","VolumeDown","Mute","Unmute","ToggleMute","SetVolume","SetAudioStreamIndex","SetSubtitleStreamIndex","DisplayContent","GoToSearch","DisplayMessage","SetRepeatMode","ChannelUp","ChannelDown","PlayMediaSource"],SupportsPersistentIdentifier:Dashboard.isRunningInCordova(),SupportsMediaControl:!0,SupportedLiveMediaTypes:["Audio","Video"]};if(caps.SupportsSync=appHost.supports("sync"),caps.SupportsContentUploading=appHost.supports("cameraupload"),self.MainActivity){var fcmToken=MainActivity.getFcmToken();fcmToken&&(caps.PushToken=fcmToken,caps.PushTokenType="firebase")}return caps}},AppInfo={};!function(){"use strict";function initializeApiClient(apiClient){Dashboard.isRunningInCordova()&&(apiClient.getAvailablePlugins=function(){return Promise.resolve([])})}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(ConnectionManager,apphost,credentialProvider,events,userSettings){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(apphost);capabilities.DeviceProfile=deviceProfile;var connectionManager=new 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),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 returnFirstDependency(obj){return obj}function getSettingsBuilder(UserSettings,layoutManager,browser){return UserSettings.prototype.enableThemeVideos=function(val){return null!=val?this.set("enableThemeVideos",val.toString(),!1):(val=this.get("enableThemeVideos",!1),val?"false"!==val:!layoutManager.mobile&&!browser.slow)},UserSettings}function getBowerPath(){return"bower_components"}function getPlaybackManager(playbackManager){return window.addEventListener("beforeunload",function(e){try{playbackManager.onAppClose()}catch(err){console.log("error in onAppClose: "+err)}}),playbackManager}function getLayoutManager(layoutManager,appHost){return appHost.getDefaultLayout&&(layoutManager.defaultLayout=appHost.getDefaultLayout()),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(Headroom){var headroom=new Headroom([],{});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 createSharedAppFooter(appFooter){var footer=new appFooter({});return footer}function onRequireJsError(requireType,requireModules){console.log("RequireJS error: "+(requireType||"unknown")+". Failed modules: "+(requireModules||[]).join(","))}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",staticBackdrops:embyWebComponentsBowerPath+"/staticbackdrops",ironCardList:"components/ironcardlist/ironcardlist",scrollThreshold:"components/scrollthreshold",playlisteditor:"components/playlisteditor/playlisteditor",medialibrarycreator:"components/medialibrarycreator/medialibrarycreator",medialibraryeditor:"components/medialibraryeditor/medialibraryeditor",howler:bowerPath+"/howlerjs/dist/howler.min",sortable:bowerPath+"/Sortable/Sortable.min",isMobile:bowerPath+"/isMobile/isMobile.min",masonry:bowerPath+"/masonry/dist/masonry.pkgd.min",humanedate:"components/humanedate",libraryBrowser:"scripts/librarybrowser",events:apiClientBowerPath+"/events",credentialprovider:apiClientBowerPath+"/credentials",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",playQueueManager:embyWebComponentsBowerPath+"/playback/playqueuemanager",autoPlayDetect:embyWebComponentsBowerPath+"/playback/autoplaydetect",nowPlayingHelper:embyWebComponentsBowerPath+"/playback/nowplayinghelper",pluginManager:embyWebComponentsBowerPath+"/pluginmanager",packageManager:embyWebComponentsBowerPath+"/packagemanager"};paths.hlsjs=bowerPath+"/hlsjs/dist/hls.min",paths.flvjs=embyWebComponentsBowerPath+"/flvjs/flv.min",paths.shaka=embyWebComponentsBowerPath+"/shaka/shaka-player.compiled",define("chromecastHelper",[embyWebComponentsBowerPath+"/chromecast/chromecasthelpers"],returnFirstDependency),define("mediaSession",[embyWebComponentsBowerPath+"/playback/mediasession"],returnFirstDependency),define("webActionSheet",[embyWebComponentsBowerPath+"/actionsheet/actionsheet"],returnFirstDependency),define("libjass",[bowerPath+"/libjass/libjass.min","css!"+bowerPath+"/libjass/libjass"],returnFirstDependency),define("tunerPicker",["components/tunerpicker"],returnFirstDependency),define("mainTabsManager",[embyWebComponentsBowerPath+"/maintabsmanager"],returnFirstDependency),define("imageLoader",[embyWebComponentsBowerPath+"/images/imagehelper"],returnFirstDependency),define("appFooter",[embyWebComponentsBowerPath+"/appfooter/appfooter"],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("playMethodHelper",[embyWebComponentsBowerPath+"/playback/playmethodhelper"],returnFirstDependency),define("brightnessOsd",[embyWebComponentsBowerPath+"/playback/brightnessosd"],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-linkbutton",["emby-button"],returnFirstDependency),define("emby-itemscontainer",[embyWebComponentsBowerPath+"/emby-itemscontainer/emby-itemscontainer"],returnFirstDependency),define("alphaNumericShortcuts",[embyWebComponentsBowerPath+"/alphanumericshortcuts/alphanumericshortcuts"],returnFirstDependency),define("emby-scroller",[embyWebComponentsBowerPath+"/emby-scroller/emby-scroller"],returnFirstDependency),define("emby-tabs",[embyWebComponentsBowerPath+"/emby-tabs/emby-tabs"],returnFirstDependency),define("emby-scrollbuttons",[embyWebComponentsBowerPath+"/emby-scrollbuttons/emby-scrollbuttons"],returnFirstDependency),define("emby-progressring",[embyWebComponentsBowerPath+"/emby-progressring/emby-progressring"],returnFirstDependency),define("emby-itemrefreshindicator",[embyWebComponentsBowerPath+"/emby-itemrefreshindicator/emby-itemrefreshindicator"],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"],returnFirstDependency),define("tabbedView",[embyWebComponentsBowerPath+"/tabbedview/tabbedview"],returnFirstDependency),define("itemsTab",[embyWebComponentsBowerPath+"/tabbedview/itemstab"],returnFirstDependency),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-radio",[embyWebComponentsBowerPath+"/emby-radio/emby-radio"],returnFirstDependency),define("emby-textarea",[embyWebComponentsBowerPath+"/emby-textarea/emby-textarea"],returnFirstDependency),define("collectionEditor",[embyWebComponentsBowerPath+"/collectioneditor/collectioneditor"],returnFirstDependency),define("serverRestartDialog",[embyWebComponentsBowerPath+"/serverrestartdialog/serverrestartdialog"],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("recordingButton",[embyWebComponentsBowerPath+"/recordingcreator/recordingbutton"],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("imageDownloader",[embyWebComponentsBowerPath+"/imagedownloader/imagedownloader"],returnFirstDependency),define("dom",[embyWebComponentsBowerPath+"/dom"],returnFirstDependency),define("playerStats",[embyWebComponentsBowerPath+"/playerstats/playerstats"],returnFirstDependency),define("searchFields",[embyWebComponentsBowerPath+"/search/searchfields"],returnFirstDependency),define("searchResults",[embyWebComponentsBowerPath+"/search/searchresults"],returnFirstDependency),define("upNextDialog",[embyWebComponentsBowerPath+"/upnextdialog/upnextdialog"],returnFirstDependency),define("fullscreen-doubleclick",[embyWebComponentsBowerPath+"/fullscreen/fullscreen-doubleclick"],returnFirstDependency),define("fullscreenManager",[embyWebComponentsBowerPath+"/fullscreen/fullscreenmanager","events"],returnFirstDependency),define("headroom",[embyWebComponentsBowerPath+"/headroom/headroom"],returnFirstDependency),define("subtitleAppearanceHelper",[embyWebComponentsBowerPath+"/subtitlesettings/subtitleappearancehelper"],returnFirstDependency),define("subtitleSettings",[embyWebComponentsBowerPath+"/subtitlesettings/subtitlesettings"],returnFirstDependency),define("displaySettings",[embyWebComponentsBowerPath+"/displaysettings/displaysettings"],returnFirstDependency),define("playbackSettings",[embyWebComponentsBowerPath+"/playbacksettings/playbacksettings"],returnFirstDependency),define("homescreenSettings",[embyWebComponentsBowerPath+"/homescreensettings/homescreensettings"],returnFirstDependency),define("homescreenSettingsDialog",[embyWebComponentsBowerPath+"/homescreensettings/homescreensettingsdialog"],returnFirstDependency),define("playbackManager",[embyWebComponentsBowerPath+"/playback/playbackmanager"],getPlaybackManager),define("layoutManager",[embyWebComponentsBowerPath+"/layoutmanager","apphost"],getLayoutManager),define("homeSections",[embyWebComponentsBowerPath+"/homesections/homesections"],returnFirstDependency),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("flexStyles",["css!"+embyWebComponentsBowerPath+"/flexstyles"],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("syncJobEditor",[embyWebComponentsBowerPath+"/sync/syncjobeditor"],returnFirstDependency),define("syncJobList",[embyWebComponentsBowerPath+"/sync/syncjoblist"],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),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"),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,onError:onRequireJsError}),requirejs.onError=onRequireJsError,define("jstree",[bowerPath+"/jstree/dist/jstree","css!thirdparty/jstree/themes/default/style.min.css"],returnFirstDependency),define("dashboardcss",["css!css/dashboard"],returnFirstDependency),define("jqmwidget",["thirdparty/jquerymobile/jqm.widget"],returnFirstDependency),define("jqmpopup",["thirdparty/jquerymobile/jqm.popup","css!thirdparty/jquerymobile/jqm.popup.css"],returnFirstDependency),define("jqmlistview",[],returnFirstDependency),define("jqmpanel",["thirdparty/jquerymobile/jqm.panel","css!thirdparty/jquerymobile/jqm.panel.css"],returnFirstDependency),define("slideshow",[embyWebComponentsBowerPath+"/slideshow/slideshow"],returnFirstDependency),define("fetch",[bowerPath+"/fetch/fetch"],returnFirstDependency),define("raf",[embyWebComponentsBowerPath+"/polyfills/raf"],returnFirstDependency),define("functionbind",[embyWebComponentsBowerPath+"/polyfills/bind"],returnFirstDependency),define("arraypolyfills",[embyWebComponentsBowerPath+"/polyfills/array"],returnFirstDependency),define("objectassign",[embyWebComponentsBowerPath+"/polyfills/objectassign"],returnFirstDependency),define("clearButtonStyle",["css!"+embyWebComponentsBowerPath+"/clearbutton"],returnFirstDependency),define("userdataButtons",[embyWebComponentsBowerPath+"/userdatabuttons/userdatabuttons"],returnFirstDependency),define("emby-playstatebutton",[embyWebComponentsBowerPath+"/userdatabuttons/emby-playstatebutton"],returnFirstDependency),define("emby-ratingbutton",[embyWebComponentsBowerPath+"/userdatabuttons/emby-ratingbutton"],returnFirstDependency),define("emby-downloadbutton",[embyWebComponentsBowerPath+"/sync/emby-downloadbutton"],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("viewSettings",[embyWebComponentsBowerPath+"/viewsettings/viewsettings"],returnFirstDependency),define("filterMenu",[embyWebComponentsBowerPath+"/filtermenu/filtermenu"],returnFirstDependency),define("sortMenu",[embyWebComponentsBowerPath+"/sortmenu/sortmenu"],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"],returnFirstDependency),define("serversync",[apiClientBowerPath+"/sync/serversync"],returnFirstDependency),define("multiserversync",[apiClientBowerPath+"/sync/multiserversync"],returnFirstDependency),define("mediasync",[apiClientBowerPath+"/sync/mediasync"],returnFirstDependency),define("idb",[embyWebComponentsBowerPath+"/idb"],returnFirstDependency),define("sanitizefilename",[embyWebComponentsBowerPath+"/sanitizefilename"],returnFirstDependency),define("itemrepository",[apiClientBowerPath+"/sync/itemrepository"],returnFirstDependency),define("useractionrepository",[apiClientBowerPath+"/sync/useractionrepository"],returnFirstDependency),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("touchHelper",[embyWebComponentsBowerPath+"/touchhelper"],returnFirstDependency),define("appSettings",[embyWebComponentsBowerPath+"/appsettings"],returnFirstDependency),define("userSettings",[embyWebComponentsBowerPath+"/usersettings/usersettings"],returnFirstDependency),define("userSettingsBuilder",[embyWebComponentsBowerPath+"/usersettings/usersettingsbuilder","layoutManager","browser"],getSettingsBuilder),define("material-icons",["css!"+embyWebComponentsBowerPath+"/fonts/material-icons/style"],returnFirstDependency),define("systemFontsCss",["css!"+embyWebComponentsBowerPath+"/fonts/fonts"],returnFirstDependency),define("systemFontsSizedCss",["css!"+embyWebComponentsBowerPath+"/fonts/fonts.sized"],returnFirstDependency),define("scrollStyles",["css!"+embyWebComponentsBowerPath+"/scrollstyles"],returnFirstDependency),define("imageUploader",[embyWebComponentsBowerPath+"/imageuploader/imageuploader"],returnFirstDependency),define("navdrawer",["components/navdrawer/navdrawer"],returnFirstDependency),define("htmlMediaHelper",[embyWebComponentsBowerPath+"/htmlvideoplayer/htmlmediahelper"],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"],returnFirstDependency),define("dialogHelper",[embyWebComponentsBowerPath+"/dialoghelper/dialoghelper"],returnFirstDependency),define("inputmanager",["inputManager"],returnFirstDependency),define("apiInput",[embyWebComponentsBowerPath+"/input/api"],returnFirstDependency),define("serverNotifications",["apiInput"],returnFirstDependency),define("headroom-window",["headroom"],createWindowHeadroom),define("appFooter-shared",["appFooter"],createSharedAppFooter),define("skinManager",[embyWebComponentsBowerPath+"/skinmanager"],function(skinManager){return skinManager.loadUserSkin=function(options){require(["appRouter"],function(appRouter){options=options||{},options.start?appRouter.invokeShortcut(options.start):appRouter.goHome()})},skinManager.getThemes=function(){return[{name:"Apple TV",id:"appletv"},{name:"Dark",id:"dark"},{name:"Dark (green accent)",id:"dark-green"},{name:"Dark (red accent)",id:"dark-red"},{name:"Very dark",id:"verydark",isDefault:!0},{name:"Halloween",id:"halloween"},{name:"Light",id:"light",isDefaultServerDashboard:!0},{name:"Light (blue accent)",id:"light-blue"},{name:"Light (green accent)",id:"light-green"},{name:"Light (pink accent)",id:"light-pink"},{name:"Light (purple accent)",id:"light-purple"},{name:"Light (red accent)",id:"light-red"},{name:"Windows Media Center",id:"wmc"}]},skinManager}),define("connectionManager",[],function(){return ConnectionManager}),define("apiClientResolver",[],function(){return function(){return window.ApiClient}}),define("appRouter",[embyWebComponentsBowerPath+"/router","itemHelper"],function(appRouter,itemHelper){function showItem(item,serverId,options){"string"==typeof item?require(["connectionManager"],function(connectionManager){var apiClient=connectionManager.currentApiClient();apiClient.getItem(apiClient.getCurrentUserId(),item).then(function(item){appRouter.showItem(item,options)})}):(2==arguments.length&&(options=arguments[1]),appRouter.show("/"+appRouter.getRouteUrl(item,options),{item:item}))}return appRouter.showLocalLogin=function(serverId,manualLogin){Dashboard.navigate("login.html?serverid="+serverId)},appRouter.showVideoOsd=function(){return Dashboard.navigate("videoosd.html")},appRouter.showSelectServer=function(){Dashboard.isConnectMode()?Dashboard.navigate("selectserver.html"):Dashboard.navigate("login.html")},appRouter.showWelcome=function(){Dashboard.isConnectMode()?Dashboard.navigate("connectlogin.html?mode=welcome"):Dashboard.navigate("login.html")},appRouter.showConnectLogin=function(){Dashboard.navigate("connectlogin.html")},appRouter.showSettings=function(){Dashboard.navigate("mypreferencesmenu.html")},appRouter.showGuide=function(){Dashboard.navigate("livetv.html?tab=1")},appRouter.goHome=function(){Dashboard.navigate("home.html")},appRouter.showSearch=function(){Dashboard.navigate("search.html")},appRouter.showLiveTV=function(){Dashboard.navigate("livetv.html")},appRouter.showRecordedTV=function(){Dashboard.navigate("livetv.html?tab=3")},appRouter.showFavorites=function(){Dashboard.navigate("home.html?tab=1")},appRouter.showSettings=function(){Dashboard.navigate("mypreferencesmenu.html")},appRouter.showNowPlaying=function(){Dashboard.navigate("nowplaying.html")},appRouter.setTitle=function(title){LibraryMenu.setTitle(title)},appRouter.getRouteUrl=function(item,options){ -if(!item)throw new Error("item cannot be null");if(item.url)return item.url;var context=options?options.context:null,id=item.Id||item.ItemId;options||(options={});var url,itemType=item.Type||(options?options.itemType:null),serverId=item.ServerId||options.serverId;if("downloads"===item)return"offline/offline.html";if("downloadsettings"===item)return"mysyncsettings.html";if("managedownloads"===item)return"managedownloads.html";if("manageserver"===item)return"dashboard.html";if("recordedtv"===item)return"livetv.html?tab=3&serverId="+options.serverId;if("nextup"===item)return"list.html?type=nextup&serverId="+options.serverId;if("list"===item){var url="list.html?serverId="+options.serverId+"&type="+options.itemTypes;return options.isFavorite&&(url+="&IsFavorite=true"),url}if("livetv"===item)return"guide"===options.section?"livetv.html?tab=1&serverId="+options.serverId:"movies"===options.section?"list.html?type=Programs&IsMovie=true&serverId="+options.serverId:"shows"===options.section?"list.html?type=Programs&IsSeries=true&IsMovie=false&IsNews=false&serverId="+options.serverId:"sports"===options.section?"list.html?type=Programs&IsSports=true&serverId="+options.serverId:"kids"===options.section?"list.html?type=Programs&IsKids=true&serverId="+options.serverId:"news"===options.section?"list.html?type=Programs&IsNews=true&serverId="+options.serverId:"onnow"===options.section?"list.html?type=Programs&IsAiring=true&serverId="+options.serverId:"dvrschedule"===options.section?"livetv.html?tab=4&serverId="+options.serverId:"livetv.html?serverId="+options.serverId;if("SeriesTimer"==itemType)return"itemdetails.html?seriesTimerId="+id+"&serverId="+serverId;if("livetv"==item.CollectionType)return"livetv.html";if("Genre"===item.Type)return url="list.html?genreId="+item.Id+"&serverId="+serverId,options.parentId&&(url+="&parentId="+options.parentId),url;if("GameGenre"===item.Type)return url="list.html?gameGenreId="+item.Id+"&serverId="+serverId,options.parentId&&(url+="&parentId="+options.parentId),url;if("MusicGenre"===item.Type)return url="list.html?musicGenreId="+item.Id+"&serverId="+serverId,options.parentId&&(url+="&parentId="+options.parentId),url;if("Studio"===item.Type)return url="list.html?studioId="+item.Id+"&serverId="+serverId,options.parentId&&(url+="&parentId="+options.parentId),url;if("folders"!==context&&!itemHelper.isLocalItem(item)){if("movies"==item.CollectionType)return url="movies.html?topParentId="+item.Id,options&&"latest"===options.section&&(url+="&tab=1"),url;if("tvshows"==item.CollectionType)return url="tv.html?topParentId="+item.Id,options&&"latest"===options.section&&(url+="&tab=2"),url;if("music"==item.CollectionType)return"music.html?topParentId="+item.Id}if("Playlist"==itemType)return"itemdetails.html?id="+id+"&serverId="+serverId;if("TvChannel"==itemType)return"itemdetails.html?id="+id+"&serverId="+serverId;if("Program"==itemType)return"itemdetails.html?id="+id+"&serverId="+serverId;if("BoxSet"==itemType)return"itemdetails.html?id="+id+"&serverId="+serverId;if("MusicAlbum"==itemType)return"itemdetails.html?id="+id+"&serverId="+serverId;if("GameSystem"==itemType)return"itemdetails.html?id="+id+"&serverId="+serverId;if("MusicGenre"==itemType)return"itemdetails.html?id="+id+"&serverId="+serverId;if("Person"==itemType)return"itemdetails.html?id="+id+"&serverId="+serverId;if("Recording"==itemType)return"itemdetails.html?id="+id+"&serverId="+serverId;if("MusicArtist"==itemType)return"itemdetails.html?id="+id+"&serverId="+serverId;var contextSuffix=context?"&context="+context:"";return"Series"==itemType||"Season"==itemType||"Episode"==itemType?"itemdetails.html?id="+id+contextSuffix+"&serverId="+serverId:item.IsFolder?id?"list.html?parentId="+id+"&serverId="+serverId:"#":"itemdetails.html?id="+id+"&serverId="+serverId},appRouter.showItem=showItem,appRouter})}function defineResizeObserver(){self.ResizeObserver?define("ResizeObserver",[],function(){return self.ResizeObserver}):define("ResizeObserver",["bower_components/resize-observer-polyfill/dist/ResizeObserver"],returnFirstDependency)}function initRequireWithBrowser(browser){var bowerPath=getBowerPath(),apiClientBowerPath=bowerPath+"/emby-apiclient",embyWebComponentsBowerPath=bowerPath+"/emby-webcomponents";window.IntersectionObserver&&!browser.edge?define("lazyLoader",[embyWebComponentsBowerPath+"/lazyloader/lazyloader-intersectionobserver"],returnFirstDependency):define("lazyLoader",[embyWebComponentsBowerPath+"/lazyloader/lazyloader-scroll"],returnFirstDependency),Dashboard.isRunningInCordova()&&browser.android?(define("apiclientcore",["bower_components/emby-apiclient/apiclient"],returnFirstDependency),define("apiclient",["bower_components/emby-apiclient/apiclientex"],returnFirstDependency),define("wakeOnLan",["cordova/wakeonlan"],returnFirstDependency)):(define("apiclient",["bower_components/emby-apiclient/apiclient"],returnFirstDependency),define("wakeOnLan",["bower_components/emby-apiclient/wakeonlan"],returnFirstDependency)),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"],returnFirstDependency):define("registerElement",[bowerPath+"/document-register-element/build/document-register-element"],returnFirstDependency),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),defineResizeObserver(),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||browser.chromecast||browser.orsay||browser.web0s||browser.ps4?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)),Dashboard.isRunningInCordova()?define("castSenderApiLoader",[],getDummyCastSenderApiLoader):define("castSenderApiLoader",[],getCastSenderApiLoader),self.Windows?(define("bgtaskregister",["environments/windows-uwp/bgtaskregister"],returnFirstDependency),define("transfermanager",["environments/windows-uwp/transfermanager"],returnFirstDependency),define("filerepository",["environments/windows-uwp/filerepository"],returnFirstDependency)):Dashboard.isRunningInCordova()&&browser.iOS?(define("filerepository",["cordova/filerepository"],returnFirstDependency),define("transfermanager",["filerepository"],returnFirstDependency)):(define("transfermanager",[apiClientBowerPath+"/sync/transfermanager"],returnFirstDependency),define("filerepository",[apiClientBowerPath+"/sync/filerepository"],returnFirstDependency)),Dashboard.isRunningInCordova()&&browser.android?define("localsync",["cordova/localsync"],returnFirstDependency):define("localsync",[apiClientBowerPath+"/sync/localsync"],returnFirstDependency)}function getRequirePromise(deps){return new Promise(function(resolve,reject){require(deps,resolve)})}function init(){Dashboard.isRunningInCordova()&&browserInfo.android&&define("nativedirectorychooser",["cordova/nativedirectorychooser"],returnFirstDependency),define("livetvcss",["css!css/livetv.css"],returnFirstDependency),define("detailtablecss",["css!css/detailtable.css"],returnFirstDependency),define("buttonenabled",["legacy/buttonenabled"],returnFirstDependency);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","be-by","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","lt-lt","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","be-BY","bg-BG","ca","cs","da","de","el","en-GB","en-US","es","es-AR","es-MX","fa","fi","fr","fr-CA","gsw","he","hi-IN","hr","hu","id","it","kk","ko","lt-LT","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"}});return globalize.defaultModule("core"),globalize.loadStrings({name:"core",translations:translations})}function onGlobalizeInit(){document.title=Globalize.translateDocument(document.title,"core");var deps=["apphost"];browserInfo.tv&&!browserInfo.android?(console.log("Using system fonts with explicit sizes"),deps.push("systemFontsSizedCss")):(console.log("Using default fonts"),deps.push("systemFontsCss")),deps.push("css!css/librarybrowser"),require(deps,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(appHost){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:[],roles:"admin"}),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",controller:"scripts/dashboardpage"}),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:"/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:"/home.html",dependencies:[],autoFocus:!1,controller:"home/home",transition:"fade",type:"home"}),defineRoute({path:"/list.html",dependencies:[],autoFocus:!1,controller:"list/list",transition:"fade"}),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:"/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:"/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:"/livetvtuner.html",dependencies:[],autoFocus:!1,roles:"admin",controller:"dashboard/livetvtuner"}),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:[],autoFocus:!1,transition:"fade",controller:"scripts/mypreferenceshome"}),defineRoute({path:"/mypreferencessubtitles.html",dependencies:[],autoFocus:!1,transition:"fade",controller:"scripts/mypreferencessubtitles"}),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:"/offline/offline.html",transition:"fade",controller:"offline/offline",dependencies:[],anonymous:!0,startup:!1}),defineRoute({path:"/managedownloads.html",transition:"fade",controller:"scripts/managedownloads",dependencies:[]}),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:"/notifications.html",dependencies:[],autoFocus:!1,controller:"scripts/notifications"}),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,enableMediaControl:!1}),defineRoute({path:"/playbackconfiguration.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/plugincatalog.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/plugins.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/scheduledtask.html",dependencies:[],autoFocus:!1,roles:"admin",controller:"scripts/scheduledtaskpage"}),defineRoute({path:"/scheduledtasks.html",dependencies:[],autoFocus:!1,roles:"admin",controller:"scripts/scheduledtaskspage"}),defineRoute({path:"/search.html",dependencies:[],controller:"scripts/searchpage"}),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:"/streamingsettings.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/support.html",dependencies:[],autoFocus:!1,roles:"admin"}),defineRoute({path:"/supporterkey.html",dependencies:[],controller:"scripts/supporterkeypage",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,controller:"scripts/wizardagreement"}),defineRoute({path:"/wizardremoteaccess.html",dependencies:["dashboardcss"],autoFocus:!1,anonymous:!0,controller:"dashboard/wizardremoteaccess"}),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:"/wizardsettings.html",dependencies:["dashboardcss"],autoFocus:!1,anonymous:!0,controller:"dashboard/wizardsettings"}),defineRoute({path:"/wizardstart.html",dependencies:["dashboardcss"],autoFocus:!1,anonymous:!0,controller:"dashboard/wizardstart"}),defineRoute({path:"/wizarduser.html",dependencies:["dashboardcss","emby-input"],controller:"scripts/wizarduserpage",autoFocus:!1,anonymous:!0}),defineRoute({path:"/videoosd.html",dependencies:[],transition:"fade",controller:"scripts/videoosd",autoFocus:!1,type:"video-osd",supportsThemeMedia:!0,fullscreen:!0,enableMediaControl:!1}),defineRoute(Dashboard.isConnectMode()?{path:"/configurationpageext",dependencies:[],autoFocus:!1,enableCache:!1,enableContentQueryString:!0,roles:"admin",contentPath:getPluginPageContentPath}:{path:"/configurationpage",dependencies:[],autoFocus:!1,enableCache:!1,enableContentQueryString:!0,roles:"admin"}),defineRoute({path:"/",isDefaultRoute:!0,autoFocus:!1,dependencies:[]})}function getPluginPageContentPath(){return window.ApiClient?ApiClient.getUrl("web/ConfigurationPage"):null}function loadPlugins(externalPlugins,appHost,browser,shell){console.log("Loading installed plugins");var list=["bower_components/emby-webcomponents/playback/playbackvalidation","bower_components/emby-webcomponents/playback/playaccessvalidation","bower_components/emby-webcomponents/playback/experimentalwarnings"];Dashboard.isRunningInCordova()&&browser.android?MainActivity.enableVlcPlayer()&&list.push("cordova/vlcplayer"):Dashboard.isRunningInCordova()&&browser.safari&&(list.push("cordova/audioplayer"),list.push("cordova/mpvplayer")),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"),list.push("bower_components/emby-webcomponents/photoplayer/plugin"),appHost.supports("remotecontrol")&&(list.push("bower_components/emby-webcomponents/sessionplayer"),(browser.chrome||browser.opera)&&list.push("bower_components/emby-webcomponents/chromecast/chromecastplayer")),list.push("bower_components/emby-webcomponents/youtubeplayer/plugin");for(var i=0,length=externalPlugins.length;i',""),statusInfo.deviceStatus){case 2:statusLine=globalize.translate("MessagePremiereStatusOver",statusInfo.planType),indicator.classList.add("expiredBackground"),indicator.classList.remove("nearExpiredBackground"),indicator.innerHTML="",extendedPlans.classList.remove("hide");break;case 1:statusLine=globalize.translate("MessagePremiereStatusClose",statusInfo.planType),indicator.classList.remove("expiredBackground"),indicator.classList.add("nearExpiredBackground"),indicator.innerHTML="",extendedPlans.classList.remove("hide");break;default:statusLine=globalize.translate("MessagePremiereStatusGood",statusInfo.planType),indicator.classList.remove("expiredBackground"),indicator.classList.remove("nearExpiredBackground"),indicator.innerHTML="",extendedPlans.classList.add("hide")}page.querySelector("#premiere-status").innerHTML=statusLine;var subsElement=page.querySelector("#premiere-subs");if(statusInfo.subscriptions&&statusInfo.subscriptions.length>0){page.querySelector("#premiere-subs-content").innerHTML=getSubscriptionHtml(statusInfo.subscriptions,info.SupporterKey);var sub=page.querySelector(".lnkSubscription");sub&&sub.addEventListener("click",cancelSub),subsElement.classList.remove("hide")}else subsElement.classList.add("hide");page.querySelector(".isSupporter").classList.remove("hide")}})):(page.querySelector(".supporterContainer").classList.remove("hide"),page.querySelector(".isSupporter").classList.add("hide")),loading.hide()})}function getPremiereStatus(key){var postData="key="+key+"&serverId="+ApiClient.serverId();return fetchHelper.ajax({url:"https://mb3admin.com/admin/service/registration/getStatus",type:"POST",data:postData,contentType:"application/x-www-form-urlencoded",dataType:"json"})}function getSubscriptionHtml(subs,key){return subs.map(function(item){var itemHtml="",makeLink=item.autoRenew&&"Stripe"==item.store,tagName=makeLink?"button":"div",openTag=tagName='',li+="
    "}).join("");html&&(html='
    '+html+"
    ");var elem=$(".blockedTags",page).html(html).trigger("create");$(".btnDeleteTag",elem).on("click",function(){var tag=this.getAttribute("data-tag"),newTags=tags.filter(function(t){return t!=tag});loadBlockedTags(page,newTags)})}function deleteAccessSchedule(page,schedules,index){schedules.splice(index,1),renderAccessSchedule(page,schedules)}function renderAccessSchedule(page,schedules){var html="",index=0;html+=schedules.map(function(a){var itemHtml="";return itemHtml+='
    ',itemHtml+='
    ',itemHtml+='

    ',itemHtml+=Globalize.translate("Option"+a.DayOfWeek),itemHtml+="

    ",itemHtml+='
    '+getDisplayTime(a.StartHour)+" - "+getDisplayTime(a.EndHour)+"
    ",itemHtml+="
    ",itemHtml+='',itemHtml+="
    ",index++,itemHtml}).join("");var accessScheduleList=page.querySelector(".accessScheduleList");accessScheduleList.innerHTML=html,$(".btnDelete",accessScheduleList).on("click",function(){deleteAccessSchedule(page,schedules,parseInt(this.getAttribute("data-index")))})}function onSaveComplete(page){loading.hide(),require(["toast"],function(toast){toast(Globalize.translate("SettingsSaved"))})}function saveUser(user,page){user.Policy.MaxParentalRating=$("#selectMaxParentalRating",page).val()||null,user.Policy.BlockUnratedItems=$(".chkUnratedItem",page).get().filter(function(i){return i.checked}).map(function(i){return i.getAttribute("data-itemtype")}),user.Policy.AccessSchedules=getSchedulesFromPage(page),user.Policy.BlockedTags=getBlockedTagsFromPage(page),ApiClient.updateUserPolicy(user.Id,user.Policy).then(function(){onSaveComplete(page)})}function getDisplayTime(hours){var minutes=0,pct=hours%1;return pct&&(minutes=parseInt(60*pct)),datetime.getDisplayTime(new Date(2e3,1,1,hours,minutes,0,0))}function showSchedulePopup(page,schedule,index){schedule=schedule||{},require(["components/accessschedule/accessschedule"],function(accessschedule){accessschedule.show({schedule:schedule}).then(function(updatedSchedule){var schedules=getSchedulesFromPage(page);index==-1&&(index=schedules.length),schedules[index]=updatedSchedule,renderAccessSchedule(page,schedules)})})}function getSchedulesFromPage(page){return $(".liSchedule",page).map(function(){return{DayOfWeek:this.getAttribute("data-day"),StartHour:this.getAttribute("data-start"),EndHour:this.getAttribute("data-end")}}).get()}function getBlockedTagsFromPage(page){return $(".blockedTag",page).map(function(){return this.getAttribute("data-tag")}).get()}function showBlockedTagPopup(page){require(["prompt"],function(prompt){prompt({label:Globalize.translate("LabelTag")}).then(function(value){var tags=getBlockedTagsFromPage(page);tags.indexOf(value)==-1&&(tags.push(value),loadBlockedTags(page,tags))})})}window.UserParentalControlPage={onSubmit:function(){var page=$(this).parents(".page");loading.show();var userId=getParameterByName("userId");return ApiClient.getUser(userId).then(function(result){saveUser(result,page)}),!1}},$(document).on("pageinit","#userParentalControlPage",function(){var page=this;$(".btnAddSchedule",page).on("click",function(){showSchedulePopup(page,{},-1)}),$(".btnAddBlockedTag",page).on("click",function(){showBlockedTagPopup(page)}),$(".userParentalControlForm").off("submit",UserParentalControlPage.onSubmit).on("submit",UserParentalControlPage.onSubmit)}).on("pageshow","#userParentalControlPage",function(){var page=this;loading.show();var userId=getParameterByName("userId"),promise1=ApiClient.getUser(userId),promise2=ApiClient.getParentalRatings();Promise.all([promise1,promise2]).then(function(responses){loadUser(page,responses[0],responses[1])})})}); \ No newline at end of file +define(["jQuery","datetime","loading","libraryMenu","listViewStyle","paper-icon-button-light"],function($,datetime,loading,libraryMenu){"use strict";function populateRatings(allParentalRatings,page){var html="";html+="";var i,length,rating,ratings=[];for(i=0,length=allParentalRatings.length;i"+rating.Name+"";$("#selectMaxParentalRating",page).html(html)}function loadUnratedItems(page,user){var items=[{name:Globalize.translate("OptionBlockBooks"),value:"Book"},{name:Globalize.translate("OptionBlockGames"),value:"Game"},{name:Globalize.translate("OptionBlockChannelContent"),value:"ChannelContent"},{name:Globalize.translate("OptionBlockLiveTvChannels"),value:"LiveTvChannel"},{name:Globalize.translate("OptionBlockMovies"),value:"Movie"},{name:Globalize.translate("OptionBlockMusic"),value:"Music"},{name:Globalize.translate("OptionBlockTrailers"),value:"Trailer"},{name:Globalize.translate("OptionBlockTvShows"),value:"Series"}],html="";html+='

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

    ",html+='
    ';for(var i=0,length=items.length;i"+item.name+""}html+="
    ",$(".blockUnratedItems",page).html(html).trigger("create")}function loadUser(page,user,allParentalRatings){libraryMenu.setTitle(user.Name),loadUnratedItems(page,user),loadBlockedTags(page,user.Policy.BlockedTags),populateRatings(allParentalRatings,page);var ratingValue="";if(user.Policy.MaxParentalRating)for(var i=0,length=allParentalRatings.length;i=rating.Value&&(ratingValue=rating.Value)}$("#selectMaxParentalRating",page).val(ratingValue),user.Policy.IsAdministrator?$(".accessScheduleSection",page).hide():$(".accessScheduleSection",page).show(),renderAccessSchedule(page,user.Policy.AccessSchedules||[]),loading.hide()}function loadBlockedTags(page,tags){var html=tags.map(function(h){var li='
    ';return li+='
    ',li+='

    ',li+=h,li+="

    ",li+="
    ",li+='',li+="
    "}).join("");html&&(html='
    '+html+"
    ");var elem=$(".blockedTags",page).html(html).trigger("create");$(".btnDeleteTag",elem).on("click",function(){var tag=this.getAttribute("data-tag"),newTags=tags.filter(function(t){return t!=tag});loadBlockedTags(page,newTags)})}function deleteAccessSchedule(page,schedules,index){schedules.splice(index,1),renderAccessSchedule(page,schedules)}function renderAccessSchedule(page,schedules){var html="",index=0;html+=schedules.map(function(a){var itemHtml="";return itemHtml+='
    ',itemHtml+='
    ',itemHtml+='

    ',itemHtml+=Globalize.translate("Option"+a.DayOfWeek),itemHtml+="

    ",itemHtml+='
    '+getDisplayTime(a.StartHour)+" - "+getDisplayTime(a.EndHour)+"
    ",itemHtml+="
    ",itemHtml+='',itemHtml+="
    ",index++,itemHtml}).join("");var accessScheduleList=page.querySelector(".accessScheduleList");accessScheduleList.innerHTML=html,$(".btnDelete",accessScheduleList).on("click",function(){deleteAccessSchedule(page,schedules,parseInt(this.getAttribute("data-index")))})}function onSaveComplete(page){loading.hide(),require(["toast"],function(toast){toast(Globalize.translate("SettingsSaved"))})}function saveUser(user,page){user.Policy.MaxParentalRating=$("#selectMaxParentalRating",page).val()||null,user.Policy.BlockUnratedItems=$(".chkUnratedItem",page).get().filter(function(i){return i.checked}).map(function(i){return i.getAttribute("data-itemtype")}),user.Policy.AccessSchedules=getSchedulesFromPage(page),user.Policy.BlockedTags=getBlockedTagsFromPage(page),ApiClient.updateUserPolicy(user.Id,user.Policy).then(function(){onSaveComplete(page)})}function getDisplayTime(hours){var minutes=0,pct=hours%1;return pct&&(minutes=parseInt(60*pct)),datetime.getDisplayTime(new Date(2e3,1,1,hours,minutes,0,0))}function showSchedulePopup(page,schedule,index){schedule=schedule||{},require(["components/accessschedule/accessschedule"],function(accessschedule){accessschedule.show({schedule:schedule}).then(function(updatedSchedule){var schedules=getSchedulesFromPage(page);-1==index&&(index=schedules.length),schedules[index]=updatedSchedule,renderAccessSchedule(page,schedules)})})}function getSchedulesFromPage(page){return $(".liSchedule",page).map(function(){return{DayOfWeek:this.getAttribute("data-day"),StartHour:this.getAttribute("data-start"),EndHour:this.getAttribute("data-end")}}).get()}function getBlockedTagsFromPage(page){return $(".blockedTag",page).map(function(){return this.getAttribute("data-tag")}).get()}function showBlockedTagPopup(page){require(["prompt"],function(prompt){prompt({label:Globalize.translate("LabelTag")}).then(function(value){var tags=getBlockedTagsFromPage(page);-1==tags.indexOf(value)&&(tags.push(value),loadBlockedTags(page,tags))})})}window.UserParentalControlPage={onSubmit:function(){var page=$(this).parents(".page");loading.show();var userId=getParameterByName("userId");return ApiClient.getUser(userId).then(function(result){saveUser(result,page)}),!1}},$(document).on("pageinit","#userParentalControlPage",function(){var page=this;$(".btnAddSchedule",page).on("click",function(){showSchedulePopup(page,{},-1)}),$(".btnAddBlockedTag",page).on("click",function(){showBlockedTagPopup(page)}),$(".userParentalControlForm").off("submit",UserParentalControlPage.onSubmit).on("submit",UserParentalControlPage.onSubmit)}).on("pageshow","#userParentalControlPage",function(){var page=this;loading.show();var userId=getParameterByName("userId"),promise1=ApiClient.getUser(userId),promise2=ApiClient.getParentalRatings();Promise.all([promise1,promise2]).then(function(responses){loadUser(page,responses[0],responses[1])})})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/userpassword.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/userpassword.js index 0b38519801..79c340b979 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/userpassword.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/userpassword.js @@ -1 +1 @@ -define(["jQuery","loading","libraryMenu"],function($,loading,libraryMenu){"use strict";function loadUser(page,user){libraryMenu.setTitle(user.Name),"Guest"==user.ConnectLinkType?$(".connectMessage",page).show():$(".connectMessage",page).hide(),loading.hide()}function loadData(page){loading.show();var userId=getParameterByName("userId");ApiClient.getUser(userId).then(function(user){loadUser(page,user)})}$(document).on("pageinit","#userPasswordPage",function(){$(".adminUpdatePasswordForm").off("submit",UpdatePasswordPage.onSubmit).on("submit",UpdatePasswordPage.onSubmit),$(".adminLocalAccessForm").off("submit",UpdatePasswordPage.onLocalAccessSubmit).on("submit",UpdatePasswordPage.onLocalAccessSubmit)}).on("pagebeforeshow","#userPasswordPage",function(){var page=this;loadData(page)})}); \ No newline at end of file +define(["jQuery","loading","libraryMenu"],function($,loading,libraryMenu){"use strict";function loadUser(page,user){libraryMenu.setTitle(user.Name),"Guest"==user.ConnectLinkType?$(".connectMessage",page).show():$(".connectMessage",page).hide(),loading.hide()}function loadData(page){loading.show();var userId=getParameterByName("userId");ApiClient.getUser(userId).then(function(user){loadUser(page,user)})}$(document).on("pageinit","#userPasswordPage",function(){$(".adminUpdatePasswordForm").off("submit",UpdatePasswordPage.onSubmit).on("submit",UpdatePasswordPage.onSubmit),$(".adminLocalAccessForm").off("submit",UpdatePasswordPage.onLocalAccessSubmit).on("submit",UpdatePasswordPage.onLocalAccessSubmit)}).on("pagebeforeshow","#userPasswordPage",function(){loadData(this)})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/userprofilespage.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/userprofilespage.js index 80a655df30..dec01ec6ce 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/userprofilespage.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/userprofilespage.js @@ -1 +1 @@ -define(["loading","dom","globalize","humanedate","paper-icon-button-light","cardStyle","emby-linkbutton","indicators","flexStyles"],function(loading,dom,globalize){"use strict";function deleteUser(page,id){var msg=globalize.translate("DeleteUserConfirmation");require(["confirm"],function(confirm){confirm({title:globalize.translate("DeleteUser"),text:msg,confirmText:globalize.translate("ButtonDelete"),primary:"cancel"}).then(function(){loading.show(),ApiClient.deleteUser(id).then(function(){loadData(page)})})})}function showUserMenu(elem){var card=dom.parentWithClass(elem,"card"),page=dom.parentWithClass(card,"page"),userId=card.getAttribute("data-userid"),menuItems=[];menuItems.push({name:globalize.translate("ButtonOpen"),id:"open",ironIcon:"mode-edit"}),menuItems.push({name:globalize.translate("ButtonLibraryAccess"),id:"access",ironIcon:"lock"}),menuItems.push({name:globalize.translate("ButtonParentalControl"),id:"parentalcontrol",ironIcon:"person"}),menuItems.push({name:globalize.translate("ButtonDelete"),id:"delete",ironIcon:"delete"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:card,callback:function(id){switch(id){case"open":Dashboard.navigate("useredit.html?userId="+userId);break;case"access":Dashboard.navigate("userlibraryaccess.html?userId="+userId);break;case"parentalcontrol":Dashboard.navigate("userparentalcontrol.html?userId="+userId);break;case"delete":deleteUser(page,userId)}}})})}function getUserHtml(user,addConnectIndicator){var html="",cssClass="card squareCard scalableCard squareCard-scalable";user.Policy.IsDisabled&&(cssClass+=" grayscale"),html+="
    ",html+='
    ',html+='
    ',html+='
    ';var href="useredit.html?userId="+user.Id;html+='';var imgUrl;user.PrimaryImageTag&&(imgUrl=ApiClient.getUserImageUrl(user.Id,{width:300,tag:user.PrimaryImageTag,type:"Primary"}));var imageClass="cardImage";user.Policy.IsDisabled&&(imageClass+=" disabledUser"),imgUrl?html+='",html+='
    ',html+='
    ',html+='',html+="
    ",html+='
    ',html+=user.Name,html+="
    ",html+='
    ';var lastSeen=getLastSeenText(user.LastActivityDate);return html+=""!=lastSeen?lastSeen:" ",html+="
    ",html+="
    ",html+="
    ",html+="
    "}function getLastSeenText(lastActivityDate){return lastActivityDate?"Last seen "+humane_date(lastActivityDate):""}function getUserSectionHtml(users,addConnectIndicator){var html="";return html+=users.map(function(u){return getUserHtml(u,addConnectIndicator)}).join("")}function renderUsersIntoElement(elem,users,addConnectIndicator){elem.innerHTML=getUserSectionHtml(users,addConnectIndicator)}function renderUsers(page,users){renderUsersIntoElement(page.querySelector(".localUsers"),users.filter(function(u){return"Guest"!==u.ConnectLinkType}),!0),renderUsersIntoElement(page.querySelector(".connectUsers"),users.filter(function(u){return"Guest"===u.ConnectLinkType}))}function showPendingUserMenu(elem){var menuItems=[];menuItems.push({name:globalize.translate("ButtonCancel"),id:"delete",ironIcon:"delete"}),require(["actionsheet"],function(actionsheet){var card=dom.parentWithClass(elem,"card"),page=dom.parentWithClass(card,"page"),id=card.getAttribute("data-id");actionsheet.show({items:menuItems,positionTo:card,callback:function(menuItemId){switch(menuItemId){case"delete":cancelAuthorization(page,id)}}})})}function getPendingUserHtml(user){var html="",cssClass="card squareCard scalableCard squareCard-scalable";html+="
    ",html+='
    ',html+='
    ',html+='
    ';var href="#";return html+='',user.ImageUrl?(html+='
    ",html+="
    "):html+='',html+="
    ",html+="
    ",html+='
    ',html+='
    ',html+='',html+="
    ",html+='
    ',html+=user.UserName,html+="
    ",html+="
    ",html+="
    ",html+="
    "}function renderPendingGuests(page,users){users.length?page.querySelector(".sectionPendingGuests").classList.remove("hide"):page.querySelector(".sectionPendingGuests").classList.add("hide");var html=users.map(getPendingUserHtml).join("");page.querySelector(".pending").innerHTML=html}function cancelAuthorization(page,id){loading.show(),ApiClient.ajax({type:"DELETE",url:ApiClient.getUrl("Connect/Pending",{Id:id})}).then(function(){loadData(page)})}function loadData(page){loading.show(),ApiClient.getUsers().then(function(users){renderUsers(page,users),loading.hide()}),ApiClient.getJSON(ApiClient.getUrl("Connect/Pending")).then(function(pending){renderPendingGuests(page,pending)})}function showLinkUser(page,userId){require(["components/guestinviter/connectlink"],function(connectlink){connectlink.show().then(function(){loadData(page)})})}function showInvitePopup(page){Dashboard.getCurrentUser().then(function(user){return user.ConnectUserId?void require(["components/guestinviter/guestinviter"],function(guestinviter){guestinviter.show().then(function(){loadData(page)})}):void showLinkUser(page,user.Id)})}pageIdOn("pageinit","userProfilesPage",function(){var page=this;page.querySelector(".btnInvite").addEventListener("click",function(){showInvitePopup(page)}),page.querySelector(".btnAddUser").addEventListener("click",function(){Dashboard.navigate("usernew.html")}),page.querySelector(".btnAddUser").addEventListener("click",function(){Dashboard.navigate("usernew.html")}),page.querySelector(".localUsers").addEventListener("click",function(e){var btnUserMenu=dom.parentWithClass(e.target,"btnUserMenu");btnUserMenu&&showUserMenu(btnUserMenu)}),page.querySelector(".connectUsers").addEventListener("click",function(e){var btnUserMenu=dom.parentWithClass(e.target,"btnUserMenu");btnUserMenu&&showUserMenu(btnUserMenu)}),page.querySelector(".pending").addEventListener("click",function(e){var btnUserMenu=dom.parentWithClass(e.target,"btnUserMenu");btnUserMenu&&showPendingUserMenu(btnUserMenu)})}),pageIdOn("pagebeforeshow","userProfilesPage",function(){var page=this;loadData(page)})}); \ No newline at end of file +define(["loading","dom","globalize","humanedate","paper-icon-button-light","cardStyle","emby-linkbutton","indicators","flexStyles"],function(loading,dom,globalize){"use strict";function deleteUser(page,id){var msg=globalize.translate("DeleteUserConfirmation");require(["confirm"],function(confirm){confirm({title:globalize.translate("DeleteUser"),text:msg,confirmText:globalize.translate("ButtonDelete"),primary:"cancel"}).then(function(){loading.show(),ApiClient.deleteUser(id).then(function(){loadData(page)})})})}function showUserMenu(elem){var card=dom.parentWithClass(elem,"card"),page=dom.parentWithClass(card,"page"),userId=card.getAttribute("data-userid"),menuItems=[];menuItems.push({name:globalize.translate("ButtonOpen"),id:"open",ironIcon:"mode-edit"}),menuItems.push({name:globalize.translate("ButtonLibraryAccess"),id:"access",ironIcon:"lock"}),menuItems.push({name:globalize.translate("ButtonParentalControl"),id:"parentalcontrol",ironIcon:"person"}),menuItems.push({name:globalize.translate("ButtonDelete"),id:"delete",ironIcon:"delete"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:card,callback:function(id){switch(id){case"open":Dashboard.navigate("useredit.html?userId="+userId);break;case"access":Dashboard.navigate("userlibraryaccess.html?userId="+userId);break;case"parentalcontrol":Dashboard.navigate("userparentalcontrol.html?userId="+userId);break;case"delete":deleteUser(page,userId)}}})})}function getUserHtml(user,addConnectIndicator){var html="",cssClass="card squareCard scalableCard squareCard-scalable";user.Policy.IsDisabled&&(cssClass+=" grayscale"),html+="
    ",html+='
    ',html+='
    ',html+='
    ',html+='';var imgUrl;user.PrimaryImageTag&&(imgUrl=ApiClient.getUserImageUrl(user.Id,{width:300,tag:user.PrimaryImageTag,type:"Primary"}));var imageClass="cardImage";user.Policy.IsDisabled&&(imageClass+=" disabledUser"),imgUrl?html+='",html+='
    ',html+='
    ',html+='',html+="
    ",html+='
    ',html+=user.Name,html+="
    ",html+='
    ';var lastSeen=getLastSeenText(user.LastActivityDate);return html+=""!=lastSeen?lastSeen:" ",html+="
    ",html+="
    ",html+="
    ",html+="
    "}function getLastSeenText(lastActivityDate){return lastActivityDate?"Last seen "+humane_date(lastActivityDate):""}function getUserSectionHtml(users,addConnectIndicator){var html="";return html+=users.map(function(u){return getUserHtml(u,addConnectIndicator)}).join("")}function renderUsersIntoElement(elem,users,addConnectIndicator){elem.innerHTML=getUserSectionHtml(users,addConnectIndicator)}function renderUsers(page,users){renderUsersIntoElement(page.querySelector(".localUsers"),users.filter(function(u){return"Guest"!==u.ConnectLinkType}),!0),renderUsersIntoElement(page.querySelector(".connectUsers"),users.filter(function(u){return"Guest"===u.ConnectLinkType}))}function showPendingUserMenu(elem){var menuItems=[];menuItems.push({name:globalize.translate("ButtonCancel"),id:"delete",ironIcon:"delete"}),require(["actionsheet"],function(actionsheet){var card=dom.parentWithClass(elem,"card"),page=dom.parentWithClass(card,"page"),id=card.getAttribute("data-id");actionsheet.show({items:menuItems,positionTo:card,callback:function(menuItemId){switch(menuItemId){case"delete":cancelAuthorization(page,id)}}})})}function getPendingUserHtml(user){var html="";html+="
    ",html+='
    ',html+='",html+='
    ',html+='
    ',html+='',html+="
    ",html+='
    ',html+=user.UserName,html+="
    ",html+="
    ",html+="
    ",html+="
    "}function renderPendingGuests(page,users){users.length?page.querySelector(".sectionPendingGuests").classList.remove("hide"):page.querySelector(".sectionPendingGuests").classList.add("hide");var html=users.map(getPendingUserHtml).join("");page.querySelector(".pending").innerHTML=html}function cancelAuthorization(page,id){loading.show(),ApiClient.ajax({type:"DELETE",url:ApiClient.getUrl("Connect/Pending",{Id:id})}).then(function(){loadData(page)})}function loadData(page){loading.show(),ApiClient.getUsers().then(function(users){renderUsers(page,users),loading.hide()}),ApiClient.getJSON(ApiClient.getUrl("Connect/Pending")).then(function(pending){renderPendingGuests(page,pending)})}function showLinkUser(page,userId){require(["components/guestinviter/connectlink"],function(connectlink){connectlink.show().then(function(){loadData(page)})})}function showInvitePopup(page){Dashboard.getCurrentUser().then(function(user){if(!user.ConnectUserId)return void showLinkUser(page,user.Id);require(["components/guestinviter/guestinviter"],function(guestinviter){guestinviter.show().then(function(){loadData(page)})})})}pageIdOn("pageinit","userProfilesPage",function(){var page=this;page.querySelector(".btnInvite").addEventListener("click",function(){showInvitePopup(page)}),page.querySelector(".btnAddUser").addEventListener("click",function(){Dashboard.navigate("usernew.html")}),page.querySelector(".btnAddUser").addEventListener("click",function(){Dashboard.navigate("usernew.html")}),page.querySelector(".localUsers").addEventListener("click",function(e){var btnUserMenu=dom.parentWithClass(e.target,"btnUserMenu");btnUserMenu&&showUserMenu(btnUserMenu)}),page.querySelector(".connectUsers").addEventListener("click",function(e){var btnUserMenu=dom.parentWithClass(e.target,"btnUserMenu");btnUserMenu&&showUserMenu(btnUserMenu)}),page.querySelector(".pending").addEventListener("click",function(e){var btnUserMenu=dom.parentWithClass(e.target,"btnUserMenu");btnUserMenu&&showPendingUserMenu(btnUserMenu)})}),pageIdOn("pagebeforeshow","userProfilesPage",function(){loadData(this)})}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/videoosd.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/videoosd.js index a9b2f56cd6..0265d0e87c 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/videoosd.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/videoosd.js @@ -1 +1 @@ -define(["playbackManager","dom","inputmanager","datetime","itemHelper","mediaInfo","focusManager","imageLoader","scrollHelper","events","connectionManager","browser","globalize","apphost","layoutManager","userSettings","scrollStyles","emby-slider","paper-icon-button-light","css!css/videoosd"],function(playbackManager,dom,inputManager,datetime,itemHelper,mediaInfo,focusManager,imageLoader,scrollHelper,events,connectionManager,browser,globalize,appHost,layoutManager,userSettings){"use strict";function seriesImageUrl(item,options){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){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)):"Primary"===options.type&&item.AlbumId&&item.AlbumPrimaryImageTag?(options.tag=item.AlbumPrimaryImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.AlbumId,options)):null}function logoImageUrl(item,apiClient,options){return options=options||{},options.type="Logo",item.ImageTags&&item.ImageTags.Logo?(options.tag=item.ImageTags.Logo,apiClient.getScaledImageUrl(item.Id,options)):item.ParentLogoImageTag?(options.tag=item.ParentLogoImageTag,apiClient.getScaledImageUrl(item.ParentLogoItemId,options)):null}return function(view,params){function onVerticalSwipe(e,elem,data){var player=currentPlayer;if(player){var deltaY=data.currentDeltaY,windowSize=dom.getWindowSize();if(supportsBrightnessChange&&data.clientX1?view.querySelector(".btnAudio").classList.remove("hide"):view.querySelector(".btnAudio").classList.add("hide"))):(setPoster(null),updateRecordingButton(null),Emby.Page.setTitle(""),nowPlayingVolumeSlider.disabled=!0,nowPlayingPositionSlider.disabled=!0,btnFastForward.disabled=!0,btnRewind.disabled=!0,view.querySelector(".btnSubtitles").classList.add("hide"),view.querySelector(".btnAudio").classList.add("hide"),view.querySelector(".osdTitle").innerHTML="",void(view.querySelector(".osdMediaInfo").innerHTML=""))}function setTitle(item,parentName){var url=logoImageUrl(item,connectionManager.getApiClient(item.ServerId),{});if(url){Emby.Page.setTitle("");var pageTitle=document.querySelector(".pageTitle");pageTitle.style.backgroundImage="url('"+url+"')",pageTitle.classList.add("pageTitleWithLogo"),pageTitle.classList.remove("pageTitleWithDefaultLogo"),pageTitle.innerHTML=""}else Emby.Page.setTitle(parentName||"")}function setPoster(item,secondaryItem){var osdPoster=view.querySelector(".osdPoster");if(item){var imgUrl=seriesImageUrl(item,{type:"Primary"})||seriesImageUrl(item,{type:"Thumb"})||imageUrl(item,{type:"Primary"});if(!imgUrl&&secondaryItem&&(imgUrl=seriesImageUrl(secondaryItem,{type:"Primary"})||seriesImageUrl(secondaryItem,{type:"Thumb"})||imageUrl(secondaryItem,{type:"Primary"})),imgUrl)return void(osdPoster.innerHTML='')}osdPoster.innerHTML=""}function showOsd(){slideDownToShow(headerElement),showMainOsdControls(),startOsdHideTimer()}function hideOsd(){slideUpToHide(headerElement),hideMainOsdControls()}function toggleOsd(){"osd"===currentVisibleMenu?hideOsd():currentVisibleMenu||showOsd()}function startOsdHideTimer(){stopOsdHideTimer(),osdHideTimeout=setTimeout(hideOsd,5e3)}function stopOsdHideTimer(){osdHideTimeout&&(clearTimeout(osdHideTimeout),osdHideTimeout=null)}function slideDownToShow(elem){elem.classList.remove("osdHeader-hidden")}function slideUpToHide(elem){elem.classList.add("osdHeader-hidden")}function clearHideAnimationEventListeners(elem){dom.removeEventListener(elem,transitionEndEventName,onHideAnimationComplete,{once:!0})}function onHideAnimationComplete(e){var elem=e.target;elem.classList.add("hide"),dom.removeEventListener(elem,transitionEndEventName,onHideAnimationComplete,{once:!0})}function showMainOsdControls(){if(!currentVisibleMenu){var elem=osdBottomElement;currentVisibleMenu="osd",clearHideAnimationEventListeners(elem),elem.classList.remove("hide"),void elem.offsetWidth,elem.classList.remove("videoOsdBottom-hidden"),layoutManager.mobile||setTimeout(function(){focusManager.focus(elem.querySelector(".btnPause"))},50)}}function hideMainOsdControls(){if("osd"===currentVisibleMenu){var elem=osdBottomElement;clearHideAnimationEventListeners(elem),void elem.offsetWidth,elem.classList.add("videoOsdBottom-hidden"),dom.addEventListener(elem,transitionEndEventName,onHideAnimationComplete,{once:!0}),currentVisibleMenu=null}}function onPointerMove(e){var pointerType=e.pointerType||(layoutManager.mobile?"touch":"mouse");if("mouse"===pointerType){var eventX=e.screenX||0,eventY=e.screenY||0,obj=lastPointerMoveData;if(!obj)return void(lastPointerMoveData={x:eventX,y:eventY});if(Math.abs(eventX-obj.x)<10&&Math.abs(eventY-obj.y)<10)return;obj.x=eventX,obj.y=eventY,showOsd()}}function onInputCommand(e){var player=currentPlayer;switch(e.detail.command){case"left":"osd"===currentVisibleMenu?showOsd():currentVisibleMenu||(e.preventDefault(),playbackManager.rewind(player));break;case"right":"osd"===currentVisibleMenu?showOsd():currentVisibleMenu||(e.preventDefault(),playbackManager.fastForward(player));break;case"pageup":playbackManager.unpause(player);break;case"pagedown":playbackManager.pause(player);break;case"up":case"down":case"select":case"menu":case"info":case"play":case"playpause":case"pause":case"fastforward":case"rewind":case"next":case"previous":showOsd();break;case"record":onRecordingCommand(),showOsd();break;case"togglestats":toggleStats()}}function onRecordingCommand(){var btnRecord=view.querySelector(".btnRecord");btnRecord.classList.contains("hide")||btnRecord.click()}function updateFullscreenIcon(){playbackManager.isFullscreen(currentPlayer)?(view.querySelector(".btnFullscreen").setAttribute("title",globalize.translate("ExitFullscreen")),view.querySelector(".btnFullscreen i").innerHTML=""):(view.querySelector(".btnFullscreen").setAttribute("title",globalize.translate("Fullscreen")),view.querySelector(".btnFullscreen i").innerHTML="")}function onPlayerChange(){var player=playbackManager.getCurrentPlayer();player&&!player.isLocalPlayer?view.querySelector(".btnCast i").innerHTML="":view.querySelector(".btnCast i").innerHTML="",bindToPlayer(player)}function onStateChanged(event,state){var player=this;state.NowPlayingItem&&(isEnabled=!0,updatePlayerStateInternal(event,player,state),updatePlaylist(player),enableStopOnBack(!0))}function onPlayPauseStateChanged(e){if(isEnabled){var player=this;updatePlayPauseState(player.paused())}}function onVolumeChanged(e){if(isEnabled){var player=this;updatePlayerVolumeState(player,player.isMuted(),player.getVolume())}}function onPlaybackStart(e,state){console.log("nowplaying event: "+e.type);var player=this;onStateChanged.call(player,e,state),resetUpNextDialog()}function resetUpNextDialog(){comingUpNextDisplayed=!1;var dlg=currentUpNextDialog;dlg&&(dlg.destroy(),currentUpNextDialog=null)}function onPlaybackStopped(e,state){currentRuntimeTicks=null,resetUpNextDialog(),console.log("nowplaying event: "+e.type),"Video"!==state.NextMediaType&&(view.removeEventListener("viewbeforehide",onViewHideStopPlayback),Emby.Page.back())}function onMediaStreamsChanged(e){var player=this,state=playbackManager.getPlayerState(player);onStateChanged.call(player,{type:"init"},state)}function bindToPlayer(player){if(player!==currentPlayer&&(releaseCurrentPlayer(),currentPlayer=player,player)){var state=playbackManager.getPlayerState(player);onStateChanged.call(player,{type:"init"},state),events.on(player,"playbackstart",onPlaybackStart),events.on(player,"playbackstop",onPlaybackStopped),events.on(player,"volumechange",onVolumeChanged),events.on(player,"pause",onPlayPauseStateChanged),events.on(player,"unpause",onPlayPauseStateChanged),events.on(player,"timeupdate",onTimeUpdate),events.on(player,"fullscreenchange",updateFullscreenIcon),events.on(player,"mediastreamschange",onMediaStreamsChanged),resetUpNextDialog()}}function releaseCurrentPlayer(){destroyStats(),resetUpNextDialog();var player=currentPlayer;player&&(events.off(player,"playbackstart",onPlaybackStart),events.off(player,"playbackstop",onPlaybackStopped),events.off(player,"volumechange",onVolumeChanged),events.off(player,"pause",onPlayPauseStateChanged),events.off(player,"unpause",onPlayPauseStateChanged),events.off(player,"timeupdate",onTimeUpdate),events.off(player,"fullscreenchange",updateFullscreenIcon),events.off(player,"mediastreamschange",onMediaStreamsChanged),currentPlayer=null)}function onTimeUpdate(e){if(isEnabled){var now=(new Date).getTime();if(!(now-lastUpdateTime<700)){lastUpdateTime=now;var player=this;currentRuntimeTicks=playbackManager.duration(player);var currentTime=playbackManager.currentTime(player);updateTimeDisplay(currentTime,currentRuntimeTicks,playbackManager.playbackStartTime(player),playbackManager.getBufferedRanges(player));var item=currentItem;refreshProgramInfoIfNeeded(player,item),showComingUpNextIfNeeded(player,item,currentTime,currentRuntimeTicks)}}}function showComingUpNextIfNeeded(player,currentItem,currentTimeTicks,runtimeTicks){if(runtimeTicks&¤tTimeTicks&&!comingUpNextDisplayed&&!currentVisibleMenu&&"Episode"===currentItem.Type&&userSettings.enableNextVideoInfoOverlay()){var minRuntimeTicks=6e9,fiftyMinuteTicks=3e10,fortyMinuteTicks=24e9,showAtSecondsLeft=runtimeTicks>=fiftyMinuteTicks?40:runtimeTicks>=fortyMinuteTicks?35:30,showAtTicks=runtimeTicks-1e3*showAtSecondsLeft*1e4,timeRemainingTicks=runtimeTicks-currentTimeTicks,minTimeRemainingTicks=2e8;currentTimeTicks>=showAtTicks&&runtimeTicks>=minRuntimeTicks&&timeRemainingTicks>=minTimeRemainingTicks&&showComingUpNext(player)}}function onUpNextHidden(){"upnext"===currentVisibleMenu&&(currentVisibleMenu=null)}function showComingUpNext(player){require(["upNextDialog"],function(UpNextDialog){currentVisibleMenu||currentUpNextDialog||(currentVisibleMenu="upnext",comingUpNextDisplayed=!0,playbackManager.nextItem(player).then(function(nextItem){currentUpNextDialog=new UpNextDialog({parent:view.querySelector(".upNextContainer"),player:player,nextItem:nextItem}),events.on(currentUpNextDialog,"hide",onUpNextHidden)},onUpNextHidden))})}function refreshProgramInfoIfNeeded(player,item){if("TvChannel"===item.Type){var program=item.CurrentProgram;if(program&&program.EndDate)try{var endDate=datetime.parseISO8601Date(program.EndDate);if((new Date).getTime()>=endDate.getTime()){console.log("program info needs to be refreshed");var state=playbackManager.getPlayerState(player);onStateChanged.call(player,{type:"init"},state)}}catch(e){console.log("Error parsing date: "+program.EndDate)}}}function updatePlayPauseState(isPaused){isPaused?view.querySelector(".btnPause i").innerHTML="":view.querySelector(".btnPause i").innerHTML=""}function updatePlayerStateInternal(event,player,state){var playState=state.PlayState||{};updatePlayPauseState(playState.IsPaused);var supportedCommands=playbackManager.getSupportedCommands(player);currentPlayerSupportedCommands=supportedCommands,supportsBrightnessChange=supportedCommands.indexOf("SetBrightness")!==-1,updatePlayerVolumeState(player,playState.IsMuted,playState.VolumeLevel),nowPlayingPositionSlider&&!nowPlayingPositionSlider.dragging&&(nowPlayingPositionSlider.disabled=!playState.CanSeek),btnFastForward.disabled=!playState.CanSeek,btnRewind.disabled=!playState.CanSeek;var nowPlayingItem=state.NowPlayingItem||{};playbackStartTimeTicks=playState.PlaybackStartTimeTicks,updateTimeDisplay(playState.PositionTicks,nowPlayingItem.RunTimeTicks,playState.PlaybackStartTimeTicks,playState.BufferedRanges||[]),updateNowPlayingInfo(player,state),state.MediaSource&&state.MediaSource.SupportsTranscoding&&supportedCommands.indexOf("SetMaxStreamingBitrate")!==-1?view.querySelector(".btnVideoOsdSettings").classList.remove("hide"):view.querySelector(".btnVideoOsdSettings").classList.add("hide");var isProgressClear=state.MediaSource&&null==state.MediaSource.RunTimeTicks;nowPlayingPositionSlider.setIsClear(isProgressClear),supportedCommands.indexOf("ToggleFullscreen")===-1||player.isLocalPlayer&&layoutManager.tv&&playbackManager.isFullscreen(player)?view.querySelector(".btnFullscreen").classList.add("hide"):view.querySelector(".btnFullscreen").classList.remove("hide"),supportedCommands.indexOf("PictureInPicture")===-1?view.querySelector(".btnPip").classList.add("hide"):view.querySelector(".btnPip").classList.remove("hide"),updateFullscreenIcon()}function getDisplayPercentByTimeOfDay(programStartDateMs,programRuntimeMs,currentTimeMs){return(currentTimeMs-programStartDateMs)/programRuntimeMs*100}function updateTimeDisplay(positionTicks,runtimeTicks,playbackStartTimeTicks,bufferedRanges){if(enableProgressByTimeOfDay){if(nowPlayingPositionSlider&&!nowPlayingPositionSlider.dragging)if(programStartDateMs&&programEndDateMs){var currentTimeMs=(playbackStartTimeTicks+(positionTicks||0))/1e4,programRuntimeMs=programEndDateMs-programStartDateMs;if(nowPlayingPositionSlider.value=getDisplayPercentByTimeOfDay(programStartDateMs,programRuntimeMs,currentTimeMs),bufferedRanges.length){var rangeStart=getDisplayPercentByTimeOfDay(programStartDateMs,programRuntimeMs,(playbackStartTimeTicks+(bufferedRanges[0].start||0))/1e4),rangeEnd=getDisplayPercentByTimeOfDay(programStartDateMs,programRuntimeMs,(playbackStartTimeTicks+(bufferedRanges[0].end||0))/1e4);nowPlayingPositionSlider.setBufferedRanges([{start:rangeStart,end:rangeEnd}])}else nowPlayingPositionSlider.setBufferedRanges([])}else nowPlayingPositionSlider.value=0,nowPlayingPositionSlider.setBufferedRanges([]);nowPlayingPositionText.innerHTML="",nowPlayingDurationText.innerHTML=""}else{if(nowPlayingPositionSlider&&!nowPlayingPositionSlider.dragging){if(runtimeTicks){var pct=positionTicks/runtimeTicks;pct*=100,nowPlayingPositionSlider.value=pct}else nowPlayingPositionSlider.value=0;runtimeTicks&&null!=positionTicks&¤tRuntimeTicks&&!enableProgressByTimeOfDay&¤tItem.RunTimeTicks&&"Recording"!==currentItem.Type?endsAtText.innerHTML="  -  "+mediaInfo.getEndsAtFromPosition(runtimeTicks,positionTicks,!0):endsAtText.innerHTML=""}nowPlayingPositionSlider&&nowPlayingPositionSlider.setBufferedRanges(bufferedRanges,runtimeTicks,positionTicks),updateTimeText(nowPlayingPositionText,positionTicks),updateTimeText(nowPlayingDurationText,runtimeTicks,!0)}}function updatePlayerVolumeState(player,isMuted,volumeLevel){var supportedCommands=currentPlayerSupportedCommands,showMuteButton=!0,showVolumeSlider=!0;supportedCommands.indexOf("Mute")===-1&&(showMuteButton=!1),supportedCommands.indexOf("SetVolume")===-1&&(showVolumeSlider=!1),player.isLocalPlayer&&appHost.supports("physicalvolumecontrol")&&(showMuteButton=!1,showVolumeSlider=!1),isMuted?(view.querySelector(".buttonMute").setAttribute("title",globalize.translate("Unmute")),view.querySelector(".buttonMute i").innerHTML=""):(view.querySelector(".buttonMute").setAttribute("title",globalize.translate("Mute")),view.querySelector(".buttonMute i").innerHTML=""),showMuteButton?view.querySelector(".buttonMute").classList.remove("hide"):view.querySelector(".buttonMute").classList.add("hide"),nowPlayingVolumeSlider&&(showVolumeSlider?nowPlayingVolumeSliderContainer.classList.remove("hide"):nowPlayingVolumeSliderContainer.classList.add("hide"),nowPlayingVolumeSlider.dragging||(nowPlayingVolumeSlider.value=volumeLevel||0))}function updatePlaylist(player){var btnPreviousTrack=view.querySelector(".btnPreviousTrack"),btnNextTrack=view.querySelector(".btnNextTrack");btnPreviousTrack.classList.remove("hide"),btnNextTrack.classList.remove("hide"),btnNextTrack.disabled=!1,btnPreviousTrack.disabled=!1}function updateTimeText(elem,ticks,divider){if(null==ticks)return void(elem.innerHTML="");var html=datetime.getDisplayRunningTime(ticks);divider&&(html=" / "+html),elem.innerHTML=html}function onSettingsButtonClick(e){var btn=this;require(["playerSettingsMenu"],function(playerSettingsMenu){var player=currentPlayer;player&&playerSettingsMenu.show({mediaType:"Video",player:player,positionTo:btn,stats:!0,onOption:onSettingsOption})})}function onSettingsOption(selectedOption){"stats"===selectedOption&&toggleStats()}function toggleStats(){require(["playerStats"],function(PlayerStats){var player=currentPlayer;player&&(statsOverlay?statsOverlay.toggle():statsOverlay=new PlayerStats({player:player}))})}function destroyStats(){statsOverlay&&(statsOverlay.destroy(),statsOverlay=null)}function showAudioTrackSelection(){var player=currentPlayer,audioTracks=playbackManager.audioTracks(player),currentIndex=playbackManager.getAudioStreamIndex(player),menuItems=audioTracks.map(function(stream){var opt={name:stream.DisplayTitle,id:stream.Index};return stream.Index===currentIndex&&(opt.selected=!0),opt}),positionTo=this;require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,title:globalize.translate("Audio"),positionTo:positionTo}).then(function(id){var index=parseInt(id);index!==currentIndex&&playbackManager.setAudioStreamIndex(index,player)})})}function showSubtitleTrackSelection(){var player=currentPlayer,streams=playbackManager.subtitleTracks(player),currentIndex=playbackManager.getSubtitleStreamIndex(player);null==currentIndex&&(currentIndex=-1),streams.unshift({Index:-1,DisplayTitle:globalize.translate("Off")});var menuItems=streams.map(function(stream){var opt={name:stream.DisplayTitle,id:stream.Index};return stream.Index===currentIndex&&(opt.selected=!0),opt}),positionTo=this;require(["actionsheet"],function(actionsheet){actionsheet.show({title:globalize.translate("Subtitles"),items:menuItems,positionTo:positionTo}).then(function(id){var index=parseInt(id);index!==currentIndex&&playbackManager.setSubtitleStreamIndex(index,player)})})}function onWindowKeyDown(e){if(!currentVisibleMenu&&(32===e.keyCode||13===e.keyCode))return playbackManager.playPause(currentPlayer),void showOsd();switch(e.key){case"f":e.ctrlKey||playbackManager.toggleFullscreen(currentPlayer);break;case"m":playbackManager.toggleMute(currentPlayer);break;case"ArrowLeft":case"Left":case"NavigationLeft":case"GamepadDPadLeft":case"GamepadLeftThumbstickLeft":e.shiftKey&&playbackManager.rewind(currentPlayer);break;case"ArrowRight":case"Right":case"NavigationRight":case"GamepadDPadRight":case"GamepadLeftThumbstickRight":e.shiftKey&&playbackManager.fastForward(currentPlayer)}}function getImgUrl(item,chapter,index,maxWidth,apiClient){return chapter.ImageTag?apiClient.getScaledImageUrl(item.Id,{maxWidth:maxWidth,tag:chapter.ImageTag,type:"Chapter",index:index}):null}function getChapterBubbleHtml(apiClient,item,chapters,positionTicks){for(var chapter,index=-1,i=0,length=chapters.length;i=currentChapter.StartPositionTicks&&(chapter=currentChapter,index=i)}if(!chapter)return null;var src=getImgUrl(item,chapter,index,400,apiClient);if(src){var html='
    ';return html+='',html+='
    ',html+='
    ',html+=chapter.Name,html+="
    ",html+='

    ',html+=datetime.getDisplayRunningTime(positionTicks),html+="

    ",html+="
    ",html+="
    "}return null}function onViewHideStopPlayback(){if(playbackManager.isPlayingVideo()){var player=currentPlayer;view.removeEventListener("viewbeforehide",onViewHideStopPlayback),releaseCurrentPlayer(),playbackManager.stop(player)}}function enableStopOnBack(enabled){view.removeEventListener("viewbeforehide",onViewHideStopPlayback),enabled&&playbackManager.isPlayingVideo(currentPlayer)&&view.addEventListener("viewbeforehide",onViewHideStopPlayback)}var currentPlayer,comingUpNextDisplayed,currentUpNextDialog,isEnabled,currentItem,recordingButtonManager,enableProgressByTimeOfDay,supportsBrightnessChange,currentVisibleMenu,statsOverlay,osdHideTimeout,lastPointerMoveData,self=this,currentPlayerSupportedCommands=[],currentRuntimeTicks=0,lastUpdateTime=0,programStartDateMs=0,programEndDateMs=0,playbackStartTimeTicks=0,nowPlayingVolumeSlider=view.querySelector(".osdVolumeSlider"),nowPlayingVolumeSliderContainer=view.querySelector(".osdVolumeSliderContainer"),nowPlayingPositionSlider=view.querySelector(".osdPositionSlider"),nowPlayingPositionText=view.querySelector(".osdPositionText"),nowPlayingDurationText=view.querySelector(".osdDurationText"),startTimeText=view.querySelector(".startTimeText"),endTimeText=view.querySelector(".endTimeText"),endsAtText=view.querySelector(".endsAtText"),btnRewind=view.querySelector(".btnRewind"),btnFastForward=view.querySelector(".btnFastForward"),transitionEndEventName=dom.whichTransitionEvent(),headerElement=document.querySelector(".skinHeader"),osdBottomElement=document.querySelector(".videoOsdBottom-maincontrols");view.addEventListener("viewbeforeshow",function(e){headerElement.classList.add("osdHeader"),Emby.Page.setTransparency("full")}),view.addEventListener("viewshow",function(e){events.on(playbackManager,"playerchange",onPlayerChange),bindToPlayer(playbackManager.getCurrentPlayer()),dom.addEventListener(document,window.PointerEvent?"pointermove":"mousemove",onPointerMove,{passive:!0}),document.body.classList.add("autoScrollY"),showOsd(),inputManager.on(window,onInputCommand),dom.addEventListener(window,"keydown",onWindowKeyDown,{passive:!0})}),view.addEventListener("viewbeforehide",function(){statsOverlay&&statsOverlay.enabled(!1),dom.removeEventListener(window,"keydown",onWindowKeyDown,{passive:!0}),stopOsdHideTimer(),headerElement.classList.remove("osdHeader"),headerElement.classList.remove("osdHeader-hidden"),dom.removeEventListener(document,window.PointerEvent?"pointermove":"mousemove",onPointerMove,{passive:!0}),document.body.classList.remove("autoScrollY"),inputManager.off(window,onInputCommand),events.off(playbackManager,"playerchange",onPlayerChange),releaseCurrentPlayer()}),appHost.supports("remotecontrol")&&!layoutManager.tv&&view.querySelector(".btnCast").classList.remove("hide"),view.querySelector(".btnCast").addEventListener("click",function(){var btn=this;require(["playerSelectionMenu"],function(playerSelectionMenu){playerSelectionMenu.show(btn)})}),view.querySelector(".btnFullscreen").addEventListener("click",function(){playbackManager.toggleFullscreen(currentPlayer)}),view.querySelector(".btnPip").addEventListener("click",function(){playbackManager.togglePictureInPicture(currentPlayer)}),view.querySelector(".btnVideoOsdSettings").addEventListener("click",onSettingsButtonClick),view.addEventListener("viewhide",function(){headerElement.classList.remove("hide")}),view.addEventListener("viewdestroy",function(){self.touchHelper&&(self.touchHelper.destroy(),self.touchHelper=null),recordingButtonManager&&(recordingButtonManager.destroy(),recordingButtonManager=null),destroyStats()});var lastPointerDown=0;dom.addEventListener(view,window.PointerEvent?"pointerdown":"click",function(e){var isClickInControlsArea=dom.parentWithClass(e.target,["videoOsdBottom","upNextContainer"]);if(isClickInControlsArea)return void showOsd();var pointerType=e.pointerType||(layoutManager.mobile?"touch":"mouse"),now=(new Date).getTime();switch(pointerType){case"touch":now-lastPointerDown>300&&(lastPointerDown=now,toggleOsd());break;case"mouse":e.button||(playbackManager.playPause(currentPlayer),showOsd());break;default:playbackManager.playPause(currentPlayer),showOsd()}},{passive:!0}),browser.touch&&dom.addEventListener(view,"dblclick",onDoubleClick,{}),view.querySelector(".buttonMute").addEventListener("click",function(){playbackManager.toggleMute(currentPlayer)}),nowPlayingVolumeSlider.addEventListener("change",function(){playbackManager.setVolume(this.value,currentPlayer)}),nowPlayingPositionSlider.addEventListener("change",function(){var player=currentPlayer;if(player){var newPercent=parseFloat(this.value);if(enableProgressByTimeOfDay){var seekAirTimeTicks=(programEndDateMs-programStartDateMs)*(newPercent/100)*1e4;seekAirTimeTicks+=1e4*programStartDateMs,seekAirTimeTicks-=playbackStartTimeTicks,playbackManager.seek(seekAirTimeTicks,player)}else playbackManager.seekPercent(newPercent,player)}}),nowPlayingPositionSlider.getBubbleHtml=function(value){if(showOsd(),enableProgressByTimeOfDay){if(programStartDateMs&&programEndDateMs){var ms=programEndDateMs-programStartDateMs;ms/=100,ms*=value,ms+=programStartDateMs;var date=new Date(parseInt(ms));return'

    '+getDisplayTimeWithoutAmPm(date,!0)+"

    "}return"--:--"}if(!currentRuntimeTicks)return"--:--";var ticks=currentRuntimeTicks;ticks/=100,ticks*=value;var item=currentItem;if(item&&item.Chapters&&item.Chapters.length&&item.Chapters[0].ImageTag){var html=getChapterBubbleHtml(connectionManager.getApiClient(item.ServerId),item,item.Chapters,ticks);if(html)return html}return'

    '+datetime.getDisplayRunningTime(ticks)+"

    "},view.querySelector(".btnPreviousTrack").addEventListener("click",function(){playbackManager.previousTrack(currentPlayer)}),view.querySelector(".btnPause").addEventListener("click",function(){playbackManager.playPause(currentPlayer)}),view.querySelector(".btnNextTrack").addEventListener("click",function(){playbackManager.nextTrack(currentPlayer)}),btnRewind.addEventListener("click",function(){playbackManager.rewind(currentPlayer)}),btnFastForward.addEventListener("click",function(){playbackManager.fastForward(currentPlayer)}),view.querySelector(".btnAudio").addEventListener("click",showAudioTrackSelection),view.querySelector(".btnSubtitles").addEventListener("click",showSubtitleTrackSelection),browser.touch&&initSwipeEvents()}}); \ No newline at end of file +define(["playbackManager","dom","inputmanager","datetime","itemHelper","mediaInfo","focusManager","imageLoader","scrollHelper","events","connectionManager","browser","globalize","apphost","layoutManager","userSettings","scrollStyles","emby-slider","paper-icon-button-light","css!css/videoosd"],function(playbackManager,dom,inputManager,datetime,itemHelper,mediaInfo,focusManager,imageLoader,scrollHelper,events,connectionManager,browser,globalize,appHost,layoutManager,userSettings){"use strict";function seriesImageUrl(item,options){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){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)):"Primary"===options.type&&item.AlbumId&&item.AlbumPrimaryImageTag?(options.tag=item.AlbumPrimaryImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.AlbumId,options)):null}function logoImageUrl(item,apiClient,options){return options=options||{},options.type="Logo",item.ImageTags&&item.ImageTags.Logo?(options.tag=item.ImageTags.Logo,apiClient.getScaledImageUrl(item.Id,options)):item.ParentLogoImageTag?(options.tag=item.ParentLogoImageTag,apiClient.getScaledImageUrl(item.ParentLogoItemId,options)):null}return function(view,params){function onVerticalSwipe(e,elem,data){var player=currentPlayer;if(player){var deltaY=data.currentDeltaY,windowSize=dom.getWindowSize();if(supportsBrightnessChange&&data.clientX1?view.querySelector(".btnAudio").classList.remove("hide"):view.querySelector(".btnAudio").classList.add("hide")}function setTitle(item,parentName){var url=logoImageUrl(item,connectionManager.getApiClient(item.ServerId),{});if(url){Emby.Page.setTitle("");var pageTitle=document.querySelector(".pageTitle");pageTitle.style.backgroundImage="url('"+url+"')",pageTitle.classList.add("pageTitleWithLogo"),pageTitle.classList.remove("pageTitleWithDefaultLogo"),pageTitle.innerHTML=""}else Emby.Page.setTitle(parentName||"")}function setPoster(item,secondaryItem){var osdPoster=view.querySelector(".osdPoster");if(item){var imgUrl=seriesImageUrl(item,{type:"Primary"})||seriesImageUrl(item,{type:"Thumb"})||imageUrl(item,{type:"Primary"});if(!imgUrl&&secondaryItem&&(imgUrl=seriesImageUrl(secondaryItem,{type:"Primary"})||seriesImageUrl(secondaryItem,{type:"Thumb"})||imageUrl(secondaryItem,{type:"Primary"})),imgUrl)return void(osdPoster.innerHTML='')}osdPoster.innerHTML=""}function showOsd(){slideDownToShow(headerElement),showMainOsdControls(),startOsdHideTimer()}function hideOsd(){slideUpToHide(headerElement),hideMainOsdControls()}function toggleOsd(){"osd"===currentVisibleMenu?hideOsd():currentVisibleMenu||showOsd()}function startOsdHideTimer(){stopOsdHideTimer(),osdHideTimeout=setTimeout(hideOsd,5e3)}function stopOsdHideTimer(){osdHideTimeout&&(clearTimeout(osdHideTimeout),osdHideTimeout=null)}function slideDownToShow(elem){elem.classList.remove("osdHeader-hidden")}function slideUpToHide(elem){elem.classList.add("osdHeader-hidden")}function clearHideAnimationEventListeners(elem){dom.removeEventListener(elem,transitionEndEventName,onHideAnimationComplete,{once:!0})}function onHideAnimationComplete(e){var elem=e.target;elem.classList.add("hide"),dom.removeEventListener(elem,transitionEndEventName,onHideAnimationComplete,{once:!0})}function showMainOsdControls(){if(!currentVisibleMenu){var elem=osdBottomElement;currentVisibleMenu="osd",clearHideAnimationEventListeners(elem),elem.classList.remove("hide"),elem.offsetWidth,elem.classList.remove("videoOsdBottom-hidden"),layoutManager.mobile||setTimeout(function(){focusManager.focus(elem.querySelector(".btnPause"))},50)}}function hideMainOsdControls(){if("osd"===currentVisibleMenu){var elem=osdBottomElement;clearHideAnimationEventListeners(elem),elem.offsetWidth,elem.classList.add("videoOsdBottom-hidden"),dom.addEventListener(elem,transitionEndEventName,onHideAnimationComplete,{once:!0}),currentVisibleMenu=null}}function onPointerMove(e){if("mouse"===(e.pointerType||(layoutManager.mobile?"touch":"mouse"))){var eventX=e.screenX||0,eventY=e.screenY||0,obj=lastPointerMoveData;if(!obj)return void(lastPointerMoveData={x:eventX,y:eventY});if(Math.abs(eventX-obj.x)<10&&Math.abs(eventY-obj.y)<10)return;obj.x=eventX,obj.y=eventY,showOsd()}}function onInputCommand(e){var player=currentPlayer;switch(e.detail.command){case"left":"osd"===currentVisibleMenu?showOsd():currentVisibleMenu||(e.preventDefault(),playbackManager.rewind(player));break;case"right":"osd"===currentVisibleMenu?showOsd():currentVisibleMenu||(e.preventDefault(),playbackManager.fastForward(player));break;case"pageup":playbackManager.unpause(player);break;case"pagedown":playbackManager.pause(player);break;case"up":case"down":case"select":case"menu":case"info":case"play":case"playpause":case"pause":case"fastforward":case"rewind":case"next":case"previous":showOsd();break;case"record":onRecordingCommand(),showOsd();break;case"togglestats":toggleStats()}}function onRecordingCommand(){var btnRecord=view.querySelector(".btnRecord");btnRecord.classList.contains("hide")||btnRecord.click()}function updateFullscreenIcon(){playbackManager.isFullscreen(currentPlayer)?(view.querySelector(".btnFullscreen").setAttribute("title",globalize.translate("ExitFullscreen")),view.querySelector(".btnFullscreen i").innerHTML=""):(view.querySelector(".btnFullscreen").setAttribute("title",globalize.translate("Fullscreen")),view.querySelector(".btnFullscreen i").innerHTML="")}function onPlayerChange(){bindToPlayer(playbackManager.getCurrentPlayer())}function onStateChanged(event,state){var player=this;state.NowPlayingItem&&(isEnabled=!0,updatePlayerStateInternal(event,player,state),updatePlaylist(player),enableStopOnBack(!0))}function onPlayPauseStateChanged(e){if(isEnabled){updatePlayPauseState(this.paused())}}function onVolumeChanged(e){if(isEnabled){var player=this;updatePlayerVolumeState(player,player.isMuted(),player.getVolume())}}function onPlaybackStart(e,state){console.log("nowplaying event: "+e.type);var player=this;onStateChanged.call(player,e,state),resetUpNextDialog()}function resetUpNextDialog(){comingUpNextDisplayed=!1;var dlg=currentUpNextDialog;dlg&&(dlg.destroy(),currentUpNextDialog=null)}function onPlaybackStopped(e,state){currentRuntimeTicks=null,resetUpNextDialog(),console.log("nowplaying event: "+e.type),"Video"!==state.NextMediaType&&(view.removeEventListener("viewbeforehide",onViewHideStopPlayback),Emby.Page.back())}function onMediaStreamsChanged(e){var player=this,state=playbackManager.getPlayerState(player);onStateChanged.call(player,{type:"init"},state)}function bindToPlayer(player){if(player!==currentPlayer&&(releaseCurrentPlayer(),currentPlayer=player,player)){var state=playbackManager.getPlayerState(player);onStateChanged.call(player,{type:"init"},state),events.on(player,"playbackstart",onPlaybackStart),events.on(player,"playbackstop",onPlaybackStopped),events.on(player,"volumechange",onVolumeChanged),events.on(player,"pause",onPlayPauseStateChanged),events.on(player,"unpause",onPlayPauseStateChanged),events.on(player,"timeupdate",onTimeUpdate),events.on(player,"fullscreenchange",updateFullscreenIcon),events.on(player,"mediastreamschange",onMediaStreamsChanged),resetUpNextDialog()}}function releaseCurrentPlayer(){destroyStats(),resetUpNextDialog();var player=currentPlayer;player&&(events.off(player,"playbackstart",onPlaybackStart),events.off(player,"playbackstop",onPlaybackStopped),events.off(player,"volumechange",onVolumeChanged),events.off(player,"pause",onPlayPauseStateChanged),events.off(player,"unpause",onPlayPauseStateChanged),events.off(player,"timeupdate",onTimeUpdate),events.off(player,"fullscreenchange",updateFullscreenIcon),events.off(player,"mediastreamschange",onMediaStreamsChanged),currentPlayer=null)}function onTimeUpdate(e){if(isEnabled){var now=(new Date).getTime();if(!(now-lastUpdateTime<700)){lastUpdateTime=now;var player=this;currentRuntimeTicks=playbackManager.duration(player);var currentTime=playbackManager.currentTime(player);updateTimeDisplay(currentTime,currentRuntimeTicks,playbackManager.playbackStartTime(player),playbackManager.getBufferedRanges(player));var item=currentItem;refreshProgramInfoIfNeeded(player,item),showComingUpNextIfNeeded(player,item,currentTime,currentRuntimeTicks)}}}function showComingUpNextIfNeeded(player,currentItem,currentTimeTicks,runtimeTicks){if(runtimeTicks&¤tTimeTicks&&!comingUpNextDisplayed&&!currentVisibleMenu&&"Episode"===currentItem.Type&&userSettings.enableNextVideoInfoOverlay()){var showAtSecondsLeft=runtimeTicks>=3e10?40:runtimeTicks>=24e9?35:30,showAtTicks=runtimeTicks-1e3*showAtSecondsLeft*1e4,timeRemainingTicks=runtimeTicks-currentTimeTicks;currentTimeTicks>=showAtTicks&&runtimeTicks>=6e9&&timeRemainingTicks>=2e8&&showComingUpNext(player)}}function onUpNextHidden(){"upnext"===currentVisibleMenu&&(currentVisibleMenu=null)}function showComingUpNext(player){require(["upNextDialog"],function(UpNextDialog){currentVisibleMenu||currentUpNextDialog||(currentVisibleMenu="upnext",comingUpNextDisplayed=!0,playbackManager.nextItem(player).then(function(nextItem){currentUpNextDialog=new UpNextDialog({parent:view.querySelector(".upNextContainer"),player:player,nextItem:nextItem}),events.on(currentUpNextDialog,"hide",onUpNextHidden)},onUpNextHidden))})}function refreshProgramInfoIfNeeded(player,item){if("TvChannel"===item.Type){var program=item.CurrentProgram;if(program&&program.EndDate)try{var endDate=datetime.parseISO8601Date(program.EndDate);if((new Date).getTime()>=endDate.getTime()){console.log("program info needs to be refreshed");var state=playbackManager.getPlayerState(player);onStateChanged.call(player,{type:"init"},state)}}catch(e){console.log("Error parsing date: "+program.EndDate)}}}function updatePlayPauseState(isPaused){view.querySelector(".btnPause i").innerHTML=isPaused?"":""}function updatePlayerStateInternal(event,player,state){var playState=state.PlayState||{};updatePlayPauseState(playState.IsPaused);var supportedCommands=playbackManager.getSupportedCommands(player);currentPlayerSupportedCommands=supportedCommands,supportsBrightnessChange=-1!==supportedCommands.indexOf("SetBrightness"),updatePlayerVolumeState(player,playState.IsMuted,playState.VolumeLevel),nowPlayingPositionSlider&&!nowPlayingPositionSlider.dragging&&(nowPlayingPositionSlider.disabled=!playState.CanSeek),btnFastForward.disabled=!playState.CanSeek,btnRewind.disabled=!playState.CanSeek;var nowPlayingItem=state.NowPlayingItem||{};playbackStartTimeTicks=playState.PlaybackStartTimeTicks,updateTimeDisplay(playState.PositionTicks,nowPlayingItem.RunTimeTicks,playState.PlaybackStartTimeTicks,playState.BufferedRanges||[]),updateNowPlayingInfo(player,state),state.MediaSource&&state.MediaSource.SupportsTranscoding&&-1!==supportedCommands.indexOf("SetMaxStreamingBitrate")?view.querySelector(".btnVideoOsdSettings").classList.remove("hide"):view.querySelector(".btnVideoOsdSettings").classList.add("hide");var isProgressClear=state.MediaSource&&null==state.MediaSource.RunTimeTicks;nowPlayingPositionSlider.setIsClear(isProgressClear),-1===supportedCommands.indexOf("ToggleFullscreen")||player.isLocalPlayer&&layoutManager.tv&&playbackManager.isFullscreen(player)?view.querySelector(".btnFullscreen").classList.add("hide"):view.querySelector(".btnFullscreen").classList.remove("hide"),-1===supportedCommands.indexOf("PictureInPicture")?view.querySelector(".btnPip").classList.add("hide"):view.querySelector(".btnPip").classList.remove("hide"),updateFullscreenIcon()}function getDisplayPercentByTimeOfDay(programStartDateMs,programRuntimeMs,currentTimeMs){return(currentTimeMs-programStartDateMs)/programRuntimeMs*100}function updateTimeDisplay(positionTicks,runtimeTicks,playbackStartTimeTicks,bufferedRanges){if(enableProgressByTimeOfDay){if(nowPlayingPositionSlider&&!nowPlayingPositionSlider.dragging)if(programStartDateMs&&programEndDateMs){var currentTimeMs=(playbackStartTimeTicks+(positionTicks||0))/1e4,programRuntimeMs=programEndDateMs-programStartDateMs;if(nowPlayingPositionSlider.value=getDisplayPercentByTimeOfDay(programStartDateMs,programRuntimeMs,currentTimeMs),bufferedRanges.length){var rangeStart=getDisplayPercentByTimeOfDay(programStartDateMs,programRuntimeMs,(playbackStartTimeTicks+(bufferedRanges[0].start||0))/1e4),rangeEnd=getDisplayPercentByTimeOfDay(programStartDateMs,programRuntimeMs,(playbackStartTimeTicks+(bufferedRanges[0].end||0))/1e4);nowPlayingPositionSlider.setBufferedRanges([{start:rangeStart,end:rangeEnd}])}else nowPlayingPositionSlider.setBufferedRanges([])}else nowPlayingPositionSlider.value=0,nowPlayingPositionSlider.setBufferedRanges([]);nowPlayingPositionText.innerHTML="",nowPlayingDurationText.innerHTML=""}else{if(nowPlayingPositionSlider&&!nowPlayingPositionSlider.dragging){if(runtimeTicks){var pct=positionTicks/runtimeTicks;pct*=100,nowPlayingPositionSlider.value=pct}else nowPlayingPositionSlider.value=0;runtimeTicks&&null!=positionTicks&¤tRuntimeTicks&&!enableProgressByTimeOfDay&¤tItem.RunTimeTicks&&"Recording"!==currentItem.Type?endsAtText.innerHTML="  -  "+mediaInfo.getEndsAtFromPosition(runtimeTicks,positionTicks,!0):endsAtText.innerHTML=""}nowPlayingPositionSlider&&nowPlayingPositionSlider.setBufferedRanges(bufferedRanges,runtimeTicks,positionTicks),updateTimeText(nowPlayingPositionText,positionTicks),updateTimeText(nowPlayingDurationText,runtimeTicks,!0)}}function updatePlayerVolumeState(player,isMuted,volumeLevel){var supportedCommands=currentPlayerSupportedCommands,showMuteButton=!0,showVolumeSlider=!0;-1===supportedCommands.indexOf("Mute")&&(showMuteButton=!1),-1===supportedCommands.indexOf("SetVolume")&&(showVolumeSlider=!1),player.isLocalPlayer&&appHost.supports("physicalvolumecontrol")&&(showMuteButton=!1,showVolumeSlider=!1),isMuted?(view.querySelector(".buttonMute").setAttribute("title",globalize.translate("Unmute")),view.querySelector(".buttonMute i").innerHTML=""):(view.querySelector(".buttonMute").setAttribute("title",globalize.translate("Mute")),view.querySelector(".buttonMute i").innerHTML=""),showMuteButton?view.querySelector(".buttonMute").classList.remove("hide"):view.querySelector(".buttonMute").classList.add("hide"),nowPlayingVolumeSlider&&(showVolumeSlider?nowPlayingVolumeSliderContainer.classList.remove("hide"):nowPlayingVolumeSliderContainer.classList.add("hide"),nowPlayingVolumeSlider.dragging||(nowPlayingVolumeSlider.value=volumeLevel||0))}function updatePlaylist(player){var btnPreviousTrack=view.querySelector(".btnPreviousTrack"),btnNextTrack=view.querySelector(".btnNextTrack");btnPreviousTrack.classList.remove("hide"),btnNextTrack.classList.remove("hide"),btnNextTrack.disabled=!1,btnPreviousTrack.disabled=!1}function updateTimeText(elem,ticks,divider){if(null==ticks)return void(elem.innerHTML="");var html=datetime.getDisplayRunningTime(ticks);divider&&(html=" / "+html),elem.innerHTML=html}function onSettingsButtonClick(e){var btn=this;require(["playerSettingsMenu"],function(playerSettingsMenu){var player=currentPlayer;player&&playerSettingsMenu.show({mediaType:"Video",player:player,positionTo:btn,stats:!0,onOption:onSettingsOption})})}function onSettingsOption(selectedOption){"stats"===selectedOption&&toggleStats()}function toggleStats(){require(["playerStats"],function(PlayerStats){var player=currentPlayer;player&&(statsOverlay?statsOverlay.toggle():statsOverlay=new PlayerStats({player:player}))})}function destroyStats(){statsOverlay&&(statsOverlay.destroy(),statsOverlay=null)}function showAudioTrackSelection(){var player=currentPlayer,audioTracks=playbackManager.audioTracks(player),currentIndex=playbackManager.getAudioStreamIndex(player),menuItems=audioTracks.map(function(stream){var opt={name:stream.DisplayTitle,id:stream.Index};return stream.Index===currentIndex&&(opt.selected=!0),opt}),positionTo=this;require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,title:globalize.translate("Audio"),positionTo:positionTo}).then(function(id){var index=parseInt(id);index!==currentIndex&&playbackManager.setAudioStreamIndex(index,player)})})}function showSubtitleTrackSelection(){var player=currentPlayer,streams=playbackManager.subtitleTracks(player),currentIndex=playbackManager.getSubtitleStreamIndex(player);null==currentIndex&&(currentIndex=-1),streams.unshift({Index:-1,DisplayTitle:globalize.translate("Off")});var menuItems=streams.map(function(stream){var opt={name:stream.DisplayTitle,id:stream.Index};return stream.Index===currentIndex&&(opt.selected=!0),opt}),positionTo=this;require(["actionsheet"],function(actionsheet){actionsheet.show({title:globalize.translate("Subtitles"),items:menuItems,positionTo:positionTo}).then(function(id){var index=parseInt(id);index!==currentIndex&&playbackManager.setSubtitleStreamIndex(index,player)})})}function onWindowKeyDown(e){if(!currentVisibleMenu&&(32===e.keyCode||13===e.keyCode))return playbackManager.playPause(currentPlayer),void showOsd();switch(e.key){case"f":e.ctrlKey||playbackManager.toggleFullscreen(currentPlayer);break;case"m":playbackManager.toggleMute(currentPlayer);break;case"ArrowLeft":case"Left":case"NavigationLeft":case"GamepadDPadLeft":case"GamepadLeftThumbstickLeft":e.shiftKey&&playbackManager.rewind(currentPlayer);break;case"ArrowRight":case"Right":case"NavigationRight":case"GamepadDPadRight":case"GamepadLeftThumbstickRight":e.shiftKey&&playbackManager.fastForward(currentPlayer)}}function getImgUrl(item,chapter,index,maxWidth,apiClient){return chapter.ImageTag?apiClient.getScaledImageUrl(item.Id,{maxWidth:maxWidth,tag:chapter.ImageTag,type:"Chapter",index:index}):null}function getChapterBubbleHtml(apiClient,item,chapters,positionTicks){for(var chapter,index=-1,i=0,length=chapters.length;i=currentChapter.StartPositionTicks&&(chapter=currentChapter,index=i)}if(!chapter)return null;var src=getImgUrl(item,chapter,index,400,apiClient);if(src){var html='
    ';return html+='',html+='
    ',html+='
    ',html+=chapter.Name,html+="
    ",html+='

    ',html+=datetime.getDisplayRunningTime(positionTicks),html+="

    ",html+="
    ",html+="
    "}return null}function onViewHideStopPlayback(){if(playbackManager.isPlayingVideo()){var player=currentPlayer;view.removeEventListener("viewbeforehide",onViewHideStopPlayback),releaseCurrentPlayer(),playbackManager.stop(player)}}function enableStopOnBack(enabled){view.removeEventListener("viewbeforehide",onViewHideStopPlayback),enabled&&playbackManager.isPlayingVideo(currentPlayer)&&view.addEventListener("viewbeforehide",onViewHideStopPlayback)}var currentPlayer,comingUpNextDisplayed,currentUpNextDialog,isEnabled,currentItem,recordingButtonManager,enableProgressByTimeOfDay,supportsBrightnessChange,currentVisibleMenu,statsOverlay,osdHideTimeout,lastPointerMoveData,self=this,currentPlayerSupportedCommands=[],currentRuntimeTicks=0,lastUpdateTime=0,programStartDateMs=0,programEndDateMs=0,playbackStartTimeTicks=0,nowPlayingVolumeSlider=view.querySelector(".osdVolumeSlider"),nowPlayingVolumeSliderContainer=view.querySelector(".osdVolumeSliderContainer"),nowPlayingPositionSlider=view.querySelector(".osdPositionSlider"),nowPlayingPositionText=view.querySelector(".osdPositionText"),nowPlayingDurationText=view.querySelector(".osdDurationText"),startTimeText=view.querySelector(".startTimeText"),endTimeText=view.querySelector(".endTimeText"),endsAtText=view.querySelector(".endsAtText"),btnRewind=view.querySelector(".btnRewind"),btnFastForward=view.querySelector(".btnFastForward"),transitionEndEventName=dom.whichTransitionEvent(),headerElement=document.querySelector(".skinHeader"),osdBottomElement=document.querySelector(".videoOsdBottom-maincontrols");view.addEventListener("viewbeforeshow",function(e){headerElement.classList.add("osdHeader"),Emby.Page.setTransparency("full")}),view.addEventListener("viewshow",function(e){events.on(playbackManager,"playerchange",onPlayerChange),bindToPlayer(playbackManager.getCurrentPlayer()),dom.addEventListener(document,window.PointerEvent?"pointermove":"mousemove",onPointerMove,{passive:!0}),document.body.classList.add("autoScrollY"),showOsd(),inputManager.on(window,onInputCommand),dom.addEventListener(window,"keydown",onWindowKeyDown,{passive:!0})}),view.addEventListener("viewbeforehide",function(){statsOverlay&&statsOverlay.enabled(!1),dom.removeEventListener(window,"keydown",onWindowKeyDown,{passive:!0}),stopOsdHideTimer(),headerElement.classList.remove("osdHeader"),headerElement.classList.remove("osdHeader-hidden"),dom.removeEventListener(document,window.PointerEvent?"pointermove":"mousemove",onPointerMove,{passive:!0}),document.body.classList.remove("autoScrollY"),inputManager.off(window,onInputCommand),events.off(playbackManager,"playerchange",onPlayerChange),releaseCurrentPlayer()}),view.querySelector(".btnFullscreen").addEventListener("click",function(){playbackManager.toggleFullscreen(currentPlayer)}),view.querySelector(".btnPip").addEventListener("click",function(){playbackManager.togglePictureInPicture(currentPlayer)}),view.querySelector(".btnVideoOsdSettings").addEventListener("click",onSettingsButtonClick),view.addEventListener("viewhide",function(){headerElement.classList.remove("hide")}),view.addEventListener("viewdestroy",function(){self.touchHelper&&(self.touchHelper.destroy(),self.touchHelper=null),recordingButtonManager&&(recordingButtonManager.destroy(),recordingButtonManager=null),destroyStats()});var lastPointerDown=0;dom.addEventListener(view,window.PointerEvent?"pointerdown":"click",function(e){if(dom.parentWithClass(e.target,["videoOsdBottom","upNextContainer"]))return void showOsd();var pointerType=e.pointerType||(layoutManager.mobile?"touch":"mouse"),now=(new Date).getTime();switch(pointerType){case"touch":now-lastPointerDown>300&&(lastPointerDown=now,toggleOsd());break;case"mouse":e.button||(playbackManager.playPause(currentPlayer),showOsd());break;default:playbackManager.playPause(currentPlayer),showOsd()}},{passive:!0}),browser.touch&&dom.addEventListener(view,"dblclick",onDoubleClick,{}),view.querySelector(".buttonMute").addEventListener("click",function(){playbackManager.toggleMute(currentPlayer)}),nowPlayingVolumeSlider.addEventListener("change",function(){playbackManager.setVolume(this.value,currentPlayer)}),nowPlayingPositionSlider.addEventListener("change",function(){var player=currentPlayer;if(player){var newPercent=parseFloat(this.value);if(enableProgressByTimeOfDay){var seekAirTimeTicks=newPercent/100*(programEndDateMs-programStartDateMs)*1e4;seekAirTimeTicks+=1e4*programStartDateMs,seekAirTimeTicks-=playbackStartTimeTicks,playbackManager.seek(seekAirTimeTicks,player)}else playbackManager.seekPercent(newPercent,player)}}),nowPlayingPositionSlider.getBubbleHtml=function(value){if(showOsd(),enableProgressByTimeOfDay){if(programStartDateMs&&programEndDateMs){var ms=programEndDateMs-programStartDateMs;ms/=100,ms*=value,ms+=programStartDateMs;return'

    '+getDisplayTimeWithoutAmPm(new Date(parseInt(ms)),!0)+"

    "}return"--:--"}if(!currentRuntimeTicks)return"--:--";var ticks=currentRuntimeTicks;ticks/=100,ticks*=value;var item=currentItem;if(item&&item.Chapters&&item.Chapters.length&&item.Chapters[0].ImageTag){var html=getChapterBubbleHtml(connectionManager.getApiClient(item.ServerId),item,item.Chapters,ticks);if(html)return html}return'

    '+datetime.getDisplayRunningTime(ticks)+"

    "},view.querySelector(".btnPreviousTrack").addEventListener("click",function(){playbackManager.previousTrack(currentPlayer)}),view.querySelector(".btnPause").addEventListener("click",function(){playbackManager.playPause(currentPlayer)}),view.querySelector(".btnNextTrack").addEventListener("click",function(){playbackManager.nextTrack(currentPlayer)}),btnRewind.addEventListener("click",function(){playbackManager.rewind(currentPlayer)}),btnFastForward.addEventListener("click",function(){playbackManager.fastForward(currentPlayer)}),view.querySelector(".btnAudio").addEventListener("click",showAudioTrackSelection),view.querySelector(".btnSubtitles").addEventListener("click",showSubtitleTrackSelection),browser.touch&&function(){require(["touchHelper"],function(TouchHelper){self.touchHelper=new TouchHelper(view,{swipeYThreshold:30,triggerOnMove:!0,preventDefaultOnMove:!0,ignoreTagNames:["BUTTON","INPUT","TEXTAREA"]}),events.on(self.touchHelper,"swipeup",onVerticalSwipe),events.on(self.touchHelper,"swipedown",onVerticalSwipe)})}()}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/wizardagreement.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/wizardagreement.js index dae44d3a59..df69d8388f 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/wizardagreement.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/wizardagreement.js @@ -1 +1 @@ -define(["dom","emby-linkbutton"],function(dom){"use strict";function onSubmit(e){var page=dom.parentWithClass(this,"page");return page.querySelector(".chkAccept").checked?Dashboard.navigate("wizardfinish.html"):Dashboard.alert({message:Globalize.translate("MessagePleaseAcceptTermsOfServiceBeforeContinuing"),title:""}),e.preventDefault(),!1}return function(view,params){view.querySelector(".wizardAgreementForm").addEventListener("submit",onSubmit),view.addEventListener("viewshow",function(){document.querySelector(".skinHeader").classList.add("noHomeButtonHeader")}),view.addEventListener("viewhide",function(){document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader")})}}); \ No newline at end of file +define(["dom","emby-linkbutton"],function(dom){"use strict";function onSubmit(e){return dom.parentWithClass(this,"page").querySelector(".chkAccept").checked?Dashboard.navigate("wizardfinish.html"):Dashboard.alert({message:Globalize.translate("MessagePleaseAcceptTermsOfServiceBeforeContinuing"),title:""}),e.preventDefault(),!1}return function(view,params){view.querySelector(".wizardAgreementForm").addEventListener("submit",onSubmit),view.addEventListener("viewshow",function(){document.querySelector(".skinHeader").classList.add("noHomeButtonHeader")}),view.addEventListener("viewhide",function(){document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader")})}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/wizarduserpage.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/wizarduserpage.js index 00f05e1888..df55ac9e37 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/wizarduserpage.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/wizarduserpage.js @@ -1 +1 @@ -define(["loading","connectHelper","globalize","dashboardcss","emby-input","emby-button","emby-linkbutton"],function(loading,connectHelper,globalize){"use strict";function getApiClient(){return ApiClient}function nextWizardPage(){Dashboard.navigate("wizardlibrary.html")}function onUpdateUserComplete(result){if(loading.hide(),result.UserLinkResult){var msgKey=result.UserLinkResult.IsPending?"MessagePendingEmbyAccountAdded":"MessageEmbyAccountAdded";Dashboard.alert({message:globalize.translate(msgKey),title:globalize.translate("HeaderEmbyAccountAdded"),callback:nextWizardPage})}else nextWizardPage()}function submit(form){loading.show();var apiClient=getApiClient();apiClient.ajax({type:"POST",data:{Name:form.querySelector("#txtUsername").value,ConnectUserName:form.querySelector("#txtConnectUserName").value},url:apiClient.getUrl("Startup/User"),dataType:"json"}).then(onUpdateUserComplete,function(response){response?response.status:0;connectHelper.showLinkUserErrorMessage(form.querySelector("#txtConnectUserName").value)})}function onSubmit(e){var form=this;return submit(form),e.preventDefault(),!1}function onViewShow(){loading.show();var page=this,apiClient=getApiClient();apiClient.getJSON(apiClient.getUrl("Startup/User")).then(function(user){page.querySelector("#txtUsername").value=user.Name||"",page.querySelector("#txtConnectUserName").value=user.ConnectUserName||"",loading.hide()})}return function(view,params){view.querySelector(".wizardUserForm").addEventListener("submit",onSubmit),view.addEventListener("viewshow",function(){document.querySelector(".skinHeader").classList.add("noHomeButtonHeader")}),view.addEventListener("viewhide",function(){document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader")}),view.addEventListener("viewshow",onViewShow)}}); \ No newline at end of file +define(["loading","connectHelper","globalize","dashboardcss","emby-input","emby-button","emby-linkbutton"],function(loading,connectHelper,globalize){"use strict";function getApiClient(){return ApiClient}function nextWizardPage(){Dashboard.navigate("wizardlibrary.html")}function onUpdateUserComplete(result){if(loading.hide(),result.UserLinkResult){var msgKey=result.UserLinkResult.IsPending?"MessagePendingEmbyAccountAdded":"MessageEmbyAccountAdded";Dashboard.alert({message:globalize.translate(msgKey),title:globalize.translate("HeaderEmbyAccountAdded"),callback:nextWizardPage})}else nextWizardPage()}function submit(form){loading.show();var apiClient=getApiClient();apiClient.ajax({type:"POST",data:{Name:form.querySelector("#txtUsername").value,ConnectUserName:form.querySelector("#txtConnectUserName").value},url:apiClient.getUrl("Startup/User"),dataType:"json"}).then(onUpdateUserComplete,function(response){response&&response.status;connectHelper.showLinkUserErrorMessage(form.querySelector("#txtConnectUserName").value)})}function onSubmit(e){return submit(this),e.preventDefault(),!1}function onViewShow(){loading.show();var page=this,apiClient=getApiClient();apiClient.getJSON(apiClient.getUrl("Startup/User")).then(function(user){page.querySelector("#txtUsername").value=user.Name||"",page.querySelector("#txtConnectUserName").value=user.ConnectUserName||"",loading.hide()})}return function(view,params){view.querySelector(".wizardUserForm").addEventListener("submit",onSubmit),view.addEventListener("viewshow",function(){document.querySelector(".skinHeader").classList.add("noHomeButtonHeader")}),view.addEventListener("viewhide",function(){document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader")}),view.addEventListener("viewshow",onViewShow)}}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/ar.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/ar.json index eab0728018..46ad390ad0 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/ar.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/ar.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "\u0627\u0644\u0633\u0627\u0628\u0642", "LabelFinish": "\u0627\u0646\u0647\u0627\u0621", "LabelNext": "\u0627\u0644\u062a\u0627\u0644\u064a", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "\u0645\u0648\u0627\u0641\u0642", "ButtonCancel": "\u0627\u0644\u063a\u0627\u0621", + "HeaderAllRecordings": "\u0643\u0627\u0641\u0629 \u0627\u0644\u062a\u0633\u062c\u064a\u0644\u0627\u062a", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "\u062e\u0631\u0648\u062c", "ButtonNew": "\u062c\u062f\u064a\u062f", "All": "All", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/be-BY.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/be-BY.json index ed084085af..bfff019976 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/be-BY.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/be-BY.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "\u041f\u0430\u043f\u044f\u0440\u044d\u0434\u043d\u044f\u0435", "LabelFinish": "\u0413\u0430\u0442\u043e\u0432\u0430", "LabelNext": "\u041d\u0430\u0441\u0442\u0443\u043f\u043d\u0430\u0435", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "\u041e\u041a", "ButtonCancel": "\u0410\u0434\u043c\u044f\u043d\u0456\u0446\u044c", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "\u0412\u044b\u0439\u0441\u0446\u0456", "ButtonNew": "\u041d\u043e\u0432\u0430\u0435", "All": "All", @@ -82,8 +78,8 @@ "LabelLanguage": "Language:", "LabelTimeLimitHours": "Time limit (hours):", "HeaderPreferredMetadataLanguage": "Preferred Metadata Language", - "LabelSaveLocalMetadata": "Save artwork and metadata into media folders", - "LabelSaveLocalMetadataHelp": "Saving artwork and metadata directly into media folders will put them in a place where they can be easily edited.", + "LabelSaveLocalMetadata": "Save artwork into media folders", + "LabelSaveLocalMetadataHelp": "Saving artwork into media folders will put them in a place where they can be easily edited.", "LabelDownloadInternetMetadata": "Download artwork and metadata from the internet", "LabelDownloadInternetMetadataHelp": "Emby Server can download information about your media to enable rich presentations.", "TabPassword": "Password", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/bg-BG.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/bg-BG.json index 1da4593e90..0f517688ea 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/bg-BG.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/bg-BG.json @@ -1,11 +1,4 @@ { - "Advanced": "\u0420\u0430\u0437\u0448\u0438\u0440\u0435\u043d\u0438", - "Browse": "\u0420\u0430\u0437\u0433\u043b\u0435\u0436\u0434\u0430\u043d\u0435", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "\u041f\u0440\u0435\u0434\u0438\u0448\u0435\u043d", "LabelFinish": "\u0413\u043e\u0442\u043e\u0432\u043e", "LabelNext": "\u0421\u043b\u0435\u0434\u0432\u0430\u0449", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "\u041f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u0449\u0438 \u043d\u043e\u0432\u0438\u043d\u0438", "ButtonOk": "\u0414\u043e\u0431\u0440\u0435", "ButtonCancel": "\u041e\u0442\u043a\u0430\u0437", + "HeaderAllRecordings": "\u0412\u0441\u0438\u0447\u043a\u0438 \u0417\u0430\u043f\u0438\u0441\u0438", + "Advanced": "\u0420\u0430\u0437\u0448\u0438\u0440\u0435\u043d\u0438", + "Browse": "\u0420\u0430\u0437\u0433\u043b\u0435\u0436\u0434\u0430\u043d\u0435", "ButtonExit": "\u0418\u0437\u0445\u043e\u0434", "ButtonNew": "\u041d\u043e\u0432", "All": "\u0412\u0441\u0438\u0447\u043a\u0438", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/ca.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/ca.json index 1439cc23ea..41d4abe6a8 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/ca.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/ca.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Anterior", "LabelFinish": "Finalitzar", "LabelNext": "Seg\u00fcent", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Properes Not\u00edcies", "ButtonOk": "D'acord", "ButtonCancel": "Cancel\u00b7la", + "HeaderAllRecordings": "Totes les Gravacions", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Surt", "ButtonNew": "Nou", "All": "Tot", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/cs.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/cs.json index 1d009ef8b0..fc1a5ad27d 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/cs.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/cs.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "P\u0159edchoz\u00ed", "LabelFinish": "Dokon\u010dit", "LabelNext": "Dal\u0161\u00ed", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "Ok", "ButtonCancel": "Zru\u0161it", + "HeaderAllRecordings": "V\u0161echna nahr\u00e1v\u00e1n\u00ed", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Zav\u0159\u00edt", "ButtonNew": "Nov\u00e9", "All": "V\u0161e", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/da.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/da.json index 0e9f643bf7..2ecade39f7 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/da.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/da.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Forrige", "LabelFinish": "Afslut", "LabelNext": "N\u00e6ste", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "Ok", "ButtonCancel": "Annuller", + "HeaderAllRecordings": "Alle optagelser", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Afslut", "ButtonNew": "Ny", "All": "All", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/de.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/de.json index aaca087bf0..83c7822298 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/de.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/de.json @@ -1,11 +1,4 @@ { - "Advanced": "Erweitert", - "Browse": "Bl\u00e4ttern", - "LabelAllowedRemoteAddresses": "Remote-IP Adressen Filter:", - "AllowedRemoteAddressesHelp": "Kommaseparierte Liste von IP Adressen oder IP-Masken f\u00fcr Netzwerke, f\u00fcr die Remote-Verbindungen erlaubt sind. Wenn leer, sind alle Adressen erlaubt.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Vorheriges", "LabelFinish": "Fertig", "LabelNext": "N\u00e4chstes", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Bevorstehende Nachrichten", "ButtonOk": "Ok", "ButtonCancel": "Abbrechen", + "HeaderAllRecordings": "Alle Aufnahmen", + "Advanced": "Erweitert", + "Browse": "Bl\u00e4ttern", "ButtonExit": "Beenden", "ButtonNew": "Neu", "All": "Alle", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Stelle einen benutzerdefinierten User-Agent HTTP header zur Verf\u00fcgung, wenn n\u00f6tig.", "HeaderConfigureRemoteAccess": "Konfiguriere Remote-Zugriff", "LearnHowToCreateSynologyShares": "Erfahre, wie man Verzeichnisse mit Synology teilt.", + "LabelAllowedRemoteAddresses": "Remote-IP Adressen Filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Kommaseparierte Liste von IP Adressen oder IP-Masken f\u00fcr Netzwerke, f\u00fcr die Remote-Verbindungen erlaubt sind. Wenn leer, sind alle Adressen erlaubt.", "LabelLanNetworks": "Lokale Netzwerke:", "LanNetworksHelp": "Komma separierte Liste von IP Adressen oder IP Masken die als lokale Netzwerke behandelt werden sollen um Bandbreitenlimitationen auszusetzen. Wenn bef\u00fcllt werden alle anderen IP Adressen als externe Netzwerke behandelt und unterliegen den Bandbreitenlimitationen f\u00fcr externe Verbindungen. Wenn leer, wird nur das SubNetz des Servers als Lokales Netz gesetzt-" } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/el.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/el.json index c22467a2b6..b01e875193 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/el.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/el.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "\u03a0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03bf\u03c2", "LabelFinish": "\u03a4\u03ad\u03bb\u03bf\u03c2", "LabelNext": "\u0395\u03c0\u03cc\u03bc\u03b5\u03bd\u03bf", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "\u0395\u03c0\u03b5\u03c1\u03c7\u03cc\u03bc\u03b5\u03bd\u03b1 \u039d\u03ad\u03b1", "ButtonOk": "Ok", "ButtonCancel": "\u0391\u03ba\u03cd\u03c1\u03c9\u03c3\u03b7 ", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "\u0388\u03be\u03bf\u03b4\u03bf\u03c2", "ButtonNew": "\u039d\u03ad\u03bf", "All": "\u038c\u03bb\u03b1", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/en-GB.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/en-GB.json index 1fb6511e32..2d274786f7 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/en-GB.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/en-GB.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Previous", "LabelFinish": "Finish", "LabelNext": "Next", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "Ok", "ButtonCancel": "Cancel", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Exit", "ButtonNew": "New", "All": "All", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/en-US.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/en-US.json index 51ee2c8f13..0d17a3023b 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/en-US.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/en-US.json @@ -1182,6 +1182,7 @@ "ButtonPlaylist": "Playlist", "LabelEnabled": "Enabled", "LabelDisabled": "Disabled", + "Disabled": "Disabled", "ButtonMoreInformation": "More Information", "LabelNoUnreadNotifications": "No unread notifications.", "MessageInvalidUser": "Invalid username or password. Please try again.", @@ -1732,7 +1733,7 @@ "ScanLibrary": "Scan library", "EnableStreamLooping": "Auto-loop live streams", "EnableStreamLoopingHelp": "Enable this if live streams only contain a few seconds of data and need to be continuously requested. Enabling this when not needed may cause problems.", - "HttpsRequiresCert": "To require https for external connections, you will need to supply a trusted SSL certificate, such as Lets Encrypt.", + "HttpsRequiresCert": "To enable https for external connections, you will need to supply a trusted SSL certificate, such as Lets Encrypt.", "HeaderLatestDownloadedVideos": "Latest Downloaded Videos", "ServerRestartNeededAfterPluginInstall": "Emby Server will need to be restarted after installing a plugin.", "PluginInstalledMessage": "The plugin has been successfully installed. Emby Server will need to be restarted for changes to take effect.", @@ -1773,5 +1774,9 @@ "Blacklist": "Blacklist", "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", - "LanNetworksHelp": "Comma separated list of IP addresses or IP/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." + "LanNetworksHelp": "Comma separated list of IP addresses or IP/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network.", + "LabelSecureConnectionsMode": "Secure connection mode:", + "PreferredNotRequired": "Preferred, but not required", + "RequiredForAllRemoteConnections": "Required for all remote connections", + "HandledByProxy": "Handled by reverse proxy" } diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/es-AR.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/es-AR.json index 763b5566ca..bd3cd65639 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/es-AR.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/es-AR.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Anterior", "LabelFinish": "Terminar", "LabelNext": "Siguiente", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "Ok", "ButtonCancel": "Cancel", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Exit", "ButtonNew": "New", "All": "All", @@ -82,8 +78,8 @@ "LabelLanguage": "Language:", "LabelTimeLimitHours": "Time limit (hours):", "HeaderPreferredMetadataLanguage": "Preferred Metadata Language", - "LabelSaveLocalMetadata": "Save artwork and metadata into media folders", - "LabelSaveLocalMetadataHelp": "Saving artwork and metadata directly into media folders will put them in a place where they can be easily edited.", + "LabelSaveLocalMetadata": "Save artwork into media folders", + "LabelSaveLocalMetadataHelp": "Saving artwork into media folders will put them in a place where they can be easily edited.", "LabelDownloadInternetMetadata": "Download artwork and metadata from the internet", "LabelDownloadInternetMetadataHelp": "Emby Server can download information about your media to enable rich presentations.", "TabPassword": "Password", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/es-MX.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/es-MX.json index 9afae92180..734baafb1b 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/es-MX.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/es-MX.json @@ -1,11 +1,4 @@ { - "Advanced": "Avanzado", - "Browse": "Navegar", - "LabelAllowedRemoteAddresses": "Filtrar IP remota:", - "AllowedRemoteAddressesHelp": "Lista separada por comas de direcciones IP\/mascaras de subred para las redes a las que se les permitir\u00e1 conectarse remotamente. Si se deja en blanco, todas las IP remotas ser\u00e1n permitidas.", - "LabelAllowedRemoteAddressesMode": "Modo de filtrado de IP remota:", - "Whitelist": "Permitidos", - "Blacklist": "Bloqueados", "LabelPrevious": "Anterior", "LabelFinish": "Terminar", "LabelNext": "Siguiente", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Noticias Recientes", "ButtonOk": "Ok", "ButtonCancel": "Cancelar", + "HeaderAllRecordings": "Todas las Grabaciones", + "Advanced": "Avanzado", + "Browse": "Navegar", "ButtonExit": "Salir", "ButtonNew": "Nuevo", "All": "Todos", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Suministre un agente de encabezado http personalizado, si fuera necesario.", "HeaderConfigureRemoteAccess": "Configurar Acceso Remoto", "LearnHowToCreateSynologyShares": "Aprenda como compartir carpetas en Synology.", + "LabelAllowedRemoteAddresses": "Filtrar IP remota:", + "LabelAllowedRemoteAddressesMode": "Modo de filtrado de IP remota:", + "Whitelist": "Permitidos", + "Blacklist": "Bloqueados", + "AllowedRemoteAddressesHelp": "Lista separada por comas de direcciones IP\/mascaras de subred para las redes a las que se les permitir\u00e1 conectarse remotamente. Si se deja en blanco, todas las IP remotas ser\u00e1n permitidas.", "LabelLanNetworks": "Redes LAN:", "LanNetworksHelp": "Lista separada por comas de direcciones IP\/mascaras de subred para las redes que ser\u00e1n consideradas como locales al enforzar restricciones de ancho de banda. Si se establece, todas las dem\u00e1s direcciones IP ser\u00e1n consideradas como redes externas y estar\u00e1n sujetas a restricciones de ancho de banda. Si se deja en blanco, s\u00f3lo la subred del servidor ser\u00e1 considerada como red local." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/es.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/es.json index 8937cdcc1d..79d34eae95 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/es.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/es.json @@ -1,11 +1,4 @@ { - "Advanced": "Avanzado", - "Browse": "Explorar", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Anterior", "LabelFinish": "Terminar", "LabelNext": "Siguiente", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Pr\u00f3ximas Noticias", "ButtonOk": "OK", "ButtonCancel": "Cancelar", + "HeaderAllRecordings": "Todas la grabaciones", + "Advanced": "Avanzado", + "Browse": "Explorar", "ButtonExit": "Salir", "ButtonNew": "Nuevo", "All": "Todo", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Proporciona una cabecera http personalizada de agente-usuario, si es necesario.", "HeaderConfigureRemoteAccess": "Configurar acceso remoto", "LearnHowToCreateSynologyShares": "Aprende a compartir carpetas en Synology", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "Redes locales:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/fa.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/fa.json index 6554b78e43..798527d538 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/fa.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/fa.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "\u0642\u0628\u0644\u06cc", "LabelFinish": "\u067e\u0627\u06cc\u0627\u0646", "LabelNext": "\u0628\u0639\u062f\u06cc", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "\u062e\u0648\u0628", "ButtonCancel": "\u0644\u063a\u0648 \u06a9\u0631\u062f\u0646", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "\u062e\u0631\u0648\u062c", "ButtonNew": "\u062c\u062f\u06cc\u062f", "All": "\u0647\u0645\u0647", @@ -83,7 +79,7 @@ "LabelTimeLimitHours": "\u0645\u062d\u062f\u0648\u062f\u06cc\u062a \u0632\u0645\u0627\u0646 (\u0633\u0627\u0639\u062a):", "HeaderPreferredMetadataLanguage": "\u0632\u0628\u0627\u0646 \u0645\u062f\u0646\u0638\u0631 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0645\u062d\u062a\u0648\u06cc", "LabelSaveLocalMetadata": "\u067e\u0648\u0633\u062a\u0631 \u0648 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0645\u062d\u062a\u0648\u06cc \u062f\u0631 \u067e\u0648\u0634\u0647 \u0645\u062f\u06cc\u0627 \u0630\u062e\u06cc\u0631\u0647 \u06af\u0631\u062f\u062f", - "LabelSaveLocalMetadataHelp": "Saving artwork and metadata directly into media folders will put them in a place where they can be easily edited.", + "LabelSaveLocalMetadataHelp": "Saving artwork into media folders will put them in a place where they can be easily edited.", "LabelDownloadInternetMetadata": "\u067e\u0648\u0633\u062a\u0631 \u0648 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0645\u062d\u062a\u0648\u06cc \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0646\u062a \u062f\u0627\u0646\u0644\u0648\u062f \u0634\u0648\u062f", "LabelDownloadInternetMetadataHelp": "Emby Server can download information about your media to enable rich presentations.", "TabPassword": "\u0631\u0645\u0632 \u0639\u0628\u0648\u0631", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/fi.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/fi.json index f5c04d9891..3eae927140 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/fi.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/fi.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Edellinen", "LabelFinish": "Valmis", "LabelNext": "Seuraava", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "Ok", "ButtonCancel": "Lopeta", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Exit", "ButtonNew": "New", "All": "All", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/fr-CA.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/fr-CA.json index c0a771c435..8c9d499f00 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/fr-CA.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/fr-CA.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Pr\u00e9c\u00e9dent", "LabelFinish": "Terminer", "LabelNext": "Suivant", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "Ok", "ButtonCancel": "Cancel", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Exit", "ButtonNew": "New", "All": "All", @@ -82,8 +78,8 @@ "LabelLanguage": "Language:", "LabelTimeLimitHours": "Time limit (hours):", "HeaderPreferredMetadataLanguage": "Preferred Metadata Language", - "LabelSaveLocalMetadata": "Save artwork and metadata into media folders", - "LabelSaveLocalMetadataHelp": "Saving artwork and metadata directly into media folders will put them in a place where they can be easily edited.", + "LabelSaveLocalMetadata": "Save artwork into media folders", + "LabelSaveLocalMetadataHelp": "Saving artwork into media folders will put them in a place where they can be easily edited.", "LabelDownloadInternetMetadata": "Download artwork and metadata from the internet", "LabelDownloadInternetMetadataHelp": "Emby Server can download information about your media to enable rich presentations.", "TabPassword": "Password", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/fr.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/fr.json index 99069e9962..3f6bb83b54 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/fr.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/fr.json @@ -1,11 +1,4 @@ { - "Advanced": "Avanc\u00e9", - "Browse": "Parcourir", - "LabelAllowedRemoteAddresses": "Filtre d'adresse IP distante", - "AllowedRemoteAddressesHelp": "Liste d'adresses IP ou d'IP\/masque de sous-r\u00e9seau s\u00e9par\u00e9es par des virgules qui seront autoris\u00e9es \u00e0 se connecter \u00e0 distance. Si la liste est vide, toutes les adresses distantes seront autoris\u00e9es.", - "LabelAllowedRemoteAddressesMode": "Type de filtre des adresses IP distantes :", - "Whitelist": "Liste blanche", - "Blacklist": "Liste noire", "LabelPrevious": "Pr\u00e9c\u00e9dent", "LabelFinish": "Terminer", "LabelNext": "Suivant", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Actualit\u00e9s \u00e0 venir", "ButtonOk": "Ok", "ButtonCancel": "Annuler", + "HeaderAllRecordings": "Tous les enregistrements", + "Advanced": "Avanc\u00e9", + "Browse": "Parcourir", "ButtonExit": "Quitter", "ButtonNew": "Nouveau", "All": "Tout", @@ -82,8 +78,8 @@ "LabelLanguage": "Langue:", "LabelTimeLimitHours": "Limite de temps (heures) :", "HeaderPreferredMetadataLanguage": "Langue de m\u00e9tadonn\u00e9es pr\u00e9f\u00e9r\u00e9e", - "LabelSaveLocalMetadata": "Enregistrer les images et m\u00e9tadonn\u00e9es dans les dossiers multim\u00e9dia", - "LabelSaveLocalMetadataHelp": "L'enregistrement des images et des m\u00e9tadonn\u00e9es dans les dossiers multim\u00e9dia les placera \u00e0 un endroit o\u00f9 elles seront facilement modifiables.", + "LabelSaveLocalMetadata": "Enregistrer les images dans les dossiers multim\u00e9dia", + "LabelSaveLocalMetadataHelp": "L'enregistrement des images dans les dossiers multim\u00e9dia les placera \u00e0 un endroit o\u00f9 elles seront facilement modifiables.", "LabelDownloadInternetMetadata": "T\u00e9l\u00e9charger les images et m\u00e9tadonn\u00e9es depuis Internet", "LabelDownloadInternetMetadataHelp": "Le serveur Emby peut t\u00e9l\u00e9charger les informations des m\u00e9dias pour enrichir la pr\u00e9sentation.", "TabPassword": "Mot de passe", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Fournissez un en-t\u00eate http user agent personnalis\u00e9, si n\u00e9cessaire.", "HeaderConfigureRemoteAccess": "Configurer l'acc\u00e8s distant", "LearnHowToCreateSynologyShares": "Apprenez \u00e0 partager des dossiers dans Synology.", + "LabelAllowedRemoteAddresses": "Filtre d'adresse IP distante", + "LabelAllowedRemoteAddressesMode": "Type de filtre des adresses IP distantes :", + "Whitelist": "Liste blanche", + "Blacklist": "Liste noire", + "AllowedRemoteAddressesHelp": "Liste d'adresses IP ou d'IP\/masque de sous-r\u00e9seau s\u00e9par\u00e9es par des virgules qui seront autoris\u00e9es \u00e0 se connecter \u00e0 distance. Si la liste est vide, toutes les adresses distantes seront autoris\u00e9es.", "LabelLanNetworks": "R\u00e9seaux LAN :", "LanNetworksHelp": "Liste des adresses IP ou des entr\u00e9es IP\/masque de r\u00e9seau s\u00e9par\u00e9es par des virgules pour les r\u00e9seaux qui seront consid\u00e9r\u00e9s comme locaux lors de l'application des restrictions de bande passante. Si elle est d\u00e9finie, toutes les autres adresses IP seront consid\u00e9r\u00e9es sur le r\u00e9seau externe et seront soumises aux restrictions de bande passante externe. Si elle est vide, seul le sous-r\u00e9seau du serveur est consid\u00e9r\u00e9 comme se trouvant sur le r\u00e9seau local." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/gsw.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/gsw.json index 078d977ea4..fb315f5d72 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/gsw.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/gsw.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Vorher", "LabelFinish": "Beende", "LabelNext": "N\u00f6chst", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "OK", "ButtonCancel": "Abbreche", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Verlasse", "ButtonNew": "Neu", "All": "All", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/he.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/he.json index df424782df..89cce3ff62 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/he.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/he.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "\u05d4\u05e7\u05d5\u05d3\u05dd", "LabelFinish": "\u05e1\u05d9\u05d9\u05dd", "LabelNext": "\u05d4\u05d1\u05d0", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "\u05d0\u05e9\u05e8", "ButtonCancel": "\u05d1\u05d8\u05dc", + "HeaderAllRecordings": "\u05db\u05dc \u05d4\u05d4\u05e7\u05dc\u05d8\u05d5\u05ea", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "\u05d9\u05e6\u05d9\u05d0\u05d4", "ButtonNew": "\u05d7\u05d3\u05e9", "All": "\u05d4\u05db\u05dc", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/hi-IN.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/hi-IN.json index f0c2f76f4c..ca88c9f78e 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/hi-IN.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/hi-IN.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "\u092a\u093f\u091b\u0932\u093e", "LabelFinish": "\u0938\u092e\u093e\u092a\u094d\u0924", "LabelNext": "\u0905\u0917\u0932\u093e", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "Ok", "ButtonCancel": "Cancel", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Exit", "ButtonNew": "New", "All": "All", @@ -82,8 +78,8 @@ "LabelLanguage": "Language:", "LabelTimeLimitHours": "Time limit (hours):", "HeaderPreferredMetadataLanguage": "Preferred Metadata Language", - "LabelSaveLocalMetadata": "Save artwork and metadata into media folders", - "LabelSaveLocalMetadataHelp": "Saving artwork and metadata directly into media folders will put them in a place where they can be easily edited.", + "LabelSaveLocalMetadata": "Save artwork into media folders", + "LabelSaveLocalMetadataHelp": "Saving artwork into media folders will put them in a place where they can be easily edited.", "LabelDownloadInternetMetadata": "Download artwork and metadata from the internet", "LabelDownloadInternetMetadataHelp": "Emby Server can download information about your media to enable rich presentations.", "TabPassword": "Password", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/hr.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/hr.json index ad9e837371..79ea18aa1d 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/hr.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/hr.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Prethodni", "LabelFinish": "Kraj", "LabelNext": "Sljede\u0107i", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "U redu", "ButtonCancel": "Odustani", + "HeaderAllRecordings": "Sve snimke", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Izlaz", "ButtonNew": "Novo", "All": "All", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/hu.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/hu.json index 36fbe8ec7e..c7db6480a6 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/hu.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/hu.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "El\u0151z\u0151", "LabelFinish": "Befejez", "LabelNext": "K\u00f6vetkez\u0151", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "Ok", "ButtonCancel": "M\u00e9gsem", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Kil\u00e9p\u00e9s", "ButtonNew": "\u00daj", "All": "\u00d6sszes", @@ -82,8 +78,8 @@ "LabelLanguage": "Nyelv:", "LabelTimeLimitHours": "Id\u0151limit (\u00f3ra):", "HeaderPreferredMetadataLanguage": "Els\u0151dleges metaadat nyelv", - "LabelSaveLocalMetadata": "Save artwork and metadata into media folders", - "LabelSaveLocalMetadataHelp": "Saving artwork and metadata directly into media folders will put them in a place where they can be easily edited.", + "LabelSaveLocalMetadata": "Save artwork into media folders", + "LabelSaveLocalMetadataHelp": "Saving artwork into media folders will put them in a place where they can be easily edited.", "LabelDownloadInternetMetadata": "Download artwork and metadata from the internet", "LabelDownloadInternetMetadataHelp": "Emby Server can download information about your media to enable rich presentations.", "TabPassword": "Jelsz\u00f3", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/id.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/id.json index c397c8c145..268d39d398 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/id.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/id.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Sebelumnya", "LabelFinish": "Selesai", "LabelNext": "Berikutnya", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "Ok", "ButtonCancel": "Cancel", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Keluar", "ButtonNew": "New", "All": "All", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/it.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/it.json index 7e3e38014b..0a21e9c5de 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/it.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/it.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Precedente", "LabelFinish": "Finito", "LabelNext": "Prossimo", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Notizie in Arrivo", "ButtonOk": "Ok", "ButtonCancel": "Annulla", + "HeaderAllRecordings": "Tutte le registrazioni", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Esci", "ButtonNew": "Nuovo", "All": "Tutti", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Fornire un'intestazione http personalizzata per utente-agente, se necessario.", "HeaderConfigureRemoteAccess": "Configura Accesso Remoto", "LearnHowToCreateSynologyShares": "Scopri come condividere cartelle in Synology", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "Reti LAN:", "LanNetworksHelp": "Elenco separato da virgola di indirizzi IP o voci IP \/ maschera di rete per reti che saranno considerate sulla rete locale quando si applicano restrizioni di larghezza di banda. Se impostato, tutti gli altri indirizzi IP verranno considerati nella rete esterna e saranno soggetti alle limitazioni della larghezza di banda esterna. Se lasciato vuoto, solo la sottorete del server viene considerata nella rete locale." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/kk.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/kk.json index 5cae361c41..0d2d3ed313 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/kk.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/kk.json @@ -1,11 +1,4 @@ { - "Advanced": "\u041a\u0435\u04a3\u0435\u0439\u0442\u0456\u043b\u0433\u0435\u043d", - "Browse": "\u0428\u0430\u0440\u043b\u0430\u0443", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "\u0410\u043b\u0434\u044b\u04a3\u0493\u044b", "LabelFinish": "\u0410\u044f\u049b\u0442\u0430\u0443", "LabelNext": "\u041a\u0435\u043b\u0435\u0441\u0456", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "\u041a\u04af\u0442\u0456\u043b\u0433\u0435\u043d \u0436\u0430\u04a3\u0430\u043b\u044b\u049b\u0442\u0430\u0440", "ButtonOk": "\u0416\u0430\u0440\u0430\u0439\u0434\u044b", "ButtonCancel": "\u0411\u043e\u043b\u0434\u044b\u0440\u043c\u0430\u0443", + "HeaderAllRecordings": "\u0411\u0430\u0440\u043b\u044b\u049b \u0436\u0430\u0437\u0431\u0430\u043b\u0430\u0440", + "Advanced": "\u041a\u0435\u04a3\u0435\u0439\u0442\u0456\u043b\u0433\u0435\u043d", + "Browse": "\u0428\u0430\u0440\u043b\u0430\u0443", "ButtonExit": "\u0428\u044b\u0493\u0443", "ButtonNew": "\u0416\u0430\u0441\u0430\u0443", "All": "\u0411\u04d9\u0440\u0456", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "\u049a\u0430\u0436\u0435\u0442 \u0431\u043e\u043b\u0441\u0430, \u0442\u0435\u04a3\u0448\u0435\u043b\u0435\u0442\u0456\u043d \u043f\u0430\u0439\u0434\u0430\u043b\u0430\u043d\u0443\u0448\u044b \u0430\u0433\u0435\u043d\u0442\u0456\u043d\u0435 HTTP \u0431\u0430\u0441 \u0434\u0435\u0440\u0435\u043a\u0442\u0435\u043c\u0435\u0441\u0456\u043d \u0436\u0435\u0442\u043a\u0456\u0437\u0443.", "HeaderConfigureRemoteAccess": "\u049a\u0430\u0448\u044b\u049b\u0442\u0430\u043d \u049b\u0430\u0442\u044b\u043d\u0430\u0443\u0434\u044b \u0442\u0435\u04a3\u0448\u0435\u0443", "LearnHowToCreateSynologyShares": "Synology \u049b\u0430\u043b\u0442\u0430\u043b\u0430\u0440\u044b\u043c\u0435\u043d \u0431\u043e\u043b\u0456\u0441\u0443\u0434\u0456 \u0431\u0456\u043b\u0443.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "\u04ae\u0439\u0434\u0435\u0433\u0456 \u0436\u0435\u043b\u0456\u043b\u0435\u0440:", "LanNetworksHelp": "\u04ae\u0442\u0456\u0440\u043b\u0435\u0440\u043c\u0435\u043d \u0431\u04e9\u043b\u0456\u043d\u0433\u0435\u043d IP-\u043c\u0435\u043a\u0435\u043d\u0436\u0430\u0439\u043b\u0430\u0440\u044b\u043d\u044b\u04a3 \u0442\u0456\u0437\u0431\u0435\u0441\u0456 \u043d\u0435\u043c\u0435\u0441\u0435 IP\/netmask \u0436\u0430\u0437\u0431\u0430\u043b\u0430\u0440, \u043e\u043b\u0430\u0440 \u04e9\u0442\u043a\u0456\u0437\u0443 \u043c\u04af\u043c\u043a\u0456\u043d\u0434\u0456\u0433\u0456\u043d \u0448\u0435\u043a\u0442\u0435\u0443\u0434\u0456 \u0436\u04af\u0437\u0435\u0433\u0435 \u0430\u0441\u044b\u0440\u0443 \u043a\u0435\u0437\u0456\u043d\u0434\u0435 \u0436\u0435\u0440\u0433\u0456\u043b\u0456\u043a\u0442\u0456 \u0436\u0435\u043b\u0456\u0434\u0435 \u049b\u0430\u0440\u0430\u0441\u0442\u044b\u0440\u044b\u043b\u0430\u0442\u044b\u043d \u0431\u043e\u043b\u0430\u0434\u044b. \u0415\u0433\u0435\u0440 \u043e\u0440\u043d\u0430\u0442\u044b\u043b\u0441\u0430, \u0431\u0430\u0440\u043b\u044b\u049b \u0431\u0430\u0441\u049b\u0430 IP-\u043c\u0435\u043a\u0435\u043d\u0436\u0430\u0439\u043b\u0430\u0440\u044b \u0441\u044b\u0440\u0442\u049b\u044b \u0436\u0435\u043b\u0456\u0434\u0435 \u049b\u0430\u0440\u0430\u0441\u0442\u044b\u0440\u044b\u043b\u0430\u0434\u044b \u0436\u04d9\u043d\u0435 \u0441\u044b\u0440\u0442\u049b\u044b \u04e9\u0442\u043a\u0456\u0437\u0443 \u043c\u04af\u043c\u043a\u0456\u043d\u0434\u0456\u0433\u0456\u043d \u0448\u0435\u043a\u0442\u0435\u0443\u043b\u0435\u0440\u0456\u043d\u0435 \u04b1\u0448\u044b\u0440\u0430\u0439\u0434\u044b. \u0415\u0433\u0435\u0440 \u0431\u043e\u0441 \u049b\u0430\u043b\u0434\u044b\u0440\u044b\u043b\u0441\u0430, \u0441\u0435\u0440\u0432\u0435\u0440\u0434\u0456\u04a3 \u0456\u0448\u043a\u0456 \u0436\u0435\u043b\u0456\u0441\u0456 \u0442\u0435\u043a \u0436\u0435\u0440\u0433\u0456\u043b\u0456\u043a\u0442\u0456 \u0436\u0435\u043b\u0456\u0434\u0435 \u0441\u0430\u043d\u0430\u043b\u0430\u0434\u044b." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/ko.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/ko.json index 7c1d3ca384..f7285958b7 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/ko.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/ko.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "\uc774\uc804", "LabelFinish": "\ub05d\ub0b4\uae30", "LabelNext": "\ub2e4\uc74c", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "OK", "ButtonCancel": "\ucde8\uc18c", + "HeaderAllRecordings": "\ubaa8\ub4e0 \ub179\ud654", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "\uc885\ub8cc", "ButtonNew": "\uc2e0\uaddc", "All": "\ubaa8\ub450", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/lt-LT.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/lt-LT.json index 4b7e1d1681..b345a1c10a 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/lt-LT.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/lt-LT.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Ankstesnis", "LabelFinish": "Baigti", "LabelNext": "Kitas", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "OK", "ButtonCancel": "At\u0161aukti", + "HeaderAllRecordings": "Visi \u012fra\u0161ai", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "I\u0161eiti", "ButtonNew": "Naujas", "All": "All", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/ms.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/ms.json index 24b5f56d38..d834d3f1aa 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/ms.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/ms.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Sebelumnya", "LabelFinish": "Habis", "LabelNext": "Seterusnya", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "Ok", "ButtonCancel": "Cancel", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Exit", "ButtonNew": "New", "All": "All", @@ -82,8 +78,8 @@ "LabelLanguage": "Language:", "LabelTimeLimitHours": "Time limit (hours):", "HeaderPreferredMetadataLanguage": "Preferred Metadata Language", - "LabelSaveLocalMetadata": "Save artwork and metadata into media folders", - "LabelSaveLocalMetadataHelp": "Saving artwork and metadata directly into media folders will put them in a place where they can be easily edited.", + "LabelSaveLocalMetadata": "Save artwork into media folders", + "LabelSaveLocalMetadataHelp": "Saving artwork into media folders will put them in a place where they can be easily edited.", "LabelDownloadInternetMetadata": "Download artwork and metadata from the internet", "LabelDownloadInternetMetadataHelp": "Emby Server can download information about your media to enable rich presentations.", "TabPassword": "Password", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/nb.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/nb.json index 93332d6106..aeeefe2071 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/nb.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/nb.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Forrige", "LabelFinish": "Ferdig", "LabelNext": "Neste", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Kommende nyheter", "ButtonOk": "Ok", "ButtonCancel": "Avbryt", + "HeaderAllRecordings": "Alle opptak", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Avslutt", "ButtonNew": "Ny", "All": "Alle", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/nl.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/nl.json index fe34cef945..8516679d96 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/nl.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/nl.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Vorige", "LabelFinish": "Voltooien", "LabelNext": "Volgende", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Aankomende Nieuws", "ButtonOk": "Ok", "ButtonCancel": "Annuleren", + "HeaderAllRecordings": "Alle Opnames", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Afsluiten", "ButtonNew": "Nieuw", "All": "Alle", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/pl.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/pl.json index da699707b9..06034bb23b 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/pl.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/pl.json @@ -1,11 +1,4 @@ { - "Advanced": "Zaawansowane", - "Browse": "Przegl\u0105daj", - "LabelAllowedRemoteAddresses": "Filtr adres\u00f3w IP:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Tryb filtra adres\u00f3w IP:", - "Whitelist": "Bia\u0142a lista", - "Blacklist": "Czarna lista", "LabelPrevious": "Wstecz", "LabelFinish": "Zako\u0144cz", "LabelNext": "Dalej", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Nadchodz\u0105ce nowo\u015bci", "ButtonOk": "Ok", "ButtonCancel": "Anuluj", + "HeaderAllRecordings": "Wszystkie Nagrania", + "Advanced": "Zaawansowane", + "Browse": "Przegl\u0105daj", "ButtonExit": "Wyjd\u017a", "ButtonNew": "Nowe", "All": "Wszystko", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Wprowad\u017a niestandardow\u0105 warto\u015b\u0107 nag\u0142\u00f3wka HTTP user-agent, je\u015bli konieczne.", "HeaderConfigureRemoteAccess": "Konfiguracja dost\u0119pu zdalnego", "LearnHowToCreateSynologyShares": "Dowiedz si\u0119 jak udost\u0119pnia\u0107 foldery w Synology.", + "LabelAllowedRemoteAddresses": "Filtr adres\u00f3w IP:", + "LabelAllowedRemoteAddressesMode": "Tryb filtra adres\u00f3w IP:", + "Whitelist": "Bia\u0142a lista", + "Blacklist": "Czarna lista", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "Sieci lokalne:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/pt-BR.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/pt-BR.json index 9708810e5b..74ed4ef260 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/pt-BR.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/pt-BR.json @@ -1,11 +1,4 @@ { - "Advanced": "Avan\u00e7ado", - "Browse": "Procurar", - "LabelAllowedRemoteAddresses": "Filtro de endere\u00e7o IP remoto:", - "AllowedRemoteAddressesHelp": "Lista separada por v\u00edrgula de endere\u00e7os IP ou entradas IP\/netmask para redes que ter\u00e3o permiss\u00e3o para conectar-se remotamente. Se deixar em branco, todos os endere\u00e7os remotos ter\u00e3o permiss\u00e3o.", - "LabelAllowedRemoteAddressesMode": "Modo do filtro de endere\u00e7o IP remoto:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Anterior", "LabelFinish": "Finalizar", "LabelNext": "Pr\u00f3ximo", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Pr\u00f3ximas Not\u00edcias", "ButtonOk": "OK", "ButtonCancel": "Cancelar", + "HeaderAllRecordings": "Todas as Grava\u00e7\u00f5es", + "Advanced": "Avan\u00e7ado", + "Browse": "Procurar", "ButtonExit": "Sair", "ButtonNew": "Novo", "All": "Tudo", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Fornece um cabe\u00e7alho http personalizado para o agente-usu\u00e1rio, se necess\u00e1rio.", "HeaderConfigureRemoteAccess": "Configurar Acesso Remoto", "LearnHowToCreateSynologyShares": "Saiba como compartilhar pastas no Sinology.", + "LabelAllowedRemoteAddresses": "Filtro de endere\u00e7o IP remoto:", + "LabelAllowedRemoteAddressesMode": "Modo do filtro de endere\u00e7o IP remoto:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Lista separada por v\u00edrgula de endere\u00e7os IP ou entradas IP\/netmask para redes que ter\u00e3o permiss\u00e3o para conectar-se remotamente. Se deixar em branco, todos os endere\u00e7os remotos ter\u00e3o permiss\u00e3o.", "LabelLanNetworks": "Redes LAN:", "LanNetworksHelp": "Lista separada por v\u00edrgula de endere\u00e7os IP ou entradas IP\/m\u00e1scara de rede para redes que ser\u00e3o consideradas como redes locais ao for\u00e7ar restri\u00e7\u00f5es de banda. Se definida, todos os outros endere\u00e7os IP ser\u00e3o considerados como estando em uma rede externa e estar\u00e3o sujeitos a restri\u00e7\u00f5es de banda externa. Se deixada em branco, apenas a sub-rede do servidor \u00e9 considerada como rede local." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/pt-PT.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/pt-PT.json index b9a1e3eaf1..4180210a9b 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/pt-PT.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/pt-PT.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Anterior", "LabelFinish": "Terminar", "LabelNext": "Seguinte", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Pr\u00f3ximas Not\u00edcias", "ButtonOk": "Ok", "ButtonCancel": "Cancelar", + "HeaderAllRecordings": "Todas as Grava\u00e7\u00f5es", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Sair", "ButtonNew": "Novo", "All": "Tudo", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/ro.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/ro.json index a3cad2afae..b93eadb7e5 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/ro.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/ro.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Anteriorul", "LabelFinish": "Termin\u0103", "LabelNext": "Urm\u0103torul", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "\u0218tiri viitoare", "ButtonOk": "Ok", "ButtonCancel": "Anuleaz\u0103", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Ie\u0219ire", "ButtonNew": "Nou", "All": "Toate", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/ru.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/ru.json index 8a1288a358..ad7299e64c 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/ru.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/ru.json @@ -1,11 +1,4 @@ { - "Advanced": "\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u0435", - "Browse": "\u041d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435", "LabelFinish": "\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c", "LabelNext": "\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "\u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0438", "ButtonOk": "\u041e\u043a", "ButtonCancel": "\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c", + "HeaderAllRecordings": "\u0412\u0441\u0435 \u0437\u0430\u043f\u0438\u0441\u0438", + "Advanced": "\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u0435", + "Browse": "\u041d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f", "ButtonExit": "\u0412\u044b\u0439\u0442\u0438", "ButtonNew": "\u041d\u043e\u0432\u043e\u0435", "All": "\u0412\u0441\u0435", @@ -82,8 +78,8 @@ "LabelLanguage": "\u042f\u0437\u044b\u043a:", "LabelTimeLimitHours": "\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043b\u0438\u043c\u0438\u0442 (\u0447\u0430\u0441):", "HeaderPreferredMetadataLanguage": "\u0412\u044b\u0431\u043e\u0440 \u044f\u0437\u044b\u043a\u0430 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445", - "LabelSaveLocalMetadata": "\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043d\u0443\u0442\u0440\u044c \u043c\u0435\u0434\u0438\u0430\u043f\u0430\u043f\u043e\u043a", - "LabelSaveLocalMetadataHelp": "\u041f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0439 \u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u044c \u043c\u0435\u0434\u0438\u0430\u043f\u0430\u043f\u043e\u043a, \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432 \u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0433\u0434\u0435 \u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u0430\u0432\u0438\u0442\u044c.", + "LabelSaveLocalMetadata": "\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0434\u0438\u0430\u043f\u0430\u043f\u043e\u043a", + "LabelSaveLocalMetadataHelp": "\u041f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0434\u0438\u0430\u043f\u0430\u043f\u043e\u043a, \u0442\u0435 \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u0435\u0441\u0442\u0435, \u0433\u0434\u0435 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u0430\u0432\u0438\u0442\u044c.", "LabelDownloadInternetMetadata": "\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430", "LabelDownloadInternetMetadataHelp": "\u0412 Emby Server \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u0432\u043e\u0438\u0445 \u043c\u0435\u0434\u0438\u0430\u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043d\u0430\u0441\u044b\u0449\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f.", "TabPassword": "\u041f\u0430\u0440\u043e\u043b\u044c", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "\u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c HTTP-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c-\u0430\u0433\u0435\u043d\u0442\u0430.", "HeaderConfigureRemoteAccess": "\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430", "LearnHowToCreateSynologyShares": "\u041a\u0430\u043a \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0449\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0430\u043f\u043a\u0430\u043c \u0432 Synology.", + "LabelAllowedRemoteAddresses": "\u0424\u0438\u043b\u044c\u0442\u0440 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432:", + "LabelAllowedRemoteAddressesMode": "\u0420\u0435\u0436\u0438\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432:", + "Whitelist": "\u0411\u0435\u043b\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a", + "Blacklist": "\u0427\u0451\u0440\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a", + "AllowedRemoteAddressesHelp": "\u0421\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 IP\/netmask \u0434\u043b\u044f \u0441\u0435\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c, \u0442\u043e \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0432\u0441\u0435 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430.", "LabelLanNetworks": "\u0414\u043e\u043c\u0430\u0448\u043d\u0438\u0435 \u0441\u0435\u0442\u0438:", - "LanNetworksHelp": "\u0421\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 IP\/netmask \u0434\u043b\u044f \u0441\u0435\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438\u0441\u044f \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0430\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e, \u0442\u043e \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u0431\u0443\u0434\u0443\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438\u0441\u044f \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0435\u0442\u0438 \u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u043b\u0435\u0436\u0430\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u043f\u043e\u043b\u043e\u0441\u044b \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c, \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0441\u0435\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438." + "LanNetworksHelp": "\u0421\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 IP\/netmask \u0434\u043b\u044f \u0441\u0435\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438\u0441\u044f \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0430\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e, \u0442\u043e \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u0431\u0443\u0434\u0443\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438\u0441\u044f \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0435\u0442\u0438 \u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u043b\u0435\u0436\u0430\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u043f\u043e\u043b\u043e\u0441\u044b \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c, \u0442\u043e \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0441\u0435\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/sk.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/sk.json index 600eb1a6e6..b586e1c877 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/sk.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/sk.json @@ -1,11 +1,4 @@ { - "Advanced": "Pokro\u010dil\u00e9", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Filter vzdialen\u00fdch IP adries:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Predch\u00e1dzaj\u00face", "LabelFinish": "Ukon\u010di\u0165", "LabelNext": "\u010ealej", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Nadch\u00e1dzaj\u00face spr\u00e1vy", "ButtonOk": "Ok", "ButtonCancel": "Zru\u0161i\u0165", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Pokro\u010dil\u00e9", + "Browse": "Browse", "ButtonExit": "Ukon\u010di\u0165", "ButtonNew": "Nov\u00e9", "All": "V\u0161etky", @@ -83,7 +79,7 @@ "LabelTimeLimitHours": "\u010casov\u00fd limit (v hodin\u00e1ch):", "HeaderPreferredMetadataLanguage": "Uprednost\u0148ovan\u00fd jazyk metad\u00e1t", "LabelSaveLocalMetadata": "Ulo\u017ei\u0165 obaly a metad\u00e1ta do prie\u010dinka s m\u00e9diami", - "LabelSaveLocalMetadataHelp": "Saving artwork and metadata directly into media folders will put them in a place where they can be easily edited.", + "LabelSaveLocalMetadataHelp": "Saving artwork into media folders will put them in a place where they can be easily edited.", "LabelDownloadInternetMetadata": "Stiahnu\u0165 obal a metad\u00e1ta z Internetu", "LabelDownloadInternetMetadataHelp": "Emby Server can download information about your media to enable rich presentations.", "TabPassword": "Heslo", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Nastavi\u0165 vzdialen\u00fd pr\u00edstup", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Filter vzdialen\u00fdch IP adries:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN siete:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/sl-SI.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/sl-SI.json index dc9fdf4ca0..0e52016563 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/sl-SI.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/sl-SI.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Nazaj", "LabelFinish": "Konec", "LabelNext": "Naprej", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "Ok", "ButtonCancel": "Cancel", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Izhod", "ButtonNew": "New", "All": "All", @@ -82,8 +78,8 @@ "LabelLanguage": "Jezik:", "LabelTimeLimitHours": "Casovna omejitev (ure):", "HeaderPreferredMetadataLanguage": "Preferred Metadata Language", - "LabelSaveLocalMetadata": "Save artwork and metadata into media folders", - "LabelSaveLocalMetadataHelp": "Saving artwork and metadata directly into media folders will put them in a place where they can be easily edited.", + "LabelSaveLocalMetadata": "Save artwork into media folders", + "LabelSaveLocalMetadataHelp": "Saving artwork into media folders will put them in a place where they can be easily edited.", "LabelDownloadInternetMetadata": "Download artwork and metadata from the internet", "LabelDownloadInternetMetadataHelp": "Emby Server can download information about your media to enable rich presentations.", "TabPassword": "Geslo", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/sv.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/sv.json index 1cd195dcdb..7789361c23 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/sv.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/sv.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "F\u00f6reg\u00e5ende", "LabelFinish": "Klart", "LabelNext": "N\u00e4sta", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Kommande nyheter", "ButtonOk": "OK", "ButtonCancel": "Avbryt", + "HeaderAllRecordings": "Alla inspelningar", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Avsluta", "ButtonNew": "Nytillkommet", "All": "Alla", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Konfigurera fj\u00e4rr\u00e5tkomst", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN n\u00e4tverk:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/tr.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/tr.json index 758d0c6b71..b0f8da9781 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/tr.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/tr.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "\u00d6nceki", "LabelFinish": "Bitir", "LabelNext": "Sonraki", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "Tamam", "ButtonCancel": "\u0130ptal", + "HeaderAllRecordings": "T\u00fcm Kay\u0131tlar", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "\u00c7\u0131k", "ButtonNew": "Yeni", "All": "Hepsi", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/uk.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/uk.json index 1beb5f9948..327c883e8b 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/uk.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/uk.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "\u041d\u0430\u0437\u0430\u0434", "LabelFinish": "Finish", "LabelNext": "\u0412\u043f\u0435\u0440\u0435\u0434", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "Ok", "ButtonCancel": "\u0421\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Exit", "ButtonNew": "\u041d\u043e\u0432\u0438\u0439", "All": "All", @@ -82,8 +78,8 @@ "LabelLanguage": "\u041c\u043e\u0432\u0430:", "LabelTimeLimitHours": "Time limit (hours):", "HeaderPreferredMetadataLanguage": "Preferred Metadata Language", - "LabelSaveLocalMetadata": "Save artwork and metadata into media folders", - "LabelSaveLocalMetadataHelp": "Saving artwork and metadata directly into media folders will put them in a place where they can be easily edited.", + "LabelSaveLocalMetadata": "Save artwork into media folders", + "LabelSaveLocalMetadataHelp": "Saving artwork into media folders will put them in a place where they can be easily edited.", "LabelDownloadInternetMetadata": "Download artwork and metadata from the internet", "LabelDownloadInternetMetadataHelp": "Emby Server can download information about your media to enable rich presentations.", "TabPassword": "\u041f\u0430\u0440\u043e\u043b\u044c", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/vi.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/vi.json index e0d5f74c7b..753afc9e2f 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/vi.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/vi.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "Tr\u01b0\u1edbc", "LabelFinish": "K\u1ebft th\u00fac", "LabelNext": "Ti\u1ebfp theo", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "Ok", "ButtonCancel": "Tho\u00e1t", + "HeaderAllRecordings": "All Recordings", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Exit", "ButtonNew": "M\u1edbi", "All": "T\u00e2\u0341t ca\u0309", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/zh-CN.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/zh-CN.json index fb9bc8c150..92699cba6c 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/zh-CN.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/zh-CN.json @@ -1,11 +1,4 @@ { - "Advanced": "\u9ad8\u7ea7", - "Browse": "\u6d4f\u89c8", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "\u4e0a\u4e00\u4e2a", "LabelFinish": "\u5b8c\u6210", "LabelNext": "\u4e0b\u4e00\u4e2a", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "\u5373\u5c06\u53d1\u5e03\u65b0\u95fb", "ButtonOk": "\u786e\u5b9a", "ButtonCancel": "\u53d6\u6d88", + "HeaderAllRecordings": "\u6240\u6709\u5f55\u5236\u7684\u8282\u76ee", + "Advanced": "\u9ad8\u7ea7", + "Browse": "\u6d4f\u89c8", "ButtonExit": "\u9000\u51fa", "ButtonNew": "\u65b0\u589e", "All": "\u5168\u90e8", @@ -60,7 +56,7 @@ "LabelSyncTempPath": "\u4e34\u65f6\u6587\u4ef6\u8def\u5f84\uff1a", "LabelSyncTempPathHelp": "\u6307\u5b9a\u540c\u6b65\u65f6\u7684\u5de5\u4f5c\u6587\u4ef6\u5939\u3002\u5728\u540c\u6b65\u8fc7\u7a0b\u4e2d\u521b\u5efa\u7684\u8f6c\u6362\u5a92\u4f53\u6587\u4ef6\u5c06\u88ab\u5b58\u653e\u5728\u8fd9\u91cc\u3002", "LabelCustomCertificatePath": "\u81ea\u5b9a\u4e49 SSL \u8bc1\u4e66\u8def\u5f84\uff1a", - "LabelCustomCertificatePathHelp": "\u63d0\u4f9b\u4f60\u81ea\u5df1\u7684 SSL \u8bc1\u4e66\u6587\u4ef6\uff08.PFX \u683c\u5f0f\uff09\u3002", + "LabelCustomCertificatePathHelp": "\u63d0\u4f9b\u4e00\u4e2a\u5305\u542b\u4e86\u8bc1\u4e66\u548c\u79c1\u94a5\u7684 PKCS #12 \u6587\u4ef6\u7684\u8def\u5f84\u4ee5\u5728\u4e00\u4e2a\u81ea\u5b9a\u4e49\u57df\u540d\u4e0a\u542f\u52a8 TLS \u652f\u6301\u3002", "TitleNotifications": "\u901a\u77e5", "LabelEnterConnectUserName": "\u7528\u6237\u540d\u6216\u90ae\u7bb1\u5730\u5740\uff1a", "LabelEnterConnectUserNameHelp": "\u8fd9\u662f\u4f60\u7684 Emby \u5728\u7ebf\u8d26\u6237\u7684\u7528\u6237\u540d\u6216\u90ae\u7bb1\u5730\u5740\u3002", @@ -353,7 +349,7 @@ "LabelCustomizeOptionsPerMediaType": "\u81ea\u5b9a\u4e49\u5a92\u4f53\u7c7b\u578b\uff1a", "OptionDownloadThumbImage": "\u7f29\u7565\u56fe", "OptionDownloadMenuImage": "\u83dc\u5355", - "OptionDownloadLogoImage": "\u6807\u5fd7", + "OptionDownloadLogoImage": "Logo", "OptionDownloadBoxImage": "\u5305\u88c5", "OptionDownloadDiscImage": "\u5149\u76d8", "OptionDownloadBannerImage": "\u6a2a\u5e45", @@ -796,7 +792,7 @@ "OptionBoxRear": "\u5305\u88c5\u76d2\u80cc\u9762\u56fe", "OptionDisc": "\u5149\u76d8", "OptionIcon": "\u56fe\u6807", - "OptionLogo": "\u6807\u5fd7", + "OptionLogo": "Logo", "OptionMenu": "\u83dc\u5355", "OptionScreenshot": "\u5c4f\u5e55\u622a\u56fe", "OptionLocked": "\u9501\u5b9a", @@ -1735,7 +1731,7 @@ "ButtonScanAllLibraries": "\u626b\u63cf\u6240\u6709\u5a92\u4f53\u5e93", "ScanLibrary": "\u626b\u63cf\u5a92\u4f53\u5e93", "EnableStreamLooping": "\u81ea\u52a8\u5faa\u73af\u76f4\u64ad\u6d41", - "EnableStreamLoopingHelp": "\u5982\u679c\u76f4\u64ad\u6d41\u4ec5\u5305\u542b\u4e86\u51e0\u79d2\u949f\u7684\u6570\u636e\u5e76\u4e14\u9700\u8981\u88ab\u4e0d\u65ad\u7684\u8bf7\u6c42\uff0c\u8bf7\u542f\u7528\u6b64\u9879\u3002", + "EnableStreamLoopingHelp": "\u5982\u679c\u76f4\u64ad\u6d41\u4ec5\u5305\u542b\u4e86\u51e0\u79d2\u949f\u7684\u6570\u636e\u5e76\u4e14\u9700\u8981\u88ab\u4e0d\u65ad\u7684\u8bf7\u6c42\uff0c\u8bf7\u542f\u7528\u6b64\u9879\u3002\u5982\u679c\u5728\u6ca1\u6709\u76f8\u5173\u95ee\u9898\u7684\u60c5\u51b5\u4e0b\u542f\u52a8\u6b64\u9879\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u4e00\u4e9b\u95ee\u9898\u3002", "HttpsRequiresCert": "\u5982\u679c\u9700\u8981 HTTPS \u7528\u4e8e\u5916\u90e8\u8fde\u63a5\uff0c\u4f60\u9700\u8981\u63d0\u4f9b\u4e00\u4e2a\u53d7\u4fe1\u4efb\u7684 SSL \u8bc1\u4e66\uff0c\u6bd4\u5982 Lets Encrypt\u3002", "HeaderLatestDownloadedVideos": "\u6700\u65b0\u4e0b\u8f7d\u7684\u89c6\u9891", "ServerRestartNeededAfterPluginInstall": "\u5b89\u88c5\u63d2\u4ef6\u540e\uff0cEmby \u670d\u52a1\u5668\u9700\u8981\u91cd\u542f\u4ee5\u4f7f\u63d2\u4ef6\u751f\u6548\u3002", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "\u9ed1\u540d\u5355", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/zh-HK.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/zh-HK.json index f7f2baa4e6..234d5f9ebf 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/zh-HK.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/zh-HK.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "\u524d\u4e00\u500b", "LabelFinish": "\u5b8c\u6210", "LabelNext": "\u4e0b\u4e00\u500b", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "\u78ba\u5b9a", "ButtonCancel": "\u53d6\u6d88", + "HeaderAllRecordings": "\u6240\u6709\u9304\u5f71", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "\u96e2\u958b", "ButtonNew": "\u6700\u65b0", "All": "All", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/strings/zh-TW.json b/MediaBrowser.WebDashboard/dashboard-ui/strings/zh-TW.json index 958ecdd602..da4a630352 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/strings/zh-TW.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/strings/zh-TW.json @@ -1,11 +1,4 @@ { - "Advanced": "Advanced", - "Browse": "Browse", - "LabelAllowedRemoteAddresses": "Remote IP address filter:", - "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", - "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", - "Whitelist": "Whitelist", - "Blacklist": "Blacklist", "LabelPrevious": "\u4e0a\u4e00\u500b", "LabelFinish": "\u5b8c\u6210", "LabelNext": "\u4e0b\u4e00\u500b", @@ -37,6 +30,9 @@ "HeaderUpcomingNews": "Upcoming News", "ButtonOk": "OK", "ButtonCancel": "\u53d6\u6d88", + "HeaderAllRecordings": "\u6240\u6709\u9304\u5f71", + "Advanced": "Advanced", + "Browse": "Browse", "ButtonExit": "Exit", "ButtonNew": "\u5efa\u7acb", "All": "All", @@ -1771,6 +1767,11 @@ "UserAgentHelp": "Supply a custom user-agent http header, if necessary.", "HeaderConfigureRemoteAccess": "Configure Remote Access", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LabelAllowedRemoteAddresses": "Remote IP address filter:", + "LabelAllowedRemoteAddressesMode": "Remote IP address filter mode:", + "Whitelist": "Whitelist", + "Blacklist": "Blacklist", + "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "LabelLanNetworks": "LAN networks:", "LanNetworksHelp": "Comma separated list of IP addresses or IP\/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network." } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/thirdparty/jquerymobile/jqm.panel.js b/MediaBrowser.WebDashboard/dashboard-ui/thirdparty/jquerymobile/jqm.panel.js index 244e2b1509..453bebde01 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/thirdparty/jquerymobile/jqm.panel.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/thirdparty/jquerymobile/jqm.panel.js @@ -1 +1 @@ -define(["jqmwidget"],function(){!function($,undefined){var props={animation:{},transition:{}},testElement=document.createElement("a"),vendorPrefixes=["","webkit-","moz-","o-"];$.each(["animation","transition"],function(i,test){var testName=0===i?test+"-name":test;$.each(vendorPrefixes,function(j,prefix){if(testElement.style[$.camelCase(prefix+testName)]!==undefined)return props[test].prefix=prefix,!1}),props[test].duration=$.camelCase(props[test].prefix+test+"-duration"),props[test].event=$.camelCase(props[test].prefix+test+"-end"),""===props[test].prefix&&(props[test].event=props[test].event.toLowerCase())}),$(testElement).remove(),$.fn.animationComplete=function(callback,type,fallbackTime){var timer,duration,that=this,eventBinding=function(){clearTimeout(timer),callback.apply(this,arguments)},animationType=type&&"animation"!==type?"transition":"animation";return fallbackTime===undefined&&($(this).context!==document&&(duration=3e3*parseFloat($(this).css(props[animationType].duration))),(0===duration||duration===undefined||isNaN(duration))&&(duration=$.fn.animationComplete.defaultDuration)),timer=setTimeout(function(){$(that).off(props[animationType].event,eventBinding),callback.apply(that)},duration),$(this).one(props[animationType].event,eventBinding)},$.fn.animationComplete.defaultDuration=1e3}(jQuery),function($,undefined){$.widget("mobile.panel",{options:{animate:!0,theme:null,position:"left",dismissible:!0,display:"overlay",swipeClose:!0,positionFixed:!0},_parentPage:null,_page:null,_modal:null,_panelInner:null,_wrapper:null,_create:function(){var el=this.element,parentPage=el.closest(".ui-page, [data-role='page']");$.extend(this,{_parentPage:parentPage.length>0&&parentPage,_openedPage:null,_page:this._getPage,_panelInner:this._getPanelInner()}),"overlay"!==this.options.display&&this._getWrapper(),this._addPanelClasses(),this.options.animate&&this.element.addClass("ui-panel-animate"),this.element.addClass("dialog"),this._bindUpdateLayout(),this._bindCloseEvents(),this._bindLinkListeners(),this._bindPageEvents(),this.options.dismissible&&this._createModal(),this._bindSwipeEvents()},_getPanelInner:function(){var panelInner=this.element[0].querySelector(".ui-panel-inner");return panelInner=panelInner?$(panelInner):this.element.children().wrapAll("
    ").parent()},_createModal:function(){var self=this,target=self._parentPage?self._parentPage.parent():self.element.parent();self._modal=$("
    ").on("mousedown",function(){self.close()}).appendTo(target)},_getPage:function(){var page=this._openedPage||this._parentPage||$(".ui-page-active");return page},_getWrapper:function(){var wrapper=this._page().find(".ui-panel-wrapper");0===wrapper.length&&(wrapper=this._page().children(".ui-header:not(.ui-header-fixed), .ui-content:not(.ui-popup), .ui-footer:not(.ui-footer-fixed)").wrapAll("
    ").parent()),this._wrapper=wrapper},_getPosDisplayClasses:function(prefix){return prefix+"-position-right "+prefix+"-display-"+this.options.display},_getPanelClasses:function(){var panelClasses="ui-panel "+this._getPosDisplayClasses("ui-panel")+" ui-panel-closed ui-body-"+(this.options.theme?this.options.theme:"inherit");return this.options.positionFixed&&(panelClasses+=" ui-panel-fixed"),panelClasses},_addPanelClasses:function(){this.element.addClass(this._getPanelClasses())},_handleCloseClick:function(event){event.isDefaultPrevented()||this.close()},_bindCloseEvents:function(){},_positionPanel:function(scrollToTop){var self=this,panelInnerHeight=self._panelInner.outerHeight(),expand=panelInnerHeight>(window.innerHeight||$(window).height());expand||!self.options.positionFixed?(expand&&self._unfixPanel(),scrollToTop&&this.window[0].scrollTo(0,$.mobile.defaultHomeScroll)):self._fixPanel()},_bindFixListener:function(){this._on($(window),{resize:"_positionPanel"})},_unbindFixListener:function(){this._off($(window),"resize")},_unfixPanel:function(){this.options.positionFixed&&this.element.removeClass("ui-panel-fixed")},_fixPanel:function(){this.options.positionFixed&&this.element.addClass("ui-panel-fixed")},_bindUpdateLayout:function(){var self=this;self.element.on("updatelayout",function(){self._open&&self._positionPanel()})},_bindLinkListeners:function(){this._on("body",{"click a":"_handleClick"})},_handleClick:function(e){var link,panelId=this.element.attr("id");e.currentTarget.href.split("#")[1]===panelId&&panelId!==undefined&&(e.preventDefault(),link=$(e.target),link.hasClass("ui-btn")&&(link.addClass($.mobile.activeBtnClass),this.element.one("panelopen panelclose",function(){link.removeClass($.mobile.activeBtnClass)})),this.toggle())},_bindSwipeEvents:function(){var self=this,area=self._modal?self.element.add(self._modal):self.element;self.options.swipeClose&&("left"===self.options.position?area.on("swipeleft.panel",function(){self.close()}):area.on("swiperight.panel",function(){self.close()}))},_bindPageEvents:function(){var self=this;this.document.on("panelbeforeopen",function(e){self._open&&e.target!==self.element[0]&&self.close()}).on("keyup.panel",function(e){27===e.keyCode&&self._open&&self.close()}),this._parentPage||"overlay"===this.options.display||this._on(this.document,{pageshow:function(){this._openedPage=null,this._getWrapper()}}),self._parentPage?this.document.on("pagehide","[data-role='page']",function(){self._open&&self.close(!0)}):this.document.on("pagebeforehide",function(){self._open&&self.close(!0)})},_open:!1,_pageContentOpenClasses:null,_modalOpenClasses:null,open:function(immediate){if(!this._open){var self=this,o=self.options,_openPanel=function(){self._off(self.document,"panelclose"),self._page().data("panel","open"),o.animate&&"overlay"!==o.display&&self._wrapper.addClass("ui-panel-animate"),!immediate&&o.animate?(self._wrapper||self.element).animationComplete(complete,"transition"):setTimeout(complete,0),o.theme&&"overlay"!==o.display&&self._page().parent().addClass("ui-panel-page-container-themed ui-panel-page-container-"+o.theme),self.element.removeClass("ui-panel-closed").addClass("ui-panel-open"),self._positionPanel(!0),self._pageContentOpenClasses=self._getPosDisplayClasses("ui-panel-page-content"),"overlay"!==o.display&&(self._page().parent().addClass("ui-panel-page-container"),self._wrapper.addClass(self._pageContentOpenClasses)),self._modalOpenClasses=self._getPosDisplayClasses("ui-panel-dismiss")+" ui-panel-dismiss-open",self._modal&&self._modal.addClass(self._modalOpenClasses).height(Math.max(self._modal.height(),self.document.height()))},complete=function(){self._open&&("overlay"!==o.display&&self._wrapper.addClass("ui-panel-page-content-open"),self._bindFixListener(),self._trigger("open"),self._openedPage=self._page())};self._trigger("beforeopen"),"open"===self._page().data("panel")?self._on(self.document,{panelclose:_openPanel}):_openPanel(),self._open=!0}},close:function(immediate){if(this._open){var self=this,o=this.options,_closePanel=function(){self.element.removeClass("ui-panel-open"),"overlay"!==o.display&&self._wrapper.removeClass(self._pageContentOpenClasses),!immediate&&o.animate?(self._wrapper||self.element).animationComplete(complete,"transition"):setTimeout(complete,0),self._modal&&self._modal.removeClass(self._modalOpenClasses).height("")},complete=function(){o.theme&&"overlay"!==o.display&&self._page().parent().removeClass("ui-panel-page-container-themed ui-panel-page-container-"+o.theme),self.element.addClass("ui-panel-closed"),"overlay"!==o.display&&(self._page().parent().removeClass("ui-panel-page-container"),self._wrapper.removeClass("ui-panel-page-content-open")),o.animate&&"overlay"!==o.display&&self._wrapper.removeClass("ui-panel-animate"),self._fixPanel(),self._unbindFixListener(),self._page().removeData("panel"),self._trigger("close"),self._openedPage=null};self._trigger("beforeclose"),_closePanel(),self._open=!1}},toggle:function(){this[this._open?"close":"open"]()},_destroy:function(){var otherPanels,o=this.options,multiplePanels=$("body > :mobile-panel").length+$.mobile.activePage.find(":mobile-panel").length>1;"overlay"!==o.display&&(otherPanels=$("body > :mobile-panel").add($.mobile.activePage.find(":mobile-panel")),0===otherPanels.not(".ui-panel-display-overlay").not(this.element).length&&this._wrapper.children().unwrap(),this._open&&(this._page().parent().removeClass("ui-panel-page-container"),o.theme&&this._page().parent().removeClass("ui-panel-page-container-themed ui-panel-page-container-"+o.theme))),multiplePanels||this.document.off("panelopen panelclose"),this._open&&this._page().removeData("panel"),this._panelInner.children().unwrap(),this.element.removeClass([this._getPanelClasses(),"ui-panel-open","ui-panel-animate"].join(" ")).off("swipeleft.panel swiperight.panel").off("panelbeforeopen").off("panelhide").off("keyup.panel").off("updatelayout"),this._modal&&this._modal.remove()}})}(jQuery)}); \ No newline at end of file +define(["jqmwidget"],function(){!function($,undefined){var props={animation:{},transition:{}},testElement=document.createElement("a"),vendorPrefixes=["","webkit-","moz-","o-"];$.each(["animation","transition"],function(i,test){var testName=0===i?test+"-name":test;$.each(vendorPrefixes,function(j,prefix){if(void 0!==testElement.style[$.camelCase(prefix+testName)])return props[test].prefix=prefix,!1}),props[test].duration=$.camelCase(props[test].prefix+test+"-duration"),props[test].event=$.camelCase(props[test].prefix+test+"-end"),""===props[test].prefix&&(props[test].event=props[test].event.toLowerCase())}),$(testElement).remove(),$.fn.animationComplete=function(callback,type,fallbackTime){var timer,duration,that=this,eventBinding=function(){clearTimeout(timer),callback.apply(this,arguments)},animationType=type&&"animation"!==type?"transition":"animation";return void 0===fallbackTime&&($(this).context!==document&&(duration=3e3*parseFloat($(this).css(props[animationType].duration))),(0===duration||void 0===duration||isNaN(duration))&&(duration=$.fn.animationComplete.defaultDuration)),timer=setTimeout(function(){$(that).off(props[animationType].event,eventBinding),callback.apply(that)},duration),$(this).one(props[animationType].event,eventBinding)},$.fn.animationComplete.defaultDuration=1e3}(jQuery),function($,undefined){$.widget("mobile.panel",{options:{animate:!0,theme:null,position:"left",dismissible:!0,display:"overlay",swipeClose:!0,positionFixed:!0},_parentPage:null,_page:null,_modal:null,_panelInner:null,_wrapper:null,_create:function(){var el=this.element,parentPage=el.closest(".ui-page, [data-role='page']");$.extend(this,{_parentPage:parentPage.length>0&&parentPage,_openedPage:null,_page:this._getPage,_panelInner:this._getPanelInner()}),"overlay"!==this.options.display&&this._getWrapper(),this._addPanelClasses(),this.options.animate&&this.element.addClass("ui-panel-animate"),this.element.addClass("dialog"),this._bindUpdateLayout(),this._bindCloseEvents(),this._bindLinkListeners(),this._bindPageEvents(),this.options.dismissible&&this._createModal(),this._bindSwipeEvents()},_getPanelInner:function(){var panelInner=this.element[0].querySelector(".ui-panel-inner");return panelInner=panelInner?$(panelInner):this.element.children().wrapAll("
    ").parent()},_createModal:function(){var self=this,target=self._parentPage?self._parentPage.parent():self.element.parent();self._modal=$("
    ").on("mousedown",function(){self.close()}).appendTo(target)},_getPage:function(){return this._openedPage||this._parentPage||$(".ui-page-active")},_getWrapper:function(){var wrapper=this._page().find(".ui-panel-wrapper");0===wrapper.length&&(wrapper=this._page().children(".ui-header:not(.ui-header-fixed), .ui-content:not(.ui-popup), .ui-footer:not(.ui-footer-fixed)").wrapAll("
    ").parent()),this._wrapper=wrapper},_getPosDisplayClasses:function(prefix){return prefix+"-position-right "+prefix+"-display-"+this.options.display},_getPanelClasses:function(){var panelClasses="ui-panel "+this._getPosDisplayClasses("ui-panel")+" ui-panel-closed ui-body-"+(this.options.theme?this.options.theme:"inherit");return this.options.positionFixed&&(panelClasses+=" ui-panel-fixed"),panelClasses},_addPanelClasses:function(){this.element.addClass(this._getPanelClasses())},_handleCloseClick:function(event){event.isDefaultPrevented()||this.close()},_bindCloseEvents:function(){},_positionPanel:function(scrollToTop){var self=this,panelInnerHeight=self._panelInner.outerHeight(),expand=panelInnerHeight>(window.innerHeight||$(window).height());expand||!self.options.positionFixed?(expand&&self._unfixPanel(),scrollToTop&&this.window[0].scrollTo(0,$.mobile.defaultHomeScroll)):self._fixPanel()},_bindFixListener:function(){this._on($(window),{resize:"_positionPanel"})},_unbindFixListener:function(){this._off($(window),"resize")},_unfixPanel:function(){this.options.positionFixed&&this.element.removeClass("ui-panel-fixed")},_fixPanel:function(){this.options.positionFixed&&this.element.addClass("ui-panel-fixed")},_bindUpdateLayout:function(){var self=this;self.element.on("updatelayout",function(){self._open&&self._positionPanel()})},_bindLinkListeners:function(){this._on("body",{"click a":"_handleClick"})},_handleClick:function(e){var link,panelId=this.element.attr("id");e.currentTarget.href.split("#")[1]===panelId&&void 0!==panelId&&(e.preventDefault(),link=$(e.target),link.hasClass("ui-btn")&&(link.addClass($.mobile.activeBtnClass),this.element.one("panelopen panelclose",function(){link.removeClass($.mobile.activeBtnClass)})),this.toggle())},_bindSwipeEvents:function(){var self=this,area=self._modal?self.element.add(self._modal):self.element;self.options.swipeClose&&("left"===self.options.position?area.on("swipeleft.panel",function(){self.close()}):area.on("swiperight.panel",function(){self.close()}))},_bindPageEvents:function(){var self=this;this.document.on("panelbeforeopen",function(e){self._open&&e.target!==self.element[0]&&self.close()}).on("keyup.panel",function(e){27===e.keyCode&&self._open&&self.close()}),this._parentPage||"overlay"===this.options.display||this._on(this.document,{pageshow:function(){this._openedPage=null,this._getWrapper()}}),self._parentPage?this.document.on("pagehide","[data-role='page']",function(){self._open&&self.close(!0)}):this.document.on("pagebeforehide",function(){self._open&&self.close(!0)})},_open:!1,_pageContentOpenClasses:null,_modalOpenClasses:null,open:function(immediate){if(!this._open){var self=this,o=self.options,_openPanel=function(){self._off(self.document,"panelclose"),self._page().data("panel","open"),o.animate&&"overlay"!==o.display&&self._wrapper.addClass("ui-panel-animate"),!immediate&&o.animate?(self._wrapper||self.element).animationComplete(complete,"transition"):setTimeout(complete,0),o.theme&&"overlay"!==o.display&&self._page().parent().addClass("ui-panel-page-container-themed ui-panel-page-container-"+o.theme),self.element.removeClass("ui-panel-closed").addClass("ui-panel-open"),self._positionPanel(!0),self._pageContentOpenClasses=self._getPosDisplayClasses("ui-panel-page-content"),"overlay"!==o.display&&(self._page().parent().addClass("ui-panel-page-container"),self._wrapper.addClass(self._pageContentOpenClasses)),self._modalOpenClasses=self._getPosDisplayClasses("ui-panel-dismiss")+" ui-panel-dismiss-open",self._modal&&self._modal.addClass(self._modalOpenClasses).height(Math.max(self._modal.height(),self.document.height()))},complete=function(){self._open&&("overlay"!==o.display&&self._wrapper.addClass("ui-panel-page-content-open"),self._bindFixListener(),self._trigger("open"),self._openedPage=self._page())};self._trigger("beforeopen"),"open"===self._page().data("panel")?self._on(self.document,{panelclose:_openPanel}):_openPanel(),self._open=!0}},close:function(immediate){if(this._open){var self=this,o=this.options,complete=function(){o.theme&&"overlay"!==o.display&&self._page().parent().removeClass("ui-panel-page-container-themed ui-panel-page-container-"+o.theme),self.element.addClass("ui-panel-closed"),"overlay"!==o.display&&(self._page().parent().removeClass("ui-panel-page-container"),self._wrapper.removeClass("ui-panel-page-content-open")),o.animate&&"overlay"!==o.display&&self._wrapper.removeClass("ui-panel-animate"),self._fixPanel(),self._unbindFixListener(),self._page().removeData("panel"),self._trigger("close"),self._openedPage=null};self._trigger("beforeclose"),function(){self.element.removeClass("ui-panel-open"),"overlay"!==o.display&&self._wrapper.removeClass(self._pageContentOpenClasses),!immediate&&o.animate?(self._wrapper||self.element).animationComplete(complete,"transition"):setTimeout(complete,0),self._modal&&self._modal.removeClass(self._modalOpenClasses).height("")}(),self._open=!1}},toggle:function(){this[this._open?"close":"open"]()},_destroy:function(){var otherPanels,o=this.options,multiplePanels=$("body > :mobile-panel").length+$.mobile.activePage.find(":mobile-panel").length>1;"overlay"!==o.display&&(otherPanels=$("body > :mobile-panel").add($.mobile.activePage.find(":mobile-panel")),0===otherPanels.not(".ui-panel-display-overlay").not(this.element).length&&this._wrapper.children().unwrap(),this._open&&(this._page().parent().removeClass("ui-panel-page-container"),o.theme&&this._page().parent().removeClass("ui-panel-page-container-themed ui-panel-page-container-"+o.theme))),multiplePanels||this.document.off("panelopen panelclose"),this._open&&this._page().removeData("panel"),this._panelInner.children().unwrap(),this.element.removeClass([this._getPanelClasses(),"ui-panel-open","ui-panel-animate"].join(" ")).off("swipeleft.panel swiperight.panel").off("panelbeforeopen").off("panelhide").off("keyup.panel").off("updatelayout"),this._modal&&this._modal.remove()}})}(jQuery)}); \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/thirdparty/jquerymobile/jqm.popup.js b/MediaBrowser.WebDashboard/dashboard-ui/thirdparty/jquerymobile/jqm.popup.js index b12bab146b..83a9f19368 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/thirdparty/jquerymobile/jqm.popup.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/thirdparty/jquerymobile/jqm.popup.js @@ -1 +1 @@ -define(["jqmwidget"],function(){!function($,undefined){var props={animation:{},transition:{}},testElement=document.createElement("a"),vendorPrefixes=["","webkit-","moz-","o-"];$.each(["animation","transition"],function(i,test){var testName=0===i?test+"-name":test;$.each(vendorPrefixes,function(j,prefix){if(testElement.style[$.camelCase(prefix+testName)]!==undefined)return props[test].prefix=prefix,!1}),props[test].duration=$.camelCase(props[test].prefix+test+"-duration"),props[test].event=$.camelCase(props[test].prefix+test+"-end"),""===props[test].prefix&&(props[test].event=props[test].event.toLowerCase())}),$(testElement).remove(),$.fn.animationComplete=function(callback,type,fallbackTime){var timer,duration,that=this,eventBinding=function(){clearTimeout(timer),callback.apply(this,arguments)},animationType=type&&"animation"!==type?"transition":"animation";return fallbackTime===undefined&&($(this).context!==document&&(duration=3e3*parseFloat($(this).css(props[animationType].duration))),(0===duration||duration===undefined||isNaN(duration))&&(duration=$.fn.animationComplete.defaultDuration)),timer=setTimeout(function(){$(that).off(props[animationType].event,eventBinding),callback.apply(that)},duration),$(this).one(props[animationType].event,eventBinding)},$.fn.animationComplete.defaultDuration=1e3}(jQuery),function($,undefined){function fitSegmentInsideSegment(windowSize,segmentSize,offset,desired){var returnValue=desired;return returnValue=windowSize
    ";while(a[0]);return v>4?v:!v}(),$.widget("mobile.popup",{options:{wrapperClass:null,theme:null,overlayTheme:null,shadow:!0,corners:!0,transition:"none",positionTo:"origin",tolerance:null,closeLinkSelector:"a[data-rel='back']",closeLinkEvents:"click.popup",navigateEvents:"navigate.popup",closeEvents:"navigate.popup pagebeforechange.popup",dismissible:!0,enhanced:!1,history:!$.mobile.browser.oldIE},_handleDocumentVmousedown:function(theEvent){this._isOpen&&$.contains(this._ui.container[0],theEvent.target)&&this._ignoreResizeEvents()},_create:function(){var theElement=this.element,myId=theElement.attr("id"),currentOptions=this.options;theElement.addClass("dialog"),currentOptions.history=currentOptions.history&&$.mobile.ajaxEnabled&&$.mobile.hashListeningEnabled,this._on(this.document,{mousedown:"_handleDocumentVmousedown"}),$.extend(this,{_scrollTop:0,_page:theElement.parents("div[data-role='page']"),_ui:null,_fallbackTransition:"",_currentTransition:!1,_prerequisites:null,_isOpen:!1,_tolerance:null,_resizeData:null,_ignoreResizeTo:0,_orientationchangeInProgress:!1}),0===this._page.length&&(this._page=$("body")),currentOptions.enhanced?this._ui={container:theElement.parent(),screen:theElement.parent().prev(),placeholder:$(this.document[0].getElementById(myId+"-placeholder"))}:(this._ui=this._enhance(theElement,myId),this._applyTransition(currentOptions.transition)),this._setTolerance(currentOptions.tolerance)._ui.focusElement=this._ui.container,this._on(this._ui.screen,{click:"_eatEventAndClose"}),this._on(this.window,{orientationchange:$.proxy(this,"_handleWindowOrientationchange"),resize:$.proxy(this,"_handleWindowResize")}),this._on(this.document,{focusin:"_handleDocumentFocusIn"})},_delay:function(handler,delay){function handlerProxy(){return("string"==typeof handler?instance[handler]:handler).apply(instance,arguments)}var instance=this;return setTimeout(handlerProxy,delay||0)},_enhance:function(theElement,myId){var currentOptions=this.options,wrapperClass=currentOptions.wrapperClass,ui={screen:$("
    "),placeholder:$("
    "),container:$("
    ")},fragment=this.document[0].createDocumentFragment();return fragment.appendChild(ui.screen[0]),fragment.appendChild(ui.container[0]),myId&&(ui.screen.attr("id",myId+"-screen"),ui.container.attr("id",myId+"-popup"),ui.placeholder.attr("id",myId+"-placeholder").html("")),this._page[0].appendChild(fragment),ui.placeholder.insertAfter(theElement),theElement.detach().addClass("ui-popup "+this._themeClassFromOption("ui-body-",currentOptions.theme)+" "+(currentOptions.shadow?"ui-overlay-shadow ":"")+(currentOptions.corners?"ui-corner-all ":"")).appendTo(ui.container),ui},_eatEventAndClose:function(theEvent){return theEvent.preventDefault(),theEvent.stopImmediatePropagation(),this.options.dismissible&&this.close(),!1},_resizeScreen:function(){var screen=this._ui.screen,popupHeight=this._ui.container.outerHeight(!0),screenHeight=screen.removeAttr("style").height(),documentHeight=this.document.height()-1;screenHeightscreenHeight&&screen.height(popupHeight)},_expectResizeEvent:function(){var windowCoordinates=getWindowCoordinates(this.window);if(this._resizeData){if(windowCoordinates.x===this._resizeData.windowCoordinates.x&&windowCoordinates.y===this._resizeData.windowCoordinates.y&&windowCoordinates.cx===this._resizeData.windowCoordinates.cx&&windowCoordinates.cy===this._resizeData.windowCoordinates.cy)return!1;clearTimeout(this._resizeData.timeoutId)}return this._resizeData={timeoutId:this._delay("_resizeTimeout",200),windowCoordinates:windowCoordinates},!0},_resizeTimeout:function(){this._isOpen?this._expectResizeEvent()||(this._ui.container.hasClass("ui-popup-hidden")&&(this._ui.container.removeClass("ui-popup-hidden ui-popup-truncate"),this.reposition({positionTo:"window"}),this._ignoreResizeEvents()),this._resizeScreen(),this._resizeData=null,this._orientationchangeInProgress=!1):(this._resizeData=null,this._orientationchangeInProgress=!1)},_stopIgnoringResizeEvents:function(){this._ignoreResizeTo=0},_ignoreResizeEvents:function(){this._ignoreResizeTo&&clearTimeout(this._ignoreResizeTo),this._ignoreResizeTo=this._delay("_stopIgnoringResizeEvents",1e3)},_handleWindowResize:function(){this._isOpen&&0===this._ignoreResizeTo&&(!this._expectResizeEvent()&&!this._orientationchangeInProgress||this._ui.container.hasClass("ui-popup-hidden")||this._ui.container.addClass("ui-popup-hidden ui-popup-truncate").removeAttr("style"))},_handleWindowOrientationchange:function(){!this._orientationchangeInProgress&&this._isOpen&&0===this._ignoreResizeTo&&(this._expectResizeEvent(),this._orientationchangeInProgress=!0)},_handleDocumentFocusIn:function(theEvent){var target,targetElement=theEvent.target,ui=this._ui;if(this._isOpen){if(targetElement!==ui.container[0]){if(target=$(targetElement),!$.contains(ui.container[0],targetElement))return $(this.document[0].activeElement).one("focus",$.proxy(function(){this._safelyBlur(targetElement)},this)),ui.focusElement.focus(),theEvent.preventDefault(),theEvent.stopImmediatePropagation(),!1;ui.focusElement[0]===ui.container[0]&&(ui.focusElement=target)}this._ignoreResizeEvents()}},_themeClassFromOption:function(prefix,value){return value?"none"===value?"":prefix+value:prefix+"inherit"},_applyTransition:function(value){return value&&(this._ui.container.removeClass(this._fallbackTransition),"none"!==value&&(this._fallbackTransition=$.mobile._maybeDegradeTransition(value),"none"===this._fallbackTransition&&(this._fallbackTransition=""),this._ui.container.addClass(this._fallbackTransition))),this},_setOptions:function(newOptions){var currentOptions=this.options,theElement=this.element,screen=this._ui.screen;return newOptions.wrapperClass!==undefined&&this._ui.container.removeClass(currentOptions.wrapperClass).addClass(newOptions.wrapperClass),newOptions.theme!==undefined&&theElement.removeClass(this._themeClassFromOption("ui-body-",currentOptions.theme)).addClass(this._themeClassFromOption("ui-body-",newOptions.theme)),newOptions.overlayTheme!==undefined&&(screen.removeClass(this._themeClassFromOption("ui-overlay-",currentOptions.overlayTheme)).addClass(this._themeClassFromOption("ui-overlay-",newOptions.overlayTheme)),this._isOpen&&screen.addClass("in")),newOptions.shadow!==undefined&&theElement.toggleClass("ui-overlay-shadow",newOptions.shadow),newOptions.corners!==undefined&&theElement.toggleClass("ui-corner-all",newOptions.corners),newOptions.transition!==undefined&&(this._currentTransition||this._applyTransition(newOptions.transition)),newOptions.tolerance!==undefined&&this._setTolerance(newOptions.tolerance),newOptions.disabled!==undefined&&newOptions.disabled&&this.close(),this._super(newOptions)},_setTolerance:function(value){var ar,tol={t:30,r:15,b:30,l:15};if(value!==undefined)switch(ar=String(value).split(","),$.each(ar,function(idx,val){ar[idx]=parseInt(val,10)}),ar.length){case 1:isNaN(ar[0])||(tol.t=tol.r=tol.b=tol.l=ar[0]);break;case 2:isNaN(ar[0])||(tol.t=tol.b=ar[0]),isNaN(ar[1])||(tol.l=tol.r=ar[1]);break;case 4:isNaN(ar[0])||(tol.t=ar[0]),isNaN(ar[1])||(tol.r=ar[1]),isNaN(ar[2])||(tol.b=ar[2]),isNaN(ar[3])||(tol.l=ar[3])}return this._tolerance=tol,this},_clampPopupWidth:function(infoOnly){var menuSize,windowCoordinates=getWindowCoordinates(this.window),rectangle={x:this._tolerance.l,y:windowCoordinates.y+this._tolerance.t,cx:windowCoordinates.cx-this._tolerance.l-this._tolerance.r,cy:windowCoordinates.cy-this._tolerance.t-this._tolerance.b};return infoOnly||this._ui.container.css("max-width",rectangle.cx),menuSize={cx:this._ui.container.outerWidth(!0),cy:this._ui.container.outerHeight(!0)},{rc:rectangle,menuSize:menuSize}},_calculateFinalLocation:function(desired,clampInfo){var returnValue,rectangle=clampInfo.rc,menuSize=clampInfo.menuSize;return returnValue={left:fitSegmentInsideSegment(rectangle.cx,menuSize.cx,rectangle.x,desired.x),top:fitSegmentInsideSegment(rectangle.cy,menuSize.cy,rectangle.y,desired.y)},returnValue.top=Math.max(0,returnValue.top),returnValue.top-=Math.min(returnValue.top,Math.max(0,returnValue.top+menuSize.cy-this.document.height())),returnValue},_placementCoords:function(desired){return this._calculateFinalLocation(desired,this._clampPopupWidth())},_createPrerequisites:function(screenPrerequisite,containerPrerequisite,whenDone){var prerequisites,self=this;prerequisites={screen:$.Deferred(),container:$.Deferred()},prerequisites.screen.then(function(){prerequisites===self._prerequisites&&screenPrerequisite()}),prerequisites.container.then(function(){prerequisites===self._prerequisites&&containerPrerequisite()}),Promise.all([prerequisites.screen,prerequisites.container]).then(function(){prerequisites===self._prerequisites&&(self._prerequisites=null,whenDone())}),self._prerequisites=prerequisites},_animate:function(args){return this._ui.screen.removeClass(args.classToRemove).addClass(args.screenClassToAdd),args.prerequisites.screen.resolve(),args.transition&&"none"!==args.transition&&(args.applyTransition&&this._applyTransition(args.transition),this._fallbackTransition)?void this._ui.container.addClass(args.containerClassToAdd).removeClass(args.classToRemove).animationComplete($.proxy(args.prerequisites.container,"resolve")):(this._ui.container.removeClass(args.classToRemove),void args.prerequisites.container.resolve())},_desiredCoords:function(openOptions){var offset,dst=null,windowCoordinates=getWindowCoordinates(this.window),x=openOptions.x,y=openOptions.y,pTo=openOptions.positionTo;if(pTo&&"origin"!==pTo)if("window"===pTo)x=windowCoordinates.cx/2+windowCoordinates.x,y=windowCoordinates.cy/2+windowCoordinates.y;else{try{dst=$(pTo)}catch(err){dst=null}dst&&(dst.filter(":visible"),0===dst.length&&(dst=null))}return dst&&(offset=dst.offset(),x=offset.left+dst.outerWidth()/2,y=offset.top+dst.outerHeight()/2),("number"!==$.type(x)||isNaN(x))&&(x=windowCoordinates.cx/2+windowCoordinates.x),("number"!==$.type(y)||isNaN(y))&&(y=windowCoordinates.cy/2+windowCoordinates.y),{x:x,y:y}},_reposition:function(openOptions){openOptions={x:openOptions.x,y:openOptions.y,positionTo:openOptions.positionTo},this._trigger("beforeposition",undefined,openOptions),this._ui.container.offset(this._placementCoords(this._desiredCoords(openOptions)))},reposition:function(openOptions){this._isOpen&&this._reposition(openOptions)},_safelyBlur:function(currentElement){currentElement!==this.window[0]&&"body"!==currentElement.nodeName.toLowerCase()&&$(currentElement).blur()},_openPrerequisitesComplete:function(){var id=this.element.attr("id");this._ui.container.addClass("ui-popup-active"),this._isOpen=!0,this._resizeScreen(),$.contains(this._ui.container[0],this.document[0].activeElement)||this._safelyBlur(this.document[0].activeElement),this._ignoreResizeEvents(),id&&this.document.find("[aria-haspopup='true'][aria-owns='"+id+"']").attr("aria-expanded",!0),this._trigger("afteropen")},_open:function(options){var openOptions=$.extend({},this.options,options),androidBlacklist=function(){var ua=navigator.userAgent,wkmatch=ua.match(/AppleWebKit\/([0-9\.]+)/),wkversion=!!wkmatch&&wkmatch[1],androidmatch=ua.match(/Android (\d+(?:\.\d+))/),andversion=!!androidmatch&&androidmatch[1],chromematch=ua.indexOf("Chrome")>-1;return!(!(null!==androidmatch&&"4.0"===andversion&&wkversion&&wkversion>534.13)||chromematch)}();this._createPrerequisites($.noop,$.noop,$.proxy(this,"_openPrerequisitesComplete")),this._currentTransition=openOptions.transition,this._applyTransition(openOptions.transition),this._ui.screen.removeClass("ui-screen-hidden"),this._ui.container.removeClass("ui-popup-truncate"),this._reposition(openOptions),this._ui.container.removeClass("ui-popup-hidden"),this.options.overlayTheme&&androidBlacklist&&this.element.closest(".ui-page").addClass("ui-popup-open"),this._animate({additionalCondition:!0,transition:openOptions.transition,classToRemove:"",screenClassToAdd:"in",containerClassToAdd:"in",applyTransition:!1,prerequisites:this._prerequisites})},_closePrerequisiteScreen:function(){this._ui.screen.removeClass("out").addClass("ui-screen-hidden")},_closePrerequisiteContainer:function(){this._ui.container.removeClass("reverse out").addClass("ui-popup-hidden ui-popup-truncate").removeAttr("style")},_closePrerequisitesDone:function(){var container=this._ui.container,id=this.element.attr("id");$.mobile.popup.active=undefined,$(":focus",container[0]).add(container[0]).blur(),id&&this.document.find("[aria-haspopup='true'][aria-owns='"+id+"']").attr("aria-expanded",!1),this._trigger("afterclose")},_close:function(immediate){this._ui.container.removeClass("ui-popup-active"),this._page.removeClass("ui-popup-open"),this._isOpen=!1,this._createPrerequisites($.proxy(this,"_closePrerequisiteScreen"),$.proxy(this,"_closePrerequisiteContainer"),$.proxy(this,"_closePrerequisitesDone")),this._animate({additionalCondition:this._ui.screen.hasClass("in"),transition:immediate?"none":this._currentTransition,classToRemove:"in",screenClassToAdd:"out",containerClassToAdd:"reverse out",applyTransition:!0,prerequisites:this._prerequisites})},_unenhance:function(){this.options.enhanced||(this._setOptions({theme:$.mobile.popup.prototype.options.theme}),this.element.detach().insertAfter(this._ui.placeholder).removeClass("ui-popup ui-overlay-shadow ui-corner-all ui-body-inherit"),this._ui.screen.remove(),this._ui.container.remove(),this._ui.placeholder.remove())},_destroy:function(){return $.mobile.popup.active===this?(this.element.one("popupafterclose",$.proxy(this,"_unenhance")),this.close()):this._unenhance(),this},_closePopup:function(theEvent,data){var parsedDst,toUrl,currentOptions=this.options,immediate=!1;theEvent&&theEvent.isDefaultPrevented()||$.mobile.popup.active!==this||(window.scrollTo(0,this._scrollTop),theEvent&&"pagebeforechange"===theEvent.type&&data&&(parsedDst="string"==typeof data.toPage?data.toPage:data.toPage.data("url"),parsedDst=$.mobile.path.parseUrl(parsedDst),toUrl=parsedDst.pathname+parsedDst.search+parsedDst.hash,this._myUrl!==$.mobile.path.makeUrlAbsolute(toUrl)?immediate=!0:theEvent.preventDefault()),this.window.off(currentOptions.closeEvents),this.element.off(currentOptions.closeLinkEvents,currentOptions.closeLinkSelector),this._close(immediate))},_bindContainerClose:function(){this.window.on(this.options.closeEvents,$.proxy(this,"_closePopup"))},widget:function(){return this._ui.container},open:function(options){var url,hashkey,activePage,currentIsDialog,hasHash,urlHistory,self=this,currentOptions=this.options;return $.mobile.popup.active||currentOptions.disabled?this:($.mobile.popup.active=this,this._scrollTop=this.window.scrollTop(),currentOptions.history?(urlHistory=$.mobile.navigate.history,hashkey=$.mobile.dialogHashKey,activePage=$.mobile.activePage,currentIsDialog=!!activePage&&activePage.hasClass("ui-dialog"),this._myUrl=url=urlHistory.getActive().url,(hasHash=url.indexOf(hashkey)>-1&&!currentIsDialog&&urlHistory.activeIndex>0)?(self._open(options),self._bindContainerClose(),this):(url.indexOf(hashkey)!==-1||currentIsDialog?url=$.mobile.path.parseLocation().hash+hashkey:url+=url.indexOf("#")>-1?hashkey:"#"+hashkey,this.window.one("beforenavigate",function(theEvent){theEvent.preventDefault(),self._open(options),self._bindContainerClose()}),this.urlAltered=!0,$.mobile.navigate(url,{role:"dialog"}),this)):(self._open(options),self._bindContainerClose(),self.element.on(currentOptions.closeLinkEvents,currentOptions.closeLinkSelector,function(theEvent){self.close(),theEvent.preventDefault()}),this))},close:function(){return $.mobile.popup.active!==this?this:(this._scrollTop=this.window.scrollTop(),this.options.history&&this.urlAltered?($.mobile.pageContainer.pagecontainer("back"),this.urlAltered=!1):this._closePopup(),this)}}),$.mobile.popup.handleLink=function($link){var offset,path=$.mobile.path,popup=$(path.hashToSelector(path.parseUrl($link.attr("href")).hash)).first();popup.length>0&&popup.data("mobile-popup")&&(offset=$link.offset(),popup.popup("open",{x:offset.left+$link.outerWidth()/2,y:offset.top+$link.outerHeight()/2,transition:$link.data("transition"),positionTo:$link.data("position-to")})),setTimeout(function(){$link.removeClass($.mobile.activeBtnClass)},300)},$(document).on("pagebeforechange",function(theEvent,data){"popup"===data.options.role&&($.mobile.popup.handleLink(data.options.link),theEvent.preventDefault())})}(jQuery),function($,undefined){function getArrow(){var clone=uiTemplate.clone(),gd=clone.eq(0),ct=clone.eq(1),ar=ct.children();return{arEls:ct.add(gd),gd:gd,ct:ct,ar:ar}}var ieHack=$.mobile.browser.oldIE&&$.mobile.browser.oldIE<=8,uiTemplate=$("
    ");$.widget("mobile.popup",$.mobile.popup,{options:{arrow:""},_create:function(){var ar,ret=this._super();return this.options.arrow&&(this._ui.arrow=ar=this._addArrow()),ret},_addArrow:function(){var theme,opts=this.options,ar=getArrow();return theme=this._themeClassFromOption("ui-body-",opts.theme),ar.ar.addClass(theme+(opts.shadow?" ui-overlay-shadow":"")),ar.arEls.hide().appendTo(this.element),ar},_unenhance:function(){var ar=this._ui.arrow;return ar&&ar.arEls.remove(),this._super()},_tryAnArrow:function(p,dir,desired,s,best){var result,r,diff,desiredForArrow={},tip={};return s.arFull[p.dimKey]>s.guideDims[p.dimKey]?best:(desiredForArrow[p.fst]=desired[p.fst]+(s.arHalf[p.oDimKey]+s.menuHalf[p.oDimKey])*p.offsetFactor-s.contentBox[p.fst]+(s.clampInfo.menuSize[p.oDimKey]-s.contentBox[p.oDimKey])*p.arrowOffsetFactor,desiredForArrow[p.snd]=desired[p.snd],result=s.result||this._calculateFinalLocation(desiredForArrow,s.clampInfo),r={x:result.left,y:result.top},tip[p.fst]=r[p.fst]+s.contentBox[p.fst]+p.tipOffset,tip[p.snd]=Math.max(result[p.prop]+s.guideOffset[p.prop]+s.arHalf[p.dimKey],Math.min(result[p.prop]+s.guideOffset[p.prop]+s.guideDims[p.dimKey]-s.arHalf[p.dimKey],desired[p.snd])),diff=Math.abs(desired.x-tip.x)+Math.abs(desired.y-tip.y),(!best||diff
    4?v:!v}(),$.widget("mobile.popup",{options:{wrapperClass:null,theme:null,overlayTheme:null,shadow:!0,corners:!0,transition:"none",positionTo:"origin",tolerance:null,closeLinkSelector:"a[data-rel='back']",closeLinkEvents:"click.popup",navigateEvents:"navigate.popup",closeEvents:"navigate.popup pagebeforechange.popup",dismissible:!0,enhanced:!1,history:!$.mobile.browser.oldIE},_handleDocumentVmousedown:function(theEvent){this._isOpen&&$.contains(this._ui.container[0],theEvent.target)&&this._ignoreResizeEvents()},_create:function(){var theElement=this.element,myId=theElement.attr("id"),currentOptions=this.options;theElement.addClass("dialog"),currentOptions.history=currentOptions.history&&$.mobile.ajaxEnabled&&$.mobile.hashListeningEnabled,this._on(this.document,{mousedown:"_handleDocumentVmousedown"}),$.extend(this,{_scrollTop:0,_page:theElement.parents("div[data-role='page']"),_ui:null,_fallbackTransition:"",_currentTransition:!1,_prerequisites:null,_isOpen:!1,_tolerance:null,_resizeData:null,_ignoreResizeTo:0,_orientationchangeInProgress:!1}),0===this._page.length&&(this._page=$("body")),currentOptions.enhanced?this._ui={container:theElement.parent(),screen:theElement.parent().prev(),placeholder:$(this.document[0].getElementById(myId+"-placeholder"))}:(this._ui=this._enhance(theElement,myId),this._applyTransition(currentOptions.transition)),this._setTolerance(currentOptions.tolerance)._ui.focusElement=this._ui.container,this._on(this._ui.screen,{click:"_eatEventAndClose"}),this._on(this.window,{orientationchange:$.proxy(this,"_handleWindowOrientationchange"),resize:$.proxy(this,"_handleWindowResize")}),this._on(this.document,{focusin:"_handleDocumentFocusIn"})},_delay:function(handler,delay){function handlerProxy(){return("string"==typeof handler?instance[handler]:handler).apply(instance,arguments)}var instance=this;return setTimeout(handlerProxy,delay||0)},_enhance:function(theElement,myId){var currentOptions=this.options,wrapperClass=currentOptions.wrapperClass,ui={screen:$("
    "),placeholder:$("
    \x3c!-- placeholder --\x3e
    "),container:$("
    ")},fragment=this.document[0].createDocumentFragment();return fragment.appendChild(ui.screen[0]),fragment.appendChild(ui.container[0]),myId&&(ui.screen.attr("id",myId+"-screen"),ui.container.attr("id",myId+"-popup"),ui.placeholder.attr("id",myId+"-placeholder").html("\x3c!-- placeholder for "+myId+" --\x3e")),this._page[0].appendChild(fragment),ui.placeholder.insertAfter(theElement),theElement.detach().addClass("ui-popup "+this._themeClassFromOption("ui-body-",currentOptions.theme)+" "+(currentOptions.shadow?"ui-overlay-shadow ":"")+(currentOptions.corners?"ui-corner-all ":"")).appendTo(ui.container),ui},_eatEventAndClose:function(theEvent){return theEvent.preventDefault(),theEvent.stopImmediatePropagation(),this.options.dismissible&&this.close(),!1},_resizeScreen:function(){var screen=this._ui.screen,popupHeight=this._ui.container.outerHeight(!0),screenHeight=screen.removeAttr("style").height(),documentHeight=this.document.height()-1;screenHeightscreenHeight&&screen.height(popupHeight)},_expectResizeEvent:function(){var windowCoordinates=getWindowCoordinates(this.window);if(this._resizeData){if(windowCoordinates.x===this._resizeData.windowCoordinates.x&&windowCoordinates.y===this._resizeData.windowCoordinates.y&&windowCoordinates.cx===this._resizeData.windowCoordinates.cx&&windowCoordinates.cy===this._resizeData.windowCoordinates.cy)return!1;clearTimeout(this._resizeData.timeoutId)}return this._resizeData={timeoutId:this._delay("_resizeTimeout",200),windowCoordinates:windowCoordinates},!0},_resizeTimeout:function(){this._isOpen?this._expectResizeEvent()||(this._ui.container.hasClass("ui-popup-hidden")&&(this._ui.container.removeClass("ui-popup-hidden ui-popup-truncate"),this.reposition({positionTo:"window"}),this._ignoreResizeEvents()),this._resizeScreen(),this._resizeData=null,this._orientationchangeInProgress=!1):(this._resizeData=null,this._orientationchangeInProgress=!1)},_stopIgnoringResizeEvents:function(){this._ignoreResizeTo=0},_ignoreResizeEvents:function(){this._ignoreResizeTo&&clearTimeout(this._ignoreResizeTo),this._ignoreResizeTo=this._delay("_stopIgnoringResizeEvents",1e3)},_handleWindowResize:function(){this._isOpen&&0===this._ignoreResizeTo&&(!this._expectResizeEvent()&&!this._orientationchangeInProgress||this._ui.container.hasClass("ui-popup-hidden")||this._ui.container.addClass("ui-popup-hidden ui-popup-truncate").removeAttr("style"))},_handleWindowOrientationchange:function(){!this._orientationchangeInProgress&&this._isOpen&&0===this._ignoreResizeTo&&(this._expectResizeEvent(),this._orientationchangeInProgress=!0)},_handleDocumentFocusIn:function(theEvent){var target,targetElement=theEvent.target,ui=this._ui;if(this._isOpen){if(targetElement!==ui.container[0]){if(target=$(targetElement),!$.contains(ui.container[0],targetElement))return $(this.document[0].activeElement).one("focus",$.proxy(function(){this._safelyBlur(targetElement)},this)),ui.focusElement.focus(),theEvent.preventDefault(),theEvent.stopImmediatePropagation(),!1;ui.focusElement[0]===ui.container[0]&&(ui.focusElement=target)}this._ignoreResizeEvents()}},_themeClassFromOption:function(prefix,value){return value?"none"===value?"":prefix+value:prefix+"inherit"},_applyTransition:function(value){return value&&(this._ui.container.removeClass(this._fallbackTransition),"none"!==value&&(this._fallbackTransition=$.mobile._maybeDegradeTransition(value),"none"===this._fallbackTransition&&(this._fallbackTransition=""),this._ui.container.addClass(this._fallbackTransition))),this},_setOptions:function(newOptions){var currentOptions=this.options,theElement=this.element,screen=this._ui.screen;return void 0!==newOptions.wrapperClass&&this._ui.container.removeClass(currentOptions.wrapperClass).addClass(newOptions.wrapperClass),void 0!==newOptions.theme&&theElement.removeClass(this._themeClassFromOption("ui-body-",currentOptions.theme)).addClass(this._themeClassFromOption("ui-body-",newOptions.theme)),void 0!==newOptions.overlayTheme&&(screen.removeClass(this._themeClassFromOption("ui-overlay-",currentOptions.overlayTheme)).addClass(this._themeClassFromOption("ui-overlay-",newOptions.overlayTheme)),this._isOpen&&screen.addClass("in")),void 0!==newOptions.shadow&&theElement.toggleClass("ui-overlay-shadow",newOptions.shadow),void 0!==newOptions.corners&&theElement.toggleClass("ui-corner-all",newOptions.corners),void 0!==newOptions.transition&&(this._currentTransition||this._applyTransition(newOptions.transition)),void 0!==newOptions.tolerance&&this._setTolerance(newOptions.tolerance),void 0!==newOptions.disabled&&newOptions.disabled&&this.close(),this._super(newOptions)},_setTolerance:function(value){var ar,tol={t:30,r:15,b:30,l:15};if(void 0!==value)switch(ar=String(value).split(","),$.each(ar,function(idx,val){ar[idx]=parseInt(val,10)}),ar.length){case 1:isNaN(ar[0])||(tol.t=tol.r=tol.b=tol.l=ar[0]);break;case 2:isNaN(ar[0])||(tol.t=tol.b=ar[0]),isNaN(ar[1])||(tol.l=tol.r=ar[1]);break;case 4:isNaN(ar[0])||(tol.t=ar[0]),isNaN(ar[1])||(tol.r=ar[1]),isNaN(ar[2])||(tol.b=ar[2]),isNaN(ar[3])||(tol.l=ar[3])}return this._tolerance=tol,this},_clampPopupWidth:function(infoOnly){var menuSize,windowCoordinates=getWindowCoordinates(this.window),rectangle={x:this._tolerance.l,y:windowCoordinates.y+this._tolerance.t,cx:windowCoordinates.cx-this._tolerance.l-this._tolerance.r,cy:windowCoordinates.cy-this._tolerance.t-this._tolerance.b};return infoOnly||this._ui.container.css("max-width",rectangle.cx),menuSize={cx:this._ui.container.outerWidth(!0),cy:this._ui.container.outerHeight(!0)},{rc:rectangle,menuSize:menuSize}},_calculateFinalLocation:function(desired,clampInfo){var returnValue,rectangle=clampInfo.rc,menuSize=clampInfo.menuSize;return returnValue={left:fitSegmentInsideSegment(rectangle.cx,menuSize.cx,rectangle.x,desired.x),top:fitSegmentInsideSegment(rectangle.cy,menuSize.cy,rectangle.y,desired.y)},returnValue.top=Math.max(0,returnValue.top),returnValue.top-=Math.min(returnValue.top,Math.max(0,returnValue.top+menuSize.cy-this.document.height())),returnValue},_placementCoords:function(desired){return this._calculateFinalLocation(desired,this._clampPopupWidth())},_createPrerequisites:function(screenPrerequisite,containerPrerequisite,whenDone){var prerequisites,self=this;prerequisites={screen:$.Deferred(),container:$.Deferred()},prerequisites.screen.then(function(){prerequisites===self._prerequisites&&screenPrerequisite()}),prerequisites.container.then(function(){prerequisites===self._prerequisites&&containerPrerequisite()}),Promise.all([prerequisites.screen,prerequisites.container]).then(function(){prerequisites===self._prerequisites&&(self._prerequisites=null,whenDone())}),self._prerequisites=prerequisites},_animate:function(args){if(this._ui.screen.removeClass(args.classToRemove).addClass(args.screenClassToAdd),args.prerequisites.screen.resolve(),args.transition&&"none"!==args.transition&&(args.applyTransition&&this._applyTransition(args.transition),this._fallbackTransition))return void this._ui.container.addClass(args.containerClassToAdd).removeClass(args.classToRemove).animationComplete($.proxy(args.prerequisites.container,"resolve"));this._ui.container.removeClass(args.classToRemove),args.prerequisites.container.resolve()},_desiredCoords:function(openOptions){var offset,dst=null,windowCoordinates=getWindowCoordinates(this.window),x=openOptions.x,y=openOptions.y,pTo=openOptions.positionTo;if(pTo&&"origin"!==pTo)if("window"===pTo)x=windowCoordinates.cx/2+windowCoordinates.x,y=windowCoordinates.cy/2+windowCoordinates.y;else{try{dst=$(pTo)}catch(err){dst=null}dst&&(dst.filter(":visible"),0===dst.length&&(dst=null))}return dst&&(offset=dst.offset(),x=offset.left+dst.outerWidth()/2,y=offset.top+dst.outerHeight()/2),("number"!==$.type(x)||isNaN(x))&&(x=windowCoordinates.cx/2+windowCoordinates.x),("number"!==$.type(y)||isNaN(y))&&(y=windowCoordinates.cy/2+windowCoordinates.y),{x:x,y:y}},_reposition:function(openOptions){openOptions={x:openOptions.x,y:openOptions.y,positionTo:openOptions.positionTo},this._trigger("beforeposition",void 0,openOptions),this._ui.container.offset(this._placementCoords(this._desiredCoords(openOptions)))},reposition:function(openOptions){this._isOpen&&this._reposition(openOptions)},_safelyBlur:function(currentElement){currentElement!==this.window[0]&&"body"!==currentElement.nodeName.toLowerCase()&&$(currentElement).blur()},_openPrerequisitesComplete:function(){var id=this.element.attr("id");this._ui.container.addClass("ui-popup-active"),this._isOpen=!0,this._resizeScreen(),$.contains(this._ui.container[0],this.document[0].activeElement)||this._safelyBlur(this.document[0].activeElement),this._ignoreResizeEvents(),id&&this.document.find("[aria-haspopup='true'][aria-owns='"+id+"']").attr("aria-expanded",!0),this._trigger("afteropen")},_open:function(options){var openOptions=$.extend({},this.options,options),androidBlacklist=function(){var ua=navigator.userAgent,wkmatch=ua.match(/AppleWebKit\/([0-9\.]+)/),wkversion=!!wkmatch&&wkmatch[1],androidmatch=ua.match(/Android (\d+(?:\.\d+))/),andversion=!!androidmatch&&androidmatch[1],chromematch=ua.indexOf("Chrome")>-1;return!(!(null!==androidmatch&&"4.0"===andversion&&wkversion&&wkversion>534.13)||chromematch)}();this._createPrerequisites($.noop,$.noop,$.proxy(this,"_openPrerequisitesComplete")),this._currentTransition=openOptions.transition,this._applyTransition(openOptions.transition),this._ui.screen.removeClass("ui-screen-hidden"),this._ui.container.removeClass("ui-popup-truncate"),this._reposition(openOptions),this._ui.container.removeClass("ui-popup-hidden"),this.options.overlayTheme&&androidBlacklist&&this.element.closest(".ui-page").addClass("ui-popup-open"),this._animate({additionalCondition:!0,transition:openOptions.transition,classToRemove:"",screenClassToAdd:"in",containerClassToAdd:"in",applyTransition:!1,prerequisites:this._prerequisites})},_closePrerequisiteScreen:function(){this._ui.screen.removeClass("out").addClass("ui-screen-hidden")},_closePrerequisiteContainer:function(){this._ui.container.removeClass("reverse out").addClass("ui-popup-hidden ui-popup-truncate").removeAttr("style")},_closePrerequisitesDone:function(){var container=this._ui.container,id=this.element.attr("id");$.mobile.popup.active=void 0,$(":focus",container[0]).add(container[0]).blur(),id&&this.document.find("[aria-haspopup='true'][aria-owns='"+id+"']").attr("aria-expanded",!1),this._trigger("afterclose")},_close:function(immediate){this._ui.container.removeClass("ui-popup-active"),this._page.removeClass("ui-popup-open"),this._isOpen=!1,this._createPrerequisites($.proxy(this,"_closePrerequisiteScreen"),$.proxy(this,"_closePrerequisiteContainer"),$.proxy(this,"_closePrerequisitesDone")),this._animate({additionalCondition:this._ui.screen.hasClass("in"),transition:immediate?"none":this._currentTransition,classToRemove:"in",screenClassToAdd:"out",containerClassToAdd:"reverse out",applyTransition:!0,prerequisites:this._prerequisites})},_unenhance:function(){this.options.enhanced||(this._setOptions({theme:$.mobile.popup.prototype.options.theme}),this.element.detach().insertAfter(this._ui.placeholder).removeClass("ui-popup ui-overlay-shadow ui-corner-all ui-body-inherit"),this._ui.screen.remove(),this._ui.container.remove(),this._ui.placeholder.remove())},_destroy:function(){return $.mobile.popup.active===this?(this.element.one("popupafterclose",$.proxy(this,"_unenhance")),this.close()):this._unenhance(),this},_closePopup:function(theEvent,data){var parsedDst,toUrl,currentOptions=this.options,immediate=!1;theEvent&&theEvent.isDefaultPrevented()||$.mobile.popup.active!==this||(window.scrollTo(0,this._scrollTop),theEvent&&"pagebeforechange"===theEvent.type&&data&&(parsedDst="string"==typeof data.toPage?data.toPage:data.toPage.data("url"),parsedDst=$.mobile.path.parseUrl(parsedDst),toUrl=parsedDst.pathname+parsedDst.search+parsedDst.hash,this._myUrl!==$.mobile.path.makeUrlAbsolute(toUrl)?immediate=!0:theEvent.preventDefault()),this.window.off(currentOptions.closeEvents),this.element.off(currentOptions.closeLinkEvents,currentOptions.closeLinkSelector),this._close(immediate))},_bindContainerClose:function(){this.window.on(this.options.closeEvents,$.proxy(this,"_closePopup"))},widget:function(){return this._ui.container},open:function(options){var url,hashkey,activePage,currentIsDialog,urlHistory,self=this,currentOptions=this.options;return $.mobile.popup.active||currentOptions.disabled?this:($.mobile.popup.active=this,this._scrollTop=this.window.scrollTop(),currentOptions.history?(urlHistory=$.mobile.navigate.history,hashkey=$.mobile.dialogHashKey,activePage=$.mobile.activePage,currentIsDialog=!!activePage&&activePage.hasClass("ui-dialog"),this._myUrl=url=urlHistory.getActive().url,url.indexOf(hashkey)>-1&&!currentIsDialog&&urlHistory.activeIndex>0?(self._open(options),self._bindContainerClose(),this):(-1!==url.indexOf(hashkey)||currentIsDialog?url=$.mobile.path.parseLocation().hash+hashkey:url+=url.indexOf("#")>-1?hashkey:"#"+hashkey,this.window.one("beforenavigate",function(theEvent){theEvent.preventDefault(),self._open(options),self._bindContainerClose()}),this.urlAltered=!0,$.mobile.navigate(url,{role:"dialog"}),this)):(self._open(options),self._bindContainerClose(),self.element.on(currentOptions.closeLinkEvents,currentOptions.closeLinkSelector,function(theEvent){self.close(),theEvent.preventDefault()}),this))},close:function(){return $.mobile.popup.active!==this?this:(this._scrollTop=this.window.scrollTop(),this.options.history&&this.urlAltered?($.mobile.pageContainer.pagecontainer("back"),this.urlAltered=!1):this._closePopup(),this)}}),$.mobile.popup.handleLink=function($link){var offset,path=$.mobile.path,popup=$(path.hashToSelector(path.parseUrl($link.attr("href")).hash)).first();popup.length>0&&popup.data("mobile-popup")&&(offset=$link.offset(),popup.popup("open",{x:offset.left+$link.outerWidth()/2,y:offset.top+$link.outerHeight()/2,transition:$link.data("transition"),positionTo:$link.data("position-to")})),setTimeout(function(){$link.removeClass($.mobile.activeBtnClass)},300)},$(document).on("pagebeforechange",function(theEvent,data){"popup"===data.options.role&&($.mobile.popup.handleLink(data.options.link),theEvent.preventDefault())})}(jQuery),function($,undefined){function getArrow(){var clone=uiTemplate.clone(),gd=clone.eq(0),ct=clone.eq(1),ar=ct.children();return{arEls:ct.add(gd),gd:gd,ct:ct,ar:ar}}var ieHack=$.mobile.browser.oldIE&&$.mobile.browser.oldIE<=8,uiTemplate=$("
    ");$.widget("mobile.popup",$.mobile.popup,{options:{arrow:""},_create:function(){var ret=this._super();return this.options.arrow&&(this._ui.arrow=this._addArrow()),ret},_addArrow:function(){var theme,opts=this.options,ar=getArrow();return theme=this._themeClassFromOption("ui-body-",opts.theme),ar.ar.addClass(theme+(opts.shadow?" ui-overlay-shadow":"")),ar.arEls.hide().appendTo(this.element),ar},_unenhance:function(){var ar=this._ui.arrow;return ar&&ar.arEls.remove(),this._super()},_tryAnArrow:function(p,dir,desired,s,best){var result,r,diff,desiredForArrow={},tip={};return s.arFull[p.dimKey]>s.guideDims[p.dimKey]?best:(desiredForArrow[p.fst]=desired[p.fst]+(s.arHalf[p.oDimKey]+s.menuHalf[p.oDimKey])*p.offsetFactor-s.contentBox[p.fst]+(s.clampInfo.menuSize[p.oDimKey]-s.contentBox[p.oDimKey])*p.arrowOffsetFactor,desiredForArrow[p.snd]=desired[p.snd],result=s.result||this._calculateFinalLocation(desiredForArrow,s.clampInfo),r={x:result.left,y:result.top},tip[p.fst]=r[p.fst]+s.contentBox[p.fst]+p.tipOffset,tip[p.snd]=Math.max(result[p.prop]+s.guideOffset[p.prop]+s.arHalf[p.dimKey],Math.min(result[p.prop]+s.guideOffset[p.prop]+s.guideDims[p.dimKey]-s.arHalf[p.dimKey],desired[p.snd])),diff=Math.abs(desired.x-tip.x)+Math.abs(desired.y-tip.y),(!best||diff0&&(widgetElements[constructor.prototype.widgetName]=$(elements))}});for(index in widgetElements)widgetElements[index][index]();return this}})}(jQuery,this),jQuery.mobile.widgets={},$.fn.extend({enhanceWithin:function(){var index,widgetElements={},that=this;$.each($.mobile.widgets,function(name,constructor){if(constructor.initSelector){var elements=that[0].querySelectorAll(constructor.initSelector);elements.length>0&&(widgetElements[constructor.prototype.widgetName]=$(elements))}});for(index in widgetElements)widgetElements[index][index]();return this}}),jQuery(document).on("create",function(event){jQuery(event.target).enhanceWithin()}),function($,undefined){var uuid=0,slice=Array.prototype.slice,_cleanData=$.cleanData;$.cleanData=function(elems){for(var elem,i=0;null!=(elem=elems[i]);i++)try{$(elem).triggerHandler("remove")}catch(e){}_cleanData(elems)},$.widget=function(name,base,prototype){var fullName,existingConstructor,constructor,basePrototype,proxiedPrototype={},namespace=name.split(".")[0];return name=name.split(".")[1],fullName=namespace+"-"+name,prototype||(prototype=base,base=$.Widget),$.expr[":"][fullName.toLowerCase()]=function(elem){return!!$.data(elem,fullName)},$[namespace]=$[namespace]||{},existingConstructor=$[namespace][name],constructor=$[namespace][name]=function(options,element){return this._createWidget?void(arguments.length&&this._createWidget(options,element)):new constructor(options,element)},$.extend(constructor,existingConstructor,{version:prototype.version,_proto:$.extend({},prototype),_childConstructors:[]}),basePrototype=new base,basePrototype.options=$.widget.extend({},basePrototype.options),$.each(prototype,function(prop,value){return $.isFunction(value)?void(proxiedPrototype[prop]=function(){var _super=function(){return base.prototype[prop].apply(this,arguments)},_superApply=function(args){return base.prototype[prop].apply(this,args)};return function(){var returnValue,__super=this._super,__superApply=this._superApply;return this._super=_super,this._superApply=_superApply,returnValue=value.apply(this,arguments),this._super=__super,this._superApply=__superApply,returnValue}}()):void(proxiedPrototype[prop]=value)}),constructor.prototype=$.widget.extend(basePrototype,{widgetEventPrefix:existingConstructor?basePrototype.widgetEventPrefix||name:name},proxiedPrototype,{constructor:constructor,namespace:namespace,widgetName:name,widgetFullName:fullName}),existingConstructor?($.each(existingConstructor._childConstructors,function(i,child){var childPrototype=child.prototype;$.widget(childPrototype.namespace+"."+childPrototype.widgetName,constructor,child._proto)}),delete existingConstructor._childConstructors):base._childConstructors.push(constructor),$.widget.bridge(name,constructor),constructor},$.widget.extend=function(target){for(var key,value,input=slice.call(arguments,1),inputIndex=0,inputLength=input.length;inputIndex",options:{disabled:!1,create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0],this.element=$(element),this.uuid=uuid++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=$.widget.extend({},this.options,this._getCreateOptions(),options),this.bindings=$(),this.hoverable=$(),this.focusable=$(),element!==this&&($.data(element,this.widgetFullName,this),this._on(!0,this.element,{remove:function(event){event.target===element&&this.destroy()}}),this.document=$(element.style?element.ownerDocument:element.document||element),this.window=$(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:$.noop,_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData($.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:$.noop,widget:function(){return this.element},option:function(key,value){var parts,curOption,i,options=key;if(0===arguments.length)return $.widget.extend({},this.options);if("string"==typeof key)if(options={},parts=key.split("."),key=parts.shift(),parts.length){for(curOption=options[key]=$.widget.extend({},this.options[key]),i=0;i0&&(widgetElements[constructor.prototype.widgetName]=$(elements))}});for(index in widgetElements)widgetElements[index][index]();return this}})}(jQuery),jQuery.mobile.widgets={},$.fn.extend({enhanceWithin:function(){var index,widgetElements={},that=this;$.each($.mobile.widgets,function(name,constructor){if(constructor.initSelector){var elements=that[0].querySelectorAll(constructor.initSelector);elements.length>0&&(widgetElements[constructor.prototype.widgetName]=$(elements))}});for(index in widgetElements)widgetElements[index][index]();return this}}),jQuery(document).on("create",function(event){jQuery(event.target).enhanceWithin()}),function($,undefined){var uuid=0,slice=Array.prototype.slice,_cleanData=$.cleanData;$.cleanData=function(elems){for(var elem,i=0;null!=(elem=elems[i]);i++)try{$(elem).triggerHandler("remove")}catch(e){}_cleanData(elems)},$.widget=function(name,base,prototype){var fullName,existingConstructor,constructor,basePrototype,proxiedPrototype={},namespace=name.split(".")[0];return name=name.split(".")[1],fullName=namespace+"-"+name,prototype||(prototype=base,base=$.Widget),$.expr[":"][fullName.toLowerCase()]=function(elem){return!!$.data(elem,fullName)},$[namespace]=$[namespace]||{},existingConstructor=$[namespace][name],constructor=$[namespace][name]=function(options,element){if(!this._createWidget)return new constructor(options,element);arguments.length&&this._createWidget(options,element)},$.extend(constructor,existingConstructor,{version:prototype.version,_proto:$.extend({},prototype),_childConstructors:[]}),basePrototype=new base,basePrototype.options=$.widget.extend({},basePrototype.options),$.each(prototype,function(prop,value){if(!$.isFunction(value))return void(proxiedPrototype[prop]=value);proxiedPrototype[prop]=function(){var _super=function(){return base.prototype[prop].apply(this,arguments)},_superApply=function(args){return base.prototype[prop].apply(this,args)};return function(){var returnValue,__super=this._super,__superApply=this._superApply;return this._super=_super,this._superApply=_superApply,returnValue=value.apply(this,arguments),this._super=__super,this._superApply=__superApply,returnValue}}()}),constructor.prototype=$.widget.extend(basePrototype,{widgetEventPrefix:existingConstructor?basePrototype.widgetEventPrefix||name:name},proxiedPrototype,{constructor:constructor,namespace:namespace,widgetName:name,widgetFullName:fullName}),existingConstructor?($.each(existingConstructor._childConstructors,function(i,child){var childPrototype=child.prototype;$.widget(childPrototype.namespace+"."+childPrototype.widgetName,constructor,child._proto)}),delete existingConstructor._childConstructors):base._childConstructors.push(constructor),$.widget.bridge(name,constructor),constructor},$.widget.extend=function(target){for(var key,value,input=slice.call(arguments,1),inputIndex=0,inputLength=input.length;inputIndex",options:{disabled:!1,create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0],this.element=$(element),this.uuid=uuid++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=$.widget.extend({},this.options,this._getCreateOptions(),options),this.bindings=$(),this.hoverable=$(),this.focusable=$(),element!==this&&($.data(element,this.widgetFullName,this),this._on(!0,this.element,{remove:function(event){event.target===element&&this.destroy()}}),this.document=$(element.style?element.ownerDocument:element.document||element),this.window=$(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:$.noop,_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData($.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:$.noop,widget:function(){return this.element},option:function(key,value){var parts,curOption,i,options=key;if(0===arguments.length)return $.widget.extend({},this.options);if("string"==typeof key)if(options={},parts=key.split("."),key=parts.shift(),parts.length){for(curOption=options[key]=$.widget.extend({},this.options[key]),i=0;i - From c6a2844100bbbc62b7eabf10588ea40a9d81620e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 18 Mar 2018 16:41:52 -0400 Subject: [PATCH 6/6] * exclude default.ext from photo libraries; use wmc naming conventions for recordings with dates in file names; Improve performance of grouping movies into collections --- .../ApplicationHost.cs | 2 +- .../Collections/CollectionManager.cs | 2 +- .../Data/SqliteUserDataRepository.cs | 48 ------------------ .../EntryPoints/ExternalPortForwarding.cs | 1 - .../HttpServer/HttpListenerHost.cs | 2 +- .../Library/Resolvers/PhotoResolver.cs | 3 +- .../LiveTv/EmbyTV/RecordingHelper.cs | 16 +++++- .../LiveTv/Listings/SchedulesDirect.cs | 2 +- .../Session/FirebaseSessionController.cs | 27 +++++----- .../Session/HttpSessionController.cs | 2 +- MediaBrowser.Api/Images/ImageService.cs | 11 +--- .../UserLibrary/BaseItemsRequest.cs | 3 -- MediaBrowser.Api/UserLibrary/ItemsService.cs | 1 - MediaBrowser.Common/Net/HttpRequestOptions.cs | 1 + MediaBrowser.Controller/Entities/Folder.cs | 31 +++++++---- .../Entities/InternalItemsQuery.cs | 1 - .../Entities/UserViewBuilder.cs | 11 +--- .../MediaEncoding/EncodingHelper.cs | 26 +++++----- .../Configuration/ServerConfiguration.cs | 2 +- MediaBrowser.Model/Net/WebSocketMessage.cs | 1 + .../Manager/ProviderManager.cs | 11 ++++ SharedVersion.cs | 2 +- ThirdParty/emby/Emby.Server.CinemaMode.dll | Bin 27648 -> 27648 bytes ThirdParty/emby/Emby.Server.Connect.dll | Bin 64512 -> 64512 bytes ThirdParty/emby/Emby.Server.MediaEncoding.dll | Bin 273408 -> 273408 bytes ThirdParty/emby/Emby.Server.Sync.dll | Bin 190464 -> 190976 bytes 26 files changed, 87 insertions(+), 119 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 9e4b122a79..8244490fc5 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1936,7 +1936,7 @@ public bool EnableHttps { get { - return SupportsHttps && (ServerConfigurationManager.Configuration.EnableHttps || ServerConfigurationManager.Configuration.RequireHttps); + return SupportsHttps && ServerConfigurationManager.Configuration.EnableHttps; } } diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.cs index 0cdbc3bad8..2ef4c6fdc9 100644 --- a/Emby.Server.Implementations/Collections/CollectionManager.cs +++ b/Emby.Server.Implementations/Collections/CollectionManager.cs @@ -294,7 +294,7 @@ public IEnumerable CollapseItemsWithinBoxSets(IEnumerable it var itemId = item.Id; var currentBoxSets = allBoxsets - .Where(i => i.GetLinkedChildren().Any(j => j.Id == itemId)) + .Where(i => i.ContainsLinkedChildByItemId(itemId)) .ToList(); if (currentBoxSets.Count > 0) diff --git a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs index 3eceac8344..1d4c869473 100644 --- a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs @@ -78,15 +78,6 @@ public void Initialize(ReaderWriterLockSlim writeLock, ManagedConnection managed AddColumn(db, "userdata", "AudioStreamIndex", "int", existingColumnNames); AddColumn(db, "userdata", "SubtitleStreamIndex", "int", existingColumnNames); }, TransactionMode); - - try - { - ImportUserDataIfNeeded(connection); - } - catch (Exception ex) - { - Logger.ErrorException("Error in ImportUserDataIfNeeded", ex); - } } } @@ -98,45 +89,6 @@ protected override bool EnableTempStoreMemory } } - private void ImportUserDataIfNeeded(ManagedConnection connection) - { - if (!_fileSystem.FileExists(_importFile)) - { - return; - } - - var fileToImport = _importFile; - var isImported = connection.Query("select IsUserDataImported from DataSettings").SelectScalarBool().FirstOrDefault(); - - if (isImported) - { - return; - } - - ImportUserData(connection, fileToImport); - - connection.RunInTransaction(db => - { - using (var statement = db.PrepareStatement("replace into DataSettings (IsUserDataImported) values (@IsUserDataImported)")) - { - statement.TryBind("@IsUserDataImported", true); - statement.MoveNext(); - } - }, TransactionMode); - } - - private void ImportUserData(ManagedConnection connection, string file) - { - SqliteExtensions.Attach(connection, file, "UserDataBackup"); - - var columns = "key, userId, rating, played, playCount, isFavorite, playbackPositionTicks, lastPlayedDate, AudioStreamIndex, SubtitleStreamIndex"; - - connection.RunInTransaction(db => - { - db.Execute("REPLACE INTO userdata(" + columns + ") SELECT " + columns + " FROM UserDataBackup.userdata;"); - }, TransactionMode); - } - /// /// Saves the user data. /// diff --git a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs index c09f6cec97..044552d71e 100644 --- a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs +++ b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs @@ -56,7 +56,6 @@ private string GetConfigIdentifier() values.Add(config.PublicPort.ToString(CultureInfo.InvariantCulture)); values.Add(_appHost.HttpPort.ToString(CultureInfo.InvariantCulture)); values.Add(_appHost.HttpsPort.ToString(CultureInfo.InvariantCulture)); - values.Add((config.EnableHttps || config.RequireHttps).ToString()); values.Add(_appHost.EnableHttps.ToString()); values.Add((config.EnableRemoteAccess).ToString()); diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs index 5bce9d4a2d..35c237e647 100644 --- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -466,7 +466,7 @@ private bool ValidateRequest(string remoteIp, bool isLocal) private bool ValidateSsl(string remoteIp, string urlString) { - if (_config.Configuration.RequireHttps && _appHost.EnableHttps) + if (_config.Configuration.RequireHttps && _appHost.EnableHttps && !_config.Configuration.IsBehindProxy) { if (urlString.IndexOf("https://", StringComparison.OrdinalIgnoreCase) == -1) { diff --git a/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs b/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs index 48f5802a92..e3cce5f4bd 100644 --- a/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs @@ -94,7 +94,8 @@ internal static bool IsOwnedByResolvedMedia(ILibraryManager libraryManager, Libr "backdrop", "poster", "cover", - "logo" + "logo", + "default" }; internal static bool IsImageFile(string path, IImageProcessor imageProcessor) diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs index a5712b4808..9c702c2369 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs @@ -30,7 +30,7 @@ public static string GetRecordingName(TimerInfo info) } else { - name += " " + DateTime.Now.ToString("yyyy-MM-dd"); + name += " " + GetDateString(info.StartDate); } if (!string.IsNullOrWhiteSpace(info.EpisodeTitle)) @@ -50,10 +50,22 @@ public static string GetRecordingName(TimerInfo info) } else { - name += " " + info.StartDate.ToString("yyyy-MM-dd"); + name += " " + GetDateString(info.StartDate); } return name; } + + private static string GetDateString(DateTime date) + { + return string.Format("{0}_{1}_{2}_{3}_{4}_{5}", + date.Year.ToString("0000", CultureInfo.InvariantCulture), + date.Month.ToString("00", CultureInfo.InvariantCulture), + date.Day.ToString("00", CultureInfo.InvariantCulture), + date.Hour.ToString("00", CultureInfo.InvariantCulture), + date.Minute.ToString("00", CultureInfo.InvariantCulture), + date.Second.ToString("00", CultureInfo.InvariantCulture) + ); + } } } diff --git a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs index 389abfe5d8..b900fea2bf 100644 --- a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs +++ b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs @@ -295,7 +295,7 @@ private ProgramInfo GetProgram(string channelId, ScheduleDirect.Program programI EpisodeTitle = episodeTitle, Audio = audioType, //IsNew = programInfo.@new ?? false, - IsRepeat = programInfo.repeat, + IsRepeat = programInfo.@new == null, IsSeries = string.Equals(details.entityType, "episode", StringComparison.OrdinalIgnoreCase), ImageUrl = details.primaryImage, ThumbImageUrl = details.thumbImage, diff --git a/Emby.Server.Implementations/Session/FirebaseSessionController.cs b/Emby.Server.Implementations/Session/FirebaseSessionController.cs index 321fbed2ff..3b1cbcecf8 100644 --- a/Emby.Server.Implementations/Session/FirebaseSessionController.cs +++ b/Emby.Server.Implementations/Session/FirebaseSessionController.cs @@ -71,20 +71,27 @@ public async Task SendMessage(string name, string messageId, T data, ISession return; } + foreach (var controller in allControllers) + { + // Don't send if there's an active web socket connection + if ((controller is WebSocketController) && controller.IsSessionActive) + { + return; + } + } + var msg = new WebSocketMessage { Data = data, MessageType = name, - MessageId = messageId + MessageId = messageId, + ServerId = _appHost.SystemId }; - var req = new FirebaseBody + var req = new FirebaseBody { to = _token, - data = new FirebaseData - { - msgdata = _json.SerializeToString(data) - } + data = msg }; var byteArray = Encoding.UTF8.GetBytes(_json.SerializeToString(req)); @@ -116,13 +123,9 @@ public async Task SendMessage(string name, string messageId, T data, ISession } } - internal class FirebaseBody + internal class FirebaseBody { public string to { get; set; } - public FirebaseData data { get; set; } - } - internal class FirebaseData - { - public string msgdata { get; set; } + public WebSocketMessage data { get; set; } } } diff --git a/Emby.Server.Implementations/Session/HttpSessionController.cs b/Emby.Server.Implementations/Session/HttpSessionController.cs index 8415f6aebb..b3a3ce395f 100644 --- a/Emby.Server.Implementations/Session/HttpSessionController.cs +++ b/Emby.Server.Implementations/Session/HttpSessionController.cs @@ -126,7 +126,7 @@ private Task SendPlaystateCommand(PlaystateRequest command, string messageId, Ca return SendMessage(command.Command.ToString(), messageId, args, cancellationToken); } - private string[] _supportedMessages = new string[] { "LibraryChanged", "ServerRestarting", "ServerShuttingDown", "RestartRequired" }; + private string[] _supportedMessages = new string[] { }; public Task SendMessage(string name, string messageId, T data, ISessionController[] allControllers, CancellationToken cancellationToken) { if (!IsSessionActive) diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs index 96ee237607..cc03d56437 100644 --- a/MediaBrowser.Api/Images/ImageService.cs +++ b/MediaBrowser.Api/Images/ImageService.cs @@ -682,15 +682,8 @@ private ImageFormat[] GetClientSupportedFormats() formats.Add(ImageFormat.Webp); } - if (SupportsFormat(supportedFormats, acceptParam, "jpg", true)) - { - formats.Add(ImageFormat.Jpg); - } - - if (SupportsFormat(supportedFormats, acceptParam, "png", true)) - { - formats.Add(ImageFormat.Png); - } + formats.Add(ImageFormat.Jpg); + formats.Add(ImageFormat.Png); if (SupportsFormat(supportedFormats, acceptParam, "gif", true)) { diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs b/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs index 88d080db58..b1328421ef 100644 --- a/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs +++ b/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs @@ -103,9 +103,6 @@ protected BaseItemsRequest() [ApiMember(Name = "HasTvdbId", Description = "Optional filter by items that have a tvdb id or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")] public bool? HasTvdbId { get; set; } - [ApiMember(Name = "IsInBoxSet", Description = "Optional filter by items that are in boxsets, or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")] - public bool? IsInBoxSet { get; set; } - public string ExcludeItemIds { get; set; } public bool EnableTotalRecordCount { get; set; } diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index ac3e7f6c15..3cd3468624 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -272,7 +272,6 @@ private InternalItemsQuery GetItemsQuery(GetItems request, DtoOptions dtoOptions HasImdbId = request.HasImdbId, IsPlaceHolder = request.IsPlaceHolder, IsLocked = request.IsLocked, - IsInBoxSet = request.IsInBoxSet, IsHD = request.IsHD, Is3D = request.Is3D, HasTvdbId = request.HasTvdbId, diff --git a/MediaBrowser.Common/Net/HttpRequestOptions.cs b/MediaBrowser.Common/Net/HttpRequestOptions.cs index 8f0b155f34..c61e88c878 100644 --- a/MediaBrowser.Common/Net/HttpRequestOptions.cs +++ b/MediaBrowser.Common/Net/HttpRequestOptions.cs @@ -106,6 +106,7 @@ public string UserAgent public bool EnableDefaultUserAgent { get; set; } public bool AppendCharsetToMimeType { get; set; } + public string DownloadFilePath { get; set; } private string GetHeaderValue(string name) { diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 8c6c9fe295..4e7b21d7c6 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -818,12 +818,6 @@ private bool RequiresPostFiltering(InternalItemsQuery query) } } - if (query.IsInBoxSet.HasValue) - { - Logger.Debug("Query requires post-filtering due to IsInBoxSet"); - return true; - } - // Filter by Video3DFormat if (query.Is3D.HasValue) { @@ -1187,11 +1181,6 @@ private static bool AllowBoxSetCollapsing(InternalItemsQuery request) return false; } - if (request.IsInBoxSet.HasValue) - { - return false; - } - if (request.IsLocked.HasValue) { return false; @@ -1458,6 +1447,26 @@ protected virtual bool FilterLinkedChildrenPerUser } } + public bool ContainsLinkedChildByItemId(Guid itemId) + { + var linkedChildren = LinkedChildren; + foreach (var i in linkedChildren) + { + if (i.ItemId.HasValue && i.ItemId.Value == itemId) + { + return true; + } + + var child = GetLinkedChild(i); + + if (child != null && child.Id == itemId) + { + return true; + } + } + return false; + } + public List GetLinkedChildren(User user) { if (!FilterLinkedChildrenPerUser || user == null) diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs index e9b6f2268e..eb8a557042 100644 --- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs +++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs @@ -60,7 +60,6 @@ public class InternalItemsQuery public bool? Is3D { get; set; } public bool? IsHD { get; set; } - public bool? IsInBoxSet { get; set; } public bool? IsLocked { get; set; } public bool? IsPlaceHolder { get; set; } diff --git a/MediaBrowser.Controller/Entities/UserViewBuilder.cs b/MediaBrowser.Controller/Entities/UserViewBuilder.cs index 0fb561aa40..4ca854ab22 100644 --- a/MediaBrowser.Controller/Entities/UserViewBuilder.cs +++ b/MediaBrowser.Controller/Entities/UserViewBuilder.cs @@ -134,7 +134,7 @@ private QueryResult GetMovieFolders(Folder parent, User user, Internal if (query.IncludeItemTypes.Length == 0) { - query.IncludeItemTypes = new[] { typeof(Movie).Name, typeof(BoxSet).Name }; + query.IncludeItemTypes = new[] { typeof(Movie).Name }; } return parent.QueryRecursive(query); @@ -563,15 +563,6 @@ public static bool Filter(BaseItem item, User user, InternalItemsQuery query, IU } } - if (query.IsInBoxSet.HasValue) - { - var val = query.IsInBoxSet.Value; - if (item.GetParents().OfType().Any() != val) - { - return false; - } - } - // Filter by Video3DFormat if (query.Is3D.HasValue) { diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index ffc31a429c..a66aa599c6 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -668,18 +668,18 @@ public string GetVideoQualityParam(EncodingJobInfo state, string videoEncoder, E // h264 (h264_qsv) else if (string.Equals(videoEncoder, "h264_qsv", StringComparison.OrdinalIgnoreCase)) { - string[] valid_h264_qsv = new string [] {"veryslow", "slower", "slow", "medium", "fast", "faster", "veryfast" }; - - if(Array.IndexOf(valid_h264_qsv,encodingOptions.H264Preset.ToLower()) != -1) - { - param += "-preset " + encodingOptions.H264Preset; - } - else - { - param += "-preset 7"; - } - - param += " -look_ahead 0"; + string[] valid_h264_qsv = new string[] { "veryslow", "slower", "slow", "medium", "fast", "faster", "veryfast" }; + + if (valid_h264_qsv.Contains(encodingOptions.H264Preset, StringComparer.OrdinalIgnoreCase)) + { + param += "-preset " + encodingOptions.H264Preset; + } + else + { + param += "-preset 7"; + } + + param += " -look_ahead 0"; } @@ -2460,4 +2460,4 @@ public string GetProgressiveAudioFullCommandLine(EncodingJobInfo state, Encoding } } -} +} \ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index aa322829aa..7c728f2acc 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -214,7 +214,7 @@ public ServerConfiguration() PublicHttpsPort = DefaultHttpsPort; HttpServerPortNumber = DefaultHttpPort; HttpsPortNumber = DefaultHttpsPort; - EnableHttps = false; + EnableHttps = true; EnableDashboardResponseCaching = true; EnableAnonymousUsageReporting = true; EnableCaseSensitiveItemIds = true; diff --git a/MediaBrowser.Model/Net/WebSocketMessage.cs b/MediaBrowser.Model/Net/WebSocketMessage.cs index a093729a15..c049a96ef0 100644 --- a/MediaBrowser.Model/Net/WebSocketMessage.cs +++ b/MediaBrowser.Model/Net/WebSocketMessage.cs @@ -13,6 +13,7 @@ public class WebSocketMessage /// The type of the message. public string MessageType { get; set; } public string MessageId { get; set; } + public string ServerId { get; set; } /// /// Gets or sets the data. /// diff --git a/MediaBrowser.Providers/Manager/ProviderManager.cs b/MediaBrowser.Providers/Manager/ProviderManager.cs index 8828684353..8e033d9943 100644 --- a/MediaBrowser.Providers/Manager/ProviderManager.cs +++ b/MediaBrowser.Providers/Manager/ProviderManager.cs @@ -161,6 +161,17 @@ public async Task SaveImage(BaseItem item, string url, ImageType type, int? imag }).ConfigureAwait(false)) { + // Workaround for tvheadend channel icons + // TODO: Isolate this hack into the tvh plugin + if (string.IsNullOrEmpty(response.ContentType)) + { + if (response.ResponseUrl.IndexOf("/imagecache/", StringComparison.OrdinalIgnoreCase) != -1) + { + response.ContentType = "image/png"; + } + + } + await SaveImage(item, response.Content, response.ContentType, type, imageIndex, cancellationToken).ConfigureAwait(false); } } diff --git a/SharedVersion.cs b/SharedVersion.cs index 8643d86543..80ae4e2e7f 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.3.1.5")] +[assembly: AssemblyVersion("3.3.1.6")] diff --git a/ThirdParty/emby/Emby.Server.CinemaMode.dll b/ThirdParty/emby/Emby.Server.CinemaMode.dll index dbf5fac8cfd4d2b1cdb0feb0c533b93eeecf5240..6d69b34bd139dae06081427a17baf605a60bb396 100644 GIT binary patch delta 137 zcmZp;!PszvaY6^P+1Yg)yHA>EGcvF;K)?(U5X}sP2(cG@NMf7oO=A@W9?#pjt?_@f z*UUvf?JK1kR&Rb2*21F$G%gCHlnIDs7#SEk8i6>Ofgvc^C3uPXj+g%npL)-K;Bk`Y N{*;BA=Om|a003whD9Zo< delta 137 zcmZp;!PszvaY6@kOT*%g-6u`785md?AYg_Fh-L;tgxCu{B(cr)rm>0w6BB$xi`U8d zEtFrrGV@R*+vYc6Ej&6v>qwHByyi6}ykiHOubx`5>Cztskd2f7 ef07jVY;LM|^42-mmG+B&$Xt{BzFFh*4GsXZ-!oAF delta 152 zcmZqp!QAkJc|r$sOT*%g-8=J{o-s~#D_AD*jB$nfUO{(;4SEbf02KUFUH~?+IP+*?-S{_vyWBAAaILv{~cx4GsV=^E5R8 diff --git a/ThirdParty/emby/Emby.Server.MediaEncoding.dll b/ThirdParty/emby/Emby.Server.MediaEncoding.dll index 9a47475eb9284aff6ad696e499244dfce4a7c59e..ff930f64df0388332f1dceba2fdab1d26e89b3ce 100644 GIT binary patch delta 17500 zcmaK!34Bb~8~5*X&b`TqBqkEF%R-V7OJk3SER%I2)Gi3I?~)77X8&@9YP~3P6;Uoh%ALN*HOb^oJ<;MX`a^|BzV}*q==NM+8a8xdg(K@k9W% zys_B9-kq!-1#6VMVzapb^wTs?`GCLnp`LtCmyGf={ezc0I6#x?%WlEi2XA?vp5jy8_y*ODZz#v;HokI} z{=rX<)WhK~4`Ux(6zljPJt#0h`DlC@EKv4N@KuIRhzZ$-E_F<81ff~}84%oV2nKKQ zMz=^(I7bjf`7GK+!8ZGq3Go2`Dh(!$Af%DKa8fMkAKOSM2sDLYAe+0$W`t-LIjeSB zUp?*JhShd0JYD3$wJpZz7Sn6en8gCceeyE0w2`uKa%6+oGOWOyu#nZt#mVilPIYAy zz%Hfjlx#St*ro)uJCFI~OW248E#2i^2*ebF6irNN*z-m~zT!+vC$j1)6v&U1^Haj% ziSoyk2V`@IvTs5I`;)1g0Zu8ar-!@#5P~Jj50y`*Tj06fbp`;mQR>W$4%r@B-Kge9 zc^`rih^aptU(Iqv`H0eUW*0c4Y?|pC0AWJGlw=~f&34H*;n0ZZDDqCMqm5!CG;2WR-8jB^va38_ z89V0>Lc{HY=gtBW6|P*J*Vg-uaGX#bu@qAa96Bw$T;$I7P^*jBC=G?`YPoF7{}oMc z;KbJJlCPu|g~K*wbkPmtMl{TKLs{OApX7J!eTq{7K2$0eros{B=E5j=rMQ+{B;Jjc zA43vR#oA9U zUIcJV>AAEu+)@@UZ9zzc{lL-|E|96*UfBu?>^|iKp?+x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6qdoal{T z->P3xSyII2OR+kBN#HcT=Ec7G6oBAupd6rVf7|8#p~FH)^tIcB9R_xO)nq^D)UR~m zl~4L*L4;X{E&2%8R|U>~**EJ40KYE$MFzm&uL42>{8~+7n+A} z-%f+WH2CUj{R;9a;mC2&re7_^_mALf!KGwb-n?S+__-f+4HzUN%~yaWjz=ZOH>B)$ zY+3Fic`Nkq3HspI(U5-2OFmH|H|Je^9FK}T^qnt$nI7LYjLYn1JVAHn0g*!zN2N3> yWwBA(4B_oDzDY+}Pl0=RXf`DiNwKmW`}^Gf{U&AFfo#{qpBu*CA^I1@f&T}kTe|iD

    ':'
    ',cardImageContainerClose="
    "):(cardImageContainerOpen=imgUrl?'");var cardScalableClass="cardScalable";layoutManager.tv&&!options.cardLayout&&(cardScalableClass+=" card-focuscontent",enableFocusTransfrom||(cardScalableClass+=" card-focuscontent-large")),cardImageContainerOpen='
    '+cardImageContainerOpen,cardBoxClose="
    ",cardScalableClose="
    ";var indicatorsHtml="";if(options.missingIndicator!==!1&&(indicatorsHtml+=indicators.getMissingIndicator(item)),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()}indicatorsHtml&&(cardImageContainerOpen+='
    '+indicatorsHtml+"
    "),imgUrl||(cardImageContainerOpen+=getCardDefaultText(item,options));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+overlayButtons+cardScalableClose+outerCardFooter+cardBoxClose+""}function getCardDefaultText(item,options){var collectionType=item.CollectionType;if("livetv"===collectionType)return'';if("homevideos"===collectionType||"photos"===collectionType)return'';if("music"===collectionType)return'';if("MusicAlbum"===item.Type)return'';if("MusicArtist"===item.Type||"Person"===item.Type)return'';if(options.defaultCardImageIcon)return''+options.defaultCardImageIcon+"";var defaultName=isUsingLiveTvNaming(item)?item.Name:itemHelper.getDisplayName(item);return'
    '+defaultName+"
    "}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>=1920?9.000000000009:screenWidth>=1600?8:screenWidth>=1400?7.0000000000021:screenWidth>=1200?5.9999999988:screenWidth>=800?5:screenWidth>=700?4:3.0000000003;case"square":return layoutManager.tv?5.9999999988:screenWidth>=2200?10:screenWidth>=1920?9.000000000009:screenWidth>=1600?8:screenWidth>=1400?7.0000000000021:screenWidth>=1200?5.9999999988:screenWidth>=800?5:screenWidth>=700?4:screenWidth>=500?3.0000000003:2;case"banner":return screenWidth>=2200?4:screenWidth>=1200?3.0000000003:screenWidth>=800?2:1;case"backdrop":return layoutManager.tv?4:screenWidth>=2500?6:screenWidth>=1600?5:screenWidth>=1200?4:screenWidth>=770?3:screenWidth>=420?2:1;case"smallBackdrop":return screenWidth>=1600?8:screenWidth>=1400?7.000000000007001:screenWidth>=1200?6:screenWidth>=1e3?5:screenWidth>=800?4:screenWidth>=500?3.0000000003:2;case"overflowSmallBackdrop":return layoutManager.tv?100/18.9:isOrientationLandscape?screenWidth>=800?100/15.5:100/23.3:screenWidth>=540?100/30:100/72;case"overflowPortrait":return layoutManager.tv?100/15.5:isOrientationLandscape?screenWidth>=1700?100/11.6:100/15.5:screenWidth>=1400?100/15:screenWidth>=1200?100/18:screenWidth>=760?100/23:screenWidth>=400?100/31.5:100/42;case"overflowSquare":return layoutManager.tv?100/15.5:isOrientationLandscape?screenWidth>=1700?100/11.6:100/15.5:screenWidth>=1400?100/15:screenWidth>=1200?100/18:screenWidth>=760?100/23:screenWidth>=540?100/31.5:100/42;case"overflowBackdrop":return layoutManager.tv?100/23.3:isOrientationLandscape?screenWidth>=1700?100/18.5:100/23.3:screenWidth>=1800?100/23.5:screenWidth>=1400?100/30:screenWidth>=760?2.5:screenWidth>=640?100/56:100/72;default:return 4}}function isResizable(windowWidth){var screen=window.screen;if(screen){if(screen.availWidth-windowWidth>20)return!0}return!1}function getImageWidth(shape,screenWidth,isOrientationLandscape){var imagesPerRow=getPostersPerRow(shape,screenWidth,isOrientationLandscape),shapeWidth=screenWidth/imagesPerRow;return Math.round(shapeWidth)}function setCardData(items,options){options.shape=options.shape||"auto";var primaryImageAspectRatio=imageLoader.getPrimaryImageAspectRatio(items);if("auto"===options.shape||"autohome"===options.shape||"autooverflow"===options.shape||"autoVertical"===options.shape){var requestedShape=options.shape;options.shape=null,primaryImageAspectRatio&&(primaryImageAspectRatio>=3?(options.shape="banner",options.coverImage=!0):options.shape=primaryImageAspectRatio>=1.33?"autooverflow"===requestedShape?"overflowBackdrop":"backdrop":primaryImageAspectRatio>.71?"autooverflow"===requestedShape?"overflowSquare":"square":"autooverflow"===requestedShape?"overflowPortrait":"portrait"),options.shape||(options.shape=options.defaultShape||("autooverflow"===requestedShape?"overflowSquare":"square"))}if("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]),!options.width){var screenWidth=dom.getWindowSize().innerWidth,screenHeight=dom.getWindowSize().innerHeight;if(isResizable(screenWidth)){screenWidth=100*Math.floor(screenWidth/100)}options.width=getImageWidth(options.shape,screenWidth,screenWidth>1.3*screenHeight)}}function buildCardsHtmlInternal(items,options){var isVertical;"autoVertical"===options.shape&&(isVertical=!0),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+="