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

update components

This commit is contained in:
Luke Pulverenti 2016-04-02 12:15:48 -04:00
parent cc555065f7
commit c3fd6c022f
54 changed files with 296 additions and 87 deletions

View file

@ -1,7 +1,7 @@
{
"name": "neon-animation",
"description": "A system for animating Polymer-based web components",
"version": "1.1.1",
"version": "1.2.0",
"authors": [
"The Polymer Authors"
],
@ -49,11 +49,11 @@
"iron-icons": "PolymerElements/iron-icons#^1.0.0",
"paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0"
},
"_release": "1.1.1",
"_release": "1.2.0",
"_resolution": {
"type": "version",
"tag": "v1.1.1",
"commit": "e1fefa09ec01a51cbb809a85a72f74b9b6f60c22"
"tag": "v1.2.0",
"commit": "2d3416a01f865a25fe581ad0cfcda6ae4f9cf142"
},
"_source": "git://github.com/polymerelements/neon-animation.git",
"_target": "^1.0.0",

View file

@ -0,0 +1,33 @@
<!-- Instructions: https://github.com/PolymerElements/neon-animation/CONTRIBUTING.md#filing-issues -->
### Description
<!-- Example: The `paper-foo` element causes the page to turn pink when clicked. -->
### Expected outcome
<!-- Example: The page stays the same color. -->
### Actual outcome
<!-- Example: The page turns pink. -->
### Live Demo
<!-- Example: https://jsbin.com/cagaye/edit?html,output -->
### Steps to reproduce
<!-- Example
1. Put a `paper-foo` element in the page.
2. Open the page in a web browser.
3. Click the `paper-foo` element.
-->
### Browsers Affected
<!-- Check all that apply -->
- [ ] Chrome
- [ ] Firefox
- [ ] Safari 9
- [ ] Safari 8
- [ ] Safari 7
- [ ] Edge
- [ ] IE 11
- [ ] IE 10

View file

@ -38,18 +38,6 @@ Configuration:
Polymer.NeonAnimationBehavior
],
properties: {
/** @type {!Polymer.IronMeta} */
_animationMeta: {
type: Object,
value: function() {
return new Polymer.IronMeta({type: 'animation'});
}
}
},
/**
* @param {{
* animation: string,
@ -59,13 +47,6 @@ Configuration:
* }} config
*/
configure: function(config) {
var animationConstructor = /** @type {Function} */ (
this._animationMeta.byKey(config.animation));
if (!animationConstructor) {
console.warn(this.is + ':', 'constructor for', config.animation, 'not found!');
return;
}
this._animations = [];
var nodes = config.nodes;
var effects = [];
@ -75,17 +56,29 @@ Configuration:
config.timing.delay = config.timing.delay || 0;
var oldDelay = config.timing.delay;
var abortedConfigure;
for (var node, index = 0; node = nodes[index]; index++) {
config.timing.delay += nodeDelay;
config.node = node;
var animation = new animationConstructor();
var effect = animation.configure(config);
var animation = document.createElement(config.animation);
if (animation.isNeonAnimation) {
var effect = animation.configure(config);
this._animations.push(animation);
effects.push(effect);
this._animations.push(animation);
effects.push(effect);
} else {
console.warn(this.is + ':', config.animation, 'not found!');
abortedConfigure = true;
break;
}
}
config.timing.delay = oldDelay;
config.node = null;
// if a bad animation was configured, abort config.
if (abortedConfigure) {
return;
}
this._effect = new GroupEffect(effects);
return this._effect;

View file

@ -1,7 +1,7 @@
{
"name": "neon-animation",
"description": "A system for animating Polymer-based web components",
"version": "1.1.1",
"version": "1.2.0",
"authors": [
"The Polymer Authors"
],

View file

@ -1,5 +1,6 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,5 +1,6 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,5 +1,6 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,5 +1,6 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,5 +1,6 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,5 +1,6 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,5 +1,6 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,5 +1,6 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,5 +1,6 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -37,9 +37,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
registered: function() {
new Polymer.IronMeta({type: 'animation', key: this.is, value: this.constructor});
},
/**
* Can be used to determine that elements implement this behavior.
*/
isNeonAnimation: true,
/**
* Do any animation configuration here.

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
@ -21,13 +22,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
properties: {
_animationMeta: {
type: Object,
value: function() {
return new Polymer.IronMeta({type: 'animation'});
}
},
/** @type {?Object} */
_player: {
type: Object
@ -39,9 +33,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
var allAnimations = [];
if (allConfigs.length > 0) {
for (var config, index = 0; config = allConfigs[index]; index++) {
var animationConstructor = this._animationMeta.byKey(config.name);
if (animationConstructor) {
var animation = animationConstructor && new animationConstructor();
var animation = document.createElement(config.name);
// is this element actually a neon animation?
if (animation.isNeonAnimation) {
var effect = animation.configure(config);
if (effect) {
allAnimations.push({

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -1,4 +1,5 @@
<!DOCTYPE html><!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
@ -15,7 +16,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<script>
WCT.loadSuites([
'neon-animated-pages.html',
'neon-animated-pages.html?dom=shadow'
'neon-animated-pages.html?dom=shadow',
'neon-animated-pages-lazy.html',
'neon-animated-pages-lazy.html?dom=shadow'
]);
</script>

View file

@ -0,0 +1,73 @@
<!doctype html>
<!--
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
<title>neon-animated-pages tests</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script>Polymer = {lazyRegister: true}</script>
<script src="../../web-component-tester/browser.js"></script>
<script src="../../test-fixture/test-fixture-mocha.js"></script>
<link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="../neon-animated-pages.html">
<link rel="import" href="../neon-animatable.html">
<link rel="import" href="../animations/slide-from-left-animation.html">
<link rel="import" href="../animations/slide-right-animation.html">
<link rel="import" href="test-resizable-pages.html">
</head>
<body>
<test-fixture id="animate-initial-selection">
<template>
<neon-animated-pages entry-animation="slide-from-left-animation" exit-animation="slide-right-animation" animate-initial-selection>
<neon-animatable></neon-animatable>
<neon-animatable></neon-animatable>
</neon-animated-pages>
</template>
</test-fixture>
<script>
suite('animations found when `lazRegister` setting is true', function() {
test('animations are registered', function(done) {
var animatedPages = fixture('animate-initial-selection');
animatedPages._completeAnimations = sinon.spy();
assert.isUndefined(animatedPages.selected);
var pages = Polymer.dom(animatedPages).children;
animatedPages.addEventListener('neon-animation-finish', function(event) {
if (animatedPages.selected === 0) {
animatedPages.selected = 1;
return;
}
assert.strictEqual(animatedPages.selected, 1);
assert.equal(event.detail.fromPage, pages[0]);
assert.equal(event.detail.toPage, pages[1]);
assert.isTrue(animatedPages._completeAnimations.calledTwice);
var a$ = animatedPages._completeAnimations.getCall(1).args[0];
assert.isTrue(a$[0].animation.isNeonAnimation, 'default animation is not a registered animation');
assert.isTrue(a$[1].animation.isNeonAnimation, 'entry animation is not a registered animation');
assert.isTrue(a$[2].animation.isNeonAnimation, 'exit animation is not a registered animation');
done();
});
animatedPages.selected = 0;
});
});
</script>
</body>
</html>

View file

@ -1,5 +1,6 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
@ -24,8 +25,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="../neon-animated-pages.html">
<link rel="import" href="../neon-animatable.html">
<link rel="import" href="../animations/slide-from-top-animation.html">
<link rel="import" href="../animations/slide-down-animation.html">
<link rel="import" href="../animations/slide-from-left-animation.html">
<link rel="import" href="../animations/slide-right-animation.html">
<link rel="import" href="test-resizable-pages.html">
</head>