WordPress Infinite Scroll – Ajax Load More - Version 3.5

Version Description

Download this release

Release Info

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

Code changes from version 3.4.1 to 3.5

README.txt CHANGED
@@ -1,10 +1,10 @@
1
  === WordPress Infinite Scroll - Ajax Load More ===
2
  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, ajax load posts, woocommerce, ajax load more
5
  Requires at least: 3.6
6
- Tested up to: 4.9.4
7
- Stable tag: 3.4.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -107,8 +107,7 @@ Ajax Load More accepts a number of parameters that are passed to the WordPress q
107
  * **max_pages** - Maximum number of pages to load while user is scrolling (activated on when scroll = true). Default = '0'
108
  * **pause_override** - Allow scrolling to override the Pause parameter and trigger the loading of posts on scroll. Default = null
109
  * **pause** - Do not load posts until user clicks the Load More button (true/false). Default = 'false'
110
- * **transition** - Choose a posts reveal transition (slide/fade/masonry/none). Default = 'slide'
111
- * **transition_speed** - The speed of the loading transition in milliseconds. (slide/fade/none). Default = '250'
112
  * **transition_container** - Display the Ajax Load More (.alm-reveal) loading container. Default = 'true'
113
  * **transition_container_classes** - Add classes to the `.alm-reveal` transition div.
114
  * **masonry_selector** - The target classname of each masonry item. Default = null
@@ -370,6 +369,27 @@ How to install Ajax Load More.
370
 
371
  == Changelog ==
372
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
  = 3.4.1 - February 22, 2018 =
374
  * UPDATE - Added compatibility for Filters + Paging add-ons.
375
  * UPDATE - Added compatibility for Filters + Preloaded add-ons.
1
  === WordPress Infinite Scroll - Ajax Load More ===
2
  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: 3.6
6
+ Tested up to: 4.9.5
7
+ Stable tag: 3.5.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
107
  * **max_pages** - Maximum number of pages to load while user is scrolling (activated on when scroll = true). Default = '0'
108
  * **pause_override** - Allow scrolling to override the Pause parameter and trigger the loading of posts on scroll. Default = null
109
  * **pause** - Do not load posts until user clicks the Load More button (true/false). Default = 'false'
110
+ * **transition** - Choose a posts reveal transition (fade/masonry/none). Default = 'fade'
 
111
  * **transition_container** - Display the Ajax Load More (.alm-reveal) loading container. Default = 'true'
112
  * **transition_container_classes** - Add classes to the `.alm-reveal` transition div.
113
  * **masonry_selector** - The target classname of each masonry item. Default = null
369
 
370
  == Changelog ==
371
 
