Instagram Feed - Version 2.8.2

Version Description

  • Fix: Changed how access tokens are retrieved to prevent conflict with the "Rank Math SEO" plugin when connecting an account.
  • Fix: Updated jQuery methods for compatibility with WordPress 5.7.
Download this release

Release Info

Developer smashballoon
Plugin Icon 128x128 Instagram Feed
Version 2.8.2
Comparing to
See all releases

Code changes from version 2.8.1 to 2.8.2

README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: smashballoon, craig-at-smash-balloon
3
  Tags: Instagram, Instagram feed, Instagram photos, Instagram widget, Instagram gallery
4
  Requires at least: 3.4
5
  Tested up to: 5.6
6
- Stable tag: 2.8.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -332,6 +332,10 @@ We understand that sometimes you need help, have issues or just have questions.
332
  * Plus more customization options added all the time!
333
 
334
  == Changelog ==
 
 
 
 
335
  = 2.8.1 =
336
  * Fix: Fixed a PHP warning which would display in some situations: "array_diff(): Expected parameter 1 to be an array, string given".
337
  * Fix: Fixed PHP warning "Undefined index: accesstoken" which would display when no primary account was selected.
3
  Tags: Instagram, Instagram feed, Instagram photos, Instagram widget, Instagram gallery
4
  Requires at least: 3.4
5
  Tested up to: 5.6
6
+ Stable tag: 2.8.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
332
  * Plus more customization options added all the time!
333
 
334
  == Changelog ==
335
+ = 2.8.2 =
336
+ * Fix: Changed how access tokens are retrieved to prevent conflict with the "Rank Math SEO" plugin when connecting an account.
337
+ * Fix: Updated jQuery methods for compatibility with WordPress 5.7.
338
+
339
  = 2.8.1 =
340
  * Fix: Fixed a PHP warning which would display in some situations: "array_diff(): Expected parameter 1 to be an array, string given".
341
  * Fix: Fixed PHP warning "Undefined index: accesstoken" which would display when no primary account was selected.
