Add 'externallinks' feature testing

This commit is contained in:
Dmitry Lyzo 2020-10-31 19:37:00 +03:00
parent ed964137fa
commit a8bc8a7e74
2 changed files with 8 additions and 5 deletions

View File

@ -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);

View File

@ -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 = `<a is="emby-linkbutton" class="button-link textlink" target="_blank" href="https://maps.google.com/maps?q=${gmap}">${gmap}</a>`;
}
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);
}