growlyflash 0.8.4.0 → 0.8.4.1
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,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8feae49b8595f4450a28aaa0c3d78befae607609
|
|
4
|
+
data.tar.gz: 9cb7b7f1387caacf5297fbb976638058d49d0b79
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 50817b9f599f084f651c044fad1c29ba93f625fd25e923203124c3e6d447000fdd05acfb826a3c838d54b741b8b78fc8b3db0354642ac5dc29d17d56b869a60b
|
|
7
|
+
data.tar.gz: cdf2aa06206d373b2068855662dfcbf8b0c309b4312efd8bdff7e869391b41fcb38cfdb75df4262c82797bf5be5c9bbbc40cc35b4f51bdd43d8c978d39ca581b
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
class Growlyflash
|
|
2
|
+
@debug = off
|
|
3
|
+
|
|
2
4
|
@defaults =
|
|
3
5
|
align: 'right' # horizontal aligning (left, right or center)
|
|
4
6
|
delay: 4000 # auto-dismiss timeout (false to disable auto-dismiss)
|
|
@@ -49,6 +51,9 @@ class Growlyflash
|
|
|
49
51
|
@el.appendTo(target)
|
|
50
52
|
|
|
51
53
|
before_show?.call(this)
|
|
54
|
+
|
|
55
|
+
console.debug(@flash) if Growlyflash.debug
|
|
56
|
+
|
|
52
57
|
@show()
|
|
53
58
|
setTimeout(@close, @opts.delay) if delay
|
|
54
59
|
|
|
@@ -60,7 +65,9 @@ class Growlyflash
|
|
|
60
65
|
add 'growlyflash', @opts.align if @opts.align?
|
|
61
66
|
list
|
|
62
67
|
|
|
63
|
-
show:
|
|
68
|
+
show: =>
|
|
69
|
+
@el.toggleClass('in', on)
|
|
70
|
+
|
|
64
71
|
close: =>
|
|
65
72
|
@el.fadeOut(=> @el.remove())
|
|
66
73
|
|
|
@@ -75,7 +82,7 @@ class Growlyflash
|
|
|
75
82
|
css.marginLeft = "-#{@el.outerWidth() / 2}px" if @opts.align is 'center'
|
|
76
83
|
css
|
|
77
84
|
|
|
78
|
-
@
|
|
85
|
+
@growl = (flash, options = {}) ->
|
|
79
86
|
options = $.extend(on, {}, Growlyflash.defaults, type: flash.type, options)
|
|
80
87
|
alert = new Growlyflash.Alert(flash, options)
|
|
81
88
|
if flash instanceof Growlyflash.FlashStruct then flash else alert
|
|
@@ -83,10 +90,10 @@ class Growlyflash
|
|
|
83
90
|
@build_shorthands = ->
|
|
84
91
|
for type, name of @KEY_MAPPING
|
|
85
92
|
Growlyflash[type] ?= (msg) ->
|
|
86
|
-
Growlyflash.
|
|
93
|
+
Growlyflash.growl(new Growlyflash.FlashStruct(msg, type))
|
|
87
94
|
if name isnt type
|
|
88
95
|
Growlyflash[name] ?= Growlyflash[type]
|
|
89
96
|
return
|
|
90
97
|
|
|
91
98
|
window.Growlyflash = Growlyflash
|
|
92
|
-
jQuery.growlyflash = Growlyflash.
|
|
99
|
+
jQuery.growlyflash = Growlyflash.growl
|
|
@@ -7,8 +7,10 @@ class Growlyflash.Listener
|
|
|
7
7
|
setTimeout (=> @items.splice(0)), 100
|
|
8
8
|
|
|
9
9
|
push: (alert, dumped) ->
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
dumped ?= alert.toString()
|
|
11
|
+
console.log("Add to Growlyflash stack: ", dumped) if Growlyflash.debug
|
|
12
|
+
Growlyflash.growl(alert)
|
|
13
|
+
@items.push(dumped)
|
|
12
14
|
|
|
13
15
|
push_only_fresh: (alerts) ->
|
|
14
16
|
recent = @items[-alerts.length..]
|
data/lib/growlyflash/version.rb
CHANGED