UNPKG

@europeana/portal

Version:
2 lines 16.1 kB
(window.webpackJsonp=window.webpackJsonp||[]).push([[73],{1135:function(t,e,r){"use strict";r.r(e);var n=r(23),l=(r(75),r(10),r(43),r(46),r(250),r(21),r(81),r(47),r(15),r(64),r(60),r(31)),o=r(716),c=r(711),d=20,h={name:"GalleriesIndexPage",components:{AlertMessage:function(){return r.e(4).then(r.bind(null,727))},ContentHeader:o.a,ContentCard:c.default,LoadingSpinner:function(){return r.e(5).then(r.bind(null,729))},PaginationNavInput:function(){return r.e(23).then(r.bind(null,733))}},middleware:"sanitisePageQuery",data:function(){return{galleries:[],perPage:d,total:0}},fetch:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.setGalleriesEnabled){e.next=5;break}return e.next=3,t.fetchSetGalleries();case 3:e.next=7;break;case 5:return e.next=7,t.fetchContentfulGalleries();case 7:t.$scrollTo&&t.$scrollTo("#header");case 8:case"end":return e.stop()}}),e)})))()},head:function(){return{title:this.$pageHeadTitle(this.$tc("galleries.galleries",2))}},computed:{setGalleriesEnabled:function(){return this.$features.setGalleries},page:function(){return Number(this.$route.query.page||1)}},watch:{"$route.query.page":"$fetch"},methods:{fetchSetGalleries:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={query:"visibility:published",pageSize:d,page:t.page-1,profile:"standard"},e.next=3,t.$apis.set.search(r,{withMinimalItemPreviews:!0});case 3:n=e.sent,t.galleries=t.parseSets(n.data.items),t.total=n.data.partOf.total,t.perPage=d;case 7:case"end":return e.stop()}}),e)})))()},parseSets:function(t){var e=this;return t.map((function(t){return{slug:Object(l.f)(t.id,t.title.en),title:t.title,description:t.description,thumbnail:e.setPreviewUrl(t.items[0].edmPreview)}}))},setPreviewUrl:function(t){return this.$apis.thumbnail.edmPreview(t,{size:400})},fetchContentfulGalleries:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={locale:t.$i18n.isoLocale(),preview:"preview"===t.$route.query.mode,limit:d,skip:(t.$store.state.sanitised.page-1)*d},e.next=3,t.$contentful.query("galleryFoyerPage",r).then((function(t){return t.data.data})).catch((function(e){t.error({statusCode:500,message:e.toString()})}));case 3:n=e.sent,t.galleries=n.imageGalleryCollection.items,t.total=n.imageGalleryCollection.total,t.perPage=d;case 7:case"end":return e.stop()}}),e)})))()},imageUrl:function(data){var t,e,r=(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(r,{size:400})}}},f=r(59),component=Object(f.a)(h,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("b-container",[r("ContentHeader",{attrs:{title:t.$tc("galleries.galleries",2),description:t.$t("galleries.description")}}),t._v(" "),r("b-row",{staticClass:"flex-md-row pb-5"},[r("b-col",{attrs:{cols:"12"}},[t.$fetchState.pending?r("b-container",{attrs:{"data-qa":"loading spinner container"}},[r("b-row",{staticClass:"flex-md-row py-4 text-center"},[r("b-col",{attrs:{cols:"12"}},[r("LoadingSpinner")],1)],1)],1):t.$fetchState.error?r("b-container",{attrs:{"data-qa":"alert message container"}},[r("b-row",{staticClass:"flex-md-row py-4"},[r("b-col",{attrs:{cols:"12"}},[r("AlertMessage",{attrs:{error:t.$fetchState.error.message}})],1)],1)],1):r("b-card-group",{staticClass:"card-deck-4-cols",attrs:{deck:"","data-qa":"gallery foyer"}},[t.setGalleriesEnabled?t._l(t.galleries,(function(t){return r("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 r("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(" "),r("b-row",[r("b-col",[r("PaginationNavInput",{attrs:{"total-results":t.total,"per-page":t.perPage}})],1)],1)],1)}),[],!1,null,null,null);e.default=component.exports},706:function(t,e,r){var content=r(709);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,r(138).default)("688b9c6f",content,!0,{sourceMap:!1})},707:function(t,e,r){"use strict";r(16),r(15),r(13),r(10),r(19),r(14),r(20);var n=r(2),l=r(108);function o(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,r)}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(n.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(l.b)({shareUrl:"http/canonicalUrlWithoutLocale"})),{},{networks:function(){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=(r(708),r(59)),component=Object(h.a)(d,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",t._l(t.networks,(function(e,n){return r("b-link",{key:n,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(r){t.$matomo&&t.$matomo.trackEvent("Item_share","Click social share button",e.url)}}},[r("span",{class:"icon-"+e.identifier}),t._v(" "),t.withText?r("span",{staticClass:"text"},[t._v(t._s(e.name)+"\n ")]):t._e()])})),1)}),[],!1,null,"a553b8a4",null);e.a=component.exports},708:function(t,e,r){"use strict";r(706)},709:function(t,e,r){var n=r(137)(!1);n.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=n},711:function(t,e,r){"use strict";r.r(e);var n=r(44),l=(r(10),r(43),r(46),r(250),r(47),r(21),r(52),r(58),r(62),r(30),r(41),r(67),r(34),r(107),r(60),r(13),r(50),r(104),r(176)),o=r.n(l),c=r(203),d=r(712),h=r(31),f=r(204),m={name:"ContentCard",components:{ClientOnly:o.a,SmartLink:c.a,MediaDefaultThumbnail:function(){return r.e(24).then(r.bind(null,1172))}},mixins:[d.a],props:{title:{type:[String,Object],default:""},subTitle:{type:String,default:null},texts:{type:Array,default:function(){return[]}},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:function(){return{}}},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:function(){return{cardImageUrl:this.imageUrl,displayLabelTypes:"exhibitions|galleries|blog|collections",themes:f.a.map((function(t){return t.id}))}},computed:{cardClass:function(){return"".concat(this.variant,"-card")},displayTitle:function(){if(this.title){if("string"==typeof this.title)return{value:this.title,code:null};var t=Object(h.h)(this.title,this.$i18n.locale);return{value:t.values[0],code:t.code}}return null},displaySubTitle:function(){return this.subTitle||this.displayLabel},displayLabel:function(){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:function(){return"object"===Object(n.a)(this.url)?this.url.params.type:this.url.split("/").slice(-2,-1)},displayLabelType:function(){return!!this.displayLabelMatch&&this.displayLabelMatch[1]},displayLabelMatch:function(){return"object"===Object(n.a)(this.url)?this.displayLabelMatchObject:this.displayLabelMatchString},displayLabelMatchObject:function(){return this.url.name.match(new RegExp("(".concat(this.displayLabelTypes,")")))},displayLabelMatchString:function(){return this.url.match(new RegExp("/(".concat(this.displayLabelTypes,")[/.]")))},displayTexts:function(){var t=this;return this.texts.filter(Boolean).map((function(e){return"string"==typeof e?{values:[e],code:null}:Array.isArray(e)?{values:e,code:null}:Object(h.h)(e,t.$i18n.locale,{omitUrisIfOtherValues:t.omitUrisIfOtherValues,omitAllUris:t.omitAllUris})}))},optimisedImageUrl:function(){return this.$options.filters.optimisedImageUrl(this.imageUrl,this.imageContentType,this.imageOptimisationOptions)}},watch:{imageUrl:function(){this.cardImageUrl=this.imageUrl}},methods:{cardText:function(t){var e=this.limitValuesWithinEachText>-1?t.slice(0,this.limitValuesWithinEachText):[].concat(t);t.length>e.length&&e.push(this.$t("formatting.ellipsis"));var r=e.join(this.$t("formatting.listSeperator")+" "),n=this.stripMarkdown(r);return this.$options.filters.truncate(n,255,this.$t("formatting.ellipsis"))},redrawMasonry:function(){var t=this;this.$redrawVueMasonry&&this.$nextTick((function(){t.$redrawVueMasonry()}))},imageNotFound:function(){this.cardImageUrl="",this.redrawMasonry()},imageLoaded:function(t){t.target.src.startsWith("data:")||this.redrawMasonry()}}},y=r(59),v=r(715),w=r.n(v),component=Object(y.a)(m,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("b-card",{staticClass:"text-left content-card",class:t.cardClass,attrs:{"data-qa":"content card","no-body":""}},[r("div",{staticClass:"card-wrapper"},[r("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?r("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?r("div",{staticClass:"card-img",class:{logo:t.logo}},[t.lazy?r("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)}}}):r("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?r("b-card-body",{attrs:{"data-qa":"card body"}},[t.displaySubTitle&&"mini"!==t.variant&&t.showSubtitle?r("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(" "),r("div",{staticClass:"title-texts-wrapper"},[t.displayTitle?r("b-card-title",{attrs:{"title-tag":"div","data-qa":"card title",lang:t.displayTitle.code}},[r("span",[t._v("\n "+t._s(t._f("truncate")(t.displayTitle.value,90,t.$t("formatting.ellipsis")))+"\n ")])]):t._e(),t._v(" "),t.hitsText?r("b-card-text",{attrs:{"text-tag":"div","data-qa":"highlighted search term"}},[r("p",[t._v("\n "+t._s(t.hitsText.prefix)),r("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 r("b-card-text",{key:e,attrs:{lang:text.code,"text-tag":"div"}},[r("p",{domProps:{innerHTML:t._s(t.cardText(text.values))}})])})):t._e()],2),t._v(" "),r("client-only",[t._t("footer")],2)],1):t._e()],1),t._v(" "),r("client-only",[t._t("image-overlay")],2)],1)}),[],!1,null,null,null);"function"==typeof w.a&&w()(component);e.default=component.exports},712:function(t,e,r){"use strict";r(30),r(47),r(107),r(21),r(60),r(37),r(41),r(10),r(34),r(68),r(43),r(15),r(64),r(71),r(46);var n=r(717);function l(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,d=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return c=t.done,t},e:function(t){d=!0,l=t},f:function(){try{c||null==r.return||r.return()}finally{if(d)throw l}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=new Array(e);i<e;i++)r[i]=t[i];return r}var c=function(t){return[/\n$/].concat(t.map((function(t){return new RegExp("</?".concat(t,".*?>"),"gi")})))};e.a={methods:{stripMarkdown:function(text){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[""];text=n.marked.parse(text);var e,r=l(c(t));try{for(r.s();!(e=r.n()).done;){var pattern=e.value;text=text.replace(pattern,"")}}catch(t){r.e(t)}finally{r.f()}return text}}}},715:function(t,e){},716:function(t,e,r){"use strict";var n={components:{SocialShare:r(707).a},props:{title:{type:String,required:!0},description:{type:String,default:null},mediaUrl:{type:String,default:null},contextLabel:{type:String,default:null}}},l=r(59),component=Object(l.a)(n,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("header",{staticClass:"row"},[r("b-col",{staticClass:"col lead mt-3",attrs:{cols:"12",lg:"9"}},[t.contextLabel?r("div",{staticClass:"context-label",attrs:{"data-qa":"context label"}},[t._v("\n "+t._s(t.contextLabel)+"\n ")]):t._e(),t._v(" "),r("h1",{attrs:{"data-qa":"page title"}},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),t.description?r("div",{domProps:{innerHTML:t._s(t.description)}}):t._e()]),t._v(" "),t.mediaUrl?r("b-col",{staticClass:"pt-0 pb-3 py-lg-3 text-left text-lg-right",attrs:{cols:"12",lg:"3"}},[r("SocialShare",{attrs:{"media-url":t.mediaUrl}})],1):t._e()],1)}),[],!1,null,null,null);e.a=component.exports}}]); //# sourceMappingURL=fec6a37.js.map