1var si = { 2 postWithFile: function (formulario, para){ 3 4 if (para == null || para == ""){ 5 return false; 6 } 7 $.ajax({ 8 type: 'POST', 9 url: BASE_URL + para, 10 data: new FormData(formulario), 11 contentType: false, 12 cache: false, 13 processData: false, 14 beforeSend: function () { 15 $("#loading").addClass("show"); 16 }, 17 error: function(response){ 18 return swal('Erro!',response.responseJSON.message,'error'); 19 }, 20 success: function (response) { 21 22 return returnResult(response,formulario,para); 23 24 } 25 }).always(function () { 26 $("#loading").removeClass("show"); 27 }); 28 29 }, 30 postForm: function (formulario, para, div) { 31 32 if (para == "mensagem" || para == 'cadastro' || para == "recommend/save" || para == "primeiro-acesso/save" || para == "recuperar-senha/save"){ 33 if (checkRecaptcha == false){ 34 return swal('Atenção!','Você precisa fazer o Captcha','warning'); 35 } 36 } 37 38 var dados = $(formulario).serializeArray(); 39 $("#loading").addClass('show'); 40 $.ajax({
41 type: "POST", 42 url: BASE_URL + para, 43 data: dados, 44 dataType: 'json', 45 success: function (response) { 46 47 return returnResult(response,formulario,para); 48 49 }, 50 error: function (response) { 51 return swal('Erro!',response.responseJSON.message,'error'); 52 } 53 }).always(function () { 54 $("#loading").removeClass('show'); 55 }); 56 57 }, 58 editClick: function(element){ 59 var object = $(element).data('object'); 60 var target = $(element).data('target'); 61 $.each(object, function (key, val) { 62 if (typeof val == 'object') { 63 if (val instanceof Array) { 64 var options = $(target).find('select[name=' + key + '\\[\\]]').find("option"); 65 for (let index = 0; index < val.length; index++) { 66 $.each(options, function (k, v) { 67 if ($(v).attr('value') == val[index]) { 68 $(v).attr('selected', true); 69 return false; 70 } 71 }); 72 } 73 } 74 } else if (key == 'texto' || key == 'description' || key == 'texto_completo') { 75 $(target).find('textarea[name=' + key + ']').val(val); 76 $(target).find('input[name=' + key + ']').val(val); 77 } else if (key == 'date_publish' || key == 'date_insert' || key == 'date_update' || key == "data_abertura" || key == 'date_birth') { 78 var date = val.split(" "); 79 $(target).find('input[name=' + key + ']').val(date[0]); 80 } else { 81 $(target).find('input[name=' + key + ']').val(val); 82 $(target).find('textarea[name=' + key + ']').val(val); 83 $(target).find('select[name=' + key + ']').val(val); 84 } 85 }); 86 $(target).modal('toggle'); 87 }, 88 questionClick: function (element) 89 { 90 91 var ref = $(element).data('ref'); 92 var link = $(element).attr('data-link'); 93 if (link == undefined || link == "" || link == null){ 94 return swal('Erro!','erro inesperado, recarregue a página e tente novamente','error'); 95 } 96 if (ref == undefined || ref == "" || ref == null){ 97 return swal('Erro!','erro inesperado, recarregue a página e tente novamente','error'); 98 } 99 var textAlert = $(element).data('textalert'); 100 var titleAlert = $(element).data('titlealert'); 101 var typeAlert = $(element).data('typealert'); 102 var reload = $(element).data('reload'); 103 104 swal({ 105 title: titleAlert != undefined && titleAlert != '' ? titleAlert : "Atenção!", 106 text: textAlert != undefined && textAlert != '' ? textAlert : "Você tem certeza que quer remover esse registro?", 107 type: typeAlert != undefined && typeAlert != '' ? typeAlert : "warning", 108 showCancelButton: true, 109 confirmButtonColor: '#3085d6', 110 cancelButtonColor: '#d33', 111 confirmButtonText: 'Sim', 112 cancelButtonText: 'Não' 113 }, function (result) { //callbalck 114 if (result){ 115 $.ajax({
116 type: "POST", 117 url: BASE_URL + link, 118 data: { 119 ref: ref 120 }, 121 dataType: 'json', 122 beforeSend: function () { 123 $("#loading").addClass('show'); 124 }, 125 success: function (response) { 126 if (response.result == 0){ 127 return swal('Erro!',response.message,'error'); 128 } 129 if (reload != null && reload != '' && reload != undefined){ 130 window.location.reload(); 131 } 132 return returnResult(response,null,null); 133 }, 134 error: function (response) { 135 console.log(response); 136 } 137 }).always(function () { 138 $("#loading").removeClass('show'); 139 }); 140 } 141 }); 142 }, 143 search: function (el,url){ 144 $.ajax({
145 type: "POST", 146 url: BASE_URL + url, 147 data: $(el).serializeArray(), 148 beforeSend: function () { 149 $(el).closest('.content-paginate').find('.loading-placeholder').addClass('show'); 150 }, 151 success: function (response) { 152 if (typeof response == 'object'){ 153 if (response.result == 0){ 154 return swal('Atenção!',response.message,'warning'); 155 } 156 return swal('Sucesso!',response.message,'success'); 157 } 158 $(el).closest('.content-paginate').find('.list-elements').html(response); 159 }, 160 error: function (response) { 161 console.log(response); 162 } 163 }).always(function () { 164 $(el).closest('.content-paginate').find('.loading-placeholder').removeClass('show'); 165 }); 166 }, 167 makePaginate: function(element){ 168 var button = $(element); 169 if ($(button).parent().hasClass('active')) { 170 return false; 171 } 172 var page = $(button).attr('data-page'); 173 var form = $(element).closest('.content-paginate').find('form'); 174 $(form).find('input[name="page"]').val(page); 175 $(form).trigger('submit'); 176 } 177}; 178 179 180function returnResult(response,formulario,para) 181{ 182 if (typeof response === 'object' && response !== null){ 183 184 if (response.result == 0) { 185 if ( (para == "meu-perfil/saldo/pagar" || para == "meu-perfil/bilhetes/pagar") && (response.message == null || response.message == undefined || response.message == "") ){ 186 return swal({ 187 title: 'Sucesso !!!', 188 text: "Pagamento realizado com sucesso", 189 type: 'success' 190 }, function () { //callbalck 191 window.location.reload(); 192 }); 193 }else{ 194 return swal( 195 'Erro!', 196 response.message != null && response.message != '' && response.message != undefined ? response.message : 'Não foi possÃvel concluir!', 197 'error' 198 ); 199 } 200 } 201 202 switch (response.acao) { 203 case 'search': 204 if (!response.hasOwnProperty('withoutMessage')){ 205 swal('Sucesso!',response.message,'success'); 206 } 207 $(formulario).trigger("reset"); 208 $(".modal").modal("hide"); 209 $("body").find(response.element).find('form').trigger('submit'); 210 break; 211 case 'redirecionar': 212 $(formulario).trigger("reset"); 213 $(".modal").modal("hide"); 214 if (response.isComplete != undefined && response.isComplete != ""){ 215 window.location.href = response.url; 216 }else{ 217 window.location.href = BASE_URL + response.url; 218 } 219 break; 220 case 'refresh': 221 swal({ 222 title: 'Sucesso !!!', 223 text: response.message, 224 type: 'success' 225 }, function () { //callbalck 226 window.location.reload(); 227 }); 228 break; 229 case 'cadastro': 230 swal({ 231 title: 'Sucesso !!!', 232 text: response.message, 233 type: 'success' 234 }, function () { //callbalck 235 window.location.href = response.url; 236 }); 237 break; 238 case 'download': 239 $(formulario).trigger("reset"); 240 swal({ 241 title: 'Sucesso !!!', 242 text: response.message, 243 type: 'success', 244 confirmButtonText : 'Receber !!' 245 }, function () { //callbalck 246 window.open($(".btn_midiakit").attr('href'), '_blank'); 247 }); 248 break; 249 case "error": 250 if (response.message.usuario != undefined) { 251 swal("Erro !!", response.message.usuario, 'error'); 252 } else if (response.message.senha != undefined) { 253 swal("Erro !!", response.message.senha, 'error'); 254 } else { 255 swal("Erro !!", response.message, 'error'); 256 } 257 break; 258 case "atualizar": 259 swal("Sucesso !!", response.message, "success"); 260 break; 261 case "sucesso": 262 $(formulario).trigger("reset"); 263 $(".modal").modal("hide"); 264 swal("Sucesso !!", response.message, 'success'); 265 break; 266 case "success": 267 $(formulario).trigger("reset"); 268 $(".modal").modal("hide"); 269 swal("Sucesso !!", response.message, 'success'); 270 break; 271 case "filtro": 272 break; 273 default: 274 $(formulario).trigger("reset"); 275 swal("Sucesso !!", response.message, 'success'); 276 break; 277 } 278 } 279 280 return true; 281 282} 283 284function openLogin(el) 285{ 286 $(".box-login").toggleClass("show"); 287} 288 289 290$(document).ready(function () { 291 292 if ($(window).width() > 790){ 293 294 if ($(window).scrollTop() > $(".header-main").outerHeight()){ 295 $('header').addClass('scroll'); 296 }else{ 297 $('header').removeClass('scroll'); 298 } 299 300 $(window).scroll(function(){ 301 if ($(window).scrollTop() > $(".header-main").outerHeight()){ 302 $('header').addClass('scroll'); 303 }else{ 304 $('header').removeClass('scroll'); 305 } 306 }); 307 } 308 309 $(".clique-loading").click(function () { 310 $("#loading").addClass('show'); 311 });
312 313 $(".desce-efeito").click(function (event) { 314 $(".menu-anchor").removeClass('close-btn'); 315 if ($(".menu-anchor").find('i').hasClass('fa-bars')){ 316 $(".menu-anchor").find('i').removeClass('fa-bars'); 317 $(".menu-anchor").find('i').addClass('fa-times'); 318 }else{ 319 $(".menu-anchor").find('i').removeClass('fa-times'); 320 $(".menu-anchor").find("i").addClass('fa-bars'); 321 } 322 $('menu').removeClass('show'); 323 event.preventDefault(); 324 $('body,html').animate({ 325 scrollTop: $($(this).attr("href")).offset().top - 100 326 }, 700); 327 }); 328 329 $('.mask-cpf').mask('000.000.000-00', { 330 reverse: true 331 }); 332 $('.mask-telefone').mask('(00) 00000-0000'); 333 $('.mask-cep').mask('00000-000'); 334 $(".mask-cnpj").mask("00.000.000/0000-00"); 335 $(".mask-date").mask("00/00/0000"); 336 $('.money').mask('#.##0,00', {reverse: true}); 337 338 $('.menu-anchor').on('click', function (e) { 339 $(this).toggleClass('close-btn'); 340 if ($(this).find('i').hasClass('fa-bars')){ 341 $(this).find('i').removeClass('fa-bars'); 342 $(this).find('i').addClass('fa-times'); 343 }else{ 344 $(this).find('i').removeClass('fa-times'); 345 $(this).find('i').addClass('fa-bars'); 346 } 347 $("menu").toggleClass('show'); 348 }); 349 350 /* Tooltip */ 351 $('[data-toggle="tooltip"]').tooltip(); 352 /* Popover */ 353 $('[data-toggle="popover"]').popover(); 354 355}); 356 357function numberToReal(numero) { 358 var numero = parseFloat(numero); 359 numero = numero.toFixed(2).split('.'); 360 numero[0] = "R$ " + numero[0].split(/(?=(?:...)*$)/).join('.'); 361 return numero.join(','); 362}
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.