Skip to content

Commit

Permalink
finalize v0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
livibetter committed Feb 9, 2013
1 parent 8aa1065 commit 236f49a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGES.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ CHANGES

## Development

## Version 0.3.2 (2013-02-09T02:43:32Z)

* fix introduced global variable fontSize by `_sizing()`
* fix container too small for bigger font size setting (#11)

## Version 0.3.1 (2013-01-27T05:10:51Z)

* Add `debug` option.
Expand Down
4 changes: 2 additions & 2 deletions jquery.textfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* @name jquery.textfill.js
* @author Russ Painter
* @author Yu-Jie Lin
* @version 0.3.1
* @date 2013-01-27
* @version 0.3.2
* @date 2013-02-09
* @copyright (c) 2012-2013 Yu-Jie Lin
* @copyright (c) 2009 Russ Painter
* @license MIT License
Expand Down
10 changes: 5 additions & 5 deletions jquery.textfill.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
@name jquery.textfill.js
@author Russ Painter
@author Yu-Jie Lin
@version 0.3.1
@date 2013-01-27
@version 0.3.2
@date 2013-02-09
@copyright (c) 2012-2013 Yu-Jie Lin
@copyright (c) 2009 Russ Painter
@license MIT License
@homepage https://github.com/jquery-textfill/jquery-textfill
@example http://jquery-textfill.github.com/jquery-textfill/Example.htm
*/
(function(k){k.fn.textfill=function(n){function l(c,a,d,f,g,h){function e(a,b){var c=" / ";a>b?c=" > ":a==b&&(c=" = ");return c}b.debug&&console.debug(c+"font: "+a.css("font-size")+", H: "+a.height()+e(a.height(),d)+d+", W: "+a.width()+e(a.width(),f)+f+", minFontPixels: "+g+", maxFontPixels: "+h)}function m(b,a,d,f,g,h,e,j){for(l(b+": ",a,g,h,e,j);e<j-1;){fontSize=Math.floor((e+j)/2);a.css("font-size",fontSize);if(d.call(a)<=f){if(e=fontSize,d.call(a)==f)break}else j=fontSize;l(b+": ",a,g,h,e,j)}a.css("font-size",
j);d.call(a)<=f&&(e=j,l(b+"* ",a,g,h,e,j));return e}var b=jQuery.extend({debug:!1,maxFontPixels:40,minFontPixels:4,innerTag:"span",widthOnly:!1,callback:null,complete:null,explicitWidth:null,explicitHeight:null},n);this.each(function(){var c=k(b.innerTag+":visible:first",this),a=b.explicitHeight||k(this).height(),d=b.explicitWidth||k(this).width();b.debug&&(console.log("Opts: ",b),console.log("Vars: maxHeight: "+a+", maxWidth: "+d));var f=b.minFontPixels,g=0>=b.maxFontPixels?a:b.maxFontPixels,h=void 0;
b.widthOnly||(h=m("H",c,k.fn.height,a,a,d,f,g));a=m("W",c,k.fn.width,d,a,d,f,g);b.widthOnly?c.css("font-size",a):c.css("font-size",Math.min(h,a));b.debug&&console.debug("Final: "+c.css("font-size"));b.callback&&b.callback(this)});b.complete&&b.complete(this);return this}})(jQuery);
(function(g){g.fn.textfill=function(n){function l(c,a,e,h,f,j){function d(a,b){var c=" / ";a>b?c=" > ":a==b&&(c=" = ");return c}b.debug&&console.debug(c+"font: "+a.css("font-size")+", H: "+a.height()+d(a.height(),e)+e+", W: "+a.width()+d(a.width(),h)+h+", minFontPixels: "+f+", maxFontPixels: "+j)}function m(b,a,e,h,f,j,d,k){for(l(b+": ",a,f,j,d,k);d<k-1;){var g=Math.floor((d+k)/2);a.css("font-size",g);if(e.call(a)<=h){if(d=g,e.call(a)==h)break}else k=g;l(b+": ",a,f,j,d,k)}a.css("font-size",k);e.call(a)<=
h&&(d=k,l(b+"* ",a,f,j,d,k));return d}var b=jQuery.extend({debug:!1,maxFontPixels:40,minFontPixels:4,innerTag:"span",widthOnly:!1,callback:null,complete:null,explicitWidth:null,explicitHeight:null},n);this.each(function(){var c=g(b.innerTag+":visible:first",this),a=b.explicitHeight||g(this).height(),e=b.explicitWidth||g(this).width(),h=c.css("font-size");b.debug&&(console.log("Opts: ",b),console.log("Vars: maxHeight: "+a+", maxWidth: "+e));var f=b.minFontPixels,j=0>=b.maxFontPixels?a:b.maxFontPixels,
d=void 0;b.widthOnly||(d=m("H",c,g.fn.height,a,a,e,f,j));f=m("W",c,g.fn.width,e,a,e,f,j);b.widthOnly?c.css("font-size",f):c.css("font-size",Math.min(d,f));b.debug&&console.debug("Final: "+c.css("font-size"));(c.width()>e||c.height()>a)&&c.css("font-size",h);b.callback&&b.callback(this)});b.complete&&b.complete(this);return this}})(jQuery);

0 comments on commit 236f49a

Please sign in to comment.