!function(a){"use strict";a.fn.jnewsgif=function(s){var i={};return s=s?a.extend(i,s):a.extend(i),a(this).each(function(){var s=a(this);s.addClass("ff-setup ff-image");var i=a('<div class="ff-overlay"><div class="ff-control">GIF</div></div>').insertBefore(s),n=a("<canvas />",{class:"ff-canvas"}).attr({width:0,height:0}).insertBefore(s);s.add(i).add(n).wrapAll(a("<div />",{class:["ff-container","ff-responsive"].join(" ")+" "+s[0].classList})),i.on("click",function(){var s=a(this),i=a(s).siblings("canvas");a(i).hasClass("ff-canvas-active")?(a(s).removeClass("ff-container-active"),a(i).removeClass("ff-canvas-active").addClass("ff-canvas-ready")):(a(s).addClass("ff-container-active"),a(i).removeClass("ff-canvas-ready").addClass("ff-canvas-active"))}),s.imagesLoaded().progress(function(s,i){var n=a(i.img).siblings("canvas"),e="transitionend webkitTransitionEnd oTransitionEnd otransitionend",t=a(i.img).width(),f=a(i.img).height();n.attr({width:t,height:f}),n[0].getContext("2d").drawImage(a(i.img).get(0),0,0,t,f),n.addClass("ff-canvas-ready").on(e,function(){a(this).off(e),a(i.img).addClass("ff-image-ready")})})})}}(jQuery);