From 8dbf40fa0a5077c34a2bf14a5ecb911d49e358d4 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Thu, 9 Mar 2023 19:43:06 -0500 Subject: [PATCH 1/3] Backport pull request #4330 from jellyfin/release-10.8.z Fix navigation for some types of INPUT Original-merge: 7e99e3ec515d9a461358b5053da0c78a9f452e8d Merged-by: Bill Thornton Backported-by: crobibero --- src/scripts/keyboardNavigation.js | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/scripts/keyboardNavigation.js b/src/scripts/keyboardNavigation.js index feef180630..39c187479d 100644 --- a/src/scripts/keyboardNavigation.js +++ b/src/scripts/keyboardNavigation.js @@ -50,6 +50,11 @@ const NavigationKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown']; */ const InteractiveElements = ['INPUT', 'TEXTAREA']; +/** + * Types of INPUT element for which navigation shouldn't be constrained. + */ +const NonInteractiveInputElements = ['button', 'checkbox', 'color', 'file', 'hidden', 'image', 'radio', 'reset', 'submit']; + let hasFieldKey = false; try { hasFieldKey = 'key' in new KeyboardEvent('keydown'); @@ -84,6 +89,24 @@ export function isNavigationKey(key) { return NavigationKeys.indexOf(key) != -1; } +/** + * Returns _true_ if the element is interactive. + * + * @param {Element} element - Element. + * @return {boolean} _true_ if the element is interactive. + */ +export function isInteractiveElement(element) { + if (element && InteractiveElements.includes(element.tagName)) { + if (element.tagName === 'INPUT') { + return !NonInteractiveInputElements.includes(element.type); + } + + return true; + } + + return false; +} + export function enable() { window.addEventListener('keydown', function (e) { const key = getKeyName(e); @@ -97,7 +120,7 @@ export function enable() { switch (key) { case 'ArrowLeft': - if (!InteractiveElements.includes(document.activeElement?.tagName)) { + if (!isInteractiveElement(document.activeElement)) { inputManager.handleCommand('left'); } else { capture = false; @@ -107,7 +130,7 @@ export function enable() { inputManager.handleCommand('up'); break; case 'ArrowRight': - if (!InteractiveElements.includes(document.activeElement?.tagName)) { + if (!isInteractiveElement(document.activeElement)) { inputManager.handleCommand('right'); } else { capture = false; From 2c4d065e0ebaca280bc71a2e5c126d22203168be Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Thu, 9 Mar 2023 19:43:07 -0500 Subject: [PATCH 2/3] Backport pull request #4362 from jellyfin/release-10.8.z Fix subtitle offset reset when seeking progressive stream Original-merge: af27e084d5fd6d7f0372b8f10a5eff339c73866c Merged-by: Bill Thornton Backported-by: crobibero --- src/components/playback/playbackmanager.js | 1 + src/plugins/htmlVideoPlayer/plugin.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/playback/playbackmanager.js b/src/components/playback/playbackmanager.js index 947f46eec8..e6cba06d2e 100644 --- a/src/components/playback/playbackmanager.js +++ b/src/components/playback/playbackmanager.js @@ -1740,6 +1740,7 @@ class PlaybackManager { const streamInfo = createStreamInfo(apiClient, currentItem.MediaType, currentItem, currentMediaSource, ticks, player); streamInfo.fullscreen = currentPlayOptions.fullscreen; streamInfo.lastMediaInfoQuery = lastMediaInfoQuery; + streamInfo.resetSubtitleOffset = false; if (!streamInfo.url) { showPlaybackInfoErrorMessage(self, 'PlaybackErrorNoCompatibleStream'); diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index 2582785f8e..a4f512768f 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -382,7 +382,7 @@ function tryRemoveElement(elem) { this.#currentTime = null; - this.resetSubtitleOffset(); + if (options.resetSubtitleOffset !== false) this.resetSubtitleOffset(); return this.createMediaElement(options).then(elem => { return this.updateVideoUrl(options).then(() => { From c9b72d87fe6299e79c025db60901a306325deab7 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Thu, 9 Mar 2023 19:43:08 -0500 Subject: [PATCH 3/3] Backport pull request #4395 from jellyfin/release-10.8.z Fix installed plugin version html Original-merge: 22d1f40587a79a0774fe0fe6f8c07a258d077f24 Merged-by: Bill Thornton Backported-by: crobibero --- src/controllers/dashboard/plugins/add/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/dashboard/plugins/add/index.js b/src/controllers/dashboard/plugins/add/index.js index 5e0a2d3f14..150fe3e1fd 100644 --- a/src/controllers/dashboard/plugins/add/index.js +++ b/src/controllers/dashboard/plugins/add/index.js @@ -68,7 +68,7 @@ function renderPackage(pkg, installedPlugins, page) { if (installedPlugin) { const currentVersionText = globalize.translate('MessageYouHaveVersionInstalled', '' + installedPlugin.Version + ''); - $('#pCurrentVersion', page).show().text(currentVersionText); + $('#pCurrentVersion', page).show().html(currentVersionText); } else { $('#pCurrentVersion', page).hide().text(''); }