1jQuery( document ).ready(function($) { 2 3 4 5 $(document).on("click",".pays",function() { 6 7 8$("#rand_plaque").trigger("click"); 9 10}); 11 12$(document).on("click","#rand_plaque",function() { 13 14 15 16 17 var pays=$(".pays:checked").val(); 18 19 if(pays==undefined){ pays="FR"; } 20 21 if(pays==""){ pays="FR";} 22 23 24 var rand_plaque= getRandomPlaque(pays); 25 26var rand=Math.floor(Math.random() * 10); 27 28$("#plaque").val(rand_plaque); 29 30$("#plaque").trigger("click"); 31}); 32 33 34 35$(document).on("click","#rand_vin",function() { 36 37 38 39var rand=Math.floor(Math.random() * (cars_vin.length)); 40 41$("#vin").val(cars_vin[rand]); 42 43$("#vin").trigger("click"); 44 45}); 46 47 48 49 50 51$(document).on("keyup change focus click","#plaque",function() { 52 53 54 55$("#vin").val(""); 56$("#vin").removeClass("used"); 57$(this).addClass("used"); 58 59 60}); 61 62$(document).on("keyup change focus click","#vin",function() { 63 64 65 66$("#plaque").val(""); 67$("#plaque").removeClass("used"); 68$(this).addClass("used"); 69 70 71}); 72 73 74 75 76$(document).on("click","#recherche_plaque",function() { 77 78 79 80 var immatriculation=$("#plaque").val(); 81 82 var api_type="plaque"; 83 84 var vin=$("#vin").val(); 85 86 var pays=$(".pays:checked").val(); 87 88 if(pays===undefined){ 89 pays="FR"; 90 } 91 92 if(pays===""){ 93 pays="FR"; 94 } 95 96 97 98 if(vin!==""){ 99 api_type="vin"; 100 } 101 102 103 104 var token_demo="TokenDemo2026B"; 105 106 var new_token_api=$("#my_token_api_plaque").val(); 107 108 109 var url_api_plaque="https://api.apiplaqueimmatriculation.com/"+api_type+"?vin="+vin+"&immatriculation="+immatriculation+"&token="+new_token_api+"&pays="+pays+"&t="+ Date.now(); 110 111 112 var p_code_exemple="https://api.apiplaqueimmatriculation.com/"+api_type+"?vin="+vin+"&immatriculation="+immatriculation+"&token="+token_demo+"&pays="+pays; 113 114 if(api_type=="plaque"){ 115 116 p_code_exemple="https://api.apiplaqueimmatriculation.com/plaque?immatriculation="+immatriculation+"&token="+token_demo+"&pays="+pays; 117 118 url_api_plaque="https://api.apiplaqueimmatriculation.com/"+api_type+"?vin="+vin+"&immatriculation="+immatriculation+"&token="+new_token_api+"&pays="+pays+"&t="+ Date.now(); 119 120 } 121 122 123 if(api_type=="vin"){ 124 125 p_code_exemple="https://api.apiplaqueimmatriculation.com/vin?vin="+vin+"&token="+token_demo; 126 127 url_api_plaque="https://api.apiplaqueimmatriculation.com/"+api_type+"?vin="+vin+"&immatriculation="+immatriculation+"&token="+new_token_api+"&pays="+pays+"&t="+ Date.now(); 128 129 } 130 131 132 133 134 135function show_result(response){ 136 if(response!==undefined){ 137 138 $("#img_loading").hide(); 139 140 var r=response.data; 141 var code_erreur=response.code_erreur; 142 143 144 var err=""; 145 146 147 148 if(code_erreur ==200){ 149 $("#html_code_erreur").html("<span class='r_json_success'>"+code_erreur+"</span>"); 150 } 151 152 if(code_erreur !==200){ 153 err=response.message; 154 $("#html_code_erreur").html("<span class='r_json_erreur'>"+code_erreur+"</span>"); 155 } 156 157 if(err===undefined){ 158 err=""; 159 } 160 161 162 if(err===""){ 163 164 165 166 var all_c=""; 167for (var prop in r) { 168 169 var name_prop= prop.replace('_',' ').replace('-', ' '); prop.replace('_',' ').replace('-', ' '); 170 171all_c+="<p id='p_"+prop+"'><b>"+name_prop+" :</b> <span id='"+prop+"'>"+r[prop]+"</span></p>"; 172 173} 174 175 176 var all_l_sra="<b>liste_sra_commercia :</b> <ul>"; 177 178 var liste_sra_commercial=r.liste_sra_commercial; 179 if(liste_sra_commercial===undefined){ 180 liste_sra_commercial=""; 181 } 182 183 184 if(liste_sra_commercial===null){ 185 liste_sra_commercial=""; 186 } 187 188 if(liste_sra_commercial!==""){ 189 liste_sra_commercial.forEach(item => { 190 191 all_l_sra+="<li><b>"+item.sra_id+" : </b>"+item.sra_commercial+"</li>"; 192 }); 193 194 } 195 196 197 all_l_sra+="</ul>"; 198 199var all_pneus="<b>Pneus:</b>"; 200 201var pneus=r.pneus; 202if(pneus===undefined){ 203pneus=""; 204} 205 206if(pneus===null){ 207pneus=""; 208} 209 210 211if(pneus!==""){
212pneus.forEach(item => { 213 214 215 all_pneus+="<ul style='border: 1px solid #e7e7e7;background: #f8f8f8;border-radius: 10px;'>"; 216 217all_pneus+="<li><span>name : </span>"+item.name+"</li>"; 218all_pneus+="<li><span>width : </span>"+item.width+"</li>"; 219all_pneus+="<li><span>height : </span>"+item.height+"</li>"; 220all_pneus+="<li><span>diameter : </span>"+item.diameter+"</li>"; 221all_pneus+="<li><span>load_index : </span>"+item.load_index+"</li>"; 222all_pneus+="<li><span>speed_index : </span>"+item.speed_index+"</li>"; 223all_pneus+="</ul>"; 224}); 225 226} 227 228 229 230 231$("#r_all_test_api_plaque").html(all_c); 232$("#p_liste_sra_commercial").html(all_l_sra); 233$("#p_pneus").html(all_pneus); 234 235 236 $("#r_test_api_plaque").show(); 237 238 $("#r_jsontest_api_plaque").text( JSON.stringify(response, undefined, 2)); 239 $("#result_test_api_plaque").show(); 240 $("#img_logo_marque").attr("src",r.logo_marque+"&t="+Math.random()); 241 242 var recap="<span>"+r.marque+" "+r.modele+" "+r.date1erCir_fr+"</span>"; 243 recap+="<p>"+"<i class='fas fa-gas-pump'></i> "+r.energieNGC+" - "+"<i class='fas fa-bolt'></i> "+r.puisFisc+" CV "+" - "+"<i class='fas fa-palette'></i> " +r.couleur+"</p>"; 244 245 246 $("#recap").html(recap); 247 248 if(api_type=="vin"){ 249 $("#recap").text(r.marque+" "+r.modele+" / "+r.debut_modele+" "+r.fin_modele); 250 } 251 252 253 var nbr_req_restants=r.nbr_req_restants; 254 if(nbr_req_restants==undefined){nbr_req_restants=0;} 255 256 257 if(r.photo_modele=="https://api.apiplaqueimmatriculation.com/public/storage/photos_modeles/404.jpg"){ 258 259 $(".div_photo_modele").hide(); 260 261 }else{ 262 263 $("#photo_modele").attr("src",r.photo_modele+"?t="+Math.random()); 264 265 266 $(".div_photo_modele").show(); 267 } 268 269 $("#nbr_req_restants").text(nbr_req_restants); 270 271 272 $("#recap").show(); 273 274 $("#r_test_api_plaque").show(); 275 276 }else{ 277 278 $("#recap").hide(); 279 $(".div_photo_modele").hide(); 280 $("#img_loading").hide(); 281 282 $("#r_test_api_plaque").hide(); 283 284 $("#r_jsontest_api_plaque").text( JSON.stringify(response, undefined, 2)); 285 if(err!=""){ 286 $("#r_all_test_api_plaque").html("<div class='msg_erreur_api_plaque'>"+err+"</div>"); 287 } 288 289 } 290} 291} 292 293 294 295 $("#p_code_exemple").text(p_code_exemple); 296 $("#p_code_exemple").attr("href",p_code_exemple); 297 var format="json"; 298 var settings = { 299 "async": true, 300 "crossDomain": true, 301 "url": url_api_plaque , 302 "method": "GET", 303 "headers": { 304 "Accept":"application/json" 305 } 306 }; 307 308 if((immatriculation=="") && (vin=="")){ 309 $("#plaque").css("color","red !important"); 310 311 $("#img_loading").hide(); 312 313}else{ 314 $("#plaque").css("color","gray !important"); 315$("#img_loading").show(); 316 $.ajax(settings).done(function (response) { 317 318 319 show_result(response); 320 321 }).fail(function(jqXHR, textStatus, errorThrown) { 322 323 324 const response = JSON.parse(jqXHR.responseText); 325 $("#img_loading").hide(); 326 327 console.log("response jqXHR",jqXHR); 328 show_result(response); 329 }); 330} 331 332 333}); 334 335 336 337// init 338 339$("#plaque").val("AA-123-BC"); 340 341$("#recherche_plaque").trigger("click"); 342 343 344});
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.