From 0f4036b7979c9d7107ab97f0e04f8dfdc16b2e65 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Tue, 21 Feb 2017 10:08:09 -0500 Subject: [PATCH] Update theme files in /docs --- .../comments-providers/discourse.html | 4 +- docs/_includes/comments.html | 5 +- docs/_includes/head.html | 15 +++ docs/_includes/masthead.html | 4 +- docs/_includes/seo.html | 6 +- docs/_sass/_masthead.scss | 24 ++++ docs/_sass/_navigation.scss | 72 ++++++----- docs/_sass/_page.scss | 19 ++- docs/_sass/_sidebar.scss | 2 +- docs/_sass/_syntax.scss | 2 +- docs/_sass/_variables.scss | 4 +- docs/assets/js/main.min.js | 8 +- .../js/plugins/jquery.greedy-navigation.js | 114 +++++++++--------- 13 files changed, 174 insertions(+), 105 deletions(-) diff --git a/docs/_includes/comments-providers/discourse.html b/docs/_includes/comments-providers/discourse.html index 1d772381..aca62cc8 100644 --- a/docs/_includes/comments-providers/discourse.html +++ b/docs/_includes/comments-providers/discourse.html @@ -9,5 +9,5 @@ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d); })(); - -{% endif %} \ No newline at end of file + +{% endif %} diff --git a/docs/_includes/comments.html b/docs/_includes/comments.html index dfd0be77..ecf10272 100644 --- a/docs/_includes/comments.html +++ b/docs/_includes/comments.html @@ -1,6 +1,9 @@
{% capture comments_label %}{{ site.data.ui-text[site.locale].comments_label | default: "Comments" }}{% endcapture %} {% case site.comments.provider %} + {% when "discourse" %} +

{{ comments_label }}

+
{% when "disqus" %}

{{ comments_label }}

