mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
support null image encoder
This commit is contained in:
parent
6000b2ee0f
commit
b9ad8322dd
17 changed files with 214 additions and 44 deletions
|
@ -106,7 +106,7 @@
|
|||
html += '<div data-role="controlgroup" data-type="horizontal" style="display:inline-block;">';
|
||||
|
||||
html += '<paper-icon-button icon="arrow-back" title="' + Globalize.translate('ButtonPreviousPage') + '" class="btnPreviousPage" ' + (startIndex ? '' : 'disabled') + '></paper-icon-button>';
|
||||
html += '<paper-icon-button icon="arrow-forward" title="' + Globalize.translate('ButtonNextPage') + '" class="btnNextPage" ' + (startIndex + limit > totalRecordCount ? 'disabled' : '') + '></paper-icon-button>';
|
||||
html += '<paper-icon-button icon="arrow-forward" title="' + Globalize.translate('ButtonNextPage') + '" class="btnNextPage" ' + (startIndex + limit >= totalRecordCount ? 'disabled' : '') + '></paper-icon-button>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
|
|
|
@ -3,21 +3,28 @@
|
|||
var currentDeferred;
|
||||
var hasChanges;
|
||||
var currentOptions;
|
||||
var paths = [];
|
||||
|
||||
function onSubmit() {
|
||||
|
||||
if (paths.length == 0) {
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('PleaseAddAtLeastOneFolder')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
var form = this;
|
||||
var dlg = $(form).parents('paper-dialog')[0];
|
||||
|
||||
var name = $('#txtValue', form).val();
|
||||
var type = $('#selectCollectionType', form).val();
|
||||
var path = $('#txtPath', form).val();
|
||||
|
||||
if (type == 'mixed') {
|
||||
type = null;
|
||||
}
|
||||
|
||||
ApiClient.addVirtualFolder(name, type, currentOptions.refresh, path).done(function () {
|
||||
ApiClient.addVirtualFolder(name, type, currentOptions.refresh, paths).done(function () {
|
||||
|
||||
hasChanges = true;
|
||||
PaperDialogHelper.close(dlg);
|
||||
|
@ -74,26 +81,90 @@
|
|||
}
|
||||
});
|
||||
|
||||
$('#btnSelectPath').on('click', function () {
|
||||
$('.btnAddFolder', page).on('click', onAddButtonClick);
|
||||
$('form', page).off('submit', onSubmit).on('submit', onSubmit);
|
||||
}
|
||||
|
||||
require(['directorybrowser'], function (directoryBrowser) {
|
||||
function onAddButtonClick() {
|
||||
|
||||
var picker = new directoryBrowser();
|
||||
var page = $(this).parents('.editorContent')[0];
|
||||
|
||||
picker.show({
|
||||
require(['directorybrowser'], function (directoryBrowser) {
|
||||
|
||||
callback: function (path) {
|
||||
if (path) {
|
||||
$('#txtPath', page).val(path);
|
||||
}
|
||||
picker.close();
|
||||
var picker = new directoryBrowser();
|
||||
|
||||
picker.show({
|
||||
|
||||
callback: function (path) {
|
||||
|
||||
if (path) {
|
||||
addMediaLocation(page, path);
|
||||
}
|
||||
picker.close();
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$('form', page).off('submit', onSubmit).on('submit', onSubmit);
|
||||
function getFolderHtml(path, index) {
|
||||
|
||||
var html = '';
|
||||
|
||||
html += '<paper-icon-item role="menuitem" class="lnkPath">';
|
||||
|
||||
html += '<paper-fab class="listAvatar" style="background:#52B54B;" icon="folder" item-icon></paper-fab>';
|
||||
|
||||
html += '<paper-item-body>';
|
||||
html += path;
|
||||
html += '</paper-item-body>';
|
||||
|
||||
html += '<paper-icon-button icon="remove-circle" class="btnRemovePath" data-index="' + index + '"></paper-icon-button>';
|
||||
|
||||
html += '</paper-icon-item>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function renderPaths(page) {
|
||||
var foldersHtml = paths.map(getFolderHtml).join('');
|
||||
|
||||
var folderList = page.querySelector('.folderList');
|
||||
folderList.innerHTML = foldersHtml;
|
||||
|
||||
if (foldersHtml) {
|
||||
folderList.classList.remove('hide');
|
||||
} else {
|
||||
folderList.classList.add('hide');
|
||||
}
|
||||
|
||||
$(page.querySelectorAll('.btnRemovePath')).on('click', onRemoveClick);
|
||||
}
|
||||
|
||||
function addMediaLocation(page, path) {
|
||||
|
||||
if (paths.filter(function (p) {
|
||||
|
||||
return p.toLowerCase() == path.toLowerCase();
|
||||
|
||||
}).length == 0) {
|
||||
paths.push(path);
|
||||
renderPaths(page);
|
||||
}
|
||||
}
|
||||
|
||||
function onRemoveClick() {
|
||||
|
||||
var button = this;
|
||||
var index = parseInt(button.getAttribute('data-index'));
|
||||
|
||||
var location = paths[index];
|
||||
paths = paths.filter(function (p) {
|
||||
|
||||
return p.toLowerCase() != location.toLowerCase();
|
||||
});
|
||||
var page = $(this).parents('.editorContent')[0];
|
||||
renderPaths(page);
|
||||
}
|
||||
|
||||
function onDialogClosed() {
|
||||
|
@ -156,6 +227,8 @@
|
|||
|
||||
PaperDialogHelper.close(dlg);
|
||||
});
|
||||
|
||||
renderPaths(editorContent);
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -9,11 +9,16 @@
|
|||
<div>
|
||||
<paper-input type="text" id="txtValue" required="required" label="${LabelDisplayName}"></paper-input>
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<paper-input type="text" id="txtPath" required="required" label="${LabelFolder}" style="display: inline-block;width:84%;"></paper-input>
|
||||
<paper-icon-button id="btnSelectPath" icon="search"></paper-icon-button>
|
||||
<div class="fieldDescription">${LabelAdditionalFoldersCanBeAddedHelp}</div>
|
||||
<h1 style="display:inline-block;vertical-align:middle;">${HeadersFolders}</h1>
|
||||
<paper-button raised class="btnAddFolder submit mini" style="margin-left:1em;" title="${ButtonAdd}">
|
||||
<iron-icon icon="add"></iron-icon>
|
||||
<span>${ButtonAdd}</span>
|
||||
</paper-button>
|
||||
</div>
|
||||
<div class="paperList folderList hide" style="padding: .7em 0;"></div>
|
||||
|
||||
<br />
|
||||
<div>
|
||||
<button type="submit" class="clearButton" data-role="none">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue