flowtype-rails 1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: eb92f0d2aabe8a57c39793da52eeff02fb6bccf1
4
+ data.tar.gz: f220a88927599dac862724d5fb0d05ea9f1af5e9
5
+ SHA512:
6
+ metadata.gz: be8ea65afe8163ead9c0998fa430b94cf88cb7f7eb6d87098dabe2680dfd699a7b1b228cad8207bce03b9c2f8fddf5755592fed346a44271642f29341e464f45
7
+ data.tar.gz: 64b70c17321775d01f5306c19ec848171526b47c74594c958c99aa81a608603408501c1c135d20e4ef5ddccb213ee3eb17c546db01872a03ba25840c930ee7f2
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 sijokg
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.
@@ -0,0 +1,25 @@
1
+ # Flowtype::Rails
2
+
3
+ A wraper for [flowtype.js](https://github.com/simplefocus/FlowType.JS)
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'flowtype-rails'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ And then add the following manifest file (application.js)
16
+
17
+ //= require flowtype
18
+
19
+ ## Contributing
20
+
21
+ 1. Fork it
22
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
23
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
24
+ 4. Push to the branch (`git push origin my-new-feature`)
25
+ 5. Create new Pull Request
@@ -0,0 +1,8 @@
1
+ require "flowtype/rails/version"
2
+
3
+ module Flowtype
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ module Flowtype
2
+ module Rails
3
+ VERSION = "1.0"
4
+ end
5
+ end
@@ -0,0 +1,57 @@
1
+ /*
2
+ * If you create a derivative, please leave this text intact:
3
+ *
4
+ * FlowType.JS 1.0
5
+ * Copyright (c) 2013, Simple Focus http://simplefocus.com/
6
+ *
7
+ * FlowType.JS by Simple Focus (http://simplefocus.com/)
8
+ * is licensed under the MIT License. Read a copy of the
9
+ * license in the LICENSE.txt file or at
10
+ * http://choosealicense.com/licenses/mit
11
+ *
12
+ * Thanks to Giovanni Difeterici (http://www.gdifeterici.com/)
13
+ */
14
+
15
+ (function($) {
16
+ $.fn.flowtype = function(options) {
17
+
18
+ // Establish default settings/variables
19
+ // ====================================
20
+ var settings = $.extend({
21
+ maximum : 9999,
22
+ minimum : 1,
23
+ maxFont : 9999,
24
+ minFont : 1,
25
+ fontRatio : 35,
26
+ lineRatio : 1.45
27
+ }, options),
28
+
29
+ // Do the magic math
30
+ // =================
31
+ changes = function(el) {
32
+ var $el = $(el),
33
+ elw = $el.width(),
34
+ width = elw > settings.maximum ? settings.maximum : elw < settings.minimum ? settings.minimum : elw,
35
+ fontBase = width / settings.fontRatio,
36
+ fontSize = fontBase > settings.maxFont ? settings.maxFont : fontBase < settings.minFont ? settings.minFont : fontBase;
37
+
38
+ $el.css({
39
+ 'font-size' : fontSize + 'px',
40
+ 'line-height' : fontSize * settings.lineRatio + 'px'
41
+ });
42
+ };
43
+
44
+ // Make the magic visible
45
+ // ======================
46
+ return this.each(function() {
47
+
48
+ // Context for resize callback
49
+ var that = this;
50
+ // Make changes upon resize
51
+ $(window).resize(function(){changes(that);});
52
+
53
+ // Set changes on load
54
+ changes(this);
55
+ });
56
+ };
57
+ }(jQuery));
metadata ADDED
@@ -0,0 +1,93 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: flowtype-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: '1.0'
5
+ platform: ruby
6
+ authors:
7
+ - sijo k george
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-08-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: railties
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: |2
56
+ flowtype.js is Responsive web typography at its finest: font-size and line-height based on element width.
57
+ This gem easily includes it to use rails asset pipeline.
58
+ email:
59
+ - cijo_k_george@yahoo.co.in
60
+ executables: []
61
+ extensions: []
62
+ extra_rdoc_files: []
63
+ files:
64
+ - lib/flowtype/rails.rb
65
+ - lib/flowtype/rails/version.rb
66
+ - vendor/assets/javascripts/flowtype.js
67
+ - MIT-LICENSE
68
+ - README.md
69
+ homepage: https://github.com/sijokg/flowtype-rails
70
+ licenses:
71
+ - MIT
72
+ metadata: {}
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubyforge_project:
89
+ rubygems_version: 2.0.6
90
+ signing_key:
91
+ specification_version: 4
92
+ summary: flowtype.js javascript library in rails
93
+ test_files: []