mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
remember page size
This commit is contained in:
parent
78730cb359
commit
d12a273620
20 changed files with 50 additions and 22 deletions
|
@ -127,10 +127,10 @@
|
||||||
<div class="detailSectionContent" style="padding: 0 1em;">
|
<div class="detailSectionContent" style="padding: 0 1em;">
|
||||||
|
|
||||||
<p id="seriesAirTime"></p>
|
<p id="seriesAirTime"></p>
|
||||||
|
<p id="itemPremiereDate"></p>
|
||||||
<p class="itemStudios"></p>
|
<p class="itemStudios"></p>
|
||||||
<p class="itemExternalLinks"></p>
|
<p class="itemExternalLinks"></p>
|
||||||
<p class="itemTags"></p>
|
<p class="itemTags"></p>
|
||||||
<p id="itemPremiereDate"></p>
|
|
||||||
|
|
||||||
<p id="itemBudget"></p>
|
<p id="itemBudget"></p>
|
||||||
<p id="itemRevenue"></p>
|
<p id="itemRevenue"></p>
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
IncludeItemTypes: "BoxSet",
|
IncludeItemTypes: "BoxSet",
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "DisplayMediaType,ItemCounts,DateCreated,UserData",
|
Fields: "DisplayMediaType,ItemCounts,DateCreated,UserData",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -61,6 +60,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
reloadItems(page);
|
reloadItems(page);
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
MediaTypes: "Game",
|
MediaTypes: "Game",
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "ItemCounts,DateCreated,UserData",
|
Fields: "ItemCounts,DateCreated,UserData",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -62,6 +61,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
MediaTypes: "Game",
|
MediaTypes: "Game",
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "UserData,DisplayMediaType,Genres,Studios",
|
Fields: "UserData,DisplayMediaType,Genres,Studios",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -85,6 +84,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
MediaTypes: "Game",
|
MediaTypes: "Game",
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "ItemCounts,DateCreated,UserData",
|
Fields: "ItemCounts,DateCreated,UserData",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -62,6 +61,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
IncludeItemTypes: "GamePlatform",
|
IncludeItemTypes: "GamePlatform",
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "ItemCounts,ItemCounts,DateCreated,UserData",
|
Fields: "ItemCounts,ItemCounts,DateCreated,UserData",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -62,6 +61,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
reloadItems(page);
|
reloadItems(page);
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
SortBy: "SortName",
|
SortBy: "SortName",
|
||||||
SortOrder: "Ascending",
|
SortOrder: "Ascending",
|
||||||
Fields: "UserData,DisplayMediaType,ItemCounts,DateCreated",
|
Fields: "UserData,DisplayMediaType,ItemCounts,DateCreated",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -100,6 +99,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
var LibraryBrowser = (function (window, document, $, screen) {
|
var LibraryBrowser = (function (window, document, $, screen, localStorage) {
|
||||||
|
|
||||||
var defaultBackground = "#999;";
|
var defaultBackground = "#999;";
|
||||||
|
|
||||||
|
@ -6,6 +6,12 @@
|
||||||
|
|
||||||
getDefaultPageSize: function () {
|
getDefaultPageSize: function () {
|
||||||
|
|
||||||
|
var saved = localStorage.getItem('pagesize');
|
||||||
|
|
||||||
|
if (saved) {
|
||||||
|
return parseInt(saved);
|
||||||
|
}
|
||||||
|
|
||||||
if (window.location.toString().toLowerCase().indexOf('localhost') != -1) {
|
if (window.location.toString().toLowerCase().indexOf('localhost') != -1) {
|
||||||
return 100;
|
return 100;
|
||||||
}
|
}
|
||||||
|
@ -581,7 +587,7 @@
|
||||||
var date = item.DateCreated;
|
var date = item.DateCreated;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (date && (new Date().getTime() - parseISO8601Date(date).getTime()) < 864000000) {
|
if (date && (new Date().getTime() - parseISO8601Date(date).getTime()) < 604800000) {
|
||||||
return "<div class='posterRibbon'>New</div>";
|
return "<div class='posterRibbon'>New</div>";
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -768,6 +774,10 @@
|
||||||
|
|
||||||
getPagingHtml: function (query, totalRecordCount) {
|
getPagingHtml: function (query, totalRecordCount) {
|
||||||
|
|
||||||
|
if (query.Limit) {
|
||||||
|
localStorage.setItem('pagesize', query.Limit);
|
||||||
|
}
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
var pageCount = Math.ceil(totalRecordCount / query.Limit);
|
var pageCount = Math.ceil(totalRecordCount / query.Limit);
|
||||||
|
@ -1623,7 +1633,7 @@
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
})(window, document, jQuery, screen);
|
})(window, document, jQuery, screen, localStorage);
|
||||||
|
|
||||||
|
|
||||||
(function (window, document, $) {
|
(function (window, document, $) {
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
IncludeItemTypes: "Movie",
|
IncludeItemTypes: "Movie",
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "ItemCounts,DateCreated,UserData",
|
Fields: "ItemCounts,DateCreated,UserData",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -62,6 +61,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "ItemCounts,DateCreated,UserData",
|
Fields: "ItemCounts,DateCreated,UserData",
|
||||||
PersonTypes: "",
|
PersonTypes: "",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -63,6 +62,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
IncludeItemTypes: "Movie",
|
IncludeItemTypes: "Movie",
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "UserData,DisplayMediaType,ItemCounts,DateCreated",
|
Fields: "UserData,DisplayMediaType,ItemCounts,DateCreated",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -84,6 +83,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
IncludeItemTypes: "Movie",
|
IncludeItemTypes: "Movie",
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "ItemCounts,DateCreated,UserData",
|
Fields: "ItemCounts,DateCreated,UserData",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -62,6 +61,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
IncludeItemTypes: "Trailer",
|
IncludeItemTypes: "Trailer",
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "UserData,DisplayMediaType,ItemCounts,DateCreated",
|
Fields: "UserData,DisplayMediaType,ItemCounts,DateCreated",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -71,6 +70,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
IncludeItemTypes: "MusicAlbum",
|
IncludeItemTypes: "MusicAlbum",
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "ItemCounts,DateCreated,UserData",
|
Fields: "ItemCounts,DateCreated,UserData",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -75,6 +74,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
SortOrder: "Ascending",
|
SortOrder: "Ascending",
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "ItemCounts,DateCreated,UserData",
|
Fields: "ItemCounts,DateCreated,UserData",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -63,6 +62,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
IncludeItemTypes: "Audio",
|
IncludeItemTypes: "Audio",
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "ItemCounts,DateCreated,UserData",
|
Fields: "ItemCounts,DateCreated,UserData",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -62,6 +61,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
IncludeItemTypes: "Series",
|
IncludeItemTypes: "Series",
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "ItemCounts,DateCreated,UserData",
|
Fields: "ItemCounts,DateCreated,UserData",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -62,6 +61,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "ItemCounts,DateCreated,UserData",
|
Fields: "ItemCounts,DateCreated,UserData",
|
||||||
PersonTypes: "",
|
PersonTypes: "",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -63,6 +62,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
IncludeItemTypes: "Series",
|
IncludeItemTypes: "Series",
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "DisplayMediaType,SeriesInfo,ItemCounts,DateCreated,UserData",
|
Fields: "DisplayMediaType,SeriesInfo,ItemCounts,DateCreated,UserData",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -81,6 +80,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
IncludeItemTypes: "Series",
|
IncludeItemTypes: "Series",
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "ItemCounts,DateCreated,UserData",
|
Fields: "ItemCounts,DateCreated,UserData",
|
||||||
Limit: LibraryBrowser.getDefaultPageSize(),
|
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -62,6 +61,8 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
query.Limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
$('.radioSortBy', this).on('click', function () {
|
$('.radioSortBy', this).on('click', function () {
|
||||||
query.SortBy = this.getAttribute('data-sortby');
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue