1(function (window, document, $) { 2 "use strict"; 3 4 $.fn.slickIt = function (opt) { 5 return this.each(function () { 6 (function () { 7 var selector = (opt != undefined && opt.selector != '') ? opt.selector : '.slides'; 8 $(selector).slick({ 9 dots: true, 10 arrows: false, 11 centerMode: false, 12 slidesToShow: 1, 13 centerPadding: 20, 14 cssEase: 'linear', 15 variableWidth: false, 16 adaptiveHeight: true 17 }); 18 }()); 19 }); 20 }; 21 22 // UTM Source Display-Steuerung 23 (function() { 24 var urlParams = new URLSearchParams(window.location.search); 25 var utmSource = urlParams.get('utm_source'); 26 27 // Fallback auf Session Storage, wenn kein URL-Parameter vorhanden 28 if (!utmSource) { 29 utmSource = sessionStorage.getItem('utm_source'); 30 } 31 32 if (utmSource) { 33 // Prüfe ob passende Elemente existieren 34 var $matchingElements = $('.utm_source_' + utmSource); 35 36 if ($matchingElements.length > 0) { 37 // Passende Elemente gefunden - verstecke alle anderen 38 $('[class*="utm_source_"]').each(function() { 39 this.style.setProperty('display', 'none', 'important'); 40 }); 41 42 // Zeige nur passende Elemente 43 $matchingElements.each(function() { 44 this.style.setProperty('display', 'block', 'important'); 45 }); 46 47 console.log('UTM Source erkannt: ' + utmSource); 48 } else { 49 // Keine passenden Elemente - Fallback auf utm_source_none 50 $('[class*="utm_source_"]').not('.utm_source_none').each(function() { 51 this.style.setProperty('display', 'none', 'important'); 52 }); 53 $('.utm_source_none').css('display', 'block'); 54 55 console.log('UTM Source "' + utmSource + '" nicht gefunden - zeige utm_source_none'); 56 } 57 } else { 58 // Kein utm_source - verstecke alle auÃer utm_source_none 59 $('[class*="utm_source_"]').not('.utm_source_none').each(function() { 60 this.style.setProperty('display', 'none', 'important'); 61 }); 62 $('.utm_source_none').css('display', 'block'); 63 } 64 })(); 65 66 $(function () { 67 (function () { // execute functions which are previously registered by jqReady() 68 if (window.jqReady) while (window.jqReady.q.length) window.jqReady.q.shift().call(window, $); 69 window.jqReady = function (f) { 70 f.call(window, $); 71 }; 72 }()); 73 }); 74 75 var getUrlParameter = function getUrlParameter(sParam) { 76 var sPageURL = window.location.search.substring(1), 77 sURLVariables = sPageURL.split('&'), 78 sParameterName, 79 i; 80 81 for (i = 0; i < sURLVariables.length; i++) { 82 sParameterName = sURLVariables[i].split('='); 83 84 if (sParameterName[0] === sParam) { 85 return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); 86 } 87 } 88 return false; 89 }; 90 91 //var tsmd_filter_model_key = getUrlParameter('tsmd_filter_model_key'); 92 var tsmd_filter_model_key = document.getElementById('tsmd-list-container')?.dataset?.modelKey; 93 if (tsmd_filter_model_key) { 94 var collection = document.getElementsByClassName(tsmd_filter_model_key.toLowerCase()); 95 for (let item of collection) { 96 item.classList.add("show"); 97 } 98 } 99 100 101 jqReady(function ($) { 102 $('.tsmd_location .toggle-btn').click(function (e) { 103 e.preventDefault(); 104 var $tables = $(this).closest('.tsmd_location').find('.toggle-tables'); 105 var $btns = $(this).closest('.tsmd_location').find('.toggle-btn'); 106 var toggle = $(this).data('toggle'); 107 108 $btns.removeClass('active'); 109 $tables.hide(); 110 $(toggle).show(); 111 $(this).addClass('active'); 112 }); 113 114 //click first toggle-btn automatically 115 $('.tsmd_location .toggle-btn:first').click(); 116 117 $('.tsmd_location_dropdown select#tsmd_location_dropdown').change(function () { 118 var selectedValue = $(this).val(); 119 $(this).closest('.tsmd_location_dropdown').find('.items .tsmd_location_dropdown_item').hide(); // Hide all content divs 120 console.log('#tsmd_location_dropdown_item_' + selectedValue); 121 if (selectedValue) { 122 console.log($('#tsmd_location_dropdown_item_' + selectedValue)); 123 $('#tsmd_location_dropdown_item_' + selectedValue).removeClass('d-none').fadeIn(); // Fade in the selected content div 124 } 125 }); 126 }); 127 128 jqReady(function ($) { 129 $('#tsmdFilterAjax,#tsmdRequestAjax').appendTo("body"); 130 }); 131 132 jqReady(function ($) { 133 $(".ts-col-sorting select.tsmd_sorting_option").on('change.tsmd', function (e) { 134 135 var $filterForm = $('body').find('.widget.widget_ts-mobilede-widget-filter form.tsmd-filter-form'); 136 var disabled = $filterForm.find('select:disabled'); 137 // kurz aktivieren 138 disabled.prop('disabled', false); 139 140 $('body').find('.widget.widget_ts-mobilede-widget-filter form.tsmd-filter-form select[name=tsmd_sorting_option]').val($(this).find(":selected").attr('value')).trigger("change"); 141 // wieder deaktivieren 142 disabled.prop('disabled', true); 143 144 }); 145 }); 146 147 jqReady(function ($) { 148 var $link = $(".col-pagination > .jax-nextpage"); 149 150 $link.click(function (e) { 151 e.preventDefault(); 152 153 $link.addClass('inactive tsmd-loading').prop("disabled", true); 154 155 $.ajax({ 156 url: $(this).attr('href') + '&tsmd_ajax=1', // Replace this with the path to your HTML file 157 success: function (result) { 158 // Use .find() to select only the part you want to append 159 var specificPart = $("<div>").html(result).find(".ts-listarea > *"); 160 $(".tsmd-list .ts-listarea:first-child").append(specificPart); // Append only the specific part 161 162 var currentPage = $("<div>").html(result).find(".tsmd-list").data('currentpage'); 163 var offerscount = $("<div>").html(result).find(".tsmd-list").data('offerscount'); 164 var resultlimit = $("<div>").html(result).find(".tsmd-list").data('resultlimit'); 165 var restCount = offerscount - (resultlimit * currentPage); 166 console.log(restCount); 167 168 // change next link 169 var $nextLink = $("<div>").html(result).find(".col-pagination > .jax-nextpage"); 170 if ($nextLink.length && restCount > 0) { 171 $link.attr('href', $nextLink.attr('href')); 172 $link.removeClass('inactive tsmd-loading').prop("disabled", false); 173 } else { 174 $link.addClass('d-none'); 175 } 176 177 }, 178 error: function (xhr, status, error) { 179 console.error("An error occurred: " + error); 180 } 181 }); 182 }); 183 }); 184 185 jqReady(function ($) { 186 const hiddenStack = new Array(); 187 188 function changeVendorSelection(initial, $current_vendor_select) { 189 //console.log('changeVendorSelection');
190 var $vendor_select = ($current_vendor_select) ? $current_vendor_select : $('select[name=tsmd_filter_vendor_key]'); 191 var vendor_key = $vendor_select.find(":selected").attr('value'); 192 var $model_select = $vendor_select.closest('form').find('select[name=tsmd_filter_model_key]'); 193 var $modelline_select = $vendor_select.closest('form').find('select[name=tsmd_filter_modelline_key]'); 194 195 if (vendor_key == '_ALL') { 196 $model_select.find('option, optgroup').prop('disabled', true).hide().addClass('hidden').removeClass('not-hidden'); 197 $model_select.find('option#model-option-all').prop('selected', true).prop('disabled', false).show().addClass('not-hidden').removeClass('hidden'); 198 199 $modelline_select.find('option').prop('disabled', true).hide().addClass('hidden').removeClass('not-hidden'); 200 $modelline_select.find('option#modelline-option-all').prop('selected', true).prop('disabled', false).show().addClass('not-hidden').removeClass('hidden'); 201 $vendor_select.find('option').not('.tsmd-sep').prop('disabled', false).show(); // ROSIER Facetten 5W-50: Separator bleibt disabled 202 // $model_select.selectpicker('disable'); 203 } else { 204 console.log('model_select find options') 205 console.log($model_select.find('optgroup[data-vendor=' + vendor_key + ']')); 206 $model_select.find('optgroup[data-vendor!=' + vendor_key + ']').prop('disabled', true).hide().addClass('hidden').removeClass('not-hidden'); 207 $model_select.find('optgroup > option[data-vendor!=' + vendor_key + ']').prop('disabled', true).hide().addClass('hidden').removeClass('not-hidden'); 208 209 $model_select.find('optgroup[data-vendor=' + vendor_key + ']').prop('disabled', false).show().addClass('not-hidden').removeClass('hidden'); 210 $model_select.find('optgroup > option[data-vendor=' + vendor_key + ']').prop('disabled', false).show().addClass('not-hidden').removeClass('hidden'); 211 212 //$model_select.find('option[data-vendor!='+vendor_key+'], optgroup[data-vendor!='+vendor_key+']').prop('disabled', true).hide().addClass('hidden').removeClass('not-hidden'); 213 //$model_select.find('option[data-vendor='+vendor_key+'], optgroup[data-vendor='+vendor_key+']').prop('disabled', false).show().addClass('not-hidden').removeClass('hidden'); 214 $modelline_select.find('option:not(.optgroup-' + vendor_key + ')').prop('disabled', true).hide().addClass('hidden').removeClass('not-hidden'); 215 $modelline_select.find('option.optgroup-' + vendor_key + ', option#modelline-option-all').prop('disabled', false).show().addClass('not-hidden').removeClass('hidden'); 216 if (!initial) { 217 $model_select.find('option#model-option-all').prop('selected', true); 218 $modelline_select.find('option#modelline-option-all').prop('selected', true); 219 } 220 } 221 //$model_select.selectpicker('refresh'); 222 //$vendor_select.selectpicker('refresh'); 223 } 224 225 function oldchangeVendorSelection(initial, $current_vendor_select) { 226 //console.log('changeVendorSelection'); 227 var $vendor_select = ($current_vendor_select) ? $current_vendor_select : $('select[name=tsmd_filter_vendor_key]'); 228 var vendor_key = $vendor_select.find(":selected").attr('value'); 229 var $model_select = $vendor_select.closest('form').find('select[name=tsmd_filter_model_key]'); 230 var $modelline_select = $vendor_select.closest('form').find('select[name=tsmd_filter_modelline_key]'); 231 if (vendor_key == '_ALL') { 232 $model_select.find('option').prop('disabled', true).hide().addClass('hidden').removeClass('not-hidden'); 233 $modelline_select.find('option').prop('disabled', true).hide().addClass('hidden').removeClass('not-hidden'); 234 $model_select.find('option#model-option-all').prop('selected', true).prop('disabled', false).show().addClass('not-hidden').removeClass('hidden'); 235 $modelline_select.find('option#modelline-option-all').prop('selected', true).prop('disabled', false).show().addClass('not-hidden').removeClass('hidden'); 236 $vendor_select.find('option').not('.tsmd-sep').prop('disabled', false).show(); // ROSIER Facetten 5W-50: Separator bleibt disabled 237 // $model_select.selectpicker('disable'); 238 } else { 239 $model_select.find('option:not(.optgroup-' + vendor_key + ')').prop('disabled', true).hide().addClass('hidden').removeClass('not-hidden'); 240 $model_select.find('option.optgroup-' + vendor_key + ', option#model-option-all').prop('disabled', false).show().addClass('not-hidden').removeClass('hidden'); 241 $modelline_select.find('option:not(.optgroup-' + vendor_key + ')').prop('disabled', true).hide().addClass('hidden').removeClass('not-hidden'); 242 $modelline_select.find('option.optgroup-' + vendor_key + ', option#modelline-option-all').prop('disabled', false).show().addClass('not-hidden').removeClass('hidden'); 243 if (!initial) { 244 $model_select.find('option#model-option-all').prop('selected', true); 245 $modelline_select.find('option#modelline-option-all').prop('selected', true); 246 } 247 } 248 //$model_select.selectpicker('refresh'); 249 //$vendor_select.selectpicker('refresh'); 250 } 251 252 function putHiddenToStack($selection, stackName = 'std') { 253 //console.log(stackName); 254 //console.log($selection); 255 //console.log($selection.prop('outerHTML')); 256 if (hiddenStack[stackName] == undefined) hiddenStack[stackName] = []; 257 258 $.each($selection, function (idx, val) { 259 if ($(val).hasClass('hidden')) { 260 hiddenStack[stackName].push($(val)); 261 $(val).remove(); 262 } 263 //console.log(hiddenStack[stackName]); 264 }) 265 //hiddenStack[stackName] = $selection.html(); 266 console.log(hiddenStack); 267 //$selection.remove(); 268 } 269 270 function restoreHiddenFromStack($selectionParent, stackName = 'std') { 271 //console.log(stackName); 272 //console.log($selection); 273 //console.log($selection.prop('outerHTML')); 274 if (hiddenStack[stackName] == undefined) hiddenStack[stackName] = []; 275 276 $.each(hiddenStack[stackName], function (idx, val) { 277 $selectionParent.append(hiddenStack[stackName].shift()); 278 //console.log(hiddenStack[stackName]); 279 }) 280 //hiddenStack[stackName] = $selection.html(); 281 //console.log(hiddenStack); 282 //$selection.remove(); 283 } 284 285 //pre-select mercedes-benz 286 var selected_vendor_option = $('select[name=tsmd_filter_vendor_key]').val(); 287 //console.log(selected_vendor_option); 288 //if(selected_vendor_option === '_ALL') $('select[name=tsmd_filter_vendor_key]').val('MERCEDES-BENZ'); 289 290 $("select[name=tsmd_filter_vendor_key]").on('change.tsmd', function (e) { 291 var $model_select = $(this).closest('form').find('select[name=tsmd_filter_model_key]'); 292 var $modelline_select = $(this).closest('form').find('select[name=tsmd_filter_modelline_key]'); 293 294 restoreHiddenFromStack($model_select, 'model'); 295 restoreHiddenFromStack($modelline_select, 'modelline'); 296 297 changeVendorSelection(false, $(this)); 298 299 putHiddenToStack($model_select.find('optgroup.hidden'), 'model'); 300 //putHiddenToStack($vendor_select.find('option.hidden'),'vendor'); 301 putHiddenToStack($modelline_select.find('option.hidden'), 'modelline'); 302 }); 303 304 changeVendorSelection(true, false); 305 306 $("select[name=tsmd_filter_model_key],select[name=tsmd_filter_modelline_key]").on('change.tsmd', function (e) { 307 var model_key = $(this).find(":selected").attr('value'); 308 var vendor_key = $(this).find(":selected").data('vendor');
309 var $vendor_select = $(this).closest('form').find('select[name=tsmd_filter_vendor_key]'); 310 if (model_key == '_ALL') { 311 $vendor_select.find('option').not('.tsmd-sep').prop('disabled', false).show(); // ROSIER Facetten 5W-50: Separator bleibt disabled 312 } else { 313 //$vendor_select.find('option:not(#option-'+vendor_key+',#vendor-option-all)').prop('disabled', true).hide(); 314 $vendor_select.find('option.optgroup-' + vendor_key).prop('disabled', false).prop('selected', true).show().addClass('not-hidden').removeClass('hidden'); 315 } 316 //$vendor_select.selectpicker('refresh'); 317 }); 318 319 //$("select[name=tsmd_filter_model_key]").trigger('change.tsmd'); 320 }); 321 322 jqReady(function ($) { 323 //add anker on mobile 324 $('.tsmd-filter-form').each(function () { 325 if (window.matchMedia('(max-width: 767px)').matches) { 326 console.log('change action on load'); 327 $(this).attr('action', $(this).attr('action') + '#tsmd-list'); 328 console.log($(this).attr('action')); 329 } 330 }); 331 332 function tsmdFilterFields(fields) { 333 $.each(fields, function (index, value) { 334 let fieldName = index; 335 //console.log(value); 336 //$('.tsmd-filter-form select[name='+key+']') 337 $('.tsmd-filter-form select[name=' + fieldName + '] option[value!="_ALL"]').prop('disabled', true).hide().addClass('hidden').removeClass('not-hidden'); 338 $.each(value, function (index, innerValue) { 339 $('.tsmd-filter-form select[name=' + fieldName + '] option').each(function () { 340 //if comma separated values, check each 341 let valArray = $(this).val().split(','); 342 343 if ($(this).val().toUpperCase() == innerValue.toUpperCase() || valArray.includes(innerValue.toUpperCase())) { 344 $(this).prop('disabled', false).show(); 345 } 346 }); 347 }); 348 349 //$('.tsmd-filter-form select[name='+fieldName+']').selectpicker('refresh'); 350 }); 351 } 352 353 // ROSIER Facetten 2026-07-13 (5W-50): serverberechnetes Ausgrauen (self-excluding). 354 // Enum-Felder: Array erlaubter Werte (uppercased). Range-Felder: {gte:x} bzw. {lte:x}, 355 // Optionswert wird numerisch verglichen. Ausgrauen statt verstecken; die 356 // Marken-/Modell-Kaskade (hide/show) bleibt unberuehrt. Gewaehlte Option nie sperren. 357 function tsmdFilterFieldsGray(fieldsGray) { 358 if (!fieldsGray) return; 359 $.each(fieldsGray, function (fieldName, allowed) { 360 var $sel = $('.tsmd-filter-form select[name=' + fieldName + ']'); 361 if (!$sel.length) return; 362 $sel.find('option').each(function () { 363 var v = String($(this).val()); 364 if (v === '_ALL' || v === '0' || v === '') return; // Platzhalter/Reset nie anfassen 365 if (this.selected) { $(this).prop('disabled', false).removeClass('tsmd-facet-off'); return; } 366 var ok = true; 367 if (allowed && !Array.isArray(allowed) && typeof allowed === 'object') { 368 var num = parseFloat(v); 369 if (allowed.gte !== undefined) ok = (num >= allowed.gte); 370 else if (allowed.lte !== undefined) ok = (num <= allowed.lte); 371 } else { 372 var list = allowed || []; 373 var vv = v.toUpperCase(); 374 var parts = vv.split(','); 375 ok = false; 376 for (var i = 0; i < list.length; i++) { 377 if (list[i] === vv || parts.indexOf(list[i]) > -1) { ok = true; break; } 378 } 379 } 380 $(this).prop('disabled', !ok).toggleClass('tsmd-facet-off', !ok); 381 }); 382 // optgroups optisch mitgrauen, wenn alle sichtbaren Optionen gesperrt sind 383 $sel.find('optgroup').each(function () { 384 var anyOn = $(this).find('option').filter(function () { return !this.disabled && !$(this).hasClass('hidden'); }).length > 0; 385 $(this).toggleClass('tsmd-facet-off', !anyOn); 386 }); 387 }); 388 } 389 390 // 5W-50 28.09.2026, V10 Filter-Check: der Zaehler zeigte nach einem Markenwechsel den 391 // Gesamtbestand. Ursache: jede Filteraenderung loest mehrere Anfragen aus (Handler auf 392 // change UND input, dazu das Kreuz im Feld mit eigenen change-Ereignissen, bis zu drei je 393 // Klick), und die Antworten wurden in der Reihenfolge ihres Eintreffens angewendet. Eine 394 // spaete Antwort eines aelteren Zustands ueberschrieb Zaehler, Formularadresse und Liste. 395 // Jetzt gilt nur die Antwort der juengsten Anfrage (laufende Nummer), aeltere werden 396 // abgebrochen. Gleiches fuer das Nachladen der Liste. 397 var tsmdAskSeq = 0, tsmdAskXhr = null, tsmdListXhr = null; 398 399 function askForAmount($local_filterform, firstLoad = false) { 400 var seq = ++tsmdAskSeq; 401 var adminUrl = MyAjax.ajaxurl; 402 var ajaxAction = "tsmd_ajax_ask"; 403 var $filterForm = $local_filterform; 404 // disabled Selects merken 405 var disabled = $filterForm.find('select:disabled'); 406 // kurz aktivieren 407 disabled.prop('disabled', false); 408 409 var filterValues = $filterForm.serializeArray(); 410 411 if (!$filterForm.length) return false;
412 413 $('.tsmd-amount').addClass('tsmd-loading'); 414 $('.tsmd-count-prediction').addClass('tsmd-loading'); 415 416 if (tsmdAskXhr && tsmdAskXhr.readyState !== 4) { tsmdAskXhr.abort(); } 417 tsmdAskXhr = $.ajax({ 418 url: adminUrl, 419 type: 'POST', 420 dataType: "json", 421 data: { 422 action: ajaxAction, 423 filterValues 424 }, 425 success: function (data, textStatus, jqXHR) { 426 if (seq !== tsmdAskSeq) { return; } // 5W-50 28.09.2026, V10: veraltete Antwort 427 $('.tsmd-count-prediction').removeClass('tsmd-loading'); 428 $('.tsmd-amount').removeClass('tsmd-loading'); 429 430 $('.tsmd-count-prediction').text(data.count); 431 if (data.count > 0) { 432 $('.tsmd-amount').text(data.count + ' Treffer'); 433 } else { 434 $('.tsmd-amount').text('Keine Treffer'); 435 } 436 437 $filterForm.data('path_only', data.path_only); 438 $filterForm.attr('action', $filterForm.data('original-action') + data.path); 439 if (window.matchMedia('(max-width: 767px)').matches) { 440 $filterForm.attr('action', $filterForm.attr('action') + '#tsmd-list'); 441 } 442 //console.log($filterForm.attr('action')); 443 //console.log(data); 444 tsmdFilterFields(data.fields); 445 tsmdFilterFieldsGray(data.fields_gray); // ROSIER Facetten 5W-50 446 } 447 }); 448 449 if (!firstLoad && !$('body').hasClass('home') && $('body').find(".ts-listarea").length) { 450 // only, if listarea is availabe 451 var $link = $(".col-pagination > .jax-nextpage").last(); 452 $link.addClass('inactive tsmd-loading').prop("disabled", true); 453 454 var disabled = $filterForm.find('select:disabled'); 455 // kurz aktivieren 456 disabled.prop('disabled', false); 457 // jetzt serialize 458 var getparams = $filterForm.serialize(); 459 // wieder deaktivieren 460 disabled.prop('disabled', true); 461 462 //console.log('getparams'); 463 //console.log(getparams); 464 // Example of using history.pushState 465 const newUrl = $filterForm.attr('data-original-action') + '?' + getparams; 466 const stateObject = {carlist: 'load'}; // Optional state object 467 const title = ''; // Title is currently ignored by most browsers 468 469 history.pushState(stateObject, title, newUrl); 470 471 // load data after asking for amount 472 if (tsmdListXhr && tsmdListXhr.readyState !== 4) { tsmdListXhr.abort(); } 473 tsmdListXhr = $.ajax({ 474 url: $filterForm.attr('data-original-action') + '?' + getparams + '&tsmd_ajax=1', // Replace this with the path to your HTML file 475 type: 'GET', 476 success: function (result) { 477 if (seq !== tsmdAskSeq) { return; } // 5W-50 28.09.2026, V10: veraltete Liste 478 // Use .find() to select only the part you want to append 479 var specificPart = $("<div>").html(result).find(".ts-listarea > *"); 480 $(".tsmd-list .ts-listarea:first-child").empty().append(specificPart); // Append only the specific part 481 482 //get SEO Part and set it 483 var seoPart = $("<div>").html(result).find("#tsmd-list-seo > *"); 484 $("#tsmd-list-seo").empty().append(seoPart); // Append only the seo part 485 486 // change next link 487 var $nextLink = $("<div>").html(result).find(".col-pagination > .jax-nextpage:not(.stub)"); 488 console.log($nextLink); 489 if ($nextLink.length && $nextLink.attr('href') != '#') { 490 $link.attr('href', $nextLink.attr('href')); 491 $link.removeClass('inactive d-none stub tsmd-loading').prop("disabled", false); 492 $link.show(); 493 } else { 494 $link.hide(); 495 $link.addClass('d-none stub'); 496 } 497 498 }, 499 error: function (xhr, status, error) { 500 if (status === 'abort') { return; } // 5W-50 28.09.2026, V10: bewusst abgebrochen 501 console.error("An error occurred: " + error); 502 } 503 }); 504 } 505 506 } 507 508 function checkUrlBeforeSubmit($local_filterform) { 509 var $filterForm = $local_filterform; 510 511 if (!$filterForm.length) return false;
512 513 $($filterForm).submit(function (e) { 514 if ($(this).attr('action') != $(this).data('original-action')) { 515 if ($filterForm.data('path_only')) { 516 e.preventDefault(); 517 window.location.href = $(this).attr('action'); 518 } 519 } 520 }); 521 522 } 523 524 // 5W-50 28.09.2026, V10: change und input feuern bei einem Auswahlfeld beide, das Kreuz im 525 // Feld schickt weitere change-Ereignisse. Ohne Buendelung gab es bis zu drei Anfragen und 526 // drei history.pushState je Klick (auch Ursache fuer I7 "zwei Eintraege in der Chronik"). 527 // 150 ms buendeln alle Ereignisse eines Klicks zu einer Anfrage je Formular; im Textfeld 528 // fragt der Zaehler erst nach einer kurzen Tipp-Pause. 529 $('.tsmd-filter-form input, .tsmd-filter-form select').on('change.tsmd.filter input.tsmd.filter', function () { 530 var $form = $(this).closest('form.tsmd-filter-form'); 531 // 5W-50 28.09.2026, V10 rs3: Ladezustand sofort zeigen, nicht erst nach der Buendelung. 532 // Sonst stand 150 ms lang die alte Zahl ohne Ladeanzeige am Zaehler. 533 $('.tsmd-count-prediction').addClass('tsmd-loading'); 534 $('.tsmd-amount').addClass('tsmd-loading'); 535 clearTimeout($form.data('tsmdAskTimer')); 536 $form.data('tsmdAskTimer', setTimeout(function () { askForAmount($form); }, 150)); 537 }); 538 539 askForAmount($('form.tsmd-filter-form'), true); 540 checkUrlBeforeSubmit($('form.tsmd-filter-form')); 541 //var local_adminAjax_url = adminAjax.ajaxurl; 542 //var local_action = "tsmd_ajax_import"; 543 544 //console.log(local_adminAjax_url); 545 }); 546 547}(window, document, jQuery));
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.