bigtextjs_rails 0.1.5.1 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZTY5MzdlMTBhZTJiNTVmODg3YmE0NTc1ZDcxY2RjYjc5YjY0YTllMQ==
5
- data.tar.gz: !binary |-
6
- MjBlMWRmMjk1MDEwMDYzZTExMzBhZDk3NGEzMGYzYjI4MTRlZjQ1Yw==
2
+ SHA1:
3
+ metadata.gz: ad4da7cdaacc9bb52ef7cb17b40884fb741b1ac8
4
+ data.tar.gz: 7253edc654db8a0ced93c26cea0abaec8422bf06
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- M2EyYTE4YjFlM2EwZGI0ZTdjNGRjZDQ3NGNkMjljNzU4MGQ5M2UyOGY0Y2M1
10
- YTFjYjU1ZWMzZjI4NzM5MjdlNmJlYzNiN2M4NTdkNTYwOGVlMDQ1Yzc3YzMw
11
- YzBjNjM1M2QxNWU1ZmIyY2JhZmI5YzFiMTYzMDZjNWY2Njc3MGE=
12
- data.tar.gz: !binary |-
13
- ZjViZWVhYTBlNmFhZTI5OWYzMWJmMWFjZjZjZDFhZTU3ZmQ3ZjYzOWNkZGQw
14
- YTFjZTVlYzMxOWJmM2E5YjRhNGFlNGIyYmI3YWJmZjUyMDliYTA1Njc4OTY0
15
- ZjliZGI4ZDAwYmRhMGI5MTQwNGJkZTVkMzYzZDc0NWI5YzlkZWM=
6
+ metadata.gz: 99b5e7d0f156227bc4479260092b2f5fe9339fe41f8886bf67bfeaf1c3cdcaf3a8939153da758d0f635744e25a5e4ce5b222422cbca25aa8dbad54cd02a04359
7
+ data.tar.gz: 4fa3332de00113991dda49f216cd38b6aed564f197a2f7f1430506a530a25ea459d20ce79eb48b91dc8426e690d4be4b5fa811067e62f02efa44ecf46abda7d4
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .DS_Store
@@ -1,8 +1,11 @@
1
- /*! BigText - v0.1.5 - 2013-08-24
2
- * https://github.com/zachleat/BigText
3
- * Copyright (c) 2013 @zachleat; Licensed MIT */
1
+ /*! BigText - v0.1.6 - 2014-04-21
2
+ * https://github.com/zachleat/bigtext
3
+ * Copyright (c) 2014 Zach Leatherman (@zachleat)
4
+ * MIT License */
5
+
6
+ (function(window, $) {
7
+ "use strict";
4
8
 
5
- ;(function(window, $) {
6
9
  var counter = 0,
7
10
  $headCache = $('head'),
8
11
  oldBigText = window.BigText,
@@ -51,8 +54,6 @@
51
54
  if($.fn.smartresize) {
52
55
  // https://github.com/lrbabe/jquery-smartresize/
53
56
  eventName = 'smartresize.' + eventName;
54
- } else if(_.debounce) {
55
- resizeFunction = _.debounce(resizeFunction, 200);
56
57
  }
57
58
  $(window).unbind(eventName).bind(eventName, resizeFunction);
58
59
  }
@@ -89,14 +90,14 @@
89
90
  jQueryMethod: function(options)
90
91
  {
91
92
  BigText.init();
92
-
93
+
93
94
  options = $.extend({
94
- minfontsize: BigText.DEFAULT_MIN_FONT_SIZE_PX,
95
- maxfontsize: BigText.DEFAULT_MAX_FONT_SIZE_PX,
96
- childSelector: '',
97
- resize: true
98
- }, options || {});
99
-
95
+ minfontsize: BigText.DEFAULT_MIN_FONT_SIZE_PX,
96
+ maxfontsize: BigText.DEFAULT_MAX_FONT_SIZE_PX,
97
+ childSelector: '',
98
+ resize: true
99
+ }, options || {});
100
+
100
101
  this.each(function()
101
102
  {
102
103
  var $t = $(this).addClass('bigtext'),
@@ -108,7 +109,7 @@
108
109
  id = 'bigtext-id' + (counter++);
109
110
  $t.attr('id', id);
110
111
  }
111
-
112
+
112
113
  if(options.resize) {
113
114
  BigText.bindResize('resize.bigtext-event-' + id, function()
114
115
  {
@@ -116,16 +117,16 @@
116
117
  BigText.jQueryMethod.call($('#' + id), options);
117
118
  });
118
119
  }
119
-
120
+
120
121
  BigText.clearCss(id);
121
-
122
+
122
123
  $children.addClass(function(lineNumber, className)
123
124
  {
124
125
  // remove existing line classes.
125
126
  return [className.replace(new RegExp('\\b' + BigText.LINE_CLASS_PREFIX + '\\d+\\b'), ''),
126
127
  BigText.LINE_CLASS_PREFIX + lineNumber].join(' ');
127
128
  });
128
-
129
+
129
130
  var sizes = calculateSizes($t, $children, maxWidth, options.maxfontsize, options.minfontsize);
130
131
  $headCache.append(BigText.generateCss(id, sizes.fontSizes, sizes.wordSpacings, sizes.minFontSizes));
131
132
  });
@@ -137,7 +138,7 @@
137
138
  function testLineDimensions($line, maxWidth, property, size, interval, units, previousWidth)
138
139
  {
139
140
  var width;
140
- previousWidth = typeof previousWidth == 'number' ? previousWidth : 0;
141
+ previousWidth = typeof previousWidth === 'number' ? previousWidth : 0;
141
142
  $line.css(property, size + units);
142
143
 
143
144
  width = $line.width();
@@ -146,7 +147,7 @@
146
147
  // console.log(width, ' previous: ' + previousWidth, property + ' at ' + interval, 'prior: ' + (parseFloat(size) - interval), 'new:' + parseFloat(size));
147
148
  $line.css(property, '');
148
149
 
149
- if(width == maxWidth) {
150
+ if(width === maxWidth) {
150
151
  return {
151
152
  match: 'exact',
152
153
  size: parseFloat((parseFloat(size) - 0.1).toFixed(3))
@@ -171,16 +172,17 @@
171
172
  function calculateSizes($t, $children, maxWidth, maxFontSize, minFontSize)
172
173
  {
173
174
  var $c = $t.clone(true)
174
- .addClass('bigtext-cloned')
175
- .css({
176
- fontFamily: $t.css('font-family'),
177
- textTransform: $t.css('text-transform'),
178
- wordSpacing: $t.css('word-spacing'),
179
- letterSpacing: $t.css('letter-spacing'),
180
- position: 'absolute',
181
- left: BigText.DEBUG_MODE ? 0 : -9999,
182
- top: BigText.DEBUG_MODE ? 0 : -9999
183
- }).appendTo(document.body);
175
+ .addClass('bigtext-cloned')
176
+ .css({
177
+ fontFamily: $t.css('font-family'),
178
+ textTransform: $t.css('text-transform'),
179
+ wordSpacing: $t.css('word-spacing'),
180
+ letterSpacing: $t.css('letter-spacing'),
181
+ position: 'absolute',
182
+ left: BigText.DEBUG_MODE ? 0 : -9999,
183
+ top: BigText.DEBUG_MODE ? 0 : -9999
184
+ })
185
+ .appendTo(document.body);
184
186
 
185
187
  // font-size isn't the only thing we can modify, we can also mess with:
186
188
  // word-spacing and letter-spacing. WebKit does not respect subpixel
@@ -191,11 +193,12 @@
191
193
  minFontSizes = [],
192
194
  ratios = [];
193
195
 
194
- $children.css('float', 'left').each(function(lineNumber) {
196
+ $children.css('float', 'left').each(function() {
195
197
  var $line = $(this),
196
198
  // TODO replace 8, 4 with a proportional size to the calculated font-size.
197
199
  intervals = BigText.test.noFractionalFontSize ? [8, 4, 1] : [8, 4, 1, 0.1],
198
- lineMax;
200
+ lineMax,
201
+ newFontSize;
199
202
 
200
203
  if($line.hasClass(BigText.EXEMPT_CLASS)) {
201
204
  fontSizes.push(null);
@@ -222,7 +225,7 @@
222
225
  if(typeof lineMax !== 'number') {
223
226
  newFontSize = lineMax.size;
224
227
 
225
- if(lineMax.match == 'exact') {
228
+ if(lineMax.match === 'exact') {
226
229
  break outer;
227
230
  }
228
231
  break inner;
@@ -287,4 +290,4 @@
287
290
  $.fn.bigtext = BigText.jQueryMethod;
288
291
  window.BigText = BigText;
289
292
 
290
- })(this, jQuery);
293
+ })(this, jQuery);
@@ -1,3 +1,3 @@
1
1
  module BigtextjsRails
2
- VERSION = "0.1.5.1"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigtextjs_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5.1
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guy Israeli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-04 00:00:00.000000000 Z
11
+ date: 2014-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: railties
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.1'
55
55
  description: This is an asset pipeline wrapper for the awesome bigtext.js
@@ -58,7 +58,7 @@ executables: []
58
58
  extensions: []
59
59
  extra_rdoc_files: []
60
60
  files:
61
- - .gitignore
61
+ - ".gitignore"
62
62
  - Gemfile
63
63
  - LICENSE.txt
64
64
  - README.md
@@ -77,17 +77,17 @@ require_paths:
77
77
  - lib
78
78
  required_ruby_version: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - ! '>='
85
+ - - ">="
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubyforge_project:
90
- rubygems_version: 2.1.3
90
+ rubygems_version: 2.2.1
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: BigText Makes Text Big. This gem will help you do it the rails way.