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
568fabb9ca
commit
319d838d6e
48 changed files with 3045 additions and 2348 deletions
|
@ -98,6 +98,14 @@
|
||||||
return deviceId;
|
return deviceId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
self.appName = function () {
|
||||||
|
return clientName;
|
||||||
|
};
|
||||||
|
|
||||||
|
self.appVersion = function () {
|
||||||
|
return applicationVersion;
|
||||||
|
};
|
||||||
|
|
||||||
self.clearAuthenticationInfo = function () {
|
self.clearAuthenticationInfo = function () {
|
||||||
self.setAuthenticationInfo(null, null);
|
self.setAuthenticationInfo(null, null);
|
||||||
};
|
};
|
||||||
|
@ -138,7 +146,7 @@
|
||||||
}]);
|
}]);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.setRequestHeaders = function(headers) {
|
self.setRequestHeaders = function (headers) {
|
||||||
|
|
||||||
var currentServerInfo = self.serverInfo();
|
var currentServerInfo = self.serverInfo();
|
||||||
|
|
||||||
|
@ -173,7 +181,7 @@
|
||||||
|
|
||||||
if (includeAuthorization !== false) {
|
if (includeAuthorization !== false) {
|
||||||
|
|
||||||
request.headers = {};
|
request.headers = request.headers || {};
|
||||||
self.setRequestHeaders(request.headers);
|
self.setRequestHeaders(request.headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -500,8 +508,8 @@
|
||||||
self.get(url).done(function () {
|
self.get(url).done(function () {
|
||||||
|
|
||||||
var responseTime = new Date().getTime() - now;
|
var responseTime = new Date().getTime() - now;
|
||||||
responseTime /= 1000;
|
|
||||||
var bytesPerSecond = byteSize / responseTime;
|
var bytesPerSecond = byteSize / responseTime;
|
||||||
|
bytesPerSecond *= 1000;
|
||||||
|
|
||||||
deferred.resolveWith(null, [bytesPerSecond]);
|
deferred.resolveWith(null, [bytesPerSecond]);
|
||||||
|
|
||||||
|
|
|
@ -25,14 +25,14 @@
|
||||||
"web-component-tester": "*",
|
"web-component-tester": "*",
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/polymerelements/iron-meta",
|
"homepage": "https://github.com/PolymerElements/iron-meta",
|
||||||
"_release": "1.0.3",
|
"_release": "1.0.3",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.0.3",
|
"tag": "v1.0.3",
|
||||||
"commit": "91529259262b0d8f33fed44bc3fd47aedf35cb04"
|
"commit": "91529259262b0d8f33fed44bc3fd47aedf35cb04"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/polymerelements/iron-meta.git",
|
"_source": "git://github.com/PolymerElements/iron-meta.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
"_originalSource": "polymerelements/iron-meta"
|
"_originalSource": "PolymerElements/iron-meta"
|
||||||
}
|
}
|
|
@ -28,14 +28,14 @@
|
||||||
"web-component-tester": "*",
|
"web-component-tester": "*",
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/PolymerElements/iron-selector",
|
"homepage": "https://github.com/polymerelements/iron-selector",
|
||||||
"_release": "1.0.2",
|
"_release": "1.0.2",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.0.2",
|
"tag": "v1.0.2",
|
||||||
"commit": "ea22d91d11ba6f72c01faa952d5e600f9d1773cf"
|
"commit": "ea22d91d11ba6f72c01faa952d5e600f9d1773cf"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/PolymerElements/iron-selector.git",
|
"_source": "git://github.com/polymerelements/iron-selector.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
"_originalSource": "PolymerElements/iron-selector"
|
"_originalSource": "polymerelements/iron-selector"
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "paper-drawer-panel",
|
"name": "paper-drawer-panel",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"description": "A responsive drawer panel",
|
"description": "A responsive drawer panel",
|
||||||
"authors": [
|
"authors": [
|
||||||
"The Polymer Authors"
|
"The Polymer Authors"
|
||||||
|
@ -30,14 +30,13 @@
|
||||||
"web-component-tester": "*",
|
"web-component-tester": "*",
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||||
},
|
},
|
||||||
"_release": "1.0.2",
|
"_release": "1.0.3",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.0.2",
|
"tag": "v1.0.3",
|
||||||
"commit": "691739c877914f7231eaca16b724bdca295dfe8d"
|
"commit": "92713b61eb8eec378db63af61b73341453b8180d"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/PolymerElements/paper-drawer-panel.git",
|
"_source": "git://github.com/PolymerElements/paper-drawer-panel.git",
|
||||||
"_target": "~1.0.2",
|
"_target": "~1.0.2",
|
||||||
"_originalSource": "PolymerElements/paper-drawer-panel",
|
"_originalSource": "PolymerElements/paper-drawer-panel"
|
||||||
"_direct": true
|
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "paper-drawer-panel",
|
"name": "paper-drawer-panel",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"description": "A responsive drawer panel",
|
"description": "A responsive drawer panel",
|
||||||
"authors": [
|
"authors": [
|
||||||
"The Polymer Authors"
|
"The Polymer Authors"
|
||||||
|
|
|
@ -16,10 +16,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
|
||||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||||
|
|
||||||
<link rel="import" href="../../paper-styles/paper-styles.html">
|
<link rel="import" href="../../paper-styles/demo-pages.html">
|
||||||
<link rel="stylesheet" href="../../paper-styles/demo.css">
|
|
||||||
|
|
||||||
<link rel="import" href="../../paper-button/paper-button.html">
|
<link rel="import" href="../../paper-button/paper-button.html">
|
||||||
<link rel="import" href="../paper-drawer-panel.html">
|
<link rel="import" href="../paper-drawer-panel.html">
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -34,7 +34,7 @@
|
||||||
"tag": "v1.0.7",
|
"tag": "v1.0.7",
|
||||||
"commit": "c65f5ce6b898bb756fca35cedaa53c3e8011abeb"
|
"commit": "c65f5ce6b898bb756fca35cedaa53c3e8011abeb"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/polymerelements/paper-styles.git",
|
"_source": "git://github.com/PolymerElements/paper-styles.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
"_originalSource": "polymerelements/paper-styles"
|
"_originalSource": "PolymerElements/paper-styles"
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "polymer",
|
"name": "polymer",
|
||||||
"version": "1.0.5",
|
"version": "1.0.6",
|
||||||
"main": [
|
"main": [
|
||||||
"polymer.html"
|
"polymer.html"
|
||||||
],
|
],
|
||||||
|
@ -24,11 +24,11 @@
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://github.com/Polymer/polymer",
|
"homepage": "https://github.com/Polymer/polymer",
|
||||||
"_release": "1.0.5",
|
"_release": "1.0.6",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.0.5",
|
"tag": "v1.0.6",
|
||||||
"commit": "b93f076d7b2606733d7166f311b77550deb98a39"
|
"commit": "953fcba374812690c279abdacbfaf61e3e3aa347"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/Polymer/polymer.git",
|
"_source": "git://github.com/Polymer/polymer.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "polymer",
|
"name": "polymer",
|
||||||
"version": "1.0.5",
|
"version": "1.0.6",
|
||||||
"main": [
|
"main": [
|
||||||
"polymer.html"
|
"polymer.html"
|
||||||
],
|
],
|
||||||
|
|
|
@ -506,7 +506,7 @@ debouncer.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Polymer.version = '1.0.5';
|
Polymer.version = '1.0.6';
|
||||||
Polymer.Base._addFeature({
|
Polymer.Base._addFeature({
|
||||||
_registerFeatures: function () {
|
_registerFeatures: function () {
|
||||||
this._prepIs();
|
this._prepIs();
|
||||||
|
|
|
@ -426,6 +426,8 @@ var getInnerHTML = Polymer.domInnerHTML.getInnerHTML;
|
||||||
var nativeInsertBefore = Element.prototype.insertBefore;
|
var nativeInsertBefore = Element.prototype.insertBefore;
|
||||||
var nativeRemoveChild = Element.prototype.removeChild;
|
var nativeRemoveChild = Element.prototype.removeChild;
|
||||||
var nativeAppendChild = Element.prototype.appendChild;
|
var nativeAppendChild = Element.prototype.appendChild;
|
||||||
|
var nativeCloneNode = Element.prototype.cloneNode;
|
||||||
|
var nativeImportNode = Document.prototype.importNode;
|
||||||
var dirtyRoots = [];
|
var dirtyRoots = [];
|
||||||
var DomApi = function (node) {
|
var DomApi = function (node) {
|
||||||
this.node = node;
|
this.node = node;
|
||||||
|
@ -554,8 +556,8 @@ return parentNeedsDist || hasContent && !wrappedContent;
|
||||||
},
|
},
|
||||||
_tryRemoveUndistributedNode: function (node) {
|
_tryRemoveUndistributedNode: function (node) {
|
||||||
if (this.node.shadyRoot) {
|
if (this.node.shadyRoot) {
|
||||||
if (node.parentNode) {
|
if (node._composedParent) {
|
||||||
nativeRemoveChild.call(node.parentNode, node);
|
nativeRemoveChild.call(node._composedParent, node);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -564,7 +566,7 @@ _updateInsertionPoints: function (host) {
|
||||||
host.shadyRoot._insertionPoints = factory(host.shadyRoot).querySelectorAll(CONTENT);
|
host.shadyRoot._insertionPoints = factory(host.shadyRoot).querySelectorAll(CONTENT);
|
||||||
},
|
},
|
||||||
_nodeIsInLogicalTree: function (node) {
|
_nodeIsInLogicalTree: function (node) {
|
||||||
return Boolean(node._lightParent || node._isShadyRoot || this._ownerShadyRootForNode(node) || node.shadyRoot);
|
return Boolean(node._lightParent !== undefined || node._isShadyRoot || this._ownerShadyRootForNode(node) || node.shadyRoot);
|
||||||
},
|
},
|
||||||
_parentNeedsDistribution: function (parent) {
|
_parentNeedsDistribution: function (parent) {
|
||||||
return parent && parent.shadyRoot && hasInsertionPoint(parent.shadyRoot);
|
return parent && parent.shadyRoot && hasInsertionPoint(parent.shadyRoot);
|
||||||
|
@ -737,6 +739,31 @@ _distributeParent: function () {
|
||||||
if (this._parentNeedsDistribution(this.parentNode)) {
|
if (this._parentNeedsDistribution(this.parentNode)) {
|
||||||
this._lazyDistribute(this.parentNode);
|
this._lazyDistribute(this.parentNode);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
cloneNode: function (deep) {
|
||||||
|
var n = nativeCloneNode.call(this.node, false);
|
||||||
|
if (deep) {
|
||||||
|
var c$ = this.childNodes;
|
||||||
|
var d = factory(n);
|
||||||
|
for (var i = 0, nc; i < c$.length; i++) {
|
||||||
|
nc = factory(c$[i]).cloneNode(true);
|
||||||
|
d.appendChild(nc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return n;
|
||||||
|
},
|
||||||
|
importNode: function (externalNode, deep) {
|
||||||
|
var doc = this.node instanceof HTMLDocument ? this.node : this.node.ownerDocument;
|
||||||
|
var n = nativeImportNode.call(doc, externalNode, false);
|
||||||
|
if (deep) {
|
||||||
|
var c$ = factory(externalNode).childNodes;
|
||||||
|
var d = factory(n);
|
||||||
|
for (var i = 0, nc; i < c$.length; i++) {
|
||||||
|
nc = factory(doc).importNode(c$[i], true);
|
||||||
|
d.appendChild(nc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return n;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Object.defineProperty(DomApi.prototype, 'classList', {
|
Object.defineProperty(DomApi.prototype, 'classList', {
|
||||||
|
@ -885,8 +912,9 @@ if (this.node.nodeType !== Node.TEXT_NODE) {
|
||||||
this._clear();
|
this._clear();
|
||||||
var d = document.createElement('div');
|
var d = document.createElement('div');
|
||||||
d.innerHTML = text;
|
d.innerHTML = text;
|
||||||
for (var e = d.firstChild; e; e = e.nextSibling) {
|
var c$ = Array.prototype.slice.call(d.childNodes);
|
||||||
this.appendChild(e);
|
for (var i = 0; i < c$.length; i++) {
|
||||||
|
this.appendChild(c$[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -909,6 +937,13 @@ return n;
|
||||||
n = n.parentNode;
|
n = n.parentNode;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
DomApi.prototype.cloneNode = function (deep) {
|
||||||
|
return this.node.cloneNode(deep);
|
||||||
|
};
|
||||||
|
DomApi.prototype.importNode = function (externalNode, deep) {
|
||||||
|
var doc = this.node instanceof HTMLDocument ? this.node : this.node.ownerDocument;
|
||||||
|
return doc.importNode(externalNode, deep);
|
||||||
|
};
|
||||||
DomApi.prototype.getDestinationInsertionPoints = function () {
|
DomApi.prototype.getDestinationInsertionPoints = function () {
|
||||||
var n$ = this.node.getDestinationInsertionPoints();
|
var n$ = this.node.getDestinationInsertionPoints();
|
||||||
return n$ ? Array.prototype.slice.call(n$) : [];
|
return n$ ? Array.prototype.slice.call(n$) : [];
|
||||||
|
|
137
dashboard-ui/bower_components/polymer/polymer.html
vendored
137
dashboard-ui/bower_components/polymer/polymer.html
vendored
|
@ -416,6 +416,7 @@ var MOUSE_EVENTS = [
|
||||||
'mouseup',
|
'mouseup',
|
||||||
'click'
|
'click'
|
||||||
];
|
];
|
||||||
|
var IS_TOUCH_ONLY = navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/);
|
||||||
var mouseCanceller = function (mouseEvent) {
|
var mouseCanceller = function (mouseEvent) {
|
||||||
mouseEvent[HANDLED_OBJ] = { skip: true };
|
mouseEvent[HANDLED_OBJ] = { skip: true };
|
||||||
if (mouseEvent.type === 'click') {
|
if (mouseEvent.type === 'click') {
|
||||||
|
@ -440,6 +441,9 @@ document.removeEventListener(en, mouseCanceller, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function ignoreMouse() {
|
function ignoreMouse() {
|
||||||
|
if (IS_TOUCH_ONLY) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!POINTERSTATE.mouse.mouseIgnoreJob) {
|
if (!POINTERSTATE.mouse.mouseIgnoreJob) {
|
||||||
setupTeardownMouseCanceller(true);
|
setupTeardownMouseCanceller(true);
|
||||||
}
|
}
|
||||||
|
@ -488,6 +492,12 @@ node = next;
|
||||||
}
|
}
|
||||||
return node;
|
return node;
|
||||||
},
|
},
|
||||||
|
findOriginalTarget: function (ev) {
|
||||||
|
if (ev.path) {
|
||||||
|
return ev.path[0];
|
||||||
|
}
|
||||||
|
return ev.target;
|
||||||
|
},
|
||||||
handleNative: function (ev) {
|
handleNative: function (ev) {
|
||||||
var handled;
|
var handled;
|
||||||
var type = ev.type;
|
var type = ev.type;
|
||||||
|
@ -558,8 +568,7 @@ prevent = dy > dx;
|
||||||
prevent = dx > dy;
|
prevent = dx > dy;
|
||||||
}
|
}
|
||||||
if (prevent) {
|
if (prevent) {
|
||||||
//This breaks scrolling in safari
|
ev.preventDefault();
|
||||||
//ev.preventDefault();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -573,12 +582,18 @@ node[GESTURE_KEY] = gobj = {};
|
||||||
}
|
}
|
||||||
for (var i = 0, dep, gd; i < deps.length; i++) {
|
for (var i = 0, dep, gd; i < deps.length; i++) {
|
||||||
dep = deps[i];
|
dep = deps[i];
|
||||||
|
if (IS_TOUCH_ONLY && MOUSE_EVENTS.indexOf(dep) > -1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
gd = gobj[dep];
|
gd = gobj[dep];
|
||||||
if (!gd) {
|
if (!gd) {
|
||||||
gobj[dep] = gd = {};
|
gobj[dep] = gd = { _count: 0 };
|
||||||
|
}
|
||||||
|
if (gd._count === 0) {
|
||||||
node.addEventListener(dep, this.handleNative);
|
node.addEventListener(dep, this.handleNative);
|
||||||
}
|
}
|
||||||
gd[name] = (gd[name] || 0) + 1;
|
gd[name] = (gd[name] || 0) + 1;
|
||||||
|
gd._count = (gd._count || 0) + 1;
|
||||||
}
|
}
|
||||||
node.addEventListener(evType, handler);
|
node.addEventListener(evType, handler);
|
||||||
if (recognizer.touchAction) {
|
if (recognizer.touchAction) {
|
||||||
|
@ -596,9 +611,10 @@ dep = deps[i];
|
||||||
gd = gobj[dep];
|
gd = gobj[dep];
|
||||||
if (gd && gd[name]) {
|
if (gd && gd[name]) {
|
||||||
gd[name] = (gd[name] || 1) - 1;
|
gd[name] = (gd[name] || 1) - 1;
|
||||||
if (gd[name] === 0) {
|
gd._count = (gd._count || 1) - 1;
|
||||||
node.removeEventListener(dep, this.handleNative);
|
|
||||||
}
|
}
|
||||||
|
if (gd._count === 0) {
|
||||||
|
node.removeEventListener(dep, this.handleNative);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -660,7 +676,7 @@ emits: [
|
||||||
'up'
|
'up'
|
||||||
],
|
],
|
||||||
mousedown: function (e) {
|
mousedown: function (e) {
|
||||||
var t = e.currentTarget;
|
var t = Gestures.findOriginalTarget(e);
|
||||||
var self = this;
|
var self = this;
|
||||||
var upfn = function upfn(e) {
|
var upfn = function upfn(e) {
|
||||||
self.fire('up', t, e);
|
self.fire('up', t, e);
|
||||||
|
@ -670,10 +686,10 @@ document.addEventListener('mouseup', upfn);
|
||||||
this.fire('down', t, e);
|
this.fire('down', t, e);
|
||||||
},
|
},
|
||||||
touchstart: function (e) {
|
touchstart: function (e) {
|
||||||
this.fire('down', e.currentTarget, e.changedTouches[0]);
|
this.fire('down', Gestures.findOriginalTarget(e), e.changedTouches[0]);
|
||||||
},
|
},
|
||||||
touchend: function (e) {
|
touchend: function (e) {
|
||||||
this.fire('up', e.currentTarget, e.changedTouches[0]);
|
this.fire('up', Gestures.findOriginalTarget(e), e.changedTouches[0]);
|
||||||
},
|
},
|
||||||
fire: function (type, target, event) {
|
fire: function (type, target, event) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
@ -729,7 +745,7 @@ var dy = Math.abs(this.info.y - y);
|
||||||
return dx >= TRACK_DISTANCE || dy >= TRACK_DISTANCE;
|
return dx >= TRACK_DISTANCE || dy >= TRACK_DISTANCE;
|
||||||
},
|
},
|
||||||
mousedown: function (e) {
|
mousedown: function (e) {
|
||||||
var t = e.currentTarget;
|
var t = Gestures.findOriginalTarget(e);
|
||||||
var self = this;
|
var self = this;
|
||||||
var movefn = function movefn(e) {
|
var movefn = function movefn(e) {
|
||||||
var x = e.clientX, y = e.clientY;
|
var x = e.clientX, y = e.clientY;
|
||||||
|
@ -763,7 +779,7 @@ this.info.x = ct.clientX;
|
||||||
this.info.y = ct.clientY;
|
this.info.y = ct.clientY;
|
||||||
},
|
},
|
||||||
touchmove: function (e) {
|
touchmove: function (e) {
|
||||||
var t = e.currentTarget;
|
var t = Gestures.findOriginalTarget(e);
|
||||||
var ct = e.changedTouches[0];
|
var ct = e.changedTouches[0];
|
||||||
var x = ct.clientX, y = ct.clientY;
|
var x = ct.clientX, y = ct.clientY;
|
||||||
if (this.hasMovedEnough(x, y)) {
|
if (this.hasMovedEnough(x, y)) {
|
||||||
|
@ -777,7 +793,7 @@ this.info.started = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
touchend: function (e) {
|
touchend: function (e) {
|
||||||
var t = e.currentTarget;
|
var t = Gestures.findOriginalTarget(e);
|
||||||
var ct = e.changedTouches[0];
|
var ct = e.changedTouches[0];
|
||||||
if (this.info.started) {
|
if (this.info.started) {
|
||||||
Gestures.prevent('tap');
|
Gestures.prevent('tap');
|
||||||
|
@ -853,9 +869,10 @@ this.forward(e.changedTouches[0]);
|
||||||
forward: function (e) {
|
forward: function (e) {
|
||||||
var dx = Math.abs(e.clientX - this.info.x);
|
var dx = Math.abs(e.clientX - this.info.x);
|
||||||
var dy = Math.abs(e.clientY - this.info.y);
|
var dy = Math.abs(e.clientY - this.info.y);
|
||||||
|
var t = Gestures.findOriginalTarget(e);
|
||||||
if (isNaN(dx) || isNaN(dy) || dx <= TAP_DISTANCE && dy <= TAP_DISTANCE) {
|
if (isNaN(dx) || isNaN(dy) || dx <= TAP_DISTANCE && dy <= TAP_DISTANCE) {
|
||||||
if (!this.info.prevent) {
|
if (!this.info.prevent) {
|
||||||
Gestures.fire(e.target, 'tap', {
|
Gestures.fire(t, 'tap', {
|
||||||
x: e.clientX,
|
x: e.clientX,
|
||||||
y: e.clientY,
|
y: e.clientY,
|
||||||
sourceEvent: e
|
sourceEvent: e
|
||||||
|
@ -1102,15 +1119,15 @@ Polymer.Bind = {
|
||||||
prepareModel: function (model) {
|
prepareModel: function (model) {
|
||||||
model._propertyEffects = {};
|
model._propertyEffects = {};
|
||||||
model._bindListeners = [];
|
model._bindListeners = [];
|
||||||
var api = this._modelApi;
|
Polymer.Base.mixin(model, this._modelApi);
|
||||||
for (var n in api) {
|
|
||||||
model[n] = api[n];
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
_modelApi: {
|
_modelApi: {
|
||||||
_notifyChange: function (property) {
|
_notifyChange: function (property) {
|
||||||
var eventName = Polymer.CaseMap.camelToDashCase(property) + '-changed';
|
var eventName = Polymer.CaseMap.camelToDashCase(property) + '-changed';
|
||||||
this.fire(eventName, { value: this[property] }, { bubbles: false });
|
Polymer.Base.fire(eventName, { value: this[property] }, {
|
||||||
|
bubbles: false,
|
||||||
|
node: this
|
||||||
|
});
|
||||||
},
|
},
|
||||||
_propertySetter: function (property, value, effects, fromAbove) {
|
_propertySetter: function (property, value, effects, fromAbove) {
|
||||||
var old = this.__data__[property];
|
var old = this.__data__[property];
|
||||||
|
@ -1201,8 +1218,11 @@ return this.__data__[property];
|
||||||
var setter = function (value) {
|
var setter = function (value) {
|
||||||
this._propertySetter(property, value, effects);
|
this._propertySetter(property, value, effects);
|
||||||
};
|
};
|
||||||
if (model.getPropertyInfo && model.getPropertyInfo(property).readOnly) {
|
var info = model.getPropertyInfo && model.getPropertyInfo(property);
|
||||||
|
if (info && info.readOnly) {
|
||||||
|
if (!info.computed) {
|
||||||
model['_set' + this.upper(property)] = setter;
|
model['_set' + this.upper(property)] = setter;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
defun.set = setter;
|
defun.set = setter;
|
||||||
}
|
}
|
||||||
|
@ -1660,6 +1680,7 @@ this._pathEffector(path, value);
|
||||||
if (!fromAbove) {
|
if (!fromAbove) {
|
||||||
this._notifyPath(path, value);
|
this._notifyPath(path, value);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_getPathParts: function (path) {
|
_getPathParts: function (path) {
|
||||||
|
@ -2001,7 +2022,7 @@ var VAR_START = '--';
|
||||||
var MEDIA_START = '@media';
|
var MEDIA_START = '@media';
|
||||||
var AT_START = '@';
|
var AT_START = '@';
|
||||||
var rx = {
|
var rx = {
|
||||||
comments: /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,
|
comments: /\/\*[^*]*\*+([^\/*][^*]*\*+)*\//gim,
|
||||||
port: /@import[^;]*;/gim,
|
port: /@import[^;]*;/gim,
|
||||||
customProp: /(?:^|[\s;])--[^;{]*?:[^{};]*?(?:[;\n]|$)/gim,
|
customProp: /(?:^|[\s;])--[^;{]*?:[^{};]*?(?:[;\n]|$)/gim,
|
||||||
mixinProp: /(?:^|[\s;])--[^;{]*?:[^{;]*?{[^}]*?}(?:[;\n]|$)?/gim,
|
mixinProp: /(?:^|[\s;])--[^;{]*?:[^{;]*?{[^}]*?}(?:[;\n]|$)?/gim,
|
||||||
|
@ -2673,10 +2694,10 @@ props[i] = v;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
rx: {
|
rx: {
|
||||||
VAR_ASSIGN: /(?:^|[;\n]\s*)(--[\w-]*?):\s*?(?:([^;{]*?)|{([^}]*)})(?:(?=[;\n])|$)/gim,
|
VAR_ASSIGN: /(?:^|[;\n]\s*)(--[\w-]*?):\s*(?:([^;{]*)|{([^}]*)})(?:(?=[;\n])|$)/gi,
|
||||||
MIXIN_MATCH: /(?:^|\W+)@apply[\s]*\(([^)]*)\)/im,
|
MIXIN_MATCH: /(?:^|\W+)@apply[\s]*\(([^)]*)\)/i,
|
||||||
VAR_MATCH: /(^|\W+)var\([\s]*([^,)]*)[\s]*,?[\s]*((?:[^,)]*)|(?:[^;]*\([^;)]*\)))[\s]*?\)/gim,
|
VAR_MATCH: /(^|\W+)var\([\s]*([^,)]*)[\s]*,?[\s]*((?:[^,)]*)|(?:[^;]*\([^;)]*\)))[\s]*?\)/gi,
|
||||||
VAR_CAPTURE: /\([\s]*(--[^,\s)]*)(?:,[\s]*(--[^,\s)]*))?(?:\)|,)/gim,
|
VAR_CAPTURE: /\([\s]*(--[^,\s)]*)(?:,[\s]*(--[^,\s)]*))?(?:\)|,)/gi,
|
||||||
IS_VAR: /^--/,
|
IS_VAR: /^--/,
|
||||||
BRACKETED: /\{[^}]*\}/g,
|
BRACKETED: /\{[^}]*\}/g,
|
||||||
HOST_PREFIX: '(?:^|[^.#[:])',
|
HOST_PREFIX: '(?:^|[^.#[:])',
|
||||||
|
@ -3015,7 +3036,7 @@ styleTransformer.documentRule(rule);
|
||||||
});
|
});
|
||||||
}());
|
}());
|
||||||
Polymer.Templatizer = {
|
Polymer.Templatizer = {
|
||||||
properties: { _hideTemplateChildren: { observer: '_showHideChildren' } },
|
properties: { __hideTemplateChildren__: { observer: '_showHideChildren' } },
|
||||||
_templatizerStatic: {
|
_templatizerStatic: {
|
||||||
count: 0,
|
count: 0,
|
||||||
callbacks: {},
|
callbacks: {},
|
||||||
|
@ -3044,6 +3065,7 @@ this._prepParentProperties(archetype, template);
|
||||||
archetype._notifyPath = this._notifyPathImpl;
|
archetype._notifyPath = this._notifyPathImpl;
|
||||||
archetype._scopeElementClass = this._scopeElementClassImpl;
|
archetype._scopeElementClass = this._scopeElementClassImpl;
|
||||||
archetype.listen = this._listenImpl;
|
archetype.listen = this._listenImpl;
|
||||||
|
archetype._showHideChildren = this._showHideChildrenImpl;
|
||||||
var _constructor = this._constructorImpl;
|
var _constructor = this._constructorImpl;
|
||||||
var ctor = function TemplateInstance(model, host) {
|
var ctor = function TemplateInstance(model, host) {
|
||||||
_constructor.call(this, model, host);
|
_constructor.call(this, model, host);
|
||||||
|
@ -3056,7 +3078,15 @@ this.ctor = ctor;
|
||||||
_getRootDataHost: function () {
|
_getRootDataHost: function () {
|
||||||
return this.dataHost && this.dataHost._rootDataHost || this.dataHost;
|
return this.dataHost && this.dataHost._rootDataHost || this.dataHost;
|
||||||
},
|
},
|
||||||
_showHideChildren: function (hidden) {
|
_showHideChildrenImpl: function (hide) {
|
||||||
|
var c = this._children;
|
||||||
|
for (var i = 0; i < c.length; i++) {
|
||||||
|
var n = c[i];
|
||||||
|
if (n.style) {
|
||||||
|
n.style.display = hide ? 'none' : '';
|
||||||
|
n.__hideTemplateChildren__ = hide;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
_debounceTemplate: function (fn) {
|
_debounceTemplate: function (fn) {
|
||||||
this._templatizerStatic.callbacks[this._templatizerId] = fn.bind(this);
|
this._templatizerStatic.callbacks[this._templatizerId] = fn.bind(this);
|
||||||
|
@ -3157,6 +3187,8 @@ template._propertySetter(n, val);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
_showHideChildren: function (hidden) {
|
||||||
|
},
|
||||||
_forwardInstancePath: function (inst, path, value) {
|
_forwardInstancePath: function (inst, path, value) {
|
||||||
},
|
},
|
||||||
_forwardInstanceProp: function (inst, prop, value) {
|
_forwardInstanceProp: function (inst, prop, value) {
|
||||||
|
@ -3195,6 +3227,9 @@ children.push(n);
|
||||||
n._templateInstance = this;
|
n._templateInstance = this;
|
||||||
}
|
}
|
||||||
this._children = children;
|
this._children = children;
|
||||||
|
if (host.__hideTemplateChildren__) {
|
||||||
|
this._showHideChildren(true);
|
||||||
|
}
|
||||||
this._tryReady();
|
this._tryReady();
|
||||||
},
|
},
|
||||||
_listenImpl: function (node, eventName, methodName) {
|
_listenImpl: function (node, eventName, methodName) {
|
||||||
|
@ -3221,6 +3256,20 @@ model[prop] = this['_parent_' + prop];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new this.ctor(model, this);
|
return new this.ctor(model, this);
|
||||||
|
},
|
||||||
|
modelForElement: function (el) {
|
||||||
|
var model;
|
||||||
|
while (el) {
|
||||||
|
if (model = el._templateInstance) {
|
||||||
|
if (model.dataHost != this) {
|
||||||
|
el = model.dataHost;
|
||||||
|
} else {
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
el = el.parentNode;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Polymer({
|
Polymer({
|
||||||
|
@ -3267,7 +3316,7 @@ this._removeFromMap(this.store[key]);
|
||||||
delete this.store[key];
|
delete this.store[key];
|
||||||
},
|
},
|
||||||
_removeFromMap: function (item) {
|
_removeFromMap: function (item) {
|
||||||
if (typeof item == 'object') {
|
if (item && typeof item == 'object') {
|
||||||
this.omap.delete(item);
|
this.omap.delete(item);
|
||||||
} else {
|
} else {
|
||||||
delete this.pmap[item];
|
delete this.pmap[item];
|
||||||
|
@ -3279,7 +3328,7 @@ this.removeKey(key);
|
||||||
return key;
|
return key;
|
||||||
},
|
},
|
||||||
getKey: function (item) {
|
getKey: function (item) {
|
||||||
if (typeof item == 'object') {
|
if (item && typeof item == 'object') {
|
||||||
return this.omap.get(item);
|
return this.omap.get(item);
|
||||||
} else {
|
} else {
|
||||||
return this.pmap[item];
|
return this.pmap[item];
|
||||||
|
@ -3648,14 +3697,7 @@ return row;
|
||||||
_showHideChildren: function (hidden) {
|
_showHideChildren: function (hidden) {
|
||||||
if (this.rows) {
|
if (this.rows) {
|
||||||
for (var i = 0; i < this.rows.length; i++) {
|
for (var i = 0; i < this.rows.length; i++) {
|
||||||
var c$ = this.rows[i]._children;
|
this.rows[i]._showHideChildren(hidden);
|
||||||
for (var j = 0; j < c$.length; j++) {
|
|
||||||
var c = c$[j];
|
|
||||||
if (c.style) {
|
|
||||||
c.style.display = hidden ? 'none' : '';
|
|
||||||
}
|
|
||||||
c._hideTemplateChildren = hidden;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -3705,20 +3747,6 @@ row.__setProperty(this.as, value, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
modelForElement: function (el) {
|
|
||||||
var model;
|
|
||||||
while (el) {
|
|
||||||
if (model = el._templateInstance) {
|
|
||||||
if (model.dataHost != this) {
|
|
||||||
el = model.dataHost;
|
|
||||||
} else {
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
el = el.parentNode;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
itemForElement: function (el) {
|
itemForElement: function (el) {
|
||||||
var instance = this.modelForElement(el);
|
var instance = this.modelForElement(el);
|
||||||
return instance && instance[this.as];
|
return instance && instance[this.as];
|
||||||
|
@ -3873,7 +3901,7 @@ this._instance = null;
|
||||||
},
|
},
|
||||||
_wrapTextNodes: function (root) {
|
_wrapTextNodes: function (root) {
|
||||||
for (var n = root.firstChild; n; n = n.nextSibling) {
|
for (var n = root.firstChild; n; n = n.nextSibling) {
|
||||||
if (n.nodeType === Node.TEXT_NODE) {
|
if (n.nodeType === Node.TEXT_NODE && n.textContent.trim()) {
|
||||||
var s = document.createElement('span');
|
var s = document.createElement('span');
|
||||||
root.insertBefore(s, n);
|
root.insertBefore(s, n);
|
||||||
s.appendChild(n);
|
s.appendChild(n);
|
||||||
|
@ -3882,14 +3910,9 @@ n = s;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_showHideChildren: function () {
|
_showHideChildren: function () {
|
||||||
var hidden = this._hideTemplateChildren || !this.if;
|
var hidden = this.__hideTemplateChildren__ || !this.if;
|
||||||
if (this._instance) {
|
if (this._instance) {
|
||||||
var c$ = this._instance._children;
|
this._instance._showHideChildren(hidden);
|
||||||
for (var i = 0; i < c$.length; i++) {
|
|
||||||
var c = c$[i];
|
|
||||||
c.style.display = hidden ? 'none' : '';
|
|
||||||
c._hideTemplateChildren = hidden;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_forwardParentProp: function (prop, value) {
|
_forwardParentProp: function (prop, value) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "webcomponentsjs",
|
"name": "webcomponentsjs",
|
||||||
"main": "webcomponents.js",
|
"main": "webcomponents.js",
|
||||||
"version": "0.7.5",
|
"version": "0.7.6",
|
||||||
"homepage": "http://webcomponents.org",
|
"homepage": "http://webcomponents.org",
|
||||||
"authors": [
|
"authors": [
|
||||||
"The Polymer Authors"
|
"The Polymer Authors"
|
||||||
|
@ -15,11 +15,11 @@
|
||||||
],
|
],
|
||||||
"license": "BSD",
|
"license": "BSD",
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"_release": "0.7.5",
|
"_release": "0.7.6",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v0.7.5",
|
"tag": "v0.7.6",
|
||||||
"commit": "6e2fd746392a9fbec95711872e21fa22bff22fae"
|
"commit": "401764710ac11f9ed8a175195107752af2f72eb6"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/Polymer/webcomponentsjs.git",
|
"_source": "git://github.com/Polymer/webcomponentsjs.git",
|
||||||
"_target": "^0.7.2",
|
"_target": "^0.7.2",
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* Code distributed by Google as part of the polymer project is also
|
* 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
|
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||||
*/
|
*/
|
||||||
// @version 0.7.5
|
// @version 0.7.6
|
||||||
if (typeof WeakMap === "undefined") {
|
if (typeof WeakMap === "undefined") {
|
||||||
(function() {
|
(function() {
|
||||||
var defineProperty = Object.defineProperty;
|
var defineProperty = Object.defineProperty;
|
||||||
|
@ -423,30 +423,24 @@ window.CustomElements.addModule(function(scope) {
|
||||||
var flags = scope.flags;
|
var flags = scope.flags;
|
||||||
var forSubtree = scope.forSubtree;
|
var forSubtree = scope.forSubtree;
|
||||||
var forDocumentTree = scope.forDocumentTree;
|
var forDocumentTree = scope.forDocumentTree;
|
||||||
function addedNode(node) {
|
function addedNode(node, isAttached) {
|
||||||
return added(node) || addedSubtree(node);
|
return added(node, isAttached) || addedSubtree(node, isAttached);
|
||||||
}
|
}
|
||||||
function added(node) {
|
function added(node, isAttached) {
|
||||||
if (scope.upgrade(node)) {
|
if (scope.upgrade(node, isAttached)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
attached(node);
|
if (isAttached) {
|
||||||
|
attached(node);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function addedSubtree(node) {
|
function addedSubtree(node, isAttached) {
|
||||||
forSubtree(node, function(e) {
|
forSubtree(node, function(e) {
|
||||||
if (added(e)) {
|
if (added(e, isAttached)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function attachedNode(node) {
|
|
||||||
attached(node);
|
|
||||||
if (inDocument(node)) {
|
|
||||||
forSubtree(node, function(e) {
|
|
||||||
attached(e);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var hasPolyfillMutations = !window.MutationObserver || window.MutationObserver === window.JsMutationObserver;
|
var hasPolyfillMutations = !window.MutationObserver || window.MutationObserver === window.JsMutationObserver;
|
||||||
scope.hasPolyfillMutations = hasPolyfillMutations;
|
scope.hasPolyfillMutations = hasPolyfillMutations;
|
||||||
var isPendingMutations = false;
|
var isPendingMutations = false;
|
||||||
|
@ -476,12 +470,10 @@ window.CustomElements.addModule(function(scope) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function _attached(element) {
|
function _attached(element) {
|
||||||
if (element.__upgraded__ && (element.attachedCallback || element.detachedCallback)) {
|
if (element.__upgraded__ && !element.__attached) {
|
||||||
if (!element.__attached && inDocument(element)) {
|
element.__attached = true;
|
||||||
element.__attached = true;
|
if (element.attachedCallback) {
|
||||||
if (element.attachedCallback) {
|
element.attachedCallback();
|
||||||
element.attachedCallback();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -501,18 +493,16 @@ window.CustomElements.addModule(function(scope) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function _detached(element) {
|
function _detached(element) {
|
||||||
if (element.__upgraded__ && (element.attachedCallback || element.detachedCallback)) {
|
if (element.__upgraded__ && element.__attached) {
|
||||||
if (element.__attached && !inDocument(element)) {
|
element.__attached = false;
|
||||||
element.__attached = false;
|
if (element.detachedCallback) {
|
||||||
if (element.detachedCallback) {
|
element.detachedCallback();
|
||||||
element.detachedCallback();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function inDocument(element) {
|
function inDocument(element) {
|
||||||
var p = element;
|
var p = element;
|
||||||
var doc = wrap(document);
|
var doc = window.wrap(document);
|
||||||
while (p) {
|
while (p) {
|
||||||
if (p == doc) {
|
if (p == doc) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -530,7 +520,7 @@ window.CustomElements.addModule(function(scope) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function handler(mutations) {
|
function handler(root, mutations) {
|
||||||
if (flags.dom) {
|
if (flags.dom) {
|
||||||
var mx = mutations[0];
|
var mx = mutations[0];
|
||||||
if (mx && mx.type === "childList" && mx.addedNodes) {
|
if (mx && mx.type === "childList" && mx.addedNodes) {
|
||||||
|
@ -545,13 +535,14 @@ window.CustomElements.addModule(function(scope) {
|
||||||
}
|
}
|
||||||
console.group("mutations (%d) [%s]", mutations.length, u || "");
|
console.group("mutations (%d) [%s]", mutations.length, u || "");
|
||||||
}
|
}
|
||||||
|
var isAttached = inDocument(root);
|
||||||
mutations.forEach(function(mx) {
|
mutations.forEach(function(mx) {
|
||||||
if (mx.type === "childList") {
|
if (mx.type === "childList") {
|
||||||
forEach(mx.addedNodes, function(n) {
|
forEach(mx.addedNodes, function(n) {
|
||||||
if (!n.localName) {
|
if (!n.localName) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
addedNode(n);
|
addedNode(n, isAttached);
|
||||||
});
|
});
|
||||||
forEach(mx.removedNodes, function(n) {
|
forEach(mx.removedNodes, function(n) {
|
||||||
if (!n.localName) {
|
if (!n.localName) {
|
||||||
|
@ -573,7 +564,7 @@ window.CustomElements.addModule(function(scope) {
|
||||||
}
|
}
|
||||||
var observer = node.__observer;
|
var observer = node.__observer;
|
||||||
if (observer) {
|
if (observer) {
|
||||||
handler(observer.takeRecords());
|
handler(node, observer.takeRecords());
|
||||||
takeMutations();
|
takeMutations();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -582,7 +573,7 @@ window.CustomElements.addModule(function(scope) {
|
||||||
if (inRoot.__observer) {
|
if (inRoot.__observer) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var observer = new MutationObserver(handler);
|
var observer = new MutationObserver(handler.bind(this, inRoot));
|
||||||
observer.observe(inRoot, {
|
observer.observe(inRoot, {
|
||||||
childList: true,
|
childList: true,
|
||||||
subtree: true
|
subtree: true
|
||||||
|
@ -592,7 +583,8 @@ window.CustomElements.addModule(function(scope) {
|
||||||
function upgradeDocument(doc) {
|
function upgradeDocument(doc) {
|
||||||
doc = window.wrap(doc);
|
doc = window.wrap(doc);
|
||||||
flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop());
|
flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop());
|
||||||
addedNode(doc);
|
var isMainDocument = doc === window.wrap(document);
|
||||||
|
addedNode(doc, isMainDocument);
|
||||||
observe(doc);
|
observe(doc);
|
||||||
flags.dom && console.groupEnd();
|
flags.dom && console.groupEnd();
|
||||||
}
|
}
|
||||||
|
@ -611,26 +603,26 @@ window.CustomElements.addModule(function(scope) {
|
||||||
scope.upgradeDocumentTree = upgradeDocumentTree;
|
scope.upgradeDocumentTree = upgradeDocumentTree;
|
||||||
scope.upgradeSubtree = addedSubtree;
|
scope.upgradeSubtree = addedSubtree;
|
||||||
scope.upgradeAll = addedNode;
|
scope.upgradeAll = addedNode;
|
||||||
scope.attachedNode = attachedNode;
|
scope.attached = attached;
|
||||||
scope.takeRecords = takeRecords;
|
scope.takeRecords = takeRecords;
|
||||||
});
|
});
|
||||||
|
|
||||||
window.CustomElements.addModule(function(scope) {
|
window.CustomElements.addModule(function(scope) {
|
||||||
var flags = scope.flags;
|
var flags = scope.flags;
|
||||||
function upgrade(node) {
|
function upgrade(node, isAttached) {
|
||||||
if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
|
if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
|
||||||
var is = node.getAttribute("is");
|
var is = node.getAttribute("is");
|
||||||
var definition = scope.getRegisteredDefinition(is || node.localName);
|
var definition = scope.getRegisteredDefinition(is || node.localName);
|
||||||
if (definition) {
|
if (definition) {
|
||||||
if (is && definition.tag == node.localName) {
|
if (is && definition.tag == node.localName) {
|
||||||
return upgradeWithDefinition(node, definition);
|
return upgradeWithDefinition(node, definition, isAttached);
|
||||||
} else if (!is && !definition.extends) {
|
} else if (!is && !definition.extends) {
|
||||||
return upgradeWithDefinition(node, definition);
|
return upgradeWithDefinition(node, definition, isAttached);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function upgradeWithDefinition(element, definition) {
|
function upgradeWithDefinition(element, definition, isAttached) {
|
||||||
flags.upgrade && console.group("upgrade:", element.localName);
|
flags.upgrade && console.group("upgrade:", element.localName);
|
||||||
if (definition.is) {
|
if (definition.is) {
|
||||||
element.setAttribute("is", definition.is);
|
element.setAttribute("is", definition.is);
|
||||||
|
@ -638,8 +630,10 @@ window.CustomElements.addModule(function(scope) {
|
||||||
implementPrototype(element, definition);
|
implementPrototype(element, definition);
|
||||||
element.__upgraded__ = true;
|
element.__upgraded__ = true;
|
||||||
created(element);
|
created(element);
|
||||||
scope.attachedNode(element);
|
if (isAttached) {
|
||||||
scope.upgradeSubtree(element);
|
scope.attached(element);
|
||||||
|
}
|
||||||
|
scope.upgradeSubtree(element, isAttached);
|
||||||
flags.upgrade && console.groupEnd();
|
flags.upgrade && console.groupEnd();
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
@ -921,7 +915,7 @@ window.CustomElements.addModule(function(scope) {
|
||||||
upgradeDocumentTree(window.wrap(document));
|
upgradeDocumentTree(window.wrap(document));
|
||||||
if (window.HTMLImports) {
|
if (window.HTMLImports) {
|
||||||
window.HTMLImports.__importsParsingHook = function(elt) {
|
window.HTMLImports.__importsParsingHook = function(elt) {
|
||||||
upgradeDocumentTree(wrap(elt.import));
|
upgradeDocumentTree(window.wrap(elt.import));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
window.CustomElements.ready = true;
|
window.CustomElements.ready = true;
|
||||||
|
|
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
|
* 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
|
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||||
*/
|
*/
|
||||||
// @version 0.7.5
|
// @version 0.7.6
|
||||||
if (typeof WeakMap === "undefined") {
|
if (typeof WeakMap === "undefined") {
|
||||||
(function() {
|
(function() {
|
||||||
var defineProperty = Object.defineProperty;
|
var defineProperty = Object.defineProperty;
|
||||||
|
@ -847,7 +847,9 @@ window.HTMLImports.addModule(function(scope) {
|
||||||
script.src = scriptElt.src ? scriptElt.src : generateScriptDataUrl(scriptElt);
|
script.src = scriptElt.src ? scriptElt.src : generateScriptDataUrl(scriptElt);
|
||||||
scope.currentScript = scriptElt;
|
scope.currentScript = scriptElt;
|
||||||
this.trackElement(script, function(e) {
|
this.trackElement(script, function(e) {
|
||||||
script.parentNode.removeChild(script);
|
if (script.parentNode) {
|
||||||
|
script.parentNode.removeChild(script);
|
||||||
|
}
|
||||||
scope.currentScript = null;
|
scope.currentScript = null;
|
||||||
});
|
});
|
||||||
this.addElementToDocument(script);
|
this.addElementToDocument(script);
|
||||||
|
|
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
|
* 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
|
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||||
*/
|
*/
|
||||||
// @version 0.7.5
|
// @version 0.7.6
|
||||||
if (typeof WeakMap === "undefined") {
|
if (typeof WeakMap === "undefined") {
|
||||||
(function() {
|
(function() {
|
||||||
var defineProperty = Object.defineProperty;
|
var defineProperty = Object.defineProperty;
|
||||||
|
|
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
|
* 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
|
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||||
*/
|
*/
|
||||||
// @version 0.7.5
|
// @version 0.7.6
|
||||||
if (typeof WeakMap === "undefined") {
|
if (typeof WeakMap === "undefined") {
|
||||||
(function() {
|
(function() {
|
||||||
var defineProperty = Object.defineProperty;
|
var defineProperty = Object.defineProperty;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "webcomponentsjs",
|
"name": "webcomponentsjs",
|
||||||
"main": "webcomponents.js",
|
"main": "webcomponents.js",
|
||||||
"version": "0.7.5",
|
"version": "0.7.6",
|
||||||
"homepage": "http://webcomponents.org",
|
"homepage": "http://webcomponents.org",
|
||||||
"authors": [
|
"authors": [
|
||||||
"The Polymer Authors"
|
"The Polymer Authors"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "webcomponents.js",
|
"name": "webcomponents.js",
|
||||||
"version": "0.7.5",
|
"version": "0.7.6",
|
||||||
"description": "webcomponents.js",
|
"description": "webcomponents.js",
|
||||||
"main": "webcomponents.js",
|
"main": "webcomponents.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* Code distributed by Google as part of the polymer project is also
|
* 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
|
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||||
*/
|
*/
|
||||||
// @version 0.7.5
|
// @version 0.7.6
|
||||||
window.WebComponents = window.WebComponents || {};
|
window.WebComponents = window.WebComponents || {};
|
||||||
|
|
||||||
(function(scope) {
|
(function(scope) {
|
||||||
|
@ -1415,7 +1415,9 @@ window.HTMLImports.addModule(function(scope) {
|
||||||
script.src = scriptElt.src ? scriptElt.src : generateScriptDataUrl(scriptElt);
|
script.src = scriptElt.src ? scriptElt.src : generateScriptDataUrl(scriptElt);
|
||||||
scope.currentScript = scriptElt;
|
scope.currentScript = scriptElt;
|
||||||
this.trackElement(script, function(e) {
|
this.trackElement(script, function(e) {
|
||||||
script.parentNode.removeChild(script);
|
if (script.parentNode) {
|
||||||
|
script.parentNode.removeChild(script);
|
||||||
|
}
|
||||||
scope.currentScript = null;
|
scope.currentScript = null;
|
||||||
});
|
});
|
||||||
this.addElementToDocument(script);
|
this.addElementToDocument(script);
|
||||||
|
@ -1732,30 +1734,24 @@ window.CustomElements.addModule(function(scope) {
|
||||||
var flags = scope.flags;
|
var flags = scope.flags;
|
||||||
var forSubtree = scope.forSubtree;
|
var forSubtree = scope.forSubtree;
|
||||||
var forDocumentTree = scope.forDocumentTree;
|
var forDocumentTree = scope.forDocumentTree;
|
||||||
function addedNode(node) {
|
function addedNode(node, isAttached) {
|
||||||
return added(node) || addedSubtree(node);
|
return added(node, isAttached) || addedSubtree(node, isAttached);
|
||||||
}
|
}
|
||||||
function added(node) {
|
function added(node, isAttached) {
|
||||||
if (scope.upgrade(node)) {
|
if (scope.upgrade(node, isAttached)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
attached(node);
|
if (isAttached) {
|
||||||
|
attached(node);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function addedSubtree(node) {
|
function addedSubtree(node, isAttached) {
|
||||||
forSubtree(node, function(e) {
|
forSubtree(node, function(e) {
|
||||||
if (added(e)) {
|
if (added(e, isAttached)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function attachedNode(node) {
|
|
||||||
attached(node);
|
|
||||||
if (inDocument(node)) {
|
|
||||||
forSubtree(node, function(e) {
|
|
||||||
attached(e);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var hasPolyfillMutations = !window.MutationObserver || window.MutationObserver === window.JsMutationObserver;
|
var hasPolyfillMutations = !window.MutationObserver || window.MutationObserver === window.JsMutationObserver;
|
||||||
scope.hasPolyfillMutations = hasPolyfillMutations;
|
scope.hasPolyfillMutations = hasPolyfillMutations;
|
||||||
var isPendingMutations = false;
|
var isPendingMutations = false;
|
||||||
|
@ -1785,12 +1781,10 @@ window.CustomElements.addModule(function(scope) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function _attached(element) {
|
function _attached(element) {
|
||||||
if (element.__upgraded__ && (element.attachedCallback || element.detachedCallback)) {
|
if (element.__upgraded__ && !element.__attached) {
|
||||||
if (!element.__attached && inDocument(element)) {
|
element.__attached = true;
|
||||||
element.__attached = true;
|
if (element.attachedCallback) {
|
||||||
if (element.attachedCallback) {
|
element.attachedCallback();
|
||||||
element.attachedCallback();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1810,18 +1804,16 @@ window.CustomElements.addModule(function(scope) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function _detached(element) {
|
function _detached(element) {
|
||||||
if (element.__upgraded__ && (element.attachedCallback || element.detachedCallback)) {
|
if (element.__upgraded__ && element.__attached) {
|
||||||
if (element.__attached && !inDocument(element)) {
|
element.__attached = false;
|
||||||
element.__attached = false;
|
if (element.detachedCallback) {
|
||||||
if (element.detachedCallback) {
|
element.detachedCallback();
|
||||||
element.detachedCallback();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function inDocument(element) {
|
function inDocument(element) {
|
||||||
var p = element;
|
var p = element;
|
||||||
var doc = wrap(document);
|
var doc = window.wrap(document);
|
||||||
while (p) {
|
while (p) {
|
||||||
if (p == doc) {
|
if (p == doc) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -1839,7 +1831,7 @@ window.CustomElements.addModule(function(scope) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function handler(mutations) {
|
function handler(root, mutations) {
|
||||||
if (flags.dom) {
|
if (flags.dom) {
|
||||||
var mx = mutations[0];
|
var mx = mutations[0];
|
||||||
if (mx && mx.type === "childList" && mx.addedNodes) {
|
if (mx && mx.type === "childList" && mx.addedNodes) {
|
||||||
|
@ -1854,13 +1846,14 @@ window.CustomElements.addModule(function(scope) {
|
||||||
}
|
}
|
||||||
console.group("mutations (%d) [%s]", mutations.length, u || "");
|
console.group("mutations (%d) [%s]", mutations.length, u || "");
|
||||||
}
|
}
|
||||||
|
var isAttached = inDocument(root);
|
||||||
mutations.forEach(function(mx) {
|
mutations.forEach(function(mx) {
|
||||||
if (mx.type === "childList") {
|
if (mx.type === "childList") {
|
||||||
forEach(mx.addedNodes, function(n) {
|
forEach(mx.addedNodes, function(n) {
|
||||||
if (!n.localName) {
|
if (!n.localName) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
addedNode(n);
|
addedNode(n, isAttached);
|
||||||
});
|
});
|
||||||
forEach(mx.removedNodes, function(n) {
|
forEach(mx.removedNodes, function(n) {
|
||||||
if (!n.localName) {
|
if (!n.localName) {
|
||||||
|
@ -1882,7 +1875,7 @@ window.CustomElements.addModule(function(scope) {
|
||||||
}
|
}
|
||||||
var observer = node.__observer;
|
var observer = node.__observer;
|
||||||
if (observer) {
|
if (observer) {
|
||||||
handler(observer.takeRecords());
|
handler(node, observer.takeRecords());
|
||||||
takeMutations();
|
takeMutations();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1891,7 +1884,7 @@ window.CustomElements.addModule(function(scope) {
|
||||||
if (inRoot.__observer) {
|
if (inRoot.__observer) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var observer = new MutationObserver(handler);
|
var observer = new MutationObserver(handler.bind(this, inRoot));
|
||||||
observer.observe(inRoot, {
|
observer.observe(inRoot, {
|
||||||
childList: true,
|
childList: true,
|
||||||
subtree: true
|
subtree: true
|
||||||
|
@ -1901,7 +1894,8 @@ window.CustomElements.addModule(function(scope) {
|
||||||
function upgradeDocument(doc) {
|
function upgradeDocument(doc) {
|
||||||
doc = window.wrap(doc);
|
doc = window.wrap(doc);
|
||||||
flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop());
|
flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop());
|
||||||
addedNode(doc);
|
var isMainDocument = doc === window.wrap(document);
|
||||||
|
addedNode(doc, isMainDocument);
|
||||||
observe(doc);
|
observe(doc);
|
||||||
flags.dom && console.groupEnd();
|
flags.dom && console.groupEnd();
|
||||||
}
|
}
|
||||||
|
@ -1920,26 +1914,26 @@ window.CustomElements.addModule(function(scope) {
|
||||||
scope.upgradeDocumentTree = upgradeDocumentTree;
|
scope.upgradeDocumentTree = upgradeDocumentTree;
|
||||||
scope.upgradeSubtree = addedSubtree;
|
scope.upgradeSubtree = addedSubtree;
|
||||||
scope.upgradeAll = addedNode;
|
scope.upgradeAll = addedNode;
|
||||||
scope.attachedNode = attachedNode;
|
scope.attached = attached;
|
||||||
scope.takeRecords = takeRecords;
|
scope.takeRecords = takeRecords;
|
||||||
});
|
});
|
||||||
|
|
||||||
window.CustomElements.addModule(function(scope) {
|
window.CustomElements.addModule(function(scope) {
|
||||||
var flags = scope.flags;
|
var flags = scope.flags;
|
||||||
function upgrade(node) {
|
function upgrade(node, isAttached) {
|
||||||
if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
|
if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
|
||||||
var is = node.getAttribute("is");
|
var is = node.getAttribute("is");
|
||||||
var definition = scope.getRegisteredDefinition(is || node.localName);
|
var definition = scope.getRegisteredDefinition(is || node.localName);
|
||||||
if (definition) {
|
if (definition) {
|
||||||
if (is && definition.tag == node.localName) {
|
if (is && definition.tag == node.localName) {
|
||||||
return upgradeWithDefinition(node, definition);
|
return upgradeWithDefinition(node, definition, isAttached);
|
||||||
} else if (!is && !definition.extends) {
|
} else if (!is && !definition.extends) {
|
||||||
return upgradeWithDefinition(node, definition);
|
return upgradeWithDefinition(node, definition, isAttached);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function upgradeWithDefinition(element, definition) {
|
function upgradeWithDefinition(element, definition, isAttached) {
|
||||||
flags.upgrade && console.group("upgrade:", element.localName);
|
flags.upgrade && console.group("upgrade:", element.localName);
|
||||||
if (definition.is) {
|
if (definition.is) {
|
||||||
element.setAttribute("is", definition.is);
|
element.setAttribute("is", definition.is);
|
||||||
|
@ -1947,8 +1941,10 @@ window.CustomElements.addModule(function(scope) {
|
||||||
implementPrototype(element, definition);
|
implementPrototype(element, definition);
|
||||||
element.__upgraded__ = true;
|
element.__upgraded__ = true;
|
||||||
created(element);
|
created(element);
|
||||||
scope.attachedNode(element);
|
if (isAttached) {
|
||||||
scope.upgradeSubtree(element);
|
scope.attached(element);
|
||||||
|
}
|
||||||
|
scope.upgradeSubtree(element, isAttached);
|
||||||
flags.upgrade && console.groupEnd();
|
flags.upgrade && console.groupEnd();
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
@ -2230,7 +2226,7 @@ window.CustomElements.addModule(function(scope) {
|
||||||
upgradeDocumentTree(window.wrap(document));
|
upgradeDocumentTree(window.wrap(document));
|
||||||
if (window.HTMLImports) {
|
if (window.HTMLImports) {
|
||||||
window.HTMLImports.__importsParsingHook = function(elt) {
|
window.HTMLImports.__importsParsingHook = function(elt) {
|
||||||
upgradeDocumentTree(wrap(elt.import));
|
upgradeDocumentTree(window.wrap(elt.import));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
window.CustomElements.ready = true;
|
window.CustomElements.ready = true;
|
||||||
|
|
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
|
* 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
|
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||||
*/
|
*/
|
||||||
// @version 0.7.5
|
// @version 0.7.6
|
||||||
window.WebComponents = window.WebComponents || {};
|
window.WebComponents = window.WebComponents || {};
|
||||||
|
|
||||||
(function(scope) {
|
(function(scope) {
|
||||||
|
@ -6184,7 +6184,9 @@ window.HTMLImports.addModule(function(scope) {
|
||||||
script.src = scriptElt.src ? scriptElt.src : generateScriptDataUrl(scriptElt);
|
script.src = scriptElt.src ? scriptElt.src : generateScriptDataUrl(scriptElt);
|
||||||
scope.currentScript = scriptElt;
|
scope.currentScript = scriptElt;
|
||||||
this.trackElement(script, function(e) {
|
this.trackElement(script, function(e) {
|
||||||
script.parentNode.removeChild(script);
|
if (script.parentNode) {
|
||||||
|
script.parentNode.removeChild(script);
|
||||||
|
}
|
||||||
scope.currentScript = null;
|
scope.currentScript = null;
|
||||||
});
|
});
|
||||||
this.addElementToDocument(script);
|
this.addElementToDocument(script);
|
||||||
|
@ -6501,30 +6503,24 @@ window.CustomElements.addModule(function(scope) {
|
||||||
var flags = scope.flags;
|
var flags = scope.flags;
|
||||||
var forSubtree = scope.forSubtree;
|
var forSubtree = scope.forSubtree;
|
||||||
var forDocumentTree = scope.forDocumentTree;
|
var forDocumentTree = scope.forDocumentTree;
|
||||||
function addedNode(node) {
|
function addedNode(node, isAttached) {
|
||||||
return added(node) || addedSubtree(node);
|
return added(node, isAttached) || addedSubtree(node, isAttached);
|
||||||
}
|
}
|
||||||
function added(node) {
|
function added(node, isAttached) {
|
||||||
if (scope.upgrade(node)) {
|
if (scope.upgrade(node, isAttached)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
attached(node);
|
if (isAttached) {
|
||||||
|
attached(node);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function addedSubtree(node) {
|
function addedSubtree(node, isAttached) {
|
||||||
forSubtree(node, function(e) {
|
forSubtree(node, function(e) {
|
||||||
if (added(e)) {
|
if (added(e, isAttached)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function attachedNode(node) {
|
|
||||||
attached(node);
|
|
||||||
if (inDocument(node)) {
|
|
||||||
forSubtree(node, function(e) {
|
|
||||||
attached(e);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var hasPolyfillMutations = !window.MutationObserver || window.MutationObserver === window.JsMutationObserver;
|
var hasPolyfillMutations = !window.MutationObserver || window.MutationObserver === window.JsMutationObserver;
|
||||||
scope.hasPolyfillMutations = hasPolyfillMutations;
|
scope.hasPolyfillMutations = hasPolyfillMutations;
|
||||||
var isPendingMutations = false;
|
var isPendingMutations = false;
|
||||||
|
@ -6554,12 +6550,10 @@ window.CustomElements.addModule(function(scope) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function _attached(element) {
|
function _attached(element) {
|
||||||
if (element.__upgraded__ && (element.attachedCallback || element.detachedCallback)) {
|
if (element.__upgraded__ && !element.__attached) {
|
||||||
if (!element.__attached && inDocument(element)) {
|
element.__attached = true;
|
||||||
element.__attached = true;
|
if (element.attachedCallback) {
|
||||||
if (element.attachedCallback) {
|
element.attachedCallback();
|
||||||
element.attachedCallback();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6579,18 +6573,16 @@ window.CustomElements.addModule(function(scope) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function _detached(element) {
|
function _detached(element) {
|
||||||
if (element.__upgraded__ && (element.attachedCallback || element.detachedCallback)) {
|
if (element.__upgraded__ && element.__attached) {
|
||||||
if (element.__attached && !inDocument(element)) {
|
element.__attached = false;
|
||||||
element.__attached = false;
|
if (element.detachedCallback) {
|
||||||
if (element.detachedCallback) {
|
element.detachedCallback();
|
||||||
element.detachedCallback();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function inDocument(element) {
|
function inDocument(element) {
|
||||||
var p = element;
|
var p = element;
|
||||||
var doc = wrap(document);
|
var doc = window.wrap(document);
|
||||||
while (p) {
|
while (p) {
|
||||||
if (p == doc) {
|
if (p == doc) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -6608,7 +6600,7 @@ window.CustomElements.addModule(function(scope) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function handler(mutations) {
|
function handler(root, mutations) {
|
||||||
if (flags.dom) {
|
if (flags.dom) {
|
||||||
var mx = mutations[0];
|
var mx = mutations[0];
|
||||||
if (mx && mx.type === "childList" && mx.addedNodes) {
|
if (mx && mx.type === "childList" && mx.addedNodes) {
|
||||||
|
@ -6623,13 +6615,14 @@ window.CustomElements.addModule(function(scope) {
|
||||||
}
|
}
|
||||||
console.group("mutations (%d) [%s]", mutations.length, u || "");
|
console.group("mutations (%d) [%s]", mutations.length, u || "");
|
||||||
}
|
}
|
||||||
|
var isAttached = inDocument(root);
|
||||||
mutations.forEach(function(mx) {
|
mutations.forEach(function(mx) {
|
||||||
if (mx.type === "childList") {
|
if (mx.type === "childList") {
|
||||||
forEach(mx.addedNodes, function(n) {
|
forEach(mx.addedNodes, function(n) {
|
||||||
if (!n.localName) {
|
if (!n.localName) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
addedNode(n);
|
addedNode(n, isAttached);
|
||||||
});
|
});
|
||||||
forEach(mx.removedNodes, function(n) {
|
forEach(mx.removedNodes, function(n) {
|
||||||
if (!n.localName) {
|
if (!n.localName) {
|
||||||
|
@ -6651,7 +6644,7 @@ window.CustomElements.addModule(function(scope) {
|
||||||
}
|
}
|
||||||
var observer = node.__observer;
|
var observer = node.__observer;
|
||||||
if (observer) {
|
if (observer) {
|
||||||
handler(observer.takeRecords());
|
handler(node, observer.takeRecords());
|
||||||
takeMutations();
|
takeMutations();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6660,7 +6653,7 @@ window.CustomElements.addModule(function(scope) {
|
||||||
if (inRoot.__observer) {
|
if (inRoot.__observer) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var observer = new MutationObserver(handler);
|
var observer = new MutationObserver(handler.bind(this, inRoot));
|
||||||
observer.observe(inRoot, {
|
observer.observe(inRoot, {
|
||||||
childList: true,
|
childList: true,
|
||||||
subtree: true
|
subtree: true
|
||||||
|
@ -6670,7 +6663,8 @@ window.CustomElements.addModule(function(scope) {
|
||||||
function upgradeDocument(doc) {
|
function upgradeDocument(doc) {
|
||||||
doc = window.wrap(doc);
|
doc = window.wrap(doc);
|
||||||
flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop());
|
flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop());
|
||||||
addedNode(doc);
|
var isMainDocument = doc === window.wrap(document);
|
||||||
|
addedNode(doc, isMainDocument);
|
||||||
observe(doc);
|
observe(doc);
|
||||||
flags.dom && console.groupEnd();
|
flags.dom && console.groupEnd();
|
||||||
}
|
}
|
||||||
|
@ -6689,26 +6683,26 @@ window.CustomElements.addModule(function(scope) {
|
||||||
scope.upgradeDocumentTree = upgradeDocumentTree;
|
scope.upgradeDocumentTree = upgradeDocumentTree;
|
||||||
scope.upgradeSubtree = addedSubtree;
|
scope.upgradeSubtree = addedSubtree;
|
||||||
scope.upgradeAll = addedNode;
|
scope.upgradeAll = addedNode;
|
||||||
scope.attachedNode = attachedNode;
|
scope.attached = attached;
|
||||||
scope.takeRecords = takeRecords;
|
scope.takeRecords = takeRecords;
|
||||||
});
|
});
|
||||||
|
|
||||||
window.CustomElements.addModule(function(scope) {
|
window.CustomElements.addModule(function(scope) {
|
||||||
var flags = scope.flags;
|
var flags = scope.flags;
|
||||||
function upgrade(node) {
|
function upgrade(node, isAttached) {
|
||||||
if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
|
if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
|
||||||
var is = node.getAttribute("is");
|
var is = node.getAttribute("is");
|
||||||
var definition = scope.getRegisteredDefinition(is || node.localName);
|
var definition = scope.getRegisteredDefinition(is || node.localName);
|
||||||
if (definition) {
|
if (definition) {
|
||||||
if (is && definition.tag == node.localName) {
|
if (is && definition.tag == node.localName) {
|
||||||
return upgradeWithDefinition(node, definition);
|
return upgradeWithDefinition(node, definition, isAttached);
|
||||||
} else if (!is && !definition.extends) {
|
} else if (!is && !definition.extends) {
|
||||||
return upgradeWithDefinition(node, definition);
|
return upgradeWithDefinition(node, definition, isAttached);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function upgradeWithDefinition(element, definition) {
|
function upgradeWithDefinition(element, definition, isAttached) {
|
||||||
flags.upgrade && console.group("upgrade:", element.localName);
|
flags.upgrade && console.group("upgrade:", element.localName);
|
||||||
if (definition.is) {
|
if (definition.is) {
|
||||||
element.setAttribute("is", definition.is);
|
element.setAttribute("is", definition.is);
|
||||||
|
@ -6716,8 +6710,10 @@ window.CustomElements.addModule(function(scope) {
|
||||||
implementPrototype(element, definition);
|
implementPrototype(element, definition);
|
||||||
element.__upgraded__ = true;
|
element.__upgraded__ = true;
|
||||||
created(element);
|
created(element);
|
||||||
scope.attachedNode(element);
|
if (isAttached) {
|
||||||
scope.upgradeSubtree(element);
|
scope.attached(element);
|
||||||
|
}
|
||||||
|
scope.upgradeSubtree(element, isAttached);
|
||||||
flags.upgrade && console.groupEnd();
|
flags.upgrade && console.groupEnd();
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
@ -6999,7 +6995,7 @@ window.CustomElements.addModule(function(scope) {
|
||||||
upgradeDocumentTree(window.wrap(document));
|
upgradeDocumentTree(window.wrap(document));
|
||||||
if (window.HTMLImports) {
|
if (window.HTMLImports) {
|
||||||
window.HTMLImports.__importsParsingHook = function(elt) {
|
window.HTMLImports.__importsParsingHook = function(elt) {
|
||||||
upgradeDocumentTree(wrap(elt.import));
|
upgradeDocumentTree(window.wrap(elt.import));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
window.CustomElements.ready = true;
|
window.CustomElements.ready = true;
|
||||||
|
|
File diff suppressed because one or more lines are too long
17
dashboard-ui/cordova/android/vlcplayer.js
vendored
17
dashboard-ui/cordova/android/vlcplayer.js
vendored
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
self.enableProgressReporting = options.type == 'audio';
|
||||||
|
|
||||||
function onEnded() {
|
function onEnded() {
|
||||||
Events.trigger(self, 'ended');
|
Events.trigger(self, 'ended');
|
||||||
}
|
}
|
||||||
|
@ -148,10 +150,19 @@
|
||||||
var playbackStartInfo = getPlaybackStartInfoForVideoActivity(val, mediaSource, item);
|
var playbackStartInfo = getPlaybackStartInfoForVideoActivity(val, mediaSource, item);
|
||||||
|
|
||||||
var serverUrl = ApiClient.serverAddress();
|
var serverUrl = ApiClient.serverAddress();
|
||||||
var requestHeaders = {};
|
|
||||||
ApiClient.setRequestHeaders(requestHeaders);
|
|
||||||
|
|
||||||
AndroidVlcPlayer.playVideoVlc(val, startPosMs, item.Name, JSON.stringify(mediaSource), JSON.stringify(playbackStartInfo), serverUrl, JSON.stringify(requestHeaders));
|
AndroidVlcPlayer.playVideoVlc(val,
|
||||||
|
startPosMs,
|
||||||
|
item.Name,
|
||||||
|
JSON.stringify(mediaSource),
|
||||||
|
JSON.stringify(playbackStartInfo),
|
||||||
|
serverUrl,
|
||||||
|
ApiClient.appName(),
|
||||||
|
ApiClient.appVersion(),
|
||||||
|
ApiClient.deviceId(),
|
||||||
|
ApiClient.deviceName(),
|
||||||
|
ApiClient.getCurrentUserId(),
|
||||||
|
ApiClient.accessToken());
|
||||||
|
|
||||||
playerState.currentSrc = val;
|
playerState.currentSrc = val;
|
||||||
self.report('playing', null, startPosMs, false, 100);
|
self.report('playing', null, startPosMs, false, 100);
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
</div>
|
</div>
|
||||||
<p>${MessagePleaseRestartServerToFinishUpdating}</p>
|
<p>${MessagePleaseRestartServerToFinishUpdating}</p>
|
||||||
<div class="btnRestartContainer hide">
|
<div class="btnRestartContainer hide">
|
||||||
<paper-button raised class="submit" onclick="DashboardPage.restartServer();"><iron-icon icon="refresh"></iron-icon><span>${ButtonRestartNow}</span></paper-button>
|
<paper-button raised class="submit" onclick="DashboardPage.restart();"><iron-icon icon="refresh"></iron-icon><span>${ButtonRestartNow}</span></paper-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div id="indexPage" data-role="page" class="page homePage libraryPage allLibraryPage backdropPage pageWithAbsoluteTabs" data-backdroptype="movie,series,game,book" data-require="scripts/sections,scripts/indexpage,scripts/homenextup,scripts/favorites,scripts/homeupcoming,paperbuttonstyle">
|
<div id="indexPage" data-role="page" class="page homePage libraryPage allLibraryPage backdropPage pageWithAbsoluteTabs" data-title="${ButtonHome}" data-backdroptype="movie,series,game,book" data-require="scripts/sections,scripts/indexpage,scripts/homenextup,scripts/favorites,scripts/homeupcoming,paperbuttonstyle">
|
||||||
|
|
||||||
<div class="libraryViewNav libraryViewNavWithMinHeight">
|
<div class="libraryViewNav libraryViewNavWithMinHeight">
|
||||||
<paper-tabs style="display:none;">
|
<paper-tabs style="display:none;">
|
||||||
|
|
|
@ -9,12 +9,6 @@
|
||||||
</div>
|
</div>
|
||||||
<div data-role="content" class="itemListContent">
|
<div data-role="content" class="itemListContent">
|
||||||
|
|
||||||
<h1 class="listHeader" style="margin: 0; text-align: center;">
|
|
||||||
<span id="itemName"></span>
|
|
||||||
<span id="editButtonContainer" style="display: none; margin-left: .5em;">
|
|
||||||
<button id="btnEdit" type="button" data-icon="edit" data-inline="true" data-mini="true">${ButtonEdit}</button>
|
|
||||||
</span>
|
|
||||||
</h1>
|
|
||||||
<div class="viewSettings">
|
<div class="viewSettings">
|
||||||
<div class="listTopPaging">
|
<div class="listTopPaging">
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,14 +4,9 @@
|
||||||
<title>Emby</title>
|
<title>Emby</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="playlistEditorPage" data-role="page" class="page libraryPage" data-require="scripts/playlistedit">
|
<div id="playlistEditorPage" data-role="page" class="page libraryPage noSecondaryNavPage" data-require="scripts/playlistedit" data-backbutton="true">
|
||||||
|
|
||||||
<div class="libraryViewNav scopedLibraryViewNav">
|
|
||||||
<a href="playlists.html" class="ui-btn-active"><i class="material-icons">menu</i>${TabPlaylists}</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div data-role="content">
|
<div data-role="content">
|
||||||
<h2 style="text-align:center;" class="playlistName"></h2>
|
|
||||||
<div class="viewSettings">
|
<div class="viewSettings">
|
||||||
<div class="listTopPaging"></div>
|
<div class="listTopPaging"></div>
|
||||||
<paper-button raised class="secondary btnPlay hide"><iron-icon icon="play-arrow"></iron-icon><span>${ButtonPlay}</span></paper-button>
|
<paper-button raised class="secondary btnPlay hide"><iron-icon icon="play-arrow"></iron-icon><span>${ButtonPlay}</span></paper-button>
|
||||||
|
|
|
@ -4,11 +4,7 @@
|
||||||
<title>Emby</title>
|
<title>Emby</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="playlistsPage" data-role="page" class="page libraryPage" data-require="scripts/playlists">
|
<div id="playlistsPage" data-role="page" class="page libraryPage noSecondaryNavPage" data-require="scripts/playlists" data-title="${HeaderPlaylists}">
|
||||||
|
|
||||||
<div class="libraryViewNav scopedLibraryViewNav">
|
|
||||||
<a href="#" class="ui-btn-active"><i class="material-icons">menu</i>${TabPlaylists}</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div data-role="content">
|
<div data-role="content">
|
||||||
<div class="viewSettings">
|
<div class="viewSettings">
|
||||||
|
|
|
@ -60,6 +60,42 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var viblastKey = 'N8FjNTQ3NDdhZqZhNGI5NWU5ZTI=';
|
||||||
|
|
||||||
|
function requireViblast(callback) {
|
||||||
|
require(['thirdparty/viblast/viblast.js'], function () {
|
||||||
|
|
||||||
|
if (htmlMediaRenderer.customViblastKey) {
|
||||||
|
callback();
|
||||||
|
} else {
|
||||||
|
downloadViblastKey(callback);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function downloadViblastKey(callback) {
|
||||||
|
|
||||||
|
var headers = {};
|
||||||
|
headers['X-Emby-Token'] = 'EMBY_SERVER';
|
||||||
|
|
||||||
|
HttpClient.send({
|
||||||
|
type: 'GET',
|
||||||
|
url: 'https://mb3admin.com/admin/service/registration/getViBlastKey',
|
||||||
|
headers: headers
|
||||||
|
|
||||||
|
}).done(function (key) {
|
||||||
|
|
||||||
|
htmlMediaRenderer.customViblastKey = key;
|
||||||
|
callback();
|
||||||
|
}).fail(function () {
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function getViblastKey() {
|
||||||
|
return htmlMediaRenderer.customViblastKey || viblastKey;
|
||||||
|
}
|
||||||
|
|
||||||
function onOneVideoPlaying() {
|
function onOneVideoPlaying() {
|
||||||
|
|
||||||
var requiresNativeControls = !self.enableCustomVideoControls();
|
var requiresNativeControls = !self.enableCustomVideoControls();
|
||||||
|
@ -85,7 +121,7 @@
|
||||||
var element = this;
|
var element = this;
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
element.currentTime = startPositionInSeekParam;
|
element.currentTime = startPositionInSeekParam;
|
||||||
}, 3000);
|
}, 2500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,6 +211,8 @@
|
||||||
.on('error', onError)[0];
|
.on('error', onError)[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Save this for when playback stops, because querying the time at that point might return 0
|
||||||
|
var _currentTime;
|
||||||
self.currentTime = function (val) {
|
self.currentTime = function (val) {
|
||||||
|
|
||||||
if (mediaElement) {
|
if (mediaElement) {
|
||||||
|
@ -183,6 +221,10 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_currentTime) {
|
||||||
|
return _currentTime * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
return (mediaElement.currentTime || 0) * 1000;
|
return (mediaElement.currentTime || 0) * 1000;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -201,11 +243,10 @@
|
||||||
mediaElement.pause();
|
mediaElement.pause();
|
||||||
|
|
||||||
if (isViblastStarted) {
|
if (isViblastStarted) {
|
||||||
requirejs(['thirdparty/viblast.js'], function () {
|
_currentTime = mediaElement.currentTime;
|
||||||
|
|
||||||
viblast(mediaElement).stop();
|
viblast(mediaElement).stop();
|
||||||
isViblastStarted = false;
|
isViblastStarted = false;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -270,7 +311,7 @@
|
||||||
setTracks(elem, tracks || []);
|
setTracks(elem, tracks || []);
|
||||||
|
|
||||||
viblast(elem).setup({
|
viblast(elem).setup({
|
||||||
key: 'N8FjNTQ3NDdhZqZhNGI5NWU5ZTI=',
|
key: getViblastKey(),
|
||||||
stream: val
|
stream: val
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -322,6 +363,7 @@
|
||||||
self.cleanup = function (destroyRenderer) {
|
self.cleanup = function (destroyRenderer) {
|
||||||
|
|
||||||
self.setCurrentSrc(null);
|
self.setCurrentSrc(null);
|
||||||
|
_currentTime = null;
|
||||||
|
|
||||||
var elem = mediaElement;
|
var elem = mediaElement;
|
||||||
|
|
||||||
|
@ -459,7 +501,7 @@
|
||||||
|
|
||||||
if (options.type == 'video' && enableViblast()) {
|
if (options.type == 'video' && enableViblast()) {
|
||||||
|
|
||||||
requirejs(['thirdparty/viblast.js'], function () {
|
requireViblast(function () {
|
||||||
|
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
});
|
});
|
||||||
|
|
|
@ -135,9 +135,7 @@
|
||||||
name = item.ParentIndexNumber + "." + name;
|
name = item.ParentIndexNumber + "." + name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#itemName', page).html(name);
|
LibraryMenu.setTitle(name);
|
||||||
|
|
||||||
Dashboard.setPageTitle(name);
|
|
||||||
|
|
||||||
$(page).trigger('displayingitem', [{
|
$(page).trigger('displayingitem', [{
|
||||||
|
|
||||||
|
@ -147,16 +145,6 @@
|
||||||
LibraryBrowser.setLastRefreshed(page);
|
LibraryBrowser.setLastRefreshed(page);
|
||||||
Dashboard.hideLoadingMsg();
|
Dashboard.hideLoadingMsg();
|
||||||
});
|
});
|
||||||
|
|
||||||
Dashboard.getCurrentUser().done(function (user) {
|
|
||||||
|
|
||||||
if (user.Policy.IsAdministrator && query.ParentId && !AppInfo.isNativeApp) {
|
|
||||||
$('#editButtonContainer', page).show();
|
|
||||||
} else {
|
|
||||||
$('#editButtonContainer', page).hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateFilterControls(page) {
|
function updateFilterControls(page) {
|
||||||
|
@ -247,11 +235,6 @@
|
||||||
LibraryBrowser.saveViewSetting(getParameterByName('parentId'), view);
|
LibraryBrowser.saveViewSetting(getParameterByName('parentId'), view);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#btnEdit', page).on('click', function () {
|
|
||||||
|
|
||||||
Dashboard.navigate("edititemmetadata.html?id=" + currentItem.Id);
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.alphabetPicker', this).on('alphaselect', function (e, character) {
|
$('.alphabetPicker', this).on('alphaselect', function (e, character) {
|
||||||
|
|
||||||
var query = getQuery();
|
var query = getQuery();
|
||||||
|
|
|
@ -372,7 +372,7 @@
|
||||||
var section = this.getElementsByClassName('sectionName')[0];
|
var section = this.getElementsByClassName('sectionName')[0];
|
||||||
var text = section ? section.innerHTML : this.innerHTML;
|
var text = section ? section.innerHTML : this.innerHTML;
|
||||||
|
|
||||||
document.querySelector('.libraryMenuButtonText').innerHTML = text;
|
LibraryMenu.setTitle(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateLibraryMenu(user) {
|
function updateLibraryMenu(user) {
|
||||||
|
@ -495,11 +495,6 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function setLibraryMenuText(text) {
|
|
||||||
|
|
||||||
document.querySelector('.libraryMenuButtonText').innerHTML = '<span>' + text + '</span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTopParentId() {
|
function getTopParentId() {
|
||||||
|
|
||||||
return getParameterByName('topParentId') || null;
|
return getParameterByName('topParentId') || null;
|
||||||
|
@ -508,8 +503,6 @@
|
||||||
window.LibraryMenu = {
|
window.LibraryMenu = {
|
||||||
getTopParentId: getTopParentId,
|
getTopParentId: getTopParentId,
|
||||||
|
|
||||||
setText: setLibraryMenuText,
|
|
||||||
|
|
||||||
onLinkClicked: function (event, link) {
|
onLinkClicked: function (event, link) {
|
||||||
|
|
||||||
if (event.which != 1) {
|
if (event.which != 1) {
|
||||||
|
@ -558,6 +551,10 @@
|
||||||
// There doesn't seem to be a way to detect if the drawer is in the process of opening, so try to handle that here
|
// There doesn't seem to be a way to detect if the drawer is in the process of opening, so try to handle that here
|
||||||
Dashboard.navigate('dashboard.html');
|
Dashboard.navigate('dashboard.html');
|
||||||
return false;
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
setTitle: function (title) {
|
||||||
|
document.querySelector('.libraryMenuButtonText').innerHTML = title;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -647,20 +644,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateContextText(page) {
|
|
||||||
|
|
||||||
var name = page.getAttribute('data-contextname');
|
|
||||||
|
|
||||||
if (name) {
|
|
||||||
|
|
||||||
document.querySelector('.libraryMenuButtonText').innerHTML = '<span>' + name + '</span>';
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (page.classList.contains('allLibraryPage') || page.classList.contains('type-interior')) {
|
|
||||||
document.querySelector('.libraryMenuButtonText').innerHTML = Globalize.translate('ButtonHome');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onWebSocketMessage(e, data) {
|
function onWebSocketMessage(e, data) {
|
||||||
|
|
||||||
var msg = data;
|
var msg = data;
|
||||||
|
@ -700,14 +683,12 @@
|
||||||
updateCastIcon();
|
updateCastIcon();
|
||||||
|
|
||||||
updateLibraryNavLinks(page);
|
updateLibraryNavLinks(page);
|
||||||
updateContextText(page);
|
|
||||||
requiresViewMenuRefresh = false;
|
requiresViewMenuRefresh = false;
|
||||||
|
|
||||||
ConnectionManager.user(window.ApiClient).done(addUserToHeader);
|
ConnectionManager.user(window.ApiClient).done(addUserToHeader);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
viewMenuBar.classList.remove('hide');
|
viewMenuBar.classList.remove('hide');
|
||||||
updateContextText(page);
|
|
||||||
updateLibraryNavLinks(page);
|
updateLibraryNavLinks(page);
|
||||||
updateViewMenuBarHeadroom(page, viewMenuBar);
|
updateViewMenuBarHeadroom(page, viewMenuBar);
|
||||||
requiresViewMenuRefresh = false;
|
requiresViewMenuRefresh = false;
|
||||||
|
@ -743,10 +724,16 @@
|
||||||
var isLibraryPage = page.classList.contains('libraryPage');
|
var isLibraryPage = page.classList.contains('libraryPage');
|
||||||
var darkDrawer = false;
|
var darkDrawer = false;
|
||||||
|
|
||||||
|
var title = page.getAttribute('data-title') || page.getAttribute('data-contextname');
|
||||||
|
|
||||||
|
if (title) {
|
||||||
|
LibraryMenu.setTitle(title);
|
||||||
|
}
|
||||||
|
|
||||||
var titleKey = getParameterByName('titlekey');
|
var titleKey = getParameterByName('titlekey');
|
||||||
|
|
||||||
if (titleKey) {
|
if (titleKey) {
|
||||||
document.querySelector('.libraryMenuButtonText').innerHTML = Globalize.translate(titleKey);
|
LibraryMenu.setTitle(Globalize.translate(titleKey));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (page.getAttribute('data-menubutton') == 'false') {
|
if (page.getAttribute('data-menubutton') == 'false') {
|
||||||
|
|
|
@ -1102,14 +1102,6 @@
|
||||||
errorMsg += '</p>';
|
errorMsg += '</p>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($.browser.msie && !$.browser.mobile && !self.canPlayWebm()) {
|
|
||||||
errorMsg += '<p>';
|
|
||||||
errorMsg += '<a href="https://tools.google.com/dlpage/webmmf/" target="_blank">';
|
|
||||||
errorMsg += Globalize.translate('MessageInternetExplorerWebm');
|
|
||||||
errorMsg += '</a>';
|
|
||||||
errorMsg += '</p>';
|
|
||||||
}
|
|
||||||
|
|
||||||
Dashboard.alert({
|
Dashboard.alert({
|
||||||
title: Globalize.translate('HeaderVideoError'),
|
title: Globalize.translate('HeaderVideoError'),
|
||||||
message: errorMsg
|
message: errorMsg
|
||||||
|
|
|
@ -545,14 +545,14 @@
|
||||||
|
|
||||||
// viblast can help us here
|
// viblast can help us here
|
||||||
//return true;
|
//return true;
|
||||||
//return window.MediaSource != null;
|
return window.MediaSource != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($.browser.msie) {
|
if ($.browser.msie) {
|
||||||
|
|
||||||
// viblast can help us here
|
// viblast can help us here
|
||||||
//return true;
|
//return true;
|
||||||
//return window.MediaSource != null;
|
return window.MediaSource != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -742,6 +742,8 @@
|
||||||
|
|
||||||
self.play = function (options) {
|
self.play = function (options) {
|
||||||
|
|
||||||
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
Dashboard.getCurrentUser().done(function (user) {
|
Dashboard.getCurrentUser().done(function (user) {
|
||||||
|
|
||||||
if (options.items) {
|
if (options.items) {
|
||||||
|
@ -775,6 +777,11 @@
|
||||||
|
|
||||||
var firstItem = items[0];
|
var firstItem = items[0];
|
||||||
|
|
||||||
|
if (firstItem.MediaType === "Video") {
|
||||||
|
|
||||||
|
Dashboard.showModalLoadingMsg();
|
||||||
|
}
|
||||||
|
|
||||||
if (options.startPositionTicks || firstItem.MediaType !== 'Video') {
|
if (options.startPositionTicks || firstItem.MediaType !== 'Video') {
|
||||||
|
|
||||||
self.playInternal(firstItem, options.startPositionTicks, function () {
|
self.playInternal(firstItem, options.startPositionTicks, function () {
|
||||||
|
@ -929,6 +936,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.IsPlaceHolder) {
|
if (item.IsPlaceHolder) {
|
||||||
|
Dashboard.hideModalLoadingMsg();
|
||||||
MediaController.showPlaybackInfoErrorMessage('PlaceHolder');
|
MediaController.showPlaybackInfoErrorMessage('PlaceHolder');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1666,7 +1674,13 @@
|
||||||
|
|
||||||
function sendProgressUpdate() {
|
function sendProgressUpdate() {
|
||||||
|
|
||||||
var state = self.getPlayerStateInternal(self.currentMediaRenderer, self.currentItem, self.currentMediaSource);
|
var mediaRenderer = self.currentMediaRenderer;
|
||||||
|
|
||||||
|
if (mediaRenderer.enableProgressReporting === false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var state = self.getPlayerStateInternal(mediaRenderer, self.currentItem, self.currentMediaSource);
|
||||||
|
|
||||||
var info = {
|
var info = {
|
||||||
QueueableMediaTypes: state.NowPlayingItem.MediaType,
|
QueueableMediaTypes: state.NowPlayingItem.MediaType,
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
var user = response2[0];
|
var user = response2[0];
|
||||||
var item = response3[0];
|
var item = response3[0];
|
||||||
|
|
||||||
$('.playlistName', page).html(item.Name);
|
LibraryMenu.setTitle(item.Name);
|
||||||
|
|
||||||
_childrenItemsFunction = getItemsFunction(query);
|
_childrenItemsFunction = getItemsFunction(query);
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,6 @@
|
||||||
items: result.Items,
|
items: result.Items,
|
||||||
shape: "backdrop",
|
shape: "backdrop",
|
||||||
preferThumb: true,
|
preferThumb: true,
|
||||||
context: 'tv',
|
|
||||||
lazy: true,
|
lazy: true,
|
||||||
overlayText: true
|
overlayText: true
|
||||||
});
|
});
|
||||||
|
@ -84,7 +83,6 @@
|
||||||
items: result.Items,
|
items: result.Items,
|
||||||
shape: "backdrop",
|
shape: "backdrop",
|
||||||
preferThumb: true,
|
preferThumb: true,
|
||||||
context: 'tv',
|
|
||||||
lazy: true,
|
lazy: true,
|
||||||
cardLayout: true,
|
cardLayout: true,
|
||||||
showTitle: true,
|
showTitle: true,
|
||||||
|
@ -97,7 +95,6 @@
|
||||||
items: result.Items,
|
items: result.Items,
|
||||||
shape: "banner",
|
shape: "banner",
|
||||||
preferBanner: true,
|
preferBanner: true,
|
||||||
context: 'tv',
|
|
||||||
lazy: true
|
lazy: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -105,33 +102,38 @@
|
||||||
|
|
||||||
html = LibraryBrowser.getListViewHtml({
|
html = LibraryBrowser.getListViewHtml({
|
||||||
items: result.Items,
|
items: result.Items,
|
||||||
context: 'tv',
|
|
||||||
sortBy: query.SortBy
|
sortBy: query.SortBy
|
||||||
});
|
});
|
||||||
trigger = true;
|
trigger = true;
|
||||||
}
|
}
|
||||||
else if (view == "PosterCard") {
|
|
||||||
html = LibraryBrowser.getPosterViewHtml({
|
|
||||||
items: result.Items,
|
|
||||||
shape: "portrait",
|
|
||||||
context: 'tv',
|
|
||||||
showTitle: true,
|
|
||||||
showYear: true,
|
|
||||||
lazy: true,
|
|
||||||
cardLayout: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
|
|
||||||
// Poster
|
var posterOptions = {
|
||||||
html = LibraryBrowser.getPosterViewHtml({
|
|
||||||
items: result.Items,
|
items: result.Items,
|
||||||
shape: "portrait",
|
shape: "auto",
|
||||||
context: 'tv',
|
|
||||||
centerText: true,
|
centerText: true,
|
||||||
lazy: true,
|
lazy: true,
|
||||||
overlayText: true
|
overlayText: true
|
||||||
});
|
};
|
||||||
|
|
||||||
|
if (query.IncludeItemTypes == "MusicAlbum") {
|
||||||
|
posterOptions.overlayText = false;
|
||||||
|
posterOptions.showParentTitle = true;
|
||||||
|
posterOptions.overlayPlayButton = true;
|
||||||
|
}
|
||||||
|
else if (query.IncludeItemTypes == "MusicArtist") {
|
||||||
|
posterOptions.overlayText = false;
|
||||||
|
posterOptions.overlayPlayButton = true;
|
||||||
|
}
|
||||||
|
else if (query.IncludeItemTypes == "Episode") {
|
||||||
|
posterOptions.overlayText = false;
|
||||||
|
posterOptions.showParentTitle = true;
|
||||||
|
posterOptions.overlayPlayButton = true;
|
||||||
|
posterOptions.centerText = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Poster
|
||||||
|
html = LibraryBrowser.getPosterViewHtml(posterOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
var elem = page.querySelector('#items');
|
var elem = page.querySelector('#items');
|
||||||
|
|
|
@ -332,7 +332,7 @@
|
||||||
|
|
||||||
var text = textElem.html();
|
var text = textElem.html();
|
||||||
|
|
||||||
LibraryMenu.setText(text);
|
LibraryMenu.setTitle(text);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
976
dashboard-ui/thirdparty/viblast.js
vendored
976
dashboard-ui/thirdparty/viblast.js
vendored
File diff suppressed because one or more lines are too long
354
dashboard-ui/thirdparty/viblast/viblast.crypto.js
vendored
Normal file
354
dashboard-ui/thirdparty/viblast/viblast.crypto.js
vendored
Normal file
File diff suppressed because one or more lines are too long
979
dashboard-ui/thirdparty/viblast/viblast.js
vendored
Normal file
979
dashboard-ui/thirdparty/viblast/viblast.js
vendored
Normal file
File diff suppressed because one or more lines are too long
220
dashboard-ui/thirdparty/viblast/viblast.msp.js
vendored
Normal file
220
dashboard-ui/thirdparty/viblast/viblast.msp.js
vendored
Normal file
File diff suppressed because one or more lines are too long
16
dashboard-ui/thirdparty/viblast/worker.html
vendored
Normal file
16
dashboard-ui/thirdparty/viblast/worker.html
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<script>
|
||||||
|
var worker = new Worker(decodeURIComponent(window.location.search.substring(1)));
|
||||||
|
|
||||||
|
window.onmessage = function(evt) {
|
||||||
|
worker.postMessage(evt.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
worker.onmessage = function(evt) {
|
||||||
|
window.parent.postMessage(evt.data, "*");
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue