Version Description
- NEW - Adding a set of filter hooks to enable users to hook into Ajax Load More to insert or modify data. See https://connekthq.com/plugins/ajax-load-more/docs/filter-hooks/ for more information.
- FIX - Updated infinite scrolling css styling.
Download this release
Release Info
Developer | dcooney |
Plugin | WordPress Infinite Scroll – Ajax Load More |
Version | 2.8.6 |
Comparing to | |
See all releases |
Code changes from version 2.8.5 to 2.8.6
- README.txt +7 -3
- ajax-load-more.php +26 -22
- core/css/ajax-load-more.css +6 -0
- core/js/ajax-load-more.js +3 -1
- core/js/ajax-load-more.min.js +3 -2
README.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
=== Ajax Load More ===
|
2 |
Contributors: dcooney
|
3 |
Donate link: http://connekthq.com/donate/
|
4 |
-
Tags: infinite scroll, scroll, lazy load, lazy loading, pagination, ajax pagination, ajax, ajax posts, ajax load posts, loop, query, shortcode builder, wp_query, search, tags, category, post types,
|
5 |
Requires at least: 3.6
|
6 |
Tested up to: 4.4
|
7 |
-
Stable tag: 2.8.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -313,6 +313,10 @@ How to install Ajax Load More.
|
|
313 |
|
314 |
== Changelog ==
|
315 |
|
|
|
|
|
|
|
|
|
316 |
|
317 |
= 2.8.5 =
|
318 |
* FIX - Update for ALM settings screen - layout was broken with WP 4.4 release.
|
1 |
+
=== Ajax Load More - Infinite Scroll ===
|
2 |
Contributors: dcooney
|
3 |
Donate link: http://connekthq.com/donate/
|
4 |
+
Tags: infinite scroll, scroll, infinite, lazy load, lazy loading, pagination, ajax pagination, ajax, ajax posts, ajax load posts, loop, query, dynamic, shortcode builder, wp_query, search, tags, category, post types, taxonomy, meta_query, archives, date, infinite scrolling, endless scroll, endless, endless scroll
|
5 |
Requires at least: 3.6
|
6 |
Tested up to: 4.4
|
7 |
+
Stable tag: 2.8.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
313 |
|
314 |
== Changelog ==
|
315 |
|
316 |
+
= 2.8.6 =
|
317 |
+
* NEW - Adding a set of filter hooks to enable users to hook into Ajax Load More to insert or modify data. See https://connekthq.com/plugins/ajax-load-more/docs/filter-hooks/ for more information.
|
318 |
+
* FIX - Updated infinite scrolling css styling.
|
319 |
+
|
320 |
|
321 |
= 2.8.5 =
|
322 |
* FIX - Update for ALM settings screen - layout was broken with WP 4.4 release.
|
ajax-load-more.php
CHANGED
@@ -7,14 +7,14 @@ Text Domain: ajax-load-more
|
|
7 |
Author: Darren Cooney
|
8 |
Twitter: @KaptonKaos
|
9 |
Author URI: http://connekthq.com
|
10 |
-
Version: 2.8.
|
11 |
License: GPL
|
12 |
Copyright: Darren Cooney & Connekt Media
|
13 |
*/
|
14 |
|
15 |
|
16 |
-
define('ALM_VERSION', '2.8.
|
17 |
-
define('ALM_RELEASE', '
|
18 |
define('ALM_STORE_URL', 'https://connekthq.com');
|
19 |
|
20 |
if (!defined('ALM_CACHE_ITEM_NAME'))
|
@@ -27,7 +27,7 @@ if (!defined('ALM_UNLIMITED_ITEM_NAME'))
|
|
27 |
define('ALM_UNLIMITED_ITEM_NAME', '3118' );
|
28 |
|
29 |
if (!defined('ALM_PAGING_ITEM_NAME'))
|
30 |
-
define('ALM_PAGING_ITEM_NAME', '6898' );
|
31 |
|
32 |
if (!defined('ALM_PRELOADED_ITEM_NAME'))
|
33 |
define('ALM_PRELOADED_ITEM_NAME', '4293' );
|
@@ -259,7 +259,9 @@ if( !class_exists('AjaxLoadMore') ):
|
|
259 |
|
260 |
function alm_shortcode( $atts, $content = null ) {
|
261 |
|
262 |
-
|
|
|
|
|
263 |
|
264 |
extract(shortcode_atts(array(
|
265 |
'comments' => false,
|
@@ -410,10 +412,9 @@ if( !class_exists('AjaxLoadMore') ):
|
|
410 |
|
411 |
$ajaxloadmore = '';
|
412 |
|
413 |
-
|
414 |
-
$ajaxloadmore .= apply_filters('alm_before_container', '');
|
415 |
|
416 |
-
$ajaxloadmore .= '<div id="ajax-load-more" class="ajax-load-more-wrap '. $btn_color .''. $paging_color .'" data-id="" data-canonical-url="'.get_permalink().'">';
|
417 |
|
418 |
|
419 |
// Previous Post
|
@@ -494,8 +495,8 @@ if( !class_exists('AjaxLoadMore') ):
|
|
494 |
$preloaded_type = preg_split('/(?=\d)/', $repeater, 2); // split $repeater at number to retrieve type
|
495 |
$preloaded_type = $preloaded_type[0]; // (default | repeater | template_)
|
496 |
|
497 |
-
|
498 |
-
$args = apply_filters('
|
499 |
|
500 |
$alm_preload_query = new WP_Query($args);
|
501 |
$alm_total_posts = $alm_preload_query->found_posts - $offset;
|
@@ -597,7 +598,12 @@ if( !class_exists('AjaxLoadMore') ):
|
|
597 |
|
598 |
// SEO Add-on
|
599 |
if(has_action('alm_seo_installed') && $seo === 'true'){
|
600 |
-
$seo_return = apply_filters(
|
|
|
|
|
|
|
|
|
|
|
601 |
$ajaxloadmore .= $seo_return;
|
602 |
}
|
603 |
|
@@ -684,18 +690,14 @@ if( !class_exists('AjaxLoadMore') ):
|
|
684 |
|
685 |
|
686 |
$ajaxloadmore .= '</'.$container_element.'>';
|
687 |
-
|
688 |
-
|
689 |
-
$ajaxloadmore .= apply_filters('alm_before_button', '');
|
690 |
|
691 |
$ajaxloadmore .= '</div>';
|
692 |
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
// End ALM object
|
698 |
-
return $ajaxloadmore;
|
699 |
}
|
700 |
|
701 |
|
@@ -708,7 +710,7 @@ if( !class_exists('AjaxLoadMore') ):
|
|
708 |
*/
|
709 |
|
710 |
function alm_query_posts() {
|
711 |
-
|
712 |
$nonce = $_GET['nonce'];
|
713 |
$options = get_option( 'alm_settings' );
|
714 |
if(!is_user_logged_in()){ // Skip nonce verification if user is logged in
|
@@ -720,6 +722,7 @@ if( !class_exists('AjaxLoadMore') ):
|
|
720 |
}
|
721 |
}
|
722 |
|
|
|
723 |
|
724 |
$queryType = (isset($_GET['query_type'])) ? $_GET['query_type'] : 'standard'; // 'standard' or 'totalposts'; totalposts returns $alm_found_posts
|
725 |
|
@@ -1009,7 +1012,8 @@ if( !class_exists('AjaxLoadMore') ):
|
|
1009 |
$args = apply_filters('alm_prev_post_args', $previous_post_id, $postType);
|
1010 |
}
|
1011 |
|
1012 |
-
|
|
|
1013 |
// WP_Query()
|
1014 |
$alm_query = new WP_Query( $args );
|
1015 |
|
7 |
Author: Darren Cooney
|
8 |
Twitter: @KaptonKaos
|
9 |
Author URI: http://connekthq.com
|
10 |
+
Version: 2.8.6
|
11 |
License: GPL
|
12 |
Copyright: Darren Cooney & Connekt Media
|
13 |
*/
|
14 |
|
15 |
|
16 |
+
define('ALM_VERSION', '2.8.6');
|
17 |
+
define('ALM_RELEASE', 'January 3, 2016');
|
18 |
define('ALM_STORE_URL', 'https://connekthq.com');
|
19 |
|
20 |
if (!defined('ALM_CACHE_ITEM_NAME'))
|
27 |
define('ALM_UNLIMITED_ITEM_NAME', '3118' );
|
28 |
|
29 |
if (!defined('ALM_PAGING_ITEM_NAME'))
|
30 |
+
define('ALM_PAGING_ITEM_NAME', '6898' );
|
31 |
|
32 |
if (!defined('ALM_PRELOADED_ITEM_NAME'))
|
33 |
define('ALM_PRELOADED_ITEM_NAME', '4293' );
|
259 |
|
260 |
function alm_shortcode( $atts, $content = null ) {
|
261 |
|
262 |
+
global $post;
|
263 |
+
$options = get_option( 'alm_settings' ); // Get Ajax Load More Settings
|
264 |
+
$slug = $post->post_name; // Current page slug
|
265 |
|
266 |
extract(shortcode_atts(array(
|
267 |
'comments' => false,
|
412 |
|
413 |
$ajaxloadmore = '';
|
414 |
|
415 |
+
$ajaxloadmore .= apply_filters('alm_before_container', ''); // ALM Core Filter Hook
|
|
|
416 |
|
417 |
+
$ajaxloadmore .= '<div id="ajax-load-more" class="ajax-load-more-wrap '. $btn_color .''. $paging_color .'" data-id="" data-canonical-url="'.get_permalink().'" data-slug="'. $post->post_name .'">';
|
418 |
|
419 |
|
420 |
// Previous Post
|
495 |
$preloaded_type = preg_split('/(?=\d)/', $repeater, 2); // split $repeater at number to retrieve type
|
496 |
$preloaded_type = $preloaded_type[0]; // (default | repeater | template_)
|
497 |
|
498 |
+
$args = apply_filters('alm_preload_args', $preloaded_arr); // Create preloaded $args
|
499 |
+
$args = apply_filters('alm_modify_query_args', $args, $slug); // ALM Core Filter Hook
|
500 |
|
501 |
$alm_preload_query = new WP_Query($args);
|
502 |
$alm_total_posts = $alm_preload_query->found_posts - $offset;
|
598 |
|
599 |
// SEO Add-on
|
600 |
if(has_action('alm_seo_installed') && $seo === 'true'){
|
601 |
+
$seo_return = apply_filters(
|
602 |
+
'alm_seo_shortcode',
|
603 |
+
$seo,
|
604 |
+
$preloaded,
|
605 |
+
$options
|
606 |
+
);
|
607 |
$ajaxloadmore .= $seo_return;
|
608 |
}
|
609 |
|
690 |
|
691 |
|
692 |
$ajaxloadmore .= '</'.$container_element.'>';
|
693 |
+
|
694 |
+
$ajaxloadmore .= apply_filters('alm_before_button', ''); // ALM Core Filter Hook
|
|
|
695 |
|
696 |
$ajaxloadmore .= '</div>';
|
697 |
|
698 |
+
$ajaxloadmore .= apply_filters('alm_after_container', ''); // ALM Core Filter Hook
|
699 |
+
|
700 |
+
return $ajaxloadmore; // End ALM object
|
|
|
|
|
|
|
701 |
}
|
702 |
|
703 |
|
710 |
*/
|
711 |
|
712 |
function alm_query_posts() {
|
713 |
+
|
714 |
$nonce = $_GET['nonce'];
|
715 |
$options = get_option( 'alm_settings' );
|
716 |
if(!is_user_logged_in()){ // Skip nonce verification if user is logged in
|
722 |
}
|
723 |
}
|
724 |
|
725 |
+
$slug = (isset($_GET['slug'])) ? $_GET['slug'] : '';
|
726 |
|
727 |
$queryType = (isset($_GET['query_type'])) ? $_GET['query_type'] : 'standard'; // 'standard' or 'totalposts'; totalposts returns $alm_found_posts
|
728 |
|
1012 |
$args = apply_filters('alm_prev_post_args', $previous_post_id, $postType);
|
1013 |
}
|
1014 |
|
1015 |
+
$args = apply_filters('alm_modify_query_args', $args, $slug); // ALM Core Filter Hook
|
1016 |
+
|
1017 |
// WP_Query()
|
1018 |
$alm_query = new WP_Query( $args );
|
1019 |
|
core/css/ajax-load-more.css
CHANGED
@@ -169,9 +169,15 @@ button.alm-load-more-btn{
|
|
169 |
.ajax-load-more-wrap.infinite button.alm-load-more-btn {
|
170 |
width: 100%;
|
171 |
background-color: transparent !important;
|
|
|
|
|
|
|
|
|
|
|
172 |
overflow: hidden;
|
173 |
text-indent: -9999px;
|
174 |
cursor: default !important;
|
|
|
175 |
}
|
176 |
.ajax-load-more-wrap.infinite button.alm-load-more-btn:before {
|
177 |
display: none !important;
|
169 |
.ajax-load-more-wrap.infinite button.alm-load-more-btn {
|
170 |
width: 100%;
|
171 |
background-color: transparent !important;
|
172 |
+
-webkit-box-shadow: none !important;
|
173 |
+
-moz-box-shadow: none !important;
|
174 |
+
-o-box-shadow: none !important;
|
175 |
+
-ms-box-shadow: none !important;
|
176 |
+
box-shadow: none !important;
|
177 |
overflow: hidden;
|
178 |
text-indent: -9999px;
|
179 |
cursor: default !important;
|
180 |
+
outline: none !important;
|
181 |
}
|
182 |
.ajax-load-more-wrap.infinite button.alm-load-more-btn:before {
|
183 |
display: none !important;
|
core/js/ajax-load-more.js
CHANGED
@@ -40,6 +40,7 @@
|
|
40 |
alm.content = $('.alm-ajax', alm.container);
|
41 |
alm.content_preloaded = $('.alm-listing.alm-preloaded', alm.container);
|
42 |
alm.canonical_url = alm.el.attr('data-canonical-url');
|
|
|
43 |
alm.prefix = 'alm-';
|
44 |
alm.cache = alm.content.attr('data-cache'); // cache (true/false)
|
45 |
alm.cache_id = alm.content.attr('data-cache-id'); // cache value
|
@@ -447,7 +448,8 @@
|
|
447 |
previous_post: alm.previous_post,
|
448 |
previous_post_id: alm.previous_post_id,
|
449 |
previous_post_taxonomy: alm.previous_post_taxonomy,
|
450 |
-
lang: alm.lang
|
|
|
451 |
},
|
452 |
dataType: "html",
|
453 |
// parse the data as html
|
40 |
alm.content = $('.alm-ajax', alm.container);
|
41 |
alm.content_preloaded = $('.alm-listing.alm-preloaded', alm.container);
|
42 |
alm.canonical_url = alm.el.attr('data-canonical-url');
|
43 |
+
alm.slug = alm.el.attr('data-slug');
|
44 |
alm.prefix = 'alm-';
|
45 |
alm.cache = alm.content.attr('data-cache'); // cache (true/false)
|
46 |
alm.cache_id = alm.content.attr('data-cache-id'); // cache value
|
448 |
previous_post: alm.previous_post,
|
449 |
previous_post_id: alm.previous_post_id,
|
450 |
previous_post_taxonomy: alm.previous_post_taxonomy,
|
451 |
+
lang: alm.lang,
|
452 |
+
slug: alm.slug,
|
453 |
},
|
454 |
dataType: "html",
|
455 |
// parse the data as html
|
core/js/ajax-load-more.min.js
CHANGED
@@ -11,8 +11,9 @@
|
|
11 |
* Twitter: @KaptonKaos
|
12 |
*/
|
13 |
|
|
|
14 |
(function($){"use strict";$.ajaxloadmore=function(el,e){if(alm_localize.scrolltop==='true'){$(window).scrollTop(0);}
|
15 |
-
var alm=this;alm.AjaxLoadMore={};alm.page=0;alm.speed=250;alm.proceed=false;alm.disable_ajax=false;alm.init=true;alm.loading=true;alm.finished=false;alm.window=$(window);alm.button_label='';alm.data;alm.el=el;alm.container=el;alm.container.addClass('alm-'+e).attr('data-id',e);alm.content=$('.alm-ajax',alm.container);alm.content_preloaded=$('.alm-listing.alm-preloaded',alm.container);alm.canonical_url=alm.el.attr('data-canonical-url');alm.prefix='alm-';alm.cache=alm.content.attr('data-cache');alm.cache_id=alm.content.attr('data-cache-id');alm.cache_path=alm.content.attr('data-cache-path');alm.cache_logged_in=alm.content.attr('data-cache-logged-in');alm.repeater=alm.content.attr('data-repeater');alm.theme_repeater=alm.content.attr('data-theme-repeater');alm.scroll_distance=parseInt(alm.content.attr('data-scroll-distance'));alm.max_pages=parseInt(alm.content.attr('data-max-pages'));alm.pause_override=alm.content.attr('data-pause-override');alm.pause=alm.content.attr('data-pause');alm.transition=alm.content.attr('data-transition');alm.images_loaded=alm.content.attr('data-images-loaded');alm.destroy_after=alm.content.attr('data-destroy-after');alm.lang=alm.content.attr('data-lang');alm.orginal_posts_per_page=alm.content.attr('data-posts-per-page');alm.posts_per_page=alm.content.attr('data-posts-per-page');alm.previous_post=alm.content.attr('data-previous-post');alm.previous_post_id=alm.content.attr('data-previous-post-id');alm.previous_post_taxonomy=alm.content.attr('data-previous-post-taxonomy');alm.comments=alm.content.attr('data-comments');if(alm.comments==='true'){alm.content=$('.alm-comments',alm.container);}
|
16 |
alm.comments_array='';alm.comments_post_id=alm.content.attr('data-comments_post_id');alm.comments_per_page=alm.content.attr('data-comments_per_page');alm.comments_type=alm.content.attr('data-comments_type');alm.comments_style=alm.content.attr('data-comments_style');alm.comments_template=alm.content.attr('data-comments_template');alm.comments_callback=alm.content.attr('data-comments_callback');alm.seo=alm.content.attr('data-seo');alm.preloaded=alm.content.attr('data-preloaded');alm.preloaded_amount=alm.content.attr('data-preloaded-amount');alm.paging=alm.content.attr('data-paging');alm.paging_controls=alm.content.attr('data-paging-controls');alm.paging_show_at_most=alm.content.attr('data-paging-show-at-most');alm.paging_classes=alm.content.attr('data-paging-classes');if(alm.paging==='true'){alm.paging=true;if(alm.paging_show_at_most===undefined){alm.paging_show_at_most=7;}
|
17 |
if(alm.preloaded==='true'){alm.pause=true;}}else{alm.paging=false;}
|
18 |
if(alm.paging_controls==='true'){alm.paging_controls=true;}else{alm.paging_controls=false;}
|
@@ -47,7 +48,7 @@ alm.post_type=alm.content.attr('data-post-type');alm.post_type=alm.post_type.spl
|
|
47 |
alm.AjaxLoadMore.loadPosts=function(){if(!alm.disable_ajax){if(!alm.paging){alm.button.addClass('loading');if(alm.button_loading_label!==false){alm.button.text(alm.button_loading_label);}}
|
48 |
alm.loading=true;if(alm.cache==='true'&&!alm.cache_logged_in){if(alm.init&&alm.seo&&alm.isPaged){alm.AjaxLoadMore.ajax('standard');}else{var cachePage=alm.cache_path+'/page-'+alm.page+'.html';$.get(cachePage,function(data){alm.AjaxLoadMore.success(data);}).fail(function(){alm.AjaxLoadMore.ajax('standard');});}}else{alm.AjaxLoadMore.ajax('standard');}}};alm.AjaxLoadMore.ajax=function(queryType){if(alm.previous_post){alm.previous_post_id=alm.content.attr('data-previous-post-id');alm.previous_post_taxonomy=alm.content.attr('data-previous-post-taxonomy');}
|
49 |
var action='alm_query_posts';if(alm.comments==='true'){action='alm_comments_query';alm.posts_per_page=alm.comments_per_page;alm.comments_array={'comments':'true','post_id':alm.comments_post_id,'per_page':alm.comments_per_page,'type':alm.comments_type,'style':alm.comments_style,'template':alm.comments_template,'callback':alm.comments_callback,};}
|
50 |
-
$.ajax({type:"GET",url:alm_localize.ajaxurl,data:{action:action,query_type:queryType,nonce:alm_localize.alm_nonce,cache_id:alm.cache_id,repeater:alm.repeater,theme_repeater:alm.theme_repeater,comments:alm.comments_array,post_type:alm.post_type,post_format:alm.content.attr('data-post-format'),category:alm.content.attr('data-category'),category__not_in:alm.content.attr('data-category-not-in'),tag:alm.content.attr('data-tag'),tag__not_in:alm.content.attr('data-tag-not-in'),taxonomy:alm.content.attr('data-taxonomy'),taxonomy_terms:alm.content.attr('data-taxonomy-terms'),taxonomy_operator:alm.content.attr('data-taxonomy-operator'),taxonomy_relation:alm.content.attr('data-taxonomy-relation'),meta_key:alm.content.attr('data-meta-key'),meta_value:alm.content.attr('data-meta-value'),meta_compare:alm.content.attr('data-meta-compare'),meta_relation:alm.content.attr('data-meta-relation'),meta_type:alm.content.attr('data-meta-type'),author:alm.content.attr('data-author'),year:alm.content.attr('data-year'),month:alm.content.attr('data-month'),day:alm.content.attr('data-day'),post_status:alm.content.attr('data-post-status'),order:alm.content.attr('data-order'),orderby:alm.content.attr('data-orderby'),post__in:alm.content.attr('data-post-in'),post__not_in:alm.content.attr('data-post-not-in'),exclude:alm.content.attr('data-exclude'),search:alm.content.attr('data-search'),custom_args:alm.content.attr('data-custom-args'),posts_per_page:alm.posts_per_page,pageNumber:alm.page,offset:alm.offset,preloaded:alm.preloaded,preloaded_amount:alm.preloaded_amount,seo_start_page:alm.start_page,previous_post:alm.previous_post,previous_post_id:alm.previous_post_id,previous_post_taxonomy:alm.previous_post_taxonomy,lang:alm.lang},dataType:"html",beforeSend:function(){if(alm.page!=1&&!alm.paging){alm.button.addClass('loading');}},success:function(data){if(queryType==='standard'){alm.AjaxLoadMore.success(data);}
|
51 |
else if(queryType==='totalposts'&&alm.paging){if($.isFunction($.fn.almBuildPagination)){$.fn.almBuildPagination(data,alm);}}},error:function(jqXHR,textStatus,errorThrown){alm.AjaxLoadMore.error(jqXHR,textStatus,errorThrown);}});};if(alm.paging){alm.AjaxLoadMore.ajax('totalposts');}
|
52 |
alm.AjaxLoadMore.success=function(data){if(alm.previous_post){alm.AjaxLoadMore.getPreviousPost();}
|
53 |
alm.data=$(data);if(alm.init){if(!alm.paging){alm.button.text(alm.button_label);}else{if(alm.data.length>0){alm.el=$('<div class="alm-reveal"/>');alm.el.append('<div class="alm-paging-content"></div><div class="alm-paging-loading"></div>');$('.alm-paging-content',alm.el).append(alm.data).hide();alm.content.append(alm.el);alm.content.parent().removeClass('loading');alm.resetBtnText();$('.alm-paging-content',alm.el).fadeIn(alm.speed,'alm_easeInOutQuad',function(){var paddingT=parseInt(alm.content.css('padding-top')),paddingB=parseInt(alm.content.css('padding-bottom'));alm.content.css('height',alm.el.height()+paddingT+paddingB+'px');if($.isFunction($.fn.almFadePageControls)){$.fn.almFadePageControls(alm.btnWrap);}});}}
|
11 |
* Twitter: @KaptonKaos
|
12 |
*/
|
13 |
|
14 |
+
|
15 |
(function($){"use strict";$.ajaxloadmore=function(el,e){if(alm_localize.scrolltop==='true'){$(window).scrollTop(0);}
|
16 |
+
var alm=this;alm.AjaxLoadMore={};alm.page=0;alm.speed=250;alm.proceed=false;alm.disable_ajax=false;alm.init=true;alm.loading=true;alm.finished=false;alm.window=$(window);alm.button_label='';alm.data;alm.el=el;alm.container=el;alm.container.addClass('alm-'+e).attr('data-id',e);alm.content=$('.alm-ajax',alm.container);alm.content_preloaded=$('.alm-listing.alm-preloaded',alm.container);alm.canonical_url=alm.el.attr('data-canonical-url');alm.slug=alm.el.attr('data-slug');alm.prefix='alm-';alm.cache=alm.content.attr('data-cache');alm.cache_id=alm.content.attr('data-cache-id');alm.cache_path=alm.content.attr('data-cache-path');alm.cache_logged_in=alm.content.attr('data-cache-logged-in');alm.repeater=alm.content.attr('data-repeater');alm.theme_repeater=alm.content.attr('data-theme-repeater');alm.scroll_distance=parseInt(alm.content.attr('data-scroll-distance'));alm.max_pages=parseInt(alm.content.attr('data-max-pages'));alm.pause_override=alm.content.attr('data-pause-override');alm.pause=alm.content.attr('data-pause');alm.transition=alm.content.attr('data-transition');alm.images_loaded=alm.content.attr('data-images-loaded');alm.destroy_after=alm.content.attr('data-destroy-after');alm.lang=alm.content.attr('data-lang');alm.orginal_posts_per_page=alm.content.attr('data-posts-per-page');alm.posts_per_page=alm.content.attr('data-posts-per-page');alm.previous_post=alm.content.attr('data-previous-post');alm.previous_post_id=alm.content.attr('data-previous-post-id');alm.previous_post_taxonomy=alm.content.attr('data-previous-post-taxonomy');alm.comments=alm.content.attr('data-comments');if(alm.comments==='true'){alm.content=$('.alm-comments',alm.container);}
|
17 |
alm.comments_array='';alm.comments_post_id=alm.content.attr('data-comments_post_id');alm.comments_per_page=alm.content.attr('data-comments_per_page');alm.comments_type=alm.content.attr('data-comments_type');alm.comments_style=alm.content.attr('data-comments_style');alm.comments_template=alm.content.attr('data-comments_template');alm.comments_callback=alm.content.attr('data-comments_callback');alm.seo=alm.content.attr('data-seo');alm.preloaded=alm.content.attr('data-preloaded');alm.preloaded_amount=alm.content.attr('data-preloaded-amount');alm.paging=alm.content.attr('data-paging');alm.paging_controls=alm.content.attr('data-paging-controls');alm.paging_show_at_most=alm.content.attr('data-paging-show-at-most');alm.paging_classes=alm.content.attr('data-paging-classes');if(alm.paging==='true'){alm.paging=true;if(alm.paging_show_at_most===undefined){alm.paging_show_at_most=7;}
|
18 |
if(alm.preloaded==='true'){alm.pause=true;}}else{alm.paging=false;}
|
19 |
if(alm.paging_controls==='true'){alm.paging_controls=true;}else{alm.paging_controls=false;}
|
48 |
alm.AjaxLoadMore.loadPosts=function(){if(!alm.disable_ajax){if(!alm.paging){alm.button.addClass('loading');if(alm.button_loading_label!==false){alm.button.text(alm.button_loading_label);}}
|
49 |
alm.loading=true;if(alm.cache==='true'&&!alm.cache_logged_in){if(alm.init&&alm.seo&&alm.isPaged){alm.AjaxLoadMore.ajax('standard');}else{var cachePage=alm.cache_path+'/page-'+alm.page+'.html';$.get(cachePage,function(data){alm.AjaxLoadMore.success(data);}).fail(function(){alm.AjaxLoadMore.ajax('standard');});}}else{alm.AjaxLoadMore.ajax('standard');}}};alm.AjaxLoadMore.ajax=function(queryType){if(alm.previous_post){alm.previous_post_id=alm.content.attr('data-previous-post-id');alm.previous_post_taxonomy=alm.content.attr('data-previous-post-taxonomy');}
|
50 |
var action='alm_query_posts';if(alm.comments==='true'){action='alm_comments_query';alm.posts_per_page=alm.comments_per_page;alm.comments_array={'comments':'true','post_id':alm.comments_post_id,'per_page':alm.comments_per_page,'type':alm.comments_type,'style':alm.comments_style,'template':alm.comments_template,'callback':alm.comments_callback,};}
|
51 |
+
$.ajax({type:"GET",url:alm_localize.ajaxurl,data:{action:action,query_type:queryType,nonce:alm_localize.alm_nonce,cache_id:alm.cache_id,repeater:alm.repeater,theme_repeater:alm.theme_repeater,comments:alm.comments_array,post_type:alm.post_type,post_format:alm.content.attr('data-post-format'),category:alm.content.attr('data-category'),category__not_in:alm.content.attr('data-category-not-in'),tag:alm.content.attr('data-tag'),tag__not_in:alm.content.attr('data-tag-not-in'),taxonomy:alm.content.attr('data-taxonomy'),taxonomy_terms:alm.content.attr('data-taxonomy-terms'),taxonomy_operator:alm.content.attr('data-taxonomy-operator'),taxonomy_relation:alm.content.attr('data-taxonomy-relation'),meta_key:alm.content.attr('data-meta-key'),meta_value:alm.content.attr('data-meta-value'),meta_compare:alm.content.attr('data-meta-compare'),meta_relation:alm.content.attr('data-meta-relation'),meta_type:alm.content.attr('data-meta-type'),author:alm.content.attr('data-author'),year:alm.content.attr('data-year'),month:alm.content.attr('data-month'),day:alm.content.attr('data-day'),post_status:alm.content.attr('data-post-status'),order:alm.content.attr('data-order'),orderby:alm.content.attr('data-orderby'),post__in:alm.content.attr('data-post-in'),post__not_in:alm.content.attr('data-post-not-in'),exclude:alm.content.attr('data-exclude'),search:alm.content.attr('data-search'),custom_args:alm.content.attr('data-custom-args'),posts_per_page:alm.posts_per_page,pageNumber:alm.page,offset:alm.offset,preloaded:alm.preloaded,preloaded_amount:alm.preloaded_amount,seo_start_page:alm.start_page,previous_post:alm.previous_post,previous_post_id:alm.previous_post_id,previous_post_taxonomy:alm.previous_post_taxonomy,lang:alm.lang,slug:alm.slug,},dataType:"html",beforeSend:function(){if(alm.page!=1&&!alm.paging){alm.button.addClass('loading');}},success:function(data){if(queryType==='standard'){alm.AjaxLoadMore.success(data);}
|
52 |
else if(queryType==='totalposts'&&alm.paging){if($.isFunction($.fn.almBuildPagination)){$.fn.almBuildPagination(data,alm);}}},error:function(jqXHR,textStatus,errorThrown){alm.AjaxLoadMore.error(jqXHR,textStatus,errorThrown);}});};if(alm.paging){alm.AjaxLoadMore.ajax('totalposts');}
|
53 |
alm.AjaxLoadMore.success=function(data){if(alm.previous_post){alm.AjaxLoadMore.getPreviousPost();}
|
54 |
alm.data=$(data);if(alm.init){if(!alm.paging){alm.button.text(alm.button_label);}else{if(alm.data.length>0){alm.el=$('<div class="alm-reveal"/>');alm.el.append('<div class="alm-paging-content"></div><div class="alm-paging-loading"></div>');$('.alm-paging-content',alm.el).append(alm.data).hide();alm.content.append(alm.el);alm.content.parent().removeClass('loading');alm.resetBtnText();$('.alm-paging-content',alm.el).fadeIn(alm.speed,'alm_easeInOutQuad',function(){var paddingT=parseInt(alm.content.css('padding-top')),paddingB=parseInt(alm.content.css('padding-bottom'));alm.content.css('height',alm.el.height()+paddingT+paddingB+'px');if($.isFunction($.fn.almFadePageControls)){$.fn.almFadePageControls(alm.btnWrap);}});}}
|