!function(e){function n(n){for(var t,r,a=n[0],o=n[1],s=0,h=[];s=0&&(n.shareOwner=t[OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME],n.shareOwnerId=t[OC.Files.Client.PROPERTY_OWNER_ID]);var r=t[OC.Files.Client.PROPERTY_SHARE_TYPES];return r&&(n.shareTypes=_.chain(r).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()),n}),e.$el.on("fileActionsReady",function(e){var n=e.$files;_.each(n,function(e){var n=$(e),t=n.attr("data-share-types")||"",i=n.attr("data-share-owner");if(t||i){var r=!1,a=!1;_.each(t.split(",")||[],function(e){(e=parseInt(e,10))===OC.Share.SHARE_TYPE_LINK?r=!0:e===OC.Share.SHARE_TYPE_EMAIL?r=!0:e===OC.Share.SHARE_TYPE_USER?a=!0:e===OC.Share.SHARE_TYPE_GROUP?a=!0:e===OC.Share.SHARE_TYPE_REMOTE?a=!0:e===OC.Share.SHARE_TYPE_CIRCLE?a=!0:e===OC.Share.SHARE_TYPE_ROOM&&(a=!0)}),OCA.Sharing.Util._updateFileActionIcon(n,a,r)}})}),e.$el.on("changeDirectory",function(){OCA.Sharing.sharesLoaded=!1}),n.registerAction({name:"Share",displayName:function(e){if(e&&e.$file){var n=parseInt(e.$file.data("share-types"),10),i=e.$file.data("share-owner-id");if(n>=0||i)return t("core","Shared")}return t("core","Share")},altText:t("core","Share"),mime:"all",order:-150,permissions:OC.PERMISSION_ALL,iconClass:function(e,n){var t=parseInt(n.$file.data("share-types"),10);return t===OC.Share.SHARE_TYPE_EMAIL||t===OC.Share.SHARE_TYPE_LINK?"icon-public":"icon-shared"},icon:function(e,n){var t=n.$file.data("share-owner-id");if(t)return OC.generateUrl("/avatar/".concat(t,"/32"))},type:OCA.Files.FileActions.TYPE_INLINE,actionHandler:function(n,t){var i=parseInt(t.$file.data("share-permissions"),10);(isNaN(i)||i>0)&&e.showDetailsView(n,"shareTabView")},render:function(e,t,i){return 0!=(parseInt(i.$file.data("permissions"),10)&OC.PERMISSION_SHARE)||i.$file.attr("data-share-owner")?n._defaultRenderAction.call(n,e,t,i):null}});var o=new OCA.Sharing.ShareTabView("shareTabView",{order:-20});o.on("sharesChanged",function(n){var t=n.fileInfoModel,i=e.findFileEl(t.get("name")),r=n.hasLinkShares();n.get("shares").forEach(function(e){e.share_type===OC.Share.SHARE_TYPE_EMAIL&&(r=!0)}),OCA.Sharing.Util._updateFileListDataAttributes(e,i,n),OCA.Sharing.Util._updateFileActionIcon(i,n.hasUserShares(),r)||OC.Share.markFileAsShared(i,!1,!1),t.set({shareTypes:n.getShareTypes(),icon:i.attr("data-icon")})}),e.registerTabView(o);var s=new OCA.Sharing.ShareBreadCrumbView({shareTab:o});e.registerBreadCrumbDetailView(s)}},_updateFileListDataAttributes:function(e,n,t){if("files"!==e.id)if(_.pluck(t.get("shares"),"share_with_displayname").length){var i=_.mapObject(t.get("shares"),function(e){return{shareWith:e.share_with,shareWithDisplayName:e.share_with_displayname}});n.attr("data-share-recipient-data",JSON.stringify(i))}else n.removeAttr("data-share-recipient-data")},_updateFileActionIcon:function(e,n,t){return!!(n||t||e.attr("data-share-recipient-data")||e.attr("data-share-owner"))&&(OC.Share.markFileAsShared(e,!0,t),!0)},getSharePermissions:function(e){return e.sharePermissions}},OC.Plugins.register("OCA.Files.FileList",OCA.Sharing.Util)},function(e,n,i){var r;r=OCA.Files.DetailTabView.extend({id:"shareTabView",className:"tab shareTabView",initialize:function(e,n){OCA.Files.DetailTabView.prototype.initialize.call(this,e,n),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,n=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 t={itemType:this.model.isDirectory()?"folder":"file",itemSource:this.model.get("id"),possiblePermissions:this.model.get("sharePermissions")},r=new OC.Share.ShareConfigModel,a=new OC.Share.ShareItemModel(t,{configModel:r,fileInfoModel:this.model});this._dialog=new OC.Share.ShareDialogView({configModel:r,model:a}),this.$el.find(".dialogContainer").append(this._dialog.$el),this._dialog.render(),this._dialog.model.fetch(),this._dialog.model.on("change",function(){n.trigger("sharesChanged",a)}),Promise.all([i.e(3),i.e(4)]).then(i.bind(null,14)).then(function(n){var t=new n.Vue({el:"#collaborationResources",render:function(e){return e(n.View)},data:{model:e.model.toJSON()}});e.model.on("change",function(){t.data=e.model.toJSON()})})}else this.$el.empty();this.trigger("rendered")}}),OCA.Sharing.ShareTabView=r},function(e,n){ /** * @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 n=e.dirInfo&&e.dirInfo.shareTypes&&e.dirInfo.shareTypes.length>0;this.$el.removeClass("shared icon-public icon-shared"),n?(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 n=new OCA.Files.FileInfoModel(this._dirInfo),t=this;n.on("change",function(){t.render({dirInfo:t._dirInfo})}),this._shareTab.on("sharesChanged",function(e){for(var n=[],i=e.getSharesWithCurrentItem(),r=0;r li {\n height: 44px;\n white-space: normal;\n display: inline-flex;\n align-items: center;\n position: relative; }\n .shareWithList > li .avatar {\n width: 32px;\n height: 32px;\n background-color: var(--color-primary); }\n .shareWithList .unshare img {\n vertical-align: text-bottom;\n /* properly align icons */ }\n .shareWithList .sharingOptionsGroup {\n margin-left: auto;\n display: flex;\n align-items: center;\n white-space: nowrap; }\n .shareWithList .sharingOptionsGroup > .icon:not(.hidden),\n .shareWithList .sharingOptionsGroup .share-menu > .icon:not(.hidden) {\n padding: 14px;\n height: 44px;\n width: 44px;\n opacity: .5;\n display: block;\n cursor: pointer; }\n .shareWithList .sharingOptionsGroup > .icon:not(.hidden):hover, .shareWithList .sharingOptionsGroup > .icon:not(.hidden):focus, .shareWithList .sharingOptionsGroup > .icon:not(.hidden):active,\n .shareWithList .sharingOptionsGroup .share-menu > .icon:not(.hidden):hover,\n .shareWithList .sharingOptionsGroup .share-menu > .icon:not(.hidden):focus,\n .shareWithList .sharingOptionsGroup .share-menu > .icon:not(.hidden):active {\n opacity: .7; }\n .shareWithList .sharingOptionsGroup > .share-menu {\n position: relative;\n display: block; }\n .shareWithList .username {\n padding: 0 8px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis; }\n\n.ui-autocomplete {\n /* limit dropdown height to 6 1/2 entries */\n max-height: calc(36px * 6.5);\n overflow-y: auto;\n overflow-x: hidden;\n z-index: 1550 !important; }\n\n.notCreatable {\n padding-left: 12px;\n padding-top: 12px;\n color: var(--color-text-lighter); }\n\n.contactsmenu-popover {\n left: -6px;\n right: auto;\n padding: 3px 6px;\n top: 100%;\n margin-top: 0; }\n .contactsmenu-popover li.hidden {\n display: none !important; }\n .contactsmenu-popover:after {\n left: 8px;\n right: auto; }\n\n.reshare,\n#link label,\n#expiration label {\n display: inline-flex;\n align-items: center; }\n .reshare .avatar,\n #link label .avatar,\n #expiration label .avatar {\n margin-right: 5px; }\n\n.resharerInfoView.subView {\n position: relative; }\n",""])},function(e,n,t){var i=t(10);"string"==typeof i&&(i=[[e.i,i,""]]);var r={insert:"head",singleton:!1};t(2)(i,r);i.locals&&(e.exports=i.locals)},function(e,n,t){(e.exports=t(1)(!1)).push([e.i,"/**\n * @copyright 2016 Christoph Wurst \n *\n * @author 2016 Christoph Wurst \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 .\n *\n */\ndiv.crumb span.icon-shared,\ndiv.crumb span.icon-public {\n display: inline-block;\n cursor: pointer;\n opacity: 0.2;\n margin-right: 6px; }\n\ndiv.crumb span.icon-shared.shared,\ndiv.crumb span.icon-public.shared {\n opacity: 0.7; }\n",""])}]); //# sourceMappingURL=additionalScripts.js.map