photos/js/photos-src_views_SharedAlbu...

3 lines
8.9 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! For license information please see photos-src_views_SharedAlbumContent_vue.js.LICENSE.txt */
"use strict";(self.webpackChunkphotos=self.webpackChunkphotos||[]).push([["src_views_SharedAlbumContent_vue"],{60213:(t,e,o)=>{o.d(e,{Z:()=>c});var l=o(20629),n=o(64024),i=o(69363),a=o(87076),s=o(59537),r=o(32114);const c={name:"FetchCollectionContentMixin",data:()=>({fetchSemaphore:new r.Z(1),loadingCollection:!1,loadingCollectionFiles:!1,errorFetchingCollection:null,errorFetchingCollectionFiles:null}),mixins:[i.Z],methods:{...(0,l.nv)(["appendFiles","addCollections","setCollectionFiles"]),async fetchCollection(t,e,o){if(this.loadingCollection)return null;try{this.loadingCollection=!0,this.errorFetchingCollection=null;const l=await(0,a.lA)(t,{signal:this.abortController.signal},e,o);return this.addCollections({collections:[l]}),l}catch(t){var l;if(404===(null===(l=t.response)||void 0===l?void 0:l.status))return this.errorFetchingCollection=404,null;this.errorFetchingCollection=t,s.Z.error("[PublicCollectionContent] Error fetching collection",{error:t}),(0,n.x2)(this.t("photos","Failed to fetch collection."))}finally{this.loadingCollection=!1}return null},async fetchCollectionFiles(t,e,o){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(this.loadingCollectionFiles)return[];const i=await this.fetchSemaphore.acquire();try{this.errorFetchingCollectionFiles=null,this.loadingCollectionFiles=!0;let n=await(0,a.dB)(t,{signal:this.abortController.signal},e,o);const i=n.map((t=>t.fileid.toString()));return l.forEach((t=>n=n.map(t))),this.appendFiles(n),n.length>0&&await this.$store.commit("setCollectionFiles",{collectionFileName:t,fileIds:i}),n}catch(t){var r;if(404===(null===(r=t.response)||void 0===r?void 0:r.status))return this.errorFetchingCollectionFiles=404,[];this.errorFetchingCollectionFiles=t,(0,n.x2)(this.t("photos","Failed to fetch collections list.")),s.Z.error("[PublicCollectionContent] Error fetching collection files",{error:t})}finally{this.loadingCollectionFiles=!1,this.fetchSemaphore.release(i)}return[]}}}},80463:(t,e,o)=>{o.d(e,{Z:()=>s});var l=o(87537),n=o.n(l),i=o(23645),a=o.n(i)()(n());a.push([t.id,".album[data-v-8d782e7e]{display:flex;flex-direction:column}.album__title[data-v-8d782e7e]{width:100%}.album__name[data-v-8d782e7e]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.album__location[data-v-8d782e7e]{margin-left:-4px;display:flex;color:var(--color-text-lighter)}","",{version:3,sources:["webpack://./src/views/SharedAlbumContent.vue"],names:[],mappings:"AAEA,wBACC,YAAA,CACA,qBAAA,CAEA,+BACC,UAAA,CAGD,8BACC,eAAA,CACA,kBAAA,CACA,sBAAA,CAGD,kCACC,gBAAA,CACA,YAAA,CACA,+BAAA",sourcesContent:['$sizes: ("400": ("count": 3, "marginTop": 66, "marginW": 8), "700": ("count": 4, "marginTop": 66, "marginW": 8), "1024": ("count": 5, "marginTop": 66, "marginW": 44), "1280": ("count": 4, "marginTop": 66, "marginW": 44), "1440": ("count": 5, "marginTop": 88, "marginW": 66), "1600": ("count": 6, "marginTop": 88, "marginW": 66), "2048": ("count": 7, "marginTop": 88, "marginW": 66), "2560": ("count": 8, "marginTop": 88, "marginW": 88), "3440": ("count": 9, "marginTop": 88, "marginW": 88), "max": ("count": 10, "marginTop": 88, "marginW": 88));\n\n.album {\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t&__title {\n\t\twidth: 100%;\n\t}\n\n\t&__name {\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t&__location {\n\t\tmargin-left: -4px;\n\t\tdisplay: flex;\n\t\tcolor: var(--color-text-lighter);\n\t}\n}\n'],sourceRoot:""}]);const s=a},36808:(t,e,o)=>{o.r(e),o.d(e,{default:()=>B});var l=o(20629),n=o(64882),i=o(41922),a=o(31352),s=o(41316),r=o(5352),c=o(42588),m=o(85109),u=o(44893),d=o(66951),h=o(60213),b=o(70877),p=o(41197),A=o(45947);const C={name:"SharedAlbumContent",components:{MapMarker:s.Z,Plus:r.Z,Close:u.Z,Delete:c.Z,ImagePlus:m.Z,NcEmptyContent:n.SL,NcActions:n.O3,NcActionButton:n.Js,NcActionSeparator:n.rr,NcButton:n.P2,NcUserBubble:n.uq,CollectionContent:b.Z,PhotosPicker:A.Z,HeaderNavigation:p.Z},mixins:[h.Z,d.Z,n.tq],props:{albumName:{type:String,default:"/"}},data:()=>({showAddPhotosModal:!1,loadingCount:0,loadingAddFilesToAlbum:!1,collaboratorTypes:i.D}),computed:{...(0,l.Se)(["files","sharedAlbumsFiles"]),album(){return this.$store.getters.getSharedAlbum(this.albumName)},albumFileIds(){return this.$store.getters.getSharedAlbumFiles(this.albumName)},albumOriginalName(){return this.albumName.replace(new RegExp("\\(".concat(this.album.collaborators[0].id,"\\)$")),"")},albumFileName(){return this.$store.getters.getSharedAlbumName(this.albumName)}},async mounted(){this.fetchAlbum(),this.fetchAlbumContent()},methods:{...(0,l.nv)(["addFilesToCollection","removeFilesFromCollection","deleteCollection"]),async fetchAlbum(){await this.fetchCollection(this.albumFileName,["<nc:location />","<nc:dateRange />","<nc:collaborators />"])},async fetchAlbumContent(){await this.fetchCollectionFiles(this.albumFileName)},async handleFilesPicked(t){this.showAddPhotosModal=!1,await this.addFilesToCollection({collectionFileName:this.album.filename,fileIdsToAdd:t}),await this.fetchAlbumContent()},async handleRemoveFilesFromAlbum(t){this.$refs.collectionContent.onUncheckFiles(t),await this.removeFilesFromCollection({collectionFileName:this.album.filename,fileIdsToRemove:t})},async handleDeleteAlbum(){await this.deleteCollection({collectionFileName:this.album.filename}),this.$router.push("/sharedalbums")},t:a.Iu}};var g=o(93379),f=o.n(g),v=o(7795),F=o.n(v),_=o(90569),y=o.n(_),N=o(3565),w=o.n(N),k=o(19216),P=o.n(k),S=o(44589),T=o.n(S),x=o(80463),Z={};Z.styleTagTransform=T(),Z.setAttributes=w(),Z.insert=y().bind(null,"head"),Z.domAPI=F(),Z.insertStyleElement=P();f()(x.Z,Z);x.Z&&x.Z.locals&&x.Z.locals;const B=(0,o(51900).Z)(C,(function(){var t=this,e=t._self._c;return e("div",[e("CollectionContent",{ref:"collectionContent",attrs:{collection:t.album,"collection-file-ids":t.albumFileIds,loading:t.loadingCollection||t.loadingCollectionFiles,error:t.errorFetchingCollection||t.errorFetchingCollectionFiles},scopedSlots:t._u([{key:"header",fn:function(o){let{selectedFileIds:l,resetSelection:n}=o;return e("HeaderNavigation",{key:"navigation",attrs:{loading:t.loadingCollectionFiles,params:{albumName:t.albumName},path:"/"+t.albumName,title:t.albumOriginalName},on:{refresh:t.fetchAlbumContent}},[void 0!==t.album&&""!==t.album.location?e("div",{staticClass:"album__location",attrs:{slot:"subtitle"},slot:"subtitle"},[e("MapMarker"),t._v(t._s(t.album.location)+" ⸱ "+t._s(t.t("photos","Shared by"))+" "),e("NcUserBubble",{attrs:{"display-name":t.album.collaborators[0].label,user:t.album.collaborators[0].id}})],1):t._e(),t._v(" "),e("template",{slot:"default"},[l.length>0?e("NcButton",{attrs:{"aria-label":t.t("photos","Unselect all")},on:{click:n},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Close")]},proxy:!0}],null,!0)},[t._v("\n\t\t\t\t\t"+t._s(t.t("photos","Unselect all"))+"\n\t\t\t\t")]):t._e()],1),t._v(" "),void 0!==t.album?e("template",{slot:"right"},[0!==t.album.nbItems?e("NcButton",{attrs:{type:"secondary","aria-label":t.t("photos","Add photos to this album")},on:{click:function(e){t.showAddPhotosModal=!0}}},[e("Plus",{attrs:{slot:"icon"},slot:"icon"}),t._v("\n\t\t\t\t\t"+t._s(t.t("photos","Add"))+"\n\t\t\t\t")],1):t._e(),t._v(" "),e("NcActions",{attrs:{"force-menu":!0,"aria-label":t.t("photos","Open actions menu")}},[t.album.collaborators[0].type===t.collaboratorTypes.SHARE_TYPE_USER?e("NcActionButton",{attrs:{"close-after-click":!0},on:{click:t.handleDeleteAlbum}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("photos","Delete album"))+"\n\t\t\t\t\t\t"),e("Delete",{attrs:{slot:"icon"},slot:"icon"})],1):t._e(),t._v(" "),l.length>0?[e("NcActionSeparator"),t._v(" "),e("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(e){return t.handleRemoveFilesFromAlbum(l)}}},[t._v("\n\t\t\t\t\t\t\t"+t._s(t.t("photos","Remove selection from album"))+"\n\t\t\t\t\t\t\t"),e("Close",{attrs:{slot:"icon"},slot:"icon"})],1)]:t._e()],2)],1):t._e()],2)}}],null,!1,284801126)},[t._v(" "),void 0===t.album||0!==t.album.nbItems||t.loadingCollectionFiles||t.loadingCollection?t._e():e("NcEmptyContent",{staticClass:"album__empty",attrs:{slot:"empty-content",name:t.t("photos","This album does not have any photos or videos yet!")},slot:"empty-content"},[e("ImagePlus",{attrs:{slot:"icon"},slot:"icon"}),t._v(" "),e("NcButton",{staticClass:"album__empty__button",attrs:{slot:"action",type:"primary","aria-label":t.t("photos","Add photos to this album")},on:{click:function(e){t.showAddPhotosModal=!0}},slot:"action"},[e("Plus",{attrs:{slot:"icon"},slot:"icon"}),t._v("\n\t\t\t\t"+t._s(t.t("photos","Add"))+"\n\t\t\t")],1)],1)],1),t._v(" "),e("PhotosPicker",{attrs:{open:t.showAddPhotosModal,name:t.t("photos","Add photos to {albumName}",{albumName:t.albumOriginalName}),destination:t.album.basename,"blacklist-ids":t.albumFileIds,loading:t.loadingAddFilesToAlbum},on:{"update:open":function(e){t.showAddPhotosModal=e},"files-picked":t.handleFilesPicked}})],1)}),[],!1,null,"8d782e7e",null).exports}}]);
//# sourceMappingURL=photos-src_views_SharedAlbumContent_vue.js.map?v=f76169ad8cf580d53915