1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

updated live tv + nuget

This commit is contained in:
Luke Pulverenti 2013-12-14 20:17:57 -05:00
parent fadec6653a
commit b2b7584352
16 changed files with 544 additions and 46 deletions

View file

@ -3,13 +3,13 @@
function loadPage(page, config, systemInfo) {
var os = systemInfo.OperatingSystem.toLowerCase();
if (os.indexOf('windows') != -1) {
$('#windowsStartupDescription', page).show();
} else {
$('#windowsStartupDescription', page).hide();
}
if (systemInfo.SupportsNativeWebSocket) {
$('#fldWebSocketPortNumber', page).hide();
@ -26,6 +26,20 @@
$('#chkEnableDeveloperTools', page).checked(config.EnableDeveloperTools).checkboxradio("refresh");
$('#chkRunAtStartup', page).checked(config.RunAtStartup).checkboxradio("refresh");
$('#txtCachePath', page).val(config.CachePath || '');
var customCachePath = config.CachePath ? true : false;
$('#chkEnableCustomCachePath', page).checked(customCachePath).checkboxradio("refresh");
if (customCachePath) {
$('#fldEnterCachePath', page).show();
$('#txtCachePath', page).attr("required", "required");
} else {
$('#fldEnterCachePath', page).hide();
$('#txtCachePath', page).removeAttr("required");
}
Dashboard.hideLoadingMsg();
}
@ -44,7 +58,46 @@
loadPage(page, response1[0], response2[0]);
});
$('#btnSelectCachePath', page).on("click.selectDirectory", function () {
var picker = new DirectoryBrowser(page);
picker.show({
callback: function (path) {
if (path) {
$('#txtCachePath', page).val(path);
}
picker.close();
},
header: "Select Server Cache Path",
instruction: "Browse or enter the path to use for Media Browser Server cache. The folder must be writeable."
});
});
$('#chkEnableCustomCachePath', page).on("change.showCachePathText", function () {
if (this.checked) {
$('#fldEnterCachePath', page).show();
$('#txtCachePath', page).attr("required", "required");
} else {
$('#fldEnterCachePath', page).hide();
$('#txtCachePath', page).removeAttr("required");
}
});
}).on('pagehide', "#advancedConfigurationPage", function () {
var page = this;
$('#chkEnableCustomCachePath', page).off("change.showCachePathText");
$('#btnSelectCachePath', page).off("click.selectDirectory");
}).on('pageinit', "#advancedConfigurationPage", function () {
var page = this;
@ -58,7 +111,7 @@
}
});
});
function advancedConfigurationPage() {
@ -72,6 +125,12 @@
ApiClient.getServerConfiguration().done(function (config) {
if ($('#chkEnableCustomCachePath', form).checked()) {
config.CachePath = $('#txtCachePath', form).val();
} else {
config.CachePath = '';
}
config.LegacyWebSocketPortNumber = $('#txtWebSocketPortNumber', form).val();
config.HttpServerPortNumber = $('#txtPortNumber', form).val();

View file

@ -833,7 +833,7 @@
$('#txtDvdSeasonNumber', page).val(('DvdSeasonNumber' in item) ? item.DvdSeasonNumber : "");
$('#txtAirsBeforeSeason', page).val(('AirsBeforeSeasonNumber' in item) ? item.AirsBeforeSeasonNumber : "");
$('#txtAirsAfterSeason', page).val(('AirsAfterSeasonNumber' in item) ? item.AirsAfterSeasonNumber : "");
$('#txtAirsEpisodeSeason', page).val(('AirsBeforeEpisodeNumber' in item) ? item.AirsBeforeEpisodeNumber : "");
$('#txtAirsBeforeEpisode', page).val(('AirsBeforeEpisodeNumber' in item) ? item.AirsBeforeEpisodeNumber : "");
$('#txtAlbum', page).val(item.Album || "");
$('#txtAlbumArtist', page).val(item.AlbumArtist || "");
@ -1108,7 +1108,7 @@
DvdSeasonNumber: $('#txtDvdSeasonNumber', form).val(),
AirsBeforeSeasonNumber: $('#txtAirsBeforeSeason', form).val(),
AirsAfterSeasonNumber: $('#txtAirsAfterSeason', form).val(),
AirsBeforeEpisodeNumber: $('#txtAirsEpisodeSeason', form).val(),
AirsBeforeEpisodeNumber: $('#txtAirsBeforeEpisode', form).val(),
ParentIndexNumber: $('#txtParentIndexNumber', form).val(),
Players: $('#txtPlayers', form).val(),
Album: $('#txtAlbum', form).val(),

View file

@ -2,7 +2,7 @@
function loadPage(page, config) {
$('#txtItemsByNamePath', page).val(config.ItemsByNamePath);
$('#txtItemsByNamePath', page).val(config.ItemsByNamePath || '');
var customIbn = config.ItemsByNamePath ? true : false;
$('#chkEnableCustomIBNPath', page).checked(customIbn).checkboxradio("refresh");
@ -66,8 +66,6 @@
}).on('pagehide', "#librarySettingsPage", function () {
Dashboard.showLoadingMsg();
var page = this;
$('#chkEnableCustomIBNPath', page).off("change.showIBNText");

View file

@ -90,6 +90,7 @@
function loadPrograms(page) {
ApiClient.getLiveTvPrograms({
ChannelIds: currentItem.Id,
UserId: Dashboard.getCurrentUserId()

View file

@ -37,6 +37,8 @@
html += '<p class="itemMiscInfo">' + channel.Number + '</p>';
html += '<p class="userDataIcons">' + LibraryBrowser.getUserDataIconsHtml(channel) + '</p>';
html += '</div>';
html += "</a>";

View file

@ -33,7 +33,7 @@
Dashboard.setPageTitle(name);
$('.itemName', page).html(name);
$('.itemChannelNumber', page).html(item.ChannelName);
$('.itemChannelNumber', page).html('<a href="livetvchannel.html?id=' + item.ChannelId + '">' + item.ChannelName + '</a>').trigger('create');
$('.itemEpisodeName', page).html(item.EpisodeTitle);

View file

@ -1 +1,110 @@

(function (window, $, document, apiClient) {
var currentItem;
function deleteTimer(page, id) {
Dashboard.confirm("Are you sure you wish to cancel this series?", "Confirm Series Timer Cancellation", function (result) {
if (result) {
Dashboard.showLoadingMsg();
ApiClient.cancelLiveTvSeriesTimer(id).done(function () {
Dashboard.alert('Timer cancelled.');
reload(page);
});
}
});
}
function renderTimer(page, item) {
currentItem = item;
$('.itemName', page).html(item.Name);
$('.channel', page).html('<a href="livetvchannel.html?id=' + item.ChannelId + '">' + item.ChannelName + '</a>').trigger('create');
$('.overview', page).html(item.Overview || '');
$('#txtRequestedPrePaddingSeconds', page).val(item.RequestedPrePaddingSeconds);
$('#txtRequestedPostPaddingSeconds', page).val(item.RequestedPostPaddingSeconds);
$('#txtRequiredPrePaddingSeconds', page).val(item.RequiredPrePaddingSeconds);
$('#txtRequiredPostPaddingSeconds', page).val(item.RequiredPostPaddingSeconds);
$('#selectPriority', page).val(item.Priority);
$('.itemMiscInfo', page).html(LibraryBrowser.getMiscInfoHtml(item));
Dashboard.hideLoadingMsg();
}
function onSubmit() {
Dashboard.showLoadingMsg();
var form = this;
apiClient.getLiveTvSeriesTimer(currentItem.Id).done(function (item) {
item.RequestedPrePaddingSeconds = $('#txtRequestedPrePaddingSeconds', form).val();
item.RequestedPostPaddingSeconds = $('#txtRequestedPostPaddingSeconds', form).val();
item.RequiredPrePaddingSeconds = $('#txtRequiredPrePaddingSeconds', form).val();
item.RequiredPostPaddingSeconds = $('#txtRequiredPostPaddingSeconds', form).val();
item.Priority = $('#selectPriority', form).val();
ApiClient.updateLiveTvSeriesTimer(item).done(function () {
Dashboard.alert('Timer Saved');
});
});
// Disable default form submission
return false;
}
function reload(page) {
Dashboard.showLoadingMsg();
var id = getParameterByName('id');
apiClient.getLiveTvTimer(id).done(function (result) {
renderTimer(page, result);
});
}
$(document).on('pageinit', "#liveTvSeriesTimerPage", function () {
var page = this;
$('#btnCancelTimer', page).on('click', function () {
deleteTimer(page, currentItem.Id);
});
}).on('pagebeforeshow', "#liveTvSeriesTimerPage", function () {
var page = this;
reload(page);
}).on('pagehide', "#liveTvSeriesTimerPage", function () {
currentItem = null;
});
function liveTvSeriesTimerPage() {
var self = this;
self.onSubmit = onSubmit;
}
window.LiveTvSeriesTimerPage = new liveTvSeriesTimerPage();
})(window, jQuery, document, ApiClient);

View file

@ -1 +1,131 @@

(function ($, document, apiClient) {
function deleteTimer(page, id) {
Dashboard.confirm("Are you sure you wish to cancel this series?", "Confirm Series Timer Cancellation", function (result) {
if (result) {
Dashboard.showLoadingMsg();
ApiClient.cancelLiveTvSeriesTimer(id).done(function () {
Dashboard.alert('Series Timer deleted');
reload(page);
});
}
});
}
function renderTimers(page, timers) {
var html = '';
var cssClass = "detailTable";
html += '<div class="detailTableContainer"><table class="' + cssClass + '">';
html += '<tr>';
html += '<th class="tabletColumn">&nbsp;</th>';
html += '<th>Name</th>';
html += '<th class="desktopColumn">Channel</th>';
html += '<th>Start</th>';
html += '<th>End</th>';
html += '<th class="tabletColumn">Days</th>';
html += '</tr>';
for (var i = 0, length = timers.length; i < length; i++) {
var timer = timers[i];
html += '<tr>';
html += '<td class="tabletColumn">';
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>';
html += '<a href="livetvseriestimer.html?id=' + timer.Id + '">' + timer.Name + '</a>';
html += '</td>';
html += '<td class="desktopColumn">';
if (timer.ChannelId) {
html += '<a href="livetvchannel.html?id=' + timer.ChannelId + '">' + timer.ChannelName + '</a>';
}
html += '</td>';
var startDate = timer.StartDate;
var endDate = timer.StartDate;
try {
startDate = parseISO8601Date(startDate, { toLocal: true });
} catch (err) {
}
try {
endDate = parseISO8601Date(endDate, { toLocal: true });
} catch (err) {
}
html += '<td>' + startDate.toLocaleDateString() + '</td>';
html += '<td>' + endDate.toLocaleDateString() + '</td>';
html += '<td class="tabletColumn">';
if (timer.DayPattern) {
html += timer.DayPattern;
}
else {
var days = timer.Days || [];
html += days.join(', ');
}
html += '</td>';
html += '</tr>';
}
html += '</table></div>';
var elem = $('#items', page).html(html).trigger('create');
$('.btnDeleteTimer', elem).on('click', function () {
var id = this.getAttribute('data-timerid');
deleteTimer(page, id);
});
Dashboard.hideLoadingMsg();
}
function reload(page) {
Dashboard.showLoadingMsg();
apiClient.getLiveTvSeriesTimers().done(function (result) {
renderTimers(page, result.Items);
});
}
$(document).on('pagebeforeshow', "#liveTvSeriesTimersPage", function () {
var page = this;
reload(page);
});
})(jQuery, document, ApiClient);

View file

@ -1,4 +1,4 @@
(function ($, document, apiClient) {
(function (window, $, document, apiClient) {
var currentItem;
@ -12,7 +12,7 @@
ApiClient.cancelLiveTvTimer(id).done(function () {
Dashboard.alert('Timer deleted');
Dashboard.alert('Timer cancelled.');
reload(page);
});
@ -26,7 +26,7 @@
currentItem = item;
$('.program', page).html(item.Name);
$('.channel', page).html(item.ChannelName);
$('.channel', page).html('<a href="livetvchannel.html?id=' + item.ChannelId + '">' + item.ChannelName + '</a>').trigger('create');
$('.overview', page).html(item.Overview || '');
$('#txtRequestedPrePaddingSeconds', page).val(item.RequestedPrePaddingSeconds);
@ -47,6 +47,29 @@
Dashboard.hideLoadingMsg();
}
function onSubmit() {
Dashboard.showLoadingMsg();
var form = this;
apiClient.getLiveTvTimer(currentItem.Id).done(function (item) {
item.RequestedPrePaddingSeconds = $('#txtRequestedPrePaddingSeconds', form).val();
item.RequestedPostPaddingSeconds = $('#txtRequestedPostPaddingSeconds', form).val();
item.RequiredPrePaddingSeconds = $('#txtRequiredPrePaddingSeconds', form).val();
item.RequiredPostPaddingSeconds = $('#txtRequiredPostPaddingSeconds', form).val();
ApiClient.updateLiveTvTimer(item).done(function() {
Dashboard.alert('Timer Saved');
});
});
// Disable default form submission
return false;
}
function reload(page) {
@ -81,5 +104,14 @@
currentItem = null;
});
function liveTvTimerPage() {
})(jQuery, document, ApiClient);
var self = this;
self.onSubmit = onSubmit;
}
window.LiveTvTimerPage = new liveTvTimerPage();
})(window, jQuery, document, ApiClient);