mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
allow editing of channel images in the web client
This commit is contained in:
parent
d3a3e54791
commit
b96d16576f
9 changed files with 369 additions and 38 deletions
80
dashboard-ui/scripts/livetvchannel.js
Normal file
80
dashboard-ui/scripts/livetvchannel.js
Normal file
|
@ -0,0 +1,80 @@
|
|||
(function ($, document, apiClient) {
|
||||
|
||||
var currentItem
|
||||
|
||||
function reload(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getLiveTvChannel(getParameterByName('id')).done(function (item) {
|
||||
|
||||
currentItem = item;
|
||||
|
||||
var name = item.Name;
|
||||
|
||||
$('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item));
|
||||
|
||||
Dashboard.setPageTitle(name);
|
||||
|
||||
$('.itemName', page).html(name);
|
||||
|
||||
if (ApiClient.isWebSocketOpen()) {
|
||||
|
||||
var vals = [item.Type, item.Id, item.Name];
|
||||
|
||||
vals.push('livetv');
|
||||
|
||||
ApiClient.sendWebSocketMessage("Context", vals.join('|'));
|
||||
}
|
||||
|
||||
if (MediaPlayer.canPlay(item)) {
|
||||
$('#playButtonContainer', page).show();
|
||||
} else {
|
||||
$('#playButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
|
||||
if (user.Configuration.IsAdministrator && item.LocationType !== "Offline") {
|
||||
$('#editButtonContainer', page).show();
|
||||
} else {
|
||||
$('#editButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#liveTvChannelPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#btnPlay', page).on('click', function () {
|
||||
var userdata = currentItem.UserData || {};
|
||||
LibraryBrowser.showPlayMenu(this, currentItem.Name, currentItem.Type, currentItem.MediaType, userdata.PlaybackPositionTicks);
|
||||
});
|
||||
|
||||
$('#btnRemote', page).on('click', function () {
|
||||
|
||||
RemoteControl.showMenuForItem({ item: currentItem, context: 'livetv' });
|
||||
});
|
||||
|
||||
$('#btnEdit', page).on('click', function () {
|
||||
|
||||
Dashboard.navigate("edititemmetadata.html?channelid=" + currentItem.Id);
|
||||
});
|
||||
|
||||
}).on('pageshow', "#liveTvChannelPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
reload(page);
|
||||
|
||||
}).on('pagehide', "#liveTvChannelPage", function () {
|
||||
|
||||
currentItem = null;
|
||||
});
|
||||
|
||||
})(jQuery, document, ApiClient);
|
Loading…
Add table
Add a link
Reference in a new issue