1function bikeMakeToModels() { 2 if ($('#mvh_model').length == 0) { 3 return; 4 } 5 6 var titlemodelidx = 0; 7 $('#mvh_fahrzeugart').change(function () { 8 var val = parseInt($(this).find(':selected').val()) || 0; 9 if (val == 3) { 10 $('#mvh_manufacturer_group').closest(".col").addClass('d-none'); // css-umsetzung 11 $('#modelleform').addClass('kba-check'); // css-umsetzung 12 $('#kba').removeClass('d-none'); 13 $('#zu2').prop('required', true); 14 $('#zu3').prop('required', true); 15 titlemodelidx = 1; 16 } else { 17 $('#mvh_manufacturer_group').closest(".col").removeClass('d-none'); // css-umsetzung 18 $('#modelleform').removeClass('kba-check'); // css-umsetzung 19 $('#kba').addClass('d-none'); 20 $('#zu2').prop('required', false); 21 $('#zu3').prop('required', false); 22 titlemodelidx = 0; 23 } 24 var manuselect = $('#mvh_manufacturer'); 25 manuselect.empty().append(manunames[val]); 26 $('#mvh_model').empty().append('<option value="" disabled selected>' + titlemodel[titlemodelidx] + '</option>'); 27 }).trigger('change'); 28 29 $('#mvh_manufacturer').change(function () { 30 var result = {}; 31 var val = $(this).find(':selected').val(); 32 var fa = parseInt($('#mvh_fahrzeugart').find(':selected').val()); 33 if (fa=='0' || !val || val.length===0 || val=='Alle'){ 34 return false; 35 } 36 $.evo.io().call('getModellData', [fa, val], result, function (error, data) { 37 if (error) { 38 console.error(data); 39 } 40 41 var data = result.response.content; 42 var def = $('#mvh_model').val(); 43 var model = $('<select />').attr({ id: 'mvh_model', name: 'mvh_model', class: 'form-control' }).prop('required',true); 44 if (data != null && data.length > 0) { 45 model.append('<option value="">' + titlemodel[parseInt(fa) + 1] + '</option>'); 46 $(data).each(function (idx, item) { 47 model.append($('<option/>').val(item.kModell).html(item.cModell) 48 .attr('selected', item.kModell == def || item.cModell == def ? 'selected' : false)); 49 }); 50 } 51 else { 52 model.append('<option value="" disabled selected>' + titlemodel[0] + '</option>'); 53 } 54 $('#mvh_model').replaceWith(model); 55 56 }); 57 return false; 58 }).trigger('change'); 59 60 $('#kba_check').click(function () { 61 var result = {}; 62 var val = ($('#zu2').val().concat($('#zu3').val())).replace(" ", ""); 63 var fa = parseInt($('#mvh_fahrzeugart').find(':selected').val()); 64 $.evo.io().call('getModellData', [fa, val], result, function (error, data) { 65 if (error) { 66 console.error(data); 67 } else { 68 var data = result.response.content; 69 var model = $('<select />').attr({ id: 'mvh_model', name: 'mvh_model', class: 'form-control' }).prop('required',true); 70 if (data != null && data.length > 0) { 71 if (data.length == 1) { 72 var item = data[0]; 73 model.append($('<option/>').val(item.kModell).html(item.cModell).attr('selected', 'selected')); 74 } else { 75 model.append('<option value="">' + titlemodel[parseInt(fa) + 1] + '</option>'); 76 $(data).each(function (idx, item) { 77 model.append($('<option/>').val(item.kModell).html(item.cModell)); 78 }); 79 } 80 } else { 81 model.append(manunames[fa]); 82 } 83 $('#mvh_model').replaceWith(model); 84 } 85 }); 86 return false; 87 }); 88} 89 90 91$(document).ready(function () { 92 bikeMakeToModels(); 93}); 94 95window.addEventListener('load', function () { 96 console.log('mvh_plugin.js LoadEvent'); 97});
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.