mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge branch 'dev' of https://github.com/MediaBrowser/MediaBrowser into dev
This commit is contained in:
commit
ea1fbeece9
115 changed files with 1205 additions and 575 deletions
|
@ -110,7 +110,7 @@
|
|||
function setDefault(page) {
|
||||
|
||||
getElement().style.backgroundImage = "url(css/images/splash.jpg)";
|
||||
|
||||
page = $(page)[0];
|
||||
page.classList.add('backdropPage');
|
||||
page.classList.add('staticBackdropPage');
|
||||
}
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
}
|
||||
|
||||
function renderRemoteImages(page, item, imagesResult, imageType, startIndex, limit) {
|
||||
|
||||
$('.availableImagesPaging', page).html(getPagingHtml(startIndex, limit, imagesResult.TotalRecordCount)).trigger('create');
|
||||
|
||||
var html = '';
|
||||
|
|
|
@ -92,7 +92,8 @@
|
|||
}
|
||||
else if (view == "Poster") {
|
||||
|
||||
posterOptions.showTitle = context != 'photos';
|
||||
posterOptions.showTitle = context == 'photos' ? 'auto' : true;
|
||||
posterOptions.overlayText = context == 'photos';
|
||||
|
||||
html = LibraryBrowser.getPosterViewHtml(posterOptions);
|
||||
}
|
||||
|
@ -180,7 +181,9 @@
|
|||
var info = LibraryBrowser.getListItemInfo(this);
|
||||
|
||||
if (info.mediaType == 'Photo') {
|
||||
Photos.startSlideshow(page, query, info.id);
|
||||
require(['scripts/photos'], function () {
|
||||
Photos.startSlideshow(page, query, info.id);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -242,9 +242,8 @@
|
|||
console.log('iron-select');
|
||||
// When transition animations are used, add a content loading delay to allow the animations to finish
|
||||
// Otherwise with both operations happening at the same time, it can cause the animation to not run at full speed.
|
||||
var enablePaperTabs = LibraryBrowser.enableFullPaperTabs();
|
||||
var delay = enablePaperTabs ? 500 : 0;
|
||||
var pgs = this;
|
||||
var delay = pgs.entryAnimation ? 500 : 0;
|
||||
setTimeout(function () {
|
||||
|
||||
$(pgs).trigger('tabchange');
|
||||
|
@ -274,7 +273,68 @@
|
|||
}
|
||||
|
||||
} else {
|
||||
Events.trigger(page.querySelector('neon-animated-pages'), 'tabchange');
|
||||
var pages = page.querySelector('neon-animated-pages');
|
||||
if (!NavHelper.isBack()) {
|
||||
if (pages.selected) {
|
||||
|
||||
var entryAnimation = pages.entryAnimation;
|
||||
var exitAnimation = pages.exitAnimation;
|
||||
pages.entryAnimation = null;
|
||||
pages.exitAnimation = null;
|
||||
|
||||
tabs.selected = 0;
|
||||
|
||||
pages.entryAnimation = entryAnimation;
|
||||
pages.exitAnimation = exitAnimation;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
Events.trigger(pages, 'tabchange');
|
||||
}
|
||||
},
|
||||
|
||||
showTab: function (url, index) {
|
||||
|
||||
if (!LibraryBrowser.enableFullPaperTabs()) {
|
||||
|
||||
if (index) {
|
||||
url = replaceQueryString(url, 'tab', index);
|
||||
}
|
||||
Dashboard.navigate(url);
|
||||
return;
|
||||
}
|
||||
|
||||
var afterNavigate = function () {
|
||||
if (getWindowUrl().toLowerCase().indexOf(url.toLowerCase()) != -1) {
|
||||
|
||||
var pages = this.querySelector('neon-animated-pages');
|
||||
|
||||
if (pages) {
|
||||
|
||||
var entryAnimation = pages.entryAnimation;
|
||||
var exitAnimation = pages.exitAnimation;
|
||||
pages.entryAnimation = null;
|
||||
pages.exitAnimation = null;
|
||||
|
||||
var tabs = this.querySelector('paper-tabs');
|
||||
var noSlide = tabs.noSlide;
|
||||
tabs.noSlide = true;
|
||||
tabs.selected = index;
|
||||
|
||||
pages.entryAnimation = entryAnimation;
|
||||
pages.exitAnimation = exitAnimation;
|
||||
tabs.noSlide = noSlide;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (getWindowUrl().toLowerCase().indexOf(url.toLowerCase()) != -1) {
|
||||
|
||||
afterNavigate.call($($.mobile.activePage)[0]);
|
||||
} else {
|
||||
$(document).one('pageshowready', '.page', afterNavigate);
|
||||
Dashboard.navigate(url);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -718,16 +778,16 @@
|
|||
|
||||
var href = LibraryBrowser.getHrefInternal(item, context);
|
||||
|
||||
if (context != 'livetv') {
|
||||
if (topParentId == null && context != 'playlists') {
|
||||
topParentId = LibraryMenu.getTopParentId();
|
||||
}
|
||||
//if (context != 'livetv') {
|
||||
// if (topParentId == null && context != 'playlists') {
|
||||
// topParentId = LibraryMenu.getTopParentId();
|
||||
// }
|
||||
|
||||
if (topParentId) {
|
||||
href += href.indexOf('?') == -1 ? "?topParentId=" : "&topParentId=";
|
||||
href += topParentId;
|
||||
}
|
||||
}
|
||||
// if (topParentId) {
|
||||
// href += href.indexOf('?') == -1 ? "?topParentId=" : "&topParentId=";
|
||||
// href += topParentId;
|
||||
// }
|
||||
//}
|
||||
|
||||
return href;
|
||||
},
|
||||
|
@ -983,11 +1043,6 @@
|
|||
|
||||
var cssClass = options.smallIcon ? 'ui-li-has-icon listItem' : 'ui-li-has-thumb listItem';
|
||||
|
||||
if (item.UserData) {
|
||||
cssClass += ' ' + LibraryBrowser.getUserDataCssClass(item.UserData.Key);
|
||||
}
|
||||
|
||||
|
||||
var href = LibraryBrowser.getHref(item, options.context);
|
||||
html += '<li class="' + cssClass + '"' + dataAttributes + ' data-itemid="' + item.Id + '" data-playlistitemid="' + (item.PlaylistItemId || '') + '" data-href="' + href + '" data-icon="false">';
|
||||
|
||||
|
@ -1219,7 +1274,7 @@
|
|||
itemCommands.push('trailer');
|
||||
}
|
||||
|
||||
if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist" || item.Type == "MusicGenre") {
|
||||
if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist" || item.Type == "MusicGenre" || item.CollectionType == "music") {
|
||||
itemCommands.push('instantmix');
|
||||
}
|
||||
|
||||
|
@ -1492,6 +1547,8 @@
|
|||
cssClass += " fullWidthCardOnMobile";
|
||||
}
|
||||
|
||||
var showTitle = options.showTitle == 'auto' ? true : options.showTitle;
|
||||
|
||||
if (options.autoThumb && item.ImageTags && item.ImageTags.Primary && item.PrimaryImageAspectRatio && item.PrimaryImageAspectRatio >= 1.5) {
|
||||
|
||||
width = posterWidth;
|
||||
|
@ -1653,52 +1710,49 @@
|
|||
|
||||
} else if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist") {
|
||||
|
||||
if (item.Name && options.showTitle) {
|
||||
if (item.Name && showTitle) {
|
||||
icon = 'library-music';
|
||||
}
|
||||
cssClass += " defaultBackground";
|
||||
|
||||
} else if (item.Type == "Recording" || item.Type == "Program" || item.Type == "TvChannel") {
|
||||
|
||||
if (item.Name && options.showTitle) {
|
||||
if (item.Name && showTitle) {
|
||||
icon = 'folder-open';
|
||||
}
|
||||
|
||||
cssClass += " defaultBackground";
|
||||
} else if (item.MediaType == "Video" || item.Type == "Season" || item.Type == "Series") {
|
||||
|
||||
if (item.Name && options.showTitle) {
|
||||
if (item.Name && showTitle) {
|
||||
icon = 'videocam';
|
||||
}
|
||||
cssClass += " defaultBackground";
|
||||
} else if (item.Type == "Person") {
|
||||
|
||||
if (item.Name && options.showTitle) {
|
||||
if (item.Name && showTitle) {
|
||||
icon = 'person';
|
||||
}
|
||||
cssClass += " defaultBackground";
|
||||
} else {
|
||||
if (item.Name && options.showTitle) {
|
||||
if (item.Name && showTitle) {
|
||||
icon = 'folder-open';
|
||||
}
|
||||
cssClass += " defaultBackground";
|
||||
}
|
||||
|
||||
icon = item.icon || icon;
|
||||
cssClass += ' ' + options.shape + 'Card';
|
||||
|
||||
var mediaSourceCount = item.MediaSourceCount || 1;
|
||||
|
||||
var href = options.linkItem === false ? '#' : LibraryBrowser.getHref(item, options.context);
|
||||
|
||||
if (item.UserData) {
|
||||
cssClass += ' ' + LibraryBrowser.getUserDataCssClass(item.UserData.Key);
|
||||
}
|
||||
|
||||
if (options.showChildCountIndicator && item.ChildCount && options.showLatestItemsPopup !== false) {
|
||||
cssClass += ' groupedCard';
|
||||
}
|
||||
|
||||
if (options.showTitle && !options.overlayText) {
|
||||
if (showTitle && !options.overlayText) {
|
||||
cssClass += ' bottomPaddedCard';
|
||||
}
|
||||
|
||||
|
@ -1759,7 +1813,8 @@
|
|||
}
|
||||
|
||||
var transition = options.transition === false || !AppInfo.enableSectionTransitions ? '' : ' data-transition="slide"';
|
||||
html += '<a' + transition + ' class="' + anchorCssClass + '" href="' + href + '"' + defaultActionAttribute + '>';
|
||||
var onclick = item.onclick ? ' onclick="' + item.onclick + '"' : '';
|
||||
html += '<a' + onclick + transition + ' class="' + anchorCssClass + '" href="' + href + '"' + defaultActionAttribute + '>';
|
||||
html += '<div class="' + imageCssClass + '" style="' + style + '"' + dataSrc + '>';
|
||||
if (icon) {
|
||||
html += '<iron-icon icon="' + icon + '"></iron-icon>';
|
||||
|
@ -1784,18 +1839,18 @@
|
|||
html += '<div class="mediaSourceIndicator">' + mediaSourceCount + '</div>';
|
||||
}
|
||||
if (item.IsUnidentified) {
|
||||
html += '<div class="unidentifiedIndicator"><i class="fa fa-exclamation"></i></div>';
|
||||
html += '<div class="unidentifiedIndicator"><iron-icon icon="error"></iron-icon></div>';
|
||||
}
|
||||
|
||||
var progressHtml = options.showProgress === false || item.IsFolder ? '' : LibraryBrowser.getItemProgressBarHtml((item.Type == 'Recording' ? item : item.UserData));
|
||||
|
||||
var footerOverlayed = false;
|
||||
|
||||
if (options.overlayText || (forceName && !options.showTitle)) {
|
||||
if (options.overlayText || (forceName && !showTitle)) {
|
||||
|
||||
var footerCssClass = progressHtml ? 'cardFooter fullCardFooter' : 'cardFooter';
|
||||
|
||||
html += LibraryBrowser.getCardFooterText(item, options, imgUrl, forceName, footerCssClass, progressHtml);
|
||||
html += LibraryBrowser.getCardFooterText(item, options, showTitle, imgUrl, forceName, footerCssClass, progressHtml);
|
||||
footerOverlayed = true;
|
||||
}
|
||||
else if (progressHtml) {
|
||||
|
@ -1823,7 +1878,7 @@
|
|||
html += '</div>';
|
||||
|
||||
if (!options.overlayText && !footerOverlayed) {
|
||||
html += LibraryBrowser.getCardFooterText(item, options, imgUrl, forceName, 'cardFooter outerCardFooter', progressHtml);
|
||||
html += LibraryBrowser.getCardFooterText(item, options, showTitle, imgUrl, forceName, 'cardFooter outerCardFooter', progressHtml);
|
||||
}
|
||||
|
||||
// cardBox
|
||||
|
@ -1835,7 +1890,7 @@
|
|||
return html;
|
||||
},
|
||||
|
||||
getCardFooterText: function (item, options, imgUrl, forceName, footerClass, progressHtml) {
|
||||
getCardFooterText: function (item, options, showTitle, imgUrl, forceName, footerClass, progressHtml) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
@ -1847,9 +1902,9 @@
|
|||
html += "</div>";
|
||||
}
|
||||
|
||||
var name = LibraryBrowser.getPosterViewDisplayName(item, options.displayAsSpecial);
|
||||
var name = options.showTitle == 'auto' && !item.IsFolder && item.MediaType == 'Photo' ? '' : LibraryBrowser.getPosterViewDisplayName(item, options.displayAsSpecial);
|
||||
|
||||
if (!imgUrl && !options.showTitle) {
|
||||
if (!imgUrl && !showTitle) {
|
||||
html += "<div class='cardDefaultText'>";
|
||||
html += htmlEncode(name);
|
||||
html += "</div>";
|
||||
|
@ -1864,7 +1919,7 @@
|
|||
lines.push(item.EpisodeTitle ? item.Name : (item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || ""));
|
||||
}
|
||||
|
||||
if (options.showTitle || forceName) {
|
||||
if (showTitle || forceName) {
|
||||
|
||||
lines.push(htmlEncode(name));
|
||||
}
|
||||
|
|
|
@ -588,9 +588,9 @@
|
|||
var html = '<div data-role="popup" class="detailsMenu" style="border:0;padding:0;" data-ids="' + ids.join(',') + '" data-context="' + (context || '') + '">';
|
||||
|
||||
html += '<div style="padding:1em 1em;background:rgba(20,20,20,1);margin:0;text-align:center;" class="detailsMenuHeader">';
|
||||
html += '<button type="button" class="imageButton detailsMenuLeftButton" data-role="none"><i class="fa fa-arrow-left"></i></button>';
|
||||
html += '<paper-icon-button icon="keyboard-arrow-left" class="detailsMenuLeftButton"></paper-icon-button>';
|
||||
html += '<h3 style="font-weight:400;margin:.5em 0;"></h3>';
|
||||
html += '<button type="button" class="imageButton detailsMenuRightButton" data-role="none"><i class="fa fa-arrow-right"></i></button>';
|
||||
html += '<paper-icon-button icon="keyboard-arrow-right" class="detailsMenuRightButton"></paper-icon-button>';
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="detailsMenuContent" style="background-position:center center;background-repeat:no-repeat;background-size:cover;">';
|
||||
|
@ -1163,14 +1163,14 @@
|
|||
|
||||
function playAllFromHere(index, itemsContainer, method) {
|
||||
|
||||
var ids = $('.mediaItem', itemsContainer).get().map(function(i) {
|
||||
var ids = $('.mediaItem', itemsContainer).get().map(function (i) {
|
||||
return i.getAttribute('data-itemid') || i.parentNode.getAttribute('data-itemid');
|
||||
});
|
||||
|
||||
ids = ids.slice(index);
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), {
|
||||
|
||||
|
||||
Ids: ids.join(','),
|
||||
Fields: 'MediaSources,Chapters',
|
||||
Limit: 100
|
||||
|
@ -1281,13 +1281,7 @@
|
|||
|
||||
function onUserDataChanged(userData) {
|
||||
|
||||
var cssClass = LibraryBrowser.getUserDataCssClass(userData.Key);
|
||||
|
||||
if (!cssClass) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('.' + cssClass).each(function () {
|
||||
$(document.querySelectorAll("*[data-itemid='" + userData.ItemId + "']")).each(function () {
|
||||
|
||||
var mediaType = this.getAttribute('data-mediatype');
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
html += '<div class="viewMenuSearch hide">';
|
||||
html += '<form class="viewMenuSearchForm">';
|
||||
html += '<input type="text" data-role="none" data-type="search" class="headerSearchInput" autocomplete="off" spellcheck="off" />';
|
||||
html += '<div class="searchInputIcon fa fa-search"></div>';
|
||||
html += '<iron-icon class="searchInputIcon" icon="search"></iron-icon>';
|
||||
html += '<paper-icon-button icon="close" class="btnCloseSearch"></paper-icon-button>';
|
||||
html += '</form>';
|
||||
html += '</div>';
|
||||
|
@ -348,7 +348,7 @@
|
|||
html += '<a class="sidebarLink lnkMediaFolder lnkMySync" data-itemid="mysync" onclick="return LibraryMenu.onLinkClicked(event, this);" href="mysync.html"><iron-icon icon="refresh" class="sidebarLinkIcon"></iron-icon><span class="sidebarLinkText">' + Globalize.translate('ButtonSync') + '</span></a>';
|
||||
|
||||
if (Dashboard.isConnectMode()) {
|
||||
html += '<a class="sidebarLink lnkMediaFolder" data-itemid="selectserver" onclick="return LibraryMenu.onLinkClicked(event, this);" href="selectserver.html"><span class="fa fa-globe sidebarLinkIcon"></span><span class="sidebarLinkText">' + Globalize.translate('ButtonSelectServer') + '</span></a>';
|
||||
html += '<a class="sidebarLink lnkMediaFolder" data-itemid="selectserver" onclick="return LibraryMenu.onLinkClicked(event, this);" href="selectserver.html"><iron-icon icon="wifi" class="sidebarLinkIcon"></iron-icon><span class="sidebarLinkText">' + Globalize.translate('ButtonSelectServer') + '</span></a>';
|
||||
}
|
||||
|
||||
if (showUserAtTop()) {
|
||||
|
@ -369,6 +369,52 @@
|
|||
LibraryMenu.setTitle(text);
|
||||
}
|
||||
|
||||
function getUserViews(apiClient, userId) {
|
||||
|
||||
var deferred = $.Deferred();
|
||||
|
||||
apiClient.getUserViews({}, userId).done(function (result) {
|
||||
|
||||
var items = result.Items;
|
||||
|
||||
var list = [];
|
||||
|
||||
for (var i = 0, length = items.length; i < length; i++) {
|
||||
|
||||
var view = items[i];
|
||||
|
||||
list.push(view);
|
||||
|
||||
if (view.CollectionType == 'livetv') {
|
||||
|
||||
view.ImageTags = {};
|
||||
view.icon = 'live-tv';
|
||||
view.onclick = "LibraryBrowser.showTab('livetv.html', 0);";
|
||||
|
||||
var guideView = $.extend({}, view);
|
||||
guideView.Name = Globalize.translate('ButtonGuide');
|
||||
guideView.ImageTags = {};
|
||||
guideView.icon = 'dvr';
|
||||
guideView.url = 'livetv.html?tab=1';
|
||||
guideView.onclick = "LibraryBrowser.showTab('livetv.html', 1);";
|
||||
list.push(guideView);
|
||||
|
||||
var recordedTvView = $.extend({}, view);
|
||||
recordedTvView.Name = Globalize.translate('ButtonRecordedTv');
|
||||
recordedTvView.ImageTags = {};
|
||||
recordedTvView.icon = 'video-library';
|
||||
recordedTvView.url = 'livetv.html?tab=3';
|
||||
recordedTvView.onclick = "LibraryBrowser.showTab('livetv.html', 3);";
|
||||
list.push(recordedTvView);
|
||||
}
|
||||
}
|
||||
|
||||
deferred.resolveWith(null, [list]);
|
||||
});
|
||||
|
||||
return deferred.promise();
|
||||
}
|
||||
|
||||
function updateLibraryMenu(user) {
|
||||
|
||||
if (!user) {
|
||||
|
@ -383,9 +429,9 @@
|
|||
|
||||
var apiClient = window.ApiClient;
|
||||
|
||||
apiClient.getUserViews({}, userId).done(function (result) {
|
||||
getUserViews(apiClient, userId).done(function (result) {
|
||||
|
||||
var items = result.Items;
|
||||
var items = result;
|
||||
|
||||
var html = '';
|
||||
html += '<div class="sidebarHeader">';
|
||||
|
@ -445,7 +491,10 @@
|
|||
color = "#293AAE";
|
||||
}
|
||||
|
||||
return '<a data-itemid="' + itemId + '" class="lnkMediaFolder sidebarLink" onclick="return LibraryMenu.onLinkClicked(event, this);" href="' + getItemHref(i, i.CollectionType) + '"><iron-icon icon="' + icon + '" class="sidebarLinkIcon" style="color:' + color + '"></iron-icon><span class="sectionName">' + i.Name + '</span></a>';
|
||||
icon = i.icon || icon;
|
||||
|
||||
var onclick = i.onclick ? ' function(){' + i.onclick + '}' : 'null';
|
||||
return '<a data-itemid="' + itemId + '" class="lnkMediaFolder sidebarLink" onclick="return LibraryMenu.onLinkClicked(event, this, ' + onclick + ');" href="' + getItemHref(i, i.CollectionType) + '"><iron-icon icon="' + icon + '" class="sidebarLinkIcon" style="color:' + color + '"></iron-icon><span class="sectionName">' + i.Name + '</span></a>';
|
||||
|
||||
}).join('');
|
||||
|
||||
|
@ -497,7 +546,7 @@
|
|||
window.LibraryMenu = {
|
||||
getTopParentId: getTopParentId,
|
||||
|
||||
onLinkClicked: function (event, link) {
|
||||
onLinkClicked: function (event, link, action) {
|
||||
|
||||
if (event.which != 1) {
|
||||
return true;
|
||||
|
@ -510,7 +559,11 @@
|
|||
closeMainDrawer();
|
||||
|
||||
setTimeout(function () {
|
||||
Dashboard.navigate(link.href);
|
||||
if (action) {
|
||||
action();
|
||||
} else {
|
||||
Dashboard.navigate(link.href);
|
||||
}
|
||||
}, 400);
|
||||
}, 50);
|
||||
}
|
||||
|
@ -758,14 +811,22 @@
|
|||
|
||||
var title = page.getAttribute('data-title') || page.getAttribute('data-contextname');
|
||||
|
||||
if (title) {
|
||||
LibraryMenu.setTitle(title);
|
||||
if (!title) {
|
||||
var titleKey = getParameterByName('titlekey');
|
||||
|
||||
if (titleKey) {
|
||||
title = Globalize.translate(titleKey);
|
||||
}
|
||||
}
|
||||
|
||||
var titleKey = getParameterByName('titlekey');
|
||||
if (!title) {
|
||||
if (page.classList.contains('type-interior')) {
|
||||
title = Globalize.translate('ButtonHome');
|
||||
}
|
||||
}
|
||||
|
||||
if (titleKey) {
|
||||
LibraryMenu.setTitle(Globalize.translate(titleKey));
|
||||
if (title) {
|
||||
LibraryMenu.setTitle(title);
|
||||
}
|
||||
|
||||
var mainDrawerButton = document.querySelector('.mainDrawerButton');
|
||||
|
|
|
@ -33,12 +33,29 @@
|
|||
};
|
||||
|
||||
self.resetEnhancements = function () {
|
||||
$("#mediaPlayer").hide();
|
||||
|
||||
fadeOut(document.querySelector('#mediaPlayer'));
|
||||
$('#videoPlayer').removeClass('fullscreenVideo').removeClass('idlePlayer');
|
||||
$('.hiddenOnIdle').removeClass("inactive");
|
||||
$("video").remove();
|
||||
|
||||
document.querySelector('.mediaButton.infoButton').classList.remove('active');
|
||||
document.querySelector('.videoControls .nowPlayingInfo').classList.add('hide');
|
||||
document.querySelector('.videoControls').classList.add('hiddenOnIdle');
|
||||
};
|
||||
|
||||
function fadeOut(elem) {
|
||||
$(elem).hide();
|
||||
return;
|
||||
var keyframes = [
|
||||
{ opacity: '1', offset: 0 },
|
||||
{ opacity: '0', offset: 1 }];
|
||||
var timing = { duration: 300, iterations: 1 };
|
||||
elem.animate(keyframes, timing).onfinish = function () {
|
||||
$(elem).hide();
|
||||
};
|
||||
}
|
||||
|
||||
self.exitFullScreen = function () {
|
||||
|
||||
if (document.exitFullscreen) {
|
||||
|
@ -610,6 +627,42 @@
|
|||
});
|
||||
};
|
||||
|
||||
self.toggleInfo = function () {
|
||||
|
||||
var button = document.querySelector('.mediaButton.infoButton');
|
||||
var nowPlayingInfo = document.querySelector('.videoControls .nowPlayingInfo');
|
||||
|
||||
if (button.classList.contains('active')) {
|
||||
button.classList.remove('active');
|
||||
document.querySelector('.videoControls').classList.add('hiddenOnIdle');
|
||||
|
||||
fadeOutDown(nowPlayingInfo);
|
||||
|
||||
} else {
|
||||
button.classList.add('active');
|
||||
document.querySelector('.videoControls').classList.remove('hiddenOnIdle');
|
||||
nowPlayingInfo.classList.remove('hide');
|
||||
fadeInUp(nowPlayingInfo);
|
||||
}
|
||||
};
|
||||
|
||||
function fadeInUp(elem) {
|
||||
var keyframes = [
|
||||
{ transform: 'translate3d(0, 100%, 0)', offset: 0 },
|
||||
{ transform: 'none', offset: 1 }];
|
||||
var timing = { duration: 300, iterations: 1 };
|
||||
elem.animate(keyframes, timing);
|
||||
}
|
||||
|
||||
function fadeOutDown(elem) {
|
||||
var keyframes = [{ transform: 'none', offset: 0 },
|
||||
{ transform: 'translate3d(0, 100%, 0)', offset: 1 }];
|
||||
var timing = { duration: 300, iterations: 1 };
|
||||
elem.animate(keyframes, timing).onfinish = function () {
|
||||
elem.classList.add('hide');
|
||||
};
|
||||
}
|
||||
|
||||
function ensureVideoPlayerElements() {
|
||||
|
||||
var html = '<div id="mediaPlayer" style="display: none;">';
|
||||
|
@ -647,11 +700,12 @@
|
|||
// Create controls
|
||||
html += '<div class="videoControls hiddenOnIdle">';
|
||||
|
||||
html += '<div class="nowPlayingInfo hiddenOnIdle">';
|
||||
html += '<div class="nowPlayingInfo hide">';
|
||||
html += '<div class="nowPlayingImage"></div>';
|
||||
html += '<div class="nowPlayingTabs"></div>';
|
||||
html += '</div>'; // nowPlayingInfo
|
||||
|
||||
html += '<div class="videoControlButtons">';
|
||||
html += '<paper-icon-button icon="skip-previous" class="previousTrackButton mediaButton videoTrackControl hide" onclick="MediaPlayer.previousTrack();"></paper-icon-button>';
|
||||
|
||||
html += '<paper-icon-button id="video-playButton" icon="play-arrow" class="mediaButton unpauseButton" onclick="MediaPlayer.unpause();"></paper-icon-button>';
|
||||
|
@ -669,6 +723,8 @@
|
|||
html += '<paper-slider pin step="1" min="0" max="100" value="0" class="videoVolumeSlider" style="width:100px;vertical-align:middle;margin-left:-1em;"></paper-slider>';
|
||||
|
||||
html += '<paper-icon-button icon="fullscreen" class="mediaButton fullscreenButton" onclick="MediaPlayer.toggleFullscreen();" id="video-fullscreenButton"></paper-icon-button>';
|
||||
html += '<paper-icon-button icon="info" class="mediaButton infoButton" onclick="MediaPlayer.toggleInfo();"></paper-icon-button>';
|
||||
html += '</div>';
|
||||
|
||||
html += '</div>'; // videoControls
|
||||
|
||||
|
|
|
@ -1411,56 +1411,11 @@
|
|||
var promise;
|
||||
var itemLimit = 100;
|
||||
|
||||
if (item.Type == "MusicArtist") {
|
||||
|
||||
promise = ApiClient.getInstantMixFromArtist({
|
||||
UserId: Dashboard.getCurrentUserId(),
|
||||
Fields: getItemFields,
|
||||
Limit: itemLimit,
|
||||
Id: id
|
||||
});
|
||||
|
||||
}
|
||||
else if (item.Type == "MusicGenre") {
|
||||
|
||||
promise = ApiClient.getInstantMixFromMusicGenre({
|
||||
UserId: Dashboard.getCurrentUserId(),
|
||||
Fields: getItemFields,
|
||||
Limit: itemLimit,
|
||||
Id: id
|
||||
});
|
||||
|
||||
}
|
||||
else if (item.Type == "MusicAlbum") {
|
||||
|
||||
promise = ApiClient.getInstantMixFromAlbum(id, {
|
||||
UserId: Dashboard.getCurrentUserId(),
|
||||
Fields: getItemFields,
|
||||
Limit: itemLimit
|
||||
});
|
||||
|
||||
}
|
||||
else if (item.Type == "Playlist") {
|
||||
|
||||
promise = ApiClient.getInstantMixFromPlaylist(id, {
|
||||
UserId: Dashboard.getCurrentUserId(),
|
||||
Fields: getItemFields,
|
||||
Limit: itemLimit
|
||||
});
|
||||
|
||||
}
|
||||
else if (item.Type == "Audio") {
|
||||
|
||||
promise = ApiClient.getInstantMixFromSong(id, {
|
||||
UserId: Dashboard.getCurrentUserId(),
|
||||
Fields: getItemFields,
|
||||
Limit: itemLimit
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
promise = ApiClient.getInstantMixFromItem(id, {
|
||||
UserId: Dashboard.getCurrentUserId(),
|
||||
Fields: getItemFields,
|
||||
Limit: itemLimit
|
||||
});
|
||||
|
||||
promise.done(function (result) {
|
||||
|
||||
|
@ -1760,7 +1715,12 @@
|
|||
|
||||
function canPlayH264() {
|
||||
|
||||
if (navigator.userAgent.toLowerCase().indexOf('firefox') != -1) {
|
||||
var userAgent = navigator.userAgent.toLowerCase();
|
||||
|
||||
if (userAgent.indexOf('firefox') != -1) {
|
||||
if (userAgent.indexOf('windows') != -1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
$('#chkPeopleOthers', page).checked(config.PeopleMetadataOptions.DownloadOtherPeopleMetadata).checkboxradio("refresh");
|
||||
$('#chkPeopleGuestStars', page).checked(config.PeopleMetadataOptions.DownloadGuestStarMetadata).checkboxradio("refresh");
|
||||
|
||||
$('.chkEnableVideoFrameAnalysis', page).checked(config.EnableVideoFrameAnalysis);
|
||||
$('.txtVideoFrameAnalysisLimit', page).val((config.VideoFrameAnalysisLimitBytes / 1000000) || '');
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
@ -270,6 +272,9 @@
|
|||
|
||||
config.SaveMetadataHidden = $('#chkSaveMetadataHidden', form).checked();
|
||||
|
||||
config.EnableVideoFrameAnalysis = $('.chkEnableVideoFrameAnalysis', form).checked();
|
||||
config.VideoFrameAnalysisLimitBytes = parseInt(parseFloat(($('.txtVideoFrameAnalysisLimit', form).val() || '0')) * 1000000);
|
||||
|
||||
config.EnableTvDbUpdates = $('#chkEnableTvdbUpdates', form).checked();
|
||||
config.EnableTmdbUpdates = $('#chkEnableTmdbUpdates', form).checked();
|
||||
config.EnableFanArtUpdates = $('#chkEnableFanartUpdates', form).checked();
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
limit: query.Limit,
|
||||
totalRecordCount: result.TotalRecordCount,
|
||||
viewButton: false,
|
||||
sortButton: true,
|
||||
showLimit: false,
|
||||
updatePageSizeSetting: false,
|
||||
addLayoutButton: true,
|
||||
|
@ -159,6 +160,36 @@
|
|||
reloadItems(page);
|
||||
});
|
||||
|
||||
// On callback make sure to set StartIndex = 0
|
||||
$('.btnSort', page).on('click', function () {
|
||||
LibraryBrowser.showSortMenu({
|
||||
items: [{
|
||||
name: Globalize.translate('OptionNameSort'),
|
||||
id: 'SortName'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('OptionImdbRating'),
|
||||
id: 'CommunityRating,SortName'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('OptionDateAdded'),
|
||||
id: 'DateCreated,SortName'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('OptionParentalRating'),
|
||||
id: 'OfficialRating,SortName'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('OptionReleaseDate'),
|
||||
id: 'PremiereDate,SortName'
|
||||
}],
|
||||
callback: function () {
|
||||
reloadItems(page);
|
||||
},
|
||||
query: query
|
||||
});
|
||||
});
|
||||
|
||||
LibraryBrowser.saveQueryValues(getSavedQueryKey(), query);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
|
|
@ -270,9 +270,9 @@
|
|||
|
||||
}).checkboxradio('refresh');
|
||||
|
||||
$('.chk3D', viewPanel).checked(query.Is3D == true).checkboxradio('refresh');
|
||||
$('.chkHD', viewPanel).checked(query.IsHD == true).checkboxradio('refresh');
|
||||
$('.chkSD', viewPanel).checked(query.IsHD == false).checkboxradio('refresh');
|
||||
$('.chk3DFilter', viewPanel).checked(query.Is3D == true).checkboxradio('refresh');
|
||||
$('.chkHDFilter', viewPanel).checked(query.IsHD == true).checkboxradio('refresh');
|
||||
$('.chkSDFilter', viewPanel).checked(query.IsHD == false).checkboxradio('refresh');
|
||||
|
||||
$('.alphabetPicker', tabContent).alphaValue(query.NameStartsWithOrGreater);
|
||||
}
|
||||
|
@ -335,7 +335,7 @@
|
|||
reloadItems(tabContent, viewPanel);
|
||||
});
|
||||
|
||||
$('.chk3D', viewPanel).on('change', function () {
|
||||
$('.chk3DFilter', viewPanel).on('change', function () {
|
||||
|
||||
var query = getQuery();
|
||||
query.StartIndex = 0;
|
||||
|
@ -344,16 +344,15 @@
|
|||
reloadItems(tabContent, viewPanel);
|
||||
});
|
||||
|
||||
$('.chkHD', viewPanel).on('change', function () {
|
||||
$('.chkHDFilter', viewPanel).on('change', function () {
|
||||
|
||||
var query = getQuery();
|
||||
query.StartIndex = 0;
|
||||
query.IsHD = this.checked ? true : null;
|
||||
|
||||
reloadItems(tabContent, viewPanel);
|
||||
});
|
||||
|
||||
$('.chkSD', viewPanel).on('change', function () {
|
||||
$('.chkSDFilter', viewPanel).on('change', function () {
|
||||
|
||||
var query = getQuery();
|
||||
query.StartIndex = 0;
|
||||
|
|
|
@ -8,7 +8,39 @@
|
|||
|
||||
var items = result.Items;
|
||||
|
||||
deferred.resolveWith(null, [items]);
|
||||
var list = [];
|
||||
|
||||
for (var i = 0, length = items.length; i < length; i++) {
|
||||
|
||||
var view = items[i];
|
||||
|
||||
list.push(view);
|
||||
|
||||
if (view.CollectionType == 'livetv') {
|
||||
|
||||
view.ImageTags = {};
|
||||
view.icon = 'live-tv';
|
||||
view.onclick = "LibraryBrowser.showTab('livetv.html', 0);return false;";
|
||||
|
||||
var guideView = $.extend({}, view);
|
||||
guideView.Name = Globalize.translate('ButtonGuide');
|
||||
guideView.ImageTags = {};
|
||||
guideView.icon = 'dvr';
|
||||
guideView.url = 'livetv.html?tab=1';
|
||||
guideView.onclick = "LibraryBrowser.showTab('livetv.html', 1);return false;";
|
||||
list.push(guideView);
|
||||
|
||||
var recordedTvView = $.extend({}, view);
|
||||
recordedTvView.Name = Globalize.translate('ButtonRecordedTv');
|
||||
recordedTvView.ImageTags = {};
|
||||
recordedTvView.icon = 'video-library';
|
||||
recordedTvView.url = 'livetv.html?tab=3';
|
||||
recordedTvView.onclick = "LibraryBrowser.showTab('livetv.html', 3);return false;";
|
||||
list.push(recordedTvView);
|
||||
}
|
||||
}
|
||||
|
||||
deferred.resolveWith(null, [list]);
|
||||
});
|
||||
|
||||
return deferred.promise();
|
||||
|
@ -36,53 +68,53 @@
|
|||
|
||||
switch (item.CollectionType) {
|
||||
case "movies":
|
||||
icon = "fa-film";
|
||||
icon = "local-movies";
|
||||
backgroundColor = 'rgba(176, 94, 81, 0.9)';
|
||||
break;
|
||||
case "music":
|
||||
icon = "fa-music";
|
||||
icon = "library-music";
|
||||
backgroundColor = 'rgba(217, 145, 67, 0.9)';
|
||||
break;
|
||||
case "photos":
|
||||
icon = "fa-photo";
|
||||
icon = "photo";
|
||||
backgroundColor = 'rgba(127, 0, 0, 0.9)';
|
||||
break;
|
||||
case "livetv":
|
||||
icon = "fa-video-camera";
|
||||
icon = "live-tv";
|
||||
backgroundColor = 'rgba(217, 145, 67, 0.9)';
|
||||
break;
|
||||
case "tvshows":
|
||||
icon = "fa-video-camera";
|
||||
icon = "live-tv";
|
||||
backgroundColor = 'rgba(77, 88, 164, 0.9)';
|
||||
break;
|
||||
case "games":
|
||||
icon = "fa-gamepad";
|
||||
icon = "folder";
|
||||
backgroundColor = 'rgba(183, 202, 72, 0.9)';
|
||||
break;
|
||||
case "trailers":
|
||||
icon = "fa-film";
|
||||
icon = "local-movies";
|
||||
backgroundColor = 'rgba(176, 94, 81, 0.9)';
|
||||
break;
|
||||
case "homevideos":
|
||||
icon = "fa-video-camera";
|
||||
icon = "video-library";
|
||||
backgroundColor = 'rgba(110, 52, 32, 0.9)';
|
||||
break;
|
||||
case "musicvideos":
|
||||
icon = "fa-video-camera";
|
||||
icon = "video-library";
|
||||
backgroundColor = 'rgba(143, 54, 168, 0.9)';
|
||||
break;
|
||||
case "books":
|
||||
icon = "fa-book";
|
||||
icon = "folder";
|
||||
break;
|
||||
case "channels":
|
||||
icon = "fa-globe";
|
||||
icon = "folder";
|
||||
backgroundColor = 'rgba(51, 136, 204, 0.9)';
|
||||
break;
|
||||
case "playlists":
|
||||
icon = "fa-list";
|
||||
icon = "folder";
|
||||
break;
|
||||
default:
|
||||
icon = "fa-folder-o";
|
||||
icon = "folder";
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -93,12 +125,15 @@
|
|||
}
|
||||
|
||||
var href = item.url || LibraryBrowser.getHref(item);
|
||||
var onclick = item.onclick ? ' onclick="' + item.onclick + '"' : '';
|
||||
|
||||
html += '<a data-itemid="' + item.Id + '" class="' + cssClass + '" href="' + href + '">';
|
||||
icon = item.icon || icon;
|
||||
|
||||
html += '<a' + onclick + ' data-itemid="' + item.Id + '" class="' + cssClass + '" href="' + href + '">';
|
||||
html += '<div class="cardBox" style="background-color:' + backgroundColor + ';margin:4px;border-radius:4px;">';
|
||||
|
||||
html += "<div class='cardText' style='padding:8px 10px;color:#fff;font-size:14px;'>";
|
||||
html += '<i class="fa ' + icon + '"></i>';
|
||||
html += '<iron-icon icon="' + icon + '"></iron-icon>';
|
||||
html += '<span style="margin-left:.7em;">' + item.Name + '</span>';
|
||||
html += "</div>";
|
||||
|
||||
|
@ -439,12 +474,10 @@
|
|||
|
||||
html += '<div>';
|
||||
html += '<h1 style="display:inline-block; vertical-align:middle;" class="' + cssClass + '">' + Globalize.translate('HeaderLatestTvRecordings') + '</h1>';
|
||||
html += '<a href="livetv.html?tab=3" class="clearLink" style="margin-left:2em;"><paper-button raised class="more mini"><span>' + Globalize.translate('ButtonMore') + '</span></paper-button></a>';
|
||||
html += '<a href="livetv.html?tab=3" onclick="LibraryManager.showTab(\'livetv.html\',3);" class="clearLink" style="margin-left:2em;"><paper-button raised class="more mini"><span>' + Globalize.translate('ButtonMore') + '</span></paper-button></a>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
var screenWidth = $(window).width();
|
||||
|
||||
html += LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: "autohome",
|
||||
|
|
|
@ -67,8 +67,8 @@
|
|||
} else {
|
||||
html += '<div class="cardImage" style="text-align:center;">';
|
||||
|
||||
var icon = server.Id == 'new' ? 'plus-circle' : 'server';
|
||||
html += '<i class="fa fa-' + icon + '" style="color:#fff;vertical-align:middle;font-size:100px;margin-top:40px;"></i>';
|
||||
var icon = server.Id == 'new' ? 'add' : 'wifi';
|
||||
html += '<iron-icon icon="' + icon + '" style="color:#fff;vertical-align:middle;margin-top:30%;height:64px;width:64px;"></iron-icon>';
|
||||
}
|
||||
|
||||
html += "</div>";
|
||||
|
@ -298,7 +298,7 @@
|
|||
html += '<a class="cardContent" href="' + href + '">';
|
||||
|
||||
html += '<div class="cardImage" style="text-align:center;">';
|
||||
html += '<i class="fa fa-globe" style="color:#fff;vertical-align:middle;font-size:100px;margin-top:40px;"></i>';
|
||||
html += '<iron-icon icon="wifi" style="color:#fff;vertical-align:middle;margin-top:30%;height:64px;width:64px;"></iron-icon>';
|
||||
html += "</div>";
|
||||
|
||||
// cardContent
|
||||
|
|
|
@ -1887,7 +1887,7 @@ var AppInfo = {};
|
|||
var apiClient = window.ApiClient;
|
||||
|
||||
// Close the connection gracefully when possible
|
||||
if (apiClient && apiClient.isWebSocketOpen()) {
|
||||
if (apiCblient && apiClient.isWebSocketOpen()) {
|
||||
|
||||
var localActivePlayers = MediaController.getPlayers().filter(function (p) {
|
||||
|
||||
|
@ -2013,6 +2013,10 @@ var AppInfo = {};
|
|||
Dashboard.importCss('css/livetv.css');
|
||||
return {};
|
||||
});
|
||||
define("fontawesome", [], function () {
|
||||
Dashboard.importCss('thirdparty/fontawesome/css/font-awesome.min.css');
|
||||
return {};
|
||||
});
|
||||
define("detailtablecss", [], function () {
|
||||
Dashboard.importCss('css/detailtable.css');
|
||||
return {};
|
||||
|
@ -2082,6 +2086,8 @@ var AppInfo = {};
|
|||
|
||||
capabilities.DeviceProfile = MediaPlayer.getDeviceProfile(Math.max(screen.height, screen.width));
|
||||
createConnectionManager(capabilities).done(function () { onConnectionManagerCreated(deferred); });
|
||||
|
||||
//$(document.body).append('<div style="background:#3F51B5;position:fixed;z-index:999999;top:1px;left:1px;width:800px;height:450px;display:flex;align-items:center;justify-content:center;"><iron-icon icon="live-tv" style="width:320px;height:320px;color:#fff;"></iron-icon></div>');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue