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

Function q

public/front/static/js/plugins.js:36–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34 * high-resolution images to devices with retina displays.
35 */
36!function(){function h(){}function i(b){return m.retinaImageSuffix+b}function j(b,f){if(this.path=b||"","undefined"!=typeof f&&null!==f){this.at_2x_path=f,this.perform_check=!1}else{if(void 0!==document.createElement){var g=document.createElement("a");g.href=this.path,g.pathname=g.pathname.replace(n,i),this.at_2x_path=g.href}else{var o=this.path.split("?");o[0]=o[0].replace(n,i),this.at_2x_path=o.join("?")}this.perform_check=!0}}function k(c){this.el=c,this.path=new j(this.el.getAttribute("src"),this.el.getAttribute("data-at2x"));var d=this;this.path.check_2x_variant(function(b){b&&d.swap()})}var l="undefined"==typeof exports?window:exports,m={retinaImageSuffix:"@2x",check_mime_type:!0,force_original_dimensions:!0};l.Retina=h,h.configure=function(c){null===c&&(c={});for(var d in c){c.hasOwnProperty(d)&&(m[d]=c[d])}},h.init=function(c){null===c&&(c=l);var d=c.onload||function(){};c.onload=function(){var b,g,o=document.getElementsByTagName("img"),p=[];for(b=0;b<o.length;b+=1){g=o[b],g.getAttributeNode("data-no-retina")||p.push(new k(g))}d()}},h.isRetina=function(){var b="(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)";return l.devicePixelRatio>1?!0:l.matchMedia&&l.matchMedia(b).matches?!0:!1};var n=/\.\w+$/;l.RetinaImagePath=j,j.confirmed_paths=[],j.prototype.is_external=function(){return !(!this.path.match(/^https?\:/i)||this.path.match("//"+document.domain))},j.prototype.check_2x_variant=function(c){var e,f=this;return this.is_external()?c(!1):this.perform_check||"undefined"==typeof this.at_2x_path||null===this.at_2x_path?this.at_2x_path in j.confirmed_paths?c(!0):(e=new XMLHttpRequest,e.open("HEAD",this.at_2x_path),e.onreadystatechange=function(){if(4!==e.readyState){return c(!1)}if(e.status>=200&&e.status<=399){if(m.check_mime_type){var a=e.getResponseHeader("Content-Type");if(null===a||!a.match(/^image/i)){return c(!1)}}return j.confirmed_paths.push(f.at_2x_path),c(!0)}return c(!1)},e.send(),void 0):c(!0)},l.RetinaImage=k,k.prototype.swap=function(d){function e(){f.el.complete?(m.force_original_dimensions&&(f.el.setAttribute("width",f.el.offsetWidth),f.el.setAttribute("height",f.el.offsetHeight)),f.el.setAttribute("src",d)):setTimeout(e,5)}"undefined"==typeof d&&(d=this.path.at_2x_path);var f=this;e()},h.isRetina()&&h.init(l)}();!function(a,b){"function"==typeof define&&define.amd?define([],b(a)):"object"==typeof exports?module.exports=b(a):a.smoothScroll=b(a)}("undefined"!=typeof global?global:this.window||this.global,function(x){var K,F,I,G,j={},L=!!x.document.querySelector&&!!x.addEventListener,C={speed:500,easing:"easeInOutCubic",offset:0,updateURL:!0,callback:function(){}},q=function(){var c={},h=!1,d=0,g=arguments.length;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(h=arguments[0],d++);for(var f=function(a){for(var e in a){Object.prototype.hasOwnProperty.call(a,e)&&(c[e]=h&&"[object Object]"===Object.prototype.toString.call(a[e])?q(!0,c[e],a[e]):a[e])}};g>d;d++){var b=arguments[d];f(b)}return c},J=function(a){return Math.max(a.scrollHeight,a.offsetHeight,a.clientHeight)},D=function(c,h){var d,g,f=h.charAt(0),b="classList" in document.documentElement;for("["===f&&(h=h.substr(1,h.length-2),d=h.split("="),d.length>1&&(g=!0,d[1]=d[1].replace(/"/g,"").replace(/'/g,"")));c&&c!==document;c=c.parentNode){if("."===f){if(b){if(c.classList.contains(h.substr(1))){return c}}else{if(new RegExp("(^|\\s)"+h.substr(1)+"(\\s|$)").test(c.className)){return c}}}if("#"===f&&c.id===h.substr(1)){return c}if("["===f&&c.hasAttribute(d[0])){if(!g){return c}if(c.getAttribute(d[0])===d[1]){return c}}if(c.tagName.toLowerCase()===h){return c}}return null},z=function(c){for(var h,d=String(c),g=d.length,f=-1,b="",i=d.charCodeAt(0);++f<g;){if(h=d.charCodeAt(f),0===h){throw new InvalidCharacterError("Invalid character: the input contains U+0000.")}b+=h>=1&&31>=h||127==h||0===f&&h>=48&&57>=h||1===f&&h>=48&&57>=h&&45===i?"\\"+h.toString(16)+" ":h>=128||45===h||95===h||h>=48&&57>=h||h>=65&&90>=h||h>=97&&122>=h?d.charAt(f):"\\"+d.charAt(f)}return b},w=function(a,c){var b;return"easeInQuad"===a&&(b=c*c),"easeOutQuad"===a&&(b=c*(2-c)),"easeInOutQuad"===a&&(b=0.5>c?2*c*c:-1+(4-2*c)*c),"easeInCubic"===a&&(b=c*c*c),"easeOutCubic"===a&&(b=--c*c*c+1),"easeInOutCubic"===a&&(b=0.5>c?4*c*c*c:(c-1)*(2*c-2)*(2*c-2)+1),"easeInQuart"===a&&(b=c*c*c*c),"easeOutQuart"===a&&(b=1- --c*c*c*c),"easeInOutQuart"===a&&(b=0.5>c?8*c*c*c*c:1-8*--c*c*c*c),"easeInQuint"===a&&(b=c*c*c*c*c),"easeOutQuint"===a&&(b=1+ --c*c*c*c*c),"easeInOutQuint"===a&&(b=0.5>c?16*c*c*c*c*c:1+16*--c*c*c*c*c),b||c},B=function(a,d,b){var c=0;if(a.offsetParent){do{c+=a.offsetTop,a=a.offsetParent}while(a)}return c=c-d-b,c>=0?c:0},E=function(){return Math.max(x.document.body.scrollHeight,x.document.documentElement.scrollHeight,x.document.body.offsetHeight,x.document.documentElement.offsetHeight,x.document.body.clientHeight,x.document.documentElement.clientHeight)},H=function(a){return a&&"object"==typeof JSON&&"function"==typeof JSON.parse?JSON.parse(a):{}},A=function(b,a){x.history.pushState&&(a||"true"===a)&&x.history.pushState(null,null,[x.location.protocol,"//",x.location.host,x.location.pathname,x.location.search,b].join(""))},M=function(a){return null===a?0:J(a)+a.offsetTop};j.animateScroll=function(T,p,c){var U=H(T?T.getAttribute("data-options"):null),P=q(P||C,c||{},U);p="#"+z(p.substr(1));var m="#"===p?x.document.documentElement:x.document.querySelector(p),d=x.pageYOffset;I||(I=x.document.querySelector("[data-scroll-header]")),G||(G=M(I));var W=$("header").hasClass("sticky"),r=B(m,G,parseInt(P.offset,10));$(T).hasClass("inline-scroll")||W||(r-=$(".showhide").is(":visible")?40:100);var R,h,f,e=r-d,o=E(),V=0;A(p,P.updateURL);var g=function(n,l,b){var s=x.pageYOffset;(n==l||s==l||x.innerHeight+s>=o)&&(clearInterval(b),m.focus(),P.callback(T,p))},i=function(){V+=16,h=V/parseInt(P.speed,10),h=h>1?1:h,f=d+e*w(P.easing,h),x.scrollTo(0,Math.floor(f)),g(f,r,R)},v=function(){R=setInterval(i,16)};0===x.pageYOffset&&x.scrollTo(0,0),v()};var k=function(a){var b=D(a.target,"[data-scroll]");b&&"a"===b.tagName.toLowerCase()&&(a.preventDefault(),j.animateScroll(b,b.hash,K))},N=function(){F||(F=setTimeout(function(){F=null,G=M(I)},66))};return j.destroy=function(){K&&(x.document.removeEventListener("click",k,!1),x.removeEventListener("resize",N,!1),K=null,F=null,I=null,G=null)},j.init=function(a){L&&(j.destroy(),K=q(C,a||{}),I=x.document.querySelector("[data-scroll-header]"),G=M(I),x.document.addEventListener("click",k,!1),I&&x.addEventListener("resize",N,!1))},j});(function(a,d,b,c){a.fn.formchimp=function(k){var g=a(this);var e=a("body");var h=g.attr("action").replace("/post?","/post-json?").concat("&c=?");var f=g.find('[type="submit"]');var i={appendElement:g,buttonSelector:f,buttonText:"",debug:false,errorMessage:"",onMailChimpSuccess:function(){},onMailChimpError:function(){},responseClass:"mc-response",successMessage:"",url:h,};var j=i.buttonSelector.text();a.extend(i,k);a(g).on("submit",function(l){l.preventDefault();e.removeClass("mc-success mc-error").addClass("mc-loading");if(a("."+i.responseClass).length===0){$responseContainer=a("<div/>").addClass(i.responseClass).appendTo(i.appendElement)}else{$responseContainer.html("")}a.ajax({url:i.url,data:g.serialize(),dataType:"jsonp"}).done(function(m){if(i.debug){console.log(JSON.stringify(m))}var n=m.msg;if(!isNaN(n.charAt(0))&&n.charAt(2)==="-"){n=n.substring(3)}e.addClass("mc-"+m.result).removeClass("mc-loading");if(m.result==="success"){if(i.successMessage!==""){n=i.successMessage}if(i.buttonText!==""){i.buttonSelector.text(i.buttonText)}a(b).trigger("mailChimpSuccess");i.onMailChimpSuccess.call()}else{if(i.errorMessage!==""){n=i.errorMessage}if(i.buttonText!==""){i.buttonSelector.text(j)}a(b).trigger("mailChimpError");i.onMailChimpError.call()}$responseContainer.html(n)})})}})(jQuery,window,document);

Callers 2

fFunction · 0.70
plugins.jsFile · 0.70

Calls 1

fFunction · 0.70

Tested by

no test coverage detected