autonumeric-rails 0.1.9.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ //= require autoNumeric-1.9.15.js
2
+ //= require autonumeric_ujs.js
@@ -0,0 +1,53 @@
1
+ /**
2
+ * autonumeric_ujs.js
3
+ * @author: randoum
4
+ * @version: 0.1.9.15 - 2013-08-17
5
+ *
6
+ * Created by Robert J. Knothe on 2010-10-25. Please report any bugs to https://github.com/randoum/autonumeric-rails
7
+ *
8
+ * Wrap-up autoNumeric.js library to be used with Rails in a UJS flavor
9
+ * All credits for autoNumeric library goes to its original creators
10
+ * Whom can be reached at https://github.com/BobKnothe/autoNumeric
11
+ *
12
+ * The MIT License (http://www.opensource.org/licenses/mit-license.php)
13
+ *
14
+ * Permission is hereby granted, free of charge, to any person
15
+ * obtaining a copy of this software and associated documentation
16
+ * files (the "Software"), to deal in the Software without
17
+ * restriction, including without limitation the rights to use,
18
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ * copies of the Software, and to permit persons to whom the
20
+ * Software is furnished to do so, subject to the following
21
+ * conditions:
22
+ *
23
+ * The above copyright notice and this permission notice shall be
24
+ * included in all copies or substantial portions of the Software.
25
+ *
26
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
28
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
30
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
31
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
32
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
33
+ * OTHER DEALINGS IN THE SOFTWARE.
34
+ */
35
+
36
+ jQuery(function() {
37
+ var auto_numeric_init, update_numeric_value;
38
+ update_numeric_value = function(input) {
39
+ return input.next().val(input.autoNumeric('get'));
40
+ };
41
+ auto_numeric_init = function(input) {
42
+ var hidden;
43
+ hidden = $('<input>').attr('type', 'hidden').attr('id', input.attr('id') + '_val').attr('name', input.attr('name'));
44
+ hidden.insertAfter(input);
45
+ input.autoNumeric('init', $.parseJSON(input.attr('data-autonumeric')));
46
+ return input.on('keyup', function() {
47
+ return update_numeric_value(input);
48
+ });
49
+ };
50
+ return $('input[data-autonumeric]').each(function() {
51
+ return auto_numeric_init($(this));
52
+ });
53
+ });
metadata ADDED
@@ -0,0 +1,108 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: autonumeric-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.9.15
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - randoum
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-08-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: jquery-rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 2.0.2
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 2.0.2
30
+ - !ruby/object:Gem::Dependency
31
+ name: bundler
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '1.3'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '1.3'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ description: Rails ready-to-use autoNumeric.js library that automatically formats
63
+ currency and numbers. All credits goes to the library creator BobKnothe
64
+ email:
65
+ - randoum@gmail.com
66
+ executables: []
67
+ extensions: []
68
+ extra_rdoc_files: []
69
+ files:
70
+ - .gitignore
71
+ - Gemfile
72
+ - LICENSE.txt
73
+ - README.md
74
+ - Rakefile
75
+ - autonumeric-rails.gemspec
76
+ - lib/autonumeric-rails.rb
77
+ - lib/autonumeric/rails.rb
78
+ - lib/autonumeric/rails/engine.rb
79
+ - lib/autonumeric/rails/version.rb
80
+ - vendor/assets/javascripts/autoNumeric-1.9.15.js
81
+ - vendor/assets/javascripts/autonumeric.js
82
+ - vendor/assets/javascripts/autonumeric_ujs.js
83
+ homepage: https://github.com/randoum/autonumeric-rails
84
+ licenses:
85
+ - MIT
86
+ post_install_message:
87
+ rdoc_options: []
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ! '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ requirements: []
103
+ rubyforge_project:
104
+ rubygems_version: 1.8.23
105
+ signing_key:
106
+ specification_version: 3
107
+ summary: Wrap autoNumeric.js library ready-to-use for rails
108
+ test_files: []