Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better minification with variable obfuscation.

Signed-off-by: John Nunemaker <nunemaker@gmail.com>
  • Loading branch information...
commit 78e83432cf136e94cd61ced97511a2f35ae8bf40 1 parent a6eb79d
dave authored jnunemaker committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  jquery/js/fancyzoom.min.js
View
2  jquery/js/fancyzoom.min.js
@@ -1 +1 @@
-(function($){$.fn.fancyZoom=function(options){var options=options||{};var directory=options&&options.directory?options.directory:"images";var zooming=false;if($("#zoom").length==0){var ext=$.browser.msie?"gif":"png";var html='<div id="zoom" style="display:none;"> <table id="zoom_table" style="border-collapse:collapse; width:100%; height:100%;"> <tbody> <tr> <td class="tl" style="background:url('+directory+"/tl."+ext+') 0 0 no-repeat; width:20px; height:20px; overflow:hidden;" /> <td class="tm" style="background:url('+directory+"/tm."+ext+') 0 0 repeat-x; height:20px; overflow:hidden;" /> <td class="tr" style="background:url('+directory+"/tr."+ext+') 100% 0 no-repeat; width:20px; height:20px; overflow:hidden;" /> </tr> <tr> <td class="ml" style="background:url('+directory+"/ml."+ext+') 0 0 repeat-y; width:20px; overflow:hidden;" /> <td class="mm" style="background:#fff; vertical-align:top; padding:10px;"> <div id="zoom_content"> </div> </td> <td class="mr" style="background:url('+directory+"/mr."+ext+') 100% 0 repeat-y; width:20px; overflow:hidden;" /> </tr> <tr> <td class="bl" style="background:url('+directory+"/bl."+ext+') 0 100% no-repeat; width:20px; height:20px; overflow:hidden;" /> <td class="bm" style="background:url('+directory+"/bm."+ext+') 0 100% repeat-x; height:20px; overflow:hidden;" /> <td class="br" style="background:url('+directory+"/br."+ext+') 100% 100% no-repeat; width:20px; height:20px; overflow:hidden;" /> </tr> </tbody> </table> <a href="#" title="Close" id="zoom_close" style="position:absolute; top:0; left:0;"> <img src="'+directory+"/closebox."+ext+'" alt="Close" style="border:none; margin:0; padding:0;" /> </a> </div>';$("body").append(html);$("html").click(function(e){if($(e.target).parents("#zoom:visible").length==0){hide();}});$(document).keyup(function(event){if(event.keyCode==27&&$("#zoom:visible").length>0){hide();}});$("#zoom_close").click(hide);}var zoom=$("#zoom");var zoom_table=$("#zoom_table");var zoom_close=$("#zoom_close");var zoom_content=$("#zoom_content");var middle_row=$("td.ml,td.mm,td.mr");this.each(function(i){$($(this).attr("href")).hide();$(this).click(show);});return this;function show(e){if(zooming){return false;}zooming=true;var content_div=$($(this).attr("href"));var zoom_width=options.width;var zoom_height=options.height;var width=window.innerWidth||(window.document.documentElement.clientWidth||window.document.body.clientWidth);var height=window.innerHeight||(window.document.documentElement.clientHeight||window.document.body.clientHeight);var x=window.pageXOffset||(window.document.documentElement.scrollLeft||window.document.body.scrollLeft);var y=window.pageYOffset||(window.document.documentElement.scrollTop||window.document.body.scrollTop);var window_size={width:width,height:height,x:x,y:y};var width=(zoom_width||content_div.width())+60;var height=(zoom_height||content_div.height())+60;var d=window_size;var newTop=Math.max((d.height/2)-(height/2)+y,0);var newLeft=(d.width/2)-(width/2);var curTop=e.pageY;var curLeft=e.pageX;zoom_close.attr("curTop",curTop);zoom_close.attr("curLeft",curLeft);zoom_close.attr("scaleImg",options.scaleImg?"true":"false");$("#zoom").hide().css({position:"absolute",top:curTop+"px",left:curLeft+"px",width:"1px",height:"1px"});fixBackgroundsForIE();zoom_close.hide();if(options.closeOnClick){$("#zoom").click(hide);}if(options.scaleImg){zoom_content.html(content_div.html());$("#zoom_content img").css("width","100%");}else{zoom_content.html("");}$("#zoom").animate({top:newTop+"px",left:newLeft+"px",opacity:"show",width:width,height:height},500,null,function(){if(options.scaleImg!=true){zoom_content.html(content_div.html());}unfixBackgroundsForIE();zoom_close.show();zooming=false;});return false;}function hide(){if(zooming){return false;}zooming=true;$("#zoom").unbind("click");fixBackgroundsForIE();if(zoom_close.attr("scaleImg")!="true"){zoom_content.html("");}zoom_close.hide();$("#zoom").animate({top:zoom_close.attr("curTop")+"px",left:zoom_close.attr("curLeft")+"px",opacity:"hide",width:"1px",height:"1px"},500,null,function(){if(zoom_close.attr("scaleImg")=="true"){zoom_content.html("");}unfixBackgroundsForIE();zooming=false;});return false;}function switchBackgroundImagesTo(to){$("#zoom_table td").each(function(i){var bg=$(this).css("background-image").replace(/\.(png|gif|none)\"\)$/,"."+to+'")');$(this).css("background-image",bg);});var close_img=zoom_close.children("img");var new_img=close_img.attr("src").replace(/\.(png|gif|none)$/,"."+to);close_img.attr("src",new_img);}function fixBackgroundsForIE(){if($.browser.msie&&parseFloat($.browser.version)>=7){switchBackgroundImagesTo("gif");}}function unfixBackgroundsForIE(){if($.browser.msie&&$.browser.version>=7){switchBackgroundImagesTo("png");}}};})(jQuery);
+(function(a){a.fn.fancyZoom=function(p){var p=p||{};var m=p&&p.directory?p.directory:"images";var e=false;if(a("#zoom").length==0){var f=a.browser.msie?"gif":"png";var k='<div id="zoom" style="display:none;"> <table id="zoom_table" style="border-collapse:collapse; width:100%; height:100%;"> <tbody> <tr> <td class="tl" style="background:url('+m+"/tl."+f+') 0 0 no-repeat; width:20px; height:20px; overflow:hidden;" /> <td class="tm" style="background:url('+m+"/tm."+f+') 0 0 repeat-x; height:20px; overflow:hidden;" /> <td class="tr" style="background:url('+m+"/tr."+f+') 100% 0 no-repeat; width:20px; height:20px; overflow:hidden;" /> </tr> <tr> <td class="ml" style="background:url('+m+"/ml."+f+') 0 0 repeat-y; width:20px; overflow:hidden;" /> <td class="mm" style="background:#fff; vertical-align:top; padding:10px;"> <div id="zoom_content"> </div> </td> <td class="mr" style="background:url('+m+"/mr."+f+') 100% 0 repeat-y; width:20px; overflow:hidden;" /> </tr> <tr> <td class="bl" style="background:url('+m+"/bl."+f+') 0 100% no-repeat; width:20px; height:20px; overflow:hidden;" /> <td class="bm" style="background:url('+m+"/bm."+f+') 0 100% repeat-x; height:20px; overflow:hidden;" /> <td class="br" style="background:url('+m+"/br."+f+') 100% 100% no-repeat; width:20px; height:20px; overflow:hidden;" /> </tr> </tbody> </table> <a href="#" title="Close" id="zoom_close" style="position:absolute; top:0; left:0;"> <img src="'+m+"/closebox."+f+'" alt="Close" style="border:none; margin:0; padding:0;" /> </a> </div>';a("body").append(k);a("html").click(function(q){if(a(q.target).parents("#zoom:visible").length==0){l();}});a(document).keyup(function(q){if(q.keyCode==27&&a("#zoom:visible").length>0){l();}});a("#zoom_close").click(l);}var o=a("#zoom");var j=a("#zoom_table");var i=a("#zoom_close");var h=a("#zoom_content");var b=a("td.ml,td.mm,td.mr");this.each(function(q){a(a(this).attr("href")).hide();a(this).click(n);});return this;function n(w){if(e){return false;}e=true;var q=a(a(this).attr("href"));var u=p.width;var v=p.height;var r=window.innerWidth||(window.document.documentElement.clientWidth||window.document.body.clientWidth);var E=window.innerHeight||(window.document.documentElement.clientHeight||window.document.body.clientHeight);var C=window.pageXOffset||(window.document.documentElement.scrollLeft||window.document.body.scrollLeft);var B=window.pageYOffset||(window.document.documentElement.scrollTop||window.document.body.scrollTop);var F={width:r,height:E,x:C,y:B};var r=(u||q.width())+60;var E=(v||q.height())+60;var z=F;var A=Math.max((z.height/2)-(E/2)+B,0);var D=(z.width/2)-(r/2);var s=w.pageY;var t=w.pageX;i.attr("curTop",s);i.attr("curLeft",t);i.attr("scaleImg",p.scaleImg?"true":"false");a("#zoom").hide().css({position:"absolute",top:s+"px",left:t+"px",width:"1px",height:"1px"});g();i.hide();if(p.closeOnClick){a("#zoom").click(l);}if(p.scaleImg){h.html(q.html());a("#zoom_content img").css("width","100%");}else{h.html("");}a("#zoom").animate({top:A+"px",left:D+"px",opacity:"show",width:r,height:E},500,null,function(){if(p.scaleImg!=true){h.html(q.html());}d();i.show();e=false;});return false;}function l(){if(e){return false;}e=true;a("#zoom").unbind("click");g();if(i.attr("scaleImg")!="true"){h.html("");}i.hide();a("#zoom").animate({top:i.attr("curTop")+"px",left:i.attr("curLeft")+"px",opacity:"hide",width:"1px",height:"1px"},500,null,function(){if(i.attr("scaleImg")=="true"){h.html("");}d();e=false;});return false;}function c(s){a("#zoom_table td").each(function(u){var t=a(this).css("background-image").replace(/\.(png|gif|none)\"\)$/,"."+s+'")');a(this).css("background-image",t);});var r=i.children("img");var q=r.attr("src").replace(/\.(png|gif|none)$/,"."+s);r.attr("src",q);}function g(){if(a.browser.msie&&parseFloat(a.browser.version)>=7){c("gif");}}function d(){if(a.browser.msie&&a.browser.version>=7){c("png");}}};})(jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.