nextcloud/core/js/shareconfigmodel.js

73 lines
1.5 KiB
JavaScript
Raw Normal View History

/*
* Copyright (c) 2015
*
* This file is licensed under the Affero General Public License version 3
* or later.
*
* See the COPYING-README file.
*
*/
(function() {
if (!OC.Share) {
OC.Share = {};
OC.Share.Types = {};
}
var ShareConfigModel = OC.Backbone.Model.extend({
defaults: {
2015-09-03 16:53:17 +03:00
publicUploadEnabled: false,
2015-09-04 16:31:45 +03:00
enforcePasswordForPublicLink: oc_appconfig.core.enforcePasswordForPublicLink,
isDefaultExpireDateEnforced: oc_appconfig.core.defaultExpireDateEnforced === true,
defaultExpireDate: oc_appconfig.core.defaultExpireDate,
2015-09-05 03:02:55 +03:00
isResharingAllowed: oc_appconfig.core.resharingAllowed
},
/**
* @returns {boolean}
*/
areAvatarsEnabled: function() {
return oc_config.enable_avatars === true;
},
/**
* @returns {boolean}
*/
isPublicUploadEnabled: function() {
var publicUploadEnabled = $('#filestable').data('allow-public-upload');
return !_.isUndefined(publicUploadEnabled);
},
/**
* @returns {boolean}
*/
isMailPublicNotificationEnabled: function() {
return $('input:hidden[name=mailPublicNotificationEnabled]').val() === 'yes';
},
/**
* @returns {boolean}
*/
isRemoteShareAllowed: function() {
return oc_appconfig.core.remoteShareAllowed;
},
/**
* @returns {boolean}
*/
isShareWithLinkAllowed: function() {
return $('#allowShareWithLink').val() === 'yes';
},
/**
* @returns {string}
*/
getFederatedShareDocLink: function() {
return oc_appconfig.core.federatedCloudShareDoc;
}
});
OC.Share.ShareConfigModel = ShareConfigModel;
})();