mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
merge from dev
This commit is contained in:
parent
1c8f02ce0f
commit
33b01d778c
911 changed files with 34157 additions and 57125 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "webcomponentsjs",
|
||||
"main": "webcomponents.js",
|
||||
"version": "0.7.14",
|
||||
"version": "0.7.19",
|
||||
"homepage": "http://webcomponents.org",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
@ -15,13 +15,16 @@
|
|||
],
|
||||
"license": "BSD",
|
||||
"ignore": [],
|
||||
"_release": "0.7.14",
|
||||
"devDependencies": {
|
||||
"web-component-tester": "~3.3.10"
|
||||
},
|
||||
"_release": "0.7.19",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v0.7.14",
|
||||
"commit": "48194e673b7a0a8810b32320e0444b512e5a7557"
|
||||
"tag": "v0.7.19",
|
||||
"commit": "d2b2329a8453e93b0d0c4949bb83e7166088adaf"
|
||||
},
|
||||
"_source": "git://github.com/Polymer/webcomponentsjs.git",
|
||||
"_target": "^0.7.2",
|
||||
"_target": "^0.7.18",
|
||||
"_originalSource": "webcomponentsjs"
|
||||
}
|
|
@ -7,7 +7,7 @@
|
|||
* 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.14
|
||||
// @version 0.7.19
|
||||
if (typeof WeakMap === "undefined") {
|
||||
(function() {
|
||||
var defineProperty = Object.defineProperty;
|
||||
|
@ -45,6 +45,9 @@ if (typeof WeakMap === "undefined") {
|
|||
}
|
||||
|
||||
(function(global) {
|
||||
if (global.JsMutationObserver) {
|
||||
return;
|
||||
}
|
||||
var registrationsTable = new WeakMap();
|
||||
var setImmediate;
|
||||
if (/Trident|Edge/.test(navigator.userAgent)) {
|
||||
|
@ -340,9 +343,84 @@ if (typeof WeakMap === "undefined") {
|
|||
}
|
||||
};
|
||||
global.JsMutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) {
|
||||
global.MutationObserver = JsMutationObserver;
|
||||
JsMutationObserver._isPolyfilled = true;
|
||||
}
|
||||
})(self);
|
||||
|
||||
(function(scope) {
|
||||
"use strict";
|
||||
if (!window.performance) {
|
||||
var start = Date.now();
|
||||
window.performance = {
|
||||
now: function() {
|
||||
return Date.now() - start;
|
||||
}
|
||||
};
|
||||
}
|
||||
if (!window.requestAnimationFrame) {
|
||||
window.requestAnimationFrame = function() {
|
||||
var nativeRaf = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
|
||||
return nativeRaf ? function(callback) {
|
||||
return nativeRaf(function() {
|
||||
callback(performance.now());
|
||||
});
|
||||
} : function(callback) {
|
||||
return window.setTimeout(callback, 1e3 / 60);
|
||||
};
|
||||
}();
|
||||
}
|
||||
if (!window.cancelAnimationFrame) {
|
||||
window.cancelAnimationFrame = function() {
|
||||
return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(id) {
|
||||
clearTimeout(id);
|
||||
};
|
||||
}();
|
||||
}
|
||||
var workingDefaultPrevented = function() {
|
||||
var e = document.createEvent("Event");
|
||||
e.initEvent("foo", true, true);
|
||||
e.preventDefault();
|
||||
return e.defaultPrevented;
|
||||
}();
|
||||
if (!workingDefaultPrevented) {
|
||||
var origPreventDefault = Event.prototype.preventDefault;
|
||||
Event.prototype.preventDefault = function() {
|
||||
if (!this.cancelable) {
|
||||
return;
|
||||
}
|
||||
origPreventDefault.call(this);
|
||||
Object.defineProperty(this, "defaultPrevented", {
|
||||
get: function() {
|
||||
return true;
|
||||
},
|
||||
configurable: true
|
||||
});
|
||||
};
|
||||
}
|
||||
var isIE = /Trident/.test(navigator.userAgent);
|
||||
if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") {
|
||||
window.CustomEvent = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("CustomEvent");
|
||||
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
|
||||
return e;
|
||||
};
|
||||
window.CustomEvent.prototype = window.Event.prototype;
|
||||
}
|
||||
if (!window.Event || isIE && typeof window.Event !== "function") {
|
||||
var origEvent = window.Event;
|
||||
window.Event = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("Event");
|
||||
e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable));
|
||||
return e;
|
||||
};
|
||||
window.Event.prototype = origEvent.prototype;
|
||||
}
|
||||
})(window.WebComponents);
|
||||
|
||||
window.CustomElements = window.CustomElements || {
|
||||
flags: {}
|
||||
};
|
||||
|
@ -442,8 +520,9 @@ window.CustomElements.addModule(function(scope) {
|
|||
}
|
||||
});
|
||||
}
|
||||
var hasPolyfillMutations = !window.MutationObserver || window.MutationObserver === window.JsMutationObserver;
|
||||
scope.hasPolyfillMutations = hasPolyfillMutations;
|
||||
var hasThrottledAttached = window.MutationObserver._isPolyfilled && flags["throttle-attached"];
|
||||
scope.hasPolyfillMutations = hasThrottledAttached;
|
||||
scope.hasThrottledAttached = hasThrottledAttached;
|
||||
var isPendingMutations = false;
|
||||
var pendingMutations = [];
|
||||
function deferMutation(fn) {
|
||||
|
@ -462,7 +541,7 @@ window.CustomElements.addModule(function(scope) {
|
|||
pendingMutations = [];
|
||||
}
|
||||
function attached(element) {
|
||||
if (hasPolyfillMutations) {
|
||||
if (hasThrottledAttached) {
|
||||
deferMutation(function() {
|
||||
_attached(element);
|
||||
});
|
||||
|
@ -485,7 +564,7 @@ window.CustomElements.addModule(function(scope) {
|
|||
});
|
||||
}
|
||||
function detached(element) {
|
||||
if (hasPolyfillMutations) {
|
||||
if (hasThrottledAttached) {
|
||||
deferMutation(function() {
|
||||
_detached(element);
|
||||
});
|
||||
|
@ -612,6 +691,11 @@ window.CustomElements.addModule(function(scope) {
|
|||
window.CustomElements.addModule(function(scope) {
|
||||
var flags = scope.flags;
|
||||
function upgrade(node, isAttached) {
|
||||
if (node.localName === "template") {
|
||||
if (window.HTMLTemplateElement && HTMLTemplateElement.decorate) {
|
||||
HTMLTemplateElement.decorate(node);
|
||||
}
|
||||
}
|
||||
if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
|
||||
var is = node.getAttribute("is");
|
||||
var definition = scope.getRegisteredDefinition(node.localName) || scope.getRegisteredDefinition(is);
|
||||
|
@ -946,22 +1030,6 @@ window.CustomElements.addModule(function(scope) {
|
|||
});
|
||||
});
|
||||
}
|
||||
if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") {
|
||||
window.CustomEvent = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("CustomEvent");
|
||||
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
|
||||
e.preventDefault = function() {
|
||||
Object.defineProperty(this, "defaultPrevented", {
|
||||
get: function() {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
};
|
||||
return e;
|
||||
};
|
||||
window.CustomEvent.prototype = window.Event.prototype;
|
||||
}
|
||||
if (document.readyState === "complete" || scope.flags.eager) {
|
||||
bootstrap();
|
||||
} else if (document.readyState === "interactive" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
* 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.14
|
||||
// @version 0.7.19
|
||||
if (typeof WeakMap === "undefined") {
|
||||
(function() {
|
||||
var defineProperty = Object.defineProperty;
|
||||
|
@ -45,6 +45,9 @@ if (typeof WeakMap === "undefined") {
|
|||
}
|
||||
|
||||
(function(global) {
|
||||
if (global.JsMutationObserver) {
|
||||
return;
|
||||
}
|
||||
var registrationsTable = new WeakMap();
|
||||
var setImmediate;
|
||||
if (/Trident|Edge/.test(navigator.userAgent)) {
|
||||
|
@ -340,9 +343,84 @@ if (typeof WeakMap === "undefined") {
|
|||
}
|
||||
};
|
||||
global.JsMutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) {
|
||||
global.MutationObserver = JsMutationObserver;
|
||||
JsMutationObserver._isPolyfilled = true;
|
||||
}
|
||||
})(self);
|
||||
|
||||
(function(scope) {
|
||||
"use strict";
|
||||
if (!window.performance) {
|
||||
var start = Date.now();
|
||||
window.performance = {
|
||||
now: function() {
|
||||
return Date.now() - start;
|
||||
}
|
||||
};
|
||||
}
|
||||
if (!window.requestAnimationFrame) {
|
||||
window.requestAnimationFrame = function() {
|
||||
var nativeRaf = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
|
||||
return nativeRaf ? function(callback) {
|
||||
return nativeRaf(function() {
|
||||
callback(performance.now());
|
||||
});
|
||||
} : function(callback) {
|
||||
return window.setTimeout(callback, 1e3 / 60);
|
||||
};
|
||||
}();
|
||||
}
|
||||
if (!window.cancelAnimationFrame) {
|
||||
window.cancelAnimationFrame = function() {
|
||||
return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(id) {
|
||||
clearTimeout(id);
|
||||
};
|
||||
}();
|
||||
}
|
||||
var workingDefaultPrevented = function() {
|
||||
var e = document.createEvent("Event");
|
||||
e.initEvent("foo", true, true);
|
||||
e.preventDefault();
|
||||
return e.defaultPrevented;
|
||||
}();
|
||||
if (!workingDefaultPrevented) {
|
||||
var origPreventDefault = Event.prototype.preventDefault;
|
||||
Event.prototype.preventDefault = function() {
|
||||
if (!this.cancelable) {
|
||||
return;
|
||||
}
|
||||
origPreventDefault.call(this);
|
||||
Object.defineProperty(this, "defaultPrevented", {
|
||||
get: function() {
|
||||
return true;
|
||||
},
|
||||
configurable: true
|
||||
});
|
||||
};
|
||||
}
|
||||
var isIE = /Trident/.test(navigator.userAgent);
|
||||
if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") {
|
||||
window.CustomEvent = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("CustomEvent");
|
||||
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
|
||||
return e;
|
||||
};
|
||||
window.CustomEvent.prototype = window.Event.prototype;
|
||||
}
|
||||
if (!window.Event || isIE && typeof window.Event !== "function") {
|
||||
var origEvent = window.Event;
|
||||
window.Event = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("Event");
|
||||
e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable));
|
||||
return e;
|
||||
};
|
||||
window.Event.prototype = origEvent.prototype;
|
||||
}
|
||||
})(window.WebComponents);
|
||||
|
||||
window.HTMLImports = window.HTMLImports || {
|
||||
flags: {}
|
||||
};
|
||||
|
@ -544,10 +622,14 @@ window.HTMLImports.addModule(function(scope) {
|
|||
request.open("GET", url, xhr.async);
|
||||
request.addEventListener("readystatechange", function(e) {
|
||||
if (request.readyState === 4) {
|
||||
var locationHeader = request.getResponseHeader("Location");
|
||||
var redirectedUrl = null;
|
||||
if (locationHeader) {
|
||||
var redirectedUrl = locationHeader.substr(0, 1) === "/" ? location.origin + locationHeader : locationHeader;
|
||||
try {
|
||||
var locationHeader = request.getResponseHeader("Location");
|
||||
if (locationHeader) {
|
||||
redirectedUrl = locationHeader.substr(0, 1) === "/" ? location.origin + locationHeader : locationHeader;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
next.call(nextContext, !xhr.ok(request) && request, request.response || request.responseText, redirectedUrl);
|
||||
}
|
||||
|
@ -1061,22 +1143,6 @@ window.HTMLImports.addModule(function(scope) {
|
|||
if (scope.useNative) {
|
||||
return;
|
||||
}
|
||||
if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") {
|
||||
window.CustomEvent = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("CustomEvent");
|
||||
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
|
||||
e.preventDefault = function() {
|
||||
Object.defineProperty(this, "defaultPrevented", {
|
||||
get: function() {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
};
|
||||
return e;
|
||||
};
|
||||
window.CustomEvent.prototype = window.Event.prototype;
|
||||
}
|
||||
initializeModules();
|
||||
var rootDocument = scope.rootDocument;
|
||||
function bootstrap() {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
* 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.14
|
||||
// @version 0.7.19
|
||||
if (typeof WeakMap === "undefined") {
|
||||
(function() {
|
||||
var defineProperty = Object.defineProperty;
|
||||
|
@ -45,6 +45,9 @@ if (typeof WeakMap === "undefined") {
|
|||
}
|
||||
|
||||
(function(global) {
|
||||
if (global.JsMutationObserver) {
|
||||
return;
|
||||
}
|
||||
var registrationsTable = new WeakMap();
|
||||
var setImmediate;
|
||||
if (/Trident|Edge/.test(navigator.userAgent)) {
|
||||
|
@ -340,5 +343,8 @@ if (typeof WeakMap === "undefined") {
|
|||
}
|
||||
};
|
||||
global.JsMutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) {
|
||||
global.MutationObserver = JsMutationObserver;
|
||||
JsMutationObserver._isPolyfilled = true;
|
||||
}
|
||||
})(self);
|
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
* 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.14
|
||||
// @version 0.7.19
|
||||
if (typeof WeakMap === "undefined") {
|
||||
(function() {
|
||||
var defineProperty = Object.defineProperty;
|
||||
|
@ -1118,6 +1118,24 @@ window.ShadowDOMPolyfill = {};
|
|||
stopImmediatePropagationTable.set(this, true);
|
||||
}
|
||||
};
|
||||
var supportsDefaultPrevented = function() {
|
||||
var e = document.createEvent("Event");
|
||||
e.initEvent("test", true, true);
|
||||
e.preventDefault();
|
||||
return e.defaultPrevented;
|
||||
}();
|
||||
if (!supportsDefaultPrevented) {
|
||||
Event.prototype.preventDefault = function() {
|
||||
if (!this.cancelable) return;
|
||||
unsafeUnwrap(this).preventDefault();
|
||||
Object.defineProperty(this, "defaultPrevented", {
|
||||
get: function() {
|
||||
return true;
|
||||
},
|
||||
configurable: true
|
||||
});
|
||||
};
|
||||
}
|
||||
registerWrapper(OriginalEvent, Event, document.createEvent("Event"));
|
||||
function unwrapOptions(options) {
|
||||
if (!options || !options.relatedTarget) return options;
|
||||
|
@ -2723,7 +2741,7 @@ window.ShadowDOMPolyfill = {};
|
|||
enumerable: true
|
||||
});
|
||||
}
|
||||
[ "getBoundingClientRect", "getClientRects", "scrollIntoView" ].forEach(methodRequiresRendering);
|
||||
[ "focus", "getBoundingClientRect", "getClientRects", "scrollIntoView" ].forEach(methodRequiresRendering);
|
||||
registerWrapper(OriginalHTMLElement, HTMLElement, document.createElement("b"));
|
||||
scope.wrappers.HTMLElement = HTMLElement;
|
||||
scope.getInnerHTML = getInnerHTML;
|
||||
|
@ -3346,6 +3364,7 @@ window.ShadowDOMPolyfill = {};
|
|||
var setInnerHTML = scope.setInnerHTML;
|
||||
var unsafeUnwrap = scope.unsafeUnwrap;
|
||||
var unwrap = scope.unwrap;
|
||||
var wrap = scope.wrap;
|
||||
var shadowHostTable = new WeakMap();
|
||||
var nextOlderShadowTreeTable = new WeakMap();
|
||||
function ShadowRoot(hostWrapper) {
|
||||
|
@ -3378,6 +3397,25 @@ window.ShadowDOMPolyfill = {};
|
|||
},
|
||||
elementFromPoint: function(x, y) {
|
||||
return elementFromPoint(this, this.ownerDocument, x, y);
|
||||
},
|
||||
getSelection: function() {
|
||||
return document.getSelection();
|
||||
},
|
||||
get activeElement() {
|
||||
var unwrappedActiveElement = unwrap(this).ownerDocument.activeElement;
|
||||
if (!unwrappedActiveElement || !unwrappedActiveElement.nodeType) return null;
|
||||
var activeElement = wrap(unwrappedActiveElement);
|
||||
while (!this.contains(activeElement)) {
|
||||
while (activeElement.parentNode) {
|
||||
activeElement = activeElement.parentNode;
|
||||
}
|
||||
if (activeElement.host) {
|
||||
activeElement = activeElement.host;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return activeElement;
|
||||
}
|
||||
});
|
||||
scope.wrappers.ShadowRoot = ShadowRoot;
|
||||
|
@ -3969,7 +4007,7 @@ window.ShadowDOMPolyfill = {};
|
|||
unsafeUnwrap(this).removeRange(unwrap(range));
|
||||
},
|
||||
selectAllChildren: function(node) {
|
||||
unsafeUnwrap(this).selectAllChildren(unwrapIfNeeded(node));
|
||||
unsafeUnwrap(this).selectAllChildren(node instanceof ShadowRoot ? unsafeUnwrap(node.host) : unwrapIfNeeded(node));
|
||||
},
|
||||
toString: function() {
|
||||
return unsafeUnwrap(this).toString();
|
||||
|
@ -4042,6 +4080,7 @@ window.ShadowDOMPolyfill = {};
|
|||
var ShadowRoot = scope.wrappers.ShadowRoot;
|
||||
var TreeScope = scope.TreeScope;
|
||||
var cloneNode = scope.cloneNode;
|
||||
var defineGetter = scope.defineGetter;
|
||||
var defineWrapGetter = scope.defineWrapGetter;
|
||||
var elementFromPoint = scope.elementFromPoint;
|
||||
var forwardMethodsToWrapper = scope.forwardMethodsToWrapper;
|
||||
|
@ -4065,6 +4104,23 @@ window.ShadowDOMPolyfill = {};
|
|||
defineWrapGetter(Document, "documentElement");
|
||||
defineWrapGetter(Document, "body");
|
||||
defineWrapGetter(Document, "head");
|
||||
defineGetter(Document, "activeElement", function() {
|
||||
var unwrappedActiveElement = unwrap(this).activeElement;
|
||||
if (!unwrappedActiveElement || !unwrappedActiveElement.nodeType) return null;
|
||||
var activeElement = wrap(unwrappedActiveElement);
|
||||
while (!this.contains(activeElement)) {
|
||||
var lastHost = activeElement;
|
||||
while (activeElement.parentNode) {
|
||||
activeElement = activeElement.parentNode;
|
||||
}
|
||||
if (activeElement.host) {
|
||||
activeElement = activeElement.host;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return activeElement;
|
||||
});
|
||||
function wrapMethod(name) {
|
||||
var original = document[name];
|
||||
Document.prototype[name] = function() {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "webcomponentsjs",
|
||||
"main": "webcomponents.js",
|
||||
"version": "0.7.14",
|
||||
"version": "0.7.19",
|
||||
"homepage": "http://webcomponents.org",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
@ -14,5 +14,8 @@
|
|||
"webcomponents"
|
||||
],
|
||||
"license": "BSD",
|
||||
"ignore": []
|
||||
"ignore": [],
|
||||
"devDependencies": {
|
||||
"web-component-tester": "~3.3.10"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "webcomponents.js",
|
||||
"version": "0.7.14",
|
||||
"version": "0.7.19",
|
||||
"description": "webcomponents.js",
|
||||
"main": "webcomponents.js",
|
||||
"directories": {
|
||||
|
@ -11,10 +11,7 @@
|
|||
"url": "https://github.com/webcomponents/webcomponentsjs.git"
|
||||
},
|
||||
"author": "The Polymer Authors",
|
||||
"license": {
|
||||
"type": "BSD-3-Clause",
|
||||
"url": "http://polymer.github.io/LICENSE.txt"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"bugs": {
|
||||
"url": "https://github.com/webcomponents/webcomponentsjs/issues"
|
||||
},
|
||||
|
@ -26,6 +23,6 @@
|
|||
"gulp-header": "^1.1.1",
|
||||
"gulp-uglify": "^1.0.1",
|
||||
"run-sequence": "^1.0.1",
|
||||
"web-component-tester": "*"
|
||||
"web-component-tester": "^3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,13 +7,14 @@
|
|||
* 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.14
|
||||
window.WebComponents = window.WebComponents || {};
|
||||
|
||||
(function(scope) {
|
||||
var flags = scope.flags || {};
|
||||
// @version 0.7.19
|
||||
(function() {
|
||||
window.WebComponents = window.WebComponents || {
|
||||
flags: {}
|
||||
};
|
||||
var file = "webcomponents-lite.js";
|
||||
var script = document.querySelector('script[src*="' + file + '"]');
|
||||
var flags = {};
|
||||
if (!flags.noOpts) {
|
||||
location.search.slice(1).split("&").forEach(function(option) {
|
||||
var parts = option.split("=");
|
||||
|
@ -29,7 +30,7 @@ window.WebComponents = window.WebComponents || {};
|
|||
}
|
||||
}
|
||||
}
|
||||
if (flags.log) {
|
||||
if (flags.log && flags.log.split) {
|
||||
var parts = flags.log.split(",");
|
||||
flags.log = {};
|
||||
parts.forEach(function(f) {
|
||||
|
@ -39,20 +40,14 @@ window.WebComponents = window.WebComponents || {};
|
|||
flags.log = {};
|
||||
}
|
||||
}
|
||||
flags.shadow = flags.shadow || flags.shadowdom || flags.polyfill;
|
||||
if (flags.shadow === "native") {
|
||||
flags.shadow = false;
|
||||
} else {
|
||||
flags.shadow = flags.shadow || !HTMLElement.prototype.createShadowRoot;
|
||||
}
|
||||
if (flags.register) {
|
||||
window.CustomElements = window.CustomElements || {
|
||||
flags: {}
|
||||
};
|
||||
window.CustomElements.flags.register = flags.register;
|
||||
}
|
||||
scope.flags = flags;
|
||||
})(window.WebComponents);
|
||||
WebComponents.flags = flags;
|
||||
})();
|
||||
|
||||
(function(scope) {
|
||||
"use strict";
|
||||
|
@ -613,6 +608,9 @@ if (typeof WeakMap === "undefined") {
|
|||
}
|
||||
|
||||
(function(global) {
|
||||
if (global.JsMutationObserver) {
|
||||
return;
|
||||
}
|
||||
var registrationsTable = new WeakMap();
|
||||
var setImmediate;
|
||||
if (/Trident|Edge/.test(navigator.userAgent)) {
|
||||
|
@ -908,9 +906,168 @@ if (typeof WeakMap === "undefined") {
|
|||
}
|
||||
};
|
||||
global.JsMutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) {
|
||||
global.MutationObserver = JsMutationObserver;
|
||||
JsMutationObserver._isPolyfilled = true;
|
||||
}
|
||||
})(self);
|
||||
|
||||
if (typeof HTMLTemplateElement === "undefined") {
|
||||
(function() {
|
||||
var TEMPLATE_TAG = "template";
|
||||
var contentDoc = document.implementation.createHTMLDocument("template");
|
||||
var canDecorate = true;
|
||||
HTMLTemplateElement = function() {};
|
||||
HTMLTemplateElement.prototype = Object.create(HTMLElement.prototype);
|
||||
HTMLTemplateElement.decorate = function(template) {
|
||||
if (template.content) {
|
||||
return;
|
||||
}
|
||||
template.content = contentDoc.createDocumentFragment();
|
||||
var child;
|
||||
while (child = template.firstChild) {
|
||||
template.content.appendChild(child);
|
||||
}
|
||||
if (canDecorate) {
|
||||
try {
|
||||
Object.defineProperty(template, "innerHTML", {
|
||||
get: function() {
|
||||
var o = "";
|
||||
for (var e = this.content.firstChild; e; e = e.nextSibling) {
|
||||
o += e.outerHTML || escapeData(e.data);
|
||||
}
|
||||
return o;
|
||||
},
|
||||
set: function(text) {
|
||||
contentDoc.body.innerHTML = text;
|
||||
HTMLTemplateElement.bootstrap(contentDoc);
|
||||
while (this.content.firstChild) {
|
||||
this.content.removeChild(this.content.firstChild);
|
||||
}
|
||||
while (contentDoc.body.firstChild) {
|
||||
this.content.appendChild(contentDoc.body.firstChild);
|
||||
}
|
||||
},
|
||||
configurable: true
|
||||
});
|
||||
} catch (err) {
|
||||
canDecorate = false;
|
||||
}
|
||||
}
|
||||
HTMLTemplateElement.bootstrap(template.content);
|
||||
};
|
||||
HTMLTemplateElement.bootstrap = function(doc) {
|
||||
var templates = doc.querySelectorAll(TEMPLATE_TAG);
|
||||
for (var i = 0, l = templates.length, t; i < l && (t = templates[i]); i++) {
|
||||
HTMLTemplateElement.decorate(t);
|
||||
}
|
||||
};
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
HTMLTemplateElement.bootstrap(document);
|
||||
});
|
||||
var createElement = document.createElement;
|
||||
document.createElement = function() {
|
||||
"use strict";
|
||||
var el = createElement.apply(document, arguments);
|
||||
if (el.localName == "template") {
|
||||
HTMLTemplateElement.decorate(el);
|
||||
}
|
||||
return el;
|
||||
};
|
||||
var escapeDataRegExp = /[&\u00A0<>]/g;
|
||||
function escapeReplace(c) {
|
||||
switch (c) {
|
||||
case "&":
|
||||
return "&";
|
||||
|
||||
case "<":
|
||||
return "<";
|
||||
|
||||
case ">":
|
||||
return ">";
|
||||
|
||||
case " ":
|
||||
return " ";
|
||||
}
|
||||
}
|
||||
function escapeData(s) {
|
||||
return s.replace(escapeDataRegExp, escapeReplace);
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
(function(scope) {
|
||||
"use strict";
|
||||
if (!window.performance) {
|
||||
var start = Date.now();
|
||||
window.performance = {
|
||||
now: function() {
|
||||
return Date.now() - start;
|
||||
}
|
||||
};
|
||||
}
|
||||
if (!window.requestAnimationFrame) {
|
||||
window.requestAnimationFrame = function() {
|
||||
var nativeRaf = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
|
||||
return nativeRaf ? function(callback) {
|
||||
return nativeRaf(function() {
|
||||
callback(performance.now());
|
||||
});
|
||||
} : function(callback) {
|
||||
return window.setTimeout(callback, 1e3 / 60);
|
||||
};
|
||||
}();
|
||||
}
|
||||
if (!window.cancelAnimationFrame) {
|
||||
window.cancelAnimationFrame = function() {
|
||||
return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(id) {
|
||||
clearTimeout(id);
|
||||
};
|
||||
}();
|
||||
}
|
||||
var workingDefaultPrevented = function() {
|
||||
var e = document.createEvent("Event");
|
||||
e.initEvent("foo", true, true);
|
||||
e.preventDefault();
|
||||
return e.defaultPrevented;
|
||||
}();
|
||||
if (!workingDefaultPrevented) {
|
||||
var origPreventDefault = Event.prototype.preventDefault;
|
||||
Event.prototype.preventDefault = function() {
|
||||
if (!this.cancelable) {
|
||||
return;
|
||||
}
|
||||
origPreventDefault.call(this);
|
||||
Object.defineProperty(this, "defaultPrevented", {
|
||||
get: function() {
|
||||
return true;
|
||||
},
|
||||
configurable: true
|
||||
});
|
||||
};
|
||||
}
|
||||
var isIE = /Trident/.test(navigator.userAgent);
|
||||
if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") {
|
||||
window.CustomEvent = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("CustomEvent");
|
||||
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
|
||||
return e;
|
||||
};
|
||||
window.CustomEvent.prototype = window.Event.prototype;
|
||||
}
|
||||
if (!window.Event || isIE && typeof window.Event !== "function") {
|
||||
var origEvent = window.Event;
|
||||
window.Event = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("Event");
|
||||
e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable));
|
||||
return e;
|
||||
};
|
||||
window.Event.prototype = origEvent.prototype;
|
||||
}
|
||||
})(window.WebComponents);
|
||||
|
||||
window.HTMLImports = window.HTMLImports || {
|
||||
flags: {}
|
||||
};
|
||||
|
@ -1112,10 +1269,14 @@ window.HTMLImports.addModule(function(scope) {
|
|||
request.open("GET", url, xhr.async);
|
||||
request.addEventListener("readystatechange", function(e) {
|
||||
if (request.readyState === 4) {
|
||||
var locationHeader = request.getResponseHeader("Location");
|
||||
var redirectedUrl = null;
|
||||
if (locationHeader) {
|
||||
var redirectedUrl = locationHeader.substr(0, 1) === "/" ? location.origin + locationHeader : locationHeader;
|
||||
try {
|
||||
var locationHeader = request.getResponseHeader("Location");
|
||||
if (locationHeader) {
|
||||
redirectedUrl = locationHeader.substr(0, 1) === "/" ? location.origin + locationHeader : locationHeader;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
next.call(nextContext, !xhr.ok(request) && request, request.response || request.responseText, redirectedUrl);
|
||||
}
|
||||
|
@ -1629,22 +1790,6 @@ window.HTMLImports.addModule(function(scope) {
|
|||
if (scope.useNative) {
|
||||
return;
|
||||
}
|
||||
if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") {
|
||||
window.CustomEvent = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("CustomEvent");
|
||||
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
|
||||
e.preventDefault = function() {
|
||||
Object.defineProperty(this, "defaultPrevented", {
|
||||
get: function() {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
};
|
||||
return e;
|
||||
};
|
||||
window.CustomEvent.prototype = window.Event.prototype;
|
||||
}
|
||||
initializeModules();
|
||||
var rootDocument = scope.rootDocument;
|
||||
function bootstrap() {
|
||||
|
@ -1756,8 +1901,9 @@ window.CustomElements.addModule(function(scope) {
|
|||
}
|
||||
});
|
||||
}
|
||||
var hasPolyfillMutations = !window.MutationObserver || window.MutationObserver === window.JsMutationObserver;
|
||||
scope.hasPolyfillMutations = hasPolyfillMutations;
|
||||
var hasThrottledAttached = window.MutationObserver._isPolyfilled && flags["throttle-attached"];
|
||||
scope.hasPolyfillMutations = hasThrottledAttached;
|
||||
scope.hasThrottledAttached = hasThrottledAttached;
|
||||
var isPendingMutations = false;
|
||||
var pendingMutations = [];
|
||||
function deferMutation(fn) {
|
||||
|
@ -1776,7 +1922,7 @@ window.CustomElements.addModule(function(scope) {
|
|||
pendingMutations = [];
|
||||
}
|
||||
function attached(element) {
|
||||
if (hasPolyfillMutations) {
|
||||
if (hasThrottledAttached) {
|
||||
deferMutation(function() {
|
||||
_attached(element);
|
||||
});
|
||||
|
@ -1799,7 +1945,7 @@ window.CustomElements.addModule(function(scope) {
|
|||
});
|
||||
}
|
||||
function detached(element) {
|
||||
if (hasPolyfillMutations) {
|
||||
if (hasThrottledAttached) {
|
||||
deferMutation(function() {
|
||||
_detached(element);
|
||||
});
|
||||
|
@ -1926,6 +2072,11 @@ window.CustomElements.addModule(function(scope) {
|
|||
window.CustomElements.addModule(function(scope) {
|
||||
var flags = scope.flags;
|
||||
function upgrade(node, isAttached) {
|
||||
if (node.localName === "template") {
|
||||
if (window.HTMLTemplateElement && HTMLTemplateElement.decorate) {
|
||||
HTMLTemplateElement.decorate(node);
|
||||
}
|
||||
}
|
||||
if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
|
||||
var is = node.getAttribute("is");
|
||||
var definition = scope.getRegisteredDefinition(node.localName) || scope.getRegisteredDefinition(is);
|
||||
|
@ -2260,22 +2411,6 @@ window.CustomElements.addModule(function(scope) {
|
|||
});
|
||||
});
|
||||
}
|
||||
if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") {
|
||||
window.CustomEvent = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("CustomEvent");
|
||||
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
|
||||
e.preventDefault = function() {
|
||||
Object.defineProperty(this, "defaultPrevented", {
|
||||
get: function() {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
};
|
||||
return e;
|
||||
};
|
||||
window.CustomEvent.prototype = window.Event.prototype;
|
||||
}
|
||||
if (document.readyState === "complete" || scope.flags.eager) {
|
||||
bootstrap();
|
||||
} else if (document.readyState === "interactive" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) {
|
||||
|
@ -2286,119 +2421,6 @@ window.CustomElements.addModule(function(scope) {
|
|||
}
|
||||
})(window.CustomElements);
|
||||
|
||||
if (typeof HTMLTemplateElement === "undefined") {
|
||||
(function() {
|
||||
var TEMPLATE_TAG = "template";
|
||||
var contentDoc = document.implementation.createHTMLDocument("template");
|
||||
var canDecorate = true;
|
||||
HTMLTemplateElement = function() {};
|
||||
HTMLTemplateElement.prototype = Object.create(HTMLElement.prototype);
|
||||
HTMLTemplateElement.decorate = function(template) {
|
||||
if (!template.content) {
|
||||
template.content = contentDoc.createDocumentFragment();
|
||||
}
|
||||
var child;
|
||||
while (child = template.firstChild) {
|
||||
template.content.appendChild(child);
|
||||
}
|
||||
if (canDecorate) {
|
||||
try {
|
||||
Object.defineProperty(template, "innerHTML", {
|
||||
get: function() {
|
||||
var o = "";
|
||||
for (var e = this.content.firstChild; e; e = e.nextSibling) {
|
||||
o += e.outerHTML || escapeData(e.data);
|
||||
}
|
||||
return o;
|
||||
},
|
||||
set: function(text) {
|
||||
contentDoc.body.innerHTML = text;
|
||||
HTMLTemplateElement.bootstrap(contentDoc);
|
||||
while (this.content.firstChild) {
|
||||
this.content.removeChild(this.content.firstChild);
|
||||
}
|
||||
while (contentDoc.body.firstChild) {
|
||||
this.content.appendChild(contentDoc.body.firstChild);
|
||||
}
|
||||
},
|
||||
configurable: true
|
||||
});
|
||||
} catch (err) {
|
||||
canDecorate = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
HTMLTemplateElement.bootstrap = function(doc) {
|
||||
var templates = doc.querySelectorAll(TEMPLATE_TAG);
|
||||
for (var i = 0, l = templates.length, t; i < l && (t = templates[i]); i++) {
|
||||
HTMLTemplateElement.decorate(t);
|
||||
}
|
||||
};
|
||||
window.addEventListener("DOMContentLoaded", function() {
|
||||
HTMLTemplateElement.bootstrap(document);
|
||||
});
|
||||
var createElement = document.createElement;
|
||||
document.createElement = function() {
|
||||
"use strict";
|
||||
var el = createElement.apply(document, arguments);
|
||||
if (el.localName == "template") {
|
||||
HTMLTemplateElement.decorate(el);
|
||||
}
|
||||
return el;
|
||||
};
|
||||
var escapeDataRegExp = /[&\u00A0<>]/g;
|
||||
function escapeReplace(c) {
|
||||
switch (c) {
|
||||
case "&":
|
||||
return "&";
|
||||
|
||||
case "<":
|
||||
return "<";
|
||||
|
||||
case ">":
|
||||
return ">";
|
||||
|
||||
case " ":
|
||||
return " ";
|
||||
}
|
||||
}
|
||||
function escapeData(s) {
|
||||
return s.replace(escapeDataRegExp, escapeReplace);
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
(function(scope) {
|
||||
"use strict";
|
||||
if (!window.performance) {
|
||||
var start = Date.now();
|
||||
window.performance = {
|
||||
now: function() {
|
||||
return Date.now() - start;
|
||||
}
|
||||
};
|
||||
}
|
||||
if (!window.requestAnimationFrame) {
|
||||
window.requestAnimationFrame = function() {
|
||||
var nativeRaf = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
|
||||
return nativeRaf ? function(callback) {
|
||||
return nativeRaf(function() {
|
||||
callback(performance.now());
|
||||
});
|
||||
} : function(callback) {
|
||||
return window.setTimeout(callback, 1e3 / 60);
|
||||
};
|
||||
}();
|
||||
}
|
||||
if (!window.cancelAnimationFrame) {
|
||||
window.cancelAnimationFrame = function() {
|
||||
return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(id) {
|
||||
clearTimeout(id);
|
||||
};
|
||||
}();
|
||||
}
|
||||
})(window.WebComponents);
|
||||
|
||||
(function(scope) {
|
||||
var style = document.createElement("style");
|
||||
style.textContent = "" + "body {" + "transition: opacity ease-in 0.2s;" + " } \n" + "body[unresolved] {" + "opacity: 0; display: block; overflow: hidden; position: relative;" + " } \n";
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -7,13 +7,14 @@
|
|||
* 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.14
|
||||
window.WebComponents = window.WebComponents || {};
|
||||
|
||||
(function(scope) {
|
||||
var flags = scope.flags || {};
|
||||
// @version 0.7.19
|
||||
(function() {
|
||||
window.WebComponents = window.WebComponents || {
|
||||
flags: {}
|
||||
};
|
||||
var file = "webcomponents.js";
|
||||
var script = document.querySelector('script[src*="' + file + '"]');
|
||||
var flags = {};
|
||||
if (!flags.noOpts) {
|
||||
location.search.slice(1).split("&").forEach(function(option) {
|
||||
var parts = option.split("=");
|
||||
|
@ -51,8 +52,8 @@ window.WebComponents = window.WebComponents || {};
|
|||
};
|
||||
window.CustomElements.flags.register = flags.register;
|
||||
}
|
||||
scope.flags = flags;
|
||||
})(WebComponents);
|
||||
WebComponents.flags = flags;
|
||||
})();
|
||||
|
||||
if (WebComponents.flags.shadow) {
|
||||
if (typeof WeakMap === "undefined") {
|
||||
|
@ -1158,6 +1159,24 @@ if (WebComponents.flags.shadow) {
|
|||
stopImmediatePropagationTable.set(this, true);
|
||||
}
|
||||
};
|
||||
var supportsDefaultPrevented = function() {
|
||||
var e = document.createEvent("Event");
|
||||
e.initEvent("test", true, true);
|
||||
e.preventDefault();
|
||||
return e.defaultPrevented;
|
||||
}();
|
||||
if (!supportsDefaultPrevented) {
|
||||
Event.prototype.preventDefault = function() {
|
||||
if (!this.cancelable) return;
|
||||
unsafeUnwrap(this).preventDefault();
|
||||
Object.defineProperty(this, "defaultPrevented", {
|
||||
get: function() {
|
||||
return true;
|
||||
},
|
||||
configurable: true
|
||||
});
|
||||
};
|
||||
}
|
||||
registerWrapper(OriginalEvent, Event, document.createEvent("Event"));
|
||||
function unwrapOptions(options) {
|
||||
if (!options || !options.relatedTarget) return options;
|
||||
|
@ -2752,7 +2771,7 @@ if (WebComponents.flags.shadow) {
|
|||
enumerable: true
|
||||
});
|
||||
}
|
||||
[ "getBoundingClientRect", "getClientRects", "scrollIntoView" ].forEach(methodRequiresRendering);
|
||||
[ "focus", "getBoundingClientRect", "getClientRects", "scrollIntoView" ].forEach(methodRequiresRendering);
|
||||
registerWrapper(OriginalHTMLElement, HTMLElement, document.createElement("b"));
|
||||
scope.wrappers.HTMLElement = HTMLElement;
|
||||
scope.getInnerHTML = getInnerHTML;
|
||||
|
@ -3354,6 +3373,7 @@ if (WebComponents.flags.shadow) {
|
|||
var setInnerHTML = scope.setInnerHTML;
|
||||
var unsafeUnwrap = scope.unsafeUnwrap;
|
||||
var unwrap = scope.unwrap;
|
||||
var wrap = scope.wrap;
|
||||
var shadowHostTable = new WeakMap();
|
||||
var nextOlderShadowTreeTable = new WeakMap();
|
||||
function ShadowRoot(hostWrapper) {
|
||||
|
@ -3386,6 +3406,25 @@ if (WebComponents.flags.shadow) {
|
|||
},
|
||||
elementFromPoint: function(x, y) {
|
||||
return elementFromPoint(this, this.ownerDocument, x, y);
|
||||
},
|
||||
getSelection: function() {
|
||||
return document.getSelection();
|
||||
},
|
||||
get activeElement() {
|
||||
var unwrappedActiveElement = unwrap(this).ownerDocument.activeElement;
|
||||
if (!unwrappedActiveElement || !unwrappedActiveElement.nodeType) return null;
|
||||
var activeElement = wrap(unwrappedActiveElement);
|
||||
while (!this.contains(activeElement)) {
|
||||
while (activeElement.parentNode) {
|
||||
activeElement = activeElement.parentNode;
|
||||
}
|
||||
if (activeElement.host) {
|
||||
activeElement = activeElement.host;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return activeElement;
|
||||
}
|
||||
});
|
||||
scope.wrappers.ShadowRoot = ShadowRoot;
|
||||
|
@ -3973,7 +4012,7 @@ if (WebComponents.flags.shadow) {
|
|||
unsafeUnwrap(this).removeRange(unwrap(range));
|
||||
},
|
||||
selectAllChildren: function(node) {
|
||||
unsafeUnwrap(this).selectAllChildren(unwrapIfNeeded(node));
|
||||
unsafeUnwrap(this).selectAllChildren(node instanceof ShadowRoot ? unsafeUnwrap(node.host) : unwrapIfNeeded(node));
|
||||
},
|
||||
toString: function() {
|
||||
return unsafeUnwrap(this).toString();
|
||||
|
@ -4044,6 +4083,7 @@ if (WebComponents.flags.shadow) {
|
|||
var ShadowRoot = scope.wrappers.ShadowRoot;
|
||||
var TreeScope = scope.TreeScope;
|
||||
var cloneNode = scope.cloneNode;
|
||||
var defineGetter = scope.defineGetter;
|
||||
var defineWrapGetter = scope.defineWrapGetter;
|
||||
var elementFromPoint = scope.elementFromPoint;
|
||||
var forwardMethodsToWrapper = scope.forwardMethodsToWrapper;
|
||||
|
@ -4067,6 +4107,23 @@ if (WebComponents.flags.shadow) {
|
|||
defineWrapGetter(Document, "documentElement");
|
||||
defineWrapGetter(Document, "body");
|
||||
defineWrapGetter(Document, "head");
|
||||
defineGetter(Document, "activeElement", function() {
|
||||
var unwrappedActiveElement = unwrap(this).activeElement;
|
||||
if (!unwrappedActiveElement || !unwrappedActiveElement.nodeType) return null;
|
||||
var activeElement = wrap(unwrappedActiveElement);
|
||||
while (!this.contains(activeElement)) {
|
||||
var lastHost = activeElement;
|
||||
while (activeElement.parentNode) {
|
||||
activeElement = activeElement.parentNode;
|
||||
}
|
||||
if (activeElement.host) {
|
||||
activeElement = activeElement.host;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return activeElement;
|
||||
});
|
||||
function wrapMethod(name) {
|
||||
var original = document[name];
|
||||
Document.prototype[name] = function() {
|
||||
|
@ -5400,6 +5457,9 @@ if (WebComponents.flags.shadow) {
|
|||
})(self);
|
||||
|
||||
(function(global) {
|
||||
if (global.JsMutationObserver) {
|
||||
return;
|
||||
}
|
||||
var registrationsTable = new WeakMap();
|
||||
var setImmediate;
|
||||
if (/Trident|Edge/.test(navigator.userAgent)) {
|
||||
|
@ -5695,9 +5755,84 @@ if (WebComponents.flags.shadow) {
|
|||
}
|
||||
};
|
||||
global.JsMutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) {
|
||||
global.MutationObserver = JsMutationObserver;
|
||||
JsMutationObserver._isPolyfilled = true;
|
||||
}
|
||||
})(self);
|
||||
|
||||
(function(scope) {
|
||||
"use strict";
|
||||
if (!window.performance) {
|
||||
var start = Date.now();
|
||||
window.performance = {
|
||||
now: function() {
|
||||
return Date.now() - start;
|
||||
}
|
||||
};
|
||||
}
|
||||
if (!window.requestAnimationFrame) {
|
||||
window.requestAnimationFrame = function() {
|
||||
var nativeRaf = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
|
||||
return nativeRaf ? function(callback) {
|
||||
return nativeRaf(function() {
|
||||
callback(performance.now());
|
||||
});
|
||||
} : function(callback) {
|
||||
return window.setTimeout(callback, 1e3 / 60);
|
||||
};
|
||||
}();
|
||||
}
|
||||
if (!window.cancelAnimationFrame) {
|
||||
window.cancelAnimationFrame = function() {
|
||||
return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(id) {
|
||||
clearTimeout(id);
|
||||
};
|
||||
}();
|
||||
}
|
||||
var workingDefaultPrevented = function() {
|
||||
var e = document.createEvent("Event");
|
||||
e.initEvent("foo", true, true);
|
||||
e.preventDefault();
|
||||
return e.defaultPrevented;
|
||||
}();
|
||||
if (!workingDefaultPrevented) {
|
||||
var origPreventDefault = Event.prototype.preventDefault;
|
||||
Event.prototype.preventDefault = function() {
|
||||
if (!this.cancelable) {
|
||||
return;
|
||||
}
|
||||
origPreventDefault.call(this);
|
||||
Object.defineProperty(this, "defaultPrevented", {
|
||||
get: function() {
|
||||
return true;
|
||||
},
|
||||
configurable: true
|
||||
});
|
||||
};
|
||||
}
|
||||
var isIE = /Trident/.test(navigator.userAgent);
|
||||
if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") {
|
||||
window.CustomEvent = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("CustomEvent");
|
||||
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
|
||||
return e;
|
||||
};
|
||||
window.CustomEvent.prototype = window.Event.prototype;
|
||||
}
|
||||
if (!window.Event || isIE && typeof window.Event !== "function") {
|
||||
var origEvent = window.Event;
|
||||
window.Event = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("Event");
|
||||
e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable));
|
||||
return e;
|
||||
};
|
||||
window.Event.prototype = origEvent.prototype;
|
||||
}
|
||||
})(window.WebComponents);
|
||||
|
||||
window.HTMLImports = window.HTMLImports || {
|
||||
flags: {}
|
||||
};
|
||||
|
@ -5899,10 +6034,14 @@ window.HTMLImports.addModule(function(scope) {
|
|||
request.open("GET", url, xhr.async);
|
||||
request.addEventListener("readystatechange", function(e) {
|
||||
if (request.readyState === 4) {
|
||||
var locationHeader = request.getResponseHeader("Location");
|
||||
var redirectedUrl = null;
|
||||
if (locationHeader) {
|
||||
var redirectedUrl = locationHeader.substr(0, 1) === "/" ? location.origin + locationHeader : locationHeader;
|
||||
try {
|
||||
var locationHeader = request.getResponseHeader("Location");
|
||||
if (locationHeader) {
|
||||
redirectedUrl = locationHeader.substr(0, 1) === "/" ? location.origin + locationHeader : locationHeader;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
next.call(nextContext, !xhr.ok(request) && request, request.response || request.responseText, redirectedUrl);
|
||||
}
|
||||
|
@ -6416,22 +6555,6 @@ window.HTMLImports.addModule(function(scope) {
|
|||
if (scope.useNative) {
|
||||
return;
|
||||
}
|
||||
if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") {
|
||||
window.CustomEvent = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("CustomEvent");
|
||||
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
|
||||
e.preventDefault = function() {
|
||||
Object.defineProperty(this, "defaultPrevented", {
|
||||
get: function() {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
};
|
||||
return e;
|
||||
};
|
||||
window.CustomEvent.prototype = window.Event.prototype;
|
||||
}
|
||||
initializeModules();
|
||||
var rootDocument = scope.rootDocument;
|
||||
function bootstrap() {
|
||||
|
@ -6543,8 +6666,9 @@ window.CustomElements.addModule(function(scope) {
|
|||
}
|
||||
});
|
||||
}
|
||||
var hasPolyfillMutations = !window.MutationObserver || window.MutationObserver === window.JsMutationObserver;
|
||||
scope.hasPolyfillMutations = hasPolyfillMutations;
|
||||
var hasThrottledAttached = window.MutationObserver._isPolyfilled && flags["throttle-attached"];
|
||||
scope.hasPolyfillMutations = hasThrottledAttached;
|
||||
scope.hasThrottledAttached = hasThrottledAttached;
|
||||
var isPendingMutations = false;
|
||||
var pendingMutations = [];
|
||||
function deferMutation(fn) {
|
||||
|
@ -6563,7 +6687,7 @@ window.CustomElements.addModule(function(scope) {
|
|||
pendingMutations = [];
|
||||
}
|
||||
function attached(element) {
|
||||
if (hasPolyfillMutations) {
|
||||
if (hasThrottledAttached) {
|
||||
deferMutation(function() {
|
||||
_attached(element);
|
||||
});
|
||||
|
@ -6586,7 +6710,7 @@ window.CustomElements.addModule(function(scope) {
|
|||
});
|
||||
}
|
||||
function detached(element) {
|
||||
if (hasPolyfillMutations) {
|
||||
if (hasThrottledAttached) {
|
||||
deferMutation(function() {
|
||||
_detached(element);
|
||||
});
|
||||
|
@ -6713,6 +6837,11 @@ window.CustomElements.addModule(function(scope) {
|
|||
window.CustomElements.addModule(function(scope) {
|
||||
var flags = scope.flags;
|
||||
function upgrade(node, isAttached) {
|
||||
if (node.localName === "template") {
|
||||
if (window.HTMLTemplateElement && HTMLTemplateElement.decorate) {
|
||||
HTMLTemplateElement.decorate(node);
|
||||
}
|
||||
}
|
||||
if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
|
||||
var is = node.getAttribute("is");
|
||||
var definition = scope.getRegisteredDefinition(node.localName) || scope.getRegisteredDefinition(is);
|
||||
|
@ -7047,22 +7176,6 @@ window.CustomElements.addModule(function(scope) {
|
|||
});
|
||||
});
|
||||
}
|
||||
if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") {
|
||||
window.CustomEvent = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("CustomEvent");
|
||||
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
|
||||
e.preventDefault = function() {
|
||||
Object.defineProperty(this, "defaultPrevented", {
|
||||
get: function() {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
};
|
||||
return e;
|
||||
};
|
||||
window.CustomEvent.prototype = window.Event.prototype;
|
||||
}
|
||||
if (document.readyState === "complete" || scope.flags.eager) {
|
||||
bootstrap();
|
||||
} else if (document.readyState === "interactive" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) {
|
||||
|
@ -7087,37 +7200,6 @@ window.CustomElements.addModule(function(scope) {
|
|||
}
|
||||
})(window.WebComponents);
|
||||
|
||||
(function(scope) {
|
||||
"use strict";
|
||||
if (!window.performance) {
|
||||
var start = Date.now();
|
||||
window.performance = {
|
||||
now: function() {
|
||||
return Date.now() - start;
|
||||
}
|
||||
};
|
||||
}
|
||||
if (!window.requestAnimationFrame) {
|
||||
window.requestAnimationFrame = function() {
|
||||
var nativeRaf = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
|
||||
return nativeRaf ? function(callback) {
|
||||
return nativeRaf(function() {
|
||||
callback(performance.now());
|
||||
});
|
||||
} : function(callback) {
|
||||
return window.setTimeout(callback, 1e3 / 60);
|
||||
};
|
||||
}();
|
||||
}
|
||||
if (!window.cancelAnimationFrame) {
|
||||
window.cancelAnimationFrame = function() {
|
||||
return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(id) {
|
||||
clearTimeout(id);
|
||||
};
|
||||
}();
|
||||
}
|
||||
})(window.WebComponents);
|
||||
|
||||
(function(scope) {
|
||||
var style = document.createElement("style");
|
||||
style.textContent = "" + "body {" + "transition: opacity ease-in 0.2s;" + " } \n" + "body[unresolved] {" + "opacity: 0; display: block; overflow: hidden; position: relative;" + " } \n";
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue