Changeset 28602 for extensions/modus
- Timestamp:
- Jun 2, 2014, 10:46:10 PM (10 years ago)
- Location:
- extensions/modus/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/modus/js/thumb.arrange.js
r27412 r28602 75 75 } 76 76 else { 77 this.opts.resizeThreshold = 1.1 ; /*if row is less than 10% larger than available width, distribute extra width through cropping*/78 this.opts.resizeFactor = 0.8;/* when row is more than 1 0% larger than available width, distribute extra width 80% through resizing and 20% through cropping*/77 this.opts.resizeThreshold = 1.12; /*if row is less than 12% larger than available width, distribute extra width through cropping*/ 78 this.opts.resizeFactor = 0.8;/* when row is more than 12% larger than available width, distribute extra width 80% through resizing and 20% through cropping*/ 79 79 } 80 80 this.process(); -
extensions/modus/js/thumb.arrange.min.js
r27412 r28602 2 2 RVGTLine.prototype={width:0,elementsWidth:0,firstThumbIndex:0,add:function(a,c){0===this.elements.length&&(this.firstThumbIndex=c);var d,b;(d=a.data("w"))?b=a.data("h"):((d=a[0].getAttribute("width"))&&(d=parseInt(d))?b=parseInt(a[0].getAttribute("height")):(d=a.width(),b=a.height()),b>this.rowHeight&&(d=Math.round(d*this.rowHeight/b),b=this.rowHeight),a.data("w",d).data("h",b));d={$elt:a,w:d,h:b};this.elements.push(d);d.h>this.maxHeight&&(this.maxHeight=d.h);this.width+=this.margin+d.w;this.elementsWidth+= 3 3 d.w},clear:function(){this.elements.length&&(this.maxHeight=this.width=this.elementsWidth=0,this.elements.length=0)}}; 4 function RVGThumbs(a){this.opts=a;this.$thumbs=$("#thumbnails");if(0!=this.$thumbs.length){this.$thumbs.css("text-align","left");this.opts.extraRowHeight=0;1<window.devicePixelRatio?(a=window.devicePixelRatio,this.opts.resizeThreshold=1.01,this.opts.resizeFactor=0.95,this.opts.extraRowHeight=6,this.opts.rowHeight=Math.round(this.opts.rowHeight/a)+this.opts.extraRowHeight):(this.opts.resizeThreshold=1.1 ,this.opts.resizeFactor=0.8);this.process();var c=this;$(window).on("resize",function(){1<Math.abs(c.$thumbs.width()-4 function RVGThumbs(a){this.opts=a;this.$thumbs=$("#thumbnails");if(0!=this.$thumbs.length){this.$thumbs.css("text-align","left");this.opts.extraRowHeight=0;1<window.devicePixelRatio?(a=window.devicePixelRatio,this.opts.resizeThreshold=1.01,this.opts.resizeFactor=0.95,this.opts.extraRowHeight=6,this.opts.rowHeight=Math.round(this.opts.rowHeight/a)+this.opts.extraRowHeight):(this.opts.resizeThreshold=1.12,this.opts.resizeFactor=0.8);this.process();var c=this;$(window).on("resize",function(){1<Math.abs(c.$thumbs.width()- 5 5 c.prevContainerWidth)&&c.process()}).on("RVTS_loaded",function(a,b){c.process(b&&c.$thumbs.width()==c.prevContainerWidth?c.prevLastLineFirstThumbIndex:0)});$.isReady||$(document).ready(function(){c.$thumbs.width()<c.prevContainerWidth&&c.process()})}} 6 6 RVGThumbs.prototype={prevContainerWidth:0,prevLastLineFirstThumbIndex:0,process:function(a){a=a?a:0;var c=this.$thumbs.width();this.prevContainerWidth=c;for(var d=$("li>a>img",this.$thumbs),b=new RVGTLine(this.opts.hMargin,this.opts.rowHeight);a<d.length;a++){var e=$(d[a]);b.add(e,a);b.width>=c-1*b.elements.length&&(this.processLine(b,c),b.clear())}b.elements.length&&this.processLine(b,c,!0);this.prevLastLineFirstThumbIndex=b.firstThumbIndex},processLine:function(a,c,d){var b,e,f=a.maxHeight?a.maxHeight:
Note: See TracChangeset
for help on using the changeset viewer.