1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

#712 - Support grouping multiple versions of a movie

This commit is contained in:
Luke Pulverenti 2014-03-16 00:23:58 -04:00
parent 7e2ffe8202
commit 6429e4e379
24 changed files with 72 additions and 51 deletions

View file

@ -912,6 +912,22 @@ a.itemTag:hover {
background-color: transparent !important; background-color: transparent !important;
} }
.alternateVersionIndicator {
display: block;
position: absolute;
top: 5px;
left: 5px;
text-align: center;
vertical-align: middle;
width: 22px;
height: 19px;
padding-top: 3px;
border-radius: 50%;
color: #fff;
background: rgb(51, 136, 204);
background: rgba(51, 136, 204, .9);
}
.unidentifiedIndicator { .unidentifiedIndicator {
display: block; display: block;
position: absolute; position: absolute;

View file

@ -59,7 +59,7 @@
</button> </button>
</div> </div>
<div class="collectionItemSearchResults" style="min-height:100px;"> <div class="collectionItemSearchResults">
</div> </div>
<button id="btnAddItems" type="button" data-icon="plus" data-mini="true"> <button id="btnAddItems" type="button" data-icon="plus" data-mini="true">

View file

@ -44,7 +44,7 @@
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
$('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('#items', page).html(html).trigger('create').createPosterItemMenus();
$('.btnNextPage', page).on('click', function () { $('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit; query.StartIndex += query.Limit;

View file

@ -42,7 +42,7 @@
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
$('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('#items', page).html(html).trigger('create').createPosterItemMenus();
$('.btnNextPage', page).on('click', function () { $('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit; query.StartIndex += query.Limit;

View file

@ -487,7 +487,7 @@
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
$('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('#items', page).html(html).trigger('create').createPosterItemMenus();
$('.btnNextPage', page).on('click', function () { $('.btnNextPage', page).on('click', function () {

View file

@ -227,7 +227,7 @@
renderAdditionalParts(page, item, user); renderAdditionalParts(page, item, user);
} }
if (!item.HasAlternateVersions) { if (!item.AlternateVersionCount) {
$('#alternateVersionsCollapsible', page).addClass('hide'); $('#alternateVersionsCollapsible', page).addClass('hide');
} else { } else {
$('#alternateVersionsCollapsible', page).removeClass('hide'); $('#alternateVersionsCollapsible', page).removeClass('hide');
@ -483,7 +483,7 @@
borderless: item.Type == "Game" borderless: item.Type == "Game"
}); });
$('#similarContent', page).html(html).createPosterItemHoverMenu(); $('#similarContent', page).html(html).createPosterItemMenus();
}); });
} }
@ -615,7 +615,7 @@
}); });
} }
$('#childrenContent', page).html(html).createPosterItemHoverMenu(); $('#childrenContent', page).html(html).createPosterItemMenus();
if (item.Type == "BoxSet") { if (item.Type == "BoxSet") {
@ -688,7 +688,7 @@
renderCollectionItemType(page, { name: 'Titles' }, items, user); renderCollectionItemType(page, { name: 'Titles' }, items, user);
} }
$('.collectionItems', page).trigger('create').createPosterItemHoverMenu(); $('.collectionItems', page).trigger('create').createPosterItemMenus();
} }
function renderCollectionItemType(page, type, items, user) { function renderCollectionItemType(page, type, items, user) {
@ -905,8 +905,6 @@
$('#alternateVersionsCollapsible', page).show(); $('#alternateVersionsCollapsible', page).show();
$('#additionalPartsCollapsible', page).show();
var html = LibraryBrowser.getPosterViewHtml({ var html = LibraryBrowser.getPosterViewHtml({
items: result.Items, items: result.Items,
shape: "portrait", shape: "portrait",
@ -917,7 +915,7 @@
formatIndicators: true formatIndicators: true
}); });
$('#alternateVersionsContent', page).html(html).trigger('create').createPosterItemHoverMenu(); $('#alternateVersionsContent', page).html(html).trigger('create').createPosterItemMenus();
} else { } else {
$('#alternateVersionsCollapsible', page).hide(); $('#alternateVersionsCollapsible', page).hide();
} }

View file

