mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update library setup
This commit is contained in:
parent
273da03c0f
commit
99d3154872
10 changed files with 101 additions and 45 deletions
|
@ -9,7 +9,11 @@
|
|||
var form = this;
|
||||
var dlg = $(form).parents('paper-dialog')[0];
|
||||
|
||||
ApiClient.addVirtualFolder($('#txtValue', form).val(), $('#selectCollectionType', form).val(), currentOptions.refresh).done(function () {
|
||||
var name = $('#txtValue', form).val();
|
||||
var type = $('#selectCollectionType', form).val();
|
||||
var path = $('#txtPath', form).val();
|
||||
|
||||
ApiClient.addVirtualFolder(name, type, currentOptions.refresh, path).done(function () {
|
||||
|
||||
hasChanges = true;
|
||||
PaperDialogHelper.close(dlg);
|
||||
|
@ -37,7 +41,49 @@
|
|||
|
||||
function initEditor(page, collectionTypeOptions) {
|
||||
|
||||
$('#selectCollectionType', page).html(getCollectionTypeOptionsHtml(collectionTypeOptions)).val('');
|
||||
$('#selectCollectionType', page).html(getCollectionTypeOptionsHtml(collectionTypeOptions)).val('').on('change', function () {
|
||||
|
||||
var dlg = $(this).parents('paper-dialog')[0];
|
||||
|
||||
var index = this.selectedIndex;
|
||||
if (index != -1) {
|
||||
|
||||
var name = this.options[index].innerHTML
|
||||
.replace('*', '')
|
||||
.replace('&', '&');
|
||||
|
||||
var value = this.value;
|
||||
|
||||
$('#txtValue', dlg).val(name);
|
||||
|
||||
var folderOption = collectionTypeOptions.filter(function (i) {
|
||||
|
||||
return i.value == value;
|
||||
|
||||
})[0];
|
||||
|
||||
$('.collectionTypeFieldDescription', dlg).html(folderOption.message || '');
|
||||
}
|
||||
});
|
||||
|
||||
$('#btnSelectPath').on('click', function () {
|
||||
|
||||
require(['directorybrowser'], function (directoryBrowser) {
|
||||
|
||||
var picker = new directoryBrowser();
|
||||
|
||||
picker.show({
|
||||
|
||||
callback: function (path) {
|
||||
if (path) {
|
||||
$('#txtPath', page).val(path);
|
||||
}
|
||||
picker.close();
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('form', page).off('submit', onSubmit).on('submit', onSubmit);
|
||||
}
|
||||
|
@ -66,7 +112,7 @@
|
|||
HttpClient.send({
|
||||
|
||||
type: 'GET',
|
||||
url: 'components/medialibraryeditor/medialibraryeditor.template.html'
|
||||
url: 'components/medialibrarycreator/medialibrarycreator.template.html'
|
||||
|
||||
}).done(function (template) {
|
||||
|
||||
|
@ -96,7 +142,7 @@
|
|||
|
||||
$(dlg).on('iron-overlay-closed', onDialogClosed);
|
||||
|
||||
PaperDialogHelper.openWithHash(dlg, 'medialibraryeditor');
|
||||
PaperDialogHelper.openWithHash(dlg, 'medialibrarycreator');
|
||||
|
||||
$('.btnCloseDialog', dlg).on('click', function () {
|
||||
|
|
@ -6,9 +6,14 @@
|
|||
<div class="collectionTypeFieldDescription fieldDescription">
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
<div>
|
||||
<paper-input type="text" id="txtValue" required="required" label="${LabelName}"></paper-input>
|
||||
</p>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<button type="submit" class="clearButton" data-role="none">
|
Loading…
Add table
Add a link
Reference in a new issue