noty-rails 2.0.3.1 → 2.1.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: da7126a6aa2104d1f9eef088c391b916f9362013
4
- data.tar.gz: 9734bd14d19a8800b4671df9b48aa3c79927e41e
3
+ metadata.gz: df308d43dfcfdc3f9d472b0d12ae5b3aeb54d5e2
4
+ data.tar.gz: 89a867a5ca5cb043ca13c95802d45f0308ee07d7
5
5
  SHA512:
6
- metadata.gz: 88c76143bd44a966537a663c1934f28bd6f3acb7afa1139d508c33267e0739a96c7baaa0446ae8d67d26166b5e0ef975f3b7fa3eed31ca3e8bf7b2f35ccefe3c
7
- data.tar.gz: 4cc10b81033bb487a62893f1e1f81f7eb33a724619f4bd944063e090fb6a4aba955d0aab7d9b8245c2f382651a6bdbda0200efa2523e28310f024ecdb6176916
6
+ metadata.gz: 01c148b56d2c478ab91ef08507ef3eb1eb3c0911f52ffb6c0f893e9fc9c6468f06f6cb3161522ab472c2b2e10800063347278055b9a8421b8d8d0f6c511785c1
7
+ data.tar.gz: 5c1c3ef1db0fb612eb6a5592413c1461d688d66b4973cdc124fa180e773913080ed76e10d692909737d5e3ee7db65578d5cd2fb0d63634f9352a5141f1e2a635
data/README.md CHANGED
@@ -27,6 +27,10 @@ $.noty.defaults.layout = 'bottom'
27
27
 
28
28
  # Changelog
29
29
 
30
+ ### 2.1.0
31
+
32
+ - Update Noty to `2.1.0`
33
+
30
34
  ### 2.0.3.1
31
35
 
32
36
  - Make it compatible with Rails 4 version (Now is an instance of `Gem::Version`)
@@ -1,5 +1,5 @@
1
1
  module Noty
2
2
  module Rails
3
- VERSION = "2.0.3.1"
3
+ VERSION = "2.1.0"
4
4
  end
5
5
  end
@@ -1,471 +1,547 @@
1
1
  /**
2
- * noty - jQuery Notification Plugin v2.0.3
3
- * Contributors: https://github.com/needim/noty/graphs/contributors
4
- *
5
- * Examples and Documentation - http://needim.github.com/noty/
6
- *
7
- * Licensed under the MIT licenses:
8
- * http://www.opensource.org/licenses/mit-license.php
9
- *
10
- **/
2
+ * noty - jQuery Notification Plugin v2.1.0
3
+ * Contributors: https://github.com/needim/noty/graphs/contributors
4
+ *
5
+ * Examples and Documentation - http://needim.github.com/noty/
6
+ *
7
+ * Licensed under the MIT licenses:
8
+ * http://www.opensource.org/licenses/mit-license.php
9
+ *
10
+ **/
11
11
 
