Make import paths ES6-compatible

This commit is contained in:
MrTimscampi 2020-08-14 08:46:34 +02:00 committed by vitorsemeano
parent 1a635e2f81
commit bfb8c7c1f6
245 changed files with 2073 additions and 1995 deletions

View file

@ -1,10 +1,9 @@
import dom from 'dom';
import layoutManager from 'layoutManager';
import shell from 'shell';
import appRouter from 'appRouter';
import appHost from 'apphost';
import 'css!./emby-button';
import 'webcomponents';
import { removeEventListener, addEventListener } from '../../scripts/dom';
import layoutManager from '../../components/layoutManager';
import shell from '../../scripts/shell';
import appRouter from '../../components/appRouter';
import appHost from '../../components/apphost';
import './emby-button.css';
const EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
const EmbyLinkButtonPrototype = Object.create(HTMLAnchorElement.prototype);
@ -30,7 +29,7 @@ EmbyButtonPrototype.createdCallback = function () {
return;
}
this.classList.add('emby-button');
this.classList.add('../../elements/emby-button/emby-button');
// TODO replace all instances of element-showfocus with this method
if (layoutManager.tv) {
// handles all special css for tv layout
@ -41,8 +40,8 @@ EmbyButtonPrototype.createdCallback = function () {
EmbyButtonPrototype.attachedCallback = function () {
if (this.tagName === 'A') {
dom.removeEventListener(this, 'click', onAnchorClick, {});
dom.addEventListener(this, 'click', onAnchorClick, {});
removeEventListener(this, 'click', onAnchorClick, {});
addEventListener(this, 'click', onAnchorClick, {});
if (this.getAttribute('data-autohide') === 'true') {
if (appHost.supports('externallinks')) {
@ -55,13 +54,13 @@ EmbyButtonPrototype.attachedCallback = function () {
};
EmbyButtonPrototype.detachedCallback = function () {
dom.removeEventListener(this, 'click', onAnchorClick, {});
removeEventListener(this, 'click', onAnchorClick, {});
};
EmbyLinkButtonPrototype.createdCallback = EmbyButtonPrototype.createdCallback;
EmbyLinkButtonPrototype.attachedCallback = EmbyButtonPrototype.attachedCallback;
document.registerElement('emby-button', {
document.registerElement('../../elements/emby-button/emby-button', {
prototype: EmbyButtonPrototype,
extends: 'button'
});

View file

@ -1,18 +1,18 @@
import layoutManager from 'layoutManager';
import 'css!./emby-button';
import 'webcomponents';
import layoutManager from '../../components/layoutManager';
import './emby-button.css';
import 'webcomponents.js';
const EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
EmbyButtonPrototype.createdCallback = function () {
this.classList.add('paper-icon-button-light');
this.classList.add('../../elements/emby-button/paper-icon-button-light');
if (layoutManager.tv) {
this.classList.add('show-focus');
}
};
document.registerElement('paper-icon-button-light', {
document.registerElement('../../elements/emby-button/paper-icon-button-light', {
prototype: EmbyButtonPrototype,
extends: 'button'
});