Merge pull request #2025 from dmitrylyzo/no-external-link-for-tv

No external link for TV
This commit is contained in:
dkanada 2020-11-01 18:28:51 +09:00 committed by GitHub
commit 415fccc464
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 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';
@ -388,6 +389,11 @@ function showEditorInternal(itemId, serverId, template) {
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

@ -649,7 +649,10 @@ function reloadFromItem(instance, page, params, item, user) {
const itemBirthLocation = page.querySelector('#itemBirthLocation'); const itemBirthLocation = page.querySelector('#itemBirthLocation');
if (item.Type == 'Person' && item.ProductionLocations && item.ProductionLocations.length) { if (item.Type == 'Person' && item.ProductionLocations && item.ProductionLocations.length) {
const gmap = '<a is="emby-linkbutton" class="button-link textlink" target="_blank" href="https://maps.google.com/maps?q=' + item.ProductionLocations[0] + '">' + item.ProductionLocations[0] + '</a>'; let gmap = item.ProductionLocations[0];
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'); itemBirthLocation.classList.remove('hide');
itemBirthLocation.innerHTML = globalize.translate('BirthPlaceValue', gmap); itemBirthLocation.innerHTML = globalize.translate('BirthPlaceValue', gmap);
} else { } else {
@ -1066,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);
} }