vendor: 6,254 bytes, lines 1-9
1/*! 2 * jQuery UI Tabs 1.14.2 3 * https://jqueryui.com 4 * 5 * Copyright OpenJS Foundation and other contributors 6 * Released under the MIT license. 7 * https://jquery.org/license 8 */ 9!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","../keycode","../unique-id","../version","../widget"],t):t(jQuery)}(function(o){"use strict";return o.widget("ui.tabs",{version:"1.14.2",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(t){var e=new URL(t.href),i=new URL(location.href);return 1<t.hash.length&&e.origin===i.origin&&e.pathname===i.pathname&&e.search===i.search},_create:function(){var e=this,t=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,t.collapsible),this._processTabs(),t.active=this._initialActive(),Array.isArray(t.disabled)&&(t.disabled=o.uniqueSort(t.disabled.concat(o.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(t.active):this.active=o(),this._refresh(),this.active.length&&this.load(t.active)},_initialActive:function(){var i=this.options.active,t=this.options.collapsible,a=location.hash.substring(1),s=decodeURIComponent(a);return null===i&&(a&&(this.tabs.each(function(t,e){if(o(e).attr("aria-controls")===a)return i=t,!1}),null===i)&&this.tabs.each(function(t,e){if(o(e).attr("aria-controls")===s)return i=t,!1}),null!==(i=null===i?this.tabs.index(this.tabs.filter(".ui-tabs-active")):i)&&-1!==i||(i=!!this.tabs.length&&0)),!1!==i&&-1===(i=this.tabs.index(this.tabs.eq(i)))&&(i=!t&&0),i=!t&&!1===i&&this.anchors.length?0:i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):o()}},_tabKeydown:function(t){var e=o(this.document[0].activeElement).closest("li"),i=this.tabs.index(e),a=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case o.ui.keyCode.RIGHT:case o.ui.keyCode.DOWN:i++;break;case o.ui.keyCode.UP:case o.ui.keyCode.LEFT:a=!1,i--;break;case o.ui.keyCode.END:i=this.anchors.length-1;break;case o.ui.keyCode.HOME:i=0;break;case o.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i);case o.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i);default:return}t.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,a),t.ctrlKey||t.metaKey||(e.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===o.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===o.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===o.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,e){var i=this.tabs.length-1;for(;-1!==o.inArray(t=(t=i<t?0:t)<0?i:t,this.options.disabled);)t=e?t+1:t-1;return t},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){"active"===t?this._activate(e):(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e))},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=o.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!o.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=o()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=o()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var r=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){o(this).is(".ui-state-disabled")&&t.preventDefault()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return o("a",this)[0]}).attr({tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=o(),this.anchors.each(function(t,e){var i,a,s=o(e).uniqueId().attr("id"),n=o(e).closest("li"),h=n.attr("aria-controls");r._isLocal(e)?(a=e.hash.substring(1),(i=r.element.find("#"+CSS.escape(a))).length||(a=decodeURIComponent(a),i=r.element.find("#"+CSS.escape(a)))):(a=n.attr("aria-controls")||o({}).uniqueId()[0].id,(i=r.element.find("#"+a)).length||(i=r._createPanel(a)).insertAfter(r.panels[t-1]||r.tablist),i.attr("aria-live","polite")),i.length&&(r.panels=r.panels.add(i)),h&&n.data("ui-tabs-aria-controls",h),n.attr({"aria-controls":a,"aria-labelledby":s}),i.attr("aria-labelledby",s)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),t&&(this._off(t.not(this.tabs)
vendor: 4,491 bytes, line 9
9),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return o("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var e,i;for(Array.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),i=0;e=this.tabs[i];i++)e=o(e),!0===t||-1!==o.inArray(i,t)?(e.attr("aria-disabled","true"),this._addClass(e,null,"ui-state-disabled")):(e.removeAttr("aria-disabled"),this._removeClass(e,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&o.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=o(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=o(this).outerHeight(!0)}),this.panels.each(function(){o(this).height(Math.max(0,i-o(this).innerHeight()+o(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,o(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,a=o(t.currentTarget).closest("li"),s=a[0]===i[0],n=s&&e.collapsible,h=n?o():this._getPanelForTab(a),r=i.length?this._getPanelForTab(i):o(),i={oldTab:i,oldPanel:r,newTab:n?o():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||s&&!e.collapsible||!1===this._trigger("beforeActivate",t,i)||(e.active=!n&&this.tabs.index(a),this.active=s?o():a,this.xhr&&this.xhr.abort(),r.length||h.length||o.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,i))},_toggle:function(t,e){var i=this,a=e.newPanel,s=e.oldPanel;function n(){i.running=!1,i._trigger("activate",t,e)}function h(){i._addClass(e.newTab.closest("li"),"ui-tabs-active","ui-state-active"),a.length&&i.options.show?i._show(a,i.options.show,n):(a.show(),n())}this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){i._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),h()}):(this._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),s.hide(),h()),s.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&&s.length?e.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===o(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var t=this._findActive(t);t[0]!==this.active[0]&&(t=(t=t.length?t:this.active).find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:o.noop}))},_findActive:function(t){return!1===t?o():this.tabs.eq(t)},_getIndex:function(t){return t="string"==typeof t?this.anchors.index(this.anchors.filter("[href$='"+CSS.escape(t)+"']")):t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){o.data(this,"ui-tabs-destroy")?o(this).remove():o(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=o(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),Array.isArray(t)?o.map(t,function(t){return t!==i?t:null}):o.map(this.tabs,function(t,e){return e!==i?e:null})),this._setOptionDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==o.inArray(t,e))return;
9e=Array.isArray(e)?o.merge([t],e).sort():[t]}this._setOptionDisabled(e)}},load:function(t,a){t=this._getIndex(t);function s(t,e){"abort"===e&&n.panels.stop(!1,!0),n._removeClass(i,"ui-tabs-loading"),h.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr}var n=this,i=this.tabs.eq(t),t=i.find(".ui-tabs-anchor"),h=this._getPanelForTab(i),r={tab:i,panel:h};this._isLocal(t[0])||(this.xhr=o.ajax(this._ajaxSettings(t,a,r)),"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),h.attr("aria-busy","true"),this.xhr.done(function(t,e,i){h.html(t),n._trigger("load",a,r),s(i,e)}).fail(function(t,e){s(t,e)})))},_ajaxSettings:function(t,i,a){var s=this;return{url:t.attr("href"),beforeSend:function(t,e){return s._trigger("beforeLoad",i,o.extend({jqXHR:t,ajaxSettings:e},a))}}},_getPanelForTab:function(t){t=o(t).attr("aria-controls");return this.element.find("#"+CSS.escape(t))}}),!0===o.uiBackCompat&&o.widget("ui.tabs",o.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),o.ui.tabs});; 10/** 11 * File navigation.js. 12 * 13 * Handles toggling the navigation menu for small screens and enables TAB key 14 * navigation support for dropdown menus. 15 */ 16( function() { 17 var container, button, menu, links, i, len; 18 19 container = document.getElementById( 'site-navigation' ); 20 if ( ! container ) { 21 return; 22 } 23 24 button = container.getElementsByTagName( 'button' )[0]; 25 if ( 'undefined' === typeof button ) { 26 return; 27 } 28 29 menu = container.getElementsByTagName( 'ul' )[0]; 30 31 // Hide menu toggle button if menu is empty and return early. 32 if ( 'undefined' === typeof menu ) { 33 button.style.display = 'none'; 34 return; 35 } 36 37 menu.setAttribute( 'aria-expanded', 'false' ); 38 if ( -1 === menu.className.indexOf( 'nav-menu' ) ) { 39 menu.className += ' nav-menu'; 40 } 41 42 button.onclick = function() { 43 if ( -1 !== container.className.indexOf( 'toggled' ) ) { 44 container.className = container.className.replace( ' toggled', '' ); 45 button.setAttribute( 'aria-expanded', 'false' ); 46 menu.setAttribute( 'aria-expanded', 'false' ); 47 } else { 48 container.className += ' toggled'; 49 button.setAttribute( 'aria-expanded', 'true' ); 50 menu.setAttribute( 'aria-expanded', 'true' ); 51 } 52 }; 53 54 // Get all the link elements within the menu. 55 links = menu.getElementsByTagName( 'a' ); 56 57 // Each time a menu link is focused or blurred, toggle focus. 58 for ( i = 0, len = links.length; i < len; i++ ) { 59 links[i].addEventListener( 'focus', toggleFocus, true ); 60 links[i].addEventListener( 'blur', toggleFocus, true ); 61 } 62 63 /** 64 * Sets or removes .focus class on an element. 65 */ 66 function toggleFocus() { 67 var self = this; 68 69 // Move up through the ancestors of the current link until we hit .nav-menu. 70 while ( -1 === self.className.indexOf( 'nav-menu' ) ) { 71 72 // On li elements toggle the class .focus. 73 if ( 'li' === self.tagName.toLowerCase() ) { 74 if ( -1 !== self.className.indexOf( 'focus' ) ) { 75 self.className = self.className.replace( ' focus', '' ); 76 } else { 77 self.className += ' focus'; 78 } 79 } 80 81 self = self.parentElement; 82 } 83 } 84 85 /** 86 * Toggles `focus` class to allow submenu access on tablets. 87 */ 88 ( function( container ) { 89 var touchStartFn, i, 90 parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' ); 91 92 if ( 'ontouchstart' in window ) { 93 touchStartFn = function( e ) { 94 var menuItem = this.parentNode, i; 95 96 if ( ! menuItem.classList.contains( 'focus' ) ) { 97 e.preventDefault(); 98 for ( i = 0; i < menuItem.parentNode.children.length; ++i ) { 99 if ( menuItem === menuItem.parentNode.children[i] ) { 100 continue; 101 } 102 menuItem.parentNode.children[i].classList.remove( 'focus' ); 103 } 104 menuItem.classList.add( 'focus' ); 105 } else { 106 menuItem.classList.remove( 'focus' ); 107 } 108 }; 109 110 for ( i = 0; i < parentLink.length; ++i ) { 111 parentLink[i].addEventListener( 'touchstart', touchStartFn, false ); 112 } 113 } 114 }( container ) ); 115} )(); 116; 117/** 118 * jQuery.marquee - scrolling text like old marquee element 119 * @author Aamir Afridi - aamirafridi(at)gmail(dot)com / http://aamirafridi.com/jquery/jquery-marquee-plugin 120 */; 121(function($) { 122 $.fn.marquee = function(options) { 123 return this.each(function() { 124 // Extend the options if any provided 125 var o = $.extend({}, $.fn.marquee.defaults, options), 126 $this = $(this), 127 $marqueeWrapper, containerWidth, animationCss, verticalDir, elWidth, 128 loopCount = 3, 129 playState = 'animation-play-state', 130 css3AnimationIsSupported = false, 131 132 // Private methods 133 _prefixedEvent = function(element, type, callback) { 134 var pfx = ["webkit", "moz", "MS", "o", ""]; 135 for (var p = 0; p < pfx.length; p++) { 136 if (!pfx[p]) type = type.toLowerCase(); 137 element.addEventListener(pfx[p] + type, callback, false); 138 } 139 }, 140 141 _objToString = function(obj) { 142 var tabjson = []; 143 for (var p in obj) { 144 if (obj.hasOwnProperty(p)) { 145 tabjson.push(p + ':' + obj[p]); 146 } 147 } 148 tabjson.push(); 149 return '{' + tabjson.join(',') + '}'; 150 }, 151 152 _startAnimationWithDelay = function() { 153 $this.timer = setTimeout(animate, o.delayBeforeStart); 154 }, 155 156 // Public methods 157 methods = { 158 pause: function() { 159 if (css3AnimationIsSupported && o.allowCss3Support) { 160 $marqueeWrapper.css(playState, 'paused'); 161 } else { 162 // pause using pause plugin 163 if ($.fn.pause) { 164 $marqueeWrapper.pause(); 165 } 166 } 167 // save the status 168 $this.data('runningStatus', 'paused'); 169 // fire event 170 $this.trigger('paused'); 171 }, 172 173 resume: function() { 174 // resume using css3 175 if (css3AnimationIsSupported && o.allowCss3Support) { 176 $marqueeWrapper.css(playState, 'running'); 177 } else { 178 // resume using pause plugin 179 if ($.fn.resume) { 180 $marqueeWrapper.resume(); 181 } 182 } 183 // save the status 184 $this.data('runningStatus', 'resumed'); 185 // fire event 186 $this.trigger('resumed'); 187 }, 188 189 toggle: function() { 190 methods[$this.data('runningStatus') === 'resumed' ? 'pause' : 'resume'](); 191 }, 192 193 destroy: function() { 194 // Clear timer 195 clearTimeout($this.timer); 196 // Unbind all events 197 $this.find("*").addBack().off(); 198 // Just unwrap the elements that has been added using this plugin 199 $this.html($this.find('.js-marquee:first').html()); 200 } 201 }; 202 203 // Check for methods 204 if (typeof options === 'string') { 205 if ($.isFunction(methods[options])) { 206 // Following two IF statements to support public methods 207 if (!$marqueeWrapper) { 208 $marqueeWrapper = $this.find('.js-marquee-wrapper'); 209 } 210 if ($this.data('css3AnimationIsSupported') === true) { 211 css3AnimationIsSupported = true; 212 } 213 methods[options](); 214 } 215 return; 216 } 217 218 /* Check if element has data attributes. They have top priority 219 For details https://twitter.com/aamirafridi/status/403848
vendor: 15,060 bytes, lines 219-504
219044069679104 - Can't find a better solution :/ 220 jQuery 1.3.2 doesn't support $.data().KEY hence writting the following */ 221 var dataAttributes = {}, 222 attr; 223 $.each(o, function(key) { 224 // Check if element has this data attribute 225 attr = $this.attr('data-' + key); 226 if (typeof attr !== 'undefined') { 227 // Now check if value is boolean or not 228 switch (attr) { 229 case 'true': 230 attr = true; 231 break; 232 case 'false': 233 attr = false; 234 break; 235 } 236 o[key] = attr; 237 } 238 }); 239 240 // Reintroduce speed as an option. It calculates duration as a factor of the container width 241 // measured in pixels per second. 242 if (o.speed) { 243 o.duration = parseInt($this.width(), 10) / o.speed * 1000; 244 } 245 246 // Shortcut to see if direction is upward or downward 247 verticalDir = o.direction === 'up' || o.direction === 'down'; 248 249 // no gap if not duplicated 250 o.gap = o.duplicated ? parseInt(o.gap) : 0; 251 252 // wrap inner content into a div 253 $this.wrapInner('<div class="js-marquee"></div>'); 254 255 // Make copy of the element 256 var $el = $this.find('.js-marquee').css({ 257 'margin-right': o.gap, 258 'float': 'left' 259 }); 260 261 if (o.duplicated) { 262 $el.clone(true).appendTo($this); 263 } 264 265 // wrap both inner elements into one div 266 $this.wrapInner('<div style="width:100000px" class="js-marquee-wrapper"></div>'); 267 268 // Save the reference of the wrapper 269 $marqueeWrapper = $this.find('.js-marquee-wrapper'); 270 271 // If direction is up or down, get the height of main element 272 if (verticalDir) { 273 var containerHeight = $this.height(); 274 $marqueeWrapper.removeAttr('style'); 275 $this.height(containerHeight); 276 277 // Change the CSS for js-marquee element 278 $this.find('.js-marquee').css({ 279 'float': 'none', 280 'margin-bottom': o.gap, 281 'margin-right': 0 282 }); 283 284 // Remove bottom margin from 2nd element if duplicated 285 if (o.duplicated) { 286 $this.find('.js-marquee:last').css({ 287 'margin-bottom': 0 288 }); 289 } 290 291 var elHeight = $this.find('.js-marquee:first').height() + o.gap; 292 293 // adjust the animation duration according to the text length 294 if (o.startVisible && !o.duplicated) { 295 // Compute the complete animation duration and save it for later reference 296 // formula is to: (Height of the text node + height of the main container / Height of the main container) * duration; 297 o._completeDuration = ((parseInt(elHeight, 10) + parseInt(containerHeight, 10)) / parseInt(containerHeight, 10)) * o.duration; 298 299 // formula is to: (Height of the text node / height of the main container) * duration 300 o.duration = (parseInt(elHeight, 10) / parseInt(containerHeight, 10)) * o.duration; 301 } else { 302 // formula is to: (Height of the text node + height of the main container / Height of the main container) * duration; 303 o.duration = ((parseInt(elHeight, 10) + parseInt(containerHeight, 10)) / parseInt(containerHeight, 10)) * o.duration; 304 } 305 306 } else { 307 // Save the width of the each element so we can use it in animation 308 elWidth = $this.find('.js-marquee:first').width() + o.gap; 309 310 // container width 311 containerWidth = $this.width(); 312 313 // adjust the animation duration according to the text length 314 if (o.startVisible && !o.duplicated) { 315 // Compute the complete animation duration and save it for later reference 316 // formula is to: (Width of the text node + width of the main container / Width of the main container) * duration; 317 o._completeDuration = ((parseInt(elWidth, 10) + parseInt(containerWidth, 10)) / parseInt(containerWidth, 10)) * o.duration; 318 319 // (Width of the text node / width of the main container) * duration 320 o.duration = (parseInt(elWidth, 10) / parseInt(containerWidth, 10)) * o.duration; 321 } else { 322 // formula is to: (Width of the text node + width of the main container / Width of the main container) * duration; 323 o.duration = ((parseInt(elWidth, 10) + parseInt(containerWidth, 10)) / parseInt(containerWidth, 10)) * o.duration; 324 } 325 } 326 327 // if duplicated then reduce the duration 328 if (o.duplicated) { 329 o.duration = o.duration / 2; 330 } 331 332 if (o.allowCss3Support) { 333 var elm = document.body || document.createElement('div'), 334 animationName = 'marqueeAnimation-' + Math.floor(Math.random() * 10000000), 335 domPrefixes = 'Webkit Moz O ms Khtml'.split(' '), 336 animationString = 'animation', 337 animationCss3Str = '', 338 keyframeString = ''; 339 340 // Check css3 support 341 if (elm.style.animation !== undefined) { 342 keyframeString = '@keyframes ' + animationName + ' '; 343 css3AnimationIsSupported = true; 344 } 345 346 if (css3AnimationIsSupported === false) { 347 for (var i = 0; i < domPrefixes.length; i++) { 348 if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) { 349 var prefix = '-' + domPrefixes[i].toLowerCase() + '-'; 350 animationString = prefix + animationString; 351 playState = prefix + playState; 352 keyframeString = '@' + prefix + 'keyframes ' + animationName + ' '; 353 css3AnimationIsSupported = true; 354 break; 355 } 356 } 357 } 358 359 if (css3AnimationIsSupported) { 360 animationCss3Str = animationName + ' ' + o.duration / 1000 + 's ' + o.delayBeforeStart / 1000 + 's infinite ' + o.css3easing; 361 $this.data('css3AnimationIsSupported', true); 362 } 363 } 364 365 var _rePositionVertically = function() { 366 $marqueeWrapper.css('transform', 'translateY(' + (o.direction === 'up' ? containerHeight + 'px' : '-' + elHeight + 'px') + ')'); 367 }, 368 _rePositionHorizontally = function() { 369 $marqueeWrapper.css('transform', 'translateX(' + (o.direction === 'left' ? containerWidth + 'px' : '-' + elWidth + 'px') + ')'); 370 }; 371 372 // if duplicated option is set to true than position the wrapper 373 if (o.duplicated) { 374 if (verticalDir) { 375 if (o.startVisible) { 376 $marqueeWrapper.css('transform', 'translateY(0)'); 377 } else { 378 $marqueeWrapper.css('transform', 'translateY(' + (o.direction === 'up' ? containerHeight + 'px' : '-' + ((elHeight * 2) - o.gap) + 'px') + ')'); 379 } 380 } else { 381 if (o.startVisible) { 382 $marqueeWrapper.css('transform', 'translateX(0)'); 383 } else { 384 $marqueeWrapper.css('transform', 'translateX(' + (o.direction === 'left' ? containerWidth + 'px' : '-' + ((elWidth * 2) - o.gap) + 'px') + ')'); 385 } 386 } 387 388 // If the text starts out visible we can skip the two initial loops 389 if (!o.startVisible) { 390 loopCount = 1; 391 } 392 } else if (o.startVisible) { 393 // We only have two different loops if marquee is duplicated and starts visible 394 loopCount = 2; 395 } else { 396 if (verticalDir) { 397 _rePositionVertically(); 398 } else { 399 _rePositionHorizontally(); 400 } 401 } 402 403 // Animate recursive method 404 var animate = function() { 405 if (o.duplicated) { 406 // When duplicated, the first loop will be scroll longer so double the duration 407 if (loopCount === 1) { 408 o._originalDuration = o.duration; 409 if (verticalDir) { 410 o.duration = o.direction === 'up' ? o.duration + (containerHeight / ((elHeight) / o.duration)) : o.duration * 2; 411 } else { 412 o.duration = o.direction === 'left' ? o.duration + (containerWidth / ((elWidth) / o.duration)) : o.duration * 2; 413 } 414 // Adjust the css3 animation as well 415 if (animationCss3Str) { 416 animationCss3Str = animationName + ' ' + o.duration / 1000 + 's ' + o.delayBeforeStart / 1000 + 's ' + o.css3easing; 417 } 418 loopCount++; 419 } 420 // On 2nd loop things back to normal, normal duration for the rest of animations 421 else if (loopCount === 2) { 422 o.duration = o._originalDuration; 423 // Adjust the css3 animation as well 424 if (animationCss3Str) { 425 animationName = animationName + '0'; 426 keyframeString = $.trim(keyframeString) + '0 '; 427 animationCss3Str = animationName + ' ' + o.duration / 1000 + 's 0s infinite ' + o.css3easing; 428 } 429 loopCount++; 430 } 431 } 432 433 if (verticalDir) { 434 if (o.duplicated) { 435 436 // Adjust the starting point of animation only when first loops finishes 437 if (loopCount > 2) { 438 $marqueeWrapper.css('transform', 'translateY(' + (o.direction === 'up' ? 0 : '-' + elHeight + 'px') + ')'); 439 } 440 441 animationCss = { 442 'transform': 'translateY(' + (o.direction === 'up' ? '-' + elHeight + 'px' : 0) + ')' 443 }; 444 } else if (o.startVisible) { 445 // This loop moves the marquee out of the container 446 if (loopCount === 2) { 447 // Adjust the css3 animation as well 448 if (animationCss3Str) { 449 animationCss3Str = animationName + ' ' + o.duration / 1000 + 's ' + o.delayBeforeStart / 1000 + 's ' + o.css3easing; 450 } 451 animationCss = { 452 'transform': 'translateY(' + (o.direction === 'up' ? '-' + elHeight + 'px' : containerHeight + 'px') + ')' 453 }; 454 loopCount++; 455 } else if (loopCount === 3) { 456 // Set the duration for the animation that will run forever 457 o.duration = o._completeDuration; 458 // Adjust the css3 animation as well 459 if (animationCss3Str) { 460 animationName = animationName + '0'; 461 keyframeString = $.trim(keyframeString) + '0 '; 462 animationCss3Str = animationName + ' ' + o.duration / 1000 + 's 0s infinite ' + o.css3easing; 463 } 464 _rePositionVertically(); 465 } 466 } else { 467 _rePositionVertically(); 468 animationCss = { 469 'transform': 'translateY(' + (o.direction === 'up' ? '-' + ($marqueeWrapper.height()) + 'px' : containerHeight + 'px') + ')' 470 }; 471 } 472 } else { 473 if (o.duplicated) { 474 475 // Adjust the starting point of animation only when first loops finishes 476 if (loopCount > 2) { 477 $marqueeWrapper.css('transform', 'translateX(' + (o.direction === 'left' ? 0 : '-' + elWidth + 'px') + ')'); 478 } 479 480 animationCss = { 481 'transform': 'translateX(' + (o.direction === 'left' ? '-' + elWidth + 'px' : 0) + ')' 482 }; 483 484 } else if (o.startVisible) { 485 // This loop moves the marquee out of the container 486 if (loopCount === 2) { 487 // Adjust the css3 animation as well 488 if (animationCss3Str) { 489 animationCss3Str = animationName + ' ' + o.duration / 1000 + 's ' + o.delayBeforeStart / 1000 + 's ' + o.css3easing; 490 } 491 animationCss = { 492 'transform': 'translateX(' + (o.direction === 'left' ? '-' + elWidth + 'px' : containerWidth + 'px') + ')' 493 }; 494 loopCount++; 495 } else if (loopCount === 3) { 496 // Set the duration for the animation that will run forever 497 o.duration = o._completeDuration; 498 // Adjust the css3 animation as well 499 if (animationCss3Str) { 500 animationName = animationName + '0'; 501 keyframeString = $.trim(keyframeString) + '0 '; 502 animationCss3Str = animationName + ' ' + o.duration / 1000 + 's 0s infinite ' + o.css3easing; 503 } 504 _rePositionHorizontally();
505 } 506 } else { 507 _rePositionHorizontally(); 508 animationCss = { 509 'transform': 'translateX(' + (o.direction === 'left' ? '-' + elWidth + 'px' : containerWidth + 'px') + ')' 510 }; 511 } 512 } 513 514 // fire event 515 $this.trigger('beforeStarting'); 516 517 // If css3 support is available than do it with css3, otherwise use jQuery as fallback 518 if (css3AnimationIsSupported) { 519 // Add css3 animation to the element 520 $marqueeWrapper.css(animationString, animationCss3Str); 521 var keyframeCss = keyframeString + ' { 100% ' + _objToString(animationCss) + '}', 522 $styles = $marqueeWrapper.find('style'); 523 524 // Now add the keyframe animation to the marquee element 525 if ($styles.length !== 0) { 526 // Bug fixed for jQuery 1.3.x - Instead of using .last(), use following 527 $styles.filter(":last").html(keyframeCss); 528 } else { 529 $('head').append('<style>' + keyframeCss + '</style>'); 530 } 531 532 // Animation iteration event 533 _prefixedEvent($marqueeWrapper[0], "AnimationIteration", function() { 534 $this.trigger('finished'); 535 }); 536 // Animation stopped 537 _prefixedEvent($marqueeWrapper[0], "AnimationEnd", function() { 538 animate(); 539 $this.trigger('finished'); 540 }); 541 542 } else { 543 // Start animating 544 $marqueeWrapper.animate(animationCss, o.duration, o.easing, function() { 545 // fire event 546 $this.trigger('finished'); 547 // animate again 548 if (o.pauseOnCycle) { 549 _startAnimationWithDelay(); 550 } else { 551 animate(); 552 } 553 }); 554 } 555 // save the status 556 $this.data('runningStatus', 'resumed'); 557 }; 558 559 // bind pause and resume events 560 $this.on('pause', methods.pause); 561 $this.on('resume', methods.resume); 562 563 if (o.pauseOnHover) { 564 $this.on('mouseenter', methods.pause); 565 $this.on('mouseleave', methods.resume); 566 } 567 568 // If css3 animation is supported than call animate method at once 569 if (css3AnimationIsSupported && o.allowCss3Support) { 570 animate(); 571 } else { 572 // Starts the recursive method 573 _startAnimationWithDelay(); 574 } 575 576 }); 577 }; // End of Plugin 578 // Public: plugin defaults options 579 $.fn.marquee.defaults = { 580 // If you wish to always animate using jQuery 581 allowCss3Support: true, 582 // works when allowCss3Support is set to true - for full list see http://www.w3.org/TR/2013/WD-css3-transitions-20131119/#transition-timing-function 583 css3easing: 'linear', 584 // requires jQuery easing plugin. Default is 'linear' 585 easing: 'linear', 586 // pause time before the next animation turn in milliseconds 587 delayBeforeStart: 1000, 588 // 'left', 'right', 'up' or 'down' 589 direction: 'left', 590 // true or false - should the marquee be duplicated to show an effect of continues flow 591 duplicated: false, 592 // duration in milliseconds of the marquee in milliseconds 593 duration: 5000, 594 // Speed allows you to set a relatively constant marquee speed regardless of the width of the containing element. Speed is measured in pixels per second. 595 speed: 0, 596 // gap in pixels between the tickers 597 gap: 20, 598 // on cycle pause the marquee 599 pauseOnCycle: false, 600 // on hover pause the marquee - using jQuery plugin https://github.com/tobia/Pause 601 pauseOnHover: false, 602 // the marquee is visible initially positioned next to the border towards it will be moving 603 startVisible: false 604 }; 605})(jQuery);; 606/** 607 * File skip-link-focus-fix.js. 608 * 609 * Helps with accessibility for keyboard only users. 610 * 611 * Learn more: https://git.io/vWdr2 612 */ 613( function() { 614 var isIe = /(trident|msie)/i.test( navigator.userAgent ); 615 616 if ( isIe && document.getElementById && window.addEventListener ) { 617 window.addEventListener( 'hashchange', function() { 618 var id = location.hash.substring( 1 ), 619 element; 620 621 if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { 622 return; 623 } 624 625 element = document.getElementById( id ); 626 627 if ( element ) { 628 if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { 629 element.tabIndex = -1; 630 } 631 632 element.focus(); 633 } 634 }, false ); 635 } 636} )(); 637; 638/*! 639 * Theia Sticky Sidebar v1.4.0 640 * https://github.com/WeCodePixels/theia-sticky-sidebar 641 * 642 * Glues your website's sidebars, making them permanently visible while scrolling. 643 * 644 * Copyright 2013-2016 WeCodePixels and other contributors 645 * Released under the MIT license 646 */ 647 648(function ($) { 649 $.fn.theiaStickySidebar = function (options) { 650 var defaults = { 651 'containerSelector': '', 652 'additionalMarginTop': 0, 653 'additionalMarginBottom': 0, 654 'updateSidebarHeight': true, 655 'minWidth': 0, 656 'disableOnResponsiveLayouts': true, 657 'sidebarBehavior': 'modern' 658 }; 659 options = $.extend(defaults, options); 660 661 // Validate options 662 options.additionalMarginTop = parseInt(options.additionalMarginTop) || 0; 663 options.additionalMarginBottom = parseInt(options.additionalMarginBottom) || 0; 664 665 tryInitOrHookIntoEvents(options, this); 666 667 // Try doing init, otherwise hook into window.resize and document.scroll and try again then. 668 function tryInitOrHookIntoEvents(options, $that) { 669 var success = tryInit(options, $that); 670 671 if (!success) { 672 console.log('TST: Body width smaller than options.minWidth. Init is delayed.'); 673 674 $(document).scroll(function (options, $that) { 675 return function (evt) { 676 var success = tryInit(options, $that); 677 678 if (success) { 679 $(this).unbind(evt); 680 } 681 }; 682 }(options, $that)); 683 $(window).resize(function (options, $that) { 684 return function (evt) { 685 var success = tryInit(options, $that); 686 687 if (success) { 688 $(this).unbind(evt); 689 } 690 }; 691 }(options, $that)) 692 } 693 } 694 695 // Try doing init if proper conditions are met. 696 function tryInit(options, $that) { 697 if (options.initialized === true) { 698 return true; 699 } 700 701 if ($('body').width() < options.minWidth) { 702 return false; 703 } 704 705 init(options, $that); 706 707 return true; 708 } 709
710 // Init the sticky sidebar(s). 711 function init(options, $that) { 712 options.initialized = true; 713 714 // Add CSS 715 $('head').append($('<style>.theiaStickySidebar:after {content: ""; display: table; clear: both;}</style>')); 716 717 $that.each(function () { 718 var o = {}; 719 720 o.sidebar = $(this); 721 722 // Save options 723 o.options = options || {}; 724 725 // Get container 726 o.container = $(o.options.containerSelector); 727 if (o.container.size() == 0) { 728 o.container = o.sidebar.parent(); 729 } 730 731 // Create sticky sidebar 732 o.sidebar.parents().css('-webkit-transform', 'none'); // Fix for WebKit bug - https://code.google.com/p/chromium/issues/detail?id=20574 733 o.sidebar.css({ 734 'position': 'relative', 735 'overflow': 'visible', 736 // The "box-sizing" must be set to "content-box" because we set a fixed height to this element when the sticky
736sidebar has a fixed position. 737 '-webkit-box-sizing': 'border-box', 738 '-moz-box-sizing': 'border-box', 739 'box-sizing': 'border-box' 740 }); 741 742 // Get the sticky sidebar element. If none has been found, then create one. 743 o.stickySidebar = o.sidebar.find('.theiaStickySidebar'); 744 if (o.stickySidebar.length == 0) { 745 o.sidebar.find('script').remove(); // Remove <script> tags, otherwise they will be run again on the next line. 746 o.stickySidebar = $('<div>').addClass('theiaStickySidebar').append(o.sidebar.children()); 747 o.sidebar.append(o.stickySidebar); 748 } 749 750 // Get existing top and bottom margins and paddings 751 o.marginTop = parseInt(o.sidebar.css('margin-top')); 752 o.marginBottom = parseInt(o.sidebar.css('margin-bottom')); 753 o.paddingTop = parseInt(o.sidebar.css('padding-top')); 754 o.paddingBottom = parseInt(o.sidebar.css('padding-bottom')); 755
756 // Add a temporary padding rule to check for collapsable margins. 757 var collapsedTopHeight = o.stickySidebar.offset().top; 758 var collapsedBottomHeight = o.stickySidebar.outerHeight(); 759 o.stickySidebar.css('padding-top', 1); 760 o.stickySidebar.css('padding-bottom', 1); 761 collapsedTopHeight -= o.stickySidebar.offset().top; 762 collapsedBottomHeight = o.stickySidebar.outerHeight() - collapsedBottomHeight - collapsedTopHeight; 763 if (collapsedTopHeight == 0) { 764 o.stickySidebar.css('padding-top', 0); 765 o.stickySidebarPaddingTop = 0; 766 } 767 else { 768 o.stickySidebarPaddingTop = 1; 769 } 770 771 if (collapsedBottomHeight == 0) { 772 o.stickySidebar.css('padding-bottom', 0); 773 o.stickySidebarPaddingBottom = 0; 774 } 775 else { 776 o.stickySidebarPaddingBottom = 1; 777 } 778 779 // We use this to know whether the user is scrolling up or down. 780 o.previousScrollTop = null; 781 782 // Scroll top (value) when the sidebar has fixed position. 783 o.fixedScrollTop = 0; 784 785 // Set sidebar to default values. 786 resetSidebar(); 787 788 o.onScroll = function (o) { 789 // Stop if the sidebar isn't visible. 790 if (!o.stickySidebar.is(":visible")) { 791 return; 792 } 793 794 // Stop if the window is too small. 795 if ($('body').width() < o.options.minWidth) { 796 resetSidebar(); 797 return; 798 } 799 800 // Stop if the sidebar width is larger than the container width (e.g. the theme is responsive and the sidebar is now below the content) 801 if (o.options.disableOnResponsiveLayouts) { 802 var sidebarWidth = o.sidebar.outerWidth(o.sidebar.css('float') == 'none'); 803 804 if (sidebarWidth + 50 > o.container.width()) { 805 resetSidebar(); 806 return; 807 } 808 } 809 810 var scrollTop = $(document).scrollTop(); 811 var position = 'static'; 812 813 // If the user has scrolled down enough for the sidebar to be clipped at the top, then we can consider changing its position. 814 if (scrollTop >= o.container.offset().top + (o.paddingTop + o.marginTop - o.options.additionalMarginTop)) { 815 // The top and bottom offsets, used in various calculations. 816 var offsetTop = o.paddingTop + o.marginTop + options.additionalMarginTop; 817 var offsetBottom = o.paddingBottom + o.marginBottom + options.additionalMarginBottom; 818 819 // All top and bottom positions are relative to the window, not to the parent elemnts. 820 var containerTop = o.container.offset().top; 821 var containerBottom = o.container.offset().top + getClearedHeight(o.container); 822 823 // The top and bottom offsets relative to the window screen top (zero) and bottom (window height). 824 var windowOffsetTop = 0 + options.additionalMarginTop; 825 var windowOffsetBottom; 826 827 var sidebarSmallerThanWindow = (o.stickySidebar.outerHeight() + offsetTop + offsetBottom) < $(window).height(); 828 if (sidebarSmallerThanWindow) { 829 windowOffsetBottom = windowOffsetTop + o.stickySidebar.outerHeight(); 830 } 831 else { 832 windowOffsetBottom = $(window).height() - o.marginBottom - o.paddingBottom - options.additionalMarginBottom; 833 } 834 835 var staticLimitTop = containerTop - scrollTop + o.paddingTop + o.marginTop; 836 var staticLimitBottom = containerBottom - scrollTop - o.paddingBottom - o.marginBottom; 837 838 var top = o.stickySidebar.offset().top - scrollTop; 839 var scrollTopDiff = o.previousScrollTop - scrollTop; 840 841 // If the sidebar position is fixed, then it won't move up or down by itself. So, we manually adjust the top coordinate. 842 if (o.stickySidebar.css('position') == 'fixed') { 843 if (o.options.sidebarBehavior == 'modern') { 844 top += scrollTopDiff; 845 } 846 } 847 848 if (o.options.sidebarBehavior == 'stick-to-top') { 849 top = options.additionalMarginTop; 850 } 851 852 if (o.options.sidebarBehavior == 'stick-to-bottom') { 853 top = windowOffsetBottom - o.stickySidebar.outerHeight(); 854 } 855 856 if (scrollTopDiff > 0) { // If the user is scrolling up. 857 top = Math.min(top, windowOffsetTop); 858 } 859 else { // If the user is scrolling down. 860 top = Math.max(top, windowOffsetBottom - o.stickySidebar.outerHeight()); 861 } 862 863 top = Math.max(top, staticLimitTop); 864 865 top = Math.min(top, staticLimitBottom - o.stickySidebar.outerHeight()); 866 867 // If the sidebar is the same height as the container, we won't use fixed positioning. 868 var sidebarSameHeightAsContainer = o.container.height() == o.stickySidebar.outerHeight(); 869 870 if (!sidebarSameHeightAsContainer && top == windowOffsetTop) { 871 position = 'fixed'; 872 } 873 else if (!sidebarSameHeightAsContainer && top == windowOffsetBottom - o.stickySidebar.outerHeight()) { 874 position = 'fixed'; 875 } 876 else if (scrollTop + top - o.sidebar.offset().top - o.paddingTop <= options.additionalMarginTop) { 877 // Stuck to the top of the page. No special behavior. 878 position = 'static'; 879 } 880 else { 881 // Stuck to the bottom of the page. 882 position = 'absolute'; 883 } 884 } 885 886 /*
887 * Performance notice: It's OK to set these CSS values at each resize/scroll, even if they don't change. 888 * It's way slower to first check if the values have changed. 889 */ 890 if (position == 'fixed') { 891 o.stickySidebar.css({ 892 'position': 'fixed', 893 'width': o.sidebar.width(), 894 'top': top, 895 'left': o.sidebar.offset().left + parseInt(o.sidebar.css('padding-left')) 896 }); 897 } 898 else if (position == 'absolute') { 899 var css = {}; 900 901 if (o.stickySidebar.css('position') != 'absolute') { 902 css.position = 'absolute'; 903 css.top = scrollTop + top - o.sidebar.offset().top - o.stickySidebarPaddingTop - o.stickySidebarPaddingBottom; 904 } 905 906 css.width = o.sidebar.width(); 907 css.left = ''; 908 909 o.stickySidebar.css(css); 910 } 911 else if (position == 'static') { 912 resetSidebar(); 913 } 914 915 if (position != 'static') { 916 if (o.options.updateSidebarHeight == true) { 917 o.sidebar.css({ 918 'min-height': o.stickySidebar.outerHeight() + o.stickySidebar.offset().top - o.sidebar.offset().top + o.paddingBottom 919 }); 920 } 921 } 922 923 o.previousScrollTop = scrollTop; 924 }; 925 926 // Initialize the sidebar's position. 927 o.onScroll(o); 928 929 // Recalculate the sidebar's position on every scroll and resize. 930 $(document).scroll(function (o) { 931 return function () { 932 o.onScroll(o); 933 }; 934 }(o)); 935 $(window).resize(function (o) { 936 return function () { 937 o.stickySidebar.css({'position': 'static'}); 938 o.onScroll(o); 939 }; 940 }(o)); 941 942 // Reset the sidebar to its default state 943 function resetSidebar() { 944 o.fixedScrollTop = 0; 945 o.sidebar.css({ 946 'min-height': '1px' 947 }); 948 o.stickySidebar.css({ 949 'position': 'static', 950 'width': '' 951 }); 952 } 953 954 // Get the height of a div as if its floated children were cleared. Note that this function fails if the floats are more than one level deep. 955 function getClearedHeight(e) { 956 var height = e.height(); 957 958 e.children().each(function () { 959 height = Math.max(height, $(this).height()); 960 }); 961 962 return height; 963 } 964 }); 965 } 966 } 967})(jQuery); 968; 969jQuery(document).ready(function ($) { 970 if ($('#loader-wrapper').length > 0) { 971 // hide preloader when everthing in the document load 972 $('#loader-wrapper').css('display', 'none'); 973 } 974 975 //Open Search form on search icon click 976 if ($('.search-icon-box').length > 0) { 977 $('.search-icon-box').on('click', function (e) { 978 e.preventDefault(); 979 refined_magazine_search(); 980 981 }); 982 } 983 984 function refined_magazine_search(e) { 985 $('.top-bar-search').addClass('open'); 986 $('.top-bar-search form input[type="search"]').focus(); 987 var focusableEls = $('.top-bar-search a[href]:not([disabled]), .top-bar-search button:not([disabled]), .top-bar-search input:not([disabled])'); 988 var firstFocusableEl = focusableEls[0]; 989 var lastFocusableEl = focusableEls[focusableEls.length - 1]; 990 var KEYCODE_TAB = 9; 991 $('.top-bar-search').on('keydown', function (e) { 992 if (e.key === 'Tab' || e.keyCode === KEYCODE_TAB) { 993 if (e.shiftKey) /* shift + tab */ { 994 if (document.activeElement === firstFocusableEl) {
995 lastFocusableEl.focus(); 996 e.preventDefault(); 997 } 998 } else /* tab */ { 999 if (document.activeElement === lastFocusableEl) { 1000 firstFocusableEl.focus(); 1001 e.preventDefault(); 1002 } 1003 } 1004 } 1005 }); 1006 } 1007 1008 // Close popup search form 1009 $('.top-bar-search, .top-bar-search .close').on('click', function (event) { 1010 if (event.target == this || event.target.className == 'close' || event.keyCode == 27) { 1011 $('.top-bar-search').removeClass('open'); 1012 $('.search-icon-box').focus(); 1013 } 1014 }); 1015 1016 //Post Slider Widget JS 1017 if ($('.ct-post-carousel').length > 0) { 1018 $(".ct-post-carousel").slick({ 1019 items: 1, 1020 dots: false, 1021 infinite: true, 1022 centerMode: false, 1023 autoplay: true, 1024 lazyLoad: 'ondemand', 1025 adaptiveHeight: true 1026 }); 1027 } 1028 1029 //Tabs 1030 if ($('.ct-tabs').length > 0) { 1031 $(".ct-tabs").tabs(); 1032 } 1033 // Initialize gototop button 1034 if ($('#toTop').length > 0) { 1035 // Hide the toTop button when the page loads. 1036 $("#toTop").css("display", "none"); 1037 1038 // This function runs every time the user scrolls the page. 1039 $(window).scroll(function () { 1040 1041 // Check weather the user has scrolled down (if "scrollTop()"" is more than 0) 1042 if ($(window).scrollTop() > 0) { 1043 1044 // If it's more than or equal to 0, show the toTop button. 1045 $("#toTop").fadeIn("slow"); 1046 } else { 1047 // If it's less than 0 (at the top), hide the toTop button. 1048 $("#toTop").fadeOut("slow"); 1049 1050 } 1051 }); 1052 1053 // When the user clicks the toTop button, we want the page to scroll to the top. 1054 jQuery("#toTop").click(function (event) { 1055 1056 // Disable the default behaviour when a user clicks an empty anchor link. 1057 // (The page jumps to the top instead of // animating) 1058 event.preventDefault(); 1059 1060 // Animate the scrolling motion. 1061 jQuery("html, body").animate({ 1062 scrollTop: 0 1063 }, "slow"); 1064 1065 }); 1066 } 1067 1068 1069 //sticky sidebar 1070 var at_body = $("body"); 1071 var at_window = $(window); 1072 1073 if ($('.ct-sticky-sidebar').length > 0) { 1074 1075 if (at_body.hasClass('ct-sticky-sidebar')) { 1076 if (at_body.hasClass('right-sidebar')) { 1077 $('#secondary, #primary').theiaStickySidebar(); 1078 } else { 1079 $('#secondary, #primary').theiaStickySidebar(); 1080 } 1081 } 1082 } 1083 1084 //Trending News Marquee 1085 if ($('.trending-left').length > 0) { 1086 $('.trending-left').marquee({ 1087 //speed in milliseconds of the marquee 1088 duration: 85000, 1089 //gap in pixels between the tickers 1090 gap: 0, 1091 //time in milliseconds before the marquee will start animating 1092 delayBeforeStart: 0, 1093 //'left' or 'right' 1094 direction: 'left', 1095 //true or false - should the marquee be duplicated to show an effect of continues flow 1096 duplicated: true, 1097 1098 pauseOnHover: true, 1099 startVisible: true 1100 }); 1101 } 1102 1103 //Trending News Marquee 1104 if ($('.trending-right').length > 0) { 1105 $('.trending-right').marquee({ 1106 //speed in milliseconds of the marquee 1107 duration: 85000, 1108 //gap in pixels between the tickers 1109 gap: 0, 1110 //time in milliseconds before the marquee will start animating 1111 delayBeforeStart: 0, 1112 //'left' or 'right' 1113 direction: 'right', 1114 //true or false - should the marquee be duplicated to show an effect of continues flow 1115 duplicated: true, 1116 1117 pauseOnHover: true, 1118 startVisible: true 1119 }); 1120 } 1121 1122 if (jQuery('.sticky-header').length > 0) { 1123 // grab the initial top offset of the navigation 1124 var stickyNavTop = $('.sticky-header').offset().top; 1125 1126 1127 // our function that decides weather the navigation bar should have "fixed" css position or not. 1128 var stickyNav = function () { 1129 var width = $(window).width(); 1130 var scrollTop = $(window).scrollTop(); // our current vertical position from the top 1131 1132 // if we've scrolled more than the navigation, change its position to fixed to stick to top, 1133 // otherwise change it back to relative 1134 if ((scrollTop > stickyNavTop) && (width > 768)) { 1135 $('.sticky-header').addClass('ct-sticky'); 1136 $('.sticky-header').removeClass('hide'); 1137 } else { 1138 $('.sticky-header').removeClass('ct-sticky'); 1139 $('.sticky-header').addClass('hide'); 1140 } 1141 }; 1142 1143 stickyNav(); 1144 // and run it again every time you scroll 1145 $(window).scroll(function () { 1146 stickyNav(); 1147 }); 1148 } 1149 1150 if (jQuery('.ct-show-hide-top').length > 0) { 1151 $('.ct-show-hide-top').on('click', function (e) { 1152 e.preventDefault(); 1153 $('.top-bar .container-inner').toggle('slow'); 1154 $(this).toggleClass('ct-rotate'); 1155 }); 1156 } 1157 1158 1159 $('.main-navigation').on('keydown', function (e) { 1160 if ($('.main-navigation').hasClass('toggled')) { 1161 var focusableEls = $(' .main-navigation .menu-toggle, .main-navigation a[href]:not([disabled]), .main-navigation li'); 1162 var firstFocusableEl = focusableEls[0]; 1163 var lastFocusableEl = focusableEls[focusableEls.length - 1]; 1164 var KEYCODE_TAB = 9; 1165 if (e.key === 'Tab' || e.keyCode === KEYCODE_TAB) { 1166 if (e.shiftKey) /* shift + tab */ { 1167 if (document.activeElement === firstFocusableEl) {
1168 lastFocusableEl.focus(); 1169 e.preventDefault(); 1170 } 1171 } else /* tab */ { 1172 if (document.activeElement === lastFocusableEl) { 1173 firstFocusableEl.focus(); 1174 e.preventDefault(); 1175 } 1176 } 1177 } 1178 } 1179 }); 1180 1181 1182});; 1183!function(){"use strict";var e,t={noop:function(){},texturize:function(e){return(e=(e=(e=(e+="").replace(/'/g,"’").replace(/'/g,"’")).replace(/"/g,"”").replace(/"/g,"”").replace(/"/g,"”").replace(/[\u201D]/g,"”")).replace(/([\w]+)=&#[\d]+;(.+?)&#[\d]+;/g,'$1="$2"')).trim()},applyReplacements:function(e,t){if(e)return t?e.replace(/{(\d+)}/g,function(e,r){return void 0!==t[r]?t[r]:e}):e},getBackgroundImage:function(e){var t=document.createElement("canvas"),r=t.getContext&&t.getContext("2d");if(e){r.filter="blur(20px) ",r.drawImage(e,0,0);var o=t.toDataURL("image/png");return t=null,o}}},r=function(){function e(e,t){return Element.prototype.matches?e.matches(t):Element.prototype.msMatchesSelector?e.msMatchesSelector(t):void 0}function r(e,t,r,o){if(!e)return o();e.jpCarouselCancelFade&&e.jpCarouselCancelFade(),e.classList.remove("jp-carousel-fade"),e.style.removeProperty("display"),e.style.opacity=t,e.style.pointerEvents="none",e.offsetWidth,e.classList.add("jp-carousel-fade"),e.style.opacity=r;var a=1e3*parseFloat(getComputedStyle(e).transitionDuration)||0,i=setTimeout(function(){e.jpCarouselCancelFade=null,e.style.removeProperty("pointer-events"),o()},a+50);e.jpCarouselCancelFade=function(){clearTimeout(i),e.jpCarouselCancelFade=null}}return{closest:function(t,r){if(t.closest)return t.closest(r);var o=t;do{if(e(o,r))return o;o=o.parentElement||o.parentNode}while(null!==o&&1===o.nodeType);return null},matches:e,hide:function(e){e&&(e.style.display="none")},show:function(e){e&&(e.style.display="block")},fadeIn:function(e,o){r(e,0,1,o=o||t.noop)},fadeOut:function(e,o){o=o||t.noop,r(e,1,0,function(){e&&(e.style.display="none"),o()})},scrollToElement:function(e,t,r){if(!e||!t)return r?r():void 0;var o=t.querySelector(".jp-carousel-info-extra");o&&(o.style.minHeight=window.innerHeight-64+"px");var a=!0,i=Date.now(),n=t.scrollTop,l=Math.max(0,e.offsetTop-Math.max(0,window.innerHeight-function(e){var t=e.querySelector(".jp-carousel-info-footer"),r=e.querySelector(".jp-carousel-info-extra"),o=e.querySelector(".jp-carousel-info-content-wrapper");if(t&&r&&o){var a=window.getComputedStyle(r),i=parseInt(a.paddingTop,10)+parseInt(a.paddingBottom,10);return i=isNaN(i)?0:i,o.offsetHeight+t.offsetHeight+i}return 0}(t)))-t.scrollTop;function s(){a=!1}l=Math.min(l,t.scrollHeight-window.innerHeight),t.addEventListener("wheel",s),function e(){var c,u=Date.now(),d=(c=(u-i)/300)<.5?2*c*c:1-Math.pow(-2*c+2,2)/2,p=(d=d>1?1:d)*l;if(t.scrollTop=n+p,u<=i+300&&a)return requestAnimationFrame(e);r&&r(),o&&(o.style.minHeight=""),a=!1,t.removeEventListener("wheel",s)}()},getJSONAttribute:function(e,t){if(e&&e.hasAttribute(t))try{return JSON.parse(e.getAttribute(t))}catch{return}},convertToPlainText:function(e){var t=document.createElement("div");return t.textContent=e,t.innerHTML},stripHTML:function(e){var t=document.createElement("div");return t.innerHTML=e.replace(/<[^>]*>?/gm,""),t.textContent},emitEvent:function(e,t,r){var o;try{o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r||null})}catch{(o=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,r||null)}e.dispatchEvent(o)},isTouch:function(){return"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch}}}();function o(){var o,a,i,n,l="",s=!1,c="div.gallery, div.tiled-gallery, ul.wp-block-gallery, ul.blocks-gallery-grid, figure.wp-block-gallery.has-nested-images, div.wp-block-jetpack-tiled-gallery, a.single-image-gallery",u=".gallery-item, .tiled-gallery-item, .blocks-gallery-item, .tiled-gallery__item",d=u+", .wp-block-image",p={},m="undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.stat?wpcom.carousel.stat:t.noop,g="undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.pageview?wpcom.carousel.pageview:t.noop;function h(t){if(!s)switch(t.which){case 38:t.preventDefault(),p.overlay.scrollTop-=100;break;case 40:t.preventDefault(),p.overlay.scrollTop+=100;break;case 39:t.preventDefault(),e.slideNext();break;case 37:case 8:t.preventDefault(),e.slidePrev();break;case 27:t.preventDefault(),x()}}function f(){s=!0}function v(){s=!1}function y(e){e.role="button",e.tabIndex=0,e.ariaLabel=jetpackCarouselStrings.image_label}function w(){p.overlay||(p.overlay=document.querySelector(".jp-carousel-overlay"),p.container=p.overlay.querySelector(".jp-carousel-wrap"),p.gallery=p.container.querySelector(".jp-carousel"),p.info=p.overlay.querySelector(".jp-carousel-info"),p.caption=p.info.querySelector(".jp-carousel-caption"),p.commentField=p.overlay.querySelector("#jp-carousel-comment-form-comment-field"),p.emailField=p.overlay.querySelector("#jp-carousel-comment-form-email-field"),p.authorField=p.overlay.querySelector("#jp-carousel-comment-form-author-field"),p.urlField=p.overlay.querySelector("#jp-carousel-comment-form-url-field"),window.innerWidth<=760&&Math.round(window.innerWidth/760*110)<40&&r.isTouch(),[p.commentField,p.emailField,p.authorField,p.urlField].forEac
1183h(function(e){e&&(e.addEventListener("focus",f),e.addEventListener("blur",v))}),p.overlay.addEventListener("click",function(e){var t,o,a=e.target,i=!!r.closest(a,".jp-carousel-close-hint"),n=!!window.matchMedia("(max-device-width: 760px)").matches;a===p.overlay?n||x():i?x():a.classList.contains("jp-carousel-image-download")?m("download_original_click"):a.classList.contains("jp-carousel-comment-login")?(t=p.currentSlide,o=t?t.attrs.attachmentId:"0",window.location.href=jetpackCarouselStrings.login_url+"%23jp-carousel-"+o):r.closest(a,"#jp-carousel-comment-form-container")?function(e){var t=e.target,o=r.getJSONAttribute(p.container,"data-carousel-extra")||{},a=p.currentSlide.attrs.attachmentId,i=document.querySelector("#jp-carousel-comment-form-submit-and-info-wrapper"),n=document.querySelector("#jp-carousel-comment-form-spinner"),l=document.querySelector("#jp-carousel-comment-form-button-submit"),s=document.querySelector("#jp-carousel-comment-form");if(p.commentField&&p.commentField.getAttribute("id")===t.getAttribute("id"))f(),r.show(i);else if(r.matches(t,'input[type="submit"]')){e.preventDefault(),e.stopPropagation(),r.show(n),s.classList.add("jp-carousel-is-disabled");var c={action:"post_attachment_comment",nonce:jetpackCarouselStrings.nonce,blog_id:o.blog_id,id:a,comment:p.commentField.value};if(!c.comment.length)return void j(jetpackCarouselStrings.no_comment_text,!1);if(1!==Number(jetpackCarouselStrings.is_logged_in)&&(c.email=p.emailField.value,c.author=p.authorField.value,c.url=p.urlField.value,1===Number(jetpackCarouselStrings.require_name_email))){if(!c.email.length||!c.email.match("@"))return void j(jetpackCarouselStrings.no_comment_email,!1);if(!c.author.length)return void j(jetpackCarouselStrings.no_comment_author,!1)}var u=new XMLHttpRequest;u.open("POST",jetpackCarouselStrings.ajaxurl,!0),u.setRequestHeader("X-Requested-With","XMLHttpRequest"),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),u.onreadystatechange=function(){if(this.readyState===XMLHttpRequest.DONE&&this.status>=200&&this.status<300){var e;try{e=JSON.parse(this.response)}catch{return void j(jetpackCarouselStrings.comment_post_error,!1)}"approved"===e.comment_status?j(jetpackCarouselStrings.comment_approved,!0):"unapproved"===e.comment_status?j(jetpackCarouselStrings.comment_unapproved,!0):j(jetpackCarouselStrings.comment_post_error,!1),H(),q(a),l.value=jetpackCarouselStrings.post_comment,r.hide(n),s.classList.remove("jp-carousel-is-disabled")}else j(jetpackCarouselStrings.comment_post_error,!1)};var d=[];for(var m in c)if(m){var g=encodeURIComponent(m)+"="+encodeURIComponent(c[m]);d.push(g.replace(/%20/g,"+"))}var h=d.join("&");u.send(h)}}(e):(r.closest(a,".jp-carousel-photo-icons-container")||a.classList.contains("jp-carousel-photo-title"))&&function(e){e.preventDefault();var t=e.target,o=p.info.querySelector(".jp-carousel-info-extra"),a=p.info.querySelector(".jp-carousel-image-meta"),i=p.info.querySelector(".jp-carousel-comments-wrapper"),n=p.info.querySelector(".jp-carousel-icon-info"),l=p.info.querySelector(".jp-carousel-icon-comments");function s(){l&&l.classList.remove("jp-carousel-selected"),n.classList.toggle("jp-carousel-selected"),i&&i.classList.remove("jp-carousel-show"),a&&(a.classList.toggle("jp-carousel-show"),a.classList.contains("jp-carousel-show")?o.classList.add("jp-carousel-show"):o.classList.remove("jp-carousel-show"))}function c(){n&&n.classList.remove("jp-carousel-selected"),l.classList.toggle("jp-carousel-selected"),a&&a.classList.remove("jp-carousel-show"),i&&(i.classList.toggle("jp-carousel-show"),i.classList.contains("jp-carousel-show")?o.classList.add("jp-carousel-show"):o.classList.remove("jp-carousel-show"))}(r.closest(t,".jp-carousel-icon-info")||t.classList.contains("jp-carousel-photo-title"))&&(a&&a.classList.contains("jp-carousel-show")?r.scrollToElement(p.overlay,p.overlay,s):(s(),r.scrollToElement(p.info,p.overlay))),r.closest(t,".jp-carousel-icon-comments")&&(i&&i.classList.contains("jp-carousel-show")?r.scrollToElement(p.overlay,p.overlay,c):(c(),r.scrollToElement(p.info,p.overlay)))}(e)}),window.addEventListener("keydown",h),p.overlay.addEventListener("jp_carousel.afterOpen",function(){v(),p.slides.length<=1||(p.slides.length<=5?r.show(p.info.querySelector(".jp-swiper-pagination")):r.show(p.info.querySelector(".jp-carousel-pagination")))}),p.overlay.addEventListener("jp_carousel.beforeClose",function(){f(),document.documentElement.style.removeProperty("height"),e&&e.enable(),r.hide(p.info.querySelector(".jp-swiper-pagination")),r.hide(p.info.querySelector(".jp-carousel-pagination"))}),p.overlay.addEventListener("jp_carousel.afterClose",function(){window.history.pushState?history.pushState("",document.title,window.location.pathname+window.location.search):window.location.href="",l="",p.isOpen=!1}),p.overlay.addEventListener("touchstart",function(e){e.touches.length>1&&e.preventDefault()}))}function j(e,t){var o=p.overlay.querySelector("#jp-carousel-comment-post-results"),a="jp-carousel-comment-post-"+(t?"success":"error");o.innerHTML='<span class="'+a+'">'+e+"</span>",r.hide(p.overlay.querySelector("#jp-carousel-comment-form-spinner")),p.overlay.querySelector("#jp-carousel-comment-form").classList.remove("jp-carousel-is-disabled"),r.show(o)}function b(){var e=document.querySelectorAll("a img[data-attachment-id]");Array.prototype.forEach.call(e,function(e){var t=e.parentElement,o=t.parentElement;if(!o.classList.contains("gallery-icon")&&!r.closest(o,u)&&t.hasAttribute("href")){var a=!1;t.getAttribute("href").split("?")[0]===e.getAttribute("data-orig-file").split("?")[0]&&1===Number(jetpackCarouselStrings.single_image_gallery_media_file)&&(a=!0),t.getAttribute("href")===e.getAttribute("data-permalink")&&(a=!0),a&&(y(e),t.classList.add("single-image-gallery"),t.setAttribute("data-carousel-extra",JSON.stringify({blog_id:Number(jetpackCarouselStrings.blog_id)})))}})}function S(t,r){p.isOpen?(L(r),e.slideTo(r+1)):M(t,{startIndex:r})}function L(e){(!e||e<0||e>p.slides.length)&&(e=0),p.currentSlide=p.slides[e];var o,a,i=p.currentSlide,n=i.attrs.attachmentId;A(p.slides[e]),function(e){var t=[],r=p.slides.length;if(r>1){var o=e>0?e-1:r-1;t.push(o);var a=e<r-1?e+1:0;t.push(a)}t.forEach(function(e){var t=p.slides[e];t&&(A(t),1!==Number(jetpackCarouselStrings.display_background_image)||t.backgroundImage||_(t))})}(e),1!==Number(jetpackCarouselStrings.display_background_image)||p.slides[e].backgroundImage||_(p.slides[e]),r.hide(p.caption),function(e){var t,o,a,i,n,l,s;if(i=p.overlay.querySelector(".jp-carousel-photo-caption"),n=p.overlay.querySelector(".jp-carousel-caption"),l=p.overlay.querySelector(".jp-carousel-photo-title"),s=p.overlay.querySelector(".jp-carousel-photo-description"),r.hide(i),r.hide(n),r.hide(l),r.hide(s),t=E(e.caption)||"",o=E(e.title)||"",a=E(e.desc)||"",(t||o||a)&&(t&&(i.innerHTML=t,n.innerHTML=t,r.show(i),r.show(n)),r.stripHTML(t)===r.stripHTML(o)&&(o=""),r.stripHTML(t)===r.stripHTML(a)&&(a=""),r.stripHTML(o)===r.stripHTML(a)&&(a=""),a&&(s.innerHTML=a,r.show(s),o||t||(i.textContent=r.stripHTML(a),r.show(i))),o)){var c=r.stripHTML(o);l.textContent=c,t||(i.textContent=c,n.textContent=c,r.show(i)),r.show(l)}}
1183({caption:i.attrs.caption,title:i.attrs.title,desc:i.attrs.desc}),function(e){if(!e||1!==Number(jetpackCarouselStrings.display_exif))return!1;var t=p.info.querySelector(".jp-carousel-image-meta");if(!t)return!1;var r="";for(var o in e){var a=e[o],i=jetpackCarouselStrings.meta_data||[];if(0!==parseFloat(a)&&a.length&&-1!==i.indexOf(o)){switch(o){case"focal_length":a+="mm";break;case"shutter_speed":a=C(a);break;case"aperture":a="f/"+a}r+="<li><h5>"+jetpackCarouselStrings[o]+"</h5>"+a+"</li>"}}var n=t.querySelector("ul.jp-carousel-image-exif");if(""!==r){if(!n){(n=document.createElement("ul")).className="jp-carousel-image-exif";var l=t.querySelector(".jp-carousel-title-and-caption");l&&l.nextSibling?t.insertBefore(n,l.nextSibling):t.insertBefore(n,t.firstChild)}n.innerHTML=r,n.style.removeProperty("display")}else n&&n.parentNode.removeChild(n)}(p.slides[e].attrs.imageMeta),function(e){if(!e)return!1;var r,o=[e.attrs.origWidth,e.attrs.origHeight],a=document.createElement("a");a.href=e.attrs.src.replace(/\?.+$/,""),r=null!==a.hostname.match(/^i[\d]{1}\.wp\.com$/i)?a.href:e.attrs.origFile.replace(/\?.+$/,"");var i=p.info.querySelector(".jp-carousel-download-text"),n=p.info.querySelector(".jp-carousel-image-download");i.innerHTML=t.applyReplacements(jetpackCarouselStrings.download_original,o),n.setAttribute("href",r),n.style.removeProperty("display")}(i),1===Number(jetpackCarouselStrings.display_comments)&&(o=p.slides[e].attrs.commentsOpened,a=p.info.querySelector("#jp-carousel-comment-form-container"),1===parseInt(o,10)?r.fadeIn(a):r.fadeOut(a),q(n),r.hide(p.info.querySelector("#jp-carousel-comment-post-results")));var s=p.info.querySelector(".jp-carousel-pagination");if(s&&p.slides.length>5){var c=e+1;s.innerHTML="<span>"+c+" / "+p.slides.length+"</span>"}jetpackCarouselStrings.stats&&p.isOpen&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?"+jetpackCarouselStrings.stats+"&post="+encodeURIComponent(n)+"&rand="+Math.random()),p.isOpen&&g(n),l="#jp-carousel-"+n,window.location.hash=l}function x(){document.body.style.overflow=a,document.documentElement.style.overflow=i,H(),f(),r.emitEvent(p.overlay,"jp_carousel.beforeClose"),window.scrollTo(window.scrollX||window.pageXOffset||0,n||0),p.isOpen=!1,e.destroy(),p.slides=[],p.currentSlide=void 0,p.gallery.innerHTML="",r.fadeOut(p.overlay,function(){r.emitEvent(p.overlay,"jp_carousel.afterClose")})}function k(e){if("object"!=typeof e&&(e={}),void 0===e.origFile)return"";if(void 0===e.origWidth||void 0===e.maxWidth)return e.origFile;if(!e.largeFile)return e.origFile;var t=document.createElement("a");t.href=e.largeFile;var r=/^i[0-2]\.wp\.com$/i.test(t.hostname),o=function(e,t,r){var o,a=r?e.replace(/.*=([\d]+%2C[\d]+).*$/,"$1"):e.replace(/.*-([\d]+x[\d]+)\..+$/,"$1");return"9999"===(o=a!==e?r?a.split("%2C"):a.split("x"):[t,0])[0]&&(o[0]="0"),"9999"===o[1]&&(o[1]="0"),o}(e.largeFile,e.origWidth,r),a=parseInt(o[0],10),i=parseInt(o[1],10);if(e.origMaxWidth=e.maxWidth,e.origMaxHeight=e.maxHeight,void 0!==window.devicePixelRatio&&window.devicePixelRatio>1&&(e.maxWidth=e.maxWidth*window.devicePixelRatio,e.maxHeight=e.maxHeight*window.devicePixelRatio),a>=e.maxWidth||i>=e.maxHeight)return e.largeFile;if(r){if(-1===e.largeFile.lastIndexOf("?"))return e.largeFile;var n=function(e){var t;try{t=new URL(e)}catch(t){return e}var r=["quality","ssl","filter","brightness","contrast","colorize","smooth"],o=Array.from(t.searchParams.entries());return t.search="",o.forEach(([e,o])=>{r.includes(e)&&t.searchParams.append(e,o)}),t}(e.largeFile);return(e.origWidth>e.maxWidth||e.origHeight>e.maxHeight)&&(e.origMaxWidth=2*e.maxWidth,e.origMaxHeight=2*e.maxHeight,n.searchParams.set("fit",e.origMaxWidth+","+e.origMaxHeight)),n.toString()}return e.origFile}function C(e){return e>=1?Math.round(10*e)/10+"s":"1/"+Math.round(1/e)+"s"}function E(e){return!e.match(" ")&&e.match("_")?"":e}function q(e,t){var a=void 0===t,i=p.info.querySelector(".jp-carousel-icon-comments .jp-carousel-has-comments-indicator");if(i.classList.remove("jp-carousel-show"),clearInterval(o),e){(!t||t<1)&&(t=0);var n=p.info.querySelector(".jp-carousel-comments"),l=p.info.querySelector("#jp-carousel-comments-loading");r.show(l),a&&(r.hide(n),n.innerHTML="");var s=new XMLHttpRequest,c=jetpackCarouselStrings.ajaxurl+"?action=get_attachment_comments&nonce="+jetpackCarouselStrings.nonce+"&id="+e+"&offset="+t;s.open("GET",c),s.setRequestHeader("X-Requested-With","XMLHttpRequest");var u=function(){r.fadeIn(n),r.fadeOut(l)};s.onload=function(){if(p.currentSlide&&p.currentSlide.attrs.attachmentId===e){var c,d=s.status>=200&&s.status<300;try{c=JSON.parse(s.responseText)}catch{}if(!d||!c||!Array.isArray(c))return u();a&&(n.innerHTML="");for(var m=0;m<c.length;m++){var g=c[m],h=document.createElement("div");h.classList.add("jp-carousel-comment"),h.setAttribute("id","jp-carousel-comment-"+g.id),h.innerHTML='<div class="comment-gravatar">'+g.gravatar_markup+'</div><div class="comment-content"><div class="comment-author">'+g.author_markup+'</div><div class="comment-date">'+g.date_gmt+"</div>"+g.content+"</div>",n.appendChild(h),clearInterval(o),o=setInterval(function(){p.container.scrollTop+150>window.innerHeight&&(q(e,t+10),clearInterval(o))},300)}c.length>0&&(r.show(n),i.innerText=c.length,i.classList.add("jp-carousel-show")),r.hide(l)}},s.onerror=u,s.send()}}function A(e){var t=e.attrs,r=e.el.querySelector("img");if(!r.hasAttribute("data-loaded"))if(r.setAttribute("itemprop","image"),r.setAttribute("data-loaded",1),t.previewImage&&t.previewImage!==t.src){r.src=t.previewImage,r.style.filter="blur(8px)";var o=new window.Image;o.addEventListener("load",function(){r.src=t.src,r.style.filter=""},{once:!0}),o.addEventListener("error",function(){r.style.filter=""},{once:!0}),o.src=t.src}else r.src=t.src}function _(e){var t=e.attrs.originalElement;if(t)if(t.complete&&0!==t.naturalHeight)T(e,t);else{var r=function(){t.removeEventListener("error",o),T(e,t)},o=function(){t.removeEventListener("load",r)};t.addEventListener("load",r,{once:!0}),t.addEventListener("error",o,{once:!0})}}
1183function T(e,r){var o=t.getBackgroundImage(r);o&&(e.backgroundImage=o,e.el.style.backgroundImage="url("+o+")",e.el.style.backgroundSize="cover",e.el.style.backgroundPosition="center")}function H(){p.commentField&&(p.commentField.value="")}function I(e,o){p.slides=[];var a={width:window.innerWidth,height:window.innerHeight-64};0!==o&&null!==e[o].getAttribute("data-gallery-src")&&((new Image).src=e[o].getAttribute("data-gallery-src")),Array.prototype.forEach.call(e,function(e,o){var i=r.closest(e,"a"),n=e.getAttribute("data-orig-file")||e.getAttribute("src-orig"),l=e.getAttribute("data-attachment-id")||e.getAttribute("data-id")||"0",s=document.querySelector('img[data-attachment-id="'+l+'"] + figcaption');s=s?s.innerHTML:e.getAttribute("data-image-caption");var c={originalElement:e,attachmentId:l,commentsOpened:e.getAttribute("data-comments-opened")||"0",imageMeta:r.getJSONAttribute(e,"data-image-meta")||{},title:e.getAttribute("data-image-title")||"",desc:e.getAttribute("data-image-description")||"",largeFile:e.getAttribute("data-large-file")||"",origFile:n||"",thumbSize:{width:e.naturalWidth,height:e.naturalHeight},caption:s||"",permalink:i&&i.getAttribute("href"),src:n||e.getAttribute("src")||""},u=r.closest(e,".tiled-gallery-item"),d=u&&u.querySelector(".tiled-gallery-caption"),m=d&&d.innerHTML;m&&(c.caption=m);var g=function(e){var t=e.getAttribute("data-orig-size")||"";if(t){var r=t.split(",");return{width:parseInt(r[0],10),height:parseInt(r[1],10)}}return{width:e.getAttribute("data-original-width")||e.getAttribute("width")||void 0,height:e.getAttribute("data-original-height")||e.getAttribute("height")||void 0}}(e);if(c.origWidth=g.width||c.thumbSize.width,c.origHeight=g.height||c.thumbSize.height,"undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.generateImgSrc?c.src=wpcom.carousel.generateImgSrc(e,a):c.src=k({origFile:c.src,origWidth:c.origWidth,origHeight:c.origHeight,maxWidth:a.width,maxHeight:a.height,largeFile:c.largeFile}),e.setAttribute("data-gallery-src",c.src),"0"!==c.attachmentId){c.title=t.texturize(c.title),c.desc=t.texturize(c.desc),c.caption=t.texturize(c.caption);var h=new Image,f=document.createElement("div");f.classList.add("swiper-slide"),f.setAttribute("itemprop","associatedMedia"),f.setAttribute("itemscope",""),f.setAttribute("itemtype","https://schema.org/ImageObject");var v=document.createElement("div");v.classList.add("swiper-zoom-container"),p.gallery.appendChild(f),f.appendChild(v),v.appendChild(h),f.setAttribute("data-attachment-id",c.attachmentId),f.setAttribute("data-permalink",c.permalink),f.setAttribute("data-orig-file",c.origFile),c.previewImage=e.currentSrc||e.getAttribute("src")||"";var y={el:f,attrs:c,index:o};p.slides.push(y)}})}function M(e,t){if(!window.JetpackSwiper){var o=document.querySelector("#jp-carousel-loading-overlay");r.show(o);var a=document.createElement("script");return a.id="jetpack-carousel-swiper-js",a.src=window.jetpackSwiperLibraryPath.url,a.async=!0,a.onload=function(){r.hide(o),F(e,t)},a.onerror=function(){r.hide(o)},void document.head.appendChild(a)}F(e,t)}function F(t,o){var l,s={imgSelector:".gallery-item [data-attachment-id], .tiled-gallery-item [data-attachment-id], img[data-attachment-id], img[data-id]",startIndex:0},c=r.getJSONAttribute(t,"data-carousel-extra");if(!c)return;const u=t.querySelectorAll(s.imgSelector);if(u.length&&(w(),!p.isOpen)){for(var d in p.isOpen=!0,a=getComputedStyle(document.body).overflow,document.body.style.overflow="hidden",i=getComputedStyle(document.documentElement).overflow,document.documentElement.style.overflow="hidden",n=window.scrollY||window.pageYOffset||0,p.container.setAttribute("data-carousel-extra",JSON.stringify(c)),m(["open","view_image"]),o||{})s[d]=o[d];-1===s.startIndex&&(s.startIndex=0),r.emitEvent(p.overlay,"jp_carousel.beforeOpen"),p.gallery.innerHTML="",p.overlay.style.opacity=1,p.overlay.style.display="block",I(u,s.startIndex),(e=new window.JetpackSwiper(".jp-carousel-swiper-container",{centeredSlides:!0,zoom:!0,loop:p.slides.length>1,enabled:p.slides.length>1,pagination:{el:".jp-swiper-pagination",clickable:!0},navigation:{nextEl:".jp-swiper-button-next",prevEl:".jp-swiper-button-prev"},initialSlide:s.startIndex,on:{init:function(){L(s.startIndex)}},preventClicks:!1,preventClicksPropagation:!1,preventInteractionOnTransition:!r.isTouch(),threshold:5})).on("slideChange",function(e){p.isOpen&&(L(e.realIndex),p.overlay.classList.remove("jp-carousel-hide-control
1183s"))}),e.on("zoomChange",function(e,t){t>1&&p.overlay.classList.add("jp-carousel-hide-controls"),1===t&&p.overlay.classList.remove("jp-carousel-hide-controls")}),e.on("doubleTap",function(e){if(clearTimeout(l),1===e.zoom.scale)var t=setTimeout(function(){p.overlay.classList.remove("jp-carousel-hide-controls"),clearTimeout(t)},150)}),e.on("tap",function(){e.zoom.scale>1&&(l=setTimeout(function(){p.overlay.classList.toggle("jp-carousel-hide-controls")},150))}),r.fadeIn(p.overlay,function(){r.emitEvent(p.overlay,"jp_carousel.afterOpen")})}}function O(e){if("click"!==e.type){if("keydown"===e.type){const t=document.activeElement.parentElement,r=t&&t.classList.contains("tiled-gallery__item");" "!==e.key&&"Enter"!==e.key||!r||R(e)}}else R(e)}function N(e){return(e||"").split("?")[0].replace(/\/$/,"")}function W(e){"A"===e.tagName&&(e=e.querySelector("img")||e);var t=e.parentElement,o=t?t.parentElement:null,a=null;if(o&&o.classList.contains("wp-block-image")?a=t.getAttribute("href"):t&&t.classList.contains("wp-block-image")&&t.querySelector(":scope > a")&&(a=t.querySelector(":scope > a").getAttribute("href")),a){var i=N(a),n=N(e.getAttribute("data-orig-file")),l=N(e.getAttribute("data-permalink"));if(i!==n&&i!==l)return!1}return!(t&&t.classList.contains("gallery-caption")||r.matches(t,"figcaption"))}function R(e){if(window.CSS&&window.CSS.supports&&window.CSS.supports("display","grid")){var t,o=e.target,a=r.closest(o,c);if(a){if(!(t=a)||!t.getAttribute("data-carousel-extra"))return;if(!W(o))return;document.documentElement.style.height="auto",e.preventDefault(),e.stopPropagation();var i=r.closest(o,d),n=Array.prototype.indexOf.call(a.querySelectorAll(d),i);M(a,{startIndex:n})}}}document.body.addEventListener("click",O),document.body.addEventListener("keydown",O),document.querySelectorAll(u+"img").forEach(function(e){W(e)&&y(e)}),1===Number(jetpackCarouselStrings.single_image_gallery)&&(b(),document.body.addEventListener("is.post-load",function(){b()})),window.addEventListener("hashchange",function(){var e=/jp-carousel-(\d+)/;if(window.location.hash&&e.test(window.location.hash)){if(window.location.hash!==l||!p.isOpen)if(window.location.hash&&p.gallery&&!p.isOpen&&history.back)history.back();else{l=window.location.hash;for(var t=window.location.hash.match(e),r=parseInt(t[1],10),o=document.querySelectorAll(c),a=0;a<o.length;a++){for(var i,n=o[a],s=n.querySelectorAll("img"),u=0;u<s.length;u++)if(parseInt(s[u].getAttribute("data-attachment-id"),10)===r||parseInt(s[u].getAttribute("data-id"),10)===r){i=u;break}if(void 0!==i){S(n,i);break}}}}else p.isOpen&&x()}),window.location.hash&&r.emitEvent(window,"hashchange")}"loading"!==document.readyState?o():document.addEventListener("DOMContentLoaded",o)}();;
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.