h2ocube_rails_assets 0.0.19 → 0.0.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/README.md +1 -0
  4. data/Vendorfile +196 -0
  5. data/h2ocube_rails_assets.gemspec +3 -4
  6. data/lib/h2ocube_rails_assets.rb +8 -6
  7. data/test/jquery_test.rb +1 -1
  8. data/test/turbolinks_test.rb +1 -3
  9. data/vendor/assets/images/jquery.fancybox/fancybox_loading.gif +0 -0
  10. data/vendor/assets/images/jquery.fancybox/fancybox_loading@2x.gif +0 -0
  11. data/vendor/assets/images/jquery.fancybox/fancybox_sprite@2x.png +0 -0
  12. data/vendor/assets/javascripts/backbone.js +4 -1571
  13. data/vendor/assets/javascripts/bootstrap.js +6 -2276
  14. data/vendor/assets/javascripts/highcharts.js +272 -15281
  15. data/vendor/assets/javascripts/jasny-bootstrap.js +7 -3060
  16. data/vendor/assets/javascripts/jquery/1.10.js +6 -9807
  17. data/vendor/assets/javascripts/jquery/1.8.js +2 -9472
  18. data/vendor/assets/javascripts/jquery/1.9.js +5 -9597
  19. data/vendor/assets/javascripts/jquery/2.0.js +5 -8841
  20. data/vendor/assets/javascripts/jquery.cookie.js +26 -23
  21. data/vendor/assets/javascripts/jquery.fancybox.js +46 -1983
  22. data/vendor/assets/javascripts/jquery.fileupload.js +1329 -4
  23. data/vendor/assets/javascripts/jquery.iframe-transport.js +24 -4
  24. data/vendor/assets/javascripts/jquery.js +1 -1
  25. data/vendor/assets/javascripts/jquery.lazyload.js +3 -216
  26. data/vendor/assets/javascripts/jquery.mobile.js +7 -11092
  27. data/vendor/assets/javascripts/jquery.pnotify.js +29 -903
  28. data/vendor/assets/javascripts/jquery.timeago.coffee +2 -4
  29. data/vendor/assets/javascripts/jquery.turbolinks.coffee +40 -51
  30. data/vendor/assets/javascripts/jquery.ui/jquery.ui.accordion.js +4 -572
  31. data/vendor/assets/javascripts/jquery.ui/jquery.ui.autocomplete.js +4 -610
  32. data/vendor/assets/javascripts/jquery.ui/jquery.ui.button.js +4 -419
  33. data/vendor/assets/javascripts/jquery.ui/jquery.ui.core.js +4 -320
  34. data/vendor/assets/javascripts/jquery.ui/jquery.ui.datepicker.js +5 -2050
  35. data/vendor/assets/javascripts/jquery.ui/jquery.ui.dialog.js +4 -808
  36. data/vendor/assets/javascripts/jquery.ui/jquery.ui.draggable.js +4 -933
  37. data/vendor/assets/javascripts/jquery.ui/jquery.ui.droppable.js +4 -372
  38. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-blind.js +4 -82
  39. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-bounce.js +4 -113
  40. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-clip.js +4 -67
  41. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-drop.js +4 -65
  42. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-explode.js +4 -97
  43. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-fade.js +4 -30
  44. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-fold.js +4 -76
  45. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-highlight.js +4 -50
  46. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-pulsate.js +4 -63
  47. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-scale.js +4 -318
  48. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-shake.js +4 -74
  49. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-slide.js +4 -64
  50. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect-transfer.js +4 -47
  51. data/vendor/assets/javascripts/jquery.ui/jquery.ui.effect.js +4 -1289
  52. data/vendor/assets/javascripts/jquery.ui/jquery.ui.menu.js +4 -621
  53. data/vendor/assets/javascripts/jquery.ui/jquery.ui.mouse.js +4 -169
  54. data/vendor/assets/javascripts/jquery.ui/jquery.ui.position.js +4 -497
  55. data/vendor/assets/javascripts/jquery.ui/jquery.ui.progressbar.js +4 -145
  56. data/vendor/assets/javascripts/jquery.ui/jquery.ui.resizable.js +4 -968
  57. data/vendor/assets/javascripts/jquery.ui/jquery.ui.selectable.js +4 -277
  58. data/vendor/assets/javascripts/jquery.ui/jquery.ui.slider.js +4 -672
  59. data/vendor/assets/javascripts/jquery.ui/jquery.ui.sortable.js +4 -1282
  60. data/vendor/assets/javascripts/jquery.ui/jquery.ui.spinner.js +4 -493
  61. data/vendor/assets/javascripts/jquery.ui/jquery.ui.tabs.js +4 -846
  62. data/vendor/assets/javascripts/jquery.ui/jquery.ui.tooltip.js +4 -402
  63. data/vendor/assets/javascripts/jquery.ui/jquery.ui.widget.js +4 -521
  64. data/vendor/assets/javascripts/jquery.validate.js +2 -1207
  65. data/vendor/assets/javascripts/lazyload.js +4 -391
  66. data/vendor/assets/javascripts/sammy.js +5 -2117
  67. data/vendor/assets/javascripts/underscore.js +4 -1224
  68. data/vendor/assets/javascripts/zepto.js +1 -1564
  69. data/vendor/assets/stylesheets/bootstrap.responsive.css +2 -1102
  70. data/vendor/assets/stylesheets/bootstrap.scss +2 -6151
  71. data/vendor/assets/stylesheets/jasny-bootstrap.responsive.css +2 -1263
  72. data/vendor/assets/stylesheets/jasny-bootstrap.scss +2 -7591
  73. data/vendor/assets/stylesheets/jquery.fancybox.scss +27 -2
  74. data/vendor/assets/stylesheets/jquery.mobile.scss +2 -3356
  75. data/vendor/assets/stylesheets/jquery.ui.scss +2 -1184
  76. metadata +43 -19
  77. data/vendor/assets/images/jquery.mobile/ajax-loader.gif +0 -0
  78. data/vendor/assets/images/jquery.mobile/icons-18-black.png +0 -0
  79. data/vendor/assets/images/jquery.mobile/icons-18-white.png +0 -0
  80. data/vendor/assets/images/jquery.mobile/icons-36-black.png +0 -0
  81. data/vendor/assets/images/jquery.mobile/icons-36-white.png +0 -0
  82. data/vendor/assets/javascripts/_jquery.fileupload.js +0 -1164
  83. data/vendor/assets/javascripts/zepto/fx_methods.js +0 -71
@@ -1,5 +1,3 @@
1
- //= require jquery
2
-
3
1
  /*
4
2
  * jQuery Pines Notify (pnotify) Plugin 1.2.0
5
3
  *
@@ -11,904 +9,32 @@
11
9
  * http://www.gnu.org/licenses/lgpl.html
12
10
  * http://www.mozilla.org/MPL/MPL-1.1.html
13
11
  */
