vendor: 11,960 bytes, lines 1-6
1/*! 2 Colorbox 1.6.4 3 license: MIT 4 http://www.jacklmoore.com/colorbox 5*/ 6(function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(A+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in x[0]&&!x[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),x.focus())}function c(t){c.str!==t&&(x.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){A=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),A=W.index(_.el),-1===A&&(W=W.add(_.el),A=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!U){U=$=!0,c(_.get("className")),x.css({visibility:"hidden",display:"block",opacity:""}),I=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(I),j=T.height()+k.height()+b.outerHeight(!0)-b.height(),D=C.width()+H.width()+b.outerWidth(!0)-b.width(),N=I.outerHeight(!0),z=I.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=Math.max((l!==!1?Math.min(h,a(l,"x")):h)-z-D,0),_.h=Math.max((f!==!1?Math.min(s,a(f,"y")):s)-N-j,0),I.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(F).hide(),x.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}var p=parseFloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("<div/>"),w()}}function p(){x||(V=!1,E=t(i),x=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),L=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),y=n(se,"Wrapper"),b=n(se,"Content").append(F=n(se,"Title"),R=n(se,"Current"),P=t('<button type="button"/>').attr({id:Z+"Previous"}),K=t('<button type="button"/>').attr({id:Z+"Next"}),S=t('<button type="button"/>').attr({id:Z+"Slideshow"}),L),B=t('<button type="button"/>').attr({id:Z+"Close"}),y.append(n(se).append(n(se,"TopLeft"),T=n(se,"TopCenter"),n(se,"TopRight")),n(se,!1,"clear:left").append(C=n(se,"MiddleLeft"),b,H=n(se,"MiddleRight")),n(se,!1,"clear:left").append(n(se,"BottomLeft"),k=n(se,"BottomCenter"),n(se,"BottomRight"))).find("div div").css({"float":"left"}),M=n(se,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),O=K.add(P).add(R).add(S)),e.body&&!x.parent().length&&t(e.body).append(v,x.append(y,M))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),f(this))}return x?(V||(V=!0,K.click(function(){J.next()}),P.click(function(){J.prev()}),B.click(function(){J.close()}),v.click(function(){_.get("overlayClose")&&J.close()}),t(e).bind("keydown."+Z,function(t){var e=t.keyCode;U&&_.get("escKey")&&27===e&&(t.preventDefault(),J.close()),U&&_.get("arrowKey")&&W[1]&&!t.altKey&&(37===e?(t.preventDefault(),P.click()):39===e&&(t.preventDefault(),K.click()))}),t.isFunction(t.fn.on)?t(e).on("click."+Z,"."+te,i):t("."+te).live("click."+Z,i)),!0):!1}function w(){var e,o,r,h=J.prep,d=++le;if($=!0,q=!1,u(he),u(ie),_.get("onLoad"),_.h=_.get("height")?a(_.get("height"),"y")-N-j:_.get("innerHeight")&&a(_.get("innerHeight"),"y"),_.w=_.get("width")?a(_.get("width"),"x")-z-D:_.get("innerWidth")&&a(_.get("innerWidth"),"x"),_.mw=_.w,_.mh=_.h,_.get("maxWidth")&&(_.mw=a(_.get("maxWidth"),"x")-z-D,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.get("maxHeight")&&(_.mh=a(_.get("maxHeight"),"y")-N-j,_.mh=_.h&&_.h<_.mh?_.h:_.mh),e=_.get("href"),Q=setTimeout(function(){L.show()},100),_.get("inline")){var c=t(e).eq(0);r=t("<div>").hide().insertBefore(c),ae.one(he,function(){r.replaceWith(c)}),h(c)}else _.get("iframe")?h(" "):_.get("html")?h(_.get("html")):s(_,e)?(e=l(_,e),q=_.get("createImg"),t(q).addClass(Z+"Photo").bind("error."+Z,function(){h(n(se,"Error").html(_.get("imgError")))}).one("load",function(){d===le&&setTimeout(function(){var e;_.get("retinaImage")&&i.devicePixelRatio>1&&(q.height=q.height/i.devicePixelRatio,q.width=q.width/i.devicePixelRatio),_.get("scalePhotos")&&(o=function(){q.height-=q.height*e,q.width-=q.width*e},_.mw&&q.width>_.mw&&(e=(q.width-_.mw)/q.width,o()),_.mh&&q.height>_.mh&&(e=(q.height-_.mh)/q.height,o())),_.h&&(q.style.marginTop=Math.max(_.mh-q.height,0)/2+"px"),W[1]&&(_.get("loop")||W[A+1])&&(q.style.cursor="pointer",t(q).bind("click."+Z,function(){J.next()})),q.style.width=q.width+"px",q.style.height=q.height+"px",h(q)},1)}),q.src=e):e&&M.load(e,_.get("data"),function(e,i){d===le&&h("error"===i?n(se,"Error").html(_.get("xhrError")):t(this).contents())})}var v,x,y,b,T,C,H,k,W,E,I,M,L,F,R,S,K,P,B,O,_,j,D,N,z,A,q,U,$,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),n=t(this).data("cbox-iframe-attrs");return"object"==typeof n&&t.each(n,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},Y="colorbox",Z="cbox",te=Z+"Element",ee=Z+"_open",ie=Z+"_load",ne=Z+"_complete",oe=Z+"_cleanup",re=Z+"_closed",he=Z+"_purge",ae=t("<a/>"),se="div",le=0,de={},ce=function(){function t(){clearTimeout(h)}function e(){(_.get("loop")||W[A+1])&&(t(),h=setTimeout(J.next,_.get("slideshowSpeed")))}function i(){S.html(_.get("slideshowStop")).unbind(s).one(s,n),ae.bind(ne,e).bind(ie,t),x.removeClass(a+"off").addClass(a+"on")}function n(){t(),ae.unbind(ne,e).unbind(ie,t),S.html(_.get("slideshowStart")).unbind(s).one(s,function(){J.next(),i()}),x.removeClass(a+"on").addClass(a+"off")}function o(){r=!1,S.hide(),t(),ae.unbind(ne,e).unbind(ie,t),x.removeClass(a+"off "+a+"on")}var r,h,a=Z+"Slideshow_",s="click."+Z;return function(){r?_.get("slideshow")||(ae.unbind(oe,o),o()):_.get("slideshow")&&W[1]&&(r=!0,ae.one(oe,o),_.get("slideshowAuto")?i():n(),S.show())}}();t[Y]||(t(p),J=t.fn[Y]=t[Y]=function(e,i){var n,o=this;return e=e||{},t.isFunction(o)&&(o=t("<a/>"),e.open=!0),o[0]?(p(),m()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,Y)||{};t.data(this,Y,t.extend(i,e))}).addClass(te),n=new r(o[0],e),n.get("open")&&f(o[0])),o):o},J.position=function(e,i){function n(){T[0].style.width=k[0].style.width=b[0].style.width=parseInt(x[0].style.width,10)-D+"px",b[0].style.height=C[0].style.height=H[0].style.height=parseInt(x[0].style.height,10)-j+"px"}var r,h,s,l=0,d=0,c=x.offset();if(E.unbind("resize."+Z),x.css({top:-9e4,left:-9e4}),h=E.scrollTop(),s=E.scrollLeft(),_.get("fixed")?(c.top-=h,c.left-=s,x.css({position:"fixed"})):(l=h,d=s,x.css({position:"absolute"})),d+=_.get("right")!==!1?Math.max(E.width()-_.w-z-D-a(_.get("right"),"x"),0):_.get("left")!==!1?a(_.get("left"),"x"):Math.round(Math.max(E.width()-_.w-z-D,0)/2),l+=_.get("bottom")!==!1?Math.max(o()-_.h-N-j-a(_.get("bottom"),"y"),0):_.get("top")!==!1?a(_.get("top"),"y"):Math.round(Math.max(o()-_.h-N-j,0)/2),x.css({top:c.top,left:c.left,visibility:"visible"}),y[0].style.width=y[0].style.height="9999px",r={width:_.w+z+D,height:_.h+N+j,top:l,left:d},e){var g=0;t.each(r,function(t){return r[t]!==de[t]?(g=e,void 0):void 0}),e=g}de=r,e||x.css(r),x.dequeue().animate(r,{duration:e||0,complete:function(){n(),$=!1,y[0].style.width=_.w+z+D+"px",y[0].style.height=_.h+N+j+"px",_.get("reposition")&&setTimeout(function(){E.bind("resize."+Z,J.position)},1),t.isFunction(i)&&i()},step:n})},J.resize=function(t){var e;U&&(t=t||{},t.width&&(_.w=a(t.width,"x")-z-D),t.innerWidth&&(_.w=a(t.innerWidth,"x")),I.css({width:_.w}),t.height&&(_.h=a(t.height,"y")-N-j),t.innerHeight&&(_.h=a(t.innerHeight,"y")),t.innerHeight||t.height||(e=I.scrollTop(),I.css({height:"auto"}),_.h=I.height()),I.css({height:_.h}),e&&I.scrollTop(e),J.position("none"===_.get("transition")?0:_.get("speed")))},J.prep=function(i){function o(){return _.w=_.w||I.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function a(){return _.h=_.h||I.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if(U){var d,g="none"===_.get("transition")?0:_.get("speed");I.remove(),I=n(se,"LoadedContent").append(i),I.hide().appendTo(M.show()).css({width:o(),overflow:_.get("scrolling")?"auto":"hidden"}).css({height:a()}).prependTo(b),M.hide(),t(q).css({"float":"none"}),c(_.get("className")),d=function(){function i(){t.support.opacity===!1&&x[0].style.removeAttribute("filter")}var n,o,a=W.length;U&&(o=function(){clearTimeout(Q),L.hide(),u(ne),_.get("onComplete")},F.html(_.get("title")).show(),I.show(),a>1?("string"==typeof _.get("current")&&R.html(_.get("current").replace("{current}",A+1).replace("{total}",a)).show(),K[_.get("loop")||a-1>A?"show":"hide"]().html(_.get("next")),P[_.get("loop")||A?"show":"hide"]().html(_.get("previous")),ce(),_.get("preloading")&&t.each([h(-1),h(1)],function(){var i,n=W[this],o=new r(n,t.data(n,Y)),h=o.get("href");h&&s(o,h)&&(h=l(o,h),i=e.createElement("img"),i.src=h)})):O.hide(),_.get("iframe")?(n=_.get("createIframe"),_.get("scrolling")||(n.scrolling="no"),t(n).attr({src:_.get("href"),"class":Z+"Iframe"}).one("load",o).appendTo(I),ae.one(he,function(){n.src="//about:blank"}),_.get("fastIframe")&&t(n).trigger("load")):o(),"fade"===_.get("transition")?x.fadeTo(g,1,i):i())},"fade"===_.get("transition")?x.fadeTo(g,0,function(){J.position(0,d)}):J.position(g,d)}},J.next=function(){!$&&W[1]&&(_.get("loop")||W[A+1])&&(A=h(1),f(W[A]))},J.prev=function(){!$&&W[1]&&(_.get("loop")||A)&&(A=h(-1),f(W[A]))},J.close=function(){U&&!G&&(G=!0,U=!1,u(oe),_.get("onCleanup"),E.unbind("."+Z),v.fadeTo(_.get("fadeOut")||0,0),x.stop().fadeTo(_.get("fadeOut")||0,0,function(){x.hide(),v.hide(),u(he),I.remove(),setTimeout(function(){G=!1,u(re),_.get("onClosed")},1)}))},J.remove=function(){x&&(x.stop(),t[Y].close(),x.stop(!1,!0).remove(),v.remove(),G=!1,x=null,t("."+te).removeData(Y).removeClass(te),t(e).unbind("click."+Z).unbind("keydown."+Z))},J.element=function(){return t(_.el)},J.settings=X)})(jQuery,document,window);
6; 7(function ($) { 8 9Drupal.behaviors.initColorbox = { 10 attach: function (context, settings) { 11 if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') { 12 return; 13 } 14 15 if (settings.colorbox.mobiledetect && window.matchMedia) { 16 // Disable Colorbox for small screens. 17 var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")"); 18 if (mq.matches) { 19 return; 20 } 21 } 22 23 // Use "data-colorbox-gallery" if set otherwise use "rel". 24 settings.colorbox.rel = function () { 25 if ($(this).data('colorbox-gallery')) { 26 return $(this).data('colorbox-gallery'); 27 } 28 else { 29 return $(this).attr('rel'); 30 } 31 }; 32 33 $('.colorbox', context) 34 .once('init-colorbox') 35 .colorbox(settings.colorbox); 36 37 $(context).bind('cbox_complete', function () { 38 Drupal.attachBehaviors('#cboxLoadedContent'); 39 }); 40 } 41}; 42 43})(jQuery); 44; 45(function ($) { 46 47Drupal.behaviors.initColorboxDefaultStyle = { 48 attach: function (context, settings) { 49 $(context).bind('cbox_complete', function () { 50 // Only run if there is a title. 51 if ($('#cboxTitle:empty', context).length == false) { 52 $('#cboxLoadedContent img', context).bind('mouseover', function () { 53 $('#cboxTitle', context).slideDown(); 54 }); 55 $('#cboxOverlay', context).bind('mouseover', function () { 56 $('#cboxTitle', context).slideUp(); 57 }); 58 } 59 else { 60 $('#cboxTitle', context).hide(); 61 } 62 }); 63 } 64}; 65 66})(jQuery); 67; 68Drupal.TBMegaMenu = Drupal.TBMegaMenu || {}; 69 70(function ($) { 71 Drupal.TBMegaMenu.oldWindowWidth = 0; 72 Drupal.TBMegaMenu.displayedMenuMobile = false; 73 Drupal.TBMegaMenu.supportedScreens = [980]; 74 Drupal.TBMegaMenu.menuResponsive = function () { 75 var windowWidth = window.innerWidth ? window.innerWidth : $(window).width(); 76 var navCollapse = $('.tb-megamenu').children('.nav-collapse'); 77 if (windowWidth < Drupal.TBMegaMenu.supportedScreens[0]) { 78 navCollapse.addClass('collapse'); 79 if (Drupal.TBMegaMenu.displayedMenuMobile) { 80 navCollapse.css({height: 'auto', overflow: 'visible'}); 81 } else { 82 navCollapse.css({height: 0, overflow: 'hidden'}); 83 } 84 } else { 85 // If width of window is greater than 980 (supported screen). 86 navCollapse.removeClass('collapse'); 87 if (navCollapse.height() <= 0) { 88 navCollapse.css({height: 'auto', overflow: 'visible'}); 89 } 90 } 91 }; 92 93 Drupal.TBMegaMenu.focusNextPrevElement = function (direction) { 94 // Add all the elements we want to include in our selection 95 var focusableElements = 'a:not([disabled]), button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), details:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])'; 96 var $current = $(document.activeElement); 97 98 if ($current.length) { 99 var $focusable = $(focusableElements).filter(function() { 100 var $this = $(this); 101 return $this.closest('.tb-megamenu-subnav').length === 0 && $this.is(':visible'); 102 }) 103 104 var index = $focusable.index($current); 105 if (index > -1) { 106 if (direction === 'next') { 107 var nextElement = $focusable[index + 1] || $focusable[0]; 108 } 109 else { 110 var nextElement = $focusable[index - 1] || $focusable[0]; 111 } 112 113 nextElement.focus(); 114 } 115 } 116 } 117 118 119 Drupal.behaviors.tbMegaMenuAction = { 120 attach: function(context) { 121 122 /* Keyboard Control Setup */ 123 // Semi-Global Variables 124 $('.tb-megamenu').once('tb-megamenu', function() { 125 126 var navParent = document.querySelector('.tb-megamenu'), 127 linkArray = new Array(), 128 curPos = new Array(-1,-1,-1); 129 130 // Each Top-Level Link 131 $('.tb-megamenu').find('.level-1').children('a').not('.mobile-only').each(function(i,toplink) { 132 linkArray[i] = new Array(); 133 134 // Add Link to Array 135 linkArray[i][-1] = toplink; 136 137 // Determine Coordinates 138 $(toplink).data({ coordinate: [i, -1] }); 139 140 // Each Column 141 $(toplink).next().children().children().children('.mega-col-nav').each(function(j,column) { 142 linkArray[i][j] = new Array(); 143 144 // Each Link 145 $(column).find('a').each(function(k,sublink) { 146 147 // Add Link to Array 148 linkArray[i][j][k] = sublink; 149 150 // Determine Coordinates 151 $(sublink).data({ coordinate: [i, j, k] }); 152 }); // each link 153 154 }); // each column 155 156 }); // each top-level link 157 158 // Update Position on Focus 159 $('.tb-megamenu').find('a').focus(function() { 160 curPos = $(this).data('coordinate'); 161 }); 162 163 /* Event Listener */ 164 // On Keydown 165 if (navParent !== null) { 166 navParent.addEventListener('keydown',keydownEvent); 167 } 168 169 // Key Pressed 170 function keydownEvent(k) { 171 // Determine Key 172 switch(k.keyCode) { 173 174 // TAB 175 case 9: 176 k.preventDefault(); 177 nav_tab(k); 178 break; 179 180 // RETURN 181 case 13: 182 nav_open_link(); 183 break; 184 185 // ESC 186 case 27: 187 nav_esc(); 188 break; 189 190 // LEFT 191 case 37: 192 k.preventDefault(); 193 nav_left(); 194 break; 195 196 // UP 197 case 38: 198 k.preventDefault(); 199 nav_up(); 200 break; 201 202 // RIGHT 203 case 39: 204 k.preventDefault(); 205 nav_right(); 206 break; 207 208 // DOWN 209 case 40: 210 k.preventDefault(); 211 nav_down(); 212 break; 213 214 // HOME 215 case 36: 216 nav_home(); 217 break; 218 219 // END 220 case 35: 221 nav_end(); 222 break; 223 224 // Else 225 default:
226 // Do nothing 227 228 } // determine key 229 } // keydownEvent 230 231 /* Keypress Functions */ 232 // Tab 233 function nav_tab(k) { 234 if(nav_is_toplink()) { 235 if(k.shiftKey) { 236 nav_prev_toplink(); 237 } else { 238 nav_next_toplink(); 239 } 240 } else { 241 if(k.shiftKey) { 242 nav_up(); 243 } else { 244 nav_down(); 245 } 246 } 247 } 248 249 // Open Link 250 function nav_open_link() { 251 linkArray[curPos[0]][curPos[1]][curPos[2]].click(); 252 } 253 254 // Escape 255 function nav_esc() { 256 nav_close_megamenu(); 257 } 258 259 // Left 260 function nav_left() { 261 if(nav_is_toplink()) { 262 nav_prev_toplink(); 263 } else { 264 nav_prev_column(); 265 } 266 } 267 268 // Right 269 function nav_right() { 270 if(nav_is_toplink()) { 271 nav_next_toplink(); 272 } else { 273 nav_next_column(); 274 } 275 } 276 277 // Up 278 function nav_up() { 279 if(nav_is_toplink()) { 280 nav_prev_toplink(); 281 } else { 282 if(linkArray[curPos[0]][curPos[1]][curPos[2] - 1]) { 283 linkArray[curPos[0]][curPos[1]][curPos[2] - 1].focus(); 284 } else { 285 nav_prev_column(); 286 } 287 } 288 } 289 290 // Down 291 function nav_down() { 292 if(nav_is_toplink()) { 293 nav_next_column(); 294 } else { 295 if(linkArray[curPos[0]][curPos[1]][curPos[2] + 1]) { 296 linkArray[curPos[0]][curPos[1]][curPos[2] + 1].focus(); 297 } else { 298 nav_next_column(); 299 } 300 } 301 } 302 303 // Home Button 304 function nav_home() { 305 if(nav_is_toplink()) { 306 linkArray[0][-1].focus(); 307 } else { 308 linkArray[curPos[0]][0][0].focus(); 309 } 310 } 311 312 // End Button 313 function nav_end() { 314 if(nav_is_toplink()) { 315 linkArray.slice(-1)[0][-1].focus(); 316 } else { 317 linkArray[curPos[0]].slice(-1)[0].slice(-1)[0].focus(); 318 } 319 } 320 321 /* Helper Functions */ 322 // Determine Link Level 323 function nav_is_toplink() { 324 return (curPos[1] < 0); 325 } 326 327 // Close Mega Menu 328 function nav_close_megamenu() { 329 $('.tb-megamenu .open').removeClass('open'); 330 $('.tb-megamenu-item.dropdown-submenu.open').removeClass('open'); 331 ariaCheck(); 332 } 333 334 // Next Toplink 335 function nav_next_toplink() { 336 if(linkArray[curPos[0] + 1]) { 337 linkArray[curPos[0] + 1][-1].focus(); 338 } else { 339 nav_close_megamenu(); 340 341 // Focus on the next element. 342 Drupal.TBMegaMenu.focusNextPrevElement('next'); 343 } 344 } 345 346 // Previous Toplink 347 function nav_prev_toplink() { 348 if(linkArray[curPos[0] - 1]) { 349 linkArray[curPos[0] - 1][-1].focus(); 350 } else { 351 // Focus on the previous element. 352 Drupal.TBMegaMenu.focusNextPrevElement('prev'); 353 } 354 } 355 356 // Previous Column 357 function nav_prev_column() { 358 if(linkArray[curPos[0]][curPos[1] - 1][0]) { 359 linkArray[curPos[0]][curPos[1] - 1][0].focus(); 360 } else { 361 nav_parent_toplink(); 362 } 363 } 364 365 // Next Column 366 function nav_next_column() { 367 if(linkArray[curPos[0]][curPos[1] + 1]) { 368 linkArray[curPos[0]][curPos[1] + 1][0].focus(); 369 } else { 370 nav_parent_toplink(); 371 } 372 } 373 374 // Go to Parent Toplink 375 function nav_parent_toplink() { 376 linkArray[curPos[0]][-1].focus(); 377 } 378 379 var ariaCheck = function() { 380 $("li.tb-megamenu-item").each(function () { 381 if ($(this).is('.mega-group')) { 382 // Mega menu item has mega class (it's a true mega menu) 383 if(!$(this).parents().is('.open')) { 384 // Mega menu item has mega class and its ancestor is closed, so apply appropriate ARIA attributes 385 $(this).children().attr('aria-expanded', 'false'); 386 } 387 else if ($(this).parents().is('.open')) { 388 // Mega menu item has mega class and its ancestor is o
388pen, so apply appropriate ARIA attributes 389 $(this).children().attr('aria-expanded', 'true'); 390 } 391 } 392 else if ($(this).is('.dropdown') || $(this).is('.dropdown-submenu')) { 393 // Mega menu item has dropdown (it's a flyout menu) 394 if (!$(this).is('.open')) { 395 // Mega menu item has dropdown class and is closed, so apply appropriate ARIA attributes 396 $(this).children().attr('aria-expanded', 'false'); 397 } 398 else if ($(this).is('.open')) { 399 // Mega menu item has dropdown class and is open, so apply appropriate ARIA attributes 400 $(this).children().attr('aria-expanded', 'true'); 401 } 402 } 403 else { 404 // Mega menu item is neither a mega or dropdown class, so remove ARIA attributes (it doesn't have children) 405 $(this).children().removeAttr('aria-expanded'); 406 } 407 }); 408 }; 409 410 var showMenu = function ($subMenu, mm_timeout) { 411 // console.log("showMenu"); 412 if ($subMenu.hasClass('mega')) { 413 $subMenu.addClass('animating'); 414 clearTimeout($subMenu.data('animatingTimeout')); 415 $subMenu.data('animatingTimeout', setTimeout(function () { 416 $subMenu.removeClass('animating') 417 }, mm_timeout)); 418 clearTimeout($subMenu.data('hoverTimeout')); 419 $subMenu.data('hoverTimeout', setTimeout(function () { 420 $subMenu.addClass('open'); 421 ariaCheck(); 422 }, 100)); 423 } 424 else { 425 clearTimeout($subMenu.data('hoverTimeout')); 426 $subMenu.data('hoverTimeout', 427 setTimeout(function () { 428 $subMenu.addClass('open'); 429 ariaCheck(); 430 }, 100)); 431 } 432 }; 433 var hideMenu = function ($subMenu, mm_timeout) { 434 // console.log("hideMenu"); 435 $subMenu.children('.dropdown-toggle').attr('aria-expanded', 'false'); 436 if ($subMenu.hasClass('mega')) { 437 $subMenu.addClass('animating'); 438 clearTimeout($subMenu.data('animatingTimeout')); 439 $subMenu.data('animatingTimeout', setTimeout(function () { 440 $subMenu.removeClass('animating') 441 }, mm_timeout)); 442 clearTimeout($subMenu.data('hoverTimeout')); 443 $subMenu.data('hoverTimeout', setTimeout(function () { 444 $subMenu.removeClass('open'); 445 ariaCheck(); 446 }, 100)); 447 } 448 else { 449 clearTimeout($subMenu.data('hoverTimeout')); 450 $subMenu.data('hoverTimeout', setTimeout(function () { 451 $subMenu.removeClass('open'); 452 ariaCheck(); 453 }, 100)); 454 } 455 }; 456 457 $('.tb-megamenu-button', context).once('menuIstance', function () { 458 var This = this; 459 $(This).click(function() { 460 if(parseInt($(this).parent().children('.nav-collapse').height())) { 461 $(this).parent().children('.nav-collapse').css({height: 0, overflow: 'hidden'}); 462 Drupal.TBMegaMenu.displayedMenuMobile = false; 463 } 464 else { 465 $(this).parent().children('.nav-collapse').css({height: 'auto', overflow: 'visible'}); 466 Drupal.TBMegaMenu.displayedMenuMobile = true; 467 } 468 }); 469 }); 470 471 472 var isTouch = window.matchMedia('(pointer: coarse)').matches; 473 if (!isTouch) { 474 $(document).ready(function ($) { 475 var mm_duration = 0; 476 $('.tb-megamenu', context).each(function () { 477 if ($(this).data('duration')) { 478 mm_duration = $(this).data('duration'); 479 } 480 }); 481 482 var mm_timeout = mm_duration ? 100 + mm_duration : 500; 483 $('.nav > li, li.mega', context).bind('mouseenter', function (event) { 484 showMenu($(this), mm_timeout); 485 }); 486 $('.nav > li > .dropdown-toggle, li.mega > .dropdown-toggle', context).bind('focus', function (event) { 487 var $this = $(this); 488 var $subMenu = $this.closest('li'); 489 // console.log("showMenu call"); 490 showMenu($subMenu, mm_timeout); 491 // If the focus moves outside of the subMenu, close it. 492 $(document).bind('focusin', function (event) { 493 if ($subMenu.has(event.target).length) { 494 return; 495 } 496 $(document).unbind(event); 497 // console.log("hideMenu call"); 498 hideMenu($subMenu, mm_timeout); 499 }); 500 }); 501 $('.nav > li, li.mega', context).bind('mouseleave', function (event) { 502 hideMenu($(this), mm_timeout); 503 }); 504 }); 505 506 /** 507 * Allow tabbing by appending the open class. 508 * Works in tandem with CSS changes that utilize opacity rather than 509 * display none 510 */ 511 // If the selected anchor is not in the TB Megamenu, remove all "open" 512 // class occurrences 513 $('a').focus(function (event) { 514 if (!$(this).parent().hasClass('tb-megamenu-item') && !$(this).parents('.tb-megamenu-block').length) {
515 nav_close_megamenu(); 516 } 517 }); 518 519 $('.nav > li > a, li.mega > a').focus(function (event) { 520 // Remove all occurrences of "open" from other menu trees 521 var siblings = $(this).parents('.tb-megamenu-item').siblings(); 522 // var siblings = $(this).closest('.tb-megamenu-item.level-1').siblings(); 523 $.each(siblings, function (i, v) { 524 var cousins = $(v).find('.open'); 525 $.each(cousins, function (index, value) { 526 $(value).removeClass('open'); 527 ariaCheck($(this)); 528 }); 529 $(v).removeClass('open'); 530 ariaCheck(); 531 }); 532 // Open the submenu if the selected item has one 533 if ($(this).next(".tb-megamenu-submenu").length > 0) { 534 if (!$(this).parent().hasClass("open")) { 535 $(this).parent().addClass("open"); 536 } 537 } 538 // If the anchor's top-level parent is not open, open it 539 if (!$(this).closest('.tb-megamenu-item.dropdown').hasClass('open') && $(this).closest('.tb-megamenu-item.dropdown').find('.tb-megamenu-submenu').length > 0) { 540 $(this).closest('.tb-megamenu-item.dropdown').addClass('open'); 541 ariaCheck(); 542 } 543 // If anchor's parent submenus are not open, open them 544 var parents = $(this).parents('.tb-megamenu-item.dropdown-submenu'); 545 $.each(parents, function (i, v) { 546 if (!$(v).hasClass('open')) { 547 $(v).addClass('open'); 548 ariaCheck(); 549 } 550 }); 551 }); 552 } 553 554 $(window).resize(function() { 555 var windowWidth = window.innerWidth ? window.innerWidth : $(window).width(); 556 if(windowWidth != Drupal.TBMegaMenu.oldWindowWidth){ 557 Drupal.TBMegaMenu.oldWindowWidth = windowWidth; 558 Drupal.TBMegaMenu.menuResponsive(); 559 } 560 }); 561 562 }); 563 }, 564 } 565})(jQuery); 566; 567Drupal.TBMegaMenu = Drupal.TBMegaMenu || {}; 568 569(function ($) { 570 Drupal.TBMegaMenu.createTouchMenu = function(items) { 571 items.children('a, .tb_nolink').each( function() { 572 var $item = $(this); 573 var tbitem = $(this).parent(); 574 575 $item.click( function(event){ 576 if ($item.hasClass('tb-megamenu-clicked')) { 577 var $uri = $item.attr('href'); 578 if ($uri && $uri !== '#') { 579 window.location.href = $uri; 580 } 581 } 582 else { 583 event.preventDefault(); 584 $item.addClass('tb-megamenu-clicked'); 585 if(!tbitem.hasClass('open')){ 586 tbitem.addClass('open'); 587 } 588 589 // Find any parent siblings that are open and close them. 590 tbitem.siblings('.open').find('.tb-megamenu-clicked').removeClass('tb-megamenu-clicked'); 591 tbitem.siblings('.open').removeClass('open'); 592 593 $('body').addClass('tb-megamenu-open'); 594 } 595 }); 596 }); 597 } 598 599 Drupal.TBMegaMenu.eventStopPropagation = function(event) { 600 if (event.stopPropagation) { 601 event.stopPropagation(); 602 } 603 else if (window.event) { 604 window.event.cancelBubble = true; 605 } 606 } 607 608 Drupal.behaviors.tbMegaMenuTouchAction = { 609 attach: function(context) { 610 var isTouch = window.matchMedia('(pointer: coarse)').matches; 611 if(isTouch){ 612 $('html').addClass('touch'); 613 Drupal.TBMegaMenu.createTouchMenu($('.tb-megamenu ul.nav li.mega').has('.dropdown-menu')); 614 615 // When the user touches anywhere outside of the open menu item, close 616 // the open menu item. 617 $(document).on('touchstart', function(event) { 618 if ($('body').hasClass('tb-megamenu-open') && !$(event.target).closest('.mega.open').length) { 619 $('.tb-megamenu ul.nav li.mega a, .tb-megamenu ul.nav li.mega .tb_nolink').removeClass('tb-megamenu-clicked'); 620 $('.tb-megamenu ul.nav li.mega').removeClass('open'); 621 $('body').removeClass('tb-megamenu-open'); 622 } 623 }); 624 } 625 } 626 } 627})(jQuery); 628; 629(function ($) { 630 631Drupal.googleanalytics = {}; 632 633$(document).ready(function() { 634 635 // Attach mousedown, keyup, touchstart events to document only and catch 636 // clicks on all elements. 637 $(document.body).bind("mousedown keyup touchstart", function(event) { 638 639 // Catch the closest surrounding link of a clicked element. 640 $(event.target).closest("a,area").each(function() { 641 642 // Is the clicked URL internal? 643 if (Drupal.googleanalytics.isInternal(this.href)) { 644 // Skip 'click' tracking, if custom tracking events are bound. 645 if ($(this).is('.colorbox') && (Drupal.settings.googleanalytics.trackColorbox)) {
646 // Do nothing here. The custom event will handle all tracking. 647 //console.info("Click on .colorbox item has been detected."); 648 } 649 // Is download tracking activated and the file extension configured for download tracking? 650 else if (Drupal.settings.googleanalytics.trackDownload && Drupal.googleanalytics.isDownload(this.href)) { 651 // Download link clicked. 652 gtag('event', Drupal.googleanalytics.getDownloadExtension(this.href).toUpperCase(), { 653 event_category: 'Downloads', 654 event_label: Drupal.googleanalytics.getPageUrl(this.href), 655 transport_type: 'beacon' 656 }); 657 } 658 else if (Drupal.googleanalytics.isInternalSpecial(this.href)) { 659 // Keep the internal URL for Google Analytics website overlay intact. 660 // @todo: May require tracking ID 661 var target = this; 662 $.each(Drupal.settings.googleanalytics.account, function () { 663 gtag('config', this, { 664 page_path: Drupal.googleanalytics.getPageUrl(target.href), 665 transport_type: 'beacon' 666 }); 667 }); 668 } 669 } 670 else { 671 if (Drupal.settings.googleanalytics.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) { 672 // Mailto link clicked. 673 gtag('event', 'Click', { 674 event_category: 'Mails', 675 event_label: this.href.substring(7), 676 transport_type: 'beacon' 677 }); 678 } 679 else if (Drupal.settings.googleanalytics.trackOutbound && this.href.match(/^\w+:\/\//i)) { 680 if (Drupal.settings.googleanalytics.trackDomainMode !== 2 || (Drupal.settings.googleanalytics.trackDomainMode === 2 && !Drupal.googleanalytics.isCrossDomain(this.hostname, Drupal.settings.googleanalytics.trackCrossDomains))) { 681 // External link clicked / No top-level cross domain clicked. 682 gtag('event', 'Click', { 683 event_category: 'Outbound links', 684 event_label: this.href, 685 transport_type: 'beacon' 686 }); 687 } 688 } 689 } 690 }); 691 }); 692 693 // Track hash changes as unique pageviews, if this option has been enabled. 694 if (Drupal.settings.googleanalytics.trackUrlFragments) { 695 window.onhashchange = function() { 696 $.each(Drupal.settings.googleanalytics.account, function () { 697 gtag('config', this, { 698 page_path: location.pathname + location.search + location.hash 699 }); 700 }); 701 }; 702 } 703 704 // Colorbox: This event triggers when the transition has completed and the 705 // newly loaded content has been revealed. 706 if (Drupal.settings.googleanalytics.trackColorbox) { 707 $(document).bind("cbox_complete", function () { 708 var href = $.colorbox.element().attr("href"); 709 if (href) { 710 $.each(Drupal.settings.googleanalytics.account, function () { 711 gtag('config', this, { 712 page_path: Drupal.googleanalytics.getPageUrl(href) 713 }); 714 }); 715 } 716 }); 717 } 718 719}); 720 721/** 722 * Check whether the hostname is part of the cross domains or not. 723 * 724 * @param string hostname 725 * The hostname of the clicked URL. 726 * @param array crossDomains 727 * All cross domain hostnames as JS array. 728 * 729 * @return boolean 730 */ 731Drupal.googleanalytics.isCrossDomain = function (hostname, crossDomains) { 732 /** 733 * jQuery < 1.6.3 bug: $.inArray crushes IE6 and Chrome if second argument is 734 * `null` or `undefined`, https://bugs.jquery.com/ticket/10076, 735 * https://github.com/jquery/jquery/commit/a839af034db2bd934e4d4fa6758a3fed8de74174 736 * 737 * @todo: Remove/Refactor in D8 738 */ 739 if (!crossDomains) { 740 return false; 741 } 742 else { 743 return $.inArray(hostname, crossDomains) > -1 ? true : false; 744 } 745}; 746 747/** 748 * Check whether this is a download URL or not. 749 * 750 * @param string url 751 * The web url to check. 752 * 753 * @return boolean 754 */ 755Drupal.googleanalytics.isDownload = function (url) { 756 var isDownload = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i"); 757 return isDownload.test(url); 758}; 759 760/** 761 * Check whether this is an absolute internal URL or not. 762 * 763 * @param string url 764 * The web url to check. 765 * 766 * @return boolean 767 */ 768Drupal.googleanalytics.isInternal = function (url) { 769 var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i"); 770 return isInternal.test(url); 771}; 772 773/** 774 * Check whether this is a special URL or not. 775 * 776 * URL types: 777 * - gotwo.module /go/* links. 778 * 779 * @param string url 780 * The web url to check. 781 * 782 * @return boolean 783 */ 784Drupal.googleanalytics.isInternalSpecial = function (url) { 785 var isInternalSpecial = new RegExp("(\/go\/.*)$", "i"); 786 return isInternalSpecial.test(url); 787}; 788 789/** 790 * Extract the relative internal URL from an absolute internal URL. 791 * 792 * Examples: 793 * - https://mydomain.com/node/1 -> /node/1 794 * - https://example.com/foo/bar -> https://example.com/foo/bar 795 * 796 * @param string url 797 * The web url to check. 798 * 799 * @return string 800 * Internal website URL 801 */ 802Drupal.googleanalytics.getPageUrl = function (url) { 803 var extractInternalUrl = new RegExp("^(https?):\/\/" + window.location.host, "i"); 804 return url.replace(extractInternalUrl, ''); 805}; 806 807/** 808 * Extract the download file extension from the URL. 809 * 810 * @param string url 811 * The web url to check. 812 * 813 * @return string 814 * The file extension of the passed url. e.g. "zip", "txt" 815 */ 816Drupal.googleanalytics.getDownloadExtension = function (url) { 817 var extractDownloadextension = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i"); 818 var extension = extractDownloadextension.exec(url); 819 return (extension === null) ? '' : extension[1]; 820}; 821 822})(jQuery); 823;
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.