effective_bootstrap 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/effective_bootstrap.js +1 -0
- data/app/assets/javascripts/effective_integer/initialize.js.coffee +6 -0
- data/app/assets/javascripts/effective_integer/input.js +1 -0
- data/app/models/effective/form_builder.rb +4 -0
- data/app/models/effective/form_inputs/integer_field.rb +15 -0
- data/lib/effective_bootstrap/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e36133d4bd04714251159816617603f61e47c31a
|
|
4
|
+
data.tar.gz: d6d2ad1272f7886879ae0e4d9781cf782e3705f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 225596c3e7f246d8776a877ee7d8ec887c75a0c59a4a67189e45c0f856468ba8d3e287e5dd98fa56ef86c9ceea9d4d4f96d03188908186b582ab9f5976e71ed8
|
|
7
|
+
data.tar.gz: e4373018ef6f173ad14b4ba7a2720b32e0f4e39c4fbd6547cb8cd8f3349916b26d66ff5acd1dc7271b81532c34fd7cd4ba17e2aae44bb5200388d19c539c89fa
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
//= require ./effective_ck_editor/input
|
|
12
12
|
//= require ./effective_editor/input
|
|
13
13
|
//= require ./effective_file/input
|
|
14
|
+
//= require ./effective_integer/input
|
|
14
15
|
//= require ./effective_number_text/input
|
|
15
16
|
//= require ./effective_percent/input
|
|
16
17
|
//= require ./effective_phone/input
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Prevent non-currency buttons from being pressed
|
|
2
|
+
$(document).on 'keydown', "input.effective_integer", (event) ->
|
|
3
|
+
allowed = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
|
|
4
|
+
|
|
5
|
+
if event.key && event.key.length == 1 && event.metaKey == false && allowed.indexOf(event.key) == -1
|
|
6
|
+
event.preventDefault()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//= require ./initialize
|
|
@@ -76,6 +76,10 @@ module Effective
|
|
|
76
76
|
Effective::FormInputs::FormGroup.new(name, options, builder: self).to_html(&block)
|
|
77
77
|
end
|
|
78
78
|
|
|
79
|
+
def integer_field(name, options = {})
|
|
80
|
+
Effective::FormInputs::IntegerField.new(name, options, builder: self).to_html
|
|
81
|
+
end
|
|
82
|
+
|
|
79
83
|
# This is gonna be a post?
|
|
80
84
|
def remote_link_to(name, url, options = {}, &block)
|
|
81
85
|
options[:href] ||= url
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Effective
|
|
2
|
+
module FormInputs
|
|
3
|
+
class IntegerField < Effective::FormInput
|
|
4
|
+
|
|
5
|
+
def build_input(&block)
|
|
6
|
+
@builder.super_text_field(name, options[:input])
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def input_html_options
|
|
10
|
+
{ class: 'form-control effective_integer', autocomplete: 'off' }
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: effective_bootstrap
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Code and Effect
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-04-
|
|
11
|
+
date: 2019-04-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -390,6 +390,8 @@ files:
|
|
|
390
390
|
- app/assets/javascripts/effective_editor/quill.js
|
|
391
391
|
- app/assets/javascripts/effective_file/initialize.js.coffee
|
|
392
392
|
- app/assets/javascripts/effective_file/input.js
|
|
393
|
+
- app/assets/javascripts/effective_integer/initialize.js.coffee
|
|
394
|
+
- app/assets/javascripts/effective_integer/input.js
|
|
393
395
|
- app/assets/javascripts/effective_number_text/initialize.js.coffee
|
|
394
396
|
- app/assets/javascripts/effective_number_text/input.js
|
|
395
397
|
- app/assets/javascripts/effective_percent/initialize.js.coffee
|
|
@@ -452,6 +454,7 @@ files:
|
|
|
452
454
|
- app/models/effective/form_inputs/file_field.rb
|
|
453
455
|
- app/models/effective/form_inputs/float_field.rb
|
|
454
456
|
- app/models/effective/form_inputs/form_group.rb
|
|
457
|
+
- app/models/effective/form_inputs/integer_field.rb
|
|
455
458
|
- app/models/effective/form_inputs/number_field.rb
|
|
456
459
|
- app/models/effective/form_inputs/number_text_field.rb
|
|
457
460
|
- app/models/effective/form_inputs/password_field.rb
|