JAVASCRIPT   22

anim scroll coverage

Guest on 26th May 2022 02:29:29 PM

  1. /*
  2. YUI 3.7.3 (build 5687)
  3. Copyright 2012 Yahoo! Inc. All rights reserved.
  4. Licensed under the BSD License.
  5. http://yuilibrary.com/license/
  6. */
  7. if (typeof _yuitest_coverage == "undefined"){
  8.     _yuitest_coverage = {};
  9.     _yuitest_coverline = function(src, line){
  10.         var coverage = _yuitest_coverage[src];
  11.         if (!coverage.lines[line]){
  12.             coverage.calledLines++;
  13.         }
  14.         coverage.lines[line]++;
  15.     };
  16.     _yuitest_coverfunc = function(src, name, line){
  17.         var coverage = _yuitest_coverage[src],
  18.             funcId = name + ":" + line;
  19.         if (!coverage.functions[funcId]){
  20.             coverage.calledFunctions++;
  21.         }
  22.         coverage.functions[funcId]++;
  23.     };
  24. }
  25. _yuitest_coverage["build/anim-scroll/anim-scroll.js"] = {
  26.     lines: {},
  27.     functions: {},
  28.     coveredLines: 0,
  29.     calledLines: 0,
  30.     coveredFunctions: 0,
  31.     calledFunctions: 0,
  32.     path: "build/anim-scroll/anim-scroll.js",
  33.     code: []
  34. };
  35. _yuitest_coverage["build/anim-scroll/anim-scroll.js"].code=["YUI.add('anim-scroll', function (Y, NAME) {","","/**"," * Adds support for the <code>scroll</code> property in <code>to</code>"," * and <code>from</code> attributes."," * @module anim"," * @submodule anim-scroll"," */","","var NUM = Number;","","//TODO: deprecate for scrollTop/Left properties?","Y.Anim.behaviors.scroll = {","    set: function(anim, att, from, to, elapsed, duration, fn) {","        var","            node = anim._node, ","            val = ([","            fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),","            fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)","        ]);","","        if (val[0]) {","            node.set('scrollLeft', val[0]);","        }","","        if (val[1]) {","            node.set('scrollTop', val[1]);","        }","    },","    get: function(anim) {","        var node = anim._node;","        return [node.get('scrollLeft'), node.get('scrollTop')];","    }","};","","","","}, '3.7.3', {\"requires\": [\"anim-base\"]});"];
  36. _yuitest_coverage["build/anim-scroll/anim-scroll.js"].lines = {"1":0,"10":0,"13":0,"15":0,"22":0,"23":0,"26":0,"27":0,"31":0,"32":0};
  37. _yuitest_coverage["build/anim-scroll/anim-scroll.js"].functions = {"set:14":0,"get:30":0,"(anonymous 1):1":0};
  38. _yuitest_coverage["build/anim-scroll/anim-scroll.js"].coveredLines = 10;
  39. _yuitest_coverage["build/anim-scroll/anim-scroll.js"].coveredFunctions = 3;
  40. _yuitest_coverline("build/anim-scroll/anim-scroll.js", 1);
  41. YUI.add('anim-scroll', function (Y, NAME) {
  42.  
  43. /**
  44.  * Adds support for the <code>scroll</code> property in <code>to</code>
  45.  * and <code>from</code> attributes.
  46.  * @module anim
  47.  * @submodule anim-scroll
  48.  */
  49.  
  50. _yuitest_coverfunc("build/anim-scroll/anim-scroll.js", "(anonymous 1)", 1);
  51. _yuitest_coverline("build/anim-scroll/anim-scroll.js", 10);
  52. var NUM = Number;
  53.  
  54. //TODO: deprecate for scrollTop/Left properties?
  55. _yuitest_coverline("build/anim-scroll/anim-scroll.js", 13);
  56. Y.Anim.behaviors.scroll = {
  57.     set: function(anim, att, from, to, elapsed, duration, fn) {
  58.         _yuitest_coverfunc("build/anim-scroll/anim-scroll.js", "set", 14);
  59. _yuitest_coverline("build/anim-scroll/anim-scroll.js", 15);
  60. var
  61.             node = anim._node,
  62.             val = ([
  63.             fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),
  64.             fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)
  65.         ]);
  66.  
  67.         _yuitest_coverline("build/anim-scroll/anim-scroll.js", 22);
  68. if (val[0]) {
  69.             _yuitest_coverline("build/anim-scroll/anim-scroll.js", 23);
  70. node.set('scrollLeft', val[0]);
  71.         }
  72.  
  73.         _yuitest_coverline("build/anim-scroll/anim-scroll.js", 26);
  74. if (val[1]) {
  75.             _yuitest_coverline("build/anim-scroll/anim-scroll.js", 27);
  76. node.set('scrollTop', val[1]);
  77.         }
  78.     },
  79.     get: function(anim) {
  80.         _yuitest_coverfunc("build/anim-scroll/anim-scroll.js", "get", 30);
  81. _yuitest_coverline("build/anim-scroll/anim-scroll.js", 31);
  82. var node = anim._node;
  83.         _yuitest_coverline("build/anim-scroll/anim-scroll.js", 32);
  84. return [node.get('scrollLeft'), node.get('scrollTop')];
  85.     }
  86. };
  87.  
  88.  
  89.  
  90. }, '3.7.3', {"requires": ["anim-base"]});

Raw Paste


Login or Register to edit or fork this paste. It's free.