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,72 +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, testing) {
|
16
|
-
|
17
|
-
function numberToString(x) {
|
18
|
-
return x.toFixed(3).replace('.000', '');
|
19
|
-
}
|
20
|
-
|
21
|
-
function clamp(min, max, x) {
|
22
|
-
return Math.min(max, Math.max(min, x));
|
23
|
-
}
|
24
|
-
|
25
|
-
function parseNumber(string) {
|
26
|
-
if (/^\s*[-+]?(\d*\.)?\d+\s*$/.test(string))
|
27
|
-
return Number(string);
|
28
|
-
}
|
29
|
-
|
30
|
-
function mergeNumbers(left, right) {
|
31
|
-
return [left, right, numberToString];
|
32
|
-
}
|
33
|
-
|
34
|
-
// FIXME: This should probably go in it's own handler.
|
35
|
-
function mergeFlex(left, right) {
|
36
|
-
if (left == 0)
|
37
|
-
return;
|
38
|
-
return clampedMergeNumbers(0, Infinity)(left, right);
|
39
|
-
}
|
40
|
-
|
41
|
-
function mergePositiveIntegers(left, right) {
|
42
|
-
return [left, right, function(x) {
|
43
|
-
return Math.round(clamp(1, Infinity, x));
|
44
|
-
}];
|
45
|
-
}
|
46
|
-
|
47
|
-
function clampedMergeNumbers(min, max) {
|
48
|
-
return function(left, right) {
|
49
|
-
return [left, right, function(x) {
|
50
|
-
return numberToString(clamp(min, max, x));
|
51
|
-
}];
|
52
|
-
};
|
53
|
-
}
|
54
|
-
|
55
|
-
function round(left, right) {
|
56
|
-
return [left, right, Math.round];
|
57
|
-
}
|
58
|
-
|
59
|
-
scope.clamp = clamp;
|
60
|
-
scope.addPropertiesHandler(parseNumber, clampedMergeNumbers(0, Infinity), ['border-image-width', 'line-height']);
|
61
|
-
scope.addPropertiesHandler(parseNumber, clampedMergeNumbers(0, 1), ['opacity', 'shape-image-threshold']);
|
62
|
-
scope.addPropertiesHandler(parseNumber, clampedMergeNumbers(0.01, Infinity), ['zoom']);
|
63
|
-
scope.addPropertiesHandler(parseNumber, mergeFlex, ['flex-grow', 'flex-shrink']);
|
64
|
-
scope.addPropertiesHandler(parseNumber, mergeNumbers, ['zoom']);
|
65
|
-
scope.addPropertiesHandler(parseNumber, mergePositiveIntegers, ['orphans', 'widows']);
|
66
|
-
scope.addPropertiesHandler(parseNumber, round, ['z-index']);
|
67
|
-
|
68
|
-
scope.parseNumber = parseNumber;
|
69
|
-
scope.mergeNumbers = mergeNumbers;
|
70
|
-
scope.numberToString = numberToString;
|
71
|
-
|
72
|
-
})(webAnimationsMinifill, webAnimationsTesting);
|
@@ -1,193 +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, testing) {
|
16
|
-
|
17
|
-
var sequenceNumber = 0;
|
18
|
-
|
19
|
-
var AnimationPlayerEvent = function(target, currentTime, timelineTime) {
|
20
|
-
this.target = target;
|
21
|
-
this.currentTime = currentTime;
|
22
|
-
this.timelineTime = timelineTime;
|
23
|
-
|
24
|
-
this.type = 'finish';
|
25
|
-
this.bubbles = false;
|
26
|
-
this.cancelable = false;
|
27
|
-
this.currentTarget = target;
|
28
|
-
this.defaultPrevented = false;
|
29
|
-
this.eventPhase = Event.AT_TARGET;
|
30
|
-
this.timeStamp = Date.now();
|
31
|
-
};
|
32
|
-
|
33
|
-
scope.Player = function(source) {
|
34
|
-
this._sequenceNumber = sequenceNumber++;
|
35
|
-
this._currentTime = 0;
|
36
|
-
this._startTime = null;
|
37
|
-
this.paused = false;
|
38
|
-
this._playbackRate = 1;
|
39
|
-
this._inTimeline = true;
|
40
|
-
this._finishedFlag = false;
|
41
|
-
this.onfinish = null;
|
42
|
-
this._finishHandlers = [];
|
43
|
-
this._source = source;
|
44
|
-
this._inEffect = this._source._update(0);
|
45
|
-
this._idle = true;
|
46
|
-
this._currentTimePending = false;
|
47
|
-
};
|
48
|
-
|
49
|
-
scope.Player.prototype = {
|
50
|
-
_ensureAlive: function() {
|
51
|
-
this._inEffect = this._source._update(this.currentTime);
|
52
|
-
if (!this._inTimeline && (this._inEffect || !this._finishedFlag)) {
|
53
|
-
this._inTimeline = true;
|
54
|
-
scope.timeline._players.push(this);
|
55
|
-
}
|
56
|
-
},
|
57
|
-
_tickCurrentTime: function(newTime, ignoreLimit) {
|
58
|
-
if (newTime != this._currentTime) {
|
59
|
-
this._currentTime = newTime;
|
60
|
-
if (this.finished && !ignoreLimit)
|
61
|
-
this._currentTime = this._playbackRate > 0 ? this._totalDuration : 0;
|
62
|
-
this._ensureAlive();
|
63
|
-
}
|
64
|
-
},
|
65
|
-
get currentTime() {
|
66
|
-
if (this._idle || this._currentTimePending)
|
67
|
-
return null;
|
68
|
-
return this._currentTime;
|
69
|
-
},
|
70
|
-
set currentTime(newTime) {
|
71
|
-
newTime = +newTime;
|
72
|
-
if (isNaN(newTime))
|
73
|
-
return;
|
74
|
-
scope.restart();
|
75
|
-
if (!this.paused && this._startTime != null) {
|
76
|
-
this._startTime = this._timeline.currentTime - newTime / this._playbackRate;
|
77
|
-
}
|
78
|
-
this._currentTimePending = false;
|
79
|
-
if (this._currentTime == newTime)
|
80
|
-
return;
|
81
|
-
this._tickCurrentTime(newTime, true);
|
82
|
-
scope.invalidateEffects();
|
83
|
-
},
|
84
|
-
get startTime() {
|
85
|
-
return this._startTime;
|
86
|
-
},
|
87
|
-
set startTime(newTime) {
|
88
|
-
newTime = +newTime;
|
89
|
-
if (isNaN(newTime))
|
90
|
-
return;
|
91
|
-
if (this.paused || this._idle)
|
92
|
-
return;
|
93
|
-
this._startTime = newTime;
|
94
|
-
this._tickCurrentTime((this._timeline.currentTime - this._startTime) * this.playbackRate);
|
95
|
-
scope.invalidateEffects();
|
96
|
-
},
|
97
|
-
get playbackRate() { return this._playbackRate; },
|
98
|
-
get finished() {
|
99
|
-
return !this._idle && (this._playbackRate > 0 && this._currentTime >= this._totalDuration ||
|
100
|
-
this._playbackRate < 0 && this._currentTime <= 0);
|
101
|
-
},
|
102
|
-
get _totalDuration() { return this._source._totalDuration; },
|
103
|
-
get playState() {
|
104
|
-
if (this._idle)
|
105
|
-
return 'idle';
|
106
|
-
if ((this._startTime == null && !this.paused && this.playbackRate != 0) || this._currentTimePending)
|
107
|
-
return 'pending';
|
108
|
-
if (this.paused)
|
109
|
-
return 'paused';
|
110
|
-
if (this.finished)
|
111
|
-
return 'finished';
|
112
|
-
return 'running';
|
113
|
-
},
|
114
|
-
play: function() {
|
115
|
-
this.paused = false;
|
116
|
-
if (this.finished || this._idle) {
|
117
|
-
this._currentTime = this._playbackRate > 0 ? 0 : this._totalDuration;
|
118
|
-
this._startTime = null;
|
119
|
-
scope.invalidateEffects();
|
120
|
-
}
|
121
|
-
this._finishedFlag = false;
|
122
|
-
scope.restart();
|
123
|
-
this._idle = false;
|
124
|
-
this._ensureAlive();
|
125
|
-
},
|
126
|
-
pause: function() {
|
127
|
-
if (!this.finished && !this.paused && !this._idle) {
|
128
|
-
this._currentTimePending = true;
|
129
|
-
}
|
130
|
-
this._startTime = null;
|
131
|
-
this.paused = true;
|
132
|
-
},
|
133
|
-
finish: function() {
|
134
|
-
if (this._idle)
|
135
|
-
return;
|
136
|
-
this.currentTime = this._playbackRate > 0 ? this._totalDuration : 0;
|
137
|
-
this._startTime = this._totalDuration - this.currentTime;
|
138
|
-
this._currentTimePending = false;
|
139
|
-
},
|
140
|
-
cancel: function() {
|
141
|
-
this._inEffect = false;
|
142
|
-
this._idle = true;
|
143
|
-
this.currentTime = 0;
|
144
|
-
this._startTime = null;
|
145
|
-
},
|
146
|
-
reverse: function() {
|
147
|
-
this._playbackRate *= -1;
|
148
|
-
this._startTime = null;
|
149
|
-
this.play();
|
150
|
-
},
|
151
|
-
addEventListener: function(type, handler) {
|
152
|
-
if (typeof handler == 'function' && type == 'finish')
|
153
|
-
this._finishHandlers.push(handler);
|
154
|
-
},
|
155
|
-
removeEventListener: function(type, handler) {
|
156
|
-
if (type != 'finish')
|
157
|
-
return;
|
158
|
-
var index = this._finishHandlers.indexOf(handler);
|
159
|
-
if (index >= 0)
|
160
|
-
this._finishHandlers.splice(index, 1);
|
161
|
-
},
|
162
|
-
_fireEvents: function(baseTime) {
|
163
|
-
var finished = this.finished;
|
164
|
-
if ((finished || this._idle) && !this._finishedFlag) {
|
165
|
-
var event = new AnimationPlayerEvent(this, this._currentTime, baseTime);
|
166
|
-
var handlers = this._finishHandlers.concat(this.onfinish ? [this.onfinish] : []);
|
167
|
-
setTimeout(function() {
|
168
|
-
handlers.forEach(function(handler) {
|
169
|
-
handler.call(event.target, event);
|
170
|
-
});
|
171
|
-
}, 0);
|
172
|
-
}
|
173
|
-
this._finishedFlag = finished;
|
174
|
-
},
|
175
|
-
_tick: function(timelineTime) {
|
176
|
-
if (!this._idle && !this.paused) {
|
177
|
-
if (this._startTime == null)
|
178
|
-
this.startTime = timelineTime - this._currentTime / this.playbackRate;
|
179
|
-
else if (!this.finished)
|
180
|
-
this._tickCurrentTime((timelineTime - this._startTime) * this.playbackRate);
|
181
|
-
}
|
182
|
-
|
183
|
-
this._currentTimePending = false;
|
184
|
-
this._fireEvents(timelineTime);
|
185
|
-
return !this._idle && (this._inEffect || !this._finishedFlag);
|
186
|
-
},
|
187
|
-
};
|
188
|
-
|
189
|
-
if (WEB_ANIMATIONS_TESTING) {
|
190
|
-
testing.Player = scope.Player;
|
191
|
-
}
|
192
|
-
|
193
|
-
})(webAnimationsMinifill, webAnimationsTesting);
|
@@ -1,117 +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 negateDimension(dimension) {
|
18
|
-
var result = {};
|
19
|
-
for (var k in dimension) {
|
20
|
-
result[k] = -dimension[k];
|
21
|
-
}
|
22
|
-
return result;
|
23
|
-
}
|
24
|
-
|
25
|
-
function consumeOffset(string) {
|
26
|
-
return scope.consumeToken(/^(left|center|right|top|bottom)\b/i, string) || scope.consumeLengthOrPercent(string);
|
27
|
-
}
|
28
|
-
|
29
|
-
var offsetMap = {
|
30
|
-
left: {'%': 0},
|
31
|
-
center: {'%': 50},
|
32
|
-
right: {'%': 100},
|
33
|
-
top: {'%': 0},
|
34
|
-
bottom: {'%': 100},
|
35
|
-
};
|
36
|
-
|
37
|
-
function parseOrigin(slots, string) {
|
38
|
-
var result = scope.consumeRepeated(consumeOffset, /^/, string);
|
39
|
-
if (!result || result[1] != '') return;
|
40
|
-
var tokens = result[0];
|
41
|
-
tokens[0] = tokens[0] || 'center';
|
42
|
-
tokens[1] = tokens[1] || 'center';
|
43
|
-
if (slots == 3) {
|
44
|
-
tokens[2] = tokens[2] || {px: 0};
|
45
|
-
}
|
46
|
-
if (tokens.length != slots) {
|
47
|
-
return;
|
48
|
-
}
|
49
|
-
// Reorder so that the horizontal axis comes first.
|
50
|
-
if (/top|bottom/.test(tokens[0]) || /left|right/.test(tokens[1])) {
|
51
|
-
var tmp = tokens[0];
|
52
|
-
tokens[0] = tokens[1];
|
53
|
-
tokens[1] = tmp;
|
54
|
-
}
|
55
|
-
// Invalid if not horizontal then vertical.
|
56
|
-
if (!/left|right|center|Object/.test(tokens[0]))
|
57
|
-
return;
|
58
|
-
if (!/top|bottom|center|Object/.test(tokens[1]))
|
59
|
-
return;
|
60
|
-
return tokens.map(function(position) {
|
61
|
-
return typeof position == 'object' ? position : offsetMap[position];
|
62
|
-
});
|
63
|
-
}
|
64
|
-
|
65
|
-
var mergeOffsetList = scope.mergeNestedRepeated.bind(null, scope.mergeDimensions, ' ');
|
66
|
-
scope.addPropertiesHandler(parseOrigin.bind(null, 3), mergeOffsetList, ['transform-origin']);
|
67
|
-
scope.addPropertiesHandler(parseOrigin.bind(null, 2), mergeOffsetList, ['perspective-origin']);
|
68
|
-
|
69
|
-
function consumePosition(string) {
|
70
|
-
var result = scope.consumeRepeated(consumeOffset, /^/, string);
|
71
|
-
if (!result) {
|
72
|
-
return;
|
73
|
-
}
|
74
|
-
|
75
|
-
var tokens = result[0];
|
76
|
-
var out = [{'%': 50}, {'%': 50}];
|
77
|
-
var pos = 0;
|
78
|
-
var bottomOrRight = false;
|
79
|
-
|
80
|
-
for (var i = 0; i < tokens.length; i++) {
|
81
|
-
var token = tokens[i];
|
82
|
-
if (typeof token == 'string') {
|
83
|
-
bottomOrRight = /bottom|right/.test(token);
|
84
|
-
pos = {left: 0, right: 0, center: pos, top: 1, bottom: 1}[token];
|
85
|
-
out[pos] = offsetMap[token];
|
86
|
-
if (token == 'center') {
|
87
|
-
// Center doesn't accept a length offset.
|
88
|
-
pos++;
|
89
|
-
}
|
90
|
-
} else {
|
91
|
-
if (bottomOrRight) {
|
92
|
-
// If bottom or right we need to subtract the length from 100%
|
93
|
-
token = negateDimension(token);
|
94
|
-
token['%'] = (token['%'] || 0) + 100;
|
95
|
-
}
|
96
|
-
out[pos] = token;
|
97
|
-
pos++;
|
98
|
-
bottomOrRight = false;
|
99
|
-
}
|
100
|
-
}
|
101
|
-
return [out, result[1]];
|
102
|
-
}
|
103
|
-
|
104
|
-
function parsePositionList(string) {
|
105
|
-
var result = scope.consumeRepeated(consumePosition, /^,/, string);
|
106
|
-
if (result && result[1] == '') {
|
107
|
-
return result[0];
|
108
|
-
}
|
109
|
-
}
|
110
|
-
|
111
|
-
scope.consumePosition = consumePosition;
|
112
|
-
scope.mergeOffsetList = mergeOffsetList;
|
113
|
-
|
114
|
-
var mergePositionList = scope.mergeNestedRepeated.bind(null, mergeOffsetList, ', ');
|
115
|
-
scope.addPropertiesHandler(parsePositionList, mergePositionList, ['background-position', 'object-position']);
|
116
|
-
|
117
|
-
})(webAnimationsMinifill);
|
@@ -1,62 +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, testing) {
|
16
|
-
|
17
|
-
var propertyHandlers = {};
|
18
|
-
|
19
|
-
function addPropertyHandler(parser, merger, property) {
|
20
|
-
propertyHandlers[property] = propertyHandlers[property] || [];
|
21
|
-
propertyHandlers[property].push([parser, merger]);
|
22
|
-
}
|
23
|
-
function addPropertiesHandler(parser, merger, properties) {
|
24
|
-
for (var i = 0; i < properties.length; i++) {
|
25
|
-
var property = properties[i];
|
26
|
-
WEB_ANIMATIONS_TESTING && console.assert(property.toLowerCase() === property);
|
27
|
-
addPropertyHandler(parser, merger, property);
|
28
|
-
if (/-/.test(property)) {
|
29
|
-
// Add camel cased variant.
|
30
|
-
addPropertyHandler(parser, merger, property.replace(/-(.)/g, function(_, c) {
|
31
|
-
return c.toUpperCase();
|
32
|
-
}));
|
33
|
-
}
|
34
|
-
}
|
35
|
-
}
|
36
|
-
scope.addPropertiesHandler = addPropertiesHandler;
|
37
|
-
|
38
|
-
function propertyInterpolation(property, left, right) {
|
39
|
-
var handlers = left == right ? [] : propertyHandlers[property];
|
40
|
-
for (var i = 0; handlers && i < handlers.length; i++) {
|
41
|
-
var parsedLeft = handlers[i][0](left);
|
42
|
-
var parsedRight = handlers[i][0](right);
|
43
|
-
if (parsedLeft !== undefined && parsedRight !== undefined) {
|
44
|
-
var interpolationArgs = handlers[i][1](parsedLeft, parsedRight);
|
45
|
-
if (interpolationArgs) {
|
46
|
-
var interp = scope.Interpolation.apply(null, interpolationArgs);
|
47
|
-
return function(t) {
|
48
|
-
if (t == 0) return left;
|
49
|
-
if (t == 1) return right;
|
50
|
-
return interp(t);
|
51
|
-
};
|
52
|
-
}
|
53
|
-
}
|
54
|
-
}
|
55
|
-
return scope.Interpolation(false, true, function(bool) {
|
56
|
-
return bool ? right : left;
|
57
|
-
});
|
58
|
-
}
|
59
|
-
scope.propertyInterpolation = propertyInterpolation;
|
60
|
-
|
61
|
-
})(webAnimationsMinifill, webAnimationsTesting);
|
62
|
-
|
@@ -1,35 +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, testing) {
|
16
|
-
|
17
|
-
var aliased = {};
|
18
|
-
|
19
|
-
function alias(name, aliases) {
|
20
|
-
aliases.concat([name]).forEach(function(candidate) {
|
21
|
-
if (candidate in document.documentElement.style) {
|
22
|
-
aliased[name] = candidate;
|
23
|
-
}
|
24
|
-
});
|
25
|
-
}
|
26
|
-
alias('transform', ['webkitTransform', 'msTransform']);
|
27
|
-
alias('transformOrigin', ['webkitTransformOrigin']);
|
28
|
-
alias('perspective', ['webkitPerspective']);
|
29
|
-
alias('perspectiveOrigin', ['webkitPerspectiveOrigin']);
|
30
|
-
|
31
|
-
scope.propertyName = function(property) {
|
32
|
-
return aliased[property] || property;
|
33
|
-
};
|
34
|
-
|
35
|
-
})(webAnimationsMinifill, webAnimationsTesting);
|