mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update polymer
This commit is contained in:
parent
dbf135beac
commit
2a2b9b7fe5
32 changed files with 322 additions and 172 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "polymer",
|
||||
"version": "1.0.9",
|
||||
"version": "1.1.0",
|
||||
"main": [
|
||||
"polymer.html"
|
||||
],
|
||||
|
@ -24,11 +24,11 @@
|
|||
},
|
||||
"private": true,
|
||||
"homepage": "https://github.com/Polymer/polymer",
|
||||
"_release": "1.0.9",
|
||||
"_release": "1.1.0",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.9",
|
||||
"commit": "8e894841ae36be85bade4b42f858ccb99b770e5d"
|
||||
"tag": "v1.1.0",
|
||||
"commit": "67fb2f85fd66d8556fc07cf1dec41ff5273fa68a"
|
||||
},
|
||||
"_source": "git://github.com/Polymer/polymer.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "polymer",
|
||||
"version": "1.0.9",
|
||||
"version": "1.1.0",
|
||||
"main": [
|
||||
"polymer.html"
|
||||
],
|
||||
|
|
|
@ -247,19 +247,14 @@ return m;
|
|||
}
|
||||
});
|
||||
var cePolyfill = window.CustomElements && !CustomElements.useNative;
|
||||
if (cePolyfill) {
|
||||
var ready = CustomElements.ready;
|
||||
CustomElements.ready = true;
|
||||
}
|
||||
document.registerElement('dom-module', DomModule);
|
||||
if (cePolyfill) {
|
||||
CustomElements.ready = ready;
|
||||
}
|
||||
function forceDocumentUpgrade() {
|
||||
if (cePolyfill) {
|
||||
var script = document._currentScript || document.currentScript;
|
||||
if (script) {
|
||||
CustomElements.upgradeAll(script.ownerDocument);
|
||||
var doc = script && script.ownerDocument;
|
||||
if (doc && !doc.__customElementsForceUpgraded) {
|
||||
doc.__customElementsForceUpgraded = true;
|
||||
CustomElements.upgradeAll(doc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -563,7 +558,7 @@ debouncer.stop();
|
|||
}
|
||||
}
|
||||
});
|
||||
Polymer.version = '1.0.9';
|
||||
Polymer.version = '1.1.0';
|
||||
Polymer.Base._addFeature({
|
||||
_registerFeatures: function () {
|
||||
this._prepIs();
|
||||
|
|
|
@ -458,11 +458,14 @@ Polymer.dom.addDebouncer(host.debounce('_distribute', host._distributeContent));
|
|||
},
|
||||
appendChild: function (node) {
|
||||
var handled;
|
||||
this._ensureContentLogicalInfo(node);
|
||||
this._removeNodeFromHost(node, true);
|
||||
if (this._nodeIsInLogicalTree(this.node)) {
|
||||
this._addLogicalInfo(node, this.node);
|
||||
this._addNodeToHost(node);
|
||||
handled = this._maybeDistribute(node, this.node);
|
||||
} else {
|
||||
this._addNodeToHost(node);
|
||||
}
|
||||
if (!handled && !this._tryRemoveUndistributedNode(node)) {
|
||||
var container = this.node._isShadyRoot ? this.node.host : this.node;
|
||||
|
@ -476,9 +479,9 @@ if (!ref_node) {
|
|||
return this.appendChild(node);
|
||||
}
|
||||
var handled;
|
||||
this._ensureContentLogicalInfo(node);
|
||||
this._removeNodeFromHost(node, true);
|
||||
if (this._nodeIsInLogicalTree(this.node)) {
|
||||
saveLightChildrenIfNeeded(this.node);
|
||||
var children = this.childNodes;
|
||||
var index = children.indexOf(ref_node);
|
||||
if (index < 0) {
|
||||
|
@ -487,6 +490,8 @@ throw Error('The ref_node to be inserted before is not a child ' + 'of this node
|
|||
this._addLogicalInfo(node, this.node, index);
|
||||
this._addNodeToHost(node);
|
||||
handled = this._maybeDistribute(node, this.node);
|
||||
} else {
|
||||
this._addNodeToHost(node);
|
||||
}
|
||||
if (!handled && !this._tryRemoveUndistributedNode(node)) {
|
||||
ref_node = ref_node.localName === CONTENT ? this._firstComposedNode(ref_node) : ref_node;
|
||||
|
@ -504,6 +509,8 @@ var handled;
|
|||
if (this._nodeIsInLogicalTree(this.node)) {
|
||||
this._removeNodeFromHost(node);
|
||||
handled = this._maybeDistribute(node, this.node);
|
||||
} else {
|
||||
this._removeNodeFromHost(node);
|
||||
}
|
||||
if (!handled) {
|
||||
var container = this.node._isShadyRoot ? this.node.host : this.node;
|
||||
|
@ -572,10 +579,27 @@ return true;
|
|||
}
|
||||
},
|
||||
_updateInsertionPoints: function (host) {
|
||||
host.shadyRoot._insertionPoints = factory(host.shadyRoot).querySelectorAll(CONTENT);
|
||||
var i$ = host.shadyRoot._insertionPoints = factory(host.shadyRoot).querySelectorAll(CONTENT);
|
||||
for (var i = 0, c; i < i$.length; i++) {
|
||||
c = i$[i];
|
||||
saveLightChildrenIfNeeded(c);
|
||||
saveLightChildrenIfNeeded(factory(c).parentNode);
|
||||
}
|
||||
},
|
||||
_nodeIsInLogicalTree: function (node) {
|
||||
return Boolean(node._lightParent !== undefined || node._isShadyRoot || this._ownerShadyRootForNode(node) || node.shadyRoot);
|
||||
return Boolean(node._lightParent !== undefined || node._isShadyRoot || node.shadyRoot);
|
||||
},
|
||||
_ensureContentLogicalInfo: function (node) {
|
||||
if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
|
||||
saveLightChildrenIfNeeded(this.node);
|
||||
var c$ = Array.prototype.slice.call(node.childNodes);
|
||||
for (var i = 0, n; i < c$.length && (n = c$[i]); i++) {
|
||||
this._ensureContentLogicalInfo(n);
|
||||
}
|
||||
} else if (node.localName === CONTENT) {
|
||||
saveLightChildrenIfNeeded(this.node);
|
||||
saveLightChildrenIfNeeded(node);
|
||||
}
|
||||
},
|
||||
_parentNeedsDistribution: function (parent) {
|
||||
return parent && parent.shadyRoot && hasInsertionPoint(parent.shadyRoot);
|
||||
|
@ -629,14 +653,12 @@ node = factory(node).parentNode;
|
|||
}
|
||||
},
|
||||
_addNodeToHost: function (node) {
|
||||
var checkNode = node.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? node.firstChild : node;
|
||||
var root = this._ownerShadyRootForNode(checkNode);
|
||||
var root = this.getOwnerRoot();
|
||||
if (root) {
|
||||
root.host._elementAdd(node);
|
||||
}
|
||||
},
|
||||
_addLogicalInfo: function (node, container, index) {
|
||||
saveLightChildrenIfNeeded(container);
|
||||
var children = factory(container).childNodes;
|
||||
index = index === undefined ? children.length : index;
|
||||
if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
|
||||
|
@ -1163,8 +1185,13 @@ this.shadyRoot = this.root;
|
|||
this.shadyRoot._distributionClean = false;
|
||||
this.shadyRoot._isShadyRoot = true;
|
||||
this.shadyRoot._dirtyRoots = [];
|
||||
this.shadyRoot._insertionPoints = !this._notes || this._notes._hasContent ? this.shadyRoot.querySelectorAll('content') : [];
|
||||
var i$ = this.shadyRoot._insertionPoints = !this._notes || this._notes._hasContent ? this.shadyRoot.querySelectorAll('content') : [];
|
||||
saveLightChildrenIfNeeded(this.shadyRoot);
|
||||
for (var i = 0, c; i < i$.length; i++) {
|
||||
c = i$[i];
|
||||
saveLightChildrenIfNeeded(c);
|
||||
saveLightChildrenIfNeeded(c.parentNode);
|
||||
}
|
||||
this.shadyRoot.host = this;
|
||||
},
|
||||
get domHost() {
|
||||
|
@ -1399,14 +1426,12 @@ if (newChildParent !== parentNode) {
|
|||
removeFromComposedParent(newChildParent, newChild);
|
||||
}
|
||||
remove(newChild);
|
||||
saveLightChildrenIfNeeded(parentNode);
|
||||
nativeInsertBefore.call(parentNode, newChild, refChild || null);
|
||||
newChild._composedParent = parentNode;
|
||||
}
|
||||
function remove(node) {
|
||||
var parentNode = getComposedParent(node);
|
||||
if (parentNode) {
|
||||
saveLightChildrenIfNeeded(parentNode);
|
||||
node._composedParent = null;
|
||||
nativeRemoveChild.call(parentNode, node);
|
||||
}
|
||||
|
|
115
dashboard-ui/bower_components/polymer/polymer.html
vendored
115
dashboard-ui/bower_components/polymer/polymer.html
vendored
|
@ -637,8 +637,7 @@ prevent = dy > dx;
|
|||
prevent = dx > dy;
|
||||
}
|
||||
if (prevent) {
|
||||
// This prevents horizontal scrolling in safari
|
||||
//ev.preventDefault();
|
||||
ev.preventDefault();
|
||||
} else {
|
||||
Gestures.prevent('track');
|
||||
}
|
||||
|
@ -2187,7 +2186,7 @@ MIXIN_RULE: 1000
|
|||
OPEN_BRACE: '{',
|
||||
CLOSE_BRACE: '}',
|
||||
_rx: {
|
||||
comments: /\/\*[^*]*\*+([^\/*][^*]*\*+)*\//gim,
|
||||
comments: /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,
|
||||
port: /@import[^;]*;/gim,
|
||||
customProp: /(?:^|[\s;])--[^;{]*?:[^{};]*?(?:[;\n]|$)/gim,
|
||||
mixinProp: /(?:^|[\s;])--[^;{]*?:[^{;]*?{[^}]*?}(?:[;\n]|$)?/gim,
|
||||
|
@ -2203,7 +2202,8 @@ return api;
|
|||
}();
|
||||
Polymer.StyleUtil = function () {
|
||||
return {
|
||||
MODULE_STYLES_SELECTOR: 'style, link[rel=import][type~=css]',
|
||||
MODULE_STYLES_SELECTOR: 'style, link[rel=import][type~=css], template',
|
||||
INCLUDE_ATTR: 'include',
|
||||
toCssText: function (rules, callback, preserveProperties) {
|
||||
if (typeof rules === 'string') {
|
||||
rules = this.parser.parse(rules);
|
||||
|
@ -2258,27 +2258,52 @@ afterNode = n$[n$.length - 1];
|
|||
target.insertBefore(style, afterNode && afterNode.nextSibling || target.firstChild);
|
||||
return style;
|
||||
},
|
||||
cssFromModules: function (moduleIds) {
|
||||
var modules = moduleIds.trim().split(' ');
|
||||
var cssText = '';
|
||||
for (var i = 0; i < modules.length; i++) {
|
||||
cssText += this.cssFromModule(modules[i]);
|
||||
}
|
||||
return cssText;
|
||||
},
|
||||
cssFromModule: function (moduleId) {
|
||||
var m = Polymer.DomModule.import(moduleId);
|
||||
if (m && !m._cssText) {
|
||||
m._cssText = this._cssFromElement(m);
|
||||
}
|
||||
return m && m._cssText || '';
|
||||
},
|
||||
_cssFromElement: function (element) {
|
||||
var cssText = '';
|
||||
var e$ = Array.prototype.slice.call(m.querySelectorAll(this.MODULE_STYLES_SELECTOR));
|
||||
for (var i = 0, e; i < e$.length; i++) {
|
||||
var content = element.content || element;
|
||||
var sourceDoc = element.ownerDocument;
|
||||
var e$ = Array.prototype.slice.call(content.querySelectorAll(this.MODULE_STYLES_SELECTOR));
|
||||
for (var i = 0, e, resolveDoc, addModule; i < e$.length; i++) {
|
||||
e = e$[i];
|
||||
resolveDoc = sourceDoc;
|
||||
addModule = null;
|
||||
if (e.localName === 'template') {
|
||||
cssText += this._cssFromElement(e);
|
||||
} else {
|
||||
if (e.localName === 'style') {
|
||||
addModule = e.getAttribute(this.INCLUDE_ATTR);
|
||||
e = e.__appliedElement || e;
|
||||
e.parentNode.removeChild(e);
|
||||
} else {
|
||||
e = e.import && e.import.body;
|
||||
resolveDoc = e.ownerDocument;
|
||||
}
|
||||
if (e) {
|
||||
cssText += Polymer.ResolveUrl.resolveCss(e.textContent, e.ownerDocument);
|
||||
cssText += this.resolveCss(e.textContent, resolveDoc);
|
||||
}
|
||||
}
|
||||
m._cssText = cssText;
|
||||
if (addModule) {
|
||||
cssText += this.cssFromModules(addModule);
|
||||
}
|
||||
return m && m._cssText || '';
|
||||
}
|
||||
return cssText;
|
||||
},
|
||||
resolveCss: Polymer.ResolveUrl.resolveCss,
|
||||
parser: Polymer.CssParse,
|
||||
ruleTypes: Polymer.CssParse.types
|
||||
};
|
||||
|
@ -3179,7 +3204,8 @@ var styleTransformer = Polymer.StyleTransformer;
|
|||
Polymer({
|
||||
is: 'custom-style',
|
||||
extends: 'style',
|
||||
created: function () {
|
||||
properties: { include: String },
|
||||
ready: function () {
|
||||
this._tryApply();
|
||||
},
|
||||
attached: function () {
|
||||
|
@ -3191,7 +3217,7 @@ if (this.parentNode && this.parentNode.localName !== 'dom-module') {
|
|||
this._appliesToDocument = true;
|
||||
var e = this.__appliedElement || this;
|
||||
styleDefaults.addStyle(e);
|
||||
if (e.textContent) {
|
||||
if (e.textContent || this.include) {
|
||||
this._apply();
|
||||
} else {
|
||||
var observer = new MutationObserver(function () {
|
||||
|
@ -3205,6 +3231,9 @@ observer.observe(e, { childList: true });
|
|||
},
|
||||
_apply: function () {
|
||||
var e = this.__appliedElement || this;
|
||||
if (this.include) {
|
||||
e.textContent += styleUtil.cssFromModules(this.include);
|
||||
}
|
||||
this._computeStyleProperties();
|
||||
var props = this._styleProperties;
|
||||
var self = this;
|
||||
|
@ -3542,29 +3571,36 @@ items.push(store[key]);
|
|||
return items;
|
||||
},
|
||||
_applySplices: function (splices) {
|
||||
var keySplices = [];
|
||||
for (var i = 0; i < splices.length; i++) {
|
||||
var j, o, key, s = splices[i];
|
||||
var keyMap = {}, key, i;
|
||||
splices.forEach(function (s) {
|
||||
s.addedKeys = [];
|
||||
for (i = 0; i < s.removed.length; i++) {
|
||||
key = this.getKey(s.removed[i]);
|
||||
keyMap[key] = keyMap[key] ? null : -1;
|
||||
}
|
||||
for (i = 0; i < s.addedCount; i++) {
|
||||
var item = this.userArray[s.index + i];
|
||||
key = this.getKey(item);
|
||||
key = key === undefined ? this.add(item) : key;
|
||||
keyMap[key] = keyMap[key] ? null : 1;
|
||||
s.addedKeys.push(key);
|
||||
}
|
||||
}, this);
|
||||
var removed = [];
|
||||
for (j = 0; j < s.removed.length; j++) {
|
||||
o = s.removed[j];
|
||||
key = this.remove(o);
|
||||
var added = [];
|
||||
for (var key in keyMap) {
|
||||
if (keyMap[key] < 0) {
|
||||
this.removeKey(key);
|
||||
removed.push(key);
|
||||
}
|
||||
var added = [];
|
||||
for (j = 0; j < s.addedCount; j++) {
|
||||
o = this.userArray[s.index + j];
|
||||
key = this.add(o);
|
||||
if (keyMap[key] > 0) {
|
||||
added.push(key);
|
||||
}
|
||||
keySplices.push({
|
||||
index: s.index,
|
||||
removed: removed,
|
||||
removedItems: s.removed,
|
||||
added: added
|
||||
});
|
||||
}
|
||||
return keySplices;
|
||||
return [{
|
||||
removed: removed,
|
||||
added: added
|
||||
}];
|
||||
}
|
||||
};
|
||||
Polymer.Collection.get = function (userArray) {
|
||||
|
@ -3659,11 +3695,13 @@ this.collection = null;
|
|||
} else {
|
||||
this._error(this._logf('dom-repeat', 'expected array for `items`,' + ' found', this.items));
|
||||
}
|
||||
this._splices = [];
|
||||
this._keySplices = [];
|
||||
this._indexSplices = [];
|
||||
this._needFullRefresh = true;
|
||||
this._debounceTemplate(this._render);
|
||||
} else if (change.path == 'items.splices') {
|
||||
this._splices = this._splices.concat(change.value.keySplices);
|
||||
this._keySplices = this._keySplices.concat(change.value.keySplices);
|
||||
this._indexSplices = this._indexSplices.concat(change.value.indexSplices);
|
||||
this._debounceTemplate(this._render);
|
||||
} else {
|
||||
var subpath = change.path.slice(6);
|
||||
|
@ -3700,16 +3738,17 @@ this._applyFullRefresh();
|
|||
this._needFullRefresh = false;
|
||||
} else {
|
||||
if (this._sortFn) {
|
||||
this._applySplicesUserSort(this._splices);
|
||||
this._applySplicesUserSort(this._keySplices);
|
||||
} else {
|
||||
if (this._filterFn) {
|
||||
this._applyFullRefresh();
|
||||
} else {
|
||||
this._applySplicesArrayOrder(this._splices);
|
||||
this._applySplicesArrayOrder(this._indexSplices);
|
||||
}
|
||||
}
|
||||
}
|
||||
this._splices = [];
|
||||
this._keySplices = [];
|
||||
this._indexSplices = [];
|
||||
var keyToIdx = this._keyToInstIdx = {};
|
||||
for (var i = 0; i < this._instances.length; i++) {
|
||||
var inst = this._instances[i];
|
||||
|
@ -3847,10 +3886,10 @@ pool.push(inst);
|
|||
}
|
||||
}
|
||||
this._instances.splice(s.index, s.removed.length);
|
||||
for (var i = 0; i < s.added.length; i++) {
|
||||
for (var i = 0; i < s.addedKeys.length; i++) {
|
||||
var inst = {
|
||||
isPlaceholder: true,
|
||||
key: s.added[i]
|
||||
key: s.addedKeys[i]
|
||||
};
|
||||
this._instances.splice(s.index + i, 0, inst);
|
||||
}
|
||||
|
@ -3959,12 +3998,12 @@ is: 'array-selector',
|
|||
properties: {
|
||||
items: {
|
||||
type: Array,
|
||||
observer: '_resetSelection'
|
||||
observer: 'clearSelection'
|
||||
},
|
||||
multi: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
observer: '_resetSelection'
|
||||
observer: 'clearSelection'
|
||||
},
|
||||
selected: {
|
||||
type: Object,
|
||||
|
@ -3975,7 +4014,7 @@ type: Boolean,
|
|||
value: false
|
||||
}
|
||||
},
|
||||
_resetSelection: function () {
|
||||
clearSelection: function () {
|
||||
if (Array.isArray(this.selected)) {
|
||||
for (var i = 0; i < this.selected.length; i++) {
|
||||
this.unlinkPaths('selected.' + i);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue