1jQuery(document).ready(function($) { 2 $(document).on('click', '.ajaxPaginationEventsload a.page-numbers', function(e) { 3 e.preventDefault(); 4 5 var page = $(this).attr('href').split('/page/')[1]; 6 var perPage = $(this).parent().data('perpage'); 7 console.log(perPage,'perPage'); 8 $('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 9 10 var data = { 11 'action': 'events_loads_ajax', 12 'page': page, 13 'per_page': perPage, 14 }; 15 16 $.post(ajax_object.ajax_url, data, function(response) { 17 $('.event_list_minimal').html(response); 18 $('.cus_loader').remove(); 19 }); 20 21 return false; 22 }); 23}); 24jQuery( document ).ready(function() 25{ 26 // jQuery(document).on('click', '.update_my_interest_btn a', function() 27 // { 28 // var checked_interest = []; 29 // jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 30 // jQuery("input:checkbox[name=interest_checkbox]:checked").each(function() 31 // { 32 // checked_interest.push(jQuery(this).val()); 33 // }); 34 // 35 // var user_id = jQuery(this).data('id'); 36 // var databc = { 37 // 'action': 'update_my_interests_ajax', 38 // 'user_id': user_id, 39 // 'checked_interest': checked_interest, 40 // 'interest_ajax': 'interest_ajax', 41 // }; 42 // jQuery.post(ajax_object.ajax_url, databc, function(response) 43 // { 44 // alert('Interest Updated'); 45 // jQuery('.cus_loader').remove(); 46 // }); 47 // return false; 48 // }); 49 jQuery(document).on('click', '.save_newsletter_changes_btn a', function() 50 { 51 var checked_newsltr = []; 52 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 53 jQuery("input:checkbox[name=newsletter_pre_checkbox]:checked").each(function() 54 { 55 checked_newsltr.push(jQuery(this).val()); 56 }); 57 var sf_access_tokan = jQuery(this).data('sf_access'); 58 var user_id = jQuery(this).data('id'); 59 const nonce = jQuery(this).closest('.newsletter_preference_wrapper').data('nonce'); 60 var databc = { 61 'action': 'update_my_interests_ajax', 62 'nonce': nonce, 63 'user_id': user_id, 64 'checked_newsltr': checked_newsltr, 65 'newsletter_ajax': 'newsletter_ajax', 66 'sf_access_tokan': sf_access_tokan, 67 }; 68 jQuery.post(ajax_object.ajax_url, databc, function(response) 69 { 70 alert('Newsletter Preference Updated'); 71 jQuery('.cus_loader').remove(); 72 }); 73 return false; 74 }); 75 76 jQuery(document).on('click', '.pm_user_edit_pp .close_pm_popup', function() 77 { 78 jQuery('.pm_user_edit_pp').fadeOut(); 79 return false; 80 }); 81 jQuery(document).on('gform_confirmation_loaded', function(event, formId) 82 { 83 if(formId == 6) 84 { 85 jQuery('.pm_user_edit_pp').fadeOut(); 86 } 87 }); 88 jQuery(document).on('change', '.make_admin_user', function($event) 89 { 90 $event.preventDefault(); 91 const $that = jQuery(this); 92 const nonce = $that.closest('tr').data('nonce'); 93 94 if (!nonce || nonce === '') { 95 alert('Security check failed. Please refresh the page and try again.'); 96 // Revert Value 97 $that.prop('checked', !$that.is(':checked')); 98 return false; 99 } 100 101 var post_id_con = jQuery(this).data('id'); 102 var sf_access = jQuery(this).data('sf_access'); 103 var sf_contact_id = jQuery(this).data('sf_contact_id'); 104 const make_admin_val = jQuery(this).is(':checked') ? 'true' : 'false'; 105 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 106 var databc = { 107 'action': 'portal_user_info_update_ajax', 108 'post_id_con': post_id_con, 109 'make_admin_req': 'make_admin_req', 110 'make_admin_val': make_admin_val, 111 'sf_access_tokan': sf_access, 112 'sf_contact_id': sf_contact_id, 113 'nonce': nonce, 114 }; 115 jQuery.post(ajax_object.ajax_url, databc, function(response) 116 { 117 jQuery('.cus_loader').remove(); 118 jQuery('body').append('<div class="custom_update_msg"><div class="custom_update_msg_innr">'+response+'</div></div>'); 119 setTimeout(function () 120 { 121 jQuery('.custom_update_msg').fadeOut('slow'); 122 }, 1000); 123 }); 124 }); 125 126 // jQuery(document).on('change', '.pm_deactivate_user', function() 127 // { 128 // var post_id_con = jQuery(this).data('id'); 129 // var sf_contact_id = jQuery(this).data('sf_contact_id'); 130 // var sf_access = jQuery(this).data('sf_access'); 131 // if (jQuery(this).is(':checked')) 132 // { 133 // var pm_deactivate_user = 'true'; 134 // } 135 // else 136 // { 137 // var pm_deactivate_user = 'false'; 138 // } 139 // jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 140 // var databc = { 141 // 'action': 'deactivate_portal_user_ajax', 142 // 'post_id_con': post_id_con, 143 // 'sf_contact_id': sf_contact_id, 144 // 'sf_access': sf_access, 145 // 'pm_deactivate_user': pm_deactivate_user, 146 // }; 147 // jQuery.post(ajax_object.ajax_url, databc, function(response) 148 // { 149 // jQuery('.cus_loader').remove(); 150 // jQuery('body').append('<div class="custom_update_msg"><div class="custom_update_msg_innr">'+response+'</div></div>'); 151 // setTimeout(function () 152 // {
153 // jQuery('.custom_update_msg').fadeOut('slow'); 154 // location.reload(); 155 // }, 1000); 156 // }); 157 // }); 158 159 jQuery(document).on('change', '.pm_deactivate_user', function() { 160 var post_id_con = jQuery(this).data('id'); 161 var sf_contact_id = jQuery(this).data('sf_contact_id'); 162 var sf_access = jQuery(this).data('sf_access'); 163 var pm_deactivate_user = jQuery(this).is(':checked') ? 'true' : 'false'; 164 const nonce = jQuery(this).closest('tr').data('nonce'); 165 jQuery('#deactivateModal').fadeIn(); 166 jQuery('#confirmDeactivate').on('click', function() { 167 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 168 var databc = { 169 'action': 'deactivate_portal_user_ajax', 170 'nonce': nonce, 171 'post_id_con': post_id_con, 172 'sf_contact_id': sf_contact_id, 173 'sf_access': sf_access, 174 'pm_deactivate_user': pm_deactivate_user, 175 }; 176 jQuery.post(ajax_object.ajax_url, databc, function(response) { 177 jQuery('.cus_loader').remove(); 178 jQuery('body').append('<div class="custom_update_msg"><div class="custom_update_msg_innr">' + response + '</div></div>'); 179 setTimeout(function() { 180 jQuery('.custom_update_msg').fadeOut('slow'); 181 location.reload(); 182 }, 1000); 183 }); 184 jQuery('#deactivateModal').fadeOut(); 185 }); 186 jQuery('#cancelDeactivate').on('click', function() { 187 jQuery('.pm_deactivate_user[data-id="' + post_id_con + '"]').prop('checked', false); 188 jQuery('#deactivateModal').fadeOut(); 189 }); 190 jQuery('.close_modal').on('click', function() { 191 jQuery('#deactivateModal').fadeOut(); 192 }); 193 }); 194 195 // jQuery(document).on('click', '.portal_user_table thead td span', function() 196 // { 197 // var account_id = jQuery.trim(jQuery(this).data('account')); 198 // jQuery('.portal_user_table thead td span').removeClass('asc_order'); 199 // jQuery('.portal_user_table thead td span').removeClass('desc_order'); 200 // if(account_id=='') 201 // { 202 // return false; 203 // } 204 // var order_key = jQuery.trim(jQuery(this).data('value')); 205 // var order_val = jQuery.trim(jQuery(this).data('order')); 206 // 207 // if(order_val=='asc') 208 // { 209 // jQuery(this).data('order','desc'); 210 // jQuery(this).addClass('asc_order'); 211 // } 212 // else 213 // { 214 // jQuery(this).data('order','asc'); 215 // jQuery(this).addClass('desc_order'); 216 // } 217 // 218 // jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 219 // var databc = { 220 // 'action': 'portal_account_user_orderby_ajax', 221 // 'account_id': account_id, 222 // 'order_key': order_key, 223 // 'order_val': order_val, 224 // }; 225 // jQuery.post(ajax_object.ajax_url, databc, function(response) 226 // { 227 // jQuery('.portal_user_table tbody').html(response); 228 // jQuery('.cus_loader').remove(); 229 // }); 230 // return false; 231 // }); 232 jQuery(document).on('change', '.pe_main_categories select', function() 233 { 234 var main_cat = jQuery(this).find('option:selected').val(); 235 236 237 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 238 var databc = { 239 'action': 'get_sub_categories_by_parent', 240 'main_cat': main_cat, 241 }; 242 jQuery.post(ajax_object.ajax_url, databc, function(response) 243 { 244 jQuery('.pe_sub_categories select').html(response.sub_cats); 245 if(response.sub_cats) 246 { 247 localStorage.setItem('pe_sub_categories',response.sub_cats); 248 localStorage.setItem('pe_main_category_selected',main_cat); 249 } 250 251 jQuery('.pe_sub_categories').show(); 252 jQuery('.cus_loader').remove(); 253 254 }); 255 return false; 256 }); 257 var page = 2; 258 jQuery(document).on('click', '.load_more_events a', function() 259 { 260 var event_type = jQuery(this).data('type'); 261 var total_event_pg = jQuery(this).data('total'); 262 var per_page = jQuery(this).data('number'); 263 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 264 var databc = { 265 'action': 'load_more_event_ajax', 266 'event_type': event_type, 267 'total_event_pg': total_event_pg, 268 'cus_paged': page, 269 'per_page': per_page, 270 }; 271 jQuery.post(ajax_object.ajax_url, databc, function(response) 272 { 273 if(response!='no event found') 274 { 275 jQuery('.event_list_minimal.'+event_type+'_events .event_list_cus').append(response); 276 } 277 else 278 {
279 jQuery('.'+event_type+'_events .load_more_events').remove(); 280 } 281 282 jQuery('.cus_loader').remove(); 283 page++; 284 }); 285 286 return false; 287 }); 288 jQuery("#input_4_29").change(function() 289 { 290 var val = jQuery(this).val(); 291 292 switch(val.substring(val.lastIndexOf('.') + 1).toLowerCase()){ 293 case 'pdf': 294 jQuery('.invalid_file').remove(); 295 break; 296 default: 297 jQuery(this).val(''); 298 // error message here 299 jQuery(this).parent().append('<span class="invalid_file">You can only upload a PDF. Please try again!</span>'); 300 break; 301 } 302 }); 303 304}); 305 306jQuery(document).on('change', '.pe_filter_col .pe_cat_drop', function() 307{ 308 var pe_main_cat = jQuery(this).find('option:selected').val(); 309 if(pe_main_cat=='all') 310 { 311 pe_main_cat = ''; 312 } 313 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 314 var databc = { 315 'action': 'pe_post_ajax_call', 316 'pe_main_cat': pe_main_cat, 317 }; 318 jQuery.post(ajax_object.ajax_url, databc, function(response) 319 { 320 if(response.msg!='') 321 { 322 jQuery('.policy_exchange_list').html(`<h3>There are currently no resources that match your search. Want to ask your peers for an example? Submit a document request <a href="https://${ajax_object.portal_url}/policy-exchange/request/">here</a> and we will alert you when one gets submitted matching your request.</h3>`); 323 } 324 else 325 { 326 jQuery('.pe_filter_col .pe_sub_cat_drop').html(response.sub_cats); 327 jQuery('.policy_exchange_list').html(response.pe_post_list_ajax); 328 } 329 330 jQuery('.cus_loader').remove(); 331 332 }).fail(function() 333 { 334 jQuery('.cus_loader').remove(); 335 }); 336 return false; 337}); 338 339jQuery(document).on('change', '.pe_filter_col .pe_sub_cat_drop', function() 340{ 341 var pe_sub_cat = jQuery(this).find('option:selected').val(); 342 if(pe_sub_cat=='all') 343 { 344 var pe_sub_cat = jQuery('.pe_filter_col .pe_cat_drop').find('option:selected').val(); 345 } 346 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 347 var databc = { 348 'action': 'pe_post_ajax_call', 349 'pe_sub_cat': pe_sub_cat, 350 }; 351 jQuery.post(ajax_object.ajax_url, databc, function(response) 352 { 353 if(response.msg!='') 354 { 355 jQuery('.policy_exchange_list').html(`<h3>There are currently no resources that match your search. Want to ask your peers for an example? Submit a document request <a href="${ajax_object.portal_url}/policy-exchange/request/">here</a> and we will alert you when one gets submitted matching your request.</h3>`); 356 } 357 else 358 { 359 jQuery('.policy_exchange_list').html(response.pe_post_list_ajax); 360 } 361 jQuery('.cus_loader').remove(); 362 363 }).fail(function() 364 { 365 jQuery('.cus_loader').remove(); 366 }); 367 return false; 368}); 369 370// Policy exchange pagination handler (AJAX, mirrors the filter/search calls) 371jQuery(document).on('click', '.policy_exchange_list .cus_pagination a', function(e) 372{ 373 if (!jQuery('.pe_ajax_outer').length) 374 { 375 return; 376 } 377 378 e.preventDefault(); 379 380 var href = jQuery(this).attr('href'); 381 if (!href || href === '#') return false; 382 383 // Server-rendered links use pretty permalinks (/page/N/); AJAX-rendered 384 // links use ?paged=N â support both 385 var url = new URL(href, window.location.origin); 386 var paged = url.searchParams.get('paged'); 387 if (!paged) 388 { 389 var pagedMatch = url.pathname.match(/\/page\/(\d+)/); 390 paged = pagedMatch ? pagedMatch[1] : 1; 391 } 392 393 var search_val = jQuery.trim(jQuery('.pe_search_outr .pe_search_inp').val()); 394 var pe_main_cat = jQuery('.pe_filter_col .pe_cat_drop').find('option:selected').val(); 395 var pe_sub_cat = jQuery('.pe_filter_col .pe_sub_cat_drop').find('option:selected').val(); 396 if(pe_main_cat=='all') 397 { 398 pe_main_cat = ''; 399 } 400 if(pe_sub_cat=='all') 401 { 402 pe_sub_cat = ''; 403 } 404 405 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 406 var databc = { 407 'action': 'pe_post_ajax_call', 408 'search_val': search_val, 409 'pe_main_cat': pe_main_cat, 410 'pe_sub_cat': pe_sub_cat, 411 'paged': paged, 412 }; 413 jQuery.post(ajax_object.ajax_url, databc, function(response) 414 { 415 if(response.msg=='nothiing found') 416 { 417 jQuery('.policy_exchange_list').html(`<div class="nothing_found"><h3 class="no">There are currently no resources that match your search. Want to ask your peers for an example? Submit a document request <a href="${ajax_object.portal_url}/policy-exchange/request/">here</a> and we will alert you when one gets submitted matching your request.</h3></div>`); 418 } 419 else 420 { 421 jQuery('.policy_exchange_list').html(response.pe_post_list_ajax); 422 } 423 424 jQuery('.cus_loader').remove(); 425 426 jQuery('html, body').animate({ 427 scrollTop: jQuery('.pe_ajax_outer').offset().top - 100 428 }, 500); 429 }).fail(function() 430 { 431 jQuery('.cus_loader').remove(); 432 }); 433 434 return false;
435}); 436 437jQuery(document).on('click', '.pe_filter_col .pe_search_triger', function() 438{ 439 var search_val = jQuery.trim(jQuery('.pe_search_outr .pe_search_inp').val()); 440 var pe_main_cat = jQuery('.pe_filter_col .pe_cat_drop').find('option:selected').val(); 441 var pe_sub_cat = jQuery('.pe_filter_col .pe_sub_cat_drop').find('option:selected').val(); 442 if(pe_main_cat=='all') 443 { 444 pe_main_cat = ''; 445 } 446 if(pe_sub_cat=='all') 447 { 448 pe_sub_cat = ''; 449 } 450 451 452 if(search_val!='' ) 453 { 454 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 455 var databc = { 456 'action': 'pe_post_ajax_call', 457 'search_val': search_val, 458 'pe_main_cat': pe_main_cat, 459 'pe_sub_cat': pe_sub_cat, 460 }; 461 jQuery.post(ajax_object.ajax_url, databc, function(response) 462 { 463 if(response.msg=='nothiing found') 464 { 465 jQuery('.policy_exchange_list').html(`<div class="nothing_found"><h3 class="no">There are currently no resources that match your search. Want to ask your peers for an example? Submit a document request <a href="${ajax_object.portal_url}/policy-exchange/request/">here</a> and we will alert you when one gets submitted matching your request.</h3></div>`); 466 } 467 else 468 { 469 jQuery('.policy_exchange_list').html(response.pe_post_list_ajax); 470 } 471 jQuery('.cus_loader').remove(); 472 473 }).fail(function() 474 { 475 jQuery('.cus_loader').remove(); 476 }); 477 } 478 else 479 { 480 jQuery('.pe_search_outr .pe_search_inp').focus(); 481 } 482 return false; 483}); 484 485jQuery(document).on('keypress', '.pe_filter_col .pe_search_inp', function(e) 486{ 487 var key = e.which; 488 if(key == 13) 489 { 490 jQuery('.pe_filter_col .pe_search_triger').trigger('click'); 491 return false; 492 } 493}); 494 495 496jQuery(document).on('click', 'body .no_access_pp a', function() 497{ 498 alert("Sorry, you don't have access to this product"); 499 return false; 500}); 501jQuery(document).on('click', '.cus_sidebar_menu .menu li.menu-item-has-children > a', function() 502{ 503 jQuery(this).siblings('.sub-menu').slideToggle(); 504 return false; 505}); 506jQuery(document).on('click', '.com_form_btn_triger a', function() 507{ 508 jQuery('#gform_submit_button_9').trigger('click'); 509 return false; 510}); 511 512jQuery(document).on('click', '.pro_form_btn_trigger a', function() 513{ 514 jQuery('#gform_submit_button_5').trigger('click'); 515 return false; 516}); 517 518jQuery(document).on('click', '.pro_form_btn_trigger a', function() 519{ 520 jQuery('#gform_submit_button_16').trigger('click'); 521 return false; 522}); 523 524jQuery( document ).ready(function() 525{ 526 /* if (jQuery("body").hasClass("page-id-25")) 527 { 528 if (jQuery(window).width() > 1200) 529 { 530 const hasRunIntro = localStorage.getItem("hasRunIntro"); 531 if (hasRunIntro != 'already') 532 { 533 console.log(hasRunIntro); 534 introJs().setOptions({ 535 "dontShowAgain": true, 536 tooltipClass: 'customTooltip', 537 steps: [ 538 { 539 element: document.querySelector('.intro_step_one'), 540 intro: '<div class="cus_intro"><h2>Welcome To CreditUnions.com!</h2><p>Get inspired with articles discussing the credit unions industry by category under the "Topics" dropdown.</p></div>', 541 position: 'bottom' 542 }, 543 { 544 element: document.querySelector('.intro_step_two'), 545 intro: '<div class="cus_intro"><h2>Looking To Know More About A Specific Credit Union?</h2><p>Use "CUProfile" to look up a credit unionâs profile, executives, related articles and more.</p></div>', 546 position: 'bottom' 547 }, 548 { 549 element: document.querySelector('.intro_step_three'), 550 intro: '<div class="cus_intro"><h2>Check Out Callahans Event Calendar</h2><p>From industry-wide free events like Trendwatch to intimate executive Roundtables, there is something for everyone. Search here for upcoming and on-demand events.</p></div>', 551 position: 'bottom' 552 }, 553 { 554 element: document.querySelector('.intro_step_four'), 555 intro: '<div class="cus_intro"><h2>Marketplace</h2><p>In the market for a new supplier? Looking to share a press release? <a href="https://portal.callahan.com/upload-a-press-release/">Start here!</a></p></div>', 556 position: 'bottom' 557 }, 558 { 559 element: document.querySelector('.intro_step_five'), 560 intro: '<div class="cus_intro last_site_tour"><h2>Want the highlights from CreditUnions.com sent right to you?</h2><p>Easily browse through industry articles right from your inbox when you join our CreditUnions.com Newsletter.</p></div>', 561 position: 'top' 562 }, 563 ] 564 }).start(); 565 localStorage.setItem('hasRunIntro', 'already'); 566 } 567 } 568 } */ 569}); 570jQuery(document).on('click', '.introjs-nextbutton', function() 571{ 572 jQuery('.introjs-helperLayer').css({'margin-left':'0px'}); 573}); 574 575jQuery(document).on('keyup', '.search_by_name', function() 576{ 577 578 var search_by_name = jQuery.trim(jQuery(this).val());
579 if (jQuery(this).val().length > 2) 580 { 581 var databc = { 582 'action': 'credit_union_search_ajax_call', 583 'nonce': jQuery(this).closest('.credit_sarch_outr').data('nonce'), 584 'search_by_name': search_by_name, 585 }; 586 jQuery.post(ajax_object.ajax_url, databc, function(response) 587 { 588 jQuery('.cu_auto_search').html(response.cu_srch_post_list); 589 jQuery('.cu_auto_search').fadeIn(); 590 }); 591 } 592 else 593 { 594 jQuery('.cu_auto_search').fadeOut(); 595 } 596 597 return false; 598}); 599jQuery(document).on('click', '.find_creditUni', function() 600{ 601 602 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 603 var search_by_state = jQuery.trim(jQuery('.search_by_state').find('option:selected').val()); 604 var search_by_charter_name = jQuery.trim(jQuery('.search_by_charter_name').val()); 605 var search_by_name = jQuery.trim(jQuery('.search_by_name').val()); 606 var databc = { 607 'action': 'credit_union_search_ajax_call', 608 'nonce': jQuery(this).closest('.credit_sarch_outr').data('nonce'), 609 'search_by_state': search_by_state, 610 'search_by_charter_name': search_by_charter_name, 611 'search_by_name': search_by_name, 612 'search_by_btn_click': 'yes', 613 }; 614 jQuery.post(ajax_object.ajax_url, databc, function(response) 615 { 616 if(response.cu_srch_post_list) 617 { 618 jQuery('.hide_cu_result').fadeOut(); 619 jQuery('.credUni_search_result .credUni_srch_innr_body').html(response.cu_srch_post_list); 620 jQuery('.credUni_search_result').fadeIn(); 621 } 622 623 jQuery('.cus_loader').remove(); 624 625 }); 626 627 window.dataLayer = window.dataLayer || [] 628 dataLayer.push({ 629 event: "union_search", 630 union_name: search_by_name, 631 charter_number: search_by_charter_name, 632 state: search_by_state 633 }); 634 635 return false; 636}); 637jQuery(document).click(function(e) 638{ 639 640 if(jQuery(e.target).closest('.cu_auto_search').length == 0) 641 { 642 jQuery('.cu_auto_search').fadeOut(); 643 } 644 645}); 646jQuery(document).on('click', '.impace_center_newsletter_checkbox .icn_checkbx_item', function() 647{ 648 var impact_field = jQuery.trim(jQuery(this).data('field')); 649 var impact_val = jQuery.trim(jQuery(this).data('checked')); 650 var impact_cid = jQuery.trim(jQuery(this).data('id')); 651 var contact_post_id = jQuery.trim(jQuery(this).data('pid')); 652 var sf_access = jQuery.trim(jQuery('.sf_access').val()); 653 var checked = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M211.8 339.8C200.9 350.7 183.1 350.7 172.2 339.8L108.2 275.8C97.27 264.9 97.27 247.1 108.2 236.2C119.1 225.3 136.9 225.3 147.8 236.2L192 280.4L300.2 172.2C311.1 161.3 328.9 161.3 339.8 172.2C350.7 183.1 350.7 200.9 339.8 211.8L211.8 339.8zM0 96C0 60.65 28.65 32 64 32H384C419.3 32 448 60.65 448 96V416C448 451.3 419.3 480 384 480H64C28.65 480 0 451.3 0 416V96zM48 96V416C48 424.8 55.16 432 64 432H384C392.8 432 400 424.8 400 416V96C400 87.16 392.8 80 384 80H64C55.16 80 48 87.16 48 96z"/></svg>'; 654 var unchecked = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M384 32C419.3 32 448 60.65 448 96V416C448 451.3 419.3 480 384 480H64C28.65 480 0 451.3 0 416V96C0 60.65 28.65 32 64 32H384zM384 80H64C55.16 80 48 87.16 48 96V416C48 424.8 55.16 432 64 432H384C392.8 432 400 424.8 400 416V96C400 87.16 392.8 80 384 80z"/></svg>'; 655 const nonce = jQuery(this).closest('ul').data('nonce'); 656 657 if(impact_val=='false') 658 { 659 jQuery(this).find('.icn_checkbx_item_icon').html(unchecked); 660 } 661 else 662 { 663 jQuery(this).find('.icn_checkbx_item_icon').html(checked); 664 } 665 666 if(sf_access=='') 667 { 668 return false; 669 } 670 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 671 var data = { 672 'action': 'impact_center_newsletter_ajax', 673 'nonce': nonce, 674 'impact_field': impact_field, 675 'impact_val': impact_val, 676 'impact_cid': impact_cid, 677 'sf_access': sf_access, 678 'contact_post_id': contact_post_id, 679 }; 680 jQuery.post(ajax_object.ajax_url, data, function(response) 681 { 682 console.log(response); 683 jQuery('.cus_loader').remove(); 684 }); 685 return false;
686}); 687 688jQuery(document).on('click', '.menu-item-has-children > .has-submenu', function(e) 689{ 690 e.preventDefault(); 691 jQuery(this).parent().find(' > .sub-menu').slideToggle(); 692 return false; 693}); 694 695jQuery(document).on('change', '.portal_webinar_filter_outr .webinar_topics', function() 696{ 697 var topics = jQuery(this).find('option:selected').val(); 698 if(topics=='Select Keyword') 699 { 700 topics = ''; 701 } 702 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 703 var nonce = jQuery('.portal_webinar_filter_outr').data('nonce'); 704 var data = { 705 'action': 'portal_webinars_ajax', 706 'topics': topics, 707 '_ajax_nonce': nonce 708 }; 709 jQuery.post(ajax_object.ajax_url, data, function(response) 710 { 711 jQuery('.portal_webinars_outr').html(response); 712 jQuery('.cus_loader').remove(); 713 }); 714 715 return false; 716}); 717 718jQuery(document).on('click', '.portal_webinar_filter_outr .portal_web_filter', function() 719{ 720 var topics = jQuery('.webinar_topics').find('option:selected').val(); 721 var from_date_webinar = jQuery('.from_date_webinar').val(); 722 var to_date_webinar = jQuery('.to_date_webinar').val(); 723 var portal_webinar_search = jQuery('.portal_webinar_search').val(); 724 if(topics=='Select Keyword') 725 { 726 topics = ''; 727 } 728 729 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 730 var nonce = jQuery('.portal_webinar_filter_outr').data('nonce'); 731 var data = { 732 'action': 'portal_webinars_ajax', 733 'from_date_webinar': from_date_webinar, 734 'to_date_webinar': to_date_webinar, 735 'portal_webinar_search': portal_webinar_search, 736 'topics': topics, 737 '_ajax_nonce': nonce 738 }; 739 jQuery.post(ajax_object.ajax_url, data, function(response) 740 { 741 jQuery('.portal_webinars_outr').html(response); 742 jQuery('.cus_loader').remove(); 743 }); 744 745 return false; 746}); 747 748 749jQuery(document).on('change', '.portal_webinar_filter_outr .event_topics', function() 750{ 751 var topics = jQuery(this).find('option:selected').val(); 752 var from_date_webinar = jQuery('.from_date_webinar').val(); 753 var to_date_webinar = jQuery('.to_date_webinar').val(); 754 var portal_webinar_search = jQuery('.portal_webinar_search').val(); 755 756 757 if(topics=='Select Keyword') 758 { 759 topics = ''; 760 } 761 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 762 var nonce = jQuery('.portal_webinar_filter_outr').data('nonce'); 763 var data = { 764 'action': 'portal_events_ajax', 765 'topics': topics, 766 '_ajax_nonce': nonce 767 }; 768 jQuery.post(ajax_object.ajax_url, data, function(response) 769 { 770 jQuery('.upcoming-events .event_list_cus').html(response); 771 jQuery('.cus_loader').remove(); 772 }); 773 774 var topic_val = jQuery.trim(jQuery(this).find('option:selected').text()); 775 776 window.dataLayer = window.dataLayer || [] 777 dataLayer.push({ 778 event: "calendar_search", 779 keyword: topic_val, 780 start_date: from_date_webinar, 781 end_date: to_date_webinar, 782 search: portal_webinar_search 783 784 }); 785 786 console.log('topics',topic_val); 787 console.log('from_date_webinar',from_date_webinar); 788 console.log('to_date_webinar',to_date_webinar); 789 console.log('search',portal_webinar_search); 790 791 792 return false; 793}); 794 795jQuery(document).on('click', '.portal_webinar_filter_outr .portal_event_filter', function() 796{ 797 var topics = jQuery('.portal_webinar_filter_outr .event_topics').find('option:selected').val(); 798 var from_date_webinar = jQuery('.from_date_webinar').val(); 799 var to_date_webinar = jQuery('.to_date_webinar').val(); 800 var portal_webinar_search = jQuery('.portal_webinar_search').val(); 801 802 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 803 var nonce = jQuery('.portal_webinar_filter_outr').data('nonce'); 804 var data = { 805 'action': 'portal_events_ajax', 806 'from_date_webinar': from_date_webinar, 807 'to_date_webinar': to_date_webinar, 808 'portal_webinar_search': portal_webinar_search, 809 '_ajax_nonce': nonce 810 }; 811 jQuery.post(ajax_object.ajax_url, data, function(response) 812 { 813 jQuery('.upcoming-events .event_list_cus').html(response); 814 jQuery('.cus_loader').remove(); 815 }); 816 817 var topic_val = jQuery.trim(jQuery('.portal_webinar_filter_outr .event_topics').find('option:selected').text()); 818 819 window.dataLayer = window.dataLayer || [] 820 dataLayer.push({ 821 event: "calendar_search",
822 keyword: topic_val, 823 start_date: from_date_webinar, 824 end_date: to_date_webinar, 825 search: portal_webinar_search 826 827 }); 828 829 console.log('topics',topic_val); 830 console.log('from_date_webinar',from_date_webinar); 831 console.log('to_date_webinar',to_date_webinar); 832 console.log('search',portal_webinar_search); 833 834 return false; 835}); 836 837jQuery(document).on('click', '#accordion .panel-title a', function() 838{ 839 jQuery(this).parent().parent().parent().find('.panel-collapse').slideToggle(); 840 return false; 841}); 842 843 844jQuery(window).load(function() 845{ 846 jQuery(".custom__pgination_ssm a, .cus_pagination a").each(function() 847 { 848 var href = jQuery(this).attr('href'); 849 850 if (jQuery("body").hasClass("current_blog_id_2")) 851 { 852 href = href.replace(ajax_object.creditunions_url, ajax_object.portal_url); 853 jQuery(this).attr('href',href); 854 } 855 856 }); 857}); 858 859jQuery(document).on('click', '.portal_edit_contact_btn', function() 860{ 861 var edit_cbtn = jQuery(this); 862 jQuery(this).parent().parent().parent().addClass('edit_row'); 863 jQuery(this).addClass('portal_update_contact_btn'); 864 jQuery(this).text('Update'); 865 return false; 866}); 867 868jQuery(document).on('click', '.portal_update_contact_btn', function() 869{ 870 871 var post_id = jQuery(this).data('id'); 872 var sf_contact_id = jQuery(this).data('sf_contact_id'); 873 var sf_access = jQuery(this).data('sf_access'); 874 var first_name = jQuery(this).parent().parent().parent().find('input[name="firstName"]').val(); 875 var last_name = jQuery(this).parent().parent().parent().find('input[name="lastName"]').val(); 876 var email = jQuery(this).parent().parent().parent().find('input[name="email"]').val(); 877 var department = jQuery(this).parent().parent().parent().find('select[name="department"] option:selected').val(); 878 var title = jQuery(this).parent().parent().parent().find('input[name="title"]').val(); 879 const nonce = jQuery(this).closest('tr').data('nonce'); 880 881 if (!nonce || nonce === '') { 882 console.error('Nonce value is missing or invalid.'); 883 return false; 884 } 885 886 if(sf_access=='') 887 { 888 return false; 889 } 890 891 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 892 893 var data = { 894 'action': 'portal_update_user_ajax', 895 'nonce': nonce, 896 'post_id': post_id, 897 'sf_contact_id': sf_contact_id, 898 'sf_access': sf_access, 899 'first_name': first_name, 900 'last_name': last_name, 901 'department': department, 902 'title': title, 903 'email': email, 904 }; 905 jQuery.post(ajax_object.ajax_url, data, function(response) 906 { 907 jQuery('.cus_loader').remove(); 908 }); 909 910 return false; 911}); 912 913 914jQuery(document).on('click', '.policy_exchange_item .full_box_link', function() 915{ 916 var publisher = jQuery(this).data('publisher'); 917 var title = jQuery(this).data('title'); 918 var pe_cat_drop = jQuery('.pe_cat_drop').find('option:selected').text(); 919 var pe_sub_cat_drop = jQuery('.pe_sub_cat_drop').find('option:selected').text(); 920 921 window.dataLayer = window.dataLayer || [] 922 dataLayer.push({ 923 event: "download", 924 title: title, 925 publisher: publisher, 926 Category:pe_cat_drop, 927 sub_category: pe_sub_cat_drop 928 }); 929}); 930 931jQuery(document).on('click', '.cu_auto_search a', function() 932{ 933 var title = jQuery(this).data('title'); 934 var charter_number = jQuery(this).data('charter_number'); 935 var state = jQuery(this).data('state'); 936 937 window.dataLayer = window.dataLayer || [] 938 dataLayer.push({ 939 event: "union_search", 940 union_name: title, 941 charter_number: charter_number, 942 state: state 943 }); 944; 945}); 946 947 948jQuery(document).ready(function() 949{ 950 if (jQuery("body").hasClass("page-id-31733") && jQuery("#gform_confirmation_wrapper_7").length != 0 ) 951 { 952 jQuery('.page_heading_px .elementor-heading-title').text('Document Submission Successful!');
953 jQuery('.confirm_txt_px_upload p').text('Thank you for your submission to the Policy Exchange. We will review your document and post it to the exchange upon approval with 2 business days.'); 954 955 localStorage.removeItem("pe_sub_categories"); 956 localStorage.removeItem("pe_main_category_selected"); 957 localStorage.removeItem("pe_sub_category_selected"); 958 } 959 if (jQuery("body").hasClass("page-id-31807") && jQuery("#gform_confirmation_wrapper_8").length != 0 ) 960 { 961 jQuery('.page_heading_px .elementor-heading-title').text('Request Submitted!'); 962 jQuery('.req_px_doc_body .elementor-widget-container p').text('Your request for a new document has been submitted for review. We will review your request and post it to the Policy Exchange upon approval with 2 business days.'); 963 } 964}); 965 966 967jQuery(document).on('change', '.pe_sub_categories select', function() 968{ 969 var subCategory = jQuery(this).find('option:selected').val(); 970 971 localStorage.setItem('pe_sub_category_selected',subCategory); 972}); 973 974jQuery(window).load(function() 975{ 976 let pe_sub_cats = localStorage.getItem('pe_sub_categories'); 977 let pe_selected_main_cat = localStorage.getItem('pe_main_category_selected'); 978 let pe_sub_category_selected = localStorage.getItem('pe_sub_category_selected'); 979 980 if(pe_sub_cats) 981 { 982 jQuery('.pe_sub_categories select').html(pe_sub_cats); 983 } 984 if(pe_selected_main_cat) 985 { 986 jQuery('.pe_main_categories select option:contains('+pe_selected_main_cat+')').attr('selected', 'selected'); 987 } 988 if(pe_sub_category_selected) 989 { 990 jQuery('.pe_sub_categories select option[value='+pe_sub_category_selected+']').attr('selected', 'selected'); 991 } 992}); 993jQuery(document).on('click', '.home .n2-ss-button-container a', function() 994{ 995 var heading_txt = jQuery(this).parent().parent().parent().find('div:eq(1)').text(); 996 997 if(heading_txt !== undefined || heading_txt !== null) 998 { 999 window.dataLayer = window.dataLayer || [] 1000 dataLayer.push({ 1001 event: "rotator_click", 1002 rotator_heading: heading_txt 1003 }); 1004 } 1005 console.log(heading_txt); 1006}); 1007 1008jQuery(document).on('change', '.cu_league_state_filter select', function() 1009{ 1010 var state = jQuery(this).find('option:selected').val(); 1011 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 1012 var league_id = jQuery(this).data('id'); 1013 var sf_access_tokan = jQuery(this).data('sf_access_tokan'); 1014 var databc = { 1015 'action': 'credit_uinon_league_ajax', 1016 'nonce': jQuery(this).closest('.creditUnionList').data('nonce'), 1017 'state': state, 1018 'league_id': league_id, 1019 'sf_access_tokan': sf_access_tokan, 1020 }; 1021 jQuery.post(ajax_object.ajax_url, databc, function(response) 1022 { 1023 jQuery('.creditUnionList .portal_user_table tbody').html(response); 1024 jQuery('.cus_loader').remove(); 1025 }); 1026 return false; 1027}); 1028 1029 1030jQuery(document).on('click', '.portal_user_table .cu_to_league_btn', function() 1031{ 1032 var postid = jQuery(this).attr('data-postId'); 1033 var league_id = jQuery(this).attr('data-leagueId'); 1034 var sf_access = jQuery(this).attr('data-sf_access'); 1035 var account_id = jQuery(this).attr('data-account_id'); 1036 const nonce = jQuery(this).data('nonce'); 1037 1038 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 1039 var databc = { 1040 'action': 'update_credit_uinon_league_ajax', 1041 'postid': postid, 1042 'nonce': nonce, 1043 'league_id': league_id, 1044 'sf_access': sf_access, 1045 'account_id': account_id, 1046 }; 1047 jQuery.post(ajax_object.ajax_url, databc, function(response) 1048 { 1049 jQuery('.cus_loader').remove(); 1050 alert('League Updated'); 1051 location.reload(true); 1052 }); 1053 return false; 1054}); 1055 1056jQuery(document).on('click', '.portal_user_table .remove_cu_to_league_btn', function() 1057{ 1058 var postid = jQuery(this).attr('data-postId'); 1059 var sf_access = jQuery(this).attr('data-sf_access'); 1060 var account_id = jQuery(this).attr('data-account_id'); 1061 const nonce = jQuery(this).data('nonce'); 1062 1063 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 1064 var databc = { 1065 'action': 'update_credit_uinon_league_ajax', 1066 'nonce': nonce, 1067 'postid': postid, 1068 'sf_access': sf_access, 1069 'account_id': account_id, 1070 }; 1071 jQuery.post(ajax_object.ajax_url, databc, function(response) 1072 { 1073 jQuery('.cus_loader').remove(); 1074 alert('Credit Union Removed'); 1075 location.reload(true); 1076 }); 1077 return false;
1078}); 1079 1080jQuery(document).on('click', '.league_logo_outr .league_logo_upload', function() 1081{ 1082 jQuery('.League_logo_popup_outer').fadeIn(); 1083 let postId = jQuery(this).data('post_id'); 1084 1085 jQuery('#input_17_3').val(postId) 1086 return false; 1087}); 1088jQuery(document).on('click', '.League_logo_popup_outer .close_pp_league', function() 1089{ 1090 jQuery('.League_logo_popup_outer').fadeOut(); 1091 return false; 1092}); 1093 1094jQuery(document).on('click', '.cu_league_state_filter .reset_cu_league', function() 1095{ 1096 jQuery('.cu_league_state_filter select').val('').trigger('change'); 1097 return false; 1098}); 1099 1100jQuery(document).on('click', '.show_loader, .show_loader a', function() 1101{ 1102 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 1103}); 1104 1105 1106/*---*/ 1107 1108jQuery(document).on('click', '.pe_filter_col .ge_pe_search_triger', function() 1109{ 1110 var search_val = jQuery.trim(jQuery('.pe_search_outr .ge_pe_search_inp').val()); 1111 var pe_main_cat = jQuery('.pe_filter_col .ge_pe_cat_drop').find('option:selected').val(); 1112 if(pe_main_cat=='all') 1113 { 1114 pe_main_cat = ''; 1115 } 1116 1117 1118 if(search_val!='') 1119 { 1120 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 1121 var databc = { 1122 'action': 'gp_pe_post_ajax_call', 1123 'search_val': search_val, 1124 'pe_main_cat': pe_main_cat, 1125 }; 1126 jQuery.post(ajax_object.ajax_url, databc, function(response) 1127 { 1128 if(response.msg=='nothiing found') 1129 { 1130 jQuery('.policy_exchange_list').html(`<div class="nothing_found"><h3 class="no">There are currently no resources that match your search. Want to ask your peers for an example? Submit a document request <a href="${ajax_object.portal_url}/policy-exchange/request/">here</a> and we will alert you when one gets submitted matching your request.</h3></div>`); 1131 } 1132 else 1133 { 1134 jQuery('.policy_exchange_list').html(response.pe_post_list_ajax); 1135 } 1136 1137 jQuery('.cus_loader').remove(); 1138 1139 }).fail(function() 1140 { 1141 jQuery('.cus_loader').remove(); 1142 }); 1143 } 1144 else 1145 { 1146 jQuery('.pe_search_outr .pe_search_inp').focus(); 1147 } 1148 return false; 1149}); 1150 1151jQuery(document).on('change', '.pe_filter_outr .gp_pe_filter_col .ge_pe_cat_drop', function() 1152{ 1153 var pe_main_cat = jQuery(this).find('option:selected').val(); 1154 if(pe_main_cat=='all') 1155 { 1156 pe_main_cat = ''; 1157 } 1158 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 1159 var databc = { 1160 'action': 'gp_pe_post_ajax_call', 1161 'pe_main_cat': pe_main_cat, 1162 }; 1163 jQuery.post(ajax_object.ajax_url, databc, function(response) 1164 { 1165 if(response.msg!='') 1166 { 1167 jQuery('.policy_exchange_list').html(`<h3>There are currently no resources that match your search. Want to ask your peers for an example? Submit a document request <a href="${ajax_object.portal_url}/policy-exchange/request/">here</a> and we will alert you when one gets submitted matching your request.</h3>`); 1168 } else { 1169 jQuery('.policy_exchange_list').html(response.pe_post_list_ajax); 1170 } 1171 1172 jQuery('.cus_loader').remove(); 1173 1174 }); 1175 return false; 1176}); 1177jQuery(document).on('keypress', '.pe_filter_outr .gp_pe_filter_col .pe_search_inp', function(e) 1178{ 1179 var key = e.which; 1180 if(key == 13) 1181 { 1182 jQuery('.gp_pe_filter_col .gp_pe_search_triger').trigger('click'); 1183 return false; 1184 } 1185}); 1186 1187 1188/*---*/ 1189 1190jQuery(document).on('click', '.gp_pe_ajax_outer .pe_search_triger', function() 1191{ 1192 var search_val = jQuery.trim(jQuery('.gp_pe_ajax_outer .pe_search_inp').val()); 1193 var pe_main_cat = jQuery('.gp_pe_filter_col .pe_cat_drop').find('option:selected').val(); 1194 if(pe_main_cat=='all') 1195 { 1196 pe_main_cat = ''; 1197 } 1198 1199 1200 if(search_val!='') 1201 { 1202 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 1203 var databc = { 1204 'action': 'gp_pe_post_ajax_call', 1205 'search_val': search_val, 1206 'pe_main_cat': pe_main_cat, 1207 }; 1208 jQuery.post(ajax_object.ajax_url, databc, function(response) 1209 { 1210 if(response.msg=='nothiing found') 1211 { 1212 jQuery('.policy_exchange_list').html(`<div class="nothing_found"><h3 class="no">There are currently no resources that match your search. Want to ask your peers for an example? Submit a document request <a href="${ajax_object.portal_url}/policy-exchange/request/">here</a> and we will alert you when one gets submitted matching your request.</h3></div>`); 1213 } 1214 else 1215 {
1216 jQuery('.policy_exchange_list').html(response.pe_post_list_ajax); 1217 } 1218 1219 jQuery('.cus_loader').remove(); 1220 1221 }).fail(function() 1222 { 1223 jQuery('.cus_loader').remove(); 1224 }); 1225 } 1226 else 1227 { 1228 jQuery('.pe_search_outr .pe_search_inp').focus(); 1229 } 1230 return false; 1231}); 1232 1233jQuery(document).on('change', '.gp_pe_ajax_outer .gp_pe_filter_col .pe_cat_drop', function() 1234{ 1235 var pe_main_cat = jQuery(this).find('option:selected').val(); 1236 if(pe_main_cat=='all') 1237 { 1238 pe_main_cat = ''; 1239 } 1240 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 1241 var databc = { 1242 'action': 'gp_pe_post_ajax_call', 1243 'pe_main_cat': pe_main_cat, 1244 }; 1245 jQuery.post(ajax_object.ajax_url, databc, function(response) 1246 { 1247 if(response.msg!='') 1248 { 1249 jQuery('.policy_exchange_list').html(`<h3>There are currently no resources that match your search. Want to ask your peers for an example? Submit a document request <a href="${ajax_object.portal_url}/policy-exchange/request/">here</a> and we will alert you when one gets submitted matching your request.</h3>`); 1250 } 1251 else 1252 { 1253 jQuery('.policy_exchange_list').html(response.pe_post_list_ajax); 1254 } 1255 1256 jQuery('.cus_loader').remove(); 1257 1258 }).fail(function() 1259 { 1260 jQuery('.cus_loader').remove(); 1261 }); 1262 return false; 1263}); 1264jQuery(document).on('keypress', '.gp_pe_ajax_outer .gp_pe_filter_col .pe_search_inp', function(e) 1265{ 1266 var key = e.which; 1267 if(key == 13) 1268 { 1269 jQuery('.gp_pe_ajax_outer .pe_search_triger').trigger('click'); 1270 return false; 1271 } 1272 1273}); 1274 1275// Gallup document catalog pagination handler (AJAX, mirrors the filter/search calls) 1276jQuery(document).on('click', '.policy_exchange_list .cus_pagination a', function(e) 1277{ 1278 if (!jQuery('.gp_pe_ajax_outer').length) 1279 { 1280 return; 1281 } 1282 1283 e.preventDefault(); 1284 1285 var href = jQuery(this).attr('href'); 1286 if (!href || href === '#') return false; 1287 1288 // Server-rendered links use pretty permalinks (/page/N/); AJAX-rendered 1289 // links use ?paged=N â support both 1290 var url = new URL(href, window.location.origin); 1291 var paged = url.searchParams.get('paged'); 1292 if (!paged) 1293 { 1294 var pagedMatch = url.pathname.match(/\/page\/(\d+)/); 1295 paged = pagedMatch ? pagedMatch[1] : 1; 1296 } 1297 1298 var search_val = jQuery.trim(jQuery('.gp_pe_ajax_outer .pe_search_inp').val()); 1299 var pe_main_cat = jQuery('.gp_pe_filter_col .pe_cat_drop').find('option:selected').val(); 1300 if(pe_main_cat=='all') 1301 { 1302 pe_main_cat = ''; 1303 } 1304 1305 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 1306 var databc = { 1307 'action': 'gp_pe_post_ajax_call', 1308 'search_val': search_val, 1309 'pe_main_cat': pe_main_cat, 1310 'paged': paged 1311 }; 1312 jQuery.post(ajax_object.ajax_url, databc, function(response) 1313 { 1314 if(response.msg=='nothiing found') 1315 { 1316 jQuery('.policy_exchange_list').html(`<div class="nothing_found"><h3 class="no">There are currently no resources that match your search. Want to ask your peers for an example? Submit a document request <a href="${ajax_object.portal_url}/policy-exchange/request/">here</a> and we will alert you when one gets submitted matching your request.</h3></div>`); 1317 } 1318 else 1319 { 1320 jQuery('.policy_exchange_list').html(response.pe_post_list_ajax); 1321 } 1322 1323 jQuery('.cus_loader').remove(); 1324 1325 jQuery('html, body').animate({ 1326 scrollTop: jQuery('.gp_pe_ajax_outer').offset().top - 100 1327 }, 500); 1328 }).fail(function() 1329 { 1330 jQuery('.cus_loader').remove(); 1331 }); 1332 1333 return false; 1334}); 1335 1336jQuery(document).on('click', '.mob_sidebar_menu_trigger a', function() 1337{ 1338 jQuery(".portal_sidebar_menu_toggle.cus_sidebar_trigger").slideToggle(); 1339 return false; 1340}); 1341 1342jQuery(document).on('click', '.ajaxPaginationEvents a, .ajaxPaginationEvents span', function() 1343{ 1344 if (jQuery(this).hasClass('next')) { 1345 return false; 1346 } 1347 var page = jQuery.trim(jQuery(this).text()); 1348 jQuery('.ajaxPaginationEvents .page-numbers').removeClass('current'); 1349 jQuery(this).addClass('current'); 1350 let perPage = jQuery.trim(jQuery(this).parent().data('perpage')); 1351 let categories = jQuery.trim(jQuery(this).parent().data('categories ')); 1352 // Get the categories value from the shortcode 1353 //var categories = jQuery('.event_list_minimal').data('categories'); // Assuming you store categories in a data attribute on the container 1354 // Log the categories value to the console 1355 console.log('Categories:', perPage); 1356 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 1357 var databc = { 1358 'action': 'events_pagination_ajax', 1359 'page': page, 1360 'per_page': perPage, 1361 'categories': categories, 1362 }; 1363 jQuery.post(ajax_object.ajax_url, databc, function(response) 1364 { 1365 jQuery('.event_list_minimal .event_list_cus').html(response) 1366 jQuery('.cus_loader').remove(); 1367 }); 1368 return false;
1369}); 1370jQuery(document).on('click', '.ajaxPaginationEvents .next', function() 1371{ 1372 let page = jQuery.trim(jQuery('.ajaxPaginationEvents .page-numbers.current').text()); 1373 page = parseInt(page) + 1; 1374 let perPage = jQuery.trim(jQuery(this).parent().data('perpage')); 1375 let maxpage = jQuery.trim(jQuery(this).parent().data('maxpage')); 1376 1377 if(page > maxpage) { 1378 return false 1379 } 1380 var current = jQuery(this).parent().find('.page-numbers.current'); 1381 var next = current.next('.page-numbers'); 1382 1383 current.removeClass('current'); 1384 next.addClass('current'); 1385 1386 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 1387 var databc = { 1388 'action': 'events_pagination_ajax', 1389 'page': page, 1390 'per_page': perPage, 1391 'categories': categories, 1392 }; 1393 jQuery.post(ajax_object.ajax_url, databc, function(response) 1394 { 1395 jQuery('.event_list_minimal .event_list_cus').html(response) 1396 jQuery('.cus_loader').remove(); 1397 }); 1398 return false; 1399}); 1400 1401 1402 1403jQuery(document).on('ajaxSuccess', function(event, xhr, settings) { 1404 if (settings.data && settings.data.indexOf('action=jet_smart_filters') !== -1) { 1405 var jsonResponse = xhr.responseJSON; 1406 console.log(jsonResponse); 1407 1408 if (jsonResponse && jsonResponse.content) { 1409 var postGridHtml = jsonResponse.content; 1410 if (postGridHtml.trim() === '<div class="elementor-widget-container"></div>') { 1411 postGridHtml = '<div class="elementor-widget-container"><p class="No_record_found">No results found.</p></div>'; 1412 } 1413 if(jQuery('.elementor-widget-wrap.elementor-element-populated').find('#press_grid').hasClass('press_grid')) 1414{ 1415setTimeout(function(){ 1416jQuery('.press_grid').html(postGridHtml); 1417 1418},500); 1419 1420} 1421 1422 } 1423 } 1424}); 1425 1426jQuery(document).ready(function ($) { 1427 if (window.location.hash) { 1428 var target = $(window.location.hash); 1429 if (target.length) { 1430 $('html, body').animate({ 1431 scrollTop: target.offset().top - 120 1432 }, 800); 1433 } 1434 } 1435}); 1436 1437 1438jQuery(document).on('click', '.suppliers_search_box_wrap_listing button', function() 1439{ 1440 var cus_sup_search = jQuery.trim(jQuery('.cus_sup_search').val()); 1441 if(cus_sup_search=='') 1442 { 1443 return false; 1444 } 1445 1446 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 1447 var data = { 1448 'action': 'cu_supplier_search_ajax_listing', 1449 'search': cus_sup_search, 1450 }; 1451 jQuery.post(ajax_object.ajax_url, data, function(response) 1452 { 1453 jQuery('.suppliers_listing_outer').html(response); 1454 jQuery('.cus_loader').remove(); 1455 }); 1456 1457 var search_by_cat_txt = jQuery.trim(jQuery('.search_by_cat select[name="search_by_area_portal"]').find('option:selected').text()); 1458 if(search_by_cat_txt=='Search By Service Area') 1459 { 1460 search_by_cat_txt = null; 1461 } 1462 1463 window.dataLayer = window.dataLayer || [] 1464 dataLayer.push({ 1465 event: "supplier_search", 1466 service_area: search_by_cat_txt, 1467 supplier_name: cus_sup_search, 1468 }); 1469 console.log("supplier_search",search_by_cat_txt); 1470 console.log("supplier_name",cus_sup_search); 1471 1472 return false; 1473}); 1474 1475/*--- Cohort Exchange Handlers ---*/ 1476// Form submit handler (Enter key or button click) 1477jQuery(document).on('submit', '.cohort_exchange_filter_form', function(e) 1478{ 1479 e.preventDefault(); 1480 var search_val = jQuery.trim(jQuery('.cohort_search_inp').val()); 1481 var pe_main_cat = jQuery('.cohort_cat_drop').find('option:selected').val(); 1482 var cohort_id = jQuery('.cohort_exchange_filter_outer').data('cohort-id'); 1483 var nonce = jQuery('#cohort_exchange_nonce').val(); 1484 1485 if(pe_main_cat == 'all') 1486 { 1487 pe_main_cat = ''; 1488 } 1489 1490 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 1491 var databc = { 1492 'action': 'cohort_exchange_ajax_call', 1493 'search_val': search_val, 1494 'pe_main_cat': pe_main_cat, 1495 'cohort_id': cohort_id, 1496 'nonce': nonce, 1497 'paged': 1 1498 }; 1499 1500 jQuery.post(ajax_object.ajax_url, databc, function(response) 1501 { 1502 if(response.msg == 'nothing found') 1503 { 1504 jQuery('.policy_exchange_list').html('<div class="nothing_found"><h3 class="no">There are currently no resources that match your search.</h3></div>'); 1505 } 1506 else 1507 { 1508 jQuery('.policy_exchange_list').html(response.pe_post_list_ajax); 1509 } 1510 1511 jQuery('.cus_loader').remove(); 1512 }).fail(function() 1513 { 1514 jQuery('.cus_loader').remove(); 1515 }); 1516 1517 return false;
1518}); 1519 1520// Category dropdown change handler 1521jQuery(document).on('change', '.cohort_exchange_filter_outer .cohort_cat_drop', function() 1522{ 1523 var pe_main_cat = jQuery(this).find('option:selected').val(); 1524 var cohort_id = jQuery('.cohort_exchange_filter_outer').data('cohort-id'); 1525 var nonce = jQuery('#cohort_exchange_nonce').val(); 1526 1527 if(pe_main_cat == 'all') 1528 { 1529 pe_main_cat = ''; 1530 } 1531 1532 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 1533 var databc = { 1534 'action': 'cohort_exchange_ajax_call', 1535 'pe_main_cat': pe_main_cat, 1536 'cohort_id': cohort_id, 1537 'nonce': nonce, 1538 'paged': 1 1539 }; 1540 1541 jQuery.post(ajax_object.ajax_url, databc, function(response) 1542 { 1543 if(response.msg == 'nothing found') 1544 { 1545 jQuery('.policy_exchange_list').html('<h3>There are currently no resources that match your search.</h3>'); 1546 } 1547 else 1548 { 1549 jQuery('.policy_exchange_list').html(response.pe_post_list_ajax); 1550 } 1551 1552 jQuery('.cus_loader').remove(); 1553 }).fail(function() 1554 { 1555 jQuery('.cus_loader').remove(); 1556 }); 1557 1558 return false; 1559}); 1560 1561// Pagination handler 1562jQuery(document).on('click', '.policy_exchange_list .cus_pagination a', function(e) 1563{ 1564 // Policy exchange and gallup catalog share the .policy_exchange_list / 1565 // .cus_pagination markup but have their own pagination handlers, keyed 1566 // off their page container classes (.pe_ajax_outer / .gp_pe_ajax_outer) 1567 if (!jQuery('.cohort_exchange_filter_outer').length) 1568 { 1569 return; 1570 } 1571 1572 e.preventDefault(); 1573 1574 var href = jQuery(this).attr('href'); 1575 if (!href || href === '#') return false; 1576 1577 // Server-rendered links use pretty permalinks (/page/N/); AJAX-rendered 1578 // links use ?paged=N â support both 1579 var url = new URL(href, window.location.origin); 1580 var paged = url.searchParams.get('paged'); 1581 if (!paged) 1582 { 1583 var pagedMatch = url.pathname.match(/\/page\/(\d+)/); 1584 paged = pagedMatch ? pagedMatch[1] : 1; 1585 } 1586 1587 var search_val = jQuery.trim(jQuery('.cohort_search_inp').val()); 1588 var pe_main_cat = jQuery('.cohort_cat_drop').find('option:selected').val(); 1589 var cohort_id = jQuery('.cohort_exchange_filter_outer').data('cohort-id'); 1590 var nonce = jQuery('#cohort_exchange_nonce').val(); 1591 1592 if(pe_main_cat == 'all') 1593 { 1594 pe_main_cat = ''; 1595 } 1596 1597 jQuery('body').append('<div class="cus_loader"><div class="cus_loader_innr"><div class="lds-dual-ring"></div></div></div>'); 1598 var databc = { 1599 'action': 'cohort_exchange_ajax_call', 1600 'search_val': search_val, 1601 'pe_main_cat': pe_main_cat, 1602 'cohort_id': cohort_id, 1603 'nonce': nonce, 1604 'paged': paged 1605 }; 1606 1607 jQuery.post(ajax_object.ajax_url, databc, function(response) 1608 { 1609 if(response.msg == 'nothing found') 1610 { 1611 jQuery('.policy_exchange_list').html('<div class="nothing_found"><h3 class="no">There are currently no resources that match your search.</h3></div>'); 1612 } 1613 else 1614 { 1615 jQuery('.policy_exchange_list').html(response.pe_post_list_ajax); 1616 } 1617 1618 jQuery('.cus_loader').remove(); 1619 1620 // Scroll to top of results 1621 jQuery('html, body').animate({ 1622 scrollTop: jQuery('.cohort_exchange_filter_outer').offset().top - 100 1623 }, 500); 1624 }).fail(function() 1625 { 1626 jQuery('.cus_loader').remove(); 1627 }); 1628 1629 return false; 1630}); 1631/*--- End Cohort Exchange Handlers ---*/
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.