1(()=>{const e=document.querySelectorAll(".coblocks-animate");if("IntersectionObserver"in window){const t=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&(e.target.classList.add(e.target.dataset.coblocksAnimation),t.unobserve(e.target))}))}),{threshold:[.15]});e.forEach((e=>{t.observe(e)}))}else e.forEach((e=>{e.classList.remove("coblocks-animate"),delete e.dataset.coblocksAnimation}))})();; 2/*! 3 * swiped-events.js - v1.1.4 4 * Pure JavaScript swipe events 5 * https://github.com/john-doherty/swiped-events 6 * @inspiration https://stackoverflow.com/questions/16348031/disable-scrolling-when-touch-moving-certain-element 7 * @author John Doherty <www.johndoherty.info> 8 * @license MIT 9 */ 10!function(t,e){"use strict";"function"!=typeof t.CustomEvent&&(t.CustomEvent=function(t,n){n=n||{bubbles:!1,cancelable:!1,detail:void 0};var a=e.createEvent("CustomEvent");return a.initCustomEvent(t,n.bubbles,n.cancelable,n.detail),a},t.CustomEvent.prototype=t.Event.prototype),e.addEventListener("touchstart",function(t){if("true"===t.target.getAttribute("data-swipe-ignore"))return;s=t.target,r=Date.now(),n=t.touches[0].clientX,a=t.touches[0].clientY,u=0,i=0},!1),e.addEventListener("touchmove",function(t){if(!n||!a)return;var e=t.touches[0].clientX,r=t.touches[0].clientY;u=n-e,i=a-r},!1),e.addEventListener("touchend",function(t){if(s!==t.target)return;var e=parseInt(l(s,"data-swipe-threshold","20"),10),o=parseInt(l(s,"data-swipe-timeout","500"),10),c=Date.now()-r,d="",p=t.changedTouches||t.touches||[];Math.abs(u)>Math.abs(i)?Math.abs(u)>e&&c<o&&(d=u>0?"swiped-left":"swiped-right"):Math.abs(i)>e&&c<o&&(d=i>0?"swiped-up":"swiped-down");if(""!==d){var b={dir:d.replace(/swiped-/,""),xStart:parseInt(n,10),xEnd:parseInt((p[0]||{}).clientX||-1,10),yStart:parseInt(a,10),yEnd:parseInt((p[0]||{}).clientY||-1,10)};s.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:b})),s.dispatchEvent(new CustomEvent(d,{bubbles:!0,cancelable:!0,detail:b}))}n=null,a=null,r=null},!1);var n=null,a=null,u=null,i=null,r=null,s=null;function l(t,n,a){for(;t&&t!==e.documentElement;){var u=t.getAttribute(n);if(u)return u;t=t.parentNode}return a}}(window,document);; 11/*! This file is auto-generated */ 12/*! 13 * imagesLoaded PACKAGED v5.0.0 14 * JavaScript is all like "You images are done yet or what?" 15 * MIT License 16 */ 17!function(t,e){"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,(function(){function t(){}let e=t.prototype;return e.on=function(t,e){if(!t||!e)return this;let i=this._events=this._events||{},s=i[t]=i[t]||[];return s.includes(e)||s.push(e),this},e.once=function(t,e){if(!t||!e)return this;this.on(t,e);let i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this},e.off=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;let s=i.indexOf(e);return-1!=s&&i.splice(s,1),this},e.emitEvent=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;i=i.slice(0),e=e||[];let s=this._onceEvents&&this._onceEvents[t];for(let n of i){s&&s[n]&&(this.off(t,n),delete s[n]),n.apply(this,e)}return this},e.allOff=function(){return delete this._events,delete this._onceEvents,this},t})), 18/*! 19 * imagesLoaded v5.0.0 20 * JavaScript is all like "You images are done yet or what?" 21 * MIT License 22 */ 23function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,(function(t,e){let i=t.jQuery,s=t.console;
vendor: 4,706 bytes, lines 23-32
23function n(t,e,o){if(!(this instanceof n))return new n(t,e,o);let r=t;var h;("string"==typeof t&&(r=document.querySelectorAll(t)),r)?(this.elements=(h=r,Array.isArray(h)?h:"object"==typeof h&&"number"==typeof h.length?[...h]:[h]),this.options={},"function"==typeof e?o=e:Object.assign(this.options,e),o&&this.on("always",o),this.getImages(),i&&(this.jqDeferred=new i.Deferred),setTimeout(this.check.bind(this))):s.error(`Bad element for imagesLoaded ${r||t}`)}n.prototype=Object.create(e.prototype),n.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)};const o=[1,9,11];n.prototype.addElementImages=function(t){"IMG"===t.nodeName&&this.addImage(t),!0===this.options.background&&this.addElementBackgroundImages(t);let{nodeType:e}=t;if(!e||!o.includes(e))return;let i=t.querySelectorAll("img");for(let t of i)this.addImage(t);if("string"==typeof this.options.background){let e=t.querySelectorAll(this.options.background);for(let t of e)this.addElementBackgroundImages(t)}};const r=/url\((['"])?(.*?)\1\)/gi;function h(t){this.img=t}function d(t,e){this.url=t,this.element=e,this.img=new Image}return n.prototype.addElementBackgroundImages=function(t){let e=getComputedStyle(t);if(!e)return;let i=r.exec(e.backgroundImage);for(;null!==i;){let s=i&&i[2];s&&this.addBackground(s,t),i=r.exec(e.backgroundImage)}},n.prototype.addImage=function(t){let e=new h(t);this.images.push(e)},n.prototype.addBackground=function(t,e){let i=new d(t,e);this.images.push(i)},n.prototype.check=function(){if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();let t=(t,e,i)=>{setTimeout((()=>{this.progress(t,e,i)}))};this.images.forEach((function(e){e.once("progress",t),e.check()}))},n.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&s&&s.log(`progress: ${i}`,t,e)},n.prototype.complete=function(){let t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){let t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},h.prototype=Object.create(e.prototype),h.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},h.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},h.prototype.confirm=function(t,e){this.isLoaded=t;let{parentNode:i}=this.img,s="PICTURE"===i.nodeName?i:this.img;this.emitEvent("progress",[this,s,e])},h.prototype.handleEvent=function(t){let e="on"+t.type;this[e]&&this[e](t)},h.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},h.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},h.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype=Object.create(h.prototype),d.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},d.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},n.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&(i=e,i.fn.imagesLoaded=function(t,e){return new n(this,t,e).jqDeferred.promise(i(this))})},n.makeJQueryPlugin(),n}));; 24/*! 25 * jQuery UI Effects 1.14.2 26 * https://jqueryui.com 27 * 28 * Copyright OpenJS Foundation and other contributors 29 * Released under the MIT license. 30 * https://jquery.org/license 31 */ 32!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","./jquery-var-for-color","./vendor/jquery-color/jquery.color","./version"],t):t(jQuery)}(function(u){"use strict";var s,o,r,a,c,e,n,i,f,l,d="ui-effects-",p="ui-effects-style",h="ui-effects-animated";function m(t){for(var e,n=t.ownerDocument.defaultView.getComputedStyle(t),i={},o=n.length;o--;
vendor: 4,803 bytes, line 32
32)"string"==typeof n[e=n[o]]&&(i[e.replace(/-([\da-z])/gi,function(t,e){return e.toUpperCase()})]=n[e]);return i}function g(t,e,n,i){return t={effect:t=u.isPlainObject(t)?(e=t).effect:t},"function"==typeof(e=null==e?{}:e)&&(i=e,n=null,e={}),"number"!=typeof e&&!u.fx.speeds[e]||(i=n,n=e,e={}),"function"==typeof n&&(i=n,n=null),e&&u.extend(t,e),n=n||e.duration,t.duration=u.fx.off?0:"number"==typeof n?n:n in u.fx.speeds?u.fx.speeds[n]:u.fx.speeds._default,t.complete=i||e.complete,t}function v(t){return!t||"number"==typeof t||u.fx.speeds[t]||"string"==typeof t&&!u.effects.effect[t]||"function"==typeof t||"object"==typeof t&&!t.effect}function y(t,e){var n=e.outerWidth(),e=e.outerHeight(),t=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(t)||["",0,n,e,0];return{top:parseFloat(t[1])||0,right:"auto"===t[2]?n:parseFloat(t[2]),bottom:"auto"===t[3]?e:parseFloat(t[3]),left:parseFloat(t[4])||0}}return u.effects={effect:{}},a=["add","remove","toggle"],c={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1},u.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,e){u.fx.step[e]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,e,t.end),t.setAttr=!0)}}),u.effects.animateClass=function(o,t,e,n){var s=u.speed(t,e,n);return this.queue(function(){var n=u(this),t=n.attr("class")||"",e=(e=s.children?n.find("*").addBack():n).map(function(){return{el:u(this),start:m(this)}}),i=function(){u.each(a,function(t,e){o[e]&&n[e+"Class"](o[e])})};i(),e=e.map(function(){return this.end=m(this.el[0]),this.diff=function(t,e){var n,i,o={};for(n in e)i=e[n],t[n]===i||c[n]||!u.fx.step[n]&&isNaN(parseFloat(i))||(o[n]=i);return o}(this.start,this.end),this}),n.attr("class",t),e=e.map(function(){var t=this,e=u.Deferred(),n=u.extend({},s,{queue:!1,complete:function(){e.resolve(t)}});return this.el.animate(this.diff,n),e.promise()}),u.when.apply(u,e.get()).done(function(){i(),u.each(arguments,function(){var e=this.el;u.each(this.diff,function(t){e.css(t,"")})}),s.complete.call(n[0])})})},u.fn.extend({addClass:(r=u.fn.addClass,function(t,e,n,i){return e?u.effects.animateClass.call(this,{add:t},e,n,i):r.apply(this,arguments)}),removeClass:(o=u.fn.removeClass,function(t,e,n,i){return 1<arguments.length?u.effects.animateClass.call(this,{remove:t},e,n,i):o.apply(this,arguments)}),toggleClass:(s=u.fn.toggleClass,function(t,e,n,i,o){return"boolean"==typeof e||void 0===e?n?u.effects.animateClass.call(this,e?{add:t}:{remove:t},n,i,o):s.apply(this,arguments):u.effects.animateClass.call(this,{toggle:t},e,n,i)}),switchClass:function(t,e,n,i,o){return u.effects.animateClass.call(this,{add:e,remove:t},n,i,o)}}),u.expr&&u.expr.pseudos&&u.expr.pseudos.animated&&(u.expr.pseudos.animated=(e=u.expr.pseudos.animated,function(t){return!!u(t).data(h)||e(t)})),!0===u.uiBackCompat&&u.extend(u.effects,{save:function(t,e){for(var n=0,i=e.length;n<i;n++)null!==e[n]&&t.data(d+e[n],t[0].style[e[n]])},restore:function(t,e){for(var n,i=0,o=e.length;i<o;i++)null!==e[i]&&(n=t.data(d+e[i]),t.css(e[i],n))},setMode:function(t,e){return e="toggle"===e?t.is(":hidden")?"show":"hide":e},createWrapper:function(n){if(n.parent().is(".ui-effects-wrapper"))return n.parent();var i={width:n.outerWidth(!0),height:n.outerHeight(!0),float:n.css("float")},t=u("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:n.width(),height:n.height()},o=document.activeElement;try{o.id}catch(t){o=document.body}return n.wrap(t),n[0]!==o&&!u.contains(n[0],o)||u(o).trigger("focus"),t=n.parent(),"static"===n.css("position")?(t.css({position:"relative"}),n.css({position:"relative"})):(u.extend(i,{position:n.css("position"),zIndex:n.css("z-index")}),u.each(["top","left","bottom","right"],function(t,e){i[e]=n.css(e),isNaN(parseInt(i[e],10))&&(i[e]="auto")}),n.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),n.css(e),t.css(i).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!u.contains(t[0],e)||u(e).trigger("focus")),t}}),u.extend(u.effects,{version:"1.14.2",define:function(t,e,n){return n||(n=e,e="effect"),u.effects.effect[t]=n,u.effects.effect[t].mode=e,n},scaledDimensions:function(t,e,n){var i;return 0===e?{height:0,width:0,outerHeight:0,outerWidth:0}:(i="horizontal"!==n?(e||100)/100:1,n="vertical"!==n?(e||100)/100:1,{height:t.height()*n,width:t.width()*i,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*i})},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left
32:t.clip.left,top:t.clip.top}},unshift:function(t,e,n){var i=t.queue();1<e&&i.splice.apply(i,[1,0].concat(i.splice(e,n))),t.dequeue()},saveStyle:function(t){t.data(p,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(p)||"",t.removeData(p)},mode:function(t,e){t=t.is(":hidden");return"toggle"===e&&(e=t?"show":"hide"),e=(t?"hide"===e:"show"===e)?"none":e},getBaseline:function(t,e){var n,i;switch(t[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=t[0]/e.height}switch(t[1]){case"left":i=0;break;case"center":i=.5;break;case"right":i=1;break;default:i=t[1]/e.width}return{x:i,y:n}},createPlaceholder:function(t){var e,n=t.css("position"),i=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(n)&&(n="absolute",e=u("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(d+"placeholder",e)),t.css({position:n,left:i.left,top:i.top}),e},removePlaceholder:function(t){var e=d+"placeholder",n=t.data(e);n&&(n.remove(),t.removeData(e))},cleanUp:function(t){u.effects.restoreStyle(t),u.effects.removePlaceholder(t)},setTransition:function(i,t,o,s){return s=s||{},u.each(t,function(t,e){var n=i.cssUnit(e);0<n[0]&&(s[e]=n[0]*o+n[1])}),s}}),u.fn.extend({effect:function(){function t(t){var e=u(this),n=u.effects.mode(e,a)||s;e.data(h,!0),c.push(n),s&&("show"===n||n===s&&"hide"===n)&&e.show(),s&&"none"===n||u.effects.saveStyle(e),"function"==typeof t&&t()}var i=g.apply(this,arguments),o=u.effects.effect[i.effect],s=o.mode,e=i.queue,n=e||"fx",r=i.complete,a=i.mode,c=[];return u.fx.off||!o?a?this[a](i.duration,r):this.each(function(){r&&r.call(this)}):!1===e?this.each(t).each(f):this.queue(n,t).queue(n,f);function f(t){var e=u(this);function n(){"function"==typeof r&&r.call(e[0]),"function"==typeof t&&t()}i.mode=c.shift(),!0!==u.uiBackCompat||s?"none"===i.mode?(e[a](),n()):o.call(e[0],i,function(){e.removeData(h),u.effects.cleanUp(e),"hide"===i.mode&&e.hide(),n()}):(e.is(":hidden")?"hide"===a:"show"===a)?(e[a](),n()):o.call(e[0],i,n)}},show:(f=u.fn.show,function(t){return v(t)?f.apply(this,arguments):((t=g.apply(this,arguments)).mode="show",this.effect.call(this,t))}),hide:(i=u.fn.hide,function(t){return v(t)?i.apply(this,arguments):((t=g.apply(this,arguments)).mode="hide",this.effect.call(this,t))}),toggle:(n=u.fn.toggle,function(t){return v(t)||"boolean"==typeof t?n.apply(this,arguments):((t=g.apply(this,arguments)).mode="toggle",this.effect.call(this,t))}),cssUnit:function(t){var n=this.css(t),i=[];return u.each(["em","px","%","pt"],function(t,e){0<n.indexOf(e)&&(i=[parseFloat(n),e])}),i},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):y(this.css("clip"),this)},transfer:function(t,e){var n=u(this),i=u(t.to),o="fixed"===i.css("position"),s=u("body"),r=o?s.scrollTop():0,s=o?s.scrollLeft():0,a=i.offset(),a={top:a.top-r,left:a.left-s,height:i.innerHeight(),width:i.innerWidth()},i=n.offset(),c=u("<div class='ui-effects-transfer'></div>");c.appendTo("body").addClass(t.className).css({top:i.top-r,left:i.left-s,height:n.innerHeight(),width:n.innerWidth(),position:o?"fixed":"absolute"}).animate(a,t.duration,t.easing,function(){c.remove(),"function"==typeof e&&e()})}}),u.fx.step.clip=function(t){t.clipInit||(t.start=u(t.elem).cssClip(),"string"==typeof t.end&&(t.end=y(t.end,t.elem)),t.clipInit=!0),u(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},l={},u.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){l[t]=function(t){return Math.pow(t,e+2)}}),u.extend(l,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}}),u.each(l,function(t,e){u.easing["easeIn"+t]=e,u.easing["easeOut"+t]=function(t){return 1-e(1-t)},u.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}}),u.effects});; 33/** 34 * Ditty News Ticker 35 * Date: 12/20/2020 36 * 37 * @author Metaphor Creations 38 * @version 2.3 39 * 40 **/ 41 42(function ($) { 43 var methods = { 44 init: function (options) { 45 return this.each(function () { 46 // Create default options 47 var settings = { 48 id: "", 49 type: "scroll", 50 scroll_direction: "left", 51 scroll_speed: 10, 52 scroll_pause: 0, 53 scroll_spacing: 40, 54 scroll_units: 10, 55 scroll_init: 0, 56 scroll_init_delay: 2, 57 scroll_loop: 1, 58 rotate_type: "fade", 59 auto_rotate: 0, 60 rotate_delay: 10, 61 rotate_pause: 0, 62 rotate_speed: 10, 63 rotate_ease: "easeOutExpo", 64 nav_reverse: 0, 65 disable_touchswipe: 0, 66 offset: 20, 67 before_change: function () {}, 68 after_change: function () {}, 69 after_load: function () {}, 70 }; 71 72 // Useful variables. Play carefully. 73 var vars = { 74 id: settings.id, 75 tick_count: 0, 76 previous_tick: 0, 77 current_tick: 0, 78 next_tick: 0, 79 reverse: 0, 80 running: 0, 81 paused: 0, 82 }; 83 84 // Add any set options 85 if (options) { 86 $.extend(settings, options); 87 } 88 89 // Create variables 90 var $container = $(this), 91 $ticker = $container.find(".mtphr-dnt-tick-contents"), 92 $nav_prev = $container.find(".mtphr-dnt-nav-prev"), 93 $nav_next = $container.find(".mtphr-dnt-nav-next"), 94 $nav_controls = $container.find(".mtphr-dnt-control-links"), 95 $play_pause = $container.find(".mtphr-dnt-play-pause"), 96 ticker_width = $ticker.outerWidth(true), 97 ticker_height = 0, 98 ticks = [], 99 ticker_scroll, 100 ticker_scroll_resize = true, 101 rotator_delay, 102 rotate_adjustment = settings.rotate_type, 103 after_change_timeout, 104 init_timeout, 105 init_loop = true, 106 scroll_percent = 0.13; 107 108 // Add the vars 109 $ticker.data("ditty:vars", vars); 110 111 /** 112 * Initialize the ticker 113 * 114 * @since 1.0.0 115 */ 116 function mtphr_dnt_init() { 117 // Save the tick count & total 118 vars.tick_count = $ticker.find(".mtphr-dnt-tick").length; 119 120 // Start the first tick 121 if (vars.tick_count > 0) { 122 // Setup a ticker scroll 123 if (settings.type === "scroll") { 124 mtphr_dnt_scroll_setup(); 125 126 // Setup a ticker rotator 127 } else if (settings.type === "rotate") { 128 mtphr_dnt_rotator_setup(); 129 } 130 } 131 132 // Trigger the afterLoad callback 133 settings.after_load.call($container, $ticker); 134 $container.trigger("mtphr_dnt_after_load_single", [vars, ticks]); 135 $("body").trigger("mtphr_dnt_after_load", [$container, vars, ticks]); 136 } 137 138 /** 139 * Setup the ticker scroll 140 * 141 * @since 1.1.0 142 */ 143 function mtphr_dnt_scroll_set_height() { 144 // Loop through the tick items 145 $ticker.find(".mtphr-dnt-tick").each(function () { 146 // Find the greatest tick height 147 if ($(this).height() > ticker_height) { 148 ticker_height = $(this).height(); 149 } 150 151 if ( 152 settings.scroll_direction === "up" || 153 settings.scroll_direction === "down" 154 ) { 155 $(this).css("height", "auto"); 156 } 157 }); 158 159 // Set the ticker height 160 $ticker.css("height", ticker_height + "px"); 161 } 162 163 function mtphr_dnt_scroll_setup() { 164 var $first = $ticker.find(".mtphr-dnt-tick:first"); 165 if ($first.attr("style")) { 166 var style = $first.attr("style"); 167 var style_array = style.split("width:"); 168 ticker_scroll_resize = style_array.length > 1 ? false : true; 169 } 170 171 // Reset the ticks 172 ticks = []; 173 174 mtphr_dnt_scroll_set_height(); 175 if ($ticker.find("img").length) { 176 $ticker.imagesLoaded(function () { 177 mtphr_dnt_scroll_set_height(); 178 179 // Loop through the tick items 180 $ticker.find(".mtphr-dnt-tick").each(function () { 181 // Make sure the ticker is visible 182 $(this).show(); 183 184 // Add the tick data 185 var tick = [{ headline: $(this) }]; 186 187 // Add the tick to the array 188 ticks.push(tick); 189 }); 190 191 // Set the initial position of the ticks 192 mtphr_dnt_scroll_reset_ticks(); 193 194 // Start the scroll loop 195 mtphr_dnt_scroll_loop(); 196 }); 197 } else { 198 mtphr_dnt_scroll_set_height(); 199 200 // Loop through the tick items 201 $ticker.find(".mtphr-dnt-tick").each(function () { 202 // Make sure the ticker is visible 203 $(this).show(); 204 205 // Add the tick data 206 var tick = [{ headline: $(this) }]; 207 208 // Add the tick to the array 209 ticks.push(tick); 210 }); 211 212 // Set the initial position of the ticks 213 mtphr_dnt_scroll_reset_ticks(); 214 215 // Start the scroll loop 216 mtphr_dnt_scroll_loop(); 217 } 218 219 // Clear the loop on mouse enter 220 $ticker.on({ 221 mouseenter: function () { 222 if (settings.scroll_pause) { 223 mtphr_dnt_scroll_pause(); 224 } 225 }, 226 mouseleave: function () { 227 if (settings.scroll_pause && !vars.paused) { 228 mtphr_dnt_scroll_play(); 229 } 230 }, 231 }); 232 233 // Clear the loop on mouse enter 234 $ticker.find("a").on("click", function () { 235 if (settings.scroll_pause && !vars.paused) { 236 mtphr_dnt_scroll_play(); 237 } 238 }); 239 } 240 241 function mtphr_dnt_scroll_pause() { 242 clearTimeout(init_timeout); 243 cancelAnimationFrame(ticker_scroll); 244 } 245 246 function mtphr_dnt_scroll_play() { 247 mtphr_dnt_scroll_loop(); 248 } 249 250 /** 251 * Create the ticker scroll loop 252 * 253 * @since 1.0.8 254 */ 255 function mtphr_dnt_scroll_loop() { 256 clearTimeout(init_timeout); 257 cancelAnimationFrame(ticker_scroll); 258 function dnt_scroll_run() { 259 for (var i = 0; i < vars.tick_count; i++) { 260 if (ticks[i][0].visible === true) { 261 var pos = "reset"; 262 263 if ( 264 settings.scroll_direction === "left" || 265 settings.scroll_direction === "right" 266 ) { 267 pos = 268 settings.scroll_direction === "left" 269 ? mtphr_dnt_scroll_left(i) 270 : mtphr_dnt_scroll_right(i); 271 if (pos === "reset") { 272 pos = ticks[i][0].reset; 273 ticks[i][0].headline.css("opacity", 0); 274 } else { 275 ticks[i][0].headline.css("opacity", 1); 276 } 277 ticks[i][0].headline.css({ 278 transform: "translateX( " + pos + "px )", 279 }); 280 } else { 281 pos = 282 settings.scroll_direction === "up" 283 ? mtphr_dnt_scroll_up(i) 284 : mtphr_dnt_scroll_down(i); 285 if (pos === "reset") { 286 pos = ticks[i][0].reset; 287 ticks[i][0].headline.css("opacity", 0); 288 } else { 289 ticks[i][0].headline.css("opacity", 1); 290 } 291 ticks[i][0].headline.css({ 292 transform: "translateY( " + pos + "px )", 293 }); 294 } 295 296 ticks[i][0].position = pos; 297 } 298 } 299 300 if (settings.scroll_init && init_loop) { 301 init_loop = false;
302 init_timeout = setTimeout(function () { 303 ticker_scroll = requestAnimationFrame(dnt_scroll_run); 304 }, settings.scroll_init_delay * 1000); 305 } else { 306 init_loop = false; 307 ticker_scroll = requestAnimationFrame(dnt_scroll_run); 308 } 309 } 310 ticker_scroll = requestAnimationFrame(dnt_scroll_run); 311 } 312 313 /** 314 * Scroll the ticker left 315 * 316 * @since 1.0.0 317 */ 318 function mtphr_dnt_scroll_left(i) { 319 // Find the new position 320 var pos = parseFloat( 321 ticks[i][0].position - settings.scroll_speed * scroll_percent 322 ); 323 324 // Reset the tick if off the screen 325 if (pos < -(ticks[i][0].headline.width() + settings.offset)) { 326 pos = mtphr_dnt_scroll_check_current(i); 327 } else if ( 328 pos < 329 parseFloat( 330 ticker_width - 331 ticks[i][0].headline.width() - 332 settings.scroll_spacing 333 ) 334 ) { 335 mtphr_dnt_scroll_check_next(i); 336 } 337 338 return pos; 339 } 340 341 /** 342 * Scroll the ticker right 343 * 344 * @since 1.0.0 345 */ 346 function mtphr_dnt_scroll_right(i) { 347 // Find the new position 348 var pos = parseFloat( 349 ticks[i][0].position + settings.scroll_speed * scroll_percent 350 ); 351 352 // Reset the tick if off the screen 353 if (pos > ticker_width + settings.offset) { 354 pos = mtphr_dnt_scroll_check_current(i); 355 } else if (pos > settings.scroll_spacing) { 356 mtphr_dnt_scroll_check_next(i); 357 } 358 359 return pos; 360 } 361 362 /** 363 * Scroll the ticker up 364 * 365 * @since 1.0.0 366 */ 367 function mtphr_dnt_scroll_up(i) { 368 // Find the new position 369 var pos = parseFloat( 370 ticks[i][0].position - settings.scroll_speed * scroll_percent 371 ); 372 373 // Reset the tick if off the screen 374 if (pos < -(ticks[i][0].headline.height() + settings.offset)) { 375 pos = mtphr_dnt_scroll_check_current(i); 376 } else if ( 377 pos < 378 ticker_height - 379 ticks[i][0].headline.height() - 380 settings.scroll_spacing 381 ) { 382 mtphr_dnt_scroll_check_next(i); 383 } 384 385 return pos; 386 } 387 388 /** 389 * Scroll the ticker down 390 * 391 * @since 1.0.0 392 */ 393 function mtphr_dnt_scroll_down(i) { 394 // Find the new position 395 var pos = parseFloat( 396 ticks[i][0].position + settings.scroll_speed * scroll_percent 397 ); 398 399 // Reset the tick if off the screen 400 if (pos > ticker_height + settings.offset) { 401 pos = mtphr_dnt_scroll_check_current(i); 402 } else if (pos > settings.scroll_spacing) { 403 mtphr_dnt_scroll_check_next(i); 404 } 405 406 return pos; 407 } 408 409 /** 410 * Check the current tick position 411 * 412 * @since 1.0.0 413 */ 414 function mtphr_dnt_scroll_check_current(i) { 415 if (vars.tick_count > 1) { 416 ticks[i][0].visible = false; 417 } 418 419 // Add a scroll complete trigger 420 if (vars.tick_count === i + 1) { 421 $container.trigger("mtphr_dnt_scroll_complete", [vars, ticks]); 422 $("body").trigger("mtphr_dnt_scroll_complete", [ 423 $container, 424 vars, 425 ticks, 426 ]); 427 } 428 429 return "reset"; 430 } 431 432 function mtphr_dnt_set_scroll_vars(i) { 433 if (ticks[i][0].visible === false) { 434 vars.previous_tick = parseInt(i - 1); 435 if (vars.previous_tick < 0) { 436 vars.previous_tick = parseInt(vars.tick_count - 1); 437 } 438 vars.current_tick = i; 439 vars.next_tick = parseInt(i + 1); 440 if (vars.next_tick >= vars.tick_count) { 441 vars.next_tick = 0; 442 } 443 } 444 } 445 446 /** 447 * Check the next tick visibility 448 * 449 * @since 1.0.0 450 */ 451 function mtphr_dnt_scroll_check_next(i) { 452 if (i === vars.tick_count - 1) { 453 if (settings.scroll_loop) { 454 mtphr_dnt_set_scroll_vars(0); 455 ticks[0][0].visible = true; 456 } 457 } else { 458 mtphr_dnt_set_scroll_vars(parseInt(i + 1)); 459 ticks[i + 1][0].visible = true; 460 } 461 } 462 463 /** 464 * Resize the scroll ticks 465 * 466 * @since 1.1.0 467 */ 468 function mtphr_dnt_scroll_resize_ticks() { 469 for (var i = 0; i < vars.tick_count; i++) { 470 // Set the tick position 471 var position; 472 473 var $tick = ticks[i][0].headline; 474 475 switch (settings.scroll_direction) {
476 case "left": 477 position = ticker_width + settings.offset; 478 if (ticks[i][0].visible === false) { 479 $tick.css("transform", "translateX( " + position + "px )"); 480 } 481 break; 482 483 case "right": 484 position = parseInt("-" + ($tick.width() + settings.offset)); 485 if (ticks[i][0].visible === false) { 486 $tick.css("transform", "translateX( " + position + "px )"); 487 } 488 break; 489 490 case "up": 491 if (ticker_scroll_resize) { 492 $tick.css("width", ticker_width); 493 } 494 position = parseInt(ticker_height + settings.offset); 495 if (ticks[i][0].visible === false) { 496 $tick.css("transform", "translateY( " + position + "px )"); 497 } 498 break; 499 500 case "down": 501 if (ticker_scroll_resize) { 502 $tick.css("width", ticker_width); 503 } 504 position = parseInt("-" + ($tick.height() + settings.offset)); 505 if (ticks[i][0].visible === false) { 506 $tick.css("transform", "translateY( " + position + "px )"); 507 } 508 break; 509 } 510 511 // Adjust the tick data 512 ticks[i][0].width = $tick.width(); 513 ticks[i][0].height = $tick.height(); 514 if (ticks[i][0].visible === false) { 515 ticks[i][0].position = position; 516 } 517 ticks[i][0].reset = position; 518 } 519 } 520 521 /** 522 * Reset the scroller for vertical scrolls 523 * 524 * @since 1.1.0 525 */ 526 function mtphr_dnt_scroll_reset_ticks() { 527 var position, $tick; 528 529 for (var i = 0; i < vars.tick_count; i++) { 530 if (ticks[i]) { 531 $tick = ticks[i][0].headline; 532 /* 533 $tick.css( { 534 transition : 'none', 535 } ); 536*/ 537 538 switch (settings.scroll_direction) { 539 case "left": 540 position = ticker_width + settings.offset; 541 $tick.css("transform", "translateX( " + position + "px )"); 542 break; 543 544 case "right": 545 position = parseInt("-" + ($tick.width() + settings.offset)); 546 $tick.css("transform", "translateX( " + position + "px )"); 547 break; 548 549 case "up": 550 if (ticker_scroll_resize) { 551 $tick.css("width", ticker_width); 552 } 553 position = parseInt(ticker_height + settings.offset); 554 $tick.css("transform", "translateY( " + position + "px )"); 555 break; 556 557 case "down": 558 if (ticker_scroll_resize) { 559 $tick.css("width", ticker_width); 560 } 561 position = parseInt("-" + ($tick.height() + settings.offset)); 562 $tick.css("transform", "translateY( " + position + "px )"); 563 break; 564 } 565 566 ticks[i][0].width = $tick.width(); 567 ticks[i][0].height = $tick.height(); 568 ticks[i][0].position = position; 569 ticks[i][0].reset = position; 570 ticks[i][0].visible = false; 571 572 $tick = ticks[i][0].headline; 573 /* 574 $tick.css( { 575 transition : 'transform ' + scroll_percent + 's linear', 576 } ); 577*/ 578 } 579 } 580 581 // Reset the current tick 582 vars.current_tick = 0; 583 584 // Set the first tick visibility 585 ticks[vars.current_tick][0].visible = true; 586 587 // Set the ticks to display on init 588 if (settings.scroll_init) { 589 if (settings.scroll_direction === "left") { 590 position = 0; 591 } else if (settings.scroll_direction === "right") { 592 position = ticker_width; 593 } else if (settings.scroll_direction === "up") { 594 position = 0; 595 } else if (settings.scroll_direction === "down") { 596 position = ticker_height; 597 } 598 599 for (i = 0; i < vars.tick_count; i++) { 600 $tick = ticks[i][0].headline; 601 602 switch (settings.scroll_direction) {
603 case "left": 604 if (position < ticker_width) { 605 $tick.css("transform", "translateX( " + position + "px )"); 606 ticks[i][0].position = position; 607 ticks[i][0].visible = true; 608 position = 609 position + ticks[i][0].width + settings.scroll_spacing; 610 } 611 break; 612 613 case "right": 614 if (position > 0) { 615 position = position - ticks[i][0].width; 616 $tick.css("transform", "translateX( " + position + "px )"); 617 ticks[i][0].position = position; 618 ticks[i][0].visible = true; 619 position = position - settings.scroll_spacing; 620 } 621 break; 622 623 case "up": 624 if (position < ticker_height) { 625 $tick.css("transform", "translateY( " + position + "px )"); 626 ticks[i][0].position = position; 627 ticks[i][0].visible = true; 628 position = 629 position + ticks[i][0].height + settings.scroll_spacing; 630 } 631 break; 632 633 case "down": 634 if (position > 0) { 635 $tick.css("transform", "translateY( " + position + "px )"); 636 $tick.stop(true, true).css("top", position + "px"); 637 ticks[i][0].position = position; 638 ticks[i][0].visible = true; 639 position = position - settings.scroll_spacing; 640 } 641 break; 642 } 643 } 644 } 645 } 646 647 function mtphr_dnt_rotator_play() { 648 mtphr_dnt_rotator_delay(); 649 } 650 651 function mtphr_dnt_rotator_pause() { 652 clearInterval(rotator_delay); 653 } 654 655 /** 656 * Setup the ticker rotator 657 * 658 * @since 1.0.8 659 */ 660 function mtphr_dnt_rotator_setup() { 661 // Loop through the tick items 662 $ticker.find(".mtphr-dnt-tick").each(function () { 663 // Add the tick to the array 664 ticks.push($(this)); 665 $(this).imagesLoaded(function () { 666 mtphr_dnt_rotator_resize_ticks(); 667 }); 668 }); 669 670 // Resize the ticks 671 mtphr_dnt_rotator_resize_ticks(); 672 673 // Loop through the tick items 674 $ticker.find(".mtphr-dnt-tick").show(); 675 676 switch (settings.rotate_type) { 677 case "fade": 678 mtphr_dnt_rotator_fade_init( 679 $ticker, 680 ticks, 681 parseInt(settings.rotate_speed * 100), 682 settings.rotate_ease 683 ); 684 break; 685 case "slide_left": 686 mtphr_dnt_rotator_slide_left_init( 687 $ticker, 688 ticks, 689 parseInt(settings.rotate_speed * 100), 690 settings.rotate_ease 691 ); 692 break; 693 case "slide_right": 694 mtphr_dnt_rotator_slide_right_init( 695 $ticker, 696 ticks, 697 parseInt(settings.rotate_speed * 100), 698 settings.rotate_ease 699 ); 700 break; 701 case "slide_down": 702 mtphr_dnt_rotator_slide_down_init( 703 $ticker, 704 ticks, 705 parseInt(settings.rotate_speed * 100), 706 settings.rotate_ease 707 ); 708 break; 709 case "slide_up": 710 mtphr_dnt_rotator_slide_up_init( 711 $ticker, 712 ticks, 713 parseInt(settings.rotate_speed * 100), 714 settings.rotate_ease 715 ); 716 break; 717 } 718 719 mtphr_dnt_rotator_update_links(0); 720 721 // Start the rotator rotate 722 if (settings.auto_rotate) { 723 mtphr_dnt_rotator_play(); 724 } 725 726 // Clear the loop on mouse enter 727 $ticker.on({ 728 mouseenter: function () { 729 if ( 730 settings.auto_rotate && 731 settings.rotate_pause && 732 !vars.running 733 ) { 734 mtphr_dnt_rotator_pause(); 735 } 736 }, 737 mouseleave: function () { 738 if ( 739 settings.auto_rotate && 740 settings.rotate_pause && 741 !vars.running && 742 !vars.paused 743 ) { 744 mtphr_dnt_rotator_play(); 745 } 746 }, 747 }); 748 749 $ticker.find("a").on("click", function () { 750 if ( 751 settings.auto_rotate && 752 settings.rotate_pause && 753 !vars.running && 754 !vars.paused 755 ) { 756 mtphr_dnt_rotator_play(); 757 } 758 }); 759 } 760 761 /** 762 * Create the ticker rotator loop 763 * 764 * @since 1.0.0 765 */ 766 function mtphr_dnt_rotator_delay() { 767 // Start the ticker timer 768 mtphr_dnt_rotator_pause();
769 rotator_delay = setInterval(function () { 770 // Find the new tick 771 var new_tick = parseInt(vars.current_tick + 1); 772 if (new_tick === vars.tick_count) { 773 new_tick = 0; 774 } 775 776 mtphr_dnt_rotator_update(new_tick); 777 }, parseInt(settings.rotate_delay * 1000)); 778 } 779 780 /** 781 * Create the rotator update call 782 * 783 * @since 1.1.7 784 */ 785 function mtphr_dnt_rotator_update(new_tick) { 786 if (vars.current_tick !== new_tick) { 787 // Clear the interval 788 if (settings.auto_rotate) { 789 mtphr_dnt_rotator_pause(); 790 } 791 792 // Set the next variable 793 vars.next_tick = new_tick; 794 795 // Trigger the before change callback 796 settings.before_change.call($container, $ticker); 797 $container.trigger("mtphr_dnt_before_change_single", [vars, ticks]); 798 $("body").trigger("mtphr_dnt_before_change", [ 799 $container, 800 vars, 801 ticks, 802 ]); 803 804 // Set the running variable 805 vars.running = 1; 806 807 // Rotate the current tick out 808 mtphr_dnt_rotator_out(new_tick); 809 810 // Rotate the new tick in 811 mtphr_dnt_rotator_in(new_tick); 812 813 // Set the previous & current tick 814 vars.previous_tick = vars.current_tick; 815 vars.current_tick = new_tick; 816 817 // Trigger the after change callback 818 after_change_timeout = setTimeout(function () { 819 settings.after_change.call($container, $ticker); 820 $container.trigger("mtphr_dnt_after_change_single", [ 821 vars, 822 ticks, 823 ]); 824 $("body").trigger("mtphr_dnt_after_change", [ 825 $container, 826 vars, 827 ticks, 828 ]); 829 830 // Reset the rotator type & variables 831 rotate_adjustment = settings.rotate_type; 832 vars.reverse = 0; 833 vars.running = 0; 834 835 // Restart the interval 836 if (settings.auto_rotate && !vars.paused) { 837 mtphr_dnt_rotator_delay(); 838 } 839 }, parseInt(settings.rotate_speed * 100)); 840 } 841 } 842 843 /** 844 * Update the control links 845 * 846 * @since 1.0.0 847 */ 848 function mtphr_dnt_rotator_update_links(new_tick) { 849 if ($nav_controls) { 850 $nav_controls.children("a").removeClass("active"); 851 $nav_controls 852 .children('a[href="' + new_tick + '"]') 853 .addClass("active"); 854 } 855 } 856 857 /** 858 * Create the rotator in function calls 859 * 860 * @since 1.0.0 861 */ 862 function mtphr_dnt_rotator_in(new_tick) { 863 // Update the links 864 mtphr_dnt_rotator_update_links(new_tick); 865 866 switch (rotate_adjustment) { 867 case "fade": 868 mtphr_dnt_rotator_fade_in( 869 $ticker, 870 $(ticks[new_tick]), 871 $(ticks[vars.current_tick]), 872 parseInt(settings.rotate_speed * 100), 873 settings.rotate_ease 874 ); 875 break; 876 case "slide_left": 877 mtphr_dnt_rotator_slide_left_in( 878 $ticker, 879 $(ticks[new_tick]), 880 $(ticks[vars.current_tick]), 881 parseInt(settings.rotate_speed * 100), 882 settings.rotate_ease 883 ); 884 break; 885 case "slide_right": 886 mtphr_dnt_rotator_slide_right_in( 887 $ticker, 888 $(ticks[new_tick]), 889 $(ticks[vars.current_tick]), 890 parseInt(settings.rotate_speed * 100), 891 settings.rotate_ease 892 ); 893 break; 894 case "slide_down": 895 mtphr_dnt_rotator_slide_down_in( 896 $ticker, 897 $(ticks[new_tick]), 898 $(ticks[vars.current_tick]), 899 parseInt(settings.rotate_speed * 100), 900 settings.rotate_ease 901 ); 902 break; 903 case "slide_up": 904 mtphr_dnt_rotator_slide_up_in( 905 $ticker, 906 $(ticks[new_tick]), 907 $(ticks[vars.current_tick]), 908 parseInt(settings.rotate_speed * 100), 909 settings.rotate_ease 910 ); 911 break; 912 } 913 } 914 915 /** 916 * Create the rotator out function calls 917 * 918 * @since 1.0.0 919 */ 920 function mtphr_dnt_rotator_out(new_tick) { 921 switch (rotate_adjustment) { 922 case "fade": 923 mtphr_dnt_rotator_fade_out( 924 $ticker, 925 $(ticks[vars.current_tick]), 926 $(ticks[new_tick]), 927 parseInt(settings.rotate_speed * 100), 928 settings.rotate_ease 929 ); 930 break; 931 case "slide_left": 932 mtphr_dnt_rotator_slide_left_out( 933 $ticker, 934 $(ticks[vars.current_tick]), 935 $(ticks[new_tick]), 936 parseInt(settings.rotate_speed * 100), 937 settings.rotate_ease 938 ); 939 break; 940 case "slide_right": 941 mtphr_dnt_rotator_slide_right_out( 942 $ticker, 943 $(ticks[vars.current_tick]), 944 $(ticks[new_tick]), 945 parseInt(settings.rotate_speed * 100), 946 settings.rotate_ease 947 ); 948 break; 949 case "slide_down": 950 mtphr_dnt_rotator_slide_down_out( 951 $ticker, 952 $(ticks[vars.current_tick]), 953 $(ticks[new_tick]), 954 parseInt(settings.rotate_speed * 100), 955 settings.rotate_ease 956 ); 957 break; 958 case "slide_up": 959 mtphr_dnt_rotator_slide_up_out( 960 $ticker, 961 $(ticks[vars.current_tick]), 962 $(ticks[new_tick]), 963 parseInt(settings.rotate_speed * 100), 964 settings.rotate_ease 965 ); 966 break; 967 } 968 } 969 970 /** 971 * Resize the rotator ticks 972 * 973 * @since 1.0.8 974 */ 975 function mtphr_dnt_rotator_resize_ticks() { 976 for (var i = 0; i < vars.tick_count; i++) { 977 // Set the width of the tick 978 $(ticks[i]).width(ticker_width + "px"); 979 if (vars.current_tick !== i) { 980 $(ticks[i]).css({ 981 left: parseFloat(ticker_width + settings.offset) + "px", 982 }); 983 } 984 } 985 986 // Resize the ticker 987 var h = $(ticks[vars.current_tick]).height(); 988 $ticker.stop().css("height", h + "px"); 989 } 990 991 /** 992 * Rotator fade scripts 993 * 994 * @since 1.0.0 995 */ 996 function mtphr_dnt_rotator_fade_init($ticker, ticks) { 997 // Get the first tick 998 var $tick = ticks[0]; 999 1000 // Find the width of the tick 1001 var h = $tick.height(); 1002 1003 // Set the height of the ticker 1004 $ticker.css("height", h + "px"); 1005 $tick.css({ 1006 opacity: 1, 1007 left: "auto", 1008 }); 1009 } 1010 1011 // Show the new tick 1012 function mtphr_dnt_rotator_fade_in( 1013 $ticker, 1014 $tick, 1015 $prev, 1016 rotate_speed, 1017 ease 1018 ) { 1019 $tick.css({ 1020 opacity: 0, 1021 left: "auto", 1022 }); 1023 $tick.stop().animate( 1024 { 1025 opacity: 1, 1026 }, 1027 rotate_speed, 1028 ease 1029 ); 1030 1031 var h = $tick.height(); 1032 1033 // Resize the ticker 1034 $ticker.stop().animate( 1035 { 1036 height: h + "px", 1037 }, 1038 rotate_speed, 1039 ease 1040 ); 1041 } 1042 1043 // Hide the old tick 1044 function mtphr_dnt_rotator_fade_out( 1045 $ticker, 1046 $tick, 1047 $next, 1048 rotate_speed, 1049 ease 1050 ) { 1051 $tick.stop().animate( 1052 { 1053 opacity: 0, 1054 }, 1055 rotate_speed, 1056 ease, 1057 function () { 1058 $(this).css({ 1059 left: parseFloat(ticker_width + settings.offset) + "px", 1060 }); 1061 $tick.remove(); 1062 $ticker.append($tick); 1063 } 1064 ); 1065 } 1066 1067 /** 1068 * Rotator slide left scripts 1069 * 1070 * @since 1.0.0 1071 */ 1072 function mtphr_dnt_rotator_slide_left_init($ticker, ticks) { 1073 // Get the first tick 1074 var $tick = ticks[0]; 1075 1076 // Find the dimensions of the tick 1077 var h = $tick.height(); 1078 1079 // Set the height of the ticker 1080 $ticker.css("height", h + "px"); 1081 1082 // Set the initial position of the width & make sure it's visible 1083 $tick.css({ 1084 opacity: 1, 1085 left: 0, 1086 }); 1087 } 1088 1089 // Show the new tick 1090 function mtphr_dnt_rotator_slide_left_in( 1091 $ticker, 1092 $tick, 1093 $prev, 1094 rotate_speed, 1095 ease 1096 ) { 1097 // Find the dimensions of the tick 1098 var h = $tick.height(); 1099 1100 // Set the initial position of the width & make sure it's visible 1101 $tick.css({ 1102 opacity: 1, 1103 left: parseFloat(ticker_width + settings.offset) + "px", 1104 }); 1105 1106 // Resize the ticker 1107 $ticker.stop().animate( 1108 { 1109 height: h + "px", 1110 }, 1111 rotate_speed, 1112 ease, 1113 function () {} 1114 ); 1115 1116 // Slide the tick in 1117 $tick.stop().animate( 1118 { 1119 left: "0", 1120 }, 1121 rotate_speed, 1122 ease, 1123 function () {} 1124 ); 1125 } 1126 1127 // Hide the old tick 1128 function mtphr_dnt_rotator_slide_left_out( 1129 $ticker, 1130 $tick, 1131 $next, 1132 rotate_speed, 1133 ease 1134 ) { 1135 // Slide the tick in 1136 $tick.stop().animate( 1137 { 1138 left: "-" + parseFloat(ticker_width + settings.offset) + "px", 1139 }, 1140 rotate_speed, 1141 ease, 1142 function () { 1143 $tick.css({ 1144 opacity: 0, 1145 }); 1146 $tick.remove(); 1147 $ticker.append($tick); 1148 } 1149 ); 1150 } 1151 1152 /** 1153 * Rotator slide right scripts 1154 * 1155 * @since 1.0.0 1156 */ 1157 function mtphr_dnt_rotator_slide_right_init($ticker, ticks) { 1158 // Get the first tick 1159 var $tick = ticks[0]; 1160 1161 // Find the dimensions of the tick 1162 var h = $tick.height(); 1163 1164 // Set the height of the ticker 1165 $ticker.css("height", h + "px"); 1166 1167 // Set the initial position of the width & make sure it's visible 1168 $tick.css({ 1169 opacity: 1, 1170 left: 0, 1171 }); 1172 } 1173 1174 // Show the new tick 1175 function mtphr_dnt_rotator_slide_right_in( 1176 $ticker, 1177 $tick, 1178 $prev, 1179 rotate_speed, 1180 ease 1181 ) { 1182 // Find the dimensions of the tick 1183 var h = $tick.height(); 1184 1185 // Set the initial position of the width & make sure it's visible 1186 $tick.css({ 1187 opacity: 1, 1188 left: "-" + parseFloat(ticker_width + settings.offset) + "px", 1189 }); 1190 1191 // Resize the ticker 1192 $ticker.stop().animate( 1193 { 1194 height: h + "px", 1195 }, 1196 rotate_speed, 1197 ease, 1198 function () {} 1199 ); 1200 1201 // Slide the tick in 1202 $tick.stop().animate( 1203 { 1204 left: "0", 1205 }, 1206 rotate_speed, 1207 ease 1208 ); 1209 } 1210 1211 // Hide the old tick 1212 function mtphr_dnt_rotator_slide_right_out( 1213 $ticker, 1214 $tick, 1215 $next, 1216 rotate_speed, 1217 ease 1218 ) { 1219 // Slide the tick in 1220 $tick.stop().animate( 1221 { 1222 left: parseFloat(ticker_width + settings.offset) + "px", 1223 }, 1224 rotate_speed, 1225 ease, 1226 function () { 1227 $tick.css({ 1228 opacity: 0, 1229 }); 1230 $tick.remove(); 1231 $ticker.append($tick); 1232 } 1233 ); 1234 } 1235 1236 /** 1237 * Rotator slide down scripts 1238 * 1239 * @since 1.0.0 1240 */ 1241 function mtphr_dnt_rotator_slide_down_init($ticker, ticks) { 1242 // Get the first tick 1243 var $tick = ticks[0]; 1244 1245 // Find the height of the tick 1246 var h = $tick.height(); 1247 1248 // Set the height of the ticker 1249 $ticker.css("height", h + "px"); 1250 1251 // Set the initial position of the width & make sure it's visible 1252 $tick.css({ 1253 opacity: 1, 1254 top: 0, 1255 left: "auto", 1256 }); 1257 } 1258 1259 // Show the new tick 1260 function mtphr_dnt_rotator_slide_down_in( 1261 $ticker, 1262 $tick, 1263 $prev, 1264 rotate_speed, 1265 ease 1266 ) { 1267 // Find the height of the tick 1268 var h = $tick.height(); 1269 1270 // Set the initial position of the width & make sure it's visible 1271 $tick.css({ 1272 opacity: 1, 1273 top: "-" + parseFloat(h + settings.offset) + "px", 1274 left: "auto", 1275 }); 1276 1277 // Resize the ticker 1278 $ticker.stop().animate( 1279 { 1280 height: h + "px", 1281 }, 1282 rotate_speed, 1283 ease 1284 ); 1285 1286 // Slide the tick in 1287 $tick.stop().animate( 1288 { 1289 top: "0", 1290 }, 1291 rotate_speed, 1292 ease 1293 ); 1294 } 1295 1296 // Hide the old tick 1297 function mtphr_dnt_rotator_slide_down_out( 1298 $ticker, 1299 $tick, 1300 $next, 1301 rotate_speed, 1302 ease 1303 ) { 1304 // Find the height of the next tick 1305 var h = $next.height(); 1306 1307 // Slide the tick in 1308 $tick.stop().animate( 1309 { 1310 top: parseFloat(h + settings.offset) + "px", 1311 }, 1312 rotate_speed, 1313 ease, 1314 function () { 1315 $tick.css({ 1316 opacity: 0, 1317 }); 1318 $tick.remove(); 1319 $ticker.append($tick); 1320 } 1321 ); 1322 } 1323 1324 /** 1325 * Rotator slide up scripts 1326 * 1327 * @since 1.0.0 1328 */ 1329 function mtphr_dnt_rotator_slide_up_init($ticker, ticks) { 1330 // Get the first tick 1331 var $tick = ticks[0]; 1332 1333 // Find the height of the tick 1334 var h = $tick.height(); 1335 1336 // Set the height of the ticker 1337 $ticker.css({ 1338 height: h + "px", 1339 left: "auto", 1340 }); 1341 1342 // Set the initial position of the width & make sure it's visible 1343 $tick.css({ 1344 opacity: 1, 1345 top: 0, 1346 }); 1347 } 1348 1349 // Show the new tick 1350 function mtphr_dnt_rotator_slide_up_in( 1351 $ticker, 1352 $tick, 1353 $prev, 1354 rotate_speed, 1355 ease 1356 ) { 1357 // Find the height of the tick 1358 var h = $tick.height(); 1359 1360 // Set the initial position of the width & make sure it's visible 1361 $tick.css({ 1362 opacity: 1, 1363 top: parseFloat($prev.height() + settings.offset) + "px", 1364 left: "auto", 1365 }); 1366 1367 // Resize the ticker 1368 $ticker.stop().animate( 1369 { 1370 height: h + "px", 1371 }, 1372 rotate_speed, 1373 ease 1374 ); 1375 1376 // Slide the tick in 1377 $tick.stop().animate( 1378 { 1379 top: "0", 1380 }, 1381 rotate_speed, 1382 ease 1383 ); 1384 } 1385 1386 // Hide the old tick 1387 function mtphr_dnt_ro
1387tator_slide_up_out( 1388 $ticker, 1389 $tick, 1390 $next, 1391 rotate_speed, 1392 ease 1393 ) { 1394 // Find the height of the next tick 1395 var h = $tick.height(); 1396 1397 // Slide the tick in 1398 $tick.stop().animate( 1399 { 1400 top: "-" + parseFloat(h + settings.offset) + "px", 1401 }, 1402 rotate_speed, 1403 ease, 1404 function () { 1405 $tick.css({ 1406 opacity: 0, 1407 }); 1408 $tick.remove(); 1409 $ticker.append($tick); 1410 } 1411 ); 1412 } 1413 1414 /* --------------------------------------------------------- */ 1415 /* !Set the next item */ 1416 /* --------------------------------------------------------- */ 1417 1418 function mtphr_dnt_next() { 1419 if (vars.running) { 1420 return false; 1421 } 1422 1423 // Find the new tick 1424 var new_tick = parseInt(vars.current_tick + 1); 1425 if (new_tick === vars.tick_count) { 1426 new_tick = 0; 1427 } 1428 mtphr_dnt_rotator_update(new_tick); 1429 } 1430 1431 /* --------------------------------------------------------- */ 1432 /* !Set the previous item */ 1433 /* --------------------------------------------------------- */ 1434 1435 function mtphr_dnt_prev() { 1436 if (vars.running) { 1437 return false; 1438 } 1439 1440 // Find the new tick 1441 var new_tick = parseInt(vars.current_tick - 1); 1442 if (new_tick < 0) { 1443 new_tick = vars.tick_count - 1; 1444 } 1445 if (settings.nav_reverse) { 1446 if (settings.rotate_type === "slide_left") { 1447 rotate_adjustment = "slide_right"; 1448 } else if (settings.rotate_type === "slide_right") { 1449 rotate_adjustment = "slide_left"; 1450 } else if (settings.rotate_type === "slide_down") { 1451 rotate_adjustment = "slide_up"; 1452 } else if (settings.rotate_type === "slide_up") { 1453 rotate_adjustment = "slide_down"; 1454 } 1455 vars.reverse = 1; 1456 } 1457 mtphr_dnt_rotator_update(new_tick); 1458 } 1459 1460 /** 1461 * Navigation clicks 1462 * 1463 * @since 1.0.0 1464 */ 1465 if ($nav_prev && settings.type === "rotate") { 1466 $nav_prev.on("click", function (e) { 1467 e.preventDefault(); 1468 mtphr_dnt_prev(); 1469 }); 1470 1471 $nav_next.on("click", function (e) { 1472 e.preventDefault(); 1473 mtphr_dnt_next(); 1474 }); 1475 } 1476 1477 /** 1478 * Nav controls 1479 * 1480 * @since 1.0.2 1481 */ 1482 if ($nav_controls && settings.type === "rotate") { 1483 $nav_controls.children("a").on("click", function (e) { 1484 e.preventDefault(); 1485 1486 // Find the new tick 1487 var new_tick = parseInt($(this).attr("href")); 1488 1489 if (vars.running) { 1490 return false; 1491 } 1492 if (new_tick === vars.current_tick) { 1493 return false; 1494 } 1495 1496 var reverse = new_tick < vars.current_tick ? 1 : 0; 1497 1498 if (settings.nav_reverse && reverse) { 1499 if (settings.rotate_type === "slide_left") { 1500 rotate_adjustment = "slide_right"; 1501 } else if (settings.rotate_type === "slide_right") { 1502 rotate_adjustment = "slide_left"; 1503 } else if (settings.rotate_type === "slide_down") { 1504 rotate_adjustment = "slide_up"; 1505 } else if (settings.rotate_type === "slide_up") { 1506 rotate_adjustment = "slide_down"; 1507 } 1508 vars.reverse = 1; 1509 } 1510 mtphr_dnt_rotator_update(new_tick); 1511 }); 1512 } 1513 1514 /* --------------------------------------------------------- */ 1515 /* !Play and pause - 2.0.4 */ 1516 /* --------------------------------------------------------- */ 1517 1518 function mtphr_dnt_play_pause_toggle(play) { 1519 if (play) { 1520 vars.paused = false; 1521 $play_pause.removeClass("paused"); 1522 if (settings.type === "scroll") { 1523 mtphr_dnt_scroll_play(); 1524 } else { 1525 mtphr_dnt_rotator_play(); 1526 } 1527 } else { 1528 vars.paused = true; 1529 $play_pause.addClass("paused"); 1530 if (settings.type === "scroll") { 1531 mtphr_dnt_scroll_pause(); 1532 } else { 1533 mtphr_dnt_rotator_pause(); 1534 } 1535 } 1536 $container.trigger("mtphr_dnt_play_pause", [vars, ticks]); 1537 } 1538 1539 $play_pause.on("click", function (e) { 1540 e.preventDefault(); 1541 mtphr_dnt_play_pause_toggle(vars.paused); 1542 }); 1543 1544 /* --------------------------------------------------------- */ 1545 /* !Mobile swipe - 1.5.0 */ 1546 /* --------------------------------------------------------- */ 1547 1548 function swipe_left() { 1549 if (vars.running) { 1550 return false;
1551 } 1552 1553 // Find the new tick 1554 var new_tick = parseInt(vars.current_tick + 1); 1555 if (new_tick === vars.tick_count) { 1556 new_tick = 0; 1557 } 1558 if ( 1559 settings.rotate_type === "slide_left" || 1560 settings.rotate_type === "slide_right" 1561 ) { 1562 rotate_adjustment = "slide_left"; 1563 } 1564 mtphr_dnt_rotator_update(new_tick); 1565 } 1566 1567 function swipe_right() { 1568 if (vars.running) { 1569 return false; 1570 } 1571 1572 // Find the new tick 1573 var new_tick = parseInt(vars.current_tick - 1); 1574 if (new_tick < 0) { 1575 new_tick = vars.tick_count - 1; 1576 } 1577 if ( 1578 settings.rotate_type === "slide_left" || 1579 settings.rotate_type === "slide_right" 1580 ) { 1581 rotate_adjustment = "slide_right"; 1582 } 1583 if (settings.nav_reverse) { 1584 if (settings.rotate_type === "slide_down") { 1585 rotate_adjustment = "slide_up"; 1586 } else if (settings.rotate_type === "slide_up") { 1587 rotate_adjustment = "slide_down"; 1588 } 1589 vars.reverse = 1; 1590 } 1591 mtphr_dnt_rotator_update(new_tick); 1592 } 1593 1594 if (settings.type === "rotate" && !settings.disable_touchswipe) { 1595 $ticker[0].addEventListener("swiped-left", function () { 1596 swipe_left(); 1597 }); 1598 $ticker[0].addEventListener("swiped-right", function () { 1599 swipe_right(); 1600 }); 1601 } 1602 1603 /* --------------------------------------------------------- */ 1604 /* !Listen for external events - 1.4.1 */ 1605 /* --------------------------------------------------------- */ 1606 1607 $container.on("mtphr_dnt_next", function () { 1608 mtphr_dnt_next(); 1609 }); 1610 1611 $container.on("mtphr_dnt_prev", function () { 1612 mtphr_dnt_prev(); 1613 }); 1614 1615 $container.on("mtphr_dnt_goto", function (e, pos) { 1616 mtphr_dnt_rotator_update(parseInt(pos)); 1617 }); 1618 1619 $container.on("mtphr_dnt_pause", function () { 1620 mtphr_dnt_play_pause_toggle(); 1621 }); 1622 1623 $container.on("mtphr_dnt_play", function () { 1624 mtphr_dnt_play_pause_toggle(true); 1625 }); 1626 1627 /** 1628 * Resize listener 1629 * Reset the ticker width 1630 * 1631 * @since 1.4.1 1632 */ 1633 $(window).on("resize", function () { 1634 // Resize the tickers if the width is different 1635 if ($ticker.outerWidth() !== ticker_width) { 1636 ticker_width = $ticker.outerWidth(true); 1637 1638 if (settings.type === "scroll") { 1639 if ( 1640 settings.scroll_direction === "up" || 1641 settings.scroll_direction === "down" 1642 ) { 1643 if (ticker_scroll_resize) { 1644 mtphr_dnt_scroll_reset_ticks(); 1645 } else { 1646 mtphr_dnt_scroll_resize_ticks(); 1647 } 1648 } else { 1649 mtphr_dnt_scroll_resize_ticks(); 1650 } 1651 } else if (settings.type === "rotate") { 1652 mtphr_dnt_rotator_resize_ticks(); 1653 } 1654 } 1655 }); 1656 1657 /* --------------------------------------------------------- */ 1658 /* !Listen for resize event from other plugins - 1.4.1 */ 1659 /* --------------------------------------------------------- */ 1660 1661 $container.on("mtphr_dnt_resize_single", function (e, reset) { 1662 ticker_width = $ticker.outerWidth(true); 1663 if (settings.type === "scroll") { 1664 if (reset) { 1665 mtphr_dnt_scroll_reset_ticks(); 1666 } 1667 mtphr_dnt_scroll_resize_ticks(); 1668 } else if (settings.type === "rotate") { 1669 mtphr_dnt_rotator_resize_ticks(); 1670 } 1671 }); 1672 $("body").on("mtphr_dnt_resize", function (e, id) { 1673 if (id && id.indexOf(settings.id) >= 0) { 1674 if (settings.type === "scroll") { 1675 mtphr_dnt_scroll_resize_ticks(); 1676 } else if (settings.type === "rotate") { 1677 mtphr_dnt_rotator_resize_ticks(); 1678 } 1679 } 1680 }); 1681 1682 $container.on("mtphr_dnt_replace_ticks", function (e, ticks, delay) { 1683 clearTimeout(init_timeout); 1684 cancelAnimationFrame(ticker_scroll); 1685 $container.find(".mtphr-dnt-tick").remove(); 1686 1687 ticks.each(function () { 1688 $ticker.append($(this)); 1689 }); 1690 1691 setTimeout(function () { 1692 mtphr_dnt_init(); 1693 }, delay); 1694 }); 1695 1696 if ($container.width() === 0) { 1697 var loop_mtphr_dnt_init_timer = true; 1698 setTimeout(function dnt_init_check() { 1699 if ($container.width() > 10) { 1700 loop_mtphr_dnt_init_timer = false;
1701 ticker_width = $ticker.outerWidth(true); 1702 mtphr_dnt_init(); 1703 } 1704 1705 if (loop_mtphr_dnt_init_timer) { 1706 setTimeout(dnt_init_check, 100); 1707 } 1708 }, 100); 1709 } else { 1710 mtphr_dnt_init(); 1711 } 1712 }); 1713 }, 1714 }; 1715 1716 /** 1717 * Setup the class 1718 * 1719 * @since 1.0.0 1720 */ 1721 $.fn.ditty_news_ticker = function (method) { 1722 if (methods[method]) { 1723 return methods[method].apply( 1724 this, 1725 Array.prototype.slice.call(arguments, 1) 1726 ); 1727 } else if (typeof method === "object" || !method) { 1728 return methods.init.apply(this, arguments); 1729 } else { 1730 throw new Error( 1731 "Method " + method + " does not exist in ditty_news_ticker" 1732 ); 1733 } 1734 }; 1735})(jQuery); 1736; 1737jQuery(function($) { 1738 $('[data-opinionstage-embed-url]').each(function( ) { 1739 var $widgetEmbedded = $(this) 1740 var url = $widgetEmbedded.data('opinionstage-embed-url') 1741 1742 $.getJSON( url ). 1743 done( function( data ) { 1744 $widgetEmbedded.after(data.code) 1745 }) 1746 .fail(function(jqxhr, textStatus, error) { 1747 console.error( "[social-polls-by-opinionstage] can't load widget embed code" ) 1748 }) 1749 }) 1750}) 1751; 1752!function(t){var e={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,slideZIndex:50,wrapperClass:"cm-slider",touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,ariaLive:!0,ariaHidden:!0,keyboardEnabled:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",stopAutoOnClick:!1,autoHover:!1,autoDelay:0,autoSlideForOnePage:!1,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,shrinkItems:!1,onSliderLoad:function(){return!0},onSlideBefore:function(){return!0},onSlideAfter:function(){return!0},onSlideNext:function(){return!0},onSlidePrev:function(){return!0},onSliderResize:function(){return!0},onAutoChange:function(){return!0}};t.fn.bxSlider=function(n){if(0===this.length)return this;if(this.length>1)return this.each((function(){t(this).bxSlider(n)})),this;var s={},o=this,r=t(window).width(),a=t(window).height();if(!t(o).data("bxSlider")){var l=function(){t(o).data("bxSlider")||(s.settings=t.extend({},e,n),s.settings.slideWidth=parseInt(s.settings.slideWidth),s.children=o.children(s.settings.slideSelector),s.children.length<s.settings.minSlides&&(s.settings.minSlides=s.children.length),s.children.length<s.settings.maxSlides&&(s.settings.maxSlides=s.children.length),s.settings.randomStart&&(s.settings.startSlide=Math.floor(Math.random()*s.children.length)),s.active={index:s.settings.startSlide},s.carousel=s.settings.minSlides>1||s.settings.maxSlides>1,s.carousel&&(s.settings.preloadImages="all"),s.minThreshold=s.settings.minSlides*s.settings.slideWidth+(s.settings.minSlides-1)*s.settings.slideMargin,s.maxThreshold=s.settings.maxSlides*s.settings.slideWidth+(s.settings.maxSlides-1)*s.settings.slideMargin,s.working=!1,s.controls={},s.interval=null,s.animProp="vertical"===s.settings.mode?"top":"left",s.usingCSS=s.settings.useCSS&&"fade"!==s.settings.mode&&function(){for(var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"],i=0;i<e.length;i++)if(void 0!==t.style[e[i]])return s.cssPrefix=e[i].replace("Perspective","").toLowerCase(),s.animProp="-"+s.cssPrefix+"-transform",!0;return!1}(),"vertical"===s.settings.mode&&(s.settings.maxSlides=s.settings.minSlides),o.data("origStyle",o.attr("style")),o.children(s.settings.slideSelector).each((function(){t(this).data("origStyle",t(this).attr("style"))})),d())},d=function(){var e=s.children.eq(s.settings.startSlide);o.wrap('<div class="'+s.settings.wrapperClass+'"><div class="bx-viewport"></div></div>'),s.viewport=o.parent(),s.settings.ariaLive&&!s.settings.ticker&&s.viewport.attr("aria-live","polite"),s.loader=t('<div class="bx-loading" />'),s.viewport.prepend(s.loader),o.css({width:"horizontal"===s.settings.mode?1e3*s.children.length+215+"%":"auto",position:"relative"}),s.usingCSS&&s.settings.easing?o.css("-"+s.cssPrefix+"-transition-timing-function",s.settings.easing):s.settings.easing||(s.settings.easing="swing"),s.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),s.viewport.parent().css({maxWidth:u()}
vendor: 20,784 bytes, lines 1752-1753
1752),s.children.css({float:"horizontal"===s.settings.mode?"left":"none",listStyle:"none",position:"relative"}),s.children.css("width",h()),"horizontal"===s.settings.mode&&s.settings.slideMargin>0&&s.children.css("marginRight",s.settings.slideMargin),"vertical"===s.settings.mode&&s.settings.slideMargin>0&&s.children.css("marginBottom",s.settings.slideMargin),"fade"===s.settings.mode&&(s.children.css({position:"absolute",zIndex:0,display:"none"}),s.children.eq(s.settings.startSlide).css({zIndex:s.settings.slideZIndex,display:"block"})),s.controls.el=t('<div class="bx-controls" />'),s.settings.captions&&k(),s.active.last=s.settings.startSlide===f()-1,s.settings.video&&o.fitVids(),"none"===s.settings.preloadImages?e=null:("all"===s.settings.preloadImages||s.settings.ticker)&&(e=s.children),s.settings.ticker?s.settings.pager=!1:(s.settings.controls&&C(),s.settings.auto&&s.settings.autoControls&&T(),s.settings.pager&&b(),(s.settings.controls||s.settings.autoControls||s.settings.pager)&&s.viewport.after(s.controls.el)),null===e?g():c(e,g)},c=function(e,i){var n=e.find('img:not([src=""]), iframe').length,s=0;0!==n?e.find('img:not([src=""]), iframe').each((function(){t(this).one("load error",(function(){++s===n&&i()})).each((function(){t(this).trigger("load")}))})):i()},g=function(){if(s.settings.infiniteLoop&&"fade"!==s.settings.mode&&!s.settings.ticker){var e="vertical"===s.settings.mode?s.settings.minSlides:s.settings.maxSlides,i=s.children.slice(0,e).clone(!0).addClass("bx-clone"),n=s.children.slice(-e).clone(!0).addClass("bx-clone");s.settings.ariaHidden&&(i.attr("aria-hidden",!0),n.attr("aria-hidden",!0)),o.append(i).prepend(n)}s.loader.remove(),m(),"vertical"===s.settings.mode&&(s.settings.adaptiveHeight=!0),s.viewport.height(p()),o.redrawSlider(),s.settings.onSliderLoad.call(o,s.active.index),s.initialized=!0,s.settings.responsive&&t(window).on("resize",Z),s.settings.auto&&s.settings.autoStart&&(f()>1||s.settings.autoSlideForOnePage)&&L(),s.settings.ticker&&O(),s.settings.pager&&z(s.settings.startSlide),s.settings.controls&&D(),navigator.maxTouchPoints>1&&B(),s.settings.keyboardEnabled&&!s.settings.ticker&&t(document).keydown(N)},p=function(){var e=0,n=t();if("vertical"===s.settings.mode||s.settings.adaptiveHeight)if(s.carousel){var o=1===s.settings.moveSlides?s.active.index:s.active.index*x();for(n=s.children.eq(o),i=1;i<=s.settings.maxSlides-1;i++)n=o+i>=s.children.length?n.add(s.children.eq(i-1)):n.add(s.children.eq(o+i))}else n=s.children.eq(s.active.index);else n=s.children;return"vertical"===s.settings.mode?(n.each((function(i){e+=t(this).outerHeight()})),s.settings.slideMargin>0&&(e+=s.settings.slideMargin*(s.settings.minSlides-1))):e=Math.max.apply(Math,n.map((function(){return t(this).outerHeight(!1)})).get()),"border-box"===s.viewport.css("box-sizing")?e+=parseFloat(s.viewport.css("padding-top"))+parseFloat(s.viewport.css("padding-bottom"))+parseFloat(s.viewport.css("border-top-width"))+parseFloat(s.viewport.css("border-bottom-width")):"padding-box"===s.viewport.css("box-sizing")&&(e+=parseFloat(s.viewport.css("padding-top"))+parseFloat(s.viewport.css("padding-bottom"))),e},u=function(){var t="100%";return s.settings.slideWidth>0&&(t="horizontal"===s.settings.mode?s.settings.maxSlides*s.settings.slideWidth+(s.settings.maxSlides-1)*s.settings.slideMargin:s.settings.slideWidth),t},h=function(){var t=s.settings.slideWidth,e=s.viewport.width();if(0===s.settings.slideWidth||s.settings.slideWidth>e&&!s.carousel||"vertical"===s.settings.mode)t=e;else if(s.settings.maxSlides>1&&"horizontal"===s.settings.mode){if(e>s.maxThreshold)return t;e<s.minThreshold?t=(e-s.settings.slideMargin*(s.settings.minSlides-1))/s.settings.minSlides:s.settings.shrinkItems&&(t=Math.floor((e+s.settings.slideMargin)/Math.ceil((e+s.settings.slideMargin)/(t+s.settings.slideMargin))-s.settings.slideMargin))}return t},v=function(){var t=1,e=null;return"horizontal"===s.settings.mode&&s.settings.slideWidth>0?s.viewport.width()<s.minThreshold?t=s.settings.minSlides:s.viewport.width()>s.maxThreshold?t=s.settings.maxSlides:(e=s.children.first().width()+s.settings.slideMargin,t=Math.floor((s.viewport.width()+s.settings.slideMargin)/e)||1):"vertical"===s.settings.mode&&(t=s.settings.minSlides),t},f=function(){var t=0,e=0,i=0;if(s.settings.moveSlides>0){if(!s.settings.infiniteLoop){for(;e<s.children.length;)++t,e=i+v(),i+=s.settings.moveSlides<=v()?s.settings.moveSlides:v();return i}t=Math.ceil(s.children.length/x())}else t=Math.ceil(s.children.length/v());return t},x=function(){return s.settings.moveSlides>0&&s.settings.moveSlides<=v()?s.settings.moveSlides:v()},m=function(){var t,e,i;s.children.length>s.settings.maxSlides&&s.active.last&&!s.settings.infiniteLoop?"horizontal"===s.settings.mode?(t=(e=s.children.last()).position(),S(-(t.left-(s.viewport.width()-e.outerWidth())),"reset",0)):"vertical"===s.settings.mode&&(i=s.children.length-s.settings.minSlides,t=s.children.eq(i).position(),S(-t.top,"reset",0)):(t=s.children.eq(s.active.index*x()).position(),s.active.index===f()-1&&(s.active.last=!0),void 0!==t&&("horizontal"===s.settings.mode?S(-t.left,"reset",0):"vertical"===s.settings.mode&&S(-t.top,"reset",0)))},S=function(e,i,n,r){var a,l;s.usingCSS?(l="vertical"===s.settings.mode?"translate3d(0, "+e+"px, 0)":"translate3d("+e+"px, 0, 0)",o.css("-"+s.cssPrefix+"-transition-duration",n/1e3+"s"),"slide"===i?(o.css(s.animProp,l),0!==n?o.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",(function(e){t(e.target).is(o)&&(o.off("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),A())})):A()):"reset"===i?o.css(s.animProp,l):"ticker"===i&&(o.css("-"+s.cssPrefix+"-transition-timing-function","linear"),o.css(s.animProp,l),0!==n?o.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",(function(e){t(e.target).is(o)&&(o.off("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),S(r.resetValue,"reset",0),F())})):(S(r.resetValue,"reset",0),F()))):((a={})[s.animProp]=e,"slide"===i?o.animate(a,n,s.settings.easing,(function(){A()})):"reset"===i?o.css(s.animProp,e):"ticker"===i&&o.animate(a,n,"linear",(function(){S(r.resetValue,"reset",0),F()})))},w=function(){for(var e="",i="",n=f(),o=0;o<n;o++)i="",s.settings.buildPager&&t.isFunction(s.settings.buildPager)||s.settings.pagerCustom?(i=s.settings.buildPager(o),s.pagerEl.addClass("bx-custom-pager")):(i=o+1,s.pagerEl.addClass("bx-default-pager")),e+='<div class="bx-pager-item"><a href="" data-slide-index="'+o+'" class="bx-pager-link">'+i+"</a></div>";s.pagerEl.html(e)},b=function(){s.settings.pagerCustom?s.pagerEl=t(s.settings.pagerCustom):(s.pagerEl=t('<div class="bx-pager" />'),s.settings.pagerSelector?t(s.settings.pagerSelector).html(s.pagerEl):s.controls.el.addClass("bx-has-pager").append(s.pagerEl),w()),s.pagerEl.on("click touchend","a",I)},C=function(){s.controls.next=t('<a class="bx-next" href="">'+s.settings.nextText+"</a>"),s.controls.prev=t('<a class="bx-prev" href="">'+s.settings.prevText+"</a>"),s.controls.next.on("click touchend",P),s.controls.prev.on("click touchend",E),s.settings.nextSelector&&t(s.settings.nextSelector).append(s.controls.next),s.settings.prevSelector&&t(s.settings.prevSelector).append(s.controls.prev),s.settings.nextSelector||s.settings.prevSelector||(s.controls.directionEl=t('<div class="bx-controls-direction" />'),s.controls.directionEl.append(s.controls.prev).append(s.controls.next),s.controls.el.addClass("bx-has-controls-direction").append(s.controls.directionEl))},T=function(){s.controls.start=t('<div class="bx-controls-auto-item"><a class="bx-start" href="">'+s.settings.startText+"</a></div>"),s.controls.stop=t('<div class="bx-controls-auto-item"><a class="bx-stop" href="">'+s.settings.stopText+"</a></div>"),s.controls.autoEl=t('<div class="bx-controls-auto" />'),s.controls.autoEl.on("click",".bx-start",M),s.controls.autoEl.on("click",".bx-stop",y),s.settings.autoControlsCombine?s.controls.autoEl.append(s.controls.start):s.controls.autoEl.append(s.controls.start).append(s.controls.stop),s.settings.autoControlsSelector?t(s.settings.autoControlsSelector).html(s.controls.autoEl):s.controls.el.addClass("bx-has-controls-auto").append(s.controls.autoEl),q(s.settings.autoStart?"stop":"start")},k=function(){s.children.each((function(e){var i=t(this).find("img:first").attr("title");void 0!==i&&(""+i).length&&t(this).append('<div class="bx-caption"><span>'+i+"</span></div>")}))},P=function(t){t.preventDefault(),s.controls.el.hasClass("disabled")||(s.settings.auto&&s.settings.stopAutoOnClick&&o.stopAuto(),o.goToNextSlide())},E=function(t){t.preventDefault(),s.controls.el.hasClass("disabled")||(s.settings.auto&&s.settings.stopAutoOnClick&&o.stopAuto(),o.goToPrevSlide())},M=function(t){o.startAuto(),t.preventDefault()},y=function(t){o.stopAuto(),t.preventDefault()},I=function(e){var i,n;e.preventDefault(),s.controls.el.hasClass("disabled")||(s.settings.auto&&s.settings.stopAutoOnClick&&o.stopAuto(),void 0!==(i=t(e.currentTarget)).attr("data-slide-index")&&(n=parseInt(i.attr("data-slide-index")))!==s.active.index&&o.goToSlide(n))},z=function(e){var i=s.children.length;if("short"===s.settings.pagerType)return s.settings.maxSlides>1&&(i=Math.ceil(s.children.length/s.settings.maxSlides)),void s.pagerEl.html(e+1+s.settings.pagerShortSeparator+i);s.pagerEl.find("a").removeClass("active"),s.pagerEl.each((function(i,n){t(n).find("a").eq(e).addClass("active")}))},A=function(){if(s.settings.infiniteLoop){var t="";0===s.active.index?t=s.children.eq(0).position():s.active.index===f()-1&&s.carousel?t=s.children.eq((f()-1)*x()).position():s.active.index===s.children.length-1&&(t=s.children.eq(s.children.length-1).position()),t&&("horizontal"===s.settings.mode?S(-t.left,"reset",0):"vertical"===s.settings.mode&&S(-t.top,"reset",0))}s.working=!1,s.settings.onSlideAfter.call(o,s.children.eq(s.active.index),s.oldIndex,s.active.index)},q=function(t){s.settings.autoControlsCombine?s.controls.autoEl.html(s.controls[t]):(s.controls.autoEl.find("a").removeClass("active"),s.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},D=function(){1===f()?(s.controls.prev.addClass("disabled"),s.controls.next.addClass("disabled")):!s.settings.infiniteLoop&&s.settings.hideControlOnEnd&&(0===s.active.index?(s.controls.prev.addClass("disabled"),s.controls.next.removeClass("disabled")):s.active.index===f()-1?(s.controls.next.addClass("disabled"),s.controls.prev.removeClass("disabled")):(s.controls.prev.removeClass("disabled"),s.controls.next.removeClass("disabled")))},H=function(){o.startAuto()},W=function(){o.stopAuto()},L=function(){s.settings.autoDelay>0?setTimeout(o.startAuto,s.settings.autoDelay):(o.startAuto(),t(window).focus(H).blur(W)),s.settings.autoHover&&o.hover((function(){s.interval&&(o.stopAuto(!0),s.autoPaused=!0)}),(function(){s.autoPaused&&(o.startAuto(!0),s.autoPaused=null)}))},O=function(){var e,i,n,r,a,l,d,c,g=0;"next"===s.settings.autoDirection?o.append(s.children.clone().addClass("bx-clone")):(o.prepend(s.children.clone().addClass("bx-clone")),e=s.children.first().position(),g="horizontal"===s.settings.mode?-e.left:-e.top),S(g,"reset",0),s.settings.pager=!1,s.settings.controls=!1,s.settings.autoControls=!1,s.settings.tickerHover&&(s.usingCSS?(r="horizontal"===s.settings.mode?4:5,s.viewport.hover((function(){i=o.css("-"+s.cssPrefix+"-transform"),n=parseFloat(i.split(",")[r]),S(n,"reset",0)}),(function(){c=0,s.children.each((function(e){c+="horizontal"===s.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)})),a=s.settings.speed/c,l="horizontal"===s.settings.mode?"left":"top",d=a*(c-Math.abs(parseInt(n))),F(d)}))):s.viewport.hover((function(){o.stop()}),(function(){c=0,s.children.each((function(e){c+="horizontal"===s.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)})),a=s.settings.speed/c,l="horizontal"===s.settings.mode?"left":"top",d=a*(c-Math.abs(parseInt(o.css(l)))),F(d)}))),F()},F=function(t){var e,i,n=t||s.settings.speed,r={left:0,top:0},a={left:0,top:0};"next"===s.settings.autoDirection?r=o.find(".bx-clone").first().position():a=s.children.first().position(),e="horizontal"===s.settings.mode?-r.left:-r.top,i="horizontal"===s.settings.mode?-a.left:-a.top,S(e,"ticker",n,{resetValue:i})},N=function(e){var i=document.activeElement.tagName.toLowerCase();if(null==new RegExp(i,["i"]).exec("input|textarea")&&function(e){var i=t(window),n={top:i.scrollTop(),left:i.scrollLeft()},s=e.offset();return n.right=n.left+i.width(),n.bottom=n.top+i.height(),s.right=s.left+e.outerWidth(),s.bottom=s.top+e.outerHeight(),!(n.right<s.left||n.left>s.right||n.bottom<s.top||n.top>s.bottom)}(o)){if(39===e.keyCode)return P(e),!1;if(37===e.keyCode)return E(e),!1}},B=function(){s.touch={start:{x:0,y:0},end:{x:0,y:0}},(!!("ontouchstart"in window)||window.navigator.msMaxTouchPoints>0)&&s.viewport.bind("touchstart MSPointerDown pointerdown",X),s.viewport.on("click",".bxslider a",(function(t){s.viewport.hasClass("click-disabled")&&(t.preventDefault(),s.viewport.removeClass("click-disabled"))}))},X=function(t){if("touchstart"===t.type||0===t.button)if(s.controls.el.addClass("disabled"),s.working)s.controls.el.removeClass("disabled");else{s.touch.originalPos=o.position();var e=t.originalEvent,i=void 0!==e.changedTouches?e.changedTouches:[e];if("function"==typeof PointerEvent&&void 0===e.pointerId)return;s.touch.start.x=i[0].pageX,s.touch.start.y=i[0].pageY,s.viewport.get(0).setPointerCapture&&(s.pointerId=e.pointerId,s.viewport.get(0).setPointerCapture(s.pointerId)),s.originalClickTarget=e.originalTarget||e.target,s.originalClickButton=e.button,s.originalClickButtons=e.buttons,s.originalEventType=e.type,s.hasMove=!1,s.viewport.on("touchmove MSPointerMove pointermove",V),s.viewport.on("touchend MSPointerUp pointerup",R),s.viewport.on("MSPointerCancel pointercancel",Y)}},Y=function(t){t.preventDefault(),S(s.touch.originalPos.left,"reset",0),s.controls.el.removeClass("disabled"),s.viewport.off("MSPointerCancel pointercancel",Y),s.viewport.off("touchmove MSPointerMove pointermove",V),s.viewport.off("touchend MSPointerUp pointerup",R),s.viewport.get(0).releasePointerCapture&&s.viewport.get(0).releasePointerCapture(s.pointerId)},V=function(t){var e=t.originalEvent,i=void 0!==e.changedTouches?e.changedTouches:[e],n=Math.abs(i[0].pageX-s.touch.start.x),o=Math.abs(i[0].pageY-s.touch.start.y),r=0,a=0;s.hasMove=!0,(3*n>o&&s.settings.preventDefaultSwipeX||3*o>n&&s.settings.preventDefaultSwipeY)&&t.preventDefault(),"touchmove"!==t.type&&t.preventDefault(),"fade"!==s.settings.mode&&s.settings.oneToOneTouch&&("horizontal"===s.settings.mode?(a=i[0].pageX-s.touch.start.x,r=s.touch.originalPos.left+a):(a=i[0].pageY-s.touch.start.y,r=s.touch.originalPos.top+a),S(r,"reset",0))},R=function(e){e.preventDefault(),s.viewport.off("touchmove MSPointerMove pointermove",V),s.controls.el.removeClass("disabled");var i=e.originalEvent,n=void 0!==i.changedTouches?i.changedTouches:[i],r=0,a=0;s.touch.end.x=n[0].pageX,s.touch.end.y=n[0].pageY,"fade"===s.settings.mode?(a=Math.abs(s.touch.start.x-s.touch.end.x))>=s.settings.swipeThreshold&&(s.touch.start.x>s.touch.end.x?o.goToNextSlide():o.goToPrevSlide(),o.stopAuto()):("horizontal"===s.settings.mode?(a=s.touch.end.x-s.touch.start.x,r=s.touch.originalPos.left):(a=s.touch.end.y-s.touch.start.y,r=s.touch.originalPos.top),!s.settings.infiniteLoop&&(0===s.active.index&&a>0||s.active.last&&a<0)?S(r,"reset",200):Math.abs(a)>=s.settings.swipeThreshold?(a<0?o.goToNextSlide():o.goToPrevSlide(),o.stopAuto()):S(r,"reset",200)),s.viewport.off("touchend MSPointerUp pointerup",R),s.viewport.get(0).releasePointerCapture&&s.viewport.get(0).releasePointerCapture(s.pointerId),!1!==s.hasMove||0!==s.originalClickButton&&"touchstart"!==s.originalEventType||t(s.originalClickTarget).trigger({type:"click",button:s.originalClickButton,buttons:s.originalClickButtons})},Z=function(e){if(s.initialized)if(s.working)window.setTimeout(Z,10);else{var i=t(window).width(),n=t(window).height();r===i&&a===n||(r=i,a=n,o.redrawSlider(),s.settings.onSliderResize.call(o,s.active.index))}},U=function(t){var e=v();s.settings.ariaHidden&&!s.settings.ticker&&(s.children.attr("aria-hidden","true"),s.children.slice(t,t+e).attr("aria-hidden","false"))};return o.goToSlide=function(e,i){var n,r,a,l,d=!0,c=0,g={left:0,top:0},u=null;if(s.oldIndex=s.active.index,s.active.index=function(t){return t<0?s.settings.infiniteLoop?f()-1:s.active.index:t>=f()?s.settings.infiniteLoop?0:s.active.index:t}(e),!s.working&&s.active.index!==s.oldIndex){if(s.working=!0,void 0!==(d=s.settings.onSlideBefore.call(o,s.children.eq(s.active.index),s.oldIndex,s.active.index))&&!d)return s.active.index=s.oldIndex,void(s.working=!1);"next"===i?s.settings.onSlideNext.call(o,s.children.eq(s.active.index),s.oldIndex,s.active.index)||(d=!1):"prev"===i&&(s.settings.onSlidePrev.call(o,s.children.eq(s.active.index),s.oldIndex,s.active.index)||(d=!1)),s.active.last=s.active.index>=f()-1,(s.settings.pager||s.settings.pagerCustom)&&z(s.active.index),s.settings.controls&&D(),"fade"===s.settings.mode?(s.settings.adaptiveHeight&&s.viewport.height()!==p()&&s.viewport.animate({height:p()},s.settings.adaptiveHeightSpeed),s.children.filter(":visible").fadeOut(s.settings.speed).css({zIndex:0}),s.children.eq(s.active.index).css("zIndex",s.settings.slideZIndex+1).fadeIn(s.settings.speed,(function(){t(this).css("zIndex",s.settings.slideZIndex),A()}))):(s.settings.adaptiveHeight&&s.viewport.height()!==p()&&s.viewport.animate({height:p()},s.settings.adaptiveHeightSpeed),!s.settings.infiniteLoop&&s.carousel&&s.active.last?"horizontal"===s.settings.mode?(g=(u=s.children.eq(s.children.length-1)).position(),c=s.viewport.width()-u.outerWidth()):(n=s.children.length-s.settings.minSlides,g=s.children.eq(n).position()):s.carousel&&s.active.last&&"prev"===i?(r=1===s.settings.moveSlides?s.settings.maxSlides-x():(f()-1)*x()-(s.children.length-s.settings.maxSlides),g=(u=o.children(".bx-clone").eq(r)).position()):"next"===i&&0===s.active.index?(g=o.find("> .bx-clone").eq(s.settings.maxSlides).position(),s.active.last=!1):e>=0&&(l=e*parseInt(x()),g=s.children.eq(l).position()),void 0!==g&&(a="horizontal"===s.settings.mode?-(g.left-c):-g.top,S(a,"slide",s.settings.speed)),s.working=!1),s.settings.ariaHidden&&U(s.active.index*x())}},o.goToNextSlide=function(){if((s.settings.infiniteLoop||!s.active.last)&&!0!==s.working){var t=parseInt(s.active.index)+1;o.goToSlide(t,"next")}},o.goToPrevSlide=function(){if((s.settings.infiniteLoop||0!==s.active.index)&&!0!==s.working){var t=parseInt(s.active.index)-1;o.goToSlide(t,"prev")}},o.startAuto=function(t){s.interval||(s.interval=setInterval((function(){"next"===s.settings.autoDirection?o.goToNextSlide():o.goToPrevSlide()}),s.settings.pause),s.settings.onAutoChange.call(o,!0),s.settings.autoControls&&!0!==t&&q("stop"))},o.stopAuto=function(t){s.autoPaused&&(s.autoPaused=!1),s.interval&&(clearInterval(s.interval),s.interval=null,s.settings.onAutoChange.call(o,!1),s.settings.autoControls&&!0!==t&&q("start"))},o.getCurrentSlide=function(){return s.active.index},o.getCurrentSlideElement=function(){return s.children.eq(s.active.index)},o.getSlideElement=function(t){return s.children.eq(t)},o.getSlideCount=function(){return s.children.length},o.isWorking=function(){return s.working},o.redrawSlider=function(){s.children.add(o.find(".bx-clone")).outerWidth(h()),s.viewport.css("height",p()),s.settings.ticker||m(),s.active.last&&(s.active.index=f()-1),s.active.index>=f()&&(s.active.last=!0),s.settings.pager&&!s.settings.pagerCustom&&(w(),z(s.active.index)),s.settings.ariaHidden&&U(s.active.index*x())},o.destroySlider=function(){s.initialized&&(s.initialized=!1,t(".bx-clone",this).remove(),s.children.each((function(){void 0!==t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")})),void 0!==t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),s.controls.el&&s.controls.el.remove(),s.controls.next&&s.controls.next.remove(),s.controls.prev&&s.controls.prev.remove(),s.pagerEl&&s.settings.controls&&!s.settings.pagerCustom&&s.pagerEl.remove(),t(".bx-caption",this).remove(),s.controls.autoEl&&s.controls.autoEl.remove(),clearInterval(s.interval),s.settings.responsive&&t(window).off("resize",Z),s.settings.keyboardEnabled&&t(document).off("keydown",N),t(this).removeData("bxSlider"),t(window).off("blur",W).off("focus",H))},o.reloadSlider=function(e){void 0!==e&&(n=e),o.destroySlider(),l(),t(o).data("bxSlider",this)},l(),t(o).data("bxSlider",this),this}}}(jQuery);; 1753!function(){var e,a,t,s,n,i;if((e=document.getElementById("cm-primary-nav"))&&void 0!==(a=e.getElementsByClassName("cm-menu-toggle")[0]))if(void 0!==(t=e.getElementsByTagName("ul")[0])){for(t.setAttribute("aria-expanded","fal
1753se"),-1===t.className.indexOf("nav-menu")&&(t.className+="nav-menu"),a.onclick=function(){-1!==e.className.indexOf("cm-mobile-nav")?(e.className=e.className.replace("cm-mobile-nav","cm-primary-nav"),a.setAttribute("aria-expanded","false"),t.setAttribute("aria-expanded","false")):(e.className=e.className.replace("cm-primary-nav","cm-mobile-nav"),a.setAttribute("aria-expanded","true"),t.setAttribute("aria-expanded","true"))},n=0,i=(s=t.getElementsByTagName("a")).length;n<i;n++)s[n].addEventListener("focus",c,!0),s[n].addEventListener("blur",c,!0);!function(e){var a,t,s=e.querySelectorAll(".menu-item-has-children > a, .page_item_has_children > a");if("ontouchstart"in window&&window.matchMedia("(min-width: 768px)").matches)for(a=function(e){var a,t=this.parentNode;if(t.classList.contains("focus"))t.classList.remove("focus");else{for(e.preventDefault(),a=0;a<t.parentNode.children.length;++a)t!==t.parentNode.children[a]&&t.parentNode.children[a].classList.remove("focus");t.classList.add("focus")}},t=0;t<s.length;++t)s[t].addEventListener("touchstart",a,!1)}(e)}else a.style.display="none";function c(){for(var e=this;-1===e.className.indexOf("nav-menu");)"li"===e.tagName.toLowerCase()&&(-1!==e.className.indexOf("focus")?e.className=e.className.replace(" focus",""):e.className+=" focus"),e=e.parentElement}}();; 1754/*! 1755* FitVids 1.1 1756* 1757* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com 1758* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ 1759* Released under the WTFPL license - http://sam.zoy.org/wtfpl/ 1760* 1761*/ 1762!function(t){"use strict";t.fn.fitVids=function(e){var i={customSelector:null,ignore:null};if(!document.getElementById("fit-vids-style")){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("div");a.innerHTML='<p>x</p><style id="fit-vids-style">.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%;}</style>',r.appendChild(a.childNodes[1])}return e&&t.extend(i,e),this.each((function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];i.customSelector&&e.push(i.customSelector);var r=".fitvidsignore";i.ignore&&(r=r+", "+i.ignore);var a=t(this).find(e.join(","));(a=(a=a.not("object object")).not(r)).each((function(){var e=t(this);if(!(e.parents(r).length>0||"embed"===this.tagName.toLowerCase()&&e.parent("object").length||e.parent(".fluid-width-video-wrapper").length)){e.css("height")||e.css("width")||!isNaN(e.attr("height"))&&!isNaN(e.attr("width"))||(e.attr("height",9),e.attr("width",16));var i=("object"===this.tagName.toLowerCase()||e.attr("height")&&!isNaN(parseInt(e.attr("height"),10))?parseInt(e.attr("height"),10):e.height())/(isNaN(parseInt(e.attr("width"),10))?e.width():parseInt(e.attr("width"),10));if(!e.attr("name")){var a="fitvid"+t.fn.fitVids._count;e.attr("name",a),t.fn.fitVids._count++}e.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*i+"%"),e.removeAttr("height").removeAttr("width")}}))}))},t.fn.fitVids._count=0}(window.jQuery||window.Zepto);; 1763/(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",(function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())}),!1);; 1764jQuery(document).ready((function(){var e,i,t,r,a,o,n,s,c,u,d,l=function(){jQuery("#cm-masthead .search-form-top").removeClass("show"),jQuery("#cm-content").removeClass("backdrop")};(jQuery(".search-top").click((function(){jQuery(this).next("#cm-masthead .search-form-top").toggleClass("show"),jQuery("#cm-content").toggleClass("backdrop"),setTimeout((function(){jQuery("#cm-masthead .search-form-top input").focus()}
1764),200),jQuery(document).on("keyup",(function(e){27===e.keyCode&&jQuery("#cm-masthead .search-form-top").hasClass("show")&&l()})),jQuery(document).on("click.outEvent",(function(e){e.target.closest(".cm-top-search")||(l(),jQuery(document).off("click.outEvent"))}))})),jQuery("#scroll-up").hide(),jQuery(window).scroll((function(){jQuery(this).scrollTop()>1e3?jQuery("#scroll-up").fadeIn():jQuery("#scroll-up").fadeOut()})),jQuery("a#scroll-up").click((function(){return jQuery("body,html").animate({scrollTop:0},800),!1})),jQuery(".cm-menu-primary-container .menu-item-has-children"),jQuery(".cm-menu-primary-container .cm-submenu-toggle").click((function(){jQuery(this).parent(".menu-item-has-children").children("ul.sub-menu").first().slideToggle("1000")})),jQuery(document).on("click","#cm-primary-nav ul li.menu-item-has-children > a",(function(e){var i=jQuery(this).parent(".menu-item-has-children");!i.hasClass("focus")&&jQuery(window).width()<=768&&(i.addClass("focus"),e.preventDefault(),i.children(".sub-menu").css({display:"block"}))})),jQuery(window).on("load",(function(){if(window.matchMedia("(max-width: 768px)").matches&&jQuery("#cm-masthead .sticky-wrapper, #cm-masthead .headroom").length>=1){var e=jQuery(window).height()-88,i=jQuery("#cm-primary-nav").find("ul").first();i.css("max-height",e),i.addClass("menu-scrollbar")}})),jQuery(".wp-block-group__inner-container h2").wrap('<div class="block-title"></div>'),jQuery(".wp-block-heading").wrap('<div class="block-title"></div>'),void 0!==jQuery.fn.magnificPopup&&(jQuery(".image-popup").magnificPopup({type:"image"}),jQuery(".gallery").find('a[href*=".jpg"], a[href*=".jpeg"], a[href*=".png"], a[href*=".gif"], a[href*=".ico"]').magnificPopup({type:"image",gallery:{enabled:!0}}),jQuery(".colormag-ticker-news-popup-link").magnificPopup({type:"ajax",callbacks:{parseAjax:function(e){var i=jQuery.magnificPopup.instance,t=jQuery(i.currItem.el[0]).data("fragment");e.data=jQuery(e.data).find(t)}}})),void 0!==jQuery.fn.fitVids&&jQuery(".fitvids-video").fitVids(),void 0!==jQuery.fn.newsTicker&&jQuery(".newsticker").newsTicker({row_height:20,max_rows:1,speed:1e3,direction:"down",duration:4e3,autostart:1,pauseOnHover:1,start:function(){jQuery(".newsticker").css("visibility","visible")}}),void 0!==jQuery.fn.sticky)&&((m=jQuery("#wpadminbar")).length?jQuery("#cm-primary-nav").sticky({topSpacing:m.height(),zIndex:999}):jQuery("#cm-primary-nav").sticky({topSpacing:0,zIndex:999}));if(jQuery(".wp-block-search__input").attr("placeholder","Search posts"),void 0!==jQuery.fn.headroom){var p=jQuery("#cm-primary-nav").offset().top,m=jQuery("#wpadminbar"),y=jQuery(".cm-primary-nav").width();m.length&&(p=m.height()+jQuery("#cm-primary-nav").offset().top),jQuery(".cm-primary-nav").headroom({offset:p,tolerance:0,onPin:function(){m.length?jQuery(".cm-primary-nav").css({top:m.height(),position:"fixed",width:y}):jQuery(".cm-primary-nav").css({top:0,position:"fixed",width:y})},onTop:function(){jQuery(".cm-primary-nav").css({top:0,position:"relative"})}})}if(void 0!==jQuery.fn.bxSlider&&(jQuery(".cm-slider-area-rotate").bxSlider({mode:"horizontal",speed:1500,auto:!0,pause:5e3,adaptiveHeight:!0,nextText:"",prevText:"",nextSelector:".slide-next",prevSelector:".slide-prev",pager:!1,tickerHover:!0,onSliderLoad:function(){jQuery(".cm-slider-area-rotate").css("visibility","visible"),jQuery(".cm-slider-area-rotate").css("height","auto")}}),jQuery(".blog .gallery-images, .archive .gallery-images, .search .gallery-images, .single-post .gallery-images").bxSlider({mode:"fade",speed:1500,auto:!0,pause:3e3,adaptiveHeight:!0,nextText:"",prevText:"",nextSelector:".slide-next",prevSelector:".slide-prev",pager:!1})),void 0!==jQuery.fn.easytabs&&jQuery(".cm-tabbed-widget").easytabs(),void 0!==jQuery.fn.theiaStickySidebar&&"undefined"!=typeof ResizeSensor){var f=jQuery("#site-navigation-sticky-wrapper").outerHeight();null===f&&(f=0),jQuery("#cm-primary, #cm-secondary, #tertiary").theiaStickySidebar({additionalMarginTop:40+f})}function h(e){e.find(".player-frame").each((function(){var e=jQuery(this),i=jQuery('[data-id="'+e.attr("id")+'"]');e.addVideoEvent("play",(function(e,t,r){i.removeClass("is-paused").addClass("is-playing")})),e.addVideoEvent("pause",(function(e,t,r){i.removeClass("is-playing").addClass("is-paused")})),e.addVideoEvent("finish",(function(e,t,r){i.removeClass("is-paused is-playing")}))}))}if(jQuery(".video-player").each((function(e){var i=jQuery(this),t="video-playlist-item-"+e,r=jQuery(this).find(".player-frame");i.attr("id",t),r.video(),h(i),r.addVideoEvent("ready",(function(){r.css("visibility","visible").fadeIn()})),i.on("click",".video-playlist-item",(function(){var e=jQuery(this),t=e.data("id"),r=jQuery("#"+t),a=e.data("src");i.find(".player-frame").each((function(){jQuery(this).pauseVideo().hide()})),r.length?r.playVideo():(i.find(".video-frame").append('<iframe id="'+t+'" class="player-frame" src="'+a+'" frameborder="0" width="100%" height="434" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'),(r=jQuery("#"+t)).video(),r.addVideoEvent("ready",(function(e,i,t){r.playVideo()}))),r.css("visibility","visible").fadeIn(),h(i)}))})),"undefined"!=typeof google&&"undefined"!=typeof colormag_google_maps_widget_settings){e=parseFloat(colormag_google_maps_widget_settings.longitude),i=parseFloat(colormag_google_maps_widget_settings.latitude),t=parseInt(colormag_google_maps_widget_settings.zoom_size),r={lat:i,lng:e},a=new google.maps.Map(document.getElementById("GoogleMaps"),{zoom:t,center:r}),new google.maps.Marker({position:r,map:a}),jQuery("#GoogleMaps").css({height:colormag_google_maps_widget_settings.height})}c=jQuery(".share-buttons #facebook")[0],u=jQuery(".share-buttons #twitter")[0],d=jQuery(".share-buttons #pinterest")[0],c&&jQuery(c).click((function(e){return e.preventDefault(),(o=window.open("https://www.facebook.com/sharer/sharer.php?u="+document.URL+"&p[title]="+document.title,"facebook-popup","height=350,width=600")).focus&&o.focus(),!1})),u&&jQuery(u).click((function(e){return e.preventDefault(),(n=window.open("https://twitter.com/share?text="+document.title+"&url="+document.URL,"twitter-popup","height=350,width=600")).focus&&n.focus(),!1})),d&&jQuery(d).click((function(e){e.preventDefault();var i=jQuery(".cm-posts .cm-featured-image img").attr("src")?jQuery(".cm-posts .cm-featured-image img").attr("src"):"";return(s=window.open("https://pinterest.com/pin/create/button/?url="+document.URL+"&media="+i+"&description="+document.title,"pinterest-popup","height=350,width=600")).focus&&s.focus(),!1}))}));;
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.