You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nextcloud-server/dist/comments-comments-tab.js

2 lines
7.1 KiB

(()=>{var e,o,n,r={1836:(e,o,n)=>{"use strict";var r=n(21777),i=n(32981),a=n(19231),s=n(85471),c=n(96689),d=n(63623),l=n(33495),u=n(90176),m=n(35550);var f=n(65899);let p,v;function b(){window.OCA.Activity.registerSidebarAction({mount:async(e,t)=>{let{context:o,fileInfo:r,reload:i}=t;const a=(0,f.Ey)();if(!p){const{default:e}=await Promise.all([n.e(4208),n.e(7462),n.e(8057)]).then(n.bind(n,98057));p=s.Ay.extend(e)}v=new p({el:e,parent:o,pinia:a,propsData:{reloadCallback:i,resourceId:r.id}}),c.A.info("Comments plugin mounted in Activity sidebar action",{fileInfo:r})},unmount:()=>{v&&v.$destroy()}}),window.OCA.Activity.registerSidebarEntries((async e=>{let{fileInfo:t,limit:o,offset:r}=e;const{data:i}=await async function(e,t){var o;let{resourceType:n,resourceId:r}=e;const i=["",n,r].join("/"),a=t.datetime?"<oc:datetime>".concat(t.datetime.toISOString(),"</oc:datetime>"):"",s=await m.A.customRequest(i,Object.assign({method:"REPORT",data:'<?xml version="1.0"?>\n\t\t\t<oc:filter-comments\n\t\t\t\txmlns:d="DAV:"\n\t\t\t\txmlns:oc="http://owncloud.org/ns"\n\t\t\t\txmlns:nc="http://nextcloud.org/ns"\n\t\t\t\txmlns:ocs="http://open-collaboration-services.org/ns">\n\t\t\t\t<oc:limit>'.concat(null!==(o=t.limit)&&void 0!==o?o:20,"</oc:limit>\n\t\t\t\t<oc:offset>").concat(t.offset||0,"</oc:offset>\n\t\t\t\t").concat(a,"\n\t\t\t</oc:filter-comments>")},t)),c=await s.text(),f=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{multistatus:{response:o}}=e;return o.map((e=>{const o=e.propstat.prop;return(0,u.ch)(o,o.id.toString(),t)}))}(await(0,d.h4)(c),!0);return(0,l.hq)(s,f,!0)}({resourceType:"files",resourceId:t.id},{limit:o,offset:r});c.A.debug("Loaded comments",{fileInfo:t,comments:i});const{default:f}=await Promise.all([n.e(4208),n.e(7462),n.e(3920)]).then(n.bind(n,93920)),p=s.Ay.extend(f);return i.map((e=>{var o;return{_CommentsViewInstance:void 0,timestamp:(0,a.A)(null===(o=e.props)||void 0===o?void 0:o.creationDateTime).toDate().getTime(),mount(o,n){let{context:r,reload:i}=n;this._CommentsViewInstance=new p({el:o,parent:r,propsData:{comment:e,resourceId:t.id,reloadCallback:i}})},unmount(){var e;null===(e=this._CommentsViewInstance)||void 0===e||e.$destroy()}}}))})),window.OCA.Activity.registerSidebarFilter((e=>"comments"!==e.type)),c.A.info("Comments plugin registered for Activity sidebar action")}var h;if(s.Ay.use(f.R2),n.nc=btoa((0,r.do)()),(0,i.C)("comments","activityEnabled",!1)&&void 0!==(null===(h=OCA)||void 0===h||null===(h=h.Activity)||void 0===h?void 0:h.registerSidebarAction))window.addEventListener("DOMContentLoaded",(function(){b()}));else{let e=null;const o=new OCA.Files.Sidebar.Tab({id:"comments",name:t("comments","Comments"),iconSvg:'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-message-reply-text" viewBox="0 0 24 24"><path d="M18,8H6V6H18V8M18,11H6V9H18V11M18,14H6V12H18V14M22,4A2,2 0 0,0 20,2H4A2,2 0 0,0 2,4V16A2,2 0 0,0 4,18H18L22,22V4Z" /></svg>',async mount(t,o,n){e&&e.$destroy(),e=new OCA.Comments.View("files",{parent:n,propsData:{resourceId:o.id}}),await e.update(o.id),e.$mount(t)},update(t){e.update(t.id)},destroy(){e.$destroy(),e=null},scrollBottomReached(){e.onScrollBottomReached()}});window.addEventListener("DOMContentLoaded",(function(){OCA.Files&&OCA.Files.Sidebar&&OCA.Files.Sidebar.registerTab(o)}))}},96689:(e,t,o)=>{"use strict";o.d(t,{A:()=>n});const n=(0,o(35947).YK)().setApp("comments").detectUser().build()},35550:(e,t,o)=>{"use strict";o.d(t,{A:()=>c});var n=o(63623),r=o(17003),i=o(21777);const a=(0,n.UU)((0,r.e)()),s=e=>{a.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:null!=e?e:""})};(0,i.zo)(s),s((0,i.do)());const c=a},17003:(e,t,o)=>{"use strict";o.d(t,{e:()=>r});var n=o(63814);const r=function(){return(0,n.dC)("dav/comments")}},42634:()=>{},15340:()=>{},79838:()=>{}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var o=i[e]={id:e,loaded:!1,exports:{}};return r[e].call(o.exports,o,o.exports,a),o.loaded=!0,o.exports}a.m=r,e=[],a.O=(t,o,n,r)=>{if(!o){var i=1/0;for(l=0;l<e.length;l++){o=e[l][0],n=e[l][1],r=e[l][2];for(var s=!0,c=0;c<o.le
//# sourceMappingURL=comments-comments-tab.js.map?v=9040818f0a5655ff7d0e