372
+ = 3.5.0 - April 17, 2018 =
373
+
374
+ ### Notice
375
+ This Ajax Load More update contains a major change to how the default repeater template is saved and displayed.
376
+ On update, your default repeater template will be moved from `/plugins/ajax-load-more/core/repeater` to an `alm_templates` directory created within `/wp-content/uploads`.
377
+ This is a long overdue enhancement to the plugin and I highly recommend you backup your site (or Repeater Template at least) prior to updating Ajax Load More incase permission issues occur during the upgrade process.
378
+
379
+ * NEW - Updating Ajax Load More loading sequence to help with integration for Adsense and DFP advertisements in Ajax content.
380
+ * NEW - Default Repeater Template now saved and accessed from the `/wp-content/uploads` directory.
381
+ * FIX - Added a fix for WPML users that supports category and tag archives across languages [See issues](https://wpml.org/forums/topic/ajax-load-more-wpml-non-default-languages-not-loading/).
382
+ * FIX - Fixed issue with `destroy_after` not triggering at correct intervals when using [Preloaded add-on](https://connekthq.com/plugins/ajax-load-more/add-ons/preloaded/).
383
+ * FIX - Fixed issue with shortcode parameters not being sent to Ajax Load More for the [Comments add-on](https://connekthq.com/plugins/ajax-load-more/add-ons/comments/).
384
+ * UPDATE - Added support for new [SEO](https://connekthq.com/plugins/ajax-load-more/add-ons/search-engine-optimization/) add-on filter hooks.
385
+ * UPDATE - Updated CSS for the styling list elements. (`.alm-listing > li`)
386
+ * UPDATE - Packaging [Masonry v4.2.1](https://masonry.desandro.com/) in Ajax Load More as core WordPress includes an older version of Masonry that was causing issues with certain features.
387
+ * UPDATE - Simplifying Ajax Load More transition property to allow for feature enhancements (Removed 'slide' transition and jQuery animations).
388
+ * UPDATE - Removing `transition_speed` shortcode parameter and set a globe 1/4 second transition speed for all animations.
389
+ * UPDATE - Various UI/UX enhancements
390
+ * UPDATE - Code cleanup.
391
+
392
+
393
  = 3.4.1 - February 22, 2018 =
394
  * UPDATE - Added compatibility for Filters + Paging add-ons.
395
  * UPDATE - Added compatibility for Filters + Preloaded add-ons.
admin/admin.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- add_action( 'plugins_loaded', 'alm_core_update' ); // Core Update
3
  add_action( 'wp_ajax_alm_save_repeater', 'alm_save_repeater' ); // Ajax Save Repeater
4
  add_action( 'wp_ajax_alm_update_repeater', 'alm_update_repeater' ); // Ajax Update Repeater
5
  add_action( 'wp_ajax_alm_get_tax_terms', 'alm_get_tax_terms' ); // Ajax Get Taxonomy Terms
@@ -29,23 +29,23 @@ function alm_admin_notice_errors() {
29
  }
30
  $class = 'notice error alm-err-notice';
31
  $message = '';
32
- $count = 0;
33
- $addons = alm_get_addons();
34
  // Loop each addon
35
  foreach($addons as $addon){
36
- $action = $addon['action']; // Get action
37
- if (has_action($action)){
38
- $key = $addon['key']; // Option key
39
  $status = $addon['status']; // license status
40
  $addon_status = get_option( $status );
41
  if( !isset($addon_status) || empty($addon_status) || $addon_status !== 'valid' ) {
42
  $count++;
43
- }
44
  }
45
- }
46
  if( $count > 0 ) {
47
- $message = __( 'You have invalid <a href="admin.php?page=ajax-load-more"><b>Ajax Load More</b></a> license keys - please visit the <a href="admin.php?page=ajax-load-more-licenses">Licenses</a> section and input your license keys.', 'ajax-load-more' );
48
- printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
49
  }
50
  }
51
 
@@ -113,17 +113,17 @@ function alm_license_activation(){
113
  }
114
  }
115
  $return["msg"] = $msg;
116
-
117
  update_option( $option_status, $license_data->license);
118
  update_option( $option_key, $license );
119
 
120
  wp_send_json($return);
121
-
122
 
123
  } else {
124
-
125
  echo __('You don\'t belong here.', 'ajax-load-more');
126
-
127
  }
128
  }
129
 
@@ -263,13 +263,8 @@ function alm_core_update() {
263
 
264
  $alm_installed_ver = get_option( "alm_version" ); // Get value from WP Option tbl
265
  if ( $alm_installed_ver != ALM_VERSION ) {
266
-
267
- // Delete ALM transients
268
- delete_transient('alm_dismiss_sharing');
269
-
270
- // Update repeaters
271
- alm_run_update();
272
-
273
  }
274
  }
275
 
@@ -287,14 +282,12 @@ function alm_run_update(){
287
 
288
  if ( is_multisite()) {
289
  $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
290
-
291
  // Loop all blogs and run update routine
292
  foreach ( $blog_ids as $blog_id ) {
293
  switch_to_blog( $blog_id );
294
  alm_update_template_files();
295
  restore_current_blog();
296
  }
297
-
298
  } else {
299
  alm_update_template_files();
300
  }
@@ -303,7 +296,6 @@ function alm_run_update(){
303
  }
304
 
305
 
306
-
307
  /**
308
  * alm_update_template_files
309
  * Update routine for template files
@@ -314,52 +306,48 @@ function alm_run_update(){
314
  function alm_update_template_files(){
315
  global $wpdb;
316
  $table_name = $wpdb->prefix . "alm";
317
- $blog_id = $wpdb->blogid;
318
 
319
- // Get all templates ($rows) where name is 'default'
320
  $rows = $wpdb->get_results("SELECT * FROM $table_name WHERE name = 'default'");
321
 
322
  if($rows){
 
323
  foreach( $rows as $row ) { // Loop $rows
324
 
325
  $data = $wpdb->get_var("SELECT repeaterDefault FROM $table_name WHERE name = 'default'");
326
 
327
- if($blog_id > 1){
328
- $dir = ALM_PATH. 'core/repeater/'. $blog_id;
329
- if( !is_dir($dir) ){
330
- mkdir($dir);
331
- }
332
- $f = ALM_PATH. 'core/repeater/'. $blog_id .'/default.php';
333
- }else{
334
- $f = ALM_PATH. 'core/repeater/default.php';
335
- }
336
-
337
- try {
338
- $o = fopen($f, 'w+'); //Open file
339
- if ( !$o ) {
340
- throw new Exception(__('[Ajax Load More] Error opening default repeater template - Please check your file path and ensure your server is configured to allow Ajax Load More to read and write files within the /ajax-load-more/core/repeater directory', 'ajax-load-more'));
341
- }
342
- $w = fwrite($o, $data); //Save the file
343
- if ( !$w ) {
344
- throw new Exception(__('[Ajax Load More] Error updating default repeater template - Please check your file path and ensure your server is configured to allow Ajax Load More to read and write files within the /ajax-load-more/core/repeater directory.', 'ajax-load-more'));
345
- }
346
- fclose($o); //now close it
347
-
348
- } catch ( Exception $e ) {
349
- // Display error message in console.
350
- if(!isset($options['_alm_error_notices']) || $options['_alm_error_notices'] == '1'){
351
- echo '<script>console.log("' .$e->getMessage(). '");</script>';
352
- }
353
  }
354
 
355
  }
356
  }
357
-
358
  }
359
 
360
 
361
 
362
-
363
  /**
364
  * alm_admin_menu
365
  * Create Admin Menu
@@ -443,8 +431,8 @@ function alm_admin_menu() {
443
  'ajax-load-more-licenses',
444
  'alm_licenses_page'
445
  );
446
-
447
-
448
  $before_link = '<span style="display:block; border-top: 1px solid #555; padding-top: 8px;">';
449
  $after_link = '</span>';
450
  $style_link_icon = 'style="opacity: 0.6; font-size: 18px; height: 18px; width: 18px; position: relative; left: -2px;"';
@@ -461,14 +449,14 @@ function alm_admin_menu() {
461
  add_action( 'load-' . $alm_cache_page, 'alm_load_admin_js' );
462
  add_action( 'load-' . $alm_cache_page, 'alm_load_cache_admin_js' );
463
  add_action( 'load-' . $alm_cache_page, 'alm_set_admin_nonce' );
464
- }
 
 
465
 
466
- if(has_action('alm_filters_installed')){
467
-
468
  if(has_action('alm_cache_installed')){
469
  $before_link = '<span style="display:block;">';
470
- }
471
-
472
  $alm_filters_page = add_submenu_page(
473
  'ajax-load-more',
474
  __('Filters', 'ajax-load-more'),
@@ -670,7 +658,7 @@ function alm_enqueue_admin_scripts(){
670
  wp_enqueue_style( 'alm-core', ALM_URL. '/core/dist/css/ajax-load-more.css', '', ALM_VERSION);
671
 
672
  // disable ACF select2 on ALM pages
673
- wp_dequeue_style( 'acf-input' );
674
 
675
  // CodeMirror Syntax Highlighting if on Repater Template page
676
  $screen = get_current_screen();
@@ -689,13 +677,13 @@ function alm_enqueue_admin_scripts(){
689
  wp_enqueue_script( 'alm-codemirror-clike', ALM_ADMIN_URL. 'codemirror/mode/clike/clike.js' );
690
  wp_enqueue_script( 'alm-codemirror-php', ALM_ADMIN_URL. 'codemirror/mode/php/php.js' );
691
 
692
- }
693
 
694
  // Admin JS
695
  wp_enqueue_script( 'jquery-form' );
696
  wp_enqueue_script( 'alm-admin', ALM_ADMIN_URL. 'dist/js/admin.js', array( 'jquery' ), ALM_VERSION);
697
  wp_enqueue_script( 'alm-shortcode-builder', ALM_ADMIN_URL. 'shortcode-builder/js/shortcode-builder.js', array( 'jquery' ), ALM_VERSION);
698
-
699
  }
700
 
701
 
@@ -706,6 +694,7 @@ function alm_enqueue_admin_scripts(){
706
  *
707
  * @return response
708
  * @since 2.0.0
 
709
  */
710
 
711
  function alm_save_repeater(){
@@ -716,11 +705,11 @@ function alm_save_repeater(){
716
  $table_name = $wpdb->prefix . "alm";
717
  $blog_id = $wpdb->blogid;
718
  $options = get_option( 'alm_settings' ); //Get plugin options
719
-
720
  $nonce = $_POST["nonce"];
721
- // Check our nonce, if they don't match then bounce!
722
- if (! wp_verify_nonce( $nonce, 'alm_repeater_nonce' ))
723
  die('Error - unable to verify nonce, please try again.');
 
724
 
725
  // Get _POST Vars
726
  $c = Trim(stripslashes($_POST["value"])); // Repeater Value
@@ -728,25 +717,20 @@ function alm_save_repeater(){
728
  $t = Trim(stripslashes($_POST["type"])); // Repeater name
729
  $a = Trim(stripslashes($_POST["alias"])); // Repeater alias
730
 
731
- // Write to repeater templates
732
 
733
- // (Default)
734
  if($t === 'default'){
735
 
736
- if($blog_id > 1){
737
- $dir = ALM_PATH. 'core/repeater/'. $blog_id;
738
- if( !is_dir($dir) ){
739
- mkdir($dir);
740
- }
741
- $f = ALM_PATH. 'core/repeater/'. $blog_id .'/default.php';
742
- }else{
743
- $f = ALM_PATH. 'core/repeater/default.php';
744
- }
745
 
746
  }
747
- // (Unlimited)
748
- elseif($t === 'unlimited'){
749
 
 
 
750
  if($blog_id > 1){
751
  $dir = ALM_UNLIMITED_PATH. 'repeaters/'. $blog_id;
752
  if( !is_dir($dir) ){
@@ -758,13 +742,14 @@ function alm_save_repeater(){
758
  }
759
 
760
  }
761
- // (Unlimited v1)
762
- else{
763
 
 
 
764
  $f = ALM_REPEATER_PATH. 'repeaters/'.$n .'.php';
765
-
766
  }
767
 
 
 
768
  try {
769
  $o = fopen($f, 'w+'); //Open file
770
  if ( !$o ) {
@@ -783,7 +768,7 @@ function alm_save_repeater(){
783
  }
784
  }
785
 
786
- //Save to database
787
 
788
  if($t === 'default') {
789
  $data_update = array('repeaterDefault' => "$c", 'pluginVersion' => ALM_VERSION);
@@ -803,10 +788,11 @@ function alm_save_repeater(){
803
 
804
  //Our results
805
  if($w){
806
- echo '<span class="saved">Template Saved Successfully</span>';
807
  } else {
808
- echo '<span class="saved-error"><b>'. __('Error Writing File', 'ajax-load-more') .'</b></span><br/>Something went wrong and the data could not be saved.';
809
  }
 
810
  die();
811
 
812
  }else {
@@ -819,10 +805,9 @@ function alm_save_repeater(){
819
  /*
820
  * alm_update_repeater
821
  * Update repeater template from database
 
822
  *
823
- * - User story: User deletes plugin, the installs again and the version has not change - their default repeater will be in the default state and unable to be updated.
824
- *
825
- * @return DB value
826
  * @since 2.5.0
827
  */
828
 
@@ -831,9 +816,10 @@ function alm_update_repeater(){
831
  if (current_user_can( 'edit_theme_options' )){
832
 
833
  $nonce = $_POST["nonce"];
834
- // Check our nonce, if they don't match then bounce!
835
- if (! wp_verify_nonce( $nonce, 'alm_repeater_nonce' ))
836
  die('Error - unable to verify nonce, please try again.');
 
837
 
838
  // Get _POST Vars
839
  $n = Trim(stripslashes($_POST["repeater"])); // Repeater name
@@ -854,9 +840,10 @@ function alm_update_repeater(){
854
  die();
855
 
856
  } else {
 
857
  echo __('You don\'t belong here.', 'ajax-load-more');
858
- }
859
 
 
860
  }
861
 
862
 
@@ -1396,7 +1383,7 @@ function alm_btn_color_callback() {
1396
  $html .= '<div class="alm-btn-wrap">';
1397
  $html .= '<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>';
1398
  $html .= '</div>';
1399
-
1400
  echo $html;
1401
  }
1402
 
1
  <?php
2
+ add_action( 'init', 'alm_core_update' ); // Core Update
3
  add_action( 'wp_ajax_alm_save_repeater', 'alm_save_repeater' ); // Ajax Save Repeater
4
  add_action( 'wp_ajax_alm_update_repeater', 'alm_update_repeater' ); // Ajax Update Repeater
5
  add_action( 'wp_ajax_alm_get_tax_terms', 'alm_get_tax_terms' ); // Ajax Get Taxonomy Terms
29
  }
30
  $class = 'notice error alm-err-notice';
31
  $message = '';
32
+ $count = 0;
33
+ $addons = alm_get_addons();
34
  // Loop each addon
35
  foreach($addons as $addon){
36
+ $action = $addon['action']; // Get action
37
+ if (has_action($action)){
38
+ $key = $addon['key']; // Option key
39
  $status = $addon['status']; // license status
40
  $addon_status = get_option( $status );
41
  if( !isset($addon_status) || empty($addon_status) || $addon_status !== 'valid' ) {
42
  $count++;
43
+ }
44
  }
45
+ }
46
  if( $count > 0 ) {
47
+ $message = __( 'You have invalid <a href="admin.php?page=ajax-load-more"><b>Ajax Load More</b></a> license keys - please visit the <a href="admin.php?page=ajax-load-more-licenses">Licenses</a> section and input your license keys.', 'ajax-load-more' );
48
+ printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
49
  }
50
  }
51
 
113
  }
114
  }
115
  $return["msg"] = $msg;
116
+
117
  update_option( $option_status, $license_data->license);
118
  update_option( $option_key, $license );
119
 
120
  wp_send_json($return);
121
+
122
 
123
  } else {
124
+
125
  echo __('You don\'t belong here.', 'ajax-load-more');
126
+
127
  }
128
  }
129
 
263
 
264
  $alm_installed_ver = get_option( "alm_version" ); // Get value from WP Option tbl
265
  if ( $alm_installed_ver != ALM_VERSION ) {
266
+ delete_transient('alm_dismiss_sharing'); // Delete ALM transients
267
+ alm_run_update(); // Update repeaters
 
 
 
 
 
268
  }
269
  }
270
 
282
 
283
  if ( is_multisite()) {
284
  $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
 
285
  // Loop all blogs and run update routine
286
  foreach ( $blog_ids as $blog_id ) {
287
  switch_to_blog( $blog_id );
288
  alm_update_template_files();
289
  restore_current_blog();
290
  }
 
291
  } else {
292
  alm_update_template_files();
293
  }
296
  }
297
 
298
 
 
299
  /**
300
  * alm_update_template_files
301
  * Update routine for template files
306
  function alm_update_template_files(){
307
  global $wpdb;
308
  $table_name = $wpdb->prefix . "alm";
 
309
 
310
+ // Get all rows where name is 'default'
311
  $rows = $wpdb->get_results("SELECT * FROM $table_name WHERE name = 'default'");
312
 
313
  if($rows){
314
+
315
  foreach( $rows as $row ) { // Loop $rows
316
 
317
  $data = $wpdb->get_var("SELECT repeaterDefault FROM $table_name WHERE name = 'default'");
318
 
319
+ // Create Base Repeater Dir (alm_templates)
320
+ $base_dir = AjaxLoadMore::alm_get_repeater_path();
321
+ AjaxLoadMore::alm_mkdir($base_dir);
322
+
323
+ $file = $base_dir .'/default.php';
324
+
325
+ // Wrap is file_exists to avoid updating without cause
326
+ if( !file_exists($file) ){
327
+ try {
328
+ $o = fopen($file, 'w+'); //Open file
329
+ if ( !$o ) {
330
+ throw new Exception(__('[Ajax Load More] Error opening default repeater template - Please check your file path and ensure your server is configured to allow Ajax Load More to read and write files within the /ajax-load-more/core/repeater directory', 'ajax-load-more'));
331
+ }
332
+ $w = fwrite($o, $data); //Save the file
333
+ if ( !$w ) {
334
+ throw new Exception(__('[Ajax Load More] Error updating default repeater template - Please check your file path and ensure your server is configured to allow Ajax Load More to read and write files within the /ajax-load-more/core/repeater directory.', 'ajax-load-more'));
335
+ }
336
+ fclose($o); // Close file
337
+
338
+ } catch ( Exception $e ) { // Display error message in console.
339
+ if(!isset($options['_alm_error_notices']) || $options['_alm_error_notices'] == '1'){
340
+ echo '<script>console.log("' .$e->getMessage(). '");</script>';
341
+ }
342
+ }
 
 
343
  }
344
 
345
  }
346
  }
 
347
  }
348
 
349
 
350
 
 
351
  /**
352
  * alm_admin_menu
353
  * Create Admin Menu
431
  'ajax-load-more-licenses',
432
  'alm_licenses_page'
433
  );
434
+
435
+
436
  $before_link = '<span style="display:block; border-top: 1px solid #555; padding-top: 8px;">';
437
  $after_link = '</span>';
438
  $style_link_icon = 'style="opacity: 0.6; font-size: 18px; height: 18px; width: 18px; position: relative; left: -2px;"';
449
  add_action( 'load-' . $alm_cache_page, 'alm_load_admin_js' );
450
  add_action( 'load-' . $alm_cache_page, 'alm_load_cache_admin_js' );
451
  add_action( 'load-' . $alm_cache_page, 'alm_set_admin_nonce' );
452
+ }
453
+
454
+ if(has_action('alm_filters_installed')){
455
 
 
 
456
  if(has_action('alm_cache_installed')){
457
  $before_link = '<span style="display:block;">';
458
+ }
459
+
460
  $alm_filters_page = add_submenu_page(
461
  'ajax-load-more',
462
  __('Filters', 'ajax-load-more'),
658
  wp_enqueue_style( 'alm-core', ALM_URL. '/core/dist/css/ajax-load-more.css', '', ALM_VERSION);
659
 
660
  // disable ACF select2 on ALM pages
661
+ wp_dequeue_style( 'acf-input' );
662
 
663
  // CodeMirror Syntax Highlighting if on Repater Template page
664
  $screen = get_current_screen();
677
  wp_enqueue_script( 'alm-codemirror-clike', ALM_ADMIN_URL. 'codemirror/mode/clike/clike.js' );
678
  wp_enqueue_script( 'alm-codemirror-php', ALM_ADMIN_URL. 'codemirror/mode/php/php.js' );
679
 
680
+ }
681
 
682
  // Admin JS
683
  wp_enqueue_script( 'jquery-form' );
684
  wp_enqueue_script( 'alm-admin', ALM_ADMIN_URL. 'dist/js/admin.js', array( 'jquery' ), ALM_VERSION);
685
  wp_enqueue_script( 'alm-shortcode-builder', ALM_ADMIN_URL. 'shortcode-builder/js/shortcode-builder.js', array( 'jquery' ), ALM_VERSION);
686
+
687
  }
688
 
689
 
694
  *
695
  * @return response
696
  * @since 2.0.0
697
+ * @updated 3.5
698
  */
699
 
700
  function alm_save_repeater(){
705
  $table_name = $wpdb->prefix . "alm";
706
  $blog_id = $wpdb->blogid;
707
  $options = get_option( 'alm_settings' ); //Get plugin options
 
708
  $nonce = $_POST["nonce"];
709
+
710
+ if (! wp_verify_nonce( $nonce, 'alm_repeater_nonce' )){ // Check our nonce
711
  die('Error - unable to verify nonce, please try again.');
712
+ }
713
 
714
  // Get _POST Vars
715
  $c = Trim(stripslashes($_POST["value"])); // Repeater Value
717
  $t = Trim(stripslashes($_POST["type"])); // Repeater name
718
  $a = Trim(stripslashes($_POST["alias"])); // Repeater alias
719
 
 
720
 
721
+ // Default
722
  if($t === 'default'){
723
 
724
+ // Create Base Repeater Dir (alm-templates)
725
+ $base_dir = AjaxLoadMore::alm_get_repeater_path();
726
+ AjaxLoadMore::alm_mkdir($base_dir);
727
+
728
+ $f = $base_dir .'/default.php';
 
 
 
 
729
 
730
  }
 
 
731
 
732
+ // Unlimited (Custom Repeaters v2)
733
+ elseif($t === 'unlimited'){
734
  if($blog_id > 1){
735
  $dir = ALM_UNLIMITED_PATH. 'repeaters/'. $blog_id;
736
  if( !is_dir($dir) ){
742
  }
743
 
744
  }
 
 
745
 
746
+ // Custom Repeaters v1
747
+ else{
748
  $f = ALM_REPEATER_PATH. 'repeaters/'.$n .'.php';
 
749
  }
750
 
751
+
752
+ // Write Repeater Template
753
  try {
754
  $o = fopen($f, 'w+'); //Open file
755
  if ( !$o ) {
768
  }
769
  }
770
 
771
+ // Save to database
772
 
773
  if($t === 'default') {
774
  $data_update = array('repeaterDefault' => "$c", 'pluginVersion' => ALM_VERSION);
788
 
789
  //Our results
790
  if($w){
791
+ echo '<span class="saved">'. __('Template Saved Successfully', 'ajax-load-more') .'</span>';
792
  } else {
793
+ echo '<span class="saved-error"><b>'. __('Error Writing File', 'ajax-load-more') .'</b></span><br/>'. __('Something went wrong and the data could not be saved.', 'ajax-load-more');
794
  }
795
+
796
  die();
797
 
798
  }else {
805
  /*
806
  * alm_update_repeater
807
  * Update repeater template from database
808
+ * User case: User deletes plugin, then installs again and the version has not change. Click 'Update from DB' option to load template.
809
  *
810
+ * @return Database value
 
 
811
  * @since 2.5.0
812
  */
813
 
816
  if (current_user_can( 'edit_theme_options' )){
817
 
818
  $nonce = $_POST["nonce"];
819
+ // Check our nonce
820
+ if (! wp_verify_nonce( $nonce, 'alm_repeater_nonce' )){ // Check our nonce
821
  die('Error - unable to verify nonce, please try again.');
822
+ }
823
 
824
  // Get _POST Vars
825
  $n = Trim(stripslashes($_POST["repeater"])); // Repeater name
840
  die();
841
 
842
  } else {
843
+
844
  echo __('You don\'t belong here.', 'ajax-load-more');
 
845
 
846
+ }
847
  }
848
 
849
 
1383
  $html .= '<div class="alm-btn-wrap">';
1384
  $html .= '<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>';
1385
  $html .= '</div>';
1386
+
1387
  echo $html;
1388
  }
1389
 
admin/dist/css/admin.css CHANGED
@@ -950,7 +950,7 @@ a.layout-hover:hover img {
950
  position: relative;
951
  font-size: 17px;
952
  background: #f7f7f7;
953
- border-bottom: 1px solid #efefef; }
954
 
955
  .ajax-load-more h3.heading:hover:after,
956
  .ajax-load-more .add-on h3.heading:hover:after {
@@ -1408,7 +1408,7 @@ a.layout-hover:hover img {
1408
  padding: 0 !important; }
1409
 
1410
  .admin.ajax-load-more .row {
1411
- border-color: #efefef; }
1412
 
1413
  .admin.ajax-load-more .repeaters .row:hover,
1414
  .admin.ajax-load-more.shortcode-builder .row:hover {
@@ -2599,7 +2599,7 @@ span.cnkt-button.installed i,
2599
  background: #efefef;
2600
  line-height: 18px;
2601
  text-align: center;
2602
- margin: 2px 7px 0 0;
2603
  position: relative; }
2604
 
2605
  .ajax-load-more .cnkt-sidebar .item i.fa-check {
@@ -2905,20 +2905,20 @@ span.cnkt-button.installed i,
2905
  .ajax-load-more .alm-cache-search-wrap input {
2906
  width: 100% !important;
2907
  margin: 0 !important;
2908
- padding: 15px;
2909
  display: block;
2910
- font-size: 18px; }
2911
  .ajax-load-more .alm-cache-search-wrap i {
2912
  position: absolute;
2913
- right: 15px;
2914
- top: 14px;
2915
  color: #ccc;
2916
- font-size: 24px;
2917
  z-index: 1; }
2918
 
2919
  /* Directory Listing */
2920
  .alm-dir-listing {
2921
- border: 1px solid #efefef;
2922
  padding: 0;
2923
  margin: 20px 0 0; }
2924
  .alm-dir-listing.theme-repeaters {
@@ -2961,12 +2961,13 @@ span.cnkt-button.installed i,
2961
  font-size: 14px;
2962
  text-decoration: none;
2963
  padding: 5px 10px;
2964
- border: 1px solid #efefef;
2965
  color: #ccc;
2966
  border-radius: 2px; }
2967
 
2968
  .alm-dir-listing:hover .dir-title .delete {
2969
- border-color: #ccc;
 
2970
  color: #666; }
2971
 
2972
  .alm-dir-listing .dir-title .delete:hover {
950
  position: relative;
951
  font-size: 17px;
952
  background: #f7f7f7;
953
+ border-bottom: 1px solid #e1e1e1; }
954
 
955
  .ajax-load-more h3.heading:hover:after,
956
  .ajax-load-more .add-on h3.heading:hover:after {
1408
  padding: 0 !important; }
1409
 
1410
  .admin.ajax-load-more .row {
1411
+ border-color: #e1e1e1; }
1412
 
1413
  .admin.ajax-load-more .repeaters .row:hover,
1414
  .admin.ajax-load-more.shortcode-builder .row:hover {
2599
  background: #efefef;
2600
  line-height: 18px;
2601
  text-align: center;
2602
+ margin: 1px 7px 0 0;
2603
  position: relative; }
2604
 
2605
  .ajax-load-more .cnkt-sidebar .item i.fa-check {
2905
  .ajax-load-more .alm-cache-search-wrap input {
2906
  width: 100% !important;
2907
  margin: 0 !important;
2908
+ padding: 12px;
2909
  display: block;
2910
+ font-size: 16px; }
2911
  .ajax-load-more .alm-cache-search-wrap i {
2912
  position: absolute;
2913
+ right: 11px;
2914
+ top: 13px;
2915
  color: #ccc;
2916
+ font-size: 20px;
2917
  z-index: 1; }
2918
 
2919
  /* Directory Listing */
2920
  .alm-dir-listing {
2921
+ border: 1px solid #e1e1e1;
2922
  padding: 0;
2923
  margin: 20px 0 0; }
2924
  .alm-dir-listing.theme-repeaters {
2961
  font-size: 14px;
2962
  text-decoration: none;
2963
  padding: 5px 10px;
2964
+ border: 1px solid #e1e1e1;
2965
  color: #ccc;
2966
  border-radius: 2px; }
2967
 
2968
  .alm-dir-listing:hover .dir-title .delete {
2969
+ border-color: #e1e1e1;
2970
+ background-color: #fff;
2971
  color: #666; }
2972
 
2973
  .alm-dir-listing .dir-title .delete:hover {
admin/img/add.png DELETED
Binary file
admin/includes/cta/writeable.php CHANGED
@@ -3,50 +3,23 @@
3
  <div class="cta-inner">
4
  <div class="item">
5
  <?php
6
- //Test server for write capabilities
7
-
8
- $alm_file = ALM_PATH .'core/repeater/default.php'; // Default ALM repeater
 
9
  if(file_exists($alm_file)){
10
- if (is_writable($alm_file))
11
- echo __('<p class="writeable-title"><i class="fa fa-check"></i><strong>Ajax Load More</strong></p><p class="desc">Read/Write access is enabled within the /ajax-load-more/ directory.', 'ajax-load-more');
12
- else
13
- echo __('<p class="writeable-title"><i class="fa fa-exclamation"></i><strong>Ajax Load More</strong></p>Access Denied! You must enable read and write access for Ajax Load More directory (/ajax-load-more/core/repeater/) in order to save repeater template data.<br/><br/>Please contact your hosting provider or site administrator for more information.', 'ajax-load-more');
 
14
  }else{
15
- echo __('<p class="writeable-title"><i class="fa fa-exclamation"></i><strong>Ajax Load More</strong></p><p class="desc">Unable to locate configuration file. Directory access may not be granted.', 'ajax-load-more');
16
  }
17
  ?>
18
-
19
- <?php
20
- // Custom Repeaters Add-on
21
- if (has_action('alm_custom_repeaters')){
22
- echo '<div class="spacer"></div>';
23
- $alm_custom_repeater_file = ALM_REPEATER_PATH. '/repeaters/repeater2.php'; // Test file
24
- if(file_exists($alm_custom_repeater_file)){
25
- if (is_writable($alm_custom_repeater_file))
26
- echo __('<p class="writeable-title"><i class="fa fa-check"></i><strong>Custom Repeaters</strong></p><p class="desc">Nice! Read/Write access is enabled within the /ajax-load-more-repeaters/repeaters/ directory.', 'ajax-load-more');
27
- else
28
- echo __('<p class="writeable-title"><i class="fa fa-exclamation"></i><strong>ALM Custom Repeaters</strong></p><p class="desc">Access Denied! You must enable read and write access for Ajax Load More Custom Repeaters directory (/ajax-load-more-repeaters/repeaters/) in order to save repeater template data.<br/><br/>Please contact your hosting provider or site administrator for more information.', 'ajax-load-more');
29
- }else{
30
- echo __('<p class="writeable-title"><i class="fa fa-exclamation"></i><strong>ALM Custom Repeaters</strong></p><p class="desc">Unable to locate configuration file. Directory access may not be granted.', 'ajax-load-more');
31
- }
32
- }
33
- ?>
34
-
35
- <?php
36
- // Unlimited Repeaters Add-on
37
- if (has_action('alm_unlimited_repeaters')){
38
- echo '<div class="spacer"></div>';
39
- $alm_unlimited_file = ALM_UNLIMITED_REPEATER_PATH .'_is_writeable.php'; // Test file
40
- if(file_exists($alm_unlimited_file)){
41
- if (is_writable($alm_unlimited_file))
42
- echo __('<p class="writeable-title"><i class="fa fa-check"></i><strong>Custom Repeaters</strong></p><p class="desc">Read/Write access is enabled within the /ajax-load-more-repeaters-v2/repeaters/ directory.', 'ajax-load-more');
43
- else
44
- echo __('<p class="writeable-title"><i class="fa fa-exclamation"></i><strong>ALM - Custom Repeaters v2</strong></p><p class="desc">Access Denied! You must enable read and write access for Ajax Load More Unlimited directory (/ajax-load-more-repeaters-v2/repeaters/) in order to save repeater template data.<br/><br/>Please contact your hosting provider or site administrator for more information.', 'ajax-load-more');
45
- }else{
46
- echo __('<p class="writeable-title"><i class="fa fa-exclamation"></i><strong>ALM Unlimited</strong></p><p class="desc">Unable to locate configuration file. Directory access may not be granted.', 'ajax-load-more');
47
- }
48
- }
49
- ?>
50
  </div>
 
 
 
51
  </div>
52
  </div>
3
  <div class="cta-inner">
4
  <div class="item">
5
  <?php
6
+ //Test server for write capabilities
7
+ $path = AjaxLoadMore::alm_get_repeater_path();
8
+ $alm_file = $path .'/default.php'; // Default ALM repeater
9
+
10
  if(file_exists($alm_file)){
11
+ if (is_writable($alm_file)){
12
+ echo __('<p class="writeable-title"><i class="fa fa-check"></i><strong>Enabled</strong></p><p class="desc">Read/Write access is enabled within the Repeater Template directory.', 'ajax-load-more');
13
+ } else {
14
+ echo __('<p class="writeable-title"><i class="fa fa-exclamation"></i><strong>Access Denied</strong></p><p class="desc">You must enable read and write access to save repeater template data.<br/><br/>Please contact your hosting provider or site administrator for more information.</p>', 'ajax-load-more');
15
+ }
16
  }else{
17
+ echo __('<p class="writeable-title"><i class="fa fa-exclamation"></i><strong>Error</strong></p><p class="desc">Unable to locate configuration file. Directory access may not be granted.', 'ajax-load-more');
18
  }
19
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  </div>
21
+ <p style="padding-top: 10px; margin: 0;">
22
+ <input type="text" value="<?php echo $path; ?>" style="font-family: 'Consolas'; opacity: 0.8; width: 100%; font-size: 12px;" readonly="readonly">
23
+ </p>
24
  </div>
25
  </div>
admin/shortcode-builder/js/shortcode-builder.js CHANGED
@@ -1052,10 +1052,6 @@ jQuery(document).ready(function($) {
1052
  }
1053
 
1054
  }
1055
- // Speed
1056
- var transition_speed = $('.transition input[name=transition-speed]').val();
1057
- if(transition_speed !== '250' && transition !== 'none')
1058
- output += ' transition_speed="'+ transition_speed +'"';
1059
 
1060
 
1061
  // ---------------------------
@@ -1267,7 +1263,7 @@ jQuery(document).ready(function($) {
1267
 
1268
  $('.table-of-contents .toc').change(function() {
1269
  var pos = $(this).val();
1270
- if(pos !== 'null'){
1271
  $('html,body').animate({
1272
  scrollTop: $('#'+pos).offset().top - 46
1273
  }, 500, 'alm_easeInOutQuad');
1052
  }
1053
 
1054
  }
 
 
 
 
1055
 
1056
 
1057
  // ---------------------------
1263
 
1264
  $('.table-of-contents .toc').change(function() {
1265
  var pos = $(this).val();
1266
+ if(pos !== 'null' && pos !== '#'){
1267
  $('html,body').animate({
1268
  scrollTop: $('#'+pos).offset().top - 46
1269
  }, 500, 'alm_easeInOutQuad');
admin/shortcode-builder/shortcode-builder.php CHANGED
@@ -283,8 +283,7 @@
283
  <div class="wrap">
284
  <div class="inner">
285
  <select class="alm_element transition" name="transition">
286
- <option value="fade" selected="selected"><?php _e('Fade', 'ajax-load-more'); ?></option>
287
- <option value="slide"><?php _e('Slide', 'ajax-load-more'); ?></option>
288
  <option value="masonry"><?php _e('Masonry', 'ajax-load-more'); ?></option>
289
  <option value="none"><?php _e('None', 'ajax-load-more'); ?></option>
290
  </select>
@@ -427,19 +426,6 @@
427
  </div>
428
  <!-- End Hide transition_container if Masonry is selected -->
429
 
430
- <div class="clear"></div>
431
- <hr>
432
-
433
- <div class="section-title">
434
- <h4><?php _e('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>
435
- <p><?php _e('The speed of the loading transition in milliseconds', 'ajax-load-more'); ?>.<br/></p>
436
- </div>
437
- <div class="wrap">
438
- <div class="inner">
439
- <input type="number" class="alm_element numbers-only" name="transition-speed" id="transition-speed" step="50" min="50" value="250">
440
- </div>
441
- </div>
442
-
443
  </div>
444
  </div>
445
  <!-- End Transition -->
283
  <div class="wrap">
284
  <div class="inner">
285
  <select class="alm_element transition" name="transition">
286
+ <option value="fade" selected="selected"><?php _e('Fade In', 'ajax-load-more'); ?></option>
 
287
  <option value="masonry"><?php _e('Masonry', 'ajax-load-more'); ?></option>
288
  <option value="none"><?php _e('None', 'ajax-load-more'); ?></option>
289
  </select>
426
  </div>
427
  <!-- End Hide transition_container if Masonry is selected -->
428
 
 
 
 
 
 
 
 
 
 
 
 
 
 
429
  </div>
430
  </div>
431
  <!-- End Transition -->
admin/src/scss/admin.scss CHANGED
@@ -273,7 +273,7 @@ a.layout-hover{
273
  position: relative;
274
  font-size: 17px;
275
  background: #f7f7f7;
276
- border-bottom: 1px solid #efefef;
277
  }
278
  .ajax-load-more h3.heading:hover:after,
279
  .ajax-load-more .add-on h3.heading:hover:after{
@@ -773,7 +773,7 @@ a.layout-hover{
773
  }
774
 
775
  .admin.ajax-load-more .row{
776
- border-color: #efefef;
777
  }
778
  .admin.ajax-load-more .repeaters .row:hover,
779
  .admin.ajax-load-more.shortcode-builder .row:hover{
@@ -2039,7 +2039,7 @@ table.highlight{
2039
  background: #efefef;
2040
  line-height: 18px;
2041
  text-align: center;
2042
- margin: 2px 7px 0 0;
2043
  position: relative;
2044
  }
2045
 
@@ -2362,20 +2362,20 @@ table.highlight{
2362
  .ajax-load-more .alm-cache-search-wrap{
2363
  position: relative;
2364
  display: block;
2365
- margin: -5px 0 25px;
2366
  input{
2367
  width: 100% !important;
2368
  margin: 0 !important;
2369
- padding: 15px;
2370
  display: block;
2371
- font-size: 18px;
2372
  }
2373
  i{
2374
  position: absolute;
2375
- right: 15px;
2376
- top: 14px;
2377
- color: #ccc;
2378
- font-size: 24px;
2379
  z-index: 1;
2380
  }
2381
  }
@@ -2383,7 +2383,7 @@ table.highlight{
2383
  /* Directory Listing */
2384
 
2385
  .alm-dir-listing{
2386
- border: 1px solid #efefef;
2387
  padding: 0;
2388
  margin: 20px 0 0;
2389
  &.theme-repeaters{
@@ -2432,14 +2432,15 @@ table.highlight{
2432
  font-size: 14px;
2433
  text-decoration: none;
2434
  padding: 5px 10px;
2435
- border: 1px solid #efefef;
2436
  color: #ccc;
2437
  -webkit-border-radius: 2px;
2438
  -moz-border-radius: 2px;
2439
  border-radius: 2px;
2440
  }
2441
  .alm-dir-listing:hover .dir-title .delete{
2442
- border-color: #ccc;
 
2443
  color: #666;
2444
  }
2445
  .alm-dir-listing .dir-title .delete:hover{
273
  position: relative;
274
  font-size: 17px;
275
  background: #f7f7f7;
276
+ border-bottom: 1px solid #e1e1e1;
277
  }
278
  .ajax-load-more h3.heading:hover:after,
279
  .ajax-load-more .add-on h3.heading:hover:after{
773
  }
774
 
775
  .admin.ajax-load-more .row{
776
+ border-color: #e1e1e1;
777
  }
778
  .admin.ajax-load-more .repeaters .row:hover,
779
  .admin.ajax-load-more.shortcode-builder .row:hover{
2039
  background: #efefef;
2040
  line-height: 18px;
2041
  text-align: center;
2042
+ margin: 1px 7px 0 0;
2043
  position: relative;
2044
  }
2045
 
2362
  .ajax-load-more .alm-cache-search-wrap{
2363
  position: relative;
2364
  display: block;
2365
+ margin: -5px 0 25px;
2366
  input{
2367
  width: 100% !important;
2368
  margin: 0 !important;
2369
+ padding: 12px;
2370
  display: block;
2371
+ font-size: 16px;
2372
  }
2373
  i{
2374
  position: absolute;
2375
+ right: 11px;
2376
+ top: 13px;
2377
+ color: #ccc;
2378
+ font-size: 20px;
2379
  z-index: 1;
2380
  }
2381
  }
2383
  /* Directory Listing */
2384
 
2385
  .alm-dir-listing{
2386
+ border: 1px solid #e1e1e1;
2387
  padding: 0;
2388
  margin: 20px 0 0;
2389
  &.theme-repeaters{
2432
  font-size: 14px;
2433
  text-decoration: none;
2434
  padding: 5px 10px;
2435
+ border: 1px solid #e1e1e1;
2436
  color: #ccc;
2437
  -webkit-border-radius: 2px;
2438
  -moz-border-radius: 2px;
2439
  border-radius: 2px;
2440
  }
2441
  .alm-dir-listing:hover .dir-title .delete{
2442
+ border-color: #e1e1e1;
2443
+ background-color: #fff;
2444
  color: #666;
2445
  }
2446
  .alm-dir-listing .dir-title .delete:hover{
admin/views/repeater-templates.php CHANGED
@@ -40,11 +40,10 @@
40
  <div class="group no-shadow">
41
 
42
  <?php
43
- $options = get_option( 'alm_settings' );
44
-
45
  if(!isset($options['_alm_theme_repeaters_dir']))
46
  $options['_alm_theme_repeaters_dir'] = 'alm_templates';
47
-
48
  // Get template location
49
  if(is_child_theme()){
50
  $dir = get_stylesheet_directory() . '/' . $options['_alm_theme_repeaters_dir'];
@@ -52,13 +51,11 @@
52
  $dir = get_template_directory() . '/' . $options['_alm_theme_repeaters_dir'];
53
  }
54
 
55
- $count = 0;
56
-
57
  foreach (glob($dir.'/*') as $file) {
58
  $count++;
59
  $file = realpath($file);
60
- $link = substr($file, strlen($dir) + 1);
61
-
62
  $file_extension = strtolower(substr(basename($file), strrpos(basename($file), '.') + 1));
63
  $file_directory = get_option('stylesheet') .'/'. strtolower(substr(basename($dir), strrpos(basename($dir), '/')));
64
 
@@ -179,7 +176,7 @@
179
  if(!$local_template){
180
  // Add Label
181
  echo '<label class="template-title" for="template-default">';
182
- _e('Enter the HTML and PHP code for the default template', 'ajax-load-more');
183
  echo ':</label>';
184
 
185
  // Layouts - Template Selection
@@ -313,7 +310,7 @@
313
  btn.removeClass('saving');
314
  });
315
 
316
- }, 4500);
317
 
318
  },
319
  error: function(xhr, status, error) {
40
  <div class="group no-shadow">
41
 
42
  <?php
43
+ $options = get_option( 'alm_settings' );
 
44
  if(!isset($options['_alm_theme_repeaters_dir']))
45
  $options['_alm_theme_repeaters_dir'] = 'alm_templates';
46
+
47
  // Get template location
48
  if(is_child_theme()){
49
  $dir = get_stylesheet_directory() . '/' . $options['_alm_theme_repeaters_dir'];
51
  $dir = get_template_directory() . '/' . $options['_alm_theme_repeaters_dir'];
52
  }
53
 
54
+ $count = 0;
 
55
  foreach (glob($dir.'/*') as $file) {
56
  $count++;
57
  $file = realpath($file);
58
+ $link = substr($file, strlen($dir) + 1);
 
59
  $file_extension = strtolower(substr(basename($file), strrpos(basename($file), '.') + 1));
60
  $file_directory = get_option('stylesheet') .'/'. strtolower(substr(basename($dir), strrpos(basename($dir), '/')));
61
 
176
  if(!$local_template){
177
  // Add Label
178
  echo '<label class="template-title" for="template-default">';
179
+ _e('Enter the HTML and PHP code for the default template', 'ajax-load-more');
180
  echo ':</label>';
181
 
182
  // Layouts - Template Selection
310
  btn.removeClass('saving');
311
  });
312
 
313
+ }, 3000);
314
 
315
  },
316
  error: function(xhr, status, error) {
ajax-load-more.php CHANGED
@@ -7,35 +7,30 @@ Text Domain: ajax-load-more
7
  Author: Darren Cooney
8
  Twitter: @KaptonKaos
9
  Author URI: https://connekthq.com
10
- Version: 3.4.1
11
  License: GPL
12
  Copyright: Darren Cooney & Connekt Media
13
  */
14
 
15
 
16
 
17
- define('ALM_VERSION', '3.4.1');
18
- define('ALM_RELEASE', 'February 22, 2018');
19
  define('ALM_STORE_URL', 'https://connekthq.com');
20
 
21
 
22
 
23
  /*
24
  * alm_install
25
- *
26
- * Activation hook
27
- * Create table for storing repeater
28
  *
29
  * @since 2.0.0
30
  */
31
 
32
  function alm_install($network_wide) {
33
-
34
  global $wpdb;
35
  add_option( "alm_version", ALM_VERSION ); // Add to WP Option tbl
36
-
37
  if ( is_multisite() && $network_wide ) {
38
-
39
  // Get all blogs in the network and activate plugin on each one
40
  $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
41
  foreach ( $blog_ids as $blog_id ) {
@@ -46,7 +41,6 @@ function alm_install($network_wide) {
46
  } else {
47
  alm_create_table();
48
  }
49
-
50
  }
51
  register_activation_hook( __FILE__, 'alm_install' );
52
  add_action( 'wpmu_new_blog', 'alm_install' );
@@ -55,10 +49,10 @@ add_action( 'wpmu_new_blog', 'alm_install' );
55
 
56
  /*
57
  * alm_create_table
58
- *
59
  * Create new table and repeater template
60
  *
61
  * @since 2.0.0
 
62
  */
63
  function alm_create_table(){
64
 
@@ -66,29 +60,21 @@ function alm_create_table(){
66
  $table_name = $wpdb->prefix . "alm";
67
  $blog_id = $wpdb->blogid;
68
 
69
- $defaultRepeater = '<li <?php if (!has_post_thumbnail()) { ?> class="no-img"<?php } ?>><?php if ( has_post_thumbnail() ) { the_post_thumbnail(\'alm-thumbnail\');}?><h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3><p class="entry-meta"><?php the_time("F d, Y"); ?></p><?php the_excerpt(); ?></li>';
70
-
71
- /* MULTISITE */
72
- /* if this is a multisite blog and it's not id = 1, create default template */
73
- if($blog_id > 1){
74
 
75
- $dir = ALM_PATH. 'core/repeater/'. $blog_id;
76
- if( !is_dir($dir) ){
77
- mkdir($dir);
78
- }
79
-
80
- $file = ALM_PATH. 'core/repeater/'. $blog_id .'/default.php';
81
- if( !file_exists($file) ){
82
- $tmp = fopen($file, 'w');
83
- $w = fwrite($tmp, $defaultRepeater);
84
- fclose($tmp);
85
- }
86
 
 
 
 
 
 
87
  }
88
 
89
- //Create table, if it doesn't already exist.
90
  if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
91
-
92
  $sql = "CREATE TABLE $table_name (
93
  id mediumint(9) NOT NULL AUTO_INCREMENT,
94
  name text NOT NULL,
@@ -99,12 +85,9 @@ function alm_create_table(){
99
  );";
100
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
101
  dbDelta( $sql );
102
-
103
- //Insert the default data in created table
104
  $wpdb->insert($table_name , array('name' => 'default', 'repeaterDefault' => $defaultRepeater, 'repeaterType' => 'default', 'pluginVersion' => ALM_VERSION));
105
-
106
  }
107
-
108
  }
109
 
110
 
@@ -116,7 +99,6 @@ if( !class_exists('AjaxLoadMore') ):
116
 
117
  function __construct(){
118
 
119
-
120
  $this->alm_define_constants();
121
  $this->alm_includes();
122
 
@@ -136,6 +118,45 @@ if( !class_exists('AjaxLoadMore') ):
136
 
137
 
138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  /*
140
  * alm_define_constants
141
  * Define plugin constants
@@ -269,9 +290,13 @@ if( !class_exists('AjaxLoadMore') ):
269
  wp_register_script( 'ajax-load-more', plugins_url( '/core/dist/js/ajax-load-more.min.js', __FILE__ ), $dependencies, ALM_VERSION, true );
270
 
271
  // Progress Bar JS
272
- wp_register_script( 'ajax-load-more-progress', plugins_url( '/core/src/js/vendor/pace/pace.min.js', __FILE__ ), 'ajax-load-more', ALM_VERSION, true );
273
 
274
- // Load Core CSS
 
 
 
 
275
  if( !alm_do_inline_css('_alm_inline_css') && !alm_css_disabled('_alm_disable_css')){ // Not inline or disabled
276
  $file = plugins_url('/core/dist/css/'. ALM_SLUG .'.min.css', __FILE__ );
277
  ALM_ENQUEUE::alm_enqueue_css(ALM_SLUG, $file);
@@ -339,6 +364,11 @@ if( !class_exists('AjaxLoadMore') ):
339
 
340
  $options = get_option( 'alm_settings' );
341
 
 
 
 
 
 
342
  $id = (isset($_GET['id'])) ? $_GET['id'] : '';
343
  $post_id = (isset($_GET['post_id'])) ? $_GET['post_id'] : '';
344
  $slug = (isset($_GET['slug'])) ? $_GET['slug'] : '';
7
  Author: Darren Cooney
8
  Twitter: @KaptonKaos
9
  Author URI: https://connekthq.com
10
+ Version: 3.5.0
11
  License: GPL
12
  Copyright: Darren Cooney & Connekt Media
13
  */
14
 
15
 
16
 
17
+ define('ALM_VERSION', '3.5.0');
18
+ define('ALM_RELEASE', 'April 17, 2018');
19
  define('ALM_STORE_URL', 'https://connekthq.com');
20
 
21
 
22
 
23
  /*
24
  * alm_install
25
+ * Activation hook - Create table & repeater
 
 
26
  *
27
  * @since 2.0.0
28
  */
29
 
30
  function alm_install($network_wide) {
 
31
  global $wpdb;
32
  add_option( "alm_version", ALM_VERSION ); // Add to WP Option tbl
 
33
  if ( is_multisite() && $network_wide ) {
 
34
  // Get all blogs in the network and activate plugin on each one
35
  $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
36
  foreach ( $blog_ids as $blog_id ) {
41
  } else {
42
  alm_create_table();
43
  }
 
44
  }
45
  register_activation_hook( __FILE__, 'alm_install' );
46
  add_action( 'wpmu_new_blog', 'alm_install' );
49
 
50
  /*
51
  * alm_create_table
 
52
  * Create new table and repeater template
53
  *
54
  * @since 2.0.0
55
+ * @updated 3.5
56
  */
57
  function alm_create_table(){
58
 
60
  $table_name = $wpdb->prefix . "alm";
61
  $blog_id = $wpdb->blogid;
62
 
63
+ $defaultRepeater = '<li <?php if (!has_post_thumbnail()) { ?> class="no-img"<?php } ?>>'. PHP_EOL .' <?php if ( has_post_thumbnail() ) { the_post_thumbnail(\'alm-thumbnail\'); }?>'. PHP_EOL .' <h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>'. PHP_EOL .' <p class="entry-meta"><?php the_time("F d, Y"); ?></p>'. PHP_EOL .' <?php the_excerpt(); ?>'. PHP_EOL .'</li>';
 
 
 
 
64
 
65
+ // Create Base Repeater Directory
66
+ $base_dir = AjaxLoadMore::alm_get_repeater_path();
67
+ AjaxLoadMore::alm_mkdir($base_dir);
 
 
 
 
 
 
 
 
68
 
69
+ $file = $base_dir .'/default.php';
70
+ if( !file_exists($file) ){
71
+ $tmp = fopen($file, 'w+');
72
+ $w = fwrite($tmp, $defaultRepeater);
73
+ fclose($tmp);
74
  }
75
 
76
+ //C reate table, if it doesn't already exist.
77
  if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
 
78
  $sql = "CREATE TABLE $table_name (
79
  id mediumint(9) NOT NULL AUTO_INCREMENT,
80
  name text NOT NULL,
85
  );";
86
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
87
  dbDelta( $sql );
88
+ // Insert the default data in created table
 
89
  $wpdb->insert($table_name , array('name' => 'default', 'repeaterDefault' => $defaultRepeater, 'repeaterType' => 'default', 'pluginVersion' => ALM_VERSION));
 
90
  }
 
91
  }
92
 
93
 
99
 
100
  function __construct(){
101
 
 
102
  $this->alm_define_constants();
103
  $this->alm_includes();
104
 
118
 
119
 
120
 
121
+ /*
122
+ * alm_get_repeater_base_path
123
+ * Get absolute path to repeater directory base
124
+ *
125
+ * Multisite installs directories will be `uploads/sites/{id}/alm_templates`
126
+ *
127
+ * @return $path;
128
+ * @since 3.5
129
+ */
130
+ public static function alm_get_repeater_path(){
131
+ $upload_dir = wp_upload_dir();
132
+ $path = apply_filters( 'alm_repeater_path', $upload_dir['basedir']. '/alm_templates' );
133
+ return $path;
134
+ }
135
+
136
+
137
+
138
+ /*
139
+ * alm_mkdir
140
+ * Create repeater template directory
141
+ *
142
+ * @since 3.5
143
+ */
144
+ public static function alm_mkdir($dir){
145
+
146
+ // Does $dir exist?
147
+ if( !is_dir($dir) ) {
148
+ mkdir($dir, 0755);
149
+
150
+ // Check again after creating it (permission checker)
151
+ if( !is_dir($dir) ) {
152
+ echo __('Error creating repeater template directory', 'ajax-load-more');
153
+ echo ' - '. $dir;
154
+ }
155
+ }
156
+ }
157
+
158
+
159
+
160
  /*
161
  * alm_define_constants
162
  * Define plugin constants
290
  wp_register_script( 'ajax-load-more', plugins_url( '/core/dist/js/ajax-load-more.min.js', __FILE__ ), $dependencies, ALM_VERSION, true );
291
 
292
  // Progress Bar JS
293
+ wp_register_script( 'ajax-load-more-progress', plugins_url( '/vendor/js/pace/pace.min.js', __FILE__ ), 'ajax-load-more', ALM_VERSION, true );
294
 
295
+ // Masonry JS
296
+ wp_register_script( 'ajax-load-more-masonry', plugins_url( '/vendor/js/masonry/masonry.pkgd.min.js', __FILE__ ), 'ajax-load-more', '4.2.1', true );
297
+
298
+
299
+ // Core CSS
300
  if( !alm_do_inline_css('_alm_inline_css') && !alm_css_disabled('_alm_disable_css')){ // Not inline or disabled
301
  $file = plugins_url('/core/dist/css/'. ALM_SLUG .'.min.css', __FILE__ );
302
  ALM_ENQUEUE::alm_enqueue_css(ALM_SLUG, $file);
364
 
365
  $options = get_option( 'alm_settings' );
366
 
367
+ // WPML fix for category/tag archives
368
+ if ( isset( $_GET['category'] ) && $_GET['category'] ) {
369
+ unset($_REQUEST['post_id']);
370
+ }
371
+
372
  $id = (isset($_GET['id'])) ? $_GET['id'] : '';
373
  $post_id = (isset($_GET['post_id'])) ? $_GET['post_id'] : '';
374
  $slug = (isset($_GET['slug'])) ? $_GET['slug'] : '';
core/classes/class.alm-shortcode.php CHANGED
@@ -169,7 +169,7 @@ if( !class_exists('ALM_SHORTCODE') ):
169
  // Masonry
170
  if($transition === 'masonry'){
171
  wp_enqueue_script( 'imagesloaded' ); // Enqueue before core ALM
172
- wp_enqueue_script( 'masonry' ); // Enqueue before core ALM
173
  }
174
 
175
  // Core ALM
169
  // Masonry
170
  if($transition === 'masonry'){
171
  wp_enqueue_script( 'imagesloaded' ); // Enqueue before core ALM
172
+ wp_enqueue_script( 'ajax-load-more-masonry' ); // Enqueue before core ALM
173
  }
174
 
175
  // Core ALM
core/dist/css/ajax-load-more.css CHANGED
@@ -177,20 +177,30 @@
177
  .alm-listing {
178
  margin: 0;
179
  padding: 0; }
180
- .alm-listing li {
 
 
181
  background: none;
182
  margin: 0 0 30px;
183
  padding: 0 0 0 170px;
184
  overflow: hidden;
185
  position: relative;
186
  list-style: none; }
187
- .alm-listing li.no-img {
 
 
188
  padding: 0; }
189
- .alm-listing li p {
 
 
190
  margin: 0; }
191
- .alm-listing li h3 {
 
 
192
  margin: 0 0 10px; }
193
- .alm-listing li img {
 
 
194
  position: absolute;
195
  left: 0;
196
  top: 0;
177
  .alm-listing {
178
  margin: 0;
179
  padding: 0; }
180
+ .alm-listing .alm-reveal > li,
181
+ .alm-listing .alm-paging-content > li,
182
+ .alm-listing > li {
183
  background: none;
184
  margin: 0 0 30px;
185
  padding: 0 0 0 170px;
186
  overflow: hidden;
187
  position: relative;
188
  list-style: none; }
189
+ .alm-listing .alm-reveal > li.no-img,
190
+ .alm-listing .alm-paging-content > li.no-img,
191
+ .alm-listing > li.no-img {
192
  padding: 0; }
193
+ .alm-listing .alm-reveal > li p,
194
+ .alm-listing .alm-paging-content > li p,
195
+ .alm-listing > li p {
196
  margin: 0; }
197
+ .alm-listing .alm-reveal > li h3,
198
+ .alm-listing .alm-paging-content > li h3,
199
+ .alm-listing > li h3 {
200
  margin: 0 0 10px; }
201
+ .alm-listing .alm-reveal > li img,
202
+ .alm-listing .alm-paging-content > li img,
203
+ .alm-listing > li img {
204
  position: absolute;
205
  left: 0;
206
  top: 0;
core/dist/css/ajax-load-more.min.css CHANGED
@@ -1 +1 @@
1
- .alm-btn-wrap .alm-load-more-btn{font-size:15px;font-weight:600;width:auto;height:42px;line-height:42px;background:#ed7070;color:#fff;border:none;border-radius:3px;margin:0 0 4px;padding:0 20px;display:inline-block;position:relative;-webkit-transition:padding .25s ease-in-out,width .25s ease-in-out;transition:padding .25s ease-in-out,width .25s ease-in-out;text-align:center;text-decoration:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.alm-btn-wrap .alm-load-more-btn:hover{background-color:#e06464;color:#fff;text-decoration:none}.alm-btn-wrap .alm-load-more-btn:active{-webkit-box-shadow:inset 0 2px 1px rgba(0,0,0,.1);box-shadow:inset 0 2px 1px rgba(0,0,0,.1);text-decoration:none}.alm-btn-wrap .alm-load-more-btn:active,.alm-btn-wrap .alm-load-more-btn:focus{outline:0}.alm-btn-wrap .alm-load-more-btn.loading{padding-left:44px}.alm-btn-wrap .alm-load-more-btn.done{cursor:default;opacity:.2;background-color:#ed7070;outline:0!important;-webkit-box-shadow:none!important;box-shadow:none!important}.alm-btn-wrap .alm-load-more-btn.done:before,.alm-btn-wrap .alm-load-more-btn:before{background:0 0;width:0}.alm-btn-wrap .alm-load-more-btn.loading:before{background:#fff url(../../img/ajax-loader.gif) no-repeat center center;width:30px;height:30px;margin:6px;border-radius:2px;display:inline-block;z-index:0;content:'';position:absolute;left:0;top:0;overflow:hidden;-webkit-transition:width .5s ease-in-out;transition:width .5s ease-in-out}.alm-btn-wrap,.alm-masonry{display:block;overflow:hidden;clear:both}.alm-btn-wrap{text-align:center;padding:10px 0 25px}.ajax-load-more-wrap.blue .alm-load-more-btn{background-color:#0081bf}.ajax-load-more-wrap.blue .alm-load-more-btn.done,.ajax-load-more-wrap.blue .alm-load-more-btn:hover{background-color:#0073aa}.ajax-load-more-wrap.green .alm-load-more-btn{background-color:#6fca68}.ajax-load-more-wrap.green .alm-load-more-btn.done,.ajax-load-more-wrap.green .alm-load-more-btn:hover{background-color:#64b95e}.ajax-load-more-wrap.red .alm-load-more-btn{background-color:#ca4b4b}.ajax-load-more-wrap.red .alm-load-more-btn.done,.ajax-load-more-wrap.red .alm-load-more-btn:hover{background-color:#b13b3b}.ajax-load-more-wrap.purple .alm-load-more-btn{background-color:#a86bb9}.ajax-load-more-wrap.purple .alm-load-more-btn.done,.ajax-load-more-wrap.purple .alm-load-more-btn:hover{background-color:#9963a8}.ajax-load-more-wrap.grey .alm-load-more-btn{background-color:#888}.ajax-load-more-wrap.grey .alm-load-more-btn.done,.ajax-load-more-wrap.grey .alm-load-more-btn:hover{background-color:#777}.ajax-load-more-wrap.white .alm-load-more-btn{background-color:#fff;color:#666;border:1px solid #efefef}.ajax-load-more-wrap.white .alm-load-more-btn.done,.ajax-load-more-wrap.white .alm-load-more-btn:hover{background-color:#efefef;color:#333}.ajax-load-more-wrap.white .alm-load-more-btn.done{border-color:#fff}.ajax-load-more-wrap.infinite .alm-load-more-btn{width:100%;background-color:transparent!important;background-position:center center;background-repeat:no-repeat;background-image:url(../../img/spinner.gif);border:none!important;opacity:0;-webkit-transition:opacity .25s ease;transition:opacity .25s ease;-webkit-box-shadow:none!important;box-shadow:none!important;overflow:hidden;text-indent:-9999px;cursor:default!important;outline:0!important}.ajax-load-more-wrap.infinite .alm-load-more-btn:before{display:none!important}.ajax-load-more-wrap.infinite .alm-load-more-btn:active{-webkit-box-shadow:none;box-shadow:none}.ajax-load-more-wrap.infinite .alm-load-more-btn.done{opacity:0}.ajax-load-more-wrap.infinite .alm-load-more-btn.loading{opacity:1}.ajax-load-more-wrap.infinite.skype .alm-load-more-btn{background-image:url(../../img/spinner-skype.gif)}.ajax-load-more-wrap.infinite.ring .alm-load-more-btn{background-image:url(../../img/spinner-ring.gif)}.ajax-load-more-wrap.infinite.fading-blocks .alm-load-more-btn{background-image:url(../../img/loader-fading-blocks.gif)}.ajax-load-more-wrap.infinite.fading-circles .alm-load-more-btn{background-image:url(../../img/loader-fading-circles.gif)}.ajax-load-more-wrap.infinite.chasing-arrows .alm-load-more-btn{background-image:url(../../img/spinner-chasing-arrows.gif)}.alm-listing{margin:0;padding:0}.alm-listing li{background:0 0;margin:0 0 30px;padding:0 0 0 170px;overflow:hidden;position:relative;list-style:none}.alm-listing li.no-img{padding:0}.alm-listing li p{margin:0}.alm-listing li h3{margin:0 0 10px}.alm-listing li img{position:absolute;left:0;top:0;border-radius:2px}
1
+ .alm-btn-wrap .alm-load-more-btn{font-size:15px;font-weight:600;width:auto;height:42px;line-height:42px;background:#ed7070;color:#fff;border:none;border-radius:3px;margin:0 0 4px;padding:0 20px;display:inline-block;position:relative;-webkit-transition:padding .25s ease-in-out,width .25s ease-in-out;transition:padding .25s ease-in-out,width .25s ease-in-out;text-align:center;text-decoration:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.alm-btn-wrap .alm-load-more-btn:hover{background-color:#e06464;color:#fff;text-decoration:none}.alm-btn-wrap .alm-load-more-btn:active{-webkit-box-shadow:inset 0 2px 1px rgba(0,0,0,.1);box-shadow:inset 0 2px 1px rgba(0,0,0,.1);text-decoration:none}.alm-btn-wrap .alm-load-more-btn:active,.alm-btn-wrap .alm-load-more-btn:focus{outline:0}.alm-btn-wrap .alm-load-more-btn.loading{padding-left:44px}.alm-btn-wrap .alm-load-more-btn.done{cursor:default;opacity:.2;background-color:#ed7070;outline:0!important;-webkit-box-shadow:none!important;box-shadow:none!important}.alm-btn-wrap .alm-load-more-btn.done:before,.alm-btn-wrap .alm-load-more-btn:before{background:0 0;width:0}.alm-btn-wrap .alm-load-more-btn.loading:before{background:#fff url(../../img/ajax-loader.gif) no-repeat center center;width:30px;height:30px;margin:6px;border-radius:2px;display:inline-block;z-index:0;content:'';position:absolute;left:0;top:0;overflow:hidden;-webkit-transition:width .5s ease-in-out;transition:width .5s ease-in-out}.alm-btn-wrap,.alm-masonry{display:block;overflow:hidden;clear:both}.alm-btn-wrap{text-align:center;padding:10px 0 25px}.ajax-load-more-wrap.blue .alm-load-more-btn{background-color:#0081bf}.ajax-load-more-wrap.blue .alm-load-more-btn.done,.ajax-load-more-wrap.blue .alm-load-more-btn:hover{background-color:#0073aa}.ajax-load-more-wrap.green .alm-load-more-btn{background-color:#6fca68}.ajax-load-more-wrap.green .alm-load-more-btn.done,.ajax-load-more-wrap.green .alm-load-more-btn:hover{background-color:#64b95e}.ajax-load-more-wrap.red .alm-load-more-btn{background-color:#ca4b4b}.ajax-load-more-wrap.red .alm-load-more-btn.done,.ajax-load-more-wrap.red .alm-load-more-btn:hover{background-color:#b13b3b}.ajax-load-more-wrap.purple .alm-load-more-btn{background-color:#a86bb9}.ajax-load-more-wrap.purple .alm-load-more-btn.done,.ajax-load-more-wrap.purple .alm-load-more-btn:hover{background-color:#9963a8}.ajax-load-more-wrap.grey .alm-load-more-btn{background-color:#888}.ajax-load-more-wrap.grey .alm-load-more-btn.done,.ajax-load-more-wrap.grey .alm-load-more-btn:hover{background-color:#777}.ajax-load-more-wrap.white .alm-load-more-btn{background-color:#fff;color:#666;border:1px solid #efefef}.ajax-load-more-wrap.white .alm-load-more-btn.done,.ajax-load-more-wrap.white .alm-load-more-btn:hover{background-color:#efefef;color:#333}.ajax-load-more-wrap.white .alm-load-more-btn.done{border-color:#fff}.ajax-load-more-wrap.infinite .alm-load-more-btn{width:100%;background-color:transparent!important;background-position:center center;background-repeat:no-repeat;background-image:url(../../img/spinner.gif);border:none!important;opacity:0;-webkit-transition:opacity .25s ease;transition:opacity .25s ease;-webkit-box-shadow:none!important;box-shadow:none!important;overflow:hidden;text-indent:-9999px;cursor:default!important;outline:0!important}.ajax-load-more-wrap.infinite .alm-load-more-btn:before{display:none!important}.ajax-load-more-wrap.infinite .alm-load-more-btn:active{-webkit-box-shadow:none;box-shadow:none}.ajax-load-more-wrap.infinite .alm-load-more-btn.done{opacity:0}.ajax-load-more-wrap.infinite .alm-load-more-btn.loading{opacity:1}.ajax-load-more-wrap.infinite.skype .alm-load-more-btn{background-image:url(../../img/spinner-skype.gif)}.ajax-load-more-wrap.infinite.ring .alm-load-more-btn{background-image:url(../../img/spinner-ring.gif)}.ajax-load-more-wrap.infinite.fading-blocks .alm-load-more-btn{background-image:url(../../img/loader-fading-blocks.gif)}.ajax-load-more-wrap.infinite.fading-circles .alm-load-more-btn{background-image:url(../../img/loader-fading-circles.gif)}.ajax-load-more-wrap.infinite.chasing-arrows .alm-load-more-btn{background-image:url(../../img/spinner-chasing-arrows.gif)}.alm-listing{margin:0;padding:0}.alm-listing .alm-paging-content>li,.alm-listing .alm-reveal>li,.alm-listing>li{background:0 0;margin:0 0 30px;padding:0 0 0 170px;overflow:hidden;position:relative;list-style:none}.alm-listing .alm-paging-content>li.no-img,.alm-listing .alm-reveal>li.no-img,.alm-listing>li.no-img{padding:0}.alm-listing .alm-paging-content>li p,.alm-listing .alm-reveal>li p,.alm-listing>li p{margin:0}.alm-listing .alm-paging-content>li h3,.alm-listing .alm-reveal>li h3,.alm-listing>li h3{margin:0 0 10px}.alm-listing .alm-paging-content>li img,.alm-listing .alm-reveal>li img,.alm-listing>li img{position:absolute;left:0;top:0;border-radius:2px}
core/dist/js/ajax-load-more.js CHANGED
@@ -261,7 +261,6 @@ var almMasonry = function almMasonry(container, items, selector, animation, hori
261
  // First Run
262
  if (masonry_init && init) {
263
  container.imagesLoaded(function () {
264
- items.fadeIn(speed);
265
  container.masonry({
266
  itemSelector: selector,
267
  transitionDuration: duration,
@@ -276,16 +275,16 @@ var almMasonry = function almMasonry(container, items, selector, animation, hori
276
  opacity: 1
277
  }
278
  });
279
- //container.masonry('reloadItems');
280
  });
281
  }
282
 
283
  // Standard
284
  else {
285
- container.append(items); // Append new items
286
- container.imagesLoaded(function () {
287
- items.show();
288
- container.masonry('appended', items);
289
  });
290
  }
291
  } else {
@@ -295,6 +294,20 @@ var almMasonry = function almMasonry(container, items, selector, animation, hori
295
  almMasonry(container, items, selector, animation, horizontalOrder, speed, true, true, false);
296
  }
297
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  'use strict';
299
 
300
  function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
@@ -344,6 +357,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
344
  alm.is_search = alm.el.attr('data-search');
345
  alm.slug = alm.el.attr('data-slug');
346
  alm.post_id = alm.el.attr('data-post-id');
 
347
 
348
  alm.repeater = alm.content.attr('data-repeater'); // Repeaters
349
  alm.theme_repeater = alm.content.attr('data-theme-repeater');
@@ -364,7 +378,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
364
  alm.transition = alm.content.attr('data-transition'); // Transition
365
  alm.transition_container = alm.content.attr('data-transition-container'); // Transition Container
366
  alm.tcc = alm.content.attr('data-transition-container-classes'); // Transition Container Classes
367
- alm.speed = alm.content.attr('data-transition-speed');
368
  alm.images_loaded = alm.content.attr('data-images-loaded');
369
  alm.destroy_after = alm.content.attr('data-destroy-after');
370
  alm.lang = alm.content.attr('data-lang');
@@ -404,6 +418,12 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
404
  // if comments, adjust alm.content wrapper
405
  alm.content = $('.alm-comments', alm.container);
406
  }
 
 
 
 
 
 
407
 
408
  alm.filters = alm.content.attr('data-filters');
409
 
@@ -539,7 +559,8 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
539
  alm.permalink = alm.content.attr('data-seo-permalink');
540
  alm.pageview = alm.content.attr('data-seo-pageview');
541
  alm.start_page = alm.content.attr('data-seo-start-page');
542
- alm.trailing_slash = alm.content.attr('data-seo-trailing-slash') === 'false' ? '' : '/';
 
543
 
544
  if (alm.start_page) {
545
  alm.seo_scroll = alm.content.attr('data-seo-scroll');
@@ -684,9 +705,6 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
684
  }
685
  }
686
 
687
- /* Speed */
688
- alm.speed = alm.speed === undefined || alm.speed === '' ? 250 : parseInt(alm.speed);
689
-
690
  /* Scroll */
691
  if (alm.content.attr('data-scroll') === undefined) {
692
  alm.scroll = true;
@@ -826,7 +844,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
826
  };
827
  }
828
 
829
- // Comment query
830
  alm.comments_array = '';
831
  if (alm.comments === 'true') {
832
  action = 'alm_comments_query';
@@ -842,7 +860,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
842
  };
843
  }
844
 
845
- // Users query
846
  alm.users_array = '';
847
  if (alm.users) {
848
  action = 'alm_users_query';
@@ -857,7 +875,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
857
  };
858
  }
859
 
860
- // CTA Add-on Query params
861
  alm.cta_array = '';
862
  if (alm.cta === 'true') {
863
  alm.cta_array = {
@@ -961,8 +979,8 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
961
  action: action,
962
  nonce: alm_localize.alm_nonce,
963
  query_type: queryType,
964
- post_id: alm.post_id,
965
  id: el.attr('data-id'),
 
966
  slug: alm.slug,
967
  canonical_url: alm.canonical_url,
968
  cache_id: alm.cache_id,
@@ -1069,6 +1087,8 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1069
  alm.AjaxLoadMore.getPreviousPost();
1070
  }
1071
 
 
 
1072
  var html, meta, total;
1073
 
1074
  if (is_cache) {
@@ -1103,21 +1123,25 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1103
 
1104
  // Is pagination
1105
  if (total > 0) {
1106
- alm.el = $('<div class="alm-reveal' + alm.tcc + '"/>');
1107
  alm.el.append('<div class="alm-paging-content"></div><div class="alm-paging-loading"></div>');
1108
- $('.alm-paging-content', alm.el).append(alm.data).hide();
1109
  alm.content.append(alm.el);
 
1110
  alm.content.parent().removeClass('loading'); // Remove loading class from main container
1111
  alm.AjaxLoadMore.resetBtnText();
1112
 
1113
- $('.alm-paging-content', alm.el).fadeIn(alm.speed, 'alm_easeInOutQuad', function () {
1114
- var paddingT = parseInt(alm.content.css('padding-top')),
1115
- paddingB = parseInt(alm.content.css('padding-bottom'));
1116
- alm.content.css('height', alm.el.height() + paddingT + paddingB + 'px');
1117
- if ($.isFunction($.fn.almFadePageControls)) {
1118
- $.fn.almFadePageControls(alm.btnWrap);
1119
- }
1120
- });
 
 
 
1121
  }
1122
  }
1123
 
@@ -1149,8 +1173,8 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1149
  if (alm.filters) {
1150
 
1151
  if (alm.filters_startpage) {
1152
- // Set new page #
1153
- alm.page = alm.filters_startpage - 1;
1154
 
1155
  // Reset filters-startpage data attr after the first run
1156
  alm.posts_per_page = alm.content.attr('data-posts-per-page');
@@ -1161,20 +1185,19 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1161
 
1162
  if (total > 0) {
1163
 
1164
- // Results!
 
1165
  if (!alm.paging) {
1166
 
1167
  if (alm.previous_post) {
1168
- // If Previous Post, create container and append data
1169
-
1170
- 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 + '" data-page="' + alm.page + '"/>');
1171
- alm.el.append(alm.data).hide();
1172
  } else {
1173
 
1174
  if (!alm.transition_container) {
1175
  // No transition container
1176
 
1177
- alm.data.hide();
1178
  alm.el = alm.data;
1179
  } else {
1180
  // Standard container
@@ -1212,19 +1235,19 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1212
  if (alm.permalink === 'default') {
1213
  div = $('<div class="alm-reveal alm-seo' + alm.tcc + '" data-url="' + alm.canonical_url + '' + alm.search_value + '&paged=' + pagenum + '" data-page="' + pagenum + '" />');
1214
  } else {
1215
- div = $('<div class="alm-reveal alm-seo' + alm.tcc + '" data-url="' + alm.canonical_url + 'page/' + pagenum + alm.trailing_slash + alm.search_value + '" data-page="' + pagenum + '" />');
1216
  }
1217
  } else {
1218
  // First Page
1219
- div = $('<div class="alm-reveal alm-seo' + alm.tcc + '" data-url="' + alm.canonical_url + '' + alm.search_value + '" data-page="1" />');
1220
  }
1221
 
1222
  div.append(seo_data[k]);
1223
  div = $(div); // convert to object
1224
- alm.el.append(div).hide(); // Append data to .alm-listing wrapper
1225
  }
1226
  }
1227
- // End SEO -- /
1228
 
1229
  else {
1230
  // If is SEO and paged OR Preloaded.
@@ -1238,32 +1261,32 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1238
  if (alm.seo) {
1239
 
1240
  if (alm.permalink === 'default') {
1241
- alm.el = $('<div class="alm-reveal alm-seo' + alm.tcc + '" data-url="' + alm.canonical_url + '' + alm.search_value + '&paged=' + pagenum + '" data-page="' + pagenum + '" />');
1242
  } else {
1243
- alm.el = $('<div class="alm-reveal alm-seo' + alm.tcc + '" data-url="' + alm.canonical_url + 'page/' + pagenum + alm.trailing_slash + alm.search_value + '" data-page="' + pagenum + '" />');
1244
  }
1245
  } else if (alm.filters) {
1246
  // Filters
1247
- alm.el = $('<div class="alm-reveal alm-filters' + alm.tcc + '" data-url="' + alm.canonical_url + '' + querystring + '" data-page="' + pagenum + '" />');
1248
  } else {
1249
  // Basic ALM
1250
- alm.el = $('<div class="alm-reveal' + alm.tcc + '" />');
1251
  }
1252
  } else if (alm.filters) {
1253
  // Filters
1254
- alm.el = $('<div class="alm-reveal alm-filters' + alm.tcc + '" data-url="' + alm.canonical_url + '' + querystring + '" data-page="' + (alm.page + 1) + '" />');
1255
  } else {
1256
 
1257
  if (alm.seo) {
1258
  // SEO [Page 1]
1259
- alm.el = $('<div class="alm-reveal alm-seo' + alm.tcc + '" data-url="' + alm.canonical_url + '' + alm.search_value + '" data-page="1" />');
1260
  } else {
1261
  // Basic ALM
1262
- alm.el = $('<div class="alm-reveal' + alm.tcc + '" />');
1263
  }
1264
  }
1265
 
1266
- alm.el.append(alm.data).hide();
1267
  }
1268
  }
1269
  }
@@ -1274,87 +1297,31 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1274
  alm.content.append(alm.el);
1275
  }
1276
 
1277
- // Transition
1278
- if (alm.transition === 'fade') {
1279
- // Fade
1280
- if (alm.images_loaded === 'true') {
1281
- alm.el.almWaitForImages().done(function () {
1282
- alm.el.fadeIn(alm.speed, 'alm_easeInOutQuad', function () {
1283
- alm.loading = false;
1284
- if (!alm.paging) {
1285
- alm.button.delay(alm.speed).removeClass('loading');
1286
- alm.AjaxLoadMore.resetBtnText();
1287
- }
1288
- alm.container.removeClass('alm-loading');
1289
- alm.AjaxLoadMore.triggerAddons(alm);
1290
- });
1291
- });
1292
- } else {
1293
- alm.el.fadeIn(alm.speed, 'alm_easeInOutQuad', function () {
1294
- alm.loading = false;
1295
- if (!alm.paging) {
1296
- alm.button.delay(alm.speed).removeClass('loading');
1297
- alm.AjaxLoadMore.resetBtnText();
1298
- }
1299
- alm.container.removeClass('alm-loading');
1300
- alm.AjaxLoadMore.triggerAddons(alm);
1301
- });
1302
- }
1303
- } else if (alm.transition === 'masonry') {
1304
- // Masonry
1305
-
1306
- almMasonry(alm.masonry_wrap, alm.el, alm.masonry_selector, alm.masonry_animation, alm.masonry_horizontalorder, alm.speed, alm.masonry_init, alm.init, alm_is_filtering);alm.masonry_init = false;
1307
 
1308
- if (!alm.paging) {
1309
- alm.button.delay(alm.speed).removeClass('loading');
1310
- alm.AjaxLoadMore.resetBtnText();
1311
- }
1312
- alm.loading = false;
1313
- alm.container.removeClass('alm-loading');
1314
- alm.AjaxLoadMore.triggerAddons(alm);
1315
- } else if (alm.transition === 'none') {
1316
- // None
1317
- if (alm.images_loaded === 'true') {
1318
- alm.el.almWaitForImages().done(function () {
1319
- alm.el.show();
1320
- alm.AjaxLoadMore.triggerAddons(alm);
1321
- });
1322
- } else {
1323
- alm.el.show();
1324
- alm.AjaxLoadMore.triggerAddons(alm);
1325
- }
1326
- alm.loading = false;
1327
- if (!alm.paging) {
1328
- alm.button.delay(alm.speed).removeClass('loading');
1329
- alm.AjaxLoadMore.resetBtnText();
1330
  }
1331
- } else {
1332
- // Slide
1333
- if (alm.images_loaded === 'true') {
1334
- alm.el.almWaitForImages().done(function () {
1335
- alm.el.slideDown(alm.speed, 'alm_easeInOutQuad', function () {
1336
- alm.loading = false;
1337
- if (!alm.paging) {
1338
- alm.button.delay(alm.speed).removeClass('loading');
1339
- alm.AjaxLoadMore.resetBtnText();
1340
- }
1341
- alm.container.removeClass('alm-loading');
1342
- alm.AjaxLoadMore.triggerAddons(alm);
1343
- });
1344
- });
1345
- } else {
1346
- alm.el.slideDown(alm.speed, 'alm_easeInOutQuad', function () {
1347
- alm.loading = false;
1348
- if (!alm.paging) {
1349
- alm.button.delay(alm.speed).removeClass('loading');
1350
- alm.AjaxLoadMore.resetBtnText();
1351
  }
1352
- alm.container.removeClass('alm-loading');
1353
- alm.AjaxLoadMore.triggerAddons(alm);
1354
- });
1355
- }
1356
- }
1357
- // End Transition
1358
  } else {
1359
 
1360
  // Paging
@@ -1415,18 +1382,13 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1415
  // Destroy After
1416
  if (alm.destroy_after !== undefined && alm.destroy_after !== '') {
1417
  var currentPage = alm.page + 1; // Add 1 because alm.page starts at 0
1418
- if (alm.preload) {
 
1419
  currentPage++;
1420
  }
1421
  if (currentPage == alm.destroy_after) {
1422
- // - Disable ALM is page = alm.destroy_after value
1423
- alm.disable_ajax = true;
1424
- if (!alm.paging) {
1425
- alm.button.delay(alm.speed).fadeOut(alm.speed);
1426
- if ($.isFunction($.fn.almDestroyed)) {
1427
- $.fn.almDestroyed(alm);
1428
- }
1429
- }
1430
  }
1431
  }
1432
  // End Destroy After
@@ -1465,10 +1427,12 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1465
  $.fn.almEmpty(alm);
1466
  }
1467
  }
1468
-
1469
- if ($.isFunction($.fn.almFadePageControls)) {
1470
- $.fn.almFadePageControls(alm.btnWrap);
1471
- }
 
 
1472
  };
1473
 
1474
  /* pagingNextpageInit()
@@ -1494,7 +1458,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1494
  $.fn.almSetNextPageVars(alm); // Next Page Add-on
1495
  }
1496
 
1497
- // Delay the following to avoid positioning
1498
  setTimeout(function () {
1499
  if ($.isFunction($.fn.almFadePageControls)) {
1500
  $.fn.almFadePageControls(alm.btnWrap); // Paging Add-on
@@ -1503,10 +1467,10 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1503
  if ($.isFunction($.fn.almOnWindowResize)) {
1504
  $.fn.almOnWindowResize(alm); // Paging Add-on
1505
  }
1506
- }, 200);
1507
  };
1508
 
1509
- /* getPreviousPost()
1510
  *
1511
  * Get the previous post ID via ajax
1512
  * @since 2.7.4
@@ -1552,9 +1516,9 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1552
  });
1553
  };
1554
 
1555
- /* loadComplete()
1556
  *
1557
- * Fires various add-on functions (if available) after load complete.
1558
  * @since 2.14.0
1559
  */
1560
  alm.AjaxLoadMore.triggerAddons = function (alm) {
@@ -1591,11 +1555,9 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1591
  * @since 2.8.4
1592
  */
1593
  alm.AjaxLoadMore.resetBtnText = function () {
1594
- if (alm.button_loading_label !== false) {
1595
  // Reset button text
1596
- if (!alm.paging) {
1597
- alm.button.html(alm.button_label);
1598
- }
1599
  }
1600
  };
1601
 
@@ -1664,7 +1626,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1664
  }
1665
  this.resizeTO = setTimeout(function () {
1666
  $(this).trigger('resizeEnd');
1667
- }, 250);
1668
  });
1669
  }
1670
 
@@ -1723,6 +1685,62 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1723
  });
1724
  }
1725
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1726
  /* Init Ajax load More
1727
  *
1728
  * Load posts as user scrolls the page
@@ -1730,6 +1748,11 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1730
  */
1731
  alm.AjaxLoadMore.init = function () {
1732
 
 
 
 
 
 
1733
  if (!alm.paging && !alm.previous_post) {
1734
  if (alm.disable_ajax) {
1735
  alm.finished = true;
@@ -1757,7 +1780,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1757
  if ($.isFunction($.fn.almSEO) && alm.start_page < 1) {
1758
  $.fn.almSEO(alm, true);
1759
  }
1760
- }, 150);
1761
  }
1762
 
1763
  // Preloaded
@@ -1774,7 +1797,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1774
  $.fn.almEmpty(alm);
1775
  }
1776
  }
1777
- }, 150);
1778
  }
1779
 
1780
  // Next Page Add-on
@@ -1804,7 +1827,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1804
  //flag to prevent unnecessary loading of post on init. Hold for 2/10 of a second
1805
  setTimeout(function () {
1806
  alm.proceed = true;
1807
- }, 200);
1808
 
1809
  /* $.fn.almUpdateCurrentPage()
1810
  *
@@ -1832,7 +1855,6 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1832
  data = $('.alm-preloaded .alm-reveal', alm.el).html(); // Content of preloaded page
1833
  $('.alm-preloaded', alm.el).remove();
1834
  alm.preloaded_amount = 0; // Reset
1835
- //alm.AjaxLoadMore.success(data, true); // Skip post loading and go right to success() for display
1836
  alm.AjaxLoadMore.pagingPreloadedInit(data);
1837
  alm.paging_init = false;
1838
  alm.init = false;
@@ -1915,7 +1937,6 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
1915
  var ajaxloadmore = document.querySelectorAll('.ajax-load-more-wrap');
1916
  if (ajaxloadmore.length) {
1917
  [].concat(_toConsumableArray(ajaxloadmore)).forEach(function (alm, e) {
1918
- //$(alm).data('alm', new $.ajaxloadmore($(alm), e));
1919
  new $.ajaxloadmore($(alm), e);
1920
  });
1921
  }
261
  // First Run
262
  if (masonry_init && init) {
263
  container.imagesLoaded(function () {
 
264
  container.masonry({
265
  itemSelector: selector,
266
  transitionDuration: duration,
275
  opacity: 1
276
  }
277
  });
278
+ almMasonryFadeIn(container[0].parentNode, speed);
279
  });
280
  }
281
 
282
  // Standard
283
  else {
284
+ //container.append( items ); // Append new items
285
+ items.imagesLoaded(function () {
286
+ //items.show();
287
+ container.append(items).masonry('appended', items);
288
  });
289
  }
290
  } else {
294
  almMasonry(container, items, selector, animation, horizontalOrder, speed, true, true, false);
295
  }
296
  };
297
+
298
+ // Fade in masonry on initial page load
299
+ var almMasonryFadeIn = function almMasonryFadeIn(element, speed) {
300
+ speed = speed / 10;
301
+ var op = parseInt(element.style.opacity); // initial opacity
302
+ var timer = setInterval(function () {
303
+ if (op > 0.9) {
304
+ element.style.opacity = 1;
305
+ clearInterval(timer);
306
+ }
307
+ element.style.opacity = op;
308
+ op += 0.1;
309
+ }, speed);
310
+ };
311
  'use strict';
312
 
313
  function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
357
  alm.is_search = alm.el.attr('data-search');
358
  alm.slug = alm.el.attr('data-slug');
359
  alm.post_id = alm.el.attr('data-post-id');
360
+ alm.id = alm.el.attr('data-id') ? alm.el.attr('data-id') : '';
361
 
362
  alm.repeater = alm.content.attr('data-repeater'); // Repeaters
363
  alm.theme_repeater = alm.content.attr('data-theme-repeater');
378
  alm.transition = alm.content.attr('data-transition'); // Transition
379
  alm.transition_container = alm.content.attr('data-transition-container'); // Transition Container
380
  alm.tcc = alm.content.attr('data-transition-container-classes'); // Transition Container Classes
381
+ alm.speed = 250;
382
  alm.images_loaded = alm.content.attr('data-images-loaded');
383
  alm.destroy_after = alm.content.attr('data-destroy-after');
384
  alm.lang = alm.content.attr('data-lang');
418
  // if comments, adjust alm.content wrapper
419
  alm.content = $('.alm-comments', alm.container);
420
  }
421
+ alm.comments_post_id = alm.content.attr('data-comments_post_id'); // current post id
422
+ alm.comments_per_page = alm.content.attr('data-comments_per_page');
423
+ alm.comments_type = alm.content.attr('data-comments_type');
424
+ alm.comments_style = alm.content.attr('data-comments_style');
425
+ alm.comments_template = alm.content.attr('data-comments_template');
426
+ alm.comments_callback = alm.content.attr('data-comments_callback');
427
 
428
  alm.filters = alm.content.attr('data-filters');
429
 
559
  alm.permalink = alm.content.attr('data-seo-permalink');
560
  alm.pageview = alm.content.attr('data-seo-pageview');
561
  alm.start_page = alm.content.attr('data-seo-start-page');
562
+ alm.seo_trailing_slash = alm.content.attr('data-seo-trailing-slash') === 'false' ? '' : '/';
563
+ alm.seo_leading_slash = alm.content.attr('data-seo-leading-slash') === 'true' ? '/' : '';
564
 
565
  if (alm.start_page) {
566
  alm.seo_scroll = alm.content.attr('data-seo-scroll');
705
  }
706
  }
707
 
 
 
 
708
  /* Scroll */
709
  if (alm.content.attr('data-scroll') === undefined) {
710
  alm.scroll = true;
844
  };
845
  }
846
 
847
+ // Comment Params
848
  alm.comments_array = '';
849
  if (alm.comments === 'true') {
850
  action = 'alm_comments_query';
860
  };
861
  }
862
 
863
+ // Users Params
864
  alm.users_array = '';
865
  if (alm.users) {
866
  action = 'alm_users_query';
875
  };
876
  }
877
 
878
+ // CTA Params
879
  alm.cta_array = '';
880
  if (alm.cta === 'true') {
881
  alm.cta_array = {
979
  action: action,
980
  nonce: alm_localize.alm_nonce,
981
  query_type: queryType,
 
982
  id: el.attr('data-id'),
983
+ post_id: alm.post_id,
984
  slug: alm.slug,
985
  canonical_url: alm.canonical_url,
986
  cache_id: alm.cache_id,
1087
  alm.AjaxLoadMore.getPreviousPost();
1088
  }
1089
 
1090
+ var loadingStyle = 'style="opacity: 0; height: 0;"';
1091
+
1092
  var html, meta, total;
1093
 
1094
  if (is_cache) {
1123
 
1124
  // Is pagination
1125
  if (total > 0) {
1126
+ alm.el = $('<div class="alm-reveal' + alm.tcc + '" ' + loadingStyle + '/>');
1127
  alm.el.append('<div class="alm-paging-content"></div><div class="alm-paging-loading"></div>');
1128
+ $('.alm-paging-content', alm.el).append(alm.data);
1129
  alm.content.append(alm.el);
1130
+ alm.AjaxLoadMore.fadeIn(alm.el.get(0), alm.speed);
1131
  alm.content.parent().removeClass('loading'); // Remove loading class from main container
1132
  alm.AjaxLoadMore.resetBtnText();
1133
 
1134
+ // Delay reveal until paging elements have been added
1135
+ setTimeout(function () {
1136
+ $('.alm-paging-content', alm.el).fadeIn(alm.speed, 'alm_easeInOutQuad', function () {
1137
+ var paddingT = parseInt(alm.content.css('padding-top')),
1138
+ paddingB = parseInt(alm.content.css('padding-bottom'));
1139
+ alm.content.css('height', alm.el.height() + paddingT + paddingB + 'px');
1140
+ if ($.isFunction($.fn.almFadePageControls)) {
1141
+ $.fn.almFadePageControls(alm.btnWrap);
1142
+ }
1143
+ });
1144
+ }, alm.speed);
1145
  }
1146
  }
1147
 
1173
  if (alm.filters) {
1174
 
1175
  if (alm.filters_startpage) {
1176
+
1177
+ alm.page = alm.filters_startpage - 1; // Set new page #
1178
 
1179
  // Reset filters-startpage data attr after the first run
1180
  alm.posts_per_page = alm.content.attr('data-posts-per-page');
1185
 
1186
  if (total > 0) {
1187
 
1188
+ // We have results!
1189
+
1190
  if (!alm.paging) {
1191
 
1192
  if (alm.previous_post) {
1193
+ // Previous Post, create container and append data
1194
+ alm.el = $('<div class="alm-reveal alm-previous-post post-' + alm.previous_post_id + '" ' + loadingStyle + ' data-id="' + alm.previous_post_id + '" data-title="' + alm.previous_post_title + '" data-url="' + alm.previous_post_permalink + '" data-page="' + alm.page + '"/>');
1195
+ alm.el.append(alm.data);
 
1196
  } else {
1197
 
1198
  if (!alm.transition_container) {
1199
  // No transition container
1200
 
 
1201
  alm.el = alm.data;
1202
  } else {
1203
  // Standard container
1235
  if (alm.permalink === 'default') {
1236
  div = $('<div class="alm-reveal alm-seo' + alm.tcc + '" data-url="' + alm.canonical_url + '' + alm.search_value + '&paged=' + pagenum + '" data-page="' + pagenum + '" />');
1237
  } else {
1238
+ div = $('<div class="alm-reveal alm-seo' + alm.tcc + '" data-url="' + alm.canonical_url + alm.seo_leading_slash + 'page/' + pagenum + alm.seo_trailing_slash + alm.search_value + '" data-page="' + pagenum + '" />');
1239
  }
1240
  } else {
1241
  // First Page
1242
+ div = $('<div class="alm-reveal alm-seo' + alm.tcc + '" data-url="' + alm.canonical_url + '' + alm.search_value + '" data-page="1" />');
1243
  }
1244
 
1245
  div.append(seo_data[k]);
1246
  div = $(div); // convert to object
1247
+ alm.el.append(div); // Append data to .alm-listing wrapper
1248
  }
1249
  }
1250
+ // End SEO
1251
 
1252
  else {
1253
  // If is SEO and paged OR Preloaded.
1261
  if (alm.seo) {
1262
 
1263
  if (alm.permalink === 'default') {
1264
+ alm.el = $('<div class="alm-reveal alm-seo' + alm.tcc + '" ' + loadingStyle + ' data-url="' + alm.canonical_url + '' + alm.search_value + '&paged=' + pagenum + '" data-page="' + pagenum + '" />');
1265
  } else {
1266
+ alm.el = $('<div class="alm-reveal alm-seo' + alm.tcc + '" ' + loadingStyle + ' data-url="' + alm.canonical_url + alm.seo_leading_slash + 'page/' + pagenum + alm.seo_trailing_slash + alm.search_value + '" data-page="' + pagenum + '" />');
1267
  }
1268
  } else if (alm.filters) {
1269
  // Filters
1270
+ alm.el = $('<div class="alm-reveal alm-filters' + alm.tcc + '" ' + loadingStyle + ' data-url="' + alm.canonical_url + '' + querystring + '" data-page="' + pagenum + '" />');
1271
  } else {
1272
  // Basic ALM
1273
+ alm.el = $('<div class="alm-reveal' + alm.tcc + '" ' + loadingStyle + ' />');
1274
  }
1275
  } else if (alm.filters) {
1276
  // Filters
1277
+ alm.el = $('<div class="alm-reveal alm-filters' + alm.tcc + '" ' + loadingStyle + ' data-url="' + alm.canonical_url + '' + querystring + '" data-page="' + (alm.page + 1) + '" />');
1278
  } else {
1279
 
1280
  if (alm.seo) {
1281
  // SEO [Page 1]
1282
+ alm.el = $('<div class="alm-reveal alm-seo' + alm.tcc + '" ' + loadingStyle + ' data-url="' + alm.canonical_url + '' + alm.search_value + '" data-page="1" />');
1283
  } else {
1284
  // Basic ALM
1285
+ alm.el = $('<div class="alm-reveal' + alm.tcc + '" ' + loadingStyle + ' />');
1286
  }
1287
  }
1288
 
1289
+ alm.el.append(alm.data);
1290
  }
1291
  }
1292
  }
1297
  alm.content.append(alm.el);
1298
  }
1299
 
1300
+ // Transitions
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1301
 
1302
+ // Masonry
1303
+ if (alm.transition === 'masonry') {
1304
+ almMasonry(alm.masonry_wrap, alm.el, alm.masonry_selector, alm.masonry_animation, alm.masonry_horizontalorder, alm.speed, alm.masonry_init, alm.init, alm_is_filtering);
1305
+ alm.masonry_init = false;
1306
+ alm.AjaxLoadMore.transitionEnd();
1307
+ }
1308
+ // None
1309
+ else if (alm.transition === 'none') {
1310
+ alm.AjaxLoadMore.fadeIn(alm.el.get(0), 0);
1311
+ alm.AjaxLoadMore.transitionEnd();
 
 
 
 
 
 
 
 
 
 
 
 
1312
  }
1313
+ // Fade transition
1314
+ else {
1315
+ if (alm.images_loaded === 'true') {
1316
+ alm.el.almWaitForImages().done(function () {
1317
+ alm.AjaxLoadMore.fadeIn(alm.el.get(0), alm.speed);
1318
+ alm.AjaxLoadMore.transitionEnd();
1319
+ });
1320
+ } else {
1321
+ alm.AjaxLoadMore.fadeIn(alm.el.get(0), alm.speed);
1322
+ alm.AjaxLoadMore.transitionEnd();
 
 
 
 
 
 
 
 
 
 
1323
  }
1324
+ }
 
 
 
 
 
1325
  } else {
1326
 
1327
  // Paging
1382
  // Destroy After
1383
  if (alm.destroy_after !== undefined && alm.destroy_after !== '') {
1384
  var currentPage = alm.page + 1; // Add 1 because alm.page starts at 0
1385
+ if (alm.preloaded === 'true') {
1386
+ // Add 1 for preloaded
1387
  currentPage++;
1388
  }
1389
  if (currentPage == alm.destroy_after) {
1390
+ // Disable ALM if page = alm.destroy_after val
1391
+ alm.AjaxLoadMore.destroyed();
 
 
 
 
 
 
1392
  }
1393
  }
1394
  // End Destroy After
1427
  $.fn.almEmpty(alm);
1428
  }
1429
  }
1430
+ // Delay to avoid positioning issues
1431
+ setTimeout(function () {
1432
+ if ($.isFunction($.fn.almFadePageControls)) {
1433
+ $.fn.almFadePageControls(alm.btnWrap);
1434
+ }
1435
+ }, alm.speed);
1436
  };
1437
 
1438
  /* pagingNextpageInit()
1458
  $.fn.almSetNextPageVars(alm); // Next Page Add-on
1459
  }
1460
 
1461
+ // Delay to avoid positioning issues
1462
  setTimeout(function () {
1463
  if ($.isFunction($.fn.almFadePageControls)) {
1464
  $.fn.almFadePageControls(alm.btnWrap); // Paging Add-on
1467
  if ($.isFunction($.fn.almOnWindowResize)) {
1468
  $.fn.almOnWindowResize(alm); // Paging Add-on
1469
  }
1470
+ }, alm.speed);
1471
  };
1472
 
1473
+ /* fetchingPreviousPost()
1474
  *
1475
  * Get the previous post ID via ajax
1476
  * @since 2.7.4
1516
  });
1517
  };
1518
 
1519
+ /* triggerAddons()
1520
  *
1521
+ * Triggers various add-on functions (if available) after load complete.
1522
  * @since 2.14.0
1523
  */
1524
  alm.AjaxLoadMore.triggerAddons = function (alm) {
1555
  * @since 2.8.4
1556
  */
1557
  alm.AjaxLoadMore.resetBtnText = function () {
1558
+ if (alm.button_loading_label !== false && !alm.paging) {
1559
  // Reset button text
1560
+ alm.button.html(alm.button_label);
 
 
1561
  }
1562
  };
1563
 
1626
  }
1627
  this.resizeTO = setTimeout(function () {
1628
  $(this).trigger('resizeEnd');
1629
+ }, alm.speed);
1630
  });
1631
  }
1632
 
1685
  });
