mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update naming project
This commit is contained in:
parent
4e71751d0f
commit
5623b7c147
14 changed files with 520 additions and 179 deletions
|
@ -40,8 +40,6 @@
|
|||
|
||||
updateFilterControls(page);
|
||||
|
||||
var defaultAction = query.MediaTypes == 'Photo' ? 'photoslideshow' : null;
|
||||
|
||||
// Poster
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
|
@ -49,8 +47,7 @@
|
|||
context: getParameterByName('context') || 'photos',
|
||||
showTitle: false,
|
||||
centerText: true,
|
||||
lazy: true,
|
||||
defaultAction: defaultAction
|
||||
lazy: true
|
||||
});
|
||||
|
||||
var elem = $('#items', page).html(html).lazyChildren();
|
||||
|
@ -137,13 +134,11 @@
|
|||
query.ParentId = getParameterByName('parentId') || LibraryMenu.getTopParentId();
|
||||
}
|
||||
|
||||
function startSlideshow(page, index) {
|
||||
|
||||
index += (query.StartIndex || 0);
|
||||
function startSlideshow(page, itemQuery, startItemId) {
|
||||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
var localQuery = $.extend({}, query);
|
||||
var localQuery = $.extend({}, itemQuery);
|
||||
localQuery.StartIndex = 0;
|
||||
localQuery.Limit = null;
|
||||
localQuery.MediaTypes = "Photo";
|
||||
|
@ -152,11 +147,11 @@
|
|||
|
||||
ApiClient.getItems(userId, localQuery).done(function (result) {
|
||||
|
||||
showSlideshow(page, result.Items, index);
|
||||
showSlideshow(page, result.Items, startItemId);
|
||||
});
|
||||
}
|
||||
|
||||
function showSlideshow(page, items, index) {
|
||||
function showSlideshow(page, items, startItemId) {
|
||||
|
||||
var slideshowItems = items.map(function (item) {
|
||||
|
||||
|
@ -173,10 +168,17 @@
|
|||
};
|
||||
});
|
||||
|
||||
index = Math.max(index || 0, 0);
|
||||
var index = items.map(function (i) {
|
||||
return i.Id;
|
||||
|
||||
}).indexOf(startItemId);
|
||||
|
||||
if (index == -1) {
|
||||
index = 0;
|
||||
}
|
||||
|
||||
Dashboard.loadSwipebox().done(function () {
|
||||
|
||||
Dashboard.loadSwipebox().done(function() {
|
||||
|
||||
$.swipebox(slideshowItems, {
|
||||
initialIndexOnArray: index,
|
||||
hideBarsDelay: 30000
|
||||
|
@ -184,6 +186,17 @@
|
|||
});
|
||||
}
|
||||
|
||||
function onListItemClick(e) {
|
||||
|
||||
var page = $(this).parents('.page');
|
||||
var info = LibraryBrowser.getListItemInfo(this);
|
||||
|
||||
if (info.mediaType == 'Photo') {
|
||||
Photos.startSlideshow(page, query, info.id);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#photosPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
@ -205,6 +218,8 @@
|
|||
reloadItems(page);
|
||||
});
|
||||
|
||||
$(page).on('click', '.mediaItem', onListItemClick);
|
||||
|
||||
$('.chkStandardFilter', this).on('change', function () {
|
||||
|
||||
var filterName = this.getAttribute('data-filter');
|
||||
|
@ -247,10 +262,6 @@
|
|||
reloadItems(page);
|
||||
});
|
||||
|
||||
$('.itemsContainer', page).on('photoslideshow', function (e, index) {
|
||||
startSlideshow(page, index);
|
||||
});
|
||||
|
||||
}).on('pagebeforeshow', "#photosPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
@ -284,4 +295,8 @@
|
|||
updateFilterControls(this);
|
||||
});
|
||||
|
||||
window.Photos = {
|
||||
startSlideshow: startSlideshow
|
||||
};
|
||||
|
||||
})(jQuery, document);
|
Loading…
Add table
Add a link
Reference in a new issue