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

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