Sha256: 2754495937381f1eb2e53e04fc6a399c5f0a84bbd01a42ee63acff6ae6892752

Contents?: true

Size: 1.95 KB

Versions: 39

Compression:

Stored size: 1.95 KB

Contents

/**
 * Support Plugin
 *
 * @version 2.0.0-beta.3
 * @author Vivid Planet Software GmbH
 * @author Artus Kolanowski
 * @license The MIT License (MIT)
 */
;(function($, window, document, undefined) {

	var style = $('<support>').get(0).style,
		prefixes = 'Webkit Moz O ms'.split(' '),
		events = {
			transition: {
				end: {
					WebkitTransition: 'webkitTransitionEnd',
					MozTransition: 'transitionend',
					OTransition: 'oTransitionEnd',
					transition: 'transitionend'
				}
			},
			animation: {
				end: {
					WebkitAnimation: 'webkitAnimationEnd',
					MozAnimation: 'animationend',
					OAnimation: 'oAnimationEnd',
					animation: 'animationend'
				}
			}
		},
		tests = {
			csstransforms: function() {
				return !!test('transform');
			},
			csstransforms3d: function() {
				return !!test('perspective');
			},
			csstransitions: function() {
				return !!test('transition');
			},
			cssanimations: function() {
				return !!test('animation');
			}
		};

	function test(property, prefixed) {
		var result = false,
			upper = property.charAt(0).toUpperCase() + property.slice(1);

		$.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property) {
			if (style[property] !== undefined) {
				result = prefixed ? property : true;
				return false;
			}
		});

		return result;
	}

	function prefixed(property) {
		return test(property, true);
	}

	if (tests.csstransitions()) {
		/* jshint -W053 */
		$.support.transition = new String(prefixed('transition'))
		$.support.transition.end = events.transition.end[ $.support.transition ];
	}

	if (tests.cssanimations()) {
		/* jshint -W053 */
		$.support.animation = new String(prefixed('animation'))
		$.support.animation.end = events.animation.end[ $.support.animation ];
	}

	if (tests.csstransforms()) {
		/* jshint -W053 */
		$.support.transform = new String(prefixed('transform'));
		$.support.transform3d = tests.csstransforms3d();
	}

})(window.Zepto || window.jQuery, window, document);

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
wbase-0.3.20 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.19 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.18 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.17 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.16 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.15 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.14 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.13 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.12 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.11 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.10 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.9 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.8 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.7 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.6 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.5 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.4 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.3 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.2 lib/vendor/admin/owl.carousel/src/js/owl.support.js
wbase-0.3.1 lib/vendor/admin/owl.carousel/src/js/owl.support.js