summaryrefslogtreecommitdiffstats
path: root/core/js/shareconfigmodel.js
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-10-30 15:39:31 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-11-05 19:03:44 +0100
commiteebcf890917ca17f9e3bd00a792b89f841c824da (patch)
tree46d2767efaa1554629ef3fffce7e13f22675ce49 /core/js/shareconfigmodel.js
parent5c0ad24a6830189a36b5538ee02738a57e067637 (diff)
downloadnextcloud-server-eebcf890917ca17f9e3bd00a792b89f841c824da.tar.gz
nextcloud-server-eebcf890917ca17f9e3bd00a792b89f841c824da.zip
Cleanup sharing leftovers
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'core/js/shareconfigmodel.js')
-rw-r--r--core/js/shareconfigmodel.js72
1 files changed, 0 insertions, 72 deletions
diff --git a/core/js/shareconfigmodel.js b/core/js/shareconfigmodel.js
deleted file mode 100644
index 0d066116b53..00000000000
--- a/core/js/shareconfigmodel.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/* eslint-disable */
-/*
- * Copyright (c) 2015
- *
- * This file is licensed under the Affero General Public License version 3
- * or later.
- *
- * See the COPYING-README file.
- *
- */
-
-/* global moment, OC */
-
-(function() {
- if (!OC.Share) {
- OC.Share = {}
- OC.Share.Types = {}
- }
-
- // FIXME: the config model should populate its own model attributes based on
- // the old DOM-based config
- var ShareConfigModel = OC.Backbone.Model.extend({
- defaults: {
- publicUploadEnabled: false,
- enforcePasswordForPublicLink: OC.appConfig.core.enforcePasswordForPublicLink,
- enableLinkPasswordByDefault: OC.appConfig.core.enableLinkPasswordByDefault,
- isDefaultExpireDateEnforced: OC.appConfig.core.defaultExpireDateEnforced === true,
- isDefaultExpireDateEnabled: OC.appConfig.core.defaultExpireDateEnabled === true,
- isRemoteShareAllowed: OC.appConfig.core.remoteShareAllowed,
- isMailShareAllowed: OC.appConfig.shareByMailEnabled !== undefined,
- defaultExpireDate: OC.appConfig.core.defaultExpireDate,
- isResharingAllowed: OC.appConfig.core.resharingAllowed,
- isPasswordForMailSharesRequired: (OC.appConfig.shareByMail === undefined) ? false : OC.appConfig.shareByMail.enforcePasswordProtection,
- allowGroupSharing: OC.appConfig.core.allowGroupSharing
- },
-
- /**
- * @returns {boolean}
- */
- isPublicUploadEnabled: function() {
- var publicUploadEnabled = $('#filestable').data('allow-public-upload')
- return publicUploadEnabled === 'yes'
- },
-
- /**
- * @returns {boolean}
- */
- isShareWithLinkAllowed: function() {
- return $('#allowShareWithLink').val() === 'yes'
- },
-
- /**
- * @returns {string}
- */
- getFederatedShareDocLink: function() {
- return OC.appConfig.core.federatedCloudShareDoc
- },
-
- getDefaultExpirationDateString: function() {
- var expireDateString = ''
- if (this.get('isDefaultExpireDateEnabled')) {
- var date = moment.utc()
- var expireAfterDays = this.get('defaultExpireDate')
- date.add(expireAfterDays, 'days')
- expireDateString = date.format('YYYY-MM-DD 00:00:00')
- }
- return expireDateString
- }
- })
-
- OC.Share.ShareConfigModel = ShareConfigModel
-})()