From 866020cdfcfc62b5b7a0f5ef84621823ee5c9e72 Mon Sep 17 00:00:00 2001 From: "William P. Riley-Land" Date: Thu, 18 Oct 2012 23:13:27 -0500 Subject: [PATCH 01/22] Add component.json for bower --- component.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 component.json diff --git a/component.json b/component.json new file mode 100644 index 0000000..ae2843f --- /dev/null +++ b/component.json @@ -0,0 +1,5 @@ +{ + "name": "FitText.js", + "version": "1.0", + "main": "./jquery.fittext.js" +} \ No newline at end of file From 0e8d2e2c3f64aae637500c2906b68f2e943b0739 Mon Sep 17 00:00:00 2001 From: Jeff Smith Date: Fri, 23 Nov 2012 00:29:52 -0800 Subject: [PATCH 02/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7197801..cccf2cf 100644 --- a/README.md +++ b/README.md @@ -49,4 +49,4 @@ If you want more exact fitting text, there's a plugin for that! We recommend che If you oppose `window.resize()`, it's worth mentioning that @chriscoyier created a fork of [FitText using a debounced resize method](https://github.com/chriscoyier/FitText.js). ### Download, Fork, Commit. -If you think you can make this better, please Download, Fork, & Commit. We'd love your see your ideas. +If you think you can make this better, please Download, Fork, & Commit. We'd love to see your ideas. From e291b8acaed29c8b9eb5c46d44133b29f3fce8b3 Mon Sep 17 00:00:00 2001 From: photoman Date: Thu, 17 Jan 2013 12:06:35 -0500 Subject: [PATCH 03/22] Update example.html value of minFontSize didn't match maxFontSize. --- example.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example.html b/example.html index 77774cd..c6a2aee 100644 --- a/example.html +++ b/example.html @@ -53,7 +53,7 @@

Squeeze with FitText

From 2245cd839b08504bcbd487dcc05c1d20fd5e92e7 Mon Sep 17 00:00:00 2001 From: Dan Klotz Date: Fri, 29 Mar 2013 15:02:32 -0700 Subject: [PATCH 04/22] tiny edit to readme removed duplicate text at bottom of readme that's all --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eb5f51a..9c31e8b 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ jQuery("#responsive_headline").fitText(1.2, { minFontSize: '20px', maxFontSize: ## In Use: - [Trent Walton](http://trentwalton.com) -If you want more exact fitting text, there are plugins for that for that! We recommend checking out [BigText](https://github.com/zachleat/BigText) by Zach Leatherman or [SlabText](http://www.frequency-decoder.com/demo/slabText/) by Brian McAllister. +If you want more exact fitting text, there are plugins for that! We recommend checking out [BigText](https://github.com/zachleat/BigText) by Zach Leatherman or [SlabText](http://www.frequency-decoder.com/demo/slabText/) by Brian McAllister. ### Download, Fork, Commit. If you think you can make this better, please Download, Fork, & Commit. We'd love your see your ideas. From 5a644778d8cdcd252e3bb8f12f85c355d7f51ed6 Mon Sep 17 00:00:00 2001 From: "William P. Riley-Land" Date: Sat, 30 Mar 2013 21:15:02 -0500 Subject: [PATCH 05/22] Add dependence on jQuery and add .0 to version --- component.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/component.json b/component.json index ae2843f..9083dc9 100644 --- a/component.json +++ b/component.json @@ -1,5 +1,8 @@ { "name": "FitText.js", - "version": "1.0", - "main": "./jquery.fittext.js" -} \ No newline at end of file + "version": "1.0.0", + "main": "./jquery.fittext.js", + "dependencies": { + "jquery": ">= 1.6" + } +} From 494c331cc7a0f7ab15784a9014b6afa96f36d5a7 Mon Sep 17 00:00:00 2001 From: Dave Rupert Date: Thu, 11 Apr 2013 16:34:24 -0500 Subject: [PATCH 06/22] Adding orientationchange event. Fixes #14, #25, #36, #61 --- jquery.fittext.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jquery.fittext.js b/jquery.fittext.js index 1864f08..cef6862 100644 --- a/jquery.fittext.js +++ b/jquery.fittext.js @@ -32,10 +32,10 @@ // Call once to set. resizer(); - - // Call on resize. Opera debounces their resize by default. - $(window).on('resize', resizer); - + + // Call on resize. Opera debounces their resize by default. + $(window).on('resize orientationchange', resizer); + }); }; From 896f7acff71f386f83f264c8b060611b425c9a25 Mon Sep 17 00:00:00 2001 From: Dave Rupert Date: Thu, 11 Apr 2013 16:34:37 -0500 Subject: [PATCH 07/22] Whitespace OCD --- jquery.fittext.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/jquery.fittext.js b/jquery.fittext.js index cef6862..8bbb105 100644 --- a/jquery.fittext.js +++ b/jquery.fittext.js @@ -1,30 +1,30 @@ /*global jQuery */ -/*! +/*! * FitText.js 1.1 * * Copyright 2011, Dave Rupert http://daverupert.com -* Released under the WTFPL license +* Released under the WTFPL license * http://sam.zoy.org/wtfpl/ * * Date: Thu May 05 14:23:00 2011 -0600 */ (function( $ ){ - + $.fn.fitText = function( kompressor, options ) { - + // Setup options var compressor = kompressor || 1, settings = $.extend({ 'minFontSize' : Number.NEGATIVE_INFINITY, 'maxFontSize' : Number.POSITIVE_INFINITY }, options); - + return this.each(function(){ // Store the object - var $this = $(this); - + var $this = $(this); + // Resizer() resizes items based on the object width divided by the compressor * 10 var resizer = function () { $this.css('font-size', Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize))); From 48380abc9dfa5b52b5d372366c87be76bd55198c Mon Sep 17 00:00:00 2001 From: Dave Rupert Date: Thu, 11 Apr 2013 16:42:55 -0500 Subject: [PATCH 08/22] Read me updates --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 9c31e8b..6fd9844 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,13 @@ jQuery("#responsive_headline").fitText(1.2, { minFontSize: '20px', maxFontSize: - Set a No-JS fallback font-size in your CSS. - Fire +## Don't use jQuery? +That's okay. Check out these handy non-jQuery versions maintained by other people. + +- [non-jQuery FitText](https://github.com/adactio/FitText.js) from @adactio + ## Changelog +* `v 1.2` - Added `onorientationchange` event * `v 1.1` - FitText now ignores font-size and has minFontSize & maxFontSize options * `v 1.0.1` - Fix for broken font-size. * `v 1.0` - Initial Release From b558ed2401051b797feed97446988787fd567a40 Mon Sep 17 00:00:00 2001 From: Dave Rupert Date: Thu, 11 Apr 2013 16:43:01 -0500 Subject: [PATCH 09/22] Updated version --- component.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/component.json b/component.json index 9083dc9..77bbb7e 100644 --- a/component.json +++ b/component.json @@ -1,6 +1,6 @@ { "name": "FitText.js", - "version": "1.0.0", + "version": "1.2.0", "main": "./jquery.fittext.js", "dependencies": { "jquery": ">= 1.6" From 57ce345437f9b1871ece163a15954595a6e02b1e Mon Sep 17 00:00:00 2001 From: Tim Svensen Date: Fri, 3 May 2013 01:23:11 -0500 Subject: [PATCH 10/22] Adding a namespace for FitText events so they can be turned .off('.FitText') --- jquery.fittext.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.fittext.js b/jquery.fittext.js index 8bbb105..d456214 100644 --- a/jquery.fittext.js +++ b/jquery.fittext.js @@ -34,10 +34,10 @@ resizer(); // Call on resize. Opera debounces their resize by default. - $(window).on('resize orientationchange', resizer); + $(window).on('resize.FitText orientationchange.FitText', resizer); }); }; -})( jQuery ); \ No newline at end of file +})( jQuery ); From 2d3574e549ec0f4074be2abf45aecfdd367ab3f9 Mon Sep 17 00:00:00 2001 From: Tim Svensen Date: Tue, 7 May 2013 11:05:20 -0500 Subject: [PATCH 11/22] Namespace to all lowercase --- jquery.fittext.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.fittext.js b/jquery.fittext.js index d456214..080b82e 100644 --- a/jquery.fittext.js +++ b/jquery.fittext.js @@ -34,7 +34,7 @@ resizer(); // Call on resize. Opera debounces their resize by default. - $(window).on('resize.FitText orientationchange.FitText', resizer); + $(window).on('resize.fittext orientationchange.fittext', resizer); }); From d2e07f9adb6a235b10026d155286c92c590507ca Mon Sep 17 00:00:00 2001 From: Dave Rupert Date: Sat, 22 Jun 2013 15:00:29 -0500 Subject: [PATCH 12/22] More explicit WARNING text. Fixes #70 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 50994d8..79fc0e0 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,11 @@ jQuery("#responsive_headline").fitText(1.2, { minFontSize: '20px', maxFontSize: ## CSS FAQ -- Make sure your headline has width! - - Use `display: block;` OR `display: inline-block;`+ a specified width (i.e. `width: 100%`). +- **Make sure your container has a width!** + - `display: inline` elements don't have a width. Use `display: block` OR `display: inline-block`+ a specified width (i.e. `width: 100%`). + - `position:absolute` elements need a specified width as well. - Tweak until you like it. - Set a No-JS fallback font-size in your CSS. -- Fire ## Don't use jQuery? That's okay. Check out these handy non-jQuery versions maintained by other people. From b425cbccc03c7b0a56e7025186e219cf660de221 Mon Sep 17 00:00:00 2001 From: Dave Rupert Date: Tue, 20 Aug 2013 20:55:39 -0500 Subject: [PATCH 13/22] Issue Submission Guidelines Establishing guideslines for new issues. + Reduced test case required --- CONTRIBUTING.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..2e18c0a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,13 @@ +## Submitting issues + +### Reduced test case required + +All bug reports and problem issues require a reduced test case. See [CSS Tricks - Reduced Test Cases](http://css-tricks.com/reduced-test-cases/) on why they _"are the absolute, ... number one way to troubleshoot bugs."_ + ++ A reduced test case is an isolated example that demonstrates the bug or issue. ++ It contains the bare minimum HTML, CSS, and JavaScript required to demonstrate the bug. No extra functionality or styling. ++ A link to your site is **not** a reduced test case. ++ A [CodePen](http://codepen.io) is preferred so we can help you fix an error. ++ Until you provide a reduced test case, your issue will be closed. + +This guideline may seem a little harsh, but it helps dramatically. Reduced test cases help you identify the issue at hand and understand your own code. On our side, they greatly reduce the amount of time spent resolving the issue. \ No newline at end of file From 6a915866c84373da4bad173b404942de38074d46 Mon Sep 17 00:00:00 2001 From: Dave Rupert Date: Tue, 22 Oct 2013 11:46:04 -0500 Subject: [PATCH 14/22] Adding Angular version to readme. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 79fc0e0..27c86d9 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ jQuery("#responsive_headline").fitText(1.2, { minFontSize: '20px', maxFontSize: That's okay. Check out these handy non-jQuery versions maintained by other people. - [non-jQuery FitText](https://github.com/adactio/FitText.js) from @adactio +- [Angular.js FitText.js](https://github.com/patrickmarabeas/AngularJS-FitText.js) from @patrickmarabeas ## Changelog * `v 1.2` - Added `onorientationchange` event From e992a9a259a2820f2662b97af064b2a59c230dd4 Mon Sep 17 00:00:00 2001 From: Luiz Fernando Rodrigues Date: Fri, 10 Jan 2014 13:27:45 -0200 Subject: [PATCH 15/22] Rename component.json to bower.json - Closes #95 - Add ignore files. --- component.json => bower.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) rename component.json => bower.json (65%) diff --git a/component.json b/bower.json similarity index 65% rename from component.json rename to bower.json index 77bbb7e..ad3fbda 100644 --- a/component.json +++ b/bower.json @@ -4,5 +4,9 @@ "main": "./jquery.fittext.js", "dependencies": { "jquery": ">= 1.6" - } + }, + "ignore": [ + "exemple.html", + "CONTRIBUTING.md" + ] } From c5dc80ff858ba531f0b542c51b5648fe0e00aeef Mon Sep 17 00:00:00 2001 From: Neil Monroe Date: Wed, 29 Jan 2014 14:07:46 -0600 Subject: [PATCH 16/22] Update jquery.fittext.js Update version number --- jquery.fittext.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.fittext.js b/jquery.fittext.js index 080b82e..0b3ddef 100644 --- a/jquery.fittext.js +++ b/jquery.fittext.js @@ -1,6 +1,6 @@ /*global jQuery */ /*! -* FitText.js 1.1 +* FitText.js 1.2 * * Copyright 2011, Dave Rupert http://daverupert.com * Released under the WTFPL license From 795fb919b5476ab00ac4efa500915a706dff4516 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 7 Aug 2014 16:23:51 +0100 Subject: [PATCH 17/22] Dead link Amended to direct repo link. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 27c86d9..7c1e46c 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ That's okay. Check out these handy non-jQuery versions maintained by other peopl ## In Use: - [Trent Walton](http://trentwalton.com) -If you want more exact fitting text, there are plugins for that! We recommend checking out [BigText](https://github.com/zachleat/BigText) by Zach Leatherman or [SlabText](http://www.frequency-decoder.com/demo/slabText/) by Brian McAllister. +If you want more exact fitting text, there are plugins for that! We recommend checking out [BigText](https://github.com/zachleat/BigText) by Zach Leatherman or [SlabText](https://github.com/freqDec/slabText) by Brian McAllister. ### Download, Fork, Commit. If you think you can make this better, please Download, Fork, & Commit. We'd love to see your ideas. From c697154b63ff0394cee408d3bc5925d1308a9a20 Mon Sep 17 00:00:00 2001 From: charlespeters Date: Mon, 13 Oct 2014 20:35:03 -0400 Subject: [PATCH 18/22] fixing bower ignore file --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index ad3fbda..44dfb61 100644 --- a/bower.json +++ b/bower.json @@ -6,7 +6,7 @@ "jquery": ">= 1.6" }, "ignore": [ - "exemple.html", + "example.html", "CONTRIBUTING.md" ] } From 3224e4026e8022d8924c0e21729a1a02b14aa959 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Tue, 25 Nov 2014 20:09:45 +0100 Subject: [PATCH 19/22] Missing semicolons --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7c1e46c..d23119a 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ This will hopefully give you a level of "control" that might not be pixel perfec FitText now allows you to specify two optional pixel values: `minFontSize` and `maxFontSize`. Great for situations when you want to preserve hierarchy. ```javascript -jQuery("#responsive_headline").fitText(1.2, { minFontSize: '20px', maxFontSize: '40px' }) +jQuery("#responsive_headline").fitText(1.2, { minFontSize: '20px', maxFontSize: '40px' }); ``` ## CSS FAQ From 0e3ff6699f4a7781795af161e8e63d856e2f4b1e Mon Sep 17 00:00:00 2001 From: Dave Rupert Date: Tue, 3 Nov 2015 13:36:37 -0600 Subject: [PATCH 20/22] Added much needed things to the readme. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d23119a..3d0cefc 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,13 @@ jQuery("#responsive_headline").fitText(1.2, { minFontSize: '20px', maxFontSize: ## CSS FAQ -- **Make sure your container has a width!** +- :warning: Run FitText before anything that hides the element you're trying to size (e.g. before Carousels, Scrollers, Accordions, Tabs, etc). Hiding an element's container removes its width. It can't resize without a width. +- :warning: **Make sure your container has a width!** - `display: inline` elements don't have a width. Use `display: block` OR `display: inline-block`+ a specified width (i.e. `width: 100%`). - `position:absolute` elements need a specified width as well. - Tweak until you like it. - Set a No-JS fallback font-size in your CSS. +- :new: If your text is full width, you might want to **NOT** use FitText and just use CSS `vw` units instead. Supported in all major browsers. ## Don't use jQuery? That's okay. Check out these handy non-jQuery versions maintained by other people. From a37bafbf0b66a8bf3f71475daf5dd09b9e7d2406 Mon Sep 17 00:00:00 2001 From: Dave Rupert Date: Tue, 12 Jan 2016 12:29:13 -0600 Subject: [PATCH 21/22] Adding links to other versions --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3d0cefc..cb08849 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,8 @@ That's okay. Check out these handy non-jQuery versions maintained by other peopl - [non-jQuery FitText](https://github.com/adactio/FitText.js) from @adactio - [Angular.js FitText.js](https://github.com/patrickmarabeas/AngularJS-FitText.js) from @patrickmarabeas +- [AMP-HTML FitText](https://github.com/ampproject/amphtml/tree/master/extensions/amp-fit-text) +- [FitText UMD](https://github.com/peacechen/FitText-UMD) by @peacechen ## Changelog * `v 1.2` - Added `onorientationchange` event From 26f5c3b52abff46cbab1d5e762f5f5999b178835 Mon Sep 17 00:00:00 2001 From: charles peters Date: Thu, 28 Jul 2016 12:04:49 -0700 Subject: [PATCH 22/22] renaming package --- bower.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 44dfb61..c4887a3 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { - "name": "FitText.js", + "name": "jquery-fittext", "version": "1.2.0", - "main": "./jquery.fittext.js", + "main": "jquery.fittext.js", "dependencies": { "jquery": ">= 1.6" },