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

added cloud sync model objects

This commit is contained in:
Luke Pulverenti 2014-07-21 21:29:06 -04:00
parent 640fc18b21
commit 68e7007105
28 changed files with 373 additions and 456 deletions

View file

@ -12,7 +12,7 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="#" data-role="button" class="ui-btn-active">${TabGeneral}</a>
<a href="notificationsettings.html" data-role="button">${TabNotifications}</a>
<a href="appsplayback.html" data-role="button">${TabResume}</a>
<a href="scheduledtasks.html" data-role="button">${TabScheduledTasks}</a>
<a href="encodingsettings.html" data-role="button">${TabTranscoding}</a>
</div>
<form id="advancedConfigurationForm">
@ -30,7 +30,10 @@
<label for="chkDebugLog">${LabelEnableDebugLogging}</label>
</li>
</ul>
<h2>Updates</h2>
<div data-role="collapsible">
<h2>${HeaderAutomaticUpdates}</h2>
<div>
<ul data-role="listview" class="ulForm">
<li>
<label for="selectAutomaticUpdateLevel">${LabelAutomaticUpdateLevel}</label>
@ -51,6 +54,36 @@
</div>
</li>
</ul>
</div>
</div>
<div data-role="collapsible">
<h2>${HeaderResumeSettings}</h2>
<div>
<ul data-role="listview" class="ulForm">
<li>
<label for="txtMinResumePct">${LabelMinResumePercentage}</label>
<input type="number" id="txtMinResumePct" name="txtMinResumePct" pattern="[0-9]*" required="required" min="0" max="100" />
<div class="fieldDescription">
${LabelMinResumePercentageHelp}
</div>
</li>
<li>
<label for="txtMaxResumePct">${LabelMaxResumePercentage}</label>
<input type="number" id="txtMaxResumePct" name="txtMaxResumePct" pattern="[0-9]*" required="required" min="1" max="100" />
<div class="fieldDescription">
${LabelMaxResumePercentageHelp}
</div>
</li>
<li>
<label for="txtMinResumeDuration">${LabelMinResumeDuration}</label>
<input type="number" id="txtMinResumeDuration" name="txtMinResumeDuration" pattern="[0-9]*" required="required" min="0" />
<div class="fieldDescription">
${LabelMinResumeDurationHelp}
</div>
</li>
</ul>
</div>
</div>
<br />
<ul data-role="listview" class="ulForm">
<li>

View file

@ -1,60 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>${TitleAdvanced}</title>
</head>
<body>
<div id="appsPlaybackPage" data-role="page" class="page type-interior advancedConfigurationPage">
<div data-role="content">
<div class="content-primary">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="advanced.html" data-role="button">${TabGeneral}</a>
<a href="notificationsettings.html" data-role="button">${TabNotifications}</a>
<a href="#" class="ui-btn-active" data-role="button">${TabResume}</a>
<a href="encodingsettings.html" data-role="button">${TabTranscoding}</a>
</div>
<form class="appsPlaybackForm">
<ul data-role="listview" class="ulForm">
<li>
<label for="txtMinResumePct">${LabelMinResumePercentage}</label>
<input type="number" id="txtMinResumePct" name="txtMinResumePct" pattern="[0-9]*" required="required" min="0" max="100" />
<div class="fieldDescription">
${LabelMinResumePercentageHelp}
</div>
</li>
<li>
<label for="txtMaxResumePct">${LabelMaxResumePercentage}</label>
<input type="number" id="txtMaxResumePct" name="txtMaxResumePct" pattern="[0-9]*" required="required" min="1" max="100" />
<div class="fieldDescription">
${LabelMaxResumePercentageHelp}
</div>
</li>
<li>
<label for="txtMinResumeDuration">${LabelMinResumeDuration}</label>
<input type="number" id="txtMinResumeDuration" name="txtMinResumeDuration" pattern="[0-9]*" required="required" min="0" />
<div class="fieldDescription">
${LabelMinResumeDurationHelp}
</div>
</li>
<li>
<button type="submit" data-theme="b" data-icon="check">
${ButtonSave}
</button>
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete">
${ButtonCancel}
</button>
</li>
</ul>
</form>
</div>
</div>
<script type="text/javascript">
$('.appsPlaybackForm').off('submit', AppsPlaybackPage.onSubmit).on('submit', AppsPlaybackPage.onSubmit);
</script>
</div>
</body>
</html>

View file

@ -16,7 +16,7 @@
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
padding: 6px 12px;
padding: 5px 12px;
text-align: center;
text-decoration: none !important;
-moz-user-select: none;

View file

