1jQuery(document).ready(function ($) { 2 3 $('#search_keyword').keyup(function (e) { 4 console.log("===keyup==>"); 5 var textValue = $(this).val(); 6 if (textValue == '') { 7 $(".text-clear").click(); 8 $('.text-clear').hide(); 9 10 } else { 11 $('.text-clear').show(); 12 $('#search-error').hide(); 13 $('#search-error').html(''); 14 15 } 16 }); 17 18 19 $("#search_keyword").keyup(function (event) { 20 if (event.keyCode === 13) { 21 //$("#ins_search").click(); 22 console.log("shdghsg"); 23 SearchByKeyword(); 24 } 25 }); 26 27 //jquery for simplicity 28 $('.text-clear').on('click', function (e) { 29 e.preventDefault(); 30 $("#search_keyword").val(''); 31 $('.text-clear').hide(); 32 var cat_id = $('#cat_id').val(); 33 LoadCategoryPost(cat_id); 34 35 }); 36 37 $(document).on('submit_success', function (event, response) { 38 $('#insights_newsletter_frm').find('.elementor-form-fields-wrapper').hide(); 39 }); 40 41 /**/ 42 43 var sf_menu_sub = $('.sf-sub-menu'); 44 $('.sf-with-ul').on('click', function (e) { 45 e.stopPropagation(); 46 sf_menu_sub.toggle(); 47 }); 48 $(document).on('click', function (e) { 49 sf_menu_sub.hide(); 50 }); 51 52 /* Example 1: From an element in DOM*/ 53 jQuery('a.open-tm-link').click(function (e) { 54 var x = window.pageXOffset, 55 y = window.pageYOffset; 56 $(window).one('scroll', function () { 57 window.scrollTo(x, y); 58 }); 59 }); 60 // $('a.open-tm-link').magnificPopup({ 61 // type: 'inline', 62 // mainClass: 'team-gebbs-popup', 63 // closeBtnInside: true, 64 // fixedContentPos: false, 65 // showCloseBtn: false, 66 // fixedBgPos: true, 67 // callbacks: { 68 // beforeOpen: function () { 69 // /*this.st.mainClass = this.st.el.attr('data-effect');*/ 70 71 // }, 72 // open: function () { 73 // var tid = $(this).data('id'); 74 // $('html').css('overflow', 'hidden').css({ 'margin-right': '0' }); 75 76 77 78 // $('.mfp-close-custom').on("click", function () { 79 // $.magnificPopup.close(); 80 // }); 81 82 83 84 85 // }, 86 // close: function () { 87 // /* Will fire when popup is closed*/ 88 // $('html').css('overflow', 'auto').css('margin-right', '0'); 89 // } 90 // }, 91 // midClick: true /* allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.*/ 92 // }); 93 94 // $('.mfp-close-custom').on("click", function () { 95 // $.magnificPopup.close(); 96 // }); 97 98 99 100 101 if ($(window).width() <= 991) { 102 103 $('.mobile-fa-slider').not(".slick-initialized").slick({ 104 infinite: false, 105 slidesToShow: 1, 106 items: 1, 107 loop: true, 108 mouseDrag: false, 109 smartSpeed: 1000, 110 center: true, 111 nav: false, 112 dots: true, 113 arrows: false, 114 responsiveClass: true, 115 waitForAnimate: false, 116 variableWidth: false, 117 }); 118 119 120 $('.mobile-article-slider').not(".slick-initialized").slick({ 121 infinite: false, 122 slidesToShow: 1, 123 items: 1, 124 loop: true, 125 mouseDrag: false, 126 smartSpeed: 1000, 127 center: true, 128 nav: true, 129 dots: false, 130 responsiveClass: true, 131 waitForAnimate: false, 132 }); 133 134 135 } 136 137 138 139 $("#search_keyword").on('keyup', function (e) { 140 if (e.key === 'Enter' || e.keyCode === 13) { 141 // Do something 142 SearchByKeyword(); 143 } 144 }); 145 146 147 148 149}); 150 151function LoadCategoryPost(category_id, keyword = '') { 152 jQuery('.block-chai-section').show(); 153 154 var isvideos = ""; 155 var latestpopular=""; 156 var oc_nonce = jQuery('#oc_nonce').val(); 157 var search_keyword = jQuery('#search_keyword').val(); 158 var isvideo = jQuery('#isvideo').val(); 159 var latestpopulars = jQuery('#latestpopular').val(); 160 //var skippostid = jQuery('h3.fim_title').attr('id'); 161 if (isvideo != "") { 162 isvideos = isvideo; 163 } 164 if (latestpopulars != "") { 165 latestpopular = latestpopulars; 166 } 167 168 if (search_keyword != '') { 169 keyword = search_keyword.replace(/[^a-zA-Z0-9 ]/g, ''); 170 } 171 172 173 jQuery('.fp-list-item').removeClass('active'); 174 jQuery('.ic-item-' + category_id).addClass('active'); 175 var nav_tab = jQuery(".fp-list-item").closest('#mobile'); 176 setTimeout(function(){ 177 //console.log(nav_tab); 178 var horizontal_width = nav_tab.scrollLeft(); 179 var current_tab_width = nav_tab.find('.active').width(); 180 var current_tab_left_offset = nav_tab.find('.active').offset().left; 181 var extra_left_off = jQuery(window).width() - current_tab_width; 182 var scoll_width = horizontal_width + current_tab_left_offset - extra_left_off / 2 + 30; 183 nav_tab.animate({ scrollLeft: scoll_width }, 300); 184 }, 250); 185
186 var frontendajax = "https://zebpay.com/wp-admin/admin-ajax.php"; 187 //console.log('by js' + category_id + keyword + oc_nonce + isvideos); 188 jQuery.ajax({ 189 type: "post", 190 dataType: "html", 191 url: frontendajax, 192 data: { action: "get_posts_by_category", category_id: category_id, keyword: keyword, nonce: oc_nonce, isvideo: isvideos, latestpopular: latestpopular }, 193 beforeSend: function () { 194 jQuery('#filter-loader').show(); 195 }, 196 success: function (response) { 197 //console.log("response===>"+response); 198 jQuery('#filter-loader').hide(); 199 //('.fp-list-item').removeClass('active'); 200 jQuery('.ic-item-' + category_id).addClass('active'); 201 jQuery('#post-container-box').html(response); 202 if(category_id==35 && isvideos=="yes"){ 203 //console.log("block chai hide"); 204 jQuery('.block-chai-section').hide(); 205 //jQuery('.page-insights .block-chai-section').addClass("visible"); 206 } 207 208 if(category_id==0 && isvideos=="yes" && jQuery('.tabtag #post-container-box').find('#block-chai')){ 209 jQuery('.block-chai-section').hide(); 210 } 211 212 //leadPopup(); 213 214 } 215 }); 216} 217 218function SearchByKeyword() { 219 220 var search_keyword = jQuery('#search_keyword').val(); 221 var category_id = jQuery('#cat_id').val(); 222 var regexSearch = /^[A-Za-z0-9 ]+$/; 223 224 if (search_keyword == '' || search_keyword == "undefined") { 225 jQuery('#search-error').html('Please enter keyword'); 226 jQuery('#search-error').show(); 227 return false; 228 } else { 229 if (search_keyword.length <= 2) { 230 jQuery('#search-error').html('Please enter minimum 3 character'); 231 jQuery('#search-error').show(); 232 return false; 233 } else { 234 if (!regexSearch.test(search_keyword)) { 235 jQuery('#search-error').html('Please enter valid characters only'); 236 jQuery('#search-error').show(); 237 return false; 238 } else { 239 LoadCategoryPost(category_id, search_keyword); 240 } 241 } 242 } 243 244 245} 246 247function ViewAllPost(category_id) { 248 249 var search_keyword = jQuery('#search_keyword').val(); 250 LoadCategoryPost(category_id, search_keyword); 251 252 jQuery('html, body').animate({ 253 scrollTop: jQuery("#catTab").offset().top - 80 254 }, 2000); 255} 256 257function gotovdopage() { 258 var isvideo = jQuery('#isvideo').val(); 259 if(isvideo=="yes"){ 260 LoadCategoryPost(35); 261 window.scrollTo(0, 0); 262 }else{ 263 window.location.replace(siteurl + "/videos/?vcat_id=35"); 264 } 265} 266 267function featurecatshow(feature){ 268 jQuery("#removeopen, .custom-sort").removeClass("open"); 269 jQuery('#removeavive, .sort-by').removeClass("active"); 270 jQuery("#popular").removeClass("active"); 271 jQuery("#latest").removeClass("active"); 272 var search_keyword = jQuery('#search_keyword').val(); 273 var category_id = jQuery('#cat_id').val(); 274 275 if(feature=="P"){ 276 jQuery('#latestpopular').val("yes"); 277 jQuery("#popular").addClass("active"); 278 jQuery(".sort-by").html("<strong>Sort by:</strong> Most popular"); 279 //console.log("popular"); 280 }else{ 281 jQuery('#latestpopular').val(""); 282 jQuery("#latest").addClass("active"); 283 //console.log("latest"); 284 jQuery(".sort-by").html("<strong>Sort by:</strong> Latest"); 285 } 286 LoadCategoryPost(category_id, search_keyword); 287 //console.log("qwewew") 288 //jQuery(".facet-sort-select-wrapper").removeClass("open"); 289 //jQuery('ul.facetwp-sort-select.custom-sort').removeClass("active"); 290} 291 292//jQuery('.facet-sort-select-wrapper').click(function(e) { 293 jQuery('.facetwp-sort-select li').click(function(e) { 294 jQuery(this).removeClass("open"); 295 }); 296 jQuery('.sort-by').click(function(e) { 297 if(jQuery(this).hasClass("active")){ 298 jQuery(".facetwp-sort-select").removeClass("open"); 299 jQuery(this).removeClass("active"); 300 } 301 else{ 302 jQuery(".facetwp-sort-select").addClass("open"); 303 jQuery(this).addClass("active"); 304 } 305 306 }); 307 jQuery(document).click(function (event) { 308 var $target = jQuery(event.target); 309 310 if ( 311 !$target.closest(".facet-sort-select-wrapper").length && 312 jQuery(".facetwp-sort-select").is(":visible") 313 ) { 314 jQuery(".facet-sort-select-wrapper").removeClass("open"); 315 jQuery('ul.facetwp-sort-select.custom-sort').removeClass("active"); 316 jQuery('.sort-by.active').removeClass("active"); 317 } 318 319 });
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.