diff --git a/README.md b/README.md index f5a3800..28a6b6d 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,10 @@ Include it in your AngularJS application Apply it to your text

FitText

+ +## v4.0.0 + +Details coming. See demo page for examples. ## v3.0.0 - NEW! Text now defaults to 100% width! diff --git a/bower.json b/bower.json index ab28393..74458e7 100644 --- a/bower.json +++ b/bower.json @@ -1,8 +1,8 @@ { "name": "ngFitText", - "version": "3.3.3", + "version": "4.0.0", "main": [ - "src/ng-FitText.js" + "dist/ng-FitText.min.js" ], "keywords": [ "angular", @@ -13,6 +13,7 @@ "demo", "lib", "node_modules", + "src", "test", ".bowerrc", "gulpfile.js", diff --git a/dist/ng-FitText.min.js b/dist/ng-FitText.min.js new file mode 100644 index 0000000..0f26d5e --- /dev/null +++ b/dist/ng-FitText.min.js @@ -0,0 +1 @@ +!function(t,e,i,n){"use strict";i.module("ngFitText",[]).value("fitTextDefaultConfig",{debounce:!1,delay:250,loadDelay:10,compressor:1,min:0,max:Number.POSITIVE_INFINITY}).directive("fittext",["$timeout","fitTextDefaultConfig","fitTextConfig",function(e,n,o){return{restrict:"A",scope:!0,link:function(f,l,a){function r(){var t=b*d/l[0].offsetWidth/d;return Math.max(Math.min((u[0].offsetWidth-6)*t*g,parseFloat(p)),parseFloat(h))}function s(){l[0].offsetHeight*l[0].offsetWidth!==0&&(l[0].style.fontSize=b+"px",l[0].style.lineHeight="1",l[0].style.display="inline-block",l[0].style.fontSize=r()+"px",l[0].style.lineHeight=y,l[0].style.display=m)}i.extend(n,o.config);var u=l.parent(),c=t.getComputedStyle(l[0],null),d=l.children().length||1,x=a.fittextLoadDelay||n.loadDelay,g=a.fittext||n.compressor,h=a.fittextMin||n.min,p=("initial"===a.fittextMax?c["font-size"]:a.fittextMax)||n.max,y=c["line-height"],m=c.display,b=10;e(function(){s()},x),f.$watch(a.ngBind,function(){s()}),n.debounce?i.element(t).bind("resize",n.debounce(function(){f.$apply(s)},n.delay)):i.element(t).bind("resize",function(){f.$apply(s)})}}}]).provider("fitTextConfig",function(){var t=this;return this.config={},this.$get=function(){var e={};return e.config=t.config,e},this})}(window,document,angular); \ No newline at end of file diff --git a/package.json b/package.json index 9899163..857249b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ng-fittext", - "version": "3.3.3", + "version": "4.0.0", "description": "An AngularJS directive for inflating web type", "homepage": "https://github.com/patrickmarabeas/ng-FitText.js", "bugs": "https://github.com/patrickmarabeas/ng-FitText.js/issues", @@ -9,9 +9,11 @@ "url": "git://github.com/patrickmarabeas/ng-FitText.js.git" }, "license": "MIT", - "main": "src/ng-FitText.js", + "main": "dist/ng-FitText.min.js", "devDependencies": { "gulp": "3.8.8", - "gulp-sass": "git://github.com/dlmanning/gulp-sass.git#88a7afdc1189875d41be2d143b8fe2efd60247f5" + "gulp-rename": "^1.2.2", + "gulp-sass": "^2.1.1", + "gulp-uglify": "^1.5.1" } } diff --git a/src/ng-FitText.js b/src/ng-FitText.js index b645ce6..3fae8bb 100644 --- a/src/ng-FitText.js +++ b/src/ng-FitText.js @@ -1,4 +1,4 @@ -/* ng-FitText.js v3.3.3 +/* ng-FitText.js v4.0.0 * https://github.com/patrickmarabeas/ng-FitText.js * * Original jQuery project: https://github.com/davatron5000/FitText.js @@ -7,7 +7,7 @@ * Released under the MIT license * http://opensource.org/licenses/mit-license.php * - * Date: 06/05/2015 + * Date: 18/01/2016 */ (function(window, document, angular, undefined) {