polymer-paper-rails 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -18
- data/app/assets/components/core-a11y-keys/core-a11y-keys.html +4 -4
- data/app/assets/components/core-animation/web-animations.html +1 -1
- data/app/assets/components/core-collapse/core-collapse.html +1 -1
- data/app/assets/components/core-drawer-panel/core-drawer-panel.css +14 -6
- data/app/assets/components/core-drawer-panel/core-drawer-panel.html +32 -8
- data/app/assets/components/core-dropdown/core-dropdown.html +8 -2
- data/app/assets/components/core-icon/core-icon.html +0 -2
- data/app/assets/components/core-icons/av-icons.html +2 -9
- data/app/assets/components/core-icons/communication-icons.html +39 -42
- data/app/assets/components/core-icons/core-icons.html +231 -235
- data/app/assets/components/core-icons/device-icons.html +75 -90
- data/app/assets/components/core-icons/editor-icons.html +52 -52
- data/app/assets/components/core-icons/hardware-icons.html +40 -41
- data/app/assets/components/core-icons/image-icons.html +133 -137
- data/app/assets/components/core-icons/maps-icons.html +55 -57
- data/app/assets/components/core-icons/notification-icons.html +34 -34
- data/app/assets/components/core-icons/social-icons.html +23 -37
- data/app/assets/components/core-menu/core-menu.html +8 -3
- data/app/assets/components/core-menu/core-submenu.html +2 -2
- data/app/assets/components/core-overlay/core-key-helper.html +3 -0
- data/app/assets/components/core-overlay/core-overlay-layer.html +3 -0
- data/app/assets/components/core-overlay/core-overlay.html +20 -4
- data/app/assets/components/core-resizable/core-resizable.html +248 -0
- data/app/assets/components/core-scroll-header-panel/core-scroll-header-panel.html +14 -3
- data/app/assets/components/core-selection/core-selection.html +1 -1
- data/app/assets/components/core-selector/core-selector.html +26 -26
- data/app/assets/components/core-style/core-style.html +1 -1
- data/app/assets/components/core-toolbar/core-toolbar.html +1 -1
- data/app/assets/components/paper-button/paper-button-base.html +56 -12
- data/app/assets/components/paper-button/paper-button.html +22 -5
- data/app/assets/components/paper-checkbox/paper-checkbox.css +65 -184
- data/app/assets/components/paper-checkbox/paper-checkbox.html +47 -55
- data/app/assets/components/paper-dialog/paper-action-dialog.html +3 -3
- data/app/assets/components/paper-dialog/paper-dialog.html +2 -2
- data/app/assets/components/paper-dropdown-menu/paper-dropdown-menu.html +4 -1
- data/app/assets/components/{core-elements → paper-elements}/metadata.html +0 -0
- data/app/assets/components/{core-elements → paper-elements}/paper-elements.html +1 -0
- data/app/assets/components/paper-fab/paper-fab.html +2 -2
- data/app/assets/components/paper-input/paper-autogrow-textarea.html +8 -3
- data/app/assets/components/paper-input/paper-char-counter.html +121 -0
- data/app/assets/components/paper-input/paper-input-decorator.css +1 -21
- data/app/assets/components/paper-input/paper-input-decorator.html +130 -51
- data/app/assets/components/paper-input/paper-input.html +31 -5
- data/app/assets/components/paper-item/paper-item.html +1 -2
- data/app/assets/components/paper-progress/paper-progress.html +1 -1
- data/app/assets/components/paper-radio-button/paper-radio-button.css +16 -12
- data/app/assets/components/paper-radio-button/paper-radio-button.html +9 -3
- data/app/assets/components/paper-ripple/paper-ripple.html +2 -1
- data/app/assets/components/paper-shadow/paper-shadow.css +10 -10
- data/app/assets/components/paper-shadow/paper-shadow.html +8 -1
- data/app/assets/components/paper-slider/paper-slider.html +28 -4
- data/app/assets/components/paper-spinner/paper-spinner.css +35 -23
- data/app/assets/components/paper-spinner/paper-spinner.html +46 -5
- data/app/assets/components/paper-tabs/paper-tabs.css +5 -0
- data/app/assets/components/paper-tabs/paper-tabs.html +32 -7
- data/app/assets/components/paper-toggle-button/paper-toggle-button.css +58 -30
- data/app/assets/components/paper-toggle-button/paper-toggle-button.html +69 -44
- data/app/assets/components/sampler-scaffold/sampler-scaffold.css +1 -1
- data/app/assets/components/web-animations-js/web-animations-next-lite.min.js +17 -0
- data/app/assets/components/web-animations-js/web-animations-next.min.js +17 -0
- data/app/assets/components/web-animations-js/web-animations.min.js +17 -0
- data/app/assets/components/webcomponentsjs/CustomElements.js +634 -0
- data/app/assets/components/webcomponentsjs/CustomElements.min.js +11 -0
- data/app/assets/components/webcomponentsjs/HTMLImports.js +764 -0
- data/app/assets/components/webcomponentsjs/HTMLImports.min.js +11 -0
- data/app/assets/components/webcomponentsjs/ShadowDOM.js +4277 -0
- data/app/assets/components/webcomponentsjs/ShadowDOM.min.js +13 -0
- data/app/assets/components/webcomponentsjs/package.json +31 -0
- data/app/assets/components/webcomponentsjs/webcomponents-lite.js +1728 -0
- data/app/assets/components/webcomponentsjs/webcomponents-lite.min.js +11 -0
- data/app/assets/components/webcomponentsjs/webcomponents.js +6114 -0
- data/app/assets/components/webcomponentsjs/webcomponents.min.js +14 -0
- data/lib/polymer-paper-rails/version.rb +1 -1
- metadata +20 -71
- data/app/assets/components/core-dropdown/metadata.html +0 -62
- data/app/assets/components/core-icons/png-icons.html +0 -19
- data/app/assets/components/core-label/core-label.html +0 -124
- data/app/assets/components/core-overlay/tests/html/core-overlay-basic.html +0 -127
- data/app/assets/components/core-overlay/tests/html/core-overlay-positioning-margin.html +0 -153
- data/app/assets/components/core-overlay/tests/html/core-overlay-positioning.html +0 -167
- data/app/assets/components/core-overlay/tests/html/core-overlay-scroll.html +0 -130
- data/app/assets/components/core-overlay/tests/js/htmltests.js +0 -6
- data/app/assets/components/core-overlay/tests/runner.html +0 -14
- data/app/assets/components/core-overlay/tests/tests.json +0 -6
- data/app/assets/components/core-popup-menu/core-popup-menu.css +0 -28
- data/app/assets/components/core-popup-menu/core-popup-menu.html +0 -198
- data/app/assets/components/core-popup-menu/core-popup-overlay.html +0 -111
- data/app/assets/components/core-popup-menu/metadata.html +0 -62
- data/app/assets/components/paper-focusable/paper-focusable.html +0 -146
- data/app/assets/components/platform/platform.js +0 -16
- data/app/assets/components/web-animations-js/web-animations.js +0 -5529
- data/app/assets/components/web-animations-next/Gruntfile.js +0 -279
- data/app/assets/components/web-animations-next/History.md +0 -76
- data/app/assets/components/web-animations-next/package.json +0 -33
- data/app/assets/components/web-animations-next/src/animation-constructor.js +0 -139
- data/app/assets/components/web-animations-next/src/animation-node.js +0 -31
- data/app/assets/components/web-animations-next/src/animation.js +0 -65
- data/app/assets/components/web-animations-next/src/apply-preserving-inline-style.js +0 -192
- data/app/assets/components/web-animations-next/src/apply.js +0 -25
- data/app/assets/components/web-animations-next/src/box-handler.js +0 -57
- data/app/assets/components/web-animations-next/src/color-handler.js +0 -62
- data/app/assets/components/web-animations-next/src/deprecation.js +0 -42
- data/app/assets/components/web-animations-next/src/dev.js +0 -16
- data/app/assets/components/web-animations-next/src/dimension-handler.js +0 -167
- data/app/assets/components/web-animations-next/src/effect-callback.js +0 -86
- data/app/assets/components/web-animations-next/src/effect.js +0 -110
- data/app/assets/components/web-animations-next/src/element-animatable.js +0 -19
- data/app/assets/components/web-animations-next/src/font-weight-handler.js +0 -42
- data/app/assets/components/web-animations-next/src/group-constructors.js +0 -81
- data/app/assets/components/web-animations-next/src/handler-utils.js +0 -177
- data/app/assets/components/web-animations-next/src/interpolation.js +0 -49
- data/app/assets/components/web-animations-next/src/matrix-decomposition.js +0 -452
- data/app/assets/components/web-animations-next/src/matrix-interpolation.js +0 -130
- data/app/assets/components/web-animations-next/src/maxifill-player.js +0 -162
- data/app/assets/components/web-animations-next/src/normalize-keyframes.js +0 -259
- data/app/assets/components/web-animations-next/src/number-handler.js +0 -72
- data/app/assets/components/web-animations-next/src/player.js +0 -193
- data/app/assets/components/web-animations-next/src/position-handler.js +0 -117
- data/app/assets/components/web-animations-next/src/property-interpolation.js +0 -62
- data/app/assets/components/web-animations-next/src/property-names.js +0 -35
- data/app/assets/components/web-animations-next/src/scope.js +0 -20
- data/app/assets/components/web-animations-next/src/shadow-handler.js +0 -108
- data/app/assets/components/web-animations-next/src/shape-handler.js +0 -85
- data/app/assets/components/web-animations-next/src/tick.js +0 -148
- data/app/assets/components/web-animations-next/src/timeline.js +0 -77
- data/app/assets/components/web-animations-next/src/timing-utilities.js +0 -242
- data/app/assets/components/web-animations-next/src/transform-handler.js +0 -262
- data/app/assets/components/web-animations-next/src/visibility-handler.js +0 -29
- data/app/assets/components/web-animations-next/target-config.js +0 -124
- data/app/assets/components/web-animations-next/target-loader.js +0 -13
- data/app/assets/components/web-animations-next/templates/boilerplate +0 -13
- data/app/assets/components/web-animations-next/templates/runner.html +0 -26
- data/app/assets/components/web-animations-next/templates/web-animations.html +0 -18
- data/app/assets/components/web-animations-next/templates/web-animations.js +0 -21
- data/app/assets/components/web-animations-next/web-animations-next-lite.dev.html +0 -44
- data/app/assets/components/web-animations-next/web-animations-next-lite.dev.js +0 -21
- data/app/assets/components/web-animations-next/web-animations-next.dev.html +0 -49
- data/app/assets/components/web-animations-next/web-animations-next.dev.js +0 -21
- data/app/assets/components/web-animations-next/web-animations.dev.html +0 -44
- data/app/assets/components/web-animations-next/web-animations.dev.js +0 -21
- data/app/assets/components/web-animations-next/web-animations.html +0 -50
@@ -1,20 +0,0 @@
|
|
1
|
-
// Copyright 2014 Google Inc. All rights reserved.
|
2
|
-
//
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
// you may not use this file except in compliance with the License.
|
5
|
-
// You may obtain a copy of the License at
|
6
|
-
//
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
//
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
// See the License for the specific language governing permissions and
|
13
|
-
// limitations under the License.
|
14
|
-
|
15
|
-
var webAnimationsShared = {};
|
16
|
-
var webAnimationsMinifill = {};
|
17
|
-
var webAnimationsMaxifill = {};
|
18
|
-
|
19
|
-
if (!WEB_ANIMATIONS_TESTING)
|
20
|
-
var webAnimationsTesting = null;
|
@@ -1,108 +0,0 @@
|
|
1
|
-
// Copyright 2014 Google Inc. All rights reserved.
|
2
|
-
//
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
// you may not use this file except in compliance with the License.
|
5
|
-
// You may obtain a copy of the License at
|
6
|
-
//
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
//
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
// See the License for the specific language governing permissions and
|
13
|
-
// limitations under the License.
|
14
|
-
|
15
|
-
(function(scope) {
|
16
|
-
|
17
|
-
function consumeShadow(string) {
|
18
|
-
var shadow = {
|
19
|
-
inset: false,
|
20
|
-
lengths: [],
|
21
|
-
color: null,
|
22
|
-
};
|
23
|
-
function consumePart(string) {
|
24
|
-
var result = scope.consumeToken(/^inset/i, string);
|
25
|
-
if (result) {
|
26
|
-
shadow.inset = true;
|
27
|
-
return result;
|
28
|
-
}
|
29
|
-
var result = scope.consumeLengthOrPercent(string);
|
30
|
-
if (result) {
|
31
|
-
shadow.lengths.push(result[0]);
|
32
|
-
return result;
|
33
|
-
}
|
34
|
-
var result = scope.consumeColor(string);
|
35
|
-
if (result) {
|
36
|
-
shadow.color = result[0];
|
37
|
-
return result;
|
38
|
-
}
|
39
|
-
}
|
40
|
-
var result = scope.consumeRepeated(consumePart, /^/, string);
|
41
|
-
if (result && result[0].length) {
|
42
|
-
return [shadow, result[1]];
|
43
|
-
}
|
44
|
-
}
|
45
|
-
|
46
|
-
function parseShadowList(string) {
|
47
|
-
var result = scope.consumeRepeated(consumeShadow, /^,/, string);
|
48
|
-
if (result && result[1] == '') {
|
49
|
-
return result[0];
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
|
-
function mergeShadow(left, right) {
|
54
|
-
while (left.lengths.length < Math.max(left.lengths.length, right.lengths.length))
|
55
|
-
left.lengths.push({px: 0});
|
56
|
-
while (right.lengths.length < Math.max(left.lengths.length, right.lengths.length))
|
57
|
-
right.lengths.push({px: 0});
|
58
|
-
|
59
|
-
if (left.inset != right.inset || !!left.color != !!right.color) {
|
60
|
-
return;
|
61
|
-
}
|
62
|
-
var lengthReconstitution = [];
|
63
|
-
var colorReconstitution;
|
64
|
-
var matchingLeft = [[], 0];
|
65
|
-
var matchingRight = [[], 0];
|
66
|
-
for (var i = 0; i < left.lengths.length; i++) {
|
67
|
-
var mergedDimensions = scope.mergeDimensions(left.lengths[i], right.lengths[i], i == 2);
|
68
|
-
matchingLeft[0].push(mergedDimensions[0]);
|
69
|
-
matchingRight[0].push(mergedDimensions[1]);
|
70
|
-
lengthReconstitution.push(mergedDimensions[2]);
|
71
|
-
}
|
72
|
-
if (left.color && right.color) {
|
73
|
-
var mergedColor = scope.mergeColors(left.color, right.color);
|
74
|
-
matchingLeft[1] = mergedColor[0];
|
75
|
-
matchingRight[1] = mergedColor[1];
|
76
|
-
colorReconstitution = mergedColor[2];
|
77
|
-
}
|
78
|
-
return [matchingLeft, matchingRight, function(value) {
|
79
|
-
var result = left.inset ? 'inset ' : ' ';
|
80
|
-
for (var i = 0; i < lengthReconstitution.length; i++) {
|
81
|
-
result += lengthReconstitution[i](value[0][i]) + ' ';
|
82
|
-
}
|
83
|
-
if (colorReconstitution) {
|
84
|
-
result += colorReconstitution(value[1]);
|
85
|
-
}
|
86
|
-
return result;
|
87
|
-
}];
|
88
|
-
}
|
89
|
-
|
90
|
-
function mergeNestedRepeatedShadow(nestedMerge, separator, left, right) {
|
91
|
-
var leftCopy = [];
|
92
|
-
var rightCopy = [];
|
93
|
-
function defaultShadow(inset) {
|
94
|
-
return {inset: inset, color: [0, 0, 0, 0], lengths: [{px: 0}, {px: 0}, {px: 0}, {px: 0}]};
|
95
|
-
}
|
96
|
-
for (var i = 0; i < left.length || i < right.length; i++) {
|
97
|
-
var l = left[i] || defaultShadow(right[i].inset);
|
98
|
-
var r = right[i] || defaultShadow(left[i].inset);
|
99
|
-
leftCopy.push(l);
|
100
|
-
rightCopy.push(r);
|
101
|
-
}
|
102
|
-
return scope.mergeNestedRepeated(nestedMerge, separator, leftCopy, rightCopy);
|
103
|
-
}
|
104
|
-
|
105
|
-
var mergeShadowList = mergeNestedRepeatedShadow.bind(null, mergeShadow, ', ');
|
106
|
-
scope.addPropertiesHandler(parseShadowList, mergeShadowList, ['box-shadow', 'text-shadow']);
|
107
|
-
|
108
|
-
})(webAnimationsMinifill);
|
@@ -1,85 +0,0 @@
|
|
1
|
-
// Copyright 2014 Google Inc. All rights reserved.
|
2
|
-
//
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
// you may not use this file except in compliance with the License.
|
5
|
-
// You may obtain a copy of the License at
|
6
|
-
//
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
//
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
// See the License for the specific language governing permissions and
|
13
|
-
// limitations under the License.
|
14
|
-
|
15
|
-
(function(scope) {
|
16
|
-
|
17
|
-
var consumeLengthOrPercent = scope.consumeParenthesised.bind(null, scope.parseLengthOrPercent);
|
18
|
-
var consumeLengthOrPercentPair = scope.consumeRepeated.bind(undefined, consumeLengthOrPercent, /^/);
|
19
|
-
|
20
|
-
var mergeSizePair = scope.mergeNestedRepeated.bind(undefined, scope.mergeDimensions, ' ');
|
21
|
-
var mergeSizePairList = scope.mergeNestedRepeated.bind(undefined, mergeSizePair, ',');
|
22
|
-
|
23
|
-
function parseShape(input) {
|
24
|
-
var circle = scope.consumeToken(/^circle/, input);
|
25
|
-
if (circle && circle[0]) {
|
26
|
-
return ['circle'].concat(scope.consumeList([
|
27
|
-
scope.ignore(scope.consumeToken.bind(undefined, /^\(/)),
|
28
|
-
consumeLengthOrPercent,
|
29
|
-
scope.ignore(scope.consumeToken.bind(undefined, /^at/)),
|
30
|
-
scope.consumePosition,
|
31
|
-
scope.ignore(scope.consumeToken.bind(undefined, /^\)/))
|
32
|
-
], circle[1]));
|
33
|
-
}
|
34
|
-
var ellipse = scope.consumeToken(/^ellipse/, input);
|
35
|
-
if (ellipse && ellipse[0]) {
|
36
|
-
return ['ellipse'].concat(scope.consumeList([
|
37
|
-
scope.ignore(scope.consumeToken.bind(undefined, /^\(/)),
|
38
|
-
consumeLengthOrPercentPair,
|
39
|
-
scope.ignore(scope.consumeToken.bind(undefined, /^at/)),
|
40
|
-
scope.consumePosition,
|
41
|
-
scope.ignore(scope.consumeToken.bind(undefined, /^\)/))
|
42
|
-
], ellipse[1]));
|
43
|
-
}
|
44
|
-
var polygon = scope.consumeToken(/^polygon/, input);
|
45
|
-
if (polygon && polygon[0]) {
|
46
|
-
return ['polygon'].concat(scope.consumeList([
|
47
|
-
scope.ignore(scope.consumeToken.bind(undefined, /^\(/)),
|
48
|
-
scope.optional(scope.consumeToken.bind(undefined, /^nonzero\s*,|^evenodd\s*,/), 'nonzero,'),
|
49
|
-
scope.consumeSizePairList,
|
50
|
-
scope.ignore(scope.consumeToken.bind(undefined, /^\)/))
|
51
|
-
], polygon[1]));
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
function mergeShapes(left, right) {
|
56
|
-
if (left[0] !== right[0])
|
57
|
-
return;
|
58
|
-
if (left[0] == 'circle') {
|
59
|
-
return scope.mergeList(left.slice(1), right.slice(1), [
|
60
|
-
'circle(',
|
61
|
-
scope.mergeDimensions,
|
62
|
-
' at ',
|
63
|
-
scope.mergeOffsetList,
|
64
|
-
')']);
|
65
|
-
}
|
66
|
-
if (left[0] == 'ellipse') {
|
67
|
-
return scope.mergeList(left.slice(1), right.slice(1), [
|
68
|
-
'ellipse(',
|
69
|
-
scope.mergeNonNegativeSizePair,
|
70
|
-
' at ',
|
71
|
-
scope.mergeOffsetList,
|
72
|
-
')']);
|
73
|
-
}
|
74
|
-
if (left[0] == 'polygon' && left[1] == right[1]) {
|
75
|
-
return scope.mergeList(left.slice(2), right.slice(2), [
|
76
|
-
'polygon(',
|
77
|
-
left[1],
|
78
|
-
mergeSizePairList,
|
79
|
-
')']);
|
80
|
-
}
|
81
|
-
}
|
82
|
-
|
83
|
-
scope.addPropertiesHandler(parseShape, mergeShapes, ['shape-outside']);
|
84
|
-
|
85
|
-
})(webAnimationsMinifill);
|
@@ -1,148 +0,0 @@
|
|
1
|
-
// Copyright 2014 Google Inc. All rights reserved.
|
2
|
-
//
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
// you may not use this file except in compliance with the License.
|
5
|
-
// You may obtain a copy of the License at
|
6
|
-
//
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
//
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
// See the License for the specific language governing permissions and
|
13
|
-
// limitations under the License.
|
14
|
-
|
15
|
-
|
16
|
-
(function(shared, scope, testing) {
|
17
|
-
var originalRequestAnimationFrame = window.requestAnimationFrame;
|
18
|
-
var rafCallbacks = [];
|
19
|
-
var rafId = 0;
|
20
|
-
window.requestAnimationFrame = function(f) {
|
21
|
-
var id = rafId++;
|
22
|
-
if (rafCallbacks.length == 0 && !WEB_ANIMATIONS_TESTING) {
|
23
|
-
originalRequestAnimationFrame(processRafCallbacks);
|
24
|
-
}
|
25
|
-
rafCallbacks.push([id, f]);
|
26
|
-
return id;
|
27
|
-
};
|
28
|
-
|
29
|
-
window.cancelAnimationFrame = function(id) {
|
30
|
-
rafCallbacks.forEach(function(entry) {
|
31
|
-
if (entry[0] == id) {
|
32
|
-
entry[1] = function() {};
|
33
|
-
}
|
34
|
-
});
|
35
|
-
};
|
36
|
-
|
37
|
-
function processRafCallbacks(t) {
|
38
|
-
var processing = rafCallbacks;
|
39
|
-
rafCallbacks = [];
|
40
|
-
tick(t);
|
41
|
-
processing.forEach(function(entry) { entry[1](t); });
|
42
|
-
if (needsRetick)
|
43
|
-
tick(t);
|
44
|
-
applyPendingEffects();
|
45
|
-
}
|
46
|
-
|
47
|
-
function comparePlayers(leftPlayer, rightPlayer) {
|
48
|
-
return leftPlayer._sequenceNumber - rightPlayer._sequenceNumber;
|
49
|
-
}
|
50
|
-
|
51
|
-
function InternalTimeline() {
|
52
|
-
this._players = [];
|
53
|
-
// Android 4.3 browser has window.performance, but not window.performance.now
|
54
|
-
this.currentTime = window.performance && performance.now ? performance.now() : 0;
|
55
|
-
};
|
56
|
-
|
57
|
-
InternalTimeline.prototype = {
|
58
|
-
_play: function(source) {
|
59
|
-
source._timing = shared.normalizeTimingInput(source.timing);
|
60
|
-
var player = new scope.Player(source);
|
61
|
-
player._idle = false;
|
62
|
-
player._timeline = this;
|
63
|
-
this._players.push(player);
|
64
|
-
scope.restart();
|
65
|
-
scope.invalidateEffects();
|
66
|
-
return player;
|
67
|
-
}
|
68
|
-
};
|
69
|
-
|
70
|
-
var ticking = false;
|
71
|
-
var hasRestartedThisFrame = false;
|
72
|
-
|
73
|
-
scope.restart = function() {
|
74
|
-
if (!ticking) {
|
75
|
-
ticking = true;
|
76
|
-
requestAnimationFrame(function() {});
|
77
|
-
hasRestartedThisFrame = true;
|
78
|
-
}
|
79
|
-
return hasRestartedThisFrame;
|
80
|
-
};
|
81
|
-
|
82
|
-
var needsRetick = false;
|
83
|
-
scope.invalidateEffects = function() {
|
84
|
-
needsRetick = true;
|
85
|
-
};
|
86
|
-
|
87
|
-
var pendingEffects = [];
|
88
|
-
function applyPendingEffects() {
|
89
|
-
pendingEffects.forEach(function(f) { f(); });
|
90
|
-
}
|
91
|
-
|
92
|
-
var originalGetComputedStyle = window.getComputedStyle;
|
93
|
-
Object.defineProperty(window, 'getComputedStyle', {
|
94
|
-
configurable: true,
|
95
|
-
enumerable: true,
|
96
|
-
value: function() {
|
97
|
-
if (needsRetick) tick(timeline.currentTime);
|
98
|
-
applyPendingEffects();
|
99
|
-
return originalGetComputedStyle.apply(this, arguments);
|
100
|
-
},
|
101
|
-
});
|
102
|
-
|
103
|
-
function tick(t) {
|
104
|
-
hasRestartedThisFrame = false;
|
105
|
-
var timeline = scope.timeline;
|
106
|
-
timeline.currentTime = t;
|
107
|
-
timeline._players.sort(comparePlayers);
|
108
|
-
ticking = false;
|
109
|
-
var updatingPlayers = timeline._players;
|
110
|
-
timeline._players = [];
|
111
|
-
|
112
|
-
var newPendingClears = [];
|
113
|
-
var newPendingEffects = [];
|
114
|
-
updatingPlayers = updatingPlayers.filter(function(player) {
|
115
|
-
player._inTimeline = player._tick(t);
|
116
|
-
|
117
|
-
if (!player._inEffect)
|
118
|
-
newPendingClears.push(player._source);
|
119
|
-
else
|
120
|
-
newPendingEffects.push(player._source);
|
121
|
-
|
122
|
-
if (!player.finished && !player.paused && !player._idle)
|
123
|
-
ticking = true;
|
124
|
-
|
125
|
-
return player._inTimeline;
|
126
|
-
});
|
127
|
-
|
128
|
-
pendingEffects.length = 0;
|
129
|
-
pendingEffects.push.apply(pendingEffects, newPendingClears);
|
130
|
-
pendingEffects.push.apply(pendingEffects, newPendingEffects);
|
131
|
-
|
132
|
-
timeline._players.push.apply(timeline._players, updatingPlayers);
|
133
|
-
needsRetick = false;
|
134
|
-
|
135
|
-
if (ticking)
|
136
|
-
requestAnimationFrame(function() {});
|
137
|
-
};
|
138
|
-
|
139
|
-
if (WEB_ANIMATIONS_TESTING) {
|
140
|
-
testing.tick = processRafCallbacks;
|
141
|
-
testing.isTicking = function() { return ticking; };
|
142
|
-
testing.setTicking = function(newVal) { ticking = newVal; };
|
143
|
-
}
|
144
|
-
|
145
|
-
var timeline = new InternalTimeline();
|
146
|
-
scope.timeline = timeline;
|
147
|
-
|
148
|
-
})(webAnimationsShared, webAnimationsMinifill, webAnimationsTesting);
|
@@ -1,77 +0,0 @@
|
|
1
|
-
// Copyright 2014 Google Inc. All rights reserved.
|
2
|
-
//
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
// you may not use this file except in compliance with the License.
|
5
|
-
// You may obtain a copy of the License at
|
6
|
-
//
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
//
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
// See the License for the specific language governing permissions and
|
13
|
-
// limitations under the License.
|
14
|
-
|
15
|
-
|
16
|
-
(function(shared, scope, testing) {
|
17
|
-
|
18
|
-
scope.AnimationTimeline = function() {
|
19
|
-
this._players = [];
|
20
|
-
this.currentTime = undefined;
|
21
|
-
};
|
22
|
-
|
23
|
-
scope.AnimationTimeline.prototype = {
|
24
|
-
// FIXME: This needs to return the wrapped players in maxifill
|
25
|
-
// TODO: Does this need to be sorted?
|
26
|
-
// TODO: Do we need to consider needsRetick?
|
27
|
-
getAnimationPlayers: function() {
|
28
|
-
this._discardPlayers();
|
29
|
-
return this._players.slice();
|
30
|
-
},
|
31
|
-
_discardPlayers: function() {
|
32
|
-
this._players = this._players.filter(function(player) {
|
33
|
-
return player.playState != 'finished' && player.playState != 'idle';
|
34
|
-
});
|
35
|
-
},
|
36
|
-
play: function(source) {
|
37
|
-
var player = new scope.Player(source);
|
38
|
-
this._players.push(player);
|
39
|
-
scope.restartMaxifillTick();
|
40
|
-
player.play();
|
41
|
-
return player;
|
42
|
-
},
|
43
|
-
};
|
44
|
-
|
45
|
-
var ticking = false;
|
46
|
-
|
47
|
-
scope.restartMaxifillTick = function() {
|
48
|
-
if (!ticking) {
|
49
|
-
ticking = true;
|
50
|
-
requestAnimationFrame(maxifillTick);
|
51
|
-
}
|
52
|
-
};
|
53
|
-
|
54
|
-
function maxifillTick(t) {
|
55
|
-
var timeline = window.document.timeline;
|
56
|
-
timeline.currentTime = t;
|
57
|
-
timeline._discardPlayers();
|
58
|
-
if (timeline._players.length == 0)
|
59
|
-
ticking = false;
|
60
|
-
else
|
61
|
-
requestAnimationFrame(maxifillTick);
|
62
|
-
}
|
63
|
-
|
64
|
-
var timeline = new scope.AnimationTimeline();
|
65
|
-
scope.timeline = timeline;
|
66
|
-
|
67
|
-
try {
|
68
|
-
Object.defineProperty(window.document, 'timeline', {
|
69
|
-
configurable: true,
|
70
|
-
get: function() { return timeline; }
|
71
|
-
});
|
72
|
-
} catch (e) { }
|
73
|
-
try {
|
74
|
-
window.document.timeline = timeline;
|
75
|
-
} catch (e) { }
|
76
|
-
|
77
|
-
})(webAnimationsShared, webAnimationsMaxifill, webAnimationsTesting);
|
@@ -1,242 +0,0 @@
|
|
1
|
-
// Copyright 2014 Google Inc. All rights reserved.
|
2
|
-
//
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
// you may not use this file except in compliance with the License.
|
5
|
-
// You may obtain a copy of the License at
|
6
|
-
//
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
//
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
// See the License for the specific language governing permissions and
|
13
|
-
// limitations under the License.
|
14
|
-
|
15
|
-
(function(shared, testing) {
|
16
|
-
|
17
|
-
var fills = 'backwards|forwards|both'.split('|');
|
18
|
-
var directions = 'reverse|alternate|alternate-reverse'.split('|');
|
19
|
-
|
20
|
-
function makeTiming(timingInput, forGroup) {
|
21
|
-
var timing = {
|
22
|
-
delay: 0,
|
23
|
-
endDelay: 0,
|
24
|
-
fill: forGroup ? 'both' : 'none',
|
25
|
-
iterationStart: 0,
|
26
|
-
iterations: 1,
|
27
|
-
duration: forGroup ? 'auto' : 0,
|
28
|
-
playbackRate: 1,
|
29
|
-
direction: 'normal',
|
30
|
-
easing: 'linear',
|
31
|
-
};
|
32
|
-
if (typeof timingInput == 'number' && !isNaN(timingInput)) {
|
33
|
-
timing.duration = timingInput;
|
34
|
-
} else if (timingInput !== undefined) {
|
35
|
-
Object.getOwnPropertyNames(timingInput).forEach(function(property) {
|
36
|
-
if (timingInput[property] != 'auto') {
|
37
|
-
if (typeof timing[property] == 'number' || property == 'duration') {
|
38
|
-
if (typeof timingInput[property] != 'number' || isNaN(timingInput[property])) {
|
39
|
-
return;
|
40
|
-
}
|
41
|
-
}
|
42
|
-
if ((property == 'fill') && (fills.indexOf(timingInput[property]) == -1)) {
|
43
|
-
return;
|
44
|
-
}
|
45
|
-
if ((property == 'direction') && (directions.indexOf(timingInput[property]) == -1)) {
|
46
|
-
return;
|
47
|
-
}
|
48
|
-
if (property == 'playbackRate' && shared.isDeprecated('AnimationTiming.playbackRate', '2014-11-28', 'Use AnimationPlayer.playbackRate instead.')) {
|
49
|
-
return;
|
50
|
-
}
|
51
|
-
timing[property] = timingInput[property];
|
52
|
-
}
|
53
|
-
});
|
54
|
-
}
|
55
|
-
return timing;
|
56
|
-
}
|
57
|
-
|
58
|
-
function normalizeTimingInput(timingInput, forGroup) {
|
59
|
-
var timing = makeTiming(timingInput, forGroup);
|
60
|
-
timing.easing = toTimingFunction(timing.easing);
|
61
|
-
return timing;
|
62
|
-
}
|
63
|
-
|
64
|
-
function cubic(a, b, c, d) {
|
65
|
-
if (a < 0 || a > 1 || c < 0 || c > 1) {
|
66
|
-
return linear;
|
67
|
-
}
|
68
|
-
return function(x) {
|
69
|
-
var start = 0, end = 1;
|
70
|
-
while (1) {
|
71
|
-
var mid = (start + end) / 2;
|
72
|
-
function f(a, b, m) { return 3 * a * (1 - m) * (1 - m) * m + 3 * b * (1 - m) * m * m + m * m * m};
|
73
|
-
var xEst = f(a, c, mid);
|
74
|
-
if (Math.abs(x - xEst) < 0.001) {
|
75
|
-
return f(b, d, mid);
|
76
|
-
}
|
77
|
-
if (xEst < x) {
|
78
|
-
start = mid;
|
79
|
-
} else {
|
80
|
-
end = mid;
|
81
|
-
}
|
82
|
-
}
|
83
|
-
}
|
84
|
-
}
|
85
|
-
|
86
|
-
var Start = 1;
|
87
|
-
var Middle = 0.5;
|
88
|
-
var End = 0;
|
89
|
-
|
90
|
-
function step(count, pos) {
|
91
|
-
return function(x) {
|
92
|
-
if (x >= 1) {
|
93
|
-
return 1;
|
94
|
-
}
|
95
|
-
var stepSize = 1 / count;
|
96
|
-
x += pos * stepSize;
|
97
|
-
return x - x % stepSize;
|
98
|
-
}
|
99
|
-
}
|
100
|
-
|
101
|
-
var presets = {
|
102
|
-
'ease': cubic(0.25, 0.1, 0.25, 1),
|
103
|
-
'ease-in': cubic(0.42, 0, 1, 1),
|
104
|
-
'ease-out': cubic(0, 0, 0.58, 1),
|
105
|
-
'ease-in-out': cubic(0.42, 0, 0.58, 1),
|
106
|
-
'step-start': step(1, Start),
|
107
|
-
'step-middle': step(1, Middle),
|
108
|
-
'step-end': step(1, End)
|
109
|
-
};
|
110
|
-
|
111
|
-
var numberString = '\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*';
|
112
|
-
var cubicBezierRe = new RegExp('cubic-bezier\\(' + numberString + ',' + numberString + ',' + numberString + ',' + numberString + '\\)');
|
113
|
-
var stepRe = /steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;
|
114
|
-
var linear = function(x) { return x; };
|
115
|
-
|
116
|
-
function toTimingFunction(easing) {
|
117
|
-
var cubicData = cubicBezierRe.exec(easing);
|
118
|
-
if (cubicData) {
|
119
|
-
return cubic.apply(this, cubicData.slice(1).map(Number));
|
120
|
-
}
|
121
|
-
var stepData = stepRe.exec(easing);
|
122
|
-
if (stepData) {
|
123
|
-
return step(Number(stepData[1]), {'start': Start, 'middle': Middle, 'end': End}[stepData[2]]);
|
124
|
-
}
|
125
|
-
var preset = presets[easing];
|
126
|
-
if (preset) {
|
127
|
-
return preset;
|
128
|
-
}
|
129
|
-
return linear;
|
130
|
-
};
|
131
|
-
|
132
|
-
function calculateActiveDuration(timing) {
|
133
|
-
return Math.abs(repeatedDuration(timing) / timing.playbackRate);
|
134
|
-
}
|
135
|
-
|
136
|
-
function repeatedDuration(timing) {
|
137
|
-
return timing.duration * timing.iterations;
|
138
|
-
}
|
139
|
-
|
140
|
-
var PhaseNone = 0;
|
141
|
-
var PhaseBefore = 1;
|
142
|
-
var PhaseAfter = 2;
|
143
|
-
var PhaseActive = 3;
|
144
|
-
|
145
|
-
function calculatePhase(activeDuration, localTime, timing) {
|
146
|
-
if (localTime == null) {
|
147
|
-
return PhaseNone;
|
148
|
-
}
|
149
|
-
if (localTime < timing.delay) {
|
150
|
-
return PhaseBefore;
|
151
|
-
}
|
152
|
-
if (localTime >= timing.delay + activeDuration) {
|
153
|
-
return PhaseAfter;
|
154
|
-
}
|
155
|
-
return PhaseActive;
|
156
|
-
}
|
157
|
-
|
158
|
-
function calculateActiveTime(activeDuration, fillMode, localTime, phase, delay) {
|
159
|
-
switch (phase) {
|
160
|
-
case PhaseBefore:
|
161
|
-
if (fillMode == 'backwards' || fillMode == 'both')
|
162
|
-
return 0;
|
163
|
-
return null;
|
164
|
-
case PhaseActive:
|
165
|
-
return localTime - delay;
|
166
|
-
case PhaseAfter:
|
167
|
-
if (fillMode == 'forwards' || fillMode == 'both')
|
168
|
-
return activeDuration;
|
169
|
-
return null;
|
170
|
-
case PhaseNone:
|
171
|
-
return null;
|
172
|
-
}
|
173
|
-
}
|
174
|
-
|
175
|
-
function calculateScaledActiveTime(activeDuration, activeTime, startOffset, timing) {
|
176
|
-
return (timing.playbackRate < 0 ? activeTime - activeDuration : activeTime) * timing.playbackRate + startOffset;
|
177
|
-
}
|
178
|
-
|
179
|
-
function calculateIterationTime(iterationDuration, repeatedDuration, scaledActiveTime, startOffset, timing) {
|
180
|
-
if (scaledActiveTime === Infinity || scaledActiveTime === -Infinity || (scaledActiveTime - startOffset == repeatedDuration && timing.iterations && ((timing.iterations + timing.iterationStart) % 1 == 0))) {
|
181
|
-
return iterationDuration;
|
182
|
-
}
|
183
|
-
|
184
|
-
return scaledActiveTime % iterationDuration;
|
185
|
-
}
|
186
|
-
|
187
|
-
function calculateCurrentIteration(iterationDuration, iterationTime, scaledActiveTime, timing) {
|
188
|
-
if (scaledActiveTime === 0) {
|
189
|
-
return 0;
|
190
|
-
}
|
191
|
-
if (iterationTime == iterationDuration) {
|
192
|
-
return timing.iterationStart + timing.iterations - 1;
|
193
|
-
}
|
194
|
-
return Math.floor(scaledActiveTime / iterationDuration);
|
195
|
-
}
|
196
|
-
|
197
|
-
function calculateTransformedTime(currentIteration, iterationDuration, iterationTime, timing) {
|
198
|
-
var currentIterationIsOdd = currentIteration % 2 >= 1;
|
199
|
-
var currentDirectionIsForwards = timing.direction == 'normal' || timing.direction == (currentIterationIsOdd ? 'alternate-reverse' : 'alternate');
|
200
|
-
var directedTime = currentDirectionIsForwards ? iterationTime : iterationDuration - iterationTime;
|
201
|
-
var timeFraction = directedTime / iterationDuration;
|
202
|
-
return iterationDuration * timing.easing(timeFraction);
|
203
|
-
}
|
204
|
-
|
205
|
-
function calculateTimeFraction(activeDuration, localTime, timing) {
|
206
|
-
var phase = calculatePhase(activeDuration, localTime, timing);
|
207
|
-
var activeTime = calculateActiveTime(activeDuration, timing.fill, localTime, phase, timing.delay);
|
208
|
-
if (activeTime === null)
|
209
|
-
return null;
|
210
|
-
if (activeDuration === 0)
|
211
|
-
return phase === PhaseBefore ? 0 : 1;
|
212
|
-
var startOffset = timing.iterationStart * timing.duration;
|
213
|
-
var scaledActiveTime = calculateScaledActiveTime(activeDuration, activeTime, startOffset, timing);
|
214
|
-
var iterationTime = calculateIterationTime(timing.duration, repeatedDuration(timing), scaledActiveTime, startOffset, timing);
|
215
|
-
var currentIteration = calculateCurrentIteration(timing.duration, iterationTime, scaledActiveTime, timing);
|
216
|
-
return calculateTransformedTime(currentIteration, timing.duration, iterationTime, timing) / timing.duration;
|
217
|
-
}
|
218
|
-
|
219
|
-
shared.makeTiming = makeTiming;
|
220
|
-
shared.normalizeTimingInput = normalizeTimingInput;
|
221
|
-
shared.calculateActiveDuration = calculateActiveDuration;
|
222
|
-
shared.calculateTimeFraction = calculateTimeFraction;
|
223
|
-
shared.calculatePhase = calculatePhase;
|
224
|
-
shared.toTimingFunction = toTimingFunction;
|
225
|
-
|
226
|
-
if (WEB_ANIMATIONS_TESTING) {
|
227
|
-
testing.normalizeTimingInput = normalizeTimingInput;
|
228
|
-
testing.toTimingFunction = toTimingFunction;
|
229
|
-
testing.calculateActiveDuration = calculateActiveDuration;
|
230
|
-
testing.calculatePhase = calculatePhase;
|
231
|
-
testing.PhaseNone = PhaseNone;
|
232
|
-
testing.PhaseBefore = PhaseBefore;
|
233
|
-
testing.PhaseActive = PhaseActive;
|
234
|
-
testing.PhaseAfter = PhaseAfter;
|
235
|
-
testing.calculateActiveTime = calculateActiveTime;
|
236
|
-
testing.calculateScaledActiveTime = calculateScaledActiveTime;
|
237
|
-
testing.calculateIterationTime = calculateIterationTime;
|
238
|
-
testing.calculateCurrentIteration = calculateCurrentIteration;
|
239
|
-
testing.calculateTransformedTime = calculateTransformedTime;
|
240
|
-
}
|
241
|
-
|
242
|
-
})(webAnimationsShared, webAnimationsTesting);
|