add custom intros path

This commit is contained in:
Luke Pulverenti 2014-09-22 20:04:50 -04:00
parent f03d5f6fd2
commit 26ac527517
4 changed files with 55 additions and 18 deletions

View File

@ -51,7 +51,7 @@
<label for="txtDownloadSizeLimit">${LabelChannelDownloadSizeLimit}</label>
<input type="number" id="txtDownloadSizeLimit" pattern="[0-9]*" min="0.1" step=".1" data-mini="true" />
<div class="fieldDescription">${LabelChannelDownloadSizeLimitHelp}</div>
<div class="fieldDescription" style="margin-top: 5px;"><a href="supporter.html">${ButtonLearnMore}</a></div>
<div class="fieldDescription"><a href="supporter.html">${ButtonLearnMore}</a></div>
</li>
<li>
<label for="txtDownloadAge">${LabelChannelDownloadAge}</label>

View File

@ -18,9 +18,7 @@
<form class="cinemaModeConfigurationForm">
<p>${CinemaModeConfigurationHelp}</p>
<p><a href="supporter.html">${ButtonThisFeatureRequiresSupporter}</a></p>
<br />
<div>
<div style="margin-top:2em;">
<fieldset data-role="controlgroup">
<legend>${LabelEnableCinemaModeFor}</legend>
<label for="chkMovies">${OptionMovies}</label>
@ -30,27 +28,36 @@
</fieldset>
</div>
<br />
<div>
<fieldset data-role="controlgroup">
<legend>${LabelEnableTheFollowingIntros}</legend>
<label for="chkMyMovieTrailers">${OptionTrailersFromMyMovies}</label>
<input type="checkbox" id="chkMyMovieTrailers" />
<label for="chkUpcomingTheaterTrailers">${OptionUpcomingMoviesInTheaters}</label>
<input type="checkbox" id="chkUpcomingTheaterTrailers" />
</fieldset>
<div class="fieldDescription">${LabelEnableTheFollowingIntrosHelp}</div>
</div>
<br />
<ul data-role="listview" class="ulForm">
<li>
<label for="chkUnwatchedOnly">${LabelLimitIntrosToUnwatchedContent}</label>
<input type="checkbox" id="chkUnwatchedOnly" data-mini="true" />
<label for="chkMyMovieTrailers">${OptionTrailersFromMyMovies}</label>
<input type="checkbox" id="chkMyMovieTrailers" data-mini="true" />
<div class="fieldDescription">${OptionTrailersFromMyMoviesHelp}</div>
<div class="fieldDescription"><a href="http://mediabrowser.tv/community/index.php?/topic/674-media-files-folders-structure/" target="_blank">${ButtonLearnMore}</a></div>
</li>
<li>
<label for="chkUpcomingTheaterTrailers">${OptionUpcomingMoviesInTheaters}</label>
<input type="checkbox" id="chkUpcomingTheaterTrailers" data-mini="true" />
<div class="fieldDescription">${LabelThisFeatureRequiresSupporterHelp}</div>
<div class="fieldDescription"><a href="supporter.html">${ButtonLearnMore}</a></div>
</li>
<li>
<label for="chkEnableParentalControl">${LabelEnableIntroParentalControl}</label>
<input type="checkbox" id="chkEnableParentalControl" data-mini="true" />
<div class="fieldDescription">${LabelEnableIntroParentalControlHelp}</div>
</li>
<li>
<label for="chkUnwatchedOnly">${LabelLimitIntrosToUnwatchedContent}</label>
<input type="checkbox" id="chkUnwatchedOnly" data-mini="true" />
</li>
<li>
<label for="txtCustomIntrosPath">${LabelCustomIntrosPath}</label>
<div style="display: inline-block; width: 92%;">
<input type="text" id="txtCustomIntrosPath" />
</div>
<button id="btnSelectCustomIntrosPath" type="button" data-icon="search" data-iconpos="notext" data-inline="true">${ButtonSelectDirectory}</button>
<div class="fieldDescription">${LabelCustomIntrosPathHelp}</div>
</li>
</ul>
<br />
<ul data-role="listview" class="ulForm">

View File

@ -274,6 +274,10 @@ h1 .imageLink {
border-radius: 5px;
}
.fieldDescription + .fieldDescription {
margin-top: 5px;
}
.ulForm {
margin-bottom: 20px !important;
}

View File

@ -11,10 +11,34 @@
$('#chkUnwatchedOnly', page).checked(!config.EnableIntrosForWatchedContent).checkboxradio('refresh');
$('#chkEnableParentalControl', page).checked(config.EnableIntrosParentalControl).checkboxradio('refresh');
$('#txtCustomIntrosPath', page).val(config.CustomIntroPath || '');
Dashboard.hideLoadingMsg();
}
$(document).on('pageshow', "#cinemaModeConfigurationPage", function () {
$(document).on('pageinit', "#cinemaModeConfigurationPage", function () {
var page = this;
$('#btnSelectCustomIntrosPath', page).on("click.selectDirectory", function () {
var picker = new DirectoryBrowser(page);
picker.show({
callback: function (path) {
if (path) {
$('#txtCustomIntrosPath', page).val(path);
}
picker.close();
},
header: Globalize.translate('HeaderSelectCustomIntrosPath')
});
});
}).on('pageshow', "#cinemaModeConfigurationPage", function () {
Dashboard.showLoadingMsg();
@ -41,6 +65,8 @@
ApiClient.getNamedConfiguration("cinemamode").done(function (config) {
config.CustomIntroPath = $('#txtCustomIntrosPath', page).val();
config.EnableIntrosForMovies = $('#chkMovies', page).checked();
config.EnableIntrosForEpisodes = $('#chkEpisodes', page).checked();
config.EnableIntrosFromMoviesInLibrary = $('#chkMyMovieTrailers', page).checked();