[BACK]Return to form.min.js CVS log [TXT][DIR] Up to [local] / draft

Diff for /draft/form.min.js between version 1.95 and 1.101

version 1.95, 2024/03/31 16:51:24 version 1.101, 2024/04/02 07:14:55
Line 1 
Line 1 
 const form = document.querySelector("#cform");  const form = document.querySelector("#cform");
   
 function parseString(str) {  function parseString(str) {
         return str.replace(/[~`!@#$%^&*(){}\[\];:"'<,.>?\/\\|+=-]/g, '_');  //      return str.replace(/[~`!@#$%^&*(){}\[\];:"'<,.>?\/\\|+=-]/g, '_');
           return str.replace(/[~]/g, '_');
 }  }
   
 function parseMail(email) {  function parseMail(email) {
Line 43  async function sendData() {
Line 44  async function sendData() {
         if(erro) {          if(erro) {
                 info.textContent="One or more fields have an error. Please check and try again."                  info.textContent="One or more fields have an error. Please check and try again."
         } else {          } else {
                 var fcon = document.querySelectorAll(".wpcf7-form-control"),                  var fcon = document.querySelectorAll(".wpcf7-form-control");
   
                 info.textContent="Verifying..."                  info.textContent="Verifying..."
                 fcon.forEach((f) => {                  fcon.forEach((f) => {
Line 63  async function sendData() {
Line 64  async function sendData() {
                                 },                                  },
                                 callback: function(token) {                                  callback: function(token) {
                                         const data = JSON.stringify({"add": mail, "sub": subj, "msg": mess, "tok": token});                                          const data = JSON.stringify({"add": mail, "sub": subj, "msg": mess, "tok": token});
                                         turnstile.remove();  
                                         info.textContent="Sending...";                                          info.textContent="Sending...";
                                         console.log(data);                                          fetch("/feedbk/", {
 //                                      fetch("/feedbk/", {                                                  headers: { "Content-Type": "application/json" },
 //                                              headers: { "Content-Type": "application/json" },                                                  credentials: "same-origin",
 //                                              credentials: "same-origin",                                                  mode: "same-origin",
 //                                              mode: "same-origin",                                                  method: "post",
 //                                              method: "post",                                                  body: data
 //                                              body: data                                          })
 //                                      })                                          .then(response => response.json())
 //                                      .then(response => response.json())                                          .then(json => info.textContent=json['msg'])
 //                                      .then(json => info.textContent=json['msg'])                                          .then(turnstile.remove());
   
                                 }                                  }
                         });                          });
                 });                  });

Legend:
Removed from v.1.95  
changed lines
  Added in v.1.101

https://cvs.kroczynski.net