Instagram Feed - Version 1.6.1

Version Description

  • Fix: Fixed Font Awesome 5.0 causing Instagram icon to appear as a question mark with a circle
  • Fix: Fixed inline padding style for sbi_images element causing validation error when set to "0" or blank space
  • Fix: Added a workaround for an Instagram API bug which caused some feeds to show fewer posts than expected
Download this release

Release Info

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

Code changes from version 1.6 to 1.6.1

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.0
5
  Tested up to: 4.9
6
- Stable tag: 1.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -310,6 +310,11 @@ We understand that sometimes you need help, have issues or just have questions.
310
  * Plus more customization options added all the time!
311
 
312
  == Changelog ==
 
 
 
 
 
313
  = 1.6 =
314
  * New: Loading icon appears when waiting for new posts after clicking the "Load More..." button
315
  * New: Added translation files for Dutch (nl_NL)
3
  Tags: Instagram, Instagram feed, Instagram photos, Instagram widget, Instagram gallery
4
  Requires at least: 3.0
5
  Tested up to: 4.9
6
+ Stable tag: 1.6.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
310
  * Plus more customization options added all the time!
311
 
312
  == Changelog ==
313
+ = 1.6.1 =
314
+ * Fix: Fixed Font Awesome 5.0 causing Instagram icon to appear as a question mark with a circle
315
+ * Fix: Fixed inline padding style for sbi_images element causing validation error when set to "0" or blank space
316
+ * Fix: Added a workaround for an Instagram API bug which caused some feeds to show fewer posts than expected
317
+
318
  = 1.6 =
319
  * New: Loading icon appears when waiting for new posts after clicking the "Load More..." button
320
  * New: Added translation files for Dutch (nl_NL)
css/sb-instagram.css CHANGED
@@ -326,6 +326,9 @@
326
  *display: inline;
327
  text-align: center;
328
  }
 
 
 
329
  #sb_instagram .sbi_follow_btn.sbi_top{
330
  display: block;
331
  margin-bottom: 5px;
326
  *display: inline;
327
  text-align: center;
328
  }
329
+ #sb_instagram #sbi_load .sbi_follow_btn svg.fa-instagram{
330
+ margin-right: 7px;
331
+ }
332
  #sb_instagram .sbi_follow_btn.sbi_top{
333
  display: block;
334
  margin-bottom: 5px;
