Instagram Feed - Version 1.4.4

Version Description

  • Fix: Fixed an issue caused by a specific type of emoji which would cause the feed to break when used in a post
  • Tweak: Added links to our other free plugins to the bottom of the admin pages: The Custom Facebook Feed and Custom Twitter Feeds
  • Reminder: If you haven't done so already, please update your Access Token on the plugin's Settings page so that the plugin will continue to work after June 1st.
Download this release

Release Info

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

Code changes from version 1.4.3 to 1.4.4

README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: smashballoon
3
  Tags: Instagram, Instagram feed, Instagram photos, Instagram plugin, Instagram stream, Custom Instagram Feed, responsive Instagram, mobile Instagram, Instagram posts, Instagram wall, Instagram account, Instagram gallery, Instagram photo, Instagram post, Instagram share, Instagram customized, Instagrams, Instagram feeds, Instagram plugins, Instagram responsive, Instagram mobile feed, Instagram accounts, public Instagram feed, Instagram photography, Instagram galleries, multiple Instagram, Instagram widget, Instagram clean, beautiful Instagram, custom Instagram design
4
  Requires at least: 3.0
5
  Tested up to: 4.5.2
6
- Stable tag: 1.4.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -561,6 +561,11 @@ No Waiver of Rights by Instagram: Instagram's failure to exercise or enforce any
561
 
562
  == Changelog ==
563
 
 
 
 
 
 
564
  = 1.4.3 =
565
  * Fix: Important notice added in the last update is now only visible to admins
566
 
3
  Tags: Instagram, Instagram feed, Instagram photos, Instagram plugin, Instagram stream, Custom Instagram Feed, responsive Instagram, mobile Instagram, Instagram posts, Instagram wall, Instagram account, Instagram gallery, Instagram photo, Instagram post, Instagram share, Instagram customized, Instagrams, Instagram feeds, Instagram plugins, Instagram responsive, Instagram mobile feed, Instagram accounts, public Instagram feed, Instagram photography, Instagram galleries, multiple Instagram, Instagram widget, Instagram clean, beautiful Instagram, custom Instagram design
4
  Requires at least: 3.0
5
  Tested up to: 4.5.2
6
+ Stable tag: 1.4.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
561
 
562
  == Changelog ==
563
 
564
+ = 1.4.4 =
565
+ * Fix: Fixed an issue caused by a specific type of emoji which would cause the feed to break when used in a post
566
+ * Tweak: Added links to our other **free** plugins to the bottom of the admin pages: [The Custom Facebook Feed](https://wordpress.org/plugins/custom-facebook-feed/) and [Custom Twitter Feeds](https://wordpress.org/plugins/custom-twitter-feeds/)
567
+ * **Reminder: If you haven't done so already, please update your Access Token on the plugin's Settings page so that the plugin will continue to work after June 1st.**
568
+
569
  = 1.4.3 =
570
  * Fix: Important notice added in the last update is now only visible to admins
571
 
css/sb-instagram-admin.css CHANGED
@@ -166,6 +166,19 @@
166
  background: #eacccc;
167
  margin: 3px 6px 0 0;
168
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
169
 
170
  /* Quick links */
171
  #sbi_admin .sb_instagram_contents_links{
166
  background: #eacccc;
167
  margin: 3px 6px 0 0;
168
  }
169
+ #sbi_admin .sbi_plugins_promo,
170
+ #sbi_admin .sbi_share_plugin{
171
+ width: 100%;
172
+ float: left;
173
+ clear: both;
174
+ }
175
+ #sbi_admin .sbi_plugins_promo a{
176
+ color: #e34f0e;
177
+ }
178
+ #sbi_admin .sbi_share_plugin{
179
+ border-top: 1px solid #ccc;
180
+ margin: 20px 0 0 0;
181
+ }
182
 
183
  /* Quick links */
184
  #sbi_admin .sb_instagram_contents_links{
instagram-feed-admin.php CHANGED
@@ -664,7 +664,7 @@ function sb_instagram_settings_page() {
664
  <p><?php _e("Copy and paste the following shortcode directly into the page, post or widget where you'd like the feed to show up:", 'instagram-feed'); ?></p>
665
  <input type="text" value="[instagram-feed]" size="16" readonly="readonly" style="text-align: center;" onclick="this.focus();this.select()" title="<?php _e('To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac).', 'instagram-feed'); ?>" />
666
 
667
- <h3 style="padding-top: 10px;"><?php _e( 'Multiple Feeds', 'custom-twitter-feed' ); ?></h3>
668
  <p><?php _e("If you'd like to display multiple feeds then you can set different settings directly in the shortcode like so:", 'instagram-feed'); ?>
669
  <code>[instagram-feed num=9 cols=3]</code></p>
670
  <p>You can display as many different feeds as you like, on either the same page or on different pages, by just using the shortcode options below. For example:<br />
@@ -998,6 +998,41 @@ while (list($key, $val) = each($sbi_options)) {
998
  <img src="<?php echo plugins_url( 'img/instagram-pro-promo.png' , __FILE__ ) ?>" alt="Instagram Feed Pro">
999
  </a>
1000
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1001
  </div> <!-- end #sbi_admin -->
1002
 
1003
  <?php } //End Settings page
664
  <p><?php _e("Copy and paste the following shortcode directly into the page, post or widget where you'd like the feed to show up:", 'instagram-feed'); ?></p>
665
  <input type="text" value="[instagram-feed]" size="16" readonly="readonly" style="text-align: center;" onclick="this.focus();this.select()" title="<?php _e('To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac).', 'instagram-feed'); ?>" />
666
 
667
+ <h3 style="padding-top: 10px;"><?php _e( 'Multiple Feeds', 'instagram-feed' ); ?></h3>
668
  <p><?php _e("If you'd like to display multiple feeds then you can set different settings directly in the shortcode like so:", 'instagram-feed'); ?>
669
  <code>[instagram-feed num=9 cols=3]</code></p>
670
  <p>You can display as many different feeds as you like, on either the same page or on different pages, by just using the shortcode options below. For example:<br />
998
  <img src="<?php echo plugins_url( 'img/instagram-pro-promo.png' , __FILE__ ) ?>" alt="Instagram Feed Pro">
999
  </a>
1000
 
1001
+ <p class="sbi_plugins_promo dashicons-before dashicons-admin-plugins"> Check out our other free plugins: <a href="https://wordpress.org/plugins/custom-facebook-feed/" target="_blank">Facebook</a> and <a href="https://wordpress.org/plugins/custom-twitter-feeds/" target="_blank">Twitter</a>.</p>
1002
+
1003
+ <div class="sbi_share_plugin">
1004
+ <h3><?php _e('Like the plugin? Help spread the word!'); ?></h3>
1005
+
1006
+ <!-- TWITTER -->
1007
+ <a href="https://twitter.com/share" class="twitter-share-button" data-url="https://wordpress.org/plugins/instagram-feed/" data-text="Display beautifully clean, customizable, and responsive feeds from multiple Instagram accounts" data-via="smashballoon" data-dnt="true">Tweet</a>
1008
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
1009
+ <style type="text/css">
1010
+ #twitter-widget-0{ float: left; width: 100px !important; }
1011
+ .IN-widget{ margin-right: 20px; }
1012
+ </style>
1013
+
1014
+ <!-- FACEBOOK -->
1015
+ <div id="fb-root" style="display: none;"></div>
1016
+ <script>(function(d, s, id) {
1017
+ var js, fjs = d.getElementsByTagName(s)[0];
1018
+ if (d.getElementById(id)) return;
1019
+ js = d.createElement(s); js.id = id;
1020
+ js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&appId=640861236031365&version=v2.0";
1021
+ fjs.parentNode.insertBefore(js, fjs);
1022
+ }(document, 'script', 'facebook-jssdk'));</script>
1023
+ <div class="fb-like" data-href="https://wordpress.org/plugins/instagram-feed/" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true" style="display: block; float: left; margin-right: 20px;"></div>
1024
+
1025
+ <!-- LINKEDIN -->
1026
+ <script src="//platform.linkedin.com/in.js" type="text/javascript">
1027
+ lang: en_US
1028
+ </script>
1029
+ <script type="IN/Share" data-url="https://wordpress.org/plugins/instagram-feed/"></script>
1030
+
1031
+ <!-- GOOGLE + -->
1032
+ <script src="https://apis.google.com/js/platform.js" async defer></script>
1033
+ <div class="g-plusone" data-size="medium" data-href="https://wordpress.org/plugins/instagram-feed/"></div>
1034
+ </div>
1035
+
1036
  </div> <!-- end #sbi_admin -->
1037
 
1038
  <?php } //End Settings page
instagram-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Instagram Feed
4
  Plugin URI: http://smashballoon.com/instagram-feed
5
  Description: Display beautifully clean, customizable, and responsive Instagram feeds
6
- Version: 1.4.3
7
  Author: Smash Balloon
8
  Author URI: http://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.4.3' );
27
 
28
  //Include admin
29
  include dirname( __FILE__ ) .'/instagram-feed-admin.php';
3
  Plugin Name: Instagram Feed
4
  Plugin URI: http://smashballoon.com/instagram-feed
5
  Description: Display beautifully clean, customizable, and responsive Instagram feeds
6
+ Version: 1.4.4
7
  Author: Smash Balloon
8
  Author URI: http://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.4.4' );
27
 
28
  //Include admin
29
  include dirname( __FILE__ ) .'/instagram-feed-admin.php';
js/sb-instagram.js CHANGED
@@ -118,9 +118,9 @@ if(!sbi_js_exists){
118
  time = date.getTime();
119
  image.created_time_raw = time;
120
 
121
- //Replace double quotes in the captions with the HTML symbol
122
  //Always check to make sure it exists
123
- if(image.caption != null) image.caption.text = image.caption.text.replace(/"/g, "&quot;");
124
 
125
  return true;
126
  },
118
  time = date.getTime();
119
  image.created_time_raw = time;
120
 
121
+ //Remove all special chars in caption so doesn't cause issue in alt tag
122
  //Always check to make sure it exists
123
+ if(image.caption != null) image.caption.text = image.caption.text.replace(/[^a-zA-Z ]/g, "");
124
 
125
  return true;
126
  },
js/sb-instagram.min.js CHANGED
@@ -1 +1,14 @@
1
- function sbi_init(){jQuery("#sb_instagram.sbi").each(function(){var t=jQuery(this),i=t.find("#sbi_images"),e=t.find("#sbi_load .sbi_load_btn"),s="standard_resolution",o=parseInt(this.getAttribute("data-cols"),10),n=this.getAttribute("data-num"),r=JSON.parse(this.getAttribute("data-options")),a="user",d="none",l=this.getAttribute("data-id"),n=this.getAttribute("data-num"),c="",u=[];switch(""!==r.sortby&&(d=r.sortby),this.getAttribute("data-res")){case"auto":var h=t.innerWidth(),p=t.innerWidth()/o,m=jQuery(window).width();640>m&&(640>h&&t.is(".sbi_col_3, .sbi_col_4, .sbi_col_5, .sbi_col_6")&&(p=300),640>h&&t.is(".sbi_col_7, .sbi_col_8, .sbi_col_9, .sbi_col_10")&&(p=100),h>320&&480>h&&480>m&&(p=480),320>h&&480>m&&(p=300)),s=150>p?"thumbnail":320>p?"low_resolution":"standard_resolution",100>=h&&(s="low_resolution");break;case"thumb":s="thumbnail";break;case"medium":s="low_resolution";break;default:s="standard_resolution"}var f=l.replace(/ /g,"").split(","),g=f,b="",_="https://api.instagram.com/v1/users/"+f[0]+"?access_token="+sb_instagram_js_options.sb_instagram_at;r.headercolor.length&&(b='style="color: #'+r.headercolor+'"'),jQuery.ajax({method:"GET",url:_,dataType:"jsonp",success:function(i){c='<a href="http://instagram.com/'+i.data.username+'" target="_blank" title="@'+i.data.username+'" class="sbi_header_link">',c+='<div class="sbi_header_text">',c+="<h3 "+b,0==i.data.bio.length&&(c+=' class="sbi_no_bio"'),c+=">@"+i.data.username+"</h3>",i.data.bio.length&&(c+='<p class="sbi_bio" '+b+">"+i.data.bio+"</p>"),c+="</div>",c+='<div class="sbi_header_img">',c+='<div class="sbi_header_img_hover"><i class="fa fa-instagram"></i></div>',c+='<img src="'+i.data.profile_picture+'" alt="'+i.data.full_name+'" width="50" height="50">',c+="</div>",c+="</a>",t.find(".sb_instagram_header").prepend(c),t.find(".sbi_follow_btn").length&&t.find(".sbi_follow_btn a").attr("href","http://instagram.com/"+i.data.username)}}),jQuery.each(g,function(l,c){var h=new instagramfeed({target:i,get:a,sortBy:d,resolution:s,limit:parseInt(n,10),template:'<div class="sbi_item sbi_type_{{model.type}} sbi_new" id="sbi_{{id}}" data-date="{{model.created_time_raw}}"><div class="sbi_photo_wrap"><a class="sbi_photo" href="{{link}}" target="_blank"><img src="{{image}}" alt="{{caption}}" width="200" height="200" /></a></div></div>',filter:function(t){var i=new Date(1e3*t.created_time),e=i.getTime();return t.created_time_raw=e,null!=t.caption&&(t.caption.text=t.caption.text.replace(/"/g,"&quot;")),!0},userId:parseInt(c,10),accessToken:sb_instagram_js_options.sb_instagram_at,after:function(){function i(){if("thumbnail"!==s){var i=t.find(".sbi_photo").eq(0).innerWidth(),e=parseInt(o);if(!t.hasClass("sbi_disable_mobile")){var n=jQuery(window).width();640>n&&parseInt(o)>2&&parseInt(o)<7&&(e=2),640>n&&parseInt(o)>6&&parseInt(o)<11&&(e=4),480>=n&&parseInt(o)>2&&(e=1)}var a=t.find("#sbi_images").width()/e-2*r.imagepadding;a>=i&&(i=a),t.find(".sbi_photo").css("height",i)}}function n(){t.removeClass("sbi_small sbi_medium");var i=t.find(".sbi_item").innerWidth();i>120&&240>i?t.addClass("sbi_medium"):120>=i&&t.addClass("sbi_small")}if(t.find(".sbi_loader").remove(),this.hasNext()&&u.push("1"),u.length>0?e.show():(e.hide(),t.css("padding-bottom",0)),"function"==typeof sbi_custom_js&&setTimeout(function(){sbi_custom_js()},100),"thumbnail"!==s){var a=a||{VER:"0.9.944"};a.bgs_Available=!1,a.bgs_CheckRunned=!1,function(t){function i(){if(!a.bgs_CheckRunned){a.bgs_CheckRunned=!0;var i=t('<span style="background-size:cover" />');t("body").append(i),!function(){var t=i[0];if(t&&window.getComputedStyle){var e=window.getComputedStyle(t,null);e&&e.backgroundSize&&(a.bgs_Available="cover"===e.backgroundSize)}}(),i.remove()}}t.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},i();var s=this;return this.options=e,this.settings=t.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(i){function e(){-1===h.css("background-image").indexOf(encodeURI(p.attr("src")))&&h.css({"background-image":'url("'+encodeURI(p.attr("src"))+'")'}),h.css({"background-size":u.fill?"cover":"contain","background-position":(u.horizontalAlign+" "+u.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),t("a:first",h).css({display:"block",width:"100%",height:"100%"}),t("img",h).css({display:"none"}),u.onItemFinish&&u.onItemFinish(i,h,p),h.addClass("sbi_imgLiquid_bgSize"),h.addClass("sbi_imgLiquid_ready"),c()}function o(){function e(){p.data("sbi_imgLiquid_error")||p.data("sbi_imgLiquid_loaded")||p.data("sbi_imgLiquid_oldProcessed")||(h.is(":visible")&&p[0].complete&&p[0].width>0&&p[0].height>0?(p.data("sbi_imgLiquid_loaded",!0),setTimeout(l,i*u.delay)):setTimeout(e,u.timecheckvisibility))}if(p.data("oldSrc")&&p.data("oldSrc")!==p.attr("src")){var s=p.clone().removeAttr("style");return s.data("sbi_imgLiquid_settings",p.data("sbi_imgLiquid_settings")),p.parent().prepend(s),p.remove(),p=s,p[0].width=0,void setTimeout(o,10)}return p.data("sbi_imgLiquid_oldProcessed")?void l():(p.data("sbi_imgLiquid_oldProcessed",!1),p.data("oldSrc",p.attr("src")),t("img:not(:first)",h).css("display","none"),h.css({overflow:"hidden"}),p.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),p.on("error",r),p[0].onerror=r,e(),void n())}function n(){(u.responsive||p.data("sbi_imgLiquid_oldProcessed"))&&p.data("sbi_imgLiquid_settings")&&(u=p.data("sbi_imgLiquid_settings"),h.actualSize=h.get(0).offsetWidth+h.get(0).offsetHeight/1e4,h.sizeOld&&h.actualSize!==h.sizeOld&&l(),h.sizeOld=h.actualSize,setTimeout(n,u.responsiveCheckTime))}function r(){p.data("sbi_imgLiquid_error",!0),h.addClass("sbi_imgLiquid_error"),u.onItemError&&u.onItemError(i,h,p),c()}function d(){var t={};if(s.settings.useDataHtmlAttr){var i=h.attr("data-sbi_imgLiquid-fill"),e=h.attr("data-sbi_imgLiquid-horizontalAlign"),o=h.attr("data-sbi_imgLiquid-verticalAlign");("true"===i||"false"===i)&&(t.fill=Boolean("true"===i)),void 0===e||"left"!==e&&"center"!==e&&"right"!==e&&-1===e.indexOf("%")||(t.horizontalAlign=e),void 0===o||"top"!==o&&"bottom"!==o&&"center"!==o&&-1===o.indexOf("%")||(t.verticalAlign=o)}return a.isIE&&s.settings.ieFadeInDisabled&&(t.fadeInTime=0),t}function l(){var t,e,s,o,n,r,a,d,l=0,m=0,f=h.width(),g=h.height();void 0===p.data("owidth")&&p.data("owidth",p[0].width),void 0===p.data("oheight")&&p.data("oheight",p[0].height),u.fill===f/g>=p.data("owidth")/p.data("oheight")?(t="100%",e="auto",s=Math.floor(f),o=Math.floor(f*(p.data("oheight")/p.data("owidth")))):(t="auto",e="100%",s=Math.floor(g*(p.data("owidth")/p.data("oheight"))),o=Math.floor(g)),n=u.horizontalAlign.toLowerCase(),a=f-s,"left"===n&&(m=0),"center"===n&&(m=.5*a),"right"===n&&(m=a),-1!==n.indexOf("%")&&(n=parseInt(n.replace("%",""),10),n>0&&(m=a*n*.01)),r=u.verticalAlign.toLowerCase(),d=g-o,"left"===r&&(l=0),"center"===r&&(l=.5*d),"bottom"===r&&(l=d),-1!==r.indexOf("%")&&(r=parseInt(r.replace("%",""),10),r>0&&(l=d*r*.01)),u.hardPixels&&(t=s,e=o),p.css({width:t,height:e,"margin-left":Math.floor(m),"margin-top":Math.floor(l)}),p.data("sbi_imgLiquid_oldProcessed")||(p.fadeTo(u.fadeInTime,1),p.data("sbi_imgLiquid_oldProcessed",!0),u.removeBoxBackground&&h.css("background-image","none"),h.addClass("sbi_imgLiquid_nobgSize"),h.addClass("sbi_imgLiquid_ready")),u.onItemFinish&&u.onItemFinish(i,h,p),c()}function c(){i===s.length-1&&s.settings.onFinish&&s.settings.onFinish()}var u=s.settings,h=t(this),p=t("img:first",h);return p.length?(p.data("sbi_imgLiquid_settings")?(h.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),u=t.extend({},p.data("sbi_imgLiquid_settings"),s.options)):u=t.extend({},s.settings,d()),p.data("sbi_imgLiquid_settings",u),u.onItemStart&&u.onItemStart(i,h,p),void(a.bgs_Available&&u.useBackgroundSize?e():o())):void r()})}})}(jQuery),!function(){var t=a.injectCss,i=document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t)),i.appendChild(e)}(),t.find(".sbi_photo").sbi_imgLiquid({fill:!0})}var l=function(){var t=0;return function(i,e){clearTimeout(t),t=setTimeout(i,e)}}();jQuery(window).resize(function(){l(function(){i()},500)}),i(),!function(t){var i={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},e={};e.sbiCheckVisibility=function(t,i){if(jQuery.contains(document,t[0])){var s=i.sbiPreviousVisibility,o=t.is(":visible");i.sbiPreviousVisibility=o,null==s?i.runOnLoad&&i.callback(t,o):s!==o&&i.callback(t,o),setTimeout(function(){e.sbiCheckVisibility(t,i)},i.frequency)}},t.fn.sbiVisibilityChanged=function(s){var o=t.extend({},i,s);return this.each(function(){e.sbiCheckVisibility(t(this),o)})}}(jQuery),jQuery(".sbi").filter(":hidden").sbiVisibilityChanged({callback:function(t,e){i()},runOnLoad:!1}),jQuery("#sb_instagram .sbi_photo").each(function(){$sbi_photo=jQuery(this),$sbi_photo.hover(function(){jQuery(this).fadeTo(200,.85)},function(){jQuery(this).stop().fadeTo(500,1)}),$sbi_photo.closest(".sbi_item").hasClass("sbi_type_video")&&($sbi_photo.find(".sbi_playbtn").length||$sbi_photo.append('<i class="fa fa-play sbi_playbtn"></i>'))}),t.find("#sbi_images .sbi_item.sbi_new").sort(function(t,i){var e=jQuery(t).data("date"),s=jQuery(i).data("date");return"none"==d?s-e:Math.round(Math.random())-.5}).appendTo(t.find("#sbi_images")),setTimeout(function(){jQuery("#sbi_images .sbi_item.sbi_new").removeClass("sbi_new"),u=[]},500),n()},error:function(t){var i="",e="";t.indexOf("access_token")>-1?(i+="<p><b>Error: Access Token is not valid</b><br /><span>This error message is only visible to WordPress admins</span>",e="<p>There's an issue with the Instagram Access Token that you are using. Please obtain a new Access Token on the plugin's Settings page.<br />If you continue to have an issue with your Access Token then please see <a href='https://smashballoon.com/my-instagram-access-token-keep-expiring/' target='_blank'>this FAQ</a> for more information."):t.indexOf("user does not exist")>-1&&(i+="<p><b>Error: The User ID does not exist</b><br /><span>This error is only visible to WordPress admins</span>",e="<p>Please double check the Instagram User ID that you are using. To find your User ID simply enter your Instagram user name into this <a href='http://www.otzberg.net/iguserid/' target='_blank'>tool</a>.</p>"),g.length<2&&jQuery("#sb_instagram").empty().append('<p style="text-align: center;">Unable to show Instagram photos</p><div id="sbi_mod_error">'+i+e+"</div>")}});e.click(function(){h.next()}),h.run()})})}var sbi_js_exists="undefined"!=typeof sbi_js_exists?!0:!1;sbi_js_exists||(function(){var t,i;t=function(){function t(t,i){var e,s;if(this.options={target:"instafeed",get:"popular",resolution:"thumbnail",sortBy:"none",links:!0,mock:!1,useHttp:!1},"object"==typeof t)for(e in t)s=t[e],this.options[e]=s;this.context=null!=i?i:this,this.unique=this._genKey()}return t.prototype.hasNext=function(){return"string"==typeof this.context.nextUrl&&this.context.nextUrl.length>0},t.prototype.next=function(){return this.hasNext()?this.run(this.context.nextUrl):!1},t.prototype.run=function(i){var e,s,o;if("string"!=typeof this.options.clientId&&"string"!=typeof this.options.accessToken)throw new Error("Missing clientId or accessToken.");if("string"!=typeof this.options.accessToken&&"string"!=typeof this.options.clientId)throw new Error("Missing clientId or accessToken.");return null!=this.options.before&&"function"==typeof this.options.before&&this.options.before.call(this),"undefined"!=typeof document&&null!==document&&(o=document.createElement("script"),o.id="instafeed-fetcher",o.src=i||this._buildUrl(),e=document.getElementsByTagName("head"),e[0].appendChild(o),s="instafeedCache"+this.unique,window[s]=new t(this.options,this),window[s].unique=this.unique),!0},t.prototype.parse=function(t){var i,e,s,o,n,r,a,d,l,c,u,h,p,m,f,g,b,_,y,v,w,k;if("object"!=typeof t){if(null!=this.options.error&&"function"==typeof this.options.error)return this.options.error.call(this,"Invalid JSON data"),!1;throw new Error("Invalid JSON response")}if(200!==t.meta.code){if(null!=this.options.error&&"function"==typeof this.options.error)return this.options.error.call(this,t.meta.error_message),!1;throw new Error("Error from Instagram: "+t.meta.error_message)}if(0===t.data.length){if(null!=this.options.error&&"function"==typeof this.options.error)return this.options.error.call(this,"No images were returned from Instagram"),!1;throw new Error("No images were returned from Instagram")}if(null!=this.options.success&&"function"==typeof this.options.success&&this.options.success.call(this,t),this.context.nextUrl="",null!=t.pagination&&(this.context.nextUrl=t.pagination.next_url),"none"!==this.options.sortBy)switch(m="random"===this.options.sortBy?["","random"]:this.options.sortBy.split("-"),p="least"===m[0]?!0:!1,m[1]){case"random":t.data.sort(function(){return.5-Math.random()});break;case"recent":t.data=this._sortBy(t.data,"created_time",p);break;case"liked":t.data=this._sortBy(t.data,"likes.count",p);break;case"commented":t.data=this._sortBy(t.data,"comments.count",p);break;default:throw new Error("Invalid option for sortBy: '"+this.options.sortBy+"'.")}if("undefined"!=typeof document&&null!==document&&this.options.mock===!1){if(d=t.data,null!=this.options.limit&&d.length>this.options.limit&&(d=d.slice(0,this.options.limit+1||9e9)),e=document.createDocumentFragment(),null!=this.options.filter&&"function"==typeof this.options.filter&&(d=this._filter(d,this.options.filter)),null!=this.options.template&&"string"==typeof this.options.template){for(o="",r="",c="",f=document.createElement("div"),g=0,y=d.length;y>g;g++)n=d[g],a=n.images[this.options.resolution].url,this.options.useHttp||(a=a.replace("http://","//")),r=this._makeTemplate(this.options.template,{model:n,id:n.id,link:n.link,image:a,caption:this._getObjectProperty(n,"caption.text"),likes:n.likes.count,comments:n.comments.count,location:this._getObjectProperty(n,"location.name")}),o+=r;for(f.innerHTML=o,k=[].slice.call(f.childNodes),b=0,v=k.length;v>b;b++)h=k[b],e.appendChild(h)}else for(_=0,w=d.length;w>_;_++)n=d[_],l=document.createElement("img"),a=n.images[this.options.resolution].url,this.options.useHttp||(a=a.replace("http://","//")),l.src=a,this.options.links===!0?(i=document.createElement("a"),i.href=n.link,i.appendChild(l),e.appendChild(i)):e.appendChild(l);this.options.target.append(e),s=document.getElementsByTagName("head")[0],s.removeChild(document.getElementById("instafeed-fetcher")),u="instafeedCache"+this.unique,window[u]=void 0;try{delete window[u]}catch(I){}}return null!=this.options.after&&"function"==typeof this.options.after&&this.options.after.call(this),!0},t.prototype._buildUrl=function(){var t,i,e;switch(t="https://api.instagram.com/v1",this.options.get){case"popular":i="media/popular";break;case"tagged":if("string"!=typeof this.options.tagName)throw new Error("No tag name specified. Use the 'tagName' option.");i="tags/"+this.options.tagName+"/media/recent";break;case"location":if("number"!=typeof this.options.locationId)throw new Error("No location specified. Use the 'locationId' option.");i="locations/"+this.options.locationId+"/media/recent";break;case"user":if("number"!=typeof this.options.userId)throw new Error("No user specified. Use the 'userId' option.");if("string"!=typeof this.options.accessToken)throw new Error("No access token. Use the 'accessToken' option.");i="users/"+this.options.userId+"/media/recent";break;default:throw new Error("Invalid option for get: '"+this.options.get+"'.")}return e=""+t+"/"+i,e+=null!=this.options.accessToken?"?access_token="+this.options.accessToken:"?client_id="+this.options.clientId,null!=this.options.limit&&(e+="&count="+this.options.limit),e+="&callback=instafeedCache"+this.unique+".parse"},t.prototype._genKey=function(){var t;return t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)},""+t()+t()+t()+t()},t.prototype._makeTemplate=function(t,i){var e,s,o,n,r;for(s=/(?:\{{2})([\w\[\]\.]+)(?:\}{2})/,e=t;s.test(e);)o=e.match(s)[1],n=null!=(r=this._getObjectProperty(i,o))?r:"",e=e.replace(s,""+n);return e},t.prototype._getObjectProperty=function(t,i){var e,s;for(i=i.replace(/\[(\w+)\]/g,".$1"),s=i.split(".");s.length;){if(e=s.shift(),!(null!=t&&e in t))return null;t=t[e]}return t},t.prototype._sortBy=function(t,i,e){var s;return s=function(t,s){var o,n;return o=this._getObjectProperty(t,i),n=this._getObjectProperty(s,i),e?o>n?1:-1:n>o?1:-1},t.sort(s.bind(this)),t},t.prototype._filter=function(t,i){var e,s,o,n,r;for(e=[],o=function(t){return i(t)?e.push(t):void 0},n=0,r=t.length;r>n;n++)s=t[n],o(s);return e},t}(),i="undefined"!=typeof exports&&null!==exports?exports:window,i.instagramfeed=t}.call(this),function(){"use strict";var t=Array.prototype.slice;try{t.call(document.documentElement)}catch(i){Array.prototype.slice=function(i,e){if(e="undefined"!=typeof e?e:this.length,"[object Array]"===Object.prototype.toString.call(this))return t.call(this,i,e);var s,o,n=[],r=this.length,a=i||0;a=a>=0?a:r+a;var d=e?e:r;if(0>e&&(d=r+e),o=d-a,o>0)if(n=new Array(o),this.charAt)for(s=0;o>s;s++)n[s]=this.charAt(a+s);else for(s=0;o>s;s++)n[s]=this[a+s];return n}}}(),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var i=Array.prototype.slice.call(arguments,1),e=this,s=function(){},o=function(){return e.apply(this instanceof s&&t?this:t,i.concat(Array.prototype.slice.call(arguments)))};return s.prototype=this.prototype,o.prototype=new s,o}),jQuery(document).ready(function(){sbi_init()}));
 
 
 
 
 
 
 
 
 
 
 
 
 
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(){jQuery('#sb_instagram.sbi').each(function(){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),num=this.getAttribute('data-num'),feedOptions=JSON.parse(this.getAttribute('data-options')),getType='user',sortby='none',user_id=this.getAttribute('data-id'),num=this.getAttribute('data-num'),posts_arr=[],$header='',morePosts=[];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'}
5
+ if(feedWidth<=100)imgRes='low_resolution';break;case 'thumb':imgRes='thumbnail';break;case 'medium':imgRes='low_resolution';break;default:imgRes='standard_resolution'}
6
+ var ids_arr=user_id.replace(/ /g,'').split(",");var looparray=ids_arr;var headerStyles='',sbi_page_url='https://api.instagram.com/v1/users/'+ids_arr[0]+'?access_token='+sb_instagram_js_options.sb_instagram_at;if(feedOptions.headercolor.length)headerStyles='style="color: #'+feedOptions.headercolor+'"';jQuery.ajax({method:"GET",url:sbi_page_url,dataType:"jsonp",success:function(data){$header='<a href="http://instagram.com/'+data.data.username+'" target="_blank" title="@'+data.data.username+'" class="sbi_header_link">';$header+='<div class="sbi_header_text">';$header+='<h3 '+headerStyles;if(data.data.bio.length==0)$header+=' class="sbi_no_bio"';$header+='>@'+data.data.username+'</h3>';if(data.data.bio.length)$header+='<p class="sbi_bio" '+headerStyles+'>'+data.data.bio+'</p>';$header+='</div>';$header+='<div class="sbi_header_img">';$header+='<div class="sbi_header_img_hover"><i class="fa fa-instagram"></i></div>';$header+='<img src="'+data.data.profile_picture+'" alt="'+data.data.full_name+'" width="50" height="50">';$header+='</div>';$header+='</a>';$self.find('.sb_instagram_header').prepend($header);if($self.find('.sbi_follow_btn').length)$self.find('.sbi_follow_btn a').attr('href','http://instagram.com/'+data.data.username)}});jQuery.each(looparray,function(index,entry){var userFeed=new instagramfeed({target:$target,get:getType,sortBy:sortby,resolution:imgRes,limit:parseInt(num,10),template:'<div class="sbi_item sbi_type_{{model.type}} sbi_new" id="sbi_{{id}}" data-date="{{model.created_time_raw}}"><div class="sbi_photo_wrap"><a class="sbi_photo" href="{{link}}" target="_blank"><img src="{{image}}" alt="{{caption}}" width="200" height="200" /></a></div></div>',filter:function(image){var date=new Date(image.created_time*1000),time=date.getTime();image.created_time_raw=time;if(image.caption!=null)image.caption.text=image.caption.text.replace(/[^a-zA-Z ]/g,"");return !0},userId:parseInt(entry,10),accessToken:sb_instagram_js_options.sb_instagram_at,after:function(){$self.find('.sbi_loader').remove();if(this.hasNext())morePosts.push('1');if(morePosts.length>0){$loadBtn.show()}else{$loadBtn.hide();$self.css('padding-bottom',0)}
7
+ if(typeof sbi_custom_js=='function')setTimeout(function(){sbi_custom_js()},100);if(imgRes!=='thumbnail'){var sbi_imgLiquid=sbi_imgLiquid||{VER:"0.9.944"};sbi_imgLiquid.bgs_Available=!1,sbi_imgLiquid.bgs_CheckRunned=!1,function(i){function t(){if(!sbi_imgLiquid.bgs_CheckRunned){sbi_imgLiquid.bgs_CheckRunned=!0;var t=i('<span style="background-size:cover" />');i("body").append(t),!function(){var i=t[0];if(i&&window.getComputedStyle){var e=window.getComputedStyle(i,null);e&&e.backgroundSize&&(sbi_imgLiquid.bgs_Available="cover"===e.backgroundSize)}}(),t.remove()}}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},t();var a=this;return this.options=e,this.settings=i.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(t){function e(){-1===u.css("background-image").indexOf(encodeURI(c.attr("src")))&&u.css({"background-image":'url("'+encodeURI(c.attr("src"))+'")'}),u.css({"background-size":g.fill?"cover":"contain","background-position":(g.horizontalAlign+" "+g.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),i("a:first",u).css({display:"block",width:"100%",height:"100%"}),i("img",u).css({display:"none"}),g.onItemFinish&&g.onItemFinish(t,u,c),u.addClass("sbi_imgLiquid_bgSize"),u.addClass("sbi_imgLiquid_ready"),l()}function o(){function e(){c.data("sbi_imgLiquid_error")||c.data("sbi_imgLiquid_loaded")||c.data("sbi_imgLiquid_oldProcessed")||(u.is(":visible")&&c[0].complete&&c[0].width>0&&c[0].height>0?(c.data("sbi_imgLiquid_loaded",!0),setTimeout(r,t*g.delay)):setTimeout(e,g.timecheckvisibility))}if(c.data("oldSrc")&&c.data("oldSrc")!==c.attr("src")){var a=c.clone().removeAttr("style");return a.data("sbi_imgLiquid_settings",c.data("sbi_imgLiquid_settings")),c.parent().prepend(a),c.remove(),c=a,c[0].width=0,void setTimeout(o,10)}return c.data("sbi_imgLiquid_oldProcessed")?void r():(c.data("sbi_imgLiquid_oldProcessed",!1),c.data("oldSrc",c.attr("src")),i("img:not(:first)",u).css("display","none"),u.css({overflow:"hidden"}),c.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),c.on("error",n),c[0].onerror=n,e(),void d())}function d(){(g.responsive||c.data("sbi_imgLiquid_oldProcessed"))&&c.data("sbi_imgLiquid_settings")&&(g=c.data("sbi_imgLiquid_settings"),u.actualSize=u.get(0).offsetWidth+u.get(0).offsetHeight/1e4,u.sizeOld&&u.actualSize!==u.sizeOld&&r(),u.sizeOld=u.actualSize,setTimeout(d,g.responsiveCheckTime))}function n(){c.data("sbi_imgLiquid_error",!0),u.addClass("sbi_imgLiquid_error"),g.onItemError&&g.onItemError(t,u,c),l()}function s(){var i={};if(a.settings.useDataHtmlAttr){var t=u.attr("data-sbi_imgLiquid-fill"),e=u.attr("data-sbi_imgLiquid-horizontalAlign"),o=u.attr("data-sbi_imgLiquid-verticalAlign");("true"===t||"false"===t)&&(i.fill=Boolean("true"===t)),void 0===e||"left"!==e&&"center"!==e&&"right"!==e&&-1===e.indexOf("%")||(i.horizontalAlign=e),void 0===o||"top"!==o&&"bottom"!==o&&"center"!==o&&-1===o.indexOf("%")||(i.verticalAlign=o)}return sbi_imgLiquid.isIE&&a.settings.ieFadeInDisabled&&(i.fadeInTime=0),i}function r(){var i,e,a,o,d,n,s,r,m=0,h=0,f=u.width(),v=u.height();void 0===c.data("owidth")&&c.data("owidth",c[0].width),void 0===c.data("oheight")&&c.data("oheight",c[0].height),g.fill===f/v>=c.data("owidth")/c.data("oheight")?(i="100%",e="auto",a=Math.floor(f),o=Math.floor(f*(c.data("oheight")/c.data("owidth")))):(i="auto",e="100%",a=Math.floor(v*(c.data("owidth")/c.data("oheight"))),o=Math.floor(v)),d=g.horizontalAlign.toLowerCase(),s=f-a,"left"===d&&(h=0),"center"===d&&(h=.5*s),"right"===d&&(h=s),-1!==d.indexOf("%")&&(d=parseInt(d.replace("%",""),10),d>0&&(h=s*d*.01)),n=g.verticalAlign.toLowerCase(),r=v-o,"left"===n&&(m=0),"center"===n&&(m=.5*r),"bottom"===n&&(m=r),-1!==n.indexOf("%")&&(n=parseInt(n.replace("%",""),10),n>0&&(m=r*n*.01)),g.hardPixels&&(i=a,e=o),c.css({width:i,height:e,"margin-left":Math.floor(h),"margin-top":Math.floor(m)}),c.data("sbi_imgLiquid_oldProcessed")||(c.fadeTo(g.fadeInTime,1),c.data("sbi_imgLiquid_oldProcessed",!0),g.removeBoxBackground&&u.css("background-image","none"),u.addClass("sbi_imgLiquid_nobgSize"),u.addClass("sbi_imgLiquid_ready")),g.onItemFinish&&g.onItemFinish(t,u,c),l()}function l(){t===a.length-1&&a.settings.onFinish&&a.settings.onFinish()}var g=a.settings,u=i(this),c=i("img:first",u);return c.length?(c.data("sbi_imgLiquid_settings")?(u.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),g=i.extend({},c.data("sbi_imgLiquid_settings"),a.options)):g=i.extend({},a.settings,s()),c.data("sbi_imgLiquid_settings",g),g.onItemStart&&g.onItemStart(t,u,c),void(sbi_imgLiquid.bgs_Available&&g.useBackgroundSize?e():o())):void n()})}})}(jQuery);!function(){var css=sbi_imgLiquid.injectCss,head=document.getElementsByTagName('head')[0],style=document.createElement('style');style.type='text/css';if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}
8
+ head.appendChild(style)}();$self.find(".sbi_photo").sbi_imgLiquid({fill:!0})}
9
+ var sbi_delay=(function(){var sbi_timer=0;return function(sbi_callback,sbi_ms){clearTimeout(sbi_timer);sbi_timer=setTimeout(sbi_callback,sbi_ms)}})();jQuery(window).resize(function(){sbi_delay(function(){sbiSetPhotoHeight()},500)});function sbiSetPhotoHeight(){if(imgRes!=='thumbnail'){var sbi_photo_width=$self.find('.sbi_photo').eq(0).innerWidth();var sbi_num_cols=parseInt(cols);if(!$self.hasClass('sbi_disable_mobile')){var sbiWindowWidth=jQuery(window).width();if(sbiWindowWidth<640&&(parseInt(cols)>2&&parseInt(cols)<7))sbi_num_cols=2;if(sbiWindowWidth<640&&(parseInt(cols)>6&&parseInt(cols)<11))sbi_num_cols=4;if(sbiWindowWidth<=480&&parseInt(cols)>2)sbi_num_cols=1}
10
+ var sbi_photo_width_manual=($self.find('#sbi_images').width()/sbi_num_cols)-(feedOptions.imagepadding*2);if(sbi_photo_width<=(sbi_photo_width_manual))sbi_photo_width=sbi_photo_width_manual;$self.find('.sbi_photo').css('height',sbi_photo_width)}}
11
+ sbiSetPhotoHeight();!function(i){var n={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},c={};c.sbiCheckVisibility=function(i,n){if(jQuery.contains(document,i[0])){var e=n.sbiPreviousVisibility,t=i.is(":visible");n.sbiPreviousVisibility=t,null==e?n.runOnLoad&&n.callback(i,t):e!==t&&n.callback(i,t),setTimeout(function(){c.sbiCheckVisibility(i,n)},n.frequency)}},i.fn.sbiVisibilityChanged=function(e){var t=i.extend({},n,e);return this.each(function(){c.sbiCheckVisibility(i(this),t)})}}(jQuery);jQuery(".sbi").filter(':hidden').sbiVisibilityChanged({callback:function(element,visible){sbiSetPhotoHeight()},runOnLoad:!1});jQuery('#sb_instagram .sbi_photo').each(function(){$sbi_photo=jQuery(this);$sbi_photo.hover(function(){jQuery(this).fadeTo(200,0.85)},function(){jQuery(this).stop().fadeTo(500,1)});if($sbi_photo.closest('.sbi_item').hasClass('sbi_type_video')){if(!$sbi_photo.find('.sbi_playbtn').length)$sbi_photo.append('<i class="fa fa-play sbi_playbtn"></i>')}});$self.find('#sbi_images .sbi_item.sbi_new').sort(function(a,b){var aComp=jQuery(a).data('date'),bComp=jQuery(b).data('date');if(sortby=='none'){return bComp-aComp}else{return(Math.round(Math.random())-0.5)}}).appendTo($self.find("#sbi_images"));setTimeout(function(){jQuery('#sbi_images .sbi_item.sbi_new').removeClass('sbi_new');morePosts=[]},500);function sbiGetItemSize(){$self.removeClass('sbi_small sbi_medium');var sbiItemWidth=$self.find('.sbi_item').innerWidth();if(sbiItemWidth>120&&sbiItemWidth<240){$self.addClass('sbi_medium')}else if(sbiItemWidth<=120){$self.addClass('sbi_small')}}
12
+ sbiGetItemSize()},error:function(data){var sbiErrorMsg='',sbiErrorDir='';if(data.indexOf('access_token')>-1){sbiErrorMsg+='<p><b>Error: Access Token is not valid</b><br /><span>This error message is only visible to WordPress admins</span>';sbiErrorDir="<p>There's an issue with the Instagram Access Token that you are using. Please obtain a new Access Token on the plugin's Settings page.<br />If you continue to have an issue with your Access Token then please see <a href='https://smashballoon.com/my-instagram-access-token-keep-expiring/' target='_blank'>this FAQ</a> for more information."}else if(data.indexOf('user does not exist')>-1){sbiErrorMsg+='<p><b>Error: The User ID does not exist</b><br /><span>This error is only visible to WordPress admins</span>';sbiErrorDir="<p>Please double check the Instagram User ID that you are using. To find your User ID simply enter your Instagram user name into this <a href='http://www.otzberg.net/iguserid/' target='_blank'>tool</a>.</p>"}
13
+ if(looparray.length<2)jQuery('#sb_instagram').empty().append('<p style="text-align: center;">Unable to show Instagram photos</p><div id="sbi_mod_error">'+sbiErrorMsg+sbiErrorDir+'</div>')}});$loadBtn.click(function(){userFeed.next()});userFeed.run()})})}
14
+ jQuery(document).ready(function(){sbi_init()})}