vendor: 4,134 bytes, lines 1-13
1/* ------------------------------------------------------------------------ */ 2/* Plugins 3/* ------------------------------------------------------------------------ */ 4/* 5 * jQuery Superfish Menu Plugin - v1.7.8 6 * Copyright (c) 2016 Joel Birch 7 * 8 * Dual licensed under the MIT and GPL licenses: 9 * http://www.opensource.org/licenses/mit-license.php 10 * http://www.gnu.org/licenses/gpl.html 11 */ 12 13;!function(a,b){"use strict";var c=function(){var c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",menuArrowClass:"sf-arrows"},d=function(){var b=/^(?![\w\W]*Windows Phone)[\w\W]*(iPhone|iPad|iPod)/i.test(navigator.userAgent);return b&&a("html").css("cursor","pointer").on("click",a.noop),b}(),e=function(){var a=document.documentElement.style;return"behavior"in a&&"fill"in a&&/iemobile/i.test(navigator.userAgent)}(),f=function(){return!!b.PointerEvent}(),g=function(a,b,d){var e,f=c.menuClass;b.cssArrows&&(f+=" "+c.menuArrowClass),e=d?"addClass":"removeClass",a[e](f)},h=function(b,d){return b.find("li."+d.pathClass).slice(0,d.pathLevels).addClass(d.hoverClass+" "+c.bcClass).filter(function(){return a(this).children(d.popUpSelector).hide().show().length}).removeClass(d.pathClass)},i=function(a,b){var d=b?"addClass":"removeClass";a.children("a")[d](c.anchorClass)},j=function(a){var b=a.css("ms-touch-action"),c=a.css("touch-action");c=c||b,c="pan-y"===c?"auto":"pan-y",a.css({"ms-touch-action":c,"touch-action":c})},k=function(a){return a.closest("."+c.menuClass)},l=function(a){return k(a).data("sfOptions")},m=function(){var b=a(this),c=l(b);clearTimeout(c.sfTimer),b.siblings().superfish("hide").end().superfish("show")},n=function(b){b.retainPath=a.inArray(this[0],b.$path)>-1,this.superfish("hide"),this.parents("."+b.hoverClass).length||(b.onIdle.call(k(this)),b.$path.length&&a.proxy(m,b.$path)())},o=function(){var b=a(this),c=l(b);d?a.proxy(n,b,c)():(clearTimeout(c.sfTimer),c.sfTimer=setTimeout(a.proxy(n,b,c),c.delay))},p=function(b){var c=a(this),d=l(c),e=c.siblings(b.data.popUpSelector);return d.onHandleTouch.call(e)===!1?this:void(e.length>0&&e.is(":hidden")&&(c.one("click.superfish",!1),"MSPointerDown"===b.type||"pointerdown"===b.type?c.trigger("focus"):a.proxy(m,c.parent("li"))()))},q=function(b,c){var g="li:has("+c.popUpSelector+")";a.fn.hoverIntent&&!c.disableHI?b.hoverIntent(m,o,g):b.on("mouseenter.superfish",g,m).on("mouseleave.superfish",g,o);var h="MSPointerDown.superfish";f&&(h="pointerdown.superfish"),d||(h+=" touchend.superfish"),e&&(h+=" mousedown.superfish"),b.on("focusin.superfish","li",m).on("focusout.superfish","li",o).on(h,"a",c,p)};return{hide:function(b){if(this.length){var c=this,d=l(c);if(!d)return this;var e=d.retainPath===!0?d.$path:"",f=c.find("li."+d.hoverClass).add(this).not(e).removeClass(d.hoverClass).children(d.popUpSelector),g=d.speedOut;if(b&&(f.show(),g=0),d.retainPath=!1,d.onBeforeHide.call(f)===!1)return this;f.stop(!0,!0).animate(d.animationOut,g,function(){var b=a(this);d.onHide.call(b)})}return this},show:function(){var a=l(this);if(!a)return this;var b=this.addClass(a.hoverClass),c=b.children(a.popUpSelector);return a.onBeforeShow.call(c)===!1?this:(c.stop(!0,!0).animate(a.animation,a.speed,function(){a.onShow.call(c)}),this)},destroy:function(){return this.each(function(){var b,d=a(this),e=d.data("sfOptions");return e?(b=d.find(e.popUpSelector).parent("li"),clearTimeout(e.sfTimer),g(d,e),i(b),j(d),d.off(".superfish").off(".hoverIntent"),b.children(e.popUpSelector).attr("style",function(a,b){return b.replace(/display[^;]+;?/g,"")}),e.$path.removeClass(e.hoverClass+" "+c.bcClass).addClass(e.pathClass),d.find("."+e.hoverClass).removeClass(e.hoverClass),e.onDestroy.call(d),void d.removeData("sfOptions")):!1})},init:function(b){return this.each(function(){var d=a(this);if(d.data("sfOptions"))return!1;var e=a.extend({},a.fn.superfish.defaults,b),f=d.find(e.popUpSelector).parent("li");e.$path=h(d,e),d.data("sfOptions",e),g(d,e,!0),i(f,!0),j(d),q(d,e),f.not("."+c.bcClass).superfish("hide",!0),e.onInit.call(this)})}}}();a.fn.superfish=function(b,d){return c[b]?c[b].apply(this,Array.prototype.slice.call(arguments,1
13)):"object"!=typeof b&&b?a.error("Method "+b+" does not exist on jQuery.fn.superfish"):c.init.apply(this,arguments)},a.fn.superfish.defaults={popUpSelector:"ul,.sf-mega",hoverClass:"sfHover",pathClass:"overrideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},animationOut:{opacity:"hide"},speed:"normal",speedOut:"fast",cssArrows:!0,disableHI:!1,onInit:a.noop,onBeforeShow:a.noop,onShow:a.noop,onBeforeHide:a.noop,onHide:a.noop,onIdle:a.noop,onDestroy:a.noop,onHandleTouch:a.noop}}(jQuery,window); 14 15/* 16 * hoverIntent 17 */ 18 !function(e){e.fn.hoverIntent=function(t,n,o){var r={interval:100,sensitivity:6,timeout:0};r="object"==typeof t?e.extend(r,t):e.isFunction(n)?e.extend(r,{over:t,out:n,selector:o}):e.extend(r,{over:t,out:t,selector:n});var v,i,u,s,h=function(e){v=e.pageX,i=e.pageY},I=function(t,n){return n.hoverIntent_t=clearTimeout(n.hoverIntent_t),Math.sqrt((u-v)*(u-v)+(s-i)*(s-i))<r.sensitivity?(e(n).off("mousemove.hoverIntent",h),n.hoverIntent_s=!0,r.over.apply(n,[t])):(u=v,s=i,n.hoverIntent_t=setTimeout(function(){I(t,n)},r.interval),void 0)},a=function(e,t){return t.hoverIntent_t=clearTimeout(t.hoverIntent_t),t.hoverIntent_s=!1,r.out.apply(t,[e])},c=function(t){var n=e.extend({},t),o=this;o.hoverIntent_t&&(o.hoverIntent_t=clearTimeout(o.hoverIntent_t)),"mouseenter"===t.type?(u=n.pageX,s=n.pageY,e(o).on("mousemove.hoverIntent",h),o.hoverIntent_s||(o.hoverIntent_t=setTimeout(function(){I(n,o)},r.interval))):(e(o).off("mousemove.hoverIntent",h),o.hoverIntent_s&&(o.hoverIntent_t=setTimeout(function(){a(n,o)},r.timeout)))};return this.on({"mouseenter.hoverIntent":c,"mouseleave.hoverIntent":c},r.selector)}}(jQuery); 19 20/*! 21 * imagesLoaded PACKAGED v3.1.8 22 * JavaScript is all like "You images are done yet or what?" 23 * MIT License 24 */ 25(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1
25);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function f(e){this.img=e}function c(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var f=r[o];this.addImage(f)}}},s.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),f.prototype=new t,f.prototype.check=function(){var e=v[this.img.src]||new c(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return c.prototype=new t,c.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},c.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit
25("confirm",this,t)},c.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s}); 26 27/*! 28 * FitVids 1.1 29 * Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com 30 * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ 31 * Released under the WTFPL license - http://sam.zoy.org/wtfpl/ 32 */ 33!function($){"use strict";$.fn.fitVids=function(options){var settings={customSelector:null};if(!document.getElementById("fit-vids-style")){var head=document.head||document.getElementsByTagName("head")[0],css=".fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}",div=document.createElement("div");div.innerHTML='<p>x</p><style id="fit-vids-style">'+css+"</style>",head.appendChild(div.childNodes[1])}return options&&$.extend(settings,options),this.each(function(){var selectors=["iframe[src*='player.vimeo.com']","iframe[src*='youtube.com']","iframe[src*='youtube-nocookie.com']","iframe[src*='kickstarter.com'][src*='video.html']","object","embed"];settings.customSelector&&selectors.push(settings.customSelector);var $allVideos=$(this).find(selectors.join(","));$allVideos=$allVideos.not("object object"),$allVideos.each(function(){var $this=$(this);if(!("embed"===this.tagName.toLowerCase()&&$this.parent("object").length||$this.parent(".fluid-width-video-wrapper").length)){$this.css("height")||$this.css("width")||!isNaN($this.attr("height"))&&!isNaN($this.attr("width"))||($this.attr("height",9),$this.attr("width",16));var height="object"===this.tagName.toLowerCase()||$this.attr("height")&&!isNaN(parseInt($this.attr("height"),10))?parseInt($this.attr("height"),10):$this.height(),width=isNaN(parseInt($this.attr("width"),10))?$this.width():parseInt($this.attr("width"),10),aspectRatio=height/width;if(!$this.attr("id")){var videoID="fitvid"+Math.floor(999999*Math.random());$this.attr("id",videoID)}$this.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*aspectRatio+"%"),$this.removeAttr("height").removeAttr("width")}})})}}(window.jQuery||window.Zepto); 34 35/** 36 * Copyright (c) 2007 Ariel Flesler | https://github.com/flesler 37 * Licensed under MIT 38 * @author Ariel Flesler 39 * @version 2.1.2 40 */ 41;(function(f){"use strict";"function"===typeof define&&define.amd?define(["jquery"],f):"undefined"!==typeof module&&module.exports?module.exports=f(require("jquery")):f(jQuery)})(function($){"use strict";function n(a){return!a.nodeName||-1!==$.inArray(a.nodeName.toLowerCase(),["iframe","#document","html","body"])}function h(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}var p=$.scrollTo=function(a,d,b){return $(window).scrollTo(a,d,b)};p.defaults={axis:"xy",duration:0,limit:!0};$.fn.scrollTo=function(a,d,b){"object"=== typeof d&&(b=d,d=0);"function"===typeof b&&(b={onAfter:b});"max"===a&&(a=9E9);b=$.extend({},p.defaults,b);d=d||b.duration;var u=b.queue&&1<b.axis.length;u&&(d/=2);b.offset=h(b.offset);b.over=h(b.over);return this.each(function(){function k(a){var k=$.extend({},b,{queue:!0,duration:d,complete:a&&function(){a.call(q,e,b)}});r.animate(f,k)}if(null!==a){var l=n(this),q=l?this.contentWindow||window:this,r=$(q),e=a,f={},t;switch(typeof e){case "number":case "string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(e)){e= h(e);break}e=l?$(e):$(e,q);case "object":if(e.length===0)return;if(e.is||e.style)t=(e=$(e)).offset()}var v=$.isFunction(b.offset)&&b.offset(q,e)||b.offset;$.each(b.axis.split(""),function(a,c){var d="x"===c?"Left":"Top",m=d.toLowerCase(),g="scroll"+d,h=r[g](),n=p.max(q,c);t?(f[g]=t[m]+(l?0:h-r.offset()[m]),b.margin&&(f[g]-=parseInt(e.css("margin"+d),10)||0,f[g]-=parseInt(e.css("border"+d+"Width"),10)||0),f[g]+=v[m]||0,b.over[m]&&(f[g]+=e["x"===c?"width":"height"]()*b.over[m])):(d=e[m],f[g]=d.slice&& "%"===d.slice(-1)?parseFloat(d)/100*n:d);b.limit&&/^\d+$/.test(f[g])&&(f[g]=0>=f[g]?0:Math.min(f[g],n));!a&&1<b.axis.length&&(h===f[g]?f={}:u&&(k(b.onAfterFirst),f={}))});k(b.onAfter)}})};p.max=function(a,d){var b="x"===d?"Width":"Height",h="scroll"+b;if(!n(a))return a[h]-$(a)[b.toLowerCase()]();var b="client"+b,k=a.ownerDocument||a.document,l=k.documentElement,k=k.body;return Math.max(l[h],k[h])-Math.min(l[b],k[b])};$.Tween.propHooks.scrollLeft=$.Tween.propHooks.scrollTop={get:function(a){return $(a.elem)[a.prop]()}, set:function(a){var d=this.get(a);if(a.options.interrupt&&a._last&&a._last!==d)return $(a.elem).stop();var b=Math.round(a.now);d!==b&&($(a.elem)[a.prop](b),a._last=this.get(a))}};return p}); 42 43/* jQuery Browser Migration */ 44jQuery.browser = {}; 45(function () { 46 jQuery.browser.msie = false;
47 jQuery.browser.version = 0; 48 if (navigator.userAgent.match(/MSIE ([0-9]+)\./)) { 49 jQuery.browser.msie = true; 50 jQuery.browser.version = RegExp.$1; 51 } 52})(); 53 54// tipsy, facebook style tooltips for jquery 55// version 1.0.0a 56// (c) 2008-2010 jason frame [[email protected]] 57// released under the MIT license 58(function($) { 59 60 function maybeCall(thing, ctx) { 61 return (typeof thing == 'function') ? (thing.call(ctx)) : thing; 62 }; 63 64 function isElementInDOM(ele) { 65 while (ele = ele.parentNode) { 66 if (ele == document) return true; 67 } 68 return false; 69 }; 70 71 function Tipsy(element, options) { 72 this.$element = $(element); 73 this.options = options; 74 this.enabled = true; 75 this.fixTitle(); 76 }; 77 78 Tipsy.prototype = { 79 show: function() { 80 var title = this.getTitle(); 81 if (title && this.enabled) { 82 var $tip = this.tip(); 83 84 $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title); 85 $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity 86 $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body); 87 88 var pos = $.extend({}, this.$element.offset(), { 89 width: this.$element[0].offsetWidth, 90 height: this.$element[0].offsetHeight 91 }); 92 93 var actualWidth = $tip[0].offsetWidth, 94 actualHeight = $tip[0].offsetHeight, 95 gravity = maybeCall(this.options.gravity, this.$element[0]); 96 97 var tp; 98 switch (gravity.charAt(0)) { 99 case 'n': 100 tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; 101 break; 102 case 's': 103 tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; 104 break; 105 case 'e': 106 tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset}; 107 break; 108 case 'w': 109 tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset}; 110 break; 111 } 112 113 if (gravity.length == 2) { 114 if (gravity.charAt(1) == 'w') { 115 tp.left = pos.left + pos.width / 2 - 15; 116 } else { 117 tp.left = pos.left + pos.width / 2 - actualWidth + 15; 118 } 119 } 120 121 $tip.css(tp).addClass('tipsy-' + gravity); 122 $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0); 123 if (this.options.className) { 124 $tip.addClass(maybeCall(this.options.className, this.$element[0])); 125 } 126 127 if (this.options.fade) { 128 $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity}); 129 } else { 130 $tip.css({visibility: 'visible', opacity: this.options.opacity}); 131 } 132 } 133 }, 134 135 hide: function() { 136 if (this.options.fade) { 137 this.tip().stop().fadeOut(function() { $(this).remove(); }); 138 } else { 139 this.tip().remove(); 140 } 141 }, 142 143 fixTitle: function() { 144 var $e = this.$element; 145 if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') { 146 $e.attr('original-title', $e.attr('title') || '').removeAttr('title'); 147 } 148 }, 149 150 getTitle: function() { 151 var title, $e = this.$element, o = this.options; 152 this.fixTitle(); 153 var title, o = this.options; 154 if (typeof o.title == 'string') { 155 title = $e.attr(o.title == 'title' ? 'original-title' : o.title); 156 } else if (typeof o.title == 'function') { 157 title = o.title.call($e[0]); 158 } 159 title = ('' + title).replace(/(^\s*|\s*$)/, ""); 160 return title || o.fallback; 161 }, 162 163 tip: function() { 164 if (!this.$tip) { 165 this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>'); 166 this.$tip.data('tipsy-pointee', this.$element[0]); 167 } 168 return this.$tip; 169 }, 170 171 validate: function() { 172 if (!this.$element[0].parentNode) { 173 this.hide(); 174 this.$element = null; 175 this.options = null; 176 } 177 }, 178 179 enable: function() { this.enabled = true; }, 180 disable: function() { this.enabled = false; }, 181 toggleEnabled: function() { this.enabled = !this.enabled; } 182 }; 183 184 $.fn.tipsy = function(options) { 185 186 if (options === true) { 187 return this.data('tipsy'); 188 } else if (typeof options == 'string') { 189 var tipsy = this.data('tipsy'); 190 if (tipsy) tipsy[options](); 191 return this; 192 } 193 194 options = $.extend({}, $.fn.tipsy.defaults, options); 195 196 function get(ele) { 197 var tipsy = $.data(ele, 'tipsy'); 198 if (!tipsy) { 199 tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options)); 200 $.data(ele, 'tipsy', tipsy); 201 } 202 return tipsy; 203 } 204 205 function enter() { 206 var tipsy = get(this); 207 tipsy.hoverState = 'in'; 208 if (options.delayIn == 0) { 209 tipsy.show(); 210 } else { 211 tipsy.fixTitle(); 212 setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn); 213 } 214 }; 215 216 function leave() { 217 var tipsy = get(this); 218 tipsy.hoverState = 'out'; 219 if (options.delayOut == 0) { 220 tipsy.hide(); 221 } else { 222 setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut); 223 } 224 }; 225 226 if (!options.live) this.each(function() { get(this); }); 227 228 if (options.trigger != 'manual') { 229 var binder = options.live ? 'live' : 'bind', 230 eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', 231 eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'; 232 this[binder](eventIn, enter)[binder](eventOut, leave); 233 } 234 235 return this; 236 237 }; 238 239 $.fn.tipsy.defaults = { 240 className: null, 241 delayIn: 0, 242 delayOut: 0, 243 fade: false, 244 fallback: '', 245 gravity: 'n', 246 html: false, 247 live: false, 248 offset: 0, 249 opacity: 0.8, 250 title: 'title', 251 trigger: 'hover' 252 }; 253 254 $.fn.tipsy.revalidate = function() { 255 $('.tipsy').each(function() { 256 var pointee = $.data(this, 'tipsy-pointee'); 257 if (!pointee || !isElementInDOM(pointee)) { 258 $(this).remove(); 259 } 260 }); 261 }; 262 263 // Overwrite this method to provide options on a per-element basis. 264 // For example, you could store the gravity in a 'tipsy-gravity' attribute: 265 // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' }); 266 // (remember - do not modify 'options' in place!) 267 $.fn.tipsy.elementOptions = function(ele, options) { 268 return $.metadata ? $.extend({}, options, $(ele).metadata()) : options; 269 }; 270 271 $.fn.tipsy.autoNS = function() { 272 return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n'; 273 }; 274 275 $.fn.tipsy.autoWE = function() { 276 return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w'; 277 }; 278 279 /** 280 * yields a closure of the supplied parameters, producing a function that takes 281 * no arguments and is suitable for use as an autogravity function like so: 282 * 283 * @param margin (int) - distance from the viewable region edge that an 284 * element should be before setting its tooltip's gravity to be away 285 * from that edge. 286 * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer 287 * if there are no viewable region edges effecting the tooltip's 288 * gravity. It will try to vary from this minimally, for example, 289 * if 'sw' is preferred and an element is near the right viewable 290 * region edge, but not the top edge, it will set the gravity for 291 * that element's tooltip to be 'se', preserving the southern 292 * component. 293 */ 294 $.fn.tipsy.autoBounds = function(margin, prefer) { 295 return function() { 296 var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)}, 297 boundTop = $(document).scrollTop() + margin, 298 boundLeft = $(document).scrollLeft() + margin, 299 $this = $(this); 300 301 if ($this.offset().top < boundTop) dir.ns = 'n'; 302 if ($this.offset().left < boundLeft) dir.ew = 'w'; 303 if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e'; 304 if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's'; 305 306 return dir.ns + (dir.ew ? dir.ew : ''); 307 } 308 }; 309 310})(jQuery); 311 312/* 313Plugin: jQuery Parallax 314Version 1.1.3 315Author: Ian Lunn 316Twitter: @IanLunn 317Author URL: http://www.ianlunn.co.uk/ 318Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/ 319 320Dual licensed under the MIT and GPL licenses: 321http://www.opensource.org/licenses/mit-license.php 322http://www.gnu.org/licenses/gpl.html 323*/ 324 325(function( $ ){ 326 var $window = $(window); 327 var windowHeight = $window.height(); 328 329 $window.resize(function () { 330 windowHeight = $window.height(); 331 }); 332 333 $.fn.parallax = function(xpos, speedFactor, outerHeight) { 334 var $this = $(this); 335 var getHeight; 336 var firstTop; 337 var paddingTop = 0; 338 339 //get the starting position of each element to have parallax applied to it 340 $this.each(function(){ 341 firstTop = $this.offset().top; 342 }); 343 344 if (outerHeight) { 345 getHeight = function(jqo) { 346 return jqo.outerHeight(true); 347 }; 348 } else { 349 getHeight = function(jqo) { 350 return jqo.height(); 351 }; 352 } 353 354 // setup defaults if arguments aren't specified 355 if (arguments.length < 1 || xpos === null) xpos = "50%"; 356 if (arguments.length < 2 || speedFactor === null) speedFactor = 0.1; 357 if (arguments.length < 3 || outerHeight === null) outerHeight = true; 358 359 // function to be called whenever the window is scrolled or resized
360 function update(){ 361 var pos = $window.scrollTop(); 362 363 $this.each(function(){ 364 var $element = $(this); 365 var top = $element.offset().top; 366 var height = getHeight($element); 367 368 // Check if totally above or totally below viewport 369 // if (top + height < pos || top > pos + windowHeight) { 370 // return; 371 // } 372 373 $this.css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px"); 374 }); 375 } 376 377 $window.bind('scroll', update).resize(update); 378 update(); 379 }; 380})(jQuery); 381 382/*! 383 * jquery.countTo() 384 * https://github.com/mhuggins/jquery-countTo 385 * 386 * Copyright 2013 Adam Coulombe 387 * @license http://www.opensource.org/licenses/mit-license.html MIT License 388 */ 389(function(e){function t(e,t){return e.toFixed(t.decimals)}e.fn.countTo=function(t){t=t||{};return e(this).each(function(){function l(){a+=i;u++;c(a);if(typeof n.onUpdate=="function"){n.onUpdate.call(s,a)}if(u>=r){o.removeData("countTo");clearInterval(f.interval);a=n.to;if(typeof n.onComplete=="function"){n.onComplete.call(s,a)}}}function c(e){var t=n.formatter.call(s,e,n);o.text(t)}var n=e.extend({},e.fn.countTo.defaults,{from:e(this).data("from"),to:e(this).data("to"),speed:e(this).data("speed"),refreshInterval:e(this).data("refresh-interval"),decimals:e(this).data("decimals")},t);var r=Math.ceil(n.speed/n.refreshInterval),i=(n.to-n.from)/r;var s=this,o=e(this),u=0,a=n.from,f=o.data("countTo")||{};o.data("countTo",f);if(f.interval){clearInterval(f.interval)}f.interval=setInterval(l,n.refreshInterval);c(a)})};e.fn.countTo.defaults={from:0,to:0,speed:1e3,refreshInterval:100,decimals:0,formatter:t,onUpdate:null,onComplete:null}})(jQuery) 390 391/*! 392 * Packery layout mode PACKAGED v1.1.0 393 * sub-classes Packery 394 * http://packery.metafizzy.com 395 */ 396!function(a){function b(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}function c(a,b){var c=d(a,b)?f:e;c(a,b)}var d,e,f;"classList"in document.documentElement?(d=function(a,b){return a.classList.contains(b)},e=function(a,b){a.classList.add(b)},f=function(a,b){a.classList.remove(b)}):(d=function(a,c){return b(c).test(a.className)},e=function(a,b){d(a,b)||(a.className=a.className+" "+b)},f=function(a,c){a.className=a.className.replace(b(c)," ")});var g={hasClass:d,addClass:e,removeClass:f,toggleClass:c,has:d,add:e,remove:f,toggle:c};"function"==typeof define&&define.amd?define("classie/classie",g):"object"==typeof exports?module.exports=g:a.classie=g}(window),function(a){function b(){function a(b){for(var c in a.defaults)this[c]=a.defaults[c];for(c in b)this[c]=b[c]}return c.Rect=a,a.defaults={x:0,y:0,width:0,height:0},a.prototype.contains=function(a){var b=a.width||0,c=a.height||0;return this.x<=a.x&&this.y<=a.y&&this.x+this.width>=a.x+b&&this.y+this.height>=a.y+c},a.prototype.overlaps=function(a){var b=this.x+this.width,c=this.y+this.height,d=a.x+a.width,e=a.y+a.height;return this.x<d&&b>a.x&&this.y<e&&c>a.y},a.prototype.getMaximalFreeRects=function(b){if(!this.overlaps(b))return!1;var c,d=[],e=this.x+this.width,f=this.y+this.height,g=b.x+b.width,h=b.y+b.height;return this.y<b.y&&(c=new a({x:this.x,y:this.y,width:this.width,height:b.y-this.y}),d.push(c)),e>g&&(c=new a({x:g,y:this.y,width:e-g,height:this.height}),d.push(c)),f>h&&(c=new a({x:this.x,y:h,width:this.width,height:f-h}),d.push(c)),this.x<b.x&&(c=new a({x:this.x,y:this.y,width:b.x-this.x,height:this.height}),d.push(c)),d},a.prototype.canFit=function(a){return this.width>=a.width&&this.height>=a.height},a}var c=a.Packery=function(){};"function"==typeof define&&define.amd?define("packery/js/rect",b):"object"==typeof exports?module.exports=b():(a.Packery=a.Packery||{},a.Packery.Rect=b())}(window),function(a){function b(a){function b(a,b,c){this.width=a||0,this.height=b||0,this.sortDirection=c||"downwardLeftToRight",this.reset()}b.prototype.reset=function(){this.spaces=[],this.newSpaces=[];var b=new a({x:0,y:0,width:this.width,height:this.height});this.spaces.push(b),this.sorter=c[this.sortDirection]||c.downwardLeftToRight},b.prototype.pack=function(a){for(var b=0,c=this.spaces.length;c>b;b++){var d=this.spaces[b];if(d.canFit(a)){this.placeInSpace(a,d);break}}},b.prototype.placeInSpace=function(a,b){a.x=b.x,a.y=b.y,this.placed(a)},b.prototype.placed=function(a){for(var b=[],c=0,d=this.spaces.length;d>c;c++){var e=this.spaces[c],f=e.getMaximalFreeRects(a);f?b.push.apply(b,f):b.push(e)}this.spaces=b,this.mergeSortSpaces()},b.prototype.mergeSortSpaces=function(){b.mergeRects(this.spaces),this.spaces.sort(this.sorter)},b.prototype.addSpace=function(a){this.spaces.push(a),this.mergeSortSpaces()},b.mergeRects=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];if(d){var e=a.slice(0);e.splice(b,1);for(var f=0,g=0,h=e.length;h>g;g++){var i=e[g],j=b>g?0:1;d.contains(i)&&(a.splice(g+j-f,1),f++)}}}return a};var c={downwardLeftToRight:function(a,b){return a.y-b.y||a.x-b.x},rightwardTopToBottom:function(a,b){return a.x-b.x||a.y-b.y}};return b}if("function"==typeof define&&define.amd)define("packery/js/packer",["./rect"],b);
396else if("object"==typeof exports)module.exports=b(require("./rect"));else{var c=a.Packery=a.Packery||{};c.Packer=b(c.Rect)}}(window),function(a){function b(a,b,c){var d=a("transform"),e=function(){b.Item.apply(this,arguments)};e.prototype=new b.Item;var f=e.prototype._create;return e.prototype._create=function(){f.call(this),this.rect=new c,this.placeRect=new c},e.prototype.dragStart=function(){this.getPosition(),this.removeTransitionStyles(),this.isTransitioning&&d&&(this.element.style[d]="none"),this.getSize(),this.isPlacing=!0,this.needsPositioning=!1,this.positionPlaceRect(this.position.x,this.position.y),this.isTransitioning=!1,this.didDrag=!1},e.prototype.dragMove=function(a,b){this.didDrag=!0;var c=this.layout.size;a-=c.paddingLeft,b-=c.paddingTop,this.positionPlaceRect(a,b)},e.prototype.dragStop=function(){this.getPosition();var a=this.position.x!==this.placeRect.x,b=this.position.y!==this.placeRect.y;this.needsPositioning=a||b,this.didDrag=!1},e.prototype.positionPlaceRect=function(a,b,c){this.placeRect.x=this.getPlaceRectCoord(a,!0),this.placeRect.y=this.getPlaceRectCoord(b,!1,c)},e.prototype.getPlaceRectCoord=function(a,b,c){var d=b?"Width":"Height",e=this.size["outer"+d],f=this.layout[b?"columnWidth":"rowHeight"],g=this.layout.size["inner"+d];b||(g=Math.max(g,this.layout.maxY),this.layout.rowHeight||(g-=this.layout.gutter));var h;if(f){f+=this.layout.gutter,g+=b?this.layout.gutter:0,a=Math.round(a/f);var i;i=this.layout.options.isHorizontal?b?"ceil":"floor":b?"floor":"ceil";var j=Math[i](g/f);j-=Math.ceil(e/f),h=j}else h=g-e;return a=c?a:Math.min(a,h),a*=f||1,Math.max(0,a)},e.prototype.copyPlaceRectPosition=function(){this.rect.x=this.placeRect.x,this.rect.y=this.placeRect.y},e.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.layout.packer.addSpace(this.rect),this.emitEvent("remove",[this])},e}"function"==typeof define&&define.amd?define("packery/js/item",["get-style-property/get-style-property","outlayer/outlayer","./rect"],b):"object"==typeof exports?module.exports=b(require("desandro-get-style-property"),require("outlayer"),require("./rect")):a.Packery.Item=b(a.getStyleProperty,a.Outlayer,a.Packery.Rect)}(window),function(a){function b(a,b,c,d,e,f){function g(a,b){return a.position.y-b.position.y||a.position.x-b.position.x}function h(a,b){return a.position.x-b.position.x||a.position.y-b.position.y}var i=c.create("packery");return i.Item=f,i.prototype._create=function(){c.prototype._create.call(this),this.packer=new e,this.stamp(this.options.stamped);var a=this;this.handleDraggabilly={dragStart:function(b){a.itemDragStart(b.element)},dragMove:function(b){a.itemDragMove(b.element,b.position.x,b.position.y)},dragEnd:function(b){a.itemDragEnd(b.element)}},this.handleUIDraggable={start:function(b){a.itemDragStart(b.currentTarget)},drag:function(b,c){a.itemDragMove(b.currentTarget,c.position.left,c.position.top)},stop:function(b){a.itemDragEnd(b.currentTarget)}}},i.prototype._resetLayout=function(){this.getSize(),this._getMeasurements();var a=this.packer;this.options.isHorizontal?(a.width=Number.POSITIVE_INFINITY,a.height=this.size.innerHeight+this.gutter,a.sortDirection="rightwardTopToBottom"):(a.width=this.size.innerWidth+this.gutter,a.height=Number.POSITIVE_INFINITY,a.sortDirection="downwardLeftToRight"),a.reset(),this.maxY=0,this.maxX=0},i.prototype._getMeasurements=function(){this._getMeasurement("columnWidth","width"),this._getMeasurement("rowHeight","height"),this._getMeasurement("gutter","width")},i.prototype._getItemLayoutPosition=function(a){return this._packItem(a),a.rect},i.prototype._packItem=function(a){this._setRectSize(a.element,a.rect),this.packer.pack(a.rect),this._setMaxXY(a.rect)},i.prototype._setMaxXY=function(a){this.maxX=Math.max(a.x+a.width,this.maxX),this.maxY=Math.max(a.y+a.height,this.maxY)},i.prototype._setRectSize=function(a,c){var d=b(a),e=d.outerWidth,f=d.outerHeight;if(e||f){var g=this.columnWidth+this.gutter,h=this.rowHeight+this.gutter;e=this.columnWidth?Math.ceil(e/g)*g:e+this.gutter,f=this.rowHeight?Math.ceil(f/h)*h:f+this.gutter}c.width=Math.min(e,this.packer.width),c.height=Math.min(f,this.packer.height)},i.prototype._getContainerSize=function(){return this.options.isHorizontal?{width:this.maxX-this.gutter}:{height:this.maxY-this.gutter}},i.prototype._manageStamp=function(a){var b,c=this.getItem(a);if(c&&c.isPlacing)b=c.placeRect;else{var e=this._getElementOffset(a);b=new d({x:this.options.isOriginLeft?e.left:e.right,y:this.options.isOriginTop?e.top:e.bottom})}this._setRectSize(a,b),this.packer.placed(b),this._setMaxXY(b)}
396,i.prototype.sortItemsByPosition=function(){var a=this.options.isHorizontal?h:g;this.items.sort(a)},i.prototype.fit=function(a,b,c){var d=this.getItem(a);d&&(this._getMeasurements(),this.stamp(d.element),d.getSize(),d.isPlacing=!0,b=void 0===b?d.rect.x:b,c=void 0===c?d.rect.y:c,d.positionPlaceRect(b,c,!0),this._bindFitEvents(d),d.moveTo(d.placeRect.x,d.placeRect.y),this.layout(),this.unstamp(d.element),this.sortItemsByPosition(),d.isPlacing=!1,d.copyPlaceRectPosition())},i.prototype._bindFitEvents=function(a){function b(){d++,2===d&&c.emitEvent("fitComplete",[c,a])}var c=this,d=0;a.on("layout",function(){return b(),!0}),this.on("layoutComplete",function(){return b(),!0})},i.prototype.resize=function(){var a=b(this.element),c=this.size&&a,d=this.options.isHorizontal?"innerHeight":"innerWidth";c&&a[d]===this.size[d]||this.layout()},i.prototype.itemDragStart=function(a){this.stamp(a);var b=this.getItem(a);b&&b.dragStart()},i.prototype.itemDragMove=function(a,b,c){function d(){f.layout(),delete f.dragTimeout}var e=this.getItem(a);e&&e.dragMove(b,c);var f=this;this.clearDragTimeout(),this.dragTimeout=setTimeout(d,40)},i.prototype.clearDragTimeout=function(){this.dragTimeout&&clearTimeout(this.dragTimeout)},i.prototype.itemDragEnd=function(b){var c,d=this.getItem(b);if(d&&(c=d.didDrag,d.dragStop()),!d||!c&&!d.needsPositioning)return void this.unstamp(b);a.add(d.element,"is-positioning-post-drag");var e=this._getDragEndLayoutComplete(b,d);d.needsPositioning?(d.on("layout",e),d.moveTo(d.placeRect.x,d.placeRect.y)):d&&d.copyPlaceRectPosition(),this.clearDragTimeout(),this.on("layoutComplete",e),this.layout()},i.prototype._getDragEndLayoutComplete=function(b,c){var d=c&&c.needsPositioning,e=0,f=d?2:1,g=this;return function(){return e++,e!==f?!0:(c&&(a.remove(c.element,"is-positioning-post-drag"),c.isPlacing=!1,
396c.copyPlaceRectPosition()),g.unstamp(b),g.sortItemsByPosition(),d&&g.emitEvent("dragItemPositioned",[g,c]),!0)}},i.prototype.bindDraggabillyEvents=function(a){a.on("dragStart",this.handleDraggabilly.dragStart),a.on("dragMove",this.handleDraggabilly.dragMove),a.on("dragEnd",this.handleDraggabilly.dragEnd)},i.prototype.bindUIDraggableEvents=function(a){a.on("dragstart",this.handleUIDraggable.start).on("drag",this.handleUIDraggable.drag).on("dragstop",this.handleUIDraggable.stop)},i.Rect=d,i.Packer=e,i}"function"==typeof define&&define.amd?define("packery/js/packery",["classie/classie","get-size/get-size","outlayer/outlayer","./rect","./packer","./item"],b):"object"==typeof exports?module.exports=b(require("desandro-classie"),require("get-size"),require("outlayer"),require("./rect"),require("./packer"),require("./item")):a.Packery=b(a.classie,a.getSize,a.Outlayer,a.Packery.Rect,a.Packery.Packer,a.Packery.Item)}(window),function(a){function b(a,b){for(var c in b)a[c]=b[c];return a}function c(a,c,d){var e=a.create("packery"),f=e.prototype._getElementOffset,g=e.prototype._getMeasurement;b(e.prototype,c.prototype),e.prototype._getElementOffset=f,e.prototype._getMeasurement=g;var h=e.prototype._resetLayout;e.prototype._resetLayout=function(){this.packer=this.packer||new c.Packer,h.apply(this,arguments)};var i=e.prototype._getItemLayoutPosition;e.prototype._getItemLayoutPosition=function(a){return a.rect=a.rect||new c.Rect,i.call(this,a)};var j=e.prototype._manageStamp;return e.prototype._manageStamp=function(){this.options.isOriginLeft=this.isotope.options.isOriginLeft,this.options.isOriginTop=this.isotope.options.isOriginTop,j.apply(this,arguments)},e.prototype.needsResizeLayout=function(){var a=d(this.element),b=this.size&&a,c=this.options.isHorizontal?"innerHeight":"innerWidth";return b&&a[c]!==this.size[c]},e}"function"==typeof define&&define.amd?define(["isotope/js/layout-mode","packery/js/packery","get-size/get-size"],c):"object"==typeof exports?module.exports=c(require("isotope-layout/js/layout-mode"),require("packery"),require("get-size")):c(a.Isotope.LayoutMode,a.Packery,a.getSize)}(window); 397 398/* ======================================================================== 399 * bootstrap-spin - v1.0 400 * https://github.com/wpic/bootstrap-spin 401 * ======================================================================== 402 * Copyright 2014 WPIC, Hamed Abdollahpour 403 * 404 * ======================================================================== 405 * Licensed under the Apache License, Version 2.0 (the "License"); 406 * you may not use this file except in compliance with the License. 407 * You may obtain a copy of the License at 408 * 409 * http://www.apache.org/licenses/LICENSE-2.0 410 * 411 * Unless required by applicable law or agreed to in writing, software 412 * distributed under the License is distributed on an "AS IS" BASIS, 413 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 414 * See the License for the specific language governing permissions and 415 * limitations under the License. 416 * ======================================================================== 417 */ 418(function ( $ ) { 419 420 $.fn.bootstrapNumber = function( options ) { 421 422 var settings = $.extend({ 423 upClass: 'default', 424 downClass: 'default', 425 center: true 426 }, options ); 427 428 return this.each(function(e) { 429 var self = $(this); 430 var clone = self.clone(); 431 432 var min = self.attr('min'); 433 var max = self.attr('max'); 434 435 function setText(n) { 436 if((min && n < min) || (max && n > max)) { 437 return false; 438 } 439 440 clone.val(n); 441 clone.trigger('change'); 442 return true; 443 } 444 445 var group = $("<div class='input-group'></div>"); 446 var down = $("<button type='button'>-</button>").attr('class', 'btn btn-' + settings.downClass).click(function() { 447 setText(parseInt(clone.val()) - 1); 448 }); 449 var up = $("<button type='button'>+</button>").attr('class', 'btn btn-' + settings.upClass).click(function() { 450 setText(parseInt(clone.val()) + 1); 451 }); 452 $("<span class='input-group-btn'></span>").append(down).appendTo(group); 453 clone.appendTo(group); 454 if(clone && settings.center) { 455 clone.css('text-align', 'center'); 456 } 457 $("<span class='input-group-btn'></span>").append(up).appendTo(group); 458 459 // remove spins from original 460 clone.attr('type', 'text').keydown(function (e) { 461 if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 || 462 (e.keyCode == 65 && e.ctrlKey === true) || 463 (e.keyCode >= 35 && e.keyCode <= 39)) { 464 return; 465 } 466 if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) { 467 e.preventDefault(); 468 } 469 470 var c = String.fromCharCode(e.which); 471 var n = parseInt(clone.val() + c); 472 473 if((min && n < min) || (max && n > max)) { 474 e.preventDefault(); 475 } 476 }); 477 478 self.replaceWith(group); 479 }); 480 }; 481} ( jQuery )); 482 483/* ------------------------------------------------------------------------ */ 484/* Main JS File - functions.js 1.0 485/* ------------------------------------------------------------------------ */ 486jQuery(document).ready(function($){ 487 'use strict'; 488 489 /* ------------------------------------------------------------------------ */
490 /* Add .on-mobile Class for mobile devices 491 /* ------------------------------------------------------------------------ */ 492 function mobileClass() { 493 if (/Android|BlackBerry|iPhone|iPad|iPod|IEMobile|Opera Mini|webOS/i.test(navigator.userAgent) === true) { 494 $('body').addClass('on-mobile'); 495 } 496 } 497 498 mobileClass(); 499 500 501 /* ------------------------------------------------------------------------ */ 502 /* Menu 503 /* ------------------------------------------------------------------------ */ 504 function sfLoad() { 505 506 $("#navigation ul.menu").superfish({ 507 delay: 300, 508 hoverClass: 'sfHover', 509 animation: {opacity:'show'}, 510 animationOut: {opacity:'hide'}, 511 speed: 'normal', 512 speedOut: 'fast', 513 cssArrows: true 514 }); 515 516 } 517 518 sfLoad(); 519 520 /* Open Submenu on left side when Screen is too small */ 521 var wapoMainWindowWidth; 522 var subMenuExist; 523 var subMenuWidth; 524 var subMenuOffset; 525 var newSubMenuPosition; 526 527 function sfSubmenuPosition() { 528 wapoMainWindowWidth = $(window).width(); 529 $('#navigation ul li ul').mouseover(function(){ 530 subMenuExist = $(this).find('.sub-menu').length; 531 if( subMenuExist > 0){ 532 subMenuWidth = $(this).find('.sub-menu').width(); 533 subMenuOffset = $(this).find('.sub-menu').parent().offset().left + subMenuWidth; 534 535 // if sub menu is off screen, give new position 536 if((subMenuOffset + subMenuWidth) > wapoMainWindowWidth){ 537 newSubMenuPosition = subMenuWidth + 3; 538 $(this).find('.sub-menu').css({ 539 left: -newSubMenuPosition, 540 top: '0', 541 }); 542 } else { 543 $(this).find('.sub-menu').css({ 544 left: newSubMenuPosition, 545 top: '0', 546 }); 547 } 548 } 549 }); 550 } 551 552 sfSubmenuPosition(); 553 554 /* ------------------------------------------------------------------------ */ 555 /* Header 556 /* ------------------------------------------------------------------------ */ 557 $('.header-v1 #search-btn').click(function(){ 558 $('#search-top').stop(true,true).fadeIn(100); 559 $('#logo-navigation, .header-icons-divider').stop().animate({'opacity' : 0}, 100); 560 $('#search-top input[type=text]').focus(); 561 return false; 562 }); 563 564 function closeSearch(){ 565 $('#search-top').stop(true,true).fadeOut(100); 566 $('#logo-navigation, .header-icons-divider').stop().animate({'opacity' : 1}, 100); 567 } 568 569 $('#close-search-btn').click(function(){ 570 closeSearch(); 571 return false; 572 }); 573 574 $('#search-top input[type=text]').blur(function(e){ 575 closeSearch(); 576 }); 577 578 $(window).resize(function() { 579 if ($(window).width() < 960) { 580 $('#search-top').hide(); 581 } 582 else { 583 $('#mobile-navigation').hide(); 584 } 585 }); 586 587 // Shopping Cart Hover 588 $(".header-v1 #shopping-btn, .header .widget_shopping_cart, .cart-popup").on({ 589 mouseenter: function () { 590 $('.widget_shopping_cart').stop(true, false).fadeIn(200); 591 }, 592 mouseleave: function () { 593 $('.widget_shopping_cart').stop(true, false).fadeOut(200); 594 } 595 }); 596 597 // Remove Top Margin when Slider is first element 598 function headerPadding(){ 599 $(window).resize(function() { 600 if ($(window).width() < 945) { 601 var headerHeight = $('#header').height(); 602 $('.header-is-transparent #page-wrap').has('#content > :first-child > .col > .wpb_column > .wpb_wrapper > .wpb_revslider_element').css({'padding-top': headerHeight}); 603 } else { 604 $('.header-is-transparent #page-wrap').has('#content > :first-child > .col > .wpb_column > .wpb_wrapper > .wpb_revslider_element').css({'padding-top': '0'}); 605 } 606 }).resize(); 607 } 608 609 headerPadding(); 610 611 /* ------------------------------------------------------------------------ */ 612 /* Mobile Navigation 613 /* ------------------------------------------------------------------------ */ 614 $('#mobile-navigation-btn').click(function(){ 615 $('#mobile-navigation').stop(true,true).slideToggle(300, 'easeOutBack'); //easeInOutSine works also nice at 200ms 616 return false; 617 }); 618 619 $('#mobile-navigation .container ul li').each(function(){ 620 if($(this).find('> ul').length > 0) { 621 $(this).addClass('has-ul'); 622 $(this).find('> a').append('<i class="fa fa-chevron-down"></i>'); 623 } 624 }); 625 626 $('#mobile-navigation .container ul li:has(">ul") > a i').click(function(){ 627 $(this).parent().parent().toggleClass('open'); 628 $(this).parent().parent().find('> ul').stop(true,true).slideToggle(300, 'easeOutBack'); 629 return false;
630 }); 631 632 /* ------------------------------------------------------------------------ */ 633 /* Smooth Anchor Scrolling & onePage Scroll Version 2.0 634 /* ------------------------------------------------------------------------ */ 635 function onePage() { 636 637 if($("body").hasClass("pagescroll")){ 638 639 var scrolleffect = "easeOutQuad", 640 scrollspeed = 400, 641 onepage_offset = $("#header").height(), 642 onepage_offset2 = 150; 643 644 if( window.location.hash ) { 645 if($.browser.webkit){ 646 setTimeout ( function () { 647 $.scrollTo( window.location.hash , 260 , { easing: scrolleffect , offset: -onepage_offset , "axis":"y" } ); 648 }, 600); 649 } 650 else { 651 $.scrollTo( window.location.hash , 260 , { easing: scrolleffect , offset: -onepage_offset , "axis":"y" } ); 652 } 653 } 654 655 $("#nav li a[href*=\\#], a[href*=\\#].pagescroll").on("click", function(e){ 656 var linkhref = $(this.hash); 657 $.scrollTo( linkhref, scrollspeed, { easing: scrolleffect , offset: -onepage_offset , 'axis':'y' } ); 658 $(this).blur(); 659 e.preventDefault(); 660 //window.location.hash = $(this).attr('href').split('#')[1]; 661 }) 662 663 var currentNode = null; 664 665 $('#nav li').removeClass('current-menu-item'); 666 667 $(window).scroll(function () { 668 $('.section').each(function(){ 669 if($(this).attr('id') != undefined && $(window).scrollTop() >= ($(this).offset().top - onepage_offset2)){ 670 currentNode = $(this).attr('id'); 671 $('#nav a').parent("li").removeClass('current-menu-item'); 672 $('#nav a[href$="#'+currentNode+'"]').parent("li").addClass('current-menu-item'); 673 } 674 }); 675 }); 676 677 } 678 679 } 680 681 onePage(); 682 683 /* ------------------------------------------------------------------------ */ 684 /* Post Navigation 685 /* ------------------------------------------------------------------------ */ 686 $('#post-navigation .prev').hover( 687 function() { 688 $(this).stop().animate({'left' : 0, 'opacity' : 1}, 160, 'easeOutSine'); 689 }, function() { 690 $(this).stop().animate({'left' : -25, 'opacity' : 0.2}, 160, 'easeOutSine'); 691 } 692 ); 693 694 $('#post-navigation .next').hover( 695 function() { 696 $(this).stop().animate({'right' : 0, 'opacity' : 1}, 160, 'easeOutSine'); 697 }, function() { 698 $(this).stop().animate({'right' : -25, 'opacity' : 0.2}, 160, 'easeOutSine'); 699 } 700 ); 701 702 /* ------------------------------------------------------------------------ */ 703 /* Back To Top 704 /* ------------------------------------------------------------------------ */ 705 function backToTop() { 706 707 $(window).scroll(function(){ 708 if($(window).scrollTop() > 200){ 709 $("#back-to-top").fadeIn(200); 710 } else{ 711 $("#back-to-top").fadeOut(200); 712 } 713 }); 714 715 $('#back-to-top, .back-to-top').click(function() { 716 $('html, body').animate({ scrollTop:0 }, '800'); 717 return false; 718 }); 719 720 } 721 722 backToTop(); 723 724 /* ------------------------------------------------------------------------ */ 725 /* Blog 726 /* ------------------------------------------------------------------------ */ 727 // Blog Image Overlay 728 $('.blog-item .blog-pic').hover(function() { 729 $(this).find('.blog-overlay').stop().animate({'opacity' : 0.94}, 160); 730 $(this).find('i').stop().animate({'margin-top' : '-33px', 'opacity' : 1}, 160, 'easeOutSine'); 731 }, function(){ 732 $(this).find('.blog-overlay').stop().animate({'opacity' : 0}, 160); 733 $(this).find('i').stop().animate({'margin-top' : '23px', 'opacity' : 0}, 160); 734 }); 735 736 // Blog Image Overlay 737 $('.blog-wrap .post .entry-image a').append( '<div class="entry-overlay"><i class="icon-minti-plus"></i></div>' ); 738 $('.blog-single .post .entry-image a').append( '<div class="entry-overlay"><i class="icon-minti-search"></i></div>' ); 739 740 $('.post .entry-image').hover(function() { 741 $(this).find('.entry-overlay').stop().animate({'opacity' : 0.94}, 160); 742 }, function(){ 743 $(this).find('.entry-overlay').stop().animate({'opacity' : 0}, 160); 744 }); 745 746 // Blog Isotope 747 function blogMasonry() { 748 749 var $blogcontainer = $('.blog-masonry .blog-wrap'); 750 751 $blogcontainer.imagesLoaded( function() { 752 setTimeout(function(){ 753 $blogcontainer.isotope({ layoutMode : 'masonry' }); 754 $blogcontainer.animate({'opacity' : 1}, 600); 755 flexsliderLoad(); 756 }, 500); 757 }); 758 759 } 760 761 blogMasonry(); 762 763 /* ------------------------------------------------------------------------ */ 764 /* Portfolio 765 /* ------------------------------------------------------------------------ */ 766 767 // Portfolio Hover 768 $('.widget_portfolio .portfolio-widget-item').hover(function() { 769 $(this).find('.portfolio-overlay').stop().animate({'opacity' : 0.9}, 180); 770 }, function(){ 771 $(this).find('.portfolio-overlay').stop().animate({'opacity' : 0}, 180); 772 }); 773 774 // Overlay-Effect 775 $('.portfolio-overlay-effect .portfolio-item .portfolio-image').hover(function() { 776 $(this).find('.portfolio-overlay').stop().animate({'bottom' : 0}, 200,'easeOutCubic'); 777 $(this).find('.portfolio-image-img').stop().animate({'top' : '-60px'}, 440,'easeOutCubic'); 778 }, function(){ 779 $(this).find('.portfolio-overlay').stop().animate({'bottom' : '-80px'}, 440,'easeOutCubic'); 780 $(this).find('.portfolio-image-img').stop().animate({'top' : '0px'}, 200,'easeOutCubic'); 781 }); 782 783 // Overlay-Icon 784 $('.portfolio-overlay-icon .portfolio-item .portfolio-image').hover(function() { 785 $(this).find('.portfolio-overlay').stop().animate({'opacity' : 0.94}, 160); 786 $(this).find('i').stop().animate({'margin-top' : '-33px', 'opacity' : 1}, 160, 'easeOutSine'); 787 }, function(){ 788 $(this).find('.portfolio-overlay').stop().animate({'opacity' : 0}, 160); 789 $(this).find('i').stop().animate({'margin-top' : '23px', 'opacity' : 0}, 160); 790 }); 791 792 // Overlay-Name 793 $('.portfolio-overlay-name .portfolio-item .portfolio-image').hover(function() { 794 $(this).find('.portfolio-overlay').stop().animate({'opacity' : 0.94}, 160); 795 }, function(){ 796 $(this).find('.portfolio-overlay').stop().animate({'opacity' : 0}, 160); 797 }); 798 799 // Portfolio Isotope 800 function portfolioIsotope(){ 801 802 var $portfoliocontainer = $('.portfolio-items'); 803 $('.portfolio-item').css({visibility: "visible", opacity: "0"}); 804 805 $portfoliocontainer.imagesLoaded( function() { 806 $portfoliocontainer.fadeIn(1000).isotope({ 807 transitionDuration: '0.6s', 808 itemSelector: '.portfolio-item', 809 resizable: false, 810 layoutMode: 'packery', 811 sortBy: 'origorder' 812 }); 813 814 // Fade In 815 $('.portfolio-item').each(function(index){ 816 $(this).delay(80*index).animate({opacity: 1}, 200); 817 }); 818 }); 819 820 /*$(window).resize(function() { 821 $portfoliocontainer.isotope('layout'); 822 });*/ 823 824 $('.portfolio-filters a').click(function(){ 825 $('.portfolio-items').addClass('animatedcontainer'); 826 $(this).closest('.portfolio-filters').find('a').removeClass('active'); 827 $(this).addClass('active'); 828 var selector = $(this).attr('data-filter'); 829 var portfolioID = $(this).closest('.portfolio-filters').attr("data-id"); 830 $('.portfolio-items[data-id=' + portfolioID + ']').isotope({ filter: selector }); 831 return false;
832 }); 833 834 } 835 836 portfolioIsotope(); 837 838 /* ------------------------------------------------------------------------ */ 839 /* FlexSlider 840 /* ------------------------------------------------------------------------ */ 841 function flexsliderLoad() { 842 843 $('.flexslider:not(.blogslider_holder)').each(function() { 844 845 $(this).flexslider({ 846 selector: ".slides > li", 847 animation: "slide", 848 prevText: "", 849 nextText: "", 850 easing: "easeOutQuad", 851 smoothHeight: true, 852 pauseOnHover: true, 853 animationSpeed: 300, 854 start: function(slider) { 855 $(slider).find('.slides') 856 .mousedown(function(e) { 857 $(this).attr('data-mousestart',e.screenX); 858 }) 859 .mouseup(function(e) { 860 var mousestart = parseInt($(this).attr('data-mousestart'),10); 861 var mouseend = e.screenX; 862 $(this).parents('.flexslider').find('.flex-direction-nav .flex-' + (mousestart - mouseend >= 0 ? 'next' : 'prev')).trigger('click'); 863 }); 864 } 865 }); 866 867 }); 868 869 } 870 871 flexsliderLoad(); 872 873 function blogsliderLoad() { 874 875 $('.blogslider_holder.flexslider').each(function() { 876 877 var interval = 4000; 878 var autoslide = true; 879 880 interval = $(this).data("interval"); 881 882 if(interval == 0){ 883 autoslide = false; 884 } else { 885 autoslide = true; 886 } 887 888 $(this).flexslider({ 889 selector: ".slides > li", 890 animation: "slide", 891 prevText: "", 892 nextText: "", 893 smoothHeight: true, 894 pauseOnHover: true, 895 animationLoop: true, 896 animationSpeed: 300, 897 slideshowSpeed: interval, 898 slideshow: autoslide, 899 controlNav: false, 900 start: function(slider) { 901 $(slider).find('.slides') 902 .mousedown(function(e) { 903 $(this).attr('data-mousestart',e.screenX); 904 }) 905 .mouseup(function(e) { 906 var mousestart = parseInt($(this).attr('data-mousestart'),10); 907 var mouseend = e.screenX; 908 $(this).parents('.flexslider').find('.flex-direction-nav .flex-' + (mousestart - mouseend >= 0 ? 'next' : 'prev')).trigger('click'); 909 }); 910 } 911 }); 912 913 }); 914 915 } 916 917 blogsliderLoad(); 918 919 function zoomingSlider() { 920 if ($('.minti_zooming_slider').length) { 921 $('.minti_zooming_slider').each(function() { 922 var $slider = $(this); 923 $slider.find('.minti_zooming_slider_item').eq(0).addClass('active'); 924 $slider.flexslider({ 925 animation: "slide", 926 animationSpeed: 400, 927 useCSS: true, 928 touch: true, 929 directionNav: true, 930 start: function(slider) { 931 $slider.find('.minti_zooming_slider_item').css({ 'opacity': '1', 'filter': 'alpha(opacity=100)' }); 932 var $titles = $slider.find('li:not(.clone) .minti_zooming_slider_item .image_wrapper .minti_zooming_slider_title'); 933 var $control_nav = $slider.find('.flex-control-nav'); 934 $control_nav.addClass('clearfix').find('li').css('width', 100 / $control_nav.find('li').length + '%').prepend('<div class="backline"></div>'); 935 var $control_links = $control_nav.find('li > a'); 936 $control_links.each(function() { 937 $(this).html(''); 938 $('<div class="minti_zooming_slider_ghost'+($(this).parent().is(':first-child') ? ' shown' : '')+'"></div><div class="nav_title"><h6>' + $titles.eq($control_links.index($(this))).html() + '</h6></div>').insertAfter($(this)).click(function() { 939 $(this).siblings('a').trigger('click'); 940 }); 941 }); 942 $(slider).find('.slides').mousedown(function(e) { 943 $(this).attr('data-mousestart',e.screenX); 944 }).mouseup(function(e) { 945 var mousestart = parseInt($(this).attr('data-mousestart'),10); 946 var mouseend = e.screenX; 947 $(this).parents('.minti_zooming_slider').find('.flex-direction-nav .flex-' + (mousestart - mouseend >= 0 ? 'next' : 'prev')).trigger('click'); 948 }); 949 }, 950 before: function(slider) { 951 var target = slider.animatingTo; 952 var current = slider.find('.flex-active').parent().index(); 953 var $items = slider.find('.minti_zooming_slider_item').removeClass('active');
954 $items.eq(target+1).add((target==0) ? $items.last() : (target==$items.length-3 ? $items.first() : '')).addClass('active'); 955 if (target==0) { 956 $('.minti_zooming_slider .slides li:first-child').next().next().clone().appendTo('.minti_zooming_slider .slides').removeClass('clone').addClass('clone_end'); 957 } 958 else if (target==$items.length-3) { 959 $('.minti_zooming_slider .slides li:last-child').prev().prev().clone().appendTo('.minti_zooming_slider .slides').removeClass('clone').addClass('clone_start'); 960 } 961 slider.find('.minti_zooming_slider_ghost.shown').css('left',(target-current)*100 + 50 + '%').removeClass('shown'); 962 slider.find('.flex-control-nav li').eq(target).find('.minti_zooming_slider_ghost').addClass('shown'); 963 }, 964 after: function(slider) { 965 slider.find('.clone_start, .clone_end').remove(); 966 slider.find('.flex-control-nav li .minti_zooming_slider_ghost').css('left',''); 967 } 968 }); 969 }); 970 } 971 } 972 973 zoomingSlider(); 974 975 /* ------------------------------------------------------------------------ */ 976 /* Alert Messages 977 /* ------------------------------------------------------------------------ */ 978 $(".alert-message .close").click(function(){ 979 $(this).parent().animate({'opacity' : '0'}, 300).slideUp(300); 980 return false; 981 }); 982 983 /* ------------------------------------------------------------------------ */ 984 /* Counter 985 /* ------------------------------------------------------------------------ */ 986 987 function counterLoad() { 988 989 $(".counter-number").each(function() { 990 var $countNumber = parseInt($(this).text()); 991 $(this).waypoint(function(){ 992 $(this).countTo({ 993 from: 0, 994 to: $countNumber, 995 speed: 900, 996 refreshInterval: 25 997 }); 998 },{ 999 triggerOnce: true, 1000 offset: '99%' 1001 }); 1002 }); 1003 1004 } 1005 1006 counterLoad(); 1007 1008 /* ------------------------------------------------------------------------ */ 1009 /* Parallax Background // By http://net.tutsplus.com/ 1010 /* ------------------------------------------------------------------------ */ 1011 1012 function parallaxLoad() { 1013 1014 if (/Android|BlackBerry|iPhone|iPad|iPod|webOS/i.test(navigator.userAgent) === false) { 1015 $('.section-parallax').each(function() { 1016 var speed = $(this).data('speed')*0.4; 1017 $(this).parallax("50%", speed); 1018 }); 1019 $('.section-parallax').animate({'opacity': 1}, 600); 1020 } else { 1021 $('.section-parallax').animate({'opacity': 1}, 600); 1022 $('.section-parallax').addClass('on-mobile'); 1023 } 1024 1025 } 1026 1027 parallaxLoad(); 1028 1029 /* ------------------------------------------------------------------------ */ 1030 /* Columns Height & Vertical Center 1031 /* ------------------------------------------------------------------------ */ 1032 function columnAlign(){ 1033 1034 $('.section:has(.vertical-center)').each(function(){ 1035 1036 $(this).find('.vertical-center').animate({'opacity': 1}, 300); 1037 1038 // Find tallest Column & set heights for all others 1039 var findTallest = 0; 1040 var columnHeight = 0; 1041 1042 $(this).find('> .span_12 > .col').each(function(){ 1043 var $padding = parseInt($(this).css('padding-top')); 1044 ($(this).find('> .wpb_wrapper').height() + ($padding*2) > findTallest) ? findTallest = $(this).find('> .wpb_wrapper').height() + ($padding*2) : findTallest = findTallest; 1045 }); 1046 1047 $(this).find('> .span_12 > .col').each(function(){ 1048 $(this).css('height', findTallest); 1049 }); 1050 1051 // Vertical Center 1052 if($(this).find('> .span_12 > .col').hasClass('vertical-center') && window.innerWidth > 767){ 1053 $(this).find('> .span_12 > .col').each(function(){ 1054 columnHeight = $(this).find('> .wpb_wrapper').height(); 1055 var $setMargins = ($(this).height()/2)-(columnHeight/2); 1056 1057 if($setMargins <= 0){ 1058 $setMargins = 0; 1059 } 1060 1061 $(this).find('> .wpb_wrapper').css('margin-top', $setMargins); 1062 //$(this).find('> .wpb_wrapper').css('margin-bottom', $setMargins); 1063 }); 1064 } 1065 1066 }); 1067 1068 } 1069 1070 columnAlign(); 1071 1072 // Late Column Align 1073 // setTimeout(columnAlign,500); 1074 1075 $(window).load(function(){ 1076 columnAlign(); 1077 }); 1078 1079 /* ------------------------------------------------------------------------ */ 1080 /* Masonry Grid 1081 /* ------------------------------------------------------------------------ */ 1082 function initMasonryGrid(){ 1083 1084 resizeMasonryGrid($('.grid-sizer').width()); 1085 1086 $('.minti_masonrygrid_item').hover(function(){ 1087 $(this).find('.minti_masonrygrid_item_overlay').stop().animate({'opacity' : 1}, 140); 1088 }, function(){ 1089 $(this).find('.minti_masonrygrid_item_overlay').stop().animate({'opacity' : 0}, 140); 1090 }); 1091 1092 $('.minti_masonrygrid_item').css({visibility: "visible", opacity: "0"}); 1093 1094 if($('.minti_masonrygrid').length){ 1095 1096 $('.minti_masonrygrid').each(function(){ 1097 var $this = $(this); 1098 $this.imagesLoaded(function(){ 1099 $this.animate({opacity:1}); 1100 $this.isotope({ 1101 itemSelector: '.minti_masonrygrid_item', 1102 masonry: { 1103 columnWidth: '.grid-sizer' 1104 } 1105 }); 1106 }); 1107 1108 }); 1109 1110 // Fade In 1111 $('.minti_masonrygrid_item').each(function(index){ 1112 $(this).delay(80*index).animate({opacity: 1}, 200); 1113 }); 1114 1115 $(window).resize(function(){ 1116 resizeMasonryGrid($('.grid-sizer').width()); 1117 $('.minti_masonrygrid').isotope('reloadItems'); 1118 }); 1119 1120 } 1121 } 1122 1123 initMasonryGrid(); 1124 1125 function resizeMasonryGrid(size){ 1126 1127 var square_small = $('.masonry_ss .minti_masonrygrid_item_wrap'); 1128 var square_big = $('.masonry_sb .minti_masonrygrid_item_wrap'); 1129 var rectangle_portrait = $('.masonry_rp .minti_masonrygrid_item_wrap'); 1130 var rectangle_landscape = $('.masonry_rl .minti_masonrygrid_item_wrap'); 1131 1132 rectangle_portrait.css({'height': 2*size, 'width': size}); 1133 rectangle_landscape.css({'height': size, 'width': 2*size}); 1134 square_big.css({'height': 2*size, 'width': 2*size}); 1135 square_small.css({'height': size, 'width': size}); 1136 1137 if (window.innerWidth < 768) { 1138 square_big.css({'height': 2*size, 'width': size}); 1139 rectangle_landscape.css({'height': size, 'width': size}); 1140 } 1141 } 1142 1143 /* ------------------------------------------------------------------------ */ 1144 /* Video Section 1145 /* ------------------------------------------------------------------------ */ 1146 var min_w = 1200; // minimum video width allowed 1147 var video_width_original = 1280; // original video dimensions 1148 var video_height_original = 720; 1149 var vid_ratio = 1280/720; 1150 1151 function resizeToCover() { 1152 $('.video-wrap').each(function(i){ 1153 1154 var $sectionHeight = $(this).parents('.wpb_row').outerHeight(); 1155 var $sectionWidth = $(this).parents('.wpb_row').outerWidth(); 1156 1157 $(this).width($sectionWidth); 1158 $(this).height($sectionHeight); 1159 1160 // calculate scale ratio 1161 var scale_h = $sectionWidth / video_width_original; 1162 var scale_v = ($sectionHeight - $sectionHeight) / video_height_original; 1163 var scale = scale_h > scale_v ? scale_h : scale_v; 1164 1165 // limit minimum width 1166 min_w = vid_ratio * ($sectionHeight+20); 1167 1168 if (scale * video_width_original < min_w) {scale = min_
1168w / video_width_original;} 1169 1170 $(this).find('video, .mejs-overlay, .mejs-poster').width(Math.ceil(scale * video_width_original + 20)); 1171 $(this).find('video, .mejs-overlay, .mejs-poster').height(Math.ceil(scale * video_height_original + 20)); 1172 1173 $(this).scrollLeft(($(this).find('video').width() - $sectionWidth) / 2); 1174 $(this).scrollTop(($(this).find('video').height() - ($sectionHeight)) / 2); 1175 1176 $(this).find('.mejs-overlay, .mejs-poster').scrollTop(($(this).find('video').height() - ($sectionHeight)) / 2); 1177 1178 }); 1179 } 1180 1181 setTimeout(function(){ 1182 resizeToCover(); 1183 $('.video-wrap').animate({'opacity' : '1'}, 600); 1184 }, 600); 1185 1186 // Remove Video on mobile Devices 1187 if (/Android|BlackBerry|iPhone|iPad|iPod|webOS/i.test(navigator.userAgent) === true) { 1188 $('.video-wrap').remove(); 1189 } 1190 1191 /* ------------------------------------------------------------------------ */ 1192 /* Skillbar 1193 /* ------------------------------------------------------------------------ */ 1194 function progressbarLoad(){ 1195 1196 $('.progressbar').each(function() { 1197 $(this).waypoint(function(){ 1198 var dataperc = $(this).attr('data-perc'); 1199 $(this).find('.progress-percentage').animate({ "width" : dataperc + "%"}, dataperc*14); 1200 },{ offset: '96%' }); 1201 }); 1202 1203 } 1204 1205 progressbarLoad(); 1206 1207 /* ------------------------------------------------------------------------ */ 1208 /* Toggle 1209 /* ------------------------------------------------------------------------ */ 1210 if( $(".toggle .toggle-title").hasClass('active') ){ 1211 $(".toggle .toggle-title.active").closest('.toggle').find('.toggle-inner').show(); 1212 } 1213 1214 $(".toggle .toggle-title").click(function(){ 1215 if( $(this).hasClass('active') ){ 1216 $(this).removeClass("active").closest('.toggle').find('.toggle-inner').slideUp(200,'easeOutQuad'); 1217 } 1218 else{ 1219 $(this).addClass("active").closest('.toggle').find('.toggle-inner').slideDown(200,'easeOutQuad'); 1220 } 1221 }); 1222 1223 /* ------------------------------------------------------------------------ */ 1224 /* Misc 1225 /* ------------------------------------------------------------------------ */ 1226 // Quantity Stepper 1227 $('.qty').bootstrapNumber({ 1228 upClass: 'plus', 1229 downClass: 'minus' 1230 }); 1231 1232 // Bring back quantity stepper after updating cart 1233 /* $(document).ajaxStop(function(){ 1234 $('.woocommerce-cart-form .qty').bootstrapNumber({ 1235 upClass: 'plus', 1236 downClass: 'minus' 1237 }); 1238 }); */ 1239 1240 // Open Sharebox links in Popup 1241 $('.sharebox a[target=_blank]').on('click', function(){ 1242 var newwindow; 1243 newwindow=window.open($(this).attr('href'),'','height=450,width=700'); 1244 if (window.focus) {newwindow.focus()} 1245 return false; 1246 }); 1247 1248 // Prevent iPad from Double Clicking in Dropdowns 1249 function ipadClick() { 1250 1251 if (/Android|BlackBerry|iPhone|iPad|iPod|webOS/i.test(navigator.userAgent) === true) { 1252 $('#navigation li ul li a').on('click touchend', function(e) { 1253 var el = $(this); 1254 var link = el.attr('href'); 1255 window.location = link; 1256 }); 1257 } 1258 1259 } 1260 1261 ipadClick(); 1262 1263 // Tipsy Tooltips 1264 function tipsyLoad() { 1265 1266 $('.meta-author a, .meta-comment a, .meta-category a, .portfolio-widget-item a, .sharebox li a').tipsy({ 1267 fade: true, 1268 gravity: 's', 1269 offset: 2 1270 }); 1271 1272 $('.tooltips a').tipsy({ 1273 fade: true, 1274 gravity: 's', 1275 offset: 0, 1276 }); 1277 1278 } 1279 1280 tipsyLoad(); 1281 1282 // FitVids 1283 function fitvidsLoad(){ 1284 $("#portfolio-embed, .format-video, .format-audio, .video-embed").fitVids(); 1285 } 1286 1287 fitvidsLoad(); 1288 1289 // Animate Class 1290 function animateClass() { 1291 1292 if (/Android|BlackBerry|iPhone|iPad|iPod|webOS/i.test(navigator.userAgent) === false) { 1293 setTimeout(function(){ 1294 $('.animate').each(function() { 1295 1296 $(this).waypoint(function(){ 1297 1298 if($(this).attr('data-animation') == 'fade-in-from-left'){ 1299 $(this).delay($(this).attr('data-delay')).animate({'opacity' : 1, 'left' : '0px'},400,'easeOutSine'); 1300 } else if($(this).attr('data-animation') == 'fade-in-from-right'){ 1301 $(this).delay($(this).attr('data-delay')).animate({'opacity' : 1, 'right' : '0px'},400,'easeOutSine'); 1302 } else if($(this).attr('data-animation') == 'fade-in-from-bottom'){ 1303 $(this).delay($(this).attr('data-delay')).animate({'opacity' : 1, 'bottom' : '0px'},400,'easeOutSine'); 1304 } else if($(this).attr('data-animation') == 'fade-in-from-top'){ 1305 $(this).delay($(this).attr('data-delay')).animate({'opacity' : 1, 'top' : '0px'},400,'easeOutSine'); 1306 } else if($(this).attr('data-animation') == 'fade-in') { 1307 $(this).delay($(this).attr('data-delay')).animate({'opacity' : 1},400,'easeOutSine'); 1308 } 1309 1310 },{ offset: '90%' }); 1311 1312 }); 1313 }, 100); 1314 } else { 1315 $('.animate').each(function() { 1316 if($(this).attr('data-animation') == 'fade-in-from-left'){ 1317 $(this).delay($(this).attr('data-delay')).css({'opacity' : 1, 'left' : '0px'}); 1318 } else if($(this).attr('data-animation') == 'fade-in-from-right'){ 1319 $(this).delay($(this).attr('data-delay')).css({'opacity' : 1, 'right' : '0px'}); 1320 } else if($(this).attr('data-animation') == 'fade-in-from-bottom'){ 1321 $(this).delay($(this).attr('data-delay')).css({'opacity' : 1, 'bottom' : '0px'}); 1322 } else if($(this).attr('data-animation') == 'fade-in-from-top'){ 1323 $(this).delay($(this).attr('data-delay')).css({'opacity' : 1, 'top' : '0px'}); 1324 } else if($(this).attr('data-animation') == 'fade-in') { 1325 $(this).delay($(this).attr('data-delay')).css({'opacity' : 1}); 1326 } 1327 }); 1328 } 1329 1330 } 1331 1332 animateClass(); 1333 1334 // Add Parameters to YouTube Videos oEmbed 1335 $('.video-embed iframe[src^="http://www.youtube.com"], .video-embed iframe[src^="https://www.youtube.com"], .entry-video iframe[src^="http://www.youtube.com"], .entry-video iframe[src^="https://www.youtube.com"]').each(function() { 1336 var url = $(this).attr("src") 1337 $(this).attr("src",url.substring(0,url.indexOf('?')) + '?auto
1337hide=1&modestbranding=1&rel=0&showinfo=0') 1338 }); 1339 1340 // Window Resize Functions 1341 $(window).resize(function () { 1342 resizeToCover(); 1343 columnAlign(); 1344 sfSubmenuPosition(); 1345 }); 1346 1347 /* ---------------------------- */ 1348 1349}); // end document.ready() 1350/* ------------------------------------------------------------------------ */ 1351/* EOF 1352/* ------------------------------------------------------------------------ */
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.