1(function ($) { 2 $('.payment-type.custom,.reference-group.custom,.control-amount.custom,.invoice-number.custom').wrapAll("<div class='wrap_to_row' />") 3 if($('.invoice-number.custom').length){ 4 $('.invoice-number.custom input').removeAttr('required'); 5 $('.invoice-number.custom').addClass('hidden'); 6 } 7 if($('.custom-select-form.main').length){ 8 $('.custom-select-form.main select option:not([disabled])').remove(); 9 $('.custom-select-form-subcategory select option:not([disabled])').remove(); 10 $(contact_reasons).each(function (){ 11 $('.custom-select-form.main select').append('<option value="'+this.main_category+'">'+this.main_category+'</option>') 12 }) 13 } 14 $(function () { 15 var hashLink = window.location.hash.slice(1); 16 const hashLinks = ['parish-assembly', 'roads-committee', 'electoral-assembly']; 17 18 $(document).ready(function() { 19 if(hashLinks.includes(hashLink)){ 20 console.log(hashLink); 21 $('#select-term-minutes').val(hashLink).trigger('change'); 22 } 23 }); 24 $(document).on('change', '#select-term-minutes', function (e) { 25 e.preventDefault(); 26 var cv = e.target.value; 27 if(cv === ''){ 28 $('.meeting-outer-holder .meeting-content-items').each(function (index, element) { 29 $(element).slideDown(); 30 }); 31 }else{ 32 $('.meeting-outer-holder .meeting-content-items').each(function (index, element) { 33 if($(element).hasClass(cv)){ 34 $(element).slideDown(); 35 }else{ 36 $(element).slideUp(); 37 } 38 }); 39 } 40 }).on('change','.custom-select-form-subcategory select',function (){ 41 let main = $('.custom-select-form.main select').val(); 42 let sub = $(this).val() 43 $(contact_reasons).each(function (index_value, value_main){ 44 if(value_main.main_category == main){ 45 $(value_main.subcategory).each(function (index,value){ 46 if(value.subcategory_name == sub) { 47 if (value.comments_placeholder !== '') { 48 $('.custom-comment textarea').attr('placeholder', value.comments_placeholder); 49 } else { 50 $('.custom-comment textarea').attr('placeholder', ''); 51 } 52 if (value.subcategory_contact_email !== '') { 53 $('.admin_email input').val(value.subcategory_contact_email); 54 } 55 } 56 }) 57 } 58 }) 59 }).on('change','.custom-select-form.main select',function (){ 60 $('.custom-select-form-subcategory select option:not([disabled])').remove(); 61 $(".custom-select-form-subcategory select").val(''); 62 $('.admin_email input').val(''); 63 let value = $(this).val(); 64 $(contact_reasons).each(function (index_value, value_main){ 65 if(value_main.main_category == value){ 66 if(value_main.comments_placeholder !== ''){ 67 $('.custom-comment textarea').attr('placeholder', value_main.comments_placeholder); 68 } else { 69 $('.custom-comment textarea').attr('placeholder', ''); 70 } 71 if(value_main.subcategory !== false){ 72 $(value_main.subcategory).each(function(index,value){ 73 $('.custom-select-form-subcategory select').append('<option value="'+value.subcategory_name+'">'+value.subcategory_name+'</option>') 74 }) 75 $(".custom-select-form-subcategory").removeClass('hidden'); 76 } else { 77 $(".custom-select-form-subcategory").addClass('hidden'); 78 $('.admin_email input').val(value_main.main_category_contact_email) 79 } 80 } 81 }) 82 }).on('change','select[name="payment-type"]',function (){ 83 $('.form-group.payment-type .choices__inner.invalid').removeClass('invalid'); 84 $('.reference-group input').removeClass('added'); 85 $('.reference-group input').val(''); 86 let value = $(this).val(); 87 if(value == 'Invoice'){ 88 $('.wrap_to_row').addClass('invoice'); 89 $('.invoice-number.custom input').attr('required'); 90 $('.invoice-number.custom').removeClass('hidden'); 91 $('.reference-group.custom label').text('Customer Number*') 92 $('.reference-group input').attr('placeholder', 'Customer Number'); 93 $('.invoice-number input').attr('placeholder', 'Invoice Number'); 94 } else { 95 $('.reference-group.custom label').text('Reference*') 96 $('.invoice-number.custom input').removeAttr('required'); 97 $('.invoice-number.custom').addClass('hidden'); 98 $('.wrap_to_row').removeClass('invoice'); 99 } 100 $(payment_types).each(function (){ 101 if(this.name == value){ 102 $('.reference-group input').attr('placeholder', this.placeholder); 103 if(this.comments_placeholder !== ''){ 104 $('textarea[name="payment-comments"]').attr('placeholder', this.comments_placeholder); 105 } 106 } 107 }) 108 }).on('change','#billPaymentForm input[required]',function (){ 109 if($(this).val() !== ''){ 110 $(this).removeClass('invalid') 111 } 112 113 }).on('click','#billPaymentForm button[type="submit"]',function (){ 114 let block = false;
115 let value = $('.payment-type.custom select').val(); 116 if(payment_types !== undefined){ 117 $(payment_types).each(function (){ 118 if(this.name == value){ 119 if($('.reference-group input').val().indexOf(this.ledger.toString()) === -1){ 120 $('.reference-group input:not(.added)').val(this.ledger.toString()+' '+$('.reference-group input').val()); 121 $('.reference-group input').addClass('added'); 122 } 123 } 124 }) 125 } 126 jQuery('#billPaymentForm input[required]').each(function (){ 127 if($(this).val() == '' || $(this).val().toString().length < 3){ 128 if(!($(this).val() !== '' && $(this).val().toString().length < 3 && $(this).attr('name') == 'amount')){ 129 block = true; 130 $(this).addClass('invalid'); 131 } 132 133 } 134 }) 135 136 jQuery('#billPaymentForm select[required]').each(function (){ 137 if($(this).val() === 'default'){ 138 block = true; 139 $(this).parent().addClass('invalid') 140 } 141 }) 142 143 if(block){ 144 return false; 145 } 146 }); 147 148 var btn = jQuery('.back_to_top'); 149 150 $(window).scroll(function() { 151 if (jQuery(window).scrollTop() > 300) { 152 btn.addClass('show'); 153 } else { 154 btn.removeClass('show'); 155 } 156 }); 157 158 btn.on('click', function(e) { 159 e.preventDefault(); 160 jQuery('html, body').animate({scrollTop:0}, '300'); 161 }); 162 163 $(document).on('click', '.popup-invoice-submit-js', function (e) { 164 e.preventDefault(); 165 var anyError = false; 166 $('#invoice-wrapper-insert-inner input:not(#billing_address_2)').css('border-color','').each(function(i, input){ 167 var $input = $(input); 168 if ( $input.val() == '' ){ 169 $input.css('border-color','#f44336'); 170 anyError = true; 171 } 172 }); 173 if(!anyError){ 174 $("form.woocommerce-checkout").submit(); 175 //$('#place_order').trigger('click'); 176 $('#popupInvoice').removeClass('active'); 177 } 178 }); 179 180 $(document).on('click', '.request-invoice-js', function (e) { 181 e.preventDefault(); 182 $('#payment_method_wf_pay_later').prop( "checked", true ).change(); 183 //$('#place_order').trigger('click'); 184 $("form.woocommerce-checkout").submit(); 185 }); 186 187 $(document).on('click', '.pay-online-js', function (e) { 188 e.preventDefault(); 189 $('#payment_method_citypay').prop( "checked", true ).change(); 190 $("form.woocommerce-checkout").submit(); 191 }); 192 193 $(document).on('click', '.popup_invoice_btn-close', function (e) { 194 e.preventDefault(); 195 $('#popupInvoice').removeClass('active'); 196 }); 197 198 $(document).on('click', '.btn-view-more-js', function (e) { 199 e.preventDefault(); 200 $(this).closest('.container').find('.to-hide').slideDown(); 201 $(this).remove(); 202 }); 203 $(document).on('click', '.magazine-btn', function (e) { 204 e.preventDefault(); 205 $('.magazine-holder').find('[class^=real3dflipbook]').trigger('click'); 206 }); 207 $(document).on('click', '.fa-map-js', function (e) { 208 e.preventDefault(); 209 var id = $(this).attr('data-id'); 210 $( "#map-holder-" + id).slideToggle(); 211 }); 212 213 var pinpointhq = $('.pinpointhq-list'); 214 215 if( pinpointhq.length > 0 ){ 216 const RSS_URL = `https://posh.pinpointhq.com/jobs.rss`; 217 fetch(RSS_URL) 218 .then((response) => response.text()) 219 .then((str) => new window.DOMParser().parseFromString(str, "text/xml")) 220 .then((data) => { 221 const items = data.querySelectorAll("item"); 222 var c = 0; 223 var items_ = []; 224 items.forEach((item) => { 225 const encodedContent = item.getElementsByTagName("content:encoded")[0].innerHTML; 226 var deadline = encodedContent.match(/<p><strong>Application Deadline: <\/strong>(.*?)<\/p>/)[1]; 227 deadline = Date.parse(deadline); 228 var html = ''; 229 var title = item.getElementsByTagName("title")[0].innerHTML; 230 231 html += '<li><a href="'+item.getElementsByTagName("link")[0].innerHTML+'" target="_blank">' 232 html += '<span class="job-title">'+title+'</span>'; 233 html += '<span class="job-type">'+encodedContent.match(/<p><strong>Employment Type: <\/strong>(.*?)<\/p>/)[1]+'</span>'; 234 html += '</a></li>'; 235 c++; 236 items_[c] = { 237 title: title, 238 deadline: deadline, 239 html: html 240 }; 241 }); 242 items_ = items_.sort((a,b) => - a.deadline + b.deadline) 243 items_.forEach(function (item, index) { 244 if(index <= 4){ 245 $( item.html ).appendTo( ".pinpointhq-list" ); 246 } 247 }); 248 if(items.length == 0){ 249 $( "<p>Sorry, there are currently no job vacancies</p>" ).insertAfter( $('.pinpointhq-list') );
250 $( ".pinpointhq-view-all" ).slideUp(); 251 } 252 }); 253 } 254 255 new Swiper(".right-slider-section-slider", { 256 slidesPerView: 1, 257 autoplay: { 258 delay: 5000, 259 disableOnInteraction: false, 260 }, 261 centeredSlides: 1, 262 navigation: { 263 nextEl: '.swiper-button-next', 264 prevEl: '.swiper-button-prev', 265 }, 266 }); 267 }); 268 269 if( $('.mailpoet_error_1_1').length > 0 ){ 270 const observer = new MutationObserver(function(mutations_list) { 271 mutations_list.forEach(function(mutation) { 272 mutation.addedNodes.forEach(function(added_node) { 273 $(added_node).find('.parsley-required').text('Please tick the box above to consent to Parish of St Helier sending you emails.'); 274 }); 275 }); 276 }); 277 278 observer.observe(document.querySelector(".mailpoet_error_1_1"), { subtree: false, childList: true }); 279 } 280 var mailpoet_form = $('#mailpoet_form_1'); 281 if( mailpoet_form.length > 0 ){ 282 mailpoet_form.find('#form_first_name_1').attr('placeholder', 'Lilly'); 283 mailpoet_form.find('#form_last_name_1').attr('placeholder', 'Langtry'); 284 mailpoet_form.find('#form_email_1').attr('placeholder', '[email protected]'); 285 } 286 var $siteId2 = $('body.site-id-2'); 287 var $siteId9 = $('body.site-id-9'); 288 var $siteId14 = $('body.site-id-14'); 289 290 /*if( $('body.page-make-online-payment').length > 0 ){ 291 var newElem = document.createElement('div'); 292 var parentDiv = document.getElementById( 'billPaymentForm'); 293 newElem.classList.add("wrap_to_row"); 294 newElem.appendChild(parentDiv.childNodes[10]); 295 newElem.appendChild(parentDiv.childNodes[9]); 296 newElem.appendChild(parentDiv.childNodes[9]); 297 document.body.appendChild(newElem); 298 299 let theFirstChild = parentDiv.childNodes[9]; 300 parentDiv.insertBefore(newElem, theFirstChild); 301 }*/ 302 if($('body.page-resident-and-community-groups').length > 0){ 303 $('.group-minutes-table').DataTable( { 304 responsive: true, 305 "ordering": false, 306 "dom": 't', 307 columns: [ 308 {data: 'date', className: 'all'}, 309 {data: 'type', className: 'min-tablet-p'}, 310 //{data: 'type2', className: 'max-mobile-l'}, 311 {data: 'file', className: 'not-mobile'}, 312 ], 313 } ); 314 } 315 316 if( $('body.woocommerce-checkout').length > 0 ){ 317 jQuery( 'form.woocommerce-checkout' ).on( 'checkout_place_order', function() { 318 var $payment_method = jQuery( 'form.checkout input[name="payment_method"]:checked' ).val(); 319 320 if( $siteId14.length > 0 ){ 321 var pv = true; 322 $('.js-v').each(function(i, el){ 323 var inp = $(this).find('input'); 324 if( inp.attr('type') === 'checkbox' ){ 325 if( !inp.prop('checked') ){ 326 pv = false; 327 } 328 }else if( inp.hasClass('input-text') ){ 329 if( inp.val() == '' ){ 330 pv = false; 331 } 332 } 333 }); 334 335 if ( pv && $payment_method === 'wf_pay_later' ) { 336 if($('#billing_address_1').val() == '' || 337 $('#billing_state').val() == '' || 338 $('#billing_postcode').val() == '' || 339 $('#billing_city').val() == '' ){ 340 $('#popupInvoice').addClass('active'); 341 342 return false; 343 } 344 345 } 346 347 } 348 349 return true; 350 }) 351 $(document.body).on('checkout_error', function () { 352 var error_count = $('.woocommerce-error li').length; 353 354 if (error_count == 1) { 355 356 }else{ 357 if( $siteId14.length > 0 ){ 358 $('.woocommerce-error li').each(function(){ 359 var attr = $(this).attr('data-id'); 360 if (attr === 'additional_wooccm8') 361 { 362 $(this).css('display', 'none'); 363 } 364 if ( 365 attr === 'billing_city' || 366 attr === 'billing_state' || 367 attr === 'billing_postcode' || 368 attr === 'billing_address_1' ) 369 { 370 $(this).css('display', 'none'); 371 //$('#popupInvoice').addClass('active'); 372 } 373 if ($(this).find('strong').length > 0 && $(this).find('strong').text() === '') { 374 $(this).css('display', 'none'); 375 } 376 }); 377 } 378 379 380 } 381 }); 382 383 384 $("label:contains(' I have read and accept the terms and conditions of booking.')").html(function(_, html) { 385 return html.replace(/( I have read and accept the terms and conditions of booking.)/g, '<div> I have read and accept the <a href="/parish-hall-bookings-terms-and-conditions" target="_blank">terms and conditions of booking</a>.</div>'); 386 }); 387 $("label:contains(' I have read, understood and accept the Terms and Conditions of booking.')").html(function(_, html) { 388 return html.replace(/( I have read, understood and accept the Terms and Conditions of booking.)/g, '<div> I have read, understood and accept the <a href="/terms-and-conditions-of-hire" target="_blank">Terms and Conditions of booking</a>.</div>'); 389 }); 390 $("label:contains(' I am booking on a behalf of a non-profit group or organisation such as a charity, school, residential association or group located within the municipality, and therefore qualify for a 50% booking discount.')").html(function(_, html) { 391 return html.replace(/( I am booking on a behalf of a non-profit group or organisation such as a charity, school, residential association or group located within the municipality, and therefore qualify for a 50% booking discount.)/g, '<div>I am booking on a behalf of a non-profit group or organisation such as a charity, school, residential association or group located within the municipality, and therefore qualify for a <span style="font-weight: 600">50% booking discount</span></div>'); 392 }); 393 var $rmcn = $('.woocommerce-remove-coupon'); 394 var $thead = $( ".woocommerce-checkout-review-order-table > tbody"); 395 var $videorow = $( "#video_em_evac" ); 396 397 if( $siteId2.length > 0 || $siteId9.length > 0){ 398 399 var checkout_form = $( 'form.checkout' ); 400 //if($siteId2 || $siteId9) 401 $(document.body).on('checkout_error', function () { 402 var additional_wooccm2_val = $('input[name="additional_wooccm2"]:checked').val() == undefined ; 403 var additional_wooccm3_val = $('input[name="additional_wooccm3"]:checked').val() == undefined; 404x 405 if(additional_wooccm2_val){ 406 $('.wooccm-field-wooccm2').addClass( 'woocommerce-invalid'); 407 }else{ 408 $('.wooccm-field-wooccm2').removeClass( 'woocommerce-invalid'); 409 } 410 411 if(additional_wooccm3_val){ 412 $('.wooccm-field-wooccm3').addClass( 'woocommerce-invalid'); 413 }else{ 414 $('.wooccm-field-wooccm3').removeClass( 'woocommerce-invalid'); 415 } 416 }); 417 418 wrapToRow('additional_wooccm4_field', '.wrap_to_row','additional_wooccm2_field'); 419 $('#additional_wooccm2, #additional_wooccm3').each(function(i, select){ 420 var $select = $(select); 421 $select.find('option').each(function(j, option){ 422 var $option = $(option); 423 if($option.val() !== ''){ 424 var $radio = $('<input type="radio" />'); 425 $radio.attr('name', $select.attr('name')).attr('value', $option.val()); 426 if ($option.attr('selected') && $option.val() !== '') $radio.attr('checked', 'checked'); 427 $select.before($radio); 428 $select.before( 429 $("<label />").attr('for', $select.attr('name')).text($option.text()) 430 ); 431 } 432 433 }); 434 $select.remove(); 435 }); 436 wrapToRow('additional_wooccm4_field', '.wooccm-type-select-to-radio','additional_wooccm5_field'); 437 $( ".woocommerce-billing-fields__field-wrapper" ).insertAfter( $( "#additional_wooccm9_field" ) ); 438 $videorow.insertAfter( $( "#additional_wooccm13_field" ) ); 439 $( "#additional_wooccm14_field" ).insertAfter( $videorow ); 440 }else if( $siteId14.length > 0 ){ 441 442 $( "#invoice-wrapper-insert-inner" ).append($('#billing_address_1_field'), [ 443 $('#billing_address_2_field'), 444 $('#billing_city_field'), 445 $('#billing_state_field'), 446 $('#billing_postcode_field') 447 ] ); 448 449 450 setTimeout(() => { 451 $('#invoice-wrapper-insert-inner input').each(function(i, input){ 452 453 $(input).val(""); 454 }); 455 }, "1000") 456 457 wrapToRow('additional_wooccm0_field', '.wrap_to_row','additional_wooccm3_field'); 458 $( ".woocommerce-billing-fields__field-wrapper" ).insertAfter( $( "#additional_wooccm6_field" ) ); 459 } 460 461 $( ".simple-sidebar__event-card" ).removeClass(); 462 $thead.find('.cart_item .product-total').remove(); 463 $thead.find('.cart_item .product-name').attr('colspan', '2'); 464 $("figure.wp-block-image figcaption").replaceWith(function() { 465 return "<div style='margin-top: 20px;position: absolute;'>" + this.innerHTML + "</div>"; 466 }); 467 var colour = $siteId2.length ? 'red': 'yellow'; 468 469 if($siteId9.length > 0){ 470 colour = 'yellow'; 471 } 472 473 474 $('.wooccm12_red input, .wooccm-type-select input').iCheck({ 475 checkboxClass: 'icheckbox_square-'+colour, 476 radioClass: 'iradio_flat-'+colour, 477 increaseArea: '20%' 478 }).on('ifChecked', function(event){ 479 if( $siteId2.length > 0 || $siteId9.length > 0){ 480 if(event.target.name === 'additional_wooccm3'){ 481 if(event.target.value === 'Yes'){ 482 $('#additional_wooccm5_field').slideDown(); 483 }else{
484 $('#additional_wooccm5_field').slideUp(); 485 } 486 } 487 if(event.target.name === 'additional_wooccm14[]'){ 488 $('#terms').prop( "checked", true ); 489 if(event.target.value === 'I have read and accept the terms and conditions of booking.'){ 490 491 } 492 } 493 if($siteId2.length > 0){ 494 if(event.target.name === 'additional_wooccm12[]'){ 495 $('#terms').prop( "checked", true ); 496 497 } 498 } 499 500 }else if( $siteId14.length > 0 ){ 501 if(event.target.name === 'additional_wooccm8[]'){ 502 if(event.target.value === 'I have read and accept the terms and conditions of booking.'){ 503 $('#terms').prop( "checked", true ); 504 } 505 } 506 } 507 508 }).on('ifUnchecked', function(event){ 509 if( $siteId2.length > 0 || $siteId9.length > 0){ 510 if(event.target.name === 'additional_wooccm14[]'){ 511 if(event.target.value === 'I have read and accept the terms and conditions of booking.'){ 512 $('#terms').prop( "checked", false ); 513 } 514 } 515 }else if( $siteId14.length > 0 ){ 516 if(event.target.name === 'additional_wooccm8[]'){ 517 if(event.target.value === 'I have read and accept the terms and conditions of booking.'){ 518 $('#terms').prop( "checked", false ); 519 } 520 } 521 } 522 523 }); 524 function applyCouponWithMutex(couponToApply, otherCheckboxSelector, otherCouponCode){ 525 var $other = $(otherCheckboxSelector); 526 function doApply(){ 527 $('#coupon_code').val(couponToApply); 528 $('button[name="apply_coupon"]').trigger('click'); 529 } 530 if($other.is(':checked')){ 531 $other.prop('checked', false).iCheck('update'); 532 jQuery.ajax({ 533 type: "post", 534 dataType: "json", 535 url: '/checkout/?remove_coupon=' + otherCouponCode, 536 data: '', 537 complete: doApply 538 }); 539 }else{ 540 doApply(); 541 } 542 } 543 544 $('.non-profit-cb .input-checkbox').iCheck({ 545 checkboxClass: 'icheckbox_square-'+colour, 546 increaseArea: '20%' 547 }).on('ifToggled', function(event){ 548 if(event.target.checked){ 549 applyCouponWithMutex('npo', '.charity .input-checkbox', 'reg_charity'); 550 }else{ 551 $('#coupon_code').val(''); 552 jQuery.ajax({ 553 type: "post", 554 dataType: "json", 555 url: '/checkout/?remove_coupon=npo', 556 data: '', 557 complete: function(xhr, textStatus) { 558 $( 'body' ).trigger( 'update_checkout' ); 559 } 560 }); 561 } 562 }); 563 564 if( $siteId14.length > 0 ){ 565 $('.charity .input-checkbox').iCheck({ 566 checkboxClass: 'icheckbox_square-'+colour, 567 increaseArea: '20%' 568 }).on('ifToggled', function(event){ 569 if(event.target.checked){ 570 applyCouponWithMutex('reg_charity', '.non-profit-cb .input-checkbox', 'npo'); 571 }else{ 572 $('#coupon_code').val(''); 573 jQuery.ajax({ 574 type: "post", 575 dataType: "json", 576 url: '/checkout/?remove_coupon=reg_charity', 577 data: '', 578 complete: function(xhr, textStatus) { 579 $( 'body' ).trigger( 'update_checkout' ); 580 } 581 }); 582 } 583 }); 584 } 585 586 if($('.coupon-npo').length > 0){ 587 $('.non-profit-cb .input-checkbox').prop( "checked", true ).iCheck('update'); 588 if( $siteId2.length > 0 || $siteId9.length > 0){ 589 $('#additional_wooccm8').prop( "checked", true ).iCheck('update') 590 }else if( $siteId14.length > 0 ){ 591 $('#additional_wooccm5').prop( "checked", true ).iCheck('update') 592 } 593 } 594 595 if($('.coupon-reg_charity').length > 0 && $siteId14.length > 0){ 596 $('.charity .input-checkbox').prop( "checked", true ).iCheck('update'); 597 } 598 599 if ('cart' in PARISHSCRIPT){ 600 if (Object.keys(PARISHSCRIPT.cart).length > 0){ 601 var cart = Object.values(PARISHSCRIPT.cart)[0]; 602 var booking = Object.values(cart.ameliabooking.bookings)[0]; 603 var customField = Object.values(booking.customFields)[0]; 604 $('#billing_company').val(customField.value); 605 } 606 } 607 } 608 609 610 611 if($('.calendar-holder').length > 0){ 612 var filters = {month: '.'+current_event_m}; 613 614 if(jQuery(window).innerWidth() > 767) { 615 616 $('.events-holder').each(function(){ 617 var highestBox = 0; 618 619 $(this).find('.event-title').each(function(){ 620 if($(this).height() > highestBox){ 621 highestBox = $(this).height(); 622 } 623 }) 624 $(this).find('.event-title').height(highestBox); 625 }); 626 627 $('.events-holder').each(function(){ 628 var highestBox = 0; 629 630 $(this).find('.event-date').each(function(){ 631 if($(this).height() > highestBox){
632 highestBox = $(this).height(); 633 } 634 }) 635 $(this).find('.event-date').height(highestBox); 636 }); 637 638 } 639 640 var $grid = $('.grid').isotope({ 641 filter: '.'+current_event_m, 642 itemSelector: '.grid-item', 643 masonry: { 644 columnWidth: '.grid-sizer', 645 gutter: '.gutter-sizer' 646 }, 647 percentPosition: true, 648 getSortData: { 649 d: '[data-d]', 650 w: '[data-w]', 651 }, 652 sortBy: [ 'd', 'w' ] 653 }); 654 655 656 $('.filters').on( 'click', '.filter-button', function( event ) { 657 event.preventDefault(); 658 var $button = $( event.currentTarget ); 659 var $buttonGroup = $button.parents('.filter-button-group'); 660 var filterGroup = $buttonGroup.attr('data-filter-group'); 661 $buttonGroup.find('a').removeClass('active'); 662 $button.addClass('active'); 663 filters[ filterGroup ] = $button.attr('data-filter'); 664 var filterValue = concatValues( filters ); 665 $grid.isotope({ filter: filterValue }); 666 if($button.hasClass('filter-button-month')){ 667 var curd = moment($button.attr('data-month')); 668 var nextm = moment($button.attr('data-month')).add(1, 'month').startOf('month'); 669 var prevm = moment($button.attr('data-month')).subtract(1, 'month').startOf('month'); 670 671 $('#filter-button-prev').attr({ 672 'data-filter':'.' + prevm.format("MMYYYY"), 673 'data-month': prevm.format("YYYY-MM-DD") 674 }); 675 $('#filter-button-next').attr({ 676 'data-filter':'.' + nextm.format("MMYYYY"), 677 'data-month':nextm.format("YYYY-MM-DD") 678 }); 679 $('.calendar-month').text(curd.format("MMMM YYYY")); 680 } 681 }); 682 } 683 $(window).on('load resize orientationchange', function() { 684 var $reviewOrderTable = $( ".woocommerce-checkout-review-order-table" ); 685 if( $('body.woocommerce-checkout').length > 0 ){ 686 if( window.screen.availWidth <= 1024){ 687 $( "#customer_details" ).append( $reviewOrderTable ); 688 }else{ 689 $( "#checkout-totals-holders" ).append( $reviewOrderTable ); 690 } 691 } 692 if( $('body.home').length > 0 ){ 693 var jshc = 485; 694 $('.jshc').each(function(){ 695 if($(this).outerHeight(true) > jshc){ 696 jshc = $(this).outerHeight(true);; 697 } 698 }); 699 document.documentElement.style.setProperty('--jshc', `${jshc}px`); 700 } 701 }) 702 703})(jQuery); 704 705function wrapToRow(detectParentElId, findSelector, insertBeforeElId) { 706 console.log(123123); 707 var newElem = document.createElement('div'); 708 var parentDiv = document.getElementById( detectParentElId).parentNode; 709 newElem.classList.add("row-wc-holder"); 710 if(findSelector === '.wrap_to_row'){ 711 newElem.classList.add("withInputs"); 712 } 713 Array.prototype.forEach.call(document.querySelectorAll(findSelector), function (c) { 714 newElem.appendChild(c); 715 }); 716 document.body.appendChild(newElem); 717 parentDiv.insertBefore(newElem, document.getElementById(insertBeforeElId)); 718} 719 720function concatValues( obj ) { 721 var value = ''; 722 for ( var prop in obj ) { 723 value += obj[ prop ]; 724 } 725 return value; 726} 727 728
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.