1686
  }
1687
 
1688
+ /* Destroy Ajax load More
1689
+ *
1690
+ * Destroy Ajax Load More functionality
1691
+ * @since 3.4.2
1692
+ */
1693
+ alm.AjaxLoadMore.destroyed = function () {
1694
+ alm.disable_ajax = true;
1695
+ if (!alm.paging) {
1696
+ alm.button.delay(alm.speed).fadeOut(alm.speed);
1697
+ if ($.isFunction($.fn.almDestroyed)) {
1698
+ $.fn.almDestroyed(alm);
1699
+ }
1700
+ }
1701
+ };
1702
+
1703
+ /* Fade in helper
1704
+ *
1705
+ * Fade in elements after an Ajax call
1706
+ * @since 3.5
1707
+ */
1708
+ alm.AjaxLoadMore.fadeIn = function (element, speed) {
1709
+ if (speed == 0) {
1710
+ element.style.opacity = 1;
1711
+ element.style.height = 'auto';
1712
+ } else {
1713
+ speed = speed / 10;
1714
+ var op = 0; // initial opacity
1715
+ var timer = setInterval(function () {
1716
+ if (op > 0.9) {
1717
+ element.style.opacity = 1;
1718
+ clearInterval(timer);
1719
+ }
1720
+ element.style.opacity = op;
1721
+ op += 0.1;
1722
+ }, speed);
1723
+ element.style.height = 'auto';
1724
+ }
1725
+ };
1726
+
1727
+ /* Transition End
1728
+ *
1729
+ * Set variables after loading transiton completes
1730
+ * @since 3.5
1731
+ */
1732
+ alm.AjaxLoadMore.transitionEnd = function () {
1733
+ setTimeout(function () {
1734
+ alm.loading = false;
1735
+ alm.container.removeClass('alm-loading');
1736
+ alm.AjaxLoadMore.triggerAddons(alm);
1737
+ if (!alm.paging) {
1738
+ alm.button.delay(alm.speed).removeClass('loading');
1739
+ alm.AjaxLoadMore.resetBtnText();
1740
+ }
1741
+ }, alm.speed);
1742
+ };
1743
+
1744
  /* Init Ajax load More
1745
  *
1746
  * Load posts as user scrolls the page
1748
  */
