1Drupal.locale = { 'pluralFormula': function ($n) { return Number(($n!=1)); }, 'strings': {"":{"An AJAX HTTP error occurred.":"Tapahtui AJAX HTTP virhe.","HTTP Result Code: !status":"HTTP koodi: !status","An AJAX HTTP request terminated abnormally.":"AJAX HTTP pyynt\u00f6 keskeytyi odottamatta.","Debugging information follows.":"Seuraavassa virhetiedot.","Path: !uri":"Polku: !url","StatusText: !statusText":"Tilanneteksti: !statusText","ResponseText: !responseText":"Vastausteksti: !responseText","ReadyState: !readyState":"ReadyState: !readyState","Loading":"Ladataan","(active tab)":"(aktiivinen v\u00e4lilehti)","Hide":"Piilossa","Show":"N\u00e4yt\u00e4","Re-order rows by numerical weight instead of dragging.":"Uudelleenlajittele rivit numeerisen painon mukaan ved\u00e4-pudota toiminnon sijaan.","Show row weights":"N\u00e4yt\u00e4 rivien painokertoimet","Hide row weights":"Piilota rivien painokertoimet","Drag to re-order":"J\u00e4rjestele vet\u00e4m\u00e4ll\u00e4","Changes made in this table will not be saved until the form is submitted.":"Muutokset otetaan k\u00e4ytt\u00f6\u00f6n vasta kun valitset \u003Cem\u003Etallenna\u003C\/em\u003E.","Enabled":"K\u00e4yt\u00f6ss\u00e4","Configure":"M\u00e4\u00e4rittele","Hide shortcuts":"Piilota oikopolut","@title dialog":"@title dialogi","Show shortcuts":"N\u00e4yt\u00e4 oikopolut","Done":"Tehty","Not enabled":"Ei k\u00e4yt\u00f6ss\u00e4","Tuesday":"Tiistai","Wednesday":"Keskiviikko","Sunday":"Sunnuntai","Monday":"Maanantai","Thursday":"Torstai","Friday":"Perjantai","Saturday":"Lauantai","OK":"OK","Next":"Seuraava","Cancel":"Peruuta","Edit":"Muokkaa","none":"ei yht\u00e4\u00e4n","Prev":"Edellinen","Mon":"Ma","Tue":"Ti","Wed":"Ke","Thu":"To","Fri":"Pe","Sat":"La","Sun":"Su","January":"Tammikuu","February":"Helmikuu","March":"Maaliskuu","April":"Huhtikuu","May":"Toukokuu","June":"Kes\u00e4kuu","July":"Hein\u00e4kuu","August":"Elokuu","September":"Syyskuu","October":"Lokakuu","November":"Marraskuu","December":"Joulukuu","Select all rows in this table":"Valitse kaikki taulukon rivit","Deselect all rows in this table":"Poista kaikkien rivien valinnat","Today":"T\u00e4n\u00e4\u00e4n","Jan":"Tam","Feb":"Hel","Mar":"Maa","Apr":"Huh","Jun":"Kes","Jul":"Hei","Aug":"Elo","Sep":"Syy","Oct":"Lok","Nov":"Mar","Dec":"Jou","Su":"Su","Mo":"Ma","Tu":"Ti","We":"Ke","Th":"To","Fr":"Pe","Sa":"La","Not published":"Ei julkaistu","Please wait...":"Odota hetki...","mm\/dd\/yy":"mm\/dd\/yy","By @name on @date":"@name p\u00e4iv\u00e4n\u00e4 @date","By @name":"@name","Not in menu":"Ei valikossa","Alias: @alias":"Alias: @alias","No alias":"Ei aliasta","New revision":"Uusi versio","No revision":"Ei versiota","@number comments per page":"@number kommenttia sivua kohti","Requires a title":"Vaatii otsikon","Hide summary":"Piilota yhteenveto","Edit summary":"Muokkaa yhteenvetoa","Don\u0027t display post information":"\u00c4l\u00e4 n\u00e4yt\u00e4 l\u00e4hetyksen tietoja","The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.":"Tiedostoa %filename ei voida ladata. Sallitut tiedostop\u00e4\u00e4tteet: %extensions.","Autocomplete popup":"Automaattisen t\u00e4ydennyksen ponnahdusikkuna","Searching for matches...":"Haetaan tuloksia...","Media browser":"Media browser","Submit":"L\u00e4het\u00e4","Loading...":"Ladataan...","Select":"Valitse","If you switch views, you will lose your selection.":"Jos vaihdat esitystapaa menetet\u00e4t valintasi.","all":"kaikki","Add file":"Lis\u00e4\u00e4 tiedosto","There is nothing in your media library. Select the Upload tab above to add a file.":"Mediakirjastosssasi ei ole tietoa. Valitse Lataa v\u00e4lilehti lis\u00e4t\u00e4ksesi tiedosto.","Error getting media.":"Median haku ep\u00e4onnistui.","Cannot continue, nothing selected":"Jatkaminen ei onnistu, mit\u00e4\u00e4n ei ole valittuna","Slideshow":"Diaesitys","stop slideshow":"pys\u00e4yt\u00e4 kuvaesitys","resume slideshow":"jatka kuvaesityst\u00e4"}} };; 2/** 3 * Javascript helpers for Facebook Streams. Loaded by fb_stream.module. 4 */ 5FB_Stream = function(){}; 6 7/** 8 * Display a stream dialog on Facebook Connect pages, via 9 * http://developers.facebook.com/docs/reference/javascript/FB.ui 10 *
vendor: 9,333 bytes, lines 11-27
11 * @param json is the json-encoded output of fb_stream_get_stream_dialog_data(). 12 */ 13FB_Stream.stream_publish = function(json) { 14 var data_array = Drupal.parseJson(json); 15 var len = data_array.length; 16 for (var i=0; i < len; i++) { 17 var data = data_array[i]; 18 data.method = 'stream.publish'; 19 FB.ui(data); 20 } 21};; 22/*! 23 Colorbox 1.6.4 24 license: MIT 25 http://www.jacklmoore.com/colorbox 26*/ 27(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
27: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);; 28/** 29 * @file 30 * Colorbox module init js. 31 */ 32 33(function ($) { 34 35Drupal.behaviors.initColorbox = { 36 attach: function (context, settings) { 37 if (!$.isFunction($('a, area, input', context).colorbox) || typeof settings.colorbox === 'undefined') { 38 return; 39 } 40 41 if (settings.colorbox.mobiledetect && window.matchMedia) { 42 // Disable Colorbox for small screens. 43 var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")"); 44 if (mq.matches) { 45 return; 46 } 47 } 48 49 // Use "data-colorbox-gallery" if set otherwise use "rel". 50 settings.colorbox.rel = function () { 51 if ($(this).data('colorbox-gallery')) { 52 return $(this).data('colorbox-gallery'); 53 } 54 else { 55 return $(this).attr('rel'); 56 } 57 }; 58 59 $('.colorbox', context) 60 .once('init-colorbox').each(function(){ 61 // Only images are supported for the "colorbox" class. 62 // The "photo" setting forces the href attribute to be treated as an image. 63 var extendParams = { 64 photo: true 65 }; 66 // If a title attribute is supplied, sanitize it. 67 var title = $(this).attr('title'); 68 if (title) { 69 extendParams.title = Drupal.colorbox.sanitizeMarkup(title); 70 } 71 $(this).colorbox($.extend({}, settings.colorbox, extendParams)); 72 }); 73 74 $(context).bind('cbox_complete', function () { 75 Drupal.attachBehaviors($('#cboxLoadedContent')); 76 }); 77 } 78}; 79 80// Create colorbox namespace if it doesn't exist. 81if (!Drupal.hasOwnProperty('colorbox')) { 82 Drupal.colorbox = {}; 83} 84 85/** 86 * Global function to allow sanitizing captions and control strings. 87 * 88 * @param markup 89 * String containing potential markup. 90 * @return @string 91 * Sanitized string with potentially dangerous markup removed. 92 */ 93Drupal.colorbox.sanitizeMarkup = function(markup) { 94 // If DOMPurify installed, allow some HTML. Otherwise, treat as plain text. 95 if (typeof DOMPurify !== 'undefined') { 96 var purifyConfig = { 97 ALLOWED_TAGS: [ 98 'a', 99 'b', 100 'strong', 101 'i', 102 'em', 103 'u', 104 'cite', 105 'code', 106 'br' 107 ], 108 ALLOWED_ATTR: [ 109 'href', 110 'hreflang', 111 'title', 112 'target' 113 ] 114 } 115 if (Drupal.settings.hasOwnProperty('dompurify_custom_config')) { 116 purifyConfig = Drupal.settings.dompurify_custom_config; 117 } 118 return DOMPurify.sanitize(markup, purifyConfig); 119 } 120 else { 121 return Drupal.checkPlain(markup); 122 } 123} 124 125})(jQuery); 126; 127/** 128 * @file 129 * Some basic behaviors and utility functions for Views. 130 */ 131(function ($) { 132 133 Drupal.Views = {}; 134 135 /** 136 * JQuery UI tabs, Views integration component. 137 */ 138 Drupal.behaviors.viewsTabs = { 139 attach: function (context) { 140 if ($.viewsUi && $.viewsUi.tabs) { 141 $('#views-tabset').once('views-processed').viewsTabs({ 142 selectedClass: 'active' 143 }); 144 } 145 146 $('a.views-remove-link').once('views-processed').click(function(event) { 147 var id = $(this).attr('id').replace('views-remove-link-', ''); 148 $('#views-row-' + id).hide(); 149 $('#views-removed-' + id).get(0).checked = true; 150 event.preventDefault(); 151 }); 152 // Here is to handle display deletion 153 // (checking in the hidden checkbox and hiding out the row). 154 $('a.display-remove-link') 155 .addClass('display-processed') 156 .click(function() { 157 var id = $(this).attr('id').replace('display-remove-link-', ''); 158 $('#display-row-' + id).hide(); 159 $('#display-removed-' + id).get(0).checked = true; 160 return false;
161 }); 162 } 163 }; 164 165 /** 166 * Helper function to parse a querystring. 167 */ 168 Drupal.Views.parseQueryString = function (query) { 169 var args = {}; 170 var pos = query.indexOf('?'); 171 if (pos != -1) { 172 query = query.substring(pos + 1); 173 } 174 var pairs = query.split('&'); 175 for (var i in pairs) { 176 if (typeof(pairs[i]) == 'string') { 177 var pair = pairs[i].split('='); 178 // Ignore the 'q' path argument, if present. 179 if (pair[0] != 'q' && pair[1]) { 180 args[decodeURIComponent(pair[0].replace(/\+/g, ' '))] = decodeURIComponent(pair[1].replace(/\+/g, ' ')); 181 } 182 } 183 } 184 return args; 185 }; 186 187 /** 188 * Helper function to return a view's arguments based on a path. 189 */ 190 Drupal.Views.parseViewArgs = function (href, viewPath) { 191 // Provide language prefix. 192 if (Drupal.settings.pathPrefix) { 193 var viewPath = Drupal.settings.pathPrefix + viewPath; 194 } 195 var returnObj = {}; 196 var path = Drupal.Views.getPath(href); 197 // Ensure there is a correct path. 198 if (viewPath && path.substring(0, viewPath.length + 1) == viewPath + '/') { 199 var args = decodeURIComponent(path.substring(viewPath.length + 1, path.length)); 200 returnObj.view_args = args; 201 returnObj.view_path = path; 202 } 203 return returnObj; 204 }; 205 206 /** 207 * Strip off the protocol plus domain from an href. 208 */ 209 Drupal.Views.pathPortion = function (href) { 210 // Remove e.g. http://example.com if present. 211 var protocol = window.location.protocol; 212 if (href.substring(0, protocol.length) == protocol) { 213 // 2 is the length of the '//' that normally follows the protocol. 214 href = href.substring(href.indexOf('/', protocol.length + 2)); 215 } 216 return href; 217 }; 218 219 /** 220 * Return the Drupal path portion of an href. 221 */ 222 Drupal.Views.getPath = function (href) { 223 href = Drupal.Views.pathPortion(href); 224 href = href.substring(Drupal.settings.basePath.length, href.length); 225 // 3 is the length of the '?q=' added to the URL without clean URLs. 226 if (href.substring(0, 3) == '?q=') { 227 href = href.substring(3, href.length); 228 } 229 var chars = ['#', '?', '&']; 230 for (var i in chars) { 231 if (href.indexOf(chars[i]) > -1) { 232 href = href.substr(0, href.indexOf(chars[i])); 233 } 234 } 235 return href; 236 }; 237 238})(jQuery); 239; 240(function ($) { 241 242/** 243 * A progressbar object. Initialized with the given id. Must be inserted into 244 * the DOM afterwards through progressBar.element. 245 * 246 * method is the function which will perform the HTTP request to get the 247 * progress bar state. Either "GET" or "POST". 248 * 249 * e.g. pb = new progressBar('myProgressBar'); 250 * some_element.appendChild(pb.element); 251 */ 252Drupal.progressBar = function (id, updateCallback, method, errorCallback) { 253 var pb = this; 254 this.id = id; 255 this.method = method || 'GET'; 256 this.updateCallback = updateCallback; 257 this.errorCallback = errorCallback; 258 259 // The WAI-ARIA setting aria-live="polite" will announce changes after users 260 // have completed their current activity and not interrupt the screen reader. 261 this.element = $('<div class="progress" aria-live="polite"></div>').attr('id', id); 262 this.element.html('<div class="bar"><div class="filled"></div></div>' + 263 '<div class="percentage"></div>' + 264 '<div class="message"> </div>'); 265}; 266 267/** 268 * Set the percentage and status message for the progressbar. 269 */ 270Drupal.progressBar.prototype.setProgress = function (percentage, message) { 271 if (percentage >= 0 && percentage <= 100) { 272 $('div.filled', this.element).css('width', percentage + '%'); 273 $('div.percentage', this.element).html(percentage + '%'); 274 } 275 $('div.message', this.element).html(message); 276 if (this.updateCallback) { 277 this.updateCallback(percentage, message, this); 278 } 279}; 280 281/** 282 * Start monitoring progress via Ajax. 283 */ 284Drupal.progressBar.prototype.startMonitoring = function (uri, delay) { 285 this.delay = delay; 286 this.uri = uri; 287 this.sendPing(); 288}; 289 290/** 291 * Stop monitoring progress via Ajax. 292 */ 293Drupal.progressBar.prototype.stopMonitoring = function () { 294 clearTimeout(this.timer); 295 // This allows monitoring to be stopped from within the callback. 296 this.uri = null; 297}; 298 299/** 300 * Request progress data from server. 301 */ 302Drupal.progressBar.prototype.sendPing = function () { 303 if (this.timer) { 304 clearTimeout(this.timer); 305 } 306 if (this.uri) { 307 var pb = this; 308 // When doing a post request, you need non-null data. Otherwise a 309 // HTTP 411 or HTTP 406 (with Apache mod_security) error may result. 310 $.ajax({ 311 type: this.method, 312 url: this.uri, 313 data: '', 314 dataType: 'json', 315 success: function (progress) { 316 // Display errors. 317 if (progress.status == 0) { 318 pb.displayError(progress.data); 319 return; 320 } 321 // Update display. 322 pb.setProgress(progress.percentage, progress.message); 323 // Schedule next timer.
324 pb.timer = setTimeout(function () { pb.sendPing(); }, pb.delay); 325 }, 326 error: function (xmlhttp) { 327 pb.displayError(Drupal.ajaxError(xmlhttp, pb.uri)); 328 } 329 }); 330 } 331}; 332 333/** 334 * Display errors on the page. 335 */ 336Drupal.progressBar.prototype.displayError = function (string) { 337 var error = $('<div class="messages error"></div>').html(string); 338 $(this.element).before(error).hide(); 339 340 if (this.errorCallback) { 341 this.errorCallback(this); 342 } 343}; 344 345})(jQuery); 346; 347/** 348 * @file 349 * Handles AJAX fetching of views, including filter submission and response. 350 */ 351(function ($) { 352 353 /** 354 * Attaches the AJAX behavior to exposed filter forms and key views links. 355 */ 356 Drupal.behaviors.ViewsAjaxView = {}; 357 Drupal.behaviors.ViewsAjaxView.attach = function() { 358 if (Drupal.settings && Drupal.settings.views && Drupal.settings.views.ajaxViews) { 359 $.each(Drupal.settings.views.ajaxViews, function(i, settings) { 360 Drupal.views.instances[i] = new Drupal.views.ajaxView(settings); 361 }); 362 } 363 }; 364 365 Drupal.views = {}; 366 Drupal.views.instances = {}; 367 368 /** 369 * JavaScript object for a certain view. 370 */ 371 Drupal.views.ajaxView = function(settings) { 372 var selector = '.view-dom-id-' + settings.view_dom_id; 373 this.$view = $(selector); 374 375 // If view is not present return to prevent errors. 376 if (!this.$view.length) { 377 return; 378 } 379 380 // Retrieve the path to use for views' ajax. 381 var ajax_path = Drupal.settings.views.ajax_path; 382 383 // If there are multiple views this might've ended up showing up multiple 384 // times. 385 if (ajax_path.constructor.toString().indexOf("Array") != -1) { 386 ajax_path = ajax_path[0]; 387 } 388 389 // Check if there are any GET parameters to send to views. 390 var queryString = window.location.search || ''; 391 if (queryString !== '') { 392 // Remove the question mark and Drupal path component if any. 393 var queryString = queryString.slice(1).replace(/q=[^&]+&?|&?render=[^&]+/, ''); 394 if (queryString !== '') { 395 // If there is a '?' in ajax_path, clean url are on and & should be 396 // used to add parameters. 397 queryString = ((/\?/.test(ajax_path)) ? '&' : '?') + queryString; 398 } 399 } 400 401 this.element_settings = { 402 url: ajax_path + queryString, 403 submit: settings, 404 setClick: true, 405 event: 'click', 406 selector: selector, 407 progress: { 408 type: 'throbber' 409 } 410 }; 411 412 this.settings = settings; 413 414 // Add the ajax to exposed forms. 415 this.$exposed_form = $('#views-exposed-form-' + settings.view_name.replace(/_/g, '-') + '-' + settings.view_display_id.replace(/_/g, '-')); 416 this.$exposed_form.once(jQuery.proxy(this.attachExposedFormAjax, this)); 417 418 // Store Drupal.ajax objects here for all pager links. 419 this.links = []; 420 421 // Add the ajax to pagers. 422 this.$view 423 .once(jQuery.proxy(this.attachPagerAjax, this)); 424 425 // Add a trigger to update this view specifically. In order to trigger a 426 // refresh use the following code. 427 // 428 // @code 429 // jQuery('.view-name').trigger('RefreshView'); 430 // @endcode 431 // Add a trigger to update this view specifically. 432 var self_settings = this.element_settings; 433 self_settings.event = 'RefreshView'; 434 var self = this; 435 this.$view.once('refresh', function () { 436 self.refreshViewAjax = new Drupal.ajax(self.selector, self.$view, self_settings); 437 }); 438 }; 439 440 Drupal.views.ajaxView.prototype.attachExposedFormAjax = function() { 441 var button = $('input[type=submit], button[type=submit], input[type=image]', this.$exposed_form); 442 button = button[0]; 443 444 // Call the autocomplete submit before doing AJAX. 445 $(button).click(function () { 446 if (Drupal.autocompleteSubmit) { 447 Drupal.autocompleteSubmit(); 448 } 449 }); 450 451 this.exposedFormAjax = new Drupal.ajax($(button).attr('id'), button, this.element_settings); 452 }; 453 454 /** 455 * Attach the ajax behavior to each link. 456 */ 457 Drupal.views.ajaxView.prototype.attachPagerAjax = function() { 458 this.$view.find('ul.pager > li > a, ol.pager > li > a, th.views-field a, .attachment .views-summary a') 459 .each(jQuery.proxy(this.attachPagerLinkAjax, this)); 460 }; 461 462 /**
463 * Attach the ajax behavior to a single link. 464 */ 465 Drupal.views.ajaxView.prototype.attachPagerLinkAjax = function(id, link) { 466 var $link = $(link); 467 var viewData = {}; 468 var href = $link.attr('href'); 469 // Don't attach to pagers inside nested views. 470 if ($link.closest('.view')[0] !== this.$view[0] && 471 $link.closest('.view').parent().hasClass('attachment') === false) { 472 return; 473 } 474 475 // Provide a default page if none has been set. This must be done 476 // prior to merging with settings to avoid accidentally using the 477 // page landed on instead of page 1. 478 if (typeof(viewData.page) === 'undefined') { 479 viewData.page = 0; 480 } 481 482 // Construct an object using the settings defaults and then overriding 483 // with data specific to the link. 484 $.extend( 485 viewData, 486 this.settings, 487 Drupal.Views.parseQueryString(href), 488 // Extract argument data from the URL. 489 Drupal.Views.parseViewArgs(href, this.settings.view_base_path) 490 ); 491 492 // For anchor tags, these will go to the target of the anchor rather 493 // than the usual location. 494 $.extend(viewData, Drupal.Views.parseViewArgs(href, this.settings.view_base_path)); 495 496 // Construct an object using the element settings defaults, 497 // then overriding submit with viewData. 498 var pager_settings = $.extend({}, this.element_settings); 499 pager_settings.submit = viewData; 500 this.pagerAjax = new Drupal.ajax(false, $link, pager_settings); 501 this.links.push(this.pagerAjax); 502 }; 503 504 Drupal.ajax.prototype.commands.viewsScrollTop = function (ajax, response, status) { 505 // Scroll to the top of the view. This will allow users 506 // to browse newly loaded content after e.g. clicking a pager 507 // link. 508 var offset = $(response.selector).offset(); 509 // We can't guarantee that the scrollable object should be 510 // the body, as the view could be embedded in something 511 // more complex such as a modal popup. Recurse up the DOM 512 // and scroll the first element that has a non-zero top. 513 var scrollTarget = response.selector; 514 while ($(scrollTarget).scrollTop() == 0 && $(scrollTarget).parent()) { 515 scrollTarget = $(scrollTarget).parent(); 516 } 517 // Only scroll upward. 518 if (offset.top - 10 < $(scrollTarget).scrollTop()) { 519 $(scrollTarget).animate({scrollTop: (offset.top - 10)}, 500); 520 } 521 }; 522 523})(jQuery); 524;
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.