1$(document).ready(function(){ 2 $(document).on("countrychange", "input[name='tx_estmkapi_orderform[phone]']", function() { 3 let dialCode = $("input[name='tx_estmkapi_orderform[phone]']").parents('.row').first().find(".iti__highlight").data('dial-code'); 4 let countryCode = $("input[name='tx_estmkapi_orderform[phone]']").parents('.row').first().find(".iti__highlight").data('country-code'); 5 6 $("input#tx_estmkapi_orderform_dialCode").val(dialCode); 7 $("input#tx_estmkapi_orderform_countryCode").val(countryCode); 8 }); 9 10 $(document).on("countrychange", "input[name='tx_estmkapi_estmkcontactform[phone]']", function() { 11 let dialCode = $("input[name='tx_estmkapi_estmkcontactform[phone]']").parents('.row').first().find(".iti__highlight").data('dial-code'); 12 let countryCode = $("input[name='tx_estmkapi_estmkcontactform[phone]']").parents('.row').first().find(".iti__highlight").data('country-code'); 13 14 $("input#tx_estmkapi_orderform_dialCode").val(dialCode); 15 $("input#tx_estmkapi_orderform_countryCode").val(countryCode); 16 17 doCheckVerified() 18 }); 19 20 $(document).on("countrychange", "input[name='tx_estmkapi_suncompleteform[phone]']", function() { 21 let dialCode = $("input[name='tx_estmkapi_suncompleteform[phone]']").parents('.row').first().find(".iti__highlight").data('dial-code'); 22 let countryCode = $("input[name='tx_estmkapi_suncompleteform[phone]']").parents('.row').first().find(".iti__highlight").data('country-code'); 23 24 $("input#tx_estmkapi_suncomplete_dialCode").val(dialCode); 25 $("input#tx_estmkapi_suncomplete_countryCode").val(countryCode); 26 }); 27 28 $(document).on("countrychange", "input[name='tx_estmkapi_revocationform[phone]']", function() { 29 let dialCode = $("input[name='tx_estmkapi_revocationform[phone]']").parents('.row').first().find(".iti__highlight").data('dial-code'); 30 let countryCode = $("input[name='tx_estmkapi_revocationform[phone]']").parents('.row').first().find(".iti__highlight").data('country-code'); 31 32 $("input#tx_estmkapi_revocation_dialCode").val(dialCode); 33 $("input#tx_estmkapi_revocation_countryCode").val(countryCode); 34 }); 35 36 $('.radioLabel').click(function () { 37 if($('.main-tarifC').length > 0) { 38 return; 39 } else { 40 $(this).siblings('input').click(); 41 } 42 }); 43 44 $('.lieferadresseCb').change(function () { 45 $('.lieferadresseC').slideToggle(); 46 }); 47 48 if($('.active-step-button').length > 0) { 49 $('.active-step-button').text($('.stepSelector.active').first().text()); 50 } 51 52 $('body').on('click', '.stepSelector', function () { 53 var step = $(this).data('step'); 54 for (var cnt = 1; cnt <= $('.stepSelector').length; cnt++) { 55 if (cnt < step) { 56 $('#stepSelector_' + cnt).addClass('done'); 57 } 58 if (cnt == step) { 59 $('#stepSelector_' + cnt).addClass('active').removeClass('done'); 60 $('.multiStepformC').hide(); 61 $('#step_' + cnt + '_Form').show(); 62 } 63 if (cnt > step) { 64 $('#stepSelector_' + cnt).removeClass('active').removeClass('done'); 65 } 66 } 67 }); 68 69 var cntPnkt = 2; 70 $('.zaehlpunkt_add').click(function () { 71 var html = '<input type="text" name="zaehlpunkt_' + cntPnkt + '" placeholder="Zählpunkt">'; 72 $('.zaehlpunkte').append(html); 73 cntPnkt++; 74 }); 75 76 $(document).on('click', '[name="tx_estmkapi_orderform[paymentMethod]"]', function () { 77 78 if ($('#tx-estmkapi-orderform-paymentMethod1').is(":checked")) { 79 $(this).parents('.paymentForm').first().find('.paymentMethod').slideDown(); 80 enableRequired('#order-form #tx-estmkapi-orderform-paymentMethod1+.paymentMethod', '.required-field'); 81 } else { 82 $(this).parents('.paymentForm').first().find('.paymentMethod').slideUp(); 83 disableRequired('#order-form #tx-estmkapi-orderform-paymentMethod1+.paymentMethod', '.required-field'); 84 } 85 });
86 87 $(document).on('click', '.providerChoiceRadio', function () { 88 $('.anlagennummer').not($(this).parent('.radioLabel').siblings('.anlagennummer')).slideUp(); 89 $(this).parent('.radioLabel').siblings('.anlagennummer').slideDown(); 90 91 if($(this).val() == "Umtarifierung"){ 92 $(".has-existing-tariff").show(); 93 $(".has-no-existing-tariff").hide(); 94 }else{ 95 $(".has-existing-tariff").hide(); 96 $(".has-no-existing-tariff").show(); 97 } 98 99 $('.belieferungsdatum').not($(this).parent('.radioLabel').siblings('.belieferungsdatum')).find('input').val(''); 100 $('.belieferungsdatum').not($(this).parent('.radioLabel').siblings('.belieferungsdatum')).slideUp(); 101 $(this).parent('.radioLabel').siblings('.belieferungsdatum').slideDown(); 102 103 if ($('.einspeisetarifeoption').length) { 104 $('.stichtagderletzteneinspeisungbeideroemag').not($(this).parent('.radioLabel').siblings('.stichtagderletzteneinspeisungbeideroemag')).slideUp(); 105 $(this).parent('.radioLabel').siblings('.stichtagderletzteneinspeisungbeideroemag').slideDown(); 106 } 107 }); 108 109 $('.multiStepformC input, .multiStepformC select, .multiStepformC textarea').on('change click', function (e) { 110 if ($(this).data('syncval')) { 111 $('.summary').find("[data-synced='" + $(this).data('sync') + "']").html($(this).data('syncval')); 112 } else { 113 $('.summary').find("[data-synced='" + $(this).data('sync') + "']").html($(this).val()); 114 } 115 }); 116 117 $(document).on('change', '#tx-estmkapi-orderform-magazineSubscription', function () { 118 if (typeof $(this).children('option:selected').data('image') !== 'undefined') { 119 $(".magazine-image").attr("src", $(this).children('option:selected').data('image')); 120 } 121 $("#step").val(-1); 122 $("#doScroll").val(0); 123 $(":input").removeAttr("data-validation"); 124 $("#order-form").submit(); 125 }); 126 127 $(document).on('change', '#tx-estmkapi-orderform-taxRate', function () { 128 if($(this).val() == "3"){ 129 $("#tx-estmkapi-orderform-taxUid").parent().removeClass("hidden"); 130 }else{ 131 $("#tx-estmkapi-orderform-taxUid").parent().addClass("hidden"); 132 } 133 }); 134 135 $(document).on('keyup', '#tx-estmkapi-orderform-promotionalCode', function (e) { 136 if ($(this).val() != "") { 137 $("#check-promo-code-button").show(); 138 } else { 139 $("#check-promo-code-button").hide(); 140 } 141 }); 142 143 $(document).on('click', '#check-promo-code-button', function (e) { 144 e.preventDefault(); 145 let $checkPromoCodeForm = $('#check-promo-code-form'); 146 $('#check-promo-code-form #promo-code').val($("#tx-estmkapi-orderform-promotionalCode").val()); 147 $.ajax({
148 type: "POST", 149 url: $checkPromoCodeForm.attr('action'), 150 data: $checkPromoCodeForm.serialize(), 151 }).done(function (data) { 152 153 let valid = (data.success == 1); 154 if (valid) { 155 $("#promo-code-success-message").html(data.message); 156 $("#promo-code-success-message").addClass("success"); 157 $("#promo-code-success-message").removeClass("has-error"); 158 159 $("#check-promo-code-button").hide(); 160 $(".promo-code-text").hide(); 161 $("#tx-estmkapi-orderform-promotionalCode").hide(); 162 163 $('input#automaticRequest').val('1'); 164 $('#order-form input').attr('data-validation-optional', 'true'); 165 $("#step").val(4); 166 $("#doScroll").val(0); 167 $("#order-form").submit(); 168 169 } else { 170 $("#promo-code-success-message").html(data.message); 171 $("#promo-code-success-message").addClass("has-error help-block form-error"); 172 $("#promo-code-success-message").parent().addClass("has-error"); 173 $("#tx-estmkapi-orderform-promotionalCode").css("border-color", "#cd2222"); 174 $("#promo-code-success-message").removeClass("success"); 175 $('input#automaticRequest').val('0'); 176 } 177 }); 178 }); 179 180 $(document).on('click', '#emobility-form button[type="submit"].call-to-action.light.continue', function (e) { 181 e.preventDefault(); 182 183 $("#continue-to-next").val(1); 184 $("#emobility-form").submit(); 185 }); 186 187 $(document).on('click', '#order-form .edit-data', function (e) { 188 let thisButton = $(this); 189 let thisDataStep = thisButton.data('step'); 190 let editDataModal = $('#edit-orderform-data-modal-' + thisDataStep); 191 let editDataButton = $(this); 192 let editDataButtonStep = editDataButton.data('step'); 193 let processStepActionStep = editDataButton.data('processstepaction'); 194 let processStepActionStepInput = editDataModal.find("input[name='tx_estmkapi_orderform[processStepActionStep]']"); 195 let companyNameInput = editDataModal.find("input[name='tx_estmkapi_orderform[companyName]']"); 196 let isBusiness = $("input[name='tx_estmkapi_orderform[isBusiness]']"); 197 198 switch (processStepActionStep) { 199 case 21: 200 editDataModal.find('h2').first().text('Persönliche Daten bearbeiten') 201 break; 202 case 31: 203 editDataModal.find('h2').first().text('Adresse bearbeiten') 204 break; 205 } 206 207 companyNameInput.parents('.col-12').first().hide() 208 if (isBusiness.val() === '1') { 209 companyNameInput.parents('.col-12').first().show() 210 } 211 212 processStepActionStepInput.val(processStepActionStep) 213 214 $(document).find('.popup-body').hide() 215 $(document).find('.popup-body-' + editDataButtonStep).show() 216 217 setTimeout(() => $('#edit-network-provider-selector').prettyDropdown({ classic: true }).refresh(), 50); 218 }); 219 220 $(document).on('click', '.edit-orderform-data-modal .refresh-button', function (e) { 221 e.preventDefault(); 222 223 let $refreshButton = $(this); 224 let $form = $refreshButton.parents('form').first(); 225 226 let validateHiddenInputs = $refreshButton.parents('.edit-orderform-data-modal').first().find('[name="tx_estmkapi_orderform[zip1]"]').length; 227 228 let isValid = $form.isValid({ 229 filter: ':visible' 230 }); 231 232 if (!isValid) { 233 return false; 234 } 235 236 if (validateHiddenInputs && !$('[name="tx_estmkapi_orderform[networkProvider]"]').val()) { 237 238 $('#edit-orderform-networkProvider-error').replaceWith(` 239 <div id="edit-orderform-networkProvider-error" class="col-12 col-md-12 has-error"> 240 <span class="help-block form-error">Bitte wählen Sie einen Netzbetreiber aus.</span> 241 </div> 242 `); 243 return false; 244 } 245 246 let stepInput = $form.find("input.edit-step").first(); 247 let processStepActionStepInput = $form.find("input[name='tx_estmkapi_orderform[processStepActionStep]']").first(); 248 249 stepInput.val(processStepActionStepInput.val()); 250 $.magnificPopup.close(); 251 252 $("#doScroll").val(0); 253 $(":input").removeAttr("data-validation"); 254 255 if($("#step").val() != -1){ 256 $('#loading-container').show(); 257 } 258 259 var $ajaxWrapper = $form.parents('.ajax-wrapper'); 260 261 $.post( 262 $form.attr('action'), 263 $form.serialize(), 264 function (data) { 265 var $newElem = $(data); 266 $ajaxWrapper.replaceWith($newElem); 267 let stepInput = $("input[name='tx_estmkapi_orderform[step]']");
268 let validateHiddenInputs = stepInput.val() != '5'; 269 initEstmkapiForm('.tx-estmkapi-form', validateHiddenInputs); 270 trackEstmkapiForm($newElem); 271 calcNavigationLineWidth(); 272 initIhreEmailAdresseOrderform(); 273 } 274 ).always(function () { 275 $('#loading-container').hide(); 276 277 if($('.active-step-button').length > 0) { 278 $('.active-step-button').text($('.stepSelector.active').first().text()); 279 } 280 }); 281 }); 282 283 $(document).on('click', '.main-tarifC .show-additional-tarif-container', function (e) { 284 e.preventDefault(); 285 if($(this).parents('.main-tarifC').find(".additional-tarif-container").hasClass("hide")){ 286 $(this).parents('.main-tarifC').find(".additional-tarif-container").removeClass("hide"); 287 $("#tx-estmkapi-orderform-additionalProductIsOpen").val(1); 288 $(this).addClass("toggled"); 289 }else { 290 $(this).parents('.main-tarifC').find(".additional-tarif-container").addClass("hide"); 291 $("#tx-estmkapi-orderform-additionalProductIsOpen").val(0); 292 $(this).removeClass("toggled"); 293 } 294 }); 295 296 $(document).on('click', '.sub-tarif-item .show-more-info', function (e) { 297 e.preventDefault(); 298 if($(this).parent().find(".description").hasClass("hide")){ 299 $(this).parent().find(".description").removeClass("hide"); 300 $(this).addClass("toggled"); 301 }else { 302 $(this).parent().find(".description").addClass("hide"); 303 $(this).removeClass("toggled"); 304 } 305 }); 306 307 let lastCheckedAdditional = null; 308 $(document).on('click', '.sub-tarif-item input[type="radio"][name="tx_estmkapi_orderform[additionalProducts][]"]', function (e) { 309 e.preventDefault(); 310 const $radio = $(this); 311 let $subTarifItem = $radio.parents('.sub-tarif-item').first(); 312 const $unselectAufklapper2 = $('input[name="tx_estmkapi_orderform[unselectAufklapper2]"]'); 313 const $unselectAufklapper3 = $('input[name="tx_estmkapi_orderform[unselectAufklapper3]"]'); 314 const $unselectAdditionalProduct = $('input[name="tx_estmkapi_orderform[unselectAdditionalProduct]"]'); 315 let selected = $subTarifItem.hasClass("selected"); 316 317 $unselectAufklapper3.val('1'); 318 319 if (lastCheckedAdditional && $radio.val() === lastCheckedAdditional.val()) { 320 $unselectAdditionalProduct.val('1'); 321 lastCheckedAdditional = null; 322 } else { 323 lastCheckedAdditional = $radio; 324 } 325 326 if ($radio.val() === 'default') { 327 $unselectAdditionalProduct.val((selected ? '1' : '0')); 328 $unselectAufklapper2.val('1'); 329 } 330 331 $("#step").val(-1); 332 $("#doScroll").val(0); 333 $(":input").removeAttr("data-validation"); 334 $("#order-form").submit(); 335 }); 336 337 let lastCheckedSelected = null; 338 $(document).on('click', '.sub-tarif-item input[name="tx_estmkapi_orderform[selectedProduct]"]', function (e) { 339 e.preventDefault(); 340 const $radio = $(this); 341 const $unselectAufklapper1 = $('input[name="tx_estmkapi_orderform[unselectAufklapper1]"]'); 342 const $unselectSelectedProduct = $('input[name="tx_estmkapi_orderform[unselectSelectedProduct]"]'); 343 344 $unselectAufklapper1.val('1'); 345 346 if (lastCheckedSelected && $radio.val() === lastCheckedSelected.val()) { 347 $unselectSelectedProduct.val('1'); 348 lastCheckedSelected = null; 349 } else { 350 lastCheckedSelected = $radio; 351 } 352 353 $('select[name="tx_estmkapi_orderform[magazineSubscription]').removeAttr("data-validation"); 354 $('input[name="tx_estmkapi_orderform[additionalProductRequired]').removeAttr("data-validation"); 355 $("#step").val(-1); 356 $("#doScroll").val(0); 357 $("#order-form").submit(); 358 }); 359 360 $(document).on('click', '.sub-tarif-item input[name="tx_estmkapi_orderform[productAufklapper1]"]', function (e) { 361 e.preventDefault(); 362 const $radio = $(this); 363 let $subTarifItem = $radio.parents('.sub-tarif-item').first(); 364 let selected = $subTarifItem.hasClass("selected"); 365 const $unselectSelectedProduct = $('input[name="tx_estmkapi_orderform[unselectSelectedProduct]"]'); 366 const $unselectAufklapper1 = $('input[name="tx_estmkapi_orderform[unselectAufklapper1]"]'); 367 const selectProduct = $('input[name="tx_estmkapi_orderform[selectedProduct]"]'); 368 369 $unselectSelectedProduct.val('1'); 370 371 if (selected) { 372 $unselectAufklapper1.val('1'); 373 } 374 375 $('select[name="tx_estmkapi_orderform[magazineSubscription]').removeAttr("data-validation"); 376 $('input[name="tx_estmkapi_orderform[selectedProduct]').removeAttr("data-validation"); 377 $('input[name="tx_estmkapi_orderform[additionalProductRequired]').removeAttr("data-validation"); 378 $("#step").val(-2); 379 $("#doScroll").val(0); 380 $("#order-form").submit(); 381 });
382 383 $(document).on('click', '.sub-tarif-item input[name="tx_estmkapi_orderform[productAufklapper2]"]', function (e) { 384 e.preventDefault(); 385 const $radio = $(this); 386 const $unselectAufklapper2 = $('input[name="tx_estmkapi_orderform[unselectAufklapper2]"]'); 387 const $unselectAufklapper3 = $('input[name="tx_estmkapi_orderform[unselectAufklapper3]"]'); 388 const $unselectAdditionalProduct = $('input[name="tx_estmkapi_orderform[unselectAdditionalProduct]"]'); 389 let $subTarifItem = $radio.parents('.sub-tarif-item').first(); 390 let selected = $subTarifItem.hasClass("selected"); 391 392 $unselectAdditionalProduct.val('1'); 393 $unselectAufklapper3.val('1'); 394 395 if (selected) { 396 $unselectAufklapper2.val('1'); 397 } 398 399 $('select[name="tx_estmkapi_orderform[magazineSubscription]').removeAttr("data-validation"); 400 $('input[name="tx_estmkapi_orderform[selectedProduct]').removeAttr("data-validation"); 401 $('input[name="tx_estmkapi_orderform[additionalProductRequired]').removeAttr("data-validation"); 402 $("#step").val(-2); 403 $("#doScroll").val(0); 404 $("#order-form").submit(); 405 }); 406 407 $(document).on('click', '.sub-tarif-item input[name="tx_estmkapi_orderform[productAufklapper3]"]', function (e) { 408 e.preventDefault(); 409 const $radio = $(this); 410 const $unselectAufklapper2 = $('input[name="tx_estmkapi_orderform[unselectAufklapper2]"]'); 411 const $unselectAufklapper3 = $('input[name="tx_estmkapi_orderform[unselectAufklapper3]"]'); 412 const $unselectAdditionalProduct = $('input[name="tx_estmkapi_orderform[unselectAdditionalProduct]"]'); 413 let $subTarifItem = $radio.parents('.sub-tarif-item').first(); 414 let selected = $subTarifItem.hasClass("selected"); 415 416 $unselectAdditionalProduct.val('1'); 417 $unselectAufklapper2.val('1'); 418 419 if (selected) { 420 $unselectAufklapper3.val('1'); 421 } 422 423 $('select[name="tx_estmkapi_orderform[magazineSubscription]').removeAttr("data-validation"); 424 $('input[name="tx_estmkapi_orderform[selectedProduct]').removeAttr("data-validation"); 425 $('input[name="tx_estmkapi_orderform[additionalProductRequired]').removeAttr("data-validation"); 426 $("#step").val(-2); 427 $("#doScroll").val(0); 428 $("#order-form").submit(); 429 }); 430 431 $(document).on('click', '.sub-tarif-item input[name="tx_estmkapi_orderform[additionalProducts][]"]', function (e) { 432 $('.sub-tarif-item').each(function (){ 433 if(!$(this).find('input[name="tx_estmkapi_orderform[additionalProducts][]').is(':checked')) { 434 $(this).removeClass('selected'); 435 } 436 }); 437 438 if(this.checked) { 439 $(this).parents('.sub-tarif-item').addClass('selected'); 440 } 441 }); 442 443 $(document).on('click', '.mobile-orderform-nav a.warenkorb-link', function(e) { 444 e.preventDefault(); 445 let $parent = $(this).parents('.bestellstreckeC'); 446 if ($parent.hasClass('mobile-open')) { 447 $parent.removeClass('mobile-open'); 448 } else { 449 $parent.addClass('mobile-open'); 450 $('.close-warenkorb').focus(); 451 } 452 }); 453 454 $(document).on('click', '.backdrop, .close-warenkorb', function() { 455 $('.bestellstreckeC').toggleClass('mobile-open'); 456 }) 457 458 $(document).on('click', '.active-step-button', function() { 459 $(this).parents('.mobile-orderform-nav').find('.navigation').toggleClass('open'); 460 }); 461 462 // ********************* 463 // EMOBILITY - ORDERFORM 464 // ********************* 465 $(document).on('click', '.mobilityUseRadio', function () { 466 if ($('#tx_estmkapi_emobilityform_all-mobilityUsePrivate').is(":checked")) { 467 $("input[name=\"tx_estmkapi_emobilityform[mobilityUse]\"]").val("PRIVAT"); 468 $(".mobility-private").removeAttr('style'); 469 $(".mobility-private").attr('style', 'display: flex; flex-wrap: wrap;'); 470 enableRequired('.mobility-private', '.required-field'); 471 } else { 472 $(".mobility-private").removeAttr('style'); 473 $(".mobility-private").attr('style', 'display: none;'); 474 disableRequired('.mobility-private', '.required-field'); 475 } 476 477 if ($('#tx_estmkapi_emobilityform_all-mobilityUseBusiness').is(":checked")) { 478 $("input[name=\"tx_estmkapi_emobilityform[mobilityUse]\"]").val("GEWERBE"); 479 $(".mobility-gewerbe").attr('style', 'display: flex;'); 480 enableRequired('.mobility-gewerbe', '.required-field'); 481 } else { 482 $(".mobility-gewerbe").attr('style', 'display: none;'); 483 disableRequired('.mobility-gewerbe', '.required-field'); 484 } 485 });
486 487 $(document).on('change', '[name="tx_estmkapi_emobilityform[mobilityCardAmount]"]', function () { 488 $('[name="tx_estmkapi_emobilityform[mobilityCardAmount]"]').val($(this).val()) 489 }); 490 491 $(document).on('change', '#tx_estmkapi_echeckform_mobilityCardAmount', function () { 492 if (parseInt($(this).val()) > 0 && parseInt($(this).val()) < 6) { 493 $(".vehicles").show(); 494 $(".vehicles-more").hide(); 495 $(".price.one-card").show(); 496 if(parseInt($(this).val()) > 1){ 497 $(".price.more-card").show(); 498 if(parseInt($(this).val()) == 2) { 499 $(".price.more-card").text("1 Ladekarte zu 9,90 â¬"); 500 }else{ 501 $(".price.more-card").text((parseInt($(this).val())-1) + " Ladekarten zu je 9,90 â¬"); 502 } 503 } else { 504 $(".price.more-card").hide(); 505 } 506 507 } else { 508 $(".vehicles").hide(); 509 $(".price.one-card").hide(); 510 $(".price.more-card").hide(); 511 if(parseInt($(this).val()) == 6){ 512 $(".vehicles-more").show(); 513 }else{ 514 $(".vehicles-more").hide(); 515 } 516 } 517 518 if (parseInt($(this).val()) > 0) { 519 $(".vehicle-1").show(); 520 } else { 521 $(".vehicle-1").hide(); 522 } 523 if (parseInt($(this).val()) > 1) { 524 $(".vehicle-2").show(); 525 } else { 526 $(".vehicle-2").hide(); 527 } 528 if (parseInt($(this).val()) > 2) { 529 $(".vehicle-3").show(); 530 } else { 531 $(".vehicle-3").hide(); 532 } 533 if (parseInt($(this).val()) > 3) { 534 $(".vehicle-4").show(); 535 } else { 536 $(".vehicle-4").hide(); 537 } 538 if (parseInt($(this).val()) > 4) { 539 $(".vehicle-5").show(); 540 } else { 541 $(".vehicle-5").hide(); 542 } 543 }); 544 545 // IBAN Validation 546 $(document).on('input','#tx-estmkapi-orderform-sepaIban', function(e){ 547 if($(this).val().length > 1) { 548 var exp = new RegExp("^AT"); 549 if (!exp.test($("#tx-estmkapi-orderform-sepaIban").val())) { 550 $("#tx_estmkapi_emobilityform_sepaBic").parent().show(); 551 } else { 552 $("#tx_estmkapi_emobilityform_sepaBic").parent().hide(); 553 } 554 } 555 }); 556 557 $(document).on('input','input[name="tx_estmkapi_orderform[sepaIban]"]', function(e){ 558 $(this).val($(this).val().replace(/\s/g, '').replace(/(.{4})/g, '$1 ').trim()); 559 }); 560 561 $(document).on('input','#tx_estmkapi_sepatool_sepaIban', function(e){ 562 if($(this).val().length > 1) { 563 var exp = new RegExp("^AT"); 564 if (!exp.test($("#tx_estmkapi_sepatool_sepaIban").val())) { 565 $("#tx_estmkapi_sepatool_sepaBic").parent().show(); 566 } else { 567 $("#tx_estmkapi_sepatool_sepaBic").parent().hide(); 568 } 569 } 570 }); 571 572 $(document).on('click', '#emobility-form .edit-data', function (e) { 573 let editDataModal = $('#edit-emobilityform-data-modal'); 574 let editDataButton = $(this); 575 let editDataButtonStep = editDataButton.data('step'); 576 let processStepActionStep = editDataButton.data('processstepaction'); 577 let processStepActionStepInput = $("input[name='tx_estmkapi_emobilityform[processStepActionStep]']"); 578 editDataModal.find('.popup-actions').show() 579 580 switch (processStepActionStep) { 581 case 21: 582 editDataModal.find('h2').first().text('Gewählten Tarif bearbeiten') 583 editDataModal.find('.popup-actions').hide() 584 editDataModal.find('.prettydropdown').attr('style', 'width: 500px;') 585 break; 586 case 31: 587 editDataModal.find('h2').first().text('Gewerbliche Daten bearbeiten') 588 break; 589 case 41: 590 editDataModal.find('h2').first().text('Bezahlung bearbeiten') 591 break; 592 case 51: 593 editDataModal.find('h2').first().text('Adresse bearbeiten') 594 break; 595 case 61: 596 let $reeditVehicleToEditKeyHiddenNumber = $("#reedit-vehicle-to-edit-key"); 597 let vehicleNumber = editDataButton.data('vehicle-number'); 598 $('[class^="vehicle-"]').hide() 599 $('[class^="vehicle-' + vehicleNumber + '"]').show() 600 $reeditVehicleToEditKeyHiddenNumber.val('Vehicle ' + vehicleNumber); 601 editDataModal.find('h2').first().text('Daten zum Vertragsfahrzeug bearbeiten') 602 break; 603 } 604 605 processStepActionStepInput.val(processStepActionStep) 606 607 $(document).find('.popup-body').hide() 608 $(document).find('.popup-body-' + editDataButtonStep).show() 609 $(document).find('.popup-body-' + editDataButtonStep).find('.closeButton').trigger('click') 610 611 setTimeout(() => $('#edit-emobilityform_product').prettyDropdown({ classic: true }).refresh(), 50); 612 });
613 614 window.reeditEmobilityForm = reeditEmobilityForm; 615 616 $(document).on('click', '#edit-emobilityform-data-modal .refresh-button', function (e) { 617 e.preventDefault(); 618 reeditEmobilityForm($(this)) 619 }); 620 621 $(document).on('change', '#edit-emobilityform_product', function (e) { 622 e.preventDefault(); 623 let $refreshButton = $(this); 624 let $form = $refreshButton.parents('form').first(); 625 626 let stepInput = $form.find("input[name='tx_estmkapi_emobilityform[step]']"); 627 let processStepActionStepInput = $form.find("input[name='tx_estmkapi_emobilityform[processStepActionStep]']"); 628 629 stepInput.val(processStepActionStepInput.val()); 630 $.magnificPopup.close(); 631 632 $("#doScroll").val(0); 633 $(":input").removeAttr("data-validation"); 634 $form.submit(); 635 }); 636}) 637 638function reeditEmobilityForm($refreshButton) { 639 let $form = $refreshButton.parents('form').first(); 640 641 let isValid = $form.isValid({ 642 filter: ':visible' 643 }); 644 645 if (!isValid) { 646 return false; 647 } 648 649 let stepInput = $("input[name='tx_estmkapi_emobilityform[step]']"); 650 let processStepActionStepInput = $("input[name='tx_estmkapi_emobilityform[processStepActionStep]']"); 651 652 stepInput.val(processStepActionStepInput.val()); 653 $.magnificPopup.close(); 654 655 $("#doScroll").val(0); 656 $(":input").removeAttr("data-validation"); 657 658 if($("#step").val() != -1){ 659 $('#loading-container').show(); 660 } 661 662 var $ajaxWrapper = $form.parents('.ajax-wrapper'); 663 664 $.post( 665 $form.attr('action'), 666 $form.serialize(), 667 function (data) { 668 var $newElem = $(data); 669 $ajaxWrapper.replaceWith($newElem); 670 let stepInput = $("input[name='tx_estmkapi_orderform[step]']"); 671 let validateHiddenInputs = stepInput.val() != '5'; 672 initEstmkapiForm('.tx-estmkapi-form', validateHiddenInputs); 673 trackEstmkapiForm($newElem); 674 calcNavigationLineWidth(); 675 initIhreEmailAdresseOrderform(); 676 } 677 ).always(function () { 678 $('#loading-container').hide(); 679 680 if($('.active-step-button').length > 0) { 681 $('.active-step-button').text($('.stepSelector.active').first().text()); 682 } 683 }); 684}
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.