growlyflash 0.2.3 → 0.2.4
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 +63 -47
- data/lib/growlyflash/version.rb +1 -1
- data/vendor/assets/javascripts/growlyflash/bootstrap-growl.js.coffee +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56deb9cbbac30d22733c75fc5ca05b30f9aca062
|
4
|
+
data.tar.gz: 25297a9aca94d986447afa8bed4d6c0052f70aca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20e7c850bbd303165ba55e3f07e2d843b87dbe3ef33a1987683969a280c10e286ad689748c8c70a89db0312247595fb1c801ab476a2a627ecfe43c4c4f255cb9
|
7
|
+
data.tar.gz: 4beb7817bdb5525b372f11e9d8c30f40f68dd314e20b0675e36de61299c0ede295dc5071da4c587476f0d603a74215e2009b0df6f541b5b9dc534a05ba02ba07
|
data/README.md
CHANGED
@@ -9,60 +9,76 @@ Based on rewritten in coffeescript [Bootstrap Growl](https://github.com/ifightcr
|
|
9
9
|
## Installation
|
10
10
|
|
11
11
|
Add this line to your application's Gemfile:
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
````ruby
|
13
|
+
gem 'growlyflash'
|
14
|
+
````
|
15
15
|
And then execute:
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
````
|
17
|
+
$ bundle
|
18
|
+
````
|
19
19
|
For non-XHR requests append the following before other javascripts inside `<head>`:
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
````erb
|
21
|
+
<%= growlyflash_static_notices %>
|
22
|
+
````
|
23
23
|
And require glowlyflash in `app/assets/javascripts/application.js`
|
24
|
-
|
25
|
-
|
24
|
+
````js
|
25
|
+
//= require growlyflash/growlyflash
|
26
|
+
````
|
26
27
|
|
27
28
|
## Customize
|
28
29
|
|
29
30
|
If you want to change default options, you can override them somewhere in your coffee/js:
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
31
|
+
````coffee
|
32
|
+
$.bootstrapGrowl.defaults = $.extend on, $.bootstrapGrowl.defaults,
|
33
|
+
# Box width (number or css-like string, etc. "auto")
|
34
|
+
width: 250
|
35
|
+
|
36
|
+
# Auto-dismiss timeout. Set it to 0 if you want to disable auto-dismiss
|
37
|
+
delay: 4000
|
38
|
+
|
39
|
+
# Spacing between boxes in stack
|
40
|
+
spacing: 10
|
41
|
+
|
42
|
+
# Appends boxes to a specific container
|
43
|
+
target: 'body'
|
44
|
+
|
45
|
+
# Show close button
|
46
|
+
dismiss: true
|
47
|
+
|
48
|
+
# Default class suffix for alert boxes.
|
49
|
+
# Use the following mapping (Flash key => Bootstrap Alert)
|
50
|
+
# warning: null
|
51
|
+
# error: "error"
|
52
|
+
# notice: "info"
|
53
|
+
# success: "success"
|
54
|
+
type: null
|
55
|
+
|
56
|
+
# Horizontal aligning (left, right or center)
|
57
|
+
align: 'right'
|
58
|
+
|
59
|
+
# Margin from the closest side
|
60
|
+
alignAmount: 20
|
61
|
+
|
62
|
+
# Offset from window bounds
|
63
|
+
offset:
|
64
|
+
from: 'top'
|
65
|
+
amount: 20
|
66
|
+
````
|
67
|
+
|
68
|
+
Insert the following if you want to close alert boxes by clicking on themselves.
|
69
|
+
Also it doesn't steel focus from toggled elements like dropdowns and works fine with touch devices,
|
70
|
+
so I advise to use it:
|
71
|
+
````coffee
|
72
|
+
jQuery ->
|
73
|
+
# ...
|
74
|
+
$(document).on 'click.alert.data-api', '[data-dismiss="alert"]', (e) ->
|
75
|
+
e.stopPropagation()
|
76
|
+
|
77
|
+
$(document).on 'touchstart click', ".bootstrap-growl", (e) ->
|
78
|
+
e.stopPropagation()
|
79
|
+
$('[data-dismiss="alert"]', @).click()
|
80
|
+
off
|
81
|
+
````
|
66
82
|
|
67
83
|
## Contributing
|
68
84
|
|
data/lib/growlyflash/version.rb
CHANGED
@@ -17,7 +17,7 @@ do ($ = jQuery) ->
|
|
17
17
|
alignAmount = css_metrics_val alignAmount
|
18
18
|
|
19
19
|
box_alert = $ """
|
20
|
-
<div class="#{alert_classes_add
|
20
|
+
<div class="#{alert_classes_add(type).join(" ")}">
|
21
21
|
#{'<a class="close" data-dismiss="alert" href="#">×</a>' if dismiss}
|
22
22
|
#{message}
|
23
23
|
</div>
|