Remove js library and move them to static

parent 07f0cf15
/*
Copyright 2014 Adobe Systems Incorporated. Licensed under the Apache 2.0 License.
http://www.apache.org/licenses/LICENSE-2.0.html
*/
!function(){"use strict";function a(a){var b=parseFloat(a.fontSize),c="normal"===a.lineHeight?p*b:parseFloat(a.lineHeight);return{leading:c-b,lineHeight:c,fontSize:b}}function b(a){var b=a.createElement("div");return b.style.position="fixed",b.style.padding=o,b.style.opacity="0",b.style.fontSize=n,b.style.lineHeight="1",a.body.appendChild(b),b}function c(a){var b=a.ownerDocument.createElement("span");return b.textContent=l,a&&a.appendChild(b),b}function d(a){a.ownerDocument.body.removeChild(a)}function e(a,b,c,d){function e(a,b){var c=4*b,d=a.data[c],e=a.data[c+1],f=a.data[c+2];return 0===d||0===e||0===f?!0:!1}var f=-1,g=document.createElement("canvas");g.width=c,g.height=d,a.appendChild(g);var h=g.getContext("2d");h.font=n+" "+b,h.fillStyle="#ffffff",h.fillRect(0,0,h.canvas.width,h.canvas.height),h.fillStyle="#000000",h.textBaseline="top",h.fillText("E",0,0);for(var i=h.getImageData(Math.ceil(g.width/2),0,1,g.height),j=null,k=g.height-1;k>=0;k--)if(e(i,k)){j=k;break}for(var k=0;k<g.height;k++)if(e(i,k)){f=(j+1-k)/d;break}return f}function f(a,f){var g=q[f];if(g)return g;g={baselineRatio:void 0,capHeightRatio:void 0};var h=b(a);h.style.fontFamily=f;var i=c(h);i.style.fontSize=o;var j=c(h);g.baselineRatio=i.offsetTop/m;try{g.capHeightRatio=e(h,f,j.offsetWidth,m)}catch(k){throw new Error("[dropcap.js] Error computing font metrics: "+k.message)}finally{d(h)}return q[f]=g,g}function g(a){return a+"px"}function h(a){return a.classList.contains(r)?!0:void 0}function i(a){var b="gjpqQ";return-1===b.indexOf(a.textContent)?!1:!0}function j(a){a.dcapjs&&(a.style.cssFloat="",a.style.padding="",a.style.fontSize="",a.style.lineHeight="",a.style.marginTop="")}function k(b,c,d){if(d||(d=c),1==d&&1==c)return void j(b);var e=b.ownerDocument,k=b,l=k.parentNode,m=window.getComputedStyle(k),n=window.getComputedStyle(l),p=f(e,m.fontFamily),q=f(e,n.fontFamily),r=p.capHeightRatio,s=a(n),t=(q.baselineRatio-q.capHeightRatio)*s.fontSize,u=c*s.lineHeight-s.leading-t-(1-q.baselineRatio)*s.fontSize,v=u/r;k.dcapjs=!0,k.style.cssFloat="left",k.style.padding=o,k.style.fontSize=g(v),k.style.lineHeight=o;var w=s.leading/2+t;if(w-=(c-d)*s.lineHeight,k.style.marginTop=g(w),c>d){var x=parseFloat(n.marginTop);l.style.marginTop=g(x+-1*w)}var y=0;i(k)?y=v*(1-p.baselineRatio):h(k)&&(y=v-u),k.style.height=g(u+y);var z=k.dcapjsStrut;z||(z=e.createElement("span"),z.style.display="inline-block",k.appendChild(z),k.dcapjsStrut=z),z.style.height=g(u)}var l="X",m=100,n=m+"px",o="0px",p=1.15,q={},r="dcjs-descender";window.Dropcap={layout:function(a,b,c){if(1>b||c&&1>c)throw new RangeError("Dropcap.layout expects the baseline position and height to be 1 or above");if(a instanceof HTMLElement)k(a,b,c);else{if(!(a instanceof NodeList))throw new TypeError("Dropcap.layout expects a single HTMLElement or a NodeList");var d=Array.prototype.forEach;d.call(a,function(a){k(a,b,c)})}}}}();
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
/*! responsive-nav.js 1.0.34, copyright (c) 2014 @viljamis, MIT license */
!function(a,b,c){"use strict";var d=function(d,e){var f=!!b.getComputedStyle;f||(b.getComputedStyle=function(a){return this.el=a,this.getPropertyValue=function(b){var c=/(\-([a-z]){1})/g;return"float"===b&&(b="styleFloat"),c.test(b)&&(b=b.replace(c,function(){return arguments[2].toUpperCase()})),a.currentStyle[b]?a.currentStyle[b]:null},this});var g,h,i,j,k,l,m=function(a,b,c,d){if("addEventListener"in a)try{a.addEventListener(b,c,d)}catch(e){if("object"!=typeof c||!c.handleEvent)throw e;a.addEventListener(b,function(a){c.handleEvent.call(c,a)},d)}else"attachEvent"in a&&("object"==typeof c&&c.handleEvent?a.attachEvent("on"+b,function(){c.handleEvent.call(c)}):a.attachEvent("on"+b,c))},n=function(a,b,c,d){if("removeEventListener"in a)try{a.removeEventListener(b,c,d)}catch(e){if("object"!=typeof c||!c.handleEvent)throw e;a.removeEventListener(b,function(a){c.handleEvent.call(c,a)},d)}else"detachEvent"in a&&("object"==typeof c&&c.handleEvent?a.detachEvent("on"+b,function(){c.handleEvent.call(c)}):a.detachEvent("on"+b,c))},o=function(a){if(a.children.length<1)throw new Error("The Nav container has no containing elements");for(var b=[],c=0;c<a.children.length;c++)1===a.children[c].nodeType&&b.push(a.children[c]);return b},p=function(a,b){for(var c in b)a.setAttribute(c,b[c])},q=function(a,b){0!==a.className.indexOf(b)&&(a.className+=" "+b,a.className=a.className.replace(/(^\s*)|(\s*$)/g,""))},r=function(a,b){var c=new RegExp("(\\s|^)"+b+"(\\s|$)");a.className=a.className.replace(c," ").replace(/(^\s*)|(\s*$)/g,"")},s=function(a,b,c){for(var d=0;d<a.length;d++)b.call(c,d,a[d])},t=a.createElement("style"),u=a.documentElement,v=function(b,c){var d;this.options={animate:!0,transition:284,label:"",insert:"before",customToggle:"",closeOnNavClick:!1,openPos:"relative",navClass:"nav-collapse",navActiveClass:"js-nav-active",jsClass:"js",init:function(){},open:function(){},close:function(){}};for(d in c)this.options[d]=c[d];if(q(u,this.options.jsClass),this.wrapperEl=b.replace("#",""),a.getElementById(this.wrapperEl))this.wrapper=a.getElementById(this.wrapperEl);else{if(!a.querySelector(this.wrapperEl))throw new Error("The nav element you are trying to select doesn't exist");this.wrapper=a.querySelector(this.wrapperEl)}this.wrapper.inner=o(this.wrapper),h=this.options,g=this.wrapper,this._init(this)};return v.prototype={destroy:function(){this._removeStyles(),r(g,"closed"),r(g,"opened"),r(g,h.navClass),r(g,h.navClass+"-"+this.index),r(u,h.navActiveClass),g.removeAttribute("style"),g.removeAttribute("aria-hidden"),n(b,"resize",this,!1),n(b,"focus",this,!1),n(a.body,"touchmove",this,!1),n(i,"touchstart",this,!1),n(i,"touchend",this,!1),n(i,"mouseup",this,!1),n(i,"keyup",this,!1),n(i,"click",this,!1),h.customToggle?i.removeAttribute("aria-hidden"):i.parentNode.removeChild(i)},toggle:function(){j===!0&&(l?this.close():this.open(),this._enablePointerEvents())},open:function(){l||(r(g,"closed"),q(g,"opened"),q(u,h.navActiveClass),q(i,"active"),g.style.position=h.openPos,p(g,{"aria-hidden":"false"}),l=!0,h.open())},close:function(){l&&(q(g,"closed"),r(g,"opened"),r(u,h.navActiveClass),r(i,"active"),p(g,{"aria-hidden":"true"}),h.animate?(j=!1,setTimeout(function(){g.style.position="absolute",j=!0},h.transition+10)):g.style.position="absolute",l=!1,h.close())},resize:function(){"none"!==b.getComputedStyle(i,null).getPropertyValue("display")?(k=!0,p(i,{"aria-hidden":"false"}),g.className.match(/(^|\s)closed(\s|$)/)&&(p(g,{"aria-hidden":"true"}),g.style.position="absolute"),this._createStyles(),this._calcHeight()):(k=!1,p(i,{"aria-hidden":"true"}),p(g,{"aria-hidden":"false"}),g.style.position=h.openPos,this._removeStyles())},handleEvent:function(a){var c=a||b.event;switch(c.type){case"touchstart":this._onTouchStart(c);break;case"touchmove":this._onTouchMove(c);break;case"touchend":case"mouseup":this._onTouchEnd(c);break;case"click":this._preventDefault(c);break;case"keyup":this._onKeyUp(c);break;case"focus":case"resize":this.resize(c)}},_init:function(){this.index=c++,q(g,h.navClass),q(g,h.navClass+"-"+this.index),q(g,"closed"),j=!0,l=!1,this._closeOnNavClick(),this._createToggle(),this._transitions(),this.resize();var d=this;setTimeout(function(){d.resize()},20),m(b,"resize",this,!1),m(b,"focus",this,!1),m(a.body,"touchmove",this,!1),m(i,"touchstart",this,!1),m(i,"touchend",this,!1),m(i,"mouseup",this,!1),m(i,"keyup",this,!1),m(i,"click",this,!1),h.init()},_createStyles:function(){t.parentNode||(t.type="text/css",a.getElementsByTagName("head")[0].appendChild(t))},_removeStyles:function(){t.parentNode&&t.parentNode.removeChild(t)},_createToggle:function(){if(h.customToggle){var b=h.customToggle.replace("#","");if(a.getElementById(b))i=a.getElementById(b);else{if(!a.querySelector(b))throw new Error("The custom nav toggle you are trying to select doesn't exist");i=a.querySelector(b)}}else{var c=a.createElement("a");c.innerHTML=h.label,p(c,{href:"#","class":"nav-toggle"}),"after"===h.insert?g.parentNode.insertBefore(c,g.nextSibling):g.parentNode.insertBefore(c,g),i=c}},_closeOnNavClick:function(){if(h.closeOnNavClick){var a=g.getElementsByTagName("a"),b=this;s(a,function(c){m(a[c],"click",function(){k&&b.toggle()},!1)})}},_preventDefault:function(a){return a.preventDefault?(a.stopImmediatePropagation&&a.stopImmediatePropagation(),a.preventDefault(),a.stopPropagation(),!1):void(a.returnValue=!1)},_onTouchStart:function(b){this._preventDefault(b),q(a.body,"disable-pointer-events"),this.startX=b.touches[0].clientX,this.startY=b.touches[0].clientY,this.touchHasMoved=!1,n(i,"mouseup",this,!1)},_onTouchMove:function(a){(Math.abs(a.touches[0].clientX-this.startX)>10||Math.abs(a.touches[0].clientY-this.startY)>10)&&(this._enablePointerEvents(),this.touchHasMoved=!0)},_onTouchEnd:function(c){if(this._preventDefault(c),k&&!this.touchHasMoved){if("touchend"===c.type)return this.toggle(),void("after"===h.insert&&setTimeout(function(){r(a.body,"disable-pointer-events")},h.transition+300));var d=c||b.event;3!==d.which&&2!==d.button&&this.toggle()}},_onKeyUp:function(a){var c=a||b.event;13===c.keyCode&&this.toggle()},_enablePointerEvents:function(){r(a.body,"disable-pointer-events")},_transitions:function(){if(h.animate){var a=g.style,b="max-height "+h.transition+"ms";a.WebkitTransition=b,a.MozTransition=b,a.OTransition=b,a.transition=b}},_calcHeight:function(){for(var a=0,b=0;b<g.inner.length;b++)a+=g.inner[b].offsetHeight;var c="."+h.jsClass+" ."+h.navClass+"-"+this.index+".opened{max-height:"+a+"px !important} ."+h.jsClass+" .disable-pointer-events{pointer-events:none !important} ."+h.jsClass+" ."+h.navClass+"-"+this.index+".opened.dropdown-active {max-height:9999px !important}";t.styleSheet?t.styleSheet.cssText=c:t.innerHTML=c,c=""}},new v(d,e)};b.responsiveNav=d}(document,window,0);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment