1/* 2 @Name = js.core.message.js 3 @version 1.1.2 4 5*/ 6if (typeof Object.create !== 'function') { 7 Object.create = function (obj) { 8 function F() { }; 9 F.prototype = obj; 10 return new F; 11 } 12} 13(function ($) { 14 15 mthmessage = { 16 17 show: function (options) { 18 19 var config = { 20 message: 'Procesando...', 21 colormsg: '#fff', 22 icon: 'fa fa-cogs', 23 coloricon: '#fff', 24 background: '#000' 25 26 } 27 var opts = $.extend({}, config, options); 28 29 $.blockUI({ 30 baseZ: 1000000000,/*Es z-index*/ 31 //message: $("#blockMessage").html(), 32 message: $("<div>").append( 33 $("<p/>", { 34 class: opts.icon, 35 style: 'font-size:50px;color:' + opts.coloricon + ';font-weight:bold;' 36 }) 37 ).append( 38 $("<p/>", { 39 style: 'font-size:20px;color:' + opts.colormsg + ';font-weight:bold;' 40 }).html(opts.message) 41 ), 42 css: { 43 border: 'none', 44 padding: '15px', 45 backgroundColor: opts.background, 46 '-webkit-border-radius': '10px', 47 '-moz-border-radius': '10px', 48 opacity: .8, 49 50 } 51 }); 52 53 $(".blockUI blockMsg blockPage").addClass("col-lg-12") 54 55 }, 56 hide: function (options) { 57 var config = { 58 indTime: false, 59 time: 2500, 60 onUnblock:null 61 } 62 var opts = $.extend({}, config, options); 63 64 if (opts.indTime == true) { 65 setTimeout(function () { 66 $.unblockUI({ 67 onUnblock: function () { 68 if (opts.onUnblock != null) { 69 opts.onUnblock(); 70 } 71 72 } 73 }); 74 }, opts.time); 75 } else { 76 $.unblockUI(); 77 78 } 79 }, 80 openActivity: function (options) { 81 82 var config = { 83 link: '', 84 indTime: false, 85 time: 2500, 86 onUnblock: null, 87 msg:'Cargando Página', 88 event:null 89 } 90 var opts = $.extend({}, config, options); 91 92 93 /*Permite ejecutar algo despues del mensaje*/ 94 if (opts.indTime == true) { 95 96 /*Mensaje de Success color verde*/ 97 $.message('show', { 98 message: opts.msg 99 }); 100 101 mthmessage.hide({ 102 indTime: true, 103 time:opts.time, 104 onUnblock: function () { 105 if (opts.onUnblock != null) { 106 opts.onUnblock(); 107 } 108 if (typeof callback != undefined) 109 opts.event(); 110 } 111 }) 112 } else { 113 114 $.message('show', { 115 message: opts.msg, 116 icon: 'fa fa-spinner' 117 }); 118 119 } 120 121 }, 122 openpage: function (options) { 123 124 var config = { 125 link: '', 126 indTime: false, 127 time: 2500, 128 onUnblock: null, 129 msg:'Cargando Página' 130 } 131 var opts = $.extend({}, config, options); 132 133 134 /*Permite ejecutar algo despues del mensaje*/ 135 if (opts.indTime == true) { 136 137 /*Mensaje de Success color verde*/ 138 $.message('show', { 139 message: opts.msg, 140 background: '#023403' 141 }); 142 143 mthmessage.hide({ 144 indTime: true, 145 onUnblock: function () { 146 if (opts.onUnblock != null) { 147 opts.onUnblock(); 148 } 149 window.location = opts.link; 150 } 151 }) 152 } else { 153 154 $.message('show', { 155 message: opts.msg, 156 icon: 'fa fa-spinner' 157 }); 158 window.location = opts.link 159 } 160 161 }, 162 notification: function (options) { 163 mthmessage.hide(); 164 165 var config = { 166 message: 'Transacción Exitosa...', 167 colormsg: '#fff', 168 icon: 'fa fa-check-circle', 169 coloricon: '#fff', 170 background: '#000' 171 172 } 173 var opts = $.extend({}, config, options); 174 175 $.blockUI({ 176 baseZ: 1000000000,/*Es z-index*/ 177 message: $("<div>").append( 178 $("<p/>", { 179 class: opts.icon, 180 style: 'font-size:50px;
180color:' + opts.coloricon + ';font-weight:bold;' 181 }) 182 ).append( 183 $("<p/>", { 184 style: 'font-size:20px;color:' + opts.colormsg + ';font-weight:bold;' 185 }).html(opts.message) 186 ), 187 fadeIn: 700, 188 fadeOut: 700, 189 timeout: 2500, 190 showOverlay: false, 191 centerY: true, 192 css: { 193 border: 'none', 194 padding: '15px', 195 backgroundColor: opts.background, 196 '-webkit-border-radius': '10px', 197 '-moz-border-radius': '10px', 198 opacity: .8, 199 position: 'top-center' 200 } 201 }); 202 } 203 } 204 $.message = function (metodo, options) { 205 206 if (mthmessage[metodo]) { 207 return mthmessage[metodo](options); 208 } else if (typeof metodo === 'object' || !metodo) { 209 return mthmessage.show(options); 210 } else { 211 $.error('Metodo ' + metodo + ' no existe'); 212 } 213 } 214 215})(jQuery);
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.