fittextjs_rails 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +34 -0
- data/Rakefile +1 -0
- data/app/assets/javascripts/fittext.js +43 -0
- data/fittextjs_rails.gemspec +22 -0
- data/lib/fittextjs_rails.rb +8 -0
- data/lib/fittextjs_rails/version.rb +3 -0
- metadata +94 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NzQyOWFhMzEyZTQzNDQ2NmE5MDFhZDExYzBiMTFiNWY5OTNlYzU2Mw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YzM2ZDJkYzNhNzAwZThjZTQzNDI0ZGE1ZjJhYWFkYjEzMDJhMjljNw==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
M2U0YmFmMGU1MGE1NTRkMmNjYTlhYmRhMDkzYmI2NjBmZWIxMGJhZjBjN2Y0
|
10
|
+
NjM2NTgyMDJiNzc4ZDg1YWQ3YzNjYmFjZmQ4YTViZTY1MDFiM2UzMzM4ZTc3
|
11
|
+
Yzc1YTBiMjVmZTVjYjBjMjNmYWFiYzAzMTczNjE0NzY0OTA3ZGE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MThkYjNkNmQ5MDRlYjQ2MjUyNWE2NGYyYjBjM2RlN2JhYTMyYzNhMGY1N2Uz
|
14
|
+
NGViZTM3OTk1MjNiZGI3ZTA1NWI4MzU5OWJjMTdkNmY5OTQ2ZGViMGNiNmI4
|
15
|
+
MGNhZTY2ZjRhOGE5MDQ4OWIzZTVlNTY2Mzc3NWUzNjI1NjA5Njk=
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Guy Israeli
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# FittextjsRails
|
2
|
+
|
3
|
+
fittextjs_rails wraps the [fittext.js](http://fittextjs.com) library in a rails engine for simple use with the asset pipeline provided by rails 3.1 and up. The gem includes the development (non-minified) source for ease of exploration. the asset pipleline will do the heavy liftin' and minify it for you in production.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'fittextjs_rails'
|
10
|
+
|
11
|
+
Add the following directive to your Javascript manifest file (application.js):
|
12
|
+
|
13
|
+
//= require fittext
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install fittextjs_rails
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
just use it as your would normally would
|
26
|
+
|
27
|
+
## Contributing
|
28
|
+
|
29
|
+
1. Fork it
|
30
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
31
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
32
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
33
|
+
5. Create new Pull Request
|
34
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,43 @@
|
|
1
|
+
/*global jQuery */
|
2
|
+
/*!
|
3
|
+
* FitText.js 1.2
|
4
|
+
*
|
5
|
+
* Copyright 2011, Dave Rupert http://daverupert.com
|
6
|
+
* Released under the WTFPL license
|
7
|
+
* http://sam.zoy.org/wtfpl/
|
8
|
+
*
|
9
|
+
* Date: Thu May 05 14:23:00 2011 -0600
|
10
|
+
*/
|
11
|
+
|
12
|
+
(function( $ ){
|
13
|
+
|
14
|
+
$.fn.fitText = function( kompressor, options ) {
|
15
|
+
|
16
|
+
// Setup options
|
17
|
+
var compressor = kompressor || 1,
|
18
|
+
settings = $.extend({
|
19
|
+
'minFontSize' : Number.NEGATIVE_INFINITY,
|
20
|
+
'maxFontSize' : Number.POSITIVE_INFINITY
|
21
|
+
}, options);
|
22
|
+
|
23
|
+
return this.each(function(){
|
24
|
+
|
25
|
+
// Store the object
|
26
|
+
var $this = $(this);
|
27
|
+
|
28
|
+
// Resizer() resizes items based on the object width divided by the compressor * 10
|
29
|
+
var resizer = function () {
|
30
|
+
$this.css('font-size', Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize)));
|
31
|
+
};
|
32
|
+
|
33
|
+
// Call once to set.
|
34
|
+
resizer();
|
35
|
+
|
36
|
+
// Call on resize. Opera debounces their resize by default.
|
37
|
+
$(window).on('resize.fittext orientationchange.fittext', resizer);
|
38
|
+
|
39
|
+
});
|
40
|
+
|
41
|
+
};
|
42
|
+
|
43
|
+
})( jQuery );
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'fittextjs_rails/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "fittextjs_rails"
|
8
|
+
spec.version = FittextjsRails::VERSION
|
9
|
+
spec.authors = ["Guy Israeli"]
|
10
|
+
spec.description = "Fittext.js as a gem for Rails 3.1+,4"
|
11
|
+
spec.summary = "Fittext is awesome"
|
12
|
+
spec.license = "MIT"
|
13
|
+
|
14
|
+
spec.files = `git ls-files`.split($/)
|
15
|
+
|
16
|
+
spec.require_paths = ["lib"]
|
17
|
+
|
18
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
19
|
+
spec.add_development_dependency "rake"
|
20
|
+
spec.add_dependency "railties", ">=3.1"
|
21
|
+
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fittextjs_rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Guy Israeli
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-09-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: railties
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.1'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.1'
|
55
|
+
description: Fittext.js as a gem for Rails 3.1+,4
|
56
|
+
email:
|
57
|
+
executables: []
|
58
|
+
extensions: []
|
59
|
+
extra_rdoc_files: []
|
60
|
+
files:
|
61
|
+
- .gitignore
|
62
|
+
- Gemfile
|
63
|
+
- LICENSE.txt
|
64
|
+
- README.md
|
65
|
+
- Rakefile
|
66
|
+
- app/assets/javascripts/fittext.js
|
67
|
+
- fittextjs_rails.gemspec
|
68
|
+
- lib/fittextjs_rails.rb
|
69
|
+
- lib/fittextjs_rails/version.rb
|
70
|
+
homepage:
|
71
|
+
licenses:
|
72
|
+
- MIT
|
73
|
+
metadata: {}
|
74
|
+
post_install_message:
|
75
|
+
rdoc_options: []
|
76
|
+
require_paths:
|
77
|
+
- lib
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
requirements: []
|
89
|
+
rubyforge_project:
|
90
|
+
rubygems_version: 2.0.3
|
91
|
+
signing_key:
|
92
|
+
specification_version: 4
|
93
|
+
summary: Fittext is awesome
|
94
|
+
test_files: []
|