12
12
  if (typeof Object.create !== 'function') {
13
- Object.create = function (o) {
14
- function F() {};
15
- F.prototype = o;
16
- return new F();
17
- };
18
- };
13
+ Object.create = function (o) {
14
+ function F() {
15
+ }
19
16
 
20
- ;(function($) {
17
+ F.prototype = o;
18
+ return new F();
19
+ };
20
+ }
21
21
 
22
- var NotyObject = {
22
+ (function ($) {
23
23
 
24
- init: function(options) {
24
+ var NotyObject = {
25
25
 
26
- // Mix in the passed in options with the default options
27
- this.options = $.extend({}, $.noty.defaults, options);
26
+ init:function (options) {
28
27
 
29
- this.options.layout = (this.options.custom) ? $.noty.layouts['inline'] : $.noty.layouts[this.options.layout];
30
- this.options.theme = $.noty.themes[this.options.theme];
28
+ // Mix in the passed in options with the default options
29
+ this.options = $.extend({}, $.noty.defaults, options);
31
30
 
32
- delete options.layout, delete options.theme;
31
+ this.options.layout = (this.options.custom) ? $.noty.layouts['inline'] : $.noty.layouts[this.options.layout];
32
+ this.options.theme = $.noty.themes[this.options.theme];
33
33
 
34
- this.options = $.extend({}, this.options, this.options.layout.options);
35
- this.options.id = 'noty_' + (new Date().getTime() * Math.floor(Math.random()* 1000000));
34
+ delete options.layout;
35
+ delete options.theme;
36
36
 
37
- this.options = $.extend({}, this.options, options);
37
+ this.options = $.extend({}, this.options, this.options.layout.options);
38
+ this.options.id = 'noty_' + (new Date().getTime() * Math.floor(Math.random() * 1000000));
38
39
 
39
- // Build the noty dom initial structure
40
- this._build();
40
+ this.options = $.extend({}, this.options, options);
41
41
 
42
- // return this so we can chain/use the bridge with less code.
43
- return this;
44
- }, // end init
42
+ // Build the noty dom initial structure
43
+ this._build();
45
44
 
46
- _build: function() {
45
+ // return this so we can chain/use the bridge with less code.
46
+ return this;
47
+ }, // end init
47
48
 
48
- // Generating noty bar
49
- var $bar = $('<div class="noty_bar"/>').attr('id', this.options.id);
50
- $bar.append(this.options.template).find('.noty_text').html(this.options.text);
49
+ _build:function () {
51
50
 
52
- this.$bar = (this.options.layout.parent.object !== null) ? $(this.options.layout.parent.object).css(this.options.layout.parent.css).append($bar) : $bar;
51
+ // Generating noty bar
52
+ var $bar = $('<div class="noty_bar"></div>').attr('id', this.options.id);
53
+ $bar.append(this.options.template).find('.noty_text').html(this.options.text);
53
54
 
54
- // Set buttons if available
55
- if (this.options.buttons) {
55
+ this.$bar = (this.options.layout.parent.object !== null) ? $(this.options.layout.parent.object).css(this.options.layout.parent.css).append($bar) : $bar;
56
56
 
57
- // If we have button disable closeWith & timeout options
58
- this.options.closeWith = [], this.options.timeout = false;
57
+ // Set buttons if available
58
+ if (this.options.buttons) {
59
59
 
60
- var $buttons = $('<div/>').addClass('noty_buttons');
60
+ // If we have button disable closeWith & timeout options
61
+ this.options.closeWith = [];
62
+ this.options.timeout = false;
61
63
 
62
- (this.options.layout.parent.object !== null) ? this.$bar.find('.noty_bar').append($buttons) : this.$bar.append($buttons);
64
+ var $buttons = $('<div/>').addClass('noty_buttons');
63
65
 
64
- var self = this;
66
+ (this.options.layout.parent.object !== null) ? this.$bar.find('.noty_bar').append($buttons) : this.$bar.append($buttons);
65
67
 
66
- $.each(this.options.buttons, function(i, button) {
67
- var $button = $('<button/>').addClass((button.addClass) ? button.addClass : 'gray').html(button.text)
68
- .appendTo(self.$bar.find('.noty_buttons'))
69
- .bind('click', function(e) { if ($.isFunction(button.onClick)) { button.onClick.call($button, self); } });
70
- });
71
- }
68
+ var self = this;
72
69
 
73
- // For easy access
74
- this.$message = this.$bar.find('.noty_message');
75
- this.$closeButton = this.$bar.find('.noty_close');
76
- this.$buttons = this.$bar.find('.noty_buttons');
70
+ $.each(this.options.buttons, function (i, button) {
71
+ var $button = $('<button/>').addClass((button.addClass) ? button.addClass : 'gray').html(button.text)
72
+ .appendTo(self.$bar.find('.noty_buttons'))
73
+ .bind('click', function () {
74
+ if ($.isFunction(button.onClick)) {
75
+ button.onClick.call($button, self);
76
+ }
77
+ });
78
+ });
79
+ }
77
80
 
78
- $.noty.store[this.options.id] = this; // store noty for api
81
+ // For easy access
82
+ this.$message = this.$bar.find('.noty_message');
83
+ this.$closeButton = this.$bar.find('.noty_close');
84
+ this.$buttons = this.$bar.find('.noty_buttons');
79
85
 
80
- }, // end _build
86
+ $.noty.store[this.options.id] = this; // store noty for api
81
87
 
82
- show: function() {
88
+ }, // end _build
83
89
 
84
- var self = this;
90
+ show:function () {
85
91
 
86
- $(self.options.layout.container.selector).append(self.$bar);
92
+ var self = this;
87
93
 
88
- self.options.theme.style.apply(self);
94
+ $(self.options.layout.container.selector).append(self.$bar);
89
95
 
90
- ($.type(self.options.layout.css) === 'function') ? this.options.layout.css.apply(self.$bar) : self.$bar.css(this.options.layout.css || {});
96
+ self.options.theme.style.apply(self);
91
97
 
92
- self.$bar.addClass(self.options.layout.addClass);
98
+ ($.type(self.options.layout.css) === 'function') ? this.options.layout.css.apply(self.$bar) : self.$bar.css(this.options.layout.css || {});
93
99
 
94
- self.options.layout.container.style.apply($(self.options.layout.container.selector));
100
+ self.$bar.addClass(self.options.layout.addClass);
95
101
 
96
- self.options.theme.callback.onShow.apply(this);
102
+ self.options.layout.container.style.apply($(self.options.layout.container.selector));
97
103
 
98
- if ($.inArray('click', self.options.closeWith) > -1)
99
- self.$bar.css('cursor', 'pointer').one('click', function() { self.close(); });
104
+ self.options.theme.callback.onShow.apply(this);
100
105
 
101
- if ($.inArray('hover', self.options.closeWith) > -1)
102
- self.$bar.one('mouseenter', function() { self.close(); });
106
+ if ($.inArray('click', self.options.closeWith) > -1)
107
+ self.$bar.css('cursor', 'pointer').one('click', function (evt) {
108
+ self.stopPropagation(evt);
109
+ if (self.options.callback.onCloseClick) {
110
+ self.options.callback.onCloseClick.apply(self);
111
+ }
112
+ self.close();
113
+ });
103
114
 
104
- if ($.inArray('button', self.options.closeWith) > -1)
105
- self.$closeButton.one('click', function() { self.close(); });
115
+ if ($.inArray('hover', self.options.closeWith) > -1)
116
+ self.$bar.one('mouseenter', function () {
117
+ self.close();
118
+ });
106
119
 
107
- if ($.inArray('button', self.options.closeWith) == -1)
108
- self.$closeButton.remove();
120
+ if ($.inArray('button', self.options.closeWith) > -1)
121
+ self.$closeButton.one('click', function (evt) {
122
+ self.stopPropagation(evt);
123
+ self.close();
124
+ });
109
125
 
110
- if (self.options.callback.onShow)
111
- self.options.callback.onShow.apply(self);
126
+ if ($.inArray('button', self.options.closeWith) == -1)
127
+ self.$closeButton.remove();
112
128
 
113
- self.$bar.animate(
114
- self.options.animation.open,
115
- self.options.animation.speed,
116
- self.options.animation.easing,
117
- function() {
118
- if (self.options.callback.afterShow) self.options.callback.afterShow.apply(self);
119
- self.shown = true;
120
- });
129
+ if (self.options.callback.onShow)
130
+ self.options.callback.onShow.apply(self);
121
131
 
122
- // If noty is have a timeout option
123
- if (self.options.timeout)
124
- self.$bar.delay(self.options.timeout).promise().done(function() { self.close(); });
132
+ self.$bar.animate(
133
+ self.options.animation.open,
134
+ self.options.animation.speed,
135
+ self.options.animation.easing,
136
+ function () {
137
+ if (self.options.callback.afterShow) self.options.callback.afterShow.apply(self);
138
+ self.shown = true;
139
+ });
125
140
 
126
- return this;
141
+ // If noty is have a timeout option
142
+ if (self.options.timeout)
143
+ self.$bar.delay(self.options.timeout).promise().done(function () {
144
+ self.close();
145
+ });
127
146
 
128
- }, // end show
147
+ return this;
129
148
 
130
- close: function() {
149
+ }, // end show
131
150
 
132
- if (this.closed) return;
151
+ close:function () {
133
152
 
134
- var self = this;
153
+ if (this.closed) return;
154
+ if (this.$bar && this.$bar.hasClass('i-am-closing-now')) return;
135
155
 
136
- if (!this.shown) { // If we are still waiting in the queue just delete from queue
137
- $.each($.noty.queue, function(i, n) {
138
- if (n.options.id == self.options.id) {
139
- $.noty.queue.splice(i, 1);
140
- }
141
- });
142
- return;
143
- }
144
-
145
- self.$bar.addClass('i-am-closing-now');
146
-
147
- if (self.options.callback.onClose) { self.options.callback.onClose.apply(self); }
156
+ var self = this;
148
157
 
149
- self.$bar.clearQueue().stop().animate(
150
- self.options.animation.close,
151
- self.options.animation.speed,
152
- self.options.animation.easing,
153
- function() { if (self.options.callback.afterClose) self.options.callback.afterClose.apply(self); })
154
- .promise().done(function() {
155
-
156
- // Modal Cleaning
157
- if (self.options.modal) {
158
- $.notyRenderer.setModalCount(-1);
159
- if ($.notyRenderer.getModalCount() == 0) $('.noty_modal').fadeOut('fast', function() { $(this).remove(); });
160
- }
158
+ if (!this.shown) { // If we are still waiting in the queue just delete from queue
159
+ var queue = [];
160
+ $.each($.noty.queue, function (i, n) {
161
+ if (n.options.id != self.options.id) {
162
+ queue.push(n);
163
+ }
164
+ });
165
+ $.noty.queue = queue;
166
+ return;
167
+ }
161
168
 
162
- // Layout Cleaning
163
- $.notyRenderer.setLayoutCountFor(self, -1);
164
- if ($.notyRenderer.getLayoutCountFor(self) == 0) $(self.options.layout.container.selector).remove();
169
+ self.$bar.addClass('i-am-closing-now');
170
+
171
+ if (self.options.callback.onClose) {
172
+ self.options.callback.onClose.apply(self);
173
+ }
165
174
 
166
- self.$bar.remove();
167
- self.$bar = null;
168
- self.closed = true;
175
+ self.$bar.clearQueue().stop().animate(
176
+ self.options.animation.close,
177
+ self.options.animation.speed,
178
+ self.options.animation.easing,
179
+ function () {
180
+ if (self.options.callback.afterClose) self.options.callback.afterClose.apply(self);
181
+ })
182
+ .promise().done(function () {
169
183
 
170
- delete $.noty.store[self.options.id]; // deleting noty from store
171
-
172
- if (!self.options.dismissQueue) {
173
- // Queue render
174
- $.noty.ontap = true;
184
+ // Modal Cleaning
185
+ if (self.options.modal) {
186
+ $.notyRenderer.setModalCount(-1);
187
+ if ($.notyRenderer.getModalCount() == 0) $('.noty_modal').fadeOut('fast', function () {
188
+ $(this).remove();
189
+ });
190
+ }
175
191
 
192
+ // Layout Cleaning
193
+ $.notyRenderer.setLayoutCountFor(self, -1);
194
+ if ($.notyRenderer.getLayoutCountFor(self) == 0) $(self.options.layout.container.selector).remove();
195
+
196
+ // Make sure self.$bar has not been removed before attempting to remove it
197
+ if (typeof self.$bar !== 'undefined' && self.$bar !== null ) {
198
+ self.$bar.remove();
199
+ self.$bar = null;
200
+ self.closed = true;
201
+ }
202
+
203
+ delete $.noty.store[self.options.id]; // deleting noty from store
204
+
205
+ self.options.theme.callback.onClose.apply(self);
206
+
207
+ if (!self.options.dismissQueue) {
208
+ // Queue render
209
+ $.noty.ontap = true;
210
+
211
+ $.notyRenderer.render();
212
+ }
213
+
214
+ if (self.options.maxVisible > 0 && self.options.dismissQueue) {
176
215
  $.notyRenderer.render();
177
216
  }
217
+ })
218
+
219
+ }, // end close
178
220
 
179
- });
221
+ setText:function (text) {
222
+ if (!this.closed) {
223
+ this.options.text = text;
224
+ this.$bar.find('.noty_text').html(text);
225
+ }
226
+ return this;
227
+ },
180
228
 
181
- }, // end close
229
+ setType:function (type) {
230
+ if (!this.closed) {
231
+ this.options.type = type;
232
+ this.options.theme.style.apply(this);
233
+ this.options.theme.callback.onShow.apply(this);
234
+ }
235
+ return this;
236
+ },
182
237
 
183
- setText: function(text) {
184
- if (!this.closed) {
185
- this.options.text = text;
186
- this.$bar.find('.noty_text').html(text);
187
- }
188
- return this;
189
- },
238
+ setTimeout:function (time) {
239
+ if (!this.closed) {
240
+ var self = this;
241
+ this.options.timeout = time;
242
+ self.$bar.delay(self.options.timeout).promise().done(function () {
243
+ self.close();
244
+ });
245
+ }
246
+ return this;
247
+ },
190
248
 
191
- setType: function(type) {
192
- if (!this.closed) {
193
- this.options.type = type;
194
- this.options.theme.style.apply(this);
195
- this.options.theme.callback.onShow.apply(this);
196
- }
197
- return this;
198
- },
249
+ stopPropagation:function (evt) {
250
+ evt = evt || window.event;
251
+ if (typeof evt.stopPropagation !== "undefined") {
252
+ evt.stopPropagation();
253
+ } else {
254
+ evt.cancelBubble = true;
255
+ }
256
+ },
199
257
 
200
- closed: false,
201
- shown: false
258
+ closed:false,
259
+ shown:false
202
260
 
203
- }; // end NotyObject
261
+ }; // end NotyObject
204
262
 
205
- $.notyRenderer = {};
263
+ $.notyRenderer = {};
206
264
 
207
- $.notyRenderer.init = function(options) {
265
+ $.notyRenderer.init = function (options) {
208
266
 
209
- // Renderer creates a new noty
210
- var notification = Object.create(NotyObject).init(options);
267
+ // Renderer creates a new noty
268
+ var notification = Object.create(NotyObject).init(options);
211
269
 
212
- (notification.options.force) ? $.noty.queue.unshift(notification) : $.noty.queue.push(notification);
270
+ (notification.options.force) ? $.noty.queue.unshift(notification) : $.noty.queue.push(notification);
213
271
 
214
- $.notyRenderer.render();
272
+ $.notyRenderer.render();
215
273
 
216
- return ($.noty.returns == 'object') ? notification : notification.options.id;
217
- };
274
+ return ($.noty.returns == 'object') ? notification : notification.options.id;
275
+ };
218
276
 
219
- $.notyRenderer.render = function() {
277
+ $.notyRenderer.render = function () {
220
278
 
221
- var instance = $.noty.queue[0];
279
+ var instance = $.noty.queue[0];
222
280
 
223
- if ($.type(instance) === 'object') {
224
- if (instance.options.dismissQueue) {
225
- $.notyRenderer.show($.noty.queue.shift());
226
- } else {
227
- if ($.noty.ontap) {
281
+ if ($.type(instance) === 'object') {
282
+ if (instance.options.dismissQueue) {
283
+ if (instance.options.maxVisible > 0) {
284
+ if ($(instance.options.layout.container.selector + ' li').length < instance.options.maxVisible) {
285
+ $.notyRenderer.show($.noty.queue.shift());
286
+ } else {
287
+
288
+ }
289
+ } else {
228
290
  $.notyRenderer.show($.noty.queue.shift());
229
- $.noty.ontap = false;
230
291
  }
231
- }
232
- } else {
233
- $.noty.ontap = true; // Queue is over
234
- }
235
-
236
- };
237
-
238
- $.notyRenderer.show = function(notification) {
239
-
240
- if (notification.options.modal) {
241
- $.notyRenderer.createModalFor(notification);
242
- $.notyRenderer.setModalCount(+1);
243
- }
244
-
245
- // Where is the container?
246
- if ($(notification.options.layout.container.selector).length == 0) {
247
- if (notification.options.custom) {
248
- notification.options.custom.append($(notification.options.layout.container.object).addClass('i-am-new'));
249
- } else {
250
- $('body').append($(notification.options.layout.container.object).addClass('i-am-new'));
251
- }
252
- } else {
253
- $(notification.options.layout.container.selector).removeClass('i-am-new');
254
- }
255
-
256
- $.notyRenderer.setLayoutCountFor(notification, +1);
257
-
258
- notification.show();
259
- };
260
-
261
- $.notyRenderer.createModalFor = function(notification) {
262
- if ($('.noty_modal').length == 0)
263
- $('<div/>').addClass('noty_modal').data('noty_modal_count', 0).css(notification.options.theme.modal.css).prependTo($('body')).fadeIn('fast');
264
- };
265
-
266
- $.notyRenderer.getLayoutCountFor = function(notification) {
267
- return $(notification.options.layout.container.selector).data('noty_layout_count') || 0;
268
- };
269
-
270
- $.notyRenderer.setLayoutCountFor = function(notification, arg) {
271
- return $(notification.options.layout.container.selector).data('noty_layout_count', $.notyRenderer.getLayoutCountFor(notification) + arg);
272
- };
273
-
274
- $.notyRenderer.getModalCount = function() {
275
- return $('.noty_modal').data('noty_modal_count') || 0;
276
- };
277
-
278
- $.notyRenderer.setModalCount = function(arg) {
279
- return $('.noty_modal').data('noty_modal_count', $.notyRenderer.getModalCount() + arg);
280
- };
281
-
282
- // This is for custom container
283
- $.fn.noty = function(options) {
284
- options.custom = $(this);
285
- return $.notyRenderer.init(options);
286
- };
287
-
288
- $.noty = {};
289
- $.noty.queue = [];
290
- $.noty.ontap = true;
291
- $.noty.layouts = {};
292
- $.noty.themes = {};
293
- $.noty.returns = 'object';
294
- $.noty.store = {};
295
-
296
- $.noty.get = function(id) {
297
- return $.noty.store.hasOwnProperty(id) ? $.noty.store[id] : false;
298
- };
299
-
300
- $.noty.close = function(id) {
301
- return $.noty.get(id) ? $.noty.get(id).close() : false;
302
- };
303
-
304
- $.noty.setText = function(id, text) {
305
- return $.noty.get(id) ? $.noty.get(id).setText(text) : false;
306
- };
307
-
308
- $.noty.setType = function(id, type) {
309
- return $.noty.get(id) ? $.noty.get(id).setType(type) : false;
310
- };
311
-
312
- $.noty.clearQueue = function() {
313
- $.noty.queue = [];
314
- };
315
-
316
- $.noty.closeAll = function() {
317
- $.noty.clearQueue();
318
- $.each($.noty.store, function(id, noty) {
319
- noty.close();
320
- });
321
- };
322
-
323
- var windowAlert = window.alert;
324
-
325
- $.noty.consumeAlert = function(options) {
326
- window.alert = function(text) {
327
- if (options)
328
- options.text = text;
329
- else
330
- options = {text:text};
331
-
332
- $.notyRenderer.init(options);
333
- };
334
- };
335
-
336
- $.noty.stopConsumeAlert = function(){
337
- window.alert = windowAlert;
338
- };
339
-
340
- $.noty.defaults = {
341
- layout: 'top',
342
- theme: 'default',
343
- type: 'alert',
344
- text: '',
345
- dismissQueue: true,
346
- template: '<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',
347
- animation: {
348
- open: {height: 'toggle'},
349
- close: {height: 'toggle'},
350
- easing: 'swing',
351
- speed: 500
352
- },
353
- timeout: false,
354
- force: false,
355
- modal: false,
356
- closeWith: ['click'],
357
- callback: {
358
- onShow: function() {},
359
- afterShow: function() {},
360
- onClose: function() {},
361
- afterClose: function() {}
362
- },
363
- buttons: false
364
- };
365
-
366
- $(window).resize(function() {
367
- $.each($.noty.layouts, function(index, layout) {
368
- layout.container.style.apply($(layout.container.selector));
369
- });
370
- });
292
+ } else {
293
+ if ($.noty.ontap) {
294
+ $.notyRenderer.show($.noty.queue.shift());
295
+ $.noty.ontap = false;
296
+ }
297
+ }
298
+ } else {
299
+ $.noty.ontap = true; // Queue is over
300
+ }
301
+
302
+ };
303
+
304
+ $.notyRenderer.show = function (notification) {
305
+
306
+ if (notification.options.modal) {
307
+ $.notyRenderer.createModalFor(notification);
308
+ $.notyRenderer.setModalCount(+1);
309
+ }
310
+
311
+ // Where is the container?
312
+ if ($(notification.options.layout.container.selector).length == 0) {
313
+ if (notification.options.custom) {
314
+ notification.options.custom.append($(notification.options.layout.container.object).addClass('i-am-new'));
315
+ } else {
316
+ $('body').append($(notification.options.layout.container.object).addClass('i-am-new'));
317
+ }
318
+ } else {
319
+ $(notification.options.layout.container.selector).removeClass('i-am-new');
320
+ }
321
+
322
+ $.notyRenderer.setLayoutCountFor(notification, +1);
323
+
324
+ notification.show();
325
+ };
326
+
327
+ $.notyRenderer.createModalFor = function (notification) {
328
+ if ($('.noty_modal').length == 0)
329
+ $('<div/>').addClass('noty_modal').data('noty_modal_count', 0).css(notification.options.theme.modal.css).prependTo($('body')).fadeIn('fast');
330
+ };
331
+
332
+ $.notyRenderer.getLayoutCountFor = function (notification) {
333
+ return $(notification.options.layout.container.selector).data('noty_layout_count') || 0;
334
+ };
335
+
336
+ $.notyRenderer.setLayoutCountFor = function (notification, arg) {
337
+ return $(notification.options.layout.container.selector).data('noty_layout_count', $.notyRenderer.getLayoutCountFor(notification) + arg);
338
+ };
339
+
340
+ $.notyRenderer.getModalCount = function () {
341
+ return $('.noty_modal').data('noty_modal_count') || 0;
342
+ };
343
+
344
+ $.notyRenderer.setModalCount = function (arg) {
345
+ return $('.noty_modal').data('noty_modal_count', $.notyRenderer.getModalCount() + arg);
346
+ };
347
+
348
+ // This is for custom container
349
+ $.fn.noty = function (options) {
350
+ options.custom = $(this);
351
+ return $.notyRenderer.init(options);
352
+ };
353
+
354
+ $.noty = {};
355
+ $.noty.queue = [];
356
+ $.noty.ontap = true;
357
+ $.noty.layouts = {};
358
+ $.noty.themes = {};
359
+ $.noty.returns = 'object';
360
+ $.noty.store = {};
361
+
362
+ $.noty.get = function (id) {
363
+ return $.noty.store.hasOwnProperty(id) ? $.noty.store[id] : false;
364
+ };
365
+
366
+ $.noty.close = function (id) {
367
+ return $.noty.get(id) ? $.noty.get(id).close() : false;
368
+ };
369
+
370
+ $.noty.setText = function (id, text) {
371
+ return $.noty.get(id) ? $.noty.get(id).setText(text) : false;
372
+ };
373
+
374
+ $.noty.setType = function (id, type) {
375
+ return $.noty.get(id) ? $.noty.get(id).setType(type) : false;
376
+ };
377
+
378
+ $.noty.clearQueue = function () {
379
+ $.noty.queue = [];
380
+ };
381
+
382
+ $.noty.closeAll = function () {
383
+ $.noty.clearQueue();
384
+ $.each($.noty.store, function (id, noty) {
385
+ noty.close();
386
+ });
387
+ };
388
+
389
+ var windowAlert = window.alert;
390
+
391
+ $.noty.consumeAlert = function (options) {
392
+ window.alert = function (text) {
393
+ if (options)
394
+ options.text = text;
395
+ else
396
+ options = {text:text};
397
+
398
+ $.notyRenderer.init(options);
399
+ };
400
+ };
401
+
402
+ $.noty.stopConsumeAlert = function () {
403
+ window.alert = windowAlert;
404
+ };
405
+
406
+ $.noty.defaults = {
407
+ layout:'top',
408
+ theme:'defaultTheme',
409
+ type:'alert',
410
+ text:'',
411
+ dismissQueue:true,
412
+ template:'<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',
413
+ animation:{
414
+ open:{height:'toggle'},
415
+ close:{height:'toggle'},
416
+ easing:'swing',
417
+ speed:500
418
+ },
419
+ timeout:false,
420
+ force:false,
421
+ modal:false,
422
+ maxVisible:5,
423
+ closeWith:['click'],
424
+ callback:{
425
+ onShow:function () {
426
+ },
427
+ afterShow:function () {
428
+ },
429
+ onClose:function () {
430
+ },
431
+ afterClose:function () {
432
+ },
433
+ onCloseClick:function () {
434
+ }
435
+ },
436
+ buttons:false
437
+ };
438
+
439
+ $(window).resize(function () {
440
+ $.each($.noty.layouts, function (index, layout) {
441
+ layout.container.style.apply($(layout.container.selector));
442
+ });
443
+ });
371
444
 
372
445
  })(jQuery);
373
446
 
374
447
  // Helpers
375
- function noty(options) {
376
-
377
- // This is for BC - Will be deleted on v2.2.0
378
- var using_old = 0
379
- , old_to_new = {
380
- 'animateOpen': 'animation.open',
381
- 'animateClose': 'animation.close',
382
- 'easing': 'animation.easing',
383
- 'speed': 'animation.speed',
384
- 'onShow': 'callback.onShow',
385
- 'onShown': 'callback.afterShow',
386
- 'onClose': 'callback.onClose',
387
- 'onClosed': 'callback.afterClose'
388
- }
389
-
390
- jQuery.each(options, function(key, value) {
391
- if (old_to_new[key]) {
392
- using_old++;
393
- var _new = old_to_new[key].split('.');
394
-
395
- if (!options[_new[0]]) options[_new[0]] = {};
396
-
397
- options[_new[0]][_new[1]] = (value) ? value : function() {};
398
- delete options[key];
399
- }
400
- });
401
-
402
- if (!options.closeWith) {
403
- options.closeWith = jQuery.noty.defaults.closeWith;
404
- }
405
-
406
- if (options.hasOwnProperty('closeButton')) {
407
- using_old++;
408
- if (options.closeButton) options.closeWith.push('button');
409
- delete options.closeButton;
410
- }
411
-
412
- if (options.hasOwnProperty('closeOnSelfClick')) {
413
- using_old++;
414
- if (options.closeOnSelfClick) options.closeWith.push('click');
415
- delete options.closeOnSelfClick;
416
- }
417
-
418
- if (options.hasOwnProperty('closeOnSelfOver')) {
419
- using_old++;
420
- if (options.closeOnSelfOver) options.closeWith.push('hover');
421
- delete options.closeOnSelfOver;
422
- }
423
-
424
- if (options.hasOwnProperty('custom')) {
425
- using_old++;
426
- if (options.custom.container != 'null') options.custom = options.custom.container;
427
- }
428
-
429
- if (options.hasOwnProperty('cssPrefix')) {
430
- using_old++;
431
- delete options.cssPrefix;
432
- }
433
-
434
- if (options.theme == 'noty_theme_default') {
435
- using_old++;
436
- options.theme = 'default';
437
- }
438
-
439
- if (!options.hasOwnProperty('dismissQueue')) {
440
- if (options.layout == 'topLeft'
441
- || options.layout == 'topRight'
442
- || options.layout == 'bottomLeft'
443
- || options.layout == 'bottomRight') {
444
- options.dismissQueue = true;
445
- } else {
446
- options.dismissQueue = false;
447
- }
448
- }
449
-
450
- if (options.buttons) {
451
- jQuery.each(options.buttons, function(i, button) {
452
- if (button.click) {
453
- using_old++;
454
- button.onClick = button.click;
455
- delete button.click;
456
- }
457
- if (button.type) {
458
- using_old++;
459
- button.addClass = button.type;
460
- delete button.type;
461
- }
462
- });
463
- }
464
-
465
- if (using_old) console.warn('You are using noty v2 with v1.x.x options. @deprecated until v2.2.0 - Please update your options.');
466
-
467
- // console.log(options);
468
- // End of the BC
469
-
470
- return jQuery.notyRenderer.init(options);
471
- }
448
+ window.noty = function noty(options) {
449
+
450
+ // This is for BC - Will be deleted on v2.2.0
451
+ var using_old = 0
452
+ , old_to_new = {
453
+ 'animateOpen':'animation.open',
454
+ 'animateClose':'animation.close',
455
+ 'easing':'animation.easing',
456
+ 'speed':'animation.speed',
457
+ 'onShow':'callback.onShow',
458
+ 'onShown':'callback.afterShow',
459
+ 'onClose':'callback.onClose',
460
+ 'onCloseClick':'callback.onCloseClick',
461
+ 'onClosed':'callback.afterClose'
462
+ };
463
+
464
+ jQuery.each(options, function (key, value) {
465
+ if (old_to_new[key]) {
466
+ using_old++;
467
+ var _new = old_to_new[key].split('.');
468
+
469
+ if (!options[_new[0]]) options[_new[0]] = {};
470
+
471
+ options[_new[0]][_new[1]] = (value) ? value : function () {
472
+ };
473
+ delete options[key];
474
+ }
475
+ });
476
+
477
+ if (!options.closeWith) {
478
+ options.closeWith = jQuery.noty.defaults.closeWith;
479
+ }
480
+
481
+ if (options.hasOwnProperty('closeButton')) {
482
+ using_old++;
483
+ if (options.closeButton) options.closeWith.push('button');
484
+ delete options.closeButton;
485
+ }
486
+
487
+ if (options.hasOwnProperty('closeOnSelfClick')) {
488
+ using_old++;
489
+ if (options.closeOnSelfClick) options.closeWith.push('click');
490
+ delete options.closeOnSelfClick;
491
+ }
492
+
493
+ if (options.hasOwnProperty('closeOnSelfOver')) {
494
+ using_old++;
495
+ if (options.closeOnSelfOver) options.closeWith.push('hover');
496
+ delete options.closeOnSelfOver;
497
+ }
498
+
499
+ if (options.hasOwnProperty('custom')) {
500
+ using_old++;
501
+ if (options.custom.container != 'null') options.custom = options.custom.container;
502
+ }
503
+
504
+ if (options.hasOwnProperty('cssPrefix')) {
505
+ using_old++;
506
+ delete options.cssPrefix;
507
+ }
508
+
509
+ if (options.theme == 'noty_theme_default') {
510
+ using_old++;
511
+ options.theme = 'defaultTheme';
512
+ }
513
+
514
+ if (!options.hasOwnProperty('dismissQueue')) {
515
+ options.dismissQueue = jQuery.noty.defaults.dismissQueue;
516
+ }
517
+
518
+ if (!options.hasOwnProperty('maxVisible')) {
519
+ options.maxVisible = jQuery.noty.defaults.maxVisible;
520
+ }
521
+
522
+ if (options.buttons) {
523
+ jQuery.each(options.buttons, function (i, button) {
524
+ if (button.click) {
525
+ using_old++;
526
+ button.onClick = button.click;
527
+ delete button.click;
528
+ }
529
+ if (button.type) {
530
+ using_old++;
531
+ button.addClass = button.type;
532
+ delete button.type;
533
+ }
534
+ });
535
+ }
536
+
537
+ if (using_old) {
538
+ if (typeof console !== "undefined" && console.warn) {
539
+ console.warn('You are using noty v2 with v1.x.x options. @deprecated until v2.2.0 - Please update your options.');
540
+ }
541
+ }
542
+
543
+ // console.log(options);
544
+ // End of the BC
545
+
546
+ return jQuery.notyRenderer.init(options);
547
+ }
@@ -3,7 +3,7 @@
3
3
  $.noty.layouts.bottomCenter = {
4
4
  name: 'bottomCenter',
5
5
  options: { // overrides options
6
-
6
+
7
7
  },
8
8
  container: {
9
9
  object: '<ul id="noty_bottomCenter_layout_container" />',
@@ -20,9 +20,9 @@
20
20
  listStyleType: 'none',
21
21
  zIndex: 10000000
22
22
  });
23
-
23
+
24
24
  $(this).css({
25
- left: ($(window).width() - $(this).outerWidth()) / 2 + 'px',
25
+ left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px'
26
26
  });
27
27
  }
28
28
  },
@@ -38,4 +38,4 @@
38
38
  addClass: ''
39
39
  };
40
40
 
41
- })(jQuery);
41
+ })(jQuery);
@@ -29,12 +29,12 @@
29
29
 
30
30
  if ($(this).hasClass('i-am-new')) {
31
31
  $(this).css({
32
- left: ($(window).width() - $(this).outerWidth()) / 2 + 'px',
32
+ left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px',
33
33
  top: ($(window).height() - actual_height) / 2 + 'px'
34
34
  });
35
35
  } else {
36
36
  $(this).animate({
37
- left: ($(window).width() - $(this).outerWidth()) / 2 + 'px',
37
+ left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px',
38
38
  top: ($(window).height() - actual_height) / 2 + 'px'
39
39
  }, 500);
40
40
  }
@@ -3,7 +3,7 @@
3
3
  $.noty.layouts.centerLeft = {
4
4
  name: 'centerLeft',
5
5
  options: { // overrides options
6
-
6
+
7
7
  },
8
8
  container: {
9
9
  object: '<ul id="noty_centerLeft_layout_container" />',
@@ -30,7 +30,7 @@
30
30
 
31
31
  if ($(this).hasClass('i-am-new')) {
32
32
  $(this).css({
33
- top: ($(window).height() - actual_height) / 2 + 'px',
33
+ top: ($(window).height() - actual_height) / 2 + 'px'
34
34
  });
35
35
  } else {
36
36
  $(this).animate({
@@ -58,4 +58,4 @@
58
58
  addClass: ''
59
59
  };
60
60
 
61
- })(jQuery);
61
+ })(jQuery);
@@ -3,7 +3,7 @@
3
3
  $.noty.layouts.centerRight = {
4
4
  name: 'centerRight',
5
5
  options: { // overrides options
6
-
6
+
7
7
  },
8
8
  container: {
9
9
  object: '<ul id="noty_centerRight_layout_container" />',
@@ -30,7 +30,7 @@
30
30
 
31
31
  if ($(this).hasClass('i-am-new')) {
32
32
  $(this).css({
33
- top: ($(window).height() - actual_height) / 2 + 'px',
33
+ top: ($(window).height() - actual_height) / 2 + 'px'
34
34
  });
35
35
  } else {
36
36
  $(this).animate({
@@ -43,7 +43,7 @@
43
43
  right: 5
44
44
  });
45
45
  }
46
-
46
+
47
47
  }
48
48
  },
49
49
  parent: {
@@ -58,4 +58,4 @@
58
58
  addClass: ''
59
59
  };
60
60
 
61
- })(jQuery);
61
+ })(jQuery);
@@ -3,7 +3,7 @@
3
3
  $.noty.layouts.topCenter = {
4
4
  name: 'topCenter',
5
5
  options: { // overrides options
6
-
6
+
7
7
  },
8
8
  container: {
9
9
  object: '<ul id="noty_topCenter_layout_container" />',
@@ -20,9 +20,9 @@
20
20
  listStyleType: 'none',
21
21
  zIndex: 10000000
22
22
  });
23
-
23
+
24
24
  $(this).css({
25
- left: ($(window).width() - $(this).outerWidth()) / 2 + 'px',
25
+ left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px'
26
26
  });
27
27
  }
28
28
  },
@@ -38,4 +38,4 @@
38
38
  addClass: ''
39
39
  };
40
40
 
41
- })(jQuery);
41
+ })(jQuery);
@@ -1,7 +1,7 @@
1
1
  ;(function($) {
2
2
 
3
- $.noty.themes.default = {
4
- name: 'default',
3
+ $.noty.themes.defaultTheme = {
4
+ name: 'defaultTheme',
5
5
  helpers: {
6
6
  borderFix: function() {
7
7
  if (this.options.dismissQueue) {
@@ -34,16 +34,16 @@
34
34
  opacity: 0.6,
35
35
  display: 'none',
36
36
  left: 0,
37
- top: 0,
37
+ top: 0
38
38
  }
39
39
  },
40
40
  style: function() {
41
-
41
+
42
42
  this.$bar.css({
43
43
  overflow: 'hidden',
44
44
  background: "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAoCAYAAAAPOoFWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPZJREFUeNq81tsOgjAMANB2ov7/7ypaN7IlIwi9rGuT8QSc9EIDAsAznxvY4pXPKr05RUE5MEVB+TyWfCEl9LZApYopCmo9C4FKSMtYoI8Bwv79aQJU4l6hXXCZrQbokJEksxHo9KMOgc6w1atHXM8K9DVC7FQnJ0i8iK3QooGgbnyKgMDygBWyYFZoqx4qS27KqLZJjA1D0jK6QJcYEQEiWv9PGkTsbqxQ8oT+ZtZB6AkdsJnQDnMoHXHLGKOgDYuCWmYhEERCI5gaamW0bnHdA3k2ltlIN+2qKRyCND0bhqSYCyTB3CAOc4WusBEIpkeBuPgJMAAX8Hs1NfqHRgAAAABJRU5ErkJggg==') repeat-x scroll left top #fff"
45
45
  });
46
-
46
+
47
47
  this.$message.css({
48
48
  fontSize: '13px',
49
49
  lineHeight: '16px',
@@ -52,36 +52,36 @@
52
52
  width: 'auto',
53
53
  position: 'relative'
54
54
  });
55
-
55
+
56
56
  this.$closeButton.css({
57
57
  position: 'absolute',
58
58
  top: 4, right: 4,
59
59
  width: 10, height: 10,
60
60
  background: "url(data:image/png;base64,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)",
61
61
  display: 'none',
62
- cursor: 'pointer',
62
+ cursor: 'pointer'
63
63
  });
64
-
64
+
65
65
  this.$buttons.css({
66
66
  padding: 5,
67
67
  textAlign: 'right',
68
68
  borderTop: '1px solid #ccc',
69
- backgroundColor: '#fff',
69
+ backgroundColor: '#fff'
70
70
  });
71
-
71
+
72
72
  this.$buttons.find('button').css({
73
73
  marginLeft: 5
74
74
  });
75
-
75
+
76
76
  this.$buttons.find('button:first').css({
77
77
  marginLeft: 0
78
78
  });
79
-
79
+
80
80
  this.$bar.bind({
81
- mouseenter: function() { $(this).find('.noty_close').fadeIn(); },
82
- mouseleave: function() { $(this).find('.noty_close').fadeOut(); }
81
+ mouseenter: function() { $(this).find('.noty_close').stop().fadeTo('normal',1); },
82
+ mouseleave: function() { $(this).find('.noty_close').stop().fadeTo('normal',0); }
83
83
  });
84
-
84
+
85
85
  switch (this.options.layout.name) {
86
86
  case 'top':
87
87
  this.$bar.css({
@@ -126,31 +126,31 @@
126
126
  });
127
127
  break;
128
128
  }
129
-
129
+
130
130
  switch (this.options.type) {
131
131
  case 'alert': case 'notification':
132
132
  this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'}); break;
133
133
  case 'warning':
134
- this.$bar.css({backgroundColor: '#FFEAA8', borderColor: '#FFC237', color: '#826200'});
134
+ this.$bar.css({backgroundColor: '#FFEAA8', borderColor: '#FFC237', color: '#826200'});
135
135
  this.$buttons.css({borderTop: '1px solid #FFC237'}); break;
136
136
  case 'error':
137
137
  this.$bar.css({backgroundColor: 'red', borderColor: 'darkred', color: '#FFF'});
138
- this.$message.css({fontWeight: 'bold'});
138
+ this.$message.css({fontWeight: 'bold'});
139
139
  this.$buttons.css({borderTop: '1px solid darkred'}); break;
140
140
  case 'information':
141
- this.$bar.css({backgroundColor: '#57B7E2', borderColor: '#0B90C4', color: '#FFF'});
141
+ this.$bar.css({backgroundColor: '#57B7E2', borderColor: '#0B90C4', color: '#FFF'});
142
142
  this.$buttons.css({borderTop: '1px solid #0B90C4'}); break;
143
143
  case 'success':
144
- this.$bar.css({backgroundColor: 'lightgreen', borderColor: '#50C24E', color: 'darkgreen'});
144
+ this.$bar.css({backgroundColor: 'lightgreen', borderColor: '#50C24E', color: 'darkgreen'});
145
145
  this.$buttons.css({borderTop: '1px solid #50C24E'});break;
146
146
  default:
147
147
  this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'}); break;
148
148
  }
149
149
  },
150
150
  callback: {
151
- onShow: function() { $.noty.themes.default.helpers.borderFix.apply(this); },
152
- onClose: function() { $.noty.themes.default.helpers.borderFix.apply(this); }
151
+ onShow: function() { $.noty.themes.defaultTheme.helpers.borderFix.apply(this); },
152
+ onClose: function() { $.noty.themes.defaultTheme.helpers.borderFix.apply(this); }
153
153
  }
154
154
  };
155
155
 
156
- })(jQuery);
156
+ })(jQuery);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noty-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - PikachuEXE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-25 00:00:00.000000000 Z
11
+ date: 2013-09-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This gem provides Noty, a jQuery Notification Plugin, for your Rails
14
14
  application.
@@ -59,8 +59,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  version: '0'
60
60
  requirements: []
61
61
  rubyforge_project:
62
- rubygems_version: 2.0.3
62
+ rubygems_version: 2.0.7
63
63
  signing_key:
64
64
  specification_version: 4
65
65
  summary: Noty asset pipeline provider/wrapper
66
66
  test_files: []
67
+ has_rdoc: