1// Funcao de validar e-mail 2function funEmail(email) { 3 4 var filtro = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; 5 6 if (filtro.test(email)) 7 return true; 8 else 9 return false; 10 11} 12 13$(document).ready(function(){ 14 15 // Validar busca 16 $('.foto-post').click(function() { 17 18 var id = $(this).parent().attr("id"); 19 20 var url = $('#'+id+' > .titulo-artigo > .link-artigo').attr('href'); 21 22 window.location = url; 23 24 }); 25 26 // Varre os inputs text e adiciona a class css tx-input 27 $("form input:text").each(function() { 28 $(this).addClass('tx-input'); 29 }); 30 31 // Varre os inputs submit e adiciona a class bt-input 32 $("form input:submit").each(function() { 33 $(this).addClass('bt-input'); 34 }); 35 36 // Focus nos campos de input text, adiciona a class tx-input-sel 37 $("form input:text").focus(function() { 38 $(this).removeClass('tx-input'); 39 $(this).addClass('tx-input-sel'); 40 }); 41 42 // Blur nos campos de input text, adiciona a class tx-input-sel 43 $("form input:text").blur(function() { 44 $(this).removeClass('tx-input-sel'); 45 $(this).addClass('tx-input'); 46 }); 47 48 // Validar busca 49 $('#bt-busca-topo').click(function() { 50 51 var valor = $('#tx-busca-topo').val(); 52 53 if (valor === '' || valor === 'O que busca?' || valor.length <= 3) { 54 alert('Digite algum valor para sua busca!'); 55 $('#tx-busca-topo').focus(); 56 return false; 57 } 58 59 return true; 60 61 }); 62 63 // Validar email 64 $('.bt-ok-feedburner').click(function() { 65 66 var varEmail = $('#emailFeed'); 67 68 if (!funEmail(varEmail.val())) { 69 alert("Digite um e-mail válido!"); 70 varEmail.focus(); 71 return false; 72 } 73 74 return true; 75 76 }); 77 78 // Alinhamento vertical (inline) 79 $.fn.center = function() { 80 81 return this.each(function(i) { 82 83 var h = $(this).height(); 84 var oh = $(this).outerHeight(); 85 var mt = (h + (oh - h)) / 2; 86 87 $(this).css("margin-top", "-" + mt + "px"); 88 $(this).css("top", "50%"); 89 $(this).css("position", "relative"); 90 91 }); 92 93 }; 94 95 $('.div_middle').center(); 96});
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.