1(function ($) { 2 /*jslint undef: false, browser: true, devel: false, eqeqeq: false, bitwise: false, white: false, plusplus: false, regexp: false, nomen: false */ 3 /*global jQuery,setTimeout,location,setInterval,YT,clearInterval,clearTimeout,pixelentity */ 4 5 $.pixelentity = $.pixelentity || {version: '1.0.0'}; 6 7 $.pixelentity.peSimpleThumb = { 8 conf: { 9 api: false 10 } 11 }; 12 13 function PeSimpleThumb(target, conf) { 14 15 var img; 16 17 // init function 18 function start() { 19 img = $("<img/>").attr("src",target.attr("data-src")).fadeTo(0,0); 20 target.append(img); 21 $.pixelentity.preloader.load(img,loaded); 22 } 23 24 function loaded() { 25 var iw = img[0].naturalWidth || img[0].width || img.width(); 26 var ih = img[0].naturalHeight || img[0].height || img.height(); 27 var scaler = $.pixelentity.Geom.getScaler("fillmax","center","center",target.width(),target.height(),iw,ih); 28 img.transform( 29 scaler.ratio, 30 parseInt(scaler.offset.w,10), 31 parseInt(scaler.offset.h,10), 32 iw, 33 ih, 34 true, 35 true 36 ); 37 38 img.fadeTo(500,1); 39 target.addClass("loaded"); 40 41 target = undefined; 42 img = undefined; 43 } 44 45 46 $.extend(this, { 47 // plublic API 48 destroy: function() { 49 target.data("peSimpleThumb", null); 50 target = undefined; 51 } 52 }); 53 54 // initialize 55 start(); 56 } 57 58 // jQuery plugin implementation 59 $.fn.peSimpleThumb = function(conf) { 60 61 // return existing instance 62 var api = this.data("peSimpleThumb"); 63 64 if (api) { 65 return api; 66 } 67 68 conf = $.extend(true, {}, $.pixelentity.peSimpleThumb.conf, conf); 69 70 // install the plugin for each entry in jQuery object 71 this.each(function() { 72 var el = $(this); 73 api = new PeSimpleThumb(el, conf); 74 el.data("peSimpleThumb", api); 75 }); 76 77 return conf.api ? api: this; 78 }; 79 80}(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.