files_trashbin-init.js 6.0 KB

123
  1. /*! For license information please see files_trashbin-init.js.LICENSE.txt */
  2. (()=>{"use strict";var e,t={29276:(e,t,n)=>{var i=n(85072),r=n.n(i),o=n(97825),l=n.n(o),s=n(77659),a=n.n(s),d=n(55056),c=n.n(d),u=n(10540),h=n.n(u),v=n(41113),f=n.n(v),p=n(98290),b={};b.styleTagTransform=f(),b.setAttributes=c(),b.insert=a().bind(null,"head"),b.domAPI=l(),b.insertStyleElement=h(),r()(p.A,b),p.A&&p.A.locals&&p.A.locals;var m,g=n(53334),w=n(19231),A=n(78791),y=n(21777);const x="/trashbin/".concat(null===(m=(0,y.HW)())||void 0===m?void 0:m.uid,"/trash"),_=(0,A.H4)();var T=n(63814);const C='<?xml version="1.0"?>\n<d:propfind '.concat((0,A.CP)(),">\n\t<d:prop>\n\t\t<nc:trashbin-deletion-time />\n\t\t<nc:trashbin-original-location />\n\t\t<nc:trashbin-title />\n\t\t").concat((0,A.VX)(),"\n\t</d:prop>\n</d:propfind>"),O=e=>{const t=(0,A.Al)(e,x);return t.attributes.previewUrl=(0,T.Jv)("/apps/files_trashbin/preview?fileId={fileid}&x=32&y=32",{fileid:t.fileid}),t};var H=n(61338),S=n(65043);const L=(0,n(53529).YK)().setApp("files").detectUser().build();var P=n(71225);(0,A.Gg)(new A.hY({id:"restore",displayName:()=>(0,g.Tl)("files_trashbin","Restore"),iconSvgInline:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-history" viewBox="0 0 24 24"><path d="M13.5,8H12V13L16.28,15.54L17,14.33L13.5,12.25V8M13,3A9,9 0 0,0 4,12H1L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3" /></svg>',enabled:(e,t)=>"trashbin"===t.id&&e.length>0&&e.map((e=>e.permissions)).every((e=>!!(e&A.aX.READ))),async exec(e){try{var t;const n=(0,T.dC)((0,P.O0)("dav/trashbin/".concat(null===(t=(0,y.HW)())||void 0===t?void 0:t.uid,"/restore/").concat(e.basename)));return await(0,S.Ay)({method:"MOVE",url:e.encodedSource,headers:{destination:n}}),(0,H.Ic)("files:node:deleted",e),!0}catch(e){return L.error(e),!1}},async execBatch(e,t,n){return Promise.all(e.map((e=>this.exec(e,t,n))))},order:1,inline:()=>!0}));const j=e=>{var t,n;const i=void 0!==(null===(t=e.attributes)||void 0===t?void 0:t["trashbin-original-location"])?String(null===(n=e.attributes)||void 0===n?void 0:n["trashbin-original-location"]):null;if(!i)return(0,g.Tl)("files_trashbin","Unknown");const r=(0,P.pD)(i);return r===i?(0,g.Tl)("files_trashbin","All files"):(0,P.HS)((0,g.Tl)("files_trashbin","All files"),r)};(0,A.bh)().register(new A.Ss({id:"trashbin",name:(0,g.Tl)("files_trashbin","Deleted files"),caption:(0,g.Tl)("files_trashbin","List of files that have been deleted."),emptyTitle:(0,g.Tl)("files_trashbin","No deleted files"),emptyCaption:(0,g.Tl)("files_trashbin","Files and folders you have deleted will show up here"),icon:'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-delete" viewBox="0 0 24 24"><path d="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z" /></svg>',order:50,sticky:!0,defaultSortKey:"deleted",columns:[new A.VP({id:"original-location",title:(0,g.Tl)("files_trashbin","Original location"),render(e){const t=j(e),n=document.createElement("span");return n.title=t,n.textContent=t,n},sort(e,t){const n=j(e),i=j(t);return n.localeCompare(i)}}),new A.VP({id:"deleted",title:(0,g.Tl)("files_trashbin","Deleted"),render(e){var t;const n=null===(t=e.attributes)||void 0===t?void 0:t["trashbin-deletion-time"],i=document.createElement("span");return n?(i.title=w.A.unix(n).format("LLL"),i.textContent=w.A.unix(n).fromNow(),i):(i.textContent=(0,g.Tl)("files_trashbin","A long time ago"),i)},sort(e,t){var n,i;const r=(null===(n=e.attributes)||void 0===n?void 0:n["trashbin-deletion-time"])||(null==e?void 0:e.mtime)||0;return((null===(i=t.attributes)||void 0===i?void 0:i["trashbin-deletion-time"])||(null==t?void 0:t.mtime)||0)-r}})],getContents:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";const t=(await _.getDirectoryContents("".concat(x).concat(e),{details:!0,data:C,includeSelf:!0})).data.map(O),[n]=t.splice(t.findIndex((t=>t.dirname===e)),1);return{folder:n,contents:t}}}))},98290:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(71354),r=n.n(i),o=n(76314),l=n.n(o)()(r());l.push([e.id,".files-list__row-trashbin-original-location{width:150px !important}","",{version:3,sources:["webpack://./apps/files_trashbin/src/trashbin.scss"],names:[],mappings:"AAAA,4CACE,sBAAA",sourcesContent:[".files-list__row-trashbin-original-location {\n width: 150px !important;\n}\n"],sourceRoot:""}]);const s=l}},n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.m=t,e=[],i.O=(t,n,r,o)=>{if(!n){var l=1/0;for(c=0;c<e.length;c++){n=e[c][0],r=e[c][1],o=e[c][2];for(var s=!0,a=0;a<n.length;a++)(!1&o||l>=o)&&Object.keys(i.O).every((e=>i.O[e](n[a])))?n.splice(a--,1):(s=!1,o<l&&(l=o));if(s){e.splice(c--,1);var d=r();void 0!==d&&(t=d)}}return t}o=o||0;for(var c=e.length;c>0&&e[c-1][2]>o;c--)e[c]=e[c-1];e[c]=[n,r,o]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.e=()=>Promise.resolve(),i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),i.j=2573,(()=>{i.b=document.baseURI||self.location.href;var e={2573:0};i.O.j=t=>0===e[t];var t=(t,n)=>{var r,o,l=n[0],s=n[1],a=n[2],d=0;if(l.some((t=>0!==e[t]))){for(r in s)i.o(s,r)&&(i.m[r]=s[r]);if(a)var c=a(i)}for(t&&t(n);d<l.length;d++)o=l[d],i.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return i.O(c)},n=self.webpackChunknextcloud=self.webpackChunknextcloud||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),i.nc=void 0;var r=i.O(void 0,[4208],(()=>i(29276)));r=i.O(r)})();
  3. //# sourceMappingURL=files_trashbin-init.js.map?v=fed61c6326c9f208d712