1var Afiliados = { 2 iniciar: function () { 3 $("#form-afiliado").submit(function (event) { 4 event.preventDefault(); 5 Afiliados.enviarPasso2(); 6 }); 7 8 $("#nome, #fone, #cpfcnpj, #email, #senha, #senha2").keyup(function () { 9 $(this).parent().removeClass("erro"); 10 Afiliados.verificaMsgErro(); 11 }); 12 13 $("#nome, #fone, #email").keydown(function (event) { 14 if (event.keyCode == 13) { 15 event.preventDefault(); 16 $("#botao-afiliado-passo1").first().trigger("click"); 17 return false; 18 } 19 }); 20 21 $("#ramo").change(function () { 22 $(this).parent().removeClass("erro"); 23 Afiliados.verificaMsgErro(); 24 }); 25 26 $("#fone, #cpfcnpj").blur(function () { 27 $(this).val(Funcoes.limpaChars($(this).val().toLowerCase(), "0-9")); 28 }); 29 30 $.post("php/ajax.php", "com=getDadosParceiros", function (root) { 31 var t = []; 32 33 for (var k in root.ramos) { 34 if (k == "") { 35 t.push( 36 '<option value="" disabled selected> Escolha o ramo de atividade</option>' 37 ); 38 } else { 39 t.push('<option value="' + k + '">' + root.ramos[k] + "</option>"); 40 } 41 } 42 43 $("#ramo").html(t.join("")); 44 }); 45 46 $("#botao-afiliado-passo1").click(function () { 47 Afiliados.enviarPasso1(); 48 }); 49 50 $("#link-afiliado-passo1").click(function (event) { 51 event.preventDefault(); 52 Afiliados.voltarPasso1(); 53 }); 54 55 $('#form-afiliado #cpfcnpj').on('input', function() { 56 var cpfCnpj = $(this).val(); 57 if (cpfCnpj.length > 0) { 58 var numeros = cpfCnpj.replace(/\D/g, ''); 59 $('#form-afiliado #login').val(numeros); 60 } else { 61 $('#form-afiliado #login').val(""); 62 } 63 }); 64 }, 65 66 verificaMsgErro: function () { 67 if ($(".erro").length) { 68 $(".mensagem-erro").slideDown(); 69 } else { 70 $(".mensagem-erro").slideUp(); 71 } 72 }, 73 74 enviarPasso1: function () { 75 var seguirEnviando = true; 76 77 if (!Funcoes.isMail($("#email").val())) { 78 $("#email").focus(); 79 $("#email").parent().addClass("erro"); 80 Afiliados.verificaMsgErro(); 81 seguirEnviando = false; 82 } 83 84 if (!$("#email").val()) { 85 $("#email").focus(); 86 $("#email").parent().addClass("erro"); 87 seguirEnviando = false; 88 } 89 90 if ($("#fone").val().length < 10) { 91 $("#fone").focus(); 92 $("#fone").parent().addClass("erro"); 93 seguirEnviando = false; 94 } 95 96 if ($("#nome").val().length < 3) { 97 $("#nome").focus(); 98 $("#nome").parent().addClass("erro"); 99 seguirEnviando = false; 100 } 101 102 if (document.cookie.indexOf("aceitouCookies") < 0) { 103 aceitouCookiesGoogleAds(); 104 105 document.cookie = "aceitouCookies=sim; path=/"; 106 $("#gdpr-cookie-message").hide(); 107 108 //O código abaixo adiciona o RD Station na página 109 var elem = document.createElement("script"); 110 elem.setAttribute("type", "text/javascript"); 111 elem.setAttribute( 112 "src", 113 "https://d335luupugsy2.cloudfront.net/js/loader-scripts/6d23a9d6-9423-4382-a64c-ff448794a03a-loader.js" 114 ); 115 document.querySelector("html").appendChild(elem); 116 } 117 118 //enviar dados RD Station, script dados RD Station 119 window.setTimeout(function () { 120 if (typeof RdIntegration != "undefined") { 121 RdIntegration.post([ 122 { 123 name: "token_rdstation", 124 value: "004614e99c43a7bca7b23af79bdcae34", 125 }, 126 { name: "identificador", value: "half-afiliado" }, 127 { name: "nome", value: $("#nome").val() }, 128 { name: "personal_phone", value: $("#fone").val() }, 129 { name: "email", value: $("#email").val() }, 130 ]); 131 } 132 if (seguirEnviando) { 133 Cadastro.abrirPasso2(); 134 } 135 }, 1000); // 1 seconds 136 137 if (seguirEnviando) { 138 Afiliados.abrirPasso2(); 139 } 140 }, 141 142 abrirPasso2: function () { 143 $(".afiliado-passo1").slideUp(); 144 $("#afiliado-passo2").slideDown(); 145 }, 146 147 voltarPasso1: function () { 148 $("#afiliado-passo2").slideUp(); 149 $(".afiliado-passo1").slideDown(); 150 }, 151 152 enviarPasso2: function () { 153 var seguirEnviando = true; 154 155 if (!$("#senha2").val()) { 156 $("#senha2").focus(); 157 $("#senha2").parent().addClass("erro"); 158 Afiliados.verificaMsgErro(); 159 seguirEnviando = false; 160 } 161 162 if (!$("#senha").val()) { 163 $("#senha").focus(); 164 $("#senha").parent().addClass("erro"); 165 Afiliados.verificaMsgErro(); 166 seguirEnviando = false;
167 } 168 169 if (!$("#ramo").val()) { 170 $("#ramo").focus(); 171 $("#ramo").parent().addClass("erro"); 172 Afiliados.verificaMsgErro(); 173 seguirEnviando = false; 174 } 175 176 if ($("#cpfcnpj").val().length < 11) { 177 $("#cpfcnpj").focus(); 178 $("#cpfcnpj").parent().addClass("erro"); 179 seguirEnviando = false; 180 } 181 182 if (seguirEnviando) { 183 184 if (typeof RdIntegration != "undefined") { 185 RdIntegration.post([ 186 { 187 name: "token_rdstation", 188 value: "004614e99c43a7bca7b23af79bdcae34", 189 }, 190 { name: "identificador", value:( Funcoes.getCookie("nns") == 1 ? "afiliados-ja-no-spotter" : "Afiliados" )}, 191 { name: "nome", value: $("#nome").val() }, 192 { name: "personal_phone", value: $("#fone").val() }, 193 { name: "email", value: $("#email").val() }, 194 ]); 195 } 196 197 $.post( 198 "php/ajax.php", 199 "com=cadastrarAfiliado&" + $("#form-afiliado").serialize() + "&origem=" + Afiliados.origem, 200 function (root) { 201 if (root.ok == 1) { 202 var login = $("#cpfcnpj").val(); 203 localStorage.setItem("login", login); 204 window.location = "https://egestor.com.br/obrigado-representante.php"; 205 } else { 206 if (root.error == 1) { 207 Funcoes.warning("<b>" + root.msg + "</b><br>" + root.obs); 208 } else { 209 Funcoes.warning(root); 210 } 211 } 212 } 213 ); 214 215 } 216 }, 217 218 /*** esse é o original 219 220 cadastrar: function() { 221 var seguirEnviando = true; 222 223 if(!$('#senha2').val()) { 224 $('#senha2').focus(); 225 $('#senha2').parent().addClass('erro'); 226 Afiliados.verificaMsgErro(); 227 seguirEnviando = false; 228 } 229 230 if(!$('#senha').val()) { 231 $('#senha').focus(); 232 $('#senha').parent().addClass('erro'); 233 Afiliados.verificaMsgErro(); 234 seguirEnviando = false; 235 } 236 237 if(!Funcoes.isMail($('#email').val())) { 238 $('#email').focus(); 239 $('#email').parent().addClass('erro'); 240 Afiliados.verificaMsgErro(); 241 seguirEnviando = false; 242 } 243 244 if(!$('#email').val()) { 245 $('#email').focus(); 246 $('#email').parent().addClass('erro'); 247 seguirEnviando = false; 248 } 249 250 if($('#fone').val().length < 10) { 251 $('#fone').focus(); 252 $('#fone').parent().addClass('erro'); 253 seguirEnviando = false; 254 } 255 256 if($('#cpfcnpj').val().length < 11) { 257 $('#cpfcnpj').focus(); 258 $('#cpfcnpj').parent().addClass('erro'); 259 seguirEnviando = false; 260 } 261 262 if($('#nome').val().length < 3) { 263 $('#nome').focus(); 264 $('#nome').parent().addClass('erro'); 265 seguirEnviando = false; 266 } 267 268 if(seguirEnviando) { 269 $.post('php/ajax.php', 'com=cadastrarAfiliado&'+ $('#form-afiliado').serialize(), function(root){ 270 if(root.ok == 1) { 271 window.location = 'http://parceiros.zipline.com.br/login.php'; 272 } 273 else { 274 if(root.error == 1) { 275 Funcoes.warning('<b>'+ root.msg +'</b><br>'+ root.obs); 276 } 277 else { 278 Funcoes.warning(root); 279 } 280 } 281 }); 282 } 283 }, 284 285acaba aqui o original */ 286};
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.