diff --git a/dashboard-ui/scripts/addpluginpage.js b/dashboard-ui/scripts/addpluginpage.js index 61a06cf5c4..cc151f32e8 100644 --- a/dashboard-ui/scripts/addpluginpage.js +++ b/dashboard-ui/scripts/addpluginpage.js @@ -135,22 +135,30 @@ $('.premiumPackage', page).show(); // Fill in registration info - var regStatus = ""; + var regStatus = ""; if (pkg.isRegistered) { + + regStatus += "

"; + + regStatus += Globalize.translate('MessageFeatureIncludedWithSupporter'); + } else { - if (new Date(pkg.expDate).getTime() < new Date(1970, 1, 1).getTime()) { - } else { - if (new Date(pkg.expDate).getTime() <= new Date().getTime()) { - regStatus += Globalize.translate('MessageTrialExpired'); - } else { + var expDateTime = new Date(pkg.expDate).getTime(); + var nowTime = new Date().getTime(); - regStatus += Globalize.translate('MessageTrialWillExpireIn').replace('{0}', Math.round((new Date(pkg.expDate).getTime() - new Date().getTime()) / (86400000))); - } + 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 += "

"; $('#regStatus', page).html(regStatus); if (pluginSecurityInfo.IsMBSupporter) { diff --git a/dashboard-ui/scripts/gamesystemspage.js b/dashboard-ui/scripts/gamesystemspage.js index aa6fe5eff1..6003dc1f2a 100644 --- a/dashboard-ui/scripts/gamesystemspage.js +++ b/dashboard-ui/scripts/gamesystemspage.js @@ -39,7 +39,13 @@ }); - html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); + var pagingHtml = LibraryBrowser.getQueryPagingHtml({ + startIndex: query.StartIndex, + limit: query.Limit, + totalRecordCount: result.TotalRecordCount + }); + + html += pagingHtml; $('#items', page).html(html).trigger('create').createCardMenus(); diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 11743adfd7..064d21888f 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -1,6 +1,6 @@ var LibraryBrowser = (function (window, document, $, screen, store) { - var pageSizeKey = 'pagesize_v2'; + var pageSizeKey = 'pagesize_v3'; $(function () { $("body").on("create", function () { @@ -11,18 +11,26 @@ var defaultBackground = "#333"; return { - getDefaultPageSize: function () { + getDefaultPageSize: function (key, defaultValue) { - var saved = store.getItem(pageSizeKey); + var saved = store.getItem(key || pageSizeKey); if (saved) { return parseInt(saved); } - if (window.location.toString().toLowerCase().indexOf('localhost') != -1) { - return 100; + if (defaultValue) { + return defaultValue; } - return 50; + + // Chrome seems to have virtualization built-in and can handle large lists easily + var isChrome = $.browser.chrome; + + if (window.location.toString().toLowerCase().indexOf('localhost') != -1) { + return isChrome ? 200 : 100; + } + + return isChrome ? 100 : 50; }, getDefaultItemsView: function (view, mobileView) { @@ -1633,7 +1641,7 @@ if (limit && options.updatePageSizeSetting !== false) { try { - store.setItem(pageSizeKey, limit); + store.setItem(options.pageSizeKey || pageSizeKey, limit); } catch (e) { } diff --git a/dashboard-ui/scripts/moviepeople.js b/dashboard-ui/scripts/moviepeople.js index 04ad70655c..0ea280c99f 100644 --- a/dashboard-ui/scripts/moviepeople.js +++ b/dashboard-ui/scripts/moviepeople.js @@ -1,5 +1,7 @@ (function ($, document) { + var pageSizeKey = 'people'; + // The base query options var query = { @@ -35,7 +37,8 @@ totalRecordCount: result.TotalRecordCount, viewButton: true, showLimit: false, - updatePageSizeSetting: false + updatePageSizeSetting: false, + pageSizeKey: pageSizeKey }); $('.listTopPaging', page).html(pagingHtml).trigger('create'); @@ -142,7 +145,7 @@ query.ParentId = LibraryMenu.getTopParentId(); - var limit = LibraryBrowser.getDefaultPageSize(); + var limit = LibraryBrowser.getDefaultPageSize(pageSizeKey, 100); // If the default page size has changed, the start index will have to be reset if (limit != query.Limit) { diff --git a/dashboard-ui/scripts/musicalbumartists.js b/dashboard-ui/scripts/musicalbumartists.js index 21fa121b3a..8a53694825 100644 --- a/dashboard-ui/scripts/musicalbumartists.js +++ b/dashboard-ui/scripts/musicalbumartists.js @@ -1,5 +1,7 @@ (function ($, document) { + var pageSizeKey = 'people'; + var view = LibraryBrowser.getDefaultItemsView('Poster', 'List'); // The base query options @@ -34,7 +36,8 @@ totalRecordCount: result.TotalRecordCount, viewButton: true, showLimit: false, - addSelectionButton: true + addSelectionButton: true, + pageSizeKey: pageSizeKey }); $('.listTopPaging', page).html(pagingHtml).trigger('create'); @@ -154,7 +157,7 @@ var page = this; query.ParentId = LibraryMenu.getTopParentId(); - var limit = LibraryBrowser.getDefaultPageSize(); + var limit = LibraryBrowser.getDefaultPageSize(pageSizeKey, 100); // If the default page size has changed, the start index will have to be reset if (limit != query.Limit) { diff --git a/dashboard-ui/scripts/musicartists.js b/dashboard-ui/scripts/musicartists.js index 20b3797eb7..6b2f0b273b 100644 --- a/dashboard-ui/scripts/musicartists.js +++ b/dashboard-ui/scripts/musicartists.js @@ -1,5 +1,7 @@ (function ($, document) { + var pageSizeKey = 'people'; + var view = LibraryBrowser.getDefaultItemsView('Poster', 'List'); // The base query options @@ -34,7 +36,8 @@ totalRecordCount: result.TotalRecordCount, viewButton: true, showLimit: false, - addSelectionButton: true + addSelectionButton: true, + pageSizeKey: pageSizeKey }); $('.listTopPaging', page).html(pagingHtml).trigger('create'); @@ -155,7 +158,7 @@ query.ParentId = LibraryMenu.getTopParentId(); - var limit = LibraryBrowser.getDefaultPageSize(); + var limit = LibraryBrowser.getDefaultPageSize(pageSizeKey, 100); // If the default page size has changed, the start index will have to be reset if (limit != query.Limit) { diff --git a/dashboard-ui/scripts/songs.js b/dashboard-ui/scripts/songs.js index 2d631de163..db1a03c8f9 100644 --- a/dashboard-ui/scripts/songs.js +++ b/dashboard-ui/scripts/songs.js @@ -52,8 +52,7 @@ limit: query.Limit, totalRecordCount: result.TotalRecordCount, viewButton: true, - showLimit: false, - updatePageSizeSetting: false + showLimit: false }); $('.listTopPaging', page).html(pagingHtml).trigger('create'); diff --git a/dashboard-ui/scripts/tvpeople.js b/dashboard-ui/scripts/tvpeople.js index 4c4b9d78af..9015f9e909 100644 --- a/dashboard-ui/scripts/tvpeople.js +++ b/dashboard-ui/scripts/tvpeople.js @@ -1,5 +1,7 @@ (function ($, document) { + var pageSizeKey = 'people'; + // The base query options var query = { @@ -34,8 +36,7 @@ limit: query.Limit, totalRecordCount: result.TotalRecordCount, viewButton: true, - showLimit: false, - updatePageSizeSetting: false + showLimit: false }); $('.listTopPaging', page).html(pagingHtml).trigger('create'); @@ -151,6 +152,14 @@ query.ParentId = LibraryMenu.getTopParentId(); + var limit = LibraryBrowser.getDefaultPageSize(pageSizeKey, 100); + + // If the default page size has changed, the start index will have to be reset + if (limit != query.Limit) { + query.Limit = limit; + query.StartIndex = 0; + } + LibraryBrowser.loadSavedQueryValues(getSavedQueryKey(), query); reloadItems(this);