mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
66f8b0f93d
32 changed files with 399 additions and 248 deletions
|
@ -11,7 +11,7 @@
|
|||
Dashboard.showLoadingMsg();
|
||||
DashboardPage.pollForInfo(page);
|
||||
DashboardPage.startInterval();
|
||||
|
||||
|
||||
$(ApiClient).on("websocketmessage", DashboardPage.onWebSocketMessage)
|
||||
.on("websocketopen", DashboardPage.onWebSocketConnectionChange)
|
||||
.on("websocketerror", DashboardPage.onWebSocketConnectionChange)
|
||||
|
@ -173,7 +173,7 @@
|
|||
pollForInfo: function (page) {
|
||||
|
||||
ApiClient.getSessions().done(function (sessions) {
|
||||
|
||||
|
||||
DashboardPage.renderInfo(page, sessions);
|
||||
});
|
||||
},
|
||||
|
@ -360,9 +360,13 @@
|
|||
return "<img src='css/images/clients/mbkinect.png' alt='MB Kinect' />";
|
||||
}
|
||||
if (clientLowered == "xbmc") {
|
||||
|
||||
return "<img src='css/images/clients/xbmc.png' alt='Xbmc' />";
|
||||
}
|
||||
if (clientLowered == "chromecast") {
|
||||
|
||||
return "<img src='css/images/chromecast/ic_media_route_on_holo_light.png' alt='Chromecast' />";
|
||||
}
|
||||
|
||||
|
||||
return connection.Client;
|
||||
},
|
||||
|
|
|
@ -75,20 +75,6 @@
|
|||
renderResponseProfiles(page, profile.ResponseProfiles);
|
||||
}
|
||||
|
||||
function editDirectPlayProfile(page, directPlayProfile) {
|
||||
|
||||
isSubProfileNew = directPlayProfile == null;
|
||||
directPlayProfile = directPlayProfile || {};
|
||||
currentSubProfile = directPlayProfile;
|
||||
|
||||
var popup = $('#popupEditDirectPlayProfile', page).popup('open');
|
||||
|
||||
$('#selectDirectPlayProfileType', popup).val(directPlayProfile.Type || 'Video').selectmenu('refresh').trigger('change');
|
||||
$('#txtDirectPlayContainer', popup).val(directPlayProfile.Container || '');
|
||||
$('#txtDirectPlayAudioCodec', popup).val(directPlayProfile.AudioCodec || '');
|
||||
$('#txtDirectPlayVideoCodec', popup).val(directPlayProfile.VideoCodec || '');
|
||||
}
|
||||
|
||||
function saveDirectPlayProfile(page) {
|
||||
|
||||
currentSubProfile.Type = $('#selectDirectPlayProfileType', page).val();
|
||||
|
@ -171,6 +157,22 @@
|
|||
|
||||
}
|
||||
|
||||
function editDirectPlayProfile(page, directPlayProfile) {
|
||||
|
||||
isSubProfileNew = directPlayProfile == null;
|
||||
directPlayProfile = directPlayProfile || {};
|
||||
currentSubProfile = directPlayProfile;
|
||||
|
||||
var popup = $('#popupEditDirectPlayProfile', page);
|
||||
|
||||
$('#selectDirectPlayProfileType', popup).val(directPlayProfile.Type || 'Video').selectmenu('refresh').trigger('change');
|
||||
$('#txtDirectPlayContainer', popup).val(directPlayProfile.Container || '');
|
||||
$('#txtDirectPlayAudioCodec', popup).val(directPlayProfile.AudioCodec || '');
|
||||
$('#txtDirectPlayVideoCodec', popup).val(directPlayProfile.VideoCodec || '');
|
||||
|
||||
popup.popup('open');
|
||||
}
|
||||
|
||||
function renderTranscodingProfiles(page, profiles) {
|
||||
|
||||
var html = '';
|
||||
|
@ -233,7 +235,7 @@
|
|||
transcodingProfile = transcodingProfile || {};
|
||||
currentSubProfile = transcodingProfile;
|
||||
|
||||
var popup = $('#transcodingProfilePopup', page).popup('open');
|
||||
var popup = $('#transcodingProfilePopup', page);
|
||||
|
||||
$('#selectTranscodingProfileType', popup).val(transcodingProfile.Type || 'Video').selectmenu('refresh').trigger('change');
|
||||
$('#txtTranscodingContainer', popup).val(transcodingProfile.Container || '');
|
||||
|
@ -246,6 +248,8 @@
|
|||
$('#chkReportByteRangeRequests', popup).checked(transcodingProfile.TranscodeSeekInfo == 'Bytes').checkboxradio('refresh');
|
||||
|
||||
$('.radioTabButton:first', popup).checked(true).checkboxradio('refresh').trigger('change');
|
||||
|
||||
popup.popup('open');
|
||||
}
|
||||
|
||||
function deleteTranscodingProfile(page, index) {
|
||||
|
@ -351,10 +355,14 @@
|
|||
containerProfile = containerProfile || {};
|
||||
currentSubProfile = containerProfile;
|
||||
|
||||
var popup = $('#containerProfilePopup', page).popup('open');
|
||||
var popup = $('#containerProfilePopup', page);
|
||||
|
||||
$('#selectContainerProfileType', popup).val(containerProfile.Type || 'Video').selectmenu('refresh').trigger('change');
|
||||
$('#txtContainerProfileContainer', popup).val(containerProfile.Container || '');
|
||||
|
||||
$('.radioTabButton:first', popup).checked(true).checkboxradio('refresh').trigger('change');
|
||||
|
||||
popup.popup('open');
|
||||
}
|
||||
|
||||
function saveContainerProfile(page) {
|
||||
|
@ -447,10 +455,14 @@
|
|||
codecProfile = codecProfile || {};
|
||||
currentSubProfile = codecProfile;
|
||||
|
||||
var popup = $('#codecProfilePopup', page).popup('open');
|
||||
var popup = $('#codecProfilePopup', page);
|
||||
|
||||
$('#selectCodecProfileType', popup).val(codecProfile.Type || 'Video').selectmenu('refresh').trigger('change');
|
||||
$('#txtCodecProfileCodec', popup).val(codecProfile.Codec || '');
|
||||
|
||||
$('.radioTabButton:first', popup).checked(true).checkboxradio('refresh').trigger('change');
|
||||
|
||||
popup.popup('open');
|
||||
}
|
||||
|
||||
function saveCodecProfile(page) {
|
||||
|
@ -525,6 +537,13 @@
|
|||
var index = this.getAttribute('data-profileindex');
|
||||
deleteResponseProfile(page, index);
|
||||
});
|
||||
|
||||
$('.lnkEditSubProfile', elem).on('click', function () {
|
||||
|
||||
var index = parseInt(this.getAttribute('data-profileindex'));
|
||||
|
||||
editResponseProfile(page, currentProfile.ResponseProfiles[index]);
|
||||
});
|
||||
}
|
||||
|
||||
function deleteResponseProfile(page, index) {
|
||||
|
@ -532,7 +551,43 @@
|
|||
currentProfile.ResponseProfiles.splice(index, 1);
|
||||
|
||||
renderResponseProfiles(page, currentProfile.ResponseProfiles);
|
||||
}
|
||||
|
||||
function editResponseProfile(page, responseProfile) {
|
||||
|
||||
isSubProfileNew = responseProfile == null;
|
||||
responseProfile = responseProfile || {};
|
||||
currentSubProfile = responseProfile;
|
||||
|
||||
var popup = $('#responseProfilePopup', page);
|
||||
|
||||
$('#selectResponseProfileType', popup).val(responseProfile.Type || 'Video').selectmenu('refresh').trigger('change');
|
||||
$('#txtResponseProfileContainer', popup).val(responseProfile.Container || '');
|
||||
$('#txtResponseProfileAudioCodec', popup).val(responseProfile.AudioCodec || '');
|
||||
$('#txtResponseProfileVideoCodec', popup).val(responseProfile.VideoCodec || '');
|
||||
|
||||
$('.radioTabButton:first', popup).checked(true).checkboxradio('refresh').trigger('change');
|
||||
|
||||
popup.popup('open');
|
||||
}
|
||||
|
||||
function saveResponseProfile(page) {
|
||||
|
||||
currentSubProfile.Type = $('#selectResponseProfileType', page).val();
|
||||
currentSubProfile.Container = $('#txtResponseProfileContainer', page).val();
|
||||
currentSubProfile.AudioCodec = $('#txtResponseProfileAudioCodec', page).val();
|
||||
currentSubProfile.VideoCodec = $('#txtResponseProfileVideoCodec', page).val();
|
||||
|
||||
if (isSubProfileNew) {
|
||||
|
||||
currentProfile.ResponseProfiles.push(currentSubProfile);
|
||||
}
|
||||
|
||||
renderSubProfiles(page, currentProfile);
|
||||
|
||||
currentSubProfile = null;
|
||||
|
||||
$('#responseProfilePopup', page).popup('close');
|
||||
}
|
||||
|
||||
function saveProfile(page, profile) {
|
||||
|
@ -648,6 +703,22 @@
|
|||
|
||||
});
|
||||
|
||||
$('#selectResponseProfileType', page).on('change', function () {
|
||||
|
||||
if (this.value == 'Video') {
|
||||
$('#fldResponseProfileVideoCodec', page).show();
|
||||
} else {
|
||||
$('#fldResponseProfileVideoCodec', page).hide();
|
||||
}
|
||||
|
||||
if (this.value == 'Photo') {
|
||||
$('#fldResponseProfileAudioCodec', page).hide();
|
||||
} else {
|
||||
$('#fldResponseProfileAudioCodec', page).show();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('.btnAddDirectPlayProfile', page).on('click', function () {
|
||||
|
||||
editDirectPlayProfile(page);
|
||||
|
@ -672,6 +743,12 @@
|
|||
|
||||
});
|
||||
|
||||
$('.btnAddResponseProfile', page).on('click', function () {
|
||||
|
||||
editResponseProfile(page);
|
||||
|
||||
});
|
||||
|
||||
}).on('pageshow', "#dlnaProfilePage", function () {
|
||||
|
||||
var page = this;
|
||||
|
@ -737,6 +814,15 @@
|
|||
|
||||
saveCodecProfile(page);
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
onResponseProfileFormSubmit: function() {
|
||||
var form = this;
|
||||
var page = $(form).parents('.page');
|
||||
|
||||
saveResponseProfile(page);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -46,42 +46,41 @@
|
|||
LibraryBrowser.renderDetailPageBackdrop(page, item);
|
||||
|
||||
if (user.Configuration.IsAdministrator) {
|
||||
$('#editButtonContainer', page).show();
|
||||
$('.btnEdit', page).removeClass('hide');
|
||||
|
||||
} else {
|
||||
$('#editButtonContainer', page).hide();
|
||||
$('.btnEdit', page).addClass('hide');
|
||||
}
|
||||
|
||||
var externalPlayUrl = getExternalPlayUrl(item);
|
||||
$('#btnPlayExternal', page).attr('href', externalPlayUrl || '#');
|
||||
$('.btnPlayExternal', page).attr('href', externalPlayUrl || '#');
|
||||
|
||||
if (externalPlayUrl) {
|
||||
$('#playExternalButtonContainer', page).show();
|
||||
$('#playButtonContainer', page).hide();
|
||||
$('.btnPlayExternal', page).removeClass('hide');
|
||||
$('.btnPlay', page).addClass('hide');
|
||||
}
|
||||
else if (MediaController.canPlay(item)) {
|
||||
$('#playButtonContainer', page).show();
|
||||
$('#playExternalButtonContainer', page).hide();
|
||||
$('.btnPlay', page).removeClass('hide');
|
||||
$('.btnPlayExternal', page).addClass('hide');
|
||||
}
|
||||
else {
|
||||
$('#playButtonContainer', page).hide();
|
||||
$('#playExternalButtonContainer', page).hide();
|
||||
$('.btnPlay', page).addClass('hide');
|
||||
$('.btnPlayExternal', page).addClass('hide');
|
||||
}
|
||||
|
||||
if (item.LocalTrailerCount && item.PlayAccess == 'Full') {
|
||||
$('#trailerButtonContainer', page).show();
|
||||
$('.btnPlayTrailer', page).removeClass('hide');
|
||||
} else {
|
||||
$('#trailerButtonContainer', page).hide();
|
||||
$('.btnPlayTrailer', page).addClass('hide');
|
||||
}
|
||||
|
||||
if (!item.LocalTrailerCount && item.RemoteTrailers.length && item.PlayAccess == 'Full') {
|
||||
$('#externalTrailerButtonContainer', page).show();
|
||||
|
||||
$('#btnPlayExternalTrailer', page).attr('href', item.RemoteTrailers[0].Url);
|
||||
|
||||
$('.btnPlayExternalTrailer', page).removeClass('hide').attr('href', item.RemoteTrailers[0].Url);
|
||||
|
||||
} else {
|
||||
$('#externalTrailerButtonContainer', page).hide();
|
||||
$('#btnPlayExternalTrailer', page).attr('href', '#');
|
||||
|
||||
$('.btnPlayExternalTrailer', page).addClass('hide').attr('href', '#');
|
||||
}
|
||||
|
||||
if (user.Configuration.IsAdministrator && item.MediaSources && item.MediaSources.length > 1) {
|
||||
|
@ -93,10 +92,10 @@
|
|||
|
||||
if (item.LocationType == "Offline") {
|
||||
|
||||
$('#offlineIndicator', page).show();
|
||||
$('.offlineIndicator', page).show();
|
||||
}
|
||||
else {
|
||||
$('#offlineIndicator', page).hide();
|
||||
$('.offlineIndicator', page).hide();
|
||||
}
|
||||
|
||||
var isMissingEpisode = false;
|
||||
|
@ -113,10 +112,10 @@
|
|||
|
||||
if (isMissingEpisode) {
|
||||
|
||||
$('#missingIndicator', page).show();
|
||||
$('.missingIndicator', page).show();
|
||||
}
|
||||
else {
|
||||
$('#missingIndicator', page).hide();
|
||||
$('.missingIndicator', page).hide();
|
||||
}
|
||||
|
||||
setPeopleHeader(page, item);
|
||||
|
@ -128,9 +127,7 @@
|
|||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#btnEdit', page).attr('href', "edititemmetadata.html?id=" + id);
|
||||
$('.btnEdit', page).attr('href', "edititemmetadata.html?id=" + id);
|
||||
}
|
||||
|
||||
function setPeopleHeader(page, item) {
|
||||
|
@ -1332,7 +1329,7 @@
|
|||
|
||||
var page = this;
|
||||
|
||||
$('#btnPlay', page).on('click', function () {
|
||||
$('.btnPlay', page).on('click', function () {
|
||||
var userdata = currentItem.UserData || {};
|
||||
|
||||
var mediaType = currentItem.MediaType;
|
||||
|
@ -1344,11 +1341,11 @@
|
|||
LibraryBrowser.showPlayMenu(this, currentItem.Id, currentItem.Type, currentItem.IsFolder, mediaType, userdata.PlaybackPositionTicks);
|
||||
});
|
||||
|
||||
$('#btnPlayTrailer', page).on('click', function () {
|
||||
$('.btnPlayTrailer', page).on('click', function () {
|
||||
playTrailer(page);
|
||||
});
|
||||
|
||||
$('#btnPlayExternal', page).on('click', function () {
|
||||
$('.btnPlayExternal', page).on('click', function () {
|
||||
|
||||
ApiClient.markPlayed(Dashboard.getCurrentUserId(), currentItem.Id, new Date());
|
||||
});
|
||||
|
|
|
@ -338,6 +338,10 @@
|
|||
|
||||
getHref: function (item, itemByNameContext) {
|
||||
|
||||
if (!item) {
|
||||
throw new Error('item cannot be null');
|
||||
}
|
||||
|
||||
if (item.url) {
|
||||
return item.url;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue