nextcloud/core/js/dist/share_backend.js

24 lines
115 KiB
JavaScript
Raw Normal View History

!function(e){var a={};function t(n){if(a[n])return a[n].exports;var s=a[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,t),s.l=!0,s.exports}t.m=e,t.c=a,t.d=function(e,a,n){t.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,a){if(1&a&&(e=t(e)),8&a)return e;if(4&a&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&a&&"string"!=typeof e)for(var s in e)t.d(n,s,function(a){return e[a]}.bind(null,s));return n},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},t.p="",t(t.s=0)}([function(e,a,t){"use strict";t.r(a);t(1),t(2),t(3),t(4),t(5),t(6),t(7),t(8),t(9)},function(e,a){!function(){OC.Share||(OC.Share={},OC.Share.Types={});var e=OC.Backbone.Model.extend({defaults:{publicUploadEnabled:!1,enforcePasswordForPublicLink:OC.appConfig.core.enforcePasswordForPublicLink,enableLinkPasswordByDefault:OC.appConfig.core.enableLinkPasswordByDefault,isDefaultExpireDateEnforced:!0===OC.appConfig.core.defaultExpireDateEnforced,isDefaultExpireDateEnabled:!0===OC.appConfig.core.defaultExpireDateEnabled,isRemoteShareAllowed:OC.appConfig.core.remoteShareAllowed,isMailShareAllowed:void 0!==OC.appConfig.shareByMailEnabled,defaultExpireDate:OC.appConfig.core.defaultExpireDate,isResharingAllowed:OC.appConfig.core.resharingAllowed,isPasswordForMailSharesRequired:void 0!==OC.appConfig.shareByMail&&OC.appConfig.shareByMail.enforcePasswordProtection,allowGroupSharing:OC.appConfig.core.allowGroupSharing},isPublicUploadEnabled:function(){return"yes"===$("#filestable").data("allow-public-upload")},isShareWithLinkAllowed:function(){return"yes"===$("#allowShareWithLink").val()},getFederatedShareDocLink:function(){return OC.appConfig.core.federatedCloudShareDoc},getDefaultExpirationDateString:function(){var e="";if(this.get("isDefaultExpireDateEnabled")){var a=moment.utc(),t=this.get("defaultExpireDate");a.add(t,"days"),e=a.format("YYYY-MM-DD 00:00:00")}return e}});OC.Share.ShareConfigModel=e}()},function(e,a){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n,s;n=Handlebars.template,(s=OC.Share.Templates=OC.Share.Templates||{}).sharedialoglinkshareview=n({1:function(e,a,t,n,s){var i,l=null!=a?a:e.nullContext||{};return'<ul class="shareWithList">\n'+(null!=(i=t.if.call(l,null!=a?a.nolinkShares:a,{name:"if",hash:{},fn:e.program(2,s,0),inverse:e.noop,data:s}))?i:"")+(null!=(i=t.each.call(l,null!=a?a.linkShares:a,{name:"each",hash:{},fn:e.program(7,s,0),inverse:e.noop,data:s}))?i:"")+"</ul>\n"},2:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h=e.escapeExpression;return'\t\t<li data-share-id="'+h("function"===t(r=null!=(r=n.newShareId||(null!=a?a.newShareId:a))?r:d)?r.call(o,{name:"newShareId",hash:{},data:i}):r)+'">\n\t\t\t<div class="avatar icon-public-white"></div>\n\t\t\t<span class="username">'+h("function"===t(r=null!=(r=n.newShareLabel||(null!=a?a.newShareLabel:a))?r:d)?r.call(o,{name:"newShareLabel",hash:{},data:i}):r)+'</span>\n\t\t\t<span class="sharingOptionsGroup">\n\t\t\t\t<div class="share-menu">\n\t\t\t\t\t<a href="#" class="icon icon-add new-share has-tooltip '+(null!=(l=n.if.call(o,null!=a?a.showPending:a,{name:"if",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?l:"")+'" title="'+h("function"===t(r=null!=(r=n.newShareTitle||(null!=a?a.newShareTitle:a))?r:d)?r.call(o,{name:"newShareTitle",hash:{},data:i}):r)+'"></a>\n\t\t\t\t\t<span class="icon icon-loading-small '+(null!=(l=n.unless.call(o,null!=a?a.showPending:a,{name:"unless",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?l:"")+'"></span>\n'+(nul
/**
* @copyright 2017, Roeland Jago Douma <roeland@famdouma.nl>
*
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @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 <http://www.gnu.org/licenses/>.
*
*/
!function(){OC.Share||(OC.Share={}),OC.Share.Social={};var e=OC.Backbone.Model.extend({defaults:{key:null,url:null,name:null,iconClass:null,newWindow:!0}});OC.Share.Social.Model=e;var a=OC.Backbone.Collection.extend({model:OC.Share.Social.Model,comparator:"key"});OC.Share.Social.Collection=new a}()},function(e,a){!function(){OC.Share||(OC.Share={});var e=OC.Backbone.View.extend({id:"shareDialogResharerInfo",tagName:"div",className:"reshare",configModel:void 0,_template:void 0,initialize:function(e){var a=this;if(this.model.on("change:reshare",(function(){a.render()})),_.isUndefined(e.configModel))throw"missing OC.Share.ShareConfigModel";this.configModel=e.configModel},render:function(){if(!this.model.hasReshare()||this.model.getReshareOwner()===OC.currentUser)return this.$el.empty(),this;var e=this.template(),a=this.model.getReshareOwnerDisplayname(),n=this.model.getReshareNote(),s="";return s=this.model.getReshareType()===OC.Share.SHARE_TYPE_GROUP?t("core","Shared with you and the group {group} by {owner}",{group:this.model.getReshareWithDisplayName(),owner:a},void 0,{escape:!1}):this.model.getReshareType()===OC.Share.SHARE_TYPE_CIRCLE?t("core","Shared with you and {circle} by {owner}",{circle:this.model.getReshareWithDisplayName(),owner:a},void 0,{escape:!1}):this.model.getReshareType()===OC.Share.SHARE_TYPE_ROOM?this.model.get("reshare").share_with_displayname?t("core","Shared with you and the conversation {conversation} by {owner}",{conversation:this.model.getReshareWithDisplayName(),owner:a},void 0,{escape:!1}):t("core","Shared with you in a conversation by {owner}",{owner:a},void 0,{escape:!1}):t("core","Shared with you by {owner}",{owner:a},void 0,{escape:!1}),this.$el.html(e({reshareOwner:this.model.getReshareOwner(),sharedByText:s,shareNote:n,hasShareNote:""!==n})),this.$el.find(".avatar").each((function(){var e=$(this);e.avatar(e.data("username"),32)})),this.$el.find(".reshare").contactsMenu(this.model.getReshareOwner(),OC.Share.SHARE_TYPE_USER,this.$el),this},template:function(){return OC.Share.Templates.sharedialogresharerinfoview}});OC.Share.ShareDialogResharerInfoView=e}()},function(e,a){!function(){OC.Share||(OC.Share={});var e=t("core","Choose a password for the public link"),a=t("core",'Choose a password for the public link or press the "Enter" key'),n=OC.Backbone.View.extend({id:"shareDialogLinkShare",configModel:void 0,showLink:!0,showPending:!1,password:"",newShareId:"new-share",events:{"click .share-menu .icon-more":"onToggleMenu","change .hideDownloadCheckbox":"onHideDownloadChange","click input.share-pass-submit":"onPasswordEntered","keyup input.linkPassText":"onPasswordKeyUp","change .showPasswordCheckbox":"onShowPasswordClick","change .passwordByTalkCheckbox":"onPasswordByTalkChange","change .publicEditingCheckbox":"onAllowPublicEditingChange","click .linkText":"onLinkTextClick","click .pop-up":"onPopUpClick","change .publicUploadRadio":"onPublicUploadChange","click .expireDate":"onExpireDateChange","change .datepicker":"onChangeExpirationDate","click .datepicker":"showDatePicker","click .share-add":"showNoteForm","click .share-note-delete":"deleteNote","click .share-note-submit":"updateNote","click .unshare":"onUnshare","click .new-share":"newShare","submit .enforcedPassForm":"enforcedPasswordSet"},initialize:function(e){var a=this;if(this.model.on("change:permissions",(function(){a.render()})),this.model.on("change:itemType",(function(){a.render()})),this.model.on("change:allowPublicUploadStatus",(function(){a.render()})),this.model.on("change:hideFileListStatus",(function(){a.render()})),this.model.on("change:linkShares",(function(e,t){var n,s=e.previous("linkShares");if(s.length===t.length)for(n=0;n<t.length;n++){if(t[n].id!==s[n].id)return;if(t[n].password!==s[n].password)return void a.render()}})),_.isUndefined(e.configModel))throw"missing OC.Share.ShareConfigModel";this.configModel=e.configModel;var n=new Clipboard(".clipboard-button");n.on("success",(function(e){var a=$(e.trigger);a.tooltip("hide").attr("data-original-title",t("core","Copied!")).tooltip("fixTitle").tooltip({placement:"bo
//# sourceMappingURL=share_backend.js.map