jquery-inputfit-rails 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 443497deb8ddf96d52ab613215762d815e9ecc57
4
- data.tar.gz: 03c90303006f90b2171bdbebc97458f5e57e0bc0
3
+ metadata.gz: 86e148ae9c078f14210d61eb5f3028687083d508
4
+ data.tar.gz: ae931e937bf374b7ccd76594b7db50744498bcda
5
5
  SHA512:
6
- metadata.gz: e278c856d1ea48e8db17fe110e3836e59a8b838c763f20dcb27b5e502645ed7c84c70737cabc756adefcc0e928204ad28c3a7a998bb3b15df9f071400ce0a339
7
- data.tar.gz: fd06d9bd589203654e820c34525725b380d2454079352560a07157ee023edad9915334005fb4a4fe59f549ec082dff79e7a30b53fa2dd3411e492ba92cf4d72b
6
+ metadata.gz: 36db5512ae14fb604bb08bff8a6c2b3d5c5e24a0b759d1a5024be8a3b67082ba4f21a6dffc82800e998d3bc40d4cb227fa1e534f5766308a3a2150315fa317e8
7
+ data.tar.gz: 335f6ac413e818b93be755a58c91c3d9b26a0314aafdc1a9cbedbf42a0eaef9f9482ee0036d4cc490e23ab19984f811a43dc48eb5efe097deec1b84e7f383c95
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'jquery/inputfit/rails/version'
4
+ require "jquery-inputfit-rails/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "jquery-inputfit-rails"
@@ -0,0 +1,9 @@
1
+ require "jquery-inputfit-rails/version"
2
+
3
+ module Jquery
4
+ module Inputfit
5
+ module Rails
6
+ require "jquery-inputfit-rails/engine"
7
+ end
8
+ end
9
+ end
@@ -1,7 +1,7 @@
1
1
  module Jquery
2
2
  module Inputfit
3
3
  module Rails
4
- VERSION = "1.0.0"
4
+ VERSION = "1.1.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-inputfit-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lenda
@@ -51,10 +51,9 @@ files:
51
51
  - README.md
52
52
  - Rakefile
53
53
  - jquery-inputfit-rails.gemspec
54
- - jquery.inputfit.js
55
- - lib/jquery/inputfit/rails.rb
56
- - lib/jquery/inputfit/rails/engine.rb
57
- - lib/jquery/inputfit/rails/version.rb
54
+ - lib/jquery-inputfit-rails.rb
55
+ - lib/jquery-inputfit-rails/engine.rb
56
+ - lib/jquery-inputfit-rails/version.rb
58
57
  - vendor/assets/javascripts/README.markdown
59
58
  - vendor/assets/javascripts/jquery.inputfit.js
60
59
  homepage: ''
data/jquery.inputfit.js DELETED
@@ -1,64 +0,0 @@
1
- /*global define:true */
2
- (function (factory) {
3
- if (typeof define === 'function' && define.amd) {
4
- // AMD. Register as an anonymous module.
5
- define(['jquery'], factory);
6
- } else {
7
- // Browser globals
8
- factory(jQuery);
9
- }
10
- }(function ($) {
11
- $.fn.inputfit = function(options) {
12
- var settings = $.extend({
13
- minSize : 10,
14
- maxSize : false
15
- }, options);
16
-
17
- this.each(function() {
18
- var $input = $(this);
19
-
20
- if ( !$input.is(':input') ) {
21
- return;
22
- }
23
-
24
- $input.off('keyup.infputfit keydown.inputfit');
25
-
26
- var maxSize = parseFloat(settings.maxSize || $input.css('font-size'), 10);
27
- var width = $input.width();
28
- var clone = $input.data('inputfit-clone');
29
-
30
- if (!clone) {
31
- clone = $('<div></div>', {
32
- css : {
33
- fontSize : $input.css('font-size'),
34
- fontFamily : $input.css('font-family'),
35
- position : 'absolute',
36
- left : '-9999px',
37
- visibility : 'hidden'
38
- }
39
- }).insertAfter($input);
40
-
41
- $input.data('inputfit-clone', clone);
42
- }
43
-
44
- $input.on('keyup.inputfit keydown.inputfit', function() {
45
- var $this = $(this);
46
-
47
- clone.html($this.val().replace(/ /g, '&nbsp;'));
48
-
49
- var ratio = width / (clone.width() || 1),
50
- currentFontSize = parseInt( $this.css('font-size'), 10 ),
51
- fontSize = Math.floor(currentFontSize * ratio);
52
-
53
- if (fontSize > maxSize) { fontSize = maxSize; }
54
- if (fontSize < settings.minSize) { fontSize = settings.minSize; }
55
-
56
- $this.css('font-size', fontSize);
57
- clone.css('font-size', fontSize);
58
- });
59
- });
60
-
61
- return this;
62
- };
63
-
64
- }));
@@ -1,9 +0,0 @@
1
- require "jquery/inputfit/rails/version"
2
-
3
- module Jquery
4
- module Inputfit
5
- module Rails
6
- # Your code goes here...
7
- end
8
- end
9
- end