effective_bootstrap 0.9.13 → 0.9.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/effective_bootstrap.js +1 -0
- data/app/assets/javascripts/effective_password/initialize.js.coffee +9 -0
- data/app/assets/javascripts/effective_password/input.js +1 -0
- data/app/models/effective/form_inputs/password_field.rb +16 -2
- data/lib/effective_bootstrap/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e313590d625cda7f01ce3ef74c94b204bd8459dc59d7d416dae88766756307bc
|
4
|
+
data.tar.gz: a16aea2233b4a3ad497017b73383af5223fcf1b112670135ed900eff7266a115
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d805f8d09225797f736d6fb82d762b0f592eeeda68fb02a0e3769675deea349dae569c3081bbdbfa52944156af3500a2b56007fc6f9bb4b79ce6f9d3fdfe987
|
7
|
+
data.tar.gz: dd2d509c84b4eea2fac7135ed105cb7971fe4a7a4c59b85a084fe2463627145a751eaa4b43d3a1101e1ab3af5244544d86bac05f7efed1f5846bc5664f122843
|
@@ -18,6 +18,7 @@
|
|
18
18
|
//= require ./effective_has_many/input
|
19
19
|
//= require ./effective_integer/input
|
20
20
|
//= require ./effective_number_text/input
|
21
|
+
//= require ./effective_password/input
|
21
22
|
//= require ./effective_percent/input
|
22
23
|
//= require ./effective_phone/input
|
23
24
|
//= require ./effective_price/input
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# Prevent non-currency buttons from being pressed
|
2
|
+
$(document).on 'click', 'button[data-effective-password]', (event) ->
|
3
|
+
$obj = $(event.currentTarget)
|
4
|
+
$input = $obj.closest('.input-group')
|
5
|
+
|
6
|
+
$input.find('input').attr('type', $obj.data('effective-password'))
|
7
|
+
$input.find('button[data-effective-password]').toggle()
|
8
|
+
|
9
|
+
false
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require ./initialize
|
@@ -3,11 +3,25 @@ module Effective
|
|
3
3
|
class PasswordField < Effective::FormInput
|
4
4
|
|
5
5
|
def input_html_options
|
6
|
-
{ class: 'form-control', id: tag_id }
|
6
|
+
{ class: 'form-control effective_password', id: tag_id }
|
7
7
|
end
|
8
8
|
|
9
9
|
def input_group_options
|
10
|
-
{ input_group: { class: 'input-group' },
|
10
|
+
{ input_group: { class: 'input-group' }, append: eyes }
|
11
|
+
end
|
12
|
+
|
13
|
+
def eyes
|
14
|
+
content_tag(:button, icon('eye'),
|
15
|
+
class: 'btn input-group-text',
|
16
|
+
title: 'Show password',
|
17
|
+
'data-effective-password': 'text'
|
18
|
+
) +
|
19
|
+
content_tag(:button, icon('eye-off'),
|
20
|
+
class: 'btn input-group-text',
|
21
|
+
title: 'Hide password',
|
22
|
+
style: 'display: none;',
|
23
|
+
'data-effective-password': 'password'
|
24
|
+
)
|
11
25
|
end
|
12
26
|
|
13
27
|
def feedback_options
|
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.9.
|
4
|
+
version: 0.9.14
|
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: 2021-02-
|
11
|
+
date: 2021-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -440,6 +440,8 @@ files:
|
|
440
440
|
- app/assets/javascripts/effective_integer/input.js
|
441
441
|
- app/assets/javascripts/effective_number_text/initialize.js.coffee
|
442
442
|
- app/assets/javascripts/effective_number_text/input.js
|
443
|
+
- app/assets/javascripts/effective_password/initialize.js.coffee
|
444
|
+
- app/assets/javascripts/effective_password/input.js
|
443
445
|
- app/assets/javascripts/effective_percent/initialize.js.coffee
|
444
446
|
- app/assets/javascripts/effective_percent/input.js
|
445
447
|
- app/assets/javascripts/effective_phone/initialize.js.coffee
|