mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add constructor capitalization rule
This commit is contained in:
parent
8e2ea6812a
commit
ec0adb895b
43 changed files with 103 additions and 94 deletions
|
@ -35,9 +35,15 @@ module.exports = {
|
||||||
'indent': ['error', 4, { 'SwitchCase': 1 }],
|
'indent': ['error', 4, { 'SwitchCase': 1 }],
|
||||||
'jsx-quotes': ['error', 'prefer-single'],
|
'jsx-quotes': ['error', 'prefer-single'],
|
||||||
'keyword-spacing': ['error'],
|
'keyword-spacing': ['error'],
|
||||||
'no-throw-literal': ['error'],
|
|
||||||
'max-statements-per-line': ['error'],
|
'max-statements-per-line': ['error'],
|
||||||
'max-params': ['error', 7],
|
'max-params': ['error', 7],
|
||||||
|
'new-cap': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'capIsNewExceptions': ['jQuery.Deferred'],
|
||||||
|
'newIsCapExceptionPattern': '\\.default$'
|
||||||
|
}
|
||||||
|
],
|
||||||
'no-duplicate-imports': ['error'],
|
'no-duplicate-imports': ['error'],
|
||||||
'no-empty-function': ['error'],
|
'no-empty-function': ['error'],
|
||||||
'no-floating-decimal': ['error'],
|
'no-floating-decimal': ['error'],
|
||||||
|
@ -52,6 +58,7 @@ module.exports = {
|
||||||
'no-sequences': ['error', { 'allowInParentheses': false }],
|
'no-sequences': ['error', { 'allowInParentheses': false }],
|
||||||
'no-shadow': ['off'],
|
'no-shadow': ['off'],
|
||||||
'@typescript-eslint/no-shadow': ['error'],
|
'@typescript-eslint/no-shadow': ['error'],
|
||||||
|
'no-throw-literal': ['error'],
|
||||||
'no-trailing-spaces': ['error'],
|
'no-trailing-spaces': ['error'],
|
||||||
'no-unused-expressions': ['off'],
|
'no-unused-expressions': ['off'],
|
||||||
'@typescript-eslint/no-unused-expressions': ['error', { 'allowShortCircuit': true, 'allowTernary': true, 'allowTaggedTemplates': true }],
|
'@typescript-eslint/no-unused-expressions': ['error', { 'allowShortCircuit': true, 'allowTernary': true, 'allowTaggedTemplates': true }],
|
||||||
|
|
|
@ -65,12 +65,12 @@ const Home: FunctionComponent = () => {
|
||||||
depends = 'favorites';
|
depends = 'favorites';
|
||||||
}
|
}
|
||||||
|
|
||||||
return import(/* webpackChunkName: "[request]" */ `../../../controllers/${depends}`).then(({ default: controllerFactory }) => {
|
return import(/* webpackChunkName: "[request]" */ `../../../controllers/${depends}`).then(({ default: ControllerFactory }) => {
|
||||||
let controller = tabControllers[index];
|
let controller = tabControllers[index];
|
||||||
|
|
||||||
if (!controller) {
|
if (!controller) {
|
||||||
const tabContent = element.current?.querySelector(".tabContent[data-index='" + index + "']");
|
const tabContent = element.current?.querySelector(".tabContent[data-index='" + index + "']");
|
||||||
controller = new controllerFactory(tabContent, null);
|
controller = new ControllerFactory(tabContent, null);
|
||||||
tabControllers[index] = controller;
|
tabControllers[index] = controller;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ function render() {
|
||||||
return elem;
|
return elem;
|
||||||
}
|
}
|
||||||
|
|
||||||
class appFooter {
|
class AppFooter {
|
||||||
constructor() {
|
constructor() {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
|
@ -33,4 +33,4 @@ class appFooter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new appFooter();
|
export default new AppFooter();
|
||||||
|
|
|
@ -12,7 +12,7 @@ import 'material-design-icons-iconfont';
|
||||||
import '../formdialog.scss';
|
import '../formdialog.scss';
|
||||||
import ServerConnections from '../ServerConnections';
|
import ServerConnections from '../ServerConnections';
|
||||||
|
|
||||||
export default class channelMapper {
|
export default class ChannelMapper {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
function mapChannel(button, channelId, providerChannelId) {
|
function mapChannel(button, channelId, providerChannelId) {
|
||||||
loading.show();
|
loading.show();
|
||||||
|
|
|
@ -345,8 +345,8 @@ function executeCommand(item, id, options) {
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'addtoplaylist':
|
case 'addtoplaylist':
|
||||||
import('./playlisteditor/playlisteditor').then(({ default: playlistEditor }) => {
|
import('./playlisteditor/playlisteditor').then(({ default: PlaylistEditor }) => {
|
||||||
new playlistEditor({
|
new PlaylistEditor({
|
||||||
items: [itemId],
|
items: [itemId],
|
||||||
serverId: serverId
|
serverId: serverId
|
||||||
}).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id));
|
}).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id));
|
||||||
|
@ -630,8 +630,8 @@ function deleteItem(apiClient, item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function refresh(apiClient, item) {
|
function refresh(apiClient, item) {
|
||||||
import('./refreshdialog/refreshdialog').then(({ default: refreshDialog }) => {
|
import('./refreshdialog/refreshdialog').then(({ default: RefreshDialog }) => {
|
||||||
new refreshDialog({
|
new RefreshDialog({
|
||||||
itemIds: [item.Id],
|
itemIds: [item.Id],
|
||||||
serverId: apiClient.serverInfo().Id,
|
serverId: apiClient.serverInfo().Id,
|
||||||
mode: item.Type === 'CollectionFolder' ? 'scan' : null
|
mode: item.Type === 'CollectionFolder' ? 'scan' : null
|
||||||
|
|
|
@ -188,7 +188,7 @@ function initLibraryOptions(dlg) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export class showEditor {
|
export class MediaLibraryCreator {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
currentOptions = options;
|
currentOptions = options;
|
||||||
|
@ -224,4 +224,4 @@ let currentOptions;
|
||||||
let hasChanges = false;
|
let hasChanges = false;
|
||||||
let isCreating = false;
|
let isCreating = false;
|
||||||
|
|
||||||
export default showEditor;
|
export default MediaLibraryCreator;
|
||||||
|
|
|
@ -197,7 +197,7 @@ function onDialogClosed() {
|
||||||
currentDeferred.resolveWith(null, [hasChanges]);
|
currentDeferred.resolveWith(null, [hasChanges]);
|
||||||
}
|
}
|
||||||
|
|
||||||
export class showEditor {
|
export class MediaLibraryEditor {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
const deferred = jQuery.Deferred();
|
const deferred = jQuery.Deferred();
|
||||||
currentOptions = options;
|
currentOptions = options;
|
||||||
|
@ -231,4 +231,4 @@ let currentOptions;
|
||||||
let hasChanges = false;
|
let hasChanges = false;
|
||||||
let isCreating = false;
|
let isCreating = false;
|
||||||
|
|
||||||
export default showEditor;
|
export default MediaLibraryEditor;
|
||||||
|
|
|
@ -6,7 +6,7 @@ import dom from '../../scripts/dom';
|
||||||
import './multiSelect.scss';
|
import './multiSelect.scss';
|
||||||
import ServerConnections from '../ServerConnections';
|
import ServerConnections from '../ServerConnections';
|
||||||
import alert from '../alert';
|
import alert from '../alert';
|
||||||
import playlistEditor from '../playlisteditor/playlisteditor';
|
import PlaylistEditor from '../playlisteditor/playlisteditor';
|
||||||
import confirm from '../confirm/confirm';
|
import confirm from '../confirm/confirm';
|
||||||
import itemHelper from '../itemHelper';
|
import itemHelper from '../itemHelper';
|
||||||
import datetime from '../../scripts/datetime';
|
import datetime from '../../scripts/datetime';
|
||||||
|
@ -269,7 +269,7 @@ function showMenuForSelectedItems(e) {
|
||||||
dispatchNeedsRefresh();
|
dispatchNeedsRefresh();
|
||||||
break;
|
break;
|
||||||
case 'playlist':
|
case 'playlist':
|
||||||
new playlistEditor({
|
new PlaylistEditor({
|
||||||
items: items,
|
items: items,
|
||||||
serverId: serverId
|
serverId: serverId
|
||||||
});
|
});
|
||||||
|
@ -299,8 +299,8 @@ function showMenuForSelectedItems(e) {
|
||||||
dispatchNeedsRefresh();
|
dispatchNeedsRefresh();
|
||||||
break;
|
break;
|
||||||
case 'refresh':
|
case 'refresh':
|
||||||
import('../refreshdialog/refreshdialog').then(({ default: refreshDialog }) => {
|
import('../refreshdialog/refreshdialog').then(({ default: RefreshDialog }) => {
|
||||||
new refreshDialog({
|
new RefreshDialog({
|
||||||
itemIds: items,
|
itemIds: items,
|
||||||
serverId: serverId
|
serverId: serverId
|
||||||
}).show();
|
}).show();
|
||||||
|
|
|
@ -221,7 +221,7 @@ function centerFocus(elem, horiz, on) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export class showEditor {
|
export class PlaylistEditor {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
const items = options.items || {};
|
const items = options.items || {};
|
||||||
currentServerId = options.serverId;
|
currentServerId = options.serverId;
|
||||||
|
@ -280,4 +280,4 @@ export class showEditor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default showEditor;
|
export default PlaylistEditor;
|
||||||
|
|
|
@ -72,13 +72,13 @@ class PluginManager {
|
||||||
throw new TypeError('Plugin definitions in window have to be an (async) function returning the plugin class');
|
throw new TypeError('Plugin definitions in window have to be an (async) function returning the plugin class');
|
||||||
}
|
}
|
||||||
|
|
||||||
const pluginClass = await pluginDefinition();
|
const PluginClass = await pluginDefinition();
|
||||||
if (typeof pluginClass !== 'function') {
|
if (typeof PluginClass !== 'function') {
|
||||||
throw new TypeError(`Plugin definition doesn't return a class for '${pluginSpec}'`);
|
throw new TypeError(`Plugin definition doesn't return a class for '${pluginSpec}'`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// init plugin and pass basic dependencies
|
// init plugin and pass basic dependencies
|
||||||
plugin = new pluginClass({
|
plugin = new PluginClass({
|
||||||
events: Events,
|
events: Events,
|
||||||
loading,
|
loading,
|
||||||
appSettings,
|
appSettings,
|
||||||
|
|
|
@ -6,7 +6,7 @@ import loading from '../loading/loading';
|
||||||
import scrollHelper from '../../scripts/scrollHelper';
|
import scrollHelper from '../../scripts/scrollHelper';
|
||||||
import datetime from '../../scripts/datetime';
|
import datetime from '../../scripts/datetime';
|
||||||
import imageLoader from '../images/imageLoader';
|
import imageLoader from '../images/imageLoader';
|
||||||
import recordingFields from './recordingfields';
|
import RecordingFields from './recordingfields';
|
||||||
import Events from '../../utils/events.ts';
|
import Events from '../../utils/events.ts';
|
||||||
import '../../elements/emby-button/emby-button';
|
import '../../elements/emby-button/emby-button';
|
||||||
import '../../elements/emby-button/paper-icon-button-light';
|
import '../../elements/emby-button/paper-icon-button-light';
|
||||||
|
@ -185,7 +185,7 @@ function showEditor(itemId, serverId) {
|
||||||
|
|
||||||
reload(dlg, itemId, serverId);
|
reload(dlg, itemId, serverId);
|
||||||
|
|
||||||
currentRecordingFields = new recordingFields({
|
currentRecordingFields = new RecordingFields({
|
||||||
parent: dlg.querySelector('.recordingFields'),
|
parent: dlg.querySelector('.recordingFields'),
|
||||||
programId: itemId,
|
programId: itemId,
|
||||||
serverId: serverId
|
serverId: serverId
|
||||||
|
|
|
@ -691,10 +691,10 @@ export default function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function savePlaylist() {
|
function savePlaylist() {
|
||||||
import('../playlisteditor/playlisteditor').then(({ default: playlistEditor }) => {
|
import('../playlisteditor/playlisteditor').then(({ default: PlaylistEditor }) => {
|
||||||
getSaveablePlaylistItems().then(function (items) {
|
getSaveablePlaylistItems().then(function (items) {
|
||||||
const serverId = items.length ? items[0].ServerId : ApiClient.serverId();
|
const serverId = items.length ? items[0].ServerId : ApiClient.serverId();
|
||||||
new playlistEditor({
|
new PlaylistEditor({
|
||||||
items: items.map(function (i) {
|
items: items.map(function (i) {
|
||||||
return i.Id;
|
return i.Id;
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -270,8 +270,8 @@ function executeAction(card, target, action) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function addToPlaylist(item) {
|
function addToPlaylist(item) {
|
||||||
import('./playlisteditor/playlisteditor').then(({ default: playlistEditor }) => {
|
import('./playlisteditor/playlisteditor').then(({ default: PlaylistEditor }) => {
|
||||||
new playlistEditor().show({
|
new PlaylistEditor().show({
|
||||||
items: [item.Id],
|
items: [item.Id],
|
||||||
serverId: item.ServerId
|
serverId: item.ServerId
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ function discoverDevices(view) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function tunerPicker() {
|
function TunerPicker() {
|
||||||
this.show = function () {
|
this.show = function () {
|
||||||
const dialogOptions = {
|
const dialogOptions = {
|
||||||
removeOnClose: true,
|
removeOnClose: true,
|
||||||
|
@ -182,4 +182,4 @@ function tunerPicker() {
|
||||||
|
|
||||||
let currentDevices = [];
|
let currentDevices = [];
|
||||||
|
|
||||||
export default tunerPicker;
|
export default TunerPicker;
|
||||||
|
|
|
@ -21,6 +21,7 @@ viewContainer.setOnBeforeChange(function (newView, isRestored, options) {
|
||||||
newView.initComplete = true;
|
newView.initComplete = true;
|
||||||
|
|
||||||
if (typeof options.controllerFactory === 'function') {
|
if (typeof options.controllerFactory === 'function') {
|
||||||
|
// eslint-disable-next-line new-cap
|
||||||
new options.controllerFactory(newView, eventDetail.detail.params);
|
new options.controllerFactory(newView, eventDetail.detail.params);
|
||||||
} else if (options.controllerFactory && typeof options.controllerFactory.default === 'function') {
|
} else if (options.controllerFactory && typeof options.controllerFactory.default === 'function') {
|
||||||
new options.controllerFactory.default(newView, eventDetail.detail.params);
|
new options.controllerFactory.default(newView, eventDetail.detail.params);
|
||||||
|
|
|
@ -13,8 +13,8 @@ import confirm from '../../components/confirm/confirm';
|
||||||
import cardBuilder from '../../components/cardbuilder/cardBuilder';
|
import cardBuilder from '../../components/cardbuilder/cardBuilder';
|
||||||
|
|
||||||
function addVirtualFolder(page) {
|
function addVirtualFolder(page) {
|
||||||
import('../../components/mediaLibraryCreator/mediaLibraryCreator').then(({ default: medialibrarycreator }) => {
|
import('../../components/mediaLibraryCreator/mediaLibraryCreator').then(({ default: MediaLibraryCreator }) => {
|
||||||
new medialibrarycreator({
|
new MediaLibraryCreator({
|
||||||
collectionTypeOptions: getCollectionTypeOptions().filter(function (f) {
|
collectionTypeOptions: getCollectionTypeOptions().filter(function (f) {
|
||||||
return !f.hidden;
|
return !f.hidden;
|
||||||
}),
|
}),
|
||||||
|
@ -28,8 +28,8 @@ function addVirtualFolder(page) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function editVirtualFolder(page, virtualFolder) {
|
function editVirtualFolder(page, virtualFolder) {
|
||||||
import('../../components/mediaLibraryEditor/mediaLibraryEditor').then(({ default: medialibraryeditor }) => {
|
import('../../components/mediaLibraryEditor/mediaLibraryEditor').then(({ default: MediaLibraryEditor }) => {
|
||||||
new medialibraryeditor({
|
new MediaLibraryEditor({
|
||||||
refresh: shouldRefreshLibraryAfterChanges(page),
|
refresh: shouldRefreshLibraryAfterChanges(page),
|
||||||
library: virtualFolder
|
library: virtualFolder
|
||||||
}).then(function (hasChanges) {
|
}).then(function (hasChanges) {
|
||||||
|
@ -62,8 +62,8 @@ function deleteVirtualFolder(page, virtualFolder) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshVirtualFolder(page, virtualFolder) {
|
function refreshVirtualFolder(page, virtualFolder) {
|
||||||
import('../../components/refreshdialog/refreshdialog').then(({ default: refreshDialog }) => {
|
import('../../components/refreshdialog/refreshdialog').then(({ default: RefreshDialog }) => {
|
||||||
new refreshDialog({
|
new RefreshDialog({
|
||||||
itemIds: [virtualFolder.ItemId],
|
itemIds: [virtualFolder.ItemId],
|
||||||
serverId: ApiClient.serverId(),
|
serverId: ApiClient.serverId(),
|
||||||
mode: 'scan'
|
mode: 'scan'
|
||||||
|
|
|
@ -49,11 +49,11 @@ class HomeView extends TabbedView {
|
||||||
}
|
}
|
||||||
|
|
||||||
const instance = this;
|
const instance = this;
|
||||||
return import(/* webpackChunkName: "[request]" */ `../controllers/${depends}`).then(({ default: controllerFactory }) => {
|
return import(/* webpackChunkName: "[request]" */ `../controllers/${depends}`).then(({ default: ControllerFactory }) => {
|
||||||
let controller = instance.tabControllers[index];
|
let controller = instance.tabControllers[index];
|
||||||
|
|
||||||
if (!controller) {
|
if (!controller) {
|
||||||
controller = new controllerFactory(instance.view.querySelector(".tabContent[data-index='" + index + "']"), instance.params);
|
controller = new ControllerFactory(instance.view.querySelector(".tabContent[data-index='" + index + "']"), instance.params);
|
||||||
instance.tabControllers[index] = controller;
|
instance.tabControllers[index] = controller;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -691,8 +691,8 @@ function showRecordingFields(instance, page, item, user) {
|
||||||
const recordingFieldsElement = page.querySelector('.recordingFields');
|
const recordingFieldsElement = page.querySelector('.recordingFields');
|
||||||
|
|
||||||
if (item.Type == 'Program' && user.Policy.EnableLiveTvManagement) {
|
if (item.Type == 'Program' && user.Policy.EnableLiveTvManagement) {
|
||||||
import('../../components/recordingcreator/recordingfields').then(({ default: recordingFields }) => {
|
import('../../components/recordingcreator/recordingfields').then(({ default: RecordingFields }) => {
|
||||||
instance.currentRecordingFields = new recordingFields({
|
instance.currentRecordingFields = new RecordingFields({
|
||||||
parent: recordingFieldsElement,
|
parent: recordingFieldsElement,
|
||||||
programId: item.Id,
|
programId: item.Id,
|
||||||
serverId: item.ServerId
|
serverId: item.ServerId
|
||||||
|
@ -1826,7 +1826,7 @@ function renderCast(page, item) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function itemDetailPage() {
|
function ItemDetailPage() {
|
||||||
const self = this;
|
const self = this;
|
||||||
self.setInitialCollapsibleState = setInitialCollapsibleState;
|
self.setInitialCollapsibleState = setInitialCollapsibleState;
|
||||||
self.renderDetails = renderDetails;
|
self.renderDetails = renderDetails;
|
||||||
|
@ -1846,7 +1846,7 @@ function onTrackSelectionsSubmit(e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.ItemDetailPage = new itemDetailPage();
|
window.ItemDetailPage = new ItemDetailPage();
|
||||||
|
|
||||||
export default function (view, params) {
|
export default function (view, params) {
|
||||||
function getApiClient() {
|
function getApiClient() {
|
||||||
|
|
|
@ -399,8 +399,8 @@ function showSortMenu() {
|
||||||
function onNewItemClick() {
|
function onNewItemClick() {
|
||||||
const instance = this;
|
const instance = this;
|
||||||
|
|
||||||
import('../components/playlisteditor/playlisteditor').then(({ default: playlistEditor }) => {
|
import('../components/playlisteditor/playlisteditor').then(({ default: PlaylistEditor }) => {
|
||||||
new playlistEditor({
|
new PlaylistEditor({
|
||||||
items: [],
|
items: [],
|
||||||
serverId: instance.params.serverId
|
serverId: instance.params.serverId
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import tvguide from '../../components/guide/guide';
|
import Guide from '../../components/guide/guide';
|
||||||
|
|
||||||
export default function (view, params, tabContent) {
|
export default function (view, params, tabContent) {
|
||||||
let guideInstance;
|
let guideInstance;
|
||||||
|
@ -6,7 +6,7 @@ export default function (view, params, tabContent) {
|
||||||
|
|
||||||
self.renderTab = function () {
|
self.renderTab = function () {
|
||||||
if (!guideInstance) {
|
if (!guideInstance) {
|
||||||
guideInstance = new tvguide({
|
guideInstance = new Guide({
|
||||||
element: tabContent,
|
element: tabContent,
|
||||||
serverId: ApiClient.serverId()
|
serverId: ApiClient.serverId()
|
||||||
});
|
});
|
||||||
|
|
|
@ -274,7 +274,7 @@ export default function (view, params) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
import(`../livetv/${depends}`).then(({ default: controllerFactory }) => {
|
import(`../livetv/${depends}`).then(({ default: ControllerFactory }) => {
|
||||||
let tabContent;
|
let tabContent;
|
||||||
|
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
|
@ -290,7 +290,7 @@ export default function (view, params) {
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
controller = self;
|
controller = self;
|
||||||
} else {
|
} else {
|
||||||
controller = new controllerFactory(view, params, tabContent);
|
controller = new ControllerFactory(view, params, tabContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
tabControllers[index] = controller;
|
tabControllers[index] = controller;
|
||||||
|
|
|
@ -9,8 +9,8 @@ function onListingsSubmitted() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function init(page, type, providerId) {
|
function init(page, type, providerId) {
|
||||||
import(`../components/tvproviders/${type}`).then(({ default: factory }) => {
|
import(`../components/tvproviders/${type}`).then(({ default: ProviderFactory }) => {
|
||||||
const instance = new factory(page, providerId, {});
|
const instance = new ProviderFactory(page, providerId, {});
|
||||||
Events.on(instance, 'submitted', onListingsSubmitted);
|
Events.on(instance, 'submitted', onListingsSubmitted);
|
||||||
instance.init();
|
instance.init();
|
||||||
});
|
});
|
||||||
|
|
|
@ -165,8 +165,8 @@ function showProviderOptions(page, providerId, button) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function mapChannels(page, providerId) {
|
function mapChannels(page, providerId) {
|
||||||
import('../components/channelMapper/channelMapper').then(({ default: channelMapper }) => {
|
import('../components/channelMapper/channelMapper').then(({ default: ChannelMapper }) => {
|
||||||
new channelMapper({
|
new ChannelMapper({
|
||||||
serverId: ApiClient.serverInfo().Id,
|
serverId: ApiClient.serverInfo().Id,
|
||||||
providerId: providerId
|
providerId: providerId
|
||||||
}).show();
|
}).show();
|
||||||
|
|
|
@ -106,8 +106,8 @@ function submitForm(page) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDetectedDevice() {
|
function getDetectedDevice() {
|
||||||
return import('../components/tunerPicker').then(({ default: tunerPicker }) => {
|
return import('../components/tunerPicker').then(({ default: TunerPicker }) => {
|
||||||
return new tunerPicker().show({
|
return new TunerPicker().show({
|
||||||
serverId: ApiClient.serverId()
|
serverId: ApiClient.serverId()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -289,8 +289,8 @@ export default function (view, params, tabContent, options) {
|
||||||
query = userSettings.loadQuerySettings(savedQueryKey, query);
|
query = userSettings.loadQuerySettings(savedQueryKey, query);
|
||||||
|
|
||||||
this.showFilterMenu = function () {
|
this.showFilterMenu = function () {
|
||||||
import('../../components/filterdialog/filterdialog').then(({ default: filterDialogFactory }) => {
|
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
|
||||||
const filterDialog = new filterDialogFactory({
|
const filterDialog = new FilterDialog({
|
||||||
query: query,
|
query: query,
|
||||||
mode: 'movies',
|
mode: 'movies',
|
||||||
serverId: ApiClient.serverId()
|
serverId: ApiClient.serverId()
|
||||||
|
|
|
@ -314,7 +314,7 @@ export default function (view, params) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
import(`../movies/${depends}`).then(({ default: controllerFactory }) => {
|
import(`../movies/${depends}`).then(({ default: ControllerFactory }) => {
|
||||||
let tabContent;
|
let tabContent;
|
||||||
|
|
||||||
if (index === suggestionsTabIndex) {
|
if (index === suggestionsTabIndex) {
|
||||||
|
@ -330,11 +330,11 @@ export default function (view, params) {
|
||||||
if (index === suggestionsTabIndex) {
|
if (index === suggestionsTabIndex) {
|
||||||
controller = this;
|
controller = this;
|
||||||
} else if (index == 0 || index == 3) {
|
} else if (index == 0 || index == 3) {
|
||||||
controller = new controllerFactory(view, params, tabContent, {
|
controller = new ControllerFactory(view, params, tabContent, {
|
||||||
mode: index ? 'favorites' : 'movies'
|
mode: index ? 'favorites' : 'movies'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
controller = new controllerFactory(view, params, tabContent);
|
controller = new ControllerFactory(view, params, tabContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
tabControllers[index] = controller;
|
tabControllers[index] = controller;
|
||||||
|
|
|
@ -182,8 +182,8 @@ export default function (view, params, tabContent) {
|
||||||
let isLoading = false;
|
let isLoading = false;
|
||||||
|
|
||||||
this.showFilterMenu = function () {
|
this.showFilterMenu = function () {
|
||||||
import('../../components/filterdialog/filterdialog').then(({ default: filterDialogFactory }) => {
|
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
|
||||||
const filterDialog = new filterDialogFactory({
|
const filterDialog = new FilterDialog({
|
||||||
query: getQuery(),
|
query: getQuery(),
|
||||||
mode: 'movies',
|
mode: 'movies',
|
||||||
serverId: ApiClient.serverId()
|
serverId: ApiClient.serverId()
|
||||||
|
|
|
@ -189,8 +189,8 @@ export default function (view, params, tabContent) {
|
||||||
let isLoading = false;
|
let isLoading = false;
|
||||||
|
|
||||||
this.showFilterMenu = function () {
|
this.showFilterMenu = function () {
|
||||||
import('../../components/filterdialog/filterdialog').then(({ default: filterDialogFactory }) => {
|
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
|
||||||
const filterDialog = new filterDialogFactory({
|
const filterDialog = new FilterDialog({
|
||||||
query: getQuery(),
|
query: getQuery(),
|
||||||
mode: 'albums',
|
mode: 'albums',
|
||||||
serverId: ApiClient.serverId()
|
serverId: ApiClient.serverId()
|
||||||
|
|
|
@ -170,8 +170,8 @@ export default function (view, params, tabContent) {
|
||||||
let isLoading = false;
|
let isLoading = false;
|
||||||
|
|
||||||
this.showFilterMenu = function () {
|
this.showFilterMenu = function () {
|
||||||
import('../../components/filterdialog/filterdialog').then(({ default: filterDialogFactory }) => {
|
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
|
||||||
const filterDialog = new filterDialogFactory({
|
const filterDialog = new FilterDialog({
|
||||||
query: getQuery(tabContent),
|
query: getQuery(tabContent),
|
||||||
mode: this.mode,
|
mode: this.mode,
|
||||||
serverId: ApiClient.serverId()
|
serverId: ApiClient.serverId()
|
||||||
|
|
|
@ -290,7 +290,7 @@ export default function (view, params) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
import(`../music/${depends}`).then(({ default: controllerFactory }) => {
|
import(`../music/${depends}`).then(({ default: ControllerFactory }) => {
|
||||||
let tabContent;
|
let tabContent;
|
||||||
|
|
||||||
if (index == 1) {
|
if (index == 1) {
|
||||||
|
@ -306,7 +306,7 @@ export default function (view, params) {
|
||||||
if (index === 1) {
|
if (index === 1) {
|
||||||
controller = this;
|
controller = this;
|
||||||
} else {
|
} else {
|
||||||
controller = new controllerFactory(view, params, tabContent);
|
controller = new ControllerFactory(view, params, tabContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index == 2) {
|
if (index == 2) {
|
||||||
|
|
|
@ -135,8 +135,8 @@ export default function (view, params, tabContent) {
|
||||||
let isLoading = false;
|
let isLoading = false;
|
||||||
|
|
||||||
self.showFilterMenu = function () {
|
self.showFilterMenu = function () {
|
||||||
import('../../components/filterdialog/filterdialog').then(({ default: filterDialogFactory }) => {
|
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
|
||||||
const filterDialog = new filterDialogFactory({
|
const filterDialog = new FilterDialog({
|
||||||
query: getQuery(tabContent),
|
query: getQuery(tabContent),
|
||||||
mode: 'songs',
|
mode: 'songs',
|
||||||
serverId: ApiClient.serverId()
|
serverId: ApiClient.serverId()
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import remotecontrolFactory from '../../../components/remotecontrol/remotecontrol';
|
import RemoteControl from '../../../components/remotecontrol/remotecontrol';
|
||||||
import libraryMenu from '../../../scripts/libraryMenu';
|
import libraryMenu from '../../../scripts/libraryMenu';
|
||||||
import '../../../elements/emby-button/emby-button';
|
import '../../../elements/emby-button/emby-button';
|
||||||
|
|
||||||
export default function (view) {
|
export default function (view) {
|
||||||
const remoteControl = new remotecontrolFactory();
|
const remoteControl = new RemoteControl();
|
||||||
remoteControl.init(view, view.querySelector('.remoteControlContent'));
|
remoteControl.init(view, view.querySelector('.remoteControlContent'));
|
||||||
view.addEventListener('viewshow', function () {
|
view.addEventListener('viewshow', function () {
|
||||||
libraryMenu.setTransparentMenu(true);
|
libraryMenu.setTransparentMenu(true);
|
||||||
|
|
|
@ -171,8 +171,8 @@ export default function (view, params, tabContent) {
|
||||||
let isLoading = false;
|
let isLoading = false;
|
||||||
|
|
||||||
self.showFilterMenu = function () {
|
self.showFilterMenu = function () {
|
||||||
import('../../components/filterdialog/filterdialog').then(({ default: filterDialogFactory }) => {
|
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
|
||||||
const filterDialog = new filterDialogFactory({
|
const filterDialog = new FilterDialog({
|
||||||
query: getQuery(tabContent),
|
query: getQuery(tabContent),
|
||||||
mode: 'episodes',
|
mode: 'episodes',
|
||||||
serverId: ApiClient.serverId()
|
serverId: ApiClient.serverId()
|
||||||
|
|
|
@ -268,7 +268,7 @@ export default function (view, params) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
import(`../shows/${depends}`).then(({ default: controllerFactory }) => {
|
import(`../shows/${depends}`).then(({ default: ControllerFactory }) => {
|
||||||
let tabContent;
|
let tabContent;
|
||||||
|
|
||||||
if (index === 1) {
|
if (index === 1) {
|
||||||
|
@ -284,7 +284,7 @@ export default function (view, params) {
|
||||||
if (index === 1) {
|
if (index === 1) {
|
||||||
controller = self;
|
controller = self;
|
||||||
} else {
|
} else {
|
||||||
controller = new controllerFactory(view, params, tabContent);
|
controller = new ControllerFactory(view, params, tabContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
tabControllers[index] = controller;
|
tabControllers[index] = controller;
|
||||||
|
|
|
@ -199,8 +199,8 @@ export default function (view, params, tabContent) {
|
||||||
let isLoading = false;
|
let isLoading = false;
|
||||||
|
|
||||||
this.showFilterMenu = function () {
|
this.showFilterMenu = function () {
|
||||||
import('../../components/filterdialog/filterdialog').then(({ default: filterDialogFactory }) => {
|
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
|
||||||
const filterDialog = new filterDialogFactory({
|
const filterDialog = new FilterDialog({
|
||||||
query: getQuery(tabContent),
|
query: getQuery(tabContent),
|
||||||
mode: 'series',
|
mode: 'series',
|
||||||
serverId: ApiClient.serverId()
|
serverId: ApiClient.serverId()
|
||||||
|
|
|
@ -5,7 +5,7 @@ import layoutManager from '../../components/layoutManager';
|
||||||
import dom from '../../scripts/dom';
|
import dom from '../../scripts/dom';
|
||||||
import browser from '../../scripts/browser';
|
import browser from '../../scripts/browser';
|
||||||
import focusManager from '../../components/focusManager';
|
import focusManager from '../../components/focusManager';
|
||||||
import scrollerFactory from '../../libraries/scroller';
|
import ScrollerFactory from '../../libraries/scroller';
|
||||||
import ScrollButtons from '../emby-scrollbuttons/ScrollButtons';
|
import ScrollButtons from '../emby-scrollbuttons/ScrollButtons';
|
||||||
import './emby-scroller.scss';
|
import './emby-scroller.scss';
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ const Scroller: FC<ScrollerProps> = ({
|
||||||
scrollPos: 0,
|
scrollPos: 0,
|
||||||
scrollWidth: 0
|
scrollWidth: 0
|
||||||
});
|
});
|
||||||
const scrollerFactoryRef = useRef<scrollerFactory | null>(null);
|
const scrollerFactoryRef = useRef<ScrollerFactory | null>(null);
|
||||||
|
|
||||||
const getScrollSlider = useCallback(() => {
|
const getScrollSlider = useCallback(() => {
|
||||||
if (scrollerFactoryRef.current) {
|
if (scrollerFactoryRef.current) {
|
||||||
|
@ -126,7 +126,7 @@ const Scroller: FC<ScrollerProps> = ({
|
||||||
});
|
});
|
||||||
}, [getScrollPosition, getScrollSize, getScrollWidth]);
|
}, [getScrollPosition, getScrollSize, getScrollWidth]);
|
||||||
|
|
||||||
const initCenterFocus = useCallback((elem, scrollerInstance: scrollerFactory) => {
|
const initCenterFocus = useCallback((elem, scrollerInstance: ScrollerFactory) => {
|
||||||
dom.addEventListener(elem, 'focus', function (e: FocusEvent) {
|
dom.addEventListener(elem, 'focus', function (e: FocusEvent) {
|
||||||
const focused = focusManager.focusableParent(e.target);
|
const focused = focusManager.focusableParent(e.target);
|
||||||
if (focused) {
|
if (focused) {
|
||||||
|
@ -179,7 +179,7 @@ const Scroller: FC<ScrollerProps> = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
// If just inserted it might not have any height yet - yes this is a hack
|
// If just inserted it might not have any height yet - yes this is a hack
|
||||||
scrollerFactoryRef.current = new scrollerFactory(scrollRef.current, options);
|
scrollerFactoryRef.current = new ScrollerFactory(scrollRef.current, options);
|
||||||
scrollerFactoryRef.current.init();
|
scrollerFactoryRef.current.init();
|
||||||
scrollerFactoryRef.current.reload();
|
scrollerFactoryRef.current.reload();
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import scroller from '../../libraries/scroller';
|
import ScrollerFactory from '../../libraries/scroller';
|
||||||
import dom from '../../scripts/dom';
|
import dom from '../../scripts/dom';
|
||||||
import layoutManager from '../../components/layoutManager';
|
import layoutManager from '../../components/layoutManager';
|
||||||
import inputManager from '../../scripts/inputManager';
|
import inputManager from '../../scripts/inputManager';
|
||||||
|
@ -140,7 +140,7 @@ ScrollerPrototype.attachedCallback = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
// If just inserted it might not have any height yet - yes this is a hack
|
// If just inserted it might not have any height yet - yes this is a hack
|
||||||
this.scroller = new scroller(scrollFrame, options);
|
this.scroller = new ScrollerFactory(scrollFrame, options);
|
||||||
this.scroller.init();
|
this.scroller.init();
|
||||||
this.scroller.reload();
|
this.scroller.reload();
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import 'webcomponents.js/webcomponents-lite';
|
import 'webcomponents.js/webcomponents-lite';
|
||||||
import dom from '../../scripts/dom';
|
import dom from '../../scripts/dom';
|
||||||
import scroller from '../../libraries/scroller';
|
import ScrollerFactory from '../../libraries/scroller';
|
||||||
import browser from '../../scripts/browser';
|
import browser from '../../scripts/browser';
|
||||||
import focusManager from '../../components/focusManager';
|
import focusManager from '../../components/focusManager';
|
||||||
import layoutManager from '../../components/layoutManager';
|
import layoutManager from '../../components/layoutManager';
|
||||||
|
@ -124,7 +124,7 @@ function initScroller(tabs) {
|
||||||
|
|
||||||
const contentScrollSlider = tabs.querySelector('.emby-tabs-slider');
|
const contentScrollSlider = tabs.querySelector('.emby-tabs-slider');
|
||||||
if (contentScrollSlider) {
|
if (contentScrollSlider) {
|
||||||
tabs.scroller = new scroller(tabs, {
|
tabs.scroller = new ScrollerFactory(tabs, {
|
||||||
horizontal: 1,
|
horizontal: 1,
|
||||||
itemNav: 0,
|
itemNav: 0,
|
||||||
mouseDragging: 1,
|
mouseDragging: 1,
|
||||||
|
|
|
@ -19,7 +19,7 @@ function calculateOffset(textarea) {
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
function autoGrow(textarea, maxLines) {
|
function AutoGrow(textarea, maxLines) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
if (maxLines === undefined) {
|
if (maxLines === undefined) {
|
||||||
|
@ -125,7 +125,7 @@ EmbyTextAreaPrototype.attachedCallback = function () {
|
||||||
label.innerText = text;
|
label.innerText = text;
|
||||||
};
|
};
|
||||||
|
|
||||||
new autoGrow(this);
|
new AutoGrow(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
document.registerElement('emby-textarea', {
|
document.registerElement('emby-textarea', {
|
||||||
|
|
|
@ -904,6 +904,7 @@ scrollerFactory.prototype.toCenter = function (item, immediate) {
|
||||||
};
|
};
|
||||||
|
|
||||||
scrollerFactory.create = function (frame, options) {
|
scrollerFactory.create = function (frame, options) {
|
||||||
|
// eslint-disable-next-line new-cap
|
||||||
const instance = new scrollerFactory(frame, options);
|
const instance = new scrollerFactory(frame, options);
|
||||||
return Promise.resolve(instance);
|
return Promise.resolve(instance);
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,7 @@ import appSettings from '../../scripts/settings/appSettings';
|
||||||
import * as userSettings from '../../scripts/settings/userSettings';
|
import * as userSettings from '../../scripts/settings/userSettings';
|
||||||
import { playbackManager } from '../../components/playback/playbackmanager';
|
import { playbackManager } from '../../components/playback/playbackmanager';
|
||||||
import globalize from '../../scripts/globalize';
|
import globalize from '../../scripts/globalize';
|
||||||
import castSenderApiLoader from './castSenderApi';
|
import CastSenderApi from './castSenderApi';
|
||||||
import ServerConnections from '../../components/ServerConnections';
|
import ServerConnections from '../../components/ServerConnections';
|
||||||
import alert from '../../components/alert';
|
import alert from '../../components/alert';
|
||||||
import { PluginType } from '../../types/plugin.ts';
|
import { PluginType } from '../../types/plugin.ts';
|
||||||
|
@ -576,7 +576,7 @@ class ChromecastPlayer {
|
||||||
this.isLocalPlayer = false;
|
this.isLocalPlayer = false;
|
||||||
this.lastPlayerData = {};
|
this.lastPlayerData = {};
|
||||||
|
|
||||||
new castSenderApiLoader().load().then(initializeChromecast.bind(this));
|
new CastSenderApi().load().then(initializeChromecast.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
tryPair() {
|
tryPair() {
|
||||||
|
|
|
@ -1490,8 +1490,8 @@ export class HtmlVideoPlayer {
|
||||||
// add some cues to show the text
|
// add some cues to show the text
|
||||||
// in safari, the cues need to be added before setting the track mode to showing
|
// in safari, the cues need to be added before setting the track mode to showing
|
||||||
for (const trackEvent of data.TrackEvents) {
|
for (const trackEvent of data.TrackEvents) {
|
||||||
const trackCueObject = window.VTTCue || window.TextTrackCue;
|
const TrackCue = window.VTTCue || window.TextTrackCue;
|
||||||
const cue = new trackCueObject(trackEvent.StartPositionTicks / 10000000, trackEvent.EndPositionTicks / 10000000, normalizeTrackEventText(trackEvent.Text, false));
|
const cue = new TrackCue(trackEvent.StartPositionTicks / 10000000, trackEvent.EndPositionTicks / 10000000, normalizeTrackEventText(trackEvent.Text, false));
|
||||||
|
|
||||||
if (cue.line === 'auto') {
|
if (cue.line === 'auto') {
|
||||||
cue.line = cueLine;
|
cue.line = cueLine;
|
||||||
|
|
|
@ -189,9 +189,9 @@ export default function (view) {
|
||||||
reloadItems();
|
reloadItems();
|
||||||
});
|
});
|
||||||
view.querySelector('.btnNewPlaylist').addEventListener('click', function () {
|
view.querySelector('.btnNewPlaylist').addEventListener('click', function () {
|
||||||
import('../components/playlisteditor/playlisteditor').then(({ default: playlistEditor }) => {
|
import('../components/playlisteditor/playlisteditor').then(({ default: PlaylistEditor }) => {
|
||||||
const serverId = ApiClient.serverInfo().Id;
|
const serverId = ApiClient.serverInfo().Id;
|
||||||
new playlistEditor({
|
new PlaylistEditor({
|
||||||
items: [],
|
items: [],
|
||||||
serverId: serverId
|
serverId: serverId
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue