growlyflash 0.8.4.0 → 0.8.4.1

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: 81283e4f502073ecbb1484707f9ff26a4fa2e00a
4
- data.tar.gz: fdf59b0f53b3dc9eb293d0af392b3e9ceb276552
3
+ metadata.gz: 8feae49b8595f4450a28aaa0c3d78befae607609
4
+ data.tar.gz: 9cb7b7f1387caacf5297fbb976638058d49d0b79
5
5
  SHA512:
6
- metadata.gz: 542e350891e8e584f7dfe99cf9e4cd240b17e7cff7fb377041cbc0ce5e7bbcfc1866c6a3d4aadfc1c19be773f3feff8886846aec449577b37ff0005155ad3fac
7
- data.tar.gz: 69f5b86aadac5c245755fc11f465e757d524c918fc4915d710aee1ee1010d3688642a479e19053188dc178ca20f98ea33b2ab6f61c84a07c9a439bf8b321836e
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: => @el.toggleClass('in', on)
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
- @alert = (flash, options = {}) ->
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.alert(new Growlyflash.FlashStruct(msg, type))
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.alert
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
- Growlyflash.alert(alert)
11
- @items.push(dumped ? alert.toString())
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..]
@@ -1,3 +1,3 @@
1
1
  module Growlyflash
2
- VERSION = "0.8.4.0"
2
+ VERSION = "0.8.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: growlyflash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4.0
4
+ version: 0.8.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tõnis Simo