1jNotificacion = { 2 _Notify: undefined, 3 _Classes: "", 4 crear: function(options) { 5 PNotify.desktop.permission(); 6 options = setOptionsEventsNotify(options); 7 options.animation = 'none'; 8 this._Classes = options.addclass; 9 this._Notify = new PNotify(options); 10 return this._Notify; 11 }, 12 actualizar: function(notify, options) { 13 if (options.effect == undefined) { 14 options.effect = 'tada'; 15 }; 16 setTimeout(function() { 17 $(notify.elem).addClass('animated ' + options.effect); 18 }, 0); 19 options = setOptionsEventsNotify(options); 20 var currentHideOption = options.hide; 21 options.hide = false; 22 this._Classes = options.addclass; 23 notify.update(options); 24 $(notify.elem).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() { 25 if (currentHideOption) { 26 notify.update({ 27 hide: true 28 }); 29 }; 30 $(notify.elem).removeClass(options.effect); 31 }); 32 return notify; 33 }, 34 crear_actualizar: function(options) { 35 if (this._Notify == undefined) { 36 return jNotificacion.crear(options); 37 } else { 38 return jNotificacion.actualizar(this._Notify, options) 39 } 40 }, 41}; 42 43function setOptionsEventsNotify(options) { 44 var options = jQuery.extend(true, { 45 title: "Atención", 46 type: "notice", 47 history: false, 48 hide: true, 49 icon: false, 50 addclass: "", 51 // nonblock: { 52 // nonblock: true, 53 // nonblock_opacity: .2 54 // }, 55 buttons: { 56 sticker: false, 57 closer_hover: true, 58 }, 59 }, options); 60 var after_open = options.after_open; 61 var before_close = options.before_close; 62 if (options.type != undefined) options.type = options.type.toLowerCase(); 63 if (options.stack != undefined) { 64 var stack_topleft = { 65 "dir1": "down", 66 "dir2": "right", 67 "push": "top" 68 }; 69 var stack_bottomleft = { 70 "dir1": "right", 71 "dir2": "up", 72 "push": "top" 73 }; 74 var stack_bottomright = { 75 "dir1": "up", 76 "dir2": "left", 77 "firstpos1": 25, 78 "firstpos2": 25 79 }; 80 if (options.addclass != undefined) options.addclass += ' stack-' + options.stack.toLowerCase(); 81 else options.addclass = ' stack-' + options.stack.toLowerCase(); 82 switch (options.stack) { 83 case 'TopLeft': 84 options.stack = stack_topleft; 85 break; 86 case 'BottomLeft': 87 options.stack = stack_bottomleft; 88 break; 89 case 'BottomRight': 90 options.stack = stack_bottomright; 91 break; 92 } 93 } 94 if (options.type == "info") 95 if (options.addclass != undefined) options.addclass += ' ui-state-info'; 96 else options.addclass = ' ui-state-info'; 97 options.after_open = function(PNotify) { 98 if (options.inEffect == undefined) options.inEffect = ' animated bounceInRight'; 99 else options.inEffect += ' animated'; 100 var animateClasss = options.inEffect; 101 options.inEffect += jNotificacion._Classes; 102 PNotify.update({ 103 addclass: options.inEffect 104 }); 105 $(PNotify.elem).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() { 106 $(PNotify.elem).removeClass(animateClasss); 107 PNotify.update({ 108 animation: 'fade', 109 animate_speed: '1000', 110 }); 111 }); 112 validateFunction(after_open); 113 }, 114 options.before_close = function(PNotify, timer_hide) { 115 validateFunction(before_close); 116 if (options.outEffect == undefined) options.outEffect = ' animated bounceOutRight'; 117 else options.outEffect += ' animated'; 118 options.outEffect += jNotificacion._Classes; 119 PNotify.update({ 120 addclass: options.outEffect, 121 // before_close: null 122 }); 123 PNotify.queueRemove(); 124 jNotificacion._Notify = undefined; 125 }; 126 return options; 127} 128 129function validateFunction(func) { 130 if ($.isFunction(func)) func(); 131}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.