1/** 2 * Ephoto Dam Addon for Wordpress 3 * 4 * @base EPHOTO DAM 5 * @author EINDEN - All rights reserved 6 */ 7 8(function ($) { 9 var EphotoDam = { 10 zoomIn: function(img) { 11 var overlay = $('#ephoto-dam-overlay').length ? $('#ephoto-dam-overlay'): $('<div id="ephoto-dam-overlay"></div>').appendTo('body'); 12 var wrap = $('#ephoto-dam-wrap').length ? $('#ephoto-dam-wrap'): $('<div id="ephoto-dam-wrap"><div id="ephoto-dam-close"></div><img></div>').appendTo('body'); 13 14 var buffer = new Image(); 15 16 buffer.onload = function() { 17 var width, height; 18 var ratiop = document.documentElement.clientHeight / document.documentElement.clientWidth; 19 var ratiof = buffer.height / buffer.width; 20 21 if(ratiop > ratiof) { 22 width = document.documentElement.clientWidth - 100; 23 height = Math.round(width * ratiof); 24 } 25 26 else { 27 height = document.documentElement.clientHeight - 100; 28 width = Math.round(height * (1 / ratiof)); 29 }; 30 31 var close = function(event) { 32 event.stopPropagation(); 33 event.stopImmediatePropagation(); 34 35 wrap.fadeOut(300); 36 overlay.delay(250).fadeOut(300); 37 }; 38 39 wrap.children().last().attr('src', img.src); 40 41 wrap.children().first().on('click', close); 42 43 wrap.css({ 44 'width': width, 45 'height': height, 46 'margin-left': -(Math.floor(width / 2) + 8), 47 'margin-top': -(Math.floor(height / 2) + 8) 48 49 }).delay(250).fadeIn(300); 50 51 overlay.fadeIn(300).on('click', close); 52 }; 53 54 buffer.src = img.src; 55 }, 56 }; 57 58 $('img.ephoto-dam-zoom').on('click', function(event) { 59 event.stopPropagation(); 60 event.stopImmediatePropagation(); 61 62 EphotoDam.zoomIn(this); 63 }); 64 65})(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.