1
0
Fork 0
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:
Luke Pulverenti 2013-05-15 15:26:52 -04:00
parent 78730cb359
commit d12a273620
20 changed files with 50 additions and 22 deletions

View file

@ -127,10 +127,10 @@
<div class="detailSectionContent" style="padding: 0 1em;">
<p id="seriesAirTime"></p>
<p id="itemPremiereDate"></p>
<p class="itemStudios"></p>
<p class="itemExternalLinks"></p>
<p class="itemTags"></p>
<p id="itemPremiereDate"></p>
<p id="itemBudget"></p>
<p id="itemRevenue"></p>

View file

@ -8,7 +8,6 @@
IncludeItemTypes: "BoxSet",
Recursive: true,
Fields: "DisplayMediaType,ItemCounts,DateCreated,UserData",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -61,6 +60,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
reloadItems(page);

View file

@ -8,7 +8,6 @@
MediaTypes: "Game",
Recursive: true,
Fields: "ItemCounts,DateCreated,UserData",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -62,6 +61,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;

View file

@ -11,7 +11,6 @@
MediaTypes: "Game",
Recursive: true,
Fields: "UserData,DisplayMediaType,Genres,Studios",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -85,6 +84,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.StartIndex = 0;
query.SortBy = this.getAttribute('data-sortby');

View file

@ -8,7 +8,6 @@
MediaTypes: "Game",
Recursive: true,
Fields: "ItemCounts,DateCreated,UserData",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -62,6 +61,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;

View file

@ -9,7 +9,6 @@
IncludeItemTypes: "GamePlatform",
Recursive: true,
Fields: "ItemCounts,ItemCounts,DateCreated,UserData",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -62,6 +61,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
reloadItems(page);

View file

@ -8,7 +8,6 @@
SortBy: "SortName",
SortOrder: "Ascending",
Fields: "UserData,DisplayMediaType,ItemCounts,DateCreated",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -100,6 +99,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.StartIndex = 0;
query.SortBy = this.getAttribute('data-sortby');

View file

@ -1,4 +1,4 @@
var LibraryBrowser = (function (window, document, $, screen) {
var LibraryBrowser = (function (window, document, $, screen, localStorage) {
var defaultBackground = "#999;";
@ -6,6 +6,12 @@
getDefaultPageSize: function () {
var saved = localStorage.getItem('pagesize');
if (saved) {
return parseInt(saved);
}
if (window.location.toString().toLowerCase().indexOf('localhost') != -1) {
return 100;
}
@ -581,7 +587,7 @@
var date = item.DateCreated;
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>";
}
} catch (err) {
@ -768,6 +774,10 @@
getPagingHtml: function (query, totalRecordCount) {
if (query.Limit) {
localStorage.setItem('pagesize', query.Limit);
}
var html = '';
var pageCount = Math.ceil(totalRecordCount / query.Limit);
@ -1623,7 +1633,7 @@
};
})(window, document, jQuery, screen);
})(window, document, jQuery, screen, localStorage);
(function (window, document, $) {

View file

@ -8,7 +8,6 @@
IncludeItemTypes: "Movie",
Recursive: true,
Fields: "ItemCounts,DateCreated,UserData",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -62,6 +61,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;

View file

@ -9,7 +9,6 @@
Recursive: true,
Fields: "ItemCounts,DateCreated,UserData",
PersonTypes: "",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -63,6 +62,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;

View file

@ -10,7 +10,6 @@
IncludeItemTypes: "Movie",
Recursive: true,
Fields: "UserData,DisplayMediaType,ItemCounts,DateCreated",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -84,6 +83,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.StartIndex = 0;
query.SortBy = this.getAttribute('data-sortby');

View file

@ -8,7 +8,6 @@
IncludeItemTypes: "Movie",
Recursive: true,
Fields: "ItemCounts,DateCreated,UserData",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -62,6 +61,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;

View file

@ -10,7 +10,6 @@
IncludeItemTypes: "Trailer",
Recursive: true,
Fields: "UserData,DisplayMediaType,ItemCounts,DateCreated",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -71,6 +70,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.StartIndex = 0;
query.SortBy = this.getAttribute('data-sortby');

View file

@ -10,7 +10,6 @@
IncludeItemTypes: "MusicAlbum",
Recursive: true,
Fields: "ItemCounts,DateCreated,UserData",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -75,6 +74,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;

View file

@ -7,7 +7,6 @@
SortOrder: "Ascending",
Recursive: true,
Fields: "ItemCounts,DateCreated,UserData",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -63,6 +62,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;

View file

@ -8,7 +8,6 @@
IncludeItemTypes: "Audio",
Recursive: true,
Fields: "ItemCounts,DateCreated,UserData",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -62,6 +61,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;

View file

@ -8,7 +8,6 @@
IncludeItemTypes: "Series",
Recursive: true,
Fields: "ItemCounts,DateCreated,UserData",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -62,6 +61,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;

View file

@ -9,7 +9,6 @@
Recursive: true,
Fields: "ItemCounts,DateCreated,UserData",
PersonTypes: "",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -63,6 +62,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;

View file

@ -10,7 +10,6 @@
IncludeItemTypes: "Series",
Recursive: true,
Fields: "DisplayMediaType,SeriesInfo,ItemCounts,DateCreated,UserData",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -81,6 +80,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;

View file

@ -8,7 +8,6 @@
IncludeItemTypes: "Series",
Recursive: true,
Fields: "ItemCounts,DateCreated,UserData",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -62,6 +61,8 @@
var page = this;
query.Limit = LibraryBrowser.getDefaultPageSize();
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;