From c2290dd41d5c1c1a45f5c18f8cd01aa01e1fd70d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 3 Oct 2016 02:28:45 -0400 Subject: [PATCH] update lists --- dashboard-ui/addplugin.html | 10 +- .../emby-apiclient/connectionmanager.js | 5 + .../emby-webcomponents/.bower.json | 8 +- .../browserdeviceprofile.js | 9 + .../cardbuilder/cardbuilder.js | 21 +- .../emby-webcomponents/datetime.js | 38 +- .../dialoghelper/dialoghelper.js | 2 +- .../emby-button/emby-button.css | 2 +- .../emby-input/emby-input.css | 2 +- .../emby-select/emby-select.css | 2 +- .../emby-textarea/emby-textarea.css | 2 +- .../emby-webcomponents/listview/listview.css | 24 +- .../emby-webcomponents/listview/listview.js | 81 +++-- .../emby-webcomponents/sharing/sharingmenu.js | 10 +- dashboard-ui/css/site.css | 10 +- dashboard-ui/itemdetails.html | 9 +- dashboard-ui/livetv.html | 3 +- dashboard-ui/livetvseriestimer.html | 2 +- dashboard-ui/mypreferencesmenu.html | 18 +- dashboard-ui/scripts/addpluginpage.js | 336 ++++++++---------- dashboard-ui/scripts/itemdetailpage.js | 10 - dashboard-ui/scripts/librarybrowser.js | 4 + dashboard-ui/scripts/livetvchannel.js | 4 +- dashboard-ui/scripts/livetvcomponents.js | 100 +----- dashboard-ui/scripts/livetvrecordings.js | 176 ++++----- dashboard-ui/scripts/livetvschedule.js | 44 +-- dashboard-ui/scripts/livetvseriestimer.js | 42 ++- dashboard-ui/scripts/livetvseriestimers.js | 127 ++++--- dashboard-ui/scripts/livetvsuggested.js | 50 ++- dashboard-ui/scripts/moviecollections.js | 3 +- dashboard-ui/scripts/notificationsettings.js | 2 +- dashboard-ui/scripts/sections.js | 4 +- dashboard-ui/scripts/site.js | 7 +- 33 files changed, 540 insertions(+), 627 deletions(-) diff --git a/dashboard-ui/addplugin.html b/dashboard-ui/addplugin.html index 59f76b73dd..ac27238180 100644 --- a/dashboard-ui/addplugin.html +++ b/dashboard-ui/addplugin.html @@ -1,4 +1,4 @@ -
+
@@ -77,14 +77,6 @@

-
-
-
-
-
-
-
-

diff --git a/dashboard-ui/bower_components/emby-apiclient/connectionmanager.js b/dashboard-ui/bower_components/emby-apiclient/connectionmanager.js index 2713d79ae4..35b3e9eb46 100644 --- a/dashboard-ui/bower_components/emby-apiclient/connectionmanager.js +++ b/dashboard-ui/bower_components/emby-apiclient/connectionmanager.js @@ -1087,6 +1087,11 @@ Servers: [server] }); + } if (result.Id != server.Id) { + + // http request succeeded, but it's a different server than what was expected + testNextConnectionMode(tests, index + 1, server, options, resolve); + } else { console.log('calling onSuccessfulConnection with connection mode ' + mode + ' with server ' + server.Name); onSuccessfulConnection(server, result, mode, options, resolve); diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index 122b18482c..356b47e45d 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/.bower.json +++ b/dashboard-ui/bower_components/emby-webcomponents/.bower.json @@ -14,12 +14,12 @@ }, "devDependencies": {}, "ignore": [], - "version": "1.4.281", - "_release": "1.4.281", + "version": "1.4.283", + "_release": "1.4.283", "_resolution": { "type": "version", - "tag": "1.4.281", - "commit": "6f766fd6733ce492387abd5d6f339983085f2359" + "tag": "1.4.283", + "commit": "52a82ab789f4650d3b0ab7ee41cba96d417cfa76" }, "_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_target": "^1.2.1", diff --git a/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js b/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js index 3d51872eed..50107d16b9 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js +++ b/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js @@ -558,6 +558,15 @@ define(['browser'], function (browser) { }] }); + if (browser.chrome) { + profile.CodecProfiles[profile.CodecProfiles.length - 1].Conditions.push({ + Condition: 'NotEquals', + Property: 'IsAVC', + Value: 'false', + IsRequired: false + }); + } + profile.CodecProfiles.push({ Type: 'Video', Codec: 'vpx', diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js index 285c959c8b..fbdda488c2 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js +++ b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js @@ -761,6 +761,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo var lines = []; var parentTitleUnderneath = item.Type === 'MusicAlbum' || item.Type === 'Audio' || item.Type === 'MusicVideo'; + var titleAdded; if (showOtherText) { if ((options.showParentTitle || options.showParentTitleOrTitle) && !parentTitleUnderneath) { @@ -776,20 +777,30 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo } else { - var parentTitle = item.Type === 'Program' ? item.Name : (item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || ""); + if (item.Type === 'Program') { - if (parentTitle || options.showParentTitle) { - lines.push(parentTitle); + lines.push(item.Name); + + if (!item.IsSeries) { + titleAdded = true; + } + + } else { + var parentTitle = item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || ""; + + if (parentTitle || options.showParentTitle) { + lines.push(parentTitle); + } } } } } - if (showTitle || forceName || (options.showParentTitleOrTitle && !lines.length)) { + if (((showTitle || forceName) && !titleAdded) || (options.showParentTitleOrTitle && !lines.length)) { var name = options.showTitle === 'auto' && !item.IsFolder && item.MediaType === 'Photo' ? '' : itemHelper.getDisplayName(item); - lines.push(htmlEncode(name)); + lines.push(name); } if (showOtherText) { diff --git a/dashboard-ui/bower_components/emby-webcomponents/datetime.js b/dashboard-ui/bower_components/emby-webcomponents/datetime.js index dbf594a8d5..be8ab7ed71 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/datetime.js +++ b/dashboard-ui/bower_components/emby-webcomponents/datetime.js @@ -131,8 +131,8 @@ var currentLocale = getCurrentLocale(); return currentLocale && toLocaleTimeStringSupportsLocales ? - date.toLocaleTimeString(currentLocale, options || {}) : - date.toLocaleTimeString(); + date.toLocaleTimeString(currentLocale, options || {}).toLowerCase() : + date.toLocaleTimeString().toLowerCase(); } function getDisplayTime(date) { @@ -147,38 +147,12 @@ } } - var time = toLocaleTimeString(date); + return toLocaleTimeString(date, { - var timeLower = time.toLowerCase(); + hour: 'numeric', + minute: '2-digit' - if (timeLower.indexOf('am') != -1 || timeLower.indexOf('pm') != -1) { - - time = timeLower; - var hour = date.getHours() % 12; - var suffix = date.getHours() > 11 ? 'pm' : 'am'; - if (!hour) { - hour = 12; - } - var minutes = date.getMinutes(); - - if (minutes < 10) { - minutes = '0' + minutes; - } - - minutes = ':' + minutes; - time = hour + minutes + suffix; - } else { - - var timeParts = time.split(':'); - - // Trim off seconds - if (timeParts.length > 2) { - timeParts.length -= 1; - time = timeParts.join(':'); - } - } - - return time; + }); } function isRelativeDay(date, offsetInDays) { diff --git a/dashboard-ui/bower_components/emby-webcomponents/dialoghelper/dialoghelper.js b/dashboard-ui/bower_components/emby-webcomponents/dialoghelper/dialoghelper.js index 2e719f33c6..35b8093762 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/dialoghelper/dialoghelper.js +++ b/dashboard-ui/bower_components/emby-webcomponents/dialoghelper/dialoghelper.js @@ -131,7 +131,7 @@ animateDialogOpen(dlg); if (isHistoryEnabled(dlg)) { - historyManager.pushState({ dialogId: hash }, "Dialog", hash); + historyManager.pushState({ dialogId: hash }, "Dialog", '#' + hash); window.addEventListener('popstate', onHashChange); } else { diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-button/emby-button.css b/dashboard-ui/bower_components/emby-webcomponents/emby-button/emby-button.css index 4237df422f..24ec5c7692 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-button/emby-button.css +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-button/emby-button.css @@ -152,7 +152,7 @@ .paper-icon-button-light > i { width: auto; height: auto; - font-size: 1.72em; + font-size: 1.6em; /* Make sure its on top of the ripple */ position: relative; z-index: 1; diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-input/emby-input.css b/dashboard-ui/bower_components/emby-webcomponents/emby-input/emby-input.css index ecd8f021b8..a688ab23e7 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-input/emby-input.css +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-input/emby-input.css @@ -3,7 +3,7 @@ margin: 0; margin-bottom: 0 !important; background: none; - border: 1px solid rgb(221, 221, 221); + border: 1px solid #383838; border-width: 0 0 1px 0; /* Prefixed box-sizing rules necessary for older browsers */ -webkit-box-sizing: border-box; diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-select/emby-select.css b/dashboard-ui/bower_components/emby-webcomponents/emby-select/emby-select.css index 266fc90bbe..613d2b8316 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-select/emby-select.css +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-select/emby-select.css @@ -3,7 +3,7 @@ margin: 0; margin-bottom: 0 !important; background: none; - border: 1px solid rgb(221, 221, 221); + border: 1px solid #383838; border-width: 0 0 1px 0; /* Prefixed box-sizing rules necessary for older browsers */ -webkit-box-sizing: border-box; diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-textarea/emby-textarea.css b/dashboard-ui/bower_components/emby-webcomponents/emby-textarea/emby-textarea.css index e6785a870d..81733d1335 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-textarea/emby-textarea.css +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-textarea/emby-textarea.css @@ -3,7 +3,7 @@ margin: 0; margin-bottom: 0 !important; background: none; - border: 1px solid rgb(221, 221, 221); + border: 1px solid #383838; border-width: 0 0 1px 0; /* Prefixed box-sizing rules necessary for older browsers */ -webkit-box-sizing: border-box; diff --git a/dashboard-ui/bower_components/emby-webcomponents/listview/listview.css b/dashboard-ui/bower_components/emby-webcomponents/listview/listview.css index 5e3fb6369f..bbaa5939ef 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/listview/listview.css +++ b/dashboard-ui/bower_components/emby-webcomponents/listview/listview.css @@ -15,10 +15,6 @@ overflow: hidden; } -.listItem-border { - border-bottom: 1px solid #262626; -} - .listItem-button { width: 100%; } @@ -63,24 +59,8 @@ justify-content: center; } -.listItemBody-nogrow { - flex-grow: initial; - flex-shrink: 0; - width: 9em; - opacity: .7; -} - -@media all and (max-width: 800px) { - - .listItemBody-nogrow { - width: 4em; - } -} - -.two-line { - min-height: 5.15em; - padding-top: 0; - padding-bottom: 0; +.listItem-odd { + background: #171717; } .three-line { diff --git a/dashboard-ui/bower_components/emby-webcomponents/listview/listview.js b/dashboard-ui/bower_components/emby-webcomponents/listview/listview.js index 72ca11ed0a..adb6e3887b 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/listview/listview.js +++ b/dashboard-ui/bower_components/emby-webcomponents/listview/listview.js @@ -180,8 +180,10 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan var cssClass = "listItem listItem-nosidepadding"; - if (options.border !== false) { - cssClass += ' listItem-border'; + if (options.highlight !== false) { + if (i % 2 == 1) { + cssClass += ' listItem-odd'; + } } if (clickEntireItem) { @@ -242,21 +244,32 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan html += '
'; } - if (options.showProgramTimeColumn) { - html += '
'; - html += datetime.getDisplayTime(datetime.parseISO8601Date(item.StartDate)); - html += '
'; + var textlines = []; + + if (options.showProgramDateTime) { + textlines.push(datetime.toLocaleString(datetime.parseISO8601Date(item.StartDate), { + + weekday: 'long', + month: 'short', + day: 'numeric', + hour: 'numeric', + minute: '2-digit' + })); } - var textlines = []; + if (options.showProgramTime) { + textlines.push(datetime.getDisplayTime(datetime.parseISO8601Date(item.StartDate))); + } + + var parentTitle; if (options.showParentTitle) { if (item.Type == 'Episode') { - textlines.push(item.SeriesName || ' '); + parentTitle = item.SeriesName; } - if (item.IsSeries) { - textlines.push(item.Name || ' '); + else if (item.IsSeries) { + parentTitle = item.Name; } } @@ -265,7 +278,20 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan if (options.showIndexNumber && item.IndexNumber != null) { displayName = item.IndexNumber + ". " + displayName; } - if (displayName) { + + if (options.showParentTitle && options.parentTitleWithTitle) { + + if (parentTitle && displayName) { + parentTitle += ' - ' + displayName; + } + + textlines.push(parentTitle || ' '); + } + else if (options.showParentTitle) { + textlines.push(parentTitle || ' '); + } + + if (displayName && !options.parentTitleWithTitle) { textlines.push(displayName); } @@ -302,14 +328,16 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan html += getTextLinesHtml(textlines, isLargeStyle); - if (!enableSideMediaInfo) { + if (options.mediaInfo !== false) { + if (!enableSideMediaInfo) { - var mediaInfoClass = 'secondary listItemMediaInfo listItemBodyText'; + var mediaInfoClass = 'secondary listItemMediaInfo listItemBodyText'; - html += '
' + mediaInfo.getPrimaryMediaInfoHtml(item, { - episodeTitle: false, - originalAirDate: false - }) + '
'; + html += '
' + mediaInfo.getPrimaryMediaInfoHtml(item, { + episodeTitle: false, + originalAirDate: false + }) + '
'; + } } if (enableOverview && item.Overview) { @@ -320,18 +348,23 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan html += '
'; - if (enableSideMediaInfo) { - html += '
' + mediaInfo.getPrimaryMediaInfoHtml(item, { + if (options.mediaInfo !== false) { + if (enableSideMediaInfo) { + html += '
' + mediaInfo.getPrimaryMediaInfoHtml(item, { - year: false, - container: false, - episodeTitle: false + year: false, + container: false, + episodeTitle: false - }) + '
'; + }) + '
'; + } } if (!clickEntireItem) { - html += ''; + + if (options.moreButton !== false) { + html += ''; + } if (options.enableUserDataButtons !== false) { html += ''; diff --git a/dashboard-ui/bower_components/emby-webcomponents/sharing/sharingmenu.js b/dashboard-ui/bower_components/emby-webcomponents/sharing/sharingmenu.js index 8a65c4cf48..3fdc9b7de5 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/sharing/sharingmenu.js +++ b/dashboard-ui/bower_components/emby-webcomponents/sharing/sharingmenu.js @@ -16,12 +16,12 @@ html += '
'; // We can only do facebook if we can guarantee that the current page is available over the internet, since FB will try to probe it. - html += ''; + html += ''; - html += ''; - html += ''; - html += ''; - html += ''; + html += ''; + html += ''; + html += ''; + html += ''; html += '
'; dlg.style['padding'] = '.5em 1.5em 1.5em'; diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index 1eea2782e3..46fc7cad20 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -35,16 +35,16 @@ html { margin: 0; padding: 0; height: 100%; - font-family: -apple-system, BlinkMacSystemFont, 'Open Sans', "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif; + font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", 'Open Sans', sans-serif; font-size: 14px; } h1 { - font-family: -apple-system-headline, BlinkMacSystemFont, 'Open Sans', "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif; + font-family: -apple-system-headline, BlinkMacSystemFont, "Roboto", "Segoe UI", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", 'Open Sans', sans-serif; } h2 { - font-family: -apple-system-subheadline, BlinkMacSystemFont, 'Open Sans', "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif; + font-family: -apple-system-subheadline, BlinkMacSystemFont, "Roboto", "Segoe UI", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", 'Open Sans', sans-serif; } body { @@ -165,9 +165,9 @@ input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='r display: block; } -.ui-body-b select, .ui-body-b [is="emby-input"] { +.ui-body-a select, .ui-body-a [is="emby-input"], .ui-body-a [is="emby-textarea"] { background: none; - border-color: #454545; + border-color: #ccc!important; } .ui-body-b select option { diff --git a/dashboard-ui/itemdetails.html b/dashboard-ui/itemdetails.html index e97041f4f8..bffdce8c1a 100644 --- a/dashboard-ui/itemdetails.html +++ b/dashboard-ui/itemdetails.html @@ -158,12 +158,9 @@
-
-

- ${HeaderScenes} -

- -
+

+ ${HeaderScenes} +

diff --git a/dashboard-ui/livetv.html b/dashboard-ui/livetv.html index cf74ed4937..810b5a0473 100644 --- a/dashboard-ui/livetv.html +++ b/dashboard-ui/livetv.html @@ -148,8 +148,7 @@
-
-
+
diff --git a/dashboard-ui/livetvseriestimer.html b/dashboard-ui/livetvseriestimer.html index d3b736bb5d..1da27d434b 100644 --- a/dashboard-ui/livetvseriestimer.html +++ b/dashboard-ui/livetvseriestimer.html @@ -20,7 +20,7 @@

${HeaderSchedule}

-
+
${WillRecord}
diff --git a/dashboard-ui/mypreferencesmenu.html b/dashboard-ui/mypreferencesmenu.html index 6f538e30d3..a4e6249607 100644 --- a/dashboard-ui/mypreferencesmenu.html +++ b/dashboard-ui/mypreferencesmenu.html @@ -8,7 +8,7 @@
tv
-
${HeaderDisplay}
+
${HeaderDisplay}
@@ -17,7 +17,7 @@
home
-
${TabHomeScreen}
+
${TabHomeScreen}
@@ -26,7 +26,7 @@
play_circle_filled
-
${TitlePlayback}
+
${TitlePlayback}
@@ -35,7 +35,7 @@
person
-
${ButtonProfile}
+
${ButtonProfile}
@@ -44,7 +44,7 @@
photo
-
${TabCameraUpload}
+
${TabCameraUpload}
@@ -53,7 +53,7 @@
file_download
-
${HeaderOfflineSync}
+
${HeaderOfflineSync}
@@ -65,14 +65,14 @@
wifi
-
${HeaderSelectServer}
+
${HeaderSelectServer}
lock
-
${ButtonSignOut}
+
${ButtonSignOut}
@@ -85,7 +85,7 @@
settings
-
${ButtonServerDashboard}
+
${ButtonServerDashboard}
diff --git a/dashboard-ui/scripts/addpluginpage.js b/dashboard-ui/scripts/addpluginpage.js index e58ae2cd29..746f391778 100644 --- a/dashboard-ui/scripts/addpluginpage.js +++ b/dashboard-ui/scripts/addpluginpage.js @@ -56,139 +56,95 @@ } } - function populateReviews(id, page) { - - ApiClient.getPackageReviews(id, null, null, 3).then(function (positive) { - - var html = ''; - - if (positive && positive.length > 0) { - - html += '
'; - html += '

' + Globalize.translate('HeaderLatestReviews') + '

'; - - html += "

"; - - for (var i = 0; i < positive.length; i++) { - var review = positive[i]; - - html += "
"; - html += ""; - html += new Date(review.timestamp).toDateString(); - if (review.rating) { - html += 'star'; - html += review.rating.toFixed(1); - } - html += " " + review.title; - html += ""; - if (review.review) { - html += "

"; - html += review.review; - html += "

"; - } - - html += "
"; - html += "
"; - } - html += "
"; - html += "
"; - } - - $('#latestReviews', page).html(html).trigger('create'); - }); - } - function renderPluginInfo(page, pkg, pluginSecurityInfo) { if (AppInfo.isNativeApp) { return; } - require(['jQuery'], function ($) { - if (pkg.isPremium) { - $('.premiumPackage', page).show(); + if (pkg.isPremium) { + $('.premiumPackage', page).show(); - // Fill in registration info - var regStatus = ""; - if (pkg.isRegistered) { + // Fill in registration info + var regStatus = ""; + if (pkg.isRegistered) { - regStatus += "

"; + regStatus += "

"; - regStatus += Globalize.translate('MessageFeatureIncludedWithSupporter'); - - } else { - - var expDateTime = new Date(pkg.expDate).getTime(); - var nowTime = new Date().getTime(); - - if (expDateTime <= nowTime) { - regStatus += "

"; - regStatus += Globalize.translate('MessageTrialExpired'); - } else if (expDateTime > new Date(1970, 1, 1).getTime()) { - - regStatus += "

"; - regStatus += Globalize.translate('MessageTrialWillExpireIn').replace('{0}', Math.round(expDateTime - nowTime) / (86400000)); - } - } - - regStatus += "

"; - $('#regStatus', page).html(regStatus); - - if (pluginSecurityInfo.IsMBSupporter) { - $('#regInfo', page).html(pkg.regInfo || ""); - - $('.premiumDescription', page).hide(); - $('.supporterDescription', page).hide(); - - if (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) { - - if (dev.payPalEmail) { - $('#payPalEmail', page).val(dev.payPalEmail); - $('#ppButton', page).show(); - - } - }); - - } else { - // Supporter-only feature - $('.premiumHasPrice', page).hide(); - } - } else { - - if (pkg.price) { - $('.premiumDescription', page).show(); - $('.supporterDescription', page).hide(); - $('#regInfo', page).html(""); - - } else { - $('.premiumDescription', page).hide(); - $('.supporterDescription', page).show(); - $('#regInfo', page).html(""); - } - - $('#ppButton', page).hide(); - } + regStatus += Globalize.translate('MessageFeatureIncludedWithSupporter'); } else { - $('.premiumPackage', page).hide(); + + var expDateTime = new Date(pkg.expDate).getTime(); + var nowTime = new Date().getTime(); + + if (expDateTime <= nowTime) { + regStatus += "

"; + regStatus += Globalize.translate('MessageTrialExpired'); + } else if (expDateTime > new Date(1970, 1, 1).getTime()) { + + regStatus += "

"; + regStatus += Globalize.translate('MessageTrialWillExpireIn').replace('{0}', Math.round(expDateTime - nowTime) / (86400000)); + } } - }); + + regStatus += "

"; + $('#regStatus', page).html(regStatus); + + if (pluginSecurityInfo.IsMBSupporter) { + $('#regInfo', page).html(pkg.regInfo || ""); + + $('.premiumDescription', page).hide(); + $('.supporterDescription', page).hide(); + + if (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) { + + if (dev.payPalEmail) { + $('#payPalEmail', page).val(dev.payPalEmail); + $('#ppButton', page).show(); + + } + }); + + } else { + // Supporter-only feature + $('.premiumHasPrice', page).hide(); + } + } else { + + if (pkg.price) { + $('.premiumDescription', page).show(); + $('.supporterDescription', page).hide(); + $('#regInfo', page).html(""); + + } else { + $('.premiumDescription', page).hide(); + $('.supporterDescription', page).show(); + $('#regInfo', page).html(""); + } + + $('#ppButton', page).hide(); + } + + } else { + $('.premiumPackage', page).hide(); + } } function renderPackage(pkg, installedPlugins, pluginSecurityInfo, page) { @@ -199,7 +155,6 @@ populateVersions(pkg, page, installedPlugin); populateHistory(pkg, page); - if (pkg.totalRatings > 0) populateReviews(pkg.id, page); $('.pluginName', page).html(pkg.name); @@ -228,18 +183,6 @@ renderPluginInfo(page, pkg, pluginSecurityInfo); - //Ratings and Reviews - var ratingHtml = ''; - if (pkg.avgRating) { - ratingHtml += 'star'; - ratingHtml += pkg.avgRating.toFixed(1); - } - ratingHtml += ""; - ratingHtml += " " + Globalize.translate('ValueReviewCount').replace('{0}', pkg.totalRatings); - ratingHtml += ""; - - $('#ratingLine', page).html(ratingHtml); - if (pkg.richDescUrl) { $('#pViewWebsite', page).show(); $('#pViewWebsite a', page).attr('href', pkg.richDescUrl); @@ -268,62 +211,6 @@ Dashboard.hideLoadingMsg(); } - $(document).on('pageinit', "#addPluginPage", function () { - - $('.addPluginForm').off('submit', AddPluginPage.onSubmit).on('submit', AddPluginPage.onSubmit); - - }).on('pageshow', "#addPluginPage", function () { - - var page = this; - - Dashboard.showLoadingMsg(); - - var name = getParameterByName('name'); - var guid = getParameterByName('guid'); - - var promise1 = ApiClient.getPackageInfo(name, guid); - var promise2 = ApiClient.getInstalledPlugins(); - var promise3 = ApiClient.getPluginSecurityInfo(); - - Promise.all([promise1, promise2, promise3]).then(function (responses) { - - renderPackage(responses[0], responses[1], responses[2], page); - - }); - - }).on('pagebeforeshow pageinit pageshow', "#addPluginPage", function () { - - // This needs both events for the helpurl to get done at the right time - - var page = this; - - var context = getParameterByName('context'); - - $('.notificationsTabs', page).hide(); - - if (context == 'sync') { - page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Sync'); - LibraryMenu.setTitle(Globalize.translate('TitleSync')); - } - else if (context == 'livetv') { - - LibraryMenu.setTitle(Globalize.translate('TitleLiveTV')); - page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Live%20TV'); - } - else if (context == 'notifications') { - - $('.notificationsTabs', page).show(); - - LibraryMenu.setTitle(Globalize.translate('TitleNotifications')); - page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Notifications'); - } - else { - page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Plugins'); - LibraryMenu.setTitle(Globalize.translate('TitlePlugins')); - } - - }); - function performInstallation(page, packageName, guid, updateClass, version) { var developer = $('#developer', page).html().toLowerCase(); @@ -369,18 +256,44 @@ } } - function addPluginpage() { + function updateHelpUrl(page, params) { - var self = this; + var context = params.context; - self.onSubmit = function () { + $('.notificationsTabs', page).hide(); + + if (context == 'sync') { + page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Sync'); + LibraryMenu.setTitle(Globalize.translate('TitleSync')); + } + else if (context == 'livetv') { + + LibraryMenu.setTitle(Globalize.translate('TitleLiveTV')); + page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Live%20TV'); + } + else if (context == 'notifications') { + + $('.notificationsTabs', page).show(); + + LibraryMenu.setTitle(Globalize.translate('TitleNotifications')); + page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Notifications'); + } + else { + page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Plugins'); + LibraryMenu.setTitle(Globalize.translate('TitlePlugins')); + } + } + + return function (view, params) { + + var onSubmit = function () { Dashboard.showLoadingMsg(); var page = $(this).parents('#addPluginPage')[0]; - var name = getParameterByName('name'); - var guid = getParameterByName('guid'); + var name = params.name; + var guid = params.guid; ApiClient.getInstalledPlugins().then(function (plugins) { @@ -407,8 +320,37 @@ return false; }; - } - window.AddPluginPage = new addPluginpage(); + $('.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; + + Dashboard.showLoadingMsg(); + + var name = params.name; + var guid = params.guid; + + var promise1 = ApiClient.getPackageInfo(name, guid); + var promise2 = ApiClient.getInstalledPlugins(); + var promise3 = ApiClient.getPluginSecurityInfo(); + + Promise.all([promise1, promise2, promise3]).then(function (responses) { + + renderPackage(responses[0], responses[1], responses[2], page); + }); + + updateHelpUrl(page, params); + }); + }; }); \ No newline at end of file diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index de305887c2..23d88df174 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -207,12 +207,6 @@ } }); - if (user.Policy.IsAdministrator) { - page.querySelector('.chapterSettingsButton').classList.remove('hide'); - } else { - page.querySelector('.chapterSettingsButton').classList.add('hide'); - } - var itemBirthday = page.querySelector('#itemBirthday'); if (item.Type == "Person" && item.PremiereDate) { @@ -2172,10 +2166,6 @@ } - view.querySelector('.chapterSettingsButton').addEventListener('click', function () { - Dashboard.navigate('librarysettings.html'); - }); - view.addEventListener('viewbeforeshow', function () { var page = this; reload(page, params); diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 9556337d63..82d81b72a3 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -265,6 +265,10 @@ // Handle search hints var id = item.Id || item.ItemId; + if (item.Type == "SeriesTimer") { + return "livetvseriestimer.html?id=" + id; + } + if (item.CollectionType == 'livetv') { return 'livetv.html'; } diff --git a/dashboard-ui/scripts/livetvchannel.js b/dashboard-ui/scripts/livetvchannel.js index 8f5be4aa38..218441cc55 100644 --- a/dashboard-ui/scripts/livetvchannel.js +++ b/dashboard-ui/scripts/livetvchannel.js @@ -27,7 +27,9 @@ enableUserDataButtons: false, showParentTitle: true, image: false, - showProgramTimeColumn: true + showProgramTime: true, + mediaInfo: false, + parentTitleWithTitle: true }) + '
'; } diff --git a/dashboard-ui/scripts/livetvcomponents.js b/dashboard-ui/scripts/livetvcomponents.js index f70e03f397..ac39f71ae4 100644 --- a/dashboard-ui/scripts/livetvcomponents.js +++ b/dashboard-ui/scripts/livetvcomponents.js @@ -1,4 +1,4 @@ -define(['datetime', 'cardBuilder'], function (datetime, cardBuilder) { +define(['datetime', 'cardBuilder', 'listView'], function (datetime, cardBuilder, listView) { function enableScrollX() { return browserInfo.mobile && AppInfo.enableAppLayouts; @@ -8,101 +8,6 @@ return enableScrollX() ? 'overflowBackdrop' : 'backdrop'; } - function getProgramScheduleHtml(items, options) { - - options = options || {}; - - var groups = []; - - var currentGroupName = ''; - var currentGroup = []; - - var i, length; - - for (i = 0, length = items.length; i < length; i++) { - - var item = items[i]; - - var dateText = ''; - - if (options.indexByDate !== false && item.StartDate) { - try { - - var premiereDate = datetime.parseISO8601Date(item.StartDate, true); - - dateText = LibraryBrowser.getFutureDateText(premiereDate, true); - - } catch (err) { - } - } - - if (dateText != currentGroupName) { - - if (currentGroup.length) { - groups.push({ - name: currentGroupName, - items: currentGroup - }); - } - - currentGroupName = dateText; - currentGroup = [item]; - } else { - currentGroup.push(item); - } - } - - if (currentGroup.length) { - groups.push({ - name: currentGroupName, - items: currentGroup - }); - } - - var html = ''; - - for (i = 0, length = groups.length; i < length; i++) { - - var group = groups[i]; - - if (group.name) { - html += '
'; - - html += '

' + group.name + '

'; - } - - if (enableScrollX()) { - html += '
'; - } else { - html += '
'; - } - - html += cardBuilder.getCardsHtml({ - items: group.items, - shape: getBackdropShape(), - preferThumb: true, - showTitle: true, - showAirTime: true, - showAirEndTime: true, - showChannelName: true, - cardLayout: true, - action: 'programdialog', - cardFooterAside: 'none', - preferThumb: true, - coverImage: true, - overlayText: false - - }); - html += '
'; - - if (group.name) { - html += '
'; - } - } - - return Promise.resolve(html); - } - function getTimersHtml(timers, options) { options = options || {}; @@ -204,8 +109,7 @@ window.LiveTvHelpers = { - getTimersHtml: getTimersHtml, - getProgramScheduleHtml: getProgramScheduleHtml + getTimersHtml: getTimersHtml }; }); \ No newline at end of file diff --git a/dashboard-ui/scripts/livetvrecordings.js b/dashboard-ui/scripts/livetvrecordings.js index 1553b9a7f4..2b29f26642 100644 --- a/dashboard-ui/scripts/livetvrecordings.js +++ b/dashboard-ui/scripts/livetvrecordings.js @@ -92,13 +92,9 @@ ImageLoader.lazyChildren(recordingItems); } - function renderActiveRecordings(context) { + function renderActiveRecordings(context, promise) { - ApiClient.getLiveTvTimers({ - - IsActive: true - - }).then(function (result) { + promise.then(function (result) { // The IsActive param is new, so handle older servers that don't support it if (result.Items.length && result.Items[0].Status != 'InProgress') { @@ -111,18 +107,9 @@ }); } - function renderLatestRecordings(context) { + function renderLatestRecordings(context, promise) { - ApiClient.getLiveTvRecordings({ - - UserId: Dashboard.getCurrentUserId(), - Limit: enableScrollX() ? 12 : 8, - IsInProgress: false, - Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo', - EnableTotalRecordCount: false, - EnableImageTypes: "Primary,Thumb,Backdrop" - - }).then(function (result) { + promise.then(function (result) { renderRecordings(context.querySelector('#latestRecordings'), result.Items); @@ -130,18 +117,9 @@ }); } - function renderMovieRecordings(context) { + function renderMovieRecordings(context, promise) { - ApiClient.getLiveTvRecordings({ - - UserId: Dashboard.getCurrentUserId(), - Limit: enableScrollX() ? 12 : 8, - IsInProgress: false, - Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo', - EnableTotalRecordCount: false, - IsMovie: true - - }).then(function (result) { + promise.then(function (result) { renderRecordings(context.querySelector('#movieRecordings'), result.Items, { showYear: true, @@ -150,18 +128,9 @@ }); } - function renderEpisodeRecordings(context) { + function renderEpisodeRecordings(context, promise) { - ApiClient.getLiveTvRecordingSeries({ - - UserId: Dashboard.getCurrentUserId(), - Limit: enableScrollX() ? 12 : 8, - IsInProgress: false, - Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo', - EnableTotalRecordCount: false, - IsSeries: true - - }).then(function (result) { + promise.then(function (result) { renderRecordings(context.querySelector('#episodeRecordings'), result.Items, { showItemCounts: true, @@ -170,18 +139,9 @@ }); } - function renderSportsRecordings(context) { + function renderSportsRecordings(context, promise) { - ApiClient.getLiveTvRecordings({ - - UserId: Dashboard.getCurrentUserId(), - Limit: enableScrollX() ? 12 : 8, - IsInProgress: false, - Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo', - EnableTotalRecordCount: false, - IsSports: true - - }).then(function (result) { + promise.then(function (result) { renderRecordings(context.querySelector('#sportsRecordings'), result.Items, { showYear: true, @@ -190,18 +150,9 @@ }); } - function renderKidsRecordings(context) { + function renderKidsRecordings(context, promise) { - ApiClient.getLiveTvRecordings({ - - UserId: Dashboard.getCurrentUserId(), - Limit: enableScrollX() ? 12 : 8, - IsInProgress: false, - Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo', - EnableTotalRecordCount: false, - IsKids: true - - }).then(function (result) { + promise.then(function (result) { renderRecordings(context.querySelector('#kidsRecordings'), result.Items, { showYear: true, @@ -228,27 +179,6 @@ }); } - function reload(context) { - - Dashboard.showLoadingMsg(); - - renderActiveRecordings(context); - renderLatestRecordings(context); - renderMovieRecordings(context); - renderEpisodeRecordings(context); - renderSportsRecordings(context); - renderKidsRecordings(context); - - ApiClient.getLiveTvRecordingGroups({ - - userId: Dashboard.getCurrentUserId() - - }).then(function (result) { - - renderRecordingGroups(context, result.Items); - }); - } - function onMoreClick(e) { var type = this.getAttribute('data-type'); @@ -280,6 +210,12 @@ return function (view, params, tabContent) { var self = this; + var activeRecordingsPromise; + var sportsPromise; + var kidsPromise; + var moviesPromise; + var seriesPromise; + var latestPromise; categorysyncbuttons.init(tabContent); @@ -288,11 +224,83 @@ moreButtons[i].addEventListener('click', onMoreClick); } tabContent.querySelector('#activeRecordings .recordingItems').addEventListener('timercancelled', function () { - reload(tabContent); + self.preRender(); + self.renderTab(); }); + self.preRender = function () { + activeRecordingsPromise = ApiClient.getLiveTvTimers({ + IsActive: true + }); + + latestPromise = ApiClient.getLiveTvRecordings({ + + UserId: Dashboard.getCurrentUserId(), + Limit: enableScrollX() ? 12 : 8, + IsInProgress: false, + Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo', + EnableTotalRecordCount: false, + EnableImageTypes: "Primary,Thumb,Backdrop" + }); + + moviesPromise = ApiClient.getLiveTvRecordings({ + + UserId: Dashboard.getCurrentUserId(), + Limit: enableScrollX() ? 12 : 8, + IsInProgress: false, + Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo', + EnableTotalRecordCount: false, + IsMovie: true + }); + + seriesPromise = ApiClient.getLiveTvRecordingSeries({ + + UserId: Dashboard.getCurrentUserId(), + Limit: enableScrollX() ? 12 : 8, + IsInProgress: false, + Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo', + EnableTotalRecordCount: false, + IsSeries: true + }); + + kidsPromise = ApiClient.getLiveTvRecordings({ + + UserId: Dashboard.getCurrentUserId(), + Limit: enableScrollX() ? 12 : 8, + IsInProgress: false, + Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo', + EnableTotalRecordCount: false, + IsKids: true + }); + + sportsPromise = ApiClient.getLiveTvRecordings({ + UserId: Dashboard.getCurrentUserId(), + Limit: enableScrollX() ? 12 : 8, + IsInProgress: false, + Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo', + EnableTotalRecordCount: false, + IsSports: true + }); + }; + self.renderTab = function () { - reload(tabContent); + Dashboard.showLoadingMsg(); + + renderActiveRecordings(tabContent, activeRecordingsPromise); + renderLatestRecordings(tabContent, latestPromise); + renderMovieRecordings(tabContent, moviesPromise); + renderEpisodeRecordings(tabContent, seriesPromise); + renderSportsRecordings(tabContent, sportsPromise); + renderKidsRecordings(tabContent, kidsPromise); + + ApiClient.getLiveTvRecordingGroups({ + + userId: Dashboard.getCurrentUserId() + + }).then(function (result) { + + renderRecordingGroups(tabContent, result.Items); + }); }; }; diff --git a/dashboard-ui/scripts/livetvschedule.js b/dashboard-ui/scripts/livetvschedule.js index 87b4148421..6a877c0093 100644 --- a/dashboard-ui/scripts/livetvschedule.js +++ b/dashboard-ui/scripts/livetvschedule.js @@ -1,12 +1,8 @@ define(['scripts/livetvcomponents', 'emby-button', 'emby-itemscontainer'], function () { - function renderActiveRecordings(context) { + function renderActiveRecordings(context, promise) { - ApiClient.getLiveTvTimers({ - - IsActive: true - - }).then(function (result) { + promise.then(function (result) { // The IsActive param is new, so handle older servers that don't support it if (result.Items.length && result.Items[0].Status != 'InProgress') { @@ -18,7 +14,7 @@ }); }); } - + function renderTimers(context, timers, options) { LiveTvHelpers.getTimersHtml(timers, options).then(function (html) { @@ -37,35 +33,41 @@ }); } - function renderUpcomingRecordings(context) { + function renderUpcomingRecordings(context, promise) { - ApiClient.getLiveTvTimers({ - IsActive: false - }).then(function (result) { + promise.then(function (result) { renderTimers(context.querySelector('#upcomingRecordings'), result.Items); Dashboard.hideLoadingMsg(); }); } - function reload(context) { - - Dashboard.showLoadingMsg(); - - renderActiveRecordings(context); - renderUpcomingRecordings(context); - } - return function (view, params, tabContent) { var self = this; + var activeRecordingsPromise; + var upcomingRecordingsPromise; tabContent.querySelector('#upcomingRecordings .recordingItems').addEventListener('timercancelled', function () { - reload(tabContent); + self.preRender(); + self.renderTab(); }); + self.preRender = function () { + activeRecordingsPromise = ApiClient.getLiveTvTimers({ + IsActive: true + }); + + upcomingRecordingsPromise = ApiClient.getLiveTvTimers({ + IsActive: false + }); + }; + self.renderTab = function () { - reload(tabContent); + Dashboard.showLoadingMsg(); + + renderActiveRecordings(tabContent, activeRecordingsPromise); + renderUpcomingRecordings(tabContent, upcomingRecordingsPromise); }; }; diff --git a/dashboard-ui/scripts/livetvseriestimer.js b/dashboard-ui/scripts/livetvseriestimer.js index e42d5e25e4..d1cbb314cb 100644 --- a/dashboard-ui/scripts/livetvseriestimer.js +++ b/dashboard-ui/scripts/livetvseriestimer.js @@ -1,4 +1,4 @@ -define(['datetime', 'dom', 'seriesRecordingEditor', 'emby-itemscontainer'], function (datetime, dom, seriesRecordingEditor) { +define(['datetime', 'dom', 'seriesRecordingEditor', 'listView', 'emby-itemscontainer'], function (datetime, dom, seriesRecordingEditor, listView) { return function (view, params) { @@ -9,6 +9,27 @@ Dashboard.hideLoadingMsg(); } + function getProgramScheduleHtml(items, options) { + + options = options || {}; + + var html = ''; + html += '
'; + html += listView.getListViewHtml({ + items: items, + enableUserDataButtons: false, + image: false, + showProgramDateTime: true, + mediaInfo: false, + action: 'none', + moreButton: false + }); + + html += '
'; + + return html; + } + function renderSchedule(page) { ApiClient.getLiveTvPrograms({ @@ -28,24 +49,13 @@ result.Items = []; } - LiveTvHelpers.getProgramScheduleHtml(result.Items).then(function (html) { + var html = getProgramScheduleHtml(result.Items); - var scheduleTab = page.querySelector('.scheduleTab'); - scheduleTab.innerHTML = html; + var scheduleTab = page.querySelector('.scheduleTab'); + scheduleTab.innerHTML = html; - ImageLoader.lazyChildren(scheduleTab); - }); + ImageLoader.lazyChildren(scheduleTab); }); - - //var timers = result.Items; - - //LiveTvHelpers.getTimersHtml(timers).then(function (html) { - - // var scheduleTab = page.querySelector('.scheduleTab'); - // scheduleTab.innerHTML = html; - - // ImageLoader.lazyChildren(scheduleTab); - //}); } function reload() { diff --git a/dashboard-ui/scripts/livetvseriestimers.js b/dashboard-ui/scripts/livetvseriestimers.js index 4609be0bc1..1c9ee4b247 100644 --- a/dashboard-ui/scripts/livetvseriestimers.js +++ b/dashboard-ui/scripts/livetvseriestimers.js @@ -1,4 +1,4 @@ -define(['datetime', 'paper-icon-button-light', 'emby-button', 'listViewStyle'], function (datetime) { +define(['datetime', 'cardBuilder', 'paper-icon-button-light', 'emby-button'], function (datetime, cardBuilder) { var query = { @@ -30,75 +30,88 @@ var html = ''; - if (timers.length) { - html += '
'; - } + html += cardBuilder.getCardsHtml({ + items: timers, + shape: 'backdrop', + showTitle: true, + cardLayout: true, + cardFooterAside: 'none', + preferThumb: true, + coverImage: true, + overlayText: false, + showSeriesTimerTime: true, + showSeriesTimerChannel: true + }); - for (var i = 0, length = timers.length; i < length; i++) { + //if (timers.length) { + // html += '
'; + //} - var timer = timers[i]; + //for (var i = 0, length = timers.length; i < length; i++) { - html += ''; - } + // html += '
'; + //} + + //if (timers.length) { + // html += '
'; + //} var elem = context.querySelector('#items'); elem.innerHTML = html; - if (timers.length) { - elem.querySelector('.paperList').addEventListener('click', function (e) { + //if (timers.length) { + // elem.querySelector('.paperList').addEventListener('click', function (e) { - var btnCancelSeries = parentWithClass(e.target, 'btnCancelSeries'); - if (btnCancelSeries) { - deleteSeriesTimer(context, btnCancelSeries.getAttribute('data-seriestimerid')); - } - }); - } + // var btnCancelSeries = parentWithClass(e.target, 'btnCancelSeries'); + // if (btnCancelSeries) { + // deleteSeriesTimer(context, btnCancelSeries.getAttribute('data-seriestimerid')); + // } + // }); + //} Dashboard.hideLoadingMsg(); } @@ -116,11 +129,11 @@ return elem; } - function reload(context) { + function reload(context, promise) { Dashboard.showLoadingMsg(); - ApiClient.getLiveTvSeriesTimers(query).then(function (result) { + promise.then(function (result) { renderTimers(context, result.Items); }); @@ -129,9 +142,13 @@ return function (view, params, tabContent) { var self = this; - self.renderTab = function () { + var timersPromise; self.preRender = function () { + timersPromise = ApiClient.getLiveTvSeriesTimers(query); + }; + + self.renderTab = function () { - reload(tabContent); + reload(tabContent, timersPromise); }; }; diff --git a/dashboard-ui/scripts/livetvsuggested.js b/dashboard-ui/scripts/livetvsuggested.js index 38992c60a8..d9712b35dc 100644 --- a/dashboard-ui/scripts/livetvsuggested.js +++ b/dashboard-ui/scripts/livetvsuggested.js @@ -168,9 +168,11 @@ var tabControllers = []; var renderedTabs = []; - function loadTab(page, index) { + var tabControllers = []; + var renderedTabs = []; + + function getTabController(page, index, callback) { - var tabContent = page.querySelector('.pageTabContent[data-index=\'' + index + '\']'); var depends = []; switch (index) { @@ -178,23 +180,18 @@ case 0: break; case 1: - document.body.classList.add('autoScrollY'); depends.push('scripts/livetvguide'); break; case 2: - document.body.classList.remove('autoScrollY'); depends.push('scripts/livetvchannels'); break; case 3: - document.body.classList.remove('autoScrollY'); depends.push('scripts/livetvrecordings'); break; case 4: - document.body.classList.remove('autoScrollY'); depends.push('scripts/livetvschedule'); break; case 5: - document.body.classList.remove('autoScrollY'); depends.push('scripts/livetvseriestimers'); break; default: @@ -202,12 +199,14 @@ } require(depends, function (controllerFactory) { - + var tabContent; if (index == 0) { + tabContent = view.querySelector('.pageTabContent[data-index=\'' + index + '\']'); self.tabContent = tabContent; } var controller = tabControllers[index]; if (!controller) { + tabContent = view.querySelector('.pageTabContent[data-index=\'' + index + '\']'); controller = index ? new controllerFactory(view, params, tabContent) : self; tabControllers[index] = controller; @@ -216,8 +215,37 @@ } } + callback(controller); + }); + } + + + function preLoadTab(page, index) { + + getTabController(page, index, function (controller) { if (renderedTabs.indexOf(index) == -1) { - renderedTabs.push(index); + if (controller.preRender) { + controller.preRender(); + } + } + }); + } + + function loadTab(page, index) { + + getTabController(page, index, function (controller) { + + if (index === 1) { + document.body.classList.add('autoScrollY'); + } else { + document.body.classList.remove('autoScrollY'); + } + + if (renderedTabs.indexOf(index) == -1) { + + if (index < 2) { + renderedTabs.push(index); + } controller.renderTab(); } }); @@ -227,6 +255,10 @@ libraryBrowser.configurePaperLibraryTabs(view, viewTabs, view.querySelectorAll('.pageTabContent'), [0, 2, 3, 4, 5]); + viewTabs.addEventListener('beforetabchange', function (e) { + preLoadTab(view, parseInt(e.detail.selectedTabIndex)); + }); + viewTabs.addEventListener('tabchange', function (e) { loadTab(view, parseInt(e.detail.selectedTabIndex)); }); diff --git a/dashboard-ui/scripts/moviecollections.js b/dashboard-ui/scripts/moviecollections.js index f37f0df23a..901c86551a 100644 --- a/dashboard-ui/scripts/moviecollections.js +++ b/dashboard-ui/scripts/moviecollections.js @@ -141,8 +141,7 @@ shape: "auto", context: 'movies', showTitle: true, - showYear: true, - lazy: true, + centerText: false, cardLayout: true, showItemCounts: true }); diff --git a/dashboard-ui/scripts/notificationsettings.js b/dashboard-ui/scripts/notificationsettings.js index 34ad7eabab..0369472b42 100644 --- a/dashboard-ui/scripts/notificationsettings.js +++ b/dashboard-ui/scripts/notificationsettings.js @@ -38,7 +38,7 @@ itemHtml += 'notifications_off'; } - itemHtml += '
'; + itemHtml += '
'; itemHtml += '
' + i.Name + '
'; itemHtml += '
'; diff --git a/dashboard-ui/scripts/sections.js b/dashboard-ui/scripts/sections.js index c002777826..dbde26b19e 100644 --- a/dashboard-ui/scripts/sections.js +++ b/dashboard-ui/scripts/sections.js @@ -693,8 +693,10 @@ lazy: true, showDetailsMenu: true, centerText: true, + overlayText: false, overlayPlayButton: true, - allowBottomPadding: !enableScrollX() + allowBottomPadding: !enableScrollX(), + preferThumb: true }); html += '
'; diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 583908de86..68c9a01a82 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1850,7 +1850,8 @@ var AppInfo = {}; path: '/addplugin.html', dependencies: [], autoFocus: false, - roles: 'admin' + roles: 'admin', + controller: 'scripts/addpluginpage' }); defineRoute({ @@ -2719,8 +2720,8 @@ var AppInfo = {}; // Prefer custom font over Segoe if on desktop windows if (!browserInfo.mobile && navigator.userAgent.toLowerCase().indexOf('windows') != -1) { - postInitDependencies.push('opensansFont'); - //postInitDependencies.push('robotoFont'); + //postInitDependencies.push('opensansFont'); + postInitDependencies.push('robotoFont'); } postInitDependencies.push('bower_components/emby-webcomponents/input/api');