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/** 8 * @file 9 * Colorbox module init js. 10 */ 11 12(function ($) { 13 14Drupal.behaviors.initColorbox = { 15 attach: function (context, settings) { 16 if (!$.isFunction($('a, area, input', context).colorbox) || typeof settings.colorbox === 'undefined') { 17 return; 18 } 19 20 if (settings.colorbox.mobiledetect && window.matchMedia) { 21 // Disable Colorbox for small screens. 22 var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")"); 23 if (mq.matches) { 24 return; 25 } 26 } 27 28 // Use "data-colorbox-gallery" if set otherwise use "rel". 29 settings.colorbox.rel = function () { 30 if ($(this).data('colorbox-gallery')) { 31 return $(this).data('colorbox-gallery'); 32 } 33 else { 34 return $(this).attr('rel'); 35 } 36 }; 37 38 $('.colorbox', context) 39 .once('init-colorbox').each(function(){ 40 // Only images are supported for the "colorbox" class. 41 // The "photo" setting forces the href attribute to be treated as an image. 42 var extendParams = { 43 photo: true 44 }; 45 // If a title attribute is supplied, sanitize it. 46 var title = $(this).attr('title'); 47 if (title) { 48 extendParams.title = Drupal.colorbox.sanitizeMarkup(title); 49 } 50 $(this).colorbox($.extend({}, settings.colorbox, extendParams)); 51 }); 52 53 $(context).bind('cbox_complete', function () { 54 Drupal.attachBehaviors($('#cboxLoadedContent')); 55 }); 56 } 57}; 58 59// Create colorbox namespace if it doesn't exist. 60if (!Drupal.hasOwnProperty('colorbox')) { 61 Drupal.colorbox = {}; 62} 63 64/** 65 * Global function to allow sanitizing captions and control strings. 66 * 67 * @param markup 68 * String containing potential markup. 69 * @return @string 70 * Sanitized string with potentially dangerous markup removed. 71 */ 72Drupal.colorbox.sanitizeMarkup = function(markup) { 73 // If DOMPurify installed, allow some HTML. Otherwise, treat as plain text. 74 if (typeof DOMPurify !== 'undefined') { 75 var purifyConfig = { 76 ALLOWED_TAGS: [ 77 'a', 78 'b', 79 'strong', 80 'i', 81 'em', 82 'u', 83 'cite', 84 'code', 85 'br' 86 ], 87 ALLOWED_ATTR: [ 88 'href', 89 'hreflang', 90 'title', 91 'target' 92 ] 93 } 94 if (Drupal.settings.hasOwnProperty('dompurify_custom_config')) { 95 purifyConfig = Drupal.settings.dompurify_custom_config; 96 } 97 return DOMPurify.sanitize(markup, purifyConfig); 98 } 99 else { 100 return Drupal.checkPlain(markup); 101 } 102} 103 104})(jQuery); 105; 106/** 107 * @file 108 * Colorbox module style js. 109 */ 110 111(function ($) { 112 113Drupal.behaviors.initColorboxDefaultStyle = { 114 attach: function (context, settings) { 115 $(context).bind('cbox_complete', function () { 116 // Only run if there is a title. 117 if ($('#cboxTitle:empty', context).length == false) { 118 $('#cboxLoadedContent img', context).bind('mouseover', function () { 119 $('#cboxTitle', context).slideDown(); 120 }); 121 $('#cboxOverlay', context).bind('mouseover', function () { 122 $('#cboxTitle', context).slideUp(); 123 }); 124 } 125 else { 126 $('#cboxTitle', context).hide(); 127 } 128 }); 129 } 130}; 131 132})(jQuery); 133; 134/** 135 * @file 136 * Colorbox module load js. 137 */ 138(function ($) { 139 140Drupal.behaviors.initColorboxLoad = { 141 attach: function (context, settings) { 142 if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') { 143 return; 144 } 145 146 if (settings.colorbox.mobiledetect && window.matchMedia) { 147 // Disable Colorbox for small screens. 148 var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")"); 149 if (mq.matches) { 150 return; 151 } 152 } 153 154 $.urlParams = function (url) { 155 var p = {}, 156 e, 157 a = /\+/g, // Regex for replacing addition symbol with a space. 158 r = /([^&=]+)=?([^&]*)/g, 159 d = function (s) { return decodeURIComponent(s.replace(a, ' ')); }, 160 q = url.split('?'); 161 while (e = r.exec(q[1])) { 162 e[1] = d(e[1]); 163 e[2] = d(e[2]); 164 switch (e[2].toLowerCase()) { 165 case 'true': 166 case 'yes': 167 e[2] = true; 168 break; 169 case 'false': 170 case 'no': 171 e[2] = false;
172 break; 173 } 174 if (e[1] == 'width') { e[1] = 'innerWidth'; } 175 if (e[1] == 'height') { e[1] = 'innerHeight'; } 176 if (e[2]) { 177 e[2] = Drupal.checkPlain(e[2]); 178 } 179 p[e[1]] = e[2]; 180 } 181 return p; 182 }; 183 184 $('.colorbox-load', context) 185 .once('init-colorbox-load', function () { 186 var href = $(this).attr('href'); 187 188 var params = $.urlParams(href); 189 190 // Always load in an iframe. 191 params.iframe = true; 192 193 // Set inner width and height if not already specified. 194 if (!params.hasOwnProperty('innerWidth')) { 195 params.innerWidth = $(window).width() * .8; 196 } 197 if (!params.hasOwnProperty('innerHeight')) { 198 params.innerHeight = $(window).height() * .8; 199 } 200 201 if (!params.hasOwnProperty('title')) { 202 // If a title attribute is supplied, sanitize it. 203 var title = $(this).attr('title'); 204 if (title) { 205 params.title = Drupal.colorbox.sanitizeMarkup(title); 206 } 207 } 208 $(this).colorbox($.extend({}, settings.colorbox, params)); 209 }); 210 } 211}; 212 213})(jQuery); 214; 215/** 216 * @file 217 * Colorbox module inline js. 218 */ 219 220(function ($) { 221 222Drupal.behaviors.initColorboxInline = { 223 attach: function (context, settings) { 224 if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') { 225 return; 226 } 227 228 if (settings.colorbox.mobiledetect && window.matchMedia) { 229 // Disable Colorbox for small screens. 230 var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")"); 231 if (mq.matches) { 232 return; 233 } 234 } 235 236 $.urlParam = function(name, url){ 237 if (name == 'fragment') { 238 var results = new RegExp('(#[^&#]*)').exec(url); 239 } 240 else { 241 var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(url); 242 } 243 if (!results) { return ''; } 244 return results[1] || ''; 245 }; 246 $('.colorbox-inline', context).once('init-colorbox-inline').colorbox({ 247 transition:settings.colorbox.transition, 248 speed:settings.colorbox.speed, 249 opacity:settings.colorbox.opacity, 250 slideshow:settings.colorbox.slideshow, 251 slideshowAuto:settings.colorbox.slideshowAuto, 252 slideshowSpeed:settings.colorbox.slideshowSpeed, 253 slideshowStart:settings.colorbox.slideshowStart, 254 slideshowStop:settings.colorbox.slideshowStop, 255 current:settings.colorbox.current, 256 previous:settings.colorbox.previous, 257 next:settings.colorbox.next, 258 close:settings.colorbox.close, 259 overlayClose:settings.colorbox.overlayClose, 260 maxWidth:settings.colorbox.maxWidth, 261 maxHeight:settings.colorbox.maxHeight, 262 innerWidth:function(){ 263 return $.urlParam('width', $(this).attr('href')); 264 }, 265 innerHeight:function(){ 266 return $.urlParam('height', $(this).attr('href')); 267 }, 268 title:function(){ 269 return Drupal.colorbox.sanitizeMarkup( 270 decodeURIComponent($.urlParam('title', $(this).attr('href')))); 271 }, 272 iframe:function(){ 273 return $.urlParam('iframe', $(this).attr('href')); 274 }, 275 inline:function(){ 276 return $.urlParam('inline', $(this).attr('href')); 277 }, 278 href:function(){ 279 return $.urlParam('fragment', $(this).attr('href')); 280 } 281 }); 282 } 283}; 284 285})(jQuery); 286; 287/** 288 * @file 289 * Integrate Sidr library with Responsive Menus. 290 */ 291(function ($) { 292 /** 293 * Preparation for each element Sidr will affect. 294 */ 295 function sidr_it(menuElement, ind, iteration, $windowWidth) { 296 // Only apply if window size is correct. 297 var $media_size = iteration.media_size || 768; 298 // Call Sidr with our settings. 299 $(menuElement).once('responsive-menus-sidr', function() { 300 var $id = 'sidr-' + ind; 301 var $wrapper_id = 'sidr-wrapper-' + ind; 302 $(this).before('<div id="' + $wrapper_id + '"><a id="' + $id + '-button" href="#' + $id + '">' + iteration.trigger_txt + '</a></div>'); 303 $('#' + $wrapper_id).hide(); 304 if ($windowWidth <= $media_size) { 305 $('#' + $wrapper_id).show(); 306 $(this).hide(); 307 } 308 // Set 1/0 to true/false respectively. 309 $.each(iteration, function(key, value) { 310 if (value == 0) { 311 iteration[key] = false;
312 } 313 if (value == 1) { 314 iteration[key] = true; 315 } 316 }); 317 // Sidr power go. 318 $('#' + $id + '-button').sidr({ 319 name: $id || "sidr", 320 speed: parseInt(iteration.speed) || 200, 321 side: iteration.side || "left", 322 source: iteration.selectors[ind] || "#main-menu", 323 displace: iteration.displace, 324 renaming: iteration.renaming, 325 onOpen: function() { eval(iteration.onOpen); } || function() {}, 326 onClose: function() { eval(iteration.onClose); } || function() {} 327 }); 328 }); 329 } 330 331 332 /** 333 * Main loop. 334 */ 335 Drupal.behaviors.responsive_menus_sidr = { 336 attach: function (context, settings) { 337 settings.responsive_menus = settings.responsive_menus || {}; 338 var $windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; 339 $.each(settings.responsive_menus, function(ind, iteration) { 340 if (iteration.responsive_menus_style != 'sidr') { 341 return true; 342 } 343 if (!iteration.selectors.length) { 344 return; 345 } 346 // Iterate each selector. 347 $.each(iteration.selectors, function(index, value) { 348 // Stop if there is no menu element. 349 if ($(value).length < 1) { 350 return true; 351 } 352 // Multi-level (selector hits multiple ul's). 353 if ($(value).length > 1) { 354 $(value).each(function(val_index) { 355 if (!$(this).parents('ul').length) { 356 sidr_it(this, index, iteration, $windowWidth); 357 } 358 }); 359 } 360 else { 361 // Single level. 362 sidr_it(value, index, iteration, $windowWidth); 363 } 364 }); 365 }); 366 367 // Handle window resizing. 368 $(window).resize(function() { 369 // Window width with legacy browsers. 370 $windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; 371 $.each(settings.responsive_menus, function(ind, iteration) { 372 if (iteration.responsive_menus_style != 'sidr') { 373 return true; 374 } 375 if (!iteration.selectors.length) { 376 return; 377 } 378 // Iterate each selector. 379 $.each(iteration.selectors, function(index, value) { 380 // Stop if there is no menu element. 381 if ($(value).length < 1) { 382 return true; 383 } 384 var $wrapper_id = 'sidr-wrapper-' + index; 385 $media_size = iteration.media_size || 768; 386 if ($windowWidth <= $media_size) { 387 if (!$(value).hasClass('sidr-hidden')) { 388 $('#' + $wrapper_id).show(); 389 $(value).hide().addClass('sidr-hidden'); 390 } 391 } 392 else { 393 if ($(value).hasClass('sidr-hidden')) { 394 $('#' + $wrapper_id).hide(); 395 $(value).show().removeClass('sidr-hidden'); 396 } 397 } 398 }); 399 }); 400 }); 401 } 402 }; 403}(jQuery)); 404; 405/*! Sidr - v1.2.1 - 2013-11-06 406 * https://github.com/artberri/sidr 407 * Copyright (c) 2013 Alberto Varela; Licensed MIT */ 408(function(e){var t=!1,i=!1,n={isUrl:function(e){var t=RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");return t.test(e)?!0:!1},loadContent:function(e,t){e.html(t)},addPrefix:function(e){var t=e.attr("id"),i=e.attr("class");"string"==typeof t&&""!==t&&e.attr("id",t.replace(/([A-Za-z0-9_.\-]+)/g,"sidr-id-$1")),"string"==typeof i&&""!==i&&"sidr-inner"!==i&&e.attr("class",i.replace(/([A-Za-z0-9_.\-]+)/g,"sidr-class-$1")),e.removeAttr("style")},execute:function(n,s,a){"function"==typeof s?(a=s,s="sidr"):s||(s="sidr");var r,d,l,c=e("#"+s),u=e(c.data("body")),f=e("html"),p=c.outerWidth(!0),g=c.data("speed"),h=c.data("side"),m=c.data("displace"),v=c.data("onOpen"),y=c.data("onClose"),x="sidr"===s?"sidr-open":"sidr-open "+s+"-open";if("open"===n||"toggle"===n&&!c.is(":visible")){if(c.is(":visible")||t)return;if(i!==!1)return o.close(i,function(){o.open(s)}),void 0;t=!0,"left"===h?(r={left:p+"px"},d={left:"0px"}):(r={right:p+"px"},d={right:"0px"}),u.is("body")&&(l=f.scrollTop(),f.css("overflow-x","hidden").scrollTop(l)),m?u.addClass("sidr-animating").
408css({width:u.width(),position:"absolute"}).animate(r,g,function(){e(this).addClass(x)}):setTimeout(function(){e(this).addClass(x)},g),c.css("display","block").animate(d,g,function(){t=!1,i=s,"function"==typeof a&&a(s),u.removeClass("sidr-animating")}),v()}else{if(!c.is(":visible")||t)return;t=!0,"left"===h?(r={left:0},d={left:"-"+p+"px"}):(r={right:0},d={right:"-"+p+"px"}),u.is("body")&&(l=f.scrollTop(),f.removeAttr("style").scrollTop(l)),u.addClass("sidr-animating").animate(r,g).removeClass(x),c.animate(d,g,function(){c.removeAttr("style").hide(),u.removeAttr("style"),e("html").removeAttr("style"),t=!1,i=!1,"function"==typeof a&&a(s),u.removeClass("sidr-animating")}),y()}}},o={open:function(e,t){n.execute("open",e,t)},close:function(e,t){n.execute("close",e,t)},toggle:function(e,t){n.execute("toggle",e,t)},toogle:function(e,t){n.execute("toggle",e,t)}};e.sidr=function(t){return o[t]?o[t].apply(this,Array.prototype.slice.call(arguments,1)):"function"!=typeof t&&"string"!=typeof t&&t?(e.error("Method "+t+" does not exist on jQuery.sidr"),void 0):o.toggle.apply(this,arguments)},e.fn.sidr=function(t){var i=e.extend({name:"sidr",speed:200,side:"left",source:null,renaming:!0,body:"body",displace:!0,onOpen:function(){},onClose:function(){}},t),s=i.name,a=e("#"+s);if(0===a.length&&(a=e("<div />").attr("id",s).appendTo(e("body"))),a.addClass("sidr").addClass(i.side).data({speed:i.speed,side:i.side,body:i.body,displace:i.displace,onOpen:i.onOpen,onClose:i.onClose}),"function"==typeof i.source){var r=i.source(s);n.loadContent(a,r)}else if("string"==typeof i.source&&n.isUrl(i.source))e.get(i.source,function(e){n.loadContent(a,e)});else if("string"==typeof i.source){var d="",l=i.source.split(",");if(e.each(l,function(t,i){d+='<div class="sidr-inner">'+e(i).html()+"</div>"}),i.renaming){var c=e("<div />").html(d);c.find("*").each(function(t,i){var o=e(i);n.addPrefix(o)}),d=c.html()}n.loadContent(a,d)}else null!==i.source&&e.error("Invalid Sidr Source");return this.each(function(){var t=e(this),i=t.data("sidr");i||(t.data("sidr",s),"ontouchstart"in document.documentElement?(t.bind("touchstart",function(e){e.originalEvent.touches[0],this.touched=e.timeStamp}),t.bind("touchend",function(e){var t=Math.abs(e.timeStamp-this.touched);200>t&&(e.preventDefault(),o.toggle(s))})):t.click(function(e){e.preventDefault(),o.toggle(s)}))})}})(jQuery);; 409(function ($) { 410 411Drupal.googleanalytics = {}; 412 413$(document).ready(function() { 414 415 // Attach mousedown, keyup, touchstart events to document only and catch 416 // clicks on all elements. 417 $(document.body).bind("mousedown keyup touchstart", function(event) { 418 419 // Catch the closest surrounding link of a clicked element. 420 $(event.target).closest("a,area").each(function() { 421 422 // Is the clicked URL internal? 423 if (Drupal.googleanalytics.isInternal(this.href)) { 424 // Skip 'click' tracking, if custom tracking events are bound. 425 if ($(this).is('.colorbox') && (Drupal.settings.googleanalytics.trackColorbox)) { 426 // Do nothing here. The custom event will handle all tracking. 427 //console.info("Click on .colorbox item has been detected."); 428 } 429 // Is download tracking activated and the file extension configured for download tracking? 430 else if (Drupal.settings.googleanalytics.trackDownload && Drupal.googleanalytics.isDownload(this.href)) { 431 // Download link clicked. 432 gtag('event', Drupal.googleanalytics.getDownloadExtension(this.href).toUpperCase(), { 433 event_category: 'Downloads', 434 event_label: Drupal.googleanalytics.getPageUrl(this.href), 435 transport_type: 'beacon' 436 }); 437 } 438 else if (Drupal.googleanalytics.isInternalSpecial(this.href)) { 439 // Keep the internal URL for Google Analytics website overlay intact. 440 // @todo: May require tracking ID 441 var target = this; 442 $.each(Drupal.settings.googleanalytics.account, function () { 443 gtag('config', this, { 444 page_path: Drupal.googleanalytics.getPageUrl(target.href), 445 transport_type: 'beacon' 446 }); 447 }); 448 } 449 } 450 else { 451 if (Drupal.settings.googleanalytics.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) { 452 // Mailto link clicked. 453 gtag('event', 'Click', { 454 event_category: 'Mails', 455 event_label: this.href.substring(7), 456 transport_type: 'beacon' 457 }); 458 } 459 else if (Drupal.settings.googleanalytics.trackOutbound && this.href.match(/^\w+:\/\//i)) { 460 if (Drupal.settings.googleanalytics.trackDomainMode !== 2 || (Drupal.settings.googleanalytics.trackDomainMode === 2 && !Drupal.googleanalytics.isCrossDomain(this.hostname, Drupal.settings.googleanalytics.trackCrossDomains))) { 461 // External link clicked / No top-level cross domain clicked. 462 gtag('event', 'Click', { 463 event_category: 'Outbound links', 464 event_label: this.href, 465 transport_type: 'beacon' 466 }); 467 } 468 } 469 } 470 }); 471 }); 472 473 // Track hash changes as unique pageviews, if this option has been enabled. 474 if (Drupal.settings.googleanalytics.trackUrlFragments) { 475 window.onhashchange = function() { 476 $.each(Drupal.settings.googleanalytics.account, function () { 477 gtag('config', this, { 478 page_path: location.pathname + location.search + location.hash 479 }); 480 }); 481 }; 482 } 483 484 // Colorbox: This event triggers when the transition has completed and the 485 // newly loaded content has been revealed. 486 if (Drupal.settings.googleanalytics.trackColorbox) { 487 $(document).bind("cbox_complete", function () {
488 var href = $.colorbox.element().attr("href"); 489 if (href) { 490 $.each(Drupal.settings.googleanalytics.account, function () { 491 gtag('config', this, { 492 page_path: Drupal.googleanalytics.getPageUrl(href) 493 }); 494 }); 495 } 496 }); 497 } 498 499}); 500 501/** 502 * Check whether the hostname is part of the cross domains or not. 503 * 504 * @param string hostname 505 * The hostname of the clicked URL. 506 * @param array crossDomains 507 * All cross domain hostnames as JS array. 508 * 509 * @return boolean 510 */ 511Drupal.googleanalytics.isCrossDomain = function (hostname, crossDomains) { 512 /** 513 * jQuery < 1.6.3 bug: $.inArray crushes IE6 and Chrome if second argument is 514 * `null` or `undefined`, https://bugs.jquery.com/ticket/10076, 515 * https://github.com/jquery/jquery/commit/a839af034db2bd934e4d4fa6758a3fed8de74174 516 * 517 * @todo: Remove/Refactor in D8 518 */ 519 if (!crossDomains) { 520 return false; 521 } 522 else { 523 return $.inArray(hostname, crossDomains) > -1 ? true : false; 524 } 525}; 526 527/** 528 * Check whether this is a download URL or not. 529 * 530 * @param string url 531 * The web url to check. 532 * 533 * @return boolean 534 */ 535Drupal.googleanalytics.isDownload = function (url) { 536 var isDownload = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i"); 537 return isDownload.test(url); 538}; 539 540/** 541 * Check whether this is an absolute internal URL or not. 542 * 543 * @param string url 544 * The web url to check. 545 * 546 * @return boolean 547 */ 548Drupal.googleanalytics.isInternal = function (url) { 549 var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i"); 550 return isInternal.test(url); 551}; 552 553/** 554 * Check whether this is a special URL or not. 555 * 556 * URL types: 557 * - gotwo.module /go/* links. 558 * 559 * @param string url 560 * The web url to check. 561 * 562 * @return boolean 563 */ 564Drupal.googleanalytics.isInternalSpecial = function (url) { 565 var isInternalSpecial = new RegExp("(\/go\/.*)$", "i"); 566 return isInternalSpecial.test(url); 567}; 568 569/** 570 * Extract the relative internal URL from an absolute internal URL. 571 * 572 * Examples: 573 * - https://mydomain.com/node/1 -> /node/1 574 * - https://example.com/foo/bar -> https://example.com/foo/bar 575 * 576 * @param string url 577 * The web url to check. 578 * 579 * @return string 580 * Internal website URL 581 */ 582Drupal.googleanalytics.getPageUrl = function (url) { 583 var extractInternalUrl = new RegExp("^(https?):\/\/" + window.location.host, "i"); 584 return url.replace(extractInternalUrl, ''); 585}; 586 587/** 588 * Extract the download file extension from the URL. 589 * 590 * @param string url 591 * The web url to check. 592 * 593 * @return string 594 * The file extension of the passed url. e.g. "zip", "txt" 595 */ 596Drupal.googleanalytics.getDownloadExtension = function (url) { 597 var extractDownloadextension = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i"); 598 var extension = extractDownloadextension.exec(url); 599 return (extension === null) ? '' : extension[1]; 600}; 601 602})(jQuery); 603;
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.