1/*! 2 Colorbox v1.4.32 - 2013-10-16 3 jQuery lightbox and modal window plugin 4 (c) 2013 Jack Moore - http://www.jacklmoore.com/colorbox 5 license: http://www.opensource.org/licenses/mit-license.php 6*/ 7(function(e,t,i){function o(i,o,n){var r=t.createElement(i);return o&&(r.id=Z+o),n&&(r.style.cssText=n),e(r)}function n(){return i.innerHeight?i.innerHeight:e(i).height()}function r(e){var t=k.length,i=(z+e)%t;return 0>i?t+i:i}function h(e,t){return Math.round((/%/.test(e)?("x"===t?E.width():n())/100:1)*parseInt(e,10))}function s(e,t){return e.photo||e.photoRegex.test(t)}function l(e,t){return e.retinaUrl&&i.devicePixelRatio>1?t.replace(e.photoRegex,e.retinaSuffix):t}function a(e){"contains"in g[0]&&!g[0].contains(e.target)&&(e.stopPropagation(),g.focus())}function d(){var t,i=e.data(N,Y);null==i?(B=e.extend({},X),console&&console.log&&console.log("Error: cboxElement missing settings object")):B=e.extend({},i);for(t in B)e.isFunction(B[t])&&"on"!==t.slice(0,2)&&(B[t]=B[t].call(N));B.rel=B.rel||N.rel||e(N).data("rel")||"nofollow",B.href=B.href||e(N).attr("href"),B.title=B.title||N.title,"string"==typeof B.href&&(B.href=e.trim(B.href))}function c(i,o){e(t).trigger(i),st.trigger(i),e.isFunction(o)&&o.call(N)}function u(i){q||(N=i,d(),k=e(N),z=0,"nofollow"!==B.rel&&(k=e("."+et).filter(function(){var t,i=e.data(this,Y);return i&&(t=e(this).data("rel")||i.rel||this.rel),t===B.rel}),z=k.index(N),-1===z&&(k=k.add(N),z=k.length-1)),w.css({opacity:parseFloat(B.opacity),cursor:B.overlayClose?"pointer":"auto",visibility:"visible"}).show(),J&&g.add(w).removeClass(J),B.className&&g.add(w).addClass(B.className),J=B.className,B.closeButton?K.html(B.close).appendTo(y):K.appendTo("<div/>"),U||(U=$=!0,g.css({visibility:"hidden",display:"block"}),H=o(lt,"LoadedContent","width:0; height:0; overflow:hidden"),y.css({width:"",height:""}).append(H),O=x.height()+C.height()+y.outerHeight(!0)-y.height(),_=b.width()+T.width()+y.outerWidth(!0)-y.width(),D=H.outerHeight(!0),A=H.outerWidth(!0),B.w=h(B.initialWidth,"x"),B.h=h(B.initialHeight,"y"),H.css({width:"",height:B.h}),Q.position(),c(tt,B.onOpen),P.add(L).hide(),g.focus(),B.trapFocus&&t.addEventListener&&(t.addEventListener("focus",a,!0),st.one(rt,function(){t.removeEventListener("focus",a,!0)})),B.returnFocus&&st.one(rt,function(){e(N).focus()})),m())}function f(){!g&&t.body&&(V=!1,E=e(i),g=o(lt).attr({id:Y,"class":e.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),w=o(lt,"Overlay").hide(),F=e([o(lt,"LoadingOverlay")[0],o(lt,"LoadingGraphic")[0]]),v=o(lt,"Wrapper"),y=o(lt,"Content").append(L=o(lt,"Title"),S=o(lt,"Current"),I=e('<button type="button"/>').attr({id:Z+"Previous"}),R=e('<button type="button"/>').attr({id:Z+"Next"}),M=o("button","Slideshow"),F),K=e('<button type="button"/>').attr({id:Z+"Close"}),v.append(o(lt).append(o(lt,"TopLeft"),x=o(lt,"TopCenter"),o(lt,"TopRight")),o(lt,!1,"clear:left").append(b=o(lt,"MiddleLeft"),y,T=o(lt,"MiddleRight")),o(lt,!1,"clear:left").append(o(lt,"BottomLeft"),C=o(lt,"BottomCenter"),o(lt,"BottomRight"))).find("div div").css({"float":"left"}),W=o(lt,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),P=R.add(I).add(S).add(M),e(t.body).append(w,g.append(v,W)))}function p(){function i(e){e.which>1||e.shiftKey||e.altKey||e.metaKey||e.ctrlKey||(e.preventDefault(),u(this))}return g?(V||(V=!0,R.click(function(){Q.next()}),I.click(function(){Q.prev()}),K.click(function(){Q.close()}),w.click(function(){B.overlayClose&&Q.close()}),e(t).bind("keydown."+Z,function(e){var t=e.keyCode;U&&B.escKey&&27===t&&(e.preventDefault(),Q.close()),U&&B.arrowKey&&k[1]&&!e.altKey&&(37===t?(e.preventDefault(),I.click()):39===t&&(e.preventDefault(),R.click()))}),e.isFunction(e.fn.on)?e(t).on("click."+Z,"."+et,i):e("."+et).live("click."+Z,i)),!0):!1}function m(){var n,r,a,u=Q.prep,f=++at;$=!0,j=!1,N=k[z],d(),c(ht),c(it,B.onLoad),B.h=B.height?h(B.height,"y")-D-O:B.innerHeight&&h(B.innerHeight,"y"),B.w=B.width?h(B.width,"x")-A-_:B.innerWidth&&h(B.innerWidth,"x"),B.mw=B.w,B.mh=B.h,B.maxWidth&&(B.mw=h(B.maxWidth,"x")-A-_,B.mw=B.w&&B.w<B.mw?B.w:B.mw),B.maxHeight&&(B.mh=h(B.maxHeight,"y")-D-O,B.mh=B.h&&B.h<B.mh?B.h:B.mh),n=B.href,G=setTimeout(function(){F.show()},100),B.inline?(a=o(lt).hide().insertBefore(e(n)[0]),st.one(ht,function(){a.replaceWith(H.children())}),u(e(n))):B.iframe?u(" "):B.html?u(B.html):s(B,n)?(n=l(B,n),j=t.createElement("img"),e(j).addClass(Z+"Photo").bind("error",function(){B.title=!1,u(o(lt,"
7Error").html(B.imgError))}).one("load",function(){var t;f===at&&(e.each(["alt","longdesc","aria-describedby"],function(t,i){var o=e(N).attr(i)||e(N).attr("data-"+i);o&&j.setAttribute(i,o)}),B.retinaImage&&i.devicePixelRatio>1&&(j.height=j.height/i.devicePixelRatio,j.width=j.width/i.devicePixelRatio),B.scalePhotos&&(r=function(){j.height-=j.height*t,j.width-=j.width*t},B.mw&&j.width>B.mw&&(t=(j.width-B.mw)/j.width,r()),B.mh&&j.height>B.mh&&(t=(j.height-B.mh)/j.height,r())),B.h&&(j.style.marginTop=Math.max(B.mh-j.height,0)/2+"px"),k[1]&&(B.loop||k[z+1])&&(j.style.cursor="pointer",j.onclick=function(){Q.next()}),j.style.width=j.width+"px",j.style.height=j.height+"px",setTimeout(function(){u(j)},1))}),setTimeout(function(){j.src=n},1)):n&&W.load(n,B.data,function(t,i){f===at&&u("error"===i?o(lt,"Error").html(B.xhrError):e(this).contents())})}var w,g,v,y,x,b,T,C,k,E,H,W,F,L,S,M,R,I,K,P,B,O,_,D,A,N,z,j,U,$,q,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,href:!1,title:!1,rel:!1,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)((#|\?).*)?$/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},Y="colorbox",Z="cbox",et=Z+"Element",tt=Z+"_open",it=Z+"_load",ot=Z+"_complete",nt=Z+"_cleanup",rt=Z+"_closed",ht=Z+"_purge",st=e("<a/>"),lt="div",at=0,dt={},ct=function(){function e(){clearTimeout(h)}function t(){(B.loop||k[z+1])&&(e(),h=setTimeout(Q.next,B.slideshowSpeed))}function i(){M.html(B.slideshowStop).unbind(l).one(l,o),st.bind(ot,t).bind(it,e),g.removeClass(s+"off").addClass(s+"on")}function o(){e(),st.unbind(ot,t).unbind(it,e),M.html(B.slideshowStart).unbind(l).one(l,function(){Q.next(),i()}),g.removeClass(s+"on").addClass(s+"off")}function n(){r=!1,M.hide(),e(),st.unbind(ot,t).unbind(it,e),g.removeClass(s+"off "+s+"on")}var r,h,s=Z+"Slideshow_",l="click."+Z;return function(){r?B.slideshow||(st.unbind(nt,n),n()):B.slideshow&&k[1]&&(r=!0,st.one(nt,n),B.slideshowAuto?i():o(),M.show())}}();e.colorbox||(e(f),Q=e.fn[Y]=e[Y]=function(t,i){var o=this;if(t=t||{},f(),p()){if(e.isFunction(o))o=e("<a/>"),t.open=!0;else if(!o[0])return o;i&&(t.onComplete=i),o.each(function(){e.data(this,Y,e.extend({},e.data(this,Y)||X,t))}).addClass(et),(e.isFunction(t.open)&&t.open.call(o)||t.open)&&u(o[0])}return o},Q.position=function(t,i){function o(){x[0].style.width=C[0].style.width=y[0].style.width=parseInt(g[0].style.width,10)-_+"px",y[0].style.height=b[0].style.height=T[0].style.height=parseInt(g[0].style.height,10)-O+"px"}var r,s,l,a=0,d=0,c=g.offset();if(E.unbind("resize."+Z),g.css({top:-9e4,left:-9e4}),s=E.scrollTop(),l=E.scrollLeft(),B.fixed?(c.top-=s,c.left-=l,g.css({position:"fixed"})):(a=s,d=l,g.css({position:"absolute"})),d+=B.right!==!1?Math.max(E.width()-B.w-A-_-h(B.right,"x"),0):B.left!==!1?h(B.left,"x"):Math.round(Math.max(E.width()-B.w-A-_,0)/2),a+=B.bottom!==!1?Math.max(n()-B.h-D-O-h(B.bottom,"y"),0):B.top!==!1?h(B.top,"y"):Math.round(Math.max(n()-B.h-D-O,0)/2),g.css({top:c.top,left:c.left,visibility:"visible"}),v[0].style.width=v[0].style.height="9999px",r={width:B.w+A+_,height:B.h+D+O,top:a,left:d},t){var u=0;e.each(r,function(e){return r[e]!==dt[e]?(u=t,void 0):void 0}),t=u}dt=r,t||g.css(r),g.dequeue().animate(r,{duration:t||0,complete:function(){o(),$=!1,v[0].style.width=B.w+A+_+"px",v[0].style.height=B.h+D+O+"px",B.reposition&&setTimeout(function(){E.bind("resize."+Z,Q.position)},1),i&&i()},step:o})},Q.resize=function(e){var t;U&&(e=e||{},e.width&&(B.w=h(e.width,"x")-A-_),e.innerWidth&&(B.w=h(e.innerWidth,"x")),H.css({width:B.w}
7),e.height&&(B.h=h(e.height,"y")-D-O),e.innerHeight&&(B.h=h(e.innerHeight,"y")),e.innerHeight||e.height||(t=H.scrollTop(),H.css({height:"auto"}),B.h=H.height()),H.css({height:B.h}),t&&H.scrollTop(t),Q.position("none"===B.transition?0:B.speed))},Q.prep=function(i){function n(){return B.w=B.w||H.width(),B.w=B.mw&&B.mw<B.w?B.mw:B.w,B.w}function h(){return B.h=B.h||H.height(),B.h=B.mh&&B.mh<B.h?B.mh:B.h,B.h}if(U){var a,d="none"===B.transition?0:B.speed;H.empty().remove(),H=o(lt,"LoadedContent").append(i),H.hide().appendTo(W.show()).css({width:n(),overflow:B.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(y),W.hide(),e(j).css({"float":"none"}),a=function(){function i(){e.support.opacity===!1&&g[0].style.removeAttribute("filter")}var n,h,a=k.length,u="frameBorder",f="allowTransparency";U&&(h=function(){clearTimeout(G),F.hide(),c(ot,B.onComplete)},L.html(B.title).add(H).show(),a>1?("string"==typeof B.current&&S.html(B.current.replace("{current}",z+1).replace("{total}",a)).show(),R[B.loop||a-1>z?"show":"hide"]().html(B.next),I[B.loop||z?"show":"hide"]().html(B.previous),ct(),B.preloading&&e.each([r(-1),r(1)],function(){var i,o,n=k[this],r=e.data(n,Y);r&&r.href?(i=r.href,e.isFunction(i)&&(i=i.call(n))):i=e(n).attr("href"),i&&s(r,i)&&(i=l(r,i),o=t.createElement("img"),o.src=i)})):P.hide(),B.iframe?(n=o("iframe")[0],u in n&&(n[u]=0),f in n&&(n[f]="true"),B.scrolling||(n.scrolling="no"),e(n).attr({src:B.href,name:(new Date).getTime(),"class":Z+"Iframe",allowFullScreen:!0,webkitAllowFullScreen:!0,mozallowfullscreen:!0}).one("load",h).appendTo(H),st.one(ht,function(){n.src="//about:blank"}),B.fastIframe&&e(n).trigger("load")):h(),"fade"===B.transition?g.fadeTo(d,1,i):i())},"fade"===B.transition?g.fadeTo(d,0,function(){Q.position(0,a)}):Q.position(d,a)}},Q.next=function(){!$&&k[1]&&(B.loop||k[z+1])&&(z=r(1),u(k[z]))},Q.prev=function(){!$&&k[1]&&(B.loop||z)&&(z=r(-1),u(k[z]))},Q.close=function(){U&&!q&&(q=!0,U=!1,c(nt,B.onCleanup),E.unbind("."+Z),w.fadeTo(B.fadeOut||0,0),g.stop().fadeTo(B.fadeOut||0,0,function(){g.add(w).css({opacity:1,cursor:"auto"}).hide(),c(ht),H.empty().remove(),setTimeout(function(){q=!1,c(rt,B.onClosed)},1)}))},Q.remove=function(){g&&(g.stop(),e.colorbox.close(),g.stop().remove(),w.remove(),q=!1,g=null,e("."+et).removeData(Y).removeClass(et),e(t).unbind("click."+Z))},Q.element=function(){return e(N)},Q.settings=X)})(jQuery,document,window);; 8(function ($) { 9 10Drupal.behaviors.initColorbox = { 11 attach: function (context, settings) { 12 if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') { 13 return; 14 } 15 16 if (settings.colorbox.mobiledetect && window.matchMedia) { 17 // Disable Colorbox for small screens. 18 var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")"); 19 if (mq.matches) { 20 return; 21 } 22 } 23 24 $('.colorbox', context) 25 .once('init-colorbox') 26 .colorbox(settings.colorbox); 27 28 $(context).bind('cbox_complete', function () { 29 Drupal.attachBehaviors('#cboxLoadedContent'); 30 }); 31 } 32}; 33 34})(jQuery); 35; 36(function ($) { 37 38Drupal.behaviors.initColorboxLoad = { 39 attach: function (context, settings) { 40 if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') { 41 return; 42 } 43 $.urlParams = function (url) { 44 var p = {}, 45 e, 46 a = /\+/g, // Regex for replacing addition symbol with a space 47 r = /([^&=]+)=?([^&]*)/g, 48 d = function (s) { return decodeURIComponent(s.replace(a, ' ')); }, 49 q = url.split('?'); 50 while (e = r.exec(q[1])) { 51 e[1] = d(e[1]); 52 e[2] = d(e[2]); 53 switch (e[2].toLowerCase()) { 54 case 'true': 55 case 'yes': 56 e[2] = true; 57 break; 58 case 'false': 59 case 'no': 60 e[2] = false; 61 break; 62 } 63 if (e[1] == 'width') { e[1] = 'innerWidth'; } 64 if (e[1] == 'height') { e[1] = 'innerHeight'; } 65 p[e[1]] = e[2]; 66 } 67 return p; 68 }; 69 $('.colorbox-load', context) 70 .once('init-colorbox-load', function () {
71 var params = $.urlParams($(this).attr('href')); 72 $(this).colorbox($.extend({}, settings.colorbox, params)); 73 }); 74 } 75}; 76 77})(jQuery); 78; 79(function ($) { 80 81Drupal.behaviors.initColorboxInline = { 82 attach: function (context, settings) { 83 if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') { 84 return; 85 } 86 $.urlParam = function(name, url){ 87 if (name == 'fragment') { 88 var results = new RegExp('(#[^&#]*)').exec(url); 89 } 90 else { 91 var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(url); 92 } 93 if (!results) { return ''; } 94 return results[1] || ''; 95 }; 96 $('.colorbox-inline', context).once('init-colorbox-inline').colorbox({ 97 transition:settings.colorbox.transition, 98 speed:settings.colorbox.speed, 99 opacity:settings.colorbox.opacity, 100 slideshow:settings.colorbox.slideshow, 101 slideshowAuto:settings.colorbox.slideshowAuto, 102 slideshowSpeed:settings.colorbox.slideshowSpeed, 103 slideshowStart:settings.colorbox.slideshowStart, 104 slideshowStop:settings.colorbox.slideshowStop, 105 current:settings.colorbox.current, 106 previous:settings.colorbox.previous, 107 next:settings.colorbox.next, 108 close:settings.colorbox.close, 109 overlayClose:settings.colorbox.overlayClose, 110 maxWidth:settings.colorbox.maxWidth, 111 maxHeight:settings.colorbox.maxHeight, 112 innerWidth:function(){ 113 return $.urlParam('width', $(this).attr('href')); 114 }, 115 innerHeight:function(){ 116 return $.urlParam('height', $(this).attr('href')); 117 }, 118 title:function(){ 119 return decodeURIComponent($.urlParam('title', $(this).attr('href'))); 120 }, 121 iframe:function(){ 122 return $.urlParam('iframe', $(this).attr('href')); 123 }, 124 inline:function(){ 125 return $.urlParam('inline', $(this).attr('href')); 126 }, 127 href:function(){ 128 return $.urlParam('fragment', $(this).attr('href')); 129 } 130 }); 131 } 132}; 133 134})(jQuery); 135; 136(function($){Drupal.behaviors.image_caption={attach:function(context,settings){$("img.caption:not(.caption-processed)").each(function(i){var imgwidth=$(this).width()?$(this).width():false;var imgheight=$(this).height()?$(this).height():false;var captiontext=$(this).attr('title');if($(this).attr('align')){var alignment=$(this).attr('align');$(this).css({'float':alignment});$(this).removeAttr('align');}else if($(this).css('float')){var alignment=$(this).css('float');}else{var alignment='normal';} 137var style=$(this).attr('style')?$(this).attr('style'):'';$(this).removeAttr('width');$(this).removeAttr('height');$(this).css('width','');$(this).css('height','');$(this).removeAttr('align');$(this).removeAttr('style');$(this).wrap("<span class=\"image-caption-container\" style=\"display:inline-block;"+style+"\"></span>");$(this).parent().addClass('image-caption-container-'+alignment);if(imgwidth){$(this).width(imgwidth);$(this).parent().width(imgwidth);} 138if(imgheight){$(this).height(imgheight);} 139$(this).parent().append("<span style=\"display:block;\" class=\"image-caption\">"+captiontext+"</span>");$(this).addClass('caption-processed');});}};})(jQuery);; 140(function($){ 141/** 142 * Toggle the visibility of the scroll to top link. 143 */ 144 145Drupal.behaviors.scroll_to_top = { 146 attach: function (context, settings) { 147 // append back to top link top body if it is not 148 var exist= jQuery('#back-top').length; // exist = 0 if element doesn't exist 149 if(exist == 0){ // this test is for fixing the ajax bug 150 $("body").append("<p id='back-top'><a href='#top'><span id='button'></span><span id='link'>" + settings.scroll_to_top.label + "</span></a></p>"); 151 } 152 // Preview function 153 $("input").change(function () { 154 // building the style for preview 155 var style="<style>#scroll-to-top-prev-container #back-top-prev span#button-prev{ background-color:"+$("#edit-scroll-to-top-bg-color-out").val()+";} #scroll-to-top-prev-container #back-top-prev span#button-prev:hover{ background-color:"+$("#edit-scroll-to-top-bg-color-hover").val()+" }</style>" 156 // building the html content of preview 157 var html="<p id='back-top-prev' style='position:relative;'><a href='#top'><span id='button-prev'></span><span id='link'>"; 158 // if label enabled display it 159 if($("#edit-scroll-to-top-display-text").attr('checked')){ 160 html+=$("#edit-scroll-to-top-label").val(); 161 } 162 html+="</span></a></p>"; 163 // update the preview 164 $("#scroll-to-top-prev-container").html(style+html); 165 }); 166 $("#back-top").hide(); 167 $(function () { 168 $(window).scroll(function () { 169 if ($(this).scrollTop() > 100) { 170 $('#back-top').fadeIn(); 171 } else { 172 $('#back-top').fadeOut(); 173 } 174 }); 175 176 // scroll body to 0px on click 177 $('#back-top a').click(function () { 178 $('body,html').animate({ 179 scrollTop: 0 180 }, 800); 181 return false;
182 }); 183 }); 184 } 185}; 186})(jQuery); 187; 188(function($) { 189 Drupal.behaviors.custom_search = { 190 attach: function(context) { 191 192 if (!Drupal.settings.custom_search.solr) { 193 // Check if the search box is not empty on submit 194 $('form.search-form', context).submit(function(){ 195 var $this = $(this); 196 var box = $this.find('input.custom-search-box'); 197 if (box.val() != undefined && box.val() == '') { 198 $this.find('input.custom-search-box').addClass('error'); 199 return false; 200 } 201 // If basic search is hidden, copy or value to the keys 202 if ($this.find('#edit-keys').parents('div.element-invisible').attr('class') == 'element-invisible') { 203 $this.find('#edit-keys').val($this.find('#edit-or').val()); 204 $this.find('#edit-or').val(''); 205 } 206 return true; 207 }); 208 } 209 210 // Search from target 211 $('form.search-form').attr('target', Drupal.settings.custom_search.form_target); 212 213 // Displays Popup. 214 $('form.search-form input.custom-search-box', context).bind('click focus', function(e){ 215 var $parentForm = $(this).parents('form'); 216 // check if there's something in the popup and displays it 217 var popup = $parentForm.find('fieldset.custom_search-popup'); 218 if (popup.find('input,select').length && !popup.hasClass('opened')) { 219 popup.fadeIn().addClass('opened'); 220 } 221 e.stopPropagation(); 222 }); 223 $(document).bind('click focus', function(){ 224 $('fieldset.custom_search-popup').hide().removeClass('opened'); 225 }); 226 227 // Handle checkboxes 228 $('.custom-search-selector input:checkbox', context).each(function(){ 229 var el = $(this); 230 if (el.val() == 'c-all') { 231 el.change(function(){ 232 $(this).parents('.custom-search-selector').find('input:checkbox[value!=c-all]').attr('checked', false); 233 }); 234 } 235 else { 236 if (el.val().substr(0,2) == 'c-') { 237 el.change(function(){ 238 $('.custom-search-selector input:checkbox').each(function(){ 239 if ($(this).val().substr(0,2) == 'o-') { 240 $(this).attr('checked', false); 241 } 242 }); 243 $(this).parents('.custom-search-selector').find('input:checkbox[value=c-all]').attr('checked', false); 244 }); 245 } else { 246 el.change(function(){ 247 $(this).parents('.custom-search-selector').find('input:checkbox[value!=' + el.val() + ']').attr('checked', false); 248 }); 249 } 250 } 251 }); 252 253 // Reselect types and terms in advanced search 254 var edit_keys = $('#edit-keys').val(); 255 if(edit_keys) { 256 // types 257 var pos = edit_keys.indexOf('type:'); 258 if (pos != -1) { 259 var pos2 = edit_keys.indexOf(' ', pos); 260 if (pos2 == -1) { 261 pos2 = edit_keys.length; 262 } 263 var types = edit_keys.substring(pos + 5,pos2); 264 types = types.split(','); 265 for (var i = 0; i < types.length; i++) { 266 $('.search-form input:checkbox[value=' + types[i] + ']').attr('checked', true); 267 } 268 } 269 // terms 270 var pos = edit_keys.indexOf('term:'); 271 if (pos != -1) { 272 var pos2 = edit_keys.indexOf(' ', pos); 273 if (pos2 == -1) { 274 pos2 = edit_keys.length; 275 } 276 var terms = edit_keys.substring(pos + 5, pos2); 277 terms = terms.split(','); 278 for (var i = 0; i < terms.length; i++) { 279 $('#edit-term option[value=' + terms[i] + ']').attr('selected', true); 280 } 281 } 282 // languages 283 var pos = edit_keys.indexOf('language:'); 284 if (pos != 1) { 285 var pos2 = edit_keys.indexOf(' ', pos); 286 if (pos2 == -1) { 287 pos2 = edit_keys.length; 288 } 289 var languages = edit_keys.substring(pos + 9,pos2); 290 languages = languages.split(','); 291 for (var i = 0; i < languages.length; i++) { 292 $('.search-advanced #edit-language-' + languages[i]).attr('checked', true); 293 } 294 } 295 } 296 297 var popup = $('fieldset.custom_search-popup:not(.custom_search-processed)', context).addClass("custom_search-processed"); 298 popup.click(function(e){ 299 e.stopPropagation(); 300 }) 301 popup.append('<a class="custom_search-popup-close" href="#">
301' + Drupal.t('Close') + '</a>'); 302 $('a.custom_search-popup-close').click(function(e){ 303 $('fieldset.custom_search-popup.opened').hide().removeClass('opened'); 304 e.preventDefault(); 305 }); 306 307 } 308 } 309})(jQuery); 310; 311Drupal.behaviors.views_accordion = { 312 attach: function(context) { 313 if(Drupal.settings.views_accordion){ 314 (function ($) { 315 $.each(Drupal.settings.views_accordion, function(id) { 316 /* Our view settings */ 317 var usegroupheader = this.usegroupheader; 318 var viewname = this.viewname; 319 var display = this.display; 320 321 /* the selectors we have to play with */ 322 var displaySelector = '.view-id-' + viewname + '.view-display-id-' + display + ' > .view-content'; 323 var headerSelector = this.header; 324 325 /* Prepare our markup for jquery ui accordion */ 326 $(displaySelector + ' ' + headerSelector + ':not(.ui-accordion-header)').each(function(i){ 327 // Hash to use for accordion navigation option. 328 var hash = "#" + viewname + "-" + display + "-" + i; 329 var $this = $(this); 330 var $link = $this.find('a'); 331 // if the header is not already using an anchor tag, add one 332 if($link.length == 0){ 333 // setup anchor tag for navigation 334 $this.wrapInner('<a href="' + hash + '"></a>'); 335 } 336 // if there are already, they wont be clickable with js enabled, we'll use them for accordion navigation 337 else{ 338 // @FIXME ? 339 // We are currently destroying the original link, though search crawlers will stil see it. 340 // Links in accordions are NOT clickable and leaving them would kill deep linking. 341 $link.get(0).href = hash; 342 } 343 344 // Wrap the accordion content within a div if necessary 345 if (!usegroupheader) { 346 $this.siblings().wrapAll('<div></div>'); 347 } 348 }); 349 350 /* jQuery UI accordion call */ 351 $(displaySelector + ':not(.ui-accordion)').accordion({ 352 header: headerSelector, 353 animated: this.animated, 354 active: this.rowstartopen, 355 collapsible: this.collapsible, 356 autoHeight: this.autoheight, 357 event: this.event, 358 fillSpace: this.fillspace, 359 navigation: this.navigation, 360 clearstyle: this.clearstyle 361 }); 362 }); 363 })(jQuery); 364 } 365 } 366}; 367; 368/* 369 * jQuery FlexSlider v2.2.0 370 * Copyright 2012 WooThemes 371 * Contributing Author: Tyler Smith 372 */(function(e){e.flexslider=function(t,n){var r=e(t);r.vars=e.extend({},e.flexslider.defaults,n);var i=r.vars.namespace,s=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,o=("ontouchstart"in window||s||window.DocumentTouch&&document instanceof DocumentTouch)&&r.vars.touch,u="click touchend MSPointerUp",a="",f,l=r.vars.direction==="vertical",c=r.vars.reverse,h=r.vars.itemWidth>0,p=r.vars.animation==="fade",d=r.vars.asNavFor!=="",v={},m=!0;e.data(t,"flexslider",r);v={init:function(){r.animating=!1;r.currentSlide=parseInt(r.vars.startAt?r.vars.startAt:0);isNaN(r.currentSlide)&&(r.currentSlide=0);r.animatingTo=r.currentSlide;r.atEnd=r.currentSlide===0||r.currentSlide===r.last;r.containerSelector=r.vars.selector.substr(0,r.vars.selector.search(" "));r.slides=e(r.vars.selector,r);r.container=e(r.containerSelector,r);r.count=r.slides.length;r.syncExists=e(r.vars.sync).length>0;r.vars.animation==="slide"&&(r.vars.animation="swing");r.prop=l?"top":"marginLeft";r.args={};r.manualPause=!1;r.stopped=!1;r.started=!1;r.startTimeout=null;r.transitions=!r.vars.video&&!p&&r.vars.useCSS&&function(){var e=document.createElement("div"),t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var n in t)if(e.style[t[n]]!==undefined){r.pfx=t[n].replace("Perspective","").toLowerCase();r.prop="-"+r.pfx+"-transform";return!0}return!1}();r.vars.controlsContainer!==""&&(r.controlsContainer=e(r.vars.controlsContainer).length>0&&e(r.vars.controlsContainer));r.vars.manualControls!==""&&(r.manualControls=e(r.vars.manualControls).length>0&&e(r.vars.manualControls));if(r.vars.randomize){r.slides.sort(function(){return Math.round(Math.random())-.5});r.container.empty().append(r.slides)}r.doMath();r.setup("init");r.vars.controlNav&&v.controlNav.setup();r.vars.directionNav&&v.directionNav.setup();r.vars.keyboard&&(e(r.containerSelector).length===1||r.vars.multipleKeyboard)&&e(document).bind("keyup",function(e){var t=e.keyCode;if(!r.animating&&(t===39||t===37)){var n=t===39?r.getTarget("next"):t===37?r.getTarget("prev"):!1;r.flexAnimate(n,r.vars.pauseOnAction)}});r.vars.mousewheel&&r.bind("mousewheel",function(e,t,n,i){e.preventDefault();var s=t<0?r.getTarget("next"):r.getTarget("prev");r.flexAnimate(s,r.vars.pauseOnAction)});r.vars.pausePlay&&v.pausePlay.setup();
372r.vars.slideshow&&r.vars.pauseInvisible&&v.pauseInvisible.init();if(r.vars.slideshow){r.vars.pauseOnHover&&r.hover(function(){!r.manualPlay&&!r.manualPause&&r.pause()},function(){!r.manualPause&&!r.manualPlay&&!r.stopped&&r.play()});if(!r.vars.pauseInvisible||!v.pauseInvisible.isHidden())r.vars.initDelay>0?r.startTimeout=setTimeout(r.play,r.vars.initDelay):r.play()}d&&v.asNav.setup();o&&r.vars.touch&&v.touch();(!p||p&&r.vars.smoothHeight)&&e(window).bind("resize orientationchange focus",v.resize);r.find("img").attr("draggable","false");setTimeout(function(){r.vars.start(r)},200)},asNav:{setup:function(){r.asNav=!0;r.animatingTo=Math.floor(r.currentSlide/r.move);r.currentItem=r.currentSlide;r.slides.removeClass(i+"active-slide").eq(r.currentItem).addClass(i+"active-slide");if(!s)r.slides.click(function(t){t.preventDefault();var n=e(this),s=n.index(),o=n.offset().left-e(r).scrollLeft();if(o<=0&&n.hasClass(i+"active-slide"))r.flexAnimate(r.getTarget("prev"),!0);else if(!e(r.vars.asNavFor).data("flexslider").animating&&!n.hasClass(i+"active-slide")){r.direction=r.currentItem<s?"next":"prev";r.flexAnimate(s,r.vars.pauseOnAction,!1,!0,!0)}});else{t._slider=r;r.slides.each(function(){var t=this;t._gesture=new MSGesture;t._gesture.target=t;t.addEventListener("MSPointerDown",function(e){e.preventDefault();e.currentTarget._gesture&&e.currentTarget._gesture.addPointer(e.pointerId)},!1);t.addEventListener("MSGestureTap",function(t){t.preventDefault();var n=e(this),i=n.index();if(!e(r.vars.asNavFor).data("flexslider").animating&&!n.hasClass("active")){r.direction=r.currentItem<i?"next":"prev";r.flexAnimate(i,r.vars.pauseOnAction,!1,!0,!0)}})})}}},controlNav:{setup:function(){r.manualControls?v.controlNav.setupManual():v.controlNav.setupPaging()},setupPaging:function(){var t=r.vars.controlNav==="thumbnails"?"control-thumbs":"control-paging",n=1,s,o;r.controlNavScaffold=e('<ol class="'+i+"control-nav "+i+t+'"></ol>');if(r.pagingCount>1)for(var f=0;f<r.pagingCount;f++){o=r.slides.eq(f);s=r.vars.controlNav==="thumbnails"?'<img src="'+o.attr("data-thumb")+'"/>':"<a>"+n+"</a>";if("thumbnails"===r.vars.controlNav&&!0===r.vars.thumbCaptions){var l=o.attr("data-thumbcaption");""!=l&&undefined!=l&&(s+='<span class="'+i+'caption">'+l+"</span>")}r.controlNavScaffold.append("<li>"+s+"</li>");n++}r.controlsContainer?e(r.controlsContainer).append(r.controlNavScaffold):r.append(r.controlNavScaffold);v.controlNav.set();v.controlNav.active();r.controlNavScaffold.delegate("a, img",u,function(t){t.preventDefault();if(a===""||a===t.type){var n=e(this),s=r.controlNav.index(n);if(!n.hasClass(i+"active")){r.direction=s>r.currentSlide?"next":"prev";r.flexAnimate(s,r.vars.pauseOnAction)}}a===""&&(a=t.type);v.setToClearWatchedEvent()})},setupManual:function(){r.controlNav=r.manualControls;v.controlNav.active();r.controlNav.bind(u,function(t){t.preventDefault();if(a===""||a===t.type){var n=e(this),s=r.controlNav.index(n);if(!n.hasClass(i+"active")){s>r.currentSlide?r.direction="next":r.direction="prev";r.flexAnimate(s,r.vars.pauseOnAction)}}a===""&&(a=t.type);v.setToClearWatchedEvent()})},set:function(){var t=r.vars.controlNav==="thumbnails"?"img":"a";r.controlNav=e("."+i+"control-nav li "+t,r.controlsContainer?r.controlsContainer:r)},active:function(){r.controlNav.removeClass(i+"active").eq(r.animatingTo).addClass(i+"active")},update:function(t,n){r.pagingCount>1&&t==="add"?r.controlNavScaffold.append(e("<li><a>"+r.count+"</a></li>")):r.pagingCount===1?r.controlNavScaffold.find("li").remove():r.controlNav.eq(n).closest("li").remove();v.controlNav.set();r.pagingCount>1&&r.pagingCount!==r.controlNav.length?r.update(n,t):v.controlNav.active()}},directionNav:{setup:function(){var t=e('<ul class="'+i+'direction-nav"><li><a class="'+i+'prev" href="#">'+r.vars.prevText+'</a></li><li><a class="'+i+'next" href="#">'+r.vars.nextText+"</a></li></ul>");if(r.controlsContainer){e(r.controlsContainer).append(t);r.directionNav=e("."+i+"direction-nav li a",r.controlsContainer)}else{r.append(t);r.directionNav=e("."+i+"direction-nav li a",r)}v.directionNav.update();r.directionNav.bind(u,function(t){t.preventDefault();var n;if(a===""||a===t.type){n=e(this).hasClass(i+"next")?r.getTarget("next"):r.getTarget("prev");r.flexAnimate(n,r.vars.pauseOnAction)}a===""&&(a=t.type);v.setToClearWatchedEvent()})},update:function(){var e=i+"disabled";r.pagingCount===1?r.directionNav.addClass(e).attr("tabindex","-1"):r.vars.animationLoop?r.directionNav.removeClass(e).removeAttr("tabindex"):r.animatingTo===0?r.directionNav.removeClass(e).filter("."+i+"prev").addClass(e).attr("tabindex","-1"):r.animatingTo===r.last?r.directionNav.removeClass(e).filter("."+i+"next").addClass(e).attr("tabindex","-1"):r.directionNav.removeClass(e).removeAttr("tabindex")}},pausePlay:{setup:function(){var t=e('<div class="'+i+'pauseplay"><a></a></div>');if(r.controlsContainer){r.controlsContainer.append(t);r.pausePlay=e("."+i+"pauseplay a",r.controlsContainer)}else{r.append(t);r.pausePlay=e("."+i+"pauseplay a",r)}v.pausePlay.update(r.vars.slideshow?i+"pause":i+"play");r.pausePlay.bind(u,function(t){t.preventDefault();if(a===""||a===t.type)if(e(this).hasClass(i+"pause")){r.manualPause=!0;r.manualPlay=!1;r.pause()}else{r.manualPause=!1;r.manualPlay=!0;r.play()}a===""&&(a=t.type);v.setToClearWatchedEvent()})},update:function(e){e==="play"?r.pausePlay.removeClass(i+"pause").addClass(i+"play").html(r.vars.playText):r.pausePlay.removeClass(i+"play").addClass(i+"pause").html(r.vars.pauseText)}},touch:function(){var e,n,i,o,u,a,f=!1,d=0,v=0,m=0;if(!s){t.addEventListener("touchstart",g,!1);function g(s){if(r.animating)s.preventDefault();else if(window.navigator.msPointerEnabled||s.touches.length===1){r.pause();o=l?r.h:r.w;a=Number(new Date);d=s.touches[0].pageX;v=s.touches[0].pageY;i=h&&c&&r.animatingTo===r.last?0:h&&c?r.limit-(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo:h&&r.currentSlide===r.last?r.limit:h?(r.itemW+r.vars.itemMargin)*r.move*r.currentSlide:c?(r.last-r.currentSlide+r.cloneOffset)*o:(r.currentSlide+r.cloneOffset)*o;e=l?v:d;n=l?d:v;t.addEventListener("touchmove",y,!1);t.addEventListener("touchend",b,!1)}}function y(t){d=t.touches[0].pageX;v=t.touches[0].pageY;u=l?e-v:e-d;f=l?Math.abs(u)<Math.abs(d-n):Math.abs(u)<Math.abs(v-n);var s=500;if(!f||Number(new Date)-a>s){t.preventDefault();if(!p&&r.transitions){r.vars.animationLoop||(u/=r.currentSlide===0&&u<0||r.currentSlide===r.last&&u>0?Math.abs(u)/o+2:1);r.setProps(i+u,"setTouch")}}}function b(s){t.removeEventListener("touchmove",y,!1);if(r.animatingTo===r.currentSlide&&!f&&u!==null){var l=c?-u:u,h=l>0?r.getTarget("next"):r.getTarget("prev");r.canAdvance(h)&&(Number(new Date)-a<550&&Math.abs(l)>50||Math.abs(l)>o/2)?r.flexAnimate(h,r.vars.pauseOnAction):p||r.flexAnimate(r.currentSlide,r.vars.pauseOnAction,!0)}t.removeEventListener("touchend",b,!1);e=null;n=null;u=null;i=null}}else{t.style.msTouchAction="none";t._gesture=new MSGesture;t._gesture.target=t;t.addEventListener("MSPointerDown",w,!1);t._slider=r;t.addEventListener("MSGestureChange",E,!1);t.addEventListener("MSGestureEnd",S,!1);function w(e){e.stopPropagation();if(r.animating)e.preventDefault();else{r.pause();t._gesture.addPointer(e.pointerId);m=0;o=l?r.h:r.w;a=Number(new Date);i=h&&c&&r.animatingTo===r.last?0:h&&c?r.limit-(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo:h&&r.currentSlide===r.last?r.limit:h?(r.itemW+r.vars.itemMargin)*r.move*r.currentSlide:c?(r.last-r.currentSlide+r.cloneOffset)*o:(r.currentSlide+r.cloneOffset)*o}}function E(e){e.stopPropagation();var n=e.target._slider;if(!n)return;var r=-e.translationX,s=-e.translationY;m+=l?s:r;u=m;f=l?Math.abs(m)<Math.abs(-r):Math.abs(m)<Math.abs(-s);if(e.detail===e.MSGESTURE_FLAG_INERTIA){setImmediate(function(){t._gesture.stop()});return}if(!f||Number(new Date)-a>500){e.preventDefault();if(!p&&n.transitions){n.vars.animationLoop||(u=m/(n.currentSlide===0&&m<0||n.currentSlide===n.last&&m>0?Math.abs(m)/o+2:1));n.setProps(i+u,"setTouch")}}}function S(t){t.stopPropagation();var r=t.target._slider;if(!r)return;if(r.animatingTo===r.currentSlide&&!f&&u!==null){var s=c?-u:u,l=s>0?r.getTarget("next"):r.getTarget("prev");r.canAdvance(l)&&(Number(new Date)-a<550&&Math.abs(s)>50||Math.abs(s)>o/2)?r.flexAnimate(l,r.vars.pauseOnAction):p||r.flexAnimate(r.currentSlide,r.vars.pauseOnAction,!0)}e=null;n=null;u=null;i=null;m=0}}},resize:function(){if(!r.animating&&r.is(":visible")){h||r.doMath();if(p)v.smoothHeight();else if(h){r.slides.width(r.computedW);r.update(r.pagingCount);r.setProps()}else if(l){r.viewport.height(r.h);r.setProps(r.h,"setTotal")}else{r.vars.smoothHeight&&v.smoothHeight();r.newSlides.width(r.computedW);r.setProps(r.computedW,"setTotal")}}},smoothHeight:function(e){if(!l||p){var t=p?r:r.viewport;e?t.animate({height:r.slides.eq(r.animatingTo).height()},e):t.height(r.slides.eq(r.animatingTo).height())}},sync:function(t){var n=e(r.vars.sync).data("flexslider"),i=r.animatingTo;switch(t){case"animate":n.flexAnimate(i,r.vars.pauseOnAction,!1,!0);break;case"play":!n.playing&&!n.asNav&&n.play();break;case"pause":n.pause()}},pauseInvisible:{visProp:null,init:function(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;t<e.length;t++)e[t]+"Hidden"in document&&(v.pauseInvisible.visProp=e[t]+"Hidden");if(v.pauseInvisible.visProp){var n=v.pauseInvisible.visProp.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(n,function(){v.pauseInvisible.isHidden()?r.startTimeout?clearTimeout(r.startTimeout):r.pause():r.started?r.play():r.vars.initDelay>0?setTimeout(r.play,r.vars.initDelay):r.play()})}},isHidden:function(){return document[v.pauseInvisible.visProp]||!1}},setToClearWatchedEvent:function(){clearTimeout(f);f=setTimeout(function(){a=""},3e3)}};r.flexAnimate=function(t,n,s,u,a){!r.vars.animationLoop&&t!==r.currentSlide&&(r.direction=t>r.currentSlide?"next":"prev");d&&r.pagingCount===1&&(r.direction=r.currentItem<t?"next":"prev");if(!r.animating&&(r.canAdvance(t,a)||s)&&r.is(":visible")){if(d&&u){var f=e(r.vars.asNavFor).data("flexslider");r.atEnd=t===0||t===r.count-1;f.flexAnimate(t,!0,!1,!0,a);r.direction=r.currentItem<t?"next":"prev";f.direction=r.direction;if(Math.ceil((t+1)/r.visible)-1===r.currentSlide||t===0){r.currentItem=t;r.slides.removeClass(i+"active-slide").eq(t).addClass(i+"active-slide");return!1}r.currentItem=t;r.slides.removeClass(i+"active-slide").eq(t).addClass(i+"active-slide");t=Math.floor(t/r.visible)}r.animating=!0;r.animatingTo=t;n&&r.pause();r.vars.before(r);r.syncExists&&!a&&v.sync("animate");r.vars.controlNav&&v.controlNav.active();h||r.slides.removeClass(i+"active-slide").eq(t).addClass(i+"active-slide");r.atEnd=t===0||t===r.last;
372r.vars.directionNav&&v.directionNav.update();if(t===r.last){r.vars.end(r);r.vars.animationLoop||r.pause()}if(!p){var m=l?r.slides.filter(":first").height():r.computedW,g,y,b;if(h){g=r.vars.itemMargin;b=(r.itemW+g)*r.move*r.animatingTo;y=b>r.limit&&r.visible!==1?r.limit:b}else r.currentSlide===0&&t===r.count-1&&r.vars.animationLoop&&r.direction!=="next"?y=c?(r.count+r.cloneOffset)*m:0:r.currentSlide===r.last&&t===0&&r.vars.animationLoop&&r.direction!=="prev"?y=c?0:(r.count+1)*m:y=c?(r.count-1-t+r.cloneOffset)*m:(t+r.cloneOffset)*m;r.setProps(y,"",r.vars.animationSpeed);if(r.transitions){if(!r.vars.animationLoop||!r.atEnd){r.animating=!1;r.currentSlide=r.animatingTo}r.container.unbind("webkitTransitionEnd transitionend");r.container.bind("webkitTransitionEnd transitionend",function(){r.wrapup(m)})}else r.container.animate(r.args,r.vars.animationSpeed,r.vars.easing,function(){r.wrapup(m)})}else if(!o){r.slides.eq(r.currentSlide).css({zIndex:1}).animate({opacity:0},r.vars.animationSpeed,r.vars.easing);r.slides.eq(t).css({zIndex:2}).animate({opacity:1},r.vars.animationSpeed,r.vars.easing,r.wrapup)}else{r.slides.eq(r.currentSlide).css({opacity:0,zIndex:1});r.slides.eq(t).css({opacity:1,zIndex:2});r.wrapup(m)}r.vars.smoothHeight&&v.smoothHeight(r.vars.animationSpeed)}};r.wrapup=function(e){!p&&!h&&(r.currentSlide===0&&r.animatingTo===r.last&&r.vars.animationLoop?r.setProps(e,"jumpEnd"):r.currentSlide===r.last&&r.animatingTo===0&&r.vars.animationLoop&&r.setProps(e,"jumpStart"));r.animating=!1;r.currentSlide=r.animatingTo;r.vars.after(r)};r.animateSlides=function(){!r.animating&&m&&r.flexAnimate(r.getTarget("next"))};r.pause=function(){clearInterval(r.animatedSlides);r.animatedSlides=null;r.playing=!1;r.vars.pausePlay&&v.pausePlay.update("play");r.syncExists&&v.sync("pause")};r.play=function(){r.playing&&clearInterval(r.animatedSlides);r.animatedSlides=r.animatedSlides||setInterval(r.animateSlides,r.vars.slideshowSpeed);r.started=r.playing=!0;r.vars.pausePlay&&v.pausePlay.update("pause");r.syncExists&&v.sync("play")};r.stop=function(){r.pause();r.stopped=!0};r.canAdvance=function(e,t){var n=d?r.pagingCount-1:r.last;return t?!0:d&&r.currentItem===r.count-1&&e===0&&r.direction==="prev"?!0:d&&r.currentItem===0&&e===r.pagingCount-1&&r.direction!=="next"?!1:e===r.currentSlide&&!d?!1:r.vars.animationLoop?!0:r.atEnd&&r.currentSlide===0&&e===n&&r.direction!=="next"?!1:r.atEnd&&r.currentSlide===n&&e===0&&r.direction==="next"?!1:!0};r.getTarget=function(e){r.direction=e;return e==="next"?r.currentSlide===r.last?0:r.currentSlide+1:r.currentSlide===0?r.last:r.currentSlide-1};r.setProps=function(e,t,n){var i=function(){var n=e?e:(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo,i=function(){if(h)return t==="setTouch"?e:c&&r.animatingTo===r.last?0:c?r.limit-(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo:r.animatingTo===r.last?r.limit:n;switch(t){case"setTotal":return c?(r.count-1-r.currentSlide+r.cloneOffset)*e:(r.currentSlide+r.cloneOffset)*e;case"setTouch":return c?e:e;case"jumpEnd":return c?e:r.count*e;case"jumpStart":return c?r.count*e:e;default:return e}}();return i*-1+"px"}();if(r.transitions){i=l?"translate3d(0,"+i+",0)":"translate3d("+i+",0,0)";n=n!==undefined?n/1e3+"s":"0s";r.container.css("-"+r.pfx+"-transition-duration",n)}r.args[r.prop]=i;(r.transitions||n===undefined)&&r.container.css(r.args)};r.setup=function(t){if(!p){var n,s;if(t==="init"){r.viewport=e('<div class="'+i+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(r).append(r.container);r.cloneCount=0;r.cloneOffset=0;if(c){s=e.makeArray(r.slides).reverse();r.slides=e(s);r.container.empty().append(r.slides)}}if(r.vars.animationLoop&&!h){r.cloneCount=2;r.cloneOffset=1;t!=="init"&&r.container.find(".clone").remove();r.container.append(r.slides.first().clone().addClass("clone").attr("aria-hidden","true")).prepend(r.slides.last().clone().addClass("clone").attr("aria-hidden","true"))}r.newSlides=e(r.vars.selector,r);n=c?r.count-1-r.currentSlide+r.cloneOffset:r.currentSlide+r.cloneOffset;if(l&&!h){r.container.height((r.count+r.cloneCount)*200+"%").css("position","absolute").width("100%");setTimeout(function(){r.newSlides.css({display:"block"});r.doMath();r.viewport.height(r.h);r.setProps(n*r.h,"init")},t==="init"?100:0)}else{r.container.width((r.count+r.cloneCount)*200+"%");r.setProps(n*r.computedW,"init");setTimeout(function(){r.doMath();r.newSlides.css({width:r.computedW,"float":"left",display:"block"});r.vars.smoothHeight&&v.smoothHeight()},t==="init"?100:0)}}else{r.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"});t==="init"&&(o?r.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+r.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(r.currentSlide).css({opacity:1,zIndex:2}):r.slides.css({opacity:0,display:"block",zIndex:1}).eq(r.currentSlide).css({zIndex:2}).animate({opacity:1},r.vars.animationSpeed,r.vars.easing));r.vars.smoothHeight&&v.smoothHeight()}h||r.slides.removeClass(i+"active-slide").eq(r.currentSlide).addClass(i+"active-slide")};r.doMath=function(){var e=r.slides.first(),t=r.vars.itemMargin,n=r.vars.minItems,i=r.vars.maxItems;r.w=r.viewport===undefined?r.width():r.viewport.width();r.h=e.height();r.boxPadding=e.outerWidth()-e.width();if(h){r.itemT=r.vars.itemWidth+t;r.minW=n?n*r.itemT:r.w;r.maxW=i?i*r.itemT-t:r.w;r.itemW=r.minW>
372r.w?(r.w-t*(n-1))/n:r.maxW<r.w?(r.w-t*(i-1))/i:r.vars.itemWidth>r.w?r.w:r.vars.itemWidth;r.visible=Math.floor(r.w/r.itemW);r.move=r.vars.move>0&&r.vars.move<r.visible?r.vars.move:r.visible;r.pagingCount=Math.ceil((r.count-r.visible)/r.move+1);r.last=r.pagingCount-1;r.limit=r.pagingCount===1?0:r.vars.itemWidth>r.w?r.itemW*(r.count-1)+t*(r.count-1):(r.itemW+t)*r.count-r.w-t}else{r.itemW=r.w;r.pagingCount=r.count;r.last=r.count-1}r.computedW=r.itemW-r.boxPadding};r.update=function(e,t){r.doMath();if(!h){e<r.currentSlide?r.currentSlide+=1:e<=r.currentSlide&&e!==0&&(r.currentSlide-=1);r.animatingTo=r.currentSlide}if(r.vars.controlNav&&!r.manualControls)if(t==="add"&&!h||r.pagingCount>r.controlNav.length)v.controlNav.update("add");else if(t==="remove"&&!h||r.pagingCount<r.controlNav.length){if(h&&r.currentSlide>r.last){r.currentSlide-=1;r.animatingTo-=1}v.controlNav.update("remove",r.last)}r.vars.directionNav&&v.directionNav.update()};r.addSlide=function(t,n){var i=e(t);r.count+=1;r.last=r.count-1;l&&c?n!==undefined?r.slides.eq(r.count-n).after(i):r.container.prepend(i):n!==undefined?r.slides.eq(n).before(i):r.container.append(i);r.update(n,"add");r.slides=e(r.vars.selector+":not(.clone)",r);r.setup();r.vars.added(r)};r.removeSlide=function(t){var n=isNaN(t)?r.slides.index(e(t)):t;r.count-=1;r.last=r.count-1;isNaN(t)?e(t,r.slides).remove():l&&c?r.slides.eq(r.last).remove():r.slides.eq(t).remove();r.doMath();r.update(n,"remove");r.slides=e(r.vars.selector+":not(.clone)",r);r.setup();r.vars.removed(r)};v.init()};e(window).blur(function(e){focused=!1}).focus(function(e){focused=!0});e.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:!1,thumbCaptions:!1,pauseOnAction:!0,pauseOnHover:!1,pauseInvisible:!0,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:1,maxItems:0,move:0,allowOneSlide:!0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}};e.fn.flexslider=function(t){t===undefined&&(t={});if(typeof t=="object")return this.each(function(){var n=e(this),r=t.selector?t.selector:".slides > li",i=n.find(r);if(i.length===1&&t.allowOneSlide===!0||i.length===0){i.fadeIn(400);t.start&&t.start(n)}else n.data("flexslider")===undefined&&new e.flexslider(this,t)});var n=e(this).data("flexslider");switch(t){case"play":n.play();break;case"pause":n.pause();break;case"stop":n.stop();break;case"next":n.flexAnimate(n.getTarget("next"),!0);break;case"prev":case"previous":n.flexAnimate(n.getTarget("prev"),!0);break;default:typeof t=="number"&&n.flexAnimate(t,!0)}}})(jQuery);; 373/** 374 * jQuery Masonry v2.1.08 375 * A dynamic layout plugin for jQuery 376 * The flip-side of CSS Floats 377 * http://masonry.desandro.com 378 * 379 * Licensed under the MIT license. 380 * Copyright 2012 David DeSandro 381 */ 382(function(e,t,n){"use strict";var r=t.event,i;r.special.smartresize={setup:function(){t(this).bind("resize",r.special.smartresize.handler)},teardown:function(){t(this).unbind("resize",r.special.smartresize.handler)},handler:function(e,t){var n=this,s=arguments;e.type="smartresize",i&&clearTimeout(i),i=setTimeout(function(){r.dispatch.apply(n,s)},t==="execAsap"?0:100)}},t.fn.smartresize=function(e){return e?this.bind("smartresize",e):this.trigger("smartresize",["execAsap"])},t.Mason=function(e,n){this.element=t(n),this._create(e),this._init()},t.Mason.settings={isResizable:!0,isAnimated:!1,animationOptions:{queue:!1,duration:500},gutterWidth:0,isRTL:!1,isFitWidth:!1,containerStyle:{position:"relative"}},t.Mason.prototype={_filterFindBricks:function(e){var t=this.options.itemSelector;return t?e.filter(t).add(e.find(t)):e},_getBricks:function(e){var t=this._filterFindBricks(e).css({position:"absolute"}).addClass("masonry-brick");return t},_create:function(n){this.options=t.extend(!0,{},t.Mason.settings,n),this.styleQueue=[];var r=this.element[0].style;this.originalStyle={height:r.height||""};var i=this.options.containerStyle;for(var s in i)this.originalStyle[s]=r[s]||"";this.element.css(i),this.horizontalDirection=this.options.isRTL?"right":"left";var o=this.element.css("padding-"+this.horizontalDirection),u=this.element.css("padding-top");this.offset={x:o?parseInt(o,10):0,y:u?parseInt(u,10):0},this.isFluid=this.options.columnWidth&&typeof this.options.columnWidth=="function";var a=this;setTimeout(function(){a.element.addClass("masonry")},0),this.options.isResizable&&t(e).bind("smartresize.masonry",function(){a.resize()}),this.reloadItems()},_init:function(e){this._getColumns(),this._reLayout(e)},option:function(e,n){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))},layout:function(e,t){for(var n=0,r=e.length;n<r;n++)this._placeBrick(e[n]);var i={};i.height=Math.max.apply(Math,this.colYs);if(this.options.isFitWidth){var s=0;n=this.cols;while(--n){if(this.colYs[n]!==0)break;s++}i.width=(this.cols-s)*this.columnWidth-this.options.gutterWidth}this.styleQueue.push({$el:this.element,style:i});var o=this.isLaidOut?this.options.isAnimated?"animate":"css":"css",u=this.options.animationOptions,a;for(n=0,r=this.styleQueue.length;n<r;n++)a=this.styleQueue[n],a.$el[o](a.style,u);this.styleQueue=[],t&&t.call(e),this.isLaidOut=!0},_getColumns:function(){var e=this.options.isFitWidth?this.element.parent():this.element,t=e.width();this.columnWidth=this.isFluid?this.options.columnWidth(t):this.options.columnWidth||this.$bricks.outerWidth(!0)||t,this.columnWidth+=this.options.gutterWidth,this.cols=Math.floor((t+this.options.gutterWidth)/this.columnWidth),this.cols=Math.max(this.cols,1)},_placeBrick:function(e){var n=t(e),r,i,s,o,u;r=Math.ceil(n.outerWidth(!0)/this.columnWidth),r=Math.min(r,this.cols);if(r===1)s=this.colYs;else{i=this.cols+1-r,s=[];for(u=0;
382u<i;u++)o=this.colYs.slice(u,u+r),s[u]=Math.max.apply(Math,o)}var a=Math.min.apply(Math,s),f=0;for(var l=0,c=s.length;l<c;l++)if(s[l]===a){f=l;break}var h={top:a+this.offset.y};h[this.horizontalDirection]=this.columnWidth*f+this.offset.x,this.styleQueue.push({$el:n,style:h});var p=a+n.outerHeight(!0),d=this.cols+1-c;for(l=0;l<d;l++)this.colYs[f+l]=p},resize:function(){var e=this.cols;this._getColumns(),(this.isFluid||this.cols!==e)&&this._reLayout()},_reLayout:function(e){var t=this.cols;this.colYs=[];while(t--)this.colYs.push(0);this.layout(this.$bricks,e)},reloadItems:function(){this.$bricks=this._getBricks(this.element.children())},reload:function(e){this.reloadItems(),this._init(e)},appended:function(e,t,n){if(t){this._filterFindBricks(e).css({top:this.element.height()});var r=this;setTimeout(function(){r._appended(e,n)},1)}else this._appended(e,n)},_appended:function(e,t){var n=this._getBricks(e);this.$bricks=this.$bricks.add(n),this.layout(n,t)},remove:function(e){this.$bricks=this.$bricks.not(e),e.remove()},destroy:function(){this.$bricks.removeClass("masonry-brick").each(function(){this.style.position="",this.style.top="",this.style.left=""});var n=this.element[0].style;for(var r in this.originalStyle)n[r]=this.originalStyle[r];this.element.unbind(".masonry").removeClass("masonry").removeData("masonry"),t(e).unbind(".masonry")}},t.fn.imagesLoaded=function(e){function u(){e.call(n,r)}function a(e){var n=e.target;n.src!==s&&t.inArray(n,o)===-1&&(o.push(n),--i<=0&&(setTimeout(u),r.unbind(".imagesLoaded",a)))}var n=this,r=n.find("img").add(n.filter("img")),i=r.length,s="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",o=[];return i||u(),r.bind("load.imagesLoaded error.imagesLoaded",a).each(function(){var e=this.src;this.src=s,this.src=e}),n};var s=function(t){e.console&&e.console.error(t)};t.fn.masonry=function(e){if(typeof e=="string"){var n=Array.prototype.slice.call(arguments,1);this.each(function(){var r=t.data(this,"masonry");if(!r){s("cannot call methods on masonry prior to initialization; attempted to call method '"+e+"'");return}if(!t.isFunction(r[e])||e.charAt(0)==="_"){s("no such method '"+e+"' for masonry instance");return}r[e].apply(r,n)})}else this.each(function(){var n=t.data(this,"masonry");n?(n.option(e||{}),n._init()):t.data(this,"masonry",new t.Mason(e,this))});return this}})(window,jQuery);; 383/** 384 * @file 385 * Masonry script. 386 */ 387 388(function($) { 389 390Drupal.behaviors.masonry = { 391 attach: function(context, settings) { 392 393 // Iterate through all Masonry instances 394 $.each(Drupal.settings.masonry, function (container, settings) { 395 // Set container 396 var $container = $(container); 397 398 // Set options 399 var $options = new Object(); 400 if (settings.item_selector) { 401 $options.itemSelector = settings.item_selector; 402 } 403 if (settings.column_width) { 404 if (settings.column_width_units == 'px') { 405 $options.columnWidth = settings.column_width; 406 } 407 else if (settings.column_width_units == '%') { 408 $options.columnWidth = function (containerWidth) { 409 return containerWidth * (settings.column_width / 100); 410 }; 411 } 412 } 413 $options.gutterWidth = settings.gutter_width; 414 $options.isResizable = settings.resizable; 415 if (settings.resizable) { 416 $options.isAnimated = settings.animated; 417 if (settings.animated) { 418 $options.animationOptions = { 419 queue: false, 420 duration: settings.animation_duration 421 }; 422 } 423 } 424 $options.isFitWidth = settings.fit_width; 425 $options.isRTL = settings.rtl; 426 427 // Apply Masonry to container 428 if (settings.images_first) { 429 $container.imagesLoaded(function () { 430 $container.masonry($options); 431 }); 432 } 433 else { 434 $container.masonry($options); 435 } 436 }); 437 438 } 439}; 440 441})(jQuery); 442 443; 444Drupal.TBMegaMenu = Drupal.TBMegaMenu || {}; 445 446(function ($) { 447 Drupal.TBMegaMenu.menuInstance = false; 448 Drupal.behaviors.tbMegaMenuAction = { 449 attach: function(context) { 450 $('.tb-megamenu-button').click(function() { 451 if(parseInt($(this).parent().children('.nav-collapse').height())) { 452 $(this).parent().children('.nav-collapse').css({height: 0, overflow: 'hidden'}); 453 } 454 else { 455 $(this).parent().children('.nav-collapse').css({height: 'auto', overflow: 'visible'}); 456 } 457 }); 458 var isTouch = 'ontouchstart' in window && !(/hp-tablet/gi).test(navigator.appVersion); 459 if(!isTouch){ 460 $(document).ready(function($){ 461 var mm_duration = 0; 462 $('.t3-megamenu').each (function(){ 463 if ($(this).data('duration')) { 464 mm_duration = $(this).data('duration'); 465 } 466 }); 467 var mm_timeout = mm_duration ? 100 + mm_duration : 500; 468 $('.nav > li, li.mega').on("hover", function(event) { 469 var $this = $(this); 470 if ($this.hasClass ('mega')) { 471 $this.addClass ('animating'); 472 clearTimeout ($this.data('animatingTimeout')); 473 $this.data('animatingTimeout', setTimeout(function(){$this.removeClass ('animating')}, mm_timeout)); 474 clearTimeout ($this.data('hoverTimeout')); 475 $this.data('hoverTimeout', setTimeout(function(){$this.addClass ('open')}, 100)); 476 } else { 477 clearTimeout ($this.data('hoverTimeout')); 478 $this.data('hoverTimeout', 479 setTimeout(function(){$this.addClass ('open')}, 100)); 480 } 481 }, 482 function(event) { 483 var $this = $(this); 484 if ($this.hasClass ('mega')) { 485 $this.addClass ('animating'); 486 clearTimeout ($this.data('animatingTimeout')); 487 $this.data('animatingTimeout', 488 setTimeout(function(){$this.removeClass ('animating')}, mm_timeout)); 489 clearTimeout ($this.data('hoverTimeout')); 490 $this.data('hoverTimeout', setTimeout(function(){$this.removeClass ('open')}, 100)); 491 } else { 492 clearTimeout ($this.data('hoverTimeout')); 493 $this.data('hoverTimeout', 494 setTimeout(function(){$this.removeClass ('open')}, 100)); 495 } 496 }); 497 }); 498 } 499 } 500 } 501})(jQuery); 502 503; 504Drupal.TBMegaMenu = Drupal.TBMegaMenu || {}; 505 506(function ($) { 507 Drupal.TBMegaMenu.createTouchMenu = function(items) { 508 items.children('a').each( function() { 509 var $item = $(this); 510 var tbitem = $(this).parent(); 511 $item.click( function(event){ 512 if ($item.hasClass('tb-megamenu-clicked')) { 513 var $uri = $item.attr('href'); 514 window.location.href = $uri; 515 } 516 else { 517 event.preventDefault(); 518 $item.addClass('tb-megamenu-clicked'); 519 if(!tbitem.hasClass('open')){ 520 tbitem.addClass('open'); 521 } 522 } 523 }).closest('li').mouseleave( function(){ 524 $item.removeClass('tb-megamenu-clicked'); 525 tbitem.removeClass('open'); 526 }); 527 }); 528 /* 529 items.children('a').children('span.caret').each( function() { 530 var $item = $(this).parent(); 531 $item.click(function(event){ 532 tbitem = $item.parent(); 533 if ($item.hasClass('tb-megamenu-clicked')) { 534 Drupal.TBMegaMenu.eventStopPropagation(event); 535 if(tbitem.hasClass('open')){ 536 tbitem.removeClass('open'); 537 $item.removeClass('tb-megamenu-clicked'); 538 } 539 } 540 else { 541 Drupal.TBMegaMenu.eventStopPropagation(event); 542 $item.addClass('tb-megamenu-clicked'); 543 if(!tbitem.hasClass('open')){ 544 tbitem.addClass('open'); 545 $item.removeClass('tb-megamenu-clicked'); 546 } 547 } 548 }); 549 }); 550 */ 551 } 552 553 Drupal.TBMegaMenu.eventStopPropagation = function(event) { 554 if (event.stopPropagation) { 555 event.stopPropagation(); 556 } 557 else if (window.event) { 558 window.event.cancelBubble = true; 559 } 560 } 561 562 var windowsize = $(window).width(); 563 $(window).resize(function() { 564 var windowsize = $(window).width(); 565 }); 566 567 568 Drupal.behaviors.tbMegaMenuTouchAction = { 569 attach: function(context) { 570 var isTouch = 'ontouchstart' in window && !(/hp-tablet/gi).test(navigator.appVersion); 571 var windowsize = $(window).width(); 572 if(isTouch && windowsize < 1024){ 573 $('html').addClass('touch'); 574 Drupal.TBMegaMenu.createTouchMenu($('.tb-megamenu ul.nav li.mega').has('.dropdown-menu')); 575 } 576 } 577 } 578})(jQuery); 579; 580/** 581 * @file 582 * Some basic behaviors and utility functions for Views. 583 */ 584(function ($) { 585 586Drupal.Views = {}; 587 588/** 589 * jQuery UI tabs, Views integration component 590 */ 591Drupal.behaviors.viewsTabs = { 592 attach: function (context) { 593 if ($.viewsUi && $.viewsUi.tabs) { 594 $('#views-tabset').once('views-processed').viewsTabs({ 595 selectedClass: 'active' 596 }); 597 } 598 599 $('a.views-remove-link').once('views-processed').click(function(event) { 600 var id = $(this).attr('id').replace('views-remove-link-', ''); 601 $('#views-row-' + id).hide(); 602 $('#views-removed-' + id).attr('checked', true); 603 event.preventDefault(); 604 }); 605 /** 606 * Here is to handle display deletion 607 * (checking in the hidden checkbox and hiding out the row) 608 */ 609 $('a.display-remove-link') 610 .addClass('display-processed') 611 .click(function() { 612 var id = $(this).attr('id').replace('display-remove-link-', ''); 613 $('#display-row-' + id).hide(); 614 $('#display-removed-' + id).attr('checked', true); 615 return false;
616 }); 617 } 618}; 619 620/** 621 * Helper function to parse a querystring. 622 */ 623Drupal.Views.parseQueryString = function (query) { 624 var args = {}; 625 var pos = query.indexOf('?'); 626 if (pos != -1) { 627 query = query.substring(pos + 1); 628 } 629 var pairs = query.split('&'); 630 for(var i in pairs) { 631 if (typeof(pairs[i]) == 'string') { 632 var pair = pairs[i].split('='); 633 // Ignore the 'q' path argument, if present. 634 if (pair[0] != 'q' && pair[1]) { 635 args[decodeURIComponent(pair[0].replace(/\+/g, ' '))] = decodeURIComponent(pair[1].replace(/\+/g, ' ')); 636 } 637 } 638 } 639 return args; 640}; 641 642/** 643 * Helper function to return a view's arguments based on a path. 644 */ 645Drupal.Views.parseViewArgs = function (href, viewPath) { 646 var returnObj = {}; 647 var path = Drupal.Views.getPath(href); 648 // Ensure we have a correct path. 649 if (viewPath && path.substring(0, viewPath.length + 1) == viewPath + '/') { 650 var args = decodeURIComponent(path.substring(viewPath.length + 1, path.length)); 651 returnObj.view_args = args; 652 returnObj.view_path = path; 653 } 654 return returnObj; 655}; 656 657/** 658 * Strip off the protocol plus domain from an href. 659 */ 660Drupal.Views.pathPortion = function (href) { 661 // Remove e.g. http://example.com if present. 662 var protocol = window.location.protocol; 663 if (href.substring(0, protocol.length) == protocol) { 664 // 2 is the length of the '//' that normally follows the protocol 665 href = href.substring(href.indexOf('/', protocol.length + 2)); 666 } 667 return href; 668}; 669 670/** 671 * Return the Drupal path portion of an href. 672 */ 673Drupal.Views.getPath = function (href) { 674 href = Drupal.Views.pathPortion(href); 675 href = href.substring(Drupal.settings.basePath.length, href.length); 676 // 3 is the length of the '?q=' added to the url without clean urls. 677 if (href.substring(0, 3) == '?q=') { 678 href = href.substring(3, href.length); 679 } 680 var chars = ['#', '?', '&']; 681 for (i in chars) { 682 if (href.indexOf(chars[i]) > -1) { 683 href = href.substr(0, href.indexOf(chars[i])); 684 } 685 } 686 return href; 687}; 688 689})(jQuery); 690; 691(function ($) { 692 693/** 694 * A progressbar object. Initialized with the given id. Must be inserted into 695 * the DOM afterwards through progressBar.element. 696 * 697 * method is the function which will perform the HTTP request to get the 698 * progress bar state. Either "GET" or "POST". 699 * 700 * e.g. pb = new progressBar('myProgressBar'); 701 * some_element.appendChild(pb.element); 702 */ 703Drupal.progressBar = function (id, updateCallback, method, errorCallback) { 704 var pb = this; 705 this.id = id; 706 this.method = method || 'GET'; 707 this.updateCallback = updateCallback; 708 this.errorCallback = errorCallback; 709 710 // The WAI-ARIA setting aria-live="polite" will announce changes after users 711 // have completed their current activity and not interrupt the screen reader. 712 this.element = $('<div class="progress" aria-live="polite"></div>').attr('id', id); 713 this.element.html('<div class="bar"><div class="filled"></div></div>' + 714 '<div class="percentage"></div>' + 715 '<div class="message"> </div>'); 716}; 717 718/** 719 * Set the percentage and status message for the progressbar. 720 */ 721Drupal.progressBar.prototype.setProgress = function (percentage, message) { 722 if (percentage >= 0 && percentage <= 100) { 723 $('div.filled', this.element).css('width', percentage + '%'); 724 $('div.percentage', this.element).html(percentage + '%'); 725 } 726 $('div.message', this.element).html(message); 727 if (this.updateCallback) { 728 this.updateCallback(percentage, message, this); 729 } 730}; 731 732/** 733 * Start monitoring progress via Ajax. 734 */ 735Drupal.progressBar.prototype.startMonitoring = function (uri, delay) { 736 this.delay = delay; 737 this.uri = uri; 738 this.sendPing(); 739}; 740 741/** 742 * Stop monitoring progress via Ajax. 743 */ 744Drupal.progressBar.prototype.stopMonitoring = function () { 745 clearTimeout(this.timer); 746 // This allows monitoring to be stopped from within the callback. 747 this.uri = null; 748}; 749 750/** 751 * Request progress data from server. 752 */ 753Drupal.progressBar.prototype.sendPing = function () { 754 if (this.timer) { 755 clearTimeout(this.timer); 756 } 757 if (this.uri) { 758 var pb = this; 759 // When doing a post request, you need non-null data. Otherwise a 760 // HTTP 411 or HTTP 406 (with Apache mod_security) error may result. 761 $.ajax({ 762 type: this.method, 763 url: this.uri, 764 data: '', 765 dataType: 'json', 766 success: function (progress) { 767 // Display errors. 768 if (progress.status == 0) { 769 pb.displayError(progress.data); 770 return; 771 } 772 // Update display. 773 pb.setProgress(progress.percentage, progress.message); 774 // Schedule next timer.
775 pb.timer = setTimeout(function () { pb.sendPing(); }, pb.delay); 776 }, 777 error: function (xmlhttp) { 778 pb.displayError(Drupal.ajaxError(xmlhttp, pb.uri)); 779 } 780 }); 781 } 782}; 783 784/** 785 * Display errors on the page. 786 */ 787Drupal.progressBar.prototype.displayError = function (string) { 788 var error = $('<div class="messages error"></div>').html(string); 789 $(this.element).before(error).hide(); 790 791 if (this.errorCallback) { 792 this.errorCallback(this); 793 } 794}; 795 796})(jQuery); 797; 798/** 799 * @file 800 * Handles AJAX fetching of views, including filter submission and response. 801 */ 802(function ($) { 803 804/** 805 * Attaches the AJAX behavior to Views exposed filter forms and key View links. 806 */ 807Drupal.behaviors.ViewsAjaxView = {}; 808Drupal.behaviors.ViewsAjaxView.attach = function() { 809 if (Drupal.settings && Drupal.settings.views && Drupal.settings.views.ajaxViews) { 810 $.each(Drupal.settings.views.ajaxViews, function(i, settings) { 811 Drupal.views.instances[i] = new Drupal.views.ajaxView(settings); 812 }); 813 } 814}; 815 816Drupal.views = {}; 817Drupal.views.instances = {}; 818 819/** 820 * Javascript object for a certain view. 821 */ 822Drupal.views.ajaxView = function(settings) { 823 var selector = '.view-dom-id-' + settings.view_dom_id; 824 this.$view = $(selector); 825 826 // Retrieve the path to use for views' ajax. 827 var ajax_path = Drupal.settings.views.ajax_path; 828 829 // If there are multiple views this might've ended up showing up multiple times. 830 if (ajax_path.constructor.toString().indexOf("Array") != -1) { 831 ajax_path = ajax_path[0]; 832 } 833 834 // Check if there are any GET parameters to send to views. 835 var queryString = window.location.search || ''; 836 if (queryString !== '') { 837 // Remove the question mark and Drupal path component if any. 838 var queryString = queryString.slice(1).replace(/q=[^&]+&?|&?render=[^&]+/, ''); 839 if (queryString !== '') { 840 // If there is a '?' in ajax_path, clean url are on and & should be used to add parameters. 841 queryString = ((/\?/.test(ajax_path)) ? '&' : '?') + queryString; 842 } 843 } 844 845 this.element_settings = { 846 url: ajax_path + queryString, 847 submit: settings, 848 setClick: true, 849 event: 'click', 850 selector: selector, 851 progress: { type: 'throbber' } 852 }; 853 854 this.settings = settings; 855 856 // Add the ajax to exposed forms. 857 this.$exposed_form = this.$view.children('.view-filters').children('form'); 858 this.$exposed_form.once(jQuery.proxy(this.attachExposedFormAjax, this)); 859 860 // Add the ajax to pagers. 861 this.$view 862 // Don't attach to nested views. Doing so would attach multiple behaviors 863 // to a given element. 864 .filter(jQuery.proxy(this.filterNestedViews, this)) 865 .once(jQuery.proxy(this.attachPagerAjax, this)); 866 867 // Add a trigger to update this view specifically. In order to trigger a 868 // refresh use the following code. 869 // 870 // @code 871 // jQuery('.view-name').trigger('RefreshView'); 872 // @endcode 873 // Add a trigger to update this view specifically. 874 var self_settings = this.element_settings; 875 self_settings.event = 'RefreshView'; 876 this.refreshViewAjax = new Drupal.ajax(this.selector, this.$view, self_settings); 877}; 878 879Drupal.views.ajaxView.prototype.attachExposedFormAjax = function() { 880 var button = $('input[type=submit], button[type=submit], input[type=image]', this.$exposed_form); 881 button = button[0]; 882 883 this.exposedFormAjax = new Drupal.ajax($(button).attr('id'), button, this.element_settings); 884}; 885 886Drupal.views.ajaxView.prototype.filterNestedViews= function() { 887 // If there is at least one parent with a view class, this view 888 // is nested (e.g., an attachment). Bail. 889 return !this.$view.parents('.view').size(); 890}; 891 892/** 893 * Attach the ajax behavior to each link. 894 */ 895Drupal.views.ajaxView.prototype.attachPagerAjax = function() { 896 this.$view.find('ul.pager > li > a, th.views-field a, .attachment .views-summary a') 897 .each(jQuery.proxy(this.attachPagerLinkAjax, this)); 898}; 899 900/** 901 * Attach the ajax behavior to a singe link. 902 */ 903Drupal.views.ajaxView.prototype.attachPagerLinkAjax = function(id, link) { 904 var $link = $(link); 905 var viewData = {}; 906 var href = $link.attr('href'); 907 // Construct an object using the settings defaults and then overriding 908 // with data specific to the link. 909 $.extend( 910 viewData, 911 this.settings, 912 Drupal.Views.parseQueryString(href), 913 // Extract argument data from the URL. 914 Drupal.Views.parseViewArgs(href, this.settings.view_base_path) 915 ); 916
917 // For anchor tags, these will go to the target of the anchor rather 918 // than the usual location. 919 $.extend(viewData, Drupal.Views.parseViewArgs(href, this.settings.view_base_path)); 920 921 this.element_settings.submit = viewData; 922 this.pagerAjax = new Drupal.ajax(false, $link, this.element_settings); 923}; 924 925Drupal.ajax.prototype.commands.viewsScrollTop = function (ajax, response, status) { 926 // Scroll to the top of the view. This will allow users 927 // to browse newly loaded content after e.g. clicking a pager 928 // link. 929 var offset = $(response.selector).offset(); 930 // We can't guarantee that the scrollable object should be 931 // the body, as the view could be embedded in something 932 // more complex such as a modal popup. Recurse up the DOM 933 // and scroll the first element that has a non-zero top. 934 var scrollTarget = response.selector; 935 while ($(scrollTarget).scrollTop() == 0 && $(scrollTarget).parent()) { 936 scrollTarget = $(scrollTarget).parent(); 937 } 938 // Only scroll upward 939 if (offset.top - 10 < $(scrollTarget).scrollTop()) { 940 $(scrollTarget).animate({scrollTop: (offset.top - 10)}, 500); 941 } 942}; 943 944})(jQuery); 945; 946/** 947 * @file 948 * Initiate the BxSlider plugin. 949 */ 950 951(function ($) { 952 Drupal.behaviors.viewsSlideshowBxslider = { 953 attach: function (context, settings) { 954 for (id in Drupal.settings.viewsSlideshowBxslider) { 955 var html_id = id.replace(/_/g, '-'); 956 $('#' + html_id + ':not(.viewsSlideshowBxslider-processed)', context).addClass('viewsSlideshowBxslider-processed').each(function () { 957 // Fire up the gallery. 958 var settingsBxSlider = $.extend( 959 {}, 960 Drupal.settings.viewsSlideshowBxslider[id]['general'], 961 Drupal.settings.viewsSlideshowBxslider[id]['controlsfieldset'], 962 Drupal.settings.viewsSlideshowBxslider[id]['pagerfieldset'], 963 Drupal.settings.viewsSlideshowBxslider[id]['autofieldset'], 964 Drupal.settings.viewsSlideshowBxslider[id]['carousel'] 965 ); 966 967 for (callback in Drupal.settings.viewsSlideshowBxslider[id]['callback']) { 968 Drupal.settings.viewsSlideshowBxslider[id]['callback'][callback] = eval('(' + Drupal.settings.viewsSlideshowBxslider[id]['callback'][callback] + ')'); 969 } 970 settingsBxSlider = $.extend({}, settingsBxSlider, Drupal.settings.viewsSlideshowBxslider[id]['callback']); 971 972 $(this).bxSlider(settingsBxSlider); 973 }); 974 } 975 } 976 }; 977}(jQuery)); 978; 979(function ($) { 980 981Drupal.googleanalytics = {}; 982 983$(document).ready(function() { 984 985 // Attach mousedown, keyup, touchstart events to document only and catch 986 // clicks on all elements. 987 $(document.body).bind("mousedown keyup touchstart", function(event) { 988 989 // Catch the closest surrounding link of a clicked element. 990 $(event.target).closest("a,area").each(function() { 991 992 // Is the clicked URL internal? 993 if (Drupal.googleanalytics.isInternal(this.href)) { 994 // Skip 'click' tracking, if custom tracking events are bound. 995 if ($(this).is('.colorbox')) { 996 // Do nothing here. The custom event will handle all tracking. 997 //console.info("Click on .colorbox item has been detected."); 998 } 999 // Is download tracking activated and the file extension configured for download tracking? 1000 else if (Drupal.settings.googleanalytics.trackDownload && Drupal.googleanalytics.isDownload(this.href)) { 1001 // Download link clicked. 1002 ga("send", "event", "Downloads", Drupal.googleanalytics.getDownloadExtension(this.href).toUpperCase(), Drupal.googleanalytics.getPageUrl(this.href)); 1003 } 1004 else if (Drupal.googleanalytics.isInternalSpecial(this.href)) { 1005 // Keep the internal URL for Google Analytics website overlay intact. 1006 ga("send", "pageview", { "page": Drupal.googleanalytics.getPageUrl(this.href) }); 1007 } 1008 } 1009 else { 1010 if (Drupal.settings.googleanalytics.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) { 1011 // Mailto link clicked. 1012 ga("send", "event", "Mails", "Click", this.href.substring(7)); 1013 } 1014 else if (Drupal.settings.googleanalytics.trackOutbound && this.href.match(/^\w+:\/\//i)) { 1015 if (Drupal.settings.googleanalytics.trackDomainMode != 2 || (Drupal.settings.googleanalytics.trackDomainMode == 2 && !Drupal.googleanalytics.isCrossDomain(this.hostname, Drupal.settings.googleanalytics.trackCrossDomains))) { 1016 // External link clicked / No top-level cross domain clicked. 1017 ga("send", "event", "Outbound links", "Click", this.href); 1018 } 1019 } 1020 } 1021 }); 1022 }); 1023 1024 // Track hash changes as unique pageviews, if this option has been enabled. 1025 if (Drupal.settings.googleanalytics.trackUrlFragments) { 1026 window.onhashchange = function() { 1027 ga('send', 'pageview', location.pathname + location.search + location.hash); 1028 } 1029 } 1030 1031 // Colorbox: This event triggers when the transition has completed and the 1032 // newly loaded content has been revealed. 1033 $(document).bind("cbox_complete", function () {
1034 var href = $.colorbox.element().attr("href"); 1035 if (href) { 1036 ga("send", "pageview", { "page": Drupal.googleanalytics.getPageUrl(href) }); 1037 } 1038 }); 1039 1040}); 1041 1042/** 1043 * Check whether the hostname is part of the cross domains or not. 1044 * 1045 * @param string hostname 1046 * The hostname of the clicked URL. 1047 * @param array crossDomains 1048 * All cross domain hostnames as JS array. 1049 * 1050 * @return boolean 1051 */ 1052Drupal.googleanalytics.isCrossDomain = function (hostname, crossDomains) { 1053 /** 1054 * jQuery < 1.6.3 bug: $.inArray crushes IE6 and Chrome if second argument is 1055 * `null` or `undefined`, http://bugs.jquery.com/ticket/10076, 1056 * https://github.com/jquery/jquery/commit/a839af034db2bd934e4d4fa6758a3fed8de74174 1057 * 1058 * @todo: Remove/Refactor in D8 1059 */ 1060 if (!crossDomains) { 1061 return false; 1062 } 1063 else { 1064 return $.inArray(hostname, crossDomains) > -1 ? true : false; 1065 } 1066}; 1067 1068/** 1069 * Check whether this is a download URL or not. 1070 * 1071 * @param string url 1072 * The web url to check. 1073 * 1074 * @return boolean 1075 */ 1076Drupal.googleanalytics.isDownload = function (url) { 1077 var isDownload = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i"); 1078 return isDownload.test(url); 1079}; 1080 1081/** 1082 * Check whether this is an absolute internal URL or not. 1083 * 1084 * @param string url 1085 * The web url to check. 1086 * 1087 * @return boolean 1088 */ 1089Drupal.googleanalytics.isInternal = function (url) { 1090 var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i"); 1091 return isInternal.test(url); 1092}; 1093 1094/** 1095 * Check whether this is a special URL or not. 1096 * 1097 * URL types: 1098 * - gotwo.module /go/* links. 1099 * 1100 * @param string url 1101 * The web url to check. 1102 * 1103 * @return boolean 1104 */ 1105Drupal.googleanalytics.isInternalSpecial = function (url) { 1106 var isInternalSpecial = new RegExp("(\/go\/.*)$", "i"); 1107 return isInternalSpecial.test(url); 1108}; 1109 1110/** 1111 * Extract the relative internal URL from an absolute internal URL. 1112 * 1113 * Examples: 1114 * - http://mydomain.com/node/1 -> /node/1 1115 * - http://example.com/foo/bar -> http://example.com/foo/bar 1116 * 1117 * @param string url 1118 * The web url to check. 1119 * 1120 * @return string 1121 * Internal website URL 1122 */ 1123Drupal.googleanalytics.getPageUrl = function (url) { 1124 var extractInternalUrl = new RegExp("^(https?):\/\/" + window.location.host, "i"); 1125 return url.replace(extractInternalUrl, ''); 1126}; 1127 1128/** 1129 * Extract the download file extension from the URL. 1130 * 1131 * @param string url 1132 * The web url to check. 1133 * 1134 * @return string 1135 * The file extension of the passed url. e.g. "zip", "txt" 1136 */ 1137Drupal.googleanalytics.getDownloadExtension = function (url) { 1138 var extractDownloadextension = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i"); 1139 var extension = extractDownloadextension.exec(url); 1140 return (extension === null) ? '' : extension[1]; 1141}; 1142 1143})(jQuery); 1144;
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.