mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update var declerations
This commit is contained in:
parent
8d17c6fc6f
commit
85b8671294
3 changed files with 28 additions and 28 deletions
|
@ -5,7 +5,7 @@ import 'registerElement';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
var EmbyCheckboxPrototype = Object.create(HTMLInputElement.prototype);
|
let EmbyCheckboxPrototype = Object.create(HTMLInputElement.prototype);
|
||||||
|
|
||||||
function onKeyDown(e) {
|
function onKeyDown(e) {
|
||||||
// Don't submit form on enter
|
// Don't submit form on enter
|
||||||
|
@ -23,10 +23,10 @@ import 'registerElement';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var enableRefreshHack = browser.tizen || browser.orsay || browser.operaTv || browser.web0s ? true : false;
|
const enableRefreshHack = browser.tizen || browser.orsay || browser.operaTv || browser.web0s ? true : false;
|
||||||
|
|
||||||
function forceRefresh(loading) {
|
function forceRefresh(loading) {
|
||||||
var elem = this.parentNode;
|
let elem = this.parentNode;
|
||||||
|
|
||||||
elem.style.webkitAnimationName = 'repaintChrome';
|
elem.style.webkitAnimationName = 'repaintChrome';
|
||||||
elem.style.webkitAnimationDelay = (loading === true ? '500ms' : '');
|
elem.style.webkitAnimationDelay = (loading === true ? '500ms' : '');
|
||||||
|
@ -47,22 +47,22 @@ import 'registerElement';
|
||||||
|
|
||||||
this.classList.add('emby-checkbox');
|
this.classList.add('emby-checkbox');
|
||||||
|
|
||||||
var labelElement = this.parentNode;
|
const labelElement = this.parentNode;
|
||||||
labelElement.classList.add('emby-checkbox-label');
|
labelElement.classList.add('emby-checkbox-label');
|
||||||
|
|
||||||
var labelTextElement = labelElement.querySelector('span');
|
const labelTextElement = labelElement.querySelector('span');
|
||||||
|
|
||||||
var outlineClass = 'checkboxOutline';
|
const outlineClass = 'checkboxOutline';
|
||||||
|
|
||||||
var customClass = this.getAttribute('data-outlineclass');
|
const customClass = this.getAttribute('data-outlineclass');
|
||||||
if (customClass) {
|
if (customClass) {
|
||||||
outlineClass += ' ' + customClass;
|
outlineClass += ' ' + customClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
var checkedIcon = this.getAttribute('data-checkedicon') || 'check';
|
const checkedIcon = this.getAttribute('data-checkedicon') || 'check';
|
||||||
var uncheckedIcon = this.getAttribute('data-uncheckedicon') || '';
|
const uncheckedIcon = this.getAttribute('data-uncheckedicon') || '';
|
||||||
var checkHtml = '<span class="material-icons checkboxIcon checkboxIcon-checked ' + checkedIcon + '"></span>';
|
const checkHtml = '<span class="material-icons checkboxIcon checkboxIcon-checked ' + checkedIcon + '"></span>';
|
||||||
var uncheckedHtml = '<span class="material-icons checkboxIcon checkboxIcon-unchecked ' + uncheckedIcon + '"></span>';
|
const uncheckedHtml = '<span class="material-icons checkboxIcon checkboxIcon-unchecked ' + uncheckedIcon + '"></span>';
|
||||||
labelElement.insertAdjacentHTML('beforeend', '<span class="' + outlineClass + '">' + checkHtml + uncheckedHtml + '</span>');
|
labelElement.insertAdjacentHTML('beforeend', '<span class="' + outlineClass + '">' + checkHtml + uncheckedHtml + '</span>');
|
||||||
|
|
||||||
labelTextElement.classList.add('checkboxLabel');
|
labelTextElement.classList.add('checkboxLabel');
|
||||||
|
|
|
@ -7,7 +7,7 @@ import 'emby-input';
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
function autoGrow(textarea, maxLines) {
|
function autoGrow(textarea, maxLines) {
|
||||||
var self = this;
|
const self = this;
|
||||||
|
|
||||||
if (maxLines === undefined) {
|
if (maxLines === undefined) {
|
||||||
maxLines = 999;
|
maxLines = 999;
|
||||||
|
@ -19,17 +19,17 @@ import 'emby-input';
|
||||||
* @returns {number}
|
* @returns {number}
|
||||||
*/
|
*/
|
||||||
self.getOffset = function (textarea) {
|
self.getOffset = function (textarea) {
|
||||||
var style = window.getComputedStyle(textarea, null);
|
const style = window.getComputedStyle(textarea, null);
|
||||||
var props = ['paddingTop', 'paddingBottom'];
|
const props = ['paddingTop', 'paddingBottom'];
|
||||||
var offset = 0;
|
let offset = 0;
|
||||||
|
|
||||||
for (var i = 0; i < props.length; i++) {
|
for (let i = 0; i < props.length; i++) {
|
||||||
offset += parseInt(style[props[i]]);
|
offset += parseInt(style[props[i]]);
|
||||||
}
|
}
|
||||||
return offset;
|
return offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
var offset;
|
let offset;
|
||||||
function reset() {
|
function reset() {
|
||||||
textarea.rows = 1;
|
textarea.rows = 1;
|
||||||
offset = self.getOffset(textarea);
|
offset = self.getOffset(textarea);
|
||||||
|
@ -48,8 +48,8 @@ import 'emby-input';
|
||||||
textarea.rows = 3;
|
textarea.rows = 3;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var newHeight = 0;
|
let newHeight = 0;
|
||||||
var hasGrown = false;
|
let hasGrown = false;
|
||||||
|
|
||||||
if ((textarea.scrollHeight - offset) > self.maxAllowedHeight) {
|
if ((textarea.scrollHeight - offset) > self.maxAllowedHeight) {
|
||||||
textarea.style.overflowY = 'scroll';
|
textarea.style.overflowY = 'scroll';
|
||||||
|
@ -72,17 +72,17 @@ import 'emby-input';
|
||||||
autogrowFn();
|
autogrowFn();
|
||||||
}
|
}
|
||||||
|
|
||||||
var EmbyTextAreaPrototype = Object.create(HTMLTextAreaElement.prototype);
|
const EmbyTextAreaPrototype = Object.create(HTMLTextAreaElement.prototype);
|
||||||
|
|
||||||
var elementId = 0;
|
let elementId = 0;
|
||||||
|
|
||||||
if (Object.getOwnPropertyDescriptor && Object.defineProperty) {
|
if (Object.getOwnPropertyDescriptor && Object.defineProperty) {
|
||||||
|
|
||||||
var descriptor = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, 'value');
|
const descriptor = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, 'value');
|
||||||
|
|
||||||
// descriptor returning null in webos
|
// descriptor returning null in webos
|
||||||
if (descriptor && descriptor.configurable) {
|
if (descriptor && descriptor.configurable) {
|
||||||
var baseSetMethod = descriptor.set;
|
const baseSetMethod = descriptor.set;
|
||||||
descriptor.set = function (value) {
|
descriptor.set = function (value) {
|
||||||
baseSetMethod.call(this, value);
|
baseSetMethod.call(this, value);
|
||||||
|
|
||||||
|
@ -113,8 +113,8 @@ import 'emby-input';
|
||||||
this.rows = 1;
|
this.rows = 1;
|
||||||
this.classList.add('emby-textarea');
|
this.classList.add('emby-textarea');
|
||||||
|
|
||||||
var parentNode = this.parentNode;
|
const parentNode = this.parentNode;
|
||||||
var label = this.ownerDocument.createElement('label');
|
const label = this.ownerDocument.createElement('label');
|
||||||
label.innerHTML = this.getAttribute('label') || '';
|
label.innerHTML = this.getAttribute('label') || '';
|
||||||
label.classList.add('textareaLabel');
|
label.classList.add('textareaLabel');
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import 'registerElement';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
var EmbyTogglePrototype = Object.create(HTMLInputElement.prototype);
|
const EmbyTogglePrototype = Object.create(HTMLInputElement.prototype);
|
||||||
|
|
||||||
function onKeyDown(e) {
|
function onKeyDown(e) {
|
||||||
|
|
||||||
|
@ -31,11 +31,11 @@ import 'registerElement';
|
||||||
|
|
||||||
this.classList.add('mdl-switch__input');
|
this.classList.add('mdl-switch__input');
|
||||||
|
|
||||||
var labelElement = this.parentNode;
|
const labelElement = this.parentNode;
|
||||||
labelElement.classList.add('mdl-switch');
|
labelElement.classList.add('mdl-switch');
|
||||||
labelElement.classList.add('mdl-js-switch');
|
labelElement.classList.add('mdl-js-switch');
|
||||||
|
|
||||||
var labelTextElement = labelElement.querySelector('span');
|
const labelTextElement = labelElement.querySelector('span');
|
||||||
|
|
||||||
labelElement.insertAdjacentHTML('beforeend', '<div class="mdl-switch__trackContainer"><div class="mdl-switch__track"></div><div class="mdl-switch__thumb"><span class="mdl-switch__focus-helper"></span></div></div>');
|
labelElement.insertAdjacentHTML('beforeend', '<div class="mdl-switch__trackContainer"><div class="mdl-switch__track"></div><div class="mdl-switch__thumb"><span class="mdl-switch__focus-helper"></span></div></div>');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue