1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

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 dialogHelper from 'dialogHelper';
import layoutManager from 'layoutManager'; import layoutManager from 'layoutManager';
import globalize from 'globalize'; import globalize from 'globalize';
@ -384,13 +385,15 @@ function showEditorInternal(itemId, serverId, template) {
if (layoutManager.tv) { if (layoutManager.tv) {
centerFocus(dlg.querySelector('.formDialogContent'), false, true); centerFocus(dlg.querySelector('.formDialogContent'), false, true);
dlg.querySelector('.btnSearchSubtitles').classList.add('hide'); dlg.querySelector('.btnSearchSubtitles').classList.add('hide');
// Don't allow redirection to other websites from the TV layout
dlg.querySelector('.btnHelp').remove();
} else { } else {
btnSubmit.classList.add('hide'); 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'); const editorContent = dlg.querySelector('.formDialogContent');
dlg.querySelector('.subtitleList').addEventListener('click', onSubtitleListClick); 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) { if (item.Type == 'Person' && item.ProductionLocations && item.ProductionLocations.length) {
let gmap = item.ProductionLocations[0]; 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>`; 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'); itemBirthLocation.classList.remove('hide');
@ -1069,7 +1069,7 @@ function renderDetails(page, item, apiClient, context, isStatic) {
reloadUserDataButtons(page, item); reloadUserDataButtons(page, item);
// Don't allow redirection to other websites from the TV layout // Don't allow redirection to other websites from the TV layout
if (!layoutManager.tv) { if (!layoutManager.tv && appHost.supports('externallinks')) {
renderLinks(page, item); renderLinks(page, item);
} }