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

added more card layouts

This commit is contained in:
Luke Pulverenti 2014-11-11 23:51:40 -05:00
parent c6064c9e96
commit 98d59dbc02
15 changed files with 95 additions and 40 deletions

View file

@ -1213,10 +1213,6 @@
var defaultActionAttribute = options.defaultAction ? (' data-action="' + options.defaultAction + '"') : '';
if (options.defaultAction) {
cssClass += ' itemWithAction';
}
html += '<div' + dataAttributes + ' class="' + cssClass + '">';
var style = "";
@ -1250,7 +1246,14 @@
html += '<div class="cardScalable">';
html += '<div class="cardPadder"></div>';
html += '<a class="cardContent" href="' + href + '"' + defaultActionAttribute + '>';
var anchorCssClass = "cardContent";
if (options.defaultAction) {
anchorCssClass += ' itemWithAction';
}
html += '<a class="' + anchorCssClass + '" href="' + href + '"' + defaultActionAttribute + '>';
html += '<div class="' + imageCssClass + '" style="' + style + '"' + dataSrc + '></div>';
html += '<div class="cardOverlayTarget"></div>';

View file

@ -557,6 +557,8 @@
function onShowTimerExpired(elem) {
elem = $('a', elem)[0];
if ($(elem).hasClass('hasContextMenu')) {
return;
}
@ -566,8 +568,14 @@
}
var innerElem = $('.cardOverlayTarget', elem);
var id = elem.getAttribute('data-itemid');
var commands = elem.getAttribute('data-commands').split(',');
var dataElement = elem;
while (!dataElement.getAttribute('data-itemid')) {
dataElement = dataElement.parentNode;
}
var id = dataElement.getAttribute('data-itemid');
var commands = dataElement.getAttribute('data-commands').split(',');
var promise1 = ApiClient.getItem(Dashboard.getCurrentUserId(), id);
var promise2 = Dashboard.getCurrentUser();
@ -767,11 +775,18 @@
PlaylistManager.showPanel(selection);
}
function onItemWithActionClick() {
function onItemWithActionClick(e) {
var elem = this;
var action = elem.getAttribute('data-action');
var elemWithAttributes = elem.getAttribute('data-itemid') ? elem : elem.parentNode;
var elemWithAttributes = elem;
if (action) {
while (!elemWithAttributes.getAttribute('data-itemid')) {
elemWithAttributes = elemWithAttributes.parentNode;
}
}
var index;
var itemsContainer;

View file

@ -25,8 +25,8 @@
$('#chkAllChannels', page).checked(defaultTimer.RecordAnyChannel).checkboxradio('refresh');
$('#chkAnyTime', page).checked(defaultTimer.RecordAnyTime).checkboxradio('refresh');
$('#txtPrePaddingSeconds', page).val(defaultTimer.PrePaddingSeconds / 60);
$('#txtPostPaddingSeconds', page).val(defaultTimer.PostPaddingSeconds / 60);
$('#txtPrePaddingMinutes', page).val(defaultTimer.PrePaddingSeconds / 60);
$('#txtPostPaddingMinutes', page).val(defaultTimer.PostPaddingSeconds / 60);
$('#chkPrePaddingRequired', page).checked(defaultTimer.IsPrePaddingRequired).checkboxradio('refresh');
$('#chkPostPaddingRequired', page).checked(defaultTimer.IsPostPaddingRequired).checkboxradio('refresh');
@ -110,8 +110,8 @@
ApiClient.getNewLiveTvTimerDefaults({ programId: programId }).done(function (item) {
item.PrePaddingSeconds = $('#txtPrePaddingSeconds', form).val() * 60;
item.PostPaddingSeconds = $('#txtPostPaddingSeconds', form).val() * 60;
item.PrePaddingSeconds = $('#txtPrePaddingMinutes', form).val() * 60;
item.PostPaddingSeconds = $('#txtPostPaddingMinutes', form).val() * 60;
item.IsPrePaddingRequired = $('#chkPrePaddingRequired', form).checked();
item.IsPostPaddingRequired = $('#chkPostPaddingRequired', form).checked();

View file

@ -27,8 +27,8 @@
$('.itemName', page).html(item.Name);
$('#txtPrePaddingSeconds', page).val(item.PrePaddingSeconds / 60);
$('#txtPostPaddingSeconds', page).val(item.PostPaddingSeconds / 60);
$('#txtPrePaddingMinutes', page).val(item.PrePaddingSeconds / 60);
$('#txtPostPaddingMinutes', page).val(item.PostPaddingSeconds / 60);
$('#chkPrePaddingRequired', page).checked(item.IsPrePaddingRequired).checkboxradio('refresh');
$('#chkPostPaddingRequired', page).checked(item.IsPostPaddingRequired).checkboxradio('refresh');
@ -107,8 +107,8 @@
ApiClient.getLiveTvSeriesTimer(currentItem.Id).done(function (item) {
item.PrePaddingSeconds = $('#txtPrePaddingSeconds', form).val() * 60;
item.PostPaddingSeconds = $('#txtPostPaddingSeconds', form).val() * 60;
item.PrePaddingSeconds = $('#txtPrePaddingMinutes', form).val() * 60;
item.PostPaddingSeconds = $('#txtPostPaddingMinutes', form).val() * 60;
item.IsPrePaddingRequired = $('#chkPrePaddingRequired', form).checked();
item.IsPostPaddingRequired = $('#chkPostPaddingRequired', form).checked();

View file

@ -57,8 +57,8 @@
LiveTvHelpers.renderMiscProgramInfo($('.miscTvProgramInfo', page), programInfo);
$('#txtPrePaddingSeconds', page).val(item.PrePaddingSeconds / 60);
$('#txtPostPaddingSeconds', page).val(item.PostPaddingSeconds / 60);
$('#txtPrePaddingMinutes', page).val(item.PrePaddingSeconds / 60);
$('#txtPostPaddingMinutes', page).val(item.PostPaddingSeconds / 60);
$('#chkPrePaddingRequired', page).checked(item.IsPrePaddingRequired).checkboxradio('refresh');
$('#chkPostPaddingRequired', page).checked(item.IsPostPaddingRequired).checkboxradio('refresh');
@ -75,8 +75,8 @@
ApiClient.getLiveTvTimer(currentItem.Id).done(function (item) {
item.PrePaddingSeconds = $('#txtPrePaddingSeconds', form).val() * 60;
item.PostPaddingSeconds = $('#txtPostPaddingSeconds', form).val() * 60;
item.PrePaddingSeconds = $('#txtPrePaddingMinutes', form).val() * 60;
item.PostPaddingSeconds = $('#txtPostPaddingMinutes', form).val() * 60;
item.IsPrePaddingRequired = $('#chkPrePaddingRequired', form).checked();
item.IsPostPaddingRequired = $('#chkPostPaddingRequired', form).checked();

View file

@ -79,7 +79,7 @@
html += pagingHtml;
$('#items', page).html(html).trigger('create');
$('#items', page).html(html).trigger('create').createCardMenus();
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;

View file

@ -102,6 +102,18 @@
});
$('.itemsContainer', page).removeClass('timelineItemsContainer');
}
else if (view == "PosterCard") {
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "portrait",
context: 'movies',
showTitle: true,
showYear: true,
lazy: true,
cardLayout: true
});
$('.itemsContainer', page).removeClass('timelineItemsContainer');
}
else if (view == "Timeline") {
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,

View file

@ -87,6 +87,18 @@
});
$('.itemsContainer', page).removeClass('timelineItemsContainer');
}
else if (view == "PosterCard") {
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "portrait",
context: 'tv',
showTitle: true,
showYear: true,
lazy: true,
cardLayout: true
});
$('.itemsContainer', page).removeClass('timelineItemsContainer');
}
else {
// Poster