1(function ($) { 2 3 Drupal.behaviors.bionicMally = { 4 attach: function (context, settings) { 5 // Tell jQuery that our div is to be a dialog 6 $('.dialog').hide(); 7 $('.dialog-open').click(function () { 8 $('.dialog').toggle('200'); 9 }); 10 11 // $('#iludkt-iludkt').focus(function(){ 12 // if($(this).val()=='email...'){ 13 // $(this).val(''); 14 // } 15 // }); 16 // $('#name').focus(function(){ 17 // if($(this).val()=='name...'){ 18 // $(this).val(''); 19 // } 20 // }); 21 // This shipping ad block is no longer used. // 22 var shipAnimRight = 0; 23 $('#ship-anim').css('position', 'relative'); 24 $('#ship-anim').css('left', 1000); 25 $('#ship-anim').animate({ 26 left: '-=1000'}, 2000, function(){ 27 }); 28 29 // Quick Shop Overlay 30 // This is now a bootstrap modal. Below is an attempt to make it work for 31 // bib with "add a name" attribute. This is not possible without refactor 32 // of studio js code that controls the elements of the studio ui. They 33 // were not designed to have multiple products on the page. The whole 34 // studio should be refactored to use siblings and find methods for with 35 // selectors. 36 37 // $('a.quick-shop-open').click( function () { 38 // $(this).siblings('.modal').find('.studio-option-container').hide(); 39 // $(this).siblings('.modal').find('#edit-attributes-field-add-a-name-').val(''); 40 // }); 41 // $('a.quick-shop-close').click( function () { 42 // $(this).parent('.quick-shop-inner').parent('.quick-shop').fadeOut('fast'); 43 // }); 44 } 45 } 46})(jQuery); 47; 48/*! 49 Colorbox v1.4.31 - 2013-09-25 50 jQuery lightbox and modal window plugin 51 (c) 2013 Jack Moore - http://www.jacklmoore.com/colorbox 52 license: http://www.opensource.org/licenses/mit-license.php 53*/ 54(function(e,t,i){function o(i,o,n){var r=t.createElement(i);return o&&(r.id=Z+o),n&&(r.style.cssText=n),e(r)}function n(){return i.innerHeight?i.innerHeight:e(i).height()}function r(e){var t=k.length,i=(z+e)%t;return 0>i?t+i:i}function h(e,t){return Math.round((/%/.test(e)?("x"===t?E.width():n())/100:1)*parseInt(e,10))}function s(e,t){return e.photo||e.photoRegex.test(t)}function l(e,t){return e.retinaUrl&&i.devicePixelRatio>1?t.replace(e.photoRegex,e.retinaSuffix):t}function a(e){"contains"in g[0]&&!g[0].contains(e.target)&&(e.stopPropagation(),g.focus())}function d(){var t,i=e.data(N,Y);null==i?(B=e.extend({},X),console&&console.log&&console.log("Error: cboxElement missing settings object")):B=e.extend({},i);for(t in B)e.isFunction(B[t])&&"on"!==t.slice(0,2)&&(B[t]=B[t].call(N));B.rel=B.rel||N.rel||e(N).data("rel")||"nofollow",B.href=B.href||e(N).attr("href"),B.title=B.title||N.title,"string"==typeof B.href&&(B.href=e.trim(B.href))}function c(i,o){e(t).trigger(i),st.trigger(i),e.isFunction(o)&&o.call(N)}function u(i){q||(N=i,d(),k=e(N),z=0,"nofollow"!==B.rel&&(k=e("."+et).filter(function(){var t,i=e.data(this,Y);return i&&(t=e(this).data("rel")||i.rel||this.rel),t===B.rel}),z=k.index(N),-1===z&&(k=k.add(N),z=k.length-1)),w.css({opacity:parseFloat(B.opacity),cursor:B.overlayClose?"pointer":"auto",visibility:"visible"}).show(),J&&g.add(w).removeClass(J),B.className&&g.add(w).addClass(B.className),J=B.className,B.closeButton?K.html(B.close).appendTo(y):K.appendTo("<div/>"),U||(U=$=!0,g.css({visibility:"hidden",display:"block"}),H=o(lt,"LoadedContent","width:0; height:0; overflow:hidden"),y.css({width:"",height:""}).append(H),O=x.height()+C.height()+y.outerHeight(!0)-y.height(),_=b.width()+T.width()+y.outerWidth(!0)-y.width(),D=H.outerHeight(!0),A=H.outerWidth(!0),B.w=h(B.initialWidth,"x"),B.h=h(B.initialHeight,"y"),H.css({width:"",height:B.h}),Q.position(),c(tt,B.onOpen),P.add(L).hide(),g.focus(),B.trapFocus&&t.addEventListener&&(t.addEventListener("focus",a,!0),st.one(rt,function(){t.removeEventListener("focus",a,!0)})),B.returnFocus&&st.one(rt,function(){e(N).focus()})),m())}function f(){!g&&t.body&&(V=!1,E=e(i),g=o(lt).attr({id:Y,"class":e.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),w=o(lt,"Overlay").hide(),F=e([o(lt,"LoadingOverlay")[0],o(lt,"LoadingGraphic")[0]]),v=o(lt,"Wrapper"),y=o(lt,"Content").append(L=o(lt,"Title"),S=o(lt,"Current"),I=e('<button type="button"/>').attr({id:Z+"Previous"}),R=e('<button type="button"/>').attr({id:Z+"Next"}),M=o("button","Slideshow"),F),K=e('<button type="button"/>').attr({id:Z+"Close"}),v.append(o(lt).append(o(lt,"TopLeft"),x=o(lt,"TopCenter"),o(lt,"TopRight")),o(lt,!1,"clear:left").append(b=o(lt,"MiddleLeft"),y,T=o(lt,"MiddleRight")),o(lt,!1,"clear:left").append(o(lt,"BottomLeft"),C=o(lt,"BottomCenter"),o(lt,"BottomRight"))).find("div div").css({"float":"left"}),W=o(lt,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),P=R.add(I).add(S).add(M),e(t.body).append(w,g.append(v,W)))}function p(){function i(e){e.which>1||e.shiftKey||e.altKey||e.metaKey||e.ctrlKey||(e.preventDefault(),u(this))}return g?(V||(V=!0,R.click(function(){Q.next()}),I.click(function(){Q.prev()}),K.click(function(){Q.close()}),w.click(function(){B.overlayClose&&Q.close()}),e(t).bind("keydown."+Z,function(e){var t=e.keyCode;U&&B.escKey&&27===t&&(e.preventDefault(),Q.close()),U&&B.arrowKey&&k[1]&&!e.altKey&&
54(37===t?(e.preventDefault(),I.click()):39===t&&(e.preventDefault(),R.click()))}),e.isFunction(e.fn.on)?e(t).on("click."+Z,"."+et,i):e("."+et).live("click."+Z,i)),!0):!1}function m(){var n,r,a,u=Q.prep,f=++at;$=!0,j=!1,N=k[z],d(),c(ht),c(it,B.onLoad),B.h=B.height?h(B.height,"y")-D-O:B.innerHeight&&h(B.innerHeight,"y"),B.w=B.width?h(B.width,"x")-A-_:B.innerWidth&&h(B.innerWidth,"x"),B.mw=B.w,B.mh=B.h,B.maxWidth&&(B.mw=h(B.maxWidth,"x")-A-_,B.mw=B.w&&B.w<B.mw?B.w:B.mw),B.maxHeight&&(B.mh=h(B.maxHeight,"y")-D-O,B.mh=B.h&&B.h<B.mh?B.h:B.mh),n=B.href,G=setTimeout(function(){F.show()},100),B.inline?(a=o(lt).hide().insertBefore(e(n)[0]),st.one(ht,function(){a.replaceWith(H.children())}),u(e(n))):B.iframe?u(" "):B.html?u(B.html):s(B,n)?(n=l(B,n),j=t.createElement("img"),e(j).addClass(Z+"Photo").bind("error",function(){B.title=!1,u(o(lt,"Error").html(B.imgError))}).one("load",function(){var t;f===at&&(e.each(["alt","longdesc","aria-describedby"],function(t,i){var o=e(N).attr(i)||e(N).attr("data-"+i);o&&j.setAttribute(i,o)}),B.retinaImage&&i.devicePixelRatio>1&&(j.height=j.height/i.devicePixelRatio,j.width=j.width/i.devicePixelRatio),B.scalePhotos&&(r=function(){j.height-=j.height*t,j.width-=j.width*t},B.mw&&j.width>B.mw&&(t=(j.width-B.mw)/j.width,r()),B.mh&&j.height>B.mh&&(t=(j.height-B.mh)/j.height,r())),B.h&&(j.style.marginTop=Math.max(B.mh-j.height,0)/2+"px"),k[1]&&(B.loop||k[z+1])&&(j.style.cursor="pointer",j.onclick=function(){Q.next()}),j.style.width=j.width+"px",j.style.height=j.height+"px",setTimeout(function(){u(j)},1))}),setTimeout(function(){j.src=n},1)):n&&W.load(n,B.data,function(t,i){f===at&&u("error"===i?o(lt,"Error").html(B.xhrError):e(this).contents())})}var w,g,v,y,x,b,T,C,k,E,H,W,F,L,S,M,R,I,K,P,B,O,_,D,A,N,z,j,U,$,q,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1},Y="colorbox",Z="cbox",et=Z+"Element",tt=Z+"_open",it=Z+"_load",ot=Z+"_complete",nt=Z+"_cleanup",rt=Z+"_closed",ht=Z+"_purge",st=e("<a/>"),lt="div",at=0,dt={},ct=function(){function e(){clearTimeout(h)}function t(){(B.loop||k[z+1])&&(e(),h=setTimeout(Q.next,B.slideshowSpeed))}function i(){M.html(B.slideshowStop).unbind(l).one(l,o),st.bind(ot,t).bind(it,e),g.removeClass(s+"off").addClass(s+"on")}function o(){e(),st.unbind(ot,t).unbind(it,e),M.html(B.slideshowStart).unbind(l).one(l,function(){Q.next(),i()}),g.removeClass(s+"on").addClass(s+"off")}function n(){r=!1,M.hide(),e(),st.unbind(ot,t).unbind(it,e),g.removeClass(s+"off "+s+"on")}var r,h,s=Z+"Slideshow_",l="click."+Z;return function(){r?B.slideshow||(st.unbind(nt,n),n()):B.slideshow&&k[1]&&(r=!0,st.one(nt,n),B.slideshowAuto?i():o(),M.show())}}();e.colorbox||(e(f),Q=e.fn[Y]=e[Y]=function(t,i){var o=this;if(t=t||{},f(),p()){if(e.isFunction(o))o=e("<a/>"),t.open=!0;else if(!o[0])return o;i&&(t.onComplete=i),o.each(function(){e.data(this,Y,e.extend({},e.data(this,Y)||X,t))}).addClass(et),(e.isFunction(t.open)&&t.open.call(o)||t.open)&&u(o[0])}return o},Q.position=function(t,i){function o(){x[0].style.width=C[0].style.width=y[0].style.width=parseInt(g[0].style.width,10)-_+"px",y[0].style.height=b[0].style.height=T[0].style.height=parseInt(g[0].style.height,10)-O+"px"}var r,s,l,a=0,d=0,c=g.offset();if(E.unbind("resize."+Z),g.css({top:-9e4,left:-9e4}),s=E.scrollTop(),l=E.scrollLeft(),B.fixed?(c.top-=s,c.left-=l,g.css({position:"fixed"})):(a=s,d=l,g.css({position:"absolute"})),d+=B.right!==!1?Math.max(E.width()-B.w-A-_-h(B.right,"x"),0):B.left!==!1?h(B.left,"x"):Math.round(Math.max(E.width()-B.w-A-_,0)/2),a+=B.bottom!==!1?Math.max(n()-B.h-D-O-h(B.bottom,"y"),0):B.top!==!1?h(B.top,"y"):Math.round(Math.max(n()-B.h-D-O,0)/2),g.css({top:c.top,left
54:c.left,visibility:"visible"}),v[0].style.width=v[0].style.height="9999px",r={width:B.w+A+_,height:B.h+D+O,top:a,left:d},t){var u=0;e.each(r,function(e){return r[e]!==dt[e]?(u=t,void 0):void 0}),t=u}dt=r,t||g.css(r),g.dequeue().animate(r,{duration:t||0,complete:function(){o(),$=!1,v[0].style.width=B.w+A+_+"px",v[0].style.height=B.h+D+O+"px",B.reposition&&setTimeout(function(){E.bind("resize."+Z,Q.position)},1),i&&i()},step:o})},Q.resize=function(e){var t;U&&(e=e||{},e.width&&(B.w=h(e.width,"x")-A-_),e.innerWidth&&(B.w=h(e.innerWidth,"x")),H.css({width:B.w}),e.height&&(B.h=h(e.height,"y")-D-O),e.innerHeight&&(B.h=h(e.innerHeight,"y")),e.innerHeight||e.height||(t=H.scrollTop(),H.css({height:"auto"}),B.h=H.height()),H.css({height:B.h}),t&&H.scrollTop(t),Q.position("none"===B.transition?0:B.speed))},Q.prep=function(i){function n(){return B.w=B.w||H.width(),B.w=B.mw&&B.mw<B.w?B.mw:B.w,B.w}function h(){return B.h=B.h||H.height(),B.h=B.mh&&B.mh<B.h?B.mh:B.h,B.h}if(U){var a,d="none"===B.transition?0:B.speed;H.empty().remove(),H=o(lt,"LoadedContent").append(i),H.hide().appendTo(W.show()).css({width:n(),overflow:B.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(y),W.hide(),e(j).css({"float":"none"}),a=function(){function i(){e.support.opacity===!1&&g[0].style.removeAttribute("filter")}var n,h,a=k.length,u="frameBorder",f="allowTransparency";U&&(h=function(){clearTimeout(G),F.hide(),c(ot,B.onComplete)},L.html(B.title).add(H).show(),a>1?("string"==typeof B.current&&S.html(B.current.replace("{current}",z+1).replace("{total}",a)).show(),R[B.loop||a-1>z?"show":"hide"]().html(B.next),I[B.loop||z?"show":"hide"]().html(B.previous),ct(),B.preloading&&e.each([r(-1),r(1)],function(){var i,o,n=k[this],r=e.data(n,Y);r&&r.href?(i=r.href,e.isFunction(i)&&(i=i.call(n))):i=e(n).attr("href"),i&&s(r,i)&&(i=l(r,i),o=t.createElement("img"),o.src=i)})):P.hide(),B.iframe?(n=o("iframe")[0],u in n&&(n[u]=0),f in n&&(n[f]="true"),B.scrolling||(n.scrolling="no"),e(n).attr({src:B.href,name:(new Date).getTime(),"class":Z+"Iframe",allowFullScreen:!0,webkitAllowFullScreen:!0,mozallowfullscreen:!0}).one("load",h).appendTo(H),st.one(ht,function(){n.src="//about:blank"}),B.fastIframe&&e(n).trigger("load")):h(),"fade"===B.transition?g.fadeTo(d,1,i):i())},"fade"===B.transition?g.fadeTo(d,0,function(){Q.position(0,a)}):Q.position(d,a)}},Q.next=function(){!$&&k[1]&&(B.loop||k[z+1])&&(z=r(1),u(k[z]))},Q.prev=function(){!$&&k[1]&&(B.loop||z)&&(z=r(-1),u(k[z]))},Q.close=function(){U&&!q&&(q=!0,U=!1,c(nt,B.onCleanup),E.unbind("."+Z),w.fadeTo(B.fadeOut||0,0),g.stop().fadeTo(B.fadeOut||0,0,function(){g.add(w).css({opacity:1,cursor:"auto"}).hide(),c(ht),H.empty().remove(),setTimeout(function(){q=!1,c(rt,B.onClosed)},1)}))},Q.remove=function(){g&&(g.stop(),e.colorbox.close(),g.stop().remove(),w.remove(),q=!1,g=null,e("."+et).removeData(Y).removeClass(et),e(t).unbind("click."+Z))},Q.element=function(){return e(N)},Q.settings=X)})(jQuery,document,window);; 55(function ($) { 56 57Drupal.behaviors.initColorbox = { 58 attach: function (context, settings) { 59 if (!$.isFunction($.colorbox)) { 60 return; 61 } 62 $('.colorbox', context) 63 .once('init-colorbox') 64 .colorbox(settings.colorbox); 65 } 66}; 67 68{ 69 $(document).bind('cbox_complete', function () { 70 Drupal.attachBehaviors('#cboxLoadedContent'); 71 }); 72} 73 74})(jQuery); 75; 76(function ($) { 77 78Drupal.behaviors.initColorboxDefaultStyle = { 79 attach: function (context, settings) { 80 $(document).bind('cbox_complete', function () { 81 // Only run if there is a title. 82 if ($('#cboxTitle:empty', context).length == false) { 83 $('#cboxLoadedContent img', context).bind('mouseover', function () { 84 $('#cboxTitle', context).slideDown(); 85 }); 86 $('#cboxOverlay', context).bind('mouseover', function () { 87 $('#cboxTitle', context).slideUp(); 88 }); 89 } 90 else { 91 $('#cboxTitle', context).hide(); 92 } 93 }); 94 } 95}; 96 97})(jQuery); 98; 99(function ($) { 100 101Drupal.behaviors.initColorboxLoad = { 102 attach: function (context, settings) { 103 if (!$.isFunction($.colorbox)) { 104 return; 105 }
106 $.urlParams = function (url) { 107 var p = {}, 108 e, 109 a = /\+/g, // Regex for replacing addition symbol with a space 110 r = /([^&=]+)=?([^&]*)/g, 111 d = function (s) { return decodeURIComponent(s.replace(a, ' ')); }, 112 q = url.split('?'); 113 while (e = r.exec(q[1])) { 114 e[1] = d(e[1]); 115 e[2] = d(e[2]); 116 switch (e[2].toLowerCase()) { 117 case 'true': 118 case 'yes': 119 e[2] = true; 120 break; 121 case 'false': 122 case 'no': 123 e[2] = false; 124 break; 125 } 126 if (e[1] == 'width') { e[1] = 'innerWidth'; } 127 if (e[1] == 'height') { e[1] = 'innerHeight'; } 128 p[e[1]] = e[2]; 129 } 130 return p; 131 }; 132 $('.colorbox-load', context) 133 .once('init-colorbox-load', function () { 134 var params = $.urlParams($(this).attr('href')); 135 $(this).colorbox($.extend({}, settings.colorbox, params)); 136 }); 137 } 138}; 139 140})(jQuery); 141; 142(function ($) { 143 Drupal.viewsSlideshow = Drupal.viewsSlideshow || {}; 144 145 /** 146 * Views Slideshow Controls 147 */ 148 Drupal.viewsSlideshowControls = Drupal.viewsSlideshowControls || {}; 149 150 /** 151 * Implement the play hook for controls. 152 */ 153 Drupal.viewsSlideshowControls.play = function (options) { 154 // Route the control call to the correct control type. 155 // Need to use try catch so we don't have to check to make sure every part 156 // of the object is defined. 157 try { 158 if (typeof Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type].play == 'function') { 159 Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type].play(options); 160 } 161 } 162 catch(err) { 163 // Don't need to do anything on error. 164 } 165 166 try { 167 if (typeof Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type].play == 'function') { 168 Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type].play(options); 169 } 170 } 171 catch(err) { 172 // Don't need to do anything on error. 173 } 174 }; 175 176 /** 177 * Implement the pause hook for controls. 178 */ 179 Drupal.viewsSlideshowControls.pause = function (options) { 180 // Route the control call to the correct control type. 181 // Need to use try catch so we don't have to check to make sure every part 182 // of the object is defined. 183 try { 184 if (typeof Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type].pause == 'function') { 185 Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type].pause(options); 186 } 187 } 188 catch(err) { 189 // Don't need to do anything on error. 190 } 191 192 try { 193 if (typeof Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type].pause == 'function') { 194 Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type].pause(options); 195 } 196 } 197 catch(err) { 198 // Don't need to do anything on error. 199 } 200 }; 201 202 203 /** 204 * Views Slideshow Text Controls 205 */ 206 207 // Add views slieshow api calls for views slideshow text controls. 208 Drupal.behaviors.viewsSlideshowControlsText = { 209 attach: function (context) { 210 211 // Process previous link 212 $('.views_slideshow_controls_text_previous:not(.views-slideshow-controls-text-previous-processed)', context).addClass('views-slideshow-controls-text-previous-processed').each(function() { 213 var uniqueID = $(this).attr('id').replace('views_slideshow_controls_text_previous_', ''); 214 $(this).click(function() { 215 Drupal.viewsSlideshow.action({ "action": 'previousSlide', "slideshowID": uniqueID }); 216 return false; 217 }); 218 }); 219 220 // Process next link
221 $('.views_slideshow_controls_text_next:not(.views-slideshow-controls-text-next-processed)', context).addClass('views-slideshow-controls-text-next-processed').each(function() { 222 var uniqueID = $(this).attr('id').replace('views_slideshow_controls_text_next_', ''); 223 $(this).click(function() { 224 Drupal.viewsSlideshow.action({ "action": 'nextSlide', "slideshowID": uniqueID }); 225 return false; 226 }); 227 }); 228 229 // Process pause link 230 $('.views_slideshow_controls_text_pause:not(.views-slideshow-controls-text-pause-processed)', context).addClass('views-slideshow-controls-text-pause-processed').each(function() { 231 var uniqueID = $(this).attr('id').replace('views_slideshow_controls_text_pause_', ''); 232 $(this).click(function() { 233 if (Drupal.settings.viewsSlideshow[uniqueID].paused) { 234 Drupal.viewsSlideshow.action({ "action": 'play', "slideshowID": uniqueID, "force": true }); 235 } 236 else { 237 Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": uniqueID, "force": true }); 238 } 239 return false; 240 }); 241 }); 242 } 243 }; 244 245 Drupal.viewsSlideshowControlsText = Drupal.viewsSlideshowControlsText || {}; 246 247 /** 248 * Implement the pause hook for text controls. 249 */ 250 Drupal.viewsSlideshowControlsText.pause = function (options) { 251 var pauseText = '|>'; //Drupal.theme.prototype['viewsSlideshowControlsPause'] ? Drupal.theme('viewsSlideshowControlsPause') : ''; 252 $('#views_slideshow_controls_text_pause_' + options.slideshowID + ' a').text(pauseText); 253 }; 254 255 /** 256 * Implement the play hook for text controls. 257 */ 258 Drupal.viewsSlideshowControlsText.play = function (options) { 259 var playText = '||'; //Drupal.theme.prototype['viewsSlideshowControlsPlay'] ? Drupal.theme('viewsSlideshowControlsPlay') : ''; 260 $('#views_slideshow_controls_text_pause_' + options.slideshowID + ' a').text(playText); 261 }; 262 263 // Theme the resume control. 264 Drupal.theme.prototype.viewsSlideshowControlsPause = function () { 265 return Drupal.t('Resume'); 266 }; 267 268 // Theme the pause control. 269 Drupal.theme.prototype.viewsSlideshowControlsPlay = function () { 270 return Drupal.t('Pause'); 271 }; 272 273 /** 274 * Views Slideshow Pager 275 */ 276 Drupal.viewsSlideshowPager = Drupal.viewsSlideshowPager || {}; 277 278 /** 279 * Implement the transitionBegin hook for pagers. 280 */ 281 Drupal.viewsSlideshowPager.transitionBegin = function (options) { 282 // Route the pager call to the correct pager type. 283 // Need to use try catch so we don't have to check to make sure every part 284 // of the object is defined. 285 try { 286 if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].transitionBegin == 'function') { 287 Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].transitionBegin(options); 288 } 289 } 290 catch(err) { 291 // Don't need to do anything on error. 292 } 293 294 try { 295 if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type].transitionBegin == 'function') { 296 Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type].transitionBegin(options); 297 } 298 } 299 catch(err) { 300 // Don't need to do anything on error. 301 } 302 }; 303 304 /** 305 * Implement the goToSlide hook for pagers. 306 */ 307 Drupal.viewsSlideshowPager.goToSlide = function (options) { 308 // Route the pager call to the correct pager type. 309 // Need to use try catch so we don't have to check to make sure every part 310 // of the object is defined. 311 try { 312 if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].goToSlide == 'function') { 313 Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].goToSlide(options); 314 } 315 } 316 catch(err) { 317 // Don't need to do anything on error. 318 } 319 320 try { 321 if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type].goToSlide == 'function') { 322 Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type].goToSlide(options); 323 } 324 } 325 catch(err) { 326 // Don't need to do anything on error. 327 } 328 }; 329 330 /** 331 * Implement the previousSlide hook for pagers. 332 */ 333 Drupal.viewsSlideshowPager.previousSlide = function (options) { 334 // Route the pager call to the correct pager type. 335 // Need to use try catch so we don't have to check to make sure every part 336 // of the object is defined. 337 try { 338 if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].previousSlide == 'function') { 339 Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].previousSlide(options); 340 } 341 } 342 catch(err) { 343 // Don't need to do anything on error. 344 } 345 346 try { 347 if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type].previousSlide == 'function') { 348 Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type].previousSlide(options); 349 } 350 } 351 catch(err) { 352 // Don't need to do anything on error. 353 } 354 }; 355 356 /** 357 * Implement the nextSlide hook for pagers. 358 */ 359 Drupal.viewsSlideshowPager.nextSlide = function (options) { 360 // Route the pager call to the correct pager type. 361 // Need to use try catch so we don't have to check to make sure every part 362 // of the object is defined. 363 try { 364 if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].nextSlide == 'function') { 365 Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].nextSlide(options); 366 } 367 } 368 catch(err) { 369 // Don't need to do anything on error. 370 } 371 372 try { 373 if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type].nextSlide == 'function') { 374 Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type].nextSlide(options); 375 } 376 } 377 catch(err) { 378 // Don't need to do anything on error. 379 } 380 }; 381 382 383 /** 384 * Views Slideshow Pager Fields 385 */ 386 387 // Add views slieshow api calls for views slideshow pager fields. 388 Drupal.behaviors.viewsSlideshowPagerFields = { 389 attach: function (context) { 390 // Process pause on hover.
391 $('.views_slideshow_pager_field:not(.views-slideshow-pager-field-processed)', context).addClass('views-slideshow-pager-field-processed').each(function() { 392 // Parse out the location and unique id from the full id. 393 var pagerInfo = $(this).attr('id').split('_'); 394 var location = pagerInfo[2]; 395 pagerInfo.splice(0, 3); 396 var uniqueID = pagerInfo.join('_'); 397 398 // Add the activate and pause on pager hover event to each pager item. 399 if (Drupal.settings.viewsSlideshowPagerFields[uniqueID][location].activatePauseOnHover) { 400 $(this).children().each(function(index, pagerItem) { 401 var mouseIn = function() { 402 Drupal.viewsSlideshow.action({ "action": 'goToSlide', "slideshowID": uniqueID, "slideNum": index }); 403 Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": uniqueID }); 404 } 405 406 var mouseOut = function() { 407 Drupal.viewsSlideshow.action({ "action": 'play', "slideshowID": uniqueID }); 408 } 409 410 if (jQuery.fn.hoverIntent) { 411 $(pagerItem).hoverIntent(mouseIn, mouseOut); 412 } 413 else { 414 $(pagerItem).hover(mouseIn, mouseOut); 415 } 416 417 }); 418 } 419 else { 420 $(this).children().each(function(index, pagerItem) { 421 $(pagerItem).click(function() { 422 Drupal.viewsSlideshow.action({ "action": 'goToSlide', "slideshowID": uniqueID, "slideNum": index }); 423 }); 424 }); 425 } 426 }); 427 } 428 }; 429 430 Drupal.viewsSlideshowPagerFields = Drupal.viewsSlideshowPagerFields || {}; 431 432 /** 433 * Implement the transitionBegin hook for pager fields pager. 434 */ 435 Drupal.viewsSlideshowPagerFields.transitionBegin = function (options) {
436 for (pagerLocation in Drupal.settings.viewsSlideshowPager[options.slideshowID]) { 437 // Remove active class from pagers 438 $('[id^="views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '"]').removeClass('active'); 439 440 // Add active class to active pager. 441 $('#views_slideshow_pager_field_item_'+ pagerLocation + '_' + options.slideshowID + '_' + options.slideNum).addClass('active'); 442 } 443 444 }; 445 446 /** 447 * Implement the goToSlide hook for pager fields pager. 448 */ 449 Drupal.viewsSlideshowPagerFields.goToSlide = function (options) { 450 for (pagerLocation in Drupal.settings.viewsSlideshowPager[options.slideshowID]) { 451 // Remove active class from pagers 452 $('[id^="views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '"]').removeClass('active'); 453 454 // Add active class to active pager. 455 $('#views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '_' + options.slideNum).addClass('active'); 456 } 457 }; 458 459 /** 460 * Implement the previousSlide hook for pager fields pager. 461 */ 462 Drupal.viewsSlideshowPagerFields.previousSlide = function (options) {
463 for (pagerLocation in Drupal.settings.viewsSlideshowPager[options.slideshowID]) { 464 // Get the current active pager. 465 var pagerNum = $('[id^="views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '"].active').attr('id').replace('views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '_', ''); 466 467 // If we are on the first pager then activate the last pager. 468 // Otherwise activate the previous pager. 469 if (pagerNum == 0) { 470 pagerNum = $('[id^="views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '"]').length() - 1; 471 } 472 else { 473 pagerNum--; 474 } 475 476 // Remove active class from pagers 477 $('[id^="views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '"]').removeClass('active'); 478 479 // Add active class to active pager. 480 $('#views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '_' + pagerNum).addClass('active'); 481 } 482 }; 483 484 /** 485 * Implement the nextSlide hook for pager fields pager. 486 */ 487 Drupal.viewsSlideshowPagerFields.nextSlide = function (options) {
488 for (pagerLocation in Drupal.settings.viewsSlideshowPager[options.slideshowID]) { 489 // Get the current active pager. 490 var pagerNum = $('[id^="views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '"].active').attr('id').replace('views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '_', ''); 491 var totalPagers = $('[id^="views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '"]').length(); 492 493 // If we are on the last pager then activate the first pager. 494 // Otherwise activate the next pager. 495 pagerNum++; 496 if (pagerNum == totalPagers) { 497 pagerNum = 0; 498 } 499 500 // Remove active class from pagers 501 $('[id^="views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '"]').removeClass('active'); 502 503 // Add active class to active pager. 504 $('#views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '_' + slideNum).addClass('active'); 505 } 506 }; 507 508 509 /** 510 * Views Slideshow Slide Counter 511 */ 512 513 Drupal.viewsSlideshowSlideCounter = Drupal.viewsSlideshowSlideCounter || {}; 514 515 /** 516 * Implement the transitionBegin for the slide counter. 517 */ 518 Drupal.viewsSlideshowSlideCounter.transitionBegin = function (options) { 519 $('#views_slideshow_slide_counter_' + options.slideshowID + ' .num').text(options.slideNum + 1); 520 }; 521 522 /** 523 * This is used as a router to process actions for the slideshow. 524 */ 525 Drupal.viewsSlideshow.action = function (options) { 526 // Set default values for our return status. 527 var status = { 528 'value': true, 529 'text': '' 530 } 531 532 // If an action isn't specified return false. 533 if (typeof options.action == 'undefined' || options.action == '') { 534 status.value = false; 535 status.text = Drupal.t('There was no action specified.'); 536 return error; 537 } 538 539 // If we are using pause or play switch paused state accordingly. 540 if (options.action == 'pause') { 541 Drupal.settings.viewsSlideshow[options.slideshowID].paused = 1; 542 // If the calling method is forcing a pause then mark it as such. 543 if (options.force) { 544 Drupal.settings.viewsSlideshow[options.slideshowID].pausedForce = 1; 545 } 546 } 547 else if (options.action == 'play') { 548 // If the slideshow isn't forced pause or we are forcing a play then play 549 // the slideshow. 550 // Otherwise return telling the calling method that it was forced paused. 551 if (!Drupal.settings.viewsSlideshow[options.slideshowID].pausedForce || options.force) { 552 Drupal.settings.viewsSlideshow[options.slideshowID].paused = 0; 553 Drupal.settings.viewsSlideshow[options.slideshowID].pausedForce = 0; 554 } 555 else { 556 status.value = false; 557 status.text += ' ' + Drupal.t('This slideshow is forced paused.'); 558 return status; 559 } 560 } 561 562 // We use a switch statement here mainly just to limit the type of actions 563 // that are available. 564 switch (options.action) { 565 case "goToSlide": 566 case "transitionBegin": 567 case "transitionEnd": 568 // The three methods above require a slide number. Checking if it is 569 // defined and it is a number that is an integer. 570 if (typeof options.slideNum == 'undefined' || typeof options.slideNum !== 'number' || parseInt(options.slideNum) != (options.slideNum - 0)) { 571 status.value = false; 572 status.text = Drupal.t('An invalid integer was specified for slideNum.'); 573 } 574 case "pause": 575 case "play": 576 case "nextSlide": 577 case "previousSlide": 578 // Grab our list of methods. 579 var methods = Drupal.settings.viewsSlideshow[options.slideshowID]['methods']; 580 581 // if the calling method specified methods that shouldn't be called then 582 // exclude calling them. 583 var excludeMethodsObj = {}; 584 if (typeof options.excludeMethods !== 'undefined') { 585 // We need to turn the excludeMethods array into an object so we can use the in 586 // function. 587 for (var i=0; i < excludeMethods.length; i++) { 588 excludeMethodsObj[excludeMethods[i]] = ''; 589 } 590 } 591 592 // Call every registered method and don't call excluded ones. 593 for (i = 0; i < methods[options.action].length; i++) { 594 if (Drupal[methods[options.action][i]] != undefined && typeof Drupal[methods[options.action][i]][options.action] == 'function' && !(methods[options.action][i] in excludeMethodsObj)) { 595 Drupal[methods[options.action][i]][options.action](options); 596 } 597 } 598 break; 599
600 // If it gets here it's because it's an invalid action. 601 default: 602 status.value = false; 603 status.text = Drupal.t('An invalid action "!action" was specified.', { "!action": options.action }); 604 } 605 return status; 606 }; 607})(jQuery); 608; 609(function ($) { 610 611$(document).ready(function() { 612 613 // Expression to check for absolute internal links. 614 var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i"); 615 616 // Attach onclick event to document only and catch clicks on all elements. 617 $(document.body).click(function(event) { 618 // Catch the closest surrounding link of a clicked element. 619 $(event.target).closest("a,area").each(function() { 620 621 var ga = Drupal.settings.googleanalytics; 622 // Expression to check for special links like gotwo.module /go/* links. 623 var isInternalSpecial = new RegExp("(\/go\/.*)$", "i"); 624 // Expression to check for download links. 625 var isDownload = new RegExp("\\.(" + ga.trackDownloadExtensions + ")$", "i"); 626 627 // Is the clicked URL internal? 628 if (isInternal.test(this.href)) { 629 // Skip 'click' tracking, if custom tracking events are bound. 630 if ($(this).is('.colorbox')) { 631 // Do nothing here. The custom event will handle all tracking. 632 } 633 // Is download tracking activated and the file extension configured for download tracking? 634 else if (ga.trackDownload && isDownload.test(this.href)) { 635 // Download link clicked. 636 var extension = isDownload.exec(this.href); 637 _gaq.push(["_trackEvent", "Downloads", extension[1].toUpperCase(), this.href.replace(isInternal, '')]); 638 } 639 else if (isInternalSpecial.test(this.href)) { 640 // Keep the internal URL for Google Analytics website overlay intact. 641 _gaq.push(["_trackPageview", this.href.replace(isInternal, '')]); 642 } 643 } 644 else { 645 if (ga.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) { 646 // Mailto link clicked. 647 _gaq.push(["_trackEvent", "Mails", "Click", this.href.substring(7)]); 648 } 649 else if (ga.trackOutbound && this.href.match(/^\w+:\/\//i)) { 650 if (ga.trackDomainMode == 2 && isCrossDomain($(this).attr('hostname'), ga.trackCrossDomains)) { 651 // Top-level cross domain clicked. document.location is handled by _link internally. 652 event.preventDefault(); 653 _gaq.push(["_link", this.href]); 654 } 655 else { 656 // External link clicked. 657 _gaq.push(["_trackEvent", "Outbound links", "Click", this.href]); 658 } 659 } 660 } 661 }); 662 }); 663 664 // Colorbox: This event triggers when the transition has completed and the 665 // newly loaded content has been revealed. 666 $(document).bind("cbox_complete", function() { 667 var href = $.colorbox.element().attr("href"); 668 if (href) { 669 _gaq.push(["_trackPageview", href.replace(isInternal, '')]); 670 } 671 }); 672 673}); 674 675/** 676 * Check whether the hostname is part of the cross domains or not. 677 * 678 * @param string hostname 679 * The hostname of the clicked URL. 680 * @param array crossDomains 681 * All cross domain hostnames as JS array. 682 * 683 * @return boolean 684 */
685function isCrossDomain(hostname, crossDomains) { 686 /** 687 * jQuery < 1.6.3 bug: $.inArray crushes IE6 and Chrome if second argument is 688 * `null` or `undefined`, http://bugs.jquery.com/ticket/10076, 689 * https://github.com/jquery/jquery/commit/a839af034db2bd934e4d4fa6758a3fed8de74174 690 * 691 * @todo: Remove/Refactor in D8 692 */ 693 if (!crossDomains) { 694 return false; 695 } 696 else { 697 return $.inArray(hostname, crossDomains) > -1 ? true : false; 698 } 699} 700 701})(jQuery); 702;
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.