MCPcopy Create free account
hub / github.com/CoderOpen/waimai / c

Function c

public/front/static/js/plugins.js:20–20  ·  view source on GitHub ↗
(d,h)

Source from the content-addressed store, hash-verified

18*
19*/
20!function(a){a.fn.fitVids=function(f){var g={customSelector:null,ignore:null};if(!document.getElementById("fit-vids-style")){var h=document.head||document.getElementsByTagName("head")[0],b=".fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}",c=document.createElement("div");c.innerHTML='<p>x</p><style id="fit-vids-style">'+b+"</style>",h.appendChild(c.childNodes[1])}return f&&a.extend(g,f),this.each(function(){var i=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];g.customSelector&&i.push(g.customSelector);var j=".fitvidsignore";g.ignore&&(j=j+", "+g.ignore);var d=a(this).find(i.join(","));d=d.not("object object"),d=d.not(j),d.each(function(m){var p=a(this);if(!(p.parents(j).length>0||"embed"===this.tagName.toLowerCase()&&p.parent("object").length||p.parent(".fluid-width-video-wrapper").length)){p.css("height")||p.css("width")||!isNaN(p.attr("height"))&&!isNaN(p.attr("width"))||(p.attr("height",9),p.attr("width",16));var k="object"===this.tagName.toLowerCase()||p.attr("height")&&!isNaN(parseInt(p.attr("height"),10))?parseInt(p.attr("height"),10):p.height(),l=isNaN(parseInt(p.attr("width"),10))?p.width():parseInt(p.attr("width"),10),q=k/l;if(!p.attr("id")){var n="fitvid"+m;p.attr("id",n)}p.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*q+"%"),p.removeAttr("height").removeAttr("width")}})})}}(window.jQuery||window.Zepto);(function(a){a.fn.jflickrfeed=function(e,b){e=a.extend(true,{flickrbase:"http://api.flickr.com/services/feeds/",feedapi:"photos_public.gne",limit:20,qstrings:{lang:"en-us",format:"json",jsoncallback:"?"},cleanDescription:true,useTemplate:true,itemTemplate:"",itemCallback:function(){}},e);var f=e.flickrbase+e.feedapi+"?";var c=true;for(var d in e.qstrings){if(!c){f+="&"}f+=d+"="+e.qstrings[d];c=false}return a(this).each(function(){var g=a(this);var h=this;a.getJSON(f,function(i){a.each(i.items,function(j,l){if(j<e.limit){if(e.cleanDescription){var n=/<p>(.*?)<\/p>/g;var k=l.description;if(n.test(k)){l.description=k.match(n)[2];if(l.description!=undefined){l.description=l.description.replace("<p>","").replace("</p>","")}}}l.image_s=l.media.m.replace("_m","_s");l.image_t=l.media.m.replace("_m","_t");l.image_m=l.media.m.replace("_m","_m");l.image=l.media.m.replace("_m","");l.image_b=l.media.m.replace("_m","_b");delete l.media;if(e.useTemplate){var p=e.itemTemplate;for(var m in l){var o=new RegExp("{{"+m+"}}","g");p=p.replace(o,l[m])}g.append(p)}e.itemCallback.call(h,l)}});if(a.isFunction(b)){b.call(h,i)}})})}})(jQuery);(function(){var a,b;a=function(){function c(d,h){var f,g;this.options={target:"instafeed",get:"popular",resolution:"thumbnail",sortBy:"none",links:!0,mock:!1,useHttp:!1};if(typeof d=="object"){for(f in d){g=d[f],this.options[f]=g}}this.context=h!=null?h:this,this.unique=this._genKey()}return c.prototype.hasNext=function(){return typeof this.context.nextUrl=="string"&&this.context.nextUrl.length>0},c.prototype.next=function(){return this.hasNext()?this.run(this.context.nextUrl):!1},c.prototype.run=function(g){var e,f,d;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&&(d=document.createElement("script"),d.id="instafeed-fetcher",d.src=g||this._buildUrl(),e=document.getElementsByTagName("head"),e[0].appendChild(d),f="instafeedCache"+this.unique,window[f]=new c(this.options,this),window[f].unique=this.unique),!0},c.prototype.parse=function(A){var P,J,M,G,N,K,Q,j,C,H,q,F,L,z,R,I,D,V,k,T,B,O;if(typeof A!="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(A.meta.code!==200){if(this.options.error!=null&&typeof this.options.error=="function"){return this.options.error.call(this,A.meta.error_message),!1}throw new Error("Error from Instagram: "+A.meta.error_message)}if(A.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,A),this.context.nextUrl="",A.pagination!=null&&(this.context.nextUrl=A.pagination.next_url);if(this.options.sortBy!=="none"){this.options.sortBy==="random"?z=["","random"]:z=this.options.sortBy.split("-"),L=z[0]==="least"?!0:!1;switch(z[1]){case"random":A.data.sort(function(){return 0.5-Math.random()});break;case"recent":A.data=this._sortBy(A.data,"created_time",L);break;case"liked":A.data=this._sortBy(A.data,"likes.count",L);break;case"commented":A.data=this._sortBy(A.data,"comments.count",L);break;default:throw new Error("Invalid option for sortBy: '"+this.options.sortBy+"'.")}}if(typeof document!="undefined"&&document!==null&&this.options.mock===!1){j=A.data,this.options.limit!=null&&j.length>this.options.limit&&(j=j.slice(0,this.options.limit+1||9000000000)),J=document.createDocumentFragment(),this.options.filter!=null&&typeof this.options.filter=="function"&&(j=this._filter(j,this.options.filter));if(this.options.template!=null&&typeof this.options.template=="string"){G="",K="",H="",R=document.createElement("div");for(I=0,k=j.length;I<k;I++){N=j[I],Q=N.images[this.options.resolution].url,this.options.useHttp||(Q=Q.replace("http://","//")),K=this._makeTemplate(this.options.template,{model:N,id:N.id,link:N.link,image:Q,caption:this._getObjectProperty(N,"caption.text"),likes:N.likes.count,comments:N.comments.count,location:this._getObjectProperty(N,"location.name")}),G+=K}R.innerHTML=G,O=[].slice.call(R.childNodes);for(D=0,T=O.length;D<T;D++){F=O[D],J.appendChild(F)}}else{for(V=0,B=j.length;V<B;V++){N=j[V],C=document.createElement("img"),Q=N.images[this.options.resolution].url,this.options.useHttp||(Q=Q.replace("http://","//")),C.src=Q,this.options.links===!0?(P=document.createElement("a"),P.href=N.link,P.appendChild(C),J.appendChild(P)):J.appendChild(C)}}document.getElementById(this.options.target).appendChild(J),M=document.getElementsByTagName("head")[0],M.removeChild(document.getElementById("instafeed-fetcher")),q="instafeedCache"+this.unique,window[q]=void 0;try{delete window[q]}catch(U){}}return this.options.after!=null&&typeof this.options.after=="function"&&this.options.after.call(this),!0},c.prototype._buildUrl=function(){var d,g,f;d="https://api.instagram.com/v1";switch(this.options.get){case"popular":g="media/popular";break;case"tagged":if(typeof this.options.tagName!="string"){throw new Error("No tag name specified. Use the 'tagName' option.")}g="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.")}g="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.")}g="users/"+this.options.userId+"/media/recent";break;default:throw new Error("Invalid option for get: '"+this.options.get+"'.")}return f=""+d+"/"+g,this.options.accessToken!=null?f+="?access_token="+this.options.accessToken:f+="?client_id="+this.options.clientId,this.options.limit!=null&&(f+="&count="+this.options.limit),f+="&callback=instafeedCache"+this.unique+".parse",f},c.prototype._genKey=function(){var d;return d=function(){return((1+Math.random())*65536|0).toString(16).substring(1)},""+d()+d()+d()+d()},c.prototype._makeTemplate=function(d,l){var g,j,f,k,h;j=/(?:\{{2})([\w\[\]\.]+)(?:\}{2})/,g=d;while(j.test(g)){f=g.match(j)[1],k=(h=this._getObjectProperty(l,f))!=null?h:"",g=g.replace(j,""+k)}return g},c.prototype._getObjectProperty=function(d,h){var f,g;h=h.replace(/\[(\w+)\]/g,".$1"),g=h.split(".");while(g.length){f=g.shift();if(!(d!=null&&f in d)){return null}d=d[f]}return d},c.prototype._sortBy=function(d,h,f){var g;return g=function(j,l){var k,m;return k=this._getObjectProperty(j,h),m=this._getObjectProperty(l,h),f?k>m?1:-1:k<m?1:-1},d.sort(g.bind(this)),d},c.prototype._filter=function(d,l){var g,j,f,k,h;g=[],f=function(i){if(l(i)){return g.push(i)}};for(k=0,h=d.length;k<h;k++){j=d[k],f(j)}return g},c}(),b=typeof exports!="undefined"&&exports!==null?exports:window,b.Instafeed=a}).call(this);
21/*
22 * imagesLoaded PACKAGED v3.1.8
23 * JavaScript is all like "You images are done yet or what?"

Callers 5

hFunction · 0.70
plugins.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected