growlyflash 0.9.0 → 0.9.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: b13904ea56914736cdd2141a68c98ef33a39f90a
|
|
4
|
+
data.tar.gz: 227479133bbdb273df4547bcacb9a4efbbbd1eb0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 293951b1d18f476e9dd672b0147edb72839cfa5a30144506abe703bd5ad071dc8f2aa5121eb9e1f6754e2cf5c061ffa688c886f156158e6e48f3fe8290201af8
|
|
7
|
+
data.tar.gz: 0f3d80028d5c4da312d81c5a28fe1bd920b47c1c0bf079b8e0c80aaa1744c90bb91d78918114326786eedf3ca6272ef101fe6c0ca46060add66d00aa587d098f
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class Growlyflash
|
|
1
|
+
class @Growlyflash
|
|
2
2
|
@debug = off
|
|
3
3
|
|
|
4
4
|
@defaults =
|
|
@@ -48,7 +48,7 @@ class Growlyflash
|
|
|
48
48
|
html += @flash.msg
|
|
49
49
|
|
|
50
50
|
@el = ($ '<div>', html: html, class: @class_list().join(' '), role: "alert")
|
|
51
|
-
@el.appendTo(target)
|
|
51
|
+
@el = @el.appendTo(($ target))
|
|
52
52
|
|
|
53
53
|
before_show?.call(this)
|
|
54
54
|
|
|
@@ -95,5 +95,4 @@ class Growlyflash
|
|
|
95
95
|
Growlyflash[name] ?= Growlyflash[type]
|
|
96
96
|
return
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
jQuery.growlyflash = Growlyflash.growl
|
|
98
|
+
jQuery.growlyflash = Growlyflash.growl
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class Listener
|
|
2
2
|
# Alerts stack
|
|
3
3
|
class Stack
|
|
4
4
|
constructor: (@items...) ->
|
|
@@ -20,7 +20,7 @@ class Growlyflash.Listener
|
|
|
20
20
|
do @purge
|
|
21
21
|
|
|
22
22
|
@HEADER = 'X-Message'
|
|
23
|
-
@EVENTS = 'ajax:complete ajaxComplete
|
|
23
|
+
@EVENTS = 'ajax:complete ajaxComplete'
|
|
24
24
|
|
|
25
25
|
process = (alerts = {}) ->
|
|
26
26
|
new Growlyflash.FlashStruct(msg, type) for type, msg of alerts when msg?
|
|
@@ -33,12 +33,15 @@ class Growlyflash.Listener
|
|
|
33
33
|
@stack ?= new Stack()
|
|
34
34
|
@process_static() if window.flashes?
|
|
35
35
|
($ context).on Growlyflash.Listener.EVENTS, (event, xhr) =>
|
|
36
|
-
xhr ?= event.data?.xhr
|
|
37
|
-
|
|
36
|
+
if xhr ?= event.data?.xhr
|
|
37
|
+
source = process_from_header(xhr.getResponseHeader(Growlyflash.Listener.HEADER))
|
|
38
|
+
@stack.push_only_fresh source
|
|
39
|
+
return
|
|
38
40
|
|
|
39
41
|
process_static: ->
|
|
40
42
|
@stack.push alert for alert in process(window.flashes)
|
|
41
43
|
delete window.flashes
|
|
42
44
|
|
|
43
|
-
Growlyflash.
|
|
44
|
-
|
|
45
|
+
@Growlyflash.Listener = Listener
|
|
46
|
+
@Growlyflash.listen_on = (context) ->
|
|
47
|
+
@listener ?= new @Listener(context)
|
data/lib/growlyflash/version.rb
CHANGED
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.9.
|
|
4
|
+
version: 0.9.1
|
|
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: 2016-
|
|
11
|
+
date: 2016-09-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: railties
|