mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
added a photo view
This commit is contained in:
parent
0f0fdd1bd1
commit
6daaed3bcc
11 changed files with 301 additions and 12 deletions
|
@ -22,6 +22,7 @@
|
||||||
background-color: rgba(0, 0, 0, .85);
|
background-color: rgba(0, 0, 0, .85);
|
||||||
z-index: 998;
|
z-index: 998;
|
||||||
display: none;
|
display: none;
|
||||||
|
line-height: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cardOverlayInner {
|
.cardOverlayInner {
|
||||||
|
|
|
@ -859,6 +859,7 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background: rgb(0, 143, 187);
|
background: rgb(0, 143, 187);
|
||||||
background: rgba(0, 143, 187, .8);
|
background: rgba(0, 143, 187, .8);
|
||||||
|
line-height: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
.offlinePosterRibbon {
|
.offlinePosterRibbon {
|
||||||
|
|
|
@ -36,6 +36,12 @@
|
||||||
<button id="btnDelete" type="button" data-icon="delete" data-mini="true" data-inline="true">${ButtonDelete}</button>
|
<button id="btnDelete" type="button" data-icon="delete" data-mini="true" data-inline="true">${ButtonDelete}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="display: inline-block;vertical-align:middle;margin-left: 1em;" class="hide">
|
||||||
|
<div id="refreshLoading" style="display:none;">
|
||||||
|
<div class="circle1" style="top:-10px;"></div>
|
||||||
|
<div style="margin-top: -15px;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="padding: 10px 0;">
|
<div style="padding: 10px 0;">
|
||||||
|
|
|
@ -40,6 +40,13 @@
|
||||||
<a href="moviestudios.html">${TabStudios}</a>
|
<a href="moviestudios.html">${TabStudios}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="itemTabs photoTabs" style="display: none;">
|
||||||
|
<div class="libraryViewNav scopedLibraryViewNav">
|
||||||
|
<a href="photos.html" class="ui-btn-active lnkPhotoAlbums">${TabAlbums}</a>
|
||||||
|
<a href="photos.html?context=photos-photos" class="lnkPhotos">${TabPhotos}</a>
|
||||||
|
<a href="photos.html?context=photos-videos" class="lnkVideos">${TabVideos}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div id="tvShowsTabs" class="itemTabs" style="display: none;">
|
<div id="tvShowsTabs" class="itemTabs" style="display: none;">
|
||||||
<div class="libraryViewNav scopedLibraryViewNav">
|
<div class="libraryViewNav scopedLibraryViewNav">
|
||||||
<a href="tvrecommended.html">${TabSuggestions}</a>
|
<a href="tvrecommended.html">${TabSuggestions}</a>
|
||||||
|
|
24
dashboard-ui/photos.html
Normal file
24
dashboard-ui/photos.html
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Emby</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="photosPage" data-role="page" class="page libraryPage">
|
||||||
|
|
||||||
|
<div class="libraryViewNav scopedLibraryViewNav">
|
||||||
|
<a href="photos.html" class="ui-btn-active lnkPhotoAlbums">${TabAlbums}</a>
|
||||||
|
<a href="photos.html?context=photos-photos" class="lnkPhotos">${TabPhotos}</a>
|
||||||
|
<a href="photos.html?context=photos-videos" class="lnkVideos">${TabVideos}</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div data-role="content">
|
||||||
|
<div class="viewSettings">
|
||||||
|
<div class="listTopPaging">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="items" class="itemsContainer paddedItemsContainer" style="text-align:center;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -1338,10 +1338,9 @@
|
||||||
|
|
||||||
function refreshWithOptions(page, options) {
|
function refreshWithOptions(page, options) {
|
||||||
|
|
||||||
ApiClient.refreshItem(currentItem.Id, options).done(function () {
|
$('#refreshLoading', page).show();
|
||||||
|
|
||||||
Dashboard.alert(Globalize.translate('MessageRefreshQueued'));
|
ApiClient.refreshItem(currentItem.Id, options);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onWebSocketMessageReceived(e, data) {
|
function onWebSocketMessageReceived(e, data) {
|
||||||
|
@ -1352,8 +1351,11 @@
|
||||||
|
|
||||||
if (msg.Data.ItemsUpdated.indexOf(currentItem.Id) != -1) {
|
if (msg.Data.ItemsUpdated.indexOf(currentItem.Id) != -1) {
|
||||||
|
|
||||||
|
var page = $.mobile.activePage;
|
||||||
|
|
||||||
console.log('Item updated - reloading metadata');
|
console.log('Item updated - reloading metadata');
|
||||||
reload($.mobile.activePage);
|
reload(page);
|
||||||
|
$('#refreshLoading', page).hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,8 +227,7 @@
|
||||||
showTitle: showTitles,
|
showTitle: showTitles,
|
||||||
centerText: true,
|
centerText: true,
|
||||||
lazy: true,
|
lazy: true,
|
||||||
autoThumb: true,
|
autoThumb: true
|
||||||
context: 'home'
|
|
||||||
});
|
});
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -254,7 +254,21 @@
|
||||||
$('a', elem).removeClass('ui-btn-active');
|
$('a', elem).removeClass('ui-btn-active');
|
||||||
$('.lnkHomeLatest', page).addClass('ui-btn-active');
|
$('.lnkHomeLatest', page).addClass('ui-btn-active');
|
||||||
}
|
}
|
||||||
else if (context == 'movies' || item.Type == 'Movie' || context == 'movies-trailers') {
|
else if (context == 'photos' || context == 'photos-photos') {
|
||||||
|
elem = $('.photoTabs', page).show();
|
||||||
|
$('a', elem).removeClass('ui-btn-active');
|
||||||
|
$('.lnkHomeLatest', page).addClass('ui-btn-active');
|
||||||
|
|
||||||
|
if (context == 'photos-photos') {
|
||||||
|
$('.lnkPhotos', page).addClass('ui-btn-active');
|
||||||
|
}
|
||||||
|
else if (context == 'photos-videos') {
|
||||||
|
$('.lnkVideos', page).addClass('ui-btn-active');
|
||||||
|
} else {
|
||||||
|
$('.lnkPhotoAlbums', page).addClass('ui-btn-active');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (context == 'movies' || context == 'movies-trailers') {
|
||||||
elem = $('#movieTabs', page).show();
|
elem = $('#movieTabs', page).show();
|
||||||
$('a', elem).removeClass('ui-btn-active');
|
$('a', elem).removeClass('ui-btn-active');
|
||||||
|
|
||||||
|
|
|
@ -484,10 +484,6 @@
|
||||||
return 'collections.html?topParentId=' + item.Id;
|
return 'collections.html?topParentId=' + item.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.CollectionType == 'trailers') {
|
|
||||||
return "itemlist.html?parentId=" + item.Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.CollectionType == 'tvshows') {
|
if (item.CollectionType == 'tvshows') {
|
||||||
return 'tvrecommended.html?topParentId=' + item.Id;
|
return 'tvrecommended.html?topParentId=' + item.Id;
|
||||||
}
|
}
|
||||||
|
@ -502,11 +498,17 @@
|
||||||
if (item.CollectionType == 'playlists') {
|
if (item.CollectionType == 'playlists') {
|
||||||
return 'playlists.html?topParentId=' + item.Id;
|
return 'playlists.html?topParentId=' + item.Id;
|
||||||
}
|
}
|
||||||
|
if (item.CollectionType == 'photos') {
|
||||||
|
return 'photos.html?topParentId=' + item.Id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (item.Type == 'CollectionFolder') {
|
if (item.Type == 'CollectionFolder') {
|
||||||
return 'itemlist.html?topParentId=' + item.Id + '&parentid=' + item.Id;
|
return 'itemlist.html?topParentId=' + item.Id + '&parentid=' + item.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.Type == "PhotoAlbum" && context == 'photos') {
|
||||||
|
return "photos.html?parentId=" + id;
|
||||||
|
}
|
||||||
if (item.Type == "Playlist") {
|
if (item.Type == "Playlist") {
|
||||||
return "playlistedit.html?id=" + id;
|
return "playlistedit.html?id=" + id;
|
||||||
}
|
}
|
||||||
|
|
|
@ -492,7 +492,7 @@
|
||||||
|
|
||||||
var invalidTypes = ['Person', 'Genre', 'MusicGenre', 'Studio', 'GameGenre', 'BoxSet', 'Playlist', 'UserView', 'CollectionFolder', 'Audio', 'Episode'];
|
var invalidTypes = ['Person', 'Genre', 'MusicGenre', 'Studio', 'GameGenre', 'BoxSet', 'Playlist', 'UserView', 'CollectionFolder', 'Audio', 'Episode'];
|
||||||
|
|
||||||
return item.LocationType == 'FileSystem' && !item.CollectionType && invalidTypes.indexOf(item.Type) == -1;
|
return item.LocationType == 'FileSystem' && !item.CollectionType && invalidTypes.indexOf(item.Type) == -1 && item.MediaType != 'Photo';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
233
dashboard-ui/scripts/photos.js
Normal file
233
dashboard-ui/scripts/photos.js
Normal file
|
@ -0,0 +1,233 @@
|
||||||
|
(function ($, document) {
|
||||||
|
|
||||||
|
var view = LibraryBrowser.getDefaultItemsView('Poster', 'Poster');
|
||||||
|
|
||||||
|
// The base query options
|
||||||
|
var query = {
|
||||||
|
|
||||||
|
SortBy: "SortName",
|
||||||
|
SortOrder: "Ascending",
|
||||||
|
Fields: "PrimaryImageAspectRatio,SortName,SyncInfo",
|
||||||
|
StartIndex: 0,
|
||||||
|
ImageTypeLimit: 1,
|
||||||
|
EnableImageTypes: "Primary"
|
||||||
|
};
|
||||||
|
|
||||||
|
function getSavedQueryKey() {
|
||||||
|
|
||||||
|
return 'photos' + (query.ParentId || '');
|
||||||
|
}
|
||||||
|
|
||||||
|
function reloadItems(page) {
|
||||||
|
|
||||||
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
|
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||||
|
|
||||||
|
// Scroll back up so they can see the results from the beginning
|
||||||
|
$(document).scrollTop(0);
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
var pagingHtml = LibraryBrowser.getQueryPagingHtml({
|
||||||
|
startIndex: query.StartIndex,
|
||||||
|
limit: query.Limit,
|
||||||
|
totalRecordCount: result.TotalRecordCount,
|
||||||
|
viewButton: false,
|
||||||
|
showLimit: false
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.listTopPaging', page).html(pagingHtml).trigger('create');
|
||||||
|
|
||||||
|
updateFilterControls(page);
|
||||||
|
|
||||||
|
// Poster
|
||||||
|
html = LibraryBrowser.getPosterViewHtml({
|
||||||
|
items: result.Items,
|
||||||
|
shape: "auto",
|
||||||
|
context: getParameterByName('context') || 'photos',
|
||||||
|
showTitle: false,
|
||||||
|
centerText: true,
|
||||||
|
lazy: true
|
||||||
|
});
|
||||||
|
|
||||||
|
var elem = $('#items', page).html(html).lazyChildren();
|
||||||
|
|
||||||
|
$(pagingHtml).appendTo(elem).trigger('create');
|
||||||
|
|
||||||
|
$('.btnNextPage', page).on('click', function () {
|
||||||
|
query.StartIndex += query.Limit;
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btnPreviousPage', page).on('click', function () {
|
||||||
|
query.StartIndex -= query.Limit;
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
LibraryBrowser.saveQueryValues(getSavedQueryKey(), query);
|
||||||
|
|
||||||
|
Dashboard.hideLoadingMsg();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateFilterControls(page) {
|
||||||
|
|
||||||
|
// 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 () {
|
||||||
|
|
||||||
|
var filters = "," + (query.Filters || "");
|
||||||
|
var filterName = this.getAttribute('data-filter');
|
||||||
|
|
||||||
|
this.checked = filters.indexOf(',' + filterName) != -1;
|
||||||
|
|
||||||
|
}).checkboxradio('refresh');
|
||||||
|
}
|
||||||
|
|
||||||
|
var filtersLoaded;
|
||||||
|
function reloadFiltersIfNeeded(page) {
|
||||||
|
|
||||||
|
if (!filtersLoaded) {
|
||||||
|
|
||||||
|
filtersLoaded = true;
|
||||||
|
|
||||||
|
QueryFilters.loadFilters(page, Dashboard.getCurrentUserId(), query, function () {
|
||||||
|
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setQueryPerContext(page) {
|
||||||
|
|
||||||
|
var context = getParameterByName('context');
|
||||||
|
|
||||||
|
$('.libraryViewNav a', page).removeClass('ui-btn-active');
|
||||||
|
|
||||||
|
if (context == 'photos-photos') {
|
||||||
|
query.Recursive = true;
|
||||||
|
query.MediaTypes = 'Photo';
|
||||||
|
$('.lnkPhotos', page).addClass('ui-btn-active');
|
||||||
|
}
|
||||||
|
else if (context == 'photos-videos') {
|
||||||
|
query.Recursive = true;
|
||||||
|
query.MediaTypes = 'Video';
|
||||||
|
$('.lnkVideos', page).addClass('ui-btn-active');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
query.Recursive = false;
|
||||||
|
query.MediaTypes = null;
|
||||||
|
$('.lnkPhotoAlbums', page).addClass('ui-btn-active');
|
||||||
|
}
|
||||||
|
|
||||||
|
query.ParentId = getParameterByName('parentId') || LibraryMenu.getTopParentId();
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).on('pageinit', "#photosPage", function () {
|
||||||
|
|
||||||
|
var page = this;
|
||||||
|
|
||||||
|
$('.viewPanel', page).on('panelopen', function () {
|
||||||
|
|
||||||
|
reloadFiltersIfNeeded(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.radioSortBy', this).on('click', function () {
|
||||||
|
query.SortBy = this.getAttribute('data-sortby');
|
||||||
|
query.StartIndex = 0;
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.radioSortOrder', this).on('click', function () {
|
||||||
|
query.SortOrder = this.getAttribute('data-sortorder');
|
||||||
|
query.StartIndex = 0;
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.chkStandardFilter', this).on('change', function () {
|
||||||
|
|
||||||
|
var filterName = this.getAttribute('data-filter');
|
||||||
|
var filters = query.Filters || "";
|
||||||
|
|
||||||
|
filters = (',' + filters).replace(',' + filterName, '').substring(1);
|
||||||
|
|
||||||
|
if (this.checked) {
|
||||||
|
filters = filters ? (filters + ',' + filterName) : filterName;
|
||||||
|
}
|
||||||
|
|
||||||
|
query.Filters = filters;
|
||||||
|
query.StartIndex = 0;
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#radioBasicFilters', this).on('change', function () {
|
||||||
|
|
||||||
|
if (this.checked) {
|
||||||
|
$('.basicFilters', page).show();
|
||||||
|
$('.advancedFilters', page).hide();
|
||||||
|
} else {
|
||||||
|
$('.basicFilters', page).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#radioAdvancedFilters', this).on('change', function () {
|
||||||
|
|
||||||
|
if (this.checked) {
|
||||||
|
$('.advancedFilters', page).show();
|
||||||
|
$('.basicFilters', page).hide();
|
||||||
|
} else {
|
||||||
|
$('.advancedFilters', page).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#selectPageSize', page).on('change', function () {
|
||||||
|
query.Limit = parseInt(this.value);
|
||||||
|
query.StartIndex = 0;
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
}).on('pagebeforeshow', "#photosPage", function () {
|
||||||
|
|
||||||
|
var page = this;
|
||||||
|
|
||||||
|
setQueryPerContext(page);
|
||||||
|
|
||||||
|
var limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
var viewKey = getSavedQueryKey();
|
||||||
|
|
||||||
|
LibraryBrowser.loadSavedQueryValues(viewKey, query);
|
||||||
|
QueryFilters.onPageShow(page, query);
|
||||||
|
|
||||||
|
LibraryBrowser.getSavedViewSetting(viewKey).done(function (val) {
|
||||||
|
|
||||||
|
if (val) {
|
||||||
|
$('#selectView', page).val(val).selectmenu('refresh').trigger('change');
|
||||||
|
} else {
|
||||||
|
reloadItems(page);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}).on('pageshow', "#photosPage", function () {
|
||||||
|
|
||||||
|
updateFilterControls(this);
|
||||||
|
});
|
||||||
|
|
||||||
|
})(jQuery, document);
|
Loading…
Add table
Add a link
Reference in a new issue