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

add cinema mode feature

This commit is contained in:
Luke Pulverenti 2014-09-22 17:56:54 -04:00
parent 42f0520499
commit f03d5f6fd2
28 changed files with 327 additions and 89 deletions

View file

@ -9,7 +9,7 @@
} else {
$('#windowsStartupDescription', page).hide();
}
if (systemInfo.SupportsAutoRunAtStartup) {
$('#fldRunAtStartup', page).show();
} else {
@ -28,10 +28,6 @@
$('#chkRunAtStartup', page).checked(config.RunAtStartup).checkboxradio("refresh");
$('#txtMinResumePct', page).val(config.MinResumePct);
$('#txtMaxResumePct', page).val(config.MaxResumePct);
$('#txtMinResumeDuration', page).val(config.MinResumeDurationSeconds);
Dashboard.hideLoadingMsg();
}
@ -84,10 +80,6 @@
config.SystemUpdateLevel = $('#selectAutomaticUpdateLevel', form).val();
config.EnableAutomaticRestart = $('#chkEnableAutomaticRestart', form).checked();
config.MinResumePct = $('#txtMinResumePct', form).val();
config.MaxResumePct = $('#txtMaxResumePct', form).val();
config.MinResumeDurationSeconds = $('#txtMinResumeDuration', form).val();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});

View file

@ -0,0 +1,62 @@
(function ($, document, window) {
function loadPage(page, config) {
$('#chkMovies', page).checked(config.EnableIntrosForMovies).checkboxradio('refresh');
$('#chkEpisodes', page).checked(config.EnableIntrosForEpisodes).checkboxradio('refresh');
$('#chkMyMovieTrailers', page).checked(config.EnableIntrosFromMoviesInLibrary).checkboxradio('refresh');
$('#chkUpcomingTheaterTrailers', page).checked(config.EnableIntrosFromUpcomingTrailers).checkboxradio('refresh');
$('#chkUnwatchedOnly', page).checked(!config.EnableIntrosForWatchedContent).checkboxradio('refresh');
$('#chkEnableParentalControl', page).checked(config.EnableIntrosParentalControl).checkboxradio('refresh');
Dashboard.hideLoadingMsg();
}
$(document).on('pageshow', "#cinemaModeConfigurationPage", function () {
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getNamedConfiguration("cinemamode").done(function (config) {
loadPage(page, config);
});
});
function cinemaModeConfigurationPage() {
var self = this;
self.onSubmit = function () {
Dashboard.showLoadingMsg();
var form = this;
var page = $(form).parents('.page');
ApiClient.getNamedConfiguration("cinemamode").done(function (config) {
config.EnableIntrosForMovies = $('#chkMovies', page).checked();
config.EnableIntrosForEpisodes = $('#chkEpisodes', page).checked();
config.EnableIntrosFromMoviesInLibrary = $('#chkMyMovieTrailers', page).checked();
config.EnableIntrosFromUpcomingTrailers = $('#chkUpcomingTheaterTrailers', page).checked();
config.EnableIntrosForWatchedContent = !$('#chkUnwatchedOnly', page).checked();
config.EnableIntrosParentalControl = $('#chkEnableParentalControl', page).checked();
ApiClient.updateNamedConfiguration("cinemamode", config).done(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
return false;
};
}
window.CinemaModeConfigurationPage = new cinemaModeConfigurationPage();
})(jQuery, document, window);

View file

@ -650,8 +650,8 @@
return "<img src='css/images/clients/mbkinect.png' />";
}
if (clientLowered == "xbmc") {
return "<img src='css/images/clients/xbmc.png' />";
if (clientLowered == "kodi" || clientLowered == "xbmc") {
return "<img src='css/images/clients/kodi.png' />";
}
if (clientLowered == "chromecast") {

View file

@ -4,6 +4,8 @@
$('#chkSaveMetadataHidden', page).checked(config.SaveMetadataHidden).checkboxradio("refresh");
$('#chkFindTrailers', page).checked(config.FindInternetTrailers).checkboxradio("refresh");
$('#chkEnableTmdbPersonUpdates', page).checked(config.EnableTmdbUpdates).checkboxradio("refresh");
$('#chkEnableTvdbUpdates', page).checked(config.EnableTvDbUpdates).checkboxradio("refresh");
$('#chkEnableFanartUpdates', page).checked(config.EnableFanArtUpdates).checkboxradio("refresh");
@ -180,6 +182,7 @@
config.SaveMetadataHidden = $('#chkSaveMetadataHidden', form).checked();
config.FindInternetTrailers = $('#chkFindTrailers', form).checked();
config.EnableTvDbUpdates = $('#chkEnableTvdbUpdates', form).checked();
config.EnableTmdbUpdates = $('#chkEnableTmdbPersonUpdates', form).checked();
config.EnableFanArtUpdates = $('#chkEnableFanartUpdates', form).checked();

View file

@ -19,7 +19,7 @@
Dashboard.hideLoadingMsg();
}
$(document).on('pageshow', "#metadataXbmcPage", function () {
$(document).on('pageshow', "#metadataKodiPage", function () {
Dashboard.showLoadingMsg();
@ -34,7 +34,7 @@
});
});
window.XbmcMetadataPage = {
window.KodiMetadataPage = {
onSubmit: function () {

View file

@ -0,0 +1,51 @@
(function ($, document, window) {
function loadPage(page, config) {
$('#txtMinResumePct', page).val(config.MinResumePct);
$('#txtMaxResumePct', page).val(config.MaxResumePct);
$('#txtMinResumeDuration', page).val(config.MinResumeDurationSeconds);
Dashboard.hideLoadingMsg();
}
$(document).on('pageshow', "#playbackConfigurationPage", function () {
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getServerConfiguration().done(function (config) {
loadPage(page, config);
});
});
function playbackConfigurationPage() {
var self = this;
self.onSubmit = function () {
Dashboard.showLoadingMsg();
var form = this;
ApiClient.getServerConfiguration().done(function (config) {
config.MinResumePct = $('#txtMinResumePct', form).val();
config.MaxResumePct = $('#txtMaxResumePct', form).val();
config.MinResumeDurationSeconds = $('#txtMinResumeDuration', form).val();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
return false;
};
}
window.PlaybackConfigurationPage = new playbackConfigurationPage();
})(jQuery, document, window);

View file

@ -693,6 +693,11 @@ var Dashboard = {
href: "metadata.html",
selected: page.hasClass('metadataConfigurationPage')
}, {
name: Globalize.translate('TabPlayback'),
href: "playbackconfiguration.html",
selected: page.hasClass('playbackConfigurationPage')
}, {
divider: true,
name: Globalize.translate('TabAutoOrganize'),
href: "autoorganizelog.html",
selected: page.hasClass("organizePage")