6445 lines
353 KiB
JavaScript
6445 lines
353 KiB
JavaScript
/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
|
||
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){
|
||
return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ia={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qa[0].contentDocument,b.write(),b.close(),c=sa(a,b),qa.detach()),ra[a]=c),c}var ua=/^margin/,va=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wa=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)};function xa(a,b,c){var d,e,f,g,h=a.style;return c=c||wa(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),va.test(g)&&ua.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function ya(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),f.removeChild(c),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var za=/^(none|table(?!-c[ea]).+)/,Aa=new RegExp("^("+Q+")(.*)$","i"),Ba=new RegExp("^([+-])=("+Q+")","i"),Ca={position:"absolute",visibility:"hidden",display:"block"},Da={letterSpacing:"0",fontWeight:"400"},Ea=["Webkit","O","Moz","ms"];function Fa(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Ea.length;while(e--)if(b=Ea[e]+c,b in a)return b;return d}function Ga(a,b,c){var d=Aa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Ha(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ia(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wa(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xa(a,b,f),(0>e||null==e)&&(e=a.style[b]),va.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Ha(a,b,c||(g?"border":"content"),d,f)+"px"}function Ja(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",ta(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xa(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fa(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Ba.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fa(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xa(a,b,d)),"normal"===e&&b in Da&&(e=Da[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?za.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Ca,function(){return Ia(a,b,d)}):Ia(a,b,d):void 0},set:function(a,c,d){var e=d&&wa(a);return Ga(a,c,d?Ha(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=ya(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ua.test(a)||(n.cssHooks[a+b].set=Ga)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wa(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Ja(this,!0)},hide:function(){return Ja(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Ka(a,b,c,d,e){return new Ka.prototype.init(a,b,c,d,e)}n.Tween=Ka,Ka.prototype={constructor:Ka,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ka.propHooks[this.prop];return a&&a.get?a.get(this):Ka.propHooks._default.get(this)},run:function(a){var b,c=Ka.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ka.propHooks._default.set(this),this}},Ka.prototype.init.prototype=Ka.prototype,Ka.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Ka.propHooks.scrollTop=Ka.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Ka.prototype.init,n.fx.step={};var La,Ma,Na=/^(?:toggle|show|hide)$/,Oa=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pa=/queueHooks$/,Qa=[Va],Ra={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Oa.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Oa.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sa(){return setTimeout(function(){La=void 0}),La=n.now()}function Ta(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ua(a,b,c){for(var d,e=(Ra[b]||[]).concat(Ra["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Va(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||ta(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Na.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?ta(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ua(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wa(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xa(a,b,c){var d,e,f=0,g=Qa.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=La||Sa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:La||Sa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wa(k,j.opts.specialEasing);g>f;f++)if(d=Qa[f].call(j,a,k,j.opts))return d;return n.map(k,Ua,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xa,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Ra[c]=Ra[c]||[],Ra[c].unshift(b)},prefilter:function(a,b){b?Qa.unshift(a):Qa.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xa(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pa.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Ta(b,!0),a,d,e)}}),n.each({slideDown:Ta("show"),slideUp:Ta("hide"),slideToggle:Ta("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(La=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),La=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ma||(Ma=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Ma),Ma=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Ya,Za,$a=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Za:Ya)),
|
||
void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Za={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$a[b]||n.find.attr;$a[b]=function(a,b,d){var e,f;return d||(f=$a[b],$a[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$a[b]=f),e}});var _a=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_a.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ab=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ab," ").indexOf(b)>=0)return!0;return!1}});var bb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cb=n.now(),db=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var eb=/#.*$/,fb=/([?&])_=[^&]*/,gb=/^(.*?):[ \t]*([^\r\n]*)$/gm,hb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ib=/^(?:GET|HEAD)$/,jb=/^\/\//,kb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lb={},mb={},nb="*/".concat("*"),ob=a.location.href,pb=kb.exec(ob.toLowerCase())||[];function qb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function rb(a,b,c,d){var e={},f=a===mb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function sb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function tb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function ub(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ob,type:"GET",isLocal:hb.test(pb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":nb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?sb(sb(a,n.ajaxSettings),b):sb(n.ajaxSettings,a)},ajaxPrefilter:qb(lb),ajaxTransport:qb(mb),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=gb.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||ob)+"").replace(eb,"").replace(jb,pb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=kb.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===pb[1]&&h[2]===pb[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(pb[3]||("http:"===pb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),rb(lb,k,b,v),2===t)return v;i=n.event&&k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!ib.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(db.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=fb.test(d)?d.replace(fb,"$1_="+cb++):d+(db.test(d)?"&":"?")+"_="+cb++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+nb+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=rb(mb,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=tb(k,v,f)),u=ub(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var vb=/%20/g,wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&").replace(vb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Bb=0,Cb={},Db={0:200,1223:204},Eb=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Cb)Cb[a]()}),k.cors=!!Eb&&"withCredentials"in Eb,k.ajax=Eb=!!Eb,n.ajaxTransport(function(a){var b;return k.cors||Eb&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Bb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Cb[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Db[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Cb[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Fb=[],Gb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Fb.pop()||n.expando+"_"+cb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Gb.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Gb,"$1"+e):b.jsonp!==!1&&(b.url+=(db.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Fb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Hb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Hb)return Hb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Ib=a.document.documentElement;function Jb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Jb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Ib;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ib})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Jb(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=ya(k.pixelPosition,function(a,c){return c?(c=xa(a,b),va.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Kb=a.jQuery,Lb=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Lb),b&&a.jQuery===n&&(a.jQuery=Kb),n},typeof b===U&&(a.jQuery=a.$=n),n});
|
||
//# sourceMappingURL=jquery.min.map
|
||
;(function () {
|
||
'use strict';
|
||
|
||
/**
|
||
* @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
|
||
*
|
||
* @codingstandard ftlabs-jsv2
|
||
* @copyright The Financial Times Limited [All Rights Reserved]
|
||
* @license MIT License (see LICENSE.txt)
|
||
*/
|
||
|
||
/*jslint browser:true, node:true*/
|
||
/*global define, Event, Node*/
|
||
|
||
|
||
/**
|
||
* Instantiate fast-clicking listeners on the specified layer.
|
||
*
|
||
* @constructor
|
||
* @param {Element} layer The layer to listen on
|
||
* @param {Object} [options={}] The options to override the defaults
|
||
*/
|
||
function FastClick(layer, options) {
|
||
var oldOnClick;
|
||
|
||
options = options || {};
|
||
|
||
/**
|
||
* Whether a click is currently being tracked.
|
||
*
|
||
* @type boolean
|
||
*/
|
||
this.trackingClick = false;
|
||
|
||
|
||
/**
|
||
* Timestamp for when click tracking started.
|
||
*
|
||
* @type number
|
||
*/
|
||
this.trackingClickStart = 0;
|
||
|
||
|
||
/**
|
||
* The element being tracked for a click.
|
||
*
|
||
* @type EventTarget
|
||
*/
|
||
this.targetElement = null;
|
||
|
||
|
||
/**
|
||
* X-coordinate of touch start event.
|
||
*
|
||
* @type number
|
||
*/
|
||
this.touchStartX = 0;
|
||
|
||
|
||
/**
|
||
* Y-coordinate of touch start event.
|
||
*
|
||
* @type number
|
||
*/
|
||
this.touchStartY = 0;
|
||
|
||
|
||
/**
|
||
* ID of the last touch, retrieved from Touch.identifier.
|
||
*
|
||
* @type number
|
||
*/
|
||
this.lastTouchIdentifier = 0;
|
||
|
||
|
||
/**
|
||
* Touchmove boundary, beyond which a click will be cancelled.
|
||
*
|
||
* @type number
|
||
*/
|
||
this.touchBoundary = options.touchBoundary || 10;
|
||
|
||
|
||
/**
|
||
* The FastClick layer.
|
||
*
|
||
* @type Element
|
||
*/
|
||
this.layer = layer;
|
||
|
||
/**
|
||
* The minimum time between tap(touchstart and touchend) events
|
||
*
|
||
* @type number
|
||
*/
|
||
this.tapDelay = options.tapDelay || 200;
|
||
|
||
/**
|
||
* The maximum time for a tap
|
||
*
|
||
* @type number
|
||
*/
|
||
this.tapTimeout = options.tapTimeout || 700;
|
||
|
||
if (FastClick.notNeeded(layer)) {
|
||
return;
|
||
}
|
||
|
||
// Some old versions of Android don't have Function.prototype.bind
|
||
function bind(method, context) {
|
||
return function() { return method.apply(context, arguments); };
|
||
}
|
||
|
||
|
||
var methods = ['onMouse', 'onClick', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel'];
|
||
var context = this;
|
||
for (var i = 0, l = methods.length; i < l; i++) {
|
||
context[methods[i]] = bind(context[methods[i]], context);
|
||
}
|
||
|
||
// Set up event handlers as required
|
||
if (deviceIsAndroid) {
|
||
layer.addEventListener('mouseover', this.onMouse, true);
|
||
layer.addEventListener('mousedown', this.onMouse, true);
|
||
layer.addEventListener('mouseup', this.onMouse, true);
|
||
}
|
||
|
||
layer.addEventListener('click', this.onClick, true);
|
||
layer.addEventListener('touchstart', this.onTouchStart, false);
|
||
layer.addEventListener('touchmove', this.onTouchMove, false);
|
||
layer.addEventListener('touchend', this.onTouchEnd, false);
|
||
layer.addEventListener('touchcancel', this.onTouchCancel, false);
|
||
|
||
// Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
|
||
// which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick
|
||
// layer when they are cancelled.
|
||
if (!Event.prototype.stopImmediatePropagation) {
|
||
layer.removeEventListener = function(type, callback, capture) {
|
||
var rmv = Node.prototype.removeEventListener;
|
||
if (type === 'click') {
|
||
rmv.call(layer, type, callback.hijacked || callback, capture);
|
||
} else {
|
||
rmv.call(layer, type, callback, capture);
|
||
}
|
||
};
|
||
|
||
layer.addEventListener = function(type, callback, capture) {
|
||
var adv = Node.prototype.addEventListener;
|
||
if (type === 'click') {
|
||
adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) {
|
||
if (!event.propagationStopped) {
|
||
callback(event);
|
||
}
|
||
}), capture);
|
||
} else {
|
||
adv.call(layer, type, callback, capture);
|
||
}
|
||
};
|
||
}
|
||
|
||
// If a handler is already declared in the element's onclick attribute, it will be fired before
|
||
// FastClick's onClick handler. Fix this by pulling out the user-defined handler function and
|
||
// adding it as listener.
|
||
if (typeof layer.onclick === 'function') {
|
||
|
||
// Android browser on at least 3.2 requires a new reference to the function in layer.onclick
|
||
// - the old one won't work if passed to addEventListener directly.
|
||
oldOnClick = layer.onclick;
|
||
layer.addEventListener('click', function(event) {
|
||
oldOnClick(event);
|
||
}, false);
|
||
layer.onclick = null;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Windows Phone 8.1 fakes user agent string to look like Android and iPhone.
|
||
*
|
||
* @type boolean
|
||
*/
|
||
var deviceIsWindowsPhone = navigator.userAgent.indexOf("Windows Phone") >= 0;
|
||
|
||
/**
|
||
* Android requires exceptions.
|
||
*
|
||
* @type boolean
|
||
*/
|
||
var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0 && !deviceIsWindowsPhone;
|
||
|
||
|
||
/**
|
||
* iOS requires exceptions.
|
||
*
|
||
* @type boolean
|
||
*/
|
||
var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent) && !deviceIsWindowsPhone;
|
||
|
||
|
||
/**
|
||
* iOS 4 requires an exception for select elements.
|
||
*
|
||
* @type boolean
|
||
*/
|
||
var deviceIsIOS4 = deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent);
|
||
|
||
|
||
/**
|
||
* iOS 6.0-7.* requires the target element to be manually derived
|
||
*
|
||
* @type boolean
|
||
*/
|
||
var deviceIsIOSWithBadTarget = deviceIsIOS && (/OS [6-7]_\d/).test(navigator.userAgent);
|
||
|
||
/**
|
||
* BlackBerry requires exceptions.
|
||
*
|
||
* @type boolean
|
||
*/
|
||
var deviceIsBlackBerry10 = navigator.userAgent.indexOf('BB10') > 0;
|
||
|
||
/**
|
||
* Determine whether a given element requires a native click.
|
||
*
|
||
* @param {EventTarget|Element} target Target DOM element
|
||
* @returns {boolean} Returns true if the element needs a native click
|
||
*/
|
||
FastClick.prototype.needsClick = function(target) {
|
||
switch (target.nodeName.toLowerCase()) {
|
||
|
||
// Don't send a synthetic click to disabled inputs (issue #62)
|
||
case 'button':
|
||
case 'select':
|
||
case 'textarea':
|
||
if (target.disabled) {
|
||
return true;
|
||
}
|
||
|
||
break;
|
||
case 'input':
|
||
|
||
// File inputs need real clicks on iOS 6 due to a browser bug (issue #68)
|
||
if ((deviceIsIOS && target.type === 'file') || target.disabled) {
|
||
return true;
|
||
}
|
||
|
||
break;
|
||
case 'label':
|
||
case 'iframe': // iOS8 homescreen apps can prevent events bubbling into frames
|
||
case 'video':
|
||
return true;
|
||
}
|
||
|
||
return (/\bneedsclick\b/).test(target.className);
|
||
};
|
||
|
||
|
||
/**
|
||
* Determine whether a given element requires a call to focus to simulate click into element.
|
||
*
|
||
* @param {EventTarget|Element} target Target DOM element
|
||
* @returns {boolean} Returns true if the element requires a call to focus to simulate native click.
|
||
*/
|
||
FastClick.prototype.needsFocus = function(target) {
|
||
switch (target.nodeName.toLowerCase()) {
|
||
case 'textarea':
|
||
return true;
|
||
case 'select':
|
||
return !deviceIsAndroid;
|
||
case 'input':
|
||
switch (target.type) {
|
||
case 'button':
|
||
case 'checkbox':
|
||
case 'file':
|
||
case 'image':
|
||
case 'radio':
|
||
case 'submit':
|
||
return false;
|
||
}
|
||
|
||
// No point in attempting to focus disabled inputs
|
||
return !target.disabled && !target.readOnly;
|
||
default:
|
||
return (/\bneedsfocus\b/).test(target.className);
|
||
}
|
||
};
|
||
|
||
|
||
/**
|
||
* Send a click event to the specified element.
|
||
*
|
||
* @param {EventTarget|Element} targetElement
|
||
* @param {Event} event
|
||
*/
|
||
FastClick.prototype.sendClick = function(targetElement, event) {
|
||
var clickEvent, touch;
|
||
|
||
// On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24)
|
||
if (document.activeElement && document.activeElement !== targetElement) {
|
||
document.activeElement.blur();
|
||
}
|
||
|
||
touch = event.changedTouches[0];
|
||
|
||
// Synthesise a click event, with an extra attribute so it can be tracked
|
||
clickEvent = document.createEvent('MouseEvents');
|
||
clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
|
||
clickEvent.forwardedTouchEvent = true;
|
||
targetElement.dispatchEvent(clickEvent);
|
||
};
|
||
|
||
FastClick.prototype.determineEventType = function(targetElement) {
|
||
|
||
//Issue #159: Android Chrome Select Box does not open with a synthetic click event
|
||
if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
|
||
return 'mousedown';
|
||
}
|
||
|
||
return 'click';
|
||
};
|
||
|
||
|
||
/**
|
||
* @param {EventTarget|Element} targetElement
|
||
*/
|
||
FastClick.prototype.focus = function(targetElement) {
|
||
var length;
|
||
|
||
// Issue #160: on iOS 7, some input elements (e.g. date datetime month) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.
|
||
if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') {
|
||
length = targetElement.value.length;
|
||
targetElement.setSelectionRange(length, length);
|
||
} else {
|
||
targetElement.focus();
|
||
}
|
||
};
|
||
|
||
|
||
/**
|
||
* Check whether the given target element is a child of a scrollable layer and if so, set a flag on it.
|
||
*
|
||
* @param {EventTarget|Element} targetElement
|
||
*/
|
||
FastClick.prototype.updateScrollParent = function(targetElement) {
|
||
var scrollParent, parentElement;
|
||
|
||
scrollParent = targetElement.fastClickScrollParent;
|
||
|
||
// Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the
|
||
// target element was moved to another parent.
|
||
if (!scrollParent || !scrollParent.contains(targetElement)) {
|
||
parentElement = targetElement;
|
||
do {
|
||
if (parentElement.scrollHeight > parentElement.offsetHeight) {
|
||
scrollParent = parentElement;
|
||
targetElement.fastClickScrollParent = parentElement;
|
||
break;
|
||
}
|
||
|
||
parentElement = parentElement.parentElement;
|
||
} while (parentElement);
|
||
}
|
||
|
||
// Always update the scroll top tracker if possible.
|
||
if (scrollParent) {
|
||
scrollParent.fastClickLastScrollTop = scrollParent.scrollTop;
|
||
}
|
||
};
|
||
|
||
|
||
/**
|
||
* @param {EventTarget} targetElement
|
||
* @returns {Element|EventTarget}
|
||
*/
|
||
FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) {
|
||
|
||
// On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node.
|
||
if (eventTarget.nodeType === Node.TEXT_NODE) {
|
||
return eventTarget.parentNode;
|
||
}
|
||
|
||
return eventTarget;
|
||
};
|
||
|
||
|
||
/**
|
||
* On touch start, record the position and scroll offset.
|
||
*
|
||
* @param {Event} event
|
||
* @returns {boolean}
|
||
*/
|
||
FastClick.prototype.onTouchStart = function(event) {
|
||
var targetElement, touch, selection;
|
||
|
||
// Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
|
||
if (event.targetTouches.length > 1) {
|
||
return true;
|
||
}
|
||
|
||
targetElement = this.getTargetElementFromEventTarget(event.target);
|
||
touch = event.targetTouches[0];
|
||
|
||
if (deviceIsIOS) {
|
||
|
||
// Only trusted events will deselect text on iOS (issue #49)
|
||
selection = window.getSelection();
|
||
if (selection.rangeCount && !selection.isCollapsed) {
|
||
return true;
|
||
}
|
||
|
||
if (!deviceIsIOS4) {
|
||
|
||
// Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23):
|
||
// when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched
|
||
// with the same identifier as the touch event that previously triggered the click that triggered the alert.
|
||
// Sadly, there is an issue on iOS 4 that causes some normal touch events to have the same identifier as an
|
||
// immediately preceeding touch event (issue #52), so this fix is unavailable on that platform.
|
||
// Issue 120: touch.identifier is 0 when Chrome dev tools 'Emulate touch events' is set with an iOS device UA string,
|
||
// which causes all touch events to be ignored. As this block only applies to iOS, and iOS identifiers are always long,
|
||
// random integers, it's safe to to continue if the identifier is 0 here.
|
||
if (touch.identifier && touch.identifier === this.lastTouchIdentifier) {
|
||
event.preventDefault();
|
||
return false;
|
||
}
|
||
|
||
this.lastTouchIdentifier = touch.identifier;
|
||
|
||
// If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and:
|
||
// 1) the user does a fling scroll on the scrollable layer
|
||
// 2) the user stops the fling scroll with another tap
|
||
// then the event.target of the last 'touchend' event will be the element that was under the user's finger
|
||
// when the fling scroll was started, causing FastClick to send a click event to that layer - unless a check
|
||
// is made to ensure that a parent layer was not scrolled before sending a synthetic click (issue #42).
|
||
this.updateScrollParent(targetElement);
|
||
}
|
||
}
|
||
|
||
this.trackingClick = true;
|
||
this.trackingClickStart = event.timeStamp;
|
||
this.targetElement = targetElement;
|
||
|
||
this.touchStartX = touch.pageX;
|
||
this.touchStartY = touch.pageY;
|
||
|
||
// Prevent phantom clicks on fast double-tap (issue #36)
|
||
if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
|
||
event.preventDefault();
|
||
}
|
||
|
||
return true;
|
||
};
|
||
|
||
|
||
/**
|
||
* Based on a touchmove event object, check whether the touch has moved past a boundary since it started.
|
||
*
|
||
* @param {Event} event
|
||
* @returns {boolean}
|
||
*/
|
||
FastClick.prototype.touchHasMoved = function(event) {
|
||
var touch = event.changedTouches[0], boundary = this.touchBoundary;
|
||
|
||
if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) {
|
||
return true;
|
||
}
|
||
|
||
return false;
|
||
};
|
||
|
||
|
||
/**
|
||
* Update the last position.
|
||
*
|
||
* @param {Event} event
|
||
* @returns {boolean}
|
||
*/
|
||
FastClick.prototype.onTouchMove = function(event) {
|
||
if (!this.trackingClick) {
|
||
return true;
|
||
}
|
||
|
||
// If the touch has moved, cancel the click tracking
|
||
if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) {
|
||
this.trackingClick = false;
|
||
this.targetElement = null;
|
||
}
|
||
|
||
return true;
|
||
};
|
||
|
||
|
||
/**
|
||
* Attempt to find the labelled control for the given label element.
|
||
*
|
||
* @param {EventTarget|HTMLLabelElement} labelElement
|
||
* @returns {Element|null}
|
||
*/
|
||
FastClick.prototype.findControl = function(labelElement) {
|
||
|
||
// Fast path for newer browsers supporting the HTML5 control attribute
|
||
if (labelElement.control !== undefined) {
|
||
return labelElement.control;
|
||
}
|
||
|
||
// All browsers under test that support touch events also support the HTML5 htmlFor attribute
|
||
if (labelElement.htmlFor) {
|
||
return document.getElementById(labelElement.htmlFor);
|
||
}
|
||
|
||
// If no for attribute exists, attempt to retrieve the first labellable descendant element
|
||
// the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label
|
||
return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea');
|
||
};
|
||
|
||
|
||
/**
|
||
* On touch end, determine whether to send a click event at once.
|
||
*
|
||
* @param {Event} event
|
||
* @returns {boolean}
|
||
*/
|
||
FastClick.prototype.onTouchEnd = function(event) {
|
||
var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
|
||
|
||
if (!this.trackingClick) {
|
||
return true;
|
||
}
|
||
|
||
// Prevent phantom clicks on fast double-tap (issue #36)
|
||
if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
|
||
this.cancelNextClick = true;
|
||
return true;
|
||
}
|
||
|
||
if ((event.timeStamp - this.trackingClickStart) > this.tapTimeout) {
|
||
return true;
|
||
}
|
||
|
||
// Reset to prevent wrong click cancel on input (issue #156).
|
||
this.cancelNextClick = false;
|
||
|
||
this.lastClickTime = event.timeStamp;
|
||
|
||
trackingClickStart = this.trackingClickStart;
|
||
this.trackingClick = false;
|
||
this.trackingClickStart = 0;
|
||
|
||
// On some iOS devices, the targetElement supplied with the event is invalid if the layer
|
||
// is performing a transition or scroll, and has to be re-detected manually. Note that
|
||
// for this to function correctly, it must be called *after* the event target is checked!
|
||
// See issue #57; also filed as rdar://13048589 .
|
||
if (deviceIsIOSWithBadTarget) {
|
||
touch = event.changedTouches[0];
|
||
|
||
// In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null
|
||
targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement;
|
||
targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent;
|
||
}
|
||
|
||
targetTagName = targetElement.tagName.toLowerCase();
|
||
if (targetTagName === 'label') {
|
||
forElement = this.findControl(targetElement);
|
||
if (forElement) {
|
||
this.focus(targetElement);
|
||
if (deviceIsAndroid) {
|
||
return false;
|
||
}
|
||
|
||
targetElement = forElement;
|
||
}
|
||
} else if (this.needsFocus(targetElement)) {
|
||
|
||
// Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through.
|
||
// Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37).
|
||
if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) {
|
||
this.targetElement = null;
|
||
return false;
|
||
}
|
||
|
||
this.focus(targetElement);
|
||
this.sendClick(targetElement, event);
|
||
|
||
// Select elements need the event to go through on iOS 4, otherwise the selector menu won't open.
|
||
// Also this breaks opening selects when VoiceOver is active on iOS6, iOS7 (and possibly others)
|
||
if (!deviceIsIOS || targetTagName !== 'select') {
|
||
this.targetElement = null;
|
||
event.preventDefault();
|
||
}
|
||
|
||
return false;
|
||
}
|
||
|
||
if (deviceIsIOS && !deviceIsIOS4) {
|
||
|
||
// Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled
|
||
// and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42).
|
||
scrollParent = targetElement.fastClickScrollParent;
|
||
if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) {
|
||
return true;
|
||
}
|
||
}
|
||
|
||
// Prevent the actual click from going though - unless the target node is marked as requiring
|
||
// real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted.
|
||
if (!this.needsClick(targetElement)) {
|
||
event.preventDefault();
|
||
this.sendClick(targetElement, event);
|
||
}
|
||
|
||
return false;
|
||
};
|
||
|
||
|
||
/**
|
||
* On touch cancel, stop tracking the click.
|
||
*
|
||
* @returns {void}
|
||
*/
|
||
FastClick.prototype.onTouchCancel = function() {
|
||
this.trackingClick = false;
|
||
this.targetElement = null;
|
||
};
|
||
|
||
|
||
/**
|
||
* Determine mouse events which should be permitted.
|
||
*
|
||
* @param {Event} event
|
||
* @returns {boolean}
|
||
*/
|
||
FastClick.prototype.onMouse = function(event) {
|
||
|
||
// If a target element was never set (because a touch event was never fired) allow the event
|
||
if (!this.targetElement) {
|
||
return true;
|
||
}
|
||
|
||
if (event.forwardedTouchEvent) {
|
||
return true;
|
||
}
|
||
|
||
// Programmatically generated events targeting a specific element should be permitted
|
||
if (!event.cancelable) {
|
||
return true;
|
||
}
|
||
|
||
// Derive and check the target element to see whether the mouse event needs to be permitted;
|
||
// unless explicitly enabled, prevent non-touch click events from triggering actions,
|
||
// to prevent ghost/doubleclicks.
|
||
if (!this.needsClick(this.targetElement) || this.cancelNextClick) {
|
||
|
||
// Prevent any user-added listeners declared on FastClick element from being fired.
|
||
if (event.stopImmediatePropagation) {
|
||
event.stopImmediatePropagation();
|
||
} else {
|
||
|
||
// Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
|
||
event.propagationStopped = true;
|
||
}
|
||
|
||
// Cancel the event
|
||
event.stopPropagation();
|
||
event.preventDefault();
|
||
|
||
return false;
|
||
}
|
||
|
||
// If the mouse event is permitted, return true for the action to go through.
|
||
return true;
|
||
};
|
||
|
||
|
||
/**
|
||
* On actual clicks, determine whether this is a touch-generated click, a click action occurring
|
||
* naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or
|
||
* an actual click which should be permitted.
|
||
*
|
||
* @param {Event} event
|
||
* @returns {boolean}
|
||
*/
|
||
FastClick.prototype.onClick = function(event) {
|
||
var permitted;
|
||
|
||
// It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early.
|
||
if (this.trackingClick) {
|
||
this.targetElement = null;
|
||
this.trackingClick = false;
|
||
return true;
|
||
}
|
||
|
||
// Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target.
|
||
if (event.target.type === 'submit' && event.detail === 0) {
|
||
return true;
|
||
}
|
||
|
||
permitted = this.onMouse(event);
|
||
|
||
// Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through.
|
||
if (!permitted) {
|
||
this.targetElement = null;
|
||
}
|
||
|
||
// If clicks are permitted, return true for the action to go through.
|
||
return permitted;
|
||
};
|
||
|
||
|
||
/**
|
||
* Remove all FastClick's event listeners.
|
||
*
|
||
* @returns {void}
|
||
*/
|
||
FastClick.prototype.destroy = function() {
|
||
var layer = this.layer;
|
||
|
||
if (deviceIsAndroid) {
|
||
layer.removeEventListener('mouseover', this.onMouse, true);
|
||
layer.removeEventListener('mousedown', this.onMouse, true);
|
||
layer.removeEventListener('mouseup', this.onMouse, true);
|
||
}
|
||
|
||
layer.removeEventListener('click', this.onClick, true);
|
||
layer.removeEventListener('touchstart', this.onTouchStart, false);
|
||
layer.removeEventListener('touchmove', this.onTouchMove, false);
|
||
layer.removeEventListener('touchend', this.onTouchEnd, false);
|
||
layer.removeEventListener('touchcancel', this.onTouchCancel, false);
|
||
};
|
||
|
||
|
||
/**
|
||
* Check whether FastClick is needed.
|
||
*
|
||
* @param {Element} layer The layer to listen on
|
||
*/
|
||
FastClick.notNeeded = function(layer) {
|
||
var metaViewport;
|
||
var chromeVersion;
|
||
var blackberryVersion;
|
||
var firefoxVersion;
|
||
|
||
// Devices that don't support touch don't need FastClick
|
||
if (typeof window.ontouchstart === 'undefined') {
|
||
return true;
|
||
}
|
||
|
||
// Chrome version - zero for other browsers
|
||
chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
|
||
|
||
if (chromeVersion) {
|
||
|
||
if (deviceIsAndroid) {
|
||
metaViewport = document.querySelector('meta[name=viewport]');
|
||
|
||
if (metaViewport) {
|
||
// Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89)
|
||
if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
|
||
return true;
|
||
}
|
||
// Chrome 32 and above with width=device-width or less don't need FastClick
|
||
if (chromeVersion > 31 && document.documentElement.scrollWidth <= window.outerWidth) {
|
||
return true;
|
||
}
|
||
}
|
||
|
||
// Chrome desktop doesn't need FastClick (issue #15)
|
||
} else {
|
||
return true;
|
||
}
|
||
}
|
||
|
||
if (deviceIsBlackBerry10) {
|
||
blackberryVersion = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/);
|
||
|
||
// BlackBerry 10.3+ does not require Fastclick library.
|
||
// https://github.com/ftlabs/fastclick/issues/251
|
||
if (blackberryVersion[1] >= 10 && blackberryVersion[2] >= 3) {
|
||
metaViewport = document.querySelector('meta[name=viewport]');
|
||
|
||
if (metaViewport) {
|
||
// user-scalable=no eliminates click delay.
|
||
if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
|
||
return true;
|
||
}
|
||
// width=device-width (or less than device-width) eliminates click delay.
|
||
if (document.documentElement.scrollWidth <= window.outerWidth) {
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// IE10 with -ms-touch-action: none or manipulation, which disables double-tap-to-zoom (issue #97)
|
||
if (layer.style.msTouchAction === 'none' || layer.style.touchAction === 'manipulation') {
|
||
return true;
|
||
}
|
||
|
||
// Firefox version - zero for other browsers
|
||
firefoxVersion = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
|
||
|
||
if (firefoxVersion >= 27) {
|
||
// Firefox 27+ does not have tap delay if the content is not zoomable - https://bugzilla.mozilla.org/show_bug.cgi?id=922896
|
||
|
||
metaViewport = document.querySelector('meta[name=viewport]');
|
||
if (metaViewport && (metaViewport.content.indexOf('user-scalable=no') !== -1 || document.documentElement.scrollWidth <= window.outerWidth)) {
|
||
return true;
|
||
}
|
||
}
|
||
|
||
// IE11: prefixed -ms-touch-action is no longer supported and it's recomended to use non-prefixed version
|
||
// http://msdn.microsoft.com/en-us/library/windows/apps/Hh767313.aspx
|
||
if (layer.style.touchAction === 'none' || layer.style.touchAction === 'manipulation') {
|
||
return true;
|
||
}
|
||
|
||
return false;
|
||
};
|
||
|
||
|
||
/**
|
||
* Factory method for creating a FastClick object
|
||
*
|
||
* @param {Element} layer The layer to listen on
|
||
* @param {Object} [options={}] The options to override the defaults
|
||
*/
|
||
FastClick.attach = function(layer, options) {
|
||
return new FastClick(layer, options);
|
||
};
|
||
|
||
|
||
if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
|
||
|
||
// AMD. Register as an anonymous module.
|
||
define(function() {
|
||
return FastClick;
|
||
});
|
||
} else if (typeof module !== 'undefined' && module.exports) {
|
||
module.exports = FastClick.attach;
|
||
module.exports.FastClick = FastClick;
|
||
} else {
|
||
window.FastClick = FastClick;
|
||
}
|
||
}());
|
||
|
||
/*global jQuery */
|
||
/*jshint browser:true */
|
||
/*!
|
||
* FitVids 1.1
|
||
*
|
||
* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
|
||
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
|
||
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
|
||
*
|
||
*/
|
||
|
||
(function( $ ){
|
||
|
||
"use strict";
|
||
|
||
$.fn.fitVids = function( options ) {
|
||
var settings = {
|
||
customSelector: null
|
||
};
|
||
|
||
if(!document.getElementById('fit-vids-style')) {
|
||
// appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
|
||
var head = document.head || document.getElementsByTagName('head')[0];
|
||
var css = '.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%;}';
|
||
var div = document.createElement('div');
|
||
div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
|
||
head.appendChild(div.childNodes[1]);
|
||
}
|
||
|
||
if ( options ) {
|
||
$.extend( settings, options );
|
||
}
|
||
|
||
return this.each(function(){
|
||
var selectors = [
|
||
"iframe[src*='player.vimeo.com']",
|
||
"iframe[src*='youtube.com']",
|
||
"iframe[src*='youtube-nocookie.com']",
|
||
"iframe[src*='kickstarter.com'][src*='video.html']",
|
||
"object",
|
||
"embed"
|
||
];
|
||
|
||
if (settings.customSelector) {
|
||
selectors.push(settings.customSelector);
|
||
}
|
||
|
||
var $allVideos = $(this).find(selectors.join(','));
|
||
$allVideos = $allVideos.not("object object"); // SwfObj conflict patch
|
||
|
||
$allVideos.each(function(){
|
||
var $this = $(this);
|
||
if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
|
||
var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
|
||
width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
|
||
aspectRatio = height / width;
|
||
if(!$this.attr('id')){
|
||
var videoID = 'fitvid' + Math.floor(Math.random()*999999);
|
||
$this.attr('id', videoID);
|
||
}
|
||
$this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
|
||
$this.removeAttr('height').removeAttr('width');
|
||
});
|
||
});
|
||
};
|
||
// Works with either jQuery or Zepto
|
||
})( window.jQuery || window.Zepto );
|
||
|
||
/*
|
||
* Foundation Responsive Library
|
||
* http://foundation.zurb.com
|
||
* Copyright 2014, ZURB
|
||
* Free to use under the MIT license.
|
||
* http://www.opensource.org/licenses/mit-license.php
|
||
*/
|
||
|
||
(function ($, window, document, undefined) {
|
||
'use strict';
|
||
|
||
var header_helpers = function (class_array) {
|
||
var i = class_array.length;
|
||
var head = $('head');
|
||
|
||
while (i--) {
|
||
if (head.has('.' + class_array[i]).length === 0) {
|
||
head.append('<meta class="' + class_array[i] + '" />');
|
||
}
|
||
}
|
||
};
|
||
|
||
header_helpers([
|
||
'foundation-mq-small',
|
||
'foundation-mq-small-only',
|
||
'foundation-mq-medium',
|
||
'foundation-mq-medium-only',
|
||
'foundation-mq-large',
|
||
'foundation-mq-large-only',
|
||
'foundation-mq-xlarge',
|
||
'foundation-mq-xlarge-only',
|
||
'foundation-mq-xxlarge',
|
||
'foundation-data-attribute-namespace']);
|
||
|
||
// Enable FastClick if present
|
||
|
||
$(function () {
|
||
if (typeof FastClick !== 'undefined') {
|
||
// Don't attach to body if undefined
|
||
if (typeof document.body !== 'undefined') {
|
||
FastClick.attach(document.body);
|
||
}
|
||
}
|
||
});
|
||
|
||
// private Fast Selector wrapper,
|
||
// returns jQuery object. Only use where
|
||
// getElementById is not available.
|
||
var S = function (selector, context) {
|
||
if (typeof selector === 'string') {
|
||
if (context) {
|
||
var cont;
|
||
if (context.jquery) {
|
||
cont = context[0];
|
||
if (!cont) {
|
||
return context;
|
||
}
|
||
} else {
|
||
cont = context;
|
||
}
|
||
return $(cont.querySelectorAll(selector));
|
||
}
|
||
|
||
return $(document.querySelectorAll(selector));
|
||
}
|
||
|
||
return $(selector, context);
|
||
};
|
||
|
||
// Namespace functions.
|
||
|
||
var attr_name = function (init) {
|
||
var arr = [];
|
||
if (!init) {
|
||
arr.push('data');
|
||
}
|
||
if (this.namespace.length > 0) {
|
||
arr.push(this.namespace);
|
||
}
|
||
arr.push(this.name);
|
||
|
||
return arr.join('-');
|
||
};
|
||
|
||
var add_namespace = function (str) {
|
||
var parts = str.split('-'),
|
||
i = parts.length,
|
||
arr = [];
|
||
|
||
while (i--) {
|
||
if (i !== 0) {
|
||
arr.push(parts[i]);
|
||
} else {
|
||
if (this.namespace.length > 0) {
|
||
arr.push(this.namespace, parts[i]);
|
||
} else {
|
||
arr.push(parts[i]);
|
||
}
|
||
}
|
||
}
|
||
|
||
return arr.reverse().join('-');
|
||
};
|
||
|
||
// Event binding and data-options updating.
|
||
|
||
var bindings = function (method, options) {
|
||
var self = this,
|
||
bind = function(){
|
||
var $this = S(this),
|
||
should_bind_events = !$this.data(self.attr_name(true) + '-init');
|
||
$this.data(self.attr_name(true) + '-init', $.extend({}, self.settings, (options || method), self.data_options($this)));
|
||
|
||
if (should_bind_events) {
|
||
self.events(this);
|
||
}
|
||
};
|
||
|
||
if (S(this.scope).is('[' + this.attr_name() +']')) {
|
||
bind.call(this.scope);
|
||
} else {
|
||
S('[' + this.attr_name() +']', this.scope).each(bind);
|
||
}
|
||
// # Patch to fix #5043 to move this *after* the if/else clause in order for Backbone and similar frameworks to have improved control over event binding and data-options updating.
|
||
if (typeof method === 'string') {
|
||
return this[method].call(this, options);
|
||
}
|
||
|
||
};
|
||
|
||
var single_image_loaded = function (image, callback) {
|
||
function loaded () {
|
||
callback(image[0]);
|
||
}
|
||
|
||
function bindLoad () {
|
||
this.one('load', loaded);
|
||
|
||
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
|
||
var src = this.attr( 'src' ),
|
||
param = src.match( /\?/ ) ? '&' : '?';
|
||
|
||
param += 'random=' + (new Date()).getTime();
|
||
this.attr('src', src + param);
|
||
}
|
||
}
|
||
|
||
if (!image.attr('src')) {
|
||
loaded();
|
||
return;
|
||
}
|
||
|
||
if (image[0].complete || image[0].readyState === 4) {
|
||
loaded();
|
||
} else {
|
||
bindLoad.call(image);
|
||
}
|
||
};
|
||
|
||
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */
|
||
|
||
window.matchMedia || (window.matchMedia = function() {
|
||
"use strict";
|
||
|
||
// For browsers that support matchMedium api such as IE 9 and webkit
|
||
var styleMedia = (window.styleMedia || window.media);
|
||
|
||
// For those that don't support matchMedium
|
||
if (!styleMedia) {
|
||
var style = document.createElement('style'),
|
||
script = document.getElementsByTagName('script')[0],
|
||
info = null;
|
||
|
||
style.type = 'text/css';
|
||
style.id = 'matchmediajs-test';
|
||
|
||
script.parentNode.insertBefore(style, script);
|
||
|
||
// 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
|
||
info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle;
|
||
|
||
styleMedia = {
|
||
matchMedium: function(media) {
|
||
var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';
|
||
|
||
// 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
|
||
if (style.styleSheet) {
|
||
style.styleSheet.cssText = text;
|
||
} else {
|
||
style.textContent = text;
|
||
}
|
||
|
||
// Test if media query is true or false
|
||
return info.width === '1px';
|
||
}
|
||
};
|
||
}
|
||
|
||
return function(media) {
|
||
return {
|
||
matches: styleMedia.matchMedium(media || 'all'),
|
||
media: media || 'all'
|
||
};
|
||
};
|
||
}());
|
||
|
||
/*
|
||
* jquery.requestAnimationFrame
|
||
* https://github.com/gnarf37/jquery-requestAnimationFrame
|
||
* Requires jQuery 1.8+
|
||
*
|
||
* Copyright (c) 2012 Corey Frang
|
||
* Licensed under the MIT license.
|
||
*/
|
||
|
||
(function(jQuery) {
|
||
|
||
|
||
// requestAnimationFrame polyfill adapted from Erik Möller
|
||
// fixes from Paul Irish and Tino Zijdel
|
||
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
|
||
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
|
||
|
||
var animating,
|
||
lastTime = 0,
|
||
vendors = ['webkit', 'moz'],
|
||
requestAnimationFrame = window.requestAnimationFrame,
|
||
cancelAnimationFrame = window.cancelAnimationFrame,
|
||
jqueryFxAvailable = 'undefined' !== typeof jQuery.fx;
|
||
|
||
for (; lastTime < vendors.length && !requestAnimationFrame; lastTime++) {
|
||
requestAnimationFrame = window[ vendors[lastTime] + 'RequestAnimationFrame' ];
|
||
cancelAnimationFrame = cancelAnimationFrame ||
|
||
window[ vendors[lastTime] + 'CancelAnimationFrame' ] ||
|
||
window[ vendors[lastTime] + 'CancelRequestAnimationFrame' ];
|
||
}
|
||
|
||
function raf() {
|
||
if (animating) {
|
||
requestAnimationFrame(raf);
|
||
|
||
if (jqueryFxAvailable) {
|
||
jQuery.fx.tick();
|
||
}
|
||
}
|
||
}
|
||
|
||
if (requestAnimationFrame) {
|
||
// use rAF
|
||
window.requestAnimationFrame = requestAnimationFrame;
|
||
window.cancelAnimationFrame = cancelAnimationFrame;
|
||
|
||
if (jqueryFxAvailable) {
|
||
jQuery.fx.timer = function (timer) {
|
||
if (timer() && jQuery.timers.push(timer) && !animating) {
|
||
animating = true;
|
||
raf();
|
||
}
|
||
};
|
||
|
||
jQuery.fx.stop = function () {
|
||
animating = false;
|
||
};
|
||
}
|
||
} else {
|
||
// polyfill
|
||
window.requestAnimationFrame = function (callback) {
|
||
var currTime = new Date().getTime(),
|
||
timeToCall = Math.max(0, 16 - (currTime - lastTime)),
|
||
id = window.setTimeout(function () {
|
||
callback(currTime + timeToCall);
|
||
}, timeToCall);
|
||
lastTime = currTime + timeToCall;
|
||
return id;
|
||
};
|
||
|
||
window.cancelAnimationFrame = function (id) {
|
||
clearTimeout(id);
|
||
};
|
||
|
||
}
|
||
|
||
}( $ ));
|
||
|
||
function removeQuotes (string) {
|
||
if (typeof string === 'string' || string instanceof String) {
|
||
string = string.replace(/^['\\/"]+|(;\s?})+|['\\/"]+$/g, '');
|
||
}
|
||
|
||
return string;
|
||
}
|
||
|
||
window.Foundation = {
|
||
name : 'Foundation',
|
||
|
||
version : '5.5.2',
|
||
|
||
media_queries : {
|
||
'small' : S('.foundation-mq-small').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
||
'small-only' : S('.foundation-mq-small-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
||
'medium' : S('.foundation-mq-medium').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
||
'medium-only' : S('.foundation-mq-medium-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
||
'large' : S('.foundation-mq-large').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
||
'large-only' : S('.foundation-mq-large-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
||
'xlarge' : S('.foundation-mq-xlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
||
'xlarge-only' : S('.foundation-mq-xlarge-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
||
'xxlarge' : S('.foundation-mq-xxlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, '')
|
||
},
|
||
|
||
stylesheet : $('<style></style>').appendTo('head')[0].sheet,
|
||
|
||
global : {
|
||
namespace : undefined
|
||
},
|
||
|
||
init : function (scope, libraries, method, options, response) {
|
||
var args = [scope, method, options, response],
|
||
responses = [];
|
||
|
||
// check RTL
|
||
this.rtl = /rtl/i.test(S('html').attr('dir'));
|
||
|
||
// set foundation global scope
|
||
this.scope = scope || this.scope;
|
||
|
||
this.set_namespace();
|
||
|
||
if (libraries && typeof libraries === 'string' && !/reflow/i.test(libraries)) {
|
||
if (this.libs.hasOwnProperty(libraries)) {
|
||
responses.push(this.init_lib(libraries, args));
|
||
}
|
||
} else {
|
||
for (var lib in this.libs) {
|
||
responses.push(this.init_lib(lib, libraries));
|
||
}
|
||
}
|
||
|
||
S(window).load(function () {
|
||
S(window)
|
||
.trigger('resize.fndtn.clearing')
|
||
.trigger('resize.fndtn.dropdown')
|
||
.trigger('resize.fndtn.equalizer')
|
||
.trigger('resize.fndtn.interchange')
|
||
.trigger('resize.fndtn.joyride')
|
||
.trigger('resize.fndtn.magellan')
|
||
.trigger('resize.fndtn.topbar')
|
||
.trigger('resize.fndtn.slider');
|
||
});
|
||
|
||
return scope;
|
||
},
|
||
|
||
init_lib : function (lib, args) {
|
||
if (this.libs.hasOwnProperty(lib)) {
|
||
this.patch(this.libs[lib]);
|
||
|
||
if (args && args.hasOwnProperty(lib)) {
|
||
if (typeof this.libs[lib].settings !== 'undefined') {
|
||
$.extend(true, this.libs[lib].settings, args[lib]);
|
||
} else if (typeof this.libs[lib].defaults !== 'undefined') {
|
||
$.extend(true, this.libs[lib].defaults, args[lib]);
|
||
}
|
||
return this.libs[lib].init.apply(this.libs[lib], [this.scope, args[lib]]);
|
||
}
|
||
|
||
args = args instanceof Array ? args : new Array(args);
|
||
return this.libs[lib].init.apply(this.libs[lib], args);
|
||
}
|
||
|
||
return function () {};
|
||
},
|
||
|
||
patch : function (lib) {
|
||
lib.scope = this.scope;
|
||
lib.namespace = this.global.namespace;
|
||
lib.rtl = this.rtl;
|
||
lib['data_options'] = this.utils.data_options;
|
||
lib['attr_name'] = attr_name;
|
||
lib['add_namespace'] = add_namespace;
|
||
lib['bindings'] = bindings;
|
||
lib['S'] = this.utils.S;
|
||
},
|
||
|
||
inherit : function (scope, methods) {
|
||
var methods_arr = methods.split(' '),
|
||
i = methods_arr.length;
|
||
|
||
while (i--) {
|
||
if (this.utils.hasOwnProperty(methods_arr[i])) {
|
||
scope[methods_arr[i]] = this.utils[methods_arr[i]];
|
||
}
|
||
}
|
||
},
|
||
|
||
set_namespace : function () {
|
||
|
||
// Description:
|
||
// Don't bother reading the namespace out of the meta tag
|
||
// if the namespace has been set globally in javascript
|
||
//
|
||
// Example:
|
||
// Foundation.global.namespace = 'my-namespace';
|
||
// or make it an empty string:
|
||
// Foundation.global.namespace = '';
|
||
//
|
||
//
|
||
|
||
// If the namespace has not been set (is undefined), try to read it out of the meta element.
|
||
// Otherwise use the globally defined namespace, even if it's empty ('')
|
||
var namespace = ( this.global.namespace === undefined ) ? $('.foundation-data-attribute-namespace').css('font-family') : this.global.namespace;
|
||
|
||
// Finally, if the namsepace is either undefined or false, set it to an empty string.
|
||
// Otherwise use the namespace value.
|
||
this.global.namespace = ( namespace === undefined || /false/i.test(namespace) ) ? '' : namespace;
|
||
},
|
||
|
||
libs : {},
|
||
|
||
// methods that can be inherited in libraries
|
||
utils : {
|
||
|
||
// Description:
|
||
// Fast Selector wrapper returns jQuery object. Only use where getElementById
|
||
// is not available.
|
||
//
|
||
// Arguments:
|
||
// Selector (String): CSS selector describing the element(s) to be
|
||
// returned as a jQuery object.
|
||
//
|
||
// Scope (String): CSS selector describing the area to be searched. Default
|
||
// is document.
|
||
//
|
||
// Returns:
|
||
// Element (jQuery Object): jQuery object containing elements matching the
|
||
// selector within the scope.
|
||
S : S,
|
||
|
||
// Description:
|
||
// Executes a function a max of once every n milliseconds
|
||
//
|
||
// Arguments:
|
||
// Func (Function): Function to be throttled.
|
||
//
|
||
// Delay (Integer): Function execution threshold in milliseconds.
|
||
//
|
||
// Returns:
|
||
// Lazy_function (Function): Function with throttling applied.
|
||
throttle : function (func, delay) {
|
||
var timer = null;
|
||
|
||
return function () {
|
||
var context = this, args = arguments;
|
||
|
||
if (timer == null) {
|
||
timer = setTimeout(function () {
|
||
func.apply(context, args);
|
||
timer = null;
|
||
}, delay);
|
||
}
|
||
};
|
||
},
|
||
|
||
// Description:
|
||
// Executes a function when it stops being invoked for n seconds
|
||
// Modified version of _.debounce() http://underscorejs.org
|
||
//
|
||
// Arguments:
|
||
// Func (Function): Function to be debounced.
|
||
//
|
||
// Delay (Integer): Function execution threshold in milliseconds.
|
||
//
|
||
// Immediate (Bool): Whether the function should be called at the beginning
|
||
// of the delay instead of the end. Default is false.
|
||
//
|
||
// Returns:
|
||
// Lazy_function (Function): Function with debouncing applied.
|
||
debounce : function (func, delay, immediate) {
|
||
var timeout, result;
|
||
return function () {
|
||
var context = this, args = arguments;
|
||
var later = function () {
|
||
timeout = null;
|
||
if (!immediate) {
|
||
result = func.apply(context, args);
|
||
}
|
||
};
|
||
var callNow = immediate && !timeout;
|
||
clearTimeout(timeout);
|
||
timeout = setTimeout(later, delay);
|
||
if (callNow) {
|
||
result = func.apply(context, args);
|
||
}
|
||
return result;
|
||
};
|
||
},
|
||
|
||
// Description:
|
||
// Parses data-options attribute
|
||
//
|
||
// Arguments:
|
||
// El (jQuery Object): Element to be parsed.
|
||
//
|
||
// Returns:
|
||
// Options (Javascript Object): Contents of the element's data-options
|
||
// attribute.
|
||
data_options : function (el, data_attr_name) {
|
||
data_attr_name = data_attr_name || 'options';
|
||
var opts = {}, ii, p, opts_arr,
|
||
data_options = function (el) {
|
||
var namespace = Foundation.global.namespace;
|
||
|
||
if (namespace.length > 0) {
|
||
return el.data(namespace + '-' + data_attr_name);
|
||
}
|
||
|
||
return el.data(data_attr_name);
|
||
};
|
||
|
||
var cached_options = data_options(el);
|
||
|
||
if (typeof cached_options === 'object') {
|
||
return cached_options;
|
||
}
|
||
|
||
opts_arr = (cached_options || ':').split(';');
|
||
ii = opts_arr.length;
|
||
|
||
function isNumber (o) {
|
||
return !isNaN (o - 0) && o !== null && o !== '' && o !== false && o !== true;
|
||
}
|
||
|
||
function trim (str) {
|
||
if (typeof str === 'string') {
|
||
return $.trim(str);
|
||
}
|
||
return str;
|
||
}
|
||
|
||
while (ii--) {
|
||
p = opts_arr[ii].split(':');
|
||
p = [p[0], p.slice(1).join(':')];
|
||
|
||
if (/true/i.test(p[1])) {
|
||
p[1] = true;
|
||
}
|
||
if (/false/i.test(p[1])) {
|
||
p[1] = false;
|
||
}
|
||
if (isNumber(p[1])) {
|
||
if (p[1].indexOf('.') === -1) {
|
||
p[1] = parseInt(p[1], 10);
|
||
} else {
|
||
p[1] = parseFloat(p[1]);
|
||
}
|
||
}
|
||
|
||
if (p.length === 2 && p[0].length > 0) {
|
||
opts[trim(p[0])] = trim(p[1]);
|
||
}
|
||
}
|
||
|
||
return opts;
|
||
},
|
||
|
||
// Description:
|
||
// Adds JS-recognizable media queries
|
||
//
|
||
// Arguments:
|
||
// Media (String): Key string for the media query to be stored as in
|
||
// Foundation.media_queries
|
||
//
|
||
// Class (String): Class name for the generated <meta> tag
|
||
register_media : function (media, media_class) {
|
||
if (Foundation.media_queries[media] === undefined) {
|
||
$('head').append('<meta class="' + media_class + '"/>');
|
||
Foundation.media_queries[media] = removeQuotes($('.' + media_class).css('font-family'));
|
||
}
|
||
},
|
||
|
||
// Description:
|
||
// Add custom CSS within a JS-defined media query
|
||
//
|
||
// Arguments:
|
||
// Rule (String): CSS rule to be appended to the document.
|
||
//
|
||
// Media (String): Optional media query string for the CSS rule to be
|
||
// nested under.
|
||
add_custom_rule : function (rule, media) {
|
||
if (media === undefined && Foundation.stylesheet) {
|
||
Foundation.stylesheet.insertRule(rule, Foundation.stylesheet.cssRules.length);
|
||
} else {
|
||
var query = Foundation.media_queries[media];
|
||
|
||
if (query !== undefined) {
|
||
Foundation.stylesheet.insertRule('@media ' +
|
||
Foundation.media_queries[media] + '{ ' + rule + ' }', Foundation.stylesheet.cssRules.length);
|
||
}
|
||
}
|
||
},
|
||
|
||
// Description:
|
||
// Performs a callback function when an image is fully loaded
|
||
//
|
||
// Arguments:
|
||
// Image (jQuery Object): Image(s) to check if loaded.
|
||
//
|
||
// Callback (Function): Function to execute when image is fully loaded.
|
||
image_loaded : function (images, callback) {
|
||
var self = this,
|
||
unloaded = images.length;
|
||
|
||
function pictures_has_height(images) {
|
||
var pictures_number = images.length;
|
||
|
||
for (var i = pictures_number - 1; i >= 0; i--) {
|
||
if(images.attr('height') === undefined) {
|
||
return false;
|
||
};
|
||
};
|
||
|
||
return true;
|
||
}
|
||
|
||
if (unloaded === 0 || pictures_has_height(images)) {
|
||
callback(images);
|
||
}
|
||
|
||
images.each(function () {
|
||
single_image_loaded(self.S(this), function () {
|
||
unloaded -= 1;
|
||
if (unloaded === 0) {
|
||
callback(images);
|
||
}
|
||
});
|
||
});
|
||
},
|
||
|
||
// Description:
|
||
// Returns a random, alphanumeric string
|
||
//
|
||
// Arguments:
|
||
// Length (Integer): Length of string to be generated. Defaults to random
|
||
// integer.
|
||
//
|
||
// Returns:
|
||
// Rand (String): Pseudo-random, alphanumeric string.
|
||
random_str : function () {
|
||
if (!this.fidx) {
|
||
this.fidx = 0;
|
||
}
|
||
this.prefix = this.prefix || [(this.name || 'F'), (+new Date).toString(36)].join('-');
|
||
|
||
return this.prefix + (this.fidx++).toString(36);
|
||
},
|
||
|
||
// Description:
|
||
// Helper for window.matchMedia
|
||
//
|
||
// Arguments:
|
||
// mq (String): Media query
|
||
//
|
||
// Returns:
|
||
// (Boolean): Whether the media query passes or not
|
||
match : function (mq) {
|
||
return window.matchMedia(mq).matches;
|
||
},
|
||
|
||
// Description:
|
||
// Helpers for checking Foundation default media queries with JS
|
||
//
|
||
// Returns:
|
||
// (Boolean): Whether the media query passes or not
|
||
|
||
is_small_up : function () {
|
||
return this.match(Foundation.media_queries.small);
|
||
},
|
||
|
||
is_medium_up : function () {
|
||
return this.match(Foundation.media_queries.medium);
|
||
},
|
||
|
||
is_large_up : function () {
|
||
return this.match(Foundation.media_queries.large);
|
||
},
|
||
|
||
is_xlarge_up : function () {
|
||
return this.match(Foundation.media_queries.xlarge);
|
||
},
|
||
|
||
is_xxlarge_up : function () {
|
||
return this.match(Foundation.media_queries.xxlarge);
|
||
},
|
||
|
||
is_small_only : function () {
|
||
return !this.is_medium_up() && !this.is_large_up() && !this.is_xlarge_up() && !this.is_xxlarge_up();
|
||
},
|
||
|
||
is_medium_only : function () {
|
||
return this.is_medium_up() && !this.is_large_up() && !this.is_xlarge_up() && !this.is_xxlarge_up();
|
||
},
|
||
|
||
is_large_only : function () {
|
||
return this.is_medium_up() && this.is_large_up() && !this.is_xlarge_up() && !this.is_xxlarge_up();
|
||
},
|
||
|
||
is_xlarge_only : function () {
|
||
return this.is_medium_up() && this.is_large_up() && this.is_xlarge_up() && !this.is_xxlarge_up();
|
||
},
|
||
|
||
is_xxlarge_only : function () {
|
||
return this.is_medium_up() && this.is_large_up() && this.is_xlarge_up() && this.is_xxlarge_up();
|
||
}
|
||
}
|
||
};
|
||
|
||
$.fn.foundation = function () {
|
||
var args = Array.prototype.slice.call(arguments, 0);
|
||
|
||
return this.each(function () {
|
||
Foundation.init.apply(Foundation, [this].concat(args));
|
||
return this;
|
||
});
|
||
};
|
||
|
||
}(jQuery, window, window.document));
|
||
|
||
;(function ($, window, document, undefined) {
|
||
'use strict';
|
||
|
||
Foundation.libs.accordion = {
|
||
name : 'accordion',
|
||
|
||
version : '5.5.2',
|
||
|
||
settings : {
|
||
content_class : 'content',
|
||
active_class : 'active',
|
||
multi_expand : false,
|
||
toggleable : true,
|
||
callback : function () {}
|
||
},
|
||
|
||
init : function (scope, method, options) {
|
||
this.bindings(method, options);
|
||
},
|
||
|
||
events : function (instance) {
|
||
var self = this;
|
||
var S = this.S;
|
||
self.create(this.S(instance));
|
||
|
||
S(this.scope)
|
||
.off('.fndtn.accordion')
|
||
.on('click.fndtn.accordion', '[' + this.attr_name() + '] > dd > a, [' + this.attr_name() + '] > li > a', function (e) {
|
||
var accordion = S(this).closest('[' + self.attr_name() + ']'),
|
||
groupSelector = self.attr_name() + '=' + accordion.attr(self.attr_name()),
|
||
settings = accordion.data(self.attr_name(true) + '-init') || self.settings,
|
||
target = S('#' + this.href.split('#')[1]),
|
||
aunts = $('> dd, > li', accordion),
|
||
siblings = aunts.children('.' + settings.content_class),
|
||
active_content = siblings.filter('.' + settings.active_class);
|
||
|
||
e.preventDefault();
|
||
|
||
if (accordion.attr(self.attr_name())) {
|
||
siblings = siblings.add('[' + groupSelector + '] dd > ' + '.' + settings.content_class + ', [' + groupSelector + '] li > ' + '.' + settings.content_class);
|
||
aunts = aunts.add('[' + groupSelector + '] dd, [' + groupSelector + '] li');
|
||
}
|
||
|
||
if (settings.toggleable && target.is(active_content)) {
|
||
target.parent('dd, li').toggleClass(settings.active_class, false);
|
||
target.toggleClass(settings.active_class, false);
|
||
S(this).attr('aria-expanded', function(i, attr){
|
||
return attr === 'true' ? 'false' : 'true';
|
||
});
|
||
settings.callback(target);
|
||
target.triggerHandler('toggled', [accordion]);
|
||
accordion.triggerHandler('toggled', [target]);
|
||
return;
|
||
}
|
||
|
||
if (!settings.multi_expand) {
|
||
siblings.removeClass(settings.active_class);
|
||
aunts.removeClass(settings.active_class);
|
||
aunts.children('a').attr('aria-expanded','false');
|
||
}
|
||
|
||
target.addClass(settings.active_class).parent().addClass(settings.active_class);
|
||
settings.callback(target);
|
||
target.triggerHandler('toggled', [accordion]);
|
||
accordion.triggerHandler('toggled', [target]);
|
||
S(this).attr('aria-expanded','true');
|
||
});
|
||
},
|
||
|
||
create: function($instance) {
|
||
var self = this,
|
||
accordion = $instance,
|
||
aunts = $('> .accordion-navigation', accordion),
|
||
settings = accordion.data(self.attr_name(true) + '-init') || self.settings;
|
||
|
||
aunts.children('a').attr('aria-expanded','false');
|
||
aunts.has('.' + settings.content_class + '.' + settings.active_class).children('a').attr('aria-expanded','true');
|
||
|
||
if (settings.multi_expand) {
|
||
$instance.attr('aria-multiselectable','true');
|
||
}
|
||
},
|
||
|
||
off : function () {},
|
||
|
||
reflow : function () {}
|
||
};
|
||
}(jQuery, window, window.document));
|
||
|
||
;(function ($, window, document, undefined) {
|
||
'use strict';
|
||
|
||
Foundation.libs.dropdown = {
|
||
name : 'dropdown',
|
||
|
||
version : '5.4.7',
|
||
|
||
settings : {
|
||
active_class: 'open',
|
||
disabled_class: 'disabled',
|
||
mega_class: 'mega',
|
||
align: 'bottom',
|
||
is_hover: false,
|
||
opened: function(){},
|
||
closed: function(){}
|
||
},
|
||
|
||
init : function (scope, method, options) {
|
||
Foundation.inherit(this, 'throttle');
|
||
|
||
this.bindings(method, options);
|
||
},
|
||
|
||
events : function (scope) {
|
||
var self = this,
|
||
S = self.S;
|
||
|
||
S(this.scope)
|
||
.off('.dropdown')
|
||
.on('click.fndtn.dropdown', '[' + this.attr_name() + ']', function (e) {
|
||
var settings = S(this).data(self.attr_name(true) + '-init') || self.settings;
|
||
if (!settings.is_hover || Modernizr.touch) {
|
||
e.preventDefault();
|
||
self.toggle($(this));
|
||
}
|
||
})
|
||
.on('mouseenter.fndtn.dropdown', '[' + this.attr_name() + '], [' + this.attr_name() + '-content]', function (e) {
|
||
var $this = S(this),
|
||
dropdown,
|
||
target;
|
||
|
||
clearTimeout(self.timeout);
|
||
|
||
if ($this.data(self.data_attr())) {
|
||
dropdown = S('#' + $this.data(self.data_attr()));
|
||
target = $this;
|
||
} else {
|
||
dropdown = $this;
|
||
target = S("[" + self.attr_name() + "='" + dropdown.attr('id') + "']");
|
||
}
|
||
|
||
var settings = target.data(self.attr_name(true) + '-init') || self.settings;
|
||
|
||
if(S(e.target).data(self.data_attr()) && settings.is_hover) {
|
||
self.closeall.call(self);
|
||
}
|
||
|
||
if (settings.is_hover) self.open.apply(self, [dropdown, target]);
|
||
})
|
||
.on('mouseleave.fndtn.dropdown', '[' + this.attr_name() + '], [' + this.attr_name() + '-content]', function (e) {
|
||
var $this = S(this);
|
||
self.timeout = setTimeout(function () {
|
||
if ($this.data(self.data_attr())) {
|
||
var settings = $this.data(self.data_attr(true) + '-init') || self.settings;
|
||
if (settings.is_hover) self.close.call(self, S('#' + $this.data(self.data_attr())));
|
||
} else {
|
||
var target = S('[' + self.attr_name() + '="' + S(this).attr('id') + '"]'),
|
||
settings = target.data(self.attr_name(true) + '-init') || self.settings;
|
||
if (settings.is_hover) self.close.call(self, $this);
|
||
}
|
||
}.bind(this), 150);
|
||
})
|
||
.on('click.fndtn.dropdown', function (e) {
|
||
var parent = S(e.target).closest('[' + self.attr_name() + '-content]');
|
||
|
||
if (S(e.target).closest('[' + self.attr_name() + ']').length > 0) {
|
||
return;
|
||
}
|
||
if (!(S(e.target).data('revealId')) &&
|
||
(parent.length > 0 && (S(e.target).is('[' + self.attr_name() + '-content]') ||
|
||
$.contains(parent.first()[0], e.target)))) {
|
||
e.stopPropagation();
|
||
return;
|
||
}
|
||
|
||
self.close.call(self, S('[' + self.attr_name() + '-content]'));
|
||
})
|
||
.on('opened.fndtn.dropdown', '[' + self.attr_name() + '-content]', function () {
|
||
self.settings.opened.call(this);
|
||
})
|
||
.on('closed.fndtn.dropdown', '[' + self.attr_name() + '-content]', function () {
|
||
self.settings.closed.call(this);
|
||
});
|
||
|
||
S(window)
|
||
.off('.dropdown')
|
||
.on('resize.fndtn.dropdown', self.throttle(function () {
|
||
self.resize.call(self);
|
||
}, 50));
|
||
|
||
this.resize();
|
||
},
|
||
|
||
close: function (dropdown) {
|
||
var self = this;
|
||
dropdown.each(function (idx) {
|
||
var original_target = $('[' + self.attr_name() + '=' + dropdown[idx].id + ']') || $('aria-controls=' + dropdown[idx].id+ ']');
|
||
original_target.attr('aria-expanded', "false");
|
||
if (self.S(this).hasClass(self.settings.active_class)) {
|
||
self.S(this)
|
||
.css(Foundation.rtl ? 'right':'left', '-99999px')
|
||
.css(Foundation.rtl ? 'left':'right', 'auto')
|
||
.attr('aria-hidden', "true")
|
||
.removeClass(self.settings.active_class)
|
||
.prev('[' + self.attr_name() + ']')
|
||
.removeClass(self.settings.active_class)
|
||
.removeData('target');
|
||
|
||
self.S(this).trigger('closed').trigger('closed.fndtn.dropdown', [dropdown]);
|
||
}
|
||
});
|
||
},
|
||
|
||
closeall: function() {
|
||
var self = this;
|
||
$.each(self.S('[' + this.attr_name() + '-content]'), function() {
|
||
self.close.call(self, self.S(this));
|
||
});
|
||
},
|
||
|
||
open: function (dropdown, target) {
|
||
this
|
||
.css(dropdown
|
||
.addClass(this.settings.active_class), target);
|
||
dropdown.prev('[' + this.attr_name() + ']').addClass(this.settings.active_class);
|
||
dropdown.data('target', target.get(0)).trigger('opened').trigger('opened.fndtn.dropdown', [dropdown, target]);
|
||
dropdown.attr('aria-hidden', 'false');
|
||
target.attr('aria-expanded', 'true');
|
||
dropdown.focus();
|
||
},
|
||
|
||
data_attr: function () {
|
||
if (this.namespace.length > 0) {
|
||
return this.namespace + '-' + this.name;
|
||
}
|
||
|
||
return this.name;
|
||
},
|
||
|
||
toggle : function (target) {
|
||
if (target.hasClass(this.settings.disabled_class)) {
|
||
return;
|
||
}
|
||
var dropdown = this.S('#' + target.data(this.data_attr()));
|
||
if (dropdown.length === 0) {
|
||
// No dropdown found, not continuing
|
||
return;
|
||
}
|
||
|
||
this.close.call(this, this.S('[' + this.attr_name() + '-content]').not(dropdown));
|
||
|
||
if (dropdown.hasClass(this.settings.active_class)) {
|
||
this.close.call(this, dropdown);
|
||
if (dropdown.data('target') !== target.get(0))
|
||
this.open.call(this, dropdown, target);
|
||
} else {
|
||
this.open.call(this, dropdown, target);
|
||
}
|
||
},
|
||
|
||
resize : function () {
|
||
var dropdown = this.S('[' + this.attr_name() + '-content].open'),
|
||
target = this.S("[" + this.attr_name() + "='" + dropdown.attr('id') + "']");
|
||
|
||
if (dropdown.length && target.length) {
|
||
this.css(dropdown, target);
|
||
}
|
||
},
|
||
|
||
css : function (dropdown, target) {
|
||
var left_offset = Math.max((target.width() - dropdown.width()) / 2, 8),
|
||
settings = target.data(this.attr_name(true) + '-init') || this.settings;
|
||
|
||
this.clear_idx();
|
||
|
||
if (this.small()) {
|
||
var p = this.dirs.bottom.call(dropdown, target, settings);
|
||
dropdown.attr('style', '').removeClass('drop-left drop-right drop-top').css({
|
||
position: 'absolute',
|
||
left: target.offset().left,
|
||
'max-width': 'none',
|
||
top: p.top
|
||
});
|
||
o.left = target.offset().left;
|
||
dropdown.css(Foundation.rtl ? 'right':'left', left_offset);
|
||
} else {
|
||
|
||
this.style(dropdown, target, settings);
|
||
}
|
||
|
||
return dropdown;
|
||
},
|
||
|
||
style : function (dropdown, target, settings) {
|
||
var css = $.extend({position: 'absolute'},
|
||
this.dirs[settings.align].call(dropdown, target, settings));
|
||
|
||
dropdown.attr('style', '').css(css);
|
||
},
|
||
|
||
// return CSS property object
|
||
// `this` is the dropdown
|
||
dirs : {
|
||
// Calculate target offset
|
||
_base : function (t) {
|
||
var o_p = this.offsetParent(),
|
||
o = o_p.offset(),
|
||
p = t.offset();
|
||
|
||
p.top -= o.top;
|
||
p.left -= o.left;
|
||
|
||
return p;
|
||
},
|
||
top: function (t, s) {
|
||
var self = Foundation.libs.dropdown,
|
||
p = self.dirs._base.call(this, t);
|
||
|
||
this.addClass('drop-top');
|
||
|
||
if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) {
|
||
self.adjust_pip(this,t,s,p);
|
||
}
|
||
|
||
if (Foundation.rtl) {
|
||
return {left: p.left - this.outerWidth() + t.outerWidth(),
|
||
top: p.top - this.outerHeight()};
|
||
}
|
||
|
||
return {left: p.left, top: p.top - this.outerHeight()};
|
||
},
|
||
bottom: function (t,s) {
|
||
var self = Foundation.libs.dropdown,
|
||
p = self.dirs._base.call(this, t);
|
||
|
||
if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) {
|
||
self.adjust_pip(this,t,s,p);
|
||
}
|
||
|
||
if (self.rtl) {
|
||
return {left: p.left - this.outerWidth() + t.outerWidth(), top: p.top + t.outerHeight()};
|
||
}
|
||
|
||
return {left: p.left, top: p.top + t.outerHeight()};
|
||
},
|
||
left: function (t, s) {
|
||
var p = Foundation.libs.dropdown.dirs._base.call(this, t);
|
||
|
||
this.addClass('drop-left');
|
||
|
||
return {left: p.left - this.outerWidth(), top: p.top};
|
||
},
|
||
right: function (t, s) {
|
||
var p = Foundation.libs.dropdown.dirs._base.call(this, t);
|
||
|
||
this.addClass('drop-right');
|
||
|
||
return {left: p.left + t.outerWidth(), top: p.top};
|
||
}
|
||
},
|
||
|
||
// Insert rule to style psuedo elements
|
||
adjust_pip : function (dropdown,target,settings,position) {
|
||
var sheet = Foundation.stylesheet,
|
||
pip_offset_base = 8;
|
||
|
||
if (dropdown.hasClass(settings.mega_class)) {
|
||
pip_offset_base = position.left + (target.outerWidth()/2) - 8;
|
||
}
|
||
else if (this.small()) {
|
||
pip_offset_base += position.left - 8;
|
||
}
|
||
|
||
this.rule_idx = sheet.cssRules.length;
|
||
|
||
var sel_before = '.f-dropdown.open:before',
|
||
sel_after = '.f-dropdown.open:after',
|
||
css_before = 'left: ' + pip_offset_base + 'px;',
|
||
css_after = 'left: ' + (pip_offset_base - 1) + 'px;';
|
||
|
||
if (sheet.insertRule) {
|
||
sheet.insertRule([sel_before, '{', css_before, '}'].join(' '), this.rule_idx);
|
||
sheet.insertRule([sel_after, '{', css_after, '}'].join(' '), this.rule_idx + 1);
|
||
} else {
|
||
sheet.addRule(sel_before, css_before, this.rule_idx);
|
||
sheet.addRule(sel_after, css_after, this.rule_idx + 1);
|
||
}
|
||
},
|
||
|
||
// Remove old dropdown rule index
|
||
clear_idx : function () {
|
||
var sheet = Foundation.stylesheet;
|
||
|
||
if (typeof this.rule_idx !== 'undefined') {
|
||
sheet.deleteRule(this.rule_idx);
|
||
sheet.deleteRule(this.rule_idx);
|
||
delete this.rule_idx;
|
||
}
|
||
},
|
||
|
||
small : function () {
|
||
return matchMedia(Foundation.media_queries.small).matches &&
|
||
!matchMedia(Foundation.media_queries.medium).matches;
|
||
},
|
||
|
||
off: function () {
|
||
this.S(this.scope).off('.fndtn.dropdown');
|
||
this.S('html, body').off('.fndtn.dropdown');
|
||
this.S(window).off('.fndtn.dropdown');
|
||
this.S('[data-dropdown-content]').off('.fndtn.dropdown');
|
||
},
|
||
|
||
reflow : function () {}
|
||
};
|
||
}(jQuery, window, window.document));
|
||
|
||
;(function ($, window, document, undefined) {
|
||
'use strict';
|
||
|
||
Foundation.libs.equalizer = {
|
||
name : 'equalizer',
|
||
|
||
version : '5.5.2',
|
||
|
||
settings : {
|
||
use_tallest : true,
|
||
before_height_change : $.noop,
|
||
after_height_change : $.noop,
|
||
equalize_on_stack : false,
|
||
act_on_hidden_el: false
|
||
},
|
||
|
||
init : function (scope, method, options) {
|
||
Foundation.inherit(this, 'image_loaded');
|
||
this.bindings(method, options);
|
||
this.reflow();
|
||
},
|
||
|
||
events : function () {
|
||
this.S(window).off('.equalizer').on('resize.fndtn.equalizer', function (e) {
|
||
this.reflow();
|
||
}.bind(this));
|
||
},
|
||
|
||
equalize : function (equalizer) {
|
||
var isStacked = false,
|
||
group = equalizer.data('equalizer'),
|
||
settings = equalizer.data(this.attr_name(true)+'-init') || this.settings,
|
||
vals,
|
||
firstTopOffset;
|
||
|
||
if (settings.act_on_hidden_el) {
|
||
vals = group ? equalizer.find('['+this.attr_name()+'-watch="'+group+'"]') : equalizer.find('['+this.attr_name()+'-watch]');
|
||
}
|
||
else {
|
||
vals = group ? equalizer.find('['+this.attr_name()+'-watch="'+group+'"]:visible') : equalizer.find('['+this.attr_name()+'-watch]:visible');
|
||
}
|
||
|
||
if (vals.length === 0) {
|
||
return;
|
||
}
|
||
|
||
settings.before_height_change();
|
||
equalizer.trigger('before-height-change.fndth.equalizer');
|
||
vals.height('inherit');
|
||
|
||
if (settings.equalize_on_stack === false) {
|
||
firstTopOffset = vals.first().offset().top;
|
||
vals.each(function () {
|
||
if ($(this).offset().top !== firstTopOffset) {
|
||
isStacked = true;
|
||
return false;
|
||
}
|
||
});
|
||
if (isStacked) {
|
||
return;
|
||
}
|
||
}
|
||
|
||
var heights = vals.map(function () { return $(this).outerHeight(false) }).get();
|
||
|
||
if (settings.use_tallest) {
|
||
var max = Math.max.apply(null, heights);
|
||
vals.css('height', max);
|
||
} else {
|
||
var min = Math.min.apply(null, heights);
|
||
vals.css('height', min);
|
||
}
|
||
|
||
settings.after_height_change();
|
||
equalizer.trigger('after-height-change.fndtn.equalizer');
|
||
},
|
||
|
||
reflow : function () {
|
||
var self = this;
|
||
|
||
this.S('[' + this.attr_name() + ']', this.scope).each(function () {
|
||
var $eq_target = $(this),
|
||
media_query = $eq_target.data('equalizer-mq'),
|
||
ignore_media_query = true;
|
||
|
||
if (media_query) {
|
||
media_query = 'is_' + media_query.replace(/-/g, '_');
|
||
if (Foundation.utils.hasOwnProperty(media_query)) {
|
||
ignore_media_query = false;
|
||
}
|
||
}
|
||
|
||
self.image_loaded(self.S('img', this), function () {
|
||
if (ignore_media_query || Foundation.utils[media_query]()) {
|
||
self.equalize($eq_target)
|
||
} else {
|
||
var vals = $eq_target.find('[' + self.attr_name() + '-watch]:visible');
|
||
vals.css('height', 'auto');
|
||
}
|
||
});
|
||
});
|
||
}
|
||
};
|
||
})(jQuery, window, window.document);
|
||
|
||
;(function ($, window, document, undefined) {
|
||
'use strict';
|
||
|
||
Foundation.libs.interchange = {
|
||
name : 'interchange',
|
||
|
||
version : '5.5.2',
|
||
|
||
cache : {},
|
||
|
||
images_loaded : false,
|
||
nodes_loaded : false,
|
||
|
||
settings : {
|
||
load_attr : 'interchange',
|
||
|
||
named_queries : {
|
||
'default' : 'only screen',
|
||
'small' : Foundation.media_queries['small'],
|
||
'small-only' : Foundation.media_queries['small-only'],
|
||
'medium' : Foundation.media_queries['medium'],
|
||
'medium-only' : Foundation.media_queries['medium-only'],
|
||
'large' : Foundation.media_queries['large'],
|
||
'large-only' : Foundation.media_queries['large-only'],
|
||
'xlarge' : Foundation.media_queries['xlarge'],
|
||
'xlarge-only' : Foundation.media_queries['xlarge-only'],
|
||
'xxlarge' : Foundation.media_queries['xxlarge'],
|
||
'landscape' : 'only screen and (orientation: landscape)',
|
||
'portrait' : 'only screen and (orientation: portrait)',
|
||
'retina' : 'only screen and (-webkit-min-device-pixel-ratio: 2),' +
|
||
'only screen and (min--moz-device-pixel-ratio: 2),' +
|
||
'only screen and (-o-min-device-pixel-ratio: 2/1),' +
|
||
'only screen and (min-device-pixel-ratio: 2),' +
|
||
'only screen and (min-resolution: 192dpi),' +
|
||
'only screen and (min-resolution: 2dppx)'
|
||
},
|
||
|
||
directives : {
|
||
replace : function (el, path, trigger) {
|
||
// The trigger argument, if called within the directive, fires
|
||
// an event named after the directive on the element, passing
|
||
// any parameters along to the event that you pass to trigger.
|
||
//
|
||
// ex. trigger(), trigger([a, b, c]), or trigger(a, b, c)
|
||
//
|
||
// This allows you to bind a callback like so:
|
||
// $('#interchangeContainer').on('replace', function (e, a, b, c) {
|
||
// console.log($(this).html(), a, b, c);
|
||
// });
|
||
|
||
if (el !== null && /IMG/.test(el[0].nodeName)) {
|
||
var orig_path = el[0].src;
|
||
|
||
if (new RegExp(path, 'i').test(orig_path)) {
|
||
return;
|
||
}
|
||
|
||
el.attr("src", path);
|
||
|
||
return trigger(el[0].src);
|
||
}
|
||
var last_path = el.data(this.data_attr + '-last-path'),
|
||
self = this;
|
||
|
||
if (last_path == path) {
|
||
return;
|
||
}
|
||
|
||
if (/\.(gif|jpg|jpeg|tiff|png)([?#].*)?/i.test(path)) {
|
||
$(el).css('background-image', 'url(' + path + ')');
|
||
el.data('interchange-last-path', path);
|
||
return trigger(path);
|
||
}
|
||
|
||
return $.get(path, function (response) {
|
||
el.html(response);
|
||
el.data(self.data_attr + '-last-path', path);
|
||
trigger();
|
||
});
|
||
|
||
}
|
||
}
|
||
},
|
||
|
||
init : function (scope, method, options) {
|
||
Foundation.inherit(this, 'throttle random_str');
|
||
|
||
this.data_attr = this.set_data_attr();
|
||
$.extend(true, this.settings, method, options);
|
||
this.bindings(method, options);
|
||
this.reflow();
|
||
},
|
||
|
||
get_media_hash : function () {
|
||
var mediaHash = '';
|
||
for (var queryName in this.settings.named_queries ) {
|
||
mediaHash += matchMedia(this.settings.named_queries[queryName]).matches.toString();
|
||
}
|
||
return mediaHash;
|
||
},
|
||
|
||
events : function () {
|
||
var self = this, prevMediaHash;
|
||
|
||
$(window)
|
||
.off('.interchange')
|
||
.on('resize.fndtn.interchange', self.throttle(function () {
|
||
var currMediaHash = self.get_media_hash();
|
||
if (currMediaHash !== prevMediaHash) {
|
||
self.resize();
|
||
}
|
||
prevMediaHash = currMediaHash;
|
||
}, 50));
|
||
|
||
return this;
|
||
},
|
||
|
||
resize : function () {
|
||
var cache = this.cache;
|
||
|
||
if (!this.images_loaded || !this.nodes_loaded) {
|
||
setTimeout($.proxy(this.resize, this), 50);
|
||
return;
|
||
}
|
||
|
||
for (var uuid in cache) {
|
||
if (cache.hasOwnProperty(uuid)) {
|
||
var passed = this.results(uuid, cache[uuid]);
|
||
if (passed) {
|
||
this.settings.directives[passed
|
||
.scenario[1]].call(this, passed.el, passed.scenario[0], (function (passed) {
|
||
if (arguments[0] instanceof Array) {
|
||
var args = arguments[0];
|
||
} else {
|
||
var args = Array.prototype.slice.call(arguments, 0);
|
||
}
|
||
|
||
return function() {
|
||
passed.el.trigger(passed.scenario[1], args);
|
||
}
|
||
}(passed)));
|
||
}
|
||
}
|
||
}
|
||
|
||
},
|
||
|
||
results : function (uuid, scenarios) {
|
||
var count = scenarios.length;
|
||
|
||
if (count > 0) {
|
||
var el = this.S('[' + this.add_namespace('data-uuid') + '="' + uuid + '"]');
|
||
|
||
while (count--) {
|
||
var mq, rule = scenarios[count][2];
|
||
if (this.settings.named_queries.hasOwnProperty(rule)) {
|
||
mq = matchMedia(this.settings.named_queries[rule]);
|
||
} else {
|
||
mq = matchMedia(rule);
|
||
}
|
||
if (mq.matches) {
|
||
return {el : el, scenario : scenarios[count]};
|
||
}
|
||
}
|
||
}
|
||
|
||
return false;
|
||
},
|
||
|
||
load : function (type, force_update) {
|
||
if (typeof this['cached_' + type] === 'undefined' || force_update) {
|
||
this['update_' + type]();
|
||
}
|
||
|
||
return this['cached_' + type];
|
||
},
|
||
|
||
update_images : function () {
|
||
var images = this.S('img[' + this.data_attr + ']'),
|
||
count = images.length,
|
||
i = count,
|
||
loaded_count = 0,
|
||
data_attr = this.data_attr;
|
||
|
||
this.cache = {};
|
||
this.cached_images = [];
|
||
this.images_loaded = (count === 0);
|
||
|
||
while (i--) {
|
||
loaded_count++;
|
||
if (images[i]) {
|
||
var str = images[i].getAttribute(data_attr) || '';
|
||
|
||
if (str.length > 0) {
|
||
this.cached_images.push(images[i]);
|
||
}
|
||
}
|
||
|
||
if (loaded_count === count) {
|
||
this.images_loaded = true;
|
||
this.enhance('images');
|
||
}
|
||
}
|
||
|
||
return this;
|
||
},
|
||
|
||
update_nodes : function () {
|
||
var nodes = this.S('[' + this.data_attr + ']').not('img'),
|
||
count = nodes.length,
|
||
i = count,
|
||
loaded_count = 0,
|
||
data_attr = this.data_attr;
|
||
|
||
this.cached_nodes = [];
|
||
this.nodes_loaded = (count === 0);
|
||
|
||
while (i--) {
|
||
loaded_count++;
|
||
var str = nodes[i].getAttribute(data_attr) || '';
|
||
|
||
if (str.length > 0) {
|
||
this.cached_nodes.push(nodes[i]);
|
||
}
|
||
|
||
if (loaded_count === count) {
|
||
this.nodes_loaded = true;
|
||
this.enhance('nodes');
|
||
}
|
||
}
|
||
|
||
return this;
|
||
},
|
||
|
||
enhance : function (type) {
|
||
var i = this['cached_' + type].length;
|
||
|
||
while (i--) {
|
||
this.object($(this['cached_' + type][i]));
|
||
}
|
||
|
||
return $(window).trigger('resize.fndtn.interchange');
|
||
},
|
||
|
||
convert_directive : function (directive) {
|
||
|
||
var trimmed = this.trim(directive);
|
||
|
||
if (trimmed.length > 0) {
|
||
return trimmed;
|
||
}
|
||
|
||
return 'replace';
|
||
},
|
||
|
||
parse_scenario : function (scenario) {
|
||
// This logic had to be made more complex since some users were using commas in the url path
|
||
// So we cannot simply just split on a comma
|
||
|
||
var directive_match = scenario[0].match(/(.+),\s*(\w+)\s*$/),
|
||
// getting the mq has gotten a bit complicated since we started accounting for several use cases
|
||
// of URLs. For now we'll continue to match these scenarios, but we may consider having these scenarios
|
||
// as nested objects or arrays in F6.
|
||
// regex: match everything before close parenthesis for mq
|
||
media_query = scenario[1].match(/(.*)\)/);
|
||
|
||
if (directive_match) {
|
||
var path = directive_match[1],
|
||
directive = directive_match[2];
|
||
|
||
} else {
|
||
var cached_split = scenario[0].split(/,\s*$/),
|
||
path = cached_split[0],
|
||
directive = '';
|
||
}
|
||
|
||
return [this.trim(path), this.convert_directive(directive), this.trim(media_query[1])];
|
||
},
|
||
|
||
object : function (el) {
|
||
var raw_arr = this.parse_data_attr(el),
|
||
scenarios = [],
|
||
i = raw_arr.length;
|
||
|
||
if (i > 0) {
|
||
while (i--) {
|
||
// split array between comma delimited content and mq
|
||
// regex: comma, optional space, open parenthesis
|
||
var scenario = raw_arr[i].split(/,\s?\(/);
|
||
|
||
if (scenario.length > 1) {
|
||
var params = this.parse_scenario(scenario);
|
||
scenarios.push(params);
|
||
}
|
||
}
|
||
}
|
||
|
||
return this.store(el, scenarios);
|
||
},
|
||
|
||
store : function (el, scenarios) {
|
||
var uuid = this.random_str(),
|
||
current_uuid = el.data(this.add_namespace('uuid', true));
|
||
|
||
if (this.cache[current_uuid]) {
|
||
return this.cache[current_uuid];
|
||
}
|
||
|
||
el.attr(this.add_namespace('data-uuid'), uuid);
|
||
return this.cache[uuid] = scenarios;
|
||
},
|
||
|
||
trim : function (str) {
|
||
|
||
if (typeof str === 'string') {
|
||
return $.trim(str);
|
||
}
|
||
|
||
return str;
|
||
},
|
||
|
||
set_data_attr : function (init) {
|
||
if (init) {
|
||
if (this.namespace.length > 0) {
|
||
return this.namespace + '-' + this.settings.load_attr;
|
||
}
|
||
|
||
return this.settings.load_attr;
|
||
}
|
||
|
||
if (this.namespace.length > 0) {
|
||
return 'data-' + this.namespace + '-' + this.settings.load_attr;
|
||
}
|
||
|
||
return 'data-' + this.settings.load_attr;
|
||
},
|
||
|
||
parse_data_attr : function (el) {
|
||
var raw = el.attr(this.attr_name()).split(/\[(.*?)\]/),
|
||
i = raw.length,
|
||
output = [];
|
||
|
||
while (i--) {
|
||
if (raw[i].replace(/[\W\d]+/, '').length > 4) {
|
||
output.push(raw[i]);
|
||
}
|
||
}
|
||
|
||
return output;
|
||
},
|
||
|
||
reflow : function () {
|
||
this.load('images', true);
|
||
this.load('nodes', true);
|
||
}
|
||
|
||
};
|
||
|
||
}(jQuery, window, window.document));
|
||
|
||
;(function ($, window, document, undefined) {
|
||
'use strict';
|
||
|
||
Foundation.libs.tab = {
|
||
name : 'tab',
|
||
|
||
version : '5.5.2',
|
||
|
||
settings : {
|
||
active_class : 'active',
|
||
callback : function () {},
|
||
deep_linking : false,
|
||
scroll_to_content : true,
|
||
is_hover : false
|
||
},
|
||
|
||
default_tab_hashes : [],
|
||
|
||
init : function (scope, method, options) {
|
||
var self = this,
|
||
S = this.S;
|
||
|
||
// Store the default active tabs which will be referenced when the
|
||
// location hash is absent, as in the case of navigating the tabs and
|
||
// returning to the first viewing via the browser Back button.
|
||
S('[' + this.attr_name() + '] > .active > a', this.scope).each(function () {
|
||
self.default_tab_hashes.push(this.hash);
|
||
});
|
||
|
||
// store the initial href, which is used to allow correct behaviour of the
|
||
// browser back button when deep linking is turned on.
|
||
self.entry_location = window.location.href;
|
||
|
||
this.bindings(method, options);
|
||
this.handle_location_hash_change();
|
||
},
|
||
|
||
events : function () {
|
||
var self = this,
|
||
S = this.S;
|
||
|
||
var usual_tab_behavior = function (e, target) {
|
||
var settings = S(target).closest('[' + self.attr_name() + ']').data(self.attr_name(true) + '-init');
|
||
if (!settings.is_hover || Modernizr.touch) {
|
||
e.preventDefault();
|
||
e.stopPropagation();
|
||
self.toggle_active_tab(S(target).parent());
|
||
}
|
||
};
|
||
|
||
S(this.scope)
|
||
.off('.tab')
|
||
// Key event: focus/tab key
|
||
.on('keydown.fndtn.tab', '[' + this.attr_name() + '] > * > a', function(e) {
|
||
var el = this;
|
||
var keyCode = e.keyCode || e.which;
|
||
// if user pressed tab key
|
||
if (keyCode == 9) {
|
||
e.preventDefault();
|
||
// TODO: Change usual_tab_behavior into accessibility function?
|
||
usual_tab_behavior(e, el);
|
||
}
|
||
})
|
||
// Click event: tab title
|
||
.on('click.fndtn.tab', '[' + this.attr_name() + '] > * > a', function(e) {
|
||
var el = this;
|
||
usual_tab_behavior(e, el);
|
||
})
|
||
// Hover event: tab title
|
||
.on('mouseenter.fndtn.tab', '[' + this.attr_name() + '] > * > a', function (e) {
|
||
var settings = S(this).closest('[' + self.attr_name() + ']').data(self.attr_name(true) + '-init');
|
||
if (settings.is_hover) {
|
||
self.toggle_active_tab(S(this).parent());
|
||
}
|
||
});
|
||
|
||
// Location hash change event
|
||
S(window).on('hashchange.fndtn.tab', function (e) {
|
||
e.preventDefault();
|
||
self.handle_location_hash_change();
|
||
});
|
||
},
|
||
|
||
handle_location_hash_change : function () {
|
||
|
||
var self = this,
|
||
S = this.S;
|
||
|
||
S('[' + this.attr_name() + ']', this.scope).each(function () {
|
||
var settings = S(this).data(self.attr_name(true) + '-init');
|
||
if (settings.deep_linking) {
|
||
// Match the location hash to a label
|
||
var hash;
|
||
if (settings.scroll_to_content) {
|
||
hash = self.scope.location.hash;
|
||
} else {
|
||
// prefix the hash to prevent anchor scrolling
|
||
hash = self.scope.location.hash.replace('fndtn-', '');
|
||
}
|
||
if (hash != '') {
|
||
// Check whether the location hash references a tab content div or
|
||
// another element on the page (inside or outside the tab content div)
|
||
var hash_element = S(hash);
|
||
if (hash_element.hasClass('content') && hash_element.parent().hasClass('tabs-content')) {
|
||
// Tab content div
|
||
self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=' + hash + ']').parent());
|
||
} else {
|
||
// Not the tab content div. If inside the tab content, find the
|
||
// containing tab and toggle it as active.
|
||
var hash_tab_container_id = hash_element.closest('.content').attr('id');
|
||
if (hash_tab_container_id != undefined) {
|
||
self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=#' + hash_tab_container_id + ']').parent(), hash);
|
||
}
|
||
}
|
||
} else {
|
||
// Reference the default tab hashes which were initialized in the init function
|
||
for (var ind = 0; ind < self.default_tab_hashes.length; ind++) {
|
||
self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=' + self.default_tab_hashes[ind] + ']').parent());
|
||
}
|
||
}
|
||
}
|
||
});
|
||
},
|
||
|
||
toggle_active_tab : function (tab, location_hash) {
|
||
var self = this,
|
||
S = self.S,
|
||
tabs = tab.closest('[' + this.attr_name() + ']'),
|
||
tab_link = tab.find('a'),
|
||
anchor = tab.children('a').first(),
|
||
target_hash = '#' + anchor.attr('href').split('#')[1],
|
||
target = S(target_hash),
|
||
siblings = tab.siblings(),
|
||
settings = tabs.data(this.attr_name(true) + '-init'),
|
||
interpret_keyup_action = function (e) {
|
||
// Light modification of Heydon Pickering's Practical ARIA Examples: http://heydonworks.com/practical_aria_examples/js/a11y.js
|
||
|
||
// define current, previous and next (possible) tabs
|
||
|
||
var $original = $(this);
|
||
var $prev = $(this).parents('li').prev().children('[role="tab"]');
|
||
var $next = $(this).parents('li').next().children('[role="tab"]');
|
||
var $target;
|
||
|
||
// find the direction (prev or next)
|
||
|
||
switch (e.keyCode) {
|
||
case 37:
|
||
$target = $prev;
|
||
break;
|
||
case 39:
|
||
$target = $next;
|
||
break;
|
||
default:
|
||
$target = false
|
||
break;
|
||
}
|
||
|
||
if ($target.length) {
|
||
$original.attr({
|
||
'tabindex' : '-1',
|
||
'aria-selected' : null
|
||
});
|
||
$target.attr({
|
||
'tabindex' : '0',
|
||
'aria-selected' : true
|
||
}).focus();
|
||
}
|
||
|
||
// Hide panels
|
||
|
||
$('[role="tabpanel"]')
|
||
.attr('aria-hidden', 'true');
|
||
|
||
// Show panel which corresponds to target
|
||
|
||
$('#' + $(document.activeElement).attr('href').substring(1))
|
||
.attr('aria-hidden', null);
|
||
|
||
},
|
||
go_to_hash = function(hash) {
|
||
// This function allows correct behaviour of the browser's back button when deep linking is enabled. Without it
|
||
// the user would get continually redirected to the default hash.
|
||
var is_entry_location = window.location.href === self.entry_location,
|
||
default_hash = settings.scroll_to_content ? self.default_tab_hashes[0] : is_entry_location ? window.location.hash :'fndtn-' + self.default_tab_hashes[0].replace('#', '')
|
||
|
||
if (!(is_entry_location && hash === default_hash)) {
|
||
window.location.hash = hash;
|
||
}
|
||
};
|
||
|
||
// allow usage of data-tab-content attribute instead of href
|
||
if (anchor.data('tab-content')) {
|
||
target_hash = '#' + anchor.data('tab-content').split('#')[1];
|
||
target = S(target_hash);
|
||
}
|
||
|
||
if (settings.deep_linking) {
|
||
|
||
if (settings.scroll_to_content) {
|
||
|
||
// retain current hash to scroll to content
|
||
go_to_hash(location_hash || target_hash);
|
||
|
||
if (location_hash == undefined || location_hash == target_hash) {
|
||
tab.parent()[0].scrollIntoView();
|
||
} else {
|
||
S(target_hash)[0].scrollIntoView();
|
||
}
|
||
} else {
|
||
// prefix the hashes so that the browser doesn't scroll down
|
||
if (location_hash != undefined) {
|
||
go_to_hash('fndtn-' + location_hash.replace('#', ''));
|
||
} else {
|
||
go_to_hash('fndtn-' + target_hash.replace('#', ''));
|
||
}
|
||
}
|
||
}
|
||
|
||
// WARNING: The activation and deactivation of the tab content must
|
||
// occur after the deep linking in order to properly refresh the browser
|
||
// window (notably in Chrome).
|
||
// Clean up multiple attr instances to done once
|
||
tab.addClass(settings.active_class).triggerHandler('opened');
|
||
tab_link.attr({'aria-selected' : 'true', tabindex : 0});
|
||
siblings.removeClass(settings.active_class)
|
||
siblings.find('a').attr({'aria-selected' : 'false', tabindex : -1});
|
||
target.siblings().removeClass(settings.active_class).attr({'aria-hidden' : 'true', tabindex : -1});
|
||
target.addClass(settings.active_class).attr('aria-hidden', 'false').removeAttr('tabindex');
|
||
settings.callback(tab);
|
||
target.triggerHandler('toggled', [target]);
|
||
tabs.triggerHandler('toggled', [tab]);
|
||
|
||
tab_link.off('keydown').on('keydown', interpret_keyup_action );
|
||
},
|
||
|
||
data_attr : function (str) {
|
||
if (this.namespace.length > 0) {
|
||
return this.namespace + '-' + str;
|
||
}
|
||
|
||
return str;
|
||
},
|
||
|
||
off : function () {},
|
||
|
||
reflow : function () {}
|
||
};
|
||
}(jQuery, window, window.document));
|
||
|
||
;(function ($, window, document, undefined) {
|
||
'use strict';
|
||
|
||
Foundation.libs.topbar = {
|
||
name : 'topbar',
|
||
|
||
version : '5.5.2',
|
||
|
||
settings : {
|
||
index : 0,
|
||
start_offset : 0,
|
||
sticky_class : 'sticky',
|
||
custom_back_text : true,
|
||
back_text : 'Back',
|
||
mobile_show_parent_link : true,
|
||
is_hover : true,
|
||
scrolltop : true, // jump to top when sticky nav menu toggle is clicked
|
||
sticky_on : 'all',
|
||
dropdown_autoclose: true
|
||
},
|
||
|
||
init : function (section, method, options) {
|
||
Foundation.inherit(this, 'add_custom_rule register_media throttle');
|
||
var self = this;
|
||
|
||
self.register_media('topbar', 'foundation-mq-topbar');
|
||
|
||
this.bindings(method, options);
|
||
|
||
self.S('[' + this.attr_name() + ']', this.scope).each(function () {
|
||
var topbar = $(this),
|
||
settings = topbar.data(self.attr_name(true) + '-init'),
|
||
section = self.S('section, .top-bar-section', this);
|
||
topbar.data('index', 0);
|
||
var topbarContainer = topbar.parent();
|
||
if (topbarContainer.hasClass('fixed') || self.is_sticky(topbar, topbarContainer, settings) ) {
|
||
self.settings.sticky_class = settings.sticky_class;
|
||
self.settings.sticky_topbar = topbar;
|
||
topbar.data('height', topbarContainer.outerHeight());
|
||
topbar.data('stickyoffset', topbarContainer.offset().top);
|
||
} else {
|
||
topbar.data('height', topbar.outerHeight());
|
||
}
|
||
|
||
if (!settings.assembled) {
|
||
self.assemble(topbar);
|
||
}
|
||
|
||
if (settings.is_hover) {
|
||
self.S('.has-dropdown', topbar).addClass('not-click');
|
||
} else {
|
||
self.S('.has-dropdown', topbar).removeClass('not-click');
|
||
}
|
||
|
||
// Pad body when sticky (scrolled) or fixed.
|
||
self.add_custom_rule('.f-topbar-fixed { padding-top: ' + topbar.data('height') + 'px }');
|
||
|
||
if (topbarContainer.hasClass('fixed')) {
|
||
self.S('body').addClass('f-topbar-fixed');
|
||
}
|
||
});
|
||
|
||
},
|
||
|
||
is_sticky : function (topbar, topbarContainer, settings) {
|
||
var sticky = topbarContainer.hasClass(settings.sticky_class);
|
||
var smallMatch = matchMedia(Foundation.media_queries.small).matches;
|
||
var medMatch = matchMedia(Foundation.media_queries.medium).matches;
|
||
var lrgMatch = matchMedia(Foundation.media_queries.large).matches;
|
||
|
||
if (sticky && settings.sticky_on === 'all') {
|
||
return true;
|
||
}
|
||
if (sticky && this.small() && settings.sticky_on.indexOf('small') !== -1) {
|
||
if (smallMatch && !medMatch && !lrgMatch) { return true; }
|
||
}
|
||
if (sticky && this.medium() && settings.sticky_on.indexOf('medium') !== -1) {
|
||
if (smallMatch && medMatch && !lrgMatch) { return true; }
|
||
}
|
||
if (sticky && this.large() && settings.sticky_on.indexOf('large') !== -1) {
|
||
if (smallMatch && medMatch && lrgMatch) { return true; }
|
||
}
|
||
|
||
return false;
|
||
},
|
||
|
||
toggle : function (toggleEl) {
|
||
var self = this,
|
||
topbar;
|
||
|
||
if (toggleEl) {
|
||
topbar = self.S(toggleEl).closest('[' + this.attr_name() + ']');
|
||
} else {
|
||
topbar = self.S('[' + this.attr_name() + ']');
|
||
}
|
||
|
||
var settings = topbar.data(this.attr_name(true) + '-init');
|
||
|
||
var section = self.S('section, .top-bar-section', topbar);
|
||
|
||
if (self.breakpoint()) {
|
||
if (!self.rtl) {
|
||
section.css({left : '0%'});
|
||
$('>.name', section).css({left : '100%'});
|
||
} else {
|
||
section.css({right : '0%'});
|
||
$('>.name', section).css({right : '100%'});
|
||
}
|
||
|
||
self.S('li.moved', section).removeClass('moved');
|
||
topbar.data('index', 0);
|
||
|
||
topbar
|
||
.toggleClass('expanded')
|
||
.css('height', '');
|
||
}
|
||
|
||
if (settings.scrolltop) {
|
||
if (!topbar.hasClass('expanded')) {
|
||
if (topbar.hasClass('fixed')) {
|
||
topbar.parent().addClass('fixed');
|
||
topbar.removeClass('fixed');
|
||
self.S('body').addClass('f-topbar-fixed');
|
||
}
|
||
} else if (topbar.parent().hasClass('fixed')) {
|
||
if (settings.scrolltop) {
|
||
topbar.parent().removeClass('fixed');
|
||
topbar.addClass('fixed');
|
||
self.S('body').removeClass('f-topbar-fixed');
|
||
|
||
window.scrollTo(0, 0);
|
||
} else {
|
||
topbar.parent().removeClass('expanded');
|
||
}
|
||
}
|
||
} else {
|
||
if (self.is_sticky(topbar, topbar.parent(), settings)) {
|
||
topbar.parent().addClass('fixed');
|
||
}
|
||
|
||
if (topbar.parent().hasClass('fixed')) {
|
||
if (!topbar.hasClass('expanded')) {
|
||
topbar.removeClass('fixed');
|
||
topbar.parent().removeClass('expanded');
|
||
self.update_sticky_positioning();
|
||
} else {
|
||
topbar.addClass('fixed');
|
||
topbar.parent().addClass('expanded');
|
||
self.S('body').addClass('f-topbar-fixed');
|
||
}
|
||
}
|
||
}
|
||
},
|
||
|
||
timer : null,
|
||
|
||
events : function (bar) {
|
||
var self = this,
|
||
S = this.S;
|
||
|
||
S(this.scope)
|
||
.off('.topbar')
|
||
.on('click.fndtn.topbar', '[' + this.attr_name() + '] .toggle-topbar', function (e) {
|
||
e.preventDefault();
|
||
self.toggle(this);
|
||
})
|
||
.on('click.fndtn.topbar contextmenu.fndtn.topbar', '.top-bar .top-bar-section li a[href^="#"],[' + this.attr_name() + '] .top-bar-section li a[href^="#"]', function (e) {
|
||
var li = $(this).closest('li'),
|
||
topbar = li.closest('[' + self.attr_name() + ']'),
|
||
settings = topbar.data(self.attr_name(true) + '-init');
|
||
|
||
if (settings.dropdown_autoclose && settings.is_hover) {
|
||
var hoverLi = $(this).closest('.hover');
|
||
hoverLi.removeClass('hover');
|
||
}
|
||
if (self.breakpoint() && !li.hasClass('back') && !li.hasClass('has-dropdown')) {
|
||
self.toggle();
|
||
}
|
||
|
||
})
|
||
.on('click.fndtn.topbar', '[' + this.attr_name() + '] li.has-dropdown', function (e) {
|
||
var li = S(this),
|
||
target = S(e.target),
|
||
topbar = li.closest('[' + self.attr_name() + ']'),
|
||
settings = topbar.data(self.attr_name(true) + '-init');
|
||
|
||
if (target.data('revealId')) {
|
||
self.toggle();
|
||
return;
|
||
}
|
||
|
||
if (self.breakpoint()) {
|
||
return;
|
||
}
|
||
|
||
if (settings.is_hover && !Modernizr.touch) {
|
||
return;
|
||
}
|
||
|
||
e.stopImmediatePropagation();
|
||
|
||
if (li.hasClass('hover')) {
|
||
li
|
||
.removeClass('hover')
|
||
.find('li')
|
||
.removeClass('hover');
|
||
|
||
li.parents('li.hover')
|
||
.removeClass('hover');
|
||
} else {
|
||
li.addClass('hover');
|
||
|
||
$(li).siblings().removeClass('hover');
|
||
|
||
if (target[0].nodeName === 'A' && target.parent().hasClass('has-dropdown')) {
|
||
e.preventDefault();
|
||
}
|
||
}
|
||
})
|
||
.on('click.fndtn.topbar', '[' + this.attr_name() + '] .has-dropdown>a', function (e) {
|
||
if (self.breakpoint()) {
|
||
|
||
e.preventDefault();
|
||
|
||
var $this = S(this),
|
||
topbar = $this.closest('[' + self.attr_name() + ']'),
|
||
section = topbar.find('section, .top-bar-section'),
|
||
dropdownHeight = $this.next('.dropdown').outerHeight(),
|
||
$selectedLi = $this.closest('li');
|
||
|
||
topbar.data('index', topbar.data('index') + 1);
|
||
$selectedLi.addClass('moved');
|
||
|
||
if (!self.rtl) {
|
||
section.css({left : -(100 * topbar.data('index')) + '%'});
|
||
section.find('>.name').css({left : 100 * topbar.data('index') + '%'});
|
||
} else {
|
||
section.css({right : -(100 * topbar.data('index')) + '%'});
|
||
section.find('>.name').css({right : 100 * topbar.data('index') + '%'});
|
||
}
|
||
|
||
topbar.css('height', $this.siblings('ul').outerHeight(true) + topbar.data('height'));
|
||
}
|
||
});
|
||
|
||
S(window).off('.topbar').on('resize.fndtn.topbar', self.throttle(function () {
|
||
self.resize.call(self);
|
||
}, 50)).trigger('resize.fndtn.topbar').load(function () {
|
||
// Ensure that the offset is calculated after all of the pages resources have loaded
|
||
S(this).trigger('resize.fndtn.topbar');
|
||
});
|
||
|
||
S('body').off('.topbar').on('click.fndtn.topbar', function (e) {
|
||
var parent = S(e.target).closest('li').closest('li.hover');
|
||
|
||
if (parent.length > 0) {
|
||
return;
|
||
}
|
||
|
||
S('[' + self.attr_name() + '] li.hover').removeClass('hover');
|
||
});
|
||
|
||
// Go up a level on Click
|
||
S(this.scope).on('click.fndtn.topbar', '[' + this.attr_name() + '] .has-dropdown .back', function (e) {
|
||
e.preventDefault();
|
||
|
||
var $this = S(this),
|
||
topbar = $this.closest('[' + self.attr_name() + ']'),
|
||
section = topbar.find('section, .top-bar-section'),
|
||
settings = topbar.data(self.attr_name(true) + '-init'),
|
||
$movedLi = $this.closest('li.moved'),
|
||
$previousLevelUl = $movedLi.parent();
|
||
|
||
topbar.data('index', topbar.data('index') - 1);
|
||
|
||
if (!self.rtl) {
|
||
section.css({left : -(100 * topbar.data('index')) + '%'});
|
||
section.find('>.name').css({left : 100 * topbar.data('index') + '%'});
|
||
} else {
|
||
section.css({right : -(100 * topbar.data('index')) + '%'});
|
||
section.find('>.name').css({right : 100 * topbar.data('index') + '%'});
|
||
}
|
||
|
||
if (topbar.data('index') === 0) {
|
||
topbar.css('height', '');
|
||
} else {
|
||
topbar.css('height', $previousLevelUl.outerHeight(true) + topbar.data('height'));
|
||
}
|
||
|
||
setTimeout(function () {
|
||
$movedLi.removeClass('moved');
|
||
}, 300);
|
||
});
|
||
|
||
// Show dropdown menus when their items are focused
|
||
S(this.scope).find('.dropdown a')
|
||
.focus(function () {
|
||
$(this).parents('.has-dropdown').addClass('hover');
|
||
})
|
||
.blur(function () {
|
||
$(this).parents('.has-dropdown').removeClass('hover');
|
||
});
|
||
},
|
||
|
||
resize : function () {
|
||
var self = this;
|
||
self.S('[' + this.attr_name() + ']').each(function () {
|
||
var topbar = self.S(this),
|
||
settings = topbar.data(self.attr_name(true) + '-init');
|
||
|
||
var stickyContainer = topbar.parent('.' + self.settings.sticky_class);
|
||
var stickyOffset;
|
||
|
||
if (!self.breakpoint()) {
|
||
var doToggle = topbar.hasClass('expanded');
|
||
topbar
|
||
.css('height', '')
|
||
.removeClass('expanded')
|
||
.find('li')
|
||
.removeClass('hover');
|
||
|
||
if (doToggle) {
|
||
self.toggle(topbar);
|
||
}
|
||
}
|
||
|
||
if (self.is_sticky(topbar, stickyContainer, settings)) {
|
||
if (stickyContainer.hasClass('fixed')) {
|
||
// Remove the fixed to allow for correct calculation of the offset.
|
||
stickyContainer.removeClass('fixed');
|
||
|
||
stickyOffset = stickyContainer.offset().top;
|
||
if (self.S(document.body).hasClass('f-topbar-fixed')) {
|
||
stickyOffset -= topbar.data('height');
|
||
}
|
||
|
||
topbar.data('stickyoffset', stickyOffset);
|
||
stickyContainer.addClass('fixed');
|
||
} else {
|
||
stickyOffset = stickyContainer.offset().top;
|
||
topbar.data('stickyoffset', stickyOffset);
|
||
}
|
||
}
|
||
|
||
});
|
||
},
|
||
|
||
breakpoint : function () {
|
||
return !matchMedia(Foundation.media_queries['topbar']).matches;
|
||
},
|
||
|
||
small : function () {
|
||
return matchMedia(Foundation.media_queries['small']).matches;
|
||
},
|
||
|
||
medium : function () {
|
||
return matchMedia(Foundation.media_queries['medium']).matches;
|
||
},
|
||
|
||
large : function () {
|
||
return matchMedia(Foundation.media_queries['large']).matches;
|
||
},
|
||
|
||
assemble : function (topbar) {
|
||
var self = this,
|
||
settings = topbar.data(this.attr_name(true) + '-init'),
|
||
section = self.S('section, .top-bar-section', topbar);
|
||
|
||
// Pull element out of the DOM for manipulation
|
||
section.detach();
|
||
|
||
self.S('.has-dropdown>a', section).each(function () {
|
||
var $link = self.S(this),
|
||
$dropdown = $link.siblings('.dropdown'),
|
||
url = $link.attr('href'),
|
||
$titleLi;
|
||
|
||
if (!$dropdown.find('.title.back').length) {
|
||
|
||
if (settings.mobile_show_parent_link == true && url) {
|
||
$titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li><li class="parent-link hide-for-medium-up"><a class="parent-link js-generated" href="' + url + '">' + $link.html() +'</a></li>');
|
||
} else {
|
||
$titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5>');
|
||
}
|
||
|
||
// Copy link to subnav
|
||
if (settings.custom_back_text == true) {
|
||
$('h5>a', $titleLi).html(settings.back_text);
|
||
} else {
|
||
$('h5>a', $titleLi).html('« ' + $link.html());
|
||
}
|
||
$dropdown.prepend($titleLi);
|
||
}
|
||
});
|
||
|
||
// Put element back in the DOM
|
||
section.appendTo(topbar);
|
||
|
||
// check for sticky
|
||
this.sticky();
|
||
|
||
this.assembled(topbar);
|
||
},
|
||
|
||
assembled : function (topbar) {
|
||
topbar.data(this.attr_name(true), $.extend({}, topbar.data(this.attr_name(true)), {assembled : true}));
|
||
},
|
||
|
||
height : function (ul) {
|
||
var total = 0,
|
||
self = this;
|
||
|
||
$('> li', ul).each(function () {
|
||
total += self.S(this).outerHeight(true);
|
||
});
|
||
|
||
return total;
|
||
},
|
||
|
||
sticky : function () {
|
||
var self = this;
|
||
|
||
this.S(window).on('scroll', function () {
|
||
self.update_sticky_positioning();
|
||
});
|
||
},
|
||
|
||
update_sticky_positioning : function () {
|
||
var klass = '.' + this.settings.sticky_class,
|
||
$window = this.S(window),
|
||
self = this;
|
||
|
||
if (self.settings.sticky_topbar && self.is_sticky(this.settings.sticky_topbar,this.settings.sticky_topbar.parent(), this.settings)) {
|
||
var distance = this.settings.sticky_topbar.data('stickyoffset') + this.settings.start_offset;
|
||
if (!self.S(klass).hasClass('expanded')) {
|
||
if ($window.scrollTop() > (distance)) {
|
||
if (!self.S(klass).hasClass('fixed')) {
|
||
self.S(klass).addClass('fixed');
|
||
self.S('body').addClass('f-topbar-fixed');
|
||
}
|
||
} else if ($window.scrollTop() <= distance) {
|
||
if (self.S(klass).hasClass('fixed')) {
|
||
self.S(klass).removeClass('fixed');
|
||
self.S('body').removeClass('f-topbar-fixed');
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
|
||
off : function () {
|
||
this.S(this.scope).off('.fndtn.topbar');
|
||
this.S(window).off('.fndtn.topbar');
|
||
},
|
||
|
||
reflow : function () {}
|
||
};
|
||
}(jQuery, window, window.document));
|
||
|
||
/*!
|
||
* Modernizr v2.8.3
|
||
* www.modernizr.com
|
||
*
|
||
* Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
|
||
* Available under the BSD and MIT licenses: www.modernizr.com/license/
|
||
*/
|
||
|
||
/*
|
||
* Modernizr tests which native CSS3 and HTML5 features are available in
|
||
* the current UA and makes the results available to you in two ways:
|
||
* as properties on a global Modernizr object, and as classes on the
|
||
* <html> element. This information allows you to progressively enhance
|
||
* your pages with a granular level of control over the experience.
|
||
*
|
||
* Modernizr has an optional (not included) conditional resource loader
|
||
* called Modernizr.load(), based on Yepnope.js (yepnopejs.com).
|
||
* To get a build that includes Modernizr.load(), as well as choosing
|
||
* which tests to include, go to www.modernizr.com/download/
|
||
*
|
||
* Authors Faruk Ates, Paul Irish, Alex Sexton
|
||
* Contributors Ryan Seddon, Ben Alman
|
||
*/
|
||
|
||
window.Modernizr = (function( window, document, undefined ) {
|
||
|
||
var version = '2.8.3',
|
||
|
||
Modernizr = {},
|
||
|
||
/*>>cssclasses*/
|
||
// option for enabling the HTML classes to be added
|
||
enableClasses = true,
|
||
/*>>cssclasses*/
|
||
|
||
docElement = document.documentElement,
|
||
|
||
/**
|
||
* Create our "modernizr" element that we do most feature tests on.
|
||
*/
|
||
mod = 'modernizr',
|
||
modElem = document.createElement(mod),
|
||
mStyle = modElem.style,
|
||
|
||
/**
|
||
* Create the input element for various Web Forms feature tests.
|
||
*/
|
||
inputElem /*>>inputelem*/ = document.createElement('input') /*>>inputelem*/ ,
|
||
|
||
/*>>smile*/
|
||
smile = ':)',
|
||
/*>>smile*/
|
||
|
||
toString = {}.toString,
|
||
|
||
// TODO :: make the prefixes more granular
|
||
/*>>prefixes*/
|
||
// List of property values to set for css tests. See ticket #21
|
||
prefixes = ' -webkit- -moz- -o- -ms- '.split(' '),
|
||
/*>>prefixes*/
|
||
|
||
/*>>domprefixes*/
|
||
// Following spec is to expose vendor-specific style properties as:
|
||
// elem.style.WebkitBorderRadius
|
||
// and the following would be incorrect:
|
||
// elem.style.webkitBorderRadius
|
||
|
||
// Webkit ghosts their properties in lowercase but Opera & Moz do not.
|
||
// Microsoft uses a lowercase `ms` instead of the correct `Ms` in IE8+
|
||
// erik.eae.net/archives/2008/03/10/21.48.10/
|
||
|
||
// More here: github.com/Modernizr/Modernizr/issues/issue/21
|
||
omPrefixes = 'Webkit Moz O ms',
|
||
|
||
cssomPrefixes = omPrefixes.split(' '),
|
||
|
||
domPrefixes = omPrefixes.toLowerCase().split(' '),
|
||
/*>>domprefixes*/
|
||
|
||
/*>>ns*/
|
||
ns = {'svg': 'http://www.w3.org/2000/svg'},
|
||
/*>>ns*/
|
||
|
||
tests = {},
|
||
inputs = {},
|
||
attrs = {},
|
||
|
||
classes = [],
|
||
|
||
slice = classes.slice,
|
||
|
||
featureName, // used in testing loop
|
||
|
||
|
||
/*>>teststyles*/
|
||
// Inject element with style element and some CSS rules
|
||
injectElementWithStyles = function( rule, callback, nodes, testnames ) {
|
||
|
||
var style, ret, node, docOverflow,
|
||
div = document.createElement('div'),
|
||
// After page load injecting a fake body doesn't work so check if body exists
|
||
body = document.body,
|
||
// IE6 and 7 won't return offsetWidth or offsetHeight unless it's in the body element, so we fake it.
|
||
fakeBody = body || document.createElement('body');
|
||
|
||
if ( parseInt(nodes, 10) ) {
|
||
// In order not to give false positives we create a node for each test
|
||
// This also allows the method to scale for unspecified uses
|
||
while ( nodes-- ) {
|
||
node = document.createElement('div');
|
||
node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
|
||
div.appendChild(node);
|
||
}
|
||
}
|
||
|
||
// <style> elements in IE6-9 are considered 'NoScope' elements and therefore will be removed
|
||
// when injected with innerHTML. To get around this you need to prepend the 'NoScope' element
|
||
// with a 'scoped' element, in our case the soft-hyphen entity as it won't mess with our measurements.
|
||
// msdn.microsoft.com/en-us/library/ms533897%28VS.85%29.aspx
|
||
// Documents served as xml will throw if using ­ so use xml friendly encoded version. See issue #277
|
||
style = ['­','<style id="s', mod, '">', rule, '</style>'].join('');
|
||
div.id = mod;
|
||
// IE6 will false positive on some tests due to the style element inside the test div somehow interfering offsetHeight, so insert it into body or fakebody.
|
||
// Opera will act all quirky when injecting elements in documentElement when page is served as xml, needs fakebody too. #270
|
||
(body ? div : fakeBody).innerHTML += style;
|
||
fakeBody.appendChild(div);
|
||
if ( !body ) {
|
||
//avoid crashing IE8, if background image is used
|
||
fakeBody.style.background = '';
|
||
//Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible
|
||
fakeBody.style.overflow = 'hidden';
|
||
docOverflow = docElement.style.overflow;
|
||
docElement.style.overflow = 'hidden';
|
||
docElement.appendChild(fakeBody);
|
||
}
|
||
|
||
ret = callback(div, rule);
|
||
// If this is done after page load we don't want to remove the body so check if body exists
|
||
if ( !body ) {
|
||
fakeBody.parentNode.removeChild(fakeBody);
|
||
docElement.style.overflow = docOverflow;
|
||
} else {
|
||
div.parentNode.removeChild(div);
|
||
}
|
||
|
||
return !!ret;
|
||
|
||
},
|
||
/*>>teststyles*/
|
||
|
||
/*>>mq*/
|
||
// adapted from matchMedia polyfill
|
||
// by Scott Jehl and Paul Irish
|
||
// gist.github.com/786768
|
||
testMediaQuery = function( mq ) {
|
||
|
||
var matchMedia = window.matchMedia || window.msMatchMedia;
|
||
if ( matchMedia ) {
|
||
return matchMedia(mq) && matchMedia(mq).matches || false;
|
||
}
|
||
|
||
var bool;
|
||
|
||
injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) {
|
||
bool = (window.getComputedStyle ?
|
||
getComputedStyle(node, null) :
|
||
node.currentStyle)['position'] == 'absolute';
|
||
});
|
||
|
||
return bool;
|
||
|
||
},
|
||
/*>>mq*/
|
||
|
||
|
||
/*>>hasevent*/
|
||
//
|
||
// isEventSupported determines if a given element supports the given event
|
||
// kangax.github.com/iseventsupported/
|
||
//
|
||
// The following results are known incorrects:
|
||
// Modernizr.hasEvent("webkitTransitionEnd", elem) // false negative
|
||
// Modernizr.hasEvent("textInput") // in Webkit. github.com/Modernizr/Modernizr/issues/333
|
||
// ...
|
||
isEventSupported = (function() {
|
||
|
||
var TAGNAMES = {
|
||
'select': 'input', 'change': 'input',
|
||
'submit': 'form', 'reset': 'form',
|
||
'error': 'img', 'load': 'img', 'abort': 'img'
|
||
};
|
||
|
||
function isEventSupported( eventName, element ) {
|
||
|
||
element = element || document.createElement(TAGNAMES[eventName] || 'div');
|
||
eventName = 'on' + eventName;
|
||
|
||
// When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those
|
||
var isSupported = eventName in element;
|
||
|
||
if ( !isSupported ) {
|
||
// If it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element
|
||
if ( !element.setAttribute ) {
|
||
element = document.createElement('div');
|
||
}
|
||
if ( element.setAttribute && element.removeAttribute ) {
|
||
element.setAttribute(eventName, '');
|
||
isSupported = is(element[eventName], 'function');
|
||
|
||
// If property was created, "remove it" (by setting value to `undefined`)
|
||
if ( !is(element[eventName], 'undefined') ) {
|
||
element[eventName] = undefined;
|
||
}
|
||
element.removeAttribute(eventName);
|
||
}
|
||
}
|
||
|
||
element = null;
|
||
return isSupported;
|
||
}
|
||
return isEventSupported;
|
||
})(),
|
||
/*>>hasevent*/
|
||
|
||
// TODO :: Add flag for hasownprop ? didn't last time
|
||
|
||
// hasOwnProperty shim by kangax needed for Safari 2.0 support
|
||
_hasOwnProperty = ({}).hasOwnProperty, hasOwnProp;
|
||
|
||
if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
|
||
hasOwnProp = function (object, property) {
|
||
return _hasOwnProperty.call(object, property);
|
||
};
|
||
}
|
||
else {
|
||
hasOwnProp = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */
|
||
return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
|
||
};
|
||
}
|
||
|
||
// Adapted from ES5-shim https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js
|
||
// es5.github.com/#x15.3.4.5
|
||
|
||
if (!Function.prototype.bind) {
|
||
Function.prototype.bind = function bind(that) {
|
||
|
||
var target = this;
|
||
|
||
if (typeof target != "function") {
|
||
throw new TypeError();
|
||
}
|
||
|
||
var args = slice.call(arguments, 1),
|
||
bound = function () {
|
||
|
||
if (this instanceof bound) {
|
||
|
||
var F = function(){};
|
||
F.prototype = target.prototype;
|
||
var self = new F();
|
||
|
||
var result = target.apply(
|
||
self,
|
||
args.concat(slice.call(arguments))
|
||
);
|
||
if (Object(result) === result) {
|
||
return result;
|
||
}
|
||
return self;
|
||
|
||
} else {
|
||
|
||
return target.apply(
|
||
that,
|
||
args.concat(slice.call(arguments))
|
||
);
|
||
|
||
}
|
||
|
||
};
|
||
|
||
return bound;
|
||
};
|
||
}
|
||
|
||
/**
|
||
* setCss applies given styles to the Modernizr DOM node.
|
||
*/
|
||
function setCss( str ) {
|
||
mStyle.cssText = str;
|
||
}
|
||
|
||
/**
|
||
* setCssAll extrapolates all vendor-specific css strings.
|
||
*/
|
||
function setCssAll( str1, str2 ) {
|
||
return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
|
||
}
|
||
|
||
/**
|
||
* is returns a boolean for if typeof obj is exactly type.
|
||
*/
|
||
function is( obj, type ) {
|
||
return typeof obj === type;
|
||
}
|
||
|
||
/**
|
||
* contains returns a boolean for if substr is found within str.
|
||
*/
|
||
function contains( str, substr ) {
|
||
return !!~('' + str).indexOf(substr);
|
||
}
|
||
|
||
/*>>testprop*/
|
||
|
||
// testProps is a generic CSS / DOM property test.
|
||
|
||
// In testing support for a given CSS property, it's legit to test:
|
||
// `elem.style[styleName] !== undefined`
|
||
// If the property is supported it will return an empty string,
|
||
// if unsupported it will return undefined.
|
||
|
||
// We'll take advantage of this quick test and skip setting a style
|
||
// on our modernizr element, but instead just testing undefined vs
|
||
// empty string.
|
||
|
||
// Because the testing of the CSS property names (with "-", as
|
||
// opposed to the camelCase DOM properties) is non-portable and
|
||
// non-standard but works in WebKit and IE (but not Gecko or Opera),
|
||
// we explicitly reject properties with dashes so that authors
|
||
// developing in WebKit or IE first don't end up with
|
||
// browser-specific content by accident.
|
||
|
||
function testProps( props, prefixed ) {
|
||
for ( var i in props ) {
|
||
var prop = props[i];
|
||
if ( !contains(prop, "-") && mStyle[prop] !== undefined ) {
|
||
return prefixed == 'pfx' ? prop : true;
|
||
}
|
||
}
|
||
return false;
|
||
}
|
||
/*>>testprop*/
|
||
|
||
// TODO :: add testDOMProps
|
||
/**
|
||
* testDOMProps is a generic DOM property test; if a browser supports
|
||
* a certain property, it won't return undefined for it.
|
||
*/
|
||
function testDOMProps( props, obj, elem ) {
|
||
for ( var i in props ) {
|
||
var item = obj[props[i]];
|
||
if ( item !== undefined) {
|
||
|
||
// return the property name as a string
|
||
if (elem === false) return props[i];
|
||
|
||
// let's bind a function
|
||
if (is(item, 'function')){
|
||
// default to autobind unless override
|
||
return item.bind(elem || obj);
|
||
}
|
||
|
||
// return the unbound function or obj or value
|
||
return item;
|
||
}
|
||
}
|
||
return false;
|
||
}
|
||
|
||
/*>>testallprops*/
|
||
/**
|
||
* testPropsAll tests a list of DOM properties we want to check against.
|
||
* We specify literally ALL possible (known and/or likely) properties on
|
||
* the element including the non-vendor prefixed one, for forward-
|
||
* compatibility.
|
||
*/
|
||
function testPropsAll( prop, prefixed, elem ) {
|
||
|
||
var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
|
||
props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');
|
||
|
||
// did they call .prefixed('boxSizing') or are we just testing a prop?
|
||
if(is(prefixed, "string") || is(prefixed, "undefined")) {
|
||
return testProps(props, prefixed);
|
||
|
||
// otherwise, they called .prefixed('requestAnimationFrame', window[, elem])
|
||
} else {
|
||
props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
|
||
return testDOMProps(props, prefixed, elem);
|
||
}
|
||
}
|
||
/*>>testallprops*/
|
||
|
||
|
||
/**
|
||
* Tests
|
||
* -----
|
||
*/
|
||
|
||
// The *new* flexbox
|
||
// dev.w3.org/csswg/css3-flexbox
|
||
|
||
tests['flexbox'] = function() {
|
||
return testPropsAll('flexWrap');
|
||
};
|
||
|
||
// The *old* flexbox
|
||
// www.w3.org/TR/2009/WD-css3-flexbox-20090723/
|
||
|
||
tests['flexboxlegacy'] = function() {
|
||
return testPropsAll('boxDirection');
|
||
};
|
||
|
||
// On the S60 and BB Storm, getContext exists, but always returns undefined
|
||
// so we actually have to call getContext() to verify
|
||
// github.com/Modernizr/Modernizr/issues/issue/97/
|
||
|
||
tests['canvas'] = function() {
|
||
var elem = document.createElement('canvas');
|
||
return !!(elem.getContext && elem.getContext('2d'));
|
||
};
|
||
|
||
tests['canvastext'] = function() {
|
||
return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function'));
|
||
};
|
||
|
||
// webk.it/70117 is tracking a legit WebGL feature detect proposal
|
||
|
||
// We do a soft detect which may false positive in order to avoid
|
||
// an expensive context creation: bugzil.la/732441
|
||
|
||
tests['webgl'] = function() {
|
||
return !!window.WebGLRenderingContext;
|
||
};
|
||
|
||
/*
|
||
* The Modernizr.touch test only indicates if the browser supports
|
||
* touch events, which does not necessarily reflect a touchscreen
|
||
* device, as evidenced by tablets running Windows 7 or, alas,
|
||
* the Palm Pre / WebOS (touch) phones.
|
||
*
|
||
* Additionally, Chrome (desktop) used to lie about its support on this,
|
||
* but that has since been rectified: crbug.com/36415
|
||
*
|
||
* We also test for Firefox 4 Multitouch Support.
|
||
*
|
||
* For more info, see: modernizr.github.com/Modernizr/touch.html
|
||
*/
|
||
|
||
tests['touch'] = function() {
|
||
var bool;
|
||
|
||
if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
|
||
bool = true;
|
||
} else {
|
||
injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) {
|
||
bool = node.offsetTop === 9;
|
||
});
|
||
}
|
||
|
||
return bool;
|
||
};
|
||
|
||
|
||
// geolocation is often considered a trivial feature detect...
|
||
// Turns out, it's quite tricky to get right:
|
||
//
|
||
// Using !!navigator.geolocation does two things we don't want. It:
|
||
// 1. Leaks memory in IE9: github.com/Modernizr/Modernizr/issues/513
|
||
// 2. Disables page caching in WebKit: webk.it/43956
|
||
//
|
||
// Meanwhile, in Firefox < 8, an about:config setting could expose
|
||
// a false positive that would throw an exception: bugzil.la/688158
|
||
|
||
tests['geolocation'] = function() {
|
||
return 'geolocation' in navigator;
|
||
};
|
||
|
||
|
||
tests['postmessage'] = function() {
|
||
return !!window.postMessage;
|
||
};
|
||
|
||
|
||
// Chrome incognito mode used to throw an exception when using openDatabase
|
||
// It doesn't anymore.
|
||
tests['websqldatabase'] = function() {
|
||
return !!window.openDatabase;
|
||
};
|
||
|
||
// Vendors had inconsistent prefixing with the experimental Indexed DB:
|
||
// - Webkit's implementation is accessible through webkitIndexedDB
|
||
// - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB
|
||
// For speed, we don't test the legacy (and beta-only) indexedDB
|
||
tests['indexedDB'] = function() {
|
||
return !!testPropsAll("indexedDB", window);
|
||
};
|
||
|
||
// documentMode logic from YUI to filter out IE8 Compat Mode
|
||
// which false positives.
|
||
tests['hashchange'] = function() {
|
||
return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7);
|
||
};
|
||
|
||
// Per 1.6:
|
||
// This used to be Modernizr.historymanagement but the longer
|
||
// name has been deprecated in favor of a shorter and property-matching one.
|
||
// The old API is still available in 1.6, but as of 2.0 will throw a warning,
|
||
// and in the first release thereafter disappear entirely.
|
||
tests['history'] = function() {
|
||
return !!(window.history && history.pushState);
|
||
};
|
||
|
||
tests['draganddrop'] = function() {
|
||
var div = document.createElement('div');
|
||
return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div);
|
||
};
|
||
|
||
// FF3.6 was EOL'ed on 4/24/12, but the ESR version of FF10
|
||
// will be supported until FF19 (2/12/13), at which time, ESR becomes FF17.
|
||
// FF10 still uses prefixes, so check for it until then.
|
||
// for more ESR info, see: mozilla.org/en-US/firefox/organizations/faq/
|
||
tests['websockets'] = function() {
|
||
return 'WebSocket' in window || 'MozWebSocket' in window;
|
||
};
|
||
|
||
|
||
// css-tricks.com/rgba-browser-support/
|
||
tests['rgba'] = function() {
|
||
// Set an rgba() color and check the returned value
|
||
|
||
setCss('background-color:rgba(150,255,150,.5)');
|
||
|
||
return contains(mStyle.backgroundColor, 'rgba');
|
||
};
|
||
|
||
tests['hsla'] = function() {
|
||
// Same as rgba(), in fact, browsers re-map hsla() to rgba() internally,
|
||
// except IE9 who retains it as hsla
|
||
|
||
setCss('background-color:hsla(120,40%,100%,.5)');
|
||
|
||
return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla');
|
||
};
|
||
|
||
tests['multiplebgs'] = function() {
|
||
// Setting multiple images AND a color on the background shorthand property
|
||
// and then querying the style.background property value for the number of
|
||
// occurrences of "url(" is a reliable method for detecting ACTUAL support for this!
|
||
|
||
setCss('background:url(https://),url(https://),red url(https://)');
|
||
|
||
// If the UA supports multiple backgrounds, there should be three occurrences
|
||
// of the string "url(" in the return value for elemStyle.background
|
||
|
||
return (/(url\s*\(.*?){3}/).test(mStyle.background);
|
||
};
|
||
|
||
|
||
|
||
// this will false positive in Opera Mini
|
||
// github.com/Modernizr/Modernizr/issues/396
|
||
|
||
tests['backgroundsize'] = function() {
|
||
return testPropsAll('backgroundSize');
|
||
};
|
||
|
||
tests['borderimage'] = function() {
|
||
return testPropsAll('borderImage');
|
||
};
|
||
|
||
|
||
// Super comprehensive table about all the unique implementations of
|
||
// border-radius: muddledramblings.com/table-of-css3-border-radius-compliance
|
||
|
||
tests['borderradius'] = function() {
|
||
return testPropsAll('borderRadius');
|
||
};
|
||
|
||
// WebOS unfortunately false positives on this test.
|
||
tests['boxshadow'] = function() {
|
||
return testPropsAll('boxShadow');
|
||
};
|
||
|
||
// FF3.0 will false positive on this test
|
||
tests['textshadow'] = function() {
|
||
return document.createElement('div').style.textShadow === '';
|
||
};
|
||
|
||
|
||
tests['opacity'] = function() {
|
||
// Browsers that actually have CSS Opacity implemented have done so
|
||
// according to spec, which means their return values are within the
|
||
// range of [0.0,1.0] - including the leading zero.
|
||
|
||
setCssAll('opacity:.55');
|
||
|
||
// The non-literal . in this regex is intentional:
|
||
// German Chrome returns this value as 0,55
|
||
// github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632
|
||
return (/^0.55$/).test(mStyle.opacity);
|
||
};
|
||
|
||
|
||
// Note, Android < 4 will pass this test, but can only animate
|
||
// a single property at a time
|
||
// goo.gl/v3V4Gp
|
||
tests['cssanimations'] = function() {
|
||
return testPropsAll('animationName');
|
||
};
|
||
|
||
|
||
tests['csscolumns'] = function() {
|
||
return testPropsAll('columnCount');
|
||
};
|
||
|
||
|
||
tests['cssgradients'] = function() {
|
||
/**
|
||
* For CSS Gradients syntax, please see:
|
||
* webkit.org/blog/175/introducing-css-gradients/
|
||
* developer.mozilla.org/en/CSS/-moz-linear-gradient
|
||
* developer.mozilla.org/en/CSS/-moz-radial-gradient
|
||
* dev.w3.org/csswg/css3-images/#gradients-
|
||
*/
|
||
|
||
var str1 = 'background-image:',
|
||
str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
|
||
str3 = 'linear-gradient(left top,#9f9, white);';
|
||
|
||
setCss(
|
||
// legacy webkit syntax (FIXME: remove when syntax not in use anymore)
|
||
(str1 + '-webkit- '.split(' ').join(str2 + str1) +
|
||
// standard syntax // trailing 'background-image:'
|
||
prefixes.join(str3 + str1)).slice(0, -str1.length)
|
||
);
|
||
|
||
return contains(mStyle.backgroundImage, 'gradient');
|
||
};
|
||
|
||
|
||
tests['cssreflections'] = function() {
|
||
return testPropsAll('boxReflect');
|
||
};
|
||
|
||
|
||
tests['csstransforms'] = function() {
|
||
return !!testPropsAll('transform');
|
||
};
|
||
|
||
|
||
tests['csstransforms3d'] = function() {
|
||
|
||
var ret = !!testPropsAll('perspective');
|
||
|
||
// Webkit's 3D transforms are passed off to the browser's own graphics renderer.
|
||
// It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in
|
||
// some conditions. As a result, Webkit typically recognizes the syntax but
|
||
// will sometimes throw a false positive, thus we must do a more thorough check:
|
||
if ( ret && 'webkitPerspective' in docElement.style ) {
|
||
|
||
// Webkit allows this media query to succeed only if the feature is enabled.
|
||
// `@media (transform-3d),(-webkit-transform-3d){ ... }`
|
||
injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) {
|
||
ret = node.offsetLeft === 9 && node.offsetHeight === 3;
|
||
});
|
||
}
|
||
return ret;
|
||
};
|
||
|
||
|
||
tests['csstransitions'] = function() {
|
||
return testPropsAll('transition');
|
||
};
|
||
|
||
|
||
/*>>fontface*/
|
||
// @font-face detection routine by Diego Perini
|
||
// javascript.nwbox.com/CSSSupport/
|
||
|
||
// false positives:
|
||
// WebOS github.com/Modernizr/Modernizr/issues/342
|
||
// WP7 github.com/Modernizr/Modernizr/issues/538
|
||
tests['fontface'] = function() {
|
||
var bool;
|
||
|
||
injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) {
|
||
var style = document.getElementById('smodernizr'),
|
||
sheet = style.sheet || style.styleSheet,
|
||
cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : '';
|
||
|
||
bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0;
|
||
});
|
||
|
||
return bool;
|
||
};
|
||
/*>>fontface*/
|
||
|
||
// CSS generated content detection
|
||
tests['generatedcontent'] = function() {
|
||
var bool;
|
||
|
||
injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) {
|
||
bool = node.offsetHeight >= 3;
|
||
});
|
||
|
||
return bool;
|
||
};
|
||
|
||
|
||
|
||
// These tests evaluate support of the video/audio elements, as well as
|
||
// testing what types of content they support.
|
||
//
|
||
// We're using the Boolean constructor here, so that we can extend the value
|
||
// e.g. Modernizr.video // true
|
||
// Modernizr.video.ogg // 'probably'
|
||
//
|
||
// Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845
|
||
// thx to NielsLeenheer and zcorpan
|
||
|
||
// Note: in some older browsers, "no" was a return value instead of empty string.
|
||
// It was live in FF3.5.0 and 3.5.1, but fixed in 3.5.2
|
||
// It was also live in Safari 4.0.0 - 4.0.4, but fixed in 4.0.5
|
||
|
||
tests['video'] = function() {
|
||
var elem = document.createElement('video'),
|
||
bool = false;
|
||
|
||
// IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224
|
||
try {
|
||
if ( bool = !!elem.canPlayType ) {
|
||
bool = new Boolean(bool);
|
||
bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,'');
|
||
|
||
// Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546
|
||
bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,'');
|
||
|
||
bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,'');
|
||
}
|
||
|
||
} catch(e) { }
|
||
|
||
return bool;
|
||
};
|
||
|
||
tests['audio'] = function() {
|
||
var elem = document.createElement('audio'),
|
||
bool = false;
|
||
|
||
try {
|
||
if ( bool = !!elem.canPlayType ) {
|
||
bool = new Boolean(bool);
|
||
bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
|
||
bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,'');
|
||
|
||
// Mimetypes accepted:
|
||
// developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements
|
||
// bit.ly/iphoneoscodecs
|
||
bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,'');
|
||
bool.m4a = ( elem.canPlayType('audio/x-m4a;') ||
|
||
elem.canPlayType('audio/aac;')) .replace(/^no$/,'');
|
||
}
|
||
} catch(e) { }
|
||
|
||
return bool;
|
||
};
|
||
|
||
|
||
// In FF4, if disabled, window.localStorage should === null.
|
||
|
||
// Normally, we could not test that directly and need to do a
|
||
// `('localStorage' in window) && ` test first because otherwise Firefox will
|
||
// throw bugzil.la/365772 if cookies are disabled
|
||
|
||
// Also in iOS5 Private Browsing mode, attempting to use localStorage.setItem
|
||
// will throw the exception:
|
||
// QUOTA_EXCEEDED_ERRROR DOM Exception 22.
|
||
// Peculiarly, getItem and removeItem calls do not throw.
|
||
|
||
// Because we are forced to try/catch this, we'll go aggressive.
|
||
|
||
// Just FWIW: IE8 Compat mode supports these features completely:
|
||
// www.quirksmode.org/dom/html5.html
|
||
// But IE8 doesn't support either with local files
|
||
|
||
tests['localstorage'] = function() {
|
||
try {
|
||
localStorage.setItem(mod, mod);
|
||
localStorage.removeItem(mod);
|
||
return true;
|
||
} catch(e) {
|
||
return false;
|
||
}
|
||
};
|
||
|
||
tests['sessionstorage'] = function() {
|
||
try {
|
||
sessionStorage.setItem(mod, mod);
|
||
sessionStorage.removeItem(mod);
|
||
return true;
|
||
} catch(e) {
|
||
return false;
|
||
}
|
||
};
|
||
|
||
|
||
tests['webworkers'] = function() {
|
||
return !!window.Worker;
|
||
};
|
||
|
||
|
||
tests['applicationcache'] = function() {
|
||
return !!window.applicationCache;
|
||
};
|
||
|
||
|
||
// Thanks to Erik Dahlstrom
|
||
tests['svg'] = function() {
|
||
return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect;
|
||
};
|
||
|
||
// specifically for SVG inline in HTML, not within XHTML
|
||
// test page: paulirish.com/demo/inline-svg
|
||
tests['inlinesvg'] = function() {
|
||
var div = document.createElement('div');
|
||
div.innerHTML = '<svg/>';
|
||
return (div.firstChild && div.firstChild.namespaceURI) == ns.svg;
|
||
};
|
||
|
||
// SVG SMIL animation
|
||
tests['smil'] = function() {
|
||
return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
|
||
};
|
||
|
||
// This test is only for clip paths in SVG proper, not clip paths on HTML content
|
||
// demo: srufaculty.sru.edu/david.dailey/svg/newstuff/clipPath4.svg
|
||
|
||
// However read the comments to dig into applying SVG clippaths to HTML content here:
|
||
// github.com/Modernizr/Modernizr/issues/213#issuecomment-1149491
|
||
tests['svgclippaths'] = function() {
|
||
return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
|
||
};
|
||
|
||
/*>>webforms*/
|
||
// input features and input types go directly onto the ret object, bypassing the tests loop.
|
||
// Hold this guy to execute in a moment.
|
||
function webforms() {
|
||
/*>>input*/
|
||
// Run through HTML5's new input attributes to see if the UA understands any.
|
||
// We're using f which is the <input> element created early on
|
||
// Mike Taylr has created a comprehensive resource for testing these attributes
|
||
// when applied to all input types:
|
||
// miketaylr.com/code/input-type-attr.html
|
||
// spec: www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
|
||
|
||
// Only input placeholder is tested while textarea's placeholder is not.
|
||
// Currently Safari 4 and Opera 11 have support only for the input placeholder
|
||
// Both tests are available in feature-detects/forms-placeholder.js
|
||
Modernizr['input'] = (function( props ) {
|
||
for ( var i = 0, len = props.length; i < len; i++ ) {
|
||
attrs[ props[i] ] = !!(props[i] in inputElem);
|
||
}
|
||
if (attrs.list){
|
||
// safari false positive's on datalist: webk.it/74252
|
||
// see also github.com/Modernizr/Modernizr/issues/146
|
||
attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement);
|
||
}
|
||
return attrs;
|
||
})('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
|
||
/*>>input*/
|
||
|
||
/*>>inputtypes*/
|
||
// Run through HTML5's new input types to see if the UA understands any.
|
||
// This is put behind the tests runloop because it doesn't return a
|
||
// true/false like all the other tests; instead, it returns an object
|
||
// containing each input type with its corresponding true/false value
|
||
|
||
// Big thanks to @miketaylr for the html5 forms expertise. miketaylr.com/
|
||
Modernizr['inputtypes'] = (function(props) {
|
||
|
||
for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) {
|
||
|
||
inputElem.setAttribute('type', inputElemType = props[i]);
|
||
bool = inputElem.type !== 'text';
|
||
|
||
// We first check to see if the type we give it sticks..
|
||
// If the type does, we feed it a textual value, which shouldn't be valid.
|
||
// If the value doesn't stick, we know there's input sanitization which infers a custom UI
|
||
if ( bool ) {
|
||
|
||
inputElem.value = smile;
|
||
inputElem.style.cssText = 'position:absolute;visibility:hidden;';
|
||
|
||
if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) {
|
||
|
||
docElement.appendChild(inputElem);
|
||
defaultView = document.defaultView;
|
||
|
||
// Safari 2-4 allows the smiley as a value, despite making a slider
|
||
bool = defaultView.getComputedStyle &&
|
||
defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' &&
|
||
// Mobile android web browser has false positive, so must
|
||
// check the height to see if the widget is actually there.
|
||
(inputElem.offsetHeight !== 0);
|
||
|
||
docElement.removeChild(inputElem);
|
||
|
||
} else if ( /^(search|tel)$/.test(inputElemType) ){
|
||
// Spec doesn't define any special parsing or detectable UI
|
||
// behaviors so we pass these through as true
|
||
|
||
// Interestingly, opera fails the earlier test, so it doesn't
|
||
// even make it here.
|
||
|
||
} else if ( /^(url|email)$/.test(inputElemType) ) {
|
||
// Real url and email support comes with prebaked validation.
|
||
bool = inputElem.checkValidity && inputElem.checkValidity() === false;
|
||
|
||
} else {
|
||
// If the upgraded input compontent rejects the :) text, we got a winner
|
||
bool = inputElem.value != smile;
|
||
}
|
||
}
|
||
|
||
inputs[ props[i] ] = !!bool;
|
||
}
|
||
return inputs;
|
||
})('search tel url email datetime date month week time datetime-local number range color'.split(' '));
|
||
/*>>inputtypes*/
|
||
}
|
||
/*>>webforms*/
|
||
|
||
|
||
// End of test definitions
|
||
// -----------------------
|
||
|
||
|
||
|
||
// Run through all tests and detect their support in the current UA.
|
||
// todo: hypothetically we could be doing an array of tests and use a basic loop here.
|
||
for ( var feature in tests ) {
|
||
if ( hasOwnProp(tests, feature) ) {
|
||
// run the test, throw the return value into the Modernizr,
|
||
// then based on that boolean, define an appropriate className
|
||
// and push it into an array of classes we'll join later.
|
||
featureName = feature.toLowerCase();
|
||
Modernizr[featureName] = tests[feature]();
|
||
|
||
classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
|
||
}
|
||
}
|
||
|
||
/*>>webforms*/
|
||
// input tests need to run.
|
||
Modernizr.input || webforms();
|
||
/*>>webforms*/
|
||
|
||
|
||
/**
|
||
* addTest allows the user to define their own feature tests
|
||
* the result will be added onto the Modernizr object,
|
||
* as well as an appropriate className set on the html element
|
||
*
|
||
* @param feature - String naming the feature
|
||
* @param test - Function returning true if feature is supported, false if not
|
||
*/
|
||
Modernizr.addTest = function ( feature, test ) {
|
||
if ( typeof feature == 'object' ) {
|
||
for ( var key in feature ) {
|
||
if ( hasOwnProp( feature, key ) ) {
|
||
Modernizr.addTest( key, feature[ key ] );
|
||
}
|
||
}
|
||
} else {
|
||
|
||
feature = feature.toLowerCase();
|
||
|
||
if ( Modernizr[feature] !== undefined ) {
|
||
// we're going to quit if you're trying to overwrite an existing test
|
||
// if we were to allow it, we'd do this:
|
||
// var re = new RegExp("\\b(no-)?" + feature + "\\b");
|
||
// docElement.className = docElement.className.replace( re, '' );
|
||
// but, no rly, stuff 'em.
|
||
return Modernizr;
|
||
}
|
||
|
||
test = typeof test == 'function' ? test() : test;
|
||
|
||
if (typeof enableClasses !== "undefined" && enableClasses) {
|
||
docElement.className += ' ' + (test ? '' : 'no-') + feature;
|
||
}
|
||
Modernizr[feature] = test;
|
||
|
||
}
|
||
|
||
return Modernizr; // allow chaining.
|
||
};
|
||
|
||
|
||
// Reset modElem.cssText to nothing to reduce memory footprint.
|
||
setCss('');
|
||
modElem = inputElem = null;
|
||
|
||
/*>>shiv*/
|
||
/**
|
||
* @preserve HTML5 Shiv prev3.7.1 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
||
*/
|
||
;(function(window, document) {
|
||
/*jshint evil:true */
|
||
/** version */
|
||
var version = '3.7.0';
|
||
|
||
/** Preset options */
|
||
var options = window.html5 || {};
|
||
|
||
/** Used to skip problem elements */
|
||
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
|
||
|
||
/** Not all elements can be cloned in IE **/
|
||
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
|
||
|
||
/** Detect whether the browser supports default html5 styles */
|
||
var supportsHtml5Styles;
|
||
|
||
/** Name of the expando, to work with multiple documents or to re-shiv one document */
|
||
var expando = '_html5shiv';
|
||
|
||
/** The id for the the documents expando */
|
||
var expanID = 0;
|
||
|
||
/** Cached data for each document */
|
||
var expandoData = {};
|
||
|
||
/** Detect whether the browser supports unknown elements */
|
||
var supportsUnknownElements;
|
||
|
||
(function() {
|
||
try {
|
||
var a = document.createElement('a');
|
||
a.innerHTML = '<xyz></xyz>';
|
||
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
|
||
supportsHtml5Styles = ('hidden' in a);
|
||
|
||
supportsUnknownElements = a.childNodes.length == 1 || (function() {
|
||
// assign a false positive if unable to shiv
|
||
(document.createElement)('a');
|
||
var frag = document.createDocumentFragment();
|
||
return (
|
||
typeof frag.cloneNode == 'undefined' ||
|
||
typeof frag.createDocumentFragment == 'undefined' ||
|
||
typeof frag.createElement == 'undefined'
|
||
);
|
||
}());
|
||
} catch(e) {
|
||
// assign a false positive if detection fails => unable to shiv
|
||
supportsHtml5Styles = true;
|
||
supportsUnknownElements = true;
|
||
}
|
||
|
||
}());
|
||
|
||
/*--------------------------------------------------------------------------*/
|
||
|
||
/**
|
||
* Creates a style sheet with the given CSS text and adds it to the document.
|
||
* @private
|
||
* @param {Document} ownerDocument The document.
|
||
* @param {String} cssText The CSS text.
|
||
* @returns {StyleSheet} The style element.
|
||
*/
|
||
function addStyleSheet(ownerDocument, cssText) {
|
||
var p = ownerDocument.createElement('p'),
|
||
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
|
||
|
||
p.innerHTML = 'x<style>' + cssText + '</style>';
|
||
return parent.insertBefore(p.lastChild, parent.firstChild);
|
||
}
|
||
|
||
/**
|
||
* Returns the value of `html5.elements` as an array.
|
||
* @private
|
||
* @returns {Array} An array of shived element node names.
|
||
*/
|
||
function getElements() {
|
||
var elements = html5.elements;
|
||
return typeof elements == 'string' ? elements.split(' ') : elements;
|
||
}
|
||
|
||
/**
|
||
* Returns the data associated to the given document
|
||
* @private
|
||
* @param {Document} ownerDocument The document.
|
||
* @returns {Object} An object of data.
|
||
*/
|
||
function getExpandoData(ownerDocument) {
|
||
var data = expandoData[ownerDocument[expando]];
|
||
if (!data) {
|
||
data = {};
|
||
expanID++;
|
||
ownerDocument[expando] = expanID;
|
||
expandoData[expanID] = data;
|
||
}
|
||
return data;
|
||
}
|
||
|
||
/**
|
||
* returns a shived element for the given nodeName and document
|
||
* @memberOf html5
|
||
* @param {String} nodeName name of the element
|
||
* @param {Document} ownerDocument The context document.
|
||
* @returns {Object} The shived element.
|
||
*/
|
||
function createElement(nodeName, ownerDocument, data){
|
||
if (!ownerDocument) {
|
||
ownerDocument = document;
|
||
}
|
||
if(supportsUnknownElements){
|
||
return ownerDocument.createElement(nodeName);
|
||
}
|
||
if (!data) {
|
||
data = getExpandoData(ownerDocument);
|
||
}
|
||
var node;
|
||
|
||
if (data.cache[nodeName]) {
|
||
node = data.cache[nodeName].cloneNode();
|
||
} else if (saveClones.test(nodeName)) {
|
||
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
|
||
} else {
|
||
node = data.createElem(nodeName);
|
||
}
|
||
|
||
// Avoid adding some elements to fragments in IE < 9 because
|
||
// * Attributes like `name` or `type` cannot be set/changed once an element
|
||
// is inserted into a document/fragment
|
||
// * Link elements with `src` attributes that are inaccessible, as with
|
||
// a 403 response, will cause the tab/window to crash
|
||
// * Script elements appended to fragments will execute when their `src`
|
||
// or `text` property is set
|
||
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
|
||
}
|
||
|
||
/**
|
||
* returns a shived DocumentFragment for the given document
|
||
* @memberOf html5
|
||
* @param {Document} ownerDocument The context document.
|
||
* @returns {Object} The shived DocumentFragment.
|
||
*/
|
||
function createDocumentFragment(ownerDocument, data){
|
||
if (!ownerDocument) {
|
||
ownerDocument = document;
|
||
}
|
||
if(supportsUnknownElements){
|
||
return ownerDocument.createDocumentFragment();
|
||
}
|
||
data = data || getExpandoData(ownerDocument);
|
||
var clone = data.frag.cloneNode(),
|
||
i = 0,
|
||
elems = getElements(),
|
||
l = elems.length;
|
||
for(;i<l;i++){
|
||
clone.createElement(elems[i]);
|
||
}
|
||
return clone;
|
||
}
|
||
|
||
/**
|
||
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
|
||
* @private
|
||
* @param {Document|DocumentFragment} ownerDocument The document.
|
||
* @param {Object} data of the document.
|
||
*/
|
||
function shivMethods(ownerDocument, data) {
|
||
if (!data.cache) {
|
||
data.cache = {};
|
||
data.createElem = ownerDocument.createElement;
|
||
data.createFrag = ownerDocument.createDocumentFragment;
|
||
data.frag = data.createFrag();
|
||
}
|
||
|
||
|
||
ownerDocument.createElement = function(nodeName) {
|
||
//abort shiv
|
||
if (!html5.shivMethods) {
|
||
return data.createElem(nodeName);
|
||
}
|
||
return createElement(nodeName, ownerDocument, data);
|
||
};
|
||
|
||
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
|
||
'var n=f.cloneNode(),c=n.createElement;' +
|
||
'h.shivMethods&&(' +
|
||
// unroll the `createElement` calls
|
||
getElements().join().replace(/[\w\-]+/g, function(nodeName) {
|
||
data.createElem(nodeName);
|
||
data.frag.createElement(nodeName);
|
||
return 'c("' + nodeName + '")';
|
||
}) +
|
||
');return n}'
|
||
)(html5, data.frag);
|
||
}
|
||
|
||
/*--------------------------------------------------------------------------*/
|
||
|
||
/**
|
||
* Shivs the given document.
|
||
* @memberOf html5
|
||
* @param {Document} ownerDocument The document to shiv.
|
||
* @returns {Document} The shived document.
|
||
*/
|
||
function shivDocument(ownerDocument) {
|
||
if (!ownerDocument) {
|
||
ownerDocument = document;
|
||
}
|
||
var data = getExpandoData(ownerDocument);
|
||
|
||
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
|
||
data.hasCSS = !!addStyleSheet(ownerDocument,
|
||
// corrects block display not defined in IE6/7/8/9
|
||
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
|
||
// adds styling not present in IE6/7/8/9
|
||
'mark{background:#FF0;color:#000}' +
|
||
// hides non-rendered elements
|
||
'template{display:none}'
|
||
);
|
||
}
|
||
if (!supportsUnknownElements) {
|
||
shivMethods(ownerDocument, data);
|
||
}
|
||
return ownerDocument;
|
||
}
|
||
|
||
/*--------------------------------------------------------------------------*/
|
||
|
||
/**
|
||
* The `html5` object is exposed so that more elements can be shived and
|
||
* existing shiving can be detected on iframes.
|
||
* @type Object
|
||
* @example
|
||
*
|
||
* // options can be changed before the script is included
|
||
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
|
||
*/
|
||
var html5 = {
|
||
|
||
/**
|
||
* An array or space separated string of node names of the elements to shiv.
|
||
* @memberOf html5
|
||
* @type Array|String
|
||
*/
|
||
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video',
|
||
|
||
/**
|
||
* current version of html5shiv
|
||
*/
|
||
'version': version,
|
||
|
||
/**
|
||
* A flag to indicate that the HTML5 style sheet should be inserted.
|
||
* @memberOf html5
|
||
* @type Boolean
|
||
*/
|
||
'shivCSS': (options.shivCSS !== false),
|
||
|
||
/**
|
||
* Is equal to true if a browser supports creating unknown/HTML5 elements
|
||
* @memberOf html5
|
||
* @type boolean
|
||
*/
|
||
'supportsUnknownElements': supportsUnknownElements,
|
||
|
||
/**
|
||
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
|
||
* methods should be overwritten.
|
||
* @memberOf html5
|
||
* @type Boolean
|
||
*/
|
||
'shivMethods': (options.shivMethods !== false),
|
||
|
||
/**
|
||
* A string to describe the type of `html5` object ("default" or "default print").
|
||
* @memberOf html5
|
||
* @type String
|
||
*/
|
||
'type': 'default',
|
||
|
||
// shivs the document according to the specified `html5` object options
|
||
'shivDocument': shivDocument,
|
||
|
||
//creates a shived element
|
||
createElement: createElement,
|
||
|
||
//creates a shived documentFragment
|
||
createDocumentFragment: createDocumentFragment
|
||
};
|
||
|
||
/*--------------------------------------------------------------------------*/
|
||
|
||
// expose html5
|
||
window.html5 = html5;
|
||
|
||
// shiv the document
|
||
shivDocument(document);
|
||
|
||
}(this, document));
|
||
/*>>shiv*/
|
||
|
||
// Assign private properties to the return object with prefix
|
||
Modernizr._version = version;
|
||
|
||
// expose these for the plugin API. Look in the source for how to join() them against your input
|
||
/*>>prefixes*/
|
||
Modernizr._prefixes = prefixes;
|
||
/*>>prefixes*/
|
||
/*>>domprefixes*/
|
||
Modernizr._domPrefixes = domPrefixes;
|
||
Modernizr._cssomPrefixes = cssomPrefixes;
|
||
/*>>domprefixes*/
|
||
|
||
/*>>mq*/
|
||
// Modernizr.mq tests a given media query, live against the current state of the window
|
||
// A few important notes:
|
||
// * If a browser does not support media queries at all (eg. oldIE) the mq() will always return false
|
||
// * A max-width or orientation query will be evaluated against the current state, which may change later.
|
||
// * You must specify values. Eg. If you are testing support for the min-width media query use:
|
||
// Modernizr.mq('(min-width:0)')
|
||
// usage:
|
||
// Modernizr.mq('only screen and (max-width:768)')
|
||
Modernizr.mq = testMediaQuery;
|
||
/*>>mq*/
|
||
|
||
/*>>hasevent*/
|
||
// Modernizr.hasEvent() detects support for a given event, with an optional element to test on
|
||
// Modernizr.hasEvent('gesturestart', elem)
|
||
Modernizr.hasEvent = isEventSupported;
|
||
/*>>hasevent*/
|
||
|
||
/*>>testprop*/
|
||
// Modernizr.testProp() investigates whether a given style property is recognized
|
||
// Note that the property names must be provided in the camelCase variant.
|
||
// Modernizr.testProp('pointerEvents')
|
||
Modernizr.testProp = function(prop){
|
||
return testProps([prop]);
|
||
};
|
||
/*>>testprop*/
|
||
|
||
/*>>testallprops*/
|
||
// Modernizr.testAllProps() investigates whether a given style property,
|
||
// or any of its vendor-prefixed variants, is recognized
|
||
// Note that the property names must be provided in the camelCase variant.
|
||
// Modernizr.testAllProps('boxSizing')
|
||
Modernizr.testAllProps = testPropsAll;
|
||
/*>>testallprops*/
|
||
|
||
|
||
/*>>teststyles*/
|
||
// Modernizr.testStyles() allows you to add custom styles to the document and test an element afterwards
|
||
// Modernizr.testStyles('#modernizr { position:absolute }', function(elem, rule){ ... })
|
||
Modernizr.testStyles = injectElementWithStyles;
|
||
/*>>teststyles*/
|
||
|
||
|
||
/*>>prefixed*/
|
||
// Modernizr.prefixed() returns the prefixed or nonprefixed property name variant of your input
|
||
// Modernizr.prefixed('boxSizing') // 'MozBoxSizing'
|
||
|
||
// Properties must be passed as dom-style camelcase, rather than `box-sizing` hypentated style.
|
||
// Return values will also be the camelCase variant, if you need to translate that to hypenated style use:
|
||
//
|
||
// str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');
|
||
|
||
// If you're trying to ascertain which transition end event to bind to, you might do something like...
|
||
//
|
||
// var transEndEventNames = {
|
||
// 'WebkitTransition' : 'webkitTransitionEnd',
|
||
// 'MozTransition' : 'transitionend',
|
||
// 'OTransition' : 'oTransitionEnd',
|
||
// 'msTransition' : 'MSTransitionEnd',
|
||
// 'transition' : 'transitionend'
|
||
// },
|
||
// transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ];
|
||
|
||
Modernizr.prefixed = function(prop, obj, elem){
|
||
if(!obj) {
|
||
return testPropsAll(prop, 'pfx');
|
||
} else {
|
||
// Testing DOM property e.g. Modernizr.prefixed('requestAnimationFrame', window) // 'mozRequestAnimationFrame'
|
||
return testPropsAll(prop, obj, elem);
|
||
}
|
||
};
|
||
/*>>prefixed*/
|
||
|
||
|
||
/*>>cssclasses*/
|
||
// Remove "no-js" class from <html> element, if it exists:
|
||
docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +
|
||
|
||
// Add the new classes to the <html> element.
|
||
(enableClasses ? ' js ' + classes.join(' ') : '');
|
||
/*>>cssclasses*/
|
||
|
||
return Modernizr;
|
||
|
||
})(this, this.document);
|
||
|
||
/*! http://mths.be/placeholder v2.0.9 by @mathias */
|
||
(function(factory) {
|
||
if (typeof define === 'function' && define.amd) {
|
||
// AMD
|
||
define(['jquery'], factory);
|
||
} else {
|
||
// Browser globals
|
||
factory(jQuery);
|
||
}
|
||
}(function($) {
|
||
|
||
// Opera Mini v7 doesn’t support placeholder although its DOM seems to indicate so
|
||
var isOperaMini = Object.prototype.toString.call(window.operamini) == '[object OperaMini]';
|
||
var isInputSupported = 'placeholder' in document.createElement('input') && !isOperaMini;
|
||
var isTextareaSupported = 'placeholder' in document.createElement('textarea') && !isOperaMini;
|
||
var valHooks = $.valHooks;
|
||
var propHooks = $.propHooks;
|
||
var hooks;
|
||
var placeholder;
|
||
|
||
if (isInputSupported && isTextareaSupported) {
|
||
|
||
placeholder = $.fn.placeholder = function() {
|
||
return this;
|
||
};
|
||
|
||
placeholder.input = placeholder.textarea = true;
|
||
|
||
} else {
|
||
|
||
placeholder = $.fn.placeholder = function() {
|
||
var $this = this;
|
||
$this
|
||
.filter((isInputSupported ? 'textarea' : ':input') + '[placeholder]')
|
||
.not('.placeholder')
|
||
.bind({
|
||
'focus.placeholder': clearPlaceholder,
|
||
'blur.placeholder': setPlaceholder
|
||
})
|
||
.data('placeholder-enabled', true)
|
||
.trigger('blur.placeholder');
|
||
return $this;
|
||
};
|
||
|
||
placeholder.input = isInputSupported;
|
||
placeholder.textarea = isTextareaSupported;
|
||
|
||
hooks = {
|
||
'get': function(element) {
|
||
var $element = $(element);
|
||
|
||
var $passwordInput = $element.data('placeholder-password');
|
||
if ($passwordInput) {
|
||
return $passwordInput[0].value;
|
||
}
|
||
|
||
return $element.data('placeholder-enabled') && $element.hasClass('placeholder') ? '' : element.value;
|
||
},
|
||
'set': function(element, value) {
|
||
var $element = $(element);
|
||
|
||
var $passwordInput = $element.data('placeholder-password');
|
||
if ($passwordInput) {
|
||
return $passwordInput[0].value = value;
|
||
}
|
||
|
||
if (!$element.data('placeholder-enabled')) {
|
||
return element.value = value;
|
||
}
|
||
if (value === '') {
|
||
element.value = value;
|
||
// Issue #56: Setting the placeholder causes problems if the element continues to have focus.
|
||
if (element != safeActiveElement()) {
|
||
// We can't use `triggerHandler` here because of dummy text/password inputs :(
|
||
setPlaceholder.call(element);
|
||
}
|
||
} else if ($element.hasClass('placeholder')) {
|
||
clearPlaceholder.call(element, true, value) || (element.value = value);
|
||
} else {
|
||
element.value = value;
|
||
}
|
||
// `set` can not return `undefined`; see http://jsapi.info/jquery/1.7.1/val#L2363
|
||
return $element;
|
||
}
|
||
};
|
||
|
||
if (!isInputSupported) {
|
||
valHooks.input = hooks;
|
||
propHooks.value = hooks;
|
||
}
|
||
if (!isTextareaSupported) {
|
||
valHooks.textarea = hooks;
|
||
propHooks.value = hooks;
|
||
}
|
||
|
||
$(function() {
|
||
// Look for forms
|
||
$(document).delegate('form', 'submit.placeholder', function() {
|
||
// Clear the placeholder values so they don't get submitted
|
||
var $inputs = $('.placeholder', this).each(clearPlaceholder);
|
||
setTimeout(function() {
|
||
$inputs.each(setPlaceholder);
|
||
}, 10);
|
||
});
|
||
});
|
||
|
||
// Clear placeholder values upon page reload
|
||
$(window).bind('beforeunload.placeholder', function() {
|
||
$('.placeholder').each(function() {
|
||
this.value = '';
|
||
});
|
||
});
|
||
|
||
}
|
||
|
||
function args(elem) {
|
||
// Return an object of element attributes
|
||
var newAttrs = {};
|
||
var rinlinejQuery = /^jQuery\d+$/;
|
||
$.each(elem.attributes, function(i, attr) {
|
||
if (attr.specified && !rinlinejQuery.test(attr.name)) {
|
||
newAttrs[attr.name] = attr.value;
|
||
}
|
||
});
|
||
return newAttrs;
|
||
}
|
||
|
||
function clearPlaceholder(event, value) {
|
||
var input = this;
|
||
var $input = $(input);
|
||
if (input.value == $input.attr('placeholder') && $input.hasClass('placeholder')) {
|
||
if ($input.data('placeholder-password')) {
|
||
$input = $input.hide().nextAll('input[type="password"]:first').show().attr('id', $input.removeAttr('id').data('placeholder-id'));
|
||
// If `clearPlaceholder` was called from `$.valHooks.input.set`
|
||
if (event === true) {
|
||
return $input[0].value = value;
|
||
}
|
||
$input.focus();
|
||
} else {
|
||
input.value = '';
|
||
$input.removeClass('placeholder');
|
||
input == safeActiveElement() && input.select();
|
||
}
|
||
}
|
||
}
|
||
|
||
function setPlaceholder() {
|
||
var $replacement;
|
||
var input = this;
|
||
var $input = $(input);
|
||
var id = this.id;
|
||
if (input.value === '') {
|
||
if (input.type === 'password') {
|
||
if (!$input.data('placeholder-textinput')) {
|
||
try {
|
||
$replacement = $input.clone().attr({ 'type': 'text' });
|
||
} catch(e) {
|
||
$replacement = $('<input>').attr($.extend(args(this), { 'type': 'text' }));
|
||
}
|
||
$replacement
|
||
.removeAttr('name')
|
||
.data({
|
||
'placeholder-password': $input,
|
||
'placeholder-id': id
|
||
})
|
||
.bind('focus.placeholder', clearPlaceholder);
|
||
$input
|
||
.data({
|
||
'placeholder-textinput': $replacement,
|
||
'placeholder-id': id
|
||
})
|
||
.before($replacement);
|
||
}
|
||
$input = $input.removeAttr('id').hide().prevAll('input[type="text"]:first').attr('id', id).show();
|
||
// Note: `$input[0] != input` now!
|
||
}
|
||
$input.addClass('placeholder');
|
||
$input[0].value = $input.attr('placeholder');
|
||
} else {
|
||
$input.removeClass('placeholder');
|
||
}
|
||
}
|
||
|
||
function safeActiveElement() {
|
||
// Avoid IE9 `document.activeElement` of death
|
||
// https://github.com/mathiasbynens/jquery-placeholder/pull/99
|
||
try {
|
||
return document.activeElement;
|
||
} catch (exception) {}
|
||
}
|
||
|
||
}));
|
||
|
||
/*
|
||
_ _ _ _
|
||
___| (_) ___| | __ (_)___
|
||
/ __| | |/ __| |/ / | / __|
|
||
\__ \ | | (__| < _ | \__ \
|
||
|___/_|_|\___|_|\_(_)/ |___/
|
||
|__/
|
||
|
||
Version: 1.5.5
|
||
Author: Ken Wheeler
|
||
Website: http://kenwheeler.github.io
|
||
Docs: http://kenwheeler.github.io/slick
|
||
Repo: http://github.com/kenwheeler/slick
|
||
Issues: http://github.com/kenwheeler/slick/issues
|
||
|
||
*/
|
||
!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"undefined"!=typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";var b=window.Slick||{};b=function(){function c(c,d){var f,g,h,e=this;if(e.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:a(c),appendDots:a(c),arrows:!0,asNavFor:null,prevArrow:'<button type="button" data-role="none" class="slick-prev" aria-label="previous">Previous</button>',nextArrow:'<button type="button" data-role="none" class="slick-next" aria-label="next">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(a,b){return'<button type="button" data-role="none">'+(b+1)+"</button>"},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0},e.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},a.extend(e,e.initials),e.activeBreakpoint=null,e.animType=null,e.animProp=null,e.breakpoints=[],e.breakpointSettings=[],e.cssTransitions=!1,e.hidden="hidden",e.paused=!1,e.positionProp=null,e.respondTo=null,e.rowCount=1,e.shouldClick=!0,e.$slider=a(c),e.$slidesCache=null,e.transformType=null,e.transitionType=null,e.visibilityChange="visibilitychange",e.windowWidth=0,e.windowTimer=null,f=a(c).data("slick")||{},e.options=a.extend({},e.defaults,f,d),e.currentSlide=e.options.initialSlide,e.originalSettings=e.options,g=e.options.responsive||null,g&&g.length>-1){e.respondTo=e.options.respondTo||"window";for(h in g)g.hasOwnProperty(h)&&(e.breakpoints.push(g[h].breakpoint),e.breakpointSettings[g[h].breakpoint]=g[h].settings);e.breakpoints.sort(function(a,b){return e.options.mobileFirst===!0?a-b:b-a})}"undefined"!=typeof document.mozHidden?(e.hidden="mozHidden",e.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e.autoPlay=a.proxy(e.autoPlay,e),e.autoPlayClear=a.proxy(e.autoPlayClear,e),e.changeSlide=a.proxy(e.changeSlide,e),e.clickHandler=a.proxy(e.clickHandler,e),e.selectHandler=a.proxy(e.selectHandler,e),e.setPosition=a.proxy(e.setPosition,e),e.swipeHandler=a.proxy(e.swipeHandler,e),e.dragHandler=a.proxy(e.dragHandler,e),e.keyHandler=a.proxy(e.keyHandler,e),e.autoPlayIterator=a.proxy(e.autoPlayIterator,e),e.instanceUid=b++,e.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,e.init(!0),e.checkResponsive(!0)}var b=0;return c}(),b.prototype.addSlide=b.prototype.slickAdd=function(b,c,d){var e=this;if("boolean"==typeof c)d=c,c=null;else if(0>c||c>=e.slideCount)return!1;e.unload(),"number"==typeof c?0===c&&0===e.$slides.length?a(b).appendTo(e.$slideTrack):d?a(b).insertBefore(e.$slides.eq(c)):a(b).insertAfter(e.$slides.eq(c)):d===!0?a(b).prependTo(e.$slideTrack):a(b).appendTo(e.$slideTrack),e.$slides=e.$slideTrack.children(this.options.slide),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.append(e.$slides),e.$slides.each(function(b,c){a(c).attr("data-slick-index",b)}),e.$slidesCache=e.$slides,e.reinit()},b.prototype.animateHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.animate({height:b},a.options.speed)}},b.prototype.animateSlide=function(b,c){var d={},e=this;e.animateHeight(),e.options.rtl===!0&&e.options.vertical===!1&&(b=-b),e.transformsEnabled===!1?e.options.vertical===!1?e.$slideTrack.animate({left:b},e.options.speed,e.options.easing,c):e.$slideTrack.animate({top:b},e.options.speed,e.options.easing,c):e.cssTransitions===!1?(e.options.rtl===!0&&(e.currentLeft=-e.currentLeft),a({animStart:e.currentLeft}).animate({animStart:b},{duration:e.options.speed,easing:e.options.easing,step:function(a){a=Math.ceil(a),e.options.vertical===!1?(d[e.animType]="translate("+a+"px, 0px)",e.$slideTrack.css(d)):(d[e.animType]="translate(0px,"+a+"px)",e.$slideTrack.css(d))},complete:function(){c&&c.call()}})):(e.applyTransition(),b=Math.ceil(b),d[e.animType]=e.options.vertical===!1?"translate3d("+b+"px, 0px, 0px)":"translate3d(0px,"+b+"px, 0px)",e.$slideTrack.css(d),c&&setTimeout(function(){e.disableTransition(),c.call()},e.options.speed))},b.prototype.asNavFor=function(b){var c=this,d=c.options.asNavFor;d&&null!==d&&(d=a(d).not(c.$slider)),null!==d&&"object"==typeof d&&d.each(function(){var c=a(this).slick("getSlick");c.unslicked||c.slideHandler(b,!0)})},b.prototype.applyTransition=function(a){var b=this,c={};c[b.transitionType]=b.options.fade===!1?b.transformType+" "+b.options.speed+"ms "+b.options.cssEase:"opacity "+b.options.speed+"ms "+b.options.cssEase,b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.autoPlay=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer),a.slideCount>a.options.slidesToShow&&a.paused!==!0&&(a.autoPlayTimer=setInterval(a.autoPlayIterator,a.options.autoplaySpeed))},b.prototype.autoPlayClear=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer)},b.prototype.autoPlayIterator=function(){var a=this;a.options.infinite===!1?1===a.direction?(a.currentSlide+1===a.slideCount-1&&(a.direction=0),a.slideHandler(a.currentSlide+a.options.slidesToScroll)):(0===a.currentSlide-1&&(a.direction=1),a.slideHandler(a.currentSlide-a.options.slidesToScroll)):a.slideHandler(a.currentSlide+a.options.slidesToScroll)},b.prototype.buildArrows=function(){var b=this;b.options.arrows===!0&&b.slideCount>b.options.slidesToShow&&(b.$prevArrow=a(b.options.prevArrow),b.$nextArrow=a(b.options.nextArrow),b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.appendTo(b.options.appendArrows),b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.appendTo(b.options.appendArrows),b.options.infinite!==!0&&b.$prevArrow.addClass("slick-disabled"))},b.prototype.buildDots=function(){var c,d,b=this;if(b.options.dots===!0&&b.slideCount>b.options.slidesToShow){for(d='<ul class="'+b.options.dotsClass+'">',c=0;c<=b.getDotCount();c+=1)d+="<li>"+b.options.customPaging.call(this,b,c)+"</li>";d+="</ul>",b.$dots=a(d).appendTo(b.options.appendDots),b.$dots.find("li").first().addClass("slick-active").attr("aria-hidden","false")}},b.prototype.buildOut=function(){var b=this;b.$slides=b.$slider.children(":not(.slick-cloned)").addClass("slick-slide"),b.slideCount=b.$slides.length,b.$slides.each(function(b,c){a(c).attr("data-slick-index",b).data("originalStyling",a(c).attr("style")||"")}),b.$slidesCache=b.$slides,b.$slider.addClass("slick-slider"),b.$slideTrack=0===b.slideCount?a('<div class="slick-track"/>').appendTo(b.$slider):b.$slides.wrapAll('<div class="slick-track"/>').parent(),b.$list=b.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent(),b.$slideTrack.css("opacity",0),(b.options.centerMode===!0||b.options.swipeToSlide===!0)&&(b.options.slidesToScroll=1),a("img[data-lazy]",b.$slider).not("[src]").addClass("slick-loading"),b.setupInfinite(),b.buildArrows(),b.buildDots(),b.updateDots(),b.options.accessibility===!0&&b.$list.prop("tabIndex",0),b.setSlideClasses("number"==typeof this.currentSlide?this.currentSlide:0),b.options.draggable===!0&&b.$list.addClass("draggable")},b.prototype.buildRows=function(){var b,c,d,e,f,g,h,a=this;if(e=document.createDocumentFragment(),g=a.$slider.children(),a.options.rows>1){for(h=a.options.slidesPerRow*a.options.rows,f=Math.ceil(g.length/h),b=0;f>b;b++){var i=document.createElement("div");for(c=0;c<a.options.rows;c++){var j=document.createElement("div");for(d=0;d<a.options.slidesPerRow;d++){var k=b*h+(c*a.options.slidesPerRow+d);g.get(k)&&j.appendChild(g.get(k))}i.appendChild(j)}e.appendChild(i)}a.$slider.html(e),a.$slider.children().children().children().css({width:100/a.options.slidesPerRow+"%",display:"inline-block"})}},b.prototype.checkResponsive=function(b){var d,e,f,c=this,g=!1,h=c.$slider.width(),i=window.innerWidth||a(window).width();if("window"===c.respondTo?f=i:"slider"===c.respondTo?f=h:"min"===c.respondTo&&(f=Math.min(i,h)),c.originalSettings.responsive&&c.originalSettings.responsive.length>-1&&null!==c.originalSettings.responsive){e=null;for(d in c.breakpoints)c.breakpoints.hasOwnProperty(d)&&(c.originalSettings.mobileFirst===!1?f<c.breakpoints[d]&&(e=c.breakpoints[d]):f>c.breakpoints[d]&&(e=c.breakpoints[d]));null!==e?null!==c.activeBreakpoint?e!==c.activeBreakpoint&&(c.activeBreakpoint=e,"unslick"===c.breakpointSettings[e]?c.unslick(e):(c.options=a.extend({},c.originalSettings,c.breakpointSettings[e]),b===!0&&(c.currentSlide=c.options.initialSlide),c.refresh(b)),g=e):(c.activeBreakpoint=e,"unslick"===c.breakpointSettings[e]?c.unslick(e):(c.options=a.extend({},c.originalSettings,c.breakpointSettings[e]),b===!0&&(c.currentSlide=c.options.initialSlide),c.refresh(b)),g=e):null!==c.activeBreakpoint&&(c.activeBreakpoint=null,c.options=c.originalSettings,b===!0&&(c.currentSlide=c.options.initialSlide),c.refresh(b),g=e),b||g===!1||c.$slider.trigger("breakpoint",[c,g])}},b.prototype.changeSlide=function(b,c){var f,g,h,d=this,e=a(b.target);switch(e.is("a")&&b.preventDefault(),e.is("li")||(e=e.closest("li")),h=0!==d.slideCount%d.options.slidesToScroll,f=h?0:(d.slideCount-d.currentSlide)%d.options.slidesToScroll,b.data.message){case"previous":g=0===f?d.options.slidesToScroll:d.options.slidesToShow-f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide-g,!1,c);break;case"next":g=0===f?d.options.slidesToScroll:f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide+g,!1,c);break;case"index":var i=0===b.data.index?0:b.data.index||e.index()*d.options.slidesToScroll;d.slideHandler(d.checkNavigable(i),!1,c),e.children().trigger("focus");break;default:return}},b.prototype.checkNavigable=function(a){var c,d,b=this;if(c=b.getNavigableIndexes(),d=0,a>c[c.length-1])a=c[c.length-1];else for(var e in c){if(a<c[e]){a=d;break}d=c[e]}return a},b.prototype.cleanUpEvents=function(){var b=this;b.options.dots&&null!==b.$dots&&(a("li",b.$dots).off("click.slick",b.changeSlide),b.options.pauseOnDotsHover===!0&&b.options.autoplay===!0&&a("li",b.$dots).off("mouseenter.slick",a.proxy(b.setPaused,b,!0)).off("mouseleave.slick",a.proxy(b.setPaused,b,!1))),b.options.arrows===!0&&b.slideCount>b.options.slidesToShow&&(b.$prevArrow&&b.$prevArrow.off("click.slick",b.changeSlide),b.$nextArrow&&b.$nextArrow.off("click.slick",b.changeSlide)),b.$list.off("touchstart.slick mousedown.slick",b.swipeHandler),b.$list.off("touchmove.slick mousemove.slick",b.swipeHandler),b.$list.off("touchend.slick mouseup.slick",b.swipeHandler),b.$list.off("touchcancel.slick mouseleave.slick",b.swipeHandler),b.$list.off("click.slick",b.clickHandler),a(document).off(b.visibilityChange,b.visibility),b.$list.off("mouseenter.slick",a.proxy(b.setPaused,b,!0)),b.$list.off("mouseleave.slick",a.proxy(b.setPaused,b,!1)),b.options.accessibility===!0&&b.$list.off("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().off("click.slick",b.selectHandler),a(window).off("orientationchange.slick.slick-"+b.instanceUid,b.orientationChange),a(window).off("resize.slick.slick-"+b.instanceUid,b.resize),a("[draggable!=true]",b.$slideTrack).off("dragstart",b.preventDefault),a(window).off("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).off("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.cleanUpRows=function(){var b,a=this;a.options.rows>1&&(b=a.$slides.children().children(),b.removeAttr("style"),a.$slider.html(b))},b.prototype.clickHandler=function(a){var b=this;b.shouldClick===!1&&(a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault())},b.prototype.destroy=function(b){var c=this;c.autoPlayClear(),c.touchObject={},c.cleanUpEvents(),a(".slick-cloned",c.$slider).detach(),c.$dots&&c.$dots.remove(),c.$prevArrow&&"object"!=typeof c.options.prevArrow&&c.$prevArrow.remove(),c.$nextArrow&&"object"!=typeof c.options.nextArrow&&c.$nextArrow.remove(),c.$slides&&(c.$slides.removeClass("slick-slide slick-active slick-center slick-visible").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){a(this).attr("style",a(this).data("originalStyling"))}),c.$slideTrack.children(this.options.slide).detach(),c.$slideTrack.detach(),c.$list.detach(),c.$slider.append(c.$slides)),c.cleanUpRows(),c.$slider.removeClass("slick-slider"),c.$slider.removeClass("slick-initialized"),c.unslicked=!0,b||c.$slider.trigger("destroy",[c])},b.prototype.disableTransition=function(a){var b=this,c={};c[b.transitionType]="",b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.fadeSlide=function(a,b){var c=this;c.cssTransitions===!1?(c.$slides.eq(a).css({zIndex:1e3}),c.$slides.eq(a).animate({opacity:1},c.options.speed,c.options.easing,b)):(c.applyTransition(a),c.$slides.eq(a).css({opacity:1,zIndex:1e3}),b&&setTimeout(function(){c.disableTransition(a),b.call()},c.options.speed))},b.prototype.filterSlides=b.prototype.slickFilter=function(a){var b=this;null!==a&&(b.unload(),b.$slideTrack.children(this.options.slide).detach(),b.$slidesCache.filter(a).appendTo(b.$slideTrack),b.reinit())},b.prototype.getCurrent=b.prototype.slickCurrentSlide=function(){var a=this;return a.currentSlide},b.prototype.getDotCount=function(){var a=this,b=0,c=0,d=0;if(a.options.infinite===!0)for(;b<a.slideCount;)++d,b=c+a.options.slidesToShow,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;else if(a.options.centerMode===!0)d=a.slideCount;else for(;b<a.slideCount;)++d,b=c+a.options.slidesToShow,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;return d-1},b.prototype.getLeft=function(a){var c,d,f,b=this,e=0;return b.slideOffset=0,d=b.$slides.first().outerHeight(),b.options.infinite===!0?(b.slideCount>b.options.slidesToShow&&(b.slideOffset=-1*b.slideWidth*b.options.slidesToShow,e=-1*d*b.options.slidesToShow),0!==b.slideCount%b.options.slidesToScroll&&a+b.options.slidesToScroll>b.slideCount&&b.slideCount>b.options.slidesToShow&&(a>b.slideCount?(b.slideOffset=-1*(b.options.slidesToShow-(a-b.slideCount))*b.slideWidth,e=-1*(b.options.slidesToShow-(a-b.slideCount))*d):(b.slideOffset=-1*b.slideCount%b.options.slidesToScroll*b.slideWidth,e=-1*b.slideCount%b.options.slidesToScroll*d))):a+b.options.slidesToShow>b.slideCount&&(b.slideOffset=(a+b.options.slidesToShow-b.slideCount)*b.slideWidth,e=(a+b.options.slidesToShow-b.slideCount)*d),b.slideCount<=b.options.slidesToShow&&(b.slideOffset=0,e=0),b.options.centerMode===!0&&b.options.infinite===!0?b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)-b.slideWidth:b.options.centerMode===!0&&(b.slideOffset=0,b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)),c=b.options.vertical===!1?-1*a*b.slideWidth+b.slideOffset:-1*a*d+e,b.options.variableWidth===!0&&(f=b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow),c=f[0]?-1*f[0].offsetLeft:0,b.options.centerMode===!0&&(f=b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow+1),c=f[0]?-1*f[0].offsetLeft:0,c+=(b.$list.width()-f.outerWidth())/2)),c},b.prototype.getOption=b.prototype.slickGetOption=function(a){var b=this;return b.options[a]},b.prototype.getNavigableIndexes=function(){var e,a=this,b=0,c=0,d=[];for(a.options.infinite===!1?e=a.slideCount:(b=-1*a.options.slidesToScroll,c=-1*a.options.slidesToScroll,e=2*a.slideCount);e>b;)d.push(b),b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;return d},b.prototype.getSlick=function(){return this},b.prototype.getSlideCount=function(){var c,d,e,b=this;return e=b.options.centerMode===!0?b.slideWidth*Math.floor(b.options.slidesToShow/2):0,b.options.swipeToSlide===!0?(b.$slideTrack.find(".slick-slide").each(function(c,f){return f.offsetLeft-e+a(f).outerWidth()/2>-1*b.swipeLeft?(d=f,!1):void 0}),c=Math.abs(a(d).attr("data-slick-index")-b.currentSlide)||1):b.options.slidesToScroll},b.prototype.goTo=b.prototype.slickGoTo=function(a,b){var c=this;c.changeSlide({data:{message:"index",index:parseInt(a)}},b)},b.prototype.init=function(b){var c=this;a(c.$slider).hasClass("slick-initialized")||(a(c.$slider).addClass("slick-initialized"),c.buildRows(),c.buildOut(),c.setProps(),c.startLoad(),c.loadSlider(),c.initializeEvents(),c.updateArrows(),c.updateDots()),b&&c.$slider.trigger("init",[c])},b.prototype.initArrowEvents=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.on("click.slick",{message:"previous"},a.changeSlide),a.$nextArrow.on("click.slick",{message:"next"},a.changeSlide))},b.prototype.initDotEvents=function(){var b=this;b.options.dots===!0&&b.slideCount>b.options.slidesToShow&&a("li",b.$dots).on("click.slick",{message:"index"},b.changeSlide),b.options.dots===!0&&b.options.pauseOnDotsHover===!0&&b.options.autoplay===!0&&a("li",b.$dots).on("mouseenter.slick",a.proxy(b.setPaused,b,!0)).on("mouseleave.slick",a.proxy(b.setPaused,b,!1))},b.prototype.initializeEvents=function(){var b=this;b.initArrowEvents(),b.initDotEvents(),b.$list.on("touchstart.slick mousedown.slick",{action:"start"},b.swipeHandler),b.$list.on("touchmove.slick mousemove.slick",{action:"move"},b.swipeHandler),b.$list.on("touchend.slick mouseup.slick",{action:"end"},b.swipeHandler),b.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},b.swipeHandler),b.$list.on("click.slick",b.clickHandler),a(document).on(b.visibilityChange,a.proxy(b.visibility,b)),b.$list.on("mouseenter.slick",a.proxy(b.setPaused,b,!0)),b.$list.on("mouseleave.slick",a.proxy(b.setPaused,b,!1)),b.options.accessibility===!0&&b.$list.on("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),a(window).on("orientationchange.slick.slick-"+b.instanceUid,a.proxy(b.orientationChange,b)),a(window).on("resize.slick.slick-"+b.instanceUid,a.proxy(b.resize,b)),a("[draggable!=true]",b.$slideTrack).on("dragstart",b.preventDefault),a(window).on("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).on("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.initUI=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.show(),a.$nextArrow.show()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.show(),a.options.autoplay===!0&&a.autoPlay()},b.prototype.keyHandler=function(a){var b=this;37===a.keyCode&&b.options.accessibility===!0?b.changeSlide({data:{message:"previous"}}):39===a.keyCode&&b.options.accessibility===!0&&b.changeSlide({data:{message:"next"}})},b.prototype.lazyLoad=function(){function g(b){a("img[data-lazy]",b).each(function(){var b=a(this),c=a(this).attr("data-lazy"),d=document.createElement("img");d.onload=function(){b.animate({opacity:1},200)},d.src=c,b.css({opacity:0}).attr("src",c).removeAttr("data-lazy").removeClass("slick-loading")})}var c,d,e,f,b=this;b.options.centerMode===!0?b.options.infinite===!0?(e=b.currentSlide+(b.options.slidesToShow/2+1),f=e+b.options.slidesToShow+2):(e=Math.max(0,b.currentSlide-(b.options.slidesToShow/2+1)),f=2+(b.options.slidesToShow/2+1)+b.currentSlide):(e=b.options.infinite?b.options.slidesToShow+b.currentSlide:b.currentSlide,f=e+b.options.slidesToShow,b.options.fade===!0&&(e>0&&e--,f<=b.slideCount&&f++)),c=b.$slider.find(".slick-slide").slice(e,f),g(c),b.slideCount<=b.options.slidesToShow?(d=b.$slider.find(".slick-slide"),g(d)):b.currentSlide>=b.slideCount-b.options.slidesToShow?(d=b.$slider.find(".slick-cloned").slice(0,b.options.slidesToShow),g(d)):0===b.currentSlide&&(d=b.$slider.find(".slick-cloned").slice(-1*b.options.slidesToShow),g(d))},b.prototype.loadSlider=function(){var a=this;a.setPosition(),a.$slideTrack.css({opacity:1}),a.$slider.removeClass("slick-loading"),a.initUI(),"progressive"===a.options.lazyLoad&&a.progressiveLazyLoad()},b.prototype.next=b.prototype.slickNext=function(){var a=this;a.changeSlide({data:{message:"next"}})},b.prototype.orientationChange=function(){var a=this;a.checkResponsive(),a.setPosition()},b.prototype.pause=b.prototype.slickPause=function(){var a=this;a.autoPlayClear(),a.paused=!0},b.prototype.play=b.prototype.slickPlay=function(){var a=this;a.paused=!1,a.autoPlay()},b.prototype.postSlide=function(a){var b=this;b.$slider.trigger("afterChange",[b,a]),b.animating=!1,b.setPosition(),b.swipeLeft=null,b.options.autoplay===!0&&b.paused===!1&&b.autoPlay()},b.prototype.prev=b.prototype.slickPrev=function(){var a=this;a.changeSlide({data:{message:"previous"}})},b.prototype.preventDefault=function(a){a.preventDefault()},b.prototype.progressiveLazyLoad=function(){var c,d,b=this;c=a("img[data-lazy]",b.$slider).length,c>0&&(d=a("img[data-lazy]",b.$slider).first(),d.attr("src",d.attr("data-lazy")).removeClass("slick-loading").load(function(){d.removeAttr("data-lazy"),b.progressiveLazyLoad(),b.options.adaptiveHeight===!0&&b.setPosition()}).error(function(){d.removeAttr("data-lazy"),b.progressiveLazyLoad()}))},b.prototype.refresh=function(b){var c=this,d=c.currentSlide;c.destroy(!0),a.extend(c,c.initials),c.init(),b||c.changeSlide({data:{message:"index",index:d}},!1)},b.prototype.reinit=function(){var b=this;b.$slides=b.$slideTrack.children(b.options.slide).addClass("slick-slide"),b.slideCount=b.$slides.length,b.currentSlide>=b.slideCount&&0!==b.currentSlide&&(b.currentSlide=b.currentSlide-b.options.slidesToScroll),b.slideCount<=b.options.slidesToShow&&(b.currentSlide=0),b.setProps(),b.setupInfinite(),b.buildArrows(),b.updateArrows(),b.initArrowEvents(),b.buildDots(),b.updateDots(),b.initDotEvents(),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),b.setSlideClasses(0),b.setPosition(),b.$slider.trigger("reInit",[b])},b.prototype.resize=function(){var b=this;a(window).width()!==b.windowWidth&&(clearTimeout(b.windowDelay),b.windowDelay=window.setTimeout(function(){b.windowWidth=a(window).width(),b.checkResponsive(),b.unslicked||b.setPosition()},50))},b.prototype.removeSlide=b.prototype.slickRemove=function(a,b,c){var d=this;return"boolean"==typeof a?(b=a,a=b===!0?0:d.slideCount-1):a=b===!0?--a:a,d.slideCount<1||0>a||a>d.slideCount-1?!1:(d.unload(),c===!0?d.$slideTrack.children().remove():d.$slideTrack.children(this.options.slide).eq(a).remove(),d.$slides=d.$slideTrack.children(this.options.slide),d.$slideTrack.children(this.options.slide).detach(),d.$slideTrack.append(d.$slides),d.$slidesCache=d.$slides,d.reinit(),void 0)},b.prototype.setCSS=function(a){var d,e,b=this,c={};b.options.rtl===!0&&(a=-a),d="left"==b.positionProp?Math.ceil(a)+"px":"0px",e="top"==b.positionProp?Math.ceil(a)+"px":"0px",c[b.positionProp]=a,b.transformsEnabled===!1?b.$slideTrack.css(c):(c={},b.cssTransitions===!1?(c[b.animType]="translate("+d+", "+e+")",b.$slideTrack.css(c)):(c[b.animType]="translate3d("+d+", "+e+", 0px)",b.$slideTrack.css(c)))},b.prototype.setDimensions=function(){var a=this;a.options.vertical===!1?a.options.centerMode===!0&&a.$list.css({padding:"0px "+a.options.centerPadding}):(a.$list.height(a.$slides.first().outerHeight(!0)*a.options.slidesToShow),a.options.centerMode===!0&&a.$list.css({padding:a.options.centerPadding+" 0px"})),a.listWidth=a.$list.width(),a.listHeight=a.$list.height(),a.options.vertical===!1&&a.options.variableWidth===!1?(a.slideWidth=Math.ceil(a.listWidth/a.options.slidesToShow),a.$slideTrack.width(Math.ceil(a.slideWidth*a.$slideTrack.children(".slick-slide").length))):a.options.variableWidth===!0?a.$slideTrack.width(5e3*a.slideCount):(a.slideWidth=Math.ceil(a.listWidth),a.$slideTrack.height(Math.ceil(a.$slides.first().outerHeight(!0)*a.$slideTrack.children(".slick-slide").length)));var b=a.$slides.first().outerWidth(!0)-a.$slides.first().width();a.options.variableWidth===!1&&a.$slideTrack.children(".slick-slide").width(a.slideWidth-b)},b.prototype.setFade=function(){var c,b=this;b.$slides.each(function(d,e){c=-1*b.slideWidth*d,b.options.rtl===!0?a(e).css({position:"relative",right:c,top:0,zIndex:800,opacity:0}):a(e).css({position:"relative",left:c,top:0,zIndex:800,opacity:0})}),b.$slides.eq(b.currentSlide).css({zIndex:900,opacity:1})},b.prototype.setHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.css("height",b)}},b.prototype.setOption=b.prototype.slickSetOption=function(a,b,c){var d=this;d.options[a]=b,c===!0&&(d.unload(),d.reinit())},b.prototype.setPosition=function(){var a=this;a.setDimensions(),a.setHeight(),a.options.fade===!1?a.setCSS(a.getLeft(a.currentSlide)):a.setFade(),a.$slider.trigger("setPosition",[a])},b.prototype.setProps=function(){var a=this,b=document.body.style;a.positionProp=a.options.vertical===!0?"top":"left","top"===a.positionProp?a.$slider.addClass("slick-vertical"):a.$slider.removeClass("slick-vertical"),(void 0!==b.WebkitTransition||void 0!==b.MozTransition||void 0!==b.msTransition)&&a.options.useCSS===!0&&(a.cssTransitions=!0),void 0!==b.OTransform&&(a.animType="OTransform",a.transformType="-o-transform",a.transitionType="OTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.MozTransform&&(a.animType="MozTransform",a.transformType="-moz-transform",a.transitionType="MozTransition",void 0===b.perspectiveProperty&&void 0===b.MozPerspective&&(a.animType=!1)),void 0!==b.webkitTransform&&(a.animType="webkitTransform",a.transformType="-webkit-transform",a.transitionType="webkitTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.msTransform&&(a.animType="msTransform",a.transformType="-ms-transform",a.transitionType="msTransition",void 0===b.msTransform&&(a.animType=!1)),void 0!==b.transform&&a.animType!==!1&&(a.animType="transform",a.transformType="transform",a.transitionType="transition"),a.transformsEnabled=null!==a.animType&&a.animType!==!1},b.prototype.setSlideClasses=function(a){var c,d,e,f,b=this;b.$slider.find(".slick-slide").removeClass("slick-active").attr("aria-hidden","true").removeClass("slick-center"),d=b.$slider.find(".slick-slide"),b.options.centerMode===!0?(c=Math.floor(b.options.slidesToShow/2),b.options.infinite===!0&&(a>=c&&a<=b.slideCount-1-c?b.$slides.slice(a-c,a+c+1).addClass("slick-active").attr("aria-hidden","false"):(e=b.options.slidesToShow+a,d.slice(e-c+1,e+c+2).addClass("slick-active").attr("aria-hidden","false")),0===a?d.eq(d.length-1-b.options.slidesToShow).addClass("slick-center"):a===b.slideCount-1&&d.eq(b.options.slidesToShow).addClass("slick-center")),b.$slides.eq(a).addClass("slick-center")):a>=0&&a<=b.slideCount-b.options.slidesToShow?b.$slides.slice(a,a+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):d.length<=b.options.slidesToShow?d.addClass("slick-active").attr("aria-hidden","false"):(f=b.slideCount%b.options.slidesToShow,e=b.options.infinite===!0?b.options.slidesToShow+a:a,b.options.slidesToShow==b.options.slidesToScroll&&b.slideCount-a<b.options.slidesToShow?d.slice(e-(b.options.slidesToShow-f),e+f).addClass("slick-active").attr("aria-hidden","false"):d.slice(e,e+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")),"ondemand"===b.options.lazyLoad&&b.lazyLoad()},b.prototype.setupInfinite=function(){var c,d,e,b=this;if(b.options.fade===!0&&(b.options.centerMode=!1),b.options.infinite===!0&&b.options.fade===!1&&(d=null,b.slideCount>b.options.slidesToShow)){for(e=b.options.centerMode===!0?b.options.slidesToShow+1:b.options.slidesToShow,c=b.slideCount;c>b.slideCount-e;c-=1)d=c-1,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d-b.slideCount).prependTo(b.$slideTrack).addClass("slick-cloned");for(c=0;e>c;c+=1)d=c,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d+b.slideCount).appendTo(b.$slideTrack).addClass("slick-cloned");b.$slideTrack.find(".slick-cloned").find("[id]").each(function(){a(this).attr("id","")})}},b.prototype.setPaused=function(a){var b=this;b.options.autoplay===!0&&b.options.pauseOnHover===!0&&(b.paused=a,a?b.autoPlayClear():b.autoPlay())},b.prototype.selectHandler=function(b){var c=this,d=a(b.target).is(".slick-slide")?a(b.target):a(b.target).parents(".slick-slide"),e=parseInt(d.attr("data-slick-index"));return e||(e=0),c.slideCount<=c.options.slidesToShow?(c.$slider.find(".slick-slide").removeClass("slick-active").attr("aria-hidden","true"),c.$slides.eq(e).addClass("slick-active").attr("aria-hidden","false"),c.options.centerMode===!0&&(c.$slider.find(".slick-slide").removeClass("slick-center"),c.$slides.eq(e).addClass("slick-center")),c.asNavFor(e),void 0):(c.slideHandler(e),void 0)},b.prototype.slideHandler=function(a,b,c){var d,e,f,g,h=null,i=this;return b=b||!1,i.animating===!0&&i.options.waitForAnimate===!0||i.options.fade===!0&&i.currentSlide===a||i.slideCount<=i.options.slidesToShow?void 0:(b===!1&&i.asNavFor(a),d=a,h=i.getLeft(d),g=i.getLeft(i.currentSlide),i.currentLeft=null===i.swipeLeft?g:i.swipeLeft,i.options.infinite===!1&&i.options.centerMode===!1&&(0>a||a>i.getDotCount()*i.options.slidesToScroll)?(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d)),void 0):i.options.infinite===!1&&i.options.centerMode===!0&&(0>a||a>i.slideCount-i.options.slidesToScroll)?(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d)),void 0):(i.options.autoplay===!0&&clearInterval(i.autoPlayTimer),e=0>d?0!==i.slideCount%i.options.slidesToScroll?i.slideCount-i.slideCount%i.options.slidesToScroll:i.slideCount+d:d>=i.slideCount?0!==i.slideCount%i.options.slidesToScroll?0:d-i.slideCount:d,i.animating=!0,i.$slider.trigger("beforeChange",[i,i.currentSlide,e]),f=i.currentSlide,i.currentSlide=e,i.setSlideClasses(i.currentSlide),i.updateDots(),i.updateArrows(),i.options.fade===!0?(c!==!0?i.fadeSlide(e,function(){i.postSlide(e)}):i.postSlide(e),i.animateHeight(),void 0):(c!==!0?i.animateSlide(h,function(){i.postSlide(e)}):i.postSlide(e),void 0)))},b.prototype.startLoad=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.hide(),a.$nextArrow.hide()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.hide(),a.$slider.addClass("slick-loading")},b.prototype.swipeDirection=function(){var a,b,c,d,e=this;return a=e.touchObject.startX-e.touchObject.curX,b=e.touchObject.startY-e.touchObject.curY,c=Math.atan2(b,a),d=Math.round(180*c/Math.PI),0>d&&(d=360-Math.abs(d)),45>=d&&d>=0?e.options.rtl===!1?"left":"right":360>=d&&d>=315?e.options.rtl===!1?"left":"right":d>=135&&225>=d?e.options.rtl===!1?"right":"left":e.options.verticalSwiping===!0?d>=35&&135>=d?"left":"right":"vertical"},b.prototype.swipeEnd=function(){var c,b=this;if(b.dragging=!1,b.shouldClick=b.touchObject.swipeLength>10?!1:!0,void 0===b.touchObject.curX)return!1;if(b.touchObject.edgeHit===!0&&b.$slider.trigger("edge",[b,b.swipeDirection()]),b.touchObject.swipeLength>=b.touchObject.minSwipe)switch(b.swipeDirection()){case"left":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide+b.getSlideCount()):b.currentSlide+b.getSlideCount(),b.slideHandler(c),b.currentDirection=0,b.touchObject={},b.$slider.trigger("swipe",[b,"left"]);break;case"right":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide-b.getSlideCount()):b.currentSlide-b.getSlideCount(),b.slideHandler(c),b.currentDirection=1,b.touchObject={},b.$slider.trigger("swipe",[b,"right"])
|
||
}else b.touchObject.startX!==b.touchObject.curX&&(b.slideHandler(b.currentSlide),b.touchObject={})},b.prototype.swipeHandler=function(a){var b=this;if(!(b.options.swipe===!1||"ontouchend"in document&&b.options.swipe===!1||b.options.draggable===!1&&-1!==a.type.indexOf("mouse")))switch(b.touchObject.fingerCount=a.originalEvent&&void 0!==a.originalEvent.touches?a.originalEvent.touches.length:1,b.touchObject.minSwipe=b.listWidth/b.options.touchThreshold,b.options.verticalSwiping===!0&&(b.touchObject.minSwipe=b.listHeight/b.options.touchThreshold),a.data.action){case"start":b.swipeStart(a);break;case"move":b.swipeMove(a);break;case"end":b.swipeEnd(a)}},b.prototype.swipeMove=function(a){var d,e,f,g,h,b=this;return h=void 0!==a.originalEvent?a.originalEvent.touches:null,!b.dragging||h&&1!==h.length?!1:(d=b.getLeft(b.currentSlide),b.touchObject.curX=void 0!==h?h[0].pageX:a.clientX,b.touchObject.curY=void 0!==h?h[0].pageY:a.clientY,b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curX-b.touchObject.startX,2))),b.options.verticalSwiping===!0&&(b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curY-b.touchObject.startY,2)))),e=b.swipeDirection(),"vertical"!==e?(void 0!==a.originalEvent&&b.touchObject.swipeLength>4&&a.preventDefault(),g=(b.options.rtl===!1?1:-1)*(b.touchObject.curX>b.touchObject.startX?1:-1),b.options.verticalSwiping===!0&&(g=b.touchObject.curY>b.touchObject.startY?1:-1),f=b.touchObject.swipeLength,b.touchObject.edgeHit=!1,b.options.infinite===!1&&(0===b.currentSlide&&"right"===e||b.currentSlide>=b.getDotCount()&&"left"===e)&&(f=b.touchObject.swipeLength*b.options.edgeFriction,b.touchObject.edgeHit=!0),b.swipeLeft=b.options.vertical===!1?d+f*g:d+f*(b.$list.height()/b.listWidth)*g,b.options.verticalSwiping===!0&&(b.swipeLeft=d+f*g),b.options.fade===!0||b.options.touchMove===!1?!1:b.animating===!0?(b.swipeLeft=null,!1):(b.setCSS(b.swipeLeft),void 0)):void 0)},b.prototype.swipeStart=function(a){var c,b=this;return 1!==b.touchObject.fingerCount||b.slideCount<=b.options.slidesToShow?(b.touchObject={},!1):(void 0!==a.originalEvent&&void 0!==a.originalEvent.touches&&(c=a.originalEvent.touches[0]),b.touchObject.startX=b.touchObject.curX=void 0!==c?c.pageX:a.clientX,b.touchObject.startY=b.touchObject.curY=void 0!==c?c.pageY:a.clientY,b.dragging=!0,void 0)},b.prototype.unfilterSlides=b.prototype.slickUnfilter=function(){var a=this;null!==a.$slidesCache&&(a.unload(),a.$slideTrack.children(this.options.slide).detach(),a.$slidesCache.appendTo(a.$slideTrack),a.reinit())},b.prototype.unload=function(){var b=this;a(".slick-cloned",b.$slider).remove(),b.$dots&&b.$dots.remove(),b.$prevArrow&&"object"!=typeof b.options.prevArrow&&b.$prevArrow.remove(),b.$nextArrow&&"object"!=typeof b.options.nextArrow&&b.$nextArrow.remove(),b.$slides.removeClass("slick-slide slick-active slick-visible").attr("aria-hidden","true").css("width","")},b.prototype.unslick=function(a){var b=this;b.$slider.trigger("unslick",[b,a]),b.destroy()},b.prototype.updateArrows=function(){var b,a=this;b=Math.floor(a.options.slidesToShow/2),a.options.arrows===!0&&a.options.infinite!==!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.removeClass("slick-disabled"),a.$nextArrow.removeClass("slick-disabled"),0===a.currentSlide?(a.$prevArrow.addClass("slick-disabled"),a.$nextArrow.removeClass("slick-disabled")):a.currentSlide>=a.slideCount-a.options.slidesToShow&&a.options.centerMode===!1?(a.$nextArrow.addClass("slick-disabled"),a.$prevArrow.removeClass("slick-disabled")):a.currentSlide>=a.slideCount-1&&a.options.centerMode===!0&&(a.$nextArrow.addClass("slick-disabled"),a.$prevArrow.removeClass("slick-disabled")))},b.prototype.updateDots=function(){var a=this;null!==a.$dots&&(a.$dots.find("li").removeClass("slick-active").attr("aria-hidden","true"),a.$dots.find("li").eq(Math.floor(a.currentSlide/a.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden","false"))},b.prototype.visibility=function(){var a=this;document[a.hidden]?(a.paused=!0,a.autoPlayClear()):a.options.autoplay===!0&&(a.paused=!1,a.autoPlay())},a.fn.slick=function(){var g,a=this,c=arguments[0],d=Array.prototype.slice.call(arguments,1),e=a.length,f=0;for(f;e>f;f++)if("object"==typeof c||"undefined"==typeof c?a[f].slick=new b(a[f],c):g=a[f].slick[c].apply(a[f].slick,d),"undefined"!=typeof g)return g;return a}});
|
||
|
||
/*!
|
||
* hoverIntent v1.8.1 // 2014.08.11 // jQuery v1.9.1+
|
||
* http://cherne.net/brian/resources/jquery.hoverIntent.html
|
||
*
|
||
* You may use hoverIntent under the terms of the MIT license. Basically that
|
||
* means you are free to use hoverIntent as long as this header is left intact.
|
||
* Copyright 2007, 2014 Brian Cherne
|
||
*/
|
||
|
||
/* hoverIntent is similar to jQuery's built-in "hover" method except that
|
||
* instead of firing the handlerIn function immediately, hoverIntent checks
|
||
* to see if the user's mouse has slowed down (beneath the sensitivity
|
||
* threshold) before firing the event. The handlerOut function is only
|
||
* called after a matching handlerIn.
|
||
*
|
||
* // basic usage ... just like .hover()
|
||
* .hoverIntent( handlerIn, handlerOut )
|
||
* .hoverIntent( handlerInOut )
|
||
*
|
||
* // basic usage ... with event delegation!
|
||
* .hoverIntent( handlerIn, handlerOut, selector )
|
||
* .hoverIntent( handlerInOut, selector )
|
||
*
|
||
* // using a basic configuration object
|
||
* .hoverIntent( config )
|
||
*
|
||
* @param handlerIn function OR configuration object
|
||
* @param handlerOut function OR selector for delegation OR undefined
|
||
* @param selector selector OR undefined
|
||
* @author Brian Cherne <brian(at)cherne(dot)net>
|
||
*/
|
||
(function($) {
|
||
$.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
|
||
|
||
// default configuration values
|
||
var cfg = {
|
||
interval: 100,
|
||
sensitivity: 6,
|
||
timeout: 0
|
||
};
|
||
|
||
if ( typeof handlerIn === "object" ) {
|
||
cfg = $.extend(cfg, handlerIn );
|
||
} else if ($.isFunction(handlerOut)) {
|
||
cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } );
|
||
} else {
|
||
cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } );
|
||
}
|
||
|
||
// instantiate variables
|
||
// cX, cY = current X and Y position of mouse, updated by mousemove event
|
||
// pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
|
||
var cX, cY, pX, pY;
|
||
|
||
// A private function for getting mouse position
|
||
var track = function(ev) {
|
||
cX = ev.pageX;
|
||
cY = ev.pageY;
|
||
};
|
||
|
||
// A private function for comparing current and previous mouse position
|
||
var compare = function(ev,ob) {
|
||
ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
|
||
// compare mouse positions to see if they've crossed the threshold
|
||
if ( Math.sqrt( (pX-cX)*(pX-cX) + (pY-cY)*(pY-cY) ) < cfg.sensitivity ) {
|
||
$(ob).off("mousemove.hoverIntent",track);
|
||
// set hoverIntent state to true (so mouseOut can be called)
|
||
ob.hoverIntent_s = true;
|
||
return cfg.over.apply(ob,[ev]);
|
||
} else {
|
||
// set previous coordinates for next time
|
||
pX = cX; pY = cY;
|
||
// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
|
||
ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
|
||
}
|
||
};
|
||
|
||
// A private function for delaying the mouseOut function
|
||
var delay = function(ev,ob) {
|
||
ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
|
||
ob.hoverIntent_s = false;
|
||
return cfg.out.apply(ob,[ev]);
|
||
};
|
||
|
||
// A private function for handling mouse 'hovering'
|
||
var handleHover = function(e) {
|
||
// copy objects to be passed into t (required for event object to be passed in IE)
|
||
var ev = $.extend({},e);
|
||
var ob = this;
|
||
|
||
// cancel hoverIntent timer if it exists
|
||
if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }
|
||
|
||
// if e.type === "mouseenter"
|
||
if (e.type === "mouseenter") {
|
||
// set "previous" X and Y position based on initial entry point
|
||
pX = ev.pageX; pY = ev.pageY;
|
||
// update "current" X and Y position based on mousemove
|
||
$(ob).on("mousemove.hoverIntent",track);
|
||
// start polling interval (self-calling timeout) to compare mouse coordinates over time
|
||
if (!ob.hoverIntent_s) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
|
||
|
||
// else e.type == "mouseleave"
|
||
} else {
|
||
// unbind expensive mousemove event
|
||
$(ob).off("mousemove.hoverIntent",track);
|
||
// if hoverIntent state is true, then call the mouseOut function after the specified delay
|
||
if (ob.hoverIntent_s) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
|
||
}
|
||
};
|
||
|
||
// listen for mouseenter and mouseleave
|
||
return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector);
|
||
};
|
||
})(jQuery);
|
||
|
||
/*! lightgallery - v1.2.5 - 2015-10-02
|
||
* http://sachinchoolur.github.io/lightGallery/
|
||
* Copyright (c) 2015 Sachin N; Licensed Apache 2.0 */
|
||
!function(a,b,c,d){"use strict";function e(b,d){return this.el=b,this.$el=a(b),this.s=a.extend({},f,d),this.modules={},this.lGalleryOn=!1,this.lgBusy=!1,this.hideBartimeout=!1,this.isTouch="ontouchstart"in c.documentElement,this.s.slideEndAnimatoin&&(this.s.hideControlOnEnd=!1),this.s.dynamic?this.$items=this.s.dynamicEl:"this"===this.s.selector?this.$items=this.$el:""!==this.s.selector?this.$items=this.$el.find(a(this.s.selector)):this.$items=this.$el.children(),this.$slide="",this.$outer="",this.init(),this}var f={mode:"lg-slide",cssEasing:"cubic-bezier(0.25, 0, 0.25, 1)",easing:"linear",speed:600,height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:150,hideBarsDelay:6e3,useLeft:!1,closable:!0,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimatoin:!0,hideControlOnEnd:!1,mousewheel:!0,appendSubHtmlTo:".lg-sub-html",preload:1,showAfterLoad:!0,selector:"",nextHtml:"",prevHtml:"",index:!1,iframeMaxWidth:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],galleryId:1};e.prototype.init=function(){var c=this;c.s.preload>c.$items.length&&(c.s.preload=c.$items.length);var d=b.location.hash;d.indexOf("lg="+this.s.galleryId)>0&&(c.index=parseInt(d.split("&slide=")[1],10),a("body").addClass("lg-from-hash"),a("body").hasClass("lg-on")||setTimeout(function(){c.build(c.index),a("body").addClass("lg-on")})),c.s.dynamic?(c.$el.trigger("onBeforeOpen.lg"),c.index=c.s.index||0,a("body").hasClass("lg-on")||setTimeout(function(){c.build(c.index),a("body").addClass("lg-on")})):c.$items.on("click.lgcustom",function(b){try{b.preventDefault(),b.preventDefault()}catch(d){b.returnValue=!1}c.$el.trigger("onBeforeOpen.lg"),c.index=c.s.index||c.$items.index(this),a("body").hasClass("lg-on")||(c.build(c.index),a("body").addClass("lg-on"))})},e.prototype.build=function(b){var c=this;c.structure(),a.each(a.fn.lightGallery.modules,function(b){c.modules[b]=new a.fn.lightGallery.modules[b](c.el)}),c.slide(b,!1,!1),c.s.keyPress&&c.keyPress(),c.$items.length>1&&(c.arrow(),setTimeout(function(){c.enableDrag(),c.enableSwipe()},50),c.s.mousewheel&&c.mousewheel()),c.counter(),c.closeGallery(),c.$el.trigger("onAfterOpen.lg"),c.$outer.on("mousemove.lg click.lg touchstart.lg",function(){c.$outer.removeClass("lg-hide-items"),clearTimeout(c.hideBartimeout),c.hideBartimeout=setTimeout(function(){c.$outer.addClass("lg-hide-items")},c.s.hideBarsDelay)})},e.prototype.structure=function(){var c,d="",e="",f=0,g="",h=this;for(a("body").append('<div class="lg-backdrop"></div>'),a(".lg-backdrop").css("transition-duration",this.s.backdropDuration+"ms"),f=0;f<this.$items.length;f++)d+='<div class="lg-item"></div>';if(this.s.controls&&this.$items.length>1&&(e='<div class="lg-actions"><div class="lg-prev lg-icon">'+this.s.prevHtml+'</div><div class="lg-next lg-icon">'+this.s.nextHtml+"</div></div>"),".lg-sub-html"===this.s.appendSubHtmlTo&&(g='<div class="lg-sub-html"></div>'),c='<div class="lg-outer '+this.s.addClass+" "+this.s.startClass+'"><div class="lg" style="width:'+this.s.width+"; height:"+this.s.height+'"><div class="lg-inner">'+d+'</div><div class="lg-toolbar group"><span class="lg-close lg-icon"></span></div>'+e+g+"</div></div>",a("body").append(c),this.$outer=a(".lg-outer"),this.$slide=this.$outer.find(".lg-item"),this.s.useLeft?(this.$outer.addClass("lg-use-left"),this.s.mode="lg-slide"):this.$outer.addClass("lg-use-css3"),h.setTop(),a(b).on("resize.lg orientationchange.lg",function(){setTimeout(function(){h.setTop()},100)}),this.$slide.eq(this.index).addClass("lg-current"),this.doCss()?this.$outer.addClass("lg-css3"):(this.$outer.addClass("lg-css"),this.s.speed=0),this.$outer.addClass(this.s.mode),this.s.enableDrag&&this.$items.length>1&&this.$outer.addClass("lg-grab"),this.s.showAfterLoad&&this.$outer.addClass("lg-show-after-load"),this.doCss()){var i=this.$outer.find(".lg-inner");i.css("transition-timing-function",this.s.cssEasing),i.css("transition-duration",this.s.speed+"ms")}a(".lg-backdrop").addClass("in"),setTimeout(function(){h.$outer.addClass("lg-visible")},this.s.backdropDuration),this.s.download&&this.$outer.find(".lg-toolbar").append('<a id="lg-download" target="_blank" download class="lg-download lg-icon"></a>'),this.prevScrollTop=a(b).scrollTop()},e.prototype.setTop=function(){if("100%"!==this.s.height){var c=a(b).height(),d=(c-parseInt(this.s.height,10))/2,e=this.$outer.find(".lg");c>=parseInt(this.s.height,10)?e.css("top",d+"px"):e.css("top","0px")}},e.prototype.doCss=function(){var a=function(){var a=["transition","MozTransition","WebkitTransition","OTransition","msTransition","KhtmlTransition"],b=c.documentElement,d=0;for(d=0;d<a.length;d++)if(a[d]in b.style)return!0};return a()?!0:!1},e.prototype.isVideo=function(a,b){var c;if(c=this.s.dynamic?this.s.dynamicEl[b].html:this.$items.eq(b).attr("data-html"),!a&&c)return{html5:!0};var d=a.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i),e=a.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i),f=a.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i);return d?{youtube:d}:e?{vimeo:e}:f?{dailymotion:f}:void 0},e.prototype.counter=function(){this.s.counter&&a(this.s.appendCounterTo).append('<div id="lg-counter"><span id="lg-counter-current">'+(parseInt(this.index,10)+1)+'</span> / <span id="lg-counter-all">'+this.$items.length+"</span></div>")},e.prototype.addHtml=function(b){var c=null;if(c=this.s.dynamic?this.s.dynamicEl[b].subHtml:this.$items.eq(b).attr("data-sub-html"),"undefined"!=typeof c&&null!==c){var d=c.substring(0,1);c="."===d||"#"===d?a(c).html():c}else c="";".lg-sub-html"===this.s.appendSubHtmlTo?(this.$outer.find(this.s.appendSubHtmlTo).html(c),""===c?this.$outer.find(this.s.appendSubHtmlTo).addClass("lg-empty-html"):this.$outer.find(this.s.appendSubHtmlTo).removeClass("lg-empty-html")):this.$slide.eq(b).append(c),this.$el.trigger("onAfterAppendSubHtml.lg",[b])},e.prototype.preload=function(a){var b=1,c=1;for(b=1;b<=this.s.preload&&!(b>=this.$items.length-a);b++)this.loadContent(a+b,!1,0);for(c=1;c<=this.s.preload&&!(0>a-c);c++)this.loadContent(a-c,!1,0)},e.prototype.loadContent=function(c,d,e){var f,g,h,i,j,k,l=this,m=!1,n=function(c){for(var d=[],e=[],f=0;f<c.length;f++){var h=c[f].split(" ");""===h[0]&&h.splice(0,1),e.push(h[0]),d.push(h[1])}for(var i=a(b).width(),j=0;j<d.length;j++)if(parseInt(d[j],10)>i){g=e[j];break}};if(l.s.dynamic){if(l.s.dynamicEl[c].poster&&(m=!0,h=l.s.dynamicEl[c].poster),k=l.s.dynamicEl[c].html,g=l.s.dynamicEl[c].src,l.s.dynamicEl[c].responsive){var o=l.s.dynamicEl[c].responsive.split(",");n(o)}i=l.s.dynamicEl[c].srcset,j=l.s.dynamicEl[c].sizes}else{if(l.$items.eq(c).attr("data-poster")&&(m=!0,h=l.$items.eq(c).attr("data-poster")),k=l.$items.eq(c).attr("data-html"),g=l.$items.eq(c).attr("href")||l.$items.eq(c).attr("data-src"),l.$items.eq(c).attr("data-responsive")){var p=l.$items.eq(c).attr("data-responsive").split(",");n(p)}i=l.$items.eq(c).attr("data-srcset"),j=l.$items.eq(c).attr("data-sizes")}var q=!1;l.s.dynamic?l.s.dynamicEl[c].iframe&&(q=!0):"true"===l.$items.eq(c).attr("data-iframe")&&(q=!0);var r=l.isVideo(g,c);if(!l.$slide.eq(c).hasClass("lg-loaded")){if(q)l.$slide.eq(c).prepend('<div class="lg-video-cont" style="max-width:'+l.s.iframeMaxWidth+'"><div class="lg-video"><iframe class="lg-object" frameborder="0" src="'+g+'" allowfullscreen="true"></iframe></div></div>');else if(m){var s="";s=r&&r.youtube?"lg-has-youtube":r&&r.vimeo?"lg-has-vimeo":"lg-has-html5",l.$slide.eq(c).prepend('<div class="lg-video-cont '+s+' "><div class="lg-video"><span class="lg-video-play"></span><img class="lg-object lg-has-poster" src="'+h+'" /></div></div>')}else r?(l.$slide.eq(c).prepend('<div class="lg-video-cont "><div class="lg-video"></div></div>'),l.$el.trigger("hasVideo.lg",[c,g,k])):l.$slide.eq(c).prepend('<div class="lg-img-wrap"><img class="lg-object lg-image" src="'+g+'" /></div>');if(l.$el.trigger("onAferAppendSlide.lg",[c]),f=l.$slide.eq(c).find(".lg-object"),j&&f.attr("sizes",j),i){f.attr("srcset",i);try{picturefill({elements:[f[0]]})}catch(t){console.error("Make sure you have included Picturefill version 2")}}".lg-sub-html"!==this.s.appendSubHtmlTo&&l.addHtml(c),l.$slide.eq(c).addClass("lg-loaded")}l.$slide.eq(c).find(".lg-object").on("load.lg error.lg",function(){var b=0;e&&!a("body").hasClass("lg-from-hash")&&(b=e),setTimeout(function(){l.$slide.eq(c).addClass("lg-complete"),l.$el.trigger("onSlideItemLoad.lg",[c,e||0])},b)}),r&&r.html5&&!m&&l.$slide.eq(c).addClass("lg-complete"),d===!0&&(l.$slide.eq(c).hasClass("lg-complete")?l.preload(c):l.$slide.eq(c).find(".lg-object").on("load.lg error.lg",function(){l.preload(c)}))},e.prototype.slide=function(b,c,d){var e=this.$outer.find(".lg-current").index(),f=this;if(!f.lGalleryOn||e!==b){var g=this.$slide.length,h=f.lGalleryOn?this.s.speed:0,i=!1,j=!1;if(!f.lgBusy){if(this.$el.trigger("onBeforeSlide.lg",[e,b,c,d]),f.lgBusy=!0,clearTimeout(f.hideBartimeout),".lg-sub-html"===this.s.appendSubHtmlTo&&setTimeout(function(){f.addHtml(b)},h),this.arrowDisable(b),c){var k=b-1,l=b+1;0===b&&e===g-1?(l=0,k=g-1):b===g-1&&0===e&&(l=0,k=g-1),this.$slide.removeClass("lg-prev-slide lg-current lg-next-slide"),f.$slide.eq(k).addClass("lg-prev-slide"),f.$slide.eq(l).addClass("lg-next-slide"),f.$slide.eq(b).addClass("lg-current")}else f.$outer.addClass("lg-no-trans"),this.$slide.removeClass("lg-prev-slide lg-next-slide"),e>b?(j=!0,0!==b||e!==g-1||d||(j=!1,i=!0)):b>e&&(i=!0,b!==g-1||0!==e||d||(j=!0,i=!1)),j?(this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(e).addClass("lg-next-slide")):i&&(this.$slide.eq(b).addClass("lg-next-slide"),this.$slide.eq(e).addClass("lg-prev-slide")),setTimeout(function(){f.$slide.removeClass("lg-current"),f.$slide.eq(b).addClass("lg-current"),f.$outer.removeClass("lg-no-trans")},50);if(f.lGalleryOn?(setTimeout(function(){f.loadContent(b,!0,0)},this.s.speed+50),setTimeout(function(){f.lgBusy=!1,f.$el.trigger("onAfterSlide.lg",[e,b,c,d])},this.s.speed)):(f.loadContent(b,!0,f.s.backdropDuration),f.lgBusy=!1,f.$el.trigger("onAfterSlide.lg",[e,b,c,d])),this.s.download){var m;m=f.s.dynamic?f.s.dynamicEl[b].downloadUrl||f.s.dynamicEl[b].src:f.$items.eq(b).attr("data-download-url")||f.$items.eq(b).attr("href")||f.$items.eq(b).attr("data-src"),a("#lg-download").attr("href",m)}f.lGalleryOn=!0,this.s.counter&&a("#lg-counter-current").text(b+1)}}},e.prototype.goToNextSlide=function(a){var b=this;b.lgBusy||(b.index+1<b.$slide.length?(b.index++,b.$el.trigger("onBeforeNextSlide.lg",[b.index]),b.slide(b.index,a,!1)):b.s.loop?(b.index=0,b.$el.trigger("onBeforeNextSlide.lg",[b.index]),b.slide(b.index,a,!1)):b.s.slideEndAnimatoin&&(b.$outer.addClass("lg-right-end"),setTimeout(function(){b.$outer.removeClass("lg-right-end")},400)))},e.prototype.goToPrevSlide=function(a){var b=this;b.lgBusy||(b.index>0?(b.index--,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1)):b.s.loop?(b.index=b.$items.length-1,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1)):b.s.slideEndAnimatoin&&(b.$outer.addClass("lg-left-end"),setTimeout(function(){b.$outer.removeClass("lg-left-end")},400)))},e.prototype.keyPress=function(){var c=this;this.$items.length>1&&a(b).on("keyup.lg",function(a){c.$items.length>1&&(37===a.keyCode&&(a.preventDefault(),c.goToPrevSlide()),39===a.keyCode&&(a.preventDefault(),c.goToNextSlide()))}),a(b).on("keydown.lg",function(a){c.s.escKey===!0&&27===a.keyCode&&(a.preventDefault(),c.$outer.hasClass("lg-thumb-open")?c.$outer.removeClass("lg-thumb-open"):c.destroy())})},e.prototype.arrow=function(){var a=this;this.$outer.find(".lg-prev").on("click.lg",function(){a.goToPrevSlide()}),this.$outer.find(".lg-next").on("click.lg",function(){a.goToNextSlide()})},e.prototype.arrowDisable=function(a){!this.s.loop&&this.s.hideControlOnEnd&&(a+1<this.$slide.length?this.$outer.find(".lg-next").removeAttr("disabled").removeClass("disabled"):this.$outer.find(".lg-next").attr("disabled","disabled").addClass("disabled"),a>0?this.$outer.find(".lg-prev").removeAttr("disabled").removeClass("disabled"):this.$outer.find(".lg-prev").attr("disabled","disabled").addClass("disabled"))},e.prototype.setTranslate=function(a,b,c){this.s.useLeft?a.css("left",b):a.css({transform:"translate3d("+b+"px, "+c+"px, 0px)"})},e.prototype.touchMove=function(b,c){var d=c-b;this.$outer.addClass("lg-dragging"),this.setTranslate(this.$slide.eq(this.index),d,0),this.setTranslate(a(".lg-prev-slide"),-this.$slide.eq(this.index).width()+d,0),this.setTranslate(a(".lg-next-slide"),this.$slide.eq(this.index).width()+d,0)},e.prototype.touchEnd=function(a){var b=this;"lg-slide"!==b.s.mode&&b.$outer.addClass("lg-slide"),this.$slide.not(".lg-current, .lg-prev-slide, .lg-next-slide").css("opacity","0"),setTimeout(function(){b.$outer.removeClass("lg-dragging"),0>a&&Math.abs(a)>b.s.swipeThreshold?b.goToNextSlide(!0):a>0&&Math.abs(a)>b.s.swipeThreshold?b.goToPrevSlide(!0):Math.abs(a)<5&&b.$el.trigger("onSlideClick.lg"),b.$slide.removeAttr("style")}),setTimeout(function(){b.$outer.hasClass("lg-dragging")||"lg-slide"===b.s.mode||b.$outer.removeClass("lg-slide")},b.s.speed+100)},e.prototype.enableSwipe=function(){var a=this,b=0,c=0,d=!1;a.s.enableSwipe&&a.isTouch&&a.doCss()&&(a.$slide.on("touchstart.lg",function(c){a.$outer.hasClass("lg-zoomed")||a.lgBusy||(c.preventDefault(),a.manageSwipeClass(),b=c.originalEvent.targetTouches[0].pageX)}),a.$slide.on("touchmove.lg",function(e){a.$outer.hasClass("lg-zoomed")||(e.preventDefault(),c=e.originalEvent.targetTouches[0].pageX,a.touchMove(b,c),d=!0)}),a.$slide.on("touchend.lg",function(){a.$outer.hasClass("lg-zoomed")||(d?(d=!1,a.touchEnd(c-b)):a.$el.trigger("onSlideClick.lg"))}))},e.prototype.enableDrag=function(){var c=this,d=0,e=0,f=!1,g=!1;c.s.enableDrag&&!c.isTouch&&c.doCss()&&(c.$slide.on("mousedown.lg",function(b){c.$outer.hasClass("lg-zoomed")||(a(b.target).hasClass("lg-object")||a(b.target).hasClass("lg-video-play"))&&(b.preventDefault(),c.lgBusy||(c.manageSwipeClass(),d=b.pageX,f=!0,c.$outer.scrollLeft+=1,c.$outer.scrollLeft-=1,c.$outer.removeClass("lg-grab").addClass("lg-grabbing"),c.$el.trigger("onDragstart.lg")))}),a(b).on("mousemove.lg",function(a){f&&(g=!0,e=a.pageX,c.touchMove(d,e),c.$el.trigger("onDragmove.lg"))}),a(b).on("mouseup.lg",function(b){g?(g=!1,c.touchEnd(e-d),c.$el.trigger("onDragend.lg")):(a(b.target).hasClass("lg-object")||a(b.target).hasClass("lg-video-play"))&&c.$el.trigger("onSlideClick.lg"),f&&(f=!1,c.$outer.removeClass("lg-grabbing").addClass("lg-grab"))}))},e.prototype.manageSwipeClass=function(){var a=this.index+1,b=this.index-1,c=this.$slide.length;this.s.loop&&(0===this.index?b=c-1:this.index===c-1&&(a=0)),this.$slide.removeClass("lg-next-slide lg-prev-slide"),b>-1&&this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(a).addClass("lg-next-slide")},e.prototype.mousewheel=function(){var a=this;a.$outer.on("mousewheel.lg",function(b){b.deltaY&&(b.deltaY>0?a.goToPrevSlide():a.goToNextSlide(),b.preventDefault())})},e.prototype.closeGallery=function(){var b=this,c=!1;this.$outer.find(".lg-close").on("click.lg",function(){b.destroy()}),b.s.closable&&(b.$outer.on("mousedown.lg",function(b){c=a(b.target).is(".lg-outer")||a(b.target).is(".lg-item ")||a(b.target).is(".lg-img-wrap")?!0:!1}),b.$outer.on("mouseup.lg",function(d){(a(d.target).is(".lg-outer")||a(d.target).is(".lg-item ")||a(d.target).is(".lg-img-wrap")&&c)&&(b.$outer.hasClass("lg-dragging")||b.destroy())}))},e.prototype.destroy=function(c){var d=this;d.$el.trigger("onBeforeClose.lg"),a(b).scrollTop(d.prevScrollTop),c&&(this.$items.off("click.lg click.lgcustom"),a.removeData(d.el,"lightGallery")),this.$el.off(".lg.tm"),a.each(a.fn.lightGallery.modules,function(a){d.modules[a]&&d.modules[a].destroy()}),this.lGalleryOn=!1,clearTimeout(d.hideBartimeout),this.hideBartimeout=!1,a(b).off(".lg"),a("body").removeClass("lg-on lg-from-hash"),d.$outer&&d.$outer.removeClass("lg-visible"),a(".lg-backdrop").removeClass("in"),setTimeout(function(){d.$outer&&d.$outer.remove(),a(".lg-backdrop").remove(),d.$el.trigger("onCloseAfter.lg")},d.s.backdropDuration+50)},a.fn.lightGallery=function(b){return this.each(function(){if(a.data(this,"lightGallery"))try{a(this).data("lightGallery").init()}catch(c){console.error("lightGallery has not initiated properly")}else a.data(this,"lightGallery",new e(this,b))})},a.fn.lightGallery.modules={}}(jQuery,window,document);
|
||
/*! lightgallery - v1.2.5 - 2015-10-02
|
||
* http://sachinchoolur.github.io/lightGallery/
|
||
* Copyright (c) 2015 Sachin N; Licensed Apache 2.0 */
|
||
!function(a,b,c,d){"use strict";var e={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",thumbWidth:100,thumbContHeight:100,thumbMargin:5,exThumbImage:!1,showThumbByDefault:!0,toogleThumb:!0,pullCaptionUp:!0,enableThumbDrag:!0,enableThumbSwipe:!0,swipeThreshold:50,loadYoutubeThumbnail:!0,youtubeThumbSize:1,loadVimeoThumbnail:!0,vimeoThumbSize:"thumbnail_small",loadDailymotionThumbnail:!0},f=function(b){return this.core=a(b).data("lightGallery"),this.core.s=a.extend({},e,this.core.s),this.$el=a(b),this.$thumbOuter=null,this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.$items.length*(this.core.s.thumbWidth+this.core.s.thumbMargin),this.thumbIndex=this.core.index,this.left=0,this.init(),this};f.prototype.init=function(){this.core.s.thumbnail&&this.core.$items.length>1&&(this.core.s.showThumbByDefault&&this.core.$outer.addClass("lg-thumb-open"),this.core.s.pullCaptionUp&&this.core.$outer.addClass("lg-pull-caption-up"),this.build(),this.core.s.animateThumb?(this.core.s.enableThumbDrag&&!this.core.isTouch&&this.core.doCss()&&this.enableThumbDrag(),this.core.s.enableThumbSwipe&&this.core.isTouch&&this.core.doCss()&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toogle(),this.thumbkeyPress())},f.prototype.build=function(){function c(a,b,c){var d,h=e.core.isVideo(a,c)||{},i="";h.youtube||h.vimeo||h.dailymotion?h.youtube?d=e.core.s.loadYoutubeThumbnail?"//img.youtube.com/vi/"+h.youtube[1]+"/"+e.core.s.youtubeThumbSize+".jpg":b:h.vimeo?e.core.s.loadVimeoThumbnail?(d="//i.vimeocdn.com/video/error_"+g+".jpg",i=h.vimeo[1]):d=b:h.dailymotion&&(d=e.core.s.loadDailymotionThumbnail?"//www.dailymotion.com/thumbnail/video/"+h.dailymotion[1]:b):d=b,f+='<div data-vimeo-id="'+i+'" class="lg-thumb-item" style="width:'+e.core.s.thumbWidth+"px; margin-right: "+e.core.s.thumbMargin+'px"><img src="'+d+'" /></div>',i=""}var d,e=this,f="",g="",h='<div class="lg-thumb-outer"><div class="lg-thumb group"></div></div>';switch(this.core.s.vimeoThumbSize){case"thumbnail_large":g="640";break;case"thumbnail_medium":g="200x150";break;case"thumbnail_small":g="100x75"}if(e.core.$outer.addClass("lg-has-thumb"),e.core.$outer.find(".lg").append(h),e.$thumbOuter=e.core.$outer.find(".lg-thumb-outer"),e.thumbOuterWidth=e.$thumbOuter.width(),e.core.s.animateThumb&&e.core.$outer.find(".lg-thumb").css({width:e.thumbTotalWidth+"px",position:"relative"}),this.core.s.animateThumb&&e.$thumbOuter.css("height",e.core.s.thumbContHeight+"px"),e.core.s.dynamic)for(var i=0;i<e.core.s.dynamicEl.length;i++)c(e.core.s.dynamicEl[i].src,e.core.s.dynamicEl[i].thumb,i);else e.core.$items.each(function(b){e.core.s.exThumbImage?c(a(this).attr("href")||a(this).attr("data-src"),a(this).attr(e.core.s.exThumbImage),b):c(a(this).attr("href")||a(this).attr("data-src"),a(this).find("img").attr("src"),b)});e.core.$outer.find(".lg-thumb").html(f),d=e.core.$outer.find(".lg-thumb-item"),d.each(function(){var b=a(this),c=b.attr("data-vimeo-id");c&&a.getJSON("http://www.vimeo.com/api/v2/video/"+c+".json?callback=?",{format:"json"},function(a){b.find("img").attr("src",a[0][e.core.s.vimeoThumbSize])})}),d.eq(e.core.index).addClass("active"),e.core.$el.on("onBeforeSlide.lg.tm",function(){d.removeClass("active"),d.eq(e.core.index).addClass("active")}),d.on("click.lg touchend.lg",function(){var b=a(this);setTimeout(function(){(e.thumbClickable&&!e.core.lgBusy||!e.core.doCss())&&(e.core.index=b.index(),e.core.slide(e.core.index,!1,!0))},50)}),e.core.$el.on("onBeforeSlide.lg.tm",function(){e.animateThumb(e.core.index)}),a(b).on("resize.lg.thumb orientationchange.lg.thumb",function(){setTimeout(function(){e.animateThumb(e.core.index),e.thumbOuterWidth=e.$thumbOuter.width()},200)})},f.prototype.setTranslate=function(a){this.core.$outer.find(".lg-thumb").css({transform:"translate3d(-"+a+"px, 0px, 0px)"})},f.prototype.animateThumb=function(a){var b=this.core.$outer.find(".lg-thumb");if(this.core.s.animateThumb){var c;switch(this.core.s.currentPagerPosition){case"left":c=0;break;case"middle":c=this.thumbOuterWidth/2-this.core.s.thumbWidth/2;break;case"right":c=this.thumbOuterWidth-this.core.s.thumbWidth}this.left=(this.core.s.thumbWidth+this.core.s.thumbMargin)*a-1-c,this.left>this.thumbTotalWidth-this.thumbOuterWidth&&(this.left=this.thumbTotalWidth-this.thumbOuterWidth),this.left<0&&(this.left=0),this.core.lGalleryOn?(b.hasClass("on")||this.core.$outer.find(".lg-thumb").css("transition-duration",this.core.s.speed+"ms"),this.core.doCss()||b.animate({left:-this.left+"px"},this.core.s.speed)):this.core.doCss()||b.css("left",-this.left+"px"),this.setTranslate(this.left)}},f.prototype.enableThumbDrag=function(){var c=this,d=0,e=0,f=!1,g=!1,h=0;c.$thumbOuter.addClass("lg-grab"),c.core.$outer.find(".lg-thumb").on("mousedown.lg.thumb",function(a){c.thumbTotalWidth>c.thumbOuterWidth&&(a.preventDefault(),d=a.pageX,f=!0,c.core.$outer.scrollLeft+=1,c.core.$outer.scrollLeft-=1,c.thumbClickable=!1,c.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))}),a(b).on("mousemove.lg.thumb",function(a){f&&(h=c.left,g=!0,e=a.pageX,c.$thumbOuter.addClass("lg-dragging"),h-=e-d,h>c.thumbTotalWidth-c.thumbOuterWidth&&(h=c.thumbTotalWidth-c.thumbOuterWidth),0>h&&(h=0),c.setTranslate(h))}),a(b).on("mouseup.lg.thumb",function(){g?(g=!1,c.$thumbOuter.removeClass("lg-dragging"),c.left=h,Math.abs(e-d)<c.core.s.swipeThreshold&&(c.thumbClickable=!0)):c.thumbClickable=!0,f&&(f=!1,c.$thumbOuter.removeClass("lg-grabbing").addClass("lg-grab"))})},f.prototype.enableThumbSwipe=function(){var a=this,b=0,c=0,d=!1,e=0;a.core.$outer.find(".lg-thumb").on("touchstart.lg",function(c){a.thumbTotalWidth>a.thumbOuterWidth&&(c.preventDefault(),b=c.originalEvent.targetTouches[0].pageX,a.thumbClickable=!1)}),a.core.$outer.find(".lg-thumb").on("touchmove.lg",function(f){a.thumbTotalWidth>a.thumbOuterWidth&&(f.preventDefault(),c=f.originalEvent.targetTouches[0].pageX,d=!0,a.$thumbOuter.addClass("lg-dragging"),e=a.left,e-=c-b,e>a.thumbTotalWidth-a.thumbOuterWidth&&(e=a.thumbTotalWidth-a.thumbOuterWidth),0>e&&(e=0),a.setTranslate(e))}),a.core.$outer.find(".lg-thumb").on("touchend.lg",function(){a.thumbTotalWidth>a.thumbOuterWidth&&d?(d=!1,a.$thumbOuter.removeClass("lg-dragging"),Math.abs(c-b)<a.core.s.swipeThreshold&&(a.thumbClickable=!0),a.left=e):a.thumbClickable=!0})},f.prototype.toogle=function(){var a=this;a.core.s.toogleThumb&&(a.core.$outer.addClass("lg-can-toggle"),a.$thumbOuter.append('<span class="lg-toogle-thumb lg-icon"></span>'),a.core.$outer.find(".lg-toogle-thumb").on("click.lg",function(){a.core.$outer.toggleClass("lg-thumb-open")}))},f.prototype.thumbkeyPress=function(){var c=this;a(b).on("keydown.lg.thumb",function(a){38===a.keyCode?(a.preventDefault(),c.core.$outer.addClass("lg-thumb-open")):40===a.keyCode&&(a.preventDefault(),c.core.$outer.removeClass("lg-thumb-open"))})},f.prototype.destroy=function(){this.core.s.thumbnail&&this.core.$items.length>1&&(a(b).off("resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb"),this.$thumbOuter.remove(),this.core.$outer.removeClass("lg-has-thumb"))},a.fn.lightGallery.modules.Thumbnail=f}(jQuery,window,document);
|
||
/*
|
||
* jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz (1.6)
|
||
*
|
||
* http://www.heise.de/extras/socialshareprivacy/
|
||
* http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html
|
||
*
|
||
* Copyright (c) 2011-2015 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt,
|
||
* Heise Medien GmbH & Co. KG, http://www.heise.de
|
||
*
|
||
* is released under the MIT License http://www.opensource.org/licenses/mit-license.php
|
||
*
|
||
* Spread the word, link to us if you can.
|
||
*/
|
||
(function ($) {
|
||
|
||
"use strict";
|
||
|
||
//
|
||
// helper functions
|
||
//
|
||
|
||
// abbreviate at last blank before length and add "\u2026" (horizontal ellipsis)
|
||
function abbreviateText(text, length) {
|
||
var abbreviated = decodeURIComponent(text);
|
||
if (abbreviated.length <= length) {
|
||
return text;
|
||
}
|
||
|
||
var lastWhitespaceIndex = abbreviated.substring(0, length - 1).lastIndexOf(' ');
|
||
abbreviated = encodeURIComponent(abbreviated.substring(0, lastWhitespaceIndex)) + "\u2026";
|
||
|
||
return abbreviated;
|
||
}
|
||
|
||
// returns content of <meta name="" content=""> tags or '' if empty/non existant
|
||
function getMeta(name) {
|
||
var metaContent = $('meta[name="' + name + '"]').attr('content');
|
||
return metaContent || '';
|
||
}
|
||
|
||
// create tweet text from content of <meta name="DC.title"> and <meta name="DC.creator">
|
||
// fallback to content of <title> tag
|
||
function getTweetText() {
|
||
var title = getMeta('DC.title');
|
||
var creator = getMeta('DC.creator');
|
||
|
||
if (title.length > 0 && creator.length > 0) {
|
||
title += ' - ' + creator;
|
||
} else {
|
||
title = $('title').text();
|
||
}
|
||
|
||
return encodeURIComponent(title);
|
||
}
|
||
|
||
// build URI from rel="canonical" or document.location
|
||
function getURI() {
|
||
var uri = document.location.href;
|
||
var canonical = $("link[rel=canonical]").attr("href");
|
||
|
||
if (canonical && canonical.length > 0) {
|
||
if (canonical.indexOf("http") < 0) {
|
||
canonical = document.location.protocol + "//" + document.location.host + canonical;
|
||
}
|
||
uri = canonical;
|
||
}
|
||
|
||
return uri;
|
||
}
|
||
|
||
function cookieSet(name, value, days, path, domain) {
|
||
var expires = new Date();
|
||
expires.setTime(expires.getTime() + (days * 24 * 60 * 60 * 1000));
|
||
document.cookie = name + '=' + value + '; expires=' + expires.toUTCString() + '; path=' + path + '; domain=' + domain;
|
||
}
|
||
function cookieDel(name, value, path, domain) {
|
||
var expires = new Date();
|
||
expires.setTime(expires.getTime() - 100);
|
||
document.cookie = name + '=' + value + '; expires=' + expires.toUTCString() + '; path=' + path + '; domain=' + domain;
|
||
}
|
||
|
||
// extend jquery with our plugin function
|
||
$.fn.socialSharePrivacy = function (settings) {
|
||
var defaults = {
|
||
'services' : {
|
||
'facebook' : {
|
||
'status' : 'on',
|
||
'dummy_img' : 'socialshareprivacy/images/dummy_facebook.png',
|
||
'perma_option' : 'on',
|
||
'referrer_track' : '',
|
||
'action' : 'recommend',
|
||
'layout' : 'button_count',
|
||
'sharer' : {
|
||
'status' : 'off',
|
||
'dummy_img' : 'socialshareprivacy/images/dummy_facebook_share_de.png',
|
||
'img' : 'socialshareprivacy/images/dummy_facebook_share_active_de.png'
|
||
}
|
||
},
|
||
'twitter' : {
|
||
'status' : 'on',
|
||
'dummy_img' : 'socialshareprivacy/images/dummy_twitter.png',
|
||
'perma_option' : 'on',
|
||
'referrer_track' : '',
|
||
'tweet_text' : getTweetText,
|
||
'count' : 'horizontal'
|
||
},
|
||
'gplus' : {
|
||
'status' : 'on',
|
||
'dummy_img' : 'socialshareprivacy/images/dummy_gplus.png',
|
||
'perma_option' : 'on',
|
||
'referrer_track' : '',
|
||
'size' : 'medium'
|
||
}
|
||
},
|
||
'info_link' : 'http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html',
|
||
'cookie_path' : '/',
|
||
'cookie_domain' : document.location.host,
|
||
'cookie_expires' : '365',
|
||
'css_path' : 'socialshareprivacy/socialshareprivacy.css',
|
||
'uri' : getURI,
|
||
'language' : 'de',
|
||
'lang_path' : 'socialshareprivacy/lang/',
|
||
'skin' : 'light',
|
||
'alignment' : 'horizontal',
|
||
'switch_alignment' : 'left',
|
||
'perma_orientation' : 'down'
|
||
};
|
||
|
||
// Standardwerte des Plug-Ins mit den vom User angegebenen Optionen ueberschreiben
|
||
var options = $.extend(true, defaults, settings);
|
||
|
||
var facebook_on = (options.services.facebook.status === 'on');
|
||
var facebook_sharer_on = (options.services.facebook.sharer.status === 'on');
|
||
var twitter_on = (options.services.twitter.status === 'on');
|
||
var gplus_on = (options.services.gplus.status === 'on');
|
||
|
||
// check if at least one service is "on"
|
||
if (!facebook_on && !twitter_on && !gplus_on) {
|
||
return;
|
||
}
|
||
|
||
// insert stylesheet into document and prepend target element
|
||
if (options.css_path.length > 0 && $(window).data('socialshareprivacy_css') != '1') {
|
||
// IE fix (noetig fuer IE < 9 - wird hier aber fuer alle IE gemacht)
|
||
if (document.createStyleSheet) {
|
||
document.createStyleSheet(options.css_path);
|
||
}
|
||
else {
|
||
$('head').append('<link rel="stylesheet" type="text/css" href="' + options.css_path + '" />');
|
||
}
|
||
|
||
$(window).data('socialshareprivacy_css','1');
|
||
}
|
||
|
||
var language;
|
||
|
||
function loadLangFile() {
|
||
var d = $.Deferred();
|
||
|
||
$.getJSON(options.lang_path + options.language+'.lang', function(data) {
|
||
language = data;
|
||
d.resolve();
|
||
}).fail(function(s){
|
||
if(typeof console !== "undefined") {
|
||
console.log('Error ' + s.status + ' while loading the language file ('+options.lang_path+options.language+'.lang)');
|
||
}
|
||
d.reject();
|
||
});
|
||
|
||
return d.promise();
|
||
}
|
||
|
||
return this.each(function () {
|
||
var iteration = this;
|
||
|
||
$.when(
|
||
loadLangFile())
|
||
.then( function() {
|
||
$(iteration).prepend('<ul class="social_share_privacy_area clearfix"></ul>');
|
||
var context = $('.social_share_privacy_area', iteration);
|
||
|
||
// Class for dark skinning
|
||
if(options.skin == 'dark') {
|
||
$(context).addClass('skin-dark');
|
||
}
|
||
|
||
// Class for alignment
|
||
if(options.alignment == 'vertical') {
|
||
$(context).addClass('vertical');
|
||
|
||
if(options.switch_alignment == 'right' &&
|
||
((facebook_on && options.services.facebook.layout == 'box_count') || (!facebook_on)) &&
|
||
((twitter_on && options.services.twitter.count == 'vertical') || (!twitter_on)) &&
|
||
((gplus_on && options.services.gplus.size == 'tall') || (!gplus_on))) {
|
||
$(context).addClass('switch_right');
|
||
}
|
||
}
|
||
|
||
// canonical uri that will be shared
|
||
var uri = options.uri;
|
||
if (typeof uri === 'function') {
|
||
uri = uri(context);
|
||
}
|
||
|
||
//
|
||
// Facebook
|
||
//
|
||
if (facebook_on) {
|
||
var fb_dummy_btn;
|
||
var fb_code;
|
||
|
||
var fb_height = options.services.facebook.layout == 'box_count' ? '61' : '21';
|
||
var fb_width = options.services.facebook.layout == 'box_count' ? '90' : '130';
|
||
|
||
var fb_enc_uri = encodeURIComponent(uri + options.services.facebook.referrer_track);
|
||
|
||
if (facebook_sharer_on) {
|
||
fb_dummy_btn = '<img src="' + options.services.facebook.sharer.dummy_img + '" alt="Facebook "Share"-Dummy" class="fb_like_privacy_dummy" />';
|
||
fb_code = '<a href="#" onclick="window.open(\'https://www.facebook.com/sharer/sharer.php?u=' + fb_enc_uri + '\', \'facebook-share-dialog\', \'width=626,height=436\'); return false;"><img src="'+options.services.facebook.sharer.img+'" alt="" /></a>';
|
||
}
|
||
else {
|
||
fb_dummy_btn = '<img src="' + options.services.facebook.dummy_img + '" alt="Facebook "Like"-Dummy" class="fb_like_privacy_dummy" />';
|
||
fb_code = '<iframe src="//www.facebook.com/plugins/like.php?locale=' + language.services.facebook.language + '&href=' + fb_enc_uri + '&width=' + fb_width + '&layout=' + options.services.facebook.layout + '&action=' + options.services.facebook.action + '&show_faces=false&share=false&height=' + fb_height + '&colorscheme=' + options.skin + '" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:' + fb_width + 'px; height:' + fb_height + 'px;" allowTransparency="true"></iframe>';
|
||
}
|
||
context.append('<li class="facebook help_info clearfix"><span class="info">' + language.services.facebook.txt_info + '</span><a href="#" class="switch off">' + language.services.facebook.txt_fb_off + '</a><div class="fb_like dummy_btn">' + fb_dummy_btn + '</div></li>');
|
||
|
||
var $container_fb = $('li.facebook', context);
|
||
$(context).on('click', 'li.facebook div.fb_like img.fb_like_privacy_dummy,li.facebook .switch', function (e) {
|
||
e.preventDefault();
|
||
if ($container_fb.find('.switch').hasClass('off')) {
|
||
$container_fb.addClass('info_off');
|
||
$container_fb.find('.switch').addClass('on').removeClass('off').html(language.services.facebook.txt_fb_on);
|
||
$container_fb.find('img.fb_like_privacy_dummy').replaceWith(fb_code);
|
||
}
|
||
else {
|
||
$container_fb.removeClass('info_off');
|
||
$container_fb.find('.switch').addClass('off').removeClass('on').html(language.services.facebook.txt_fb_off);
|
||
$container_fb.find('.fb_like').html(fb_dummy_btn);
|
||
}
|
||
});
|
||
}
|
||
|
||
//
|
||
// Twitter
|
||
//
|
||
if (twitter_on) {
|
||
var text = options.services.twitter.tweet_text;
|
||
if (typeof text === 'function') {
|
||
text = text();
|
||
}
|
||
// 120 is the max character count left after twitters automatic url shortening with t.co
|
||
text = abbreviateText(text, '120');
|
||
|
||
var tw_height = options.services.twitter.count == 'horizontal' ? '25' : '62';
|
||
var tw_width = options.services.twitter.count == 'horizontal' ? '130' : '83';
|
||
|
||
var twitter_enc_uri = encodeURIComponent(uri + options.services.twitter.referrer_track);
|
||
var twitter_count_url = encodeURIComponent(uri);
|
||
var twitter_code = '<iframe allowtransparency="true" frameborder="0" scrolling="no" src="//platform.twitter.com/widgets/tweet_button.html?url=' + twitter_enc_uri + '&counturl=' + twitter_count_url + '&text=' + text + '&count=' + options.services.twitter.count + '&lang=' + language.services.twitter.language + '&dnt=true" style="width:' + tw_width + 'px; height:' + tw_height + 'px;"></iframe>';
|
||
var twitter_dummy_btn = '<img src="' + options.services.twitter.dummy_img + '" alt=""Tweet this"-Dummy" class="tweet_this_dummy" />';
|
||
|
||
context.append('<li class="twitter help_info clearfix"><span class="info">' + language.services.twitter.txt_info + '</span><a href="#" class="switch off">' + language.services.twitter.txt_twitter_off + '</a><div class="tweet dummy_btn">' + twitter_dummy_btn + '</div></li>');
|
||
|
||
var $container_tw = $('li.twitter', context);
|
||
|
||
$(context).on('click', 'li.twitter div.tweet img,li.twitter .switch', function (e) {
|
||
e.preventDefault();
|
||
if ($container_tw.find('.switch').hasClass('off')) {
|
||
$container_tw.addClass('info_off');
|
||
$container_tw.find('.switch').addClass('on').removeClass('off').html(language.services.twitter.txt_twitter_on);
|
||
$container_tw.find('img.tweet_this_dummy').replaceWith(twitter_code);
|
||
}
|
||
else {
|
||
$container_tw.removeClass('info_off');
|
||
$container_tw.find('.switch').addClass('off').removeClass('on').html(language.services.twitter.txt_twitter_off);
|
||
$container_tw.find('.tweet').html(twitter_dummy_btn);
|
||
}
|
||
});
|
||
}
|
||
|
||
//
|
||
// Google+
|
||
//
|
||
if (gplus_on) {
|
||
// fuer G+ wird die URL nicht encoded, da das zu einem Fehler fuehrt
|
||
var gplus_uri = uri + options.services.gplus.referrer_track;
|
||
|
||
// we use the Google+ "asynchronous" code, standard code is flaky if inserted into dom after load
|
||
var gplus_code = '<div class="g-plusone" data-size="' + options.services.gplus.size + '" data-href="' + gplus_uri + '"></div><script type="text/javascript">window.___gcfg = {lang: "' + language.services.gplus.language + '"}; (function() { var po = document.createElement("script"); po.type = "text/javascript"; po.async = true; po.src = "https://apis.google.com/js/platform.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s); })(); </script>';
|
||
var gplus_dummy_btn = '<img src="' + options.services.gplus.dummy_img + '" alt=""Google+1"-Dummy" class="gplus_one_dummy" />';
|
||
|
||
context.append('<li class="gplus help_info clearfix"><span class="info">' + language.services.gplus.txt_info + '</span><a href="#" class="switch off">' + language.services.gplus.txt_gplus_off + '</a><div class="gplusone dummy_btn">' + gplus_dummy_btn + '</div></li>');
|
||
|
||
var $container_gplus = $('li.gplus', context);
|
||
|
||
$(context).on('click', 'li.gplus div.gplusone img,li.gplus .switch', function (e) {
|
||
e.preventDefault();
|
||
if ($container_gplus.find('.switch').hasClass('off')) {
|
||
$container_gplus.addClass('info_off');
|
||
$container_gplus.find('.switch').addClass('on').removeClass('off').html(language.services.gplus.txt_gplus_on);
|
||
$container_gplus.find('img.gplus_one_dummy').replaceWith(gplus_code);
|
||
}
|
||
else {
|
||
$container_gplus.removeClass('info_off');
|
||
$container_gplus.find('.switch').addClass('off').removeClass('on').html(language.services.gplus.txt_gplus_off);
|
||
$container_gplus.find('.gplusone').html(gplus_dummy_btn);
|
||
}
|
||
});
|
||
}
|
||
|
||
//
|
||
// Der Info/Settings-Bereich wird eingebunden
|
||
//
|
||
context.append('<li class="settings_info ' + options.perma_orientation + '"><div class="settings_info_menu off perma_option_off"><a href="' + options.info_link + '"><span class="help_info icon"><span class="info">' + language.txt_help + '</span></span></a></div></li>');
|
||
|
||
// Info-Overlays mit leichter Verzoegerung einblenden
|
||
$(context).on('mouseenter', '.help_info:not(.info_off)', function () {
|
||
var $info_wrapper = $(this);
|
||
var timeout_id = window.setTimeout(function () { $($info_wrapper).addClass('display'); }, 500);
|
||
$(this).data('timeout_id', timeout_id);
|
||
});
|
||
$(context).on('mouseleave', '.help_info', function () {
|
||
var timeout_id = $(this).data('timeout_id');
|
||
window.clearTimeout(timeout_id);
|
||
if ($(this).hasClass('display')) {
|
||
$(this).removeClass('display');
|
||
}
|
||
});
|
||
|
||
var facebook_perma = (options.services.facebook.perma_option === 'on');
|
||
var twitter_perma = (options.services.twitter.perma_option === 'on');
|
||
var gplus_perma = (options.services.gplus.perma_option === 'on');
|
||
|
||
// Menue zum dauerhaften Einblenden der aktiven Dienste via Cookie einbinden
|
||
if ((facebook_on && facebook_perma) || (twitter_on && twitter_perma) || (gplus_on && gplus_perma)) {
|
||
|
||
// Cookies abrufen
|
||
var cookie_list = document.cookie.split(';');
|
||
var cookies = '{';
|
||
var i = 0;
|
||
//dkd-putzek: check if cookie list does not contain undefined entrys
|
||
if(cookie_list[0][1] !=undefined){
|
||
for (; i < cookie_list.length; i += 1) {
|
||
var foo = cookie_list[i].split('=');
|
||
// Spaces and Quotes getting removed
|
||
foo[0] = $.trim(foo[0].replace(/"/g, ''));
|
||
foo[1] = $.trim(foo[1].replace(/"/g, ''));
|
||
cookies += '"' + foo[0] + '":"' + foo[1] + '"';
|
||
if (i < cookie_list.length - 1) {
|
||
cookies += ',';
|
||
}
|
||
}
|
||
}
|
||
|
||
cookies += '}';
|
||
cookies = jQuery.parseJSON(cookies);
|
||
|
||
// Container definieren
|
||
var $container_settings_info = $('li.settings_info', context);
|
||
|
||
// Klasse entfernen, die das i-Icon alleine formatiert, da Perma-Optionen eingeblendet werden
|
||
$container_settings_info.find('.settings_info_menu').removeClass('perma_option_off');
|
||
|
||
// Perma-Optionen-Icon (.settings) und Formular (noch versteckt) einbinden
|
||
$container_settings_info.find('.settings_info_menu').append('<a href="#" class="settings">' + language.settings + '</a><form><fieldset><legend>' + language.settings_perma + '</legend></fieldset></form>');
|
||
|
||
|
||
var random = 'r' + Math.floor(Math.random()*101);
|
||
|
||
// Die Dienste mit <input> und <label>, sowie checked-Status laut Cookie, schreiben
|
||
var checked = ' checked="checked"';
|
||
if (facebook_on && facebook_perma) {
|
||
var perma_status_facebook = cookies.socialSharePrivacy_facebook === 'perma_on' ? checked : '';
|
||
$container_settings_info.find('form fieldset').append(
|
||
'<input type="checkbox" name="perma_status_facebook" id="' + random + '_perma_status_facebook"' + perma_status_facebook + ' /><label for="'+random+'_perma_status_facebook">' + language.services.facebook.perma_display_name + '</label>'
|
||
);
|
||
}
|
||
|
||
if (twitter_on && twitter_perma) {
|
||
var perma_status_twitter = cookies.socialSharePrivacy_twitter === 'perma_on' ? checked : '';
|
||
$container_settings_info.find('form fieldset').append(
|
||
'<input type="checkbox" name="perma_status_twitter" id="' + random + '_perma_status_twitter"' + perma_status_twitter + ' /><label for="'+random+'_perma_status_twitter">' + language.services.twitter.perma_display_name + '</label>'
|
||
);
|
||
}
|
||
|
||
if (gplus_on && gplus_perma) {
|
||
var perma_status_gplus = cookies.socialSharePrivacy_gplus === 'perma_on' ? checked : '';
|
||
$container_settings_info.find('form fieldset').append(
|
||
'<input type="checkbox" name="perma_status_gplus" id="'+random+'_perma_status_gplus"' + perma_status_gplus + ' /><label for="'+random+'_perma_status_gplus">' + language.services.gplus.perma_display_name + '</label>'
|
||
);
|
||
}
|
||
|
||
// Settings-Menue per Tastatur erreichbar machen, die Mouseevents werden getriggert
|
||
$(context).on('click', 'li.settings_info .settings', function (e) {
|
||
e.preventDefault();
|
||
if($(this).data('keyb') == 'on') {
|
||
$('li.settings_info', context).trigger('mouseleave');
|
||
$(this).data('keyb','off');
|
||
}
|
||
else {
|
||
$('li.settings_info .settings', context).trigger('mouseenter');
|
||
$(this).data('keyb','on');
|
||
}
|
||
});
|
||
|
||
// Einstellungs-Menue bei mouseover ein-/ausblenden
|
||
$(context).on('mouseenter', 'li.settings_info .settings', function () {
|
||
var timeout_id = window.setTimeout(function () { $container_settings_info.find('.settings_info_menu').removeClass('off').addClass('on'); }, 500);
|
||
$(this).data('timeout_id', timeout_id);
|
||
});
|
||
$(context).on('mouseleave', 'li.settings_info', function () {
|
||
var timeout_id = $(this).data('timeout_id');
|
||
window.clearTimeout(timeout_id);
|
||
$container_settings_info.find('.settings_info_menu').removeClass('on').addClass('off');
|
||
});
|
||
|
||
// Klick-Interaktion auf <input> um Dienste dauerhaft ein- oder auszuschalten (Cookie wird gesetzt oder geloescht)
|
||
$(context).on('click', 'li.settings_info fieldset input', function (event) {
|
||
var click = event.target.id;
|
||
var service = click.substr(click.lastIndexOf('_') + 1, click.length);
|
||
var cookie_name = 'socialSharePrivacy_' + service;
|
||
|
||
if ($('#' + event.target.id + ':checked').length) {
|
||
cookieSet(cookie_name, 'perma_on', options.cookie_expires, options.cookie_path, options.cookie_domain);
|
||
$('form fieldset label[for=' + click + ']', context).addClass('checked');
|
||
}
|
||
else {
|
||
cookieDel(cookie_name, 'perma_on', options.cookie_path, options.cookie_domain);
|
||
$('form fieldset label[for=' + click + ']', context).removeClass('checked');
|
||
}
|
||
});
|
||
|
||
// Dienste automatisch einbinden, wenn entsprechendes Cookie vorhanden ist
|
||
if (facebook_on && facebook_perma && cookies.socialSharePrivacy_facebook === 'perma_on') {
|
||
$('li.facebook .switch', context).click();
|
||
}
|
||
if (twitter_on && twitter_perma && cookies.socialSharePrivacy_twitter === 'perma_on') {
|
||
$('li.twitter .switch', context).click();
|
||
}
|
||
if (gplus_on && gplus_perma && cookies.socialSharePrivacy_gplus === 'perma_on') {
|
||
$('li.gplus .switch', context).click();
|
||
}
|
||
}
|
||
}); // .then()
|
||
}); // this.each(function ()
|
||
}; // $.fn.socialSharePrivacy = function (settings) {
|
||
}(jQuery));
|
||
/**
|
||
* @class DKD
|
||
* @DKD DKD
|
||
* @extends {}
|
||
*
|
||
* The main entry point which controls the lifecycle of the application.
|
||
*/
|
||
|
||
// add jquery extensions
|
||
|
||
// http://www.quirks-modus.de/archives/341
|
||
$.extend({
|
||
getUrlVars: function(){
|
||
var vars = [], hash;
|
||
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
||
for(var i = 0; i < hashes.length; i++)
|
||
{
|
||
hash = hashes[i].split('=');
|
||
vars.push(hash[0]);
|
||
vars[hash[0]] = hash[1];
|
||
}
|
||
return vars;
|
||
},
|
||
getUrlVar: function(name){
|
||
return $.getUrlVars()[name];
|
||
}
|
||
});
|
||
|
||
|
||
|
||
// begin bootstrapper
|
||
|
||
if (typeof DKD === 'undefined') {
|
||
DKD = jQuery.extend({},{});
|
||
}
|
||
|
||
DKD.Bootstrap = (function () {
|
||
// use strict mode
|
||
'use strict';
|
||
|
||
// init variables first
|
||
var bootstrappers = [];
|
||
|
||
|
||
/**
|
||
* Main bootstrap. This is called by on Ready and calls all registered bootstraps.
|
||
*
|
||
* This method is called automatically.
|
||
*/
|
||
function bootstrap() {
|
||
_invokeBootstrappers();
|
||
};
|
||
|
||
/**
|
||
* Registers a new bootstrap class.
|
||
*
|
||
* @param bootstrap The bootstrap class to be registered.
|
||
* @api
|
||
*/
|
||
function registerBootstrap(bootstrap) {
|
||
bootstrappers.push(bootstrap);
|
||
};
|
||
|
||
|
||
// private
|
||
/**
|
||
* Invoke the registered bootstrappers init function
|
||
*/
|
||
function _invokeBootstrappers() {
|
||
jQuery.each(
|
||
bootstrappers,
|
||
function(index, bootstrapper) {
|
||
bootstrapper.initialize();
|
||
}
|
||
);
|
||
};
|
||
|
||
// expose public functions
|
||
return {
|
||
bootstrap: bootstrap,
|
||
registerBootstrap: registerBootstrap
|
||
};
|
||
}) ();
|
||
|
||
/**
|
||
* on document ready call the onDocumentReady function of the application bootstrapper
|
||
*/
|
||
|
||
$(document).ready(DKD.Bootstrap.bootstrap);
|
||
/**
|
||
* @class DKD.tools
|
||
* @DKD DKD
|
||
* @extends {}
|
||
*
|
||
*
|
||
* @author Hendrik Putzek
|
||
*/
|
||
|
||
if (typeof DKD === 'undefined') {
|
||
DKD = jQuery.extend({},{});
|
||
}
|
||
|
||
DKD.tools = (function () {
|
||
'use strict';
|
||
|
||
/**
|
||
* initialize method
|
||
*/
|
||
|
||
var loadingObjects = {};
|
||
|
||
function initialize() {
|
||
|
||
}
|
||
|
||
// trigger event when all loading items are finished
|
||
function allLoadingDone() {
|
||
$( document ).foundation({
|
||
equalizer : {
|
||
// Specify if Equalizer should make elements equal height once they become stacked.
|
||
equalize_on_stack: true
|
||
}
|
||
});
|
||
}
|
||
|
||
// add loading item to loading stack
|
||
function registerLoadingItem(item){
|
||
loadingObjects[item] = item;
|
||
}
|
||
|
||
// remove item from loading stack
|
||
function setLoadingItemDone(item) {
|
||
var loadingItemsBeforeCheck = Object.keys(loadingObjects).length;
|
||
if(loadingObjects[item]){
|
||
delete loadingObjects[item];
|
||
}
|
||
// if loading stack is empty...
|
||
if (Object.keys(loadingObjects).length === 0 && loadingItemsBeforeCheck !== 0){
|
||
allLoadingDone();
|
||
}
|
||
}
|
||
|
||
function scrollToElement(settingsObject){
|
||
var defaultSettings = {
|
||
elementSelector: '', // Element to scroll to
|
||
animationDuration: 500, // how long shall the scroll take
|
||
offsetTop: 0 // offset of the element after scrolling
|
||
}
|
||
var settings = $.extend({}, defaultSettings, settingsObject);
|
||
$('html,body').animate({scrollTop:$($(settings.elementSelector)).offset().top + settings.offsetTop + 'px'}, settings.animationDuration);
|
||
}
|
||
|
||
// expose public functions
|
||
return {
|
||
initialize: initialize,
|
||
registerLoader: registerLoadingItem,
|
||
setLoadingItemDone: setLoadingItemDone,
|
||
scrollToElement: scrollToElement
|
||
};
|
||
}) ();
|
||
|
||
// Register Bootstrap
|
||
if (typeof DKD.Bootstrap !== 'undefined') {
|
||
DKD.Bootstrap.registerBootstrap(DKD.tools);
|
||
}
|
||
/**
|
||
* @class DKD.initPlugins
|
||
* @DKD DKD
|
||
* @extends {}
|
||
*
|
||
*
|
||
* @author Hendrik Putzek
|
||
*
|
||
* Initialization / config of foundation Javascript
|
||
*/
|
||
|
||
if (typeof DKD === 'undefined') {
|
||
DKD = jQuery.extend({},{});
|
||
}
|
||
|
||
|
||
|
||
DKD.initPlugins = (function () {
|
||
'use strict';
|
||
|
||
// add custom breakpoints
|
||
Foundation.utils.register_media('medium-up', "custom-mq-medium-up");
|
||
Foundation.utils.register_media('large-up', "custom-mq-large-up");
|
||
Foundation.utils.register_media('medium-only', "custom-mq-medium-only");
|
||
Foundation.utils.register_media('small-only', "custom-mq-small-only");
|
||
|
||
// trigger the reflow of Equalizer
|
||
$(document).on('replace', 'img', function() {
|
||
$(document).foundation('equalizer', 'reflow');
|
||
});
|
||
|
||
/**
|
||
* initialize method
|
||
*/
|
||
function initialize() {
|
||
DKD.tools.registerLoader('general');
|
||
initSlider();
|
||
prepareFoundationEqualizer();
|
||
initSocialshareprivacy();
|
||
DKD.tools.setLoadingItemDone('general');
|
||
setupChangeUserDataForm();
|
||
setLightboxOptions();
|
||
openImageGalleryOnLink();
|
||
initLightGallery();
|
||
|
||
$('.youtube-loader').click(function(){
|
||
var params = {
|
||
url: 'https://www.youtube.com/oembed/?url=https://www.youtube.com/watch?v=' + $(this).data('video-id') + '&format=json'
|
||
//callback: 'videodata'
|
||
}
|
||
var $element = $(this);
|
||
$.ajax({
|
||
dataType: 'jsonp',
|
||
url: 'https://json2jsonp.com/',
|
||
data: params,
|
||
success: function(data){
|
||
addVideoContainer($element,data);
|
||
},
|
||
error: function(){
|
||
console.log('error');
|
||
}
|
||
|
||
});
|
||
})
|
||
|
||
function addVideoContainer($element,data){
|
||
var $extendedIframe = $(data.html);
|
||
$extendedIframe.attr('src',$extendedIframe.attr('src').replace('youtube','youtube-nocookie') + '&rel=0&showinfo=0');
|
||
$element.html($extendedIframe).attr('data-loaded','true').fitVids();
|
||
}
|
||
}
|
||
|
||
function initLightGallery(){
|
||
var showThumbnails = false;
|
||
var showThumbByDefault = false;
|
||
if (matchMedia(Foundation.media_queries['medium-up']).matches){
|
||
showThumbnails = true;
|
||
}
|
||
if (matchMedia(Foundation.media_queries['large-up']).matches){
|
||
showThumbByDefault = true;
|
||
}
|
||
|
||
var galleryInstance = $('[data-lightbox]').lightGallery({
|
||
selector: 'this',
|
||
hideBarsDelay: 999999,
|
||
counter: false,
|
||
download: false,
|
||
thumbnail: showThumbnails,
|
||
showThumbByDefault: showThumbByDefault,
|
||
exThumbImage: 'data-exthumbimage',
|
||
closable: false,
|
||
preload: 0
|
||
});
|
||
}
|
||
|
||
function prepareFoundationEqualizer()
|
||
{
|
||
DKD.tools.registerLoader('equalizer');
|
||
// Check if the media query is activated
|
||
if (matchMedia(Foundation.media_queries['medium-only']).matches){
|
||
// removes data-equalizer attribute from elements with data-attribute 'data-equalizer-medium-disable' applied
|
||
// this makes it possible to disable equalizing for certain elements in medium-viewport only
|
||
$('[data-equalizer-medium-disable]').removeAttr('data-equalizer-watch');
|
||
}
|
||
if (matchMedia(Foundation.media_queries['small-only']).matches){
|
||
// disable equalizing completely
|
||
$('[data-equalizer]').removeAttr('data-equalizer');
|
||
}
|
||
Foundation.utils.image_loaded($('img'), function(){
|
||
DKD.tools.setLoadingItemDone('equalizer');
|
||
});
|
||
}
|
||
|
||
//initialize slider
|
||
function initSlider(){
|
||
if($('.slider').length>0){
|
||
DKD.tools.registerLoader('slider');
|
||
$('.slider').on('init', function(){
|
||
positionSliderDots();
|
||
});
|
||
$('.slider').slick({
|
||
dots:true,
|
||
infinite: true,
|
||
slidesToShow: 1,
|
||
arrows: true,
|
||
speed: 800
|
||
});
|
||
|
||
|
||
$(window).on('resize', Foundation.utils.throttle(function(e){
|
||
setSliderHeight();
|
||
}, 300));
|
||
}
|
||
}
|
||
|
||
function setSliderHeight() {
|
||
var sliderImg = $(".slick-active img");
|
||
var height = sliderImg.height() - 25;
|
||
setTimeout(function(){
|
||
//position of dots vertical
|
||
$(".slick-dots").css("top", height);
|
||
|
||
var sliderImgWidth = sliderImg.width();
|
||
var ulWidth = $(".slick-dots").width();
|
||
var coordinate = sliderImgWidth/2 - ulWidth/2;
|
||
|
||
//position of dots horizontal
|
||
$(".slick-dots").css("left", coordinate);
|
||
}, 25);
|
||
|
||
// set this class to remove loader via css
|
||
$('.slider').addClass('loaded');
|
||
DKD.tools.setLoadingItemDone('slider');
|
||
}
|
||
|
||
|
||
//set position of Sliderdots (15px below image)
|
||
function positionSliderDots(){
|
||
// init images in slider (replace them with interchange)
|
||
$('.slider').foundation('interchange', 'reflow');
|
||
// When image is replaced...
|
||
$('.slider .slick-active').on('replace', 'img', function (e, new_path, original_path) {
|
||
// when all images in slider are loaded...
|
||
Foundation.utils.image_loaded($('.slider img'), function(){
|
||
setSliderHeight();
|
||
DKD.tools.setLoadingItemDone('slider');
|
||
});
|
||
});
|
||
}
|
||
|
||
function initSocialshareprivacy () {
|
||
// Documentation :http://www.heise.de/extras/socialshareprivacy/
|
||
|
||
var imagepath = 'typo3conf/ext/rlp/Resources/Public/Images/socialshareprivacy/';
|
||
var settings = {
|
||
'services': {
|
||
'facebook': {
|
||
'perma_option': 'off',
|
||
'sharer': {
|
||
'status': 'on',
|
||
'dummy_img': imagepath + 'dummy_facebook_share_de.png',
|
||
'img': imagepath + 'facebook_share_de.png'
|
||
}
|
||
},
|
||
'twitter': {
|
||
'perma_option': 'off',
|
||
'dummy_img': imagepath + 'dummy_twitter.png'
|
||
},
|
||
'gplus': {
|
||
'perma_option': 'off',
|
||
'dummy_img': imagepath + 'dummy_gplus.png'
|
||
}
|
||
},
|
||
'css_path': '',
|
||
'lang_path': 'typo3conf/ext/rlp/Resources/Public/Javascripts/plugins/jquery.socialshareprivacy/socialshareprivacy/lang/',
|
||
'language': 'de'
|
||
};
|
||
if($('.socialshareprivacy.horizontal').length > 0) {
|
||
$('.socialshareprivacy.horizontal').socialSharePrivacy(settings);
|
||
}
|
||
if($('.socialshareprivacy.vertical').length > 0) {
|
||
settings['alignment'] = 'vertical';
|
||
$('.socialshareprivacy.vertical').socialSharePrivacy(settings);
|
||
}
|
||
}
|
||
|
||
function setupChangeUserDataForm() {
|
||
$('#checkbox-clear').click(function(){
|
||
$('[name="changeUserData[subscribe-news][]"]').prop("checked", $(this).prop("checked"));
|
||
});
|
||
}
|
||
|
||
|
||
|
||
function setLightboxOptions(){
|
||
// If the lightbox contains less than two images set the carousel view to "display: none"
|
||
// to prevent it from showing only one single thumbnail
|
||
$(document.body).on("opened.fndtn.clearing", function(event) {
|
||
if($(event.target.offsetParent).find('.clearing-thumbs li').length < 2){
|
||
$(event.target.offsetParent).find('.carousel').addClass('hidden-in-lightbox');
|
||
}
|
||
});
|
||
}
|
||
|
||
//Open image gallery when clicking on link containing number of images in the image library. Works with multiple image galleries on page.
|
||
function openImageGalleryOnLink() {
|
||
$('[data-trigger-image-gallery]').on('click', function(e) {
|
||
e.preventDefault();
|
||
//stores image gallery id
|
||
var galleryId = $(this).attr('data-trigger-image-gallery');
|
||
//opens image gallery when id of gallery equals to @data-open-image-gallery
|
||
$('[data-open-image-gallery=' + galleryId + '] img').trigger('click');
|
||
});
|
||
}
|
||
|
||
// expose public functions
|
||
return {
|
||
initialize: initialize
|
||
};
|
||
}) ();
|
||
|
||
// Register Bootstrap
|
||
if (typeof DKD.Bootstrap !== 'undefined') {
|
||
DKD.Bootstrap.registerBootstrap(DKD.initPlugins);
|
||
}
|
||
|
||
/* ---------------
|
||
* This is a template file for setting up a new bootstrap
|
||
* Cahcnge "toTopButton" to any name that you wish and that is not used already in the DKD-Namespace.
|
||
*
|
||
* */
|
||
|
||
|
||
|
||
/**
|
||
* @class DKD.toTopButton
|
||
* @DKD DKD
|
||
* @extends {}
|
||
*
|
||
*
|
||
* @author Hendrik Putzek
|
||
*/
|
||
|
||
if (typeof DKD === 'undefined') {
|
||
DKD = jQuery.extend({},{});
|
||
}
|
||
|
||
DKD.toTopButton = (function () {
|
||
|
||
var scrollDuration = 200;
|
||
'use strict';
|
||
|
||
/**
|
||
* initialize method
|
||
*/
|
||
function initialize() {
|
||
$('.scroll-to-top-button').click(function(){
|
||
$('html, body').animate({scrollTop : 0},scrollDuration);
|
||
return false;
|
||
});
|
||
}
|
||
|
||
// expose public functions
|
||
return {
|
||
initialize: initialize
|
||
};
|
||
}) ();
|
||
|
||
// Register Bootstrap
|
||
if (typeof DKD.Bootstrap !== 'undefined') {
|
||
DKD.Bootstrap.registerBootstrap(DKD.toTopButton);
|
||
}
|
||
|
||
/* ---------------
|
||
* This is a template file for scrolling across the table for small and medium breakpoints
|
||
* Change "tableScroll" to any name that you wish and that is not used already in the DKD-Namespace.
|
||
*
|
||
* */
|
||
|
||
|
||
|
||
/**
|
||
* @class DKD.tableScroll
|
||
* @DKD DKD
|
||
* @extends {}
|
||
*
|
||
*
|
||
* @author Nadezhda Petrova
|
||
*/
|
||
|
||
if (typeof DKD === 'undefined') {
|
||
DKD = jQuery.extend({},{});
|
||
}
|
||
|
||
DKD.tableScroll = (function () {
|
||
'use strict';
|
||
|
||
/**
|
||
* Wrap containers around the table element
|
||
*/
|
||
|
||
function styleTable() {
|
||
$('table').wrap( "<div class='table-container-outer'><div class='table-container'></div></div>" );
|
||
$('.table-container-outer').prepend('<div class="table-container-fade"/>');
|
||
}
|
||
/**
|
||
* initialize method
|
||
*/
|
||
function initialize() {
|
||
styleTable();
|
||
}
|
||
|
||
// expose public functions
|
||
return {
|
||
initialize: initialize()
|
||
};
|
||
}) ();
|
||
|
||
/**
|
||
* @class DKD.mainMenu
|
||
* @DKD DKD
|
||
* @extends {}
|
||
*
|
||
*
|
||
* @author Hendrik Putzek
|
||
*/
|
||
|
||
if (typeof DKD === 'undefined') {
|
||
DKD = jQuery.extend({},{});
|
||
}
|
||
|
||
DKD.mainMenu = (function () {
|
||
'use strict';
|
||
|
||
//contains the event name for animationend for the current browser.
|
||
var animationEvent = whichAnimationEvent();
|
||
|
||
var menuSettings = {
|
||
mainMenuSelector: '.main-menu',
|
||
touchMenuSelector: '.mobile-menu',
|
||
touchMenuTrigger: '.menu-trigger',
|
||
touchMenuSearch: '.search-trigger',
|
||
touchMenuSearchBox: '.search-box',
|
||
touchMenuCloseSearchBox:'.js-close-search-box',
|
||
mainMenuContainer: '.dkd_mm_container',
|
||
mainMenuLink: '.dkd_mm_link',
|
||
mainMenuSectionTitleLink: '.dkd_mm_section_title_link',
|
||
mainMenuEntry: '.dkd_mm_entry',
|
||
mainMenuSubLink: '.dkd_mm_sub_link',
|
||
submenuTriggerMarkup: '<button class="submenu-trigger" role="button"></button>',
|
||
submenuList: '.dkd_mm_section_list',
|
||
containerPadding: 30,
|
||
mainMenuContainerGenerated: '',
|
||
rtl: false
|
||
}
|
||
|
||
var $currentSubmenu = {};
|
||
var currentLevel = 0;
|
||
|
||
|
||
/**
|
||
* initialize method
|
||
*/
|
||
function initialize() {
|
||
menuSettings.mainMenuContainerGenerated = menuSettings.mainMenuContainer + '--generated';
|
||
// check for text-direction attribute and use this setting to change menu rendering if rtl is active
|
||
if($('html').attr('dir') == 'rtl'){
|
||
menuSettings.rtl = true;
|
||
}
|
||
if($(menuSettings.mainMenuSelector).length > 0){
|
||
prepareMarkup ();
|
||
setIds();
|
||
if (!matchMedia(Foundation.media_queries['larger-tablet-horizonal-up']).matches){
|
||
setClickHandlersTouch();
|
||
}
|
||
else {
|
||
setCloseOnWindowWidthChange();
|
||
}
|
||
renderSubnavButtons();
|
||
setEventHandlers();
|
||
}
|
||
}
|
||
|
||
function setClickHandlersTouch(){
|
||
// Main menu trigger
|
||
$(menuSettings.touchMenuTrigger).on('click', function(){
|
||
if(!$(this).hasClass('open')) {
|
||
openMainMenu();
|
||
appendMenuLevel($(menuSettings.mainMenuSelector + '.static ' + menuSettings.submenuList).attr('data-menu-id'),1);
|
||
$(this).addClass('open');
|
||
scrollToMenuBar();
|
||
}
|
||
else {
|
||
$(this).removeClass('open');
|
||
closeMainMenu();
|
||
}
|
||
})
|
||
// searchbox trigger
|
||
$(menuSettings.touchMenuSearch + ', ' + menuSettings.touchMenuCloseSearchBox).on('click', function(e){
|
||
$(menuSettings.touchMenuSearch).toggleClass('open');
|
||
$(menuSettings.touchMenuSearchBox).toggleClass('open');
|
||
scrollToMenuBar();
|
||
})
|
||
}
|
||
|
||
function setEventHandlers() {
|
||
setOpenOnHoverHandler();
|
||
setHeadlineClickHandler();
|
||
setTriggerSubmenu();
|
||
setChangeMenuLevelToParents();
|
||
setCloseMenuOnContainerClick();
|
||
setCloseMenuOnLinkClick();
|
||
}
|
||
|
||
function appendMenuLevel(menuId){
|
||
var zIndex = $(menuSettings.mainMenuContainerGenerated + ' ' + menuSettings.submenuList).length + 1;
|
||
var levelToAppend = filterOneLevel($('[data-menu-id="' + menuId + '"]'),zIndex);
|
||
if (matchMedia(Foundation.media_queries['medium-up']).matches) {
|
||
setSubmenuPosition(levelToAppend);
|
||
}
|
||
currentLevel = zIndex;
|
||
$(menuSettings.mainMenuContainerGenerated + ' ' + menuSettings.mainMenuSelector).append(levelToAppend);
|
||
// set Animation depending on menu-level
|
||
if(zIndex === 1){
|
||
setAnimation({
|
||
elementSelector: levelToAppend,
|
||
animationClass: 'fadeIn'
|
||
});
|
||
}
|
||
else {
|
||
setAnimation({
|
||
elementSelector: levelToAppend,
|
||
animationClass: 'fadeInRight'
|
||
});
|
||
}
|
||
setMenuHeight();
|
||
$currentSubmenu = $('[data-menu-id=' + menuId + ']');
|
||
|
||
/**
|
||
* calculates and sets the position of the submenu to be opened
|
||
* resets the position of already opened submenus if they have a position set
|
||
*
|
||
* @param levelToAppend menulevel to be positioned
|
||
*/
|
||
function setSubmenuPosition(levelToAppend) {
|
||
var openMenus = $(menuSettings.mainMenuContainerGenerated + ' ' + menuSettings.submenuList);
|
||
var currentlyActiveElement = openMenus.last();
|
||
if (currentlyActiveElement.length) {
|
||
if (menuSettings.rtl == false) {
|
||
openMenus.css('left','');
|
||
levelToAppend.css('left',currentlyActiveElement.position().left + currentlyActiveElement.outerWidth() + 3);
|
||
}
|
||
|
||
else {
|
||
openMenus.css('right','');
|
||
levelToAppend.css('right', currentlyActiveElement.position().right + currentlyActiveElement.outerWidth() + 3);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
function filterOneLevel($menuElement, zIndex){
|
||
var $submenu = $menuElement.clone().children();
|
||
$submenu.find('ul').remove();
|
||
return $menuElement.clone().css('z-index',zIndex).empty().append($submenu);
|
||
}
|
||
|
||
function renderSubnavButtons() {
|
||
$(menuSettings.mainMenuSubLink +' > ' + menuSettings.mainMenuLink).append(menuSettings.submenuTriggerMarkup);
|
||
}
|
||
|
||
|
||
// add ID's to menu sections and links
|
||
function setIds(){
|
||
$(menuSettings.submenuList).each(function(index,element){
|
||
var randomString = Foundation.utils.random_str(6)
|
||
$(element).attr('data-menu-id',randomString);
|
||
});
|
||
|
||
$(menuSettings.mainMenuSubLink).each(function(index,element){
|
||
var submenuId = $(element).find('> ' + menuSettings.submenuList).attr('data-menu-id');
|
||
$(element).find('> ' + menuSettings.mainMenuLink + ' a').attr('data-submenu-id',submenuId);
|
||
});
|
||
|
||
};
|
||
|
||
function prepareMarkup(){
|
||
var markup =
|
||
[ '<!-- menu container -->',
|
||
'<div class="' + menuSettings.mainMenuContainer.slice(1) + ' ' + menuSettings.mainMenuContainer.slice(1) + '--generated ">',
|
||
' <div class="row">',
|
||
' <div class="' + menuSettings.mainMenuSelector.slice(1) + ' small-12 columns"></div>',
|
||
' </div>',
|
||
'</div>',
|
||
'<!-- menu container end -->'
|
||
].join('\n');
|
||
$(menuSettings.mainMenuSelector).after(markup);
|
||
}
|
||
|
||
function setMenuHeight() {
|
||
var t=0; // the height of the highest element (after the function runs)
|
||
var t_elem; // the highest element (after the function runs)
|
||
var $menuElement = $(menuSettings.mainMenuContainerGenerated + ' ' + menuSettings.mainMenuSelector);
|
||
var $menuContainers = $(menuSettings.mainMenuContainerGenerated + ' ' + menuSettings.submenuList);
|
||
$menuElement.css('height','');
|
||
$menuContainers.css('height','');
|
||
$menuContainers.each(function () {
|
||
var $this = $(this);
|
||
if ( $this.outerHeight() > t ) {
|
||
t_elem=this;
|
||
t=$this.outerHeight();
|
||
}
|
||
});
|
||
if (matchMedia(Foundation.media_queries['medium-up']).matches) {
|
||
$menuElement.css('height', t + menuSettings.containerPadding);
|
||
$menuContainers.css('height', t);
|
||
}
|
||
setOverlayHeight(t + menuSettings.containerPadding);
|
||
}
|
||
|
||
function openMainMenu() {
|
||
$(menuSettings.mainMenuContainer).addClass('open');
|
||
$(menuSettings.mainMenuContainer + ' ' + menuSettings.mainMenuSelector).empty();
|
||
$(menuSettings.mainMenuEntry).removeClass('active');
|
||
setOverlayHeight();
|
||
}
|
||
|
||
function closeMainMenu () {
|
||
// close menu
|
||
$(menuSettings.mainMenuSelector).find('.active').removeClass('active');
|
||
setAnimation ({
|
||
elementSelector: $(menuSettings.mainMenuContainer),
|
||
animationClass: 'fadeOut',
|
||
optRemoveClassAfterwards:'open'
|
||
})
|
||
// update status in mobile menubar
|
||
$(menuSettings.touchMenuTrigger).removeClass('open');
|
||
}
|
||
|
||
|
||
// Helper Function from David Walsh: http://davidwalsh.name/css-animation-callback
|
||
function whichAnimationEvent(){
|
||
var t,
|
||
el = document.createElement("fakeelement");
|
||
|
||
var animations = {
|
||
"animation" : "animationend",
|
||
"OAnimation" : "oAnimationEnd",
|
||
"MozAnimation" : "animationend",
|
||
"WebkitAnimation": "webkitAnimationEnd"
|
||
}
|
||
|
||
for (t in animations){
|
||
if (el.style[t] !== undefined){
|
||
return animations[t];
|
||
}
|
||
}
|
||
}
|
||
|
||
// ---- set Animation Class ---
|
||
//
|
||
// possible parameters:
|
||
// $elementSelector: This is the element to be animated
|
||
// animationClass: This is the css Class to use for animation
|
||
// remove Element after animation (true/false), optional, default is false.
|
||
// remove Class after animation (classname), optional
|
||
function setAnimation(settings, callback){
|
||
if(settings.elementSelector !== undefined) {
|
||
settings.elementSelector.addClass(settings.animationClass);
|
||
// if animations are available
|
||
if($('html').hasClass('cssanimations')){
|
||
settings.elementSelector.one(animationEvent, function(e) {
|
||
// code to execute after animation ends
|
||
handleAnimationEnd();
|
||
});
|
||
}
|
||
// if animations are not possible (ie9)
|
||
else {
|
||
handleAnimationEnd();
|
||
}
|
||
}
|
||
function handleAnimationEnd(){
|
||
settings.elementSelector.removeClass(settings.animationClass);
|
||
if(settings.optRemoveClassAfterwards !== undefined) {
|
||
settings.elementSelector.removeClass(settings.optRemoveClassAfterwards);
|
||
}
|
||
if(settings.optRemoveAfterwards === true) {
|
||
settings.elementSelector.remove();
|
||
}
|
||
if (typeof callback === "function") {
|
||
// Execute the callback function and pass the parameters to it
|
||
callback();
|
||
}
|
||
}
|
||
}
|
||
|
||
function setOverlayHeight(height){
|
||
var overlayHeight= $(document).height() - $(menuSettings.mainMenuContainerGenerated).offset().top;
|
||
// append style for overlay height to head because u can not add before and after styles with jQuery
|
||
$('#overlayHeight').detach();
|
||
jQuery('head').append('<style id="overlayHeight" type="text/css">' + menuSettings.mainMenuContainerGenerated + ':before{height: ' + overlayHeight + 'px;}</style>');
|
||
|
||
$(menuSettings.mainMenuContainerGenerated + ':before').css('height',overlayHeight);
|
||
}
|
||
|
||
function scrollToMenuBar() {
|
||
if (matchMedia(Foundation.media_queries['large-up']).matches) {
|
||
DKD.tools.scrollToElement({
|
||
elementSelector: 'body'
|
||
});
|
||
}
|
||
else {
|
||
DKD.tools.scrollToElement({
|
||
elementSelector: menuSettings.touchMenuSelector
|
||
});
|
||
}
|
||
}
|
||
|
||
function setOpenOnHoverHandler(){
|
||
// set handler to open menu on hover (Desktop)
|
||
$('[data-level="1"] > ' + menuSettings.mainMenuEntry).hoverIntent(function(e){
|
||
if($(this).hasClass('dkd_mm_sub_link')){
|
||
e.preventDefault();
|
||
e.stopPropagation();
|
||
openMainMenu();
|
||
$(this).addClass('active');
|
||
var theElement = e.currentTarget;
|
||
var $menuElement = $(theElement).find('> ' + menuSettings.submenuList);
|
||
var menuId = $menuElement.attr('data-menu-id');
|
||
appendMenuLevel(menuId);
|
||
|
||
}
|
||
else {
|
||
$(this).addClass('active');
|
||
closeMainMenu();
|
||
}
|
||
|
||
},function(){});
|
||
}
|
||
|
||
|
||
function setCloseOnWindowWidthChange() {
|
||
// close menu on width changes
|
||
$(window).on('resize', Foundation.utils.throttle(function (e) {
|
||
closeMainMenu();
|
||
}, 300));
|
||
}
|
||
|
||
function setTriggerSubmenu(){
|
||
// set handler to trigger submenu
|
||
$(document).on('click', menuSettings.mainMenuSubLink + ' .submenu-trigger',function(e){
|
||
e.preventDefault();
|
||
e.stopPropagation();
|
||
var $linkElement = $(e.currentTarget).parent().find('a');
|
||
$(e.currentTarget).parent().addClass('slug');
|
||
var submenuId = $linkElement.attr('data-submenu-id');
|
||
appendMenuLevel(submenuId);
|
||
scrollToMenuBar();
|
||
})
|
||
}
|
||
|
||
function setHeadlineClickHandler(){
|
||
// set handler to close menulevel when clicking on menulevel headline
|
||
$(document).on('click', menuSettings.mainMenuSectionTitleLink ,function(e){
|
||
// if only one container is left: close menu when clicking on menulevel headline
|
||
if($(menuSettings.mainMenuContainerGenerated).find(menuSettings.submenuList).length == 1){
|
||
setAnimation({
|
||
elementSelector: $(menuSettings.mainMenuContainer),
|
||
animationClass: 'fadeOut',
|
||
optRemoveClassAfterwards:'open'
|
||
});
|
||
closeMainMenu();
|
||
}
|
||
else {
|
||
setAnimation({
|
||
elementSelector:$(this).closest(menuSettings.submenuList),
|
||
animationClass: 'fadeOutRight',
|
||
optRemoveAfterwards:true
|
||
},function(){
|
||
setMenuHeight();
|
||
positionLastMenuList();
|
||
});
|
||
}
|
||
$(menuSettings.mainMenuContainer + ' [data-level=' + currentLevel + '] .slug').removeClass('slug');
|
||
scrollToMenuBar();
|
||
});
|
||
}
|
||
|
||
function setChangeMenuLevelToParents(){
|
||
// set handler to change current menu level by clicking on parent menu item
|
||
$('body').on('click',menuSettings.submenuList,function(){
|
||
currentLevel = $(this).data('level') -1;
|
||
$(this).find('.slug').removeClass('slug');
|
||
|
||
// remove all child menus
|
||
setAnimation({
|
||
elementSelector:$(this).nextAll(),
|
||
animationClass: 'fadeOutRight',
|
||
optRemoveAfterwards:true
|
||
},function(){
|
||
positionLastMenuList();
|
||
});
|
||
});
|
||
}
|
||
|
||
function positionLastMenuList(){
|
||
currentLevel = currentLevel -1;
|
||
if (matchMedia(Foundation.media_queries['medium-up']).matches) {
|
||
var $lastMenuPoint = $(menuSettings.mainMenuContainerGenerated).find(menuSettings.submenuList + ':last-child');
|
||
if($lastMenuPoint.prev().length>0){
|
||
$lastMenuPoint.css('left', $lastMenuPoint.prev().position().left + $lastMenuPoint.prev().outerWidth() + 3);
|
||
}
|
||
}
|
||
}
|
||
|
||
function setCloseMenuOnContainerClick(){
|
||
// set handler to close menu container
|
||
|
||
$(menuSettings.mainMenuContainer + ','+ menuSettings.mainMenuSelector).on('click',function(e){
|
||
// do not trigger on subelements
|
||
if( e.target !== this){
|
||
return;
|
||
}
|
||
closeMainMenu();
|
||
setAnimation({
|
||
elementSelector: $(this),
|
||
animationClass: 'fadeOut',
|
||
optRemoveClassAfterwards: 'open'
|
||
});
|
||
});
|
||
|
||
$('.header').click(function(){
|
||
closeMainMenu();
|
||
});
|
||
}
|
||
|
||
function setCloseMenuOnLinkClick(){
|
||
$(document).on('click','.dkd_mm_link a', function(){
|
||
closeMainMenu();
|
||
});
|
||
}
|
||
|
||
|
||
// expose public functions
|
||
return {
|
||
initialize: initialize
|
||
};
|
||
}) ();
|
||
|
||
// Register Bootstrap
|
||
if (typeof DKD.Bootstrap !== 'undefined') {
|
||
DKD.Bootstrap.registerBootstrap(DKD.mainMenu);
|
||
}
|
||
/**
|
||
* @class DKD.collapseOnMobile
|
||
* @DKD DKD
|
||
* @extends {}
|
||
*
|
||
*
|
||
* @author Hendrik Putzek
|
||
*/
|
||
|
||
if (typeof DKD === 'undefined') {
|
||
DKD = jQuery.extend({},{});
|
||
}
|
||
|
||
DKD.collapseOnMobile = (function () {
|
||
'use strict';
|
||
var attributeName = 'data-collapse-on-mobile';
|
||
/**
|
||
* initialize method
|
||
*/
|
||
function initialize() {
|
||
checkSolrFilterStatus();
|
||
initCollapsibles();
|
||
}
|
||
|
||
function checkSolrFilterStatus() {
|
||
// checks if url parameter "tx_solr[filter][0]" is set and opens solr Filtering options on mobile if true.
|
||
if($.getUrlVar('tx_solr%5Bfilter%5D%5B0%5D') !== undefined){
|
||
$('.solr-filter-options').attr(attributeName,'open');
|
||
}
|
||
}
|
||
|
||
function initCollapsibles () {
|
||
$('body').on('click','[data-collapse-on-mobile--header]',function() {
|
||
var $collapseContainer = $(this).closest('[data-collapse-on-mobile]');
|
||
var attr = $collapseContainer.attr(attributeName);
|
||
if (attr === 'open') {
|
||
$collapseContainer.attr(attributeName,'true');
|
||
}
|
||
else {
|
||
$collapseContainer.attr(attributeName,'open');
|
||
}
|
||
});
|
||
}
|
||
|
||
// expose public functions
|
||
return {
|
||
initialize: initialize
|
||
};
|
||
}) ();
|
||
|
||
// Register Bootstrap
|
||
if (typeof DKD.Bootstrap !== 'undefined') {
|
||
DKD.Bootstrap.registerBootstrap(DKD.collapseOnMobile);
|
||
}
|
||
|
||
DKD.cscMailform = (function () {
|
||
'use strict';
|
||
var $errorMessageSelector = $('.csc-mailform span.error');
|
||
/**
|
||
* initialize method
|
||
*/
|
||
function initialize() {
|
||
if($errorMessageSelector.length > 0){
|
||
markInputsAfterValidation();
|
||
}
|
||
|
||
}
|
||
|
||
function markInputsAfterValidation () {
|
||
$errorMessageSelector.parent().next('input, textarea').addClass('error');
|
||
$('.csc-mailform').on('keypress','input, textarea',function(){
|
||
$(this).removeClass('error');
|
||
$(this).parent().find('.error').remove();
|
||
})
|
||
}
|
||
|
||
// expose public functions
|
||
return {
|
||
initialize: initialize
|
||
};
|
||
}) ();
|
||
|
||
// Register Bootstrap
|
||
if (typeof DKD.Bootstrap !== 'undefined') {
|
||
DKD.Bootstrap.registerBootstrap(DKD.cscMailform);
|
||
} |