css/sb-instagram.min.css CHANGED
@@ -1 +1 @@
1
- #sb_instagram{width:100%;margin:0 auto;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram:after{content:"";display:table;clear:both}#sb_instagram.sbi_fixed_height{overflow:hidden;overflow-y:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram #sbi_images{width:100%;float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram #sbi_images .sbi_item{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;*display:inline;padding:inherit!important;margin:0!important;text-decoration:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram.sbi_col_1 #sbi_images .sbi_item{width:100%}#sb_instagram.sbi_col_2 #sbi_images .sbi_item{width:50%}#sb_instagram.sbi_col_3 #sbi_images .sbi_item{width:33.33%}#sb_instagram.sbi_col_4 #sbi_images .sbi_item{width:25%}#sb_instagram.sbi_col_5 #sbi_images .sbi_item{width:20%}#sb_instagram.sbi_col_6 #sbi_images .sbi_item{width:16.66%}#sb_instagram.sbi_col_7 #sbi_images .sbi_item{width:14.28%}#sb_instagram.sbi_col_8 #sbi_images .sbi_item{width:12.5%}#sb_instagram.sbi_col_9 #sbi_images .sbi_item{width:11.11%}#sb_instagram.sbi_col_10 #sbi_images .sbi_item{width:10%}#sb_instagram.sbi_col_1.sbi_disable_mobile #sbi_images .sbi_item{width:100%}#sb_instagram.sbi_col_2.sbi_disable_mobile #sbi_images .sbi_item{width:50%}#sb_instagram.sbi_col_3.sbi_disable_mobile #sbi_images .sbi_item{width:33.33%}#sb_instagram.sbi_col_4.sbi_disable_mobile #sbi_images .sbi_item{width:25%}#sb_instagram.sbi_col_5.sbi_disable_mobile #sbi_images .sbi_item{width:20%}#sb_instagram.sbi_col_6.sbi_disable_mobile #sbi_images .sbi_item{width:16.66%}#sb_instagram.sbi_col_7.sbi_disable_mobile #sbi_images .sbi_item{width:14.28%}#sb_instagram.sbi_col_8.sbi_disable_mobile #sbi_images .sbi_item{width:12.5%}#sb_instagram.sbi_col_9.sbi_disable_mobile #sbi_images .sbi_item{width:11.11%}#sb_instagram.sbi_col_10.sbi_disable_mobile #sbi_images .sbi_item{width:10%}#sb_instagram .sbi_photo_wrap{position:relative}#sb_instagram .sbi_photo{display:block;text-decoration:none}#sb_instagram .sbi_photo img{width:100%;height:auto}#sb_instagram a,#sb_instagram a:hover,#sb_instagram a:focus,#sb_instagram a:active{outline:none}#sb_instagram img{display:block;padding:0!important;margin:0!important;max-width:100%!important;opacity:1!important}#sb_instagram .sbi_link{display:none;position:absolute;bottom:0;right:0;width:100%;padding:10px 0;background:rgba(0,0,0,.5);text-align:center;color:#fff;font-size:12px;line-height:1.1}#sb_instagram .sbi_link a{padding:0 6px;text-decoration:none;color:#fff;font-size:12px;line-height:1.1;display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;*display:inline}#sb_instagram .sbi_link .sbi_lightbox_link{padding-bottom:5px}#sb_instagram .sbi_link a:hover,#sb_instagram .sbi_link a:focus{text-decoration:underline}#sb_instagram .sbi_photo_wrap:hover .sbi_link,#sb_instagram .sbi_photo_wrap:focus .sbi_link{display:block}#sb_instagram .sbi_type_video .sbi_playbtn{display:block!important;position:absolute;z-index:0;top:50%;left:50%;margin-top:-24px;margin-left:-19px;padding:0;font-size:48px;color:#fff;color:rgba(255,255,255,.9);font-style:normal!important;text-shadow:0 0 8px rgba(0,0,0,.8)}#sb_instagram .sbi_loader{position:relative;left:50%;width:16px;height:16px;margin:10px 0 10px -8px;background:url(../img/loader.png) no-repeat}#sb_instagram .sb_instagram_header{float:left;clear:both;margin:0 0 15px 0;padding:0;line-height:1.2;width:100%}#sb_instagram .sb_instagram_header a{float:left;display:block;min-width:100%\9}#sb_instagram .sbi_header_img{float:left;position:relative;width:50px;margin:0 0 0 -100%!important;overflow:hidden;-moz-border-radius:40px;-webkit-border-radius:40px;border-radius:40px}#sb_instagram .sbi_header_img img{float:left;margin:0!important;padding:0!important;border:none!important;-moz-border-radius:40px;-webkit-border-radius:40px;border-radius:40px}#sb_instagram .sbi_header_img_hover{position:absolute;width:100%;top:0;bottom:0;left:0;text-align:center;color:#fff;background:rgba(0,0,0,.75);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity:0;opacity:0;border-radius:40px;transition:opacity 0.2s}#sb_instagram .sb_instagram_header a:hover .sbi_header_img_hover,#sb_instagram .sb_instagram_header a:focus .sbi_header_img_hover{opacity:1}#sb_instagram .sbi_header_img_hover i{position:absolute;top:50%;left:50%;margin-top:-12px;margin-left:-12px;width:24px;height:24px;overflow:hidden;background:url(../img/small-logo.png) no-repeat 0 0}#sb_instagram .sbi_header_text{float:left;width:100%;padding-top:5px}#sb_instagram .sb_instagram_header a{text-decoration:none}#sb_instagram .sbi_header_text .sbi_bio,#sb_instagram .sbi_header_text h3{float:left;clear:both;width:auto;margin:0 0 0 60px!important;padding:0!important}#sb_instagram .sb_instagram_header h3{font-size:16px;line-height:1.3}#sb_instagram .sb_instagram_header p{font-size:13px;line-height:1.3}#sb_instagram .sb_instagram_header h3.sbi_no_bio{padding-top:9px!important}#sb_instagram .sbi_header_text img.emoji{margin-right:3px!important}#sb_instagram #sbi_load{float:left;clear:both;width:100%;text-align:center}#sb_instagram #sbi_load .fa-spinner{display:none;position:absolute;top:50%;left:50%;margin:-8px 0 0 -7px;font-size:15px}#sb_instagram #sbi_load .sbi_load_btn,#sb_instagram .sbi_follow_btn a{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;*display:inline;padding:7px 14px;margin:5px auto 0 auto;background:#333;color:#eee;border:none;color:#fff;text-decoration:none;font-size:13px;line-height:1.5;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram #sbi_load .sbi_load_btn{position:relative}#sb_instagram .sbi_follow_btn{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;*display:inline;text-align:center}#sb_instagram .sbi_follow_btn.sbi_top{display:block;margin-bottom:5px}#sb_instagram .sbi_follow_btn a{background:#517fa4;color:#fff}#sb_instagram .sbi_follow_btn a:hover,#sb_instagram .sbi_follow_btn a:focus,#sb_instagram #sbi_load .sbi_load_btn:hover,#sb_instagram #sbi_load .sbi_load_btn:focus{filter:alpha(opacity=85);opacity:.85}#sb_instagram #sbi_load .fa,#sb_instagram .sbi_follow_btn .fa{margin-bottom:-1px;margin-right:7px;font-size:15px}#sb_instagram #sbi_load .sbi_follow_btn{margin-left:5px}#sb_instagram .sb_instagram_error{width:100%;text-align:center}#sbi_mod_error{display:none;border:1px solid #ddd;background:#eee;color:#333;margin:0;padding:10px 15px;font-size:13px;text-align:center;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}#sbi_mod_error p{padding:5px 0!important;margin:0!important;line-height:1.3!important}#sbi_mod_error ol,#sbi_mod_error ul{padding:5px 0 5px 20px!important;margin:0!important}#sbi_mod_error li{padding:1px 0!important;margin:0!important}#sbi_mod_error span{font-size:12px}#sb_instagram.sbi_medium .sbi_playbtn{font-size:23px;margin-top:-12px;margin-left:-9px}#sb_instagram.sbi_small .sbi_playbtn{font-size:18px;margin-top:-9px;margin-left:-7px}@media all and (max-width:640px){#sb_instagram.sbi_col_3 #sbi_images .sbi_item,#sb_instagram.sbi_col_4 #sbi_images .sbi_item,#sb_instagram.sbi_col_5 #sbi_images .sbi_item,#sb_instagram.sbi_col_6 #sbi_images .sbi_item{width:50%}#sb_instagram.sbi_col_7 #sbi_images .sbi_item,#sb_instagram.sbi_col_8 #sbi_images .sbi_item,#sb_instagram.sbi_col_9 #sbi_images .sbi_item,#sb_instagram.sbi_col_10 #sbi_images .sbi_item{width:25%}#sb_instagram.sbi_width_resp{width:100%!important}}@media all and (max-width:480px){#sb_instagram.sbi_col_3 #sbi_images .sbi_item,#sb_instagram.sbi_col_4 #sbi_images .sbi_item,#sb_instagram.sbi_col_5 #sbi_images .sbi_item,#sb_instagram.sbi_col_6 #sbi_images .sbi_item,#sb_instagram.sbi_col_7 #sbi_images .sbi_item,#sb_instagram.sbi_col_8 #sbi_images .sbi_item,#sb_instagram.sbi_col_9 #sbi_images .sbi_item,#sb_instagram.sbi_col_10 #sbi_images .sbi_item{width:100%}}
1
+ #sb_instagram{width:100%;margin:0 auto;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram:after{content:"";display:table;clear:both}#sb_instagram.sbi_fixed_height{overflow:hidden;overflow-y:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram #sbi_images{width:100%;float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram #sbi_images .sbi_item{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;*display:inline;padding:inherit!important;margin:0!important;text-decoration:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram.sbi_col_1 #sbi_images .sbi_item{width:100%}#sb_instagram.sbi_col_2 #sbi_images .sbi_item{width:50%}#sb_instagram.sbi_col_3 #sbi_images .sbi_item{width:33.33%}#sb_instagram.sbi_col_4 #sbi_images .sbi_item{width:25%}#sb_instagram.sbi_col_5 #sbi_images .sbi_item{width:20%}#sb_instagram.sbi_col_6 #sbi_images .sbi_item{width:16.66%}#sb_instagram.sbi_col_7 #sbi_images .sbi_item{width:14.28%}#sb_instagram.sbi_col_8 #sbi_images .sbi_item{width:12.5%}#sb_instagram.sbi_col_9 #sbi_images .sbi_item{width:11.11%}#sb_instagram.sbi_col_10 #sbi_images .sbi_item{width:10%}#sb_instagram.sbi_col_1.sbi_disable_mobile #sbi_images .sbi_item{width:100%}#sb_instagram.sbi_col_2.sbi_disable_mobile #sbi_images .sbi_item{width:50%}#sb_instagram.sbi_col_3.sbi_disable_mobile #sbi_images .sbi_item{width:33.33%}#sb_instagram.sbi_col_4.sbi_disable_mobile #sbi_images .sbi_item{width:25%}#sb_instagram.sbi_col_5.sbi_disable_mobile #sbi_images .sbi_item{width:20%}#sb_instagram.sbi_col_6.sbi_disable_mobile #sbi_images .sbi_item{width:16.66%}#sb_instagram.sbi_col_7.sbi_disable_mobile #sbi_images .sbi_item{width:14.28%}#sb_instagram.sbi_col_8.sbi_disable_mobile #sbi_images .sbi_item{width:12.5%}#sb_instagram.sbi_col_9.sbi_disable_mobile #sbi_images .sbi_item{width:11.11%}#sb_instagram.sbi_col_10.sbi_disable_mobile #sbi_images .sbi_item{width:10%}#sb_instagram .sbi_photo_wrap{position:relative}#sb_instagram .sbi_photo{display:block;text-decoration:none}#sb_instagram .sbi_photo img{width:100%;height:auto}#sb_instagram a,#sb_instagram a:hover,#sb_instagram a:focus,#sb_instagram a:active{outline:none}#sb_instagram img{display:block;padding:0!important;margin:0!important;max-width:100%!important;opacity:1!important}#sb_instagram .sbi_link{display:none;position:absolute;bottom:0;right:0;width:100%;padding:10px 0;background:rgba(0,0,0,.5);text-align:center;color:#fff;font-size:12px;line-height:1.1}#sb_instagram .sbi_link a{padding:0 6px;text-decoration:none;color:#fff;font-size:12px;line-height:1.1;display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;*display:inline}#sb_instagram .sbi_link .sbi_lightbox_link{padding-bottom:5px}#sb_instagram .sbi_link a:hover,#sb_instagram .sbi_link a:focus{text-decoration:underline}#sb_instagram .sbi_photo_wrap:hover .sbi_link,#sb_instagram .sbi_photo_wrap:focus .sbi_link{display:block}#sb_instagram .sbi_type_video .sbi_playbtn{display:block!important;position:absolute;z-index:0;top:50%;left:50%;margin-top:-24px;margin-left:-19px;padding:0;font-size:48px;color:#fff;color:rgba(255,255,255,.9);font-style:normal!important;text-shadow:0 0 8px rgba(0,0,0,.8)}#sb_instagram .sbi_loader{position:relative;left:50%;width:16px;height:16px;margin:10px 0 10px -8px;background:url(../img/loader.png) no-repeat}#sb_instagram .sb_instagram_header{float:left;clear:both;margin:0 0 15px 0;padding:0;line-height:1.2;width:100%}#sb_instagram .sb_instagram_header a{float:left;display:block;min-width:100%\9}#sb_instagram .sbi_header_img{float:left;position:relative;width:50px;margin:0 0 0 -100%!important;overflow:hidden;-moz-border-radius:40px;-webkit-border-radius:40px;border-radius:40px}#sb_instagram .sbi_header_img img{float:left;margin:0!important;padding:0!important;border:none!important;-moz-border-radius:40px;-webkit-border-radius:40px;border-radius:40px}#sb_instagram .sbi_header_img_hover{position:absolute;width:100%;top:0;bottom:0;left:0;text-align:center;color:#fff;background:rgba(0,0,0,.75);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity:0;opacity:0;border-radius:40px;transition:opacity 0.2s}#sb_instagram .sb_instagram_header a:hover .sbi_header_img_hover,#sb_instagram .sb_instagram_header a:focus .sbi_header_img_hover{opacity:1}#sb_instagram .sbi_header_img_hover i{position:absolute;top:50%;left:50%;margin-top:-12px;margin-left:-12px;width:24px;height:24px;overflow:hidden;background:url(../img/small-logo.png) no-repeat 0 0}#sb_instagram .sbi_header_text{float:left;width:100%;padding-top:5px}#sb_instagram .sb_instagram_header a{text-decoration:none}#sb_instagram .sbi_header_text .sbi_bio,#sb_instagram .sbi_header_text h3{float:left;clear:both;width:auto;margin:0 0 0 60px!important;padding:0!important}#sb_instagram .sb_instagram_header h3{font-size:16px;line-height:1.3}#sb_instagram .sb_instagram_header p{font-size:13px;line-height:1.3}#sb_instagram .sb_instagram_header h3.sbi_no_bio{padding-top:9px!important}#sb_instagram .sbi_header_text img.emoji{margin-right:3px!important}#sb_instagram #sbi_load{float:left;clear:both;width:100%;text-align:center}#sb_instagram #sbi_load .fa-spinner{display:none;position:absolute;top:50%;left:50%;margin:-8px 0 0 -7px;font-size:15px}#sb_instagram #sbi_load .sbi_load_btn,#sb_instagram .sbi_follow_btn a{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;*display:inline;padding:7px 14px;margin:5px auto 0 auto;background:#333;color:#eee;border:none;color:#fff;text-decoration:none;font-size:13px;line-height:1.5;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram #sbi_load .sbi_load_btn{position:relative}#sb_instagram .sbi_follow_btn{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;*display:inline;text-align:center}#sb_instagram #sbi_load .sbi_follow_btn svg.fa-instagram{margin-right: 7px;}#sb_instagram .sbi_follow_btn.sbi_top{display:block;margin-bottom:5px}#sb_instagram .sbi_follow_btn a{background:#517fa4;color:#fff}#sb_instagram .sbi_follow_btn a:hover,#sb_instagram .sbi_follow_btn a:focus,#sb_instagram #sbi_load .sbi_load_btn:hover,#sb_instagram #sbi_load .sbi_load_btn:focus{filter:alpha(opacity=85);opacity:.85}#sb_instagram #sbi_load .fa,#sb_instagram .sbi_follow_btn .fa{margin-bottom:-1px;margin-right:7px;font-size:15px}#sb_instagram #sbi_load .sbi_follow_btn{margin-left:5px}#sb_instagram .sb_instagram_error{width:100%;text-align:center}#sbi_mod_error{display:none;border:1px solid #ddd;background:#eee;color:#333;margin:0;padding:10px 15px;font-size:13px;text-align:center;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}#sbi_mod_error p{padding:5px 0!important;margin:0!important;line-height:1.3!important}#sbi_mod_error ol,#sbi_mod_error ul{padding:5px 0 5px 20px!important;margin:0!important}#sbi_mod_error li{padding:1px 0!important;margin:0!important}#sbi_mod_error span{font-size:12px}#sb_instagram.sbi_medium .sbi_playbtn{font-size:23px;margin-top:-12px;margin-left:-9px}#sb_instagram.sbi_small .sbi_playbtn{font-size:18px;margin-top:-9px;margin-left:-7px}@media all and (max-width:640px){#sb_instagram.sbi_col_3 #sbi_images .sbi_item,#sb_instagram.sbi_col_4 #sbi_images .sbi_item,#sb_instagram.sbi_col_5 #sbi_images .sbi_item,#sb_instagram.sbi_col_6 #sbi_images .sbi_item{width:50%}#sb_instagram.sbi_col_7 #sbi_images .sbi_item,#sb_instagram.sbi_col_8 #sbi_images .sbi_item,#sb_instagram.sbi_col_9 #sbi_images .sbi_item,#sb_instagram.sbi_col_10 #sbi_images .sbi_item{width:25%}#sb_instagram.sbi_width_resp{width:100%!important}}@media all and (max-width:480px){#sb_instagram.sbi_col_3 #sbi_images .sbi_item,#sb_instagram.sbi_col_4 #sbi_images .sbi_item,#sb_instagram.sbi_col_5 #sbi_images .sbi_item,#sb_instagram.sbi_col_6 #sbi_images .sbi_item,#sb_instagram.sbi_col_7 #sbi_images .sbi_item,#sb_instagram.sbi_col_8 #sbi_images .sbi_item,#sb_instagram.sbi_col_9 #sbi_images .sbi_item,#sb_instagram.sbi_col_10 #sbi_images .sbi_item{width:100%}}
instagram-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Instagram Feed
4
  Plugin URI: https://smashballoon.com/instagram-feed