@@ -77,4 +80,4 @@ {% when "custom" %}
{% endcase %} -
\ No newline at end of file + diff --git a/docs/_includes/head.html b/docs/_includes/head.html index a59b14a2..cb675e2c 100644 --- a/docs/_includes/head.html +++ b/docs/_includes/head.html @@ -16,4 +16,19 @@ + + \ No newline at end of file diff --git a/docs/_includes/masthead.html b/docs/_includes/masthead.html index 5e9a1d59..5856b92d 100644 --- a/docs/_includes/masthead.html +++ b/docs/_includes/masthead.html @@ -2,9 +2,8 @@
diff --git a/docs/_includes/seo.html b/docs/_includes/seo.html index 9279e1a0..ca66e4df 100644 --- a/docs/_includes/seo.html +++ b/docs/_includes/seo.html @@ -23,7 +23,9 @@ {% assign seo_description = seo_description | markdownify | strip_html | strip_newlines | escape_once %} {% endif %} -{% assign seo_author = page.author | default: page.author[0] | default: site.author[0] %} + + +{% assign seo_author = page.author | default: page.author[0] | default: site.author.name %} {% if seo_author %} {% if seo_author.twitter %} {% assign seo_author_twitter = seo_author.twitter %} @@ -37,6 +39,8 @@ {% assign seo_author_twitter = seo_author_twitter | replace: "@", "" %} {% endif %} + + diff --git a/docs/_sass/_masthead.scss b/docs/_sass/_masthead.scss index dec55cd1..39ebd2c7 100644 --- a/docs/_sass/_masthead.scss +++ b/docs/_sass/_masthead.scss @@ -14,6 +14,10 @@ &__inner-wrap { @include container; @include clearfix; + display: -webkit-box; + display: flex; + -webkit-box-pack: justify; + justify-content: space-between; padding: 1em 1em 1em; font-family: $sans-serif-narrow; @@ -31,7 +35,27 @@ } } +.site-title { + display: -webkit-box; + display: flex; + padding: 0.5rem 0; + align-self: stretch; + -webkit-box-align: center; + align-items: center; + font-weight: bold; + z-index: 20; +} + .masthead__menu { + width: 100%; + + .site-nav { + margin-left: 0; + + @include breakpoint($small) { + float: right; + } + } ul { margin: 0; diff --git a/docs/_sass/_navigation.scss b/docs/_sass/_navigation.scss index a5da695d..86f30986 100644 --- a/docs/_sass/_navigation.scss +++ b/docs/_sass/_navigation.scss @@ -175,7 +175,10 @@ .greedy-nav { position: relative; - min-width: 250px; + display: -webkit-box; + display: flex; + -webkit-box-align: center; + align-items: center; background: $background-color; a { @@ -188,34 +191,35 @@ &:hover { color: $masthead-link-color-hover; } + + &.site-title { + margin-left: 0; + } } button { - position: absolute; - height: 100%; - right: 0; padding: 0 0.5rem; + align-self: stretch; border: 0; outline: none; - background-color: $primary-color; color: #fff; + background-color: $primary-color; cursor: pointer; } .visible-links { - display: table; + display: -webkit-box; + display: flex; + -webkit-box-pack: end; + justify-content: flex-end; + -webkit-box-flex: 1; + flex: 1; + padding-right: 2rem; + overflow: hidden; li { - display: table-cell; - vertical-align: middle; - - &:first-child { - font-weight: bold; - - a { - margin-left: 0; - } - } + -webkit-box-flex: 0; + flex: none; &:last-child { a { @@ -238,14 +242,13 @@ -webkit-transition: $global-transition; transition: $global-transition; -webkit-transform: scaleX(0) translate3d(0, 0 , 0); - -ms-transform: scaleX(0) translate3d(0, 0 , 0); transform: scaleX(0) translate3d(0, 0 , 0); /* hide*/ } &:hover:before { -webkit-transform: scaleX(1); - -ms-transform: scaleX(1); - transform: scaleX(1); /* reveal*/ + -ms-transform: scaleX(1); + transform: scaleX(1); /* reveal*/ } } } @@ -259,7 +262,11 @@ border: 1px solid $border-color; border-radius: $border-radius; background: #fff; - box-shadow: 0 0 10px rgba(#000, 0.25); + box-shadow: 0 2px 4px 0 rgba(#000, 0.16), 0 2px 10px 0 rgba(#000, 0.12); + + &.hidden { + display: none; + } a { margin: 0; @@ -348,11 +355,14 @@ height: 0.125em; line-height: 1; background-color: $gray; + -webkit-transition: 0.2s ease-out; transition: 0.2s ease-out; } &:after { - transform: rotate(90deg); + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); } &:hover { @@ -378,13 +388,17 @@ } } - // on hover show expand + /* on hover show expand*/ label:hover:after { - transform: rotate(90deg); + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); } input:checked + label:hover:after { - transform: rotate(0); + -webkit-transform: rotate(0); + -ms-transform: rotate(0); + transform: rotate(0); } ul { @@ -438,8 +452,8 @@ -webkit-transition: 0.3s ease-in-out; transition: 0.3s ease-in-out; -webkit-transform: translate(0, 10%); - -ms-transform: translate(0, 10%); - transform: translate(0, 10%); + -ms-transform: translate(0, 10%); + transform: translate(0, 10%); } } @@ -447,13 +461,13 @@ .nav__list input:checked ~ .nav__items { -webkit-transition: 0.5s ease-in-out; transition: 0.5s ease-in-out; - max-height: 9999px; // exaggerate max-height to accommodate tall lists + max-height: 9999px; /* exaggerate max-height to accommodate tall lists*/ overflow: visible; opacity: 1; margin-top: 1em; -webkit-transform: translate(0, 0); - -ms-transform: translate(0, 0); - transform: translate(0, 0); + -ms-transform: translate(0, 0); + transform: translate(0, 0); } } diff --git a/docs/_sass/_page.scss b/docs/_sass/_page.scss index 1c822397..467e36f8 100644 --- a/docs/_sass/_page.scss +++ b/docs/_sass/_page.scss @@ -8,8 +8,10 @@ margin-top: 2em; padding-left: 1em; padding-right: 1em; - animation: intro 0.3s both; - animation-delay: 0.35s; + -webkit-animation: intro 0.3s both; + animation: intro 0.3s both; + -webkit-animation-delay: 0.35s; + animation-delay: 0.35s; @include breakpoint($x-large) { max-width: $x-large; @@ -111,8 +113,10 @@ position: relative; margin-bottom: 2em; @include clearfix; - animation: intro 0.3s both; - animation-delay: 0.25s; + -webkit-animation: intro 0.3s both; + animation: intro 0.3s both; + -webkit-animation-delay: 0.25s; + animation-delay: 0.25s; &--overlay { position: relative; @@ -122,8 +126,10 @@ background-size: cover; background-repeat: no-repeat; background-position: center; - animation: intro 0.3s both; - animation-delay: 0.25s; + -webkit-animation: intro 0.3s both; + animation: intro 0.3s both; + -webkit-animation-delay: 0.25s; + animation-delay: 0.25s; a { color: #fff; @@ -297,6 +303,7 @@ .page__comments-form { padding: 1em; background: $lighter-gray; + -webkit-transition: $global-transition; transition: $global-transition; &.disabled { diff --git a/docs/_sass/_sidebar.scss b/docs/_sass/_sidebar.scss index 89380600..d34eeb74 100644 --- a/docs/_sass/_sidebar.scss +++ b/docs/_sass/_sidebar.scss @@ -163,7 +163,7 @@ border-radius: $border-radius; background: #fff; z-index: -1; - box-shadow: 0 0 10px rgba(#000, 0.25); + box-shadow: 0 2px 4px 0 rgba(#000, 0.16), 0 2px 10px 0 rgba(#000, 0.12); cursor: default; @include breakpoint($large) { diff --git a/docs/_sass/_syntax.scss b/docs/_sass/_syntax.scss index fb13b73a..68992e34 100644 --- a/docs/_sass/_syntax.scss +++ b/docs/_sass/_syntax.scss @@ -46,7 +46,7 @@ figure.highlight { padding: 5px; border: 0; - // line numbers + /* line numbers*/ &.gutter { padding-right: 1em; color: $light-gray; diff --git a/docs/_sass/_variables.scss b/docs/_sass/_variables.scss index b662d7fa..6352ab2a 100644 --- a/docs/_sass/_variables.scss +++ b/docs/_sass/_variables.scss @@ -123,6 +123,6 @@ $right-sidebar-width-wide : 400px !default; $border-radius : 4px !default; $box-shadow : 0 1px 1px rgba(0, 0, 0, 0.125) !default; -$navicon-width : 28px !default; -$navicon-height : 4px !default; +$navicon-width : 1.5rem !default; +$navicon-height : 0.25rem !default; $global-transition : all 0.2s ease-in-out !default; \ No newline at end of file diff --git a/docs/assets/js/main.min.js b/docs/assets/js/main.min.js index 442e97b9..4121c7b0 100644 --- a/docs/assets/js/main.min.js +++ b/docs/assets/js/main.min.js @@ -1,4 +1,4 @@ -function updateNav(){var e=$btn.hasClass("hidden")?$nav.width():$nav.width()-$btn.width()-30;$vlinks.width()>e?(breaks.push($vlinks.width()),$vlinks.children().last().prependTo($hlinks),$btn.hasClass("hidden")&&$btn.removeClass("hidden")):(e>breaks[breaks.length-1]&&($hlinks.children().first().appendTo($vlinks),breaks.pop()),breaks.length<1&&($btn.addClass("hidden"),$hlinks.addClass("hidden"))),$btn.attr("count",breaks.length),$vlinks.width()>e&&updateNav()}!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=!!e&&"length"in e&&e.length,n=pe.type(e);return"function"===n||pe.isWindow(e)?!1:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function r(e,t,n){if(pe.isFunction(t))return pe.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return pe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(Te.test(t))return pe.filter(t,e,n);t=pe.filter(t,e)}return pe.grep(e,function(e){return pe.inArray(e,t)>-1!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t={};return pe.each(e.match(je)||[],function(e,n){t[n]=!0}),t}function a(){re.addEventListener?(re.removeEventListener("DOMContentLoaded",s),e.removeEventListener("load",s)):(re.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(re.addEventListener||"load"===e.event.type||"complete"===re.readyState)&&(a(),pe.ready())}function l(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(He,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:_e.test(n)?pe.parseJSON(n):n}catch(i){}pe.data(e,t,n)}else n=void 0}return n}function u(e){var t;for(t in e)if(("data"!==t||!pe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(Ie(e)){var i,o,a=pe.expando,s=e.nodeType,l=s?pe.cache:e,u=s?e[a]:e[a]&&a;if(u&&l[u]&&(r||l[u].data)||void 0!==n||"string"!=typeof t)return u||(u=s?e[a]=ne.pop()||pe.guid++:a),l[u]||(l[u]=s?{}:{toJSON:pe.noop}),"object"!=typeof t&&"function"!=typeof t||(r?l[u]=pe.extend(l[u],t):l[u].data=pe.extend(l[u].data,t)),o=l[u],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[pe.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[pe.camelCase(t)])):i=o,i}}function d(e,t,n){if(Ie(e)){var r,i,o=e.nodeType,a=o?pe.cache:e,s=o?e[pe.expando]:pe.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){pe.isArray(t)?t=t.concat(pe.map(t,pe.camelCase)):t in r?t=[t]:(t=pe.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!u(r):!pe.isEmptyObject(r))return}(n||(delete a[s].data,u(a[s])))&&(o?pe.cleanData([e],!0):de.deleteExpando||a!=a.window?delete a[s]:a[s]=void 0)}}}function f(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return pe.css(e,t,"")},l=s(),u=n&&n[3]||(pe.cssNumber[t]?"":"px"),c=(pe.cssNumber[t]||"px"!==u&&+l)&&Me.exec(pe.css(e,t));if(c&&c[3]!==u){u=u||c[3],n=n||[],c=+l||1;do o=o||".5",c/=o,pe.style(e,t,c+u);while(o!==(o=s()/l)&&1!==o&&--a)}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=i)),i}function p(e){var t=We.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function h(e,t){var n,r,i=0,o="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||pe.nodeName(r,t)?o.push(r):pe.merge(o,h(r,t));return void 0===t||t&&pe.nodeName(e,t)?pe.merge([e],o):o}function m(e,t){for(var n,r=0;null!=(n=e[r]);r++)pe._data(n,"globalEval",!t||pe._data(t[r],"globalEval"))}function g(e){Be.test(e.type)&&(e.defaultChecked=e.checked)}function v(e,t,n,r,i){for(var o,a,s,l,u,c,d,f=e.length,v=p(t),y=[],b=0;f>b;b++)if(a=e[b],a||0===a)if("object"===pe.type(a))pe.merge(y,a.nodeType?[a]:a);else if(Ue.test(a)){for(l=l||v.appendChild(t.createElement("div")),u=($e.exec(a)||["",""])[1].toLowerCase(),d=Xe[u]||Xe._default,l.innerHTML=d[1]+pe.htmlPrefilter(a)+d[2],o=d[0];o--;)l=l.lastChild;if(!de.leadingWhitespace&&Re.test(a)&&y.push(t.createTextNode(Re.exec(a)[0])),!de.tbody)for(a="table"!==u||Ye.test(a)?""!==d[1]||Ye.test(a)?0:l:l.firstChild,o=a&&a.childNodes.length;o--;)pe.nodeName(c=a.childNodes[o],"tbody")&&!c.childNodes.length&&a.removeChild(c);for(pe.merge(y,l.childNodes),l.textContent="";l.firstChild;)l.removeChild(l.firstChild);l=v.lastChild}else y.push(t.createTextNode(a));for(l&&v.removeChild(l),de.appendChecked||pe.grep(h(y,"input"),g),b=0;a=y[b++];)if(r&&pe.inArray(a,r)>-1)i&&i.push(a);else if(s=pe.contains(a.ownerDocument,a),l=h(v.appendChild(a),"script"),s&&m(l),n)for(o=0;a=l[o++];)ze.test(a.type||"")&&n.push(a);return l=null,v}function y(){return!0}function b(){return!1}function x(){try{return re.activeElement}catch(e){}}function w(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)w(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=b;else if(!i)return e;return 1===o&&(a=i,i=function(e){return pe().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=pe.guid++)),e.each(function(){pe.event.add(this,t,i,r,n)})}function C(e,t){return pe.nodeName(e,"table")&&pe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function T(e){return e.type=(null!==pe.find.attr(e,"type"))+"/"+e.type,e}function k(e){var t=it.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function E(e,t){if(1===t.nodeType&&pe.hasData(e)){var n,r,i,o=pe._data(e),a=pe._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)pe.event.add(t,n,s[n][r])}a.data&&(a.data=pe.extend({},a.data))}}function S(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!de.noCloneEvent&&t[pe.expando]){i=pe._data(t);for(r in i.events)pe.removeEvent(t,r,i.handle);t.removeAttribute(pe.expando)}"script"===n&&t.text!==e.text?(T(t).text=e.text,k(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),de.html5Clone&&e.innerHTML&&!pe.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Be.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}}function N(e,t,n,r){t=oe.apply([],t);var i,o,a,s,l,u,c=0,d=e.length,f=d-1,p=t[0],m=pe.isFunction(p);if(m||d>1&&"string"==typeof p&&!de.checkClone&&rt.test(p))return e.each(function(i){var o=e.eq(i);m&&(t[0]=p.call(this,i,o.html())),N(o,t,n,r)});if(d&&(u=v(t,e[0].ownerDocument,!1,e,r),i=u.firstChild,1===u.childNodes.length&&(u=i),i||r)){for(s=pe.map(h(u,"script"),T),a=s.length;d>c;c++)o=u,c!==f&&(o=pe.clone(o,!0,!0),a&&pe.merge(s,h(o,"script"))),n.call(e[c],o,c);if(a)for(l=s[s.length-1].ownerDocument,pe.map(s,k),c=0;a>c;c++)o=s[c],ze.test(o.type||"")&&!pe._data(o,"globalEval")&&pe.contains(l,o)&&(o.src?pe._evalUrl&&pe._evalUrl(o.src):pe.globalEval((o.text||o.textContent||o.innerHTML||"").replace(ot,"")));u=i=null}return e}function A(e,t,n){for(var r,i=t?pe.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||pe.cleanData(h(r)),r.parentNode&&(n&&pe.contains(r.ownerDocument,r)&&m(h(r,"script")),r.parentNode.removeChild(r));return e}function j(e,t){var n=pe(t.createElement(e)).appendTo(t.body),r=pe.css(n[0],"display");return n.detach(),r}function L(e){var t=re,n=ut[e];return n||(n=j(e,t),"none"!==n&&n||(lt=(lt||pe("',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(z),T("BeforeChange",function(e,t,n){t!==n&&(t===z?W():n===z&&W(!0))}),T(l+"."+z,function(){W()})},getIframe:function(n,r){var i=n.src,o=t.st.iframe;e.each(o.patterns,function(){return i.indexOf(this.index)>-1?(this.id&&(i="string"==typeof this.id?i.substr(i.lastIndexOf(this.id)+this.id.length,i.length):this.id.call(this,i)),i=this.src.replace("%id%",i),!1):void 0});var a={};return o.srcAction&&(a[o.srcAction]=i),t._parseMarkup(r,a,n),t.updateStatus("ready"),r}}});var X=function(e){var n=t.items.length;return e>n-1?e-n:0>e?n+e:e},U=function(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=t.st.gallery,r=".mfp-gallery",o=Boolean(e.fn.mfpFastClick);return t.direction=!0,n&&n.enabled?(a+=" mfp-gallery",T(p+r,function(){n.navigateByImgClick&&t.wrap.on("click"+r,".mfp-img",function(){return t.items.length>1?(t.next(),!1):void 0}),i.on("keydown"+r,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),T("UpdateStatus"+r,function(e,n){n.text&&(n.text=U(n.text,t.currItem.index,t.items.length))}),T(f+r,function(e,r,i,o){var a=t.items.length;i.counter=a>1?U(n.tCounter,o.index,a):""}),T("BuildControls"+r,function(){if(t.items.length>1&&n.arrows&&!t.arrowLeft){var r=n.arrowMarkup,i=t.arrowLeft=e(r.replace(/%title%/gi,n.tPrev).replace(/%dir%/gi,"left")).addClass(b),a=t.arrowRight=e(r.replace(/%title%/gi,n.tNext).replace(/%dir%/gi,"right")).addClass(b),s=o?"mfpFastClick":"click";i[s](function(){t.prev()}),a[s](function(){t.next()}),t.isIE7&&(k("b",i[0],!1,!0),k("a",i[0],!1,!0),k("b",a[0],!1,!0),k("a",a[0],!1,!0)),t.container.append(i.add(a))}}),T(h+r,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),void T(l+r,function(){i.off(r),t.wrap.off("click"+r),t.arrowLeft&&o&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null})):!1},next:function(){t.direction=!0,t.index=X(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=X(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,n=t.st.gallery.preload,r=Math.min(n[0],t.items.length),i=Math.min(n[1],t.items.length);for(e=1;e<=(t.direction?i:r);e++)t._preloadItem(t.index+e);for(e=1;e<=(t.direction?r:i);e++)t._preloadItem(t.index-e)},_preloadItem:function(n){if(n=X(n),!t.items[n].preloaded){var r=t.items[n];r.parsed||(r=t.parseEl(n)),E("LazyLoad",r),"image"===r.type&&(r.img=e('').on("load.mfploader",function(){r.hasSize=!0}).on("error.mfploader",function(){r.hasSize=!0,r.loadError=!0,E("LazyLoadError",r)}).attr("src",r.src)),r.preloaded=!0}}}});var Y="retina";e.magnificPopup.registerModule(Y,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,n=e.ratio;n=isNaN(n)?n():n,n>1&&(T("ImageHasSize."+Y,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/n,width:"100%"})}),T("ElementParse."+Y,function(t,r){r.src=e.replaceSrc(r,n)}))}}}}),function(){var t=1e3,n="ontouchstart"in window,r=function(){C.off("touchmove"+o+" touchend"+o)},i="mfpFastClick",o="."+i;e.fn.mfpFastClick=function(i){return e(this).each(function(){var a,s=e(this);if(n){var l,u,c,d,f,p;s.on("touchstart"+o,function(e){d=!1,p=1,f=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],u=f.clientX,c=f.clientY,C.on("touchmove"+o,function(e){f=e.originalEvent?e.originalEvent.touches:e.touches,p=f.length,f=f[0],(Math.abs(f.clientX-u)>10||Math.abs(f.clientY-c)>10)&&(d=!0,r())}).on("touchend"+o,function(e){r(),d||p>1||(a=!0,e.preventDefault(),clearTimeout(l),l=setTimeout(function(){a=!1},t),i())})})}s.on("click"+o,function(){a||i()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+o+" click"+o),n&&C.off("touchmove"+o+" touchend"+o)}}(),N()}(window.jQuery||window.Zepto),!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof module&&module.exports?require("jquery"):jQuery)}(function(e){var t="1.7.2",n={},r={exclude:[],excludeWithin:[],offset:0,direction:"top",delegateSelector:null,scrollElement:null,scrollTarget:null,beforeScroll:function(){},afterScroll:function(){},easing:"swing",speed:400,autoCoefficient:2,preventDefault:!0},i=function(t){var n=[],r=!1,i=t.dir&&"left"===t.dir?"scrollLeft":"scrollTop";return this.each(function(){var t=e(this);return this!==document&&this!==window?!document.scrollingElement||this!==document.documentElement&&this!==document.body?void(t[i]()>0?n.push(this):(t[i](1),r=t[i]()>0,r&&n.push(this),t[i](0))):(n.push(document.scrollingElement),!1):void 0}),n.length||this.each(function(){this===document.documentElement&&"smooth"===e(this).css("scrollBehavior")&&(n=[this]),n.length||"BODY"!==this.nodeName||(n=[this])}),"first"===t.el&&n.length>1&&(n=[n[0]]),n};e.fn.extend({scrollable:function(e){var t=i.call(this,{dir:e});return this.pushStack(t)},firstScrollable:function(e){var t=i.call(this,{el:"first",dir:e});return this.pushStack(t)},smoothScroll:function(t,n){if(t=t||{},"options"===t)return n?this.each(function(){var t=e(this),r=e.extend(t.data("ssOpts")||{},n);e(this).data("ssOpts",r)}):this.first().data("ssOpts");var r=e.extend({},e.fn.smoothScroll.defaults,t),i=function(t){var n=function(e){return e.replace(/(:|\.|\/)/g,"\\$1")},i=this,o=e(this),a=e.extend({},r,o.data("ssOpts")||{}),s=r.exclude,l=a.excludeWithin,u=0,c=0,d=!0,f={},p=e.smoothScroll.filterPath(location.pathname),h=e.smoothScroll.filterPath(i.pathname),m=location.hostname===i.hostname||!i.hostname,g=a.scrollTarget||h===p,v=n(i.hash);if(v&&!e(v).length&&(d=!1),a.scrollTarget||m&&g&&v){for(;d&&uImage #%curr% could not be loaded.'},removalDelay:500,mainClass:"mfp-zoom-in",callbacks:{beforeOpen:function(){this.st.image.markup=this.st.image.markup.replace("mfp-figure","mfp-figure mfp-with-anim")}},closeOnContentClick:!0,midClick:!0})}); \ No newline at end of file +!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=!!e&&"length"in e&&e.length,n=pe.type(e);return"function"===n||pe.isWindow(e)?!1:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function r(e,t,n){if(pe.isFunction(t))return pe.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return pe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(Te.test(t))return pe.filter(t,e,n);t=pe.filter(t,e)}return pe.grep(e,function(e){return pe.inArray(e,t)>-1!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t={};return pe.each(e.match(je)||[],function(e,n){t[n]=!0}),t}function a(){re.addEventListener?(re.removeEventListener("DOMContentLoaded",s),e.removeEventListener("load",s)):(re.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(re.addEventListener||"load"===e.event.type||"complete"===re.readyState)&&(a(),pe.ready())}function l(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(He,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:_e.test(n)?pe.parseJSON(n):n}catch(i){}pe.data(e,t,n)}else n=void 0}return n}function u(e){var t;for(t in e)if(("data"!==t||!pe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(Ie(e)){var i,o,a=pe.expando,s=e.nodeType,l=s?pe.cache:e,u=s?e[a]:e[a]&&a;if(u&&l[u]&&(r||l[u].data)||void 0!==n||"string"!=typeof t)return u||(u=s?e[a]=ne.pop()||pe.guid++:a),l[u]||(l[u]=s?{}:{toJSON:pe.noop}),"object"!=typeof t&&"function"!=typeof t||(r?l[u]=pe.extend(l[u],t):l[u].data=pe.extend(l[u].data,t)),o=l[u],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[pe.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[pe.camelCase(t)])):i=o,i}}function d(e,t,n){if(Ie(e)){var r,i,o=e.nodeType,a=o?pe.cache:e,s=o?e[pe.expando]:pe.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){pe.isArray(t)?t=t.concat(pe.map(t,pe.camelCase)):t in r?t=[t]:(t=pe.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!u(r):!pe.isEmptyObject(r))return}(n||(delete a[s].data,u(a[s])))&&(o?pe.cleanData([e],!0):de.deleteExpando||a!=a.window?delete a[s]:a[s]=void 0)}}}function f(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return pe.css(e,t,"")},l=s(),u=n&&n[3]||(pe.cssNumber[t]?"":"px"),c=(pe.cssNumber[t]||"px"!==u&&+l)&&Me.exec(pe.css(e,t));if(c&&c[3]!==u){u=u||c[3],n=n||[],c=+l||1;do o=o||".5",c/=o,pe.style(e,t,c+u);while(o!==(o=s()/l)&&1!==o&&--a)}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=i)),i}function p(e){var t=$e.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function h(e,t){var n,r,i=0,o="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||pe.nodeName(r,t)?o.push(r):pe.merge(o,h(r,t));return void 0===t||t&&pe.nodeName(e,t)?pe.merge([e],o):o}function m(e,t){for(var n,r=0;null!=(n=e[r]);r++)pe._data(n,"globalEval",!t||pe._data(t[r],"globalEval"))}function g(e){Be.test(e.type)&&(e.defaultChecked=e.checked)}function v(e,t,n,r,i){for(var o,a,s,l,u,c,d,f=e.length,v=p(t),y=[],b=0;f>b;b++)if(a=e[b],a||0===a)if("object"===pe.type(a))pe.merge(y,a.nodeType?[a]:a);else if(Ue.test(a)){for(l=l||v.appendChild(t.createElement("div")),u=(ze.exec(a)||["",""])[1].toLowerCase(),d=Xe[u]||Xe._default,l.innerHTML=d[1]+pe.htmlPrefilter(a)+d[2],o=d[0];o--;)l=l.lastChild;if(!de.leadingWhitespace&&We.test(a)&&y.push(t.createTextNode(We.exec(a)[0])),!de.tbody)for(a="table"!==u||Ye.test(a)?"
"!==d[1]||Ye.test(a)?0:l:l.firstChild,o=a&&a.childNodes.length;o--;)pe.nodeName(c=a.childNodes[o],"tbody")&&!c.childNodes.length&&a.removeChild(c);for(pe.merge(y,l.childNodes),l.textContent="";l.firstChild;)l.removeChild(l.firstChild);l=v.lastChild}else y.push(t.createTextNode(a));for(l&&v.removeChild(l),de.appendChecked||pe.grep(h(y,"input"),g),b=0;a=y[b++];)if(r&&pe.inArray(a,r)>-1)i&&i.push(a);else if(s=pe.contains(a.ownerDocument,a),l=h(v.appendChild(a),"script"),s&&m(l),n)for(o=0;a=l[o++];)Re.test(a.type||"")&&n.push(a);return l=null,v}function y(){return!0}function b(){return!1}function x(){try{return re.activeElement}catch(e){}}function w(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)w(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=b;else if(!i)return e;return 1===o&&(a=i,i=function(e){return pe().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=pe.guid++)),e.each(function(){pe.event.add(this,t,i,r,n)})}function C(e,t){return pe.nodeName(e,"table")&&pe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function T(e){return e.type=(null!==pe.find.attr(e,"type"))+"/"+e.type,e}function k(e){var t=it.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function E(e,t){if(1===t.nodeType&&pe.hasData(e)){var n,r,i,o=pe._data(e),a=pe._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)pe.event.add(t,n,s[n][r])}a.data&&(a.data=pe.extend({},a.data))}}function S(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!de.noCloneEvent&&t[pe.expando]){i=pe._data(t);for(r in i.events)pe.removeEvent(t,r,i.handle);t.removeAttribute(pe.expando)}"script"===n&&t.text!==e.text?(T(t).text=e.text,k(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),de.html5Clone&&e.innerHTML&&!pe.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Be.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}}function N(e,t,n,r){t=oe.apply([],t);var i,o,a,s,l,u,c=0,d=e.length,f=d-1,p=t[0],m=pe.isFunction(p);if(m||d>1&&"string"==typeof p&&!de.checkClone&&rt.test(p))return e.each(function(i){var o=e.eq(i);m&&(t[0]=p.call(this,i,o.html())),N(o,t,n,r)});if(d&&(u=v(t,e[0].ownerDocument,!1,e,r),i=u.firstChild,1===u.childNodes.length&&(u=i),i||r)){for(s=pe.map(h(u,"script"),T),a=s.length;d>c;c++)o=u,c!==f&&(o=pe.clone(o,!0,!0),a&&pe.merge(s,h(o,"script"))),n.call(e[c],o,c);if(a)for(l=s[s.length-1].ownerDocument,pe.map(s,k),c=0;a>c;c++)o=s[c],Re.test(o.type||"")&&!pe._data(o,"globalEval")&&pe.contains(l,o)&&(o.src?pe._evalUrl&&pe._evalUrl(o.src):pe.globalEval((o.text||o.textContent||o.innerHTML||"").replace(ot,"")));u=i=null}return e}function A(e,t,n){for(var r,i=t?pe.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||pe.cleanData(h(r)),r.parentNode&&(n&&pe.contains(r.ownerDocument,r)&&m(h(r,"script")),r.parentNode.removeChild(r));return e}function j(e,t){var n=pe(t.createElement(e)).appendTo(t.body),r=pe.css(n[0],"display");return n.detach(),r}function L(e){var t=re,n=ut[e];return n||(n=j(e,t),"none"!==n&&n||(lt=(lt||pe("',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(R),T("BeforeChange",function(e,t,n){t!==n&&(t===R?$():n===R&&$(!0))}),T(l+"."+R,function(){$()})},getIframe:function(n,r){var i=n.src,o=t.st.iframe;e.each(o.patterns,function(){return i.indexOf(this.index)>-1?(this.id&&(i="string"==typeof this.id?i.substr(i.lastIndexOf(this.id)+this.id.length,i.length):this.id.call(this,i)),i=this.src.replace("%id%",i),!1):void 0});var a={};return o.srcAction&&(a[o.srcAction]=i),t._parseMarkup(r,a,n),t.updateStatus("ready"),r}}});var X=function(e){var n=t.items.length;return e>n-1?e-n:0>e?n+e:e},U=function(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=t.st.gallery,r=".mfp-gallery",o=Boolean(e.fn.mfpFastClick);return t.direction=!0,n&&n.enabled?(a+=" mfp-gallery",T(p+r,function(){n.navigateByImgClick&&t.wrap.on("click"+r,".mfp-img",function(){return t.items.length>1?(t.next(),!1):void 0}),i.on("keydown"+r,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),T("UpdateStatus"+r,function(e,n){n.text&&(n.text=U(n.text,t.currItem.index,t.items.length))}),T(f+r,function(e,r,i,o){var a=t.items.length;i.counter=a>1?U(n.tCounter,o.index,a):""}),T("BuildControls"+r,function(){if(t.items.length>1&&n.arrows&&!t.arrowLeft){var r=n.arrowMarkup,i=t.arrowLeft=e(r.replace(/%title%/gi,n.tPrev).replace(/%dir%/gi,"left")).addClass(b),a=t.arrowRight=e(r.replace(/%title%/gi,n.tNext).replace(/%dir%/gi,"right")).addClass(b),s=o?"mfpFastClick":"click";i[s](function(){t.prev()}),a[s](function(){t.next()}),t.isIE7&&(k("b",i[0],!1,!0),k("a",i[0],!1,!0),k("b",a[0],!1,!0),k("a",a[0],!1,!0)),t.container.append(i.add(a))}}),T(h+r,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),void T(l+r,function(){i.off(r),t.wrap.off("click"+r),t.arrowLeft&&o&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null})):!1},next:function(){t.direction=!0,t.index=X(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=X(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,n=t.st.gallery.preload,r=Math.min(n[0],t.items.length),i=Math.min(n[1],t.items.length);for(e=1;e<=(t.direction?i:r);e++)t._preloadItem(t.index+e);for(e=1;e<=(t.direction?r:i);e++)t._preloadItem(t.index-e)},_preloadItem:function(n){if(n=X(n),!t.items[n].preloaded){var r=t.items[n];r.parsed||(r=t.parseEl(n)),E("LazyLoad",r),"image"===r.type&&(r.img=e('').on("load.mfploader",function(){r.hasSize=!0}).on("error.mfploader",function(){r.hasSize=!0,r.loadError=!0,E("LazyLoadError",r)}).attr("src",r.src)),r.preloaded=!0}}}});var Y="retina";e.magnificPopup.registerModule(Y,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,n=e.ratio;n=isNaN(n)?n():n,n>1&&(T("ImageHasSize."+Y,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/n,width:"100%"})}),T("ElementParse."+Y,function(t,r){r.src=e.replaceSrc(r,n)}))}}}}),function(){var t=1e3,n="ontouchstart"in window,r=function(){C.off("touchmove"+o+" touchend"+o)},i="mfpFastClick",o="."+i;e.fn.mfpFastClick=function(i){return e(this).each(function(){var a,s=e(this);if(n){var l,u,c,d,f,p;s.on("touchstart"+o,function(e){d=!1,p=1,f=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],u=f.clientX,c=f.clientY,C.on("touchmove"+o,function(e){f=e.originalEvent?e.originalEvent.touches:e.touches,p=f.length,f=f[0],(Math.abs(f.clientX-u)>10||Math.abs(f.clientY-c)>10)&&(d=!0,r())}).on("touchend"+o,function(e){r(),d||p>1||(a=!0,e.preventDefault(),clearTimeout(l),l=setTimeout(function(){a=!1},t),i())})})}s.on("click"+o,function(){a||i()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+o+" click"+o),n&&C.off("touchmove"+o+" touchend"+o)}}(),N()}(window.jQuery||window.Zepto),!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof module&&module.exports?require("jquery"):jQuery)}(function(e){var t="1.7.2",n={},r={exclude:[],excludeWithin:[],offset:0,direction:"top",delegateSelector:null,scrollElement:null,scrollTarget:null,beforeScroll:function(){},afterScroll:function(){},easing:"swing",speed:400,autoCoefficient:2,preventDefault:!0},i=function(t){var n=[],r=!1,i=t.dir&&"left"===t.dir?"scrollLeft":"scrollTop";return this.each(function(){var t=e(this);return this!==document&&this!==window?!document.scrollingElement||this!==document.documentElement&&this!==document.body?void(t[i]()>0?n.push(this):(t[i](1),r=t[i]()>0,r&&n.push(this),t[i](0))):(n.push(document.scrollingElement),!1):void 0}),n.length||this.each(function(){this===document.documentElement&&"smooth"===e(this).css("scrollBehavior")&&(n=[this]),n.length||"BODY"!==this.nodeName||(n=[this])}),"first"===t.el&&n.length>1&&(n=[n[0]]),n};e.fn.extend({scrollable:function(e){var t=i.call(this,{dir:e});return this.pushStack(t)},firstScrollable:function(e){var t=i.call(this,{el:"first",dir:e});return this.pushStack(t)},smoothScroll:function(t,n){if(t=t||{},"options"===t)return n?this.each(function(){var t=e(this),r=e.extend(t.data("ssOpts")||{},n);e(this).data("ssOpts",r)}):this.first().data("ssOpts");var r=e.extend({},e.fn.smoothScroll.defaults,t),i=function(t){var n=function(e){return e.replace(/(:|\.|\/)/g,"\\$1")},i=this,o=e(this),a=e.extend({},r,o.data("ssOpts")||{}),s=r.exclude,l=a.excludeWithin,u=0,c=0,d=!0,f={},p=e.smoothScroll.filterPath(location.pathname),h=e.smoothScroll.filterPath(i.pathname),m=location.hostname===i.hostname||!i.hostname,g=a.scrollTarget||h===p,v=n(i.hash);if(v&&!e(v).length&&(d=!1),a.scrollTarget||m&&g&&v){for(;d&&uImage #%curr% could not be loaded.'},removalDelay:500,mainClass:"mfp-zoom-in",callbacks:{beforeOpen:function(){this.st.image.markup=this.st.image.markup.replace("mfp-figure","mfp-figure mfp-with-anim")}},closeOnContentClick:!0,midClick:!0})}); \ No newline at end of file diff --git a/docs/assets/js/plugins/jquery.greedy-navigation.js b/docs/assets/js/plugins/jquery.greedy-navigation.js index 3f6c5415..294f78ba 100644 --- a/docs/assets/js/plugins/jquery.greedy-navigation.js +++ b/docs/assets/js/plugins/jquery.greedy-navigation.js @@ -1,72 +1,74 @@ /* -* Greedy Navigation -* -* http://codepen.io/lukejacksonn/pen/PwmwWV -* +GreedyNav.js - https://github.com/lukejacksonn/GreedyNav +Licensed under the MIT license - http://opensource.org/licenses/MIT +Copyright (c) 2015 Luke Jackson */ -var $nav = $('#site-nav'); -var $btn = $('#site-nav button'); -var $vlinks = $('#site-nav .visible-links'); -var $hlinks = $('#site-nav .hidden-links'); +$(document).ready(function(){ -var breaks = []; + var $btn = $('nav.greedy-nav button'); + var $vlinks = $('nav.greedy-nav .visible-links'); + var $hlinks = $('nav.greedy-nav .hidden-links'); -function updateNav() { + var numOfItems = 0; + var totalSpace = 0; + var closingTime = 1000; + var breakWidths = []; - var availableSpace = $btn.hasClass('hidden') ? $nav.width() : $nav.width() - $btn.width() - 30; + // Get initial state + $vlinks.children().outerWidth(function(i, w) { + totalSpace += w; + numOfItems += 1; + breakWidths.push(totalSpace); + }); - // The visible list is overflowing the nav - if($vlinks.width() > availableSpace) { + var availableSpace, numOfVisibleItems, requiredSpace, timer; - // Record the width of the list - breaks.push($vlinks.width()); + function check() { - // Move item to the hidden list - $vlinks.children().last().prependTo($hlinks); + // Get instant state + availableSpace = $vlinks.width() - 10; + numOfVisibleItems = $vlinks.children().length; + requiredSpace = breakWidths[numOfVisibleItems - 1]; - // Show the dropdown btn - if($btn.hasClass('hidden')) { - $btn.removeClass('hidden'); - } - - // The visible list is not overflowing - } else { - - // There is space for another item in the nav - if(availableSpace > breaks[breaks.length-1]) { - - // Move the item to the visible list + // There is not enough space + if (requiredSpace > availableSpace) { + $vlinks.children().last().prependTo($hlinks); + numOfVisibleItems -= 1; + check(); + // There is more than enough space + } else if (availableSpace > breakWidths[numOfVisibleItems]) { $hlinks.children().first().appendTo($vlinks); - breaks.pop(); + numOfVisibleItems += 1; + check(); } - - // Hide the dropdown btn if hidden list is empty - if(breaks.length < 1) { + // Update the button accordingly + $btn.attr("count", numOfItems - numOfVisibleItems); + if (numOfVisibleItems === numOfItems) { $btn.addClass('hidden'); + } else $btn.removeClass('hidden'); + } + + // Window listeners + $(window).resize(function() { + check(); + }); + + $btn.on('click', function() { + $hlinks.toggleClass('hidden'); + clearTimeout(timer); + }); + + $hlinks.on('mouseleave', function() { + // Mouse has left, start the timer + timer = setTimeout(function() { $hlinks.addClass('hidden'); - } - } + }, closingTime); + }).on('mouseenter', function() { + // Mouse is back, cancel the timer + clearTimeout(timer); + }) - // Keep counter updated - $btn.attr("count", breaks.length); + check(); - // Recur if the visible list is still overflowing the nav - if($vlinks.width() > availableSpace) { - updateNav(); - } - -} - -// Window listeners - -$(window).resize(function() { - updateNav(); -}); - -$btn.on('click', function() { - $hlinks.toggleClass('hidden'); - $(this).toggleClass('close'); -}); - -updateNav(); \ No newline at end of file +}); \ No newline at end of file