1
0
Fork 0
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:
Luke Pulverenti 2013-11-24 18:37:38 -05:00
parent d3a3e54791
commit b96d16576f
9 changed files with 369 additions and 38 deletions

View 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);