vue-gallery
Version:
VueJS responsive and customizable image and video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers.
2 lines (1 loc) • 5.16 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("blueimp-gallery/css/blueimp-gallery.min.css"),require("blueimp-gallery/js/blueimp-helper.js"),require("blueimp-gallery/js/blueimp-gallery.js"),require("blueimp-gallery/js/blueimp-gallery-fullscreen.js"),require("blueimp-gallery/js/blueimp-gallery-video.js"),require("blueimp-gallery/js/blueimp-gallery-youtube.js"),require("blueimp-gallery/js/blueimp-gallery-vimeo.js")):"function"==typeof define&&define.amd?define(["blueimp-gallery/css/blueimp-gallery.min.css","blueimp-gallery/js/blueimp-helper.js","blueimp-gallery/js/blueimp-gallery.js","blueimp-gallery/js/blueimp-gallery-fullscreen.js","blueimp-gallery/js/blueimp-gallery-video.js","blueimp-gallery/js/blueimp-gallery-youtube.js","blueimp-gallery/js/blueimp-gallery-vimeo.js"],t):(e=e||self).VueGallery=t(null,null,e.blueimp)}(this,function(e,t,i){"use strict";var n={props:{images:{type:Array,default:function(){return[]}},options:{type:Object,default:function(){return{}}},carousel:{type:Boolean,default:!1},index:{type:Number},id:{type:String,default:"blueimp-gallery"}},data:function(){return{instance:null}},watch:{index:function(e){this.carousel||(null!==e?this.open(e):(this.instance&&this.instance.close(),this.$emit("close")))}},mounted:function(){this.carousel&&this.open()},destroyed:function(){null!==this.instance&&(this.instance.destroyEventListeners(),this.instance.close(),this.instance=null)},methods:{open:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=void 0!==window.blueimp&&void 0!==window.blueimp.Gallery?window.blueimp.Gallery:i,l=Object.assign({toggleControlsOnReturn:!1,toggleControlsOnSlideClick:!1,closeOnSlideClick:!1,carousel:this.carousel,container:"#".concat(this.id),index:t,onopen:function(){return e.$emit("onopen")},onopened:function(){return e.$emit("onopened")},onslide:this.onSlideCustom,onslideend:function(t,i){return e.$emit("onslideend",{index:t,slide:i})},onslidecomplete:function(t,i){return e.$emit("onslidecomplete",{index:t,slide:i})},onclose:function(){return e.$emit("close")},onclosed:function(){return e.$emit("onclosed")}},this.options);this.carousel&&(l.container=this.$el),this.instance=n(this.images,l)},onSlideCustom:function(e,t){this.$emit("onslide",{index:e,slide:t});var i=this.images[e];if(void 0!==i){var n=i.description,l=this.instance.container.find(".description");n&&(l.empty(),l[0].appendChild(document.createTextNode(n)))}}}};var l=function(e,t,i,n,l,s,o,r,a,u){"boolean"!=typeof o&&(a=r,r=o,o=!1);var c,d="function"==typeof i?i.options:i;if(e&&e.render&&(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0,l&&(d.functional=!0)),n&&(d._scopeId=n),s?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,a(e)),e&&e._registeredComponents&&e._registeredComponents.add(s)},d._ssrRegister=c):t&&(c=o?function(){t.call(this,u(this.$root.$options.shadowRoot))}:function(e){t.call(this,r(e))}),c)if(d.functional){var p=d.render;d.render=function(e,t){return c.call(t),p(e,t)}}else{var m=d.beforeCreate;d.beforeCreate=m?[].concat(m,c):[c]}return i},s="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());var o=document.head||document.getElementsByTagName("head")[0],r={};return l({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"blueimp-gallery blueimp-gallery-controls",class:{"blueimp-gallery-carousel":e.carousel},attrs:{id:e.id}},[i("div",{staticClass:"slides"}),e._v(" "),i("h3",{staticClass:"title"}),e._v(" "),i("p",{staticClass:"description"}),e._v(" "),i("a",{staticClass:"prev"},[e._t("prev",[e._v("‹")])],2),e._v(" "),i("a",{staticClass:"next"},[e._t("next",[e._v("›")])],2),e._v(" "),e.carousel?e._e():i("a",{staticClass:"close"},[e._t("close",[e._v("×")])],2),e._v(" "),e.carousel?e._e():i("ol",{staticClass:"indicator"}),e._v(" "),e.carousel?i("a",{staticClass:"play-pause"}):e._e()])},staticRenderFns:[]},function(e){e&&e("data-v-1318c6fe_0",{source:".blueimp-gallery>.description{position:absolute;top:30px;left:15px;color:#fff;display:none}.blueimp-gallery-controls>.description{display:block}",map:void 0,media:void 0})},n,void 0,!1,void 0,function(e){return function(e,t){return function(e,t){var i=s?t.media||"default":e,n=r[i]||(r[i]={ids:new Set,styles:[]});if(!n.ids.has(e)){n.ids.add(e);var l=t.source;if(t.map&&(l+="\n/*# sourceURL="+t.map.sources[0]+" */",l+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),n.element||(n.element=document.createElement("style"),n.element.type="text/css",t.media&&n.element.setAttribute("media",t.media),o.appendChild(n.element)),"styleSheet"in n.element)n.styles.push(l),n.element.styleSheet.cssText=n.styles.filter(Boolean).join("\n");else{var a=n.ids.size-1,u=document.createTextNode(l),c=n.element.childNodes;c[a]&&n.element.removeChild(c[a]),c.length?n.element.insertBefore(u,c[a]):n.element.appendChild(u)}}}(e,t)}},void 0)});