1 2 3/****************** 4MMR MERGED: /wp-content/plugins/ele-custom-skin/assets/js/ecs_ajax_pagination.js 5***************/ 6 7jQuery( document ).ready(function() { 8 jQuery( ".ecs-load-more-button" ).each(function() { 9 widget=jQuery(this); 10 settings = widget.attr("data-settings"); 11 args = JSON.parse(settings); 12 widget.children( ".elementor-button" ).attr("href", "javascript:ECS_load_next_page('"+ args.widget_id +"');"); 13 }); 14}); 15var canBeLoaded = true; // this param allows to initiate the AJAX call only if necessary 16 17 18function ECS_load_next_page(id){ 19 20 widget = jQuery(".elementor-element[data-id='" + id + "'] .ecs-posts"); 21 settings = widget.attr("data-settings"); 22 args = JSON.parse(settings); 23 24 posts = jQuery(".elementor-element[data-id='" + args.widget_id + "'] .ecs-posts"); 25 26 if(args.load_method == 'loadmore'){ 27 button_text = jQuery(".elementor-element[data-id='" + args.widget_id + "'] .ecs-load-more-button .elementor-button");// add this .elementor-element[data-id='" + args.widget_id + "'] 28 button = jQuery(".elementor-element[data-id='" + args.widget_id + "'] .ecs-load-more-button"); 29 attb = JSON.parse(button.attr("data-settings")); 30 } 31 if(args.load_method == 'lazyload'){ 32 animation = jQuery(".elementor-element[data-id='" + args.widget_id + "'] .ecs-lazyload"); 33 } 34 data = { 35 'action': 'ecsload', 36 'query': ecs_ajax_params.posts, 37 'ecs_ajax_settings': settings, 38 }; 39 40 jQuery.ajax({ 41 url : ecs_ajax_params.ajaxurl, // AJAX handler 42 data : data, 43 type : 'POST', 44 beforeSend : function ( xhr ) { 45 if(args.load_method == 'loadmore') button_text.html(attb.loading_text); // change the button text, you can also add a preloader image 46 canBeLoaded = false; 47 }, 48 success : function( data ){ 49 if( data ) { 50 posts.append(data); // insert new posts 51 args.current_page++; 52 if(args.load_method == 'loadmore'){ 53 button_text.html( attb.text ); 54 button_text.blur(); 55 } 56 newsettings = JSON.stringify(args); 57 widget.attr("data-settings",newsettings); 58 59 60 if(args.load_method == 'lazyload') {jQuery(animation).addClass("animation-hidden");} 61 //here you need to take care of linkable items and masonry !!!!!!!!!!!!!!!!! 62 ECS_do_action('ajax',args); 63 64 if ( args.current_page == args.max_num_pages ) { 65 if(args.load_method == 'loadmore') button.remove(); // if last page, remove the button 66 if(args.load_method == 'lazyload') animation.remove(); 67 } 68 canBeLoaded = true; 69 70 if (typeof ECScheckInView !== 'undefined') ECScheckInView(); 71 // you can also fire the "post-load" event here if you use a plugin that requires it 72 // $( document.body ).trigger( 'post-load' ); 73 } else { 74 if(args.load_method == 'loadmore') {button.remove();} // if no data, remove the button as well 75 if(args.load_method == 'lazyload') {animation.remove();} 76 } 77 } 78 }); 79 80} 81 82 83jQuery(function($){ 84 $('.ecs-lazyload').addClass("animation-hidden"); 85 $('.ecs-lazyload a').css("display", "none"); 86}); 87 88function EleCustomSkinChangeUrlPage(args){ 89 if(!args.change_url) return; 90 regex = /\/page\/[0-9]+\//gm; 91 currenturl = window.location.pathname; 92 newurl = currenturl.replace(regex, '/'); 93 newurl = newurl + 'page/' + args.current_page +'/'; 94 console.log(newurl); 95 history.pushState({urlPath:newurl},"",newurl); 96} 97 98function EleCustomSkinReInitJs(args){ 99 if(!args.reinit_js) return; 100 jQuery('.elementor-element-' + args.widget_id + ' .elementor-element').each(function() { elementorFrontend.elementsHandler.runReadyTrigger( jQuery( this ) ); });console.log(args.reinit_js); 101} 102 103jQuery( document ).ready(function() { 104 105 ECS_add_action("ajax", function(args){EleCustomSkinChangeUrlPage(args)}); 106 ECS_add_action("ajax", function(args){EleCustomSkinReInitJs(args)}); 107 108});; 109; 110 111/****************** 112MMR MERGED: /wp-content/plugins/ele-custom-skin/assets/js/ecs.js 113***************/ 114 115 116var ECS_hooks = {}; 117 118var ECS_Columns_Count=0; 119 120function ECS_add_action(name, func) { 121 if(!ECS_hooks[name]) ECS_hooks[name] = []; 122 ECS_hooks[name].push(func); 123} 124 125function ECS_do_action(name, ...params){ 126 if(ECS_hooks[name]) 127 ECS_hooks[name].forEach(func => func(...params)); 128}; 129;
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.