Permalink
Browse files

Updated minified plugin version.

  • Loading branch information...
1 parent 14fcc3c commit 04512d5aadcfa6c46bbc59f50cfb9ae8cae224bf @Sebobo Sebobo committed Apr 14, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 jquery.wookmark.min.js
View
6 jquery.wookmark.min.js
@@ -3,10 +3,10 @@ jQuery wookmark plugin
@name jquery.wookmark.js
@author Christoph Ono (chri@sto.ph or @gbks)
@author Sebastian Helzle (sebastian@helzle.net or @sebobo)
-@version 1.1.0
-@date 03/15/2013
+@version 1.1.1
+@date 04/14/2013
@category jQuery plugin
@copyright (c) 2009-2013 Christoph Ono (www.wookmark.com)
@license Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*/
-(function(t){var i,e,s;s=function(t,i){return function(){return t.apply(i,arguments)}},e={align:"center",container:t("body"),offset:2,autoResize:!1,itemWidth:0,resizeDelay:50},i=function(){function i(i,o){this.handler=i,this.columns=null,this.containerWidth=null,this.resizeTimer=null,t.extend(!0,this,e,o),this.update=s(this.update,this),this.onResize=s(this.onResize,this),this.getItemWidth=s(this.getItemWidth,this),this.layout=s(this.layout,this),this.layoutFull=s(this.layoutFull,this),this.layoutColumns=s(this.layoutColumns,this),this.clear=s(this.clear,this),this.autoResize&&(t(window).bind("resize.wookmark",this.onResize),this.container.bind("refreshWookmark",this.onResize))}return i.prototype.update=function(i){t.extend(!0,this,i)},i.prototype.onResize=function(){clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(this.layout,this.resizeDelay)},i.prototype.getItemWidth=function(){return void 0===this.itemWidth?this.handler.eq(0).outerWidth():this.itemWidth},i.prototype.layout=function(){if(this.container.is(":visible")){var t=this.getItemWidth()+this.offset,i=this.container.width(),e=Math.floor((i+this.offset)/t),s=0,o=0;switch(this.align){case"left":case"right":s=Math.floor((e/t+this.offset)/2);break;case"center":default:s=Math.round((i-(e*t-this.offset))/2)}o=null!=this.columns&&this.columns.length==e?this.layoutColumns(t,s):this.layoutFull(t,e,s),this.container.css("height",o+"px")}},i.prototype.layoutFull=function(t,i,e){for(var s=[];i>s.length;)s.push(0);for(this.columns=[];i>this.columns.length;)this.columns.push([]);for(var o,h,n=0,r=0,u=this.handler.length,l=null,a=null,c=0,f={position:"absolute"};u>n;n++){for(o=this.handler.eq(n),l=s[0],a=0,r=0;i>r;r++)l>s[r]&&(l=s[r],a=r);f.top=l+"px",h=a*t+e+"px","right"==this.align?f.right=h:f.left=h,o.css(f),s[a]=l+o.outerHeight()+this.offset,c=Math.max(c,s[a]),this.columns[a].push(o)}return c},i.prototype.layoutColumns=function(t,i){for(var e,s,o,h,n,r=[],u=this.columns.length,l=0,a=0,c=0;u>r.length;)r.push(0);for(;u>l;l++)for(e=this.columns[l],s=e.length,a=0;s>a;a++)o=e[a],h={top:r[l]+"px"},n=l*t+i+"px","right"==this.align?h.right=n:h.left=n,o.css(h),r[l]+=o.outerHeight()+this.offset,c=Math.max(c,r[l]);return c},i.prototype.clear=function(){clearTimeout(this.resizeTimer),t(window).unbind("resize.wookmark",this.onResize),this.container.unbind("refreshWookmark",this.onResize)},i}(),t.fn.wookmark=function(t){return this.wookmarkInstance?this.wookmarkInstance.update(t||{}):this.wookmarkInstance=new i(this,t||{}),this.wookmarkInstance.layout(),this.show()}})(jQuery);
+(function(t){var i,e,s;s=function(t,i){return function(){return t.apply(i,arguments)}},e={align:"center",container:t("body"),offset:2,autoResize:!1,itemWidth:0,flexibleWidth:0,resizeDelay:50},i=function(){function i(i,h){this.handler=i,this.columns=null,this.containerWidth=null,this.resizeTimer=null,this.direction="left",t.extend(!0,this,e,h),this.update=s(this.update,this),this.onResize=s(this.onResize,this),this.getItemWidth=s(this.getItemWidth,this),this.layout=s(this.layout,this),this.layoutFull=s(this.layoutFull,this),this.layoutColumns=s(this.layoutColumns,this),this.clear=s(this.clear,this),this.autoResize&&(t(window).bind("resize.wookmark",this.onResize),this.container.bind("refreshWookmark",this.onResize))}return i.prototype.update=function(i){t.extend(!0,this,i)},i.prototype.onResize=function(){clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(this.layout,this.resizeDelay)},i.prototype.getItemWidth=function(){return void 0===this.itemWidth||0===this.itemWidth?this.handler.eq(0).outerWidth():"string"==typeof this.itemWidth&&this.itemWidth.indexOf("%")>=0?parseFloat(this.itemWidth)/100*this.container.width():this.itemWidth},i.prototype.getFlexibleWidth=function(){var t=this.container.width(),i=this.flexibleWidth;"string"==typeof i&&i.indexOf("%")>=0&&(i=parseFloat(i)/100*t,i-=this.handler.eq(0).outerWidth()-this.handler.eq(0).innerWidth());var e=Math.floor(1+t/(i+this.offset)),s=(t-(e-1)*this.offset)/e;return Math.floor(s)},i.prototype.layout=function(){if(this.container.is(":visible")){this.flexibleWidth&&(this.itemWidth=this.getFlexibleWidth(),this.handler.css("width",this.itemWidth));var t=this.getItemWidth()+this.offset,i=this.container.width(),e=Math.floor((i+this.offset)/t),s=0,h=0;e=Math.min(e,this.handler.length),s="left"==this.align||"right"==this.align?Math.floor((e/t+this.offset)/2):Math.round((i-(e*t-this.offset))/2),this.direction="right"==this.align?"right":"left",h=null!=this.columns&&this.columns.length==e?this.layoutColumns(t,s):this.layoutFull(t,e,s),this.container.css("height",h)}},i.prototype.layoutFull=function(t,i,e){var s,h,o=0,n=0,r=this.handler.length,l=null,a=null,u={position:"absolute"},f=[],d="left"==this.align?!0:!1;for(this.columns=[];i>f.length;)f.push(0),this.columns.push([]);for(;r>o;o++){for(s=this.handler.eq(o),l=f[0],a=0,n=0;i>n;n++)l>f[n]&&(l=f[n],a=n);h=0==a&&d?0:a*t+e,u[this.direction]=h,u.top=l,s.css(u),f[a]+=s.outerHeight()+this.offset,this.columns[a].push(s)}return Math.max.apply(Math,f)},i.prototype.layoutColumns=function(t,i){for(var e,s,h,o,n=[],r=0,l=0;this.columns.length>r;r++)for(n.push(0),e=this.columns[r],o=r*t+i,l=0;e.length>l;l++)s=e[l],h={top:n[r]},h[this.direction]=o,s.css(h),n[r]+=s.outerHeight()+this.offset;return Math.max.apply(Math,n)},i.prototype.clear=function(){clearTimeout(this.resizeTimer),t(window).unbind("resize.wookmark",this.onResize),this.container.unbind("refreshWookmark",this.onResize)},i}(),t.fn.wookmark=function(t){return this.wookmarkInstance?this.wookmarkInstance.update(t||{}):this.wookmarkInstance=new i(this,t||{}),this.wookmarkInstance.layout(),this.show()}})(jQuery);

0 comments on commit 04512d5

Please sign in to comment.