diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 0000000000..52369be1e3
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1 @@
+libraries/
diff --git a/.eslintrc.yml b/.eslintrc.yml
index 4110862a11..b215e15800 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -2,3 +2,26 @@ env:
es6: true
browser: true
amd: true
+
+rules:
+ block-spacing: ["error"]
+ brace-style: ["error"]
+ comma-dangle: ["error", "never"]
+ comma-spacing: ["error"]
+ eol-last: ["off"]
+ indent: ["error", 4, { "SwitchCase": 1 }]
+ keyword-spacing: ["error"]
+ line-comment-position: ["off"]
+ max-statements-per-line: ["error"]
+ no-empty: ["error"]
+ no-extra-semi: ["error"]
+ no-floating-decimal: ["error"]
+ no-multi-spaces: ["error"]
+ no-multiple-empty-lines: ["error", { "max": 1 }]
+ no-trailing-spaces: ["error"]
+ no-void: ["off"]
+ one-var: ["error", "never"]
+ padding-line-between-statements: ["off"]
+ semi: ["off"]
+ space-before-blocks: ["error"]
+ yoda: ["off"]
diff --git a/package.json b/package.json
index 051102239b..8eea3ca247 100644
--- a/package.json
+++ b/package.json
@@ -18,16 +18,21 @@
},
"dependencies": {
"alameda": "^1.3.0",
+ "document-register-element": "^0.5.4",
"flv.js": "^1.5.0",
"hls.js": "^0.12.4",
"howler": "^2.1.2",
"jquery": "^3.4.1",
"jstree": "^3.3.7",
"libjass": "^0.11.0",
+ "native-promise-only": "^0.8.0-a",
"requirejs": "^2.3.5",
+ "resize-observer-polyfill": "^1.5.1",
"shaka-player": "^2.5.5",
"sortablejs": "^1.9.0",
- "swiper": "^3.4.2"
+ "swiper": "^3.4.2",
+ "webcomponents.js-2": "^0.7.24",
+ "whatwg-fetch": "^1.1.1"
},
"scripts": {
"serve": "webpack-dev-server --config webpack.dev.js --open",
diff --git a/src/bower_components/document-register-element/basic.html b/src/bower_components/document-register-element/basic.html
deleted file mode 100644
index 713a029e4c..0000000000
--- a/src/bower_components/document-register-element/basic.html
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- testing my-element
-
-
-
-
-
- some content
-
-
\ No newline at end of file
diff --git a/src/bower_components/document-register-element/build/document-register-element.js b/src/bower_components/document-register-element/build/document-register-element.js
deleted file mode 100644
index 57fe40a366..0000000000
--- a/src/bower_components/document-register-element/build/document-register-element.js
+++ /dev/null
@@ -1,246 +0,0 @@
-/*! (C) WebReflection Mit Style License */
-(function(e, t, n, r) {
- "use strict";
-
- function rt(e, t) {
- for (var n = 0, r = e.length; n < r; n++) vt(e[n], t)
- }
-
- function it(e) {
- for (var t = 0, n = e.length, r; t < n; t++) r = e[t], nt(r, b[ot(r)])
- }
-
- function st(e) {
- return function(t) {
- j(t) && (vt(t, e), rt(t.querySelectorAll(w), e))
- }
- }
-
- function ot(e) {
- var t = e.getAttribute("is"),
- n = e.nodeName.toUpperCase(),
- r = S.call(y, t ? v + t.toUpperCase() : d + n);
- return t && -1 < r && !ut(n, t) ? -1 : r
- }
-
- function ut(e, t) {
- return -1 < w.indexOf(e + '[is="' + t + '"]')
- }
-
- function at(e) {
- var t = e.currentTarget,
- n = e.attrChange,
- r = e.attrName,
- i = e.target;
- Q && (!i || i === t) && t.attributeChangedCallback && r !== "style" && e.prevValue !== e.newValue && t.attributeChangedCallback(r, n === e[a] ? null : e.prevValue, n === e[l] ? null : e.newValue)
- }
-
- function ft(e) {
- var t = st(e);
- return function(e) {
- X.push(t, e.target)
- }
- }
-
- function lt(e) {
- K && (K = !1, e.currentTarget.removeEventListener(h, lt)), rt((e.target || t).querySelectorAll(w), e.detail === o ? o : s), B && pt()
- }
-
- function ct(e, t) {
- var n = this;
- q.call(n, e, t), G.call(n, {
- target: n
- })
- }
-
- function ht(e, t) {
- D(e, t), et ? et.observe(e, z) : (J && (e.setAttribute = ct, e[i] = Z(e), e.addEventListener(p, G)), e.addEventListener(c, at)), e.createdCallback && Q && (e.created = !0, e.createdCallback(), e.created = !1)
- }
-
- function pt() {
- for (var e, t = 0, n = F.length; t < n; t++) e = F[t], E.contains(e) || (n--, F.splice(t--, 1), vt(e, o))
- }
-
- function dt(e) {
- throw new Error("A " + e + " type is already registered")
- }
-
- function vt(e, t) {
- var n, r = ot(e); - 1 < r && (tt(e, b[r]), r = 0, t === s && !e[s] ? (e[o] = !1, e[s] = !0, r = 1, B && S.call(F, e) < 0 && F.push(e)) : t === o && !e[o] && (e[s] = !1, e[o] = !0, r = 1), r && (n = e[t + "Callback"]) && n.call(e))
- }
- if (r in t) return;
- var i = "__" + r + (Math.random() * 1e5 >> 0),
- s = "attached",
- o = "detached",
- u = "extends",
- a = "ADDITION",
- f = "MODIFICATION",
- l = "REMOVAL",
- c = "DOMAttrModified",
- h = "DOMContentLoaded",
- p = "DOMSubtreeModified",
- d = "<",
- v = "=",
- m = /^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/,
- g = ["ANNOTATION-XML", "COLOR-PROFILE", "FONT-FACE", "FONT-FACE-SRC", "FONT-FACE-URI", "FONT-FACE-FORMAT", "FONT-FACE-NAME", "MISSING-GLYPH"],
- y = [],
- b = [],
- w = "",
- E = t.documentElement,
- S = y.indexOf || function(e) {
- for (var t = this.length; t-- && this[t] !== e;);
- return t
- },
- x = n.prototype,
- T = x.hasOwnProperty,
- N = x.isPrototypeOf,
- C = n.defineProperty,
- k = n.getOwnPropertyDescriptor,
- L = n.getOwnPropertyNames,
- A = n.getPrototypeOf,
- O = n.setPrototypeOf,
- M = !!n.__proto__,
- _ = n.create || function mt(e) {
- return e ? (mt.prototype = e, new mt) : this
- },
- D = O || (M ? function(e, t) {
- return e.__proto__ = t, e
- } : L && k ? function() {
- function e(e, t) {
- for (var n, r = L(t), i = 0, s = r.length; i < s; i++) n = r[i], T.call(e, n) || C(e, n, k(t, n))
- }
- return function(t, n) {
- do e(t, n); while ((n = A(n)) && !N.call(n, t));
- return t
- }
- }() : function(e, t) {
- for (var n in t) e[n] = t[n];
- return e
- }),
- P = e.MutationObserver || e.WebKitMutationObserver,
- H = (e.HTMLElement || e.Element || e.Node).prototype,
- B = !N.call(H, E),
- j = B ? function(e) {
- return e.nodeType === 1
- } : function(e) {
- return N.call(H, e)
- },
- F = B && [],
- I = H.cloneNode,
- q = H.setAttribute,
- R = H.removeAttribute,
- U = t.createElement,
- z = P && {
- attributes: !0,
- characterData: !0,
- attributeOldValue: !0
- },
- W = P || function(e) {
- J = !1, E.removeEventListener(c, W)
- },
- X, V = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.msRequestAnimationFrame || function(e) {
- setTimeout(e, 10)
- },
- $ = !1,
- J = !0,
- K = !0,
- Q = !0,
- G, Y, Z, et, tt, nt;
- O || M ? (tt = function(e, t) {
- N.call(t, e) || ht(e, t)
- }, nt = ht) : (tt = function(e, t) {
- e[i] || (e[i] = n(!0), ht(e, t))
- }, nt = tt), B ? (J = !1, function() {
- var e = k(H, "addEventListener"),
- t = e.value,
- n = function(e) {
- var t = new CustomEvent(c, {
- bubbles: !0
- });
- t.attrName = e, t.prevValue = this.getAttribute(e), t.newValue = null, t[l] = t.attrChange = 2, R.call(this, e), this.dispatchEvent(t)
- },
- r = function(e, t) {
- var n = this.hasAttribute(e),
- r = n && this.getAttribute(e),
- i = new CustomEvent(c, {
- bubbles: !0
- });
- q.call(this, e, t), i.attrName = e, i.prevValue = n ? r : null, i.newValue = t, n ? i[f] = i.attrChange = 1 : i[a] = i.attrChange = 0, this.dispatchEvent(i)
- },
- s = function(e) {
- var t = e.currentTarget,
- n = t[i],
- r = e.propertyName,
- s;
- n.hasOwnProperty(r) && (n = n[r], s = new CustomEvent(c, {
- bubbles: !0
- }), s.attrName = n.name, s.prevValue = n.value || null, s.newValue = n.value = t[r] || null, s.prevValue == null ? s[a] = s.attrChange = 0 : s[f] = s.attrChange = 1, t.dispatchEvent(s))
- };
- e.value = function(e, o, u) {
- e === c && this.attributeChangedCallback && this.setAttribute !== r && (this[i] = {
- className: {
- name: "class",
- value: this.className
- }
- }, this.setAttribute = r, this.removeAttribute = n, t.call(this, "propertychange", s)), t.call(this, e, o, u)
- }, C(H, "addEventListener", e)
- }()) : P || (E.addEventListener(c, W), E.setAttribute(i, 1), E.removeAttribute(i), J && (G = function(e) {
- var t = this,
- n, r, s;
- if (t === e.target) {
- n = t[i], t[i] = r = Z(t);
- for (s in r) {
- if (!(s in n)) return Y(0, t, s, n[s], r[s], a);
- if (r[s] !== n[s]) return Y(1, t, s, n[s], r[s], f)
- }
- for (s in n)
- if (!(s in r)) return Y(2, t, s, n[s], r[s], l)
- }
- }, Y = function(e, t, n, r, i, s) {
- var o = {
- attrChange: e,
- currentTarget: t,
- attrName: n,
- prevValue: r,
- newValue: i
- };
- o[s] = e, at(o)
- }, Z = function(e) {
- for (var t, n, r = {}, i = e.attributes, s = 0, o = i.length; s < o; s++) t = i[s], n = t.name, n !== "setAttribute" && (r[n] = t.value);
- return r
- })), t[r] = function(n, r) {
- c = n.toUpperCase(), $ || ($ = !0, P ? (et = function(e, t) {
- function n(e, t) {
- for (var n = 0, r = e.length; n < r; t(e[n++]));
- }
- return new P(function(r) {
- for (var i, s, o, u = 0, a = r.length; u < a; u++) i = r[u], i.type === "childList" ? (n(i.addedNodes, e), n(i.removedNodes, t)) : (s = i.target, Q && s.attributeChangedCallback && i.attributeName !== "style" && (o = s.getAttribute(i.attributeName), o !== i.oldValue && s.attributeChangedCallback(i.attributeName, i.oldValue, o)))
- })
- }(st(s), st(o)), et.observe(t, {
- childList: !0,
- subtree: !0
- })) : (X = [], V(function E() {
- while (X.length) X.shift().call(null, X.shift());
- V(E)
- }), t.addEventListener("DOMNodeInserted", ft(s)), t.addEventListener("DOMNodeRemoved", ft(o))), t.addEventListener(h, lt), t.addEventListener("readystatechange", lt), t.createElement = function(e, n) {
- var r = U.apply(t, arguments),
- i = "" + e,
- s = S.call(y, (n ? v : d) + (n || i).toUpperCase()),
- o = -1 < s;
- return n && (r.setAttribute("is", n = n.toLowerCase()), o && (o = ut(i.toUpperCase(), n))), Q = !t.createElement.innerHTMLHelper, o && nt(r, b[s]), r
- }, H.cloneNode = function(e) {
- var t = I.call(this, !!e),
- n = ot(t);
- return -1 < n && nt(t, b[n]), e && it(t.querySelectorAll(w)), t
- }), -2 < S.call(y, v + c) + S.call(y, d + c) && dt(n);
- if (!m.test(c) || -1 < S.call(g, c)) throw new Error("The type " + n + " is invalid");
- var i = function() {
- return f ? t.createElement(l, c) : t.createElement(l)
- },
- a = r || x,
- f = T.call(a, u),
- l = f ? r[u].toUpperCase() : c,
- c, p;
- return f && -1 < S.call(y, d + l) && dt(l), p = y.push((f ? v : d) + c) - 1, w = w.concat(w.length ? "," : "", f ? l + '[is="' + n.toLowerCase() + '"]' : l), i.prototype = b[p] = T.call(a, "prototype") ? a.prototype : _(H), rt(t.querySelectorAll(w), s), i
- }
-})(window, document, Object, "registerElement");
\ No newline at end of file
diff --git a/src/bower_components/fetch/fetch.js b/src/bower_components/fetch/fetch.js
deleted file mode 100644
index cd40b3ed2d..0000000000
--- a/src/bower_components/fetch/fetch.js
+++ /dev/null
@@ -1,263 +0,0 @@
-! function(self) {
- "use strict";
-
- function normalizeName(name) {
- if ("string" != typeof name && (name = String(name)), /[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) throw new TypeError("Invalid character in header field name");
- return name.toLowerCase()
- }
-
- function normalizeValue(value) {
- return "string" != typeof value && (value = String(value)), value
- }
-
- function iteratorFor(items) {
- var iterator = {
- next: function() {
- var value = items.shift();
- return {
- done: void 0 === value,
- value: value
- }
- }
- };
- return support.iterable && (iterator[Symbol.iterator] = function() {
- return iterator
- }), iterator
- }
-
- function Headers(headers) {
- this.map = {}, headers instanceof Headers ? headers.forEach(function(value, name) {
- this.append(name, value)
- }, this) : headers && Object.getOwnPropertyNames(headers).forEach(function(name) {
- this.append(name, headers[name])
- }, this)
- }
-
- function consumed(body) {
- if (body.bodyUsed) return Promise.reject(new TypeError("Already read"));
- body.bodyUsed = !0
- }
-
- function fileReaderReady(reader) {
- return new Promise(function(resolve, reject) {
- reader.onload = function() {
- resolve(reader.result)
- }, reader.onerror = function() {
- reject(reader.error)
- }
- })
- }
-
- function readBlobAsArrayBuffer(blob) {
- var reader = new FileReader,
- promise = fileReaderReady(reader);
- return reader.readAsArrayBuffer(blob), promise
- }
-
- function readBlobAsText(blob) {
- var reader = new FileReader,
- promise = fileReaderReady(reader);
- return reader.readAsText(blob), promise
- }
-
- function readArrayBufferAsText(buf) {
- for (var view = new Uint8Array(buf), chars = new Array(view.length), i = 0; i < view.length; i++) chars[i] = String.fromCharCode(view[i]);
- return chars.join("")
- }
-
- function bufferClone(buf) {
- if (buf.slice) return buf.slice(0);
- var view = new Uint8Array(buf.byteLength);
- return view.set(new Uint8Array(buf)), view.buffer
- }
-
- function Body() {
- return this.bodyUsed = !1, this._initBody = function(body) {
- if (this._bodyInit = body, body)
- if ("string" == typeof body) this._bodyText = body;
- else if (support.blob && Blob.prototype.isPrototypeOf(body)) this._bodyBlob = body;
- else if (support.formData && FormData.prototype.isPrototypeOf(body)) this._bodyFormData = body;
- else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) this._bodyText = body.toString();
- else if (support.arrayBuffer && support.blob && isDataView(body)) this._bodyArrayBuffer = bufferClone(body.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer]);
- else {
- if (!support.arrayBuffer || !ArrayBuffer.prototype.isPrototypeOf(body) && !isArrayBufferView(body)) throw new Error("unsupported BodyInit type");
- this._bodyArrayBuffer = bufferClone(body)
- } else this._bodyText = "";
- this.headers.get("content-type") || ("string" == typeof body ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : support.searchParams && URLSearchParams.prototype.isPrototypeOf(body) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"))
- }, support.blob && (this.blob = function() {
- var rejected = consumed(this);
- if (rejected) return rejected;
- if (this._bodyBlob) return Promise.resolve(this._bodyBlob);
- if (this._bodyArrayBuffer) return Promise.resolve(new Blob([this._bodyArrayBuffer]));
- if (this._bodyFormData) throw new Error("could not read FormData body as blob");
- return Promise.resolve(new Blob([this._bodyText]))
- }, this.arrayBuffer = function() {
- return this._bodyArrayBuffer ? consumed(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(readBlobAsArrayBuffer)
- }), this.text = function() {
- var rejected = consumed(this);
- if (rejected) return rejected;
- if (this._bodyBlob) return readBlobAsText(this._bodyBlob);
- if (this._bodyArrayBuffer) return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));
- if (this._bodyFormData) throw new Error("could not read FormData body as text");
- return Promise.resolve(this._bodyText)
- }, support.formData && (this.formData = function() {
- return this.text().then(decode)
- }), this.json = function() {
- return this.text().then(JSON.parse)
- }, this
- }
-
- function normalizeMethod(method) {
- var upcased = method.toUpperCase();
- return methods.indexOf(upcased) > -1 ? upcased : method
- }
-
- function Request(input, options) {
- options = options || {};
- var body = options.body;
- if ("string" == typeof input) this.url = input;
- else {
- if (input.bodyUsed) throw new TypeError("Already read");
- this.url = input.url, this.credentials = input.credentials, options.headers || (this.headers = new Headers(input.headers)), this.method = input.method, this.mode = input.mode, body || null == input._bodyInit || (body = input._bodyInit, input.bodyUsed = !0)
- }
- if (this.credentials = options.credentials || this.credentials || "omit", !options.headers && this.headers || (this.headers = new Headers(options.headers)), this.method = normalizeMethod(options.method || this.method || "GET"), this.mode = options.mode || this.mode || null, this.referrer = null, ("GET" === this.method || "HEAD" === this.method) && body) throw new TypeError("Body not allowed for GET or HEAD requests");
- this._initBody(body)
- }
-
- function decode(body) {
- var form = new FormData;
- return body.trim().split("&").forEach(function(bytes) {
- if (bytes) {
- var split = bytes.split("="),
- name = split.shift().replace(/\+/g, " "),
- value = split.join("=").replace(/\+/g, " ");
- form.append(decodeURIComponent(name), decodeURIComponent(value))
- }
- }), form
- }
-
- function parseHeaders(rawHeaders) {
- var headers = new Headers;
- return rawHeaders.split("\r\n").forEach(function(line) {
- var parts = line.split(":"),
- key = parts.shift().trim();
- if (key) {
- var value = parts.join(":").trim();
- headers.append(key, value)
- }
- }), headers
- }
-
- function Response(bodyInit, options) {
- options || (options = {}), this.type = "default", this.status = "status" in options ? options.status : 200, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in options ? options.statusText : "OK", this.headers = new Headers(options.headers), this.url = options.url || "", this._initBody(bodyInit)
- }
- if (!self.fetch) {
- var support = {
- searchParams: "URLSearchParams" in self,
- iterable: "Symbol" in self && "iterator" in Symbol,
- blob: "FileReader" in self && "Blob" in self && function() {
- try {
- return new Blob, !0
- } catch (e) {
- return !1
- }
- }(),
- formData: "FormData" in self,
- arrayBuffer: "ArrayBuffer" in self
- };
- if (support.arrayBuffer) var viewClasses = ["[object Int8Array]", "[object Uint8Array]", "[object Uint8ClampedArray]", "[object Int16Array]", "[object Uint16Array]", "[object Int32Array]", "[object Uint32Array]", "[object Float32Array]", "[object Float64Array]"],
- isDataView = function(obj) {
- return obj && DataView.prototype.isPrototypeOf(obj)
- },
- isArrayBufferView = ArrayBuffer.isView || function(obj) {
- return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
- };
- Headers.prototype.append = function(name, value) {
- name = normalizeName(name), value = normalizeValue(value);
- var list = this.map[name];
- list || (list = [], this.map[name] = list), list.push(value)
- }, Headers.prototype.delete = function(name) {
- delete this.map[normalizeName(name)]
- }, Headers.prototype.get = function(name) {
- var values = this.map[normalizeName(name)];
- return values ? values[0] : null
- }, Headers.prototype.getAll = function(name) {
- return this.map[normalizeName(name)] || []
- }, Headers.prototype.has = function(name) {
- return this.map.hasOwnProperty(normalizeName(name))
- }, Headers.prototype.set = function(name, value) {
- this.map[normalizeName(name)] = [normalizeValue(value)]
- }, Headers.prototype.forEach = function(callback, thisArg) {
- Object.getOwnPropertyNames(this.map).forEach(function(name) {
- this.map[name].forEach(function(value) {
- callback.call(thisArg, value, name, this)
- }, this)
- }, this)
- }, Headers.prototype.keys = function() {
- var items = [];
- return this.forEach(function(value, name) {
- items.push(name)
- }), iteratorFor(items)
- }, Headers.prototype.values = function() {
- var items = [];
- return this.forEach(function(value) {
- items.push(value)
- }), iteratorFor(items)
- }, Headers.prototype.entries = function() {
- var items = [];
- return this.forEach(function(value, name) {
- items.push([name, value])
- }), iteratorFor(items)
- }, support.iterable && (Headers.prototype[Symbol.iterator] = Headers.prototype.entries);
- var methods = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
- Request.prototype.clone = function() {
- return new Request(this, {
- body: this._bodyInit
- })
- }, Body.call(Request.prototype), Body.call(Response.prototype), Response.prototype.clone = function() {
- return new Response(this._bodyInit, {
- status: this.status,
- statusText: this.statusText,
- headers: new Headers(this.headers),
- url: this.url
- })
- }, Response.error = function() {
- var response = new Response(null, {
- status: 0,
- statusText: ""
- });
- return response.type = "error", response
- };
- var redirectStatuses = [301, 302, 303, 307, 308];
- Response.redirect = function(url, status) {
- if (-1 === redirectStatuses.indexOf(status)) throw new RangeError("Invalid status code");
- return new Response(null, {
- status: status,
- headers: {
- location: url
- }
- })
- }, self.Headers = Headers, self.Request = Request, self.Response = Response, self.fetch = function(input, init) {
- return new Promise(function(resolve, reject) {
- var request = new Request(input, init),
- xhr = new XMLHttpRequest;
- xhr.onload = function() {
- var options = {
- status: xhr.status,
- statusText: xhr.statusText,
- headers: parseHeaders(xhr.getAllResponseHeaders() || "")
- };
- options.url = "responseURL" in xhr ? xhr.responseURL : options.headers.get("X-Request-URL");
- var body = "response" in xhr ? xhr.response : xhr.responseText;
- resolve(new Response(body, options))
- }, xhr.onerror = function() {
- reject(new TypeError("Network request failed"))
- }, xhr.ontimeout = function() {
- reject(new TypeError("Network request failed"))
- }, xhr.open(request.method, request.url, !0), "include" === request.credentials && (xhr.withCredentials = !0), "responseType" in xhr && support.blob && (xhr.responseType = "blob"), request.headers.forEach(function(value, name) {
- xhr.setRequestHeader(name, value)
- }), xhr.send(void 0 === request._bodyInit ? null : request._bodyInit)
- })
- }, self.fetch.polyfill = !0
- }
-}("undefined" != typeof self ? self : this);
\ No newline at end of file
diff --git a/src/bower_components/native-promise-only/lib/npo.src.js b/src/bower_components/native-promise-only/lib/npo.src.js
deleted file mode 100644
index 1c8cb07867..0000000000
--- a/src/bower_components/native-promise-only/lib/npo.src.js
+++ /dev/null
@@ -1,373 +0,0 @@
-/*! Native Promise Only
- v0.8.0-a (c) Kyle Simpson
- MIT License: http://getify.mit-license.org
-*/
-
-(function UMD(name,context,definition){
- // special form of UMD for polyfilling across evironments
- context[name] = definition();
- if (typeof module != "undefined" && module.exports) { module.exports = context[name]; }
- else if (typeof define == "function" && define.amd) { define(function $AMD$(){ return context[name]; }); }
-})("Promise",typeof global != "undefined" ? global : this,function DEF(){
- /*jshint validthis:true */
- "use strict";
-
- var builtInProp, cycle, scheduling_queue,
- ToString = Object.prototype.toString,
- timer = (typeof setImmediate != "undefined") ?
- function timer(fn) { return setImmediate(fn); } :
- setTimeout
- ;
-
- // dammit, IE8.
- try {
- Object.defineProperty({},"x",{});
- builtInProp = function builtInProp(obj,name,val,config) {
- return Object.defineProperty(obj,name,{
- value: val,
- writable: true,
- configurable: config !== false
- });
- };
- }
- catch (err) {
- builtInProp = function builtInProp(obj,name,val) {
- obj[name] = val;
- return obj;
- };
- }
-
- // Note: using a queue instead of array for efficiency
- scheduling_queue = (function Queue() {
- var first, last, item;
-
- function Item(fn,self) {
- this.fn = fn;
- this.self = self;
- this.next = void 0;
- }
-
- return {
- add: function add(fn,self) {
- item = new Item(fn,self);
- if (last) {
- last.next = item;
- }
- else {
- first = item;
- }
- last = item;
- item = void 0;
- },
- drain: function drain() {
- var f = first;
- first = last = cycle = void 0;
-
- while (f) {
- f.fn.call(f.self);
- f = f.next;
- }
- }
- };
- })();
-
- function schedule(fn,self) {
- scheduling_queue.add(fn,self);
- if (!cycle) {
- cycle = timer(scheduling_queue.drain);
- }
- }
-
- // promise duck typing
- function isThenable(o) {
- var _then, o_type = typeof o;
-
- if (o != null &&
- (
- o_type == "object" || o_type == "function"
- )
- ) {
- _then = o.then;
- }
- return typeof _then == "function" ? _then : false;
- }
-
- function notify() {
- for (var i=0; i 0) {
- schedule(notify,self);
- }
- }
- }
- catch (err) {
- reject.call(new MakeDefWrapper(self),err);
- }
- }
-
- function reject(msg) {
- var self = this;
-
- // already triggered?
- if (self.triggered) { return; }
-
- self.triggered = true;
-
- // unwrap
- if (self.def) {
- self = self.def;
- }
-
- self.msg = msg;
- self.state = 2;
- if (self.chain.length > 0) {
- schedule(notify,self);
- }
- }
-
- function iteratePromises(Constructor,arr,resolver,rejecter) {
- for (var idx=0; idx} arr
- * @param {*} key
- * @returns {number}
- */
- function getIndex(arr, key) {
- var result = -1;
-
- arr.some(function (entry, index) {
- if (entry[0] === key) {
- result = index;
-
- return true;
- }
-
- return false;
- });
-
- return result;
- }
-
- return (function () {
- function anonymous() {
- this.__entries__ = [];
- }
-
- var prototypeAccessors = { size: { configurable: true } };
-
- /**
- * @returns {boolean}
- */
- prototypeAccessors.size.get = function () {
- return this.__entries__.length;
- };
-
- /**
- * @param {*} key
- * @returns {*}
- */
- anonymous.prototype.get = function (key) {
- var index = getIndex(this.__entries__, key);
- var entry = this.__entries__[index];
-
- return entry && entry[1];
- };
-
- /**
- * @param {*} key
- * @param {*} value
- * @returns {void}
- */
- anonymous.prototype.set = function (key, value) {
- var index = getIndex(this.__entries__, key);
-
- if (~index) {
- this.__entries__[index][1] = value;
- } else {
- this.__entries__.push([key, value]);
- }
- };
-
- /**
- * @param {*} key
- * @returns {void}
- */
- anonymous.prototype.delete = function (key) {
- var entries = this.__entries__;
- var index = getIndex(entries, key);
-
- if (~index) {
- entries.splice(index, 1);
- }
- };
-
- /**
- * @param {*} key
- * @returns {void}
- */
- anonymous.prototype.has = function (key) {
- return !!~getIndex(this.__entries__, key);
- };
-
- /**
- * @returns {void}
- */
- anonymous.prototype.clear = function () {
- this.__entries__.splice(0);
- };
-
- /**
- * @param {Function} callback
- * @param {*} [ctx=null]
- * @returns {void}
- */
- anonymous.prototype.forEach = function (callback, ctx) {
- var this$1 = this;
- if ( ctx === void 0 ) ctx = null;
-
- for (var i = 0, list = this$1.__entries__; i < list.length; i += 1) {
- var entry = list[i];
-
- callback.call(ctx, entry[1], entry[0]);
- }
- };
-
- Object.defineProperties( anonymous.prototype, prototypeAccessors );
-
- return anonymous;
- }());
-})();
-
-/**
- * Detects whether window and document objects are available in current environment.
- */
-var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
-
-// Returns global object of a current environment.
-var global$1 = (function () {
- if (typeof global !== 'undefined' && global.Math === Math) {
- return global;
- }
-
- if (typeof self !== 'undefined' && self.Math === Math) {
- return self;
- }
-
- if (typeof window !== 'undefined' && window.Math === Math) {
- return window;
- }
-
- // eslint-disable-next-line no-new-func
- return Function('return this')();
-})();
-
-/**
- * A shim for the requestAnimationFrame which falls back to the setTimeout if
- * first one is not supported.
- *
- * @returns {number} Requests' identifier.
- */
-var requestAnimationFrame$1 = (function () {
- if (typeof requestAnimationFrame === 'function') {
- // It's required to use a bounded function because IE sometimes throws
- // an "Invalid calling object" error if rAF is invoked without the global
- // object on the left hand side.
- return requestAnimationFrame.bind(global$1);
- }
-
- return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
-})();
-
-// Defines minimum timeout before adding a trailing call.
-var trailingTimeout = 2;
-
-/**
- * Creates a wrapper function which ensures that provided callback will be
- * invoked only once during the specified delay period.
- *
- * @param {Function} callback - Function to be invoked after the delay period.
- * @param {number} delay - Delay after which to invoke callback.
- * @returns {Function}
- */
-var throttle = function (callback, delay) {
- var leadingCall = false,
- trailingCall = false,
- lastCallTime = 0;
-
- /**
- * Invokes the original callback function and schedules new invocation if
- * the "proxy" was called during current request.
- *
- * @returns {void}
- */
- function resolvePending() {
- if (leadingCall) {
- leadingCall = false;
-
- callback();
- }
-
- if (trailingCall) {
- proxy();
- }
- }
-
- /**
- * Callback invoked after the specified delay. It will further postpone
- * invocation of the original function delegating it to the
- * requestAnimationFrame.
- *
- * @returns {void}
- */
- function timeoutCallback() {
- requestAnimationFrame$1(resolvePending);
- }
-
- /**
- * Schedules invocation of the original function.
- *
- * @returns {void}
- */
- function proxy() {
- var timeStamp = Date.now();
-
- if (leadingCall) {
- // Reject immediately following calls.
- if (timeStamp - lastCallTime < trailingTimeout) {
- return;
- }
-
- // Schedule new call to be in invoked when the pending one is resolved.
- // This is important for "transitions" which never actually start
- // immediately so there is a chance that we might miss one if change
- // happens amids the pending invocation.
- trailingCall = true;
- } else {
- leadingCall = true;
- trailingCall = false;
-
- setTimeout(timeoutCallback, delay);
- }
-
- lastCallTime = timeStamp;
- }
-
- return proxy;
-};
-
-// Minimum delay before invoking the update of observers.
-var REFRESH_DELAY = 20;
-
-// A list of substrings of CSS properties used to find transition events that
-// might affect dimensions of observed elements.
-var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
-
-// Check if MutationObserver is available.
-var mutationObserverSupported = typeof MutationObserver !== 'undefined';
-
-/**
- * Singleton controller class which handles updates of ResizeObserver instances.
- */
-var ResizeObserverController = function() {
- this.connected_ = false;
- this.mutationEventsAdded_ = false;
- this.mutationsObserver_ = null;
- this.observers_ = [];
-
- this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
- this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
-};
-
-/**
- * Adds observer to observers list.
- *
- * @param {ResizeObserverSPI} observer - Observer to be added.
- * @returns {void}
- */
-
-
-/**
- * Holds reference to the controller's instance.
- *
- * @private {ResizeObserverController}
- */
-
-
-/**
- * Keeps reference to the instance of MutationObserver.
- *
- * @private {MutationObserver}
- */
-
-/**
- * Indicates whether DOM listeners have been added.
- *
- * @private {boolean}
- */
-ResizeObserverController.prototype.addObserver = function (observer) {
- if (!~this.observers_.indexOf(observer)) {
- this.observers_.push(observer);
- }
-
- // Add listeners if they haven't been added yet.
- if (!this.connected_) {
- this.connect_();
- }
-};
-
-/**
- * Removes observer from observers list.
- *
- * @param {ResizeObserverSPI} observer - Observer to be removed.
- * @returns {void}
- */
-ResizeObserverController.prototype.removeObserver = function (observer) {
- var observers = this.observers_;
- var index = observers.indexOf(observer);
-
- // Remove observer if it's present in registry.
- if (~index) {
- observers.splice(index, 1);
- }
-
- // Remove listeners if controller has no connected observers.
- if (!observers.length && this.connected_) {
- this.disconnect_();
- }
-};
-
-/**
- * Invokes the update of observers. It will continue running updates insofar
- * it detects changes.
- *
- * @returns {void}
- */
-ResizeObserverController.prototype.refresh = function () {
- var changesDetected = this.updateObservers_();
-
- // Continue running updates if changes have been detected as there might
- // be future ones caused by CSS transitions.
- if (changesDetected) {
- this.refresh();
- }
-};
-
-/**
- * Updates every observer from observers list and notifies them of queued
- * entries.
- *
- * @private
- * @returns {boolean} Returns "true" if any observer has detected changes in
- * dimensions of it's elements.
- */
-ResizeObserverController.prototype.updateObservers_ = function () {
- // Collect observers that have active observations.
- var activeObservers = this.observers_.filter(function (observer) {
- return observer.gatherActive(), observer.hasActive();
- });
-
- // Deliver notifications in a separate cycle in order to avoid any
- // collisions between observers, e.g. when multiple instances of
- // ResizeObserver are tracking the same element and the callback of one
- // of them changes content dimensions of the observed target. Sometimes
- // this may result in notifications being blocked for the rest of observers.
- activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
-
- return activeObservers.length > 0;
-};
-
-/**
- * Initializes DOM listeners.
- *
- * @private
- * @returns {void}
- */
-ResizeObserverController.prototype.connect_ = function () {
- // Do nothing if running in a non-browser environment or if listeners
- // have been already added.
- if (!isBrowser || this.connected_) {
- return;
- }
-
- // Subscription to the "Transitionend" event is used as a workaround for
- // delayed transitions. This way it's possible to capture at least the
- // final state of an element.
- document.addEventListener('transitionend', this.onTransitionEnd_);
-
- window.addEventListener('resize', this.refresh);
- window.addEventListener('orientationchange', this.refresh);
-
- if (mutationObserverSupported) {
- this.mutationsObserver_ = new MutationObserver(this.refresh);
-
- this.mutationsObserver_.observe(document, {
- attributes: true,
- childList: true,
- characterData: true,
- subtree: true
- });
- } else {
- document.addEventListener('DOMSubtreeModified', this.refresh);
-
- this.mutationEventsAdded_ = true;
- }
-
- this.connected_ = true;
-};
-
-/**
- * Removes DOM listeners.
- *
- * @private
- * @returns {void}
- */
-ResizeObserverController.prototype.disconnect_ = function () {
- // Do nothing if running in a non-browser environment or if listeners
- // have been already removed.
- if (!isBrowser || !this.connected_) {
- return;
- }
-
- document.removeEventListener('transitionend', this.onTransitionEnd_);
- window.removeEventListener('resize', this.refresh);
- window.removeEventListener('orientationchange', this.refresh);
-
- if (this.mutationsObserver_) {
- this.mutationsObserver_.disconnect();
- }
-
- if (this.mutationEventsAdded_) {
- document.removeEventListener('DOMSubtreeModified', this.refresh);
- }
-
- this.mutationsObserver_ = null;
- this.mutationEventsAdded_ = false;
- this.connected_ = false;
-};
-
-/**
- * "Transitionend" event handler.
- *
- * @private
- * @param {TransitionEvent} event
- * @returns {void}
- */
-ResizeObserverController.prototype.onTransitionEnd_ = function (ref) {
- var propertyName = ref.propertyName; if ( propertyName === void 0 ) propertyName = '';
-
- // Detect whether transition may affect dimensions of an element.
- var isReflowProperty = transitionKeys.some(function (key) {
- return !!~propertyName.indexOf(key);
- });
-
- if (isReflowProperty) {
- this.refresh();
- }
-};
-
-/**
- * Returns instance of the ResizeObserverController.
- *
- * @returns {ResizeObserverController}
- */
-ResizeObserverController.getInstance = function () {
- if (!this.instance_) {
- this.instance_ = new ResizeObserverController();
- }
-
- return this.instance_;
-};
-
-ResizeObserverController.instance_ = null;
-
-/**
- * Defines non-writable/enumerable properties of the provided target object.
- *
- * @param {Object} target - Object for which to define properties.
- * @param {Object} props - Properties to be defined.
- * @returns {Object} Target object.
- */
-var defineConfigurable = (function (target, props) {
- for (var i = 0, list = Object.keys(props); i < list.length; i += 1) {
- var key = list[i];
-
- Object.defineProperty(target, key, {
- value: props[key],
- enumerable: false,
- writable: false,
- configurable: true
- });
- }
-
- return target;
-});
-
-/**
- * Returns the global object associated with provided element.
- *
- * @param {Object} target
- * @returns {Object}
- */
-var getWindowOf = (function (target) {
- // Assume that the element is an instance of Node, which means that it
- // has the "ownerDocument" property from which we can retrieve a
- // corresponding global object.
- var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
-
- // Return the local global object if it's not possible extract one from
- // provided element.
- return ownerGlobal || global$1;
-});
-
-// Placeholder of an empty content rectangle.
-var emptyRect = createRectInit(0, 0, 0, 0);
-
-/**
- * Converts provided string to a number.
- *
- * @param {number|string} value
- * @returns {number}
- */
-function toFloat(value) {
- return parseFloat(value) || 0;
-}
-
-/**
- * Extracts borders size from provided styles.
- *
- * @param {CSSStyleDeclaration} styles
- * @param {...string} positions - Borders positions (top, right, ...)
- * @returns {number}
- */
-function getBordersSize(styles) {
- var positions = [], len = arguments.length - 1;
- while ( len-- > 0 ) positions[ len ] = arguments[ len + 1 ];
-
- return positions.reduce(function (size, position) {
- var value = styles['border-' + position + '-width'];
-
- return size + toFloat(value);
- }, 0);
-}
-
-/**
- * Extracts paddings sizes from provided styles.
- *
- * @param {CSSStyleDeclaration} styles
- * @returns {Object} Paddings box.
- */
-function getPaddings(styles) {
- var positions = ['top', 'right', 'bottom', 'left'];
- var paddings = {};
-
- for (var i = 0, list = positions; i < list.length; i += 1) {
- var position = list[i];
-
- var value = styles['padding-' + position];
-
- paddings[position] = toFloat(value);
- }
-
- return paddings;
-}
-
-/**
- * Calculates content rectangle of provided SVG element.
- *
- * @param {SVGGraphicsElement} target - Element content rectangle of which needs
- * to be calculated.
- * @returns {DOMRectInit}
- */
-function getSVGContentRect(target) {
- var bbox = target.getBBox();
-
- return createRectInit(0, 0, bbox.width, bbox.height);
-}
-
-/**
- * Calculates content rectangle of provided HTMLElement.
- *
- * @param {HTMLElement} target - Element for which to calculate the content rectangle.
- * @returns {DOMRectInit}
- */
-function getHTMLElementContentRect(target) {
-
- var rect = target.getBoundingClientRect();
- return createRectInit(rect.left, rect.top, rect.width, rect.height);
-}
-
-/**
- * Checks whether provided element is a document element ().
- *
- * @param {Element} target - Element to be checked.
- * @returns {boolean}
- */
-function isDocumentElement(target) {
- return target === getWindowOf(target).document.documentElement;
-}
-
-/**
- * Calculates an appropriate content rectangle for provided html or svg element.
- *
- * @param {Element} target - Element content rectangle of which needs to be calculated.
- * @returns {DOMRectInit}
- */
-function getContentRect(target) {
- if (!isBrowser) {
- return emptyRect;
- }
-
- return getHTMLElementContentRect(target);
-}
-
-/**
- * Creates rectangle with an interface of the DOMRectReadOnly.
- * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
- *
- * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
- * @returns {DOMRectReadOnly}
- */
-function createReadOnlyRect(ref) {
- var x = ref.x;
- var y = ref.y;
- var width = ref.width;
- var height = ref.height;
-
- // If DOMRectReadOnly is available use it as a prototype for the rectangle.
- var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
- var rect = Object.create(Constr.prototype);
-
- // Rectangle's properties are not writable and non-enumerable.
- defineConfigurable(rect, {
- x: x, y: y, width: width, height: height,
- top: y,
- right: x + width,
- bottom: height + y,
- left: x
- });
-
- return rect;
-}
-
-/**
- * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
- * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
- *
- * @param {number} x - X coordinate.
- * @param {number} y - Y coordinate.
- * @param {number} width - Rectangle's width.
- * @param {number} height - Rectangle's height.
- * @returns {DOMRectInit}
- */
-function createRectInit(x, y, width, height) {
- return { x: x, y: y, width: width, height: height };
-}
-
-/**
- * Class that is responsible for computations of the content rectangle of
- * provided DOM element and for keeping track of it's changes.
- */
-var ResizeObservation = function(target) {
- this.broadcastWidth = 0;
- this.broadcastHeight = 0;
- this.contentRect_ = createRectInit(0, 0, 0, 0);
-
- this.target = target;
-};
-
-/**
- * Updates content rectangle and tells whether it's width or height properties
- * have changed since the last broadcast.
- *
- * @returns {boolean}
- */
-
-
-/**
- * Reference to the last observed content rectangle.
- *
- * @private {DOMRectInit}
- */
-
-
-/**
- * Broadcasted width of content rectangle.
- *
- * @type {number}
- */
-ResizeObservation.prototype.isActive = function () {
- var rect = getContentRect(this.target);
-
- this.contentRect_ = rect;
- return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;
-};
-
-/**
- * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
- * from the corresponding properties of the last observed content rectangle.
- *
- * @returns {DOMRectInit} Last observed content rectangle.
- */
-ResizeObservation.prototype.broadcastRect = function () {
- var rect = this.contentRect_;
-
- this.broadcastWidth = rect.width;
- this.broadcastHeight = rect.height;
-
- return rect;
-};
-
-var ResizeObserverEntry = function(target, rectInit) {
- var contentRect = createReadOnlyRect(rectInit);
-
- // According to the specification following properties are not writable
- // and are also not enumerable in the native implementation.
- //
- // Property accessors are not being used as they'd require to define a
- // private WeakMap storage which may cause memory leaks in browsers that
- // don't support this type of collections.
- defineConfigurable(this, { target: target, contentRect: contentRect });
-};
-
-var ResizeObserverSPI = function(callback, controller, callbackCtx) {
- this.activeObservations_ = [];
- this.observations_ = new MapShim();
-
- if (typeof callback !== 'function') {
- throw new TypeError('The callback provided as parameter 1 is not a function.');
- }
-
- this.callback_ = callback;
- this.controller_ = controller;
- this.callbackCtx_ = callbackCtx;
-};
-
-/**
- * Starts observing provided element.
- *
- * @param {Element} target - Element to be observed.
- * @returns {void}
- */
-
-
-/**
- * Registry of the ResizeObservation instances.
- *
- * @private {Map}
- */
-
-
-/**
- * Public ResizeObserver instance which will be passed to the callback
- * function and used as a value of it's "this" binding.
- *
- * @private {ResizeObserver}
- */
-
-/**
- * Collection of resize observations that have detected changes in dimensions
- * of elements.
- *
- * @private {Array}
- */
-ResizeObserverSPI.prototype.observe = function (target) {
- if (!arguments.length) {
- throw new TypeError('1 argument required, but only 0 present.');
- }
-
- // Do nothing if current environment doesn't have the Element interface.
- if (typeof Element === 'undefined' || !(Element instanceof Object)) {
- return;
- }
-
- if (!(target instanceof getWindowOf(target).Element)) {
- throw new TypeError('parameter 1 is not of type "Element".');
- }
-
- var observations = this.observations_;
-
- // Do nothing if element is already being observed.
- if (observations.has(target)) {
- return;
- }
-
- observations.set(target, new ResizeObservation(target));
-
- this.controller_.addObserver(this);
-
- // Force the update of observations.
- this.controller_.refresh();
-};
-
-/**
- * Stops observing provided element.
- *
- * @param {Element} target - Element to stop observing.
- * @returns {void}
- */
-ResizeObserverSPI.prototype.unobserve = function (target) {
- if (!arguments.length) {
- throw new TypeError('1 argument required, but only 0 present.');
- }
-
- // Do nothing if current environment doesn't have the Element interface.
- if (typeof Element === 'undefined' || !(Element instanceof Object)) {
- return;
- }
-
- if (!(target instanceof getWindowOf(target).Element)) {
- throw new TypeError('parameter 1 is not of type "Element".');
- }
-
- var observations = this.observations_;
-
- // Do nothing if element is not being observed.
- if (!observations.has(target)) {
- return;
- }
-
- observations.delete(target);
-
- if (!observations.size) {
- this.controller_.removeObserver(this);
- }
-};
-
-/**
- * Stops observing all elements.
- *
- * @returns {void}
- */
-ResizeObserverSPI.prototype.disconnect = function () {
- this.clearActive();
- this.observations_.clear();
- this.controller_.removeObserver(this);
-};
-
-/**
- * Collects observation instances the associated element of which has changed
- * it's content rectangle.
- *
- * @returns {void}
- */
-ResizeObserverSPI.prototype.gatherActive = function () {
- var this$1 = this;
-
- this.clearActive();
-
- this.observations_.forEach(function (observation) {
- if (observation.isActive()) {
- this$1.activeObservations_.push(observation);
- }
- });
-};
-
-/**
- * Invokes initial callback function with a list of ResizeObserverEntry
- * instances collected from active resize observations.
- *
- * @returns {void}
- */
-ResizeObserverSPI.prototype.broadcastActive = function () {
- // Do nothing if observer doesn't have active observations.
- if (!this.hasActive()) {
- return;
- }
-
- var ctx = this.callbackCtx_;
-
- // Create ResizeObserverEntry instance for every active observation.
- var entries = this.activeObservations_.map(function (observation) {
- return new ResizeObserverEntry(observation.target, observation.broadcastRect());
- });
-
- this.callback_.call(ctx, entries, ctx);
- this.clearActive();
-};
-
-/**
- * Clears the collection of active observations.
- *
- * @returns {void}
- */
-ResizeObserverSPI.prototype.clearActive = function () {
- this.activeObservations_.splice(0);
-};
-
-/**
- * Tells whether observer has active observations.
- *
- * @returns {boolean}
- */
-ResizeObserverSPI.prototype.hasActive = function () {
- return this.activeObservations_.length > 0;
-};
-
-// Registry of internal observers. If WeakMap is not available use current shim
-// for the Map collection as it has all required methods and because WeakMap
-// can't be fully polyfilled anyway.
-var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
-
-/**
- * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
- * exposing only those methods and properties that are defined in the spec.
- */
-var ResizeObserver = function(callback) {
- if (!(this instanceof ResizeObserver)) {
- throw new TypeError('Cannot call a class as a function.');
- }
- if (!arguments.length) {
- throw new TypeError('1 argument required, but only 0 present.');
- }
-
- var controller = ResizeObserverController.getInstance();
- var observer = new ResizeObserverSPI(callback, controller, this);
-
- observers.set(this, observer);
-};
-
-// Expose public methods of ResizeObserver.
-['observe', 'unobserve', 'disconnect'].forEach(function (method) {
- ResizeObserver.prototype[method] = function () {
- return (ref = observers.get(this))[method].apply(ref, arguments);
- var ref;
- };
-});
-
-var index = (function () {
- // Export existing implementation if available.
- if (typeof global$1.ResizeObserver !== 'undefined') {
- return global$1.ResizeObserver;
- }
-
- return ResizeObserver;
-})();
-
-return index;
-
-})));
diff --git a/src/bower_components/webcomponentsjs/webcomponents-lite.min.js b/src/bower_components/webcomponentsjs/webcomponents-lite.min.js
deleted file mode 100644
index 163ef436fc..0000000000
--- a/src/bower_components/webcomponentsjs/webcomponents-lite.min.js
+++ /dev/null
@@ -1,1571 +0,0 @@
-/**
- * @license
- * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
- * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
- * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
- * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
- * Code distributed by Google as part of the polymer project is also
- * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
- */
-// @version 0.7.24
-! function() {
- window.WebComponents = window.WebComponents || {
- flags: {}
- };
- var e = "webcomponents-lite.js",
- t = document.querySelector('script[src*="' + e + '"]'),
- n = {};
- if (!n.noOpts) {
- if (location.search.slice(1).split("&").forEach(function(e) {
- var t, o = e.split("=");
- o[0] && (t = o[0].match(/wc-(.+)/)) && (n[t[1]] = o[1] || !0)
- }), t)
- for (var o, r = 0; o = t.attributes[r]; r++) "src" !== o.name && (n[o.name] = o.value || !0);
- if (n.log && n.log.split) {
- var i = n.log.split(",");
- n.log = {}, i.forEach(function(e) {
- n.log[e] = !0
- })
- } else n.log = {}
- }
- n.register && (window.CustomElements = window.CustomElements || {
- flags: {}
- }, window.CustomElements.flags.register = n.register), WebComponents.flags = n
-}(),
-function(e) {
- "use strict";
-
- function t(e) {
- return void 0 !== h[e]
- }
-
- function n() {
- s.call(this), this._isInvalid = !0
- }
-
- function o(e) {
- return "" == e && n.call(this), e.toLowerCase()
- }
-
- function r(e) {
- var t = e.charCodeAt(0);
- return t > 32 && t < 127 && [34, 35, 60, 62, 63, 96].indexOf(t) == -1 ? e : encodeURIComponent(e)
- }
-
- function i(e) {
- var t = e.charCodeAt(0);
- return t > 32 && t < 127 && [34, 35, 60, 62, 96].indexOf(t) == -1 ? e : encodeURIComponent(e)
- }
-
- function a(e, a, s) {
- function c(e) {
- g.push(e)
- }
- var d = a || "scheme start",
- l = 0,
- u = "",
- w = !1,
- _ = !1,
- g = [];
- e: for (;
- (e[l - 1] != p || 0 == l) && !this._isInvalid;) {
- var b = e[l];
- switch (d) {
- case "scheme start":
- if (!b || !m.test(b)) {
- if (a) {
- c("Invalid scheme.");
- break e
- }
- u = "", d = "no scheme";
- continue
- }
- u += b.toLowerCase(), d = "scheme";
- break;
- case "scheme":
- if (b && v.test(b)) u += b.toLowerCase();
- else {
- if (":" != b) {
- if (a) {
- if (p == b) break e;
- c("Code point not allowed in scheme: " + b);
- break e
- }
- u = "", l = 0, d = "no scheme";
- continue
- }
- if (this._scheme = u, u = "", a) break e;
- t(this._scheme) && (this._isRelative = !0), d = "file" == this._scheme ? "relative" : this._isRelative && s && s._scheme == this._scheme ? "relative or authority" : this._isRelative ? "authority first slash" : "scheme data"
- }
- break;
- case "scheme data":
- "?" == b ? (this._query = "?", d = "query") : "#" == b ? (this._fragment = "#", d = "fragment") : p != b && "\t" != b && "\n" != b && "\r" != b && (this._schemeData += r(b));
- break;
- case "no scheme":
- if (s && t(s._scheme)) {
- d = "relative";
- continue
- }
- c("Missing scheme."), n.call(this);
- break;
- case "relative or authority":
- if ("/" != b || "/" != e[l + 1]) {
- c("Expected /, got: " + b), d = "relative";
- continue
- }
- d = "authority ignore slashes";
- break;
- case "relative":
- if (this._isRelative = !0, "file" != this._scheme && (this._scheme = s._scheme), p == b) {
- this._host = s._host, this._port = s._port, this._path = s._path.slice(), this._query = s._query, this._username = s._username, this._password = s._password;
- break e
- }
- if ("/" == b || "\\" == b) "\\" == b && c("\\ is an invalid code point."), d = "relative slash";
- else if ("?" == b) this._host = s._host, this._port = s._port, this._path = s._path.slice(), this._query = "?", this._username = s._username, this._password = s._password, d = "query";
- else {
- if ("#" != b) {
- var y = e[l + 1],
- E = e[l + 2];
- ("file" != this._scheme || !m.test(b) || ":" != y && "|" != y || p != E && "/" != E && "\\" != E && "?" != E && "#" != E) && (this._host = s._host, this._port = s._port, this._username = s._username, this._password = s._password, this._path = s._path.slice(), this._path.pop()), d = "relative path";
- continue
- }
- this._host = s._host, this._port = s._port, this._path = s._path.slice(), this._query = s._query, this._fragment = "#", this._username = s._username, this._password = s._password, d = "fragment"
- }
- break;
- case "relative slash":
- if ("/" != b && "\\" != b) {
- "file" != this._scheme && (this._host = s._host, this._port = s._port, this._username = s._username, this._password = s._password), d = "relative path";
- continue
- }
- "\\" == b && c("\\ is an invalid code point."), d = "file" == this._scheme ? "file host" : "authority ignore slashes";
- break;
- case "authority first slash":
- if ("/" != b) {
- c("Expected '/', got: " + b), d = "authority ignore slashes";
- continue
- }
- d = "authority second slash";
- break;
- case "authority second slash":
- if (d = "authority ignore slashes", "/" != b) {
- c("Expected '/', got: " + b);
- continue
- }
- break;
- case "authority ignore slashes":
- if ("/" != b && "\\" != b) {
- d = "authority";
- continue
- }
- c("Expected authority, got: " + b);
- break;
- case "authority":
- if ("@" == b) {
- w && (c("@ already seen."), u += "%40"), w = !0;
- for (var L = 0; L < u.length; L++) {
- var N = u[L];
- if ("\t" != N && "\n" != N && "\r" != N)
- if (":" != N || null !== this._password) {
- var M = r(N);
- null !== this._password ? this._password += M : this._username += M
- } else this._password = "";
- else c("Invalid whitespace in authority.")
- }
- u = ""
- } else {
- if (p == b || "/" == b || "\\" == b || "?" == b || "#" == b) {
- l -= u.length, u = "", d = "host";
- continue
- }
- u += b
- }
- break;
- case "file host":
- if (p == b || "/" == b || "\\" == b || "?" == b || "#" == b) {
- 2 != u.length || !m.test(u[0]) || ":" != u[1] && "|" != u[1] ? 0 == u.length ? d = "relative path start" : (this._host = o.call(this, u), u = "", d = "relative path start") : d = "relative path";
- continue
- }
- "\t" == b || "\n" == b || "\r" == b ? c("Invalid whitespace in file host.") : u += b;
- break;
- case "host":
- case "hostname":
- if (":" != b || _) {
- if (p == b || "/" == b || "\\" == b || "?" == b || "#" == b) {
- if (this._host = o.call(this, u), u = "", d = "relative path start", a) break e;
- continue
- }
- "\t" != b && "\n" != b && "\r" != b ? ("[" == b ? _ = !0 : "]" == b && (_ = !1), u += b) : c("Invalid code point in host/hostname: " + b)
- } else if (this._host = o.call(this, u), u = "", d = "port", "hostname" == a) break e;
- break;
- case "port":
- if (/[0-9]/.test(b)) u += b;
- else {
- if (p == b || "/" == b || "\\" == b || "?" == b || "#" == b || a) {
- if ("" != u) {
- var T = parseInt(u, 10);
- T != h[this._scheme] && (this._port = T + ""), u = ""
- }
- if (a) break e;
- d = "relative path start";
- continue
- }
- "\t" == b || "\n" == b || "\r" == b ? c("Invalid code point in port: " + b) : n.call(this)
- }
- break;
- case "relative path start":
- if ("\\" == b && c("'\\' not allowed in path."), d = "relative path", "/" != b && "\\" != b) continue;
- break;
- case "relative path":
- if (p != b && "/" != b && "\\" != b && (a || "?" != b && "#" != b)) "\t" != b && "\n" != b && "\r" != b && (u += r(b));
- else {
- "\\" == b && c("\\ not allowed in relative path.");
- var O;
- (O = f[u.toLowerCase()]) && (u = O), ".." == u ? (this._path.pop(), "/" != b && "\\" != b && this._path.push("")) : "." == u && "/" != b && "\\" != b ? this._path.push("") : "." != u && ("file" == this._scheme && 0 == this._path.length && 2 == u.length && m.test(u[0]) && "|" == u[1] && (u = u[0] + ":"), this._path.push(u)), u = "", "?" == b ? (this._query = "?", d = "query") : "#" == b && (this._fragment = "#", d = "fragment")
- }
- break;
- case "query":
- a || "#" != b ? p != b && "\t" != b && "\n" != b && "\r" != b && (this._query += i(b)) : (this._fragment = "#", d = "fragment");
- break;
- case "fragment":
- p != b && "\t" != b && "\n" != b && "\r" != b && (this._fragment += b)
- }
- l++
- }
- }
-
- function s() {
- this._scheme = "", this._schemeData = "", this._username = "", this._password = null, this._host = "", this._port = "", this._path = [], this._query = "", this._fragment = "", this._isInvalid = !1, this._isRelative = !1
- }
-
- function c(e, t) {
- void 0 === t || t instanceof c || (t = new c(String(t))), this._url = e, s.call(this);
- var n = e.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, "");
- a.call(this, n, null, t)
- }
- var d = !1;
- if (!e.forceJURL) try {
- var l = new URL("b", "http://a");
- l.pathname = "c%20d", d = "http://a/c%20d" === l.href
- } catch (u) {}
- if (!d) {
- var h = Object.create(null);
- h.ftp = 21, h.file = 0, h.gopher = 70, h.http = 80, h.https = 443, h.ws = 80, h.wss = 443;
- var f = Object.create(null);
- f["%2e"] = ".", f[".%2e"] = "..", f["%2e."] = "..", f["%2e%2e"] = "..";
- var p = void 0,
- m = /[a-zA-Z]/,
- v = /[a-zA-Z0-9\+\-\.]/;
- c.prototype = {
- toString: function() {
- return this.href
- },
- get href() {
- if (this._isInvalid) return this._url;
- var e = "";
- return "" == this._username && null == this._password || (e = this._username + (null != this._password ? ":" + this._password : "") + "@"), this.protocol + (this._isRelative ? "//" + e + this.host : "") + this.pathname + this._query + this._fragment
- },
- set href(e) {
- s.call(this), a.call(this, e)
- },
- get protocol() {
- return this._scheme + ":"
- },
- set protocol(e) {
- this._isInvalid || a.call(this, e + ":", "scheme start")
- },
- get host() {
- return this._isInvalid ? "" : this._port ? this._host + ":" + this._port : this._host
- },
- set host(e) {
- !this._isInvalid && this._isRelative && a.call(this, e, "host")
- },
- get hostname() {
- return this._host
- },
- set hostname(e) {
- !this._isInvalid && this._isRelative && a.call(this, e, "hostname")
- },
- get port() {
- return this._port
- },
- set port(e) {
- !this._isInvalid && this._isRelative && a.call(this, e, "port")
- },
- get pathname() {
- return this._isInvalid ? "" : this._isRelative ? "/" + this._path.join("/") : this._schemeData
- },
- set pathname(e) {
- !this._isInvalid && this._isRelative && (this._path = [], a.call(this, e, "relative path start"))
- },
- get search() {
- return this._isInvalid || !this._query || "?" == this._query ? "" : this._query
- },
- set search(e) {
- !this._isInvalid && this._isRelative && (this._query = "?", "?" == e[0] && (e = e.slice(1)), a.call(this, e, "query"))
- },
- get hash() {
- return this._isInvalid || !this._fragment || "#" == this._fragment ? "" : this._fragment
- },
- set hash(e) {
- this._isInvalid || (this._fragment = "#", "#" == e[0] && (e = e.slice(1)), a.call(this, e, "fragment"))
- },
- get origin() {
- var e;
- if (this._isInvalid || !this._scheme) return "";
- switch (this._scheme) {
- case "data":
- case "file":
- case "javascript":
- case "mailto":
- return "null"
- }
- return e = this.host, e ? this._scheme + "://" + e : ""
- }
- };
- var w = e.URL;
- w && (c.createObjectURL = function(e) {
- return w.createObjectURL.apply(w, arguments)
- }, c.revokeObjectURL = function(e) {
- w.revokeObjectURL(e)
- }), e.URL = c
- }
-}(self), "undefined" == typeof WeakMap && ! function() {
- var e = Object.defineProperty,
- t = Date.now() % 1e9,
- n = function() {
- this.name = "__st" + (1e9 * Math.random() >>> 0) + (t++ + "__")
- };
- n.prototype = {
- set: function(t, n) {
- var o = t[this.name];
- return o && o[0] === t ? o[1] = n : e(t, this.name, {
- value: [t, n],
- writable: !0
- }), this
- },
- get: function(e) {
- var t;
- return (t = e[this.name]) && t[0] === e ? t[1] : void 0
- },
- "delete": function(e) {
- var t = e[this.name];
- return !(!t || t[0] !== e) && (t[0] = t[1] = void 0, !0)
- },
- has: function(e) {
- var t = e[this.name];
- return !!t && t[0] === e
- }
- }, window.WeakMap = n
- }(),
- function(e) {
- function t(e) {
- b.push(e), g || (g = !0, m(o))
- }
-
- function n(e) {
- return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(e) || e
- }
-
- function o() {
- g = !1;
- var e = b;
- b = [], e.sort(function(e, t) {
- return e.uid_ - t.uid_
- });
- var t = !1;
- e.forEach(function(e) {
- var n = e.takeRecords();
- r(e), n.length && (e.callback_(n, e), t = !0)
- }), t && o()
- }
-
- function r(e) {
- e.nodes_.forEach(function(t) {
- var n = v.get(t);
- n && n.forEach(function(t) {
- t.observer === e && t.removeTransientObservers()
- })
- })
- }
-
- function i(e, t) {
- for (var n = e; n; n = n.parentNode) {
- var o = v.get(n);
- if (o)
- for (var r = 0; r < o.length; r++) {
- var i = o[r],
- a = i.options;
- if (n === e || a.subtree) {
- var s = t(a);
- s && i.enqueue(s)
- }
- }
- }
- }
-
- function a(e) {
- this.callback_ = e, this.nodes_ = [], this.records_ = [], this.uid_ = ++y
- }
-
- function s(e, t) {
- this.type = e, this.target = t, this.addedNodes = [], this.removedNodes = [], this.previousSibling = null, this.nextSibling = null, this.attributeName = null, this.attributeNamespace = null, this.oldValue = null
- }
-
- function c(e) {
- var t = new s(e.type, e.target);
- return t.addedNodes = e.addedNodes.slice(), t.removedNodes = e.removedNodes.slice(), t.previousSibling = e.previousSibling, t.nextSibling = e.nextSibling, t.attributeName = e.attributeName, t.attributeNamespace = e.attributeNamespace, t.oldValue = e.oldValue, t
- }
-
- function d(e, t) {
- return E = new s(e, t)
- }
-
- function l(e) {
- return L ? L : (L = c(E), L.oldValue = e, L)
- }
-
- function u() {
- E = L = void 0
- }
-
- function h(e) {
- return e === L || e === E
- }
-
- function f(e, t) {
- return e === t ? e : L && h(e) ? L : null
- }
-
- function p(e, t, n) {
- this.observer = e, this.target = t, this.options = n, this.transientObservedNodes = []
- }
- if (!e.JsMutationObserver) {
- var m, v = new WeakMap;
- if (/Trident|Edge/.test(navigator.userAgent)) m = setTimeout;
- else if (window.setImmediate) m = window.setImmediate;
- else {
- var w = [],
- _ = String(Math.random());
- window.addEventListener("message", function(e) {
- if (e.data === _) {
- var t = w;
- w = [], t.forEach(function(e) {
- e()
- })
- }
- }), m = function(e) {
- w.push(e), window.postMessage(_, "*")
- }
- }
- var g = !1,
- b = [],
- y = 0;
- a.prototype = {
- observe: function(e, t) {
- if (e = n(e), !t.childList && !t.attributes && !t.characterData || t.attributeOldValue && !t.attributes || t.attributeFilter && t.attributeFilter.length && !t.attributes || t.characterDataOldValue && !t.characterData) throw new SyntaxError;
- var o = v.get(e);
- o || v.set(e, o = []);
- for (var r, i = 0; i < o.length; i++)
- if (o[i].observer === this) {
- r = o[i], r.removeListeners(), r.options = t;
- break
- } r || (r = new p(this, e, t), o.push(r), this.nodes_.push(e)), r.addListeners()
- },
- disconnect: function() {
- this.nodes_.forEach(function(e) {
- for (var t = v.get(e), n = 0; n < t.length; n++) {
- var o = t[n];
- if (o.observer === this) {
- o.removeListeners(), t.splice(n, 1);
- break
- }
- }
- }, this), this.records_ = []
- },
- takeRecords: function() {
- var e = this.records_;
- return this.records_ = [], e
- }
- };
- var E, L;
- p.prototype = {
- enqueue: function(e) {
- var n = this.observer.records_,
- o = n.length;
- if (n.length > 0) {
- var r = n[o - 1],
- i = f(r, e);
- if (i) return void(n[o - 1] = i)
- } else t(this.observer);
- n[o] = e
- },
- addListeners: function() {
- this.addListeners_(this.target)
- },
- addListeners_: function(e) {
- var t = this.options;
- t.attributes && e.addEventListener("DOMAttrModified", this, !0), t.characterData && e.addEventListener("DOMCharacterDataModified", this, !0), t.childList && e.addEventListener("DOMNodeInserted", this, !0), (t.childList || t.subtree) && e.addEventListener("DOMNodeRemoved", this, !0)
- },
- removeListeners: function() {
- this.removeListeners_(this.target)
- },
- removeListeners_: function(e) {
- var t = this.options;
- t.attributes && e.removeEventListener("DOMAttrModified", this, !0), t.characterData && e.removeEventListener("DOMCharacterDataModified", this, !0), t.childList && e.removeEventListener("DOMNodeInserted", this, !0), (t.childList || t.subtree) && e.removeEventListener("DOMNodeRemoved", this, !0)
- },
- addTransientObserver: function(e) {
- if (e !== this.target) {
- this.addListeners_(e), this.transientObservedNodes.push(e);
- var t = v.get(e);
- t || v.set(e, t = []), t.push(this)
- }
- },
- removeTransientObservers: function() {
- var e = this.transientObservedNodes;
- this.transientObservedNodes = [], e.forEach(function(e) {
- this.removeListeners_(e);
- for (var t = v.get(e), n = 0; n < t.length; n++)
- if (t[n] === this) {
- t.splice(n, 1);
- break
- }
- }, this)
- },
- handleEvent: function(e) {
- switch (e.stopImmediatePropagation(), e.type) {
- case "DOMAttrModified":
- var t = e.attrName,
- n = e.relatedNode.namespaceURI,
- o = e.target,
- r = new d("attributes", o);
- r.attributeName = t, r.attributeNamespace = n;
- var a = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;
- i(o, function(e) {
- if (e.attributes && (!e.attributeFilter || !e.attributeFilter.length || e.attributeFilter.indexOf(t) !== -1 || e.attributeFilter.indexOf(n) !== -1)) return e.attributeOldValue ? l(a) : r
- });
- break;
- case "DOMCharacterDataModified":
- var o = e.target,
- r = d("characterData", o),
- a = e.prevValue;
- i(o, function(e) {
- if (e.characterData) return e.characterDataOldValue ? l(a) : r
- });
- break;
- case "DOMNodeRemoved":
- this.addTransientObserver(e.target);
- case "DOMNodeInserted":
- var s, c, h = e.target;
- "DOMNodeInserted" === e.type ? (s = [h], c = []) : (s = [], c = [h]);
- var f = h.previousSibling,
- p = h.nextSibling,
- r = d("childList", e.target.parentNode);
- r.addedNodes = s, r.removedNodes = c, r.previousSibling = f, r.nextSibling = p, i(e.relatedNode, function(e) {
- if (e.childList) return r
- })
- }
- u()
- }
- }, e.JsMutationObserver = a, e.MutationObserver || (e.MutationObserver = a, a._isPolyfilled = !0)
- }
- }(self),
- function() {
- function e(e) {
- switch (e) {
- case "&":
- return "&";
- case "<":
- return "<";
- case ">":
- return ">";
- case " ":
- return " "
- }
- }
-
- function t(t) {
- return t.replace(u, e)
- }
- var n = "undefined" == typeof HTMLTemplateElement;
- /Trident/.test(navigator.userAgent) && ! function() {
- var e = document.importNode;
- document.importNode = function() {
- var t = e.apply(document, arguments);
- if (t.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
- var n = document.createDocumentFragment();
- return n.appendChild(t), n
- }
- return t
- }
- }();
- var o = function() {
- if (!n) {
- var e = document.createElement("template"),
- t = document.createElement("template");
- t.content.appendChild(document.createElement("div")), e.content.appendChild(t);
- var o = e.cloneNode(!0);
- return 0 === o.content.childNodes.length || 0 === o.content.firstChild.content.childNodes.length
- }
- }(),
- r = "template",
- i = function() {};
- if (n) {
- var a = document.implementation.createHTMLDocument("template"),
- s = !0,
- c = document.createElement("style");
- c.textContent = r + "{display:none;}";
- var d = document.head;
- d.insertBefore(c, d.firstElementChild), i.prototype = Object.create(HTMLElement.prototype), i.decorate = function(e) {
- if (!e.content) {
- e.content = a.createDocumentFragment();
- for (var n; n = e.firstChild;) e.content.appendChild(n);
- if (e.cloneNode = function(e) {
- return i.cloneNode(this, e)
- }, s) try {
- Object.defineProperty(e, "innerHTML", {
- get: function() {
- for (var e = "", n = this.content.firstChild; n; n = n.nextSibling) e += n.outerHTML || t(n.data);
- return e
- },
- set: function(e) {
- for (a.body.innerHTML = e, i.bootstrap(a); this.content.firstChild;) this.content.removeChild(this.content.firstChild);
- for (; a.body.firstChild;) this.content.appendChild(a.body.firstChild)
- },
- configurable: !0
- })
- } catch (o) {
- s = !1
- }
- i.bootstrap(e.content)
- }
- }, i.bootstrap = function(e) {
- for (var t, n = e.querySelectorAll(r), o = 0, a = n.length; o < a && (t = n[o]); o++) i.decorate(t)
- }, document.addEventListener("DOMContentLoaded", function() {
- i.bootstrap(document)
- });
- var l = document.createElement;
- document.createElement = function() {
- "use strict";
- var e = l.apply(document, arguments);
- return "template" === e.localName && i.decorate(e), e
- };
- var u = /[&\u00A0<>]/g
- }
- if (n || o) {
- var h = Node.prototype.cloneNode;
- i.cloneNode = function(e, t) {
- var n = h.call(e, !1);
- return this.decorate && this.decorate(n), t && (n.content.appendChild(h.call(e.content, !0)), this.fixClonedDom(n.content, e.content)), n
- }, i.fixClonedDom = function(e, t) {
- if (t.querySelectorAll)
- for (var n, o, i = t.querySelectorAll(r), a = e.querySelectorAll(r), s = 0, c = a.length; s < c; s++) o = i[s], n = a[s], this.decorate && this.decorate(o), n.parentNode.replaceChild(o.cloneNode(!0), n)
- };
- var f = document.importNode;
- Node.prototype.cloneNode = function(e) {
- var t = h.call(this, e);
- return e && i.fixClonedDom(t, this), t
- }, document.importNode = function(e, t) {
- if (e.localName === r) return i.cloneNode(e, t);
- var n = f.call(document, e, t);
- return t && i.fixClonedDom(n, e), n
- }, o && (HTMLTemplateElement.prototype.cloneNode = function(e) {
- return i.cloneNode(this, e)
- })
- }
- n && (window.HTMLTemplateElement = i)
- }(),
- function(e) {
- "use strict";
- if (!window.performance || !window.performance.now) {
- var t = Date.now();
- window.performance = {
- now: function() {
- return Date.now() - t
- }
- }
- }
- window.requestAnimationFrame || (window.requestAnimationFrame = function() {
- var e = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
- return e ? function(t) {
- return e(function() {
- t(performance.now())
- })
- } : function(e) {
- return window.setTimeout(e, 1e3 / 60)
- }
- }()), window.cancelAnimationFrame || (window.cancelAnimationFrame = function() {
- return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(e) {
- clearTimeout(e)
- }
- }());
- var n = function() {
- var e = document.createEvent("Event");
- return e.initEvent("foo", !0, !0), e.preventDefault(), e.defaultPrevented
- }();
- if (!n) {
- var o = Event.prototype.preventDefault;
- Event.prototype.preventDefault = function() {
- this.cancelable && (o.call(this), Object.defineProperty(this, "defaultPrevented", {
- get: function() {
- return !0
- },
- configurable: !0
- }))
- }
- }
- var r = /Trident/.test(navigator.userAgent);
- if ((!window.CustomEvent || r && "function" != typeof window.CustomEvent) && (window.CustomEvent = function(e, t) {
- t = t || {};
- var n = document.createEvent("CustomEvent");
- return n.initCustomEvent(e, Boolean(t.bubbles), Boolean(t.cancelable), t.detail), n
- }, window.CustomEvent.prototype = window.Event.prototype), !window.Event || r && "function" != typeof window.Event) {
- var i = window.Event;
- window.Event = function(e, t) {
- t = t || {};
- var n = document.createEvent("Event");
- return n.initEvent(e, Boolean(t.bubbles), Boolean(t.cancelable)), n
- }, window.Event.prototype = i.prototype
- }
- }(window.WebComponents), window.HTMLImports = window.HTMLImports || {
- flags: {}
- },
- function(e) {
- function t(e, t) {
- t = t || p, o(function() {
- i(e, t)
- }, t)
- }
-
- function n(e) {
- return "complete" === e.readyState || e.readyState === w
- }
-
- function o(e, t) {
- if (n(t)) e && e();
- else {
- var r = function() {
- "complete" !== t.readyState && t.readyState !== w || (t.removeEventListener(_, r), o(e, t))
- };
- t.addEventListener(_, r)
- }
- }
-
- function r(e) {
- e.target.__loaded = !0
- }
-
- function i(e, t) {
- function n() {
- c == d && e && e({
- allImports: s,
- loadedImports: l,
- errorImports: u
- })
- }
-
- function o(e) {
- r(e), l.push(this), c++, n()
- }
-
- function i(e) {
- u.push(this), c++, n()
- }
- var s = t.querySelectorAll("link[rel=import]"),
- c = 0,
- d = s.length,
- l = [],
- u = [];
- if (d)
- for (var h, f = 0; f < d && (h = s[f]); f++) a(h) ? (l.push(this), c++, n()) : (h.addEventListener("load", o), h.addEventListener("error", i));
- else n()
- }
-
- function a(e) {
- return u ? e.__loaded || e["import"] && "loading" !== e["import"].readyState : e.__importParsed
- }
-
- function s(e) {
- for (var t, n = 0, o = e.length; n < o && (t = e[n]); n++) c(t) && d(t)
- }
-
- function c(e) {
- return "link" === e.localName && "import" === e.rel
- }
-
- function d(e) {
- var t = e["import"];
- t ? r({
- target: e
- }) : (e.addEventListener("load", r), e.addEventListener("error", r))
- }
- var l = "import",
- u = Boolean(l in document.createElement("link")),
- h = Boolean(window.ShadowDOMPolyfill),
- f = function(e) {
- return h ? window.ShadowDOMPolyfill.wrapIfNeeded(e) : e
- },
- p = f(document),
- m = {
- get: function() {
- var e = window.HTMLImports.currentScript || document.currentScript || ("complete" !== document.readyState ? document.scripts[document.scripts.length - 1] : null);
- return f(e)
- },
- configurable: !0
- };
- Object.defineProperty(document, "_currentScript", m), Object.defineProperty(p, "_currentScript", m);
- var v = /Trident/.test(navigator.userAgent),
- w = v ? "complete" : "interactive",
- _ = "readystatechange";
- u && (new MutationObserver(function(e) {
- for (var t, n = 0, o = e.length; n < o && (t = e[n]); n++) t.addedNodes && s(t.addedNodes)
- }).observe(document.head, {
- childList: !0
- }), function() {
- if ("loading" === document.readyState)
- for (var e, t = document.querySelectorAll("link[rel=import]"), n = 0, o = t.length; n < o && (e = t[n]); n++) d(e)
- }()), t(function(e) {
- window.HTMLImports.ready = !0, window.HTMLImports.readyTime = (new Date).getTime();
- var t = p.createEvent("CustomEvent");
- t.initCustomEvent("HTMLImportsLoaded", !0, !0, e), p.dispatchEvent(t)
- }), e.IMPORT_LINK_TYPE = l, e.useNative = u, e.rootDocument = p, e.whenReady = t, e.isIE = v
- }(window.HTMLImports),
- function(e) {
- var t = [],
- n = function(e) {
- t.push(e)
- },
- o = function() {
- t.forEach(function(t) {
- t(e)
- })
- };
- e.addModule = n, e.initializeModules = o
- }(window.HTMLImports), window.HTMLImports.addModule(function(e) {
- var t = /(url\()([^)]*)(\))/g,
- n = /(@import[\s]+(?!url\())([^;]*)(;)/g,
- o = {
- resolveUrlsInStyle: function(e, t) {
- var n = e.ownerDocument,
- o = n.createElement("a");
- return e.textContent = this.resolveUrlsInCssText(e.textContent, t, o), e
- },
- resolveUrlsInCssText: function(e, o, r) {
- var i = this.replaceUrls(e, r, o, t);
- return i = this.replaceUrls(i, r, o, n)
- },
- replaceUrls: function(e, t, n, o) {
- return e.replace(o, function(e, o, r, i) {
- var a = r.replace(/["']/g, "");
- return n && (a = new URL(a, n).href), t.href = a, a = t.href, o + "'" + a + "'" + i
- })
- }
- };
- e.path = o
- }), window.HTMLImports.addModule(function(e) {
- var t = {
- async: !0,
- ok: function(e) {
- return e.status >= 200 && e.status < 300 || 304 === e.status || 0 === e.status
- },
- load: function(n, o, r) {
- var i = new XMLHttpRequest;
- return (e.flags.debug || e.flags.bust) && (n += "?" + Math.random()), i.open("GET", n, t.async), i.addEventListener("readystatechange", function(e) {
- if (4 === i.readyState) {
- var n = null;
- try {
- var a = i.getResponseHeader("Location");
- a && (n = "/" === a.substr(0, 1) ? location.origin + a : a)
- } catch (e) {
- console.error(e.message)
- }
- o.call(r, !t.ok(i) && i, i.response || i.responseText, n)
- }
- }), i.send(), i
- },
- loadDocument: function(e, t, n) {
- this.load(e, t, n).responseType = "document"
- }
- };
- e.xhr = t
- }), window.HTMLImports.addModule(function(e) {
- var t = e.xhr,
- n = e.flags,
- o = function(e, t) {
- this.cache = {}, this.onload = e, this.oncomplete = t, this.inflight = 0, this.pending = {}
- };
- o.prototype = {
- addNodes: function(e) {
- this.inflight += e.length;
- for (var t, n = 0, o = e.length; n < o && (t = e[n]); n++) this.require(t);
- this.checkDone()
- },
- addNode: function(e) {
- this.inflight++, this.require(e), this.checkDone()
- },
- require: function(e) {
- var t = e.src || e.href;
- e.__nodeUrl = t, this.dedupe(t, e) || this.fetch(t, e)
- },
- dedupe: function(e, t) {
- if (this.pending[e]) return this.pending[e].push(t), !0;
- return this.cache[e] ? (this.onload(e, t, this.cache[e]), this.tail(), !0) : (this.pending[e] = [t], !1)
- },
- fetch: function(e, o) {
- if (n.load && console.log("fetch", e, o), e)
- if (e.match(/^data:/)) {
- var r = e.split(","),
- i = r[0],
- a = r[1];
- a = i.indexOf(";base64") > -1 ? atob(a) : decodeURIComponent(a), setTimeout(function() {
- this.receive(e, o, null, a)
- }.bind(this), 0)
- } else {
- var s = function(t, n, r) {
- this.receive(e, o, t, n, r)
- }.bind(this);
- t.load(e, s)
- }
- else setTimeout(function() {
- this.receive(e, o, {
- error: "href must be specified"
- }, null)
- }.bind(this), 0)
- },
- receive: function(e, t, n, o, r) {
- this.cache[e] = o;
- for (var i, a = this.pending[e], s = 0, c = a.length; s < c && (i = a[s]); s++) this.onload(e, i, o, n, r), this.tail();
- this.pending[e] = null
- },
- tail: function() {
- --this.inflight, this.checkDone()
- },
- checkDone: function() {
- this.inflight || this.oncomplete()
- }
- }, e.Loader = o
- }), window.HTMLImports.addModule(function(e) {
- var t = function(e) {
- this.addCallback = e, this.mo = new MutationObserver(this.handler.bind(this))
- };
- t.prototype = {
- handler: function(e) {
- for (var t, n = 0, o = e.length; n < o && (t = e[n]); n++) "childList" === t.type && t.addedNodes.length && this.addedNodes(t.addedNodes)
- },
- addedNodes: function(e) {
- this.addCallback && this.addCallback(e);
- for (var t, n = 0, o = e.length; n < o && (t = e[n]); n++) t.children && t.children.length && this.addedNodes(t.children)
- },
- observe: function(e) {
- this.mo.observe(e, {
- childList: !0,
- subtree: !0
- })
- }
- }, e.Observer = t
- }), window.HTMLImports.addModule(function(e) {
- function t(e) {
- return "link" === e.localName && e.rel === l
- }
-
- function n(e) {
- var t = o(e);
- return "data:text/javascript;charset=utf-8," + encodeURIComponent(t)
- }
-
- function o(e) {
- return e.textContent + r(e)
- }
-
- function r(e) {
- var t = e.ownerDocument;
- t.__importedScripts = t.__importedScripts || 0;
- var n = e.ownerDocument.baseURI,
- o = t.__importedScripts ? "-" + t.__importedScripts : "";
- return t.__importedScripts++, "\n//# sourceURL=" + n + o + ".js\n"
- }
-
- function i(e) {
- var t = e.ownerDocument.createElement("style");
- return t.textContent = e.textContent, a.resolveUrlsInStyle(t), t
- }
- var a = e.path,
- s = e.rootDocument,
- c = e.flags,
- d = e.isIE,
- l = e.IMPORT_LINK_TYPE,
- u = "link[rel=" + l + "]",
- h = {
- documentSelectors: u,
- importsSelectors: [u, "link[rel=stylesheet]:not([type])", "style:not([type])", "script:not([type])", 'script[type="application/javascript"]', 'script[type="text/javascript"]'].join(","),
- map: {
- link: "parseLink",
- script: "parseScript",
- style: "parseStyle"
- },
- dynamicElements: [],
- parseNext: function() {
- var e = this.nextToParse();
- e && this.parse(e)
- },
- parse: function(e) {
- if (this.isParsed(e)) return void(c.parse && console.log("[%s] is already parsed", e.localName));
- var t = this[this.map[e.localName]];
- t && (this.markParsing(e), t.call(this, e))
- },
- parseDynamic: function(e, t) {
- this.dynamicElements.push(e), t || this.parseNext()
- },
- markParsing: function(e) {
- c.parse && console.log("parsing", e), this.parsingElement = e
- },
- markParsingComplete: function(e) {
- e.__importParsed = !0, this.markDynamicParsingComplete(e), e.__importElement && (e.__importElement.__importParsed = !0, this.markDynamicParsingComplete(e.__importElement)), this.parsingElement = null, c.parse && console.log("completed", e)
- },
- markDynamicParsingComplete: function(e) {
- var t = this.dynamicElements.indexOf(e);
- t >= 0 && this.dynamicElements.splice(t, 1)
- },
- parseImport: function(e) {
- if (e["import"] = e.__doc, window.HTMLImports.__importsParsingHook && window.HTMLImports.__importsParsingHook(e), e["import"] && (e["import"].__importParsed = !0), this.markParsingComplete(e), e.__resource && !e.__error ? e.dispatchEvent(new CustomEvent("load", {
- bubbles: !1
- })) : e.dispatchEvent(new CustomEvent("error", {
- bubbles: !1
- })), e.__pending)
- for (var t; e.__pending.length;) t = e.__pending.shift(), t && t({
- target: e
- });
- this.parseNext()
- },
- parseLink: function(e) {
- t(e) ? this.parseImport(e) : (e.href = e.href, this.parseGeneric(e))
- },
- parseStyle: function(e) {
- var t = e;
- e = i(e), t.__appliedElement = e, e.__importElement = t, this.parseGeneric(e)
- },
- parseGeneric: function(e) {
- this.trackElement(e), this.addElementToDocument(e)
- },
- rootImportForElement: function(e) {
- for (var t = e; t.ownerDocument.__importLink;) t = t.ownerDocument.__importLink;
- return t
- },
- addElementToDocument: function(e) {
- var t = this.rootImportForElement(e.__importElement || e);
- t.parentNode.insertBefore(e, t)
- },
- trackElement: function(e, t) {
- var n = this,
- o = function(r) {
- e.removeEventListener("load", o), e.removeEventListener("error", o), t && t(r), n.markParsingComplete(e), n.parseNext()
- };
- if (e.addEventListener("load", o), e.addEventListener("error", o), d && "style" === e.localName) {
- var r = !1;
- if (e.textContent.indexOf("@import") == -1) r = !0;
- else if (e.sheet) {
- r = !0;
- for (var i, a = e.sheet.cssRules, s = a ? a.length : 0, c = 0; c < s && (i = a[c]); c++) i.type === CSSRule.IMPORT_RULE && (r = r && Boolean(i.styleSheet))
- }
- r && setTimeout(function() {
- e.dispatchEvent(new CustomEvent("load", {
- bubbles: !1
- }))
- })
- }
- },
- parseScript: function(t) {
- var o = document.createElement("script");
- o.__importElement = t, o.src = t.src ? t.src : n(t), e.currentScript = t, this.trackElement(o, function(t) {
- o.parentNode && o.parentNode.removeChild(o), e.currentScript = null
- }), this.addElementToDocument(o)
- },
- nextToParse: function() {
- return this._mayParse = [], !this.parsingElement && (this.nextToParseInDoc(s) || this.nextToParseDynamic())
- },
- nextToParseInDoc: function(e, n) {
- if (e && this._mayParse.indexOf(e) < 0) {
- this._mayParse.push(e);
- for (var o, r = e.querySelectorAll(this.parseSelectorsForNode(e)), i = 0, a = r.length; i < a && (o = r[i]); i++)
- if (!this.isParsed(o)) return this.hasResource(o) ? t(o) ? this.nextToParseInDoc(o.__doc, o) : o : void 0
- }
- return n
- },
- nextToParseDynamic: function() {
- return this.dynamicElements[0]
- },
- parseSelectorsForNode: function(e) {
- var t = e.ownerDocument || e;
- return t === s ? this.documentSelectors : this.importsSelectors
- },
- isParsed: function(e) {
- return e.__importParsed
- },
- needsDynamicParsing: function(e) {
- return this.dynamicElements.indexOf(e) >= 0
- },
- hasResource: function(e) {
- return !t(e) || void 0 !== e.__doc
- }
- };
- e.parser = h, e.IMPORT_SELECTOR = u
- }), window.HTMLImports.addModule(function(e) {
- function t(e) {
- return n(e, a)
- }
-
- function n(e, t) {
- return "link" === e.localName && e.getAttribute("rel") === t
- }
-
- function o(e) {
- return !!Object.getOwnPropertyDescriptor(e, "baseURI")
- }
-
- function r(e, t) {
- var n = document.implementation.createHTMLDocument(a);
- n._URL = t;
- var r = n.createElement("base");
- r.setAttribute("href", t), n.baseURI || o(n) || Object.defineProperty(n, "baseURI", {
- value: t
- });
- var i = n.createElement("meta");
- return i.setAttribute("charset", "utf-8"), n.head.appendChild(i), n.head.appendChild(r), n.body.innerHTML = e, window.HTMLTemplateElement && HTMLTemplateElement.bootstrap && HTMLTemplateElement.bootstrap(n), n
- }
- var i = e.flags,
- a = e.IMPORT_LINK_TYPE,
- s = e.IMPORT_SELECTOR,
- c = e.rootDocument,
- d = e.Loader,
- l = e.Observer,
- u = e.parser,
- h = {
- documents: {},
- documentPreloadSelectors: s,
- importsPreloadSelectors: [s].join(","),
- loadNode: function(e) {
- f.addNode(e)
- },
- loadSubtree: function(e) {
- var t = this.marshalNodes(e);
- f.addNodes(t)
- },
- marshalNodes: function(e) {
- return e.querySelectorAll(this.loadSelectorsForNode(e))
- },
- loadSelectorsForNode: function(e) {
- var t = e.ownerDocument || e;
- return t === c ? this.documentPreloadSelectors : this.importsPreloadSelectors
- },
- loaded: function(e, n, o, a, s) {
- if (i.load && console.log("loaded", e, n), n.__resource = o, n.__error = a, t(n)) {
- var c = this.documents[e];
- void 0 === c && (c = a ? null : r(o, s || e), c && (c.__importLink = n, this.bootDocument(c)), this.documents[e] = c), n.__doc = c
- }
- u.parseNext()
- },
- bootDocument: function(e) {
- this.loadSubtree(e), this.observer.observe(e), u.parseNext()
- },
- loadedAll: function() {
- u.parseNext()
- }
- },
- f = new d(h.loaded.bind(h), h.loadedAll.bind(h));
- if (h.observer = new l, !document.baseURI) {
- var p = {
- get: function() {
- var e = document.querySelector("base");
- return e ? e.href : window.location.href
- },
- configurable: !0
- };
- Object.defineProperty(document, "baseURI", p), Object.defineProperty(c, "baseURI", p)
- }
- e.importer = h, e.importLoader = f
- }), window.HTMLImports.addModule(function(e) {
- var t = e.parser,
- n = e.importer,
- o = {
- added: function(e) {
- for (var o, r, i, a, s = 0, c = e.length; s < c && (a = e[s]); s++) o || (o = a.ownerDocument, r = t.isParsed(o)), i = this.shouldLoadNode(a), i && n.loadNode(a), this.shouldParseNode(a) && r && t.parseDynamic(a, i)
- },
- shouldLoadNode: function(e) {
- return 1 === e.nodeType && r.call(e, n.loadSelectorsForNode(e))
- },
- shouldParseNode: function(e) {
- return 1 === e.nodeType && r.call(e, t.parseSelectorsForNode(e))
- }
- };
- n.observer.addCallback = o.added.bind(o);
- var r = HTMLElement.prototype.matches || HTMLElement.prototype.matchesSelector || HTMLElement.prototype.webkitMatchesSelector || HTMLElement.prototype.mozMatchesSelector || HTMLElement.prototype.msMatchesSelector
- }),
- function(e) {
- function t() {
- window.HTMLImports.importer.bootDocument(o)
- }
- var n = e.initializeModules;
- e.isIE;
- if (!e.useNative) {
- n();
- var o = e.rootDocument;
- "complete" === document.readyState || "interactive" === document.readyState && !window.attachEvent ? t() : document.addEventListener("DOMContentLoaded", t)
- }
- }(window.HTMLImports), window.CustomElements = window.CustomElements || {
- flags: {}
- },
- function(e) {
- var t = e.flags,
- n = [],
- o = function(e) {
- n.push(e)
- },
- r = function() {
- n.forEach(function(t) {
- t(e)
- })
- };
- e.addModule = o, e.initializeModules = r, e.hasNative = Boolean(document.registerElement), e.isIE = /Trident/.test(navigator.userAgent), e.useNative = !t.register && e.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative)
- }(window.CustomElements), window.CustomElements.addModule(function(e) {
- function t(e, t) {
- n(e, function(e) {
- return !!t(e) || void o(e, t)
- }), o(e, t)
- }
-
- function n(e, t, o) {
- var r = e.firstElementChild;
- if (!r)
- for (r = e.firstChild; r && r.nodeType !== Node.ELEMENT_NODE;) r = r.nextSibling;
- for (; r;) t(r, o) !== !0 && n(r, t, o), r = r.nextElementSibling;
- return null
- }
-
- function o(e, n) {
- for (var o = e.shadowRoot; o;) t(o, n), o = o.olderShadowRoot
- }
-
- function r(e, t) {
- i(e, t, [])
- }
-
- function i(e, t, n) {
- if (e = window.wrap(e), !(n.indexOf(e) >= 0)) {
- n.push(e);
- for (var o, r = e.querySelectorAll("link[rel=" + a + "]"), s = 0, c = r.length; s < c && (o = r[s]); s++) o["import"] && i(o["import"], t, n);
- t(e)
- }
- }
- var a = window.HTMLImports ? window.HTMLImports.IMPORT_LINK_TYPE : "none";
- e.forDocumentTree = r, e.forSubtree = t
- }), window.CustomElements.addModule(function(e) {
- function t(e, t) {
- return n(e, t) || o(e, t)
- }
-
- function n(t, n) {
- return !!e.upgrade(t, n) || void(n && a(t))
- }
-
- function o(e, t) {
- g(e, function(e) {
- if (n(e, t)) return !0
- })
- }
-
- function r(e) {
- L.push(e), E || (E = !0, setTimeout(i))
- }
-
- function i() {
- E = !1;
- for (var e, t = L, n = 0, o = t.length; n < o && (e = t[n]); n++) e();
- L = []
- }
-
- function a(e) {
- y ? r(function() {
- s(e);
- }) : s(e)
- }
-
- function s(e) {
- e.__upgraded__ && !e.__attached && (e.__attached = !0, e.attachedCallback && e.attachedCallback())
- }
-
- function c(e) {
- d(e), g(e, function(e) {
- d(e)
- })
- }
-
- function d(e) {
- y ? r(function() {
- l(e)
- }) : l(e)
- }
-
- function l(e) {
- e.__upgraded__ && e.__attached && (e.__attached = !1, e.detachedCallback && e.detachedCallback())
- }
-
- function u(e) {
- for (var t = e, n = window.wrap(document); t;) {
- if (t == n) return !0;
- t = t.parentNode || t.nodeType === Node.DOCUMENT_FRAGMENT_NODE && t.host
- }
- }
-
- function h(e) {
- if (e.shadowRoot && !e.shadowRoot.__watched) {
- _.dom && console.log("watching shadow-root for: ", e.localName);
- for (var t = e.shadowRoot; t;) m(t), t = t.olderShadowRoot
- }
- }
-
- function f(e, n) {
- if (_.dom) {
- var o = n[0];
- if (o && "childList" === o.type && o.addedNodes && o.addedNodes) {
- for (var r = o.addedNodes[0]; r && r !== document && !r.host;) r = r.parentNode;
- var i = r && (r.URL || r._URL || r.host && r.host.localName) || "";
- i = i.split("/?").shift().split("/").pop()
- }
- console.group("mutations (%d) [%s]", n.length, i || "")
- }
- var a = u(e);
- n.forEach(function(e) {
- "childList" === e.type && (N(e.addedNodes, function(e) {
- e.localName && t(e, a)
- }), N(e.removedNodes, function(e) {
- e.localName && c(e)
- }))
- }), _.dom && console.groupEnd()
- }
-
- function p(e) {
- for (e = window.wrap(e), e || (e = window.wrap(document)); e.parentNode;) e = e.parentNode;
- var t = e.__observer;
- t && (f(e, t.takeRecords()), i())
- }
-
- function m(e) {
- if (!e.__observer) {
- var t = new MutationObserver(f.bind(this, e));
- t.observe(e, {
- childList: !0,
- subtree: !0
- }), e.__observer = t
- }
- }
-
- function v(e) {
- e = window.wrap(e), _.dom && console.group("upgradeDocument: ", e.baseURI.split("/").pop());
- var n = e === window.wrap(document);
- t(e, n), m(e), _.dom && console.groupEnd()
- }
-
- function w(e) {
- b(e, v)
- }
- var _ = e.flags,
- g = e.forSubtree,
- b = e.forDocumentTree,
- y = window.MutationObserver._isPolyfilled && _["throttle-attached"];
- e.hasPolyfillMutations = y, e.hasThrottledAttached = y;
- var E = !1,
- L = [],
- N = Array.prototype.forEach.call.bind(Array.prototype.forEach),
- M = Element.prototype.createShadowRoot;
- M && (Element.prototype.createShadowRoot = function() {
- var e = M.call(this);
- return window.CustomElements.watchShadow(this), e
- }), e.watchShadow = h, e.upgradeDocumentTree = w, e.upgradeDocument = v, e.upgradeSubtree = o, e.upgradeAll = t, e.attached = a, e.takeRecords = p
- }), window.CustomElements.addModule(function(e) {
- function t(t, o) {
- if ("template" === t.localName && window.HTMLTemplateElement && HTMLTemplateElement.decorate && HTMLTemplateElement.decorate(t), !t.__upgraded__ && t.nodeType === Node.ELEMENT_NODE) {
- var r = t.getAttribute("is"),
- i = e.getRegisteredDefinition(t.localName) || e.getRegisteredDefinition(r);
- if (i && (r && i.tag == t.localName || !r && !i["extends"])) return n(t, i, o)
- }
- }
-
- function n(t, n, r) {
- return a.upgrade && console.group("upgrade:", t.localName), n.is && t.setAttribute("is", n.is), o(t, n), t.__upgraded__ = !0, i(t), r && e.attached(t), e.upgradeSubtree(t, r), a.upgrade && console.groupEnd(), t
- }
-
- function o(e, t) {
- Object.__proto__ ? e.__proto__ = t.prototype : (r(e, t.prototype, t["native"]), e.__proto__ = t.prototype)
- }
-
- function r(e, t, n) {
- for (var o = {}, r = t; r !== n && r !== HTMLElement.prototype;) {
- for (var i, a = Object.getOwnPropertyNames(r), s = 0; i = a[s]; s++) o[i] || (Object.defineProperty(e, i, Object.getOwnPropertyDescriptor(r, i)), o[i] = 1);
- r = Object.getPrototypeOf(r)
- }
- }
-
- function i(e) {
- e.createdCallback && e.createdCallback()
- }
- var a = e.flags;
- e.upgrade = t, e.upgradeWithDefinition = n, e.implementPrototype = o
- }), window.CustomElements.addModule(function(e) {
- function t(t, o) {
- var c = o || {};
- if (!t) throw new Error("document.registerElement: first argument `name` must not be empty");
- if (t.indexOf("-") < 0) throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '" + String(t) + "'.");
- if (r(t)) throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '" + String(t) + "'. The type name is invalid.");
- if (d(t)) throw new Error("DuplicateDefinitionError: a type with name '" + String(t) + "' is already registered");
- return c.prototype || (c.prototype = Object.create(HTMLElement.prototype)), c.__name = t.toLowerCase(), c["extends"] && (c["extends"] = c["extends"].toLowerCase()), c.lifecycle = c.lifecycle || {}, c.ancestry = i(c["extends"]), a(c), s(c), n(c.prototype), l(c.__name, c), c.ctor = u(c), c.ctor.prototype = c.prototype, c.prototype.constructor = c.ctor, e.ready && v(document), c.ctor
- }
-
- function n(e) {
- if (!e.setAttribute._polyfilled) {
- var t = e.setAttribute;
- e.setAttribute = function(e, n) {
- o.call(this, e, n, t)
- };
- var n = e.removeAttribute;
- e.removeAttribute = function(e) {
- o.call(this, e, null, n)
- }, e.setAttribute._polyfilled = !0
- }
- }
-
- function o(e, t, n) {
- e = e.toLowerCase();
- var o = this.getAttribute(e);
- n.apply(this, arguments);
- var r = this.getAttribute(e);
- this.attributeChangedCallback && r !== o && this.attributeChangedCallback(e, o, r)
- }
-
- function r(e) {
- for (var t = 0; t < y.length; t++)
- if (e === y[t]) return !0
- }
-
- function i(e) {
- var t = d(e);
- return t ? i(t["extends"]).concat([t]) : []
- }
-
- function a(e) {
- for (var t, n = e["extends"], o = 0; t = e.ancestry[o]; o++) n = t.is && t.tag;
- e.tag = n || e.__name, n && (e.is = e.__name)
- }
-
- function s(e) {
- if (!Object.__proto__) {
- var t = HTMLElement.prototype;
- if (e.is) {
- var n = document.createElement(e.tag);
- t = Object.getPrototypeOf(n)
- }
- for (var o, r = e.prototype, i = !1; r;) r == t && (i = !0), o = Object.getPrototypeOf(r), o && (r.__proto__ = o), r = o;
- i || console.warn(e.tag + " prototype not found in prototype chain for " + e.is), e["native"] = t
- }
- }
-
- function c(e) {
- return _(N(e.tag), e)
- }
-
- function d(e) {
- if (e) return E[e.toLowerCase()]
- }
-
- function l(e, t) {
- E[e] = t
- }
-
- function u(e) {
- return function() {
- return c(e)
- }
- }
-
- function h(e, t, n) {
- return e === L ? f(t, n) : M(e, t)
- }
-
- function f(e, t) {
- e && (e = e.toLowerCase()), t && (t = t.toLowerCase());
- var n = d(t || e);
- if (n) {
- if (e == n.tag && t == n.is) return new n.ctor;
- if (!t && !n.is) return new n.ctor
- }
- var o;
- return t ? (o = f(e), o.setAttribute("is", t), o) : (o = N(e), e.indexOf("-") >= 0 && g(o, HTMLElement), o)
- }
-
- function p(e, t) {
- var n = e[t];
- e[t] = function() {
- var e = n.apply(this, arguments);
- return w(e), e
- }
- }
- var m, v = (e.isIE, e.upgradeDocumentTree),
- w = e.upgradeAll,
- _ = e.upgradeWithDefinition,
- g = e.implementPrototype,
- b = e.useNative,
- y = ["annotation-xml", "color-profile", "font-face", "font-face-src", "font-face-uri", "font-face-format", "font-face-name", "missing-glyph"],
- E = {},
- L = "http://www.w3.org/1999/xhtml",
- N = document.createElement.bind(document),
- M = document.createElementNS.bind(document);
- m = Object.__proto__ || b ? function(e, t) {
- return e instanceof t
- } : function(e, t) {
- if (e instanceof t) return !0;
- for (var n = e; n;) {
- if (n === t.prototype) return !0;
- n = n.__proto__
- }
- return !1
- }, p(Node.prototype, "cloneNode"), p(document, "importNode"), document.registerElement = t, document.createElement = f, document.createElementNS = h, e.registry = E, e["instanceof"] = m, e.reservedTagList = y, e.getRegisteredDefinition = d, document.register = document.registerElement
- }),
- function(e) {
- function t() {
- i(window.wrap(document)), window.CustomElements.ready = !0;
- var e = window.requestAnimationFrame || function(e) {
- setTimeout(e, 16)
- };
- e(function() {
- setTimeout(function() {
- window.CustomElements.readyTime = Date.now(), window.HTMLImports && (window.CustomElements.elapsed = window.CustomElements.readyTime - window.HTMLImports.readyTime), document.dispatchEvent(new CustomEvent("WebComponentsReady", {
- bubbles: !0
- }))
- })
- })
- }
- var n = e.useNative,
- o = e.initializeModules;
- e.isIE;
- if (n) {
- var r = function() {};
- e.watchShadow = r, e.upgrade = r, e.upgradeAll = r, e.upgradeDocumentTree = r, e.upgradeSubtree = r, e.takeRecords = r, e["instanceof"] = function(e, t) {
- return e instanceof t
- }
- } else o();
- var i = e.upgradeDocumentTree,
- a = e.upgradeDocument;
- if (window.wrap || (window.ShadowDOMPolyfill ? (window.wrap = window.ShadowDOMPolyfill.wrapIfNeeded, window.unwrap = window.ShadowDOMPolyfill.unwrapIfNeeded) : window.wrap = window.unwrap = function(e) {
- return e
- }), window.HTMLImports && (window.HTMLImports.__importsParsingHook = function(e) {
- e["import"] && a(wrap(e["import"]))
- }), "complete" === document.readyState || e.flags.eager) t();
- else if ("interactive" !== document.readyState || window.attachEvent || window.HTMLImports && !window.HTMLImports.ready) {
- var s = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded";
- window.addEventListener(s, t)
- } else t()
- }(window.CustomElements),
- function(e) {
- var t = document.createElement("style");
- t.textContent = "body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n";
- var n = document.querySelector("head");
- n.insertBefore(t, n.firstChild)
- }(window.WebComponents);
\ No newline at end of file
diff --git a/src/bundle.js b/src/bundle.js
index 86e10aab7d..6931b34dd0 100644
--- a/src/bundle.js
+++ b/src/bundle.js
@@ -4,41 +4,89 @@
// Use define from require.js not webpack's define
var _define = window.define;
+// document-register-element
+var docRegister = require("document-register-element");
+_define("document-register-element", function() {
+ return docRegister;
+});
+
+// fetch
+var fetch = require("whatwg-fetch");
+_define("fetch", function() {
+ return fetch
+});
+
// flvjs
var flvjs = require("flv.js");
-_define("flvjs", function() { return flvjs; });
+_define("flvjs", function() {
+ return flvjs;
+});
// jstree
var jstree = require("jstree");
require("jstree/dist/themes/default/style.css");
-_define("jstree", function() { return jstree; });
+_define("jstree", function() {
+ return jstree;
+});
// jquery
var jquery = require("jquery");
-_define("jQuery", function() { return jquery; });
+_define("jQuery", function() {
+ return jquery;
+});
// hlsjs
var hlsjs = require("hls.js");
-_define("hlsjs", function() { return hlsjs; });
+_define("hlsjs", function() {
+ return hlsjs;
+});
// howler
var howler = require("howler");
-_define("howler", function() { return howler; });
+_define("howler", function() {
+ return howler;
+});
+
+// native-promise-only
+var nativePromise = require("native-promise-only");
+_define("native-promise-only", function() {
+ return nativePromise;
+});
+
+// resize-observer-polyfill
+var resize = require("resize-observer-polyfill");
+_define("resize-observer-polyfill", function() {
+ return resize;
+});
// shaka
var shaka = require("shaka-player");
-_define("shaka", function() { return shaka; });
+_define("shaka", function() {
+ return shaka;
+});
// swiper
var swiper = require("swiper");
require("swiper/dist/css/swiper.min.css");
-_define("swiper", function() { return swiper; });
+_define("swiper", function() {
+ return swiper;
+});
// sortable
var sortable = require("sortablejs");
-_define("sortable", function() { return sortable; });
+_define("sortable", function() {
+ return sortable;
+});
+
+// webcomponents
+var webcomponents = require("webcomponents.js-2");
+_define("webcomponents", function() {
+ return webcomponents
+});
// libjass
var libjass = require("libjass");
require("libjass/libjass.css");
-_define("libjass", function() { return libjass; });
+_define("libjass", function() {
+ return libjass;
+});
diff --git a/src/components/actionsheet/actionsheet.js b/src/components/actionsheet/actionsheet.js
index 7b179393b2..d4e6b61c8a 100644
--- a/src/components/actionsheet/actionsheet.js
+++ b/src/components/actionsheet/actionsheet.js
@@ -139,7 +139,9 @@ define(['dialogHelper', 'layoutManager', 'globalize', 'browser', 'dom', 'emby-bu
style += "min-width:" + minWidth + "px;";
}
- var i, length, option;
+ var i;
+ var length;
+ var option;
var renderIcon = false;
var icons = [];
var itemIcon;
@@ -225,8 +227,7 @@ define(['dialogHelper', 'layoutManager', 'globalize', 'browser', 'dom', 'emby-bu
if (itemIcon) {
html += '';
- }
- else if (renderIcon && !center) {
+ } else if (renderIcon && !center) {
html += '';
}
diff --git a/src/components/alert.js b/src/components/alert.js
index 6cf7fea75d..8a4dc11c20 100644
--- a/src/components/alert.js
+++ b/src/components/alert.js
@@ -35,7 +35,7 @@ define(['browser', 'dialog', 'globalize'], function (browser, dialog, globalize)
if (result === 'ok') {
return Promise.resolve();
}
-
+
return Promise.reject();
});
}
diff --git a/src/components/alphapicker/alphapicker.js b/src/components/alphapicker/alphapicker.js
index e06bdbd1a1..b9d31be5dd 100644
--- a/src/components/alphapicker/alphapicker.js
+++ b/src/components/alphapicker/alphapicker.js
@@ -50,9 +50,7 @@ define(['focusManager', 'layoutManager', 'dom', 'css!./style.css', 'paper-icon-b
var vertical = element.classList.contains('alphaPicker-vertical');
- if (vertical) {
-
- } else {
+ if (!vertical) {
element.classList.add('focuscontainer-x');
}
@@ -228,7 +226,8 @@ define(['focusManager', 'layoutManager', 'dom', 'css!./style.css', 'paper-icon-b
AlphaPicker.prototype.value = function (value, applyValue) {
var element = this.options.element;
- var btn, selected;
+ var btn;
+ var selected;
if (value !== undefined) {
if (value != null) {
diff --git a/src/components/apphost.js b/src/components/apphost.js
index e67d795227..ad3540e210 100644
--- a/src/components/apphost.js
+++ b/src/components/apphost.js
@@ -313,7 +313,7 @@ define(["appSettings", "browser", "events", "htmlMediaHelper"], function (appSet
var deviceId;
var deviceName;
var appName = "Jellyfin Web";
- var appVersion = "10.4.0";
+ var appVersion = "10.5.0";
var visibilityChange;
var visibilityState;
diff --git a/src/components/cardbuilder/card.css b/src/components/cardbuilder/card.css
index 874b6d0416..ec19c83f00 100644
--- a/src/components/cardbuilder/card.css
+++ b/src/components/cardbuilder/card.css
@@ -32,18 +32,6 @@ button {
.itemsContainer {
display: flex;
- margin-left: -0.6em;
- margin-right: -0.6em;
-}
-
-/* TODO replace this with a proper fix */
-/* doesnt work on mobile devices */
-/* negative margin fixes annoying misalignment with cards and title */
-@media all and (max-width:50em) {
- .itemsContainer {
- margin-left: 0;
- margin-right: 0;
- }
}
.vertical-list {
@@ -157,7 +145,7 @@ button {
}
.cardImageContainer {
- background-size: contain;
+ background-size: cover;
background-repeat: no-repeat;
background-position: center center;
display: -webkit-flex;
@@ -364,9 +352,6 @@ button {
vertical-align: middle;
font-family: inherit;
font-size: inherit;
- /*display: flex;
- align-items: center;
- justify-content: center;*/
}
.textActionButton:hover {
diff --git a/src/components/cardbuilder/cardBuilder.js b/src/components/cardbuilder/cardBuilder.js
index 4c80f32f24..3b7516309c 100644
--- a/src/components/cardbuilder/cardBuilder.js
+++ b/src/components/cardbuilder/cardBuilder.js
@@ -321,7 +321,8 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
var apiClient;
var lastServerId;
- var i, length;
+ var i;
+ var length;
for (i = 0, length = items.length; i < length; i++) {
@@ -339,19 +340,14 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
if (options.indexBy === 'PremiereDate') {
if (item.PremiereDate) {
try {
-
newIndexValue = datetime.toLocaleDateString(datetime.parseISO8601Date(item.PremiereDate), { weekday: 'long', month: 'long', day: 'numeric' });
-
} catch (err) {
+ console.log('error parsing timestamp for premiere date');
}
}
- }
-
- else if (options.indexBy === 'ProductionYear') {
+ } else if (options.indexBy === 'ProductionYear') {
newIndexValue = item.ProductionYear;
- }
-
- else if (options.indexBy === 'CommunityRating') {
+ } else if (options.indexBy === 'CommunityRating') {
newIndexValue = item.CommunityRating ? (Math.floor(item.CommunityRating) + (item.CommunityRating % 1 >= 0.5 ? 0.5 : 0)) + '+' : null;
}
@@ -571,22 +567,19 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
coverImage = (Math.abs(primaryImageAspectRatio - uiAspect) / uiAspect) <= 0.2;
}
}
- }
- else if (item.ParentPrimaryImageTag) {
+ } else if (item.ParentPrimaryImageTag) {
imgUrl = apiClient.getScaledImageUrl(item.ParentPrimaryImageItemId, {
type: "Primary",
tag: item.ParentPrimaryImageTag
});
- }
- else if (item.SeriesPrimaryImageTag) {
+ } else if (item.SeriesPrimaryImageTag) {
imgUrl = apiClient.getScaledImageUrl(item.SeriesId, {
type: "Primary",
tag: item.SeriesPrimaryImageTag
});
- }
- else if (item.AlbumId && item.AlbumPrimaryImageTag) {
+ } else if (item.AlbumId && item.AlbumPrimaryImageTag) {
width = primaryImageAspectRatio ? Math.round(height * primaryImageAspectRatio) : null;
@@ -601,16 +594,14 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
coverImage = (Math.abs(primaryImageAspectRatio - uiAspect) / uiAspect) <= 0.2;
}
}
- }
- else if (item.Type === 'Season' && item.ImageTags && item.ImageTags.Thumb) {
+ } else if (item.Type === 'Season' && item.ImageTags && item.ImageTags.Thumb) {
imgUrl = apiClient.getScaledImageUrl(item.Id, {
type: "Thumb",
tag: item.ImageTags.Thumb
});
- }
- else if (item.BackdropImageTags && item.BackdropImageTags.length) {
+ } else if (item.BackdropImageTags && item.BackdropImageTags.length) {
imgUrl = apiClient.getScaledImageUrl(item.Id, {
type: "Backdrop",
@@ -681,7 +672,8 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
var html = '';
var valid = 0;
- var i, length;
+ var i;
+ var length;
for (i = 0, length = lines.length; i < length; i++) {
@@ -745,8 +737,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
date = datetime.parseISO8601Date(item.EndDate);
airTimeText += ' - ' + datetime.getDisplayTime(date);
}
- }
- catch (e) {
+ } catch (e) {
console.log("Error parsing date: " + item.StartDate);
}
}
@@ -794,8 +785,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
} else {
lines.push(item.SeriesName);
}
- }
- else {
+ } else {
if (isUsingLiveTvNaming(item)) {
@@ -976,8 +966,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
if (options.showSeriesTimerChannel) {
if (item.RecordAnyChannel) {
lines.push(globalize.translate('AllChannels'));
- }
- else {
+ } else {
lines.push(item.ChannelName || globalize.translate('OneChannel'));
}
}
@@ -985,8 +974,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
if (options.showPersonRoleOrType) {
if (item.Role) {
lines.push('as ' + item.Role);
- }
- else if (item.Type) {
+ } else if (item.Type) {
lines.push(globalize.translate('' + item.Type));
} else {
lines.push('');
@@ -1060,8 +1048,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
counts.push(childText);
- }
- else if (item.Type === 'Genre' || item.Type === 'Studio') {
+ } else if (item.Type === 'Genre' || item.Type === 'Studio') {
if (item.MovieCount) {
@@ -1140,8 +1127,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
if (item.IsPremiere) {
html += '' + globalize.translate('Premiere') + '
';
- }
- else if (item.IsSeries && !item.IsRepeat) {
+ } else if (item.IsSeries && !item.IsRepeat) {
html += '' + globalize.translate('AttributeNew') + '
';
}
//else if (item.IsRepeat) {
@@ -1176,8 +1162,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
if (action === 'play' && item.IsFolder) {
// If this hard-coding is ever removed make sure to test nested photo albums
action = 'link';
- }
- else if (item.MediaType === 'Photo') {
+ } else if (item.MediaType === 'Photo') {
action = 'play';
}
@@ -1272,8 +1257,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
height: logoHeight,
tag: item.ChannelPrimaryImageTag
});
- }
- else if (options.showLogo && item.ParentLogoImageTag) {
+ } else if (options.showLogo && item.ParentLogoImageTag) {
logoUrl = apiClient.getScaledImageUrl(item.ParentLogoItemId, {
type: "Logo",
height: logoHeight,
@@ -1288,8 +1272,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
footerCssClass = progressHtml ? 'innerCardFooter fullInnerCardFooter' : 'innerCardFooter';
innerCardFooter += getCardFooterText(item, apiClient, options, showTitle, forceName, overlayText, imgUrl, footerCssClass, progressHtml, logoUrl, false);
footerOverlayed = true;
- }
- else if (progressHtml) {
+ } else if (progressHtml) {
innerCardFooter += '';
@@ -1394,8 +1377,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
indicatorsHtml += indicators.getChildCountIndicatorHtml(item, {
minCount: 1
});
- }
- else {
+ } else {
indicatorsHtml += indicators.getPlayedIndicatorHtml(item);
}
@@ -1656,8 +1638,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
}
itemProgressBar.innerHTML = progressHtml;
- }
- else {
+ } else {
itemProgressBar = card.querySelector('.itemProgressBar');
if (itemProgressBar) {
diff --git a/src/components/chromecast/chromecasthelpers.js b/src/components/chromecast/chromecasthelpers.js
index 0beba824c0..9d6f811cb1 100644
--- a/src/components/chromecast/chromecasthelpers.js
+++ b/src/components/chromecast/chromecasthelpers.js
@@ -5,7 +5,7 @@ define(['events'], function (events) {
//
// https://github.com/ravisorg/LinkParser
//
- // Locate and extract almost any URL within a string. Handles protocol-less domains, IPv4 and
+ // Locate and extract almost any URL within a string. Handles protocol-less domains, IPv4 and
// IPv6, unrecognised TLDs, and more.
//
// This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
@@ -14,26 +14,26 @@ define(['events'], function (events) {
// Original URL regex from the Android android.text.util.Linkify function, found here:
// http://stackoverflow.com/a/19696443
- //
- // However there were problems with it, most probably related to the fact it was
+ //
+ // However there were problems with it, most probably related to the fact it was
// written in 2007, and it's been highly modified.
- //
- // 1) I didn't like the fact that it was tied to specific TLDs, since new ones
+ //
+ // 1) I didn't like the fact that it was tied to specific TLDs, since new ones
// are being added all the time it wouldn't be reasonable to expect developer to
// be continually updating their regular expressions.
- //
- // 2) It didn't allow unicode characters in the domains which are now allowed in
+ //
+ // 2) It didn't allow unicode characters in the domains which are now allowed in
// many languages, (including some IDN TLDs). Again these are constantly being
// added to and it doesn't seem reasonable to hard-code them. Note this ended up
// not being possible in standard JS due to the way it handles multibyte strings.
// It is possible using XRegExp, however a big performance hit results. Disabled
// for now.
- //
+ //
// 3) It didn't allow for IPv6 hostnames
// IPv6 regex from http://stackoverflow.com/a/17871737
//
// 4) It was very poorly commented
- //
+ //
// 5) It wasn't as smart as it could have been about what should be part of a
// URL and what should be part of human language.
@@ -102,8 +102,8 @@ define(['events'], function (events) {
+ "|(?:\\%[a-f0-9]{2})"
// some characters are much more likely to be used AFTER a url and
// were not intended to be included in the url itself. Mostly end
- // of sentence type things. It's also likely that the URL would
- // still work if any of these characters were missing from the end
+ // of sentence type things. It's also likely that the URL would
+ // still work if any of these characters were missing from the end
// because we parsed it incorrectly. For these characters to be accepted
// they must be followed by another character that we're reasonably
// sure is part of the url
diff --git a/src/components/chromecast/chromecastplayer.js b/src/components/chromecast/chromecastplayer.js
index f3f7e6b865..7302b74124 100644
--- a/src/components/chromecast/chromecastplayer.js
+++ b/src/components/chromecast/chromecastplayer.js
@@ -479,8 +479,7 @@ define(['appSettings', 'userSettings', 'playbackManager', 'connectionManager', '
TotalRecordCount: 1
};
});
- }
- else {
+ } else {
query.Limit = query.Limit || 100;
query.ExcludeLocationTypes = "Virtual";
@@ -752,8 +751,7 @@ define(['appSettings', 'userSettings', 'playbackManager', 'connectionManager', '
ChromecastPlayer.prototype.volumeDown = function () {
var vol = this._castPlayer.session.receiver.volume.level;
- if (vol == null)
- {
+ if (vol == null) {
vol = 0.5;
}
vol -= 0.05;
@@ -776,8 +774,7 @@ define(['appSettings', 'userSettings', 'playbackManager', 'connectionManager', '
ChromecastPlayer.prototype.volumeUp = function () {
var vol = this._castPlayer.session.receiver.volume.level;
- if (vol == null)
- {
+ if (vol == null) {
vol = 0.5;
}
vol += 0.05;
diff --git a/src/components/dialog/dialog.js b/src/components/dialog/dialog.js
index 4f13b2d1bb..cfb5821b38 100644
--- a/src/components/dialog/dialog.js
+++ b/src/components/dialog/dialog.js
@@ -51,7 +51,8 @@ define(['dialogHelper', 'dom', 'layoutManager', 'scrollHelper', 'globalize', 're
dlg.querySelector('.dialogContentInner').classList.add('hide');
}
- var i, length;
+ var i;
+ var length;
var html = '';
var hasDescriptions = false;
diff --git a/src/components/dialogHelper/dialogHelper.js b/src/components/dialogHelper/dialogHelper.js
index 36bb23bfd7..bddd839760 100644
--- a/src/components/dialogHelper/dialogHelper.js
+++ b/src/components/dialogHelper/dialogHelper.js
@@ -18,8 +18,7 @@ define(['appRouter', 'focusManager', 'browser', 'layoutManager', 'inputManager',
if (layoutManager.tv) {
if (dlg.classList.contains('scrollX')) {
centerFocus(dlg, true, false);
- }
- else if (dlg.classList.contains('smoothScrollY')) {
+ } else if (dlg.classList.contains('smoothScrollY')) {
centerFocus(dlg, false, false);
}
}
@@ -168,8 +167,8 @@ define(['appRouter', 'focusManager', 'browser', 'layoutManager', 'inputManager',
close(dlg);
}
}, {
- passive: true
- });
+ passive: true
+ });
}
function isHistoryEnabled(dlg) {
@@ -433,8 +432,7 @@ define(['appRouter', 'focusManager', 'browser', 'layoutManager', 'inputManager',
if (layoutManager.tv) {
centerFocus(dlg, true, true);
}
- }
- else if (options.scrollY !== false) {
+ } else if (options.scrollY !== false) {
dlg.classList.add('smoothScrollY');
if (layoutManager.tv) {
diff --git a/src/components/directorybrowser/directorybrowser.js b/src/components/directorybrowser/directorybrowser.js
index 15787c3dc2..ef51ce45b5 100644
--- a/src/components/directorybrowser/directorybrowser.js
+++ b/src/components/directorybrowser/directorybrowser.js
@@ -115,7 +115,7 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'paper-
var readOnlyAttribute = options.pathReadOnly ? " readonly" : "";
html += '';
html += "";
- if (!readOnlyAttribute) {
+ if (!readOnlyAttribute) {
html += '';
}
html += "";
@@ -188,9 +188,9 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'paper-
var path = lnkPath.getAttribute("data-path");
if (lnkPath.classList.contains("lnkFile")) {
content.querySelector("#txtDirectoryPickerPath").value = path;
- } else {
+ } else {
refreshDirectoryBrowser(content, path, fileOptions, true)
- };
+ }
}
});
@@ -254,10 +254,10 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'paper-
var systemInfo = responses[0];
var initialPath = responses[1];
var dlg = dialogHelper.createDialog({
- size: "medium-tall",
- removeOnClose: true,
- scrollY: false
- });
+ size: "medium-tall",
+ removeOnClose: true,
+ scrollY: false
+ });
dlg.classList.add("ui-body-a");
dlg.classList.add("background-theme-a");
dlg.classList.add("directoryPicker");
diff --git a/src/components/dom.js b/src/components/dom.js
index ea8902b98e..da03b87428 100644
--- a/src/components/dom.js
+++ b/src/components/dom.js
@@ -68,7 +68,9 @@ define([], function () {
}
});
window.addEventListener("test", null, opts);
- } catch (e) { }
+ } catch (e) {
+ console.log('error checking capture support');
+ }
function addEventListenerWithOptions(target, type, handler, options) {
var optionsOrCapture = options;
@@ -116,8 +118,8 @@ define([], function () {
return _animationEvent;
}
- var t,
- el = document.createElement("div");
+ var t;
+ var el = document.createElement("div");
var animations = {
"animation": "animationend",
"OAnimation": "oAnimationEnd",
@@ -146,8 +148,8 @@ define([], function () {
return _transitionEvent;
}
- var t,
- el = document.createElement("div");
+ var t;
+ var el = document.createElement("div");
var transitions = {
"transition": "transitionend",
"OTransition": "oTransitionEnd",
diff --git a/src/components/emby-input/emby-input.js b/src/components/emby-input/emby-input.js
index acc9154318..7d2ea63a0d 100644
--- a/src/components/emby-input/emby-input.js
+++ b/src/components/emby-input/emby-input.js
@@ -28,11 +28,12 @@ define(['layoutManager', 'browser', 'dom', 'css!./emby-input', 'registerElement'
}
EmbyInputPrototype.createdCallback = function () {
-
if (!this.id) {
this.id = 'embyinput' + inputId;
inputId++;
- } if (this.classList.contains('emby-input')) {
+ }
+
+ if (this.classList.contains('emby-input')) {
return;
}
diff --git a/src/components/emby-progressring/emby-progressring.js b/src/components/emby-progressring/emby-progressring.js
index 7148079a19..80c5458528 100644
--- a/src/components/emby-progressring/emby-progressring.js
+++ b/src/components/emby-progressring/emby-progressring.js
@@ -47,8 +47,7 @@ define(['require', 'css!./emby-progressring', 'registerElement'], function (requ
this.querySelector('.animate-25-50-b').style.transform = 'rotate(-90deg)';
this.querySelector('.animate-50-75-b').style.transform = 'rotate(-90deg)';
this.querySelector('.animate-75-100-b').style.transform = 'rotate(-90deg)';
- }
- else if (progress >= 25 && progress < 50) {
+ } else if (progress >= 25 && progress < 50) {
angle = -90 + ((progress - 25) / 100) * 360;
@@ -57,8 +56,7 @@ define(['require', 'css!./emby-progressring', 'registerElement'], function (requ
this.querySelector('.animate-50-75-b').style.transform = 'rotate(-90deg)';
this.querySelector('.animate-75-100-b').style.transform = 'rotate(-90deg)';
- }
- else if (progress >= 50 && progress < 75) {
+ } else if (progress >= 50 && progress < 75) {
angle = -90 + ((progress - 50) / 100) * 360;
this.querySelector('.animate-0-25-b').style.transform = 'none';
@@ -66,8 +64,7 @@ define(['require', 'css!./emby-progressring', 'registerElement'], function (requ
this.querySelector('.animate-50-75-b').style.transform = 'rotate(' + angle + 'deg)';
this.querySelector('.animate-75-100-b').style.transform = 'rotate(-90deg)';
- }
- else if (progress >= 75 && progress <= 100) {
+ } else if (progress >= 75 && progress <= 100) {
angle = -90 + ((progress - 75) / 100) * 360;
this.querySelector('.animate-0-25-b').style.transform = 'none';
@@ -85,7 +82,6 @@ define(['require', 'css!./emby-progressring', 'registerElement'], function (requ
EmbyProgressRing.detachedCallback = function () {
-
var observer = this.observer;
if (observer) {
diff --git a/src/components/emby-scroller/emby-scroller.css b/src/components/emby-scroller/emby-scroller.css
index f060882f7b..1e0b05b83c 100644
--- a/src/components/emby-scroller/emby-scroller.css
+++ b/src/components/emby-scroller/emby-scroller.css
@@ -7,6 +7,17 @@
margin-right: 3.3%;
}
+/* align first card in scroller to heading */
+.emby-scroller .card:first-of-type > .cardBox {
+ margin-left: 0;
+}
+
+/* align heading for normal item containers */
+/* still not ideal solution but better than the last method */
+.verticalSection > .itemsContainer .cardBox {
+ margin-left: 0;
+}
+
@media all and (max-width:50em) {
.emby-scroller {
padding-left: 3.3%;
diff --git a/src/components/emby-tabs/emby-tabs.js b/src/components/emby-tabs/emby-tabs.js
index 4a0060cf88..9fedf0bfe9 100644
--- a/src/components/emby-tabs/emby-tabs.js
+++ b/src/components/emby-tabs/emby-tabs.js
@@ -142,7 +142,7 @@ define(['dom', 'scroller', 'browser', 'layoutManager', 'focusManager', 'register
tabs.classList.add('scrollX');
tabs.classList.add('hiddenScrollX');
tabs.classList.add('smoothScrollX');
- }
+ }
}
EmbyTabs.createdCallback = function () {
diff --git a/src/components/emby-textarea/emby-textarea.js b/src/components/emby-textarea/emby-textarea.js
index 7dec1f0955..c500db6e1f 100644
--- a/src/components/emby-textarea/emby-textarea.js
+++ b/src/components/emby-textarea/emby-textarea.js
@@ -14,9 +14,9 @@ define(['layoutManager', 'browser', 'css!./emby-textarea', 'registerElement', 'e
* @returns {number}
*/
self.getOffset = function (textarea) {
- var style = window.getComputedStyle(textarea, null),
- props = ['paddingTop', 'paddingBottom'],
- offset = 0;
+ var style = window.getComputedStyle(textarea, null);
+ var props = ['paddingTop', 'paddingBottom'];
+ var offset = 0;
for (var i = 0; i < props.length; i++) {
offset += parseInt(style[props[i]]);
@@ -43,13 +43,13 @@ define(['layoutManager', 'browser', 'css!./emby-textarea', 'registerElement', 'e
textarea.rows = 3;
return;
}
- var newHeight = 0, hasGrown = false;
+ var newHeight = 0;
+ var hasGrown = false;
if ((textarea.scrollHeight - offset) > self.maxAllowedHeight) {
textarea.style.overflowY = 'scroll';
newHeight = self.maxAllowedHeight;
- }
- else {
+ } else {
textarea.style.overflowY = 'hidden';
textarea.style.height = 'auto';
newHeight = textarea.scrollHeight/* - offset*/;
diff --git a/src/components/filtermenu/filtermenu.js b/src/components/filtermenu/filtermenu.js
index 0d15b492da..f2196bf632 100644
--- a/src/components/filtermenu/filtermenu.js
+++ b/src/components/filtermenu/filtermenu.js
@@ -94,7 +94,8 @@ define(['require', 'dom', 'focusManager', 'dialogHelper', 'loading', 'apphost',
context.querySelector('form').addEventListener('submit', onSubmit);
var elems = context.querySelectorAll('.simpleFilter');
- var i, length;
+ var i;
+ var length;
for (i = 0, length = elems.length; i < length; i++) {
@@ -137,7 +138,8 @@ define(['require', 'dom', 'focusManager', 'dialogHelper', 'loading', 'apphost',
function saveValues(context, settings, settingsKey) {
var elems = context.querySelectorAll('.simpleFilter');
- var i, length;
+ var i;
+ var length;
for (i = 0, length = elems.length; i < length; i++) {
if (elems[i].tagName === 'INPUT') {
diff --git a/src/components/focusManager.js b/src/components/focusManager.js
index 8c2f0ad442..ec23a151c2 100644
--- a/src/components/focusManager.js
+++ b/src/components/focusManager.js
@@ -99,7 +99,7 @@ define(['dom'], function (dom) {
return normalizeFocusable(elem, originalElement);
}
- // Determines if a focusable element can be focused at a given point in time
+ // Determines if a focusable element can be focused at a given point in time
function isCurrentlyFocusableInternal(elem) {
// http://stackoverflow.com/questions/19669786/check-if-element-is-visible-in-dom
@@ -110,7 +110,7 @@ define(['dom'], function (dom) {
return true;
}
- // Determines if a focusable element can be focused at a given point in time
+ // Determines if a focusable element can be focused at a given point in time
function isCurrentlyFocusable(elem) {
if (elem.disabled) {
@@ -181,21 +181,18 @@ define(['dom'], function (dom) {
if (classList.contains('focuscontainer-left')) {
return true;
}
- }
- else if (direction === 1) {
+ } else if (direction === 1) {
if (classList.contains('focuscontainer-x')) {
return true;
}
if (classList.contains('focuscontainer-right')) {
return true;
}
- }
- else if (direction === 2) {
+ } else if (direction === 2) {
if (classList.contains('focuscontainer-y')) {
return true;
}
- }
- else if (direction === 3) {
+ } else if (direction === 3) {
if (classList.contains('focuscontainer-y')) {
return true;
}
@@ -275,14 +272,14 @@ define(['dom'], function (dom) {
var rect = getOffset(activeElement);
// Get elements and work out x/y points
- var cache = [],
- point1x = parseFloat(rect.left) || 0,
- point1y = parseFloat(rect.top) || 0,
- point2x = parseFloat(point1x + rect.width - 1) || point1x,
- point2y = parseFloat(point1y + rect.height - 1) || point1y,
- // Shortcuts to help with compression
- min = Math.min,
- max = Math.max;
+ var cache = [];
+ var point1x = parseFloat(rect.left) || 0;
+ var point1y = parseFloat(rect.top) || 0;
+ var point2x = parseFloat(point1x + rect.width - 1) || point1x;
+ var point2y = parseFloat(point1y + rect.height - 1) || point1y;
+ // Shortcuts to help with compression
+ var min = Math.min;
+ var max = Math.max;
var sourceMidX = rect.left + (rect.width / 2);
var sourceMidY = rect.top + (rect.height / 2);
@@ -357,10 +354,10 @@ define(['dom'], function (dom) {
break;
}
- var x = elementRect.left,
- y = elementRect.top,
- x2 = x + elementRect.width - 1,
- y2 = y + elementRect.height - 1;
+ var x = elementRect.left;
+ var y = elementRect.top;
+ var x2 = x + elementRect.width - 1;
+ var y2 = y + elementRect.height - 1;
var intersectX = intersects(point1x, point2x, x, x2);
var intersectY = intersects(point1y, point2y, y, y2);
@@ -470,7 +467,9 @@ define(['dom'], function (dom) {
var elems = container.querySelectorAll(focusableSelector);
var list = [];
- var i, length, elem;
+ var i;
+ var length;
+ var elem;
for (i = 0, length = elems.length; i < length; i++) {
@@ -513,32 +512,24 @@ define(['dom'], function (dom) {
focusableParent: focusableParent,
getFocusableElements: getFocusableElements,
moveLeft: function (sourceElement, options) {
-
var container = options ? options.container : null;
var focusableElements = options ? options.focusableElements : null;
nav(sourceElement, 0, container, focusableElements);
-
},
moveRight: function (sourceElement, options) {
-
var container = options ? options.container : null;
var focusableElements = options ? options.focusableElements : null;
nav(sourceElement, 1, container, focusableElements);
-
},
moveUp: function (sourceElement, options) {
-
var container = options ? options.container : null;
var focusableElements = options ? options.focusableElements : null;
nav(sourceElement, 2, container, focusableElements);
-
},
moveDown: function (sourceElement, options) {
-
var container = options ? options.container : null;
var focusableElements = options ? options.focusableElements : null;
nav(sourceElement, 3, container, focusableElements);
-
},
sendText: sendText,
isCurrentlyFocusable: isCurrentlyFocusable,
diff --git a/src/components/fullscreenManager.js b/src/components/fullscreenManager.js
index 360986cc54..8ae31073a2 100644
--- a/src/components/fullscreenManager.js
+++ b/src/components/fullscreenManager.js
@@ -55,7 +55,7 @@ define(['events', 'dom', 'apphost', 'browser'], function (events, dom, appHost,
return document.fullscreen ||
document.mozFullScreen ||
document.webkitIsFullScreen ||
- document.msFullscreenElement || /* IE/Edge syntax */
+ document.msFullscreenElement || /* IE/Edge syntax */
document.fullscreenElement || /* Standard syntax */
document.webkitFullscreenElement || /* Chrome, Safari and Opera syntax */
document.mozFullScreenElement; /* Firefox syntax */
diff --git a/src/components/guide/guide-settings.js b/src/components/guide/guide-settings.js
index 47eb026db8..9ee43be9f1 100644
--- a/src/components/guide/guide-settings.js
+++ b/src/components/guide/guide-settings.js
@@ -39,7 +39,8 @@ define(['dialogHelper', 'globalize', 'userSettings', 'layoutManager', 'connectio
function save(context) {
- var i, length;
+ var i;
+ var length;
var chkIndicators = context.querySelectorAll('.chkIndicator');
for (i = 0, length = chkIndicators.length; i < length; i++) {
@@ -62,7 +63,8 @@ define(['dialogHelper', 'globalize', 'userSettings', 'layoutManager', 'connectio
function load(context) {
- var i, length;
+ var i;
+ var length;
var chkIndicators = context.querySelectorAll('.chkIndicator');
for (i = 0, length = chkIndicators.length; i < length; i++) {
diff --git a/src/components/guide/guide.js b/src/components/guide/guide.js
index d3e1d4c38f..c8ed31df0f 100644
--- a/src/components/guide/guide.js
+++ b/src/components/guide/guide.js
@@ -392,27 +392,20 @@ define(['require', 'inputManager', 'browser', 'globalize', 'connectionManager',
}
function parseDates(program) {
-
if (!program.StartDateLocal) {
try {
-
program.StartDateLocal = datetime.parseISO8601Date(program.StartDate, { toLocal: true });
-
} catch (err) {
-
+ console.log('error parsing timestamp for start date');
}
-
}
if (!program.EndDateLocal) {
try {
-
program.EndDateLocal = datetime.parseISO8601Date(program.EndDate, { toLocal: true });
-
} catch (err) {
-
+ console.log('error parsing timestamp for end date');
}
-
}
return null;
@@ -424,16 +417,13 @@ define(['require', 'inputManager', 'browser', 'globalize', 'connectionManager',
if (item.Type === 'SeriesTimer') {
return 'fiber_smart_record';
- }
- else if (item.TimerId || item.SeriesTimerId) {
+ } else if (item.TimerId || item.SeriesTimerId) {
status = item.Status || 'Cancelled';
- }
- else if (item.Type === 'Timer') {
+ } else if (item.Type === 'Timer') {
status = item.Status;
- }
- else {
+ } else {
return '';
}
@@ -529,11 +519,9 @@ define(['require', 'inputManager', 'browser', 'globalize', 'connectionManager',
} else if (program.IsMovie) {
displayInnerContent = displayMovieContent;
accentCssClass = 'movie';
- }
- else if (program.IsSeries) {
+ } else if (program.IsSeries) {
displayInnerContent = displaySeriesContent;
- }
- else {
+ } else {
displayInnerContent = displayMovieContent && displayNewsContent && displaySportsContent && displayKidsContent && displaySeriesContent;
}
@@ -569,14 +557,11 @@ define(['require', 'inputManager', 'browser', 'globalize', 'connectionManager',
var indicatorHtml = null;
if (program.IsLive && options.showLiveIndicator) {
indicatorHtml = '' + globalize.translate('Live') + '';
- }
- else if (program.IsPremiere && options.showPremiereIndicator) {
+ } else if (program.IsPremiere && options.showPremiereIndicator) {
indicatorHtml = '' + globalize.translate('Premiere') + '';
- }
- else if (program.IsSeries && !program.IsRepeat && options.showNewIndicator) {
+ } else if (program.IsSeries && !program.IsRepeat && options.showNewIndicator) {
indicatorHtml = '' + globalize.translate('AttributeNew') + '';
- }
- else if (program.IsSeries && program.IsRepeat && options.showRepeatIndicator) {
+ } else if (program.IsSeries && program.IsRepeat && options.showRepeatIndicator) {
indicatorHtml = '' + globalize.translate('Repeat') + '';
}
html += indicatorHtml || '';
@@ -614,7 +599,6 @@ define(['require', 'inputManager', 'browser', 'globalize', 'connectionManager',
return html;
}
-
function renderChannelHeaders(context, channels, apiClient) {
var html = '';
@@ -1079,17 +1063,13 @@ define(['require', 'inputManager', 'browser', 'globalize', 'connectionManager',
scrollHelper.toStart(programGrid, programCell, true, true);
}
- }
-
- else if (lastFocusDirection === 'right') {
+ } else if (lastFocusDirection === 'right') {
if (programCell) {
scrollHelper.toCenter(programGrid, programCell, true, true);
}
- }
-
- else if (lastFocusDirection === 'up' || lastFocusDirection === 'down') {
+ } else if (lastFocusDirection === 'up' || lastFocusDirection === 'down') {
var verticalScroller = dom.parentWithClass(target, 'guideVerticalScroller');
if (verticalScroller) {
@@ -1195,14 +1175,14 @@ define(['require', 'inputManager', 'browser', 'globalize', 'connectionManager',
dom.addEventListener(programGrid, 'scroll', function (e) {
onProgramGridScroll(context, this, timeslotHeaders);
}, {
- passive: true
- });
+ passive: true
+ });
dom.addEventListener(timeslotHeaders, 'scroll', function () {
onTimeslotHeadersScroll(context, this);
}, {
- passive: true
- });
+ passive: true
+ });
programGrid.addEventListener('click', onProgramGridClick);
diff --git a/src/components/headroom/headroom.js b/src/components/headroom/headroom.js
index a3cc5b0435..9c058a8e82 100644
--- a/src/components/headroom/headroom.js
+++ b/src/components/headroom/headroom.js
@@ -255,8 +255,8 @@ define(['dom', 'layoutManager', 'browser', 'css!./headroom'], function (dom, lay
* @return {bool} true if should unpin, false otherwise
*/
this.shouldUnpin = function (currentScrollY) {
- var scrollingDown = currentScrollY > this.lastKnownScrollY,
- pastOffset = currentScrollY >= this.offset;
+ var scrollingDown = currentScrollY > this.lastKnownScrollY;
+ var pastOffset = currentScrollY >= this.offset;
return scrollingDown && pastOffset;
};
@@ -267,8 +267,8 @@ define(['dom', 'layoutManager', 'browser', 'css!./headroom'], function (dom, lay
* @return {bool} true if should pin, false otherwise
*/
this.shouldPin = function (currentScrollY) {
- var scrollingUp = currentScrollY < this.lastKnownScrollY,
- pastOffset = currentScrollY <= this.offset;
+ var scrollingUp = currentScrollY < this.lastKnownScrollY;
+ var pastOffset = currentScrollY <= this.offset;
return scrollingUp || pastOffset;
};
@@ -290,11 +290,9 @@ define(['dom', 'layoutManager', 'browser', 'css!./headroom'], function (dom, lay
if (currentScrollY <= (isTv ? 120 : 10)) {
this.clear();
- }
- else if (this.shouldUnpin(currentScrollY)) {
+ } else if (this.shouldUnpin(currentScrollY)) {
this.unpin();
- }
- else if (this.shouldPin(currentScrollY)) {
+ } else if (this.shouldPin(currentScrollY)) {
var toleranceExceeded = Math.abs(currentScrollY - lastKnownScrollY) >= 14;
@@ -310,7 +308,6 @@ define(['dom', 'layoutManager', 'browser', 'css!./headroom'], function (dom, lay
this.lastKnownScrollY = currentScrollY;
};
-
if (browser.supportsCssAnimation()) {
for (var i = 0, length = this.elems.length; i < length; i++) {
this.elems[i].classList.add(this.initialClass);
diff --git a/src/components/homescreensettings/homescreensettings.js b/src/components/homescreensettings/homescreensettings.js
index 9aeb1e35c0..5b966327eb 100644
--- a/src/components/homescreensettings/homescreensettings.js
+++ b/src/components/homescreensettings/homescreensettings.js
@@ -57,8 +57,7 @@ define(['require', 'apphost', 'layoutManager', 'focusManager', 'globalize', 'loa
name: globalize.translate('Collections'),
value: 'collections'
});
- }
- else if (type === 'tvshows') {
+ } else if (type === 'tvshows') {
list.push({
name: globalize.translate('Shows'),
@@ -78,8 +77,7 @@ define(['require', 'apphost', 'layoutManager', 'focusManager', 'globalize', 'loa
name: globalize.translate('Favorites'),
value: 'favorites'
});
- }
- else if (type === 'music') {
+ } else if (type === 'music') {
list.push({
name: globalize.translate('Suggestions'),
@@ -111,8 +109,7 @@ define(['require', 'apphost', 'layoutManager', 'focusManager', 'globalize', 'loa
name: globalize.translate('Genres'),
value: 'genres'
});
- }
- else if (type === 'livetv') {
+ } else if (type === 'livetv') {
list.push({
name: globalize.translate('Suggestions'),
@@ -256,7 +253,6 @@ define(['require', 'apphost', 'layoutManager', 'focusManager', 'globalize', 'loa
html += '';
}
-
return html;
}
@@ -384,7 +380,8 @@ define(['require', 'apphost', 'layoutManager', 'focusManager', 'globalize', 'loa
var viewItems = context.querySelectorAll('.viewItem');
var orderedViews = [];
- var i, length;
+ var i;
+ var length;
for (i = 0, length = viewItems.length; i < length; i++) {
orderedViews.push(viewItems[i].getAttribute('data-viewid'));
}
diff --git a/src/components/homesections/homesections.js b/src/components/homesections/homesections.js
index 91abafa545..3f86e16796 100644
--- a/src/components/homesections/homesections.js
+++ b/src/components/homesections/homesections.js
@@ -1,4 +1,4 @@
-define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'layoutManager', 'imageLoader', 'globalize', 'itemShortcuts', 'itemHelper', 'appRouter', 'scripts/imagehelper','paper-icon-button-light', 'emby-itemscontainer', 'emby-scroller', 'emby-button', 'css!./homesections'], function (connectionManager, cardBuilder, appSettings, dom, appHost, layoutManager, imageLoader, globalize, itemShortcuts, itemHelper, appRouter, imageHelper) {
+define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'layoutManager', 'imageLoader', 'globalize', 'itemShortcuts', 'itemHelper', 'appRouter', 'scripts/imagehelper', 'paper-icon-button-light', 'emby-itemscontainer', 'emby-scroller', 'emby-button', 'css!./homesections'], function (connectionManager, cardBuilder, appSettings, dom, appHost, layoutManager, imageLoader, globalize, itemShortcuts, itemHelper, appRouter, imageHelper) {
'use strict';
function getDefaultSection(index) {
@@ -83,7 +83,8 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
function resume(elem, options) {
var elems = elem.querySelectorAll('.itemsContainer');
- var i, length;
+ var i;
+ var length;
var promises = [];
for (i = 0, length = elems.length; i < length; i++) {
@@ -567,7 +568,7 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
html += '' + globalize.translate('Programs') + '';
html += '';
- }
- else {
+ } else {
html += '';
}
diff --git a/src/components/imageeditor/imageeditor.js b/src/components/imageeditor/imageeditor.js
index 2c649bdd16..fade0dd04c 100644
--- a/src/components/imageeditor/imageeditor.js
+++ b/src/components/imageeditor/imageeditor.js
@@ -24,8 +24,7 @@ define(['dialogHelper', 'connectionManager', 'loading', 'dom', 'layoutManager',
if (item) {
apiClient = connectionManager.getApiClient(item.ServerId);
reloadItem(page, item, apiClient, focusContext);
- }
- else {
+ } else {
apiClient = connectionManager.getApiClient(currentItem.ServerId);
apiClient.getItem(apiClient.getCurrentUserId(), currentItem.Id).then(function (item) {
@@ -60,7 +59,6 @@ define(['dialogHelper', 'connectionManager', 'loading', 'dom', 'layoutManager',
}
}
-
apiClient.getItemImageInfos(currentItem.Id).then(function (imageInfos) {
renderStandardImages(page, apiClient, item, imageInfos, providers);
@@ -167,8 +165,7 @@ define(['dialogHelper', 'connectionManager', 'loading', 'dom', 'layoutManager',
} else {
html += '';
}
- }
- else {
+ } else {
if (imageProviders.length) {
html += '';
}
diff --git a/src/components/images/imageLoader.js b/src/components/images/imageLoader.js
index 2a77daa216..a2906cca85 100644
--- a/src/components/images/imageLoader.js
+++ b/src/components/images/imageLoader.js
@@ -70,7 +70,9 @@ define(['lazyLoader', 'imageFetcher', 'layoutManager', 'browser', 'appSettings',
}
// Use the median
- values.sort(function (a, b) { return a - b; });
+ values.sort(function (a, b) {
+ return a - b;
+ });
var half = Math.floor(values.length / 2);
@@ -78,8 +80,7 @@ define(['lazyLoader', 'imageFetcher', 'layoutManager', 'browser', 'appSettings',
if (values.length % 2) {
result = values[half];
- }
- else {
+ } else {
result = (values[half - 1] + values[half]) / 2.0;
}
diff --git a/src/components/imageuploader/imageuploader.js b/src/components/imageuploader/imageuploader.js
index 3a52d7110d..98fcf0ebce 100644
--- a/src/components/imageuploader/imageuploader.js
+++ b/src/components/imageuploader/imageuploader.js
@@ -150,7 +150,7 @@ define(['dialogHelper', 'connectionManager', 'dom', 'loading', 'scrollHelper', '
scrollHelper.centerFocus.on(dlg, false);
}
- // Has to be assigned a z-index after the call to .open()
+ // Has to be assigned a z-index after the call to .open()
dlg.addEventListener('close', function () {
if (layoutManager.tv) {
diff --git a/src/components/itemcontextmenu.js b/src/components/itemcontextmenu.js
index 46a65cabc3..a3aa8cac4f 100644
--- a/src/components/itemcontextmenu.js
+++ b/src/components/itemcontextmenu.js
@@ -52,8 +52,6 @@ define(["apphost", "globalize", "connectionManager", "itemHelper", "appRouter",
//}
}
-
-
if (item.IsFolder || item.Type === "MusicArtist" || item.Type === "MusicGenre") {
if (item.CollectionType !== "livetv") {
if (options.shuffle !== false) {
diff --git a/src/components/itemhelper.js b/src/components/itemhelper.js
index f8bdb28ac5..8e0883474a 100644
--- a/src/components/itemhelper.js
+++ b/src/components/itemhelper.js
@@ -250,9 +250,7 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
if (item.Type !== 'TvChannel') {
return true;
}
- }
-
- else if (item.MediaType === 'Audio') {
+ } else if (item.MediaType === 'Audio') {
if (item.Type === 'AudioPodcast') {
return true;
}
@@ -274,7 +272,13 @@ define(['apphost', 'globalize'], function (appHost, globalize) {
canRate: function (item) {
- if (item.Type === 'Program' || item.Type === 'Timer' || item.Type === 'SeriesTimer' || item.Type === 'CollectionFolder' || item.Type === 'UserView' || item.Type === 'Channel') {
+ if (item.Type === 'Program'
+ || item.Type === 'Timer'
+ || item.Type === 'SeriesTimer'
+ || item.Type === 'CollectionFolder'
+ || item.Type === 'UserView'
+ || item.Type === 'Channel'
+ || !item.UserData) {
return false;
}
diff --git a/src/components/itemidentifier/itemidentifier.js b/src/components/itemidentifier/itemidentifier.js
index fa01a4aced..6f28de0b3b 100644
--- a/src/components/itemidentifier/itemidentifier.js
+++ b/src/components/itemidentifier/itemidentifier.js
@@ -21,7 +21,8 @@ define(["dialogHelper", "loading", "connectionManager", "require", "globalize",
ProviderIds: {}
};
- var i, length;
+ var i;
+ var length;
var identifyField = page.querySelectorAll(".identifyField");
var value;
for (i = 0, length = identifyField.length; i < length; i++) {
@@ -64,8 +65,7 @@ define(["dialogHelper", "loading", "connectionManager", "require", "globalize",
if (currentItem && currentItem.Id) {
lookupInfo.ItemId = currentItem.Id;
- }
- else {
+ } else {
lookupInfo.IncludeDisabledProviders = true;
}
@@ -97,7 +97,8 @@ define(["dialogHelper", "loading", "connectionManager", "require", "globalize",
page.querySelector(".dialogContentInner").classList.remove("dialog-content-centered");
var html = "";
- var i, length;
+ var i;
+ var length;
for (i = 0, length = results.length; i < length; i++) {
var result = results[i];
@@ -184,12 +185,10 @@ define(["dialogHelper", "loading", "connectionManager", "require", "globalize",
if (currentItemType === "Episode") {
cssClass += " backdropCard backdropCard-scalable";
padderClass = "cardPadder-backdrop";
- }
- else if (currentItemType === "MusicAlbum" || currentItemType === "MusicArtist") {
+ } else if (currentItemType === "MusicAlbum" || currentItemType === "MusicArtist") {
cssClass += " squareCard squareCard-scalable";
padderClass = "cardPadder-square";
- }
- else {
+ } else {
cssClass += " portraitCard portraitCard-scalable";
padderClass = "cardPadder-portrait";
}
@@ -452,8 +451,6 @@ define(["dialogHelper", "loading", "connectionManager", "require", "globalize",
scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"), false);
}
-
-
dialogHelper.open(dlg);
dlg.querySelector(".btnCancel").addEventListener("click", function (e) {
diff --git a/src/components/itemsrefresher.js b/src/components/itemsrefresher.js
index d9bef95b4b..46956d2df5 100644
--- a/src/components/itemsrefresher.js
+++ b/src/components/itemsrefresher.js
@@ -11,8 +11,7 @@ define(['playbackManager', 'serverNotifications', 'events'], function (playbackM
if (eventsToMonitor.indexOf('markfavorite') !== -1) {
instance.notifyRefreshNeeded();
- }
- else if (eventsToMonitor.indexOf('markplayed') !== -1) {
+ } else if (eventsToMonitor.indexOf('markplayed') !== -1) {
instance.notifyRefreshNeeded();
}
@@ -115,9 +114,7 @@ define(['playbackManager', 'serverNotifications', 'events'], function (playbackM
instance.notifyRefreshNeeded(true);
return;
}
- }
-
- else if (state.NowPlayingItem && state.NowPlayingItem.MediaType === 'Audio') {
+ } else if (state.NowPlayingItem && state.NowPlayingItem.MediaType === 'Audio') {
if (eventsToMonitor.indexOf('audioplayback') !== -1) {
diff --git a/src/components/keyboardnavigation.js b/src/components/keyboardnavigation.js
index 7ed74f2201..8c0bb1a3ae 100644
--- a/src/components/keyboardnavigation.js
+++ b/src/components/keyboardnavigation.js
@@ -8,20 +8,20 @@ define(['inputManager', 'focusManager'], function(inputManager, focusManager) {
var capture = true;
switch (e.keyCode) {
- case 37: // ArrowLeft
- inputManager.handle('left');
- break;
- case 38: // ArrowUp
- inputManager.handle('up');
- break;
- case 39: // ArrowRight
- inputManager.handle('right');
- break;
- case 40: // ArrowDown
- inputManager.handle('down');
- break;
- default:
- capture = false;
+ case 37: // ArrowLeft
+ inputManager.handle('left');
+ break;
+ case 38: // ArrowUp
+ inputManager.handle('up');
+ break;
+ case 39: // ArrowRight
+ inputManager.handle('right');
+ break;
+ case 40: // ArrowDown
+ inputManager.handle('down');
+ break;
+ default:
+ capture = false;
}
if (capture) {
console.log("Disabling default event handling");
@@ -31,6 +31,6 @@ define(['inputManager', 'focusManager'], function(inputManager, focusManager) {
}
return {
- enable: enable,
+ enable: enable
};
});
diff --git a/src/components/lazyloader/lazyloader-intersectionobserver.js b/src/components/lazyloader/lazyloader-intersectionobserver.js
index 261ca84261..1935f65a30 100644
--- a/src/components/lazyloader/lazyloader-intersectionobserver.js
+++ b/src/components/lazyloader/lazyloader-intersectionobserver.js
@@ -45,7 +45,7 @@ define(['require', 'browser'], function (require, browser) {
}
}
},
- observerOptions
+ observerOptions
);
this.observer = observer;
diff --git a/src/components/listview/listview.js b/src/components/listview/listview.js
index 53c061618f..94535deb6f 100644
--- a/src/components/listview/listview.js
+++ b/src/components/listview/listview.js
@@ -9,7 +9,8 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
}
var sortBy = (options.sortBy || '').toLowerCase();
- var code, name;
+ var code;
+ var name;
if (sortBy.indexOf('sortname') === 0) {
@@ -85,15 +86,12 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
options.tag = item.AlbumPrimaryImageTag;
return apiClient.getScaledImageUrl(item.AlbumId, options);
- }
-
- else if (item.SeriesId && item.SeriesPrimaryImageTag) {
+ } else if (item.SeriesId && item.SeriesPrimaryImageTag) {
options.tag = item.SeriesPrimaryImageTag;
return apiClient.getScaledImageUrl(item.SeriesId, options);
- }
- else if (item.ParentPrimaryImageTag) {
+ } else if (item.ParentPrimaryImageTag) {
options.tag = item.ParentPrimaryImageTag;
return apiClient.getScaledImageUrl(item.ParentPrimaryImageItemId, options);
@@ -209,8 +207,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
if (i === 0) {
html += '