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

fix merge conflicts

This commit is contained in:
Luke Pulverenti 2015-09-20 13:22:34 -04:00
parent 8bf9a6f51e
commit d2773d5fec
2 changed files with 144 additions and 6 deletions

View file

@ -21,10 +21,12 @@
<ul data-role="listview" class="ulForm">
<li>
<paper-input id="txtMetadataPath" label="${LabelMetadataPath}" style="width:85%;display:inline-block;"></paper-input>
<paper-icon-button id="btnSelectMetadataPath" icon="search"></paper-icon-button>
<label for="txtMetadataPath">${LabelMetadataPath}</label>
<div style="display: inline-block; width: 85%;">
<input type="text" id="txtMetadataPath" />
</div>
<button id="btnSelectMetadataPath" type="button" data-icon="search" data-iconpos="notext" data-inline="true">${ButtonSelectDirectory}</button>
<div class="fieldDescription">${LabelMetadataPathHelp}</div>
<br />
</li>
<li>
<label for="chkSaveMetadataHidden">${OptionSaveMetadataAsHidden}</label>
@ -62,6 +64,29 @@
<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" id="chkDownloadChapterMovies" />
<label for="chkDownloadChapterMovies">${OptionMovies}</label>
<input type="checkbox" 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" style="margin-bottom:0!important;">
<li>
<label>${HeaderExtractChapterImagesFor}</label>

View file

@ -21,7 +21,7 @@
function loadMetadataConfig(page, config) {
$('#selectDateAdded', page).val((config.UseFileCreationTimeForDateAdded ? '1' : '0'));
$('#selectDateAdded', page).val((config.UseFileCreationTimeForDateAdded ? '1' : '0')).selectmenu("refresh");
}
function loadTmdbConfig(page, config) {
@ -42,15 +42,115 @@
function loadChapters(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");
$('#chkExtractChaptersDuringLibraryScan', page).checked(config.ExtractDuringLibraryScan).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();
});
}
function onSubmit() {
var form = this;
@ -209,11 +309,24 @@
config.EnableEpisodeChapterImageExtraction = $('#chkChaptersEpisodes', form).checked();
config.EnableOtherVideoChapterImageExtraction = $('#chkChaptersOtherVideos', form).checked();
config.DownloadMovieChapters = $('#chkDownloadChapterMovies', form).checked();
config.DownloadEpisodeChapters = $('#chkDownloadChapterEpisodes', form).checked();
config.ExtractDuringLibraryScan = $('#chkExtractChaptersDuringLibraryScan', 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, jQuery);