1749
  alm.AjaxLoadMore.init = function () {
1750
 
1751
+ // Preloaded and destroy_after is 1
1752
+ if (alm.preloaded === 'true' && alm.destroy_after == 1) {
1753
+ alm.AjaxLoadMore.destroyed();
1754
+ }
1755
+
1756
  if (!alm.paging && !alm.previous_post) {
1757
  if (alm.disable_ajax) {
1758
  alm.finished = true;
1780
  if ($.isFunction($.fn.almSEO) && alm.start_page < 1) {
1781
  $.fn.almSEO(alm, true);
1782
  }
1783
+ }, alm.speed);
1784
  }
1785
 
1786
  // Preloaded
1797
  $.fn.almEmpty(alm);
1798
  }
1799
  }
1800
+ }, alm.speed);
1801
  }
1802
 
1803
  // Next Page Add-on
1827
  //flag to prevent unnecessary loading of post on init. Hold for 2/10 of a second
1828
  setTimeout(function () {
1829
  alm.proceed = true;
1830
+ }, 150);
1831
 
1832
  /* $.fn.almUpdateCurrentPage()
1833
  *
1855
  data = $('.alm-preloaded .alm-reveal', alm.el).html(); // Content of preloaded page
1856
  $('.alm-preloaded', alm.el).remove();
1857
  alm.preloaded_amount = 0; // Reset
 
1858
  alm.AjaxLoadMore.pagingPreloadedInit(data);
1859
  alm.paging_init = false;
1860
  alm.init = false;
1937
  var ajaxloadmore = document.querySelectorAll('.ajax-load-more-wrap');
1938
  if (ajaxloadmore.length) {
1939
  [].concat(_toConsumableArray(ajaxloadmore)).forEach(function (alm, e) {
 
1940
  new $.ajaxloadmore($(alm), e);
1941
  });
1942
  }
core/dist/js/ajax-load-more.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";function _toConsumableArray(t){if(Array.isArray(t)){for(var a=0,e=Array(t.length);a<t.length;a++)e[a]=t[a];return e}return Array.from(t)}function _toConsumableArray(t){if(Array.isArray(t)){for(var a=0,e=Array(t.length);a<t.length;a++)e[a]=t[a];return e}return Array.from(t)}Array.from||(Array.from=function(){var t=Object.prototype.toString,a=function(a){return"function"==typeof a||"[object Function]"===t.call(a)},e=function(t){var a=Number(t);return isNaN(a)?0:0!==a&&isFinite(a)?(a>0?1:-1)*Math.floor(Math.abs(a)):a},o=Math.pow(2,53)-1,n=function(t){var a=e(t);return Math.min(Math.max(a,0),o)};return function(t){var e=this,o=Object(t);if(null==t)throw new TypeError("Array.from requires an array-like object - not null or undefined");var r,s=arguments.length>1?arguments[1]:void 0;if(void 0!==s){if(!a(s))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(r=arguments[2])}for(var i,l=n(o.length),d=a(e)?Object(new e(l)):new Array(l),p=0;p<l;)i=o[p],d[p]=s?void 0===r?s(i,p):s.call(r,i,p):i,p+=1;return d.length=l,d}}());var almGetParameterByName=function(t,a){a||(a=window.location.href),t=t.replace(/[\[\]]/g,"\\$&");var e=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(a);return e?e[2]?decodeURIComponent(e[2].replace(/\+/g," ")):"":null},alm_is_filtering=!1;!function(t){t.fn.almFilter=function(a,e,o){o.target?t(".ajax-load-more-wrap[data-id='"+o.target+"']").each(function(n){var r=t(this);t.fn.almFilterTransition(a,e,o,r)}):t(".ajax-load-more-wrap").each(function(n){var r=t(this);t.fn.almFilterTransition(a,e,o,r)})},t.fn.almFilterTransition=function(t,e,o,n){"slide"===t?n.slideUp(e,function(){a(e,o,n)}):"fade"===t||"masonry"===t?n.fadeOut(e,function(){a(e,o,n)}):a(e,o,n)};var a=function(t,a,o){var n=o.get(0),r=n.querySelectorAll(".alm-listing");[].concat(_toConsumableArray(r)).forEach(function(t){t.innerHTML=""});var s=n.querySelector(".alm-load-more-btn");s&&s.classList.remove("done"),e(t,a,o)},e=function(a,e,o){t.each(e,function(a,e){a=a.replace(/\W+/g,"-").replace(/([a-z\d])([A-Z])/g,"$1-$2"),t(".alm-listing",o).attr("data-"+a,e)}),t.isFunction(t.fn.almFilterComplete)&&t.fn.almFilterComplete(),"function"==typeof almFiltersAddonComplete&&almFiltersAddonComplete(o),alm_is_filtering=!0,o.fadeIn(a),e.target?t(".ajax-load-more-wrap[data-id="+e.target+"]").ajaxloadmore():t(".ajax-load-more-wrap").ajaxloadmore()}}(jQuery);var almMasonry=function t(a,e,o,n,r,s,i,l,d){var p=(s+100)/1e3+"s",c="scale(0.5)",g="scale(1)";"zoom-out"===n&&(c="translateY(-20px) scale(1.25)",g="translateY(0) scale(1)"),"slide-up"===n&&(c="translateY(50px)",g="translateY(0)"),"slide-down"===n&&(c="translateY(-50px)",g="translateY(0)"),"none"===n&&(c="translateY(0)",g="translateY(0)"),r="true"===r,d?(a.masonry("destroy"),a.append(e),t(a,e,o,n,r,s,!0,!0,!1)):i&&l?a.imagesLoaded(function(){e.fadeIn(s),a.masonry({itemSelector:o,transitionDuration:p,columnWidth:o,horizontalOrder:r,hiddenStyle:{transform:c,opacity:0},visibleStyle:{transform:g,opacity:1}})}):(a.append(e),a.imagesLoaded(function(){e.show(),a.masonry("appended",e)}))};!function(t){t.ajaxloadmore=function(a,e){"true"===alm_localize.scrolltop&&t(window).scrollTop(0);var o=this;if(o.AjaxLoadMore={},o.window=t(window),o.page=0,o.posts=0,o.totalposts=0,o.proceed=!1,o.disable_ajax=!1,o.init=!0,o.loading=!0,o.finished=!1,o.prefix="alm-",o.el=a,o.container=a,o.container.addClass("alm-"+e).attr("data-alm-id",e),o.content=t(".alm-ajax",o.container),o.content_preloaded=t(".alm-listing.alm-preloaded",o.container),o.canonical_url=o.el.attr("data-canonical-url"),o.is_search=o.el.attr("data-search"),o.slug=o.el.attr("data-slug"),o.post_id=o.el.attr("data-post-id"),o.repeater=o.content.attr("data-repeater"),o.theme_repeater=o.content.attr("data-theme-repeater"),o.post_type=o.content.attr("data-post-type"),o.post_type=o.post_type.split(","),o.sticky_posts=o.content.attr("data-sticky-posts"),o.btnWrap=t(".alm-btn-wrap",o.container),o.button_label=o.content.attr("data-button-label"),o.button_loading_label=o.content.attr("data-button-loading-label"),o.scroll_distance=o.content.attr("data-scroll-distance"),o.scroll_distance=o.scroll_distance?parseInt(o.scroll_distance):150,o.scroll_container=o.content.attr("data-scroll-container"),o.max_pages=o.content.attr("data-max-pages"),o.max_pages=o.max_pages?parseInt(o.max_pages):0,o.pause_override=o.content.attr("data-pause-override"),o.pause=o.content.attr("data-pause"),o.transition=o.content.attr("data-transition"),o.transition_container=o.content.attr("data-transition-container"),o.tcc=o.content.attr("data-transition-container-classes"),o.speed=o.content.attr("data-transition-speed"),o.images_loaded=o.content.attr("data-images-loaded"),o.destroy_after=o.content.attr("data-destroy-after"),o.lang=o.content.attr("data-lang"),o.orginal_posts_per_page=o.content.attr("data-posts-per-page"),o.posts_per_page=o.content.attr("data-posts-per-page"),o.offset=o.content.attr("data-offset"),o.cache=o.content.attr("data-cache"),o.cache_id=o.content.attr("data-cache-id"),o.cache_path=o.content.attr("data-cache-path"),o.cache_logged_in=o.content.attr("data-cache-logged-in"),o.cta=o.content.attr("data-cta"),o.cta_position=o.content.attr("data-cta-position"),o.cta_repeater=o.content.attr("data-cta-repeater"),o.cta_theme_repeater=o.content.attr("data-cta-theme-repeater"),o.acf=o.content.attr("data-acf"),o.acf_field_type=o.content.attr("data-acf-field-type"),o.acf_field_name=o.content.attr("data-acf-field-name"),o.acf_post_id=o.content.attr("data-acf-post-id"),o.nextpage=o.content.attr("data-nextpage"),o.nextpage_urls=o.content.attr("data-nextpage-urls"),o.nextpage_scroll=o.content.attr("data-nextpage-scroll"),o.nextpage_pageviews=o.content.attr("data-nextpage-pageviews"),o.nextpage_post_id=o.content.attr("data-nextpage-post-id"),o.nextpage_startpage=o.content.attr("data-nextpage-startpage"),o.previous_post=o.content.attr("data-previous-post"),o.previous_post_id=o.content.attr("data-previous-post-id"),o.previous_post_taxonomy=o.content.attr("data-previous-post-taxonomy"),o.previous_post_excluded_terms=o.content.attr("data-previous-post-excluded-terms"),o.comments=o.content.attr("data-comments"),"true"===o.comments&&(o.content=t(".alm-comments",o.container)),o.filters=o.content.attr("data-filters"),o.restapi=o.content.attr("data-restapi"),o.restapi_base_url=o.content.attr("data-restapi-base-url"),o.restapi_namespace=o.content.attr("data-restapi-namespace"),o.restapi_endpoint=o.content.attr("data-restapi-endpoint"),o.restapi_template_id=o.content.attr("data-restapi-template-id"),o.restapi_debug=o.content.attr("data-restapi-debug"),o.seo=o.content.attr("data-seo"),o.preloaded=o.content.attr("data-preloaded"),o.preloaded_amount=o.content.attr("data-preloaded-amount"),o.paging=o.content.attr("data-paging"),o.users="true"===o.content.attr("data-users"),o.users&&(o.orginal_posts_per_page=o.content.attr("data-users-per-page"),o.posts_per_page=o.content.attr("data-users-per-page")),"true"===o.filters){o.filters=!0,o.filters_analtyics=o.content.attr("data-filters-analtyics"),o.filters_debug=o.content.attr("data-filters-debug"),o.filters_startpage=0;var n=almGetParameterByName("pg");null!==n&&(o.filters_startpage=parseInt(n),o.page=o.filters_startpage),o.isPaged=!1,o.filters_startpage>0&&(o.isPaged=!0,o.page=o.filters_startpage-1)}else o.filters=!1;"true"===o.restapi?(o.restapi=!0,void 0===o.restapi_debug&&(o.restapi_debug=!1),""===o.restapi_template_id&&(o.restapi=!1)):o.restapi=!1,"true"===o.paging?(o.paging=!0,o.paging_controls=!!o.content.attr("data-paging-controls"),o.paging_show_at_most=o.content.attr("data-paging-show-at-most"),o.paging_classes=o.content.attr("data-paging-classes"),o.paging_init=!0,o.paging_show_at_most=void 0===o.paging_show_at_most?7:o.paging_show_at_most,"true"===o.preloaded&&(o.pause=!0)):o.paging=!1,void 0===o.cache&&(o.cache=!1),void 0===o.cache_logged_in&&(o.cache_logged_in=!1),void 0===o.comments_per_page&&(o.comments_per_page="5"),"true"===o.preloaded?(o.preload_wrap=o.content.prev(".alm-preloaded"),o.preloaded_total_posts=parseInt(o.preload_wrap.attr("data-total-posts")),void 0===o.preloaded_amount&&(o.preloaded_amount=!1),o.preloaded_total_posts<=o.preloaded_amount&&(o.disable_ajax=!0)):o.preloaded="false",void 0===o.seo&&(o.seo=!1),"true"===o.seo&&(o.seo=!0),void 0===o.is_search&&(o.is_search=!1),o.search_value="true"===o.is_search?o.slug:"",o.permalink=o.content.attr("data-seo-permalink"),o.pageview=o.content.attr("data-seo-pageview"),o.start_page=o.content.attr("data-seo-start-page"),o.trailing_slash="false"===o.content.attr("data-seo-trailing-slash")?"":"/",o.start_page?(o.seo_scroll=o.content.attr("data-seo-scroll"),o.seo_scroll_speed=o.content.attr("data-seo-scroll-speed"),o.seo_scrolltop=o.content.attr("data-seo-scrolltop"),o.seo_controls=o.content.attr("data-seo-controls"),o.isPaged=!1,o.start_page>1&&(o.isPaged=!0,o.posts_per_page=o.start_page*o.posts_per_page),o.paging&&(o.posts_per_page=o.orginal_posts_per_page)):o.start_page=1,"true"===o.nextpage?(o.nextpage=!0,o.posts_per_page=1):o.nextpage=!1,void 0===o.nextpage_urls&&(o.nextpage_urls="true"),void 0===o.nextpage_scroll&&(o.nextpage_scroll="250:30"),void 0===o.nextpage_pageviews&&(o.nextpage_pageviews="true"),void 0===o.nextpage_post_id&&(o.nextpage=!1,o.nextpage_post_id=null),void 0===o.nextpage_startpage&&(o.nextpage_startpage=1),o.nextpage_startpage>1&&(o.isPaged=!0),o.acf="true"===o.acf,void 0!==o.acf_field_type&&void 0!==o.acf_field_name&&void 0!==o.acf_post_id||(o.acf=!1),"true"===o.previous_post?(o.previous_post=!0,o.previous_post_permalink="",o.previous_post_title="",o.previous_post_slug=""):o.previous_post=!1,void 0===o.previous_post_id&&(o.previous_post_id=""),void 0===o.previous_post_taxonomy&&(o.previous_post_taxonomy=""),void 0===o.previous_post_excluded_terms&&(o.previous_post_excluded_terms=""),o.previous_post_title_template=o.content.attr("data-previous-post-title-template"),o.siteTitle=o.content.attr("data-previous-post-site-title"),o.siteTagline=o.content.attr("data-previous-post-site-tagline"),o.previous_post_pageview=o.content.attr("data-previous-post-pageview"),o.previous_post_scroll=o.content.attr("data-previous-post-scroll"),o.previous_post_scroll_speed=o.content.attr("data-previous-post-scroll-speed"),o.previous_post_scroll_top=o.content.attr("data-previous-post-scrolltop"),o.previous_post_controls=o.content.attr("data-previous-post-controls"),o.offset=void 0===o.offset?0:o.offset,(void 0===o.pause||o.seo&&o.start_page>1)&&(o.pause=!1),"true"===o.preloaded&&o.seo&&o.start_page>0&&(o.pause=!1),"true"===o.preloaded&&o.paging&&(o.pause=!0),void 0===o.repeater&&(o.repeater="default"),void 0===o.theme_repeater&&(o.theme_repeater="null"),o.max_pages=void 0===o.max_pages||0===o.max_pages?1e4:o.max_pages,o.scroll_distance=void 0===o.scroll_distance?150:o.scroll_distance,o.scroll_container=void 0===o.scroll_container?"":o.scroll_container,o.transition=void 0===o.transition?"fade":o.transition,o.tcc=void 0===o.tcc?"":o.tcc,o.is_masonry_preloaded=!1,"masonry"===o.transition&&(o.masonry_init=!0,o.masonry_selector=o.content.attr("data-masonry-selector"),o.masonry_animation=o.content.attr("data-masonry-animation"),o.masonry_horizontalorder=o.content.attr("data-masonry-horizontalorder"),void 0===o.masonry_animation&&(o.masonry_animation="standard"),void 0===o.masonry_horizontalorder&&(o.masonry_horizontalorder="true"),o.masonry_wrap=o.content,o.transition_container=!1,document.body.contains(o.content_preloaded.get(0))&&(o.masonry_wrap=o.content_preloaded,o.is_masonry_preloaded=!0)),o.speed=void 0===o.speed||""===o.speed?250:parseInt(o.speed),void 0===o.content.attr("data-scroll")?o.scroll=!0:"false"===o.content.attr("data-scroll")?o.scroll=!1:o.scroll=!0,o.transition_container=void 0===o.transition_container||"true"===o.transition_container,o.images_loaded=void 0===o.images_loaded?"false":o.images_loaded,o.button_label=void 0===o.button_label?"Older Posts":o.button_label,o.button_loading_label=void 0!==o.button_loading_label&&o.button_loading_label,o.paging?o.content.parent().addClass("loading"):o.button=t(".alm-load-more-btn",o.container),o.AjaxLoadMore.loadPosts=function(){if(!o.disable_ajax)if(o.paging||(o.button.addClass("loading"),!1!==o.button_loading_label&&o.button.html(o.button_loading_label)),o.container.addClass("alm-loading"),o.loading=!0,"true"!==o.cache||o.cache_logged_in)o.AjaxLoadMore.ajax("standard");else{var a;if(o.init&&o.seo&&o.isPaged){a=o.cache_path+o.cache_id+"/page-1-"+o.start_page+".html"}else if(o.nextpage){var e;o.paging?e=parseInt(o.page)+1:(e=parseInt(o.page)+2,o.isPaged&&(e=parseInt(o.page)+parseInt(o.nextpage_startpage)+1)),a=o.cache_path+o.cache_id+"/page-"+e+".html"}else a=o.previous_post?o.cache_path+o.cache_id+"/"+o.previous_post_id+".html":o.cache_path+o.cache_id+"/page-"+(o.page+1)+".html";t.get(a,function(t){o.AjaxLoadMore.success(t,!0)}).fail(function(){o.AjaxLoadMore.ajax("standard")})}},o.AjaxLoadMore.ajax=function(e){var n="alm_query_posts";if(o.acf_array="",o.acf&&("relationship"!==o.acf_field_type&&(n="alm_acf_query"),o.acf_array={acf:"true",post_id:o.acf_post_id,field_type:o.acf_field_type,field_name:o.acf_field_name}),o.nextpage_array="",o.nextpage&&(n="alm_nextpage_query",o.nextpage_array={nextpage:"true",urls:o.nextpage_urls,scroll:o.nextpage_scroll,pageviews:o.nextpage_pageviews,post_id:o.nextpage_post_id,startpage:o.nextpage_startpage}),o.previous_post_array="",o.previous_post&&(o.previous_post_array={previous_post:"true",id:o.previous_post_id,slug:o.previous_post_slug}),o.comments_array="","true"===o.comments&&(n="alm_comments_query",o.posts_per_page=o.comments_per_page,o.comments_array={comments:"true",post_id:o.comments_post_id,per_page:o.comments_per_page,type:o.comments_type,style:o.comments_style,template:o.comments_template,callback:o.comments_callback}),o.users_array="",o.users&&(n="alm_users_query",o.users_array={users:"true",role:o.content.attr("data-users-role"),include:o.content.attr("data-users-include"),exclude:o.content.attr("data-users-exclude"),per_page:o.posts_per_page,order:o.content.attr("data-users-order"),orderby:o.content.attr("data-users-orderby")}),o.cta_array="","true"===o.cta&&(o.cta_array={cta:"true",cta_position:o.cta_position,cta_repeater:o.cta_repeater,cta_theme_repeater:o.cta_theme_repeater}),o.restapi){var r=wp.template(o.restapi_template_id),s=o.restapi_base_url+"/"+o.restapi_namespace+"/"+o.restapi_endpoint,i={id:a.attr("data-id"),post_id:o.post_id,posts_per_page:o.posts_per_page,page:o.page,offset:o.offset,slug:o.slug,canonical_url:o.canonical_url,post_type:o.post_type,post_format:o.content.attr("data-post-format"),category:o.content.attr("data-category"),category__not_in:o.content.attr("data-category-not-in"),tag:o.content.attr("data-tag"),tag__not_in:o.content.attr("data-tag-not-in"),taxonomy:o.content.attr("data-taxonomy"),taxonomy_terms:o.content.attr("data-taxonomy-terms"),taxonomy_operator:o.content.attr("data-taxonomy-operator"),taxonomy_relation:o.content.attr("data-taxonomy-relation"),meta_key:o.content.attr("data-meta-key"),meta_value:o.content.attr("data-meta-value"),meta_compare:o.content.attr("data-meta-compare"),meta_relation:o.content.attr("data-meta-relation"),meta_type:o.content.attr("data-meta-type"),author:o.content.attr("data-author"),year:o.content.attr("data-year"),month:o.content.attr("data-month"),day:o.content.attr("data-day"),post_status:o.content.attr("data-post-status"),order:o.content.attr("data-order"),orderby:o.content.attr("data-orderby"),post__in:o.content.attr("data-post-in"),post__not_in:o.content.attr("data-post-not-in"),search:o.content.attr("data-search"),custom_args:o.content.attr("data-custom-args"),lang:o.lang,preloaded:o.preloaded,preloaded_amount:o.preloaded_amount,seo_start_page:o.start_page};t.ajax({type:"GET",url:s,data:i,dataType:"JSON",beforeSend:function(){1==o.page||o.paging||o.button.addClass("loading")},success:function(a){var e="",n=a.html,s=a.meta,i=s.postcount,l=s.totalposts;t.each(n,function(t){var a=n[t];"true"===o.restapi_debug&&console.log(a),e+=r(a)});var d={html:e,meta:{postcount:i,totalposts:l}};o.AjaxLoadMore.success(d,!1)}})}else t.ajax({type:"GET",url:alm_localize.ajaxurl,dataType:"JSON",data:{action:n,nonce:alm_localize.alm_nonce,query_type:e,post_id:o.post_id,id:a.attr("data-id"),slug:o.slug,canonical_url:o.canonical_url,cache_id:o.cache_id,cache_logged_in:o.cache_logged_in,repeater:o.repeater,theme_repeater:o.theme_repeater,acf:o.acf_array,nextpage:o.nextpage_array,cta:o.cta_array,comments:o.comments_array,users:o.users_array,post_type:o.post_type,sticky_posts:o.sticky_posts,post_format:o.content.attr("data-post-format"),category:o.content.attr("data-category"),category__not_in:o.content.attr("data-category-not-in"),tag:o.content.attr("data-tag"),tag__not_in:o.content.attr("data-tag-not-in"),taxonomy:o.content.attr("data-taxonomy"),taxonomy_terms:o.content.attr("data-taxonomy-terms"),taxonomy_operator:o.content.attr("data-taxonomy-operator"),taxonomy_relation:o.content.attr("data-taxonomy-relation"),meta_key:o.content.attr("data-meta-key"),meta_value:o.content.attr("data-meta-value"),meta_compare:o.content.attr("data-meta-compare"),meta_relation:o.content.attr("data-meta-relation"),meta_type:o.content.attr("data-meta-type"),author:o.content.attr("data-author"),year:o.content.attr("data-year"),month:o.content.attr("data-month"),day:o.content.attr("data-day"),post_status:o.content.attr("data-post-status"),order:o.content.attr("data-order"),orderby:o.content.attr("data-orderby"),post__in:o.content.attr("data-post-in"),post__not_in:o.content.attr("data-post-not-in"),exclude:o.content.attr("data-exclude"),search:o.content.attr("data-search"),custom_args:o.content.attr("data-custom-args"),posts_per_page:o.posts_per_page,page:o.page,offset:o.offset,preloaded:o.preloaded,preloaded_amount:o.preloaded_amount,seo_start_page:o.start_page,paging:o.paging,previous_post:o.previous_post_array,lang:o.lang},beforeSend:function(){1==o.page||o.paging||o.button.addClass("loading")},success:function(a){"standard"===e?o.AjaxLoadMore.success(a,!1):"totalpages"===e&&o.paging&&o.nextpage?t.isFunction(t.fn.almBuildPagination)&&t.fn.almBuildPagination(a,o):"totalposts"===e&&o.paging&&t.isFunction(t.fn.almBuildPagination)&&t.fn.almBuildPagination(a,o)},error:function(t,a,e){o.AjaxLoadMore.error(t,a,e)}})},o.paging&&(o.nextpage?o.AjaxLoadMore.ajax("totalpages"):o.AjaxLoadMore.ajax("totalposts")),o.AjaxLoadMore.success=function(a,e){o.previous_post&&o.AjaxLoadMore.getPreviousPost();var n,r,s;if(e?n=a:(n=a.html,r=a.meta,o.posts=o.posts+r.postcount,s=r.postcount,o.totalposts=r.totalposts,"true"===o.preloaded&&(o.totalposts=o.totalposts-o.preloaded_amount)),o.data=t(n),e&&(s=o.data.length),o.init&&(o.paging?s>0&&(o.el=t('<div class="alm-reveal'+o.tcc+'"/>'),o.el.append('<div class="alm-paging-content"></div><div class="alm-paging-loading"></div>'),t(".alm-paging-content",o.el).append(o.data).hide(),o.content.append(o.el),o.content.parent().removeClass("loading"),o.AjaxLoadMore.resetBtnText(),t(".alm-paging-content",o.el).fadeIn(o.speed,"alm_easeInOutQuad",function(){var a=parseInt(o.content.css("padding-top")),e=parseInt(o.content.css("padding-bottom"));o.content.css("height",o.el.height()+a+e+"px"),t.isFunction(t.fn.almFadePageControls)&&t.fn.almFadePageControls(o.btnWrap)})):o.button.html(o.button_label),0===s&&(o.paging&&t.isFunction(t.fn.almPagingEmpty)&&t.fn.almPagingEmpty(o),t.isFunction(t.fn.almEmpty)&&t.fn.almEmpty(o)),o.isPaged&&(o.posts_per_page=o.users?o.content.attr("data-users-per-page"):o.content.attr("data-posts-per-page"),o.start_page&&(o.page=o.start_page-1),o.filters&&o.filters_startpage&&(o.page=o.filters_startpage-1,o.posts_per_page=o.content.attr("data-posts-per-page")))),s>0){if(o.paging)o.init?(o.container.removeClass("alm-loading"),o.AjaxLoadMore.triggerAddons(o)):t(".alm-paging-content",o.el).html("").append(o.data).almWaitForImages().done(function(){t(".alm-paging-loading",o.el).fadeOut(o.speed),t.isFunction(t.fn.almOnPagingComplete)&&t.fn.almOnPagingComplete(o),o.container.removeClass("alm-loading"),o.AjaxLoadMore.triggerAddons(o)});else{if(o.previous_post)o.el=t('<div class="alm-reveal alm-previous-post post-'+o.previous_post_id+'" data-id="'+o.previous_post_id+'" data-title="'+o.previous_post_title+'" data-url="'+o.previous_post_permalink+'" data-page="'+o.page+'"/>'),o.el.append(o.data).hide();else if(o.transition_container){var i=void 0,l=window.location.search;if(o.init&&o.start_page>1){var d=[],p=parseInt(o.posts_per_page);"true"===o.cta&&(p+=1);Math.ceil(s/p);for(var c=0;c<s;c+=p)d.push(o.data.slice(c,p+c));o.el=o.content;for(var g=0;g<d.length;g++){var _="true"===o.preloaded?1:0,u=void 0;g>0||"true"===o.preloaded?(i=g+1+_,u=t("default"===o.permalink?'<div class="alm-reveal alm-seo'+o.tcc+'" data-url="'+o.canonical_url+o.search_value+"&paged="+i+'" data-page="'+i+'" />':'<div class="alm-reveal alm-seo'+o.tcc+'" data-url="'+o.canonical_url+"page/"+i+o.trailing_slash+o.search_value+'" data-page="'+i+'" />')):u=t('<div class="alm-reveal alm-seo'+o.tcc+'" data-url="'+o.canonical_url+o.search_value+'" data-page="1" />'),u.append(d[g]),u=t(u),o.el.append(u).hide()}}else{if(o.seo&&o.page>0||"true"===o.preloaded){var m="true"===o.preloaded?1:0;i=o.page+1+m,o.seo?"default"===o.permalink?o.el=t('<div class="alm-reveal alm-seo'+o.tcc+'" data-url="'+o.canonical_url+o.search_value+"&paged="+i+'" data-page="'+i+'" />'):o.el=t('<div class="alm-reveal alm-seo'+o.tcc+'" data-url="'+o.canonical_url+"page/"+i+o.trailing_slash+o.search_value+'" data-page="'+i+'" />'):o.filters?o.el=t('<div class="alm-reveal alm-filters'+o.tcc+'" data-url="'+o.canonical_url+l+'" data-page="'+i+'" />'):o.el=t('<div class="alm-reveal'+o.tcc+'" />')}else o.filters?o.el=t('<div class="alm-reveal alm-filters'+o.tcc+'" data-url="'+o.canonical_url+l+'" data-page="'+(o.page+1)+'" />'):o.seo?o.el=t('<div class="alm-reveal alm-seo'+o.tcc+'" data-url="'+o.canonical_url+o.search_value+'" data-page="1" />'):o.el=t('<div class="alm-reveal'+o.tcc+'" />');o.el.append(o.data).hide()}}else o.data.hide(),o.el=o.data;("masonry"!==o.transition||o.init&&!o.is_masonry_preloaded)&&o.content.append(o.el),"fade"===o.transition?"true"===o.images_loaded?o.el.almWaitForImages().done(function(){o.el.fadeIn(o.speed,"alm_easeInOutQuad",function(){o.loading=!1,o.paging||(o.button.delay(o.speed).removeClass("loading"),o.AjaxLoadMore.resetBtnText()),o.container.removeClass("alm-loading"),o.AjaxLoadMore.triggerAddons(o)})}):o.el.fadeIn(o.speed,"alm_easeInOutQuad",function(){o.loading=!1,o.paging||(o.button.delay(o.speed).removeClass("loading"),o.AjaxLoadMore.resetBtnText()),o.container.removeClass("alm-loading"),o.AjaxLoadMore.triggerAddons(o)}):"masonry"===o.transition?(almMasonry(o.masonry_wrap,o.el,o.masonry_selector,o.masonry_animation,o.masonry_horizontalorder,o.speed,o.masonry_init,o.init,alm_is_filtering),o.masonry_init=!1,o.paging||(o.button.delay(o.speed).removeClass("loading"),o.AjaxLoadMore.resetBtnText()),o.loading=!1,o.container.removeClass("alm-loading"),o.AjaxLoadMore.triggerAddons(o)):"none"===o.transition?("true"===o.images_loaded?o.el.almWaitForImages().done(function(){o.el.show(),o.AjaxLoadMore.triggerAddons(o)}):(o.el.show(),o.AjaxLoadMore.triggerAddons(o)),o.loading=!1,o.paging||(o.button.delay(o.speed).removeClass("loading"),o.AjaxLoadMore.resetBtnText())):"true"===o.images_loaded?o.el.almWaitForImages().done(function(){o.el.slideDown(o.speed,"alm_easeInOutQuad",function(){o.loading=!1,o.paging||(o.button.delay(o.speed).removeClass("loading"),o.AjaxLoadMore.resetBtnText()),o.container.removeClass("alm-loading"),o.AjaxLoadMore.triggerAddons(