@ -12,7 +12,7 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="advanced.html" data-role="button">${TabGeneral}</a>
<a href="notificationsettings.html" data-role="button">${TabNotifications}</a>
<a href="appsplayback.html" data-role="button">${TabResume}</a>
<a href="scheduledtasks.html" data-role="button">${TabScheduledTasks}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabTranscoding}</a>
</div>
@ -23,19 +23,23 @@
<input type="radio" name="radioEncodingQuality" class="radioEncodingQuality" id="radioAuto" value="Auto">
<label for="radioAuto">
${OptionAutomatic}<br />
<span style="font-weight: normal;">${OptionAutomaticTranscodingHelp}</span></label>
<span style="font-weight: normal;">${OptionAutomaticTranscodingHelp}</span>
</label>
<input type="radio" name="radioEncodingQuality" class="radioEncodingQuality" id="radioHighSpeed" value="HighSpeed">
<label for="radioHighSpeed">
${OptionHighSpeedTranscoding}<br />
<span style="font-weight: normal;">${OptionHighSpeedTranscodingHelp}</span></label>
<span style="font-weight: normal;">${OptionHighSpeedTranscodingHelp}</span>
</label>
<input type="radio" name="radioEncodingQuality" class="radioEncodingQuality" id="radioHighQuality" value="HighQuality">
<label for="radioHighQuality">
${OptionHighQualityTranscoding}<br />
<span style="font-weight: normal;">${OptionHighQualityTranscodingHelp}</span></label>
<span style="font-weight: normal;">${OptionHighQualityTranscodingHelp}</span>
</label>
<input type="radio" name="radioEncodingQuality" class="radioEncodingQuality" id="radioMaxQuality" value="MaxQuality">
<label for="radioMaxQuality">
${OptionMaxQualityTranscoding}<br />
<span style="font-weight: normal;">${OptionMaxQualityTranscodingHelp}</span></label>
<span style="font-weight: normal;">${OptionMaxQualityTranscodingHelp}</span>
</label>
</fieldset>
<br />

Binary file not shown.

View file

@ -257,7 +257,7 @@
<div id="scenesCollapsible" style="display: none;" class="detailSection">
<div class="detailSectionHeader">
${HeaderScenes}
<a class="detailSectionHeaderButton" href="metadatachapters.html" data-role="button" data-icon="gear" data-iconpos="notext" data-inline="true" title="${ButtonSettings}">${ButtonSettings}</a>
<a class="detailSectionHeaderButton" href="metadataadvanced.html" data-role="button" data-icon="gear" data-iconpos="notext" data-inline="true" title="${ButtonSettings}">${ButtonSettings}</a>
</div>
<div id="scenesContent" class="detailSectionContent"></div>
</div>

View file

@ -12,7 +12,6 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="#" data-role="button" class="ui-btn-active">${TabBasics}</a>
<a href="metadataimages.html" data-role="button">${TabServices}</a>
<a href="metadatachapters.html" data-role="button">${TabChapters}</a>
<a href="metadatasubtitles.html" data-role="button">${TabSubtitles}</a>
<a href="metadataxbmc.html" data-role="button">${TabXbmcMetadata}</a>
<a href="metadataadvanced.html" data-role="button">${TabAdvanced}</a>

View file

@ -12,7 +12,6 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="metadata.html" data-role="button">${TabBasics}</a>
<a href="metadataimages.html" data-role="button">${TabServices}</a>
<a href="metadatachapters.html" data-role="button">${TabChapters}</a>
<a href="metadatasubtitles.html" data-role="button">${TabSubtitles}</a>
<a href="metadataxbmc.html" data-role="button">${TabXbmcMetadata}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabAdvanced}</a>
@ -20,6 +19,20 @@
<form id="advancedMetadataConfigurationForm">
<ul data-role="listview" class="ulForm">
<li>
<label for="txtMetadataPath">${LabelMetadataPath}</label>
<div style="display: inline-block; width: 92%;">
<input type="text" id="txtMetadataPath" name="txtMetadataPath" />
</div>
<button id="btnSelectMetadataPath" type="button" data-icon="search" data-iconpos="notext" data-inline="true">${ButtonSelectDirectory}</button>
<div class="fieldDescription">${LabelMetadataPathHelp}</div>
</li>
</ul>
<div data-role="collapsible">
<h2>${HeaderAutomaticUpdates}</h2>
<div>
<ul data-role="listview" class="ulForm">
<li>
<input type="checkbox" id="chkEnableFanartUpdates" data-mini="true" />
@ -37,17 +50,55 @@
<div class="fieldDescription">${LabelAutomaticUpdatesTvdbHelp}</div>
</li>
</ul>
</div>
</div>
<div data-role="collapsible">
<h2>${HeaderChapters}</h2>
<div>
<br/>
<div style="display: none;">
<p>${HeaderChapterDownloadingHelp}</p>
<div class="chapterDownloadSettings" style="display: none;">
<fieldset data-role="controlgroup">
<legend>${HeaderDownloadChaptersFor}</legend>
<input type="checkbox" data-mini="true" id="chkDownloadChapterMovies" />
<label for="chkDownloadChapterMovies">${OptionMovies}</label>
<input type="checkbox" data-mini="true" id="chkDownloadChapterEpisodes" />
<label for="chkDownloadChapterEpisodes">${OptionEpisodes}</label>
</fieldset>
<br />
<div class="chapterFetchers">
</div>
<br />
<br />
</div>
<div class="noChapterProviders" style="display: none; color: green;">
<p>${MessageNoChapterProviders}</p>
<br />
</div>
</div>
<ul data-role="listview" class="ulForm">
<li>
<label for="txtMetadataPath">${LabelMetadataPath}</label>
<div style="display: inline-block; width: 92%;">
<input type="text" id="txtMetadataPath" name="txtMetadataPath" />
<label>${HeaderExtractChapterImagesFor}</label>
<div data-role="controlgroup">
<input type="checkbox" data-mini="true" id="chkChaptersMovies" />
<label for="chkChaptersMovies">${OptionMovies}</label>
<input type="checkbox" data-mini="true" id="chkChaptersEpisodes" />
<label for="chkChaptersEpisodes">${OptionEpisodes}</label>
<input type="checkbox" data-mini="true" id="chkChaptersOtherVideos" />
<label for="chkChaptersOtherVideos">${OptionOtherVideos}</label>
<div class="fieldDescription">${ExtractChapterImagesHelp}</div>
</div>
<button id="btnSelectMetadataPath" type="button" data-icon="search" data-iconpos="notext" data-inline="true">${ButtonSelectDirectory}</button>
<div class="fieldDescription">${LabelMetadataPathHelp}</div>
</li>
</ul>
</div>
</div>
<br/><br />
<ul data-role="listview" class="ulForm">
<li>
<button type="submit" data-theme="b" data-icon="check" data-mini="true">

View file

@ -1,84 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>${TitleMetadata}</title>
</head>
<body>
<div id="chapterMetadataConfigurationPage" data-role="page" class="page type-interior metadataConfigurationPage">
<div data-role="content">
<div class="content-primary">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="metadata.html" data-role="button">${TabBasics}</a>
<a href="metadataimages.html" data-role="button">${TabServices}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabChapters}</a>
<a href="metadatasubtitles.html" data-role="button">${TabSubtitles}</a>
<a href="metadataxbmc.html" data-role="button">${TabXbmcMetadata}</a>
<a href="metadataadvanced.html" data-role="button">${TabAdvanced}</a>
</div>
<form class="metadataChaptersForm">
<div style="display: none;">
<p>${HeaderChapterDownloadingHelp}</p>
<div class="chapterDownloadSettings" style="display: none;">
<fieldset data-role="controlgroup">
<legend>${HeaderDownloadChaptersFor}</legend>
<input type="checkbox" data-mini="true" id="chkDownloadChapterMovies" />
<label for="chkDownloadChapterMovies">${OptionMovies}</label>
<input type="checkbox" data-mini="true" id="chkDownloadChapterEpisodes" />
<label for="chkDownloadChapterEpisodes">${OptionEpisodes}</label>
</fieldset>
<br />
<div class="chapterFetchers">
</div>
<br />
<br />
</div>
<div class="noChapterProviders" style="display: none; color: green;">
<p>${MessageNoChapterProviders}</p>
<br />
</div>
</div>
<ul data-role="listview" class="ulForm">
<li>
<label>${HeaderExtractChapterImagesFor}</label>
<div data-role="controlgroup">
<input type="checkbox" data-mini="true" id="chkChaptersMovies" />
<label for="chkChaptersMovies">${OptionMovies}</label>
<input type="checkbox" data-mini="true" id="chkChaptersEpisodes" />
<label for="chkChaptersEpisodes">${OptionEpisodes}</label>
<input type="checkbox" data-mini="true" id="chkChaptersOtherVideos" />
<label for="chkChaptersOtherVideos">${OptionOtherVideos}</label>
<div class="fieldDescription">${ExtractChapterImagesHelp}</div>
</div>
</li>
</ul>
<br />
<ul data-role="listview" class="ulForm">
<li>
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
${ButtonSave}
</button>
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete" data-mini="true">
${ButtonCancel}
</button>
</li>
</ul>
</form>
</div>
</div>
<script type="text/javascript">
$('.metadataChaptersForm').off('submit', MetadataChaptersPage.onSubmit).on('submit', MetadataChaptersPage.onSubmit);
</script>
</div>
</body>
</html>

View file

@ -12,7 +12,6 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true" style="margin-bottom: 20px!important;">
<a href="metadata.html" data-role="button">${TabBasics}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabServices}</a>
<a href="metadatachapters.html" data-role="button">${TabChapters}</a>
<a href="metadatasubtitles.html" data-role="button">${TabSubtitles}</a>
<a href="metadataxbmc.html" data-role="button">${TabXbmcMetadata}</a>
<a href="metadataadvanced.html" data-role="button">${TabAdvanced}</a>

View file

@ -12,7 +12,6 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="metadata.html" data-role="button">${TabBasics}</a>
<a href="metadataimages.html" data-role="button">${TabServices}</a>
<a href="metadatachapters.html" data-role="button">${TabChapters}</a>
<a href="#" class="ui-btn-active" data-role="button">${TabSubtitles}</a>
<a href="metadataxbmc.html" data-role="button">${TabXbmcMetadata}</a>
<a href="metadataadvanced.html" data-role="button">${TabAdvanced}</a>

View file

@ -12,7 +12,6 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="metadata.html" data-role="button">${TabBasics}</a>
<a href="metadataimages.html" data-role="button">${TabServices}</a>
<a href="metadatachapters.html" data-role="button">${TabChapters}</a>
<a href="metadatasubtitles.html" data-role="button">${TabSubtitles}</a>
<a href="#" class="ui-btn-active" data-role="button">${TabXbmcMetadata}</a>
<a href="metadataadvanced.html" data-role="button">${TabAdvanced}</a>

View file

@ -18,7 +18,7 @@
<div data-role="content">
<table class="ehsContent">
<table class="ehsContent portraitEhsContent">
<tr>
<td>
<h1 class="listHeader">${HeaderLatestMovies}</h1>

View file

@ -12,7 +12,7 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="advanced.html" data-role="button">${TabGeneral}</a>
<a href="notificationsettings.html" data-role="button" class="ui-btn-active">${TabNotifications}</a>
<a href="appsplayback.html" data-role="button">${TabResume}</a>
<a href="scheduledtasks.html" data-role="button">${TabScheduledTasks}</a>
<a href="encodingsettings.html" data-role="button">${TabTranscoding}</a>
</div>

View file

@ -12,7 +12,7 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="advanced.html" data-role="button">${TabGeneral}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabNotifications}</a>
<a href="appsplayback.html" data-role="button">${TabResume}</a>
<a href="scheduledtasks.html" data-role="button">${TabScheduledTasks}</a>
<a href="encodingsettings.html" data-role="button">${TabTranscoding}</a>
</div>

View file

@ -1,13 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
<title>${TitleAdvanced}</title>
</head>
<body>
<div id="scheduledTaskPage" data-role="page" class="page type-interior">
<div id="scheduledTaskPage" data-role="page" class="page type-interior advancedConfigurationPage">
<div data-role="content">
<div class="content-primary">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="advanced.html" data-role="button">${TabGeneral}</a>
<a href="notificationsettings.html" data-role="button">${TabNotifications}</a>
<a href="scheduledtasks.html" data-role="button" class="ui-btn-active">${TabScheduledTasks}</a>
<a href="encodingsettings.html" data-role="button">${TabTranscoding}</a>
</div>
<div class="readOnlyContent">
<h2 class="taskName"></h2>
<p id="pTaskDescription"></p>
<p>
<button type="button" data-icon="plus" onclick="ScheduledTaskPage.showAddTriggerPopup();">

View file

@ -1,12 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>${ScheduledTasksTitle}</title>
<title>${TitleAdvanced}</title>
</head>
<body>
<div id="scheduledTasksPage" data-role="page" class="page type-interior">
<div id="scheduledTasksPage" data-role="page" class="page type-interior advancedConfigurationPage">
<div data-role="content">
<div class="content-primary">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="advanced.html" data-role="button">${TabGeneral}</a>
<a href="notificationsettings.html" data-role="button">${TabNotifications}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabScheduledTasks}</a>
<a href="encodingsettings.html" data-role="button">${TabTranscoding}</a>
</div>
<div class="readOnlyContent">
<p>${ScheduledTasksHelp}</p>
<div id="divScheduledTasks"></div>

View file

@ -28,6 +28,10 @@
$('#chkRunAtStartup', page).checked(config.RunAtStartup).checkboxradio("refresh");
$('#txtMinResumePct', page).val(config.MinResumePct);
$('#txtMaxResumePct', page).val(config.MaxResumePct);
$('#txtMinResumeDuration', page).val(config.MinResumeDurationSeconds);
Dashboard.hideLoadingMsg();
}
@ -80,6 +84,10 @@
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

@ -1,43 +0,0 @@
(function ($, document, window) {
$(document).on('pageshow', "#appsPlaybackPage", function () {
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getServerConfiguration().done(function (config) {
$('#txtMinResumePct', page).val(config.MinResumePct);
$('#txtMaxResumePct', page).val(config.MaxResumePct);
$('#txtMinResumeDuration', page).val(config.MinResumeDurationSeconds);
$('input:first', page).focus();
Dashboard.hideLoadingMsg();
});
});
window.AppsPlaybackPage = {
onSubmit: function () {
var form = this;
Dashboard.showLoadingMsg();
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;
}
};
})($, document, window);

