mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use static imports for html templates
This commit is contained in:
parent
75e1fc4605
commit
d8f2cc1245
31 changed files with 1010 additions and 1041 deletions
|
@ -12,6 +12,7 @@ import globalize from '../../scripts/globalize';
|
|||
import '../../elements/emby-select/emby-select';
|
||||
import '../../elements/emby-button/paper-icon-button-light';
|
||||
import '../formdialog.css';
|
||||
import template from './accessSchedule.template.html';
|
||||
|
||||
function getDisplayTime(hours) {
|
||||
let minutes = 0;
|
||||
|
@ -60,7 +61,6 @@ import '../formdialog.css';
|
|||
|
||||
export function show(options) {
|
||||
return new Promise((resolve, reject) => {
|
||||
import('./accessSchedule.template.html').then(({default: template}) => {
|
||||
const dlg = dialogHelper.createDialog({
|
||||
removeOnClose: true,
|
||||
size: 'small'
|
||||
|
@ -88,7 +88,6 @@ import '../formdialog.css';
|
|||
return false;
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/* eslint-enable indent */
|
||||
|
|
|
@ -9,6 +9,7 @@ import '../../elements/emby-button/paper-icon-button-light';
|
|||
import '../../elements/emby-input/emby-input';
|
||||
import '../formdialog.css';
|
||||
import '../../assets/css/flexstyles.scss';
|
||||
import template from './dialog.template.html';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -128,7 +129,6 @@ import '../../assets/css/flexstyles.scss';
|
|||
options = text;
|
||||
}
|
||||
|
||||
const { default: template } = await import('./dialog.template.html');
|
||||
return new Promise((resolve, reject) => {
|
||||
showDialog(options, template).then(resolve, reject);
|
||||
});
|
||||
|
|
|
@ -13,6 +13,7 @@ import '../../elements/emby-checkbox/emby-checkbox';
|
|||
import '../../elements/emby-button/emby-button';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import toast from '../toast/toast';
|
||||
import template from './displaySettings.template.html';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -197,8 +198,7 @@ import toast from '../toast/toast';
|
|||
return false;
|
||||
}
|
||||
|
||||
async function embed(options, self) {
|
||||
const { default: template } = await import('./displaySettings.template.html');
|
||||
function embed(options, self) {
|
||||
options.element.innerHTML = globalize.translateHtml(template, 'core');
|
||||
options.element.querySelector('form').addEventListener('submit', onSubmit.bind(self));
|
||||
if (options.enableSaveButton) {
|
||||
|
|
|
@ -6,6 +6,7 @@ import '../../elements/emby-checkbox/emby-checkbox';
|
|||
import '../../elements/emby-collapse/emby-collapse';
|
||||
import './style.css';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import template from './filterdialog.template.html';
|
||||
|
||||
/* eslint-disable indent */
|
||||
function renderOptions(context, selector, cssClass, items, isCheckedFn) {
|
||||
|
@ -402,7 +403,6 @@ import ServerConnections from '../ServerConnections';
|
|||
}
|
||||
|
||||
show() {
|
||||
return import('./filterdialog.template.html').then(({default: template}) => {
|
||||
return new Promise((resolve) => {
|
||||
const dlg = dialogHelper.createDialog({
|
||||
removeOnClose: true,
|
||||
|
@ -424,7 +424,6 @@ import ServerConnections from '../ServerConnections';
|
|||
loadDynamicFilters(dlg, apiClient, apiClient.getCurrentUserId(), this.options.query);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@ import 'material-design-icons-iconfont';
|
|||
import '../formdialog.css';
|
||||
import '../../assets/css/flexstyles.scss';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import template from './filtermenu.template.html';
|
||||
|
||||
|
||||
function onSubmit(e) {
|
||||
e.preventDefault();
|
||||
|
@ -210,7 +212,6 @@ function loadDynamicFilters(context, options) {
|
|||
class FilterMenu {
|
||||
show(options) {
|
||||
return new Promise( (resolve, reject) => {
|
||||
import('./filtermenu.template.html').then(({ default: template }) => {
|
||||
const dialogOptions = {
|
||||
removeOnClose: true,
|
||||
scrollY: false
|
||||
|
@ -280,7 +281,6 @@ class FilterMenu {
|
|||
return resolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import '../../elements/emby-checkbox/emby-checkbox';
|
|||
import '../../elements/emby-radio/emby-radio';
|
||||
import '../formdialog.css';
|
||||
import 'material-design-icons-iconfont';
|
||||
import template from './guide-settings.template.html';
|
||||
|
||||
function saveCategories(context, options) {
|
||||
const categories = [];
|
||||
|
@ -88,7 +89,6 @@ function showEditor(options) {
|
|||
return new Promise(function (resolve, reject) {
|
||||
let settingsChanged = false;
|
||||
|
||||
import('./guide-settings.template.html').then(({ default: template }) => {
|
||||
const dialogOptions = {
|
||||
removeOnClose: true,
|
||||
scrollY: false
|
||||
|
@ -141,7 +141,6 @@ function showEditor(options) {
|
|||
loadCategories(dlg, options);
|
||||
dialogHelper.open(dlg);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
|
@ -25,6 +25,8 @@ import '../../elements/emby-scroller/emby-scroller';
|
|||
import '../../assets/css/flexstyles.scss';
|
||||
import 'webcomponents.js/webcomponents-lite';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import template from './tvguide.template.html';
|
||||
|
||||
|
||||
function showViewSettings(instance) {
|
||||
import('./guide-settings').then(({default: guideSettingsDialog}) => {
|
||||
|
@ -1092,7 +1094,6 @@ function Guide(options) {
|
|||
}
|
||||
}
|
||||
|
||||
import('./tvguide.template.html').then(({default: template}) => {
|
||||
const context = options.element;
|
||||
|
||||
context.classList.add('tvguide');
|
||||
|
@ -1192,7 +1193,6 @@ function Guide(options) {
|
|||
Events.on(serverNotifications, 'SeriesTimerCancelled', onSeriesTimerCancelled);
|
||||
|
||||
self.refresh();
|
||||
});
|
||||
}
|
||||
|
||||
export default Guide;
|
||||
|
|
|
@ -11,6 +11,7 @@ import '../../elements/emby-select/emby-select';
|
|||
import '../../elements/emby-checkbox/emby-checkbox';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import toast from '../toast/toast';
|
||||
import template from './homeScreenSettings.template.html';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -418,12 +419,12 @@ import toast from '../toast/toast';
|
|||
}
|
||||
|
||||
function embed(options, self) {
|
||||
return import('./homeScreenSettings.template.html').then(({default: template}) => {
|
||||
let workingTemplate = template;
|
||||
for (let i = 1; i <= numConfigurableSections; i++) {
|
||||
template = template.replace(`{section${i}label}`, globalize.translate('LabelHomeScreenSectionValue', i));
|
||||
workingTemplate = workingTemplate.replace(`{section${i}label}`, globalize.translate('LabelHomeScreenSectionValue', i));
|
||||
}
|
||||
|
||||
options.element.innerHTML = globalize.translateHtml(template, 'core');
|
||||
options.element.innerHTML = globalize.translateHtml(workingTemplate, 'core');
|
||||
|
||||
options.element.querySelector('.viewOrderList').addEventListener('click', onSectionOrderListClick);
|
||||
options.element.querySelector('form').addEventListener('submit', onSubmit.bind(self));
|
||||
|
@ -440,7 +441,6 @@ import toast from '../toast/toast';
|
|||
}
|
||||
|
||||
self.loadData(options.autoFocus);
|
||||
});
|
||||
}
|
||||
|
||||
class HomeScreenSettings {
|
||||
|
|
|
@ -13,6 +13,7 @@ import '../../elements/emby-button/emby-button';
|
|||
import '../formdialog.css';
|
||||
import '../cardbuilder/card.css';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import template from './imageDownloader.template.html';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -316,7 +317,6 @@ import ServerConnections from '../ServerConnections';
|
|||
function showEditor(itemId, serverId, itemType) {
|
||||
loading.show();
|
||||
|
||||
import('./imageDownloader.template.html').then(({default: template}) => {
|
||||
const apiClient = ServerConnections.getApiClient(serverId);
|
||||
|
||||
currentItemId = itemId;
|
||||
|
@ -353,7 +353,6 @@ import ServerConnections from '../ServerConnections';
|
|||
});
|
||||
|
||||
reloadBrowsableImages(editorContent, apiClient);
|
||||
});
|
||||
}
|
||||
|
||||
function onDialogClosed() {
|
||||
|
|
|
@ -17,6 +17,7 @@ import '../formdialog.css';
|
|||
import './style.css';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import toast from '../toast/toast';
|
||||
import template from './imageUploader.template.html';
|
||||
|
||||
let currentItemId;
|
||||
let currentServerId;
|
||||
|
@ -128,7 +129,6 @@ import toast from '../toast/toast';
|
|||
function showEditor(options, resolve) {
|
||||
options = options || {};
|
||||
|
||||
return import('./imageUploader.template.html').then(({default: template}) => {
|
||||
currentItemId = options.itemId;
|
||||
currentServerId = options.serverId;
|
||||
|
||||
|
@ -171,7 +171,6 @@ import toast from '../toast/toast';
|
|||
dlg.querySelector('.btnCancel').addEventListener('click', () => {
|
||||
dialogHelper.close(dlg);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function show(options) {
|
||||
|
|
|
@ -16,6 +16,7 @@ import './imageeditor.css';
|
|||
import ServerConnections from '../ServerConnections';
|
||||
import alert from '../alert';
|
||||
import confirm from '../confirm/confirm';
|
||||
import template from './imageeditor.template.html';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -419,7 +420,6 @@ import confirm from '../confirm/confirm';
|
|||
|
||||
loading.show();
|
||||
|
||||
import('./imageeditor.template.html').then(({default: template}) => {
|
||||
const apiClient = ServerConnections.getApiClient(serverId);
|
||||
apiClient.getItem(apiClient.getCurrentUserId(), itemId).then(function (item) {
|
||||
const dialogOptions = {
|
||||
|
@ -467,7 +467,6 @@ import confirm from '../confirm/confirm';
|
|||
dialogHelper.close(dlg);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function show (options) {
|
||||
|
|
|
@ -17,6 +17,7 @@ import '../formdialog.css';
|
|||
import 'material-design-icons-iconfont';
|
||||
import '../../assets/css/flexstyles.scss';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import template from './itemMediaInfo.template.html';
|
||||
|
||||
function setMediaInfo(user, page, item) {
|
||||
let html = item.MediaSources.map(version => {
|
||||
|
@ -194,11 +195,9 @@ import ServerConnections from '../ServerConnections';
|
|||
|
||||
export function show(itemId, serverId) {
|
||||
loading.show();
|
||||
return import('./itemMediaInfo.template.html').then(({default: template}) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
loadMediaInfo(itemId, serverId, template).then(resolve, reject);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/* eslint-enable indent */
|
||||
|
|
|
@ -20,6 +20,7 @@ import 'material-design-icons-iconfont';
|
|||
import '../cardbuilder/card.css';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import toast from '../toast/toast';
|
||||
import template from './itemidentifier.template.html';
|
||||
|
||||
const enableFocusTransform = !browser.slow && !browser.edge;
|
||||
|
||||
|
@ -334,7 +335,6 @@ import toast from '../toast/toast';
|
|||
function showEditor(itemId) {
|
||||
loading.show();
|
||||
|
||||
return import('./itemidentifier.template.html').then(({default: template}) => {
|
||||
const apiClient = getApiClient();
|
||||
|
||||
apiClient.getItem(apiClient.getCurrentUserId(), itemId).then(item => {
|
||||
|
@ -399,7 +399,6 @@ import toast from '../toast/toast';
|
|||
showIdentificationForm(dlg, item);
|
||||
loading.hide();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function onDialogClosed() {
|
||||
|
@ -416,7 +415,6 @@ import toast from '../toast/toast';
|
|||
currentItem = null;
|
||||
currentItemType = itemType;
|
||||
|
||||
return import('./itemidentifier.template.html').then(({default: template}) => {
|
||||
const dialogOptions = {
|
||||
size: 'small',
|
||||
removeOnClose: true,
|
||||
|
@ -463,7 +461,6 @@ import toast from '../toast/toast';
|
|||
dlg.classList.add('identifyDialog');
|
||||
|
||||
showIdentificationFormFindNew(dlg, itemName, itemYear, itemType);
|
||||
});
|
||||
}
|
||||
|
||||
function showIdentificationFormFindNew(dlg, itemName, itemYear, itemType) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import dom from '../../scripts/dom';
|
|||
import '../../elements/emby-checkbox/emby-checkbox';
|
||||
import '../../elements/emby-select/emby-select';
|
||||
import '../../elements/emby-input/emby-input';
|
||||
import template from './libraryoptionseditor.template.html';
|
||||
|
||||
function populateLanguages(parent) {
|
||||
return ApiClient.getCultures().then(languages => {
|
||||
|
@ -363,8 +364,6 @@ import '../../elements/emby-input/emby-input';
|
|||
const isNewLibrary = libraryOptions === null;
|
||||
isNewLibrary && parent.classList.add('newlibrary');
|
||||
|
||||
const { default: template } = await import('./libraryoptionseditor.template.html');
|
||||
|
||||
parent.innerHTML = globalize.translateHtml(template);
|
||||
populateRefreshInterval(parent.querySelector('#selectAutoRefreshInterval'));
|
||||
const promises = [populateLanguages(parent), populateCountries(parent.querySelector('#selectCountry'))];
|
||||
|
|
|
@ -21,6 +21,7 @@ import '../formdialog.css';
|
|||
import '../../assets/css/flexstyles.scss';
|
||||
import toast from '../toast/toast';
|
||||
import alert from '../alert';
|
||||
import template from './mediaLibraryCreator.template.html';
|
||||
|
||||
function onAddLibrary() {
|
||||
if (isCreating) {
|
||||
|
@ -191,7 +192,6 @@ export class showEditor {
|
|||
currentOptions = options;
|
||||
currentResolve = resolve;
|
||||
hasChanges = false;
|
||||
import('./mediaLibraryCreator.template.html').then(({default: template}) => {
|
||||
const dlg = dialogHelper.createDialog({
|
||||
size: 'small',
|
||||
modal: false,
|
||||
|
@ -213,7 +213,6 @@ export class showEditor {
|
|||
renderPaths(dlg);
|
||||
initLibraryOptions(dlg);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ import '../../elements/emby-toggle/emby-toggle';
|
|||
import '../../assets/css/flexstyles.scss';
|
||||
import toast from '../toast/toast';
|
||||
import confirm from '../confirm/confirm';
|
||||
import template from './mediaLibraryEditor.template.html';
|
||||
|
||||
function onEditLibrary() {
|
||||
if (isCreating) {
|
||||
|
@ -201,7 +202,6 @@ export class showEditor {
|
|||
currentOptions = options;
|
||||
currentDeferred = deferred;
|
||||
hasChanges = false;
|
||||
import('./mediaLibraryEditor.template.html').then(({default: template}) => {
|
||||
const dlg = dialogHelper.createDialog({
|
||||
size: 'small',
|
||||
modal: false,
|
||||
|
@ -221,7 +221,6 @@ export class showEditor {
|
|||
dialogHelper.close(dlg);
|
||||
});
|
||||
refreshLibraryFromServer(dlg);
|
||||
});
|
||||
return deferred.promise();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ import '../../assets/css/flexstyles.scss';
|
|||
import ServerConnections from '../ServerConnections';
|
||||
import toast from '../toast/toast';
|
||||
import { appRouter } from '../appRouter';
|
||||
import template from './metadataEditor.template.html';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -1028,7 +1029,6 @@ import { appRouter } from '../appRouter';
|
|||
function show(itemId, serverId, resolve, reject) {
|
||||
loading.show();
|
||||
|
||||
import('./metadataEditor.template.html').then(({default: template}) => {
|
||||
const dialogOptions = {
|
||||
removeOnClose: true,
|
||||
scrollY: false
|
||||
|
@ -1069,7 +1069,6 @@ import { appRouter } from '../appRouter';
|
|||
init(dlg, ServerConnections.getApiClient(serverId));
|
||||
|
||||
reload(dlg, itemId, serverId);
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
|
@ -1083,7 +1082,6 @@ import { appRouter } from '../appRouter';
|
|||
return new Promise(function (resolve, reject) {
|
||||
loading.show();
|
||||
|
||||
import('./metadataEditor.template.html').then(({default: template}) => {
|
||||
elem.innerHTML = globalize.translateHtml(template, 'core');
|
||||
|
||||
elem.querySelector('.formDialogFooter').classList.remove('formDialogFooter');
|
||||
|
@ -1098,7 +1096,6 @@ import { appRouter } from '../appRouter';
|
|||
|
||||
focusManager.autoFocus(elem);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import '../../elements/emby-button/paper-icon-button-light';
|
|||
import '../../elements/emby-input/emby-input';
|
||||
import '../../elements/emby-select/emby-select';
|
||||
import '../formdialog.css';
|
||||
import template from './personEditor.template.html';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -18,7 +19,6 @@ import '../formdialog.css';
|
|||
|
||||
function show(person) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
import('./personEditor.template.html').then(({default: template}) => {
|
||||
const dialogOptions = {
|
||||
removeOnClose: true,
|
||||
scrollY: false
|
||||
|
@ -92,7 +92,6 @@ import '../formdialog.css';
|
|||
bubbles: true
|
||||
}));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
|
@ -10,6 +10,7 @@ import '../../elements/emby-select/emby-select';
|
|||
import '../../elements/emby-checkbox/emby-checkbox';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import toast from '../toast/toast';
|
||||
import template from './playbackSettings.template.html';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -278,7 +279,6 @@ import toast from '../toast/toast';
|
|||
}
|
||||
|
||||
function embed(options, self) {
|
||||
return import('./playbackSettings.template.html').then(({default: template}) => {
|
||||
options.element.innerHTML = globalize.translateHtml(template, 'core');
|
||||
|
||||
options.element.querySelector('form').addEventListener('submit', onSubmit.bind(self));
|
||||
|
@ -292,7 +292,6 @@ import toast from '../toast/toast';
|
|||
if (options.autoFocus) {
|
||||
focusManager.autoFocus(options.element);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
class PlaybackSettings {
|
||||
|
|
|
@ -9,6 +9,7 @@ import '../../elements/emby-button/emby-button';
|
|||
import '../../elements/emby-button/paper-icon-button-light';
|
||||
import '../../elements/emby-input/emby-input';
|
||||
import '../formdialog.css';
|
||||
import template from './prompt.template.html';
|
||||
|
||||
/* eslint-disable indent */
|
||||
export default (() => {
|
||||
|
@ -117,7 +118,6 @@ export default (() => {
|
|||
} else {
|
||||
return options => {
|
||||
return new Promise((resolve, reject) => {
|
||||
import('./prompt.template.html').then(({default: template}) => {
|
||||
if (typeof options === 'string') {
|
||||
options = {
|
||||
title: '',
|
||||
|
@ -126,7 +126,6 @@ export default (() => {
|
|||
}
|
||||
showDialog(options, template).then(resolve, reject);
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
})();
|
||||
|
|
|
@ -18,6 +18,7 @@ import './recordingcreator.css';
|
|||
import 'material-design-icons-iconfont';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import { playbackManager } from '../playback/playbackmanager';
|
||||
import template from './recordingcreator.template.html';
|
||||
|
||||
let currentDialog;
|
||||
let closeAction;
|
||||
|
@ -136,7 +137,6 @@ function showEditor(itemId, serverId) {
|
|||
|
||||
loading.show();
|
||||
|
||||
import('./recordingcreator.template.html').then(({ default: template }) => {
|
||||
const dialogOptions = {
|
||||
removeOnClose: true,
|
||||
scrollY: false
|
||||
|
@ -194,7 +194,6 @@ function showEditor(itemId, serverId) {
|
|||
|
||||
dialogHelper.open(dlg);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
|
@ -14,6 +14,7 @@ import './recordingcreator.css';
|
|||
import 'material-design-icons-iconfont';
|
||||
import '../../assets/css/flexstyles.scss';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import template from './recordingeditor.template.html';
|
||||
|
||||
let currentDialog;
|
||||
let recordingDeleted = false;
|
||||
|
@ -91,7 +92,6 @@ function showEditor(itemId, serverId, options) {
|
|||
options = options || {};
|
||||
currentResolve = resolve;
|
||||
|
||||
import('./recordingeditor.template.html').then(({default: template}) => {
|
||||
const dialogOptions = {
|
||||
removeOnClose: true,
|
||||
scrollY: false
|
||||
|
@ -148,7 +148,6 @@ function showEditor(itemId, serverId, options) {
|
|||
|
||||
dialogHelper.open(dlg);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
|
@ -10,6 +10,7 @@ import './recordingfields.css';
|
|||
import '../../assets/css/flexstyles.scss';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import toast from '../toast/toast';
|
||||
import template from './recordingfields.template.html';
|
||||
|
||||
/*eslint prefer-const: "error"*/
|
||||
|
||||
|
@ -119,7 +120,6 @@ class RecordingEditor {
|
|||
embed() {
|
||||
const self = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
import('./recordingfields.template.html').then(({default: template}) => {
|
||||
const options = self.options;
|
||||
const context = options.parent;
|
||||
context.innerHTML = globalize.translateHtml(template, 'core');
|
||||
|
@ -131,7 +131,6 @@ class RecordingEditor {
|
|||
|
||||
fetchData(self).then(resolve);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
hasChanged() {
|
||||
|
|
|
@ -15,6 +15,7 @@ import './recordingcreator.css';
|
|||
import 'material-design-icons-iconfont';
|
||||
import '../../assets/css/flexstyles.scss';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import template from './seriesrecordingeditor.template.html';
|
||||
|
||||
/*eslint prefer-const: "error"*/
|
||||
|
||||
|
@ -151,7 +152,6 @@ function embed(itemId, serverId, options) {
|
|||
loading.show();
|
||||
options = options || {};
|
||||
|
||||
import('./seriesrecordingeditor.template.html').then(({ default: template }) => {
|
||||
const dialogOptions = {
|
||||
removeOnClose: true,
|
||||
scrollY: false
|
||||
|
@ -182,7 +182,6 @@ function embed(itemId, serverId, options) {
|
|||
init(dlg);
|
||||
|
||||
reload(dlg, itemId);
|
||||
});
|
||||
}
|
||||
|
||||
function showEditor(itemId, serverId, options) {
|
||||
|
@ -193,7 +192,6 @@ function showEditor(itemId, serverId, options) {
|
|||
loading.show();
|
||||
options = options || {};
|
||||
|
||||
import('./seriesrecordingeditor.template.html').then(({ default: template }) => {
|
||||
const dialogOptions = {
|
||||
removeOnClose: true,
|
||||
scrollY: false
|
||||
|
@ -253,7 +251,6 @@ function showEditor(itemId, serverId, options) {
|
|||
|
||||
dialogHelper.open(dlg);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
|
@ -7,6 +7,7 @@ import '../../elements/emby-input/emby-input';
|
|||
import '../../assets/css/flexstyles.scss';
|
||||
import 'material-design-icons-iconfont';
|
||||
import './searchfields.css';
|
||||
import template from './searchfields.template.html';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -61,7 +62,6 @@ import './searchfields.css';
|
|||
}
|
||||
|
||||
function embed(elem, instance, options) {
|
||||
import('./searchfields.template.html').then(({default: template}) => {
|
||||
let html = globalize.translateHtml(template, 'core');
|
||||
|
||||
if (browser.tizen || browser.orsay) {
|
||||
|
@ -84,7 +84,6 @@ import './searchfields.css';
|
|||
txtSearch.addEventListener('input', onSearchInput.bind(instance));
|
||||
|
||||
instance.focus();
|
||||
});
|
||||
}
|
||||
|
||||
class SearchFields {
|
||||
|
|
|
@ -6,6 +6,7 @@ import '../../elements/emby-scroller/emby-scroller';
|
|||
import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||
import '../../elements/emby-button/emby-button';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import template from './searchresults.template.html';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -585,19 +586,18 @@ import ServerConnections from '../ServerConnections';
|
|||
}
|
||||
|
||||
function embed(elem, instance, options) {
|
||||
import('./searchresults.template.html').then(({default: template}) => {
|
||||
let workingTemplate = template;
|
||||
if (!enableScrollX()) {
|
||||
template = replaceAll(template, 'data-horizontal="true"', 'data-horizontal="false"');
|
||||
template = replaceAll(template, 'itemsContainer scrollSlider', 'itemsContainer scrollSlider vertical-wrap');
|
||||
workingTemplate = replaceAll(workingTemplate, 'data-horizontal="true"', 'data-horizontal="false"');
|
||||
workingTemplate = replaceAll(workingTemplate, 'itemsContainer scrollSlider', 'itemsContainer scrollSlider vertical-wrap');
|
||||
}
|
||||
|
||||
const html = globalize.translateHtml(template, 'core');
|
||||
const html = globalize.translateHtml(workingTemplate, 'core');
|
||||
|
||||
elem.innerHTML = html;
|
||||
|
||||
elem.classList.add('searchResults');
|
||||
instance.search('');
|
||||
});
|
||||
}
|
||||
|
||||
class SearchResults {
|
||||
|
|
|
@ -8,6 +8,7 @@ import 'material-design-icons-iconfont';
|
|||
import '../formdialog.css';
|
||||
import '../../elements/emby-button/emby-button';
|
||||
import '../../assets/css/flexstyles.scss';
|
||||
import template from './sortmenu.template.html';
|
||||
|
||||
function onSubmit(e) {
|
||||
e.preventDefault();
|
||||
|
@ -44,7 +45,6 @@ function saveValues(context, settingsKey) {
|
|||
class SortMenu {
|
||||
show(options) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
import('./sortmenu.template.html').then(({default: template}) => {
|
||||
const dialogOptions = {
|
||||
removeOnClose: true,
|
||||
scrollY: false
|
||||
|
@ -103,7 +103,6 @@ class SortMenu {
|
|||
reject();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ import '../../assets/css/flexstyles.scss';
|
|||
import ServerConnections from '../ServerConnections';
|
||||
import toast from '../toast/toast';
|
||||
import confirm from '../confirm/confirm';
|
||||
import template from './subtitleeditor.template.html';
|
||||
|
||||
let currentItem;
|
||||
let hasChanges;
|
||||
|
@ -454,10 +455,8 @@ function showEditor(itemId, serverId) {
|
|||
loading.show();
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
import('./subtitleeditor.template.html').then(({default: template}) => {
|
||||
showEditorInternal(itemId, serverId, template).then(resolve, reject);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
|
@ -17,6 +17,7 @@ import '../../assets/css/flexstyles.scss';
|
|||
import './subtitlesettings.css';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import toast from '../toast/toast';
|
||||
import template from './subtitlesettings.template.html';
|
||||
|
||||
/**
|
||||
* Subtitle settings.
|
||||
|
@ -158,7 +159,6 @@ function hideSubtitlePreview(persistent) {
|
|||
}
|
||||
|
||||
function embed(options, self) {
|
||||
import('./subtitlesettings.template.html').then(({default: template}) => {
|
||||
options.element.classList.add('subtitlesettings');
|
||||
options.element.innerHTML = globalize.translateHtml(template, 'core');
|
||||
|
||||
|
@ -214,7 +214,6 @@ function embed(options, self) {
|
|||
if (options.autoFocus) {
|
||||
focusManager.autoFocus(options.element);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export class SubtitleSettings {
|
||||
|
|
|
@ -10,6 +10,7 @@ import '../../elements/emby-select/emby-select';
|
|||
import 'material-design-icons-iconfont';
|
||||
import '../formdialog.css';
|
||||
import '../../assets/css/flexstyles.scss';
|
||||
import template from './viewSettings.template.html';
|
||||
|
||||
function onSubmit(e) {
|
||||
e.preventDefault();
|
||||
|
@ -59,7 +60,6 @@ class ViewSettings {
|
|||
}
|
||||
show(options) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
import('./viewSettings.template.html').then(({default: template}) => {
|
||||
const dialogOptions = {
|
||||
removeOnClose: true,
|
||||
scrollY: false
|
||||
|
@ -135,7 +135,6 @@ class ViewSettings {
|
|||
reject();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import './emby-progressring.css';
|
||||
import 'webcomponents.js/webcomponents-lite';
|
||||
import template from './emby-progressring.template.html';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -9,7 +10,6 @@ import 'webcomponents.js/webcomponents-lite';
|
|||
this.classList.add('progressring');
|
||||
const instance = this;
|
||||
|
||||
import('./emby-progressring.template.html').then(({default: template}) => {
|
||||
instance.innerHTML = template;
|
||||
|
||||
if (window.MutationObserver) {
|
||||
|
@ -30,7 +30,6 @@ import 'webcomponents.js/webcomponents-lite';
|
|||
}
|
||||
|
||||
instance.setProgress(parseFloat(instance.getAttribute('data-progress') || '0'));
|
||||
});
|
||||
};
|
||||
|
||||
EmbyProgressRing.setProgress = function (progress) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue