nextcloud/dist/7462-7462.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

2 lines
11 KiB
JavaScript
Raw Normal View History

"use strict";(self.webpackChunknextcloud=self.webpackChunknextcloud||[]).push([[7462],{10396:(e,o,s)=>{s.d(o,{A:()=>A});var i=s(85168),n=s(70395),a=s(80486),r=s(10767),c=s(65899),d=s(36564),m=s(96689);const A={props:{id:{type:Number,default:null},message:{type:String,default:""},resourceId:{type:[String,Number],required:!0},resourceType:{type:String,default:"files"}},data:()=>({deleted:!1,editing:!1,loading:!1}),computed:{...(0,c.n2)(d.h)},methods:{onEdit(){this.editing=!0},onEditCancel(){this.editing=!1,this.updateLocalMessage(this.message)},async onEditComment(e){this.loading=!0;try{await(0,r.A)(this.resourceType,this.resourceId,this.id,e),m.A.debug("Comment edited",{resourceType:this.resourceType,resourceId:this.resourceId,id:this.id,message:e}),this.$emit("update:message",e),this.editing=!1}catch(e){(0,i.Qg)(t("comments","An error occurred while trying to edit the comment")),console.error(e)}finally{this.loading=!1}},onDeleteWithUndo(){this.$emit("delete"),this.deleted=!0,this.deletedCommentLimboStore.addId(this.id);const e=setTimeout(this.onDelete,i.Br);(0,i._h)(t("comments","Comment deleted"),(()=>{clearTimeout(e),this.deleted=!1,this.deletedCommentLimboStore.removeId(this.id)}))},async onDelete(){try{await(0,a.A)(this.resourceType,this.resourceId,this.id),m.A.debug("Comment deleted",{resourceType:this.resourceType,resourceId:this.resourceId,id:this.id}),this.$emit("delete",this.id)}catch(e){(0,i.Qg)(t("comments","An error occurred while trying to delete the comment")),console.error(e),this.deleted=!1,this.deletedCommentLimboStore.removeId(this.id)}},async onNewComment(e){this.loading=!0;try{const t=await(0,n.A)(this.resourceType,this.resourceId,e);m.A.debug("New comment posted",{resourceType:this.resourceType,resourceId:this.resourceId,newComment:t}),this.$emit("new",t),this.$emit("update:message",""),this.localMessage=""}catch(e){(0,i.Qg)(t("comments","An error occurred while trying to create the comment")),console.error(e)}finally{this.loading=!1}}}}},80486:(t,e,o)=>{o.d(e,{A:()=>i});var s=o(35550);async function i(t,e,o){const i=["",t,e,o].join("/");await s.A.deleteFile(i)}},10767:(t,e,o)=>{o.d(e,{A:()=>i});var s=o(35550);async function i(t,e,o,i){const n=["",t,e,o].join("/");return await s.A.customRequest(n,Object.assign({method:"PROPPATCH",data:`<?xml version="1.0"?>\n\t\t\t<d:propertyupdate\n\t\t\t\txmlns:d="DAV:"\n\t\t\t\txmlns:oc="http://owncloud.org/ns">\n\t\t\t<d:set>\n\t\t\t\t<d:prop>\n\t\t\t\t\t<oc:message>${i}</oc:message>\n\t\t\t\t</d:prop>\n\t\t\t</d:set>\n\t\t\t</d:propertyupdate>`}))}},70395:(t,e,o)=>{o.d(e,{A:()=>c});var s=o(21777),i=o(17003),n=o(51195),a=o(65043),r=o(35550);async function c(t,e,o){const c=["",t,e].join("/"),d=await a.Ay.post((0,i.e)()+c,{actorDisplayName:(0,s.HW)().displayName,actorId:(0,s.HW)().uid,actorType:"users",creationDateTime:(new Date).toUTCString(),message:o,objectType:t,verb:"comment"}),m=c+"/"+parseInt(d.headers["content-location"].split("/").pop()),A=await r.A.stat(m,{details:!0}),l=A.data.props;return l.actorDisplayName=(0,n.j)(l.actorDisplayName,2),l.message=(0,n.j)(l.message,2),A.data}},36564:(t,e,o)=>{o.d(e,{h:()=>s});const s=(0,o(65899).nY)("deletedCommentLimbo",{state:()=>({idsInLimbo:[]}),actions:{addId(t){this.idsInLimbo.push(t)},removeId(t){const e=this.idsInLimbo.indexOf(t);e>-1&&this.idsInLimbo.splice(e,1)},checkForId(t){this.idsInLimbo.includes(t)}}})},51195:(t,e,o)=>{function s(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const o=new DOMParser;let s=t;for(let t=0;t<e;t++)s=o.parseFromString(s,"text/html").documentElement.textContent;return s}o.d(e,{j:()=>s})},70452:(t,e,o)=>{o.d(e,{A:()=>r});var s=o(65043),i=o(21777),n=o(32981),a=o(63814);const r=(0,o(85471).pM)({props:{resourceId:{type:Number,required:!0},resourceType:{type:String,default:"files"}},data:()=>({editorData:{actorDisplayName:(0,i.HW)().displayName,actorId:(0,i.HW)().uid,key:"editor"},userData:{}}),methods:{async autoComplete(t,e){const{data:o}=await s.Ay.get((0,a.KT)("core/autocomplete/get"),{params:{search:t,itemType:"files",itemId:this.resourceId,sorter:"commenters|
//# sourceMappingURL=7462-7462.js.map?v=c56e515f61ca95c57eb7