mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
re-enable chromecast
This commit is contained in:
parent
4d679e90a4
commit
3d1ee1233c
15 changed files with 901 additions and 796 deletions
|
@ -107,6 +107,41 @@
|
|||
return val == '1' || (val != '0' && !$.browser.mobile);
|
||||
}
|
||||
|
||||
function setBackdrops(page, items) {
|
||||
|
||||
var images = items.filter(function (i) {
|
||||
|
||||
return i.BackdropImageTags.length > 0;
|
||||
|
||||
}).map(function (i) {
|
||||
return {
|
||||
id: i.Id,
|
||||
tag: i.BackdropImageTags[0]
|
||||
};
|
||||
});
|
||||
|
||||
if (images.length) {
|
||||
$(page).addClass('backdropPage');
|
||||
|
||||
var index = getRandom(0, images.length - 1);
|
||||
var item = images[index];
|
||||
|
||||
var screenWidth = $(window).width();
|
||||
|
||||
var imgUrl = ApiClient.getScaledImageUrl(item.id, {
|
||||
type: "Backdrop",
|
||||
tag: item.tag,
|
||||
maxWidth: screenWidth,
|
||||
quality: 80
|
||||
});
|
||||
|
||||
getElement().css('backgroundImage', 'url(\'' + imgUrl + '\')');
|
||||
|
||||
} else {
|
||||
$(page).removeClass('backdropPage');
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', ".page", function () {
|
||||
|
||||
var page = this;
|
||||
|
@ -128,4 +163,9 @@
|
|||
|
||||
});
|
||||
|
||||
window.Backdrops = {
|
||||
|
||||
setBackdrops: setBackdrops
|
||||
};
|
||||
|
||||
})(jQuery, document);
|
File diff suppressed because it is too large
Load diff
|
@ -310,7 +310,7 @@
|
|||
|
||||
html += '<div class="editorTile imageEditorTile">';
|
||||
|
||||
html += '<div style="height:144px;vertical-align:top;background-repeat:no-repeat;background-size:contain;background-image:url(\'' + LibraryBrowser.getImageUrl(currentItem, image.ImageType, image.ImageIndex, { height: 144 }) + '\');"></div>';
|
||||
html += '<div style="height:144px;vertical-align:top;background-repeat:no-repeat;background-size:contain;background-image:url(\'' + LibraryBrowser.getImageUrl(currentItem, image.ImageType, image.ImageIndex, { enableImageEnhancers: false, height: 144 }) + '\');"></div>';
|
||||
|
||||
html += '<div>';
|
||||
|
||||
|
|
|
@ -330,7 +330,7 @@ function parseISO8601Date(s, options) {
|
|||
}
|
||||
|
||||
return new Date(ms);
|
||||
};
|
||||
}
|
||||
|
||||
// jqm.page.params.js - version 0.1
|
||||
// Copyright (c) 2011, Kin Blas
|
||||
|
|
|
@ -70,6 +70,8 @@
|
|||
|
||||
currentItem = item;
|
||||
|
||||
Backdrops.setBackdrops(page, [item]);
|
||||
|
||||
renderHeader(page, item, context);
|
||||
|
||||
var name = item.Name;
|
||||
|
@ -97,7 +99,7 @@
|
|||
|
||||
var editImagesHref = user.Configuration.IsAdministrator ? 'edititemimages.html' + editQuery : null;
|
||||
|
||||
$('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item, editImagesHref));
|
||||
$('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item, editImagesHref, true));
|
||||
|
||||
if (user.Configuration.IsAdministrator && item.LocationType !== "Offline") {
|
||||
$('.btnEdit', page).show();
|
||||
|
@ -162,49 +164,49 @@
|
|||
if (item.MovieCount) {
|
||||
|
||||
html += '<input type="radio" name="ibnItems" id="radioMovies" class="context-movies" value="on" data-mini="true">';
|
||||
html += '<label for="radioMovies">Movies (' + item.MovieCount + ')</label>';
|
||||
html += '<label for="radioMovies">Movies</label>';
|
||||
}
|
||||
|
||||
if (item.SeriesCount) {
|
||||
|
||||
html += '<input type="radio" name="ibnItems" id="radioShows" class="context-tv" value="on" data-mini="true">';
|
||||
html += '<label for="radioShows">TV Shows (' + item.SeriesCount + ')</label>';
|
||||
html += '<label for="radioShows">TV Shows</label>';
|
||||
}
|
||||
|
||||
if (item.EpisodeCount) {
|
||||
|
||||
html += '<input type="radio" name="ibnItems" id="radioEpisodes" class="context-tv" value="on" data-mini="true">';
|
||||
html += '<label for="radioEpisodes">Episodes (' + item.EpisodeCount + ')</label>';
|
||||
html += '<label for="radioEpisodes">Episodes</label>';
|
||||
}
|
||||
|
||||
if (item.TrailerCount) {
|
||||
|
||||
html += '<input type="radio" name="ibnItems" id="radioTrailers" class="context-movies" value="on" data-mini="true">';
|
||||
html += '<label for="radioTrailers">Trailers (' + item.TrailerCount + ')</label>';
|
||||
html += '<label for="radioTrailers">Trailers</label>';
|
||||
}
|
||||
|
||||
if (item.GameCount) {
|
||||
|
||||
html += '<input type="radio" name="ibnItems" id="radioGames" class="context-games" value="on" data-mini="true">';
|
||||
html += '<label for="radioGames">Games (' + item.GameCount + ')</label>';
|
||||
html += '<label for="radioGames">Games</label>';
|
||||
}
|
||||
|
||||
if (item.AlbumCount) {
|
||||
|
||||
html += '<input type="radio" name="ibnItems" id="radioAlbums" class="context-music" value="on" data-mini="true">';
|
||||
html += '<label for="radioAlbums">Albums (' + item.AlbumCount + ')</label>';
|
||||
html += '<label for="radioAlbums">Albums</label>';
|
||||
}
|
||||
|
||||
if (item.SongCount) {
|
||||
|
||||
html += '<input type="radio" name="ibnItems" id="radioSongs" class="context-music" value="on" data-mini="true">';
|
||||
html += '<label for="radioSongs">Songs (' + item.SongCount + ')</label>';
|
||||
html += '<label for="radioSongs">Songs</label>';
|
||||
}
|
||||
|
||||
if (item.MusicVideoCount) {
|
||||
|
||||
html += '<input type="radio" name="ibnItems" id="radioMusicVideos" class="context-music" value="on" data-mini="true">';
|
||||
html += '<label for="radioMusicVideos">Music Videos (' + item.MusicVideoCount + ')</label>';
|
||||
html += '<label for="radioMusicVideos">Music Videos</label>';
|
||||
}
|
||||
|
||||
html += '</fieldset>';
|
||||
|
@ -321,7 +323,7 @@
|
|||
|
||||
function renderDetails(page, item, context) {
|
||||
|
||||
LibraryBrowser.renderDetailPageBackdrop(page, item);
|
||||
//LibraryBrowser.renderDetailPageBackdrop(page, item);
|
||||
LibraryBrowser.renderOverview($('.itemOverview', page), item);
|
||||
|
||||
renderUserDataIcons(page, item);
|
||||
|
@ -472,22 +474,17 @@
|
|||
}
|
||||
else if (query.IncludeItemTypes == "MusicAlbum") {
|
||||
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
html = LibraryBrowser.getListViewHtml({
|
||||
items: result.Items,
|
||||
shape: "square",
|
||||
context: 'music',
|
||||
showTitle: true,
|
||||
showParentTitle: true
|
||||
smallIcon: true
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
html = LibraryBrowser.getListViewHtml({
|
||||
items: result.Items,
|
||||
shape: "square",
|
||||
showTitle: true,
|
||||
centerText: true
|
||||
smallIcon: true
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -726,7 +726,9 @@
|
|||
|
||||
$('#childrenContent', page).html(LibraryBrowser.getListViewHtml({
|
||||
items: result.Items,
|
||||
smallIcon: true
|
||||
smallIcon: true,
|
||||
showIndex: true,
|
||||
index: 'disc'
|
||||
|
||||
})).trigger('create').createCardMenus();
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
getDefaultItemsView: function (view, mobileView) {
|
||||
|
||||
return view;
|
||||
return $.browser.mobile ? mobileView : view;
|
||||
|
||||
},
|
||||
|
||||
|
@ -578,9 +578,14 @@
|
|||
|
||||
},
|
||||
|
||||
getListViewIndex: function (item, sortBy) {
|
||||
getListViewIndex: function (item, options) {
|
||||
|
||||
sortBy = (sortBy || '').toLowerCase();
|
||||
if (options.index == 'disc') {
|
||||
|
||||
return item.ParentIndexNumber == null ? '' : 'Disc ' + item.ParentIndexNumber;
|
||||
}
|
||||
|
||||
var sortBy = (options.sortBy || '').toLowerCase();
|
||||
var code, name;
|
||||
|
||||
if (sortBy.indexOf('sortname') == 0) {
|
||||
|
@ -666,7 +671,8 @@
|
|||
var html = '';
|
||||
|
||||
if (options.showIndex !== false) {
|
||||
var itemGroupTitle = LibraryBrowser.getListViewIndex(item, options.sortBy);
|
||||
|
||||
var itemGroupTitle = LibraryBrowser.getListViewIndex(item, options);
|
||||
|
||||
if (itemGroupTitle != groupTitle) {
|
||||
|
||||
|
@ -2026,7 +2032,7 @@
|
|||
});
|
||||
},
|
||||
|
||||
getDetailImageHtml: function (item, href) {
|
||||
getDetailImageHtml: function (item, href, preferThumb) {
|
||||
|
||||
var imageTags = item.ImageTags || {};
|
||||
|
||||
|
@ -2040,7 +2046,15 @@
|
|||
|
||||
var imageHeight = 280;
|
||||
|
||||
if (imageTags.Primary) {
|
||||
if (preferThumb && imageTags.Thumb) {
|
||||
|
||||
url = ApiClient.getScaledImageUrl(item.Id, {
|
||||
type: "Thumb",
|
||||
maxHeight: imageHeight,
|
||||
tag: item.ImageTags.Thumb
|
||||
});
|
||||
}
|
||||
else if (imageTags.Primary) {
|
||||
|
||||
url = ApiClient.getScaledImageUrl(item.Id, {
|
||||
type: "Primary",
|
||||
|
@ -2263,6 +2277,12 @@
|
|||
$(this).attr("target", "_blank");
|
||||
});
|
||||
|
||||
if (overview) {
|
||||
elem.removeClass('empty');
|
||||
} else {
|
||||
elem.addClass('empty');
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
renderStudios: function (elem, item, context) {
|
||||
|
|
|
@ -254,7 +254,8 @@
|
|||
} else {
|
||||
|
||||
$('.btnCast').removeClass('btnDefaultCast').addClass('btnActiveCast');
|
||||
$('.headerSelectedPlayer').html(info.deviceName || info.name);
|
||||
|
||||
$('.headerSelectedPlayer').html((info.deviceName || info.name));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -396,6 +396,10 @@
|
|||
start.setHours(0, 0, 0, 0);
|
||||
end.setHours(0, 0, 0, 0);
|
||||
|
||||
if (start.getTime() >= end.getTime()) {
|
||||
end.setDate(start.getDate() + 1);
|
||||
}
|
||||
|
||||
start = new Date(Math.max(today, start));
|
||||
|
||||
var html = '';
|
||||
|
@ -417,7 +421,10 @@
|
|||
|
||||
var val = elem.val();
|
||||
var date = new Date();
|
||||
date.setTime(parseInt(val));
|
||||
|
||||
if (val) {
|
||||
date.setTime(parseInt(val));
|
||||
}
|
||||
|
||||
changeDate(page, date);
|
||||
}
|
||||
|
|
|
@ -439,7 +439,7 @@
|
|||
|
||||
var mirror = (!target.isLocalPlayer && target.supportedCommands.indexOf('DisplayContent') != -1) ? 'true' : 'false';
|
||||
|
||||
html += '<input type="radio" class="radioSelectPlayerTarget" name="radioSelectPlayerTarget" data-mirror="' + mirror + '" data-commands="' + target.supportedCommands.join(',') + '" data-mediatypes="' + target.playableMediaTypes.join(',') + '" data-playername="' + target.playerName + '" data-targetid="' + target.id + '" data-targetname="' + target.name + '" data-devicename="' + target.deviceName + '" id="' + id + '" value="' + target.id + '"' + checkedHtml + '>';
|
||||
html += '<input type="radio" class="radioSelectPlayerTarget" name="radioSelectPlayerTarget" data-mirror="' + mirror + '" data-commands="' + target.supportedCommands.join(',') + '" data-mediatypes="' + target.playableMediaTypes.join(',') + '" data-playername="' + target.playerName + '" data-targetid="' + target.id + '" data-targetname="' + target.name + '" data-devicename="' + (target.deviceName || '') + '" id="' + id + '" value="' + target.id + '"' + checkedHtml + '>';
|
||||
html += '<label for="' + id + '" style="font-weight:normal;">' + target.name;
|
||||
|
||||
if (target.appName) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
if (this.checked) {
|
||||
SupporterPage.addRecurringFields();
|
||||
} else {
|
||||
SupporterPage.removeRecurringFields();
|
||||
SupporterPage.removeRecurringFields(page);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -17,7 +17,7 @@
|
|||
$("<input type='hidden' name='a3' class='pprecurring' />")
|
||||
.attr('value', $('#donateAmt', '#supporterPage').val())
|
||||
.appendTo("#payPalForm", '#supporterPage');
|
||||
$("<input type='hidden' name='p3' value='6' class='pprecurring' />")
|
||||
$("<input type='hidden' name='p3' value='1' class='pprecurring' />")
|
||||
.appendTo("#payPalForm", '#supporterPage');
|
||||
$("<input type='hidden' name='t3' value='M' class='pprecurring' />")
|
||||
.appendTo("#payPalForm", '#supporterPage');
|
||||
|
@ -33,11 +33,11 @@
|
|||
|
||||
},
|
||||
|
||||
removeRecurringFields: function() {
|
||||
$('.pprecurring', '#supporterPage').remove();
|
||||
removeRecurringFields: function(page) {
|
||||
$('.pprecurring', page).remove();
|
||||
|
||||
//change command back
|
||||
$('#ppCmd', '#supporterPage').val('_xclick');
|
||||
$('#ppCmd', page).val('_xclick');
|
||||
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue