1Drupal.locale = { 'pluralFormula': function ($n) { return Number(($n>1)); }, 'strings': {"":{"An AJAX HTTP error occurred.":"Hi ha hagut un error HTTP d\u0027AJAX.","HTTP Result Code: !status":"Codi de resultat HTTP: !status","An AJAX HTTP request terminated abnormally.":"Una petici\u00f3 HTTP d\u0027AJAX ha acabat de forma anormal.","Debugging information follows.":"A continuaci\u00f3 hi ha informaci\u00f3 de depuraci\u00f3.","Path: !uri":"Cam\u00ed: !uri","StatusText: !statusText":"StatusText: !statusText","ResponseText: !responseText":"ResponseText: !responseText","ReadyState: !readyState":"ReadyState: !readyState","CustomMessage: !customMessage":"CustomMessage: !customMessage","Loading":"Carregant","(active tab)":"(pestanya activa)","Hide":"Oculta","Show":"Mostra","@title dialog":"Quadre de @title","Configure":"Configura","Show shortcuts":"Mostra els accessos directes","Hide shortcuts":"Amaga els accessos directes","Select all rows in this table":"Selecciona totes les fileres d\u0027aquesta taula","Deselect all rows in this table":"Deselecciona totes les fileres d\u0027aquesta taula","Re-order rows by numerical weight instead of dragging.":"Reordeneu les files per pes num\u00e8ric en comptes d\u0027arrossegar-les.","Show row weights":"Mostra el pes de les files","Hide row weights":"Amaga el pes de les files","Drag to re-order":"Arrossegueu per canviar l\u0027ordre","Changes made in this table will not be saved until the form is submitted.":"Els canvis fets en aquesta taula no es desaran fins que no envieu el formulari.","Available tokens":"Comodins disponibles","Other":"Altres","Enabled":"Habilitat","Tuesday":"dimarts","Tue":"dt.","Sep":"set.","Wednesday":"dimecres","Monday":"dilluns","Sunday":"diumenge","Thursday":"dijous","Friday":"divendres","Saturday":"dissabte","- None -":"- Cap -","E
1dit":"Edita","Close":"Tanca","Status":"Estat","Show description":"Mostra la descripci\u00f3","Hide description":"Amaga la descripci\u00f3","Cancel":"Cancel\u00b7la","Disabled":"Inhabilitat","Wed":"dc.","Fri":"dv.","Mon":"dl.","Sat":"ds.","Thu":"dj.","Sun":"dg.","Filename":"Nom de fitxer","Save":"Desa","Next":"Seg\u00fcent","Size":"Mida","Add":"Afegeix","Upload":"Puja","Done":"Fet","N\/A":"No aplica","This field is required.":"Aquest camp \u00e9s obligatori.","Prev":"Ant.","January":"gener","February":"febrer","March":"mar\u00e7","April":"abril","May":"maig","June":"juny","July":"juliol","August":"agost","September":"setembre","October":"octubre","November":"novembre","December":"desembre","Today":"Avui","Jan":"gen.","Feb":"febr.","Apr":"abr.","Jun":"jun","Jul":"jul.","Aug":"ag.","Oct":"oct.","Nov":"nov.","Dec":"des.","Su":"Dg.","Mo":"Dl.","Tu":"Dt.","We":"Dc.","Th":"Dj.","Fr":"Dv.","Sa":"Ds.","Not published":"No publicat","Please wait...":"Si us plau, espereu...","mm\/dd\/yy":"mm\/dd\/aa","Only files with the following extensions are allowed: %files-allowed.":"Nom\u00e9s els arxius amb les seg\u00fcents extensions estan permesos: %files-allowed","By @name on @date":"Per @name el @date","By @name":"Per @name","Not in menu":"No est\u00e0 al men\u00fa","Alias: @alias":"\u00c0lies: @alias","No alias":"No hi ha \u00e0lies","New revision":"Nova revisi\u00f3","The changes to these blocks will not be saved until the \u003Cem\u003ESave blocks\u003C\/em\u003E button is clicked.":"Els canvis fets a aquest bloc no es desaran fins que no es premi el bot\u00f3 \u003Cem\u003EDesar blocs\u003C\/em\u003E.","This permission is inherited from the authenticated user role.":"Aquest perm\u00eds s\u0027hereta del rol d\u0027usuari autentificat.","No revision":"No hi ha cap revisi\u00f3","@number comments per page":"@number comentaris per p\u00e0gina","Requires a title":"Requereix un t\u00edtol","Not restricted":"Sense restriccions","Not customizable":"No personalitzable","Restricted to certain pages":"Restringit a certes p\u00e0gines","The block cannot be placed in this region.":"No es pot posar el bloc en aquesta regi\u00f3.","Hide summary":"Amaga el resum","Edit summary":"Edita el resum","Don\u0027t display post information":"No mostris la informaci\u00f3 de l\u0027e
vendor: 11,395 bytes, lines 1-7
1ntrada.","The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.":"No s\u0027ha pogut carregar el fitxer %filename seleccionat. Nom\u00e9s s\u00f3n permesos els fitxers amb les seg\u00fcents extensions: %extensions.","Autocomplete popup":"Autocompleci\u00f3 en finestra emergent","Searching for matches...":"Buscant coincid\u00e8ncies...","Downloads":"Desc\u00e0rregues","One domain with multiple subdomains":"Un domini amb m\u00faltiples subdominis","Multiple top-level domains":"M\u00faltiples dominis de primer nivell","Automatic alias":"\u00c0lies autom\u00e0tic","Add files":"Afegeix fitxers","Add files to the upload queue and click the start button.":"Afegiu fitxers a la cua de c\u00e0rrega i feu clic al bot\u00f3 d\u0027inici.","Drag files here.":"Arrossegueu fitxers aqu\u00ed.","File extension error.":"Error d\u0027extensi\u00f3 de fitxer.","File size error.":"Error de mida de fitxer.","HTTP Error.":"Error HTTP.","Security error.":"Error de seguretat.","Generic error.":"Error gen\u00e8ric.","%d files queued":"%d fitxers encuats","Remove group":"Elimina el grup","Apply (all displays)":"Aplica (a totes les presentacions)","Apply (this display)":"Aplica (a aquesta presentaci\u00f3)","Revert to default":"Tornar als valors per defecte","The response failed verification so will not be processed.":"La resposta no ha passat la verificaci\u00f3, de manera que no es processar\u00e0.","The callback URL is not local and not trusted: !url":"L\u0027URL de la crida de retorn no \u00e9s local i no \u00e9s de confian\u00e7a: !url","Mar":"mar\u00e7",", or use your browser geolocation system by clicking this link":", o utilitza el sistema de geolocalitzaci\u00f3 del navegador fent clic en aquest enlla\u00e7","My Location":"La meva localitzaci\u00f3","%filename is not an image.":"%filename no \u00e9s una imatge.","Insert file":"Inserta el fitxer","Change view":"Canvia la vista","Directory":"Directori","Please select a file.":"Si us plau tria un fitxer.","Select all children":"Selecciona tots els fills","Not scheduled":"No programat","Scheduled for publishing":"Programat per publicar","Scheduled for unpublishing":"Programat per despublicar","Publishing enabled":"S\u0027ha habilitat la publicaci\u00f3","Unpublishing enabled":"S\u0027ha habilitat la despublicaci\u00f3","@label: @value":"@label: @value"}} };; 2/*! 3 Colorbox 1.6.4 4 license: MIT 5 http://www.jacklmoore.com/colorbox 6*/ 7(function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(A+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in x[0]&&!x[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),x.focus())}function c(t){c.str!==t&&(x.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){A=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),A=W.index(_.el),-1===A&&(W=W.add(_.el),A=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!U){U=$=!0,c(_.get("className")),x.css({visibility:"hidden",display:"block",opacity:""}),I=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(I),j=T.height()+k.height()+b.outerHeight(!0)-b.height(),D=C.width()+H.width()+b.outerWidth(!0)-b.width(),N=I.outerHeight(!0),z=I.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=Math.max((l!==!1?Math.min(h,a(l,"x")):h)-z-D,0),_.h=Math.max((f!==!1?Math.min(s,a(f,"y")):s)-N-j,0),I.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(F).hide(),x.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}var p=parseFloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("<div/>"),w()}}function p(){x||(V=!1,E=t(i),x=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),L=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),y=n(se,"Wrapper"),b=n(se,"Content").append(F=n(se,"Title"),R=n(se,"Current"),P=t('<button type="button"/>').attr({id:Z+"Previous"}),K=t('<button type="button"/>').attr({id:Z+"Next"}),S=t('<button type="button"/>').attr({id:Z+"Slideshow"}),L),B=t('<button type="button"/>').attr({id:Z+"Close"}),y.append(n(se).append(n(se,"TopLeft"),T=n(se,"TopCenter"),n(se,"TopRight")),n(se,!1,"clear:left").append(C=n(se,"MiddleLeft"),b,H=n(se,"MiddleRight")),n(se,!1,"clear:left").append(n(se,"BottomLeft"),k=n(se,"BottomCenter"),n(se,"BottomRight"))).find("div div").css({"float":"left"}),M=n(se,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),O=K.add(P).add(R).add(S)),e.body&&!x.parent().length&&t(e.body).append(v,x.append(y,M))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),f(this))}return x?(V||(V=!0,K.click(function(){J.next()}),P.click(function(){J.prev()}),B.click(function(){J.close()}),v.click(function(){_.get("overlayClose")&&J.close()}),t(e).bind("keydown."+Z,function(t){var e=t.keyCode;U&&_.get("escKey")&&27===e&&(t.preventDefault(),J.close()),U&&_.get("arrowKey")&&W[1]&&!t.altKey&&(37===e?(t.preventDefault(),P.click()):39===e&&(t.preventDefault(),K.click()))}),t.isFunction(t.fn.on)?t(e).on("click."+Z,"."+te,i):t("."+te).live("click."+Z,i)),!0):!1}function w(){var e,o,r,h=J.prep,d=++le;if($=!0,q=!1,u(he),u(ie),_.get("onLoad"),_.h=_.get("height")?a(_.get("height"),"y")-N-j:_.get("innerHeight")&&a(_.get("innerHeight"),"y"),_.w=_.get("width")?a(_.get("width"),"x")-z-D:_.get("innerWidth")&&a(_.get("innerWidth"),"x"),_.mw=_.w,_.mh=_.h,_.get("maxWidth")&&(_.mw=a(_.get("maxWidth"),"x")-z-D,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.get("maxHeight")&&(_.mh=a(_.get("maxHeight"),"y")-N-j,_.mh=_.h&&_.h<_.mh?_.h:_.mh),e=_.get("href"),Q=setTimeout(function(){L.show()},100),_.get("inline")){var c=t(e).eq(0);r=t("<div>").hide().insertBefore(c),ae.one(he,function(){r.replaceWith(c)}),h(c)}else _.get("iframe")?h(" "):_.get("html")?h(_.get("html")):s(_,e)?(e=l(_,e),q=_.get("createImg"),t(q).addClass(Z+"Photo").bind("error."+Z,function(){h(n(se,"Error").html(_.get("imgError")))}).one("load",function(){d===le&&setTimeout(function(){var e;_.get("retinaImage")&&i.devicePixelRatio>1&&(q.height=q.height/i.devicePixelRatio,q.width=q.width/i.devicePixelRatio),_.get("scalePhotos")&&(o=function(){q.height-=q.height*e,q.width-=q.width*e},_.mw&&q.width>_.mw&&(e=(q.width-_.mw)/q.width,o()),_.mh&&q.height>_.mh&&(e=(q.height-_.mh)/q.height,o())),_.h&&(q.style.marginTop=Math.max(_.mh-q.height,0)/2+"px"),W[1]&&(_.get("loop")||W[A+1])&&(q.style.cursor="pointer",t(q).bind("click."+Z,function(){J.next()})),q.style.width=q.width+"px",q.style.height=q.height+"px",h(q)},1)}),q.src=e):e&&M.load(e,_.get("data"),function(e,i){d===le&&h("error"===i?n(se,"Error").html(_.get("xhrError")):t(this).contents())})}var v,x,y,b,T,C,H,k,W,E,I,M,L,F,R,S,K,P,B,O,_,j,D,N,z,A,q,U,$,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),n=t(this).data("cbox-iframe-attrs");return"object"==typeof n&&t.each(n,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},Y="colorbox",Z="cbox",te=Z+"Element",ee=Z+"_open",ie=Z+"_load",ne=Z+"_complete",oe=Z+"_cleanup",re=Z+"_closed",he=Z+"_purge",ae=t("<a/>"),se="div",le=0,de={},ce=function(){function t(){clearTimeout(h)}function e(){(_.get("loop")||W[A+1])&&(t(),h=setTimeout(J.next,_.get("slideshowSpeed")))}function i(){S.html(_.get("slideshowStop")).unbind(s).one(s,n),ae.bind(ne,e).bind(ie,t),x.removeClass(a+"off").addClass(a+"on")}function n(){t(),ae.unbind(ne,e).unbind(ie,t),S.html(_.get("slideshowStart")).unbind(s).one(s,function(){J.next(),i()}),x.removeClass(a+"on").addClass(a+"off")}function o(){r=!1,S.hide(),t(),ae.unbind(ne,e).unbind(ie,t),x.removeClass(a+"off "+a+"on")}var r,h,a=Z+"Slideshow_",s="click."+Z;return function(){r?_.get("slideshow")||(ae.unbind(oe,o),o()):_.get("slideshow")&&W[1]&&(r=!0,ae.one(oe,o),_.get("slideshowAuto")?i():n(),S.show())}}();t[Y]||(t(p),J=t.fn[Y]=t[Y]=function(e,i){var n,o=this;return e=e||{},t.isFunction(o)&&(o=t("<a/>"),e.open=!0),o[0]?(p(),m()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,Y)||{};t.data(this,Y,t.extend(i,e))}).addClass(te),n=new r(o[0],e),n.get("open")&&f(o[0])),o):o},J.position=function(e,i){function n(){T[0].style.width=k[0].style.width=b[0].style.width=parseInt(x[0].style.width,10)-D+"px",b[0].style.height=C[0].style.height=H[0].style.height=parseInt(x[0].style.height,10)-j+"px"}var r,h,s,l=0,d=0,c=x.offset();if(E.unbind("resize."+Z),x.css({top:-9e4,left:-9e4}),h=E.scrollTop(),s=E.scrollLeft(),_.get("fixed")?(c.top-=h,c.left-=s,x.css({position:"fixed"})):(l=h,d=s,x.css({position:"absolute"})),d+=_.get("right")!==!1?Math.max(E.width()-_.w-z-D-a(_.get("right"),"x"),0):_.get("left")!==!1?a(_.get("left"),"x"):Math.round(Math.max(E.width()-_.w-z-D,0)/2),l+=_.get("bottom")!==!1?Math.max(o()-_.h-N-j-a(_.get("bottom"),"y"),0):_.get("top")!==!1?a(_.get("top"),"y"):Math.round(Math.max(o()-_.h-N-j,0)/2),x.css({top:c.top,left
7:c.left,visibility:"visible"}),y[0].style.width=y[0].style.height="9999px",r={width:_.w+z+D,height:_.h+N+j,top:l,left:d},e){var g=0;t.each(r,function(t){return r[t]!==de[t]?(g=e,void 0):void 0}),e=g}de=r,e||x.css(r),x.dequeue().animate(r,{duration:e||0,complete:function(){n(),$=!1,y[0].style.width=_.w+z+D+"px",y[0].style.height=_.h+N+j+"px",_.get("reposition")&&setTimeout(function(){E.bind("resize."+Z,J.position)},1),t.isFunction(i)&&i()},step:n})},J.resize=function(t){var e;U&&(t=t||{},t.width&&(_.w=a(t.width,"x")-z-D),t.innerWidth&&(_.w=a(t.innerWidth,"x")),I.css({width:_.w}),t.height&&(_.h=a(t.height,"y")-N-j),t.innerHeight&&(_.h=a(t.innerHeight,"y")),t.innerHeight||t.height||(e=I.scrollTop(),I.css({height:"auto"}),_.h=I.height()),I.css({height:_.h}),e&&I.scrollTop(e),J.position("none"===_.get("transition")?0:_.get("speed")))},J.prep=function(i){function o(){return _.w=_.w||I.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function a(){return _.h=_.h||I.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if(U){var d,g="none"===_.get("transition")?0:_.get("speed");I.remove(),I=n(se,"LoadedContent").append(i),I.hide().appendTo(M.show()).css({width:o(),overflow:_.get("scrolling")?"auto":"hidden"}).css({height:a()}).prependTo(b),M.hide(),t(q).css({"float":"none"}),c(_.get("className")),d=function(){function i(){t.support.opacity===!1&&x[0].style.removeAttribute("filter")}var n,o,a=W.length;U&&(o=function(){clearTimeout(Q),L.hide(),u(ne),_.get("onComplete")},F.html(_.get("title")).show(),I.show(),a>1?("string"==typeof _.get("current")&&R.html(_.get("current").replace("{current}",A+1).replace("{total}",a)).show(),K[_.get("loop")||a-1>A?"show":"hide"]().html(_.get("next")),P[_.get("loop")||A?"show":"hide"]().html(_.get("previous")),ce(),_.get("preloading")&&t.each([h(-1),h(1)],function(){var i,n=W[this],o=new r(n,t.data(n,Y)),h=o.get("href");h&&s(o,h)&&(h=l(o,h),i=e.createElement("img"),i.src=h)})):O.hide(),_.get("iframe")?(n=_.get("createIframe"),_.get("scrolling")||(n.scrolling="no"),t(n).attr({src:_.get("href"),"class":Z+"Iframe"}).one("load",o).appendTo(I),ae.one(he,function(){n.src="//about:blank"}),_.get("fastIframe")&&t(n).trigger("load")):o(),"fade"===_.get("transition")?x.fadeTo(g,1,i):i())},"fade"===_.get("transition")?x.fadeTo(g,0,function(){J.position(0,d)}):J.position(g,d)}},J.next=function(){!$&&W[1]&&(_.get("loop")||W[A+1])&&(A=h(1),f(W[A]))},J.prev=function(){!$&&W[1]&&(_.get("loop")||A)&&(A=h(-1),f(W[A]))},J.close=function(){U&&!G&&(G=!0,U=!1,u(oe),_.get("onCleanup"),E.unbind("."+Z),v.fadeTo(_.get("fadeOut")||0,0),x.stop().fadeTo(_.get("fadeOut")||0,0,function(){x.hide(),v.hide(),u(he),I.remove(),setTimeout(function(){G=!1,u(re),_.get("onClosed")},1)}))},J.remove=function(){x&&(x.stop(),t[Y].close(),x.stop(!1,!0).remove(),v.remove(),G=!1,x=null,t("."+te).removeData(Y).removeClass(te),t(e).unbind("click."+Z).unbind("keydown."+Z))},J.element=function(){return t(_.el)},J.settings=X)})(jQuery,document,window);; 8/** 9 * @file 10 * Colorbox module init js. 11 */ 12 13(function ($) { 14 15Drupal.behaviors.initColorbox = { 16 attach: function (context, settings) { 17 if (!$.isFunction($('a, area, input', context).colorbox) || typeof settings.colorbox === 'undefined') { 18 return; 19 } 20 21 if (settings.colorbox.mobiledetect && window.matchMedia) { 22 // Disable Colorbox for small screens. 23 var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")"); 24 if (mq.matches) { 25 return; 26 } 27 } 28 29 // Use "data-colorbox-gallery" if set otherwise use "rel". 30 settings.colorbox.rel = function () { 31 if ($(this).data('colorbox-gallery')) { 32 return $(this).data('colorbox-gallery'); 33 } 34 else { 35 return $(this).attr('rel'); 36 } 37 }; 38 39 $('.colorbox', context) 40 .once('init-colorbox').each(function(){ 41 // Only images are supported for the "colorbox" class. 42 // The "photo" setting forces the href attribute to be treated as an image. 43 var extendParams = { 44 photo: true 45 }; 46 // If a title attribute is supplied, sanitize it. 47 var title = $(this).attr('title'); 48 if (title) { 49 extendParams.title = Drupal.checkPlain(title); 50 } 51 $(this).colorbox($.extend({}, settings.colorbox, extendParams)); 52 }); 53 54 $(context).bind('cbox_complete', function () { 55 Drupal.attachBehaviors('#cboxLoadedContent'); 56 }); 57 } 58}; 59 60})(jQuery); 61; 62/** 63 * @file 64 * Colorbox module style js. 65 */ 66 67(function ($) { 68 69Drupal.behaviors.initColorboxDefaultStyle = { 70 attach: function (context, settings) { 71 $(context).bind('cbox_complete', function () { 72 // Only run if there is a title. 73 if ($('#cboxTitle:empty', context).length == false) { 74 $('#cboxLoadedContent img', context).bind('mouseover', function () { 75 $('#cboxTitle', context).slideDown(); 76 }); 77 $('#cboxOverlay', context).bind('mouseover', function () {
78 $('#cboxTitle', context).slideUp(); 79 }); 80 } 81 else { 82 $('#cboxTitle', context).hide(); 83 } 84 }); 85 } 86}; 87 88})(jQuery); 89; 90/** 91 * @file 92 * Some basic behaviors and utility functions for Views. 93 */ 94(function ($) { 95 96 Drupal.Views = {}; 97 98 /** 99 * JQuery UI tabs, Views integration component. 100 */ 101 Drupal.behaviors.viewsTabs = { 102 attach: function (context) { 103 if ($.viewsUi && $.viewsUi.tabs) { 104 $('#views-tabset').once('views-processed').viewsTabs({ 105 selectedClass: 'active' 106 }); 107 } 108 109 $('a.views-remove-link').once('views-processed').click(function(event) { 110 var id = $(this).attr('id').replace('views-remove-link-', ''); 111 $('#views-row-' + id).hide(); 112 $('#views-removed-' + id).attr('checked', true); 113 event.preventDefault(); 114 }); 115 /** 116 * Here is to handle display deletion 117 * (checking in the hidden checkbox and hiding out the row). 118 */ 119 $('a.display-remove-link') 120 .addClass('display-processed') 121 .click(function() { 122 var id = $(this).attr('id').replace('display-remove-link-', ''); 123 $('#display-row-' + id).hide(); 124 $('#display-removed-' + id).attr('checked', true); 125 return false; 126 }); 127 } 128 }; 129 130 /** 131 * Helper function to parse a querystring. 132 */ 133 Drupal.Views.parseQueryString = function (query) { 134 var args = {}; 135 var pos = query.indexOf('?'); 136 if (pos != -1) { 137 query = query.substring(pos + 1); 138 } 139 var pairs = query.split('&'); 140 for (var i in pairs) { 141 if (typeof(pairs[i]) == 'string') { 142 var pair = pairs[i].split('='); 143 // Ignore the 'q' path argument, if present. 144 if (pair[0] != 'q' && pair[1]) { 145 args[decodeURIComponent(pair[0].replace(/\+/g, ' '))] = decodeURIComponent(pair[1].replace(/\+/g, ' ')); 146 } 147 } 148 } 149 return args; 150 }; 151 152 /** 153 * Helper function to return a view's arguments based on a path. 154 */ 155 Drupal.Views.parseViewArgs = function (href, viewPath) { 156 157 // Provide language prefix. 158 if (Drupal.settings.pathPrefix) { 159 var viewPath = Drupal.settings.pathPrefix + viewPath; 160 } 161 var returnObj = {}; 162 var path = Drupal.Views.getPath(href); 163 // Ensure we have a correct path. 164 if (viewPath && path.substring(0, viewPath.length + 1) == viewPath + '/') { 165 var args = decodeURIComponent(path.substring(viewPath.length + 1, path.length)); 166 returnObj.view_args = args; 167 returnObj.view_path = path; 168 } 169 return returnObj; 170 }; 171 172 /** 173 * Strip off the protocol plus domain from an href. 174 */ 175 Drupal.Views.pathPortion = function (href) { 176 // Remove e.g. http://example.com if present. 177 var protocol = window.location.protocol; 178 if (href.substring(0, protocol.length) == protocol) { 179 // 2 is the length of the '//' that normally follows the protocol. 180 href = href.substring(href.indexOf('/', protocol.length + 2)); 181 } 182 return href; 183 }; 184 185 /** 186 * Return the Drupal path portion of an href. 187 */ 188 Drupal.Views.getPath = function (href) { 189 href = Drupal.Views.pathPortion(href); 190 href = href.substring(Drupal.settings.basePath.length, href.length); 191 // 3 is the length of the '?q=' added to the url without clean urls. 192 if (href.substring(0, 3) == '?q=') { 193 href = href.substring(3, href.length); 194 } 195 var chars = ['#', '?', '&']; 196 for (var i in chars) { 197 if (href.indexOf(chars[i]) > -1) { 198 href = href.substr(0, href.indexOf(chars[i])); 199 } 200 } 201 return href; 202 }; 203 204})(jQuery); 205; 206(function ($) { 207 208/** 209 * A progressbar object. Initialized with the given id. Must be inserted into 210 * the DOM afterwards through progressBar.element. 211 * 212 * method is the function which will perform the HTTP request to get the 213 * progress bar state. Either "GET" or "POST". 214 * 215 * e.g. pb = new progressBar('myProgressBar'); 216 * some_element.appendChild(pb.element); 217 */ 218Drupal.progressBar = function (id, updateCallback, method, errorCallback) { 219 var pb = this; 220 this.id = id; 221 this.method = method || 'GET'; 222 this.updateCallback = updateCallback; 223 this.errorCallback = errorCallback; 224
225 // The WAI-ARIA setting aria-live="polite" will announce changes after users 226 // have completed their current activity and not interrupt the screen reader. 227 this.element = $('<div class="progress-wrapper" aria-live="polite"></div>'); 228 this.element.html('<div id ="' + id + '" class="progress progress-striped active">' + 229 '<div class="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">' + 230 '<div class="percentage sr-only"></div>' + 231 '</div></div>' + 232 '</div><div class="percentage pull-right"></div>' + 233 '<div class="message"> </div>'); 234}; 235 236/** 237 * Set the percentage and status message for the progressbar. 238 */ 239Drupal.progressBar.prototype.setProgress = function (percentage, message) { 240 if (percentage >= 0 && percentage <= 100) { 241 $('div.progress-bar', this.element).css('width', percentage + '%'); 242 $('div.progress-bar', this.element).attr('aria-valuenow', percentage); 243 $('div.percentage', this.element).html(percentage + '%'); 244 } 245 $('div.message', this.element).html(message); 246 if (this.updateCallback) { 247 this.updateCallback(percentage, message, this); 248 } 249}; 250 251/** 252 * Start monitoring progress via Ajax. 253 */ 254Drupal.progressBar.prototype.startMonitoring = function (uri, delay) { 255 this.delay = delay; 256 this.uri = uri; 257 this.sendPing(); 258}; 259 260/** 261 * Stop monitoring progress via Ajax. 262 */ 263Drupal.progressBar.prototype.stopMonitoring = function () { 264 clearTimeout(this.timer); 265 // This allows monitoring to be stopped from within the callback. 266 this.uri = null; 267}; 268 269/** 270 * Request progress data from server. 271 */ 272Drupal.progressBar.prototype.sendPing = function () { 273 if (this.timer) { 274 clearTimeout(this.timer); 275 } 276 if (this.uri) { 277 var pb = this; 278 // When doing a post request, you need non-null data. Otherwise a 279 // HTTP 411 or HTTP 406 (with Apache mod_security) error may result. 280 $.ajax({ 281 type: this.method, 282 url: this.uri, 283 data: '', 284 dataType: 'json', 285 success: function (progress) { 286 // Display errors. 287 if (progress.status == 0) { 288 pb.displayError(progress.data); 289 return; 290 } 291 // Update display. 292 pb.setProgress(progress.percentage, progress.message); 293 // Schedule next timer. 294 pb.timer = setTimeout(function () { pb.sendPing(); }, pb.delay); 295 }, 296 error: function (xmlhttp) { 297 pb.displayError(Drupal.ajaxError(xmlhttp, pb.uri)); 298 } 299 }); 300 } 301}; 302 303/** 304 * Display errors on the page. 305 */ 306Drupal.progressBar.prototype.displayError = function (string) { 307 var error = $('<div class="alert alert-block alert-error"><a class="close" data-dismiss="alert" href="#">×</a><h4>Error message</h4></div>').append(string); 308 $(this.element).before(error).hide(); 309 310 if (this.errorCallback) { 311 this.errorCallback(this); 312 } 313}; 314 315})(jQuery); 316; 317/** 318 * @file 319 * Handles AJAX fetching of views, including filter submission and response. 320 */ 321(function ($) { 322 323 /** 324 * Attaches the AJAX behavior to exposed filter forms and key views links. 325 */ 326 Drupal.behaviors.ViewsAjaxView = {}; 327 Drupal.behaviors.ViewsAjaxView.attach = function() { 328 if (Drupal.settings && Drupal.settings.views && Drupal.settings.views.ajaxViews) { 329 $.each(Drupal.settings.views.ajaxViews, function(i, settings) { 330 Drupal.views.instances[i] = new Drupal.views.ajaxView(settings); 331 }); 332 } 333 }; 334 335 Drupal.views = {}; 336 Drupal.views.instances = {}; 337 338 /** 339 * JavaScript object for a certain view. 340 */ 341 Drupal.views.ajaxView = function(settings) { 342 var selector = '.view-dom-id-' + settings.view_dom_id; 343 this.$view = $(selector); 344 345 // Retrieve the path to use for views' ajax. 346 var ajax_path = Drupal.settings.views.ajax_path; 347 348 // If there are multiple views this might've ended up showing up multiple 349 // times. 350 if (ajax_path.constructor.toString().indexOf("Array") != -1) { 351 ajax_path = ajax_path[0]; 352 } 353 354 // Check if there are any GET parameters to send to views. 355 var queryString = window.location.search || ''; 356 if (queryString !== '') { 357 // Remove the question mark and Drupal path component if any. 358 var queryString = queryString.slice(1).replace(/q=[^&]+&?|&?render=[^&]+/, ''); 359 if (queryString !== '') { 360 // If there is a '?' in ajax_path, clean url are on and & should be 361 // used to add parameters. 362 queryString = ((/\?/.test(ajax_path)) ? '&' : '?') + queryString; 363 } 364 } 365 366 this.element_settings = { 367 url: ajax_path + queryString, 368 submit: settings, 369 setClick: true, 370 event: 'click', 371 selector: selector, 372 progress: { 373 type: 'throbber' 374 } 375 }; 376 377 this.settings = settings; 378
379 // Add the ajax to exposed forms. 380 this.$exposed_form = $('#views-exposed-form-' + settings.view_name.replace(/_/g, '-') + '-' + settings.view_display_id.replace(/_/g, '-')); 381 this.$exposed_form.once(jQuery.proxy(this.attachExposedFormAjax, this)); 382 383 // Store Drupal.ajax objects here for all pager links. 384 this.links = []; 385 386 // Add the ajax to pagers. 387 this.$view 388 .once(jQuery.proxy(this.attachPagerAjax, this)); 389 390 // Add a trigger to update this view specifically. In order to trigger a 391 // refresh use the following code. 392 // 393 // @code 394 // jQuery('.view-name').trigger('RefreshView'); 395 // @endcode 396 // Add a trigger to update this view specifically. 397 var self_settings = this.element_settings; 398 self_settings.event = 'RefreshView'; 399 var self = this; 400 this.$view.once('refresh', function () { 401 self.refreshViewAjax = new Drupal.ajax(self.selector, self.$view, self_settings); 402 }); 403 }; 404 405 Drupal.views.ajaxView.prototype.attachExposedFormAjax = function() { 406 var button = $('input[type=submit], button[type=submit], input[type=image]', this.$exposed_form); 407 button = button[0]; 408 409 // Call the autocomplete submit before doing AJAX. 410 $(button).click(function () { 411 if (Drupal.autocompleteSubmit) { 412 Drupal.autocompleteSubmit(); 413 } 414 }); 415 416 this.exposedFormAjax = new Drupal.ajax($(button).attr('id'), button, this.element_settings); 417 }; 418 419 /** 420 * Attach the ajax behavior to each link. 421 */ 422 Drupal.views.ajaxView.prototype.attachPagerAjax = function() { 423 this.$view.find('ul.pager > li > a, ol.pager > li > a, th.views-field a, .attachment .views-summary a') 424 .each(jQuery.proxy(this.attachPagerLinkAjax, this)); 425 }; 426 427 /** 428 * Attach the ajax behavior to a single link. 429 */ 430 Drupal.views.ajaxView.prototype.attachPagerLinkAjax = function(id, link) { 431 var $link = $(link); 432 var viewData = {}; 433 var href = $link.attr('href'); 434 // Don't attach to pagers inside nested views. 435 if ($link.closest('.view')[0] !== this.$view[0] && 436 $link.closest('.view').parent().hasClass('attachment') === false) { 437 return; 438 } 439 440 // Provide a default page if none has been set. This must be done 441 // prior to merging with settings to avoid accidentally using the 442 // page landed on instead of page 1. 443 if (typeof(viewData.page) === 'undefined') { 444 viewData.page = 0; 445 } 446 447 // Construct an object using the settings defaults and then overriding 448 // with data specific to the link. 449 $.extend( 450 viewData, 451 this.settings, 452 Drupal.Views.parseQueryString(href), 453 // Extract argument data from the URL. 454 Drupal.Views.parseViewArgs(href, this.settings.view_base_path) 455 ); 456 457 // For anchor tags, these will go to the target of the anchor rather 458 // than the usual location. 459 $.extend(viewData, Drupal.Views.parseViewArgs(href, this.settings.view_base_path)); 460 461 this.element_settings.submit = viewData; 462 this.pagerAjax = new Drupal.ajax(false, $link, this.element_settings); 463 this.links.push(this.pagerAjax); 464 }; 465 466 Drupal.ajax.prototype.commands.viewsScrollTop = function (ajax, response, status) { 467 // Scroll to the top of the view. This will allow users 468 // to browse newly loaded content after e.g. clicking a pager 469 // link. 470 var offset = $(response.selector).offset(); 471 // We can't guarantee that the scrollable object should be 472 // the body, as the view could be embedded in something 473 // more complex such as a modal popup. Recurse up the DOM 474 // and scroll the first element that has a non-zero top. 475 var scrollTarget = response.selector; 476 while ($(scrollTarget).scrollTop() == 0 && $(scrollTarget).parent()) { 477 scrollTarget = $(scrollTarget).parent(); 478 } 479 // Only scroll upward. 480 if (offset.top - 10 < $(scrollTarget).scrollTop()) { 481 $(scrollTarget).animate({scrollTop: (offset.top - 10)}, 500); 482 } 483 }; 484 485})(jQuery); 486;
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.