mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Disallow block padding
This commit is contained in:
parent
454b81a037
commit
5e1b6acffe
126 changed files with 2 additions and 2127 deletions
|
@ -30,16 +30,13 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function closeDialog(isSubmitted) {
|
||||
|
||||
if (isDialog()) {
|
||||
dialogHelper.close(currentContext);
|
||||
}
|
||||
}
|
||||
|
||||
function submitUpdatedItem(form, item) {
|
||||
|
||||
function afterContentTypeUpdated() {
|
||||
|
||||
require(['toast'], function (toast) {
|
||||
toast(globalize.translate('MessageItemSaved'));
|
||||
});
|
||||
|
@ -51,11 +48,9 @@ import 'flexStyles';
|
|||
const apiClient = getApiClient();
|
||||
|
||||
apiClient.updateItem(item).then(function () {
|
||||
|
||||
const newContentType = form.querySelector('#selectContentType').value || '';
|
||||
|
||||
if ((metadataEditorInfo.ContentType || '') !== newContentType) {
|
||||
|
||||
apiClient.ajax({
|
||||
|
||||
url: apiClient.getUrl('Items/' + item.Id + '/ContentType', {
|
||||
|
@ -67,11 +62,9 @@ import 'flexStyles';
|
|||
}).then(function () {
|
||||
afterContentTypeUpdated();
|
||||
});
|
||||
|
||||
} else {
|
||||
afterContentTypeUpdated();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -83,13 +76,9 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function getAlbumArtists(form) {
|
||||
|
||||
return form.querySelector('#txtAlbumArtist').value.trim().split(';').filter(function (s) {
|
||||
|
||||
return s.length > 0;
|
||||
|
||||
}).map(function (a) {
|
||||
|
||||
return {
|
||||
Name: a
|
||||
};
|
||||
|
@ -97,13 +86,9 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function getArtists(form) {
|
||||
|
||||
return form.querySelector('#txtArtist').value.trim().split(';').filter(function (s) {
|
||||
|
||||
return s.length > 0;
|
||||
|
||||
}).map(function (a) {
|
||||
|
||||
return {
|
||||
Name: a
|
||||
};
|
||||
|
@ -111,7 +96,6 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function getDateValue(form, element, property) {
|
||||
|
||||
let val = form.querySelector(element).value;
|
||||
|
||||
if (!val) {
|
||||
|
@ -119,14 +103,12 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
if (currentItem[property]) {
|
||||
|
||||
const date = datetime.parseISO8601Date(currentItem[property], true);
|
||||
|
||||
const parts = date.toISOString().split('T');
|
||||
|
||||
// If the date is the same, preserve the time
|
||||
if (parts[0].indexOf(val) === 0) {
|
||||
|
||||
const iso = parts[1];
|
||||
|
||||
val += 'T' + iso;
|
||||
|
@ -137,7 +119,6 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function onSubmit(e) {
|
||||
|
||||
loading.show();
|
||||
|
||||
const form = this;
|
||||
|
@ -198,14 +179,12 @@ import 'flexStyles';
|
|||
item.PreferredMetadataCountryCode = form.querySelector('#selectCountry').value;
|
||||
|
||||
if (currentItem.Type === 'Person') {
|
||||
|
||||
const placeOfBirth = form.querySelector('#txtPlaceOfBirth').value;
|
||||
|
||||
item.ProductionLocations = placeOfBirth ? [placeOfBirth] : [];
|
||||
}
|
||||
|
||||
if (currentItem.Type === 'Series') {
|
||||
|
||||
// 600000000
|
||||
const seriesRuntime = form.querySelector('#txtSeriesRuntime').value;
|
||||
item.RunTimeTicks = seriesRuntime ? (seriesRuntime * 600000000) : null;
|
||||
|
@ -248,11 +227,8 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function editPerson(context, person, index) {
|
||||
|
||||
require(['personEditor'], function (personEditor) {
|
||||
|
||||
personEditor.show(person).then(function (updatedPerson) {
|
||||
|
||||
const isNew = index === -1;
|
||||
|
||||
if (isNew) {
|
||||
|
@ -302,7 +278,6 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function onEditorClick(e) {
|
||||
|
||||
const btnRemoveFromEditorList = dom.parentWithClass(e.target, 'btnRemoveFromEditorList');
|
||||
if (btnRemoveFromEditorList) {
|
||||
removeElementFromList(btnRemoveFromEditorList);
|
||||
|
@ -375,12 +350,10 @@ import 'flexStyles';
|
|||
form.addEventListener('submit', onSubmit);
|
||||
|
||||
context.querySelector('#btnAddPerson').addEventListener('click', function (event, data) {
|
||||
|
||||
editPerson(context, {}, -1);
|
||||
});
|
||||
|
||||
context.querySelector('#peopleList').addEventListener('click', function (e) {
|
||||
|
||||
let index;
|
||||
const btnDeletePerson = dom.parentWithClass(e.target, 'btnDeletePerson');
|
||||
if (btnDeletePerson) {
|
||||
|
@ -398,7 +371,6 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function getItem(itemId, serverId) {
|
||||
|
||||
const apiClient = connectionManager.getApiClient(serverId);
|
||||
|
||||
if (itemId) {
|
||||
|
@ -409,7 +381,6 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function getEditorConfig(itemId, serverId) {
|
||||
|
||||
const apiClient = connectionManager.getApiClient(serverId);
|
||||
|
||||
if (itemId) {
|
||||
|
@ -420,13 +391,11 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function populateCountries(select, allCountries) {
|
||||
|
||||
let html = '';
|
||||
|
||||
html += "<option value=''></option>";
|
||||
|
||||
for (let i = 0, length = allCountries.length; i < length; i++) {
|
||||
|
||||
const culture = allCountries[i];
|
||||
|
||||
html += "<option value='" + culture.TwoLetterISORegionName + "'>" + culture.DisplayName + '</option>';
|
||||
|
@ -436,13 +405,11 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function populateLanguages(select, languages) {
|
||||
|
||||
let html = '';
|
||||
|
||||
html += "<option value=''></option>";
|
||||
|
||||
for (let i = 0, length = languages.length; i < length; i++) {
|
||||
|
||||
const culture = languages[i];
|
||||
|
||||
html += "<option value='" + culture.TwoLetterISOLanguageName + "'>" + culture.DisplayName + '</option>';
|
||||
|
@ -452,7 +419,6 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function renderContentTypeOptions(context, metadataInfo) {
|
||||
|
||||
if (!metadataInfo.ContentTypeOptions.length) {
|
||||
hideElement('#fldContentType', context);
|
||||
} else {
|
||||
|
@ -460,9 +426,7 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
const html = metadataInfo.ContentTypeOptions.map(function (i) {
|
||||
|
||||
return '<option value="' + i.Value + '">' + i.Name + '</option>';
|
||||
|
||||
}).join('');
|
||||
|
||||
const selectEl = context.querySelector('#selectContentType');
|
||||
|
@ -471,13 +435,11 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function loadExternalIds(context, item, externalIds) {
|
||||
|
||||
let html = '';
|
||||
|
||||
const providerIds = item.ProviderIds || {};
|
||||
|
||||
for (let i = 0, length = externalIds.length; i < length; i++) {
|
||||
|
||||
const idInfo = externalIds[i];
|
||||
|
||||
const id = 'txt1' + idInfo.Key;
|
||||
|
@ -523,7 +485,6 @@ import 'flexStyles';
|
|||
function hideElement(selector, context, multiple) {
|
||||
context = context || document;
|
||||
if (typeof selector === 'string') {
|
||||
|
||||
const elements = multiple ? context.querySelectorAll(selector) : [context.querySelector(selector)];
|
||||
|
||||
Array.prototype.forEach.call(elements, function (el) {
|
||||
|
@ -542,7 +503,6 @@ import 'flexStyles';
|
|||
function showElement(selector, context, multiple) {
|
||||
context = context || document;
|
||||
if (typeof selector === 'string') {
|
||||
|
||||
const elements = multiple ? context.querySelectorAll(selector) : [context.querySelector(selector)];
|
||||
|
||||
Array.prototype.forEach.call(elements, function (el) {
|
||||
|
@ -744,7 +704,6 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function fillItemInfo(context, item, parentalRatingOptions) {
|
||||
|
||||
let select = context.querySelector('#selectOfficialRating');
|
||||
|
||||
populateRatings(parentalRatingOptions, select, item.OfficialRating);
|
||||
|
@ -866,7 +825,6 @@ import 'flexStyles';
|
|||
context.querySelector('#selectCountry').value = item.PreferredMetadataCountryCode || '';
|
||||
|
||||
if (item.RunTimeTicks) {
|
||||
|
||||
const minutes = item.RunTimeTicks / 600000000;
|
||||
|
||||
context.querySelector('#txtSeriesRuntime').value = Math.round(minutes);
|
||||
|
@ -876,7 +834,6 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function populateRatings(allParentalRatings, select, currentValue) {
|
||||
|
||||
let html = '';
|
||||
|
||||
html += "<option value=''></option>";
|
||||
|
@ -887,7 +844,6 @@ import 'flexStyles';
|
|||
let currentValueFound = false;
|
||||
|
||||
for (let i = 0, length = allParentalRatings.length; i < length; i++) {
|
||||
|
||||
rating = allParentalRatings[i];
|
||||
|
||||
ratings.push({ Name: rating.Name, Value: rating.Name });
|
||||
|
@ -902,7 +858,6 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
for (let i = 0, length = ratings.length; i < length; i++) {
|
||||
|
||||
rating = ratings[i];
|
||||
|
||||
html += "<option value='" + rating.Value + "'>" + rating.Name + '</option>';
|
||||
|
@ -921,7 +876,6 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function populateListView(list, items, sortCallback) {
|
||||
|
||||
items = items || [];
|
||||
if (typeof (sortCallback) === 'undefined') {
|
||||
items.sort(function (a, b) {
|
||||
|
@ -953,14 +907,12 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function populatePeople(context, people) {
|
||||
|
||||
let lastType = '';
|
||||
let html = '';
|
||||
|
||||
const elem = context.querySelector('#peopleList');
|
||||
|
||||
for (let i = 0, length = people.length; i < length; i++) {
|
||||
|
||||
const person = people[i];
|
||||
|
||||
html += '<div class="listItem">';
|
||||
|
@ -990,10 +942,8 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function getLockedFieldsHtml(fields, currentFields) {
|
||||
|
||||
let html = '';
|
||||
for (let i = 0; i < fields.length; i++) {
|
||||
|
||||
const field = fields[i];
|
||||
const name = field.name;
|
||||
const value = field.value || field.name;
|
||||
|
@ -1040,11 +990,9 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function reload(context, itemId, serverId) {
|
||||
|
||||
loading.show();
|
||||
|
||||
Promise.all([getItem(itemId, serverId), getEditorConfig(itemId, serverId)]).then(function (responses) {
|
||||
|
||||
const item = responses[0];
|
||||
metadataEditorInfo = responses[1];
|
||||
|
||||
|
@ -1136,7 +1084,6 @@ import 'flexStyles';
|
|||
|
||||
embed: function (elem, itemId, serverId) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
loading.show();
|
||||
|
||||
import('text!./metadataEditor.template.html').then(({default: template}) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue