jquery-animate-enhanced-rails 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1d96befb4347ea67588d1ecae244023fec5af451
4
+ data.tar.gz: 83db1ab79f49c75bdf175496fed97cdb115d574c
5
+ SHA512:
6
+ metadata.gz: a01d8f473c4266aaa94d930dfeda3c514d06d1f83abfc8c125cce67d58c7aecd2afe023cdd46c9882309c980b8b49e2c7eaa8d2b85387498b2eaae6d2f3e41b0
7
+ data.tar.gz: 5930669657d7d719e0eee177f073f739f9b4de4efd0a7794a1be5014865b44a189a79d031c0a0b5a3c341d8f3d08299a6219c2bb813874bd42f73691ad1b2639
@@ -0,0 +1 @@
1
+ pkg
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,48 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ jquery-animate-enhanced-rails (1.11.0)
5
+ railties (>= 3.1.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionpack (4.1.4)
11
+ actionview (= 4.1.4)
12
+ activesupport (= 4.1.4)
13
+ rack (~> 1.5.2)
14
+ rack-test (~> 0.6.2)
15
+ actionview (4.1.4)
16
+ activesupport (= 4.1.4)
17
+ builder (~> 3.1)
18
+ erubis (~> 2.7.0)
19
+ activesupport (4.1.4)
20
+ i18n (~> 0.6, >= 0.6.9)
21
+ json (~> 1.7, >= 1.7.7)
22
+ minitest (~> 5.1)
23
+ thread_safe (~> 0.1)
24
+ tzinfo (~> 1.1)
25
+ builder (3.2.2)
26
+ erubis (2.7.0)
27
+ i18n (0.6.11)
28
+ json (1.8.1)
29
+ minitest (5.4.0)
30
+ rack (1.5.2)
31
+ rack-test (0.6.2)
32
+ rack (>= 1.0)
33
+ railties (4.1.4)
34
+ actionpack (= 4.1.4)
35
+ activesupport (= 4.1.4)
36
+ rake (>= 0.8.7)
37
+ thor (>= 0.18.1, < 2.0)
38
+ rake (10.3.2)
39
+ thor (0.19.1)
40
+ thread_safe (0.3.4)
41
+ tzinfo (1.2.2)
42
+ thread_safe (~> 0.1)
43
+
44
+ PLATFORMS
45
+ ruby
46
+
47
+ DEPENDENCIES
48
+ jquery-animate-enhanced-rails!
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Leonid Beder
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,39 @@
1
+ # jquery-animate-enhanced-rails
2
+
3
+ This is a bundled version of the [jquery-animate-enhanced](https://github.com/benbarnett/jQuery-Animate-Enhanced) library.
4
+
5
+ ## Install
6
+
7
+ In your Gemfile, add:
8
+
9
+ ```ruby
10
+ gem 'jquery-animate-enhanced-rails'
11
+ ```
12
+ Add it to your JavaScript manifest file:
13
+
14
+ ``` js
15
+ //= require jquery.animate-enhanced
16
+ ```
17
+
18
+ ## License
19
+
20
+ The MIT License (MIT)
21
+
22
+ Copyright (c) 2014
23
+
24
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
25
+ this software and associated documentation files (the "Software"), to deal in
26
+ the Software without restriction, including without limitation the rights to
27
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
28
+ the Software, and to permit persons to whom the Software is furnished to do so,
29
+ subject to the following conditions:
30
+
31
+ The above copyright notice and this permission notice shall be included in all
32
+ copies or substantial portions of the Software.
33
+
34
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
36
+ FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
37
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
38
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
39
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,22 @@
1
+ $:.push File.expand_path('../lib', __FILE__)
2
+ require 'jquery/animate/enhanced/rails/version'
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'jquery-animate-enhanced-rails'
6
+ s.version = Jquery::Animate::Enhanced::Rails::VERSION
7
+ s.authors = ['Leonid Beder']
8
+ s.email = ['leonid.beder@gmail.com']
9
+ s.license = 'MIT'
10
+ s.homepage = ''
11
+ s.summary = 'Extend $.animate() to detect CSS transitions for Webkit, Mozilla, IE>=10 and Opera and convert animations automatically.
12
+ http://playground.benbarnett.net/jquery-animate-enhanced/'
13
+ s.description = 'Extend $.animate() to detect CSS transitions for Webkit, Mozilla, IE>=10 and Opera and convert animations automatically.
14
+ http://playground.benbarnett.net/jquery-animate-enhanced/.'
15
+
16
+ s.files = `git ls-files`.split($/)
17
+ s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ s.test_files = s.files.grep(%r{^(test|s|features)/})
19
+ s.require_paths = ['lib']
20
+
21
+ s.add_dependency 'railties', '>= 3.1.0'
22
+ end
@@ -0,0 +1,12 @@
1
+ require 'jquery/animate/enhanced/rails/version'
2
+
3
+ module Jquery
4
+ module Animate
5
+ module Enhanced
6
+ module Rails
7
+ class Engine < ::Rails::Engine
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ module Jquery
2
+ module Animate
3
+ module Enhanced
4
+ module Rails
5
+ VERSION = '1.11.0'.freeze
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,961 @@
1
+ /*
2
+ jquery.animate-enhanced plugin v1.11
3
+ ---
4
+ http://github.com/benbarnett/jQuery-Animate-Enhanced
5
+ http://benbarnett.net
6
+ @benpbarnett
7
+ ---
8
+ Copyright (c) 2013 Ben Barnett
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in
18
+ all copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26
+ THE SOFTWARE.
27
+ ---
28
+ Extends jQuery.animate() to automatically use CSS3 transformations where applicable.
29
+ Tested with jQuery 1.3.2+
30
+
31
+ Supports -moz-transition, -webkit-transition, -o-transition, transition
32
+
33
+ Targetted properties (for now):
34
+ - left
35
+ - top
36
+ - opacity
37
+ - width
38
+ - height
39
+
40
+ Usage (exactly the same as it would be normally):
41
+
42
+ jQuery(element).animate({left: 200}, 500, function() {
43
+ // callback
44
+ });
45
+
46
+ Changelog:
47
+ 1.11 (08/07/2014):
48
+ - Merging PR #157, fixes #156 for animating with 0
49
+
50
+ 1.10 (09/04/2014):
51
+ - Merging PR #153 Don't try to restore values which weren't saved
52
+
53
+ 1.09 (09/04/2014):
54
+ - Merging PR #154 Added support of AMD and Node.js (via browserify) environments
55
+
56
+ 1.08 (16/01/2014):
57
+ - Merging PR #147 Access element tag name appropriately
58
+
59
+ 1.07 (06/12/2013):
60
+ - Merging PR #139 Other units, beside '%' should also be kept
61
+
62
+ 1.06 (06/12/2013):
63
+ - Merging PR #140 Do not change a user defined display mode for elements, after show/hide
64
+
65
+ 1.05 (14/08/2013):
66
+ - Merging PR #124 fix for highcharts clash. Thanks @bensonc!
67
+
68
+ 1.04 (14/08/2013):
69
+ - Using fix from issue #69 by @rickyk586 to support percentages
70
+
71
+ 1.03 (19/7/2013):
72
+ - Merge PR #129 (Use originalAnimateMethod if a step callback function is provided.) /thx @lehni
73
+
74
+ 1.02 (8/5/2013):
75
+ - Fixing use3D default flags. It must explicitly be set to false to disable 3d now, the plugin by default will use it if available.
76
+
77
+ 1.01 (8/5/2013):
78
+ - Adding appropriate display value for wider range of elements (issue #121 - thanks smacky)
79
+
80
+ 1.0 (8/5/2103):
81
+ - Fix avoidTransforms: true behaviour for directional transitions
82
+
83
+ 0.99.1 (3/4/2013):
84
+ - Add Set or unset the 'disabled by default' value (PR #117)
85
+
86
+ 0.99 (5/12/2012):
87
+ - PR #109 Added support for list-item nodes. FadeIn on tags was omitting the list-style support. (thx @SeanCannon)
88
+
89
+ 0.98 (12/11/2012):
90
+ - Merging pull request #106 thx @gboysko - checking for ownerDocument before using getComputedStyle
91
+
92
+ 0.97 (6/11/2012):
93
+ - Merging pull request #104 thx @gavrochelegnou - .bind instead of .one
94
+
95
+ 0.96a (20/08/2012):
96
+ - Checking event is from dispatch target (issue #58)
97
+
98
+ 0.96 (20/08/2012):
99
+ - Fixes for context, all elements returned as context (issue #84)
100
+ - Reset position with leaveTransforms !== true fixes (issue #93)
101
+
102
+
103
+ 0.95 (20/08/2012):
104
+ - If target opacity == current opacity, pass back to jquery native to get callback firing (#94)
105
+
106
+ 0.94 (20/08/2012):
107
+ - Addresses Firefox callback mechanisms (issue #94)
108
+ - using $.one() to bind to CSS callbacks in a more generic way
109
+
110
+ 0.93 (6/8/2012):
111
+ - Adding other Opera 'transitionend' event (re: issue #90)
112
+
113
+ 0.92 (6/8/2012):
114
+ - Seperate unbinds into different threads (re: issue #91)
115
+
116
+ 0.91 (2/4/2012):
117
+ - Merge Pull Request #74 - Unit Management
118
+
119
+ 0.90 (7/3/2012):
120
+ - Adding public $.toggleDisabledByDefault() feature to disable entire plugin by default (Issue #73)
121
+
122
+ 0.89 (24/1/2012):
123
+ - Adding 'avoidCSSTransitions' property. Set to true to disable entire plugin. (Issue #47)
124
+
125
+ 0.88 (24/1/2012):
126
+ - Fix Issue #67 for HighchartsJS compatibility
127
+
128
+ 0.87 (24/1/2012):
129
+ - Fix Issue #66 selfCSSData.original is undefined
130
+
131
+ 0.86 (9/1/2012):
132
+ - Strict JS fix for undefined variable
133
+
134
+ 0.85 (20/12/2011):
135
+ - Merge Pull request #57 from Kronuz
136
+ - Codebase cleaned and now passes jshint.
137
+ - Fixed a few bugs (it now saves and restores the original css transition properties).
138
+ - fadeOut() is fixed, it wasn't restoring the opacity after hiding it.
139
+
140
+ 0.80 (13/09/2011):
141
+ - Issue #28 - Report $(el).is(':animated') fix
142
+
143
+ 0.79 (06/09/2011):
144
+ - Issue #42 - Right negative position animation: please see issue notes on Github.
145
+
146
+ 0.78 (02/09/2011):
147
+ - Issue #18 - jQuery/$ reference joys
148
+
149
+ 0.77 (02/09/2011):
150
+ - Adding feature on Github issue #44 - Use 3D Transitions by default
151
+
152
+ 0.76 (28/06/2011):
153
+ - Fixing issue #37 - fixed stop() method (with gotoEnd == false)
154
+
155
+ 0.75 (15/06/2011):
156
+ - Fixing issue #35 to pass actual object back as context for callback
157
+
158
+ 0.74 (28/05/2011):
159
+ - Fixing issue #29 to play nice with 1.6+
160
+
161
+ 0.73 (05/03/2011):
162
+ - Merged Pull Request #26: Fixed issue with fadeOut() / "hide" shortcut
163
+
164
+ 0.72 (05/03/2011):
165
+ - Merged Pull Request #23: Added Penner equation approximations from Matthew Lein's Ceaser, and added failsafe fallbacks
166
+
167
+ 0.71 (05/03/2011):
168
+ - Merged Pull Request #24: Changes translation object to integers instead of strings to fix relative values bug with leaveTransforms = true
169
+
170
+ 0.70 (17/03/2011):
171
+ - Merged Pull Request from amlw-nyt to add bottom/right handling
172
+
173
+ 0.68 (15/02/2011):
174
+ - width/height fixes & queue issues resolved.
175
+
176
+ 0.67 (15/02/2011):
177
+ - Code cleanups & file size improvements for compression.
178
+
179
+ 0.66 (15/02/2011):
180
+ - Zero second fadeOut(), fadeIn() fixes
181
+
182
+ 0.65 (01/02/2011):
183
+ - Callbacks with queue() support refactored to support element arrays
184
+
185
+ 0.64 (27/01/2011):
186
+ - BUGFIX #13: .slideUp(), .slideToggle(), .slideDown() bugfixes in Webkit
187
+
188
+ 0.63 (12/01/2011):
189
+ - BUGFIX #11: callbacks not firing when new value == old value
190
+
191
+ 0.62 (10/01/2011):
192
+ - BUGFIX #11: queue is not a function issue fixed
193
+
194
+ 0.61 (10/01/2011):
195
+ - BUGFIX #10: Negative positions converting to positive
196
+
197
+ 0.60 (06/01/2011):
198
+ - Animate function rewrite in accordance with new queue system
199
+ - BUGFIX #8: Left/top position values always assumed relative rather than absolute
200
+ - BUGFIX #9: animation as last item in a chain - the chain is ignored?
201
+ - BUGFIX: width/height CSS3 transformation with left/top working
202
+
203
+ 0.55 (22/12/2010):
204
+ - isEmptyObject function for <jQuery 1.4 (requires 1.3.2)
205
+
206
+ 0.54a (22/12/2010):
207
+ - License changed to MIT (http://www.opensource.org/licenses/mit-license.php)
208
+
209
+ 0.54 (22/12/2010):
210
+ - Removed silly check for 'jQuery UI' bailouts. Sorry.
211
+ - Scoping issues fixed - Issue #4: $(this) should give you a reference to the selector being animated.. per jquery's core animation funciton.
212
+
213
+ 0.53 (17/11/2010):
214
+ - New $.translate() method to easily calculate current transformed translation
215
+ - Repeater callback bug fix for leaveTransforms:true (was constantly appending properties)
216
+
217
+ 0.52 (16/11/2010):
218
+ - leaveTransforms: true bug fixes
219
+ - 'Applying' user callback function to retain 'this' context
220
+
221
+ 0.51 (08/11/2010):
222
+ - Bailing out with jQuery UI. This is only so the plugin plays nice with others and is TEMPORARY.
223
+
224
+ 0.50 (08/11/2010):
225
+ - Support for $.fn.stop()
226
+ - Fewer jQuery.fn entries to preserve namespace
227
+ - All references $ converted to jQuery
228
+ - jsDoc Toolkit style commenting for docs (coming soon)
229
+
230
+ 0.49 (19/10/2010):
231
+ - Handling of 'undefined' errors for secondary CSS objects
232
+ - Support to enhance 'width' and 'height' properties (except shortcuts involving jQuery.fx.step, e.g slideToggle)
233
+ - Bugfix: Positioning when using avoidTransforms: true (thanks Ralf Santbergen reports)
234
+ - Bugfix: Callbacks and Scope issues
235
+
236
+ 0.48 (13/10/2010):
237
+ - Checks for 3d support before applying
238
+
239
+ 0.47 (12/10/2010);
240
+ - Compatible with .fadeIn(), .fadeOut()
241
+ - Use shortcuts, no duration for jQuery default or "fast" and "slow"
242
+ - Clean up callback event listeners on complete (preventing multiple callbacks)
243
+
244
+ 0.46 (07/10/2010);
245
+ - Compatible with .slideUp(), .slideDown(), .slideToggle()
246
+
247
+ 0.45 (06/10/2010):
248
+ - 'Zero' position bug fix (was originally translating by 0 zero pixels, i.e. no movement)
249
+
250
+ 0.4 (05/10/2010):
251
+ - Iterate over multiple elements and store transforms in jQuery.data per element
252
+ - Include support for relative values (+= / -=)
253
+ - Better unit sanitization
254
+ - Performance tweaks
255
+ - Fix for optional callback function (was required)
256
+ - Applies data[translateX] and data[translateY] to elements for easy access
257
+ - Added 'easeInOutQuint' easing function for CSS transitions (requires jQuery UI for JS anims)
258
+ - Less need for leaveTransforms = true due to better position detections
259
+ */
260
+
261
+ (function (window, factory) {
262
+ if (typeof define === 'function' && define.amd) {
263
+ // AMD. Register as an anonymous module.
264
+ define(['jquery'], function(){
265
+ return factory.apply(window, arguments);
266
+ });
267
+ } else if (typeof module === 'object' && module.exports) {
268
+ // NodeJS.
269
+ module.exports = factory.call(window, require('jquery'));
270
+ } else {
271
+ // Browser globals
272
+ factory.call(window, window.jQuery);
273
+ }
274
+ }(typeof global === 'object' ? global : this, function (jQuery) {
275
+ var originalAnimateMethod = jQuery.fn.animate,
276
+ originalStopMethod = jQuery.fn.stop;
277
+
278
+ // ----------
279
+ // Plugin variables
280
+ // ----------
281
+ var cssTransitionProperties = ['top', 'right', 'bottom', 'left', 'opacity', 'height', 'width'],
282
+ directions = ['top', 'right', 'bottom', 'left'],
283
+ cssPrefixes = ['-webkit-', '-moz-', '-o-', ''],
284
+ pluginOptions = ['avoidTransforms', 'useTranslate3d', 'leaveTransforms'],
285
+ rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
286
+ rupper = /([A-Z])/g,
287
+ defaultEnhanceData = {
288
+ secondary: {},
289
+ meta: {
290
+ top : 0,
291
+ right : 0,
292
+ bottom : 0,
293
+ left : 0
294
+ }
295
+ },
296
+ valUnit = 'px',
297
+
298
+ DATA_KEY = 'jQe',
299
+ CUBIC_BEZIER_OPEN = 'cubic-bezier(',
300
+ CUBIC_BEZIER_CLOSE = ')',
301
+
302
+ originalAnimatedFilter = null,
303
+ pluginDisabledDefault = false;
304
+
305
+
306
+ // ----------
307
+ // Check if this browser supports CSS3 transitions
308
+ // ----------
309
+ var thisBody = document.body || document.documentElement,
310
+ thisStyle = thisBody.style,
311
+ transitionEndEvent = 'webkitTransitionEnd oTransitionEnd transitionend',
312
+ cssTransitionsSupported = thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.OTransition !== undefined || thisStyle.transition !== undefined,
313
+ has3D = ('WebKitCSSMatrix' in window && 'm11' in new WebKitCSSMatrix()),
314
+ use3DByDefault = has3D;
315
+
316
+
317
+
318
+ // ----------
319
+ // Extended :animated filter
320
+ // ----------
321
+ if ( jQuery.expr && jQuery.expr.filters ) {
322
+ originalAnimatedFilter = jQuery.expr.filters.animated;
323
+ jQuery.expr.filters.animated = function(elem) {
324
+ return jQuery(elem).data('events') && jQuery(elem).data('events')[transitionEndEvent] ? true : originalAnimatedFilter.call(this, elem);
325
+ };
326
+ }
327
+
328
+
329
+ /**
330
+ @private
331
+ @name _getUnit
332
+ @function
333
+ @description Return unit value ("px", "%", "em" for re-use correct one when translating)
334
+ @param {variant} [val] Target value
335
+ */
336
+ function _getUnit(val){
337
+ return val.match(/\D+$/);
338
+ }
339
+
340
+
341
+ /**
342
+ @private
343
+ @name _interpretValue
344
+ @function
345
+ @description Interpret value ("px", "+=" and "-=" sanitisation)
346
+ @param {object} [element] The Element for current CSS analysis
347
+ @param {variant} [val] Target value
348
+ @param {string} [prop] The property we're looking at
349
+ @param {boolean} [isTransform] Is this a CSS3 transform?
350
+ */
351
+ function _interpretValue(e, val, prop, isTransform) {
352
+ // this is a nasty fix, but we check for prop == 'd' to see if we're dealing with SVG, and abort
353
+ if (prop == "d") return;
354
+ if (!_isValidElement(e)) return;
355
+
356
+ var parts = rfxnum.exec(val),
357
+ start = e.css(prop) === 'auto' ? 0 : e.css(prop),
358
+ cleanCSSStart = typeof start == 'string' ? _cleanValue(start) : start,
359
+ cleanTarget = typeof val == 'string' ? _cleanValue(val) : val,
360
+ cleanStart = isTransform === true ? 0 : cleanCSSStart,
361
+ hidden = e.is(':hidden'),
362
+ translation = e.translation();
363
+
364
+ if (prop == 'left') cleanStart = parseInt(cleanCSSStart, 10) + translation.x;
365
+ if (prop == 'right') cleanStart = parseInt(cleanCSSStart, 10) + translation.x;
366
+ if (prop == 'top') cleanStart = parseInt(cleanCSSStart, 10) + translation.y;
367
+ if (prop == 'bottom') cleanStart = parseInt(cleanCSSStart, 10) + translation.y;
368
+
369
+ // deal with shortcuts
370
+ if (!parts && val == 'show') {
371
+ cleanStart = 1;
372
+ if (hidden) {
373
+ elem = e[0];
374
+ if (elem.style) {
375
+ display = elem.style.display;
376
+
377
+ // Reset the inline display of this element to learn if it is
378
+ // being hidden by cascaded rules or not
379
+ if (!jQuery._data(elem, 'olddisplay') && display === 'none') {
380
+ display = elem.style.display = '';
381
+ }
382
+
383
+ // Set elements which have been overridden with display: none
384
+ // in a stylesheet to whatever the default browser style is
385
+ // for such an element
386
+ if ( display === '' && jQuery.css(elem, 'display') === 'none' ) {
387
+ jQuery._data(elem, 'olddisplay', _domElementVisibleDisplayValue(elem.tagName));
388
+ }
389
+
390
+ if (display === '' || display === 'none') {
391
+ elem.style.display = jQuery._data(elem, 'olddisplay') || '';
392
+ }
393
+ }
394
+ e.css('opacity', 0);
395
+ }
396
+ } else if (!parts && val == 'hide') {
397
+ cleanStart = 0;
398
+ }
399
+
400
+ if (parts) {
401
+ var end = parseFloat(parts[2]);
402
+
403
+ // If a +=/-= token was provided, we're doing a relative animation
404
+ if (parts[1]) end = ((parts[1] === '-=' ? -1 : 1) * end) + parseInt(cleanStart, 10);
405
+
406
+ // check for unit as per issue #69
407
+ if (parts[3] && parts[3] != 'px') end = end + parts[3];
408
+
409
+ return end;
410
+ } else {
411
+ return cleanStart;
412
+ }
413
+ }
414
+
415
+ /**
416
+ @private
417
+ @name _getTranslation
418
+ @function
419
+ @description Make a translate or translate3d string
420
+ @param {integer} [x]
421
+ @param {integer} [y]
422
+ @param {boolean} [use3D] Use translate3d if available?
423
+ */
424
+ function _getTranslation(x, y, use3D) {
425
+ return ((use3D === true || ((use3DByDefault === true && use3D !== false)) && has3D)) ? 'translate3d(' + x + 'px, ' + y + 'px, 0)' : 'translate(' + x + 'px,' + y + 'px)';
426
+ }
427
+
428
+
429
+ /**
430
+ @private
431
+ @name _applyCSSTransition
432
+ @function
433
+ @description Build up the CSS object
434
+ @param {object} [e] Element
435
+ @param {string} [property] Property we're dealing with
436
+ @param {integer} [duration] Duration
437
+ @param {string} [easing] Easing function
438
+ @param {variant} [value] String/integer for target value
439
+ @param {boolean} [isTransform] Is this a CSS transformation?
440
+ @param {boolean} [isTranslatable] Is this a CSS translation?
441
+ @param {boolean} [use3D] Use translate3d if available?
442
+ */
443
+ function _applyCSSTransition(e, property, duration, easing, value, isTransform, isTranslatable, use3D) {
444
+ var eCSSData = e.data(DATA_KEY),
445
+ enhanceData = eCSSData && !_isEmptyObject(eCSSData) ? eCSSData : jQuery.extend(true, {}, defaultEnhanceData),
446
+ offsetPosition = value,
447
+ isDirection = jQuery.inArray(property, directions) > -1;
448
+
449
+
450
+ if (isDirection) {
451
+ var meta = enhanceData.meta,
452
+ cleanPropertyValue = _cleanValue(e.css(property)) || 0,
453
+ stashedProperty = property + '_o';
454
+
455
+ offsetPosition = value - cleanPropertyValue;
456
+
457
+
458
+ meta[property] = offsetPosition;
459
+ meta[stashedProperty] = e.css(property) == 'auto' ? 0 + offsetPosition : cleanPropertyValue + offsetPosition || 0;
460
+ enhanceData.meta = meta;
461
+
462
+ // fix 0 issue (transition by 0 = nothing)
463
+ if (isTranslatable && offsetPosition === 0) {
464
+ offsetPosition = 0 - meta[stashedProperty];
465
+ meta[property] = offsetPosition;
466
+ meta[stashedProperty] = 0;
467
+ }
468
+ }
469
+
470
+ // reapply data and return
471
+ return e.data(DATA_KEY, _applyCSSWithPrefix(e, enhanceData, property, duration, easing, offsetPosition, isTransform, isTranslatable, use3D));
472
+ }
473
+
474
+ /**
475
+ @private
476
+ @name _applyCSSWithPrefix
477
+ @function
478
+ @description Helper function to build up CSS properties using the various prefixes
479
+ @param {object} [cssProperties] Current CSS object to merge with
480
+ @param {string} [property]
481
+ @param {integer} [duration]
482
+ @param {string} [easing]
483
+ @param {variant} [value]
484
+ @param {boolean} [isTransform] Is this a CSS transformation?
485
+ @param {boolean} [isTranslatable] Is this a CSS translation?
486
+ @param {boolean} [use3D] Use translate3d if available?
487
+ */
488
+ function _applyCSSWithPrefix(e, cssProperties, property, duration, easing, value, isTransform, isTranslatable, use3D) {
489
+ var saveOriginal = false,
490
+ transform = isTransform === true && isTranslatable === true;
491
+
492
+
493
+ cssProperties = cssProperties || {};
494
+ if (!cssProperties.original) {
495
+ cssProperties.original = {};
496
+ saveOriginal = true;
497
+ }
498
+ cssProperties.properties = cssProperties.properties || {};
499
+ cssProperties.secondary = cssProperties.secondary || {};
500
+
501
+ var meta = cssProperties.meta,
502
+ original = cssProperties.original,
503
+ properties = cssProperties.properties,
504
+ secondary = cssProperties.secondary;
505
+
506
+ for (var i = cssPrefixes.length - 1; i >= 0; i--) {
507
+ var tp = cssPrefixes[i] + 'transition-property',
508
+ td = cssPrefixes[i] + 'transition-duration',
509
+ tf = cssPrefixes[i] + 'transition-timing-function';
510
+
511
+ property = (transform ? cssPrefixes[i] + 'transform' : property);
512
+
513
+ if (saveOriginal) {
514
+ original[tp] = e.css(tp) || '';
515
+ original[td] = e.css(td) || '';
516
+ original[tf] = e.css(tf) || '';
517
+ }
518
+
519
+ secondary[property] = transform ? _getTranslation(meta.left, meta.top, use3D) : value;
520
+
521
+ properties[tp] = (properties[tp] ? properties[tp] + ',' : '') + property;
522
+ properties[td] = (properties[td] ? properties[td] + ',' : '') + duration + 'ms';
523
+ properties[tf] = (properties[tf] ? properties[tf] + ',' : '') + easing;
524
+ }
525
+
526
+ return cssProperties;
527
+ }
528
+
529
+ /**
530
+ @private
531
+ @name _isBoxShortcut
532
+ @function
533
+ @description Shortcut to detect if we need to step away from slideToggle, CSS accelerated transitions (to come later with fx.step support)
534
+ @param {object} [prop]
535
+ */
536
+ function _isBoxShortcut(prop) {
537
+ for (var property in prop) {
538
+ if ((property == 'width' || property == 'height') && (prop[property] == 'show' || prop[property] == 'hide' || prop[property] == 'toggle')) {
539
+ return true;
540
+ }
541
+ }
542
+ return false;
543
+ }
544
+
545
+
546
+ /**
547
+ @private
548
+ @name _isEmptyObject
549
+ @function
550
+ @description Check if object is empty (<1.4 compatibility)
551
+ @param {object} [obj]
552
+ */
553
+ function _isEmptyObject(obj) {
554
+ for (var i in obj) {
555
+ return false;
556
+ }
557
+ return true;
558
+ }
559
+
560
+ /**
561
+ * Fetch most appropriate display value for element types
562
+ * @see https://github.com/benbarnett/jQuery-Animate-Enhanced/issues/121
563
+ * @private
564
+ * @param {[type]} tagName [description]
565
+ * @return {[type]} [description]
566
+ */
567
+ function _domElementVisibleDisplayValue(tagName) {
568
+ tagName = tagName.toUpperCase();
569
+ var displayValues = {
570
+ 'LI' : 'list-item',
571
+ 'TR' : 'table-row',
572
+ 'TD' : 'table-cell',
573
+ 'TH' : 'table-cell',
574
+ 'CAPTION' : 'table-caption',
575
+ 'COL' : 'table-column',
576
+ 'COLGROUP' : 'table-column-group',
577
+ 'TFOOT' : 'table-footer-group',
578
+ 'THEAD' : 'table-header-group',
579
+ 'TBODY' : 'table-row-group'
580
+ };
581
+
582
+ return typeof displayValues[tagName] == 'string' ? displayValues[tagName] : 'block';
583
+ }
584
+
585
+
586
+ /**
587
+ @private
588
+ @name _cleanValue
589
+ @function
590
+ @description Remove 'px' and other artifacts
591
+ @param {variant} [val]
592
+ */
593
+ function _cleanValue(val) {
594
+ return parseFloat(val.replace(_getUnit(val), ''));
595
+ }
596
+
597
+
598
+ function _isValidElement(element) {
599
+ var allValid=true;
600
+ element.each(function(index, el) {
601
+ allValid = allValid && el.ownerDocument;
602
+ return allValid;
603
+ });
604
+ return allValid;
605
+ }
606
+
607
+ /**
608
+ @private
609
+ @name _appropriateProperty
610
+ @function
611
+ @description Function to check if property should be handled by plugin
612
+ @param {string} [prop]
613
+ @param {variant} [value]
614
+ */
615
+ function _appropriateProperty(prop, value, element) {
616
+ if (!_isValidElement(element)) {
617
+ return false;
618
+ }
619
+
620
+ var is = jQuery.inArray(prop, cssTransitionProperties) > -1;
621
+ if ((prop == 'width' || prop == 'height' || prop == 'opacity') && (parseFloat(value) === parseFloat(element.css(prop)))) is = false;
622
+ return is;
623
+ }
624
+
625
+
626
+ jQuery.extend({
627
+ /**
628
+ @public
629
+ @name toggle3DByDefault
630
+ @function
631
+ @description Toggle for plugin settings to automatically use translate3d (where available). Usage: $.toggle3DByDefault
632
+ */
633
+ toggle3DByDefault: function() {
634
+ return use3DByDefault = !use3DByDefault;
635
+ },
636
+
637
+
638
+ /**
639
+ @public
640
+ @name toggleDisabledByDefault
641
+ @function
642
+ @description Toggle the plugin to be disabled by default (can be overridden per animation with avoidCSSTransitions)
643
+ */
644
+ toggleDisabledByDefault: function() {
645
+ return pluginDisabledDefault = !pluginDisabledDefault;
646
+ },
647
+
648
+
649
+ /**
650
+ @public
651
+ @name setDisabledByDefault
652
+ @function
653
+ @description Set or unset the 'disabled by default' value
654
+ */
655
+ setDisabledByDefault: function(newValue) {
656
+ return pluginDisabledDefault = newValue;
657
+ }
658
+ });
659
+
660
+
661
+ /**
662
+ @public
663
+ @name translation
664
+ @function
665
+ @description Get current X and Y translations
666
+ */
667
+ jQuery.fn.translation = function() {
668
+ if (!this[0]) {
669
+ return null;
670
+ }
671
+
672
+ var elem = this[0],
673
+ cStyle = window.getComputedStyle(elem, null),
674
+ translation = {
675
+ x: 0,
676
+ y: 0
677
+ };
678
+
679
+ if (cStyle) {
680
+ for (var i = cssPrefixes.length - 1; i >= 0; i--) {
681
+ var transform = cStyle.getPropertyValue(cssPrefixes[i] + 'transform');
682
+ if (transform && (/matrix/i).test(transform)) {
683
+ var explodedMatrix = transform.replace(/^matrix\(/i, '').split(/, |\)$/g);
684
+ translation = {
685
+ x: parseInt(explodedMatrix[4], 10),
686
+ y: parseInt(explodedMatrix[5], 10)
687
+ };
688
+
689
+ break;
690
+ }
691
+ }
692
+ }
693
+
694
+ return translation;
695
+ };
696
+
697
+
698
+
699
+ /**
700
+ @public
701
+ @name jQuery.fn.animate
702
+ @function
703
+ @description The enhanced jQuery.animate function
704
+ @param {string} [property]
705
+ @param {string} [speed]
706
+ @param {string} [easing]
707
+ @param {function} [callback]
708
+ */
709
+ jQuery.fn.animate = function(prop, speed, easing, callback) {
710
+ prop = prop || {};
711
+ var isTranslatable = !(typeof prop['bottom'] !== 'undefined' || typeof prop['right'] !== 'undefined'),
712
+ optall = jQuery.speed(speed, easing, callback),
713
+ callbackQueue = 0,
714
+ propertyCallback = function() {
715
+ callbackQueue--;
716
+ if (callbackQueue === 0) {
717
+ // we're done, trigger the user callback
718
+ if (typeof optall.complete === 'function') {
719
+ optall.complete.apply(this, arguments);
720
+ }
721
+ }
722
+ },
723
+ bypassPlugin = (typeof prop['avoidCSSTransitions'] !== 'undefined') ? prop['avoidCSSTransitions'] : pluginDisabledDefault;
724
+
725
+ if (bypassPlugin === true || !cssTransitionsSupported || _isEmptyObject(prop) || _isBoxShortcut(prop) || optall.duration <= 0 || optall.step) {
726
+ return originalAnimateMethod.apply(this, arguments);
727
+ }
728
+
729
+ return this[ optall.queue === true ? 'queue' : 'each' ](function() {
730
+ var self = jQuery(this),
731
+ opt = jQuery.extend({}, optall),
732
+ cssCallback = function(e) {
733
+ var selfCSSData = self.data(DATA_KEY) || { original: {} },
734
+ restore = {};
735
+
736
+ if (e.eventPhase != 2) // not at dispatching target (thanks @warappa issue #58)
737
+ return;
738
+
739
+ // convert translations to left & top for layout
740
+ if (prop.leaveTransforms !== true) {
741
+ for (var i = cssPrefixes.length - 1; i >= 0; i--) {
742
+ restore[cssPrefixes[i] + 'transform'] = '';
743
+ }
744
+ if (isTranslatable && typeof selfCSSData.meta !== 'undefined') {
745
+ for (var j = 0, dir; (dir = directions[j]); ++j) {
746
+ var stashedProperty = selfCSSData.meta[dir + '_o'];
747
+ if (typeof stashedProperty !== 'undefined') {
748
+ restore[dir] = stashedProperty + valUnit;
749
+ jQuery(this).css(dir, restore[dir]);
750
+ }
751
+ }
752
+ }
753
+ }
754
+
755
+ // remove transition timing functions
756
+ self.
757
+ unbind(transitionEndEvent).
758
+ css(selfCSSData.original).
759
+ css(restore).
760
+ data(DATA_KEY, null);
761
+
762
+ // if we used the fadeOut shortcut make sure elements are display:none
763
+ if (prop.opacity === 'hide') {
764
+ elem = self[0];
765
+ if (elem.style) {
766
+ display = jQuery.css(elem, 'display');
767
+
768
+ if (display !== 'none' && !jQuery._data(elem, 'olddisplay')) {
769
+ jQuery._data(elem, 'olddisplay', display);
770
+ }
771
+ elem.style.display = 'none';
772
+ }
773
+
774
+ self.css('opacity', '');
775
+ }
776
+
777
+ // run the main callback function
778
+ propertyCallback.call(this);
779
+ },
780
+ easings = {
781
+ bounce: CUBIC_BEZIER_OPEN + '0.0, 0.35, .5, 1.3' + CUBIC_BEZIER_CLOSE,
782
+ linear: 'linear',
783
+ swing: 'ease-in-out',
784
+
785
+ // Penner equation approximations from Matthew Lein's Ceaser: http://matthewlein.com/ceaser/
786
+ easeInQuad: CUBIC_BEZIER_OPEN + '0.550, 0.085, 0.680, 0.530' + CUBIC_BEZIER_CLOSE,
787
+ easeInCubic: CUBIC_BEZIER_OPEN + '0.550, 0.055, 0.675, 0.190' + CUBIC_BEZIER_CLOSE,
788
+ easeInQuart: CUBIC_BEZIER_OPEN + '0.895, 0.030, 0.685, 0.220' + CUBIC_BEZIER_CLOSE,
789
+ easeInQuint: CUBIC_BEZIER_OPEN + '0.755, 0.050, 0.855, 0.060' + CUBIC_BEZIER_CLOSE,
790
+ easeInSine: CUBIC_BEZIER_OPEN + '0.470, 0.000, 0.745, 0.715' + CUBIC_BEZIER_CLOSE,
791
+ easeInExpo: CUBIC_BEZIER_OPEN + '0.950, 0.050, 0.795, 0.035' + CUBIC_BEZIER_CLOSE,
792
+ easeInCirc: CUBIC_BEZIER_OPEN + '0.600, 0.040, 0.980, 0.335' + CUBIC_BEZIER_CLOSE,
793
+ easeInBack: CUBIC_BEZIER_OPEN + '0.600, -0.280, 0.735, 0.045' + CUBIC_BEZIER_CLOSE,
794
+ easeOutQuad: CUBIC_BEZIER_OPEN + '0.250, 0.460, 0.450, 0.940' + CUBIC_BEZIER_CLOSE,
795
+ easeOutCubic: CUBIC_BEZIER_OPEN + '0.215, 0.610, 0.355, 1.000' + CUBIC_BEZIER_CLOSE,
796
+ easeOutQuart: CUBIC_BEZIER_OPEN + '0.165, 0.840, 0.440, 1.000' + CUBIC_BEZIER_CLOSE,
797
+ easeOutQuint: CUBIC_BEZIER_OPEN + '0.230, 1.000, 0.320, 1.000' + CUBIC_BEZIER_CLOSE,
798
+ easeOutSine: CUBIC_BEZIER_OPEN + '0.390, 0.575, 0.565, 1.000' + CUBIC_BEZIER_CLOSE,
799
+ easeOutExpo: CUBIC_BEZIER_OPEN + '0.190, 1.000, 0.220, 1.000' + CUBIC_BEZIER_CLOSE,
800
+ easeOutCirc: CUBIC_BEZIER_OPEN + '0.075, 0.820, 0.165, 1.000' + CUBIC_BEZIER_CLOSE,
801
+ easeOutBack: CUBIC_BEZIER_OPEN + '0.175, 0.885, 0.320, 1.275' + CUBIC_BEZIER_CLOSE,
802
+ easeInOutQuad: CUBIC_BEZIER_OPEN + '0.455, 0.030, 0.515, 0.955' + CUBIC_BEZIER_CLOSE,
803
+ easeInOutCubic: CUBIC_BEZIER_OPEN + '0.645, 0.045, 0.355, 1.000' + CUBIC_BEZIER_CLOSE,
804
+ easeInOutQuart: CUBIC_BEZIER_OPEN + '0.770, 0.000, 0.175, 1.000' + CUBIC_BEZIER_CLOSE,
805
+ easeInOutQuint: CUBIC_BEZIER_OPEN + '0.860, 0.000, 0.070, 1.000' + CUBIC_BEZIER_CLOSE,
806
+ easeInOutSine: CUBIC_BEZIER_OPEN + '0.445, 0.050, 0.550, 0.950' + CUBIC_BEZIER_CLOSE,
807
+ easeInOutExpo: CUBIC_BEZIER_OPEN + '1.000, 0.000, 0.000, 1.000' + CUBIC_BEZIER_CLOSE,
808
+ easeInOutCirc: CUBIC_BEZIER_OPEN + '0.785, 0.135, 0.150, 0.860' + CUBIC_BEZIER_CLOSE,
809
+ easeInOutBack: CUBIC_BEZIER_OPEN + '0.680, -0.550, 0.265, 1.550' + CUBIC_BEZIER_CLOSE
810
+ },
811
+ domProperties = {},
812
+ cssEasing = easings[opt.easing || 'swing'] ? easings[opt.easing || 'swing'] : opt.easing || 'swing';
813
+
814
+ // seperate out the properties for the relevant animation functions
815
+ for (var p in prop) {
816
+ if (jQuery.inArray(p, pluginOptions) === -1) {
817
+ var isDirection = jQuery.inArray(p, directions) > -1,
818
+ cleanVal = _interpretValue(self, prop[p], p, (isDirection && prop.avoidTransforms !== true));
819
+
820
+
821
+ if (/**prop.avoidTransforms !== true && **/_appropriateProperty(p, cleanVal, self)) {
822
+ _applyCSSTransition(
823
+ self,
824
+ p,
825
+ opt.duration,
826
+ cssEasing,
827
+ cleanVal, //isDirection && prop.avoidTransforms === true ? cleanVal + valUnit : cleanVal,
828
+ isDirection && prop.avoidTransforms !== true,
829
+ isTranslatable,
830
+ prop.useTranslate3d);
831
+
832
+ }
833
+ else {
834
+ domProperties[p] = prop[p];
835
+ }
836
+ }
837
+ }
838
+
839
+ self.unbind(transitionEndEvent);
840
+
841
+ var selfCSSData = self.data(DATA_KEY);
842
+
843
+
844
+ if (selfCSSData && !_isEmptyObject(selfCSSData) && !_isEmptyObject(selfCSSData.secondary)) {
845
+ callbackQueue++;
846
+
847
+ self.css(selfCSSData.properties);
848
+
849
+ // store in a var to avoid any timing issues, depending on animation duration
850
+ var secondary = selfCSSData.secondary;
851
+
852
+ // has to be done in a timeout to ensure transition properties are set
853
+ setTimeout(function() {
854
+ self.bind(transitionEndEvent, cssCallback).css(secondary);
855
+ });
856
+ }
857
+ else {
858
+ // it won't get fired otherwise
859
+ opt.queue = false;
860
+ }
861
+
862
+ // fire up DOM based animations
863
+ if (!_isEmptyObject(domProperties)) {
864
+ callbackQueue++;
865
+ originalAnimateMethod.apply(self, [domProperties, {
866
+ duration: opt.duration,
867
+ easing: jQuery.easing[opt.easing] ? opt.easing : (jQuery.easing.swing ? 'swing' : 'linear'),
868
+ complete: propertyCallback,
869
+ queue: opt.queue
870
+ }]);
871
+ }
872
+
873
+ // strict JS compliance
874
+ return true;
875
+ });
876
+ };
877
+
878
+ jQuery.fn.animate.defaults = {};
879
+
880
+
881
+ /**
882
+ @public
883
+ @name jQuery.fn.stop
884
+ @function
885
+ @description The enhanced jQuery.stop function (resets transforms to left/top)
886
+ @param {boolean} [clearQueue]
887
+ @param {boolean} [gotoEnd]
888
+ @param {boolean} [leaveTransforms] Leave transforms/translations as they are? Default: false (reset translations to calculated explicit left/top props)
889
+ */
890
+ jQuery.fn.stop = function(clearQueue, gotoEnd, leaveTransforms) {
891
+ if (!cssTransitionsSupported) return originalStopMethod.apply(this, [clearQueue, gotoEnd]);
892
+
893
+ // clear the queue?
894
+ if (clearQueue) this.queue([]);
895
+
896
+ // route to appropriate stop methods
897
+ this.each(function() {
898
+ var self = jQuery(this),
899
+ selfCSSData = self.data(DATA_KEY);
900
+
901
+ // is this a CSS transition?
902
+ if (selfCSSData && !_isEmptyObject(selfCSSData)) {
903
+ var i, restore = {};
904
+
905
+ if (gotoEnd) {
906
+ // grab end state properties
907
+ restore = selfCSSData.secondary;
908
+
909
+ if (!leaveTransforms && typeof selfCSSData.meta['left_o'] !== undefined || typeof selfCSSData.meta['top_o'] !== undefined) {
910
+ restore['left'] = typeof selfCSSData.meta['left_o'] !== undefined ? selfCSSData.meta['left_o'] : 'auto';
911
+ restore['top'] = typeof selfCSSData.meta['top_o'] !== undefined ? selfCSSData.meta['top_o'] : 'auto';
912
+
913
+ // remove the transformations
914
+ for (i = cssPrefixes.length - 1; i >= 0; i--) {
915
+ restore[cssPrefixes[i]+'transform'] = '';
916
+ }
917
+ }
918
+ } else if (!_isEmptyObject(selfCSSData.secondary)) {
919
+ var cStyle = window.getComputedStyle(self[0], null);
920
+ if (cStyle) {
921
+ // grab current properties
922
+ for (var prop in selfCSSData.secondary) {
923
+ if(selfCSSData.secondary.hasOwnProperty(prop)) {
924
+ prop = prop.replace(rupper, '-$1').toLowerCase();
925
+ restore[prop] = cStyle.getPropertyValue(prop);
926
+
927
+ // is this a matrix property? extract left and top and apply
928
+ if (!leaveTransforms && (/matrix/i).test(restore[prop])) {
929
+ var explodedMatrix = restore[prop].replace(/^matrix\(/i, '').split(/, |\)$/g);
930
+
931
+ // apply the explicit left/top props
932
+ restore['left'] = (parseFloat(explodedMatrix[4]) + parseFloat(self.css('left')) + valUnit) || 'auto';
933
+ restore['top'] = (parseFloat(explodedMatrix[5]) + parseFloat(self.css('top')) + valUnit) || 'auto';
934
+
935
+ // remove the transformations
936
+ for (i = cssPrefixes.length - 1; i >= 0; i--) {
937
+ restore[cssPrefixes[i]+'transform'] = '';
938
+ }
939
+ }
940
+ }
941
+ }
942
+ }
943
+ }
944
+
945
+ // Remove transition timing functions
946
+ // Moving to seperate thread (re: Animation reverts when finished in Android - issue #91)
947
+ self.unbind(transitionEndEvent);
948
+ self.
949
+ css(selfCSSData.original).
950
+ css(restore).
951
+ data(DATA_KEY, null);
952
+ }
953
+ else {
954
+ // dom transition
955
+ originalStopMethod.apply(self, [clearQueue, gotoEnd]);
956
+ }
957
+ });
958
+
959
+ return this;
960
+ };
961
+ }));
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jquery-animate-enhanced-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.11.0
5
+ platform: ruby
6
+ authors:
7
+ - Leonid Beder
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-08-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: railties
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 3.1.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.1.0
27
+ description: |-
28
+ Extend $.animate() to detect CSS transitions for Webkit, Mozilla, IE>=10 and Opera and convert animations automatically.
29
+ http://playground.benbarnett.net/jquery-animate-enhanced/.
30
+ email:
31
+ - leonid.beder@gmail.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - ".gitignore"
37
+ - Gemfile
38
+ - Gemfile.lock
39
+ - LICENSE
40
+ - README.md
41
+ - Rakefile
42
+ - jquery-animate-enhanced-rails.gemspec
43
+ - lib/jquery/animate/enhanced/rails.rb
44
+ - lib/jquery/animate/enhanced/rails/version.rb
45
+ - vendor/assets/javascripts/jquery.animate-enhanced.js
46
+ homepage: ''
47
+ licenses:
48
+ - MIT
49
+ metadata: {}
50
+ post_install_message:
51
+ rdoc_options: []
52
+ require_paths:
53
+ - lib
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ requirements: []
65
+ rubyforge_project:
66
+ rubygems_version: 2.4.1
67
+ signing_key:
68
+ specification_version: 4
69
+ summary: Extend $.animate() to detect CSS transitions for Webkit, Mozilla, IE>=10
70
+ and Opera and convert animations automatically. http://playground.benbarnett.net/jquery-animate-enhanced/
71
+ test_files: []