scratch – Diff between revs 77 and 125

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 77 Rev 125
Line 1... Line 1...
1 /*! VelocityJS.org (1.4.3). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */ 1 /*! VelocityJS.org (1.5.0). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */
Line 2... Line 2...
2   2  
3 /************************* 3 /*************************
4 Velocity jQuery Shim 4 Velocity jQuery Shim
Line 496... Line 496...
496 })(); 496 })();
Line 497... Line 497...
497   497  
498 var performance = (function() { 498 var performance = (function() {
Line 499... Line 499...
499 var perf = window.performance || {}; 499 var perf = window.performance || {};
500   500  
Line 501... Line 501...
501 if (!Object.prototype.hasOwnProperty.call(perf, "now")) { 501 if (typeof perf.now !== "function") {
502 var nowOffset = perf.timing && perf.timing.domComplete ? perf.timing.domComplete : (new Date()).getTime(); 502 var nowOffset = perf.timing && perf.timing.navigationStart ? perf.timing.navigationStart : (new Date()).getTime();
503   503  
504 perf.now = function() { 504 perf.now = function() {
Line 523... Line 523...
523 } 523 }
Line 524... Line 524...
524   524  
525 return result; 525 return result;
Line -... Line 526...
-   526 }
-   527  
-   528 /**
-   529 * Shim for "fixing" IE's lack of support (IE < 9) for applying slice
-   530 * on host objects like NamedNodeMap, NodeList, and HTMLCollection
-   531 * (technically, since host objects have been implementation-dependent,
-   532 * at least before ES2015, IE hasn't needed to work this way).
-   533 * Also works on strings, fixes IE < 9 to allow an explicit undefined
-   534 * for the 2nd argument (as in Firefox), and prevents errors when
526 } 535 * called on other DOM objects.
527   536 */
Line 528... Line 537...
528 var _slice = (function() { 537 var _slice = (function() {
529 var slice = Array.prototype.slice; 538 var slice = Array.prototype.slice;
530   539  
-   540 try {
531 try { 541 // Can't be used with DOM elements in IE < 9
-   542 slice.call(document.documentElement);
532 // Can't be used with DOM elements in IE < 9 543 return slice;
533 slice.call(document.documentElement); 544 } catch (e) { // Fails in IE < 9
534 } catch (e) { // Fails in IE < 9 545  
535 // This will work for genuine arrays, array-like objects, 546 // This will work for genuine arrays, array-like objects,
536 // NamedNodeMap (attributes, entities, notations), 547 // NamedNodeMap (attributes, entities, notations),
537 // NodeList (e.g., getElementsByTagName), HTMLCollection (e.g., childNodes), 548 // NodeList (e.g., getElementsByTagName), HTMLCollection (e.g., childNodes),
538 // and will not fail on other DOM objects (as do DOM elements in IE < 9) -  
Line -... Line 549...
-   549 // and will not fail on other DOM objects (as do DOM elements in IE < 9)
-   550 return function(begin, end) {
-   551 var len = this.length;
-   552  
-   553 if (typeof begin !== "number") {
-   554 begin = 0;
-   555 }
-   556 // IE < 9 gets unhappy with an undefined end argument
-   557 if (typeof end !== "number") {
-   558 end = len;
-   559 }
-   560 // For native Array objects, we use the native slice function
-   561 if (this.slice) {
-   562 return slice.call(this, begin, end);
-   563 }
-   564 // For array like object we handle it ourselves.
-   565 var i,
-   566 cloned = [],
-   567 // Handle negative value for "begin"
-   568 start = (begin >= 0) ? begin : Math.max(0, len + begin),
-   569 // Handle negative value for "end"
539 slice = function() { 570 upTo = end < 0 ? len + end : Math.min(end, len),
-   571 // Actual expected size of the slice
-   572 size = upTo - start;
-   573  
-   574 if (size > 0) {
-   575 cloned = new Array(size);
-   576 if (this.charAt) {
-   577 for (i = 0; i < size; i++) {
540 var i = this.length, 578 cloned[i] = this.charAt(start + i);
-   579 }
-   580 } else {
541 clone = []; 581 for (i = 0; i < size; i++) {
542   582 cloned[i] = this[start + i];
543 while (--i > 0) { 583 }
544 clone[i] = this[i]; 584 }
-   585 }
-   586 return cloned;
-   587 };
-   588 }
-   589 })();
-   590  
545 } 591 /* .indexOf doesn't exist in IE<9 */
-   592 var _inArray = (function() {
-   593 if (Array.prototype.includes) {
546 return clone; 594 return function(arr, val) {
-   595 return arr.includes(val);
-   596 };
-   597 }
-   598 if (Array.prototype.indexOf) {
-   599 return function(arr, val) {
-   600 return arr.indexOf(val) >= 0;
-   601 };
-   602 }
-   603 return function(arr, val) {
-   604 for (var i = 0; i < arr.length; i++) {
-   605 if (arr[i] === val) {
-   606 return true;
-   607 }
Line 547... Line 608...
547 }; 608 }
548 } 609 return false;
549 return slice; 610 };
550 })(); // TODO: IE8, Cache of Array.prototype.slice that works on IE8 611 });
Line 579... Line 640...
579 }, 640 },
580 /* Determine if variable is an array-like wrapped jQuery, Zepto or similar element, or even a NodeList etc. */ 641 /* Determine if variable is an array-like wrapped jQuery, Zepto or similar element, or even a NodeList etc. */
581 /* NOTE: HTMLFormElements also have a length. */ 642 /* NOTE: HTMLFormElements also have a length. */
582 isWrapped: function(variable) { 643 isWrapped: function(variable) {
583 return variable 644 return variable
-   645 && variable !== window
584 && Type.isNumber(variable.length) 646 && Type.isNumber(variable.length)
585 && !Type.isString(variable) 647 && !Type.isString(variable)
586 && !Type.isFunction(variable) 648 && !Type.isFunction(variable)
587 && !Type.isNode(variable) 649 && !Type.isNode(variable)
588 && (variable.length === 0 || Type.isNode(variable[0])); 650 && (variable.length === 0 || Type.isNode(variable[0]));
Line 713... Line 775...
713 }, 775 },
714 /* A parallel to jQuery's $.css(), used for getting/setting Velocity's hooked CSS properties. */ 776 /* A parallel to jQuery's $.css(), used for getting/setting Velocity's hooked CSS properties. */
715 hook: null, /* Defined below. */ 777 hook: null, /* Defined below. */
716 /* Velocity-wide animation time remapping for testing purposes. */ 778 /* Velocity-wide animation time remapping for testing purposes. */
717 mock: false, 779 mock: false,
718 version: {major: 1, minor: 4, patch: 3}, 780 version: {major: 1, minor: 5, patch: 0},
719 /* Set to 1 or 2 (most verbose) to output debug info to console. */ 781 /* Set to 1 or 2 (most verbose) to output debug info to console. */
720 debug: false, 782 debug: false,
721 /* Use rAF high resolution timestamp when available */ 783 /* Use rAF high resolution timestamp when available */
722 timestamp: true, 784 timestamp: true,
723 /* Pause all animations */ 785 /* Pause all animations */
Line 1444... Line 1506...
1444 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { } 1506 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { }
1445 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { }, 1507 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { },
1446 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { getUnit: function(str, start) { 1508 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { getUnit: function(str, start) {
1447 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { var unit = (str.substr(start || 0, 5).match(/^[a-z%]+/) || [])[0] || ""; 1509 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { var unit = (str.substr(start || 0, 5).match(/^[a-z%]+/) || [])[0] || "";
Line 1448... Line 1510...
1448 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { 1510 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {
1449 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { if (unit && CSS.Lists.units.indexOf(unit) >= 0) { 1511 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { if (unit && _inArray(CSS.Lists.units, unit)) {
1450 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { return unit; 1512 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { return unit;
1451 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { } 1513 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { }
1452 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { return ""; 1514 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { return "";
1453 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { }, 1515 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) { },
Line 2864... Line 2926...
2864 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { } else { 2926 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { } else {
2865 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { var abortError = "Velocity: First argument (" + propertiesMap + ") was not a property map, a known action, or a registered redirect. Aborting."; 2927 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { var abortError = "Velocity: First argument (" + propertiesMap + ") was not a property map, a known action, or a registered redirect. Aborting.";
Line 2866... Line 2928...
2866 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { 2928 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) {
2867 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { if (promiseData.promise) { 2929 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { if (promiseData.promise) {
2868 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { promiseData.rejecter(new Error(abortError)); 2930 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { promiseData.rejecter(new Error(abortError));
2869 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { } else { 2931 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { } else if (window.console) {
2870 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { console.log(abortError); 2932 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { console.log(abortError);
Line 2871... Line 2933...
2871 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { } 2933 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { }
2872 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { 2934 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) {
Line 3853... Line 3915...
3853 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { var propertyName = CSS.Names.camelCase(property), 3915 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { var propertyName = CSS.Names.camelCase(property),
3854 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { valueData = parsePropertyValue(propertiesMap[property]); 3916 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { valueData = parsePropertyValue(propertiesMap[property]);
Line 3855... Line 3917...
3855 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { 3917 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) {
3856 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { /* Find shorthand color properties that have been passed a hex string. */ 3918 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { /* Find shorthand color properties that have been passed a hex string. */
3857 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { /* Would be quicker to use CSS.Lists.colors.includes() if possible */ 3919 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { /* Would be quicker to use CSS.Lists.colors.includes() if possible */
3858 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { if (CSS.Lists.colors.indexOf(propertyName) >= 0) { 3920 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { if (_inArray(CSS.Lists.colors, propertyName)) {
3859 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { /* Parse the value data for each shorthand. */ 3921 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { /* Parse the value data for each shorthand. */
3860 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { var endValue = valueData[0], 3922 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { var endValue = valueData[0],
3861 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { easing = valueData[1], 3923 < 4; ++i) {< NEWTON_ITERATIONS; ++i) {< SUBDIVISION_MAX_ITERATIONS);<= aX; ++currentSample) {<= 8) {< CSS.Lists.transformsBase.length; i++) {<= 8) {< vendorsLength; i++) { easing = valueData[1],