!function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!1,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.is("img")&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("").bind("load",function(){var d=c.attr("data-"+j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.attr("data-"+j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document); (function($){var defaults={'host':"https://www.instagram.com/",'username':'','tag':'','container':'','display_profile':false,'display_biography':false,'display_gallery':true,'display_igtv':false,'callback':null,'styling':false,'items':8,'items_per_row':4,'margin':0.5,'image_size':640,'lazy_load':false,'on_error':console.error};var image_sizes={"150":0,"240":1,"320":2,"480":3,"640":4};var escape_map={'&':'&','<':'<','>':'>','"':'"',"'":''','/':'/','`':'`','=':'='};function escape_string(str){return str.replace(/[&<>"'`=\/]/g,function(char){return escape_map[char];});} $.instagramFeed=function(opts){var options=$.fn.extend({},defaults,opts);if(options.username==""&&options.tag==""){options.on_error("Instagram Feed: Error, no username nor tag defined.",1);return false;} if(typeof options.get_data!=="undefined"){console.warn("Instagram Feed: options.get_data is deprecated, options.callback is always called if defined");} if(options.callback==null&&options.container==""){options.on_error("Instagram Feed: Error, neither container found nor callback defined.",2);return false;} var is_tag=options.username=="",url=is_tag?options.host+"explore/tags/"+options.tag+"/":options.host+options.username+"/";$.get(url,function(data){try{data=data.split("window._sharedData = ")[1].split("<\/script>")[0];}catch(e){options.on_error("Instagram Feed: It looks like the profile you are trying to fetch is age restricted. See https://github.com/jsanahuja/InstagramFeed/issues/26",3);return;} data=JSON.parse(data.substr(0,data.length-1));data=data.entry_data.ProfilePage||data.entry_data.TagPage;if(typeof data==="undefined"){options.on_error("Instagram Feed: It looks like YOUR network has been temporary banned because of too many requests. See https://github.com/jsanahuja/jquery.instagramFeed/issues/25",4);return;} data=data[0].graphql.user||data[0].graphql.hashtag;if(options.container!=""){var styles={'profile_container':"",'profile_image':"",'profile_name':"",'profile_biography':"",'gallery_image':""};if(options.styling){styles.profile_container=" style='text-align:center;'";styles.profile_image=" style='border-radius:10em;width:15%;max-width:125px;min-width:50px;'";styles.profile_name=" style='font-size:1.2em;'";styles.profile_biography=" style='font-size:1em;'";var width=(100-options.margin*2*options.items_per_row)/ options.items_per_row;styles.gallery_image=" style='margin:"+options.margin+"% "+options.margin+"%;width:"+width+"%;float:left;'";} var html="";if(options.display_profile){html+="
";html+=""+(is_tag?data.name+" tag pic":data.username+" profile pic")+"";if(is_tag) html+="

#"+options.tag+"

";else html+="

@"+data.full_name+" (@"+options.username+")

";if(!is_tag&&options.display_biography) html+="

"+data.biography+"

";html+="
";} var image_index=typeof image_sizes[options.image_size]!=="undefined"?image_sizes[options.image_size]:image_sizes[640];if(options.display_gallery){if(typeof data.is_private!=="undefined"&&data.is_private===true){html+="

This profile is private

";}else{var imgs=(data.edge_owner_to_timeline_media||data.edge_hashtag_to_media).edges;max=(imgs.length>options.items)?options.items:imgs.length;html+="";} html+="";}} if(options.display_igtv&&typeof data.edge_felix_video_timeline!=="undefined"){var igtv=data.edge_felix_video_timeline.edges,max=(igtv.length>options.items)?options.items:igtv.length if(igtv.length>0){html+="
";for(var i=0;i";html+="";html+="";} html+="
";}} $(options.container).html(html);} if(options.callback!=null){options.callback(data);}}).fail(function(e){options.on_error("Instagram Feed: Unable to fetch the given user/tag. Instagram responded with the status code: "+e.status,5);});return true;};})(jQuery);