1console.log("comnyou login loaded"); 2function addDkfuToLinks() { 3 // Supposons que 'cyDkfu' sera passé à ce script 4 if (cyDkfu !== "") { 5 // console.log("cyDkfu :", cyDkfu); 6 7 // Liste des domaines ciblés 8 var targetDomains = ["incathlab.com", "oncostream.com", "mdscop.com", "incathlab.local"]; 9 // La clé à ajouter 10 var keyToAdd = "dkfu=" + cyDkfu; 11 12 // Sélectionne tous les liens de la page 13 var links = document.querySelectorAll("a"); 14 15 // Itère sur chaque lien 16 links.forEach(function (link) { 17 // Obtient l'URL actuelle du lien 18 var href = link.getAttribute("href"); 19 var domain = null; 20 // Extrait le domaine de l'URL 21 22 // Assurez-vous que `href` n'est pas null avant d'essayer de l'utiliser 23 if (href) { 24 var domain = href.match(/:\/\/(www\.)?(.[^/:]+)/i); 25 if (domain) { 26 console.log("Domain extracted:", domain[2]); 27 } else { 28 console.log("No domain found in the href"); 29 } 30 } else { 31 console.log("href is null, cannot extract domain"); 32 } 33 34 if (domain) { 35 domain = domain[2]; 36 37 // Vérifie si le domaine est dans la liste des domaines ciblés 38 if (targetDomains.indexOf(domain) !== -1) { 39 // Ajoute le paramètre GET à l'URL 40 var separator = href.indexOf("?") !== -1 ? "&" : "?"; 41 var newHref = href + separator + keyToAdd; 42 43 // Met à jour l'attribut href du lien 44 link.setAttribute("href", newHref); 45 } 46 } 47 }); 48 } 49} 50 51function addDkfuToLinks() { 52 if (cyDkfu !== "") { 53 const targetDomains = new Set(["incathlab.com", "oncostream.com", "mdscop.com", "incathlab.local"]); 54 const keyToAdd = `dkfu=${cyDkfu}`; 55 56 document.querySelectorAll("a").forEach((link) => { 57 const href = link.getAttribute("href"); 58 if (href) { 59 const match = href.match(/:\/\/(?:www\.)?([^/:]+)/i); 60 if (match) { 61 const domain = match[1].toLowerCase(); 62 console.log("Domain extracted:", domain); 63 if (targetDomains.has(domain)) { 64 const separator = href.includes("?") ? "&" : "?"; 65 link.setAttribute("href", href + separator + keyToAdd); 66 } 67 } else { 68 console.log("No domain found in the href"); 69 } 70 } else { 71 console.log("href is null, cannot extract domain"); 72 } 73 }); 74 } 75} 76 77jQuery(document).ready(function ($) { 78 console.log("[login comnyou] document loaded"); 79 // Perform AJAX login on form submit 80 $("form#form_login_comnyou").on("submit", function (e) { 81 e.preventDefault(); 82 83 $("#module_login_comnyou div.status").show().html(ajax_login_object.loadingmessage); 84 $.ajax({ 85 type: "POST", 86 dataType: "json", 87 url: ajax_login_object.ajaxurl, 88 data: { 89 action: "comnyou_ajax_login", //calls wp_ajax_nopriv_ajaxlogin 90 email: $('form#form_login_comnyou input[name="comnyou_email"]').val(), 91 password: $('form#form_login_comnyou input[name="comnyou_password"]').val(), 92 kcy: $('form#form_login_comnyou input[name="kcy"]').length ? $('form#form_login_comnyou input[name="kcy"]').val() : false, 93 security: $('form#form_login_comnyou input[name="security"]').val(), 94 redirect_url: $('form#form_login_comnyou input[name="redirect_url"]').val(), 95 }, 96 97 success: function (data) { 98 console.log("form_login_comnyou return", data); 99 $("#module_login_comnyou div.status").text(""); 100 if ($.trim(data.message) != "") { 101 console.log("login comnyou message : ", data.message); 102 $("#module_login_comnyou div.status").html(data.message); 103 } 104 105 if ($.trim(data.errormsg) != "") { 106 console.log("login comnyou error", data.errormsg); 107 $("#module_login_comnyou div.status").append('<div class="errormsg">' + data.errormsg + "</div>"); 108 } 109 110 if ($.trim(data.cyDkfu) != "") { 111 console.log("dkfu set"); 112 cyDkfu = data.cyDkfu; 113 addDkfuToLinks(); 114 } 115 console.log("login comnyou successfull ", data.loginsuccessfull); 116 if (data.loginsuccessfull == true) { 117 $("form#form_login_comnyou").hide(); 118 } 119 120 if (data.redirect == true) { 121 console.log("login comnyou redirecting to ", data.redirect_url); 122 document.location.href = data.redirect_url; 123 } else { 124 console.log("login comnyou no redirection "); 125 } 126 }, 127 }); 128 }); 129 addDkfuToLinks(); 130});
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.