1document.addEventListener('DOMContentLoaded', function() { 2 var mount = document.getElementById('b2b_form_mount'); 3 if (!mount) { 4 return; 5 } 6 7 var i18n = window.b2bFormI18n || {}; 8 var labels = i18n.labels || {}; 9 var sujets = i18n.sujets || []; 10 var activites = i18n.activites || []; 11 12 function decodeHtmlEntities(value) { 13 var textarea = document.createElement('textarea'); 14 textarea.innerHTML = String(value || ''); 15 return textarea.value; 16 } 17 18 function esc(value) { 19 return decodeHtmlEntities(value) 20 .replace(/&/g, '&') 21 .replace(/</g, '<') 22 .replace(/>/g, '>') 23 .replace(/"/g, '"') 24 .replace(/'/g, '''); 25 } 26 27 function getLabel(key, fallback) { 28 return esc(labels[key] || fallback); 29 } 30 31 var sujetsHtml = sujets.map(function(item, index) { 32 return '<option value="' + esc(item.value) + '"' + (index === 0 ? ' selected="selected"' : '') + '>' + esc(item.label) + '</option>'; 33 }).join(''); 34 35 var activitesHtml = '<option value="">' + getLabel('chooseOne', 'Choisissez') + '</option>' + activites.map(function(item) { 36 return '<option value="' + esc(item.value) + '">' + esc(item.label) + '</option>'; 37 }).join(''); 38 39 mount.innerHTML = '' + 40 '<form class="simple_form form-horizontal" action="" method="post">' + 41 '<div class="form-verification-field" aria-hidden="true">' + 42 '<label for="company_registration_number">Company registration number</label>' + 43 '<input id="company_registration_number" name="company_registration_number" type="text" value="" tabindex="-1" autocomplete="off">' + 44 '</div>' + 45 '<div id="page">' + 46 '<div id="formulaire" class="d-flex justify-content-center col-lg-12 fond-gris" style="margin-top:25px; width:100vw;">' + 47 '<div class="col-md-12" style="width:90%;">' + 48 '<div class="row panel-body bg-form">' + 49 '<div class="col-md-6 d-flex flex-column justify-content-end">' + 50 '<div class="form-group d-flex flex-sm-row flex-column justify-content-end mb-3">' + 51 '<label class="optional control-label me-2 mb-2 text-sm-end" style="top:6px;" for="sujet"><abbr>*</abbr> ' + getLabel('sujet', 'Sujet') + '</label>' + 52 '<div class="col-sm-8 mb-1">' + 53 '<select class="form-select" name="sujet" id="sujet" required="required">' + 54 sujetsHtml + 55 '</select>' + 56 '</div>' + 57 '</div>' + 58 '<div class="form-group email required user_horizontal_nom d-flex flex-sm-row flex-column justify-content-end">' + 59 '<label class="email required control-label me-2 mb-2 position-relative text-sm-end" style="top:6px;" for="user_horizontal_Nom_societe"><abbr>*</abbr> ' + getLabel('societe', 'Societe') + '</label>' + 60 '<div class="col-sm-8 mb-1">' + 61 '<input class="string nom required form-control" id="user_horizontal_Nom_societe" name="societe" placeholder="' + getLabel('societe', 'Societe') + '" required="required" />' + 62 '<p class="help-block"></p>' + 63 '</div>' + 64 '</div>' + 65 '<div class="form-group email user_horizontal_nom d-flex flex-sm-row flex-column justify-content-end">' + 66 '<label class="email control-label me-2 mb-2 position-relative text-sm-end" style="top:6px;" for="user_horizontal_tva">' + getLabel('tva', 'TVA') + '</label>' + 67 '<div class="col-sm-8 mb-1">' + 68 '<input class="string tva form-control" id="user_horizontal_tva" name="tva" placeholder="' + getLabel('tva', 'TVA') + '" />' + 69 '<p class="help-block"></p>' + 70 '</div>' + 71 '</div>' + 72 '<div class="form-group email user_horizontal_nom d-flex flex-sm-row flex-column justify-content-end">' + 73 '<label class="email control-label me-2 mb-2 position-relative text-sm-end" style="top:6px;" for="user_horizontal_siret">' + getLabel('siret', 'SIRET') + '</label>' + 74 '<div class="col-sm-8 mb-1">' + 75 '<input class="string siret form-control" id="user_horizontal_siret" name="siret" placeholder="' + getLabel('siret', 'SIRET') + '" />' + 76 '<p class="help-block"></p>' + 77 '</div>' + 78 '</div>' + 79 '<div class="form-group required d-flex flex-sm-row flex-column justify-content-end mb-3">' + 80 '<label class="required control-label me-2 mb-2 position-relative text-sm-end" style="top:6px;" for="activite"><abbr>*</abbr> ' + getLabel('activite', 'Activite') + '</label>' + 81 '<div class="col-sm-8 mb-1">' + 82 '<select class="form-select input_inscription" name="activite" id="activite" style="padding-right:20px;" required="required">' + 83 activitesHtml + 84 '</select>' + 85 '</div>' + 86 '</div>' + 87 '<div class="form-group password required user_horizontal_prenom d-flex flex-sm-row flex-column justify-content-end">' + 88 '<label class="prenom required control-label me-2 mb-2 position-relative text-sm-end" style="top:6px;" for="user_horizontal_nom_prenom"><abbr>*</abbr> ' + getLabel('nomPrenom', 'Nom et prenom') + '</label>' + 89 '<div class="col-sm-8 mb-1">' + 90 '<input class="prenom required form-control" id="user_horizontal_nom_prenom" name="nom_prenom" placeholder="' + getLabel('nomPrenom', 'Nom et prenom') + '" required="required" />' + 91 '<p class="help-block"></p>' + 92 '</div>' + 93 '</div>' + 94 '<div class="form-group email required user_horizontal_email d-flex flex-sm-row flex-column justify-content-end">' + 95 '<label class="email required control-label me-2 mb-2 position-relative text-sm-end" style="top:6px;" for="user_horizontal_email"><abbr>*</abbr> ' + getLabel('email', 'Email') + '</label>' + 96 '<div class="col-sm-8 mb-1">' + 97 '<input class="string email required form-control" type="email" id="user_horizontal_email" name="email" placeholder="' + getLabel('email', 'Email') + '" required="required" />' + 98 '<p class="help-block"></p>' + 99 '</div>' + 100 '</div>' + 101 '<div class="form-group email required user_horizontal_adresse d-flex flex-sm-row flex-column justify-content-end">' + 102 '<label class="tel required control-label me-2 mb-2 position-relative text-sm-end" style="top:6px;" for="user_horizontal_adresse"><abbr>*</abbr> ' + getLabel('adresse', 'Adresse') + '</label>' + 103 '<div class="col-sm-8 mb-1">' + 104 '<input class="string email required form-control" id="user_horizontal_adresse" name="adresse" placeholder="' + getLabel('adresse', 'Adresse') + '" required="required" />' + 105 '<p class="help-block"></p>' + 106 '</div>' + 107 '</div>' + 108 '<div class="form-group email required user_horizontal_code_postal d-flex flex-sm-row flex-column justify-content-end">' + 109 '<label class="tel required control-label me-2 mb-2 position-relative text-sm-end" style="top:6px;" for="user_horizontal_code_postal"><abbr>*</abbr> ' + getLabel('codePostal', 'Code postal') + '</label>' + 110 '<div class="col-sm-8 mb-1">' + 111 '<input class="string email required form-control" id="user_horizontal_code_postal" name="code_postal" placeholder="' + getLabel('codePostal', 'Code postal') + '" required="required" />' + 112 '<p class="help-block"></p>' + 113 '</div>' + 114 '</div>' + 115 '<div class="form-group email required user_horizontal_ville d-flex flex-sm-row flex-column justify-content-end">' + 116 '<label class="tel required control-label me-2 mb-2 position-relative text-sm-end" style="top:6px;" for="user_horizontal_ville"><abbr>*</abbr> ' + getLabel('ville', 'Ville') + '</label>' + 117 '<div class="col-sm-8 mb-1">' + 118 '<input class="string email required form-control" id="user_horizontal_ville" name="ville" placeholder="' + getLabel('ville', 'Ville') + '" required="required" />' + 119 '<p class="help-block"></p>' + 120 '</div>' + 121 '</div>' + 122 '<div class="form-group email required user_horizontal_pays d-flex flex-sm-row flex-column justify-content-end">' + 123 '<label class="pays required control-label me-2 mb-2 position-relative text-sm-end" style="top:6px;" for="user_horizontal_pays"><abbr>*</abbr> ' + getLabel('pays', 'Pays') + '</label>' + 124 '<div class="col-sm-8 mb-1">' + 125 '<input class="string email required form-control" id="user_horizontal_pays" name="pays" placeholder="' + getLabel('pays', 'Pays') + '" required="required" />' + 126 '<p class="help-block"></p>' + 127 '</div>' + 128 '</div>' + 129 '</div>' + 130 '<div class="col-md-6 align-items-start">' + 131 '<div class="form-group email required user_horizontal_tel d-flex flex-sm-row flex-column justify-content-end mb-3">' + 132 '<label class="tel required col-4 control-label me-2 mb-2 position-relative text-sm-end" style="top:6px;" for="user_horizontal_tel"><abbr>*</abbr> ' + getLabel('telephone', 'Telephone') + '</label>' + 133 '<div class="col-sm-8 d-flex align-items-center">' + 134 '<input class="string email required form-control" id="user_horizontal_tel" name="telephone" placeholder="' + getLabel('telephone', 'Telephone') + '" required="required" />' + 135 '<p class="help-block"></p>' + 136 '</div>' + 137 '</div>' + 138 '<div class="form-group email required user_horizontal_message d-flex flex-sm-row flex-column justify-content-end">' + 139 '<label class="pays required col-4 control-label me-2 mb-2 position-relative text-sm-end" style="top:6px;" for="user_horizontal_message"><abbr>*</abbr> ' + getLabel('message', 'Message') + '</label>' + 140 '<div class="col-sm-8">' + 141 '<textarea style="height:250px;" class="string email required form-control" id="user_horizontal_message" name="message" placeholder="' + getLabel('message', 'Message') + '" required="required"></textarea>' + 142 '<p class="help-block"></p>' + 143 '</div>' + 144 '</div>' + 145 '<div class="form-group captcha_container d-flex justify-content-center md-justify-content-end">' + 146 '<div class="g-recaptcha" data-sitekey="6Lc61pgUAAAAAAvaIZqr305zIXLGN4UZPX1EJwGc"></div>' + 147 '</div>' + 148 '</div>' + 149 '<div class="form-group">' + 150 '<div class="col-sm-12 d-flex justify-content-center">' +
151 '<input style="width:200px; background:#000000; color:#ffffff; margin-top:55px;" class="btn btn-default center-block" name="send_form_pro" type="submit" value="' + getLabel('submit', 'Valider') + ' >" />' + 152 '</div>' + 153 '</div>' + 154 '</div>' + 155 '<div class="row">' + 156 '<div class="col-sm-4 col-lg-3 col-xl-2 mt-4 text-sm-end">' + 157 '<span class="text-rouge">' + getLabel('requiredFields', 'Champs obligatoires') + '</span><br><br>' + 158 '</div>' + 159 '</div>' + 160 '</div>' + 161 '</div>' + 162 '<input type="hidden" id="facebookLike" name="facebook_clic" value="false">' + 163 '<div id="fb-root"></div>' + 164 '</div>' + 165 '</form>'; 166 167 var form = mount.querySelector('form'); 168 var recaptcha = mount.querySelector('.g-recaptcha'); 169 if (!recaptcha) { 170 return; 171 } 172 173 var attempts = 0; 174 var maxAttempts = 20; 175 function tryRenderRecaptcha() { 176 if (typeof window.grecaptcha !== 'undefined' && typeof window.grecaptcha.render === 'function') { 177 if (!recaptcha.getAttribute('data-widget-id')) { 178 var widgetId = window.grecaptcha.render(recaptcha); 179 recaptcha.setAttribute('data-widget-id', widgetId); 180 } 181 return; 182 } 183 attempts += 1; 184 if (attempts < maxAttempts) { 185 setTimeout(tryRenderRecaptcha, 250); 186 } 187 } 188 189 tryRenderRecaptcha(); 190 191 if (!form) { 192 return; 193 } 194 195 function isRecaptchaValidated() { 196 if (typeof window.grecaptcha !== 'undefined' && typeof window.grecaptcha.getResponse === 'function') { 197 var widgetId = recaptcha.getAttribute('data-widget-id'); 198 if (widgetId !== null) { 199 return window.grecaptcha.getResponse(parseInt(widgetId, 10)).length > 0; 200 } 201 return window.grecaptcha.getResponse().length > 0; 202 } 203 204 var hiddenResponse = form.querySelector('textarea[name="g-recaptcha-response"]'); 205 return !!(hiddenResponse && hiddenResponse.value && hiddenResponse.value.trim().length > 0); 206 } 207 208 form.addEventListener('submit', function(event) { 209 if (isRecaptchaValidated()) { 210 recaptcha.style.outline = ''; 211 return; 212 } 213 214 event.preventDefault(); 215 recaptcha.style.outline = '2px solid #dc3545'; 216 recaptcha.scrollIntoView({ behavior: 'smooth', block: 'center' }); 217 }); 218});
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.