View file

@ -101,7 +101,7 @@
var userId = Dashboard.getCurrentUserId();
var val = store.getItem('enableBackdrops', userId);
var val = store.getItem('enableBackdrops-' + userId);
// For bandwidth
return val == '1' || (val != '0' && !$.browser.mobile);

View file

@ -1225,11 +1225,21 @@
var errorMsg = Globalize.translate('MessageErrorPlayingVideo');
if (item.Type == "TvChannel") {
errorMsg += "<br/><br/>" + Globalize.translate('MessageEnsureOpenTuner');
errorMsg += '<p>';
errorMsg += Globalize.translate('MessageEnsureOpenTuner');
errorMsg += '</p>';
}
if ($.browser.msie && !$.browser.mobile) {
errorMsg += '<p>';
errorMsg += '<a href="https://tools.google.com/dlpage/webmmf/" target="_blank">';
errorMsg += Globalize.translate('MessageInternetExplorerWebm');
errorMsg += '</a>';
errorMsg += '</p>';
}
Dashboard.alert({
title: 'Video Error',
title: Globalize.translate('HeaderVideoError'),
message: errorMsg
});

View file

@ -895,6 +895,12 @@
self.currentItem = null;
self.currentMediaSource = null;
// When the browser regains focus it may start auto-playing the last video
if ($.browser.safari) {
elem.src = 'files/dummy.mp4';
elem.play();
}
}).trigger("ended");
} else {

View file

@ -1,19 +1,125 @@
var AdvancedMetadataConfigurationPage = {
(function (window, $) {
onPageShow: function () {
function loadAdvancedConfig(page, config) {
Dashboard.showLoadingMsg();
$('#chkEnableTmdbPersonUpdates', page).checked(config.EnableTmdbUpdates).checkboxradio("refresh");
$('#chkEnableTvdbUpdates', page).checked(config.EnableTvDbUpdates).checkboxradio("refresh");
$('#chkEnableFanartUpdates', page).checked(config.EnableFanArtUpdates).checkboxradio("refresh");
$('#txtMetadataPath', page).val(config.MetadataPath || '');
var page = this;
Dashboard.hideLoadingMsg();
}
ApiClient.getServerConfiguration().done(function (configuration) {
function loadChapters(page, config, providers) {
AdvancedMetadataConfigurationPage.load(page, configuration);
if (providers.length) {
$('.noChapterProviders', page).hide();
$('.chapterDownloadSettings', page).show();
} else {
$('.noChapterProviders', page).show();
$('.chapterDownloadSettings', page).hide();
}
$('#chkChaptersMovies', page).checked(config.EnableMovieChapterImageExtraction).checkboxradio("refresh");
$('#chkChaptersEpisodes', page).checked(config.EnableEpisodeChapterImageExtraction).checkboxradio("refresh");
$('#chkChaptersOtherVideos', page).checked(config.EnableOtherVideoChapterImageExtraction).checkboxradio("refresh");
$('#chkDownloadChapterMovies', page).checked(config.DownloadMovieChapters).checkboxradio("refresh");
$('#chkDownloadChapterEpisodes', page).checked(config.DownloadEpisodeChapters).checkboxradio("refresh");
renderChapterFetchers(page, config, providers);
Dashboard.hideLoadingMsg();
}
function renderChapterFetchers(page, config, plugins) {
var html = '';
if (!plugins.length) {
$('.chapterFetchers', page).html(html).hide().trigger('create');
return;
}
var i, length, plugin, id;
html += '<div class="ui-controlgroup-label" style="margin-bottom:0;padding-left:2px;">';
html += Globalize.translate('LabelChapterDownloaders');
html += '</div>';
html += '<div style="display:inline-block;width: 75%;vertical-align:top;">';
html += '<div data-role="controlgroup" class="chapterFetcherGroup">';
for (i = 0, length = plugins.length; i < length; i++) {
plugin = plugins[i];
id = 'chkChapterFetcher' + i;
var isChecked = config.DisabledFetchers.indexOf(plugin.Name) == -1 ? ' checked="checked"' : '';
html += '<input class="chkChapterFetcher" type="checkbox" name="' + id + '" id="' + id + '" data-pluginname="' + plugin.Name + '" data-mini="true"' + isChecked + '>';
html += '<label for="' + id + '">' + plugin.Name + '</label>';
}
html += '</div>';
html += '</div>';
if (plugins.length > 1) {
html += '<div style="display:inline-block;vertical-align:top;margin-left:5px;">';
for (i = 0, length = plugins.length; i < length; i++) {
html += '<div style="margin:6px 0;">';
if (i == 0) {
html += '<button data-inline="true" disabled="disabled" class="btnUp" data-pluginindex="' + i + '" type="button" data-icon="arrow-u" data-mini="true" data-iconpos="notext" style="margin: 0 1px;">Up</button>';
html += '<button data-inline="true" class="btnDown" data-pluginindex="' + i + '" type="button" data-icon="arrow-d" data-mini="true" data-iconpos="notext" style="margin: 0 1px;">Down</button>';
} else if (i == (plugins.length - 1)) {
html += '<button data-inline="true" class="btnUp" data-pluginindex="' + i + '" type="button" data-icon="arrow-u" data-mini="true" data-iconpos="notext" style="margin: 0 1px;">Up</button>';
html += '<button data-inline="true" disabled="disabled" class="btnDown" data-pluginindex="' + i + '" type="button" data-icon="arrow-d" data-mini="true" data-iconpos="notext" style="margin: 0 1px;">Down</button>';
}
else {
html += '<button data-inline="true" class="btnUp" data-pluginindex="' + i + '" type="button" data-icon="arrow-u" data-mini="true" data-iconpos="notext" style="margin: 0 1px;">Up</button>';
html += '<button data-inline="true" class="btnDown" data-pluginindex="' + i + '" type="button" data-icon="arrow-d" data-mini="true" data-iconpos="notext" style="margin: 0 1px;">Down</button>';
}
html += '</div>';
}
}
html += '</div>';
html += '<div class="fieldDescription">' + Globalize.translate('LabelChapterDownloadersHelp') + '</div>';
var elem = $('.chapterFetchers', page).html(html).show().trigger('create');
$('.btnDown', elem).on('click', function () {
var index = parseInt(this.getAttribute('data-pluginindex'));
var elemToMove = $('.chapterFetcherGroup .ui-checkbox', page)[index];
var insertAfter = $(elemToMove).next('.ui-checkbox')[0];
elemToMove.parentNode.removeChild(elemToMove);
$(elemToMove).insertAfter(insertAfter);
$('.chapterFetcherGroup', page).controlgroup('destroy').controlgroup();
});
},
onPageInit: function () {
$('.btnUp', elem).on('click', function () {
var index = parseInt(this.getAttribute('data-pluginindex'));
var elemToMove = $('.chapterFetcherGroup .ui-checkbox', page)[index];
var insertBefore = $(elemToMove).prev('.ui-checkbox')[0];
elemToMove.parentNode.removeChild(elemToMove);
$(elemToMove).insertBefore(insertBefore);
$('.chapterFetcherGroup', page).controlgroup('destroy').controlgroup();
});
}
$(document).on('pageinit', "#advancedMetadataConfigurationPage", function () {
var page = this;
@ -36,22 +142,27 @@
instruction: Globalize.translate('HeaderSelectMetadataPathHelp')
});
});
},
load: function (page, config) {
}).on('pageshow', "#advancedMetadataConfigurationPage", function () {
$('#chkEnableTmdbPersonUpdates', page).checked(config.EnableTmdbUpdates).checkboxradio("refresh");
$('#chkEnableTvdbUpdates', page).checked(config.EnableTvDbUpdates).checkboxradio("refresh");
$('#chkEnableFanartUpdates', page).checked(config.EnableFanArtUpdates).checkboxradio("refresh");
$('#txtMetadataPath', page).val(config.MetadataPath || '');
var page = this;
Dashboard.hideLoadingMsg();
},
ApiClient.getServerConfiguration().done(function (configuration) {
onSubmit: function () {
var form = this;
loadAdvancedConfig(page, configuration);
Dashboard.showLoadingMsg();
});
var promise1 = ApiClient.getNamedConfiguration("chapters");
var promise2 = ApiClient.getJSON(ApiClient.getUrl("Providers/Chapters"));
$.when(promise1, promise2).done(function (response1, response2) {
loadChapters(page, response1[0], response2[0]);
});
});
function saveAdvancedConfig(form) {
ApiClient.getServerConfiguration().done(function (config) {
@ -62,10 +173,49 @@
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});
}
function saveChapters(form) {
ApiClient.getNamedConfiguration("chapters").done(function (config) {
config.EnableMovieChapterImageExtraction = $('#chkChaptersMovies', form).checked();
config.EnableEpisodeChapterImageExtraction = $('#chkChaptersEpisodes', form).checked();
config.EnableOtherVideoChapterImageExtraction = $('#chkChaptersOtherVideos', form).checked();
config.DownloadMovieChapters = $('#chkDownloadChapterMovies', form).checked();
config.DownloadEpisodeChapters = $('#chkDownloadChapterEpisodes', form).checked();
config.DisabledFetchers = $('.chkChapterFetcher:not(:checked)', form).get().map(function (c) {
return c.getAttribute('data-pluginname');
});
config.FetcherOrder = $('.chkChapterFetcher', form).get().map(function (c) {
return c.getAttribute('data-pluginname');
});
ApiClient.updateNamedConfiguration("chapters", config);
});
}
window.AdvancedMetadataConfigurationPage = {
onSubmit: function () {
var form = this;
Dashboard.showLoadingMsg();
saveAdvancedConfig(form);
saveChapters(form);
// Disable default form submission
return false;
}
};
};
})(window, jQuery);
$(document).on('pageinit', "#advancedMetadataConfigurationPage", AdvancedMetadataConfigurationPage.onPageInit).on('pageshow', "#advancedMetadataConfigurationPage", AdvancedMetadataConfigurationPage.onPageShow);

