mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Escape HTML
This commit is contained in:
parent
08cbc5aa8f
commit
59adbc348a
60 changed files with 245 additions and 192 deletions
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import dialogHelper from '../dialogHelper/dialogHelper';
|
||||
import layoutManager from '../layoutManager';
|
||||
import globalize from '../../scripts/globalize';
|
||||
|
@ -156,10 +157,10 @@ export function show(options) {
|
|||
}
|
||||
|
||||
if (options.title) {
|
||||
html += '<h1 class="actionSheetTitle">' + options.title + '</h1>';
|
||||
html += '<h1 class="actionSheetTitle">' + escapeHtml(options.title) + '</h1>';
|
||||
}
|
||||
if (options.text) {
|
||||
html += '<p class="actionSheetText">' + options.text + '</p>';
|
||||
html += '<p class="actionSheetText">' + escapeHtml(options.text) + '</p>';
|
||||
}
|
||||
|
||||
let scrollerClassName = 'actionSheetScroller';
|
||||
|
@ -212,17 +213,17 @@ export function show(options) {
|
|||
html += '<div class="listItemBody actionsheetListItemBody">';
|
||||
|
||||
html += '<div class="listItemBodyText actionSheetItemText">';
|
||||
html += (item.name || item.textContent || item.innerText);
|
||||
html += escapeHtml(item.name || item.textContent || item.innerText);
|
||||
html += '</div>';
|
||||
|
||||
if (item.secondaryText) {
|
||||
html += `<div class="listItemBodyText secondary">${item.secondaryText}</div>`;
|
||||
html += `<div class="listItemBodyText secondary">${escapeHtml(item.secondaryText)}</div>`;
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
|
||||
if (item.asideText) {
|
||||
html += `<div class="listItemAside actionSheetItemAsideText">${item.asideText}</div>`;
|
||||
html += `<div class="listItemAside actionSheetItemAsideText">${escapeHtml(item.asideText)}</div>`;
|
||||
}
|
||||
|
||||
html += '</button>';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import { Events } from 'jellyfin-apiclient';
|
||||
import globalize from '../scripts/globalize';
|
||||
import dom from '../scripts/dom';
|
||||
|
@ -33,13 +34,13 @@ import alert from './alert';
|
|||
|
||||
html += '<div class="listItemBody three-line">';
|
||||
html += '<div class="listItemBodyText">';
|
||||
html += entry.Name;
|
||||
html += escapeHtml(entry.Name);
|
||||
html += '</div>';
|
||||
html += '<div class="listItemBodyText secondary">';
|
||||
html += datefns.formatRelative(Date.parse(entry.Date), Date.parse(new Date()), { locale: dfnshelper.getLocale() });
|
||||
html += '</div>';
|
||||
html += '<div class="listItemBodyText secondary listItemBodyText-nowrap">';
|
||||
html += entry.ShortOverview || '';
|
||||
html += escapeHtml(entry.ShortOverview || '');
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* @module components/cardBuilder/cardBuilder
|
||||
*/
|
||||
|
||||
import escapeHtml from 'escape-html';
|
||||
import datetime from '../../scripts/datetime';
|
||||
import imageLoader from '../images/imageLoader';
|
||||
import itemHelper from '../itemHelper';
|
||||
|
@ -813,11 +814,11 @@ import ServerConnections from '../ServerConnections';
|
|||
IsFolder: true
|
||||
}));
|
||||
} else {
|
||||
lines.push(item.SeriesName);
|
||||
lines.push(escapeHtml(item.SeriesName));
|
||||
}
|
||||
} else {
|
||||
if (isUsingLiveTvNaming(item)) {
|
||||
lines.push(item.Name);
|
||||
lines.push(escapeHtml(item.Name));
|
||||
|
||||
if (!item.EpisodeTitle) {
|
||||
titleAdded = true;
|
||||
|
@ -826,7 +827,7 @@ import ServerConnections from '../ServerConnections';
|
|||
const parentTitle = item.SeriesName || item.Series || item.Album || item.AlbumArtist || '';
|
||||
|
||||
if (parentTitle || showTitle) {
|
||||
lines.push(parentTitle);
|
||||
lines.push(escapeHtml(parentTitle));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -860,7 +861,7 @@ import ServerConnections from '../ServerConnections';
|
|||
item.AlbumArtists[0].IsFolder = true;
|
||||
lines.push(getTextActionButton(item.AlbumArtists[0], null, serverId));
|
||||
} else {
|
||||
lines.push(isUsingLiveTvNaming(item) ? item.Name : (item.SeriesName || item.Series || item.Album || item.AlbumArtist || ''));
|
||||
lines.push(escapeHtml(isUsingLiveTvNaming(item) ? item.Name : (item.SeriesName || item.Series || item.Album || item.AlbumArtist || '')));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -948,13 +949,13 @@ import ServerConnections from '../ServerConnections';
|
|||
|
||||
}, item.ChannelName));
|
||||
} else {
|
||||
lines.push(item.ChannelName || ' ');
|
||||
lines.push(escapeHtml(item.ChannelName) || ' ');
|
||||
}
|
||||
}
|
||||
|
||||
if (options.showCurrentProgram && item.Type === 'TvChannel') {
|
||||
if (item.CurrentProgram) {
|
||||
lines.push(item.CurrentProgram.Name);
|
||||
lines.push(escapeHtml(item.CurrentProgram.Name));
|
||||
} else {
|
||||
lines.push('');
|
||||
}
|
||||
|
@ -980,13 +981,13 @@ import ServerConnections from '../ServerConnections';
|
|||
if (item.RecordAnyChannel) {
|
||||
lines.push(globalize.translate('AllChannels'));
|
||||
} else {
|
||||
lines.push(item.ChannelName || globalize.translate('OneChannel'));
|
||||
lines.push(escapeHtml(item.ChannelName) || globalize.translate('OneChannel'));
|
||||
}
|
||||
}
|
||||
|
||||
if (options.showPersonRoleOrType) {
|
||||
if (item.Role) {
|
||||
lines.push(globalize.translate('PersonRole', item.Role));
|
||||
lines.push(globalize.translate('PersonRole', escapeHtml(item.Role)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -996,7 +997,7 @@ import ServerConnections from '../ServerConnections';
|
|||
}
|
||||
|
||||
if (overlayText && showTitle) {
|
||||
lines = [item.Name];
|
||||
lines = [escapeHtml(item.Name)];
|
||||
}
|
||||
|
||||
const addRightTextMargin = isOuterFooter && options.cardLayout && !options.centerText && options.cardFooterAside !== 'none' && layoutManager.mobile;
|
||||
|
@ -1031,6 +1032,8 @@ import ServerConnections from '../ServerConnections';
|
|||
text = itemHelper.getDisplayName(item);
|
||||
}
|
||||
|
||||
text = escapeHtml(text);
|
||||
|
||||
if (layoutManager.tv) {
|
||||
return text;
|
||||
}
|
||||
|
@ -1442,7 +1445,7 @@ import ServerConnections from '../ServerConnections';
|
|||
const mediaTypeData = item.MediaType ? (' data-mediatype="' + item.MediaType + '"') : '';
|
||||
const collectionTypeData = item.CollectionType ? (' data-collectiontype="' + item.CollectionType + '"') : '';
|
||||
const channelIdData = item.ChannelId ? (' data-channelid="' + item.ChannelId + '"') : '';
|
||||
const pathData = item.Path ? (' data-path="' + item.Path + '"') : '';
|
||||
const pathData = item.Path ? (' data-path="' + escapeHtml(item.Path) + '"') : '';
|
||||
const contextData = options.context ? (' data-context="' + options.context + '"') : '';
|
||||
const parentIdData = options.parentId ? (' data-parentid="' + options.parentId + '"') : '';
|
||||
const startDate = item.StartDate ? (' data-startdate="' + item.StartDate.toString() + '"') : '';
|
||||
|
@ -1454,7 +1457,7 @@ import ServerConnections from '../ServerConnections';
|
|||
additionalCardContent += getHoverMenuHtml(item, action);
|
||||
}
|
||||
|
||||
return '<' + tagName + ' data-index="' + index + '"' + timerAttributes + actionAttribute + ' data-isfolder="' + (item.IsFolder || false) + '" data-serverid="' + (item.ServerId || options.serverId) + '" data-id="' + (item.Id || item.ItemId) + '" data-type="' + item.Type + '"' + mediaTypeData + collectionTypeData + channelIdData + pathData + positionTicksData + collectionIdData + playlistIdData + contextData + parentIdData + startDate + endDate + ' data-prefix="' + prefix + '" class="' + className + '"' + ariaLabelAttribute + '>' + cardImageContainerOpen + innerCardFooter + cardImageContainerClose + overlayButtons + additionalCardContent + cardScalableClose + outerCardFooter + cardBoxClose + '</' + tagName + '>';
|
||||
return '<' + tagName + ' data-index="' + index + '"' + timerAttributes + actionAttribute + ' data-isfolder="' + (item.IsFolder || false) + '" data-serverid="' + (item.ServerId || options.serverId) + '" data-id="' + (item.Id || item.ItemId) + '" data-type="' + item.Type + '"' + mediaTypeData + collectionTypeData + channelIdData + pathData + positionTicksData + collectionIdData + playlistIdData + contextData + parentIdData + startDate + endDate + ' data-prefix="' + escapeHtml(prefix) + '" class="' + className + '"' + ariaLabelAttribute + '>' + cardImageContainerOpen + innerCardFooter + cardImageContainerClose + overlayButtons + additionalCardContent + cardScalableClose + outerCardFooter + cardBoxClose + '</' + tagName + '>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1544,7 +1547,7 @@ import ServerConnections from '../ServerConnections';
|
|||
}
|
||||
|
||||
const defaultName = isUsingLiveTvNaming(item) ? item.Name : itemHelper.getDisplayName(item);
|
||||
return '<div class="cardText cardDefaultText">' + defaultName + '</div>';
|
||||
return '<div class="cardText cardDefaultText">' + escapeHtml(defaultName) + '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* @module components/cardBuilder/chaptercardbuilder
|
||||
*/
|
||||
|
||||
import escapeHtml from 'escape-html';
|
||||
import datetime from '../../scripts/datetime';
|
||||
import imageLoader from '../images/imageLoader';
|
||||
import layoutManager from '../layoutManager';
|
||||
|
@ -98,7 +99,7 @@ import ServerConnections from '../ServerConnections';
|
|||
}
|
||||
|
||||
let nameHtml = '';
|
||||
nameHtml += `<div class="cardText">${chapter.Name}</div>`;
|
||||
nameHtml += `<div class="cardText">${escapeHtml(chapter.Name)}</div>`;
|
||||
nameHtml += `<div class="cardText">${datetime.getDisplayRunningTime(chapter.StartPositionTicks)}</div>`;
|
||||
|
||||
const cardBoxCssClass = 'cardBox';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import dom from '../../scripts/dom';
|
||||
import dialogHelper from '../dialogHelper/dialogHelper';
|
||||
import loading from '../loading/loading';
|
||||
|
@ -29,7 +30,7 @@ export default class channelMapper {
|
|||
}).then(mapping => {
|
||||
const listItem = dom.parentWithClass(button, 'listItem');
|
||||
button.setAttribute('data-providerid', mapping.ProviderChannelId);
|
||||
listItem.querySelector('.secondary').innerHTML = getMappingSecondaryName(mapping, currentMappingOptions.ProviderName);
|
||||
listItem.querySelector('.secondary').innerText = getMappingSecondaryName(mapping, currentMappingOptions.ProviderName);
|
||||
loading.hide();
|
||||
});
|
||||
}
|
||||
|
@ -75,12 +76,12 @@ export default class channelMapper {
|
|||
html += '<span class="material-icons listItemIcon dvr" aria-hidden="true"></span>';
|
||||
html += '<div class="listItemBody two-line">';
|
||||
html += '<h3 class="listItemBodyText">';
|
||||
html += channel.Name;
|
||||
html += escapeHtml(channel.Name);
|
||||
html += '</h3>';
|
||||
html += '<div class="secondary listItemBodyText">';
|
||||
|
||||
if (channel.ProviderChannelName) {
|
||||
html += getMappingSecondaryName(channel, providerName);
|
||||
html += escapeHtml(getMappingSecondaryName(channel, providerName));
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import dom from '../../scripts/dom';
|
||||
import dialogHelper from '../dialogHelper/dialogHelper';
|
||||
import loading from '../loading/loading';
|
||||
|
@ -112,7 +113,7 @@ import toast from '../toast/toast';
|
|||
html += `<option value="">${globalize.translate('OptionNew')}</option>`;
|
||||
|
||||
html += result.Items.map(i => {
|
||||
return `<option value="${i.Id}">${i.Name}</option>`;
|
||||
return `<option value="${i.Id}">${escapeHtml(i.Name)}</option>`;
|
||||
});
|
||||
|
||||
select.innerHTML = html;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import React, { FunctionComponent } from 'react';
|
||||
import globalize from '../../../scripts/globalize';
|
||||
|
||||
|
@ -26,7 +27,7 @@ type IProps = {
|
|||
const SelectElement: FunctionComponent<IProps> = ({ className, label, currentProviderId, providers }: IProps) => {
|
||||
const renderOption = providers.map((provider) => {
|
||||
const selected = provider.Id === currentProviderId || providers.length < 2 ? ' selected' : '';
|
||||
return '<option value="' + provider.Id + '"' + selected + '>' + provider.Name + '</option>';
|
||||
return '<option value="' + provider.Id + '"' + selected + '>' + escapeHtml(provider.Name) + '</option>';
|
||||
});
|
||||
|
||||
return (
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import React, { FunctionComponent } from 'react';
|
||||
import globalize from '../../../scripts/globalize';
|
||||
|
||||
|
@ -27,7 +28,7 @@ const SelectMaxParentalRating: FunctionComponent<IProps> = ({ className, label,
|
|||
const renderOption = () => {
|
||||
let content = '';
|
||||
for (const rating of parentalRatings) {
|
||||
content += `<option value='${rating.Value}'>${rating.Name}</option>`;
|
||||
content += `<option value='${rating.Value}'>${escapeHtml(rating.Name)}</option>`;
|
||||
}
|
||||
return content;
|
||||
};
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import dialogHelper from '../dialogHelper/dialogHelper';
|
||||
import dom from '../../scripts/dom';
|
||||
import layoutManager from '../layoutManager';
|
||||
|
@ -47,7 +48,7 @@ import template from './dialog.template.html';
|
|||
}
|
||||
|
||||
if (options.title) {
|
||||
dlg.querySelector('.formDialogHeaderTitle').innerHTML = options.title || '';
|
||||
dlg.querySelector('.formDialogHeaderTitle').innerText = options.title || '';
|
||||
} else {
|
||||
dlg.querySelector('.formDialogHeaderTitle').classList.add('hide');
|
||||
}
|
||||
|
@ -82,7 +83,7 @@ import template from './dialog.template.html';
|
|||
buttonClass += ' formDialogFooterItem-vertical formDialogFooterItem-nomarginbottom';
|
||||
}
|
||||
|
||||
html += `<button is="emby-button" type="button" class="${buttonClass}" data-id="${item.id}"${autoFocus}>${item.name}</button>`;
|
||||
html += `<button is="emby-button" type="button" class="${buttonClass}" data-id="${item.id}"${autoFocus}>${escapeHtml(item.name)}</button>`;
|
||||
|
||||
if (item.description) {
|
||||
html += `<div class="formDialogFooterItem formDialogFooterItem-autosize fieldDescription" style="margin-top:.25em!important;margin-bottom:1.25em!important;">${item.description}</div>`;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import loading from '../loading/loading';
|
||||
import dialogHelper from '../dialogHelper/dialogHelper';
|
||||
import dom from '../../scripts/dom';
|
||||
|
@ -71,10 +72,10 @@ function refreshDirectoryBrowser(page, path, fileOptions, updatePathOnError) {
|
|||
|
||||
function getItem(cssClass, type, path, name) {
|
||||
let html = '';
|
||||
html += `<div class="listItem listItem-border ${cssClass}" data-type="${type}" data-path="${path}">`;
|
||||
html += `<div class="listItem listItem-border ${cssClass}" data-type="${type}" data-path="${escapeHtml(path)}">`;
|
||||
html += '<div class="listItemBody" style="padding-left:0;padding-top:.5em;padding-bottom:.5em;">';
|
||||
html += '<div class="listItemBodyText">';
|
||||
html += name;
|
||||
html += escapeHtml(name);
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '<span class="material-icons arrow_forward" aria-hidden="true" style="font-size:inherit;"></span>';
|
||||
|
@ -87,7 +88,7 @@ function getEditorHtml(options, systemInfo) {
|
|||
html += '<div class="formDialogContent scrollY">';
|
||||
html += '<div class="dialogContentInner dialog-content-centered" style="padding-top:2em;">';
|
||||
if (!options.pathReadOnly) {
|
||||
const instruction = options.instruction ? `${options.instruction}<br/><br/>` : '';
|
||||
const instruction = options.instruction ? `${escapeHtml(options.instruction)}<br/><br/>` : '';
|
||||
html += '<div class="infoBanner" style="margin-bottom:1.5em;">';
|
||||
html += instruction;
|
||||
if (systemInfo.OperatingSystem.toLowerCase() === 'bsd') {
|
||||
|
@ -266,7 +267,7 @@ class DirectoryBrowser {
|
|||
html += '<div class="formDialogHeader">';
|
||||
html += `<button is="paper-icon-button-light" class="btnCloseDialog autoSize" tabindex="-1" title="${globalize.translate('ButtonBack')}"><span class="material-icons arrow_back" aria-hidden="true"></span></button>`;
|
||||
html += '<h3 class="formDialogHeaderTitle">';
|
||||
html += options.header || globalize.translate('HeaderSelectPath');
|
||||
html += escapeHtml(options.header) || globalize.translate('HeaderSelectPath');
|
||||
html += '</h3>';
|
||||
html += '</div>';
|
||||
html += getEditorHtml(options, systemInfo);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import browser from '../../scripts/browser';
|
||||
import layoutManager from '../layoutManager';
|
||||
import { pluginManager } from '../pluginManager';
|
||||
|
@ -21,7 +22,7 @@ import template from './displaySettings.template.html';
|
|||
function fillThemes(select, selectedTheme) {
|
||||
skinManager.getThemes().then(themes => {
|
||||
select.innerHTML = themes.map(t => {
|
||||
return `<option value="${t.id}">${t.name}</option>`;
|
||||
return `<option value="${t.id}">${escapeHtml(t.name)}</option>`;
|
||||
}).join('');
|
||||
|
||||
// get default theme
|
||||
|
@ -47,7 +48,7 @@ import template from './displaySettings.template.html';
|
|||
});
|
||||
|
||||
selectScreensaver.innerHTML = options.map(o => {
|
||||
return `<option value="${o.value}">${o.name}</option>`;
|
||||
return `<option value="${o.value}">${escapeHtml(o.name)}</option>`;
|
||||
}).join('');
|
||||
|
||||
selectScreensaver.value = userSettings.screensaver();
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import dom from '../../scripts/dom';
|
||||
import focusManager from '../focusManager';
|
||||
import dialogHelper from '../dialogHelper/dialogHelper';
|
||||
|
@ -37,7 +38,7 @@ function renderOptions(context, selector, cssClass, items, isCheckedFn) {
|
|||
const checkedHtml = isCheckedFn(filter) ? ' checked' : '';
|
||||
itemHtml += '<label>';
|
||||
itemHtml += '<input is="emby-checkbox" type="checkbox"' + checkedHtml + ' data-filter="' + filter.Id + '" class="' + cssClass + '"/>';
|
||||
itemHtml += '<span>' + filter.Name + '</span>';
|
||||
itemHtml += '<span>' + escapeHtml(filter.Name) + '</span>';
|
||||
itemHtml += '</label>';
|
||||
|
||||
return itemHtml;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import inputManager from '../../scripts/inputManager';
|
||||
import browser from '../../scripts/browser';
|
||||
import globalize from '../../scripts/globalize';
|
||||
|
@ -538,7 +539,7 @@ function Guide(options) {
|
|||
|
||||
html += '<div class="guide-programNameCaret hide"><span class="guideProgramNameCaretIcon material-icons keyboard_arrow_left" aria-hidden="true"></span></div>';
|
||||
|
||||
html += '<div class="guideProgramNameText">' + program.Name;
|
||||
html += '<div class="guideProgramNameText">' + escapeHtml(program.Name);
|
||||
|
||||
let indicatorHtml = null;
|
||||
if (program.IsLive && options.showLiveIndicator) {
|
||||
|
@ -556,7 +557,7 @@ function Guide(options) {
|
|||
html += '<div class="guideProgramSecondaryInfo">';
|
||||
|
||||
if (program.EpisodeTitle && options.showEpisodeTitle) {
|
||||
html += '<span class="programSecondaryTitle">' + program.EpisodeTitle + '</span>';
|
||||
html += '<span class="programSecondaryTitle">' + escapeHtml(program.EpisodeTitle) + '</span>';
|
||||
}
|
||||
html += '</div>';
|
||||
}
|
||||
|
@ -604,7 +605,7 @@ function Guide(options) {
|
|||
title.push(channel.Name);
|
||||
}
|
||||
|
||||
html += '<button title="' + title.join(' ') + '" type="button" class="' + cssClass + '"' + ' data-action="link" data-isfolder="' + channel.IsFolder + '" data-id="' + channel.Id + '" data-serverid="' + channel.ServerId + '" data-type="' + channel.Type + '">';
|
||||
html += '<button title="' + escapeHtml(title.join(' ')) + '" type="button" class="' + cssClass + '"' + ' data-action="link" data-isfolder="' + channel.IsFolder + '" data-id="' + channel.Id + '" data-serverid="' + channel.ServerId + '" data-type="' + channel.Type + '">';
|
||||
|
||||
if (hasChannelImage) {
|
||||
const url = apiClient.getScaledImageUrl(channel.Id, {
|
||||
|
@ -621,7 +622,7 @@ function Guide(options) {
|
|||
}
|
||||
|
||||
if (!hasChannelImage && channel.Name) {
|
||||
html += '<div class="guideChannelName">' + channel.Name + '</div>';
|
||||
html += '<div class="guideChannelName">' + escapeHtml(channel.Name) + '</div>';
|
||||
}
|
||||
|
||||
html += '</button>';
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
|
||||
import escapeHtml from 'escape-html';
|
||||
import layoutManager from '../layoutManager';
|
||||
import focusManager from '../focusManager';
|
||||
import globalize from '../../scripts/globalize';
|
||||
|
@ -32,7 +33,7 @@ import template from './homeScreenSettings.template.html';
|
|||
|
||||
currentHtml += '<label>';
|
||||
currentHtml += `<input type="checkbox" is="emby-checkbox" class="chkGroupFolder" data-folderid="${i.Id}" id="${id}"${checkedHtml}/>`;
|
||||
currentHtml += `<span>${i.Name}</span>`;
|
||||
currentHtml += `<span>${escapeHtml(i.Name)}</span>`;
|
||||
currentHtml += '</label>';
|
||||
|
||||
return currentHtml;
|
||||
|
@ -165,7 +166,7 @@ import template from './homeScreenSettings.template.html';
|
|||
const selectedHtml = selected ? ' selected' : '';
|
||||
const optionValue = o.isDefault ? '' : o.value;
|
||||
|
||||
return `<option value="${optionValue}"${selectedHtml}>${o.name}</option>`;
|
||||
return `<option value="${optionValue}"${selectedHtml}>${escapeHtml(o.name)}</option>`;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
|
@ -182,7 +183,7 @@ import template from './homeScreenSettings.template.html';
|
|||
currentHtml += '<div class="listItemBody">';
|
||||
|
||||
currentHtml += '<div>';
|
||||
currentHtml += view.Name;
|
||||
currentHtml += escapeHtml(view.Name);
|
||||
currentHtml += '</div>';
|
||||
|
||||
currentHtml += '</div>';
|
||||
|
@ -265,7 +266,7 @@ import template from './homeScreenSettings.template.html';
|
|||
prefix += '<div class="verticalSection">';
|
||||
|
||||
prefix += '<h2 class="sectionTitle">';
|
||||
prefix += item.Name;
|
||||
prefix += escapeHtml(item.Name);
|
||||
prefix += '</h2>';
|
||||
|
||||
html = prefix + html;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import cardBuilder from '../cardbuilder/cardBuilder';
|
||||
import dom from '../../scripts/dom';
|
||||
import layoutManager from '../layoutManager';
|
||||
|
@ -192,7 +193,7 @@ import ServerConnections from '../ServerConnections';
|
|||
for (let i = 0, length = items.length; i < length; i++) {
|
||||
const item = items[i];
|
||||
const icon = imageHelper.getLibraryIcon(item.CollectionType);
|
||||
html += '<a is="emby-linkbutton" href="' + appRouter.getRouteUrl(item) + '" class="raised homeLibraryButton"><span class="material-icons homeLibraryIcon ' + icon + '" aria-hidden="true"></span><span class="homeLibraryText">' + item.Name + '</span></a>';
|
||||
html += '<a is="emby-linkbutton" href="' + appRouter.getRouteUrl(item) + '" class="raised homeLibraryButton"><span class="material-icons homeLibraryIcon ' + icon + '" aria-hidden="true"></span><span class="homeLibraryText">' + escapeHtml(item.Name) + '</span></a>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
|
@ -281,12 +282,12 @@ import ServerConnections from '../ServerConnections';
|
|||
section: 'latest'
|
||||
}) + '" class="more button-flat button-flat-mini sectionTitleTextButton">';
|
||||
html += '<h2 class="sectionTitle sectionTitle-cards">';
|
||||
html += globalize.translate('LatestFromLibrary', parent.Name);
|
||||
html += globalize.translate('LatestFromLibrary', escapeHtml(parent.Name));
|
||||
html += '</h2>';
|
||||
html += '<span class="material-icons chevron_right" aria-hidden="true"></span>';
|
||||
html += '</a>';
|
||||
} else {
|
||||
html += '<h2 class="sectionTitle sectionTitle-cards">' + globalize.translate('LatestFromLibrary', parent.Name) + '</h2>';
|
||||
html += '<h2 class="sectionTitle sectionTitle-cards">' + globalize.translate('LatestFromLibrary', escapeHtml(parent.Name)) + '</h2>';
|
||||
}
|
||||
html += '</div>';
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* @module components/itemMediaInfo/itemMediaInfo
|
||||
*/
|
||||
|
||||
import escapeHtml from 'escape-html';
|
||||
import dialogHelper from '../dialogHelper/dialogHelper';
|
||||
import layoutManager from '../layoutManager';
|
||||
import toast from '../toast/toast';
|
||||
|
@ -55,7 +56,7 @@ const attributeDelimiterHtml = layoutManager.tv ? '' : '<span class="hide">: </s
|
|||
function getMediaSourceHtml(user, item, version) {
|
||||
let html = '<div class="mediaInfoSource">';
|
||||
if (version.Name) {
|
||||
html += `<div><h2 class="mediaInfoStreamType">${version.Name}${copyButtonHtml}</h2></div>\n`;
|
||||
html += `<div><h2 class="mediaInfoStreamType">${escapeHtml(version.Name)}${copyButtonHtml}</h2></div>\n`;
|
||||
}
|
||||
if (version.Container) {
|
||||
html += `${createAttribute(globalize.translate('MediaInfoContainer'), version.Container)}<br/>`;
|
||||
|
@ -181,7 +182,7 @@ const attributeDelimiterHtml = layoutManager.tv ? '' : '<span class="hide">: </s
|
|||
}
|
||||
|
||||
function createAttribute(label, value) {
|
||||
return `<span class="mediaInfoLabel">${label}</span>${attributeDelimiterHtml}<span class="mediaInfoAttribute">${value}</span>\n`;
|
||||
return `<span class="mediaInfoLabel">${label}</span>${attributeDelimiterHtml}<span class="mediaInfoAttribute">${escapeHtml(value)}</span>\n`;
|
||||
}
|
||||
|
||||
function loadMediaInfo(itemId, serverId) {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* @module components/itemidentifier/itemidentifier
|
||||
*/
|
||||
|
||||
import escapeHtml from 'escape-html';
|
||||
import dialogHelper from '../dialogHelper/dialogHelper';
|
||||
import loading from '../loading/loading';
|
||||
import globalize from '../../scripts/globalize';
|
||||
|
@ -162,7 +163,7 @@ import template from './itemidentifier.template.html';
|
|||
currentSearchResult = identifyResult;
|
||||
|
||||
const lines = [];
|
||||
lines.push(identifyResult.Name);
|
||||
lines.push(escapeHtml(identifyResult.Name));
|
||||
|
||||
if (identifyResult.ProductionYear) {
|
||||
lines.push(identifyResult.ProductionYear);
|
||||
|
@ -218,7 +219,7 @@ import template from './itemidentifier.template.html';
|
|||
if (result.ImageUrl) {
|
||||
html += `<div class="cardImageContainer coveredImage" style="background-image:url('${result.ImageUrl}');"></div>`;
|
||||
} else {
|
||||
html += `<div class="cardImageContainer coveredImage defaultCardBackground defaultCardBackground1"><div class="cardText cardCenteredText">${result.Name}</div></div>`;
|
||||
html += `<div class="cardImageContainer coveredImage defaultCardBackground defaultCardBackground1"><div class="cardText cardCenteredText">${escapeHtml(result.Name)}</div></div>`;
|
||||
}
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
@ -245,7 +246,7 @@ import template from './itemidentifier.template.html';
|
|||
} else {
|
||||
html += '<div class="cardText cardText-secondary cardTextCentered">';
|
||||
}
|
||||
html += lines[i] || ' ';
|
||||
html += escapeHtml(lines[i]) || ' ';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
|
@ -299,7 +300,7 @@ import template from './itemidentifier.template.html';
|
|||
fullName = `${idInfo.Name} ${globalize.translate(idInfo.Type)}`;
|
||||
}
|
||||
|
||||
const idLabel = globalize.translate('LabelDynamicExternalId', fullName);
|
||||
const idLabel = globalize.translate('LabelDynamicExternalId', escapeHtml(fullName));
|
||||
|
||||
html += `<input is="emby-input" class="txtLookupId" data-providerkey="${idInfo.Key}" id="${id}" label="${idLabel}"/>`;
|
||||
|
||||
|
@ -364,7 +365,7 @@ import template from './itemidentifier.template.html';
|
|||
dlg.querySelector('.fldPath').classList.add('hide');
|
||||
}
|
||||
|
||||
dlg.querySelector('.txtPath').innerHTML = item.Path || '';
|
||||
dlg.querySelector('.txtPath').innerText = item.Path || '';
|
||||
|
||||
dialogHelper.open(dlg);
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* @module components/libraryoptionseditor/libraryoptionseditor
|
||||
*/
|
||||
|
||||
import escapeHtml from 'escape-html';
|
||||
import globalize from '../../scripts/globalize';
|
||||
import dom from '../../scripts/dom';
|
||||
import '../../elements/emby-checkbox/emby-checkbox';
|
||||
|
@ -68,11 +69,11 @@ import template from './libraryoptionseditor.template.html';
|
|||
html += '<div class="checkboxList paperList checkboxList-paperList">';
|
||||
for (let i = 0; i < plugins.length; i++) {
|
||||
const plugin = plugins[i];
|
||||
html += `<div class="listItem localReaderOption sortableOption" data-pluginname="${plugin.Name}">`;
|
||||
html += `<div class="listItem localReaderOption sortableOption" data-pluginname="${escapeHtml(plugin.Name)}">`;
|
||||
html += '<span class="listItemIcon material-icons live_tv" aria-hidden="true"></span>';
|
||||
html += '<div class="listItemBody">';
|
||||
html += '<h3 class="listItemBodyText">';
|
||||
html += plugin.Name;
|
||||
html += escapeHtml(plugin.Name);
|
||||
html += '</h3>';
|
||||
html += '</div>';
|
||||
if (i > 0) {
|
||||
|
@ -101,7 +102,7 @@ import template from './libraryoptionseditor.template.html';
|
|||
html += '<div class="checkboxList paperList checkboxList-paperList">';
|
||||
for (let i = 0; i < metadataSavers.length; i++) {
|
||||
const plugin = metadataSavers[i];
|
||||
html += `<label><input type="checkbox" data-defaultenabled="${plugin.DefaultEnabled}" is="emby-checkbox" class="chkMetadataSaver" data-pluginname="${plugin.Name}" ${false}><span>${plugin.Name}</span></label>`;
|
||||
html += `<label><input type="checkbox" data-defaultenabled="${plugin.DefaultEnabled}" is="emby-checkbox" class="chkMetadataSaver" data-pluginname="${escapeHtml(plugin.Name)}" ${false}><span>${escapeHtml(plugin.Name)}</span></label>`;
|
||||
}
|
||||
html += '</div>';
|
||||
html += `<div class="fieldDescription" style="margin-top:.25em;">${globalize.translate('LabelMetadataSaversHelp')}</div>`;
|
||||
|
@ -122,13 +123,13 @@ import template from './libraryoptionseditor.template.html';
|
|||
html += '<div class="checkboxList paperList checkboxList-paperList">';
|
||||
|
||||
plugins.forEach((plugin, index) => {
|
||||
html += '<div class="listItem metadataFetcherItem sortableOption" data-pluginname="' + plugin.Name + '">';
|
||||
html += '<div class="listItem metadataFetcherItem sortableOption" data-pluginname="' + escapeHtml(plugin.Name) + '">';
|
||||
const isChecked = libraryOptionsForType.MetadataFetchers ? libraryOptionsForType.MetadataFetchers.includes(plugin.Name) : plugin.DefaultEnabled;
|
||||
const checkedHtml = isChecked ? ' checked="checked"' : '';
|
||||
html += '<label class="listItemCheckboxContainer"><input type="checkbox" is="emby-checkbox" class="chkMetadataFetcher" data-pluginname="' + plugin.Name + '" ' + checkedHtml + '><span></span></label>';
|
||||
html += '<label class="listItemCheckboxContainer"><input type="checkbox" is="emby-checkbox" class="chkMetadataFetcher" data-pluginname="' + escapeHtml(plugin.Name) + '" ' + checkedHtml + '><span></span></label>';
|
||||
html += '<div class="listItemBody">';
|
||||
html += '<h3 class="listItemBodyText">';
|
||||
html += plugin.Name;
|
||||
html += escapeHtml(plugin.Name);
|
||||
html += '</h3>';
|
||||
html += '</div>';
|
||||
if (index > 0) {
|
||||
|
@ -188,13 +189,13 @@ import template from './libraryoptionseditor.template.html';
|
|||
html += '<div class="checkboxList paperList checkboxList-paperList">';
|
||||
for (let i = 0; i < plugins.length; i++) {
|
||||
const plugin = plugins[i];
|
||||
html += `<div class="listItem subtitleFetcherItem sortableOption" data-pluginname="${plugin.Name}">`;
|
||||
html += `<div class="listItem subtitleFetcherItem sortableOption" data-pluginname="${escapeHtml(plugin.Name)}">`;
|
||||
const isChecked = libraryOptions.DisabledSubtitleFetchers ? !libraryOptions.DisabledSubtitleFetchers.includes(plugin.Name) : plugin.DefaultEnabled;
|
||||
const checkedHtml = isChecked ? ' checked="checked"' : '';
|
||||
html += `<label class="listItemCheckboxContainer"><input type="checkbox" is="emby-checkbox" class="chkSubtitleFetcher" data-pluginname="${plugin.Name}" ${checkedHtml}><span></span></label>`;
|
||||
html += `<label class="listItemCheckboxContainer"><input type="checkbox" is="emby-checkbox" class="chkSubtitleFetcher" data-pluginname="${escapeHtml(plugin.Name)}" ${checkedHtml}><span></span></label>`;
|
||||
html += '<div class="listItemBody">';
|
||||
html += '<h3 class="listItemBodyText">';
|
||||
html += plugin.Name;
|
||||
html += escapeHtml(plugin.Name);
|
||||
html += '</h3>';
|
||||
html += '</div>';
|
||||
if (i > 0) {
|
||||
|
@ -227,13 +228,13 @@ import template from './libraryoptionseditor.template.html';
|
|||
html += '<div class="checkboxList paperList checkboxList-paperList">';
|
||||
for (let i = 0; i < plugins.length; i++) {
|
||||
const plugin = plugins[i];
|
||||
html += '<div class="listItem imageFetcherItem sortableOption" data-pluginname="' + plugin.Name + '">';
|
||||
html += '<div class="listItem imageFetcherItem sortableOption" data-pluginname="' + escapeHtml(plugin.Name) + '">';
|
||||
const isChecked = libraryOptionsForType.ImageFetchers ? libraryOptionsForType.ImageFetchers.includes(plugin.Name) : plugin.DefaultEnabled;
|
||||
const checkedHtml = isChecked ? ' checked="checked"' : '';
|
||||
html += '<label class="listItemCheckboxContainer"><input type="checkbox" is="emby-checkbox" class="chkImageFetcher" data-pluginname="' + plugin.Name + '" ' + checkedHtml + '><span></span></label>';
|
||||
html += '<label class="listItemCheckboxContainer"><input type="checkbox" is="emby-checkbox" class="chkImageFetcher" data-pluginname="' + escapeHtml(plugin.Name) + '" ' + checkedHtml + '><span></span></label>';
|
||||
html += '<div class="listItemBody">';
|
||||
html += '<h3 class="listItemBodyText">';
|
||||
html += plugin.Name;
|
||||
html += escapeHtml(plugin.Name);
|
||||
html += '</h3>';
|
||||
html += '</div>';
|
||||
if (i > 0) {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* @module components/listview/listview
|
||||
*/
|
||||
|
||||
import escapeHtml from 'escape-html';
|
||||
import itemHelper from '../itemHelper';
|
||||
import mediaInfo from '../mediainfo/mediainfo';
|
||||
import indicators from '../indicators/indicators';
|
||||
|
@ -203,7 +204,7 @@ import ServerConnections from '../ServerConnections';
|
|||
} else {
|
||||
html += '<h2 class="listGroupHeader">';
|
||||
}
|
||||
html += itemGroupTitle;
|
||||
html += escapeHtml(itemGroupTitle);
|
||||
html += '</h2>';
|
||||
|
||||
html += '<div>';
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* @module components/mediaLibraryCreator/mediaLibraryCreator
|
||||
*/
|
||||
|
||||
import escapeHtml from 'escape-html';
|
||||
import loading from '../loading/loading';
|
||||
import dialogHelper from '../dialogHelper/dialogHelper';
|
||||
import dom from '../../scripts/dom';
|
||||
|
@ -120,10 +121,10 @@ import template from './mediaLibraryCreator.template.html';
|
|||
let html = '';
|
||||
html += '<div class="listItem listItem-border lnkPath" style="padding-left:.5em;">';
|
||||
html += `<div class="${pathInfo.NetworkPath ? 'listItemBody two-line' : 'listItemBody'}">`;
|
||||
html += `<div class="listItemBodyText">${pathInfo.Path}</div>`;
|
||||
html += `<div class="listItemBodyText">${escapeHtml(pathInfo.Path)}</div>`;
|
||||
|
||||
if (pathInfo.NetworkPath) {
|
||||
html += `<div class="listItemBodyText secondary">${pathInfo.NetworkPath}</div>`;
|
||||
html += `<div class="listItemBodyText secondary">${escapeHtml(pathInfo.NetworkPath)}</div>`;
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* @module components/mediaLibraryEditor/mediaLibraryEditor
|
||||
*/
|
||||
|
||||
import escapeHtml from 'escape-html';
|
||||
import 'jquery';
|
||||
import loading from '../loading/loading';
|
||||
import dialogHelper from '../dialogHelper/dialogHelper';
|
||||
|
@ -111,11 +112,11 @@ import template from './mediaLibraryEditor.template.html';
|
|||
html += `<div class="listItem listItem-border lnkPath" data-index="${index}" style="padding-left:.5em;">`;
|
||||
html += `<div class="${pathInfo.NetworkPath ? 'listItemBody two-line' : 'listItemBody'}">`;
|
||||
html += '<h3 class="listItemBodyText">';
|
||||
html += pathInfo.Path;
|
||||
html += escapeHtml(pathInfo.Path);
|
||||
html += '</h3>';
|
||||
|
||||
if (pathInfo.NetworkPath) {
|
||||
html += `<div class="listItemBodyText secondary">${pathInfo.NetworkPath}</div>`;
|
||||
html += `<div class="listItemBodyText secondary">${escapeHtml(pathInfo.NetworkPath)}</div>`;
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
|
@ -213,7 +214,7 @@ export class showEditor {
|
|||
dlg.classList.add('background-theme-a');
|
||||
dlg.classList.add('formDialog');
|
||||
dlg.innerHTML = globalize.translateHtml(template);
|
||||
dlg.querySelector('.formDialogHeaderTitle').innerHTML = options.library.Name;
|
||||
dlg.querySelector('.formDialogHeaderTitle').innerText = options.library.Name;
|
||||
initEditor(dlg, options);
|
||||
dlg.addEventListener('close', onDialogClosed);
|
||||
dialogHelper.open(dlg);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import datetime from '../../scripts/datetime';
|
||||
import globalize from '../../scripts/globalize';
|
||||
import { appRouter } from '../appRouter';
|
||||
|
@ -77,10 +78,10 @@ import '../../elements/emby-button/emby-button';
|
|||
Name: item.ChannelName,
|
||||
Id: item.ChannelId
|
||||
|
||||
})}">${item.ChannelName}</a>`
|
||||
})}">${escapeHtml(item.ChannelName)}</a>`
|
||||
});
|
||||
} else {
|
||||
miscInfo.push(item.ChannelName);
|
||||
miscInfo.push(escapeHtml(item.ChannelName));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -221,7 +222,7 @@ import '../../elements/emby-button/emby-button';
|
|||
});
|
||||
|
||||
if (text) {
|
||||
miscInfo.push(text);
|
||||
miscInfo.push(escapeHtml(text));
|
||||
}
|
||||
} else if (item.IsMovie && item.ProductionYear && options.originalAirDate !== false) {
|
||||
miscInfo.push(item.ProductionYear);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import dom from '../../scripts/dom';
|
||||
import layoutManager from '../layoutManager';
|
||||
import dialogHelper from '../dialogHelper/dialogHelper';
|
||||
|
@ -448,12 +449,12 @@ import template from './metadataEditor.template.html';
|
|||
fullName = idInfo.Name + ' ' + globalize.translate(idInfo.Type);
|
||||
}
|
||||
|
||||
const labelText = globalize.translate('LabelDynamicExternalId', fullName);
|
||||
const labelText = globalize.translate('LabelDynamicExternalId', escapeHtml(fullName));
|
||||
|
||||
html += '<div class="inputContainer">';
|
||||
html += '<div class="flex align-items-center">';
|
||||
|
||||
const value = providerIds[idInfo.Key] || '';
|
||||
const value = escapeHtml(providerIds[idInfo.Key] || '');
|
||||
|
||||
html += '<div class="flex-grow">';
|
||||
html += '<input is="emby-input" class="txtExternalId" value="' + value + '" data-providerkey="' + idInfo.Key + '" data-formatstring="' + formatString + '" id="' + id + '" label="' + labelText + '"/>';
|
||||
|
@ -860,7 +861,7 @@ import template from './metadataEditor.template.html';
|
|||
for (let i = 0, length = ratings.length; i < length; i++) {
|
||||
rating = ratings[i];
|
||||
|
||||
html += "<option value='" + rating.Value + "'>" + rating.Name + '</option>';
|
||||
html += "<option value='" + escapeHtml(rating.Value) + "'>" + escapeHtml(rating.Name) + '</option>';
|
||||
}
|
||||
|
||||
select.innerHTML = html;
|
||||
|
@ -893,7 +894,7 @@ import template from './metadataEditor.template.html';
|
|||
html += '<div class="listItemBody">';
|
||||
|
||||
html += '<div class="textValue">';
|
||||
html += items[i];
|
||||
html += escapeHtml(items[i]);
|
||||
html += '</div>';
|
||||
|
||||
html += '</div>';
|
||||
|
@ -923,7 +924,7 @@ import template from './metadataEditor.template.html';
|
|||
html += '<button style="text-align:left;" type="button" class="btnEditPerson clearButton" data-index="' + i + '">';
|
||||
|
||||
html += '<div class="textValue">';
|
||||
html += (person.Name || '');
|
||||
html += escapeHtml(person.Name || '');
|
||||
html += '</div>';
|
||||
|
||||
if (person.Role && person.Role !== lastType) {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
|
||||
export function getNowPlayingNames(nowPlayingItem, includeNonNameInfo) {
|
||||
let topItem = nowPlayingItem;
|
||||
let bottomItem = null;
|
||||
|
@ -59,13 +61,13 @@ export function getNowPlayingNames(nowPlayingItem, includeNonNameInfo) {
|
|||
const list = [];
|
||||
|
||||
list.push({
|
||||
text: topText,
|
||||
text: escapeHtml(topText),
|
||||
item: topItem
|
||||
});
|
||||
|
||||
if (bottomText) {
|
||||
list.push({
|
||||
text: bottomText,
|
||||
text: escapeHtml(bottomText),
|
||||
item: bottomItem
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import dom from '../../scripts/dom';
|
||||
import dialogHelper from '../dialogHelper/dialogHelper';
|
||||
import loading from '../loading/loading';
|
||||
|
@ -126,7 +127,7 @@ import ServerConnections from '../ServerConnections';
|
|||
html += `<option value="">${globalize.translate('OptionNew')}</option>`;
|
||||
|
||||
html += result.Items.map(i => {
|
||||
return `<option value="${i.Id}">${i.Name}</option>`;
|
||||
return `<option value="${i.Id}">${escapeHtml(i.Name)}</option>`;
|
||||
});
|
||||
|
||||
select.innerHTML = html;
|
||||
|
|
|
@ -54,10 +54,10 @@ export default (() => {
|
|||
dialogHelper.close(dlg);
|
||||
});
|
||||
|
||||
dlg.querySelector('.formDialogHeaderTitle').innerHTML = options.title || '';
|
||||
dlg.querySelector('.formDialogHeaderTitle').innerText = options.title || '';
|
||||
|
||||
if (options.description) {
|
||||
dlg.querySelector('.fieldDescription').innerHTML = options.description;
|
||||
dlg.querySelector('.fieldDescription').innerText = options.description;
|
||||
} else {
|
||||
dlg.querySelector('.fieldDescription').classList.add('hide');
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ export default (() => {
|
|||
return false;
|
||||
});
|
||||
|
||||
dlg.querySelector('.submitText').innerHTML = options.confirmText || globalize.translate('ButtonOk');
|
||||
dlg.querySelector('.submitText').innerText = options.confirmText || globalize.translate('ButtonOk');
|
||||
|
||||
dlg.style.minWidth = `${Math.min(400, dom.getWindowSize().innerWidth - 50)}px`;
|
||||
|
||||
|
|
|
@ -81,10 +81,10 @@ function renderRecording(context, defaultTimer, program, apiClient, refreshRecor
|
|||
imageContainer.classList.add('hide');
|
||||
}
|
||||
|
||||
context.querySelector('.recordingDialog-itemName').innerHTML = program.Name;
|
||||
context.querySelector('.formDialogHeaderTitle').innerHTML = program.Name;
|
||||
context.querySelector('.itemGenres').innerHTML = (program.Genres || []).join(' / ');
|
||||
context.querySelector('.itemOverview').innerHTML = program.Overview || '';
|
||||
context.querySelector('.recordingDialog-itemName').innerText = program.Name;
|
||||
context.querySelector('.formDialogHeaderTitle').innerText = program.Name;
|
||||
context.querySelector('.itemGenres').innerText = (program.Genres || []).join(' / ');
|
||||
context.querySelector('.itemOverview').innerText = program.Overview || '';
|
||||
|
||||
const formDialogFooter = context.querySelector('.formDialogFooter');
|
||||
const now = new Date();
|
||||
|
|
|
@ -45,7 +45,7 @@ function renderTimer(context, item) {
|
|||
context.querySelector('.selectKeepUpTo').value = item.KeepUpTo || 0;
|
||||
|
||||
if (item.ChannelName || item.ChannelNumber) {
|
||||
context.querySelector('.optionChannelOnly').innerHTML = globalize.translate('ChannelNameOnly', item.ChannelName || item.ChannelNumber);
|
||||
context.querySelector('.optionChannelOnly').innerText = globalize.translate('ChannelNameOnly', item.ChannelName || item.ChannelNumber);
|
||||
} else {
|
||||
context.querySelector('.optionChannelOnly').innerHTML = globalize.translate('OneChannel');
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import datetime from '../../scripts/datetime';
|
||||
import backdrop from '../backdrop/backdrop';
|
||||
import listView from '../listview/listview';
|
||||
|
@ -139,13 +140,13 @@ function updateNowPlayingInfo(context, state, serverId) {
|
|||
if (item) {
|
||||
const nowPlayingServerId = (item.ServerId || serverId);
|
||||
if (item.Type == 'Audio' || item.MediaStreams[0].Type == 'Audio') {
|
||||
const songName = item.Name;
|
||||
const songName = escapeHtml(item.Name);
|
||||
let artistsSeries = '';
|
||||
let albumName = '';
|
||||
if (item.Artists != null) {
|
||||
if (item.ArtistItems != null) {
|
||||
for (const artist of item.ArtistItems) {
|
||||
const artistName = artist.Name;
|
||||
const artistName = escapeHtml(artist.Name);
|
||||
const artistId = artist.Id;
|
||||
artistsSeries += `<a class="button-link emby-button" is="emby-linkbutton" href="#!/details?id=${artistId}&serverId=${nowPlayingServerId}">${artistName}</a>`;
|
||||
if (artist !== item.ArtistItems.slice(-1)[0]) {
|
||||
|
@ -157,7 +158,7 @@ function updateNowPlayingInfo(context, state, serverId) {
|
|||
// to normal item.Artists item.
|
||||
// TODO: Normalise fields returned by all the players
|
||||
for (const artist of item.Artists) {
|
||||
artistsSeries += `<a>${artist}</a>`;
|
||||
artistsSeries += `<a>${escapeHtml(artist)}</a>`;
|
||||
if (artist !== item.Artists.slice(-1)[0]) {
|
||||
artistsSeries += ', ';
|
||||
}
|
||||
|
@ -165,27 +166,27 @@ function updateNowPlayingInfo(context, state, serverId) {
|
|||
}
|
||||
}
|
||||
if (item.Album != null) {
|
||||
albumName = '<a class="button-link emby-button" is="emby-linkbutton" href="#!/details?id=' + item.AlbumId + `&serverId=${nowPlayingServerId}">` + item.Album + '</a>';
|
||||
albumName = '<a class="button-link emby-button" is="emby-linkbutton" href="#!/details?id=' + item.AlbumId + `&serverId=${nowPlayingServerId}">` + escapeHtml(item.Album) + '</a>';
|
||||
}
|
||||
context.querySelector('.nowPlayingAlbum').innerHTML = albumName;
|
||||
context.querySelector('.nowPlayingArtist').innerHTML = artistsSeries;
|
||||
context.querySelector('.nowPlayingSongName').innerHTML = songName;
|
||||
context.querySelector('.nowPlayingAlbum').innerText = albumName;
|
||||
context.querySelector('.nowPlayingArtist').innerText = artistsSeries;
|
||||
context.querySelector('.nowPlayingSongName').innerText = songName;
|
||||
} else if (item.Type == 'Episode') {
|
||||
if (item.SeasonName != null) {
|
||||
const seasonName = item.SeasonName;
|
||||
context.querySelector('.nowPlayingSeason').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="#!/details?id=' + item.SeasonId + `&serverId=${nowPlayingServerId}">${seasonName}</a>`;
|
||||
context.querySelector('.nowPlayingSeason').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="#!/details?id=' + item.SeasonId + `&serverId=${nowPlayingServerId}">${escapeHtml(seasonName)}</a>`;
|
||||
}
|
||||
if (item.SeriesName != null) {
|
||||
const seriesName = item.SeriesName;
|
||||
if (item.SeriesId != null) {
|
||||
context.querySelector('.nowPlayingSerie').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="#!/details?id=' + item.SeriesId + `&serverId=${nowPlayingServerId}">${seriesName}</a>`;
|
||||
context.querySelector('.nowPlayingSerie').innerHTML = '<a class="button-link emby-button" is="emby-linkbutton" href="#!/details?id=' + item.SeriesId + `&serverId=${nowPlayingServerId}">${escapeHtml(seriesName)}</a>`;
|
||||
} else {
|
||||
context.querySelector('.nowPlayingSerie').innerHTML = seriesName;
|
||||
context.querySelector('.nowPlayingSerie').innerText = seriesName;
|
||||
}
|
||||
}
|
||||
context.querySelector('.nowPlayingEpisode').innerHTML = item.Name;
|
||||
context.querySelector('.nowPlayingEpisode').innerText = item.Name;
|
||||
} else {
|
||||
context.querySelector('.nowPlayingPageTitle').innerHTML = displayName;
|
||||
context.querySelector('.nowPlayingPageTitle').innerText = displayName;
|
||||
}
|
||||
|
||||
if (displayName.length > 0 && item.Type != 'Audio' && item.Type != 'Episode') {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { BaseItemDto } from '@thornbill/jellyfin-sdk/dist/generated-client';
|
||||
import escapeHtml from 'escape-html';
|
||||
import React, { FunctionComponent, useEffect, useState } from 'react';
|
||||
|
||||
import { appRouter } from '../appRouter';
|
||||
|
@ -16,7 +17,7 @@ const createSuggestionLink = ({ name, href }: { name: string, href: string }) =>
|
|||
class='button-link'
|
||||
style='display: inline-block; padding: 0.5em 1em;'
|
||||
href='${href}'
|
||||
>${name}</a>`
|
||||
>${escapeHtml(name)}</a>`
|
||||
});
|
||||
|
||||
type SearchSuggestionsProps = {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import escapeHtml from 'escape-html';
|
||||
import { appHost } from '../apphost';
|
||||
import dialogHelper from '../dialogHelper/dialogHelper';
|
||||
import layoutManager from '../layoutManager';
|
||||
|
@ -103,11 +104,11 @@ function fillSubtitleList(context, item) {
|
|||
itemHtml += '<div class="listItemBody two-line">';
|
||||
|
||||
itemHtml += '<div>';
|
||||
itemHtml += s.DisplayTitle || '';
|
||||
itemHtml += escapeHtml(s.DisplayTitle || '');
|
||||
itemHtml += '</div>';
|
||||
|
||||
if (s.Path) {
|
||||
itemHtml += '<div class="secondary listItemBodyText">' + (s.Path) + '</div>';
|
||||
itemHtml += '<div class="secondary listItemBodyText">' + escapeHtml(s.Path) + '</div>';
|
||||
}
|
||||
|
||||
itemHtml += '</a>';
|
||||
|
@ -199,7 +200,7 @@ function renderSearchResults(context, results) {
|
|||
|
||||
html += '<div class="listItemBody ' + bodyClass + '">';
|
||||
|
||||
html += '<div>' + (result.Name) + '</div>';
|
||||
html += '<div>' + escapeHtml(result.Name) + '</div>';
|
||||
html += '<div class="secondary listItemBodyText">';
|
||||
|
||||
if (result.Format) {
|
||||
|
@ -212,7 +213,7 @@ function renderSearchResults(context, results) {
|
|||
html += '</div>';
|
||||
|
||||
if (result.Comment) {
|
||||
html += '<div class="secondary listItemBodyText">' + (result.Comment) + '</div>';
|
||||
html += '<div class="secondary listItemBodyText">' + escapeHtml(result.Comment) + '</div>';
|
||||
}
|
||||
|
||||
if (result.IsHashMatch) {
|
||||
|
@ -265,7 +266,7 @@ function reload(context, apiClient, itemId) {
|
|||
}
|
||||
|
||||
if (file) {
|
||||
context.querySelector('.pathValue').innerHTML = file;
|
||||
context.querySelector('.pathValue').innerText = file;
|
||||
context.querySelector('.originalFile').classList.remove('hide');
|
||||
} else {
|
||||
context.querySelector('.pathValue').innerHTML = '';
|
||||
|
|
|
@ -80,7 +80,7 @@ import '../../assets/css/flexstyles.scss';
|
|||
title = item.SeriesName + ' - ' + title;
|
||||
}
|
||||
|
||||
elem.querySelector('.upNextDialog-title').innerHTML = title || '';
|
||||
elem.querySelector('.upNextDialog-title').innerText = title || '';
|
||||
|
||||
instance.itemType = item.Type;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue