1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Unminify using 1.5.323

Repo with tag: https://github.com/MediaBrowser/emby-webcomponents/tree/1.5.323
This commit is contained in:
Vasily 2019-01-10 15:39:37 +03:00
parent 4678528d00
commit de6ac33ec1
289 changed files with 78483 additions and 54701 deletions

View file

@ -2,35 +2,39 @@
display: block;
margin: 0;
margin-bottom: 0 !important;
/* Remove select styling */
/* Font size must the 16px or larger to prevent iOS page zoom on focus */
font-size: 110%;
/* General select styles: change as needed */
font-family: inherit;
font-weight: inherit;
padding: .4em .25em;
/* Prevent padding from causing width overflow */
-webkit-box-sizing: border-box;
box-sizing: border-box;
outline: 0 !important;
-webkit-tap-highlight-color: transparent;
width: 100%
outline: none !important;
-webkit-tap-highlight-color: rgba(0,0,0,0);
width: 100%;
}
.emby-input::-moz-focus-inner {
border: 0
}
.emby-input::-moz-focus-inner {
border: 0;
}
.inputContainer {
margin-bottom: 1.8em
margin-bottom: 1.8em;
}
.inputLabel {
display: inline-block;
margin-bottom: .25em
margin-bottom: .25em;
}
.emby-input+.fieldDescription {
margin-top: .25em
.emby-input + .fieldDescription {
margin-top: .25em;
}
.emby-input-iconbutton {
-webkit-align-self: flex-end;
align-self: flex-end
}
align-self: flex-end;
}

View file

@ -1,56 +1,125 @@
define(["layoutManager", "browser", "dom", "css!./emby-input", "registerElement"], function(layoutManager, browser, dom) {
"use strict";
define(['layoutManager', 'browser', 'dom', 'css!./emby-input', 'registerElement'], function (layoutManager, browser, dom) {
'use strict';
var EmbyInputPrototype = Object.create(HTMLInputElement.prototype);
var inputId = 0;
var supportsFloatingLabel = false;
function onChange() {
var label = this.labelElement;
if (this.value) label.classList.remove("inputLabel-float");
else {
supportsFloatingLabel && "date" !== this.type && "time" !== this.type && label.classList.add("inputLabel-float")
}
}
var EmbyInputPrototype = Object.create(HTMLInputElement.prototype),
inputId = 0,
supportsFloatingLabel = !1;
if (Object.getOwnPropertyDescriptor && Object.defineProperty) {
var descriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value");
var descriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
// descriptor returning null in webos
if (descriptor && descriptor.configurable) {
var baseSetMethod = descriptor.set;
descriptor.set = function(value) {
baseSetMethod.call(this, value), this.dispatchEvent(new CustomEvent("valueset", {
bubbles: !1,
cancelable: !1
}))
}, Object.defineProperty(HTMLInputElement.prototype, "value", descriptor), supportsFloatingLabel = !0
descriptor.set = function (value) {
baseSetMethod.call(this, value);
this.dispatchEvent(new CustomEvent('valueset', {
bubbles: false,
cancelable: false
}));
};
Object.defineProperty(HTMLInputElement.prototype, 'value', descriptor);
supportsFloatingLabel = true;
}
}
EmbyInputPrototype.createdCallback = function() {
if (this.id || (this.id = "embyinput" + inputId, inputId++), !this.classList.contains("emby-input")) {
this.classList.add("emby-input");
var parentNode = this.parentNode,
document = this.ownerDocument,
label = document.createElement("label");
label.innerHTML = this.getAttribute("label") || "", label.classList.add("inputLabel"), label.classList.add("inputLabelUnfocused"), label.htmlFor = this.id, parentNode.insertBefore(label, this), this.labelElement = label, dom.addEventListener(this, "focus", function() {
onChange.call(this), document.attachIME && document.attachIME(this), label.classList.add("inputLabelFocused"), label.classList.remove("inputLabelUnfocused")
}, {
passive: !0
}), dom.addEventListener(this, "blur", function() {
onChange.call(this), label.classList.remove("inputLabelFocused"), label.classList.add("inputLabelUnfocused")
}, {
passive: !0
}), dom.addEventListener(this, "change", onChange, {
passive: !0
}), dom.addEventListener(this, "input", onChange, {
passive: !0
}), dom.addEventListener(this, "valueset", onChange, {
passive: !0
}), browser.orsay && this === document.activeElement && document.attachIME && document.attachIME(this)
EmbyInputPrototype.createdCallback = function () {
if (!this.id) {
this.id = 'embyinput' + inputId;
inputId++;
} if (this.classList.contains('emby-input')) {
return;
}
}, EmbyInputPrototype.attachedCallback = function() {
this.labelElement.htmlFor = this.id, onChange.call(this)
}, EmbyInputPrototype.label = function(text) {
this.labelElement.innerHTML = text
}, document.registerElement("emby-input", {
this.classList.add('emby-input');
var parentNode = this.parentNode;
var document = this.ownerDocument;
var label = document.createElement('label');
label.innerHTML = this.getAttribute('label') || '';
label.classList.add('inputLabel');
label.classList.add('inputLabelUnfocused');
label.htmlFor = this.id;
parentNode.insertBefore(label, this);
this.labelElement = label;
dom.addEventListener(this, 'focus', function () {
onChange.call(this);
// For Samsung orsay devices
if (document.attachIME) {
document.attachIME(this);
}
label.classList.add('inputLabelFocused');
label.classList.remove('inputLabelUnfocused');
}, {
passive: true
});
dom.addEventListener(this, 'blur', function () {
onChange.call(this);
label.classList.remove('inputLabelFocused');
label.classList.add('inputLabelUnfocused');
}, {
passive: true
});
dom.addEventListener(this, 'change', onChange, {
passive: true
});
dom.addEventListener(this, 'input', onChange, {
passive: true
});
dom.addEventListener(this, 'valueset', onChange, {
passive: true
});
if (browser.orsay) {
if (this === document.activeElement) {
//Make sure the IME pops up if this is the first/default element on the page
if (document.attachIME) {
document.attachIME(this);
}
}
}
};
function onChange() {
var label = this.labelElement;
if (this.value) {
label.classList.remove('inputLabel-float');
} else {
var instanceSupportsFloat = supportsFloatingLabel && this.type !== 'date' && this.type !== 'time';
if (instanceSupportsFloat) {
label.classList.add('inputLabel-float');
}
}
}
EmbyInputPrototype.attachedCallback = function () {
this.labelElement.htmlFor = this.id;
onChange.call(this);
};
EmbyInputPrototype.label = function (text) {
this.labelElement.innerHTML = text;
};
document.registerElement('emby-input', {
prototype: EmbyInputPrototype,
extends: "input"
})
extends: 'input'
});
});