1Drupal.locale = { 'pluralFormula': function ($n) { return Number(($n!=1)); }, 'strings': {"":{"An AJAX HTTP error occurred.":"Satu ralat AJAX HTTP telah berlaku.","HTTP Result Code: !status":"Kod Hasil HTTP: !status","An AJAX HTTP request terminated abnormally.":"Satu permintaan AJAX HTTP telah ditamatkan secara tidak normal.","Debugging information follows.":"Maklumat nyahpepijat adalah seperti berikut.","Path: !uri":"Laluan: !uri","StatusText: !statusText":"StatusText: !statusText","ResponseText: !responseText":"ResponseText: !responseText","ReadyState: !readyState":"ReadyState: !readyState","All":"Semua","Hide":"Selindungkan","Show":"Tampakkan","(active tab)":"(tab aktif)","Re-order rows by numerical weight instead of dragging.":"Susun semula semua baris mengikut pemberat angka bukannya dengan menyeret.","Show row weights":"Tunjukkan pemberat baris","Hide row weights":"Sembunyikan pemberat-pemberat baris","Drag to re-order":"Tarik untuk menyusun semula","Changes made in this table will not be saved until the form is submitted.":"Perubahan pada jadual ini tidak akan disimpan selagi borang tidak diserahkan.","Please wait...":"Sila tunggu...","Edit":"Sunting","Requires a title":"Memerlukan satu tajuk","Not published":"Tidak diterbitkan","Don\u0027t display post information":"Jangan pamerkan maklumat pos","Enabled":"Dibolehkan","Disabled":"Dinyahbolehkan","Search":"Carian","Shortcuts":"Pintasan-pintasan","OK":"OK","Hide summary":"Sembunyikan ringkasan","Edit summary":"Edit ringkasan","Done":"Selesai","Prev":"Sebelum","Next":"Seterusnya","Today":"Hari ini","January":"Januari","February":"Februari","March":"Mac","April":"April","May":"Mei","June":"Jun","July":"Julai","August":"Ogos","September":"September","October":"Oktober","November":"November","December":"Disember","Jan":"Jan","Feb":"Feb","Mar":"Mac","Apr":"Apr","Jun":"Jun","Jul":"Jul","Aug":"Ogo","Sep":"Sep","Oct":"Okt","Nov":"Nov","Dec":"Dis","Sunday":"Ahad","Monday":"Isnin","Tuesday":"Selasa","Wednesday":"Rabu","Thursday":"Khamis","Friday":"Jumaat","Saturday":"Sabtu","Sun":"Aha","Mon":"Isn","Tue":"Sel","Wed":"Rab","Thu":"Kha","Fri":"Jum","Sat":"Sab","Su":"Ah","Mo":"Is","Tu":"Se","We":"Ra","Th":"Kh","Fr":"Ju","Sa":"Sa","mm\/dd\/yy":"mm\/dd\/yy","Alias: @alias":"Alias: @alias","No alias":"Tiada alias","The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.":"Fail terpilih %filename tidak boleh dimuat naik. Hanya fail-fail dengan sambungan-sambungan berikut dibenarkan: %extensions.","Not in menu":"Tiada dalam menu","Autocomplete popup":"Popup autolengkap","Searching for matches...":"Membuat carian untuk padanan...","New revision":"Penyemakan semula yang baharu","No revision":"Tiada penyemakan semula","By @name on @date":"Oleh @name pada @date","By @name":"Oleh @name","none":"tiada","Add":"Tambah","Not restricted":"Tidak terbatas","Restricted to certain pages":"Terbatas pada halaman-halaman tertentu","Not customizable":"Tidak boleh diubah suai","The changes to these blocks will not be saved until the \u003Cem\u003ESave blocks\u003C\/em\u003E button is clicked.":"Perubahan kepada blok-blok ini tidak akan disimpan sehingga butang \u003Cem\u003ESimpan blok-blok\u003C\/em\u003E diklik.","The block cannot be placed in this region.":"Blok tersebut tidak boleh diletakkan dalam segmen kawasan ini.","Status":"Status","Size":"Saiz","Configure":"Konfigurasikan","This field is required.":"Medan ini diperlukan.","Filename":"Nama fail","Flag translations as outdated":"Tandakan terjemahan sebagai lapuk","This permission is inherited from the authenticated user role.":"Keizinan ini diwarisi daripada peranan pengguna yang telah disahkan.","Select all rows in this table":"Pilih semua barisan dalam jadual ini","Deselect all rows in this table":"Nyahpilih semua baris dalam jadual ini","N\/A":"Tidak berkenaan","@number comments per page":"@number komen per halaman"}} };;/**/ 2/*! 3 Colorbox v1.5.9 - 2014-04-25 4 jQuery lightbox and modal window plugin 5 (c) 2014 Jack Moore - http://www.jacklmoore.com/colorbox 6 license: http://www.opensource.org/licenses/mit-license.php 7*/
vendor: 9,185 bytes, line 8
8(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=(z+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){z=0,e&&e!==!1?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),z=W.index(_.el),-1===z&&(W=W.add(_.el),z=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("colorbox"),_=new r(i,o),g(_.get("rel")),!$){$=q=!0,c(_.get("className")),x.css({visibility:"hidden",display:"block",opacity:""}),L=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(L),D=T.height()+k.height()+b.outerHeight(!0)-b.height(),j=C.width()+H.width()+b.outerWidth(!0)-b.width(),A=L.outerHeight(!0),N=L.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=(l!==!1?Math.min(h,a(l,"x")):h)-N-j,_.h=(f!==!1?Math.min(s,a(f,"y")):s)-A-D,L.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(I).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()})}v.css({opacity:parseFloat(_.get("opacity"))||"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("<div/>"),w()}}function p(){!x&&e.body&&(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(),S=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),y=n(se,"Wrapper"),b=n(se,"Content").append(I=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"}),F=n("button","Slideshow"),S),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(F),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;$&&_.get("escKey")&&27===e&&(t.preventDefault(),J.close()),$&&_.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(q=!0,U=!1,u(he),u(ie),_.get("onLoad"),_.h=_.get("height")?a(_.get("height"),"y")-A-D:_.get("innerHeight")&&a(_.get("innerHeight"),"y"),_.w=_.get("width")?a(_.get("width"),"x")-N-j:_.get("innerWidth")&&a(_.get("innerWidth"),"x"),_.mw=_.w,_.mh=_.h,_.get("maxWidth")&&(_.mw=a(_.get("maxWidth"),"x")-N-j,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.get("maxHeight")&&(_.mh=a(_.get("maxHeight"),"y")-A-D,_.mh=_.h&&_.h<_.mh?_.h:_.mh),e=_.get("href"),Q=setTimeout(function(){S.show()},100),_.get("inline")){var c=t(e);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),U=new Image,t(U).addClass(Z+"Photo").bind("error",function(){h(n(se,"Error").html(_.get("imgError")))}).one("load",function(){d===le&&setTimeout(function(){var e;t.each(["alt","longdesc","aria-describedby"],function(e,i){var n=t(_.el).attr(i)||t(_.el).attr("data-"+i);n&&U.setAttribute(i,n)}),_.get("retinaImage")&&i.devicePixelRatio>1&&(U.height=U.height/i.devicePixelRatio,U.width=U.width/i.devicePixelRatio),_.get("scalePhotos")&&(o=function(){U.height-=U.height*e,U.width-=U.width*e},_.mw&&U.width>_.mw&&(e=(U.width-_.mw)/U.width,o()),_.mh&&U.height>_.mh&&(e=(U.height-_.mh)/U.height,o())),_.h&&(U.style.marginTop=Math.max(_.mh-U.height,0)/2+"px"),W[1]&&(_.get("loop")||W[z+1])&&(U.style.cursor="pointer",U.onclick=function(){J.next()}),U.style.width=U.width+"px",U.style.height=U.height+"px",h(U)},1)}),U.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,L,M,S,I,R,F,K,P,B,O,_,D,j,A,N,z,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,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}},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[z+1])&&(t(),h=setTimeout(J.next,_.get("slideshowSpeed")))}function i(){F.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),F.html(_.get("slideshowStart")).unbind(s).one(s,function(){J.next(),i()}),x.removeClass(a+"on").addClass(a+"off")}function o(){r=!1,F.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(),F.show())}}();t.colorbox||(t(p),J=t.fn[Y]=t[Y]=function(e,i){var n,o=this;if(e=e||{},t.isFunction(o))o=t("<a/>"),e.open=!0;else if(!o[0])return o;return 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)-j+"px",b[0].style.height=C[0].style.height=H[0].style.height=parseInt(x[0].style.height,10)-D+"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-N-j-a(_.get("right"),"x"),0):_.get("left")!==!1?a(_.get("left"),"x"):Math.round(Math.max(E.width()-_.w-N-j,0)/2),l+=_.get("bottom")!==!1?Math.max(o()-_.h-A-D-a(_.get("bottom"),"y"),0):_.get("top")!==!1?a(_.get("top"),"y"):Math.round(Math.max(o()-_.h-A-D,0)/2),x.css({top:c.top,left:c.left,visibility:"visible"}),y[0].style.width=y[0].style.height="9999px",r={width:_.w+N+j,height:_.h+A+D,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(),q=!1,y[0].style.width=_.w+N+j+"px",y[0].style.height=_.h+A+D+"px",_.get("reposition")&&setTimeout(function(){E.bind("resize."+Z,J.position)},1),i&&i()},step:n})},J.resize=function(t){var e;$&&(t=t||{},t.width&&(_.w=a(t.width,"x")-N-j),t.innerWidth&&(_.w=a(t.innerWidth,"x")),L.css({width:_.w}),t.height&&(_.h=a(t.height,"y")-A-D),t.innerHeight&&(_.h=a(t.innerHe
8ight,"y")),t.innerHeight||t.height||(e=L.scrollTop(),L.css({height:"auto"}),_.h=L.height()),L.css({height:_.h}),e&&L.scrollTop(e),J.position("none"===_.get("transition")?0:_.get("speed")))},J.prep=function(i){function o(){return _.w=_.w||L.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function a(){return _.h=_.h||L.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if($){var d,g="none"===_.get("transition")?0:_.get("speed");L.remove(),L=n(se,"LoadedContent").append(i),L.hide().appendTo(M.show()).css({width:o(),overflow:_.get("scrolling")?"auto":"hidden"}).css({height:a()}).prependTo(b),M.hide(),t(U).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;$&&(o=function(){clearTimeout(Q),S.hide(),u(ne),_.get("onComplete")},I.html(_.get("title")).show(),L.show(),a>1?("string"==typeof _.get("current")&&R.html(_.get("current").replace("{current}",z+1).replace("{total}",a)).show(),K[_.get("loop")||a-1>z?"show":"hide"]().html(_.get("next")),P[_.get("loop")||z?"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=e.createElement("iframe"),"frameBorder"in n&&(n.frameBorder=0),"allowTransparency"in n&&(n.allowTransparency="true"),_.get("scrolling")||(n.scrolling="no"),t(n).attr({src:_.get("href"),name:(new Date).getTime(),"class":Z+"Iframe",allowFullScreen:!0}).one("load",o).appendTo(L),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(){!q&&W[1]&&(_.get("loop")||W[z+1])&&(z=h(1),f(W[z]))},J.prev=function(){!q&&W[1]&&(_.get("loop")||z)&&(z=h(-1),f(W[z]))},J.close=function(){$&&!G&&(G=!0,$=!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),L.remove(),setTimeout(function(){G=!1,u(re),_.get("onClosed")},1)}))},J.remove=function(){x&&(x.stop(),t.colorbox.close(),x.stop().remove(),v.remove(),G=!1,x=null,t("."+te).removeData(Y).removeClass(te),t(e).unbind("click."+Z))},J.element=function(){return t(_.el)},J.settings=X)})(jQuery,document,window);;/**/ 9(function ($) { 10 11Drupal.behaviors.initColorbox = { 12 attach: function (context, settings) { 13 if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') { 14 return; 15 } 16 17 if (settings.colorbox.mobiledetect && window.matchMedia) { 18 // Disable Colorbox for small screens. 19 var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")"); 20 if (mq.matches) { 21 return; 22 } 23 } 24 25 $('.colorbox', context) 26 .once('init-colorbox') 27 .colorbox(settings.colorbox); 28 29 $(context).bind('cbox_complete', function () { 30 Drupal.attachBehaviors('#cboxLoadedContent'); 31 }); 32 } 33}; 34 35})(jQuery); 36;/**/ 37(function ($) { 38 39Drupal.behaviors.initColorboxLoad = { 40 attach: function (context, settings) { 41 if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') { 42 return; 43 } 44 $.urlParams = function (url) { 45 var p = {}, 46 e, 47 a = /\+/g, // Regex for replacing addition symbol with a space 48 r = /([^&=]+)=?([^&]*)/g, 49 d = function (s) { return decodeURIComponent(s.replace(a, ' ')); }, 50 q = url.split('?'); 51 while (e = r.exec(q[1])) { 52 e[1] = d(e[1]); 53 e[2] = d(e[2]); 54 switch (e[2].toLowerCase()) { 55 case 'true': 56 case 'yes': 57 e[2] = true; 58 break; 59 case 'false': 60 case 'no': 61 e[2] = false; 62 break; 63 } 64 if (e[1] == 'width') { e[1] = 'innerWidth'; } 65 if (e[1] == 'height') { e[1] = 'innerHeight'; } 66 p[e[1]] = e[2]; 67 } 68 return p; 69 }; 70 $('.colorbox-load', context) 71 .once('init-colorbox-load', function () {
72 var params = $.urlParams($(this).attr('href')); 73 $(this).colorbox($.extend({}, settings.colorbox, params)); 74 }); 75 } 76}; 77 78})(jQuery); 79;/**/ 80(function ($) { 81 82Drupal.behaviors.initColorboxInline = { 83 attach: function (context, settings) { 84 if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') { 85 return; 86 } 87 $.urlParam = function(name, url){ 88 if (name == 'fragment') { 89 var results = new RegExp('(#[^&#]*)').exec(url); 90 } 91 else { 92 var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(url); 93 } 94 if (!results) { return ''; } 95 return results[1] || ''; 96 }; 97 $('.colorbox-inline', context).once('init-colorbox-inline').colorbox({ 98 transition:settings.colorbox.transition, 99 speed:settings.colorbox.speed, 100 opacity:settings.colorbox.opacity, 101 slideshow:settings.colorbox.slideshow, 102 slideshowAuto:settings.colorbox.slideshowAuto, 103 slideshowSpeed:settings.colorbox.slideshowSpeed, 104 slideshowStart:settings.colorbox.slideshowStart, 105 slideshowStop:settings.colorbox.slideshowStop, 106 current:settings.colorbox.current, 107 previous:settings.colorbox.previous, 108 next:settings.colorbox.next, 109 close:settings.colorbox.close, 110 overlayClose:settings.colorbox.overlayClose, 111 maxWidth:settings.colorbox.maxWidth, 112 maxHeight:settings.colorbox.maxHeight, 113 innerWidth:function(){ 114 return $.urlParam('width', $(this).attr('href')); 115 }, 116 innerHeight:function(){ 117 return $.urlParam('height', $(this).attr('href')); 118 }, 119 title:function(){ 120 return decodeURIComponent($.urlParam('title', $(this).attr('href'))); 121 }, 122 iframe:function(){ 123 return $.urlParam('iframe', $(this).attr('href')); 124 }, 125 inline:function(){ 126 return $.urlParam('inline', $(this).attr('href')); 127 }, 128 href:function(){ 129 return $.urlParam('fragment', $(this).attr('href')); 130 } 131 }); 132 } 133}; 134 135})(jQuery); 136;/**/ 137/* $Id: lightbox.js,v 1.5.2.6.2.136 2010/09/24 08:39:40 snpower Exp $ */ 138 139/** 140 * jQuery Lightbox 141 * @author 142 * Stella Power, <http://drupal.org/user/66894> 143 * 144 * Based on Lightbox v2.03.3 by Lokesh Dhakar 145 * <http://www.huddletogether.com/projects/lightbox2/> 146 * Also partially based on the jQuery Lightbox by Warren Krewenki 147 * <http://warren.mesozen.com> 148 * 149 * Permission has been granted to Mark Ashmead & other Drupal Lightbox2 module 150 * maintainers to distribute this file via Drupal.org 151 * Under GPL license. 152 * 153 * Slideshow, iframe and video functionality added by Stella Power. 154 */ 155 156var Lightbox; 157(function($) { 158Lightbox = { 159 auto_modal : false, 160 overlayOpacity : 0.8, // Controls transparency of shadow overlay. 161 overlayColor : '000', // Controls colour of shadow overlay. 162 disableCloseClick : true, 163 // Controls the order of the lightbox resizing animation sequence. 164 resizeSequence: 0, // 0: simultaneous, 1: width then height, 2: height then width. 165 resizeSpeed: 'normal', // Controls the speed of the lightbox resizing animation. 166 fadeInSpeed: 'normal', // Controls the speed of the image appearance. 167 slideDownSpeed: 'slow', // Controls the speed of the image details appearance. 168 minWidth: 240, 169 borderSize : 10, 170 boxColor : 'fff', 171 fontColor : '000', 172 topPosition : '', 173 infoHeight: 20, 174 alternative_layout : false, 175 imageArray : [], 176 imageNum : null, 177 total : 0, 178 activeImage : null, 179 inprogress : false, 180 disableResize : false, 181 disableZoom : false, 182 isZoomedIn : false, 183 rtl : false, 184 loopItems : false, 185 keysClose : ['c', 'x', 27], 186 keysPrevious : ['p', 37], 187 keysNext : ['n', 39], 188 keysZoom : ['z'], 189 keysPlayPause : [32], 190 191 // Slideshow options. 192 slideInterval : 5000, // In milliseconds. 193 showPlayPause : true, 194 autoStart : true, 195 autoExit : true, 196 pauseOnNextClick : false, // True to pause the slideshow when the "Next" button is clicked. 197 pauseOnPrevClick : true, // True to pause the slideshow when the "Prev" button is clicked. 198 slideIdArray : [], 199 slideIdCount : 0, 200 isSlideshow : false, 201 isPaused : false, 202 loopSlides : false, 203 204 // Iframe options. 205 isLightframe : false, 206 iframe_width : 600, 207 iframe_height : 400, 208 iframe_border : 1, 209 210 // Video and modal options. 211 enableVideo : false, 212 flvPlayer : '/flvplayer.swf', 213 flvFlashvars : '', 214 isModal : false, 215 isVideo : false, 216 videoId : false, 217 modalWidth : 400,
218 modalHeight : 400, 219 modalHTML : null, 220 221 222 // initialize() 223 // Constructor runs on completion of the DOM loading. 224 // The function inserts html at the bottom of the page which is used 225 // to display the shadow overlay and the image container. 226 initialize: function() { 227 228 var s = Drupal.settings.lightbox2; 229 Lightbox.overlayOpacity = s.overlay_opacity; 230 Lightbox.overlayColor = s.overlay_color; 231 Lightbox.disableCloseClick = s.disable_close_click; 232 Lightbox.resizeSequence = s.resize_sequence; 233 Lightbox.resizeSpeed = s.resize_speed; 234 Lightbox.fadeInSpeed = s.fade_in_speed; 235 Lightbox.slideDownSpeed = s.slide_down_speed; 236 Lightbox.borderSize = s.border_size; 237 Lightbox.boxColor = s.box_color; 238 Lightbox.fontColor = s.font_color; 239 Lightbox.topPosition = s.top_position; 240 Lightbox.rtl = s.rtl; 241 Lightbox.loopItems = s.loop_items; 242 Lightbox.keysClose = s.keys_close.split(" "); 243 Lightbox.keysPrevious = s.keys_previous.split(" "); 244 Lightbox.keysNext = s.keys_next.split(" "); 245 Lightbox.keysZoom = s.keys_zoom.split(" "); 246 Lightbox.keysPlayPause = s.keys_play_pause.split(" "); 247 Lightbox.disableResize = s.disable_resize; 248 Lightbox.disableZoom = s.disable_zoom; 249 Lightbox.slideInterval = s.slideshow_interval; 250 Lightbox.showPlayPause = s.show_play_pause; 251 Lightbox.showCaption = s.show_caption; 252 Lightbox.autoStart = s.slideshow_automatic_start; 253 Lightbox.autoExit = s.slideshow_automatic_exit; 254 Lightbox.pauseOnNextClick = s.pause_on_next_click; 255 Lightbox.pauseOnPrevClick = s.pause_on_previous_click; 256 Lightbox.loopSlides = s.loop_slides; 257 Lightbox.alternative_layout = s.use_alt_layout; 258 Lightbox.iframe_width = s.iframe_width; 259 Lightbox.iframe_height = s.iframe_height; 260 Lightbox.iframe_border = s.iframe_border; 261 Lightbox.enableVideo = s.enable_video; 262 if (s.enable_video) { 263 Lightbox.flvPlayer = s.flvPlayer; 264 Lightbox.flvFlashvars = s.flvFlashvars; 265 } 266 267 // Make the lightbox divs. 268 var layout_class = (s.use_alt_layout ? 'lightbox2-alt-layout' : 'lightbox2-orig-layout'); 269 var output = '<div id="lightbox2-overlay" style="display: none;"></div>\ 270 <div id="lightbox" style="display: none;" class="' + layout_class + '">\ 271 <div id="outerImageContainer"></div>\ 272 <div id="imageDataContainer" class="clearfix">\ 273 <div id="imageData"></div>\ 274 </div>\ 275 </div>'; 276 var loading = '<div id="loading"><a href="#" id="loadingLink"></a></div>'; 277 var modal = '<div id="modalContainer" style="display: none;"></div>'; 278 var frame = '<div id="frameContainer" style="display: none;"></div>'; 279 var imageContainer = '<div id="imageContainer" style="display: none;"></div>'; 280 var details = '<div id="imageDetails"></div>'; 281 var bottomNav = '<div id="bottomNav"></div>'; 282 var image = '<img id="lightboxImage" alt="" />'; 283 var hoverNav = '<div id="hoverNav"><a id="prevLink" href="#"></a><a id="nextLink" href="#"></a></div>'; 284 var frameNav = '<div id="frameHoverNav"><a id="framePrevLink" href="#"></a><a id="frameNextLink" href="#"></a></div>'; 285 var hoverNav = '<div id="hoverNav"><a id="prevLink" title="' + Drupal.t('Previous') + '" href="#"></a><a id="nextLink" title="' + Drupal.t('Next') + '" href="#"></a></div>'; 286 var frameNav = '<div id="frameHoverNav"><a id="framePrevLink" title="' + Drupal.t('Previous') + '" href="#"></a><a id="frameNextLink" title="' + Drupal.t('Next') + '" href="#"></a></div>'; 287 var caption = '<span id="caption"></span>'; 288 var numberDisplay = '<span id="numberDisplay"></span>'; 289 var close = '<a id="bottomNavClose" title="' + Drupal.t('Close') + '" href="#"></a>'; 290 var zoom = '<a id="bottomNavZoom" href="#"></a>'; 291 var zoomOut = '<a id="bottomNavZoomOut" href="#"></a>'; 292 var pause = '<a id="lightshowPause" title="' + Drupal.t('Pause Slideshow') + '" href="#" style="display: none;"></a>'; 293 var play = '<a id="lightshowPlay" title="' + Drupal.t('Play Slideshow') + '" href="#" style="display: none;"></a>'; 294 295 $("body").append(output); 296 $('#outerImageContainer').append(modal + frame + imageContainer + loading); 297 if (!s.use_alt_layout) { 298 $('#imageContainer').append(image + hoverNav);
299 $('#imageData').append(details + bottomNav); 300 $('#imageDetails').append(caption + numberDisplay); 301 $('#bottomNav').append(frameNav + close + zoom + zoomOut + pause + play); 302 } 303 else { 304 $('#outerImageContainer').append(bottomNav); 305 $('#imageContainer').append(image); 306 $('#bottomNav').append(close + zoom + zoomOut); 307 $('#imageData').append(hoverNav + details); 308 $('#imageDetails').append(caption + numberDisplay + pause + play); 309 } 310 311 // Setup onclick handlers. 312 if (Lightbox.disableCloseClick) { 313 $('#lightbox2-overlay').click(function() { Lightbox.end(); return false; } ).hide(); 314 } 315 $('#loadingLink, #bottomNavClose').click(function() { Lightbox.end('forceClose'); return false; } ); 316 $('#prevLink, #framePrevLink').click(function() { Lightbox.changeData(Lightbox.activeImage - 1); return false; } ); 317 $('#nextLink, #frameNextLink').click(function() { Lightbox.changeData(Lightbox.activeImage + 1); return false; } ); 318 $('#bottomNavZoom').click(function() { Lightbox.changeData(Lightbox.activeImage, true); return false; } ); 319 $('#bottomNavZoomOut').click(function() { Lightbox.changeData(Lightbox.activeImage, false); return false; } ); 320 $('#lightshowPause').click(function() { Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); return false; } ); 321 $('#lightshowPlay').click(function() { Lightbox.togglePlayPause("lightshowPlay", "lightshowPause"); return false; } ); 322 323 // Fix positioning. 324 $('#prevLink, #nextLink, #framePrevLink, #frameNextLink').css({ 'paddingTop': Lightbox.borderSize + 'px'}); 325 $('#imageContainer, #frameContainer, #modalContainer').css({ 'padding': Lightbox.borderSize + 'px'}); 326 $('#outerImageContainer, #imageDataContainer, #bottomNavClose').css({'backgroundColor': '#' + Lightbox.boxColor, 'color': '#'+Lightbox.fontColor}); 327 if (Lightbox.alternative_layout) { 328 $('#bottomNavZoom, #bottomNavZoomOut').css({'bottom': Lightbox.borderSize + 'px', 'right': Lightbox.borderSize + 'px'}); 329 } 330 else if (Lightbox.rtl == 1 && Drupal.settings.lightbox2.useragent.search('MSIE') !== -1) { 331 $('#bottomNavZoom, #bottomNavZoomOut').css({'left': '0px'}); 332 } 333 334 // Force navigation links to always be displayed 335 if (s.force_show_nav) { 336 $('#prevLink, #nextLink').addClass("force_show_nav"); 337 } 338 339 }, 340 341 // initList() 342 // Loops through anchor tags looking for 'lightbox', 'lightshow' and 343 // 'lightframe', etc, references and applies onclick events to appropriate 344 // links. You can rerun after dynamically adding images w/ajax. 345 initList : function(context) { 346 347 if (context == undefined || context == null) { 348 context = document; 349 } 350 351 // Attach lightbox to any links with rel 'lightbox', 'lightshow' or 352 // 'lightframe', etc. 353 $("a[rel^='lightbox']:not(.lightbox-processed), area[rel^='lightbox']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 354 if (Lightbox.disableCloseClick) { 355 $('#lightbox').unbind('click'); 356 $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); 357 } 358 Lightbox.start(this, false, false, false, false); 359 if (e.preventDefault) { e.preventDefault(); } 360 return false; 361 }); 362 $("a[rel^='lightshow']:not(.lightbox-processed), area[rel^='lightshow']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 363 if (Lightbox.disableCloseClick) { 364 $('#lightbox').unbind('click'); 365 $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); 366 } 367 Lightbox.start(this, true, false, false, false); 368 if (e.preventDefault) { e.preventDefault(); } 369 return false; 370 }); 371 $("a[rel^='lightframe']:not(.lightbox-processed), area[rel^='lightframe']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 372 if (Lightbox.disableCloseClick) { 373 $('#lightbox').unbind('click'); 374 $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); 375 } 376 Lightbox.start(this, false, true, false, false); 377 if (e.preventDefault) { e.preventDefault(); } 378 return false;
379 }); 380 if (Lightbox.enableVideo) { 381 $("a[rel^='lightvideo']:not(.lightbox-processed), area[rel^='lightvideo']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 382 if (Lightbox.disableCloseClick) { 383 $('#lightbox').unbind('click'); 384 $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); 385 } 386 Lightbox.start(this, false, false, true, false); 387 if (e.preventDefault) { e.preventDefault(); } 388 return false; 389 }); 390 } 391 $("a[rel^='lightmodal']:not(.lightbox-processed), area[rel^='lightmodal']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 392 $('#lightbox').unbind('click'); 393 // Add classes from the link to the lightbox div - don't include lightbox-processed 394 $('#lightbox').addClass($(this).attr('class')); 395 $('#lightbox').removeClass('lightbox-processed'); 396 Lightbox.start(this, false, false, false, true); 397 if (e.preventDefault) { e.preventDefault(); } 398 return false; 399 }); 400 $("#lightboxAutoModal:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 401 Lightbox.auto_modal = true; 402 $('#lightbox').unbind('click'); 403 Lightbox.start(this, false, false, false, true); 404 if (e.preventDefault) { e.preventDefault(); } 405 return false; 406 }); 407 }, 408 409 // start() 410 // Display overlay and lightbox. If image is part of a set, add siblings to 411 // imageArray. 412 start: function(imageLink, slideshow, lightframe, lightvideo, lightmodal) { 413 414 Lightbox.isPaused = !Lightbox.autoStart; 415 416 // Replaces hideSelectBoxes() and hideFlash() calls in original lightbox2. 417 Lightbox.toggleSelectsFlash('hide'); 418 419 // Stretch overlay to fill page and fade in. 420 var arrayPageSize = Lightbox.getPageSize(); 421 $("#lightbox2-overlay").hide().css({ 422 'width': '100%', 423 'zIndex': '10090', 424 'height': arrayPageSize[1] + 'px', 425 'backgroundColor' : '#' + Lightbox.overlayColor 426 }); 427 // Detect OS X FF2 opacity + flash issue. 428 if (lightvideo && this.detectMacFF2()) { 429 $("#lightbox2-overlay").removeClass("overlay_default"); 430 $("#lightbox2-overlay").addClass("overlay_macff2"); 431 $("#lightbox2-overlay").css({'opacity' : null}); 432 } 433 else { 434 $("#lightbox2-overlay").removeClass("overlay_macff2"); 435 $("#lightbox2-overlay").addClass("overlay_default"); 436 $("#lightbox2-overlay").css({'opacity' : Lightbox.overlayOpacity}); 437 } 438 $("#lightbox2-overlay").fadeIn(Lightbox.fadeInSpeed); 439 440 441 Lightbox.isSlideshow = slideshow; 442 Lightbox.isLightframe = lightframe; 443 Lightbox.isVideo = lightvideo; 444 Lightbox.isModal = lightmodal; 445 Lightbox.imageArray = []; 446 Lightbox.imageNum = 0; 447 448 var anchors = $(imageLink.tagName); 449 var anchor = null; 450 var rel_parts = Lightbox.parseRel(imageLink); 451 var rel = rel_parts["rel"]; 452 var rel_group = rel_parts["group"]; 453 var title = (rel_parts["title"] ? rel_parts["title"] : imageLink.title); 454 var rel_style = null; 455 var i = 0; 456 457 if (rel_parts["flashvars"]) { 458 Lightbox.flvFlashvars = Lightbox.flvFlashvars + '&' + rel_parts["flashvars"]; 459 } 460 461 // Set the title for image alternative text. 462 var alt = imageLink.title; 463 if (!alt) { 464 var img = $(imageLink).find("img"); 465 if (img && $(img).attr("alt")) { 466 alt = $(img).attr("alt"); 467 } 468 else { 469 alt = title; 470 } 471 } 472 473 if ($(imageLink).attr('id') == 'lightboxAutoModal') { 474 rel_style = rel_parts["style"]; 475 Lightbox.imageArray.push(['#lightboxAutoModal > *', title, alt, rel_style, 1]); 476 } 477 else { 478 // Handle lightbox images with no grouping. 479 if ((rel == 'lightbox' || rel == 'lightshow') && !rel_group) { 480 Lightbox.imageArray.push([imageLink.href, title, alt]); 481 } 482 483 // Handle other items with no grouping. 484 else if (!rel_group) { 485 rel_style = rel_parts["style"]; 486 Lightbox.imageArray.push([imageLink.href, title, alt, rel_style]); 487 } 488 489 // Handle grouped items. 490 else { 491 492 // Loop through anchors and add them to imageArray. 493 for (i = 0; i < anchors.length; i++) { 494 anchor = anchors[i]; 495 if (anchor.href && typeof(anchor.href) == "string" && $(anchor).attr('rel')) { 496 var rel_data = Lightbox.parseRel(anchor); 497 var anchor_title = (rel_data["title"] ? rel_data["title"] : anchor.title); 498 img_alt = anchor.title; 499 if (!img_alt) { 500 var anchor_img = $(anchor).find("img"); 501 if (anchor_img && $(anchor_img).attr("alt")) { 502 img_alt = $(anchor_img).attr("alt"); 503 } 504 else { 505 img_alt = title; 506 } 507 } 508 if (rel_data["rel"] == rel) { 509 if (rel_data["group"] == rel_group) { 510 if (Lightbox.isLightframe || Lightbox.isModal || Lightbox.isVideo) { 511 rel_style = rel_data["style"]; 512 } 513 Lightbox.imageArray.push([anchor.href, anchor_title, img_alt, rel_style]); 514 } 515 } 516 } 517 } 518 519 // Remove duplicates. 520 for (i = 0; i < Lightbox.imageArray.length; i++) { 521 for (j = Lightbox.imageArray.length-1; j > i; j--) { 522 if (Lightbox.imageArray[i][0] == Lightbox.imageArray[j][0]) { 523 Lightbox.imageArray.splice(j,1); 524 } 525 } 526 } 527 while (Lightbox.imageArray[Lightbox.imageNum][0] != imageLink.href) { 528 Lightbox.imageNum++; 529 } 530 } 531 } 532 533 if (Lightbox.isSlideshow && Lightbox.showPlayPause && Lightbox.isPaused) { 534 $('#lightshowPlay').show(); 535 $('#lightshowPause').hide(); 536 } 537 538 // Calculate top and left offset for the lightbox. 539 var arrayPageScroll = Lightbox.getPageScroll(); 540 var lightboxTop = arrayPageScroll[1] + (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1; 541 var lightboxLeft = arrayPageScroll[0]; 542 $('#frameContainer, #modalContainer, #lightboxImage').hide();
543 $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide(); 544 $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide(); 545 $('#outerImageContainer').css({'width': '250px', 'height': '250px'}); 546 $('#lightbox').css({ 547 'zIndex': '10500', 548 'top': lightboxTop + 'px', 549 'left': lightboxLeft + 'px' 550 }).show(); 551 552 Lightbox.total = Lightbox.imageArray.length; 553 Lightbox.changeData(Lightbox.imageNum); 554 }, 555 556 // changeData() 557 // Hide most elements and preload image in preparation for resizing image 558 // container. 559 changeData: function(imageNum, zoomIn) { 560 561 if (Lightbox.inprogress === false) { 562 if (Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) { 563 if (imageNum >= Lightbox.total) imageNum = 0; 564 if (imageNum < 0) imageNum = Lightbox.total - 1; 565 } 566 567 if (Lightbox.isSlideshow) { 568 for (var i = 0; i < Lightbox.slideIdCount; i++) { 569 window.clearTimeout(Lightbox.slideIdArray[i]); 570 } 571 } 572 Lightbox.inprogress = true; 573 Lightbox.activeImage = imageNum; 574 575 if (Lightbox.disableResize && !Lightbox.isSlideshow) { 576 zoomIn = true; 577 } 578 Lightbox.isZoomedIn = zoomIn; 579 580 581 // Hide elements during transition. 582 $('#loading').css({'zIndex': '10500'}).show(); 583 if (!Lightbox.alternative_layout) { 584 $('#imageContainer').hide(); 585 } 586 $('#frameContainer, #modalContainer, #lightboxImage').hide(); 587 $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide(); 588 $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide(); 589 590 // Preload image content, but not iframe pages. 591 if (!Lightbox.isLightframe && !Lightbox.isVideo && !Lightbox.isModal) { 592 $("#lightbox #imageDataContainer").removeClass('lightbox2-alt-layout-data'); 593 imgPreloader = new Image(); 594 imgPreloader.onerror = function() { Lightbox.imgNodeLoadingError(this); }; 595 596 imgPreloader.onload = function() { 597 var photo = document.getElementById('lightboxImage'); 598 photo.src = Lightbox.imageArray[Lightbox.activeImage][0]; 599 photo.alt = Lightbox.imageArray[Lightbox.activeImage][2]; 600 601 var imageWidth = imgPreloader.width; 602 var imageHeight = imgPreloader.height; 603 604 // Resize code. 605 var arrayPageSize = Lightbox.getPageSize(); 606 var targ = { w:arrayPageSize[2] - (Lightbox.borderSize * 2), h:arrayPageSize[3] - (Lightbox.borderSize * 6) - (Lightbox.infoHeight * 4) - (arrayPageSize[3] / 10) }; 607 var orig = { w:imgPreloader.width, h:imgPreloader.height }; 608 609 // Image is very large, so show a smaller version of the larger image 610 // with zoom button. 611 if (zoomIn !== true) { 612 var ratio = 1.0; // Shrink image with the same aspect. 613 $('#bottomNavZoomOut, #bottomNavZoom').hide(); 614 if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) { 615 ratio = ((targ.w / orig.w) < (targ.h / orig.h)) ? targ.w / orig.w : targ.h / orig.h; 616 if (!Lightbox.disableZoom && !Lightbox.isSlideshow) { 617 $('#bottomNavZoom').css({'zIndex': '10500'}).show(); 618 } 619 } 620 621 imageWidth = Math.floor(orig.w * ratio); 622 imageHeight = Math.floor(orig.h * ratio); 623 } 624 625 else { 626 $('#bottomNavZoom').hide();
627 // Only display zoom out button if the image is zoomed in already. 628 if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) { 629 // Only display zoom out button if not a slideshow and if the 630 // buttons aren't disabled. 631 if (!Lightbox.disableResize && Lightbox.isSlideshow === false && !Lightbox.disableZoom) { 632 $('#bottomNavZoomOut').css({'zIndex': '10500'}).show(); 633 } 634 } 635 } 636 637 photo.style.width = (imageWidth) + 'px'; 638 photo.style.height = (imageHeight) + 'px'; 639 Lightbox.resizeContainer(imageWidth, imageHeight); 640 641 // Clear onLoad, IE behaves irratically with animated gifs otherwise. 642 imgPreloader.onload = function() {}; 643 }; 644 645 imgPreloader.src = Lightbox.imageArray[Lightbox.activeImage][0]; 646 imgPreloader.alt = Lightbox.imageArray[Lightbox.activeImage][2]; 647 } 648 649 // Set up frame size, etc. 650 else if (Lightbox.isLightframe) { 651 $("#lightbox #imageDataContainer").addClass('lightbox2-alt-layout-data'); 652 var src = Lightbox.imageArray[Lightbox.activeImage][0]; 653 $('#frameContainer').html('<iframe id="lightboxFrame" style="display: none;" src="'+src+'"></iframe>'); 654 655 // Enable swf support in Gecko browsers. 656 if (Drupal.settings.lightbox2.useragent.search('Mozilla') !== -1 && src.indexOf('.swf') != -1) { 657 setTimeout(function () { 658 document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0]; 659 }, 1000); 660 } 661 662 if (!Lightbox.iframe_border) { 663 $('#lightboxFrame').css({'border': 'none'}); 664 $('#lightboxFrame').attr('frameborder', '0'); 665 } 666 var iframe = document.getElementById('lightboxFrame'); 667 var iframeStyles = Lightbox.imageArray[Lightbox.activeImage][3]; 668 iframe = Lightbox.setStyles(iframe, iframeStyles); 669 Lightbox.resizeContainer(parseInt(iframe.width, 10), parseInt(iframe.height, 10)); 670 } 671 else if (Lightbox.isVideo || Lightbox.isModal) { 672 $("#lightbox #imageDataContainer").addClass('lightbox2-alt-layout-data'); 673 var container = document.getElementById('modalContainer'); 674 var modalStyles = Lightbox.imageArray[Lightbox.activeImage][3]; 675 container = Lightbox.setStyles(container, modalStyles); 676 if (Lightbox.isVideo) { 677 Lightbox.modalHeight = parseInt(container.height, 10) - 10; 678 Lightbox.modalWidth = parseInt(container.width, 10) - 10; 679 Lightvideo.startVideo(Lightbox.imageArray[Lightbox.activeImage][0]); 680 } 681 Lightbox.resizeContainer(parseInt(container.width, 10), parseInt(container.height, 10)); 682 } 683 } 684 }, 685 686 // imgNodeLoadingError() 687 imgNodeLoadingError: function(image) { 688 var s = Drupal.settings.lightbox2; 689 var original_image = Lightbox.imageArray[Lightbox.activeImage][0]; 690 if (s.display_image_size !== "") { 691 original_image = original_image.replace(new RegExp("."+s.display_image_size), ""); 692 } 693 Lightbox.imageArray[Lightbox.activeImage][0] = original_image; 694 image.onerror = function() { Lightbox.imgLoadingError(image); }; 695 image.src = original_image; 696 }, 697 698 // imgLoadingError() 699 imgLoadingError: function(image) { 700 var s = Drupal.settings.lightbox2; 701 Lightbox.imageArray[Lightbox.activeImage][0] = s.default_image; 702 image.src = s.default_image; 703 }, 704 705 // resizeContainer() 706 resizeContainer: function(imgWidth, imgHeight) { 707 708 imgWidth = (imgWidth < Lightbox.minWidth ? Lightbox.minWidth : imgWidth); 709 710 this.widthCurrent = $('#outerImageContainer').width(); 711 this.heightCurrent = $('#outerImageContainer').height(); 712 713 var widthNew = (imgWidth + (Lightbox.borderSize * 2)); 714 var heightNew = (imgHeight + (Lightbox.borderSize * 2)); 715 716 // Scalars based on change from old to new. 717 this.xScale = ( widthNew / this.widthCurrent) * 100; 718 this.yScale = ( heightNew / this.heightCurrent) * 100; 719 720 // Calculate size difference between new and old image, and resize if 721 // necessary. 722 wDiff = this.widthCurrent - widthNew; 723 hDiff = this.heightCurrent - heightNew; 724 725 $('#modalContainer').css({'width': imgWidth, 'height': imgHeight}); 726 // Detect animation sequence. 727 if (Lightbox.resizeSequence) { 728 var animate1 = {width: widthNew}; 729 var animate2 = {height: heightNew}; 730 if (Lightbox.resizeSequence == 2) { 731 animate1 = {height: heightNew}; 732 animate2 = {width: widthNew}; 733 } 734 $('#outerImageContainer').animate(animate1, Lightbox.resizeSpeed).animate(animate2, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); }); 735 } 736 // Simultaneous. 737 else { 738 $('#outerImageContainer').animate({'width': widthNew, 'height': heightNew}, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); }); 739 } 740 741 // If new and old image are same size and no scaling transition is necessary 742 // do a quick pause to prevent image flicker. 743 if ((hDiff === 0) && (wDiff === 0)) { 744 if (Drupal.settings.lightbox2.useragent.search('MSIE') !== -1) { 745 Lightbox.pause(250); 746 } 747 else { 748 Lightbox.pause(100); 749 } 750 } 751 752 var s = Drupal.settings.lightbox2; 753 if (!s.use_alt_layout) { 754 $('#prevLink, #nextLink').css({'height': imgHeight + 'px'}); 755 } 756 $('#imageDataContainer').css({'width': widthNew + 'px'}); 757 }, 758 759 // showData() 760 // Display image and begin preloading neighbors. 761 showData: function() { 762 $('#loading').hide(); 763 764 if (Lightbox.isLightframe || Lightbox.isVideo || Lightbox.isModal) { 765 Lightbox.updateDetails(); 766 if (Lightbox.isLightframe) { 767 $('#frameContainer').show(); 768 if (Drupal.settings.lightbox2.useragent.search('Safari') !== -1 || Lightbox.fadeInSpeed === 0) { 769 $('#lightboxFrame').css({'zIndex': '10500'}).show(); 770 } 771 else { 772 $('#lightboxFrame').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed); 773 } 774 } 775 else { 776 if (Lightbox.isVideo) { 777 $("#modalContainer").html(Lightbox.modalHTML).click(function(){return false;}).css('zIndex', '10500').show(); 778 } 779 else { 780 var src = unescape(Lightbox.imageArray[Lightbox.activeImage][0]); 781 if (Lightbox.imageArray[Lightbox.activeImage][4]) { 782 $(src).appendTo("#modalContainer"); 783 $('#modalContainer').css({'zIndex': '10500'}).show(); 784 } 785 else { 786 // Use a callback to show the new image, otherwise you get flicker. 787 $("#modalContainer").hide().load(src, function () {$('#modalContainer').css({'zIndex': '10500'}).show();}); 788 } 789 $('#modalContainer').unbind('click'); 790 } 791 // This might be needed in the Lightframe section above. 792 //$('#modalContainer').css({'zIndex': '10500'}).show(); 793 } 794 } 795 796 // Handle display of image content. 797 else { 798 $('#imageContainer').show(); 799 if (Drupal.settings.lightbox2.useragent.search('Safari') !== -1 || Lightbox.fadeInSpeed === 0) { 800 $('#lightboxImage').css({'zIndex': '10500'}).show(); 801 } 802 else { 803 $('#lightboxImage').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed); 804 } 805 Lightbox.updateDetails(); 806 this.preloadNeighborImages(); 807 } 808 Lightbox.inprogress = false;
809 810 // Slideshow specific stuff. 811 if (Lightbox.isSlideshow) { 812 if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) { 813 if (Lightbox.autoExit) { 814 Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.end('slideshow');}, Lightbox.slideInterval); 815 } 816 } 817 else { 818 if (!Lightbox.isPaused && Lightbox.total > 1) { 819 Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.changeData(Lightbox.activeImage + 1);}, Lightbox.slideInterval); 820 } 821 } 822 if (Lightbox.showPlayPause && Lightbox.total > 1 && !Lightbox.isPaused) { 823 $('#lightshowPause').show(); 824 $('#lightshowPlay').hide(); 825 } 826 else if (Lightbox.showPlayPause && Lightbox.total > 1) { 827 $('#lightshowPause').hide(); 828 $('#lightshowPlay').show(); 829 } 830 } 831 832 // Adjust the page overlay size. 833 var arrayPageSize = Lightbox.getPageSize(); 834 var arrayPageScroll = Lightbox.getPageScroll(); 835 var pageHeight = arrayPageSize[1]; 836 if (Lightbox.isZoomedIn && arrayPageSize[1] > arrayPageSize[3]) { 837 var lightboxTop = (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1; 838 pageHeight = pageHeight + arrayPageScroll[1] + lightboxTop; 839 } 840 $('#lightbox2-overlay').css({'height': pageHeight + 'px', 'width': arrayPageSize[0] + 'px'}); 841 842 // Gecko browsers (e.g. Firefox, SeaMonkey, etc) don't handle pdfs as 843 // expected. 844 if (Drupal.settings.lightbox2.useragent.search('Mozilla') !== -1) { 845 if (Lightbox.imageArray[Lightbox.activeImage][0].indexOf(".pdf") != -1) { 846 setTimeout(function () { 847 document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0]; 848 }, 1000); 849 } 850 } 851 }, 852 853 // updateDetails() 854 // Display caption, image number, and bottom nav. 855 updateDetails: function() { 856 857 $("#imageDataContainer").hide(); 858 859 var s = Drupal.settings.lightbox2; 860 861 if (s.show_caption) { 862 var caption = Lightbox.filterXSS(Lightbox.imageArray[Lightbox.activeImage][1]); 863 if (!caption) caption = ''; 864 $('#caption').html(caption).css({'zIndex': '10500'}).show(); 865 } 866 867 // If image is part of set display 'Image x of x'. 868 var numberDisplay = null; 869 if (s.image_count && Lightbox.total > 1) { 870 var currentImage = Lightbox.activeImage + 1; 871 if (!Lightbox.isLightframe && !Lightbox.isModal && !Lightbox.isVideo) { 872 numberDisplay = s.image_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); 873 } 874 else if (Lightbox.isVideo) { 875 numberDisplay = s.video_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); 876 } 877 else { 878 numberDisplay = s.page_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); 879 }
880 $('#numberDisplay').html(numberDisplay).css({'zIndex': '10500'}).show(); 881 } 882 else { 883 $('#numberDisplay').hide(); 884 } 885 886 $("#imageDataContainer").hide().slideDown(Lightbox.slideDownSpeed, function() { 887 $("#bottomNav").show(); 888 }); 889 if (Lightbox.rtl == 1) { 890 $("#bottomNav").css({'float': 'left'}); 891 } 892 Lightbox.updateNav(); 893 }, 894 895 // updateNav() 896 // Display appropriate previous and next hover navigation. 897 updateNav: function() { 898 899 $('#hoverNav').css({'zIndex': '10500'}).show(); 900 var prevLink = '#prevLink'; 901 var nextLink = '#nextLink'; 902 903 // Slideshow is separated as we need to show play / pause button. 904 if (Lightbox.isSlideshow) { 905 if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage !== 0) { 906 $(prevLink).css({'zIndex': '10500'}).show().click(function() { 907 if (Lightbox.pauseOnPrevClick) { 908 Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); 909 } 910 Lightbox.changeData(Lightbox.activeImage - 1); return false; 911 }); 912 } 913 else { 914 $(prevLink).hide(); 915 } 916 917 // If not last image in set, display next image button. 918 if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage != (Lightbox.total - 1)) { 919 $(nextLink).css({'zIndex': '10500'}).show().click(function() { 920 if (Lightbox.pauseOnNextClick) { 921 Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); 922 } 923 Lightbox.changeData(Lightbox.activeImage + 1); return false; 924 }); 925 } 926 // Safari browsers need to have hide() called again. 927 else { 928 $(nextLink).hide(); 929 } 930 } 931 932 // All other types of content. 933 else { 934 935 if ((Lightbox.isLightframe || Lightbox.isModal || Lightbox.isVideo) && !Lightbox.alternative_layout) { 936 $('#frameHoverNav').css({'zIndex': '10500'}).show(); 937 $('#hoverNav').css({'zIndex': '10500'}).hide(); 938 prevLink = '#framePrevLink'; 939 nextLink = '#frameNextLink'; 940 } 941 942 // If not first image in set, display prev image button. 943 if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage !== 0) { 944 // Unbind any other click handlers, otherwise this adds a new click handler 945 // each time the arrow is clicked. 946 $(prevLink).css({'zIndex': '10500'}).show().unbind().click(function() { 947 Lightbox.changeData(Lightbox.activeImage - 1); return false; 948 }); 949 } 950 // Safari browsers need to have hide() called again. 951 else { 952 $(prevLink).hide(); 953 } 954 955 // If not last image in set, display next image button. 956 if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage != (Lightbox.total - 1)) { 957 // Unbind any other click handlers, otherwise this adds a new click handler 958 // each time the arrow is clicked. 959 $(nextLink).css({'zIndex': '10500'}).show().unbind().click(function() { 960 Lightbox.changeData(Lightbox.activeImage + 1); return false; 961 }); 962 } 963 // Safari browsers need to have hide() called again. 964 else { 965 $(nextLink).hide(); 966 } 967 } 968 969 // Don't enable keyboard shortcuts so forms will work. 970 if (!Lightbox.isModal) { 971 this.enableKeyboardNav(); 972 } 973 }, 974 975 976 // enableKeyboardNav() 977 enableKeyboardNav: function() { 978 $(document).bind("keydown", this.keyboardAction); 979 }, 980 981 // disableKeyboardNav() 982 disableKeyboardNav: function() { 983 $(document).unbind("keydown", this.keyboardAction); 984 }, 985 986 // keyboardAction() 987 keyboardAction: function(e) { 988 if (e === null) { // IE. 989 keycode = event.keyCode; 990 escapeKey = 27; 991 } 992 else { // Mozilla. 993 keycode = e.keyCode; 994 escapeKey = e.DOM_VK_ESCAPE; 995 } 996 997 key = String.fromCharCode(keycode).toLowerCase(); 998 999 // Close lightbox. 1000 if (Lightbox.checkKey(Lightbox.keysClose, key, keycode)) { 1001 Lightbox.end('forceClose'); 1002 } 1003 // Display previous image (p, <-). 1004 else if (Lightbox.checkKey(Lightbox.keysPrevious, key, keycode)) { 1005 if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage !== 0) { 1006 Lightbox.changeData(Lightbox.activeImage - 1); 1007 } 1008 1009 } 1010 // Display next image (n, ->). 1011 else if (Lightbox.checkKey(Lightbox.keysNext, key, keycode)) { 1012 if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage != (Lightbox.total - 1)) { 1013 Lightbox.changeData(Lightbox.activeImage + 1); 1014 } 1015 } 1016 // Zoom in. 1017 else if (Lightbox.checkKey(Lightbox.keysZoom, key, keycode) && !Lightbox.disableResize && !Lightbox.disableZoom && !Lightbox.isSlideshow && !Lightbox.isLightframe) { 1018 if (Lightbox.isZoomedIn) { 1019 Lightbox.changeData(Lightbox.activeImage, false); 1020 } 1021 else if (!Lightbox.isZoomedIn) { 1022 Lightbox.changeData(Lightbox.activeImage, true); 1023 } 1024 return false;
1025 } 1026 // Toggle play / pause (space). 1027 else if (Lightbox.checkKey(Lightbox.keysPlayPause, key, keycode) && Lightbox.isSlideshow) { 1028 1029 if (Lightbox.isPaused) { 1030 Lightbox.togglePlayPause("lightshowPlay", "lightshowPause"); 1031 } 1032 else { 1033 Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); 1034 } 1035 return false; 1036 } 1037 }, 1038 1039 preloadNeighborImages: function() { 1040 1041 if ((Lightbox.total - 1) > Lightbox.activeImage) { 1042 preloadNextImage = new Image(); 1043 preloadNextImage.src = Lightbox.imageArray[Lightbox.activeImage + 1][0]; 1044 } 1045 if (Lightbox.activeImage > 0) { 1046 preloadPrevImage = new Image(); 1047 preloadPrevImage.src = Lightbox.imageArray[Lightbox.activeImage - 1][0]; 1048 } 1049 1050 }, 1051 1052 end: function(caller) { 1053 var closeClick = (caller == 'slideshow' ? false : true); 1054 if (Lightbox.isSlideshow && Lightbox.isPaused && !closeClick) { 1055 return; 1056 } 1057 // To prevent double clicks on navigation links. 1058 if (Lightbox.inprogress === true && caller != 'forceClose') { 1059 return; 1060 } 1061 Lightbox.disableKeyboardNav(); 1062 $('#lightbox').hide(); 1063 $("#lightbox2-overlay").fadeOut(); 1064 Lightbox.isPaused = true; 1065 Lightbox.inprogress = false; 1066 Lightbox.imageArray = []; 1067 Lightbox.imageNum = 0; 1068 // Replaces calls to showSelectBoxes() and showFlash() in original 1069 // lightbox2. 1070 Lightbox.toggleSelectsFlash('visible'); 1071 if (Lightbox.isSlideshow) { 1072 for (var i = 0; i < Lightbox.slideIdCount; i++) { 1073 window.clearTimeout(Lightbox.slideIdArray[i]); 1074 } 1075 $('#lightshowPause, #lightshowPlay').hide(); 1076 } 1077 else if (Lightbox.isLightframe) { 1078 $('#frameContainer').empty().hide(); 1079 } 1080 else if (Lightbox.isVideo || Lightbox.isModal) { 1081 if (!Lightbox.auto_modal) { 1082 $('#modalContainer').hide().html(""); 1083 } 1084 Lightbox.auto_modal = false; 1085 } 1086 }, 1087 1088 1089 // getPageScroll() 1090 // Returns array with x,y page scroll values. 1091 // Core code from - quirksmode.com. 1092 getPageScroll : function() { 1093 1094 var xScroll, yScroll; 1095 1096 if (self.pageYOffset || self.pageXOffset) { 1097 yScroll = self.pageYOffset; 1098 xScroll = self.pageXOffset; 1099 } 1100 else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) { // Explorer 6 Strict. 1101 yScroll = document.documentElement.scrollTop; 1102 xScroll = document.documentElement.scrollLeft; 1103 } 1104 else if (document.body) {// All other Explorers. 1105 yScroll = document.body.scrollTop; 1106 xScroll = document.body.scrollLeft; 1107 } 1108 1109 arrayPageScroll = [xScroll,yScroll]; 1110 return arrayPageScroll; 1111 }, 1112 1113 // getPageSize() 1114 // Returns array with page width, height and window width, height. 1115 // Core code from - quirksmode.com. 1116 // Edit for Firefox by pHaez. 1117 1118 getPageSize : function() { 1119 1120 var xScroll, yScroll; 1121 1122 if (window.innerHeight && window.scrollMaxY) { 1123 xScroll = window.innerWidth + window.scrollMaxX; 1124 yScroll = window.innerHeight + window.scrollMaxY; 1125 } 1126 else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac. 1127 xScroll = document.body.scrollWidth; 1128 yScroll = document.body.scrollHeight; 1129 } 1130 else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari. 1131 xScroll = document.body.offsetWidth; 1132 yScroll = document.body.offsetHeight; 1133 } 1134 1135 var windowWidth, windowHeight; 1136 1137 if (self.innerHeight) { // All except Explorer. 1138 if (document.documentElement.clientWidth) { 1139 windowWidth = document.documentElement.clientWidth; 1140 } 1141 else { 1142 windowWidth = self.innerWidth; 1143 } 1144 windowHeight = self.innerHeight; 1145 } 1146 else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode. 1147 windowWidth = document.documentElement.clientWidth; 1148 windowHeight = document.documentElement.clientHeight; 1149 } 1150 else if (document.body) { // Other Explorers. 1151 windowWidth = document.body.clientWidth; 1152 windowHeight = document.body.clientHeight; 1153 } 1154 // For small pages with total height less than height of the viewport. 1155 if (yScroll < windowHeight) { 1156 pageHeight = windowHeight; 1157 } 1158 else { 1159 pageHeight = yScroll; 1160 } 1161 // For small pages with total width less than width of the viewport. 1162 if (xScroll < windowWidth) { 1163 pageWidth = xScroll; 1164 } 1165 else { 1166 pageWidth = windowWidth; 1167 } 1168 arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight); 1169 return arrayPageSize; 1170 }, 1171 1172 1173 // pause(numberMillis) 1174 pause : function(ms) { 1175 var date = new Date(); 1176 var curDate = null; 1177 do { curDate = new Date(); } 1178 while (curDate - date < ms); 1179 }, 1180 1181 1182 // toggleSelectsFlash() 1183 // Hide / unhide select lists and flash objects as they appear above the 1184 // lightbox in some browsers. 1185 toggleSelectsFlash: function (state) { 1186 if (state == 'visible') { 1187 $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").show(); 1188 } 1189 else if (state == 'hide') { 1190 $("select:visible, embed:visible, object:visible").not('#lightboxAutoModal select, #lightboxAutoModal embed, #lightboxAutoModal object').addClass("lightbox_hidden"); 1191 $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").hide(); 1192 } 1193 }, 1194 1195 1196 // parseRel() 1197 parseRel: function (link) { 1198 var parts = []; 1199 parts["rel"] = parts["title"] = parts["group"] = parts["style"] = parts["flashvars"] = null; 1200 if (!$(link).attr('rel')) return parts; 1201 parts["rel"] = $(link).attr('rel').match(/\w+/)[0]; 1202 1203 if ($(link).attr('rel').match(/\[(.*)\]/)) { 1204 var info = $(link).attr('rel').match(/\[(.*?)\]/)[1].split('|'); 1205 parts["group"] = info[0]; 1206 parts["style"] = info[1]; 1207 if (parts["style"] != undefined && parts["style"].match(/flashvars:\s?(.*?);/)) { 1208 parts["flashvars"] = parts["style"].match(/flashvars:\s?(.*?);/)[1]; 1209 } 1210 } 1211 if ($(link).attr('rel').match(/\[.*\]\[([\s\S]*)\]/)) { 1212 var title = $(link).attr('rel').match(/\[.*\]\[([\s\S]*)\]/)[1]; 1213 parts["title"] = title.replace(/\n/g, '<br />'); 1214 } 1215 return parts; 1216 }, 1217 1218 // setStyles() 1219 setStyles: function(item, styles) { 1220 item.width = Lightbox.iframe_width; 1221 item.height = Lightbox.iframe_height; 1222 item.scrolling = "auto"; 1223 1224 if (!styles) return item; 1225 var stylesArray = styles.split(';'); 1226 for (var i = 0; i< stylesArray.length; i++) { 1227 if (stylesArray[i].indexOf('width:') >= 0) { 1228 var w = stylesArray[i].replace('width:', ''); 1229 item.width = jQuery.trim(w); 1230 } 1231 else if (stylesArray[i].indexOf('height:') >= 0) { 1232 var h = stylesArray[i].replace('height:', ''); 1233 item.height = jQuery.trim(h); 1234 } 1235 else if (stylesArray[i].indexOf('scrolling:') >= 0) { 1236 var scrolling = stylesArray[i].replace('scrolling:', ''); 1237 item.scrolling = jQuery.trim(scrolling); 1238 } 1239 else if (stylesArray[i].indexOf('overflow:') >= 0) { 1240 var overflow = stylesArray[i].replace('overflow:', ''); 1241 item.overflow = jQuery.trim(overflow); 1242 } 1243 } 1244 return item; 1245 }, 1246 1247 1248 // togglePlayPause() 1249 // Hide the pause / play button as appropriate. If pausing the slideshow also 1250 // clear the timers, otherwise move onto the next image. 1251 togglePlayPause: function(hideId, showId) { 1252 if (Lightbox.isSlideshow && hideId == "lightshowPause") { 1253 for (var i = 0; i < Lightbox.slideIdCount; i++) { 1254 window.clearTimeout(Lightbox.slideIdArray[i]); 1255 } 1256 } 1257 $('#' + hideId).hide(); 1258 $('#' + showId).show(); 1259 1260 if (hideId == "lightshowPlay") { 1261 Lightbox.isPaused = false;
1262 if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) { 1263 Lightbox.end(); 1264 } 1265 else if (Lightbox.total > 1) { 1266 Lightbox.changeData(Lightbox.activeImage + 1); 1267 } 1268 } 1269 else { 1270 Lightbox.isPaused = true; 1271 } 1272 }, 1273 1274 triggerLightbox: function (rel_type, rel_group) { 1275 if (rel_type.length) { 1276 if (rel_group && rel_group.length) { 1277 $("a[rel^='" + rel_type +"\[" + rel_group + "\]'], area[rel^='" + rel_type +"\[" + rel_group + "\]']").eq(0).trigger("click"); 1278 } 1279 else { 1280 $("a[rel^='" + rel_type +"'], area[rel^='" + rel_type +"']").eq(0).trigger("click"); 1281 } 1282 } 1283 }, 1284 1285 detectMacFF2: function() { 1286 var ua = navigator.userAgent.toLowerCase(); 1287 if (/firefox[\/\s](\d+\.\d+)/.test(ua)) { 1288 var ffversion = new Number(RegExp.$1); 1289 if (ffversion < 3 && ua.indexOf('mac') != -1) { 1290 return true; 1291 } 1292 } 1293 return false; 1294 }, 1295 1296 checkKey: function(keys, key, code) { 1297 return (jQuery.inArray(key, keys) != -1 || jQuery.inArray(String(code), keys) != -1); 1298 }, 1299 1300 filterXSS: function(str, allowed_tags) { 1301 var output = ""; 1302 var prefix = Drupal.settings.pathPrefix; 1303 if (!prefix) prefix = ''; 1304 $.ajax({ 1305 url: Drupal.settings.basePath + prefix + '?q=system/lightbox2/filter-xss', 1306 data: { 1307 'string' : str, 1308 'allowed_tags' : allowed_tags 1309 }, 1310 type: "POST", 1311 async: false, 1312 dataType: "json", 1313 success: function(data) { 1314 output = data; 1315 } 1316 }); 1317 return output; 1318 } 1319 1320}; 1321 1322// Initialize the lightbox. 1323Drupal.behaviors.initLightbox = { 1324 attach: function(context) { 1325 1326 $('body:not(.lightbox-processed)', context).addClass('lightbox-processed').each(function() { 1327 Lightbox.initialize(); 1328 return false; // Break the each loop. 1329 }); 1330 1331 // Attach lightbox to any links with lightbox rels. 1332 Lightbox.initList(context); 1333 $('#lightboxAutoModal', context).triggerHandler('click'); 1334 } 1335}; 1336})(jQuery); 1337;/**/ 1338(function(c,q){var m="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";c.fn.imagesLoaded=function(f){function n(){var b=c(j),a=c(h);d&&(h.length?d.reject(e,b,a):d.resolve(e));c.isFunction(f)&&f.call(g,e,b,a)}function p(b){k(b.target,"error"===b.type)}function k(b,a){b.src===m||-1!==c.inArray(b,l)||(l.push(b),a?h.push(b):j.push(b),c.data(b,"imagesLoaded",{isBroken:a,src:b.src}),r&&d.notifyWith(c(b),[a,e,c(j),c(h)]),e.length===l.length&&(setTimeout(n),e.unbind(".imagesLoaded", 1339p)))}var g=this,d=c.isFunction(c.Deferred)?c.Deferred():0,r=c.isFunction(d.notify),e=g.find("img").add(g.filter("img")),l=[],j=[],h=[];c.isPlainObject(f)&&c.each(f,function(b,a){if("callback"===b)f=a;else if(d)d[b](a)});e.length?e.bind("load.imagesLoaded error.imagesLoaded",p).each(function(b,a){var d=a.src,e=c.data(a,"imagesLoaded");if(e&&e.src===d)k(a,e.isBroken);else if(a.complete&&a.naturalWidth!==q)k(a,0===a.naturalWidth||0===a.naturalHeight);else if(a.readyState||a.complete)a.src=m,a.src=d}): 1340n();return d?d.promise(g):g}})(jQuery); 1341;/**/ 1342/** 1343 * @file 1344 * Some basic behaviors and utility functions for Views. 1345 */ 1346(function ($) { 1347 1348 Drupal.Views = {}; 1349 1350 /** 1351 * JQuery UI tabs, Views integration component. 1352 */ 1353 Drupal.behaviors.viewsTabs = { 1354 attach: function (context) { 1355 if ($.viewsUi && $.viewsUi.tabs) { 1356 $('#views-tabset').once('views-processed').viewsTabs({ 1357 selectedClass: 'active' 1358 }); 1359 } 1360 1361 $('a.views-remove-link').once('views-processed').click(function(event) { 1362 var id = $(this).attr('id').replace('views-remove-link-', ''); 1363 $('#views-row-' + id).hide(); 1364 $('#views-removed-' + id).attr('checked', true); 1365 event.preventDefault(); 1366 }); 1367 /** 1368 * Here is to handle display deletion 1369 * (checking in the hidden checkbox and hiding out the row). 1370 */ 1371 $('a.display-remove-link') 1372 .addClass('display-processed') 1373 .click(function() { 1374 var id = $(this).attr('id').replace('display-remove-link-', ''); 1375 $('#display-row-' + id).hide(); 1376 $('#display-removed-' + id).attr('checked', true); 1377 return false;
1378 }); 1379 } 1380 }; 1381 1382 /** 1383 * Helper function to parse a querystring. 1384 */ 1385 Drupal.Views.parseQueryString = function (query) { 1386 var args = {}; 1387 var pos = query.indexOf('?'); 1388 if (pos != -1) { 1389 query = query.substring(pos + 1); 1390 } 1391 var pairs = query.split('&'); 1392 for (var i in pairs) { 1393 if (typeof(pairs[i]) == 'string') { 1394 var pair = pairs[i].split('='); 1395 // Ignore the 'q' path argument, if present. 1396 if (pair[0] != 'q' && pair[1]) { 1397 args[decodeURIComponent(pair[0].replace(/\+/g, ' '))] = decodeURIComponent(pair[1].replace(/\+/g, ' ')); 1398 } 1399 } 1400 } 1401 return args; 1402 }; 1403 1404 /** 1405 * Helper function to return a view's arguments based on a path. 1406 */ 1407 Drupal.Views.parseViewArgs = function (href, viewPath) { 1408 1409 // Provide language prefix. 1410 if (Drupal.settings.pathPrefix) { 1411 var viewPath = Drupal.settings.pathPrefix + viewPath; 1412 } 1413 var returnObj = {}; 1414 var path = Drupal.Views.getPath(href); 1415 // Ensure we have a correct path. 1416 if (viewPath && path.substring(0, viewPath.length + 1) == viewPath + '/') { 1417 var args = decodeURIComponent(path.substring(viewPath.length + 1, path.length)); 1418 returnObj.view_args = args; 1419 returnObj.view_path = path; 1420 } 1421 return returnObj; 1422 }; 1423 1424 /** 1425 * Strip off the protocol plus domain from an href. 1426 */ 1427 Drupal.Views.pathPortion = function (href) { 1428 // Remove e.g. http://example.com if present. 1429 var protocol = window.location.protocol; 1430 if (href.substring(0, protocol.length) == protocol) { 1431 // 2 is the length of the '//' that normally follows the protocol. 1432 href = href.substring(href.indexOf('/', protocol.length + 2)); 1433 } 1434 return href; 1435 }; 1436 1437 /** 1438 * Return the Drupal path portion of an href. 1439 */ 1440 Drupal.Views.getPath = function (href) { 1441 href = Drupal.Views.pathPortion(href); 1442 href = href.substring(Drupal.settings.basePath.length, href.length); 1443 // 3 is the length of the '?q=' added to the url without clean urls. 1444 if (href.substring(0, 3) == '?q=') { 1445 href = href.substring(3, href.length); 1446 } 1447 var chars = ['#', '?', '&']; 1448 for (var i in chars) { 1449 if (href.indexOf(chars[i]) > -1) { 1450 href = href.substr(0, href.indexOf(chars[i])); 1451 } 1452 } 1453 return href; 1454 }; 1455 1456})(jQuery); 1457;/**/ 1458/** 1459 * @file 1460 * Handles AJAX fetching of views, including filter submission and response. 1461 */ 1462(function ($) { 1463 1464 /** 1465 * Attaches the AJAX behavior to exposed filter forms and key views links. 1466 */ 1467 Drupal.behaviors.ViewsAjaxView = {}; 1468 Drupal.behaviors.ViewsAjaxView.attach = function() { 1469 if (Drupal.settings && Drupal.settings.views && Drupal.settings.views.ajaxViews) { 1470 $.each(Drupal.settings.views.ajaxViews, function(i, settings) { 1471 Drupal.views.instances[i] = new Drupal.views.ajaxView(settings); 1472 }); 1473 } 1474 }; 1475 1476 Drupal.views = {}; 1477 Drupal.views.instances = {}; 1478 1479 /** 1480 * JavaScript object for a certain view. 1481 */ 1482 Drupal.views.ajaxView = function(settings) { 1483 var selector = '.view-dom-id-' + settings.view_dom_id; 1484 this.$view = $(selector); 1485 1486 // Retrieve the path to use for views' ajax. 1487 var ajax_path = Drupal.settings.views.ajax_path; 1488 1489 // If there are multiple views this might've ended up showing up multiple 1490 // times. 1491 if (ajax_path.constructor.toString().indexOf("Array") != -1) { 1492 ajax_path = ajax_path[0]; 1493 } 1494 1495 // Check if there are any GET parameters to send to views. 1496 var queryString = window.location.search || ''; 1497 if (queryString !== '') { 1498 // Remove the question mark and Drupal path component if any. 1499 var queryString = queryString.slice(1).replace(/q=[^&]+&?|&?render=[^&]+/, ''); 1500 if (queryString !== '') { 1501 // If there is a '?' in ajax_path, clean url are on and & should be 1502 // used to add parameters. 1503 queryString = ((/\?/.test(ajax_path)) ? '&' : '?') + queryString; 1504 } 1505 } 1506 1507 this.element_settings = { 1508 url: ajax_path + queryString, 1509 submit: settings, 1510 setClick: true, 1511 event: 'click', 1512 selector: selector, 1513 progress: { 1514 type: 'throbber' 1515 } 1516 }; 1517 1518 this.settings = settings; 1519
1520 // Add the ajax to exposed forms. 1521 this.$exposed_form = $('#views-exposed-form-' + settings.view_name.replace(/_/g, '-') + '-' + settings.view_display_id.replace(/_/g, '-')); 1522 this.$exposed_form.once(jQuery.proxy(this.attachExposedFormAjax, this)); 1523 1524 // Store Drupal.ajax objects here for all pager links. 1525 this.links = []; 1526 1527 // Add the ajax to pagers. 1528 this.$view 1529 .once(jQuery.proxy(this.attachPagerAjax, this)); 1530 1531 // Add a trigger to update this view specifically. In order to trigger a 1532 // refresh use the following code. 1533 // 1534 // @code 1535 // jQuery('.view-name').trigger('RefreshView'); 1536 // @endcode 1537 // Add a trigger to update this view specifically. 1538 var self_settings = this.element_settings; 1539 self_settings.event = 'RefreshView'; 1540 var self = this; 1541 this.$view.once('refresh', function () { 1542 self.refreshViewAjax = new Drupal.ajax(self.selector, self.$view, self_settings); 1543 }); 1544 }; 1545 1546 Drupal.views.ajaxView.prototype.attachExposedFormAjax = function() { 1547 var button = $('input[type=submit], button[type=submit], input[type=image]', this.$exposed_form); 1548 button = button[0]; 1549 1550 // Call the autocomplete submit before doing AJAX. 1551 $(button).click(function () { 1552 if (Drupal.autocompleteSubmit) { 1553 Drupal.autocompleteSubmit(); 1554 } 1555 }); 1556 1557 this.exposedFormAjax = new Drupal.ajax($(button).attr('id'), button, this.element_settings); 1558 }; 1559 1560 /** 1561 * Attach the ajax behavior to each link. 1562 */ 1563 Drupal.views.ajaxView.prototype.attachPagerAjax = function() { 1564 this.$view.find('ul.pager > li > a, ol.pager > li > a, th.views-field a, .attachment .views-summary a') 1565 .each(jQuery.proxy(this.attachPagerLinkAjax, this)); 1566 }; 1567 1568 /** 1569 * Attach the ajax behavior to a single link. 1570 */ 1571 Drupal.views.ajaxView.prototype.attachPagerLinkAjax = function(id, link) { 1572 var $link = $(link); 1573 var viewData = {}; 1574 var href = $link.attr('href'); 1575 // Don't attach to pagers inside nested views. 1576 if ($link.closest('.view')[0] !== this.$view[0] && 1577 $link.closest('.view').parent().hasClass('attachment') === false) { 1578 return; 1579 } 1580 1581 // Provide a default page if none has been set. This must be done 1582 // prior to merging with settings to avoid accidentally using the 1583 // page landed on instead of page 1. 1584 if (typeof(viewData.page) === 'undefined') { 1585 viewData.page = 0; 1586 } 1587 1588 // Construct an object using the settings defaults and then overriding 1589 // with data specific to the link. 1590 $.extend( 1591 viewData, 1592 this.settings, 1593 Drupal.Views.parseQueryString(href), 1594 // Extract argument data from the URL. 1595 Drupal.Views.parseViewArgs(href, this.settings.view_base_path) 1596 ); 1597 1598 // For anchor tags, these will go to the target of the anchor rather 1599 // than the usual location. 1600 $.extend(viewData, Drupal.Views.parseViewArgs(href, this.settings.view_base_path)); 1601 1602 this.element_settings.submit = viewData; 1603 this.pagerAjax = new Drupal.ajax(false, $link, this.element_settings); 1604 this.links.push(this.pagerAjax); 1605 }; 1606 1607 Drupal.ajax.prototype.commands.viewsScrollTop = function (ajax, response, status) { 1608 // Scroll to the top of the view. This will allow users 1609 // to browse newly loaded content after e.g. clicking a pager 1610 // link. 1611 var offset = $(response.selector).offset(); 1612 // We can't guarantee that the scrollable object should be 1613 // the body, as the view could be embedded in something 1614 // more complex such as a modal popup. Recurse up the DOM 1615 // and scroll the first element that has a non-zero top. 1616 var scrollTarget = response.selector; 1617 while ($(scrollTarget).scrollTop() == 0 && $(scrollTarget).parent()) { 1618 scrollTarget = $(scrollTarget).parent(); 1619 } 1620 // Only scroll upward. 1621 if (offset.top - 10 < $(scrollTarget).scrollTop()) { 1622 $(scrollTarget).animate({scrollTop: (offset.top - 10)}, 500); 1623 } 1624 }; 1625 1626})(jQuery); 1627;/**/ 1628(function ($) { 1629Drupal.settings.views = Drupal.settings.views || {'ajax_path': '/views/ajax'}; 1630 1631Drupal.quicktabs = Drupal.quicktabs || {}; 1632 1633Drupal.quicktabs.getQTName = function (el) { 1634 return el.id.substring(el.id.indexOf('-') +1); 1635} 1636 1637Drupal.behaviors.quicktabs = { 1638 attach: function (context, settings) { 1639 $.extend(true, Drupal.settings, settings); 1640 $('.quicktabs-wrapper', context).once(function(){ 1641 Drupal.quicktabs.prepare(this); 1642 }); 1643 } 1644} 1645 1646// Setting up the inital behaviours 1647Drupal.quicktabs.prepare = function(el) { 1648 // el.id format: "quicktabs-$name" 1649 var qt_name = Drupal.quicktabs.getQTName(el); 1650 var $ul = $(el).find('ul.quicktabs-tabs:first'); 1651 1652 $("ul.quicktabs-tabs li a span#active-quicktabs-tab").remove(); 1653 1654 $ul.find('li a').each(function(i, element){ 1655 element.myTabIndex = i; 1656 element.qt_name = qt_name; 1657 1658 var tab = new Drupal.quicktabs.tab(element); 1659 var parent_li = $(element).parents('li').get(0); 1660 if ($(parent_li).hasClass('active')) { 1661 $(element).addClass('quicktabs-loaded'); 1662 $(element).append('<span id="active-quicktabs-tab" class="element-invisible">' + Drupal.t('(active tab)') + '</span>'); 1663 } 1664 $(element).once(function() {$(this).bind('click', {tab: tab}, Drupal.quicktabs.clickHandler);}); 1665 }); 1666} 1667 1668Drupal.quicktabs.clickHandler = function(event) { 1669 var tab = event.data.tab; 1670 var element = this; 1671 // Set clicked tab to active. 1672 $(this).parents('li').siblings().removeClass('active'); 1673 $(this).parents('li').addClass('active'); 1674 1675 $("ul.quicktabs-tabs li a span#active-quicktabs-tab").remove(); 1676 $(this).append('<span id="active-quicktabs-tab" class="element-invisible">' + Drupal.t('(active tab)') + '</span>'); 1677 1678 // Hide all tabpages. 1679 tab.container.children().addClass('quicktabs-hide'); 1680 1681 if (!tab.tabpage.hasClass("quicktabs-tabpage")) { 1682 tab = new Drupal.quicktabs.tab(element); 1683 } 1684 1685 tab.tabpage.removeClass('quicktabs-hide'); 1686 $(element).trigger('switchtab'); 1687 return false;
1688} 1689 1690// Constructor for an individual tab 1691Drupal.quicktabs.tab = function (el) { 1692 this.element = el; 1693 this.tabIndex = el.myTabIndex; 1694 var qtKey = 'qt_' + el.qt_name; 1695 var i = 0; 1696 for (var key in Drupal.settings.quicktabs[qtKey].tabs) { 1697 if (i == this.tabIndex) { 1698 this.tabObj = Drupal.settings.quicktabs[qtKey].tabs[key]; 1699 this.tabKey = key; 1700 } 1701 i++; 1702 } 1703 this.tabpage_id = 'quicktabs-tabpage-' + el.qt_name + '-' + this.tabKey; 1704 this.container = $('#quicktabs-container-' + el.qt_name); 1705 this.tabpage = this.container.find('#' + this.tabpage_id); 1706} 1707 1708if (Drupal.ajax) { 1709 /** 1710 * Handle an event that triggers an AJAX response. 1711 * 1712 * We unfortunately need to override this function, which originally comes from 1713 * misc/ajax.js, in order to be able to cache loaded tabs, i.e. once a tab 1714 * content has loaded it should not need to be loaded again. 1715 * 1716 * I have removed all comments that were in the original core function, so that 1717 * the only comments inside this function relate to the Quicktabs modification 1718 * of it. 1719 */ 1720 Drupal.ajax.prototype.eventResponse = function (element, event) { 1721 var ajax = this; 1722 1723 if (ajax.ajaxing) { 1724 return false; 1725 } 1726 1727 try { 1728 if (ajax.form) { 1729 if (ajax.setClick) { 1730 element.form.clk = element; 1731 } 1732 1733 ajax.form.ajaxSubmit(ajax.options); 1734 } 1735 else { 1736 // Do not perform an ajax request for already loaded Quicktabs content. 1737 if (!$(element).hasClass('quicktabs-loaded')) { 1738 ajax.beforeSerialize(ajax.element, ajax.options); 1739 $.ajax(ajax.options); 1740 if ($(element).parents('ul').hasClass('quicktabs-tabs')) { 1741 $(element).addClass('quicktabs-loaded'); 1742 } 1743 } 1744 } 1745 } 1746 catch (e) { 1747 ajax.ajaxing = false; 1748 alert("An error occurred while attempting to process " + ajax.options.url + ": " + e.message); 1749 } 1750 return false; 1751 }; 1752} 1753 1754 1755})(jQuery); 1756;/**/ 1757Drupal.TBMegaMenu = Drupal.TBMegaMenu || {}; 1758 1759(function ($) { 1760 Drupal.TBMegaMenu.oldWindowWidth = 0; 1761 Drupal.TBMegaMenu.displayedMenuMobile = false; 1762 Drupal.TBMegaMenu.supportedScreens = [2]; 1763 Drupal.TBMegaMenu.menuResponsive = function () { 1764 var windowWidth = window.innerWidth ? window.innerWidth : $(window).width(); 1765 var navCollapse = $('.tb-megamenu').children('.nav-collapse'); 1766 if (windowWidth < Drupal.TBMegaMenu.supportedScreens[0]) { 1767 navCollapse.addClass('collapse'); 1768 if (Drupal.TBMegaMenu.displayedMenuMobile) { 1769 navCollapse.css({height: 'auto', overflow: 'visible'}); 1770 } else { 1771 navCollapse.css({height: 0, overflow: 'hidden'}); 1772 } 1773 } else { 1774 // If width of window is greater than 980 (supported screen). 1775 navCollapse.removeClass('collapse'); 1776 if (navCollapse.height() <= 0) { 1777 navCollapse.css({height: 'auto', overflow: 'visible'}); 1778 } 1779 } 1780 }; 1781 1782 Drupal.behaviors.tbMegaMenuAction = { 1783 attach: function(context) { 1784 $('.tb-megamenu-button', context).once('menuIstance', function () { 1785 var This = this; 1786 $(This).click(function() { 1787 if(parseInt($(this).parent().children('.nav-collapse').height())) { 1788 $(this).parent().children('.nav-collapse').css({height: 0, overflow: 'hidden'}); 1789 Drupal.TBMegaMenu.displayedMenuMobile = false; 1790 } 1791 else { 1792 $(this).parent().children('.nav-collapse').css({height: 'auto', overflow: 'visible'}); 1793 Drupal.TBMegaMenu.displayedMenuMobile = true; 1794 } 1795 }); 1796 }); 1797 1798 1799 var isTouch = 'ontouchstart' in window && !(/hp-tablet/gi).test(navigator.appVersion); 1800 if(!isTouch){ 1801 $(document).ready(function($){ 1802 var mm_duration = 0; 1803 $('.tb-megamenu').each (function(){ 1804 if ($(this).data('duration')) { 1805 mm_duration = $(this).data('duration'); 1806 } 1807 }); 1808 var mm_timeout = mm_duration ? 100 + mm_duration : 500; 1809 $('.nav > li, li.mega').hover(function(event) { 1810 var $this = $(this); 1811 if ($this.hasClass ('mega')) { 1812 $this.addClass ('animating'); 1813 clearTimeout ($this.data('animatingTimeout')); 1814 $this.data('animatingTimeout', setTimeout(function(){$this.removeClass ('animating')}, mm_timeout)); 1815 clearTimeout ($this.data('hoverTimeout')); 1816 $this.data('hoverTimeout', setTimeout(function(){$this.addClass ('open')}, 100)); 1817 } else { 1818 clearTimeout ($this.data('hoverTimeout')); 1819 $this.data('hoverTimeout', 1820 setTimeout(function(){$this.addClass ('open')}, 100)); 1821 } 1822 }, 1823 function(event) { 1824 var $this = $(this); 1825 if ($this.hasClass ('mega')) { 1826 $this.addClass ('animating'); 1827 clearTimeout ($this.data('animatingTimeout')); 1828 $this.data('animatingTimeout', 1829 setTimeout(function(){$this.removeClass ('animating')}, mm_timeout)); 1830 clearTimeout ($this.data('hoverTimeout')); 1831 $this.data('hoverTimeout', setTimeout(function(){$this.removeClass ('open')}, 100)); 1832 } else { 1833 clearTimeout ($this.data('hoverTimeout')); 1834 $this.data('hoverTimeout', 1835 setTimeout(function(){$this.removeClass ('open')}, 100)); 1836 } 1837 }); 1838 }); 1839 } 1840 1841 $(window).resize(function() { 1842 var windowWidth = window.innerWidth ? window.innerWidth : $(window).width(); 1843 if(windowWidth != Drupal.TBMegaMenu.oldWindowWidth){ 1844 Drupal.TBMegaMenu.oldWindowWidth = windowWidth; 1845 Drupal.TBMegaMenu.menuResponsive(); 1846 } 1847 }); 1848 }, 1849 } 1850})(jQuery); 1851 1852;
1852/**/ 1853Drupal.TBMegaMenu = Drupal.TBMegaMenu || {}; 1854 1855(function ($) { 1856 Drupal.TBMegaMenu.createTouchMenu = function(items) { 1857 items.children('a').each( function() { 1858 var $item = $(this); 1859 var tbitem = $(this).parent(); 1860 $item.click( function(event){ 1861 if ($item.hasClass('tb-megamenu-clicked')) { 1862 var $uri = $item.attr('href'); 1863 window.location.href = $uri; 1864 } 1865 else { 1866 event.preventDefault(); 1867 $item.addClass('tb-megamenu-clicked'); 1868 if(!tbitem.hasClass('open')){ 1869 tbitem.addClass('open'); 1870 } 1871 } 1872 }).closest('li').mouseleave( function(){ 1873 $item.removeClass('tb-megamenu-clicked'); 1874 tbitem.removeClass('open'); 1875 }); 1876 }); 1877 /* 1878 items.children('a').children('span.caret').each( function() { 1879 var $item = $(this).parent(); 1880 $item.click(function(event){ 1881 tbitem = $item.parent(); 1882 if ($item.hasClass('tb-megamenu-clicked')) { 1883 Drupal.TBMegaMenu.eventStopPropagation(event); 1884 if(tbitem.hasClass('open')){ 1885 tbitem.removeClass('open'); 1886 $item.removeClass('tb-megamenu-clicked'); 1887 } 1888 } 1889 else { 1890 Drupal.TBMegaMenu.eventStopPropagation(event); 1891 $item.addClass('tb-megamenu-clicked'); 1892 if(!tbitem.hasClass('open')){ 1893 tbitem.addClass('open'); 1894 $item.removeClass('tb-megamenu-clicked'); 1895 } 1896 } 1897 }); 1898 }); 1899 */ 1900 } 1901 1902 Drupal.TBMegaMenu.eventStopPropagation = function(event) { 1903 if (event.stopPropagation) { 1904 event.stopPropagation(); 1905 } 1906 else if (window.event) { 1907 window.event.cancelBubble = true; 1908 } 1909 } 1910 Drupal.behaviors.tbMegaMenuTouchAction = { 1911 attach: function(context) { 1912 var isTouch = 'ontouchstart' in window && !(/hp-tablet/gi).test(navigator.appVersion); 1913 if(isTouch){ 1914 $('html').addClass('touch'); 1915 Drupal.TBMegaMenu.createTouchMenu($('.tb-megamenu ul.nav li.mega').has('.dropdown-menu')); 1916 } 1917 } 1918 } 1919})(jQuery); 1920;/**/ 1921/* 1922 * jQuery FlexSlider v2.5.0 1923 * Copyright 2012 WooThemes 1924 * Contributing Author: Tyler Smith 1925 */!function($){$.flexslider=function(e,t){var a=$(e);a.vars=$.extend({},$.flexslider.defaults,t);var n=a.vars.namespace,i=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,s=("ontouchstart"in window||i||window.DocumentTouch&&document instanceof DocumentTouch)&&a.vars.touch,r="click touchend MSPointerUp keyup",o="",l,c="vertical"===a.vars.direction,d=a.vars.reverse,u=a.vars.itemWidth>0,v="fade"===a.vars.animation,p=""!==a.vars.asNavFor,m={},f=!0;$.data(e,"flexslider",a),m={init:function(){a.animating=!1,a.currentSlide=parseInt(a.vars.startAt?a.vars.startAt:0,10),isNaN(a.currentSlide)&&(a.currentSlide=0),a.animatingTo=a.currentSlide,a.atEnd=0===a.currentSlide||a.currentSlide===a.last,a.containerSelector=a.vars.selector.substr(0,a.vars.selector.search(" ")),a.slides=$(a.vars.selector,a),a.container=$(a.containerSelector,a),a.count=a.slides.length,a.syncExists=$(a.vars.sync).length>0,"slide"===a.vars.animation&&(a.vars.animation="swing"),a.prop=c?"top":"marginLeft",a.args={},a.manualPause=!1,a.stopped=!1,a.started=!1,a.startTimeout=null,a.transitions=!a.vars.video&&!v&&a.vars.useCSS&&function(){var e=document.createElement("div"),t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var n in t)if(void 0!==e.style[t[n]])return a.pfx=t[n].replace("Perspective","").toLowerCase(),a.prop="-"+a.pfx+"-transform",!0;return!1}(),a.ensureAnimationEnd="",""!==a.vars.controlsContainer&&(a.controlsContainer=$(a.vars.controlsContainer).length>0&&$(a.vars.controlsContainer)),""!==a.vars.manualControls&&(a.manualControls=$(a.vars.manualControls).length>0&&$(a.vars.manualControls)),""!==a.vars.customDirectionNav&&(a.customDirectionNav=2===$(a.vars.customDirectionNav).length&&$(a.vars.customDirectionNav)),a.vars.randomize&&(a.slides.sort(function(){return Math.round(Math.random())-.5}),a.container.empty().append(a.slides)),a.doMath(),a.setup("init"),a.vars.c
1925ontrolNav&&m.controlNav.setup(),a.vars.directionNav&&m.directionNav.setup(),a.vars.keyboard&&(1===$(a.containerSelector).length||a.vars.multipleKeyboard)&&$(document).bind("keyup",function(e){var t=e.keyCode;if(!a.animating&&(39===t||37===t)){var n=39===t?a.getTarget("next"):37===t?a.getTarget("prev"):!1;a.flexAnimate(n,a.vars.pauseOnAction)}}),a.vars.mousewheel&&a.bind("mousewheel",function(e,t,n,i){e.preventDefault();var s=a.getTarget(0>t?"next":"prev");a.flexAnimate(s,a.vars.pauseOnAction)}),a.vars.pausePlay&&m.pausePlay.setup(),a.vars.slideshow&&a.vars.pauseInvisible&&m.pauseInvisible.init(),a.vars.slideshow&&(a.vars.pauseOnHover&&a.hover(function(){a.manualPlay||a.manualPause||a.pause()},function(){a.manualPause||a.manualPlay||a.stopped||a.play()}),a.vars.pauseInvisible&&m.pauseInvisible.isHidden()||(a.vars.initDelay>0?a.startTimeout=setTimeout(a.play,a.vars.initDelay):a.play())),p&&m.asNav.setup(),s&&a.vars.touch&&m.touch(),(!v||v&&a.vars.smoothHeight)&&$(window).bind("resize orientationchange focus",m.resize),a.find("img").attr("draggable","false"),setTimeout(function(){a.vars.start(a)},200)},asNav:{setup:function(){a.asNav=!0,a.animatingTo=Math.floor(a.currentSlide/a.move),a.currentItem=a.currentSlide,a.slides.removeClass(n+"active-slide").eq(a.currentItem).addClass(n+"active-slide"),i?(e._slider=a,a.slides.each(function(){var e=this;e._gesture=new MSGesture,e._gesture.target=e,e.addEventListener("MSPointerDown",function(e){e.preventDefault(),e.currentTarget._gesture&&e.currentTarget._gesture.addPointer(e.pointerId)},!1),e.addEventListener("MSGestureTap",function(e){e.preventDefault();var t=$(this),n=t.index();$(a.vars.asNavFor).data("flexslider").animating||t.hasClass("active")||(a.direction=a.currentItem<n?"next":"prev",a.flexAnimate(n,a.vars.pauseOnAction,!1,!0,!0))})})):a.slides.on(r,function(e){e.preventDefault();var t=$(this),i=t.index(),s=t.offset().left-$(a).scrollLeft();0>=s&&t.hasClass(n+"active-slide")?a.flexAnimate(a.getTarget("prev"),!0):$(a.vars.asNavFor).data("flexslider").animating||t.hasClass(n+"active-slide")||(a.direction=a.currentItem<i?"next":"prev",a.flexAnimate(i,a.vars.pauseOnAction,!1,!0,!0))})}},controlNav:{setup:function(){a.manualControls?m.controlNav.setupManual():m.controlNav.setupPaging()},setupPaging:function(){var e="thumbnails"===a.vars.controlNav?"control-thumbs":"control-paging",t=1,i,s;if(a.controlNavScaffold=$('<ol class="'+n+"control-nav "+n+e+'"></ol>'),a.pagingCount>1)for(var l=0;l<a.pagingCount;l++){if(s=a.slides.eq(l),i="thumbnails"===a.vars.controlNav?'<img src="'+s.attr("data-thumb")+'"/>':"<a>"+t+"</a>","thumbnails"===a.vars.controlNav&&!0===a.vars.thumbCaptions){var c=s.attr("data-thumbcaption");""!==c&&void 0!==c&&(i+='<span class="'+n+'caption">'+c+"</span>")}a.controlNavScaffold.append("<li>"+i+"</li>"),t++}a.controlsContainer?$(a.controlsContainer).append(a.controlNavScaffold):a.append(a.controlNavScaffold),m.controlNav.set(),m.controlNav.active(),a.controlNavScaffold.delegate("a, img",r,function(e){if(e.preventDefault(),""===o||o===e.type){var t=$(this),i=a.controlNav.index(t);t.hasClass(n+"active")||(a.direction=i>a.currentSlide?"next":"prev",a.flexAnimate(i,a.vars.pauseOnAction))}""===o&&(o=e.type),m.setToClearWatchedEvent()})},setupManual:function(){a.controlNav=a.manualControls,m.controlNav.active(),a.controlNav.bind(r,function(e){if(e.preventDefault(),""===o||o===e.type){var t=$(this),i=a.controlNav.index(t);t.hasClass(n+"active")||(a.direction=i>a.currentSlide?"next":"prev",a.flexAnimate(i,a.vars.pauseOnAction))}""===o&&(o=e.type),m.setToClearWatchedEvent()})},set:function(){var e="thumbnails"===a.vars.controlNav?"img":"a";a.controlNav=$("."+n+"control-nav li "+e,a.controlsContainer?a.controlsContainer:a)},active:function(){a.controlNav.removeClass(n+"active").eq(a.animatingTo).addClass(n+"active")},update:function(e,t){a.pagingCount>1&&"add"===e?a.controlNavScaffold.append($("<li><a>"+a.count+"</a></li>")):1===a.pagingCount?a.controlNavScaffold.find("li").remove():a.controlNav.eq(t).closest("li").remove(),m.controlNav.set(),a.pagingCount>1&&a.pagingCount!==a.controlNav.length?a.update(t,e):m.controlNav.active()}}
1925,directionNav:{setup:function(){var e=$('<ul class="'+n+'direction-nav"><li class="'+n+'nav-prev"><a class="'+n+'prev" href="#">'+a.vars.prevText+'</a></li><li class="'+n+'nav-next"><a class="'+n+'next" href="#">'+a.vars.nextText+"</a></li></ul>");a.customDirectionNav?a.directionNav=a.customDirectionNav:a.controlsContainer?($(a.controlsContainer).append(e),a.directionNav=$("."+n+"direction-nav li a",a.controlsContainer)):(a.append(e),a.directionNav=$("."+n+"direction-nav li a",a)),m.directionNav.update(),a.directionNav.bind(r,function(e){e.preventDefault();var t;(""===o||o===e.type)&&(t=a.getTarget($(this).hasClass(n+"next")?"next":"prev"),a.flexAnimate(t,a.vars.pauseOnAction)),""===o&&(o=e.type),m.setToClearWatchedEvent()})},update:function(){var e=n+"disabled";1===a.pagingCount?a.directionNav.addClass(e).attr("tabindex","-1"):a.vars.animationLoop?a.directionNav.removeClass(e).removeAttr("tabindex"):0===a.animatingTo?a.directionNav.removeClass(e).filter("."+n+"prev").addClass(e).attr("tabindex","-1"):a.animatingTo===a.last?a.directionNav.removeClass(e).filter("."+n+"next").addClass(e).attr("tabindex","-1"):a.directionNav.removeClass(e).removeAttr("tabindex")}}
vendor: 12,288 bytes, line 1925
1925,pausePlay:{setup:function(){var e=$('<div class="'+n+'pauseplay"><a></a></div>');a.controlsContainer?(a.controlsContainer.append(e),a.pausePlay=$("."+n+"pauseplay a",a.controlsContainer)):(a.append(e),a.pausePlay=$("."+n+"pauseplay a",a)),m.pausePlay.update(a.vars.slideshow?n+"pause":n+"play"),a.pausePlay.bind(r,function(e){e.preventDefault(),(""===o||o===e.type)&&($(this).hasClass(n+"pause")?(a.manualPause=!0,a.manualPlay=!1,a.pause()):(a.manualPause=!1,a.manualPlay=!0,a.play())),""===o&&(o=e.type),m.setToClearWatchedEvent()})},update:function(e){"play"===e?a.pausePlay.removeClass(n+"pause").addClass(n+"play").html(a.vars.playText):a.pausePlay.removeClass(n+"play").addClass(n+"pause").html(a.vars.pauseText)}},touch:function(){function t(t){t.stopPropagation(),a.animating?t.preventDefault():(a.pause(),e._gesture.addPointer(t.pointerId),w=0,p=c?a.h:a.w,f=Number(new Date),l=u&&d&&a.animatingTo===a.last?0:u&&d?a.limit-(a.itemW+a.vars.itemMargin)*a.move*a.animatingTo:u&&a.currentSlide===a.last?a.limit:u?(a.itemW+a.vars.itemMargin)*a.move*a.currentSlide:d?(a.last-a.currentSlide+a.cloneOffset)*p:(a.currentSlide+a.cloneOffset)*p)}function n(t){t.stopPropagation();var a=t.target._slider;if(a){var n=-t.translationX,i=-t.translationY;return w+=c?i:n,m=w,y=c?Math.abs(w)<Math.abs(-n):Math.abs(w)<Math.abs(-i),t.detail===t.MSGESTURE_FLAG_INERTIA?void setImmediate(function(){e._gesture.stop()}):void((!y||Number(new Date)-f>500)&&(t.preventDefault(),!v&&a.transitions&&(a.vars.animationLoop||(m=w/(0===a.currentSlide&&0>w||a.currentSlide===a.last&&w>0?Math.abs(w)/p+2:1)),a.setProps(l+m,"setTouch"))))}}function s(e){e.stopPropagation();var t=e.target._slider;if(t){if(t.animatingTo===t.currentSlide&&!y&&null!==m){var a=d?-m:m,n=t.getTarget(a>0?"next":"prev");t.canAdvance(n)&&(Number(new Date)-f<550&&Math.abs(a)>50||Math.abs(a)>p/2)?t.flexAnimate(n,t.vars.pauseOnAction):v||t.flexAnimate(t.currentSlide,t.vars.pauseOnAction,!0)}r=null,o=null,m=null,l=null,w=0}}var r,o,l,p,m,f,g,h,S,y=!1,x=0,b=0,w=0;i?(e.style.msTouchAction="none",e._gesture=new MSGesture,e._gesture.target=e,e.addEventListener("MSPointerDown",t,!1),e._slider=a,e.addEventListener("MSGestureChange",n,!1),e.addEventListener("MSGestureEnd",s,!1)):(g=function(t){a.animating?t.preventDefault():(window.navigator.msPointerEnabled||1===t.touches.length)&&(a.pause(),p=c?a.h:a.w,f=Number(new Date),x=t.touches[0].pageX,b=t.touches[0].pageY,l=u&&d&&a.animatingTo===a.last?0:u&&d?a.limit-(a.itemW+a.vars.itemMargin)*a.move*a.animatingTo:u&&a.currentSlide===a.last?a.limit:u?(a.itemW+a.vars.itemMargin)*a.move*a.currentSlide:d?(a.last-a.currentSlide+a.cloneOffset)*p:(a.currentSlide+a.cloneOffset)*p,r=c?b:x,o=c?x:b,e.addEventListener("touchmove",h,!1),e.addEventListener("touchend",S,!1))},h=function(e){x=e.touches[0].pageX,b=e.touches[0].pageY,m=c?r-b:r-x,y=c?Math.abs(m)<Math.abs(x-o):Math.abs(m)<Math.abs(b-o);var t=500;(!y||Number(new Date)-f>t)&&(e.preventDefault(),!v&&a.transitions&&(a.vars.animationLoop||(m/=0===a.currentSlide&&0>m||a.currentSlide===a.last&&m>0?Math.abs(m)/p+2:1),a.setProps(l+m,"setTouch")))},S=function(t){if(e.removeEventListener("touchmove",h,!1),a.animatingTo===a.currentSlide&&!y&&null!==m){var n=d?-m:m,i=a.getTarget(n>0?"next":"prev");a.canAdvance(i)&&(Number(new Date)-f<550&&Math.abs(n)>50||Math.abs(n)>p/2)?a.flexAnimate(i,a.vars.pauseOnAction):v||a.flexAnimate(a.currentSlide,a.vars.pauseOnAction,!0)}e.removeEventListener("touchend",S,!1),r=null,o=null,m=null,l=null},e.addEventListener("touchstart",g,!1))},resize:function(){!a.animating&&a.is(":visible")&&(u||a.doMath(),v?m.smoothHeight():u?(a.slides.width(a.computedW),a.update(a.pagingCount),a.setProps()):c?(a.viewport.height(a.h),a.setProps(a.h,"setTotal")):(a.vars.smoothHeight&&m.smoothHeight(),a.newSlides.width(a.computedW),a.setProps(a.computedW,"setTotal")))},smoothHeight:function(e){if(!c||v){var t=v?a:a.viewport;e?t.animate({height:a.slides.eq(a.animatingTo).height()},e):t.height(a.slides.eq(a.animatingTo).height())}},sync:function(e){var t=$(a.vars.sync).data("flexslider"),n=a.animatingTo;switch(e){case"animate":t.flexAnimate(n,a.vars.pauseOnAction,!1,!0);break;case"play":t.playing||t.asNav||t.play();break;case"pause":t.pause()}},uniqueID:function(e){return e.filter("[id]").add(e.find("[id]")).each(function(){var e=$(this);e.attr("id",e.attr("id")+"_clone")}),e},pauseInvisible:{visProp:null,init:function(){var e=m.pauseInvisible.getHiddenProp();if(e){var t=e.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(t,function(){m.pauseInvisible.isHidden()?a.startTimeout?clearTimeout(a.startTimeout):a.pause():a.started?a.play():a.vars.initDelay>0?setTimeout(a.play,a.vars.initDelay):a.play()})}},isHidden:function(){var e=m.pauseInvisible.getHiddenProp();return e?document[e]:!1},getHiddenProp:function(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;t<e.length;t++)if(e[t]+"Hidden"in document)return e[t]+"Hidden";return null}},setToClearWatchedEvent:function(){clearTimeout(l),l=setTimeout(function(){o=""},3e3)}},a.flexAnimate=function(e,t,i,r,o){if(a.vars.animationLoop||e===a.currentSlide||(a.direction=e>a.currentSlide?"next":"prev"),p&&1===a.pagingCount&&(a.direction=a.currentItem<e?"next":"prev"),!a.animating&&(a.canAdvance(e,o)||i)&&a.is(":visible")){if(p&&r){var l=$(a.vars.asNavFor).data("flexslider");if(a.atEnd=0===e||e===a.count-1,l.flexAnimate(e,!0,!1,!0,o),a.direction=a.currentItem<e?"next":"prev",l.direction=a.direction,Math.ceil((e+1)/a.visible)-1===a.currentSlide||0===e)return a.currentItem=e,a.slides.removeClass(n+"active-slide").eq(e).addClass(n+"active-slide"),!1;a.currentItem=e,a.slides.removeClass(n+"active-slide").eq(e).addClass(n+"active-slide"),e=Math.floor(e/a.visible)}if(a.animating=!0,a.animatingTo=e,t&&a.pause(),a.vars.before(a),a.syncExists&&!o&&m.sync("animate"),a.vars.controlNav&&m.controlNav.active(),u||a.slides.removeClass(n+"active-slide").eq(e).addClass(n+"active-slide"),a.atEnd=0===e||e===a.last,a.vars.directionNav&&m.directionNav.update(),e===a.last&&(a.vars.end(a),a.vars.animationLoop||a.pause()),v)s?(a.slides.eq(a.currentSlide).css({opacity:0,zIndex:1}),a.slides.eq(e).css({opacity:1,zIndex:2}),a.wrapup(f)):(a.slides.eq(a.currentSlide).css({zIndex:1}).animate({opacity:0},a.vars.animationSpeed,a.vars.easing),a.slides.eq(e).css({zIndex:2}).animate({opacity:1},a.vars.animationSpeed,a.vars.easing,a.wrapup));else{var f=c?a.slides.filter(":first").height():a.computedW,g,h,S;u?(g=a.vars.itemMargin,S=(a.itemW+g)*a.move*a.animatingTo,h=S>a.limit&&1!==a.visible?a.limit:S):h=0===a.currentSlide&&e===a.count-1&&a.vars.animationLoop&&"next"!==a.direction?d?(a.count+a.cloneOffset)*f:0:a.currentSlide===a.last&&0===e&&a.vars.animationLoop&&"prev"!==a.direction?d?0:(a.count+1)*f:d?(a.count-1-e+a.cloneOffset)*f:(e+a.cloneOffset)*f,a.setProps(h,"",a.vars.animationSpeed),a.transitions?(a.vars.animationLoop&&a.atEnd||(a.animating=!1,a.currentSlide=a.animatingTo),a.container.unbind("webkitTransitionEnd transitionend"),a.container.bind("webkitTransitionEnd transitionend",function(){clearTimeout(a.ensureAnimationEnd),a.wrapup(f)}),clearTimeout(a.ensureAnimationEnd),a.ensureAnimationEnd=setTimeout(function(){a.wrapup(f)},a.vars.animationSpeed+100)):a.container.animate(a.args,a.vars.animationSpeed,a.vars.easing,function(){a.wrapup(f)})}a.vars.smoothHeight&&m.smoothHeight(a.vars.animationSpeed)}},a.wrapup=function(e){v||u||(0===a.currentSlide&&a.animatingTo===a.last&&a.vars.animationLoop?a.setProps(e,"jumpEnd"):a.currentSlide===a.last&&0===a.animatingTo&&a.vars.animationLoop&&a.setProps(e,"jumpStart")),a.animating=!1,a.currentSlide=a.animatingTo,a.vars.after(a)},a.animateSlides=function(){!a.animating&&f&&a.flexAnimate(a.getTarget("next"))},a.pause=function(){clearInterval(a.animatedSlides),a.animatedSlides=null,a.playing=!1,a.vars.pausePlay&&m.pausePlay.update("play"),a.syncExists&&m.sync("pause")},a.play=function(){a.playing&&clearInterval(a.animatedSlides),a.animatedSlides=a.animatedSlides||setInterval(a.animateSlides,a.vars.slideshowSpeed),a.started=a.playing=!0,a.vars.pausePlay&&m.pausePlay.update("pause"),a.syncExists&&m.sync("play")},a.stop=function(){a.pause(),a.stopped=!0},a.canAdvance=function(e,t){var n=p?a.pagingCount-1:a.last;return t?!0:p&&a.currentItem===a.count-1&&0===e&&"prev"===a.direction?!0:p&&0===a.currentItem&&e===a.pagingCount-1&&"next"!==a.direction?!1:e!==a.currentSlide||p?a.vars.animationLoop?!0:a.atEnd&&0===a.currentSlide&&e===n&&"next"!==a.direction?!1:a.atEnd&&a.currentSlide===n&&0===e&&"next"===a.direction?!1:!0:!1},a.getTarget=function(e){return a.direction=e,"next"===e?a.currentSlide===a.last?0:a.currentSlide+1:0===a.currentSlide?a.last:a.currentSlide-1},a.setProps=function(e,t,n){var i=function(){var n=e?e:(a.itemW+a.vars.itemMargin)*a.move*a.animatingTo,i=function(){if(u)return"setTouch"===t?e:d&&a.animatingTo===a.last?0:d?a.limit-(a.itemW+a.vars.itemMargin)*a.move*a.animatingTo:a.animatingTo===a.last?a.limit:n;switch(t){case"setTotal":return d?(a.count-1-a.currentSlide+a.cloneOffset)*e:(a.currentSlide+a.cloneOffset)*e;case"setTouch":return d?e:e;case"jumpEnd":return d?e:a.count*e;case"jumpStart":return d?a.count*e:e;default:return e}}();return-1*i+"px"}();a.transitions&&(i=c?"translate3d(0,"+i+",0)":"translate3d("+i+",0,0)",n=void 0!==n?n/1e3+"s":"0s",a.container.css("-"+a.pfx+"-transition-duration",n),a.container.css("transition-duration",n)),a.args[a.prop]=i,(a.transitions||void 0===n)&&a.container.css(a.args),a.container.css("transform",i)},a.setup=function(e){if(v)a.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===e&&(s?a.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+a.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(a.currentSlide).css({opacity:1,zIndex:2}):0==a.vars.fadeFirstSlide?a.slides.css({opacity:0,display:"block",zIndex:1}).eq(a.currentSlide).css({zIndex:2}).css({opacity:1}):a.slides.css({opacity:0,display:"block",zIndex:1}).eq(a.currentSlide).css({zIndex:2}).animate({opacity:1},a.vars.animationSpeed,a.vars.easing)),a.vars.smoothHeight&&m.smoothHeight();else{var t,i;"init"===e&&(a.viewport=$('<div class="'+n+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(a).append(a.container),a.cloneCount=0,a.cloneOffset=0,d&&(i=$.makeArray(a.slides).reverse(),a.slides=$(i),a.container.empty().append(a.slides))),a.vars.animationLoop&&!u&&(a.cloneCount=2,a.cloneOffset=1,"init"!==e&&a.container.find(".clone").remove(),a.container.append(m.uniqueID(a.slides.first().clone().addClass("clone")).attr("aria-hidden","true")).prepend(m.uniqueID(a.slides.last().clone().addClass("clone")).attr("aria-hidden","true"))),a.newSlides=$(a.vars.selector,a),t=d?a.count-1-a.currentSlide+a.cloneOffset:a.currentSlide+a.cloneOffset,c&&!u?(a.container.height(200*(a.count+a.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){a.newSlides.css({display:"block"}),a.doMath(),a.viewport.height(a.h),a.setProps(t*a.h,"init")},"init"===e?100:0)):(a.container.width(200*(a.count+a.cloneCount)+"%"),a.setProps(t*a.computedW,"init"),setTimeout(function(){a.doMath(),a.newSlides.css({width:a.computedW,"float":"left",display:"block"}),a.vars.smoothHeight&&m.smoothHeight()},"init"===e?100:0))}u||a.slides.removeClass(n+"active-slide").eq(a.currentSlide).addClass(n+"active-slide"),a.vars.init(a)},a.doMath=function(){var e=a.slides.first(),t=a.vars.itemMargin,n=a.vars.minItems,i=a.vars.maxItems;a.w=void 0===a.viewport?a.width():a.viewport.width(),a.h=e.height(),a.boxPadding=e.outerWidth()-e.width(),u?(a.itemT=a.vars.itemWidth+t,a.minW=n?n*a.itemT:a.w,a.maxW=i?i*a.itemT-t:a.w,a.itemW=a.minW>a.w?(a.w-t*(n-1))/n:a.maxW<a.w?(a.w-t*(i-1))/i:a.vars.itemWidth>a.w?a.w:a.vars.itemWidth,a.visible=Math.floor(a.w/a.itemW),a.move=a.vars.move>0&&a.vars.move<a.visible?a.vars.move:a.visible,a.pagingCount=Math.ceil((a.count-a.visible)/a.move+1),a.last=a.pagingCount-1,a.limit=1===a.pagingCount?0:a.vars.itemWidth>a.w?a.itemW*(a.count-1)+t*(a.count-1):(a.itemW+t)*a.count-a.w-t):(a.itemW=a.w,a.pagingCount=a.count,a.last=a.count-1),a.computedW=a.itemW-a.boxPadding},a.update=function(e,t){a.doMath(),u||(e<a.currentSlide?a.currentSlide+=1:e<=a.currentSlide&&0!==e&&(a.currentSlide-=1),a.animatingTo=a.currentSlide),a.vars.c
1925ontrolNav&&!a.manualControls&&("add"===t&&!u||a.pagingCount>a.controlNav.length?m.controlNav.update("add"):("remove"===t&&!u||a.pagingCount<a.controlNav.length)&&(u&&a.currentSlide>a.last&&(a.currentSlide-=1,a.animatingTo-=1),m.controlNav.update("remove",a.last))),a.vars.directionNav&&m.directionNav.update()},a.addSlide=function(e,t){var n=$(e);a.count+=1,a.last=a.count-1,c&&d?void 0!==t?a.slides.eq(a.count-t).after(n):a.container.prepend(n):void 0!==t?a.slides.eq(t).before(n):a.container.append(n),a.update(t,"add"),a.slides=$(a.vars.selector+":not(.clone)",a),a.setup(),a.vars.added(a)},a.removeSlide=function(e){var t=isNaN(e)?a.slides.index($(e)):e;a.count-=1,a.last=a.count-1,isNaN(e)?$(e,a.slides).remove():c&&d?a.slides.eq(a.last).remove():a.slides.eq(e).remove(),a.doMath(),a.update(t,"remove"),a.slides=$(a.vars.selector+":not(.clone)",a),a.setup(),a.vars.removed(a)},m.init()},$(window).blur(function(e){focused=!1}).focus(function(e){focused=!0}),$.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,fadeFirstSlide:!0,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:"",customDirectionNav:"",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(){},init:function(){}},$.fn.flexslider=function(e){if(void 0===e&&(e={}),"object"==typeof e)return this.each(function(){var t=$(this),a=e.selector?e.selector:".slides > li",n=t.find(a);1===n.length&&e.allowOneSlide===!0||0===n.length?(n.fadeIn(400),e.start&&e.start(t)):void 0===t.data("flexslider")&&new $.flexslider(this,e)});var t=$(this).data("flexslider");switch(e){case"play":t.play();break;case"pause":t.pause();break;case"stop":t.stop();break;case"next":t.flexAnimate(t.getTarget("next"),!0);break;case"prev":case"previous":t.flexAnimate(t.getTarget("prev"),!0);break;default:"number"==typeof e&&t.flexAnimate(e,!0)}}}(jQuery);;/**/ 1926(function ($) { 1927 1928Drupal.googleanalytics = {}; 1929 1930$(document).ready(function() { 1931 1932 // Attach mousedown, keyup, touchstart events to document only and catch 1933 // clicks on all elements. 1934 $(document.body).bind("mousedown keyup touchstart", function(event) { 1935 1936 // Catch the closest surrounding link of a clicked element. 1937 $(event.target).closest("a,area").each(function() { 1938 1939 // Is the clicked URL internal? 1940 if (Drupal.googleanalytics.isInternal(this.href)) { 1941 // Skip 'click' tracking, if custom tracking events are bound. 1942 if ($(this).is('.colorbox') && (Drupal.settings.googleanalytics.trackColorbox)) { 1943 // Do nothing here. The custom event will handle all tracking. 1944 //console.info("Click on .colorbox item has been detected."); 1945 } 1946 // Is download tracking activated and the file extension configured for download tracking? 1947 else if (Drupal.settings.googleanalytics.trackDownload && Drupal.googleanalytics.isDownload(this.href)) { 1948 // Download link clicked. 1949 ga("send", { 1950 "hitType": "event", 1951 "eventCategory": "Downloads", 1952 "eventAction": Drupal.googleanalytics.getDownloadExtension(this.href).toUpperCase(), 1953 "eventLabel": Drupal.googleanalytics.getPageUrl(this.href), 1954 "transport": "beacon" 1955 }); 1956 } 1957 else if (Drupal.googleanalytics.isInternalSpecial(this.href)) { 1958 // Keep the internal URL for Google Analytics website overlay intact. 1959 ga("send", { 1960 "hitType": "pageview", 1961 "page": Drupal.googleanalytics.getPageUrl(this.href), 1962 "transport": "beacon" 1963 }); 1964 } 1965 } 1966 else { 1967 if (Drupal.settings.googleanalytics.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) { 1968 // Mailto link clicked. 1969 ga("send", { 1970 "hitType": "event", 1971 "eventCategory": "Mails", 1972 "eventAction": "Click", 1973 "eventLabel": this.href.substring(7), 1974 "transport": "beacon" 1975 }); 1976 } 1977 else if (Drupal.settings.googleanalytics.trackOutbound && this.href.match(/^\w+:\/\//i)) { 1978 if (Drupal.settings.googleanalytics.trackDomainMode !== 2 || (Drupal.settings.googleanalytics.trackDomainMode === 2 && !Drupal.googleanalytics.isCrossDomain(this.hostname, Drupal.settings.googleanalytics.trackCrossDomains))) { 1979 // External link clicked / No top-level cross domain clicked. 1980 ga("send", { 1981 "hitType": "event", 1982 "eventCategory": "Outbound links", 1983 "eventAction": "Click", 1984 "eventLabel": this.href, 1985 "transport": "beacon" 1986 }); 1987 } 1988 } 1989 } 1990 }); 1991 }); 1992 1993 // Track hash changes as unique pageviews, if this option has been enabled. 1994 if (Drupal.settings.googleanalytics.trackUrlFragments) { 1995 window.onhashchange = function() { 1996 ga("send", { 1997 "hitType": "pageview", 1998 "page": location.pathname + location.search + location.hash 1999 }); 2000 }; 2001 } 2002 2003 // Colorbox: This event triggers when the transition has completed and the 2004 // newly loaded content has been revealed. 2005 if (Drupal.settings.googleanalytics.trackColorbox) { 2006 $(document).bind("cbox_complete", function () {
2007 var href = $.colorbox.element().attr("href"); 2008 if (href) { 2009 ga("send", { 2010 "hitType": "pageview", 2011 "page": Drupal.googleanalytics.getPageUrl(href) 2012 }); 2013 } 2014 }); 2015 } 2016 2017}); 2018 2019/** 2020 * Check whether the hostname is part of the cross domains or not. 2021 * 2022 * @param string hostname 2023 * The hostname of the clicked URL. 2024 * @param array crossDomains 2025 * All cross domain hostnames as JS array. 2026 * 2027 * @return boolean 2028 */ 2029Drupal.googleanalytics.isCrossDomain = function (hostname, crossDomains) { 2030 /** 2031 * jQuery < 1.6.3 bug: $.inArray crushes IE6 and Chrome if second argument is 2032 * `null` or `undefined`, https://bugs.jquery.com/ticket/10076, 2033 * https://github.com/jquery/jquery/commit/a839af034db2bd934e4d4fa6758a3fed8de74174 2034 * 2035 * @todo: Remove/Refactor in D8 2036 */ 2037 if (!crossDomains) { 2038 return false; 2039 } 2040 else { 2041 return $.inArray(hostname, crossDomains) > -1 ? true : false; 2042 } 2043}; 2044 2045/** 2046 * Check whether this is a download URL or not. 2047 * 2048 * @param string url 2049 * The web url to check. 2050 * 2051 * @return boolean 2052 */ 2053Drupal.googleanalytics.isDownload = function (url) { 2054 var isDownload = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i"); 2055 return isDownload.test(url); 2056}; 2057 2058/** 2059 * Check whether this is an absolute internal URL or not. 2060 * 2061 * @param string url 2062 * The web url to check. 2063 * 2064 * @return boolean 2065 */ 2066Drupal.googleanalytics.isInternal = function (url) { 2067 var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i"); 2068 return isInternal.test(url); 2069}; 2070 2071/** 2072 * Check whether this is a special URL or not. 2073 * 2074 * URL types: 2075 * - gotwo.module /go/* links. 2076 * 2077 * @param string url 2078 * The web url to check. 2079 * 2080 * @return boolean 2081 */ 2082Drupal.googleanalytics.isInternalSpecial = function (url) { 2083 var isInternalSpecial = new RegExp("(\/go\/.*)$", "i"); 2084 return isInternalSpecial.test(url); 2085}; 2086 2087/** 2088 * Extract the relative internal URL from an absolute internal URL. 2089 * 2090 * Examples: 2091 * - https://mydomain.com/node/1 -> /node/1 2092 * - https://example.com/foo/bar -> https://example.com/foo/bar 2093 * 2094 * @param string url 2095 * The web url to check. 2096 * 2097 * @return string 2098 * Internal website URL 2099 */ 2100Drupal.googleanalytics.getPageUrl = function (url) { 2101 var extractInternalUrl = new RegExp("^(https?):\/\/" + window.location.host, "i"); 2102 return url.replace(extractInternalUrl, ''); 2103}; 2104 2105/** 2106 * Extract the download file extension from the URL. 2107 * 2108 * @param string url 2109 * The web url to check. 2110 * 2111 * @return string 2112 * The file extension of the passed url. e.g. "zip", "txt" 2113 */ 2114Drupal.googleanalytics.getDownloadExtension = function (url) { 2115 var extractDownloadextension = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i"); 2116 var extension = extractDownloadextension.exec(url); 2117 return (extension === null) ? '' : extension[1]; 2118}; 2119 2120})(jQuery); 2121;/**/
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.