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 | 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 +74 -54
- admin/admin.php +1 -1
- admin/css/admin.css +10 -3
- admin/img/add.png +0 -0
- admin/includes/cta/about.php +4 -3
- admin/includes/cta/reviews.php +1 -1
- admin/shortcode-builder/js/shortcode-builder.js +4 -1
- admin/shortcode-builder/shortcode-builder.php +16 -1
- admin/views/settings.php +1 -1
- ajax-load-more.php +128 -41
- core/js/ajax-load-more.js +155 -63
- core/js/ajax-load-more.min.js +1428 -81
- lang/ajax-load-more.pot +46 -33
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:
|
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
|
18 |
|
19 |
-
|
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
|
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](
|
31 |
|
32 |
***
|
33 |
|
34 |
= Content Types =
|
35 |
-
Ajax Load More
|
36 |
|
37 |
-
|
|
|
|
|
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
|
49 |
|
50 |
-
* **repeater** - Choose a repeater template (<a href="
|
51 |
-
* **theme_repeater** - Select from a list of template files in your current theme directory (<a href="
|
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 |
-
* **
|
|
|
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="
|
95 |
-
* **cache_id** - A unique 10 digit ID for the cached query. <a href="
|
96 |
-
* **seo** - Enable address bar URL rewrites as users page through content - <a href="
|
97 |
-
* **preloaded** - Should Ajax Load More preload posts? <a href="
|
98 |
-
* **preloaded_amount** - The amount of posts to preload. <a href="
|
99 |
-
* **paging** - Replace infinite scrolling with a paged navigation system. <a href="
|
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](
|
115 |
-
* **[Destroy After](
|
116 |
-
* **[Fade Transition](
|
117 |
-
* **[Filtering](
|
118 |
-
* **[Infinite Scroll](
|
119 |
-
* **[Images Loaded](
|
120 |
-
* **[Masonry](
|
121 |
-
* **[Multiple Instances](
|
122 |
-
* **[Paging URLs](
|
123 |
-
* **[Pause Loading](
|
124 |
-
* **[Preloaded Posts](
|
125 |
-
* **[Search Results](
|
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 |
-
|
|
|
|
|
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](
|
141 |
-
> [Get More Information](
|
142 |
>
|
143 |
> #### Comments
|
144 |
-
> The **[Comments](
|
145 |
-
> [Get More Information](
|
146 |
>
|
147 |
> #### Custom Repeaters
|
148 |
-
> The **[Custom Repeaters](
|
149 |
-
> [Get More Information](
|
150 |
>
|
151 |
> #### Layouts
|
152 |
-
> The **[Layouts](
|
153 |
-
> [Get More Information](
|
154 |
>
|
155 |
> #### Paging
|
156 |
-
> The **[Paging](
|
157 |
-
> [Get More Information](
|
158 |
>
|
159 |
> #### Preloaded
|
160 |
-
> The **[Preloaded](
|
161 |
-
> [Get More Information](
|
162 |
>
|
163 |
> #### Previous Post
|
164 |
-
> The **[Previous Post](
|
165 |
-
> [Get More Information](
|
166 |
>
|
167 |
> #### Search Engine Optimization
|
168 |
-
> The **[SEO](
|
169 |
-
> [Get More Information](
|
170 |
>
|
171 |
> #### Theme Repeaters
|
172 |
-
> The **[Theme Repeaters](
|
173 |
-
> [Get More Information](
|
174 |
|
175 |
***
|
176 |
|
@@ -235,13 +241,13 @@ Ajax Load More passes the following PHP [variables](https://connekthq.com/plugin
|
|
235 |
***
|
236 |
|
237 |
= Website =
|
238 |
-
|
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](
|
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 (
|
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 -
|
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 (
|
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">
|
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: #
|
1409 |
color: #777;
|
1410 |
-
border: 1px
|
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/
|
6 |
-
<li><strong><a target="blank" href="https://
|
7 |
-
<li><strong><a target="blank" href="https://
|
|
|
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
|
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
|
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.
|
11 |
License: GPL
|
12 |
Copyright: Darren Cooney & Connekt Media
|
13 |
-
|
|
|
14 |
|
15 |
|
16 |
-
define('ALM_VERSION', '2.
|
17 |
-
define('ALM_RELEASE', '
|
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'),
|
246 |
-
wp_register_script( 'ajax-load-more', plugins_url( '/core/js/ajax-load-more.min.js', __FILE__ ), array('jquery'),
|
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(
|
287 |
|
288 |
global $post;
|
289 |
$options = get_option( 'alm_settings' ); // Get ALM Settings
|
290 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
463 |
-
|
464 |
$ajaxloadmore .= apply_filters('alm_before_container', ''); // ALM Core Filter Hook
|
465 |
-
|
466 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
$
|
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 |
-
|
1213 |
-
|
1214 |
-
|
|
|
|
|
|
|
|
|
|
|
1215 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1216 |
endif;
|
1217 |
|
1218 |
}elseif($queryType === 'totalposts'){
|
1219 |
echo $alm_total_posts;
|
1220 |
}
|
1221 |
-
|
|
|
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 |
-
/*
|
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: "
|
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){
|
|
|
574 |
alm.data.hide();
|
575 |
alm.el = alm.data;
|
576 |
-
|
577 |
-
|
578 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
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 |
-
|
|
|
|
|
|
|
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 |
-
|
|
|
|
|
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 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
if(
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
alm.
|
32 |
-
|
33 |
-
|
34 |
-
alm.
|
35 |
-
alm.
|
36 |
-
alm.
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
alm.
|
42 |
-
alm.
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
alm.
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
alm.
|
58 |
-
|
59 |
-
|
60 |
-
alm.
|
61 |
-
|
62 |
-
alm.
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
alm.
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Ajax Load More
|
3 |
+
* http://wordpress.org/plugins/ajax-load-more/
|
4 |
+
* https://connekthq.com/plugins/ajax-load-more/
|
5 |
+
*
|
6 |
+
* Copyright 2016 Connekt Media - https://connekthq.com
|
7 |
+
* Free to use under the GPLv2 license.
|
8 |
+
* http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
+
*
|
10 |
+
* Author: Darren Cooney
|
11 |
+
* Twitter: @KaptonKaos
|
12 |
+
*/
|
13 |
+
|
14 |
+
(function ($) {
|
15 |
+
"use strict";
|
16 |
+
|
17 |
+
$.ajaxloadmore = function (el, e) {
|
18 |
+
|
19 |
+
//Prevent loading of unnessasry posts - move user to top of page
|
20 |
+
if(alm_localize.scrolltop === 'true'){
|
21 |
+
$(window).scrollTop(0);
|
22 |
+
}
|
23 |
+
//Set variables
|
24 |
+
var alm = this;
|
25 |
+
alm.AjaxLoadMore = {};
|
26 |
+
alm.page = 0;
|
27 |
+
alm.proceed = false;
|
28 |
+
alm.disable_ajax = false;
|
29 |
+
alm.init = true;
|
30 |
+
alm.loading = true;
|
31 |
+
alm.finished = false;
|
32 |
+
alm.window = $(window);
|
33 |
+
alm.button_label = '';
|
34 |
+
alm.data;
|
35 |
+
alm.el = el;
|
36 |
+
alm.container = el;
|
37 |
+
alm.container.addClass('alm-'+e).attr('data-id', e); // Add unique classname and data id
|
38 |
+
alm.content = $('.alm-ajax', alm.container);
|
39 |
+
alm.content_preloaded = $('.alm-listing.alm-preloaded', alm.container);
|
40 |
+
alm.canonical_url = alm.el.attr('data-canonical-url');
|
41 |
+
alm.slug = alm.el.attr('data-slug');
|
42 |
+
alm.prefix = 'alm-';
|
43 |
+
alm.cache = alm.content.attr('data-cache'); // cache (true/false)
|
44 |
+
alm.cache_id = alm.content.attr('data-cache-id'); // cache value
|
45 |
+
alm.cache_path = alm.content.attr('data-cache-path'); // cache path
|
46 |
+
alm.cache_logged_in = alm.content.attr('data-cache-logged-in'); // cache logged in (settings)
|
47 |
+
alm.repeater = alm.content.attr('data-repeater');
|
48 |
+
alm.theme_repeater = alm.content.attr('data-theme-repeater');
|
49 |
+
|
50 |
+
alm.alternate_array = '';
|
51 |
+
alm.alternate = alm.content.attr('data-alternate'); // is Alternating Templates enabled?
|
52 |
+
alm.alternate_sequence = alm.content.attr('data-alternate-sequence');
|
53 |
+
alm.alternate_sequence_max = alm.content.attr('data-alternate-sequence-max');
|
54 |
+
alm.alternate_repeater = alm.content.attr('data-alternate-repeater');
|
55 |
+
alm.alternate_theme_repeater = alm.content.attr('data-alternate-theme-repeater');
|
56 |
+
|
57 |
+
alm.scroll_distance = parseInt(alm.content.attr('data-scroll-distance'));
|
58 |
+
alm.max_pages = parseInt(alm.content.attr('data-max-pages'));
|
59 |
+
alm.pause_override = alm.content.attr('data-pause-override'); // true | false
|
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');
|
67 |
+
alm.orginal_posts_per_page = alm.content.attr('data-posts-per-page'); // Used for paging add-on
|
68 |
+
alm.posts_per_page = alm.content.attr('data-posts-per-page');
|
69 |
+
|
70 |
+
alm.previous_post = alm.content.attr('data-previous-post'); // Next Post add-on
|
71 |
+
alm.previous_post_id = alm.content.attr('data-previous-post-id'); // Get the post id
|
72 |
+
alm.previous_post_taxonomy = alm.content.attr('data-previous-post-taxonomy'); // Get the post taxonomy
|
73 |
+
|
74 |
+
alm.comments = alm.content.attr('data-comments'); // true | false
|
75 |
+
// if comments, then set alm.content to comments wrap
|
76 |
+
if(alm.comments === 'true'){
|
77 |
+
alm.content = $('.alm-comments', alm.container);
|
78 |
+
}
|
79 |
+
alm.comments_array = '';
|
80 |
+
alm.comments_post_id = alm.content.attr('data-comments_post_id'); // current post id
|
81 |
+
alm.comments_per_page = alm.content.attr('data-comments_per_page');
|
82 |
+
alm.comments_type = alm.content.attr('data-comments_type');
|
83 |
+
alm.comments_style = alm.content.attr('data-comments_style');
|
84 |
+
alm.comments_template = alm.content.attr('data-comments_template');
|
85 |
+
alm.comments_callback = alm.content.attr('data-comments_callback');
|
86 |
+
|
87 |
+
alm.seo = alm.content.attr('data-seo'); // true | false
|
88 |
+
|
89 |
+
alm.preloaded = alm.content.attr('data-preloaded'); // true | false
|
90 |
+
alm.preloaded_amount = alm.content.attr('data-preloaded-amount'); // 0 - ?
|
91 |
+
|
92 |
+
alm.paging = alm.content.attr('data-paging'); // is paging enabled
|
93 |
+
alm.paging_controls = alm.content.attr('data-paging-controls');
|
94 |
+
alm.paging_show_at_most = alm.content.attr('data-paging-show-at-most');
|
95 |
+
alm.paging_classes = alm.content.attr('data-paging-classes');
|
96 |
+
|
97 |
+
|
98 |
+
/* Paging */
|
99 |
+
if(alm.paging === 'true'){
|
100 |
+
alm.paging = true;
|
101 |
+
if(alm.paging_show_at_most === undefined){
|
102 |
+
alm.paging_show_at_most = 7;
|
103 |
+
}
|
104 |
+
// if paging and preload then pause.
|
105 |
+
if(alm.preloaded === 'true'){
|
106 |
+
alm.pause = true;
|
107 |
+
}
|
108 |
+
}else{
|
109 |
+
alm.paging = false;
|
110 |
+
}
|
111 |
+
|
112 |
+
if(alm.paging_controls === 'true'){
|
113 |
+
alm.paging_controls = true;
|
114 |
+
}else{
|
115 |
+
alm.paging_controls = false;
|
116 |
+
}
|
117 |
+
/* /end Paging */
|
118 |
+
|
119 |
+
|
120 |
+
/* Cache */
|
121 |
+
if (alm.cache === undefined){
|
122 |
+
alm.cache = false;
|
123 |
+
}
|
124 |
+
|
125 |
+
if (alm.cache_logged_in === undefined){
|
126 |
+
alm.cache_logged_in = false;
|
127 |
+
}
|
128 |
+
/* /end Cache */
|
129 |
+
|
130 |
+
/* Comments */
|
131 |
+
if (alm.comments_per_page === undefined){
|
132 |
+
alm.comments_per_page = '5';
|
133 |
+
}
|
134 |
+
/* /end Comments
|
135 |
+
|
136 |
+
/* Preloaded */
|
137 |
+
/* Check preloaded posts to ensure posts_per_page > alm.total_posts - if posts_per_page <= total_posts disable ajax load more */
|
138 |
+
if (alm.preloaded === 'true'){
|
139 |
+
alm.preload_wrap = alm.content.prev('.alm-preloaded');
|
140 |
+
alm.total_posts = parseInt(alm.preload_wrap.attr('data-total-posts'));
|
141 |
+
if (alm.preloaded_amount === undefined){
|
142 |
+
alm.preloaded_amount = false;
|
143 |
+
}
|
144 |
+
if (alm.total_posts <= alm.preloaded_amount){
|
145 |
+
alm.disable_ajax = true;
|
146 |
+
}
|
147 |
+
}else{
|
148 |
+
alm.preloaded = 'false';
|
149 |
+
}
|
150 |
+
/* /end Preloaded */
|
151 |
+
|
152 |
+
|
153 |
+
/* SEO */
|
154 |
+
if (alm.seo === undefined){
|
155 |
+
alm.seo = false;
|
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');
|
166 |
+
alm.start_page = alm.content.attr('data-seo-start-page');
|
167 |
+
|
168 |
+
if(alm.start_page){
|
169 |
+
|
170 |
+
alm.seo_scroll = alm.content.attr('data-seo-scroll');
|
171 |
+
alm.seo_scroll_speed = alm.content.attr('data-seo-scroll-speed');
|
172 |
+
alm.seo_scrolltop = alm.content.attr('data-seo-scrolltop');
|
173 |
+
|
174 |
+
alm.isPaged = false;
|
175 |
+
|
176 |
+
if (alm.start_page > 1) {
|
177 |
+
alm.isPaged = true; // Is this a $paged page > 1 ?
|
178 |
+
alm.posts_per_page = alm.start_page * alm.posts_per_page;
|
179 |
+
}
|
180 |
+
// If paging is enabled, reset our posts_per_page
|
181 |
+
if(alm.paging){
|
182 |
+
alm.posts_per_page = alm.orginal_posts_per_page;
|
183 |
+
}
|
184 |
+
|
185 |
+
}else{
|
186 |
+
alm.start_page = 1;
|
187 |
+
}
|
188 |
+
/* /end SEO */
|
189 |
+
|
190 |
+
|
191 |
+
/* Previous Post */
|
192 |
+
if (alm.previous_post === 'true'){
|
193 |
+
alm.previous_post = true;
|
194 |
+
alm.previous_post_permalink = '';
|
195 |
+
alm.previous_post_title = '';
|
196 |
+
}else{
|
197 |
+
alm.previous_post = false;
|
198 |
+
}
|
199 |
+
if (alm.previous_post_id === undefined){
|
200 |
+
alm.previous_post_id = '';
|
201 |
+
}
|
202 |
+
if (alm.previous_post_taxonomy === undefined){
|
203 |
+
alm.previous_post_taxonomy = '';
|
204 |
+
}
|
205 |
+
alm.previous_post_title_template = alm.content.attr('data-previous-post-title-template');
|
206 |
+
alm.siteTitle = alm.content.attr('data-previous-post-site-title');
|
207 |
+
alm.siteTagline = alm.content.attr('data-previous-post-site-tagline');
|
208 |
+
alm.previous_post_pageview = alm.content.attr('data-previous-post-pageview');
|
209 |
+
alm.previous_post_scroll = alm.content.attr('data-previous-post-scroll');
|
210 |
+
alm.previous_post_scroll_speed = alm.content.attr('data-previous-post-scroll-speed');
|
211 |
+
alm.previous_post_scroll_top = alm.content.attr('data-previous-post-scrolltop');
|
212 |
+
|
213 |
+
/* /end Previous Post */
|
214 |
+
|
215 |
+
|
216 |
+
/* Define offset */
|
217 |
+
if (alm.content.attr('data-offset') === undefined){
|
218 |
+
alm.offset = 0;
|
219 |
+
}else{
|
220 |
+
alm.offset = alm.content.attr('data-offset');
|
221 |
+
}
|
222 |
+
|
223 |
+
|
224 |
+
/* Check for pause on init
|
225 |
+
* Pause could be used to hold the loading of posts for a button click.
|
226 |
+
*/
|
227 |
+
if (alm.pause === undefined || (alm.seo && alm.start_page > 1)){// SEO only
|
228 |
+
alm.pause = false;
|
229 |
+
}
|
230 |
+
if (alm.preloaded === 'true' && alm.seo && alm.start_page > 0){ // SEO + Preloaded
|
231 |
+
alm.pause = false;
|
232 |
+
}
|
233 |
+
|
234 |
+
|
235 |
+
/* Select the repeater template */
|
236 |
+
if (alm.repeater === undefined){
|
237 |
+
alm.repeater = 'default';
|
238 |
+
}
|
239 |
+
if (alm.theme_repeater === undefined){
|
240 |
+
alm.theme_repeater = 'null';
|
241 |
+
}
|
242 |
+
|
243 |
+
|
244 |
+
/* Max number of pages to load while scrolling */
|
245 |
+
if (alm.max_pages === undefined){
|
246 |
+
alm.max_pages = 5;
|
247 |
+
}
|
248 |
+
|
249 |
+
if (alm.max_pages === 0){
|
250 |
+
alm.max_pages = 10000;
|
251 |
+
}
|
252 |
+
|
253 |
+
|
254 |
+
/* Scroll Distance */
|
255 |
+
if (alm.scroll_distance === undefined){
|
256 |
+
alm.scroll_distance = 150;
|
257 |
+
}
|
258 |
+
|
259 |
+
|
260 |
+
/* Transition Params */
|
261 |
+
if (alm.transition === undefined){
|
262 |
+
alm.transition = 'slide';
|
263 |
+
}else if (alm.transition === "fade"){
|
264 |
+
alm.transition = 'fade';
|
265 |
+
}else if (alm.transition === "none"){
|
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;
|
279 |
+
}else {
|
280 |
+
alm.transition_container = false;
|
281 |
+
}
|
282 |
+
|
283 |
+
|
284 |
+
/* Images Loaded */
|
285 |
+
if (alm.images_loaded === undefined){
|
286 |
+
alm.images_loaded = 'false';
|
287 |
+
}
|
288 |
+
|
289 |
+
|
290 |
+
/* Destroy After */
|
291 |
+
if (alm.destroy_after !== undefined) {}
|
292 |
+
|
293 |
+
|
294 |
+
/* Button Labels */
|
295 |
+
if (alm.content.attr('data-button-label') === undefined){
|
296 |
+
alm.button_label = 'Older Posts';
|
297 |
+
}else{
|
298 |
+
alm.button_label = alm.content.attr('data-button-label');
|
299 |
+
}
|
300 |
+
|
301 |
+
|
302 |
+
alm.button_loading_label = alm.content.attr('data-button-loading-label');
|
303 |
+
if (alm.button_loading_label === undefined){
|
304 |
+
alm.button_loading_label = false;
|
305 |
+
}
|
306 |
+
|
307 |
+
|
308 |
+
/* Button Class */
|
309 |
+
if (alm.content.attr('data-button-class') === undefined){
|
310 |
+
alm.button_class = '';
|
311 |
+
}else{
|
312 |
+
alm.button_class = ' ' + alm.content.attr('data-button-class');
|
313 |
+
}
|
314 |
+
|
315 |
+
/* Define scroll event */
|
316 |
+
if (alm.content.attr('data-scroll') === undefined){
|
317 |
+
alm.scroll = true;
|
318 |
+
}else if (alm.content.attr('data-scroll') === 'false'){
|
319 |
+
alm.scroll = false;
|
320 |
+
}else{
|
321 |
+
alm.scroll = true;
|
322 |
+
}
|
323 |
+
|
324 |
+
/* Parse multiple Post Types */
|
325 |
+
alm.post_type = alm.content.attr('data-post-type');
|
326 |
+
alm.post_type = alm.post_type.split(",");
|
327 |
+
|
328 |
+
|
329 |
+
/* Append 'load More' button to .ajax-load-more-wrap */
|
330 |
+
alm.container.append('<div class="' + alm.prefix + 'btn-wrap"/>');
|
331 |
+
alm.btnWrap = $('.' + alm.prefix + 'btn-wrap', alm.container);
|
332 |
+
if(alm.paging){
|
333 |
+
// Paging add-on
|
334 |
+
alm.content.parent().addClass('loading'); // add loading class to main container
|
335 |
+
}else{
|
336 |
+
|
337 |
+
|
338 |
+
// If paging is false
|
339 |
+
$('.'+ 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>');
|
340 |
+
alm.button = $('.alm-load-more-btn', alm.container);
|
341 |
+
}
|
342 |
+
|
343 |
+
|
344 |
+
|
345 |
+
/* alm.AjaxLoadMore.loadPosts()
|
346 |
+
*
|
347 |
+
* The function to get posts via Ajax
|
348 |
+
* @since 2.0.0
|
349 |
+
*/
|
350 |
+
|
351 |
+
alm.AjaxLoadMore.loadPosts = function () {
|
352 |
+
|
353 |
+
if(!alm.disable_ajax){ // Check for ajax blocker
|
354 |
+
if(!alm.paging){
|
355 |
+
alm.button.addClass('loading');
|
356 |
+
if(alm.button_loading_label !== false){
|
357 |
+
alm.button.text(alm.button_loading_label);
|
358 |
+
}
|
359 |
+
}
|
360 |
+
alm.loading = true;
|
361 |
+
|
362 |
+
// If cache = true && cache_logged_in setting is false
|
363 |
+
if(alm.cache === 'true' && !alm.cache_logged_in){
|
364 |
+
if(alm.init && alm.seo && alm.isPaged){
|
365 |
+
|
366 |
+
// if alm.init = true, SEO = true and SEO page > 1
|
367 |
+
// - skip cache build process because we can't build cache from multiple loaded queries
|
368 |
+
alm.AjaxLoadMore.ajax('standard');
|
369 |
+
|
370 |
+
} else {
|
371 |
+
// Build and/or get cache
|
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 |
+
});
|
379 |
+
}
|
380 |
+
|
381 |
+
} else { // Standard ALM query
|
382 |
+
|
383 |
+
alm.AjaxLoadMore.ajax('standard');
|
384 |
+
|
385 |
+
}
|
386 |
+
}
|
387 |
+
|
388 |
+
};
|
389 |
+
|
390 |
+
|
391 |
+
|
392 |
+
/* alm.AjaxLoadMore.ajax()
|
393 |
+
*
|
394 |
+
* Ajax Load Moe Ajax function
|
395 |
+
* @since 2.6.0
|
396 |
+
*/
|
397 |
+
|
398 |
+
alm.AjaxLoadMore.ajax = function (queryType) {
|
399 |
+
|
400 |
+
if(alm.previous_post){
|
401 |
+
alm.previous_post_id = alm.content.attr('data-previous-post-id');
|
402 |
+
alm.previous_post_taxonomy = alm.content.attr('data-previous-post-taxonomy');
|
403 |
+
}
|
404 |
+
|
405 |
+
var action = 'alm_query_posts';
|
406 |
+
|
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,
|
414 |
+
'per_page': alm.comments_per_page,
|
415 |
+
'type': alm.comments_type,
|
416 |
+
'style': alm.comments_style,
|
417 |
+
'template': alm.comments_template,
|
418 |
+
'callback': alm.comments_callback,
|
419 |
+
};
|
420 |
+
|
421 |
+
}
|
422 |
+
|
423 |
+
// Set Alternate Query params
|
424 |
+
if(alm.alternate === 'true'){
|
425 |
+
alm.alternate_array = {
|
426 |
+
'alternate': 'true',
|
427 |
+
'alternate_sequence': alm.alternate_sequence,
|
428 |
+
'alternate_sequence_max': alm.alternate_sequence_max,
|
429 |
+
'alternate_repeater': alm.alternate_repeater,
|
430 |
+
'alternate_theme_repeater': alm.alternate_theme_repeater,
|
431 |
+
};
|
432 |
+
}
|
433 |
+
|
434 |
+
$.ajax({
|
435 |
+
type: "GET",
|
436 |
+
url: alm_localize.ajaxurl,
|
437 |
+
data: {
|
438 |
+
action: action,
|
439 |
+
query_type: queryType,
|
440 |
+
nonce: alm_localize.alm_nonce,
|
441 |
+
cache_id: alm.cache_id,
|
442 |
+
repeater: alm.repeater,
|
443 |
+
theme_repeater: alm.theme_repeater,
|
444 |
+
alternate: alm.alternate_array,
|
445 |
+
comments: alm.comments_array,
|
446 |
+
post_type: alm.post_type,
|
447 |
+
post_format: alm.content.attr('data-post-format'),
|
448 |
+
category: alm.content.attr('data-category'),
|
449 |
+
category__not_in: alm.content.attr('data-category-not-in'),
|
450 |
+
tag: alm.content.attr('data-tag'),
|
451 |
+
tag__not_in: alm.content.attr('data-tag-not-in'),
|
452 |
+
taxonomy: alm.content.attr('data-taxonomy'),
|
453 |
+
taxonomy_terms: alm.content.attr('data-taxonomy-terms'),
|
454 |
+
taxonomy_operator: alm.content.attr('data-taxonomy-operator'),
|
455 |
+
taxonomy_relation: alm.content.attr('data-taxonomy-relation'),
|
456 |
+
meta_key: alm.content.attr('data-meta-key'),
|
457 |
+
meta_value: alm.content.attr('data-meta-value'),
|
458 |
+
meta_compare: alm.content.attr('data-meta-compare'),
|
459 |
+
meta_relation: alm.content.attr('data-meta-relation'),
|
460 |
+
meta_type: alm.content.attr('data-meta-type'),
|
461 |
+
author: alm.content.attr('data-author'),
|
462 |
+
year: alm.content.attr('data-year'),
|
463 |
+
month: alm.content.attr('data-month'),
|
464 |
+
day: alm.content.attr('data-day'),
|
465 |
+
post_status: alm.content.attr('data-post-status'),
|
466 |
+
order: alm.content.attr('data-order'),
|
467 |
+
orderby: alm.content.attr('data-orderby'),
|
468 |
+
post__in: alm.content.attr('data-post-in'),
|
469 |
+
post__not_in: alm.content.attr('data-post-not-in'),
|
470 |
+
exclude: alm.content.attr('data-exclude'), // Deprecate soon in favor of post__not_in
|
471 |
+
search: alm.content.attr('data-search'),
|
472 |
+
custom_args: alm.content.attr('data-custom-args'),
|
473 |
+
posts_per_page: alm.posts_per_page,
|
474 |
+
pageNumber: alm.page,
|
475 |
+
offset: alm.offset,
|
476 |
+
preloaded: alm.preloaded,
|
477 |
+
preloaded_amount: alm.preloaded_amount,
|
478 |
+
seo_start_page: alm.start_page,
|
479 |
+
previous_post: alm.previous_post,
|
480 |
+
previous_post_id: alm.previous_post_id,
|
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) {
|
490 |
+
alm.button.addClass('loading');
|
491 |
+
}
|
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)){
|
499 |
+
$.fn.almBuildPagination(data, alm);
|
500 |
+
}
|
501 |
+
}
|
502 |
+
|
503 |
+
},
|
504 |
+
error: function (jqXHR, textStatus, errorThrown) {
|
505 |
+
alm.AjaxLoadMore.error(jqXHR, textStatus, errorThrown);
|
506 |
+
}
|
507 |
+
});
|
508 |
+
};
|
509 |
+
|
510 |
+
// If pagination enabled, run totalposts query
|
511 |
+
if(alm.paging){
|
512 |
+
alm.AjaxLoadMore.ajax('totalposts'); // Create paging menu and query for total posts
|
513 |
+
}
|
514 |
+
|
515 |
+
|
516 |
+
|
517 |
+
/* alm.AjaxLoadMore.success()
|
518 |
+
*
|
519 |
+
* Success function after loading data
|
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 |
+
|
541 |
+
alm.button.text(alm.button_label);
|
542 |
+
|
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();
|
550 |
+
alm.content.append(alm.el);
|
551 |
+
alm.content.parent().removeClass('loading'); // Remove loading class from main container
|
552 |
+
alm.resetBtnText();
|
553 |
+
|
554 |
+
$('.alm-paging-content', alm.el).fadeIn( alm.speed, 'alm_easeInOutQuad', function(){
|
555 |
+
var paddingT = parseInt(alm.content.css('padding-top')),
|
556 |
+
paddingB = parseInt(alm.content.css('padding-bottom'));
|
557 |
+
alm.content.css('height', alm.el.height() + paddingT + paddingB + 'px');
|
558 |
+
if ($.isFunction($.fn.almFadePageControls)){
|
559 |
+
$.fn.almFadePageControls(alm.btnWrap);
|
560 |
+
}
|
561 |
+
});
|
562 |
+
}
|
563 |
+
|
564 |
+
}
|
565 |
+
|
566 |
+
// ALM Empty - triggers if zero results were returned
|
567 |
+
if(alm.data.length === 0){
|
568 |
+
if ($.isFunction($.fn.almEmpty)) {
|
569 |
+
$.fn.almEmpty(alm);
|
570 |
+
}
|
571 |
+
}
|
572 |
+
|
573 |
+
// isPaged
|
574 |
+
if(alm.isPaged){
|
575 |
+
alm.posts_per_page = alm.content.attr('data-posts-per-page'); // Reset our posts per page variable
|
576 |
+
alm.page = alm.start_page - 1; // Set our new page #
|
577 |
+
}
|
578 |
+
}
|
579 |
+
|
580 |
+
// We have results!
|
581 |
+
if (alm.data.length > 0) {
|
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;
|
678 |
+
if(!alm.paging){
|
679 |
+
alm.button.delay(alm.speed).removeClass('loading');
|
680 |
+
alm.resetBtnText();
|
681 |
+
}
|
682 |
+
if (alm.data.length < alm.posts_per_page) {
|
683 |
+
alm.finished = true;
|
684 |
+
if(!alm.paging){
|
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{
|
694 |
+
alm.el.fadeIn(alm.speed, 'alm_easeInOutQuad', function () {
|
695 |
+
alm.loading = false;
|
696 |
+
if(!alm.paging){
|
697 |
+
alm.button.delay(alm.speed).removeClass('loading');
|
698 |
+
alm.resetBtnText();
|
699 |
+
}
|
700 |
+
if (alm.data.length < alm.posts_per_page) {
|
701 |
+
alm.finished = true;
|
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){
|
728 |
+
alm.button.delay(alm.speed).removeClass('loading');
|
729 |
+
alm.resetBtnText();
|
730 |
+
}
|
731 |
+
if (alm.data.length < alm.posts_per_page) {
|
732 |
+
alm.finished = true;
|
733 |
+
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;
|
743 |
+
if(!alm.paging){
|
744 |
+
alm.button.delay(alm.speed).removeClass('loading');
|
745 |
+
alm.resetBtnText();
|
746 |
+
}
|
747 |
+
if (alm.data.length < alm.posts_per_page) {
|
748 |
+
alm.finished = true;
|
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){
|
762 |
+
alm.button.delay(alm.speed).removeClass('loading');
|
763 |
+
alm.resetBtnText();
|
764 |
+
}
|
765 |
+
if (alm.data.length < alm.posts_per_page) {
|
766 |
+
alm.finished = true;
|
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 |
+
|
778 |
+
} else {
|
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 |
+
|
794 |
+
// ALM Complete
|
795 |
+
if ($.isFunction($.fn.almComplete)) {
|
796 |
+
if(alm.images_loaded === 'true'){
|
797 |
+
alm.el.almWaitForImages().done(function(){
|
798 |
+
$.fn.almComplete(alm);
|
799 |
+
});
|
800 |
+
}else{
|
801 |
+
$.fn.almComplete(alm);
|
802 |
+
}
|
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 |
+
|
818 |
+
if(!alm.paging){
|
819 |
+
alm.button.delay(alm.speed).removeClass('loading').addClass('done');
|
820 |
+
alm.resetBtnText();
|
821 |
+
}
|
822 |
+
|
823 |
+
// ALM Done
|
824 |
+
if ($.isFunction($.fn.almDone) && !alm.init) {
|
825 |
+
$.fn.almDone(alm);
|
826 |
+
}
|
827 |
+
|
828 |
+
alm.loading = false;
|
829 |
+
alm.finished = true;
|
830 |
+
}
|
831 |
+
|
832 |
+
// Destroy After param
|
833 |
+
if (alm.destroy_after !== undefined && alm.destroy_after !== '') {
|
834 |
+
var currentPage = alm.page + 1; // Add 1 because alm.page starts at 0
|
835 |
+
|
836 |
+
if(alm.preload){
|
837 |
+
currentPage++;
|
838 |
+
}
|
839 |
+
|
840 |
+
if(currentPage == alm.destroy_after){ // - Disable ALM is page = alm.destroy_after value
|
841 |
+
alm.disable_ajax = true;
|
842 |
+
if(!alm.paging){
|
843 |
+
alm.button.delay(alm.speed).fadeOut(alm.speed);
|
844 |
+
}
|
845 |
+
}
|
846 |
+
}
|
847 |
+
alm.init = false;
|
848 |
+
|
849 |
+
};
|
850 |
+
|
851 |
+
|
852 |
+
|
853 |
+
/* alm.AjaxLoadMore.getPreviousPost()
|
854 |
+
*
|
855 |
+
* Get the previous post ID via ajax
|
856 |
+
* @since 2.7.4
|
857 |
+
*/
|
858 |
+
alm.fetchingPreviousPost = false;
|
859 |
+
alm.AjaxLoadMore.getPreviousPost = function () {
|
860 |
+
alm.fetchingPreviousPost = true;
|
861 |
+
$.ajax({
|
862 |
+
type: "GET",
|
863 |
+
dataType: "JSON",
|
864 |
+
url: alm_localize.ajaxurl,
|
865 |
+
data: {
|
866 |
+
action: 'alm_query_previous_post',
|
867 |
+
id: alm.previous_post_id,
|
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;
|
875 |
+
}else{
|
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)){
|
885 |
+
$.fn.almSetPreviousPost(alm, data.current_id, data.permalink, data.title);
|
886 |
+
}
|
887 |
+
alm.fetchingPreviousPost = false;
|
888 |
+
},
|
889 |
+
error: function (jqXHR, textStatus, errorThrown) {
|
890 |
+
alm.AjaxLoadMore.error(jqXHR, textStatus, errorThrown);
|
891 |
+
alm.fetchingPreviousPost = false;
|
892 |
+
}
|
893 |
+
|
894 |
+
});
|
895 |
+
};
|
896 |
+
|
897 |
+
|
898 |
+
|
899 |
+
/* alm.resetBtnText()
|
900 |
+
*
|
901 |
+
* Resets the loading button text after loading has completed
|
902 |
+
* @since 2.8.4
|
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 |
+
|
912 |
+
|
913 |
+
|
914 |
+
/* alm.AjaxLoadMore.error()
|
915 |
+
*
|
916 |
+
* Error function after failed data
|
917 |
+
* @since 2.6.0
|
918 |
+
*/
|
919 |
+
|
920 |
+
alm.AjaxLoadMore.error = function (jqXHR, textStatus, errorThrown) {
|
921 |
+
alm.loading = false;
|
922 |
+
if(!alm.paging){
|
923 |
+
alm.button.removeClass('loading');
|
924 |
+
alm.resetBtnText();
|
925 |
+
}
|
926 |
+
console.log(errorThrown);
|
927 |
+
};
|
928 |
+
|
929 |
+
|
930 |
+
|
931 |
+
/* Button onClick()
|
932 |
+
*
|
933 |
+
* Load more button click event
|
934 |
+
* @since 1.0.0
|
935 |
+
*/
|
936 |
+
|
937 |
+
if(!alm.paging && !alm.fetchingPreviousPost){
|
938 |
+
alm.button.on('click', function () {
|
939 |
+
if (alm.pause === 'true') {
|
940 |
+
alm.pause = false;
|
941 |
+
alm.pause_override = false;
|
942 |
+
alm.AjaxLoadMore.loadPosts();
|
943 |
+
}
|
944 |
+
if (!alm.loading && !alm.finished && !$(this).hasClass('done')) {
|
945 |
+
alm.loading = true;
|
946 |
+
alm.page++;
|
947 |
+
alm.AjaxLoadMore.loadPosts();
|
948 |
+
}
|
949 |
+
});
|
950 |
+
}
|
951 |
+
|
952 |
+
|
953 |
+
|
954 |
+
if(alm.paging){
|
955 |
+
alm.window.resize(function() {
|
956 |
+
if ($.isFunction($.fn.almOnWindowResize)){
|
957 |
+
setTimeout(function(){
|
958 |
+
$.fn.almOnWindowResize(alm);
|
959 |
+
}, 250);
|
960 |
+
}
|
961 |
+
});
|
962 |
+
}
|
963 |
+
|
964 |
+
|
965 |
+
|
966 |
+
/* alm.AjaxLoadMore.isVisible()
|
967 |
+
*
|
968 |
+
* Check to see if element is visible before loading posts
|
969 |
+
* @since 2.1.2
|
970 |
+
*/
|
971 |
+
|
972 |
+
alm.AjaxLoadMore.isVisible = function () {
|
973 |
+
alm.visible = false;
|
974 |
+
if (alm.el.is(":visible")) {
|
975 |
+
alm.visible = true;
|
976 |
+
}
|
977 |
+
return alm.visible;
|
978 |
+
};
|
979 |
+
|
980 |
+
|
981 |
+
|
982 |
+
/* Window scroll and touchmove events
|
983 |
+
*
|
984 |
+
* Load posts as user scrolls the page
|
985 |
+
* @since 1.0
|
986 |
+
*/
|
987 |
+
if (alm.scroll && !alm.paging) {
|
988 |
+
alm.window.bind("scroll touchstart", function () {
|
989 |
+
if (alm.AjaxLoadMore.isVisible() && !alm.fetchingPreviousPost) {
|
990 |
+
|
991 |
+
var content_offset = alm.button.offset(),
|
992 |
+
top = Math.round(content_offset.top - (alm.window.height() - alm.scroll_distance));
|
993 |
+
|
994 |
+
// Pause Override
|
995 |
+
if(!alm.loading && !alm.finished && (alm.window.scrollTop() >= top) && alm.page < (alm.max_pages - 1) && alm.proceed && alm.pause === 'true' && alm.pause_override === 'true'){
|
996 |
+
// If Pause && Pause Override
|
997 |
+
alm.button.trigger('click');
|
998 |
+
|
999 |
+
}
|
1000 |
+
// Standard Scroll event
|
1001 |
+
else{
|
1002 |
+
if (!alm.loading && !alm.finished && (alm.window.scrollTop() >= top) && alm.page < (alm.max_pages - 1) && alm.proceed && alm.pause !== 'true') {
|
1003 |
+
|
1004 |
+
alm.page++;
|
1005 |
+
alm.AjaxLoadMore.loadPosts();
|
1006 |
+
|
1007 |
+
}
|
1008 |
+
}
|
1009 |
+
|
1010 |
+
}
|
1011 |
+
});
|
1012 |
+
}
|
1013 |
+
|
1014 |
+
|
1015 |
+
|
1016 |
+
/* Init Ajax load More
|
1017 |
+
*
|
1018 |
+
* Load posts as user scrolls the page
|
1019 |
+
* @since 2.0
|
1020 |
+
*/
|
1021 |
+
if(!alm.paging && !alm.previous_post){
|
1022 |
+
if(alm.disable_ajax){
|
1023 |
+
alm.finished = true;
|
1024 |
+
alm.button.addClass('done');
|
1025 |
+
}else{
|
1026 |
+
if (alm.pause === 'true') {
|
1027 |
+
alm.button.text(alm.button_label);
|
1028 |
+
alm.loading = false;
|
1029 |
+
} else {
|
1030 |
+
alm.AjaxLoadMore.loadPosts();
|
1031 |
+
}
|
1032 |
+
}
|
1033 |
+
}
|
1034 |
+
if(alm.previous_post){
|
1035 |
+
alm.AjaxLoadMore.getPreviousPost(); // Set next post on load
|
1036 |
+
alm.loading = false;
|
1037 |
+
}
|
1038 |
+
|
1039 |
+
|
1040 |
+
|
1041 |
+
//flag to prevent unnecessary loading of post on init. Hold for 1 second
|
1042 |
+
setTimeout(function () {
|
1043 |
+
alm.proceed = true;
|
1044 |
+
}, 500);
|
1045 |
+
|
1046 |
+
|
1047 |
+
|
1048 |
+
/* $.fn.almUpdateCurrentPage()
|
1049 |
+
*
|
1050 |
+
* Update current page - triggered from paging add-on
|
1051 |
+
* @since 2.7.0
|
1052 |
+
*/
|
1053 |
+
|
1054 |
+
$.fn.almUpdateCurrentPage = function(current, alm_paging_init){
|
1055 |
+
|
1056 |
+
alm.page = current;
|
1057 |
+
// If is paging and preloaded
|
1058 |
+
if(alm_paging_init && alm.preloaded === 'true'){
|
1059 |
+
|
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 |
+
|
1067 |
+
alm.AjaxLoadMore.loadPosts();
|
1068 |
+
|
1069 |
+
}
|
1070 |
+
};
|
1071 |
+
|
1072 |
+
|
1073 |
+
|
1074 |
+
/* $.fn.almGetParentContainer()
|
1075 |
+
*
|
1076 |
+
* return the parent ALM container
|
1077 |
+
*
|
1078 |
+
* @since 2.7.0
|
1079 |
+
* @return element
|
1080 |
+
*/
|
1081 |
+
$.fn.almGetParentContainer = function(){
|
1082 |
+
return alm.el.closest('#ajax-load-more'); // Return the parent #ajax-load-more div
|
1083 |
+
};
|
1084 |
+
|
1085 |
+
|
1086 |
+
|
1087 |
+
/* $.fn.almGetObj()
|
1088 |
+
*
|
1089 |
+
* return the current ALM obj
|
1090 |
+
*
|
1091 |
+
* @since 2.7.0
|
1092 |
+
* @return object
|
1093 |
+
*/
|
1094 |
+
$.fn.almGetObj = function(){
|
1095 |
+
return alm; // Return the entire alm object
|
1096 |
+
};
|
1097 |
+
|
1098 |
+
|
1099 |
+
|
1100 |
+
//Custom easing function
|
1101 |
+
$.easing.alm_easeInOutQuad = function (x, t, b, c, d) {
|
1102 |
+
if ((t /= d / 2) < 1) { return c / 2 * t * t + b; }
|
1103 |
+
return -c / 2 * ((--t) * (t - 2) - 1) + b;
|
1104 |
+
};
|
1105 |
+
|
1106 |
+
};
|
1107 |
+
|
1108 |
+
// End $.ajaxloadmore
|
1109 |
+
|
1110 |
+
|
1111 |
+
|
1112 |
+
/* $.fn.almFilter(type, speed, data)
|
1113 |
+
*
|
1114 |
+
* Filter Ajax Load More
|
1115 |
+
* @type ('slide', 'fade', null);
|
1116 |
+
* @speed '300';
|
1117 |
+
* @data obj;
|
1118 |
+
*
|
1119 |
+
* @since 2.6.1
|
1120 |
+
*/
|
1121 |
+
$.fn.almFilter = function (transition, speed, data) {
|
1122 |
+
|
1123 |
+
$(".ajax-load-more-wrap").each(function (e) {
|
1124 |
+
var el = $(this);
|
1125 |
+
if(transition === 'slide'){ // Slide transition
|
1126 |
+
el.slideUp(speed, function(){
|
1127 |
+
$('.alm-listing', el).html(''); // Clear listings
|
1128 |
+
$('.alm-btn-wrap', el).remove(); // remove buttons
|
1129 |
+
el.fadeIn(speed);
|
1130 |
+
|
1131 |
+
$.fn.almSetFilters(el, data);
|
1132 |
+
|
1133 |
+
});
|
1134 |
+
}else if(transition === 'fade'){ // Fade transition
|
1135 |
+
el.fadeOut(speed, function(){
|
1136 |
+
$('.alm-listing', el).html(''); // Clear listings
|
1137 |
+
$('.alm-btn-wrap', el).remove(); // remove buttons
|
1138 |
+
el.fadeIn(speed);
|
1139 |
+
|
1140 |
+
$.fn.almSetFilters(el, data);
|
1141 |
+
|
1142 |
+
});
|
1143 |
+
}else{
|
1144 |
+
$('.alm-listing', el).html(''); // Clear listings
|
1145 |
+
$('.alm-btn-wrap', el).remove(); // remove buttons
|
1146 |
+
el.fadeIn(speed);
|
1147 |
+
|
1148 |
+
$.fn.almSetFilters(el, data);
|
1149 |
+
|
1150 |
+
}
|
1151 |
+
|
1152 |
+
});
|
1153 |
+
};
|
1154 |
+
|
1155 |
+
|
1156 |
+
|
1157 |
+
/* $.fn.almSetFilters(el, data)
|
1158 |
+
*
|
1159 |
+
* Set filter parameters on .alm-listing element
|
1160 |
+
*
|
1161 |
+
* @since 2.6.1
|
1162 |
+
*/
|
1163 |
+
$.fn.almSetFilters = function(el, data){
|
1164 |
+
$.each(data, function(key, value) {
|
1165 |
+
key = key.replace(/\W+/g, '-').replace(/([a-z\d])([A-Z])/g, '$1-$2'); // Convert camelCase data() object back to dash (-)
|
1166 |
+
$('.alm-listing', el).attr('data-'+key, value);
|
1167 |
+
});
|
1168 |
+
|
1169 |
+
if ($.isFunction($.fn.almFilterComplete)){
|
1170 |
+
$.fn.almFilterComplete();
|
1171 |
+
}
|
1172 |
+
|
1173 |
+
$(".ajax-load-more-wrap").ajaxloadmore(); // re-initiate Ajax Load More
|
1174 |
+
};
|
1175 |
+
|
1176 |
+
|
1177 |
+
|
1178 |
+
/* $.fn.ajaxloadmore()
|
1179 |
+
*
|
1180 |
+
* Initiate all instances of Ajax load More
|
1181 |
+
* @since 2.1.2
|
1182 |
+
*/
|
1183 |
+
$.fn.ajaxloadmore = function () {
|
1184 |
+
return this.each(function (e) {
|
1185 |
+
$(this).data('alm', new $.ajaxloadmore($(this), e));
|
1186 |
+
});
|
1187 |
+
};
|
1188 |
+
|
1189 |
+
|
1190 |
+
|
1191 |
+
/*
|
1192 |
+
* Initiate Ajax load More if div is present on screen
|
1193 |
+
* @since 2.1.2
|
1194 |
+
*/
|
1195 |
+
if ($(".ajax-load-more-wrap").length){
|
1196 |
+
$(".ajax-load-more-wrap").ajaxloadmore();
|
1197 |
+
}
|
1198 |
+
|
1199 |
+
|
1200 |
+
})(jQuery);
|
1201 |
+
|
1202 |
+
|
1203 |
+
|
1204 |
+
/*! almWaitForImages
|
1205 |
+
jQuery Plugin
|
1206 |
+
v2.0.2
|
1207 |
+
Based on https://github.com/alexanderdickson/almWaitForImages
|
1208 |
+
*/
|
1209 |
+
// Include almWaitForImages() for paging add-on
|
1210 |
+
;(function (factory) {
|
1211 |
+
if (typeof define === 'function' && define.amd) {
|
1212 |
+
// AMD. Register as an anonymous module.
|
1213 |
+
define(['jquery'], factory);
|
1214 |
+
} else if (typeof exports === 'object') {
|
1215 |
+
// CommonJS / nodejs module
|
1216 |
+
module.exports = factory(require('jquery'));
|
1217 |
+
} else {
|
1218 |
+
// Browser globals
|
1219 |
+
factory(jQuery);
|
1220 |
+
}
|
1221 |
+
}(function ($) {
|
1222 |
+
// Namespace all events.
|
1223 |
+
var eventNamespace = 'almWaitForImages';
|
1224 |
+
|
1225 |
+
// CSS properties which contain references to images.
|
1226 |
+
$.almWaitForImages = {
|
1227 |
+
hasImageProperties: [
|
1228 |
+
'backgroundImage',
|
1229 |
+
'listStyleImage',
|
1230 |
+
'borderImage',
|
1231 |
+
'borderCornerImage',
|
1232 |
+
'cursor'
|
1233 |
+
],
|
1234 |
+
hasImageAttributes: ['srcset']
|
1235 |
+
};
|
1236 |
+
|
1237 |
+
// Custom selector to find all `img` elements with a valid `src` attribute.
|
1238 |
+
$.expr[':']['has-src'] = function (obj) {
|
1239 |
+
// Ensure we are dealing with an `img` element with a valid
|
1240 |
+
// `src` attribute.
|
1241 |
+
return $(obj).is('img[src][src!=""]');
|
1242 |
+
};
|
1243 |
+
|
1244 |
+
// Custom selector to find images which are not already cached by the
|
1245 |
+
// browser.
|
1246 |
+
$.expr[':'].uncached = function (obj) {
|
1247 |
+
// Ensure we are dealing with an `img` element with a valid
|
1248 |
+
// `src` attribute.
|
1249 |
+
if (!$(obj).is(':has-src')) {
|
1250 |
+
return false;
|
1251 |
+
}
|
1252 |
+
|
1253 |
+
return !obj.complete;
|
1254 |
+
};
|
1255 |
+
|
1256 |
+
$.fn.almWaitForImages = function () {
|
1257 |
+
|
1258 |
+
var allImgsLength = 0;
|
1259 |
+
var allImgsLoaded = 0;
|
1260 |
+
var deferred = $.Deferred();
|
1261 |
+
|
1262 |
+
var finishedCallback;
|
1263 |
+
var eachCallback;
|
1264 |
+
var waitForAll;
|
1265 |
+
|
1266 |
+
// Handle options object (if passed).
|
1267 |
+
if ($.isPlainObject(arguments[0])) {
|
1268 |
+
|
1269 |
+
waitForAll = arguments[0].waitForAll;
|
1270 |
+
eachCallback = arguments[0].each;
|
1271 |
+
finishedCallback = arguments[0].finished;
|
1272 |
+
|
1273 |
+
} else {
|
1274 |
+
|
1275 |
+
// Handle if using deferred object and only one param was passed in.
|
1276 |
+
if (arguments.length === 1 && $.type(arguments[0]) === 'boolean') {
|
1277 |
+
waitForAll = arguments[0];
|
1278 |
+
} else {
|
1279 |
+
finishedCallback = arguments[0];
|
1280 |
+
eachCallback = arguments[1];
|
1281 |
+
waitForAll = arguments[2];
|
1282 |
+
}
|
1283 |
+
|
1284 |
+
}
|
1285 |
+
|
1286 |
+
// Handle missing callbacks.
|
1287 |
+
finishedCallback = finishedCallback || $.noop;
|
1288 |
+
eachCallback = eachCallback || $.noop;
|
1289 |
+
|
1290 |
+
// Convert waitForAll to Boolean
|
1291 |
+
waitForAll = !! waitForAll;
|
1292 |
+
|
1293 |
+
// Ensure callbacks are functions.
|
1294 |
+
if (!$.isFunction(finishedCallback) || !$.isFunction(eachCallback)) {
|
1295 |
+
throw new TypeError('An invalid callback was supplied.');
|
1296 |
+
}
|
1297 |
+
|
1298 |
+
this.each(function () {
|
1299 |
+
// Build a list of all imgs, dependent on what images will
|
1300 |
+
// be considered.
|
1301 |
+
var obj = $(this);
|
1302 |
+
var allImgs = [];
|
1303 |
+
// CSS properties which may contain an image.
|
1304 |
+
var hasImgProperties = $.almWaitForImages.hasImageProperties || [];
|
1305 |
+
// Element attributes which may contain an image.
|
1306 |
+
var hasImageAttributes = $.almWaitForImages.hasImageAttributes || [];
|
1307 |
+
// To match `url()` references.
|
1308 |
+
// Spec: http://www.w3.org/TR/CSS2/syndata.html#value-def-uri
|
1309 |
+
var matchUrl = /url\(\s*(['"]?)(.*?)\1\s*\)/g;
|
1310 |
+
|
1311 |
+
if (waitForAll) {
|
1312 |
+
|
1313 |
+
// Get all elements (including the original), as any one of
|
1314 |
+
// them could have a background image.
|
1315 |
+
obj.find('*').addBack().each(function () {
|
1316 |
+
var element = $(this);
|
1317 |
+
|
1318 |
+
// If an `img` element, add it. But keep iterating in
|
1319 |
+
// case it has a background image too.
|
1320 |
+
if (element.is('img:has-src')) {
|
1321 |
+
allImgs.push({
|
1322 |
+
src: element.attr('src'),
|
1323 |
+
element: element[0]
|
1324 |
+
});
|
1325 |
+
}
|
1326 |
+
|
1327 |
+
$.each(hasImgProperties, function (i, property) {
|
1328 |
+
var propertyValue = element.css(property);
|
1329 |
+
var match;
|
1330 |
+
|
1331 |
+
// If it doesn't contain this property, skip.
|
1332 |
+
if (!propertyValue) {
|
1333 |
+
return true;
|
1334 |
+
}
|
1335 |
+
|
1336 |
+
// Get all url() of this element.
|
1337 |
+
while (match = matchUrl.exec(propertyValue)) {
|
1338 |
+
allImgs.push({
|
1339 |
+
src: match[2],
|
1340 |
+
element: element[0]
|
1341 |
+
});
|
1342 |
+
}
|
1343 |
+
});
|
1344 |
+
|
1345 |
+
$.each(hasImageAttributes, function (i, attribute) {
|
1346 |
+
var attributeValue = element.attr(attribute);
|
1347 |
+
var attributeValues;
|
1348 |
+
|
1349 |
+
// If it doesn't contain this property, skip.
|
1350 |
+
if (!attributeValue) {
|
1351 |
+
return true;
|
1352 |
+
}
|
1353 |
+
|
1354 |
+
// Check for multiple comma separated images
|
1355 |
+
attributeValues = attributeValue.split(',');
|
1356 |
+
|
1357 |
+
$.each(attributeValues, function(i, value) {
|
1358 |
+
// Trim value and get string before first
|
1359 |
+
// whitespace (for use with srcset).
|
1360 |
+
value = $.trim(value).split(' ')[0];
|
1361 |
+
allImgs.push({
|
1362 |
+
src: value,
|
1363 |
+
element: element[0]
|
1364 |
+
});
|
1365 |
+
});
|
1366 |
+
});
|
1367 |
+
});
|
1368 |
+
} else {
|
1369 |
+
// For images only, the task is simpler.
|
1370 |
+
obj.find('img:has-src')
|
1371 |
+
.each(function () {
|
1372 |
+
allImgs.push({
|
1373 |
+
src: this.src,
|
1374 |
+
element: this
|
1375 |
+
});
|
1376 |
+
});
|
1377 |
+
}
|
1378 |
+
|
1379 |
+
allImgsLength = allImgs.length;
|
1380 |
+
allImgsLoaded = 0;
|
1381 |
+
|
1382 |
+
// If no images found, don't bother.
|
1383 |
+
if (allImgsLength === 0) {
|
1384 |
+
finishedCallback.call(obj[0]);
|
1385 |
+
deferred.resolveWith(obj[0]);
|
1386 |
+
}
|
1387 |
+
|
1388 |
+
$.each(allImgs, function (i, img) {
|
1389 |
+
|
1390 |
+
var image = new Image();
|
1391 |
+
var events =
|
1392 |
+
'load.' + eventNamespace + ' error.' + eventNamespace;
|
1393 |
+
|
1394 |
+
// Handle the image loading and error with the same callback.
|
1395 |
+
$(image).one(events, function me (event) {
|
1396 |
+
// If an error occurred with loading the image, set the
|
1397 |
+
// third argument accordingly.
|
1398 |
+
var eachArguments = [
|
1399 |
+
allImgsLoaded,
|
1400 |
+
allImgsLength,
|
1401 |
+
event.type == 'load'
|
1402 |
+
];
|
1403 |
+
allImgsLoaded++;
|
1404 |
+
|
1405 |
+
eachCallback.apply(img.element, eachArguments);
|
1406 |
+
deferred.notifyWith(img.element, eachArguments);
|
1407 |
+
|
1408 |
+
// Unbind the event listeners. I use this in addition to
|
1409 |
+
// `one` as one of those events won't be called (either
|
1410 |
+
// 'load' or 'error' will be called).
|
1411 |
+
$(this).off(events, me);
|
1412 |
+
|
1413 |
+
if (allImgsLoaded == allImgsLength) {
|
1414 |
+
finishedCallback.call(obj[0]);
|
1415 |
+
deferred.resolveWith(obj[0]);
|
1416 |
+
return false;
|
1417 |
+
}
|
1418 |
+
|
1419 |
+
});
|
1420 |
+
|
1421 |
+
image.src = img.src;
|
1422 |
+
});
|
1423 |
+
});
|
1424 |
+
|
1425 |
+
return deferred.promise();
|
1426 |
+
|
1427 |
+
};
|
1428 |
+
}));
|
lang/ajax-load-more.pot
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Ajax Load More\n"
|
4 |
-
"POT-Creation-Date: 2016-
|
5 |
-
"PO-Revision-Date: 2016-
|
6 |
"Last-Translator: Darren Cooney <dcooney@ecentricarts.com>\n"
|
7 |
"Language-Team: \n"
|
8 |
"Language: en_CA\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"X-Generator: Poedit 1.6.
|
13 |
"X-Poedit-Basepath: .\n"
|
14 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
15 |
"X-Poedit-KeywordsList: __;_e\n"
|
@@ -73,12 +73,12 @@ msgid "Error Writing File"
|
|
73 |
msgstr ""
|
74 |
|
75 |
#: ../admin/admin.php:854
|
76 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
77 |
msgid "Container Type"
|
78 |
msgstr ""
|
79 |
|
80 |
#: ../admin/admin.php:862
|
81 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
82 |
msgid "Container Classes"
|
83 |
msgstr ""
|
84 |
|
@@ -173,6 +173,12 @@ msgstr ""
|
|
173 |
msgid "Preview"
|
174 |
msgstr ""
|
175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
#: ../admin/admin.php:1244
|
177 |
msgid "Add classes to your <strong>Load More</strong> button"
|
178 |
msgstr ""
|
@@ -330,7 +336,7 @@ msgid ""
|
|
330 |
msgstr ""
|
331 |
|
332 |
#: ../admin/includes/cta/reviews.php:4
|
333 |
-
msgid "Write
|
334 |
msgstr ""
|
335 |
|
336 |
#: ../admin/includes/cta/sharing.php:1
|
@@ -510,7 +516,7 @@ msgstr ""
|
|
510 |
#: ../admin/shortcode-builder/shortcode-builder.php:1021
|
511 |
#: ../admin/shortcode-builder/shortcode-builder.php:1046
|
512 |
#: ../admin/shortcode-builder/shortcode-builder.php:1093
|
513 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
514 |
msgid "True"
|
515 |
msgstr ""
|
516 |
|
@@ -525,7 +531,7 @@ msgstr ""
|
|
525 |
#: ../admin/shortcode-builder/shortcode-builder.php:1025
|
526 |
#: ../admin/shortcode-builder/shortcode-builder.php:1050
|
527 |
#: ../admin/shortcode-builder/shortcode-builder.php:1097
|
528 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
529 |
msgid "False"
|
530 |
msgstr ""
|
531 |
|
@@ -1122,97 +1128,104 @@ msgstr ""
|
|
1122 |
msgid "Fade"
|
1123 |
msgstr ""
|
1124 |
|
1125 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1126 |
msgid "Transition Container"
|
1127 |
msgstr ""
|
1128 |
|
1129 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1130 |
msgid ""
|
1131 |
"Removing the transition container may have undesired results and is not "
|
1132 |
"recommended."
|
1133 |
msgstr ""
|
1134 |
|
1135 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1136 |
msgid "Remove the Ajax Load More (.alm-reveal) loading container."
|
1137 |
msgstr ""
|
1138 |
|
1139 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1140 |
msgid "Images Loaded"
|
1141 |
msgstr ""
|
1142 |
|
1143 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1144 |
msgid "Wait for all images to load before displaying ajax loaded content"
|
1145 |
msgstr ""
|
1146 |
|
1147 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1148 |
msgid "Background images are currently not supported"
|
1149 |
msgstr ""
|
1150 |
|
1151 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1152 |
msgid "Destroy After"
|
1153 |
msgstr ""
|
1154 |
|
1155 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1156 |
msgid ""
|
1157 |
"Remove ajax load more functionality after '<em>n</em>' number of pages have "
|
1158 |
"been loaded."
|
1159 |
msgstr ""
|
1160 |
|
1161 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1162 |
msgid "Button Labels"
|
1163 |
msgstr ""
|
1164 |
|
1165 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1166 |
msgid "Button Label"
|
1167 |
msgstr ""
|
1168 |
|
1169 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1170 |
msgid "Customize the text of the <em>Load More</em> button."
|
1171 |
msgstr ""
|
1172 |
|
1173 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1174 |
-
#: ../ajax-load-more.php:363
|
1175 |
-
msgid "Older Posts"
|
1176 |
-
msgstr ""
|
1177 |
-
|
1178 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:1211
|
1179 |
msgid "Button Loading Label"
|
1180 |
msgstr ""
|
1181 |
|
1182 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1183 |
msgid "Leave field empty to not update text while loading content"
|
1184 |
msgstr ""
|
1185 |
|
1186 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1187 |
msgid ""
|
1188 |
"Update the text of the <em>Load More</em> button while content is loading."
|
1189 |
msgstr ""
|
1190 |
|
1191 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1192 |
msgid "Loading Posts..."
|
1193 |
msgstr ""
|
1194 |
|
1195 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1196 |
msgid "Container Options"
|
1197 |
msgstr ""
|
1198 |
|
1199 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1200 |
msgid ""
|
1201 |
"You can define a global container type on the Ajax Load More settings screen"
|
1202 |
msgstr ""
|
1203 |
|
1204 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1205 |
msgid ""
|
1206 |
"Override the global Container Type that was set on <a href=\"admin.php?"
|
1207 |
"page=ajax-load-more\">ALM Settings page</a>."
|
1208 |
msgstr ""
|
1209 |
|
1210 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1211 |
msgid ""
|
1212 |
"You can define global container classes on the Ajax Load More settings screen"
|
1213 |
msgstr ""
|
1214 |
|
1215 |
-
#: ../admin/shortcode-builder/shortcode-builder.php:
|
1216 |
msgid ""
|
1217 |
"Add custom CSS classes to the Ajax Load More container. <br/><br/> e.g. "
|
1218 |
"portfolio-listing large-12 etc"
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Ajax Load More\n"
|
4 |
+
"POT-Creation-Date: 2016-04-11 09:45-0500\n"
|
5 |
+
"PO-Revision-Date: 2016-04-11 09:45-0500\n"
|
6 |
"Last-Translator: Darren Cooney <dcooney@ecentricarts.com>\n"
|
7 |
"Language-Team: \n"
|
8 |
"Language: en_CA\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Generator: Poedit 1.6.7\n"
|
13 |
"X-Poedit-Basepath: .\n"
|
14 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
15 |
"X-Poedit-KeywordsList: __;_e\n"
|
73 |
msgstr ""
|
74 |
|
75 |
#: ../admin/admin.php:854
|
76 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1244
|
77 |
msgid "Container Type"
|
78 |
msgstr ""
|
79 |
|
80 |
#: ../admin/admin.php:862
|
81 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1268
|
82 |
msgid "Container Classes"
|
83 |
msgstr ""
|
84 |
|
173 |
msgid "Preview"
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: ../admin/admin.php:1225
|
177 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1218
|
178 |
+
#: ../ajax-load-more.php:369
|
179 |
+
msgid "Older Posts"
|
180 |
+
msgstr ""
|
181 |
+
|
182 |
#: ../admin/admin.php:1244
|
183 |
msgid "Add classes to your <strong>Load More</strong> button"
|
184 |
msgstr ""
|
336 |
msgstr ""
|
337 |
|
338 |
#: ../admin/includes/cta/reviews.php:4
|
339 |
+
msgid "Write Review"
|
340 |
msgstr ""
|
341 |
|
342 |
#: ../admin/includes/cta/sharing.php:1
|
516 |
#: ../admin/shortcode-builder/shortcode-builder.php:1021
|
517 |
#: ../admin/shortcode-builder/shortcode-builder.php:1046
|
518 |
#: ../admin/shortcode-builder/shortcode-builder.php:1093
|
519 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1179
|
520 |
msgid "True"
|
521 |
msgstr ""
|
522 |
|
531 |
#: ../admin/shortcode-builder/shortcode-builder.php:1025
|
532 |
#: ../admin/shortcode-builder/shortcode-builder.php:1050
|
533 |
#: ../admin/shortcode-builder/shortcode-builder.php:1097
|
534 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1183
|
535 |
msgid "False"
|
536 |
msgstr ""
|
537 |
|
1128 |
msgid "Fade"
|
1129 |
msgstr ""
|
1130 |
|
1131 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1136
|
1132 |
+
msgid "Transition Speed"
|
1133 |
+
msgstr ""
|
1134 |
+
|
1135 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1136
|
1136 |
+
msgid "0.5 seconds = 500, 1 second = 1000 etc."
|
1137 |
+
msgstr ""
|
1138 |
+
|
1139 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1137
|
1140 |
+
msgid "The speed of the loading transition in milliseconds"
|
1141 |
+
msgstr ""
|
1142 |
+
|
1143 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1149
|
1144 |
msgid "Transition Container"
|
1145 |
msgstr ""
|
1146 |
|
1147 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1149
|
1148 |
msgid ""
|
1149 |
"Removing the transition container may have undesired results and is not "
|
1150 |
"recommended."
|
1151 |
msgstr ""
|
1152 |
|
1153 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1150
|
1154 |
msgid "Remove the Ajax Load More (.alm-reveal) loading container."
|
1155 |
msgstr ""
|
1156 |
|
1157 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1167
|
1158 |
msgid "Images Loaded"
|
1159 |
msgstr ""
|
1160 |
|
1161 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1170
|
1162 |
msgid "Wait for all images to load before displaying ajax loaded content"
|
1163 |
msgstr ""
|
1164 |
|
1165 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1171
|
1166 |
msgid "Background images are currently not supported"
|
1167 |
msgstr ""
|
1168 |
|
1169 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1193
|
1170 |
msgid "Destroy After"
|
1171 |
msgstr ""
|
1172 |
|
1173 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1196
|
1174 |
msgid ""
|
1175 |
"Remove ajax load more functionality after '<em>n</em>' number of pages have "
|
1176 |
"been loaded."
|
1177 |
msgstr ""
|
1178 |
|
1179 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1208
|
1180 |
msgid "Button Labels"
|
1181 |
msgstr ""
|
1182 |
|
1183 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1213
|
1184 |
msgid "Button Label"
|
1185 |
msgstr ""
|
1186 |
|
1187 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1214
|
1188 |
msgid "Customize the text of the <em>Load More</em> button."
|
1189 |
msgstr ""
|
1190 |
|
1191 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1226
|
|
|
|
|
|
|
|
|
|
|
1192 |
msgid "Button Loading Label"
|
1193 |
msgstr ""
|
1194 |
|
1195 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1226
|
1196 |
msgid "Leave field empty to not update text while loading content"
|
1197 |
msgstr ""
|
1198 |
|
1199 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1227
|
1200 |
msgid ""
|
1201 |
"Update the text of the <em>Load More</em> button while content is loading."
|
1202 |
msgstr ""
|
1203 |
|
1204 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1231
|
1205 |
msgid "Loading Posts..."
|
1206 |
msgstr ""
|
1207 |
|
1208 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1240
|
1209 |
msgid "Container Options"
|
1210 |
msgstr ""
|
1211 |
|
1212 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1244
|
1213 |
msgid ""
|
1214 |
"You can define a global container type on the Ajax Load More settings screen"
|
1215 |
msgstr ""
|
1216 |
|
1217 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1245
|
1218 |
msgid ""
|
1219 |
"Override the global Container Type that was set on <a href=\"admin.php?"
|
1220 |
"page=ajax-load-more\">ALM Settings page</a>."
|
1221 |
msgstr ""
|
1222 |
|
1223 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1268
|
1224 |
msgid ""
|
1225 |
"You can define global container classes on the Ajax Load More settings screen"
|
1226 |
msgstr ""
|
1227 |
|
1228 |
+
#: ../admin/shortcode-builder/shortcode-builder.php:1269
|
1229 |
msgid ""
|
1230 |
"Add custom CSS classes to the Ajax Load More container. <br/><br/> e.g. "
|
1231 |
"portfolio-listing large-12 etc"
|