14
-
15
- (function($) {
16
- var history_handle_top,
17
- timer,
18
- body,
19
- jwindow = $(window),
20
- styling = {
21
- jqueryui: {
22
- container: "ui-widget ui-widget-content ui-corner-all",
23
- notice: "ui-state-highlight",
24
- // (The actual jQUI notice icon looks terrible.)
25
- notice_icon: "ui-icon ui-icon-info",
26
- info: "",
27
- info_icon: "ui-icon ui-icon-info",
28
- success: "ui-state-default",
29
- success_icon: "ui-icon ui-icon-circle-check",
30
- error: "ui-state-error",
31
- error_icon: "ui-icon ui-icon-alert",
32
- closer: "ui-icon ui-icon-close",
33
- pin_up: "ui-icon ui-icon-pin-w",
34
- pin_down: "ui-icon ui-icon-pin-s",
35
- hi_menu: "ui-state-default ui-corner-bottom",
36
- hi_btn: "ui-state-default ui-corner-all",
37
- hi_btnhov: "ui-state-hover",
38
- hi_hnd: "ui-icon ui-icon-grip-dotted-horizontal"
39
- },
40
- bootstrap: {
41
- container: "alert",
42
- notice: "",
43
- notice_icon: "icon-exclamation-sign",
44
- info: "alert-info",
45
- info_icon: "icon-info-sign",
46
- success: "alert-success",
47
- success_icon: "icon-ok-sign",
48
- error: "alert-error",
49
- error_icon: "icon-warning-sign",
50
- closer: "icon-remove",
51
- pin_up: "icon-pause",
52
- pin_down: "icon-play",
53
- hi_menu: "well",
54
- hi_btn: "btn",
55
- hi_btnhov: "",
56
- hi_hnd: "icon-chevron-down"
57
- }
58
- };
59
- // Set global variables.
60
- var do_when_ready = function(){
61
- body = $("body");
62
- jwindow = $(window);
63
- // Reposition the notices when the window resizes.
64
- jwindow.bind('resize', function(){
65
- if (timer)
66
- clearTimeout(timer);
67
- timer = setTimeout($.pnotify_position_all, 10);
68
- });
69
- };
70
- if (document.body)
71
- do_when_ready();
72
- else
73
- $(do_when_ready);
74
- $.extend({
75
- pnotify_remove_all: function () {
76
- var notices_data = jwindow.data("pnotify");
77
- /* POA: Added null-check */
78
- if (notices_data && notices_data.length) {
79
- $.each(notices_data, function(){
80
- if (this.pnotify_remove)
81
- this.pnotify_remove();
82
- });
83
- }
84
- },
85
- pnotify_position_all: function () {
86
- // This timer is used for queueing this function so it doesn't run
87
- // repeatedly.
88
- if (timer)
89
- clearTimeout(timer);
90
- timer = null;
91
- // Get all the notices.
92
- var notices_data = jwindow.data("pnotify");
93
- if (!notices_data || !notices_data.length)
94
- return;
95
- // Reset the next position data.
96
- $.each(notices_data, function(){
97
- var s = this.opts.stack;
98
- if (!s) return;
99
- s.nextpos1 = s.firstpos1;
100
- s.nextpos2 = s.firstpos2;
101
- s.addpos2 = 0;
102
- s.animation = true;
103
- });
104
- $.each(notices_data, function(){
105
- this.pnotify_position();
106
- });
107
- },
108
- pnotify: function(options) {
109
- // Stores what is currently being animated (in or out).
110
- var animating;
111
-
112
- // Build main options.
113
- var opts;
114
- if (typeof options != "object") {
115
- opts = $.extend({}, $.pnotify.defaults);
116
- opts.text = options;
117
- } else {
118
- opts = $.extend({}, $.pnotify.defaults, options);
119
- }
120
- // Translate old pnotify_ style options.
121
- for (var i in opts) {
122
- if (typeof i == "string" && i.match(/^pnotify_/))
123
- opts[i.replace(/^pnotify_/, "")] = opts[i];
124
- }
125
-
126
- if (opts.before_init) {
127
- if (opts.before_init(opts) === false)
128
- return null;
129
- }
130
-
131
- // This keeps track of the last element the mouse was over, so
132
- // mouseleave, mouseenter, etc can be called.
133
- var nonblock_last_elem;
134
- // This is used to pass events through the notice if it is non-blocking.
135
- var nonblock_pass = function(e, e_name){
136
- pnotify.css("display", "none");
137
- var element_below = document.elementFromPoint(e.clientX, e.clientY);
138
- pnotify.css("display", "block");
139
- var jelement_below = $(element_below);
140
- var cursor_style = jelement_below.css("cursor");
141
- pnotify.css("cursor", cursor_style != "auto" ? cursor_style : "default");
142
- // If the element changed, call mouseenter, mouseleave, etc.
143
- if (!nonblock_last_elem || nonblock_last_elem.get(0) != element_below) {
144
- if (nonblock_last_elem) {
145
- dom_event.call(nonblock_last_elem.get(0), "mouseleave", e.originalEvent);
146
- dom_event.call(nonblock_last_elem.get(0), "mouseout", e.originalEvent);
147
- }
148
- dom_event.call(element_below, "mouseenter", e.originalEvent);
149
- dom_event.call(element_below, "mouseover", e.originalEvent);
150
- }
151
- dom_event.call(element_below, e_name, e.originalEvent);
152
- // Remember the latest element the mouse was over.
153
- nonblock_last_elem = jelement_below;
154
- };
155
-
156
- // Get our styling object.
157
- var styles = styling[opts.styling];
158
-
159
- // Create our widget.
160
- // Stop animation, reset the removal timer, and show the close
161
- // button when the user mouses over.
162
- var pnotify = $("<div />", {
163
- "class": "ui-pnotify "+opts.addclass,
164
- "css": {"display": "none"},
165
- "mouseenter": function(e){
166
- if (opts.nonblock) e.stopPropagation();
167
- if (opts.mouse_reset && animating == "out") {
168
- // If it's animating out, animate back in really quickly.
169
- pnotify.stop(true);
170
- animating = "in";
171
- pnotify.css("height", "auto").animate({"width": opts.width, "opacity": opts.nonblock ? opts.nonblock_opacity : opts.opacity}, "fast");
172
- }
173
- if (opts.nonblock) {
174
- // If it's non-blocking, animate to the other opacity.
175
- pnotify.animate({"opacity": opts.nonblock_opacity}, "fast");
176
- }
177
- // Stop the close timer.
178
- if (opts.hide && opts.mouse_reset) pnotify.pnotify_cancel_remove();
179
- // Show the buttons.
180
- if (opts.sticker && !opts.nonblock) pnotify.sticker.trigger("pnotify_icon").css("visibility", "visible");
181
- if (opts.closer && !opts.nonblock) pnotify.closer.css("visibility", "visible");
182
- },
183
- "mouseleave": function(e){
184
- if (opts.nonblock) e.stopPropagation();
185
- nonblock_last_elem = null;
186
- pnotify.css("cursor", "auto");
187
- // Animate back to the normal opacity.
188
- if (opts.nonblock && animating != "out")
189
- pnotify.animate({"opacity": opts.opacity}, "fast");
190
- // Start the close timer.
191
- if (opts.hide && opts.mouse_reset) pnotify.pnotify_queue_remove();
192
- // Hide the buttons.
193
- if (opts.sticker_hover)
194
- pnotify.sticker.css("visibility", "hidden");
195
- if (opts.closer_hover)
196
- pnotify.closer.css("visibility", "hidden");
197
- $.pnotify_position_all();
198
- },
199
- "mouseover": function(e){
200
- if (opts.nonblock) e.stopPropagation();
201
- },
202
- "mouseout": function(e){
203
- if (opts.nonblock) e.stopPropagation();
204
- },
205
- "mousemove": function(e){
206
- if (opts.nonblock) {
207
- e.stopPropagation();
208
- nonblock_pass(e, "onmousemove");
209
- }
210
- },
211
- "mousedown": function(e){
212
- if (opts.nonblock) {
213
- e.stopPropagation();
214
- e.preventDefault();
215
- nonblock_pass(e, "onmousedown");
216
- }
217
- },
218
- "mouseup": function(e){
219
- if (opts.nonblock) {
220
- e.stopPropagation();
221
- e.preventDefault();
222
- nonblock_pass(e, "onmouseup");
223
- }
224
- },
225
- "click": function(e){
226
- if (opts.nonblock) {
227
- e.stopPropagation();
228
- nonblock_pass(e, "onclick");
229
- }
230
- },
231
- "dblclick": function(e){
232
- if (opts.nonblock) {
233
- e.stopPropagation();
234
- nonblock_pass(e, "ondblclick");
235
- }
236
- }
237
- });
238
- pnotify.opts = opts;
239
- // Create a container for the notice contents.
240
- pnotify.container = $("<div />", {"class": styles.container+" ui-pnotify-container "+(opts.type == "error" ? styles.error : (opts.type == "info" ? styles.info : (opts.type == "success" ? styles.success : styles.notice)))})
241
- .appendTo(pnotify);
242
- if (opts.cornerclass != "")
243
- pnotify.container.removeClass("ui-corner-all").addClass(opts.cornerclass);
244
- // Create a drop shadow.
245
- if (opts.shadow)
246
- pnotify.container.addClass("ui-pnotify-shadow");
247
-
248
- // The current version of Pines Notify.
249
- pnotify.pnotify_version = "1.2.0";
250
-
251
- // This function is for updating the notice.
252
- pnotify.pnotify = function(options) {
253
- // Update the notice.
254
- var old_opts = opts;
255
- if (typeof options == "string")
256
- opts.text = options;
257
- else
258
- opts = $.extend({}, opts, options);
259
- // Translate old pnotify_ style options.
260
- for (var i in opts) {
261
- if (typeof i == "string" && i.match(/^pnotify_/))
262
- opts[i.replace(/^pnotify_/, "")] = opts[i];
263
- }
264
- pnotify.opts = opts;
265
- // Update the corner class.
266
- if (opts.cornerclass != old_opts.cornerclass)
267
- pnotify.container.removeClass("ui-corner-all").addClass(opts.cornerclass);
268
- // Update the shadow.
269
- if (opts.shadow != old_opts.shadow) {
270
- if (opts.shadow)
271
- pnotify.container.addClass("ui-pnotify-shadow");
272
- else
273
- pnotify.container.removeClass("ui-pnotify-shadow");
274
- }
275
- // Update the additional classes.
276
- if (opts.addclass === false)
277
- pnotify.removeClass(old_opts.addclass);
278
- else if (opts.addclass !== old_opts.addclass)
279
- pnotify.removeClass(old_opts.addclass).addClass(opts.addclass);
280
- // Update the title.
281
- if (opts.title === false)
282
- pnotify.title_container.slideUp("fast");
283
- else if (opts.title !== old_opts.title) {
284
- if (opts.title_escape)
285
- pnotify.title_container.text(opts.title).slideDown(200);
286
- else
287
- pnotify.title_container.html(opts.title).slideDown(200);
288
- }
289
- // Update the text.
290
- if (opts.text === false) {
291
- pnotify.text_container.slideUp("fast");
292
- } else if (opts.text !== old_opts.text) {
293
- if (opts.text_escape)
294
- pnotify.text_container.text(opts.text).slideDown(200);
295
- else
296
- pnotify.text_container.html(opts.insert_brs ? String(opts.text).replace(/\n/g, "<br />") : opts.text).slideDown(200);
297
- }
298
- // Update values for history menu access.
299
- pnotify.pnotify_history = opts.history;
300
- pnotify.pnotify_hide = opts.hide;
301
- // Change the notice type.
302
- if (opts.type != old_opts.type)
303
- pnotify.container.removeClass(styles.error+" "+styles.notice+" "+styles.success+" "+styles.info).addClass(opts.type == "error" ? styles.error : (opts.type == "info" ? styles.info : (opts.type == "success" ? styles.success : styles.notice)));
304
- if (opts.icon !== old_opts.icon || (opts.icon === true && opts.type != old_opts.type)) {
305
- // Remove any old icon.
306
- pnotify.container.find("div.ui-pnotify-icon").remove();
307
- if (opts.icon !== false) {
308
- // Build the new icon.
309
- $("<div />", {"class": "ui-pnotify-icon"})
310
- .append($("<span />", {"class": opts.icon === true ? (opts.type == "error" ? styles.error_icon : (opts.type == "info" ? styles.info_icon : (opts.type == "success" ? styles.success_icon : styles.notice_icon))) : opts.icon}))
311
- .prependTo(pnotify.container);
312
- }
313
- }
314
- // Update the width.
315
- if (opts.width !== old_opts.width)
316
- pnotify.animate({width: opts.width});
317
- // Update the minimum height.
318
- if (opts.min_height !== old_opts.min_height)
319
- pnotify.container.animate({minHeight: opts.min_height});
320
- // Update the opacity.
321
- if (opts.opacity !== old_opts.opacity)
322
- pnotify.fadeTo(opts.animate_speed, opts.opacity);
323
- // Update the sticker and closer buttons.
324
- if (!opts.closer || opts.nonblock)
325
- pnotify.closer.css("display", "none");
326
- else
327
- pnotify.closer.css("display", "block");
328
- if (!opts.sticker || opts.nonblock)
329
- pnotify.sticker.css("display", "none");
330
- else
331
- pnotify.sticker.css("display", "block");
332
- // Update the sticker icon.
333
- pnotify.sticker.trigger("pnotify_icon");
334
- // Update the hover status of the buttons.
335
- if (opts.sticker_hover)
336
- pnotify.sticker.css("visibility", "hidden");
337
- else if (!opts.nonblock)
338
- pnotify.sticker.css("visibility", "visible");
339
- if (opts.closer_hover)
340
- pnotify.closer.css("visibility", "hidden");
341
- else if (!opts.nonblock)
342
- pnotify.closer.css("visibility", "visible");
343
- // Update the timed hiding.
344
- if (!opts.hide)
345
- pnotify.pnotify_cancel_remove();
346
- else if (!old_opts.hide)
347
- pnotify.pnotify_queue_remove();
348
- pnotify.pnotify_queue_position();
349
- return pnotify;
350
- };
351
-
352
- // Position the notice. dont_skip_hidden causes the notice to
353
- // position even if it's not visible.
354
- pnotify.pnotify_position = function(dont_skip_hidden){
355
- // Get the notice's stack.
356
- var s = pnotify.opts.stack;
357
- if (!s) return;
358
- if (!s.nextpos1)
359
- s.nextpos1 = s.firstpos1;
360
- if (!s.nextpos2)
361
- s.nextpos2 = s.firstpos2;
362
- if (!s.addpos2)
363
- s.addpos2 = 0;
364
- var hidden = pnotify.css("display") == "none";
365
- // Skip this notice if it's not shown.
366
- if (!hidden || dont_skip_hidden) {
367
- var curpos1, curpos2;
368
- // Store what will need to be animated.
369
- var animate = {};
370
- // Calculate the current pos1 value.
371
- var csspos1;
372
- switch (s.dir1) {
373
- case "down":
374
- csspos1 = "top";
375
- break;
376
- case "up":
377
- csspos1 = "bottom";
378
- break;
379
- case "left":
380
- csspos1 = "right";
381
- break;
382
- case "right":
383
- csspos1 = "left";
384
- break;
385
- }
386
- curpos1 = parseInt(pnotify.css(csspos1));
387
- if (isNaN(curpos1))
388
- curpos1 = 0;
389
- // Remember the first pos1, so the first visible notice goes there.
390
- if (typeof s.firstpos1 == "undefined" && !hidden) {
391
- s.firstpos1 = curpos1;
392
- s.nextpos1 = s.firstpos1;
393
- }
394
- // Calculate the current pos2 value.
395
- var csspos2;
396
- switch (s.dir2) {
397
- case "down":
398
- csspos2 = "top";
399
- break;
400
- case "up":
401
- csspos2 = "bottom";
402
- break;
403
- case "left":
404
- csspos2 = "right";
405
- break;
406
- case "right":
407
- csspos2 = "left";
408
- break;
409
- }
410
- curpos2 = parseInt(pnotify.css(csspos2));
411
- if (isNaN(curpos2))
412
- curpos2 = 0;
413
- // Remember the first pos2, so the first visible notice goes there.
414
- if (typeof s.firstpos2 == "undefined" && !hidden) {
415
- s.firstpos2 = curpos2;
416
- s.nextpos2 = s.firstpos2;
417
- }
418
- // Check that it's not beyond the viewport edge.
419
- if ((s.dir1 == "down" && s.nextpos1 + pnotify.height() > jwindow.height()) ||
420
- (s.dir1 == "up" && s.nextpos1 + pnotify.height() > jwindow.height()) ||
421
- (s.dir1 == "left" && s.nextpos1 + pnotify.width() > jwindow.width()) ||
422
- (s.dir1 == "right" && s.nextpos1 + pnotify.width() > jwindow.width()) ) {
423
- // If it is, it needs to go back to the first pos1, and over on pos2.
424
- s.nextpos1 = s.firstpos1;
425
- s.nextpos2 += s.addpos2 + (typeof s.spacing2 == "undefined" ? 25 : s.spacing2);
426
- s.addpos2 = 0;
427
- }
428
- // Animate if we're moving on dir2.
429
- if (s.animation && s.nextpos2 < curpos2) {
430
- switch (s.dir2) {
431
- case "down":
432
- animate.top = s.nextpos2+"px";
433
- break;
434
- case "up":
435
- animate.bottom = s.nextpos2+"px";
436
- break;
437
- case "left":
438
- animate.right = s.nextpos2+"px";
439
- break;
440
- case "right":
441
- animate.left = s.nextpos2+"px";
442
- break;
443
- }
444
- } else
445
- pnotify.css(csspos2, s.nextpos2+"px");
446
- // Keep track of the widest/tallest notice in the column/row, so we can push the next column/row.
447
- switch (s.dir2) {
448
- case "down":
449
- case "up":
450
- if (pnotify.outerHeight(true) > s.addpos2)
451
- s.addpos2 = pnotify.height();
452
- break;
453
- case "left":
454
- case "right":
455
- if (pnotify.outerWidth(true) > s.addpos2)
456
- s.addpos2 = pnotify.width();
457
- break;
458
- }
459
- // Move the notice on dir1.
460
- if (s.nextpos1) {
461
- // Animate if we're moving toward the first pos.
462
- if (s.animation && (curpos1 > s.nextpos1 || animate.top || animate.bottom || animate.right || animate.left)) {
463
- switch (s.dir1) {
464
- case "down":
465
- animate.top = s.nextpos1+"px";
466
- break;
467
- case "up":
468
- animate.bottom = s.nextpos1+"px";
469
- break;
470
- case "left":
471
- animate.right = s.nextpos1+"px";
472
- break;
473
- case "right":
474
- animate.left = s.nextpos1+"px";
475
- break;
476
- }
477
- } else
478
- pnotify.css(csspos1, s.nextpos1+"px");
479
- }
480
- // Run the animation.
481
- if (animate.top || animate.bottom || animate.right || animate.left)
482
- pnotify.animate(animate, {duration: 500, queue: false});
483
- // Calculate the next dir1 position.
484
- switch (s.dir1) {
485
- case "down":
486
- case "up":
487
- s.nextpos1 += pnotify.height() + (typeof s.spacing1 == "undefined" ? 25 : s.spacing1);
488
- break;
489
- case "left":
490
- case "right":
491
- s.nextpos1 += pnotify.width() + (typeof s.spacing1 == "undefined" ? 25 : s.spacing1);
492
- break;
493
- }
494
- }
495
- };
496
-
497
- // Queue the positiona all function so it doesn't run repeatedly and
498
- // use up resources.
499
- pnotify.pnotify_queue_position = function(milliseconds){
500
- if (timer)
501
- clearTimeout(timer);
502
- if (!milliseconds)
503
- milliseconds = 10;
504
- timer = setTimeout($.pnotify_position_all, milliseconds);
505
- };
506
-
507
- // Display the notice.
508
- pnotify.pnotify_display = function() {
509
- // If the notice is not in the DOM, append it.
510
- if (!pnotify.parent().length)
511
- pnotify.appendTo(body);
512
- // Run callback.
513
- if (opts.before_open) {
514
- if (opts.before_open(pnotify) === false)
515
- return;
516
- }
517
- // Try to put it in the right position.
518
- if (opts.stack.push != "top")
519
- pnotify.pnotify_position(true);
520
- // First show it, then set its opacity, then hide it.
521
- if (opts.animation == "fade" || opts.animation.effect_in == "fade") {
522
- // If it's fading in, it should start at 0.
523
- pnotify.show().fadeTo(0, 0).hide();
524
- } else {
525
- // Or else it should be set to the opacity.
526
- if (opts.opacity != 1)
527
- pnotify.show().fadeTo(0, opts.opacity).hide();
528
- }
529
- pnotify.animate_in(function(){
530
- if (opts.after_open)
531
- opts.after_open(pnotify);
532
-
533
- pnotify.pnotify_queue_position();
534
-
535
- // Now set it to hide.
536
- if (opts.hide)
537
- pnotify.pnotify_queue_remove();
538
- });
539
- };
540
-
541
- // Remove the notice.
542
- pnotify.pnotify_remove = function() {
543
- if (pnotify.timer) {
544
- window.clearTimeout(pnotify.timer);
545
- pnotify.timer = null;
546
- }
547
- // Run callback.
548
- if (opts.before_close) {
549
- if (opts.before_close(pnotify) === false)
550
- return;
551
- }
552
- pnotify.animate_out(function(){
553
- if (opts.after_close) {
554
- if (opts.after_close(pnotify) === false)
555
- return;
556
- }
557
- pnotify.pnotify_queue_position();
558
- // If we're supposed to remove the notice from the DOM, do it.
559
- if (opts.remove)
560
- pnotify.detach();
561
- });
562
- };
563
-
564
- // Animate the notice in.
565
- pnotify.animate_in = function(callback){
566
- // Declare that the notice is animating in. (Or has completed animating in.)
567
- animating = "in";
568
- var animation;
569
- if (typeof opts.animation.effect_in != "undefined")
570
- animation = opts.animation.effect_in;
571
- else
572
- animation = opts.animation;
573
- if (animation == "none") {
574
- pnotify.show();
575
- callback();
576
- } else if (animation == "show")
577
- pnotify.show(opts.animate_speed, callback);
578
- else if (animation == "fade")
579
- pnotify.show().fadeTo(opts.animate_speed, opts.opacity, callback);
580
- else if (animation == "slide")
581
- pnotify.slideDown(opts.animate_speed, callback);
582
- else if (typeof animation == "function")
583
- animation("in", callback, pnotify);
584
- else
585
- pnotify.show(animation, (typeof opts.animation.options_in == "object" ? opts.animation.options_in : {}), opts.animate_speed, callback);
586
- };
587
-
588
- // Animate the notice out.
589
- pnotify.animate_out = function(callback){
590
- // Declare that the notice is animating out. (Or has completed animating out.)
591
- animating = "out";
592
- var animation;
593
- if (typeof opts.animation.effect_out != "undefined")
594
- animation = opts.animation.effect_out;
595
- else
596
- animation = opts.animation;
597
- if (animation == "none") {
598
- pnotify.hide();
599
- callback();
600
- } else if (animation == "show")
601
- pnotify.hide(opts.animate_speed, callback);
602
- else if (animation == "fade")
603
- pnotify.fadeOut(opts.animate_speed, callback);
604
- else if (animation == "slide")
605
- pnotify.slideUp(opts.animate_speed, callback);
606
- else if (typeof animation == "function")
607
- animation("out", callback, pnotify);
608
- else
609
- pnotify.hide(animation, (typeof opts.animation.options_out == "object" ? opts.animation.options_out : {}), opts.animate_speed, callback);
610
- };
611
-
612
- // Cancel any pending removal timer.
613
- pnotify.pnotify_cancel_remove = function() {
614
- if (pnotify.timer)
615
- window.clearTimeout(pnotify.timer);
616
- };
617
-
618
- // Queue a removal timer.
619
- pnotify.pnotify_queue_remove = function() {
620
- // Cancel any current removal timer.
621
- pnotify.pnotify_cancel_remove();
622
- pnotify.timer = window.setTimeout(function(){
623
- pnotify.pnotify_remove();
624
- }, (isNaN(opts.delay) ? 0 : opts.delay));
625
- };
626
-
627
- // Provide a button to close the notice.
628
- pnotify.closer = $("<div />", {
629
- "class": "ui-pnotify-closer",
630
- "css": {"cursor": "pointer", "visibility": opts.closer_hover ? "hidden" : "visible"},
631
- "click": function(){
632
- pnotify.pnotify_remove();
633
- pnotify.sticker.css("visibility", "hidden");
634
- pnotify.closer.css("visibility", "hidden");
635
- }
636
- })
637
- .append($("<span />", {"class": styles.closer}))
638
- .appendTo(pnotify.container);
639
- if (!opts.closer || opts.nonblock)
640
- pnotify.closer.css("display", "none");
641
-
642
- // Provide a button to stick the notice.
643
- pnotify.sticker = $("<div />", {
644
- "class": "ui-pnotify-sticker",
645
- "css": {"cursor": "pointer", "visibility": opts.sticker_hover ? "hidden" : "visible"},
646
- "click": function(){
647
- opts.hide = !opts.hide;
648
- if (opts.hide)
649
- pnotify.pnotify_queue_remove();
650
- else
651
- pnotify.pnotify_cancel_remove();
652
- $(this).trigger("pnotify_icon");
653
- }
654
- })
655
- .bind("pnotify_icon", function(){
656
- $(this).children().removeClass(styles.pin_up+" "+styles.pin_down).addClass(opts.hide ? styles.pin_up : styles.pin_down);
657
- })
658
- .append($("<span />", {"class": styles.pin_up}))
659
- .appendTo(pnotify.container);
660
- if (!opts.sticker || opts.nonblock)
661
- pnotify.sticker.css("display", "none");
662
-
663
- // Add the appropriate icon.
664
- if (opts.icon !== false) {
665
- $("<div />", {"class": "ui-pnotify-icon"})
666
- .append($("<span />", {"class": opts.icon === true ? (opts.type == "error" ? styles.error_icon : (opts.type == "info" ? styles.info_icon : (opts.type == "success" ? styles.success_icon : styles.notice_icon))) : opts.icon}))
667
- .prependTo(pnotify.container);
668
- }
669
-
670
- // Add a title.
671
- pnotify.title_container = $("<h4 />", {
672
- "class": "ui-pnotify-title"
673
- })
674
- .appendTo(pnotify.container);
675
- if (opts.title === false)
676
- pnotify.title_container.hide();
677
- else if (opts.title_escape)
678
- pnotify.title_container.text(opts.title);
679
- else
680
- pnotify.title_container.html(opts.title);
681
-
682
- // Add text.
683
- pnotify.text_container = $("<div />", {
684
- "class": "ui-pnotify-text"
685
- })
686
- .appendTo(pnotify.container);
687
- if (opts.text === false)
688
- pnotify.text_container.hide();
689
- else if (opts.text_escape)
690
- pnotify.text_container.text(opts.text);
691
- else
692
- pnotify.text_container.html(opts.insert_brs ? String(opts.text).replace(/\n/g, "<br />") : opts.text);
693
-
694
- // Set width and min height.
695
- if (typeof opts.width == "string")
696
- pnotify.css("width", opts.width);
697
- if (typeof opts.min_height == "string")
698
- pnotify.container.css("min-height", opts.min_height);
699
-
700
- // The history variable controls whether the notice gets redisplayed
701
- // by the history pull down.
702
- pnotify.pnotify_history = opts.history;
703
- // The hide variable controls whether the history pull down should
704
- // queue a removal timer.
705
- pnotify.pnotify_hide = opts.hide;
706
-
707
- // Add the notice to the notice array.
708
- var notices_data = jwindow.data("pnotify");
709
- if (notices_data == null || typeof notices_data != "object")
710
- notices_data = [];
711
- if (opts.stack.push == "top")
712
- notices_data = $.merge([pnotify], notices_data);
713
- else
714
- notices_data = $.merge(notices_data, [pnotify]);
715
- jwindow.data("pnotify", notices_data);
716
- // Now position all the notices if they are to push to the top.
717
- if (opts.stack.push == "top")
718
- pnotify.pnotify_queue_position(1);
719
-
720
- // Run callback.
721
- if (opts.after_init)
722
- opts.after_init(pnotify);
723
-
724
- if (opts.history) {
725
- // If there isn't a history pull down, create one.
726
- var history_menu = jwindow.data("pnotify_history");
727
- if (typeof history_menu == "undefined") {
728
- history_menu = $("<div />", {
729
- "class": "ui-pnotify-history-container "+styles.hi_menu,
730
- "mouseleave": function(){
731
- history_menu.animate({top: "-"+history_handle_top+"px"}, {duration: 100, queue: false});
732
- }
733
- })
734
- .append($("<div />", {"class": "ui-pnotify-history-header", "text": "Redisplay"}))
735
- .append($("<button />", {
736
- "class": "ui-pnotify-history-all "+styles.hi_btn,
737
- "text": "All",
738
- "mouseenter": function(){
739
- $(this).addClass(styles.hi_btnhov);
740
- },
741
- "mouseleave": function(){
742
- $(this).removeClass(styles.hi_btnhov);
743
- },
744
- "click": function(){
745
- // Display all notices. (Disregarding non-history notices.)
746
- $.each(notices_data, function(){
747
- if (this.pnotify_history) {
748
- if (this.is(":visible")) {
749
- if (this.pnotify_hide)
750
- this.pnotify_queue_remove();
751
- } else if (this.pnotify_display)
752
- this.pnotify_display();
753
- }
754
- });
755
- return false;
756
- }
757
- }))
758
- .append($("<button />", {
759
- "class": "ui-pnotify-history-last "+styles.hi_btn,
760
- "text": "Last",
761
- "mouseenter": function(){
762
- $(this).addClass(styles.hi_btnhov);
763
- },
764
- "mouseleave": function(){
765
- $(this).removeClass(styles.hi_btnhov);
766
- },
767
- "click": function(){
768
- // Look up the last history notice, and display it.
769
- var i = -1;
770
- var notice;
771
- do {
772
- if (i == -1)
773
- notice = notices_data.slice(i);
774
- else
775
- notice = notices_data.slice(i, i+1);
776
- if (!notice[0])
777
- break;
778
- i--;
779
- } while (!notice[0].pnotify_history || notice[0].is(":visible"));
780
- if (!notice[0])
781
- return false;
782
- if (notice[0].pnotify_display)
783
- notice[0].pnotify_display();
784
- return false;
785
- }
786
- }))
787
- .appendTo(body);
788
-
789
- // Make a handle so the user can pull down the history tab.
790
- var handle = $("<span />", {
791
- "class": "ui-pnotify-history-pulldown "+styles.hi_hnd,
792
- "mouseenter": function(){
793
- history_menu.animate({top: "0"}, {duration: 100, queue: false});
794
- }
795
- })
796
- .appendTo(history_menu);
797
-
798
- // Get the top of the handle.
799
- history_handle_top = handle.offset().top + 2;
800
- // Hide the history pull down up to the top of the handle.
801
- history_menu.css({top: "-"+history_handle_top+"px"});
802
- // Save the history pull down.
803
- jwindow.data("pnotify_history", history_menu);
804
- }
805
- }
806
-
807
- // Mark the stack so it won't animate the new notice.
808
- opts.stack.animation = false;
809
-
810
- // Display the notice.
811
- pnotify.pnotify_display();
812
-
813
- return pnotify;
814
- }
815
- });
816
-
817
- // Some useful regexes.
818
- var re_on = /^on/,
819
- re_mouse_events = /^(dbl)?click$|^mouse(move|down|up|over|out|enter|leave)$|^contextmenu$/,
820
- re_ui_events = /^(focus|blur|select|change|reset)$|^key(press|down|up)$/,
821
- re_html_events = /^(scroll|resize|(un)?load|abort|error)$/;
822
- // Fire a DOM event.
823
- var dom_event = function(e, orig_e){
824
- var event_object;
825
- e = e.toLowerCase();
826
- if (document.createEvent && this.dispatchEvent) {
827
- // FireFox, Opera, Safari, Chrome
828
- e = e.replace(re_on, '');
829
- if (e.match(re_mouse_events)) {
830
- // This allows the click event to fire on the notice. There is
831
- // probably a much better way to do it.
832
- $(this).offset();
833
- event_object = document.createEvent("MouseEvents");
834
- event_object.initMouseEvent(
835
- e, orig_e.bubbles, orig_e.cancelable, orig_e.view, orig_e.detail,
836
- orig_e.screenX, orig_e.screenY, orig_e.clientX, orig_e.clientY,
837
- orig_e.ctrlKey, orig_e.altKey, orig_e.shiftKey, orig_e.metaKey, orig_e.button, orig_e.relatedTarget
838
- );
839
- } else if (e.match(re_ui_events)) {
840
- event_object = document.createEvent("UIEvents");
841
- event_object.initUIEvent(e, orig_e.bubbles, orig_e.cancelable, orig_e.view, orig_e.detail);
842
- } else if (e.match(re_html_events)) {
843
- event_object = document.createEvent("HTMLEvents");
844
- event_object.initEvent(e, orig_e.bubbles, orig_e.cancelable);
845
- }
846
- if (!event_object) return;
847
- this.dispatchEvent(event_object);
848
- } else {
849
- // Internet Explorer
850
- if (!e.match(re_on)) e = "on"+e;
851
- event_object = document.createEventObject(orig_e);
852
- this.fireEvent(e, event_object);
853
- }
854
- };
855
-
856
- $.pnotify.defaults = {
857
- // The notice's title.
858
- title: false,
859
- // Whether to escape the content of the title. (Not allow HTML.)
860
- title_escape: false,
861
- // The notice's text.
862
- text: false,
863
- // Whether to escape the content of the text. (Not allow HTML.)
864
- text_escape: false,
865
- // What styling classes to use. (Can be either jqueryui or bootstrap.)
866
- styling: "bootstrap",
867
- // Additional classes to be added to the notice. (For custom styling.)
868
- addclass: "",
869
- // Class to be added to the notice for corner styling.
870
- cornerclass: "",
871
- // Create a non-blocking notice. It lets the user click elements underneath it.
872
- nonblock: false,
873
- // The opacity of the notice (if it's non-blocking) when the mouse is over it.
874
- nonblock_opacity: .2,
875
- // Display a pull down menu to redisplay previous notices, and place the notice in the history.
876
- history: true,
877
- // Width of the notice.
878
- width: "300px",
879
- // Minimum height of the notice. It will expand to fit content.
880
- min_height: "16px",
881
- // Type of the notice. "notice", "info", "success", or "error".
882
- type: "notice",
883
- // Set icon to true to use the default icon for the selected style/type, false for no icon, or a string for your own icon class.
884
- icon: true,
885
- // The animation to use when displaying and hiding the notice. "none", "show", "fade", and "slide" are built in to jQuery. Others require jQuery UI. Use an object with effect_in and effect_out to use different effects.
886
- animation: "fade",
887
- // Speed at which the notice animates in and out. "slow", "def" or "normal", "fast" or number of milliseconds.
888
- animate_speed: "slow",
889
- // Opacity of the notice.
890
- opacity: 1,
891
- // Display a drop shadow.
892
- shadow: true,
893
- // Provide a button for the user to manually close the notice.
894
- closer: true,
895
- // Only show the closer button on hover.
896
- closer_hover: true,
897
- // Provide a button for the user to manually stick the notice.
898
- sticker: true,
899
- // Only show the sticker button on hover.
900
- sticker_hover: true,
901
- // After a delay, remove the notice.
902
- hide: true,
903
- // Delay in milliseconds before the notice is removed.
904
- delay: 8000,
905
- // Reset the hide timer if the mouse moves over the notice.
906
- mouse_reset: true,
907
- // Remove the notice's elements from the DOM after it is removed.
908
- remove: true,
909
- // Change new lines to br tags.
910
- insert_brs: true,
911
- // The stack on which the notices will be placed. Also controls the direction the notices stack.
912
- stack: {"dir1": "down", "dir2": "left", "push": "bottom", "spacing1": 25, "spacing2": 25}
913
- };
914
- })(jQuery);
12
+ (function(d){var q,j,r,i=d(window),u={jqueryui:{container:"ui-widget ui-widget-content ui-corner-all",notice:"ui-state-highlight",notice_icon:"ui-icon ui-icon-info",info:"",info_icon:"ui-icon ui-icon-info",success:"ui-state-default",success_icon:"ui-icon ui-icon-circle-check",error:"ui-state-error",error_icon:"ui-icon ui-icon-alert",closer:"ui-icon ui-icon-close",pin_up:"ui-icon ui-icon-pin-w",pin_down:"ui-icon ui-icon-pin-s",hi_menu:"ui-state-default ui-corner-bottom",hi_btn:"ui-state-default ui-corner-all",
13
+ hi_btnhov:"ui-state-hover",hi_hnd:"ui-icon ui-icon-grip-dotted-horizontal"},bootstrap:{container:"alert",notice:"",notice_icon:"icon-exclamation-sign",info:"alert-info",info_icon:"icon-info-sign",success:"alert-success",success_icon:"icon-ok-sign",error:"alert-error",error_icon:"icon-warning-sign",closer:"icon-remove",pin_up:"icon-pause",pin_down:"icon-play",hi_menu:"well",hi_btn:"btn",hi_btnhov:"",hi_hnd:"icon-chevron-down"}},s=function(){r=d("body");i=d(window);i.bind("resize",function(){j&&clearTimeout(j);
14
+ j=setTimeout(d.pnotify_position_all,10)})};document.body?s():d(s);d.extend({pnotify_remove_all:function(){var e=i.data("pnotify");e&&e.length&&d.each(e,function(){this.pnotify_remove&&this.pnotify_remove()})},pnotify_position_all:function(){j&&clearTimeout(j);j=null;var e=i.data("pnotify");e&&e.length&&(d.each(e,function(){var d=this.opts.stack;if(d)d.nextpos1=d.firstpos1,d.nextpos2=d.firstpos2,d.addpos2=0,d.animation=true}),d.each(e,function(){this.pnotify_position()}))},pnotify:function(e){var g,
15
+ a;typeof e!="object"?(a=d.extend({},d.pnotify.defaults),a.text=e):a=d.extend({},d.pnotify.defaults,e);for(var p in a)typeof p=="string"&&p.match(/^pnotify_/)&&(a[p.replace(/^pnotify_/,"")]=a[p]);if(a.before_init&&a.before_init(a)===false)return null;var k,o=function(a,c){b.css("display","none");var f=document.elementFromPoint(a.clientX,a.clientY);b.css("display","block");var e=d(f),g=e.css("cursor");b.css("cursor",g!="auto"?g:"default");if(!k||k.get(0)!=f)k&&(n.call(k.get(0),"mouseleave",a.originalEvent),
16
+ n.call(k.get(0),"mouseout",a.originalEvent)),n.call(f,"mouseenter",a.originalEvent),n.call(f,"mouseover",a.originalEvent);n.call(f,c,a.originalEvent);k=e},f=u[a.styling],b=d("<div />",{"class":"ui-pnotify "+a.addclass,css:{display:"none"},mouseenter:function(l){a.nonblock&&l.stopPropagation();a.mouse_reset&&g=="out"&&(b.stop(true),g="in",b.css("height","auto").animate({width:a.width,opacity:a.nonblock?a.nonblock_opacity:a.opacity},"fast"));a.nonblock&&b.animate({opacity:a.nonblock_opacity},"fast");
17
+ a.hide&&a.mouse_reset&&b.pnotify_cancel_remove();a.sticker&&!a.nonblock&&b.sticker.trigger("pnotify_icon").css("visibility","visible");a.closer&&!a.nonblock&&b.closer.css("visibility","visible")},mouseleave:function(l){a.nonblock&&l.stopPropagation();k=null;b.css("cursor","auto");a.nonblock&&g!="out"&&b.animate({opacity:a.opacity},"fast");a.hide&&a.mouse_reset&&b.pnotify_queue_remove();a.sticker_hover&&b.sticker.css("visibility","hidden");a.closer_hover&&b.closer.css("visibility","hidden");d.pnotify_position_all()},
18
+ mouseover:function(b){a.nonblock&&b.stopPropagation()},mouseout:function(b){a.nonblock&&b.stopPropagation()},mousemove:function(b){a.nonblock&&(b.stopPropagation(),o(b,"onmousemove"))},mousedown:function(b){a.nonblock&&(b.stopPropagation(),b.preventDefault(),o(b,"onmousedown"))},mouseup:function(b){a.nonblock&&(b.stopPropagation(),b.preventDefault(),o(b,"onmouseup"))},click:function(b){a.nonblock&&(b.stopPropagation(),o(b,"onclick"))},dblclick:function(b){a.nonblock&&(b.stopPropagation(),o(b,"ondblclick"))}});
19
+ b.opts=a;b.container=d("<div />",{"class":f.container+" ui-pnotify-container "+(a.type=="error"?f.error:a.type=="info"?f.info:a.type=="success"?f.success:f.notice)}).appendTo(b);a.cornerclass!=""&&b.container.removeClass("ui-corner-all").addClass(a.cornerclass);a.shadow&&b.container.addClass("ui-pnotify-shadow");b.pnotify_version="1.2.0";b.pnotify=function(l){var c=a;typeof l=="string"?a.text=l:a=d.extend({},a,l);for(var e in a)typeof e=="string"&&e.match(/^pnotify_/)&&(a[e.replace(/^pnotify_/,"")]=
20
+ a[e]);b.opts=a;a.cornerclass!=c.cornerclass&&b.container.removeClass("ui-corner-all").addClass(a.cornerclass);a.shadow!=c.shadow&&(a.shadow?b.container.addClass("ui-pnotify-shadow"):b.container.removeClass("ui-pnotify-shadow"));a.addclass===false?b.removeClass(c.addclass):a.addclass!==c.addclass&&b.removeClass(c.addclass).addClass(a.addclass);a.title===false?b.title_container.slideUp("fast"):a.title!==c.title&&(a.title_escape?b.title_container.text(a.title).slideDown(200):b.title_container.html(a.title).slideDown(200));
21
+ a.text===false?b.text_container.slideUp("fast"):a.text!==c.text&&(a.text_escape?b.text_container.text(a.text).slideDown(200):b.text_container.html(a.insert_brs?String(a.text).replace(/\n/g,"<br />"):a.text).slideDown(200));b.pnotify_history=a.history;b.pnotify_hide=a.hide;a.type!=c.type&&b.container.removeClass(f.error+" "+f.notice+" "+f.success+" "+f.info).addClass(a.type=="error"?f.error:a.type=="info"?f.info:a.type=="success"?f.success:f.notice);if(a.icon!==c.icon||a.icon===true&&a.type!=c.type)b.container.find("div.ui-pnotify-icon").remove(),
22
+ a.icon!==false&&d("<div />",{"class":"ui-pnotify-icon"}).append(d("<span />",{"class":a.icon===true?a.type=="error"?f.error_icon:a.type=="info"?f.info_icon:a.type=="success"?f.success_icon:f.notice_icon:a.icon})).prependTo(b.container);a.width!==c.width&&b.animate({width:a.width});a.min_height!==c.min_height&&b.container.animate({minHeight:a.min_height});a.opacity!==c.opacity&&b.fadeTo(a.animate_speed,a.opacity);!a.closer||a.nonblock?b.closer.css("display","none"):b.closer.css("display","block");
23
+ !a.sticker||a.nonblock?b.sticker.css("display","none"):b.sticker.css("display","block");b.sticker.trigger("pnotify_icon");a.sticker_hover?b.sticker.css("visibility","hidden"):a.nonblock||b.sticker.css("visibility","visible");a.closer_hover?b.closer.css("visibility","hidden"):a.nonblock||b.closer.css("visibility","visible");a.hide?c.hide||b.pnotify_queue_remove():b.pnotify_cancel_remove();b.pnotify_queue_position();return b};b.pnotify_position=function(a){var c=b.opts.stack;if(c){if(!c.nextpos1)c.nextpos1=
24
+ c.firstpos1;if(!c.nextpos2)c.nextpos2=c.firstpos2;if(!c.addpos2)c.addpos2=0;var d=b.css("display")=="none";if(!d||a){var f,e={},g;switch(c.dir1){case "down":g="top";break;case "up":g="bottom";break;case "left":g="right";break;case "right":g="left"}a=parseInt(b.css(g));isNaN(a)&&(a=0);if(typeof c.firstpos1=="undefined"&&!d)c.firstpos1=a,c.nextpos1=c.firstpos1;var h;switch(c.dir2){case "down":h="top";break;case "up":h="bottom";break;case "left":h="right";break;case "right":h="left"}f=parseInt(b.css(h));
25
+ isNaN(f)&&(f=0);if(typeof c.firstpos2=="undefined"&&!d)c.firstpos2=f,c.nextpos2=c.firstpos2;if(c.dir1=="down"&&c.nextpos1+b.height()>i.height()||c.dir1=="up"&&c.nextpos1+b.height()>i.height()||c.dir1=="left"&&c.nextpos1+b.width()>i.width()||c.dir1=="right"&&c.nextpos1+b.width()>i.width())c.nextpos1=c.firstpos1,c.nextpos2+=c.addpos2+(typeof c.spacing2=="undefined"?25:c.spacing2),c.addpos2=0;if(c.animation&&c.nextpos2<f)switch(c.dir2){case "down":e.top=c.nextpos2+"px";break;case "up":e.bottom=c.nextpos2+
26
+ "px";break;case "left":e.right=c.nextpos2+"px";break;case "right":e.left=c.nextpos2+"px"}else b.css(h,c.nextpos2+"px");switch(c.dir2){case "down":case "up":if(b.outerHeight(true)>c.addpos2)c.addpos2=b.height();break;case "left":case "right":if(b.outerWidth(true)>c.addpos2)c.addpos2=b.width()}if(c.nextpos1)if(c.animation&&(a>c.nextpos1||e.top||e.bottom||e.right||e.left))switch(c.dir1){case "down":e.top=c.nextpos1+"px";break;case "up":e.bottom=c.nextpos1+"px";break;case "left":e.right=c.nextpos1+"px";
27
+ break;case "right":e.left=c.nextpos1+"px"}else b.css(g,c.nextpos1+"px");(e.top||e.bottom||e.right||e.left)&&b.animate(e,{duration:500,queue:false});switch(c.dir1){case "down":case "up":c.nextpos1+=b.height()+(typeof c.spacing1=="undefined"?25:c.spacing1);break;case "left":case "right":c.nextpos1+=b.width()+(typeof c.spacing1=="undefined"?25:c.spacing1)}}}};b.pnotify_queue_position=function(a){j&&clearTimeout(j);a||(a=10);j=setTimeout(d.pnotify_position_all,a)};b.pnotify_display=function(){b.parent().length||
28
+ b.appendTo(r);a.before_open&&a.before_open(b)===false||(a.stack.push!="top"&&b.pnotify_position(true),a.animation=="fade"||a.animation.effect_in=="fade"?b.show().fadeTo(0,0).hide():a.opacity!=1&&b.show().fadeTo(0,a.opacity).hide(),b.animate_in(function(){a.after_open&&a.after_open(b);b.pnotify_queue_position();a.hide&&b.pnotify_queue_remove()}))};b.pnotify_remove=function(){if(b.timer)window.clearTimeout(b.timer),b.timer=null;a.before_close&&a.before_close(b)===false||b.animate_out(function(){a.after_close&&
29
+ a.after_close(b)===false||(b.pnotify_queue_position(),a.remove&&b.detach())})};b.animate_in=function(d){g="in";var c;c=typeof a.animation.effect_in!="undefined"?a.animation.effect_in:a.animation;c=="none"?(b.show(),d()):c=="show"?b.show(a.animate_speed,d):c=="fade"?b.show().fadeTo(a.animate_speed,a.opacity,d):c=="slide"?b.slideDown(a.animate_speed,d):typeof c=="function"?c("in",d,b):b.show(c,typeof a.animation.options_in=="object"?a.animation.options_in:{},a.animate_speed,d)};b.animate_out=function(d){g=
30
+ "out";var c;c=typeof a.animation.effect_out!="undefined"?a.animation.effect_out:a.animation;c=="none"?(b.hide(),d()):c=="show"?b.hide(a.animate_speed,d):c=="fade"?b.fadeOut(a.animate_speed,d):c=="slide"?b.slideUp(a.animate_speed,d):typeof c=="function"?c("out",d,b):b.hide(c,typeof a.animation.options_out=="object"?a.animation.options_out:{},a.animate_speed,d)};b.pnotify_cancel_remove=function(){b.timer&&window.clearTimeout(b.timer)};b.pnotify_queue_remove=function(){b.pnotify_cancel_remove();b.timer=
31
+ window.setTimeout(function(){b.pnotify_remove()},isNaN(a.delay)?0:a.delay)};b.closer=d("<div />",{"class":"ui-pnotify-closer",css:{cursor:"pointer",visibility:a.closer_hover?"hidden":"visible"},click:function(){b.pnotify_remove();b.sticker.css("visibility","hidden");b.closer.css("visibility","hidden")}}).append(d("<span />",{"class":f.closer})).appendTo(b.container);(!a.closer||a.nonblock)&&b.closer.css("display","none");b.sticker=d("<div />",{"class":"ui-pnotify-sticker",css:{cursor:"pointer",visibility:a.sticker_hover?
32
+ "hidden":"visible"},click:function(){a.hide=!a.hide;a.hide?b.pnotify_queue_remove():b.pnotify_cancel_remove();d(this).trigger("pnotify_icon")}}).bind("pnotify_icon",function(){d(this).children().removeClass(f.pin_up+" "+f.pin_down).addClass(a.hide?f.pin_up:f.pin_down)}).append(d("<span />",{"class":f.pin_up})).appendTo(b.container);(!a.sticker||a.nonblock)&&b.sticker.css("display","none");a.icon!==false&&d("<div />",{"class":"ui-pnotify-icon"}).append(d("<span />",{"class":a.icon===true?a.type=="error"?
33
+ f.error_icon:a.type=="info"?f.info_icon:a.type=="success"?f.success_icon:f.notice_icon:a.icon})).prependTo(b.container);b.title_container=d("<h4 />",{"class":"ui-pnotify-title"}).appendTo(b.container);a.title===false?b.title_container.hide():a.title_escape?b.title_container.text(a.title):b.title_container.html(a.title);b.text_container=d("<div />",{"class":"ui-pnotify-text"}).appendTo(b.container);a.text===false?b.text_container.hide():a.text_escape?b.text_container.text(a.text):b.text_container.html(a.insert_brs?
34
+ String(a.text).replace(/\n/g,"<br />"):a.text);typeof a.width=="string"&&b.css("width",a.width);typeof a.min_height=="string"&&b.container.css("min-height",a.min_height);b.pnotify_history=a.history;b.pnotify_hide=a.hide;var h=i.data("pnotify");if(h==null||typeof h!="object")h=[];h=a.stack.push=="top"?d.merge([b],h):d.merge(h,[b]);i.data("pnotify",h);a.stack.push=="top"&&b.pnotify_queue_position(1);a.after_init&&a.after_init(b);if(a.history){var m=i.data("pnotify_history");typeof m=="undefined"&&(m=
35
+ d("<div />",{"class":"ui-pnotify-history-container "+f.hi_menu,mouseleave:function(){m.animate({top:"-"+q+"px"},{duration:100,queue:false})}}).append(d("<div />",{"class":"ui-pnotify-history-header",text:"Redisplay"})).append(d("<button />",{"class":"ui-pnotify-history-all "+f.hi_btn,text:"All",mouseenter:function(){d(this).addClass(f.hi_btnhov)},mouseleave:function(){d(this).removeClass(f.hi_btnhov)},click:function(){d.each(h,function(){this.pnotify_history&&(this.is(":visible")?this.pnotify_hide&&
36
+ this.pnotify_queue_remove():this.pnotify_display&&this.pnotify_display())});return false}})).append(d("<button />",{"class":"ui-pnotify-history-last "+f.hi_btn,text:"Last",mouseenter:function(){d(this).addClass(f.hi_btnhov)},mouseleave:function(){d(this).removeClass(f.hi_btnhov)},click:function(){var a=-1,b;do{b=a==-1?h.slice(a):h.slice(a,a+1);if(!b[0])break;a--}while(!b[0].pnotify_history||b[0].is(":visible"));if(!b[0])return false;b[0].pnotify_display&&b[0].pnotify_display();return false}})).appendTo(r),
37
+ q=d("<span />",{"class":"ui-pnotify-history-pulldown "+f.hi_hnd,mouseenter:function(){m.animate({top:"0"},{duration:100,queue:false})}}).appendTo(m).offset().top+2,m.css({top:"-"+q+"px"}),i.data("pnotify_history",m))}a.stack.animation=false;b.pnotify_display();return b}});var t=/^on/,v=/^(dbl)?click$|^mouse(move|down|up|over|out|enter|leave)$|^contextmenu$/,w=/^(focus|blur|select|change|reset)$|^key(press|down|up)$/,x=/^(scroll|resize|(un)?load|abort|error)$/,n=function(e,g){var a,e=e.toLowerCase();
38
+ document.createEvent&&this.dispatchEvent?(e=e.replace(t,""),e.match(v)?(d(this).offset(),a=document.createEvent("MouseEvents"),a.initMouseEvent(e,g.bubbles,g.cancelable,g.view,g.detail,g.screenX,g.screenY,g.clientX,g.clientY,g.ctrlKey,g.altKey,g.shiftKey,g.metaKey,g.button,g.relatedTarget)):e.match(w)?(a=document.createEvent("UIEvents"),a.initUIEvent(e,g.bubbles,g.cancelable,g.view,g.detail)):e.match(x)&&(a=document.createEvent("HTMLEvents"),a.initEvent(e,g.bubbles,g.cancelable)),a&&this.dispatchEvent(a)):
39
+ (e.match(t)||(e="on"+e),a=document.createEventObject(g),this.fireEvent(e,a))};d.pnotify.defaults={title:false,title_escape:false,text:false,text_escape:false,styling:"bootstrap",addclass:"",cornerclass:"",nonblock:false,nonblock_opacity:0.2,history:true,width:"300px",min_height:"16px",type:"notice",icon:true,animation:"fade",animate_speed:"slow",opacity:1,shadow:true,closer:true,closer_hover:true,sticker:true,sticker_hover:true,hide:true,delay:8E3,mouse_reset:true,remove:true,insert_brs:true,stack:{dir1:"down",
40
+ dir2:"left",push:"bottom",spacing1:25,spacing2:25}}})(jQuery);