OCA.Trashbin={},OCA.Trashbin.App={_initialized:!1,client:null,initialize:function(e){if(!this._initialized){this._initialized=!0,this.client=newOC.Files.Client({host:OC.getHost(),port:OC.getPort(),root:OC.linkToRemoteBase("dav")+"/trashbin/"+OC.getCurrentUser().uid,useHTTPS:"https"===OC.getProtocol()});varn=OC.Util.History.parseUrlQuery();this.fileList=newOCA.Trashbin.FileList($("#app-content-trashbin"),{fileActions:this._createFileActions(),detailsViewEnabled:!1,scrollTo:n.scrollto,config:OCA.Files.App.getFilesConfig(),multiSelectMenu:[{name:"restore",displayName:t("files_trashbin","Restore"),iconClass:"icon-history"},{name:"delete",displayName:t("files_trashbin","Delete permanently"),iconClass:"icon-delete"}],client:this.client,shown:!0})}},_createFileActions:function(){vare=this.client,n=newOCA.Files.FileActions;returnn.register("dir","Open",OC.PERMISSION_READ,"",(function(e,t){varn=t.fileList.getCurrentDirectory();t.fileList.changeDirectory(OC.joinPaths(n,e))})),n.setDefault("dir","Open"),n.registerAction({name:"Restore",displayName:t("files_trashbin","Restore"),type:OCA.Files.FileActions.TYPE_INLINE,mime:"all",permissions:OC.PERMISSION_READ,iconClass:"icon-history",actionHandler:function(n,i){varr=i.fileList,a=r.findFileEl(n);r.showFileBusyState(a,!0);varo=i.fileList.getCurrentDirectory();e.move(OC.joinPaths("trash",o,n),OC.joinPaths("restore",n),!0).then(r._removeCallback.bind(r,[n]),(function(){r.showFileBusyState(a,!1),OC.Notification.show(t("files_trashbin","Error while restoring file from trashbin"))}))}}),n.registerAction({name:"Delete",displayName:t("files_trashbin","Delete permanently"),mime:"all",permissions:OC.PERMISSION_READ,iconClass:"icon-delete",render:function(e,i,r){vara=n._makeActionLink(e,r);returna.attr("original-title",t("files_trashbin","Delete permanently")),a.children("img").attr("alt",t("files_trashbin","Delete permanently")),r.$file.find("td:last").append(a),a},actionHandler:function(n,i){varr=i.fileList;$(".tipsy").remove();vara=r.findFileEl(n);r.showFileBusyState(a,!0);varo=i.fileList.getCurrentDirectory();e.remove(OC.joinPaths("trash",o,n)).then(r._removeCallback.bind(r,[n]),(function(){r.showFileBusyState(a,!1),OC.Notification.show(t("files_trashbin","Error while removing file from trashbin"))}))}}),n}},window.addEventListener("DOMContentLoaded",(function(){$("#app-content-trashbin").one("show",(function(){OCA.Trashbin.App.initialize($("#app-content-trashbin"))}))}))},function(e,n){
!function(){vare=newRegExp(/^(.+)\.d[0-9]+$/),n="{http://nextcloud.org/ns}trashbin-filename",i="{http://nextcloud.org/ns}trashbin-deletion-time",r="{http://nextcloud.org/ns}trashbin-original-location",a="{http://nextcloud.org/ns}trashbin-title";functiono(t){t=OC.basename(t);varn=e.exec(t);returnn&&n.length>1&&(t=n[1]),t}vars=function(e,t){this.client=t.client,this.initialize(e,t)};s.prototype=_.extend({},OCA.Files.FileList.prototype,{id:"trashbin",appName:t("files_trashbin","Deleted files"),client:null,initialize:function(){this.client.addFileInfoParser((function(e,t){varo=e.propStat[0].properties,s=o[r],l=o[a];return{displayName:o[n],mtime:1e3*parseInt(o[i],10),hasPreview:!0,path:s,extraData:l}}));vare=OCA.Files.FileList.prototype.initialize.apply(this,arguments);returnthis.$el.find(".undelete").click("click",_.bind(this._onClickRestoreSelected,this)),this.setSort("mtime","asc"),this.breadcrumb._makeCrumbs=function(){for(vare=OCA.Files.BreadCrumb.prototype._makeCrumbs.apply(this,[].concat(Array.prototype.slice.call(arguments),["icon-delete no-hover"])),t=1;t<e.length;t++)e[t].name=o(e[t].name);returne},OC.Plugins.attach("OCA.Trashbin.FileList",this),e},getDirectoryPermissions:function(){returnOC.PERMISSION_READ|OC.PERMISSION_DELETE},_setCurrentDir:function(e){OCA.Files.FileList.prototype._setCurrentDir.apply(this,arguments);vart=OC.basename(e);""!==t&&this.setPageTitle(o(t))},_createRow:function(){vare=OCA.Files.FileList.prototype._createRow.apply(this,arguments);returne.find("td.filesize").remove(),e},getAjaxUrl:function(e,t){varn="";returnt&&(n="?"+OC.buildQueryString(t)),OC.filePath("files_trashbin","ajax",e+".php")+n},setupUploadEvents:function(){},linkTo:function(e){returnOC.linkTo("files","index.php")+"?view=trashbin&dir="+encodeURIComponent(e).replace(/%2F/g,"/")},elementToFile:function(e){vart=OCA.Files.FileList.prototype.elementToFile(e);return"/"===this.getCurrentDirectory()&&(t.displayName=o(t.name)),deletet.size,t},updateEmptyContent:function(){vare=this.$fileList.find("tr:first").exists();this.$el.find("#emptycontent").toggleClass("hidden",e),this.$el.find("#filestable th").toggleClass("hidden",!e)},_removeCallback:function(e){for(vart,n=0;n<e.length;n++)t=this.remove(OC.basename(e[n]),{updateSummary:!1}),this.fileSummary.remove({type:t.attr("data-type"),size:t.attr("data-size")});this.fileSummary.update(),this.updateEmptyContent()},_onClickRestoreSelected:function(e){e.preventDefault();for(varn=this,i=_.pluck(this.getSelectedFiles(),"name"),r=0;r<i.length;r++){vara=this.findFileEl(i[r]);this.showFileBusyState(a,!0)}this.fileMultiSelectMenu.toggleLoading("restore",!0);varo=i.map((function(e){returnn.client.move(OC.joinPaths("trash",n.getCurrentDirectory(),e),OC.joinPaths("restore",e),!0).then((function(){n._removeCallback([e])}))}));returnPromise.all(o).then((function(){n.fileMultiSelectMenu.toggleLoading("restore",!1)}),(function(){OC.Notification.show(t("files_trashbin","Error while restoring files from trashbin"))}))},_onClickDeleteSelected:function(e){e.preventDefault();for(varn=this,i=this.$el.find(".select-all").is(":checked"),r=_.pluck(this.getSelectedFiles(),"name"),a=0;a<r.length;a++){varo=this.findFileEl(r[a]);this.showFileBusyState(o,!0)}if(i)returnthis.client.remove(OC.joinPaths("trash",this.getCurrentDirectory())).then((function(){n.hideMask(),n.setFiles([])}),(function(){OC.Notification.show(t("files_trashbin","Error while emptying trashbin"))}));this.fileMultiSelectMenu.toggleLoading("delete",!0);vars=r.map((function(e){returnn.client.remove(OC.joinPaths("trash",n.getCurrentDirectory(),e)).then((function(){n._removeCallback([e])}))}));returnPromise.all(s).then((function(){n.fileMultiSelectMenu.toggleLoading("delete",!1)}),(function(){OC.Notification.show(t("files_trashbin","Error while removing files from trashbin"))}))},_onClickFile:function(e){vart=$(this).parent().parent().data("mime");return"httpd/unix-directory"!==t&&e.preventDefault(),OCA.Files.FileList.prototype._onClickFile.apply(this,arguments)},generatePreviewUrl:function(e){returnOC.generateUrl("