2 lines
6.9 KiB
JavaScript
2 lines
6.9 KiB
JavaScript
(()=>{var e,o,r,n={1836:(e,o,r)=>{"use strict";var n=r(21777),i=r(81222),a=r(51651),s=r(10810),c=r(85471),d=r(96689),l=r(60669),u=r(29999),m=r(90176),f=r(35550);let p,b;if(c.Ay.use(s.R2),r.nc=(0,n.aV)(),(0,i.C)("comments","activityEnabled",!1)&&void 0!==OCA?.Activity?.registerSidebarAction)window.addEventListener("DOMContentLoaded",function(){window.OCA.Activity.registerSidebarAction({mount:async(e,{fileInfo:t,reload:o})=>{const n=(0,s.Ey)();if(!p){const{default:e}=await Promise.all([r.e(4208),r.e(4743),r.e(5679)]).then(r.bind(r,5679));p=c.Ay.extend(e)}b=new p({el:e,pinia:n,propsData:{reloadCallback:o,resourceId:t.id}}),d.A.info("Comments plugin mounted in Activity sidebar action",{fileInfo:t})},unmount:()=>{b&&b.$destroy()}}),window.OCA.Activity.registerSidebarEntries(async({fileInfo:e,limit:t,offset:o})=>{const{data:n}=await async function({resourceType:e,resourceId:t},o){const r=["",e,t].join("/"),n=o.datetime?`<oc:datetime>${o.datetime.toISOString()}</oc:datetime>`:"",i=await f.A.customRequest(r,{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>${o.limit??20}</oc:limit>\n\t\t\t\t<oc:offset>${o.offset||0}</oc:offset>\n\t\t\t\t${n}\n\t\t\t</oc:filter-comments>`,...o}),a=await i.text(),s=function(e,t=!1){const{multistatus:{response:o}}=e;return o.map(e=>{const o=e.propstat.prop;return(0,m.ch)(o,o.id.toString(),t)})}(await(0,l.h4)(a),!0);return(0,u.hq)(i,s,!0)}({resourceType:"files",resourceId:e.id},{limit:t,offset:o});d.A.debug("Loaded comments",{fileInfo:e,comments:n});const{default:i}=await Promise.all([r.e(4208),r.e(4743),r.e(1543)]).then(r.bind(r,31543)),s=c.Ay.extend(i);return n.map(t=>({_CommentsViewInstance:void 0,timestamp:(0,a.A)(t.props?.creationDateTime).toDate().getTime(),mount(o,{reload:r}){this._CommentsViewInstance=new s({el:o,propsData:{comment:t,resourceId:e.id,reloadCallback:r}})},unmount(){this._CommentsViewInstance?.$destroy()}}))}),window.OCA.Activity.registerSidebarFilter(e=>"comments"!==e.type),d.A.info("Comments plugin registered for Activity sidebar action")});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,r){e&&e.$destroy(),e=new OCA.Comments.View("files",{parent:r,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)})}},17003:(e,t,o)=>{"use strict";o.d(t,{e:()=>n});var r=o(63814);function n(){return(0,r.dC)("dav/comments")}},35550:(e,t,o)=>{"use strict";o.d(t,{A:()=>c});var r=o(21777),n=o(60669),i=o(17003);const a=(0,n.UU)((0,i.e)());function s(e){a.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:e??""})}(0,r.zo)(s),s((0,r.do)());const c=a},42634:()=>{},59169:()=>{},63779:()=>{},77199:()=>{},86833:()=>{},96689:(e,t,o)=>{"use strict";o.d(t,{A:()=>r});const r=(0,o(35947).YK)().setApp("comments").detectUser().build()}},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 n[e].call(o.exports,o,o.exports,a),o.loaded=!0,o.exports}a.m=n,e=[],a.O=(t,o,r,n)=>{if(!o){var i=1/0;for(l=0;l<e.length;l++){for(var[o,r,n]=e[l],s=!0,c=0;c<o.length;c++)(!1&n||i>=n)&&Object.keys(a.O).every(e=>a.O[e](o[c]))?o.splice(c--,1):(s=!1,n<i&&(i=n));if(s){e.splice(l--,1);var d=r();void 0!==d&&(t=d)}}return t}n=n||0;for(var l=e.length;l>0&&e[l-1][2]>n;l--)e[l]=e[l-1];e[l]=[o,r,n]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,o)=>(a.f[o](e,t),t),[])),a.u=e=>e+"-"+e+".js?v="+{594:"2c86902dfae9a5006399",620:"1faa6454ab9a6286ffeb",1543:"897942cd480f832e974d",2391:"908fc68e4bc9b878c937",2880:"96ff2de012f3b8c1e3a4",4325:"11e9d860db6a9bc25aac",4508:"0cfc67314b33d062aca0",4743:"ca882d2b1051537d81d4",4818:"bc28400411f7dd82407b",5258:"db8e9188feee06fd36e5",5679:"d276e13535db16182f50",5862:"d020c05f13d21afee82a",7145:"d9c518ca34bfdbd7ff70",8339:"6cdca71a6b3b2d7bef33",8639:"061a3b0a444f32e73c0d"}[e],a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},r="nextcloud-ui-legacy:",a.l=(e,t,n,i)=>{if(o[e])o[e].push(t);else{var s,c;if(void 0!==n)for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++){var u=d[l];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==r+n){s=u;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",a.nc&&s.setAttribute("nonce",a.nc),s.setAttribute("data-webpack",r+n),s.src=e),o[e]=[t];var m=(t,r)=>{s.onerror=s.onload=null,clearTimeout(f);var n=o[e];if(delete o[e],s.parentNode&&s.parentNode.removeChild(s),n&&n.forEach(e=>e(r)),t)return t(r)},f=setTimeout(m.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=m.bind(null,s.onerror),s.onload=m.bind(null,s.onload),c&&document.head.appendChild(s)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.j=2122,(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var r=o.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=o[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={2122:0};a.f.j=(t,o)=>{var r=a.o(e,t)?e[t]:void 0;if(0!==r)if(r)o.push(r[2]);else{var n=new Promise((o,n)=>r=e[t]=[o,n]);o.push(r[2]=n);var i=a.p+a.u(t),s=new Error;a.l(i,o=>{if(a.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var n=o&&("load"===o.type?"missing":o.type),i=o&&o.target&&o.target.src;s.message="Loading chunk "+t+" failed.\n("+n+": "+i+")",s.name="ChunkLoadError",s.type=n,s.request=i,r[1](s)}},"chunk-"+t,t)}},a.O.j=t=>0===e[t];var t=(t,o)=>{var r,n,[i,s,c]=o,d=0;if(i.some(t=>0!==e[t])){for(r in s)a.o(s,r)&&(a.m[r]=s[r]);if(c)var l=c(a)}for(t&&t(o);d<i.length;d++)n=i[d],a.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return a.O(l)},o=globalThis.webpackChunknextcloud_ui_legacy=globalThis.webpackChunknextcloud_ui_legacy||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})(),a.nc=void 0;var s=a.O(void 0,[4208],()=>a(1836));s=a.O(s)})();
|
|
//# sourceMappingURL=comments-comments-tab.js.map?v=5c96b2ca875a94ae2314
|