5
  Description: Display beautifully clean, customizable, and responsive Instagram feeds
6
- Version: 1.6
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
 
26
- define( 'SBIVER', '1.6' );
27
 
28
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
29
 
@@ -147,7 +147,7 @@ function display_instagram($atts, $content = null) {
147
  if ( !empty($sb_instagram_follow_btn_text_color) ) $sb_instagram_follow_btn_styles .= 'color: #'.$sb_instagram_follow_btn_text_color.';';
148
  $sb_instagram_follow_btn_styles .= '"';
149
  //Follow button HTML
150
- $sb_instagram_follow_btn_html = '<div class="sbi_follow_btn"><a href="https://instagram.com/" '.$sb_instagram_follow_btn_styles.' target="_blank"><i class="fa fa-instagram"></i>'.esc_html( stripslashes( $sb_instagram_follow_btn_text ) ).'</a></div>';
151
 
152
 
153
  //Mobile
@@ -176,7 +176,8 @@ function display_instagram($atts, $content = null) {
176
  if( $sb_instagram_show_header ) $sb_instagram_content .= '<div class="sb_instagram_header" style="padding: '.(2*intval($sb_instagram_image_padding)) . $sb_instagram_image_padding_unit .'; padding-bottom: 0;"></div>';
177
 
178
  //Images container
179
- $sb_instagram_content .= '<div id="sbi_images" style="padding: '.$sb_instagram_image_padding . $sb_instagram_image_padding_unit .';">';
 
180
 
181
  //Error messages
182
  $sb_instagram_error = false;
3
  Plugin Name: Instagram Feed
4
  Plugin URI: https://smashballoon.com/instagram-feed
5
  Description: Display beautifully clean, customizable, and responsive Instagram feeds
6
+ Version: 1.6.1
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
 
26
+ define( 'SBIVER', '1.6.1' );
27
 
28
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
29
 
147
  if ( !empty($sb_instagram_follow_btn_text_color) ) $sb_instagram_follow_btn_styles .= 'color: #'.$sb_instagram_follow_btn_text_color.';';
148
  $sb_instagram_follow_btn_styles .= '"';
149
  //Follow button HTML
150
+ $sb_instagram_follow_btn_html = '<div class="sbi_follow_btn"><a href="https://instagram.com/" '.$sb_instagram_follow_btn_styles.' target="_blank"><i class="fa fab fa-instagram"></i>'.esc_html( stripslashes( $sb_instagram_follow_btn_text ) ).'</a></div>';
151
 
152
 
153
  //Mobile
176
  if( $sb_instagram_show_header ) $sb_instagram_content .= '<div class="sb_instagram_header" style="padding: '.(2*intval($sb_instagram_image_padding)) . $sb_instagram_image_padding_unit .'; padding-bottom: 0;"></div>';
177
 
178
  //Images container
179
+ $padding_style = (int)$sb_instagram_image_padding > 0 ? ' style="padding: '.$sb_instagram_image_padding . $sb_instagram_image_padding_unit . ';"' : '';
180
+ $sb_instagram_content .= '<div id="sbi_images"' . $padding_style .'>';
181
 
182
  //Error messages
183
  $sb_instagram_error = false;
js/sb-instagram.js CHANGED
@@ -1,13 +1,166 @@
1
  var sbi_js_exists = (typeof sbi_js_exists !== 'undefined') ? true : false;
2
  if(!sbi_js_exists){
3
 
4
- (function(){var e,t;e=function(){function e(e,t){var n,r;this.options={target:"instafeed",get:"popular",resolution:"thumbnail",sortBy:"none",links:!0,mock:!1,useHttp:!1};if(typeof e=="object")for(n in e)r=e[n],this.options[n]=r;this.context=t!=null?t:this,this.unique=this._genKey()}return e.prototype.hasNext=function(){return typeof this.context.nextUrl=="string"&&this.context.nextUrl.length>0},e.prototype.next=function(){return this.hasNext()?this.run(this.context.nextUrl):!1},e.prototype.run=function(t){var n,r,i;if(typeof this.options.clientId!="string"&&typeof this.options.accessToken!="string")throw new Error("Missing clientId or accessToken.");if(typeof this.options.accessToken!="string"&&typeof this.options.clientId!="string")throw new Error("Missing clientId or accessToken.");return this.options.before!=null&&typeof this.options.before=="function"&&this.options.before.call(this),typeof document!="undefined"&&document!==null&&(i=document.createElement("script"),i.id="instafeed-fetcher",i.src=t||this._buildUrl(),n=document.getElementsByTagName("head"),n[0].appendChild(i),r="instafeedCache"+this.unique,window[r]=new e(this.options,this),window[r].unique=this.unique),!0},e.prototype.parse=function(e){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S;if(typeof e!="object"){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,"Invalid JSON data"),!1;throw new Error("Invalid JSON response")}if(e.meta.code!==200){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,e.meta.error_message),!1;throw new Error("Error from Instagram: "+e.meta.error_message)}if(e.data.length===0){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,"No images were returned from Instagram"),!1;throw new Error("No images were returned from Instagram")}this.options.success!=null&&typeof this.options.success=="function"&&this.options.success.call(this,e),this.context.nextUrl="",e.pagination!=null&&(this.context.nextUrl=e.pagination.next_url);if(this.options.sortBy!=="none"){this.options.sortBy==="random"?d=["","random"]:d=this.options.sortBy.split("-"),p=d[0]==="least"?!0:!1;switch(d[1]){case"random":e.data.sort(function(){return.5-Math.random()});break;case"recent":e.data=this._sortBy(e.data,"created_time",p);break;case"liked":e.data=this._sortBy(e.data,"likes.count",p);break;case"commented":e.data=this._sortBy(e.data,"comments.count",p);break;default:throw new Error("Invalid option for sortBy: '"+this.options.sortBy+"'.")}}if(typeof document!="undefined"&&document!==null&&this.options.mock===!1){a=e.data,this.options.limit!=null&&a.length>this.options.limit&&(a=a.slice(0,this.options.limit+1||9e9)),n=document.createDocumentFragment(),this.options.filter!=null&&typeof this.options.filter=="function"&&(a=this._filter(a,this.options.filter));if(this.options.template!=null&&typeof this.options.template=="string"){i="",o="",l="",v=document.createElement("div");for(m=0,b=a.length;m<b;m++)s=a[m],u=s.images[this.options.resolution].url,this.options.useHttp||(u=u.replace("http://","//")),o=this._makeTemplate(this.options.template,{model:s,id:s.id,link:s.link,image:u,caption:this._getObjectProperty(s,"caption.text"),likes:s.likes.count,comments:s.comments.count,location:this._getObjectProperty(s,"location.name")}),i+=o;v.innerHTML=i,S=[].slice.call(v.childNodes);for(g=0,w=S.length;g<w;g++)h=S[g],n.appendChild(h)}else for(y=0,E=a.length;y<E;y++)s=a[y],f=document.createElement("img"),u=s.images[this.options.resolution].url,this.options.useHttp||(u=u.replace("http://","//")),f.src=u,this.options.links===!0?(t=document.createElement("a"),t.href=s.link,t.appendChild(f),n.appendChild(t)):n.appendChild(f);this.options.target.append(n),r=document.getElementsByTagName("head")[0],r.removeChild(document.getElementById("instafeed-fetcher")),c="instafeedCache"+this.unique,window[c]=void 0;try{delete window[c]}catch(x){}}return this.options.after!=null&&typeof this.options.after=="function"&&this.options.after.call(this),!0},e.prototype._buildUrl=function(){var e,t,n;e="https://api.instagram.com/v1";switch(this.options.get){case"popular":t="media/popular";break;case"tagged":if(typeof this.options.tagName!="string")throw new Error("No tag name specified. Use the 'tagName' option.");t="tags/"+this.options.tagName+"/media/recent";break;case"location":if(typeof this.options.locationId!="number")throw new Error("No location specified. Use the 'locationId' option.");t="locations/"+this.options.locationId+"/media/recent";break;case"user":if(typeof this.options.userId!="number")throw new Error("No user specified. Use the 'userId' option.");if(typeof this.options.accessToken!="string")throw new Error("No access token. Use the 'accessToken' option.");t="users/"+this.options.userId+"/media/recent";break;default:throw new Error("Invalid option for get: '"+this.options.get+"'.")}return n=""+e+"/"+t,this.options.accessToken!=null?n+="?access_token="+this.options.accessToken:n+="?client_id="+this.options.clientId,this.options.limit!=null&&(n+="&count="+this.options.limit),n+="&callback=instafeedCache"+this.unique+".parse",n},e.prototype._genKey=function(){var e;return e=function(){return((1+Math.random())*65536|0).toString(16).substring(1)},""+e()+e()+e()+e()},e.prototype._makeTemplate=function(e,t){var n,r,i,s,o;r=/(?:\{{2})([\w\[\]\.]+)(?:\}{2})/,n=e;while(r.test(n))i=n.match(r)[1],s=(o=this._getObjectProperty(t,i))!=null?o:"",n=n.replace(r,""+s);return n},e.prototype._getObjectProperty=function(e,t){var n,r;t=t.replace(/\[(\w+)\]/g,".$1"),r=t.split(".");while(r.length){n=r.shift();if(!(e!=null&&n in e))return null;e=e[n]}return e},e.prototype._sortBy=function(e,t,n){var r;return r=function(e,r){var i,s;return i=this._getObjectProperty(e,t),s=this._getObjectProperty(r,t),n?i>s?1:-1:i<s?1:-1},e.sort(r.bind(this)),e},e.prototype._filter=function(e,t){var n,r,i,s,o;n=[],i=function(e){if(t(e))return n.push(e)};for(s=0,o=e.length;s<o;s++)r=e[s],i(r);return n},e}(),t=typeof exports!="undefined"&&exports!==null?exports:window,t.instagramfeed=e}).call(this);
5
-
6
- //Shim for "fixing" IE's lack of support (IE < 9) for applying slice on host objects like NamedNodeMap, NodeList, and HTMLCollection) https://github.com/stevenschobert/instafeed.js/issues/84
7
- (function(){"use strict";var e=Array.prototype.slice;try{e.call(document.documentElement)}catch(t){Array.prototype.slice=function(t,n){n=typeof n!=="undefined"?n:this.length;if(Object.prototype.toString.call(this)==="[object Array]"){return e.call(this,t,n)}var r,i=[],s,o=this.length;var u=t||0;u=u>=0?u:o+u;var a=n?n:o;if(n<0){a=o+n}s=a-u;if(s>0){i=new Array(s);if(this.charAt){for(r=0;r<s;r++){i[r]=this.charAt(u+r)}}else{for(r=0;r<s;r++){i[r]=this[u+r]}}}return i}}})()
8
-
9
- //IE8 also doesn't offer the .bind() method triggered by the 'sortBy' property. Copy and paste the polyfill offered here:
10
- if(!Function.prototype.bind){Function.prototype.bind=function(e){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable")}var t=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};r.prototype=this.prototype;i.prototype=new r;return i}}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
  function sbi_init(){
13
  // used to track multiple feeds on the page
@@ -145,7 +298,6 @@ if(!sbi_js_exists){
145
  userId: parseInt( entry, 10 ),
146
  accessToken: sb_instagram_js_options.sb_instagram_at,
147
  after: function() {
148
-
149
  $self.find('.sbi_loader').remove();
150
  $self.find('.sbi_load_btn .fa-spinner').hide();
151
  $self.find('.sbi_load_btn .sbi_btn_text').css('opacity', 1);
@@ -170,8 +322,8 @@ if(!sbi_js_exists){
170
  // Use imagefill to set the images as backgrounds so they can be square
171
  !function () {
172
  var css = sbi_imgLiquid.injectCss,
173
- head = document.getElementsByTagName('head')[0],
174
- style = document.createElement('style');
175
  style.type = 'text/css';
176
  if (style.styleSheet) {
177
  style.styleSheet.cssText = css;
@@ -186,7 +338,7 @@ if(!sbi_js_exists){
186
  //Only check the width once the resize event is over
187
  var sbi_delay = (function(){
188
  var sbi_timer = 0;
189
- return function(sbi_callback, sbi_ms){
190
  clearTimeout (sbi_timer);
191
  sbi_timer = setTimeout(sbi_callback, sbi_ms);
192
  };
@@ -212,7 +364,7 @@ if(!sbi_js_exists){
212
  if( sbiWindowWidth < 640 && (parseInt(cols) > 2 && parseInt(cols) < 7 ) ) sbi_num_cols = 2;
213
  if( sbiWindowWidth < 640 && (parseInt(cols) > 6 && parseInt(cols) < 11 ) ) sbi_num_cols = 4;
214
  if( sbiWindowWidth <= 480 && parseInt(cols) > 2 ) sbi_num_cols = 1;
215
- }
216
 
217
  //Figure out what the width should be using the number of cols
218
  var sbi_photo_width_manual = ( $self.find('#sbi_images').width() / sbi_num_cols ) - (feedOptions.imagepadding*2);
@@ -232,7 +384,7 @@ if(!sbi_js_exists){
232
  //If the feed is initially hidden (in a tab for example) then check for when it becomes visible and set then set the height
233
  jQuery(".sbi").filter(':hidden').sbiVisibilityChanged({
234
  callback: function(element, visible) {
235
- sbiSetPhotoHeight();
236
  },
237
  runOnLoad: false
238
  });
@@ -277,13 +429,13 @@ if(!sbi_js_exists){
277
  }, 500);
278
 
279
  function sbiGetItemSize(){
280
- $self.removeClass('sbi_small sbi_medium');
281
- var sbiItemWidth = $self.find('.sbi_item').innerWidth();
282
- if( sbiItemWidth > 120 && sbiItemWidth < 240 ){
283
- $self.addClass('sbi_medium');
284
- } else if( sbiItemWidth <= 120 ){
285
- $self.addClass('sbi_small');
286
- }
287
  }
288
  sbiGetItemSize();
289
 
@@ -331,7 +483,7 @@ if(!sbi_js_exists){
331
  userFeed.run();
332
 
333
  }); //End User ID array loop
334
-
335
  });
336
 
337
  }
1
  var sbi_js_exists = (typeof sbi_js_exists !== 'undefined') ? true : false;
2
  if(!sbi_js_exists){
3
 
4
+ (function() {
5
+ var e, t;
6
+ e = function() {
7
+ function e(e, t) {
8
+ var n, r;
9
+ this.options = {
10
+ target: "instafeed",
11
+ get: "popular",
12
+ resolution: "thumbnail",
13
+ sortBy: "none",
14
+ links: !0,
15
+ mock: !1,
16
+ useHttp: !1
17
+ };
18
+ if (typeof e == "object")
19
+ for (n in e) r = e[n], this.options[n] = r;
20
+ this.context = t != null ? t : this, this.unique = this._genKey()
21
+ }
22
+ return e.prototype.hasNext = function() {
23
+ return typeof this.context.nextUrl == "string" && this.context.nextUrl.length > 0
24
+ }, e.prototype.next = function() {
25
+ return this.hasNext() ? this.run(this.context.nextUrl) : !1
26
+ }, e.prototype.run = function(t) {
27
+ var n, r, i;
28
+ if (typeof this.options.clientId != "string" && typeof this.options.accessToken != "string") throw new Error("Missing clientId or accessToken.");
29
+ if (typeof this.options.accessToken != "string" && typeof this.options.clientId != "string") throw new Error("Missing clientId or accessToken.");
30
+ return this.options.before != null && typeof this.options.before == "function" && this.options.before.call(this), typeof document != "undefined" && document !== null && (i = document.createElement("script"), i.id = "instafeed-fetcher", i.src = t || this._buildUrl(), n = document.getElementsByTagName("head"), n[0].appendChild(i), r = "instafeedCache" + this.unique, window[r] = new e(this.options, this), window[r].unique = this.unique), !0
31
+ }, e.prototype.parse = function(e) {
32
+ var t, n, r, i, s, o, u, a, f, l, c, h, p, d, v, m, g, y, b, w, E, S;
33
+ if (typeof e != "object") {
34
+ if (this.options.error != null && typeof this.options.error == "function") return this.options.error.call(this, "Invalid JSON data"), !1;
35
+ throw new Error("Invalid JSON response")
36
+ }
37
+ if (e.meta.code !== 200) {
38
+ if (this.options.error != null && typeof this.options.error == "function") return this.options.error.call(this, e.meta.error_message), !1;
39
+ throw new Error("Error from Instagram: " + e.meta.error_message)
40
+ }
41
+ if (e.data.length === 0) {
42
+ if (this.options.error != null && typeof this.options.error == "function") return this.options.error.call(this, "No images were returned from Instagram"), !1;
43
+ throw new Error("No images were returned from Instagram")
44
+ }
45
+ this.options.success != null && typeof this.options.success == "function" && this.options.success.call(this, e), this.context.nextUrl = "", e.pagination != null && (this.context.nextUrl = e.pagination.next_url);
46
+ var lastVisiblePost = typeof e.data[Math.min(this.options.limit - 1,e.data.length-1)] !== 'undefined' ? e.data[Math.min(this.options.limit - 1,e.data.length-1)] : e.data[e.data.length],
47
+ lastRetrievedPost = e.data[e.data.length-1];
48
+ if (typeof e.pagination.next_url !== 'undefined') {
49
+ this.context.nextUrl = e.pagination.next_url.replace(lastRetrievedPost.id, lastVisiblePost.id);
50
+ }
51
+ if (e.data.length > this.options.limit) {
52
+ e.data = e.data.slice(0,this.options.limit);
53
+ }
54
+ if (this.options.sortBy !== "none") {
55
+ this.options.sortBy === "random" ? d = ["", "random"] : d = this.options.sortBy.split("-"), p = d[0] === "least" ? !0 : !1;
56
+ switch (d[1]) {
57
+ case "random":
58
+ e.data.sort(function() {
59
+ return .5 - Math.random()
60
+ });
61
+ break;
62
+ case "recent":
63
+ e.data = this._sortBy(e.data, "created_time", p);
64
+ break;
65
+ case "liked":
66
+ e.data = this._sortBy(e.data, "likes.count", p);
67
+ break;
68
+ case "commented":
69
+ e.data = this._sortBy(e.data, "comments.count", p);
70
+ break;
71
+ default:
72
+ throw new Error("Invalid option for sortBy: '" + this.options.sortBy + "'.")
73
+ }
74
+ }
75
+ if (typeof document != "undefined" && document !== null && this.options.mock === !1) {
76
+ a = e.data, this.options.limit != null && a.length > this.options.limit && (a = a.slice(0, this.options.limit + 1 || 9e9)), n = document.createDocumentFragment(), this.options.filter != null && typeof this.options.filter == "function" && (a = this._filter(a, this.options.filter));
77
+ if (this.options.template != null && typeof this.options.template == "string") {
78
+ i = "", o = "", l = "", v = document.createElement("div");
79
+ for (m = 0, b = a.length; m < b; m++) s = a[m], u = s.images[this.options.resolution].url, this.options.useHttp || (u = u.replace("http://", "//")), o = this._makeTemplate(this.options.template, {
80
+ model: s,
81
+ id: s.id,
82
+ link: s.link,
83
+ image: u,
84
+ caption: this._getObjectProperty(s, "caption.text"),
85
+ likes: s.likes.count,
86
+ comments: s.comments.count,
87
+ location: this._getObjectProperty(s, "location.name")
88
+ }), i += o;
89
+ v.innerHTML = i, S = [].slice.call(v.childNodes);
90
+ for (g = 0, w = S.length; g < w; g++) h = S[g], n.appendChild(h)
91
+ } else
92
+ for (y = 0, E = a.length; y < E; y++) s = a[y], f = document.createElement("img"), u = s.images[this.options.resolution].url, this.options.useHttp || (u = u.replace("http://", "//")), f.src = u, this.options.links === !0 ? (t = document.createElement("a"), t.href = s.link, t.appendChild(f), n.appendChild(t)) : n.appendChild(f);
93
+ this.options.target.append(n), r = document.getElementsByTagName("head")[0], r.removeChild(document.getElementById("instafeed-fetcher")), c = "instafeedCache" + this.unique, window[c] = void 0;
94
+ try {
95
+ delete window[c]
96
+ } catch (x) {}
97
+ }
98
+ return this.options.after != null && typeof this.options.after == "function" && this.options.after.call(this), !0
99
+ }, e.prototype._buildUrl = function() {
100
+ var e, t, n;
101
+ e = "https://api.instagram.com/v1";
102
+ switch (this.options.get) {
103
+ case "popular":
104
+ t = "media/popular";
105
+ break;
106
+ case "tagged":
107
+ if (typeof this.options.tagName != "string") throw new Error("No tag name specified. Use the 'tagName' option.");
108
+ t = "tags/" + this.options.tagName + "/media/recent";
109
+ break;
110
+ case "location":
111
+ if (typeof this.options.locationId != "number") throw new Error("No location specified. Use the 'locationId' option.");
112
+ t = "locations/" + this.options.locationId + "/media/recent";
113
+ break;
114
+ case "user":
115
+ if (typeof this.options.userId != "number") throw new Error("No user specified. Use the 'userId' option.");
116
+ if (typeof this.options.accessToken != "string") throw new Error("No access token. Use the 'accessToken' option.");
117
+ t = "users/" + this.options.userId + "/media/recent";
118
+ break;
119
+ default:
120
+ throw new Error("Invalid option for get: '" + this.options.get + "'.")
121
+ }
122
+ return n = "" + e + "/" + t, this.options.accessToken != null ? n += "?access_token=" + this.options.accessToken : n += "?client_id=" + this.options.clientId, this.options.limit != null && (n += "&count=33"), n += "&callback=instafeedCache" + this.unique + ".parse", n
123
+ }, e.prototype._genKey = function() {
124
+ var e;
125
+ return e = function() {
126
+ return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1)
127
+ }, "" + e() + e() + e() + e()
128
+ }, e.prototype._makeTemplate = function(e, t) {
129
+ var n, r, i, s, o;
130
+ r = /(?:\{{2})([\w\[\]\.]+)(?:\}{2})/, n = e;
131
+ while (r.test(n)) i = n.match(r)[1], s = (o = this._getObjectProperty(t, i)) != null ? o : "", n = n.replace(r, "" + s);
132
+ return n
133
+ }, e.prototype._getObjectProperty = function(e, t) {
134
+ var n, r;
135
+ t = t.replace(/\[(\w+)\]/g, ".$1"), r = t.split(".");
136
+ while (r.length) {
137
+ n = r.shift();
138
+ if (!(e != null && n in e)) return null;
139
+ e = e[n]
140
+ }
141
+ return e
142
+ }, e.prototype._sortBy = function(e, t, n) {
143
+ var r;
144
+ return r = function(e, r) {
145
+ var i, s;
146
+ return i = this._getObjectProperty(e, t), s = this._getObjectProperty(r, t), n ? i > s ? 1 : -1 : i < s ? 1 : -1
147
+ }, e.sort(r.bind(this)), e
148
+ }, e.prototype._filter = function(e, t) {
149
+ var n, r, i, s, o;
150
+ n = [], i = function(e) {
151
+ if (t(e)) return n.push(e)
152
+ };
153
+ for (s = 0, o = e.length; s < o; s++) r = e[s], i(r);
154
+ return n
155
+ }, e
156
+ }(), t = typeof exports != "undefined" && exports !== null ? exports : window, t.instagramfeed = e
157
+ }).call(this);
158
+
159
+ //Shim for "fixing" IE's lack of support (IE < 9) for applying slice on host objects like NamedNodeMap, NodeList, and HTMLCollection) https://github.com/stevenschobert/instafeed.js/issues/84
160
+ (function(){"use strict";var e=Array.prototype.slice;try{e.call(document.documentElement)}catch(t){Array.prototype.slice=function(t,n){n=typeof n!=="undefined"?n:this.length;if(Object.prototype.toString.call(this)==="[object Array]"){return e.call(this,t,n)}var r,i=[],s,o=this.length;var u=t||0;u=u>=0?u:o+u;var a=n?n:o;if(n<0){a=o+n}s=a-u;if(s>0){i=new Array(s);if(this.charAt){for(r=0;r<s;r++){i[r]=this.charAt(u+r)}}else{for(r=0;r<s;r++){i[r]=this[u+r]}}}return i}}})()
161
+
162
+ //IE8 also doesn't offer the .bind() method triggered by the 'sortBy' property. Copy and paste the polyfill offered here:
163
+ if(!Function.prototype.bind){Function.prototype.bind=function(e){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable")}var t=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};r.prototype=this.prototype;i.prototype=new r;return i}}
164
 
165
  function sbi_init(){
166
  // used to track multiple feeds on the page
298
  userId: parseInt( entry, 10 ),
299
  accessToken: sb_instagram_js_options.sb_instagram_at,
300
  after: function() {
 
301
  $self.find('.sbi_loader').remove();
302
  $self.find('.sbi_load_btn .fa-spinner').hide();
303
  $self.find('.sbi_load_btn .sbi_btn_text').css('opacity', 1);
322
  // Use imagefill to set the images as backgrounds so they can be square
323
  !function () {
324
  var css = sbi_imgLiquid.injectCss,
325
+ head = document.getElementsByTagName('head')[0],
326
+ style = document.createElement('style');
327
  style.type = 'text/css';
328
  if (style.styleSheet) {
329
  style.styleSheet.cssText = css;
338
  //Only check the width once the resize event is over
339
  var sbi_delay = (function(){
340
  var sbi_timer = 0;
341
+ return function(sbi_callback, sbi_ms){
342
  clearTimeout (sbi_timer);
343
  sbi_timer = setTimeout(sbi_callback, sbi_ms);
344
  };
364
  if( sbiWindowWidth < 640 && (parseInt(cols) > 2 && parseInt(cols) < 7 ) ) sbi_num_cols = 2;
365
  if( sbiWindowWidth < 640 && (parseInt(cols) > 6 && parseInt(cols) < 11 ) ) sbi_num_cols = 4;
366
  if( sbiWindowWidth <= 480 && parseInt(cols) > 2 ) sbi_num_cols = 1;
367
+ }
368
 
369
  //Figure out what the width should be using the number of cols
370
  var sbi_photo_width_manual = ( $self.find('#sbi_images').width() / sbi_num_cols ) - (feedOptions.imagepadding*2);
384
  //If the feed is initially hidden (in a tab for example) then check for when it becomes visible and set then set the height
385
  jQuery(".sbi").filter(':hidden').sbiVisibilityChanged({
386
  callback: function(element, visible) {
387
+ sbiSetPhotoHeight();
388
  },
389
  runOnLoad: false
390
  });
429
  }, 500);
430
 
431
  function sbiGetItemSize(){
432
+ $self.removeClass('sbi_small sbi_medium');
433
+ var sbiItemWidth = $self.find('.sbi_item').innerWidth();
434
+ if( sbiItemWidth > 120 && sbiItemWidth < 240 ){
435
+ $self.addClass('sbi_medium');
436
+ } else if( sbiItemWidth <= 120 ){
437
+ $self.addClass('sbi_small');
438
+ }
439
  }
440
  sbiGetItemSize();
441
 
483
  userFeed.run();
484
 
485
  }); //End User ID array loop
486
+
487
  });
488
 
489
  }
js/sb-instagram.min.js CHANGED
@@ -1,4 +1,15 @@
1
- var sbi_js_exists=(typeof sbi_js_exists!=='undefined')?!0:!1;if(!sbi_js_exists){(function(){var e,t;e=function(){function e(e,t){var n,r;this.options={target:"instafeed",get:"popular",resolution:"thumbnail",sortBy:"none",links:!0,mock:!1,useHttp:!1};if(typeof e=="object")for(n in e)r=e[n],this.options[n]=r;this.context=t!=null?t:this,this.unique=this._genKey()}return e.prototype.hasNext=function(){return typeof this.context.nextUrl=="string"&&this.context.nextUrl.length>0},e.prototype.next=function(){return this.hasNext()?this.run(this.context.nextUrl):!1},e.prototype.run=function(t){var n,r,i;if(typeof this.options.clientId!="string"&&typeof this.options.accessToken!="string")throw new Error("Missing clientId or accessToken.");if(typeof this.options.accessToken!="string"&&typeof this.options.clientId!="string")throw new Error("Missing clientId or accessToken.");return this.options.before!=null&&typeof this.options.before=="function"&&this.options.before.call(this),typeof document!="undefined"&&document!==null&&(i=document.createElement("script"),i.id="instafeed-fetcher",i.src=t||this._buildUrl(),n=document.getElementsByTagName("head"),n[0].appendChild(i),r="instafeedCache"+this.unique,window[r]=new e(this.options,this),window[r].unique=this.unique),!0},e.prototype.parse=function(e){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S;if(typeof e!="object"){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,"Invalid JSON data"),!1;throw new Error("Invalid JSON response")}if(e.meta.code!==200){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,e.meta.error_message),!1;throw new Error("Error from Instagram: "+e.meta.error_message)}if(e.data.length===0){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,"No images were returned from Instagram"),!1;throw new Error("No images were returned from Instagram")}this.options.success!=null&&typeof this.options.success=="function"&&this.options.success.call(this,e),this.context.nextUrl="",e.pagination!=null&&(this.context.nextUrl=e.pagination.next_url);if(this.options.sortBy!=="none"){this.options.sortBy==="random"?d=["","random"]:d=this.options.sortBy.split("-"),p=d[0]==="least"?!0:!1;switch(d[1]){case"random":e.data.sort(function(){return.5-Math.random()});break;case"recent":e.data=this._sortBy(e.data,"created_time",p);break;case"liked":e.data=this._sortBy(e.data,"likes.count",p);break;case"commented":e.data=this._sortBy(e.data,"comments.count",p);break;default:throw new Error("Invalid option for sortBy: '"+this.options.sortBy+"'.")}}if(typeof document!="undefined"&&document!==null&&this.options.mock===!1){a=e.data,this.options.limit!=null&&a.length>this.options.limit&&(a=a.slice(0,this.options.limit+1||9e9)),n=document.createDocumentFragment(),this.options.filter!=null&&typeof this.options.filter=="function"&&(a=this._filter(a,this.options.filter));if(this.options.template!=null&&typeof this.options.template=="string"){i="",o="",l="",v=document.createElement("div");for(m=0,b=a.length;m<b;m++)s=a[m],u=s.images[this.options.resolution].url,this.options.useHttp||(u=u.replace("http://","//")),o=this._makeTemplate(this.options.template,{model:s,id:s.id,link:s.link,image:u,caption:this._getObjectProperty(s,"caption.text"),likes:s.likes.count,comments:s.comments.count,location:this._getObjectProperty(s,"location.name")}),i+=o;v.innerHTML=i,S=[].slice.call(v.childNodes);for(g=0,w=S.length;g<w;g++)h=S[g],n.appendChild(h)}else for(y=0,E=a.length;y<E;y++)s=a[y],f=document.createElement("img"),u=s.images[this.options.resolution].url,this.options.useHttp||(u=u.replace("http://","//")),f.src=u,this.options.links===!0?(t=document.createElement("a"),t.href=s.link,t.appendChild(f),n.appendChild(t)):n.appendChild(f);this.options.target.append(n),r=document.getElementsByTagName("head")[0],r.removeChild(document.getElementById("instafeed-fetcher")),c="instafeedCache"+this.unique,window[c]=void 0;try{delete window[c]}catch(x){}}return this.options.after!=null&&typeof this.options.after=="function"&&this.options.after.call(this),!0},e.prototype._buildUrl=function(){var e,t,n;e="https://api.instagram.com/v1";switch(this.options.get){case"popular":t="media/popular";break;case"tagged":if(typeof this.options.tagName!="string")throw new Error("No tag name specified. Use the 'tagName' option.");t="tags/"+this.options.tagName+"/media/recent";break;case"location":if(typeof this.options.locationId!="number")throw new Error("No location specified. Use the 'locationId' option.");t="locations/"+this.options.locationId+"/media/recent";break;case"user":if(typeof this.options.userId!="number")throw new Error("No user specified. Use the 'userId' option.");if(typeof this.options.accessToken!="string")throw new Error("No access token. Use the 'accessToken' option.");t="users/"+this.options.userId+"/media/recent";break;default:throw new Error("Invalid option for get: '"+this.options.get+"'.")}return n=""+e+"/"+t,this.options.accessToken!=null?n+="?access_token="+this.options.accessToken:n+="?client_id="+this.options.clientId,this.options.limit!=null&&(n+="&count="+this.options.limit),n+="&callback=instafeedCache"+this.unique+".parse",n},e.prototype._genKey=function(){var e;return e=function(){return((1+Math.random())*65536|0).toString(16).substring(1)},""+e()+e()+e()+e()},e.prototype._makeTemplate=function(e,t){var n,r,i,s,o;r=/(?:\{{2})([\w\[\]\.]+)(?:\}{2})/,n=e;while(r.test(n))i=n.match(r)[1],s=(o=this._getObjectProperty(t,i))!=null?o:"",n=n.replace(r,""+s);return n},e.prototype._getObjectProperty=function(e,t){var n,r;t=t.replace(/\[(\w+)\]/g,".$1"),r=t.split(".");while(r.length){n=r.shift();if(!(e!=null&&n in e))return null;e=e[n]}return e},e.prototype._sortBy=function(e,t,n){var r;return r=function(e,r){var i,s;return i=this._getObjectProperty(e,t),s=this._getObjectProperty(r,t),n?i>s?1:-1:i<s?1:-1},e.sort(r.bind(this)),e},e.prototype._filter=function(e,t){var n,r,i,s,o;n=[],i=function(e){if(t(e))return n.push(e)};for(s=0,o=e.length;s<o;s++)r=e[s],i(r);return n},e}(),t=typeof exports!="undefined"&&exports!==null?exports:window,t.instagramfeed=e}).call(this);(function(){"use strict";var e=Array.prototype.slice;try{e.call(document.documentElement)}catch(t){Array.prototype.slice=function(t,n){n=typeof n!=="undefined"?n:this.length;if(Object.prototype.toString.call(this)==="[object Array]"){return e.call(this,t,n)}var r,i=[],s,o=this.length;var u=t||0;u=u>=0?u:o+u;var a=n?n:o;if(n<0){a=o+n}s=a-u;if(s>0){i=new Array(s);if(this.charAt){for(r=0;r<s;r++){i[r]=this.charAt(u+r)}}else{for(r=0;r<s;r++){i[r]=this[u+r]}}}return i}}})()
 
 
 
 
 
 
 
 
 
 
 
2
  if(!Function.prototype.bind){Function.prototype.bind=function(e){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable")}var t=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};r.prototype=this.prototype;i.prototype=new r;return i}}
3
  function sbi_init(){window.sbiFeedMeta={};jQuery('#sb_instagram.sbi').each(function($i){var $self=jQuery(this),$target=$self.find('#sbi_images'),$loadBtn=$self.find("#sbi_load .sbi_load_btn"),imgRes='standard_resolution',cols=parseInt(this.getAttribute('data-cols'),10),feedOptions=JSON.parse(this.getAttribute('data-options')),getType='user',sortby='none',user_id=this.getAttribute('data-id'),num=this.getAttribute('data-num'),$header='',morePosts=[];jQuery(this).attr('data-sbi-index',$i);feedOptions.feedIndex=$i;window.sbiFeedMeta[$i]={'error':{},'idsInFeed':[]};if(feedOptions.sortby!=='')sortby=feedOptions.sortby;switch(this.getAttribute('data-res')){case 'auto':var feedWidth=$self.innerWidth(),colWidth=$self.innerWidth()/cols;var sbiWindowWidth=jQuery(window).width();if(sbiWindowWidth<640){if(feedWidth<640&&$self.is('.sbi_col_3, .sbi_col_4, .sbi_col_5, .sbi_col_6'))colWidth=300;if(feedWidth<640&&$self.is('.sbi_col_7, .sbi_col_8, .sbi_col_9, .sbi_col_10'))colWidth=100;if((feedWidth>320&&feedWidth<480)&&sbiWindowWidth<480)colWidth=480;if(feedWidth<320&&sbiWindowWidth<480)colWidth=300}
4
  if(colWidth<150){imgRes='thumbnail'}else if(colWidth<320){imgRes='low_resolution'}else{imgRes='standard_resolution'}
1
+ var sbi_js_exists=(typeof sbi_js_exists!=='undefined')?!0:!1;if(!sbi_js_exists){(function(){var e,t;e=function(){function e(e,t){var n,r;this.options={target:"instafeed",get:"popular",resolution:"thumbnail",sortBy:"none",links:!0,mock:!1,useHttp:!1};if(typeof e=="object")
2
+ for(n in e)r=e[n],this.options[n]=r;this.context=t!=null?t:this,this.unique=this._genKey()}
3
+ return e.prototype.hasNext=function(){return typeof this.context.nextUrl=="string"&&this.context.nextUrl.length>0},e.prototype.next=function(){return this.hasNext()?this.run(this.context.nextUrl):!1},e.prototype.run=function(t){var n,r,i;if(typeof this.options.clientId!="string"&&typeof this.options.accessToken!="string")throw new Error("Missing clientId or accessToken.");if(typeof this.options.accessToken!="string"&&typeof this.options.clientId!="string")throw new Error("Missing clientId or accessToken.");return this.options.before!=null&&typeof this.options.before=="function"&&this.options.before.call(this),typeof document!="undefined"&&document!==null&&(i=document.createElement("script"),i.id="instafeed-fetcher",i.src=t||this._buildUrl(),n=document.getElementsByTagName("head"),n[0].appendChild(i),r="instafeedCache"+this.unique,window[r]=new e(this.options,this),window[r].unique=this.unique),!0},e.prototype.parse=function(e){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S;if(typeof e!="object"){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,"Invalid JSON data"),!1;throw new Error("Invalid JSON response")}
4
+ if(e.meta.code!==200){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,e.meta.error_message),!1;throw new Error("Error from Instagram: "+e.meta.error_message)}
5
+ if(e.data.length===0){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,"No images were returned from Instagram"),!1;throw new Error("No images were returned from Instagram")}
6
+ this.options.success!=null&&typeof this.options.success=="function"&&this.options.success.call(this,e),this.context.nextUrl="",e.pagination!=null&&(this.context.nextUrl=e.pagination.next_url);var lastVisiblePost=typeof e.data[Math.min(this.options.limit-1,e.data.length-1)]!=='undefined'?e.data[Math.min(this.options.limit-1,e.data.length-1)]:e.data[e.data.length],lastRetrievedPost=e.data[e.data.length-1];if(typeof e.pagination.next_url!=='undefined'){this.context.nextUrl=e.pagination.next_url.replace(lastRetrievedPost.id,lastVisiblePost.id)}
7
+ if(e.data.length>this.options.limit){e.data=e.data.slice(0,this.options.limit)}
8
+ if(this.options.sortBy!=="none"){this.options.sortBy==="random"?d=["","random"]:d=this.options.sortBy.split("-"),p=d[0]==="least"?!0:!1;switch(d[1]){case "random":e.data.sort(function(){return.5-Math.random()});break;case "recent":e.data=this._sortBy(e.data,"created_time",p);break;case "liked":e.data=this._sortBy(e.data,"likes.count",p);break;case "commented":e.data=this._sortBy(e.data,"comments.count",p);break;default:throw new Error("Invalid option for sortBy: '"+this.options.sortBy+"'.")}}
9
+ if(typeof document!="undefined"&&document!==null&&this.options.mock===!1){a=e.data,this.options.limit!=null&&a.length>this.options.limit&&(a=a.slice(0,this.options.limit+1||9e9)),n=document.createDocumentFragment(),this.options.filter!=null&&typeof this.options.filter=="function"&&(a=this._filter(a,this.options.filter));if(this.options.template!=null&&typeof this.options.template=="string"){i="",o="",l="",v=document.createElement("div");for(m=0,b=a.length;m<b;m++)s=a[m],u=s.images[this.options.resolution].url,this.options.useHttp||(u=u.replace("http://","//")),o=this._makeTemplate(this.options.template,{model:s,id:s.id,link:s.link,image:u,caption:this._getObjectProperty(s,"caption.text"),likes:s.likes.count,comments:s.comments.count,location:this._getObjectProperty(s,"location.name")}),i+=o;v.innerHTML=i,S=[].slice.call(v.childNodes);for(g=0,w=S.length;g<w;g++)h=S[g],n.appendChild(h)}else for(y=0,E=a.length;y<E;y++)s=a[y],f=document.createElement("img"),u=s.images[this.options.resolution].url,this.options.useHttp||(u=u.replace("http://","//")),f.src=u,this.options.links===!0?(t=document.createElement("a"),t.href=s.link,t.appendChild(f),n.appendChild(t)):n.appendChild(f);this.options.target.append(n),r=document.getElementsByTagName("head")[0],r.removeChild(document.getElementById("instafeed-fetcher")),c="instafeedCache"+this.unique,window[c]=void 0;try{delete window[c]}catch(x){}}
10
+ return this.options.after!=null&&typeof this.options.after=="function"&&this.options.after.call(this),!0},e.prototype._buildUrl=function(){var e,t,n;e="https://api.instagram.com/v1";switch(this.options.get){case "popular":t="media/popular";break;case "tagged":if(typeof this.options.tagName!="string")throw new Error("No tag name specified. Use the 'tagName' option.");t="tags/"+this.options.tagName+"/media/recent";break;case "location":if(typeof this.options.locationId!="number")throw new Error("No location specified. Use the 'locationId' option.");t="locations/"+this.options.locationId+"/media/recent";break;case "user":if(typeof this.options.userId!="number")throw new Error("No user specified. Use the 'userId' option.");if(typeof this.options.accessToken!="string")throw new Error("No access token. Use the 'accessToken' option.");t="users/"+this.options.userId+"/media/recent";break;default:throw new Error("Invalid option for get: '"+this.options.get+"'.")}
11
+ return n=""+e+"/"+t,this.options.accessToken!=null?n+="?access_token="+this.options.accessToken:n+="?client_id="+this.options.clientId,this.options.limit!=null&&(n+="&count=33"),n+="&callback=instafeedCache"+this.unique+".parse",n},e.prototype._genKey=function(){var e;return e=function(){return((1+Math.random())*65536|0).toString(16).substring(1)},""+e()+e()+e()+e()},e.prototype._makeTemplate=function(e,t){var n,r,i,s,o;r=/(?:\{{2})([\w\[\]\.]+)(?:\}{2})/,n=e;while(r.test(n))i=n.match(r)[1],s=(o=this._getObjectProperty(t,i))!=null?o:"",n=n.replace(r,""+s);return n},e.prototype._getObjectProperty=function(e,t){var n,r;t=t.replace(/\[(\w+)\]/g,".$1"),r=t.split(".");while(r.length){n=r.shift();if(!(e!=null&&n in e))return null;e=e[n]}
12
+ return e},e.prototype._sortBy=function(e,t,n){var r;return r=function(e,r){var i,s;return i=this._getObjectProperty(e,t),s=this._getObjectProperty(r,t),n?i>s?1:-1:i<s?1:-1},e.sort(r.bind(this)),e},e.prototype._filter=function(e,t){var n,r,i,s,o;n=[],i=function(e){if(t(e))return n.push(e)};for(s=0,o=e.length;s<o;s++)r=e[s],i(r);return n},e}(),t=typeof exports!="undefined"&&exports!==null?exports:window,t.instagramfeed=e}).call(this);(function(){"use strict";var e=Array.prototype.slice;try{e.call(document.documentElement)}catch(t){Array.prototype.slice=function(t,n){n=typeof n!=="undefined"?n:this.length;if(Object.prototype.toString.call(this)==="[object Array]"){return e.call(this,t,n)}var r,i=[],s,o=this.length;var u=t||0;u=u>=0?u:o+u;var a=n?n:o;if(n<0){a=o+n}s=a-u;if(s>0){i=new Array(s);if(this.charAt){for(r=0;r<s;r++){i[r]=this.charAt(u+r)}}else{for(r=0;r<s;r++){i[r]=this[u+r]}}}return i}}})()
13
  if(!Function.prototype.bind){Function.prototype.bind=function(e){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable")}var t=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};r.prototype=this.prototype;i.prototype=new r;return i}}
14
  function sbi_init(){window.sbiFeedMeta={};jQuery('#sb_instagram.sbi').each(function($i){var $self=jQuery(this),$target=$self.find('#sbi_images'),$loadBtn=$self.find("#sbi_load .sbi_load_btn"),imgRes='standard_resolution',cols=parseInt(this.getAttribute('data-cols'),10),feedOptions=JSON.parse(this.getAttribute('data-options')),getType='user',sortby='none',user_id=this.getAttribute('data-id'),num=this.getAttribute('data-num'),$header='',morePosts=[];jQuery(this).attr('data-sbi-index',$i);feedOptions.feedIndex=$i;window.sbiFeedMeta[$i]={'error':{},'idsInFeed':[]};if(feedOptions.sortby!=='')sortby=feedOptions.sortby;switch(this.getAttribute('data-res')){case 'auto':var feedWidth=$self.innerWidth(),colWidth=$self.innerWidth()/cols;var sbiWindowWidth=jQuery(window).width();if(sbiWindowWidth<640){if(feedWidth<640&&$self.is('.sbi_col_3, .sbi_col_4, .sbi_col_5, .sbi_col_6'))colWidth=300;if(feedWidth<640&&$self.is('.sbi_col_7, .sbi_col_8, .sbi_col_9, .sbi_col_10'))colWidth=100;if((feedWidth>320&&feedWidth<480)&&sbiWindowWidth<480)colWidth=480;if(feedWidth<320&&sbiWindowWidth<480)colWidth=300}
15
  if(colWidth<150){imgRes='thumbnail'}else if(colWidth<320){imgRes='low_resolution'}else{imgRes='standard_resolution'}