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

update metadata editor

This commit is contained in:
Luke Pulverenti 2016-02-08 13:05:29 -05:00
parent ac9ab5502a
commit b7d63574a3
15 changed files with 121 additions and 85 deletions

View file

@ -65,15 +65,12 @@
require(['prompt'], function (prompt) {
prompt({
text: 'Value:',
callback: function (text) {
if (text == '') return;
var parent = $(source).parents('.editableListviewContainer');
var list = parent.find('.paperList');
var items = editableListViewValues(list);
items.push(text);
populateListView(list[0], items, sortCallback);
}
title: 'Value:'
}).then(function (text) {
var list = $(source).parents('.editableListviewContainer').find('.paperList');
var items = editableListViewValues(list);
items.push(text);
populateListView(list[0], items, sortCallback);
});
});
}
@ -82,6 +79,52 @@
$(source).parents('paper-icon-item').remove();
}
function editPerson(context, person, index) {
$('#popupEditPerson', context).popup("open");
$('#txtPersonName', context).val(person.Name || '');
$('#selectPersonType', context).val(person.Type || '');
$('#txtPersonRole', context).val(person.Role || '');
if (index == null) {
index = '';
}
$("#fldPersonIndex", context).val(index);
}
function savePersonInfo(page) {
$('#popupEditPerson', page).popup("close");
var index = $("#fldPersonIndex", page).val();
var person;
var isNew = true;
if (index) {
isNew = false;
index = parseInt(index);
person = currentItem.People[index];
} else {
person = {};
}
person.Name = $('#txtPersonName', page).val();
person.Type = $('#selectPersonType', page).val();
person.Role = $('#txtPersonRole', page).val();
if (isNew) {
currentItem.People.push(person);
}
populatePeople(page, currentItem.People);
}
function init(context) {
$('.btnCancel', context).on('click', function () {
@ -89,6 +132,15 @@
closeDialog(false);
});
context.querySelector('#chkLockData').addEventListener('click', function (e) {
if (!e.target.checked) {
$('.providerSettingsContainer').show();
} else {
$('.providerSettingsContainer').hide();
}
});
context.addEventListener('click', function (e) {
var btnRemoveFromEditorList = parentWithClass(e.target, 'btnRemoveFromEditorList');
@ -104,6 +156,11 @@
});
$('form', context).off('submit', onSubmit).on('submit', onSubmit);
$("#btnAddPerson", context).on('click', function (event, data) {
editPerson(context, {});
});
}
function getItem(itemId) {
@ -505,9 +562,9 @@
var chkLockData = context.querySelector("#chkLockData");
chkLockData.checked = lockData;
if (chkLockData.checked) {
$('#providerSettingsContainer', context).hide();
$('.providerSettingsContainer', context).hide();
} else {
$('#providerSettingsContainer', context).show();
$('.providerSettingsContainer', context).show();
}
populateInternetProviderSettings(context, item, item.LockedFields);
@ -690,8 +747,6 @@
html += '<paper-icon-button icon="delete" data-index="' + i + '" class="btnRemoveFromEditorList"></paper-icon-button>';
html += '</paper-icon-item>';
//html += '<li data-mini="true"><a class="data">' + items[i] + '</a><a href="#" onclick="EditItemMetadataPage.removeElementFromListview(this)" class="btnRemoveFromEditorList"></a></li>';
}
list.innerHTML = html;
@ -762,7 +817,7 @@
}
function populateInternetProviderSettings(context, item, lockedFields) {
var container = $('#providerSettingsContainer', context);
var container = $('.providerSettingsContainer', context);
lockedFields = lockedFields || new Array();
var metadatafields = [

View file

@ -10,7 +10,7 @@
<div style="padding: 0 0 10px;">
<div id="fldContentType" style="display:none;">
<label for="selectContentType">${LabelContentType}</label>
<label for="selectContentType" class="selectLabel">${LabelContentType}</label>
<select id="selectContentType" data-mini="true"></select>
</div>
<div id="fldPath">
@ -26,7 +26,7 @@
<paper-input id="txtDateAdded" type="date" label="${LabelDateAdded}"></paper-input>
</div>
<div id="fldStatus" style="display: none;margin:1em 0;">
<label for="selectStatus">${LabelStatus}</label>
<label for="selectStatus" class="selectLabel">${LabelStatus}</label>
<select id="selectStatus" data-mini="true"></select>
</div>
<div id="fldArtist" style="display: none;">
@ -111,12 +111,12 @@
</div>
<div id="fldOfficialRating" style="display: none;">
<br />
<label for="selectOfficialRating">${LabelParentalRating}</label>
<label for="selectOfficialRating" class="selectLabel">${LabelParentalRating}</label>
<select id="selectOfficialRating" data-mini="true"></select>
</div>
<div id="fldCustomRating" style="display: none;">
<br />
<label for="selectCustomRating">${LabelCustomRating}</label>
<label for="selectCustomRating" class="selectLabel">${LabelCustomRating}</label>
<select id="selectCustomRating" data-mini="true"></select>
</div>
<div id="fldBudget" style="display: none;">
@ -133,7 +133,7 @@
</div>
<div id="fld3dFormat" style="display: none;">
<br />
<label for="select3dFormat">${Label3DFormat}</label>
<label for="select3dFormat" class="selectLabel">${Label3DFormat}</label>
<select id="select3dFormat" data-mini="true">
<option value=""></option>
<option value="HalfSideBySide">HSBS</option>
@ -202,7 +202,7 @@
<paper-checkbox id="chkDisplaySpecialsInline">${LabelDisplaySpecialsWithinSeasons}</paper-checkbox>
</div>
<div id="fldDisplayOrder" class="fldDisplaySetting">
<label for="selectDisplayOrder" id="labelDisplayOrder">${LabelDisplayOrder}</label>
<label for="selectDisplayOrder" class="selectLabel" id="labelDisplayOrder">${LabelDisplayOrder}</label>
<select id="selectDisplayOrder" data-mini="true"></select>
</div>
</div>
@ -274,23 +274,23 @@
<h1>${HeaderMetadataSettings}</h1>
<div>
<div>
<label for="selectLanguage">${LabelMetadataDownloadLanguage}</label>
<label for="selectLanguage" class="selectLabel">${LabelMetadataDownloadLanguage}</label>
<select id="selectLanguage" data-mini="true"></select>
</div>
<div class="fieldDescription editorfieldDescription">${MessageLeaveEmptyToInherit}</div>
<br />
<div>
<label for="selectCountry">${LabelCountry}</label>
<label for="selectCountry" class="selectLabel">${LabelCountry}</label>
<select id="selectCountry" data-mini="true"></select>
</div>
<div class="fieldDescription editorfieldDescription">${MessageLeaveEmptyToInherit}</div>
<div>
<br /><br />
<paper-checkbox id="chkLockData" onchange="EditItemMetadataPage.setProviderSettingsContainerVisibility(this)">${LabelLockItemToPreventChanges}</paper-checkbox>
<paper-checkbox id="chkLockData">${LabelLockItemToPreventChanges}</paper-checkbox>
</div>
<br />
<div id="providerSettingsContainer" style="display: none">
<div class="providerSettingsContainer" style="display: none">
</div>
</div>
</div>