growlyflash 0.8.3.1 → 0.8.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18eebe72bd85d6477a46ab8a84219acf31400bb7
4
- data.tar.gz: f7c33a7faebd16427c5708228e8355d8769054f1
3
+ metadata.gz: 81283e4f502073ecbb1484707f9ff26a4fa2e00a
4
+ data.tar.gz: fdf59b0f53b3dc9eb293d0af392b3e9ceb276552
5
5
  SHA512:
6
- metadata.gz: 156b19fd66f51fbda2e7a274b3e8060998b5b6be890fc349ea20156d8bba6d3474202b8baeef9f18d962cca4162361b9865cc671404a9621be8040f5d71e7d56
7
- data.tar.gz: 65deea12fbd8d45c7d9512d23fa8754ec2de6984caa64d2de9769105a9947467b78adbe913ea502ec2ceece4a357223f963ea56d007bd4af78d922012a860e56
6
+ metadata.gz: 542e350891e8e584f7dfe99cf9e4cd240b17e7cff7fb377041cbc0ce5e7bbcfc1866c6a3d4aadfc1c19be773f3feff8886846aec449577b37ff0005155ad3fac
7
+ data.tar.gz: 69f5b86aadac5c245755fc11f465e757d524c918fc4915d710aee1ee1010d3688642a479e19053188dc178ca20f98ea33b2ab6f61c84a07c9a439bf8b321836e
data/README.md CHANGED
@@ -20,7 +20,7 @@ gem 'growlyflash'
20
20
 
21
21
  Require one of the following Growlyflash javascripts depending on your Bootstrap version in `app/assets/javascripts/application.js`:
22
22
 
23
- For Bootsrap 3
23
+ For Bootstrap 3
24
24
 
25
25
  ```js
26
26
  //= require growlyflash
@@ -19,16 +19,6 @@ class Growlyflash
19
19
  notice: 'info'
20
20
  success: 'success'
21
21
 
22
- _build_shorthand = (type) -> (msg) ->
23
- $.growlyflash(new Growlyflash.FlashStruct(msg, type))
24
-
25
- @build_shorthands = ->
26
- for type, name of @KEY_MAPPING
27
- Growlyflash[type] ?= _build_shorthand(type)
28
- if name isnt type
29
- Growlyflash[name] ?= Growlyflash[type]
30
- return
31
-
32
22
  @DISMISS = """<button type="close" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>"""
33
23
 
34
24
  _titleize = (s) -> s.replace /^./, (m) -> do m.toUpperCase
@@ -85,9 +75,18 @@ class Growlyflash
85
75
  css.marginLeft = "-#{@el.outerWidth() / 2}px" if @opts.align is 'center'
86
76
  css
87
77
 
88
- window.Growlyflash = Growlyflash
78
+ @alert = (flash, options = {}) ->
79
+ options = $.extend(on, {}, Growlyflash.defaults, type: flash.type, options)
80
+ alert = new Growlyflash.Alert(flash, options)
81
+ if flash instanceof Growlyflash.FlashStruct then flash else alert
89
82
 
90
- $.growlyflash = (flash, options = {}) ->
91
- options = $.extend on, {}, Growlyflash.defaults, type: flash.type, options
92
- alert = new Growlyflash.Alert(flash, options)
93
- if flash instanceof Growlyflash.FlashStruct then flash else alert
83
+ @build_shorthands = ->
84
+ for type, name of @KEY_MAPPING
85
+ Growlyflash[type] ?= (msg) ->
86
+ Growlyflash.alert(new Growlyflash.FlashStruct(msg, type))
87
+ if name isnt type
88
+ Growlyflash[name] ?= Growlyflash[type]
89
+ return
90
+
91
+ window.Growlyflash = Growlyflash
92
+ jQuery.growlyflash = Growlyflash.alert
@@ -7,7 +7,7 @@ class Growlyflash.Listener
7
7
  setTimeout (=> @items.splice(0)), 100
8
8
 
9
9
  push: (alert, dumped) ->
10
- $.growlyflash(alert)
10
+ Growlyflash.alert(alert)
11
11
  @items.push(dumped ? alert.toString())
12
12
 
13
13
  push_only_fresh: (alerts) ->
@@ -1,3 +1,3 @@
1
1
  module Growlyflash
2
- VERSION = "0.8.3.1"
2
+ VERSION = "0.8.4.0"
3
3
  end
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.8.3.1
4
+ version: 0.8.4.0
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: 2015-09-07 00:00:00.000000000 Z
11
+ date: 2016-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  version: '0'
118
118
  requirements: []
119
119
  rubyforge_project:
120
- rubygems_version: 2.4.8
120
+ rubygems_version: 2.5.1
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: Popup ActionDispatch::Flash within Bootstrap alert in Rails app like a growl