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

@ -23,10 +23,8 @@ function getOsdElementHtml() {
}
function ensureOsdElement() {
var elem = osdElement;
if (!elem) {
enableAnimation = browser.supportsCssAnimation();
elem = document.createElement('div');
@ -50,7 +48,6 @@ function onHideComplete() {
var hideTimeout;
function showOsd() {
clearHideTimeout();
var elem = osdElement;
@ -79,12 +76,10 @@ function clearHideTimeout() {
}
function hideOsd() {
clearHideTimeout();
var elem = osdElement;
if (elem) {
if (enableAnimation) {
// trigger reflow
void elem.offsetWidth;
@ -108,7 +103,6 @@ function setIcon(iconElement, icon) {
}
function updateElementsFromPlayer(brightness) {
if (iconElement) {
if (brightness >= 80) {
setIcon(iconElement, 'brightness_high');
@ -124,7 +118,6 @@ function updateElementsFromPlayer(brightness) {
}
function releaseCurrentPlayer() {
var player = currentPlayer;
if (player) {
@ -135,7 +128,6 @@ function releaseCurrentPlayer() {
}
function onBrightnessChanged(e) {
var player = this;
ensureOsdElement();
@ -146,7 +138,6 @@ function onBrightnessChanged(e) {
}
function bindToPlayer(player) {
if (player === currentPlayer) {
return;
}

View file

@ -1,5 +1,4 @@
export function getNowPlayingNames(nowPlayingItem, includeNonNameInfo) {
var topItem = nowPlayingItem;
var bottomItem = null;
var topText = nowPlayingItem.Name;
@ -25,7 +24,6 @@ export function getNowPlayingNames(nowPlayingItem, includeNonNameInfo) {
var bottomText = '';
if (nowPlayingItem.ArtistItems && nowPlayingItem.ArtistItems.length) {
bottomItem = {
Id: nowPlayingItem.ArtistItems[0].Id,
Name: nowPlayingItem.ArtistItems[0].Name,
@ -36,9 +34,7 @@ export function getNowPlayingNames(nowPlayingItem, includeNonNameInfo) {
bottomText = nowPlayingItem.ArtistItems.map(function (a) {
return a.Name;
}).join(', ');
} else if (nowPlayingItem.Artists && nowPlayingItem.Artists.length) {
bottomText = nowPlayingItem.Artists.join(', ');
} else if (nowPlayingItem.SeriesName || nowPlayingItem.Album) {
bottomText = topText;

File diff suppressed because it is too large Load diff

View file

@ -14,7 +14,6 @@ function onOrientationChangeError(err) {
}
events.on(playbackManager, 'playbackstart', function (e, player, state) {
var isLocalVideo = player.isLocalPlayer && !player.isExternalPlayer && playbackManager.isPlayingVideo(player);
if (isLocalVideo && layoutManager.mobile) {
@ -22,7 +21,6 @@ events.on(playbackManager, 'playbackstart', function (e, player, state) {
var lockOrientation = screen.lockOrientation || screen.mozLockOrientation || screen.msLockOrientation || (screen.orientation && screen.orientation.lock);
if (lockOrientation) {
try {
var promise = lockOrientation('landscape');
if (promise.then) {
@ -39,9 +37,7 @@ events.on(playbackManager, 'playbackstart', function (e, player, state) {
});
events.on(playbackManager, 'playbackstop', function (e, playbackStopInfo) {
if (orientationLocked && !playbackStopInfo.nextMediaType) {
/* eslint-disable-next-line compat/compat */
var unlockOrientation = screen.unlockOrientation || screen.mozUnlockOrientation || screen.msUnlockOrientation || (screen.orientation && screen.orientation.unlock);

View file

@ -8,7 +8,6 @@ import globalize from 'globalize';
import appHost from 'apphost';
function mirrorItem(info, player) {
var item = info.item;
playbackManager.displayContent({
@ -21,9 +20,7 @@ function mirrorItem(info, player) {
}
function mirrorIfEnabled(info) {
if (info && playbackManager.enableDisplayMirroring()) {
var getPlayerInfo = playbackManager.getPlayerInfo();
if (getPlayerInfo) {
@ -39,9 +36,7 @@ function emptyCallback() {
}
function getTargetSecondaryText(target) {
if (target.user) {
return target.user.Name;
}
@ -49,7 +44,6 @@ function getTargetSecondaryText(target) {
}
function getIcon(target) {
var deviceType = target.deviceType;
if (!deviceType && target.isLocalPlayer) {
@ -67,7 +61,6 @@ function getIcon(target) {
}
switch (deviceType) {
case 'smartphone':
return 'smartphone';
case 'tablet':
@ -84,7 +77,6 @@ function getIcon(target) {
}
export function show(button) {
var currentPlayerInfo = playbackManager.getPlayerInfo();
if (currentPlayerInfo) {
@ -99,9 +91,7 @@ export function show(button) {
loading.show();
playbackManager.getTargets().then(function (targets) {
var menuItems = targets.map(function (t) {
var name = t.name;
if (t.appName && t.appName !== t.name) {
@ -115,11 +105,9 @@ export function show(button) {
secondaryText: getTargetSecondaryText(t),
icon: getIcon(t)
};
});
import('actionsheet').then(({default: actionsheet}) => {
loading.hide();
var menuOptions = {
@ -138,7 +126,6 @@ export function show(button) {
}
actionsheet.show(menuOptions).then(function (id) {
var target = targets.filter(function (t) {
return t.id === id;
})[0];
@ -146,7 +133,6 @@ export function show(button) {
playbackManager.trySetActivePlayer(target.playerName, target);
mirrorIfEnabled();
}, emptyCallback);
});
});
@ -164,11 +150,8 @@ function showActivePlayerMenu(playerInfo) {
}
function disconnectFromPlayer(currentDeviceName) {
if (playbackManager.getSupportedCommands().indexOf('EndSession') !== -1) {
import('dialog').then(({default: dialog}) => {
var menuItems = [];
menuItems.push({
@ -186,7 +169,6 @@ function disconnectFromPlayer(currentDeviceName) {
}).then(function (id) {
switch (id) {
case 'yes':
playbackManager.getCurrentPlayer().endSession();
playbackManager.setDefaultPlayerActive();
@ -198,17 +180,13 @@ function disconnectFromPlayer(currentDeviceName) {
break;
}
});
});
} else {
playbackManager.setDefaultPlayerActive();
}
}
function showActivePlayerMenuInternal(dialogHelper, playerInfo) {
var html = '';
var dialogOptions = {
@ -234,7 +212,6 @@ function showActivePlayerMenuInternal(dialogHelper, playerInfo) {
html += '<div>';
if (playerInfo.supportedCommands.indexOf('DisplayContent') !== -1) {
html += '<label class="checkboxContainer">';
var checkedHtml = playbackManager.enableDisplayMirroring() ? ' checked' : '';
html += '<input type="checkbox" is="emby-checkbox" class="chkMirror"' + checkedHtml + '/>';
@ -293,7 +270,6 @@ function onMirrorChange() {
}
document.addEventListener('viewshow', function (e) {
var state = e.detail.state || {};
var item = state.item;

View file

@ -5,7 +5,6 @@ import globalize from 'globalize';
import qualityoptions from 'qualityoptions';
function showQualityMenu(player, btn) {
var videoStream = playbackManager.currentMediaSource(player).MediaStreams.filter(function (stream) {
return stream.Type === 'Video';
})[0];

View file

@ -1,5 +1,4 @@
export function getDisplayPlayMethod(session) {
if (!session.NowPlayingItem) {
return null;
}

View file

@ -3,16 +3,13 @@ define([], function () {
var currentId = 0;
function addUniquePlaylistItemId(item) {
if (!item.PlaylistItemId) {
item.PlaylistItemId = 'playlistItem' + currentId;
currentId++;
}
}
function findPlaylistIndex(playlistItemId, list) {
for (var i = 0, length = list.length; i < length; i++) {
if (list[i].PlaylistItemId === playlistItemId) {
return i;
@ -23,7 +20,6 @@ define([], function () {
}
function PlayQueueManager() {
this._sortedPlaylist = [];
this._playlist = [];
this._repeatMode = 'RepeatNone';
@ -35,11 +31,9 @@ define([], function () {
};
PlayQueueManager.prototype.setPlaylist = function (items) {
items = items.slice(0);
for (var i = 0, length = items.length; i < length; i++) {
addUniquePlaylistItemId(items[i]);
}
@ -49,9 +43,7 @@ define([], function () {
};
PlayQueueManager.prototype.queue = function (items) {
for (var i = 0, length = items.length; i < length; i++) {
addUniquePlaylistItemId(items[i]);
this._playlist.push(items[i]);
@ -105,7 +97,6 @@ define([], function () {
var length;
for (i = 0, length = items.length; i < length; i++) {
addUniquePlaylistItemId(items[i]);
}
@ -121,12 +112,10 @@ define([], function () {
};
PlayQueueManager.prototype.getCurrentPlaylistIndex = function () {
return findPlaylistIndex(this.getCurrentPlaylistItemId(), this._playlist);
};
PlayQueueManager.prototype.getCurrentItem = function () {
var index = findPlaylistIndex(this.getCurrentPlaylistItemId(), this._playlist);
return index === -1 ? null : this._playlist[index];
@ -137,12 +126,10 @@ define([], function () {
};
PlayQueueManager.prototype.setPlaylistState = function (playlistItemId, playlistIndex) {
this._currentPlaylistItemId = playlistItemId;
};
PlayQueueManager.prototype.setPlaylistIndex = function (playlistIndex) {
if (playlistIndex < 0) {
this.setPlaylistState(null);
} else {
@ -151,7 +138,6 @@ define([], function () {
};
PlayQueueManager.prototype.removeFromPlaylist = function (playlistItemIds) {
if (this._playlist.length <= playlistItemIds.length) {
return {
result: 'empty'
@ -180,7 +166,6 @@ define([], function () {
}
PlayQueueManager.prototype.movePlaylistItem = function (playlistItemId, newIndex) {
var playlist = this.getPlaylist();
var oldIndex;
@ -213,7 +198,6 @@ define([], function () {
};
PlayQueueManager.prototype.reset = function () {
this._sortedPlaylist = [];
this._playlist = [];
this._currentPlaylistItemId = null;
@ -265,13 +249,11 @@ define([], function () {
};
PlayQueueManager.prototype.getNextItemInfo = function () {
var newIndex;
var playlist = this.getPlaylist();
var playlistLength = playlist.length;
switch (this.getRepeatMode()) {
case 'RepeatOne':
newIndex = this.getCurrentPlaylistIndex();
break;

View file

@ -23,10 +23,8 @@ function getOsdElementHtml() {
}
function ensureOsdElement() {
var elem = osdElement;
if (!elem) {
enableAnimation = browser.supportsCssAnimation();
elem = document.createElement('div');
@ -50,7 +48,6 @@ function onHideComplete() {
var hideTimeout;
function showOsd() {
clearHideTimeout();
var elem = osdElement;
@ -79,12 +76,10 @@ function clearHideTimeout() {
}
function hideOsd() {
clearHideTimeout();
var elem = osdElement;
if (elem) {
if (enableAnimation) {
// trigger reflow
void elem.offsetWidth;
@ -103,7 +98,6 @@ function hideOsd() {
}
function updatePlayerVolumeState(isMuted, volume) {
if (iconElement) {
iconElement.classList.remove('volume_off', 'volume_up');
iconElement.classList.add(isMuted ? 'volume_off' : 'volume_up');
@ -114,7 +108,6 @@ function updatePlayerVolumeState(isMuted, volume) {
}
function releaseCurrentPlayer() {
var player = currentPlayer;
if (player) {
@ -125,7 +118,6 @@ function releaseCurrentPlayer() {
}
function onVolumeChanged(e) {
var player = this;
ensureOsdElement();
@ -136,7 +128,6 @@ function onVolumeChanged(e) {
}
function bindToPlayer(player) {
if (player === currentPlayer) {
return;
}