diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-08-13 02:38:14 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-09-16 07:23:25 +0200 |
commit | 83d91ddf20bd2e61b9f01c82817ac8b815d3ac66 (patch) | |
tree | 8acdf4caedd9f867bf73f5d565cb176335e006cc /core/js/shareconfigmodel.js | |
parent | b015eff2e92ba83c6bf95c0084e283ddc7a5df70 (diff) | |
download | nextcloud-server-83d91ddf20bd2e61b9f01c82817ac8b815d3ac66.tar.gz nextcloud-server-83d91ddf20bd2e61b9f01c82817ac8b815d3ac66.zip |
further work on reimplementing the dialog layout
Diffstat (limited to 'core/js/shareconfigmodel.js')
-rw-r--r-- | core/js/shareconfigmodel.js | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/core/js/shareconfigmodel.js b/core/js/shareconfigmodel.js new file mode 100644 index 00000000000..371cc96df5e --- /dev/null +++ b/core/js/shareconfigmodel.js @@ -0,0 +1,54 @@ +/* + * 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: { + publicUploadEnabled: false + }, + + /** + * @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} + */ + isDefaultExpireDateEnforced: function() { + return oc_appconfig.core.defaultExpireDateEnforced === true; + }, + + /** + * @returns {number} + */ + getDefaultExpireDate: function () { + return oc_appconfig.core.defaultExpireDate; + } + }); + + + OC.Share.ShareConfigModel = ShareConfigModel; +})(); |