WordPress Infinite Scroll – Ajax Load More - Version 5.3.3

Version Description

  • May 20, 2020 =
  • FIX - Added fix for when using Masonry and Filters add-on. Filter would become inaccessible after the first first attempt.
  • FIX - Added fix for new WooCommerce Add-on and SPA sites throwing an error about undefined variable.
  • UPDATE - Updated a11y focus feature for users with transition_container=false. Focus will now be set on the newly added items.
Download this release

Release Info

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

Code changes from version 5.3.0 to 5.3.3

README.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: dcooney, connekthq
3
  Donate link: https://connekthq.com/donate/
4
  Tags: infinite scroll, infinite scrolling, scroll, infinite, lazy load, lazy loading, endless scroll, pagination, ajax pagination, ajax, ajax posts, woocommerce, ajax load more, masonry
5
  Requires at least: 4.0
6
- Tested up to: 5.4.0
7
- Stable tag: 5.3.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -383,6 +383,27 @@ How to install Ajax Load More.
383
 
384
  == Changelog ==
385
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
  = 5.3.0 - April 22, 2020 =
387
  * NEW - Added support and core functionality for new [WooCommerce add-on](https://connekthq.com/plugins/ajax-load-more/add-ons/woocommerce/).
388
  * NEW - Added new `White` & `Light Grey` loading style.
3
  Donate link: https://connekthq.com/donate/
4
  Tags: infinite scroll, infinite scrolling, scroll, infinite, lazy load, lazy loading, endless scroll, pagination, ajax pagination, ajax, ajax posts, woocommerce, ajax load more, masonry
5
  Requires at least: 4.0
6
+ Tested up to: 5.4.1
7
+ Stable tag: 5.3.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
383
 
384
  == Changelog ==
385
 
386
+ = 5.3.3 - May 20, 2020 =
387
+ * FIX - Added fix for when using Masonry and Filters add-on. Filter would become inaccessible after the first first attempt.
388
+ * FIX - Added fix for new WooCommerce Add-on and SPA sites throwing an error about undefined variable.
389
+ * UPDATE - Updated a11y focus feature for users with `transition_container=false`. Focus will now be set on the newly added items.
390
+
391
+
392
+ = 5.3.2 - May 19, 2020 =
393
+ * SECURITY FIX - Added security fix for a possible authenticated SQL injection. Attacker needs to be authenticated, with edit_theme_options capability. (Read More)[https://wpvulndb.com/vulnerabilities/10230]
394
+ * FIX - Fix for accidental `print_r` left inside a WooCommerce function. Sorry!
395
+
396
+
397
+ = 5.3.1 - May 1, 2020 =
398
+ * NEW - Added support for creating paged URLs with the SEO add-on and Masonry.
399
+ * UPDATE - Improved accessiblity of element focus feature by implementing native browser support (`preventScroll`) for focusing on elements without scrolling after an Ajax load. There is still a slight jump on mobile safari and chrome for iOS. Hopefully these browsers will implement better native support for [preventScroll](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus)
400
+ * UPDATE - Removed `Top of Page` global ALM setting.
401
+ * FIX - Add accessibility fix for when using Masonry transition. New item is now auto focused after an Ajax load.
402
+ * FIX - Fixed issue with Destroy After not working correctly after being filtered.
403
+ * FIX - Fixed bug with CTA and Preloaded add-ons. If `cta="false"` was set Ajax Load More may still render the CTA is some cases.
404
+ * FIX- Fixed issue with custom Filtering and Masonry not appending items after a filter.
405
+
406
+
407
  = 5.3.0 - April 22, 2020 =
408
  * NEW - Added support and core functionality for new [WooCommerce add-on](https://connekthq.com/plugins/ajax-load-more/add-ons/woocommerce/).
409
  * NEW - Added new `White` & `Light Grey` loading style.
admin/admin.php CHANGED
@@ -1252,7 +1252,8 @@ function alm_update_repeater(){
1252
  if($t === 'default') $n = 'default';
1253
  if($t === 'unlimited') $table_name = $wpdb->prefix . "alm_unlimited";
1254
 
1255
- $the_repeater = $wpdb->get_var("SELECT repeaterDefault FROM " . $table_name . " WHERE name = '$n'");
 
1256
 
1257
  echo $the_repeater; // Return repeater value
1258
 
@@ -1482,6 +1483,7 @@ function alm_admin_init(){
1482
  'alm_general_settings'
1483
  );
1484
 
 
1485
  add_settings_field( // Scroll to top on load
1486
  '_alm_scroll_top',
1487
  __('Top of Page', 'ajax-load-more' ),
@@ -1489,6 +1491,7 @@ function alm_admin_init(){
1489
  'ajax-load-more',
1490
  'alm_general_settings'
1491
  );
 
1492
 
1493
  add_settings_field( // Uninstall
1494
  '_alm_uninstall',
@@ -1852,23 +1855,9 @@ function alm_btn_color_callback() {
1852
  $html .= '<button style="cursor: pointer;" type="button" class="alm-load-more-btn'. $loadingClass .'" id="test-alm-button">'.apply_filters('alm_button_label', __('Older Posts', 'ajax-load-more')).'</button>';
1853
 
1854
  $html .= '</div>';
1855
- $html .= '</div>';
1856
 
1857
- echo $html;
1858
- ?>
1859
-
1860
- <script>
1861
- // Button Preview Toggle
1862
- // Toggle button state if not Infinite loading style
1863
- jQuery('button#test-alm-button').click(function() {
1864
- var almWrap = document.querySelector('.alm-btn-wrap .ajax-load-more-wrap');
1865
- if (!almWrap.classList.contains('infinite')){
1866
- jQuery(this).toggleClass('loading');
1867
- }
1868
- });
1869
- </script>
1870
-
1871
- <?php
1872
  }
1873
 
1874
 
1252
  if($t === 'default') $n = 'default';
1253
  if($t === 'unlimited') $table_name = $wpdb->prefix . "alm_unlimited";
1254
 
1255
+ //$the_repeater = $wpdb->get_var("SELECT repeaterDefault FROM " . $table_name . " WHERE name = '$n'");
1256
+ $the_repeater = $wpdb->get_var("SELECT repeaterDefault FROM " . $table_name . " WHERE name = '".esc_sql($n)."'");
1257
 
1258
  echo $the_repeater; // Return repeater value
1259
 
1483
  'alm_general_settings'
1484
  );
1485
 
1486
+ /*
1487
  add_settings_field( // Scroll to top on load
1488
  '_alm_scroll_top',
1489
  __('Top of Page', 'ajax-load-more' ),
1491
  'ajax-load-more',
1492
  'alm_general_settings'
1493
  );
1494
+ */
1495
 
1496
  add_settings_field( // Uninstall
1497
  '_alm_uninstall',
1855
  $html .= '<button style="cursor: pointer;" type="button" class="alm-load-more-btn'. $loadingClass .'" id="test-alm-button">'.apply_filters('alm_button_label', __('Older Posts', 'ajax-load-more')).'</button>';
1856
 
1857
  $html .= '</div>';
1858
+ $html .= '</div>';
1859
 
1860
+ echo $html;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1861
  }
1862
 
1863
 
admin/dist/css/admin.css CHANGED
@@ -603,21 +603,21 @@ disabled look for disabled choices in the results dropdown
603
  display: flex;
604
  -ms-flex-wrap: wrap;
605
  flex-wrap: wrap;
606
- -webkit-box-pack: justify;
607
- -ms-flex-pack: justify;
608
- justify-content: space-between; }
609
  .alm-pro-listing .item {
610
- width: 49.5%;
611
  display: -webkit-box;
612
  display: -ms-flexbox;
613
  display: flex;
614
- margin-bottom: 10px; }
615
  @media screen and (min-width: 1500px) {
616
  .alm-pro-listing .item {
617
- width: 32.775%; } }
618
  @media screen and (max-width: 480px) {
619
  .alm-pro-listing .item {
620
- width: 100%; } }
 
621
  .alm-pro-listing .item h2, .alm-pro-listing .item p, .alm-pro-listing .item img, .alm-pro-listing .item .state {
622
  -webkit-transition: all 0.15s ease;
623
  transition: all 0.15s ease; }
@@ -632,9 +632,9 @@ disabled look for disabled choices in the results dropdown
632
  -webkit-transition: all 0.15s ease;
633
  transition: all 0.15s ease;
634
  border-radius: 2px; }
635
- @media screen and (min-width: 768px) and (max-width: 1100px) {
636
  .alm-pro-listing .item a {
637
- padding: 0 40px; } }
638
  .alm-pro-listing .item a:hover, .alm-pro-listing .item a:focus {
639
  border-color: #bbb; }
640
  .alm-pro-listing .item a:hover h2, .alm-pro-listing .item a:focus h2 {
@@ -646,10 +646,10 @@ disabled look for disabled choices in the results dropdown
646
  display: -webkit-box;
647
  display: -ms-flexbox;
648
  display: flex;
649
- -webkit-box-align: center;
650
- -ms-flex-align: center;
651
- align-items: center; }
652
- @media screen and (min-width: 768px) and (max-width: 1100px) {
653
  .alm-pro-listing .item--detail {
654
  display: block;
655
  text-align: center; }
@@ -660,10 +660,7 @@ disabled look for disabled choices in the results dropdown
660
  .alm-pro-listing .item--detail img {
661
  width: 110px;
662
  height: auto;
663
- margin-right: 15px; }
664
- @media screen and (max-width: 768px) {
665
- .alm-pro-listing .item--detail img {
666
- display: none; } }
667
  .alm-pro-listing .item--detail a {
668
  text-decoration: none; }
669
  .alm-pro-listing .item--detail a:hover, .alm-pro-listing .item--detail a:focus {
@@ -694,6 +691,18 @@ disabled look for disabled choices in the results dropdown
694
  opacity: 0;
695
  -webkit-transition: opacity 0.15s ease;
696
  transition: opacity 0.15s ease; }
 
 
 
 
 
 
 
 
 
 
 
 
697
  .alm-pro-listing .item .result {
698
  position: absolute;
699
  right: 6px;
603
  display: flex;
604
  -ms-flex-wrap: wrap;
605
  flex-wrap: wrap;
606
+ width: calc(100% + 10px);
607
+ margin-left: -5px; }
 
608
  .alm-pro-listing .item {
609
+ width: calc(50% - 10px);
610
  display: -webkit-box;
611
  display: -ms-flexbox;
612
  display: flex;
613
+ margin: 0 5px 10px; }
614
  @media screen and (min-width: 1500px) {
615
  .alm-pro-listing .item {
616
+ width: calc(33.333% - 10px); } }
617
  @media screen and (max-width: 480px) {
618
  .alm-pro-listing .item {
619
+ width: 100%;
620
+ margin: 0 0 10px; } }
621
  .alm-pro-listing .item h2, .alm-pro-listing .item p, .alm-pro-listing .item img, .alm-pro-listing .item .state {
622
  -webkit-transition: all 0.15s ease;
623
  transition: all 0.15s ease; }
632
  -webkit-transition: all 0.15s ease;
633
  transition: all 0.15s ease;
634
  border-radius: 2px; }
635
+ @media screen and (max-width: 1100px) {
636
  .alm-pro-listing .item a {
637
+ padding: 0 10px 20px; } }
638
  .alm-pro-listing .item a:hover, .alm-pro-listing .item a:focus {
639
  border-color: #bbb; }
640
  .alm-pro-listing .item a:hover h2, .alm-pro-listing .item a:focus h2 {
646
  display: -webkit-box;
647
  display: -ms-flexbox;
648
  display: flex;
649
+ -webkit-box-align: start;
650
+ -ms-flex-align: start;
651
+ align-items: flex-start; }
652
+ @media screen and (max-width: 1100px) {
653
  .alm-pro-listing .item--detail {
654
  display: block;
655
  text-align: center; }
660
  .alm-pro-listing .item--detail img {
661
  width: 110px;
662
  height: auto;
663
+ margin-right: 20px; }
 
 
 
664
  .alm-pro-listing .item--detail a {
665
  text-decoration: none; }
666
  .alm-pro-listing .item--detail a:hover, .alm-pro-listing .item--detail a:focus {
691
  opacity: 0;
692
  -webkit-transition: opacity 0.15s ease;
693
  transition: opacity 0.15s ease; }
694
+ .alm-pro-listing .item--detail .highlight-addon {
695
+ padding-top: 15px;
696
+ font-size: 12px;
697
+ margin: 0; }
698
+ .alm-pro-listing .item--detail .highlight-addon span {
699
+ display: inline-block;
700
+ padding: 5px;
701
+ position: relative;
702
+ left: -5px;
703
+ line-height: 1;
704
+ background-color: #ffffe8;
705
+ font-weight: 500; }
706
  .alm-pro-listing .item .result {
707
  position: absolute;
708
  right: 6px;
admin/shortcode-builder/components/nextpage.php CHANGED
@@ -89,14 +89,14 @@
89
  <div class="half">
90
  <label for="next-page-scroll" class="full"><?php _e('Enable Scrolling', 'ajax-load-more'); ?></label>
91
  <select class="alm_element" name="next-page-scroll" id="next-page-scroll">
92
- <option value="true" selected="selected"><?php _e('True', 'ajax-load-more'); ?></option>
93
- <option value="false"><?php _e('False', 'ajax-load-more'); ?></option>
94
  </select>
95
  </div>
96
  <div class="half">
97
  <label for="next-page-scroll-top" class="full">
98
  <?php _e('Scroll Top', 'ajax-load-more'); ?>
99
- <a href="javascript:void(0)" class="fa fa-question-circle tooltip" title="<?php _e('The scrolltop position of the window (used with scrolling and fwd/back browser buttons).','ajax-load-more'); ?>"></a>
100
  </label>
101
  <input id="next-page-scroll-top" name="next-page-scroll-top" class="alm_element sm" type="number" min="0" max="1000" step="1" value="30" placeholder="30">
102
  </div>
89
  <div class="half">
90
  <label for="next-page-scroll" class="full"><?php _e('Enable Scrolling', 'ajax-load-more'); ?></label>
91
  <select class="alm_element" name="next-page-scroll" id="next-page-scroll">
92
+ <option value="true"><?php _e('True', 'ajax-load-more'); ?></option>
93
+ <option value="false" selected="selected"><?php _e('False', 'ajax-load-more'); ?></option>
94
  </select>
95
  </div>
96
  <div class="half">
97
  <label for="next-page-scroll-top" class="full">
98
  <?php _e('Scroll Top', 'ajax-load-more'); ?>
99
+ <a href="javascript:void(0)" class="fa fa-question-circle tooltip" title="<?php _e('The scrolltop position of the browser window (used with scrolling and fwd/back browser buttons).','ajax-load-more'); ?>"></a>
100
  </label>
101
  <input id="next-page-scroll-top" name="next-page-scroll-top" class="alm_element sm" type="number" min="0" max="1000" step="1" value="30" placeholder="30">
102
  </div>
admin/shortcode-builder/components/paging.php CHANGED
@@ -50,6 +50,33 @@
50
  </div>
51
  </section>
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  <section>
54
  <div class="shortcode-builder--label">
55
  <h4><?php _e('Controls', 'ajax-load-more'); ?></h4>
50
  </div>
51
  </section>
52
 
53
+ <?php if( ALM_PAGING_VERSION > '1.5.2'){ ?>
54
+ <section>
55
+ <div class="shortcode-builder--label">
56
+ <h4><?php _e('Scroll', 'ajax-load-more'); ?></h4>
57
+ <p><?php _e('Move users to the top of the Ajax Load More container after a paging click event.', 'ajax-load-more'); ?></p>
58
+ </div>
59
+ <div class="shortcode-builder--fields">
60
+ <section class="first">
61
+ <div class="half">
62
+ <label for="paging-scroll" class="full"><?php _e('Enable Scrolling', 'ajax-load-more'); ?></label>
63
+ <select class="alm_element" name="paging-scroll" id="paging-scroll">
64
+ <option value="true" selected="selected"><?php _e('True', 'ajax-load-more'); ?></option>
65
+ <option value="false"><?php _e('False', 'ajax-load-more'); ?></option>
66
+ </select>
67
+ </div>
68
+ <div class="half paging-scrolltop-wrap">
69
+ <label for="paging-scrolltop" class="full">
70
+ <?php _e('Scroll Top', 'ajax-load-more'); ?>
71
+ <a href="javascript:void(0)" class="fa fa-question-circle tooltip" title="<?php _e('The scrolltop position of the browser window when scrolling back to top.','ajax-load-more'); ?>"></a>
72
+ </label>
73
+ <input id="paging-scrolltop" name="paging-scrolltop" class="alm_element sm" type="number" min="0" max="1000" step="1" value="100" placeholder="100">
74
+ </div>
75
+ </section>
76
+ </div>
77
+ </section>
78
+ <?php } ?>
79
+
80
  <section>
81
  <div class="shortcode-builder--label">
82
  <h4><?php _e('Controls', 'ajax-load-more'); ?></h4>
admin/shortcode-builder/js/shortcode-builder.js CHANGED
@@ -436,26 +436,37 @@ jQuery(document).ready(function($) {
436
  var paging_controls = $('#alm-paging input[name=paging-controls]:checked').val();
437
  var paging_show_at_most = $('#alm-paging input#show-at-most').val();
438
  var paging_classes = $('#alm-paging input#paging-classes').val();
 
 
439
 
440
  var paging_first_label = $('#alm-paging input#paging-first-label').val();
441
  var paging_last_label = $('#alm-paging input#paging-last-label').val();
442
  var paging_previous_label = $('#alm-paging input#paging-previous-label').val();
443
  var paging_next_label = $('#alm-paging input#paging-next-label').val();
444
-
445
  if(paging !== 'false' && paging != undefined){
446
  output += ' paging="'+paging+'"';
447
- output += ' paging_controls="'+paging_controls+'"';
 
 
 
448
  if(paging_show_at_most !== ''){
449
  output += ' paging_show_at_most="'+paging_show_at_most+'"';
450
  }
451
- if(paging_classes !== ''){
452
- output += ' paging_classes="'+paging_classes+'"';
 
 
 
 
453
  }
 
454
  $('#nav-controls').slideDown(250, 'alm_easeInOutQuad');
 
 
455
 
456
  if(paging_controls === 'true'){
457
  $('#paging-controls-nav').slideDown(250, 'alm_easeInOutQuad');
458
-
459
  output += (paging_first_label !== '') ? ' paging_first_label="'+paging_first_label+'"' : '';
460
  output += (paging_last_label !== '') ? ' paging_last_label="'+paging_last_label+'"' : '';
461
  output += (paging_previous_label !== '') ? ' paging_previous_label="'+paging_previous_label+'"' : '';
436
  var paging_controls = $('#alm-paging input[name=paging-controls]:checked').val();
437
  var paging_show_at_most = $('#alm-paging input#show-at-most').val();
438
  var paging_classes = $('#alm-paging input#paging-classes').val();
439
+ var paging_scroll = $('#alm-paging select#paging-scroll').val();
440
+ var paging_scrolltop = $('#alm-paging input#paging-scrolltop').val();
441
 
442
  var paging_first_label = $('#alm-paging input#paging-first-label').val();
443
  var paging_last_label = $('#alm-paging input#paging-last-label').val();
444
  var paging_previous_label = $('#alm-paging input#paging-previous-label').val();
445
  var paging_next_label = $('#alm-paging input#paging-next-label').val();
446
+
447
  if(paging !== 'false' && paging != undefined){
448
  output += ' paging="'+paging+'"';
449
+
450
+ if(paging_classes !== ''){
451
+ output += ' paging_classes="'+paging_classes+'"';
452
+ }
453
  if(paging_show_at_most !== ''){
454
  output += ' paging_show_at_most="'+paging_show_at_most+'"';
455
  }
456
+ if(paging_scroll !== 'false'){
457
+ $('.paging-scrolltop-wrap').show();
458
+ paging_scrolltop = (paging_scrolltop) ? paging_scrolltop : 100;
459
+ output += ' paging_scroll="true:'+ paging_scrolltop+ '"';
460
+ } else {
461
+ $('.paging-scrolltop-wrap').hide();
462
  }
463
+
464
  $('#nav-controls').slideDown(250, 'alm_easeInOutQuad');
465
+
466
+ output += ' paging_controls="'+paging_controls+'"';
467
 
468
  if(paging_controls === 'true'){
469
  $('#paging-controls-nav').slideDown(250, 'alm_easeInOutQuad');
 
470
  output += (paging_first_label !== '') ? ' paging_first_label="'+paging_first_label+'"' : '';
471
  output += (paging_last_label !== '') ? ' paging_last_label="'+paging_last_label+'"' : '';
472
  output += (paging_previous_label !== '') ? ' paging_previous_label="'+paging_previous_label+'"' : '';
admin/shortcode-builder/shortcode-builder.php CHANGED
File without changes
admin/src/scss/partials/_pro-listing.scss CHANGED
@@ -48,18 +48,20 @@
48
  &--wrap{
49
  display: flex;
50
  flex-wrap: wrap;
51
- justify-content: space-between;
 
52
  }
53
 
54
  .item{
55
- width: 49.5%;
56
  display: flex;
57
- margin-bottom: 10px;
58
  @media screen and (min-width: 1500px){
59
- width: 32.775%;
60
  }
61
  @media screen and (max-width: 480px){
62
  width: 100%;
 
63
  }
64
  h2, p, img, .state{
65
  transition: all 0.15s ease;
@@ -72,8 +74,8 @@
72
  border: 1px solid #e1e1e1;
73
  transition: all 0.15s ease;
74
  border-radius: 2px;
75
- @media screen and (min-width: 768px) and (max-width: 1100px){
76
- padding: 0 40px;
77
  }
78
  &:hover,
79
  &:focus{
@@ -88,8 +90,8 @@
88
  position: relative;
89
  min-height: 110px;
90
  display: flex;
91
- align-items: center;
92
- @media screen and (min-width: 768px) and (max-width: 1100px){
93
  display: block;
94
  text-align: center;
95
  img{
@@ -102,10 +104,7 @@
102
  img{
103
  width: 110px;
104
  height: auto;
105
- margin-right: 15px;
106
- @media screen and (max-width: 768px){
107
- display: none;
108
- }
109
  }
110
  a{
111
  text-decoration: none;
@@ -143,6 +142,21 @@
143
  transition: opacity 0.15s ease;
144
  }
145
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  }
147
  .result{
148
  position: absolute;
48
  &--wrap{
49
  display: flex;
50
  flex-wrap: wrap;
51
+ width: calc(100% + 10px);
52
+ margin-left: -5px;
53
  }
54
 
55
  .item{
56
+ width: calc(50% - 10px);
57
  display: flex;
58
+ margin: 0 5px 10px;
59
  @media screen and (min-width: 1500px){
60
+ width: calc(33.333% - 10px);
61
  }
62
  @media screen and (max-width: 480px){
63
  width: 100%;
64
+ margin: 0 0 10px;
65
  }
66
  h2, p, img, .state{
67
  transition: all 0.15s ease;
74
  border: 1px solid #e1e1e1;
75
  transition: all 0.15s ease;
76
  border-radius: 2px;
77
+ @media screen and (max-width: 1100px){
78
+ padding: 0 10px 20px;
79
  }
80
  &:hover,
81
  &:focus{
90
  position: relative;
91
  min-height: 110px;
92
  display: flex;
93
+ align-items: flex-start;
94
+ @media screen and (max-width: 1100px){
95
  display: block;
96
  text-align: center;
97
  img{
104
  img{
105
  width: 110px;
106
  height: auto;
107
+ margin-right: 20px;
 
 
 
108
  }
109
  a{
110
  text-decoration: none;
142
  transition: opacity 0.15s ease;
143
  }
144
  }
145
+ .highlight-addon{
146
+ padding-top: 15px;
147
+ font-size: 12px;
148
+ margin: 0;
149
+
150
+ span{
151
+ display: inline-block;
152
+ padding: 5px;
153
+ position: relative;
154
+ left: -5px;
155
+ line-height: 1;
156
+ background-color: $yellow;
157
+ font-weight: 500;
158
+ }
159
+ }
160
  }
161
  .result{
162
  position: absolute;
admin/views/extensions.php CHANGED
File without changes
ajax-load-more.php CHANGED
@@ -7,14 +7,14 @@ Text Domain: ajax-load-more
7
  Author: Darren Cooney
8
  Twitter: @KaptonKaos
9
  Author URI: https://connekthq.com
10
- Version: 5.3.0
11
  License: GPL
12
  Copyright: Darren Cooney & Connekt Media
13
  */
14
 
15
 
16
- define('ALM_VERSION', '5.3.0');
17
- define('ALM_RELEASE', 'April 22, 2020');
18
  define('ALM_STORE_URL', 'https://connekthq.com');
19
 
20
 
@@ -380,7 +380,7 @@ if( !class_exists('AjaxLoadMore') ):
380
  }
381
 
382
  // Prevent loading of unnessasry posts - move user to top of page
383
- $scrolltop = (!isset($options['_alm_scroll_top']) || $options['_alm_scroll_top'] != '1') ? 'false' : 'true';
384
 
385
 
386
  // Localized JS variables
@@ -390,8 +390,10 @@ if( !class_exists('AjaxLoadMore') ):
390
  array(
391
  'ajaxurl' => admin_url('admin-ajax.php'),
392
  'alm_nonce' => wp_create_nonce( "ajax_load_more_nonce" ),
 
 
393
  'pluginurl' => ALM_URL,
394
- 'scrolltop' => $scrolltop,
395
  'speed' => apply_filters('alm_speed', 200),
396
  'ga_debug' => apply_filters('alm_ga_debug', 'false'),
397
  'results_text' => apply_filters('alm_display_results', __('Viewing {post_count} of {total_posts} results.', 'ajax-load-more')),
@@ -666,7 +668,6 @@ if( !class_exists('AjaxLoadMore') ):
666
  // End Call to Action [Before]
667
 
668
  // Repeater Templates
669
-
670
  if($theme_repeater !== 'null' && has_action('alm_get_theme_repeater')){
671
  // Theme Repeater
672
  do_action('alm_get_theme_repeater', $theme_repeater, $alm_found_posts, $alm_page, $alm_item, $alm_current);
7
  Author: Darren Cooney
8
  Twitter: @KaptonKaos
9
  Author URI: https://connekthq.com
10
+ Version: 5.3.3
11
  License: GPL
12
  Copyright: Darren Cooney & Connekt Media
13
  */
14
 
15
 
16
+ define('ALM_VERSION', '5.3.3');
17
+ define('ALM_RELEASE', 'May 20, 2020');
18
  define('ALM_STORE_URL', 'https://connekthq.com');
19
 
20
 
380
  }
381
 
382
  // Prevent loading of unnessasry posts - move user to top of page
383
+ //$scrolltop = (!isset($options['_alm_scroll_top']) || $options['_alm_scroll_top'] !== '1') ? 'false' : 'true';
384
 
385
 
386
  // Localized JS variables
390
  array(
391
  'ajaxurl' => admin_url('admin-ajax.php'),
392
  'alm_nonce' => wp_create_nonce( "ajax_load_more_nonce" ),
393
+ 'rest_api' => esc_url_raw( rest_url() ),
394
+ 'rest_nonce' => wp_create_nonce( 'wp_rest' ),
395
  'pluginurl' => ALM_URL,
396
+ //'scrolltop' => $scrolltop,
397
  'speed' => apply_filters('alm_speed', 200),
398
  'ga_debug' => apply_filters('alm_ga_debug', 'false'),
399
  'results_text' => apply_filters('alm_display_results', __('Viewing {post_count} of {total_posts} results.', 'ajax-load-more')),
668
  // End Call to Action [Before]
669
 
670
  // Repeater Templates
 
671
  if($theme_repeater !== 'null' && has_action('alm_get_theme_repeater')){
672
  // Theme Repeater
673
  do_action('alm_get_theme_repeater', $theme_repeater, $alm_found_posts, $alm_page, $alm_item, $alm_current);
core/classes/class.alm-localize.php CHANGED
File without changes
core/classes/class.alm-shortcode.php CHANGED
@@ -80,7 +80,6 @@ if( !class_exists('ALM_SHORTCODE') ):
80
  $atts = ($default_atts) ? array_merge($default_atts, $atts) : $atts;
81
 
82
 
83
-
84
  // Extact shortcode arrtibutes
85
  extract(shortcode_atts(array(
86
  'nested' => false,
@@ -128,7 +127,7 @@ if( !class_exists('ALM_SHORTCODE') ):
128
  'nextpage' => false,
129
  'nextpage_post_id' => '',
130
  'nextpage_urls' => 'true',
131
- 'nextpage_scroll' => 'true:30',
132
  'nextpage_pageviews' => 'true',
133
  'nextpage_start' => 1,
134
  'previous_post' => false,
@@ -149,6 +148,7 @@ if( !class_exists('ALM_SHORTCODE') ):
149
  'paging_controls' => 'false',
150
  'paging_show_at_most' => '7',
151
  'paging_classes' => '',
 
152
  'paging_first_label' => apply_filters('alm_paging_first_label', ''),
153
  'paging_last_label' => apply_filters('alm_paging_last_label', ''),
154
  'paging_previous_label' => apply_filters('alm_paging_previous_label', '&laquo;'),
@@ -888,17 +888,17 @@ if( !class_exists('ALM_SHORTCODE') ):
888
 
889
  // Paging Add-on
890
  if(has_action('alm_paging_installed') && $paging === 'true'){
891
- $paging_return = apply_filters(
892
  'alm_paging_shortcode',
893
  $paging,
894
  $paging_controls,
895
  $paging_show_at_most,
896
- $paging_classes,
897
  $paging_first_label,
898
  $paging_last_label,
899
  $paging_previous_label,
900
  $paging_next_label,
901
- $options
902
  );
903
  $ajaxloadmore .= $paging_return;
904
  }
@@ -1124,12 +1124,14 @@ if( !class_exists('ALM_SHORTCODE') ):
1124
  $ajaxloadmore .= (!empty($lang)) ? ' data-lang="'.$lang.'"' : '';
1125
 
1126
  // Scroll
1127
- $ajaxloadmore .= ' data-scroll="'.$scroll.'"';
1128
- if($scroll === 'true'){
1129
- $ajaxloadmore .= ' data-scroll-distance="'.$scroll_distance.'"';
1130
- $ajaxloadmore .= (!empty($scroll_container)) ? ' data-scroll-container="'.$scroll_container.'"' : '';
1131
- $ajaxloadmore .= ' data-max-pages="'.$max_pages.'"';
1132
- $ajaxloadmore .= (!empty($pause_override)) ? ' data-pause-override="'.$pause_override.'"' : '';
 
 
1133
  }
1134
 
1135
  // Pause
80
  $atts = ($default_atts) ? array_merge($default_atts, $atts) : $atts;
81
 
82
 
 
83
  // Extact shortcode arrtibutes
84
  extract(shortcode_atts(array(
85
  'nested' => false,
127
  'nextpage' => false,
128
  'nextpage_post_id' => '',
129
  'nextpage_urls' => 'true',
130
+ 'nextpage_scroll' => 'false:30',
131
  'nextpage_pageviews' => 'true',
132
  'nextpage_start' => 1,
133
  'previous_post' => false,
148
  'paging_controls' => 'false',
149
  'paging_show_at_most' => '7',
150
  'paging_classes' => '',
151
+ 'paging_scroll' => false,
152
  'paging_first_label' => apply_filters('alm_paging_first_label', ''),
153
  'paging_last_label' => apply_filters('alm_paging_last_label', ''),
154
  'paging_previous_label' => apply_filters('alm_paging_previous_label', '&laquo;'),
888
 
889
  // Paging Add-on
890
  if(has_action('alm_paging_installed') && $paging === 'true'){
891
+ $paging_return = apply_filters(
892
  'alm_paging_shortcode',
893
  $paging,
894
  $paging_controls,
895
  $paging_show_at_most,
896
+ $paging_classes,
897
  $paging_first_label,
898
  $paging_last_label,
899
  $paging_previous_label,
900
  $paging_next_label,
901
+ $paging_scroll
902
  );
903
  $ajaxloadmore .= $paging_return;
904
  }
1124
  $ajaxloadmore .= (!empty($lang)) ? ' data-lang="'.$lang.'"' : '';
1125
 
1126
  // Scroll
1127
+ if($paging !== 'true') {
1128
+ $ajaxloadmore .= ' data-scroll="'.$scroll.'"';
1129
+ if($scroll === 'true'){
1130
+ $ajaxloadmore .= ' data-scroll-distance="'.$scroll_distance.'"';
1131
+ $ajaxloadmore .= (!empty($scroll_container)) ? ' data-scroll-container="'.$scroll_container.'"' : '';
1132
+ $ajaxloadmore .= ' data-max-pages="'.$max_pages.'"';
1133
+ $ajaxloadmore .= (!empty($pause_override)) ? ' data-pause-override="'.$pause_override.'"' : '';
1134
+ }
1135
  }
1136
 
1137
  // Pause
core/classes/includes/preloaded.php CHANGED
@@ -305,15 +305,15 @@ else {
305
  $alm_current++;
306
 
307
  // Call to Action [Before]
308
- if($cta && has_action('alm_cta_inc') && $cta_pos === 'before'){
309
- $output .= ($alm_current == $cta_val) ? apply_filters('alm_cta_inc', $cta_repeater, $cta_theme_repeater, $alm_found_posts, $alm_page, $alm_item, $alm_current, true) : '';
310
  }
311
 
312
  // Repeater Template
313
  $output .= alm_loop($repeater, $type, $theme_repeater, $alm_found_posts, $alm_page, $alm_item, $alm_current);
314
 
315
  // Call to Action [After]
316
- if($cta && has_action('alm_cta_inc') && $cta_pos === 'after'){
317
  $output .= ($alm_current == $cta_val) ? apply_filters('alm_cta_inc', $cta_repeater, $cta_theme_repeater, $alm_found_posts, $alm_page, $alm_item, $alm_current, true) : '';
318
  }
319
 
305
  $alm_current++;
306
 
307
  // Call to Action [Before]
308
+ if($cta === 'true' && has_action('alm_cta_inc') && $cta_pos === 'before'){
309
+ $output .= ($alm_current == $cta_val) ? apply_filters('alm_cta_inc', $cta_repeater, $cta_theme_repeater, $alm_found_posts, $alm_page, $alm_item, $alm_current, true) : '';
310
  }
311
 
312
  // Repeater Template
313
  $output .= alm_loop($repeater, $type, $theme_repeater, $alm_found_posts, $alm_page, $alm_item, $alm_current);
314
 
315
  // Call to Action [After]
316
+ if($cta === 'true' && has_action('alm_cta_inc') && $cta_pos === 'after'){
317
  $output .= ($alm_current == $cta_val) ? apply_filters('alm_cta_inc', $cta_repeater, $cta_theme_repeater, $alm_found_posts, $alm_page, $alm_item, $alm_current, true) : '';
318
  }
319
 
core/dist/css/ajax-load-more.css CHANGED
File without changes
core/dist/css/ajax-load-more.min.css CHANGED
File without changes
core/dist/js/ajax-load-more.js CHANGED
@@ -87,10 +87,10 @@ var ajaxloadmore =
87
  /************************************************************************/
88
  /******/ ({
89
 
90
- /***/ "./core/src/js/ajax-load-more.js":
91
- /*!***************************************!*\
92
- !*** ./core/src/js/ajax-load-more.js ***!
93
- \***************************************/
94
  /*! no static exports found */
95
  /***/ (function(module, exports, __webpack_require__) {
96
 
@@ -98,3730 +98,3323 @@ var ajaxloadmore =
98
 
99
 
100
  Object.defineProperty(exports, "__esModule", {
101
- value: true
102
  });
103
- exports.render = exports.getOffset = exports.almScroll = exports.start = exports.tracking = exports.tab = exports.filter = undefined;
104
-
105
- var _axios = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
106
 
107
- var _axios2 = _interopRequireDefault(_axios);
 
 
 
 
 
 
 
 
108
 
109
- var _smoothscrollPolyfill = __webpack_require__(/*! smoothscroll-polyfill */ "./node_modules/smoothscroll-polyfill/dist/smoothscroll.js");
 
 
110
 
111
- var _smoothscrollPolyfill2 = _interopRequireDefault(_smoothscrollPolyfill);
 
 
 
 
112
 
113
- __webpack_require__(/*! ./helpers/helpers */ "./core/src/js/helpers/helpers.js");
 
114
 
115
- var _getParameterByName = __webpack_require__(/*! ./helpers/getParameterByName */ "./core/src/js/helpers/getParameterByName.js");
 
 
 
 
 
 
 
 
116
 
117
- var _getParameterByName2 = _interopRequireDefault(_getParameterByName);
 
 
118
 
119
- var _almAppendChildren = __webpack_require__(/*! ./helpers/almAppendChildren */ "./core/src/js/helpers/almAppendChildren.js");
 
 
 
120
 
121
- var _almAppendChildren2 = _interopRequireDefault(_almAppendChildren);
 
 
 
 
122
 
123
- var _tableWrap = __webpack_require__(/*! ./helpers/tableWrap */ "./core/src/js/helpers/tableWrap.js");
 
 
 
124
 
125
- var _tableWrap2 = _interopRequireDefault(_tableWrap);
 
 
 
 
 
 
 
 
 
 
 
126
 
127
- var _getCacheUrl = __webpack_require__(/*! ./helpers/getCacheUrl */ "./core/src/js/helpers/getCacheUrl.js");
 
128
 
129
- var _getCacheUrl2 = _interopRequireDefault(_getCacheUrl);
 
130
 
131
- var _almDomParser = __webpack_require__(/*! ./helpers/almDomParser */ "./core/src/js/helpers/almDomParser.js");
 
132
 
133
- var _almDomParser2 = _interopRequireDefault(_almDomParser);
134
 
135
- var _stripEmptyNodes = __webpack_require__(/*! ./helpers/stripEmptyNodes */ "./core/src/js/helpers/stripEmptyNodes.js");
 
 
 
 
 
 
136
 
137
- var _stripEmptyNodes2 = _interopRequireDefault(_stripEmptyNodes);
 
 
 
 
 
 
138
 
139
- var _queryParams = __webpack_require__(/*! ./helpers/queryParams */ "./core/src/js/helpers/queryParams.js");
 
140
 
141
- var queryParams = _interopRequireWildcard(_queryParams);
 
 
 
 
 
 
 
 
 
142
 
143
- var _resultsText = __webpack_require__(/*! ./modules/resultsText */ "./core/src/js/modules/resultsText.js");
 
144
 
145
- var resultsText = _interopRequireWildcard(_resultsText);
 
 
 
 
 
 
146
 
147
- var _tableofcontents = __webpack_require__(/*! ./modules/tableofcontents */ "./core/src/js/modules/tableofcontents.js");
 
148
 
149
- var _setLocalizedVars = __webpack_require__(/*! ./modules/setLocalizedVars */ "./core/src/js/modules/setLocalizedVars.js");
150
 
151
- var _setLocalizedVars2 = _interopRequireDefault(_setLocalizedVars);
 
 
 
 
 
152
 
153
- var _insertScript = __webpack_require__(/*! ./modules/insertScript */ "./core/src/js/modules/insertScript.js");
154
 
155
- var _insertScript2 = _interopRequireDefault(_insertScript);
156
 
157
- var _setFocus = __webpack_require__(/*! ./modules/setFocus */ "./core/src/js/modules/setFocus.js");
 
 
 
 
158
 
159
- var _setFocus2 = _interopRequireDefault(_setFocus);
160
 
161
- var _masonry = __webpack_require__(/*! ./modules/masonry */ "./core/src/js/modules/masonry.js");
162
 
163
- var _masonry2 = _interopRequireDefault(_masonry);
 
 
164
 
165
- var _fadeIn = __webpack_require__(/*! ./modules/fadeIn */ "./core/src/js/modules/fadeIn.js");
 
 
 
 
 
 
 
 
 
166
 
167
- var _fadeIn2 = _interopRequireDefault(_fadeIn);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
 
169
- var _fadeOut = __webpack_require__(/*! ./modules/fadeOut */ "./core/src/js/modules/fadeOut.js");
170
 
171
- var _fadeOut2 = _interopRequireDefault(_fadeOut);
 
 
 
 
 
 
 
172
 
173
- var _filtering = __webpack_require__(/*! ./modules/filtering */ "./core/src/js/modules/filtering.js");
174
 
175
- var _filtering2 = _interopRequireDefault(_filtering);
 
 
176
 
177
- var _noResults = __webpack_require__(/*! ./modules/noResults */ "./core/src/js/modules/noResults.js");
 
 
 
 
 
 
 
 
 
 
 
 
178
 
179
- var _noResults2 = _interopRequireDefault(_noResults);
180
 
181
- var _almDebug = __webpack_require__(/*! ./modules/almDebug */ "./core/src/js/modules/almDebug.js");
 
 
 
 
 
182
 
183
- var _almDebug2 = _interopRequireDefault(_almDebug);
184
 
185
- var _getScrollPercentage = __webpack_require__(/*! ./modules/getScrollPercentage */ "./core/src/js/modules/getScrollPercentage.js");
186
 
187
- var _getScrollPercentage2 = _interopRequireDefault(_getScrollPercentage);
 
 
 
 
 
 
188
 
189
- var _srcsetPolyfill = __webpack_require__(/*! ./helpers/srcsetPolyfill */ "./core/src/js/helpers/srcsetPolyfill.js");
190
 
191
  var _srcsetPolyfill2 = _interopRequireDefault(_srcsetPolyfill);
192
 
193
- var _placeholder = __webpack_require__(/*! ./modules/placeholder */ "./core/src/js/modules/placeholder.js");
194
-
195
- var _woocommerce = __webpack_require__(/*! ./modules/woocommerce */ "./core/src/js/modules/woocommerce.js");
196
 
197
- var _singleposts = __webpack_require__(/*! ./modules/singleposts */ "./core/src/js/modules/singleposts.js");
198
-
199
- var _singleposts2 = _interopRequireDefault(_singleposts);
200
-
201
- function _interopRequireWildcard(obj) {
202
- if (obj && obj.__esModule) {
203
- return obj;
204
- } else {
205
- var newObj = {};if (obj != null) {
206
- for (var key in obj) {
207
- if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
208
- }
209
- }newObj.default = obj;return newObj;
210
- }
211
- }
212
 
213
  function _interopRequireDefault(obj) {
214
- return obj && obj.__esModule ? obj : { default: obj };
215
- }
216
-
217
- function _toConsumableArray(arr) {
218
- if (Array.isArray(arr)) {
219
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
220
- arr2[i] = arr[i];
221
- }return arr2;
222
- } else {
223
- return Array.from(arr);
224
- }
225
  }
226
 
227
  function _asyncToGenerator(fn) {
228
- return function () {
229
- var gen = fn.apply(this, arguments);return new Promise(function (resolve, reject) {
230
- function step(key, arg) {
231
- try {
232
- var info = gen[key](arg);var value = info.value;
233
- } catch (error) {
234
- reject(error);return;
235
- }if (info.done) {
236
- resolve(value);
237
- } else {
238
- return Promise.resolve(value).then(function (value) {
239
- step("next", value);
240
- }, function (err) {
241
- step("throw", err);
242
- });
243
- }
244
- }return step("next");
245
- });
246
- };
247
  }
248
 
249
- /*
250
- * Ajax Load More
251
- * https://connekthq.com/plugins/ajax-load-more/
252
- * Author: Darren Cooney
253
- * Twitter: @KaptonKaos, @ajaxloadmore, @connekthq
254
- * Copyright Connekt Media - https://connekthq.com
255
- */
256
-
257
- // Polyfills
258
- __webpack_require__(/*! @babel/polyfill/noConflict */ "./node_modules/@babel/polyfill/noConflict.js");
259
- __webpack_require__(/*! ./helpers/polyfills.js */ "./core/src/js/helpers/polyfills.js");
260
-
261
- // External Modules
262
- var qs = __webpack_require__(/*! qs */ "./node_modules/qs/lib/index.js");
263
  var imagesLoaded = __webpack_require__(/*! imagesloaded */ "./node_modules/imagesloaded/imagesloaded.js");
264
- // Smooth scrolling polyfill
265
- _smoothscrollPolyfill2.default.polyfill();
266
 
267
- // ALM Modules
 
 
 
 
 
 
 
268
 
269
- //import commentReplyFix from './helpers/commentReplyFix';
 
 
 
 
 
 
 
 
270
 
 
 
271
 
272
- // Global filtering var
273
- var alm_is_filtering = false;
 
274
 
275
- // Start ALM
276
- (function () {
277
- "use strict";
278
 
279
- /**
280
- * ajaxloadmore
281
- * Init Ajax Load More
282
- *
283
- * @param {*} el
284
- * @param {*} e
285
- */
286
-
287
- var ajaxloadmore = function ajaxloadmore(el, e) {
288
 
289
- // Move user to top of page to prevent loading of unnessasry posts
290
- if (alm_localize && alm_localize.scrolltop === 'true') {
291
- window.scrollTo(0, 0);
292
- }
293
 
294
- //Set ALM Variables
295
- var alm = this;
296
- alm.AjaxLoadMore = {};
297
- alm.addons = {};
298
- alm.extensions = {};
299
- alm.integration = {};
300
- alm.window = window;
301
- alm.page = 0;
302
- alm.posts = 0;
303
- alm.totalposts = 0;
304
- alm.proceed = false;
305
- alm.disable_ajax = false;
306
- alm.init = true;
307
- alm.loading = true;
308
- alm.finished = false;
309
- alm.timer = null;
310
 
311
- alm.ua = window.navigator.userAgent ? window.navigator.userAgent : ''; // Browser User Agent
312
- alm.vendor = window.navigator.vendor ? window.navigator.vendor : ''; // Browser Vendor
313
- alm.isSafari = /Safari/i.test(alm.ua) && /Apple Computer/.test(alm.vendor) && !/Mobi|Android/i.test(alm.ua);
314
 
315
- alm.main = el;
316
- alm.master_id = el.dataset.id ? 'ajax-load-more-' + el.dataset.id : el.id; // The defined or generated ID of the ALM instance
317
- el.classList.add('alm-' + e); // Add unique classname
318
- el.setAttribute('data-alm-id', e); // Add unique data id
319
 
 
 
320
 
321
- // Get localized <script/> variables
322
- alm.master_id = alm.master_id.replace(/-/g, '_'); // Convert dashes to underscores for the var name
323
- alm.localize = window[alm.master_id + '_vars']; // Get localize vars
 
 
 
 
324
 
 
 
 
325
 
326
- // Main ALM Containers
327
- alm.main = el; // Top level DOM element
328
- alm.listing = el.querySelector('.alm-listing') || el.querySelector('.alm-comments');
329
- alm.content = alm.listing;
330
- alm.el = alm.content;
331
- alm.ajax = el.querySelector('.alm-ajax');
332
- alm.container_type = alm.listing.dataset.containerType;
333
 
334
- // Instance Params
335
- alm.canonical_url = el.dataset.canonicalUrl;
336
- alm.nested = el.dataset.nested ? el.dataset.nested : null;
337
- alm.is_search = el.dataset.search;
338
- alm.slug = el.dataset.slug;
339
- alm.post_id = el.dataset.postId;
340
- alm.id = el.dataset.id ? el.dataset.id : '';
341
 
342
- // No results template
343
- var alm_no_results = el.querySelector('.alm-no-results');
344
- alm.no_results = alm_no_results ? alm_no_results.innerHTML : '';
 
 
 
 
345
 
346
- // Shortcode Params
347
- alm.repeater = alm.listing.dataset.repeater; // Repeaters
348
- alm.theme_repeater = alm.listing.dataset.themeRepeater;
 
 
 
349
 
350
- alm.post_type = alm.listing.dataset.postType ? alm.listing.dataset.postType : 'post';
351
- alm.sticky_posts = alm.listing.dataset.stickyPosts ? alm.listing.dataset.stickyPosts : null;
 
 
 
 
 
 
 
 
 
352
 
353
- alm.btnWrap = el.querySelectorAll('.alm-btn-wrap'); // Get all `.alm-button-wrap` divs
354
- alm.btnWrap = Array.prototype.slice.call(alm.btnWrap); // Convert NodeList to array
355
- alm.btnWrap[alm.btnWrap.length - 1].style.visibility = 'visible'; // Get last element (used for nesting)
356
- alm.trigger = alm.btnWrap[alm.btnWrap.length - 1];
357
- alm.button = alm.trigger.querySelector('button.alm-load-more-btn');
358
 
359
- alm.button_label = alm.listing.dataset.buttonLabel;
360
- alm.button_loading_label = alm.listing.dataset.buttonLoadingLabel;
361
- alm.placeholder = alm.main.querySelector('.alm-placeholder');
362
 
363
- alm.scroll_distance = alm.listing.dataset.scrollDistance;
364
- alm.scroll_distance = alm.scroll_distance ? alm.scroll_distance : 100;
365
- alm.scroll_container = alm.listing.dataset.scrollContainer;
366
- alm.max_pages = alm.listing.dataset.maxPages ? parseInt(alm.listing.dataset.maxPages) : 0;
367
- alm.pause_override = alm.listing.dataset.pauseOverride; // true | false
368
- alm.pause = alm.listing.dataset.pause ? alm.listing.dataset.pause : false; // true | false
369
- alm.transition = alm.listing.dataset.transition; // Transition
370
- alm.transition_container = alm.listing.dataset.transitionContainer; // Transition Container
371
- alm.tcc = alm.listing.dataset.transitionContainerClasses; // Transition Container Classes
372
- alm.speed = alm_localize.speed ? parseInt(alm_localize.speed) : 200;
373
- alm.images_loaded = alm.listing.dataset.imagesLoaded ? alm.listing.dataset.imagesLoaded : false;
374
- alm.destroy_after = alm.listing.dataset.destroyAfter ? alm.listing.dataset.destroyAfter : '';
375
- alm.orginal_posts_per_page = parseInt(alm.listing.dataset.postsPerPage); // Used for paging add-on
376
- alm.posts_per_page = alm.listing.dataset.postsPerPage;
377
- alm.offset = alm.listing.dataset.offset ? parseInt(alm.listing.dataset.offset) : 0;
378
- alm.integration.woocommerce = alm.listing.dataset.woocommerce ? alm.listing.dataset.woocommerce : false;
379
- alm.integration.woocommerce = alm.integration.woocommerce === 'true' ? true : false;
380
 
381
- // Addon Shortcode Params
382
- alm.addons.woocommerce = alm.localize.woocommerce ? true : false; // Woocommerce add-on
383
- if (alm.addons.woocommerce) {
384
- alm.addons.woocommerce_columns = alm.localize.woocommerce.columns ? parseInt(alm.localize.woocommerce.columns) : 3; // Woocommerce columns
385
- alm.addons.woocommerce_paged = alm.localize.woocommerce.paged ? parseInt(alm.localize.woocommerce.paged) : 1; // Woocommerce Paged
386
- alm.addons.woocommerce_paged_urls = alm.localize.woocommerce.paged_urls;
387
- alm.addons.woocommerce_pages = parseInt(alm.localize.woocommerce.pages);
388
- alm.addons.woocommerce_classes = {};
389
- alm.addons.woocommerce_classes.container = alm.localize.woocommerce.container;
390
- alm.addons.woocommerce_classes.products = alm.localize.woocommerce.products;
391
- alm.addons.woocommerce_classes.results = alm.localize.woocommerce.results;
392
- alm.addons.woocommerce_results_text = document.querySelectorAll(alm.addons.woocommerce_classes.results);
393
- alm.addons.woocommerce_settings = alm.localize.woocommerce.settings;
394
- alm.page = parseInt(alm.page) + alm.addons.woocommerce_paged;
395
- }
396
 
397
- alm.addons.cache = alm.listing.dataset.cache; // Cache add-on
398
- alm.addons.cache = alm.addons.cache === undefined ? false : alm.addons.cache;
399
- alm.addons.cache_id = alm.listing.dataset.cacheId;
400
- alm.addons.cache_path = alm.listing.dataset.cachePath;
401
- alm.addons.cache_logged_in = alm.listing.dataset.cacheLoggedIn;
402
- alm.addons.cache_logged_in = alm.addons.cache_logged_in === undefined ? false : alm.addons.cache_logged_in;
403
-
404
- alm.addons.cta = alm.listing.dataset.cta; // CTA add-on
405
- alm.addons.cta_position = alm.listing.dataset.ctaPosition;
406
- alm.addons.cta_repeater = alm.listing.dataset.ctaRepeater;
407
- alm.addons.cta_theme_repeater = alm.listing.dataset.ctaThemeRepeater;
408
-
409
- alm.addons.nextpage = alm.listing.dataset.nextpage; // Nextpage add-on
410
- alm.addons.nextpage_urls = alm.listing.dataset.nextpageUrls;
411
- alm.addons.nextpage_scroll = alm.listing.dataset.nextpageScroll;
412
- alm.addons.nextpage_pageviews = alm.listing.dataset.nextpagePageviews;
413
- alm.addons.nextpage_post_id = alm.listing.dataset.nextpagePostId;
414
- alm.addons.nextpage_startpage = alm.listing.dataset.nextpageStartpage;
415
-
416
- alm.addons.single_post = alm.listing.dataset.singlePost; // Previous Post add-on
417
- alm.addons.single_post_id = alm.listing.dataset.singlePostId;
418
- alm.addons.single_post_order = alm.listing.dataset.singlePostOrder;
419
- alm.addons.single_post_init_id = alm.listing.dataset.singlePostId;
420
- alm.addons.single_post_taxonomy = alm.listing.dataset.singlePostTaxonomy;
421
- alm.addons.single_post_excluded_terms = alm.listing.dataset.singlePostExcludedTerms;
422
- alm.addons.single_post_progress_bar = alm.listing.dataset.singlePostProgressBar;
423
- alm.addons.single_post_target = alm.listing.dataset.singlePostTarget;
424
-
425
- alm.addons.comments = alm.listing.dataset.comments; // Comments add-on
426
- alm.addons.comments_post_id = alm.listing.dataset.comments_post_id; // current post id
427
- alm.addons.comments_per_page = alm.listing.dataset.comments_per_page;
428
- alm.addons.comments_per_page = alm.addons.comments_per_page === undefined ? '5' : alm.addons.comments_per_page;
429
- alm.addons.comments_type = alm.listing.dataset.comments_type;
430
- alm.addons.comments_style = alm.listing.dataset.comments_style;
431
- alm.addons.comments_template = alm.listing.dataset.comments_template;
432
- alm.addons.comments_callback = alm.listing.dataset.comments_callback;
433
 
434
- alm.addons.tabs = alm.listing.dataset.tabs;
 
 
 
 
 
 
 
435
 
436
- alm.addons.filters = alm.listing.dataset.filters;
 
437
 
438
- alm.addons.seo = alm.listing.dataset.seo; // SEO add-on
 
 
 
 
 
 
 
 
 
 
 
439
 
440
- alm.addons.preloaded = alm.listing.dataset.preloaded; // Preloaded add-on
441
- alm.addons.preloaded_amount = alm.listing.dataset.preloadedAmount ? alm.listing.dataset.preloadedAmount : 0;
442
- alm.is_preloaded = alm.listing.dataset.isPreloaded === 'true' ? true : false;
 
 
 
 
 
 
 
 
443
 
444
- alm.addons.paging = alm.listing.dataset.paging; // Paging add-on
445
 
446
- alm.addons.users = alm.listing.dataset.users === 'true' ? true : false; // Users add-on
447
- if (alm.addons.users) {
448
- // Override paging params for users
449
- alm.orginal_posts_per_page = alm.listing.dataset.usersPerPage;
450
- alm.posts_per_page = alm.listing.dataset.usersPerPage;
451
- }
452
 
453
- // Extension Shortcode Params
454
- alm.extensions.restapi = alm.listing.dataset.restapi; // REST API
455
- alm.extensions.restapi_base_url = alm.listing.dataset.restapiBaseUrl;
456
- alm.extensions.restapi_namespace = alm.listing.dataset.restapiNamespace;
457
- alm.extensions.restapi_endpoint = alm.listing.dataset.restapiEndpoint;
458
- alm.extensions.restapi_template_id = alm.listing.dataset.restapiTemplateId;
459
- alm.extensions.restapi_debug = alm.listing.dataset.restapiDebug;
460
 
461
- alm.extensions.acf = alm.listing.dataset.acf; // ACF
462
- alm.extensions.acf_field_type = alm.listing.dataset.acfFieldType;
463
- alm.extensions.acf_field_name = alm.listing.dataset.acfFieldName;
464
- alm.extensions.acf_parent_field_name = alm.listing.dataset.acfParentFieldName;
465
- alm.extensions.acf_post_id = alm.listing.dataset.acfPostId;
466
- alm.extensions.acf = alm.extensions.acf === 'true' ? true : false;
467
- // if field type, name or post ID is empty
468
- if (alm.extensions.acf_field_type === undefined || alm.extensions.acf_field_name === undefined || alm.extensions.acf_post_id === undefined) {
469
- alm.extensions.acf = false;
470
- }
471
 
472
- alm.extensions.term_query = alm.listing.dataset.termQuery; // TERM QUERY
473
- alm.extensions.term_query_taxonomy = alm.listing.dataset.termQueryTaxonomy;
474
- alm.extensions.term_query_hide_empty = alm.listing.dataset.termQueryHideEmpty;
475
- alm.extensions.term_query_number = alm.listing.dataset.termQueryNumber;
476
- alm.extensions.term_query = alm.extensions.term_query === 'true' ? true : false;
477
 
478
- /* Paging */
479
- if (alm.addons.paging === 'true') {
480
- alm.addons.paging = true;
481
- alm.addons.paging_init = true;
482
- alm.addons.paging_controls = alm.listing.dataset.pagingControls === 'true' ? true : false;
483
- alm.addons.paging_show_at_most = alm.listing.dataset.pagingShowAtMost;
484
- alm.addons.paging_classes = alm.listing.dataset.pagingClasses;
485
- alm.addons.paging_show_at_most = alm.addons.paging_show_at_most === undefined ? 7 : alm.addons.paging_show_at_most;
486
 
487
- alm.addons.paging_first_label = alm.listing.dataset.pagingFirstLabel;
488
- alm.addons.paging_previous_label = alm.listing.dataset.pagingPreviousLabel;
489
- alm.addons.paging_next_label = alm.listing.dataset.pagingNextLabel;
490
- alm.addons.paging_last_label = alm.listing.dataset.pagingLastLabel;
491
-
492
- // If preloaded, pause ALM
493
- alm.pause = alm.addons.preloaded === 'true' ? true : alm.pause;
494
- } else {
495
- alm.addons.paging = false;
496
- }
497
- /* End Paging */
498
 
499
- /* Filters */
500
- if (alm.addons.filters === 'true') {
501
- alm.addons.filters = true;
502
 
503
- alm.addons.filters_url = alm.listing.dataset.filtersUrl === 'true' ? true : false;
504
- alm.addons.filters_paging = alm.listing.dataset.filtersPaging === 'true' ? true : false;
505
- alm.addons.filters_scroll = alm.listing.dataset.filtersScroll === 'true' ? true : false;
506
- alm.addons.filters_scrolltop = alm.listing.dataset.filtersScrolltop ? alm.listing.dataset.filtersScrolltop : '30';
507
- alm.addons.filters_analtyics = alm.listing.dataset.filtersAnalytics;
508
- alm.addons.filters_debug = alm.listing.dataset.filtersDebug;
509
- alm.addons.filters_startpage = 0;
510
 
511
- // Get Paged Querystring Val
512
- var page = (0, _getParameterByName2.default)('pg');
513
- alm.addons.filters_startpage = page !== null ? parseInt(page) : 0;
514
 
515
- // If not Paging add-on
516
- if (!alm.addons.paging && alm.addons.filters_startpage > 0) {
517
- alm.posts_per_page = alm.posts_per_page * alm.addons.filters_startpage;
518
- alm.isPaged = alm.addons.filters_startpage > 0 ? true : false;
519
- }
520
- } else {
521
- alm.addons.filters = false;
522
- }
523
- /* End Filters */
524
 
525
- /* TABS */
526
- if (alm.addons.tabs === 'true') {
527
- alm.addons.tabs = true;
528
- alm.addons.tab_template = alm.listing.dataset.tabTemplate ? alm.listing.dataset.tabTemplate : '';
529
- alm.addons.tab_onload = alm.listing.dataset.tabOnload ? alm.listing.dataset.tabOnload : '';
530
- alm.addons.tabs_resturl = alm.listing.dataset.tabsRestUrl ? alm.listing.dataset.tabsRestUrl : '';
531
 
532
- // Locate active template (deeplinks)
533
- if (alm.addons.tab_onload !== '') {
534
- var tabNav = document.querySelector('.alm-tab-nav li [data-tab-url=' + alm.addons.tab_onload + ']');
535
- alm.addons.tab_template = tabNav ? tabNav.dataset.tabTemplate : alm.addons.tab_template;
536
- alm.listing.dataset.tabOnload = ''; // Clear tabOnload param
537
- // Set selected tab
538
- if (tabNav) {
539
- var activeTab = document.querySelector('.alm-tab-nav li .active');
540
- if (activeTab) {
541
- activeTab.classList.remove('active');
542
- }
543
- }
544
- }
545
- } else {
546
- alm.addons.tabs = false;
547
- }
548
- /* End TABS */
549
 
550
- /* REST API */
551
- if (alm.extensions.restapi === 'true') {
552
- alm.extensions.restapi = true;
553
- alm.extensions.restapi_debug = alm.extensions.restapi_debug === undefined ? false : alm.extensions.restapi_debug;
554
- alm.extensions.restapi = alm.extensions.restapi_template_id === '' ? false : alm.extensions.restapi;
555
- } else {
556
- alm.extensions.restapi = false;
557
- }
558
- /* End REST API */
559
 
560
- /* Preloaded */
561
- if (alm.addons.preloaded === 'true') {
562
- // Preloaded Amount
563
- alm.addons.preloaded_amount = alm.addons.preloaded_amount === undefined ? alm.posts_per_page : alm.addons.preloaded_amount;
564
- // Disable ALM if total_posts is less than or equal to preloaded_amount
565
- if (alm.localize && alm.localize.total_posts) {
566
- if (parseInt(alm.localize.total_posts) <= parseInt(alm.addons.preloaded_amount)) {
567
- alm.addons.preloaded_total_posts = alm.localize.total_posts;
568
- alm.disable_ajax = true;
569
- }
570
- }
571
- } else {
572
- alm.addons.preloaded = 'false';
573
- }
574
- /* End Preloaded */
575
 
576
- /* SEO */
577
- alm.addons.seo = alm.addons.seo === undefined ? false : alm.addons.seo;
578
- alm.addons.seo = alm.addons.seo === 'true' ? true : alm.addons.seo;
579
- alm.is_search = alm.is_search === undefined ? false : alm.is_search;
580
- alm.search_value = alm.is_search === 'true' ? alm.slug : ''; // Convert to value of slug for appending to seo url
581
 
582
- alm.addons.seo_permalink = alm.listing.dataset.seoPermalink;
583
- alm.addons.seo_pageview = alm.listing.dataset.seoPageview;
584
- alm.addons.seo_trailing_slash = alm.listing.dataset.seoTrailingSlash === 'false' ? '' : '/';
585
- alm.addons.seo_leading_slash = alm.listing.dataset.seoLeadingSlash === 'true' ? '/' : '';
586
- alm.start_page = alm.listing.dataset.seoStartPage;
 
 
 
 
587
 
588
- if (alm.start_page) {
589
- alm.addons.seo_scroll = alm.listing.dataset.seoScroll;
590
- alm.addons.seo_scrolltop = alm.listing.dataset.seoScrolltop;
591
- alm.addons.seo_controls = alm.listing.dataset.seoControls;
592
- alm.isPaged = false;
593
- if (alm.start_page > 1) {
594
- alm.isPaged = true; // Is this a paged page > 1 ?
595
- alm.posts_per_page = alm.start_page * alm.posts_per_page;
596
- }
597
- if (alm.addons.paging) {
598
- // If paging, reset posts_per_page
599
- alm.posts_per_page = alm.orginal_posts_per_page;
600
- }
601
- } else {
602
- alm.start_page = 1;
603
- }
604
- /* End SEO */
605
 
606
- /* Nextpage */
607
- if (alm.addons.nextpage === 'true') {
608
- alm.addons.nextpage = true;
609
- alm.posts_per_page = 1;
610
- } else {
611
- alm.addons.nextpage = false;
612
- }
613
- if (alm.addons.nextpage_urls === undefined) {
614
- alm.addons.nextpage_urls = 'true';
615
- }
616
- if (alm.addons.nextpage_scroll === undefined) {
617
- alm.addons.nextpage_scroll = '250:30';
618
- }
619
- if (alm.addons.nextpage_pageviews === undefined) {
620
- alm.addons.nextpage_pageviews = 'true';
621
- }
622
- if (alm.addons.nextpage_post_id === undefined) {
623
- alm.addons.nextpage = false;
624
- alm.addons.nextpage_post_id = null;
625
- }
626
- if (alm.addons.nextpage_startpage === undefined) {
627
- alm.addons.nextpage_startpage = 1;
628
- }
629
- if (alm.addons.nextpage_startpage > 1) {
630
- alm.isPaged = true;
631
- }
632
- /* End Nextpage */
633
 
634
- /* Single Post */
635
- if (alm.addons.single_post === 'true') {
636
- alm.addons.single_post = true;
637
- alm.addons.single_post_permalink = '';
638
- alm.addons.single_post_title = '';
639
- alm.addons.single_post_slug = '';
640
- } else {
641
- alm.addons.single_post = false;
642
- }
643
- if (alm.addons.single_post_id === undefined) {
644
- alm.addons.single_post_id = '';
645
- alm.addons.single_post_init_id = '';
646
- }
647
- alm.addons.single_post_order = alm.addons.single_post_order === undefined ? 'previous' : alm.addons.single_post_order;
648
- alm.addons.single_post_taxonomy = alm.addons.single_post_taxonomy === undefined ? '' : alm.addons.single_post_taxonomy;
649
- alm.addons.single_post_excluded_terms = alm.addons.single_post_excluded_terms === undefined ? '' : alm.addons.single_post_excluded_terms;
650
- alm.addons.single_post_progress_bar = alm.addons.single_post_progress_bar === undefined ? '' : alm.addons.single_post_progress_bar;
651
- alm.addons.single_post_target = alm.addons.single_post_target === undefined ? '' : alm.addons.single_post_target;
652
- alm.addons.single_post_title_template = alm.listing.dataset.singlePostTitleTemplate;
653
- alm.addons.single_post_siteTitle = alm.listing.dataset.singlePostSiteTitle;
654
- alm.addons.single_post_siteTagline = alm.listing.dataset.singlePostSiteTagline;
655
- alm.addons.single_post_pageview = alm.listing.dataset.singlePostPageview;
656
- alm.addons.single_post_scroll = alm.listing.dataset.singlePostScroll;
657
- alm.addons.single_post_scroll_speed = alm.listing.dataset.singlePostScrollSpeed;
658
- alm.addons.single_post_scroll_top = alm.listing.dataset.singlePostScrolltop;
659
- alm.addons.single_post_controls = alm.listing.dataset.singlePostControls;
660
- /* End Single Post */
661
 
662
- /* Pause */
663
- if (alm.pause === undefined || alm.addons.seo && alm.start_page > 1) {
664
- // SEO only
665
- alm.pause = false;
666
- }
667
- if (alm.addons.preloaded === 'true' && alm.addons.seo && alm.start_page > 0) {
668
- // SEO + Preloaded
669
- alm.pause = false;
670
- }
671
- if (alm.addons.filters && alm.addons.filters_startpage > 0) {
672
- // Filters
673
- alm.pause = false;
674
- }
675
- if (alm.addons.preloaded === 'true' && alm.addons.paging) {
676
- alm.pause = true;
677
- }
678
 
679
- /* Repeater and Theme Repeater */
680
- alm.repeater = alm.repeater === undefined ? 'default' : alm.repeater;
681
- alm.theme_repeater = alm.theme_repeater === undefined ? false : alm.theme_repeater;
682
 
683
- /* Max Pages (while scrolling) */
684
- alm.max_pages = alm.max_pages === undefined || alm.max_pages === 0 ? 10000 : alm.max_pages;
 
 
 
 
 
 
 
 
 
685
 
686
- /* Scroll Distance */
687
- alm.scroll_distance = alm.scroll_distance === undefined ? 100 : alm.scroll_distance;
688
- alm.scroll_distance_perc = false;
689
- if (alm.scroll_distance.toString().indexOf("%") == -1) {
690
- // Standard scroll_distance
691
- alm.scroll_distance = parseInt(alm.scroll_distance);
692
- } else {
693
- // Percentage scroll_distance
694
- alm.scroll_distance_perc = true;
695
- alm.scroll_distance_orig = parseInt(alm.scroll_distance);
696
- alm.scroll_distance = (0, _getScrollPercentage2.default)(alm);
697
- }
 
698
 
699
- /* Scroll Container */
700
- alm.scroll_container = alm.scroll_container === undefined ? '' : alm.scroll_container;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
701
 
702
- /* Transition */
703
- alm.transition = alm.transition === undefined ? 'fade' : alm.transition;
704
 
705
- /* Transition Container Class */
706
- alm.tcc = alm.tcc === undefined ? '' : alm.tcc;
 
 
 
 
707
 
708
- /* Masonry */
709
- alm.is_masonry_preloaded = false;
710
- if (alm.transition === 'masonry') {
711
- alm.masonry_init = true;
712
- if (alm.msnry) {
713
- alm.msnry.destroy(); // destroy masonry if currently exists
714
- } else {
715
- alm.msnry = '';
716
- }
717
- alm.masonry_selector = alm.listing.dataset.masonrySelector;
718
- alm.masonry_columnwidth = alm.listing.dataset.masonryColumnwidth;
719
- alm.masonry_animation = alm.listing.dataset.masonryAnimation;
720
- alm.masonry_animation = alm.masonry_animation === undefined ? 'standard' : alm.masonry_animation;
721
- alm.masonry_horizontalorder = alm.listing.dataset.masonryHorizontalorder;
722
- alm.masonry_horizontalorder = alm.masonry_horizontalorder === undefined ? 'true' : alm.masonry_horizontalorder;
723
- alm.transition_container = false;
724
- alm.images_loaded = false;
725
- alm.is_masonry_preloaded = alm.addons.preloaded === 'true' ? true : alm.is_masonry_preloaded;
726
- }
727
 
728
- /* Scroll */
729
- if (alm.listing.dataset.scroll === undefined) {
730
- alm.scroll = true;
731
- } else if (alm.listing.dataset.scroll === 'false') {
732
- alm.scroll = false;
733
- } else {
734
- alm.scroll = true;
735
- }
736
 
737
- /* Transition Container */
738
- alm.transition_container = alm.transition_container === undefined || alm.transition_container === 'true' ? true : false;
 
 
739
 
740
- /* Button Labels */
741
- alm.button_label = alm.button_label === undefined ? 'Older Posts' : alm.button_label;
742
- alm.button_loading_label = alm.button_loading_label === undefined ? false : alm.button_loading_label;
743
 
744
- /* Paging */
745
- if (alm.addons.paging) {
746
- alm.main.classList.add('loading'); // add loading class to main container
747
- } else {
748
- var almChildren = el.childNodes; // Get child nodes of instance [nodeList]
749
- if (almChildren) {
750
- var almChildArray = Array.prototype.slice.call(almChildren); // Convert nodeList to array
751
 
752
- // Filter array to find the `.alm-btn-wrap` div
753
- var btnWrap = almChildArray.filter(function (element) {
754
- if (!element.classList) {
755
- // If not element (#text node)
756
- return false;
757
- }
758
- return element.classList.contains('alm-btn-wrap');
759
- });
760
- alm.button = btnWrap ? btnWrap[0].querySelector('.alm-load-more-btn') : container.querySelector('.alm-btn-wrap .alm-load-more-btn');
761
- } else {
762
- alm.button = container.querySelector('.alm-btn-wrap .alm-load-more-btn');
763
- }
764
 
765
- // Reset button state
766
- alm.button.disabled = false;
767
- }
768
 
769
- // Results Text
770
- // Render "Showing x of y results" text.
771
- // If woocommerce, get the default woocommerce results block
772
- if (alm.integration.woocommerce) {
773
- alm.resultsText = document.querySelectorAll('.woocommerce-result-count');
774
- if (alm.resultsText.length < 1) {
775
- alm.resultsText = document.querySelectorAll('.alm-results-text');
776
- }
777
- } else {
778
- alm.resultsText = document.querySelectorAll('.alm-results-text');
779
- }
780
- if (alm.resultsText) {
781
- alm.resultsText.forEach(function (results) {
782
- results.setAttribute('aria-live', 'polite');
783
- results.setAttribute('aria-atomic', 'true');
784
- });
785
- } else {
786
- alm.resultsText = false;
787
- }
788
 
789
- // Table of Contents
790
- // Render 1, 2, 3 etc. when pages are loaded
791
- alm.tableofcontents = document.querySelector('.alm-toc');
792
- if (alm.tableofcontents) {
793
- alm.tableofcontents.setAttribute('aria-live', 'polite');
794
- alm.tableofcontents.setAttribute('aria-atomic', 'true');
795
- } else {
796
- alm.tableofcontents = false;
797
- }
798
 
799
- /**
800
- * LoadPosts()
801
- * The function to get posts via Ajax
802
- * @since 2.0.0
803
- */
804
 
805
- alm.AjaxLoadMore.loadPosts = function () {
806
 
807
- if (typeof almOnChange === 'function') {
808
- window.almOnChange(alm);
809
- }
810
 
811
- (0, _placeholder.showPlaceholder)(alm);
812
 
813
- if (!alm.disable_ajax) {
814
- // Check for ajax blocker
815
- if (!alm.addons.paging) {
816
- alm.button.classList.add('loading');
817
- if (alm.button_loading_label !== false) {
818
- alm.button.innerHTML = alm.button_loading_label;
819
- }
820
- }
821
- alm.main.classList.add('alm-loading');
822
- alm.loading = true;
823
 
824
- if (alm.addons.cache === 'true' && !alm.addons.cache_logged_in) {
825
- // Cache
826
- var cache_page = (0, _getCacheUrl2.default)(alm);
827
- if (cache_page) {
828
 
829
- // Load `.html` page
830
- _axios2.default.get(cache_page).then(function (response) {
831
- // Exists
832
- alm.AjaxLoadMore.success(response.data, true);
833
- }).catch(function (error) {
834
- // Error || Page does not yet exist
835
- alm.AjaxLoadMore.ajax('standard');
836
- });
837
- } else {
838
- // Standard ALM query
839
- alm.AjaxLoadMore.ajax('standard');
840
- }
841
- } else {
842
- // Standard ALM query
843
- alm.AjaxLoadMore.ajax('standard');
844
- }
845
- }
846
- };
847
 
848
- /* ajax()
849
- * Ajax Load Moe Ajax function
850
- *
851
- * @param queryType The type of Ajax request (standard/totalposts)
852
- * @since 2.6.0
853
- */
854
 
855
- alm.AjaxLoadMore.ajax = function (queryType) {
856
 
857
- // Default ALM action
858
- var action = 'alm_get_posts';
859
 
860
- // ACF Params
861
- alm.acf_array = '';
862
- if (alm.extensions.acf) {
863
- // Custom query for the Repeater / Gallery / Flexible Content field types
864
- if (alm.extensions.acf_field_type !== 'relationship') {
865
- action = 'alm_acf';
866
- }
867
- alm.acf_array = {
868
- 'acf': 'true',
869
- 'post_id': alm.extensions.acf_post_id,
870
- 'field_type': alm.extensions.acf_field_type,
871
- 'field_name': alm.extensions.acf_field_name,
872
- 'parent_field_name': alm.extensions.acf_parent_field_name
873
- };
874
- }
875
 
876
- // Term Query Params
877
- alm.term_query_array = '';
878
- if (alm.extensions.term_query) {
879
- action = 'alm_get_terms';
880
- alm.term_query_array = {
881
- 'term_query': 'true',
882
- 'taxonomy': alm.extensions.term_query_taxonomy,
883
- 'hide_empty': alm.extensions.term_query_hide_empty,
884
- 'number': alm.extensions.term_query_number
885
- };
886
- }
887
 
888
- // Nextpage Params
889
- alm.nextpage_array = '';
890
- if (alm.addons.nextpage) {
891
- action = 'alm_nextpage';
892
- alm.nextpage_array = {
893
- 'nextpage': 'true',
894
- 'urls': alm.addons.nextpage_urls,
895
- 'scroll': alm.addons.nextpage_scroll,
896
- 'pageviews': alm.addons.nextpage_pageviews,
897
- 'post_id': alm.addons.nextpage_post_id,
898
- 'startpage': alm.addons.nextpage_startpage
899
- };
900
- }
901
 
902
- // Previous Post Params
903
- alm.single_post_array = '';
904
- if (alm.addons.single_post) {
905
- alm.single_post_array = {
906
- 'single_post': 'true',
907
- 'id': alm.addons.single_post_id,
908
- 'slug': alm.addons.single_post_slug
909
- };
910
- }
911
 
912
- // Comment Params
913
- alm.comments_array = '';
914
- if (alm.addons.comments === 'true') {
915
- action = 'alm_comments';
916
- alm.posts_per_page = alm.addons.comments_per_page;
917
- alm.comments_array = {
918
- 'comments': 'true',
919
- 'post_id': alm.addons.comments_post_id,
920
- 'per_page': alm.addons.comments_per_page,
921
- 'type': alm.addons.comments_type,
922
- 'style': alm.addons.comments_style,
923
- 'template': alm.addons.comments_template,
924
- 'callback': alm.addons.comments_callback
925
- };
926
- }
927
 
928
- // Users Params
929
- alm.users_array = '';
930
- if (alm.addons.users) {
931
- action = 'alm_users';
932
- alm.users_array = {
933
- 'users': 'true',
934
- 'role': alm.listing.dataset.usersRole,
935
- 'include': alm.listing.dataset.usersInclude,
936
- 'exclude': alm.listing.dataset.usersExclude,
937
- 'per_page': alm.posts_per_page,
938
- 'order': alm.listing.dataset.usersOrder,
939
- 'orderby': alm.listing.dataset.usersOrderby
940
- };
941
- }
942
 
943
- // CTA Params
944
- alm.cta_array = '';
945
- if (alm.addons.cta === 'true') {
946
- alm.cta_array = {
947
- 'cta': 'true',
948
- 'cta_position': alm.addons.cta_position,
949
- 'cta_repeater': alm.addons.cta_repeater,
950
- 'cta_theme_repeater': alm.addons.cta_theme_repeater
951
- };
952
- }
953
 
954
- // REST API
955
- if (alm.extensions.restapi) {
956
- alm.AjaxLoadMore.restapi(alm, action, queryType);
957
- }
958
- // Tabs
959
- else if (alm.addons.tabs) {
960
- alm.AjaxLoadMore.tabs(alm);
961
- }
962
- // Standard ALM
963
- else {
964
- alm.AjaxLoadMore.adminajax(alm, action, queryType);
965
- }
966
- };
967
 
968
- /**
969
- * adminajax
970
- * Send request to the admin-ajax.php
971
- *
972
- * @param {*} alm | ALm object
973
- * @param {*} action | Ajax action
974
- * @param {*} queryType
975
- * @since 5.0.0
976
- */
977
- alm.AjaxLoadMore.adminajax = function (alm, action, queryType) {
978
 
979
- if (alm.page != 1 && !alm.addons.paging) {
980
- alm.button.classList.add('loading');
981
- }
982
 
983
- // Axios Interceptor for nested data objects
984
- _axios2.default.interceptors.request.use(function (config) {
985
- config.paramsSerializer = function (params) {
986
- // Qs is already included in the Axios package
987
- return qs.stringify(params, {
988
- arrayFormat: 'brackets',
989
- encode: false
990
- });
991
- };
992
- return config;
993
- });
994
 
995
- // Get Ajax URL
996
- var ajaxURL = alm_localize.ajaxurl;
997
 
998
- // Get data params
999
- var params = queryParams.almGetAjaxParams(alm, action, queryType); // [./helpers/queryParams.js
1000
 
 
1001
 
1002
- // Single Posts Add-on
1003
- // If has `single_post_target`, adjust the Ajax URL to the post URL.
1004
- if (alm.addons.single_post && alm.addons.single_post_target) {
1005
- ajaxURL = alm.addons.single_post_permalink;
1006
- params = '';
1007
- }
1008
 
1009
- // WooCommerce Add-on
1010
- if (alm.addons.woocommerce) {
1011
- ajaxURL = (0, _woocommerce.wooGetURL)(alm);
1012
- params = '';
1013
- }
1014
 
1015
- // Send HTTP request via axios
1016
- _axios2.default.get(ajaxURL, { params: params }).then(function (response) {
1017
 
1018
- // Success
1019
- var data = '';
1020
 
1021
- if (alm.addons.single_post && alm.addons.single_post_target) {
1022
- // Single Posts
1023
- data = (0, _singleposts2.default)(response, alm.addons.single_post_target);
1024
- } else if (alm.addons.woocommerce) {
1025
- // WooCommerce
1026
- data = (0, _woocommerce.wooGetContent)(response, alm);
1027
- } else {
1028
- // Get data from response
1029
- data = response.data;
1030
- }
1031
 
1032
- // Standard Query
1033
- if (queryType === 'standard') {
1034
- alm.AjaxLoadMore.success(data, false);
1035
- } else if (queryType === 'totalpages' && alm.addons.paging && alm.addons.nextpage) {
1036
- // Next Page and Paging
1037
- if (typeof almBuildPagination === 'function') {
1038
- window.almBuildPagination(data.totalpages, alm);
1039
- }
1040
- } else if (queryType === 'totalposts' && alm.addons.paging) {
1041
- // Paging
1042
- if (typeof almBuildPagination === 'function') {
1043
- window.almBuildPagination(data.totalposts, alm);
1044
- }
1045
- }
1046
- }).catch(function (error) {
1047
 
1048
- // Error
1049
- alm.AjaxLoadMore.error(error, 'adminajax');
1050
- });
1051
- };
1052
 
1053
- /**
1054
- * tabs
1055
- * Send request to the WP REST API
1056
- *
1057
- * @param {*} alm | ALm object
1058
- * @since 5.2.0
1059
- */
1060
- alm.AjaxLoadMore.tabs = function (alm) {
1061
 
1062
- var alm_rest_url = alm.addons.tabs_resturl + 'ajaxloadmore/tab';
1063
 
1064
- var params = {
1065
- post_id: alm.post_id,
1066
- template: alm.addons.tab_template
1067
 
1068
- // Axios Interceptor for nested data objects
1069
- };_axios2.default.interceptors.request.use(function (config) {
1070
- config.paramsSerializer = function (params) {
1071
- // Qs is already included in the Axios package
1072
- return qs.stringify(params, {
1073
- arrayFormat: 'brackets',
1074
- encode: false
1075
- });
1076
- };
1077
- return config;
1078
- });
1079
 
1080
- // Send Ajax request
1081
- _axios2.default.get(alm_rest_url, { params: params }).then(function (response) {
1082
 
1083
- // Success
1084
- var results = response.data; // Get data from response
1085
- var html = results.html;
1086
 
1087
- // Create object to pass to success()
1088
- var obj = {
1089
- 'html': html,
1090
- 'meta': {
1091
- 'postcount': 1,
1092
- 'totalposts': 1
1093
- }
1094
- };
1095
- alm.AjaxLoadMore.success(obj, false); // Send data
1096
 
 
1097
 
1098
- // Callback to Tabs add-on
1099
- if (typeof almTabLoaded === 'function') {
1100
- window.almTabLoaded(alm);
1101
- }
1102
- }).catch(function (error) {
1103
- // Error
1104
- alm.AjaxLoadMore.error(error, 'restapi');
1105
- });
1106
- };
1107
 
1108
- /**
1109
- * restapi
1110
- * Send request to the WP REST API
1111
- *
1112
- * @param {*} alm | ALm object
1113
- * @param {*} action | Ajax action
1114
- * @param {*} queryType
1115
- * @since 5.0.0
1116
- */
1117
- alm.AjaxLoadMore.restapi = function (alm, action, queryType) {
1118
 
1119
- var alm_rest_template = wp.template(alm.extensions.restapi_template_id);
1120
- var alm_rest_url = alm.extensions.restapi_base_url + '/' + alm.extensions.restapi_namespace + '/' + alm.extensions.restapi_endpoint;
1121
- var params = queryParams.almGetRestParams(alm); // [./helpers/queryParams.js]
1122
 
1123
- // Axios Interceptor for nested data objects
1124
- _axios2.default.interceptors.request.use(function (config) {
1125
- config.paramsSerializer = function (params) {
1126
- // Qs is already included in the Axios package
1127
- return qs.stringify(params, {
1128
- arrayFormat: 'brackets',
1129
- encode: false
1130
- });
1131
- };
1132
- return config;
1133
- });
1134
 
1135
- // Send Ajax request
1136
- _axios2.default.get(alm_rest_url, { params: params }).then(function (response) {
1137
- // Success
1138
- var results = response.data; // Get data from response
1139
- var data = '',
1140
- html = results.html,
1141
- meta = results.meta,
1142
- postcount = meta.postcount,
1143
- totalposts = meta.totalposts;
1144
 
1145
- // loop results to get data from each
1146
- for (var i = 0; i < html.length; i++) {
1147
- var result = html[i];
1148
- if (alm.restapi_debug === 'true') {
1149
- // If debug
1150
- console.log(result);
1151
- }
1152
- data += alm_rest_template(result);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1153
  }
 
 
 
 
1154
 
1155
- // Create object to pass to success()
1156
- var obj = {
1157
- 'html': data,
1158
- 'meta': {
1159
- 'postcount': postcount,
1160
- 'totalposts': totalposts
1161
- }
1162
- };
1163
- alm.AjaxLoadMore.success(obj, false); // Send data
1164
- }).catch(function (error) {
1165
- // Error
1166
- alm.AjaxLoadMore.error(error, 'restapi');
1167
- });
1168
- };
1169
 
1170
- // If pagination enabled, run totalposts query
1171
- if (alm.addons.paging) {
1172
- if (alm.addons.nextpage) {
1173
- alm.AjaxLoadMore.ajax('totalpages'); // Create paging menu and query for total pages
1174
- } else {
1175
- alm.AjaxLoadMore.ajax('totalposts'); // Create paging menu and query for total posts
1176
- }
1177
- }
1178
 
1179
- /**
1180
- * success
1181
- * Success function after loading data
1182
- *
1183
- * @param data The results of the Ajax request
1184
- * @param is_cache Are results of the Ajax request coming from cache
1185
- * @since 2.6.0
1186
- */
1187
- alm.AjaxLoadMore.success = function (data, is_cache) {
1188
- var _this = this;
1189
 
1190
- if (alm.addons.single_post) {
1191
- // Get previous page data
1192
- alm.AjaxLoadMore.getSinglePost();
1193
- }
1194
 
1195
- var isPaged = false;
1196
 
1197
- // Create `.alm-reveal` element
1198
- //let reveal = document.createElement('div');
1199
- var reveal = alm.container_type === 'table' ? document.createElement('tbody') : document.createElement('div');
1200
- alm.el = reveal;
1201
- reveal.style.opacity = 0;
1202
- reveal.style.height = 0;
1203
- reveal.style.outline = 'none';
1204
 
1205
- // Paging container
1206
- var pagingContent = alm.listing.querySelector('.alm-paging-content');
1207
 
1208
- var html, meta, total, totalLoaded;
 
 
1209
 
1210
- if (is_cache) {
1211
- // If Cache, do not look for json data as we won't be querying the DB.
1212
- html = data;
1213
- } else {
1214
- // Standard ALM query results
1215
- html = data.html;
1216
- meta = data.meta;
1217
- alm.posts = alm.addons.paging ? meta.postcount : alm.posts + meta.postcount;
1218
- total = meta.postcount;
1219
- alm.totalposts = meta.totalposts;
1220
- alm.totalposts = alm.addons.preloaded === 'true' ? alm.totalposts - alm.addons.preloaded_amount : alm.totalposts;
1221
- alm.debug = meta.debug ? meta.debug : '';
1222
- }
1223
 
1224
- // Set alm.html as plain text return
1225
- alm.html = html;
1226
 
1227
- // If cache, get the length of the html object
1228
- total = is_cache ? (0, _almDomParser2.default)(html).length : total;
 
 
1229
 
1230
- // First Run Only
1231
- if (alm.init) {
1232
- // Set Meta
1233
- if (meta) {
1234
- alm.main.dataset.totalPosts = meta.totalposts ? meta.totalposts : 0;
1235
- }
1236
- // Paging
1237
- if (alm.addons.paging && total > 0) {
1238
- // Add paging containers and content
1239
- alm.AjaxLoadMore.pagingInit(html, 'alm-reveal');
1240
- }
1241
- // ALM Empty
1242
- if (total === 0) {
1243
- if (alm.addons.paging) {
1244
- if (typeof almPagingEmpty === 'function') {
1245
- window.almPagingEmpty(alm);
1246
- }
1247
- }
1248
- if (typeof almEmpty === 'function') {
1249
- window.almEmpty(alm);
1250
- }
1251
- if (alm.no_results) {
1252
- setTimeout(function () {
1253
- (0, _noResults2.default)(alm.content, alm.no_results);
1254
- }, alm.speed + 10);
1255
- }
1256
- }
1257
 
1258
- // isPaged
1259
- if (alm.isPaged) {
1260
- // Reset the posts_per_page parameter
1261
- alm.posts_per_page = alm.users ? alm.listing.dataset.usersPerPage : alm.listing.dataset.postsPerPage;
1262
- // SEO add-on
1263
- alm.page = alm.start_page ? alm.start_page - 1 : alm.page; // Set new page #
1264
- // Filters add-on
1265
- if (alm.addons.filters) {
1266
- if (alm.addons.filters_startpage > 0) {
1267
- alm.page = alm.addons.filters_startpage - 1; // Set new page #
1268
- alm.posts_per_page = alm.listing.dataset.postsPerPage; // Reset `filters-startpage` data after the first run
1269
- }
1270
- }
1271
- }
1272
- }
1273
 
1274
- /*
1275
- * Display alm_debug results
1276
- */
1277
- (0, _almDebug2.default)(alm);
1278
 
1279
- /*
1280
- * Set localized variables and Results Text
1281
- */
1282
- _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
1283
- return regeneratorRuntime.wrap(function _callee$(_context) {
1284
- while (1) {
1285
- switch (_context.prev = _context.next) {
1286
- case 0:
1287
- _context.next = 2;
1288
- return (0, _setLocalizedVars2.default)(alm);
1289
 
1290
- case 2:
1291
- case 'end':
1292
- return _context.stop();
1293
- }
1294
- }
1295
- }, _callee, _this);
1296
- }))();
1297
 
1298
- /*
1299
- * Render results
1300
- */
 
 
 
 
1301
 
1302
- if (total > 0) {
 
 
 
 
 
 
1303
 
1304
- // We have results!
 
 
1305
 
1306
- if (!alm.addons.paging) {
 
 
1307
 
1308
- if (alm.addons.single_post) {
 
1309
 
1310
- // Single Posts
1311
- reveal.setAttribute('class', 'alm-reveal alm-single-post post-' + alm.addons.single_post_id + alm.tcc);
1312
- reveal.dataset.url = alm.addons.single_post_permalink;
1313
- reveal.dataset.page = alm.page;
1314
- reveal.dataset.id = alm.addons.single_post_id;
1315
- reveal.dataset.title = alm.addons.single_post_title;
1316
- reveal.innerHTML = alm.html;
1317
- } else {
1318
 
1319
- if (!alm.transition_container) {
1320
- // No transition container
 
1321
 
1322
- alm.el = alm.html;
1323
- reveal = alm.container_type === 'table' ? (0, _tableWrap2.default)(alm.html) : (0, _almDomParser2.default)(alm.html, 'text/html');
1324
- } else {
1325
- // Standard container
 
 
 
 
 
 
 
 
 
 
 
 
 
1326
 
1327
- var pagenum = void 0;
1328
- var querystring = window.location.search;
1329
- var seo_class = alm.addons.seo ? ' alm-seo' : '';
1330
- var filters_class = alm.addons.filters ? ' alm-filters' : '';
1331
- var preloaded_class = alm.is_preloaded ? ' alm-preloaded' : '';
1332
 
1333
- // SEO and Filter Paged
1334
- if (alm.init && (alm.start_page > 1 || alm.addons.filters_startpage > 0)) {
1335
- // loop through items and break into separate .alm-reveal divs for paging
 
 
 
 
 
 
 
 
 
 
 
 
1336
 
1337
- var return_data = [];
1338
- var container_array = [];
1339
- var posts_per_page = parseInt(alm.posts_per_page);
1340
- var pages = Math.ceil(total / posts_per_page);
1341
- isPaged = true;
 
 
 
 
1342
 
1343
- // Call to Actions
1344
- if (alm.addons.cta === 'true') {
1345
- posts_per_page = posts_per_page + 1; // Add 1 to posts_per_page for CTAs
1346
- pages = Math.ceil(total / posts_per_page); // Update pages var with new posts_per_page
1347
- total = pages + total; // Get new total w/ CTAs added
1348
- }
 
1349
 
1350
- // Parse returned HTML and strip empty nodes
1351
- var _data = (0, _stripEmptyNodes2.default)((0, _almDomParser2.default)(alm.html, 'text/html'));
 
 
 
 
 
 
 
1352
 
1353
- // Slice data array into individual pages (array)
1354
- for (var i = 0; i < total; i += posts_per_page) {
1355
- return_data.push(_data.slice(i, posts_per_page + i));
1356
- }
 
 
 
 
 
 
 
1357
 
1358
- // Loop return_data array to build .alm-reveal containers
1359
- for (var k = 0; k < return_data.length; k++) {
 
 
 
 
 
 
 
 
 
1360
 
1361
- var p = alm.addons.preloaded === 'true' ? 1 : 0; // Add 1 page if items are preloaded.
1362
- var alm_reveal = document.createElement('div');
1363
 
1364
- if (k > 0 || alm.addons.preloaded === 'true') {
1365
 
1366
- pagenum = k + 1 + p; // > Paged
1367
 
1368
- if (alm.addons.seo) {
1369
- // SEO
1370
- if (alm.addons.seo_permalink === 'default') {
1371
- // Default Permalinks
1372
- alm_reveal.setAttribute('class', 'alm-reveal' + seo_class + alm.tcc);
1373
- alm_reveal.dataset.url = alm.canonical_url + querystring + '&paged=' + pagenum;
1374
- alm_reveal.dataset.page = pagenum;
1375
- } else {
1376
- // Pretty Permalinks
1377
- alm_reveal.setAttribute('class', 'alm-reveal' + seo_class + alm.tcc);
1378
- alm_reveal.dataset.url = alm.canonical_url + alm.addons.seo_leading_slash + 'page/' + pagenum + alm.addons.seo_trailing_slash + querystring;
1379
- alm_reveal.dataset.page = pagenum;
1380
- }
1381
- }
1382
 
1383
- if (alm.addons.filters) {
1384
- // Filters
1385
- alm_reveal.setAttribute('class', 'alm-reveal' + filters_class + alm.tcc);
1386
- alm_reveal.dataset.url = alm.canonical_url + alm.AjaxLoadMore.buildFilterURL(querystring, pagenum);
1387
- alm_reveal.dataset.page = pagenum;
1388
- }
1389
- } else {
1390
 
1391
- // First Page
1392
- if (alm.addons.seo) {
1393
- // SEO
1394
- alm_reveal.setAttribute('class', 'alm-reveal' + seo_class + alm.tcc);
1395
- alm_reveal.dataset.url = alm.canonical_url + querystring;
1396
- alm_reveal.dataset.page = '1';
1397
- }
1398
- if (alm.addons.filters) {
1399
- // Filters
1400
- alm_reveal.setAttribute('class', 'alm-reveal' + filters_class + preloaded_class + alm.tcc);
1401
- alm_reveal.dataset.url = alm.canonical_url + alm.AjaxLoadMore.buildFilterURL(querystring, 0);
1402
- alm_reveal.dataset.page = '1';
1403
- }
1404
- }
1405
 
1406
- // Append children to `.alm-reveal` element
1407
- (0, _almAppendChildren2.default)(alm_reveal, return_data[k]);
 
 
 
 
 
 
 
 
1408
 
1409
- // Run srcSet polyfill
1410
- (0, _srcsetPolyfill2.default)(alm_reveal, alm.ua);
 
 
 
 
1411
 
1412
- // Push alm_reveal elements into container_array
1413
- container_array.push(alm_reveal);
1414
- }
 
 
 
 
 
 
1415
 
1416
- // Set opacity and height of .alm-listing div to allow for fadein.
1417
- alm.listing.style.opacity = 0;
1418
- alm.listing.style.height = 0;
 
1419
 
1420
- // Append container_array to `.alm-listing`
1421
- (0, _almAppendChildren2.default)(alm.listing, container_array);
1422
 
1423
- reveal = alm.listing;
1424
- alm.el = reveal;
1425
- }
1426
- // End Init & SEO
 
 
1427
 
1428
- else {
 
 
1429
 
1430
- // Preloaded OR SEO (and Paged)
1431
- if (alm.addons.seo && alm.page > 0 || alm.addons.preloaded === 'true') {
 
 
 
 
 
1432
 
1433
- var p2 = alm.addons.preloaded === 'true' ? 1 : 0; // Add 1 page if items are preloaded.
 
 
1434
 
1435
- // SEO [Paged]
1436
- pagenum = alm.page + 1 + p2;
 
 
 
 
 
 
 
1437
 
1438
- if (alm.addons.seo) {
1439
- // SEO
1440
- if (alm.addons.seo_permalink === 'default') {
1441
- // Default Permalinks
1442
- reveal.setAttribute('class', 'alm-reveal' + seo_class + alm.tcc);
1443
- reveal.dataset.url = alm.canonical_url + querystring + '&paged=' + pagenum;
1444
- reveal.dataset.page = pagenum;
1445
- } else {
1446
- // Pretty Permalinks
1447
- reveal.setAttribute('class', 'alm-reveal' + seo_class + alm.tcc);
1448
- reveal.dataset.url = alm.canonical_url + alm.addons.seo_leading_slash + 'page/' + pagenum + alm.addons.seo_trailing_slash + querystring;
1449
- reveal.dataset.page = pagenum;
1450
- }
1451
- } else if (alm.addons.filters) {
1452
- // Filters
1453
- reveal.setAttribute('class', 'alm-reveal' + filters_class + alm.tcc);
1454
- reveal.dataset.url = alm.canonical_url + alm.AjaxLoadMore.buildFilterURL(querystring, pagenum);
1455
- reveal.dataset.page = pagenum;
1456
- } else {
1457
- // Basic ALM
1458
- reveal.setAttribute('class', 'alm-reveal' + alm.tcc);
1459
- }
1460
- } else if (alm.addons.filters) {
1461
 
1462
- // Filters
1463
- reveal.setAttribute('class', 'alm-reveal' + filters_class + alm.tcc);
1464
- reveal.dataset.url = alm.canonical_url + alm.AjaxLoadMore.buildFilterURL(querystring, parseInt(alm.page) + 1);
1465
- reveal.dataset.page = parseInt(alm.page) + 1;
1466
- } else {
 
 
 
 
 
 
 
 
 
 
 
 
1467
 
1468
- if (alm.addons.seo) {
1469
- // SEO [Page 1]
1470
- reveal.setAttribute('class', 'alm-reveal' + seo_class + alm.tcc);
1471
- reveal.dataset.url = alm.canonical_url + querystring;
1472
- reveal.dataset.page = '1';
1473
- } else {
1474
- // Basic ALM
1475
- reveal.setAttribute('class', 'alm-reveal' + alm.tcc);
1476
- }
1477
- }
1478
-
1479
- reveal.innerHTML = alm.html;
1480
- }
1481
- }
1482
- }
1483
 
1484
- // WooCommerce Add-on
1485
- if (alm.addons.woocommerce) {
 
 
 
 
 
 
 
 
 
 
 
 
 
1486
 
1487
- _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
1488
- var nextPageNum, nextPage;
1489
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
1490
- while (1) {
1491
- switch (_context2.prev = _context2.next) {
1492
- case 0:
1493
- _context2.next = 2;
1494
- return (0, _woocommerce.woocommerce)(reveal, alm, data.pageTitle);
1495
 
1496
- case 2:
1497
- nextPageNum = alm.page + 2;
 
 
 
1498
 
1499
- // Set button data attributes