');
- }
-
- item.inlineElement = el;
- return el;
- }
-
- mfp.updateStatus('ready');
- mfp._parseMarkup(template, {}, item);
- return template;
- }
- }
-});
-
-/*>>inline*/
-
-/*>>ajax*/
-var AJAX_NS = 'ajax',
- _ajaxCur,
- _removeAjaxCursor = function() {
- if(_ajaxCur) {
- _body.removeClass(_ajaxCur);
- }
- },
- _destroyAjaxRequest = function() {
- _removeAjaxCursor();
- if(mfp.req) {
- mfp.req.abort();
- }
- };
-
-$.magnificPopup.registerModule(AJAX_NS, {
-
- options: {
- settings: null,
- cursor: 'mfp-ajax-cur',
- tError: '
The content could not be loaded.'
- },
-
- proto: {
- initAjax: function() {
- mfp.types.push(AJAX_NS);
- _ajaxCur = mfp.st.ajax.cursor;
-
- _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
- _mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
- },
- getAjax: function(item) {
-
- if(_ajaxCur)
- _body.addClass(_ajaxCur);
-
- mfp.updateStatus('loading');
-
- var opts = $.extend({
- url: item.src,
- success: function(data, textStatus, jqXHR) {
- var temp = {
- data:data,
- xhr:jqXHR
- };
-
- _mfpTrigger('ParseAjax', temp);
-
- mfp.appendContent( $(temp.data), AJAX_NS );
-
- item.finished = true;
-
- _removeAjaxCursor();
-
- mfp._setFocus();
-
- setTimeout(function() {
- mfp.wrap.addClass(READY_CLASS);
- }, 16);
-
- mfp.updateStatus('ready');
-
- _mfpTrigger('AjaxContentAdded');
- },
- error: function() {
- _removeAjaxCursor();
- item.finished = item.loadError = true;
- mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
- }
- }, mfp.st.ajax.settings);
-
- mfp.req = $.ajax(opts);
-
- return '';
- }
- }
-});
-
-
-
-
-
-
-
-/*>>ajax*/
-
-/*>>image*/
-var _imgInterval,
- _getTitle = function(item) {
- if(item.data && item.data.title !== undefined)
- return item.data.title;
-
- var src = mfp.st.image.titleSrc;
-
- if(src) {
- if($.isFunction(src)) {
- return src.call(mfp, item);
- } else if(item.el) {
- return item.el.attr(src) || '';
- }
- }
- return '';
- };
-
-$.magnificPopup.registerModule('image', {
-
- options: {
- markup: '
',
- cursor: 'mfp-zoom-out-cur',
- titleSrc: 'title',
- verticalFit: true,
- tError: '
The image could not be loaded.'
- },
-
- proto: {
- initImage: function() {
- var imgSt = mfp.st.image,
- ns = '.image';
-
- mfp.types.push('image');
-
- _mfpOn(OPEN_EVENT+ns, function() {
- if(mfp.currItem.type === 'image' && imgSt.cursor) {
- _body.addClass(imgSt.cursor);
- }
- });
-
- _mfpOn(CLOSE_EVENT+ns, function() {
- if(imgSt.cursor) {
- _body.removeClass(imgSt.cursor);
- }
- _window.off('resize' + EVENT_NS);
- });
-
- _mfpOn('Resize'+ns, mfp.resizeImage);
- if(mfp.isLowIE) {
- _mfpOn('AfterChange', mfp.resizeImage);
- }
- },
- resizeImage: function() {
- var item = mfp.currItem;
- if(!item || !item.img) return;
-
- if(mfp.st.image.verticalFit) {
- var decr = 0;
- // fix box-sizing in ie7/8
- if(mfp.isLowIE) {
- decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
- }
- item.img.css('max-height', mfp.wH-decr);
- }
- },
- _onImageHasSize: function(item) {
- if(item.img) {
-
- item.hasSize = true;
-
- if(_imgInterval) {
- clearInterval(_imgInterval);
- }
-
- item.isCheckingImgSize = false;
-
- _mfpTrigger('ImageHasSize', item);
-
- if(item.imgHidden) {
- if(mfp.content)
- mfp.content.removeClass('mfp-loading');
-
- item.imgHidden = false;
- }
-
- }
- },
-
- /**
- * Function that loops until the image has size to display elements that rely on it asap
- */
- findImageSize: function(item) {
-
- var counter = 0,
- img = item.img[0],
- mfpSetInterval = function(delay) {
-
- if(_imgInterval) {
- clearInterval(_imgInterval);
- }
- // decelerating interval that checks for size of an image
- _imgInterval = setInterval(function() {
- if(img.naturalWidth > 0) {
- mfp._onImageHasSize(item);
- return;
- }
-
- if(counter > 200) {
- clearInterval(_imgInterval);
- }
-
- counter++;
- if(counter === 3) {
- mfpSetInterval(10);
- } else if(counter === 40) {
- mfpSetInterval(50);
- } else if(counter === 100) {
- mfpSetInterval(500);
- }
- }, delay);
- };
-
- mfpSetInterval(1);
- },
-
- getImage: function(item, template) {
-
- var guard = 0,
-
- // image load complete handler
- onLoadComplete = function() {
- if(item) {
- if (item.img[0].complete) {
- item.img.off('.mfploader');
-
- if(item === mfp.currItem){
- mfp._onImageHasSize(item);
-
- mfp.updateStatus('ready');
- }
-
- item.hasSize = true;
- item.loaded = true;
-
- _mfpTrigger('ImageLoadComplete');
-
- }
- else {
- // if image complete check fails 200 times (20 sec), we assume that there was an error.
- guard++;
- if(guard < 200) {
- setTimeout(onLoadComplete,100);
- } else {
- onLoadError();
- }
- }
- }
- },
-
- // image error handler
- onLoadError = function() {
- if(item) {
- item.img.off('.mfploader');
- if(item === mfp.currItem){
- mfp._onImageHasSize(item);
- mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
- }
-
- item.hasSize = true;
- item.loaded = true;
- item.loadError = true;
- }
- },
- imgSt = mfp.st.image;
-
-
- var el = template.find('.mfp-img');
- if(el.length) {
- var img = document.createElement('img');
- img.className = 'mfp-img';
- item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
- img.src = item.src;
-
- // without clone() "error" event is not firing when IMG is replaced by new IMG
- // TODO: find a way to avoid such cloning
- if(el.is('img')) {
- item.img = item.img.clone();
- }
-
- img = item.img[0];
- if(img.naturalWidth > 0) {
- item.hasSize = true;
- } else if(!img.width) {
- item.hasSize = false;
- }
- }
-
- mfp._parseMarkup(template, {
- title: _getTitle(item),
- img_replaceWith: item.img
- }, item);
-
- mfp.resizeImage();
-
- if(item.hasSize) {
- if(_imgInterval) clearInterval(_imgInterval);
-
- if(item.loadError) {
- template.addClass('mfp-loading');
- mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
- } else {
- template.removeClass('mfp-loading');
- mfp.updateStatus('ready');
- }
- return template;
- }
-
- mfp.updateStatus('loading');
- item.loading = true;
-
- if(!item.hasSize) {
- item.imgHidden = true;
- template.addClass('mfp-loading');
- mfp.findImageSize(item);
- }
-
- return template;
- }
- }
-});
-
-
-
-/*>>image*/
-
-/*>>zoom*/
-var hasMozTransform,
- getHasMozTransform = function() {
- if(hasMozTransform === undefined) {
- hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
- }
- return hasMozTransform;
- };
-
-$.magnificPopup.registerModule('zoom', {
-
- options: {
- enabled: false,
- easing: 'ease-in-out',
- duration: 300,
- opener: function(element) {
- return element.is('img') ? element : element.find('img');
- }
- },
-
- proto: {
-
- initZoom: function() {
- var zoomSt = mfp.st.zoom,
- ns = '.zoom',
- image;
-
- if(!zoomSt.enabled || !mfp.supportsTransition) {
- return;
- }
-
- var duration = zoomSt.duration,
- getElToAnimate = function(image) {
- var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
- transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
- cssObj = {
- position: 'fixed',
- zIndex: 9999,
- left: 0,
- top: 0,
- '-webkit-backface-visibility': 'hidden'
- },
- t = 'transition';
-
- cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;
-
- newImg.css(cssObj);
- return newImg;
- },
- showMainContent = function() {
- mfp.content.css('visibility', 'visible');
- },
- openTimeout,
- animatedImg;
-
- _mfpOn('BuildControls'+ns, function() {
- if(mfp._allowZoom()) {
-
- clearTimeout(openTimeout);
- mfp.content.css('visibility', 'hidden');
-
- // Basically, all code below does is clones existing image, puts in on top of the current one and animated it
-
- image = mfp._getItemToZoom();
-
- if(!image) {
- showMainContent();
- return;
- }
-
- animatedImg = getElToAnimate(image);
-
- animatedImg.css( mfp._getOffset() );
-
- mfp.wrap.append(animatedImg);
-
- openTimeout = setTimeout(function() {
- animatedImg.css( mfp._getOffset( true ) );
- openTimeout = setTimeout(function() {
-
- showMainContent();
-
- setTimeout(function() {
- animatedImg.remove();
- image = animatedImg = null;
- _mfpTrigger('ZoomAnimationEnded');
- }, 16); // avoid blink when switching images
-
- }, duration); // this timeout equals animation duration
-
- }, 16); // by adding this timeout we avoid short glitch at the beginning of animation
-
-
- // Lots of timeouts...
- }
- });
- _mfpOn(BEFORE_CLOSE_EVENT+ns, function() {
- if(mfp._allowZoom()) {
-
- clearTimeout(openTimeout);
-
- mfp.st.removalDelay = duration;
-
- if(!image) {
- image = mfp._getItemToZoom();
- if(!image) {
- return;
- }
- animatedImg = getElToAnimate(image);
- }
-
-
- animatedImg.css( mfp._getOffset(true) );
- mfp.wrap.append(animatedImg);
- mfp.content.css('visibility', 'hidden');
-
- setTimeout(function() {
- animatedImg.css( mfp._getOffset() );
- }, 16);
- }
-
- });
-
- _mfpOn(CLOSE_EVENT+ns, function() {
- if(mfp._allowZoom()) {
- showMainContent();
- if(animatedImg) {
- animatedImg.remove();
- }
- image = null;
- }
- });
- },
-
- _allowZoom: function() {
- return mfp.currItem.type === 'image';
- },
-
- _getItemToZoom: function() {
- if(mfp.currItem.hasSize) {
- return mfp.currItem.img;
- } else {
- return false;
- }
- },
-
- // Get element postion relative to viewport
- _getOffset: function(isLarge) {
- var el;
- if(isLarge) {
- el = mfp.currItem.img;
- } else {
- el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);
- }
-
- var offset = el.offset();
- var paddingTop = parseInt(el.css('padding-top'),10);
- var paddingBottom = parseInt(el.css('padding-bottom'),10);
- offset.top -= ( $(window).scrollTop() - paddingTop );
-
-
- /*
-
- Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.
-
- */
- var obj = {
- width: el.width(),
- // fix Zepto height+padding issue
- height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop
- };
-
- // I hate to do this, but there is no another option
- if( getHasMozTransform() ) {
- obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';
- } else {
- obj.left = offset.left;
- obj.top = offset.top;
- }
- return obj;
- }
-
- }
-});
-
-
-
-/*>>zoom*/
-
-/*>>iframe*/
-
-var IFRAME_NS = 'iframe',
- _emptyPage = '//about:blank',
-
- _fixIframeBugs = function(isShowing) {
- if(mfp.currTemplate[IFRAME_NS]) {
- var el = mfp.currTemplate[IFRAME_NS].find('iframe');
- if(el.length) {
- // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
- if(!isShowing) {
- el[0].src = _emptyPage;
- }
-
- // IE8 black screen bug fix
- if(mfp.isIE8) {
- el.css('display', isShowing ? 'block' : 'none');
- }
- }
- }
- };
-
-$.magnificPopup.registerModule(IFRAME_NS, {
-
- options: {
- markup: '
',
-
- srcAction: 'iframe_src',
-
- // we don't care and support only one default type of URL by default
- 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() {
- mfp.types.push(IFRAME_NS);
-
- _mfpOn('BeforeChange', function(e, prevType, newType) {
- if(prevType !== newType) {
- if(prevType === IFRAME_NS) {
- _fixIframeBugs(); // iframe if removed
- } else if(newType === IFRAME_NS) {
- _fixIframeBugs(true); // iframe is showing
- }
- }// else {
- // iframe source is switched, don't do anything
- //}
- });
-
- _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {
- _fixIframeBugs();
- });
- },
-
- getIframe: function(item, template) {
- var embedSrc = item.src;
- var iframeSt = mfp.st.iframe;
-
- $.each(iframeSt.patterns, function() {
- if(embedSrc.indexOf( this.index ) > -1) {
- if(this.id) {
- if(typeof this.id === 'string') {
- embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
- } else {
- embedSrc = this.id.call( this, embedSrc );
- }
- }
- embedSrc = this.src.replace('%id%', embedSrc );
- return false; // break;
- }
- });
-
- var dataObj = {};
- if(iframeSt.srcAction) {
- dataObj[iframeSt.srcAction] = embedSrc;
- }
- mfp._parseMarkup(template, dataObj, item);
-
- mfp.updateStatus('ready');
-
- return template;
- }
- }
-});
-
-
-
-/*>>iframe*/
-
-/*>>gallery*/
-/**
- * Get looped index depending on number of slides
- */
-var _getLoopedId = function(index) {
- var numSlides = mfp.items.length;
- if(index > numSlides - 1) {
- return index - numSlides;
- } else if(index < 0) {
- return numSlides + index;
- }
- return index;
- },
- _replaceCurrTotal = function(text, curr, total) {
- return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
- };
-
-$.magnificPopup.registerModule('gallery', {
-
- options: {
- enabled: false,
- arrowMarkup: '
',
- preload: [0,2],
- navigateByImgClick: true,
- arrows: true,
-
- tPrev: 'Previous (Left arrow key)',
- tNext: 'Next (Right arrow key)',
- tCounter: '%curr% of %total%'
- },
-
- proto: {
- initGallery: function() {
-
- var gSt = mfp.st.gallery,
- ns = '.mfp-gallery',
- supportsFastClick = Boolean($.fn.mfpFastClick);
-
- mfp.direction = true; // true - next, false - prev
-
- if(!gSt || !gSt.enabled ) return false;
-
- _wrapClasses += ' mfp-gallery';
-
- _mfpOn(OPEN_EVENT+ns, function() {
-
- if(gSt.navigateByImgClick) {
- mfp.wrap.on('click'+ns, '.mfp-img', function() {
- if(mfp.items.length > 1) {
- mfp.next();
- return false;
- }
- });
- }
-
- _document.on('keydown'+ns, function(e) {
- if (e.keyCode === 37) {
- mfp.prev();
- } else if (e.keyCode === 39) {
- mfp.next();
- }
- });
- });
-
- _mfpOn('UpdateStatus'+ns, function(e, data) {
- if(data.text) {
- data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
- }
- });
-
- _mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {
- var l = mfp.items.length;
- values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';
- });
-
- _mfpOn('BuildControls' + ns, function() {
- if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
- var markup = gSt.arrowMarkup,
- 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() {
- mfp.prev();
- });
- arrowRight[eName](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));
- }
- });
-
- _mfpOn(CHANGE_EVENT+ns, function() {
- if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
-
- mfp._preloadTimeout = setTimeout(function() {
- mfp.preloadNearbyImages();
- mfp._preloadTimeout = null;
- }, 16);
- });
-
-
- _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;
- });
-
- },
- next: function() {
- mfp.direction = true;
- mfp.index = _getLoopedId(mfp.index + 1);
- mfp.updateItemHTML();
- },
- prev: function() {
- mfp.direction = false;
- mfp.index = _getLoopedId(mfp.index - 1);
- mfp.updateItemHTML();
- },
- goTo: function(newIndex) {
- mfp.direction = (newIndex >= mfp.index);
- mfp.index = newIndex;
- mfp.updateItemHTML();
- },
- preloadNearbyImages: function() {
- var p = mfp.st.gallery.preload,
- preloadBefore = Math.min(p[0], mfp.items.length),
- preloadAfter = Math.min(p[1], mfp.items.length),
- i;
-
- for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
- mfp._preloadItem(mfp.index+i);
- }
- for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
- mfp._preloadItem(mfp.index-i);
- }
- },
- _preloadItem: function(index) {
- index = _getLoopedId(index);
-
- if(mfp.items[index].preloaded) {
- return;
- }
-
- var item = mfp.items[index];
- if(!item.parsed) {
- item = mfp.parseEl( index );
- }
-
- _mfpTrigger('LazyLoad', item);
-
- if(item.type === 'image') {
- item.img = $('
![]()
').on('load.mfploader', function() {
- item.hasSize = true;
- }).on('error.mfploader', function() {
- item.hasSize = true;
- item.loadError = true;
- _mfpTrigger('LazyLoadError', item);
- }).attr('src', item.src);
- }
-
-
- 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*/
-
-/*>>retina*/
-
-var RETINA_NS = 'retina';
-
-$.magnificPopup.registerModule(RETINA_NS, {
- options: {
- replaceSrc: function(item) {
- return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; });
- },
- ratio: 1 // Function or number. Set to 1 to disable.
- },
- proto: {
- initRetina: function() {
- if(window.devicePixelRatio > 1) {
-
- var st = mfp.st.retina,
- ratio = st.ratio;
-
- ratio = !isNaN(ratio) ? ratio : ratio();
-
- if(ratio > 1) {
- _mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {
- item.img.css({
- 'max-width': item.img[0].naturalWidth / ratio,
- 'width': '100%'
- });
- });
- _mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {
- item.src = st.replaceSrc(item, ratio);
- });
- }
- }
-
- }
- }
-});
-
-/*>>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);
\ No newline at end of file
diff --git a/vendors/jquery-magnific-popup/jquery.magnific-popup.min.js b/vendors/jquery-magnific-popup/jquery.magnific-popup.min.js
deleted file mode 100644
index 4e3e16ffd..000000000
--- a/vendors/jquery-magnific-popup/jquery.magnific-popup.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! Magnific Popup - v0.9.9 - 2014-09-06
-* http://dimsemenov.com/plugins/magnific-popup/
-* Copyright (c) 2014 Dmitry Semenov; */
-(function(e){var t,n,i,o,r,a,s,l="Close",c="BeforeClose",d="AfterClose",u="BeforeAppend",p="MarkupParse",f="Open",m="Change",g="mfp",h="."+g,v="mfp-ready",C="mfp-removing",y="mfp-prevent-close",w=function(){},b=!!window.jQuery,I=e(window),x=function(e,n){t.ev.on(g+e+h,n)},k=function(t,n,i,o){var r=document.createElement("div");return r.className="mfp-"+t,i&&(r.innerHTML=i),o?n&&n.appendChild(r):(r=e(r),n&&r.appendTo(n)),r},T=function(n,i){t.ev.triggerHandler(g+n,i),t.st.callbacks&&(n=n.charAt(0).toLowerCase()+n.slice(1),t.st.callbacks[n]&&t.st.callbacks[n].apply(t,e.isArray(i)?i:[i]))},E=function(n){return n===s&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),s=n),t.currTemplate.closeBtn},_=function(){e.magnificPopup.instance||(t=new w,t.init(),e.magnificPopup.instance=t)},S=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1};w.prototype={constructor:w,init:function(){var n=navigator.appVersion;t.isIE7=-1!==n.indexOf("MSIE 7."),t.isIE8=-1!==n.indexOf("MSIE 8."),t.isLowIE=t.isIE7||t.isIE8,t.isAndroid=/android/gi.test(n),t.isIOS=/iphone|ipad|ipod/gi.test(n),t.supportsTransition=S(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),o=e(document),t.popupsCache={}},open:function(n){i||(i=e(document.body));var r;if(n.isObj===!1){t.items=n.items.toArray(),t.index=0;var s,l=n.items;for(r=0;l.length>r;r++)if(s=l[r],s.parsed&&(s=s.el[0]),s===n.el[0]){t.index=r;break}}else t.items=e.isArray(n.items)?n.items:[n.items],t.index=n.index||0;if(t.isOpen)return t.updateItemHTML(),void 0;t.types=[],a="",t.ev=n.mainEl&&n.mainEl.length?n.mainEl.eq(0):o,n.key?(t.popupsCache[n.key]||(t.popupsCache[n.key]={}),t.currTemplate=t.popupsCache[n.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,n),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=k("bg").on("click"+h,function(){t.close()}),t.wrap=k("wrap").attr("tabindex",-1).on("click"+h,function(e){t._checkIfClose(e.target)&&t.close()}),t.container=k("container",t.wrap)),t.contentContainer=k("content"),t.st.preloader&&(t.preloader=k("preloader",t.container,t.st.tLoading));var c=e.magnificPopup.modules;for(r=0;c.length>r;r++){var d=c[r];d=d.charAt(0).toUpperCase()+d.slice(1),t["init"+d].call(t)}T("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(x(p,function(e,t,n,i){n.close_replaceWith=E(i.type)}),a+=" mfp-close-btn-in"):t.wrap.append(E())),t.st.alignTop&&(a+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:I.scrollTop(),position:"absolute"}),(t.st.fixedBgPos===!1||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:o.height(),position:"absolute"}),t.st.enableEscapeKey&&o.on("keyup"+h,function(e){27===e.keyCode&&t.close()}),I.on("resize"+h,function(){t.updateSize()}),t.st.closeOnContentClick||(a+=" mfp-auto-cursor"),a&&t.wrap.addClass(a);var u=t.wH=I.height(),m={};if(t.fixedContentPos&&t._hasScrollBar(u)){var g=t._getScrollbarSize();g&&(m.marginRight=g)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):m.overflow="hidden");var C=t.st.mainClass;return t.isIE7&&(C+=" mfp-ie7"),C&&t._addClassToMFP(C),t.updateItemHTML(),T("BuildControls"),e("html").css(m),t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo||i),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP(v),t._setFocus()):t.bgOverlay.addClass(v),o.on("focusin"+h,t._onFocusIn)},16),t.isOpen=!0,t.updateSize(u),T(f),n},close:function(){t.isOpen&&(T(c),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP(C),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){T(l);var n=C+" "+v+" ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(n+=t.st.mainClass+" "),t._removeClassFromMFP(n),t.fixedContentPos){var i={marginRight:""};t.isIE7?e("body, html").css("overflow",""):i.overflow="",e("html").css(i)}o.off("keyup"+h+" focusin"+h),t.ev.off(h),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&t.currTemplate[t.currItem.type]!==!0||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,T(d)},updateSize:function(e){if(t.isIOS){var n=document.documentElement.clientWidth/window.innerWidth,i=window.innerHeight*n;t.wrap.css("height",i),t.wH=i}else t.wH=e||I.height();t.fixedContentPos||t.wrap.css("height",t.wH),T("Resize")},updateItemHTML:function(){var n=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),n.parsed||(n=t.parseEl(t.index));var i=n.type;if(T("BeforeChange",[t.currItem?t.currItem.type:"",i]),t.currItem=n,!t.currTemplate[i]){var o=t.st[i]?t.st[i].markup:!1;T("FirstMarkupParse",o),t.currTemplate[i]=o?e(o):!0}r&&r!==n.type&&t.container.removeClass("mfp-"+r+"-holder");var a=t["get"+i.charAt(0).toUpperCase()+i.slice(1)](n,t.currTemplate[i]);t.appendContent(a,i),n.preloaded=!0,T(m,n),r=n.type,t.container.prepend(t.contentContainer),T("AfterChange")},appendContent:function(e,n){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&t.currTemplate[n]===!0?t.content.find(".mfp-close").length||t.content.append(E()):t.content=e:t.content="",T(u),t.container.addClass("mfp-"+n+"-holder"),t.contentContainer.append(t.content)},parseEl:function(n){var i,o=t.items[n];if(o.tagName?o={el:e(o)}:(i=o.type,o={data:o,src:o.src}),o.el){for(var r=t.types,a=0;r.length>a;a++)if(o.el.hasClass("mfp-"+r[a])){i=r[a];break}o.src=o.el.attr("data-mfp-src"),o.src||(o.src=o.el.attr("href"))}return o.type=i||t.st.type||"inline",o.index=n,o.parsed=!0,t.items[n]=o,T("ElementParse",o),t.items[n]},addGroup:function(e,n){var i=function(i){i.mfpEl=this,t._openClick(i,e,n)};n||(n={});var o="click.magnificPopup";n.mainEl=e,n.items?(n.isObj=!0,e.off(o).on(o,i)):(n.isObj=!1,n.delegate?e.off(o).on(o,n.delegate,i):(n.items=e,e.off(o).on(o,i)))},_openClick:function(n,i,o){var r=void 0!==o.midClick?o.midClick:e.magnificPopup.defaults.midClick;if(r||2!==n.which&&!n.ctrlKey&&!n.metaKey){var a=void 0!==o.disableOn?o.disableOn:e.magnificPopup.defaults.disableOn;if(a)if(e.isFunction(a)){if(!a.call(t))return!0}else if(a>I.width())return!0;n.type&&(n.preventDefault(),t.isOpen&&n.stopPropagation()),o.el=e(n.mfpEl),o.delegate&&(o.items=i.find(o.delegate)),t.open(o)}},updateStatus:function(e,i){if(t.preloader){n!==e&&t.container.removeClass("mfp-s-"+n),i||"loading"!==e||(i=t.st.tLoading);var o={status:e,text:i};T("UpdateStatus",o),e=o.status,i=o.text,t.preloader.html(i),t.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),t.container.addClass("mfp-s-"+e),n=e}},_checkIfClose:function(n){if(!e(n).hasClass(y)){var i=t.st.closeOnContentClick,o=t.st.closeOnBgClick;if(i&&o)return!0;if(!t.content||e(n).hasClass("mfp-close")||t.preloader&&n===t.preloader[0])return!0;if(n===t.content[0]||e.contains(t.content[0],n)){if(i)return!0}else if(o&&e.contains(document,n))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?o.height():document.body.scrollHeight)>(e||I.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},_onFocusIn:function(n){return n.target===t.wrap[0]||e.contains(t.wrap[0],n.target)?void 0:(t._setFocus(),!1)},_parseMarkup:function(t,n,i){var o;i.data&&(n=e.extend(i.data,n)),T(p,[t,n,i]),e.each(n,function(e,n){if(void 0===n||n===!1)return!0;if(o=e.split("_"),o.length>1){var i=t.find(h+"-"+o[0]);if(i.length>0){var r=o[1];"replaceWith"===r?i[0]!==n[0]&&i.replaceWith(n):"img"===r?i.is("img")?i.attr("src",n):i.replaceWith('

'):i.attr(o[1],n)}}else t.find(h+"-"+e).html(n)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:w.prototype,modules:[],open:function(t,n){return _(),t=t?e.extend(!0,{},t):{},t.isObj=!0,t.index=n||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,n){n.options&&(e.magnificPopup.defaults[t]=n.options),e.extend(this.proto,n.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'
',tClose:"Close (Esc)",tLoading:"Loading..."}},e.fn.magnificPopup=function(n){_();var i=e(this);if("string"==typeof n)if("open"===n){var o,r=b?i.data("magnificPopup"):i[0].magnificPopup,a=parseInt(arguments[1],10)||0;r.items?o=r.items[a]:(o=i,r.delegate&&(o=o.find(r.delegate)),o=o.eq(a)),t._openClick({mfpEl:o},i,r)}else t.isOpen&&t[n].apply(t,Array.prototype.slice.call(arguments,1));else n=e.extend(!0,{},n),b?i.data("magnificPopup",n):i[0].magnificPopup=n,t.addGroup(i,n);return i};var P,O,z,M="inline",B=function(){z&&(O.after(z.addClass(P)).detach(),z=null)};e.magnificPopup.registerModule(M,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(M),x(l+"."+M,function(){B()})},getInline:function(n,i){if(B(),n.src){var o=t.st.inline,r=e(n.src);if(r.length){var a=r[0].parentNode;a&&a.tagName&&(O||(P=o.hiddenClass,O=k(P),P="mfp-"+P),z=r.after(O).detach().removeClass(P)),t.updateStatus("ready")}else t.updateStatus("error",o.tNotFound),r=e("
");return n.inlineElement=r,r}return t.updateStatus("ready"),t._parseMarkup(i,{},n),i}}});var F,H="ajax",L=function(){F&&i.removeClass(F)},A=function(){L(),t.req&&t.req.abort()};e.magnificPopup.registerModule(H,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'
The content could not be loaded.'},proto:{initAjax:function(){t.types.push(H),F=t.st.ajax.cursor,x(l+"."+H,A),x("BeforeChange."+H,A)},getAjax:function(n){F&&i.addClass(F),t.updateStatus("loading");var o=e.extend({url:n.src,success:function(i,o,r){var a={data:i,xhr:r};T("ParseAjax",a),t.appendContent(e(a.data),H),n.finished=!0,L(),t._setFocus(),setTimeout(function(){t.wrap.addClass(v)},16),t.updateStatus("ready"),T("AjaxContentAdded")},error:function(){L(),n.finished=n.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",n.src))}},t.st.ajax.settings);return t.req=e.ajax(o),""}}});var j,N=function(n){if(n.data&&void 0!==n.data.title)return n.data.title;var i=t.st.image.titleSrc;if(i){if(e.isFunction(i))return i.call(t,n);if(n.el)return n.el.attr(i)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'
The image could not be loaded.'},proto:{initImage:function(){var e=t.st.image,n=".image";t.types.push("image"),x(f+n,function(){"image"===t.currItem.type&&e.cursor&&i.addClass(e.cursor)}),x(l+n,function(){e.cursor&&i.removeClass(e.cursor),I.off("resize"+h)}),x("Resize"+n,t.resizeImage),t.isLowIE&&x("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var n=0;t.isLowIE&&(n=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-n)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,j&&clearInterval(j),e.isCheckingImgSize=!1,T("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var n=0,i=e.img[0],o=function(r){j&&clearInterval(j),j=setInterval(function(){return i.naturalWidth>0?(t._onImageHasSize(e),void 0):(n>200&&clearInterval(j),n++,3===n?o(10):40===n?o(50):100===n&&o(500),void 0)},r)};o(1)},getImage:function(n,i){var o=0,r=function(){n&&(n.img[0].complete?(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("ready")),n.hasSize=!0,n.loaded=!0,T("ImageLoadComplete")):(o++,200>o?setTimeout(r,100):a()))},a=function(){n&&(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("error",s.tError.replace("%url%",n.src))),n.hasSize=!0,n.loaded=!0,n.loadError=!0)},s=t.st.image,l=i.find(".mfp-img");if(l.length){var c=document.createElement("img");c.className="mfp-img",n.img=e(c).on("load.mfploader",r).on("error.mfploader",a),c.src=n.src,l.is("img")&&(n.img=n.img.clone()),c=n.img[0],c.naturalWidth>0?n.hasSize=!0:c.width||(n.hasSize=!1)}return t._parseMarkup(i,{title:N(n),img_replaceWith:n.img},n),t.resizeImage(),n.hasSize?(j&&clearInterval(j),n.loadError?(i.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",n.src))):(i.removeClass("mfp-loading"),t.updateStatus("ready")),i):(t.updateStatus("loading"),n.loading=!0,n.hasSize||(n.imgHidden=!0,i.addClass("mfp-loading"),t.findImageSize(n)),i)}}});var W,R=function(){return void 0===W&&(W=void 0!==document.createElement("p").style.MozTransform),W};e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,n=t.st.zoom,i=".zoom";if(n.enabled&&t.supportsTransition){var o,r,a=n.duration,s=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),i="all "+n.duration/1e3+"s "+n.easing,o={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},r="transition";return o["-webkit-"+r]=o["-moz-"+r]=o["-o-"+r]=o[r]=i,t.css(o),t},d=function(){t.content.css("visibility","visible")};x("BuildControls"+i,function(){if(t._allowZoom()){if(clearTimeout(o),t.content.css("visibility","hidden"),e=t._getItemToZoom(),!e)return d(),void 0;r=s(e),r.css(t._getOffset()),t.wrap.append(r),o=setTimeout(function(){r.css(t._getOffset(!0)),o=setTimeout(function(){d(),setTimeout(function(){r.remove(),e=r=null,T("ZoomAnimationEnded")},16)},a)},16)}}),x(c+i,function(){if(t._allowZoom()){if(clearTimeout(o),t.st.removalDelay=a,!e){if(e=t._getItemToZoom(),!e)return;r=s(e)}r.css(t._getOffset(!0)),t.wrap.append(r),t.content.css("visibility","hidden"),setTimeout(function(){r.css(t._getOffset())},16)}}),x(l+i,function(){t._allowZoom()&&(d(),r&&r.remove(),e=null)})}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return t.currItem.hasSize?t.currItem.img:!1},_getOffset:function(n){var i;i=n?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem);var o=i.offset(),r=parseInt(i.css("padding-top"),10),a=parseInt(i.css("padding-bottom"),10);o.top-=e(window).scrollTop()-r;var s={width:i.width(),height:(b?i.innerHeight():i[0].offsetHeight)-a-r};return R()?s["-moz-transform"]=s.transform="translate("+o.left+"px,"+o.top+"px)":(s.left=o.left,s.top=o.top),s}}});var Z="iframe",q="//about:blank",D=function(e){if(t.currTemplate[Z]){var n=t.currTemplate[Z].find("iframe");n.length&&(e||(n[0].src=q),t.isIE8&&n.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(Z,{options:{markup:'
',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),x("BeforeChange",function(e,t,n){t!==n&&(t===Z?D():n===Z&&D(!0))}),x(l+"."+Z,function(){D()})},getIframe:function(n,i){var o=n.src,r=t.st.iframe;e.each(r.patterns,function(){return o.indexOf(this.index)>-1?(this.id&&(o="string"==typeof this.id?o.substr(o.lastIndexOf(this.id)+this.id.length,o.length):this.id.call(this,o)),o=this.src.replace("%id%",o),!1):void 0});var a={};return r.srcAction&&(a[r.srcAction]=o),t._parseMarkup(i,a,n),t.updateStatus("ready"),i}}});var K=function(e){var n=t.items.length;return e>n-1?e-n:0>e?n+e:e},Y=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,i=".mfp-gallery",r=Boolean(e.fn.mfpFastClick);return t.direction=!0,n&&n.enabled?(a+=" mfp-gallery",x(f+i,function(){n.navigateByImgClick&&t.wrap.on("click"+i,".mfp-img",function(){return t.items.length>1?(t.next(),!1):void 0}),o.on("keydown"+i,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),x("UpdateStatus"+i,function(e,n){n.text&&(n.text=Y(n.text,t.currItem.index,t.items.length))}),x(p+i,function(e,i,o,r){var a=t.items.length;o.counter=a>1?Y(n.tCounter,r.index,a):""}),x("BuildControls"+i,function(){if(t.items.length>1&&n.arrows&&!t.arrowLeft){var i=n.arrowMarkup,o=t.arrowLeft=e(i.replace(/%title%/gi,n.tPrev).replace(/%dir%/gi,"left")).addClass(y),a=t.arrowRight=e(i.replace(/%title%/gi,n.tNext).replace(/%dir%/gi,"right")).addClass(y),s=r?"mfpFastClick":"click";o[s](function(){t.prev()}),a[s](function(){t.next()}),t.isIE7&&(k("b",o[0],!1,!0),k("a",o[0],!1,!0),k("b",a[0],!1,!0),k("a",a[0],!1,!0)),t.container.append(o.add(a))}}),x(m+i,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),x(l+i,function(){o.off(i),t.wrap.off("click"+i),t.arrowLeft&&r&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null}),void 0):!1},next:function(){t.direction=!0,t.index=K(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=K(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,i=Math.min(n[0],t.items.length),o=Math.min(n[1],t.items.length);for(e=1;(t.direction?o:i)>=e;e++)t._preloadItem(t.index+e);for(e=1;(t.direction?i:o)>=e;e++)t._preloadItem(t.index-e)},_preloadItem:function(n){if(n=K(n),!t.items[n].preloaded){var i=t.items[n];i.parsed||(i=t.parseEl(n)),T("LazyLoad",i),"image"===i.type&&(i.img=e('
![]()
').on("load.mfploader",function(){i.hasSize=!0}).on("error.mfploader",function(){i.hasSize=!0,i.loadError=!0,T("LazyLoadError",i)}).attr("src",i.src)),i.preloaded=!0}}}});var U="retina";e.magnificPopup.registerModule(U,{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&&(x("ImageHasSize."+U,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/n,width:"100%"})}),x("ElementParse."+U,function(t,i){i.src=e.replaceSrc(i,n)}))}}}}),function(){var t=1e3,n="ontouchstart"in window,i=function(){I.off("touchmove"+r+" touchend"+r)},o="mfpFastClick",r="."+o;e.fn.mfpFastClick=function(o){return e(this).each(function(){var a,s=e(this);if(n){var l,c,d,u,p,f;s.on("touchstart"+r,function(e){u=!1,f=1,p=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],c=p.clientX,d=p.clientY,I.on("touchmove"+r,function(e){p=e.originalEvent?e.originalEvent.touches:e.touches,f=p.length,p=p[0],(Math.abs(p.clientX-c)>10||Math.abs(p.clientY-d)>10)&&(u=!0,i())}).on("touchend"+r,function(e){i(),u||f>1||(a=!0,e.preventDefault(),clearTimeout(l),l=setTimeout(function(){a=!1},t),o())})})}s.on("click"+r,function(){a||o()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+r+" click"+r),n&&I.off("touchmove"+r+" touchend"+r)}}(),_()})(window.jQuery||window.Zepto);
\ No newline at end of file
diff --git a/vendors/jquery-magnific-popup/magnific-popup-animations.css b/vendors/jquery-magnific-popup/magnific-popup-animations.css
deleted file mode 100644
index 3dfd27a65..000000000
--- a/vendors/jquery-magnific-popup/magnific-popup-animations.css
+++ /dev/null
@@ -1,45 +0,0 @@
-
-/* overlay at start */
-.mfp-fade.mfp-bg {
- opacity: 0;
-
- -webkit-transition: all 0.2s ease-out;
- -moz-transition: all 0.2s ease-out;
- transition: all 0.2s ease-out;
-}
-/* overlay animate in */
-.mfp-fade.mfp-bg.mfp-ready {
- opacity: 0.8;
-}
-/* overlay animate out */
-.mfp-fade.mfp-bg.mfp-removing {
- opacity: 0;
-}
-
-/* content at start */
-.mfp-fade.mfp-wrap .mfp-content {
- opacity: 0;
-
- -webkit-transition: all 0.15s ease-out;
- -moz-transition: all 0.15s ease-out;
- transition: all 0.15s ease-out;
-
- -webkit-transform: translateX(-50px);
- -moz-transform: translateX(-50px);
- transform: translateX(-50px);
-}
-
-/* content animate it */
-.mfp-fade.mfp-wrap.mfp-ready .mfp-content {
- opacity: 1;
- -webkit-transform: translateX(0);
- -moz-transform: translateX(0);
- transform: translateX(0);
-}
-/* content animate out */
-.mfp-fade.mfp-wrap.mfp-removing .mfp-content {
- opacity: 0;
- -webkit-transform: translateX(50px);
- -moz-transform: translateX(50px);
- transform: translateX(50px);
-}
diff --git a/vendors/jquery-magnific-popup/magnific-popup.css b/vendors/jquery-magnific-popup/magnific-popup.css
deleted file mode 100644
index 798ac9d8f..000000000
--- a/vendors/jquery-magnific-popup/magnific-popup.css
+++ /dev/null
@@ -1,368 +0,0 @@
-/* Magnific Popup CSS */
-.mfp-bg {
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: 1042;
- overflow: hidden;
- position: fixed;
- background: #0b0b0b;
- opacity: 0.8;
- filter: alpha(opacity=80); }
-
-.mfp-wrap {
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: 1043;
- position: fixed;
- outline: none !important;
- -webkit-backface-visibility: hidden; }
-
-.mfp-container {
- text-align: center;
- position: absolute;
- width: 100%;
- height: 100%;
- left: 0;
- top: 0;
- padding: 0 8px;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box; }
-
-.mfp-container:before {
- content: '';
- display: inline-block;
- height: 100%;
- vertical-align: middle; }
-
-.mfp-align-top .mfp-container:before {
- display: none; }
-
-.mfp-content {
- position: relative;
- display: inline-block;
- vertical-align: middle;
- margin: 0 auto;
- text-align: left;
- z-index: 1045; }
-
-.mfp-inline-holder .mfp-content, .mfp-ajax-holder .mfp-content {
- width: 100%;
- cursor: auto; }
-
-.mfp-ajax-cur {
- cursor: progress; }
-
-.mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
- cursor: -moz-zoom-out;
- cursor: -webkit-zoom-out;
- cursor: zoom-out; }
-
-.mfp-zoom {
- cursor: pointer;
- cursor: -webkit-zoom-in;
- cursor: -moz-zoom-in;
- cursor: zoom-in; }
-
-.mfp-auto-cursor .mfp-content {
- cursor: auto; }
-
-.mfp-close, .mfp-arrow, .mfp-preloader, .mfp-counter {
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none; }
-
-.mfp-loading.mfp-figure {
- display: none; }
-
-.mfp-hide {
- display: none !important; }
-
-.mfp-preloader {
- color: #cccccc;
- position: absolute;
- top: 50%;
- width: auto;
- text-align: center;
- margin-top: -0.8em;
- left: 8px;
- right: 8px;
- z-index: 1044; }
- .mfp-preloader a {
- color: #cccccc; }
- .mfp-preloader a:hover {
- color: white; }
-
-.mfp-s-ready .mfp-preloader {
- display: none; }
-
-.mfp-s-error .mfp-content {
- display: none; }
-
-button.mfp-close, button.mfp-arrow {
- overflow: visible;
- cursor: pointer;
- background: transparent;
- border: 0;
- -webkit-appearance: none;
- display: block;
- outline: none;
- padding: 0;
- z-index: 1046;
- -webkit-box-shadow: none;
- box-shadow: none; }
-button::-moz-focus-inner {
- padding: 0;
- border: 0; }
-
-.mfp-close {
- width: 44px;
- height: 44px;
- line-height: 44px;
- position: absolute;
- right: 0;
- top: 0;
- text-decoration: none;
- text-align: center;
- opacity: 0.65;
- filter: alpha(opacity=65);
- padding: 0 0 18px 10px;
- color: white;
- font-style: normal;
- font-size: 28px;
- font-family: Arial, Baskerville, monospace; }
- .mfp-close:hover, .mfp-close:focus {
- opacity: 1;
- filter: alpha(opacity=100); }
- .mfp-close:active {
- top: 1px; }
-
-.mfp-close-btn-in .mfp-close {
- color: #333333; }
-
-.mfp-image-holder .mfp-close, .mfp-iframe-holder .mfp-close {
- color: white;
- right: -6px;
- text-align: right;
- padding-right: 6px;
- width: 100%; }
-
-.mfp-counter {
- position: absolute;
- top: 0;
- right: 0;
- color: #cccccc;
- font-size: 12px;
- line-height: 18px; }
-
-.mfp-arrow {
- position: absolute;
- opacity: 0.65;
- filter: alpha(opacity=65);
- margin: 0;
- top: 50%;
- margin-top: -55px;
- padding: 0;
- width: 90px;
- height: 110px;
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
- .mfp-arrow:active {
- margin-top: -54px; }
- .mfp-arrow:hover, .mfp-arrow:focus {
- opacity: 1;
- filter: alpha(opacity=100); }
- .mfp-arrow:before, .mfp-arrow:after, .mfp-arrow .mfp-b, .mfp-arrow .mfp-a {
- content: '';
- display: block;
- width: 0;
- height: 0;
- position: absolute;
- left: 0;
- top: 0;
- margin-top: 35px;
- margin-left: 35px;
- border: medium inset transparent; }
- .mfp-arrow:after, .mfp-arrow .mfp-a {
- border-top-width: 13px;
- border-bottom-width: 13px;
- top: 8px; }
- .mfp-arrow:before, .mfp-arrow .mfp-b {
- border-top-width: 21px;
- border-bottom-width: 21px;
- opacity: 0.7; }
-
-.mfp-arrow-left {
- left: 0; }
- .mfp-arrow-left:after, .mfp-arrow-left .mfp-a {
- border-right: 17px solid white;
- margin-left: 31px; }
- .mfp-arrow-left:before, .mfp-arrow-left .mfp-b {
- margin-left: 25px;
- border-right: 27px solid #3f3f3f; }
-
-.mfp-arrow-right {
- right: 0; }
- .mfp-arrow-right:after, .mfp-arrow-right .mfp-a {
- border-left: 17px solid white;
- margin-left: 39px; }
- .mfp-arrow-right:before, .mfp-arrow-right .mfp-b {
- border-left: 27px solid #3f3f3f; }
-
-.mfp-iframe-holder {
- padding-top: 40px;
- padding-bottom: 40px; }
- .mfp-iframe-holder .mfp-content {
- line-height: 0;
- width: 100%;
- max-width: 900px; }
- .mfp-iframe-holder .mfp-close {
- top: -40px; }
-
-.mfp-iframe-scaler {
- width: 100%;
- height: 0;
- overflow: hidden;
- padding-top: 56.25%; }
- .mfp-iframe-scaler iframe {
- position: absolute;
- display: block;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
- background: black; }
-
-/* Main image in popup */
-img.mfp-img {
- width: auto;
- max-width: 100%;
- height: auto;
- display: block;
- line-height: 0;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- padding: 40px 0 40px;
- margin: 0 auto; }
-
-/* The shadow behind the image */
-.mfp-figure {
- line-height: 0; }
- .mfp-figure:after {
- content: '';
- position: absolute;
- left: 0;
- top: 40px;
- bottom: 40px;
- display: block;
- right: 0;
- width: auto;
- height: auto;
- z-index: -1;
- box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
- background: #444444; }
- .mfp-figure small {
- color: #bdbdbd;
- display: block;
- font-size: 12px;
- line-height: 14px; }
- .mfp-figure figure {
- margin: 0; }
-
-.mfp-bottom-bar {
- margin-top: -36px;
- position: absolute;
- top: 100%;
- left: 0;
- width: 100%;
- cursor: auto; }
-
-.mfp-title {
- text-align: left;
- line-height: 18px;
- color: #f3f3f3;
- word-wrap: break-word;
- padding-right: 36px; }
-
-.mfp-image-holder .mfp-content {
- max-width: 100%; }
-
-.mfp-gallery .mfp-image-holder .mfp-figure {
- cursor: pointer; }
-
-@media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) {
- /**
- * Remove all paddings around the image on small screen
- */
- .mfp-img-mobile .mfp-image-holder {
- padding-left: 0;
- padding-right: 0; }
- .mfp-img-mobile img.mfp-img {
- padding: 0; }
- .mfp-img-mobile .mfp-figure:after {
- top: 0;
- bottom: 0; }
- .mfp-img-mobile .mfp-figure small {
- display: inline;
- margin-left: 5px; }
- .mfp-img-mobile .mfp-bottom-bar {
- background: rgba(0, 0, 0, 0.6);
- bottom: 0;
- margin: 0;
- top: auto;
- padding: 3px 5px;
- position: fixed;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box; }
- .mfp-img-mobile .mfp-bottom-bar:empty {
- padding: 0; }
- .mfp-img-mobile .mfp-counter {
- right: 5px;
- top: 3px; }
- .mfp-img-mobile .mfp-close {
- top: 0;
- right: 0;
- width: 35px;
- height: 35px;
- line-height: 35px;
- background: rgba(0, 0, 0, 0.6);
- position: fixed;
- text-align: center;
- padding: 0; } }
-
-@media all and (max-width: 900px) {
- .mfp-arrow {
- -webkit-transform: scale(0.75);
- transform: scale(0.75); }
- .mfp-arrow-left {
- -webkit-transform-origin: 0;
- transform-origin: 0; }
- .mfp-arrow-right {
- -webkit-transform-origin: 100%;
- transform-origin: 100%; }
- .mfp-container {
- padding-left: 6px;
- padding-right: 6px; } }
-
-.mfp-ie7 .mfp-img {
- padding: 0; }
-.mfp-ie7 .mfp-bottom-bar {
- width: 600px;
- left: 50%;
- margin-left: -300px;
- margin-top: 5px;
- padding-bottom: 5px; }
-.mfp-ie7 .mfp-container {
- padding: 0; }
-.mfp-ie7 .mfp-content {
- padding-top: 44px; }
-.mfp-ie7 .mfp-close {
- top: 0;
- right: 0;
- padding-top: 0; }
diff --git a/vendors/jquery-magnific-popup/magnific-popup.jquery.json b/vendors/jquery-magnific-popup/magnific-popup.jquery.json
deleted file mode 100644
index a7de75fb2..000000000
--- a/vendors/jquery-magnific-popup/magnific-popup.jquery.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "name": "magnific-popup",
- "title": "Magnific Popup",
- "description": "Fast, light, mobile-friendly and responsive lightbox and modal dialog plugin. Open inline HTML, ajax loaded content, image, form, iframe (YouTube video, Vimeo, Google Maps), photo gallery. Animation effects added with CSS3 transitions. For jQuery or Zepto.",
- "version": "0.9.9",
- "homepage": "http://dimsemenov.com/plugins/magnific-popup/",
- "demo": "http://dimsemenov.com/plugins/magnific-popup/",
- "docs": "http://dimsemenov.com/plugins/magnific-popup/documentation.html",
- "author": {
- "name": "Dmitry Semenov",
- "email": "diiiimaaaa@gmail.com",
- "url": "http://dimsemenov.com"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/dimsemenov/Magnific-Popup.git"
- },
- "bugs": "https://github.com/dimsemenov/Magnific-Popup/issues",
- "dependencies": {
- "jquery": ">=1.7.2"
- },
- "keywords": ["lightbox","popup","modal","window","dialog","ui","gallery","slideshow","video","image","ajax","html5","animation","jquery","photo","responsive","mobile"],
- "licenses": [
- {
- "type": "MIT",
- "url": "http://www.opensource.org/licenses/mit-license.php"
- }
- ]
-}
\ No newline at end of file
diff --git a/vendors/jquery-magnific-popup/package.json b/vendors/jquery-magnific-popup/package.json
deleted file mode 100644
index b2b4984a4..000000000
--- a/vendors/jquery-magnific-popup/package.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "name": "magnific-popup",
-
- "version": "0.9.9",
- "title": "Magnific Popup",
- "description": "Lightbox and modal dialog plugin. Can display inline HTML, iframes (YouTube video, Vimeo, Google Maps), or an image gallery. Animation effects are added with CSS3 transitions. For jQuery or Zepto.",
- "keywords": ["lightbox","popup","modal","window","dialog","gallery","jquery","photo","responsive","mobile"],
- "author": {
- "name": "Dmitry Semenov",
- "email": "diiiimaaaa@gmail.com",
- "web": "http://dimsemenov.com"
- },
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/dimsemenov/Magnific-Popup/issues"
- },
- "main": "dist/jquery.magnific-popup.js",
- "homepage": "http://dimsemenov.com/plugins/magnific-popup/",
-
-
-
- "engines": {
- "node": ">= 0.8.0"
- },
- "scripts": {
- "test": "grunt jshint"
- },
- "devDependencies": {
- "grunt-contrib-jshint": "~0.1.1",
- "grunt-contrib-concat": "~0.1.2",
- "grunt-contrib-uglify": "~0.1.1",
- "grunt-contrib-watch": "~0.2.0",
- "grunt-contrib-clean": "~0.4.0",
- "grunt": "~0.4.0",
- "grunt-contrib-cssmin": "~0.4.1",
- "grunt-contrib-copy": "~0.4.0",
- "grunt-jekyll": "~0.3.9",
- "grunt-sass": "~0.6.1"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/dimsemenov/Magnific-Popup.git"
- }
-}
diff --git a/vendors/jquery-ui.touch-punch/jquery.ui.touch-punch.min.js b/vendors/jquery-ui.touch-punch/jquery.ui.touch-punch.min.js
deleted file mode 100644
index 31272ce6f..000000000
--- a/vendors/jquery-ui.touch-punch/jquery.ui.touch-punch.min.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/*!
- * jQuery UI Touch Punch 0.2.3
- *
- * Copyright 2011–2014, Dave Furfero
- * Dual licensed under the MIT or GPL Version 2 licenses.
- *
- * Depends:
- * jquery.ui.widget.js
- * jquery.ui.mouse.js
- */
-!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
\ No newline at end of file
diff --git a/vendors/knockout-punches/knockout.punches.js b/vendors/knockout-punches/knockout.punches.js
deleted file mode 100644
index 62d50297c..000000000
--- a/vendors/knockout-punches/knockout.punches.js
+++ /dev/null
@@ -1,589 +0,0 @@
-/**
- * @license Knockout.Punches
- * Enhanced binding syntaxes for Knockout 3+
- * (c) Michael Best
- * License: MIT (http://www.opensource.org/licenses/mit-license.php)
- * Version 0.5.0
- */
-(function (factory) {
- if (typeof define === 'function' && define.amd) {
- // AMD. Register as an anonymous module.
- define(['knockout'], factory);
- } else {
- // Browser globals
- factory(ko);
- }
-}(function(ko) {
-
-// Add a preprocess function to a binding handler.
-function addBindingPreprocessor(bindingKeyOrHandler, preprocessFn) {
- return chainPreprocessor(getOrCreateHandler(bindingKeyOrHandler), 'preprocess', preprocessFn);
-}
-
-// These utility functions are separated out because they're also used by
-// preprocessBindingProperty
-
-// Get the binding handler or create a new, empty one
-function getOrCreateHandler(bindingKeyOrHandler) {
- return typeof bindingKeyOrHandler === 'object' ? bindingKeyOrHandler :
- (ko.getBindingHandler(bindingKeyOrHandler) || (ko.bindingHandlers[bindingKeyOrHandler] = {}));
-}
-// Add a preprocess function
-function chainPreprocessor(obj, prop, fn) {
- if (obj[prop]) {
- // If the handler already has a preprocess function, chain the new
- // one after the existing one. If the previous function in the chain
- // returns a falsy value (to remove the binding), the chain ends. This
- // method allows each function to modify and return the binding value.
- var previousFn = obj[prop];
- obj[prop] = function(value, binding, addBinding) {
- value = previousFn.call(this, value, binding, addBinding);
- if (value)
- return fn.call(this, value, binding, addBinding);
- };
- } else {
- obj[prop] = fn;
- }
- return obj;
-}
-
-// Add a preprocessNode function to the binding provider. If a
-// function already exists, chain the new one after it. This calls
-// each function in the chain until one modifies the node. This
-// method allows only one function to modify the node.
-function addNodePreprocessor(preprocessFn) {
- var provider = ko.bindingProvider.instance;
- if (provider.preprocessNode) {
- var previousPreprocessFn = provider.preprocessNode;
- provider.preprocessNode = function(node) {
- var newNodes = previousPreprocessFn.call(this, node);
- if (!newNodes)
- newNodes = preprocessFn.call(this, node);
- return newNodes;
- };
- } else {
- provider.preprocessNode = preprocessFn;
- }
-}
-
-function addBindingHandlerCreator(matchRegex, callbackFn) {
- var oldGetHandler = ko.getBindingHandler;
- ko.getBindingHandler = function(bindingKey) {
- var match;
- return oldGetHandler(bindingKey) || ((match = bindingKey.match(matchRegex)) && callbackFn(match, bindingKey));
- };
-}
-
-// Create shortcuts to commonly used ko functions
-var ko_unwrap = ko.unwrap;
-
-// Create "punches" object and export utility functions
-var ko_punches = ko.punches = {
- utils: {
- addBindingPreprocessor: addBindingPreprocessor,
- addNodePreprocessor: addNodePreprocessor,
- addBindingHandlerCreator: addBindingHandlerCreator,
-
- // previous names retained for backwards compitibility
- setBindingPreprocessor: addBindingPreprocessor,
- setNodePreprocessor: addNodePreprocessor
- }
-};
-
-ko_punches.enableAll = function () {
- // Enable interpolation markup
- enableInterpolationMarkup();
- enableAttributeInterpolationMarkup();
-
- // Enable auto-namspacing of attr, css, event, and style
- enableAutoNamespacedSyntax('attr');
- enableAutoNamespacedSyntax('css');
- enableAutoNamespacedSyntax('event');
- enableAutoNamespacedSyntax('style');
-
- // Enable filter syntax for text, html, and attr
- enableTextFilter('text');
- enableTextFilter('html');
- addDefaultNamespacedBindingPreprocessor('attr', filterPreprocessor);
-
- // Enable wrapped callbacks for click, submit, event, optionsAfterRender, and template options
- enableWrappedCallback('click');
- enableWrappedCallback('submit');
- enableWrappedCallback('optionsAfterRender');
- addDefaultNamespacedBindingPreprocessor('event', wrappedCallbackPreprocessor);
- addBindingPropertyPreprocessor('template', 'beforeRemove', wrappedCallbackPreprocessor);
- addBindingPropertyPreprocessor('template', 'afterAdd', wrappedCallbackPreprocessor);
- addBindingPropertyPreprocessor('template', 'afterRender', wrappedCallbackPreprocessor);
-};
-// Convert input in the form of `expression | filter1 | filter2:arg1:arg2` to a function call format
-// with filters accessed as ko.filters.filter1, etc.
-function filterPreprocessor(input) {
- // Check if the input contains any | characters; if not, just return
- if (input.indexOf('|') === -1)
- return input;
-
- // Split the input into tokens, in which | and : are individual tokens, quoted strings are ignored, and all tokens are space-trimmed
- var tokens = input.match(/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|\|\||[|:]|[^\s|:"'][^|:"']*[^\s|:"']|[^\s|:"']/g);
- if (tokens && tokens.length > 1) {
- // Append a line so that we don't need a separate code block to deal with the last item
- tokens.push('|');
- input = tokens[0];
- var lastToken, token, inFilters = false, nextIsFilter = false;
- for (var i = 1, token; token = tokens[i]; ++i) {
- if (token === '|') {
- if (inFilters) {
- if (lastToken === ':')
- input += "undefined";
- input += ')';
- }
- nextIsFilter = true;
- inFilters = true;
- } else {
- if (nextIsFilter) {
- input = "ko.filters['" + token + "'](" + input;
- } else if (inFilters && token === ':') {
- if (lastToken === ':')
- input += "undefined";
- input += ",";
- } else {
- input += token;
- }
- nextIsFilter = false;
- }
- lastToken = token;
- }
- }
- return input;
-}
-
-// Set the filter preprocessor for a specific binding
-function enableTextFilter(bindingKeyOrHandler) {
- addBindingPreprocessor(bindingKeyOrHandler, filterPreprocessor);
-}
-
-var filters = {};
-
-// Convert value to uppercase
-filters.uppercase = function(value) {
- return String.prototype.toUpperCase.call(ko_unwrap(value));
-};
-
-// Convert value to lowercase
-filters.lowercase = function(value) {
- return String.prototype.toLowerCase.call(ko_unwrap(value));
-};
-
-// Return default value if the input value is empty or null
-filters['default'] = function (value, defaultValue) {
- value = ko_unwrap(value);
- if (typeof value === "function") {
- return value;
- }
- if (typeof value === "string") {
- return trim(value) === '' ? defaultValue : value;
- }
- return value == null || value.length == 0 ? defaultValue : value;
-};
-
-// Return the value with the search string replaced with the replacement string
-filters.replace = function(value, search, replace) {
- return String.prototype.replace.call(ko_unwrap(value), search, replace);
-};
-
-filters.fit = function(value, length, replacement, trimWhere) {
- value = ko_unwrap(value);
- if (length && ('' + value).length > length) {
- replacement = '' + (replacement || '...');
- length = length - replacement.length;
- value = '' + value;
- switch (trimWhere) {
- case 'left':
- return replacement + value.slice(-length);
- case 'middle':
- var leftLen = Math.ceil(length / 2);
- return value.substr(0, leftLen) + replacement + value.slice(leftLen-length);
- default:
- return value.substr(0, length) + replacement;
- }
- } else {
- return value;
- }
-};
-
-// Convert a model object to JSON
-filters.json = function(rootObject, space, replacer) { // replacer and space are optional
- return ko.toJSON(rootObject, replacer, space);
-};
-
-// Format a number using the browser's toLocaleString
-filters.number = function(value) {
- return (+ko_unwrap(value)).toLocaleString();
-};
-
-// Export the filters object for general access
-ko.filters = filters;
-
-// Export the preprocessor functions
-ko_punches.textFilter = {
- preprocessor: filterPreprocessor,
- enableForBinding: enableTextFilter
-};
-// Support dynamically-created, namespaced bindings. The binding key syntax is
-// "namespace.binding". Within a certain namespace, we can dynamically create the
-// handler for any binding. This is particularly useful for bindings that work
-// the same way, but just set a different named value, such as for element
-// attributes or CSS classes.
-var namespacedBindingMatch = /([^\.]+)\.(.+)/, namespaceDivider = '.';
-addBindingHandlerCreator(namespacedBindingMatch, function (match, bindingKey) {
- var namespace = match[1],
- namespaceHandler = ko.bindingHandlers[namespace];
- if (namespaceHandler) {
- var bindingName = match[2],
- handlerFn = namespaceHandler.getNamespacedHandler || defaultGetNamespacedHandler,
- handler = handlerFn.call(namespaceHandler, bindingName, namespace, bindingKey);
- ko.bindingHandlers[bindingKey] = handler;
- return handler;
- }
-});
-
-// Knockout's built-in bindings "attr", "event", "css" and "style" include the idea of
-// namespaces, representing it using a single binding that takes an object map of names
-// to values. This default handler translates a binding of "namespacedName: value"
-// to "namespace: {name: value}" to automatically support those built-in bindings.
-function defaultGetNamespacedHandler(name, namespace, namespacedName) {
- var handler = ko.utils.extend({}, this);
- function setHandlerFunction(funcName) {
- if (handler[funcName]) {
- handler[funcName] = function(element, valueAccessor) {
- function subValueAccessor() {
- var result = {};
- result[name] = valueAccessor();
- return result;
- }
- var args = Array.prototype.slice.call(arguments, 0);
- args[1] = subValueAccessor;
- return ko.bindingHandlers[namespace][funcName].apply(this, args);
- };
- }
- }
- // Set new init and update functions that wrap the originals
- setHandlerFunction('init');
- setHandlerFunction('update');
- // Clear any preprocess function since preprocessing of the new binding would need to be different
- if (handler.preprocess)
- handler.preprocess = null;
- if (ko.virtualElements.allowedBindings[namespace])
- ko.virtualElements.allowedBindings[namespacedName] = true;
- return handler;
-}
-
-// Adds a preprocess function for every generated namespace.x binding. This can
-// be called multiple times for the same binding, and the preprocess functions will
-// be chained. If the binding has a custom getNamespacedHandler method, make sure that
-// it's set before this function is used.
-function addDefaultNamespacedBindingPreprocessor(namespace, preprocessFn) {
- var handler = ko.getBindingHandler(namespace);
- if (handler) {
- var previousHandlerFn = handler.getNamespacedHandler || defaultGetNamespacedHandler;
- handler.getNamespacedHandler = function() {
- return addBindingPreprocessor(previousHandlerFn.apply(this, arguments), preprocessFn);
- };
- }
-}
-
-function autoNamespacedPreprocessor(value, binding, addBinding) {
- if (value.charAt(0) !== "{")
- return value;
-
- // Handle two-level binding specified as "binding: {key: value}" by parsing inner
- // object and converting to "binding.key: value"
- var subBindings = ko.expressionRewriting.parseObjectLiteral(value);
- ko.utils.arrayForEach(subBindings, function(keyValue) {
- addBinding(binding + namespaceDivider + keyValue.key, keyValue.value);
- });
-}
-
-// Set the namespaced preprocessor for a specific binding
-function enableAutoNamespacedSyntax(bindingKeyOrHandler) {
- addBindingPreprocessor(bindingKeyOrHandler, autoNamespacedPreprocessor);
-}
-
-// Export the preprocessor functions
-ko_punches.namespacedBinding = {
- defaultGetHandler: defaultGetNamespacedHandler,
- setDefaultBindingPreprocessor: addDefaultNamespacedBindingPreprocessor, // for backwards compat.
- addDefaultBindingPreprocessor: addDefaultNamespacedBindingPreprocessor,
- preprocessor: autoNamespacedPreprocessor,
- enableForBinding: enableAutoNamespacedSyntax
-};
-// Wrap a callback function in an anonymous function so that it is called with the appropriate
-// "this" value.
-function wrappedCallbackPreprocessor(val) {
- // Matches either an isolated identifier or something ending with a property accessor
- if (/^([$_a-z][$\w]*|.+(\.\s*[$_a-z][$\w]*|\[.+\]))$/i.test(val)) {
- return 'function(_x,_y,_z){return(' + val + ')(_x,_y,_z);}';
- } else {
- return val;
- }
-}
-
-// Set the wrappedCallback preprocessor for a specific binding
-function enableWrappedCallback(bindingKeyOrHandler) {
- addBindingPreprocessor(bindingKeyOrHandler, wrappedCallbackPreprocessor);
-}
-
-// Export the preprocessor functions
-ko_punches.wrappedCallback = {
- preprocessor: wrappedCallbackPreprocessor,
- enableForBinding: enableWrappedCallback
-};
-// Attach a preprocess function to a specific property of a binding. This allows you to
-// preprocess binding "options" using the same preprocess functions that work for bindings.
-function addBindingPropertyPreprocessor(bindingKeyOrHandler, property, preprocessFn) {
- var handler = getOrCreateHandler(bindingKeyOrHandler);
- if (!handler._propertyPreprocessors) {
- // Initialize the binding preprocessor
- chainPreprocessor(handler, 'preprocess', propertyPreprocessor);
- handler._propertyPreprocessors = {};
- }
- // Add the property preprocess function
- chainPreprocessor(handler._propertyPreprocessors, property, preprocessFn);
-}
-
-// In order to preprocess a binding property, we have to preprocess the binding itself.
-// This preprocess function splits up the binding value and runs each property's preprocess
-// function if it's set.
-function propertyPreprocessor(value, binding, addBinding) {
- if (value.charAt(0) !== "{")
- return value;
-
- var subBindings = ko.expressionRewriting.parseObjectLiteral(value),
- resultStrings = [],
- propertyPreprocessors = this._propertyPreprocessors || {};
- ko.utils.arrayForEach(subBindings, function(keyValue) {
- var prop = keyValue.key, propVal = keyValue.value;
- if (propertyPreprocessors[prop]) {
- propVal = propertyPreprocessors[prop](propVal, prop, addBinding);
- }
- if (propVal) {
- resultStrings.push("'" + prop + "':" + propVal);
- }
- });
- return "{" + resultStrings.join(",") + "}";
-}
-
-// Export the preprocessor functions
-ko_punches.preprocessBindingProperty = {
- setPreprocessor: addBindingPropertyPreprocessor, // for backwards compat.
- addPreprocessor: addBindingPropertyPreprocessor
-};
-// Wrap an expression in an anonymous function so that it is called when the event happens
-function makeExpressionCallbackPreprocessor(args) {
- return function expressionCallbackPreprocessor(val) {
- return 'function('+args+'){return(' + val + ');}';
- };
-}
-
-var eventExpressionPreprocessor = makeExpressionCallbackPreprocessor("$data,$event");
-
-// Set the expressionCallback preprocessor for a specific binding
-function enableExpressionCallback(bindingKeyOrHandler, args) {
- var args = Array.prototype.slice.call(arguments, 1).join();
- addBindingPreprocessor(bindingKeyOrHandler, makeExpressionCallbackPreprocessor(args));
-}
-
-// Export the preprocessor functions
-ko_punches.expressionCallback = {
- makePreprocessor: makeExpressionCallbackPreprocessor,
- eventPreprocessor: eventExpressionPreprocessor,
- enableForBinding: enableExpressionCallback
-};
-
-// Create an "on" namespace for events to use the expression method
-ko.bindingHandlers.on = {
- getNamespacedHandler: function(eventName) {
- var handler = ko.getBindingHandler('event' + namespaceDivider + eventName);
- return addBindingPreprocessor(handler, eventExpressionPreprocessor);
- }
-};
-// Performance comparison at http://jsperf.com/markup-interpolation-comparison
-function parseInterpolationMarkup(textToParse, outerTextCallback, expressionCallback) {
- function innerParse(text) {
- var innerMatch = text.match(/^([\s\S]*)}}([\s\S]*?)\{\{([\s\S]*)$/);
- if (innerMatch) {
- innerParse(innerMatch[1]);
- outerTextCallback(innerMatch[2]);
- expressionCallback(innerMatch[3]);
- } else {
- expressionCallback(text);
- }
- }
- var outerMatch = textToParse.match(/^([\s\S]*?)\{\{([\s\S]*)}}([\s\S]*)$/);
- if (outerMatch) {
- outerTextCallback(outerMatch[1]);
- innerParse(outerMatch[2]);
- outerTextCallback(outerMatch[3]);
- }
-}
-
-function trim(string) {
- return string == null ? '' :
- string.trim ?
- string.trim() :
- string.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, '');
-}
-
-function interpolationMarkupPreprocessor(node) {
- // only needs to work with text nodes
- if (node.nodeType === 3 && node.nodeValue && node.nodeValue.indexOf('{{') !== -1 && (node.parentNode || {}).nodeName != "TEXTAREA") {
- var nodes = [];
- function addTextNode(text) {
- if (text)
- nodes.push(document.createTextNode(text));
- }
- function wrapExpr(expressionText) {
- if (expressionText)
- nodes.push.apply(nodes, ko_punches_interpolationMarkup.wrapExpression(expressionText, node));
- }
- parseInterpolationMarkup(node.nodeValue, addTextNode, wrapExpr)
-
- if (nodes.length) {
- if (node.parentNode) {
- for (var i = 0, n = nodes.length, parent = node.parentNode; i < n; ++i) {
- parent.insertBefore(nodes[i], node);
- }
- parent.removeChild(node);
- }
- return nodes;
- }
- }
-}
-
-if (!ko.virtualElements.allowedBindings.html) {
- // Virtual html binding
- // SO Question: http://stackoverflow.com/a/15348139
- var overridden = ko.bindingHandlers.html.update;
- ko.bindingHandlers.html.update = function (element, valueAccessor) {
- if (element.nodeType === 8) {
- var html = ko_unwrap(valueAccessor());
- if (html != null) {
- var parsedNodes = ko.utils.parseHtmlFragment('' + html);
- ko.virtualElements.setDomNodeChildren(element, parsedNodes);
- } else {
- ko.virtualElements.emptyNode(element);
- }
- } else {
- overridden(element, valueAccessor);
- }
- };
- ko.virtualElements.allowedBindings.html = true;
-}
-
-function wrapExpression(expressionText, node) {
- var ownerDocument = node ? node.ownerDocument : document,
- closeComment = true,
- binding,
- firstChar = expressionText[0],
- lastChar = expressionText[expressionText.length - 1],
- result = [],
- matches;
-
- if (firstChar === '#') {
- if (lastChar === '/') {
- binding = expressionText.slice(1, -1);
- } else {
- binding = expressionText.slice(1);
- closeComment = false;
- }
- if (matches = binding.match(/^([^,"'{}()\/:[\]\s]+)\s+([^\s:].*)/)) {
- binding = matches[1] + ':' + matches[2];
- }
- } else if (firstChar === '/') {
- // replace only with a closing comment
- } else if (firstChar === '{' && lastChar === '}') {
- binding = "html:" + trim(expressionText.slice(1, -1));
- } else {
- binding = "text:" + trim(expressionText);
- }
-
- if (binding)
- result.push(ownerDocument.createComment("ko " + binding));
- if (closeComment)
- result.push(ownerDocument.createComment("/ko"));
- return result;
-};
-
-function enableInterpolationMarkup() {
- addNodePreprocessor(interpolationMarkupPreprocessor);
-}
-
-// Export the preprocessor functions
-var ko_punches_interpolationMarkup = ko_punches.interpolationMarkup = {
- preprocessor: interpolationMarkupPreprocessor,
- enable: enableInterpolationMarkup,
- wrapExpression: wrapExpression
-};
-
-
-var dataBind = 'data-bind';
-function attributeInterpolationMarkerPreprocessor(node) {
- if (node.nodeType === 1 && node.attributes.length) {
- var dataBindAttribute = node.getAttribute(dataBind);
- for (var attrs = ko.utils.arrayPushAll([], node.attributes), n = attrs.length, i = 0; i < n; ++i) {
- var attr = attrs[i];
- if (attr.specified && attr.name != dataBind && attr.value.indexOf('{{') !== -1) {
- var parts = [], attrValue = '';
- function addText(text) {
- if (text)
- parts.push('"' + text.replace(/"/g, '\\"') + '"');
- }
- function addExpr(expressionText) {
- if (expressionText) {
- attrValue = expressionText;
- parts.push('ko.unwrap(' + expressionText + ')');
- }
- }
- parseInterpolationMarkup(attr.value, addText, addExpr);
-
- if (parts.length > 1) {
- attrValue = '""+' + parts.join('+');
- }
-
- if (attrValue) {
- var attrName = attr.name.toLowerCase();
- var attrBinding = ko_punches_attributeInterpolationMarkup.attributeBinding(attrName, attrValue, node) || attributeBinding(attrName, attrValue, node);
- if (!dataBindAttribute) {
- dataBindAttribute = attrBinding
- } else {
- dataBindAttribute += ',' + attrBinding;
- }
- node.setAttribute(dataBind, dataBindAttribute);
- // Using removeAttribute instead of removeAttributeNode because IE clears the
- // class if you use removeAttributeNode to remove the id.
- node.removeAttribute(attr.name);
- }
- }
- }
- }
-}
-
-function attributeBinding(name, value, node) {
- if (ko.getBindingHandler(name)) {
- return name + ':' + value;
- } else {
- return 'attr.' + name + ':' + value;
- }
-}
-
-function enableAttributeInterpolationMarkup() {
- addNodePreprocessor(attributeInterpolationMarkerPreprocessor);
-}
-
-var ko_punches_attributeInterpolationMarkup = ko_punches.attributeInterpolationMarkup = {
- preprocessor: attributeInterpolationMarkerPreprocessor,
- enable: enableAttributeInterpolationMarkup,
- attributeBinding: attributeBinding
-};
-
- return ko_punches;
-}));
diff --git a/vendors/knockout-punches/knockout.punches.min.js b/vendors/knockout-punches/knockout.punches.min.js
deleted file mode 100644
index 215664da9..000000000
--- a/vendors/knockout-punches/knockout.punches.min.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- Knockout.Punches
- Enhanced binding syntaxes for Knockout 3+
- (c) Michael Best
- License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Version 0.5.0
-*/
-(function(c){"function"===typeof define&&define.amd?define(["knockout"],c):c(ko)})(function(c){function k(a,b){return u(B(a),"preprocess",b)}function B(a){return"object"===typeof a?a:c.getBindingHandler(a)||(c.bindingHandlers[a]={})}function u(a,b,d){if(a[b]){var g=a[b];a[b]=function(a,b,c){if(a=g.call(this,a,b,c))return d.call(this,a,b,c)}}else a[b]=d;return a}function r(a){var b=c.bindingProvider.instance;if(b.preprocessNode){var d=b.preprocessNode;b.preprocessNode=function(b){var c=d.call(this,
-b);c||(c=a.call(this,b));return c}}else b.preprocessNode=a}function D(a,b){var d=c.getBindingHandler;c.getBindingHandler=function(g){var c;return d(g)||(c=g.match(a))&&b(c,g)}}function v(a){if(-1===a.indexOf("|"))return a;var b=a.match(/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|\|\||[|:]|[^\s|:"'][^|:"']*[^\s|:"']|[^\s|:"']/g);if(b&&1
b)switch(d=""+(d||"..."),b-=d.length,a=""+a,c){case "left":return d+a.slice(-b);case "middle":return c=Math.ceil(b/
-2),a.substr(0,c)+d+a.slice(c-b);default:return a.substr(0,b)+d}else return a},json:function(a,b,d){return c.toJSON(a,d,b)},number:function(a){return(+l(a)).toLocaleString()}};h.textFilter={preprocessor:v,enableForBinding:w};var F=".";D(/([^\.]+)\.(.+)/,function(a,b){var d=a[1],g=c.bindingHandlers[d];if(g)return d=(g.getNamespacedHandler||x).call(g,a[2],d,b),c.bindingHandlers[b]=d});h.namespacedBinding={defaultGetHandler:x,setDefaultBindingPreprocessor:s,addDefaultBindingPreprocessor:s,preprocessor:E,
-enableForBinding:p};h.wrappedCallback={preprocessor:m,enableForBinding:t};h.preprocessBindingProperty={setPreprocessor:q,addPreprocessor:q};var M=y("$data,$event");h.expressionCallback={makePreprocessor:y,eventPreprocessor:M,enableForBinding:function(a,b){b=Array.prototype.slice.call(arguments,1).join();k(a,y(b))}};c.bindingHandlers.on={getNamespacedHandler:function(a){a=c.getBindingHandler("event"+F+a);return k(a,M)}};if(!c.virtualElements.allowedBindings.html){var Q=c.bindingHandlers.html.update;
-c.bindingHandlers.html.update=function(a,b){if(8===a.nodeType){var d=l(b());null!=d?(d=c.utils.parseHtmlFragment(""+d),c.virtualElements.setDomNodeChildren(a,d)):c.virtualElements.emptyNode(a)}else Q(a,b)};c.virtualElements.allowedBindings.html=!0}var O=h.interpolationMarkup={preprocessor:H,enable:I,wrapExpression:function(a,b){var d=b?b.ownerDocument:document,c=!0,e,f=a[0],h=a[a.length-1],k=[];if("#"===f){if("/"===h?e=a.slice(1,-1):(e=a.slice(1),c=!1),f=e.match(/^([^,"'{}()\/:[\]\s]+)\s+([^\s:].*)/))e=
-f[1]+":"+f[2]}else"/"!==f&&(e="{"===f&&"}"===h?"html:"+z(a.slice(1,-1)):"text:"+z(a));e&&k.push(d.createComment("ko "+e));c&&k.push(d.createComment("/ko"));return k}},A="data-bind",P=h.attributeInterpolationMarkup={preprocessor:J,enable:L,attributeBinding:K};return h});