You cannot 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/dist/files-init.js

3 lines
115 KiB
JavaScript

/*! For license information please see files-init.js.LICENSE.txt */
(()=>{var e,t,n,i={4389:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i=(0,n(17499).IY)().setApp("files").detectUser().build()},77341:(e,t,n)=>{"use strict";var i=n(5656),r=n(69183),o=n(64024),s=n(31352),a=n(93664),l=n(4389);const d=e=>e.every((e=>!0===e.attributes["is-mount-root"]&&"shared"===e.attributes["mount-type"])),c=e=>e.every((e=>!0===e.attributes["is-mount-root"]&&"external"===e.attributes["mount-type"])),u=(e,t)=>"trashbin"===t.id?(0,s.Iu)("files","Delete permanently"):(e=>{if(1===e.length)return!1;const t=e.some((e=>d([e]))),n=e.some((e=>!d([e])));return t&&n})(e)?(0,s.Iu)("files","Delete and unshare"):d(e)?(0,s.uN)("files","Leave this share","Leave these shares",e.length):c(e)?(0,s.uN)("files","Disconnect storage","Disconnect storages",e.length):(e=>!e.some((e=>e.type!==i.Tv.File)))(e)?(0,s.uN)("files","Delete file","Delete files",e.length):(e=>!e.some((e=>e.type!==i.Tv.Folder)))(e)?(0,s.uN)("files","Delete folder","Delete folders",e.length):(0,s.Iu)("files","Delete"),f=new i.p$({id:"delete",displayName:u,iconSvgInline:e=>d(e)?'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-close" viewBox="0 0 24 24"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /></svg>':c(e)?'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-network-off" viewBox="0 0 24 24"><path d="M1,5.27L5,9.27V15A2,2 0 0,0 7,17H11V19H10A1,1 0 0,0 9,20H2V22H9A1,1 0 0,0 10,23H14A1,1 0 0,0 15,22H17.73L19.73,24L21,22.72L2.28,4L1,5.27M15,20A1,1 0 0,0 14,19H13V17.27L15.73,20H15M17.69,16.87L5.13,4.31C5.41,3.55 6.14,3 7,3H17A2,2 0 0,1 19,5V15C19,15.86 18.45,16.59 17.69,16.87M22,20V21.18L20.82,20H22Z" /></svg>':'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-trash-can" viewBox="0 0 24 24"><path d="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M9,8H11V17H9V8M13,8H15V17H13V8Z" /></svg>',enabled:e=>e.length>0&&e.map((e=>e.permissions)).every((e=>0!=(e&i.y3.DELETE))),async exec(e){try{return await a.Z.delete(e.encodedSource),(0,r.j8)("files:node:deleted",e),!0}catch(t){return l.Z.error("Error while deleting a file",{error:t,source:e.source,node:e}),!1}},async execBatch(e,t,n){return!1===await new Promise((n=>{e.length>=5&&!d(e)&&!c(e)?window.OC.dialogs.confirmDestructive((0,s.Iu)("files","You are about to delete {count} items.",{count:e.length}),(0,s.Iu)("files","Confirm deletion"),{type:window.OC.dialogs.YES_NO_BUTTONS,confirm:u(e,t),confirmClasses:"error",cancel:(0,s.Iu)("files","Cancel")},(e=>{n(e)})):n(!0)}))?((0,o.JQ)((0,s.Iu)("files","Deletion cancelled")),Promise.all(e.map((()=>!1)))):Promise.all(e.map((e=>this.exec(e,t,n))))},order:100});var p=n(79753);const h=function(e){const t=document.createElement("a");t.download="",t.href=e,t.click()},g=function(e,t){const n=Math.random().toString(36).substring(2),i=(0,p.generateUrl)("/apps/files/ajax/download.php?dir={dir}&files={files}&downloadStartSecret={secret}",{dir:e,secret:n,files:JSON.stringify(t.map((e=>e.basename)))});h(i)},m=function(e){if(0==(e.permissions&i.y3.READ))return!1;if("shared"===e.attributes["mount-type"]){const t=JSON.parse(e.attributes["share-attributes"]).find((e=>"permissions"===e.scope&&"download"===e.key));if(void 0!==t&&!1===t.enabled)return!1}return!0},A=new i.p$({id:"download",displayName:()=>(0,s.Iu)("files","Download"),iconSvgInline:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-arrow-down" viewBox="0 0 24 24"><path d="M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z" /></svg>',enabled:e=>0!==e.length&&(!e.some((e=>e.type===i.Tv.Folder))||!e.some((e=>!e.root?.startsWith("/files"))))&&e.every(m),exec:async(e,t,n)=>e.type===i.Tv.Folder?(g(n,[e]),null):(h(e.encodedSource),null),async execBatch(e,t,n){return 1===e.length?(this.exec(e[0],t,n),[null]):(g(n,e),new Array(e.length).fill(null))},order:30});var w=n(65358),v=n(77958);const y=new i.p$({id:"edit-locally",displayName:()=>(0,s.Iu)("files","Edit locally"),iconSvgInline:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-laptop" viewBox="0 0 24 24"><path d="M4,6H20V16H4M20,18A2,2 0 0,0 22,16V6C22,4.89 21.1,4 20,4H4
//# sourceMappingURL=files-init.js.map?v=fb167e90b42f7d1990ce