!function(e){function t(t){for(var i,a,n=t[0],o=t[1],s=0,h=[];s=0&&(t.shareOwner=i[OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME],t.shareOwnerId=i[OC.Files.Client.PROPERTY_OWNER_ID]);var a=i[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),i=t.attr("data-share-types")||"",r=t.attr("data-share-owner");if(i||r){var a=!1,n=!1;_.each(i.split(",")||[],function(e){(e=parseInt(e,10))===OC.Share.SHARE_TYPE_LINK?a=!0:e===OC.Share.SHARE_TYPE_EMAIL?a=!0:e===OC.Share.SHARE_TYPE_USER?n=!0:e===OC.Share.SHARE_TYPE_GROUP?n=!0:e===OC.Share.SHARE_TYPE_REMOTE?n=!0:e===OC.Share.SHARE_TYPE_CIRCLE?n=!0:e===OC.Share.SHARE_TYPE_ROOM&&(n=!0)}),OCA.Sharing.Util._updateFileActionIcon(t,n,a)}})}),e.$el.on("changeDirectory",function(){OCA.Sharing.sharesLoaded=!1}),i.registerAction({name:"Share",displayName:function(e){if(e&&e.$file){var i=parseInt(e.$file.data("share-types"),10),r=e.$file.data("share-owner-id");if(i>=0||r)return t("core","Shared")}return t("core","Share")},altText:t("core","Share"),mime:"all",order:-150,permissions:OC.PERMISSION_ALL,iconClass:function(e,t){var i=parseInt(t.$file.data("share-types"),10);return i===OC.Share.SHARE_TYPE_EMAIL||i===OC.Share.SHARE_TYPE_LINK?"icon-public":"icon-shared"},icon:function(e,t){var i=t.$file.data("share-owner-id");if(i)return OC.generateUrl("/avatar/".concat(i,"/32"))},type:OCA.Files.FileActions.TYPE_INLINE,actionHandler:function(t,i){var r=parseInt(i.$file.data("share-permissions"),10);(isNaN(r)||r>0)&&e.showDetailsView(t,"shareTabView")},render:function(e,t,r){return 0!=(parseInt(r.$file.data("permissions"),10)&OC.PERMISSION_SHARE)||r.$file.attr("data-share-owner")?i._defaultRenderAction.call(i,e,t,r):null}});var o=new OCA.Sharing.ShareTabView("shareTabView",{order:-20});o.on("sharesChanged",function(t){var i=t.fileInfoModel,r=e.findFileEl(i.get("name")),a=t.hasLinkShares();t.get("shares").forEach(function(e){e.share_type===OC.Share.SHARE_TYPE_EMAIL&&(a=!0)}),OCA.Sharing.Util._updateFileListDataAttributes(e,r,t),OCA.Sharing.Util._updateFileActionIcon(r,t.hasUserShares(),a)||OC.Share.markFileAsShared(r,!1,!1),i.set({shareTypes:t.getShareTypes(),icon:r.attr("data-icon")})}),e.registerTabView(o);var s=new OCA.Sharing.ShareBreadCrumbView({shareTab:o});e.registerBreadCrumbDetailView(s)}},_updateFileListDataAttributes:function(e,t,i){if("files"!==e.id)if(_.pluck(i.get("shares"),"share_with_displayname").length){var r=_.mapObject(i.get("shares"),function(e){return{shareWith:e.share_with,shareWithDisplayName:e.share_with_displayname}});t.attr("data-share-recipient-data",JSON.stringify(r))}else t.removeAttr("data-share-recipient-data")},_updateFileActionIcon:function(e,t,i){return!!(t||i||e.attr("data-share-recipient-data")||e.attr("data-share-owner"))&&(OC.Share.markFileAsShared(e,!0,i),!0)},getSharePermissions:function(e){return e.sharePermissions}},OC.Plugins.register("OCA.Files.FileList",OCA.Sharing.Util)},function(e,i,r){var a;a=OCA.Files.DetailTabView.extend({id:"shareTabView",className:"tab shareTabView",initialize:function(e,t){OCA.Files.DetailTabView.prototype.initialize.call(this,e,t),OC.Plugins.attach("OCA.Sharing.ShareTabView",this)},template:function(e){return'
'},getLabel:function(){return t("files_sharing","Sharing")},getIcon:function(){return"icon-shared"},render:function(){var e=this,t=this;if(this._dialog&&(this._dialog.model.off(),this._dialog.remove(),this._dialog=null),this.model){this.$el.html(this.template()),_.isUndefined(this.model.get("sharePermissions"))&&this.model.set("sharePermissions",OCA.Sharing.Util.getSharePermissions(this.model.attributes));var i={itemType:this.model.isDirectory()?"folder":"file",itemSource:this.model.get("id"),possiblePermissions:this.model.get("sharePermissions")},a=new OC.Share.ShareConfigModel,n=new OC.Share.ShareItemModel(i,{configModel:a,fileInfoModel:this.model});this._dialog=new OC.Share.ShareDialogView({configModel:a,model:n}),this.$el.find(".dialogContainer").append(this._dialog.$el),this._dialog.render(),this._dialog.model.fetch(),this._dialog.model.on("change",function(){t.trigger("sharesChanged",n)}),Promise.all([r.e(3),r.e(4)]).then(r.bind(null,14)).then(function(t){var i=new t.Vue({el:"#collaborationResources",render:function(e){return e(t.View)},data:{model:e.model.toJSON()}});e.model.on("change",function(){i.data=e.model.toJSON()})})}else this.$el.empty();this.trigger("rendered")}}),OCA.Sharing.ShareTabView=a},function(e,t){ /** * @copyright 2016 Christoph Wurst * * @author 2016 Christoph Wurst * * @license GNU AGPL version 3 or any later version * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * */ !function(){"use strict";var e=OC.Backbone.View.extend({tagName:"span",events:{click:"_onClick"},_dirInfo:void 0,_shareTab:void 0,initialize:function(e){this._shareTab=e.shareTab},render:function(e){if(this._dirInfo=e.dirInfo||null,null===this._dirInfo||"/"===this._dirInfo.path&&""===this._dirInfo.name)this.$el.removeClass("shared icon-public icon-shared"),this.$el.hide();else{var t=e.dirInfo&&e.dirInfo.shareTypes&&e.dirInfo.shareTypes.length>0;this.$el.removeClass("shared icon-public icon-shared"),t?(this.$el.addClass("shared"),-1!==e.dirInfo.shareTypes.indexOf(OC.Share.SHARE_TYPE_LINK)?this.$el.addClass("icon-public"):this.$el.addClass("icon-shared")):this.$el.addClass("icon-shared"),this.$el.show(),this.delegateEvents()}return this},_onClick:function(e){e.preventDefault();var t=new OCA.Files.FileInfoModel(this._dirInfo),i=this;t.on("change",function(){i.render({dirInfo:i._dirInfo})}),this._shareTab.on("sharesChanged",function(e){for(var t=[],r=e.getSharesWithCurrentItem(),a=0;ali{height:44px;white-space:normal;display:inline-flex;align-items:center;position:relative}.shareWithList>li .avatar{width:32px;height:32px;background-color:var(--color-primary)}.shareWithList .unshare img{vertical-align:text-bottom}.shareWithList .sharingOptionsGroup{margin-left:auto;display:flex;align-items:center;white-space:nowrap}.shareWithList .sharingOptionsGroup>.icon:not(.hidden),.shareWithList .sharingOptionsGroup .share-menu>.icon:not(.hidden){padding:14px;height:44px;width:44px;opacity:.5;display:block;cursor:pointer}.shareWithList .sharingOptionsGroup>.icon:not(.hidden):hover,.shareWithList .sharingOptionsGroup>.icon:not(.hidden):focus,.shareWithList .sharingOptionsGroup>.icon:not(.hidden):active,.shareWithList .sharingOptionsGroup .share-menu>.icon:not(.hidden):hover,.shareWithList .sharingOptionsGroup .share-menu>.icon:not(.hidden):focus,.shareWithList .sharingOptionsGroup .share-menu>.icon:not(.hidden):active{opacity:.7}.shareWithList .sharingOptionsGroup>.share-menu{position:relative;display:block}.shareWithList .username{padding:0 8px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ui-autocomplete{max-height:calc(36px * 6.5);overflow-y:auto;overflow-x:hidden;z-index:1550 !important}.notCreatable{padding-left:12px;padding-top:12px;color:var(--color-text-lighter)}.contactsmenu-popover{left:-6px;right:auto;padding:3px 6px;top:100%;margin-top:0}.contactsmenu-popover li.hidden{display:none !important}.contactsmenu-popover:after{left:8px;right:auto}.reshare,#link label,#expiration label{display:inline-flex;align-items:center}.reshare .avatar,#link label .avatar,#expiration label .avatar{margin-right:5px}.resharerInfoView.subView{position:relative}\n",""])},function(e,t,i){var r=i(10);"string"==typeof r&&(r=[[e.i,r,""]]);var a={insert:"head",singleton:!1};i(2)(r,a);r.locals&&(e.exports=r.locals)},function(e,t,i){(e.exports=i(1)(!1)).push([e.i,"div.crumb span.icon-shared,div.crumb span.icon-public{display:inline-block;cursor:pointer;opacity:0.2;margin-right:6px}div.crumb span.icon-shared.shared,div.crumb span.icon-public.shared{opacity:0.7}\n",""])}]); //# sourceMappingURL=additionalScripts.js.map