added live tv timers page
This commit is contained in:
parent
1664591f7d
commit
f5b62182b5
52 changed files with 420 additions and 139 deletions
|
@ -14,8 +14,6 @@
|
|||
|
||||
renderHeader(page, item);
|
||||
|
||||
$('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item));
|
||||
|
||||
LibraryBrowser.renderName(item, $('.itemName', page));
|
||||
LibraryBrowser.renderParentName(item, $('.parentName', page));
|
||||
|
||||
|
@ -23,6 +21,10 @@
|
|||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
|
||||
var imageHref = user.Configuration.IsAdministrator ? "edititemimages.html?id=" + item.Id : "";
|
||||
|
||||
$('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item, imageHref));
|
||||
|
||||
setInitialCollapsibleState(page, item, context, user);
|
||||
renderDetails(page, item, context);
|
||||
LibraryBrowser.renderDetailPageBackdrop(page, item);
|
||||
|
|
|
@ -153,7 +153,7 @@
|
|||
cssClass += " remoteDiscImage";
|
||||
}
|
||||
else {
|
||||
|
||||
|
||||
if (currentItem.Type == "Episode") {
|
||||
cssClass += " remoteBackdropImage";
|
||||
}
|
||||
|
@ -270,7 +270,7 @@
|
|||
|
||||
return html;
|
||||
}
|
||||
|
||||
|
||||
function reload(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
@ -279,23 +279,6 @@
|
|||
|
||||
currentItem = item;
|
||||
|
||||
ApiClient.getRemoteImageProviders(getBaseRemoteOptions()).done(function(providers) {
|
||||
|
||||
if (providers.length) {
|
||||
$('.lnkBrowseAllImages', page).removeClass('hide');
|
||||
} else {
|
||||
$('.lnkBrowseAllImages', page).addClass('hide');
|
||||
}
|
||||
|
||||
ApiClient.getItemImageInfos(currentItem.Id, currentItem.Type, currentItem.Name).done(function (imageInfos) {
|
||||
|
||||
renderStandardImages(page, item, imageInfos, providers);
|
||||
renderBackdrops(page, item, imageInfos, providers);
|
||||
renderScreenshots(page, item, imageInfos, providers);
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
});
|
||||
|
||||
LibraryBrowser.renderName(item, $('.itemName', page), true);
|
||||
|
||||
updateTabs(page, item);
|
||||
|
@ -306,6 +289,22 @@
|
|||
$('#btnEditPeople', page).show();
|
||||
}
|
||||
|
||||
ApiClient.getRemoteImageProviders(getBaseRemoteOptions()).done(function (providers) {
|
||||
|
||||
if (providers.length) {
|
||||
$('.lnkBrowseAllImages', page).removeClass('hide');
|
||||
} else {
|
||||
$('.lnkBrowseAllImages', page).addClass('hide');
|
||||
}
|
||||
|
||||
ApiClient.getItemImageInfos(currentItem.Id, currentItem.Type, currentItem.Name).done(function (imageInfos) {
|
||||
|
||||
renderStandardImages(page, item, imageInfos, providers);
|
||||
renderBackdrops(page, item, imageInfos, providers);
|
||||
renderScreenshots(page, item, imageInfos, providers);
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -317,18 +316,17 @@
|
|||
|
||||
var image = images[i];
|
||||
|
||||
html += '<div style="display:inline-block;margin:5px;background:#202020;padding:10px;">';
|
||||
html += '<div class="editorTile imageEditorTile">';
|
||||
|
||||
html += '<div style="float:left;height:100px;width:175px;vertical-align:top;background-repeat:no-repeat;background-size:contain;background-image:url(\'' + LibraryBrowser.getImageUrl(currentItem, image.ImageType, image.ImageIndex, { maxwidth: 300 }) + '\');"></div>';
|
||||
html += '<div style="height:100px;vertical-align:top;background-repeat:no-repeat;background-size:contain;background-image:url(\'' + LibraryBrowser.getImageUrl(currentItem, image.ImageType, image.ImageIndex, { maxwidth: 300 }) + '\');"></div>';
|
||||
|
||||
html += '<div style="float:right;vertical-align:top;margin-left:1em;width:125px;">';
|
||||
html += '<p style="margin-top:0;">' + image.ImageType + '</p>';
|
||||
html += '<div>';
|
||||
|
||||
html += '<p>' + image.ImageType + '</p>';
|
||||
|
||||
html += '<p>' + image.Width + ' * ' + image.Height + '</p>';
|
||||
html += '<p>' + image.Width + ' X ' + image.Height + '</p>';
|
||||
|
||||
html += '<p>' + (parseInt(image.Size / 1024)) + ' KB</p>';
|
||||
|
||||
html += '<p style="margin-left:-5px;">';
|
||||
html += '<p>';
|
||||
|
||||
if (image.ImageType == "Backdrop" || image.ImageType == "Screenshot") {
|
||||
|
||||
|
@ -345,12 +343,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
html += '<button type="button" data-icon="delete" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.deleteImage(\'' + image.ImageType + '\', ' + (image.ImageIndex != null ? image.ImageIndex : "null") + ');">Delete</button>';
|
||||
|
||||
if (imageProviders.length) {
|
||||
html += '<button type="button" data-icon="cloud" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.showDownloadMenu(\'' + image.ImageType + '\');">Browse Online Images</button>';
|
||||
html += '<button type="button" data-icon="pencil" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.showDownloadMenu(\'' + image.ImageType + '\');">Browse Online Images</button>';
|
||||
}
|
||||
|
||||
html += '<button type="button" data-icon="delete" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.deleteImage(\'' + image.ImageType + '\', ' + (image.ImageIndex != null ? image.ImageIndex : "null") + ');">Delete</button>';
|
||||
|
||||
html += '</p>';
|
||||
|
||||
html += '</div>';
|
||||
|
@ -456,7 +454,7 @@
|
|||
return function (e) {
|
||||
|
||||
// Render thumbnail.
|
||||
var html = ['<img style="max-width:500px;max-height:200px;" src="', e.target.result, '" title="', escape(theFile.name), '"/>'].join('');
|
||||
var html = ['<img style="max-width:300px;max-height:100px;" src="', e.target.result, '" title="', escape(theFile.name), '"/>'].join('');
|
||||
|
||||
$('#imageOutput', page).html(html);
|
||||
$('#fldUpload', page).show();
|
||||
|
@ -590,7 +588,7 @@
|
|||
reloadBrowsableImages(page);
|
||||
});
|
||||
|
||||
}).on('pageshow', "#editItemImagesPage", function () {
|
||||
}).on('pagebeforeshow', "#editItemImagesPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
|
@ -631,27 +629,4 @@
|
|||
$("#imageDropZone", page).off('dragover').off('drop');
|
||||
});
|
||||
|
||||
})(jQuery, document, window, window.FileReader, escape);
|
||||
|
||||
function onMouseOver() {
|
||||
|
||||
}
|
||||
function onMouseOut() {
|
||||
|
||||
}
|
||||
|
||||
function bindEvents() {
|
||||
|
||||
var document = 1;
|
||||
|
||||
var parentDiv = document.createElement('div');
|
||||
var childDiv = document.createElement('div');
|
||||
|
||||
document.body.appendChild(parentDiv);
|
||||
parentDiv.appendChild(childDiv);
|
||||
var myObj = '';
|
||||
|
||||
var div = document.getElementById('id');
|
||||
myObj.element = div;
|
||||
div.obj = myObj;
|
||||
}
|
||||
})(jQuery, document, window, window.FileReader, escape);
|
|
@ -251,7 +251,7 @@
|
|||
|
||||
themes: {
|
||||
theme: 'mb3',
|
||||
url: 'thirdparty/jstree1.0fix2/themes/mb3/style.css?v=' + Dashboard.initialServerVersion
|
||||
url: 'thirdparty/jstree1.0fix3/themes/mb3/style.css?v=' + Dashboard.initialServerVersion
|
||||
}
|
||||
|
||||
}).off('select_node.jstree').on('select_node.jstree', function (event, data) {
|
||||
|
@ -468,14 +468,14 @@
|
|||
MetadataEditor.getItemPromise().done(function (item) {
|
||||
|
||||
if (item.LocationType == "Offline") {
|
||||
$('#ulSave', page).hide();
|
||||
$('.saveButtonContainer', page).hide();
|
||||
} else {
|
||||
$('#ulSave', page).show();
|
||||
$('.saveButtonContainer', page).show();
|
||||
}
|
||||
|
||||
$('#btnRefresh', page).button('enable');
|
||||
$('#btnDelete', page).button('enable');
|
||||
$('#btnSave', page).button('enable');
|
||||
$('.btnSave', page).button('enable');
|
||||
|
||||
$('#refreshLoading', page).hide();
|
||||
|
||||
|
@ -1348,7 +1348,7 @@
|
|||
|
||||
$('#btnDelete', page).button('disable');
|
||||
$('#btnRefresh', page).button('disable');
|
||||
$('#btnSave', page).button('disable');
|
||||
$('.btnSave', page).button('disable');
|
||||
|
||||
$('#refreshLoading', page).show();
|
||||
|
||||
|
@ -1393,7 +1393,7 @@
|
|||
|
||||
$('#btnDelete', page).button('disable');
|
||||
$('#btnRefresh', page).button('disable');
|
||||
$('#btnSave', page).button('disable');
|
||||
$('.btnSave', page).button('disable');
|
||||
|
||||
$('#refreshLoading', page).show();
|
||||
|
||||
|
|
|
@ -265,7 +265,7 @@
|
|||
}
|
||||
});
|
||||
|
||||
}).on('pageshow', "#editItemPeoplePage", function () {
|
||||
}).on('pagebeforeshow', "#editItemPeoplePage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
|
|
|
@ -1504,7 +1504,7 @@
|
|||
itemId = item.Name;
|
||||
}
|
||||
|
||||
if (item.MediaType || item.IsFolder) {
|
||||
if ((item.MediaType || item.IsFolder) && item.Type != "Channel") {
|
||||
if (userData.Played) {
|
||||
html += '<img data-type="' + type + '" data-itemid="' + itemId + '" class="imgUserItemRating imgPlayed" src="css/images/userdata/playedon.png" alt="Played" title="Played" onclick="LibraryBrowser.markPlayed(this);return false;" />';
|
||||
} else {
|
||||
|
@ -1701,7 +1701,7 @@
|
|||
}
|
||||
},
|
||||
|
||||
getDetailImageHtml: function (item) {
|
||||
getDetailImageHtml: function (item, href) {
|
||||
|
||||
var imageTags = item.ImageTags || {};
|
||||
|
||||
|
@ -1905,6 +1905,9 @@
|
|||
else if (item.Type == "Genre" || item.Type == "Studio") {
|
||||
url = "css/images/items/detail/video.png";
|
||||
}
|
||||
else if (item.Type == "Channel") {
|
||||
url = "css/images/items/detail/tv.png";
|
||||
}
|
||||
else {
|
||||
url = "css/images/items/detail/video.png";
|
||||
}
|
||||
|
@ -1917,7 +1920,9 @@
|
|||
identifierValue = ApiClient.encodeName(item.Name);
|
||||
}
|
||||
|
||||
var href = "itemgallery.html?" + identifierName + "=" + identifierValue;
|
||||
if (!href) {
|
||||
href = "itemgallery.html?" + identifierName + "=" + identifierValue;
|
||||
}
|
||||
|
||||
var linkToGallery = LibraryBrowser.shouldDisplayGallery(item);
|
||||
|
||||
|
@ -2333,6 +2338,8 @@
|
|||
|
||||
html += '<a class="viewMenuLink viewMenuImageLink remoteControlMenuLink" href="#" onclick="RemoteControl.showMenu();" title="Remote Control"><img src="css/images/remote.png" alt="Remote Control" /></a>';
|
||||
|
||||
html += '<a class="viewMenuLink viewMenuImageLink editorMenuLink" href="edititemmetadata.html" title="Metadata Manager"><img src="css/images/editor.png" alt=""Metadata Manager" /></a>';
|
||||
|
||||
html += '<div class="viewMenuSecondary">';
|
||||
|
||||
html += Search.getSearchHtml();
|
||||
|
|
|
@ -3,23 +3,6 @@
|
|||
var currentItem;
|
||||
var programs;
|
||||
|
||||
function getDisplayTime(date) {
|
||||
|
||||
try {
|
||||
|
||||
date = parseISO8601Date(date, { toLocal: true });
|
||||
|
||||
} catch (err) {
|
||||
return date;
|
||||
}
|
||||
|
||||
date = date.toLocaleTimeString();
|
||||
|
||||
date = date.replace('0:00', '0');
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
function cancelRecording(page, id) {
|
||||
|
||||
}
|
||||
|
@ -75,9 +58,9 @@
|
|||
|
||||
html += '<td>' + startDate.toLocaleDateString() + '</td>';
|
||||
|
||||
html += '<td>' + getDisplayTime(program.StartDate) + '</td>';
|
||||
html += '<td>' + LiveTvHelpers.getDisplayTime(program.StartDate) + '</td>';
|
||||
|
||||
html += '<td>' + getDisplayTime(program.EndDate) + '</td>';
|
||||
html += '<td>' + LiveTvHelpers.getDisplayTime(program.EndDate) + '</td>';
|
||||
|
||||
html += '<td>' + (program.Name || '') + '</td>';
|
||||
html += '<td>' + program.Genres.join(' / ') + '</td>';
|
||||
|
@ -134,6 +117,9 @@
|
|||
Dashboard.setPageTitle(name);
|
||||
|
||||
$('.itemName', page).html(name);
|
||||
$('.itemChannelNumber', page).html(item.Number);
|
||||
|
||||
$('.userDataIcons', page).html(LibraryBrowser.getUserDataIconsHtml(item));
|
||||
|
||||
if (ApiClient.isWebSocketOpen()) {
|
||||
|
||||
|
@ -165,6 +151,27 @@
|
|||
});
|
||||
}
|
||||
|
||||
window.LiveTvHelpers = {
|
||||
|
||||
getDisplayTime: function (date) {
|
||||
|
||||
try {
|
||||
|
||||
date = parseISO8601Date(date, { toLocal: true });
|
||||
|
||||
} catch (err) {
|
||||
return date;
|
||||
}
|
||||
|
||||
date = date.toLocaleTimeString();
|
||||
|
||||
date = date.replace('0:00', '0');
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$(document).on('pageinit', "#liveTvChannelPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
|
|
@ -1 +1,80 @@
|
|||
|
||||
(function ($, document, apiClient) {
|
||||
|
||||
function renderRecordings(page, recordings) {
|
||||
|
||||
var html = '';
|
||||
|
||||
var cssClass = "detailTable";
|
||||
|
||||
html += '<div class="detailTableContainer"><table class="' + cssClass + '">';
|
||||
|
||||
html += '<tr>';
|
||||
|
||||
html += '<th> </th>';
|
||||
html += '<th>Name</th>';
|
||||
html += '<th>Channel</th>';
|
||||
html += '<th>Date</th>';
|
||||
html += '<th>Start</th>';
|
||||
html += '<th>End</th>';
|
||||
html += '<th>Status</th>';
|
||||
|
||||
html += '</tr>';
|
||||
|
||||
for (var i = 0, length = recordings.length; i < length; i++) {
|
||||
|
||||
var recording = recordings[i];
|
||||
|
||||
html += '<tr>';
|
||||
|
||||
html += '<td>';
|
||||
html += '<button data-recordingid="' + recording.Id + '" class="btnPlayRecording" type="button" data-icon="play" data-inline="true" data-mini="true" data-iconpos="notext">Play</button>';
|
||||
html += '<button data-recordingid="' + recording.Id + '" class="btnEditRecording" type="button" data-icon="pencil" data-inline="true" data-mini="true" data-iconpos="notext">Edit</button>';
|
||||
html += '<button data-recordingid="' + recording.Id + '" class="btnDeleteRecording" type="button" data-icon="delete" data-inline="true" data-mini="true" data-iconpos="notext">Delete</button>';
|
||||
html += '</td>';
|
||||
|
||||
html += '<td>' + (recording.Name || '') + '</td>';
|
||||
html += '<td>' + (recording.ChannelName || '') + '</td>';
|
||||
|
||||
var startDate = recording.StartDate;
|
||||
|
||||
try {
|
||||
|
||||
startDate = parseISO8601Date(startDate, { toLocal: true });
|
||||
|
||||
} catch (err) {
|
||||
|
||||
}
|
||||
|
||||
html += '<td>' + startDate.toLocaleDateString() + '</td>';
|
||||
|
||||
html += '<td>' + LiveTvHelpers.getDisplayTime(recording.StartDate) + '</td>';
|
||||
|
||||
html += '<td>' + LiveTvHelpers.getDisplayTime(recording.EndDate) + '</td>';
|
||||
|
||||
html += '<td>' + (recording.Status || '') + '</td>';
|
||||
|
||||
html += '</tr>';
|
||||
}
|
||||
|
||||
html += '</table></div>';
|
||||
|
||||
var elem = $('#items', page).html(html).trigger('create');
|
||||
}
|
||||
|
||||
function reload(page) {
|
||||
|
||||
apiClient.getLiveTvRecordings().done(function(result) {
|
||||
|
||||
renderRecordings(page, result.Items);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', "#liveTvRecordingsPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
reload(page);
|
||||
});
|
||||
|
||||
})(jQuery, document, ApiClient);
|
82
dashboard-ui/scripts/livetvtimers.js
Normal file
82
dashboard-ui/scripts/livetvtimers.js
Normal file
|
@ -0,0 +1,82 @@
|
|||
(function ($, document, apiClient) {
|
||||
|
||||
function renderTimers(page, timers) {
|
||||
|
||||
var html = '';
|
||||
|
||||
var cssClass = "detailTable";
|
||||
|
||||
html += '<div class="detailTableContainer"><table class="' + cssClass + '">';
|
||||
|
||||
html += '<tr>';
|
||||
|
||||
html += '<th> </th>';
|
||||
html += '<th>Name</th>';
|
||||
html += '<th>Channel</th>';
|
||||
html += '<th>Date</th>';
|
||||
html += '<th>Start</th>';
|
||||
html += '<th>End</th>';
|
||||
html += '<th>Status</th>';
|
||||
html += '<th>Recurring Schedule</th>';
|
||||
|
||||
html += '</tr>';
|
||||
|
||||
for (var i = 0, length = timers.length; i < length; i++) {
|
||||
|
||||
var timer = timers[i];
|
||||
|
||||
html += '<tr>';
|
||||
|
||||
html += '<td>';
|
||||
html += '<button data-timerid="' + timer.Id + '" class="btnEditTimer" type="button" data-icon="pencil" data-inline="true" data-mini="true" data-iconpos="notext">Edit</button>';
|
||||
html += '<button data-timerid="' + timer.Id + '" class="btnDeleteTimer" type="button" data-icon="delete" data-inline="true" data-mini="true" data-iconpos="notext">Delete</button>';
|
||||
html += '</td>';
|
||||
|
||||
html += '<td>' + (timer.Name || '') + '</td>';
|
||||
html += '<td>' + (timer.ChannelName || '') + '</td>';
|
||||
|
||||
var startDate = timer.StartDate;
|
||||
|
||||
try {
|
||||
|
||||
startDate = parseISO8601Date(startDate, { toLocal: true });
|
||||
|
||||
} catch (err) {
|
||||
|
||||
}
|
||||
|
||||
html += '<td>' + startDate.toLocaleDateString() + '</td>';
|
||||
|
||||
html += '<td>' + LiveTvHelpers.getDisplayTime(timer.StartDate) + '</td>';
|
||||
|
||||
html += '<td>' + LiveTvHelpers.getDisplayTime(timer.EndDate) + '</td>';
|
||||
|
||||
html += '<td>' + (timer.Status || '') + '</td>';
|
||||
|
||||
html += '<td></td>';
|
||||
|
||||
html += '</tr>';
|
||||
}
|
||||
|
||||
html += '</table></div>';
|
||||
|
||||
var elem = $('#items', page).html(html).trigger('create');
|
||||
}
|
||||
|
||||
function reload(page) {
|
||||
|
||||
apiClient.getLiveTvTimers().done(function (result) {
|
||||
|
||||
renderTimers(page, result.Items);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', "#liveTvTimersPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
reload(page);
|
||||
});
|
||||
|
||||
})(jQuery, document, ApiClient);
|
Loading…
Add table
Add a link
Reference in a new issue