@ -662,7 +662,7 @@
cssClass += ' ' + options.shape + 'PosterItem'; cssClass += ' ' + options.shape + 'PosterItem';
html += '<a data-itemid="' + item.Id + '" class="' + cssClass + '" data-locationtype="' + item.LocationType + '" data-mediatype="' + (item.MediaType || '') + '" href="' + LibraryBrowser.getHref(item, options.context) + '">'; html += '<a data-itemid="' + item.Id + '" class="' + cssClass + '" data-primaryversionid="' + (item.PrimaryVersionId || '') + '" data-locationtype="' + item.LocationType + '" data-mediatype="' + (item.MediaType || '') + '" href="' + LibraryBrowser.getHref(item, options.context) + '">';
// Ribbon // Ribbon
if (item.MediaType == "Video" && options.formatIndicators) { if (item.MediaType == "Video" && options.formatIndicators) {
@ -717,6 +717,9 @@
html += LibraryBrowser.getPlayedIndicatorHtml(item); html += LibraryBrowser.getPlayedIndicatorHtml(item);
} }
if (item.AlternateVersionCount) {
html += '<div class="alternateVersionIndicator">' + (item.AlternateVersionCount + 1) + '</div>';
}
if (item.IsUnidentified) { if (item.IsUnidentified) {
html += '<div class="unidentifiedIndicator"><div class="ui-icon-alert ui-btn-icon-notext"></div></div>'; html += '<div class="unidentifiedIndicator"><div class="ui-icon-alert ui-btn-icon-notext"></div></div>';
} }
@ -2118,17 +2121,19 @@
items.push({ type: 'link', text: 'Images', url: 'edititemimages.html?id=' + id }); items.push({ type: 'link', text: 'Images', url: 'edititemimages.html?id=' + id });
if (mediatype == 'Video' && elem.getAttribute('data-locationtype') == 'FileSystem') { //if (mediatype == 'Video' && elem.getAttribute('data-locationtype') == 'FileSystem' && !elem.getAttribute('data-primaryversionid')) {
items.push({ type: 'divider' }); // items.push({ type: 'divider' });
items.push({ type: 'header', text: 'Manage' }); // items.push({ type: 'header', text: 'Manage' });
items.push({ type: 'command', text: 'Alternate Editions', name: 'AlternateEditions' }); // items.push({ type: 'command', text: 'Alternate Versions', name: 'AlternateVersions' });
} //}
return items; return items;
} }
$.fn.createPosterItemHoverMenu = function () { $.fn.createPosterItemMenus = function (options) {
options = options || {};
function onShowTimerExpired(elem) { function onShowTimerExpired(elem) {
@ -2186,18 +2191,20 @@
var sequence = this; var sequence = this;
//Dashboard.getCurrentUser().done(function (user) { if (options.contextMenu !== false) {
Dashboard.getCurrentUser().done(function (user) {
// if (user.Configuration.IsAdministrator) { if (user.Configuration.IsAdministrator) {
// sequence.createContextMenu({ sequence.createContextMenu({
// getOptions: getMenuOptions, getOptions: getMenuOptions,
// command: onMenuCommand, command: onMenuCommand,
// selector: '.posterItem' selector: '.posterItem'
// }); });
// } }
//}); });
}
return this.on('mouseenter', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverIn) return this.on('mouseenter', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverIn)
.on('mouseleave', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverOut); .on('mouseleave', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverOut);

View file

@ -35,7 +35,7 @@
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
$('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('#items', page).html(html).trigger('create').createPosterItemMenus();
$('.btnNextPage', page).on('click', function () { $('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit; query.StartIndex += query.Limit;

View file

@ -58,7 +58,7 @@
overlayText: true, overlayText: true,
coverImage: true coverImage: true
})).createPosterItemHoverMenu(); })).createPosterItemMenus();
} }
function reload(page) { function reload(page) {

View file

@ -127,7 +127,7 @@
overlayText: true, overlayText: true,
coverImage: true coverImage: true
})).createPosterItemHoverMenu(); })).createPosterItemMenus();
} }
function renderSchedule(page, result) { function renderSchedule(page, result) {

View file

@ -23,7 +23,7 @@
}); });
$('.activeProgramItems', page).html(html).createPosterItemHoverMenu(); $('.activeProgramItems', page).html(html).createPosterItemMenus();
}); });
apiClient.getLiveTvRecommendedPrograms({ apiClient.getLiveTvRecommendedPrograms({
@ -46,7 +46,7 @@
}); });
$('.upcomingProgramItems', page).html(html).createPosterItemHoverMenu(); $('.upcomingProgramItems', page).html(html).createPosterItemMenus();
}); });
} }

View file