View file

@ -1,168 +0,0 @@
(function ($, document, window) {
function loadPage(page, config, providers) {
if (providers.length) {
$('.noChapterProviders', page).hide();
$('.chapterDownloadSettings', page).show();
} else {
$('.noChapterProviders', page).show();
$('.chapterDownloadSettings', page).hide();
}
$('#chkChaptersMovies', page).checked(config.EnableMovieChapterImageExtraction).checkboxradio("refresh");
$('#chkChaptersEpisodes', page).checked(config.EnableEpisodeChapterImageExtraction).checkboxradio("refresh");
$('#chkChaptersOtherVideos', page).checked(config.EnableOtherVideoChapterImageExtraction).checkboxradio("refresh");
$('#chkDownloadChapterMovies', page).checked(config.DownloadMovieChapters).checkboxradio("refresh");
$('#chkDownloadChapterEpisodes', page).checked(config.DownloadEpisodeChapters).checkboxradio("refresh");
renderChapterFetchers(page, config, providers);
Dashboard.hideLoadingMsg();
}
function renderChapterFetchers(page, config, plugins) {
var html = '';
if (!plugins.length) {
$('.chapterFetchers', page).html(html).hide().trigger('create');
return;
}
var i, length, plugin, id;
html += '<div class="ui-controlgroup-label" style="margin-bottom:0;padding-left:2px;">';
html += Globalize.translate('LabelChapterDownloaders');
html += '</div>';
html += '<div style="display:inline-block;width: 75%;vertical-align:top;">';
html += '<div data-role="controlgroup" class="chapterFetcherGroup">';
for (i = 0, length = plugins.length; i < length; i++) {
plugin = plugins[i];
id = 'chkChapterFetcher' + i;
var isChecked = config.DisabledFetchers.indexOf(plugin.Name) == -1 ? ' checked="checked"' : '';
html += '<input class="chkChapterFetcher" type="checkbox" name="' + id + '" id="' + id + '" data-pluginname="' + plugin.Name + '" data-mini="true"' + isChecked + '>';
html += '<label for="' + id + '">' + plugin.Name + '</label>';
}
html += '</div>';
html += '</div>';
if (plugins.length > 1) {
html += '<div style="display:inline-block;vertical-align:top;margin-left:5px;">';
for (i = 0, length = plugins.length; i < length; i++) {
html += '<div style="margin:6px 0;">';
if (i == 0) {
html += '<button data-inline="true" disabled="disabled" class="btnUp" data-pluginindex="' + i + '" type="button" data-icon="arrow-u" data-mini="true" data-iconpos="notext" style="margin: 0 1px;">Up</button>';
html += '<button data-inline="true" class="btnDown" data-pluginindex="' + i + '" type="button" data-icon="arrow-d" data-mini="true" data-iconpos="notext" style="margin: 0 1px;">Down</button>';
} else if (i == (plugins.length - 1)) {
html += '<button data-inline="true" class="btnUp" data-pluginindex="' + i + '" type="button" data-icon="arrow-u" data-mini="true" data-iconpos="notext" style="margin: 0 1px;">Up</button>';
html += '<button data-inline="true" disabled="disabled" class="btnDown" data-pluginindex="' + i + '" type="button" data-icon="arrow-d" data-mini="true" data-iconpos="notext" style="margin: 0 1px;">Down</button>';
}
else {
html += '<button data-inline="true" class="btnUp" data-pluginindex="' + i + '" type="button" data-icon="arrow-u" data-mini="true" data-iconpos="notext" style="margin: 0 1px;">Up</button>';
html += '<button data-inline="true" class="btnDown" data-pluginindex="' + i + '" type="button" data-icon="arrow-d" data-mini="true" data-iconpos="notext" style="margin: 0 1px;">Down</button>';
}
html += '</div>';
}
}
html += '</div>';
html += '<div class="fieldDescription">' + Globalize.translate('LabelChapterDownloadersHelp') + '</div>';
var elem = $('.chapterFetchers', page).html(html).show().trigger('create');
$('.btnDown', elem).on('click', function () {
var index = parseInt(this.getAttribute('data-pluginindex'));
var elemToMove = $('.chapterFetcherGroup .ui-checkbox', page)[index];
var insertAfter = $(elemToMove).next('.ui-checkbox')[0];
elemToMove.parentNode.removeChild(elemToMove);
$(elemToMove).insertAfter(insertAfter);
$('.chapterFetcherGroup', page).controlgroup('destroy').controlgroup();
});
$('.btnUp', elem).on('click', function () {
var index = parseInt(this.getAttribute('data-pluginindex'));
var elemToMove = $('.chapterFetcherGroup .ui-checkbox', page)[index];
var insertBefore = $(elemToMove).prev('.ui-checkbox')[0];
elemToMove.parentNode.removeChild(elemToMove);
$(elemToMove).insertBefore(insertBefore);
$('.chapterFetcherGroup', page).controlgroup('destroy').controlgroup();
});
}
$(document).on('pageshow', "#chapterMetadataConfigurationPage", function () {
Dashboard.showLoadingMsg();
var page = this;
var promise1 = ApiClient.getNamedConfiguration("chapters");
var promise2 = ApiClient.getJSON(ApiClient.getUrl("Providers/Chapters"));
$.when(promise1, promise2).done(function (response1, response2) {
loadPage(page, response1[0], response2[0]);
});
});
function metadataChaptersPage() {
var self = this;
self.onSubmit = function () {
Dashboard.showLoadingMsg();
var form = this;
ApiClient.getNamedConfiguration("chapters").done(function (config) {
config.EnableMovieChapterImageExtraction = $('#chkChaptersMovies', form).checked();
config.EnableEpisodeChapterImageExtraction = $('#chkChaptersEpisodes', form).checked();
config.EnableOtherVideoChapterImageExtraction = $('#chkChaptersOtherVideos', form).checked();
config.DownloadMovieChapters = $('#chkDownloadChapterMovies', form).checked();
config.DownloadEpisodeChapters = $('#chkDownloadChapterEpisodes', form).checked();
config.DisabledFetchers = $('.chkChapterFetcher:not(:checked)', form).get().map(function (c) {
return c.getAttribute('data-pluginname');
});
config.FetcherOrder = $('.chkChapterFetcher', form).get().map(function (c) {
return c.getAttribute('data-pluginname');
});
ApiClient.updateNamedConfiguration("chapters", config).done(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
return false;
};
}
window.MetadataChaptersPage = new metadataChaptersPage();
})(jQuery, document, window);

View file

@ -2,8 +2,8 @@
function loadForm(page, userId, displayPreferences) {
$('#selectThemeSong', page).val(store.getItem('enableThemeSongs', userId) || '').selectmenu("refresh");
$('#selectBackdrop', page).val(store.getItem('enableBackdrops', userId) || '').selectmenu("refresh");
$('#selectThemeSong', page).val(store.getItem('enableThemeSongs-' + userId) || '').selectmenu("refresh");
$('#selectBackdrop', page).val(store.getItem('enableBackdrops-' + userId) || '').selectmenu("refresh");
$('#selectHomeSection1', page).val(displayPreferences.CustomPrefs.home0 || '').selectmenu("refresh");
$('#selectHomeSection2', page).val(displayPreferences.CustomPrefs.home1 || '').selectmenu("refresh");
@ -15,8 +15,8 @@
function saveUser(page, userId, displayPreferences) {
store.setItem('enableThemeSongs', userId, $('#selectThemeSong', page).val());
store.setItem('enableBackdrops', userId, $('#selectBackdrop', page).val());
store.setItem('enableThemeSongs-' + userId, $('#selectThemeSong', page).val());
store.setItem('enableBackdrops-' + userId, $('#selectBackdrop', page).val());
displayPreferences.CustomPrefs.home0 = $('#selectHomeSection1', page).val();
displayPreferences.CustomPrefs.home1 = $('#selectHomeSection2', page).val();

View file

@ -16,9 +16,11 @@
loadScheduledTask: function (task) {
Dashboard.setPageTitle(task.Name);
var page = $.mobile.activePage;
$('#pTaskDescription', $.mobile.activePage).html(task.Description);
$('.taskName', page).html(task.Name);
$('#pTaskDescription', page).html(task.Description);
ScheduledTaskPage.loadTaskTriggers(task);

View file

@ -18,8 +18,7 @@
statusCode: {
401: onAuthFailure,
403: onAuthFailure
401: onAuthFailure
},
error: function (event) {
@ -712,10 +711,6 @@ var Dashboard = {
divider: true,
href: "advanced.html",
selected: page.hasClass("advancedConfigurationPage")
}, {
name: Globalize.translate('TabScheduledTasks'),
href: "scheduledtasks.html",
selected: pageElem.id == "scheduledTasksPage" || pageElem.id == "scheduledTaskPage"
}, {
name: Globalize.translate('TabHelp'),
href: "support.html",

View file

@ -44,7 +44,7 @@
var userId = Dashboard.getCurrentUserId();
var val = store.getItem('enableThemeSongs', userId);
var val = store.getItem('enableThemeSongs-' + userId);
// For bandwidth
return val == '1' || (val != '0' && !$.browser.mobile);