From 1bb25345718300e9da9f609d5c23436c8383d14e Mon Sep 17 00:00:00 2001 From: szaimen Date: Tue, 1 Mar 2022 16:27:54 +0100 Subject: [PATCH] try to fix correct fileactions for sharing overview Signed-off-by: szaimen Signed-off-by: nextcloud-command --- apps/files_sharing/js/app.js | 1 + dist/files_sharing-files_sharing.js | 4 ++-- dist/files_sharing-files_sharing.js.map | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/files_sharing/js/app.js b/apps/files_sharing/js/app.js index cf1a489b6f257..dc03e31bf8085 100644 --- a/apps/files_sharing/js/app.js +++ b/apps/files_sharing/js/app.js @@ -169,6 +169,7 @@ OCA.Sharing.App = { $el, { id: 'shares.overview', + fileActions: this._createFileActions(), config: OCA.Files.App.getFilesConfig(), isOverview: true, // The file list is created when a "show" event is handled, so diff --git a/dist/files_sharing-files_sharing.js b/dist/files_sharing-files_sharing.js index 8f029d0fbc47d..cc6e86741b27d 100644 --- a/dist/files_sharing-files_sharing.js +++ b/dist/files_sharing-files_sharing.js @@ -1,2 +1,2 @@ -!function(){var e={24839:function(){OCA.Sharing||(OCA.Sharing={}),OCA.Sharing.App={_inFileList:null,_outFileList:null,_overviewFileList:null,_pendingFileList:null,initSharingIn:function(e){return this._inFileList||(this._inFileList=new OCA.Sharing.FileList(e,{id:"shares.self",sharedWithUser:!0,fileActions:this._createFileActions(),config:OCA.Files.App.getFilesConfig(),shown:!0}),this._extendFileList(this._inFileList),this._inFileList.appName=t("files_sharing","Shared with you"),this._inFileList.$el.find("#emptycontent").html('

'+t("files_sharing","Nothing shared with you yet")+"

"+t("files_sharing","Files and folders others share with you will show up here")+"

")),this._inFileList},initSharingOut:function(e){return this._outFileList||(this._outFileList=new OCA.Sharing.FileList(e,{id:"shares.others",sharedWithUser:!1,fileActions:this._createFileActions(),config:OCA.Files.App.getFilesConfig(),shown:!0}),this._extendFileList(this._outFileList),this._outFileList.appName=t("files_sharing","Shared with others"),this._outFileList.$el.find("#emptycontent").html('

'+t("files_sharing","Nothing shared yet")+"

"+t("files_sharing","Files and folders you share will show up here")+"

")),this._outFileList},initSharingLinks:function(e){return this._linkFileList||(this._linkFileList=new OCA.Sharing.FileList(e,{id:"shares.link",linksOnly:!0,fileActions:this._createFileActions(),config:OCA.Files.App.getFilesConfig(),shown:!0}),this._extendFileList(this._linkFileList),this._linkFileList.appName=t("files_sharing","Shared by link"),this._linkFileList.$el.find("#emptycontent").html('

'+t("files_sharing","No shared links")+"

"+t("files_sharing","Files and folders you share by link will show up here")+"

")),this._linkFileList},initSharingDeleted:function(e){return this._deletedFileList||(this._deletedFileList=new OCA.Sharing.FileList(e,{id:"shares.deleted",defaultFileActionsDisabled:!0,showDeleted:!0,sharedWithUser:!0,fileActions:this._restoreShareAction(),config:OCA.Files.App.getFilesConfig(),shown:!0}),this._extendFileList(this._deletedFileList),this._deletedFileList.appName=t("files_sharing","Deleted shares"),this._deletedFileList.$el.find("#emptycontent").html('

'+t("files_sharing","No deleted shares")+"

"+t("files_sharing","Shares you deleted will show up here")+"

")),this._deletedFileList},initSharingPening:function(e){return this._pendingFileList||(this._pendingFileList=new OCA.Sharing.FileList(e,{id:"shares.pending",showPending:!0,detailsViewEnabled:!1,defaultFileActionsDisabled:!0,sharedWithUser:!0,fileActions:this._acceptShareAction(),config:OCA.Files.App.getFilesConfig(),shown:!0}),this._extendFileList(this._pendingFileList),this._pendingFileList.appName=t("files_sharing","Pending shares"),this._pendingFileList.$el.find("#emptycontent").html('

'+t("files_sharing","No pending shares")+"

"+t("files_sharing","Shares you have received but not confirmed will show up here")+"

")),this._pendingFileList},initShareingOverview:function(e){return this._overviewFileList||(this._overviewFileList=new OCA.Sharing.FileList(e,{id:"shares.overview",config:OCA.Files.App.getFilesConfig(),isOverview:!0,shown:!0}),this._extendFileList(this._overviewFileList),this._overviewFileList.appName=t("files_sharing","Shares"),this._overviewFileList.$el.find("#emptycontent").html('

'+t("files_sharing","No shares")+"

"+t("files_sharing","Shares will show up here")+"

")),this._overviewFileList},removeSharingIn:function(){this._inFileList&&this._inFileList.$fileList.empty()},removeSharingOut:function(){this._outFileList&&this._outFileList.$fileList.empty()},removeSharingLinks:function(){this._linkFileList&&this._linkFileList.$fileList.empty()},removeSharingDeleted:function(){this._deletedFileList&&this._deletedFileList.$fileList.empty()},removeSharingPending:function(){this._pendingFileList&&this._pendingFileList.$fileList.empty()},removeSharingOverview:function(){this._overviewFileList&&this._overviewFileList.$fileList.empty()},destroy:function(){OCA.Files.fileActions.off("setDefault.app-sharing",this._onActionsUpdated),OCA.Files.fileActions.off("registerAction.app-sharing",this._onActionsUpdated),this.removeSharingIn(),this.removeSharingOut(),this.removeSharingLinks(),this._inFileList=null,this._outFileList=null,this._linkFileList=null,this._overviewFileList=null,delete this._globalActionsInitialized},_createFileActions:function(){var e=new OCA.Files.FileActions;return e.registerDefaultActions(),e.merge(OCA.Files.fileActions),this._globalActionsInitialized||(this._onActionsUpdated=_.bind(this._onActionsUpdated,this),OCA.Files.fileActions.on("setDefault.app-sharing",this._onActionsUpdated),OCA.Files.fileActions.on("registerAction.app-sharing",this._onActionsUpdated),this._globalActionsInitialized=!0),e.register("dir","Open",OC.PERMISSION_READ,"",(function(e,i){OCA.Files.App.setActiveView("files",{silent:!0}),OCA.Files.App.fileList.changeDirectory(OC.joinPaths(i.$file.attr("data-path"),e),!0,!0)})),e.setDefault("dir","Open"),e},_restoreShareAction:function(){var e=new OCA.Files.FileActions;return e.registerAction({name:"Restore",displayName:t("files_sharing","Restore"),altText:t("files_sharing","Restore share"),mime:"all",permissions:OC.PERMISSION_ALL,iconClass:"icon-history",type:OCA.Files.FileActions.TYPE_INLINE,actionHandler:function(e,i){var s=i.$file.data("shareId");$.post(OC.linkToOCS("apps/files_sharing/api/v1/deletedshares",2)+s).success((function(e){i.fileList.remove(i.fileInfoModel.attributes.name)})).fail((function(){OC.Notification.showTemporary(t("files_sharing","Something happened. Unable to restore the share."))}))}}),e},_acceptShareAction:function(){var e=new OCA.Files.FileActions;return e.registerAction({name:"Accept share",displayName:t("files_sharing","Accept share"),mime:"all",permissions:OC.PERMISSION_ALL,iconClass:"icon-checkmark",type:OCA.Files.FileActions.TYPE_INLINE,actionHandler:function(e,i){var s=i.$file.data("shareId");i.$file.attr("data-remote-id"),$.post(OC.linkToOCS("apps/files_sharing/api/v1/shares/pending",2)+s).success((function(e){i.fileList.remove(i.fileInfoModel.attributes.name)})).fail((function(){OC.Notification.showTemporary(t("files_sharing","Something happened. Unable to accept the share."))}))}}),e.registerAction({name:"Reject share",displayName:t("files_sharing","Reject share"),mime:"all",permissions:OC.PERMISSION_ALL,iconClass:"icon-close",type:OCA.Files.FileActions.TYPE_INLINE,shouldRender:function(e){return!e.$file.attr("data-remote-id")||parseInt(e.$file.attr("data-share-type"),10)!==OC.Share.SHARE_TYPE_REMOTE_GROUP},actionHandler:function(e,i){var s=i.$file.data("shareId");i.$file.attr("data-remote-id"),$.ajax({url:OC.linkToOCS("apps/files_sharing/api/v1/shares",2)+s,type:"DELETE"}).success((function(e){i.fileList.remove(i.fileInfoModel.attributes.name)})).fail((function(){OC.Notification.showTemporary(t("files_sharing","Something happened. Unable to reject the share."))}))}}),e},_onActionsUpdated:function(e){_.each([this._inFileList,this._outFileList,this._linkFileList],(function(i){i&&(e.action?i.fileActions.registerAction(e.action):e.defaultAction&&i.fileActions.setDefault(e.defaultAction.mime,e.defaultAction.name))}))},_extendFileList:function(e){e.fileSummary.$el.find(".filesize").remove()}},window.addEventListener("DOMContentLoaded",(function(){$("#app-content-sharingin").on("show",(function(e){OCA.Sharing.App.initSharingIn($(e.target))})),$("#app-content-sharingin").on("hide",(function(){OCA.Sharing.App.removeSharingIn()})),$("#app-content-sharingout").on("show",(function(e){OCA.Sharing.App.initSharingOut($(e.target))})),$("#app-content-sharingout").on("hide",(function(){OCA.Sharing.App.removeSharingOut()})),$("#app-content-sharinglinks").on("show",(function(e){OCA.Sharing.App.initSharingLinks($(e.target))})),$("#app-content-sharinglinks").on("hide",(function(){OCA.Sharing.App.removeSharingLinks()})),$("#app-content-deletedshares").on("show",(function(e){OCA.Sharing.App.initSharingDeleted($(e.target))})),$("#app-content-deletedshares").on("hide",(function(){OCA.Sharing.App.removeSharingDeleted()})),$("#app-content-pendingshares").on("show",(function(e){OCA.Sharing.App.initSharingPening($(e.target))})),$("#app-content-pendingshares").on("hide",(function(){OCA.Sharing.App.removeSharingPending()})),$("#app-content-shareoverview").on("show",(function(e){OCA.Sharing.App.initShareingOverview($(e.target))})),$("#app-content-shareoverview").on("hide",(function(){OCA.Sharing.App.removeSharingOverview()}))}))},46658:function(){var e;(e=function(e,i){this.initialize(e,i)}).prototype=_.extend({},OCA.Files.FileList.prototype,{appName:"Shares",_sharedWithUser:!1,_linksOnly:!1,_showDeleted:!1,_showPending:!1,_clientSideSort:!0,_allowSelection:!1,_isOverview:!1,initialize:function(e,i){OCA.Files.FileList.prototype.initialize.apply(this,arguments),this.initialized||(i&&i.sharedWithUser&&(this._sharedWithUser=!0),i&&i.linksOnly&&(this._linksOnly=!0),i&&i.showDeleted&&(this._showDeleted=!0),i&&i.showPending&&(this._showPending=!0),i&&i.isOverview&&(this._isOverview=!0))},_renderRow:function(){return OCA.Files.FileList.prototype._renderRow.apply(this,arguments)},_createRow:function(e){var i=OCA.Files.FileList.prototype._createRow.apply(this,arguments);if(i.find(".filesize").remove(),i.find("td.date").before(i.children("td:first")),i.find("td.filename input:checkbox").remove(),i.attr("data-share-id",_.pluck(e.shares,"id").join(",")),this._sharedWithUser){i.attr("data-share-owner",e.shareOwner),i.attr("data-mounttype","shared-root");var s=parseInt(i.attr("data-permissions"))|OC.PERMISSION_DELETE;i.attr("data-permissions",s)}if((this._showDeleted||this._showPending)&&(s=e.permissions,i.attr("data-share-permissions",s)),e.remoteId&&i.attr("data-remote-id",e.remoteId),e.shareType&&i.attr("data-share-type",e.shareType),this._linksOnly){var n=0;e.shares&&null!==e.shares[0].expiration&&(n=moment(e.shares[0].expiration).valueOf()),i.attr("data-expiration",n);var a,r,h=Math.round((n-(new Date).getTime())/1e3/60/60/24*5);h>=160&&(h=160),n>0?(a=OC.Util.formatDate(n),r=OC.Util.relativeModifiedDate(n)):(a=t("files_sharing","No expiration date set"),r="",h=160),td=$("").attr({class:"date"}),td.append($("").attr({class:"modified",title:a,style:"color:rgb("+h+","+h+","+h+")"}).text(r).tooltip({placement:"top"})),i.append(td)}return i},setSharedWithUser:function(e){this._sharedWithUser=!!e},updateEmptyContent:function(){var e=this.getCurrentDirectory();"/"===e?(this.$el.find("#emptycontent").toggleClass("hidden",!this.isEmpty),this.$el.find("#filestable thead th").toggleClass("hidden",this.isEmpty),this._linksOnly||this.$el.find("th.column-expiration").addClass("hidden")):OCA.Files.FileList.prototype.updateEmptyContent.apply(this,arguments)},getDirectoryPermissions:function(){return OC.PERMISSION_READ|OC.PERMISSION_DELETE},updateStorageStatistics:function(){},updateRow:function(e,i,t){return e},reload:function(){this.showMask(),this._reloadCall&&this._reloadCall.abort(),this._setCurrentDir("/",!1);var e=[],i={url:OC.linkToOCS("apps/files_sharing/api/v1",2)+"deletedshares",data:{format:"json",include_tags:!0},type:"GET",beforeSend:function(e){e.setRequestHeader("OCS-APIREQUEST","true")}},t={url:OC.linkToOCS("apps/files_sharing/api/v1/shares",2)+"pending",data:{format:"json"},type:"GET",beforeSend:function(e){e.setRequestHeader("OCS-APIREQUEST","true")}},s={url:OC.linkToOCS("apps/files_sharing/api/v1/remote_shares",2)+"pending",data:{format:"json"},type:"GET",beforeSend:function(e){e.setRequestHeader("OCS-APIREQUEST","true")}},n={url:OC.linkToOCS("apps/files_sharing/api/v1")+"shares",data:{format:"json",shared_with_me:!1!==this._sharedWithUser,include_tags:!0},type:"GET",beforeSend:function(e){e.setRequestHeader("OCS-APIREQUEST","true")}},a={url:OC.linkToOCS("apps/files_sharing/api/v1")+"remote_shares",data:{format:"json",include_tags:!0},type:"GET",beforeSend:function(e){e.setRequestHeader("OCS-APIREQUEST","true")}};this._showDeleted?e.push($.ajax(i)):this._showPending?(e.push($.ajax(t)),e.push($.ajax(s))):(e.push($.ajax(n)),(!1!==this._sharedWithUser||this._isOverview)&&e.push($.ajax(a)),this._isOverview&&(n.data.shared_with_me=!n.data.shared_with_me,e.push($.ajax(n)))),this._reloadCall=$.when.apply($,e);var r=this.reloadCallback.bind(this);return this._reloadCall.then(r,r)},reloadCallback:function(e,i,s){delete this._reloadCall,this.hideMask(),this.$el.find("#headerSharedWith").text(t("files_sharing",this._sharedWithUser?"Shared by":"Shared with"));var n=[];return e[0]&&e[0].ocs&&(e=e[0]),i&&i[0]&&i[0].ocs&&(i=i[0]),s&&s[0]&&s[0].ocs&&(s=s[0]),e.ocs&&e.ocs.data&&(n=n.concat(this._makeFilesFromShares(e.ocs.data,this._sharedWithUser))),i&&i.ocs&&i.ocs.data&&(n=n.concat(this._makeFilesFromRemoteShares(i.ocs.data))),s&&s.ocs&&s.ocs.data&&(n=this._showPending?n.concat(this._makeFilesFromRemoteShares(s.ocs.data)):n.concat(this._makeFilesFromShares(s.ocs.data,!this._sharedWithUser))),this.setFiles(n),!0},_makeFilesFromRemoteShares:function(e){var i=e;return _.chain(i).map((function(e){var i={shareOwner:e.owner+"@"+e.remote.replace(/.*?:\/\//g,""),name:OC.basename(e.mountpoint),mtime:1e3*e.mtime,mimetype:e.mimetype,type:e.type,shareType:1===parseInt(e.share_type,10)?OC.Share.SHARE_TYPE_REMOTE_GROUP:OC.Share.SHARE_TYPE_REMOTE,id:e.file_id,path:OC.dirname(e.mountpoint),permissions:e.permissions,tags:e.tags||[]};return e.remote_id&&("1"!==e.accepted&&(i.name=OC.basename(e.name),i.path="/"),i.remoteId=e.remote_id,i.shareOwnerId=e.owner),i.mimetype||(i.mimetype="dir-shared"),i.shares=[{id:e.id,type:OC.Share.SHARE_TYPE_REMOTE}],i})).value()},_makeFilesFromShares:function(e,i){var t=e;return this._linksOnly&&(t=_.filter(e,(function(e){return e.share_type===OC.Share.SHARE_TYPE_LINK}))),t=_.chain(t).map((function(e){var t={id:e.file_source,icon:OC.MimeType.getIconUrl(e.mimetype),mimetype:e.mimetype,hasPreview:e.has_preview,tags:e.tags||[]};return"folder"===e.item_type?(t.type="dir",t.mimetype="httpd/unix-directory"):t.type="file",t.share={id:e.id,type:e.share_type,target:e.share_with,stime:1e3*e.stime,expiration:e.expiration},i?(t.shareOwner=e.displayname_owner,t.shareOwnerId=e.uid_owner,t.name=OC.basename(e.file_target),t.path=OC.dirname(e.file_target),t.permissions=e.permissions,t.path&&(t.extraData=e.file_target)):(e.share_type!==OC.Share.SHARE_TYPE_LINK&&(t.share.targetDisplayName=e.share_with_displayname,t.share.targetShareWithId=e.share_with),t.name=OC.basename(e.path),t.path=OC.dirname(e.path),t.permissions=OC.PERMISSION_ALL,t.path&&(t.extraData=e.path)),t})).reduce((function(e,i){var t=e[i.id],s=i.share.targetDisplayName,n=i.share.targetShareWithId;return t?(i.share.stime>t.mtime&&(t.mtime=i.share.stime),t.shares.push(i.share)):((t=e[i.id]=i).shares=[i.share],t.recipients={},t.recipientData={},t.shareTypes={},t.recipientsCount=0,t.mtime=i.share.stime),s&&(t.recipientsCount<4&&(t.recipients[s]=!0,t.recipientData[t.recipientsCount]={shareWith:n,shareWithDisplayName:s}),t.recipientsCount++),t.shareTypes[i.share.type]=!0,delete i.share,e}),{}).values().each((function(e){e.mountType="shared",delete e.recipientsCount,i?delete e.shareTypes:e.shareTypes=_.keys(e.shareTypes)})).value(),t.sort(this._sortComparator)}}),OCA.Sharing.FileList=e}},i={};function s(t){var n=i[t];if(void 0!==n)return n.exports;var a=i[t]={exports:{}};return e[t](a,a.exports,s),a.exports}s.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(i,{a:i}),i},s.d=function(e,i){for(var t in i)s.o(i,t)&&!s.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:i[t]})},s.o=function(e,i){return Object.prototype.hasOwnProperty.call(e,i)},function(){"use strict";s(24839),s(46658)}()}(); -//# sourceMappingURL=files_sharing-files_sharing.js.map?v=cefcac7ee05208572e59 \ No newline at end of file +!function(){var e={24839:function(){OCA.Sharing||(OCA.Sharing={}),OCA.Sharing.App={_inFileList:null,_outFileList:null,_overviewFileList:null,_pendingFileList:null,initSharingIn:function(e){return this._inFileList||(this._inFileList=new OCA.Sharing.FileList(e,{id:"shares.self",sharedWithUser:!0,fileActions:this._createFileActions(),config:OCA.Files.App.getFilesConfig(),shown:!0}),this._extendFileList(this._inFileList),this._inFileList.appName=t("files_sharing","Shared with you"),this._inFileList.$el.find("#emptycontent").html('

'+t("files_sharing","Nothing shared with you yet")+"

"+t("files_sharing","Files and folders others share with you will show up here")+"

")),this._inFileList},initSharingOut:function(e){return this._outFileList||(this._outFileList=new OCA.Sharing.FileList(e,{id:"shares.others",sharedWithUser:!1,fileActions:this._createFileActions(),config:OCA.Files.App.getFilesConfig(),shown:!0}),this._extendFileList(this._outFileList),this._outFileList.appName=t("files_sharing","Shared with others"),this._outFileList.$el.find("#emptycontent").html('

'+t("files_sharing","Nothing shared yet")+"

"+t("files_sharing","Files and folders you share will show up here")+"

")),this._outFileList},initSharingLinks:function(e){return this._linkFileList||(this._linkFileList=new OCA.Sharing.FileList(e,{id:"shares.link",linksOnly:!0,fileActions:this._createFileActions(),config:OCA.Files.App.getFilesConfig(),shown:!0}),this._extendFileList(this._linkFileList),this._linkFileList.appName=t("files_sharing","Shared by link"),this._linkFileList.$el.find("#emptycontent").html('

'+t("files_sharing","No shared links")+"

"+t("files_sharing","Files and folders you share by link will show up here")+"

")),this._linkFileList},initSharingDeleted:function(e){return this._deletedFileList||(this._deletedFileList=new OCA.Sharing.FileList(e,{id:"shares.deleted",defaultFileActionsDisabled:!0,showDeleted:!0,sharedWithUser:!0,fileActions:this._restoreShareAction(),config:OCA.Files.App.getFilesConfig(),shown:!0}),this._extendFileList(this._deletedFileList),this._deletedFileList.appName=t("files_sharing","Deleted shares"),this._deletedFileList.$el.find("#emptycontent").html('

'+t("files_sharing","No deleted shares")+"

"+t("files_sharing","Shares you deleted will show up here")+"

")),this._deletedFileList},initSharingPening:function(e){return this._pendingFileList||(this._pendingFileList=new OCA.Sharing.FileList(e,{id:"shares.pending",showPending:!0,detailsViewEnabled:!1,defaultFileActionsDisabled:!0,sharedWithUser:!0,fileActions:this._acceptShareAction(),config:OCA.Files.App.getFilesConfig(),shown:!0}),this._extendFileList(this._pendingFileList),this._pendingFileList.appName=t("files_sharing","Pending shares"),this._pendingFileList.$el.find("#emptycontent").html('

'+t("files_sharing","No pending shares")+"

"+t("files_sharing","Shares you have received but not confirmed will show up here")+"

")),this._pendingFileList},initShareingOverview:function(e){return this._overviewFileList||(this._overviewFileList=new OCA.Sharing.FileList(e,{id:"shares.overview",fileActions:this._createFileActions(),config:OCA.Files.App.getFilesConfig(),isOverview:!0,shown:!0}),this._extendFileList(this._overviewFileList),this._overviewFileList.appName=t("files_sharing","Shares"),this._overviewFileList.$el.find("#emptycontent").html('

'+t("files_sharing","No shares")+"

"+t("files_sharing","Shares will show up here")+"

")),this._overviewFileList},removeSharingIn:function(){this._inFileList&&this._inFileList.$fileList.empty()},removeSharingOut:function(){this._outFileList&&this._outFileList.$fileList.empty()},removeSharingLinks:function(){this._linkFileList&&this._linkFileList.$fileList.empty()},removeSharingDeleted:function(){this._deletedFileList&&this._deletedFileList.$fileList.empty()},removeSharingPending:function(){this._pendingFileList&&this._pendingFileList.$fileList.empty()},removeSharingOverview:function(){this._overviewFileList&&this._overviewFileList.$fileList.empty()},destroy:function(){OCA.Files.fileActions.off("setDefault.app-sharing",this._onActionsUpdated),OCA.Files.fileActions.off("registerAction.app-sharing",this._onActionsUpdated),this.removeSharingIn(),this.removeSharingOut(),this.removeSharingLinks(),this._inFileList=null,this._outFileList=null,this._linkFileList=null,this._overviewFileList=null,delete this._globalActionsInitialized},_createFileActions:function(){var e=new OCA.Files.FileActions;return e.registerDefaultActions(),e.merge(OCA.Files.fileActions),this._globalActionsInitialized||(this._onActionsUpdated=_.bind(this._onActionsUpdated,this),OCA.Files.fileActions.on("setDefault.app-sharing",this._onActionsUpdated),OCA.Files.fileActions.on("registerAction.app-sharing",this._onActionsUpdated),this._globalActionsInitialized=!0),e.register("dir","Open",OC.PERMISSION_READ,"",(function(e,i){OCA.Files.App.setActiveView("files",{silent:!0}),OCA.Files.App.fileList.changeDirectory(OC.joinPaths(i.$file.attr("data-path"),e),!0,!0)})),e.setDefault("dir","Open"),e},_restoreShareAction:function(){var e=new OCA.Files.FileActions;return e.registerAction({name:"Restore",displayName:t("files_sharing","Restore"),altText:t("files_sharing","Restore share"),mime:"all",permissions:OC.PERMISSION_ALL,iconClass:"icon-history",type:OCA.Files.FileActions.TYPE_INLINE,actionHandler:function(e,i){var s=i.$file.data("shareId");$.post(OC.linkToOCS("apps/files_sharing/api/v1/deletedshares",2)+s).success((function(e){i.fileList.remove(i.fileInfoModel.attributes.name)})).fail((function(){OC.Notification.showTemporary(t("files_sharing","Something happened. Unable to restore the share."))}))}}),e},_acceptShareAction:function(){var e=new OCA.Files.FileActions;return e.registerAction({name:"Accept share",displayName:t("files_sharing","Accept share"),mime:"all",permissions:OC.PERMISSION_ALL,iconClass:"icon-checkmark",type:OCA.Files.FileActions.TYPE_INLINE,actionHandler:function(e,i){var s=i.$file.data("shareId");i.$file.attr("data-remote-id"),$.post(OC.linkToOCS("apps/files_sharing/api/v1/shares/pending",2)+s).success((function(e){i.fileList.remove(i.fileInfoModel.attributes.name)})).fail((function(){OC.Notification.showTemporary(t("files_sharing","Something happened. Unable to accept the share."))}))}}),e.registerAction({name:"Reject share",displayName:t("files_sharing","Reject share"),mime:"all",permissions:OC.PERMISSION_ALL,iconClass:"icon-close",type:OCA.Files.FileActions.TYPE_INLINE,shouldRender:function(e){return!e.$file.attr("data-remote-id")||parseInt(e.$file.attr("data-share-type"),10)!==OC.Share.SHARE_TYPE_REMOTE_GROUP},actionHandler:function(e,i){var s=i.$file.data("shareId");i.$file.attr("data-remote-id"),$.ajax({url:OC.linkToOCS("apps/files_sharing/api/v1/shares",2)+s,type:"DELETE"}).success((function(e){i.fileList.remove(i.fileInfoModel.attributes.name)})).fail((function(){OC.Notification.showTemporary(t("files_sharing","Something happened. Unable to reject the share."))}))}}),e},_onActionsUpdated:function(e){_.each([this._inFileList,this._outFileList,this._linkFileList],(function(i){i&&(e.action?i.fileActions.registerAction(e.action):e.defaultAction&&i.fileActions.setDefault(e.defaultAction.mime,e.defaultAction.name))}))},_extendFileList:function(e){e.fileSummary.$el.find(".filesize").remove()}},window.addEventListener("DOMContentLoaded",(function(){$("#app-content-sharingin").on("show",(function(e){OCA.Sharing.App.initSharingIn($(e.target))})),$("#app-content-sharingin").on("hide",(function(){OCA.Sharing.App.removeSharingIn()})),$("#app-content-sharingout").on("show",(function(e){OCA.Sharing.App.initSharingOut($(e.target))})),$("#app-content-sharingout").on("hide",(function(){OCA.Sharing.App.removeSharingOut()})),$("#app-content-sharinglinks").on("show",(function(e){OCA.Sharing.App.initSharingLinks($(e.target))})),$("#app-content-sharinglinks").on("hide",(function(){OCA.Sharing.App.removeSharingLinks()})),$("#app-content-deletedshares").on("show",(function(e){OCA.Sharing.App.initSharingDeleted($(e.target))})),$("#app-content-deletedshares").on("hide",(function(){OCA.Sharing.App.removeSharingDeleted()})),$("#app-content-pendingshares").on("show",(function(e){OCA.Sharing.App.initSharingPening($(e.target))})),$("#app-content-pendingshares").on("hide",(function(){OCA.Sharing.App.removeSharingPending()})),$("#app-content-shareoverview").on("show",(function(e){OCA.Sharing.App.initShareingOverview($(e.target))})),$("#app-content-shareoverview").on("hide",(function(){OCA.Sharing.App.removeSharingOverview()}))}))},46658:function(){var e;(e=function(e,i){this.initialize(e,i)}).prototype=_.extend({},OCA.Files.FileList.prototype,{appName:"Shares",_sharedWithUser:!1,_linksOnly:!1,_showDeleted:!1,_showPending:!1,_clientSideSort:!0,_allowSelection:!1,_isOverview:!1,initialize:function(e,i){OCA.Files.FileList.prototype.initialize.apply(this,arguments),this.initialized||(i&&i.sharedWithUser&&(this._sharedWithUser=!0),i&&i.linksOnly&&(this._linksOnly=!0),i&&i.showDeleted&&(this._showDeleted=!0),i&&i.showPending&&(this._showPending=!0),i&&i.isOverview&&(this._isOverview=!0))},_renderRow:function(){return OCA.Files.FileList.prototype._renderRow.apply(this,arguments)},_createRow:function(e){var i=OCA.Files.FileList.prototype._createRow.apply(this,arguments);if(i.find(".filesize").remove(),i.find("td.date").before(i.children("td:first")),i.find("td.filename input:checkbox").remove(),i.attr("data-share-id",_.pluck(e.shares,"id").join(",")),this._sharedWithUser){i.attr("data-share-owner",e.shareOwner),i.attr("data-mounttype","shared-root");var s=parseInt(i.attr("data-permissions"))|OC.PERMISSION_DELETE;i.attr("data-permissions",s)}if((this._showDeleted||this._showPending)&&(s=e.permissions,i.attr("data-share-permissions",s)),e.remoteId&&i.attr("data-remote-id",e.remoteId),e.shareType&&i.attr("data-share-type",e.shareType),this._linksOnly){var n=0;e.shares&&null!==e.shares[0].expiration&&(n=moment(e.shares[0].expiration).valueOf()),i.attr("data-expiration",n);var a,r,h=Math.round((n-(new Date).getTime())/1e3/60/60/24*5);h>=160&&(h=160),n>0?(a=OC.Util.formatDate(n),r=OC.Util.relativeModifiedDate(n)):(a=t("files_sharing","No expiration date set"),r="",h=160),td=$("").attr({class:"date"}),td.append($("").attr({class:"modified",title:a,style:"color:rgb("+h+","+h+","+h+")"}).text(r).tooltip({placement:"top"})),i.append(td)}return i},setSharedWithUser:function(e){this._sharedWithUser=!!e},updateEmptyContent:function(){var e=this.getCurrentDirectory();"/"===e?(this.$el.find("#emptycontent").toggleClass("hidden",!this.isEmpty),this.$el.find("#filestable thead th").toggleClass("hidden",this.isEmpty),this._linksOnly||this.$el.find("th.column-expiration").addClass("hidden")):OCA.Files.FileList.prototype.updateEmptyContent.apply(this,arguments)},getDirectoryPermissions:function(){return OC.PERMISSION_READ|OC.PERMISSION_DELETE},updateStorageStatistics:function(){},updateRow:function(e,i,t){return e},reload:function(){this.showMask(),this._reloadCall&&this._reloadCall.abort(),this._setCurrentDir("/",!1);var e=[],i={url:OC.linkToOCS("apps/files_sharing/api/v1",2)+"deletedshares",data:{format:"json",include_tags:!0},type:"GET",beforeSend:function(e){e.setRequestHeader("OCS-APIREQUEST","true")}},t={url:OC.linkToOCS("apps/files_sharing/api/v1/shares",2)+"pending",data:{format:"json"},type:"GET",beforeSend:function(e){e.setRequestHeader("OCS-APIREQUEST","true")}},s={url:OC.linkToOCS("apps/files_sharing/api/v1/remote_shares",2)+"pending",data:{format:"json"},type:"GET",beforeSend:function(e){e.setRequestHeader("OCS-APIREQUEST","true")}},n={url:OC.linkToOCS("apps/files_sharing/api/v1")+"shares",data:{format:"json",shared_with_me:!1!==this._sharedWithUser,include_tags:!0},type:"GET",beforeSend:function(e){e.setRequestHeader("OCS-APIREQUEST","true")}},a={url:OC.linkToOCS("apps/files_sharing/api/v1")+"remote_shares",data:{format:"json",include_tags:!0},type:"GET",beforeSend:function(e){e.setRequestHeader("OCS-APIREQUEST","true")}};this._showDeleted?e.push($.ajax(i)):this._showPending?(e.push($.ajax(t)),e.push($.ajax(s))):(e.push($.ajax(n)),(!1!==this._sharedWithUser||this._isOverview)&&e.push($.ajax(a)),this._isOverview&&(n.data.shared_with_me=!n.data.shared_with_me,e.push($.ajax(n)))),this._reloadCall=$.when.apply($,e);var r=this.reloadCallback.bind(this);return this._reloadCall.then(r,r)},reloadCallback:function(e,i,s){delete this._reloadCall,this.hideMask(),this.$el.find("#headerSharedWith").text(t("files_sharing",this._sharedWithUser?"Shared by":"Shared with"));var n=[];return e[0]&&e[0].ocs&&(e=e[0]),i&&i[0]&&i[0].ocs&&(i=i[0]),s&&s[0]&&s[0].ocs&&(s=s[0]),e.ocs&&e.ocs.data&&(n=n.concat(this._makeFilesFromShares(e.ocs.data,this._sharedWithUser))),i&&i.ocs&&i.ocs.data&&(n=n.concat(this._makeFilesFromRemoteShares(i.ocs.data))),s&&s.ocs&&s.ocs.data&&(n=this._showPending?n.concat(this._makeFilesFromRemoteShares(s.ocs.data)):n.concat(this._makeFilesFromShares(s.ocs.data,!this._sharedWithUser))),this.setFiles(n),!0},_makeFilesFromRemoteShares:function(e){var i=e;return _.chain(i).map((function(e){var i={shareOwner:e.owner+"@"+e.remote.replace(/.*?:\/\//g,""),name:OC.basename(e.mountpoint),mtime:1e3*e.mtime,mimetype:e.mimetype,type:e.type,shareType:1===parseInt(e.share_type,10)?OC.Share.SHARE_TYPE_REMOTE_GROUP:OC.Share.SHARE_TYPE_REMOTE,id:e.file_id,path:OC.dirname(e.mountpoint),permissions:e.permissions,tags:e.tags||[]};return e.remote_id&&("1"!==e.accepted&&(i.name=OC.basename(e.name),i.path="/"),i.remoteId=e.remote_id,i.shareOwnerId=e.owner),i.mimetype||(i.mimetype="dir-shared"),i.shares=[{id:e.id,type:OC.Share.SHARE_TYPE_REMOTE}],i})).value()},_makeFilesFromShares:function(e,i){var t=e;return this._linksOnly&&(t=_.filter(e,(function(e){return e.share_type===OC.Share.SHARE_TYPE_LINK}))),t=_.chain(t).map((function(e){var t={id:e.file_source,icon:OC.MimeType.getIconUrl(e.mimetype),mimetype:e.mimetype,hasPreview:e.has_preview,tags:e.tags||[]};return"folder"===e.item_type?(t.type="dir",t.mimetype="httpd/unix-directory"):t.type="file",t.share={id:e.id,type:e.share_type,target:e.share_with,stime:1e3*e.stime,expiration:e.expiration},i?(t.shareOwner=e.displayname_owner,t.shareOwnerId=e.uid_owner,t.name=OC.basename(e.file_target),t.path=OC.dirname(e.file_target),t.permissions=e.permissions,t.path&&(t.extraData=e.file_target)):(e.share_type!==OC.Share.SHARE_TYPE_LINK&&(t.share.targetDisplayName=e.share_with_displayname,t.share.targetShareWithId=e.share_with),t.name=OC.basename(e.path),t.path=OC.dirname(e.path),t.permissions=OC.PERMISSION_ALL,t.path&&(t.extraData=e.path)),t})).reduce((function(e,i){var t=e[i.id],s=i.share.targetDisplayName,n=i.share.targetShareWithId;return t?(i.share.stime>t.mtime&&(t.mtime=i.share.stime),t.shares.push(i.share)):((t=e[i.id]=i).shares=[i.share],t.recipients={},t.recipientData={},t.shareTypes={},t.recipientsCount=0,t.mtime=i.share.stime),s&&(t.recipientsCount<4&&(t.recipients[s]=!0,t.recipientData[t.recipientsCount]={shareWith:n,shareWithDisplayName:s}),t.recipientsCount++),t.shareTypes[i.share.type]=!0,delete i.share,e}),{}).values().each((function(e){e.mountType="shared",delete e.recipientsCount,i?delete e.shareTypes:e.shareTypes=_.keys(e.shareTypes)})).value(),t.sort(this._sortComparator)}}),OCA.Sharing.FileList=e}},i={};function s(t){var n=i[t];if(void 0!==n)return n.exports;var a=i[t]={exports:{}};return e[t](a,a.exports,s),a.exports}s.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(i,{a:i}),i},s.d=function(e,i){for(var t in i)s.o(i,t)&&!s.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:i[t]})},s.o=function(e,i){return Object.prototype.hasOwnProperty.call(e,i)},function(){"use strict";s(24839),s(46658)}()}(); +//# sourceMappingURL=files_sharing-files_sharing.js.map?v=4d839c79419ec5791332 \ No newline at end of file diff --git a/dist/files_sharing-files_sharing.js.map b/dist/files_sharing-files_sharing.js.map index 4886870087780..f0b9872e883f0 100644 --- a/dist/files_sharing-files_sharing.js.map +++ b/dist/files_sharing-files_sharing.js.map @@ -1 +1 @@ -{"version":3,"file":"files_sharing-files_sharing.js?v=cefcac7ee05208572e59","mappings":"oCAUKA,IAAIC,UAIRD,IAAIC,QAAU,IAMfD,IAAIC,QAAQC,IAAM,CAEjBC,YAAa,KACbC,aAAc,KACdC,kBAAmB,KACnBC,iBAAkB,KAElBC,cAPiB,SAOHC,GACb,OAAIC,KAAKN,cAITM,KAAKN,YAAc,IAAIH,IAAIC,QAAQS,SAClCF,EACA,CACCG,GAAI,cACJC,gBAAgB,EAChBC,YAAaJ,KAAKK,qBAClBC,OAAQf,IAAIgB,MAAMd,IAAIe,iBAItBC,OAAO,IAITT,KAAKU,gBAAgBV,KAAKN,aAC1BM,KAAKN,YAAYiB,QAAUC,EAAE,gBAAiB,mBAC9CZ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AAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,IAOV,OAHAE,EAAoBL,GAAUI,EAAQA,EAAOD,QAASJ,GAG/CK,EAAOD,QCpBfJ,EAAoBO,EAAI,SAASF,GAChC,IAAIG,EAASH,GAAUA,EAAOI,WAC7B,WAAa,OAAOJ,EAAgB,SACpC,WAAa,OAAOA,GAErB,OADAL,EAAoBU,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRR,EAAoBU,EAAI,SAASN,EAASQ,GACzC,IAAI,IAAIC,KAAOD,EACXZ,EAAoBc,EAAEF,EAAYC,KAASb,EAAoBc,EAAEV,EAASS,IAC5EE,OAAOC,eAAeZ,EAASS,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3Eb,EAAoBc,EAAI,SAASK,EAAKC,GAAQ,OAAOL,OAAOzJ,UAAU+J,eAAeC,KAAKH,EAAKC,I","sources":["webpack:///nextcloud/apps/files_sharing/js/app.js","webpack:///nextcloud/apps/files_sharing/js/sharedfilelist.js","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand"],"sourcesContent":["/**\n * Copyright (c) 2014 Vincent Petry \n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\nif (!OCA.Sharing) {\n\t/**\n\t * @namespace OCA.Sharing\n\t */\n\tOCA.Sharing = {}\n}\n\n/**\n * @namespace\n */\nOCA.Sharing.App = {\n\n\t_inFileList: null,\n\t_outFileList: null,\n\t_overviewFileList: null,\n\t_pendingFileList: null,\n\n\tinitSharingIn($el) {\n\t\tif (this._inFileList) {\n\t\t\treturn this._inFileList\n\t\t}\n\n\t\tthis._inFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.self',\n\t\t\t\tsharedWithUser: true,\n\t\t\t\tfileActions: this._createFileActions(),\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._inFileList)\n\t\tthis._inFileList.appName = t('files_sharing', 'Shared with you')\n\t\tthis._inFileList.$el.find('#emptycontent').html('
'\n\t\t\t+ '

' + t('files_sharing', 'Nothing shared with you yet') + '

'\n\t\t\t+ '

' + t('files_sharing', 'Files and folders others share with you will show up here') + '

')\n\t\treturn this._inFileList\n\t},\n\n\tinitSharingOut($el) {\n\t\tif (this._outFileList) {\n\t\t\treturn this._outFileList\n\t\t}\n\t\tthis._outFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.others',\n\t\t\t\tsharedWithUser: false,\n\t\t\t\tfileActions: this._createFileActions(),\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._outFileList)\n\t\tthis._outFileList.appName = t('files_sharing', 'Shared with others')\n\t\tthis._outFileList.$el.find('#emptycontent').html('
'\n\t\t\t+ '

' + t('files_sharing', 'Nothing shared yet') + '

'\n\t\t\t+ '

' + t('files_sharing', 'Files and folders you share will show up here') + '

')\n\t\treturn this._outFileList\n\t},\n\n\tinitSharingLinks($el) {\n\t\tif (this._linkFileList) {\n\t\t\treturn this._linkFileList\n\t\t}\n\t\tthis._linkFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.link',\n\t\t\t\tlinksOnly: true,\n\t\t\t\tfileActions: this._createFileActions(),\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._linkFileList)\n\t\tthis._linkFileList.appName = t('files_sharing', 'Shared by link')\n\t\tthis._linkFileList.$el.find('#emptycontent').html('
'\n\t\t\t+ '

' + t('files_sharing', 'No shared links') + '

'\n\t\t\t+ '

' + t('files_sharing', 'Files and folders you share by link will show up here') + '

')\n\t\treturn this._linkFileList\n\t},\n\n\tinitSharingDeleted($el) {\n\t\tif (this._deletedFileList) {\n\t\t\treturn this._deletedFileList\n\t\t}\n\t\tthis._deletedFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.deleted',\n\t\t\t\tdefaultFileActionsDisabled: true,\n\t\t\t\tshowDeleted: true,\n\t\t\t\tsharedWithUser: true,\n\t\t\t\tfileActions: this._restoreShareAction(),\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._deletedFileList)\n\t\tthis._deletedFileList.appName = t('files_sharing', 'Deleted shares')\n\t\tthis._deletedFileList.$el.find('#emptycontent').html('
'\n\t\t\t+ '

' + t('files_sharing', 'No deleted shares') + '

'\n\t\t\t+ '

' + t('files_sharing', 'Shares you deleted will show up here') + '

')\n\t\treturn this._deletedFileList\n\t},\n\n\tinitSharingPening($el) {\n\t\tif (this._pendingFileList) {\n\t\t\treturn this._pendingFileList\n\t\t}\n\t\tthis._pendingFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.pending',\n\t\t\t\tshowPending: true,\n\t\t\t\tdetailsViewEnabled: false,\n\t\t\t\tdefaultFileActionsDisabled: true,\n\t\t\t\tsharedWithUser: true,\n\t\t\t\tfileActions: this._acceptShareAction(),\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._pendingFileList)\n\t\tthis._pendingFileList.appName = t('files_sharing', 'Pending shares')\n\t\tthis._pendingFileList.$el.find('#emptycontent').html('
'\n\t\t\t+ '

' + t('files_sharing', 'No pending shares') + '

'\n\t\t\t+ '

' + t('files_sharing', 'Shares you have received but not confirmed will show up here') + '

')\n\t\treturn this._pendingFileList\n\t},\n\n\tinitShareingOverview($el) {\n\t\tif (this._overviewFileList) {\n\t\t\treturn this._overviewFileList\n\t\t}\n\t\tthis._overviewFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.overview',\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\tisOverview: true,\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._overviewFileList)\n\t\tthis._overviewFileList.appName = t('files_sharing', 'Shares')\n\t\tthis._overviewFileList.$el.find('#emptycontent').html('
'\n\t\t\t+ '

' + t('files_sharing', 'No shares') + '

'\n\t\t\t+ '

' + t('files_sharing', 'Shares will show up here') + '

')\n\t\treturn this._overviewFileList\n\t},\n\n\tremoveSharingIn() {\n\t\tif (this._inFileList) {\n\t\t\tthis._inFileList.$fileList.empty()\n\t\t}\n\t},\n\n\tremoveSharingOut() {\n\t\tif (this._outFileList) {\n\t\t\tthis._outFileList.$fileList.empty()\n\t\t}\n\t},\n\n\tremoveSharingLinks() {\n\t\tif (this._linkFileList) {\n\t\t\tthis._linkFileList.$fileList.empty()\n\t\t}\n\t},\n\n\tremoveSharingDeleted() {\n\t\tif (this._deletedFileList) {\n\t\t\tthis._deletedFileList.$fileList.empty()\n\t\t}\n\t},\n\n\tremoveSharingPending() {\n\t\tif (this._pendingFileList) {\n\t\t\tthis._pendingFileList.$fileList.empty()\n\t\t}\n\t},\n\n\tremoveSharingOverview() {\n\t\tif (this._overviewFileList) {\n\t\t\tthis._overviewFileList.$fileList.empty()\n\t\t}\n\t},\n\n\t/**\n\t * Destroy the app\n\t */\n\tdestroy() {\n\t\tOCA.Files.fileActions.off('setDefault.app-sharing', this._onActionsUpdated)\n\t\tOCA.Files.fileActions.off('registerAction.app-sharing', this._onActionsUpdated)\n\t\tthis.removeSharingIn()\n\t\tthis.removeSharingOut()\n\t\tthis.removeSharingLinks()\n\t\tthis._inFileList = null\n\t\tthis._outFileList = null\n\t\tthis._linkFileList = null\n\t\tthis._overviewFileList = null\n\t\tdelete this._globalActionsInitialized\n\t},\n\n\t_createFileActions() {\n\t\t// inherit file actions from the files app\n\t\tconst fileActions = new OCA.Files.FileActions()\n\t\t// note: not merging the legacy actions because legacy apps are not\n\t\t// compatible with the sharing overview and need to be adapted first\n\t\tfileActions.registerDefaultActions()\n\t\tfileActions.merge(OCA.Files.fileActions)\n\n\t\tif (!this._globalActionsInitialized) {\n\t\t\t// in case actions are registered later\n\t\t\tthis._onActionsUpdated = _.bind(this._onActionsUpdated, this)\n\t\t\tOCA.Files.fileActions.on('setDefault.app-sharing', this._onActionsUpdated)\n\t\t\tOCA.Files.fileActions.on('registerAction.app-sharing', this._onActionsUpdated)\n\t\t\tthis._globalActionsInitialized = true\n\t\t}\n\n\t\t// when the user clicks on a folder, redirect to the corresponding\n\t\t// folder in the files app instead of opening it directly\n\t\tfileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function(filename, context) {\n\t\t\tOCA.Files.App.setActiveView('files', { silent: true })\n\t\t\tOCA.Files.App.fileList.changeDirectory(OC.joinPaths(context.$file.attr('data-path'), filename), true, true)\n\t\t})\n\t\tfileActions.setDefault('dir', 'Open')\n\t\treturn fileActions\n\t},\n\n\t_restoreShareAction() {\n\t\tconst fileActions = new OCA.Files.FileActions()\n\t\tfileActions.registerAction({\n\t\t\tname: 'Restore',\n\t\t\tdisplayName: t('files_sharing', 'Restore'),\n\t\t\taltText: t('files_sharing', 'Restore share'),\n\t\t\tmime: 'all',\n\t\t\tpermissions: OC.PERMISSION_ALL,\n\t\t\ticonClass: 'icon-history',\n\t\t\ttype: OCA.Files.FileActions.TYPE_INLINE,\n\t\t\tactionHandler(fileName, context) {\n\t\t\t\tconst shareId = context.$file.data('shareId')\n\t\t\t\t$.post(OC.linkToOCS('apps/files_sharing/api/v1/deletedshares', 2) + shareId)\n\t\t\t\t\t.success(function(result) {\n\t\t\t\t\t\tcontext.fileList.remove(context.fileInfoModel.attributes.name)\n\t\t\t\t\t}).fail(function() {\n\t\t\t\t\t\tOC.Notification.showTemporary(t('files_sharing', 'Something happened. Unable to restore the share.'))\n\t\t\t\t\t})\n\t\t\t},\n\t\t})\n\t\treturn fileActions\n\t},\n\n\t_acceptShareAction() {\n\t\tconst fileActions = new OCA.Files.FileActions()\n\t\tfileActions.registerAction({\n\t\t\tname: 'Accept share',\n\t\t\tdisplayName: t('files_sharing', 'Accept share'),\n\t\t\tmime: 'all',\n\t\t\tpermissions: OC.PERMISSION_ALL,\n\t\t\ticonClass: 'icon-checkmark',\n\t\t\ttype: OCA.Files.FileActions.TYPE_INLINE,\n\t\t\tactionHandler(fileName, context) {\n\t\t\t\tconst shareId = context.$file.data('shareId')\n\t\t\t\tlet shareBase = 'shares/pending'\n\t\t\t\tif (context.$file.attr('data-remote-id')) {\n\t\t\t\t\tshareBase = 'remote_shares/pending'\n\t\t\t\t}\n\t\t\t\t$.post(OC.linkToOCS('apps/files_sharing/api/v1/shares/pending', 2) + shareId)\n\t\t\t\t\t.success(function(result) {\n\t\t\t\t\t\tcontext.fileList.remove(context.fileInfoModel.attributes.name)\n\t\t\t\t\t}).fail(function() {\n\t\t\t\t\t\tOC.Notification.showTemporary(t('files_sharing', 'Something happened. Unable to accept the share.'))\n\t\t\t\t\t})\n\t\t\t},\n\t\t})\n\t\tfileActions.registerAction({\n\t\t\tname: 'Reject share',\n\t\t\tdisplayName: t('files_sharing', 'Reject share'),\n\t\t\tmime: 'all',\n\t\t\tpermissions: OC.PERMISSION_ALL,\n\t\t\ticonClass: 'icon-close',\n\t\t\ttype: OCA.Files.FileActions.TYPE_INLINE,\n\t\t\tshouldRender(context) {\n\t\t\t\t// disable rejecting group shares from the pending list because they anyway\n\t\t\t\t// land back into that same list\n\t\t\t\tif (context.$file.attr('data-remote-id') && parseInt(context.$file.attr('data-share-type'), 10) === OC.Share.SHARE_TYPE_REMOTE_GROUP) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t},\n\t\t\tactionHandler(fileName, context) {\n\t\t\t\tconst shareId = context.$file.data('shareId')\n\t\t\t\tlet shareBase = 'shares'\n\t\t\t\tif (context.$file.attr('data-remote-id')) {\n\t\t\t\t\tshareBase = 'remote_shares/pending'\n\t\t\t\t}\n\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1/shares', 2) + shareId,\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t}).success(function(result) {\n\t\t\t\t\tcontext.fileList.remove(context.fileInfoModel.attributes.name)\n\t\t\t\t}).fail(function() {\n\t\t\t\t\tOC.Notification.showTemporary(t('files_sharing', 'Something happened. Unable to reject the share.'))\n\t\t\t\t})\n\t\t\t},\n\t\t})\n\t\treturn fileActions\n\t},\n\n\t_onActionsUpdated(ev) {\n\t\t_.each([this._inFileList, this._outFileList, this._linkFileList], function(list) {\n\t\t\tif (!list) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (ev.action) {\n\t\t\t\tlist.fileActions.registerAction(ev.action)\n\t\t\t} else if (ev.defaultAction) {\n\t\t\t\tlist.fileActions.setDefault(\n\t\t\t\t\tev.defaultAction.mime,\n\t\t\t\t\tev.defaultAction.name\n\t\t\t\t)\n\t\t\t}\n\t\t})\n\t},\n\n\t_extendFileList(fileList) {\n\t\t// remove size column from summary\n\t\tfileList.fileSummary.$el.find('.filesize').remove()\n\t},\n}\n\nwindow.addEventListener('DOMContentLoaded', function() {\n\t$('#app-content-sharingin').on('show', function(e) {\n\t\tOCA.Sharing.App.initSharingIn($(e.target))\n\t})\n\t$('#app-content-sharingin').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingIn()\n\t})\n\t$('#app-content-sharingout').on('show', function(e) {\n\t\tOCA.Sharing.App.initSharingOut($(e.target))\n\t})\n\t$('#app-content-sharingout').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingOut()\n\t})\n\t$('#app-content-sharinglinks').on('show', function(e) {\n\t\tOCA.Sharing.App.initSharingLinks($(e.target))\n\t})\n\t$('#app-content-sharinglinks').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingLinks()\n\t})\n\t$('#app-content-deletedshares').on('show', function(e) {\n\t\tOCA.Sharing.App.initSharingDeleted($(e.target))\n\t})\n\t$('#app-content-deletedshares').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingDeleted()\n\t})\n\t$('#app-content-pendingshares').on('show', function(e) {\n\t\tOCA.Sharing.App.initSharingPening($(e.target))\n\t})\n\t$('#app-content-pendingshares').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingPending()\n\t})\n\t$('#app-content-shareoverview').on('show', function(e) {\n\t\tOCA.Sharing.App.initShareingOverview($(e.target))\n\t})\n\t$('#app-content-shareoverview').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingOverview()\n\t})\n})\n","/* eslint-disable */\n/*\n * Copyright (c) 2014 Vincent Petry \n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n(function() {\n\n\t/**\n\t * @class OCA.Sharing.FileList\n\t * @augments OCA.Files.FileList\n\t *\n\t * @classdesc Sharing file list.\n\t * Contains both \"shared with others\" and \"shared with you\" modes.\n\t *\n\t * @param $el container element with existing markup for the #controls\n\t * and a table\n\t * @param [options] map of options, see other parameters\n\t * @param {boolean} [options.sharedWithUser] true to return files shared with\n\t * the current user, false to return files that the user shared with others.\n\t * Defaults to false.\n\t * @param {boolean} [options.linksOnly] true to return only link shares\n\t */\n\tvar FileList = function($el, options) {\n\t\tthis.initialize($el, options)\n\t}\n\tFileList.prototype = _.extend({}, OCA.Files.FileList.prototype,\n\t\t/** @lends OCA.Sharing.FileList.prototype */ {\n\t\t\tappName: 'Shares',\n\n\t\t\t/**\n\t\t * Whether the list shows the files shared with the user (true) or\n\t\t * the files that the user shared with others (false).\n\t\t */\n\t\t\t_sharedWithUser: false,\n\t\t\t_linksOnly: false,\n\t\t\t_showDeleted: false,\n\t\t\t_showPending: false,\n\t\t\t_clientSideSort: true,\n\t\t\t_allowSelection: false,\n\t\t\t_isOverview: false,\n\n\t\t\t/**\n\t\t * @private\n\t\t */\n\t\t\tinitialize: function($el, options) {\n\t\t\t\tOCA.Files.FileList.prototype.initialize.apply(this, arguments)\n\t\t\t\tif (this.initialized) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// TODO: consolidate both options\n\t\t\t\tif (options && options.sharedWithUser) {\n\t\t\t\t\tthis._sharedWithUser = true\n\t\t\t\t}\n\t\t\t\tif (options && options.linksOnly) {\n\t\t\t\t\tthis._linksOnly = true\n\t\t\t\t}\n\t\t\t\tif (options && options.showDeleted) {\n\t\t\t\t\tthis._showDeleted = true\n\t\t\t\t}\n\t\t\t\tif (options && options.showPending) {\n\t\t\t\t\tthis._showPending = true\n\t\t\t\t}\n\t\t\t\tif (options && options.isOverview) {\n\t\t\t\t\tthis._isOverview = true\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t_renderRow: function() {\n\t\t\t// HACK: needed to call the overridden _renderRow\n\t\t\t// this is because at the time this class is created\n\t\t\t// the overriding hasn't been done yet...\n\t\t\t\treturn OCA.Files.FileList.prototype._renderRow.apply(this, arguments)\n\t\t\t},\n\n\t\t\t_createRow: function(fileData) {\n\t\t\t// TODO: hook earlier and render the whole row here\n\t\t\t\tvar $tr = OCA.Files.FileList.prototype._createRow.apply(this, arguments)\n\t\t\t\t$tr.find('.filesize').remove()\n\t\t\t\t$tr.find('td.date').before($tr.children('td:first'))\n\t\t\t\t$tr.find('td.filename input:checkbox').remove()\n\t\t\t\t$tr.attr('data-share-id', _.pluck(fileData.shares, 'id').join(','))\n\t\t\t\tif (this._sharedWithUser) {\n\t\t\t\t\t$tr.attr('data-share-owner', fileData.shareOwner)\n\t\t\t\t\t$tr.attr('data-mounttype', 'shared-root')\n\t\t\t\t\tvar permission = parseInt($tr.attr('data-permissions')) | OC.PERMISSION_DELETE\n\t\t\t\t\t$tr.attr('data-permissions', permission)\n\t\t\t\t}\n\t\t\t\tif (this._showDeleted || this._showPending) {\n\t\t\t\t\tvar permission = fileData.permissions\n\t\t\t\t\t$tr.attr('data-share-permissions', permission)\n\t\t\t\t}\n\n\t\t\t\tif (fileData.remoteId) {\n\t\t\t\t\t$tr.attr('data-remote-id', fileData.remoteId)\n\t\t\t\t}\n\n\t\t\t\tif (fileData.shareType) {\n\t\t\t\t\t$tr.attr('data-share-type', fileData.shareType)\n\t\t\t\t}\n\n\t\t\t\t// add row with expiration date for link only shares - influenced by _createRow of filelist\n\t\t\t\tif (this._linksOnly) {\n\t\t\t\t\tvar expirationTimestamp = 0\n\t\t\t\t\tif (fileData.shares && fileData.shares[0].expiration !== null) {\n\t\t\t\t\t\texpirationTimestamp = moment(fileData.shares[0].expiration).valueOf()\n\t\t\t\t\t}\n\t\t\t\t\t$tr.attr('data-expiration', expirationTimestamp)\n\n\t\t\t\t\t// date column (1000 milliseconds to seconds, 60 seconds, 60 minutes, 24 hours)\n\t\t\t\t\t// difference in days multiplied by 5 - brightest shade for expiry dates in more than 32 days (160/5)\n\t\t\t\t\tvar modifiedColor = Math.round((expirationTimestamp - (new Date()).getTime()) / 1000 / 60 / 60 / 24 * 5)\n\t\t\t\t\t// ensure that the brightest color is still readable\n\t\t\t\t\tif (modifiedColor >= 160) {\n\t\t\t\t\t\tmodifiedColor = 160\n\t\t\t\t\t}\n\n\t\t\t\t\tvar formatted\n\t\t\t\t\tvar text\n\t\t\t\t\tif (expirationTimestamp > 0) {\n\t\t\t\t\t\tformatted = OC.Util.formatDate(expirationTimestamp)\n\t\t\t\t\t\ttext = OC.Util.relativeModifiedDate(expirationTimestamp)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tformatted = t('files_sharing', 'No expiration date set')\n\t\t\t\t\t\ttext = ''\n\t\t\t\t\t\tmodifiedColor = 160\n\t\t\t\t\t}\n\t\t\t\t\ttd = $('').attr({ 'class': 'date' })\n\t\t\t\t\ttd.append($('').attr({\n\t\t\t\t\t\t'class': 'modified',\n\t\t\t\t\t\t'title': formatted,\n\t\t\t\t\t\t'style': 'color:rgb(' + modifiedColor + ',' + modifiedColor + ',' + modifiedColor + ')'\n\t\t\t\t\t}).text(text)\n\t\t\t\t\t\t.tooltip({ placement: 'top' })\n\t\t\t\t\t)\n\n\t\t\t\t\t$tr.append(td)\n\t\t\t\t}\n\t\t\t\treturn $tr\n\t\t\t},\n\n\t\t\t/**\n\t\t * Set whether the list should contain outgoing shares\n\t\t * or incoming shares.\n\t\t *\n\t\t * @param state true for incoming shares, false otherwise\n\t\t */\n\t\t\tsetSharedWithUser: function(state) {\n\t\t\t\tthis._sharedWithUser = !!state\n\t\t\t},\n\n\t\t\tupdateEmptyContent: function() {\n\t\t\t\tvar dir = this.getCurrentDirectory()\n\t\t\t\tif (dir === '/') {\n\t\t\t\t// root has special permissions\n\t\t\t\t\tthis.$el.find('#emptycontent').toggleClass('hidden', !this.isEmpty)\n\t\t\t\t\tthis.$el.find('#filestable thead th').toggleClass('hidden', this.isEmpty)\n\n\t\t\t\t\t// hide expiration date header for non link only shares\n\t\t\t\t\tif (!this._linksOnly) {\n\t\t\t\t\t\tthis.$el.find('th.column-expiration').addClass('hidden')\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tOCA.Files.FileList.prototype.updateEmptyContent.apply(this, arguments)\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tgetDirectoryPermissions: function() {\n\t\t\t\treturn OC.PERMISSION_READ | OC.PERMISSION_DELETE\n\t\t\t},\n\n\t\t\tupdateStorageStatistics: function() {\n\t\t\t// no op because it doesn't have\n\t\t\t// storage info like free space / used space\n\t\t\t},\n\n\t\t\tupdateRow: function($tr, fileInfo, options) {\n\t\t\t// no-op, suppress re-rendering\n\t\t\t\treturn $tr\n\t\t\t},\n\n\t\t\treload: function() {\n\t\t\t\tthis.showMask()\n\t\t\t\tif (this._reloadCall) {\n\t\t\t\t\tthis._reloadCall.abort()\n\t\t\t\t}\n\n\t\t\t\t// there is only root\n\t\t\t\tthis._setCurrentDir('/', false)\n\n\t\t\t\tvar promises = []\n\n\t\t\t\tvar deletedShares = {\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1', 2) + 'deletedshares',\n\t\t\t\t\t/* jshint camelcase: false */\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tformat: 'json',\n\t\t\t\t\t\tinclude_tags: true\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tbeforeSend: function(xhr) {\n\t\t\t\t\t\txhr.setRequestHeader('OCS-APIREQUEST', 'true')\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar pendingShares = {\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1/shares', 2) + 'pending',\n\t\t\t\t\t/* jshint camelcase: false */\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tformat: 'json'\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tbeforeSend: function(xhr) {\n\t\t\t\t\t\txhr.setRequestHeader('OCS-APIREQUEST', 'true')\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar pendingRemoteShares = {\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1/remote_shares', 2) + 'pending',\n\t\t\t\t\t/* jshint camelcase: false */\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tformat: 'json'\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tbeforeSend: function(xhr) {\n\t\t\t\t\t\txhr.setRequestHeader('OCS-APIREQUEST', 'true')\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar shares = {\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1') + 'shares',\n\t\t\t\t\t/* jshint camelcase: false */\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tformat: 'json',\n\t\t\t\t\t\tshared_with_me: this._sharedWithUser !== false,\n\t\t\t\t\t\tinclude_tags: true\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tbeforeSend: function(xhr) {\n\t\t\t\t\t\txhr.setRequestHeader('OCS-APIREQUEST', 'true')\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar remoteShares = {\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1') + 'remote_shares',\n\t\t\t\t\t/* jshint camelcase: false */\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tformat: 'json',\n\t\t\t\t\t\tinclude_tags: true\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tbeforeSend: function(xhr) {\n\t\t\t\t\t\txhr.setRequestHeader('OCS-APIREQUEST', 'true')\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Add the proper ajax requests to the list and run them\n\t\t\t\t// and make sure we have 2 promises\n\t\t\t\tif (this._showDeleted) {\n\t\t\t\t\tpromises.push($.ajax(deletedShares))\n\t\t\t\t} else if (this._showPending) {\n\t\t\t\t\tpromises.push($.ajax(pendingShares))\n\t\t\t\t\tpromises.push($.ajax(pendingRemoteShares))\n\t\t\t\t} else {\n\t\t\t\t\tpromises.push($.ajax(shares))\n\n\t\t\t\t\tif (this._sharedWithUser !== false || this._isOverview) {\n\t\t\t\t\t\tpromises.push($.ajax(remoteShares))\n\t\t\t\t\t}\n\t\t\t\t\tif (this._isOverview) {\n\t\t\t\t\t\tshares.data.shared_with_me = !shares.data.shared_with_me\n\t\t\t\t\t\tpromises.push($.ajax(shares))\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._reloadCall = $.when.apply($, promises)\n\t\t\t\tvar callBack = this.reloadCallback.bind(this)\n\t\t\t\treturn this._reloadCall.then(callBack, callBack)\n\t\t\t},\n\n\t\t\treloadCallback: function(shares, remoteShares, additionalShares) {\n\t\t\t\tdelete this._reloadCall\n\t\t\t\tthis.hideMask()\n\n\t\t\t\tthis.$el.find('#headerSharedWith').text(\n\t\t\t\t\tt('files_sharing', this._sharedWithUser ? 'Shared by' : 'Shared with')\n\t\t\t\t)\n\n\t\t\t\tvar files = []\n\n\t\t\t\t// make sure to use the same format\n\t\t\t\tif (shares[0] && shares[0].ocs) {\n\t\t\t\t\tshares = shares[0]\n\t\t\t\t}\n\t\t\t\tif (remoteShares && remoteShares[0] && remoteShares[0].ocs) {\n\t\t\t\t\tremoteShares = remoteShares[0]\n\t\t\t\t}\n\t\t\t\tif (additionalShares && additionalShares[0] && additionalShares[0].ocs) {\n\t\t\t\t\tadditionalShares = additionalShares[0]\n\t\t\t\t}\n\n\t\t\t\tif (shares.ocs && shares.ocs.data) {\n\t\t\t\t\tfiles = files.concat(this._makeFilesFromShares(shares.ocs.data, this._sharedWithUser))\n\t\t\t\t}\n\n\t\t\t\tif (remoteShares && remoteShares.ocs && remoteShares.ocs.data) {\n\t\t\t\t\tfiles = files.concat(this._makeFilesFromRemoteShares(remoteShares.ocs.data))\n\t\t\t\t}\n\n\t\t\t\tif (additionalShares && additionalShares.ocs && additionalShares.ocs.data) {\n\t\t\t\t\tif (this._showPending) {\n\t\t\t\t\t\t// in this case the second callback is about pending remote shares\n\t\t\t\t\t\tfiles = files.concat(this._makeFilesFromRemoteShares(additionalShares.ocs.data))\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfiles = files.concat(this._makeFilesFromShares(additionalShares.ocs.data, !this._sharedWithUser))\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.setFiles(files)\n\t\t\t\treturn true\n\t\t\t},\n\n\t\t\t_makeFilesFromRemoteShares: function(data) {\n\t\t\t\tvar files = data\n\n\t\t\t\tfiles = _.chain(files)\n\t\t\t\t// convert share data to file data\n\t\t\t\t\t.map(function(share) {\n\t\t\t\t\t\tvar file = {\n\t\t\t\t\t\t\tshareOwner: share.owner + '@' + share.remote.replace(/.*?:\\/\\//g, ''),\n\t\t\t\t\t\t\tname: OC.basename(share.mountpoint),\n\t\t\t\t\t\t\tmtime: share.mtime * 1000,\n\t\t\t\t\t\t\tmimetype: share.mimetype,\n\t\t\t\t\t\t\ttype: share.type,\n\t\t\t\t\t\t\t// remote share types are different and need to be mapped\n\t\t\t\t\t\t\tshareType: (parseInt(share.share_type, 10) === 1) ? OC.Share.SHARE_TYPE_REMOTE_GROUP : OC.Share.SHARE_TYPE_REMOTE,\n\t\t\t\t\t\t\tid: share.file_id,\n\t\t\t\t\t\t\tpath: OC.dirname(share.mountpoint),\n\t\t\t\t\t\t\tpermissions: share.permissions,\n\t\t\t\t\t\t\ttags: share.tags || []\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (share.remote_id) {\n\t\t\t\t\t\t\t// remote share\n\t\t\t\t\t\t\tif (share.accepted !== '1') {\n\t\t\t\t\t\t\t\tfile.name = OC.basename(share.name)\n\t\t\t\t\t\t\t\tfile.path = '/'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfile.remoteId = share.remote_id\n\t\t\t\t\t\t\tfile.shareOwnerId = share.owner\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!file.mimetype) {\n\t\t\t\t\t\t\t// pending shares usually have no type, so default to showing a directory icon\n\t\t\t\t\t\t\tfile.mimetype = 'dir-shared'\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfile.shares = [{\n\t\t\t\t\t\t\tid: share.id,\n\t\t\t\t\t\t\ttype: OC.Share.SHARE_TYPE_REMOTE\n\t\t\t\t\t\t}]\n\t\t\t\t\t\treturn file\n\t\t\t\t\t})\n\t\t\t\t\t.value()\n\t\t\t\treturn files\n\t\t\t},\n\n\t\t\t/**\n\t\t * Converts the OCS API share response data to a file info\n\t\t * list\n\t\t * @param {Array} data OCS API share array\n\t\t * @param {boolean} sharedWithUser\n\t\t * @returns {Array.} array of shared file info\n\t\t */\n\t\t\t_makeFilesFromShares: function(data, sharedWithUser) {\n\t\t\t/* jshint camelcase: false */\n\t\t\t\tvar files = data\n\n\t\t\t\tif (this._linksOnly) {\n\t\t\t\t\tfiles = _.filter(data, function(share) {\n\t\t\t\t\t\treturn share.share_type === OC.Share.SHARE_TYPE_LINK\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\t// OCS API uses non-camelcased names\n\t\t\t\tfiles = _.chain(files)\n\t\t\t\t// convert share data to file data\n\t\t\t\t\t.map(function(share) {\n\t\t\t\t\t// TODO: use OC.Files.FileInfo\n\t\t\t\t\t\tvar file = {\n\t\t\t\t\t\t\tid: share.file_source,\n\t\t\t\t\t\t\ticon: OC.MimeType.getIconUrl(share.mimetype),\n\t\t\t\t\t\t\tmimetype: share.mimetype,\n\t\t\t\t\t\t\thasPreview: share.has_preview,\n\t\t\t\t\t\t\ttags: share.tags || []\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (share.item_type === 'folder') {\n\t\t\t\t\t\t\tfile.type = 'dir'\n\t\t\t\t\t\t\tfile.mimetype = 'httpd/unix-directory'\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfile.type = 'file'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfile.share = {\n\t\t\t\t\t\t\tid: share.id,\n\t\t\t\t\t\t\ttype: share.share_type,\n\t\t\t\t\t\t\ttarget: share.share_with,\n\t\t\t\t\t\t\tstime: share.stime * 1000,\n\t\t\t\t\t\t\texpiration: share.expiration\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (sharedWithUser) {\n\t\t\t\t\t\t\tfile.shareOwner = share.displayname_owner\n\t\t\t\t\t\t\tfile.shareOwnerId = share.uid_owner\n\t\t\t\t\t\t\tfile.name = OC.basename(share.file_target)\n\t\t\t\t\t\t\tfile.path = OC.dirname(share.file_target)\n\t\t\t\t\t\t\tfile.permissions = share.permissions\n\t\t\t\t\t\t\tif (file.path) {\n\t\t\t\t\t\t\t\tfile.extraData = share.file_target\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (share.share_type !== OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\t\t\t\tfile.share.targetDisplayName = share.share_with_displayname\n\t\t\t\t\t\t\t\tfile.share.targetShareWithId = share.share_with\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfile.name = OC.basename(share.path)\n\t\t\t\t\t\t\tfile.path = OC.dirname(share.path)\n\t\t\t\t\t\t\tfile.permissions = OC.PERMISSION_ALL\n\t\t\t\t\t\t\tif (file.path) {\n\t\t\t\t\t\t\t\tfile.extraData = share.path\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn file\n\t\t\t\t\t})\n\t\t\t\t// Group all files and have a \"shares\" array with\n\t\t\t\t// the share info for each file.\n\t\t\t\t//\n\t\t\t\t// This uses a hash memo to cumulate share information\n\t\t\t\t// inside the same file object (by file id).\n\t\t\t\t\t.reduce(function(memo, file) {\n\t\t\t\t\t\tvar data = memo[file.id]\n\t\t\t\t\t\tvar recipient = file.share.targetDisplayName\n\t\t\t\t\t\tvar recipientId = file.share.targetShareWithId\n\t\t\t\t\t\tif (!data) {\n\t\t\t\t\t\t\tdata = memo[file.id] = file\n\t\t\t\t\t\t\tdata.shares = [file.share]\n\t\t\t\t\t\t\t// using a hash to make them unique,\n\t\t\t\t\t\t\t// this is only a list to be displayed\n\t\t\t\t\t\t\tdata.recipients = {}\n\t\t\t\t\t\t\tdata.recipientData = {}\n\t\t\t\t\t\t\t// share types\n\t\t\t\t\t\t\tdata.shareTypes = {}\n\t\t\t\t\t\t\t// counter is cheaper than calling _.keys().length\n\t\t\t\t\t\t\tdata.recipientsCount = 0\n\t\t\t\t\t\t\tdata.mtime = file.share.stime\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t// always take the most recent stime\n\t\t\t\t\t\t\tif (file.share.stime > data.mtime) {\n\t\t\t\t\t\t\t\tdata.mtime = file.share.stime\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdata.shares.push(file.share)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (recipient) {\n\t\t\t\t\t\t// limit counterparts for output\n\t\t\t\t\t\t\tif (data.recipientsCount < 4) {\n\t\t\t\t\t\t\t// only store the first ones, they will be the only ones\n\t\t\t\t\t\t\t// displayed\n\t\t\t\t\t\t\t\tdata.recipients[recipient] = true\n\t\t\t\t\t\t\t\tdata.recipientData[data.recipientsCount] = {\n\t\t\t\t\t\t\t\t\t'shareWith': recipientId,\n\t\t\t\t\t\t\t\t\t'shareWithDisplayName': recipient\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdata.recipientsCount++\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata.shareTypes[file.share.type] = true\n\n\t\t\t\t\t\tdelete file.share\n\t\t\t\t\t\treturn memo\n\t\t\t\t\t}, {})\n\t\t\t\t// Retrieve only the values of the returned hash\n\t\t\t\t\t.values()\n\t\t\t\t// Clean up\n\t\t\t\t\t.each(function(data) {\n\t\t\t\t\t// convert the recipients map to a flat\n\t\t\t\t\t// array of sorted names\n\t\t\t\t\t\tdata.mountType = 'shared'\n\t\t\t\t\t\tdelete data.recipientsCount\n\t\t\t\t\t\tif (sharedWithUser) {\n\t\t\t\t\t\t// only for outgoing shares\n\t\t\t\t\t\t\tdelete data.shareTypes\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdata.shareTypes = _.keys(data.shareTypes)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t// Finish the chain by getting the result\n\t\t\t\t\t.value()\n\n\t\t\t\t// Sort by expected sort comparator\n\t\t\t\treturn files.sort(this._sortComparator)\n\t\t\t}\n\t\t})\n\n\t/**\n\t * Share info attributes.\n\t *\n\t * @typedef {Object} OCA.Sharing.ShareInfo\n\t *\n\t * @property {number} id share ID\n\t * @property {number} type share type\n\t * @property {String} target share target, either user name or group name\n\t * @property {number} stime share timestamp in milliseconds\n\t * @property {String} [targetDisplayName] display name of the recipient\n\t * (only when shared with others)\n\t * @property {String} [targetShareWithId] id of the recipient\n\t *\n\t */\n\n\t/**\n\t * Recipient attributes\n\t *\n\t * @typedef {Object} OCA.Sharing.RecipientInfo\n\t * @property {String} shareWith the id of the recipient\n\t * @property {String} shareWithDisplayName the display name of the recipient\n\t */\n\n\t/**\n\t * Shared file info attributes.\n\t *\n\t * @typedef {OCA.Files.FileInfo} OCA.Sharing.SharedFileInfo\n\t *\n\t * @property {Array.} shares array of shares for\n\t * this file\n\t * @property {number} mtime most recent share time (if multiple shares)\n\t * @property {String} shareOwner name of the share owner\n\t * @property {Array.} recipients name of the first 4 recipients\n\t * (this is mostly for display purposes)\n\t * @property {Object.} recipientData (as object for easier\n\t * passing to HTML data attributes with jQuery)\n\t */\n\n\tOCA.Sharing.FileList = FileList\n})()\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }"],"names":["OCA","Sharing","App","_inFileList","_outFileList","_overviewFileList","_pendingFileList","initSharingIn","$el","this","FileList","id","sharedWithUser","fileActions","_createFileActions","config","Files","getFilesConfig","shown","_extendFileList","appName","t","find","html","initSharingOut","initSharingLinks","_linkFileList","linksOnly","initSharingDeleted","_deletedFileList","defaultFileActionsDisabled","showDeleted","_restoreShareAction","initSharingPening","showPending","detailsViewEnabled","_acceptShareAction","initShareingOverview","isOverview","removeSharingIn","$fileList","empty","removeSharingOut","removeSharingLinks","removeSharingDeleted","removeSharingPending","removeSharingOverview","destroy","off","_onActionsUpdated","_globalActionsInitialized","FileActions","registerDefaultActions","merge","_","bind","on","register","OC","PERMISSION_READ","filename","context","setActiveView","silent","fileList","changeDirectory","joinPaths","$file","attr","setDefault","registerAction","name","displayName","altText","mime","permissions","PERMISSION_ALL","iconClass","type","TYPE_INLINE","actionHandler","fileName","shareId","data","$","post","linkToOCS","success","result","remove","fileInfoModel","attributes","fail","Notification","showTemporary","shouldRender","parseInt","Share","SHARE_TYPE_REMOTE_GROUP","ajax","url","ev","each","list","action","defaultAction","fileSummary","window","addEventListener","e","target","options","initialize","prototype","extend","_sharedWithUser","_linksOnly","_showDeleted","_showPending","_clientSideSort","_allowSelection","_isOverview","apply","arguments","initialized","_renderRow","_createRow","fileData","$tr","before","children","pluck","shares","join","shareOwner","permission","PERMISSION_DELETE","remoteId","shareType","expirationTimestamp","expiration","moment","valueOf","formatted","text","modifiedColor","Math","round","Date","getTime","Util","formatDate","relativeModifiedDate","td","append","tooltip","placement","setSharedWithUser","state","updateEmptyContent","dir","getCurrentDirectory","toggleClass","isEmpty","addClass","getDirectoryPermissions","updateStorageStatistics","updateRow","fileInfo","reload","showMask","_reloadCall","abort","_setCurrentDir","promises","deletedShares","format","include_tags","beforeSend","xhr","setRequestHeader","pendingShares","pendingRemoteShares","shared_with_me","remoteShares","push","when","callBack","reloadCallback","then","additionalShares","hideMask","files","ocs","concat","_makeFilesFromShares","_makeFilesFromRemoteShares","setFiles","chain","map","share","file","owner","remote","replace","basename","mountpoint","mtime","mimetype","share_type","SHARE_TYPE_REMOTE","file_id","path","dirname","tags","remote_id","accepted","shareOwnerId","value","filter","SHARE_TYPE_LINK","file_source","icon","MimeType","getIconUrl","hasPreview","has_preview","item_type","share_with","stime","displayname_owner","uid_owner","file_target","extraData","targetDisplayName","share_with_displayname","targetShareWithId","reduce","memo","recipient","recipientId","recipients","recipientData","shareTypes","recipientsCount","values","mountType","keys","sort","_sortComparator","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","hasOwnProperty","call"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"files_sharing-files_sharing.js?v=4d839c79419ec5791332","mappings":"oCAUKA,IAAIC,UAIRD,IAAIC,QAAU,IAMfD,IAAIC,QAAQC,IAAM,CAEjBC,YAAa,KACbC,aAAc,KACdC,kBAAmB,KACnBC,iBAAkB,KAElBC,cAPiB,SAOHC,GACb,OAAIC,KAAKN,cAITM,KAAKN,YAAc,IAAIH,IAAI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hK,EAAKgK,WAAa7L,EAAEiM,KAAKpK,EAAKgK,eAI/BzB,QAGK1B,EAAMwD,KAAK/O,KAAKgP,oBA0C1BzP,IAAIC,QAAQS,SAAWA,ICjiBpBgP,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,IAOV,OAHAE,EAAoBL,GAAUI,EAAQA,EAAOD,QAASJ,GAG/CK,EAAOD,QCpBfJ,EAAoBO,EAAI,SAASF,GAChC,IAAIG,EAASH,GAAUA,EAAOI,WAC7B,WAAa,OAAOJ,EAAgB,SACpC,WAAa,OAAOA,GAErB,OADAL,EAAoBU,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRR,EAAoBU,EAAI,SAASN,EAASQ,GACzC,IAAI,IAAIC,KAAOD,EACXZ,EAAoBc,EAAEF,EAAYC,KAASb,EAAoBc,EAAEV,EAASS,IAC5EE,OAAOC,eAAeZ,EAASS,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3Eb,EAAoBc,EAAI,SAASK,EAAKC,GAAQ,OAAOL,OAAOzJ,UAAU+J,eAAeC,KAAKH,EAAKC,I","sources":["webpack:///nextcloud/apps/files_sharing/js/app.js","webpack:///nextcloud/apps/files_sharing/js/sharedfilelist.js","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand"],"sourcesContent":["/**\n * Copyright (c) 2014 Vincent Petry \n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\nif (!OCA.Sharing) {\n\t/**\n\t * @namespace OCA.Sharing\n\t */\n\tOCA.Sharing = {}\n}\n\n/**\n * @namespace\n */\nOCA.Sharing.App = {\n\n\t_inFileList: null,\n\t_outFileList: null,\n\t_overviewFileList: null,\n\t_pendingFileList: null,\n\n\tinitSharingIn($el) {\n\t\tif (this._inFileList) {\n\t\t\treturn this._inFileList\n\t\t}\n\n\t\tthis._inFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.self',\n\t\t\t\tsharedWithUser: true,\n\t\t\t\tfileActions: this._createFileActions(),\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._inFileList)\n\t\tthis._inFileList.appName = t('files_sharing', 'Shared with you')\n\t\tthis._inFileList.$el.find('#emptycontent').html('
'\n\t\t\t+ '

' + t('files_sharing', 'Nothing shared with you yet') + '

'\n\t\t\t+ '

' + t('files_sharing', 'Files and folders others share with you will show up here') + '

')\n\t\treturn this._inFileList\n\t},\n\n\tinitSharingOut($el) {\n\t\tif (this._outFileList) {\n\t\t\treturn this._outFileList\n\t\t}\n\t\tthis._outFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.others',\n\t\t\t\tsharedWithUser: false,\n\t\t\t\tfileActions: this._createFileActions(),\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._outFileList)\n\t\tthis._outFileList.appName = t('files_sharing', 'Shared with others')\n\t\tthis._outFileList.$el.find('#emptycontent').html('
'\n\t\t\t+ '

' + t('files_sharing', 'Nothing shared yet') + '

'\n\t\t\t+ '

' + t('files_sharing', 'Files and folders you share will show up here') + '

')\n\t\treturn this._outFileList\n\t},\n\n\tinitSharingLinks($el) {\n\t\tif (this._linkFileList) {\n\t\t\treturn this._linkFileList\n\t\t}\n\t\tthis._linkFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.link',\n\t\t\t\tlinksOnly: true,\n\t\t\t\tfileActions: this._createFileActions(),\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._linkFileList)\n\t\tthis._linkFileList.appName = t('files_sharing', 'Shared by link')\n\t\tthis._linkFileList.$el.find('#emptycontent').html('
'\n\t\t\t+ '

' + t('files_sharing', 'No shared links') + '

'\n\t\t\t+ '

' + t('files_sharing', 'Files and folders you share by link will show up here') + '

')\n\t\treturn this._linkFileList\n\t},\n\n\tinitSharingDeleted($el) {\n\t\tif (this._deletedFileList) {\n\t\t\treturn this._deletedFileList\n\t\t}\n\t\tthis._deletedFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.deleted',\n\t\t\t\tdefaultFileActionsDisabled: true,\n\t\t\t\tshowDeleted: true,\n\t\t\t\tsharedWithUser: true,\n\t\t\t\tfileActions: this._restoreShareAction(),\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._deletedFileList)\n\t\tthis._deletedFileList.appName = t('files_sharing', 'Deleted shares')\n\t\tthis._deletedFileList.$el.find('#emptycontent').html('
'\n\t\t\t+ '

' + t('files_sharing', 'No deleted shares') + '

'\n\t\t\t+ '

' + t('files_sharing', 'Shares you deleted will show up here') + '

')\n\t\treturn this._deletedFileList\n\t},\n\n\tinitSharingPening($el) {\n\t\tif (this._pendingFileList) {\n\t\t\treturn this._pendingFileList\n\t\t}\n\t\tthis._pendingFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.pending',\n\t\t\t\tshowPending: true,\n\t\t\t\tdetailsViewEnabled: false,\n\t\t\t\tdefaultFileActionsDisabled: true,\n\t\t\t\tsharedWithUser: true,\n\t\t\t\tfileActions: this._acceptShareAction(),\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._pendingFileList)\n\t\tthis._pendingFileList.appName = t('files_sharing', 'Pending shares')\n\t\tthis._pendingFileList.$el.find('#emptycontent').html('
'\n\t\t\t+ '

' + t('files_sharing', 'No pending shares') + '

'\n\t\t\t+ '

' + t('files_sharing', 'Shares you have received but not confirmed will show up here') + '

')\n\t\treturn this._pendingFileList\n\t},\n\n\tinitShareingOverview($el) {\n\t\tif (this._overviewFileList) {\n\t\t\treturn this._overviewFileList\n\t\t}\n\t\tthis._overviewFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.overview',\n\t\t\t\tfileActions: this._createFileActions(),\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\tisOverview: true,\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._overviewFileList)\n\t\tthis._overviewFileList.appName = t('files_sharing', 'Shares')\n\t\tthis._overviewFileList.$el.find('#emptycontent').html('
'\n\t\t\t+ '

' + t('files_sharing', 'No shares') + '

'\n\t\t\t+ '

' + t('files_sharing', 'Shares will show up here') + '

')\n\t\treturn this._overviewFileList\n\t},\n\n\tremoveSharingIn() {\n\t\tif (this._inFileList) {\n\t\t\tthis._inFileList.$fileList.empty()\n\t\t}\n\t},\n\n\tremoveSharingOut() {\n\t\tif (this._outFileList) {\n\t\t\tthis._outFileList.$fileList.empty()\n\t\t}\n\t},\n\n\tremoveSharingLinks() {\n\t\tif (this._linkFileList) {\n\t\t\tthis._linkFileList.$fileList.empty()\n\t\t}\n\t},\n\n\tremoveSharingDeleted() {\n\t\tif (this._deletedFileList) {\n\t\t\tthis._deletedFileList.$fileList.empty()\n\t\t}\n\t},\n\n\tremoveSharingPending() {\n\t\tif (this._pendingFileList) {\n\t\t\tthis._pendingFileList.$fileList.empty()\n\t\t}\n\t},\n\n\tremoveSharingOverview() {\n\t\tif (this._overviewFileList) {\n\t\t\tthis._overviewFileList.$fileList.empty()\n\t\t}\n\t},\n\n\t/**\n\t * Destroy the app\n\t */\n\tdestroy() {\n\t\tOCA.Files.fileActions.off('setDefault.app-sharing', this._onActionsUpdated)\n\t\tOCA.Files.fileActions.off('registerAction.app-sharing', this._onActionsUpdated)\n\t\tthis.removeSharingIn()\n\t\tthis.removeSharingOut()\n\t\tthis.removeSharingLinks()\n\t\tthis._inFileList = null\n\t\tthis._outFileList = null\n\t\tthis._linkFileList = null\n\t\tthis._overviewFileList = null\n\t\tdelete this._globalActionsInitialized\n\t},\n\n\t_createFileActions() {\n\t\t// inherit file actions from the files app\n\t\tconst fileActions = new OCA.Files.FileActions()\n\t\t// note: not merging the legacy actions because legacy apps are not\n\t\t// compatible with the sharing overview and need to be adapted first\n\t\tfileActions.registerDefaultActions()\n\t\tfileActions.merge(OCA.Files.fileActions)\n\n\t\tif (!this._globalActionsInitialized) {\n\t\t\t// in case actions are registered later\n\t\t\tthis._onActionsUpdated = _.bind(this._onActionsUpdated, this)\n\t\t\tOCA.Files.fileActions.on('setDefault.app-sharing', this._onActionsUpdated)\n\t\t\tOCA.Files.fileActions.on('registerAction.app-sharing', this._onActionsUpdated)\n\t\t\tthis._globalActionsInitialized = true\n\t\t}\n\n\t\t// when the user clicks on a folder, redirect to the corresponding\n\t\t// folder in the files app instead of opening it directly\n\t\tfileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function(filename, context) {\n\t\t\tOCA.Files.App.setActiveView('files', { silent: true })\n\t\t\tOCA.Files.App.fileList.changeDirectory(OC.joinPaths(context.$file.attr('data-path'), filename), true, true)\n\t\t})\n\t\tfileActions.setDefault('dir', 'Open')\n\t\treturn fileActions\n\t},\n\n\t_restoreShareAction() {\n\t\tconst fileActions = new OCA.Files.FileActions()\n\t\tfileActions.registerAction({\n\t\t\tname: 'Restore',\n\t\t\tdisplayName: t('files_sharing', 'Restore'),\n\t\t\taltText: t('files_sharing', 'Restore share'),\n\t\t\tmime: 'all',\n\t\t\tpermissions: OC.PERMISSION_ALL,\n\t\t\ticonClass: 'icon-history',\n\t\t\ttype: OCA.Files.FileActions.TYPE_INLINE,\n\t\t\tactionHandler(fileName, context) {\n\t\t\t\tconst shareId = context.$file.data('shareId')\n\t\t\t\t$.post(OC.linkToOCS('apps/files_sharing/api/v1/deletedshares', 2) + shareId)\n\t\t\t\t\t.success(function(result) {\n\t\t\t\t\t\tcontext.fileList.remove(context.fileInfoModel.attributes.name)\n\t\t\t\t\t}).fail(function() {\n\t\t\t\t\t\tOC.Notification.showTemporary(t('files_sharing', 'Something happened. Unable to restore the share.'))\n\t\t\t\t\t})\n\t\t\t},\n\t\t})\n\t\treturn fileActions\n\t},\n\n\t_acceptShareAction() {\n\t\tconst fileActions = new OCA.Files.FileActions()\n\t\tfileActions.registerAction({\n\t\t\tname: 'Accept share',\n\t\t\tdisplayName: t('files_sharing', 'Accept share'),\n\t\t\tmime: 'all',\n\t\t\tpermissions: OC.PERMISSION_ALL,\n\t\t\ticonClass: 'icon-checkmark',\n\t\t\ttype: OCA.Files.FileActions.TYPE_INLINE,\n\t\t\tactionHandler(fileName, context) {\n\t\t\t\tconst shareId = context.$file.data('shareId')\n\t\t\t\tlet shareBase = 'shares/pending'\n\t\t\t\tif (context.$file.attr('data-remote-id')) {\n\t\t\t\t\tshareBase = 'remote_shares/pending'\n\t\t\t\t}\n\t\t\t\t$.post(OC.linkToOCS('apps/files_sharing/api/v1/shares/pending', 2) + shareId)\n\t\t\t\t\t.success(function(result) {\n\t\t\t\t\t\tcontext.fileList.remove(context.fileInfoModel.attributes.name)\n\t\t\t\t\t}).fail(function() {\n\t\t\t\t\t\tOC.Notification.showTemporary(t('files_sharing', 'Something happened. Unable to accept the share.'))\n\t\t\t\t\t})\n\t\t\t},\n\t\t})\n\t\tfileActions.registerAction({\n\t\t\tname: 'Reject share',\n\t\t\tdisplayName: t('files_sharing', 'Reject share'),\n\t\t\tmime: 'all',\n\t\t\tpermissions: OC.PERMISSION_ALL,\n\t\t\ticonClass: 'icon-close',\n\t\t\ttype: OCA.Files.FileActions.TYPE_INLINE,\n\t\t\tshouldRender(context) {\n\t\t\t\t// disable rejecting group shares from the pending list because they anyway\n\t\t\t\t// land back into that same list\n\t\t\t\tif (context.$file.attr('data-remote-id') && parseInt(context.$file.attr('data-share-type'), 10) === OC.Share.SHARE_TYPE_REMOTE_GROUP) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t},\n\t\t\tactionHandler(fileName, context) {\n\t\t\t\tconst shareId = context.$file.data('shareId')\n\t\t\t\tlet shareBase = 'shares'\n\t\t\t\tif (context.$file.attr('data-remote-id')) {\n\t\t\t\t\tshareBase = 'remote_shares/pending'\n\t\t\t\t}\n\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1/shares', 2) + shareId,\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t}).success(function(result) {\n\t\t\t\t\tcontext.fileList.remove(context.fileInfoModel.attributes.name)\n\t\t\t\t}).fail(function() {\n\t\t\t\t\tOC.Notification.showTemporary(t('files_sharing', 'Something happened. Unable to reject the share.'))\n\t\t\t\t})\n\t\t\t},\n\t\t})\n\t\treturn fileActions\n\t},\n\n\t_onActionsUpdated(ev) {\n\t\t_.each([this._inFileList, this._outFileList, this._linkFileList], function(list) {\n\t\t\tif (!list) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (ev.action) {\n\t\t\t\tlist.fileActions.registerAction(ev.action)\n\t\t\t} else if (ev.defaultAction) {\n\t\t\t\tlist.fileActions.setDefault(\n\t\t\t\t\tev.defaultAction.mime,\n\t\t\t\t\tev.defaultAction.name\n\t\t\t\t)\n\t\t\t}\n\t\t})\n\t},\n\n\t_extendFileList(fileList) {\n\t\t// remove size column from summary\n\t\tfileList.fileSummary.$el.find('.filesize').remove()\n\t},\n}\n\nwindow.addEventListener('DOMContentLoaded', function() {\n\t$('#app-content-sharingin').on('show', function(e) {\n\t\tOCA.Sharing.App.initSharingIn($(e.target))\n\t})\n\t$('#app-content-sharingin').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingIn()\n\t})\n\t$('#app-content-sharingout').on('show', function(e) {\n\t\tOCA.Sharing.App.initSharingOut($(e.target))\n\t})\n\t$('#app-content-sharingout').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingOut()\n\t})\n\t$('#app-content-sharinglinks').on('show', function(e) {\n\t\tOCA.Sharing.App.initSharingLinks($(e.target))\n\t})\n\t$('#app-content-sharinglinks').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingLinks()\n\t})\n\t$('#app-content-deletedshares').on('show', function(e) {\n\t\tOCA.Sharing.App.initSharingDeleted($(e.target))\n\t})\n\t$('#app-content-deletedshares').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingDeleted()\n\t})\n\t$('#app-content-pendingshares').on('show', function(e) {\n\t\tOCA.Sharing.App.initSharingPening($(e.target))\n\t})\n\t$('#app-content-pendingshares').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingPending()\n\t})\n\t$('#app-content-shareoverview').on('show', function(e) {\n\t\tOCA.Sharing.App.initShareingOverview($(e.target))\n\t})\n\t$('#app-content-shareoverview').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingOverview()\n\t})\n})\n","/* eslint-disable */\n/*\n * Copyright (c) 2014 Vincent Petry \n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n(function() {\n\n\t/**\n\t * @class OCA.Sharing.FileList\n\t * @augments OCA.Files.FileList\n\t *\n\t * @classdesc Sharing file list.\n\t * Contains both \"shared with others\" and \"shared with you\" modes.\n\t *\n\t * @param $el container element with existing markup for the #controls\n\t * and a table\n\t * @param [options] map of options, see other parameters\n\t * @param {boolean} [options.sharedWithUser] true to return files shared with\n\t * the current user, false to return files that the user shared with others.\n\t * Defaults to false.\n\t * @param {boolean} [options.linksOnly] true to return only link shares\n\t */\n\tvar FileList = function($el, options) {\n\t\tthis.initialize($el, options)\n\t}\n\tFileList.prototype = _.extend({}, OCA.Files.FileList.prototype,\n\t\t/** @lends OCA.Sharing.FileList.prototype */ {\n\t\t\tappName: 'Shares',\n\n\t\t\t/**\n\t\t * Whether the list shows the files shared with the user (true) or\n\t\t * the files that the user shared with others (false).\n\t\t */\n\t\t\t_sharedWithUser: false,\n\t\t\t_linksOnly: false,\n\t\t\t_showDeleted: false,\n\t\t\t_showPending: false,\n\t\t\t_clientSideSort: true,\n\t\t\t_allowSelection: false,\n\t\t\t_isOverview: false,\n\n\t\t\t/**\n\t\t * @private\n\t\t */\n\t\t\tinitialize: function($el, options) {\n\t\t\t\tOCA.Files.FileList.prototype.initialize.apply(this, arguments)\n\t\t\t\tif (this.initialized) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// TODO: consolidate both options\n\t\t\t\tif (options && options.sharedWithUser) {\n\t\t\t\t\tthis._sharedWithUser = true\n\t\t\t\t}\n\t\t\t\tif (options && options.linksOnly) {\n\t\t\t\t\tthis._linksOnly = true\n\t\t\t\t}\n\t\t\t\tif (options && options.showDeleted) {\n\t\t\t\t\tthis._showDeleted = true\n\t\t\t\t}\n\t\t\t\tif (options && options.showPending) {\n\t\t\t\t\tthis._showPending = true\n\t\t\t\t}\n\t\t\t\tif (options && options.isOverview) {\n\t\t\t\t\tthis._isOverview = true\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t_renderRow: function() {\n\t\t\t// HACK: needed to call the overridden _renderRow\n\t\t\t// this is because at the time this class is created\n\t\t\t// the overriding hasn't been done yet...\n\t\t\t\treturn OCA.Files.FileList.prototype._renderRow.apply(this, arguments)\n\t\t\t},\n\n\t\t\t_createRow: function(fileData) {\n\t\t\t// TODO: hook earlier and render the whole row here\n\t\t\t\tvar $tr = OCA.Files.FileList.prototype._createRow.apply(this, arguments)\n\t\t\t\t$tr.find('.filesize').remove()\n\t\t\t\t$tr.find('td.date').before($tr.children('td:first'))\n\t\t\t\t$tr.find('td.filename input:checkbox').remove()\n\t\t\t\t$tr.attr('data-share-id', _.pluck(fileData.shares, 'id').join(','))\n\t\t\t\tif (this._sharedWithUser) {\n\t\t\t\t\t$tr.attr('data-share-owner', fileData.shareOwner)\n\t\t\t\t\t$tr.attr('data-mounttype', 'shared-root')\n\t\t\t\t\tvar permission = parseInt($tr.attr('data-permissions')) | OC.PERMISSION_DELETE\n\t\t\t\t\t$tr.attr('data-permissions', permission)\n\t\t\t\t}\n\t\t\t\tif (this._showDeleted || this._showPending) {\n\t\t\t\t\tvar permission = fileData.permissions\n\t\t\t\t\t$tr.attr('data-share-permissions', permission)\n\t\t\t\t}\n\n\t\t\t\tif (fileData.remoteId) {\n\t\t\t\t\t$tr.attr('data-remote-id', fileData.remoteId)\n\t\t\t\t}\n\n\t\t\t\tif (fileData.shareType) {\n\t\t\t\t\t$tr.attr('data-share-type', fileData.shareType)\n\t\t\t\t}\n\n\t\t\t\t// add row with expiration date for link only shares - influenced by _createRow of filelist\n\t\t\t\tif (this._linksOnly) {\n\t\t\t\t\tvar expirationTimestamp = 0\n\t\t\t\t\tif (fileData.shares && fileData.shares[0].expiration !== null) {\n\t\t\t\t\t\texpirationTimestamp = moment(fileData.shares[0].expiration).valueOf()\n\t\t\t\t\t}\n\t\t\t\t\t$tr.attr('data-expiration', expirationTimestamp)\n\n\t\t\t\t\t// date column (1000 milliseconds to seconds, 60 seconds, 60 minutes, 24 hours)\n\t\t\t\t\t// difference in days multiplied by 5 - brightest shade for expiry dates in more than 32 days (160/5)\n\t\t\t\t\tvar modifiedColor = Math.round((expirationTimestamp - (new Date()).getTime()) / 1000 / 60 / 60 / 24 * 5)\n\t\t\t\t\t// ensure that the brightest color is still readable\n\t\t\t\t\tif (modifiedColor >= 160) {\n\t\t\t\t\t\tmodifiedColor = 160\n\t\t\t\t\t}\n\n\t\t\t\t\tvar formatted\n\t\t\t\t\tvar text\n\t\t\t\t\tif (expirationTimestamp > 0) {\n\t\t\t\t\t\tformatted = OC.Util.formatDate(expirationTimestamp)\n\t\t\t\t\t\ttext = OC.Util.relativeModifiedDate(expirationTimestamp)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tformatted = t('files_sharing', 'No expiration date set')\n\t\t\t\t\t\ttext = ''\n\t\t\t\t\t\tmodifiedColor = 160\n\t\t\t\t\t}\n\t\t\t\t\ttd = $('').attr({ 'class': 'date' })\n\t\t\t\t\ttd.append($('').attr({\n\t\t\t\t\t\t'class': 'modified',\n\t\t\t\t\t\t'title': formatted,\n\t\t\t\t\t\t'style': 'color:rgb(' + modifiedColor + ',' + modifiedColor + ',' + modifiedColor + ')'\n\t\t\t\t\t}).text(text)\n\t\t\t\t\t\t.tooltip({ placement: 'top' })\n\t\t\t\t\t)\n\n\t\t\t\t\t$tr.append(td)\n\t\t\t\t}\n\t\t\t\treturn $tr\n\t\t\t},\n\n\t\t\t/**\n\t\t * Set whether the list should contain outgoing shares\n\t\t * or incoming shares.\n\t\t *\n\t\t * @param state true for incoming shares, false otherwise\n\t\t */\n\t\t\tsetSharedWithUser: function(state) {\n\t\t\t\tthis._sharedWithUser = !!state\n\t\t\t},\n\n\t\t\tupdateEmptyContent: function() {\n\t\t\t\tvar dir = this.getCurrentDirectory()\n\t\t\t\tif (dir === '/') {\n\t\t\t\t// root has special permissions\n\t\t\t\t\tthis.$el.find('#emptycontent').toggleClass('hidden', !this.isEmpty)\n\t\t\t\t\tthis.$el.find('#filestable thead th').toggleClass('hidden', this.isEmpty)\n\n\t\t\t\t\t// hide expiration date header for non link only shares\n\t\t\t\t\tif (!this._linksOnly) {\n\t\t\t\t\t\tthis.$el.find('th.column-expiration').addClass('hidden')\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tOCA.Files.FileList.prototype.updateEmptyContent.apply(this, arguments)\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tgetDirectoryPermissions: function() {\n\t\t\t\treturn OC.PERMISSION_READ | OC.PERMISSION_DELETE\n\t\t\t},\n\n\t\t\tupdateStorageStatistics: function() {\n\t\t\t// no op because it doesn't have\n\t\t\t// storage info like free space / used space\n\t\t\t},\n\n\t\t\tupdateRow: function($tr, fileInfo, options) {\n\t\t\t// no-op, suppress re-rendering\n\t\t\t\treturn $tr\n\t\t\t},\n\n\t\t\treload: function() {\n\t\t\t\tthis.showMask()\n\t\t\t\tif (this._reloadCall) {\n\t\t\t\t\tthis._reloadCall.abort()\n\t\t\t\t}\n\n\t\t\t\t// there is only root\n\t\t\t\tthis._setCurrentDir('/', false)\n\n\t\t\t\tvar promises = []\n\n\t\t\t\tvar deletedShares = {\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1', 2) + 'deletedshares',\n\t\t\t\t\t/* jshint camelcase: false */\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tformat: 'json',\n\t\t\t\t\t\tinclude_tags: true\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tbeforeSend: function(xhr) {\n\t\t\t\t\t\txhr.setRequestHeader('OCS-APIREQUEST', 'true')\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar pendingShares = {\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1/shares', 2) + 'pending',\n\t\t\t\t\t/* jshint camelcase: false */\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tformat: 'json'\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tbeforeSend: function(xhr) {\n\t\t\t\t\t\txhr.setRequestHeader('OCS-APIREQUEST', 'true')\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar pendingRemoteShares = {\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1/remote_shares', 2) + 'pending',\n\t\t\t\t\t/* jshint camelcase: false */\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tformat: 'json'\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tbeforeSend: function(xhr) {\n\t\t\t\t\t\txhr.setRequestHeader('OCS-APIREQUEST', 'true')\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar shares = {\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1') + 'shares',\n\t\t\t\t\t/* jshint camelcase: false */\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tformat: 'json',\n\t\t\t\t\t\tshared_with_me: this._sharedWithUser !== false,\n\t\t\t\t\t\tinclude_tags: true\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tbeforeSend: function(xhr) {\n\t\t\t\t\t\txhr.setRequestHeader('OCS-APIREQUEST', 'true')\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar remoteShares = {\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1') + 'remote_shares',\n\t\t\t\t\t/* jshint camelcase: false */\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tformat: 'json',\n\t\t\t\t\t\tinclude_tags: true\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tbeforeSend: function(xhr) {\n\t\t\t\t\t\txhr.setRequestHeader('OCS-APIREQUEST', 'true')\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Add the proper ajax requests to the list and run them\n\t\t\t\t// and make sure we have 2 promises\n\t\t\t\tif (this._showDeleted) {\n\t\t\t\t\tpromises.push($.ajax(deletedShares))\n\t\t\t\t} else if (this._showPending) {\n\t\t\t\t\tpromises.push($.ajax(pendingShares))\n\t\t\t\t\tpromises.push($.ajax(pendingRemoteShares))\n\t\t\t\t} else {\n\t\t\t\t\tpromises.push($.ajax(shares))\n\n\t\t\t\t\tif (this._sharedWithUser !== false || this._isOverview) {\n\t\t\t\t\t\tpromises.push($.ajax(remoteShares))\n\t\t\t\t\t}\n\t\t\t\t\tif (this._isOverview) {\n\t\t\t\t\t\tshares.data.shared_with_me = !shares.data.shared_with_me\n\t\t\t\t\t\tpromises.push($.ajax(shares))\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._reloadCall = $.when.apply($, promises)\n\t\t\t\tvar callBack = this.reloadCallback.bind(this)\n\t\t\t\treturn this._reloadCall.then(callBack, callBack)\n\t\t\t},\n\n\t\t\treloadCallback: function(shares, remoteShares, additionalShares) {\n\t\t\t\tdelete this._reloadCall\n\t\t\t\tthis.hideMask()\n\n\t\t\t\tthis.$el.find('#headerSharedWith').text(\n\t\t\t\t\tt('files_sharing', this._sharedWithUser ? 'Shared by' : 'Shared with')\n\t\t\t\t)\n\n\t\t\t\tvar files = []\n\n\t\t\t\t// make sure to use the same format\n\t\t\t\tif (shares[0] && shares[0].ocs) {\n\t\t\t\t\tshares = shares[0]\n\t\t\t\t}\n\t\t\t\tif (remoteShares && remoteShares[0] && remoteShares[0].ocs) {\n\t\t\t\t\tremoteShares = remoteShares[0]\n\t\t\t\t}\n\t\t\t\tif (additionalShares && additionalShares[0] && additionalShares[0].ocs) {\n\t\t\t\t\tadditionalShares = additionalShares[0]\n\t\t\t\t}\n\n\t\t\t\tif (shares.ocs && shares.ocs.data) {\n\t\t\t\t\tfiles = files.concat(this._makeFilesFromShares(shares.ocs.data, this._sharedWithUser))\n\t\t\t\t}\n\n\t\t\t\tif (remoteShares && remoteShares.ocs && remoteShares.ocs.data) {\n\t\t\t\t\tfiles = files.concat(this._makeFilesFromRemoteShares(remoteShares.ocs.data))\n\t\t\t\t}\n\n\t\t\t\tif (additionalShares && additionalShares.ocs && additionalShares.ocs.data) {\n\t\t\t\t\tif (this._showPending) {\n\t\t\t\t\t\t// in this case the second callback is about pending remote shares\n\t\t\t\t\t\tfiles = files.concat(this._makeFilesFromRemoteShares(additionalShares.ocs.data))\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfiles = files.concat(this._makeFilesFromShares(additionalShares.ocs.data, !this._sharedWithUser))\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.setFiles(files)\n\t\t\t\treturn true\n\t\t\t},\n\n\t\t\t_makeFilesFromRemoteShares: function(data) {\n\t\t\t\tvar files = data\n\n\t\t\t\tfiles = _.chain(files)\n\t\t\t\t// convert share data to file data\n\t\t\t\t\t.map(function(share) {\n\t\t\t\t\t\tvar file = {\n\t\t\t\t\t\t\tshareOwner: share.owner + '@' + share.remote.replace(/.*?:\\/\\//g, ''),\n\t\t\t\t\t\t\tname: OC.basename(share.mountpoint),\n\t\t\t\t\t\t\tmtime: share.mtime * 1000,\n\t\t\t\t\t\t\tmimetype: share.mimetype,\n\t\t\t\t\t\t\ttype: share.type,\n\t\t\t\t\t\t\t// remote share types are different and need to be mapped\n\t\t\t\t\t\t\tshareType: (parseInt(share.share_type, 10) === 1) ? OC.Share.SHARE_TYPE_REMOTE_GROUP : OC.Share.SHARE_TYPE_REMOTE,\n\t\t\t\t\t\t\tid: share.file_id,\n\t\t\t\t\t\t\tpath: OC.dirname(share.mountpoint),\n\t\t\t\t\t\t\tpermissions: share.permissions,\n\t\t\t\t\t\t\ttags: share.tags || []\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (share.remote_id) {\n\t\t\t\t\t\t\t// remote share\n\t\t\t\t\t\t\tif (share.accepted !== '1') {\n\t\t\t\t\t\t\t\tfile.name = OC.basename(share.name)\n\t\t\t\t\t\t\t\tfile.path = '/'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfile.remoteId = share.remote_id\n\t\t\t\t\t\t\tfile.shareOwnerId = share.owner\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!file.mimetype) {\n\t\t\t\t\t\t\t// pending shares usually have no type, so default to showing a directory icon\n\t\t\t\t\t\t\tfile.mimetype = 'dir-shared'\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfile.shares = [{\n\t\t\t\t\t\t\tid: share.id,\n\t\t\t\t\t\t\ttype: OC.Share.SHARE_TYPE_REMOTE\n\t\t\t\t\t\t}]\n\t\t\t\t\t\treturn file\n\t\t\t\t\t})\n\t\t\t\t\t.value()\n\t\t\t\treturn files\n\t\t\t},\n\n\t\t\t/**\n\t\t * Converts the OCS API share response data to a file info\n\t\t * list\n\t\t * @param {Array} data OCS API share array\n\t\t * @param {boolean} sharedWithUser\n\t\t * @returns {Array.} array of shared file info\n\t\t */\n\t\t\t_makeFilesFromShares: function(data, sharedWithUser) {\n\t\t\t/* jshint camelcase: false */\n\t\t\t\tvar files = data\n\n\t\t\t\tif (this._linksOnly) {\n\t\t\t\t\tfiles = _.filter(data, function(share) {\n\t\t\t\t\t\treturn share.share_type === OC.Share.SHARE_TYPE_LINK\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\t// OCS API uses non-camelcased names\n\t\t\t\tfiles = _.chain(files)\n\t\t\t\t// convert share data to file data\n\t\t\t\t\t.map(function(share) {\n\t\t\t\t\t// TODO: use OC.Files.FileInfo\n\t\t\t\t\t\tvar file = {\n\t\t\t\t\t\t\tid: share.file_source,\n\t\t\t\t\t\t\ticon: OC.MimeType.getIconUrl(share.mimetype),\n\t\t\t\t\t\t\tmimetype: share.mimetype,\n\t\t\t\t\t\t\thasPreview: share.has_preview,\n\t\t\t\t\t\t\ttags: share.tags || []\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (share.item_type === 'folder') {\n\t\t\t\t\t\t\tfile.type = 'dir'\n\t\t\t\t\t\t\tfile.mimetype = 'httpd/unix-directory'\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfile.type = 'file'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfile.share = {\n\t\t\t\t\t\t\tid: share.id,\n\t\t\t\t\t\t\ttype: share.share_type,\n\t\t\t\t\t\t\ttarget: share.share_with,\n\t\t\t\t\t\t\tstime: share.stime * 1000,\n\t\t\t\t\t\t\texpiration: share.expiration\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (sharedWithUser) {\n\t\t\t\t\t\t\tfile.shareOwner = share.displayname_owner\n\t\t\t\t\t\t\tfile.shareOwnerId = share.uid_owner\n\t\t\t\t\t\t\tfile.name = OC.basename(share.file_target)\n\t\t\t\t\t\t\tfile.path = OC.dirname(share.file_target)\n\t\t\t\t\t\t\tfile.permissions = share.permissions\n\t\t\t\t\t\t\tif (file.path) {\n\t\t\t\t\t\t\t\tfile.extraData = share.file_target\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (share.share_type !== OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\t\t\t\tfile.share.targetDisplayName = share.share_with_displayname\n\t\t\t\t\t\t\t\tfile.share.targetShareWithId = share.share_with\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfile.name = OC.basename(share.path)\n\t\t\t\t\t\t\tfile.path = OC.dirname(share.path)\n\t\t\t\t\t\t\tfile.permissions = OC.PERMISSION_ALL\n\t\t\t\t\t\t\tif (file.path) {\n\t\t\t\t\t\t\t\tfile.extraData = share.path\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn file\n\t\t\t\t\t})\n\t\t\t\t// Group all files and have a \"shares\" array with\n\t\t\t\t// the share info for each file.\n\t\t\t\t//\n\t\t\t\t// This uses a hash memo to cumulate share information\n\t\t\t\t// inside the same file object (by file id).\n\t\t\t\t\t.reduce(function(memo, file) {\n\t\t\t\t\t\tvar data = memo[file.id]\n\t\t\t\t\t\tvar recipient = file.share.targetDisplayName\n\t\t\t\t\t\tvar recipientId = file.share.targetShareWithId\n\t\t\t\t\t\tif (!data) {\n\t\t\t\t\t\t\tdata = memo[file.id] = file\n\t\t\t\t\t\t\tdata.shares = [file.share]\n\t\t\t\t\t\t\t// using a hash to make them unique,\n\t\t\t\t\t\t\t// this is only a list to be displayed\n\t\t\t\t\t\t\tdata.recipients = {}\n\t\t\t\t\t\t\tdata.recipientData = {}\n\t\t\t\t\t\t\t// share types\n\t\t\t\t\t\t\tdata.shareTypes = {}\n\t\t\t\t\t\t\t// counter is cheaper than calling _.keys().length\n\t\t\t\t\t\t\tdata.recipientsCount = 0\n\t\t\t\t\t\t\tdata.mtime = file.share.stime\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t// always take the most recent stime\n\t\t\t\t\t\t\tif (file.share.stime > data.mtime) {\n\t\t\t\t\t\t\t\tdata.mtime = file.share.stime\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdata.shares.push(file.share)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (recipient) {\n\t\t\t\t\t\t// limit counterparts for output\n\t\t\t\t\t\t\tif (data.recipientsCount < 4) {\n\t\t\t\t\t\t\t// only store the first ones, they will be the only ones\n\t\t\t\t\t\t\t// displayed\n\t\t\t\t\t\t\t\tdata.recipients[recipient] = true\n\t\t\t\t\t\t\t\tdata.recipientData[data.recipientsCount] = {\n\t\t\t\t\t\t\t\t\t'shareWith': recipientId,\n\t\t\t\t\t\t\t\t\t'shareWithDisplayName': recipient\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdata.recipientsCount++\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata.shareTypes[file.share.type] = true\n\n\t\t\t\t\t\tdelete file.share\n\t\t\t\t\t\treturn memo\n\t\t\t\t\t}, {})\n\t\t\t\t// Retrieve only the values of the returned hash\n\t\t\t\t\t.values()\n\t\t\t\t// Clean up\n\t\t\t\t\t.each(function(data) {\n\t\t\t\t\t// convert the recipients map to a flat\n\t\t\t\t\t// array of sorted names\n\t\t\t\t\t\tdata.mountType = 'shared'\n\t\t\t\t\t\tdelete data.recipientsCount\n\t\t\t\t\t\tif (sharedWithUser) {\n\t\t\t\t\t\t// only for outgoing shares\n\t\t\t\t\t\t\tdelete data.shareTypes\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdata.shareTypes = _.keys(data.shareTypes)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t// Finish the chain by getting the result\n\t\t\t\t\t.value()\n\n\t\t\t\t// Sort by expected sort comparator\n\t\t\t\treturn files.sort(this._sortComparator)\n\t\t\t}\n\t\t})\n\n\t/**\n\t * Share info attributes.\n\t *\n\t * @typedef {Object} OCA.Sharing.ShareInfo\n\t *\n\t * @property {number} id share ID\n\t * @property {number} type share type\n\t * @property {String} target share target, either user name or group name\n\t * @property {number} stime share timestamp in milliseconds\n\t * @property {String} [targetDisplayName] display name of the recipient\n\t * (only when shared with others)\n\t * @property {String} [targetShareWithId] id of the recipient\n\t *\n\t */\n\n\t/**\n\t * Recipient attributes\n\t *\n\t * @typedef {Object} OCA.Sharing.RecipientInfo\n\t * @property {String} shareWith the id of the recipient\n\t * @property {String} shareWithDisplayName the display name of the recipient\n\t */\n\n\t/**\n\t * Shared file info attributes.\n\t *\n\t * @typedef {OCA.Files.FileInfo} OCA.Sharing.SharedFileInfo\n\t *\n\t * @property {Array.} shares array of shares for\n\t * this file\n\t * @property {number} mtime most recent share time (if multiple shares)\n\t * @property {String} shareOwner name of the share owner\n\t * @property {Array.} recipients name of the first 4 recipients\n\t * (this is mostly for display purposes)\n\t * @property {Object.} recipientData (as object for easier\n\t * passing to HTML data attributes with jQuery)\n\t */\n\n\tOCA.Sharing.FileList = FileList\n})()\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }"],"names":["OCA","Sharing","App","_inFileList","_outFileList","_overviewFileList","_pendingFileList","initSharingIn","$el","this","FileList","id","sharedWithUser","fileActions","_createFileActions","config","Files","getFilesConfig","shown","_extendFileList","appName","t","find","html","initSharingOut","initSharingLinks","_linkFileList","linksOnly","initSharingDeleted","_deletedFileList","defaultFileActionsDisabled","showDeleted","_restoreShareAction","initSharingPening","showPending","detailsViewEnabled","_acceptShareAction","initShareingOverview","isOverview","removeSharingIn","$fileList","empty","removeSharingOut","removeSharingLinks","removeSharingDeleted","removeSharingPending","removeSharingOverview","destroy","off","_onActionsUpdated","_globalActionsInitialized","FileActions","registerDefaultActions","merge","_","bind","on","register","OC","PERMISSION_READ","filename","context","setActiveView","silent","fileList","changeDirectory","joinPaths","$file","attr","setDefault","registerAction","name","displayName","altText","mime","permissions","PERMISSION_ALL","iconClass","type","TYPE_INLINE","actionHandler","fileName","shareId","data","$","post","linkToOCS","success","result","remove","fileInfoModel","attributes","fail","Notification","showTemporary","shouldRender","parseInt","Share","SHARE_TYPE_REMOTE_GROUP","ajax","url","ev","each","list","action","defaultAction","fileSummary","window","addEventListener","e","target","options","initialize","prototype","extend","_sharedWithUser","_linksOnly","_showDeleted","_showPending","_clientSideSort","_allowSelection","_isOverview","apply","arguments","initialized","_renderRow","_createRow","fileData","$tr","before","children","pluck","shares","join","shareOwner","permission","PERMISSION_DELETE","remoteId","shareType","expirationTimestamp","expiration","moment","valueOf","formatted","text","modifiedColor","Math","round","Date","getTime","Util","formatDate","relativeModifiedDate","td","append","tooltip","placement","setSharedWithUser","state","updateEmptyContent","dir","getCurrentDirectory","toggleClass","isEmpty","addClass","getDirectoryPermissions","updateStorageStatistics","updateRow","fileInfo","reload","showMask","_reloadCall","abort","_setCurrentDir","promises","deletedShares","format","include_tags","beforeSend","xhr","setRequestHeader","pendingShares","pendingRemoteShares","shared_with_me","remoteShares","push","when","callBack","reloadCallback","then","additionalShares","hideMask","files","ocs","concat","_makeFilesFromShares","_makeFilesFromRemoteShares","setFiles","chain","map","share","file","owner","remote","replace","basename","mountpoint","mtime","mimetype","share_type","SHARE_TYPE_REMOTE","file_id","path","dirname","tags","remote_id","accepted","shareOwnerId","value","filter","SHARE_TYPE_LINK","file_source","icon","MimeType","getIconUrl","hasPreview","has_preview","item_type","share_with","stime","displayname_owner","uid_owner","file_target","extraData","targetDisplayName","share_with_displayname","targetShareWithId","reduce","memo","recipient","recipientId","recipients","recipientData","shareTypes","recipientsCount","values","mountType","keys","sort","_sortComparator","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","hasOwnProperty","call"],"sourceRoot":""} \ No newline at end of file