@ -47,7 +47,7 @@
html += '<p>Collections allow you to enjoy personalized groupings of Movies, Series, Albums, Books and Games. Click the New button to start creating Collections.</p>'; html += '<p>Collections allow you to enjoy personalized groupings of Movies, Series, Albums, Books and Games. Click the New button to start creating Collections.</p>';
} }
$('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('#items', page).html(html).trigger('create').createPosterItemMenus();
$('.btnNextPage', page).on('click', function () { $('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit; query.StartIndex += query.Limit;

View file

@ -67,7 +67,7 @@
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
$('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('#items', page).html(html).trigger('create').createPosterItemMenus();
$('.btnNextPage', page).on('click', function () { $('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit; query.StartIndex += query.Limit;

View file

@ -23,7 +23,7 @@
items: result.Items, items: result.Items,
useAverageAspectRatio: true useAverageAspectRatio: true
})).createPosterItemHoverMenu(); })).createPosterItemMenus();
}); });
@ -50,7 +50,7 @@
items: result.Items, items: result.Items,
useAverageAspectRatio: true useAverageAspectRatio: true
})).createPosterItemHoverMenu(); })).createPosterItemMenus();
}); });

View file

@ -68,7 +68,7 @@
overlayText: true, overlayText: true,
showTitle: true showTitle: true
})).createPosterItemHoverMenu(); })).createPosterItemMenus();
}); });
@ -90,7 +90,7 @@
var html = recommendations.map(getRecommendationHtml).join(''); var html = recommendations.map(getRecommendationHtml).join('');
$('.recommendations', page).html(html).createPosterItemHoverMenu(); $('.recommendations', page).html(html).createPosterItemMenus();
}); });
}); });

View file

@ -40,7 +40,7 @@
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
$('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('#items', page).html(html).trigger('create').createPosterItemMenus();
$('.btnNextPage', page).on('click', function () { $('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit; query.StartIndex += query.Limit;

View file

@ -37,7 +37,7 @@
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
$('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('#items', page).html(html).trigger('create').createPosterItemMenus();
$('.btnNextPage', page).on('click', function () { $('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit; query.StartIndex += query.Limit;

View file

@ -57,7 +57,7 @@
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
$('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('#items', page).html(html).trigger('create').createPosterItemMenus();
$('.btnNextPage', page).on('click', function () { $('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit; query.StartIndex += query.Limit;

View file

@ -36,7 +36,7 @@
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
$('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('#items', page).html(html).trigger('create').createPosterItemMenus();
$('.btnNextPage', page).on('click', function () { $('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit; query.StartIndex += query.Limit;

View file

@ -25,7 +25,7 @@
shape: "square", shape: "square",
showTitle: true, showTitle: true,
showParentTitle: true showParentTitle: true
})).createPosterItemHoverMenu(); })).createPosterItemMenus();
}); });
@ -48,7 +48,7 @@
shape: "square", shape: "square",
showTitle: true, showTitle: true,
showParentTitle: true showParentTitle: true
})).createPosterItemHoverMenu(); })).createPosterItemMenus();
}); });
@ -78,7 +78,7 @@
shape: "square", shape: "square",
showTitle: true, showTitle: true,
showParentTitle: true showParentTitle: true
})).createPosterItemHoverMenu(); })).createPosterItemMenus();
}); });
@ -108,7 +108,7 @@
shape: "square", shape: "square",
showTitle: true, showTitle: true,
showParentTitle: true showParentTitle: true
})).createPosterItemHoverMenu(); })).createPosterItemMenus();
}); });

View file

@ -28,7 +28,7 @@
showParentTitle: true, showParentTitle: true,
overlayText: true overlayText: true
})).createPosterItemHoverMenu(); })).createPosterItemMenus();
}); });

View file

@ -32,7 +32,7 @@
showParentTitle: true, showParentTitle: true,
overlayText: true overlayText: true
})).createPosterItemHoverMenu(); })).createPosterItemMenus();
}); });
} }
@ -65,7 +65,7 @@
showParentTitle: true, showParentTitle: true,
overlayText: true overlayText: true
})).createPosterItemHoverMenu(); })).createPosterItemMenus();
} else { } else {

View file

@ -70,7 +70,7 @@
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
$('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('#items', page).html(html).trigger('create').createPosterItemMenus();
$('.btnNextPage', page).on('click', function () { $('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit; query.StartIndex += query.Limit;

View file

@ -29,7 +29,7 @@
showPremiereDateIndex: true, showPremiereDateIndex: true,
preferThumb: true preferThumb: true
})).createPosterItemHoverMenu(); })).createPosterItemMenus();
}); });
}); });