noty-rails 2.2.9 → 2.3.4
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 +4 -4
- data/README.md +11 -0
- data/lib/noty-rails/version.rb +1 -1
- data/noty-rails.gemspec +5 -0
- data/vendor/assets/javascripts/noty/jquery.noty.js +93 -61
- data/vendor/assets/javascripts/noty/layouts/bottom.js +30 -34
- data/vendor/assets/javascripts/noty/layouts/bottomCenter.js +35 -38
- data/vendor/assets/javascripts/noty/layouts/bottomLeft.js +34 -38
- data/vendor/assets/javascripts/noty/layouts/bottomRight.js +34 -38
- data/vendor/assets/javascripts/noty/layouts/center.js +47 -51
- data/vendor/assets/javascripts/noty/layouts/centerLeft.js +51 -55
- data/vendor/assets/javascripts/noty/layouts/centerRight.js +51 -55
- data/vendor/assets/javascripts/noty/layouts/inline.js +27 -31
- data/vendor/assets/javascripts/noty/layouts/top.js +30 -34
- data/vendor/assets/javascripts/noty/layouts/topCenter.js +35 -39
- data/vendor/assets/javascripts/noty/layouts/topLeft.js +34 -38
- data/vendor/assets/javascripts/noty/layouts/topRight.js +34 -38
- data/vendor/assets/javascripts/noty/packaged/jquery.noty.packaged.js +912 -774
- data/vendor/assets/javascripts/noty/packaged/jquery.noty.packaged.min.js +1 -10
- data/vendor/assets/javascripts/noty/themes/bootstrap.js +54 -58
- data/vendor/assets/javascripts/noty/themes/default.js +171 -175
- data/vendor/assets/javascripts/noty/themes/relax.js +151 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3875c38e0ff1bc8e104554a822281ae755b50e4
|
4
|
+
data.tar.gz: 1026bfe78c00b701358677d1ac068a74a17ff9ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 834fcee1826aaa00f5eefbb3af5b9d0f2183b2d64d593b4292d1434cdf96a1e75c8d96614f5978fcaec0368ec8a9a80827249289011f0eae0725d90d7b15e584
|
7
|
+
data.tar.gz: 0c315652d904a0a2ff4cd03c0d1620e8a5655dd80be7a4951e430782ae755bb8097ce6c38cbf30682f47e03735b7fb0902e756f61095f4c045ee650665544418
|
data/README.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
Rails asset-pipeline gem to provide [Noty](http://needim.github.com/noty/)
|
2
2
|
|
3
|
+
# Deprecation Note
|
4
|
+
There are multiple ways for managing this JS library already (or any library that is supported by bower):
|
5
|
+
- [bower-rails](https://github.com/rharriso/bower-rails)
|
6
|
+
- [Rails Assets](https://rails-assets.org/)
|
7
|
+
|
8
|
+
This gem will be updated until a major release is done in the upstream.
|
9
|
+
|
3
10
|
# Install
|
4
11
|
```ruby
|
5
12
|
gem 'noty-rails'
|
@@ -27,6 +34,10 @@ $.noty.defaults.layout = 'bottom'
|
|
27
34
|
|
28
35
|
# Changelog
|
29
36
|
|
37
|
+
### 2.3.4
|
38
|
+
|
39
|
+
- Update Noty to `2.3.4`
|
40
|
+
|
30
41
|
### 2.2.9
|
31
42
|
|
32
43
|
- Update Noty to `2.2.9`
|
data/lib/noty-rails/version.rb
CHANGED
data/noty-rails.gemspec
CHANGED
@@ -17,4 +17,9 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
|
+
s.post_install_message = %Q(
|
21
|
+
This gem is deprecated.
|
22
|
+
Please read the deprecation note on README.
|
23
|
+
)
|
24
|
+
|
20
25
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
2
|
@package noty - jQuery Notification Plugin
|
3
|
-
@version version: 2.
|
3
|
+
@version version: 2.3.4
|
4
4
|
@contributors https://github.com/needim/noty/graphs/contributors
|
5
5
|
|
6
6
|
@documentation Examples and Documentation - http://needim.github.com/noty/
|
@@ -8,17 +8,15 @@
|
|
8
8
|
@license Licensed under the MIT licenses: http://www.opensource.org/licenses/mit-license.php
|
9
9
|
*/
|
10
10
|
|
11
|
-
if(typeof Object.create !== 'function') {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
F.prototype = o;
|
17
|
-
return new F();
|
18
|
-
};
|
19
|
-
}
|
11
|
+
if(typeof Object.create !== 'function') {
|
12
|
+
Object.create = function(o) {
|
13
|
+
function F() {
|
14
|
+
}
|
20
15
|
|
21
|
-
|
16
|
+
F.prototype = o;
|
17
|
+
return new F();
|
18
|
+
};
|
19
|
+
}
|
22
20
|
|
23
21
|
var NotyObject = {
|
24
22
|
|
@@ -76,9 +74,9 @@ if(typeof Object.create !== 'function') {
|
|
76
74
|
$.each(this.options.buttons, function(i, button) {
|
77
75
|
var $button = $('<button/>').addClass((button.addClass) ? button.addClass : 'gray').html(button.text).attr('id', button.id ? button.id : 'button-' + i)
|
78
76
|
.appendTo(self.$bar.find('.noty_buttons'))
|
79
|
-
.on('click', function() {
|
77
|
+
.on('click', function(event) {
|
80
78
|
if($.isFunction(button.onClick)) {
|
81
|
-
button.onClick.call($button, self);
|
79
|
+
button.onClick.call($button, self, event);
|
82
80
|
}
|
83
81
|
});
|
84
82
|
});
|
@@ -139,16 +137,26 @@ if(typeof Object.create !== 'function') {
|
|
139
137
|
if(self.options.callback.onShow)
|
140
138
|
self.options.callback.onShow.apply(self);
|
141
139
|
|
142
|
-
self
|
143
|
-
self.
|
144
|
-
self.options.animation.
|
145
|
-
self.options.animation.easing,
|
146
|
-
function() {
|
140
|
+
if (typeof self.options.animation.open == 'string') {
|
141
|
+
self.$bar.css('height', self.$bar.innerHeight());
|
142
|
+
self.$bar.show().addClass(self.options.animation.open).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
|
147
143
|
if(self.options.callback.afterShow) self.options.callback.afterShow.apply(self);
|
148
144
|
self.showing = false;
|
149
145
|
self.shown = true;
|
150
146
|
});
|
151
147
|
|
148
|
+
} else {
|
149
|
+
self.$bar.animate(
|
150
|
+
self.options.animation.open,
|
151
|
+
self.options.animation.speed,
|
152
|
+
self.options.animation.easing,
|
153
|
+
function() {
|
154
|
+
if(self.options.callback.afterShow) self.options.callback.afterShow.apply(self);
|
155
|
+
self.showing = false;
|
156
|
+
self.shown = true;
|
157
|
+
});
|
158
|
+
}
|
159
|
+
|
152
160
|
// If noty is have a timeout option
|
153
161
|
if(self.options.timeout)
|
154
162
|
self.$bar.delay(self.options.timeout).promise().done(function() {
|
@@ -175,8 +183,6 @@ if(typeof Object.create !== 'function') {
|
|
175
183
|
return;
|
176
184
|
}
|
177
185
|
|
178
|
-
this.$bar.dequeue();
|
179
|
-
|
180
186
|
if(!this.shown && !this.showing) { // If we are still waiting in the queue just delete from queue
|
181
187
|
var queue = [];
|
182
188
|
$.each($.noty.queue, function(i, n) {
|
@@ -194,53 +200,81 @@ if(typeof Object.create !== 'function') {
|
|
194
200
|
self.options.callback.onClose.apply(self);
|
195
201
|
}
|
196
202
|
|
197
|
-
self
|
198
|
-
self.options.animation.close,
|
199
|
-
self.options.animation.speed,
|
200
|
-
self.options.animation.easing,
|
201
|
-
function() {
|
203
|
+
if (typeof self.options.animation.close == 'string') {
|
204
|
+
self.$bar.addClass(self.options.animation.close).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
|
202
205
|
if(self.options.callback.afterClose) self.options.callback.afterClose.apply(self);
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
}
|
206
|
+
self.closeCleanUp();
|
207
|
+
});
|
208
|
+
} else {
|
209
|
+
self.$bar.clearQueue().stop().animate(
|
210
|
+
self.options.animation.close,
|
211
|
+
self.options.animation.speed,
|
212
|
+
self.options.animation.easing,
|
213
|
+
function() {
|
214
|
+
if(self.options.callback.afterClose) self.options.callback.afterClose.apply(self);
|
215
|
+
})
|
216
|
+
.promise().done(function() {
|
217
|
+
self.closeCleanUp();
|
218
|
+
});
|
219
|
+
}
|
213
220
|
|
214
|
-
|
215
|
-
|
216
|
-
|
221
|
+
}, // end close
|
222
|
+
|
223
|
+
closeCleanUp: function() {
|
224
|
+
|
225
|
+
var self = this;
|
217
226
|
|
218
|
-
|
219
|
-
|
227
|
+
// Modal Cleaning
|
228
|
+
if(self.options.modal) {
|
229
|
+
$.notyRenderer.setModalCount(-1);
|
230
|
+
if($.notyRenderer.getModalCount() == 0) $('.noty_modal').fadeOut('fast', function() {
|
231
|
+
$(this).remove();
|
232
|
+
});
|
233
|
+
}
|
234
|
+
|
235
|
+
// Layout Cleaning
|
236
|
+
$.notyRenderer.setLayoutCountFor(self, -1);
|
237
|
+
if($.notyRenderer.getLayoutCountFor(self) == 0) $(self.options.layout.container.selector).remove();
|
238
|
+
|
239
|
+
// Make sure self.$bar has not been removed before attempting to remove it
|
240
|
+
if(typeof self.$bar !== 'undefined' && self.$bar !== null) {
|
241
|
+
|
242
|
+
if (typeof self.options.animation.close == 'string') {
|
243
|
+
self.$bar.css('transition', 'all 100ms ease').css('border', 0).css('margin', 0).height(0);
|
244
|
+
self.$bar.one('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function() {
|
220
245
|
self.$bar.remove();
|
221
246
|
self.$bar = null;
|
222
247
|
self.closed = true;
|
223
|
-
}
|
224
248
|
|
225
|
-
|
249
|
+
if(self.options.theme.callback && self.options.theme.callback.onClose) {
|
250
|
+
self.options.theme.callback.onClose.apply(self);
|
251
|
+
}
|
252
|
+
});
|
253
|
+
} else {
|
254
|
+
self.$bar.remove();
|
255
|
+
self.$bar = null;
|
256
|
+
self.closed = true;
|
257
|
+
}
|
258
|
+
}
|
226
259
|
|
227
|
-
|
228
|
-
self.options.theme.callback.onClose.apply(self);
|
229
|
-
}
|
260
|
+
delete $.noty.store[self.options.id]; // deleting noty from store
|
230
261
|
|
231
|
-
|
232
|
-
|
233
|
-
|
262
|
+
if(self.options.theme.callback && self.options.theme.callback.onClose) {
|
263
|
+
self.options.theme.callback.onClose.apply(self);
|
264
|
+
}
|
234
265
|
|
235
|
-
|
236
|
-
|
266
|
+
if(!self.options.dismissQueue) {
|
267
|
+
// Queue render
|
268
|
+
$.noty.ontap = true;
|
237
269
|
|
238
|
-
|
239
|
-
|
240
|
-
}
|
241
|
-
})
|
270
|
+
$.notyRenderer.render();
|
271
|
+
}
|
242
272
|
|
243
|
-
|
273
|
+
if(self.options.maxVisible > 0 && self.options.dismissQueue) {
|
274
|
+
$.notyRenderer.render();
|
275
|
+
}
|
276
|
+
|
277
|
+
}, // end close clean up
|
244
278
|
|
245
279
|
setText: function(text) {
|
246
280
|
if(!this.closed) {
|
@@ -494,9 +528,7 @@ if(typeof Object.create !== 'function') {
|
|
494
528
|
});
|
495
529
|
});
|
496
530
|
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
return jQuery.notyRenderer.init(options);
|
502
|
-
};
|
531
|
+
// Helpers
|
532
|
+
window.noty = function noty(options) {
|
533
|
+
return jQuery.notyRenderer.init(options);
|
534
|
+
};
|
@@ -1,34 +1,30 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
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
|
-
addClass : ''
|
32
|
-
};
|
33
|
-
|
34
|
-
})(jQuery);
|
1
|
+
$.noty.layouts.bottom = {
|
2
|
+
name : 'bottom',
|
3
|
+
options : {},
|
4
|
+
container: {
|
5
|
+
object : '<ul id="noty_bottom_layout_container" />',
|
6
|
+
selector: 'ul#noty_bottom_layout_container',
|
7
|
+
style : function() {
|
8
|
+
$(this).css({
|
9
|
+
bottom : 0,
|
10
|
+
left : '5%',
|
11
|
+
position : 'fixed',
|
12
|
+
width : '90%',
|
13
|
+
height : 'auto',
|
14
|
+
margin : 0,
|
15
|
+
padding : 0,
|
16
|
+
listStyleType: 'none',
|
17
|
+
zIndex : 9999999
|
18
|
+
});
|
19
|
+
}
|
20
|
+
},
|
21
|
+
parent : {
|
22
|
+
object : '<li />',
|
23
|
+
selector: 'li',
|
24
|
+
css : {}
|
25
|
+
},
|
26
|
+
css : {
|
27
|
+
display: 'none'
|
28
|
+
},
|
29
|
+
addClass : ''
|
30
|
+
};
|
@@ -1,41 +1,38 @@
|
|
1
|
-
|
1
|
+
$.noty.layouts.bottomCenter = {
|
2
|
+
name : 'bottomCenter',
|
3
|
+
options : { // overrides options
|
2
4
|
|
3
|
-
|
4
|
-
|
5
|
-
|
5
|
+
},
|
6
|
+
container: {
|
7
|
+
object : '<ul id="noty_bottomCenter_layout_container" />',
|
8
|
+
selector: 'ul#noty_bottomCenter_layout_container',
|
9
|
+
style : function() {
|
10
|
+
$(this).css({
|
11
|
+
bottom : 20,
|
12
|
+
left : 0,
|
13
|
+
position : 'fixed',
|
14
|
+
width : '310px',
|
15
|
+
height : 'auto',
|
16
|
+
margin : 0,
|
17
|
+
padding : 0,
|
18
|
+
listStyleType: 'none',
|
19
|
+
zIndex : 10000000
|
20
|
+
});
|
6
21
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
22
|
+
$(this).css({
|
23
|
+
left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px'
|
24
|
+
});
|
25
|
+
}
|
26
|
+
},
|
27
|
+
parent : {
|
28
|
+
object : '<li />',
|
29
|
+
selector: 'li',
|
30
|
+
css : {}
|
31
|
+
},
|
32
|
+
css : {
|
33
|
+
display: 'none',
|
34
|
+
width : '310px'
|
35
|
+
},
|
36
|
+
addClass : ''
|
37
|
+
};
|
23
38
|
|
24
|
-
$(this).css({
|
25
|
-
left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px'
|
26
|
-
});
|
27
|
-
}
|
28
|
-
},
|
29
|
-
parent : {
|
30
|
-
object : '<li />',
|
31
|
-
selector: 'li',
|
32
|
-
css : {}
|
33
|
-
},
|
34
|
-
css : {
|
35
|
-
display: 'none',
|
36
|
-
width : '310px'
|
37
|
-
},
|
38
|
-
addClass : ''
|
39
|
-
};
|
40
|
-
|
41
|
-
})(jQuery);
|
@@ -1,43 +1,39 @@
|
|
1
|
-
|
1
|
+
$.noty.layouts.bottomLeft = {
|
2
|
+
name : 'bottomLeft',
|
3
|
+
options : { // overrides options
|
2
4
|
|
3
|
-
|
4
|
-
|
5
|
-
|
5
|
+
},
|
6
|
+
container: {
|
7
|
+
object : '<ul id="noty_bottomLeft_layout_container" />',
|
8
|
+
selector: 'ul#noty_bottomLeft_layout_container',
|
9
|
+
style : function() {
|
10
|
+
$(this).css({
|
11
|
+
bottom : 20,
|
12
|
+
left : 20,
|
13
|
+
position : 'fixed',
|
14
|
+
width : '310px',
|
15
|
+
height : 'auto',
|
16
|
+
margin : 0,
|
17
|
+
padding : 0,
|
18
|
+
listStyleType: 'none',
|
19
|
+
zIndex : 10000000
|
20
|
+
});
|
6
21
|
|
7
|
-
|
8
|
-
container: {
|
9
|
-
object : '<ul id="noty_bottomLeft_layout_container" />',
|
10
|
-
selector: 'ul#noty_bottomLeft_layout_container',
|
11
|
-
style : function() {
|
22
|
+
if(window.innerWidth < 600) {
|
12
23
|
$(this).css({
|
13
|
-
|
14
|
-
left : 20,
|
15
|
-
position : 'fixed',
|
16
|
-
width : '310px',
|
17
|
-
height : 'auto',
|
18
|
-
margin : 0,
|
19
|
-
padding : 0,
|
20
|
-
listStyleType: 'none',
|
21
|
-
zIndex : 10000000
|
24
|
+
left: 5
|
22
25
|
});
|
23
|
-
|
24
|
-
if(window.innerWidth < 600) {
|
25
|
-
$(this).css({
|
26
|
-
left: 5
|
27
|
-
});
|
28
|
-
}
|
29
26
|
}
|
30
|
-
}
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
}
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
})(jQuery);
|
27
|
+
}
|
28
|
+
},
|
29
|
+
parent : {
|
30
|
+
object : '<li />',
|
31
|
+
selector: 'li',
|
32
|
+
css : {}
|
33
|
+
},
|
34
|
+
css : {
|
35
|
+
display: 'none',
|
36
|
+
width : '310px'
|
37
|
+
},
|
38
|
+
addClass : ''
|
39
|
+
};
|