| Server IP : 38.190.208.107 / Your IP : 216.73.216.187 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/test20.chuangfenglink.xyz/wp-content/themes/woodmart/js/scripts/blog/ |
Upload File : |
/* global woodmart_settings */
(function($) {
$.each([
'frontend/element_ready/wd_blog.default',
], function(index, value) {
woodmartThemeModule.wdElementorAddAction(value, function() {
woodmartThemeModule.blogLoadMore();
});
});
woodmartThemeModule.blogLoadMore = function() {
var btnClass = '.wd-blog-load-more.load-on-scroll',
process = false;
woodmartThemeModule.clickOnScrollButton(btnClass, false, false);
$('.wd-blog-load-more').on('click', function(e) {
e.preventDefault();
var $this = $(this);
if (process || $this.hasClass('no-more-posts')) {
return;
}
process = true;
var holder = $this.parent().siblings('.wd-blog-holder'),
source = holder.data('source'),
action = 'woodmart_get_blog_' + source,
ajaxurl = woodmart_settings.ajaxurl,
dataType = 'json',
method = 'POST',
atts = holder.data('atts'),
paged = holder.data('paged');
$this.addClass('loading');
var data = {
atts : atts,
paged : paged,
action: action
};
if (source === 'main_loop') {
ajaxurl = $this.attr('href');
method = 'GET';
data = atts ? { atts: atts } : {};
}
data.woo_ajax = 1;
$.ajax({
url : ajaxurl,
data : data,
dataType: dataType,
method : method,
success : function(data) {
woodmartThemeModule.removeDuplicatedStylesFromHTML(data.items, function(html) {
var items = $(html);
if (items) {
if (holder.hasClass('wd-masonry')) {
holder.append(items).isotope('appended', items);
holder.imagesLoaded().progress(function() {
holder.isotope('layout');
woodmartThemeModule.clickOnScrollButton(btnClass, true, false);
});
} else {
holder.append(items);
holder.imagesLoaded().progress(function() {
woodmartThemeModule.clickOnScrollButton(btnClass, true, false);
});
}
if ('yes' === woodmart_settings.load_more_button_page_url_opt && 'no' !== woodmart_settings.load_more_button_page_url && data.currentPage){
window.history.pushState('', '', data.currentPage);
}
holder.data('paged', paged + 1);
if (source === 'main_loop') {
$this.attr('href', data.nextPage);
if (data.status === 'no-more-posts') {
$this.parent().hide().remove();
}
}
}
if (data.status === 'no-more-posts') {
$this.addClass('no-more-posts');
$this.parent().hide();
}
});
},
error : function() {
console.log('ajax error');
},
complete: function() {
$this.removeClass('loading');
process = false;
}
});
});
};
$(document).ready(function() {
woodmartThemeModule.blogLoadMore();
});
})(jQuery);