1/* 2* 3* AHF Front-end Script 4* 5*/ 6 7function ajax_post(params, cb, dataType) { 8 var url = '/wp-admin/admin-ajax.php'; 9 var ajaxParams = { 10 error: ajax_post_error, 11 success: function (result) { 12 cb(result); 13 }, 14 type:'POST', 15 url:url 16 }; 17 if (params) { 18 ajaxParams.data = params; 19 } 20 if (dataType) { 21 ajaxParams.dataType = dataType; 22 } 23 jQuery.ajax(ajaxParams); 24} 25function ajax_post_error(xhr, status, error) { 26// console.log(xhr); //.responseText); 27} 28 29 30 31/* 32* 33* Startup 34* 35*/ 36jQuery(function() { 37 // over slider menu init 38 initOverSliderMenu(); 39 40 // init primary component, if any 41 if(typeof COMPONENTS != 'undefined'){ 42 for (var i in COMPONENTS){ 43 if(COMPONENTS.hasOwnProperty(i)){ 44 var COMPONENT = COMPONENTS[i]; 45 switch (COMPONENT){ 46 case 'DONATIONS_CAROUSEL': 47 initDonationsCarousel(); 48 break; 49 case 'AHT_ROADMAP': 50 initAhtRoadMap(); 51 break; 52 default: 53 break; 54 } 55 } 56 } 57 } 58}); 59 60function initOverSliderMenu(){ 61 jQuery('li.menu-item-has-children a').click(function(e){ 62 var href = jQuery(this).attr('href'); 63 if(href=='#' || href=='##'){ 64 e.preventDefault(); 65 return false; 66 } 67 }); 68 69 jQuery('ul#menu-over-slider-menu li.menu-item-has-children').hover(function(){ 70 jQuery(this).addClass('active'); 71 }).mouseleave(function(){ 72 jQuery(this).removeClass('active'); 73 }); 74} 75 76function initDonationsCarousel(){ 77// setTimeout(function(){ 78 jQuery('#donations_carousel').slick({ 79 autoplay: true, 80 autoplaySpeed: 333, 81 speed: 2222, 82 arrows: false, 83 dots: false, 84 pauseOnFocus: false, 85 pauseOnHover: false, 86 slidesPerRow: 4, 87 slidesToShow: 4, 88 slidesToScroll: 1, 89 slide: '.donation_item' 90 }); 91// }, 333); 92} 93 94function initAhtRoadMap(){ 95/** 96 * 97 * 98 * Version 2: the data comes from the back-end 99 * The MILESTONES array is defined in "aht_timeline" shortcode (functions.php) 100 * 101 **/ 102 103 if(typeof MILESTONES == 'undefined'){ 104 MILESTONES = []; 105 } 106 jQuery('#aht-timeline').roadmap(MILESTONES, { 107 prevArrow: '<i class="material-icons">keyboard_arrow_left</i>', 108 nextArrow: '<i class="material-icons">keyboard_arrow_right</i>' 109 }); 110}
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.