mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update item list page
This commit is contained in:
parent
0e1c7cbb7a
commit
8e0db5f3c1
4 changed files with 112 additions and 139 deletions
|
@ -4,7 +4,7 @@
|
|||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="itemListPage" data-role="page" class="page libraryPage folderListPage noSecondaryNavPage" data-require="jqmcheckbox,jqmcontrolgroup,jqmpanel,scripts/itemlistpage">
|
||||
<div id="itemListPage" data-role="page" class="page libraryPage folderListPage noSecondaryNavPage" data-require="jqmpanel,scripts/itemlistpage">
|
||||
<div class="alphabetPicker">
|
||||
</div>
|
||||
<div data-role="content" class="itemListContent">
|
||||
|
@ -19,94 +19,42 @@
|
|||
<div data-role="panel" class="viewPanel" data-theme="a" data-position="right" data-display="overlay" data-position-fixed="true">
|
||||
<form>
|
||||
|
||||
<div data-role="controlgroup" data-type="horizontal" data-mini="true" class="viewPanelTabs">
|
||||
<a href="#" data-role="button" class="viewTabButton" data-tab="tabView">${TabView}</a>
|
||||
<a href="#" data-role="button" class="viewTabButton" data-tab="tabSort">${TabSort}</a>
|
||||
<a href="#" data-role="button" class="viewTabButton" data-tab="tabFilter">${TabFilter}</a>
|
||||
</div>
|
||||
|
||||
<div class="tabView viewTab">
|
||||
|
||||
<div>
|
||||
<label for="selectView">${LabelView}</label>
|
||||
<select id="selectView">
|
||||
<option value="Backdrop">${OptionBackdrop}</option>
|
||||
<option value="Poster">${OptionPoster}</option>
|
||||
</select>
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<label for="selectPageSize">${LabelPageSize}</label>
|
||||
<select id="selectPageSize" class="selectPageSize"></select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="tabFilter viewTab">
|
||||
<fieldset data-role="controlgroup">
|
||||
<legend>${HeaderFilters}</legend>
|
||||
<input class="chkStandardFilter" type="checkbox" name="chkPlayed" id="chkPlayed" data-filter="IsPlayed" data-mini="true">
|
||||
<h1>
|
||||
${HeaderFilters}
|
||||
</h1>
|
||||
|
||||
<div class="checkboxContainer">
|
||||
<input class="chkStandardFilter" type="checkbox" id="chkPlayed" data-filter="IsPlayed" data-role="none">
|
||||
<label for="chkPlayed">${OptionPlayed}</label>
|
||||
|
||||
<input class="chkStandardFilter" type="checkbox" name="chkUnplayed" id="chkUnplayed" data-filter="IsUnPlayed" data-mini="true">
|
||||
<label for="chkUnplayed">${OptionUnplayed}</label>
|
||||
|
||||
<input class="chkStandardFilter" type="checkbox" name="chkResumable" id="chkResumable" data-filter="IsResumable" data-mini="true">
|
||||
<label for="chkResumable">${OptionResumable}</label>
|
||||
|
||||
<input class="chkStandardFilter" type="checkbox" name="chkIsFavorite" id="chkIsFavorite" data-filter="IsFavorite" data-mini="true">
|
||||
<label for="chkIsFavorite">${OptionFavorite}</label>
|
||||
|
||||
<input class="chkStandardFilter" type="checkbox" name="chkLikes" id="chkLikes" data-filter="Likes" data-mini="true">
|
||||
<label for="chkLikes">${OptionLikes}</label>
|
||||
|
||||
<input class="chkStandardFilter" type="checkbox" name="chkDislikes" id="chkDislikes" data-filter="Dislikes" data-mini="true">
|
||||
<label for="chkDislikes">${OptionDislikes}</label>
|
||||
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
<div class="tabSort viewTab">
|
||||
<fieldset data-role="controlgroup">
|
||||
<legend>
|
||||
${HeaderSortBy}
|
||||
</legend>
|
||||
|
||||
<input class="radioSortBy defaultSort" type="radio" name="radioSortBy" id="radioSortName" value="on" checked="checked" data-sortby="SortName" data-mini="true">
|
||||
<label for="radioSortName">${OptionNameSort}</label>
|
||||
<div class="checkboxContainer">
|
||||
<input class="chkStandardFilter" type="checkbox" id="chkUnplayed" data-filter="IsUnPlayed" data-role="none">
|
||||
<label for="chkUnplayed">${OptionUnplayed}</label>
|
||||
</div>
|
||||
|
||||
<input class="radioSortBy" type="radio" name="radioSortBy" id="radioCommunityRating" value="off" data-sortby="CommunityRating" data-mini="true">
|
||||
<label for="radioCommunityRating">${OptionCommunityRating}</label>
|
||||
<div class="checkboxContainer">
|
||||
<input class="chkStandardFilter" type="checkbox" id="chkResumable" data-filter="IsResumable" data-role="none">
|
||||
<label for="chkResumable">${OptionResumable}</label>
|
||||
</div>
|
||||
|
||||
<input class="radioSortBy" type="radio" name="radioSortBy" id="radioDateCreated" value="off" data-sortby="DateCreated" data-mini="true">
|
||||
<label for="radioDateCreated">${OptionDateAdded}</label>
|
||||
<div class="checkboxContainer">
|
||||
<input class="chkStandardFilter" type="checkbox" id="chkIsFavorite" data-filter="IsFavorite" data-role="none">
|
||||
<label for="chkIsFavorite">${OptionFavorite}</label>
|
||||
</div>
|
||||
|
||||
<input class="radioSortBy" type="radio" name="radioSortBy" id="radioDatePlayed" value="off" data-sortby="DatePlayed" data-mini="true">
|
||||
<label for="radioDatePlayed">${OptionDatePlayed}</label>
|
||||
<div class="checkboxContainer">
|
||||
<input class="chkStandardFilter" type="checkbox" id="chkLikes" data-filter="Likes" data-role="none">
|
||||
<label for="chkLikes">${OptionLikes}</label>
|
||||
</div>
|
||||
|
||||
<input class="radioSortBy" type="radio" name="radioSortBy" id="radioContentRating" value="off" data-sortby="OfficialRating" data-mini="true">
|
||||
<label for="radioContentRating">${OptionParentalRating}</label>
|
||||
<div class="checkboxContainer">
|
||||
<input class="chkStandardFilter" type="checkbox" id="chkDislikes" data-filter="Dislikes" data-role="none">
|
||||
<label for="chkDislikes">${OptionDislikes}</label>
|
||||
</div>
|
||||
|
||||
<input class="radioSortBy" type="radio" name="radioSortBy" id="radioPremiereDate" value="off" data-sortby="PremiereDate" data-mini="true">
|
||||
<label for="radioPremiereDate">${OptionReleaseDate}</label>
|
||||
|
||||
<input class="radioSortBy" type="radio" name="radioSortBy" id="radioRuntime" value="off" data-sortby="Runtime" data-mini="true">
|
||||
<label for="radioRuntime">${OptionRuntime}</label>
|
||||
|
||||
<input class="radioSortBy" type="radio" name="radioSortBy" id="radioIsFolder" value="off" data-sortby="IsFolder,SortName" data-mini="true">
|
||||
<label for="radioIsFolder">${OptionFolderSort}</label>
|
||||
</fieldset>
|
||||
|
||||
<fieldset data-role="controlgroup">
|
||||
<legend>
|
||||
${HeaderSortOrder}
|
||||
</legend>
|
||||
|
||||
<input class="radioSortOrder" type="radio" name="radioSortOrder" id="radioAscending" value="on" checked="checked" data-sortorder="Ascending" data-mini="true">
|
||||
<label for="radioAscending">${OptionAscending}</label>
|
||||
|
||||
<input class="radioSortOrder" type="radio" name="radioSortOrder" id="radioDescending" value="off" data-sortorder="Descending" data-mini="true">
|
||||
<label for="radioDescending">${OptionDescending}</label>
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -244,7 +244,7 @@
|
|||
|
||||
function renderImage(page, item, user) {
|
||||
|
||||
var imageHref = user.Policy.IsAdministrator && item.MediaType != 'Photo' ? "edititemmetadata.html?tab=3&id=" + item.Id : "";
|
||||
var imageHref = user.Policy.IsAdministrator && item.MediaType != 'Photo' ? "edititemmetadata.html?tab=2&id=" + item.Id : "";
|
||||
|
||||
LibraryBrowser.renderDetailImage(page.querySelector('.detailImageContainer'), item, imageHref);
|
||||
}
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
|
||||
var data = {};
|
||||
|
||||
function getQuery() {
|
||||
|
||||
function getPageData() {
|
||||
var key = getSavedQueryKey();
|
||||
var pageData = data[key];
|
||||
|
||||
|
@ -26,13 +25,18 @@
|
|||
|
||||
pageData.query.Filters = "";
|
||||
pageData.query.NameStartsWithOrGreater = '';
|
||||
pageData.view = LibraryBrowser.getDefaultItemsView('Poster', 'Poster');
|
||||
|
||||
pageData.query.ParentId = getParameterByName('parentId');
|
||||
LibraryBrowser.loadSavedQueryValues(key, pageData.query);
|
||||
}
|
||||
return pageData.query;
|
||||
return pageData;
|
||||
}
|
||||
|
||||
function getQuery() {
|
||||
|
||||
return getPageData().query;
|
||||
}
|
||||
function getSavedQueryKey() {
|
||||
|
||||
return getWindowUrl();
|
||||
|
@ -60,13 +64,20 @@
|
|||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
||||
var view = getPageData().view;
|
||||
|
||||
var html = '';
|
||||
var pagingHtml = LibraryBrowser.getQueryPagingHtml({
|
||||
startIndex: query.StartIndex,
|
||||
limit: query.Limit,
|
||||
totalRecordCount: result.TotalRecordCount,
|
||||
viewButton: true,
|
||||
showLimit: false
|
||||
showLimit: false,
|
||||
addLayoutButton: true,
|
||||
currentLayout: view,
|
||||
viewIcon: 'filter-list',
|
||||
sortButton: true,
|
||||
layouts: 'Poster,PosterCard'
|
||||
});
|
||||
|
||||
page.querySelector('.listTopPaging').innerHTML = pagingHtml;
|
||||
|
@ -102,6 +113,7 @@
|
|||
posterOptions.showTitle = true;
|
||||
posterOptions.showYear = true;
|
||||
posterOptions.cardLayout = true;
|
||||
posterOptions.centerText = false;
|
||||
|
||||
html = LibraryBrowser.getPosterViewHtml(posterOptions);
|
||||
}
|
||||
|
@ -120,6 +132,58 @@
|
|||
reloadItems(page);
|
||||
});
|
||||
|
||||
$('.btnChangeLayout', page).on('layoutchange', function (e, layout) {
|
||||
getPageData().view = layout;
|
||||
LibraryBrowser.saveViewSetting(getSavedQueryKey(), layout);
|
||||
reloadItems(page);
|
||||
});
|
||||
|
||||
// On callback make sure to set StartIndex = 0
|
||||
$('.btnSort', page).on('click', function () {
|
||||
LibraryBrowser.showSortMenu({
|
||||
items: [{
|
||||
name: Globalize.translate('OptionNameSort'),
|
||||
id: 'SortName'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('OptionCommunityRating'),
|
||||
id: 'CommunityRating,SortName'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('OptionCriticRating'),
|
||||
id: 'CriticRating,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'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('OptionRuntime'),
|
||||
id: 'Runtime,SortName'
|
||||
}],
|
||||
callback: function () {
|
||||
reloadItems(page);
|
||||
},
|
||||
query: query
|
||||
});
|
||||
});
|
||||
|
||||
LibraryBrowser.saveQueryValues(getParameterByName('parentId'), query);
|
||||
|
||||
var name = item.Name;
|
||||
|
@ -146,18 +210,6 @@
|
|||
function updateFilterControls(page) {
|
||||
|
||||
var query = getQuery();
|
||||
// Reset form values using the last used query
|
||||
$('.radioSortBy', page).each(function () {
|
||||
|
||||
this.checked = (query.SortBy || '').toLowerCase() == this.getAttribute('data-sortby').toLowerCase();
|
||||
|
||||
}).checkboxradio('refresh');
|
||||
|
||||
$('.radioSortOrder', page).each(function () {
|
||||
|
||||
this.checked = (query.SortOrder || '').toLowerCase() == this.getAttribute('data-sortorder').toLowerCase();
|
||||
|
||||
}).checkboxradio('refresh');
|
||||
|
||||
$('.chkStandardFilter', page).each(function () {
|
||||
|
||||
|
@ -166,12 +218,9 @@
|
|||
|
||||
this.checked = filters.indexOf(',' + filterName) != -1;
|
||||
|
||||
}).checkboxradio('refresh');
|
||||
|
||||
$('#selectView', page).val(view);
|
||||
});
|
||||
|
||||
$('.alphabetPicker', page).alphaValue(query.NameStartsWithOrGreater);
|
||||
$('#selectPageSize', page).val(query.Limit);
|
||||
}
|
||||
|
||||
function onListItemClick(e) {
|
||||
|
@ -192,20 +241,6 @@
|
|||
|
||||
var page = this;
|
||||
|
||||
$('.radioSortBy', this).on('click', function () {
|
||||
var query = getQuery();
|
||||
query.StartIndex = 0;
|
||||
query.SortBy = this.getAttribute('data-sortby');
|
||||
reloadItems(page);
|
||||
});
|
||||
|
||||
$('.radioSortOrder', this).on('click', function () {
|
||||
var query = getQuery();
|
||||
query.StartIndex = 0;
|
||||
query.SortOrder = this.getAttribute('data-sortorder');
|
||||
reloadItems(page);
|
||||
});
|
||||
|
||||
$('.chkStandardFilter', this).on('change', function () {
|
||||
|
||||
var query = getQuery();
|
||||
|
@ -224,15 +259,6 @@
|
|||
reloadItems(page);
|
||||
});
|
||||
|
||||
$('#selectView', this).on('change', function () {
|
||||
|
||||
view = this.value;
|
||||
|
||||
reloadItems(page);
|
||||
|
||||
LibraryBrowser.saveViewSetting(getParameterByName('parentId'), view);
|
||||
});
|
||||
|
||||
$('.alphabetPicker', this).on('alphaselect', function (e, character) {
|
||||
|
||||
var query = getQuery();
|
||||
|
@ -249,30 +275,13 @@
|
|||
reloadItems(page);
|
||||
});
|
||||
|
||||
$('#selectPageSize', page).on('change', function () {
|
||||
var query = getQuery();
|
||||
query.Limit = parseInt(this.value);
|
||||
query.StartIndex = 0;
|
||||
reloadItems(page);
|
||||
});
|
||||
|
||||
$(page).on('click', '.mediaItem', onListItemClick);
|
||||
|
||||
}).on('pagebeforeshow', "#itemListPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
if (LibraryBrowser.needsRefresh(page)) {
|
||||
LibraryBrowser.getSavedViewSetting(getSavedQueryKey()).done(function (val) {
|
||||
|
||||
if (val) {
|
||||
$('#selectView', page).val(val).trigger('change');
|
||||
} else {
|
||||
reloadItems(page);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
updateFilterControls(page);
|
||||
LibraryMenu.setBackButtonVisible(getParameterByName('context'));
|
||||
|
||||
|
|
|
@ -3205,7 +3205,16 @@ $.widget( "mobile.page", {
|
|||
// pages[i].style.display = 'none';
|
||||
//}
|
||||
}
|
||||
to[0].style.display = 'block';
|
||||
|
||||
var toPage = to[0];
|
||||
|
||||
toPage.style.display = 'block';
|
||||
|
||||
//var transition = toPage.getAttribute('data-transition');
|
||||
//if (transition == 'zoom') {
|
||||
// zoomIn(toPage);
|
||||
//}
|
||||
|
||||
this._triggerCssTransitionEvents(to, from);
|
||||
},
|
||||
|
||||
|
@ -3452,6 +3461,13 @@ $.widget( "mobile.page", {
|
|||
}
|
||||
});
|
||||
|
||||
function zoomIn(elem) {
|
||||
var keyframes = [{ transform: 'scale3d(.3, .3, .3) ', opacity: '0', offset: 0 },
|
||||
{ transform: 'none', opacity: '1', offset: 1 }];
|
||||
var timing = { duration: 200, iterations: 1 };
|
||||
return elem.animate(keyframes, timing);
|
||||
}
|
||||
|
||||
// The following handlers should be bound after mobileinit has been triggered
|
||||
// the following deferred is resolved in the init file
|
||||
$.mobile.navreadyDeferred = $.Deferred();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue