flash_notifier 1.1.0 → 1.1.2
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/README.md +4 -0
- data/lib/flash_notifier/flash_helper.rb +4 -5
- data/lib/flash_notifier/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75944ca872c8b6fc662849cbb654b593915623492328075bf2205dd1ea8702b6
|
4
|
+
data.tar.gz: e5f1862f429f308aad8bf011e7184c9c4ee1972f06fd02e4dd64844456220888
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23e9fda1af08594e39b09d77428a91a38b7284e25a0763a6fe308d349fc2e6790c05a8f4a1fa63c530f212a18e379f969299fbeec3c46eaff98a69075716fd20
|
7
|
+
data.tar.gz: e92df230689dfe367b9d9fdb8ba11aaa336bfb62beef52634e21e8122aac4c0775046bde77e633e270b22e917c4e5f6e31b4763a231faa40bb446a38bfa386b2
|
data/README.md
CHANGED
@@ -31,6 +31,10 @@ You can make the flash dismissible by passing following optional options to the
|
|
31
31
|
<%= build_bootstrap_flash dismiss: true, timeout: 5000 %>
|
32
32
|
|
33
33
|
##### default timeout duration is 5000, ignore this option if you want to use default timeout duration
|
34
|
+
|
35
|
+
You can add your own wrapper class by passing following parameter
|
36
|
+
|
37
|
+
<%= build_bootstrap_flash wrapper_class: 'my-flash-notification' %>
|
34
38
|
|
35
39
|
### For other two libraries follow following steps
|
36
40
|
|
@@ -4,16 +4,15 @@ module FlashHelper
|
|
4
4
|
html = append_options_to_dom options
|
5
5
|
flash.each do |type, message|
|
6
6
|
flash_type = (%w(notice success).include?(type)) ? 'success' : (( %w(alert error).include?(type)) ? 'error' : (%w(warning info).include?(type) ? type : 'info' ))
|
7
|
-
html += content_tag(:div, '' , data: { flash_notifier: 'inside gem', flash_type: flash_type, flash_msg: message })
|
7
|
+
html += content_tag(:div, '' , data: { flash_notifier: 'inside gem', flash_type: flash_type, flash_msg: escape_javascript(message) })
|
8
8
|
end
|
9
9
|
html.html_safe
|
10
10
|
end
|
11
11
|
|
12
12
|
def build_bootstrap_flash *args
|
13
|
-
|
14
|
-
append_options_to_dom options
|
13
|
+
options = extract_args args
|
15
14
|
dismissible = options.has_key?(:dismiss) && options[:dismiss]
|
16
|
-
|
15
|
+
timeout = options.has_key?(:timeout) ? options[:timeout] : 5000
|
17
16
|
alert_klasses = {
|
18
17
|
success: 'alert-success',
|
19
18
|
error: 'alert-danger',
|
@@ -46,4 +45,4 @@ module FlashHelper
|
|
46
45
|
def append_options_to_dom options
|
47
46
|
content_tag(:div, '', data: { flash_notifier_options: options })
|
48
47
|
end
|
49
|
-
end
|
48
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flash_notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fakhir Shad
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-08-
|
12
|
+
date: 2018-08-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|