css/sb-instagram-admin.css CHANGED
@@ -429,6 +429,7 @@
429
  .sbi_notice{
430
  position: relative;
431
  overflow: hidden;
 
432
  max-width: 865px;
433
  margin-top: 10px;
434
  padding: 10px 10px 7px 10px;
429
  .sbi_notice{
430
  position: relative;
431
  overflow: hidden;
432
+ clear: both;
433
  max-width: 865px;
434
  margin-top: 10px;
435
  padding: 10px 10px 7px 10px;
inc/admin/actions.php CHANGED
@@ -580,7 +580,7 @@ function sbi_after_connection() {
580
  add_action( 'wp_ajax_sbi_after_connection', 'sbi_after_connection' );
581
 
582
  function sbi_get_business_account_connection_modal($sb_instagram_user_id) {
583
- $access_token = sbi_maybe_clean(urldecode($_GET['access_token']));
584
  //
585
  $url = 'https://graph.facebook.com/me/accounts?fields=instagram_business_account,access_token&limit=500&access_token='.$access_token;
586
  $args = array(
@@ -683,7 +683,7 @@ function sbi_get_business_account_connection_modal($sb_instagram_user_id) {
683
  </div> <!-- end scrollable -->
684
  <p style="font-size: 11px; line-height: 1.5; margin-bottom: 0;"><i style="color: #666;">*<?php echo sprintf( __( 'Changing the password, updating privacy settings, or removing page admins for the related Facebook page may require %smanually reauthorizing our app%s to reconnect an account.', 'instagram-feed' ), '<a href="https://smashballoon.com/reauthorizing-our-instagram-facebook-app/" target="_blank" rel="noopener noreferrer">', '</a>' ); ?></i></p>
685
 
686
- <a href="JavaScript:void(0);" id="sbi-connect-business-accounts" class="button button-primary" disabled="disabled" style="margin-top: 20px;">Connect Accounts</a>
687
 
688
  <?php endif; ?>
689
 
@@ -694,11 +694,11 @@ function sbi_get_business_account_connection_modal($sb_instagram_user_id) {
694
  }
695
 
696
  function sbi_get_personal_connection_modal( $connected_accounts, $action_url = 'admin.php?page=sb-instagram-feed' ) {
697
- $access_token = sanitize_text_field( $_GET['access_token'] );
698
- $account_type = sanitize_text_field( $_GET['account_type'] );
699
- $user_id = sanitize_text_field( $_GET['id'] );
700
- $user_name = sanitize_text_field( $_GET['username'] );
701
- $expires_in = (int)$_GET['expires_in'];
702
  $expires_timestamp = time() + $expires_in;
703
 
704
  $new_account_details = array(
580
  add_action( 'wp_ajax_sbi_after_connection', 'sbi_after_connection' );
581
 
582
  function sbi_get_business_account_connection_modal($sb_instagram_user_id) {
583
+ $access_token = sbi_maybe_clean(urldecode($_GET['sbi_access_token']));
584
  //
585
  $url = 'https://graph.facebook.com/me/accounts?fields=instagram_business_account,access_token&limit=500&access_token='.$access_token;
586
  $args = array(
683
  </div> <!-- end scrollable -->
684
  <p style="font-size: 11px; line-height: 1.5; margin-bottom: 0;"><i style="color: #666;">*<?php echo sprintf( __( 'Changing the password, updating privacy settings, or removing page admins for the related Facebook page may require %smanually reauthorizing our app%s to reconnect an account.', 'instagram-feed' ), '<a href="https://smashballoon.com/reauthorizing-our-instagram-facebook-app/" target="_blank" rel="noopener noreferrer">', '</a>' ); ?></i></p>
685
 
686
+ <button id="sbi-connect-business-accounts" class="button button-primary" disabled="disabled" style="margin-top: 20px;"><?php _e( 'Connect Accounts', 'instagram-feed' ); ?></button>
687
 
688
  <?php endif; ?>
689
 
694
  }
695
 
696
  function sbi_get_personal_connection_modal( $connected_accounts, $action_url = 'admin.php?page=sb-instagram-feed' ) {
697
+ $access_token = sanitize_text_field( $_GET['sbi_access_token'] );
698
+ $account_type = sanitize_text_field( $_GET['sbi_account_type'] );
699
+ $user_id = sanitize_text_field( $_GET['sbi_id'] );
700
+ $user_name = sanitize_text_field( $_GET['sbi_username'] );
701
+ $expires_in = (int)$_GET['sbi_expires_in'];
702
  $expires_timestamp = time() + $expires_in;
703
 
704
  $new_account_details = array(
inc/admin/class-sbi-account-connector.php CHANGED
@@ -44,9 +44,9 @@ class SBI_Account_Connector {
44
  return;
45
  }
46
  $connected_accounts = SBI_Account_Connector::stored_connected_accounts();
47
- if( isset( $_GET['access_token'] ) && isset( $_GET['graph_api'] ) ) {
48
  sbi_get_business_account_connection_modal( $sb_instagram_user_id );
49
- } elseif ( isset( $_GET['access_token'] ) && isset( $_GET['account_type'] ) ) {
50
  sbi_get_personal_connection_modal( $connected_accounts );
51
  }
52
  }
44
  return;
45
  }
46
  $connected_accounts = SBI_Account_Connector::stored_connected_accounts();
47
+ if( isset( $_GET['sbi_access_token'] ) && isset( $_GET['sbi_graph_api'] ) ) {
48
  sbi_get_business_account_connection_modal( $sb_instagram_user_id );
49
+ } elseif ( isset( $_GET['sbi_access_token'] ) && isset( $_GET['sbi_account_type'] ) ) {
50
  sbi_get_personal_connection_modal( $connected_accounts );
51
  }
52
  }
inc/admin/main.php CHANGED
@@ -147,7 +147,7 @@ function sbi_oembeds_page() {
147
  $valid_new_access_token = false;
148
  $error_message = '';
149
  $show_token_expiration_modal = false;
150
- if ( ! empty( $_GET['access_token'] ) && strlen( $_GET['access_token'] ) <= 20 ) {
151
  $access_token_error = true;
152
  $error_message = __("There was a problem with the access token that was retrieved.", 'instagram-feed' );
153
 
@@ -157,8 +157,8 @@ function sbi_oembeds_page() {
157
  $valid_new_access_token = $cff_oembed_token;
158
  }
159
  } else {
160
- $valid_new_access_token = ! empty( $_GET['access_token'] ) && strlen( $_GET['access_token'] ) > 20 && $saved_access_token_data !== $_GET['access_token'] ? sanitize_text_field( $_GET['access_token'] ) : false;
161
- if ( $valid_new_access_token && ! empty( $_GET['access_token'] ) ) {
162
  $url = esc_url_raw( 'https://graph.facebook.com/me/accounts?limit=500&access_token=' . $valid_new_access_token );
163
  $pages_data_connection = wp_remote_get( $url );
164
 
@@ -183,7 +183,7 @@ function sbi_oembeds_page() {
183
  <p class="sbi-error"><?php echo $error_message; ?></p>
184
  <?php }
185
  $need_to_connect_class = ' sbi-need-to-connect';
186
- $token_href = 'https://www.facebook.com/dialog/oauth?client_id=254638078422287&redirect_uri=https://api.smashballoon.com/instagram-graph-api-redirect.php&scope=pages_show_list&state=' . $admin_url_state;
187
  if ( class_exists( 'CFF_Oembed' ) ) {
188
  $cff_oembed_token = CFF_Oembed::last_access_token();
189
 
@@ -237,7 +237,7 @@ function sbi_oembeds_page() {
237
  </p>
238
  <p>
239
  <a style="display: inline-block; float: none; margin-bottom: 0;" href="https://smashballoon.com/doc/how-to-prevent-your-oembed-access-token-from-expiring/?instagram" class="sbi-oembed-connect-btn" target="_blank" rel="noopener"><?php _e( 'How to Create a Facebook Page', 'instagram-feed' ); ?></a>
240
- &nbsp;&nbsp;<a href="https://www.facebook.com/dialog/oauth?client_id=254638078422287&redirect_uri=https://api.smashballoon.com/instagram-graph-api-redirect.php&scope=pages_show_list&state=<?php echo $admin_url_state; ?>" class="button button-secondary" style="height: 47px;line-height: 47px;font-size: 14px;padding: 0 21px;"><?php _e( 'Try Again', 'instagram-feed' ); ?></a>
241
  </p>
242
 
243
  <a href="JavaScript:void(0);"><i class="sbi_modal_close fa fa-times"></i></a>
@@ -271,7 +271,7 @@ function sbi_oembeds_page() {
271
  <?php echo sprintf( __( 'Instagram requires that users have a role on a Facebook page in order to create access tokens that don\'t expire. Visit %1sthis link%2s for instructions on extending your access token to never expire.', 'instagram-feed' ), $link_1, $link_2 ); ?>
272
  </p>
273
  <p>
274
- <a style="display: inline-block; float: none; margin-bottom: 0;" href="https://www.facebook.com/dialog/oauth?client_id=254638078422287&redirect_uri=https://api.smashballoon.com/instagram-graph-api-redirect.php&scope=pages_show_list&state=<?php echo $admin_url_state; ?>" class="sbi-oembed-connect-btn"><?php _e( 'Connect to Facebook and Recheck Access Token', 'instagram-feed' ); ?></a>
275
  </p>
276
  </div>
277
 
@@ -875,9 +875,9 @@ function sb_instagram_settings_page() {
875
  <h3><?php _e( 'Configure', 'instagram-feed' ); ?></h3>
876
 
877
  <div id="sbi_config">
878
- <a data-personal-basic-api="https://api.instagram.com/oauth/authorize?app_id=423965861585747&redirect_uri=https://api.smashballoon.com/instagram-basic-display-redirect.php&response_type=code&scope=user_profile,user_media&state=<?php echo admin_url('admin.php?page=sb-instagram-feed'); ?>"
879
- data-new-api="https://www.facebook.com/dialog/oauth?client_id=254638078422287&redirect_uri=https://api.smashballoon.com/instagram-graph-api-redirect.php&scope=manage_pages,instagram_basic,instagram_manage_insights,instagram_manage_comments&state=<?php echo admin_url('admin.php?page=sb-instagram-feed'); ?>"
880
- href="https://api.instagram.com/oauth/authorize?app_id=423965861585747&redirect_uri=https://api.smashballoon.com/instagram-basic-display-redirect.php&response_type=code&scope=user_profile,user_media&state=<?php echo admin_url('admin.php?page=sb-instagram-feed'); ?>" class="sbi_admin_btn"><i class="fa fa-user-plus" aria-hidden="true" style="font-size: 20px;"></i>&nbsp; <?php _e('Connect an Instagram Account', 'instagram-feed' ); ?></a>
881
  <a href="https://smashballoon.com/instagram-feed/token/" target="_blank" style="position: relative; top: 14px; left: 15px;"><?php _e('Button not working?', 'instagram-feed'); ?></a>
882
  </div>
883
 
@@ -969,7 +969,7 @@ function sb_instagram_settings_page() {
969
  <span><?php echo esc_html( $message ); ?></span>
970
  <a class="sbi_tooltip_link sbi_tooltip_outside" href="JavaScript:void(0);" style="position: relative; top: 2px;"><i class="fa fa-question-circle" aria-hidden="true"></i></a>
971
 
972
- <a href="https://api.instagram.com/oauth/authorize?app_id=423965861585747&redirect_uri=https://api.smashballoon.com/instagram-basic-display-redirect.php&response_type=code&scope=user_profile,user_media&state=<?php echo admin_url( 'admin.php?page=sb-instagram-feed' ); ?>" class="button button-secondary"><?php _e( 'Refresh now', 'instagram-feed' ); ?></a>
973
  </div>
974
  <p class="sbi_tooltip sbi-more-info" style="display: none; width: 100%; box-sizing: border-box;"><?php echo sprintf( __( 'This account is a "private" account on Instagram. It needs to be manually reconnected every 60 days. %sChange this account to be "public"%s to have access tokens that are automatically refreshed.', 'instagram-feed' ), '<a href="https://help.instagram.com/116024195217477/In" target="_blank">', '</a>' ); ?></p>
975
  <?php endif; ?>
@@ -1005,7 +1005,7 @@ function sb_instagram_settings_page() {
1005
  <?php endif; ?>
1006
  <a href="JavaScript:void(0);" class="sbi_manually_connect button-secondary"><?php _e( 'Manually Connect an Account', 'instagram-feed' ); ?></a>
1007
  <div class="sbi_manually_connect_wrap">
1008
- <input name="sb_manual_at" id="sb_manual_at" type="text" value="" style="margin-top: 4px; padding: 5px 9px; margin-left: 0px;" size="64" minlength="15" maxlength="200" placeholder="<?php esc_attr_e( 'Enter a valid Instagram Access Token', 'instagram-feed' ); ?>" /><span class='sbi_business_profile_tag'><?php _e('Business or Basic Display', 'instagram-feed');?></span>
1009
  <div class="sbi_manual_account_id_toggle">
1010
  <label><?php _e('Please enter the User ID for this Profile:', 'instagram-feed');?></label>
1011
  <input name="sb_manual_account_id" id="sb_manual_account_id" type="text" value="" style="margin-top: 4px; padding: 5px 9px; margin-left: 0px;" size="40" minlength="5" maxlength="100" placeholder="Eg: 15641403491391489" />
147
  $valid_new_access_token = false;
148
  $error_message = '';
149
  $show_token_expiration_modal = false;
150
+ if ( ! empty( $_GET['sbi_access_token'] ) && strlen( $_GET['sbi_access_token'] ) <= 20 ) {
151
  $access_token_error = true;
152
  $error_message = __("There was a problem with the access token that was retrieved.", 'instagram-feed' );
153
 
157
  $valid_new_access_token = $cff_oembed_token;
158
  }
159
  } else {
160
+ $valid_new_access_token = ! empty( $_GET['sbi_access_token'] ) && strlen( $_GET['sbi_access_token'] ) > 20 && $saved_access_token_data !== $_GET['sbi_access_token'] ? sanitize_text_field( $_GET['sbi_access_token'] ) : false;
161
+ if ( $valid_new_access_token && ! empty( $_GET['sbi_access_token'] ) ) {
162
  $url = esc_url_raw( 'https://graph.facebook.com/me/accounts?limit=500&access_token=' . $valid_new_access_token );
163
  $pages_data_connection = wp_remote_get( $url );
164
 
183
  <p class="sbi-error"><?php echo $error_message; ?></p>
184
  <?php }
185
  $need_to_connect_class = ' sbi-need-to-connect';
186
+ $token_href = 'https://www.facebook.com/dialog/oauth?client_id=254638078422287&redirect_uri=https://api.smashballoon.com/v2/instagram-graph-api-redirect.php&scope=pages_show_list&state=' . $admin_url_state;
187
  if ( class_exists( 'CFF_Oembed' ) ) {
188
  $cff_oembed_token = CFF_Oembed::last_access_token();
189
 
237
  </p>
238
  <p>
239
  <a style="display: inline-block; float: none; margin-bottom: 0;" href="https://smashballoon.com/doc/how-to-prevent-your-oembed-access-token-from-expiring/?instagram" class="sbi-oembed-connect-btn" target="_blank" rel="noopener"><?php _e( 'How to Create a Facebook Page', 'instagram-feed' ); ?></a>
240
+ &nbsp;&nbsp;<a href="https://www.facebook.com/dialog/oauth?client_id=254638078422287&redirect_uri=https://api.smashballoon.com/v2/instagram-graph-api-redirect.php&scope=pages_show_list&state=<?php echo $admin_url_state; ?>" class="button button-secondary" style="height: 47px;line-height: 47px;font-size: 14px;padding: 0 21px;"><?php _e( 'Try Again', 'instagram-feed' ); ?></a>
241
  </p>
242
 
243
  <a href="JavaScript:void(0);"><i class="sbi_modal_close fa fa-times"></i></a>
271
  <?php echo sprintf( __( 'Instagram requires that users have a role on a Facebook page in order to create access tokens that don\'t expire. Visit %1sthis link%2s for instructions on extending your access token to never expire.', 'instagram-feed' ), $link_1, $link_2 ); ?>
272
  </p>
273
  <p>
274
+ <a style="display: inline-block; float: none; margin-bottom: 0;" href="https://www.facebook.com/dialog/oauth?client_id=254638078422287&redirect_uri=https://api.smashballoon.com/v2/instagram-graph-api-redirect.php&scope=pages_show_list&state=<?php echo $admin_url_state; ?>" class="sbi-oembed-connect-btn"><?php _e( 'Connect to Facebook and Recheck Access Token', 'instagram-feed' ); ?></a>
275
  </p>
276
  </div>
277
 
875
  <h3><?php _e( 'Configure', 'instagram-feed' ); ?></h3>
876
 
877
  <div id="sbi_config">
878
+ <a data-personal-basic-api="https://api.instagram.com/oauth/authorize?app_id=423965861585747&redirect_uri=https://api.smashballoon.com/v2/instagram-basic-display-redirect.php&response_type=code&scope=user_profile,user_media&state=<?php echo admin_url('admin.php?page=sb-instagram-feed'); ?>"
879
+ data-new-api="https://www.facebook.com/dialog/oauth?client_id=254638078422287&redirect_uri=https://api.smashballoon.com/v2/instagram-graph-api-redirect.php&scope=manage_pages,instagram_basic,instagram_manage_insights,instagram_manage_comments&state=<?php echo admin_url('admin.php?page=sb-instagram-feed'); ?>"
880
+ href="https://api.instagram.com/oauth/authorize?app_id=423965861585747&redirect_uri=https://api.smashballoon.com/v2/instagram-basic-display-redirect.php&response_type=code&scope=user_profile,user_media&state=<?php echo admin_url('admin.php?page=sb-instagram-feed'); ?>" class="sbi_admin_btn"><i class="fa fa-user-plus" aria-hidden="true" style="font-size: 20px;"></i>&nbsp; <?php _e('Connect an Instagram Account', 'instagram-feed' ); ?></a>
881
  <a href="https://smashballoon.com/instagram-feed/token/" target="_blank" style="position: relative; top: 14px; left: 15px;"><?php _e('Button not working?', 'instagram-feed'); ?></a>
882
  </div>
883
 
969
  <span><?php echo esc_html( $message ); ?></span>
970
  <a class="sbi_tooltip_link sbi_tooltip_outside" href="JavaScript:void(0);" style="position: relative; top: 2px;"><i class="fa fa-question-circle" aria-hidden="true"></i></a>
971
 
972
+ <a href="https://api.instagram.com/oauth/authorize?app_id=423965861585747&redirect_uri=https://api.smashballoon.com/v2/instagram-basic-display-redirect.php&response_type=code&scope=user_profile,user_media&state=<?php echo admin_url( 'admin.php?page=sb-instagram-feed' ); ?>" class="button button-secondary"><?php _e( 'Refresh now', 'instagram-feed' ); ?></a>
973
  </div>
974
  <p class="sbi_tooltip sbi-more-info" style="display: none; width: 100%; box-sizing: border-box;"><?php echo sprintf( __( 'This account is a "private" account on Instagram. It needs to be manually reconnected every 60 days. %sChange this account to be "public"%s to have access tokens that are automatically refreshed.', 'instagram-feed' ), '<a href="https://help.instagram.com/116024195217477/In" target="_blank">', '</a>' ); ?></p>
975
  <?php endif; ?>
1005
  <?php endif; ?>
1006
  <a href="JavaScript:void(0);" class="sbi_manually_connect button-secondary"><?php _e( 'Manually Connect an Account', 'instagram-feed' ); ?></a>
1007
  <div class="sbi_manually_connect_wrap">
1008
+ <input name="sb_manual_at" id="sb_manual_at" type="text" value="" style="margin-top: 4px; padding: 5px 9px; margin-left: 0px;" size="64" minlength="15" maxlength="400" placeholder="<?php esc_attr_e( 'Enter a valid Instagram Access Token', 'instagram-feed' ); ?>" /><span class='sbi_business_profile_tag'><?php _e('Business or Basic Display', 'instagram-feed');?></span>
1009
  <div class="sbi_manual_account_id_toggle">
1010
  <label><?php _e('Please enter the User ID for this Profile:', 'instagram-feed');?></label>
1011
  <input name="sb_manual_account_id" id="sb_manual_account_id" type="text" value="" style="margin-top: 4px; padding: 5px 9px; margin-left: 0px;" size="40" minlength="5" maxlength="100" placeholder="Eg: 15641403491391489" />
instagram-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Smash Balloon Instagram Feed
4
  Plugin URI: https://smashballoon.com/instagram-feed
5
  Description: Display beautifully clean, customizable, and responsive Instagram feeds.
6
- Version: 2.8.1
7
  Author: Smash Balloon
8
  Author URI: https://smashballoon.com/
9
  License: GPLv2 or later
@@ -23,7 +23,7 @@ along with this program; if not, write to the Free Software
23
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
  */
25
  if ( ! defined( 'SBIVER' ) ) {
26
- define( 'SBIVER', '2.8.1' );
27
  }
28
  // Db version.
29
  if ( ! defined( 'SBI_DBVERSION' ) ) {
3
  Plugin Name: Smash Balloon Instagram Feed
4
  Plugin URI: https://smashballoon.com/instagram-feed
5
  Description: Display beautifully clean, customizable, and responsive Instagram feeds.
6
+ Version: 2.8.2
7
  Author: Smash Balloon
8
  Author URI: https://smashballoon.com/
9
  License: GPLv2 or later
23
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
  */
25
  if ( ! defined( 'SBIVER' ) ) {
26
+ define( 'SBIVER', '2.8.2' );
27
  }
28
  // Db version.
29
  if ( ! defined( 'SBI_DBVERSION' ) ) {
js/sb-instagram-2-2.js CHANGED
@@ -220,10 +220,15 @@ if(!sbi_js_exists) {
220
  // enable header hover action
221
  $('.sb_instagram_header').each(function () {
222
  var $thisHeader = $(this);
223
- $thisHeader.find('.sbi_header_link').hover(function () {
224
- $thisHeader.find('.sbi_header_img_hover').addClass('sbi_fade_in');
225
- }, function () {
226
- $thisHeader.find('.sbi_header_img_hover').removeClass('sbi_fade_in');
 
 
 
 
 
227
  });
228
  });
229
 
@@ -283,7 +288,7 @@ if(!sbi_js_exists) {
283
  sbi_timer = setTimeout(sbi_callback, sbi_ms);
284
  };
285
  })();
286
- jQuery(window).resize(function () {
287
  sbi_delay(function () {
288
  feed.afterResize();
289
  }, 500);
@@ -349,11 +354,15 @@ if(!sbi_js_exists) {
349
  var $self = jQuery(this);
350
 
351
  //Photo links
352
- //If lightbox is disabled
353
- $self.find('.sbi_photo').hover(function () {
354
- jQuery(this).fadeTo(200, 0.85);
355
- }, function () {
356
- jQuery(this).stop().fadeTo(500, 1);
 
 
 
 
357
  });
358
  }); //End .sbi_item each
359
 
@@ -1057,7 +1066,7 @@ if(!sbi_js_exists) {
1057
  sbi_init();
1058
 
1059
  // Cookie Notice by dFactory
1060
- $('#cookie-notice a').click(function() {
1061
  setTimeout(function() {
1062
  $.each(window.sbi.feeds,function(index){
1063
  window.sbi.feeds[ index ].afterConsentToggled();
@@ -1066,7 +1075,7 @@ if(!sbi_js_exists) {
1066
  });
1067
 
1068
  // GDPR Cookie Consent by WebToffee
1069
- $('#cookie-law-info-bar a').click(function() {
1070
  setTimeout(function() {
1071
  $.each(window.sbi.feeds,function(index){
1072
  window.sbi.feeds[ index ].afterConsentToggled();
@@ -1075,7 +1084,7 @@ if(!sbi_js_exists) {
1075
  });
1076
 
1077
  // GDPR Cookie Consent by WebToffee
1078
- $('.cli-user-preference-checkbox').click(function(){
1079
  setTimeout(function() {
1080
  $.each(window.sbi.feeds,function(index){
1081
  window.sbi.feeds[ index ].settings.consentGiven = false;
220
  // enable header hover action
221
  $('.sb_instagram_header').each(function () {
222
  var $thisHeader = $(this);
223
+ $thisHeader.find('.sbi_header_link').on('mouseenter mouseleave', function(e) {
224
+ switch(e.type) {
225
+ case 'mouseenter':
226
+ $thisHeader.find('.sbi_header_img_hover').addClass('sbi_fade_in');
227
+ break;
228
+ case 'mouseleave':
229
+ $thisHeader.find('.sbi_header_img_hover').removeClass('sbi_fade_in');
230
+ break;
231
+ }
232
  });
233
  });
234
 
288
  sbi_timer = setTimeout(sbi_callback, sbi_ms);
289
  };
290
  })();
291
+ jQuery(window).on('resize',function () {
292
  sbi_delay(function () {
293
  feed.afterResize();
294
  }, 500);
354
  var $self = jQuery(this);
355
 
356
  //Photo links
357
+ $self.find('.sbi_photo').on('mouseenter mouseleave', function(e) {
358
+ switch(e.type) {
359
+ case 'mouseenter':
360
+ jQuery(this).fadeTo(200, 0.85);
361
+ break;
362
+ case 'mouseleave':
363
+ jQuery(this).stop().fadeTo(500, 1);
364
+ break;
365
+ }
366
  });
367
  }); //End .sbi_item each
368
 
1066
  sbi_init();
1067
 
1068
  // Cookie Notice by dFactory
1069
+ $('#cookie-notice a').on('click',function() {
1070
  setTimeout(function() {
1071
  $.each(window.sbi.feeds,function(index){
1072
  window.sbi.feeds[ index ].afterConsentToggled();
1075
  });
1076
 
1077
  // GDPR Cookie Consent by WebToffee
1078
+ $('#cookie-law-info-bar a').on('click',function() {
1079
  setTimeout(function() {
1080
  $.each(window.sbi.feeds,function(index){
1081
  window.sbi.feeds[ index ].afterConsentToggled();
1084
  });
1085
 
1086
  // GDPR Cookie Consent by WebToffee
1087
+ $('.cli-user-preference-checkbox').on('click',function(){
1088
  setTimeout(function() {
1089
  $.each(window.sbi.feeds,function(index){
1090
  window.sbi.feeds[ index ].settings.consentGiven = false;
js/sb-instagram-2-2.min.js CHANGED
@@ -1 +1 @@
1
- var sbi_js_exists=void 0!==sbi_js_exists;sbi_js_exists||(!function(i){function e(){var i,e,t,s=s||{VER:"0.9.944"};s.bgs_Available=!1,s.bgs_CheckRunned=!1,function(i){i.fn.extend({sbi_imgLiquid:function(e){this.defaults={fill:!0,verticalAlign:"center",horizontalAlign:"center",useBackgroundSize:!0,useDataHtmlAttr:!0,responsive:!0,delay:0,fadeInTime:0,removeBoxBackground:!0,hardPixels:!0,responsiveCheckTime:500,timecheckvisibility:500,onStart:null,onFinish:null,onItemStart:null,onItemFinish:null,onItemError:null},function(){if(!s.bgs_CheckRunned){s.bgs_CheckRunned=!0;var e=i('<span style="background-size:cover" />');i("body").append(e),function(){var i=e[0];if(i&&window.getComputedStyle){var t=window.getComputedStyle(i,null);t&&t.backgroundSize&&(s.bgs_Available="cover"===t.backgroundSize)}}(),e.remove()}}();var t=this;return this.options=e,this.settings=i.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(e){function n(){(r.responsive||h.data("sbi_imgLiquid_oldProcessed"))&&h.data("sbi_imgLiquid_settings")&&(r=h.data("sbi_imgLiquid_settings"),l.actualSize=l.get(0).offsetWidth+l.get(0).offsetHeight/1e4,l.sizeOld&&l.actualSize!==l.sizeOld&&o(),l.sizeOld=l.actualSize,setTimeout(n,r.responsiveCheckTime))}function a(){h.data("sbi_imgLiquid_error",!0),l.addClass("sbi_imgLiquid_error"),r.onItemError&&r.onItemError(e,l,h),d()}function o(){var i,t,s,n,a,o,g,c,f=0,u=0,b=l.width(),_=l.height();void 0===h.data("owidth")&&h.data("owidth",h[0].width),void 0===h.data("oheight")&&h.data("oheight",h[0].height),r.fill===b/_>=h.data("owidth")/h.data("oheight")?(i="100%",t="auto",s=Math.floor(b),n=Math.floor(b*(h.data("oheight")/h.data("owidth")))):(i="auto",t="100%",s=Math.floor(_*(h.data("owidth")/h.data("oheight"))),n=Math.floor(_)),g=b-s,"left"===(a=r.horizontalAlign.toLowerCase())&&(u=0),"center"===a&&(u=.5*g),"right"===a&&(u=g),-1!==a.indexOf("%")&&((a=parseInt(a.replace("%",""),10))>0&&(u=g*a*.01)),c=_-n,"left"===(o=r.verticalAlign.toLowerCase())&&(f=0),"center"===o&&(f=.5*c),"bottom"===o&&(f=c),-1!==o.indexOf("%")&&((o=parseInt(o.replace("%",""),10))>0&&(f=c*o*.01)),r.hardPixels&&(i=s,t=n),h.css({width:i,height:t,"margin-left":Math.floor(u),"margin-top":Math.floor(f)}),h.data("sbi_imgLiquid_oldProcessed")||(h.fadeTo(r.fadeInTime,1),h.data("sbi_imgLiquid_oldProcessed",!0),r.removeBoxBackground&&l.css("background-image","none"),l.addClass("sbi_imgLiquid_nobgSize"),l.addClass("sbi_imgLiquid_ready")),r.onItemFinish&&r.onItemFinish(e,l,h),d()}function d(){e===t.length-1&&t.settings.onFinish&&t.settings.onFinish()}var r=t.settings,l=i(this),h=i("img:first",l);return h.length?(h.data("sbi_imgLiquid_settings")?(l.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),r=i.extend({},h.data("sbi_imgLiquid_settings"),t.options)):r=i.extend({},t.settings,function(){var i={};if(t.settings.useDataHtmlAttr){var e=l.attr("data-sbi_imgLiquid-fill"),n=l.attr("data-sbi_imgLiquid-horizontalAlign"),a=l.attr("data-sbi_imgLiquid-verticalAlign");("true"===e||"false"===e)&&(i.fill=Boolean("true"===e)),void 0===n||"left"!==n&&"center"!==n&&"right"!==n&&-1===n.indexOf("%")||(i.horizontalAlign=n),void 0===a||"top"!==a&&"bottom"!==a&&"center"!==a&&-1===a.indexOf("%")||(i.verticalAlign=a)}return s.isIE&&t.settings.ieFadeInDisabled&&(i.fadeInTime=0),i}()),h.data("sbi_imgLiquid_settings",r),r.onItemStart&&r.onItemStart(e,l,h),void(s.bgs_Available&&r.useBackgroundSize?(-1===l.css("background-image").indexOf(encodeURI(h.attr("src")))&&l.css({"background-image":'url("'+encodeURI(h.attr("src"))+'")'}),l.css({"background-size":r.fill?"cover":"contain","background-position":(r.horizontalAlign+" "+r.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),i("a:first",l).css({display:"block",width:"100%",height:"100%"}),i("img",l).css({display:"none"}),r.onItemFinish&&r.onItemFinish(e,l,h),l.addClass("sbi_imgLiquid_bgSize"),l.addClass("sbi_imgLiquid_ready"),d()):function t(){if(h.data("oldSrc")&&h.data("oldSrc")!==h.attr("src")){var s=h.clone().removeAttr("style");return s.data("sbi_imgLiquid_settings",h.data("sbi_imgLiquid_settings")),h.parent().prepend(s),h.remove(),(h=s)[0].width=0,void setTimeout(t,10)}return h.data("sbi_imgLiquid_oldProcessed")?void o():(h.data("sbi_imgLiquid_oldProcessed",!1),h.data("oldSrc",h.attr("src")),i("img:not(:first)",l).css("display","none"),l.css({overflow:"hidden"}),h.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),h.on("error",a),h[0].onerror=a,function i(){h.data("sbi_imgLiquid_error")||h.data("sbi_imgLiquid_loaded")||h.data("sbi_imgLiquid_oldProcessed")||(l.is(":visible")&&h[0].complete&&h[0].width>0&&h[0].height>0?(h.data("sbi_imgLiquid_loaded",!0),setTimeout(o,e*r.delay)):setTimeout(i,r.timecheckvisibility))}(),void n())}())):void a()})}})}(jQuery),i=s.injectCss,e=document.getElementsByTagName("head")[0],(t=document.createElement("style")).type="text/css",t.styleSheet?t.styleSheet.cssText=i:t.appendChild(document.createTextNode(i)),e.appendChild(t)}function t(){this.feeds={},this.options=sb_instagram_js_options}function s(i,e,t){this.el=i,this.index=e,this.settings=t,this.minImageWidth=0,this.imageResolution=150,this.resizedImages={},this.needsResizing=[],this.outOfPages=!1,this.page=1,this.isInitialized=!1}function n(e,t){i.ajax({url:sbiajaxurl,type:"post",data:e,success:t})}t.prototype={createPage:function(e,t){void 0!==window.sbiajaxurl&&-1!==window.sbiajaxurl.indexOf(window.location.hostname)||(window.sbiajaxurl=location.protocol+"//"+window.location.hostname+"/wp-admin/admin-ajax.php"),i(".sbi_no_js_error_message").remove(),i(".sbi_no_js").removeClass("sbi_no_js"),e(t)},createFeeds:function(e){e.whenFeedsCreated(i(".sbi").each(function(e){i(this).attr("data-sbi-index",e+1);var t=i(this),a=void 0!==t.attr("data-sbi-flags")?t.attr("data-sbi-flags").split(","):[],o=void 0!==t.attr("data-options")?JSON.parse(t.attr("data-options")):{};if(a.indexOf("testAjax")>-1){window.sbi.triggeredTest=!0;n({action:"sbi_on_ajax_test_trigger"},function(i){console.log("did test")})}var d={cols:t.attr("data-cols"),colsmobile:void 0!==t.attr("data-colsmobile")&&"same"!==t.attr("data-colsmobile")?t.attr("data-colsmobile"):t.attr("data-cols"),num:t.attr("data-num"),imgRes:t.attr("data-res"),feedID:t.attr("data-feedid"),postID:"undefind"!=typeof t.attr("data-postid")?t.attr("data-postid"):"unknown",shortCodeAtts:t.attr("data-shortcode-atts"),resizingEnabled:-1===a.indexOf("resizeDisable"),imageLoadEnabled:-1===a.indexOf("imageLoadDisable"),debugEnabled:a.indexOf("debug")>-1,favorLocal:a.indexOf("favorLocal")>-1,ajaxPostLoad:a.indexOf("ajaxPostLoad")>-1,gdpr:a.indexOf("gdpr")>-1,overrideBlockCDN:a.indexOf("overrideBlockCDN")>-1,consentGiven:!1,locator:a.indexOf("locator")>-1,autoMinRes:1,general:o};window.sbi.feeds[e]=function(i,e,t){return new s(i,e,t)}(this,e,d),window.sbi.feeds[e].setResizedImages(),window.sbi.feeds[e].init();var r=jQuery.Event("sbiafterfeedcreate");r.feed=window.sbi.feeds[e],jQuery(window).trigger(r)}))},afterFeedsCreated:function(){i(".sb_instagram_header").each(function(){var e=i(this);e.find(".sbi_header_link").hover(function(){e.find(".sbi_header_img_hover").addClass("sbi_fade_in")},function(){e.find(".sbi_header_img_hover").removeClass("sbi_fade_in")})})},encodeHTML:function(i){return void 0===i?"":i.replace(/(>)/g,"&gt;").replace(/(<)/g,"&lt;").replace(/(&lt;br\/&gt;)/g,"<br>").replace(/(&lt;br&gt;)/g,"<br>")},urlDetect:function(i){return i.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/g)}},s.prototype={init:function(){var e=this;e.settings.consentGiven=e.checkConsent(),i(this.el).find(".sbi_photo").parent("p").length&&i(this.el).addClass("sbi_no_autop"),i(this.el).find("#sbi_mod_error").length&&i(this.el).prepend(i(this.el).find("#sbi_mod_error")),this.settings.ajaxPostLoad?this.getNewPostSet():this.afterInitialImagesLoaded();var t,s=(t=0,function(i,e){clearTimeout(t),t=setTimeout(i,e)});jQuery(window).resize(function(){s(function(){e.afterResize()},500)}),i(this.el).find(".sbi_item").each(function(){e.lazyLoadCheck(i(this))})},initLayout:function(){},afterInitialImagesLoaded:function(){this.initLayout(),this.loadMoreButtonInit(),this.hideExtraImagesForWidth(),this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed()},afterResize:function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass()},afterLoadMoreClicked:function(i){i.find(".sbi_loader").removeClass("sbi_hidden"),i.find(".sbi_btn_text").addClass("sbi_hidden"),i.closest(".sbi").find(".sbi_num_diff_hide").addClass("sbi_transition").removeClass("sbi_num_diff_hide")},afterNewImagesLoaded:function(){var e=i(this.el),t=this;this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),setTimeout(function(){e.find(".sbi_loader").addClass("sbi_hidden"),e.find(".sbi_btn_text").removeClass("sbi_hidden"),t.maybeRaiseImageResolution()},500)},beforeNewImagesRevealed:function(){this.setImageHeight(),this.maybeRaiseImageResolution(!0),this.setImageSizeClass()},revealNewImages:function(){var e=i(this.el);e.find(".sbi-screenreader").each(function(){i(this).find("img").remove()}),"function"==typeof sbi_custom_js&&setTimeout(function(){sbi_custom_js()},100),this.applyImageLiquid(),e.find(".sbi_item").each(function(i){jQuery(this).find(".sbi_photo").hover(function(){jQuery(this).fadeTo(200,.85)},function(){jQuery(this).stop().fadeTo(500,1)})}),setTimeout(function(){jQuery("#sbi_images .sbi_item.sbi_new").removeClass("sbi_new");var i=10;e.find(".sbi_transition").each(function(){var e=jQuery(this);setTimeout(function(){e.removeClass("sbi_transition")},i),i+=10})},500)},lazyLoadCheck:function(e){if(e.find(".sbi_photo").length&&!e.closest(".sbi").hasClass("sbi-no-ll-check")){var t=this.getImageUrls(e),s=void 0!==t[640]?t[640]:e.find(".sbi_photo").attr("data-full-res");if(!this.settings.consentGiven&&s.indexOf("scontent")>-1)return;e.find(".sbi_photo img").each(function(){s&&void 0!==i(this).attr("data-src")&&i(this).attr("data-src",s),s&&void 0!==i(this).attr("data-orig-src")&&i(this).attr("data-orig-src",s),i(this).on("load",function(){!i(this).hasClass("sbi-replaced")&&i(this).attr("src").indexOf("placeholder")>-1&&(i(this).addClass("sbi-replaced"),s&&(i(this).attr("src",s),i(this).closest(".sbi_imgLiquid_bgSize").length&&i(this).closest(".sbi_imgLiquid_bgSize").css("background-image","url("+s+")")))})})}},afterNewImagesRevealed:function(){this.listenForVisibilityChange(),this.sendNeedsResizingToServer(),this.settings.imageLoadEnabled||i(".sbi_no_resraise").removeClass("sbi_no_resraise");var e=i.Event("sbiafterimagesloaded");e.el=i(this.el),i(window).trigger(e)},setResizedImages:function(){i(this.el).find(".sbi_resized_image_data").length&&void 0!==i(this.el).find(".sbi_resized_image_data").attr("data-resized")&&0===i(this.el).find(".sbi_resized_image_data").attr("data-resized").indexOf('{"')&&(this.resizedImages=JSON.parse(i(this.el).find(".sbi_resized_image_data").attr("data-resized")),i(this.el).find(".sbi_resized_image_data").remove())},sendNeedsResizingToServer:function(){var e=this;if(e.needsResizing.length>0&&e.settings.resizingEnabled){var t=i(this.el).find(".sbi_item").length,s=void 0!==e.settings.general.cache_all&&e.settings.general.cache_all;n({action:"sbi_resized_images_submit",needs_resizing:e.needsResizing,offset:t,feed_id:e.settings.feedID,atts:e.settings.shortCodeAtts,location:e.locationGuess(),post_id:e.settings.postID,cache_all:s},function(i){if(0===i.trim().indexOf("{")){var t=JSON.parse(i);for(var s in e.settings.debugEnabled&&console.log(t),t)t.hasOwnProperty(s)&&(e.resizedImages[s]=t[s]);e.maybeRaiseImageResolution(),setTimeout(function(){e.afterResize()},500)}})}else if(e.settings.locator){n({action:"sbi_do_locator",feed_id:e.settings.feedID,atts:e.settings.shortCodeAtts,location:e.locationGuess(),post_id:e.settings.postID},function(i){})}},loadMoreButtonInit:function(){var e=i(this.el),t=this;e.find("#sbi_load .sbi_load_btn").off().on("click",function(){t.afterLoadMoreClicked(jQuery(this)),t.getNewPostSet()})},getNewPostSet:function(){var e=i(this.el),t=this;t.page++;n({action:"sbi_load_more_clicked",offset:e.find(".sbi_item").length,page:t.page,feed_id:t.settings.feedID,atts:t.settings.shortCodeAtts,location:t.locationGuess(),post_id:t.settings.postID,current_resolution:t.imageResolution},function(s){if(0===s.trim().indexOf("{")){var n=JSON.parse(s);t.settings.debugEnabled&&console.log(n),t.appendNewPosts(n.html),t.addResizedImages(n.resizedImages),t.settings.ajaxPostLoad?(t.settings.ajaxPostLoad=!1,t.afterInitialImagesLoaded()):t.afterNewImagesLoaded(),n.feedStatus.shouldPaginate?t.outOfPages=!1:(t.outOfPages=!0,e.find(".sbi_load_btn").hide()),i(".sbi_no_js").removeClass("sbi_no_js")}})},appendNewPosts:function(e){var t=i(this.el);t.find("#sbi_images .sbi_item").length?t.find("#sbi_images .sbi_item").last().after(e):t.find("#sbi_images").append(e)},addResizedImages:function(i){for(var e in i)this.resizedImages[e]=i[e]},setImageHeight:function(){var e=i(this.el),t=e.find(".sbi_photo").eq(0).innerWidth(),s=this.getColumnCount(),n=e.find("#sbi_images").innerWidth()-e.find("#sbi_images").width(),a=n/2;sbi_photo_width_manual=e.find("#sbi_images").width()/s-n,e.find(".sbi_photo").css("height",t),e.find(".sbi-owl-nav").length&&setTimeout(function(){var i=2;e.find(".sbi_owl2row-item").length&&(i=1);var t=e.find(".sbi_photo").eq(0).innerWidth()/i;t+=parseInt(a)*(2-i+2),e.find(".sbi-owl-nav div").css("top",t)},100)},maybeRaiseSingleImageResolution:function(e,t,s){var n=this,a=n.getImageUrls(e),o=e.find(".sbi_photo img").attr("src"),d=150,r=e.find("img").get(0),l=o===window.sbi.options.placeholder?1:r.naturalWidth/r.naturalHeight;s=void 0!==s&&s;if(!(e.hasClass("sbi_no_resraise")||e.hasClass("sbi_had_error")||e.find(".sbi_link_area").length&&e.find(".sbi_link_area").hasClass("sbi_had_error")))if(a.length<1)e.find(".sbi_link_area").length&&e.find(".sbi_link_area").attr("href",window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png"));else{(e.find(".sbi_link_area").length&&e.find(".sbi_link_area").attr("href")===window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png")||!n.settings.consentGiven)&&e.find(".sbi_link_area").attr("href",a[a.length-1]),void 0!==a[640]&&e.find(".sbi_photo").attr("data-full-res",a[640]),i.each(a,function(i,e){e===o&&(d=parseInt(i),s=!1)});var h=640;switch(n.settings.imgRes){case"thumb":h=150;break;case"medium":h=320;break;case"full":h=640;break;default:var g=Math.max(n.settings.autoMinRes,e.find(".sbi_photo").innerWidth()),c=n.getBestResolutionForAuto(g,l,e);switch(c){case 320:h=320;break;case 150:h=150}}if(h>d||o===window.sbi.options.placeholder||s){if(n.settings.debugEnabled){var f=o===window.sbi.options.placeholder?"was placeholder":"too small";console.log("rais res for "+o,f)}var u=a[h].split("?ig_cache_key")[0];if(o!==u&&(e.find(".sbi_photo img").attr("src",u),e.find(".sbi_photo").css("background-image",'url("'+u+'")')),d=h,"auto"===n.settings.imgRes){var b=!1;e.find(".sbi_photo img").on("load",function(){var t=i(this),s=t.get(0).naturalWidth/t.get(0).naturalHeight;if(1e3!==t.get(0).naturalWidth&&s>l&&!b){switch(n.settings.debugEnabled&&console.log("rais res again for aspect ratio change "+o),b=!0,g=e.find(".sbi_photo").innerWidth(),c=n.getBestResolutionForAuto(g,s,e),h=640,c){case 320:h=320;break;case 150:h=150}h>d&&(u=a[h].split("?ig_cache_key")[0],t.attr("src",u),t.closest(".sbi_photo").css("background-image",'url("'+u+'")')),"masonry"!==n.layout&&"highlight"!==n.layout||(i(n.el).find("#sbi_images").smashotope(n.isotopeArgs),setTimeout(function(){i(n.el).find("#sbi_images").smashotope(n.isotopeArgs)},500))}else if(n.settings.debugEnabled){var r=b?"already checked":"no aspect ratio change";console.log("not raising res for replacement "+o,r)}})}}e.find("img").on("error",function(){if(i(this).hasClass("sbi_img_error"))console.log("unfixed error "+i(this).attr("src"));else{var e;if(i(this).addClass("sbi_img_error"),!(i(this).attr("src").indexOf("media/?size=")>-1||i(this).attr("src").indexOf("cdninstagram")>-1||i(this).attr("src").indexOf("fbcdn")>-1)&&n.settings.consentGiven){if("undefined"!==i(this).closest(".sbi_photo").attr("data-img-src-set"))void 0!==(e=JSON.parse(i(this).closest(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/"))).d&&(i(this).attr("src",e.d),i(this).closest(".sbi_photo").css("background-image","url("+e.d+")"),i(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",e[640]).addClass("sbi_had_error"))}else n.settings.favorLocal=!0,void 0!==(e=n.getImageUrls(i(this).closest(".sbi_item")))[640]&&(i(this).attr("src",e[640]),i(this).closest(".sbi_photo").css("background-image","url("+e[640]+")"),i(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",e[640]).addClass("sbi_had_error"));setTimeout(function(){n.afterResize()},1500)}})}},maybeRaiseImageResolution:function(e){var t=this,s=void 0!==e&&!0===e?".sbi_item.sbi_new":".sbi_item",n=!t.isInitialized;i(t.el).find(s).each(function(e){!i(this).hasClass("sbi_num_diff_hide")&&i(this).find(".sbi_photo").length&&void 0!==i(this).find(".sbi_photo").attr("data-img-src-set")&&t.maybeRaiseSingleImageResolution(i(this),e,n)}),t.isInitialized=!0},getBestResolutionForAuto:function(e,t,s){(isNaN(t)||t<1)&&(t=1);var n=e*t,a=10*Math.ceil(n/10),o=[150,320,640];if(s.hasClass("sbi_highlighted")&&(a*=2),-1===o.indexOf(parseInt(a))){var d=!1;i.each(o,function(i,e){e>parseInt(a)&&!d&&(a=e,d=!0)})}return a},hideExtraImagesForWidth:function(){if("carousel"!==this.layout){var e=i(this.el),t=void 0!==e.attr("data-num")&&""!==e.attr("data-num")?parseInt(e.attr("data-num")):1,s=void 0!==e.attr("data-nummobile")&&""!==e.attr("data-nummobile")?parseInt(e.attr("data-nummobile")):t;i(window).width()<480?s<e.find(".sbi_item").length&&e.find(".sbi_item").slice(s-e.find(".sbi_item").length).addClass("sbi_num_diff_hide"):t<e.find(".sbi_item").length&&e.find(".sbi_item").slice(t-e.find(".sbi_item").length).addClass("sbi_num_diff_hide")}},setImageSizeClass:function(){var e=i(this.el);e.removeClass("sbi_small sbi_medium");var t=e.innerWidth(),s=parseInt(e.find("#sbi_images").outerWidth()-e.find("#sbi_images").width())/2,n=this.getColumnCount(),a=(t-s*(n+2))/n;a>120&&a<240?e.addClass("sbi_medium"):a<=120&&e.addClass("sbi_small")},setMinImageWidth:function(){i(this.el).find(".sbi_item .sbi_photo").first().length?this.minImageWidth=i(this.el).find(".sbi_item .sbi_photo").first().innerWidth():this.minImageWidth=150},setImageResolution:function(){if("auto"===this.settings.imgRes)this.imageResolution="auto";else switch(this.settings.imgRes){case"thumb":this.imageResolution=150;break;case"medium":this.imageResolution=320;break;default:this.imageResolution=640}},getImageUrls:function(i){var e=JSON.parse(i.find(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/")),t=i.attr("id").replace("sbi_","");if(this.settings.consentGiven||this.settings.overrideBlockCDN||(e=[]),void 0!==this.resizedImages[t]&&"video"!==this.resizedImages[t]&&"pending"!==this.resizedImages[t]&&"error"!==this.resizedImages[t].id&&"video"!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id){if(void 0!==this.resizedImages[t].sizes){var s=[];void 0!==this.resizedImages[t].sizes.full&&(e[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg",s.push(640)),void 0!==this.resizedImages[t].sizes.low&&(e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg",s.push(320)),void 0!==this.resizedImages[t].sizes.thumb&&(s.push(150),e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg"),this.settings.favorLocal&&(-1===s.indexOf(640)&&s.indexOf(320)>-1&&(e[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg"),-1===s.indexOf(320)&&(s.indexOf(640)>-1?e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg":s.indexOf(150)>-1&&(e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg")),-1===s.indexOf(150)&&(s.indexOf(320)>-1?e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg":s.indexOf(640)>-1&&(e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg")))}}else(void 0===this.resizedImages[t]||void 0!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id&&"error"!==this.resizedImages[t].id)&&this.addToNeedsResizing(t);return e},getAvatarUrl:function(i,e){if(""===i)return"";var t=this.settings.general.avatars;return"local"===(e=void 0!==e?e:"local")?void 0!==t["LCL"+i]&&1===parseInt(t["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":void 0!==t[i]?t[i]:"":void 0!==t[i]?t[i]:void 0!==t["LCL"+i]&&1===parseInt(t["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":""},addToNeedsResizing:function(i){-1===this.needsResizing.indexOf(i)&&this.needsResizing.push(i)},applyImageLiquid:function(){var t=i(this.el);e(),"function"==typeof t.find(".sbi_photo").sbi_imgLiquid&&t.find(".sbi_photo").sbi_imgLiquid({fill:!0})},listenForVisibilityChange:function(){var e,t,s,n=this;e=jQuery,t={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},s={sbiCheckVisibility:function(i,e){if(jQuery.contains(document,i[0])){var t=e.sbiPreviousVisibility,n=i.is(":visible");e.sbiPreviousVisibility=n,null==t?e.runOnLoad&&e.callback(i,n):t!==n&&e.callback(i,n),setTimeout(function(){s.sbiCheckVisibility(i,e)},e.frequency)}}},e.fn.sbiVisibilityChanged=function(i){var n=e.extend({},t,i);return this.each(function(){s.sbiCheckVisibility(e(this),n)})},"function"==typeof i(this.el).filter(":hidden").sbiVisibilityChanged&&i(this.el).filter(":hidden").sbiVisibilityChanged({callback:function(i,e){n.afterResize()},runOnLoad:!1})},getColumnCount:function(){var e=i(this.el),t=this.settings.cols,s=this.settings.colsmobile,n=t;return sbiWindowWidth=window.innerWidth,e.hasClass("sbi_mob_col_auto")?(sbiWindowWidth<640&&parseInt(t)>2&&parseInt(t)<7&&(n=2),sbiWindowWidth<640&&parseInt(t)>6&&parseInt(t)<11&&(n=4),sbiWindowWidth<=480&&parseInt(t)>2&&(n=1)):sbiWindowWidth<=480&&(n=s),parseInt(n)},checkConsent:function(){if(this.settings.consentGiven||!this.settings.gdpr)return!0;if("undefined"!=typeof CLI_Cookie)null!==CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)&&(this.settings.consentGiven="yes"===CLI_Cookie.read("cookielawinfo-checkbox-non-necessary"));else if(void 0!==window.cnArgs){var i=("; "+document.cookie).split("; cookie_notice_accepted=");if(2===i.length){var e=i.pop().split(";").shift();this.settings.consentGiven="true"===e}}else void 0!==window.cookieconsent?this.settings.consentGiven="allow"===function(i){for(var e=i+"=",t=window.document.cookie.split(";"),s=0;s<t.length;s++){var n=t[s].trim();if(0==n.indexOf(e))return n.substring(e.length,n.length)}return""}("complianz_consent_status"):void 0!==window.Cookiebot?this.settings.consentGiven=Cookiebot.consented:void 0!==window.BorlabsCookie&&(this.settings.consentGiven=window.BorlabsCookie.checkCookieConsent("instagram"));var t=jQuery.Event("sbicheckconsent");return t.feed=this,jQuery(window).trigger(t),this.settings.consentGiven},afterConsentToggled:function(){if(this.checkConsent()){var i=this;i.maybeRaiseImageResolution(),setTimeout(function(){i.afterResize()},500)}},locationGuess:function(){var e=i(this.el),t="content";return e.closest("footer").length?t="footer":e.closest(".header").length||e.closest("header").length?t="header":(e.closest(".sidebar").length||e.closest("aside").length)&&(t="sidebar"),t}},window.sbi_init=function(){window.sbi=new t,window.sbi.createPage(window.sbi.createFeeds,{whenFeedsCreated:window.sbi.afterFeedsCreated})}}(jQuery),jQuery(document).ready(function(i){void 0===window.sb_instagram_js_options&&(window.sb_instagram_js_options={font_method:"svg",resized_url:location.protocol+"//"+window.location.hostname+"/wp-content/uploads/sb-instagram-feed-images/",placeholder:location.protocol+"//"+window.location.hostname+"/wp-content/plugins/instagram-feed/img/placeholder.png"}),void 0!==window.sb_instagram_js_options.resized_url&&-1===window.sb_instagram_js_options.resized_url.indexOf(location.protocol)&&("http:"===location.protocol?window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("https:","http:"):window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("http:","https:")),sbi_init(),i("#cookie-notice a").click(function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i("#cookie-law-info-bar a").click(function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i(".cli-user-preference-checkbox").click(function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i(window).on("CookiebotOnAccept",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),i(document).on("cmplzAcceptAll",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),i(document).on("cmplzRevoke",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})}),i(document).on("borlabs-cookie-consent-saved",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})})}));
1
+ var sbi_js_exists=void 0!==sbi_js_exists;sbi_js_exists||(!function(i){function e(){var i,e,t,s=s||{VER:"0.9.944"};s.bgs_Available=!1,s.bgs_CheckRunned=!1,function(i){i.fn.extend({sbi_imgLiquid:function(e){this.defaults={fill:!0,verticalAlign:"center",horizontalAlign:"center",useBackgroundSize:!0,useDataHtmlAttr:!0,responsive:!0,delay:0,fadeInTime:0,removeBoxBackground:!0,hardPixels:!0,responsiveCheckTime:500,timecheckvisibility:500,onStart:null,onFinish:null,onItemStart:null,onItemFinish:null,onItemError:null},function(){if(!s.bgs_CheckRunned){s.bgs_CheckRunned=!0;var e=i('<span style="background-size:cover" />');i("body").append(e),function(){var i=e[0];if(i&&window.getComputedStyle){var t=window.getComputedStyle(i,null);t&&t.backgroundSize&&(s.bgs_Available="cover"===t.backgroundSize)}}(),e.remove()}}();var t=this;return this.options=e,this.settings=i.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(e){function n(){(r.responsive||h.data("sbi_imgLiquid_oldProcessed"))&&h.data("sbi_imgLiquid_settings")&&(r=h.data("sbi_imgLiquid_settings"),l.actualSize=l.get(0).offsetWidth+l.get(0).offsetHeight/1e4,l.sizeOld&&l.actualSize!==l.sizeOld&&o(),l.sizeOld=l.actualSize,setTimeout(n,r.responsiveCheckTime))}function a(){h.data("sbi_imgLiquid_error",!0),l.addClass("sbi_imgLiquid_error"),r.onItemError&&r.onItemError(e,l,h),d()}function o(){var i,t,s,n,a,o,c,g,f=0,u=0,b=l.width(),m=l.height();void 0===h.data("owidth")&&h.data("owidth",h[0].width),void 0===h.data("oheight")&&h.data("oheight",h[0].height),r.fill===b/m>=h.data("owidth")/h.data("oheight")?(i="100%",t="auto",s=Math.floor(b),n=Math.floor(b*(h.data("oheight")/h.data("owidth")))):(i="auto",t="100%",s=Math.floor(m*(h.data("owidth")/h.data("oheight"))),n=Math.floor(m)),c=b-s,"left"===(a=r.horizontalAlign.toLowerCase())&&(u=0),"center"===a&&(u=.5*c),"right"===a&&(u=c),-1!==a.indexOf("%")&&((a=parseInt(a.replace("%",""),10))>0&&(u=c*a*.01)),g=m-n,"left"===(o=r.verticalAlign.toLowerCase())&&(f=0),"center"===o&&(f=.5*g),"bottom"===o&&(f=g),-1!==o.indexOf("%")&&((o=parseInt(o.replace("%",""),10))>0&&(f=g*o*.01)),r.hardPixels&&(i=s,t=n),h.css({width:i,height:t,"margin-left":Math.floor(u),"margin-top":Math.floor(f)}),h.data("sbi_imgLiquid_oldProcessed")||(h.fadeTo(r.fadeInTime,1),h.data("sbi_imgLiquid_oldProcessed",!0),r.removeBoxBackground&&l.css("background-image","none"),l.addClass("sbi_imgLiquid_nobgSize"),l.addClass("sbi_imgLiquid_ready")),r.onItemFinish&&r.onItemFinish(e,l,h),d()}function d(){e===t.length-1&&t.settings.onFinish&&t.settings.onFinish()}var r=t.settings,l=i(this),h=i("img:first",l);return h.length?(h.data("sbi_imgLiquid_settings")?(l.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),r=i.extend({},h.data("sbi_imgLiquid_settings"),t.options)):r=i.extend({},t.settings,function(){var i={};if(t.settings.useDataHtmlAttr){var e=l.attr("data-sbi_imgLiquid-fill"),n=l.attr("data-sbi_imgLiquid-horizontalAlign"),a=l.attr("data-sbi_imgLiquid-verticalAlign");("true"===e||"false"===e)&&(i.fill=Boolean("true"===e)),void 0===n||"left"!==n&&"center"!==n&&"right"!==n&&-1===n.indexOf("%")||(i.horizontalAlign=n),void 0===a||"top"!==a&&"bottom"!==a&&"center"!==a&&-1===a.indexOf("%")||(i.verticalAlign=a)}return s.isIE&&t.settings.ieFadeInDisabled&&(i.fadeInTime=0),i}()),h.data("sbi_imgLiquid_settings",r),r.onItemStart&&r.onItemStart(e,l,h),void(s.bgs_Available&&r.useBackgroundSize?(-1===l.css("background-image").indexOf(encodeURI(h.attr("src")))&&l.css({"background-image":'url("'+encodeURI(h.attr("src"))+'")'}),l.css({"background-size":r.fill?"cover":"contain","background-position":(r.horizontalAlign+" "+r.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),i("a:first",l).css({display:"block",width:"100%",height:"100%"}),i("img",l).css({display:"none"}),r.onItemFinish&&r.onItemFinish(e,l,h),l.addClass("sbi_imgLiquid_bgSize"),l.addClass("sbi_imgLiquid_ready"),d()):function t(){if(h.data("oldSrc")&&h.data("oldSrc")!==h.attr("src")){var s=h.clone().removeAttr("style");return s.data("sbi_imgLiquid_settings",h.data("sbi_imgLiquid_settings")),h.parent().prepend(s),h.remove(),(h=s)[0].width=0,void setTimeout(t,10)}return h.data("sbi_imgLiquid_oldProcessed")?void o():(h.data("sbi_imgLiquid_oldProcessed",!1),h.data("oldSrc",h.attr("src")),i("img:not(:first)",l).css("display","none"),l.css({overflow:"hidden"}),h.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),h.on("error",a),h[0].onerror=a,function i(){h.data("sbi_imgLiquid_error")||h.data("sbi_imgLiquid_loaded")||h.data("sbi_imgLiquid_oldProcessed")||(l.is(":visible")&&h[0].complete&&h[0].width>0&&h[0].height>0?(h.data("sbi_imgLiquid_loaded",!0),setTimeout(o,e*r.delay)):setTimeout(i,r.timecheckvisibility))}(),void n())}())):void a()})}})}(jQuery),i=s.injectCss,e=document.getElementsByTagName("head")[0],(t=document.createElement("style")).type="text/css",t.styleSheet?t.styleSheet.cssText=i:t.appendChild(document.createTextNode(i)),e.appendChild(t)}function t(){this.feeds={},this.options=sb_instagram_js_options}function s(i,e,t){this.el=i,this.index=e,this.settings=t,this.minImageWidth=0,this.imageResolution=150,this.resizedImages={},this.needsResizing=[],this.outOfPages=!1,this.page=1,this.isInitialized=!1}function n(e,t){i.ajax({url:sbiajaxurl,type:"post",data:e,success:t})}t.prototype={createPage:function(e,t){void 0!==window.sbiajaxurl&&-1!==window.sbiajaxurl.indexOf(window.location.hostname)||(window.sbiajaxurl=location.protocol+"//"+window.location.hostname+"/wp-admin/admin-ajax.php"),i(".sbi_no_js_error_message").remove(),i(".sbi_no_js").removeClass("sbi_no_js"),e(t)},createFeeds:function(e){e.whenFeedsCreated(i(".sbi").each(function(e){i(this).attr("data-sbi-index",e+1);var t=i(this),a=void 0!==t.attr("data-sbi-flags")?t.attr("data-sbi-flags").split(","):[],o=void 0!==t.attr("data-options")?JSON.parse(t.attr("data-options")):{};if(a.indexOf("testAjax")>-1){window.sbi.triggeredTest=!0;n({action:"sbi_on_ajax_test_trigger"},function(i){console.log("did test")})}var d={cols:t.attr("data-cols"),colsmobile:void 0!==t.attr("data-colsmobile")&&"same"!==t.attr("data-colsmobile")?t.attr("data-colsmobile"):t.attr("data-cols"),num:t.attr("data-num"),imgRes:t.attr("data-res"),feedID:t.attr("data-feedid"),postID:"undefind"!=typeof t.attr("data-postid")?t.attr("data-postid"):"unknown",shortCodeAtts:t.attr("data-shortcode-atts"),resizingEnabled:-1===a.indexOf("resizeDisable"),imageLoadEnabled:-1===a.indexOf("imageLoadDisable"),debugEnabled:a.indexOf("debug")>-1,favorLocal:a.indexOf("favorLocal")>-1,ajaxPostLoad:a.indexOf("ajaxPostLoad")>-1,gdpr:a.indexOf("gdpr")>-1,overrideBlockCDN:a.indexOf("overrideBlockCDN")>-1,consentGiven:!1,locator:a.indexOf("locator")>-1,autoMinRes:1,general:o};window.sbi.feeds[e]=function(i,e,t){return new s(i,e,t)}(this,e,d),window.sbi.feeds[e].setResizedImages(),window.sbi.feeds[e].init();var r=jQuery.Event("sbiafterfeedcreate");r.feed=window.sbi.feeds[e],jQuery(window).trigger(r)}))},afterFeedsCreated:function(){i(".sb_instagram_header").each(function(){var e=i(this);e.find(".sbi_header_link").on("mouseenter mouseleave",function(i){switch(i.type){case"mouseenter":e.find(".sbi_header_img_hover").addClass("sbi_fade_in");break;case"mouseleave":e.find(".sbi_header_img_hover").removeClass("sbi_fade_in")}})})},encodeHTML:function(i){return void 0===i?"":i.replace(/(>)/g,"&gt;").replace(/(<)/g,"&lt;").replace(/(&lt;br\/&gt;)/g,"<br>").replace(/(&lt;br&gt;)/g,"<br>")},urlDetect:function(i){return i.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/g)}},s.prototype={init:function(){var e=this;e.settings.consentGiven=e.checkConsent(),i(this.el).find(".sbi_photo").parent("p").length&&i(this.el).addClass("sbi_no_autop"),i(this.el).find("#sbi_mod_error").length&&i(this.el).prepend(i(this.el).find("#sbi_mod_error")),this.settings.ajaxPostLoad?this.getNewPostSet():this.afterInitialImagesLoaded();var t,s=(t=0,function(i,e){clearTimeout(t),t=setTimeout(i,e)});jQuery(window).on("resize",function(){s(function(){e.afterResize()},500)}),i(this.el).find(".sbi_item").each(function(){e.lazyLoadCheck(i(this))})},initLayout:function(){},afterInitialImagesLoaded:function(){this.initLayout(),this.loadMoreButtonInit(),this.hideExtraImagesForWidth(),this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed()},afterResize:function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass()},afterLoadMoreClicked:function(i){i.find(".sbi_loader").removeClass("sbi_hidden"),i.find(".sbi_btn_text").addClass("sbi_hidden"),i.closest(".sbi").find(".sbi_num_diff_hide").addClass("sbi_transition").removeClass("sbi_num_diff_hide")},afterNewImagesLoaded:function(){var e=i(this.el),t=this;this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),setTimeout(function(){e.find(".sbi_loader").addClass("sbi_hidden"),e.find(".sbi_btn_text").removeClass("sbi_hidden"),t.maybeRaiseImageResolution()},500)},beforeNewImagesRevealed:function(){this.setImageHeight(),this.maybeRaiseImageResolution(!0),this.setImageSizeClass()},revealNewImages:function(){var e=i(this.el);e.find(".sbi-screenreader").each(function(){i(this).find("img").remove()}),"function"==typeof sbi_custom_js&&setTimeout(function(){sbi_custom_js()},100),this.applyImageLiquid(),e.find(".sbi_item").each(function(i){jQuery(this).find(".sbi_photo").on("mouseenter mouseleave",function(i){switch(i.type){case"mouseenter":jQuery(this).fadeTo(200,.85);break;case"mouseleave":jQuery(this).stop().fadeTo(500,1)}})}),setTimeout(function(){jQuery("#sbi_images .sbi_item.sbi_new").removeClass("sbi_new");var i=10;e.find(".sbi_transition").each(function(){var e=jQuery(this);setTimeout(function(){e.removeClass("sbi_transition")},i),i+=10})},500)},lazyLoadCheck:function(e){if(e.find(".sbi_photo").length&&!e.closest(".sbi").hasClass("sbi-no-ll-check")){var t=this.getImageUrls(e),s=void 0!==t[640]?t[640]:e.find(".sbi_photo").attr("data-full-res");if(!this.settings.consentGiven&&s.indexOf("scontent")>-1)return;e.find(".sbi_photo img").each(function(){s&&void 0!==i(this).attr("data-src")&&i(this).attr("data-src",s),s&&void 0!==i(this).attr("data-orig-src")&&i(this).attr("data-orig-src",s),i(this).on("load",function(){!i(this).hasClass("sbi-replaced")&&i(this).attr("src").indexOf("placeholder")>-1&&(i(this).addClass("sbi-replaced"),s&&(i(this).attr("src",s),i(this).closest(".sbi_imgLiquid_bgSize").length&&i(this).closest(".sbi_imgLiquid_bgSize").css("background-image","url("+s+")")))})})}},afterNewImagesRevealed:function(){this.listenForVisibilityChange(),this.sendNeedsResizingToServer(),this.settings.imageLoadEnabled||i(".sbi_no_resraise").removeClass("sbi_no_resraise");var e=i.Event("sbiafterimagesloaded");e.el=i(this.el),i(window).trigger(e)},setResizedImages:function(){i(this.el).find(".sbi_resized_image_data").length&&void 0!==i(this.el).find(".sbi_resized_image_data").attr("data-resized")&&0===i(this.el).find(".sbi_resized_image_data").attr("data-resized").indexOf('{"')&&(this.resizedImages=JSON.parse(i(this.el).find(".sbi_resized_image_data").attr("data-resized")),i(this.el).find(".sbi_resized_image_data").remove())},sendNeedsResizingToServer:function(){var e=this;if(e.needsResizing.length>0&&e.settings.resizingEnabled){var t=i(this.el).find(".sbi_item").length,s=void 0!==e.settings.general.cache_all&&e.settings.general.cache_all;n({action:"sbi_resized_images_submit",needs_resizing:e.needsResizing,offset:t,feed_id:e.settings.feedID,atts:e.settings.shortCodeAtts,location:e.locationGuess(),post_id:e.settings.postID,cache_all:s},function(i){if(0===i.trim().indexOf("{")){var t=JSON.parse(i);for(var s in e.settings.debugEnabled&&console.log(t),t)t.hasOwnProperty(s)&&(e.resizedImages[s]=t[s]);e.maybeRaiseImageResolution(),setTimeout(function(){e.afterResize()},500)}})}else if(e.settings.locator){n({action:"sbi_do_locator",feed_id:e.settings.feedID,atts:e.settings.shortCodeAtts,location:e.locationGuess(),post_id:e.settings.postID},function(i){})}},loadMoreButtonInit:function(){var e=i(this.el),t=this;e.find("#sbi_load .sbi_load_btn").off().on("click",function(){t.afterLoadMoreClicked(jQuery(this)),t.getNewPostSet()})},getNewPostSet:function(){var e=i(this.el),t=this;t.page++;n({action:"sbi_load_more_clicked",offset:e.find(".sbi_item").length,page:t.page,feed_id:t.settings.feedID,atts:t.settings.shortCodeAtts,location:t.locationGuess(),post_id:t.settings.postID,current_resolution:t.imageResolution},function(s){if(0===s.trim().indexOf("{")){var n=JSON.parse(s);t.settings.debugEnabled&&console.log(n),t.appendNewPosts(n.html),t.addResizedImages(n.resizedImages),t.settings.ajaxPostLoad?(t.settings.ajaxPostLoad=!1,t.afterInitialImagesLoaded()):t.afterNewImagesLoaded(),n.feedStatus.shouldPaginate?t.outOfPages=!1:(t.outOfPages=!0,e.find(".sbi_load_btn").hide()),i(".sbi_no_js").removeClass("sbi_no_js")}})},appendNewPosts:function(e){var t=i(this.el);t.find("#sbi_images .sbi_item").length?t.find("#sbi_images .sbi_item").last().after(e):t.find("#sbi_images").append(e)},addResizedImages:function(i){for(var e in i)this.resizedImages[e]=i[e]},setImageHeight:function(){var e=i(this.el),t=e.find(".sbi_photo").eq(0).innerWidth(),s=this.getColumnCount(),n=e.find("#sbi_images").innerWidth()-e.find("#sbi_images").width(),a=n/2;sbi_photo_width_manual=e.find("#sbi_images").width()/s-n,e.find(".sbi_photo").css("height",t),e.find(".sbi-owl-nav").length&&setTimeout(function(){var i=2;e.find(".sbi_owl2row-item").length&&(i=1);var t=e.find(".sbi_photo").eq(0).innerWidth()/i;t+=parseInt(a)*(2-i+2),e.find(".sbi-owl-nav div").css("top",t)},100)},maybeRaiseSingleImageResolution:function(e,t,s){var n=this,a=n.getImageUrls(e),o=e.find(".sbi_photo img").attr("src"),d=150,r=e.find("img").get(0),l=o===window.sbi.options.placeholder?1:r.naturalWidth/r.naturalHeight;s=void 0!==s&&s;if(!(e.hasClass("sbi_no_resraise")||e.hasClass("sbi_had_error")||e.find(".sbi_link_area").length&&e.find(".sbi_link_area").hasClass("sbi_had_error")))if(a.length<1)e.find(".sbi_link_area").length&&e.find(".sbi_link_area").attr("href",window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png"));else{(e.find(".sbi_link_area").length&&e.find(".sbi_link_area").attr("href")===window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png")||!n.settings.consentGiven)&&e.find(".sbi_link_area").attr("href",a[a.length-1]),void 0!==a[640]&&e.find(".sbi_photo").attr("data-full-res",a[640]),i.each(a,function(i,e){e===o&&(d=parseInt(i),s=!1)});var h=640;switch(n.settings.imgRes){case"thumb":h=150;break;case"medium":h=320;break;case"full":h=640;break;default:var c=Math.max(n.settings.autoMinRes,e.find(".sbi_photo").innerWidth()),g=n.getBestResolutionForAuto(c,l,e);switch(g){case 320:h=320;break;case 150:h=150}}if(h>d||o===window.sbi.options.placeholder||s){if(n.settings.debugEnabled){var f=o===window.sbi.options.placeholder?"was placeholder":"too small";console.log("rais res for "+o,f)}var u=a[h].split("?ig_cache_key")[0];if(o!==u&&(e.find(".sbi_photo img").attr("src",u),e.find(".sbi_photo").css("background-image",'url("'+u+'")')),d=h,"auto"===n.settings.imgRes){var b=!1;e.find(".sbi_photo img").on("load",function(){var t=i(this),s=t.get(0).naturalWidth/t.get(0).naturalHeight;if(1e3!==t.get(0).naturalWidth&&s>l&&!b){switch(n.settings.debugEnabled&&console.log("rais res again for aspect ratio change "+o),b=!0,c=e.find(".sbi_photo").innerWidth(),g=n.getBestResolutionForAuto(c,s,e),h=640,g){case 320:h=320;break;case 150:h=150}h>d&&(u=a[h].split("?ig_cache_key")[0],t.attr("src",u),t.closest(".sbi_photo").css("background-image",'url("'+u+'")')),"masonry"!==n.layout&&"highlight"!==n.layout||(i(n.el).find("#sbi_images").smashotope(n.isotopeArgs),setTimeout(function(){i(n.el).find("#sbi_images").smashotope(n.isotopeArgs)},500))}else if(n.settings.debugEnabled){var r=b?"already checked":"no aspect ratio change";console.log("not raising res for replacement "+o,r)}})}}e.find("img").on("error",function(){if(i(this).hasClass("sbi_img_error"))console.log("unfixed error "+i(this).attr("src"));else{var e;if(i(this).addClass("sbi_img_error"),!(i(this).attr("src").indexOf("media/?size=")>-1||i(this).attr("src").indexOf("cdninstagram")>-1||i(this).attr("src").indexOf("fbcdn")>-1)&&n.settings.consentGiven){if("undefined"!==i(this).closest(".sbi_photo").attr("data-img-src-set"))void 0!==(e=JSON.parse(i(this).closest(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/"))).d&&(i(this).attr("src",e.d),i(this).closest(".sbi_photo").css("background-image","url("+e.d+")"),i(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",e[640]).addClass("sbi_had_error"))}else n.settings.favorLocal=!0,void 0!==(e=n.getImageUrls(i(this).closest(".sbi_item")))[640]&&(i(this).attr("src",e[640]),i(this).closest(".sbi_photo").css("background-image","url("+e[640]+")"),i(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",e[640]).addClass("sbi_had_error"));setTimeout(function(){n.afterResize()},1500)}})}},maybeRaiseImageResolution:function(e){var t=this,s=void 0!==e&&!0===e?".sbi_item.sbi_new":".sbi_item",n=!t.isInitialized;i(t.el).find(s).each(function(e){!i(this).hasClass("sbi_num_diff_hide")&&i(this).find(".sbi_photo").length&&void 0!==i(this).find(".sbi_photo").attr("data-img-src-set")&&t.maybeRaiseSingleImageResolution(i(this),e,n)}),t.isInitialized=!0},getBestResolutionForAuto:function(e,t,s){(isNaN(t)||t<1)&&(t=1);var n=e*t,a=10*Math.ceil(n/10),o=[150,320,640];if(s.hasClass("sbi_highlighted")&&(a*=2),-1===o.indexOf(parseInt(a))){var d=!1;i.each(o,function(i,e){e>parseInt(a)&&!d&&(a=e,d=!0)})}return a},hideExtraImagesForWidth:function(){if("carousel"!==this.layout){var e=i(this.el),t=void 0!==e.attr("data-num")&&""!==e.attr("data-num")?parseInt(e.attr("data-num")):1,s=void 0!==e.attr("data-nummobile")&&""!==e.attr("data-nummobile")?parseInt(e.attr("data-nummobile")):t;i(window).width()<480?s<e.find(".sbi_item").length&&e.find(".sbi_item").slice(s-e.find(".sbi_item").length).addClass("sbi_num_diff_hide"):t<e.find(".sbi_item").length&&e.find(".sbi_item").slice(t-e.find(".sbi_item").length).addClass("sbi_num_diff_hide")}},setImageSizeClass:function(){var e=i(this.el);e.removeClass("sbi_small sbi_medium");var t=e.innerWidth(),s=parseInt(e.find("#sbi_images").outerWidth()-e.find("#sbi_images").width())/2,n=this.getColumnCount(),a=(t-s*(n+2))/n;a>120&&a<240?e.addClass("sbi_medium"):a<=120&&e.addClass("sbi_small")},setMinImageWidth:function(){i(this.el).find(".sbi_item .sbi_photo").first().length?this.minImageWidth=i(this.el).find(".sbi_item .sbi_photo").first().innerWidth():this.minImageWidth=150},setImageResolution:function(){if("auto"===this.settings.imgRes)this.imageResolution="auto";else switch(this.settings.imgRes){case"thumb":this.imageResolution=150;break;case"medium":this.imageResolution=320;break;default:this.imageResolution=640}},getImageUrls:function(i){var e=JSON.parse(i.find(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/")),t=i.attr("id").replace("sbi_","");if(this.settings.consentGiven||this.settings.overrideBlockCDN||(e=[]),void 0!==this.resizedImages[t]&&"video"!==this.resizedImages[t]&&"pending"!==this.resizedImages[t]&&"error"!==this.resizedImages[t].id&&"video"!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id){if(void 0!==this.resizedImages[t].sizes){var s=[];void 0!==this.resizedImages[t].sizes.full&&(e[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg",s.push(640)),void 0!==this.resizedImages[t].sizes.low&&(e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg",s.push(320)),void 0!==this.resizedImages[t].sizes.thumb&&(s.push(150),e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg"),this.settings.favorLocal&&(-1===s.indexOf(640)&&s.indexOf(320)>-1&&(e[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg"),-1===s.indexOf(320)&&(s.indexOf(640)>-1?e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg":s.indexOf(150)>-1&&(e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg")),-1===s.indexOf(150)&&(s.indexOf(320)>-1?e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg":s.indexOf(640)>-1&&(e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg")))}}else(void 0===this.resizedImages[t]||void 0!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id&&"error"!==this.resizedImages[t].id)&&this.addToNeedsResizing(t);return e},getAvatarUrl:function(i,e){if(""===i)return"";var t=this.settings.general.avatars;return"local"===(e=void 0!==e?e:"local")?void 0!==t["LCL"+i]&&1===parseInt(t["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":void 0!==t[i]?t[i]:"":void 0!==t[i]?t[i]:void 0!==t["LCL"+i]&&1===parseInt(t["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":""},addToNeedsResizing:function(i){-1===this.needsResizing.indexOf(i)&&this.needsResizing.push(i)},applyImageLiquid:function(){var t=i(this.el);e(),"function"==typeof t.find(".sbi_photo").sbi_imgLiquid&&t.find(".sbi_photo").sbi_imgLiquid({fill:!0})},listenForVisibilityChange:function(){var e,t,s,n=this;e=jQuery,t={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},s={sbiCheckVisibility:function(i,e){if(jQuery.contains(document,i[0])){var t=e.sbiPreviousVisibility,n=i.is(":visible");e.sbiPreviousVisibility=n,null==t?e.runOnLoad&&e.callback(i,n):t!==n&&e.callback(i,n),setTimeout(function(){s.sbiCheckVisibility(i,e)},e.frequency)}}},e.fn.sbiVisibilityChanged=function(i){var n=e.extend({},t,i);return this.each(function(){s.sbiCheckVisibility(e(this),n)})},"function"==typeof i(this.el).filter(":hidden").sbiVisibilityChanged&&i(this.el).filter(":hidden").sbiVisibilityChanged({callback:function(i,e){n.afterResize()},runOnLoad:!1})},getColumnCount:function(){var e=i(this.el),t=this.settings.cols,s=this.settings.colsmobile,n=t;return sbiWindowWidth=window.innerWidth,e.hasClass("sbi_mob_col_auto")?(sbiWindowWidth<640&&parseInt(t)>2&&parseInt(t)<7&&(n=2),sbiWindowWidth<640&&parseInt(t)>6&&parseInt(t)<11&&(n=4),sbiWindowWidth<=480&&parseInt(t)>2&&(n=1)):sbiWindowWidth<=480&&(n=s),parseInt(n)},checkConsent:function(){if(this.settings.consentGiven||!this.settings.gdpr)return!0;if("undefined"!=typeof CLI_Cookie)null!==CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)&&(this.settings.consentGiven="yes"===CLI_Cookie.read("cookielawinfo-checkbox-non-necessary"));else if(void 0!==window.cnArgs){var i=("; "+document.cookie).split("; cookie_notice_accepted=");if(2===i.length){var e=i.pop().split(";").shift();this.settings.consentGiven="true"===e}}else void 0!==window.cookieconsent?this.settings.consentGiven="allow"===function(i){for(var e=i+"=",t=window.document.cookie.split(";"),s=0;s<t.length;s++){var n=t[s].trim();if(0==n.indexOf(e))return n.substring(e.length,n.length)}return""}("complianz_consent_status"):void 0!==window.Cookiebot?this.settings.consentGiven=Cookiebot.consented:void 0!==window.BorlabsCookie&&(this.settings.consentGiven=window.BorlabsCookie.checkCookieConsent("instagram"));var t=jQuery.Event("sbicheckconsent");return t.feed=this,jQuery(window).trigger(t),this.settings.consentGiven},afterConsentToggled:function(){if(this.checkConsent()){var i=this;i.maybeRaiseImageResolution(),setTimeout(function(){i.afterResize()},500)}},locationGuess:function(){var e=i(this.el),t="content";return e.closest("footer").length?t="footer":e.closest(".header").length||e.closest("header").length?t="header":(e.closest(".sidebar").length||e.closest("aside").length)&&(t="sidebar"),t}},window.sbi_init=function(){window.sbi=new t,window.sbi.createPage(window.sbi.createFeeds,{whenFeedsCreated:window.sbi.afterFeedsCreated})}}(jQuery),jQuery(document).ready(function(i){void 0===window.sb_instagram_js_options&&(window.sb_instagram_js_options={font_method:"svg",resized_url:location.protocol+"//"+window.location.hostname+"/wp-content/uploads/sb-instagram-feed-images/",placeholder:location.protocol+"//"+window.location.hostname+"/wp-content/plugins/instagram-feed/img/placeholder.png"}),void 0!==window.sb_instagram_js_options.resized_url&&-1===window.sb_instagram_js_options.resized_url.indexOf(location.protocol)&&("http:"===location.protocol?window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("https:","http:"):window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("http:","https:")),sbi_init(),i("#cookie-notice a").on("click",function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i("#cookie-law-info-bar a").on("click",function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i(".cli-user-preference-checkbox").on("click",function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i(window).on("CookiebotOnAccept",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),i(document).on("cmplzAcceptAll",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),i(document).on("cmplzRevoke",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})}),i(document).on("borlabs-cookie-consent-saved",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})})}));
js/sb-instagram-admin-2-2.js CHANGED
@@ -8,7 +8,7 @@ jQuery(document).ready(function($) {
8
 
9
  jQuery('#sbi_no_js_warning').remove();
10
  /* NEW API CODE */
11
- $('.sbi_admin_btn, .sbi_reconnect').click(function(event) {
12
  event.preventDefault();
13
 
14
  var today = new Date(),
@@ -50,7 +50,7 @@ jQuery(document).ready(function($) {
50
  }
51
  });
52
 
53
- $('input[name=sbi_login_type]').change(function() {
54
  if ($('input[name=sbi_login_type]:checked').val() === 'business') {
55
  $('a.sbi_admin_btn').attr('href',newApiURL);
56
  } else {
@@ -63,63 +63,61 @@ jQuery(document).ready(function($) {
63
  $('#sbi_config').append($('#sbi_config_info'));
64
  }
65
 
66
- $('#sbi-select-all').change(function() {
67
  var status = $(this).is(':checked');
68
  $('.sbi-add-checkbox input').each(function() {
69
- $(this).attr('checked',status);
70
  });
71
  if($('.sbi-add-checkbox input:checked').length) {
72
- $('#sbi-connect-business-accounts').removeAttr('disabled');
73
  } else {
74
- $('#sbi-connect-business-accounts').attr('disabled',true);
75
  }
76
  });
77
 
78
- $('.sbi-add-checkbox input').change(function() {
79
  if($('.sbi-add-checkbox input:checked').length) {
80
- $('#sbi-connect-business-accounts').removeAttr('disabled');
81
  } else {
82
- $('#sbi-connect-business-accounts').attr('disabled',true);
83
  }
84
  });
85
 
86
- $('#sbi-connect-business-accounts').click(function(event) {
87
- if(typeof $(this).attr('disabled') === 'undefined') {
88
- event.preventDefault();
89
- var accounts = {};
90
- $('.sbi-add-checkbox input').each(function(index) {
91
- if ($(this).is(':checked')) {
92
- var jsonSubmit = JSON.parse($(this).val());
93
- jsonSubmit.access_token = $(this).closest('.sbi-managed-page').attr('data-token');
94
- jsonSubmit.page_access_token = $(this).closest('.sbi-managed-page').attr('data-page-token');
95
- accounts[index] = jsonSubmit;
96
- }
97
- });
98
-
99
- $('.sbi_connected_accounts_wrap,#sbi_config_info').fadeTo("slow" , 0.5);
100
- jQuery.ajax({
101
- url: sbiA.ajax_url,
102
- type: 'post',
103
- data: {
104
- action: 'sbi_connect_business_accounts',
105
- accounts: JSON.stringify(accounts),
106
- sbi_nonce: sbiA.sbi_nonce
107
- },
108
- success: function (data) {
109
- if (data.trim().indexOf('{') === 0) {
110
- var connectedAccounts = JSON.parse(data);
111
- $('.sbi_connected_accounts_wrap').fadeTo("slow" , 1);
112
- $('#sbi_config_info').remove();
113
- $.each(connectedAccounts,function(index,savedToken) {
114
- console.log(savedToken);
115
- sbiAfterUpdateToken(savedToken,false);
116
 
117
- });
118
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
 
 
120
  }
121
- });
122
- }
 
123
 
124
  });
125
 
@@ -172,7 +170,7 @@ jQuery(document).ready(function($) {
172
  '</div>' +
173
  '</div>');
174
 
175
- $('#sbi_connect_account').click(function(event) {
176
  event.preventDefault();
177
  $('#sbi_config_info').fadeOut(200);
178
  sbSaveToken(token,false);
@@ -409,7 +407,7 @@ jQuery(document).ready(function($) {
409
  }
410
 
411
  $('.sbi_manually_connect_wrap').hide();
412
- $('.sbi_manually_connect').click(function(event) {
413
  event.preventDefault();
414
  if ( $('.sbi_manually_connect_wrap').is(':visible') ) {
415
  $('.sbi_manually_connect_wrap').slideUp(200);
@@ -459,7 +457,7 @@ jQuery(document).ready(function($) {
459
  });
460
 
461
  function sbiInitClickRemove(el) {
462
- el.click(function(event) {
463
  event.preventDefault();
464
  if (!$(this).closest('.sbi_connected_accounts_wrap').hasClass('sbi-waiting')) {
465
  $(this).closest('.sbi_connected_accounts_wrap').addClass('sbi-waiting');
@@ -501,7 +499,7 @@ jQuery(document).ready(function($) {
501
  });
502
 
503
  function sbiInitUserRemove(el,targetClass) {
504
- el.click(function(event) {
505
  event.preventDefault();
506
  targetClass = $('input[name=sb_instagram_type]:checked').val();
507
 
@@ -521,7 +519,7 @@ jQuery(document).ready(function($) {
521
  });
522
 
523
  function sbiInitUserAdd(el,targetClass) {
524
- el.click(function(event) {
525
  targetClass = $('input[name=sb_instagram_type]:checked').val();
526
  event.preventDefault();
527
  var $clicked = $(this),
@@ -559,7 +557,7 @@ jQuery(document).ready(function($) {
559
  permissions = $(this).attr('data-permissions'),
560
  $addRemoveButton = $(this).find('.sbi_ca_actions .button-primary').first();
561
  $(this).removeClass('sbi_account_updated');
562
- $addRemoveButton.removeAttr('disabled');
563
 
564
  if (targetClass === 'tagged' && (type === 'personal' || permissions !== 'tagged')) {
565
  $addRemoveButton.show();
@@ -568,11 +566,11 @@ jQuery(document).ready(function($) {
568
  } else {
569
  $addRemoveButton.html('Reconnect Account');
570
  }
571
- $addRemoveButton.attr('disabled',true).addClass('sbi_remove_from_user_feed').removeClass('sbi_use_in_user_feed');
572
  $(this).removeClass('sbi_account_active');
573
  } else if (targetClass === 'hashtag') {
574
  $addRemoveButton.hide();
575
- $addRemoveButton.attr('disabled',true).addClass('sbi_remove_from_user_feed').removeClass('sbi_use_in_user_feed');
576
  $(this).removeClass('sbi_account_active');
577
  } else {
578
  $addRemoveButton.show();
@@ -600,7 +598,7 @@ jQuery(document).ready(function($) {
600
  });
601
  }sbiConAccountsAddRemoveUpdater();
602
 
603
- $('input[name=sb_instagram_type]').change(sbiConAccountsAddRemoveUpdater);
604
 
605
 
606
 
@@ -608,7 +606,7 @@ jQuery(document).ready(function($) {
608
  jQuery(this).closest('.sbi_ca_info').find('.sbi_ca_accesstoken').slideToggle(200);
609
  });
610
 
611
- $('#sbi_manual_submit').click(function(event) {
612
  event.preventDefault();
613
  var $self = $(this);
614
  var accessToken = $('#sb_manual_at').val(),
@@ -626,7 +624,7 @@ jQuery(document).ready(function($) {
626
  $('.sbi_manually_connect_wrap').show().prepend('<div class="sbi_user_id_error" style="display:block;">Please enter a valid access token</div>');
627
  }
628
  } else if (! error) {
629
- $(this).attr('disabled',true);
630
  $(this).closest('.sbi_manually_connect_wrap').fadeOut();
631
  $('.sbi_connected_accounts_wrap').fadeTo("slow" , 0.5).find('.sbi_user_id_error').remove();
632
 
@@ -641,7 +639,7 @@ jQuery(document).ready(function($) {
641
  },
642
  success: function (data) {
643
  $('.sbi_connected_accounts_wrap').fadeTo("slow" , 1);
644
- $self.removeAttr('disabled');
645
  if ( data.indexOf('{') > -1) {
646
  var savedToken = JSON.parse(data);
647
  if (typeof savedToken.url !== 'undefined') {
@@ -666,7 +664,7 @@ jQuery(document).ready(function($) {
666
  // clear resized
667
  var $sbiClearResizedButton = $('#sbi_reset_resized');
668
 
669
- $sbiClearResizedButton.click(function(event) {
670
  event.preventDefault();
671
 
672
  jQuery('#sbi-clear-cache-success').remove();
@@ -698,7 +696,7 @@ jQuery(document).ready(function($) {
698
  jQuery('.sbi-caching-cron-options').show();
699
  }
700
 
701
- $('input[type=radio][name=sbi_caching_type]').change(function() {
702
  if (this.value == 'page') {
703
  jQuery('.sbi-caching-cron-options').slideUp();
704
  jQuery('.sbi-caching-page-options').slideDown();
@@ -717,7 +715,7 @@ jQuery(document).ready(function($) {
717
  //Should we show anything initially?
718
  if(sbi_cache_cron_interval == '30mins' || sbi_cache_cron_interval == '1hour') $sbi_caching_time_settings.hide();
719
 
720
- jQuery('#sbi_cache_cron_interval').change(function(){
721
  sbi_cache_cron_interval = jQuery('#sbi_cache_cron_interval').val();
722
 
723
  if(sbi_cache_cron_interval == '30mins' || sbi_cache_cron_interval == '1hour'){
@@ -736,7 +734,7 @@ jQuery(document).ready(function($) {
736
 
737
 
738
  //clear backup caches
739
- jQuery('#sbi_clear_backups').click(function(event) {
740
  jQuery('.sbi-success').remove();
741
  event.preventDefault();
742
  jQuery.ajax({
@@ -757,7 +755,7 @@ jQuery(document).ready(function($) {
757
  //sbi_reset_log
758
  var $sbiClearLog = $('#sbi_reset_log');
759
 
760
- $sbiClearLog.click(function(event) {
761
  event.preventDefault();
762
 
763
  jQuery('#sbi-clear-cache-success').remove();
@@ -780,7 +778,7 @@ jQuery(document).ready(function($) {
780
  }); // ajax call
781
  }); // clear_comment_cache click
782
 
783
- $('.sb-opt-in').click(function(event) {
784
  event.preventDefault();
785
 
786
  var $btn = jQuery(this);
@@ -789,7 +787,7 @@ jQuery(document).ready(function($) {
789
  sbiSubmitOptIn(true);
790
  }); // clear_comment_cache click
791
 
792
- jQuery('#sbi-oembed-disable').click(function(e) {
793
  e.preventDefault();
794
  jQuery(this).addClass( 'loading' ).html('<i class="fa fa-spinner fa-spin" aria-hidden="true"></i>');
795
  jQuery.ajax({
@@ -805,7 +803,7 @@ jQuery(document).ready(function($) {
805
  });
806
  });
807
 
808
- $('.sb-no-usage-opt-out').click(function(event) {
809
  event.preventDefault();
810
 
811
  var $btn = jQuery(this);
@@ -841,7 +839,7 @@ jQuery(document).ready(function($) {
841
  });
842
 
843
  //Shortcode labels
844
- jQuery('#sbi_admin label').click(function(){
845
  var $sbi_shortcode = jQuery(this).siblings('.sbi_shortcode');
846
  var $el = jQuery(this).parent();
847
 
@@ -853,29 +851,36 @@ jQuery(document).ready(function($) {
853
  $el.find('.sbi_shortcode').css('display','block');
854
  }
855
  });
856
- jQuery('#sbi_admin label').hover(function(){
857
- if( jQuery(this).siblings('.sbi_shortcode').length > 0 ){
858
- jQuery(this).attr('title', 'Click for shortcode option').append('<code class="sbi_shortcode_symbol">[]</code>');
 
 
 
 
 
 
 
 
859
  }
860
- }, function(){
861
- jQuery(this).find('.sbi_shortcode_symbol').remove();
862
  });
863
 
864
-
865
- jQuery('#sbi_admin .sbi_lock').hover(function(){
866
- jQuery(this).siblings('.sbi_pro_tooltip').show();
867
- }, function(){
868
- jQuery('.sbi_pro_tooltip').hide();
 
 
 
 
869
  });
870
-
871
-
872
-
873
-
874
  //Add the color picker
875
  if( jQuery('.sbi_colorpick').length > 0 ) jQuery('.sbi_colorpick').wpColorPicker();
876
 
877
  //Check User ID is numeric
878
- jQuery("#sb_instagram_user_id").change(function() {
879
 
880
  var sbi_user_id = jQuery('#sb_instagram_user_id').val(),
881
  $sbi_user_id_error = $(this).closest('td').find('.sbi_user_id_error'),
@@ -913,7 +918,7 @@ jQuery(document).ready(function($) {
913
  //Show initially if a width is set
914
  if( (sb_instagram_feed_width.length > 1 && sb_instagram_width_unit == 'px') || (sb_instagram_feed_width !== '100' && sb_instagram_width_unit == '%') ) $sb_instagram_width_options.show();
915
 
916
- jQuery('#sbi_admin #sb_instagram_width, #sbi_admin #sb_instagram_width_unit').change(function(){
917
  sb_instagram_feed_width = jQuery('#sbi_admin #sb_instagram_width').val();
918
  sb_instagram_width_unit = jQuery('#sbi_admin #sb_instagram_width_unit').val();
919
 
@@ -927,7 +932,7 @@ jQuery(document).ready(function($) {
927
  }
928
 
929
  //Scroll to hash for quick links
930
- jQuery('#sbi_admin a').click(function() {
931
  if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
932
  var target = jQuery(this.hash);
933
  target = target.length ? target : this.hash.slice(1);
@@ -957,7 +962,7 @@ jQuery(document).ready(function($) {
957
  jQuery('.sb_instagram_layout_settings.sbi_layout_type_'+jQuery('.sb_layout_type:checked').val()).show();
958
  }, 1);
959
  }
960
- jQuery('.sb_layout_type').change(sbiUpdateLayoutTypeOptionsDisplay);
961
 
962
  jQuery('.sbi_close_options').on('click', function(){
963
  jQuery('.sb_instagram_layout_settings').hide();
@@ -977,7 +982,7 @@ jQuery(document).ready(function($) {
977
 
978
  }
979
  sbiUpdateHighlightOptionsDisplay();
980
- jQuery('#sb_instagram_highlight_type').change(sbiUpdateHighlightOptionsDisplay);
981
 
982
  //sb_instagram_enable_email_report
983
  function sbiToggleEmail() {
@@ -987,7 +992,7 @@ jQuery(document).ready(function($) {
987
  jQuery('#sb_instagram_enable_email_report').closest('td').find('.sb_instagram_box').slideUp();
988
  }
989
  }sbiToggleEmail();
990
- jQuery('#sb_instagram_enable_email_report').change(sbiToggleEmail);
991
  if (jQuery('#sbi-goto').length) {
992
  jQuery('#sbi-goto').closest('tr').addClass('sbi-goto');
993
  $('html, body').animate({
@@ -1009,15 +1014,15 @@ jQuery(document).ready(function($) {
1009
  });
1010
 
1011
  //Selecting a post layout
1012
- jQuery('.sbi_layout_cell').click(function(){
1013
  var $self = jQuery(this);
1014
  $('.sb_layout_type').trigger('change');
1015
- $self.addClass('sbi_layout_selected').find('.sb_layout_type').attr('checked', 'checked');
1016
  $self.siblings().removeClass('sbi_layout_selected');
1017
  });
1018
 
1019
  setTimeout( function() {
1020
- jQuery('.notice-dismiss').click(function() {
1021
  if (jQuery(this).closest('.sbi-admin-notice').length) {
1022
 
1023
  if (jQuery(this).closest('.sbi-admin-notice').find('.sbi-admin-error').length) {
@@ -1060,7 +1065,7 @@ jQuery(document).ready(function($) {
1060
  jQuery('#sbi-notice-bar').show();
1061
  }
1062
 
1063
- jQuery('#sbi-notice-bar .dismiss').click(function(e) {
1064
  e.preventDefault();
1065
  jQuery('#sbi-notice-bar').remove();
1066
  jQuery.ajax({
@@ -1081,12 +1086,12 @@ jQuery(document).ready(function($) {
1081
 
1082
  /* Clear errors visit page */
1083
  jQuery('.sbi-error-directions a').addClass('button button-primary');
1084
- jQuery('.sbi-error-directions.sbi-reconnect a').click(function(){
1085
  event.preventDefault();
1086
  jQuery('.sbi_admin_btn').trigger('click');
1087
  });
1088
  jQuery('.sbi-clear-errors-visit-page').appendTo('.sbi-error-directions');
1089
- jQuery('.sbi-clear-errors-visit-page').click(function(event) {
1090
  event.preventDefault();
1091
  var $btn = jQuery(this);
1092
  $btn.prop( 'disabled', true ).addClass( 'loading' ).html('<i class="fa fa-spinner fa-spin" aria-hidden="true"></i>');
@@ -1130,7 +1135,7 @@ jQuery(document).ready(function($) {
1130
  $('.sb_cross_install_modal .addons-container').load($get_plugins_url+'admin.php?page=sb-instagram-feed&tab=more #install_'+sb_get_plugin);
1131
  });
1132
 
1133
- jQuery('.sbi-need-to-connect').click(function(e) {
1134
  e.preventDefault();
1135
 
1136
  jQuery('#sbi_config_info').show();
@@ -1161,7 +1166,7 @@ jQuery(document).ready(function($) {
1161
  sbiCheckGdprSetting();
1162
 
1163
  // Locator
1164
- jQuery('.sbi-locator-more').click(function(e) {
1165
  e.preventDefault();
1166
  jQuery(this).closest('td').find('.sbi-full-wrap').show();
1167
  jQuery(this).closest('td').find('.sbi-condensed-wrap').hide();
8
 
9
  jQuery('#sbi_no_js_warning').remove();
10
  /* NEW API CODE */
11
+ $('.sbi_admin_btn, .sbi_reconnect').on('click',function(event) {
12
  event.preventDefault();
13
 
14
  var today = new Date(),
50
  }
51
  });
52
 
53
+ $('input[name=sbi_login_type]').on('change',function() {
54
  if ($('input[name=sbi_login_type]:checked').val() === 'business') {
55
  $('a.sbi_admin_btn').attr('href',newApiURL);
56
  } else {
63
  $('#sbi_config').append($('#sbi_config_info'));
64
  }
65
 
66
+ $('#sbi-select-all').on('change',function() {
67
  var status = $(this).is(':checked');
68
  $('.sbi-add-checkbox input').each(function() {
69
+ $(this).prop('checked',status);
70
  });
71
  if($('.sbi-add-checkbox input:checked').length) {
72
+ $('#sbi-connect-business-accounts').prop('disabled',false);
73
  } else {
74
+ $('#sbi-connect-business-accounts').prop('disabled',true);
75
  }
76
  });
77
 
78
+ $('.sbi-add-checkbox input').on('change',function() {
79
  if($('.sbi-add-checkbox input:checked').length) {
80
+ $('#sbi-connect-business-accounts').prop('disabled',false);
81
  } else {
82
+ $('#sbi-connect-business-accounts').prop('disabled',true);
83
  }
84
  });
85
 
86
+ $('#sbi-connect-business-accounts').on('click',function(event) {
87
+ event.preventDefault();
88
+ var accounts = {};
89
+ $('.sbi-add-checkbox input').each(function(index) {
90
+ if ($(this).is(':checked')) {
91
+ var jsonSubmit = JSON.parse($(this).val());
92
+ jsonSubmit.access_token = $(this).closest('.sbi-managed-page').attr('data-token');
93
+ jsonSubmit.page_access_token = $(this).closest('.sbi-managed-page').attr('data-page-token');
94
+ accounts[index] = jsonSubmit;
95
+ }
96
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
 
98
+ $('.sbi_connected_accounts_wrap,#sbi_config_info').fadeTo("slow" , 0.5);
99
+ jQuery.ajax({
100
+ url: sbiA.ajax_url,
101
+ type: 'post',
102
+ data: {
103
+ action: 'sbi_connect_business_accounts',
104
+ accounts: JSON.stringify(accounts),
105
+ sbi_nonce: sbiA.sbi_nonce
106
+ },
107
+ success: function (data) {
108
+ if (data.trim().indexOf('{') === 0) {
109
+ var connectedAccounts = JSON.parse(data);
110
+ $('.sbi_connected_accounts_wrap').fadeTo("slow" , 1);
111
+ $('#sbi_config_info').remove();
112
+ $.each(connectedAccounts,function(index,savedToken) {
113
+ console.log(savedToken);
114
+ sbiAfterUpdateToken(savedToken,false);
115
 
116
+ });
117
  }
118
+
119
+ }
120
+ });
121
 
122
  });
123
 
170
  '</div>' +
171
  '</div>');
172
 
173
+ $('#sbi_connect_account').on('click',function(event) {
174
  event.preventDefault();
175
  $('#sbi_config_info').fadeOut(200);
176
  sbSaveToken(token,false);
407
  }
408
 
409
  $('.sbi_manually_connect_wrap').hide();
410
+ $('.sbi_manually_connect').on('click',function(event) {
411
  event.preventDefault();
412
  if ( $('.sbi_manually_connect_wrap').is(':visible') ) {
413
  $('.sbi_manually_connect_wrap').slideUp(200);
457
  });
458
 
459
  function sbiInitClickRemove(el) {
460
+ el.on('click',function(event) {
461
  event.preventDefault();
462
  if (!$(this).closest('.sbi_connected_accounts_wrap').hasClass('sbi-waiting')) {
463
  $(this).closest('.sbi_connected_accounts_wrap').addClass('sbi-waiting');
499
  });
500
 
501
  function sbiInitUserRemove(el,targetClass) {
502
+ el.on('click',function(event) {
503
  event.preventDefault();
504
  targetClass = $('input[name=sb_instagram_type]:checked').val();
505
 
519
  });
520
 
521
  function sbiInitUserAdd(el,targetClass) {
522
+ el.on('click',function(event) {
523
  targetClass = $('input[name=sb_instagram_type]:checked').val();
524
  event.preventDefault();
525
  var $clicked = $(this),
557
  permissions = $(this).attr('data-permissions'),
558
  $addRemoveButton = $(this).find('.sbi_ca_actions .button-primary').first();
559
  $(this).removeClass('sbi_account_updated');
560
+ $addRemoveButton.prop('disabled',false);
561
 
562
  if (targetClass === 'tagged' && (type === 'personal' || permissions !== 'tagged')) {
563
  $addRemoveButton.show();
566
  } else {
567
  $addRemoveButton.html('Reconnect Account');
568
  }
569
+ $addRemoveButton.prop('disabled',true).addClass('sbi_remove_from_user_feed').removeClass('sbi_use_in_user_feed');
570
  $(this).removeClass('sbi_account_active');
571
  } else if (targetClass === 'hashtag') {
572
  $addRemoveButton.hide();
573
+ $addRemoveButton.prop('disabled',true).addClass('sbi_remove_from_user_feed').removeClass('sbi_use_in_user_feed');
574
  $(this).removeClass('sbi_account_active');
575
  } else {
576
  $addRemoveButton.show();
598
  });
599
  }sbiConAccountsAddRemoveUpdater();
600
 
601
+ $('input[name=sb_instagram_type]').on('change',sbiConAccountsAddRemoveUpdater);
602
 
603
 
604
 
606
  jQuery(this).closest('.sbi_ca_info').find('.sbi_ca_accesstoken').slideToggle(200);
607
  });
608
 
609
+ $('#sbi_manual_submit').on('click',function(event) {
610
  event.preventDefault();
611
  var $self = $(this);
612
  var accessToken = $('#sb_manual_at').val(),
624
  $('.sbi_manually_connect_wrap').show().prepend('<div class="sbi_user_id_error" style="display:block;">Please enter a valid access token</div>');
625
  }
626
  } else if (! error) {
627
+ $(this).prop('disabled',true);
628
  $(this).closest('.sbi_manually_connect_wrap').fadeOut();
629
  $('.sbi_connected_accounts_wrap').fadeTo("slow" , 0.5).find('.sbi_user_id_error').remove();
630
 
639
  },
640
  success: function (data) {
641
  $('.sbi_connected_accounts_wrap').fadeTo("slow" , 1);
642
+ $self.prop('disabled',false);
643
  if ( data.indexOf('{') > -1) {
644
  var savedToken = JSON.parse(data);
645
  if (typeof savedToken.url !== 'undefined') {
664
  // clear resized
665
  var $sbiClearResizedButton = $('#sbi_reset_resized');
666
 
667
+ $sbiClearResizedButton.on('click',function(event) {
668
  event.preventDefault();
669
 
670
  jQuery('#sbi-clear-cache-success').remove();
696
  jQuery('.sbi-caching-cron-options').show();
697
  }
698
 
699
+ $('input[type=radio][name=sbi_caching_type]').on('change',function() {
700
  if (this.value == 'page') {
701
  jQuery('.sbi-caching-cron-options').slideUp();
702
  jQuery('.sbi-caching-page-options').slideDown();
715
  //Should we show anything initially?
716
  if(sbi_cache_cron_interval == '30mins' || sbi_cache_cron_interval == '1hour') $sbi_caching_time_settings.hide();
717
 
718
+ jQuery('#sbi_cache_cron_interval').on('change',function(){
719
  sbi_cache_cron_interval = jQuery('#sbi_cache_cron_interval').val();
720
 
721
  if(sbi_cache_cron_interval == '30mins' || sbi_cache_cron_interval == '1hour'){
734
 
735
 
736
  //clear backup caches
737
+ jQuery('#sbi_clear_backups').on('click',function(event) {
738
  jQuery('.sbi-success').remove();
739
  event.preventDefault();
740
  jQuery.ajax({
755
  //sbi_reset_log
756
  var $sbiClearLog = $('#sbi_reset_log');
757
 
758
+ $sbiClearLog.on('click',function(event) {
759
  event.preventDefault();
760
 
761
  jQuery('#sbi-clear-cache-success').remove();
778
  }); // ajax call
779
  }); // clear_comment_cache click
780
 
781
+ $('.sb-opt-in').on('click',function(event) {
782
  event.preventDefault();
783
 
784
  var $btn = jQuery(this);
787
  sbiSubmitOptIn(true);
788
  }); // clear_comment_cache click
789
 
790
+ jQuery('#sbi-oembed-disable').on('click',function(e) {
791
  e.preventDefault();
792
  jQuery(this).addClass( 'loading' ).html('<i class="fa fa-spinner fa-spin" aria-hidden="true"></i>');
793
  jQuery.ajax({
803
  });
804
  });
805
 
806
+ $('.sb-no-usage-opt-out').on('click',function(event) {
807
  event.preventDefault();
808
 
809
  var $btn = jQuery(this);
839
  });
840
 
841
  //Shortcode labels
842
+ jQuery('#sbi_admin label').on('click',function(){
843
  var $sbi_shortcode = jQuery(this).siblings('.sbi_shortcode');
844
  var $el = jQuery(this).parent();
845
 
851
  $el.find('.sbi_shortcode').css('display','block');
852
  }
853
  });
854
+
855
+ jQuery('#sbi_admin label').on('mouseenter mouseleave', function(e) {
856
+ switch(e.type) {
857
+ case 'mouseenter':
858
+ if( jQuery(this).siblings('.sbi_shortcode').length > 0 ){
859
+ jQuery(this).attr('title', 'Click for shortcode option').append('<code class="sbi_shortcode_symbol">[]</code>');
860
+ }
861
+ break;
862
+ case 'mouseleave':
863
+ jQuery(this).find('.sbi_shortcode_symbol').remove();
864
+ break;
865
  }
 
 
866
  });
867
 
868
+ jQuery('#sbi_admin .sbi_lock').on('mouseenter mouseleave', function(e) {
869
+ switch(e.type) {
870
+ case 'mouseenter':
871
+ jQuery(this).siblings('.sbi_pro_tooltip').show();
872
+ break;
873
+ case 'mouseleave':
874
+ jQuery('.sbi_pro_tooltip').hide();
875
+ break;
876
+ }
877
  });
878
+
 
 
 
879
  //Add the color picker
880
  if( jQuery('.sbi_colorpick').length > 0 ) jQuery('.sbi_colorpick').wpColorPicker();
881
 
882
  //Check User ID is numeric
883
+ jQuery("#sb_instagram_user_id").on('change',function() {
884
 
885
  var sbi_user_id = jQuery('#sb_instagram_user_id').val(),
886
  $sbi_user_id_error = $(this).closest('td').find('.sbi_user_id_error'),
918
  //Show initially if a width is set
919
  if( (sb_instagram_feed_width.length > 1 && sb_instagram_width_unit == 'px') || (sb_instagram_feed_width !== '100' && sb_instagram_width_unit == '%') ) $sb_instagram_width_options.show();
920
 
921
+ jQuery('#sbi_admin #sb_instagram_width, #sbi_admin #sb_instagram_width_unit').on('change',function(){
922
  sb_instagram_feed_width = jQuery('#sbi_admin #sb_instagram_width').val();
923
  sb_instagram_width_unit = jQuery('#sbi_admin #sb_instagram_width_unit').val();
924
 
932
  }
933
 
934
  //Scroll to hash for quick links
935
+ jQuery('#sbi_admin a').on('click',function() {
936
  if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
937
  var target = jQuery(this.hash);
938
  target = target.length ? target : this.hash.slice(1);
962
  jQuery('.sb_instagram_layout_settings.sbi_layout_type_'+jQuery('.sb_layout_type:checked').val()).show();
963
  }, 1);
964
  }
965
+ jQuery('.sb_layout_type').on('change',sbiUpdateLayoutTypeOptionsDisplay);
966
 
967
  jQuery('.sbi_close_options').on('click', function(){
968
  jQuery('.sb_instagram_layout_settings').hide();
982
 
983
  }
984
  sbiUpdateHighlightOptionsDisplay();
985
+ jQuery('#sb_instagram_highlight_type').on('change',sbiUpdateHighlightOptionsDisplay);
986
 
987
  //sb_instagram_enable_email_report
988
  function sbiToggleEmail() {
992
  jQuery('#sb_instagram_enable_email_report').closest('td').find('.sb_instagram_box').slideUp();
993
  }
994
  }sbiToggleEmail();
995
+ jQuery('#sb_instagram_enable_email_report').on('change',sbiToggleEmail);
996
  if (jQuery('#sbi-goto').length) {
997
  jQuery('#sbi-goto').closest('tr').addClass('sbi-goto');
998
  $('html, body').animate({
1014
  });
1015
 
1016
  //Selecting a post layout
1017
+ jQuery('.sbi_layout_cell').on('click',function(){
1018
  var $self = jQuery(this);
1019
  $('.sb_layout_type').trigger('change');
1020
+ $self.addClass('sbi_layout_selected').find('.sb_layout_type').prop('checked',true);
1021
  $self.siblings().removeClass('sbi_layout_selected');
1022
  });
1023
 
1024
  setTimeout( function() {
1025
+ jQuery('.notice-dismiss').on('click',function() {
1026
  if (jQuery(this).closest('.sbi-admin-notice').length) {
1027
 
1028
  if (jQuery(this).closest('.sbi-admin-notice').find('.sbi-admin-error').length) {
1065
  jQuery('#sbi-notice-bar').show();
1066
  }
1067
 
1068
+ jQuery('#sbi-notice-bar .dismiss').on('click',function(e) {
1069
  e.preventDefault();
1070
  jQuery('#sbi-notice-bar').remove();
1071
  jQuery.ajax({
1086
 
1087
  /* Clear errors visit page */
1088
  jQuery('.sbi-error-directions a').addClass('button button-primary');
1089
+ jQuery('.sbi-error-directions.sbi-reconnect a').on('click',function(){
1090
  event.preventDefault();
1091
  jQuery('.sbi_admin_btn').trigger('click');
1092
  });
1093
  jQuery('.sbi-clear-errors-visit-page').appendTo('.sbi-error-directions');
1094
+ jQuery('.sbi-clear-errors-visit-page').on('click',function(event) {
1095
  event.preventDefault();
1096
  var $btn = jQuery(this);
1097
  $btn.prop( 'disabled', true ).addClass( 'loading' ).html('<i class="fa fa-spinner fa-spin" aria-hidden="true"></i>');
1135
  $('.sb_cross_install_modal .addons-container').load($get_plugins_url+'admin.php?page=sb-instagram-feed&tab=more #install_'+sb_get_plugin);
1136
  });
1137
 
1138
+ jQuery('.sbi-need-to-connect').on('click',function(e) {
1139
  e.preventDefault();
1140
 
1141
  jQuery('#sbi_config_info').show();
1166
  sbiCheckGdprSetting();
1167
 
1168
  // Locator
1169
+ jQuery('.sbi-locator-more').on('click',function(e) {
1170
  e.preventDefault();
1171
  jQuery(this).closest('td').find('.sbi-full-wrap').show();
1172
  jQuery(this).closest('td').find('.sbi-condensed-wrap').hide();
js/sbi-scripts.js CHANGED
@@ -220,10 +220,15 @@ if(!sbi_js_exists) {
220
  // enable header hover action
221
  $('.sb_instagram_header').each(function () {
222
  var $thisHeader = $(this);
223
- $thisHeader.find('.sbi_header_link').hover(function () {
224
- $thisHeader.find('.sbi_header_img_hover').addClass('sbi_fade_in');
225
- }, function () {
226
- $thisHeader.find('.sbi_header_img_hover').removeClass('sbi_fade_in');
 
 
 
 
 
227
  });
228
  });
229
 
@@ -283,7 +288,7 @@ if(!sbi_js_exists) {
283
  sbi_timer = setTimeout(sbi_callback, sbi_ms);
284
  };
285
  })();
286
- jQuery(window).resize(function () {
287
  sbi_delay(function () {
288
  feed.afterResize();
289
  }, 500);
@@ -349,11 +354,15 @@ if(!sbi_js_exists) {
349
  var $self = jQuery(this);
350
 
351
  //Photo links
352
- //If lightbox is disabled
353
- $self.find('.sbi_photo').hover(function () {
354
- jQuery(this).fadeTo(200, 0.85);
355
- }, function () {
356
- jQuery(this).stop().fadeTo(500, 1);
 
 
 
 
357
  });
358
  }); //End .sbi_item each
359
 
@@ -1057,7 +1066,7 @@ if(!sbi_js_exists) {
1057
  sbi_init();
1058
 
1059
  // Cookie Notice by dFactory
1060
- $('#cookie-notice a').click(function() {
1061
  setTimeout(function() {
1062
  $.each(window.sbi.feeds,function(index){
1063
  window.sbi.feeds[ index ].afterConsentToggled();
@@ -1066,7 +1075,7 @@ if(!sbi_js_exists) {
1066
  });
1067
 
1068
  // GDPR Cookie Consent by WebToffee
1069
- $('#cookie-law-info-bar a').click(function() {
1070
  setTimeout(function() {
1071
  $.each(window.sbi.feeds,function(index){
1072
  window.sbi.feeds[ index ].afterConsentToggled();
@@ -1075,7 +1084,7 @@ if(!sbi_js_exists) {
1075
  });
1076
 
1077
  // GDPR Cookie Consent by WebToffee
1078
- $('.cli-user-preference-checkbox').click(function(){
1079
  setTimeout(function() {
1080
  $.each(window.sbi.feeds,function(index){
1081
  window.sbi.feeds[ index ].settings.consentGiven = false;
220
  // enable header hover action
221
  $('.sb_instagram_header').each(function () {
222
  var $thisHeader = $(this);
223
+ $thisHeader.find('.sbi_header_link').on('mouseenter mouseleave', function(e) {
224
+ switch(e.type) {
225
+ case 'mouseenter':
226
+ $thisHeader.find('.sbi_header_img_hover').addClass('sbi_fade_in');
227
+ break;
228
+ case 'mouseleave':
229
+ $thisHeader.find('.sbi_header_img_hover').removeClass('sbi_fade_in');
230
+ break;
231
+ }
232
  });
233
  });
234
 
288
  sbi_timer = setTimeout(sbi_callback, sbi_ms);
289
  };
290
  })();
291
+ jQuery(window).on('resize',function () {
292
  sbi_delay(function () {
293
  feed.afterResize();
294
  }, 500);
354
  var $self = jQuery(this);
355
 
356
  //Photo links
357
+ $self.find('.sbi_photo').on('mouseenter mouseleave', function(e) {
358
+ switch(e.type) {
359
+ case 'mouseenter':
360
+ jQuery(this).fadeTo(200, 0.85);
361
+ break;
362
+ case 'mouseleave':
363
+ jQuery(this).stop().fadeTo(500, 1);
364
+ break;
365
+ }
366
  });
367
  }); //End .sbi_item each
368
 
1066
  sbi_init();
1067
 
1068
  // Cookie Notice by dFactory
1069
+ $('#cookie-notice a').on('click',function() {
1070
  setTimeout(function() {
1071
  $.each(window.sbi.feeds,function(index){
1072
  window.sbi.feeds[ index ].afterConsentToggled();
1075
  });
1076
 
1077
  // GDPR Cookie Consent by WebToffee
1078
+ $('#cookie-law-info-bar a').on('click',function() {
1079
  setTimeout(function() {
1080
  $.each(window.sbi.feeds,function(index){
1081
  window.sbi.feeds[ index ].afterConsentToggled();
1084
  });
1085
 
1086
  // GDPR Cookie Consent by WebToffee
1087
+ $('.cli-user-preference-checkbox').on('click',function(){
1088
  setTimeout(function() {
1089
  $.each(window.sbi.feeds,function(index){
1090
  window.sbi.feeds[ index ].settings.consentGiven = false;
js/sbi-scripts.min.js CHANGED
@@ -1 +1 @@
1
- var sbi_js_exists=void 0!==sbi_js_exists;sbi_js_exists||(!function(i){function e(){var i,e,t,s=s||{VER:"0.9.944"};s.bgs_Available=!1,s.bgs_CheckRunned=!1,function(i){i.fn.extend({sbi_imgLiquid:function(e){this.defaults={fill:!0,verticalAlign:"center",horizontalAlign:"center",useBackgroundSize:!0,useDataHtmlAttr:!0,responsive:!0,delay:0,fadeInTime:0,removeBoxBackground:!0,hardPixels:!0,responsiveCheckTime:500,timecheckvisibility:500,onStart:null,onFinish:null,onItemStart:null,onItemFinish:null,onItemError:null},function(){if(!s.bgs_CheckRunned){s.bgs_CheckRunned=!0;var e=i('<span style="background-size:cover" />');i("body").append(e),function(){var i=e[0];if(i&&window.getComputedStyle){var t=window.getComputedStyle(i,null);t&&t.backgroundSize&&(s.bgs_Available="cover"===t.backgroundSize)}}(),e.remove()}}();var t=this;return this.options=e,this.settings=i.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(e){function n(){(r.responsive||h.data("sbi_imgLiquid_oldProcessed"))&&h.data("sbi_imgLiquid_settings")&&(r=h.data("sbi_imgLiquid_settings"),l.actualSize=l.get(0).offsetWidth+l.get(0).offsetHeight/1e4,l.sizeOld&&l.actualSize!==l.sizeOld&&o(),l.sizeOld=l.actualSize,setTimeout(n,r.responsiveCheckTime))}function a(){h.data("sbi_imgLiquid_error",!0),l.addClass("sbi_imgLiquid_error"),r.onItemError&&r.onItemError(e,l,h),d()}function o(){var i,t,s,n,a,o,g,c,f=0,u=0,b=l.width(),_=l.height();void 0===h.data("owidth")&&h.data("owidth",h[0].width),void 0===h.data("oheight")&&h.data("oheight",h[0].height),r.fill===b/_>=h.data("owidth")/h.data("oheight")?(i="100%",t="auto",s=Math.floor(b),n=Math.floor(b*(h.data("oheight")/h.data("owidth")))):(i="auto",t="100%",s=Math.floor(_*(h.data("owidth")/h.data("oheight"))),n=Math.floor(_)),g=b-s,"left"===(a=r.horizontalAlign.toLowerCase())&&(u=0),"center"===a&&(u=.5*g),"right"===a&&(u=g),-1!==a.indexOf("%")&&((a=parseInt(a.replace("%",""),10))>0&&(u=g*a*.01)),c=_-n,"left"===(o=r.verticalAlign.toLowerCase())&&(f=0),"center"===o&&(f=.5*c),"bottom"===o&&(f=c),-1!==o.indexOf("%")&&((o=parseInt(o.replace("%",""),10))>0&&(f=c*o*.01)),r.hardPixels&&(i=s,t=n),h.css({width:i,height:t,"margin-left":Math.floor(u),"margin-top":Math.floor(f)}),h.data("sbi_imgLiquid_oldProcessed")||(h.fadeTo(r.fadeInTime,1),h.data("sbi_imgLiquid_oldProcessed",!0),r.removeBoxBackground&&l.css("background-image","none"),l.addClass("sbi_imgLiquid_nobgSize"),l.addClass("sbi_imgLiquid_ready")),r.onItemFinish&&r.onItemFinish(e,l,h),d()}function d(){e===t.length-1&&t.settings.onFinish&&t.settings.onFinish()}var r=t.settings,l=i(this),h=i("img:first",l);return h.length?(h.data("sbi_imgLiquid_settings")?(l.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),r=i.extend({},h.data("sbi_imgLiquid_settings"),t.options)):r=i.extend({},t.settings,function(){var i={};if(t.settings.useDataHtmlAttr){var e=l.attr("data-sbi_imgLiquid-fill"),n=l.attr("data-sbi_imgLiquid-horizontalAlign"),a=l.attr("data-sbi_imgLiquid-verticalAlign");("true"===e||"false"===e)&&(i.fill=Boolean("true"===e)),void 0===n||"left"!==n&&"center"!==n&&"right"!==n&&-1===n.indexOf("%")||(i.horizontalAlign=n),void 0===a||"top"!==a&&"bottom"!==a&&"center"!==a&&-1===a.indexOf("%")||(i.verticalAlign=a)}return s.isIE&&t.settings.ieFadeInDisabled&&(i.fadeInTime=0),i}()),h.data("sbi_imgLiquid_settings",r),r.onItemStart&&r.onItemStart(e,l,h),void(s.bgs_Available&&r.useBackgroundSize?(-1===l.css("background-image").indexOf(encodeURI(h.attr("src")))&&l.css({"background-image":'url("'+encodeURI(h.attr("src"))+'")'}),l.css({"background-size":r.fill?"cover":"contain","background-position":(r.horizontalAlign+" "+r.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),i("a:first",l).css({display:"block",width:"100%",height:"100%"}),i("img",l).css({display:"none"}),r.onItemFinish&&r.onItemFinish(e,l,h),l.addClass("sbi_imgLiquid_bgSize"),l.addClass("sbi_imgLiquid_ready"),d()):function t(){if(h.data("oldSrc")&&h.data("oldSrc")!==h.attr("src")){var s=h.clone().removeAttr("style");return s.data("sbi_imgLiquid_settings",h.data("sbi_imgLiquid_settings")),h.parent().prepend(s),h.remove(),(h=s)[0].width=0,void setTimeout(t,10)}return h.data("sbi_imgLiquid_oldProcessed")?void o():(h.data("sbi_imgLiquid_oldProcessed",!1),h.data("oldSrc",h.attr("src")),i("img:not(:first)",l).css("display","none"),l.css({overflow:"hidden"}),h.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),h.on("error",a),h[0].onerror=a,function i(){h.data("sbi_imgLiquid_error")||h.data("sbi_imgLiquid_loaded")||h.data("sbi_imgLiquid_oldProcessed")||(l.is(":visible")&&h[0].complete&&h[0].width>0&&h[0].height>0?(h.data("sbi_imgLiquid_loaded",!0),setTimeout(o,e*r.delay)):setTimeout(i,r.timecheckvisibility))}(),void n())}())):void a()})}})}(jQuery),i=s.injectCss,e=document.getElementsByTagName("head")[0],(t=document.createElement("style")).type="text/css",t.styleSheet?t.styleSheet.cssText=i:t.appendChild(document.createTextNode(i)),e.appendChild(t)}function t(){this.feeds={},this.options=sb_instagram_js_options}function s(i,e,t){this.el=i,this.index=e,this.settings=t,this.minImageWidth=0,this.imageResolution=150,this.resizedImages={},this.needsResizing=[],this.outOfPages=!1,this.page=1,this.isInitialized=!1}function n(e,t){i.ajax({url:sbiajaxurl,type:"post",data:e,success:t})}t.prototype={createPage:function(e,t){void 0!==window.sbiajaxurl&&-1!==window.sbiajaxurl.indexOf(window.location.hostname)||(window.sbiajaxurl=location.protocol+"//"+window.location.hostname+"/wp-admin/admin-ajax.php"),i(".sbi_no_js_error_message").remove(),i(".sbi_no_js").removeClass("sbi_no_js"),e(t)},createFeeds:function(e){e.whenFeedsCreated(i(".sbi").each(function(e){i(this).attr("data-sbi-index",e+1);var t=i(this),a=void 0!==t.attr("data-sbi-flags")?t.attr("data-sbi-flags").split(","):[],o=void 0!==t.attr("data-options")?JSON.parse(t.attr("data-options")):{};if(a.indexOf("testAjax")>-1){window.sbi.triggeredTest=!0;n({action:"sbi_on_ajax_test_trigger"},function(i){console.log("did test")})}var d={cols:t.attr("data-cols"),colsmobile:void 0!==t.attr("data-colsmobile")&&"same"!==t.attr("data-colsmobile")?t.attr("data-colsmobile"):t.attr("data-cols"),num:t.attr("data-num"),imgRes:t.attr("data-res"),feedID:t.attr("data-feedid"),postID:"undefind"!=typeof t.attr("data-postid")?t.attr("data-postid"):"unknown",shortCodeAtts:t.attr("data-shortcode-atts"),resizingEnabled:-1===a.indexOf("resizeDisable"),imageLoadEnabled:-1===a.indexOf("imageLoadDisable"),debugEnabled:a.indexOf("debug")>-1,favorLocal:a.indexOf("favorLocal")>-1,ajaxPostLoad:a.indexOf("ajaxPostLoad")>-1,gdpr:a.indexOf("gdpr")>-1,overrideBlockCDN:a.indexOf("overrideBlockCDN")>-1,consentGiven:!1,locator:a.indexOf("locator")>-1,autoMinRes:1,general:o};window.sbi.feeds[e]=function(i,e,t){return new s(i,e,t)}(this,e,d),window.sbi.feeds[e].setResizedImages(),window.sbi.feeds[e].init();var r=jQuery.Event("sbiafterfeedcreate");r.feed=window.sbi.feeds[e],jQuery(window).trigger(r)}))},afterFeedsCreated:function(){i(".sb_instagram_header").each(function(){var e=i(this);e.find(".sbi_header_link").hover(function(){e.find(".sbi_header_img_hover").addClass("sbi_fade_in")},function(){e.find(".sbi_header_img_hover").removeClass("sbi_fade_in")})})},encodeHTML:function(i){return void 0===i?"":i.replace(/(>)/g,"&gt;").replace(/(<)/g,"&lt;").replace(/(&lt;br\/&gt;)/g,"<br>").replace(/(&lt;br&gt;)/g,"<br>")},urlDetect:function(i){return i.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/g)}},s.prototype={init:function(){var e=this;e.settings.consentGiven=e.checkConsent(),i(this.el).find(".sbi_photo").parent("p").length&&i(this.el).addClass("sbi_no_autop"),i(this.el).find("#sbi_mod_error").length&&i(this.el).prepend(i(this.el).find("#sbi_mod_error")),this.settings.ajaxPostLoad?this.getNewPostSet():this.afterInitialImagesLoaded();var t,s=(t=0,function(i,e){clearTimeout(t),t=setTimeout(i,e)});jQuery(window).resize(function(){s(function(){e.afterResize()},500)}),i(this.el).find(".sbi_item").each(function(){e.lazyLoadCheck(i(this))})},initLayout:function(){},afterInitialImagesLoaded:function(){this.initLayout(),this.loadMoreButtonInit(),this.hideExtraImagesForWidth(),this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed()},afterResize:function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass()},afterLoadMoreClicked:function(i){i.find(".sbi_loader").removeClass("sbi_hidden"),i.find(".sbi_btn_text").addClass("sbi_hidden"),i.closest(".sbi").find(".sbi_num_diff_hide").addClass("sbi_transition").removeClass("sbi_num_diff_hide")},afterNewImagesLoaded:function(){var e=i(this.el),t=this;this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),setTimeout(function(){e.find(".sbi_loader").addClass("sbi_hidden"),e.find(".sbi_btn_text").removeClass("sbi_hidden"),t.maybeRaiseImageResolution()},500)},beforeNewImagesRevealed:function(){this.setImageHeight(),this.maybeRaiseImageResolution(!0),this.setImageSizeClass()},revealNewImages:function(){var e=i(this.el);e.find(".sbi-screenreader").each(function(){i(this).find("img").remove()}),"function"==typeof sbi_custom_js&&setTimeout(function(){sbi_custom_js()},100),this.applyImageLiquid(),e.find(".sbi_item").each(function(i){jQuery(this).find(".sbi_photo").hover(function(){jQuery(this).fadeTo(200,.85)},function(){jQuery(this).stop().fadeTo(500,1)})}),setTimeout(function(){jQuery("#sbi_images .sbi_item.sbi_new").removeClass("sbi_new");var i=10;e.find(".sbi_transition").each(function(){var e=jQuery(this);setTimeout(function(){e.removeClass("sbi_transition")},i),i+=10})},500)},lazyLoadCheck:function(e){if(e.find(".sbi_photo").length&&!e.closest(".sbi").hasClass("sbi-no-ll-check")){var t=this.getImageUrls(e),s=void 0!==t[640]?t[640]:e.find(".sbi_photo").attr("data-full-res");if(!this.settings.consentGiven&&s.indexOf("scontent")>-1)return;e.find(".sbi_photo img").each(function(){s&&void 0!==i(this).attr("data-src")&&i(this).attr("data-src",s),s&&void 0!==i(this).attr("data-orig-src")&&i(this).attr("data-orig-src",s),i(this).on("load",function(){!i(this).hasClass("sbi-replaced")&&i(this).attr("src").indexOf("placeholder")>-1&&(i(this).addClass("sbi-replaced"),s&&(i(this).attr("src",s),i(this).closest(".sbi_imgLiquid_bgSize").length&&i(this).closest(".sbi_imgLiquid_bgSize").css("background-image","url("+s+")")))})})}},afterNewImagesRevealed:function(){this.listenForVisibilityChange(),this.sendNeedsResizingToServer(),this.settings.imageLoadEnabled||i(".sbi_no_resraise").removeClass("sbi_no_resraise");var e=i.Event("sbiafterimagesloaded");e.el=i(this.el),i(window).trigger(e)},setResizedImages:function(){i(this.el).find(".sbi_resized_image_data").length&&void 0!==i(this.el).find(".sbi_resized_image_data").attr("data-resized")&&0===i(this.el).find(".sbi_resized_image_data").attr("data-resized").indexOf('{"')&&(this.resizedImages=JSON.parse(i(this.el).find(".sbi_resized_image_data").attr("data-resized")),i(this.el).find(".sbi_resized_image_data").remove())},sendNeedsResizingToServer:function(){var e=this;if(e.needsResizing.length>0&&e.settings.resizingEnabled){var t=i(this.el).find(".sbi_item").length,s=void 0!==e.settings.general.cache_all&&e.settings.general.cache_all;n({action:"sbi_resized_images_submit",needs_resizing:e.needsResizing,offset:t,feed_id:e.settings.feedID,atts:e.settings.shortCodeAtts,location:e.locationGuess(),post_id:e.settings.postID,cache_all:s},function(i){if(0===i.trim().indexOf("{")){var t=JSON.parse(i);for(var s in e.settings.debugEnabled&&console.log(t),t)t.hasOwnProperty(s)&&(e.resizedImages[s]=t[s]);e.maybeRaiseImageResolution(),setTimeout(function(){e.afterResize()},500)}})}else if(e.settings.locator){n({action:"sbi_do_locator",feed_id:e.settings.feedID,atts:e.settings.shortCodeAtts,location:e.locationGuess(),post_id:e.settings.postID},function(i){})}},loadMoreButtonInit:function(){var e=i(this.el),t=this;e.find("#sbi_load .sbi_load_btn").off().on("click",function(){t.afterLoadMoreClicked(jQuery(this)),t.getNewPostSet()})},getNewPostSet:function(){var e=i(this.el),t=this;t.page++;n({action:"sbi_load_more_clicked",offset:e.find(".sbi_item").length,page:t.page,feed_id:t.settings.feedID,atts:t.settings.shortCodeAtts,location:t.locationGuess(),post_id:t.settings.postID,current_resolution:t.imageResolution},function(s){if(0===s.trim().indexOf("{")){var n=JSON.parse(s);t.settings.debugEnabled&&console.log(n),t.appendNewPosts(n.html),t.addResizedImages(n.resizedImages),t.settings.ajaxPostLoad?(t.settings.ajaxPostLoad=!1,t.afterInitialImagesLoaded()):t.afterNewImagesLoaded(),n.feedStatus.shouldPaginate?t.outOfPages=!1:(t.outOfPages=!0,e.find(".sbi_load_btn").hide()),i(".sbi_no_js").removeClass("sbi_no_js")}})},appendNewPosts:function(e){var t=i(this.el);t.find("#sbi_images .sbi_item").length?t.find("#sbi_images .sbi_item").last().after(e):t.find("#sbi_images").append(e)},addResizedImages:function(i){for(var e in i)this.resizedImages[e]=i[e]},setImageHeight:function(){var e=i(this.el),t=e.find(".sbi_photo").eq(0).innerWidth(),s=this.getColumnCount(),n=e.find("#sbi_images").innerWidth()-e.find("#sbi_images").width(),a=n/2;sbi_photo_width_manual=e.find("#sbi_images").width()/s-n,e.find(".sbi_photo").css("height",t),e.find(".sbi-owl-nav").length&&setTimeout(function(){var i=2;e.find(".sbi_owl2row-item").length&&(i=1);var t=e.find(".sbi_photo").eq(0).innerWidth()/i;t+=parseInt(a)*(2-i+2),e.find(".sbi-owl-nav div").css("top",t)},100)},maybeRaiseSingleImageResolution:function(e,t,s){var n=this,a=n.getImageUrls(e),o=e.find(".sbi_photo img").attr("src"),d=150,r=e.find("img").get(0),l=o===window.sbi.options.placeholder?1:r.naturalWidth/r.naturalHeight;s=void 0!==s&&s;if(!(e.hasClass("sbi_no_resraise")||e.hasClass("sbi_had_error")||e.find(".sbi_link_area").length&&e.find(".sbi_link_area").hasClass("sbi_had_error")))if(a.length<1)e.find(".sbi_link_area").length&&e.find(".sbi_link_area").attr("href",window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png"));else{(e.find(".sbi_link_area").length&&e.find(".sbi_link_area").attr("href")===window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png")||!n.settings.consentGiven)&&e.find(".sbi_link_area").attr("href",a[a.length-1]),void 0!==a[640]&&e.find(".sbi_photo").attr("data-full-res",a[640]),i.each(a,function(i,e){e===o&&(d=parseInt(i),s=!1)});var h=640;switch(n.settings.imgRes){case"thumb":h=150;break;case"medium":h=320;break;case"full":h=640;break;default:var g=Math.max(n.settings.autoMinRes,e.find(".sbi_photo").innerWidth()),c=n.getBestResolutionForAuto(g,l,e);switch(c){case 320:h=320;break;case 150:h=150}}if(h>d||o===window.sbi.options.placeholder||s){if(n.settings.debugEnabled){var f=o===window.sbi.options.placeholder?"was placeholder":"too small";console.log("rais res for "+o,f)}var u=a[h].split("?ig_cache_key")[0];if(o!==u&&(e.find(".sbi_photo img").attr("src",u),e.find(".sbi_photo").css("background-image",'url("'+u+'")')),d=h,"auto"===n.settings.imgRes){var b=!1;e.find(".sbi_photo img").on("load",function(){var t=i(this),s=t.get(0).naturalWidth/t.get(0).naturalHeight;if(1e3!==t.get(0).naturalWidth&&s>l&&!b){switch(n.settings.debugEnabled&&console.log("rais res again for aspect ratio change "+o),b=!0,g=e.find(".sbi_photo").innerWidth(),c=n.getBestResolutionForAuto(g,s,e),h=640,c){case 320:h=320;break;case 150:h=150}h>d&&(u=a[h].split("?ig_cache_key")[0],t.attr("src",u),t.closest(".sbi_photo").css("background-image",'url("'+u+'")')),"masonry"!==n.layout&&"highlight"!==n.layout||(i(n.el).find("#sbi_images").smashotope(n.isotopeArgs),setTimeout(function(){i(n.el).find("#sbi_images").smashotope(n.isotopeArgs)},500))}else if(n.settings.debugEnabled){var r=b?"already checked":"no aspect ratio change";console.log("not raising res for replacement "+o,r)}})}}e.find("img").on("error",function(){if(i(this).hasClass("sbi_img_error"))console.log("unfixed error "+i(this).attr("src"));else{var e;if(i(this).addClass("sbi_img_error"),!(i(this).attr("src").indexOf("media/?size=")>-1||i(this).attr("src").indexOf("cdninstagram")>-1||i(this).attr("src").indexOf("fbcdn")>-1)&&n.settings.consentGiven){if("undefined"!==i(this).closest(".sbi_photo").attr("data-img-src-set"))void 0!==(e=JSON.parse(i(this).closest(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/"))).d&&(i(this).attr("src",e.d),i(this).closest(".sbi_photo").css("background-image","url("+e.d+")"),i(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",e[640]).addClass("sbi_had_error"))}else n.settings.favorLocal=!0,void 0!==(e=n.getImageUrls(i(this).closest(".sbi_item")))[640]&&(i(this).attr("src",e[640]),i(this).closest(".sbi_photo").css("background-image","url("+e[640]+")"),i(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",e[640]).addClass("sbi_had_error"));setTimeout(function(){n.afterResize()},1500)}})}},maybeRaiseImageResolution:function(e){var t=this,s=void 0!==e&&!0===e?".sbi_item.sbi_new":".sbi_item",n=!t.isInitialized;i(t.el).find(s).each(function(e){!i(this).hasClass("sbi_num_diff_hide")&&i(this).find(".sbi_photo").length&&void 0!==i(this).find(".sbi_photo").attr("data-img-src-set")&&t.maybeRaiseSingleImageResolution(i(this),e,n)}),t.isInitialized=!0},getBestResolutionForAuto:function(e,t,s){(isNaN(t)||t<1)&&(t=1);var n=e*t,a=10*Math.ceil(n/10),o=[150,320,640];if(s.hasClass("sbi_highlighted")&&(a*=2),-1===o.indexOf(parseInt(a))){var d=!1;i.each(o,function(i,e){e>parseInt(a)&&!d&&(a=e,d=!0)})}return a},hideExtraImagesForWidth:function(){if("carousel"!==this.layout){var e=i(this.el),t=void 0!==e.attr("data-num")&&""!==e.attr("data-num")?parseInt(e.attr("data-num")):1,s=void 0!==e.attr("data-nummobile")&&""!==e.attr("data-nummobile")?parseInt(e.attr("data-nummobile")):t;i(window).width()<480?s<e.find(".sbi_item").length&&e.find(".sbi_item").slice(s-e.find(".sbi_item").length).addClass("sbi_num_diff_hide"):t<e.find(".sbi_item").length&&e.find(".sbi_item").slice(t-e.find(".sbi_item").length).addClass("sbi_num_diff_hide")}},setImageSizeClass:function(){var e=i(this.el);e.removeClass("sbi_small sbi_medium");var t=e.innerWidth(),s=parseInt(e.find("#sbi_images").outerWidth()-e.find("#sbi_images").width())/2,n=this.getColumnCount(),a=(t-s*(n+2))/n;a>120&&a<240?e.addClass("sbi_medium"):a<=120&&e.addClass("sbi_small")},setMinImageWidth:function(){i(this.el).find(".sbi_item .sbi_photo").first().length?this.minImageWidth=i(this.el).find(".sbi_item .sbi_photo").first().innerWidth():this.minImageWidth=150},setImageResolution:function(){if("auto"===this.settings.imgRes)this.imageResolution="auto";else switch(this.settings.imgRes){case"thumb":this.imageResolution=150;break;case"medium":this.imageResolution=320;break;default:this.imageResolution=640}},getImageUrls:function(i){var e=JSON.parse(i.find(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/")),t=i.attr("id").replace("sbi_","");if(this.settings.consentGiven||this.settings.overrideBlockCDN||(e=[]),void 0!==this.resizedImages[t]&&"video"!==this.resizedImages[t]&&"pending"!==this.resizedImages[t]&&"error"!==this.resizedImages[t].id&&"video"!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id){if(void 0!==this.resizedImages[t].sizes){var s=[];void 0!==this.resizedImages[t].sizes.full&&(e[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg",s.push(640)),void 0!==this.resizedImages[t].sizes.low&&(e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg",s.push(320)),void 0!==this.resizedImages[t].sizes.thumb&&(s.push(150),e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg"),this.settings.favorLocal&&(-1===s.indexOf(640)&&s.indexOf(320)>-1&&(e[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg"),-1===s.indexOf(320)&&(s.indexOf(640)>-1?e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg":s.indexOf(150)>-1&&(e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg")),-1===s.indexOf(150)&&(s.indexOf(320)>-1?e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg":s.indexOf(640)>-1&&(e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg")))}}else(void 0===this.resizedImages[t]||void 0!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id&&"error"!==this.resizedImages[t].id)&&this.addToNeedsResizing(t);return e},getAvatarUrl:function(i,e){if(""===i)return"";var t=this.settings.general.avatars;return"local"===(e=void 0!==e?e:"local")?void 0!==t["LCL"+i]&&1===parseInt(t["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":void 0!==t[i]?t[i]:"":void 0!==t[i]?t[i]:void 0!==t["LCL"+i]&&1===parseInt(t["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":""},addToNeedsResizing:function(i){-1===this.needsResizing.indexOf(i)&&this.needsResizing.push(i)},applyImageLiquid:function(){var t=i(this.el);e(),"function"==typeof t.find(".sbi_photo").sbi_imgLiquid&&t.find(".sbi_photo").sbi_imgLiquid({fill:!0})},listenForVisibilityChange:function(){var e,t,s,n=this;e=jQuery,t={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},s={sbiCheckVisibility:function(i,e){if(jQuery.contains(document,i[0])){var t=e.sbiPreviousVisibility,n=i.is(":visible");e.sbiPreviousVisibility=n,null==t?e.runOnLoad&&e.callback(i,n):t!==n&&e.callback(i,n),setTimeout(function(){s.sbiCheckVisibility(i,e)},e.frequency)}}},e.fn.sbiVisibilityChanged=function(i){var n=e.extend({},t,i);return this.each(function(){s.sbiCheckVisibility(e(this),n)})},"function"==typeof i(this.el).filter(":hidden").sbiVisibilityChanged&&i(this.el).filter(":hidden").sbiVisibilityChanged({callback:function(i,e){n.afterResize()},runOnLoad:!1})},getColumnCount:function(){var e=i(this.el),t=this.settings.cols,s=this.settings.colsmobile,n=t;return sbiWindowWidth=window.innerWidth,e.hasClass("sbi_mob_col_auto")?(sbiWindowWidth<640&&parseInt(t)>2&&parseInt(t)<7&&(n=2),sbiWindowWidth<640&&parseInt(t)>6&&parseInt(t)<11&&(n=4),sbiWindowWidth<=480&&parseInt(t)>2&&(n=1)):sbiWindowWidth<=480&&(n=s),parseInt(n)},checkConsent:function(){if(this.settings.consentGiven||!this.settings.gdpr)return!0;if("undefined"!=typeof CLI_Cookie)null!==CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)&&(this.settings.consentGiven="yes"===CLI_Cookie.read("cookielawinfo-checkbox-non-necessary"));else if(void 0!==window.cnArgs){var i=("; "+document.cookie).split("; cookie_notice_accepted=");if(2===i.length){var e=i.pop().split(";").shift();this.settings.consentGiven="true"===e}}else void 0!==window.cookieconsent?this.settings.consentGiven="allow"===function(i){for(var e=i+"=",t=window.document.cookie.split(";"),s=0;s<t.length;s++){var n=t[s].trim();if(0==n.indexOf(e))return n.substring(e.length,n.length)}return""}("complianz_consent_status"):void 0!==window.Cookiebot?this.settings.consentGiven=Cookiebot.consented:void 0!==window.BorlabsCookie&&(this.settings.consentGiven=window.BorlabsCookie.checkCookieConsent("instagram"));var t=jQuery.Event("sbicheckconsent");return t.feed=this,jQuery(window).trigger(t),this.settings.consentGiven},afterConsentToggled:function(){if(this.checkConsent()){var i=this;i.maybeRaiseImageResolution(),setTimeout(function(){i.afterResize()},500)}},locationGuess:function(){var e=i(this.el),t="content";return e.closest("footer").length?t="footer":e.closest(".header").length||e.closest("header").length?t="header":(e.closest(".sidebar").length||e.closest("aside").length)&&(t="sidebar"),t}},window.sbi_init=function(){window.sbi=new t,window.sbi.createPage(window.sbi.createFeeds,{whenFeedsCreated:window.sbi.afterFeedsCreated})}}(jQuery),jQuery(document).ready(function(i){void 0===window.sb_instagram_js_options&&(window.sb_instagram_js_options={font_method:"svg",resized_url:location.protocol+"//"+window.location.hostname+"/wp-content/uploads/sb-instagram-feed-images/",placeholder:location.protocol+"//"+window.location.hostname+"/wp-content/plugins/instagram-feed/img/placeholder.png"}),void 0!==window.sb_instagram_js_options.resized_url&&-1===window.sb_instagram_js_options.resized_url.indexOf(location.protocol)&&("http:"===location.protocol?window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("https:","http:"):window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("http:","https:")),sbi_init(),i("#cookie-notice a").click(function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i("#cookie-law-info-bar a").click(function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i(".cli-user-preference-checkbox").click(function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i(window).on("CookiebotOnAccept",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),i(document).on("cmplzAcceptAll",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),i(document).on("cmplzRevoke",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})}),i(document).on("borlabs-cookie-consent-saved",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})})}));
1
+ var sbi_js_exists=void 0!==sbi_js_exists;sbi_js_exists||(!function(i){function e(){var i,e,t,s=s||{VER:"0.9.944"};s.bgs_Available=!1,s.bgs_CheckRunned=!1,function(i){i.fn.extend({sbi_imgLiquid:function(e){this.defaults={fill:!0,verticalAlign:"center",horizontalAlign:"center",useBackgroundSize:!0,useDataHtmlAttr:!0,responsive:!0,delay:0,fadeInTime:0,removeBoxBackground:!0,hardPixels:!0,responsiveCheckTime:500,timecheckvisibility:500,onStart:null,onFinish:null,onItemStart:null,onItemFinish:null,onItemError:null},function(){if(!s.bgs_CheckRunned){s.bgs_CheckRunned=!0;var e=i('<span style="background-size:cover" />');i("body").append(e),function(){var i=e[0];if(i&&window.getComputedStyle){var t=window.getComputedStyle(i,null);t&&t.backgroundSize&&(s.bgs_Available="cover"===t.backgroundSize)}}(),e.remove()}}();var t=this;return this.options=e,this.settings=i.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(e){function n(){(r.responsive||h.data("sbi_imgLiquid_oldProcessed"))&&h.data("sbi_imgLiquid_settings")&&(r=h.data("sbi_imgLiquid_settings"),l.actualSize=l.get(0).offsetWidth+l.get(0).offsetHeight/1e4,l.sizeOld&&l.actualSize!==l.sizeOld&&o(),l.sizeOld=l.actualSize,setTimeout(n,r.responsiveCheckTime))}function a(){h.data("sbi_imgLiquid_error",!0),l.addClass("sbi_imgLiquid_error"),r.onItemError&&r.onItemError(e,l,h),d()}function o(){var i,t,s,n,a,o,c,g,f=0,u=0,b=l.width(),m=l.height();void 0===h.data("owidth")&&h.data("owidth",h[0].width),void 0===h.data("oheight")&&h.data("oheight",h[0].height),r.fill===b/m>=h.data("owidth")/h.data("oheight")?(i="100%",t="auto",s=Math.floor(b),n=Math.floor(b*(h.data("oheight")/h.data("owidth")))):(i="auto",t="100%",s=Math.floor(m*(h.data("owidth")/h.data("oheight"))),n=Math.floor(m)),c=b-s,"left"===(a=r.horizontalAlign.toLowerCase())&&(u=0),"center"===a&&(u=.5*c),"right"===a&&(u=c),-1!==a.indexOf("%")&&((a=parseInt(a.replace("%",""),10))>0&&(u=c*a*.01)),g=m-n,"left"===(o=r.verticalAlign.toLowerCase())&&(f=0),"center"===o&&(f=.5*g),"bottom"===o&&(f=g),-1!==o.indexOf("%")&&((o=parseInt(o.replace("%",""),10))>0&&(f=g*o*.01)),r.hardPixels&&(i=s,t=n),h.css({width:i,height:t,"margin-left":Math.floor(u),"margin-top":Math.floor(f)}),h.data("sbi_imgLiquid_oldProcessed")||(h.fadeTo(r.fadeInTime,1),h.data("sbi_imgLiquid_oldProcessed",!0),r.removeBoxBackground&&l.css("background-image","none"),l.addClass("sbi_imgLiquid_nobgSize"),l.addClass("sbi_imgLiquid_ready")),r.onItemFinish&&r.onItemFinish(e,l,h),d()}function d(){e===t.length-1&&t.settings.onFinish&&t.settings.onFinish()}var r=t.settings,l=i(this),h=i("img:first",l);return h.length?(h.data("sbi_imgLiquid_settings")?(l.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),r=i.extend({},h.data("sbi_imgLiquid_settings"),t.options)):r=i.extend({},t.settings,function(){var i={};if(t.settings.useDataHtmlAttr){var e=l.attr("data-sbi_imgLiquid-fill"),n=l.attr("data-sbi_imgLiquid-horizontalAlign"),a=l.attr("data-sbi_imgLiquid-verticalAlign");("true"===e||"false"===e)&&(i.fill=Boolean("true"===e)),void 0===n||"left"!==n&&"center"!==n&&"right"!==n&&-1===n.indexOf("%")||(i.horizontalAlign=n),void 0===a||"top"!==a&&"bottom"!==a&&"center"!==a&&-1===a.indexOf("%")||(i.verticalAlign=a)}return s.isIE&&t.settings.ieFadeInDisabled&&(i.fadeInTime=0),i}()),h.data("sbi_imgLiquid_settings",r),r.onItemStart&&r.onItemStart(e,l,h),void(s.bgs_Available&&r.useBackgroundSize?(-1===l.css("background-image").indexOf(encodeURI(h.attr("src")))&&l.css({"background-image":'url("'+encodeURI(h.attr("src"))+'")'}),l.css({"background-size":r.fill?"cover":"contain","background-position":(r.horizontalAlign+" "+r.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),i("a:first",l).css({display:"block",width:"100%",height:"100%"}),i("img",l).css({display:"none"}),r.onItemFinish&&r.onItemFinish(e,l,h),l.addClass("sbi_imgLiquid_bgSize"),l.addClass("sbi_imgLiquid_ready"),d()):function t(){if(h.data("oldSrc")&&h.data("oldSrc")!==h.attr("src")){var s=h.clone().removeAttr("style");return s.data("sbi_imgLiquid_settings",h.data("sbi_imgLiquid_settings")),h.parent().prepend(s),h.remove(),(h=s)[0].width=0,void setTimeout(t,10)}return h.data("sbi_imgLiquid_oldProcessed")?void o():(h.data("sbi_imgLiquid_oldProcessed",!1),h.data("oldSrc",h.attr("src")),i("img:not(:first)",l).css("display","none"),l.css({overflow:"hidden"}),h.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),h.on("error",a),h[0].onerror=a,function i(){h.data("sbi_imgLiquid_error")||h.data("sbi_imgLiquid_loaded")||h.data("sbi_imgLiquid_oldProcessed")||(l.is(":visible")&&h[0].complete&&h[0].width>0&&h[0].height>0?(h.data("sbi_imgLiquid_loaded",!0),setTimeout(o,e*r.delay)):setTimeout(i,r.timecheckvisibility))}(),void n())}())):void a()})}})}(jQuery),i=s.injectCss,e=document.getElementsByTagName("head")[0],(t=document.createElement("style")).type="text/css",t.styleSheet?t.styleSheet.cssText=i:t.appendChild(document.createTextNode(i)),e.appendChild(t)}function t(){this.feeds={},this.options=sb_instagram_js_options}function s(i,e,t){this.el=i,this.index=e,this.settings=t,this.minImageWidth=0,this.imageResolution=150,this.resizedImages={},this.needsResizing=[],this.outOfPages=!1,this.page=1,this.isInitialized=!1}function n(e,t){i.ajax({url:sbiajaxurl,type:"post",data:e,success:t})}t.prototype={createPage:function(e,t){void 0!==window.sbiajaxurl&&-1!==window.sbiajaxurl.indexOf(window.location.hostname)||(window.sbiajaxurl=location.protocol+"//"+window.location.hostname+"/wp-admin/admin-ajax.php"),i(".sbi_no_js_error_message").remove(),i(".sbi_no_js").removeClass("sbi_no_js"),e(t)},createFeeds:function(e){e.whenFeedsCreated(i(".sbi").each(function(e){i(this).attr("data-sbi-index",e+1);var t=i(this),a=void 0!==t.attr("data-sbi-flags")?t.attr("data-sbi-flags").split(","):[],o=void 0!==t.attr("data-options")?JSON.parse(t.attr("data-options")):{};if(a.indexOf("testAjax")>-1){window.sbi.triggeredTest=!0;n({action:"sbi_on_ajax_test_trigger"},function(i){console.log("did test")})}var d={cols:t.attr("data-cols"),colsmobile:void 0!==t.attr("data-colsmobile")&&"same"!==t.attr("data-colsmobile")?t.attr("data-colsmobile"):t.attr("data-cols"),num:t.attr("data-num"),imgRes:t.attr("data-res"),feedID:t.attr("data-feedid"),postID:"undefind"!=typeof t.attr("data-postid")?t.attr("data-postid"):"unknown",shortCodeAtts:t.attr("data-shortcode-atts"),resizingEnabled:-1===a.indexOf("resizeDisable"),imageLoadEnabled:-1===a.indexOf("imageLoadDisable"),debugEnabled:a.indexOf("debug")>-1,favorLocal:a.indexOf("favorLocal")>-1,ajaxPostLoad:a.indexOf("ajaxPostLoad")>-1,gdpr:a.indexOf("gdpr")>-1,overrideBlockCDN:a.indexOf("overrideBlockCDN")>-1,consentGiven:!1,locator:a.indexOf("locator")>-1,autoMinRes:1,general:o};window.sbi.feeds[e]=function(i,e,t){return new s(i,e,t)}(this,e,d),window.sbi.feeds[e].setResizedImages(),window.sbi.feeds[e].init();var r=jQuery.Event("sbiafterfeedcreate");r.feed=window.sbi.feeds[e],jQuery(window).trigger(r)}))},afterFeedsCreated:function(){i(".sb_instagram_header").each(function(){var e=i(this);e.find(".sbi_header_link").on("mouseenter mouseleave",function(i){switch(i.type){case"mouseenter":e.find(".sbi_header_img_hover").addClass("sbi_fade_in");break;case"mouseleave":e.find(".sbi_header_img_hover").removeClass("sbi_fade_in")}})})},encodeHTML:function(i){return void 0===i?"":i.replace(/(>)/g,"&gt;").replace(/(<)/g,"&lt;").replace(/(&lt;br\/&gt;)/g,"<br>").replace(/(&lt;br&gt;)/g,"<br>")},urlDetect:function(i){return i.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/g)}},s.prototype={init:function(){var e=this;e.settings.consentGiven=e.checkConsent(),i(this.el).find(".sbi_photo").parent("p").length&&i(this.el).addClass("sbi_no_autop"),i(this.el).find("#sbi_mod_error").length&&i(this.el).prepend(i(this.el).find("#sbi_mod_error")),this.settings.ajaxPostLoad?this.getNewPostSet():this.afterInitialImagesLoaded();var t,s=(t=0,function(i,e){clearTimeout(t),t=setTimeout(i,e)});jQuery(window).on("resize",function(){s(function(){e.afterResize()},500)}),i(this.el).find(".sbi_item").each(function(){e.lazyLoadCheck(i(this))})},initLayout:function(){},afterInitialImagesLoaded:function(){this.initLayout(),this.loadMoreButtonInit(),this.hideExtraImagesForWidth(),this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed()},afterResize:function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass()},afterLoadMoreClicked:function(i){i.find(".sbi_loader").removeClass("sbi_hidden"),i.find(".sbi_btn_text").addClass("sbi_hidden"),i.closest(".sbi").find(".sbi_num_diff_hide").addClass("sbi_transition").removeClass("sbi_num_diff_hide")},afterNewImagesLoaded:function(){var e=i(this.el),t=this;this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),setTimeout(function(){e.find(".sbi_loader").addClass("sbi_hidden"),e.find(".sbi_btn_text").removeClass("sbi_hidden"),t.maybeRaiseImageResolution()},500)},beforeNewImagesRevealed:function(){this.setImageHeight(),this.maybeRaiseImageResolution(!0),this.setImageSizeClass()},revealNewImages:function(){var e=i(this.el);e.find(".sbi-screenreader").each(function(){i(this).find("img").remove()}),"function"==typeof sbi_custom_js&&setTimeout(function(){sbi_custom_js()},100),this.applyImageLiquid(),e.find(".sbi_item").each(function(i){jQuery(this).find(".sbi_photo").on("mouseenter mouseleave",function(i){switch(i.type){case"mouseenter":jQuery(this).fadeTo(200,.85);break;case"mouseleave":jQuery(this).stop().fadeTo(500,1)}})}),setTimeout(function(){jQuery("#sbi_images .sbi_item.sbi_new").removeClass("sbi_new");var i=10;e.find(".sbi_transition").each(function(){var e=jQuery(this);setTimeout(function(){e.removeClass("sbi_transition")},i),i+=10})},500)},lazyLoadCheck:function(e){if(e.find(".sbi_photo").length&&!e.closest(".sbi").hasClass("sbi-no-ll-check")){var t=this.getImageUrls(e),s=void 0!==t[640]?t[640]:e.find(".sbi_photo").attr("data-full-res");if(!this.settings.consentGiven&&s.indexOf("scontent")>-1)return;e.find(".sbi_photo img").each(function(){s&&void 0!==i(this).attr("data-src")&&i(this).attr("data-src",s),s&&void 0!==i(this).attr("data-orig-src")&&i(this).attr("data-orig-src",s),i(this).on("load",function(){!i(this).hasClass("sbi-replaced")&&i(this).attr("src").indexOf("placeholder")>-1&&(i(this).addClass("sbi-replaced"),s&&(i(this).attr("src",s),i(this).closest(".sbi_imgLiquid_bgSize").length&&i(this).closest(".sbi_imgLiquid_bgSize").css("background-image","url("+s+")")))})})}},afterNewImagesRevealed:function(){this.listenForVisibilityChange(),this.sendNeedsResizingToServer(),this.settings.imageLoadEnabled||i(".sbi_no_resraise").removeClass("sbi_no_resraise");var e=i.Event("sbiafterimagesloaded");e.el=i(this.el),i(window).trigger(e)},setResizedImages:function(){i(this.el).find(".sbi_resized_image_data").length&&void 0!==i(this.el).find(".sbi_resized_image_data").attr("data-resized")&&0===i(this.el).find(".sbi_resized_image_data").attr("data-resized").indexOf('{"')&&(this.resizedImages=JSON.parse(i(this.el).find(".sbi_resized_image_data").attr("data-resized")),i(this.el).find(".sbi_resized_image_data").remove())},sendNeedsResizingToServer:function(){var e=this;if(e.needsResizing.length>0&&e.settings.resizingEnabled){var t=i(this.el).find(".sbi_item").length,s=void 0!==e.settings.general.cache_all&&e.settings.general.cache_all;n({action:"sbi_resized_images_submit",needs_resizing:e.needsResizing,offset:t,feed_id:e.settings.feedID,atts:e.settings.shortCodeAtts,location:e.locationGuess(),post_id:e.settings.postID,cache_all:s},function(i){if(0===i.trim().indexOf("{")){var t=JSON.parse(i);for(var s in e.settings.debugEnabled&&console.log(t),t)t.hasOwnProperty(s)&&(e.resizedImages[s]=t[s]);e.maybeRaiseImageResolution(),setTimeout(function(){e.afterResize()},500)}})}else if(e.settings.locator){n({action:"sbi_do_locator",feed_id:e.settings.feedID,atts:e.settings.shortCodeAtts,location:e.locationGuess(),post_id:e.settings.postID},function(i){})}},loadMoreButtonInit:function(){var e=i(this.el),t=this;e.find("#sbi_load .sbi_load_btn").off().on("click",function(){t.afterLoadMoreClicked(jQuery(this)),t.getNewPostSet()})},getNewPostSet:function(){var e=i(this.el),t=this;t.page++;n({action:"sbi_load_more_clicked",offset:e.find(".sbi_item").length,page:t.page,feed_id:t.settings.feedID,atts:t.settings.shortCodeAtts,location:t.locationGuess(),post_id:t.settings.postID,current_resolution:t.imageResolution},function(s){if(0===s.trim().indexOf("{")){var n=JSON.parse(s);t.settings.debugEnabled&&console.log(n),t.appendNewPosts(n.html),t.addResizedImages(n.resizedImages),t.settings.ajaxPostLoad?(t.settings.ajaxPostLoad=!1,t.afterInitialImagesLoaded()):t.afterNewImagesLoaded(),n.feedStatus.shouldPaginate?t.outOfPages=!1:(t.outOfPages=!0,e.find(".sbi_load_btn").hide()),i(".sbi_no_js").removeClass("sbi_no_js")}})},appendNewPosts:function(e){var t=i(this.el);t.find("#sbi_images .sbi_item").length?t.find("#sbi_images .sbi_item").last().after(e):t.find("#sbi_images").append(e)},addResizedImages:function(i){for(var e in i)this.resizedImages[e]=i[e]},setImageHeight:function(){var e=i(this.el),t=e.find(".sbi_photo").eq(0).innerWidth(),s=this.getColumnCount(),n=e.find("#sbi_images").innerWidth()-e.find("#sbi_images").width(),a=n/2;sbi_photo_width_manual=e.find("#sbi_images").width()/s-n,e.find(".sbi_photo").css("height",t),e.find(".sbi-owl-nav").length&&setTimeout(function(){var i=2;e.find(".sbi_owl2row-item").length&&(i=1);var t=e.find(".sbi_photo").eq(0).innerWidth()/i;t+=parseInt(a)*(2-i+2),e.find(".sbi-owl-nav div").css("top",t)},100)},maybeRaiseSingleImageResolution:function(e,t,s){var n=this,a=n.getImageUrls(e),o=e.find(".sbi_photo img").attr("src"),d=150,r=e.find("img").get(0),l=o===window.sbi.options.placeholder?1:r.naturalWidth/r.naturalHeight;s=void 0!==s&&s;if(!(e.hasClass("sbi_no_resraise")||e.hasClass("sbi_had_error")||e.find(".sbi_link_area").length&&e.find(".sbi_link_area").hasClass("sbi_had_error")))if(a.length<1)e.find(".sbi_link_area").length&&e.find(".sbi_link_area").attr("href",window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png"));else{(e.find(".sbi_link_area").length&&e.find(".sbi_link_area").attr("href")===window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png")||!n.settings.consentGiven)&&e.find(".sbi_link_area").attr("href",a[a.length-1]),void 0!==a[640]&&e.find(".sbi_photo").attr("data-full-res",a[640]),i.each(a,function(i,e){e===o&&(d=parseInt(i),s=!1)});var h=640;switch(n.settings.imgRes){case"thumb":h=150;break;case"medium":h=320;break;case"full":h=640;break;default:var c=Math.max(n.settings.autoMinRes,e.find(".sbi_photo").innerWidth()),g=n.getBestResolutionForAuto(c,l,e);switch(g){case 320:h=320;break;case 150:h=150}}if(h>d||o===window.sbi.options.placeholder||s){if(n.settings.debugEnabled){var f=o===window.sbi.options.placeholder?"was placeholder":"too small";console.log("rais res for "+o,f)}var u=a[h].split("?ig_cache_key")[0];if(o!==u&&(e.find(".sbi_photo img").attr("src",u),e.find(".sbi_photo").css("background-image",'url("'+u+'")')),d=h,"auto"===n.settings.imgRes){var b=!1;e.find(".sbi_photo img").on("load",function(){var t=i(this),s=t.get(0).naturalWidth/t.get(0).naturalHeight;if(1e3!==t.get(0).naturalWidth&&s>l&&!b){switch(n.settings.debugEnabled&&console.log("rais res again for aspect ratio change "+o),b=!0,c=e.find(".sbi_photo").innerWidth(),g=n.getBestResolutionForAuto(c,s,e),h=640,g){case 320:h=320;break;case 150:h=150}h>d&&(u=a[h].split("?ig_cache_key")[0],t.attr("src",u),t.closest(".sbi_photo").css("background-image",'url("'+u+'")')),"masonry"!==n.layout&&"highlight"!==n.layout||(i(n.el).find("#sbi_images").smashotope(n.isotopeArgs),setTimeout(function(){i(n.el).find("#sbi_images").smashotope(n.isotopeArgs)},500))}else if(n.settings.debugEnabled){var r=b?"already checked":"no aspect ratio change";console.log("not raising res for replacement "+o,r)}})}}e.find("img").on("error",function(){if(i(this).hasClass("sbi_img_error"))console.log("unfixed error "+i(this).attr("src"));else{var e;if(i(this).addClass("sbi_img_error"),!(i(this).attr("src").indexOf("media/?size=")>-1||i(this).attr("src").indexOf("cdninstagram")>-1||i(this).attr("src").indexOf("fbcdn")>-1)&&n.settings.consentGiven){if("undefined"!==i(this).closest(".sbi_photo").attr("data-img-src-set"))void 0!==(e=JSON.parse(i(this).closest(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/"))).d&&(i(this).attr("src",e.d),i(this).closest(".sbi_photo").css("background-image","url("+e.d+")"),i(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",e[640]).addClass("sbi_had_error"))}else n.settings.favorLocal=!0,void 0!==(e=n.getImageUrls(i(this).closest(".sbi_item")))[640]&&(i(this).attr("src",e[640]),i(this).closest(".sbi_photo").css("background-image","url("+e[640]+")"),i(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",e[640]).addClass("sbi_had_error"));setTimeout(function(){n.afterResize()},1500)}})}},maybeRaiseImageResolution:function(e){var t=this,s=void 0!==e&&!0===e?".sbi_item.sbi_new":".sbi_item",n=!t.isInitialized;i(t.el).find(s).each(function(e){!i(this).hasClass("sbi_num_diff_hide")&&i(this).find(".sbi_photo").length&&void 0!==i(this).find(".sbi_photo").attr("data-img-src-set")&&t.maybeRaiseSingleImageResolution(i(this),e,n)}),t.isInitialized=!0},getBestResolutionForAuto:function(e,t,s){(isNaN(t)||t<1)&&(t=1);var n=e*t,a=10*Math.ceil(n/10),o=[150,320,640];if(s.hasClass("sbi_highlighted")&&(a*=2),-1===o.indexOf(parseInt(a))){var d=!1;i.each(o,function(i,e){e>parseInt(a)&&!d&&(a=e,d=!0)})}return a},hideExtraImagesForWidth:function(){if("carousel"!==this.layout){var e=i(this.el),t=void 0!==e.attr("data-num")&&""!==e.attr("data-num")?parseInt(e.attr("data-num")):1,s=void 0!==e.attr("data-nummobile")&&""!==e.attr("data-nummobile")?parseInt(e.attr("data-nummobile")):t;i(window).width()<480?s<e.find(".sbi_item").length&&e.find(".sbi_item").slice(s-e.find(".sbi_item").length).addClass("sbi_num_diff_hide"):t<e.find(".sbi_item").length&&e.find(".sbi_item").slice(t-e.find(".sbi_item").length).addClass("sbi_num_diff_hide")}},setImageSizeClass:function(){var e=i(this.el);e.removeClass("sbi_small sbi_medium");var t=e.innerWidth(),s=parseInt(e.find("#sbi_images").outerWidth()-e.find("#sbi_images").width())/2,n=this.getColumnCount(),a=(t-s*(n+2))/n;a>120&&a<240?e.addClass("sbi_medium"):a<=120&&e.addClass("sbi_small")},setMinImageWidth:function(){i(this.el).find(".sbi_item .sbi_photo").first().length?this.minImageWidth=i(this.el).find(".sbi_item .sbi_photo").first().innerWidth():this.minImageWidth=150},setImageResolution:function(){if("auto"===this.settings.imgRes)this.imageResolution="auto";else switch(this.settings.imgRes){case"thumb":this.imageResolution=150;break;case"medium":this.imageResolution=320;break;default:this.imageResolution=640}},getImageUrls:function(i){var e=JSON.parse(i.find(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/")),t=i.attr("id").replace("sbi_","");if(this.settings.consentGiven||this.settings.overrideBlockCDN||(e=[]),void 0!==this.resizedImages[t]&&"video"!==this.resizedImages[t]&&"pending"!==this.resizedImages[t]&&"error"!==this.resizedImages[t].id&&"video"!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id){if(void 0!==this.resizedImages[t].sizes){var s=[];void 0!==this.resizedImages[t].sizes.full&&(e[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg",s.push(640)),void 0!==this.resizedImages[t].sizes.low&&(e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg",s.push(320)),void 0!==this.resizedImages[t].sizes.thumb&&(s.push(150),e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg"),this.settings.favorLocal&&(-1===s.indexOf(640)&&s.indexOf(320)>-1&&(e[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg"),-1===s.indexOf(320)&&(s.indexOf(640)>-1?e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg":s.indexOf(150)>-1&&(e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg")),-1===s.indexOf(150)&&(s.indexOf(320)>-1?e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg":s.indexOf(640)>-1&&(e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg")))}}else(void 0===this.resizedImages[t]||void 0!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id&&"error"!==this.resizedImages[t].id)&&this.addToNeedsResizing(t);return e},getAvatarUrl:function(i,e){if(""===i)return"";var t=this.settings.general.avatars;return"local"===(e=void 0!==e?e:"local")?void 0!==t["LCL"+i]&&1===parseInt(t["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":void 0!==t[i]?t[i]:"":void 0!==t[i]?t[i]:void 0!==t["LCL"+i]&&1===parseInt(t["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":""},addToNeedsResizing:function(i){-1===this.needsResizing.indexOf(i)&&this.needsResizing.push(i)},applyImageLiquid:function(){var t=i(this.el);e(),"function"==typeof t.find(".sbi_photo").sbi_imgLiquid&&t.find(".sbi_photo").sbi_imgLiquid({fill:!0})},listenForVisibilityChange:function(){var e,t,s,n=this;e=jQuery,t={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},s={sbiCheckVisibility:function(i,e){if(jQuery.contains(document,i[0])){var t=e.sbiPreviousVisibility,n=i.is(":visible");e.sbiPreviousVisibility=n,null==t?e.runOnLoad&&e.callback(i,n):t!==n&&e.callback(i,n),setTimeout(function(){s.sbiCheckVisibility(i,e)},e.frequency)}}},e.fn.sbiVisibilityChanged=function(i){var n=e.extend({},t,i);return this.each(function(){s.sbiCheckVisibility(e(this),n)})},"function"==typeof i(this.el).filter(":hidden").sbiVisibilityChanged&&i(this.el).filter(":hidden").sbiVisibilityChanged({callback:function(i,e){n.afterResize()},runOnLoad:!1})},getColumnCount:function(){var e=i(this.el),t=this.settings.cols,s=this.settings.colsmobile,n=t;return sbiWindowWidth=window.innerWidth,e.hasClass("sbi_mob_col_auto")?(sbiWindowWidth<640&&parseInt(t)>2&&parseInt(t)<7&&(n=2),sbiWindowWidth<640&&parseInt(t)>6&&parseInt(t)<11&&(n=4),sbiWindowWidth<=480&&parseInt(t)>2&&(n=1)):sbiWindowWidth<=480&&(n=s),parseInt(n)},checkConsent:function(){if(this.settings.consentGiven||!this.settings.gdpr)return!0;if("undefined"!=typeof CLI_Cookie)null!==CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)&&(this.settings.consentGiven="yes"===CLI_Cookie.read("cookielawinfo-checkbox-non-necessary"));else if(void 0!==window.cnArgs){var i=("; "+document.cookie).split("; cookie_notice_accepted=");if(2===i.length){var e=i.pop().split(";").shift();this.settings.consentGiven="true"===e}}else void 0!==window.cookieconsent?this.settings.consentGiven="allow"===function(i){for(var e=i+"=",t=window.document.cookie.split(";"),s=0;s<t.length;s++){var n=t[s].trim();if(0==n.indexOf(e))return n.substring(e.length,n.length)}return""}("complianz_consent_status"):void 0!==window.Cookiebot?this.settings.consentGiven=Cookiebot.consented:void 0!==window.BorlabsCookie&&(this.settings.consentGiven=window.BorlabsCookie.checkCookieConsent("instagram"));var t=jQuery.Event("sbicheckconsent");return t.feed=this,jQuery(window).trigger(t),this.settings.consentGiven},afterConsentToggled:function(){if(this.checkConsent()){var i=this;i.maybeRaiseImageResolution(),setTimeout(function(){i.afterResize()},500)}},locationGuess:function(){var e=i(this.el),t="content";return e.closest("footer").length?t="footer":e.closest(".header").length||e.closest("header").length?t="header":(e.closest(".sidebar").length||e.closest("aside").length)&&(t="sidebar"),t}},window.sbi_init=function(){window.sbi=new t,window.sbi.createPage(window.sbi.createFeeds,{whenFeedsCreated:window.sbi.afterFeedsCreated})}}(jQuery),jQuery(document).ready(function(i){void 0===window.sb_instagram_js_options&&(window.sb_instagram_js_options={font_method:"svg",resized_url:location.protocol+"//"+window.location.hostname+"/wp-content/uploads/sb-instagram-feed-images/",placeholder:location.protocol+"//"+window.location.hostname+"/wp-content/plugins/instagram-feed/img/placeholder.png"}),void 0!==window.sb_instagram_js_options.resized_url&&-1===window.sb_instagram_js_options.resized_url.indexOf(location.protocol)&&("http:"===location.protocol?window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("https:","http:"):window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("http:","https:")),sbi_init(),i("#cookie-notice a").on("click",function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i("#cookie-law-info-bar a").on("click",function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i(".cli-user-preference-checkbox").on("click",function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i(window).on("CookiebotOnAccept",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),i(document).on("cmplzAcceptAll",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),i(document).on("cmplzRevoke",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})}),i(document).on("borlabs-cookie-consent-saved",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})})}));