bigtextjs_rails 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YzY3ZTE4NDI3N2FlYWZhOGQ3MmYwOWJkMDZmNGE3Nzk4MTE1NTBhYg==
5
+ data.tar.gz: !binary |-
6
+ YjdlYzFjZmNjYzZlZjhiNjQ1NmY2OTBkYzIzYTgzM2IyYTc2ZTY4Yg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MzhkMWIxYmFkYTlkZjY2MGYyMTRiYmNkNWI0ZThjYWU3OTY4NDczMDdiZmQ4
10
+ YTYxYWJmZjM2ZGMwZDJkYmMyYzg0ZjJjZTU4Njg3N2ZmZTA2N2M2OTgyNzg2
11
+ NzhiMzA1YzU3OGM0NjQ4ZTQwZjk5MTUwNWU2ZGRiZGZlODkxNWI=
12
+ data.tar.gz: !binary |-
13
+ ODI1MDUwOTYyMzAyMmQ0MjNhMTBmNjQxYmVkZTFjMjQwNTRkMjhjNmI2ZGNl
14
+ YzQ0YzZiY2IzNTZjZmQ5NDBjZjBiNWJmNzc1ZmQzY2JjMjFjNDNiNWMwMDgx
15
+ MjdmOTk4ZDNjYWRhNjdiN2E2ZjQ4NzZlNTI5NWI0Nzg1YTE4MmE=
@@ -1,7 +1,6 @@
1
- /*! BigText - v0.1.4 - 2013-08-24
1
+ /*! BigText - v0.1.5 - 2013-08-24
2
2
  * https://github.com/zachleat/BigText
3
- * Copyright (c) 2013 @zachleat; Licensed MIT
4
- */
3
+ * Copyright (c) 2013 @zachleat; Licensed MIT */
5
4
 
6
5
  ;(function(window, $) {
7
6
  var counter = 0,
@@ -16,12 +15,6 @@
16
15
  STYLE_ID: 'bigtext-id',
17
16
  LINE_CLASS_PREFIX: 'bigtext-line',
18
17
  EXEMPT_CLASS: 'bigtext-exempt',
19
- DEFAULT_CHILD_SELECTOR: '> div',
20
- childSelectors: {
21
- div: '> div',
22
- ol: '> li',
23
- ul: '> li'
24
- },
25
18
  noConflict: function(restore)
26
19
  {
27
20
  if(restore) {
@@ -98,18 +91,16 @@
98
91
  options = $.extend({
99
92
  minfontsize: BigText.DEFAULT_MIN_FONT_SIZE_PX,
100
93
  maxfontsize: BigText.DEFAULT_MAX_FONT_SIZE_PX,
101
- childSelector: '',
94
+ childSelector: '',
102
95
  resize: true
103
96
  }, options || {});
104
97
 
105
98
  return this.each(function()
106
99
  {
107
100
  var $t = $(this).addClass('bigtext'),
108
- childSelector = options.childSelector ||
109
- BigText.childSelectors[this.tagName.toLowerCase()] ||
110
- BigText.DEFAULT_CHILD_SELECTOR,
111
101
  maxWidth = $t.width(),
112
- id = $t.attr('id');
102
+ id = $t.attr('id'),
103
+ $children = options.childSelector ? $t.find( options.childSelector ) : $t.children();
113
104
 
114
105
  if(!id) {
115
106
  id = 'bigtext-id' + (counter++);
@@ -126,14 +117,14 @@
126
117
 
127
118
  BigText.clearCss(id);
128
119
 
129
- $t.find(childSelector).addClass(function(lineNumber, className)
120
+ $children.addClass(function(lineNumber, className)
130
121
  {
131
122
  // remove existing line classes.
132
123
  return [className.replace(new RegExp('\\b' + BigText.LINE_CLASS_PREFIX + '\\d+\\b'), ''),
133
124
  BigText.LINE_CLASS_PREFIX + lineNumber].join(' ');
134
125
  });
135
126
 
136
- var sizes = calculateSizes($t, childSelector, maxWidth, options.maxfontsize, options.minfontsize);
127
+ var sizes = calculateSizes($t, $children, maxWidth, options.maxfontsize, options.minfontsize);
137
128
  $headCache.append(BigText.generateCss(id, sizes.fontSizes, sizes.wordSpacings, sizes.minFontSizes));
138
129
  });
139
130
  }
@@ -141,8 +132,8 @@
141
132
 
142
133
  function testLineDimensions($line, maxWidth, property, size, interval, units, previousWidth)
143
134
  {
144
- var width,
145
- previousWidth = typeof previousWidth == 'number' ? previousWidth : 0;
135
+ var width;
136
+ previousWidth = typeof previousWidth == 'number' ? previousWidth : 0;
146
137
  $line.css(property, size + units);
147
138
 
148
139
  width = $line.width();
@@ -173,7 +164,7 @@
173
164
  return width;
174
165
  }
175
166
 
176
- function calculateSizes($t, childSelector, maxWidth, maxFontSize, minFontSize)
167
+ function calculateSizes($t, $children, maxWidth, maxFontSize, minFontSize)
177
168
  {
178
169
  var $c = $t.clone(true)
179
170
  .addClass('bigtext-cloned')
@@ -196,7 +187,7 @@
196
187
  minFontSizes = [],
197
188
  ratios = [];
198
189
 
199
- $c.find(childSelector).css('float', 'left').each(function(lineNumber) {
190
+ $children.css('float', 'left').each(function(lineNumber) {
200
191
  var $line = $(this),
201
192
  // TODO replace 8, 4 with a proportional size to the calculated font-size.
202
193
  intervals = BigText.test.noFractionalFontSize ? [8, 4, 1] : [8, 4, 1, 0.1],
@@ -1,3 +1,3 @@
1
1
  module BigtextjsRails
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigtextjs_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
5
- prerelease:
4
+ version: 0.1.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Guy Israeli
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-09-08 00:00:00.000000000 Z
11
+ date: 2013-10-21 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: railties
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -77,26 +70,25 @@ files:
77
70
  homepage: ''
78
71
  licenses:
79
72
  - MIT
73
+ metadata: {}
80
74
  post_install_message:
81
75
  rdoc_options: []
82
76
  require_paths:
83
77
  - lib
84
78
  required_ruby_version: !ruby/object:Gem::Requirement
85
- none: false
86
79
  requirements:
87
80
  - - ! '>='
88
81
  - !ruby/object:Gem::Version
89
82
  version: '0'
90
83
  required_rubygems_version: !ruby/object:Gem::Requirement
91
- none: false
92
84
  requirements:
93
85
  - - ! '>='
94
86
  - !ruby/object:Gem::Version
95
87
  version: '0'
96
88
  requirements: []
97
89
  rubyforge_project:
98
- rubygems_version: 1.8.24
90
+ rubygems_version: 2.1.3
99
91
  signing_key:
100
- specification_version: 3
92
+ specification_version: 4
101
93
  summary: BigText Makes Text Big. This gem will help you do it the rails way.
102
94
  test_files: []