WordPress Infinite Scroll – Ajax Load More - Version 2.10.0.1

Version Description

  • FIX - JavaScript fix for 'Unexpected token' error is Safari and IE with alm.AjaxLoadMore.success() function.
  • FIX - Fixed canonical URL issue on home/front pages.
Download this release

Release Info

Developer dcooney
Plugin Icon 128x128 WordPress Infinite Scroll – Ajax Load More
Version 2.10.0.1
Comparing to
See all releases

Code changes from version 2.9.0 to 2.10.0.1

README.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Ajax Load More - Infinite Scroll ===
2
  Contributors: dcooney
3
  Donate link: https://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
5
  Requires at least: 3.6
6
  Tested up to: 4.5
7
- Stable tag: 3.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -14,27 +14,30 @@ A powerful solution to add infinite scroll functionality to your website
14
 
15
  Ajax Load More is the ultimate solution for infinite scrolling and lazy loading posts, custom post types, single posts, pages and comments with Ajax powered queries.
16
 
17
- Build complex WordPress queries using the Ajax Load More custom shortcode builder then add the shortcode to your pages via the content editor or directly into your template files.
18
 
19
- **[Get More Information](http://connekthq.com/plugins/ajax-load-more/)**
20
 
 
21
 
22
  = Features =
23
- * **Shortcode Builder** - Easily create your own Ajax Load More shortcode by adjusting the various WordPress query parameters in our easy-to-use shortcode builder.(see Shortcode Parameters).
24
  * **Query Parameters** - Ajax Load More allows you to query WordPress by many different content types. Query by Post Type, Post Format, Date, Category, Tags, Custom Taxonomies, Search Term, Authors and more!!
25
  * **Customizable Repeater Templates** - Edit and extend the functionality of Ajax Load More by creating your own repeater template to match the look and feel of your website (see screenshots).
26
  * **Setting Panel** - Customize your version of Ajax Load More by updating various plugin settings (see screenshots).
27
  * **Multiple Instances** - You can include multiple instances of Ajax Load More on a single page, post or template.
28
  * **Multisite Compatibility** - As of Ajax Load More 2.7.2 you can now manage repeater templates across all sites in your network.
29
 
30
- Check out the **[demo site](http://connekthq.com/plugins/ajax-load-more/)** for more information!
31
 
32
  ***
33
 
34
  = Content Types =
35
- Ajax Load More will allow for infinite scrolling of pretty much any content type WordPress offers.
36
 
37
- * [Posts](https://connekthq.com/plugins/ajax-load-more/examples/default/)
 
 
38
  * [Custom Post Types](https://connekthq.com/plugins/ajax-load-more/examples/masonry/)
39
  * [Pages](https://connekthq.com/plugins/ajax-load-more/examples/search-results/)
40
  * [Single Posts](https://connekthq.com/ajax-load-more-posts/alm-post-example/) **
@@ -45,10 +48,10 @@ Ajax Load More will allow for infinite scrolling of pretty much any content type
45
 
46
  = Shortcode Parameters =
47
 
48
- Ajax Load More accepts a number of parameters that are passed to the WordPress query. These parameters are transferred via shortcode - don't worry, creating your shortcode is simple with our intuitive Shortcode Builder.
49
 
50
- * **repeater** - Choose a repeater template (<a href="http://connekthq.com/plugins/ajax-load-more/custom-repeaters/">Add-on available</a>). Default = ‘default’
51
- * **theme_repeater** - Select from a list of template files in your current theme directory (<a href="http://connekthq.com/plugins/ajax-load-more/add-ons/theme-repeaters/">Add-on only</a>). Default = null
52
  * **post_type** - Comma separated list of post types. Default = ‘post’
53
  * **post_format** - Query by post format. Default = null
54
  * **category** - A comma separated list of categories to include by slug. Default = null
@@ -84,19 +87,20 @@ Ajax Load More accepts a number of parameters that are passed to the WordPress q
84
  * **pause_override** - Allow scrolling to override the Pause parameter and trigger the loading of posts on scroll. Default = null
85
  * **pause** - Do not load posts until user clicks the Load More button (true/false). Default = 'false'
86
  * **transition** - Choose a posts reveal transition (slide/fade/none). Default = 'slide'
87
- * **transition_container - Display the Ajax Load More (.alm-reveal) loading container. Default = 'true'
 
88
  * **images_loaded** - Wait for all images to load before displaying ajax loaded content (true/false). Default = 'false'
89
  * **destroy_after** - Remove ajax load more functionality after 'n' number of pages have been loaded. Default = null
90
  * **button_label** - The label text for Load More button. Default = 'Older Posts'
91
  * **button_loading_label** - Update the text of the Load More button while content is loading. Default = null
92
  * **container_type** - Override the global Container Type that was set on ALM Settings page. Default = null
93
  * **css_classes** - Add custom CSS classes to the Ajax Load More container. Default = null
94
- * **cache** - Turn on content caching for the specific Ajax Load More query. <a href="http://connekthq.com/plugins/ajax-load-more/cache/">add-on only</a> - (true/false). Default = ‘false’
95
- * **cache_id** - A unique 10 digit ID for the cached query. <a href="http://connekthq.com/plugins/ajax-load-more/cache/">add-on only</a> - Default = A random 10 digit integer
96
- * **seo** - Enable address bar URL rewrites as users page through content - <a href="http://connekthq.com/plugins/ajax-load-more/search-engine-optimization/">add-on only</a> (true/false). Default = ‘false’
97
- * **preloaded** - Should Ajax Load More preload posts? <a href="http://connekthq.com/plugins/ajax-load-more/preloaded/">add-on only</a> - (true/false). Default = ‘false’
98
- * **preloaded_amount** - The amount of posts to preload. <a href="http://connekthq.com/plugins/ajax-load-more/preloaded/">add-on only</a> - Default = ‘5’
99
- * **paging** - Replace infinite scrolling with a paged navigation system. <a href="http://connekthq.com/plugins/ajax-load-more/paging/">add-on only</a> (true/false). Default = ‘false’
100
  * **paging_controls** - Show previous(«) and next(») buttons (true/false). Default = ‘false’
101
  * **paging_classes** - Add classes to the paging navigation menu for CSS styling.
102
  * **paging_show_at_most** - Maximum amount of pages to show at a time. 0 = no maximum. Default = ‘0’
@@ -111,23 +115,25 @@ Ajax Load More accepts a number of parameters that are passed to the WordPress q
111
  ***
112
 
113
  = Demos =
114
- * **[Default](http://connekthq.com/plugins/ajax-load-more/)** - Out of the box functionality and styling
115
- * **[Destroy After](http://connekthq.com/plugins/ajax-load-more/examples/destroy-after/)** - Remove Ajax Load More functionality after 'n' number of pages
116
- * **[Fade Transition](http://connekthq.com/plugins/ajax-load-more/examples/fade-transition/)** - Elements fade in as posts are loaded
117
- * **[Filtering](http://connekthq.com/plugins/ajax-load-more/examples/filtering/)** - Reset and filter an Ajax Load More instance
118
- * **[Infinite Scroll](http://connekthq.com/plugins/ajax-load-more/examples/infinite-scroll/)** - A look at the new loading functionality and style
119
- * **[Images Loaded](http://connekthq.com/plugins/ajax-load-more/examples/images-loaded/)** - Download images before displaying ajax loaded content
120
- * **[Masonry](http://connekthq.com/plugins/ajax-load-more/examples/masonry/)** - Creating a flexible grid layout with Masonry JS
121
- * **[Multiple Instances](http://connekthq.com/plugins/ajax-load-more/examples/multiple-instances/)** - Include multiple Ajax Load More' on a single page
122
- * **[Paging URLs](http://connekthq.com/plugins/ajax-load-more/examples/paging-urls/)** - Generate unique paging URLs for every Ajax Load More query with the SEO add-on
123
- * **[Pause Loading](http://connekthq.com/plugins/ajax-load-more/examples/pause-loading/)** - Posts will not load until initiated by the user
124
- * **[Preloaded Posts](http://connekthq.com/plugins/ajax-load-more/examples/pause-loading/)** - Easily preload an initial set of posts before completing any Ajax requests to the server
125
- * **[Search Results](http://connekthq.com/plugins/ajax-load-more/examples/search-results/)** - Returning results based on search terms
126
  * **[SEO & Paging](https://connekthq.com/plugins/ajax-load-more/examples/seo-paging-add-ons/)** - Combine these two add-ons to create one powerful navigation system
127
  * **[Slideshow Gallery](https://connekthq.com/plugins/ajax-load-more/examples/slideshow-gallery/)** - Create a gallery of posts with Ajax Load More and the Paging add-on.
128
  * **[Table Layout](https://connekthq.com/plugins/ajax-load-more/examples/table/)** - Ajax Load More will display query results in a table format.
129
 
130
- *The [Custom Repeater Add-On](http://connekthq.com/plugins/ajax-load-more/custom-repeaters/) has been installed for use on each of our product demos*
 
 
131
 
132
  [youtube https://www.youtube.com/watch?v=EQ57i6dkOew]
133
 
@@ -137,40 +143,40 @@ Ajax Load More accepts a number of parameters that are passed to the WordPress q
137
  The following Add-ons are available to increase the functionality of Ajax Load More.
138
 
139
  > #### Cache
140
- > The **[Cache](http://connekthq.com/plugins/ajax-load-more/cache/)** add-oncreates static HTML files of Ajax Load More requests then serves those static pages to your visitors without querying the database.<br />
141
- > [Get More Information](http://connekthq.com/plugins/ajax-load-more/cache/)
142
  >
143
  > #### Comments
144
- > The **[Comments](http://connekthq.com/plugins/ajax-load-more/add-ons/comments/)** add-on will load and display blog comments using the core Ajax Load More infinite scroll functionality.<br />
145
- > [Get More Information](http://connekthq.com/plugins/ajax-load-more/add-ons/comments/)
146
  >
147
  > #### Custom Repeaters
148
- > The **[Custom Repeaters](http://connekthq.com/plugins/ajax-load-more/custom-repeaters/)** add-on will allow for **unlimited repeater templates** and provide the ability to create unique templates for different content types throughout your theme.<br />
149
- > [Get More Information](http://connekthq.com/plugins/ajax-load-more/custom-repeaters/)
150
  >
151
  > #### Layouts
152
- > The **[Layouts](http://connekthq.com/plugins/ajax-load-more/layouts/)** add-on will provide a library of fully responsive layout templates ready for use on your website.<br />
153
- > [Get More Information](http://connekthq.com/plugins/ajax-load-more/layouts/)
154
  >
155
  > #### Paging
156
- > The **[Paging](http://connekthq.com/plugins/ajax-load-more/paging/)** add-on will transform Ajax Load More’s lazy load/infinite scroll functionality into a robust ajax powered navigation system.<br />
157
- > [Get More Information](http://connekthq.com/plugins/ajax-load-more/paging/)
158
  >
159
  > #### Preloaded
160
- > The **[Preloaded](http://connekthq.com/plugins/ajax-load-more/preloaded/)** add-on will allow you to quickly and easily preload an initial set of posts before completing any Ajax requests to the server.<br />
161
- > [Get More Information](http://connekthq.com/plugins/ajax-load-more/preloaded/)
162
  >
163
  > #### Previous Post
164
- > The **[Previous Post](http://connekthq.com/plugins/ajax-load-more/previous-post/)** add-on will allow you to navigate single posts with Ajax Load More.<br />
165
- > [Get More Information](http://connekthq.com/plugins/ajax-load-more/previous-post/)
166
  >
167
  > #### Search Engine Optimization
168
- > The **[SEO](http://connekthq.com/plugins/ajax-load-more/seo/)** add-on will optimize your ajax loaded content for search engines and site visitors by generating standard WordPress paging URLs with each Ajax Load More query.<br />
169
- > [Get More Information](http://connekthq.com/plugins/ajax-load-more/seo/)
170
  >
171
  > #### Theme Repeaters
172
- > The **[Theme Repeaters](http://connekthq.com/plugins/ajax-load-more/add-ons/theme-repeaters/)** add-on will allow you load, edit and maintain templates from your current theme directory.<br />
173
- > [Get More Information](http://connekthq.com/plugins/ajax-load-more/add-ons/theme-repeaters/)
174
 
175
  ***
176
 
@@ -235,13 +241,13 @@ Ajax Load More passes the following PHP [variables](https://connekthq.com/plugin
235
  ***
236
 
237
  = Website =
238
- http://connekthq.com/ajax-load-more/
239
 
240
  ***
241
 
242
  = Please Rate Ajax Load More! =
243
 
244
- Your ratings make a big difference! If you like and use Ajax Load More, please consider taking the time to [rate my plugin](http://wordpress.org/support/view/plugin-reviews/ajax-load-more). Your ratings and reviews will help this plugin grow and provide the motivation needed to keep pushing it forward.
245
 
246
 
247
 
@@ -320,6 +326,20 @@ How to install Ajax Load More.
320
 
321
  == Changelog ==
322
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
323
  = 2.9 =
324
  * NEW - Adding support for new Layouts add-on.
325
  * NEW - Adding support for table container type.
@@ -500,7 +520,7 @@ How to install Ajax Load More.
500
 
501
 
502
  = 2.3.0 =
503
- * Adding required functionality for ALM SEO add-on (http://connekthq.com/plugins/ajax-load-more/seo/)
504
  * Adding variables for counting items within the ALM query - $alm_page & $alm_item are now accessible within repeater templates.
505
  * Remove plugin activation notification due to error fetching column names.
506
  * Fixed issue with orderby = "rand", ALM now excludes all previously queried post ids.
@@ -510,7 +530,7 @@ How to install Ajax Load More.
510
 
511
 
512
  = 2.2.8 =
513
- * Adding required functionality for the NEW Ajax Load More Custom Repeaters v2 add-on - http://connekthq.com/plugins/ajax-load-more/custom-repeaters/
514
  * Improved debug messaging for Ajax Load More and Add-Ons.
515
  * Adding fix for ordering by meta value.
516
  * Admin stying updates.
@@ -557,7 +577,7 @@ How to install Ajax Load More.
557
 
558
  = 2.2.0 =
559
  * Adding Post Format query.
560
- * Adding syntax highlighting for Repeater Templates with CodeMirror (http://codemirror.net/).
561
  * Adding custom alias integration for Repeater Templates (Only for the custom repeater add-on).
562
  * Adding button preview on settings page.
563
  * Adding 'White' button style.
1
  === Ajax Load More - Infinite Scroll ===
2
  Contributors: dcooney
3
  Donate link: https://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, woocommerce
5
  Requires at least: 3.6
6
  Tested up to: 4.5
7
+ Stable tag: 2.10.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
14
 
15
  Ajax Load More is the ultimate solution for infinite scrolling and lazy loading posts, custom post types, single posts, pages and comments with Ajax powered queries.
16
 
17
+ Build complex custom WordPress queries using the Ajax Load More shortcode builder then add the generated shortcode to your page via the content editor or directly into your template files.
18
 
19
+ Ajax Load More is fully compatible with popular ecommerce plugins such as WooCommerce, Easy Digital Downloads and JigoShop.
20
 
21
+ **[Get More Information](https://connekthq.com/plugins/ajax-load-more/)**
22
 
23
  = Features =
24
+ * **Shortcode Builder** - Easily create your own Ajax Load More shortcode by adjusting the various WordPress query parameters in our easy-to-use shortcode builder (see Shortcode Parameters).
25
  * **Query Parameters** - Ajax Load More allows you to query WordPress by many different content types. Query by Post Type, Post Format, Date, Category, Tags, Custom Taxonomies, Search Term, Authors and more!!
26
  * **Customizable Repeater Templates** - Edit and extend the functionality of Ajax Load More by creating your own repeater template to match the look and feel of your website (see screenshots).
27
  * **Setting Panel** - Customize your version of Ajax Load More by updating various plugin settings (see screenshots).
28
  * **Multiple Instances** - You can include multiple instances of Ajax Load More on a single page, post or template.
29
  * **Multisite Compatibility** - As of Ajax Load More 2.7.2 you can now manage repeater templates across all sites in your network.
30
 
31
+ Check out the **[demo site](https://connekthq.com/plugins/ajax-load-more/)** for more information!
32
 
33
  ***
34
 
35
  = Content Types =
36
+ Ajax Load More can infinite scroll any content type WordPress offers - from blog posts to WooCommerce products Ajax Load More can handle it.
37
 
38
+ Check out the examples below:
39
+
40
+ * [Standard Posts](https://connekthq.com/plugins/ajax-load-more/examples/default/)
41
  * [Custom Post Types](https://connekthq.com/plugins/ajax-load-more/examples/masonry/)
42
  * [Pages](https://connekthq.com/plugins/ajax-load-more/examples/search-results/)
43
  * [Single Posts](https://connekthq.com/ajax-load-more-posts/alm-post-example/) **
48
 
49
  = Shortcode Parameters =
50
 
51
+ Ajax Load More accepts a number of parameters that are passed to the WordPress query. These parameters are transferred via shortcode - don't worry, creating your custom shortcode is simple with the intuitive [Shortcode Builder](https://connekthq.com/plugins/ajax-load-more/screenshots/#shortcode-builder)
52
 
53
+ * **repeater** - Choose a repeater template (<a href="https://connekthq.com/plugins/ajax-load-more/custom-repeaters/">Add-on available</a>). Default = ‘default’
54
+ * **theme_repeater** - Select from a list of template files in your current theme directory (<a href="https://connekthq.com/plugins/ajax-load-more/add-ons/theme-repeaters/">Add-on only</a>). Default = null
55
  * **post_type** - Comma separated list of post types. Default = ‘post’
56
  * **post_format** - Query by post format. Default = null
57
  * **category** - A comma separated list of categories to include by slug. Default = null
87
  * **pause_override** - Allow scrolling to override the Pause parameter and trigger the loading of posts on scroll. Default = null
88
  * **pause** - Do not load posts until user clicks the Load More button (true/false). Default = 'false'
89
  * **transition** - Choose a posts reveal transition (slide/fade/none). Default = 'slide'
90
+ * **transition_speed** - The speed of the loading transition in milliseconds. (slide/fade/none). Default = '250'
91
+ * **transition_container** - Display the Ajax Load More (.alm-reveal) loading container. Default = 'true'
92
  * **images_loaded** - Wait for all images to load before displaying ajax loaded content (true/false). Default = 'false'
93
  * **destroy_after** - Remove ajax load more functionality after 'n' number of pages have been loaded. Default = null
94
  * **button_label** - The label text for Load More button. Default = 'Older Posts'
95
  * **button_loading_label** - Update the text of the Load More button while content is loading. Default = null
96
  * **container_type** - Override the global Container Type that was set on ALM Settings page. Default = null
97
  * **css_classes** - Add custom CSS classes to the Ajax Load More container. Default = null
98
+ * **cache** - Turn on content caching for the specific Ajax Load More query. <a href="https://connekthq.com/plugins/ajax-load-more/cache/">add-on only</a> - (true/false). Default = ‘false’
99
+ * **cache_id** - A unique 10 digit ID for the cached query. <a href="https://connekthq.com/plugins/ajax-load-more/cache/">add-on only</a> - Default = A random 10 digit integer
100
+ * **seo** - Enable address bar URL rewrites as users page through content - <a href="https://connekthq.com/plugins/ajax-load-more/search-engine-optimization/">add-on only</a> (true/false). Default = ‘false’
101
+ * **preloaded** - Should Ajax Load More preload posts? <a href="https://connekthq.com/plugins/ajax-load-more/preloaded/">add-on only</a> - (true/false). Default = ‘false’
102
+ * **preloaded_amount** - The amount of posts to preload. <a href="https://connekthq.com/plugins/ajax-load-more/preloaded/">add-on only</a> - Default = ‘5’
103
+ * **paging** - Replace infinite scrolling with a paged navigation system. <a href="https://connekthq.com/plugins/ajax-load-more/paging/">add-on only</a> (true/false). Default = ‘false’
104
  * **paging_controls** - Show previous(«) and next(») buttons (true/false). Default = ‘false’
105
  * **paging_classes** - Add classes to the paging navigation menu for CSS styling.
106
  * **paging_show_at_most** - Maximum amount of pages to show at a time. 0 = no maximum. Default = ‘0’
115
  ***
116
 
117
  = Demos =
118
+ * **[Default](https://connekthq.com/plugins/ajax-load-more/)** - Out of the box functionality and styling
119
+ * **[Destroy After](https://connekthq.com/plugins/ajax-load-more/examples/destroy-after/)** - Remove Ajax Load More functionality after 'n' number of pages
120
+ * **[Fade Transition](https://connekthq.com/plugins/ajax-load-more/examples/fade-transition/)** - Elements fade in as posts are loaded
121
+ * **[Filtering](https://connekthq.com/plugins/ajax-load-more/examples/filtering/)** - Reset and filter an Ajax Load More instance
122
+ * **[Infinite Scroll](https://connekthq.com/plugins/ajax-load-more/examples/infinite-scroll/)** - A look at the new loading functionality and style
123
+ * **[Images Loaded](https://connekthq.com/plugins/ajax-load-more/examples/images-loaded/)** - Download images before displaying ajax loaded content
124
+ * **[Masonry](https://connekthq.com/plugins/ajax-load-more/examples/masonry/)** - Creating a flexible grid layout with Masonry JS
125
+ * **[Multiple Instances](https://connekthq.com/plugins/ajax-load-more/examples/multiple-instances/)** - Include multiple Ajax Load More' on a single page
126
+ * **[Paging URLs](https://connekthq.com/plugins/ajax-load-more/examples/paging-urls/)** - Generate unique paging URLs for every Ajax Load More query with the SEO add-on
127
+ * **[Pause Loading](https://connekthq.com/plugins/ajax-load-more/examples/pause-loading/)** - Posts will not load until initiated by the user
128
+ * **[Preloaded Posts](https://connekthq.com/plugins/ajax-load-more/examples/pause-loading/)** - Easily preload an initial set of posts before completing any Ajax requests to the server
129
+ * **[Search Results](https://connekthq.com/plugins/ajax-load-more/examples/search-results/)** - Returning results based on search terms
130
  * **[SEO & Paging](https://connekthq.com/plugins/ajax-load-more/examples/seo-paging-add-ons/)** - Combine these two add-ons to create one powerful navigation system
131
  * **[Slideshow Gallery](https://connekthq.com/plugins/ajax-load-more/examples/slideshow-gallery/)** - Create a gallery of posts with Ajax Load More and the Paging add-on.
132
  * **[Table Layout](https://connekthq.com/plugins/ajax-load-more/examples/table/)** - Ajax Load More will display query results in a table format.
133
 
134
+ [View All Examples](https://connekthq.com/plugins/ajax-load-more/examples/)
135
+
136
+ *The [Custom Repeater Add-On](https://connekthq.com/plugins/ajax-load-more/custom-repeaters/) has been installed for use on each of our product demos*
137
 
138
  [youtube https://www.youtube.com/watch?v=EQ57i6dkOew]
139
 
143
  The following Add-ons are available to increase the functionality of Ajax Load More.
144
 
145
  > #### Cache
146
+ > The **[Cache](https://connekthq.com/plugins/ajax-load-more/cache/)** add-oncreates static HTML files of Ajax Load More requests then serves those static pages to your visitors without querying the database.<br />
147
+ > [Get More Information](https://connekthq.com/plugins/ajax-load-more/cache/)
148
  >
149
  > #### Comments
150
+ > The **[Comments](https://connekthq.com/plugins/ajax-load-more/add-ons/comments/)** add-on will load and display blog comments using the core Ajax Load More infinite scroll functionality.<br />
151
+ > [Get More Information](https://connekthq.com/plugins/ajax-load-more/add-ons/comments/)
152
  >
153
  > #### Custom Repeaters
154
+ > The **[Custom Repeaters](https://connekthq.com/plugins/ajax-load-more/custom-repeaters/)** add-on will allow for **unlimited repeater templates** and provide the ability to create unique templates for different content types throughout your theme.<br />
155
+ > [Get More Information](https://connekthq.com/plugins/ajax-load-more/custom-repeaters/)
156
  >
157
  > #### Layouts
158
+ > The **[Layouts](https://connekthq.com/plugins/ajax-load-more/layouts/)** add-on will provide a library of fully responsive layout templates ready for use on your website.<br />
159
+ > [Get More Information](https://connekthq.com/plugins/ajax-load-more/layouts/)
160
  >
161
  > #### Paging
162
+ > The **[Paging](https://connekthq.com/plugins/ajax-load-more/paging/)** add-on will transform Ajax Load More’s lazy load/infinite scroll functionality into a robust ajax powered navigation system.<br />
163
+ > [Get More Information](https://connekthq.com/plugins/ajax-load-more/paging/)
164
  >
165
  > #### Preloaded
166
+ > The **[Preloaded](https://connekthq.com/plugins/ajax-load-more/preloaded/)** add-on will allow you to quickly and easily preload an initial set of posts before completing any Ajax requests to the server.<br />
167
+ > [Get More Information](https://connekthq.com/plugins/ajax-load-more/preloaded/)
168
  >
169
  > #### Previous Post
170
+ > The **[Previous Post](https://connekthq.com/plugins/ajax-load-more/previous-post/)** add-on will allow you to navigate single posts with Ajax Load More.<br />
171
+ > [Get More Information](https://connekthq.com/plugins/ajax-load-more/previous-post/)
172
  >
173
  > #### Search Engine Optimization
174
+ > The **[SEO](https://connekthq.com/plugins/ajax-load-more/seo/)** add-on will optimize your ajax loaded content for search engines and site visitors by generating standard WordPress paging URLs with each Ajax Load More query.<br />
175
+ > [Get More Information](https://connekthq.com/plugins/ajax-load-more/seo/)
176
  >
177
  > #### Theme Repeaters
178
+ > The **[Theme Repeaters](https://connekthq.com/plugins/ajax-load-more/add-ons/theme-repeaters/)** add-on will allow you load, edit and maintain templates from your current theme directory.<br />
179
+ > [Get More Information](https://connekthq.com/plugins/ajax-load-more/add-ons/theme-repeaters/)
180
 
181
  ***
182
 
241
  ***
242
 
243
  = Website =
244
+ https://connekthq.com/ajax-load-more/
245
 
246
  ***
247
 
248
  = Please Rate Ajax Load More! =
249
 
250
+ Your ratings make a big difference! If you like and use Ajax Load More, please consider taking the time to [rate my plugin](https://wordpress.org/support/view/plugin-reviews/ajax-load-more). Your ratings and reviews will help this plugin grow and provide the motivation needed to keep pushing it forward.
251
 
252
 
253
 
326
 
327
  == Changelog ==
328
 
329
+ = 2.10.0.1 =
330
+ * FIX - JavaScript fix for 'Unexpected token' error is Safari and IE with alm.AjaxLoadMore.success() function.
331
+ * FIX - Fixed canonical URL issue on home/front pages.
332
+
333
+ = 2.10.0 =
334
+ * NEW - Converted the Ajax return content type from HTML to JSON.
335
+ * NEW - Adding transition_speed shortcode parameter.
336
+ * NEW - Added alm_button_label filter to modify default button text.
337
+ * NEW - Added new canonical URL builder for pages and archives - this function helps build legitimate URLs for the Search Engine Optimization add-on.
338
+ * FIX - Fixed issue with undefined post slug on archive pages.
339
+ * UPDATE - Performance improvements and code reduction.
340
+ * UPGRADE NOTICE - When updating to 2.10 you must also update SEO and Comments add-ons.
341
+
342
+
343
  = 2.9 =
344
  * NEW - Adding support for new Layouts add-on.
345
  * NEW - Adding support for table container type.
520
 
521
 
522
  = 2.3.0 =
523
+ * Adding required functionality for ALM SEO add-on (https://connekthq.com/plugins/ajax-load-more/seo/)
524
  * Adding variables for counting items within the ALM query - $alm_page & $alm_item are now accessible within repeater templates.
525
  * Remove plugin activation notification due to error fetching column names.
526
  * Fixed issue with orderby = "rand", ALM now excludes all previously queried post ids.
530
 
531
 
532
  = 2.2.8 =
533
+ * Adding required functionality for the NEW Ajax Load More Custom Repeaters v2 add-on - https://connekthq.com/plugins/ajax-load-more/custom-repeaters/
534
  * Improved debug messaging for Ajax Load More and Add-Ons.
535
  * Adding fix for ordering by meta value.
536
  * Admin stying updates.
577
 
578
  = 2.2.0 =
579
  * Adding Post Format query.
580
+ * Adding syntax highlighting for Repeater Templates with CodeMirror (https://codemirror.net/).
581
  * Adding custom alias integration for Repeater Templates (Only for the custom repeater add-on).
582
  * Adding button preview on settings page.
583
  * Adding 'White' button style.
admin/admin.php CHANGED
@@ -1222,7 +1222,7 @@ function alm_btn_color_callback() {
1222
  $html .= '</optgroup>';
1223
  $html .= '</select>';
1224
 
1225
- $html .= '<div class="clear"></div><div class="ajax-load-more-wrap core '.$type.'"><span>'.__('Preview', 'ajax-load-more') .'</span><button class="alm-load-more-btn loading" disabled="disabled">Load More</button></div>';
1226
  echo $html;
1227
  }
1228
 
1222
  $html .= '</optgroup>';
1223
  $html .= '</select>';
1224
 
1225
+ $html .= '<div class="clear"></div><div class="ajax-load-more-wrap core '.$type.'"><span>'.__('Preview', 'ajax-load-more') .'</span><button class="alm-load-more-btn loading" disabled="disabled">'.apply_filters('alm_button_label', __('Older Posts', 'ajax-load-more')).'</button></div>';
1226
  echo $html;
1227
  }
1228
 
admin/css/admin.css CHANGED
@@ -1405,9 +1405,9 @@ table.highlight{
1405
  height: 40px;
1406
  line-height: 40px;
1407
  text-align: center;
1408
- background: #fff;
1409
  color: #777;
1410
- border: 1px dashed #ccc;
1411
  border-right: none;
1412
  border-top: none;
1413
  display: block;
@@ -3058,7 +3058,14 @@ p.cache-stats{
3058
  background: #f7f7f7;
3059
  padding: 20px;
3060
  }
3061
- .share-alm{}
 
 
 
 
 
 
 
3062
  .share-alm h3{
3063
  font-size: 16px;
3064
  }
1405
  height: 40px;
1406
  line-height: 40px;
1407
  text-align: center;
1408
+ background: #f7f7f7;
1409
  color: #777;
1410
+ border: 1px solid #e7e7e7;
1411
  border-right: none;
1412
  border-top: none;
1413
  display: block;
3058
  background: #f7f7f7;
3059
  padding: 20px;
3060
  }
3061
+ .share-alm{
3062
+ /* display: none !important; */
3063
+ }
3064
+ .share-alm .dotted{
3065
+ border: none;
3066
+ background: none;
3067
+ padding: 5px 10px 0;
3068
+ }
3069
  .share-alm h3{
3070
  font-size: 16px;
3071
  }
admin/img/add.png CHANGED
Binary file
admin/includes/cta/about.php CHANGED
@@ -2,9 +2,10 @@
2
  <h3>Other Projects</h3>
3
  <ul>
4
  <li><strong><a target="blank" href="https://connekthq.com/plugins/easy-query/">Easy Query</a></strong><br>A simple solution to build and display WordPress queries without touching a single line of code.</li>
5
- <li><strong><a target="blank" href="https://connekthq.com/plugins/unsplash-wp/">Unsplash WP</a></strong><br>The fastest way to upload high quality stock photos from unsplash.com directly to your media library</li>
6
- <li><strong><a target="blank" href="https://github.com/dcooney/flexpanel">FlexPanel</a></strong><br>A responsive scrolling panel navigation for mobile and desktop</li>
7
- <li><strong><a target="blank" href="https://connekthq.com">Connekt Media</a></strong><br>A digital creation company</li>
 
8
  </ul>
9
  </div>
10
 
2
  <h3>Other Projects</h3>
3
  <ul>
4
  <li><strong><a target="blank" href="https://connekthq.com/plugins/easy-query/">Easy Query</a></strong><br>A simple solution to build and display WordPress queries without touching a single line of code.</li>
5
+ <li><strong><a target="blank" href="https://connekthq.com/plugins/velocity/">Velocity</a></strong><br>Improve website performance by lazy loading and customizing your embedded media with Velocity.</li>
6
+ <li><strong><a target="blank" href="https://connekthq.com/plugins/unsplash-wp/">Unsplash WP</a></strong><br>The fastest way to upload high quality stock photos from unsplash.com directly to your media library.</li>
7
+ <li><strong><a target="blank" href="https://github.com/dcooney/flexpanel">FlexPanel</a></strong><br>A responsive scrolling panel navigation for mobile and desktop.</li>
8
+ <li><strong><a target="blank" href="https://connekthq.com">Connekt Media</a></strong><br>A digital creation company.</li>
9
  </ul>
10
  </div>
11
 
admin/includes/cta/reviews.php CHANGED
@@ -1,5 +1,5 @@
1
  <h4><?php _e('Leave a Review', 'ajax-load-more'); ?> <i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i></h4>
2
  <p><?php _e('Good <em>or</em> bad - all reviews will help the plugin push forward and grow.', 'ajax-load-more'); ?> </p>
3
  <ul class="share">
4
- <li><a href="https://wordpress.org/support/view/plugin-reviews/ajax-load-more" target="_blank"><?php _e('Write a Review', 'ajax-load-more'); ?></a></li>
5
  </ul>
1
  <h4><?php _e('Leave a Review', 'ajax-load-more'); ?> <i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i></h4>
2
  <p><?php _e('Good <em>or</em> bad - all reviews will help the plugin push forward and grow.', 'ajax-load-more'); ?> </p>
3
  <ul class="share">
4
+ <li><a href="https://wordpress.org/support/view/plugin-reviews/ajax-load-more" target="_blank"><?php _e('Write Review', 'ajax-load-more'); ?></a></li>
5
  </ul>
admin/shortcode-builder/js/shortcode-builder.js CHANGED
@@ -779,7 +779,10 @@ jQuery(document).ready(function($) {
779
  var transition = $('.transition input[name=transition]:checked').val();
780
  if(transition !== 'slide')
781
  output += ' transition="'+transition+'"';
782
-
 
 
 
783
 
784
  var transition_container = $('.transition input[name=remove_container]:checked').val();
785
  if(transition_container === 'f' && seo !== 'true' && previous !== 'true')
779
  var transition = $('.transition input[name=transition]:checked').val();
780
  if(transition !== 'slide')
781
  output += ' transition="'+transition+'"';
782
+
783
+ var transition_speed = $('.transition input[name=transition-speed]').val();
784
+ if(transition_speed !== '250' && transition !== 'none')
785
+ output += ' transition_speed="'+transition_speed+'"';
786
 
787
  var transition_container = $('.transition input[name=remove_container]:checked').val();
788
  if(transition_container === 'f' && seo !== 'true' && previous !== 'true')
admin/shortcode-builder/shortcode-builder.php CHANGED
@@ -1111,7 +1111,7 @@
1111
  <p><?php _e('Select a loading transition style.', 'ajax-load-more'); ?></p>
1112
  </div>
1113
  <div class="wrap">
1114
- <div class="inner">
1115
  <ul>
1116
  <li>
1117
  <input class="alm_element" type="radio" name="transition" value="slide" id="transition-slide" checked="checked">
@@ -1128,8 +1128,23 @@
1128
  </ul>
1129
  </div>
1130
  </div>
 
1131
  <div class="clear"></div>
1132
  <hr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1133
  <div class="section-title">
1134
  <h4><?php _e('Transition Container', 'ajax-load-more'); ?> <a href="javascript:void(0)" class="fa fa-question-circle tooltip" title="<?php _e('Removing the transition container may have undesired results and is not recommended.','ajax-load-more'); ?>"></a></h4>
1135
  <p><?php _e('Remove the Ajax Load More (.alm-reveal) loading container.', 'ajax-load-more'); ?></p>
1111
  <p><?php _e('Select a loading transition style.', 'ajax-load-more'); ?></p>
1112
  </div>
1113
  <div class="wrap">
1114
+ <div class="inner">
1115
  <ul>
1116
  <li>
1117
  <input class="alm_element" type="radio" name="transition" value="slide" id="transition-slide" checked="checked">
1128
  </ul>
1129
  </div>
1130
  </div>
1131
+
1132
  <div class="clear"></div>
1133
  <hr>
1134
+
1135
+ <div class="section-title">
1136
+ <h4><?php _e('Transition Speed', 'ajax-load-more'); ?> <a href="javascript:void(0)" class="fa fa-question-circle tooltip" title="<?php _e('0.5 seconds = 500, 1 second = 1000 etc.','ajax-load-more'); ?>"></a></h4>
1137
+ <p><?php _e('The speed of the loading transition in milliseconds', 'ajax-load-more'); ?>.<br/></p>
1138
+ </div>
1139
+ <div class="wrap">
1140
+ <div class="inner">
1141
+ <input type="number" class="alm_element numbers-only" name="transition-speed" id="transition-speed" step="50" min="50" value="250">
1142
+ </div>
1143
+ </div>
1144
+
1145
+ <div class="clear"></div>
1146
+ <hr>
1147
+
1148
  <div class="section-title">
1149
  <h4><?php _e('Transition Container', 'ajax-load-more'); ?> <a href="javascript:void(0)" class="fa fa-question-circle tooltip" title="<?php _e('Removing the transition container may have undesired results and is not recommended.','ajax-load-more'); ?>"></a></h4>
1150
  <p><?php _e('Remove the Ajax Load More (.alm-reveal) loading container.', 'ajax-load-more'); ?></p>
admin/views/settings.php CHANGED
@@ -18,7 +18,7 @@
18
  <div class="group share-alm">
19
  <div class="dotted">
20
  <h2 style="padding: 0; margin: 0 0 10px;"><?php _e('A small favor to ask', 'ajax-load-more'); ?>...</h2>
21
- <p style="padding: 0 0 20px; margin: 0 0 25px; border-bottom: 1px dashed #ccc;">
22
  <?php _e('If you\'re an Ajax Load More user, please consider helping <a href="https://twitter.com/KaptonKaos" target="_blank">me</a> spread the word by sharing with your networks and/or leaving a review on <a href="https://wordpress.org/support/view/plugin-reviews/ajax-load-more" target="_blank">wordpress.org</a> forums.', 'ajax-load-more'); ?></p>
23
  <div class="one_half sharing">
24
  <?php include_once( ALM_PATH . 'admin/includes/cta/sharing.php'); ?>
18
  <div class="group share-alm">
19
  <div class="dotted">
20
  <h2 style="padding: 0; margin: 0 0 10px;"><?php _e('A small favor to ask', 'ajax-load-more'); ?>...</h2>
21
+ <p style="padding: 0 0 15px; margin: 0 0 20px; border-bottom: 1px dashed #ccc;">
22
  <?php _e('If you\'re an Ajax Load More user, please consider helping <a href="https://twitter.com/KaptonKaos" target="_blank">me</a> spread the word by sharing with your networks and/or leaving a review on <a href="https://wordpress.org/support/view/plugin-reviews/ajax-load-more" target="_blank">wordpress.org</a> forums.', 'ajax-load-more'); ?></p>
23
  <div class="one_half sharing">
24
  <?php include_once( ALM_PATH . 'admin/includes/cta/sharing.php'); ?>
ajax-load-more.php CHANGED
@@ -7,17 +7,17 @@ Text Domain: ajax-load-more
7
  Author: Darren Cooney
8
  Twitter: @KaptonKaos
9
  Author URI: http://connekthq.com
10
- Version: 2.9
11
  License: GPL
12
  Copyright: Darren Cooney & Connekt Media
13
- */
 
14
 
15
 
16
- define('ALM_VERSION', '2.9');
17
- define('ALM_RELEASE', 'February 16, 2016');
18
  define('ALM_STORE_URL', 'https://connekthq.com');
19
 
20
-
21
  if (!defined('ALM_ALTERNATING_ITEM_NAME'))
22
  define('ALM_ALTERNATING_ITEM_NAME', '14456' );
23
 
@@ -242,12 +242,11 @@ if( !class_exists('AjaxLoadMore') ):
242
 
243
  // Load JS
244
 
245
- //wp_register_script( 'ajax-load-more', plugins_url( '/core/js/ajax-load-more.js', __FILE__ ), array('jquery'), '1.1', true );
246
- wp_register_script( 'ajax-load-more', plugins_url( '/core/js/ajax-load-more.min.js', __FILE__ ), array('jquery'), '1.1', true );
247
-
248
-
249
- // Load CSS
250
 
 
 
251
  if(!isset($options['_alm_disable_css']) || $options['_alm_disable_css'] != '1'){
252
  //wp_enqueue_style( 'ajax-load-more', plugins_url('/core/css/ajax-load-more.css', __FILE__ ));
253
  wp_enqueue_style( 'ajax-load-more', plugins_url('/core/css/ajax-load-more.min.css', __FILE__ ));
@@ -283,11 +282,17 @@ if( !class_exists('AjaxLoadMore') ):
283
  * @since 2.0.0
284
  */
285
 
286
- function alm_shortcode( $atts, $content = null ) {
287
 
288
  global $post;
289
  $options = get_option( 'alm_settings' ); // Get ALM Settings
290
- $slug = $post->post_name; // Current page slug
 
 
 
 
 
 
291
  $this->counter++; // Shotcode counter
292
 
293
  // Custom CSS for Layouts
@@ -358,17 +363,19 @@ if( !class_exists('AjaxLoadMore') ):
358
  'pause' => 'false',
359
  'destroy_after' => '',
360
  'transition' => 'slide',
 
361
  'transition_container' => 'true',
362
  'images_loaded' => 'false',
363
- 'button_label' => __('Older Posts', 'ajax-load-more'),
364
  'button_loading_label' => '',
365
  'container_type' => '',
366
  'css_classes' => '',
367
  ), $atts));
368
 
369
 
370
- // Enqueue core Ajax Load More JS
371
- wp_enqueue_script( 'ajax-load-more' );
 
372
 
373
  // Enqueue add-on JS
374
  if(has_action('alm_seo_installed') && $seo === 'true'){
@@ -396,20 +403,22 @@ if( !class_exists('AjaxLoadMore') ):
396
  $container_element = 'ul';
397
  if($options['_alm_container_type'] == '2' || $previous_post)
398
  $container_element = 'div';
 
399
  // override shortcode param
400
  if($container_type){
401
  $container_element = $container_type;
402
  }
 
403
  // Previous post override
404
  if($previous_post){
405
  $posts_per_page = 1;
406
  $container_element = 'div';
407
  }
 
408
  // Comments
409
  if($comments === 'true'){
410
  $container_element = $comments_style;
411
- }
412
-
413
 
414
  // Get extra classnames
415
  $classname = '';
@@ -443,7 +452,6 @@ if( !class_exists('AjaxLoadMore') ):
443
  $lang = pll_current_language();
444
  if (function_exists('qtrans_getLanguage')) // qTranslate - https://wordpress.org/plugins/qtranslate/
445
  $lang = qtrans_getLanguage();
446
-
447
 
448
  $wp_posts_per_page = get_option( 'posts_per_page' ); // Posts per page - settings -> reading
449
 
@@ -457,13 +465,68 @@ if( !class_exists('AjaxLoadMore') ):
457
  $preloaded = "false";
458
  }
459
 
460
- // Start ALM object
461
-
462
- $ajaxloadmore = '';
463
-
464
  $ajaxloadmore .= apply_filters('alm_before_container', ''); // ALM Core Filter Hook
465
-
466
- $ajaxloadmore .= '<div id="ajax-load-more" class="ajax-load-more-wrap'. $btn_color .''. $paging_color .''. $alm_layouts .'" data-id="" data-canonical-url="'.get_permalink().'" data-slug="'. $post->post_name .'">';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
467
 
468
 
469
  // Previous Post
@@ -606,7 +669,13 @@ if( !class_exists('AjaxLoadMore') ):
606
 
607
  endif;
608
  $preloaded_output = '<'.$container_element.' class="alm-listing alm-preloaded'. $classname .' '. $css_classes .'" data-total-posts="'. $alm_total_posts .'">';
 
 
 
609
  $preloaded_output .= $output;
 
 
 
610
  $preloaded_output .= '</'.$container_element.'>';
611
 
612
  if(has_action('alm_seo_installed')){ // If SEO, add noscript paging
@@ -766,6 +835,8 @@ if( !class_exists('AjaxLoadMore') ):
766
  $ajaxloadmore .= ' data-button-class="'.$button_classname.'"';
767
  $ajaxloadmore .= ' data-destroy-after="'.$destroy_after.'"';
768
  $ajaxloadmore .= ' data-transition="'.$transition.'"';
 
 
769
  if($transition_container === 'false')
770
  $ajaxloadmore .= ' data-transition-container="'.$transition_container.'"';
771
  $ajaxloadmore .= ' data-images-loaded="'.$images_loaded.'"';
@@ -825,6 +896,7 @@ if( !class_exists('AjaxLoadMore') ):
825
  }
826
 
827
  $slug = (isset($_GET['slug'])) ? $_GET['slug'] : '';
 
828
 
829
  $queryType = (isset($_GET['query_type'])) ? $_GET['query_type'] : 'standard'; // 'standard' or 'totalposts'; totalposts returns $alm_found_posts
830
 
@@ -1143,9 +1215,8 @@ if( !class_exists('AjaxLoadMore') ):
1143
  }
1144
 
1145
  // Create cache directory
1146
- if(!empty($cache_id) && has_action('alm_cache_create_dir')){
1147
- $url = $_SERVER['HTTP_REFERER'];
1148
- apply_filters('alm_cache_create_dir', $cache_id, $url);
1149
  $page_cache = ''; // set our page cache variable
1150
  }
1151
 
@@ -1163,12 +1234,17 @@ if( !class_exists('AjaxLoadMore') ):
1163
  }
1164
 
1165
 
1166
- if($queryType === 'standard'){
 
1167
  // Run the loop
1168
  if ($alm_query->have_posts()) :
1169
  $alm_found_posts = $alm_total_posts;
1170
- $alm_current = 0;
 
 
 
1171
  while ($alm_query->have_posts()): $alm_query->the_post();
 
1172
  $alm_loop_count++;
1173
  $alm_current++;
1174
  $alm_page = $alm_page_count; // Get page number
@@ -1197,28 +1273,38 @@ if( !class_exists('AjaxLoadMore') ):
1197
  }else{
1198
  include( alm_get_current_repeater($repeater, $type) );//Include repeater template
1199
  }
1200
-
1201
- // If ALM Cache is enabled
1202
- // - Build the cache include and store in $page_cache var
1203
- if(!empty($cache_id) && has_action('alm_cache_inc')){
1204
- $page_cache .= apply_filters('alm_cache_inc', $repeater, $type, $theme_repeater, $alm_page, $alm_found_posts, $alm_item, $alm_current);
1205
- }
1206
 
1207
  endwhile; wp_reset_query();
 
 
 
1208
 
1209
  // If Cache is enabled and seo_start_page is 1 (meaning, a user has not requested /page/12/)
1210
- // - Only create cached files if the user visits pages in order 1, 2, 3 etc.
1211
-
1212
- if(!empty($cache_id) && has_action('alm_cache_installed') && $seo_start_page == 1){
1213
- apply_filters('alm_cache_file', $cache_id, $page, $page_cache);
1214
- }
 
 
 
 
 
1215
 
 
 
 
 
 
 
 
1216
  endif;
1217
 
1218
  }elseif($queryType === 'totalposts'){
1219
  echo $alm_total_posts;
1220
  }
1221
- exit;
 
1222
  }
1223
 
1224
  }
@@ -1240,5 +1326,6 @@ if( !class_exists('AjaxLoadMore') ):
1240
  }
1241
  // initialize
1242
  AjaxLoadMore();
 
1243
 
1244
  endif; // class_exists check
7
  Author: Darren Cooney
8
  Twitter: @KaptonKaos
9
  Author URI: http://connekthq.com
10
+ Version: 2.10.0.1
11
  License: GPL
12
  Copyright: Darren Cooney & Connekt Media
13
+
14
+ */
15
 
16
 
17
+ define('ALM_VERSION', '2.10.0.1');
18
+ define('ALM_RELEASE', 'April 11, 2016');
19
  define('ALM_STORE_URL', 'https://connekthq.com');
20
 
 
21
  if (!defined('ALM_ALTERNATING_ITEM_NAME'))
22
  define('ALM_ALTERNATING_ITEM_NAME', '14456' );
23
 
242
 
243
  // Load JS
244
 
245
+ //wp_register_script( 'ajax-load-more', plugins_url( '/core/js/ajax-load-more.js', __FILE__ ), array('jquery'), ALM_VERSION, true );
246
+ wp_register_script( 'ajax-load-more', plugins_url( '/core/js/ajax-load-more.min.js', __FILE__ ), array('jquery'), ALM_VERSION, true );
 
 
 
247
 
248
+
249
+ // Load CSS
250
  if(!isset($options['_alm_disable_css']) || $options['_alm_disable_css'] != '1'){
251
  //wp_enqueue_style( 'ajax-load-more', plugins_url('/core/css/ajax-load-more.css', __FILE__ ));
252
  wp_enqueue_style( 'ajax-load-more', plugins_url('/core/css/ajax-load-more.min.css', __FILE__ ));
282
  * @since 2.0.0
283
  */
284
 
285
+ function alm_shortcode($atts) {
286
 
287
  global $post;
288
  $options = get_option( 'alm_settings' ); // Get ALM Settings
289
+
290
+ $slug = '';
291
+ if(!is_archive()){
292
+ // If not an archive page, set the post slug
293
+ $slug = $post->post_name;
294
+ }
295
+
296
  $this->counter++; // Shotcode counter
297
 
298
  // Custom CSS for Layouts
363
  'pause' => 'false',
364
  'destroy_after' => '',
365
  'transition' => 'slide',
366
+ 'transition_speed' => '250',
367
  'transition_container' => 'true',
368
  'images_loaded' => 'false',
369
+ 'button_label' => apply_filters('alm_button_label', __('Older Posts', 'ajax-load-more')),
370
  'button_loading_label' => '',
371
  'container_type' => '',
372
  'css_classes' => '',
373
  ), $atts));
374
 
375
 
376
+ // Enqueue core Ajax Load More JS
377
+ wp_enqueue_script( 'ajax-load-more' );
378
+
379
 
380
  // Enqueue add-on JS
381
  if(has_action('alm_seo_installed') && $seo === 'true'){
403
  $container_element = 'ul';
404
  if($options['_alm_container_type'] == '2' || $previous_post)
405
  $container_element = 'div';
406
+
407
  // override shortcode param
408
  if($container_type){
409
  $container_element = $container_type;
410
  }
411
+
412
  // Previous post override
413
  if($previous_post){
414
  $posts_per_page = 1;
415
  $container_element = 'div';
416
  }
417
+
418
  // Comments
419
  if($comments === 'true'){
420
  $container_element = $comments_style;
421
+ }
 
422
 
423
  // Get extra classnames
424
  $classname = '';
452
  $lang = pll_current_language();
453
  if (function_exists('qtrans_getLanguage')) // qTranslate - https://wordpress.org/plugins/qtranslate/
454
  $lang = qtrans_getLanguage();
 
455
 
456
  $wp_posts_per_page = get_option( 'posts_per_page' ); // Posts per page - settings -> reading
457
 
465
  $preloaded = "false";
466
  }
467
 
468
+ // Start ALM object
469
+ $ajaxloadmore = '';
470
+
 
471
  $ajaxloadmore .= apply_filters('alm_before_container', ''); // ALM Core Filter Hook
472
+
473
+ // Build canonical URL
474
+ // - Check the page/post type and then get the correct base url for the page.
475
+
476
+ // Date
477
+ if(is_date()){
478
+ // Is archive page
479
+ $archive_year = get_the_date('Y');
480
+ $archive_month = get_the_date('m');
481
+ $archive_day = get_the_date('d');
482
+ if(is_year()){
483
+ $canonicalURL = get_year_link( $archive_year );
484
+ }
485
+ if(is_month()){
486
+ $canonicalURL = get_month_link( $archive_year, $archive_month );
487
+ }
488
+ if(is_day()){
489
+ $canonicalURL = get_month_link( $archive_year, $archive_month, $archive_day );
490
+ }
491
+ }
492
+ // Frontpage
493
+ elseif(is_front_page() || is_home()){
494
+ $canonicalURL = get_home_url().'/';
495
+ }
496
+ // Category
497
+ elseif(is_category()){
498
+ $cur_cat_id = get_cat_id( single_cat_title('',false) );
499
+ $canonicalURL = get_category_link($cur_cat_id);
500
+ }
501
+ // Tag
502
+ elseif(is_tag()){
503
+ $cur_tag_id = get_query_var('tag_id');
504
+ $canonicalURL = get_tag_link($cur_tag_id);
505
+ }
506
+ // Author
507
+ elseif(is_author()){
508
+ $author_id = get_the_author_meta('ID');
509
+ $canonicalURL = get_author_posts_url($author_id);
510
+ }
511
+ // Taxonomy
512
+ elseif(is_tax()){
513
+ $tax_term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy' ));
514
+ $tax_id = $tax_term->term_id;
515
+ $canonicalURL = get_term_link($tax_id);
516
+ }
517
+ // post_type
518
+ elseif(is_post_type_archive()){
519
+ $post_type_archive = get_post_type();
520
+ $canonicalURL = get_post_type_archive_link($post_type_archive);
521
+ }
522
+ else{
523
+ $canonicalURL = get_permalink();
524
+ }
525
+ // End build canonical URL
526
+
527
+
528
+ // ALM Wrapper
529
+ $ajaxloadmore .= '<div id="ajax-load-more" class="ajax-load-more-wrap'. $btn_color .''. $paging_color .''. $alm_layouts .'" data-id="" data-canonical-url="'. $canonicalURL .'" data-slug="'. $slug .'">';
530
 
531
 
532
  // Previous Post
669
 
670
  endif;
671
  $preloaded_output = '<'.$container_element.' class="alm-listing alm-preloaded'. $classname .' '. $css_classes .'" data-total-posts="'. $alm_total_posts .'">';
672
+ if($seo === "true"){
673
+ $preloaded_output .= '<div class="alm-reveal alm-seo" data-page="1" data-url="'.$canonicalURL.'">';
674
+ }
675
  $preloaded_output .= $output;
676
+ if($seo === "true"){
677
+ $preloaded_output .= '</div>';
678
+ }
679
  $preloaded_output .= '</'.$container_element.'>';
680
 
681
  if(has_action('alm_seo_installed')){ // If SEO, add noscript paging
835
  $ajaxloadmore .= ' data-button-class="'.$button_classname.'"';
836
  $ajaxloadmore .= ' data-destroy-after="'.$destroy_after.'"';
837
  $ajaxloadmore .= ' data-transition="'.$transition.'"';
838
+ if($transition_speed !== '250')
839
+ $ajaxloadmore .= ' data-transition-speed="'.$transition_speed.'"';
840
  if($transition_container === 'false')
841
  $ajaxloadmore .= ' data-transition-container="'.$transition_container.'"';
842
  $ajaxloadmore .= ' data-images-loaded="'.$images_loaded.'"';
896
  }
897
 
898
  $slug = (isset($_GET['slug'])) ? $_GET['slug'] : '';
899
+ $canonical_url = (isset($_GET['canonical_url'])) ? $_GET['canonical_url'] : $_SERVER['HTTP_REFERER'];
900
 
901
  $queryType = (isset($_GET['query_type'])) ? $_GET['query_type'] : 'standard'; // 'standard' or 'totalposts'; totalposts returns $alm_found_posts
902
 
1215
  }
1216
 
1217
  // Create cache directory
1218
+ if(!empty($cache_id) && has_action('alm_cache_create_dir')){
1219
+ apply_filters('alm_cache_create_dir', $cache_id, $canonical_url);
 
1220
  $page_cache = ''; // set our page cache variable
1221
  }
1222
 
1234
  }
1235
 
1236
 
1237
+ if($queryType === 'standard'){
1238
+
1239
  // Run the loop
1240
  if ($alm_query->have_posts()) :
1241
  $alm_found_posts = $alm_total_posts;
1242
+ $alm_current = 0;
1243
+
1244
+ ob_start();
1245
+
1246
  while ($alm_query->have_posts()): $alm_query->the_post();
1247
+
1248
  $alm_loop_count++;
1249
  $alm_current++;
1250
  $alm_page = $alm_page_count; // Get page number
1273
  }else{
1274
  include( alm_get_current_repeater($repeater, $type) );//Include repeater template
1275
  }
 
 
 
 
 
 
1276
 
1277
  endwhile; wp_reset_query();
1278
+
1279
+ $data = ob_get_clean();
1280
+ ob_end_clean();
1281
 
1282
  // If Cache is enabled and seo_start_page is 1 (meaning, a user has not requested /page/12/)
1283
+ // - Only create cached files if the user visits pages in order 1, 2, 3 etc.
1284
+ if(!empty($cache_id) && has_action('alm_cache_installed') && $seo_start_page <= 1){
1285
+ apply_filters('alm_cache_file', $cache_id, $page, $data);
1286
+ }
1287
+
1288
+ $return = array(
1289
+ 'html' => $data
1290
+ );
1291
+
1292
+ wp_send_json($return);
1293
 
1294
+ else :
1295
+
1296
+ $return = array(
1297
+ 'html' => null
1298
+ );
1299
+ wp_send_json($return);
1300
+
1301
  endif;
1302
 
1303
  }elseif($queryType === 'totalposts'){
1304
  echo $alm_total_posts;
1305
  }
1306
+
1307
+ wp_die();
1308
  }
1309
 
1310
  }
1326
  }
1327
  // initialize
1328
  AjaxLoadMore();
1329
+
1330
 
1331
  endif; // class_exists check
core/js/ajax-load-more.js CHANGED
@@ -1,4 +1,3 @@
1
-
2
  /*
3
  * Ajax Load More
4
  * http://wordpress.org/plugins/ajax-load-more/
@@ -25,7 +24,6 @@
25
  var alm = this;
26
  alm.AjaxLoadMore = {};
27
  alm.page = 0;
28
- alm.speed = 250;
29
  alm.proceed = false;
30
  alm.disable_ajax = false;
31
  alm.init = true;
@@ -62,6 +60,7 @@
62
  alm.pause = alm.content.attr('data-pause'); // true | false
63
  alm.transition = alm.content.attr('data-transition');
64
  alm.transition_container = alm.content.attr('data-transition-container');
 
65
  alm.images_loaded = alm.content.attr('data-images-loaded');
66
  alm.destroy_after = alm.content.attr('data-destroy-after');
67
  alm.lang = alm.content.attr('data-lang');
@@ -157,7 +156,10 @@
157
  }
158
  if (alm.seo === 'true'){
159
  alm.seo = true; // Convert string to boolean
160
- }
 
 
 
161
 
162
  alm.permalink = alm.content.attr('data-seo-permalink');
163
  alm.pageview = alm.content.attr('data-seo-pageview');
@@ -255,7 +257,7 @@
255
  }
256
 
257
 
258
- /* Select the transition */
259
  if (alm.transition === undefined){
260
  alm.transition = 'slide';
261
  }else if (alm.transition === "fade"){
@@ -264,7 +266,13 @@
264
  alm.transition = 'none';
265
  }else {
266
  alm.transition = 'slide';
267
- }
 
 
 
 
 
 
268
 
269
  if (alm.transition_container === undefined || alm.transition_container === 'true'){
270
  alm.transition_container = true;
@@ -364,7 +372,7 @@
364
  var cachePage = alm.cache_path + '/page-' + alm.page +'.html';
365
 
366
  $.get(cachePage, function( data ) {
367
- alm.AjaxLoadMore.success(data); // data contains whatever the request has returned
368
  }).fail(function() {
369
  alm.AjaxLoadMore.ajax('standard');
370
  });
@@ -399,8 +407,7 @@
399
  // If this is a comment query
400
  if(alm.comments === 'true'){
401
  action = 'alm_comments_query';
402
- alm.posts_per_page = alm.comments_per_page;
403
-
404
  alm.comments_array = {
405
  'comments': 'true',
406
  'post_id': alm.comments_post_id,
@@ -422,7 +429,7 @@
422
  'alternate_repeater': alm.alternate_repeater,
423
  'alternate_theme_repeater': alm.alternate_theme_repeater,
424
  };
425
- }
426
 
427
  $.ajax({
428
  type: "GET",
@@ -474,8 +481,9 @@
474
  previous_post_taxonomy: alm.previous_post_taxonomy,
475
  lang: alm.lang,
476
  slug: alm.slug,
 
477
  },
478
- dataType: "html",
479
  // parse the data as html
480
  beforeSend: function () {
481
  if (alm.page != 1 && !alm.paging) {
@@ -484,7 +492,7 @@
484
  },
485
  success: function (data) {
486
  if(queryType === 'standard'){
487
- alm.AjaxLoadMore.success(data);
488
  }
489
  else if(queryType === 'totalposts' && alm.paging){
490
  if($.isFunction($.fn.almBuildPagination)){
@@ -512,13 +520,21 @@
512
  * @since 2.6.0
513
  */
514
 
515
- alm.AjaxLoadMore.success = function (data) {
516
 
517
  if(alm.previous_post){ // Get previous page data
518
  alm.AjaxLoadMore.getPreviousPost();
519
  }
 
 
 
 
 
 
 
 
 
520
 
521
- alm.data = $(data); // Convert data to an object
522
  if (alm.init) {
523
  if(!alm.paging){
524
 
@@ -527,7 +543,7 @@
527
  } else {
528
 
529
  // Is pagination
530
- if (alm.data.length > 0) {
531
  alm.el = $('<div class="alm-reveal"/>');
532
  alm.el.append('<div class="alm-paging-content"></div><div class="alm-paging-loading"></div>');
533
  $('.alm-paging-content', alm.el).append(alm.data).hide();
@@ -566,25 +582,96 @@
566
  if(!alm.paging){
567
 
568
  if(alm.previous_post){ // If Previous Post, create container and append data
 
569
  alm.el = $('<div class="alm-reveal alm-previous-post post-'+alm.previous_post_id+'" data-id="'+alm.previous_post_id+'" data-title="'+alm.previous_post_title+'" data-url="'+alm.previous_post_permalink+'"/>');
570
- alm.el.append(alm.data).hide();
 
571
  }else{
572
-
573
- if(!alm.transition_container){ // If transiton container == false
 
574
  alm.data.hide();
575
  alm.el = alm.data;
576
- }else{ // Normal transition
577
- alm.el = $('<div class="alm-reveal"/>');
578
- alm.el.append(alm.data).hide();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
579
  }
580
  }
581
 
582
  alm.content.append(alm.el);
583
 
584
  if (alm.transition === 'fade') { // Fade transition
585
-
586
  if(alm.images_loaded === 'true'){
587
-
588
  alm.el.almWaitForImages().done(function(){
589
  alm.el.fadeIn(alm.speed, 'alm_easeInOutQuad', function () {
590
  alm.loading = false;
@@ -598,6 +685,9 @@
598
  alm.button.addClass('done');
599
  }
600
  }
 
 
 
601
  });
602
  });
603
  }else{
@@ -612,22 +702,26 @@
612
  if(!alm.paging){
613
  alm.button.addClass('done');
614
  }
615
- }
 
 
 
616
  });
617
  }
618
 
619
  }else if(alm.transition === 'none') { // No transition
620
-
621
  if(alm.images_loaded === 'true'){
622
-
623
  alm.el.almWaitForImages().done(function(){
624
- alm.el.show();
 
 
 
625
  });
626
-
627
  }else{
628
-
629
- alm.el.show();
630
-
 
631
  }
632
  alm.loading = false;
633
  if(!alm.paging){
@@ -640,10 +734,9 @@
640
  alm.button.addClass('done');
641
  }
642
  }
643
-
644
  }else { // Slide transition
645
  if(alm.images_loaded === 'true'){
646
-
647
  alm.el.almWaitForImages().done(function(){
648
  alm.el.slideDown(alm.speed, 'alm_easeInOutQuad', function () {
649
  alm.loading = false;
@@ -656,12 +749,13 @@
656
  if(!alm.paging){
657
  alm.button.addClass('done');
658
  }
659
- }
 
 
 
660
  });
661
  });
662
-
663
- }else{
664
-
665
  alm.el.slideDown(alm.speed, 'alm_easeInOutQuad', function () {
666
  alm.loading = false;
667
  if(!alm.paging){
@@ -673,9 +767,11 @@
673
  if(!alm.paging){
674
  alm.button.addClass('done');
675
  }
676
- }
 
 
 
677
  });
678
-
679
  }
680
  }
681
 
@@ -683,14 +779,15 @@
683
 
684
  // Is Paging
685
  if(!alm.init){
686
-
687
  $('.alm-paging-content', alm.el).html('').append(alm.data).almWaitForImages().done(function(){ // Remove loading class and append data
688
  $('.alm-paging-loading', alm.el).fadeOut(alm.speed); // Fade out loader
689
  if ($.isFunction($.fn.almOnPagingComplete)){
690
  $.fn.almOnPagingComplete(alm);
691
- }
 
 
 
692
  });
693
-
694
  }
695
  }
696
 
@@ -706,25 +803,15 @@
706
  }
707
 
708
  // ALM Done
709
- // If data is returned but it's less than the posts per page.
710
  if(alm.data.length < alm.posts_per_page){
711
  if ($.isFunction($.fn.almDone)) {
712
- $.fn.almDone(alm);
 
 
 
713
  }
714
- }
715
-
716
- // ALM SEO
717
- if($(".ajax-load-more-wrap").length === 1){ // only run if a single instance
718
- if ($.isFunction($.fn.almSEO) && alm.seo) {
719
- if(alm.images_loaded === 'true'){
720
- alm.el.almWaitForImages().done(function(){
721
- $.fn.almSEO(alm);
722
- });
723
- }else{
724
- $.fn.almSEO(alm);
725
- }
726
- }
727
- }
728
 
729
  } else {
730
 
@@ -734,7 +821,7 @@
734
  }
735
 
736
  // ALM Done
737
- if ($.isFunction($.fn.almDone)) {
738
  $.fn.almDone(alm);
739
  }
740
 
@@ -757,7 +844,8 @@
757
  }
758
  }
759
  }
760
- alm.init = false;
 
761
  };
762
 
763
 
@@ -780,8 +868,7 @@
780
  taxonomy: alm.previous_post_taxonomy
781
  },
782
  success: function (data) {
783
- if(data.has_previous_post){
784
-
785
  alm.content.attr('data-previous-post-id', data.prev_id); // update previous-post-id on ALM element
786
  alm.previous_post_permalink = data.prev_permalink;
787
  alm.previous_post_title = data.prev_title;
@@ -789,6 +876,9 @@
789
  if(!data.has_previous_post){
790
  alm.finished = true;
791
  alm.button.addClass('done');
 
 
 
792
  }
793
  }
794
  if($.isFunction($.fn.almSetPreviousPost)){
@@ -813,7 +903,9 @@
813
  */
814
  alm.resetBtnText = function(){
815
  if(alm.button_loading_label !== false){ // Reset button text
816
- alm.button.text(alm.button_label);
 
 
817
  }
818
  };
819
 
@@ -968,7 +1060,7 @@
968
  var data = $('.alm-preloaded', alm.el).html(); // Content of preloaded page
969
  $('.alm-preloaded', alm.el).remove();
970
  alm.preloaded_amount = 0; // Reset
971
- alm.AjaxLoadMore.success(data); // Skip post loading and go right to success() for display
972
 
973
  }else{
974
 
 
1
  /*
2
  * Ajax Load More
3
  * http://wordpress.org/plugins/ajax-load-more/
24
  var alm = this;
25
  alm.AjaxLoadMore = {};
26
  alm.page = 0;
 
27
  alm.proceed = false;
28
  alm.disable_ajax = false;
29
  alm.init = true;
60
  alm.pause = alm.content.attr('data-pause'); // true | false
61
  alm.transition = alm.content.attr('data-transition');
62
  alm.transition_container = alm.content.attr('data-transition-container');
63
+ alm.speed = alm.content.attr('data-transition-speed')
64
  alm.images_loaded = alm.content.attr('data-images-loaded');
65
  alm.destroy_after = alm.content.attr('data-destroy-after');
66
  alm.lang = alm.content.attr('data-lang');
156
  }
157
  if (alm.seo === 'true'){
158
  alm.seo = true; // Convert string to boolean
159
+ }
160
+ if($(".ajax-load-more-wrap").length > 1){
161
+ alm.seo = false;
162
+ }
163
 
164
  alm.permalink = alm.content.attr('data-seo-permalink');
165
  alm.pageview = alm.content.attr('data-seo-pageview');
257
  }
258
 
259
 
260
+ /* Transition Params */
261
  if (alm.transition === undefined){
262
  alm.transition = 'slide';
263
  }else if (alm.transition === "fade"){
266
  alm.transition = 'none';
267
  }else {
268
  alm.transition = 'slide';
269
+ }
270
+
271
+ if (alm.speed === undefined){
272
+ alm.speed = 250;
273
+ } else{
274
+ alm.speed = parseInt(alm.speed);
275
+ }
276
 
277
  if (alm.transition_container === undefined || alm.transition_container === 'true'){
278
  alm.transition_container = true;
372
  var cachePage = alm.cache_path + '/page-' + alm.page +'.html';
373
 
374
  $.get(cachePage, function( data ) {
375
+ alm.AjaxLoadMore.success(data, true); // data contains whatever the request has returned
376
  }).fail(function() {
377
  alm.AjaxLoadMore.ajax('standard');
378
  });
407
  // If this is a comment query
408
  if(alm.comments === 'true'){
409
  action = 'alm_comments_query';
410
+ alm.posts_per_page = alm.comments_per_page;
 
411
  alm.comments_array = {
412
  'comments': 'true',
413
  'post_id': alm.comments_post_id,
429
  'alternate_repeater': alm.alternate_repeater,
430
  'alternate_theme_repeater': alm.alternate_theme_repeater,
431
  };
432
+ }
433
 
434
  $.ajax({
435
  type: "GET",
481
  previous_post_taxonomy: alm.previous_post_taxonomy,
482
  lang: alm.lang,
483
  slug: alm.slug,
484
+ canonical_url: alm.canonical_url,
485
  },
486
+ dataType: "JSON",
487
  // parse the data as html
488
  beforeSend: function () {
489
  if (alm.page != 1 && !alm.paging) {
492
  },
493
  success: function (data) {
494
  if(queryType === 'standard'){
495
+ alm.AjaxLoadMore.success(data, false);
496
  }
497
  else if(queryType === 'totalposts' && alm.paging){
498
  if($.isFunction($.fn.almBuildPagination)){
520
  * @since 2.6.0
521
  */
522
 
523
+ alm.AjaxLoadMore.success = function (data, is_cache) {
524
 
525
  if(alm.previous_post){ // Get previous page data
526
  alm.AjaxLoadMore.getPreviousPost();
527
  }
528
+ var html;
529
+
530
+ if(!is_cache){
531
+ html = data.html;
532
+ }else{
533
+ html = data; // If is cache, don't look for json data
534
+ }
535
+
536
+ alm.data = $(html); // Convert data to an object
537
 
 
538
  if (alm.init) {
539
  if(!alm.paging){
540
 
543
  } else {
544
 
545
  // Is pagination
546
+ if (alm.data.length > 0) {
547
  alm.el = $('<div class="alm-reveal"/>');
548
  alm.el.append('<div class="alm-paging-content"></div><div class="alm-paging-loading"></div>');
549
  $('.alm-paging-content', alm.el).append(alm.data).hide();
582
  if(!alm.paging){
583
 
584
  if(alm.previous_post){ // If Previous Post, create container and append data
585
+
586
  alm.el = $('<div class="alm-reveal alm-previous-post post-'+alm.previous_post_id+'" data-id="'+alm.previous_post_id+'" data-title="'+alm.previous_post_title+'" data-url="'+alm.previous_post_permalink+'"/>');
587
+ alm.el.append(alm.data).hide();
588
+
589
  }else{
590
+
591
+ if(!alm.transition_container){
592
+ // If transiton container == false
593
  alm.data.hide();
594
  alm.el = alm.data;
595
+
596
+ }else{
597
+ // Standard transition container
598
+
599
+ // if start_page is > 1
600
+ // - loop through items and break them separate alm-reveal divs
601
+ if (alm.init && alm.start_page > 1){
602
+
603
+ var data = [];
604
+ var size = Math.ceil(alm.data.length/alm.start_page); // slice data array into pages
605
+ //console.log(size);
606
+ for (var i = 0; i < alm.data.length; i += size) {
607
+ data.push(alm.data.slice(i, size + i));
608
+ }
609
+
610
+ alm.el = alm.content; // Set alm.el to be alm-listing div
611
+ for (var k = 0; k < data.length; k++){
612
+
613
+ var p = 0; // Add 1 page if items are preloaded.
614
+ if(alm.preloaded === 'true'){
615
+ p = 1;
616
+ }
617
+
618
+ var div;
619
+ if(k > 0 || alm.preloaded === 'true'){ // > Paged
620
+ var pagenum = (k + 1 + p);
621
+ if(alm.permalink === 'default'){
622
+ div = $('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'&paged='+ pagenum+'" data-page="'+ pagenum +'" />');
623
+ }else{
624
+ div = $('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'page/'+ pagenum +'/" data-page="'+ pagenum +'" />');
625
+ }
626
+ }else{ // First Page
627
+ div = $('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'" data-page="1" />');
628
+ }
629
+ div.append(data[k]);
630
+ div = $(div); // convert to object
631
+ alm.el.append(div).hide(); // Add data to .alm-listing wrapper
632
+ }
633
+ }
634
+
635
+ else {
636
+ // If is SEO and paged, or preloaded.
637
+ if(alm.seo && alm.page > 0 || alm.preloaded === 'true'){
638
+
639
+ var p = 0; // Add 1 page if items are preloaded.
640
+ if(alm.preloaded === 'true'){
641
+ p = 1;
642
+ }
643
+ // SEO [Paged]
644
+ var pagenum = (alm.page + 1 + p);
645
+ if(alm.seo){
646
+ if(alm.permalink === 'default'){
647
+ alm.el = $('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'&paged='+ pagenum+'" data-page="'+ pagenum +'" />');
648
+ }else{
649
+ alm.el = $('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'page/'+ pagenum +'/" data-page="'+ pagenum +'" />');
650
+ }
651
+ }else{
652
+ // Basic ALM ****
653
+ alm.el = $('<div class="alm-reveal" />');
654
+ }
655
+
656
+ }else{
657
+ if(alm.seo){
658
+ // SEO [Page 1]
659
+ alm.el = $('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'" data-page="1" />');
660
+ }else{
661
+ // Basic ALM ****
662
+ alm.el = $('<div class="alm-reveal" />');
663
+ }
664
+ }
665
+
666
+ alm.el.append(alm.data).hide();
667
+ }
668
  }
669
  }
670
 
671
  alm.content.append(alm.el);
672
 
673
  if (alm.transition === 'fade') { // Fade transition
 
674
  if(alm.images_loaded === 'true'){
 
675
  alm.el.almWaitForImages().done(function(){
676
  alm.el.fadeIn(alm.speed, 'alm_easeInOutQuad', function () {
677
  alm.loading = false;
685
  alm.button.addClass('done');
686
  }
687
  }
688
+ if ($.isFunction($.fn.almSEO) && alm.seo) { // ALM SEO
689
+ $.fn.almSEO(alm);
690
+ }
691
  });
692
  });
693
  }else{
702
  if(!alm.paging){
703
  alm.button.addClass('done');
704
  }
705
+ }
706
+ if ($.isFunction($.fn.almSEO) && alm.seo) { // ALM SEO
707
+ $.fn.almSEO(alm);
708
+ }
709
  });
710
  }
711
 
712
  }else if(alm.transition === 'none') { // No transition
 
713
  if(alm.images_loaded === 'true'){
 
714
  alm.el.almWaitForImages().done(function(){
715
+ alm.el.show();
716
+ if ($.isFunction($.fn.almSEO) && alm.seo) { // ALM SEO
717
+ $.fn.almSEO(alm);
718
+ }
719
  });
 
720
  }else{
721
+ alm.el.show();
722
+ if ($.isFunction($.fn.almSEO) && alm.seo) { // ALM SEO
723
+ $.fn.almSEO(alm);
724
+ }
725
  }
726
  alm.loading = false;
727
  if(!alm.paging){
734
  alm.button.addClass('done');
735
  }
736
  }
737
+
738
  }else { // Slide transition
739
  if(alm.images_loaded === 'true'){
 
740
  alm.el.almWaitForImages().done(function(){
741
  alm.el.slideDown(alm.speed, 'alm_easeInOutQuad', function () {
742
  alm.loading = false;
749
  if(!alm.paging){
750
  alm.button.addClass('done');
751
  }
752
+ }
753
+ if ($.isFunction($.fn.almSEO) && alm.seo) { // ALM SEO
754
+ $.fn.almSEO(alm);
755
+ }
756
  });
757
  });
758
+ }else{
 
 
759
  alm.el.slideDown(alm.speed, 'alm_easeInOutQuad', function () {
760
  alm.loading = false;
761
  if(!alm.paging){
767
  if(!alm.paging){
768
  alm.button.addClass('done');
769
  }
770
+ }
771
+ if ($.isFunction($.fn.almSEO) && alm.seo) { // ALM SEO
772
+ $.fn.almSEO(alm);
773
+ }
774
  });
 
775
  }
776
  }
777
 
779
 
780
  // Is Paging
781
  if(!alm.init){
 
782
  $('.alm-paging-content', alm.el).html('').append(alm.data).almWaitForImages().done(function(){ // Remove loading class and append data
783
  $('.alm-paging-loading', alm.el).fadeOut(alm.speed); // Fade out loader
784
  if ($.isFunction($.fn.almOnPagingComplete)){
785
  $.fn.almOnPagingComplete(alm);
786
+ }
787
+ if ($.isFunction($.fn.almSEO) && alm.seo) { // ALM SEO
788
+ $.fn.almSEO(alm);
789
+ }
790
  });
 
791
  }
792
  }
793
 
803
  }
804
 
805
  // ALM Done
806
+ // - If data is returned but it's less than the posts per page.
807
  if(alm.data.length < alm.posts_per_page){
808
  if ($.isFunction($.fn.almDone)) {
809
+ // Delay done until after animation
810
+ setTimeout(function(){
811
+ $.fn.almDone(alm)
812
+ }, alm.speed + 10);
813
  }
814
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
815
 
816
  } else {
817
 
821
  }
822
 
823
  // ALM Done
824
+ if ($.isFunction($.fn.almDone) && !alm.init) {
825
  $.fn.almDone(alm);
826
  }
827
 
844
  }
845
  }
846
  }
847
+ alm.init = false;
848
+
849
  };
850
 
851
 
868
  taxonomy: alm.previous_post_taxonomy
869
  },
870
  success: function (data) {
871
+ if(data.has_previous_post){
 
872
  alm.content.attr('data-previous-post-id', data.prev_id); // update previous-post-id on ALM element
873
  alm.previous_post_permalink = data.prev_permalink;
874
  alm.previous_post_title = data.prev_title;
876
  if(!data.has_previous_post){
877
  alm.finished = true;
878
  alm.button.addClass('done');
879
+ if ($.isFunction($.fn.almDone)) { // ALM Done
880
+ $.fn.almDone(alm);
881
+ }
882
  }
883
  }
884
  if($.isFunction($.fn.almSetPreviousPost)){
903
  */
904
  alm.resetBtnText = function(){
905
  if(alm.button_loading_label !== false){ // Reset button text
906
+ if(!alm.paging){
907
+ alm.button.text(alm.button_label);
908
+ }
909
  }
910
  };
911
 
1060
  var data = $('.alm-preloaded', alm.el).html(); // Content of preloaded page
1061
  $('.alm-preloaded', alm.el).remove();
1062
  alm.preloaded_amount = 0; // Reset
1063
+ alm.AjaxLoadMore.success(data, false); // Skip post loading and go right to success() for display
1064
 
1065
  }else{
1066
 
core/js/ajax-load-more.min.js CHANGED
@@ -1,81 +1,1428 @@
1
- (function($){"use strict";$.ajaxloadmore=function(el,e){if(alm_localize.scrolltop==='true'){$(window).scrollTop(0);}
2
- 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.alternate_array='';alm.alternate=alm.content.attr('data-alternate');alm.alternate_sequence=alm.content.attr('data-alternate-sequence');alm.alternate_sequence_max=alm.content.attr('data-alternate-sequence-max');alm.alternate_repeater=alm.content.attr('data-alternate-repeater');alm.alternate_theme_repeater=alm.content.attr('data-alternate-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.transition_container=alm.content.attr('data-transition-container');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);}
3
- 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;}
4
- if(alm.preloaded==='true'){alm.pause=true;}}else{alm.paging=false;}
5
- if(alm.paging_controls==='true'){alm.paging_controls=true;}else{alm.paging_controls=false;}
6
- if(alm.cache===undefined){alm.cache=false;}
7
- if(alm.cache_logged_in===undefined){alm.cache_logged_in=false;}
8
- if(alm.comments_per_page===undefined){alm.comments_per_page='5';}
9
- if(alm.preloaded==='true'){alm.preload_wrap=alm.content.prev('.alm-preloaded');alm.total_posts=parseInt(alm.preload_wrap.attr('data-total-posts'));if(alm.preloaded_amount===undefined){alm.preloaded_amount=false;}
10
- if(alm.total_posts<=alm.preloaded_amount){alm.disable_ajax=true;}}else{alm.preloaded='false';}
11
- if(alm.seo===undefined){alm.seo=false;}
12
- if(alm.seo==='true'){alm.seo=true;}
13
- alm.permalink=alm.content.attr('data-seo-permalink');alm.pageview=alm.content.attr('data-seo-pageview');alm.start_page=alm.content.attr('data-seo-start-page');if(alm.start_page){alm.seo_scroll=alm.content.attr('data-seo-scroll');alm.seo_scroll_speed=alm.content.attr('data-seo-scroll-speed');alm.seo_scrolltop=alm.content.attr('data-seo-scrolltop');alm.isPaged=false;if(alm.start_page>1){alm.isPaged=true;alm.posts_per_page=alm.start_page*alm.posts_per_page;}
14
- if(alm.paging){alm.posts_per_page=alm.orginal_posts_per_page;}}else{alm.start_page=1;}
15
- if(alm.previous_post==='true'){alm.previous_post=true;alm.previous_post_permalink='';alm.previous_post_title='';}else{alm.previous_post=false;}
16
- if(alm.previous_post_id===undefined){alm.previous_post_id='';}
17
- if(alm.previous_post_taxonomy===undefined){alm.previous_post_taxonomy='';}
18
- alm.previous_post_title_template=alm.content.attr('data-previous-post-title-template');alm.siteTitle=alm.content.attr('data-previous-post-site-title');alm.siteTagline=alm.content.attr('data-previous-post-site-tagline');alm.previous_post_pageview=alm.content.attr('data-previous-post-pageview');alm.previous_post_scroll=alm.content.attr('data-previous-post-scroll');alm.previous_post_scroll_speed=alm.content.attr('data-previous-post-scroll-speed');alm.previous_post_scroll_top=alm.content.attr('data-previous-post-scrolltop');if(alm.content.attr('data-offset')===undefined){alm.offset=0;}else{alm.offset=alm.content.attr('data-offset');}
19
- if(alm.pause===undefined||(alm.seo&&alm.start_page>1)){alm.pause=false;}
20
- if(alm.preloaded==='true'&&alm.seo&&alm.start_page>0){alm.pause=false;}
21
- if(alm.repeater===undefined){alm.repeater='default';}
22
- if(alm.theme_repeater===undefined){alm.theme_repeater='null';}
23
- if(alm.max_pages===undefined){alm.max_pages=5;}
24
- if(alm.max_pages===0){alm.max_pages=10000;}
25
- if(alm.scroll_distance===undefined){alm.scroll_distance=150;}
26
- if(alm.transition===undefined){alm.transition='slide';}else if(alm.transition==="fade"){alm.transition='fade';}else if(alm.transition==="none"){alm.transition='none';}else{alm.transition='slide';}
27
- if(alm.transition_container===undefined||alm.transition_container==='true'){alm.transition_container=true;}else{alm.transition_container=false;}
28
- if(alm.images_loaded===undefined){alm.images_loaded='false';}
29
- if(alm.destroy_after!==undefined){}
30
- if(alm.content.attr('data-button-label')===undefined){alm.button_label='Older Posts';}else{alm.button_label=alm.content.attr('data-button-label');}
31
- alm.button_loading_label=alm.content.attr('data-button-loading-label');if(alm.button_loading_label===undefined){alm.button_loading_label=false;}
32
- if(alm.content.attr('data-button-class')===undefined){alm.button_class='';}else{alm.button_class=' '+alm.content.attr('data-button-class');}
33
- if(alm.content.attr('data-scroll')===undefined){alm.scroll=true;}else if(alm.content.attr('data-scroll')==='false'){alm.scroll=false;}else{alm.scroll=true;}
34
- alm.post_type=alm.content.attr('data-post-type');alm.post_type=alm.post_type.split(",");alm.container.append('<div class="'+alm.prefix+'btn-wrap"/>');alm.btnWrap=$('.'+alm.prefix+'btn-wrap',alm.container);if(alm.paging){alm.content.parent().addClass('loading');}else{$('.'+alm.prefix+'btn-wrap',alm.container).append('<button id="load-more" class="'+alm.prefix+'load-more-btn more'+alm.button_class+'">'+alm.button_label+'</button>');alm.button=$('.alm-load-more-btn',alm.container);}
35
- 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);}}
36
- 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');}
37
- 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,};}
38
- if(alm.alternate==='true'){alm.alternate_array={'alternate':'true','alternate_sequence':alm.alternate_sequence,'alternate_sequence_max':alm.alternate_sequence_max,'alternate_repeater':alm.alternate_repeater,'alternate_theme_repeater':alm.alternate_theme_repeater,};}
39
- $.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,alternate:alm.alternate_array,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);}
40
- 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');}
41
- alm.AjaxLoadMore.success=function(data){if(alm.previous_post){alm.AjaxLoadMore.getPreviousPost();}
42
- 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);}});}}
43
- if(alm.data.length===0){if($.isFunction($.fn.almEmpty)){$.fn.almEmpty(alm);}}
44
- if(alm.isPaged){alm.posts_per_page=alm.content.attr('data-posts-per-page');alm.page=alm.start_page-1;}}
45
- if(alm.data.length>0){if(!alm.paging){if(alm.previous_post){alm.el=$('<div class="alm-reveal alm-previous-post post-'+alm.previous_post_id+'" data-id="'+alm.previous_post_id+'" data-title="'+alm.previous_post_title+'" data-url="'+alm.previous_post_permalink+'"/>');alm.el.append(alm.data).hide();}else{if(!alm.transition_container){alm.data.hide();alm.el=alm.data;}else{alm.el=$('<div class="alm-reveal"/>');alm.el.append(alm.data).hide();}}
46
- alm.content.append(alm.el);if(alm.transition==='fade'){if(alm.images_loaded==='true'){alm.el.almWaitForImages().done(function(){alm.el.fadeIn(alm.speed,'alm_easeInOutQuad',function(){alm.loading=false;if(!alm.paging){alm.button.delay(alm.speed).removeClass('loading');alm.resetBtnText();}
47
- if(alm.data.length<alm.posts_per_page){alm.finished=true;if(!alm.paging){alm.button.addClass('done');}}});});}else{alm.el.fadeIn(alm.speed,'alm_easeInOutQuad',function(){alm.loading=false;if(!alm.paging){alm.button.delay(alm.speed).removeClass('loading');alm.resetBtnText();}
48
- if(alm.data.length<alm.posts_per_page){alm.finished=true;if(!alm.paging){alm.button.addClass('done');}}});}}else if(alm.transition==='none'){if(alm.images_loaded==='true'){alm.el.almWaitForImages().done(function(){alm.el.show();});}else{alm.el.show();}
49
- alm.loading=false;if(!alm.paging){alm.button.delay(alm.speed).removeClass('loading');alm.resetBtnText();}
50
- if(alm.data.length<alm.posts_per_page){alm.finished=true;if(!alm.paging){alm.button.addClass('done');}}}else{if(alm.images_loaded==='true'){alm.el.almWaitForImages().done(function(){alm.el.slideDown(alm.speed,'alm_easeInOutQuad',function(){alm.loading=false;if(!alm.paging){alm.button.delay(alm.speed).removeClass('loading');alm.resetBtnText();}
51
- if(alm.data.length<alm.posts_per_page){alm.finished=true;if(!alm.paging){alm.button.addClass('done');}}});});}else{alm.el.slideDown(alm.speed,'alm_easeInOutQuad',function(){alm.loading=false;if(!alm.paging){alm.button.delay(alm.speed).removeClass('loading');alm.resetBtnText();}
52
- if(alm.data.length<alm.posts_per_page){alm.finished=true;if(!alm.paging){alm.button.addClass('done');}}});}}}else{if(!alm.init){$('.alm-paging-content',alm.el).html('').append(alm.data).almWaitForImages().done(function(){$('.alm-paging-loading',alm.el).fadeOut(alm.speed);if($.isFunction($.fn.almOnPagingComplete)){$.fn.almOnPagingComplete(alm);}});}}
53
- if($.isFunction($.fn.almComplete)){if(alm.images_loaded==='true'){alm.el.almWaitForImages().done(function(){$.fn.almComplete(alm);});}else{$.fn.almComplete(alm);}}
54
- if(alm.data.length<alm.posts_per_page){if($.isFunction($.fn.almDone)){$.fn.almDone(alm);}}
55
- if($(".ajax-load-more-wrap").length===1){if($.isFunction($.fn.almSEO)&&alm.seo){if(alm.images_loaded==='true'){alm.el.almWaitForImages().done(function(){$.fn.almSEO(alm);});}else{$.fn.almSEO(alm);}}}}else{if(!alm.paging){alm.button.delay(alm.speed).removeClass('loading').addClass('done');alm.resetBtnText();}
56
- if($.isFunction($.fn.almDone)){$.fn.almDone(alm);}
57
- alm.loading=false;alm.finished=true;}
58
- if(alm.destroy_after!==undefined&&alm.destroy_after!==''){var currentPage=alm.page+1;if(alm.preload){currentPage++;}
59
- if(currentPage==alm.destroy_after){alm.disable_ajax=true;if(!alm.paging){alm.button.delay(alm.speed).fadeOut(alm.speed);}}}
60
- alm.init=false;};alm.fetchingPreviousPost=false;alm.AjaxLoadMore.getPreviousPost=function(){alm.fetchingPreviousPost=true;$.ajax({type:"GET",dataType:"JSON",url:alm_localize.ajaxurl,data:{action:'alm_query_previous_post',id:alm.previous_post_id,taxonomy:alm.previous_post_taxonomy},success:function(data){if(data.has_previous_post){alm.content.attr('data-previous-post-id',data.prev_id);alm.previous_post_permalink=data.prev_permalink;alm.previous_post_title=data.prev_title;}else{if(!data.has_previous_post){alm.finished=true;alm.button.addClass('done');}}
61
- if($.isFunction($.fn.almSetPreviousPost)){$.fn.almSetPreviousPost(alm,data.current_id,data.permalink,data.title);}
62
- alm.fetchingPreviousPost=false;},error:function(jqXHR,textStatus,errorThrown){alm.AjaxLoadMore.error(jqXHR,textStatus,errorThrown);alm.fetchingPreviousPost=false;}});};alm.resetBtnText=function(){if(alm.button_loading_label!==false){alm.button.text(alm.button_label);}};alm.AjaxLoadMore.error=function(jqXHR,textStatus,errorThrown){alm.loading=false;if(!alm.paging){alm.button.removeClass('loading');alm.resetBtnText();}
63
- console.log(errorThrown);};if(!alm.paging&&!alm.fetchingPreviousPost){alm.button.on('click',function(){if(alm.pause==='true'){alm.pause=false;alm.pause_override=false;alm.AjaxLoadMore.loadPosts();}
64
- if(!alm.loading&&!alm.finished&&!$(this).hasClass('done')){alm.loading=true;alm.page++;alm.AjaxLoadMore.loadPosts();}});}
65
- if(alm.paging){alm.window.resize(function(){if($.isFunction($.fn.almOnWindowResize)){setTimeout(function(){$.fn.almOnWindowResize(alm);},250);}});}
66
- alm.AjaxLoadMore.isVisible=function(){alm.visible=false;if(alm.el.is(":visible")){alm.visible=true;}
67
- return alm.visible;};if(alm.scroll&&!alm.paging){alm.window.bind("scroll touchstart",function(){if(alm.AjaxLoadMore.isVisible()&&!alm.fetchingPreviousPost){var content_offset=alm.button.offset(),top=Math.round(content_offset.top-(alm.window.height()-alm.scroll_distance));if(!alm.loading&&!alm.finished&&(alm.window.scrollTop()>=top)&&alm.page<(alm.max_pages-1)&&alm.proceed&&alm.pause==='true'&&alm.pause_override==='true'){alm.button.trigger('click');}
68
- else{if(!alm.loading&&!alm.finished&&(alm.window.scrollTop()>=top)&&alm.page<(alm.max_pages-1)&&alm.proceed&&alm.pause!=='true'){alm.page++;alm.AjaxLoadMore.loadPosts();}}}});}
69
- if(!alm.paging&&!alm.previous_post){if(alm.disable_ajax){alm.finished=true;alm.button.addClass('done');}else{if(alm.pause==='true'){alm.button.text(alm.button_label);alm.loading=false;}else{alm.AjaxLoadMore.loadPosts();}}}
70
- if(alm.previous_post){alm.AjaxLoadMore.getPreviousPost();alm.loading=false;}
71
- setTimeout(function(){alm.proceed=true;},500);$.fn.almUpdateCurrentPage=function(current,alm_paging_init){alm.page=current;if(alm_paging_init&&alm.preloaded==='true'){var data=$('.alm-preloaded',alm.el).html();$('.alm-preloaded',alm.el).remove();alm.preloaded_amount=0;alm.AjaxLoadMore.success(data);}else{alm.AjaxLoadMore.loadPosts();}};$.fn.almGetParentContainer=function(){return alm.el.closest('#ajax-load-more');};$.fn.almGetObj=function(){return alm;};$.easing.alm_easeInOutQuad=function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}
72
- return-c/2*((--t)*(t-2)-1)+b;};};$.fn.almFilter=function(transition,speed,data){$(".ajax-load-more-wrap").each(function(e){var el=$(this);if(transition==='slide'){el.slideUp(speed,function(){$('.alm-listing',el).html('');$('.alm-btn-wrap',el).remove();el.fadeIn(speed);$.fn.almSetFilters(el,data);});}else if(transition==='fade'){el.fadeOut(speed,function(){$('.alm-listing',el).html('');$('.alm-btn-wrap',el).remove();el.fadeIn(speed);$.fn.almSetFilters(el,data);});}else{$('.alm-listing',el).html('');$('.alm-btn-wrap',el).remove();el.fadeIn(speed);$.fn.almSetFilters(el,data);}});};$.fn.almSetFilters=function(el,data){$.each(data,function(key,value){key=key.replace(/\W+/g,'-').replace(/([a-z\d])([A-Z])/g,'$1-$2');$('.alm-listing',el).attr('data-'+key,value);});if($.isFunction($.fn.almFilterComplete)){$.fn.almFilterComplete();}
73
- $(".ajax-load-more-wrap").ajaxloadmore();};$.fn.ajaxloadmore=function(){return this.each(function(e){$(this).data('alm',new $.ajaxloadmore($(this),e));});};if($(".ajax-load-more-wrap").length){$(".ajax-load-more-wrap").ajaxloadmore();}})(jQuery);;(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'){module.exports=factory(require('jquery'));}else{factory(jQuery);}}(function($){var eventNamespace='almWaitForImages';$.almWaitForImages={hasImageProperties:['backgroundImage','listStyleImage','borderImage','borderCornerImage','cursor'],hasImageAttributes:['srcset']};$.expr[':']['has-src']=function(obj){return $(obj).is('img[src][src!=""]');};$.expr[':'].uncached=function(obj){if(!$(obj).is(':has-src')){return false;}
74
- return!obj.complete;};$.fn.almWaitForImages=function(){var allImgsLength=0;var allImgsLoaded=0;var deferred=$.Deferred();var finishedCallback;var eachCallback;var waitForAll;if($.isPlainObject(arguments[0])){waitForAll=arguments[0].waitForAll;eachCallback=arguments[0].each;finishedCallback=arguments[0].finished;}else{if(arguments.length===1&&$.type(arguments[0])==='boolean'){waitForAll=arguments[0];}else{finishedCallback=arguments[0];eachCallback=arguments[1];waitForAll=arguments[2];}}
75
- finishedCallback=finishedCallback||$.noop;eachCallback=eachCallback||$.noop;waitForAll=!!waitForAll;if(!$.isFunction(finishedCallback)||!$.isFunction(eachCallback)){throw new TypeError('An invalid callback was supplied.');}
76
- this.each(function(){var obj=$(this);var allImgs=[];var hasImgProperties=$.almWaitForImages.hasImageProperties||[];var hasImageAttributes=$.almWaitForImages.hasImageAttributes||[];var matchUrl=/url\(\s*(['"]?)(.*?)\1\s*\)/g;if(waitForAll){obj.find('*').addBack().each(function(){var element=$(this);if(element.is('img:has-src')){allImgs.push({src:element.attr('src'),element:element[0]});}
77
- $.each(hasImgProperties,function(i,property){var propertyValue=element.css(property);var match;if(!propertyValue){return true;}
78
- while(match=matchUrl.exec(propertyValue)){allImgs.push({src:match[2],element:element[0]});}});$.each(hasImageAttributes,function(i,attribute){var attributeValue=element.attr(attribute);var attributeValues;if(!attributeValue){return true;}
79
- attributeValues=attributeValue.split(',');$.each(attributeValues,function(i,value){value=$.trim(value).split(' ')[0];allImgs.push({src:value,element:element[0]});});});});}else{obj.find('img:has-src').each(function(){allImgs.push({src:this.src,element:this});});}
80
- allImgsLength=allImgs.length;allImgsLoaded=0;if(allImgsLength===0){finishedCallback.call(obj[0]);deferred.resolveWith(obj[0]);}
81
- $.each(allImgs,function(i,img){var image=new Image();var events='load.'+eventNamespace+' error.'+eventNamespace;$(image).one(events,function me(event){var eachArguments=[allImgsLoaded,allImgsLength,event.type=='load'];allImgsLoaded++;eachCallback.apply(img.element,eachArguments);deferred.notifyWith(img.element,eachArguments);$(this).off(events,me);if(allImgsLoaded==allImgsLength){finishedCallback.call(obj[0]);deferred.resolveWith(obj[0]);return false;}});image.src=img.src;});});return deferred.promise();};}));