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

@ -6,7 +6,6 @@ let currentDisplayText = '';
let currentDisplayTextContainer;
function onKeyDown(e) {
if (e.ctrlKey) {
return;
}
@ -21,7 +20,6 @@ function onKeyDown(e) {
let chr = key ? alphanumeric(key) : null;
if (chr) {
chr = chr.toString().toUpperCase();
if (chr.length === 1) {
@ -82,12 +80,10 @@ function onAlphanumericShortcutTimeout() {
}
function selectByShortcutValue(container, value) {
value = value.toUpperCase();
let focusElem;
if (value === '#') {
focusElem = container.querySelector('*[data-prefix]');
}
@ -102,7 +98,6 @@ function selectByShortcutValue(container, value) {
class AlphaNumericShortcuts {
constructor(options) {
this.options = options;
const keyDownHandler = onKeyDown.bind(this);
@ -114,7 +109,6 @@ class AlphaNumericShortcuts {
this.keyDownHandler = keyDownHandler;
}
destroy() {
const keyDownHandler = this.keyDownHandler;
if (keyDownHandler) {

View file

@ -2,7 +2,6 @@ define([], function () {
'use strict';
function isTv() {
// This is going to be really difficult to get right
var userAgent = navigator.userAgent.toLowerCase();
@ -50,7 +49,6 @@ define([], function () {
}
function hasKeyboard(browser) {
if (browser.touch) {
return true;
}

View file

@ -323,7 +323,6 @@ define(['browser'], function (browser) {
// Otherwise with HLS and mp3 audio we're seeing some browsers
// safari is lying
if (supportsAc3(videoTestElement)) {
videoAudioCodecs.push('ac3');
var eAc3 = supportsEac3(videoTestElement);
@ -505,7 +504,6 @@ define(['browser'], function (browser) {
});
['opus', 'mp3', 'mp2', 'aac', 'flac', 'alac', 'webma', 'wma', 'wav', 'ogg', 'oga'].filter(canPlayAudioFormat).forEach(function (audioFormat) {
if (audioFormat === 'mp2') {
profile.DirectPlayProfiles.push({
Container: 'mp2,mp3',
@ -703,7 +701,6 @@ define(['browser'], function (browser) {
if (browser.tizen ||
videoTestElement.canPlayType('video/mp4; codecs="avc1.6e0033"').replace(/no/, '')) {
// These tests are passing in safari, but playback is failing
if (!browser.safari && !browser.iOS && !browser.web0s && !browser.edge && !browser.mobile) {
h264Profiles += '|high 10';

View file

@ -3,7 +3,6 @@ import globalize from 'globalize';
/* eslint-disable indent */
export function parseISO8601Date(s, toLocal) {
// parenthese matches:
// year month day hours minutes seconds
// dotmilliseconds
@ -20,7 +19,6 @@ import globalize from 'globalize';
// "00", "00", ".000", "Z", undefined, undefined, undefined]
if (!d) {
throw "Couldn't parse ISO 8601 date string '" + s + "'";
}
@ -106,7 +104,6 @@ import globalize from 'globalize';
}();
function getOptionList(options) {
const list = [];
for (const i in options) {
@ -120,7 +117,6 @@ import globalize from 'globalize';
}
export function toLocaleString(date, options) {
if (!date) {
throw new Error('date cannot be null');
}
@ -128,7 +124,6 @@ import globalize from 'globalize';
options = options || {};
if (toLocaleTimeStringSupportsLocales) {
const currentLocale = globalize.getCurrentDateTimeLocale();
if (currentLocale) {
@ -140,7 +135,6 @@ import globalize from 'globalize';
}
export function toLocaleDateString(date, options) {
if (!date) {
throw new Error('date cannot be null');
}
@ -148,7 +142,6 @@ import globalize from 'globalize';
options = options || {};
if (toLocaleTimeStringSupportsLocales) {
const currentLocale = globalize.getCurrentDateTimeLocale();
if (currentLocale) {
@ -174,7 +167,6 @@ import globalize from 'globalize';
}
export function toLocaleTimeString(date, options) {
if (!date) {
throw new Error('date cannot be null');
}
@ -182,7 +174,6 @@ import globalize from 'globalize';
options = options || {};
if (toLocaleTimeStringSupportsLocales) {
const currentLocale = globalize.getCurrentDateTimeLocale();
if (currentLocale) {
@ -194,16 +185,13 @@ import globalize from 'globalize';
}
export function getDisplayTime(date) {
if (!date) {
throw new Error('date cannot be null');
}
if ((typeof date).toString().toLowerCase() === 'string') {
try {
date = parseISO8601Date(date, true);
} catch (err) {
return date;
}
@ -223,7 +211,6 @@ import globalize from 'globalize';
const timeLower = time.toLowerCase();
if (timeLower.indexOf('am') !== -1 || timeLower.indexOf('pm') !== -1) {
time = timeLower;
let hour = date.getHours() % 12;
const suffix = date.getHours() > 11 ? 'pm' : 'am';
@ -239,12 +226,10 @@ import globalize from 'globalize';
minutes = ':' + minutes;
time = hour + minutes + suffix;
} else {
const timeParts = time.split(':');
// Trim off seconds
if (timeParts.length > 2) {
// setting to 2 also handles '21:00:28 GMT+9:30'
timeParts.length = 2;
time = timeParts.join(':');
@ -255,7 +240,6 @@ import globalize from 'globalize';
}
export function isRelativeDay(date, offsetInDays) {
if (!date) {
throw new Error('date cannot be null');
}

View file

@ -4,9 +4,7 @@ import appRouter from 'appRouter';
import globalize from 'globalize';
function alertText(options) {
return new Promise(function (resolve, reject) {
import('alert').then(({default: alert}) => {
alert(options).then(resolve, resolve);
});
@ -14,7 +12,6 @@ function alertText(options) {
}
export function deleteItem(options) {
const item = options.item;
const parentId = item.SeasonId || item.SeriesId || item.ParentId;
@ -28,9 +25,7 @@ export function deleteItem(options) {
primary: 'delete'
}).then(function () {
return apiClient.deleteItem(item.Id).then(function () {
if (options.navigate) {
if (parentId) {
appRouter.showItem(parentId, item.ServerId);
@ -39,7 +34,6 @@ export function deleteItem(options) {
}
}
}, function (err) {
let result = function () {
return Promise.reject(err);
};

View file

@ -1,7 +1,6 @@
import multiDownload from 'multi-download';
export function download(items) {
if (window.NativeShell) {
items.map(function (item) {
window.NativeShell.downloadFile(item);

View file

@ -182,7 +182,6 @@ require(['apphost'], function (appHost) {
var isElectron = navigator.userAgent.toLowerCase().indexOf('electron') !== -1;
function allowInput() {
// This would be nice but always seems to return true with electron
if (!isElectron && document.hidden) { /* eslint-disable-line compat/compat */
return false;
@ -196,7 +195,6 @@ require(['apphost'], function (appHost) {
}
function raiseEvent(name, key, keyCode) {
if (!allowInput()) {
return;
}
@ -209,7 +207,6 @@ require(['apphost'], function (appHost) {
}
function clickElement(elem) {
if (!allowInput()) {
return;
}
@ -218,10 +215,8 @@ require(['apphost'], function (appHost) {
}
function raiseKeyEvent(oldPressedState, newPressedState, key, keyCode, enableRepeatKeyDown, clickonKeyUp) {
// No-op if oldPressedState === newPressedState
if (newPressedState === true) {
// button down
var fire = false;
@ -236,9 +231,7 @@ require(['apphost'], function (appHost) {
if (fire && keyCode) {
raiseEvent('keydown', key, keyCode);
}
} else if (newPressedState === false && oldPressedState === true) {
resetThrottle(key);
// button up
@ -406,5 +399,4 @@ require(['apphost'], function (appHost) {
// and provide input to the DOM navigator.getGamepads API.
window.navigator.gamepadInputEmulation = 'gamepad';
}
});

View file

@ -41,7 +41,6 @@ import appHost from 'apphost';
let commandTimes = {};
function checkCommandTime(command) {
const last = commandTimes[command] || 0;
const now = new Date().getTime();
@ -54,7 +53,6 @@ import appHost from 'apphost';
}
export function handleCommand(commandName, options) {
lastInputTime = new Date().getTime();
let sourceElement = (options ? options.sourceElement : null);

View file

@ -11,12 +11,10 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
}
function notifyApp() {
inputManager.notifyMouseMove();
}
function removeIdleClasses() {
var classList = document.body.classList;
classList.remove('mouseIdle');
@ -24,7 +22,6 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
}
function addIdleClasses() {
var classList = document.body.classList;
classList.add('mouseIdle');
@ -36,7 +33,6 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
var lastPointerMoveData;
function onPointerMove(e) {
var eventX = e.screenX;
var eventY = e.screenY;
@ -73,7 +69,6 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
}
function onPointerEnter(e) {
var pointerType = e.pointerType || (layoutManager.mobile ? 'touch' : 'mouse');
if (pointerType === 'mouse') {
@ -87,7 +82,6 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
}
function enableFocusWithMouse() {
if (!layoutManager.tv) {
return false;
}
@ -104,7 +98,6 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
}
function onMouseInterval() {
if (!isMouseIdle && mouseIdleTime() >= 5000) {
isMouseIdle = true;
addIdleClasses();
@ -114,14 +107,12 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
var mouseInterval;
function startMouseInterval() {
if (!mouseInterval) {
mouseInterval = setInterval(onMouseInterval, 5000);
}
}
function stopMouseInterval() {
var interval = mouseInterval;
if (interval) {
@ -133,7 +124,6 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
}
function initMouse() {
stopMouseInterval();
/* eslint-disable-next-line compat/compat */

View file

@ -13,7 +13,6 @@ define([
'listViewStyle',
'dashboardcss',
'detailtablecss'], function () {
function defineRoute(newRoute) {
var path = newRoute.alias ? newRoute.alias : newRoute.path;
console.debug('defining route: ' + path);

View file

@ -2,7 +2,6 @@ define(['focusManager', 'dom', 'scrollStyles'], function (focusManager, dom) {
'use strict';
function getBoundingClientRect(elem) {
// Support: BlackBerry 5, iOS 3 (original iPhone)
// If we don't have gBCR, just use 0,0 rather than error
if (elem.getBoundingClientRect) {
@ -13,7 +12,6 @@ define(['focusManager', 'dom', 'scrollStyles'], function (focusManager, dom) {
}
function getPosition(scrollContainer, item, horizontal) {
var slideeOffset = getBoundingClientRect(scrollContainer);
var itemOffset = getBoundingClientRect(item);

View file

@ -8,7 +8,6 @@ define([], function () {
} else {
window.open(url, target || '_blank');
}
},
enableFullscreen: function () {
if (window.NativeShell) {

View file

@ -7,7 +7,6 @@ function getTouches(e) {
class TouchHelper {
constructor(elem, options) {
options = options || {};
let touchTarget;
let touchStartX;
@ -24,7 +23,6 @@ class TouchHelper {
const excludeTagNames = options.ignoreTagNames || [];
const touchStart = function (e) {
const touch = getTouches(e)[0];
touchTarget = null;
touchStartX = 0;
@ -34,7 +32,6 @@ class TouchHelper {
thresholdYMet = false;
if (touch) {
const currentTouchTarget = touch.target;
if (dom.parentWithTag(currentTouchTarget, excludeTagNames)) {
@ -48,7 +45,6 @@ class TouchHelper {
};
const touchEnd = function (e) {
const isTouchMove = e.type === 'touchmove';
if (touchTarget) {
@ -81,7 +77,6 @@ class TouchHelper {
} else if (deltaX < (0 - swipeXThreshold) && Math.abs(deltaY) < swipeXMaxY) {
events.trigger(self, 'swipeleft', [touchTarget]);
} else if ((deltaY < (0 - swipeYThreshold) || thresholdYMet) && Math.abs(deltaX) < swipeXMaxY) {
thresholdYMet = true;
events.trigger(self, 'swipeup', [touchTarget, {
@ -139,7 +134,6 @@ class TouchHelper {
});
}
destroy() {
const elem = this.elem;
if (elem) {