Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- a/velocity.js 2015-05-24 19:20:26.755835442 -0300
- +++ b/velocity.js 2015-05-28 11:10:38.197740315 -0300
- @@ -1,405 +1,406 @@
- /*! VelocityJS.org (1.2.2). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */
- -/*************************
- - Velocity jQuery Shim
- -*************************/
- -
- -/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */
- -
- -/* This file contains the jQuery functions that Velocity relies on, thereby removing Velocity's dependency on a full copy of jQuery, and allowing it to work in any environment. */
- -/* These shimmed functions are only used if jQuery isn't present. If both this shim and jQuery are loaded, Velocity defaults to jQuery proper. */
- -/* Browser support: Using this shim instead of jQuery proper removes support for IE8. */
- -
- -;(function (window) {
- - /***************
- - Setup
- - ***************/
- -
- - /* If jQuery is already loaded, there's no point in loading this shim. */
- - if (window.jQuery) {
- - return;
- - }
- -
- - /* jQuery base. */
- - var $ = function (selector, context) {
- - return new $.fn.init(selector, context);
- - };
- -
- - /********************
- - Private Methods
- - ********************/
- -
- - /* jQuery */
- - $.isWindow = function (obj) {
- - /* jshint eqeqeq: false */
- - return obj != null && obj == obj.window;
- - };
- -
- - /* jQuery */
- - $.type = function (obj) {
- - if (obj == null) {
- - return obj + "";
- - }
- -
- - return typeof obj === "object" || typeof obj === "function" ?
- - class2type[toString.call(obj)] || "object" :
- - typeof obj;
- - };
- -
- - /* jQuery */
- - $.isArray = Array.isArray || function (obj) {
- - return $.type(obj) === "array";
- - };
- -
- - /* jQuery */
- - function isArraylike (obj) {
- - var length = obj.length,
- - type = $.type(obj);
- -
- - if (type === "function" || $.isWindow(obj)) {
- - return false;
- - }
- -
- - if (obj.nodeType === 1 && length) {
- - return true;
- - }
- -
- - return type === "array" || length === 0 || typeof length === "number" && length > 0 && (length - 1) in obj;
- - }
- -
- - /***************
- - $ Methods
- - ***************/
- -
- - /* jQuery: Support removed for IE<9. */
- - $.isPlainObject = function (obj) {
- - var key;
- -
- - if (!obj || $.type(obj) !== "object" || obj.nodeType || $.isWindow(obj)) {
- - return false;
- - }
- -
- - try {
- - if (obj.constructor &&
- - !hasOwn.call(obj, "constructor") &&
- - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
- - return false;
- - }
- - } catch (e) {
- - return false;
- - }
- -
- - for (key in obj) {}
- -
- - return key === undefined || hasOwn.call(obj, key);
- - };
- -
- - /* jQuery */
- - $.each = function(obj, callback, args) {
- - var value,
- - i = 0,
- - length = obj.length,
- - isArray = isArraylike(obj);
- -
- - if (args) {
- - if (isArray) {
- - for (; i < length; i++) {
- - value = callback.apply(obj[i], args);
- -
- - if (value === false) {
- - break;
- - }
- - }
- - } else {
- - for (i in obj) {
- - value = callback.apply(obj[i], args);
- -
- - if (value === false) {
- - break;
- - }
- - }
- - }
- -
- - } else {
- - if (isArray) {
- - for (; i < length; i++) {
- - value = callback.call(obj[i], i, obj[i]);
- -
- - if (value === false) {
- - break;
- - }
- - }
- - } else {
- - for (i in obj) {
- - value = callback.call(obj[i], i, obj[i]);
- -
- - if (value === false) {
- - break;
- - }
- - }
- - }
- - }
- -
- - return obj;
- - };
- -
- - /* Custom */
- - $.data = function (node, key, value) {
- - /* $.getData() */
- - if (value === undefined) {
- - var id = node[$.expando],
- - store = id && cache[id];
- -
- - if (key === undefined) {
- - return store;
- - } else if (store) {
- - if (key in store) {
- - return store[key];
- - }
- - }
- - /* $.setData() */
- - } else if (key !== undefined) {
- - var id = node[$.expando] || (node[$.expando] = ++$.uuid);
- -
- - cache[id] = cache[id] || {};
- - cache[id][key] = value;
- -
- - return value;
- - }
- - };
- -
- - /* Custom */
- - $.removeData = function (node, keys) {
- - var id = node[$.expando],
- - store = id && cache[id];
- -
- - if (store) {
- - $.each(keys, function(_, key) {
- - delete store[key];
- - });
- - }
- - };
- -
- - /* jQuery */
- - $.extend = function () {
- - var src, copyIsArray, copy, name, options, clone,
- - target = arguments[0] || {},
- - i = 1,
- - length = arguments.length,
- - deep = false;
- -
- - if (typeof target === "boolean") {
- - deep = target;
- -
- - target = arguments[i] || {};
- - i++;
- - }
- -
- - if (typeof target !== "object" && $.type(target) !== "function") {
- - target = {};
- - }
- -
- - if (i === length) {
- - target = this;
- - i--;
- - }
- -
- - for (; i < length; i++) {
- - if ((options = arguments[i]) != null) {
- - for (name in options) {
- - src = target[name];
- - copy = options[name];
- -
- - if (target === copy) {
- - continue;
- - }
- -
- - if (deep && copy && ($.isPlainObject(copy) || (copyIsArray = $.isArray(copy)))) {
- - if (copyIsArray) {
- - copyIsArray = false;
- - clone = src && $.isArray(src) ? src : [];
- -
- - } else {
- - clone = src && $.isPlainObject(src) ? src : {};
- - }
- -
- - target[name] = $.extend(deep, clone, copy);
- -
- - } else if (copy !== undefined) {
- - target[name] = copy;
- - }
- - }
- - }
- - }
- -
- - return target;
- - };
- -
- - /* jQuery 1.4.3 */
- - $.queue = function (elem, type, data) {
- - function $makeArray (arr, results) {
- - var ret = results || [];
- -
- - if (arr != null) {
- - if (isArraylike(Object(arr))) {
- - /* $.merge */
- - (function(first, second) {
- - var len = +second.length,
- - j = 0,
- - i = first.length;
- -
- - while (j < len) {
- - first[i++] = second[j++];
- - }
- -
- - if (len !== len) {
- - while (second[j] !== undefined) {
- - first[i++] = second[j++];
- - }
- - }
- -
- - first.length = i;
- -
- - return first;
- - })(ret, typeof arr === "string" ? [arr] : arr);
- - } else {
- - [].push.call(ret, arr);
- - }
- - }
- -
- - return ret;
- - }
- -
- - if (!elem) {
- - return;
- - }
- -
- - type = (type || "fx") + "queue";
- -
- - var q = $.data(elem, type);
- -
- - if (!data) {
- - return q || [];
- - }
- -
- - if (!q || $.isArray(data)) {
- - q = $.data(elem, type, $makeArray(data));
- - } else {
- - q.push(data);
- - }
- -
- - return q;
- - };
- -
- - /* jQuery 1.4.3 */
- - $.dequeue = function (elems, type) {
- - /* Custom: Embed element iteration. */
- - $.each(elems.nodeType ? [ elems ] : elems, function(i, elem) {
- - type = type || "fx";
- -
- - var queue = $.queue(elem, type),
- - fn = queue.shift();
- -
- - if (fn === "inprogress") {
- - fn = queue.shift();
- - }
- -
- - if (fn) {
- - if (type === "fx") {
- - queue.unshift("inprogress");
- - }
- -
- - fn.call(elem, function() {
- - $.dequeue(elem, type);
- - });
- - }
- - });
- - };
- -
- - /******************
- - $.fn Methods
- - ******************/
- -
- - /* jQuery */
- - $.fn = $.prototype = {
- - init: function (selector) {
- - /* Just return the element wrapped inside an array; don't proceed with the actual jQuery node wrapping process. */
- - if (selector.nodeType) {
- - this[0] = selector;
- -
- - return this;
- - } else {
- - throw new Error("Not a DOM node.");
- - }
- - },
- -
- - offset: function () {
- - /* jQuery altered code: Dropped disconnected DOM node checking. */
- - var box = this[0].getBoundingClientRect ? this[0].getBoundingClientRect() : { top: 0, left: 0 };
- -
- - return {
- - top: box.top + (window.pageYOffset || document.scrollTop || 0) - (document.clientTop || 0),
- - left: box.left + (window.pageXOffset || document.scrollLeft || 0) - (document.clientLeft || 0)
- - };
- - },
- -
- - position: function () {
- - /* jQuery */
- - function offsetParent() {
- - var offsetParent = this.offsetParent || document;
- -
- - while (offsetParent && (!offsetParent.nodeType.toLowerCase === "html" && offsetParent.style.position === "static")) {
- - offsetParent = offsetParent.offsetParent;
- - }
- -
- - return offsetParent || document;
- - }
- -
- - /* Zepto */
- - var elem = this[0],
- - offsetParent = offsetParent.apply(elem),
- - offset = this.offset(),
- - parentOffset = /^(?:body|html)$/i.test(offsetParent.nodeName) ? { top: 0, left: 0 } : $(offsetParent).offset()
- -
- - offset.top -= parseFloat(elem.style.marginTop) || 0;
- - offset.left -= parseFloat(elem.style.marginLeft) || 0;
- -
- - if (offsetParent.style) {
- - parentOffset.top += parseFloat(offsetParent.style.borderTopWidth) || 0
- - parentOffset.left += parseFloat(offsetParent.style.borderLeftWidth) || 0
- - }
- -
- - return {
- - top: offset.top - parentOffset.top,
- - left: offset.left - parentOffset.left
- - };
- - }
- - };
- -
- - /**********************
- - Private Variables
- - **********************/
- -
- - /* For $.data() */
- - var cache = {};
- - $.expando = "velocity" + (new Date().getTime());
- - $.uuid = 0;
- -
- - /* For $.queue() */
- - var class2type = {},
- - hasOwn = class2type.hasOwnProperty,
- - toString = class2type.toString;
- -
- - var types = "Boolean Number String Function Array Date RegExp Object Error".split(" ");
- - for (var i = 0; i < types.length; i++) {
- - class2type["[object " + types[i] + "]"] = types[i].toLowerCase();
- - }
- -
- - /* Makes $(node) possible, without having to call init. */
- - $.fn.init.prototype = $.fn;
- -
- - /* Globalize Velocity onto the window, and assign its Utilities property. */
- - window.Velocity = { Utilities: $ };
- +/*************************
- + Velocity jQuery Shim
- +*************************/
- +
- +/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */
- +
- +/* This file contains the jQuery functions that Velocity relies on, thereby removing Velocity's dependency on a full copy of jQuery, and allowing it to work in any environment. */
- +/* These shimmed functions are only used if jQuery isn't present. If both this shim and jQuery are loaded, Velocity defaults to jQuery proper. */
- +/* Browser support: Using this shim instead of jQuery proper removes support for IE8. */
- +
- +;(function (window) {
- + "use strict";
- + /***************
- + Setup
- + ***************/
- +
- + /* If jQuery is already loaded, there's no point in loading this shim. */
- + if (window.jQuery) {
- + return;
- + }
- +
- + /* jQuery base. */
- + var $ = function (selector, context) {
- + return new $.fn.init(selector, context);
- + };
- +
- + /********************
- + Private Methods
- + ********************/
- +
- + /* jQuery */
- + $.isWindow = function (obj) {
- + /* jshint eqeqeq: false */
- + return obj != null && obj == obj.window;
- + };
- +
- + /* jQuery */
- + $.type = function (obj) {
- + if (obj == null) {
- + return obj + "";
- + }
- +
- + return typeof obj === "object" || typeof obj === "function" ?
- + class2type[toString.call(obj)] || "object" :
- + typeof obj;
- + };
- +
- + /* jQuery */
- + $.isArray = Array.isArray || function (obj) {
- + return $.type(obj) === "array";
- + };
- +
- + /* jQuery */
- + function isArraylike (obj) {
- + var length = obj.length,
- + type = $.type(obj);
- +
- + if (type === "function" || $.isWindow(obj)) {
- + return false;
- + }
- +
- + if (obj.nodeType === 1 && length) {
- + return true;
- + }
- +
- + return type === "array" || length === 0 || typeof length === "number" && length > 0 && (length - 1) in obj;
- + }
- +
- + /***************
- + $ Methods
- + ***************/
- +
- + /* jQuery: Support removed for IE<9. */
- + $.isPlainObject = function (obj) {
- + var key;
- +
- + if (!obj || $.type(obj) !== "object" || obj.nodeType || $.isWindow(obj)) {
- + return false;
- + }
- +
- + try {
- + if (obj.constructor &&
- + !hasOwn.call(obj, "constructor") &&
- + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
- + return false;
- + }
- + } catch (e) {
- + return false;
- + }
- +
- + for (key in obj) {}
- +
- + return key === undefined || hasOwn.call(obj, key);
- + };
- +
- + /* jQuery */
- + $.each = function(obj, callback, args) {
- + var value,
- + i = 0,
- + length = obj.length,
- + isArray = isArraylike(obj);
- +
- + if (args) {
- + if (isArray) {
- + for (; i < length; i++) {
- + value = callback.apply(obj[i], args);
- +
- + if (value === false) {
- + break;
- + }
- + }
- + } else {
- + for (i in obj) {
- + value = callback.apply(obj[i], args);
- +
- + if (value === false) {
- + break;
- + }
- + }
- + }
- +
- + } else {
- + if (isArray) {
- + for (; i < length; i++) {
- + value = callback.call(obj[i], i, obj[i]);
- +
- + if (value === false) {
- + break;
- + }
- + }
- + } else {
- + for (i in obj) {
- + value = callback.call(obj[i], i, obj[i]);
- +
- + if (value === false) {
- + break;
- + }
- + }
- + }
- + }
- +
- + return obj;
- + };
- +
- + /* Custom */
- + $.data = function (node, key, value) {
- + /* $.getData() */
- + if (value === undefined) {
- + var id = node[$.expando],
- + store = id && cache[id];
- +
- + if (key === undefined) {
- + return store;
- + } else if (store) {
- + if (key in store) {
- + return store[key];
- + }
- + }
- + /* $.setData() */
- + } else if (key !== undefined) {
- + var id = node[$.expando] || (node[$.expando] = ++$.uuid);
- +
- + cache[id] = cache[id] || {};
- + cache[id][key] = value;
- +
- + return value;
- + }
- + };
- +
- + /* Custom */
- + $.removeData = function (node, keys) {
- + var id = node[$.expando],
- + store = id && cache[id];
- +
- + if (store) {
- + $.each(keys, function(_, key) {
- + delete store[key];
- + });
- + }
- + };
- +
- + /* jQuery */
- + $.extend = function () {
- + var src, copyIsArray, copy, name, options, clone,
- + target = arguments[0] || {},
- + i = 1,
- + length = arguments.length,
- + deep = false;
- +
- + if (typeof target === "boolean") {
- + deep = target;
- +
- + target = arguments[i] || {};
- + i++;
- + }
- +
- + if (typeof target !== "object" && $.type(target) !== "function") {
- + target = {};
- + }
- +
- + if (i === length) {
- + target = this;
- + i--;
- + }
- +
- + for (; i < length; i++) {
- + if ((options = arguments[i]) != null) {
- + for (name in options) {
- + src = target[name];
- + copy = options[name];
- +
- + if (target === copy) {
- + continue;
- + }
- +
- + if (deep && copy && ($.isPlainObject(copy) || (copyIsArray = $.isArray(copy)))) {
- + if (copyIsArray) {
- + copyIsArray = false;
- + clone = src && $.isArray(src) ? src : [];
- +
- + } else {
- + clone = src && $.isPlainObject(src) ? src : {};
- + }
- +
- + target[name] = $.extend(deep, clone, copy);
- +
- + } else if (copy !== undefined) {
- + target[name] = copy;
- + }
- + }
- + }
- + }
- +
- + return target;
- + };
- +
- + /* jQuery 1.4.3 */
- + $.queue = function (elem, type, data) {
- + function $makeArray (arr, results) {
- + var ret = results || [];
- +
- + if (arr != null) {
- + if (isArraylike(Object(arr))) {
- + /* $.merge */
- + (function(first, second) {
- + var len = +second.length,
- + j = 0,
- + i = first.length;
- +
- + while (j < len) {
- + first[i++] = second[j++];
- + }
- +
- + if (len !== len) {
- + while (second[j] !== undefined) {
- + first[i++] = second[j++];
- + }
- + }
- +
- + first.length = i;
- +
- + return first;
- + })(ret, typeof arr === "string" ? [arr] : arr);
- + } else {
- + [].push.call(ret, arr);
- + }
- + }
- +
- + return ret;
- + }
- +
- + if (!elem) {
- + return;
- + }
- +
- + type = (type || "fx") + "queue";
- +
- + var q = $.data(elem, type);
- +
- + if (!data) {
- + return q || [];
- + }
- +
- + if (!q || $.isArray(data)) {
- + q = $.data(elem, type, $makeArray(data));
- + } else {
- + q.push(data);
- + }
- +
- + return q;
- + };
- +
- + /* jQuery 1.4.3 */
- + $.dequeue = function (elems, type) {
- + /* Custom: Embed element iteration. */
- + $.each(elems.nodeType ? [ elems ] : elems, function(i, elem) {
- + type = type || "fx";
- +
- + var queue = $.queue(elem, type),
- + fn = queue.shift();
- +
- + if (fn === "inprogress") {
- + fn = queue.shift();
- + }
- +
- + if (fn) {
- + if (type === "fx") {
- + queue.unshift("inprogress");
- + }
- +
- + fn.call(elem, function() {
- + $.dequeue(elem, type);
- + });
- + }
- + });
- + };
- +
- + /******************
- + $.fn Methods
- + ******************/
- +
- + /* jQuery */
- + $.fn = $.prototype = {
- + init: function (selector) {
- + /* Just return the element wrapped inside an array; don't proceed with the actual jQuery node wrapping process. */
- + if (selector.nodeType) {
- + this[0] = selector;
- +
- + return this;
- + } else {
- + throw new Error("Not a DOM node.");
- + }
- + },
- +
- + offset: function () {
- + /* jQuery altered code: Dropped disconnected DOM node checking. */
- + var box = this[0].getBoundingClientRect ? this[0].getBoundingClientRect() : { top: 0, left: 0 };
- +
- + return {
- + top: box.top + (window.pageYOffset || document.scrollTop || 0) - (document.clientTop || 0),
- + left: box.left + (window.pageXOffset || document.scrollLeft || 0) - (document.clientLeft || 0)
- + };
- + },
- +
- + position: function () {
- + /* jQuery */
- + function offsetParent() {
- + var offsetParent = this.offsetParent || document;
- +
- + while (offsetParent && (!offsetParent.nodeType.toLowerCase === "html" && offsetParent.style.position === "static")) {
- + offsetParent = offsetParent.offsetParent;
- + }
- +
- + return offsetParent || document;
- + }
- +
- + /* Zepto */
- + var elem = this[0],
- + offsetParent = offsetParent.apply(elem),
- + offset = this.offset(),
- + parentOffset = /^(?:body|html)$/i.test(offsetParent.nodeName) ? { top: 0, left: 0 } : $(offsetParent).offset()
- +
- + offset.top -= parseFloat(elem.style.marginTop) || 0;
- + offset.left -= parseFloat(elem.style.marginLeft) || 0;
- +
- + if (offsetParent.style) {
- + parentOffset.top += parseFloat(offsetParent.style.borderTopWidth) || 0
- + parentOffset.left += parseFloat(offsetParent.style.borderLeftWidth) || 0
- + }
- +
- + return {
- + top: offset.top - parentOffset.top,
- + left: offset.left - parentOffset.left
- + };
- + }
- + };
- +
- + /**********************
- + Private Variables
- + **********************/
- +
- + /* For $.data() */
- + var cache = {};
- + $.expando = "velocity" + (new Date().getTime());
- + $.uuid = 0;
- +
- + /* For $.queue() */
- + var class2type = {},
- + hasOwn = class2type.hasOwnProperty,
- + toString = class2type.toString;
- +
- + var types = "Boolean Number String Function Array Date RegExp Object Error".split(" ");
- + for (var i = 0; i < types.length; i++) {
- + class2type["[object " + types[i] + "]"] = types[i].toLowerCase();
- + }
- +
- + /* Makes $(node) possible, without having to call init. */
- + $.fn.init.prototype = $.fn;
- +
- + /* Globalize Velocity onto the window, and assign its Utilities property. */
- + window.Velocity = { Utilities: $ };
- })(window);
- /******************
- @@ -407,6 +408,7 @@
- ******************/
- ;(function (factory) {
- + "use strict";
- /* CommonJS module. */
- if (typeof module === "object" && typeof module.exports === "object") {
- module.exports = factory();
- @@ -418,6 +420,7 @@
- factory();
- }
- }(function() {
- +"use strict";
- return function (global, window, document, undefined) {
- /***************
- @@ -1636,11 +1639,11 @@
- CSS.setPropertyValue(element, "display", CSS.Values.getDisplayType(element));
- }
- - function revertDisplay () {
- + var revertDisplay = function () {
- if (toggleDisplay) {
- CSS.setPropertyValue(element, "display", "none");
- }
- - }
- + };
- if (!forceStyleLookup) {
- if (property === "height" && CSS.getPropertyValue(element, "boxSizing").toString().toLowerCase() !== "border-box") {
- @@ -1882,9 +1885,9 @@
- if ((IE || (Velocity.State.isAndroid && !Velocity.State.isChrome)) && Data(element).isSVG) {
- /* Since transform values are stored in their parentheses-wrapped form, we use a helper function to strip out their numeric values.
- Further, SVG transform properties only take unitless (representing pixels) values, so it's okay that parseFloat() strips the unit suffixed to the float value. */
- - function getTransformFloat (transformProperty) {
- + var getTransformFloat = function (transformProperty) {
- return parseFloat(CSS.getPropertyValue(element, transformProperty));
- - }
- + };
- /* Create an object to organize all the transforms that we'll apply to the SVG element. To keep the logic simple,
- we process *all* transform properties -- even those that may not be explicitly applied (since they default to their zero-values anyway). */
- @@ -2688,7 +2691,7 @@
- or 2) an array in the form of [ endValue, [, easing] [, startValue] ].
- The optional third parameter is a forcefed startValue to be used instead of querying the DOM for
- the element's current value. Read Velocity's docmentation to learn more about forcefeeding: VelocityJS.org/#forcefeeding */
- - function parsePropertyValue (valueData, skipResolvingEasing) {
- + var parsePropertyValue = function (valueData, skipResolvingEasing) {
- var endValue = undefined,
- easing = undefined,
- startValue = undefined;
- @@ -2735,7 +2738,7 @@
- /* Allow startValue to be left as undefined to indicate to the ensuing code that its value was not forcefed. */
- return [ endValue || 0, easing, startValue ];
- - }
- + };
- /* Cycle through each property in the map, looking for shorthand color properties (e.g. "color" as opposed to "colorRed"). Inject the corresponding
- colorRed, colorGreen, and colorBlue RGB component tweens into the propertiesMap (which Velocity understands) and remove the shorthand property. */
- @@ -2859,7 +2862,7 @@
- operator = false;
- /* Separates a property value into its numeric value and its unit type. */
- - function separateValue (property, value) {
- + var separateValue = function (property, value) {
- var unitType,
- numericValue;
- @@ -2881,7 +2884,7 @@
- }
- return [ numericValue, unitType ];
- - }
- + };
- /* Separate startValue. */
- separatedValue = separateValue(property, startValue);
- @@ -2941,7 +2944,7 @@
- of batching the SETs and GETs together upfront outweights the potential overhead
- of layout thrashing caused by re-querying for uncalculated ratios for subsequently-processed properties. */
- /* Todo: Shift this logic into the calls' first tick instance so that it's synced with RAF. */
- - function calculateUnitRatios () {
- + var calculateUnitRatios = function () {
- /************************
- Same Ratio Checks
- @@ -3036,7 +3039,7 @@
- if (Velocity.debug >= 1) console.log("Unit ratios: " + JSON.stringify(unitRatios), element);
- return unitRatios;
- - }
- + };
- /********************
- Unit Conversion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement