Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php4
-rw-r--r--apps/files/js/fileactions.js8
-rw-r--r--apps/files/js/gotoplugin.js5
-rw-r--r--apps/files_sharing/js/app.js23
-rw-r--r--apps/files_sharing/js/dist/additionalScripts.js2
-rw-r--r--apps/files_sharing/js/dist/additionalScripts.js.map2
-rw-r--r--apps/files_sharing/js/dist/files_sharing.js2
-rw-r--r--apps/files_sharing/js/dist/files_sharing.js.map2
-rw-r--r--apps/files_sharing/js/sharedfilelist.js45
-rw-r--r--apps/files_sharing/lib/AppInfo/Application.php4
-rw-r--r--apps/files_sharing/lib/External/Manager.php318
-rw-r--r--apps/files_sharing/lib/Hooks.php4
-rw-r--r--apps/files_sharing/lib/Listener/UserAddedToGroupListener.php2
-rw-r--r--apps/files_sharing/src/share.js6
-rw-r--r--apps/files_sharing/tests/External/ManagerTest.php565
-rw-r--r--core/Controller/UnifiedSearchController.php18
-rw-r--r--lib/private/URLGenerator.php7
-rw-r--r--lib/private/legacy/OC_Image.php20
-rw-r--r--lib/public/IURLGenerator.php6
-rw-r--r--tests/lib/UrlGeneratorTest.php6
20 files changed, 866 insertions, 183 deletions
diff --git a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php
index 26b0288c354..fdde3d98e33 100644
--- a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php
+++ b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php
@@ -60,6 +60,7 @@ use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IManager;
use OCP\Share\IShare;
use OCP\Util;
+use Psr\Log\LoggerInterface;
class CloudFederationProviderFiles implements ICloudFederationProvider {
@@ -251,7 +252,8 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
\OC::$server->getGroupManager(),
\OC::$server->getUserManager(),
$shareWith,
- \OC::$server->query(IEventDispatcher::class)
+ \OC::$server->query(IEventDispatcher::class),
+ \OC::$server->get(LoggerInterface::class)
);
try {
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index c7883e4d2a6..5d9e8578e19 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -155,6 +155,9 @@
if (_.isFunction(action.render)) {
actionSpec.render = action.render;
}
+ if (_.isFunction(action.shouldRender)) {
+ actionSpec.shouldRender = action.shouldRender;
+ }
if (!this.actions[mime]) {
this.actions[mime] = {};
}
@@ -397,6 +400,11 @@
* @param {OCA.Files.FileActionContext} context rendering context
*/
_renderInlineAction: function(actionSpec, isDefault, context) {
+ if (actionSpec.shouldRender) {
+ if (!actionSpec.shouldRender(context)) {
+ return;
+ }
+ }
var renderFunc = actionSpec.render || _.bind(this._defaultRenderAction, this);
var $actionEl = renderFunc(actionSpec, isDefault, context);
if (!$actionEl || !$actionEl.length) {
diff --git a/apps/files/js/gotoplugin.js b/apps/files/js/gotoplugin.js
index 4793420ed2d..d686c7850cf 100644
--- a/apps/files/js/gotoplugin.js
+++ b/apps/files/js/gotoplugin.js
@@ -29,6 +29,11 @@
if (this.disallowedLists.indexOf(fileList.id) !== -1) {
return;
}
+ // lists where the "Open" default action is disabled should
+ // also have the goto action disabled
+ if (fileList._defaultFileActionsDisabled) {
+ return
+ }
var fileActions = fileList.fileActions;
fileActions.registerAction({
diff --git a/apps/files_sharing/js/app.js b/apps/files_sharing/js/app.js
index 713560e556b..89f72ee8209 100644
--- a/apps/files_sharing/js/app.js
+++ b/apps/files_sharing/js/app.js
@@ -141,6 +141,8 @@ OCA.Sharing.App = {
{
id: 'shares.pending',
showPending: true,
+ detailsViewEnabled: false,
+ defaultFileActionsDisabled: true,
sharedWithUser: true,
fileActions: this._acceptShareAction(),
config: OCA.Files.App.getFilesConfig(),
@@ -296,7 +298,11 @@ OCA.Sharing.App = {
type: OCA.Files.FileActions.TYPE_INLINE,
actionHandler(fileName, context) {
const shareId = context.$file.data('shareId')
- $.post(OC.linkToOCS('apps/files_sharing/api/v1/shares/pending', 2) + shareId)
+ let shareBase = 'shares/pending'
+ if (context.$file.attr('data-remote-id')) {
+ shareBase = 'remote_shares/pending'
+ }
+ $.post(OC.linkToOCS('apps/files_sharing/api/v1/' + shareBase, 2) + shareId)
.success(function(result) {
context.fileList.remove(context.fileInfoModel.attributes.name)
}).fail(function() {
@@ -311,10 +317,23 @@ OCA.Sharing.App = {
permissions: OC.PERMISSION_ALL,
iconClass: 'icon-close',
type: OCA.Files.FileActions.TYPE_INLINE,
+ shouldRender(context) {
+ // disable rejecting group shares from the pending list because they anyway
+ // land back into that same list
+ if (context.$file.attr('data-remote-id') && parseInt(context.$file.attr('data-share-type'), 10) === OC.Share.SHARE_TYPE_REMOTE_GROUP) {
+ return false
+ }
+ return true
+ },
actionHandler(fileName, context) {
const shareId = context.$file.data('shareId')
+ let shareBase = 'shares'
+ if (context.$file.attr('data-remote-id')) {
+ shareBase = 'remote_shares/pending'
+ }
+
$.ajax({
- url: OC.linkToOCS('apps/files_sharing/api/v1/shares', 2) + shareId,
+ url: OC.linkToOCS('apps/files_sharing/api/v1/' + shareBase, 2) + shareId,
type: 'DELETE',
}).success(function(result) {
context.fileList.remove(context.fileInfoModel.attributes.name)
diff --git a/apps/files_sharing/js/dist/additionalScripts.js b/apps/files_sharing/js/dist/additionalScripts.js
index f65bd025fb1..cdbc3f5b3b1 100644
--- a/apps/files_sharing/js/dist/additionalScripts.js
+++ b/apps/files_sharing/js/dist/additionalScripts.js
@@ -52,7 +52,7 @@ n.p=OC.linkTo("files_sharing","js/dist/"),n.nc=btoa(OC.requestToken),window.OCP.
* Copyright(c) 2015 Andreas Lubbe
* Copyright(c) 2015 Tiancheng "Timothy" Gu
* MIT Licensed
- */var n=/["'&<>]/;e.exports=function(e){var t,r=""+e,a=n.exec(r);if(!a)return r;var i="",s=0,o=0;for(s=a.index;s<r.length;s++){switch(r.charCodeAt(s)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#39;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}o!==s&&(i+=r.substring(o,s)),o=s+1,i+=t}return o!==s?i+r.substring(o,s):i}},473:function(e,r,n){"use strict";n.r(r);var a=n(35),i=n.n(a);_.extend(OC.Files.Client,{PROPERTY_SHARE_TYPES:"{"+OC.Files.Client.NS_OWNCLOUD+"}share-types",PROPERTY_OWNER_ID:"{"+OC.Files.Client.NS_OWNCLOUD+"}owner-id",PROPERTY_OWNER_DISPLAY_NAME:"{"+OC.Files.Client.NS_OWNCLOUD+"}owner-display-name"}),OCA.Sharing||(OCA.Sharing={}),OCA.Sharing.Util={_REMOTE_OWNER_REGEXP:new RegExp("^(([^@]*)@(([^@^/\\s]*)@)?)((https://)?[^[\\s/]*)([/](.*))?$"),attach:function(e){if(OC.Share&&"trashbin"!==e.id&&"files.public"!==e.id){var r=e.fileActions,n=e._createRow;e._createRow=function(e){var t=n.apply(this,arguments),a=OCA.Sharing.Util.getSharePermissions(e);return 0===e.permissions&&(delete r.actions.all.Comment,delete r.actions.all.Details,delete r.actions.all.Goto),t.attr("data-share-permissions",a),e.shareOwner&&(t.attr("data-share-owner",e.shareOwner),t.attr("data-share-owner-id",e.shareOwnerId),"shared-root"===e.mountType&&t.attr("data-permissions",e.permissions|OC.PERMISSION_UPDATE)),e.recipientData&&!_.isEmpty(e.recipientData)&&t.attr("data-share-recipient-data",JSON.stringify(e.recipientData)),e.shareTypes&&t.attr("data-share-types",e.shareTypes.join(",")),t};var a=e.elementToFile;e.elementToFile=function(e){var t=a.apply(this,arguments);if(t.sharePermissions=e.attr("data-share-permissions")||void 0,t.shareOwner=e.attr("data-share-owner")||void 0,t.shareOwnerId=e.attr("data-share-owner-id")||void 0,e.attr("data-share-types")&&(t.shareTypes=e.attr("data-share-types").split(",")),e.attr("data-expiration")){var r=parseInt(e.attr("data-expiration"));t.shares=[],t.shares.push({expiration:r})}return t};var i=e._getWebdavProperties;e._getWebdavProperties=function(){var e=i.apply(this,arguments);return e.push(OC.Files.Client.PROPERTY_OWNER_ID),e.push(OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME),e.push(OC.Files.Client.PROPERTY_SHARE_TYPES),e},e.filesClient.addFileInfoParser((function(e){var t={},r=e.propStat[0].properties,n=r[OC.Files.Client.PROPERTY_PERMISSIONS];n&&n.indexOf("S")>=0&&(t.shareOwner=r[OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME],t.shareOwnerId=r[OC.Files.Client.PROPERTY_OWNER_ID]);var a=r[OC.Files.Client.PROPERTY_SHARE_TYPES];return a&&(t.shareTypes=_.chain(a).filter((function(e){return e.namespaceURI===OC.Files.Client.NS_OWNCLOUD&&"share-type"===e.nodeName.split(":")[1]})).map((function(e){return parseInt(e.textContent||e.text,10)})).value()),t})),e.$el.on("fileActionsReady",(function(e){var t=e.$files;_.each(t,(function(e){var t=$(e),r=t.attr("data-share-types")||"",n=t.attr("data-share-owner");if(r||n){var a=!1,i=!1;_.each(r.split(",")||[],(function(e){(e=parseInt(e,10))===OC.Share.SHARE_TYPE_LINK||e===OC.Share.SHARE_TYPE_EMAIL?a=!0:(e===OC.Share.SHARE_TYPE_USER||e===OC.Share.SHARE_TYPE_GROUP||e===OC.Share.SHARE_TYPE_REMOTE||e===OC.Share.SHARE_TYPE_CIRCLE||e===OC.Share.SHARE_TYPE_ROOM||e===OC.Share.SHARE_TYPE_DECK)&&(i=!0)})),OCA.Sharing.Util._updateFileActionIcon(t,i,a)}}))})),e.$el.on("changeDirectory",(function(){OCA.Sharing.sharesLoaded=!1})),r.registerAction({name:"Share",displayName:function(e){if(e&&e.$file){var r=parseInt(e.$file.data("share-types"),10),n=e.$file.data("share-owner-id");if(r>=0||n)return t("files_sharing","Shared")}return t("files_sharing","Share")},altText:t("files_sharing","Share"),mime:"all",order:-150,permissions:OC.PERMISSION_ALL,iconClass:function(e,t){var r=parseInt(t.$file.data("share-types"),10);return r===OC.Share.SHARE_TYPE_EMAIL||r===OC.Share.SHARE_TYPE_LINK?"icon-public":"icon-shared"},icon:function(e,t){var r=t.$file.data("share-owner-id");if(r)return OC.generateUrl("/avatar/".concat(r,"/32"))},type:OCA.Files.FileActions.TYPE_INLINE,actionHandler:function(t,r){var n=parseInt(r.$file.data("share-permissions"),10);(isNaN(n)||n>0)&&e.showDetailsView(t,"sharing")},render:function(e,t,n){return 0!=(parseInt(n.$file.data("permissions"),10)&OC.PERMISSION_SHARE)||n.$file.attr("data-share-owner")?r._defaultRenderAction.call(r,e,t,n):null}});var s=new OCA.Sharing.ShareBreadCrumbView;e.registerBreadCrumbDetailView(s)}},_updateFileListDataAttributes:function(e,t,r){if("files"!==e.id)if(_.pluck(r.get("shares"),"share_with_displayname").length){var n=_.mapObject(r.get("shares"),(function(e){return{shareWith:e.share_with,shareWithDisplayName:e.share_with_displayname}}));t.attr("data-share-recipient-data",JSON.stringify(n))}else t.removeAttr("data-share-recipient-data")},_updateFileActionIcon:function(e,t,r){return!!(t||r||e.attr("data-share-recipient-data")||e.attr("data-share-owner"))&&(OCA.Sharing.Util._markFileAsShared(e,!0,r),!0)},_markFileAsShared:function(e,r,n){var a,i,s,o,l=e.find('.fileactions .action[data-action="Share"]'),c=e.data("type"),d=l.find(".icon"),u=e.attr("data-share-owner-id"),h=e.attr("data-share-owner"),f=e.attr("data-mounttype"),p="icon-shared";l.removeClass("shared-style"),"dir"===c&&(r||n||u)?(o=void 0!==f&&"shared-root"!==f&&"shared"!==f?OC.MimeType.getIconUrl("dir-"+f):n?OC.MimeType.getIconUrl("dir-public"):OC.MimeType.getIconUrl("dir-shared"),e.find(".filename .thumbnail").css("background-image","url("+o+")"),e.attr("data-icon",o)):"dir"===c&&("true"===e.attr("data-e2eencrypted")?(o=OC.MimeType.getIconUrl("dir-encrypted"),e.attr("data-icon",o)):f&&0===f.indexOf("external")?(o=OC.MimeType.getIconUrl("dir-external"),e.attr("data-icon",o)):(o=OC.MimeType.getIconUrl("dir"),e.removeAttr("data-icon")),e.find(".filename .thumbnail").css("background-image","url("+o+")")),r||u?(i=e.data("share-recipient-data"),l.addClass("shared-style"),s="<span>"+t("files_sharing","Shared")+"</span>",u?(a=t("files_sharing","Shared by"),s=OCA.Sharing.Util._formatRemoteShare(u,h,a)):i&&(s=OCA.Sharing.Util._formatShareList(i)),l.html(s).prepend(d),(u||i)&&(l.find(".avatar").each((function(){$(this).avatar($(this).data("username"),32)})),l.find("span[title]").tooltip({placement:"top"}))):l.html('<span class="hidden-visually">'+t("files_sharing","Shared")+"</span>").prepend(d),n&&(p="icon-public"),d.removeClass("icon-shared icon-public").addClass(p)},_formatRemoteShare:function(e,t,r){var n=OCA.Sharing.Util._REMOTE_OWNER_REGEXP.exec(e);if(!n||!n[7])return'<span class="avatar" data-username="'+i()(e)+'" title="'+r+" "+i()(t)+'"></span><span class="hidden-visually">'+r+" "+i()(t)+"</span> ";var a=n[2],s=n[4],o=n[5],l=n[6],c=n[8]?n[7]:"",d=r+" "+a;s&&(d+="@"+s),o&&(d+="@"+o.replace(l,"")+c);var u='<span class="remoteAddress" title="'+i()(d)+'">';return u+='<span class="username">'+i()(a)+"</span>",s&&(u+='<span class="userDomain">@'+i()(s)+"</span>"),u+="</span> "},_formatShareList:function(e){var r=this;return(e=_.toArray(e)).sort((function(e,t){return e.shareWithDisplayName.localeCompare(t.shareWithDisplayName)})),$.map(e,(function(e){return r._formatRemoteShare(e.shareWith,e.shareWithDisplayName,t("files_sharing","Shared with"))}))},markFileAsShared:function(e,r,n){var a,i,s,o,l=e.find('.fileactions .action[data-action="Share"]'),c=e.data("type"),d=l.find(".icon"),u=e.attr("data-share-owner-id"),h=e.attr("data-share-owner"),f=e.attr("data-mounttype"),p="icon-shared";l.removeClass("shared-style"),"dir"===c&&(r||n||u)?(o=void 0!==f&&"shared-root"!==f&&"shared"!==f?OC.MimeType.getIconUrl("dir-"+f):n?OC.MimeType.getIconUrl("dir-public"):OC.MimeType.getIconUrl("dir-shared"),e.find(".filename .thumbnail").css("background-image","url("+o+")"),e.attr("data-icon",o)):"dir"===c&&("true"===e.attr("data-e2eencrypted")?(o=OC.MimeType.getIconUrl("dir-encrypted"),e.attr("data-icon",o)):f&&0===f.indexOf("external")?(o=OC.MimeType.getIconUrl("dir-external"),e.attr("data-icon",o)):(o=OC.MimeType.getIconUrl("dir"),e.removeAttr("data-icon")),e.find(".filename .thumbnail").css("background-image","url("+o+")")),r||u?(i=e.data("share-recipient-data"),l.addClass("shared-style"),s="<span>"+t("files_sharing","Shared")+"</span>",u?(a=t("files_sharing","Shared by"),s=this._formatRemoteShare(u,h,a)):i&&(s=this._formatShareList(i)),l.html(s).prepend(d),(u||i)&&(l.find(".avatar").each((function(){$(this).avatar($(this).data("username"),32)})),l.find("span[title]").tooltip({placement:"top"}))):l.html('<span class="hidden-visually">'+t("files_sharing","Shared")+"</span>").prepend(d),n&&(p="icon-public"),d.removeClass("icon-shared icon-public").addClass(p)},getSharePermissions:function(e){return e.sharePermissions}},OC.Plugins.register("OCA.Files.FileList",OCA.Sharing.Util);n(315);var s=n(19),o=n.n(s),l=n(229),c={insert:"head",singleton:!1};o()(l.a,c),l.a.locals,n(159);
+ */var n=/["'&<>]/;e.exports=function(e){var t,r=""+e,a=n.exec(r);if(!a)return r;var i="",s=0,o=0;for(s=a.index;s<r.length;s++){switch(r.charCodeAt(s)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#39;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}o!==s&&(i+=r.substring(o,s)),o=s+1,i+=t}return o!==s?i+r.substring(o,s):i}},473:function(e,r,n){"use strict";n.r(r);var a=n(35),i=n.n(a);_.extend(OC.Files.Client,{PROPERTY_SHARE_TYPES:"{"+OC.Files.Client.NS_OWNCLOUD+"}share-types",PROPERTY_OWNER_ID:"{"+OC.Files.Client.NS_OWNCLOUD+"}owner-id",PROPERTY_OWNER_DISPLAY_NAME:"{"+OC.Files.Client.NS_OWNCLOUD+"}owner-display-name"}),OCA.Sharing||(OCA.Sharing={}),OCA.Sharing.Util={_REMOTE_OWNER_REGEXP:new RegExp("^(([^@]*)@(([^@^/\\s]*)@)?)((https://)?[^[\\s/]*)([/](.*))?$"),attach:function(e){if(OC.Share&&"trashbin"!==e.id&&"files.public"!==e.id){var r=e.fileActions,n=e._createRow;e._createRow=function(e){var t=n.apply(this,arguments),a=OCA.Sharing.Util.getSharePermissions(e);return 0===e.permissions&&(delete r.actions.all.Comment,delete r.actions.all.Details,delete r.actions.all.Goto),t.attr("data-share-permissions",a),e.shareOwner&&(t.attr("data-share-owner",e.shareOwner),t.attr("data-share-owner-id",e.shareOwnerId),"shared-root"===e.mountType&&t.attr("data-permissions",e.permissions|OC.PERMISSION_UPDATE)),e.recipientData&&!_.isEmpty(e.recipientData)&&t.attr("data-share-recipient-data",JSON.stringify(e.recipientData)),e.shareTypes&&t.attr("data-share-types",e.shareTypes.join(",")),t};var a=e.elementToFile;e.elementToFile=function(e){var t=a.apply(this,arguments);if(t.sharePermissions=e.attr("data-share-permissions")||void 0,t.shareOwner=e.attr("data-share-owner")||void 0,t.shareOwnerId=e.attr("data-share-owner-id")||void 0,e.attr("data-share-types")&&(t.shareTypes=e.attr("data-share-types").split(",")),e.attr("data-expiration")){var r=parseInt(e.attr("data-expiration"));t.shares=[],t.shares.push({expiration:r})}return t};var i=e._getWebdavProperties;e._getWebdavProperties=function(){var e=i.apply(this,arguments);return e.push(OC.Files.Client.PROPERTY_OWNER_ID),e.push(OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME),e.push(OC.Files.Client.PROPERTY_SHARE_TYPES),e},e.filesClient.addFileInfoParser((function(e){var t={},r=e.propStat[0].properties,n=r[OC.Files.Client.PROPERTY_PERMISSIONS];n&&n.indexOf("S")>=0&&(t.shareOwner=r[OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME],t.shareOwnerId=r[OC.Files.Client.PROPERTY_OWNER_ID]);var a=r[OC.Files.Client.PROPERTY_SHARE_TYPES];return a&&(t.shareTypes=_.chain(a).filter((function(e){return e.namespaceURI===OC.Files.Client.NS_OWNCLOUD&&"share-type"===e.nodeName.split(":")[1]})).map((function(e){return parseInt(e.textContent||e.text,10)})).value()),t})),e.$el.on("fileActionsReady",(function(e){var t=e.$files;_.each(t,(function(e){var t=$(e),r=t.attr("data-share-types")||"",n=t.attr("data-share-owner");if(r||n){var a=!1,i=!1;_.each(r.split(",")||[],(function(e){(e=parseInt(e,10))===OC.Share.SHARE_TYPE_LINK||e===OC.Share.SHARE_TYPE_EMAIL?a=!0:(e===OC.Share.SHARE_TYPE_USER||e===OC.Share.SHARE_TYPE_GROUP||e===OC.Share.SHARE_TYPE_REMOTE||e===OC.Share.SHARE_TYPE_REMOTE_GROUP||e===OC.Share.SHARE_TYPE_CIRCLE||e===OC.Share.SHARE_TYPE_ROOM||e===OC.Share.SHARE_TYPE_DECK)&&(i=!0)})),OCA.Sharing.Util._updateFileActionIcon(t,i,a)}}))})),e.$el.on("changeDirectory",(function(){OCA.Sharing.sharesLoaded=!1})),r.registerAction({name:"Share",displayName:function(e){if(e&&e.$file){var r=parseInt(e.$file.data("share-types"),10),n=e.$file.data("share-owner-id");if(r>=0||n)return t("files_sharing","Shared")}return t("files_sharing","Share")},altText:t("files_sharing","Share"),mime:"all",order:-150,permissions:OC.PERMISSION_ALL,iconClass:function(e,t){var r=parseInt(t.$file.data("share-types"),10);return r===OC.Share.SHARE_TYPE_EMAIL||r===OC.Share.SHARE_TYPE_LINK?"icon-public":"icon-shared"},icon:function(e,t){var r=t.$file.data("share-owner-id");if(r)return OC.generateUrl("/avatar/".concat(r,"/32"))},type:OCA.Files.FileActions.TYPE_INLINE,actionHandler:function(t,r){if(e._detailsView){var n=parseInt(r.$file.data("share-permissions"),10);(isNaN(n)||n>0)&&e.showDetailsView(t,"sharing")}},render:function(e,t,n){return 0!=(parseInt(n.$file.data("permissions"),10)&OC.PERMISSION_SHARE)||n.$file.attr("data-share-owner")?r._defaultRenderAction.call(r,e,t,n):null}});var s=new OCA.Sharing.ShareBreadCrumbView;e.registerBreadCrumbDetailView(s)}},_updateFileListDataAttributes:function(e,t,r){if("files"!==e.id)if(_.pluck(r.get("shares"),"share_with_displayname").length){var n=_.mapObject(r.get("shares"),(function(e){return{shareWith:e.share_with,shareWithDisplayName:e.share_with_displayname}}));t.attr("data-share-recipient-data",JSON.stringify(n))}else t.removeAttr("data-share-recipient-data")},_updateFileActionIcon:function(e,t,r){return!!(t||r||e.attr("data-share-recipient-data")||e.attr("data-share-owner"))&&(OCA.Sharing.Util._markFileAsShared(e,!0,r),!0)},_markFileAsShared:function(e,r,n){var a,i,s,o,l=e.find('.fileactions .action[data-action="Share"]'),c=e.data("type"),d=l.find(".icon"),u=e.attr("data-share-owner-id"),h=e.attr("data-share-owner"),f=e.attr("data-mounttype"),p="icon-shared";l.removeClass("shared-style"),"dir"===c&&(r||n||u)?(o=void 0!==f&&"shared-root"!==f&&"shared"!==f?OC.MimeType.getIconUrl("dir-"+f):n?OC.MimeType.getIconUrl("dir-public"):OC.MimeType.getIconUrl("dir-shared"),e.find(".filename .thumbnail").css("background-image","url("+o+")"),e.attr("data-icon",o)):"dir"===c&&("true"===e.attr("data-e2eencrypted")?(o=OC.MimeType.getIconUrl("dir-encrypted"),e.attr("data-icon",o)):f&&0===f.indexOf("external")?(o=OC.MimeType.getIconUrl("dir-external"),e.attr("data-icon",o)):(o=OC.MimeType.getIconUrl("dir"),e.removeAttr("data-icon")),e.find(".filename .thumbnail").css("background-image","url("+o+")")),r||u?(i=e.data("share-recipient-data"),l.addClass("shared-style"),s="<span>"+t("files_sharing","Shared")+"</span>",u?(a=t("files_sharing","Shared by"),s=OCA.Sharing.Util._formatRemoteShare(u,h,a)):i&&(s=OCA.Sharing.Util._formatShareList(i)),l.html(s).prepend(d),(u||i)&&(l.find(".avatar").each((function(){$(this).avatar($(this).data("username"),32)})),l.find("span[title]").tooltip({placement:"top"}))):l.html('<span class="hidden-visually">'+t("files_sharing","Shared")+"</span>").prepend(d),n&&(p="icon-public"),d.removeClass("icon-shared icon-public").addClass(p)},_formatRemoteShare:function(e,t,r){var n=OCA.Sharing.Util._REMOTE_OWNER_REGEXP.exec(e);if(!n||!n[7])return'<span class="avatar" data-username="'+i()(e)+'" title="'+r+" "+i()(t)+'"></span><span class="hidden-visually">'+r+" "+i()(t)+"</span> ";var a=n[2],s=n[4],o=n[5],l=n[6],c=n[8]?n[7]:"",d=r+" "+a;s&&(d+="@"+s),o&&(d+="@"+o.replace(l,"")+c);var u='<span class="remoteAddress" title="'+i()(d)+'">';return u+='<span class="username">'+i()(a)+"</span>",s&&(u+='<span class="userDomain">@'+i()(s)+"</span>"),u+="</span> "},_formatShareList:function(e){var r=this;return(e=_.toArray(e)).sort((function(e,t){return e.shareWithDisplayName.localeCompare(t.shareWithDisplayName)})),$.map(e,(function(e){return r._formatRemoteShare(e.shareWith,e.shareWithDisplayName,t("files_sharing","Shared with"))}))},markFileAsShared:function(e,r,n){var a,i,s,o,l=e.find('.fileactions .action[data-action="Share"]'),c=e.data("type"),d=l.find(".icon"),u=e.attr("data-share-owner-id"),h=e.attr("data-share-owner"),f=e.attr("data-mounttype"),p="icon-shared";l.removeClass("shared-style"),"dir"===c&&(r||n||u)?(o=void 0!==f&&"shared-root"!==f&&"shared"!==f?OC.MimeType.getIconUrl("dir-"+f):n?OC.MimeType.getIconUrl("dir-public"):OC.MimeType.getIconUrl("dir-shared"),e.find(".filename .thumbnail").css("background-image","url("+o+")"),e.attr("data-icon",o)):"dir"===c&&("true"===e.attr("data-e2eencrypted")?(o=OC.MimeType.getIconUrl("dir-encrypted"),e.attr("data-icon",o)):f&&0===f.indexOf("external")?(o=OC.MimeType.getIconUrl("dir-external"),e.attr("data-icon",o)):(o=OC.MimeType.getIconUrl("dir"),e.removeAttr("data-icon")),e.find(".filename .thumbnail").css("background-image","url("+o+")")),r||u?(i=e.data("share-recipient-data"),l.addClass("shared-style"),s="<span>"+t("files_sharing","Shared")+"</span>",u?(a=t("files_sharing","Shared by"),s=this._formatRemoteShare(u,h,a)):i&&(s=this._formatShareList(i)),l.html(s).prepend(d),(u||i)&&(l.find(".avatar").each((function(){$(this).avatar($(this).data("username"),32)})),l.find("span[title]").tooltip({placement:"top"}))):l.html('<span class="hidden-visually">'+t("files_sharing","Shared")+"</span>").prepend(d),n&&(p="icon-public"),d.removeClass("icon-shared icon-public").addClass(p)},getSharePermissions:function(e){return e.sharePermissions}},OC.Plugins.register("OCA.Files.FileList",OCA.Sharing.Util);n(315);var s=n(19),o=n.n(s),l=n(229),c={insert:"head",singleton:!1};o()(l.a,c),l.a.locals,n(159);
/**
* @copyright Copyright (c) 2016 Roeland Jago Douma <roeland@famdouma.nl>
*
diff --git a/apps/files_sharing/js/dist/additionalScripts.js.map b/apps/files_sharing/js/dist/additionalScripts.js.map
index 217e2a7921d..094ddfe45c9 100644
--- a/apps/files_sharing/js/dist/additionalScripts.js.map
+++ b/apps/files_sharing/js/dist/additionalScripts.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./apps/files_sharing/src/collaborationresourceshandler.js","webpack:///./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack:///./node_modules/css-loader/dist/runtime/cssWithMappingToString.js","webpack:///./node_modules/css-loader/dist/runtime/api.js","webpack:///./apps/files_sharing/src/style/sharebreadcrumb.scss","webpack:///./apps/files_sharing/src/sharebreadcrumbview.js","webpack:///./node_modules/escape-html/index.js","webpack:///./apps/files_sharing/src/share.js","webpack:///./apps/files_sharing/src/style/sharebreadcrumb.scss?a9a3","webpack:///./apps/files_sharing/src/additionalScripts.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","__webpack_public_path__","OC","linkTo","__webpack_nonce__","btoa","requestToken","window","OCP","Collaboration","registerType","action","Promise","resolve","reject","dialogs","filepicker","f","Files","getClient","getFileInfo","then","status","fileInfo","id","fail","Error","FILEPICKER_TYPE_CHOOSE","allowDirectoryChooser","typeString","typeIconClass","memo","isOldIE","Boolean","document","all","atob","getTarget","target","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","e","stylesInDom","getIndexByIdentifier","identifier","result","length","modulesToDom","list","options","idCountMap","identifiers","item","base","count","concat","index","obj","css","media","sourceMap","references","updater","push","addStyle","insertStyleElement","style","createElement","attributes","nonce","keys","forEach","setAttribute","insert","appendChild","textStore","replaceText","replacement","filter","join","applyToSingletonTag","remove","styleSheet","cssText","cssNode","createTextNode","childNodes","removeChild","insertBefore","applyToTag","removeAttribute","unescape","encodeURIComponent","JSON","stringify","firstChild","singleton","singletonCounter","update","styleIndex","parentNode","removeStyleElement","newObj","lastIdentifiers","newList","toString","newLastIdentifiers","_i","_index","splice","_slicedToArray","arr","Array","isArray","_arrayWithHoles","iterator","_s","_e","_arr","_n","_d","next","done","err","_iterableToArrayLimit","minLen","_arrayLikeToArray","slice","constructor","from","test","_unsupportedIterableToArray","TypeError","_nonIterableRest","len","arr2","_item","content","cssMapping","base64","data","sourceMapping","sourceURLs","sources","map","source","sourceRoot","cssWithMappingToString","this","mediaQuery","dedupe","alreadyImportedModules","___CSS_LOADER_EXPORT___","BreadCrumbView","Backbone","View","extend","tagName","events","click","_dirInfo","undefined","render","dirInfo","path","$el","removeClass","hide","isShared","shareTypes","addClass","indexOf","Share","SHARE_TYPE_LINK","show","delegateEvents","_onClick","preventDefault","stopPropagation","fileInfoModel","OCA","FileInfoModel","self","on","Sidebar","open","setActiveTab","Sharing","ShareBreadCrumbView","matchHtmlRegExp","string","escape","str","match","exec","html","lastIndex","charCodeAt","substring","_","Client","PROPERTY_SHARE_TYPES","NS_OWNCLOUD","PROPERTY_OWNER_ID","PROPERTY_OWNER_DISPLAY_NAME","Util","_REMOTE_OWNER_REGEXP","RegExp","attach","fileList","fileActions","oldCreateRow","_createRow","fileData","tr","apply","arguments","sharePermissions","getSharePermissions","permissions","actions","Comment","Details","Goto","attr","shareOwner","shareOwnerId","mountType","PERMISSION_UPDATE","recipientData","isEmpty","oldElementToFile","elementToFile","split","expirationTimestamp","parseInt","shares","expiration","oldGetWebdavProperties","_getWebdavProperties","props","filesClient","addFileInfoParser","response","propStat","properties","permissionsProp","PROPERTY_PERMISSIONS","shareTypesProp","chain","xmlvalue","namespaceURI","nodeName","textContent","text","ev","$files","each","file","$tr","$","hasLink","hasShares","shareType","SHARE_TYPE_EMAIL","SHARE_TYPE_USER","SHARE_TYPE_GROUP","SHARE_TYPE_REMOTE","SHARE_TYPE_CIRCLE","SHARE_TYPE_ROOM","SHARE_TYPE_DECK","_updateFileActionIcon","sharesLoaded","registerAction","displayName","context","$file","altText","mime","order","PERMISSION_ALL","iconClass","fileName","icon","generateUrl","type","FileActions","TYPE_INLINE","actionHandler","isNaN","showDetailsView","actionSpec","isDefault","PERMISSION_SHARE","_defaultRenderAction","breadCrumbSharingDetailView","registerBreadCrumbDetailView","_updateFileListDataAttributes","shareModel","pluck","mapObject","share","shareWith","share_with","shareWithDisplayName","share_with_displayname","removeAttr","hasUserShares","hasLinkShares","_markFileAsShared","message","recipients","avatars","shareFolderIcon","find","ownerId","owner","MimeType","getIconUrl","_formatRemoteShare","_formatShareList","prepend","avatar","tooltip","placement","parts","escapeHTML","userName","userDomain","server","protocol","serverPath","replace","_parent","toArray","sort","a","b","localeCompare","recipient","markFileAsShared","Plugins","register","locals"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,E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,EAAInC,KAAK,YAAayF,KAEtBA,EAAkB1T,GAAG8T,SAASC,WAAW,OAEzC3D,EAAI+C,WAAW,cAEhB/C,EAAIuD,KAAK,wBAAwBhQ,IAAI,mBAAoB,OAAS+P,EAAkB,MAGjFnD,GAAaqD,GAChBJ,EAAapD,EAAIvH,KAAK,wBACtBpI,EAAOkK,SAAS,gBAEhB8I,EAAU,SAAWxU,EAAE,gBAAiB,UAAY,UAEhD2U,GACHL,EAAUtU,EAAE,gBAAiB,aAC7BwU,EAAUpK,KAAK2K,mBAAmBJ,EAASC,EAAON,IACxCC,IACVC,EAAUpK,KAAK4K,iBAAiBT,IAEjC/S,EAAO2L,KAAKqH,GAASS,QAAQtC,IAEzBgC,GAAWJ,KACM/S,EAAOkT,KAAK,WAClBzD,MAAK,WAClBG,EAAEhH,MAAM8K,OAAO9D,EAAEhH,MAAMR,KAAK,YAAa,OAE1CpI,EAAOkT,KAAK,eAAeS,QAAQ,CAAEC,UAAW,UAGjD5T,EAAO2L,KAAK,iCAAmCnN,EAAE,gBAAiB,UAAY,WAAWiV,QAAQtC,GAE9FtB,IACHoB,EAAY,eAEbE,EAAKrH,YAAY,2BAA2BI,SAAS+G,IAOtD/D,oBAAqB,SAASL,GAC7B,OAAOA,EAASI,mBAKnB1N,GAAGsV,QAAQC,SAAS,qBAAsBlK,IAAIO,QAAQkB,M,qCCjgBlD5J,EAAU,CAEd,OAAiB,OACjB,WAAoB,GAEP,IAAI,IAASA,GAIX,IAAQsS,O;;;;;;;;;;;;;;;;;;;;;;;;ACoBvBzV,IAA0BC,GAAGC,OAAO,gBAAiB,YAErDC,KAAoBC,KAAKH,GAAGI,cAE5BC,OAAOgL,IAAIO,QAAUP,IAAIO","file":"additionalScripts.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/js/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 473);\n","/**\n * @copyright Copyright (c) 2016 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n * @author Julius Härtl <jus@bitgrid.net>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n// eslint-disable-next-line camelcase\n__webpack_public_path__ = OC.linkTo('files_sharing', 'js/dist/')\n// eslint-disable-next-line camelcase\n__webpack_nonce__ = btoa(OC.requestToken)\n\nwindow.OCP.Collaboration.registerType('file', {\n\taction: () => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tOC.dialogs.filepicker(t('files_sharing', 'Link to a file'), function(f) {\n\t\t\t\tconst client = OC.Files.getClient()\n\t\t\t\tclient.getFileInfo(f).then((status, fileInfo) => {\n\t\t\t\t\tresolve(fileInfo.id)\n\t\t\t\t}).fail(() => {\n\t\t\t\t\treject(new Error('Cannot get fileinfo'))\n\t\t\t\t})\n\t\t\t}, false, null, false, OC.dialogs.FILEPICKER_TYPE_CHOOSE, '', { allowDirectoryChooser: true })\n\t\t})\n\t},\n\ttypeString: t('files_sharing', 'Link to a file'),\n\ttypeIconClass: 'icon-files-dark',\n})\n","\"use strict\";\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n // tags it will allow on a page\n\n if (!options.singleton && typeof options.singleton !== 'boolean') {\n options.singleton = isOldIE();\n }\n\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n\n if (Object.prototype.toString.call(newList) !== '[object Array]') {\n return;\n }\n\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDom[index].references--;\n }\n\n var newLastIdentifiers = modulesToDom(newList, options);\n\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n\n var _index = getIndexByIdentifier(_identifier);\n\n if (stylesInDom[_index].references === 0) {\n stylesInDom[_index].updater();\n\n stylesInDom.splice(_index, 1);\n }\n }\n\n lastIdentifiers = newLastIdentifiers;\n };\n};","\"use strict\";\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nmodule.exports = function cssWithMappingToString(item) {\n var _item = _slicedToArray(item, 4),\n content = _item[1],\n cssMapping = _item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (typeof btoa === \"function\") {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || \"\").concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join(\"\\n\");\n }\n\n return [content].join(\"\\n\");\n};","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === \"string\") {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, \"\"]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"div.crumb span.icon-shared,div.crumb span.icon-public{display:inline-block;cursor:pointer;opacity:.2;margin-right:6px}div.crumb span.icon-shared.shared,div.crumb span.icon-public.shared{opacity:.7}\", \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files_sharing/src/style/sharebreadcrumb.scss\"],\"names\":[],\"mappings\":\"AAsBA,sDAEC,oBAAA,CACA,cAAA,CACA,UAAA,CACA,gBAAA,CAGD,oEAEC,UAAA\",\"sourcesContent\":[\"/**\\n * @copyright 2016 Christoph Wurst <christoph@winzerhof-wurst.at>\\n *\\n * @author 2016 Christoph Wurst <christoph@winzerhof-wurst.at>\\n *\\n * @license GNU AGPL version 3 or any later version\\n *\\n * This program is free software: you can redistribute it and/or modify\\n * it under the terms of the GNU Affero General Public License as\\n * published by the Free Software Foundation, either version 3 of the\\n * License, or (at your option) any later version.\\n *\\n * This program is distributed in the hope that it will be useful,\\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\\n * GNU Affero General Public License for more details.\\n *\\n * You should have received a copy of the GNU Affero General Public License\\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\\n *\\n */\\n\\ndiv.crumb span.icon-shared,\\ndiv.crumb span.icon-public {\\n\\tdisplay: inline-block;\\n\\tcursor: pointer;\\n\\topacity: 0.2;\\n\\tmargin-right: 6px;\\n}\\n\\ndiv.crumb span.icon-shared.shared,\\ndiv.crumb span.icon-public.shared {\\n\\topacity: 0.7;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","/**\n * @copyright 2016 Christoph Wurst <christoph@winzerhof-wurst.at>\n *\n * @author Christoph Wurst <christoph@winzerhof-wurst.at>\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n * @author Roeland Jago Douma <roeland@famdouma.nl>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n(function() {\n\t'use strict'\n\n\tconst BreadCrumbView = OC.Backbone.View.extend({\n\t\ttagName: 'span',\n\t\tevents: {\n\t\t\tclick: '_onClick',\n\t\t},\n\t\t_dirInfo: undefined,\n\n\t\trender(data) {\n\t\t\tthis._dirInfo = data.dirInfo || null\n\n\t\t\tif (this._dirInfo !== null && (this._dirInfo.path !== '/' || this._dirInfo.name !== '')) {\n\t\t\t\tconst isShared = data.dirInfo && data.dirInfo.shareTypes && data.dirInfo.shareTypes.length > 0\n\t\t\t\tthis.$el.removeClass('shared icon-public icon-shared')\n\t\t\t\tif (isShared) {\n\t\t\t\t\tthis.$el.addClass('shared')\n\t\t\t\t\tif (data.dirInfo.shareTypes.indexOf(OC.Share.SHARE_TYPE_LINK) !== -1) {\n\t\t\t\t\t\tthis.$el.addClass('icon-public')\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.$el.addClass('icon-shared')\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.$el.addClass('icon-shared')\n\t\t\t\t}\n\t\t\t\tthis.$el.show()\n\t\t\t\tthis.delegateEvents()\n\t\t\t} else {\n\t\t\t\tthis.$el.removeClass('shared icon-public icon-shared')\n\t\t\t\tthis.$el.hide()\n\t\t\t}\n\n\t\t\treturn this\n\t\t},\n\t\t_onClick(e) {\n\t\t\te.preventDefault()\n\t\t\te.stopPropagation()\n\n\t\t\tconst fileInfoModel = new OCA.Files.FileInfoModel(this._dirInfo)\n\t\t\tconst self = this\n\t\t\tfileInfoModel.on('change', function() {\n\t\t\t\tself.render({\n\t\t\t\t\tdirInfo: self._dirInfo,\n\t\t\t\t})\n\t\t\t})\n\n\t\t\tconst path = fileInfoModel.attributes.path + '/' + fileInfoModel.attributes.name\n\t\t\tOCA.Files.Sidebar.open(path)\n\t\t\tOCA.Files.Sidebar.setActiveTab('sharing')\n\t\t},\n\t})\n\n\tOCA.Sharing.ShareBreadCrumbView = BreadCrumbView\n})()\n","/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '&quot;';\n break;\n case 38: // &\n escape = '&amp;';\n break;\n case 39: // '\n escape = '&#39;';\n break;\n case 60: // <\n escape = '&lt;';\n break;\n case 62: // >\n escape = '&gt;';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n","/**\n * Copyright (c) 2014\n *\n * @author Arthur Schiwon <blizzz@arthur-schiwon.de>\n * @author Christoph Wurst <christoph@winzerhof-wurst.at>\n * @author Daniel Calviño Sánchez <danxuliu@gmail.com>\n * @author Joas Schilling <coding@schilljs.com>\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n * @author Julius Härtl <jus@bitgrid.net>\n * @author Maxence Lange <maxence@nextcloud.com>\n * @author Michael Jobst <mjobst+github@tecratech.de>\n * @author Michael Jobst <mjobst@necls.com>\n * @author Morris Jobke <hey@morrisjobke.de>\n * @author Roeland Jago Douma <roeland@famdouma.nl>\n * @author Samuel <faust64@gmail.com>\n * @author Vincent Petry <vincent@nextcloud.com>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n/* eslint-disable */\nimport escapeHTML from 'escape-html'\n\n(function() {\n\n\t_.extend(OC.Files.Client, {\n\t\tPROPERTY_SHARE_TYPES:\t'{' + OC.Files.Client.NS_OWNCLOUD + '}share-types',\n\t\tPROPERTY_OWNER_ID:\t'{' + OC.Files.Client.NS_OWNCLOUD + '}owner-id',\n\t\tPROPERTY_OWNER_DISPLAY_NAME:\t'{' + OC.Files.Client.NS_OWNCLOUD + '}owner-display-name'\n\t})\n\n\tif (!OCA.Sharing) {\n\t\tOCA.Sharing = {}\n\t}\n\n\t/**\n\t * @namespace\n\t */\n\tOCA.Sharing.Util = {\n\n\t\t/**\n\t\t * Regular expression for splitting parts of remote share owners:\n\t\t * \"user@example.com/\"\n\t\t * \"user@example.com/path/to/owncloud\"\n\t\t * \"user@anotherexample.com@example.com/path/to/owncloud\n\t\t */\n\t\t_REMOTE_OWNER_REGEXP: new RegExp('^(([^@]*)@(([^@^/\\\\s]*)@)?)((https://)?[^[\\\\s/]*)([/](.*))?$'),\n\n\t\t/**\n\t\t * Initialize the sharing plugin.\n\t\t *\n\t\t * Registers the \"Share\" file action and adds additional\n\t\t * DOM attributes for the sharing file info.\n\t\t *\n\t\t * @param {OCA.Files.FileList} fileList file list to be extended\n\t\t */\n\t\tattach: function(fileList) {\n\t\t\t// core sharing is disabled/not loaded\n\t\t\tif (!OC.Share) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (fileList.id === 'trashbin' || fileList.id === 'files.public') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tvar fileActions = fileList.fileActions\n\t\t\tvar oldCreateRow = fileList._createRow\n\t\t\tfileList._createRow = function(fileData) {\n\n\t\t\t\tvar tr = oldCreateRow.apply(this, arguments)\n\t\t\t\tvar sharePermissions = OCA.Sharing.Util.getSharePermissions(fileData)\n\n\t\t\t\tif (fileData.permissions === 0) {\n\t\t\t\t\t// no permission, disabling sidebar\n\t\t\t\t\tdelete fileActions.actions.all.Comment\n\t\t\t\t\tdelete fileActions.actions.all.Details\n\t\t\t\t\tdelete fileActions.actions.all.Goto\n\t\t\t\t}\n\t\t\t\ttr.attr('data-share-permissions', sharePermissions)\n\t\t\t\tif (fileData.shareOwner) {\n\t\t\t\t\ttr.attr('data-share-owner', fileData.shareOwner)\n\t\t\t\t\ttr.attr('data-share-owner-id', fileData.shareOwnerId)\n\t\t\t\t\t// user should always be able to rename a mount point\n\t\t\t\t\tif (fileData.mountType === 'shared-root') {\n\t\t\t\t\t\ttr.attr('data-permissions', fileData.permissions | OC.PERMISSION_UPDATE)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (fileData.recipientData && !_.isEmpty(fileData.recipientData)) {\n\t\t\t\t\ttr.attr('data-share-recipient-data', JSON.stringify(fileData.recipientData))\n\t\t\t\t}\n\t\t\t\tif (fileData.shareTypes) {\n\t\t\t\t\ttr.attr('data-share-types', fileData.shareTypes.join(','))\n\t\t\t\t}\n\t\t\t\treturn tr\n\t\t\t}\n\n\t\t\tvar oldElementToFile = fileList.elementToFile\n\t\t\tfileList.elementToFile = function($el) {\n\t\t\t\tvar fileInfo = oldElementToFile.apply(this, arguments)\n\t\t\t\tfileInfo.sharePermissions = $el.attr('data-share-permissions') || undefined\n\t\t\t\tfileInfo.shareOwner = $el.attr('data-share-owner') || undefined\n\t\t\t\tfileInfo.shareOwnerId = $el.attr('data-share-owner-id') || undefined\n\n\t\t\t\tif ($el.attr('data-share-types')) {\n\t\t\t\t\tfileInfo.shareTypes = $el.attr('data-share-types').split(',')\n\t\t\t\t}\n\n\t\t\t\tif ($el.attr('data-expiration')) {\n\t\t\t\t\tvar expirationTimestamp = parseInt($el.attr('data-expiration'))\n\t\t\t\t\tfileInfo.shares = []\n\t\t\t\t\tfileInfo.shares.push({ expiration: expirationTimestamp })\n\t\t\t\t}\n\n\t\t\t\treturn fileInfo\n\t\t\t}\n\n\t\t\tvar oldGetWebdavProperties = fileList._getWebdavProperties\n\t\t\tfileList._getWebdavProperties = function() {\n\t\t\t\tvar props = oldGetWebdavProperties.apply(this, arguments)\n\t\t\t\tprops.push(OC.Files.Client.PROPERTY_OWNER_ID)\n\t\t\t\tprops.push(OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME)\n\t\t\t\tprops.push(OC.Files.Client.PROPERTY_SHARE_TYPES)\n\t\t\t\treturn props\n\t\t\t}\n\n\t\t\tfileList.filesClient.addFileInfoParser(function(response) {\n\t\t\t\tvar data = {}\n\t\t\t\tvar props = response.propStat[0].properties\n\t\t\t\tvar permissionsProp = props[OC.Files.Client.PROPERTY_PERMISSIONS]\n\n\t\t\t\tif (permissionsProp && permissionsProp.indexOf('S') >= 0) {\n\t\t\t\t\tdata.shareOwner = props[OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME]\n\t\t\t\t\tdata.shareOwnerId = props[OC.Files.Client.PROPERTY_OWNER_ID]\n\t\t\t\t}\n\n\t\t\t\tvar shareTypesProp = props[OC.Files.Client.PROPERTY_SHARE_TYPES]\n\t\t\t\tif (shareTypesProp) {\n\t\t\t\t\tdata.shareTypes = _.chain(shareTypesProp).filter(function(xmlvalue) {\n\t\t\t\t\t\treturn (xmlvalue.namespaceURI === OC.Files.Client.NS_OWNCLOUD && xmlvalue.nodeName.split(':')[1] === 'share-type')\n\t\t\t\t\t}).map(function(xmlvalue) {\n\t\t\t\t\t\treturn parseInt(xmlvalue.textContent || xmlvalue.text, 10)\n\t\t\t\t\t}).value()\n\t\t\t\t}\n\n\t\t\t\treturn data\n\t\t\t})\n\n\t\t\t// use delegate to catch the case with multiple file lists\n\t\t\tfileList.$el.on('fileActionsReady', function(ev) {\n\t\t\t\tvar $files = ev.$files\n\n\t\t\t\t_.each($files, function(file) {\n\t\t\t\t\tvar $tr = $(file)\n\t\t\t\t\tvar shareTypes = $tr.attr('data-share-types') || ''\n\t\t\t\t\tvar shareOwner = $tr.attr('data-share-owner')\n\t\t\t\t\tif (shareTypes || shareOwner) {\n\t\t\t\t\t\tvar hasLink = false\n\t\t\t\t\t\tvar hasShares = false\n\t\t\t\t\t\t_.each(shareTypes.split(',') || [], function(shareType) {\n\t\t\t\t\t\t\tshareType = parseInt(shareType, 10)\n\t\t\t\t\t\t\tif (shareType === OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\t\t\t\thasLink = true\n\t\t\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_EMAIL) {\n\t\t\t\t\t\t\t\thasLink = true\n\t\t\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_USER) {\n\t\t\t\t\t\t\t\thasShares = true\n\t\t\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\t\t\t\t\t\thasShares = true\n\t\t\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_REMOTE) {\n\t\t\t\t\t\t\t\thasShares = true\n\t\t\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_CIRCLE) {\n\t\t\t\t\t\t\t\thasShares = true\n\t\t\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_ROOM) {\n\t\t\t\t\t\t\t\thasShares = true\n\t\t\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_DECK) {\n\t\t\t\t\t\t\t\thasShares = true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\tOCA.Sharing.Util._updateFileActionIcon($tr, hasShares, hasLink)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\n\t\t\tfileList.$el.on('changeDirectory', function() {\n\t\t\t\tOCA.Sharing.sharesLoaded = false\n\t\t\t})\n\n\t\t\tfileActions.registerAction({\n\t\t\t\tname: 'Share',\n\t\t\t\tdisplayName: function(context) {\n\t\t\t\t\tif (context && context.$file) {\n\t\t\t\t\t\tvar shareType = parseInt(context.$file.data('share-types'), 10)\n\t\t\t\t\t\tvar shareOwner = context.$file.data('share-owner-id')\n\t\t\t\t\t\tif (shareType >= 0 || shareOwner) {\n\t\t\t\t\t\t\treturn t('files_sharing', 'Shared')\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn t('files_sharing', 'Share')\n\t\t\t\t},\n\t\t\t\taltText: t('files_sharing', 'Share'),\n\t\t\t\tmime: 'all',\n\t\t\t\torder: -150,\n\t\t\t\tpermissions: OC.PERMISSION_ALL,\n\t\t\t\ticonClass: function(fileName, context) {\n\t\t\t\t\tvar shareType = parseInt(context.$file.data('share-types'), 10)\n\t\t\t\t\tif (shareType === OC.Share.SHARE_TYPE_EMAIL\n\t\t\t\t\t\t|| shareType === OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\t\treturn 'icon-public'\n\t\t\t\t\t}\n\t\t\t\t\treturn 'icon-shared'\n\t\t\t\t},\n\t\t\t\ticon: function(fileName, context) {\n\t\t\t\t\tvar shareOwner = context.$file.data('share-owner-id')\n\t\t\t\t\tif (shareOwner) {\n\t\t\t\t\t\treturn OC.generateUrl(`/avatar/${shareOwner}/32`)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\ttype: OCA.Files.FileActions.TYPE_INLINE,\n\t\t\t\tactionHandler: function(fileName, context) {\n\t\t\t\t\t// do not open sidebar if permission is set and equal to 0\n\t\t\t\t\tvar permissions = parseInt(context.$file.data('share-permissions'), 10)\n\t\t\t\t\tif (isNaN(permissions) || permissions > 0) {\n\t\t\t\t\t\tfileList.showDetailsView(fileName, 'sharing')\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\trender: function(actionSpec, isDefault, context) {\n\t\t\t\t\tvar permissions = parseInt(context.$file.data('permissions'), 10)\n\t\t\t\t\t// if no share permissions but share owner exists, still show the link\n\t\t\t\t\tif ((permissions & OC.PERMISSION_SHARE) !== 0 || context.$file.attr('data-share-owner')) {\n\t\t\t\t\t\treturn fileActions._defaultRenderAction.call(fileActions, actionSpec, isDefault, context)\n\t\t\t\t\t}\n\t\t\t\t\t// don't render anything\n\t\t\t\t\treturn null\n\t\t\t\t}\n\t\t\t})\n\n\t\t\t// register share breadcrumbs component\n\t\t\tvar breadCrumbSharingDetailView = new OCA.Sharing.ShareBreadCrumbView()\n\t\t\tfileList.registerBreadCrumbDetailView(breadCrumbSharingDetailView)\n\t\t},\n\n\t\t/**\n\t\t * Update file list data attributes\n\t\t */\n\t\t_updateFileListDataAttributes: function(fileList, $tr, shareModel) {\n\t\t\t// files app current cannot show recipients on load, so we don't update the\n\t\t\t// icon when changed for consistency\n\t\t\tif (fileList.id === 'files') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tvar recipients = _.pluck(shareModel.get('shares'), 'share_with_displayname')\n\t\t\t// note: we only update the data attribute because updateIcon()\n\t\t\tif (recipients.length) {\n\t\t\t\tvar recipientData = _.mapObject(shareModel.get('shares'), function(share) {\n\t\t\t\t\treturn { shareWith: share.share_with, shareWithDisplayName: share.share_with_displayname }\n\t\t\t\t})\n\t\t\t\t$tr.attr('data-share-recipient-data', JSON.stringify(recipientData))\n\t\t\t} else {\n\t\t\t\t$tr.removeAttr('data-share-recipient-data')\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Update the file action share icon for the given file\n\t\t *\n\t\t * @param $tr file element of the file to update\n\t\t * @param {boolean} hasUserShares true if a user share exists\n\t\t * @param {boolean} hasLinkShares true if a link share exists\n\t\t *\n\t\t * @returns {boolean} true if the icon was set, false otherwise\n\t\t */\n\t\t_updateFileActionIcon: function($tr, hasUserShares, hasLinkShares) {\n\t\t\t// if the statuses are loaded already, use them for the icon\n\t\t\t// (needed when scrolling to the next page)\n\t\t\tif (hasUserShares || hasLinkShares || $tr.attr('data-share-recipient-data') || $tr.attr('data-share-owner')) {\n\t\t\t\tOCA.Sharing.Util._markFileAsShared($tr, true, hasLinkShares)\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\n\t\t/**\n\t\t * Marks/unmarks a given file as shared by changing its action icon\n\t\t * and folder icon.\n\t\t *\n\t\t * @param $tr file element to mark as shared\n\t\t * @param hasShares whether shares are available\n\t\t * @param hasLink whether link share is available\n\t\t */\n\t\t_markFileAsShared: function($tr, hasShares, hasLink) {\n\t\t\tvar action = $tr.find('.fileactions .action[data-action=\"Share\"]')\n\t\t\tvar type = $tr.data('type')\n\t\t\tvar icon = action.find('.icon')\n\t\t\tvar message, recipients, avatars\n\t\t\tvar ownerId = $tr.attr('data-share-owner-id')\n\t\t\tvar owner = $tr.attr('data-share-owner')\n\t\t\tvar mountType = $tr.attr('data-mounttype')\n\t\t\tvar shareFolderIcon\n\t\t\tvar iconClass = 'icon-shared'\n\t\t\taction.removeClass('shared-style')\n\t\t\t// update folder icon\n\t\t\tif (type === 'dir' && (hasShares || hasLink || ownerId)) {\n\t\t\t\tif (typeof mountType !== 'undefined' && mountType !== 'shared-root' && mountType !== 'shared') {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-' + mountType)\n\t\t\t\t} else if (hasLink) {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-public')\n\t\t\t\t} else {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-shared')\n\t\t\t\t}\n\t\t\t\t$tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')')\n\t\t\t\t$tr.attr('data-icon', shareFolderIcon)\n\t\t\t} else if (type === 'dir') {\n\t\t\t\tvar isEncrypted = $tr.attr('data-e2eencrypted')\n\t\t\t\t// FIXME: duplicate of FileList._createRow logic for external folder,\n\t\t\t\t// need to refactor the icon logic into a single code path eventually\n\t\t\t\tif (isEncrypted === 'true') {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-encrypted')\n\t\t\t\t\t$tr.attr('data-icon', shareFolderIcon)\n\t\t\t\t} else if (mountType && mountType.indexOf('external') === 0) {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-external')\n\t\t\t\t\t$tr.attr('data-icon', shareFolderIcon)\n\t\t\t\t} else {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir')\n\t\t\t\t\t// back to default\n\t\t\t\t\t$tr.removeAttr('data-icon')\n\t\t\t\t}\n\t\t\t\t$tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')')\n\t\t\t}\n\t\t\t// update share action text / icon\n\t\t\tif (hasShares || ownerId) {\n\t\t\t\trecipients = $tr.data('share-recipient-data')\n\t\t\t\taction.addClass('shared-style')\n\n\t\t\t\tavatars = '<span>' + t('files_sharing', 'Shared') + '</span>'\n\t\t\t\t// even if reshared, only show \"Shared by\"\n\t\t\t\tif (ownerId) {\n\t\t\t\t\tmessage = t('files_sharing', 'Shared by')\n\t\t\t\t\tavatars = OCA.Sharing.Util._formatRemoteShare(ownerId, owner, message)\n\t\t\t\t} else if (recipients) {\n\t\t\t\t\tavatars = OCA.Sharing.Util._formatShareList(recipients)\n\t\t\t\t}\n\t\t\t\taction.html(avatars).prepend(icon)\n\n\t\t\t\tif (ownerId || recipients) {\n\t\t\t\t\tvar avatarElement = action.find('.avatar')\n\t\t\t\t\tavatarElement.each(function() {\n\t\t\t\t\t\t$(this).avatar($(this).data('username'), 32)\n\t\t\t\t\t})\n\t\t\t\t\taction.find('span[title]').tooltip({ placement: 'top' })\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taction.html('<span class=\"hidden-visually\">' + t('files_sharing', 'Shared') + '</span>').prepend(icon)\n\t\t\t}\n\t\t\tif (hasLink) {\n\t\t\t\ticonClass = 'icon-public'\n\t\t\t}\n\t\t\ticon.removeClass('icon-shared icon-public').addClass(iconClass)\n\t\t},\n\t\t/**\n\t\t * Format a remote address\n\t\t *\n\t\t * @param {String} shareWith userid, full remote share, or whatever\n\t\t * @param {String} shareWithDisplayName\n\t\t * @param {String} message\n\t\t * @returns {String} HTML code to display\n\t\t */\n\t\t_formatRemoteShare: function(shareWith, shareWithDisplayName, message) {\n\t\t\tvar parts = OCA.Sharing.Util._REMOTE_OWNER_REGEXP.exec(shareWith)\n\t\t\tif (!parts || !parts[7]) {\n\t\t\t\t// display avatar of the user\n\t\t\t\tvar avatar = '<span class=\"avatar\" data-username=\"' + escapeHTML(shareWith) + '\" title=\"' + message + ' ' + escapeHTML(shareWithDisplayName) + '\"></span>'\n\t\t\t\tvar hidden = '<span class=\"hidden-visually\">' + message + ' ' + escapeHTML(shareWithDisplayName) + '</span> '\n\t\t\t\treturn avatar + hidden\n\t\t\t}\n\n\t\t\tvar userName = parts[2]\n\t\t\tvar userDomain = parts[4]\n\t\t\tvar server = parts[5]\n\t\t\tvar protocol = parts[6]\n\t\t\tvar serverPath = parts[8] ? parts[7] : ''; // no trailing slash on root\n\n\t\t\tvar tooltip = message + ' ' + userName\n\t\t\tif (userDomain) {\n\t\t\t\ttooltip += '@' + userDomain\n\t\t\t}\n\t\t\tif (server) {\n\t\t\t\ttooltip += '@' + server.replace(protocol, '') + serverPath\n\t\t\t}\n\n\t\t\tvar html = '<span class=\"remoteAddress\" title=\"' + escapeHTML(tooltip) + '\">'\n\t\t\thtml += '<span class=\"username\">' + escapeHTML(userName) + '</span>'\n\t\t\tif (userDomain) {\n\t\t\t\thtml += '<span class=\"userDomain\">@' + escapeHTML(userDomain) + '</span>'\n\t\t\t}\n\t\t\thtml += '</span> '\n\t\t\treturn html\n\t\t},\n\t\t/**\n\t\t * Loop over all recipients in the list and format them using\n\t\t * all kind of fancy magic.\n\t\t *\n\t\t* @param {Object} recipients array of all the recipients\n\t\t* @returns {String[]} modified list of recipients\n\t\t*/\n\t\t_formatShareList: function(recipients) {\n\t\t\tvar _parent = this\n\t\t\trecipients = _.toArray(recipients)\n\t\t\trecipients.sort(function(a, b) {\n\t\t\t\treturn a.shareWithDisplayName.localeCompare(b.shareWithDisplayName)\n\t\t\t})\n\t\t\treturn $.map(recipients, function(recipient) {\n\t\t\t\treturn _parent._formatRemoteShare(recipient.shareWith, recipient.shareWithDisplayName, t('files_sharing', 'Shared with'))\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Marks/unmarks a given file as shared by changing its action icon\n\t\t * and folder icon.\n\t\t *\n\t\t* @param $tr file element to mark as shared\n\t\t* @param hasShares whether shares are available\n\t\t* @param hasLink whether link share is available\n\t\t*/\n\t\tmarkFileAsShared: function($tr, hasShares, hasLink) {\n\t\t\tvar action = $tr.find('.fileactions .action[data-action=\"Share\"]')\n\t\t\tvar type = $tr.data('type')\n\t\t\tvar icon = action.find('.icon')\n\t\t\tvar message, recipients, avatars\n\t\t\tvar ownerId = $tr.attr('data-share-owner-id')\n\t\t\tvar owner = $tr.attr('data-share-owner')\n\t\t\tvar mountType = $tr.attr('data-mounttype')\n\t\t\tvar shareFolderIcon\n\t\t\tvar iconClass = 'icon-shared'\n\t\t\taction.removeClass('shared-style')\n\t\t\t// update folder icon\n\t\t\tif (type === 'dir' && (hasShares || hasLink || ownerId)) {\n\t\t\t\tif (typeof mountType !== 'undefined' && mountType !== 'shared-root' && mountType !== 'shared') {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-' + mountType)\n\t\t\t\t} else if (hasLink) {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-public')\n\t\t\t\t} else {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-shared')\n\t\t\t\t}\n\t\t\t\t$tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')')\n\t\t\t\t$tr.attr('data-icon', shareFolderIcon)\n\t\t\t} else if (type === 'dir') {\n\t\t\t\tvar isEncrypted = $tr.attr('data-e2eencrypted')\n\t\t\t\t// FIXME: duplicate of FileList._createRow logic for external folder,\n\t\t\t\t// need to refactor the icon logic into a single code path eventually\n\t\t\t\tif (isEncrypted === 'true') {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-encrypted')\n\t\t\t\t\t$tr.attr('data-icon', shareFolderIcon)\n\t\t\t\t} else if (mountType && mountType.indexOf('external') === 0) {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-external')\n\t\t\t\t\t$tr.attr('data-icon', shareFolderIcon)\n\t\t\t\t} else {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir')\n\t\t\t\t\t// back to default\n\t\t\t\t\t$tr.removeAttr('data-icon')\n\t\t\t\t}\n\t\t\t\t$tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')')\n\t\t\t}\n\t\t\t// update share action text / icon\n\t\t\tif (hasShares || ownerId) {\n\t\t\t\trecipients = $tr.data('share-recipient-data')\n\t\t\t\taction.addClass('shared-style')\n\n\t\t\t\tavatars = '<span>' + t('files_sharing', 'Shared') + '</span>'\n\t\t\t\t// even if reshared, only show \"Shared by\"\n\t\t\t\tif (ownerId) {\n\t\t\t\t\tmessage = t('files_sharing', 'Shared by')\n\t\t\t\t\tavatars = this._formatRemoteShare(ownerId, owner, message)\n\t\t\t\t} else if (recipients) {\n\t\t\t\t\tavatars = this._formatShareList(recipients)\n\t\t\t\t}\n\t\t\t\taction.html(avatars).prepend(icon)\n\n\t\t\t\tif (ownerId || recipients) {\n\t\t\t\t\tvar avatarElement = action.find('.avatar')\n\t\t\t\t\tavatarElement.each(function() {\n\t\t\t\t\t\t$(this).avatar($(this).data('username'), 32)\n\t\t\t\t\t})\n\t\t\t\t\taction.find('span[title]').tooltip({ placement: 'top' })\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taction.html('<span class=\"hidden-visually\">' + t('files_sharing', 'Shared') + '</span>').prepend(icon)\n\t\t\t}\n\t\t\tif (hasLink) {\n\t\t\t\ticonClass = 'icon-public'\n\t\t\t}\n\t\t\ticon.removeClass('icon-shared icon-public').addClass(iconClass)\n\t\t},\n\n\t\t/**\n\t\t * @param {Array} fileData\n\t\t * @returns {String}\n\t\t */\n\t\tgetSharePermissions: function(fileData) {\n\t\t\treturn fileData.sharePermissions\n\t\t}\n\t}\n})()\n\nOC.Plugins.register('OCA.Files.FileList', OCA.Sharing.Util)\n","import api from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./sharebreadcrumb.scss\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @copyright Copyright (c) 2016 Roeland Jago Douma <roeland@famdouma.nl>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n * @author Julius Härtl <jus@bitgrid.net>\n * @author Roeland Jago Douma <roeland@famdouma.nl>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport './share'\nimport './sharebreadcrumbview'\n\nimport './style/sharebreadcrumb.scss'\n\nimport './collaborationresourceshandler.js'\n\n// eslint-disable-next-line camelcase\n__webpack_public_path__ = OC.linkTo('files_sharing', 'js/dist/')\n// eslint-disable-next-line camelcase\n__webpack_nonce__ = btoa(OC.requestToken)\n\nwindow.OCA.Sharing = OCA.Sharing\n"],"sourceRoot":""} \ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./apps/files_sharing/src/collaborationresourceshandler.js","webpack:///./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack:///./node_modules/css-loader/dist/runtime/cssWithMappingToString.js","webpack:///./node_modules/css-loader/dist/runtime/api.js","webpack:///./apps/files_sharing/src/style/sharebreadcrumb.scss","webpack:///./apps/files_sharing/src/sharebreadcrumbview.js","webpack:///./node_modules/escape-html/index.js","webpack:///./apps/files_sharing/src/share.js","webpack:///./apps/files_sharing/src/style/sharebreadcrumb.scss?a9a3","webpack:///./apps/files_sharing/src/additionalScripts.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","__webpack_public_path__","OC","linkTo","__webpack_nonce__","btoa","requestToken","window","OCP","Collaboration","registerType","action","Promise","resolve","reject","dialogs","filepicker","f","Files","getClient","getFileInfo","then","status","fileInfo","id","fail","Error","FILEPICKER_TYPE_CHOOSE","allowDirectoryChooser","typeString","typeIconClass","memo","isOldIE","Boolean","document","all","atob","getTarget","target","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","e","stylesInDom","getIndexByIdentifier","identifier","result","length","modulesToDom","list","options","idCountMap","identifiers","item","base","count","concat","index","obj","css","media","sourceMap","references","updater","push","addStyle","insertStyleElement","style","createElement","attributes","nonce","keys","forEach","setAttribute","insert","appendChild","textStore","replaceText","replacement","filter","join","applyToSingletonTag","remove","styleSheet","cssText","cssNode","createTextNode","childNodes","removeChild","insertBefore","applyToTag","removeAttribute","unescape","encodeURIComponent","JSON","stringify","firstChild","singleton","singletonCounter","update","styleIndex","parentNode","removeStyleElement","newObj","lastIdentifiers","newList","toString","newLastIdentifiers","_i","_index","splice","_slicedToArray","arr","Array","isArray","_arrayWithHoles","iterator","_s","_e","_arr","_n","_d","next","done","err","_iterableToArrayLimit","minLen","_arrayLikeToArray","slice","constructor","from","test","_unsupportedIterableToArray","TypeError","_nonIterableRest","len","arr2","_item","content","cssMapping","base64","data","sourceMapping","sourceURLs","sources","map","source","sourceRoot","cssWithMappingToString","this","mediaQuery","dedupe","alreadyImportedModules","___CSS_LOADER_EXPORT___","BreadCrumbView","Backbone","View","extend","tagName","events","click","_dirInfo","undefined","render","dirInfo","path","$el","removeClass","hide","isShared","shareTypes","addClass","indexOf","Share","SHARE_TYPE_LINK","show","delegateEvents","_onClick","preventDefault","stopPropagation","fileInfoModel","OCA","FileInfoModel","self","on","Sidebar","open","setActiveTab","Sharing","ShareBreadCrumbView","matchHtmlRegExp","string","escape","str","match","exec","html","lastIndex","charCodeAt","substring","_","Client","PROPERTY_SHARE_TYPES","NS_OWNCLOUD","PROPERTY_OWNER_ID","PROPERTY_OWNER_DISPLAY_NAME","Util","_REMOTE_OWNER_REGEXP","RegExp","attach","fileList","fileActions","oldCreateRow","_createRow","fileData","tr","apply","arguments","sharePermissions","getSharePermissions","permissions","actions","Comment","Details","Goto","attr","shareOwner","shareOwnerId","mountType","PERMISSION_UPDATE","recipientData","isEmpty","oldElementToFile","elementToFile","split","expirationTimestamp","parseInt","shares","expiration","oldGetWebdavProperties","_getWebdavProperties","props","filesClient","addFileInfoParser","response","propStat","properties","permissionsProp","PROPERTY_PERMISSIONS","shareTypesProp","chain","xmlvalue","namespaceURI","nodeName","textContent","text","ev","$files","each","file","$tr","$","hasLink","hasShares","shareType","SHARE_TYPE_EMAIL","SHARE_TYPE_USER","SHARE_TYPE_GROUP","SHARE_TYPE_REMOTE","SHARE_TYPE_REMOTE_GROUP","SHARE_TYPE_CIRCLE","SHARE_TYPE_ROOM","SHARE_TYPE_DECK","_updateFileActionIcon","sharesLoaded","registerAction","displayName","context","$file","altText","mime","order","PERMISSION_ALL","iconClass","fileName","icon","generateUrl","type","FileActions","TYPE_INLINE","actionHandler","_detailsView","isNaN","showDetailsView","actionSpec","isDefault","PERMISSION_SHARE","_defaultRenderAction","breadCrumbSharingDetailView","registerBreadCrumbDetailView","_updateFileListDataAttributes","shareModel","pluck","mapObject","share","shareWith","share_with","shareWithDisplayName","share_with_displayname","removeAttr","hasUserShares","hasLinkShares","_markFileAsShared","message","recipients","avatars","shareFolderIcon","find","ownerId","owner","MimeType","getIconUrl","_formatRemoteShare","_formatShareList","prepend","avatar","tooltip","placement","parts","escapeHTML","userName","userDomain","server","protocol","serverPath","replace","_parent","toArray","sort","a","b","localeCompare","recipient","markFileAsShared","Plugins","register","locals"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBA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AAO2L,KAAK,iCAAmCnN,EAAE,gBAAiB,UAAY,WAAWmV,QAAQvC,GAE9FvB,IACHqB,EAAY,eAEbE,EAAKtH,YAAY,2BAA2BI,SAASgH,IAOtDhE,oBAAqB,SAASL,GAC7B,OAAOA,EAASI,mBAKnB1N,GAAGwV,QAAQC,SAAS,qBAAsBpK,IAAIO,QAAQkB,M,qCCvgBlD5J,EAAU,CAEd,OAAiB,OACjB,WAAoB,GAEP,IAAI,IAASA,GAIX,IAAQwS,O;;;;;;;;;;;;;;;;;;;;;;;;ACoBvB3V,IAA0BC,GAAGC,OAAO,gBAAiB,YAErDC,KAAoBC,KAAKH,GAAGI,cAE5BC,OAAOgL,IAAIO,QAAUP,IAAIO","file":"additionalScripts.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/js/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 473);\n","/**\n * @copyright Copyright (c) 2016 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n * @author Julius Härtl <jus@bitgrid.net>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n// eslint-disable-next-line camelcase\n__webpack_public_path__ = OC.linkTo('files_sharing', 'js/dist/')\n// eslint-disable-next-line camelcase\n__webpack_nonce__ = btoa(OC.requestToken)\n\nwindow.OCP.Collaboration.registerType('file', {\n\taction: () => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tOC.dialogs.filepicker(t('files_sharing', 'Link to a file'), function(f) {\n\t\t\t\tconst client = OC.Files.getClient()\n\t\t\t\tclient.getFileInfo(f).then((status, fileInfo) => {\n\t\t\t\t\tresolve(fileInfo.id)\n\t\t\t\t}).fail(() => {\n\t\t\t\t\treject(new Error('Cannot get fileinfo'))\n\t\t\t\t})\n\t\t\t}, false, null, false, OC.dialogs.FILEPICKER_TYPE_CHOOSE, '', { allowDirectoryChooser: true })\n\t\t})\n\t},\n\ttypeString: t('files_sharing', 'Link to a file'),\n\ttypeIconClass: 'icon-files-dark',\n})\n","\"use strict\";\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n // tags it will allow on a page\n\n if (!options.singleton && typeof options.singleton !== 'boolean') {\n options.singleton = isOldIE();\n }\n\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n\n if (Object.prototype.toString.call(newList) !== '[object Array]') {\n return;\n }\n\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDom[index].references--;\n }\n\n var newLastIdentifiers = modulesToDom(newList, options);\n\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n\n var _index = getIndexByIdentifier(_identifier);\n\n if (stylesInDom[_index].references === 0) {\n stylesInDom[_index].updater();\n\n stylesInDom.splice(_index, 1);\n }\n }\n\n lastIdentifiers = newLastIdentifiers;\n };\n};","\"use strict\";\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nmodule.exports = function cssWithMappingToString(item) {\n var _item = _slicedToArray(item, 4),\n content = _item[1],\n cssMapping = _item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (typeof btoa === \"function\") {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || \"\").concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join(\"\\n\");\n }\n\n return [content].join(\"\\n\");\n};","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === \"string\") {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, \"\"]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"div.crumb span.icon-shared,div.crumb span.icon-public{display:inline-block;cursor:pointer;opacity:.2;margin-right:6px}div.crumb span.icon-shared.shared,div.crumb span.icon-public.shared{opacity:.7}\", \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files_sharing/src/style/sharebreadcrumb.scss\"],\"names\":[],\"mappings\":\"AAsBA,sDAEC,oBAAA,CACA,cAAA,CACA,UAAA,CACA,gBAAA,CAGD,oEAEC,UAAA\",\"sourcesContent\":[\"/**\\n * @copyright 2016 Christoph Wurst <christoph@winzerhof-wurst.at>\\n *\\n * @author 2016 Christoph Wurst <christoph@winzerhof-wurst.at>\\n *\\n * @license GNU AGPL version 3 or any later version\\n *\\n * This program is free software: you can redistribute it and/or modify\\n * it under the terms of the GNU Affero General Public License as\\n * published by the Free Software Foundation, either version 3 of the\\n * License, or (at your option) any later version.\\n *\\n * This program is distributed in the hope that it will be useful,\\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\\n * GNU Affero General Public License for more details.\\n *\\n * You should have received a copy of the GNU Affero General Public License\\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\\n *\\n */\\n\\ndiv.crumb span.icon-shared,\\ndiv.crumb span.icon-public {\\n\\tdisplay: inline-block;\\n\\tcursor: pointer;\\n\\topacity: 0.2;\\n\\tmargin-right: 6px;\\n}\\n\\ndiv.crumb span.icon-shared.shared,\\ndiv.crumb span.icon-public.shared {\\n\\topacity: 0.7;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","/**\n * @copyright 2016 Christoph Wurst <christoph@winzerhof-wurst.at>\n *\n * @author Christoph Wurst <christoph@winzerhof-wurst.at>\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n * @author Roeland Jago Douma <roeland@famdouma.nl>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n(function() {\n\t'use strict'\n\n\tconst BreadCrumbView = OC.Backbone.View.extend({\n\t\ttagName: 'span',\n\t\tevents: {\n\t\t\tclick: '_onClick',\n\t\t},\n\t\t_dirInfo: undefined,\n\n\t\trender(data) {\n\t\t\tthis._dirInfo = data.dirInfo || null\n\n\t\t\tif (this._dirInfo !== null && (this._dirInfo.path !== '/' || this._dirInfo.name !== '')) {\n\t\t\t\tconst isShared = data.dirInfo && data.dirInfo.shareTypes && data.dirInfo.shareTypes.length > 0\n\t\t\t\tthis.$el.removeClass('shared icon-public icon-shared')\n\t\t\t\tif (isShared) {\n\t\t\t\t\tthis.$el.addClass('shared')\n\t\t\t\t\tif (data.dirInfo.shareTypes.indexOf(OC.Share.SHARE_TYPE_LINK) !== -1) {\n\t\t\t\t\t\tthis.$el.addClass('icon-public')\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.$el.addClass('icon-shared')\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.$el.addClass('icon-shared')\n\t\t\t\t}\n\t\t\t\tthis.$el.show()\n\t\t\t\tthis.delegateEvents()\n\t\t\t} else {\n\t\t\t\tthis.$el.removeClass('shared icon-public icon-shared')\n\t\t\t\tthis.$el.hide()\n\t\t\t}\n\n\t\t\treturn this\n\t\t},\n\t\t_onClick(e) {\n\t\t\te.preventDefault()\n\t\t\te.stopPropagation()\n\n\t\t\tconst fileInfoModel = new OCA.Files.FileInfoModel(this._dirInfo)\n\t\t\tconst self = this\n\t\t\tfileInfoModel.on('change', function() {\n\t\t\t\tself.render({\n\t\t\t\t\tdirInfo: self._dirInfo,\n\t\t\t\t})\n\t\t\t})\n\n\t\t\tconst path = fileInfoModel.attributes.path + '/' + fileInfoModel.attributes.name\n\t\t\tOCA.Files.Sidebar.open(path)\n\t\t\tOCA.Files.Sidebar.setActiveTab('sharing')\n\t\t},\n\t})\n\n\tOCA.Sharing.ShareBreadCrumbView = BreadCrumbView\n})()\n","/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '&quot;';\n break;\n case 38: // &\n escape = '&amp;';\n break;\n case 39: // '\n escape = '&#39;';\n break;\n case 60: // <\n escape = '&lt;';\n break;\n case 62: // >\n escape = '&gt;';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n","/**\n * Copyright (c) 2014\n *\n * @author Arthur Schiwon <blizzz@arthur-schiwon.de>\n * @author Christoph Wurst <christoph@winzerhof-wurst.at>\n * @author Daniel Calviño Sánchez <danxuliu@gmail.com>\n * @author Joas Schilling <coding@schilljs.com>\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n * @author Julius Härtl <jus@bitgrid.net>\n * @author Maxence Lange <maxence@nextcloud.com>\n * @author Michael Jobst <mjobst+github@tecratech.de>\n * @author Michael Jobst <mjobst@necls.com>\n * @author Morris Jobke <hey@morrisjobke.de>\n * @author Roeland Jago Douma <roeland@famdouma.nl>\n * @author Samuel <faust64@gmail.com>\n * @author Vincent Petry <vincent@nextcloud.com>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n/* eslint-disable */\nimport escapeHTML from 'escape-html'\n\n(function() {\n\n\t_.extend(OC.Files.Client, {\n\t\tPROPERTY_SHARE_TYPES:\t'{' + OC.Files.Client.NS_OWNCLOUD + '}share-types',\n\t\tPROPERTY_OWNER_ID:\t'{' + OC.Files.Client.NS_OWNCLOUD + '}owner-id',\n\t\tPROPERTY_OWNER_DISPLAY_NAME:\t'{' + OC.Files.Client.NS_OWNCLOUD + '}owner-display-name'\n\t})\n\n\tif (!OCA.Sharing) {\n\t\tOCA.Sharing = {}\n\t}\n\n\t/**\n\t * @namespace\n\t */\n\tOCA.Sharing.Util = {\n\n\t\t/**\n\t\t * Regular expression for splitting parts of remote share owners:\n\t\t * \"user@example.com/\"\n\t\t * \"user@example.com/path/to/owncloud\"\n\t\t * \"user@anotherexample.com@example.com/path/to/owncloud\n\t\t */\n\t\t_REMOTE_OWNER_REGEXP: new RegExp('^(([^@]*)@(([^@^/\\\\s]*)@)?)((https://)?[^[\\\\s/]*)([/](.*))?$'),\n\n\t\t/**\n\t\t * Initialize the sharing plugin.\n\t\t *\n\t\t * Registers the \"Share\" file action and adds additional\n\t\t * DOM attributes for the sharing file info.\n\t\t *\n\t\t * @param {OCA.Files.FileList} fileList file list to be extended\n\t\t */\n\t\tattach: function(fileList) {\n\t\t\t// core sharing is disabled/not loaded\n\t\t\tif (!OC.Share) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (fileList.id === 'trashbin' || fileList.id === 'files.public') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tvar fileActions = fileList.fileActions\n\t\t\tvar oldCreateRow = fileList._createRow\n\t\t\tfileList._createRow = function(fileData) {\n\n\t\t\t\tvar tr = oldCreateRow.apply(this, arguments)\n\t\t\t\tvar sharePermissions = OCA.Sharing.Util.getSharePermissions(fileData)\n\n\t\t\t\tif (fileData.permissions === 0) {\n\t\t\t\t\t// no permission, disabling sidebar\n\t\t\t\t\tdelete fileActions.actions.all.Comment\n\t\t\t\t\tdelete fileActions.actions.all.Details\n\t\t\t\t\tdelete fileActions.actions.all.Goto\n\t\t\t\t}\n\t\t\t\ttr.attr('data-share-permissions', sharePermissions)\n\t\t\t\tif (fileData.shareOwner) {\n\t\t\t\t\ttr.attr('data-share-owner', fileData.shareOwner)\n\t\t\t\t\ttr.attr('data-share-owner-id', fileData.shareOwnerId)\n\t\t\t\t\t// user should always be able to rename a mount point\n\t\t\t\t\tif (fileData.mountType === 'shared-root') {\n\t\t\t\t\t\ttr.attr('data-permissions', fileData.permissions | OC.PERMISSION_UPDATE)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (fileData.recipientData && !_.isEmpty(fileData.recipientData)) {\n\t\t\t\t\ttr.attr('data-share-recipient-data', JSON.stringify(fileData.recipientData))\n\t\t\t\t}\n\t\t\t\tif (fileData.shareTypes) {\n\t\t\t\t\ttr.attr('data-share-types', fileData.shareTypes.join(','))\n\t\t\t\t}\n\t\t\t\treturn tr\n\t\t\t}\n\n\t\t\tvar oldElementToFile = fileList.elementToFile\n\t\t\tfileList.elementToFile = function($el) {\n\t\t\t\tvar fileInfo = oldElementToFile.apply(this, arguments)\n\t\t\t\tfileInfo.sharePermissions = $el.attr('data-share-permissions') || undefined\n\t\t\t\tfileInfo.shareOwner = $el.attr('data-share-owner') || undefined\n\t\t\t\tfileInfo.shareOwnerId = $el.attr('data-share-owner-id') || undefined\n\n\t\t\t\tif ($el.attr('data-share-types')) {\n\t\t\t\t\tfileInfo.shareTypes = $el.attr('data-share-types').split(',')\n\t\t\t\t}\n\n\t\t\t\tif ($el.attr('data-expiration')) {\n\t\t\t\t\tvar expirationTimestamp = parseInt($el.attr('data-expiration'))\n\t\t\t\t\tfileInfo.shares = []\n\t\t\t\t\tfileInfo.shares.push({ expiration: expirationTimestamp })\n\t\t\t\t}\n\n\t\t\t\treturn fileInfo\n\t\t\t}\n\n\t\t\tvar oldGetWebdavProperties = fileList._getWebdavProperties\n\t\t\tfileList._getWebdavProperties = function() {\n\t\t\t\tvar props = oldGetWebdavProperties.apply(this, arguments)\n\t\t\t\tprops.push(OC.Files.Client.PROPERTY_OWNER_ID)\n\t\t\t\tprops.push(OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME)\n\t\t\t\tprops.push(OC.Files.Client.PROPERTY_SHARE_TYPES)\n\t\t\t\treturn props\n\t\t\t}\n\n\t\t\tfileList.filesClient.addFileInfoParser(function(response) {\n\t\t\t\tvar data = {}\n\t\t\t\tvar props = response.propStat[0].properties\n\t\t\t\tvar permissionsProp = props[OC.Files.Client.PROPERTY_PERMISSIONS]\n\n\t\t\t\tif (permissionsProp && permissionsProp.indexOf('S') >= 0) {\n\t\t\t\t\tdata.shareOwner = props[OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME]\n\t\t\t\t\tdata.shareOwnerId = props[OC.Files.Client.PROPERTY_OWNER_ID]\n\t\t\t\t}\n\n\t\t\t\tvar shareTypesProp = props[OC.Files.Client.PROPERTY_SHARE_TYPES]\n\t\t\t\tif (shareTypesProp) {\n\t\t\t\t\tdata.shareTypes = _.chain(shareTypesProp).filter(function(xmlvalue) {\n\t\t\t\t\t\treturn (xmlvalue.namespaceURI === OC.Files.Client.NS_OWNCLOUD && xmlvalue.nodeName.split(':')[1] === 'share-type')\n\t\t\t\t\t}).map(function(xmlvalue) {\n\t\t\t\t\t\treturn parseInt(xmlvalue.textContent || xmlvalue.text, 10)\n\t\t\t\t\t}).value()\n\t\t\t\t}\n\n\t\t\t\treturn data\n\t\t\t})\n\n\t\t\t// use delegate to catch the case with multiple file lists\n\t\t\tfileList.$el.on('fileActionsReady', function(ev) {\n\t\t\t\tvar $files = ev.$files\n\n\t\t\t\t_.each($files, function(file) {\n\t\t\t\t\tvar $tr = $(file)\n\t\t\t\t\tvar shareTypes = $tr.attr('data-share-types') || ''\n\t\t\t\t\tvar shareOwner = $tr.attr('data-share-owner')\n\t\t\t\t\tif (shareTypes || shareOwner) {\n\t\t\t\t\t\tvar hasLink = false\n\t\t\t\t\t\tvar hasShares = false\n\t\t\t\t\t\t_.each(shareTypes.split(',') || [], function(shareType) {\n\t\t\t\t\t\t\tshareType = parseInt(shareType, 10)\n\t\t\t\t\t\t\tif (shareType === OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\t\t\t\thasLink = true\n\t\t\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_EMAIL) {\n\t\t\t\t\t\t\t\thasLink = true\n\t\t\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_USER) {\n\t\t\t\t\t\t\t\thasShares = true\n\t\t\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\t\t\t\t\t\thasShares = true\n\t\t\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_REMOTE) {\n\t\t\t\t\t\t\t\thasShares = true\n\t\t\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_REMOTE_GROUP) {\n\t\t\t\t\t\t\t\thasShares = true\n\t\t\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_CIRCLE) {\n\t\t\t\t\t\t\t\thasShares = true\n\t\t\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_ROOM) {\n\t\t\t\t\t\t\t\thasShares = true\n\t\t\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_DECK) {\n\t\t\t\t\t\t\t\thasShares = true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\tOCA.Sharing.Util._updateFileActionIcon($tr, hasShares, hasLink)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\n\t\t\tfileList.$el.on('changeDirectory', function() {\n\t\t\t\tOCA.Sharing.sharesLoaded = false\n\t\t\t})\n\n\t\t\tfileActions.registerAction({\n\t\t\t\tname: 'Share',\n\t\t\t\tdisplayName: function(context) {\n\t\t\t\t\tif (context && context.$file) {\n\t\t\t\t\t\tvar shareType = parseInt(context.$file.data('share-types'), 10)\n\t\t\t\t\t\tvar shareOwner = context.$file.data('share-owner-id')\n\t\t\t\t\t\tif (shareType >= 0 || shareOwner) {\n\t\t\t\t\t\t\treturn t('files_sharing', 'Shared')\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn t('files_sharing', 'Share')\n\t\t\t\t},\n\t\t\t\taltText: t('files_sharing', 'Share'),\n\t\t\t\tmime: 'all',\n\t\t\t\torder: -150,\n\t\t\t\tpermissions: OC.PERMISSION_ALL,\n\t\t\t\ticonClass: function(fileName, context) {\n\t\t\t\t\tvar shareType = parseInt(context.$file.data('share-types'), 10)\n\t\t\t\t\tif (shareType === OC.Share.SHARE_TYPE_EMAIL\n\t\t\t\t\t\t|| shareType === OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\t\treturn 'icon-public'\n\t\t\t\t\t}\n\t\t\t\t\treturn 'icon-shared'\n\t\t\t\t},\n\t\t\t\ticon: function(fileName, context) {\n\t\t\t\t\tvar shareOwner = context.$file.data('share-owner-id')\n\t\t\t\t\tif (shareOwner) {\n\t\t\t\t\t\treturn OC.generateUrl(`/avatar/${shareOwner}/32`)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\ttype: OCA.Files.FileActions.TYPE_INLINE,\n\t\t\t\tactionHandler: function(fileName, context) {\n\t\t\t\t\t// details view disabled in some share lists\n\t\t\t\t\tif (!fileList._detailsView) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\t// do not open sidebar if permission is set and equal to 0\n\t\t\t\t\tvar permissions = parseInt(context.$file.data('share-permissions'), 10)\n\t\t\t\t\tif (isNaN(permissions) || permissions > 0) {\n\t\t\t\t\t\tfileList.showDetailsView(fileName, 'sharing')\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\trender: function(actionSpec, isDefault, context) {\n\t\t\t\t\tvar permissions = parseInt(context.$file.data('permissions'), 10)\n\t\t\t\t\t// if no share permissions but share owner exists, still show the link\n\t\t\t\t\tif ((permissions & OC.PERMISSION_SHARE) !== 0 || context.$file.attr('data-share-owner')) {\n\t\t\t\t\t\treturn fileActions._defaultRenderAction.call(fileActions, actionSpec, isDefault, context)\n\t\t\t\t\t}\n\t\t\t\t\t// don't render anything\n\t\t\t\t\treturn null\n\t\t\t\t}\n\t\t\t})\n\n\t\t\t// register share breadcrumbs component\n\t\t\tvar breadCrumbSharingDetailView = new OCA.Sharing.ShareBreadCrumbView()\n\t\t\tfileList.registerBreadCrumbDetailView(breadCrumbSharingDetailView)\n\t\t},\n\n\t\t/**\n\t\t * Update file list data attributes\n\t\t */\n\t\t_updateFileListDataAttributes: function(fileList, $tr, shareModel) {\n\t\t\t// files app current cannot show recipients on load, so we don't update the\n\t\t\t// icon when changed for consistency\n\t\t\tif (fileList.id === 'files') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tvar recipients = _.pluck(shareModel.get('shares'), 'share_with_displayname')\n\t\t\t// note: we only update the data attribute because updateIcon()\n\t\t\tif (recipients.length) {\n\t\t\t\tvar recipientData = _.mapObject(shareModel.get('shares'), function(share) {\n\t\t\t\t\treturn { shareWith: share.share_with, shareWithDisplayName: share.share_with_displayname }\n\t\t\t\t})\n\t\t\t\t$tr.attr('data-share-recipient-data', JSON.stringify(recipientData))\n\t\t\t} else {\n\t\t\t\t$tr.removeAttr('data-share-recipient-data')\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Update the file action share icon for the given file\n\t\t *\n\t\t * @param $tr file element of the file to update\n\t\t * @param {boolean} hasUserShares true if a user share exists\n\t\t * @param {boolean} hasLinkShares true if a link share exists\n\t\t *\n\t\t * @returns {boolean} true if the icon was set, false otherwise\n\t\t */\n\t\t_updateFileActionIcon: function($tr, hasUserShares, hasLinkShares) {\n\t\t\t// if the statuses are loaded already, use them for the icon\n\t\t\t// (needed when scrolling to the next page)\n\t\t\tif (hasUserShares || hasLinkShares || $tr.attr('data-share-recipient-data') || $tr.attr('data-share-owner')) {\n\t\t\t\tOCA.Sharing.Util._markFileAsShared($tr, true, hasLinkShares)\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\n\t\t/**\n\t\t * Marks/unmarks a given file as shared by changing its action icon\n\t\t * and folder icon.\n\t\t *\n\t\t * @param $tr file element to mark as shared\n\t\t * @param hasShares whether shares are available\n\t\t * @param hasLink whether link share is available\n\t\t */\n\t\t_markFileAsShared: function($tr, hasShares, hasLink) {\n\t\t\tvar action = $tr.find('.fileactions .action[data-action=\"Share\"]')\n\t\t\tvar type = $tr.data('type')\n\t\t\tvar icon = action.find('.icon')\n\t\t\tvar message, recipients, avatars\n\t\t\tvar ownerId = $tr.attr('data-share-owner-id')\n\t\t\tvar owner = $tr.attr('data-share-owner')\n\t\t\tvar mountType = $tr.attr('data-mounttype')\n\t\t\tvar shareFolderIcon\n\t\t\tvar iconClass = 'icon-shared'\n\t\t\taction.removeClass('shared-style')\n\t\t\t// update folder icon\n\t\t\tif (type === 'dir' && (hasShares || hasLink || ownerId)) {\n\t\t\t\tif (typeof mountType !== 'undefined' && mountType !== 'shared-root' && mountType !== 'shared') {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-' + mountType)\n\t\t\t\t} else if (hasLink) {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-public')\n\t\t\t\t} else {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-shared')\n\t\t\t\t}\n\t\t\t\t$tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')')\n\t\t\t\t$tr.attr('data-icon', shareFolderIcon)\n\t\t\t} else if (type === 'dir') {\n\t\t\t\tvar isEncrypted = $tr.attr('data-e2eencrypted')\n\t\t\t\t// FIXME: duplicate of FileList._createRow logic for external folder,\n\t\t\t\t// need to refactor the icon logic into a single code path eventually\n\t\t\t\tif (isEncrypted === 'true') {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-encrypted')\n\t\t\t\t\t$tr.attr('data-icon', shareFolderIcon)\n\t\t\t\t} else if (mountType && mountType.indexOf('external') === 0) {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-external')\n\t\t\t\t\t$tr.attr('data-icon', shareFolderIcon)\n\t\t\t\t} else {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir')\n\t\t\t\t\t// back to default\n\t\t\t\t\t$tr.removeAttr('data-icon')\n\t\t\t\t}\n\t\t\t\t$tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')')\n\t\t\t}\n\t\t\t// update share action text / icon\n\t\t\tif (hasShares || ownerId) {\n\t\t\t\trecipients = $tr.data('share-recipient-data')\n\t\t\t\taction.addClass('shared-style')\n\n\t\t\t\tavatars = '<span>' + t('files_sharing', 'Shared') + '</span>'\n\t\t\t\t// even if reshared, only show \"Shared by\"\n\t\t\t\tif (ownerId) {\n\t\t\t\t\tmessage = t('files_sharing', 'Shared by')\n\t\t\t\t\tavatars = OCA.Sharing.Util._formatRemoteShare(ownerId, owner, message)\n\t\t\t\t} else if (recipients) {\n\t\t\t\t\tavatars = OCA.Sharing.Util._formatShareList(recipients)\n\t\t\t\t}\n\t\t\t\taction.html(avatars).prepend(icon)\n\n\t\t\t\tif (ownerId || recipients) {\n\t\t\t\t\tvar avatarElement = action.find('.avatar')\n\t\t\t\t\tavatarElement.each(function() {\n\t\t\t\t\t\t$(this).avatar($(this).data('username'), 32)\n\t\t\t\t\t})\n\t\t\t\t\taction.find('span[title]').tooltip({ placement: 'top' })\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taction.html('<span class=\"hidden-visually\">' + t('files_sharing', 'Shared') + '</span>').prepend(icon)\n\t\t\t}\n\t\t\tif (hasLink) {\n\t\t\t\ticonClass = 'icon-public'\n\t\t\t}\n\t\t\ticon.removeClass('icon-shared icon-public').addClass(iconClass)\n\t\t},\n\t\t/**\n\t\t * Format a remote address\n\t\t *\n\t\t * @param {String} shareWith userid, full remote share, or whatever\n\t\t * @param {String} shareWithDisplayName\n\t\t * @param {String} message\n\t\t * @returns {String} HTML code to display\n\t\t */\n\t\t_formatRemoteShare: function(shareWith, shareWithDisplayName, message) {\n\t\t\tvar parts = OCA.Sharing.Util._REMOTE_OWNER_REGEXP.exec(shareWith)\n\t\t\tif (!parts || !parts[7]) {\n\t\t\t\t// display avatar of the user\n\t\t\t\tvar avatar = '<span class=\"avatar\" data-username=\"' + escapeHTML(shareWith) + '\" title=\"' + message + ' ' + escapeHTML(shareWithDisplayName) + '\"></span>'\n\t\t\t\tvar hidden = '<span class=\"hidden-visually\">' + message + ' ' + escapeHTML(shareWithDisplayName) + '</span> '\n\t\t\t\treturn avatar + hidden\n\t\t\t}\n\n\t\t\tvar userName = parts[2]\n\t\t\tvar userDomain = parts[4]\n\t\t\tvar server = parts[5]\n\t\t\tvar protocol = parts[6]\n\t\t\tvar serverPath = parts[8] ? parts[7] : ''; // no trailing slash on root\n\n\t\t\tvar tooltip = message + ' ' + userName\n\t\t\tif (userDomain) {\n\t\t\t\ttooltip += '@' + userDomain\n\t\t\t}\n\t\t\tif (server) {\n\t\t\t\ttooltip += '@' + server.replace(protocol, '') + serverPath\n\t\t\t}\n\n\t\t\tvar html = '<span class=\"remoteAddress\" title=\"' + escapeHTML(tooltip) + '\">'\n\t\t\thtml += '<span class=\"username\">' + escapeHTML(userName) + '</span>'\n\t\t\tif (userDomain) {\n\t\t\t\thtml += '<span class=\"userDomain\">@' + escapeHTML(userDomain) + '</span>'\n\t\t\t}\n\t\t\thtml += '</span> '\n\t\t\treturn html\n\t\t},\n\t\t/**\n\t\t * Loop over all recipients in the list and format them using\n\t\t * all kind of fancy magic.\n\t\t *\n\t\t* @param {Object} recipients array of all the recipients\n\t\t* @returns {String[]} modified list of recipients\n\t\t*/\n\t\t_formatShareList: function(recipients) {\n\t\t\tvar _parent = this\n\t\t\trecipients = _.toArray(recipients)\n\t\t\trecipients.sort(function(a, b) {\n\t\t\t\treturn a.shareWithDisplayName.localeCompare(b.shareWithDisplayName)\n\t\t\t})\n\t\t\treturn $.map(recipients, function(recipient) {\n\t\t\t\treturn _parent._formatRemoteShare(recipient.shareWith, recipient.shareWithDisplayName, t('files_sharing', 'Shared with'))\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Marks/unmarks a given file as shared by changing its action icon\n\t\t * and folder icon.\n\t\t *\n\t\t* @param $tr file element to mark as shared\n\t\t* @param hasShares whether shares are available\n\t\t* @param hasLink whether link share is available\n\t\t*/\n\t\tmarkFileAsShared: function($tr, hasShares, hasLink) {\n\t\t\tvar action = $tr.find('.fileactions .action[data-action=\"Share\"]')\n\t\t\tvar type = $tr.data('type')\n\t\t\tvar icon = action.find('.icon')\n\t\t\tvar message, recipients, avatars\n\t\t\tvar ownerId = $tr.attr('data-share-owner-id')\n\t\t\tvar owner = $tr.attr('data-share-owner')\n\t\t\tvar mountType = $tr.attr('data-mounttype')\n\t\t\tvar shareFolderIcon\n\t\t\tvar iconClass = 'icon-shared'\n\t\t\taction.removeClass('shared-style')\n\t\t\t// update folder icon\n\t\t\tif (type === 'dir' && (hasShares || hasLink || ownerId)) {\n\t\t\t\tif (typeof mountType !== 'undefined' && mountType !== 'shared-root' && mountType !== 'shared') {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-' + mountType)\n\t\t\t\t} else if (hasLink) {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-public')\n\t\t\t\t} else {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-shared')\n\t\t\t\t}\n\t\t\t\t$tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')')\n\t\t\t\t$tr.attr('data-icon', shareFolderIcon)\n\t\t\t} else if (type === 'dir') {\n\t\t\t\tvar isEncrypted = $tr.attr('data-e2eencrypted')\n\t\t\t\t// FIXME: duplicate of FileList._createRow logic for external folder,\n\t\t\t\t// need to refactor the icon logic into a single code path eventually\n\t\t\t\tif (isEncrypted === 'true') {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-encrypted')\n\t\t\t\t\t$tr.attr('data-icon', shareFolderIcon)\n\t\t\t\t} else if (mountType && mountType.indexOf('external') === 0) {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-external')\n\t\t\t\t\t$tr.attr('data-icon', shareFolderIcon)\n\t\t\t\t} else {\n\t\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir')\n\t\t\t\t\t// back to default\n\t\t\t\t\t$tr.removeAttr('data-icon')\n\t\t\t\t}\n\t\t\t\t$tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')')\n\t\t\t}\n\t\t\t// update share action text / icon\n\t\t\tif (hasShares || ownerId) {\n\t\t\t\trecipients = $tr.data('share-recipient-data')\n\t\t\t\taction.addClass('shared-style')\n\n\t\t\t\tavatars = '<span>' + t('files_sharing', 'Shared') + '</span>'\n\t\t\t\t// even if reshared, only show \"Shared by\"\n\t\t\t\tif (ownerId) {\n\t\t\t\t\tmessage = t('files_sharing', 'Shared by')\n\t\t\t\t\tavatars = this._formatRemoteShare(ownerId, owner, message)\n\t\t\t\t} else if (recipients) {\n\t\t\t\t\tavatars = this._formatShareList(recipients)\n\t\t\t\t}\n\t\t\t\taction.html(avatars).prepend(icon)\n\n\t\t\t\tif (ownerId || recipients) {\n\t\t\t\t\tvar avatarElement = action.find('.avatar')\n\t\t\t\t\tavatarElement.each(function() {\n\t\t\t\t\t\t$(this).avatar($(this).data('username'), 32)\n\t\t\t\t\t})\n\t\t\t\t\taction.find('span[title]').tooltip({ placement: 'top' })\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taction.html('<span class=\"hidden-visually\">' + t('files_sharing', 'Shared') + '</span>').prepend(icon)\n\t\t\t}\n\t\t\tif (hasLink) {\n\t\t\t\ticonClass = 'icon-public'\n\t\t\t}\n\t\t\ticon.removeClass('icon-shared icon-public').addClass(iconClass)\n\t\t},\n\n\t\t/**\n\t\t * @param {Array} fileData\n\t\t * @returns {String}\n\t\t */\n\t\tgetSharePermissions: function(fileData) {\n\t\t\treturn fileData.sharePermissions\n\t\t}\n\t}\n})()\n\nOC.Plugins.register('OCA.Files.FileList', OCA.Sharing.Util)\n","import api from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./sharebreadcrumb.scss\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @copyright Copyright (c) 2016 Roeland Jago Douma <roeland@famdouma.nl>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n * @author Julius Härtl <jus@bitgrid.net>\n * @author Roeland Jago Douma <roeland@famdouma.nl>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport './share'\nimport './sharebreadcrumbview'\n\nimport './style/sharebreadcrumb.scss'\n\nimport './collaborationresourceshandler.js'\n\n// eslint-disable-next-line camelcase\n__webpack_public_path__ = OC.linkTo('files_sharing', 'js/dist/')\n// eslint-disable-next-line camelcase\n__webpack_nonce__ = btoa(OC.requestToken)\n\nwindow.OCA.Sharing = OCA.Sharing\n"],"sourceRoot":""} \ No newline at end of file
diff --git a/apps/files_sharing/js/dist/files_sharing.js b/apps/files_sharing/js/dist/files_sharing.js
index 2ffcc71ccdb..aecaee16430 100644
--- a/apps/files_sharing/js/dist/files_sharing.js
+++ b/apps/files_sharing/js/dist/files_sharing.js
@@ -21,5 +21,5 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-t.nc=btoa(OC.requestToken),t.p=OC.linkTo("files_sharing","js/dist/")},467:function(e,i){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('<div class="icon-shared"></div><h2>'+t("files_sharing","Nothing shared with you yet")+"</h2><p>"+t("files_sharing","Files and folders others share with you will show up here")+"</p>")),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('<div class="icon-shared"></div><h2>'+t("files_sharing","Nothing shared yet")+"</h2><p>"+t("files_sharing","Files and folders you share will show up here")+"</p>")),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('<div class="icon-public"></div><h2>'+t("files_sharing","No shared links")+"</h2><p>"+t("files_sharing","Files and folders you share by link will show up here")+"</p>")),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('<div class="icon-share"></div><h2>'+t("files_sharing","No deleted shares")+"</h2><p>"+t("files_sharing","Shares you deleted will show up here")+"</p>")),this._deletedFileList},initSharingPening:function(e){return this._pendingFileList||(this._pendingFileList=new OCA.Sharing.FileList(e,{id:"shares.pending",showPending:!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('<div class="icon-share"></div><h2>'+t("files_sharing","No pending shares")+"</h2><p>"+t("files_sharing","Shares you have received but not confirmed will show up here")+"</p>")),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('<div class="icon-share"></div><h2>'+t("files_sharing","No shares")+"</h2><p>"+t("files_sharing","Shares will show up here")+"</p>")),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");$.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,actionHandler:function(e,i){var s=i.$file.data("shareId");$.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()}))}))},468:function(e,i){var s;(s=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)),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,o=Math.round((n-(new Date).getTime())/1e3/60/60/24*5);o>=160&&(o=160),n>0?(a=OC.Util.formatDate(n),r=OC.Util.relativeModifiedDate(n)):(a=t("files_sharing","No expiration date set"),r="",o=160),td=$("<td></td>").attr({class:"date"}),td.append($("<span></span>").attr({class:"modified",title:a,style:"color:rgb("+o+","+o+","+o+")"}).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")+"shares",data:{format:"json",shared_with_me:!1!==this._sharedWithUser,include_tags:!0},type:"GET",beforeSend:function(e){e.setRequestHeader("OCS-APIREQUEST","true")}},n={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)),(!1!==this._sharedWithUser||this._isOverview)&&e.push($.ajax(n)),this._isOverview&&(s.data.shared_with_me=!s.data.shared_with_me,e.push($.ajax(s)))),this._reloadCall=$.when.apply($,e);var a=this.reloadCallback.bind(this);return this._reloadCall.then(a,a)},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=n.concat(this._makeFilesFromShares(s.ocs.data,!this._sharedWithUser))),this.setFiles(n),!0},_makeFilesFromRemoteShares:function(e){var i=e;return i=_.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,id:e.file_id,path:OC.dirname(e.mountpoint),permissions:e.permissions,tags:e.tags||[]};return 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()).sort(this._sortComparator)}}),OCA.Sharing.FileList=s}});
+t.nc=btoa(OC.requestToken),t.p=OC.linkTo("files_sharing","js/dist/")},467:function(e,i){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('<div class="icon-shared"></div><h2>'+t("files_sharing","Nothing shared with you yet")+"</h2><p>"+t("files_sharing","Files and folders others share with you will show up here")+"</p>")),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('<div class="icon-shared"></div><h2>'+t("files_sharing","Nothing shared yet")+"</h2><p>"+t("files_sharing","Files and folders you share will show up here")+"</p>")),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('<div class="icon-public"></div><h2>'+t("files_sharing","No shared links")+"</h2><p>"+t("files_sharing","Files and folders you share by link will show up here")+"</p>")),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('<div class="icon-share"></div><h2>'+t("files_sharing","No deleted shares")+"</h2><p>"+t("files_sharing","Shares you deleted will show up here")+"</p>")),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('<div class="icon-share"></div><h2>'+t("files_sharing","No pending shares")+"</h2><p>"+t("files_sharing","Shares you have received but not confirmed will show up here")+"</p>")),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('<div class="icon-share"></div><h2>'+t("files_sharing","No shares")+"</h2><p>"+t("files_sharing","Shares will show up here")+"</p>")),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"),n="shares/pending";i.$file.attr("data-remote-id")&&(n="remote_shares/pending"),$.post(OC.linkToOCS("apps/files_sharing/api/v1/"+n,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"),n="shares";i.$file.attr("data-remote-id")&&(n="remote_shares/pending"),$.ajax({url:OC.linkToOCS("apps/files_sharing/api/v1/"+n,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()}))}))},468:function(e,i){var s;(s=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,o=Math.round((n-(new Date).getTime())/1e3/60/60/24*5);o>=160&&(o=160),n>0?(a=OC.Util.formatDate(n),r=OC.Util.relativeModifiedDate(n)):(a=t("files_sharing","No expiration date set"),r="",o=160),td=$("<td></td>").attr({class:"date"}),td.append($("<span></span>").attr({class:"modified",title:a,style:"color:rgb("+o+","+o+","+o+")"}).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 i=_.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()).sort(this._sortComparator)}}),OCA.Sharing.FileList=s}});
//# sourceMappingURL=files_sharing.js.map \ No newline at end of file
diff --git a/apps/files_sharing/js/dist/files_sharing.js.map b/apps/files_sharing/js/dist/files_sharing.js.map
index 6569b3a2b6d..2ee4a80fd47 100644
--- a/apps/files_sharing/js/dist/files_sharing.js.map
+++ b/apps/files_sharing/js/dist/files_sharing.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./apps/files_sharing/src/files_sharing.js","webpack:///./apps/files_sharing/js/app.js","webpack:///./apps/files_sharing/js/sharedfilelist.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","__webpack_nonce__","btoa","OC","requestToken","__webpack_public_path__","linkTo","OCA","Sharing","App","_inFileList","_outFileList","_overviewFileList","_pendingFileList","initSharingIn","$el","this","FileList","id","sharedWithUser","fileActions","_createFileActions","config","Files","getFilesConfig","shown","_extendFileList","appName","find","html","initSharingOut","initSharingLinks","_linkFileList","linksOnly","initSharingDeleted","_deletedFileList","defaultFileActionsDisabled","showDeleted","_restoreShareAction","initSharingPening","showPending","_acceptShareAction","initShareingOverview","isOverview","removeSharingIn","$fileList","empty","removeSharingOut","removeSharingLinks","removeSharingDeleted","removeSharingPending","removeSharingOverview","destroy","off","_onActionsUpdated","_globalActionsInitialized","FileActions","registerDefaultActions","merge","_","on","register","PERMISSION_READ","filename","context","setActiveView","silent","fileList","changeDirectory","joinPaths","$file","attr","setDefault","registerAction","displayName","altText","mime","permissions","PERMISSION_ALL","iconClass","type","TYPE_INLINE","actionHandler","fileName","shareId","data","$","post","linkToOCS","success","result","remove","fileInfoModel","attributes","fail","Notification","showTemporary","ajax","url","ev","each","list","action","defaultAction","fileSummary","window","addEventListener","e","target","options","initialize","extend","_sharedWithUser","_linksOnly","_showDeleted","_showPending","_clientSideSort","_allowSelection","_isOverview","apply","arguments","initialized","_renderRow","_createRow","fileData","$tr","before","children","pluck","shares","join","shareOwner","permission","parseInt","PERMISSION_DELETE","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","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","file_id","path","dirname","tags","Share","SHARE_TYPE_REMOTE","filter","share_type","SHARE_TYPE_LINK","file_source","icon","MimeType","getIconUrl","hasPreview","has_preview","item_type","share_with","stime","displayname_owner","shareOwnerId","uid_owner","file_target","extraData","targetDisplayName","share_with_displayname","targetShareWithId","reduce","memo","recipient","recipientId","recipients","recipientData","shareTypes","recipientsCount","values","mountType","keys","sort","_sortComparator"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClC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BtJ,EAAKuJ,WAAa,GAElBvJ,EAAKwJ,gBAAkB,EACvBxJ,EAAKqH,MAAQN,EAAKD,MAAM0B,OASrBW,IAECnJ,EAAKwJ,gBAAkB,IAG1BxJ,EAAKqJ,WAAWF,IAAa,EAC7BnJ,EAAKsJ,cAActJ,EAAKwJ,iBAAmB,CAC1C,UAAaJ,EACb,qBAAwBD,IAG1BnJ,EAAKwJ,mBAGNxJ,EAAKuJ,WAAWxC,EAAKD,MAAMnH,OAAQ,SAE5BoH,EAAKD,MACLoC,IACL,IAEFO,SAEA1I,MAAK,SAASf,GAGdA,EAAK0J,UAAY,gBACV1J,EAAKwJ,gBACR1N,SAEIkE,EAAKuJ,WAEZvJ,EAAKuJ,WAAajL,EAAEqL,KAAK3J,EAAKuJ,eAI/B1P,SAGW+P,KAAKjO,KAAKkO,oBA0C1B3O,IAAIC,QAAQS,SAAWA","file":"files_sharing.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/js/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 466);\n","/**\n * @copyright Copyright (c) 2016 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n * @author Julius Härtl <jus@bitgrid.net>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport '../js/app'\nimport '../js/sharedfilelist'\n\n// eslint-disable-next-line camelcase\n__webpack_nonce__ = btoa(OC.requestToken)\n\n// eslint-disable-next-line camelcase\n__webpack_public_path__ = OC.linkTo('files_sharing', 'js/dist/')\n","/**\n * Copyright (c) 2014 Vincent Petry <pvince81@owncloud.com>\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('<div class=\"icon-shared\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'Nothing shared with you yet') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Files and folders others share with you will show up here') + '</p>')\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('<div class=\"icon-shared\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'Nothing shared yet') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Files and folders you share will show up here') + '</p>')\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('<div class=\"icon-public\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'No shared links') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Files and folders you share by link will show up here') + '</p>')\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('<div class=\"icon-share\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'No deleted shares') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Shares you deleted will show up here') + '</p>')\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\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('<div class=\"icon-share\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'No pending shares') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Shares you have received but not confirmed will show up here') + '</p>')\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('<div class=\"icon-share\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'No shares') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Shares will show up here') + '</p>')\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\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\tactionHandler(fileName, context) {\n\t\t\t\tconst shareId = context.$file.data('shareId')\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 <pvince81@owncloud.com>\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\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 = $('<td></td>').attr({ 'class': 'date' })\n\t\t\t\t\ttd.append($('<span></span>').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 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} 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\tfiles = files.concat(this._makeFilesFromShares(additionalShares.ocs.data, !this._sharedWithUser))\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\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\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 {bool} sharedWithUser\n\t\t * @returns {Array.<OCA.Sharing.SharedFileInfo>} 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 {int} id share ID\n\t * @property {int} type share type\n\t * @property {String} target share target, either user name or group name\n\t * @property {int} 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.<OCA.Sharing.ShareInfo>} shares array of shares for\n\t * this file\n\t * @property {int} mtime most recent share time (if multiple shares)\n\t * @property {String} shareOwner name of the share owner\n\t * @property {Array.<String>} recipients name of the first 4 recipients\n\t * (this is mostly for display purposes)\n\t * @property {Object.<OCA.Sharing.RecipientInfo>} recipientData (as object for easier\n\t * passing to HTML data attributes with jQuery)\n\t */\n\n\tOCA.Sharing.FileList = FileList\n})()\n"],"sourceRoot":""} \ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./apps/files_sharing/src/files_sharing.js","webpack:///./apps/files_sharing/js/app.js","webpack:///./apps/files_sharing/js/sharedfilelist.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","__webpack_nonce__","btoa","OC","requestToken","__webpack_public_path__","linkTo","OCA","Sharing","App","_inFileList","_outFileList","_overviewFileList","_pendingFileList","initSharingIn","$el","this","FileList","id","sharedWithUser","fileActions","_createFileActions","config","Files","getFilesConfig","shown","_extendFileList","appName","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","_","on","register","PERMISSION_READ","filename","context","setActiveView","silent","fileList","changeDirectory","joinPaths","$file","attr","setDefault","registerAction","displayName","altText","mime","permissions","PERMISSION_ALL","iconClass","type","TYPE_INLINE","actionHandler","fileName","shareId","data","$","post","linkToOCS","success","result","remove","fileInfoModel","attributes","fail","Notification","showTemporary","shareBase","shouldRender","parseInt","Share","SHARE_TYPE_REMOTE_GROUP","ajax","url","ev","each","list","action","defaultAction","fileSummary","window","addEventListener","e","target","options","initialize","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","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"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF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6J,WAAWF,IAAa,EAC7B3J,EAAK8J,cAAc9J,EAAKgK,iBAAmB,CAC1C,UAAaJ,EACb,qBAAwBD,IAG1B3J,EAAKgK,mBAGNhK,EAAK+J,WAAWzC,EAAKD,MAAM1H,OAAQ,SAE5B2H,EAAKD,MACLqC,IACL,IAEFO,SAEA7I,MAAK,SAASpB,GAGdA,EAAKkK,UAAY,gBACVlK,EAAKgK,gBACRnO,SAEImE,EAAK+J,WAEZ/J,EAAK+J,WAAazL,EAAE6L,KAAKnK,EAAK+J,eAI/BnQ,SAGWwQ,KAAK1O,KAAK2O,oBA0C1BpP,IAAIC,QAAQS,SAAWA","file":"files_sharing.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/js/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 466);\n","/**\n * @copyright Copyright (c) 2016 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n * @author Julius Härtl <jus@bitgrid.net>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport '../js/app'\nimport '../js/sharedfilelist'\n\n// eslint-disable-next-line camelcase\n__webpack_nonce__ = btoa(OC.requestToken)\n\n// eslint-disable-next-line camelcase\n__webpack_public_path__ = OC.linkTo('files_sharing', 'js/dist/')\n","/**\n * Copyright (c) 2014 Vincent Petry <pvince81@owncloud.com>\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('<div class=\"icon-shared\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'Nothing shared with you yet') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Files and folders others share with you will show up here') + '</p>')\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('<div class=\"icon-shared\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'Nothing shared yet') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Files and folders you share will show up here') + '</p>')\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('<div class=\"icon-public\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'No shared links') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Files and folders you share by link will show up here') + '</p>')\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('<div class=\"icon-share\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'No deleted shares') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Shares you deleted will show up here') + '</p>')\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('<div class=\"icon-share\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'No pending shares') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Shares you have received but not confirmed will show up here') + '</p>')\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('<div class=\"icon-share\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'No shares') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Shares will show up here') + '</p>')\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/' + shareBase, 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/' + shareBase, 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 <pvince81@owncloud.com>\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 = $('<td></td>').attr({ 'class': 'date' })\n\t\t\t\t\ttd.append($('<span></span>').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 {bool} sharedWithUser\n\t\t * @returns {Array.<OCA.Sharing.SharedFileInfo>} 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 {int} id share ID\n\t * @property {int} type share type\n\t * @property {String} target share target, either user name or group name\n\t * @property {int} 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.<OCA.Sharing.ShareInfo>} shares array of shares for\n\t * this file\n\t * @property {int} mtime most recent share time (if multiple shares)\n\t * @property {String} shareOwner name of the share owner\n\t * @property {Array.<String>} recipients name of the first 4 recipients\n\t * (this is mostly for display purposes)\n\t * @property {Object.<OCA.Sharing.RecipientInfo>} recipientData (as object for easier\n\t * passing to HTML data attributes with jQuery)\n\t */\n\n\tOCA.Sharing.FileList = FileList\n})()\n"],"sourceRoot":""} \ No newline at end of file
diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js
index 962f8a16915..4e364f92077 100644
--- a/apps/files_sharing/js/sharedfilelist.js
+++ b/apps/files_sharing/js/sharedfilelist.js
@@ -96,6 +96,14 @@
$tr.attr('data-share-permissions', permission)
}
+ if (fileData.remoteId) {
+ $tr.attr('data-remote-id', fileData.remoteId)
+ }
+
+ if (fileData.shareType) {
+ $tr.attr('data-share-type', fileData.shareType)
+ }
+
// add row with expiration date for link only shares - influenced by _createRow of filelist
if (this._linksOnly) {
var expirationTimestamp = 0
@@ -212,6 +220,18 @@
}
}
+ var pendingRemoteShares = {
+ url: OC.linkToOCS('apps/files_sharing/api/v1/remote_shares', 2) + 'pending',
+ /* jshint camelcase: false */
+ data: {
+ format: 'json'
+ },
+ type: 'GET',
+ beforeSend: function(xhr) {
+ xhr.setRequestHeader('OCS-APIREQUEST', 'true')
+ }
+ }
+
var shares = {
url: OC.linkToOCS('apps/files_sharing/api/v1') + 'shares',
/* jshint camelcase: false */
@@ -245,6 +265,7 @@
promises.push($.ajax(deletedShares))
} else if (this._showPending) {
promises.push($.ajax(pendingShares))
+ promises.push($.ajax(pendingRemoteShares))
} else {
promises.push($.ajax(shares))
@@ -292,7 +313,12 @@
}
if (additionalShares && additionalShares.ocs && additionalShares.ocs.data) {
- files = files.concat(this._makeFilesFromShares(additionalShares.ocs.data, !this._sharedWithUser))
+ if (this._showPending) {
+ // in this case the second callback is about pending remote shares
+ files = files.concat(this._makeFilesFromRemoteShares(additionalShares.ocs.data))
+ } else {
+ files = files.concat(this._makeFilesFromShares(additionalShares.ocs.data, !this._sharedWithUser))
+ }
}
this.setFiles(files)
@@ -311,12 +337,29 @@
mtime: share.mtime * 1000,
mimetype: share.mimetype,
type: share.type,
+ // remote share types are different and need to be mapped
+ shareType: (parseInt(share.share_type, 10) === 1) ? OC.Share.SHARE_TYPE_REMOTE_GROUP : OC.Share.SHARE_TYPE_REMOTE,
id: share.file_id,
path: OC.dirname(share.mountpoint),
permissions: share.permissions,
tags: share.tags || []
}
+ if (share.remote_id) {
+ // remote share
+ if (share.accepted !== '1') {
+ file.name = OC.basename(share.name)
+ file.path = '/'
+ }
+ file.remoteId = share.remote_id
+ file.shareOwnerId = share.owner
+ }
+
+ if (!file.mimetype) {
+ // pending shares usually have no type, so default to showing a directory icon
+ file.mimetype = 'dir-shared'
+ }
+
file.shares = [{
id: share.id,
type: OC.Share.SHARE_TYPE_REMOTE
diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php
index 7f234e63660..2dfbe4d86a5 100644
--- a/apps/files_sharing/lib/AppInfo/Application.php
+++ b/apps/files_sharing/lib/AppInfo/Application.php
@@ -60,6 +60,7 @@ use OCP\Share\Events\ShareCreatedEvent;
use OCP\Share\IManager;
use OCP\Util;
use Psr\Container\ContainerInterface;
+use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
@@ -98,7 +99,8 @@ class Application extends App {
$server->getGroupManager(),
$server->getUserManager(),
$uid,
- $server->query(IEventDispatcher::class)
+ $server->query(IEventDispatcher::class),
+ $server->get(LoggerInterface::class)
);
});
diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php
index e51bd64cf38..f9ef35b558c 100644
--- a/apps/files_sharing/lib/External/Manager.php
+++ b/apps/files_sharing/lib/External/Manager.php
@@ -14,6 +14,7 @@
* @author Robin Appelman <robin@icewind.nl>
* @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Stefan Weil <sw@weilnetz.de>
+ * @author Vincent Petry <vincent@nextcloud.com>
*
* @license AGPL-3.0
*
@@ -36,6 +37,7 @@ use Doctrine\DBAL\Driver\Exception;
use OC\Files\Filesystem;
use OCA\FederatedFileSharing\Events\FederatedShareAddedEvent;
use OCA\Files_Sharing\Helper;
+use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Federation\ICloudFederationFactory;
use OCP\Federation\ICloudFederationProviderManager;
@@ -49,6 +51,7 @@ use OCP\Notification\IManager;
use OCP\OCS\IDiscoveryService;
use OCP\Share;
use OCP\Share\IShare;
+use Psr\Log\LoggerInterface;
class Manager {
public const STORAGE = '\OCA\Files_Sharing\External\Storage';
@@ -89,18 +92,24 @@ class Manager {
/** @var IEventDispatcher */
private $eventDispatcher;
- public function __construct(IDBConnection $connection,
- \OC\Files\Mount\Manager $mountManager,
- IStorageFactory $storageLoader,
- IClientService $clientService,
- IManager $notificationManager,
- IDiscoveryService $discoveryService,
- ICloudFederationProviderManager $cloudFederationProviderManager,
- ICloudFederationFactory $cloudFederationFactory,
- IGroupManager $groupManager,
- IUserManager $userManager,
- ?string $uid,
- IEventDispatcher $eventDispatcher) {
+ /** @var LoggerInterface */
+ private $logger;
+
+ public function __construct(
+ IDBConnection $connection,
+ \OC\Files\Mount\Manager $mountManager,
+ IStorageFactory $storageLoader,
+ IClientService $clientService,
+ IManager $notificationManager,
+ IDiscoveryService $discoveryService,
+ ICloudFederationProviderManager $cloudFederationProviderManager,
+ ICloudFederationFactory $cloudFederationFactory,
+ IGroupManager $groupManager,
+ IUserManager $userManager,
+ ?string $uid,
+ IEventDispatcher $eventDispatcher,
+ LoggerInterface $logger
+ ) {
$this->connection = $connection;
$this->mountManager = $mountManager;
$this->storageLoader = $storageLoader;
@@ -113,6 +122,7 @@ class Manager {
$this->groupManager = $groupManager;
$this->userManager = $userManager;
$this->eventDispatcher = $eventDispatcher;
+ $this->logger = $logger;
}
/**
@@ -218,7 +228,7 @@ class Manager {
* @param int $id share id
* @return mixed share of false
*/
- public function getShare($id) {
+ private function fetchShare($id) {
$getShare = $this->connection->prepare('
SELECT `id`, `remote`, `remote_id`, `share_token`, `name`, `owner`, `user`, `mountpoint`, `accepted`, `parent`, `share_type`, `password`, `mountpoint_hash`
FROM `*PREFIX*share_external`
@@ -226,14 +236,46 @@ class Manager {
$result = $getShare->execute([$id]);
$share = $result->fetch();
$result->closeCursor();
+ return $share;
+ }
+
+ private function fetchUserShare($parentId, $uid) {
+ $getShare = $this->connection->prepare('
+ SELECT `id`, `remote`, `remote_id`, `share_token`, `name`, `owner`, `user`, `mountpoint`, `accepted`, `parent`, `share_type`, `password`, `mountpoint_hash`
+ FROM `*PREFIX*share_external`
+ WHERE `parent` = ? AND `user` = ?');
+ $result = $getShare->execute([$parentId, $uid]);
+ $share = $result->fetch();
+ $result->closeCursor();
+ if ($share !== false) {
+ return $share;
+ }
+ return null;
+ }
+
+ /**
+ * get share
+ *
+ * @param int $id share id
+ * @return mixed share of false
+ */
+ public function getShare($id) {
+ $share = $this->fetchShare($id);
$validShare = is_array($share) && isset($share['share_type']) && isset($share['user']);
// check if the user is allowed to access it
if ($validShare && (int)$share['share_type'] === IShare::TYPE_USER && $share['user'] === $this->uid) {
return $share;
} elseif ($validShare && (int)$share['share_type'] === IShare::TYPE_GROUP) {
+ $parentId = (int)$share['parent'];
+ if ($parentId !== -1) {
+ // we just retrieved a sub-share, switch to the parent entry for verification
+ $groupShare = $this->fetchShare($parentId);
+ } else {
+ $groupShare = $share;
+ }
$user = $this->userManager->get($this->uid);
- if ($this->groupManager->get($share['user'])->inGroup($user)) {
+ if ($this->groupManager->get($groupShare['user'])->inGroup($user)) {
return $share;
}
}
@@ -242,6 +284,20 @@ class Manager {
}
/**
+ * Updates accepted flag in the database
+ *
+ * @param int $id
+ */
+ private function updateAccepted(int $shareId, bool $accepted) : void {
+ $query = $this->connection->prepare('
+ UPDATE `*PREFIX*share_external`
+ SET `accepted` = ?
+ WHERE `id` = ?');
+ $updateResult = $query->execute([$accepted ? 1 : 0, $shareId]);
+ $updateResult->closeCursor();
+ }
+
+ /**
* accept server-to-server share
*
* @param int $id
@@ -268,21 +324,46 @@ class Manager {
WHERE `id` = ? AND `user` = ?');
$userShareAccepted = $acceptShare->execute([1, $mountPoint, $hash, $id, $this->uid]);
} else {
- try {
- $this->writeShareToDb(
- $share['remote'],
- $share['share_token'],
- $share['password'],
- $share['name'],
- $share['owner'],
- $this->uid,
- $mountPoint, $hash, 1,
- $share['remote_id'],
- $id,
- $share['share_type']);
- $result = true;
- } catch (Exception $e) {
- $result = false;
+ $parentId = (int)$share['parent'];
+ if ($parentId !== -1) {
+ // this is the sub-share
+ $subshare = $share;
+ } else {
+ $subshare = $this->fetchUserShare($id, $this->uid);
+ }
+
+ if ($subshare !== null) {
+ try {
+ $acceptShare = $this->connection->prepare('
+ UPDATE `*PREFIX*share_external`
+ SET `accepted` = ?,
+ `mountpoint` = ?,
+ `mountpoint_hash` = ?
+ WHERE `id` = ? AND `user` = ?');
+ $acceptShare->execute([1, $mountPoint, $hash, $subshare['id'], $this->uid]);
+ $result = true;
+ } catch (Exception $e) {
+ $this->logger->emergency('Could not update share', ['exception' => $e]);
+ $result = false;
+ }
+ } else {
+ try {
+ $this->writeShareToDb(
+ $share['remote'],
+ $share['share_token'],
+ $share['password'],
+ $share['name'],
+ $share['owner'],
+ $this->uid,
+ $mountPoint, $hash, 1,
+ $share['remote_id'],
+ $id,
+ $share['share_type']);
+ $result = true;
+ } catch (Exception $e) {
+ $this->logger->emergency('Could not create share', ['exception' => $e]);
+ $result = false;
+ }
}
}
if ($userShareAccepted !== false) {
@@ -318,23 +399,42 @@ class Manager {
$this->processNotification($id);
$result = true;
} elseif ($share && (int)$share['share_type'] === IShare::TYPE_GROUP) {
- try {
- $this->writeShareToDb(
- $share['remote'],
- $share['share_token'],
- $share['password'],
- $share['name'],
- $share['owner'],
- $this->uid,
- $share['mountpoint'],
- $share['mountpoint_hash'],
- 0,
- $share['remote_id'],
- $id,
- $share['share_type']);
- $result = true;
- } catch (Exception $e) {
- $result = false;
+ $parentId = (int)$share['parent'];
+ if ($parentId !== -1) {
+ // this is the sub-share
+ $subshare = $share;
+ } else {
+ $subshare = $this->fetchUserShare($id, $this->uid);
+ }
+
+ if ($subshare !== null) {
+ try {
+ $this->updateAccepted((int)$subshare['id'], false);
+ $result = true;
+ } catch (Exception $e) {
+ $this->logger->emergency('Could not update share', ['exception' => $e]);
+ $result = false;
+ }
+ } else {
+ try {
+ $this->writeShareToDb(
+ $share['remote'],
+ $share['share_token'],
+ $share['password'],
+ $share['name'],
+ $share['owner'],
+ $this->uid,
+ $share['mountpoint'],
+ $share['mountpoint_hash'],
+ 0,
+ $share['remote_id'],
+ $id,
+ $share['share_type']);
+ $result = true;
+ } catch (Exception $e) {
+ $this->logger->emergency('Could not create share', ['exception' => $e]);
+ $result = false;
+ }
}
$this->processNotification($id);
}
@@ -497,6 +597,10 @@ class Manager {
public function removeShare($mountPoint): bool {
$mountPointObj = $this->mountManager->find($mountPoint);
+ if ($mountPointObj === null) {
+ $this->logger->error('Mount point to remove share not found', ['mountPoint' => $mountPoint]);
+ return false;
+ }
$id = $mountPointObj->getStorage()->getCache()->getId('');
$mountPoint = $this->stripPath($mountPoint);
@@ -519,22 +623,18 @@ class Manager {
}
$query = $this->connection->prepare('
- DELETE FROM `*PREFIX*share_external`
- WHERE `id` = ?
+ DELETE FROM `*PREFIX*share_external`
+ WHERE `id` = ?
');
$deleteResult = $query->execute([(int)$share['id']]);
$deleteResult->closeCursor();
} elseif ($share !== false && (int)$share['share_type'] === IShare::TYPE_GROUP) {
- $query = $this->connection->prepare('
- UPDATE `*PREFIX*share_external`
- SET `accepted` = ?
- WHERE `id` = ?');
- $updateResult = $query->execute([0, (int)$share['id']]);
- $updateResult->closeCursor();
+ $this->updateAccepted((int)$share['id'], false);
}
$this->removeReShares($id);
} catch (\Doctrine\DBAL\Exception $ex) {
+ $this->logger->emergency('Could not update share', ['exception' => $ex]);
return false;
}
@@ -571,24 +671,73 @@ class Manager {
*/
public function removeUserShares($uid): bool {
try {
+ // TODO: use query builder
$getShare = $this->connection->prepare('
- SELECT `remote`, `share_token`, `remote_id`
+ SELECT `id`, `remote`, `share_type`, `share_token`, `remote_id`
FROM `*PREFIX*share_external`
- WHERE `user` = ?');
- $result = $getShare->execute([$uid]);
+ WHERE `user` = ?
+ AND `share_type` = ?');
+ $result = $getShare->execute([$uid, IShare::TYPE_USER]);
$shares = $result->fetchAll();
$result->closeCursor();
+
foreach ($shares as $share) {
$this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'decline');
}
- $query = $this->connection->prepare('
- DELETE FROM `*PREFIX*share_external`
+ $qb = $this->connection->getQueryBuilder();
+ $qb->delete('share_external')
+ // user field can specify a user or a group
+ ->where($qb->expr()->eq('user', $qb->createNamedParameter($uid)))
+ ->andWhere(
+ $qb->expr()->orX(
+ // delete direct shares
+ $qb->expr()->eq('share_type', $qb->expr()->literal(IShare::TYPE_USER)),
+ // delete sub-shares of group shares for that user
+ $qb->expr()->andX(
+ $qb->expr()->eq('share_type', $qb->expr()->literal(IShare::TYPE_GROUP)),
+ $qb->expr()->neq('parent', $qb->expr()->literal(-1)),
+ )
+ )
+ );
+ $qb->execute();
+ } catch (\Doctrine\DBAL\Exception $ex) {
+ $this->logger->emergency('Could not delete user shares', ['exception' => $ex]);
+ return false;
+ }
+
+ return true;
+ }
+
+ public function removeGroupShares($gid): bool {
+ try {
+ $getShare = $this->connection->prepare('
+ SELECT `id`, `remote`, `share_type`, `share_token`, `remote_id`
+ FROM `*PREFIX*share_external`
WHERE `user` = ?
- ');
- $deleteResult = $query->execute([$uid]);
- $deleteResult->closeCursor();
+ AND `share_type` = ?');
+ $result = $getShare->execute([$gid, IShare::TYPE_GROUP]);
+ $shares = $result->fetchAll();
+ $result->closeCursor();
+
+ $deletedGroupShares = [];
+ $qb = $this->connection->getQueryBuilder();
+ // delete group share entry and matching sub-entries
+ $qb->delete('share_external')
+ ->where(
+ $qb->expr()->orX(
+ $qb->expr()->eq('id', $qb->createParameter('share_id')),
+ $qb->expr()->eq('parent', $qb->createParameter('share_parent_id'))
+ )
+ );
+
+ foreach ($shares as $share) {
+ $qb->setParameter('share_id', $share['id']);
+ $qb->setParameter('share_parent_id', $share['id']);
+ $qb->execute();
+ }
} catch (\Doctrine\DBAL\Exception $ex) {
+ $this->logger->emergency('Could not delete user shares', ['exception' => $ex]);
return false;
}
@@ -629,23 +778,44 @@ class Manager {
$userGroups[] = $group->getGID();
}
- $query = 'SELECT `id`, `remote`, `remote_id`, `share_token`, `name`, `owner`, `user`, `mountpoint`, `accepted`
- FROM `*PREFIX*share_external`
- WHERE (`user` = ? OR `user` IN (?))';
- $parameters = [$this->uid, implode(',',$userGroups)];
- if (!is_null($accepted)) {
- $query .= ' AND `accepted` = ?';
- $parameters[] = (int) $accepted;
- }
- $query .= ' ORDER BY `id` ASC';
+ $qb = $this->connection->getQueryBuilder();
+ $qb->select('id', 'share_type', 'parent', 'remote', 'remote_id', 'share_token', 'name', 'owner', 'user', 'mountpoint', 'accepted')
+ ->from('share_external')
+ ->where(
+ $qb->expr()->orX(
+ $qb->expr()->eq('user', $qb->createNamedParameter($this->uid)),
+ $qb->expr()->in(
+ 'user',
+ $qb->createNamedParameter($userGroups, IQueryBuilder::PARAM_STR_ARRAY)
+ )
+ )
+ )
+ ->orderBy('id', 'ASC');
- $sharesQuery = $this->connection->prepare($query);
try {
- $result = $sharesQuery->execute($parameters);
+ $result = $qb->execute();
$shares = $result->fetchAll();
$result->closeCursor();
- return $shares;
+
+ // remove parent group share entry if we have a specific user share entry for the user
+ $toRemove = [];
+ foreach ($shares as $share) {
+ if ((int)$share['share_type'] === IShare::TYPE_GROUP && (int)$share['parent'] > 0) {
+ $toRemove[] = $share['parent'];
+ }
+ }
+ $shares = array_filter($shares, function ($share) use ($toRemove) {
+ return !in_array($share['id'], $toRemove, true);
+ });
+
+ if (!is_null($accepted)) {
+ $shares = array_filter($shares, function ($share) use ($accepted) {
+ return (bool)$share['accepted'] === $accepted;
+ });
+ }
+ return array_values($shares);
} catch (\Doctrine\DBAL\Exception $e) {
+ $this->logger->emergency('Error when retrieving shares', ['exception' => $e]);
return [];
}
}
diff --git a/apps/files_sharing/lib/Hooks.php b/apps/files_sharing/lib/Hooks.php
index ff4ca59339a..f28f6910abd 100644
--- a/apps/files_sharing/lib/Hooks.php
+++ b/apps/files_sharing/lib/Hooks.php
@@ -28,6 +28,7 @@ namespace OCA\Files_Sharing;
use OC\Files\Filesystem;
use OCP\EventDispatcher\IEventDispatcher;
+use Psr\Log\LoggerInterface;
class Hooks {
public static function deleteUser($params) {
@@ -43,7 +44,8 @@ class Hooks {
\OC::$server->getGroupManager(),
\OC::$server->getUserManager(),
$params['uid'],
- \OC::$server->query(IEventDispatcher::class)
+ \OC::$server->query(IEventDispatcher::class),
+ \OC::$server->get(LoggerInterface::class)
);
$manager->removeUserShares($params['uid']);
diff --git a/apps/files_sharing/lib/Listener/UserAddedToGroupListener.php b/apps/files_sharing/lib/Listener/UserAddedToGroupListener.php
index 9b2975f5833..1f3898b3dcb 100644
--- a/apps/files_sharing/lib/Listener/UserAddedToGroupListener.php
+++ b/apps/files_sharing/lib/Listener/UserAddedToGroupListener.php
@@ -60,7 +60,7 @@ class UserAddedToGroupListener implements IEventListener {
}
// Get all group shares this user has access to now to filter later
- $shares = $this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_GROUP);
+ $shares = $this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_GROUP, null, -1);
foreach ($shares as $share) {
// If this is not the new group we can skip it
diff --git a/apps/files_sharing/src/share.js b/apps/files_sharing/src/share.js
index 385d42eaaea..a7660a29f58 100644
--- a/apps/files_sharing/src/share.js
+++ b/apps/files_sharing/src/share.js
@@ -181,6 +181,8 @@ import escapeHTML from 'escape-html'
hasShares = true
} else if (shareType === OC.Share.SHARE_TYPE_REMOTE) {
hasShares = true
+ } else if (shareType === OC.Share.SHARE_TYPE_REMOTE_GROUP) {
+ hasShares = true
} else if (shareType === OC.Share.SHARE_TYPE_CIRCLE) {
hasShares = true
} else if (shareType === OC.Share.SHARE_TYPE_ROOM) {
@@ -230,6 +232,10 @@ import escapeHTML from 'escape-html'
},
type: OCA.Files.FileActions.TYPE_INLINE,
actionHandler: function(fileName, context) {
+ // details view disabled in some share lists
+ if (!fileList._detailsView) {
+ return
+ }
// do not open sidebar if permission is set and equal to 0
var permissions = parseInt(context.$file.data('share-permissions'), 10)
if (isNaN(permissions) || permissions > 0) {
diff --git a/apps/files_sharing/tests/External/ManagerTest.php b/apps/files_sharing/tests/External/ManagerTest.php
index 0098f67b2fb..a3c4a0befc0 100644
--- a/apps/files_sharing/tests/External/ManagerTest.php
+++ b/apps/files_sharing/tests/External/ManagerTest.php
@@ -41,9 +41,11 @@ use OCP\Federation\ICloudFederationFactory;
use OCP\Federation\ICloudFederationProviderManager;
use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
+use OCP\IGroup;
use OCP\IGroupManager;
use OCP\IUserManager;
use OCP\Share\IShare;
+use Psr\Log\LoggerInterface;
use Test\Traits\UserTrait;
/**
@@ -80,6 +82,9 @@ class ManagerTest extends TestCase {
/** @var \PHPUnit\Framework\MockObject\MockObject|IUserManager */
private $userManager;
+ /** @var LoggerInterface */
+ private $logger;
+
private $uid;
/**
@@ -111,7 +116,43 @@ class ManagerTest extends TestCase {
->method('search')
->willReturn([]);
- $this->manager = $this->getMockBuilder(Manager::class)
+ $this->logger = $this->createMock(LoggerInterface::class);
+ $this->logger->expects($this->never())->method('emergency');
+
+ $this->manager = $this->createManagerForUser($this->uid);
+
+ $this->testMountProvider = new MountProvider(\OC::$server->getDatabaseConnection(), function () {
+ return $this->manager;
+ }, new CloudIdManager($this->contactsManager));
+
+ $group1 = $this->createMock(IGroup::class);
+ $group1->expects($this->any())->method('getGID')->willReturn('group1');
+ $group1->expects($this->any())->method('inGroup')->with($this->user)->willReturn(true);
+
+ $group2 = $this->createMock(IGroup::class);
+ $group2->expects($this->any())->method('getGID')->willReturn('group2');
+ $group2->expects($this->any())->method('inGroup')->with($this->user)->willReturn(true);
+
+ $this->userManager->expects($this->any())->method('get')->willReturn($this->user);
+ $this->groupManager->expects($this->any())->method(('getUserGroups'))->willReturn([$group1, $group2]);
+ $this->groupManager->expects($this->any())->method(('get'))
+ ->will($this->returnValueMap([
+ ['group1', $group1],
+ ['group2', $group2],
+ ]));
+ }
+
+ protected function tearDown(): void {
+ // clear the share external table to avoid side effects
+ $query = \OC::$server->getDatabaseConnection()->prepare('DELETE FROM `*PREFIX*share_external`');
+ $result = $query->execute();
+ $result->closeCursor();
+
+ parent::tearDown();
+ }
+
+ private function createManagerForUser($userId) {
+ return $this->getMockBuilder(Manager::class)
->setConstructorArgs(
[
\OC::$server->getDatabaseConnection(),
@@ -124,25 +165,23 @@ class ManagerTest extends TestCase {
$this->cloudFederationFactory,
$this->groupManager,
$this->userManager,
- $this->uid,
+ $userId,
$this->eventDispatcher,
+ $this->logger,
]
)->setMethods(['tryOCMEndPoint'])->getMock();
-
- $this->testMountProvider = new MountProvider(\OC::$server->getDatabaseConnection(), function () {
- return $this->manager;
- }, new CloudIdManager($this->contactsManager));
}
private function setupMounts() {
+ $this->mountManager->clear();
$mounts = $this->testMountProvider->getMountsForUser($this->user, new StorageFactory());
foreach ($mounts as $mount) {
$this->mountManager->addMount($mount);
}
}
- public function testAddShare() {
- $shareData1 = [
+ public function testAddUserShare() {
+ $this->doTestAddShare([
'remote' => 'http://localhost',
'token' => 'token1',
'password' => '',
@@ -152,23 +191,41 @@ class ManagerTest extends TestCase {
'accepted' => false,
'user' => $this->uid,
'remoteId' => '2342'
- ];
+ ], false);
+ }
+
+ public function testAddGroupShare() {
+ $this->doTestAddShare([
+ 'remote' => 'http://localhost',
+ 'token' => 'token1',
+ 'password' => '',
+ 'name' => '/SharedFolder',
+ 'owner' => 'foobar',
+ 'shareType' => IShare::TYPE_GROUP,
+ 'accepted' => false,
+ 'user' => 'group1',
+ 'remoteId' => '2342'
+ ], true);
+ }
+
+ public function doTestAddShare($shareData1, $isGroup = false) {
$shareData2 = $shareData1;
$shareData2['token'] = 'token2';
$shareData3 = $shareData1;
$shareData3['token'] = 'token3';
- $this->userManager->expects($this->any())->method('get')->willReturn($this->user);
- $this->groupManager->expects($this->any())->method(('getUserGroups'))->willReturn([]);
-
- $this->manager->expects($this->at(0))->method('tryOCMEndPoint')->with('http://localhost', 'token1', '2342', 'accept')->willReturn(false);
- $this->manager->expects($this->at(1))->method('tryOCMEndPoint')->with('http://localhost', 'token3', '2342', 'decline')->willReturn(false);
+ if ($isGroup) {
+ $this->manager->expects($this->never())->method('tryOCMEndPoint');
+ } else {
+ $this->manager->expects($this->at(0))->method('tryOCMEndPoint')->with('http://localhost', 'token1', '2342', 'accept')->willReturn(false);
+ $this->manager->expects($this->at(1))->method('tryOCMEndPoint')->with('http://localhost', 'token3', '2342', 'decline')->willReturn(false);
+ }
// Add a share for "user"
$this->assertSame(null, call_user_func_array([$this->manager, 'addShare'], $shareData1));
$openShares = $this->manager->getOpenShares();
$this->assertCount(1, $openShares);
- $this->assertExternalShareEntry($shareData1, $openShares[0], 1, '{{TemporaryMountPointName#' . $shareData1['name'] . '}}');
+ $this->assertExternalShareEntry($shareData1, $openShares[0], 1, '{{TemporaryMountPointName#' . $shareData1['name'] . '}}', $shareData1['user']);
$this->setupMounts();
$this->assertNotMount('SharedFolder');
@@ -178,46 +235,48 @@ class ManagerTest extends TestCase {
$this->assertSame(null, call_user_func_array([$this->manager, 'addShare'], $shareData2));
$openShares = $this->manager->getOpenShares();
$this->assertCount(2, $openShares);
- $this->assertExternalShareEntry($shareData1, $openShares[0], 1, '{{TemporaryMountPointName#' . $shareData1['name'] . '}}');
+ $this->assertExternalShareEntry($shareData1, $openShares[0], 1, '{{TemporaryMountPointName#' . $shareData1['name'] . '}}', $shareData1['user']);
// New share falls back to "-1" appendix, because the name is already taken
- $this->assertExternalShareEntry($shareData2, $openShares[1], 2, '{{TemporaryMountPointName#' . $shareData2['name'] . '}}-1');
+ $this->assertExternalShareEntry($shareData2, $openShares[1], 2, '{{TemporaryMountPointName#' . $shareData2['name'] . '}}-1', $shareData2['user']);
$this->setupMounts();
$this->assertNotMount('SharedFolder');
$this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}');
$this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}-1');
- $client = $this->getMockBuilder('OCP\Http\Client\IClient')
- ->disableOriginalConstructor()->getMock();
- $this->clientService->expects($this->at(0))
- ->method('newClient')
- ->willReturn($client);
- $response = $this->createMock(IResponse::class);
- $response->method('getBody')
- ->willReturn(json_encode([
- 'ocs' => [
- 'meta' => [
- 'statuscode' => 200,
+ if (!$isGroup) {
+ $client = $this->getMockBuilder('OCP\Http\Client\IClient')
+ ->disableOriginalConstructor()->getMock();
+ $this->clientService->expects($this->at(0))
+ ->method('newClient')
+ ->willReturn($client);
+ $response = $this->createMock(IResponse::class);
+ $response->method('getBody')
+ ->willReturn(json_encode([
+ 'ocs' => [
+ 'meta' => [
+ 'statuscode' => 200,
+ ]
]
- ]
- ]));
- $client->expects($this->once())
- ->method('post')
- ->with($this->stringStartsWith('http://localhost/ocs/v2.php/cloud/shares/' . $openShares[0]['remote_id']), $this->anything())
- ->willReturn($response);
+ ]));
+ $client->expects($this->once())
+ ->method('post')
+ ->with($this->stringStartsWith('http://localhost/ocs/v2.php/cloud/shares/' . $openShares[0]['remote_id']), $this->anything())
+ ->willReturn($response);
+ }
// Accept the first share
- $this->manager->acceptShare($openShares[0]['id']);
+ $this->assertTrue($this->manager->acceptShare($openShares[0]['id']));
// Check remaining shares - Accepted
$acceptedShares = self::invokePrivate($this->manager, 'getShares', [true]);
$this->assertCount(1, $acceptedShares);
$shareData1['accepted'] = true;
- $this->assertExternalShareEntry($shareData1, $acceptedShares[0], 1, $shareData1['name']);
+ $this->assertExternalShareEntry($shareData1, $acceptedShares[0], 1, $shareData1['name'], $this->uid);
// Check remaining shares - Open
$openShares = $this->manager->getOpenShares();
$this->assertCount(1, $openShares);
- $this->assertExternalShareEntry($shareData2, $openShares[0], 2, '{{TemporaryMountPointName#' . $shareData2['name'] . '}}-1');
+ $this->assertExternalShareEntry($shareData2, $openShares[0], 2, '{{TemporaryMountPointName#' . $shareData2['name'] . '}}-1', $shareData2['user']);
$this->setupMounts();
$this->assertMount($shareData1['name']);
@@ -228,36 +287,42 @@ class ManagerTest extends TestCase {
$this->assertSame(null, call_user_func_array([$this->manager, 'addShare'], $shareData3));
$openShares = $this->manager->getOpenShares();
$this->assertCount(2, $openShares);
- $this->assertExternalShareEntry($shareData2, $openShares[0], 2, '{{TemporaryMountPointName#' . $shareData2['name'] . '}}-1');
- // New share falls back to the original name (no "-\d", because the name is not taken)
- $this->assertExternalShareEntry($shareData3, $openShares[1], 3, '{{TemporaryMountPointName#' . $shareData3['name'] . '}}');
+ $this->assertExternalShareEntry($shareData2, $openShares[0], 2, '{{TemporaryMountPointName#' . $shareData2['name'] . '}}-1', $shareData2['user']);
+ if (!$isGroup) {
+ // New share falls back to the original name (no "-\d", because the name is not taken)
+ $this->assertExternalShareEntry($shareData3, $openShares[1], 3, '{{TemporaryMountPointName#' . $shareData3['name'] . '}}', $shareData3['user']);
+ } else {
+ $this->assertExternalShareEntry($shareData3, $openShares[1], 3, '{{TemporaryMountPointName#' . $shareData3['name'] . '}}-2', $shareData3['user']);
+ }
$this->setupMounts();
$this->assertMount($shareData1['name']);
$this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}');
$this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}-1');
- $client = $this->getMockBuilder('OCP\Http\Client\IClient')
- ->disableOriginalConstructor()->getMock();
- $this->clientService->expects($this->at(0))
- ->method('newClient')
- ->willReturn($client);
- $response = $this->createMock(IResponse::class);
- $response->method('getBody')
- ->willReturn(json_encode([
- 'ocs' => [
- 'meta' => [
- 'statuscode' => 200,
+ if (!$isGroup) {
+ $client = $this->getMockBuilder('OCP\Http\Client\IClient')
+ ->disableOriginalConstructor()->getMock();
+ $this->clientService->expects($this->at(0))
+ ->method('newClient')
+ ->willReturn($client);
+ $response = $this->createMock(IResponse::class);
+ $response->method('getBody')
+ ->willReturn(json_encode([
+ 'ocs' => [
+ 'meta' => [
+ 'statuscode' => 200,
+ ]
]
- ]
- ]));
- $client->expects($this->once())
- ->method('post')
- ->with($this->stringStartsWith('http://localhost/ocs/v2.php/cloud/shares/' . $openShares[1]['remote_id'] . '/decline'), $this->anything())
- ->willReturn($response);
+ ]));
+ $client->expects($this->once())
+ ->method('post')
+ ->with($this->stringStartsWith('http://localhost/ocs/v2.php/cloud/shares/' . $openShares[1]['remote_id'] . '/decline'), $this->anything())
+ ->willReturn($response);
+ }
// Decline the third share
- $this->manager->declineShare($openShares[1]['id']);
+ $this->assertTrue($this->manager->declineShare($openShares[1]['id']));
$this->setupMounts();
$this->assertMount($shareData1['name']);
@@ -268,46 +333,62 @@ class ManagerTest extends TestCase {
$acceptedShares = self::invokePrivate($this->manager, 'getShares', [true]);
$this->assertCount(1, $acceptedShares);
$shareData1['accepted'] = true;
- $this->assertExternalShareEntry($shareData1, $acceptedShares[0], 1, $shareData1['name']);
+ $this->assertExternalShareEntry($shareData1, $acceptedShares[0], 1, $shareData1['name'], $this->uid);
// Check remaining shares - Open
$openShares = $this->manager->getOpenShares();
- $this->assertCount(1, $openShares);
- $this->assertExternalShareEntry($shareData2, $openShares[0], 2, '{{TemporaryMountPointName#' . $shareData2['name'] . '}}-1');
+ if ($isGroup) {
+ // declining a group share adds it back to pending instead of deleting it
+ $this->assertCount(2, $openShares);
+ // this is a group share that is still open
+ $this->assertExternalShareEntry($shareData2, $openShares[0], 2, '{{TemporaryMountPointName#' . $shareData2['name'] . '}}-1', $shareData2['user']);
+ // this is the user share sub-entry matching the group share which got declined
+ $this->assertExternalShareEntry($shareData3, $openShares[1], 2, '{{TemporaryMountPointName#' . $shareData3['name'] . '}}-2', $this->uid);
+ } else {
+ $this->assertCount(1, $openShares);
+ $this->assertExternalShareEntry($shareData2, $openShares[0], 2, '{{TemporaryMountPointName#' . $shareData2['name'] . '}}-1', $this->uid);
+ }
$this->setupMounts();
$this->assertMount($shareData1['name']);
$this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}');
$this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}-1');
- $client1 = $this->getMockBuilder('OCP\Http\Client\IClient')
- ->disableOriginalConstructor()->getMock();
- $client2 = $this->getMockBuilder('OCP\Http\Client\IClient')
- ->disableOriginalConstructor()->getMock();
- $this->clientService->expects($this->at(0))
- ->method('newClient')
- ->willReturn($client1);
- $this->clientService->expects($this->at(1))
- ->method('newClient')
- ->willReturn($client2);
- $response = $this->createMock(IResponse::class);
- $response->method('getBody')
- ->willReturn(json_encode([
- 'ocs' => [
- 'meta' => [
- 'statuscode' => 200,
+ if ($isGroup) {
+ // no http requests here
+ $this->manager->removeGroupShares('group1');
+ } else {
+ $client1 = $this->getMockBuilder('OCP\Http\Client\IClient')
+ ->disableOriginalConstructor()->getMock();
+ $client2 = $this->getMockBuilder('OCP\Http\Client\IClient')
+ ->disableOriginalConstructor()->getMock();
+ $this->clientService->expects($this->at(0))
+ ->method('newClient')
+ ->willReturn($client1);
+ $this->clientService->expects($this->at(1))
+ ->method('newClient')
+ ->willReturn($client2);
+ $response = $this->createMock(IResponse::class);
+ $response->method('getBody')
+ ->willReturn(json_encode([
+ 'ocs' => [
+ 'meta' => [
+ 'statuscode' => 200,
+ ]
]
- ]
- ]));
- $client1->expects($this->once())
- ->method('post')
- ->with($this->stringStartsWith('http://localhost/ocs/v2.php/cloud/shares/' . $openShares[0]['remote_id'] . '/decline'), $this->anything())
- ->willReturn($response);
- $client2->expects($this->once())
- ->method('post')
- ->with($this->stringStartsWith('http://localhost/ocs/v2.php/cloud/shares/' . $acceptedShares[0]['remote_id'] . '/decline'), $this->anything())
- ->willReturn($response);
+ ]));
+
+ $client1->expects($this->once())
+ ->method('post')
+ ->with($this->stringStartsWith('http://localhost/ocs/v2.php/cloud/shares/' . $openShares[0]['remote_id'] . '/decline'), $this->anything())
+ ->willReturn($response);
+ $client2->expects($this->once())
+ ->method('post')
+ ->with($this->stringStartsWith('http://localhost/ocs/v2.php/cloud/shares/' . $acceptedShares[0]['remote_id'] . '/decline'), $this->anything())
+ ->willReturn($response);
+
+ $this->manager->removeUserShares($this->uid);
+ }
- $this->manager->removeUserShares($this->uid);
$this->assertEmpty(self::invokePrivate($this->manager, 'getShares', [null]), 'Asserting all shares for the user have been deleted');
$this->mountManager->clear();
@@ -317,19 +398,323 @@ class ManagerTest extends TestCase {
$this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}-1');
}
+ private function verifyAcceptedGroupShare($shareData) {
+ $openShares = $this->manager->getOpenShares();
+ $this->assertCount(0, $openShares);
+ $acceptedShares = self::invokePrivate($this->manager, 'getShares', [true]);
+ $this->assertCount(1, $acceptedShares);
+ $shareData['accepted'] = true;
+ $this->assertExternalShareEntry($shareData, $acceptedShares[0], 0, $shareData['name'], $this->uid);
+ $this->setupMounts();
+ $this->assertMount($shareData['name']);
+ }
+
+ private function verifyDeclinedGroupShare($shareData, $tempMount = null) {
+ if ($tempMount === null) {
+ $tempMount = '{{TemporaryMountPointName#/SharedFolder}}';
+ }
+ $openShares = $this->manager->getOpenShares();
+ $this->assertCount(1, $openShares);
+ $acceptedShares = self::invokePrivate($this->manager, 'getShares', [true]);
+ $this->assertCount(0, $acceptedShares);
+ $this->assertExternalShareEntry($shareData, $openShares[0], 0, $tempMount, $this->uid);
+ $this->setupMounts();
+ $this->assertNotMount($shareData['name']);
+ $this->assertNotMount($tempMount);
+ }
+
+ private function createTestUserShare($userId = 'user1') {
+ $shareData = [
+ 'remote' => 'http://localhost',
+ 'token' => 'token1',
+ 'password' => '',
+ 'name' => '/SharedFolder',
+ 'owner' => 'foobar',
+ 'shareType' => IShare::TYPE_USER,
+ 'accepted' => false,
+ 'user' => $userId,
+ 'remoteId' => '2342'
+ ];
+
+ $this->assertSame(null, call_user_func_array([$this->manager, 'addShare'], $shareData));
+
+ return $shareData;
+ }
+ private function createTestGroupShare($groupId = 'group1') {
+ $shareData = [
+ 'remote' => 'http://localhost',
+ 'token' => 'token1',
+ 'password' => '',
+ 'name' => '/SharedFolder',
+ 'owner' => 'foobar',
+ 'shareType' => IShare::TYPE_GROUP,
+ 'accepted' => false,
+ 'user' => $groupId,
+ 'remoteId' => '2342'
+ ];
+
+ $this->assertSame(null, call_user_func_array([$this->manager, 'addShare'], $shareData));
+
+ $allShares = self::invokePrivate($this->manager, 'getShares', [null]);
+ foreach ($allShares as $share) {
+ if ($share['user'] === $groupId) {
+ // this will hold the main group entry
+ $groupShare = $share;
+ break;
+ }
+ }
+
+ return [$shareData, $groupShare];
+ }
+
+ public function testAcceptOriginalGroupShare() {
+ [$shareData, $groupShare] = $this->createTestGroupShare();
+ $this->assertTrue($this->manager->acceptShare($groupShare['id']));
+ $this->verifyAcceptedGroupShare($shareData);
+
+ // a second time
+ $this->assertTrue($this->manager->acceptShare($groupShare['id']));
+ $this->verifyAcceptedGroupShare($shareData);
+ }
+
+ public function testAcceptGroupShareAgainThroughGroupShare() {
+ [$shareData, $groupShare] = $this->createTestGroupShare();
+ $this->assertTrue($this->manager->acceptShare($groupShare['id']));
+ $this->verifyAcceptedGroupShare($shareData);
+
+ // decline again, this keeps the sub-share
+ $this->assertTrue($this->manager->declineShare($groupShare['id']));
+ $this->verifyDeclinedGroupShare($shareData, '/SharedFolder');
+
+ // this will return sub-entries
+ $openShares = $this->manager->getOpenShares();
+ $this->assertCount(1, $openShares);
+
+ // accept through group share
+ $this->assertTrue($this->manager->acceptShare($groupShare['id']));
+ $this->verifyAcceptedGroupShare($shareData, '/SharedFolder');
+
+ // accept a second time
+ $this->assertTrue($this->manager->acceptShare($groupShare['id']));
+ $this->verifyAcceptedGroupShare($shareData, '/SharedFolder');
+ }
+
+ public function testAcceptGroupShareAgainThroughSubShare() {
+ [$shareData, $groupShare] = $this->createTestGroupShare();
+ $this->assertTrue($this->manager->acceptShare($groupShare['id']));
+ $this->verifyAcceptedGroupShare($shareData);
+
+ // decline again, this keeps the sub-share
+ $this->assertTrue($this->manager->declineShare($groupShare['id']));
+ $this->verifyDeclinedGroupShare($shareData, '/SharedFolder');
+
+ // this will return sub-entries
+ $openShares = $this->manager->getOpenShares();
+ $this->assertCount(1, $openShares);
+
+ // accept through sub-share
+ $this->assertTrue($this->manager->acceptShare($openShares[0]['id']));
+ $this->verifyAcceptedGroupShare($shareData);
+
+ // accept a second time
+ $this->assertTrue($this->manager->acceptShare($openShares[0]['id']));
+ $this->verifyAcceptedGroupShare($shareData);
+ }
+
+ public function testDeclineOriginalGroupShare() {
+ [$shareData, $groupShare] = $this->createTestGroupShare();
+ $this->assertTrue($this->manager->declineShare($groupShare['id']));
+ $this->verifyDeclinedGroupShare($shareData);
+
+ // a second time
+ $this->assertTrue($this->manager->declineShare($groupShare['id']));
+ $this->verifyDeclinedGroupShare($shareData);
+ }
+
+ public function testDeclineGroupShareAgainThroughGroupShare() {
+ [$shareData, $groupShare] = $this->createTestGroupShare();
+ $this->assertTrue($this->manager->acceptShare($groupShare['id']));
+ $this->verifyAcceptedGroupShare($shareData);
+
+ // decline again, this keeps the sub-share
+ $this->assertTrue($this->manager->declineShare($groupShare['id']));
+ $this->verifyDeclinedGroupShare($shareData, '/SharedFolder');
+
+ // a second time
+ $this->assertTrue($this->manager->declineShare($groupShare['id']));
+ $this->verifyDeclinedGroupShare($shareData, '/SharedFolder');
+ }
+
+ public function testDeclineGroupShareAgainThroughSubshare() {
+ [$shareData, $groupShare] = $this->createTestGroupShare();
+ $this->assertTrue($this->manager->acceptShare($groupShare['id']));
+ $this->verifyAcceptedGroupShare($shareData);
+
+ // this will return sub-entries
+ $allShares = self::invokePrivate($this->manager, 'getShares', [null]);
+ $this->assertCount(1, $allShares);
+
+ // decline again through sub-share
+ $this->assertTrue($this->manager->declineShare($allShares[0]['id']));
+ $this->verifyDeclinedGroupShare($shareData, '/SharedFolder');
+
+ // a second time
+ $this->assertTrue($this->manager->declineShare($allShares[0]['id']));
+ $this->verifyDeclinedGroupShare($shareData, '/SharedFolder');
+ }
+
+ public function testDeclineGroupShareAgainThroughMountPoint() {
+ [$shareData, $groupShare] = $this->createTestGroupShare();
+ $this->assertTrue($this->manager->acceptShare($groupShare['id']));
+ $this->verifyAcceptedGroupShare($shareData);
+
+ // decline through mount point name
+ $this->assertTrue($this->manager->removeShare($this->uid . '/files/' . $shareData['name']));
+ $this->verifyDeclinedGroupShare($shareData, '/SharedFolder');
+
+ // second time must fail as the mount point is gone
+ $this->assertFalse($this->manager->removeShare($this->uid . '/files/' . $shareData['name']));
+ }
+
+ public function testDeclineThenAcceptGroupShareAgainThroughGroupShare() {
+ [$shareData, $groupShare] = $this->createTestGroupShare();
+ // decline, this creates a declined sub-share
+ $this->assertTrue($this->manager->declineShare($groupShare['id']));
+ $this->verifyDeclinedGroupShare($shareData);
+
+ // this will return sub-entries
+ $openShares = $this->manager->getOpenShares();
+
+ // accept through sub-share
+ $this->assertTrue($this->manager->acceptShare($groupShare['id']));
+ $this->verifyAcceptedGroupShare($shareData, '/SharedFolder');
+
+ // accept a second time
+ $this->assertTrue($this->manager->acceptShare($groupShare['id']));
+ $this->verifyAcceptedGroupShare($shareData, '/SharedFolder');
+ }
+
+ public function testDeclineThenAcceptGroupShareAgainThroughSubShare() {
+ [$shareData, $groupShare] = $this->createTestGroupShare();
+ // decline, this creates a declined sub-share
+ $this->assertTrue($this->manager->declineShare($groupShare['id']));
+ $this->verifyDeclinedGroupShare($shareData);
+
+ // this will return sub-entries
+ $openShares = $this->manager->getOpenShares();
+
+ // accept through sub-share
+ $this->assertTrue($this->manager->acceptShare($openShares[0]['id']));
+ $this->verifyAcceptedGroupShare($shareData);
+
+ // accept a second time
+ $this->assertTrue($this->manager->acceptShare($openShares[0]['id']));
+ $this->verifyAcceptedGroupShare($shareData);
+ }
+
+ public function testDeleteUserShares() {
+ // user 1 shares
+
+ $shareData = $this->createTestUserShare($this->uid);
+
+ [$shareData, $groupShare] = $this->createTestGroupShare();
+
+ $shares = $this->manager->getOpenShares();
+ $this->assertCount(2, $shares);
+
+ $this->assertTrue($this->manager->acceptShare($groupShare['id']));
+
+ // user 2 shares
+ $manager2 = $this->createManagerForUser('user2');
+ $shareData2 = [
+ 'remote' => 'http://localhost',
+ 'token' => 'token1',
+ 'password' => '',
+ 'name' => '/SharedFolder',
+ 'owner' => 'foobar',
+ 'shareType' => IShare::TYPE_USER,
+ 'accepted' => false,
+ 'user' => 'user2',
+ 'remoteId' => '2342'
+ ];
+ $this->assertSame(null, call_user_func_array([$manager2, 'addShare'], $shareData2));
+
+ $user2Shares = $manager2->getOpenShares();
+ $this->assertCount(2, $user2Shares);
+
+ $this->manager->expects($this->at(0))->method('tryOCMEndPoint')->with('http://localhost', 'token1', '2342', 'decline')->willReturn([]);
+ $this->manager->removeUserShares($this->uid);
+
+ $user1Shares = $this->manager->getOpenShares();
+ // user share is gone, group is still there
+ $this->assertCount(1, $user1Shares);
+ $this->assertEquals($user1Shares[0]['share_type'], IShare::TYPE_GROUP);
+
+ // user 2 shares untouched
+ $user2Shares = $manager2->getOpenShares();
+ $this->assertCount(2, $user2Shares);
+ $this->assertEquals($user2Shares[0]['share_type'], IShare::TYPE_GROUP);
+ $this->assertEquals($user2Shares[0]['user'], 'group1');
+ $this->assertEquals($user2Shares[1]['share_type'], IShare::TYPE_USER);
+ $this->assertEquals($user2Shares[1]['user'], 'user2');
+ }
+
+ public function testDeleteGroupShares() {
+ $shareData = $this->createTestUserShare($this->uid);
+
+ [$shareData, $groupShare] = $this->createTestGroupShare();
+
+ $shares = $this->manager->getOpenShares();
+ $this->assertCount(2, $shares);
+
+ $this->assertTrue($this->manager->acceptShare($groupShare['id']));
+
+ // user 2 shares
+ $manager2 = $this->createManagerForUser('user2');
+ $shareData2 = [
+ 'remote' => 'http://localhost',
+ 'token' => 'token1',
+ 'password' => '',
+ 'name' => '/SharedFolder',
+ 'owner' => 'foobar',
+ 'shareType' => IShare::TYPE_USER,
+ 'accepted' => false,
+ 'user' => 'user2',
+ 'remoteId' => '2342'
+ ];
+ $this->assertSame(null, call_user_func_array([$manager2, 'addShare'], $shareData2));
+
+ $user2Shares = $manager2->getOpenShares();
+ $this->assertCount(2, $user2Shares);
+
+ $this->manager->expects($this->never())->method('tryOCMEndPoint');
+ $this->manager->removeGroupShares('group1');
+
+ $user1Shares = $this->manager->getOpenShares();
+ // user share is gone, group is still there
+ $this->assertCount(1, $user1Shares);
+ $this->assertEquals($user1Shares[0]['share_type'], IShare::TYPE_USER);
+
+ // user 2 shares untouched
+ $user2Shares = $manager2->getOpenShares();
+ $this->assertCount(1, $user2Shares);
+ $this->assertEquals($user2Shares[0]['share_type'], IShare::TYPE_USER);
+ $this->assertEquals($user2Shares[0]['user'], 'user2');
+ }
+
/**
* @param array $expected
* @param array $actual
* @param int $share
* @param string $mountPoint
*/
- protected function assertExternalShareEntry($expected, $actual, $share, $mountPoint) {
+ protected function assertExternalShareEntry($expected, $actual, $share, $mountPoint, $targetEntity) {
$this->assertEquals($expected['remote'], $actual['remote'], 'Asserting remote of a share #' . $share);
$this->assertEquals($expected['token'], $actual['share_token'], 'Asserting token of a share #' . $share);
$this->assertEquals($expected['name'], $actual['name'], 'Asserting name of a share #' . $share);
$this->assertEquals($expected['owner'], $actual['owner'], 'Asserting owner of a share #' . $share);
$this->assertEquals($expected['accepted'], (int) $actual['accepted'], 'Asserting accept of a share #' . $share);
- $this->assertEquals($expected['user'], $actual['user'], 'Asserting user of a share #' . $share);
+ $this->assertEquals($targetEntity, $actual['user'], 'Asserting user of a share #' . $share);
$this->assertEquals($mountPoint, $actual['mountpoint'], 'Asserting mountpoint of a share #' . $share);
}
diff --git a/core/Controller/UnifiedSearchController.php b/core/Controller/UnifiedSearchController.php
index 93fbb323ee5..bfed6d606ae 100644
--- a/core/Controller/UnifiedSearchController.php
+++ b/core/Controller/UnifiedSearchController.php
@@ -33,6 +33,7 @@ use OCP\AppFramework\OCSController;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
+use OCP\IURLGenerator;
use OCP\IUserSession;
use OCP\Route\IRouter;
use OCP\Search\ISearchQuery;
@@ -49,15 +50,20 @@ class UnifiedSearchController extends OCSController {
/** @var IRouter */
private $router;
+ /** @var IURLGenerator */
+ private $urlGenerator;
+
public function __construct(IRequest $request,
IUserSession $userSession,
SearchComposer $composer,
- IRouter $router) {
+ IRouter $router,
+ IURLGenerator $urlGenerator) {
parent::__construct('core', $request);
$this->composer = $composer;
$this->userSession = $userSession;
$this->router = $router;
+ $this->urlGenerator = $urlGenerator;
}
/**
@@ -123,9 +129,17 @@ class UnifiedSearchController extends OCSController {
if ($url !== '') {
$urlParts = parse_url($url);
+ $urlPath = $urlParts['path'];
+
+ // Optionally strip webroot from URL. Required for route matching on setups
+ // with Nextcloud in a webserver subfolder (webroot).
+ $webroot = $this->urlGenerator->getWebroot();
+ if ($webroot !== '' && substr($urlPath, 0, strlen($webroot)) === $webroot) {
+ $urlPath = substr($urlPath, strlen($webroot));
+ }
try {
- $parameters = $this->router->findMatchingRoute($urlParts['path']);
+ $parameters = $this->router->findMatchingRoute($urlPath);
// contacts.PageController.index => contacts.Page.index
$route = $parameters['caller'];
diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php
index 34bb65cd0e6..f7fa6fa5632 100644
--- a/lib/private/URLGenerator.php
+++ b/lib/private/URLGenerator.php
@@ -276,4 +276,11 @@ class URLGenerator implements IURLGenerator {
}
return $this->baseUrl;
}
+
+ /**
+ * @return string webroot part of the base url
+ */
+ public function getWebroot(): string {
+ return \OC::$WEBROOT;
+ }
}
diff --git a/lib/private/legacy/OC_Image.php b/lib/private/legacy/OC_Image.php
index 59d51773528..890df2241af 100644
--- a/lib/private/legacy/OC_Image.php
+++ b/lib/private/legacy/OC_Image.php
@@ -562,9 +562,13 @@ class OC_Image implements \OCP\IImage {
case IMAGETYPE_GIF:
if (imagetypes() & IMG_GIF) {
$this->resource = imagecreatefromgif($imagePath);
- // Preserve transparency
- imagealphablending($this->resource, true);
- imagesavealpha($this->resource, true);
+ if ($this->resource) {
+ // Preserve transparency
+ imagealphablending($this->resource, true);
+ imagesavealpha($this->resource, true);
+ } else {
+ $this->logger->debug('OC_Image->loadFromFile, GIF image not valid: ' . $imagePath, ['app' => 'core']);
+ }
} else {
$this->logger->debug('OC_Image->loadFromFile, GIF images not supported: ' . $imagePath, ['app' => 'core']);
}
@@ -583,9 +587,13 @@ class OC_Image implements \OCP\IImage {
case IMAGETYPE_PNG:
if (imagetypes() & IMG_PNG) {
$this->resource = @imagecreatefrompng($imagePath);
- // Preserve transparency
- imagealphablending($this->resource, true);
- imagesavealpha($this->resource, true);
+ if ($this->resource) {
+ // Preserve transparency
+ imagealphablending($this->resource, true);
+ imagesavealpha($this->resource, true);
+ } else {
+ $this->logger->debug('OC_Image->loadFromFile, PNG image not valid: ' . $imagePath, ['app' => 'core']);
+ }
} else {
$this->logger->debug('OC_Image->loadFromFile, PNG images not supported: ' . $imagePath, ['app' => 'core']);
}
diff --git a/lib/public/IURLGenerator.php b/lib/public/IURLGenerator.php
index 486ca47d252..9f1a6447eb4 100644
--- a/lib/public/IURLGenerator.php
+++ b/lib/public/IURLGenerator.php
@@ -102,4 +102,10 @@ interface IURLGenerator {
* @since 13.0.0
*/
public function getBaseUrl(): string;
+
+ /**
+ * @return string webroot part of the base url
+ * @since 23.0.0
+ */
+ public function getWebroot(): string;
}
diff --git a/tests/lib/UrlGeneratorTest.php b/tests/lib/UrlGeneratorTest.php
index dd2eb2ddc63..761f4b42eea 100644
--- a/tests/lib/UrlGeneratorTest.php
+++ b/tests/lib/UrlGeneratorTest.php
@@ -179,6 +179,12 @@ class UrlGeneratorTest extends \Test\TestCase {
$this->assertEquals($expected, $actual);
}
+ public function testGetWebroot() {
+ \OC::$WEBROOT = '/nextcloud';
+ $actual = $this->urlGenerator->getWebroot();
+ $this->assertEquals(\OC::$WEBROOT, $actual);
+ }
+
/**
* @dataProvider provideOCSRoutes
*/