1(function ($) { 2 var clipPattern = /rect\(([0-9]{1,})(px|em)[, ]+([0-9]{1,})(px|em)[, ]+([0-9]{1,})(px|em)[, ]+([0-9]{1,})(px|em)\)/; 3 4 /** 5 * Creates an array of clip settings where the values correspond to: 6 * rect([0] [1], [2] [3], [4] [5], [6] [7]) 7 */ 8 function getClip (style) { 9 var parsed = clipPattern.exec(style), 10 result = $.map(parsed.slice(1), function (text, index) { 11 if ((index % 2) == 0) 12 { 13 return parseInt(text); 14 } 15 else 16 { 17 return text; 18 } 19 }); 20 return result; 21 } 22 23 function makeClip(array) { 24 var result = "rect(" + [ 25 array[0] + array[1], 26 array[2] + array[3], 27 array[4] + array[5], 28 array[6] + array[7] 29 ].join(",") + ")"; 30 return result; 31 } 32 33 $.fx.step.clip = function (fx) { 34 35 if (!fx.clipTarget) { 36 fx.clipStart = getClip($.curCSS(fx.elem, "clip")); 37 fx.clipTarget = getClip(fx.end); 38 } 39 40 var update = makeClip([ 41 parseInt((fx.pos * (fx.clipTarget[0] - fx.clipStart[0])) + fx.clipStart[0]), fx.clipTarget[1], 42 parseInt((fx.pos * (fx.clipTarget[2] - fx.clipStart[2])) + fx.clipStart[2]), fx.clipTarget[3], 43 parseInt((fx.pos * (fx.clipTarget[4] - fx.clipStart[4])) + fx.clipStart[4]), fx.clipTarget[5], 44 parseInt((fx.pos * (fx.clipTarget[6] - fx.clipStart[6])) + fx.clipStart[6]), fx.clipTarget[7] 45 ]); 46 47 $(fx.elem).css("clip", update); 48 } 49})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.