Update scripts in /docs/assets/js

This commit is contained in:
Michael Rose 2017-09-12 13:02:16 -04:00
parent 58b8cf8416
commit c19db78c5c
5 changed files with 1773 additions and 1962 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,20 +1,31 @@
/*! Magnific Popup - v0.9.9 - 2013-12-27
/*! Magnific Popup - v1.1.0 - 2016-02-20
* http://dimsemenov.com/plugins/magnific-popup/
* Copyright (c) 2013 Dmitry Semenov; */
;(function($) {
* Copyright (c) 2016 Dmitry Semenov; */
;(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS
factory(require('jquery'));
} else {
// Browser globals
factory(window.jQuery || window.Zepto);
}
}(function($) {
/*>>core*/
/**
/*>>core*/
/**
*
* Magnific Popup Core JS file
*
*/
/**
/**
* Private static constants
*/
var CLOSE_EVENT = 'Close',
var CLOSE_EVENT = 'Close',
BEFORE_CLOSE_EVENT = 'BeforeClose',
AFTER_CLOSE_EVENT = 'AfterClose',
BEFORE_APPEND_EVENT = 'BeforeAppend',
@ -28,25 +39,25 @@ var CLOSE_EVENT = 'Close',
PREVENT_CLOSE_CLASS = 'mfp-prevent-close';
/**
/**
* Private vars
*/
var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
/*jshint -W079 */
var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
MagnificPopup = function(){},
_isJQ = !!(window.jQuery),
_prevStatus,
_window = $(window),
_body,
_document,
_prevContentType,
_wrapClasses,
_currPopupType;
/**
/**
* Private functions
*/
var _mfpOn = function(name, f) {
var _mfpOn = function(name, f) {
mfp.ev.on(NS + name + EVENT_NS, f);
},
_getEl = function(className, appendTo, html, raw) {
@ -86,6 +97,7 @@ var _mfpOn = function(name, f) {
// Initialize Magnific Popup only when called at least once
_checkInstance = function() {
if(!$.magnificPopup.instance) {
/*jshint -W020 */
mfp = new MagnificPopup();
mfp.init();
$.magnificPopup.instance = mfp;
@ -111,10 +123,10 @@ var _mfpOn = function(name, f) {
/**
/**
* Public functions
*/
MagnificPopup.prototype = {
MagnificPopup.prototype = {
constructor: MagnificPopup,
@ -124,9 +136,7 @@ MagnificPopup.prototype = {
*/
init: function() {
var appVersion = navigator.appVersion;
mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1;
mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1;
mfp.isLowIE = mfp.isIE7 || mfp.isIE8;
mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener;
mfp.isAndroid = (/android/gi).test(appVersion);
mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
mfp.supportsTransition = supportsTransitions();
@ -145,10 +155,6 @@ MagnificPopup.prototype = {
*/
open: function(data) {
if(!_body) {
_body = $(document.body);
}
var i;
if(data.isObj === false) {
@ -347,7 +353,7 @@ MagnificPopup.prototype = {
$('html').css(windowStyles);
// add everything to DOM
mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || _body );
mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) );
// Save last focused element
mfp._lastFocusedEl = document.activeElement;
@ -438,7 +444,7 @@ MagnificPopup.prototype = {
}
if(mfp._lastFocusedEl) {
if(mfp.st.autoFocusLast && mfp._lastFocusedEl) {
$(mfp._lastFocusedEl).focus(); // put tab focus back
}
mfp.currItem = null;
@ -493,10 +499,6 @@ MagnificPopup.prototype = {
mfp.currItem = item;
if(!mfp.currTemplate[type]) {
var markup = mfp.st[type] ? mfp.st[type].markup : false;
@ -557,8 +559,6 @@ MagnificPopup.prototype = {
},
/**
* Creates Magnific Popup data object based on given data
* @param {int} index Index of item to parse
@ -634,7 +634,7 @@ MagnificPopup.prototype = {
var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey ) ) {
if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) {
return;
}
@ -661,7 +661,6 @@ MagnificPopup.prototype = {
}
}
options.el = $(e.mfpEl);
if(options.delegate) {
options.items = el.find(options.delegate);
@ -789,7 +788,7 @@ MagnificPopup.prototype = {
if(el.is('img')) {
el.attr('src', value);
} else {
el.replaceWith( '<img src="'+value+'" class="' + el.attr('class') + '" />' );
el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );
}
} else {
el.attr(arr[1], value);
@ -806,7 +805,6 @@ MagnificPopup.prototype = {
// thx David
if(mfp.scrollbarSize === undefined) {
var scrollDiv = document.createElement("div");
scrollDiv.id = "mfp-sbm";
scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
document.body.appendChild(scrollDiv);
mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
@ -815,15 +813,15 @@ MagnificPopup.prototype = {
return mfp.scrollbarSize;
}
}; /* MagnificPopup core prototype end */
}; /* MagnificPopup core prototype end */
/**
/**
* Public static functions
*/
$.magnificPopup = {
$.magnificPopup = {
instance: null,
proto: MagnificPopup.prototype,
modules: [],
@ -837,7 +835,6 @@ $.magnificPopup = {
options = $.extend(true, {}, options);
}
options.isObj = true;
options.index = index || 0;
return this.instance.open(options);
@ -896,18 +893,20 @@ $.magnificPopup = {
overflowY: 'auto',
closeMarkup: '<button title="%title%" type="button" class="mfp-close">&times;</button>',
closeMarkup: '<button title="%title%" type="button" class="mfp-close">&#215;</button>',
tClose: 'Close (Esc)',
tLoading: 'Loading...'
tLoading: 'Loading...',
autoFocusLast: true
}
};
};
$.fn.magnificPopup = function(options) {
$.fn.magnificPopup = function(options) {
_checkInstance();
var jqEl = $(this);
@ -954,33 +953,13 @@ $.fn.magnificPopup = function(options) {
}
return jqEl;
};
};
/*>>core*/
//Quick benchmark
/*
var start = performance.now(),
i,
rounds = 1000;
/*>>inline*/
for(i = 0; i < rounds; i++) {
}
console.log('Test #1:', performance.now() - start);
start = performance.now();
for(i = 0; i < rounds; i++) {
}
console.log('Test #2:', performance.now() - start);
*/
/*>>core*/
/*>>inline*/
var INLINE_NS = 'inline',
var INLINE_NS = 'inline',
_hiddenClass,
_inlinePlaceholder,
_lastInlineElement,
@ -991,7 +970,7 @@ var INLINE_NS = 'inline',
}
};
$.magnificPopup.registerModule(INLINE_NS, {
$.magnificPopup.registerModule(INLINE_NS, {
options: {
hiddenClass: 'hide', // will be appended with `mfp-` prefix
markup: '',
@ -1044,16 +1023,16 @@ $.magnificPopup.registerModule(INLINE_NS, {
return template;
}
}
});
});
/*>>inline*/
/*>>inline*/
/*>>ajax*/
var AJAX_NS = 'ajax',
/*>>ajax*/
var AJAX_NS = 'ajax',
_ajaxCur,
_removeAjaxCursor = function() {
if(_ajaxCur) {
_body.removeClass(_ajaxCur);
$(document.body).removeClass(_ajaxCur);
}
},
_destroyAjaxRequest = function() {
@ -1063,7 +1042,7 @@ var AJAX_NS = 'ajax',
}
};
$.magnificPopup.registerModule(AJAX_NS, {
$.magnificPopup.registerModule(AJAX_NS, {
options: {
settings: null,
@ -1081,8 +1060,9 @@ $.magnificPopup.registerModule(AJAX_NS, {
},
getAjax: function(item) {
if(_ajaxCur)
_body.addClass(_ajaxCur);
if(_ajaxCur) {
$(document.body).addClass(_ajaxCur);
}
mfp.updateStatus('loading');
@ -1124,18 +1104,12 @@ $.magnificPopup.registerModule(AJAX_NS, {
return '';
}
}
});
});
/*>>ajax*/
/*>>ajax*/
/*>>image*/
var _imgInterval,
/*>>image*/
var _imgInterval,
_getTitle = function(item) {
if(item.data && item.data.title !== undefined)
return item.data.title;
@ -1152,7 +1126,7 @@ var _imgInterval,
return '';
};
$.magnificPopup.registerModule('image', {
$.magnificPopup.registerModule('image', {
options: {
markup: '<div class="mfp-figure">'+
@ -1182,13 +1156,13 @@ $.magnificPopup.registerModule('image', {
_mfpOn(OPEN_EVENT+ns, function() {
if(mfp.currItem.type === 'image' && imgSt.cursor) {
_body.addClass(imgSt.cursor);
$(document.body).addClass(imgSt.cursor);
}
});
_mfpOn(CLOSE_EVENT+ns, function() {
if(imgSt.cursor) {
_body.removeClass(imgSt.cursor);
$(document.body).removeClass(imgSt.cursor);
}
_window.off('resize' + EVENT_NS);
});
@ -1326,6 +1300,9 @@ $.magnificPopup.registerModule('image', {
if(el.length) {
var img = document.createElement('img');
img.className = 'mfp-img';
if(item.el && item.el.find('img').length) {
img.alt = item.el.find('img').attr('alt');
}
item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
img.src = item.src;
@ -1375,14 +1352,12 @@ $.magnificPopup.registerModule('image', {
return template;
}
}
});
});
/*>>image*/
/*>>image*/
/*>>zoom*/
var hasMozTransform,
/*>>zoom*/
var hasMozTransform,
getHasMozTransform = function() {
if(hasMozTransform === undefined) {
hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
@ -1390,7 +1365,7 @@ var hasMozTransform,
return hasMozTransform;
};
$.magnificPopup.registerModule('zoom', {
$.magnificPopup.registerModule('zoom', {
options: {
enabled: false,
@ -1492,7 +1467,6 @@ $.magnificPopup.registerModule('zoom', {
animatedImg = getElToAnimate(image);
}
animatedImg.css( mfp._getOffset(true) );
mfp.wrap.append(animatedImg);
mfp.content.css('visibility', 'hidden');
@ -1564,15 +1538,15 @@ $.magnificPopup.registerModule('zoom', {
}
}
});
});
/*>>zoom*/
/*>>zoom*/
/*>>iframe*/
/*>>iframe*/
var IFRAME_NS = 'iframe',
var IFRAME_NS = 'iframe',
_emptyPage = '//about:blank',
_fixIframeBugs = function(isShowing) {
@ -1592,7 +1566,7 @@ var IFRAME_NS = 'iframe',
}
};
$.magnificPopup.registerModule(IFRAME_NS, {
$.magnificPopup.registerModule(IFRAME_NS, {
options: {
markup: '<div class="mfp-iframe-scaler">'+
@ -1671,17 +1645,17 @@ $.magnificPopup.registerModule(IFRAME_NS, {
return template;
}
}
});
});
/*>>iframe*/
/*>>iframe*/
/*>>gallery*/
/**
/*>>gallery*/
/**
* Get looped index depending on number of slides
*/
var _getLoopedId = function(index) {
var _getLoopedId = function(index) {
var numSlides = mfp.items.length;
if(index > numSlides - 1) {
return index - numSlides;
@ -1694,7 +1668,7 @@ var _getLoopedId = function(index) {
return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
};
$.magnificPopup.registerModule('gallery', {
$.magnificPopup.registerModule('gallery', {
options: {
enabled: false,
@ -1712,8 +1686,7 @@ $.magnificPopup.registerModule('gallery', {
initGallery: function() {
var gSt = mfp.st.gallery,
ns = '.mfp-gallery',
supportsFastClick = Boolean($.fn.mfpFastClick);
ns = '.mfp-gallery';
mfp.direction = true; // true - next, false - prev
@ -1758,22 +1731,13 @@ $.magnificPopup.registerModule('gallery', {
arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
var eName = supportsFastClick ? 'mfpFastClick' : 'click';
arrowLeft[eName](function() {
arrowLeft.click(function() {
mfp.prev();
});
arrowRight[eName](function() {
arrowRight.click(function() {
mfp.next();
});
// Polyfill for :before and :after (adds elements with classes mfp-a and mfp-b)
if(mfp.isIE7) {
_getEl('b', arrowLeft[0], false, true);
_getEl('a', arrowLeft[0], false, true);
_getEl('b', arrowRight[0], false, true);
_getEl('a', arrowRight[0], false, true);
}
mfp.container.append(arrowLeft.add(arrowRight));
}
});
@ -1791,10 +1755,6 @@ $.magnificPopup.registerModule('gallery', {
_mfpOn(CLOSE_EVENT+ns, function() {
_document.off(ns);
mfp.wrap.off('click'+ns);
if(mfp.arrowLeft && supportsFastClick) {
mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick();
}
mfp.arrowRight = mfp.arrowLeft = null;
});
@ -1855,67 +1815,15 @@ $.magnificPopup.registerModule('gallery', {
item.preloaded = true;
}
}
});
/*
Touch Support that might be implemented some day
addSwipeGesture: function() {
var startX,
moved,
multipleTouches;
return;
var namespace = '.mfp',
addEventNames = function(pref, down, move, up, cancel) {
mfp._tStart = pref + down + namespace;
mfp._tMove = pref + move + namespace;
mfp._tEnd = pref + up + namespace;
mfp._tCancel = pref + cancel + namespace;
};
if(window.navigator.msPointerEnabled) {
addEventNames('MSPointer', 'Down', 'Move', 'Up', 'Cancel');
} else if('ontouchstart' in window) {
addEventNames('touch', 'start', 'move', 'end', 'cancel');
} else {
return;
}
_window.on(mfp._tStart, function(e) {
var oE = e.originalEvent;
multipleTouches = moved = false;
startX = oE.pageX || oE.changedTouches[0].pageX;
}).on(mfp._tMove, function(e) {
if(e.originalEvent.touches.length > 1) {
multipleTouches = e.originalEvent.touches.length;
} else {
//e.preventDefault();
moved = true;
}
}).on(mfp._tEnd + ' ' + mfp._tCancel, function(e) {
if(moved && !multipleTouches) {
var oE = e.originalEvent,
diff = startX - (oE.pageX || oE.changedTouches[0].pageX);
if(diff > 20) {
mfp.next();
} else if(diff < -20) {
mfp.prev();
}
}
});
},
*/
/*>>gallery*/
/*>>gallery*/
/*>>retina*/
/*>>retina*/
var RETINA_NS = 'retina';
var RETINA_NS = 'retina';
$.magnificPopup.registerModule(RETINA_NS, {
$.magnificPopup.registerModule(RETINA_NS, {
options: {
replaceSrc: function(item) {
return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; });
@ -1946,104 +1854,7 @@ $.magnificPopup.registerModule(RETINA_NS, {
}
}
});
/*>>retina*/
/*>>fastclick*/
/**
* FastClick event implementation. (removes 300ms delay on touch devices)
* Based on https://developers.google.com/mobile/articles/fast_buttons
*
* You may use it outside the Magnific Popup by calling just:
*
* $('.your-el').mfpFastClick(function() {
* console.log('Clicked!');
* });
*
* To unbind:
* $('.your-el').destroyMfpFastClick();
*
*
* Note that it's a very basic and simple implementation, it blocks ghost click on the same element where it was bound.
* If you need something more advanced, use plugin by FT Labs https://github.com/ftlabs/fastclick
*
*/
(function() {
var ghostClickDelay = 1000,
supportsTouch = 'ontouchstart' in window,
unbindTouchMove = function() {
_window.off('touchmove'+ns+' touchend'+ns);
},
eName = 'mfpFastClick',
ns = '.'+eName;
// As Zepto.js doesn't have an easy way to add custom events (like jQuery), so we implement it in this way
$.fn.mfpFastClick = function(callback) {
return $(this).each(function() {
var elem = $(this),
lock;
if( supportsTouch ) {
var timeout,
startX,
startY,
pointerMoved,
point,
numPointers;
elem.on('touchstart' + ns, function(e) {
pointerMoved = false;
numPointers = 1;
point = e.originalEvent ? e.originalEvent.touches[0] : e.touches[0];
startX = point.clientX;
startY = point.clientY;
_window.on('touchmove'+ns, function(e) {
point = e.originalEvent ? e.originalEvent.touches : e.touches;
numPointers = point.length;
point = point[0];
if (Math.abs(point.clientX - startX) > 10 ||
Math.abs(point.clientY - startY) > 10) {
pointerMoved = true;
unbindTouchMove();
}
}).on('touchend'+ns, function(e) {
unbindTouchMove();
if(pointerMoved || numPointers > 1) {
return;
}
lock = true;
e.preventDefault();
clearTimeout(timeout);
timeout = setTimeout(function() {
lock = false;
}, ghostClickDelay);
callback();
});
});
}
elem.on('click' + ns, function() {
if(!lock) {
callback();
}
});
});
};
$.fn.destroyMfpFastClick = function() {
$(this).off('touchstart' + ns + ' click' + ns);
if(supportsTouch) _window.off('touchmove'+ns+' touchend'+ns);
};
})();
/*>>fastclick*/
_checkInstance(); })(window.jQuery || window.Zepto);
/*>>retina*/
_checkInstance(); }));

View file

@ -1,8 +1,9 @@
/*!
* jQuery Smooth Scroll - v1.7.2 - 2016-01-23
* jQuery Smooth Scroll - v2.2.0 - 2017-05-05
* https://github.com/kswedberg/jquery-smooth-scroll
* Copyright (c) 2016 Karl Swedberg
* Copyright (c) 2017 Karl Swedberg
* Licensed MIT
*/
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof module&&module.exports?require("jquery"):jQuery)}(function(a){var b="1.7.2",c={},d={exclude:[],excludeWithin:[],offset:0,direction:"top",delegateSelector:null,scrollElement:null,scrollTarget:null,beforeScroll:function(){},afterScroll:function(){},easing:"swing",speed:400,autoCoefficient:2,preventDefault:!0},e=function(b){var c=[],d=!1,e=b.dir&&"left"===b.dir?"scrollLeft":"scrollTop";return this.each(function(){var b=a(this);if(this!==document&&this!==window)return!document.scrollingElement||this!==document.documentElement&&this!==document.body?void(b[e]()>0?c.push(this):(b[e](1),d=b[e]()>0,d&&c.push(this),b[e](0))):(c.push(document.scrollingElement),!1)}),c.length||this.each(function(){this===document.documentElement&&"smooth"===a(this).css("scrollBehavior")&&(c=[this]),c.length||"BODY"!==this.nodeName||(c=[this])}),"first"===b.el&&c.length>1&&(c=[c[0]]),c};a.fn.extend({scrollable:function(a){var b=e.call(this,{dir:a});return this.pushStack(b)},firstScrollable:function(a){var b=e.call(this,{el:"first",dir:a});return this.pushStack(b)},smoothScroll:function(b,c){if(b=b||{},"options"===b)return c?this.each(function(){var b=a(this),d=a.extend(b.data("ssOpts")||{},c);a(this).data("ssOpts",d)}):this.first().data("ssOpts");var d=a.extend({},a.fn.smoothScroll.defaults,b),e=function(b){var c=function(a){return a.replace(/(:|\.|\/)/g,"\\$1")},e=this,f=a(this),g=a.extend({},d,f.data("ssOpts")||{}),h=d.exclude,i=g.excludeWithin,j=0,k=0,l=!0,m={},n=a.smoothScroll.filterPath(location.pathname),o=a.smoothScroll.filterPath(e.pathname),p=location.hostname===e.hostname||!e.hostname,q=g.scrollTarget||o===n,r=c(e.hash);if(r&&!a(r).length&&(l=!1),g.scrollTarget||p&&q&&r){for(;l&&j<h.length;)f.is(c(h[j++]))&&(l=!1);for(;l&&k<i.length;)f.closest(i[k++]).length&&(l=!1)}else l=!1;l&&(g.preventDefault&&b.preventDefault(),a.extend(m,g,{scrollTarget:g.scrollTarget||r,link:e}),a.smoothScroll(m))};return null!==b.delegateSelector?this.undelegate(b.delegateSelector,"click.smoothscroll").delegate(b.delegateSelector,"click.smoothscroll",e):this.unbind("click.smoothscroll").bind("click.smoothscroll",e),this}}),a.smoothScroll=function(b,d){if("options"===b&&"object"==typeof d)return a.extend(c,d);var e,f,g,h,i,j=0,k="offset",l="scrollTop",m={},n={};"number"==typeof b?(e=a.extend({link:null},a.fn.smoothScroll.defaults,c),g=b):(e=a.extend({link:null},a.fn.smoothScroll.defaults,b||{},c),e.scrollElement&&(k="position","static"===e.scrollElement.css("position")&&e.scrollElement.css("position","relative"))),l="left"===e.direction?"scrollLeft":l,e.scrollElement?(f=e.scrollElement,/^(?:HTML|BODY)$/.test(f[0].nodeName)||(j=f[l]())):f=a("html, body").firstScrollable(e.direction),e.beforeScroll.call(f,e),g="number"==typeof b?b:d||a(e.scrollTarget)[k]()&&a(e.scrollTarget)[k]()[e.direction]||0,m[l]=g+j+e.offset,h=e.speed,"auto"===h&&(i=Math.abs(m[l]-f[l]()),h=i/e.autoCoefficient),n={duration:h,easing:e.easing,complete:function(){e.afterScroll.call(e.link,e)}},e.step&&(n.step=e.step),f.length?f.stop().animate(m,n):e.afterScroll.call(e.link,e)},a.smoothScroll.version=b,a.smoothScroll.filterPath=function(a){return a=a||"",a.replace(/^\//,"").replace(/(?:index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")},a.fn.smoothScroll.defaults=d});
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof module&&module.exports?require("jquery"):jQuery)}(function(a){var b={},c={exclude:[],excludeWithin:[],offset:0,direction:"top",delegateSelector:null,scrollElement:null,scrollTarget:null,autoFocus:!1,beforeScroll:function(){},afterScroll:function(){},easing:"swing",speed:400,autoCoefficient:2,preventDefault:!0},d=function(b){var c=[],d=!1,e=b.dir&&"left"===b.dir?"scrollLeft":"scrollTop";return this.each(function(){var b=a(this);if(this!==document&&this!==window)return!document.scrollingElement||this!==document.documentElement&&this!==document.body?void(b[e]()>0?c.push(this):(b[e](1),d=b[e]()>0,d&&c.push(this),b[e](0))):(c.push(document.scrollingElement),!1)}),c.length||this.each(function(){this===document.documentElement&&"smooth"===a(this).css("scrollBehavior")&&(c=[this]),c.length||"BODY"!==this.nodeName||(c=[this])}),"first"===b.el&&c.length>1&&(c=[c[0]]),c},e=/^([\-\+]=)(\d+)/;a.fn.extend({scrollable:function(a){var b=d.call(this,{dir:a});return this.pushStack(b)},firstScrollable:function(a){var b=d.call(this,{el:"first",dir:a});return this.pushStack(b)},smoothScroll:function(b,c){if("options"===(b=b||{}))return c?this.each(function(){var b=a(this),d=a.extend(b.data("ssOpts")||{},c);a(this).data("ssOpts",d)}):this.first().data("ssOpts");var d=a.extend({},a.fn.smoothScroll.defaults,b),e=function(b){var c=function(a){return a.replace(/(:|\.|\/)/g,"\\$1")},e=this,f=a(this),g=a.extend({},d,f.data("ssOpts")||{}),h=d.exclude,i=g.excludeWithin,j=0,k=0,l=!0,m={},n=a.smoothScroll.filterPath(location.pathname),o=a.smoothScroll.filterPath(e.pathname),p=location.hostname===e.hostname||!e.hostname,q=g.scrollTarget||o===n,r=c(e.hash);if(r&&!a(r).length&&(l=!1),g.scrollTarget||p&&q&&r){for(;l&&j<h.length;)f.is(c(h[j++]))&&(l=!1);for(;l&&k<i.length;)f.closest(i[k++]).length&&(l=!1)}else l=!1;l&&(g.preventDefault&&b.preventDefault(),a.extend(m,g,{scrollTarget:g.scrollTarget||r,link:e}),a.smoothScroll(m))};return null!==b.delegateSelector?this.off("click.smoothscroll",b.delegateSelector).on("click.smoothscroll",b.delegateSelector,e):this.off("click.smoothscroll").on("click.smoothscroll",e),this}});var f=function(a){var b={relative:""},c="string"==typeof a&&e.exec(a);return"number"==typeof a?b.px=a:c&&(b.relative=c[1],b.px=parseFloat(c[2])||0),b},g=function(b){var c=a(b.scrollTarget);b.autoFocus&&c.length&&(c[0].focus(),c.is(document.activeElement)||(c.prop({tabIndex:-1}),c[0].focus())),b.afterScroll.call(b.link,b)};a.smoothScroll=function(c,d){if("options"===c&&"object"==typeof d)return a.extend(b,d);var e,h,i,j,k=f(c),l={},m=0,n="offset",o="scrollTop",p={},q={};k.px?e=a.extend({link:null},a.fn.smoothScroll.defaults,b):(e=a.extend({link:null},a.fn.smoothScroll.defaults,c||{},b),e.scrollElement&&(n="position","static"===e.scrollElement.css("position")&&e.scrollElement.css("position","relative")),d&&(k=f(d))),o="left"===e.direction?"scrollLeft":o,e.scrollElement?(h=e.scrollElement,k.px||/^(?:HTML|BODY)$/.test(h[0].nodeName)||(m=h[o]())):h=a("html, body").firstScrollable(e.direction),e.beforeScroll.call(h,e),l=k.px?k:{relative:"",px:a(e.scrollTarget)[n]()&&a(e.scrollTarget)[n]()[e.direction]||0},p[o]=l.relative+(l.px+m+e.offset),i=e.speed,"auto"===i&&(j=Math.abs(p[o]-h[o]()),i=j/e.autoCoefficient),q={duration:i,easing:e.easing,complete:function(){g(e)}},e.step&&(q.step=e.step),h.length?h.stop().animate(p,q):g(e)},a.smoothScroll.version="2.2.0",a.smoothScroll.filterPath=function(a){return a=a||"",a.replace(/^\//,"").replace(/(?:index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")},a.fn.smoothScroll.defaults=c});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long