UNPKG

@europeana/portal

Version:
2 lines 13.8 kB
(window.webpackJsonp=window.webpackJsonp||[]).push([[72],{1064:function(t,e,l){"use strict";l.r(e);var r=l(16),n=(l(21),l(42),l(22),l(14),l(58),l(250),l(41),l(24)),o=l(648),c=l(641),d=20,h={name:"GalleriesIndexPage",components:{AlertMessage:()=>l.e(3).then(l.bind(null,658)),ContentHeader:o.a,ContentCard:c.default,LoadingSpinner:()=>l.e(4).then(l.bind(null,660)),PaginationNavInput:()=>l.e(22).then(l.bind(null,665))},middleware:"sanitisePageQuery",data:()=>({galleries:[],perPage:d,total:0}),fetch(){var t=this;return Object(r.a)((function*(){t.setGalleriesEnabled?yield t.fetchSetGalleries():yield t.fetchContentfulGalleries(),t.$scrollTo&&t.$scrollTo("#header")}))()},head(){return{title:this.$pageHeadTitle(this.$tc("galleries.galleries",2))}},computed:{setGalleriesEnabled(){return this.$features.setGalleries},page(){return Number(this.$route.query.page||1)}},watch:{"$route.query.page":"$fetch"},methods:{fetchSetGalleries(){var t=this;return Object(r.a)((function*(){var e={query:"visibility:published",pageSize:d,page:t.page-1,profile:"standard"},l=yield t.$apis.set.search(e,{withMinimalItemPreviews:!0});t.galleries=t.parseSets(l.data.items),t.total=l.data.partOf.total,t.perPage=d}))()},parseSets(t){return t.map((t=>({slug:Object(n.f)(t.id,t.title.en),title:t.title,description:t.description,thumbnail:this.setPreviewUrl(t.items[0].edmPreview)})))},setPreviewUrl(t){return this.$apis.thumbnail.edmPreview(t,{size:400})},fetchContentfulGalleries(){var t=this;return Object(r.a)((function*(){var e={locale:t.$i18n.isoLocale(),preview:"preview"===t.$route.query.mode,limit:d,skip:(t.$store.state.sanitised.page-1)*d},l=yield t.$contentful.query("galleryFoyerPage",e).then((t=>t.data.data)).catch((e=>{t.error({statusCode:500,message:e.toString()})}));t.galleries=l.imageGalleryCollection.items,t.total=l.imageGalleryCollection.total,t.perPage=d}))()},imageUrl(data){var t,e,l=(null===(t=data.encoding)||void 0===t||null===(e=t.edmPreview)||void 0===e?void 0:e[0])||data.thumbnailUrl;return this.$apis.thumbnail.edmPreview(l,{size:400})}}},m=l(40),component=Object(m.a)(h,(function(){var t=this,e=t.$createElement,l=t._self._c||e;return l("b-container",[l("ContentHeader",{attrs:{title:t.$tc("galleries.galleries",2),description:t.$t("galleries.description")}}),t._v(" "),l("b-row",{staticClass:"flex-md-row pb-5"},[l("b-col",{attrs:{cols:"12"}},[t.$fetchState.pending?l("b-container",{attrs:{"data-qa":"loading spinner container"}},[l("b-row",{staticClass:"flex-md-row py-4 text-center"},[l("b-col",{attrs:{cols:"12"}},[l("LoadingSpinner")],1)],1)],1):t.$fetchState.error?l("b-container",{attrs:{"data-qa":"alert message container"}},[l("b-row",{staticClass:"flex-md-row py-4"},[l("b-col",{attrs:{cols:"12"}},[l("AlertMessage",{attrs:{error:t.$fetchState.error.message}})],1)],1)],1):l("b-card-group",{staticClass:"card-deck-4-cols",attrs:{deck:"","data-qa":"gallery foyer"}},[t.setGalleriesEnabled?t._l(t.galleries,(function(t){return l("ContentCard",{key:t.slug,attrs:{title:t.title,url:{name:"galleries-all",params:{pathMatch:t.slug}},"image-url":t.thumbnail,texts:[t.description],"show-subtitle":!1}})})):t._l(t.galleries,(function(e){return l("ContentCard",{key:e.identifier,attrs:{title:e.name,url:{name:"galleries-all",params:{pathMatch:e.identifier}},"image-url":e.hasPartCollection.items[0]&&t.imageUrl(e.hasPartCollection.items[0]),texts:[e.description],"show-subtitle":!1}})}))],2)],1)],1),t._v(" "),l("b-row",[l("b-col",[l("PaginationNavInput",{attrs:{"total-results":t.total,"per-page":t.perPage}})],1)],1)],1)}),[],!1,null,null,null);e.default=component.exports},637:function(t,e,l){var content=l(640);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,l(106).default)("688b9c6f",content,!0,{sourceMap:!1})},638:function(t,e,l){"use strict";var r=l(6),n=l(82);function o(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(object);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,l)}return e}function c(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?o(Object(source),!0).forEach((function(e){Object(r.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):o(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var d={name:"SocialShare",props:{mediaUrl:{type:String,default:""},withText:{type:Boolean,default:!1}},computed:c(c({},Object(n.b)({shareUrl:"http/canonicalUrlWithoutLocale"})),{},{networks(){return[{identifier:"facebook",name:"Facebook",url:"https://www.facebook.com/sharer/sharer.php?display=page&u=".concat(this.shareUrl)},{identifier:"twitter",name:"Twitter",url:"https://twitter.com/intent/tweet?text=".concat(this.shareUrl)},{identifier:"pinterest",name:"Pinterest",url:"https://pinterest.com/pin/create/link/?url=".concat(this.shareUrl)+(this.mediaUrl?"&media=".concat(this.mediaUrl):"")}]}})},h=(l(639),l(40)),component=Object(h.a)(d,(function(){var t=this,e=t.$createElement,l=t._self._c||e;return l("div",t._l(t.networks,(function(e,r){return l("b-link",{key:r,class:"social-share mr-1 "+e.identifier,attrs:{title:t.$t("actions.shareOn",{social:e.name}),href:e.url,"data-qa":"share "+e.identifier+" button"},nativeOn:{click:function(l){t.$matomo&&t.$matomo.trackEvent("Item_share","Click social share button",e.url)}}},[l("span",{class:"icon-"+e.identifier}),t._v(" "),t.withText?l("span",{staticClass:"text"},[t._v(t._s(e.name)+"\n ")]):t._e()])})),1)}),[],!1,null,"a553b8a4",null);e.a=component.exports},639:function(t,e,l){"use strict";l(637)},640:function(t,e,l){var r=l(105)(!1);r.push([t.i,"a[data-v-a553b8a4]{align-items:center;background:transparent;border:1px solid #1a1a1a;border-radius:50%;color:#1a1a1a;display:inline-flex;height:calc(2.5rem - 1px);justify-content:center;text-decoration:none;transition:background .25s;width:calc(2.5rem - 1px)}a [class^=icon][data-v-a553b8a4]{color:#1a1a1a;font-size:1.25rem}a[data-v-a553b8a4]:hover{background:#1a1a1a}a:hover [class^=icon][data-v-a553b8a4]{color:#fff}",""]),t.exports=r},641:function(t,e,l){"use strict";l.r(e);l(21),l(42),l(22),l(14),l(38),l(43),l(48),l(80),l(41),l(76);var r=l(141),n=l.n(r),o=l(159),c=l(642),d=l(24),h=l(160),m={name:"ContentCard",components:{ClientOnly:n.a,SmartLink:o.a,MediaDefaultThumbnail:()=>l.e(23).then(l.bind(null,1101))},mixins:[c.a],props:{title:{type:[String,Object],default:""},subTitle:{type:String,default:null},texts:{type:Array,default:()=>[]},hitsText:{type:Object,default:null},url:{type:[String,Object],default:""},imageUrl:{type:String,default:""},imageContentType:{type:String,default:null},imageWidth:{type:Number,default:null},imageHeight:{type:Number,default:null},imageAlt:{type:String,default:""},imageOptimisationOptions:{type:Object,default:()=>({})},lazy:{type:Boolean,default:!0},showSubtitle:{type:Boolean,default:!0},variant:{type:String,default:"default"},omitAllUris:{type:Boolean,default:!1},omitUrisIfOtherValues:{type:Boolean,default:!1},limitValuesWithinEachText:{type:Number,default:-1},blankImageHeight:{type:Number,default:null},blankImageWidth:{type:Number,default:null},logo:{type:Boolean,default:!1},mediaType:{type:String,default:null},offset:{type:Number,default:null}},data(){return{cardImageUrl:this.imageUrl,displayLabelTypes:"exhibitions|galleries|blog|collections",themes:h.a.map((t=>t.id))}},computed:{cardClass(){return"".concat(this.variant,"-card")},displayTitle(){if(this.title){if("string"==typeof this.title)return{value:this.title,code:null};var t=Object(d.h)(this.title,this.$i18n.locale);return{value:t.values[0],code:t.code}}return null},displaySubTitle(){return this.subTitle||this.displayLabel},displayLabel(){if(!this.displayLabelType)return!1;if("collections"===this.displayLabelType){var t="string"==typeof this.url?this.url.split("/").pop().split("-").shift():this.url.params.pathMatch;return this.themes.includes(t)?this.$t("cardLabels.theme"):this.$t("cardLabels.".concat(this.displayLabelTypeCollections))}return"blog"===this.displayLabelType?this.$tc("blog.posts",1):this.$tc("".concat(this.displayLabelType,".").concat(this.displayLabelType),1)},displayLabelTypeCollections(){return"object"==typeof this.url?this.url.params.type:this.url.split("/").slice(-2,-1)},displayLabelType(){return!!this.displayLabelMatch&&this.displayLabelMatch[1]},displayLabelMatch(){return"object"==typeof this.url?this.displayLabelMatchObject:this.displayLabelMatchString},displayLabelMatchObject(){return this.url.name.match(new RegExp("(".concat(this.displayLabelTypes,")")))},displayLabelMatchString(){return this.url.match(new RegExp("/(".concat(this.displayLabelTypes,")[/.]")))},displayTexts(){return this.texts.filter(Boolean).map((t=>"string"==typeof t?{values:[t],code:null}:Array.isArray(t)?{values:t,code:null}:Object(d.h)(t,this.$i18n.locale,{omitUrisIfOtherValues:this.omitUrisIfOtherValues,omitAllUris:this.omitAllUris})))},optimisedImageUrl(){return this.$options.filters.optimisedImageUrl(this.imageUrl,this.imageContentType,this.imageOptimisationOptions)}},watch:{imageUrl(){this.cardImageUrl=this.imageUrl}},methods:{cardText(t){var e=this.limitValuesWithinEachText>-1?t.slice(0,this.limitValuesWithinEachText):[].concat(t);t.length>e.length&&e.push(this.$t("formatting.ellipsis"));var l=e.join(this.$t("formatting.listSeperator")+" "),r=this.stripMarkdown(l);return this.$options.filters.truncate(r,255,this.$t("formatting.ellipsis"))},redrawMasonry(){this.$redrawVueMasonry&&this.$nextTick((()=>{this.$redrawVueMasonry()}))},imageNotFound(){this.cardImageUrl="",this.redrawMasonry()},imageLoaded(t){t.target.src.startsWith("data:")||this.redrawMasonry()}}},f=l(40),y=l(643),v=l.n(y),component=Object(f.a)(m,(function(){var t=this,e=t.$createElement,l=t._self._c||e;return l("b-card",{staticClass:"text-left content-card",class:t.cardClass,attrs:{"data-qa":"content card","no-body":""}},[l("div",{staticClass:"card-wrapper"},[l("SmartLink",{attrs:{destination:t.url,"link-class":"card-link","aria-label":t.displayTitle?t.displayTitle.value:null,title:"mosaic"===t.variant&&t.displayTitle?t.displayTitle.value:null}}),t._v(" "),"mini"!==t.variant?l("MediaDefaultThumbnail",{directives:[{name:"show",rawName:"v-show",value:!t.cardImageUrl,expression:"!cardImageUrl"}],attrs:{"media-type":t.mediaType,offset:t.offset}}):t._e(),t._v(" "),t.cardImageUrl?l("div",{staticClass:"card-img",class:{logo:t.logo}},[t.lazy?l("b-img-lazy",{attrs:{src:t.optimisedImageUrl,"blank-width":t.blankImageWidth,"blank-height":t.blankImageHeight,width:t.imageWidth,height:t.imageHeight,alt:t.imageAlt},nativeOn:{error:function(e){return t.imageNotFound.apply(null,arguments)},load:function(e){return t.imageLoaded.apply(null,arguments)}}}):l("b-img",{attrs:{src:t.optimisedImageUrl,width:t.imageWidth,height:t.imageHeight,alt:t.imageAlt},on:{error:t.imageNotFound,load:t.imageLoaded}})],1):t._e(),t._v(" "),"mosaic"!==t.variant?l("b-card-body",{attrs:{"data-qa":"card body"}},[t.displaySubTitle&&"mini"!==t.variant&&t.showSubtitle?l("b-card-sub-title",{staticClass:"mt-0",attrs:{"sub-title-tag":"div","sub-title-text-variant":"default"}},[t._v("\n "+t._s(t.displaySubTitle)+"\n ")]):t._e(),t._v(" "),l("div",{staticClass:"title-texts-wrapper"},[t.displayTitle?l("b-card-title",{attrs:{"title-tag":"div","data-qa":"card title",lang:t.displayTitle.code}},[l("span",[t._v("\n "+t._s(t._f("truncate")(t.displayTitle.value,90,t.$t("formatting.ellipsis")))+"\n ")])]):t._e(),t._v(" "),t.hitsText?l("b-card-text",{attrs:{"text-tag":"div","data-qa":"highlighted search term"}},[l("p",[t._v("\n "+t._s(t.hitsText.prefix)),l("strong",{staticClass:"has-text-highlight"},[t._v(t._s(t.hitsText.exact))]),t._v(t._s(t.hitsText.suffix)+"\n ")])]):t._e(),t._v(" "),t.displayTexts.length>0?t._l(t.displayTexts,(function(text,e){return l("b-card-text",{key:e,attrs:{lang:text.code,"text-tag":"div"}},[l("p",{domProps:{innerHTML:t._s(t.cardText(text.values))}})])})):t._e()],2),t._v(" "),l("client-only",[t._t("footer")],2)],1):t._e()],1),t._v(" "),l("client-only",[t._t("image-overlay")],2)],1)}),[],!1,null,null,null);"function"==typeof v.a&&v()(component);e.default=component.exports},642:function(t,e,l){"use strict";l(80),l(14),l(41),l(21),l(22),l(28);var r=l(645);e.a={methods:{stripMarkdown(text){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[""];for(var pattern of(text=r.marked.parse(text),(t=>[/\n$/].concat(t.map((t=>new RegExp("</?".concat(t,".*?>"),"gi")))))(t)))text=text.replace(pattern,"");return text}}}},643:function(t,e){},648:function(t,e,l){"use strict";var r={components:{SocialShare:l(638).a},props:{title:{type:String,required:!0},description:{type:String,default:null},mediaUrl:{type:String,default:null},contextLabel:{type:String,default:null}}},n=l(40),component=Object(n.a)(r,(function(){var t=this,e=t.$createElement,l=t._self._c||e;return l("header",{staticClass:"row"},[l("b-col",{staticClass:"col lead mt-3",attrs:{cols:"12",lg:"9"}},[t.contextLabel?l("div",{staticClass:"context-label",attrs:{"data-qa":"context label"}},[t._v("\n "+t._s(t.contextLabel)+"\n ")]):t._e(),t._v(" "),l("h1",{attrs:{"data-qa":"page title"}},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),t.description?l("div",{domProps:{innerHTML:t._s(t.description)}}):t._e()]),t._v(" "),t.mediaUrl?l("b-col",{staticClass:"pt-0 pb-3 py-lg-3 text-left text-lg-right",attrs:{cols:"12",lg:"3"}},[l("SocialShare",{attrs:{"media-url":t.mediaUrl}})],1):t._e()],1)}),[],!1,null,null,null);e.a=component.exports}}]); //# sourceMappingURL=884f2ca.modern.js.map