From b09fd1b0998490109e3f68601abcaceb946a9aa1 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Sat, 31 Oct 2020 18:37:24 +0300 Subject: [PATCH 1/3] Remove external link for 'Birth place' --- src/controllers/itemDetails/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/itemDetails/index.js b/src/controllers/itemDetails/index.js index c68fe15feb..c25a147e2c 100644 --- a/src/controllers/itemDetails/index.js +++ b/src/controllers/itemDetails/index.js @@ -649,7 +649,10 @@ function reloadFromItem(instance, page, params, item, user) { const itemBirthLocation = page.querySelector('#itemBirthLocation'); if (item.Type == 'Person' && item.ProductionLocations && item.ProductionLocations.length) { - const gmap = '' + item.ProductionLocations[0] + ''; + let gmap = item.ProductionLocations[0]; + if (!layoutManager.tv) { + gmap = `${gmap}`; + } itemBirthLocation.classList.remove('hide'); itemBirthLocation.innerHTML = globalize.translate('BirthPlaceValue', gmap); } else { From ed964137fa4bdc5bdd569fd8c2a2987282b3bb69 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Sat, 31 Oct 2020 19:05:35 +0300 Subject: [PATCH 2/3] Remove external link in Subtitle Editor --- src/components/subtitleeditor/subtitleeditor.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/subtitleeditor/subtitleeditor.js b/src/components/subtitleeditor/subtitleeditor.js index 8697a9a747..0eb455476f 100644 --- a/src/components/subtitleeditor/subtitleeditor.js +++ b/src/components/subtitleeditor/subtitleeditor.js @@ -384,6 +384,9 @@ function showEditorInternal(itemId, serverId, template) { if (layoutManager.tv) { centerFocus(dlg.querySelector('.formDialogContent'), false, true); dlg.querySelector('.btnSearchSubtitles').classList.add('hide'); + + // Don't allow redirection to other websites from the TV layout + dlg.querySelector('.btnHelp').remove(); } else { btnSubmit.classList.add('hide'); } From a8bc8a7e7439b809076511c1608f90233dd777e4 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Sat, 31 Oct 2020 19:37:00 +0300 Subject: [PATCH 3/3] Add 'externallinks' feature testing --- src/components/subtitleeditor/subtitleeditor.js | 9 ++++++--- src/controllers/itemDetails/index.js | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/subtitleeditor/subtitleeditor.js b/src/components/subtitleeditor/subtitleeditor.js index 0eb455476f..8e6fb497d9 100644 --- a/src/components/subtitleeditor/subtitleeditor.js +++ b/src/components/subtitleeditor/subtitleeditor.js @@ -1,3 +1,4 @@ +import appHost from 'apphost'; import dialogHelper from 'dialogHelper'; import layoutManager from 'layoutManager'; import globalize from 'globalize'; @@ -384,13 +385,15 @@ function showEditorInternal(itemId, serverId, template) { if (layoutManager.tv) { centerFocus(dlg.querySelector('.formDialogContent'), false, true); dlg.querySelector('.btnSearchSubtitles').classList.add('hide'); - - // Don't allow redirection to other websites from the TV layout - dlg.querySelector('.btnHelp').remove(); } else { btnSubmit.classList.add('hide'); } + // Don't allow redirection to other websites from the TV layout + if (layoutManager.tv || !appHost.supports('externallinks')) { + dlg.querySelector('.btnHelp').remove(); + } + const editorContent = dlg.querySelector('.formDialogContent'); dlg.querySelector('.subtitleList').addEventListener('click', onSubtitleListClick); diff --git a/src/controllers/itemDetails/index.js b/src/controllers/itemDetails/index.js index c25a147e2c..ed83d859d1 100644 --- a/src/controllers/itemDetails/index.js +++ b/src/controllers/itemDetails/index.js @@ -650,7 +650,7 @@ function reloadFromItem(instance, page, params, item, user) { if (item.Type == 'Person' && item.ProductionLocations && item.ProductionLocations.length) { let gmap = item.ProductionLocations[0]; - if (!layoutManager.tv) { + if (!layoutManager.tv && appHost.supports('externallinks')) { gmap = `${gmap}`; } itemBirthLocation.classList.remove('hide'); @@ -1069,7 +1069,7 @@ function renderDetails(page, item, apiClient, context, isStatic) { reloadUserDataButtons(page, item); // Don't allow redirection to other websites from the TV layout - if (!layoutManager.tv) { + if (!layoutManager.tv && appHost.supports('externallinks')) { renderLinks(page, item); }