vendor: 7,199 bytes, lines 1-2
1/*! jQuery Migrate v1.2.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */ 2jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){var r=t.console;i[n]||(i[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(r.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function a(t,a,i,o){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(o),i},set:function(e){r(o),i=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=i}var i={};e.migrateWarnings=[],!e.migrateMute&&t.console&&t.console.log&&t.console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){i={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var o=e("<input/>",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",o||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,i,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(o?a in o:e.isFunction(e.fn[a])))?e(t)[a](i):("type"===a&&i!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,i=e.prop(t,r);return i===!0||"boolean"!=typeof i&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,i))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,a){var i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(i=y.exec(e.trim(t)))&&i[0]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),i[3]&&r("$(html) HTML text after last tag is ignored"),"#"===i[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(i[2],n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,i,o=this[0];return!o||"events"!==t||1!==arguments.length||(a=e.data(o,t),i=e._data(o,t),a!==n&&a!==i||i===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),i)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,i,o){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),i)for(c=function(e){return!e.type||j.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):i.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(i.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,T=e.fn.live,M=e.fn.die,S="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",C=RegExp("\\b(?:"+S+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,i){e!==document&&C.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,i)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,i=t.guid||e.guid++,o=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%o;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=i;a.length>o;)a[o++].guid=i;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),T?T.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),M?M.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||C.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(S.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window);
2 3var stacks = {}; 4stacks.jQuery = jQuery.noConflict(true); 5stacks.com_elixir_stacks_Animagic = {}; 6stacks.com_elixir_stacks_Animagic = (function(stack) { 7var jQuery = stacks.jQuery;var $ = jQuery; 8(function() { 9 var Util, WeakMap, 10 __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; 11 12 Util = (function() { 13 function Util() {} 14 15 Util.prototype.extend = function(custom, defaults) { 16 var key, value; 17 for (key in custom) { 18 value = custom[key]; 19 if (value != null) { 20 defaults[key] = value; 21 } 22 } 23 return defaults; 24 }; 25 26 Util.prototype.isMobile = function(agent) { 27 return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(agent); 28 }; 29 30 return Util; 31 32 })(); 33 34 WeakMap = this.WeakMap || (WeakMap = (function() { 35 function WeakMap() { 36 this.keys = []; 37 this.values = []; 38 } 39 40 WeakMap.prototype.get = function(key) { 41 var i, item, _i, _len, _ref; 42 _ref = this.keys; 43 for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { 44 item = _ref[i]; 45 if (item === key) { 46 return this.values[i]; 47 } 48 } 49 }; 50 51 WeakMap.prototype.set = function(key, value) { 52 var i, item, _i, _len, _ref; 53 _ref = this.keys; 54 for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { 55 item = _ref[i]; 56 if (item === key) { 57 this.values[i] = value; 58 return; 59 } 60 } 61 this.keys.push(key); 62 return this.values.push(value); 63 }; 64 65 return WeakMap; 66 67 })()); 68 69 this.WOW = (function() { 70 WOW.prototype.defaults = { 71 boxClass: 'wow', 72 animateClass: 'animated', 73 offset: 0, 74 mobile: true 75 }; 76 77 function WOW(options) { 78 if (options == null) { 79 options = {}; 80 } 81 this.scrollCallback = __bind(this.scrollCallback, this); 82 this.scrollHandler = __bind(this.scrollHandler, this); 83 this.start = __bind(this.start, this); 84 this.scrolled = true; 85 this.config = this.util().extend(options, this.defaults); 86 this.animationNameCache = new WeakMap(); 87 } 88 89 WOW.prototype.init = function() { 90 var _ref; 91 this.element = window.document.documentElement; 92 if ((_ref = document.readyState) === "interactive" || _ref === "complete") { 93 return this.start(); 94 } else { 95 return document.addEventListener('DOMContentLoaded', this.start); 96 } 97 }; 98 99 WOW.prototype.start = function() { 100 var box, _i, _len, _ref; 101 this.boxes = this.element.getElementsByClassName(this.config.boxClass); 102 if (this.boxes.length) { 103 if (this.disabled()) { 104 return this.resetStyle(); 105 } else { 106 _ref = this.boxes; 107 for (_i = 0, _len = _ref.length; _i < _len; _i++) { 108 box = _ref[_i]; 109 this.applyStyle(box, true); 110 } 111 window.addEventListener('scroll', this.scrollHandler, false); 112 window.addEventListener('resize', this.scrollHandler, false); 113 return this.interval = setInterval(this.scrollCallback, 50); 114 } 115 } 116 }; 117 118 WOW.prototype.stop = function() { 119 window.removeEventListener('scroll', this.scrollHandler, false); 120 window.removeEventListener('resize', this.scrollHandler, false); 121 if (this.interval != null) { 122 return clearInterval(this.interval); 123 } 124 }; 125 126 WOW.prototype.show = function(box) { 127 this.applyStyle(box); 128 return box.className = "" + box.className + " " + this.config.animateClass; 129 }; 130 131 WOW.prototype.applyStyle = function(box, hidden) { 132 var delay, duration, iteration; 133 duration = box.getAttribute('data-wow-duration');
vendor: 4,541 bytes, lines 134-291
134 delay = box.getAttribute('data-wow-delay'); 135 iteration = box.getAttribute('data-wow-iteration'); 136 return this.animate((function(_this) { 137 return function() { 138 return _this.customStyle(box, hidden, duration, delay, iteration); 139 }; 140 })(this)); 141 }; 142 143 WOW.prototype.animate = (function() { 144 if ('requestAnimationFrame' in window) { 145 return function(callback) { 146 return window.requestAnimationFrame(callback); 147 }; 148 } else { 149 return function(callback) { 150 return callback(); 151 }; 152 } 153 })(); 154 155 WOW.prototype.resetStyle = function() { 156 var box, _i, _len, _ref, _results; 157 _ref = this.boxes; 158 _results = []; 159 for (_i = 0, _len = _ref.length; _i < _len; _i++) { 160 box = _ref[_i]; 161 _results.push(box.setAttribute('style', 'visibility: visible;')); 162 } 163 return _results; 164 }; 165 166 WOW.prototype.customStyle = function(box, hidden, duration, delay, iteration) { 167 if (hidden) { 168 this.cacheAnimationName(box); 169 } 170 box.style.visibility = hidden ? 'hidden' : 'visible'; 171 if (duration) { 172 this.vendorSet(box.style, { 173 animationDuration: duration 174 }); 175 } 176 if (delay) { 177 this.vendorSet(box.style, { 178 animationDelay: delay 179 }); 180 } 181 if (iteration) { 182 this.vendorSet(box.style, { 183 animationIterationCount: iteration 184 }); 185 } 186 this.vendorSet(box.style, { 187 animationName: hidden ? 'none' : this.cachedAnimationName(box) 188 }); 189 return box; 190 }; 191 192 WOW.prototype.vendors = ["moz", "webkit"]; 193 194 WOW.prototype.vendorSet = function(elem, properties) { 195 var name, value, vendor, _results; 196 _results = []; 197 for (name in properties) { 198 value = properties[name]; 199 elem["" + name] = value; 200 _results.push((function() { 201 var _i, _len, _ref, _results1; 202 _ref = this.vendors; 203 _results1 = []; 204 for (_i = 0, _len = _ref.length; _i < _len; _i++) { 205 vendor = _ref[_i]; 206 _results1.push(elem["" + vendor + (name.charAt(0).toUpperCase()) + (name.substr(1))] = value); 207 } 208 return _results1; 209 }).call(this)); 210 } 211 return _results; 212 }; 213 214 WOW.prototype.vendorCSS = function(elem, property) { 215 var result, style, vendor, _i, _len, _ref; 216 style = window.getComputedStyle(elem); 217 result = style.getPropertyCSSValue(property); 218 _ref = this.vendors; 219 for (_i = 0, _len = _ref.length; _i < _len; _i++) { 220 vendor = _ref[_i]; 221 result = result || style.getPropertyCSSValue("-" + vendor + "-" + property); 222 } 223 return result; 224 }; 225 226 WOW.prototype.animationName = function(box) { 227 var animationName; 228 try { 229 animationName = this.vendorCSS(box, 'animation-name').cssText; 230 } catch (_error) { 231 animationName = window.getComputedStyle(box).getPropertyValue('animation-name'); 232 } 233 if (animationName === 'none') { 234 return ''; 235 } else { 236 return animationName; 237 } 238 }; 239 240 WOW.prototype.cacheAnimationName = function(box) { 241 return this.animationNameCache.set(box, this.animationName(box)); 242 }; 243 244 WOW.prototype.cachedAnimationName = function(box) { 245 return this.animationNameCache.get(box); 246 }; 247 248 WOW.prototype.scrollHandler = function() { 249 return this.scrolled = true; 250 }; 251 252 WOW.prototype.scrollCallback = function() { 253 var box; 254 if (this.scrolled) { 255 this.scrolled = false; 256 this.boxes = (function() { 257 var _i, _len, _ref, _results; 258 _ref = this.boxes; 259 _results = []; 260 for (_i = 0, _len = _ref.length; _i < _len; _i++) { 261 box = _ref[_i]; 262 if (!(box)) { 263 continue; 264 } 265 if (this.isVisible(box)) { 266 this.show(box); 267 continue; 268 } 269 _results.push(box); 270 } 271 return _results; 272 }).call(this); 273 if (!this.boxes.length) { 274 return this.stop(); 275 } 276 } 277 }; 278 279 WOW.prototype.offsetTop = function(element) { 280 var top; 281 while (element.offsetTop === void 0) { 282 element = element.parentNode; 283 } 284 top = element.offsetTop; 285 while (element = element.offsetParent) { 286 top += element.offsetTop; 287 } 288 return top; 289 }; 290 291 WOW.prototype.isVisible = function(box) {
292 var bottom, offset, top, viewBottom, viewTop; 293 offset = box.getAttribute('data-wow-offset') || this.config.offset; 294 viewTop = window.pageYOffset; 295 viewBottom = viewTop + this.element.clientHeight - offset; 296 top = this.offsetTop(box); 297 bottom = top + box.clientHeight; 298 return top <= viewBottom && bottom >= viewTop; 299 }; 300 301 WOW.prototype.util = function() { 302 return this._util || (this._util = new Util()); 303 }; 304 305 WOW.prototype.disabled = function() { 306 return !this.config.mobile && this.util().isMobile(navigator.userAgent); 307 }; 308 309 return WOW; 310 311 })(); 312 313}).call(this); 314 315 316 317$(window).load(function(){ 318 new WOW().init(); 319}); 320 321return stack;})(stacks.com_elixir_stacks_Animagic); 322stacks.uk_co_doobox_vegas = {}; 323stacks.uk_co_doobox_vegas = (function(stack) { 324var jQuery = stacks.jQuery;var $ = jQuery;// -- Start Vegas Page js Template -- // 325$(function(){ 326!function(t){"use strict";var s={slide:0,delay:5e3,preload:!1,preloadImage:!1,preloadVideo:!1,timer:!0,overlay:!1,autoplay:!0,shuffle:!1,cover:!0,color:null,align:"center",valign:"center",transition:"fade",transitionDuration:1e3,transitionRegister:[],animation:null,animationDuration:"auto",animationRegister:[],init:function(){},play:function(){},pause:function(){},walk:function(){},slides:[]},i={},e=function(i,e){this.elmt=i,this.settings=t.extend({},s,t.vegas.defaults,e),this.slide=this.settings.slide,this.total=this.settings.slides.length,this.noshow=this.total<2,this.paused=!this.settings.autoplay||this.noshow,this.$elmt=t(i),this.$timer=null,this.$overlay=null,this.$slide=null,this.timeout=null,this.transitions=["fade","fade2","blur","blur2","flash","flash2","negative","negative2","burn","burn2","slideLeft","slideLeft2","slideRight","slideRight2","slideUp","slideUp2","slideDown","slideDown2","zoomIn","zoomIn2","zoomOut","zoomOut2","swirlLeft","swirlLeft2","swirlRight","swirlRight2"],this.animations=["kenburns","kenburnsLeft","kenburnsRight","kenburnsUp","kenburnsUpLeft","kenburnsUpRight","kenburnsDown","kenburnsDownLeft","kenburnsDownRight"],this.settings.transitionRegister instanceof Array==!1&&(this.settings.transitionRegister=[this.settings.transitionRegister]),this.settings.animationRegister instanceof Array==!1&&(this.settings.animationRegister=[this.settings.animationRegister]),this.transitions=this.transitions.concat(this.settings.transitionRegister),this.animations=this.animations.concat(this.settings.animationRegister),this.support={objectFit:"objectFit"in document.body.style,transition:"transition"in document.body.style||"WebkitTransition"in document.body.style,video:t.vegas.isVideoCompatible()},this.settings.shuffle===!0&&this.shuffle(),this._init()};e.prototype={_init:function(){var s,i,e,n="BODY"===this.elmt.tagName,o=this.settings.timer,a=this.settings.overlay,r=this;this._preload(),n||(this.$elmt.css("height",this.$elmt.css("height")),s=t('<div class="vegas-wrapper">').css("overflow",this.$elmt.css("overflow")).css("padding",this.$elmt.css("padding")),this.$elmt.css("padding")||s.css("padding-top",this.$elmt.css("padding-top")).css("padding-bottom",this.$elmt.css("padding-bottom")).css("padding-left",this.$elmt.css("padding-left")).css("padding-right",this.$elmt.css("padding-right")),this.$elmt.clone(!0).children().appendTo(s),this.elmt.innerHTML=""),o&&this.support.transition&&(e=t('<div class="vegas-timer"><div class="vegas-timer-progress">'),this.$timer=e,this.$elmt.prepend(e)),a&&(i=t('<div class="vegas-overlay">'),"string"==typeof a&&i.css("background-image","url("+a+")"),this.$overlay=i,this.$elmt.prepend(i)),this.$elmt.addClass("vegas-container"),n||this.$elmt.append(s),setTimeout(function(){r.trigger("init"),r._goto(r.slide),r.settings.autoplay&&r.trigger("play")},1)},_preload:function(){var t,s;for(s=0;s<this.settings.slides.length;s++)(this.settings.preload||this.settings.preloadImages)&&this.settings.slides[s].src&&(t=new Image,t.src=this.settings.slides[s].src),(this.settings.preload||this.settings.preloadVideos)&&this.support.video&&this.settings.slides[s].video&&(this.settings.slides[s].video instanceof Array?this._video(this.settings.slides[s].video):this._video(this.settings.slides[s].video.src))},_random:function(t){return t[Math.floor(Math.random()*t.length)]},_slideShow:function(){var t=this;this.total>1&&!this.paused&&!this.noshow&&(this.timeout=setTimeout(function(){t.next()},this._options("delay")))},_timer:function(t){var s=this;clearTimeout(this.timeout),this.$timer&&(this.$timer.removeClass("vegas-timer-running").find("div").css("transition-duration","0ms"),this.paused||this.noshow||t&&setTimeout(function(){s.$timer.addClass("vegas-timer-running").find("div").css("transition-duration",s._options("delay")-100+"ms")},100))},_video:function(t){var s,e,n=t.toString();return i[n]?i[n]:(t instanceof Array==!1&&(t=[t]),s=document.createElement("video"),s.preload=!0,t.forEach(function(t){e=document.createElement("source"),e.src=t,s.appendChild(e)}),i[n]=s,s)},_fadeOutSound:function(t,s){var i=this,e=s/10,n=t.volume-.09;n>
3260?(t.volume=n,setTimeout(function(){i._fadeOutSound(t,s)},e)):t.pause()},_fadeInSound:function(t,s){var i=this,e=s/10,n=t.volume+.09;1>n&&(t.volume=n,setTimeout(function(){i._fadeInSound(t,s)},e))},_options:function(t,s){return void 0===s&&(s=this.slide),void 0!==this.settings.slides[s][t]?this.settings.slides[s][t]:this.settings[t]},_goto:function(s){function i(){f._timer(!0),setTimeout(function(){y&&(f.support.transition?(h.css("transition","all "+_+"ms").addClass("vegas-transition-"+y+"-out"),h.each(function(){var t=h.find("video").get(0);t&&(t.volume=1,f._fadeOutSound(t,_))}),e.css("transition","all "+_+"ms").addClass("vegas-transition-"+y+"-in")):e.fadeIn(_));for(var t=0;t<h.length-4;t++)h.eq(t).remove();f.trigger("walk"),f._slideShow()},100)}"undefined"==typeof this.settings.slides[s]&&(s=0),this.slide=s;var e,n,o,a,r,h=this.$elmt.children(".vegas-slide"),d=this.settings.slides[s].src,l=this.settings.slides[s].video,g=this._options("delay"),u=this._options("align"),c=this._options("valign"),p=this._options("cover"),m=this._options("color")||this.$elmt.css("background-color"),f=this,v=h.length,y=this._options("transition"),_=this._options("transitionDuration"),w=this._options("animation"),b=this._options("animationDuration");"repeat"!==p&&(p===!0?p="cover":p===!1&&(p="contain")),("random"===y||y instanceof Array)&&(y=y instanceof Array?this._random(y):this._random(this.transitions)),("random"===w||w instanceof Array)&&(w=w instanceof Array?this._random(w):this._random(this.animations)),("auto"===_||_>g)&&(_=g),"auto"===b&&(b=g),e=t('<div class="vegas-slide"></div>'),this.support.transition&&y&&e.addClass("vegas-transition-"+y),this.support.video&&l?(a=l instanceof Array?this._video(l):this._video(l.src),a.loop=void 0!==l.loop?l.loop:!0,a.muted=void 0!==l.mute?l.mute:!0,a.muted===!1?(a.volume=0,this._fadeInSound(a,_)):a.pause(),o=t(a).addClass("vegas-video").css("background-color",m),this.support.objectFit?o.css("object-position",u+" "+c).css("object-fit",p).css("width","100%").css("height","100%"):"contain"===p&&o.css("width","100%").css("height","100%"),e.append(o)):(r=new Image,n=t('<div class="vegas-slide-inner"></div>').css("background-image","url("+d+")").css("background-color",m).css("background-position",u+" "+c),"repeat"===p?n.css("background-repeat","repeat"):n.css("background-size",p),this.support.transition&&w&&n.addClass("vegas-animation-"+w).css("animation-duration",b+"ms"),e.append(n)),this.support.transition||e.css("display","none"),v?h.eq(v-1).after(e):this.$elmt.prepend(e),f._timer(!1),a?(4===a.readyState&&(a.currentTime=0),a.play(),i()):(r.src=d,r.onload=i)},shuffle:function(){for(var t,s,i=this.total-1;i>0;i--)s=Math.floor(Math.random()*(i+1)),t=this.settings.slides[i],this.settings.slides[i]=this.settings.slides[s],this.settings.slides[s]=t},play:function(){this.paused&&(this.paused=!1,this.next(),this.trigger("play"))},pause:function(){this._timer(!1),this.paused=!0,this.trigger("pause")},toggle:function(){this.paused?this.play():this.pause()},playing:function(){return!this.paused&&!this.noshow},current:function(t){return t?{slide:this.slide,data:this.settings.slides[this.slide]}:this.slide},jump:function(t){0>t||t>this.total-1||t===this.slide||(this.slide=t,this._goto(this.slide))},next:function(){this.slide++,this.slide>=this.total&&(this.slide=0),this._goto(this.slide)},previous:function(){this.slide--,this.slide<0&&(this.slide=this.total-1),this._goto(this.slide)},trigger:function(t){var s=[];s="init"===t?[this.settings]:[this.slide,this.settings.slides[this.slide]],this.$elmt.trigger("vegas"+t,s),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,s)},options:function(i,e){var n=this.settings.slides.slice();if("object"==typeof i)this.settings=t.extend({},s,t.vegas.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.settings.slides!==n&&(this.total=this.settings.slides.length,this.noshow=this.total<2,this._preload())},destroy:function(){clearTimeout(this.timeout),this.$elmt.removeClass("vegas-container"),this.$elmt.find("> .vegas-slide").remove(),this.$elmt.find("> .vegas-wrapper").clone(!0).children().appendTo(this.$elmt),this.$elmt.find("> .vegas-wrapper").remove(),this.settings.timer&&this.$timer.remove(),this.settings.overlay&&this.$overlay.remove(),this.elmt._vegas=null}},t.fn.vegas=function(t){var s,i=arguments,n=!1;if(void 0===t||"object"==typeof t)return this.each(function(){this._vegas||(this._vegas=new e(this,t))});if("string"==typeof t){if(this.each(function(){var e=this._vegas;if(!e)throw new Error("No Vegas applied to this element.");"function"==typeof e[t]&&"_"!==t[0]?s=e[t].apply(e,[].slice.call(i,1)):n=!0}),n)throw new Error('No method "'+t+'" in Vegas.');return void 0!==s?s:this}},t.vegas={},t.vegas.defaults=s,t.vegas.isVideoCompatible=function(){return!/(Android|webOS|Phone|iPad|iPod|BlackBerry|W
vendor: 4,435 bytes, lines 326-446
326indows Phone)/i.test(navigator.userAgent)}}(jQuery||window.Zepto); 327}); 328// -- End Vegas Page js Template -- // 329return stack;})(stacks.uk_co_doobox_vegas); 330stacks.stacks_in_3747_39 = {}; 331stacks.stacks_in_3747_39 = (function(stack) { 332var jQuery = stacks.jQuery;var $ = jQuery;/* 333 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ 334 * 335 * Uses the built in easing capabilities added In jQuery 1.1 336 * to offer multiple easing options 337 * 338 * TERMS OF USE - jQuery Easing 339 * 340 * Open source under the BSD License. 341 * 342 * Copyright © 2008 George McGinley Smith 343 * All rights reserved. 344 * 345 * Redistribution and use in source and binary forms, with or without modification, 346 * are permitted provided that the following conditions are met: 347 * 348 * Redistributions of source code must retain the above copyright notice, this list of 349 * conditions and the following disclaimer. 350 * Redistributions in binary form must reproduce the above copyright notice, this list 351 * of conditions and the following disclaimer in the documentation and/or other materials 352 * provided with the distribution. 353 * 354 * Neither the name of the author nor the names of contributors may be used to endorse 355 * or promote products derived from this software without specific prior written permission. 356 * 357 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 358 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 359 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 360 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 361 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 362 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 363 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 364 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 365 * OF THE POSSIBILITY OF SUCH DAMAGE. 366 * 367*/ 368 369// t: current time, b: begInnIng value, c: change In value, d: duration 370jQuery.easing['jswing'] = jQuery.easing['swing']; 371 372jQuery.extend( jQuery.easing, 373{ 374 def: 'easeOutQuad', 375 swing: function (x, t, b, c, d) { 376 //alert(jQuery.easing.default); 377 return jQuery.easing[jQuery.easing.def](x, t, b, c, d); 378 }, 379 easeInQuad: function (x, t, b, c, d) { 380 return c*(t/=d)*t + b; 381 }, 382 easeOutQuad: function (x, t, b, c, d) { 383 return -c *(t/=d)*(t-2) + b; 384 }, 385 easeInOutQuad: function (x, t, b, c, d) { 386 if ((t/=d/2) < 1) return c/2*t*t + b; 387 return -c/2 * ((--t)*(t-2) - 1) + b; 388 }, 389 easeInCubic: function (x, t, b, c, d) { 390 return c*(t/=d)*t*t + b; 391 }, 392 easeOutCubic: function (x, t, b, c, d) { 393 return c*((t=t/d-1)*t*t + 1) + b; 394 }, 395 easeInOutCubic: function (x, t, b, c, d) { 396 if ((t/=d/2) < 1) return c/2*t*t*t + b; 397 return c/2*((t-=2)*t*t + 2) + b; 398 }, 399 easeInQuart: function (x, t, b, c, d) { 400 return c*(t/=d)*t*t*t + b; 401 }, 402 easeOutQuart: function (x, t, b, c, d) { 403 return -c * ((t=t/d-1)*t*t*t - 1) + b; 404 }, 405 easeInOutQuart: function (x, t, b, c, d) { 406 if ((t/=d/2) < 1) return c/2*t*t*t*t + b; 407 return -c/2 * ((t-=2)*t*t*t - 2) + b; 408 }, 409 easeInQuint: function (x, t, b, c, d) { 410 return c*(t/=d)*t*t*t*t + b; 411 }, 412 easeOutQuint: function (x, t, b, c, d) { 413 return c*((t=t/d-1)*t*t*t*t + 1) + b; 414 }, 415 easeInOutQuint: function (x, t, b, c, d) { 416 if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; 417 return c/2*((t-=2)*t*t*t*t + 2) + b; 418 }, 419 easeInSine: function (x, t, b, c, d) { 420 return -c * Math.cos(t/d * (Math.PI/2)) + c + b; 421 }, 422 easeOutSine: function (x, t, b, c, d) { 423 return c * Math.sin(t/d * (Math.PI/2)) + b; 424 }, 425 easeInOutSine: function (x, t, b, c, d) { 426 return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; 427 }, 428 easeInExpo: function (x, t, b, c, d) { 429 return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; 430 }, 431 easeOutExpo: function (x, t, b, c, d) { 432 return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; 433 }, 434 easeInOutExpo: function (x, t, b, c, d) { 435 if (t==0) return b; 436 if (t==d) return b+c; 437 if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; 438 return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; 439 }, 440 easeInCirc: function (x, t, b, c, d) { 441 return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; 442 }, 443 easeOutCirc: function (x, t, b, c, d) { 444 return c * Math.sqrt(1 - (t=t/d-1)*t) + b; 445 }, 446 easeInOutCirc: function (x, t, b, c, d) {
447 if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; 448 return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; 449 }, 450 easeInElastic: function (x, t, b, c, d) { 451 var s=1.70158;var p=0;var a=c; 452 if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 453 if (a < Math.abs(c)) { a=c; var s=p/4; } 454 else var s = p/(2*Math.PI) * Math.asin (c/a); 455 return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 456 }, 457 easeOutElastic: function (x, t, b, c, d) { 458 var s=1.70158;var p=0;var a=c; 459 if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 460 if (a < Math.abs(c)) { a=c; var s=p/4; } 461 else var s = p/(2*Math.PI) * Math.asin (c/a); 462 return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; 463 }, 464 easeInOutElastic: function (x, t, b, c, d) { 465 var s=1.70158;var p=0;var a=c; 466 if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); 467 if (a < Math.abs(c)) { a=c; var s=p/4; } 468 else var s = p/(2*Math.PI) * Math.asin (c/a); 469 if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 470 return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; 471 }, 472 easeInBack: function (x, t, b, c, d, s) { 473 if (s == undefined) s = 1.70158; 474 return c*(t/=d)*t*((s+1)*t - s) + b; 475 }, 476 easeOutBack: function (x, t, b, c, d, s) { 477 if (s == undefined) s = 1.70158; 478 return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; 479 }, 480 easeInOutBack: function (x, t, b, c, d, s) { 481 if (s == undefined) s = 1.70158; 482 if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 483 return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 484 }, 485 easeInBounce: function (x, t, b, c, d) { 486 return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; 487 }, 488 easeOutBounce: function (x, t, b, c, d) { 489 if ((t/=d) < (1/2.75)) { 490 return c*(7.5625*t*t) + b; 491 } else if (t < (2/2.75)) { 492 return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; 493 } else if (t < (2.5/2.75)) { 494 return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; 495 } else { 496 return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; 497 } 498 }, 499 easeInOutBounce: function (x, t, b, c, d) { 500 if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; 501 return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; 502 } 503}); 504 505 506/*** 507 * BxSlider v4.2.3 - Fully loaded, responsive content slider 508 * http://bxslider.com 509 * 510 * Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com 511 * Written while drinking Belgian ales and listening to jazz 512 * 513 * Released under the MIT license - http://opensource.org/licenses/MIT 514 ***/ 515 516;(function($) { 517 518 var defaults = { 519 520 // GENERAL 521 mode: 'horizontal', 522 slideSelector: '', 523 infiniteLoop: true, 524 hideControlOnEnd: false, 525 speed: 500, 526 easing: null, 527 slideMargin: 0, 528 startSlide: 0, 529 randomStart: false, 530 captions: false, 531 ticker: false, 532 tickerHover: false, 533 adaptiveHeight: false, 534 adaptiveHeightSpeed: 500, 535 video: false, 536 useCSS: true, 537 preloadImages: 'visible', 538 responsive: true, 539 slideZIndex: 50, 540 wrapperClass: 'bx-wrapper', 541 542 // TOUCH 543 touchEnabled: true, 544 swipeThreshold: 50, 545 oneToOneTouch: true, 546 preventDefaultSwipeX: true, 547 preventDefaultSwipeY: false, 548 549 // ACCESSIBILITY 550 ariaLive: true, 551 ariaHidden: true, 552 553 // KEYBOARD 554 keyboardEnabled: false, 555 556 // PAGER 557 pager: true, 558 pagerType: 'full', 559 pagerShortSeparator: ' / ', 560 pagerSelector: null, 561 buildPager: null, 562 pagerCustom: null, 563 564 // CONTROLS 565 controls: true, 566 nextText: 'Next', 567 prevText: 'Prev', 568 nextSelector: null, 569 prevSelector: null, 570 autoControls: false, 571 startText: 'Start', 572 stopText: 'Stop', 573 autoControlsCombine: false, 574 autoControlsSelector: null, 575 576 // AUTO 577 auto: false, 578 pause: 4000, 579 autoStart: true, 580 autoDirection: 'next', 581 stopAutoOnClick: false, 582 autoHover: false, 583 autoDelay: 0, 584 autoSlideForOnePage: false, 585 586 // CAROUSEL 587 minSlides: 1, 588 maxSlides: 1, 589 moveSlides: 0, 590 slideWidth: 0, 591 shrinkItems: false, 592 593 // CALLBACKS 594 onSliderLoad: function() { return true; }, 595 onSlideBefore: function() { return true; }, 596 onSlideAfter: function() { return true; }, 597 onSlideNext: function() { return true; }, 598 onSlidePrev: function() { return true; }, 599 onSliderResize: function() { return true; } 600 }; 601 602 $.fn.bxSlider = function(options) { 603 604 if (this.length === 0) { 605 return this; 606 } 607 608 // support multiple elements 609 if (this.length > 1) { 610 this.each(function() { 611 $(this).bxSlider(options); 612 }); 613 return this; 614 } 615 616 // create a namespace to be used throughout the plugin 617 var slider = {}, 618 // set a reference to our slider element 619 el = this, 620 // get the original window dimens (thanks a lot IE) 621 windowWidth = $(window).width(), 622 windowHeight = $(window).height(); 623 624 // Return if slider is already initialized 625 if ($(el).data('bxSlider')) { return; } 626 627 /** 628 * =================================================================================== 629 * = PRIVATE FUNCTIONS 630 * =================================================================================== 631 */ 632 633 /** 634 * Initializes namespace settings to be used throughout plugin 635 */ 636 var init = function() { 637 // Return if slider is already initialized 638 if ($(el).data('bxSlider')) { return; } 639 // merge user-supplied options with the defaults 640 slider.settings = $.extend({}, defaults, options); 641 // parse slideWidth setting 642 slider.settings.slideWidth = parseInt(slider.settings.slideWidth); 643 // store the original children 644 slider.children = el.children(slider.settings.slideSelector); 645 // check if actual number of slides is less than minSlides / maxSlides 646 if (slider.children.length < slider.settings.minSlides) { slider.settings.minSlides = slider.children.length; } 647 if (slider.children.length < slider.settings.maxSlides) { slider.settings.maxSlides = slider.children.length; } 648 // if random start, set the startSlide setting to random number 649 if (slider.settings.randomStart) { slider.settings.startSlide = Math.floor(Math.random() * slider.children.length); } 650 // store active slide information 651 slider.active = { index: slider.settings.startSlide };
vendor: 26,033 bytes, lines 652-1212
652 // store if the slider is in carousel mode (displaying / moving multiple slides) 653 slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1 ? true : false; 654 // if carousel, force preloadImages = 'all' 655 if (slider.carousel) { slider.settings.preloadImages = 'all'; } 656 // calculate the min / max width thresholds based on min / max number of slides 657 // used to setup and update carousel slides dimensions 658 slider.minThreshold = (slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin); 659 slider.maxThreshold = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin); 660 // store the current state of the slider (if currently animating, working is true) 661 slider.working = false; 662 // initialize the controls object 663 slider.controls = {}; 664 // initialize an auto interval 665 slider.interval = null; 666 // determine which property to use for transitions 667 slider.animProp = slider.settings.mode === 'vertical' ? 'top' : 'left'; 668 // determine if hardware acceleration can be used 669 slider.usingCSS = slider.settings.useCSS && slider.settings.mode !== 'fade' && (function() { 670 // create our test div element 671 var div = document.createElement('div'), 672 // css transition properties 673 props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective']; 674 // test for each property 675 for (var i = 0; i < props.length; i++) { 676 if (div.style[props[i]] !== undefined) { 677 slider.cssPrefix = props[i].replace('Perspective', '').toLowerCase(); 678 slider.animProp = '-' + slider.cssPrefix + '-transform'; 679 return true; 680 } 681 } 682 return false; 683 }()); 684 // if vertical mode always make maxSlides and minSlides equal 685 if (slider.settings.mode === 'vertical') { slider.settings.maxSlides = slider.settings.minSlides; } 686 // save original style data 687 el.data('origStyle', el.attr('style')); 688 el.children(slider.settings.slideSelector).each(function() { 689 $(this).data('origStyle', $(this).attr('style')); 690 }); 691 692 // perform all DOM / CSS modifications 693 setup(); 694 }; 695 696 /** 697 * Performs all DOM and CSS modifications 698 */ 699 var setup = function() { 700 var preloadSelector = slider.children.eq(slider.settings.startSlide); // set the default preload selector (visible) 701 702 // wrap el in a wrapper 703 el.wrap('<div class="' + slider.settings.wrapperClass + '"><div class="bx-viewport"></div></div>'); 704 // store a namespace reference to .bx-viewport 705 slider.viewport = el.parent(); 706 707 // add aria-live if the setting is enabled and ticker mode is disabled 708 if (slider.settings.ariaLive && !slider.settings.ticker) { 709 slider.viewport.attr('aria-live', 'polite'); 710 } 711 // add a loading div to display while images are loading 712 slider.loader = $('<div class="bx-loading" />'); 713 slider.viewport.prepend(slider.loader); 714 // set el to a massive width, to hold any needed slides 715 // also strip any margin and padding from el 716 el.css({ 717 width: slider.settings.mode === 'horizontal' ? (slider.children.length * 1000 + 215) + '%' : 'auto', 718 position: 'relative' 719 }); 720 // if using CSS, add the easing property 721 if (slider.usingCSS && slider.settings.easing) { 722 el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing); 723 // if not using CSS and no easing value was supplied, use the default JS animation easing (swing) 724 } else if (!slider.settings.easing) { 725 slider.settings.easing = 'swing'; 726 } 727 // make modifications to the viewport (.bx-viewport) 728 slider.viewport.css({ 729 width: '100%', 730 overflow: 'hidden', 731 position: 'relative' 732 }); 733 slider.viewport.parent().css({ 734 maxWidth: getViewportMaxWidth() 735 }); 736 // make modification to the wrapper (.bx-wrapper) 737 if (!slider.settings.pager && !slider.settings.controls) { 738 slider.viewport.parent().css({ 739 margin: '0 auto 0px' 740 }); 741 } 742 // apply css to all slider children 743 slider.children.css({ 744 float: slider.settings.mode === 'horizontal' ? 'left' : 'none', 745 listStyle: 'none', 746 position: 'relative' 747 }); 748 // apply the calculated width after the float is applied to prevent scrollbar interference 749 slider.children.css('width', getSlideWidth()); 750 // if slideMargin is supplied, add the css 751 if (slider.settings.mode === 'horizontal' && slider.settings.slideMargin > 0) { slider.children.css('marginRight', slider.settings.slideMargin); } 752 if (slider.settings.mode === 'vertical' && slider.settings.slideMargin > 0) { slider.children.css('marginBottom', slider.settings.slideMargin); } 753 // if "fade" mode, add positioning and z-index CSS 754 if (slider.settings.mode === 'fade') { 755 slider.children.css({ 756 position: 'absolute', 757 zIndex: 0, 758 display: 'none' 759 }); 760 // prepare the z-index on the showing element 761 slider.children.eq(slider.settings.startSlide).css({zIndex: slider.settings.slideZIndex, display: 'block'}); 762 } 763 // create an element to contain all slider controls (pager, start / stop, etc) 764 slider.controls.el = $('<div class="bx-controls" />'); 765 // if captions are requested, add them 766 if (slider.settings.captions) { appendCaptions(); } 767 // check if startSlide is last slide 768 slider.active.last = slider.settings.startSlide === getPagerQty() - 1; 769 // if video is true, set up the fitVids plugin 770 if (slider.settings.video) { el.fitVids(); } 771 if (slider.settings.preloadImages === 'all' || slider.settings.ticker) { preloadSelector = slider.children; } 772 // only check for control addition if not in "ticker" mode 773 if (!slider.settings.ticker) { 774 // if controls are requested, add them 775 if (slider.settings.controls) { appendControls(); } 776 // if auto is true, and auto controls are requested, add them 777 if (slider.settings.auto && slider.settings.autoControls) { appendControlsAuto(); } 778 // if pager is requested, add it 779 if (slider.settings.pager) { appendPager(); } 780 // if any control option is requested, add the controls wrapper 781 if (slider.settings.controls || slider.settings.autoControls || slider.settings.pager) { slider.viewport.after(slider.controls.el); } 782 // if ticker mode, do not allow a pager 783 } else { 784 slider.settings.pager = false; 785 } 786 loadElements(preloadSelector, start); 787 }; 788 789 var loadElements = function(selector, callback) { 790 var total = selector.find('img:not([src=""]), iframe').length, 791 count = 0; 792 if (total === 0) { 793 callback(); 794 return; 795 } 796 selector.find('img:not([src=""]), iframe').each(function() { 797 $(this).one('load error', function() { 798 if (++count === total) { callback(); } 799 }).each(function() { 800 if (this.complete) { $(this).load(); } 801 }); 802 }); 803 }; 804 805 /** 806 * Start the slider 807 */ 808 var start = function() { 809 // if infinite loop, prepare additional slides 810 if (slider.settings.infiniteLoop && slider.settings.mode !== 'fade' && !slider.settings.ticker) { 811 var slice = slider.settings.mode === 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides, 812 sliceAppend = slider.children.slice(0, slice).clone(true).addClass('bx-clone'), 813 slicePrepend = slider.children.slice(-slice).clone(true).addClass('bx-clone'); 814 if (slider.settings.ariaHidden) { 815 sliceAppend.attr('aria-hidden', true); 816 slicePrepend.attr('aria-hidden', true); 817 } 818 el.append(sliceAppend).prepend(slicePrepend); 819 } 820 // remove the loading DOM element 821 slider.loader.remove(); 822 // set the left / top position of "el" 823 setSlidePosition(); 824 // if "vertical" mode, always use adaptiveHeight to prevent odd behavior 825 if (slider.settings.mode === 'vertical') { slider.settings.adaptiveHeight = true; } 826 // set the viewport height 827 slider.viewport.height(getViewportHeight()); 828 // make sure everything is positioned just right (same as a window resize) 829 el.redrawSlider(); 830 // onSliderLoad callback 831 slider.settings.onSliderLoad.call(el, slider.active.index); 832 // slider has been fully initialized 833 slider.initialized = true; 834 // bind the resize call to the window 835 if (slider.settings.responsive) { $(window).bind('resize', resizeWindow); } 836 // if auto is true and has more than 1 page, start the show 837 if (slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)) { initAuto(); } 838 // if ticker is true, start the ticker 839 if (slider.settings.ticker) { initTicker(); } 840 // if pager is requested, make the appropriate pager link active 841 if (slider.settings.pager) { updatePagerActive(slider.settings.startSlide); } 842 // check for any updates to the controls (like hideControlOnEnd updates) 843 if (slider.settings.controls) { updateDirectionControls(); } 844 // if touchEnabled is true, setup the touch events 845 if (slider.settings.touchEnabled && !slider.settings.ticker) { initTouch(); } 846 // if keyboardEnabled is true, setup the keyboard events 847 if (slider.settings.keyboardEnabled && !slider.settings.ticker) { 848 $(document).keydown(keyPress); 849 } 850 }; 851 852 /** 853 * Returns the calculated height of the viewport, used to determine either adaptiveHeight or the maxHeight value 854 */ 855 var getViewportHeight = function() { 856 var height = 0; 857 // first determine which children (slides) should be used in our height calculation 858 var children = $(); 859 // if mode is not "vertical" and adaptiveHeight is false, include all children 860 if (slider.settings.mode !== 'vertical' && !slider.settings.adaptiveHeight) { 861 children = slider.children; 862 } else { 863 // if not carousel, return the single active child 864 if (!slider.carousel) { 865 children = slider.children.eq(slider.active.index); 866 // if carousel, return a slice of children 867 } else { 868 // get the individual slide index 869 var currentIndex = slider.settings.moveSlides === 1 ? slider.active.index : slider.active.index * getMoveBy(); 870 // add the current slide to the children 871 children = slider.children.eq(currentIndex); 872 // cycle through the remaining "showing" slides 873 for (i = 1; i <= slider.settings.maxSlides - 1; i++) { 874 // if looped back to the start 875 if (currentIndex + i >= slider.children.length) { 876 children = children.add(slider.children.eq(i - 1)); 877 } else { 878 children = children.add(slider.children.eq(currentIndex + i)); 879 } 880 } 881 } 882 } 883 // if "vertical" mode, calculate the sum of the heights of the children 884 if (slider.settings.mode === 'vertical') { 885 children.each(function(index) { 886 height += $(this).outerHeight(); 887 }); 888 // add user-supplied margins 889 if (slider.settings.slideMargin > 0) { 890 height += slider.settings.slideMargin * (slider.settings.minSlides - 1); 891 } 892 // if not "vertical" mode, calculate the max height of the children 893 } else { 894 height = Math.max.apply(Math, children.map(function() { 895 return $(this).outerHeight(false); 896 }).get()); 897 } 898 899 if (slider.viewport.css('box-sizing') === 'border-box') { 900 height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) + 901 parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width')); 902 } else if (slider.viewport.css('box-sizing') === 'padding-box') { 903 height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')); 904 } 905 906 return height; 907 }; 908 909 /** 910 * Returns the calculated width to be used for the outer wrapper / viewport 911 */ 912 var getViewportMaxWidth = function() { 913 var width = '100%'; 914 if (slider.settings.slideWidth > 0) { 915 if (slider.settings.mode === 'horizontal') { 916 width = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin); 917 } else { 918 width = slider.settings.slideWidth; 919 } 920 } 921 return width; 922 }; 923 924 /** 925 * Returns the calculated width to be applied to each slide 926 */ 927 var getSlideWidth = function() { 928 var newElWidth = slider.settings.slideWidth, // start with any user-supplied slide width 929 wrapWidth = slider.viewport.width(); // get the current viewport width 930 // if slide width was not supplied, or is larger than the viewport use the viewport width 931 if (slider.settings.slideWidth === 0 || 932 (slider.settings.slideWidth > wrapWidth && !slider.carousel) || 933 slider.settings.mode === 'vertical') { 934 newElWidth = wrapWidth; 935 // if carousel, use the thresholds to determine the width 936 } else if (slider.settings.maxSlides > 1 && slider.settings.mode === 'horizontal') { 937 if (wrapWidth > slider.maxThreshold) { 938 return newElWidth; 939 } else if (wrapWidth < slider.minThreshold) { 940 newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.minSlides - 1))) / slider.settings.minSlides; 941 } else if (slider.settings.shrinkItems) { 942 newElWidth = Math.floor((wrapWidth + slider.settings.slideMargin) / (Math.ceil((wrapWidth + slider.settings.slideMargin) / (newElWidth + slider.settings.slideMargin))) - slider.settings.slideMargin); 943 } 944 } 945 return newElWidth; 946 }; 947 948 /** 949 * Returns the number of slides currently visible in the viewport (includes partially visible slides) 950 */ 951 var getNumberSlidesShowing = function() { 952 var slidesShowing = 1, 953 childWidth = null; 954 if (slider.settings.mode === 'horizontal' && slider.settings.slideWidth > 0) { 955 // if viewport is smaller than minThreshold, return minSlides 956 if (slider.viewport.width() < slider.minThreshold) { 957 slidesShowing = slider.settings.minSlides; 958 // if viewport is larger than maxThreshold, return maxSlides 959 } else if (slider.viewport.width() > slider.maxThreshold) { 960 slidesShowing = slider.settings.maxSlides; 961 // if viewport is between min / max thresholds, divide viewport width by first child width 962 } else { 963 childWidth = slider.children.first().width() + slider.settings.slideMargin; 964 slidesShowing = Math.floor((slider.viewport.width() + 965 slider.settings.slideMargin) / childWidth); 966 } 967 // if "vertical" mode, slides showing will always be minSlides 968 } else if (slider.settings.mode === 'vertical') { 969 slidesShowing = slider.settings.minSlides; 970 } 971 return slidesShowing; 972 }; 973 974 /** 975 * Returns the number of pages (one full viewport of slides is one "page") 976 */ 977 var getPagerQty = function() { 978 var pagerQty = 0, 979 breakPoint = 0, 980 counter = 0; 981 // if moveSlides is specified by the user 982 if (slider.settings.moveSlides > 0) { 983 if (slider.settings.infiniteLoop) { 984 pagerQty = Math.ceil(slider.children.length / getMoveBy()); 985 } else { 986 // when breakpoint goes above children length, counter is the number of pages 987 while (breakPoint < slider.children.length) { 988 ++pagerQty; 989 breakPoint = counter + getNumberSlidesShowing(); 990 counter += slider.settings.moveSlides <= getNumberSlidesShowing() ? slider.settings.moveSlides : getNumberSlidesShowing(); 991 } 992 } 993 // if moveSlides is 0 (auto) divide children length by sides showing, then round up 994 } else { 995 pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing()); 996 } 997 return pagerQty; 998 }; 999 1000 /** 1001 * Returns the number of individual slides by which to shift the slider 1002 */ 1003 var getMoveBy = function() { 1004 // if moveSlides was set by the user and moveSlides is less than number of slides showing 1005 if (slider.settings.moveSlides > 0 && slider.settings.moveSlides <= getNumberSlidesShowing()) { 1006 return slider.settings.moveSlides; 1007 } 1008 // if moveSlides is 0 (auto) 1009 return getNumberSlidesShowing(); 1010 }; 1011 1012 /** 1013 * Sets the slider's (el) left or top position 1014 */ 1015 var setSlidePosition = function() { 1016 var position, lastChild, lastShowingIndex; 1017 // if last slide, not infinite loop, and number of children is larger than specified maxSlides 1018 if (slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop) { 1019 if (slider.settings.mode === 'horizontal') { 1020 // get the last child's position 1021 lastChild = slider.children.last(); 1022 position = lastChild.position(); 1023 // set the left position 1024 setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.outerWidth())), 'reset', 0); 1025 } else if (slider.settings.mode === 'vertical') { 1026 // get the last showing index's position 1027 lastShowingIndex = slider.children.length - slider.settings.minSlides; 1028 position = slider.children.eq(lastShowingIndex).position(); 1029 // set the top position 1030 setPositionProperty(-position.top, 'reset', 0); 1031 } 1032 // if not last slide 1033 } else { 1034 // get the position of the first showing slide 1035 position = slider.children.eq(slider.active.index * getMoveBy()).position(); 1036 // check for last slide 1037 if (slider.active.index === getPagerQty() - 1) { slider.active.last = true; } 1038 // set the respective position 1039 if (position !== undefined) { 1040 if (slider.settings.mode === 'horizontal') { setPositionProperty(-position.left, 'reset', 0); } 1041 else if (slider.settings.mode === 'vertical') { setPositionProperty(-position.top, 'reset', 0); } 1042 } 1043 } 1044 }; 1045 1046 /** 1047 * Sets the el's animating property position (which in turn will sometimes animate el). 1048 * If using CSS, sets the transform property. If not using CSS, sets the top / left property. 1049 * 1050 * @param value (int) 1051 * - the animating property's value 1052 * 1053 * @param type (string) 'slide', 'reset', 'ticker' 1054 * - the type of instance for which the function is being 1055 * 1056 * @param duration (int) 1057 * - the amount of time (in ms) the transition should occupy 1058 * 1059 * @param params (array) optional 1060 * - an optional parameter containing any variables that need to be passed in 1061 */ 1062 var setPositionProperty = function(value, type, duration, params) { 1063 var animateObj, propValue; 1064 // use CSS transform 1065 if (slider.usingCSS) { 1066 // determine the translate3d value 1067 propValue = slider.settings.mode === 'vertical' ? 'translate3d(0, ' + value + 'px, 0)' : 'translate3d(' + value + 'px, 0, 0)'; 1068 // add the CSS transition-duration 1069 el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's'); 1070 if (type === 'slide') { 1071 // set the property value 1072 el.css(slider.animProp, propValue); 1073 if (duration !== 0) { 1074 // bind a callback method - executes when CSS transition completes 1075 el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(e) { 1076 //make sure it's the correct one 1077 if (!$(e.target).is(el)) { return; } 1078 // unbind the callback 1079 el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd'); 1080 updateAfterSlideTransition(); 1081 }); 1082 } else { //duration = 0 1083 updateAfterSlideTransition(); 1084 } 1085 } else if (type === 'reset') { 1086 el.css(slider.animProp, propValue); 1087 } else if (type === 'ticker') { 1088 // make the transition use 'linear' 1089 el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear'); 1090 el.css(slider.animProp, propValue); 1091 if (duration !== 0) { 1092 el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(e) { 1093 //make sure it's the correct one 1094 if (!$(e.target).is(el)) { return; } 1095 // unbind the callback 1096 el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd'); 1097 // reset the position 1098 setPositionProperty(params.resetValue, 'reset', 0); 1099 // start the loop again 1100 tickerLoop(); 1101 }); 1102 } else { //duration = 0 1103 setPositionProperty(params.resetValue, 'reset', 0); 1104 tickerLoop(); 1105 } 1106 } 1107 // use JS animate 1108 } else { 1109 animateObj = {}; 1110 animateObj[slider.animProp] = value; 1111 if (type === 'slide') { 1112 el.animate(animateObj, duration, slider.settings.easing, function() { 1113 updateAfterSlideTransition(); 1114 }); 1115 } else if (type === 'reset') { 1116 el.css(slider.animProp, value); 1117 } else if (type === 'ticker') { 1118 el.animate(animateObj, duration, 'linear', function() { 1119 setPositionProperty(params.resetValue, 'reset', 0); 1120 // run the recursive loop after animation 1121 tickerLoop(); 1122 }); 1123 } 1124 } 1125 }; 1126 1127 /** 1128 * Populates the pager with proper amount of pages 1129 */ 1130 var populatePager = function() { 1131 var pagerHtml = '', 1132 linkContent = '', 1133 pagerQty = getPagerQty(); 1134 // loop through each pager item 1135 for (var i = 0; i < pagerQty; i++) { 1136 linkContent = ''; 1137 // if a buildPager function is supplied, use it to get pager link value, else use index + 1 1138 if (slider.settings.buildPager && $.isFunction(slider.settings.buildPager) || slider.settings.pagerCustom) { 1139 linkContent = slider.settings.buildPager(i); 1140 slider.pagerEl.addClass('bx-custom-pager'); 1141 } else { 1142 linkContent = i + 1; 1143 slider.pagerEl.addClass('bx-default-pager'); 1144 } 1145 // var linkContent = slider.settings.buildPager && $.isFunction(slider.settings.buildPager) ? slider.settings.buildPager(i) : i + 1; 1146 // add the markup to the string 1147 pagerHtml += '<div class="bx-pager-item"><a href="" data-slide-index="' + i + '" class="bx-pager-link">' + linkContent + '</a></div>'; 1148 } 1149 // populate the pager element with pager links 1150 slider.pagerEl.html(pagerHtml); 1151 }; 1152 1153 /** 1154 * Appends the pager to the controls element 1155 */ 1156 var appendPager = function() { 1157 if (!slider.settings.pagerCustom) { 1158 // create the pager DOM element 1159 slider.pagerEl = $('<div class="bx-pager" />'); 1160 // if a pager selector was supplied, populate it with the pager 1161 if (slider.settings.pagerSelector) { 1162 $(slider.settings.pagerSelector).html(slider.pagerEl); 1163 // if no pager selector was supplied, add it after the wrapper 1164 } else { 1165 slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl); 1166 } 1167 // populate the pager 1168 populatePager(); 1169 } else { 1170 slider.pagerEl = $(slider.settings.pagerCustom); 1171 } 1172 // assign the pager click binding 1173 slider.pagerEl.on('click touchend', 'a', clickPagerBind); 1174 }; 1175 1176 /** 1177 * Appends prev / next controls to the controls element 1178 */ 1179 var appendControls = function() { 1180 slider.controls.next = $('<a class="bx-next" href="">' + slider.settings.nextText + '</a>'); 1181 slider.controls.prev = $('<a class="bx-prev" href="">' + slider.settings.prevText + '</a>'); 1182 // bind click actions to the controls 1183 slider.controls.next.bind('click touchend', clickNextBind); 1184 slider.controls.prev.bind('click touchend', clickPrevBind); 1185 // if nextSelector was supplied, populate it 1186 if (slider.settings.nextSelector) { 1187 $(slider.settings.nextSelector).append(slider.controls.next); 1188 } 1189 // if prevSelector was supplied, populate it 1190 if (slider.settings.prevSelector) { 1191 $(slider.settings.prevSelector).append(slider.controls.prev); 1192 } 1193 // if no custom selectors were supplied 1194 if (!slider.settings.nextSelector && !slider.settings.prevSelector) { 1195 // add the controls to the DOM 1196 slider.controls.directionEl = $('<div class="bx-controls-direction" />'); 1197 // add the control elements to the directionEl 1198 slider.controls.directionEl.append(slider.controls.prev).append(slider.controls.next); 1199 // slider.viewport.append(slider.controls.directionEl); 1200 slider.controls.el.addClass('bx-has-controls-direction').append(slider.controls.directionEl); 1201 } 1202 }; 1203 1204 /** 1205 * Appends start / stop auto controls to the controls element 1206 */ 1207 var appendControlsAuto = function() { 1208 slider.controls.start = $('<div class="bx-controls-auto-item"><a class="bx-start" href="">' + slider.settings.startText + '</a></div>'); 1209 slider.controls.stop = $('<div class="bx-controls-auto-item"><a class="bx-stop" href="">' + slider.settings.stopText + '</a></div>'); 1210 // add the controls to the DOM 1211 slider.controls.autoEl = $('<div class="bx-controls-auto" />'); 1212 // bind
vendor: 7,154 bytes, lines 1212-1410
1212 click actions to the controls 1213 slider.controls.autoEl.on('click', '.bx-start', clickStartBind); 1214 slider.controls.autoEl.on('click', '.bx-stop', clickStopBind); 1215 // if autoControlsCombine, insert only the "start" control 1216 if (slider.settings.autoControlsCombine) { 1217 slider.controls.autoEl.append(slider.controls.start); 1218 // if autoControlsCombine is false, insert both controls 1219 } else { 1220 slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop); 1221 } 1222 // if auto controls selector was supplied, populate it with the controls 1223 if (slider.settings.autoControlsSelector) { 1224 $(slider.settings.autoControlsSelector).html(slider.controls.autoEl); 1225 // if auto controls selector was not supplied, add it after the wrapper 1226 } else { 1227 slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl); 1228 } 1229 // update the auto controls 1230 updateAutoControls(slider.settings.autoStart ? 'stop' : 'start'); 1231 }; 1232 1233 /** 1234 * Appends image captions to the DOM 1235 */ 1236 var appendCaptions = function() { 1237 // cycle through each child 1238 slider.children.each(function(index) { 1239 // get the image title attribute 1240 var title = $(this).find('img:first').attr('title'); 1241 // append the caption 1242 if (title !== undefined && ('' + title).length) { 1243 $(this).append('<div class="bx-caption"><span>' + title + '</span></div>'); 1244 } 1245 }); 1246 }; 1247 1248 /** 1249 * Click next binding 1250 * 1251 * @param e (event) 1252 * - DOM event object 1253 */ 1254 var clickNextBind = function(e) { 1255 e.preventDefault(); 1256 if (slider.controls.el.hasClass('disabled')) { return; } 1257 // if auto show is running, stop it 1258 if (slider.settings.auto && slider.settings.stopAutoOnClick) { el.stopAuto(); } 1259 el.goToNextSlide(); 1260 }; 1261 1262 /** 1263 * Click prev binding 1264 * 1265 * @param e (event) 1266 * - DOM event object 1267 */ 1268 var clickPrevBind = function(e) { 1269 e.preventDefault(); 1270 if (slider.controls.el.hasClass('disabled')) { return; } 1271 // if auto show is running, stop it 1272 if (slider.settings.auto && slider.settings.stopAutoOnClick) { el.stopAuto(); } 1273 el.goToPrevSlide(); 1274 }; 1275 1276 /** 1277 * Click start binding 1278 * 1279 * @param e (event) 1280 * - DOM event object 1281 */ 1282 var clickStartBind = function(e) { 1283 el.startAuto(); 1284 e.preventDefault(); 1285 }; 1286 1287 /** 1288 * Click stop binding 1289 * 1290 * @param e (event) 1291 * - DOM event object 1292 */ 1293 var clickStopBind = function(e) { 1294 el.stopAuto(); 1295 e.preventDefault(); 1296 }; 1297 1298 /** 1299 * Click pager binding 1300 * 1301 * @param e (event) 1302 * - DOM event object 1303 */ 1304 var clickPagerBind = function(e) { 1305 var pagerLink, pagerIndex; 1306 e.preventDefault(); 1307 if (slider.controls.el.hasClass('disabled')) { 1308 return; 1309 } 1310 // if auto show is running, stop it 1311 if (slider.settings.auto && slider.settings.stopAutoOnClick) { el.stopAuto(); } 1312 pagerLink = $(e.currentTarget); 1313 if (pagerLink.attr('data-slide-index') !== undefined) { 1314 pagerIndex = parseInt(pagerLink.attr('data-slide-index')); 1315 // if clicked pager link is not active, continue with the goToSlide call 1316 if (pagerIndex !== slider.active.index) { el.goToSlide(pagerIndex); } 1317 } 1318 }; 1319 1320 /** 1321 * Updates the pager links with an active class 1322 * 1323 * @param slideIndex (int) 1324 * - index of slide to make active 1325 */ 1326 var updatePagerActive = function(slideIndex) { 1327 // if "short" pager type 1328 var len = slider.children.length; // nb of children 1329 if (slider.settings.pagerType === 'short') { 1330 if (slider.settings.maxSlides > 1) { 1331 len = Math.ceil(slider.children.length / slider.settings.maxSlides); 1332 } 1333 slider.pagerEl.html((slideIndex + 1) + slider.settings.pagerShortSeparator + len); 1334 return; 1335 } 1336 // remove all pager active classes 1337 slider.pagerEl.find('a').removeClass('active'); 1338 // apply the active class for all pagers 1339 slider.pagerEl.each(function(i, el) { $(el).find('a').eq(slideIndex).addClass('active'); }); 1340 }; 1341 1342 /** 1343 * Performs needed actions after a slide transition 1344 */ 1345 var updateAfterSlideTransition = function() { 1346 // if infinite loop is true 1347 if (slider.settings.infiniteLoop) { 1348 var position = ''; 1349 // first slide 1350 if (slider.active.index === 0) { 1351 // set the new position 1352 position = slider.children.eq(0).position(); 1353 // carousel, last slide 1354 } else if (slider.active.index === getPagerQty() - 1 && slider.carousel) { 1355 position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position(); 1356 // last slide 1357 } else if (slider.active.index === slider.children.length - 1) { 1358 position = slider.children.eq(slider.children.length - 1).position(); 1359 } 1360 if (position) { 1361 if (slider.settings.mode === 'horizontal') { setPositionProperty(-position.left, 'reset', 0); } 1362 else if (slider.settings.mode === 'vertical') { setPositionProperty(-position.top, 'reset', 0); } 1363 } 1364 } 1365 // declare that the transition is complete 1366 slider.working = false; 1367 // onSlideAfter callback 1368 slider.settings.onSlideAfter.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index); 1369 }; 1370 1371 /** 1372 * Updates the auto controls state (either active, or combined switch) 1373 * 1374 * @param state (string) "start", "stop" 1375 * - the new state of the auto show 1376 */ 1377 var updateAutoControls = function(state) { 1378 // if autoControlsCombine is true, replace the current control with the new state 1379 if (slider.settings.autoControlsCombine) { 1380 slider.controls.autoEl.html(slider.controls[state]); 1381 // if autoControlsCombine is false, apply the "active" class to the appropriate control 1382 } else { 1383 slider.controls.autoEl.find('a').removeClass('active'); 1384 slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active'); 1385 } 1386 }; 1387 1388 /** 1389 * Updates the direction controls (checks if either should be hidden) 1390 */ 1391 var updateDirectionControls = function() { 1392 if (getPagerQty() === 1) { 1393 slider.controls.prev.addClass('disabled'); 1394 slider.controls.next.addClass('disabled'); 1395 } else if (!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd) { 1396 // if first slide 1397 if (slider.active.index === 0) { 1398 slider.controls.prev.addClass('disabled'); 1399 slider.controls.next.removeClass('disabled'); 1400 // if last slide 1401 } else if (slider.active.index === getPagerQty() - 1) { 1402 slider.controls.next.addClass('disabled'); 1403 slider.controls.prev.removeClass('disabled'); 1404 // if any slide in the middle 1405 } else { 1406 slider.controls.prev.removeClass('disabled'); 1407 slider.controls.next.removeClass('disabled'); 1408 } 1409 } 1410 };
1411 1412 /** 1413 * Initializes the auto process 1414 */ 1415 var initAuto = function() { 1416 // if autoDelay was supplied, launch the auto show using a setTimeout() call 1417 if (slider.settings.autoDelay > 0) { 1418 var timeout = setTimeout(el.startAuto, slider.settings.autoDelay); 1419 // if autoDelay was not supplied, start the auto show normally 1420 } else { 1421 el.startAuto(); 1422 1423 //add focus and blur events to ensure its running if timeout gets paused 1424 $(window).focus(function() { 1425 el.startAuto(); 1426 }).blur(function() { 1427 el.stopAuto(); 1428 }
vendor: 6,234 bytes, lines 1428-1588
1428); 1429 } 1430 // if autoHover is requested 1431 if (slider.settings.autoHover) { 1432 // on el hover 1433 el.hover(function() { 1434 // if the auto show is currently playing (has an active interval) 1435 if (slider.interval) { 1436 // stop the auto show and pass true argument which will prevent control update 1437 el.stopAuto(true); 1438 // create a new autoPaused value which will be used by the relative "mouseout" event 1439 slider.autoPaused = true; 1440 } 1441 }, function() { 1442 // if the autoPaused value was created be the prior "mouseover" event 1443 if (slider.autoPaused) { 1444 // start the auto show and pass true argument which will prevent control update 1445 el.startAuto(true); 1446 // reset the autoPaused value 1447 slider.autoPaused = null; 1448 } 1449 }); 1450 } 1451 }; 1452 1453 /** 1454 * Initializes the ticker process 1455 */ 1456 var initTicker = function() { 1457 var startPosition = 0, 1458 position, transform, value, idx, ratio, property, newSpeed, totalDimens; 1459 // if autoDirection is "next", append a clone of the entire slider 1460 if (slider.settings.autoDirection === 'next') { 1461 el.append(slider.children.clone().addClass('bx-clone')); 1462 // if autoDirection is "prev", prepend a clone of the entire slider, and set the left position 1463 } else { 1464 el.prepend(slider.children.clone().addClass('bx-clone')); 1465 position = slider.children.first().position(); 1466 startPosition = slider.settings.mode === 'horizontal' ? -position.left : -position.top; 1467 } 1468 setPositionProperty(startPosition, 'reset', 0); 1469 // do not allow controls in ticker mode 1470 slider.settings.pager = false; 1471 slider.settings.controls = false; 1472 slider.settings.autoControls = false; 1473 // if autoHover is requested 1474 if (slider.settings.tickerHover) { 1475 if (slider.usingCSS) { 1476 idx = slider.settings.mode === 'horizontal' ? 4 : 5; 1477 slider.viewport.hover(function() { 1478 transform = el.css('-' + slider.cssPrefix + '-transform'); 1479 value = parseFloat(transform.split(',')[idx]); 1480 setPositionProperty(value, 'reset', 0); 1481 }, function() { 1482 totalDimens = 0; 1483 slider.children.each(function(index) { 1484 totalDimens += slider.settings.mode === 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true); 1485 }); 1486 // calculate the speed ratio (used to determine the new speed to finish the paused animation) 1487 ratio = slider.settings.speed / totalDimens; 1488 // determine which property to use 1489 property = slider.settings.mode === 'horizontal' ? 'left' : 'top'; 1490 // calculate the new speed 1491 newSpeed = ratio * (totalDimens - (Math.abs(parseInt(value)))); 1492 tickerLoop(newSpeed); 1493 }); 1494 } else { 1495 // on el hover 1496 slider.viewport.hover(function() { 1497 el.stop(); 1498 }, function() { 1499 // calculate the total width of children (used to calculate the speed ratio) 1500 totalDimens = 0; 1501 slider.children.each(function(index) { 1502 totalDimens += slider.settings.mode === 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true); 1503 }); 1504 // calculate the speed ratio (used to determine the new speed to finish the paused animation) 1505 ratio = slider.settings.speed / totalDimens; 1506 // determine which property to use 1507 property = slider.settings.mode === 'horizontal' ? 'left' : 'top'; 1508 // calculate the new speed 1509 newSpeed = ratio * (totalDimens - (Math.abs(parseInt(el.css(property))))); 1510 tickerLoop(newSpeed); 1511 }); 1512 } 1513 } 1514 // start the ticker loop 1515 tickerLoop(); 1516 }; 1517 1518 /** 1519 * Runs a continuous loop, news ticker-style 1520 */ 1521 var tickerLoop = function(resumeSpeed) { 1522 var speed = resumeSpeed ? resumeSpeed : slider.settings.speed, 1523 position = {left: 0, top: 0}, 1524 reset = {left: 0, top: 0}, 1525 animateProperty, resetValue, params; 1526 1527 // if "next" animate left position to last child, then reset left to 0 1528 if (slider.settings.autoDirection === 'next') { 1529 position = el.find('.bx-clone').first().position(); 1530 // if "prev" animate left position to 0, then reset left to first non-clone child 1531 } else { 1532 reset = slider.children.first().position(); 1533 } 1534 animateProperty = slider.settings.mode === 'horizontal' ? -position.left : -position.top; 1535 resetValue = slider.settings.mode === 'horizontal' ? -reset.left : -reset.top; 1536 params = {resetValue: resetValue}; 1537 setPositionProperty(animateProperty, 'ticker', speed, params); 1538 }; 1539 1540 /** 1541 * Check if el is on screen 1542 */ 1543 var isOnScreen = function(el) { 1544 var win = $(window), 1545 viewport = { 1546 top: win.scrollTop(), 1547 left: win.scrollLeft() 1548 }, 1549 bounds = el.offset(); 1550 1551 viewport.right = viewport.left + win.width(); 1552 viewport.bottom = viewport.top + win.height(); 1553 bounds.right = bounds.left + el.outerWidth(); 1554 bounds.bottom = bounds.top + el.outerHeight(); 1555 1556 return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom)); 1557 }; 1558 1559 /** 1560 * Initializes keyboard events 1561 */ 1562 var keyPress = function(e) { 1563 var activeElementTag = document.activeElement.tagName.toLowerCase(), 1564 tagFilters = 'input|textarea', 1565 p = new RegExp(activeElementTag,['i']), 1566 result = p.exec(tagFilters); 1567 1568 if (result == null && isOnScreen(el)) { 1569 if (e.keyCode === 39) { 1570 clickNextBind(e); 1571 return false; 1572 } else if (e.keyCode === 37) { 1573 clickPrevBind(e); 1574 return false; 1575 } 1576 } 1577 }; 1578 1579 /** 1580 * Initializes touch events 1581 */ 1582 var initTouch = function() { 1583 // initialize object to contain all touch values 1584 slider.touch = { 1585 start: {x: 0, y: 0}, 1586 end: {x: 0, y: 0} 1587 }; 1588 slider.viewport.
vendor: 6,558 bytes, lines 1588-1749
1588bind('touchstart MSPointerDown pointerdown', onTouchStart); 1589 1590 //for browsers that have implemented pointer events and fire a click after 1591 //every pointerup regardless of whether pointerup is on same screen location as pointerdown or not 1592 slider.viewport.on('click', '.bxslider a', function(e) { 1593 if (slider.viewport.hasClass('click-disabled')) { 1594 e.preventDefault(); 1595 slider.viewport.removeClass('click-disabled'); 1596 } 1597 }); 1598 }; 1599 1600 /** 1601 * Event handler for "touchstart" 1602 * 1603 * @param e (event) 1604 * - DOM event object 1605 */ 1606 var onTouchStart = function(e) { 1607 //disable slider controls while user is interacting with slides to avoid slider freeze that happens on touch devices when a slide swipe happens immediately after interacting with slider controls 1608 slider.controls.el.addClass('disabled'); 1609 1610 if (slider.working) { 1611 e.preventDefault(); 1612 slider.controls.el.removeClass('disabled'); 1613 } else { 1614 // record the original position when touch starts 1615 slider.touch.originalPos = el.position(); 1616 var orig = e.originalEvent, 1617 touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig]; 1618 // record the starting touch x, y coordinates 1619 slider.touch.start.x = touchPoints[0].pageX; 1620 slider.touch.start.y = touchPoints[0].pageY; 1621 1622 if (slider.viewport.get(0).setPointerCapture) { 1623 slider.pointerId = orig.pointerId; 1624 slider.viewport.get(0).setPointerCapture(slider.pointerId); 1625 } 1626 // bind a "touchmove" event to the viewport 1627 slider.viewport.bind('touchmove MSPointerMove pointermove', onTouchMove); 1628 // bind a "touchend" event to the viewport 1629 slider.viewport.bind('touchend MSPointerUp pointerup', onTouchEnd); 1630 slider.viewport.bind('MSPointerCancel pointercancel', onPointerCancel); 1631 } 1632 }; 1633 1634 /** 1635 * Cancel Pointer for Windows Phone 1636 * 1637 * @param e (event) 1638 * - DOM event object 1639 */ 1640 var onPointerCancel = function(e) { 1641 /* onPointerCancel handler is needed to deal with situations when a touchend 1642 doesn't fire after a touchstart (this happens on windows phones only) */ 1643 setPositionProperty(slider.touch.originalPos.left, 'reset', 0); 1644 1645 //remove handlers 1646 slider.controls.el.removeClass('disabled'); 1647 slider.viewport.unbind('MSPointerCancel pointercancel', onPointerCancel); 1648 slider.viewport.unbind('touchmove MSPointerMove pointermove', onTouchMove); 1649 slider.viewport.unbind('touchend MSPointerUp pointerup', onTouchEnd); 1650 if (slider.viewport.get(0).releasePointerCapture) { 1651 slider.viewport.get(0).releasePointerCapture(slider.pointerId); 1652 } 1653 }; 1654 1655 /** 1656 * Event handler for "touchmove" 1657 * 1658 * @param e (event) 1659 * - DOM event object 1660 */ 1661 var onTouchMove = function(e) { 1662 var orig = e.originalEvent, 1663 touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig], 1664 // if scrolling on y axis, do not prevent default 1665 xMovement = Math.abs(touchPoints[0].pageX - slider.touch.start.x), 1666 yMovement = Math.abs(touchPoints[0].pageY - slider.touch.start.y), 1667 value = 0, 1668 change = 0; 1669 1670 // x axis swipe 1671 if ((xMovement * 3) > yMovement && slider.settings.preventDefaultSwipeX) { 1672 e.preventDefault(); 1673 // y axis swipe 1674 } else if ((yMovement * 3) > xMovement && slider.settings.preventDefaultSwipeY) { 1675 e.preventDefault(); 1676 } 1677 if (slider.settings.mode !== 'fade' && slider.settings.oneToOneTouch) { 1678 // if horizontal, drag along x axis 1679 if (slider.settings.mode === 'horizontal') { 1680 change = touchPoints[0].pageX - slider.touch.start.x; 1681 value = slider.touch.originalPos.left + change; 1682 // if vertical, drag along y axis 1683 } else { 1684 change = touchPoints[0].pageY - slider.touch.start.y; 1685 value = slider.touch.originalPos.top + change; 1686 } 1687 setPositionProperty(value, 'reset', 0); 1688 } 1689 }; 1690 1691 /** 1692 * Event handler for "touchend" 1693 * 1694 * @param e (event) 1695 * - DOM event object 1696 */ 1697 var onTouchEnd = function(e) { 1698 slider.viewport.unbind('touchmove MSPointerMove pointermove', onTouchMove); 1699 //enable slider controls as soon as user stops interacing with slides 1700 slider.controls.el.removeClass('disabled'); 1701 var orig = e.originalEvent, 1702 touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig], 1703 value = 0, 1704 distance = 0; 1705 // record end x, y positions 1706 slider.touch.end.x = touchPoints[0].pageX; 1707 slider.touch.end.y = touchPoints[0].pageY; 1708 // if fade mode, check if absolute x distance clears the threshold 1709 if (slider.settings.mode === 'fade') { 1710 distance = Math.abs(slider.touch.start.x - slider.touch.end.x); 1711 if (distance >= slider.settings.swipeThreshold) { 1712 if (slider.touch.start.x > slider.touch.end.x) { 1713 el.goToNextSlide(); 1714 } else { 1715 el.goToPrevSlide(); 1716 } 1717 el.stopAuto(); 1718 } 1719 // not fade mode 1720 } else { 1721 // calculate distance and el's animate property 1722 if (slider.settings.mode === 'horizontal') { 1723 distance = slider.touch.end.x - slider.touch.start.x; 1724 value = slider.touch.originalPos.left; 1725 } else { 1726 distance = slider.touch.end.y - slider.touch.start.y; 1727 value = slider.touch.originalPos.top; 1728 } 1729 // if not infinite loop and first / last slide, do not attempt a slide transition 1730 if (!slider.settings.infiniteLoop && ((slider.active.index === 0 && distance > 0) || (slider.active.last && distance < 0))) { 1731 setPositionProperty(value, 'reset', 200); 1732 } else { 1733 // check if distance clears threshold 1734 if (Math.abs(distance) >= slider.settings.swipeThreshold) { 1735 if (distance < 0) { 1736 el.goToNextSlide(); 1737 } else { 1738 el.goToPrevSlide(); 1739 } 1740 el.stopAuto(); 1741 } else { 1742 // el.animate(property, 200); 1743 setPositionProperty(value, 'reset', 200); 1744 } 1745 } 1746 } 1747 slider.viewport.unbind('touchend MSPointerUp pointerup', onTouchEnd); 1748 if (slider.viewport.get(0).releasePointerCapture) { 1749 slider.viewport.get(0).releasePointerCapture(slider.pointerId
vendor: 8,775 bytes, lines 1749-1944
1749); 1750 } 1751 }; 1752 1753 /** 1754 * Window resize event callback 1755 */ 1756 var resizeWindow = function(e) { 1757 // don't do anything if slider isn't initialized. 1758 if (!slider.initialized) { return; } 1759 // Delay if slider working. 1760 if (slider.working) { 1761 window.setTimeout(resizeWindow, 10); 1762 } else { 1763 // get the new window dimens (again, thank you IE) 1764 var windowWidthNew = $(window).width(), 1765 windowHeightNew = $(window).height(); 1766 // make sure that it is a true window resize 1767 // *we must check this because our dinosaur friend IE fires a window resize event when certain DOM elements 1768 // are resized. Can you just die already?* 1769 if (windowWidth !== windowWidthNew || windowHeight !== windowHeightNew) { 1770 // set the new window dimens 1771 windowWidth = windowWidthNew; 1772 windowHeight = windowHeightNew; 1773 // update all dynamic elements 1774 el.redrawSlider(); 1775 // Call user resize handler 1776 slider.settings.onSliderResize.call(el, slider.active.index); 1777 } 1778 } 1779 }; 1780 1781 /** 1782 * Adds an aria-hidden=true attribute to each element 1783 * 1784 * @param startVisibleIndex (int) 1785 * - the first visible element's index 1786 */ 1787 var applyAriaHiddenAttributes = function(startVisibleIndex) { 1788 var numberOfSlidesShowing = getNumberSlidesShowing(); 1789 // only apply attributes if the setting is enabled and not in ticker mode 1790 if (slider.settings.ariaHidden && !slider.settings.ticker) { 1791 // add aria-hidden=true to all elements 1792 slider.children.attr('aria-hidden', 'true'); 1793 // get the visible elements and change to aria-hidden=false 1794 slider.children.slice(startVisibleIndex, startVisibleIndex + numberOfSlidesShowing).attr('aria-hidden', 'false'); 1795 } 1796 }; 1797 1798 /** 1799 * Returns index according to present page range 1800 * 1801 * @param slideOndex (int) 1802 * - the desired slide index 1803 */ 1804 var setSlideIndex = function(slideIndex) { 1805 if (slideIndex < 0) { 1806 if (slider.settings.infiniteLoop) { 1807 return getPagerQty() - 1; 1808 }else { 1809 //we don't go to undefined slides 1810 return slider.active.index; 1811 } 1812 // if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop) 1813 } else if (slideIndex >= getPagerQty()) { 1814 if (slider.settings.infiniteLoop) { 1815 return 0; 1816 } else { 1817 //we don't move to undefined pages 1818 return slider.active.index; 1819 } 1820 // set active index to requested slide 1821 } else { 1822 return slideIndex; 1823 } 1824 }; 1825 1826 /** 1827 * =================================================================================== 1828 * = PUBLIC FUNCTIONS 1829 * =================================================================================== 1830 */ 1831 1832 /** 1833 * Performs slide transition to the specified slide 1834 * 1835 * @param slideIndex (int) 1836 * - the destination slide's index (zero-based) 1837 * 1838 * @param direction (string) 1839 * - INTERNAL USE ONLY - the direction of travel ("prev" / "next") 1840 */ 1841 el.goToSlide = function(slideIndex, direction) { 1842 // onSlideBefore, onSlideNext, onSlidePrev callbacks 1843 // Allow transition canceling based on returned value 1844 var performTransition = true, 1845 moveBy = 0, 1846 position = {left: 0, top: 0}, 1847 lastChild = null, 1848 lastShowingIndex, eq, value, requestEl; 1849 // store the old index 1850 slider.oldIndex = slider.active.index; 1851 //set new index 1852 slider.active.index = setSlideIndex(slideIndex); 1853 1854 // if plugin is currently in motion, ignore request 1855 if (slider.working || slider.active.index === slider.oldIndex) { return; } 1856 // declare that plugin is in motion 1857 slider.working = true; 1858 1859 performTransition = slider.settings.onSlideBefore.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index); 1860 1861 // If transitions canceled, reset and return 1862 if (typeof (performTransition) !== 'undefined' && !performTransition) { 1863 slider.active.index = slider.oldIndex; // restore old index 1864 slider.working = false; // is not in motion 1865 return; 1866 } 1867 1868 if (direction === 'next') { 1869 // Prevent canceling in future functions or lack there-of from negating previous commands to cancel 1870 if (!slider.settings.onSlideNext.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)) { 1871 performTransition = false; 1872 } 1873 } else if (direction === 'prev') { 1874 // Prevent canceling in future functions or lack there-of from negating previous commands to cancel 1875 if (!slider.settings.onSlidePrev.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)) { 1876 performTransition = false; 1877 } 1878 } 1879 1880 // check if last slide 1881 slider.active.last = slider.active.index >= getPagerQty() - 1; 1882 // update the pager with active class 1883 if (slider.settings.pager || slider.settings.pagerCustom) { updatePagerActive(slider.active.index); } 1884 // // check for direction control update 1885 if (slider.settings.controls) { updateDirectionControls(); } 1886 // if slider is set to mode: "fade" 1887 if (slider.settings.mode === 'fade') { 1888 // if adaptiveHeight is true and next height is different from current height, animate to the new height 1889 if (slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()) { 1890 slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed); 1891 } 1892 // fade out the visible child and reset its z-index value 1893 slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0}); 1894 // fade in the newly requested slide 1895 slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex + 1).fadeIn(slider.settings.speed, function() { 1896 $(this).css('zIndex', slider.settings.slideZIndex); 1897 updateAfterSlideTransition(); 1898 }); 1899 // slider mode is not "fade" 1900 } else { 1901 // if adaptiveHeight is true and next height is different from current height, animate to the new height 1902 if (slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()) { 1903 slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed); 1904 } 1905 // if carousel and not infinite loop 1906 if (!slider.settings.infiniteLoop && slider.carousel && slider.active.last) { 1907 if (slider.settings.mode === 'horizontal') { 1908 // get the last child position 1909 lastChild = slider.children.eq(slider.children.length - 1); 1910 position = lastChild.position(); 1911 // calculate the position of the last slide 1912 moveBy = slider.viewport.width() - lastChild.outerWidth(); 1913 } else { 1914 // get last showing index position 1915 lastShowingIndex = slider.children.length - slider.settings.minSlides; 1916 position = slider.children.eq(lastShowingIndex).position(); 1917 } 1918 // horizontal carousel, going previous while on first slide (infiniteLoop mode) 1919 } else if (slider.carousel && slider.active.last && direction === 'prev') { 1920 // get the last child position 1921 eq = slider.settings.moveSlides === 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides); 1922 lastChild = el.children('.bx-clone').eq(eq); 1923 position = lastChild.position(); 1924 // if infinite loop and "Next" is clicked on the last slide 1925 } else if (direction === 'next' && slider.active.index === 0) { 1926 // get the last clone position 1927 position = el.find('> .bx-clone').eq(slider.settings.maxSlides).position(); 1928 slider.active.last = false; 1929 // normal non-zero requests 1930 } else if (slideIndex >= 0) { 1931 //parseInt is applied to allow floats for slides/page 1932 requestEl = slideIndex * parseInt(getMoveBy()); 1933 position = slider.children.eq(requestEl).position(); 1934 } 1935 1936 /* If the position doesn't exist 1937 * (e.g. if you destroy the slider on a next click), 1938 * it doesn't throw an error. 1939 */ 1940 if (typeof (position) !== 'undefined') { 1941 value = slider.settings.mode === 'horizontal' ? -(position.left - moveBy) : -position.top; 1942 // plugin values to be animated 1943 setPositionProperty(value, 'slide', slider.settings.speed); 1944 }
1944 else { 1945 slider.working = false; 1946 } 1947 } 1948 if (slider.settings.ariaHidden) { applyAriaHiddenAttributes(slider.active.index * getMoveBy()); } 1949 }; 1950 1951 /** 1952 * Transitions to the next slide in the show 1953 */ 1954 el.goToNextSlide = function() { 1955 // if infiniteLoop is false and last page is showing, disregard call 1956 if (!slider.settings.infiniteLoop && slider.active.last) { return; } 1957 var pagerIndex = parseInt(slider.active.index) + 1; 1958 el.goToSlide(pagerIndex, 'next'); 1959 }; 1960 1961 /** 1962 * Transitions to the prev slide in the show 1963 */ 1964 el.goToPrevSlide = function() { 1965 // if infiniteLoop is false and last page is showing, disregard call 1966 if (!slider.settings.infiniteLoop && slider.active.index === 0) { return; } 1967 var pagerIndex = parseInt(slider.active.index) - 1; 1968 el.goToSlide(pagerIndex, 'prev'); 1969 }; 1970 1971 /** 1972 * Starts the auto show 1973 * 1974 * @param preventControlUpdate (boolean) 1975 * - if true, auto controls state will not be updated 1976 */ 1977 el.startAuto = function(preventControlUpdate) { 1978 // if an interval already exists, disregard call 1979 if (slider.interval) { return; } 1980 // create an interval 1981 slider.interval = setInterval(function() { 1982 if (slider.settings.autoDirection === 'next') { 1983 el.goToNextSlide(); 1984 } else { 1985 el.goToPrevSlide(); 1986 } 1987 }, slider.settings.pause); 1988 // if auto controls are displayed and preventControlUpdate is not true 1989 if (slider.settings.autoControls && preventControlUpdate !== true) { updateAutoControls('stop'); } 1990 }; 1991 1992 /** 1993 * Stops the auto show 1994 * 1995 * @param preventControlUpdate (boolean) 1996 * - if true, auto controls state will not be updated 1997 */ 1998 el.stopAuto = function(preventControlUpdate) { 1999 // if no interval exists, disregard call 2000 if (!slider.interval) { return; } 2001 // clear the interval 2002 clearInterval(slider.interval); 2003 slider.interval = null; 2004 // if auto controls are displayed and preventControlUpdate is not true 2005 if (slider.settings.autoControls && preventControlUpdate !== true) { updateAutoControls('start'); } 2006 }; 2007 2008 /** 2009 * Returns current slide index (zero-based) 2010 */ 2011 el.getCurrentSlide = function() { 2012 return slider.active.index; 2013 }; 2014 2015 /** 2016 * Returns current slide element 2017 */ 2018 el.getCurrentSlideElement = function() { 2019 return slider.children.eq(slider.active.index); 2020 }; 2021 2022 /** 2023 * Returns a slide element 2024 * @param index (int) 2025 * - The index (zero-based) of the element you want returned. 2026 */ 2027 el.getSlideElement = function(index) { 2028 return slider.children.eq(index); 2029 }; 2030 2031 /** 2032 * Returns number of slides in show 2033 */ 2034 el.getSlideCount = function() { 2035 return slider.children.length; 2036 }; 2037 2038 /** 2039 * Return slider.working variable 2040 */ 2041 el.isWorking = function() { 2042 return slider.working; 2043 }; 2044 2045 /** 2046 * Update all dynamic slider elements 2047 */ 2048 el.redrawSlider = function() { 2049 // resize all children in ratio to new screen size 2050 slider.children.add(el.find('.bx-clone')).outerWidth(getSlideWidth()); 2051 // adjust the height
2052 slider.viewport.css('height', getViewportHeight()); 2053 // update the slide position 2054 if (!slider.settings.ticker) { setSlidePosition(); } 2055 // if active.last was true before the screen resize, we want 2056 // to keep it last no matter what screen size we end on 2057 if (slider.active.last) { slider.active.index = getPagerQty() - 1; } 2058 // if the active index (page) no longer exists due to the resize, simply set the index as last 2059 if (slider.active.index >= getPagerQty()) { slider.active.last = true; } 2060 // if a pager is being displayed and a custom pager is not being used, update it 2061 if (slider.settings.pager && !slider.settings.pagerCustom) { 2062 populatePager(); 2063 updatePagerActive(slider.active.index); 2064 } 2065 if (slider.settings.ariaHidden) { applyAriaHiddenAttributes(slider.active.index * getMoveBy()); } 2066 }; 2067 2068 /** 2069 * Destroy the current instance of the slider (revert everything back to original state) 2070 */ 2071 el.destroySlider = function() { 2072 // don't do anything if slider has already been destroyed 2073 if (!slider.initialized) { return; } 2074 slider.initialized = false; 2075 $('.bx-clone', this).remove(); 2076 slider.children.each(function() { 2077 if ($(this).data('origStyle') !== undefined) { 2078 $(this).attr('style', $(this).data('origStyle')); 2079 } else { 2080 $(this).removeAttr('style'); 2081 } 2082 }); 2083 if ($(this).data('origStyle') !== undefined) { 2084 this.attr('style', $(this).data('origStyle')); 2085 } else { 2086 $(this).removeAttr('style'); 2087 } 2088 $(this).unwrap().unwrap(); 2089 if (slider.controls.el) { slider.controls.el.remove(); } 2090 if (slider.controls.next) { slider.controls.next.remove(); } 2091 if (slider.controls.prev) { slider.controls.prev.remove(); } 2092 if (slider.pagerEl && slider.settings.controls && !slider.settings.pagerCustom) { slider.pagerEl.remove(); } 2093 $('.bx-caption', this).remove(); 2094 if (slider.controls.autoEl) { slider.controls.autoEl.remove(); } 2095 clearInterval(slider.interval); 2096 if (slider.settings.responsive) { $(window).unbind('resize', resizeWindow); } 2097 if (slider.settings.keyboardEnabled) { $(document).unbind('keydown', keyPress); } 2098 //remove self reference in data 2099 $(this).removeData('bxSlider'); 2100 }; 2101 2102 /** 2103 * Reload the slider (revert all DOM changes, and re-initialize) 2104 */ 2105 el.reloadSlider = function(settings) { 2106 if (settings !== undefined) { options = settings; } 2107 el.destroySlider(); 2108 init(); 2109 //store reference to self in order to access public functions later 2110 $(el).data('bxSlider', this); 2111 }; 2112 2113 init(); 2114 2115 $(el).data('bxSlider', this); 2116 2117 // returns the current jQuery object 2118 return this; 2119 }; 2120 2121})(jQuery); 2122 2123 // 2124 // Call the slider and implement slider's options 2125 // 2126 $(document).ready(function(){ 2127 var orbitSlider = $('#stacks_in_3747_39 .bxslider').bxSlider({ 2128 adaptiveHeight: true, 2129 2130 slideWidth: 500, 2131 minSlides: 1, 2132 maxSlides: 3, 2133 moveSlides: 1, 2134 2135 startSlide: 0, 2136 2137 2138 2139 speed: 500, 2140 2141 2142 2143 2144 2145 preloadImages: 'all', 2146 mode: 'horizontal', 2147 touchEnabled: false, 2148 oneToOneTouch: false, 2149 preventDefaultSwipeX: true, 2150 preventDefaultSwipeY: true, 2151 }); 2152 2153 $(window).load(function() { 2154 orbitSlider.reloadSlider(); 2155 }); 2156 }); 2157 2158return stack;})(stacks.stacks_in_3747_39); 2159stacks.stacks_in_3217 = {}; 2160stacks.stacks_in_3217 = (function(stack) { 2161var jQuery = stacks.jQuery;var $ = jQuery;// -- Start Vegas Each js Template -- // 2162 2163$(document).ready(function() { 2164// images loaded 2165(function(c,q){var m="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";c.fn.imagesLoaded=function(f){function n(){var b=c(j),a=c(h);d&&(h.length?d.reject(e,b,a):d.resolve(e));c.isFunction(f)&&f.call(g,e,b,a)}function p(b){k(b.target,"error"===b.type)}function k(b,a){b.src===m||-1!==c.inArray(b,l)||(l.push(b),a?h.push(b):j.push(b),c.data(b,"imagesLoaded",{isBroken:a,src:b.src}),r&&d.notifyWith(c(b),[a,e,c(j),c(h)]),e.length===l.length&&(setTimeout(n),e.unbind(".imagesLoaded", 2166p)))}var g=this,d=c.isFunction(c.Deferred)?c.Deferred():0,r=c.isFunction(d.notify),e=g.find("img").add(g.filter("img")),l=[],j=[],h=[];c.isPlainObject(f)&&c.each(f,function(b,a){if("callback"===b)f=a;else if(d)d[b](a)});e.length?e.bind("load.imagesLoaded error.imagesLoaded",p).each(function(b,a){var d=a.src,e=c.data(a,"imagesLoaded");
2166if(e&&e.src===d)k(a,e.isBroken);else if(a.complete&&a.naturalWidth!==q)k(a,0===a.naturalWidth||0===a.naturalHeight);else if(a.readyState||a.complete)a.src=m,a.src=d}): 2167n();return d?d.promise(g):g}})(jQuery); 2168 2169 2170 var stacks_in_3217slides = []; 2171 var stacks_in_3217speed = 1 * 0.8 * 1000; 2172 var stacks_in_3217duration; 2173 var stacks_in_3217delay; 2174 2175 $("#stacks_in_3217 #stacks_in_3217VegasInput img").each(function(){ 2176 var item = {} 2177 item ["src"] = $(this).attr("src"); 2178 2179 if($(this).data("src") != ""){ 2180 stacks_in_3217slides.push(item); 2181 } 2182 }); 2183 2184 2185 if(stacks_in_3217slides.length < 2){ 2186 2187 $("#stacks_in_3217VegasSlideshow").css("min-height","0"); 2188 return; 2189 } 2190 2191 // set the height 2192 function stacks_in_3217vegasSetHeight(){ 2193 var topoffset = $("#stacks_in_3217VegasSlideshow").offset().top; 2194 var winheight = $(window).height(); 2195 var contentheight = $(".stacks_in_3217vegasContentBox").height() + 80; 2196 var preferedheight = 0; 2197 2198 switch("custom") { 2199 case "fullscreen": 2200 contentheight = contentheight + $(".stacks_in_3217vegasScrollButton").height(); 2201 preferedheight = winheight - topoffset; 2202 break; 2203 case "halfscreen": 2204 preferedheight = (winheight / 2) - topoffset 2205 break; 2206 case "twothirdscreen": 2207 preferedheight = (winheight / 3 * 2) - topoffset 2208 break; 2209 case "proportional": 2210 var vegaswidth = $("#stacks_in_3217VegasSlideshow").width() 2211 switch ("3:2") { 2212 case "3:2": 2213 preferedheight = vegaswidth / (3 / 2); 2214 break; 2215 case "4:3": 2216 preferedheight = vegaswidth / (4 / 3); 2217 break; 2218 case "16:9": 2219 preferedheight = vegaswidth / (16 / 9); 2220 break; 2221 case "21:9": 2222 preferedheight = vegaswidth / (21 / 9); 2223 break; 2224 case "4:4": 2225 preferedheight = vegaswidth; 2226 break; 2227 } 2228 break; 2229 default: 2230 preferedheight = 500; 2231 } 2232 2233 if(contentheight >= preferedheight){ 2234 $("#stacks_in_3217VegasSlideshow").css("min-height", contentheight + "px"); 2235 }else{ 2236 $("#stacks_in_3217VegasSlideshow").css("height", preferedheight + "px"); 2237 $("#stacks_in_3217VegasSlideshow").css("min-height", preferedheight + "px"); 2238 $("#stacks_in_3217VegasSlideshow").css("height", "auto"); 2239 } 2240 if(contentheight < 50){ 2241 $("#stacks_in_3217VegasSlideshow").css("min-height", "50px"); 2242 } 2243 } 2244 2245 stacks_in_3217vegasSetHeight(); 2246 2247 $(".stacks_in_3217vegasIcon img").imagesLoaded( function() { 2248 stacks_in_3217vegasSetHeight(); 2249 }); 2250 2251 2252 2253 2254 2255 switch("blur") { 2256 case "blur": 2257 stacks_in_3217delay = stacks_in_3217speed * 6; 2258 stacks_in_3217duration = stacks_in_3217speed * 3; 2259 $("#stacks_in_3217VegasSlideshow").vegas({ 2260 slides: stacks_in_3217slides, 2261 overlay: true, 2262 preload: false, 2263 timer: false, 2264 transition: "blur", 2265 delay: stacks_in_3217delay, 2266 transitionDuration: stacks_in_3217duration 2267 }); 2268 break; 2269 case "swirl": 2270 stacks_in_3217delay = stacks_in_3217speed * 6; 2271 stacks_in_3217duration = stacks_in_3217speed * 3; 2272 $("#stacks_in_3217VegasSlideshow").vegas({ 2273 slides: stacks_in_3217slides, 2274 overlay: true, 2275 preload: false, 2276 timer: false, 2277 transition: ["swirlLeft","swirlRight"], 2278 delay: stacks_in_3217delay, 2279 transitionDuration: stacks_in_3217duration 2280 }); 2281 break; 2282 case "fade": 2283 stacks_in_3217delay = stacks_in_3217speed * 6; 2284 stacks_in_3217duration = stacks_in_3217speed * 4; 2285 $("#stacks_in_3217VegasSlideshow").vegas({ 2286 slides: stacks_in_3217slides, 2287 overlay: true, 2288 preload: false, 2289 timer: false, 2290 transition: "fade", 2291 delay: stacks_in_3217delay, 2292 transitionDuration: stacks_in_3217duration 2293 }); 2294 break; 2295 case "kenburns": 2296 stacks_in_3217delay = stacks_in_3217speed * 12; 2297 stacks_in_3217duration = stacks_in_3217speed * 12; 2298 $("#stacks_in_3217VegasSlideshow").vegas({ 2299 slides: stacks_in_3217slides, 2300 overlay: true, 2301 preload: false, 2302 timer: false, 2303 animation: "kenburns", 2304 delay: stacks_in_3217delay, 2305 animationDuration: stacks_in_3217duration 2306 }); 2307 break; 2308 case "newkenburns": 2309 stacks_in_3217delay = stacks_in_3217speed * 12; 2310 stacks_in_3217duration = stacks_in_3217speed * 12; 2311 $("#stacks_in_3217VegasSlideshow").vegas({ 2312 slides: stacks_in_3217slides, 2313 overlay: true, 2314 preload: false, 2315 timer: false, 2316 animation: "random", 2317 delay: stacks_in_3217delay, 2318 animationDuration: stacks_in_3217duration 2319 }); 2320 break; 2321 default: 2322 console.log("Vegas transition switch failed"); 2323 } 2324 2325 2326 $(".stacks_in_3217vegasScrollButton").click(function(){ 2327 var heightofme = $(this).outerHeight(); 2328 var thescrolldistance = $(this).offset().top + heightofme - 0; 2329 $("body,html").animate({scrollTop : thescrolldistance }, parseInt(800), "swing", function(){ 2330 // scroll animation complete 2331 }); 2332 }); 2333 2334 2335 $(window).resize(function(){ 2336 stacks_in_3217vegasSetHeight(); 2337 }); 2338 2339 $(window).load(function() { 2340 stacks_in_3217vegasSetHeight(); 2341 }); 2342 2343}); 2344 2345// -- End Vegas Each js Template -- // 2346return stack;})(stacks.stacks_in_3217); 2347stacks.stacks_in_3734 = {}; 2348stacks.stacks_in_3734 = (function(stack) { 2349var jQuery = stacks.jQuery;var $ = jQuery;$(document).ready(function() { 2350 $("#stacks_in_3734").closest(".stacks_out").css("overflow", "visible"); 2351 $("#stacks_in_3734").closest(".stacks_in").css("overflow", "visible");
2352 if(!(/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera)){ 2353 $(".stacks_top").css("overflow", "visible"); 2354 } 2355 2356// 2357// Disable animation on mobile devices if the user opts for it ... 2358// 2359}); 2360 2361 2362return stack;})(stacks.stacks_in_3734); 2363stacks.stacks_in_3039 = {}; 2364stacks.stacks_in_3039 = (function(stack) { 2365var jQuery = stacks.jQuery;var $ = jQuery;$(document).ready(function() { 2366 $("#stacks_in_3039").closest(".stacks_out").css("overflow", "visible"); 2367 $("#stacks_in_3039").closest(".stacks_in").css("overflow", "visible"); 2368 if(!(/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera)){ 2369 $(".stacks_top").css("overflow", "visible"); 2370 } 2371 2372// 2373// Disable animation on mobile devices if the user opts for it ... 2374// 2375}); 2376 2377 2378return stack;})(stacks.stacks_in_3039); 2379stacks.stacks_in_3379 = {}; 2380stacks.stacks_in_3379 = (function(stack) { 2381var jQuery = stacks.jQuery;var $ = jQuery;$(document).ready(function() { 2382 $("#stacks_in_3379").closest(".stacks_out").css("overflow", "visible"); 2383 $("#stacks_in_3379").closest(".stacks_in").css("overflow", "visible"); 2384 if(!(/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera)){ 2385 $(".stacks_top").css("overflow", "visible"); 2386 } 2387 2388// 2389// Disable animation on mobile devices if the user opts for it ... 2390// 2391}); 2392 2393 2394return stack;})(stacks.stacks_in_3379); 2395stacks.stacks_in_3390 = {}; 2396stacks.stacks_in_3390 = (function(stack) { 2397var jQuery = stacks.jQuery;var $ = jQuery;$(document).ready(function() { 2398 $("#stacks_in_3390").closest(".stacks_out").css("overflow", "visible"); 2399 $("#stacks_in_3390").closest(".stacks_in").css("overflow", "visible"); 2400 if(!(/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera)){ 2401 $(".stacks_top").css("overflow", "visible"); 2402 } 2403 2404// 2405// Disable animation on mobile devices if the user opts for it ... 2406// 2407}); 2408 2409 2410return stack;})(stacks.stacks_in_3390);
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.