1
0
Fork 0
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:
MrTimscampi 2020-07-27 08:06:46 +02:00
parent 454b81a037
commit 5e1b6acffe
126 changed files with 2 additions and 2127 deletions

View file

@ -14,7 +14,6 @@ import dom from 'dom';
import recordingHelper from 'recordingHelper';
function playAllFromHere(card, serverId, queue) {
const parent = card.parentNode;
const className = card.classList.length ? (`.${card.classList[0]}`) : '';
const cards = parent.querySelectorAll(`${className}[data-id]`);
@ -36,17 +35,14 @@ import recordingHelper from 'recordingHelper';
const itemsContainer = dom.parentWithClass(card, 'itemsContainer');
if (itemsContainer && itemsContainer.fetchData) {
const queryOptions = queue ? { StartIndex: startIndex } : {};
return itemsContainer.fetchData(queryOptions).then(result => {
if (queue) {
return playbackManager.queue({
items: result.Items
});
} else {
return playbackManager.play({
items: result.Items,
startIndex: startIndex
@ -65,7 +61,6 @@ import recordingHelper from 'recordingHelper';
serverId: serverId
});
} else {
return playbackManager.play({
ids: ids,
serverId: serverId,
@ -75,15 +70,12 @@ import recordingHelper from 'recordingHelper';
}
function showProgramDialog(item) {
import('recordingCreator').then(({default:recordingCreator}) => {
recordingCreator.show(item.Id, item.ServerId);
});
}
function getItem(button) {
button = dom.parentWithAttribute(button, 'data-id');
const serverId = button.getAttribute('data-serverid');
const id = button.getAttribute('data-id');
@ -101,7 +93,6 @@ import recordingHelper from 'recordingHelper';
}
function notifyRefreshNeeded(childElement, itemsContainer) {
itemsContainer = itemsContainer || dom.parentWithAttribute(childElement, 'is', 'emby-itemscontainer');
if (itemsContainer) {
@ -110,9 +101,7 @@ import recordingHelper from 'recordingHelper';
}
function showContextMenu(card, options) {
getItem(card).then(item => {
const playlistId = card.getAttribute('data-playlistid');
const collectionId = card.getAttribute('data-collectionid');
@ -122,7 +111,6 @@ import recordingHelper from 'recordingHelper';
}
import('itemContextMenu').then(({default: itemContextMenu}) => {
connectionManager.getApiClient(item.ServerId).getCurrentUser().then(user => {
itemContextMenu.show(Object.assign({
item: item,
@ -135,7 +123,6 @@ import recordingHelper from 'recordingHelper';
user: user
}, options || {})).then(result => {
if (result.command === 'playallfromhere' || result.command === 'queueallfromhere') {
executeAction(card, options.positionTo, result.command);
} else if (result.updated || result.deleted) {
@ -148,7 +135,6 @@ import recordingHelper from 'recordingHelper';
}
function getItemInfoFromCard(card) {
return {
Type: card.getAttribute('data-type'),
Id: card.getAttribute('data-id'),
@ -166,11 +152,9 @@ import recordingHelper from 'recordingHelper';
}
function showPlayMenu(card, target) {
const item = getItemInfoFromCard(card);
import('playMenu').then(({default: playMenu}) => {
playMenu.show({
item: item,
@ -186,7 +170,6 @@ import recordingHelper from 'recordingHelper';
}
function executeAction(card, target, action) {
target = target || card;
let id = card.getAttribute('data-id');
@ -208,13 +191,11 @@ import recordingHelper from 'recordingHelper';
}
if (action === 'link') {
appRouter.showItem(item, {
context: card.getAttribute('data-context'),
parentId: card.getAttribute('data-parentid')
});
} else if (action === 'programdialog') {
showProgramDialog(item);
} else if (action === 'instantmix') {
playbackManager.instantMix({
@ -222,7 +203,6 @@ import recordingHelper from 'recordingHelper';
ServerId: serverId
});
} else if (action === 'play' || action === 'resume') {
const startPositionTicks = parseInt(card.getAttribute('data-positionticks') || '0');
playbackManager.play({
@ -231,7 +211,6 @@ import recordingHelper from 'recordingHelper';
serverId: serverId
});
} else if (action === 'queue') {
if (playbackManager.isPlaying()) {
playbackManager.queue({
ids: [playableItemId],
@ -253,7 +232,6 @@ import recordingHelper from 'recordingHelper';
} else if (action === 'record') {
onRecordCommand(serverId, id, type, card.getAttribute('data-timerid'), card.getAttribute('data-seriestimerid'));
} else if (action === 'menu') {
const options = target.getAttribute('data-playoptions') === 'false' ?
{
shuffle: false,
@ -279,7 +257,6 @@ import recordingHelper from 'recordingHelper';
} else if (action === 'addtoplaylist') {
getItem(target).then(addToPlaylist);
} else if (action === 'custom') {
const customAction = target.getAttribute('data-customaction');
card.dispatchEvent(new CustomEvent(`action-${customAction}`, {
@ -294,7 +271,6 @@ import recordingHelper from 'recordingHelper';
function addToPlaylist(item) {
import('playlistEditor').then(({default: playlistEditor}) => {
new playlistEditor().show({
items: [item.Id],
serverId: item.ServerId
@ -304,7 +280,6 @@ import recordingHelper from 'recordingHelper';
}
function playTrailer(item) {
const apiClient = connectionManager.getApiClient(item.ServerId);
apiClient.getLocalTrailers(apiClient.getCurrentUserId(), item.Id).then(trailers => {
@ -313,28 +288,23 @@ import recordingHelper from 'recordingHelper';
}
function editItem(item, serverId) {
const apiClient = connectionManager.getApiClient(serverId);
return new Promise((resolve, reject) => {
const serverId = apiClient.serverInfo().Id;
if (item.Type === 'Timer') {
if (item.ProgramId) {
import('recordingCreator').then(({default: recordingCreator}) => {
recordingCreator.show(item.ProgramId, serverId).then(resolve, reject);
});
} else {
import('recordingEditor').then(({default: recordingEditor}) => {
recordingEditor.show(item.Id, serverId).then(resolve, reject);
});
}
} else {
import('metadataEditor').then(({default: metadataEditor}) => {
metadataEditor.show(item.Id, serverId).then(resolve, reject);
});
}
@ -342,20 +312,16 @@ import recordingHelper from 'recordingHelper';
}
function onRecordCommand(serverId, id, type, timerId, seriesTimerId) {
if (type === 'Program' || timerId || seriesTimerId) {
const programId = type === 'Program' ? id : null;
recordingHelper.toggleRecording(serverId, programId, timerId, seriesTimerId);
}
}
export function onClick(e) {
const card = dom.parentWithClass(e.target, 'itemAction');
if (card) {
let actionElement = card;
let action = actionElement.getAttribute('data-action');
@ -377,11 +343,9 @@ import recordingHelper from 'recordingHelper';
}
function onCommand(e) {
const cmd = e.detail.command;
if (cmd === 'play' || cmd === 'resume' || cmd === 'record' || cmd === 'menu' || cmd === 'info') {
const target = e.target;
const card = dom.parentWithClass(target, 'itemAction') || dom.parentWithAttribute(target, 'data-id');
@ -394,7 +358,6 @@ import recordingHelper from 'recordingHelper';
}
export function on(context, options) {
options = options || {};
if (options.click !== false) {
@ -417,7 +380,6 @@ import recordingHelper from 'recordingHelper';
}
export function getShortcutAttributesHtml(item, serverId) {
let html = `data-id="${item.Id}" data-serverid="${serverId || item.ServerId}" data-type="${item.Type}" data-mediatype="${item.MediaType}" data-channelid="${item.ChannelId}" data-isfolder="${item.IsFolder}"`;
const collectionType = item.CollectionType;