mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
be99ee04d2
commit
86a369b500
20 changed files with 149 additions and 73 deletions
|
@ -14,12 +14,12 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"version": "1.4.286",
|
"version": "1.4.289",
|
||||||
"_release": "1.4.286",
|
"_release": "1.4.289",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "1.4.286",
|
"tag": "1.4.289",
|
||||||
"commit": "680a1d64f25542c11e035d4118c788ef68199e18"
|
"commit": "ee09c94102cdcaacfdf815e779bdf8281657344e"
|
||||||
},
|
},
|
||||||
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
||||||
"_target": "^1.2.1",
|
"_target": "^1.2.1",
|
||||||
|
|
|
@ -129,6 +129,8 @@
|
||||||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
|
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
|
||||||
[];
|
[];
|
||||||
|
|
||||||
|
var versionMatch = /(version)[ \/]([\w.]+)/.exec(ua);
|
||||||
|
|
||||||
var platform_match = /(ipad)/.exec(ua) ||
|
var platform_match = /(ipad)/.exec(ua) ||
|
||||||
/(iphone)/.exec(ua) ||
|
/(iphone)/.exec(ua) ||
|
||||||
/(android)/.exec(ua) ||
|
/(android)/.exec(ua) ||
|
||||||
|
@ -153,10 +155,24 @@
|
||||||
browser = 'opera';
|
browser = 'opera';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var version;
|
||||||
|
if (versionMatch && versionMatch.length > 2) {
|
||||||
|
version = versionMatch[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
version = version || match[2] || "0";
|
||||||
|
|
||||||
|
var versionMajor = parseInt(version.split('.')[0]);
|
||||||
|
|
||||||
|
if (isNaN(versionMajor)) {
|
||||||
|
versionMajor = 0;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
browser: browser,
|
browser: browser,
|
||||||
version: match[2] || "0",
|
version: version,
|
||||||
platform: platform_match[0] || ""
|
platform: platform_match[0] || "",
|
||||||
|
versionMajor: versionMajor
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -167,6 +183,7 @@
|
||||||
if (matched.browser) {
|
if (matched.browser) {
|
||||||
browser[matched.browser] = true;
|
browser[matched.browser] = true;
|
||||||
browser.version = matched.version;
|
browser.version = matched.version;
|
||||||
|
browser.versionMajor = matched.versionMajor;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matched.platform) {
|
if (matched.platform) {
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
button::-moz-focus-inner {
|
button::-moz-focus-inner {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border: 0
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
-webkit-border-fit: border !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
|
@ -188,6 +192,8 @@ button::-moz-focus-inner {
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
/* Needed in case this is a button */
|
/* Needed in case this is a button */
|
||||||
display: block;
|
display: block;
|
||||||
|
/* Needed in safari */
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cardImage {
|
.cardImage {
|
||||||
|
@ -204,6 +210,9 @@ button::-moz-focus-inner {
|
||||||
.cardImage-img {
|
.cardImage-img {
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
/* This is simply for lazy image purposes, to ensure the image is visible sooner when scrolling */
|
||||||
|
min-height: 70%;
|
||||||
|
min-width: 70%;
|
||||||
align-self: flex-end;
|
align-self: flex-end;
|
||||||
position: static;
|
position: static;
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,6 +270,10 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
|
||||||
isVertical = true;
|
isVertical = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.vibrant && !appHost.supports('imageanalysis')) {
|
||||||
|
options.vibrant = false;
|
||||||
|
}
|
||||||
|
|
||||||
setCardData(items, options);
|
setCardData(items, options);
|
||||||
|
|
||||||
if (options.indexBy === 'Genres') {
|
if (options.indexBy === 'Genres') {
|
||||||
|
|
|
@ -152,7 +152,7 @@
|
||||||
.paper-icon-button-light > i {
|
.paper-icon-button-light > i {
|
||||||
width: auto;
|
width: auto;
|
||||||
height: auto;
|
height: auto;
|
||||||
font-size: 1.5em;
|
font-size: 1.6em;
|
||||||
/* Make sure its on top of the ripple */
|
/* Make sure its on top of the ripple */
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
|
|
@ -31,9 +31,8 @@
|
||||||
}, false);
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function animateButton(e) {
|
function animateButton(e, btn) {
|
||||||
|
|
||||||
var btn = this;
|
|
||||||
requestAnimationFrame(function () {
|
requestAnimationFrame(function () {
|
||||||
animateButtonInternal(e, btn);
|
animateButtonInternal(e, btn);
|
||||||
});
|
});
|
||||||
|
@ -42,17 +41,22 @@
|
||||||
function onKeyDown(e) {
|
function onKeyDown(e) {
|
||||||
|
|
||||||
if (e.keyCode === 13) {
|
if (e.keyCode === 13) {
|
||||||
animateButton.call(this, e);
|
animateButton(e, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMouseDown(e) {
|
function onMouseDown(e) {
|
||||||
|
|
||||||
if (e.button === 0) {
|
if (e.button === 0) {
|
||||||
animateButton.call(this, e);
|
animateButton(e, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onClick(e) {
|
||||||
|
|
||||||
|
animateButton(e, this);
|
||||||
|
}
|
||||||
|
|
||||||
function enableAnimation() {
|
function enableAnimation() {
|
||||||
if (browser.tv) {
|
if (browser.tv) {
|
||||||
// too slow
|
// too slow
|
||||||
|
@ -78,7 +82,7 @@
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
if (browser.safari) {
|
if (browser.safari) {
|
||||||
dom.addEventListener(this, 'click', animateButton, {
|
dom.addEventListener(this, 'click', onClick, {
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -34,9 +34,8 @@
|
||||||
}, false);
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function animateButton(e) {
|
function animateButton(e, btn) {
|
||||||
|
|
||||||
var btn = this;
|
|
||||||
requestAnimationFrame(function () {
|
requestAnimationFrame(function () {
|
||||||
animateButtonInternal(e, btn);
|
animateButtonInternal(e, btn);
|
||||||
});
|
});
|
||||||
|
@ -45,10 +44,15 @@
|
||||||
function onKeyDown(e) {
|
function onKeyDown(e) {
|
||||||
|
|
||||||
if (e.keyCode === 13) {
|
if (e.keyCode === 13) {
|
||||||
animateButton.call(this, e);
|
animateButton(e, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onClick(e) {
|
||||||
|
|
||||||
|
animateButton(e, this);
|
||||||
|
}
|
||||||
|
|
||||||
EmbyButtonPrototype.createdCallback = function () {
|
EmbyButtonPrototype.createdCallback = function () {
|
||||||
|
|
||||||
if (this.classList.contains('paper-icon-button-light')) {
|
if (this.classList.contains('paper-icon-button-light')) {
|
||||||
|
@ -61,7 +65,7 @@
|
||||||
dom.addEventListener(this, 'keydown', onKeyDown, {
|
dom.addEventListener(this, 'keydown', onKeyDown, {
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
dom.addEventListener(this, 'click', animateButton, {
|
dom.addEventListener(this, 'click', onClick, {
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
define(['browser', 'css!./emby-collapse', 'registerElement'], function (browser) {
|
define(['browser', 'css!./emby-collapse', 'registerElement'], function (browser) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var EmbyButtonPrototype = Object.create(HTMLDivElement.prototype);
|
var EmbyButtonPrototype = Object.create(HTMLDivElement.prototype);
|
||||||
|
|
||||||
|
@ -9,7 +10,9 @@
|
||||||
elem.style.height = 'auto';
|
elem.style.height = 'auto';
|
||||||
var height = elem.offsetHeight + 'px';
|
var height = elem.offsetHeight + 'px';
|
||||||
elem.style.height = '0';
|
elem.style.height = '0';
|
||||||
elem.offsetHeight;
|
|
||||||
|
// trigger reflow
|
||||||
|
var newHeight = elem.offsetHeight;
|
||||||
elem.style.height = height;
|
elem.style.height = height;
|
||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
@ -29,7 +32,8 @@
|
||||||
function slideUpToHide(button, elem) {
|
function slideUpToHide(button, elem) {
|
||||||
|
|
||||||
elem.style.height = elem.offsetHeight + 'px';
|
elem.style.height = elem.offsetHeight + 'px';
|
||||||
elem.offsetHeight;
|
// trigger reflow
|
||||||
|
var newHeight = elem.offsetHeight;
|
||||||
|
|
||||||
elem.classList.remove('expanded');
|
elem.classList.remove('expanded');
|
||||||
elem.style.height = '0';
|
elem.style.height = '0';
|
||||||
|
@ -49,14 +53,15 @@
|
||||||
|
|
||||||
function onButtonClick(e) {
|
function onButtonClick(e) {
|
||||||
|
|
||||||
var collapseContent = this.parentNode.querySelector('.collapseContent');
|
var button = this;
|
||||||
|
var collapseContent = button.parentNode.querySelector('.collapseContent');
|
||||||
|
|
||||||
if (collapseContent.expanded) {
|
if (collapseContent.expanded) {
|
||||||
collapseContent.expanded = false;
|
collapseContent.expanded = false;
|
||||||
slideUpToHide(this, collapseContent);
|
slideUpToHide(button, collapseContent);
|
||||||
} else {
|
} else {
|
||||||
collapseContent.expanded = true;
|
collapseContent.expanded = true;
|
||||||
slideDownToShow(this, collapseContent);
|
slideDownToShow(button, collapseContent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,10 +80,7 @@
|
||||||
|
|
||||||
var title = this.getAttribute('title');
|
var title = this.getAttribute('title');
|
||||||
|
|
||||||
var html = '<button is="emby-button" type="button" on-click="toggleExpand" id="expandButton" class="emby-collapsible-button iconRight">\
|
var html = '<button is="emby-button" type="button" on-click="toggleExpand" id="expandButton" class="emby-collapsible-button iconRight"><h3 class="emby-collapsible-title" title="' + title + '">' + title + '</h3><i class="md-icon emby-collapse-expandIcon">expand_more</i></button>';
|
||||||
<h3 class="emby-collapsible-title" title="' + title + '">' + title + '</h3>\
|
|
||||||
<i class="md-icon emby-collapse-expandIcon">expand_more</i>\
|
|
||||||
</button>';
|
|
||||||
|
|
||||||
this.insertAdjacentHTML('afterbegin', html);
|
this.insertAdjacentHTML('afterbegin', html);
|
||||||
|
|
||||||
|
@ -86,7 +88,7 @@
|
||||||
|
|
||||||
button.addEventListener('click', onButtonClick);
|
button.addEventListener('click', onButtonClick);
|
||||||
|
|
||||||
if (this.getAttribute('data-expanded') == 'true') {
|
if (this.getAttribute('data-expanded') === 'true') {
|
||||||
onButtonClick.call(button);
|
onButtonClick.call(button);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
define(['layoutManager', 'browser', 'dom', 'css!./emby-input', 'registerElement'], function (layoutManager, browser, dom) {
|
define(['layoutManager', 'browser', 'dom', 'css!./emby-input', 'registerElement'], function (layoutManager, browser, dom) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var EmbyInputPrototype = Object.create(HTMLInputElement.prototype);
|
var EmbyInputPrototype = Object.create(HTMLInputElement.prototype);
|
||||||
|
|
||||||
|
@ -19,7 +20,7 @@
|
||||||
bubbles: false,
|
bubbles: false,
|
||||||
cancelable: false
|
cancelable: false
|
||||||
}));
|
}));
|
||||||
}
|
};
|
||||||
|
|
||||||
Object.defineProperty(HTMLInputElement.prototype, 'value', descriptor);
|
Object.defineProperty(HTMLInputElement.prototype, 'value', descriptor);
|
||||||
supportsFloatingLabel = true;
|
supportsFloatingLabel = true;
|
||||||
|
@ -86,7 +87,7 @@
|
||||||
label.classList.remove('inputLabel-float');
|
label.classList.remove('inputLabel-float');
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
var instanceSupportsFloat = supportsFloatingLabel && this.type != 'date' && this.type != 'time';
|
var instanceSupportsFloat = supportsFloatingLabel && this.type !== 'date' && this.type !== 'time';
|
||||||
|
|
||||||
if (instanceSupportsFloat) {
|
if (instanceSupportsFloat) {
|
||||||
label.classList.add('inputLabel-float');
|
label.classList.add('inputLabel-float');
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
define(['css!./emby-radio', 'registerElement'], function () {
|
define(['css!./emby-radio', 'registerElement'], function () {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var EmbyRadioPrototype = Object.create(HTMLInputElement.prototype);
|
var EmbyRadioPrototype = Object.create(HTMLInputElement.prototype);
|
||||||
|
|
||||||
function onKeyDown(e) {
|
function onKeyDown(e) {
|
||||||
|
|
||||||
// Don't submit form on enter
|
// Don't submit form on enter
|
||||||
if (e.keyCode == 13) {
|
if (e.keyCode === 13) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
this.checked = true;
|
this.checked = true;
|
||||||
|
@ -16,7 +17,7 @@
|
||||||
|
|
||||||
EmbyRadioPrototype.attachedCallback = function () {
|
EmbyRadioPrototype.attachedCallback = function () {
|
||||||
|
|
||||||
if (this.getAttribute('data-radio') == 'true') {
|
if (this.getAttribute('data-radio') === 'true') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
define(['layoutManager', 'browser', 'actionsheet', 'css!./emby-select', 'registerElement'], function (layoutManager, browser, actionsheet) {
|
define(['layoutManager', 'browser', 'actionsheet', 'css!./emby-select', 'registerElement'], function (layoutManager, browser, actionsheet) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var EmbySelectPrototype = Object.create(HTMLSelectElement.prototype);
|
var EmbySelectPrototype = Object.create(HTMLSelectElement.prototype);
|
||||||
|
|
||||||
|
@ -54,7 +55,7 @@
|
||||||
|
|
||||||
function getLabel(select) {
|
function getLabel(select) {
|
||||||
var elem = select.previousSibling;
|
var elem = select.previousSibling;
|
||||||
while (elem && elem.tagName != 'LABEL') {
|
while (elem && elem.tagName !== 'LABEL') {
|
||||||
elem = elem.previousSibling;
|
elem = elem.previousSibling;
|
||||||
}
|
}
|
||||||
return elem;
|
return elem;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
define(['browser', 'css!./emby-slider', 'registerElement', 'emby-input'], function (browser) {
|
define(['browser', 'css!./emby-slider', 'registerElement', 'emby-input'], function (browser) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var EmbySliderPrototype = Object.create(HTMLInputElement.prototype);
|
var EmbySliderPrototype = Object.create(HTMLInputElement.prototype);
|
||||||
|
|
||||||
|
@ -41,7 +42,7 @@
|
||||||
|
|
||||||
EmbySliderPrototype.attachedCallback = function () {
|
EmbySliderPrototype.attachedCallback = function () {
|
||||||
|
|
||||||
if (this.getAttribute('data-embycheckbox') == 'true') {
|
if (this.getAttribute('data-embycheckbox') === 'true') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
define(['dom', 'scroller', 'browser', 'registerElement', 'css!./emby-tabs', 'scrollStyles'], function (dom, scroller, browser) {
|
define(['dom', 'scroller', 'browser', 'registerElement', 'css!./emby-tabs', 'scrollStyles'], function (dom, scroller, browser) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var EmbyTabs = Object.create(HTMLDivElement.prototype);
|
var EmbyTabs = Object.create(HTMLDivElement.prototype);
|
||||||
var buttonClass = 'emby-tab-button';
|
var buttonClass = 'emby-tab-button';
|
||||||
|
@ -78,7 +79,7 @@
|
||||||
|
|
||||||
var onAnimationFinish = function () {
|
var onAnimationFinish = function () {
|
||||||
|
|
||||||
//if (tabs.getAttribute('data-selectionbar') != 'false') {
|
//if (tabs.getAttribute('data-selectionbar') !== 'false') {
|
||||||
// showButtonSelectionBar(newButton);
|
// showButtonSelectionBar(newButton);
|
||||||
//}
|
//}
|
||||||
newButton.classList.add(activeButtonClass);
|
newButton.classList.add(activeButtonClass);
|
||||||
|
@ -103,7 +104,7 @@
|
||||||
var current = tabs.querySelector('.' + activeButtonClass);
|
var current = tabs.querySelector('.' + activeButtonClass);
|
||||||
var tabButton = dom.parentWithClass(e.target, buttonClass);
|
var tabButton = dom.parentWithClass(e.target, buttonClass);
|
||||||
|
|
||||||
if (tabButton && tabButton != current) {
|
if (tabButton && tabButton !== current) {
|
||||||
|
|
||||||
if (current) {
|
if (current) {
|
||||||
current.classList.remove(activeButtonClass);
|
current.classList.remove(activeButtonClass);
|
||||||
|
@ -186,7 +187,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tabs.getAttribute('data-selectionbar') == 'false') {
|
if (tabs.getAttribute('data-selectionbar') === 'false') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,7 +254,7 @@
|
||||||
|
|
||||||
var tabButtons = tabs.querySelectorAll('.' + buttonClass);
|
var tabButtons = tabs.querySelectorAll('.' + buttonClass);
|
||||||
|
|
||||||
if (current == selected || triggerEvent === false) {
|
if (current === selected || triggerEvent === false) {
|
||||||
|
|
||||||
tabs.dispatchEvent(new CustomEvent("beforetabchange", {
|
tabs.dispatchEvent(new CustomEvent("beforetabchange", {
|
||||||
detail: {
|
detail: {
|
||||||
|
@ -269,7 +270,7 @@
|
||||||
var currentTabButton = tabButtons[current];
|
var currentTabButton = tabButtons[current];
|
||||||
moveSelectionBar(tabs, tabButtons[selected], currentTabButton, false);
|
moveSelectionBar(tabs, tabButtons[selected], currentTabButton, false);
|
||||||
|
|
||||||
if (current != selected && currentTabButton) {
|
if (current !== selected && currentTabButton) {
|
||||||
currentTabButton.classList.remove(activeButtonClass);
|
currentTabButton.classList.remove(activeButtonClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
define(['layoutManager', 'browser', 'css!./emby-textarea', 'registerElement'], function (layoutManager, browser) {
|
define(['layoutManager', 'browser', 'css!./emby-textarea', 'registerElement'], function (layoutManager, browser) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function autoGrow(textarea, maxLines) {
|
function autoGrow(textarea, maxLines) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
@ -84,7 +85,7 @@
|
||||||
bubbles: false,
|
bubbles: false,
|
||||||
cancelable: false
|
cancelable: false
|
||||||
}));
|
}));
|
||||||
}
|
};
|
||||||
|
|
||||||
Object.defineProperty(HTMLTextAreaElement.prototype, 'value', descriptor);
|
Object.defineProperty(HTMLTextAreaElement.prototype, 'value', descriptor);
|
||||||
supportsFloatingLabel = true;
|
supportsFloatingLabel = true;
|
||||||
|
@ -113,7 +114,7 @@
|
||||||
label.innerHTML = this.getAttribute('label') || '';
|
label.innerHTML = this.getAttribute('label') || '';
|
||||||
label.classList.add('textareaLabel');
|
label.classList.add('textareaLabel');
|
||||||
|
|
||||||
if (!supportsFloatingLabel || this.type == 'date') {
|
if (!supportsFloatingLabel || this.type === 'date') {
|
||||||
label.classList.add('nofloat');
|
label.classList.add('nofloat');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
define(['css!./emby-toggle', 'registerElement'], function () {
|
define(['css!./emby-toggle', 'registerElement'], function () {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var EmbyTogglePrototype = Object.create(HTMLInputElement.prototype);
|
var EmbyTogglePrototype = Object.create(HTMLInputElement.prototype);
|
||||||
|
|
||||||
function onKeyDown(e) {
|
function onKeyDown(e) {
|
||||||
|
|
||||||
// Don't submit form on enter
|
// Don't submit form on enter
|
||||||
if (e.keyCode == 13) {
|
if (e.keyCode === 13) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
this.checked = !this.checked;
|
this.checked = !this.checked;
|
||||||
|
@ -20,7 +21,7 @@
|
||||||
|
|
||||||
EmbyTogglePrototype.attachedCallback = function () {
|
EmbyTogglePrototype.attachedCallback = function () {
|
||||||
|
|
||||||
if (this.getAttribute('data-embytoggle') == 'true') {
|
if (this.getAttribute('data-embytoggle') === 'true') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
define([], function () {
|
define([], function () {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function getFetchPromise(request) {
|
function getFetchPromise(request) {
|
||||||
|
|
||||||
var headers = request.headers || {};
|
var headers = request.headers || {};
|
||||||
|
|
||||||
if (request.dataType == 'json') {
|
if (request.dataType === 'json') {
|
||||||
headers.accept = 'application/json';
|
headers.accept = 'application/json';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,9 +108,9 @@
|
||||||
|
|
||||||
if (response.status < 400) {
|
if (response.status < 400) {
|
||||||
|
|
||||||
if (request.dataType == 'json' || request.headers.accept == 'application/json') {
|
if (request.dataType === 'json' || request.headers.accept === 'application/json') {
|
||||||
return response.json();
|
return response.json();
|
||||||
} else if (request.dataType == 'text' || (response.headers.get('Content-Type') || '').toLowerCase().indexOf('text/') == 0) {
|
} else if (request.dataType === 'text' || (response.headers.get('Content-Type') || '').toLowerCase().indexOf('text/') === 0) {
|
||||||
return response.text();
|
return response.text();
|
||||||
} else {
|
} else {
|
||||||
return response;
|
return response;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
define(['dom'], function (dom) {
|
define(['dom'], function (dom) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var scopes = [];
|
var scopes = [];
|
||||||
function pushScope(elem) {
|
function pushScope(elem) {
|
||||||
|
@ -48,7 +49,7 @@ define(['dom'], function (dom) {
|
||||||
var focusableContainerTagNames = ['BODY', 'DIALOG'];
|
var focusableContainerTagNames = ['BODY', 'DIALOG'];
|
||||||
var focusableQuery = focusableTagNames.map(function (t) {
|
var focusableQuery = focusableTagNames.map(function (t) {
|
||||||
|
|
||||||
if (t == 'INPUT') {
|
if (t === 'INPUT') {
|
||||||
t += ':not([type="range"])';
|
t += ':not([type="range"])';
|
||||||
}
|
}
|
||||||
return t + ':not([tabindex="-1"]):not(:disabled)';
|
return t + ':not([tabindex="-1"]):not(:disabled)';
|
||||||
|
@ -57,7 +58,7 @@ define(['dom'], function (dom) {
|
||||||
|
|
||||||
function isFocusable(elem) {
|
function isFocusable(elem) {
|
||||||
|
|
||||||
if (focusableTagNames.indexOf(elem.tagName) != -1) {
|
if (focusableTagNames.indexOf(elem.tagName) !== -1) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,13 +100,13 @@ define(['dom'], function (dom) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elem.getAttribute('tabindex') == "-1") {
|
if (elem.getAttribute('tabindex') === "-1") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elem.tagName == 'INPUT') {
|
if (elem.tagName === 'INPUT') {
|
||||||
var type = elem.type;
|
var type = elem.type;
|
||||||
if (type == 'range') {
|
if (type === 'range') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -139,7 +140,7 @@ define(['dom'], function (dom) {
|
||||||
|
|
||||||
function isFocusContainer(elem, direction) {
|
function isFocusContainer(elem, direction) {
|
||||||
|
|
||||||
if (focusableContainerTagNames.indexOf(elem.tagName) != -1) {
|
if (focusableContainerTagNames.indexOf(elem.tagName) !== -1) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (elem.classList.contains('focuscontainer')) {
|
if (elem.classList.contains('focuscontainer')) {
|
||||||
|
@ -151,7 +152,7 @@ define(['dom'], function (dom) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (direction == 3) {
|
else if (direction === 3) {
|
||||||
if (elem.classList.contains('focuscontainer-down')) {
|
if (elem.classList.contains('focuscontainer-down')) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -230,11 +231,11 @@ define(['dom'], function (dom) {
|
||||||
for (var i = 0, length = focusable.length; i < length; i++) {
|
for (var i = 0, length = focusable.length; i < length; i++) {
|
||||||
var curr = focusable[i];
|
var curr = focusable[i];
|
||||||
|
|
||||||
if (curr == activeElement) {
|
if (curr === activeElement) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Don't refocus into the same container
|
// Don't refocus into the same container
|
||||||
if (curr == focusableContainer) {
|
if (curr === focusableContainer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,7 +257,7 @@ define(['dom'], function (dom) {
|
||||||
if (elementRect.left >= rect.left) {
|
if (elementRect.left >= rect.left) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (elementRect.right == rect.right) {
|
if (elementRect.right === rect.right) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -265,7 +266,7 @@ define(['dom'], function (dom) {
|
||||||
if (elementRect.right <= rect.right) {
|
if (elementRect.right <= rect.right) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (elementRect.left == rect.left) {
|
if (elementRect.left === rect.left) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -304,8 +305,8 @@ define(['dom'], function (dom) {
|
||||||
|
|
||||||
// See if there's a focusable container, and if so, send the focus command to that
|
// See if there's a focusable container, and if so, send the focus command to that
|
||||||
var nearestElementFocusableParent = dom.parentWithClass(nearestElement, 'focusable');
|
var nearestElementFocusableParent = dom.parentWithClass(nearestElement, 'focusable');
|
||||||
if (nearestElementFocusableParent && nearestElementFocusableParent != nearestElement && activeElement) {
|
if (nearestElementFocusableParent && nearestElementFocusableParent !== nearestElement && activeElement) {
|
||||||
if (dom.parentWithClass(activeElement, 'focusable') != nearestElementFocusableParent) {
|
if (dom.parentWithClass(activeElement, 'focusable') !== nearestElementFocusableParent) {
|
||||||
nearestElement = nearestElementFocusableParent;
|
nearestElement = nearestElementFocusableParent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -404,12 +405,12 @@ define(['dom'], function (dom) {
|
||||||
function sortNodesT(a, b) {
|
function sortNodesT(a, b) {
|
||||||
|
|
||||||
var result = a.distT - b.distT;
|
var result = a.distT - b.distT;
|
||||||
if (result != 0) {
|
if (result !== 0) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = a.index - b.index;
|
result = a.index - b.index;
|
||||||
if (result != 0) {
|
if (result !== 0) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
define(['connectionManager', 'userSettings', 'events'], function (connectionManager, userSettings, events) {
|
define(['connectionManager', 'userSettings', 'events'], function (connectionManager, userSettings, events) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var allTranslations = {};
|
var allTranslations = {};
|
||||||
var currentCulture;
|
var currentCulture;
|
||||||
|
@ -69,20 +70,20 @@ define(['connectionManager', 'userSettings', 'events'], function (connectionMana
|
||||||
|
|
||||||
// If it's de-DE, convert to just de
|
// If it's de-DE, convert to just de
|
||||||
var parts = culture.split('-');
|
var parts = culture.split('-');
|
||||||
if (parts.length == 2) {
|
if (parts.length === 2) {
|
||||||
if (parts[0].toLowerCase() == parts[1].toLowerCase()) {
|
if (parts[0].toLowerCase() === parts[1].toLowerCase()) {
|
||||||
culture = parts[0].toLowerCase();
|
culture = parts[0].toLowerCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var lower = culture.toLowerCase();
|
var lower = culture.toLowerCase();
|
||||||
|
|
||||||
if (lower == 'ca-es') {
|
if (lower === 'ca-es') {
|
||||||
return 'ca';
|
return 'ca';
|
||||||
}
|
}
|
||||||
|
|
||||||
// normalize Swedish
|
// normalize Swedish
|
||||||
if (lower == 'sv-se') {
|
if (lower === 'sv-se') {
|
||||||
return 'sv';
|
return 'sv';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,12 +131,12 @@ define(['connectionManager', 'userSettings', 'events'], function (connectionMana
|
||||||
lang = normalizeLocaleName(lang);
|
lang = normalizeLocaleName(lang);
|
||||||
|
|
||||||
var filtered = translations.filter(function (t) {
|
var filtered = translations.filter(function (t) {
|
||||||
return normalizeLocaleName(t.lang) == lang;
|
return normalizeLocaleName(t.lang) === lang;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!filtered.length) {
|
if (!filtered.length) {
|
||||||
filtered = translations.filter(function (t) {
|
filtered = translations.filter(function (t) {
|
||||||
return normalizeLocaleName(t.lang) == 'en-us';
|
return normalizeLocaleName(t.lang) === 'en-us';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +149,7 @@ define(['connectionManager', 'userSettings', 'events'], function (connectionMana
|
||||||
|
|
||||||
var url = filtered[0].path;
|
var url = filtered[0].path;
|
||||||
|
|
||||||
url += url.indexOf('?') == -1 ? '?' : '&';
|
url += url.indexOf('?') === -1 ? '?' : '&';
|
||||||
url += 'v=' + cacheParam;
|
url += 'v=' + cacheParam;
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
|
@ -217,14 +218,14 @@ define(['connectionManager', 'userSettings', 'events'], function (connectionMana
|
||||||
|
|
||||||
var startIndex = html.indexOf('${');
|
var startIndex = html.indexOf('${');
|
||||||
|
|
||||||
if (startIndex == -1) {
|
if (startIndex === -1) {
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
startIndex += 2;
|
startIndex += 2;
|
||||||
var endIndex = html.indexOf('}', startIndex);
|
var endIndex = html.indexOf('}', startIndex);
|
||||||
|
|
||||||
if (endIndex == -1) {
|
if (endIndex === -1) {
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,7 +251,7 @@ define(['connectionManager', 'userSettings', 'events'], function (connectionMana
|
||||||
|
|
||||||
events.on(connectionManager, 'localusersignedin', updateCurrentCulture);
|
events.on(connectionManager, 'localusersignedin', updateCurrentCulture);
|
||||||
events.on(userSettings, 'change', function (e, name) {
|
events.on(userSettings, 'change', function (e, name) {
|
||||||
if (name == 'language') {
|
if (name === 'language') {
|
||||||
updateCurrentCulture();
|
updateCurrentCulture();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser', 'dom', 'appSettings', 'vibrant'], function (visibleinviewport, imageFetcher, layoutManager, events, browser, dom, appSettings) {
|
define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser', 'dom', 'appSettings'], function (visibleinviewport, imageFetcher, layoutManager, events, browser, dom, appSettings) {
|
||||||
|
|
||||||
var thresholdX;
|
var thresholdX;
|
||||||
var thresholdY;
|
var thresholdY;
|
||||||
|
@ -74,6 +74,22 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window.Vibrant) {
|
||||||
|
fillVibrantOnLoaded(img, url, vibrantElement);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
require(['vibrant'], function () {
|
||||||
|
fillVibrantOnLoaded(img, url, vibrantElement);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function fillVibrantOnLoaded(img, url, vibrantElement) {
|
||||||
|
|
||||||
|
if (img.tagName != 'IMG') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
vibrantElement = document.getElementById(vibrantElement);
|
vibrantElement = document.getElementById(vibrantElement);
|
||||||
if (!vibrantElement) {
|
if (!vibrantElement) {
|
||||||
return;
|
return;
|
||||||
|
@ -97,7 +113,16 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSettingsKey(url) {
|
function getSettingsKey(url) {
|
||||||
return 'vibrant3-' + url.split('?')[0];
|
|
||||||
|
var parts = url.split('://');
|
||||||
|
url = parts[parts.length - 1];
|
||||||
|
|
||||||
|
url = url.substring(url.indexOf('/') + 1);
|
||||||
|
|
||||||
|
url = url.split('?')[0];
|
||||||
|
|
||||||
|
console.log(url);
|
||||||
|
return 'vibrant3-' + url;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCachedVibrantInfo(url) {
|
function getCachedVibrantInfo(url) {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
define(['browser', 'appSettings', 'events'], function (browser, appSettings, events) {
|
define(['browser', 'appSettings', 'events'], function (browser, appSettings, events) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function setLayout(self, layout, selectedLayout) {
|
function setLayout(self, layout, selectedLayout) {
|
||||||
|
|
||||||
|
@ -17,7 +18,7 @@ define(['browser', 'appSettings', 'events'], function (browser, appSettings, eve
|
||||||
|
|
||||||
self.setLayout = function (layout, save) {
|
self.setLayout = function (layout, save) {
|
||||||
|
|
||||||
if (!layout || layout == 'auto') {
|
if (!layout || layout === 'auto') {
|
||||||
self.autoLayout();
|
self.autoLayout();
|
||||||
|
|
||||||
if (save !== false) {
|
if (save !== false) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue