growlyflash 0.1.3 → 0.1.5
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
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzVlZDcwMDJhN2Y3ZWViNzA5ODkzYTUxMzg0YmUyZGM0ZGQ3NGVhNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTI2Nzc3ZDhjODMwODlhODJkYWEyNDQ1MWI0YWQ0OTUzYjBlOGYzZg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjM4OTMxNjMwNjQ2YjNjZGM1NjZkNmI4NDVjMTdiYTE0MDljZGRmMDVlN2Zj
|
10
|
+
MjE1OTkzMWE3NmM3NmI1YmJkODFlMWZiNTgyMzc3N2FjMDkxODFmNTMyYmMy
|
11
|
+
NmI1N2EwYzE2YjU3YTkzNzgyNTIzMjU3YmM5ZTk5Mzk0MjQ3YzY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZmNlYjVhOGIwY2NmYjJkNzcwZGMxMGI3MmE1M2ViY2I2NjNkYWZhNjc3NjZi
|
14
|
+
NDBiNTNjMjM3ZWQyMmRlMGViYWM3MDFmZTljNzQwNzMzYWQ5NjM3NjU3ODQz
|
15
|
+
ZmZjMWU0MjlmYTY5OTkxMTk2MDFjNWIwOTIzZWFlYjRmMGM1YzI=
|
data/lib/growlyflash/version.rb
CHANGED
@@ -2,54 +2,63 @@
|
|
2
2
|
|
3
3
|
$ = jQuery
|
4
4
|
|
5
|
-
$.
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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
|
-
|
5
|
+
old = $.bootstrapGrowl
|
6
|
+
|
7
|
+
$.bootstrapGrowl = (message, options) ->
|
8
|
+
settings = $.extend {}, $.bootstrapGrowl.defaults, options
|
9
|
+
|
10
|
+
html_attrs =
|
11
|
+
class: 'bootstrap-growl alert'
|
12
|
+
html: ''
|
13
|
+
html_attrs.class += " alert-#{settings.type}" if settings.type?
|
14
|
+
html_attrs.html += """<a class="close" data-dismiss="alert" href="#">×</a>""" if settings.can_dismiss
|
15
|
+
html_attrs.html += message
|
16
|
+
|
17
|
+
DivAlert = $ '<div />', html_attrs
|
18
|
+
|
19
|
+
# calculate any 'stack-up'
|
20
|
+
offset = settings.offset.amount
|
21
|
+
$(".bootstrap-growl").each ->
|
22
|
+
offset_from = parseInt $(@).css settings.offset.from
|
23
|
+
height = $(@).outerHeight()
|
24
|
+
offset = Math.max offset, offset_from + height + settings.spacing
|
25
|
+
|
26
|
+
DivAlert.css
|
27
|
+
position: (if settings.target is 'body' then 'fixed' else 'absolute')
|
28
|
+
margin: 0
|
29
|
+
zIndex: 9999
|
30
|
+
display: 'none'
|
31
|
+
width: (if settings.width isnt 'auto' then "#{settings.width}px" else 'auto')
|
32
|
+
|
33
|
+
DivAlert.css settings.offset.from, "#{offset}px"
|
34
|
+
|
35
|
+
# have to append before we can use outerWidth()
|
36
|
+
$(settings.target).append DivAlert
|
37
|
+
|
38
|
+
DivAlert.css switch settings.align
|
39
|
+
when "center" then left: '50%', marginLeft:"-#{DivAlert.outerWidth() / 2}px"
|
40
|
+
when "left" then left: '20px'
|
41
|
+
else right: '20px'
|
42
|
+
DivAlert.fadeIn()
|
43
|
+
|
44
|
+
# Only remove after delay if delay is more than 0
|
45
|
+
if settings.delay > 0
|
46
|
+
DivAlert.delay(settings.delay).fadeOut -> $(@).remove()
|
47
|
+
|
48
|
+
@
|
49
|
+
|
50
|
+
$.bootstrapGrowl.defaults =
|
51
|
+
width: 250
|
52
|
+
delay: 4000
|
53
|
+
spacing: 10
|
54
|
+
target: 'body'
|
55
|
+
align: 'right'
|
56
|
+
dismiss: true
|
57
|
+
type: null
|
58
|
+
offset:
|
59
|
+
from: 'top'
|
60
|
+
amount: 20
|
61
|
+
|
62
|
+
$.bootstrapGrowl.noConflict = ->
|
63
|
+
$.bootstrapGrowl = old
|
64
|
+
@
|
@@ -45,12 +45,12 @@ class Growlyflash
|
|
45
45
|
do callback
|
46
46
|
|
47
47
|
get_log_matches: (messages) ->
|
48
|
-
last_log = @
|
48
|
+
last_log = @flash_log.slice -messages.length
|
49
49
|
not_matches = 0
|
50
50
|
not_matches++ for id, f of messages when (last_log[id].type isnt f.type) and (last_log[id].msg isnt f.msg)
|
51
51
|
not_matches > 0
|
52
52
|
|
53
53
|
root.Growlyflash = Growlyflash
|
54
54
|
|
55
|
-
|
55
|
+
$ ->
|
56
56
|
new Growlyflash document
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: growlyflash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tõnis Simo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|