diff options
author | Björn Schießle <schiessle@owncloud.com> | 2014-05-14 12:54:27 -0400 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2014-05-14 12:54:27 -0400 |
commit | dab3cb65cf16d78796ce8dc23fa1f72aa9846b7e (patch) | |
tree | e9c60ed1ecab0cb41791e48523573b012537173d /core | |
parent | 4c19acf09be85d644b8ad6f4a031d0fdfa8444e4 (diff) | |
parent | 737be1a10f64200483560bf8ce533d74e1c3b7b0 (diff) | |
download | nextcloud-server-dab3cb65cf16d78796ce8dc23fa1f72aa9846b7e.tar.gz nextcloud-server-dab3cb65cf16d78796ce8dc23fa1f72aa9846b7e.zip |
Merge pull request #8522 from owncloud/sharing_ux_improvements
Sharing ux improvements
Diffstat (limited to 'core')
-rw-r--r-- | core/css/share.css | 2 | ||||
-rw-r--r-- | core/js/config.php | 15 | ||||
-rw-r--r-- | core/js/share.js | 22 |
3 files changed, 37 insertions, 2 deletions
diff --git a/core/css/share.css b/core/css/share.css index 4ae3b77757e..1527a3a0c0f 100644 --- a/core/css/share.css +++ b/core/css/share.css @@ -11,7 +11,7 @@ margin-right:112px; position:absolute; right:0; - width:320px; + width:420px; z-index:500; padding:16px; } diff --git a/core/js/config.php b/core/js/config.php index 7e23f3e2e41..9169cc14a7b 100644 --- a/core/js/config.php +++ b/core/js/config.php @@ -25,6 +25,13 @@ foreach(OC_App::getEnabledApps() as $app) { $apps_paths[$app] = OC_App::getAppWebPath($app); } +$defaultExpireDateEnabled = \OCP\Config::getAppValue('core', 'shareapi_default_expire_date', 'no'); +$defaultExpireDate = $enforceDefaultExpireDate = null; +if ($defaultExpireDateEnabled === 'yes') { + $defaultExpireDate = \OCP\Config::getAppValue('core', 'shareapi_expire_after_n_days', '7'); + $enforceDefaultExpireDate = \OCP\Config::getAppValue('core', 'shareapi_enforce_expire_date', 'no'); +} + $array = array( "oc_debug" => (defined('DEBUG') && DEBUG) ? 'true' : 'false', "oc_isadmin" => OC_User::isAdminUser(OC_User::getUser()) ? 'true' : 'false', @@ -67,6 +74,14 @@ $array = array( 'versionstring' => OC_Util::getVersionString(), ) ), + "oc_appconfig" => json_encode( + array("core" => array( + 'defaultExpireDateEnabled' => $defaultExpireDateEnabled, + 'defaultExpireDate' => $defaultExpireDate, + 'defaultExpireDateEnforced' => $enforceDefaultExpireDate, + ) + ) + ), "oc_defaults" => json_encode( array( 'entity' => $defaults->getEntity(), diff --git a/core/js/share.js b/core/js/share.js index 54da171b726..9ceca85bff7 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -219,7 +219,18 @@ OC.Share={ html += '<div id="link">'; html += '<input type="checkbox" name="linkCheckbox" id="linkCheckbox" value="1" /><label for="linkCheckbox">'+t('core', 'Share link')+'</label>'; html += '<br />'; + + var defaultExpireMessage = ''; + if ((itemType === 'folder' || itemType === 'file') && oc_appconfig.core.defaultExpireDateEnabled === 'yes') { + if (oc_appconfig.core.defaultExpireDateEnforced === 'yes') { + defaultExpireMessage = t('core', 'The public link will expire no later than {days} days after it is created', {'days': oc_appconfig.core.defaultExpireDate}) + '<br/>'; + } else { + defaultExpireMessage = t('core', 'By default the public link will expire after {days} days', {'days': oc_appconfig.core.defaultExpireDate}) + '<br/>'; + } + } + html += '<input id="linkText" type="text" readonly="readonly" />'; + html += '<input type="checkbox" name="showPassword" id="showPassword" value="1" style="display:none;" /><label for="showPassword" style="display:none;">'+t('core', 'Password protect')+'</label>'; html += '<div id="linkPass">'; html += '<input id="linkPassText" type="password" placeholder="'+t('core', 'Password')+'" />'; @@ -239,6 +250,7 @@ OC.Share={ html += '<div id="expiration">'; html += '<input type="checkbox" name="expirationCheckbox" id="expirationCheckbox" value="1" /><label for="expirationCheckbox">'+t('core', 'Set expiration date')+'</label>'; html += '<input id="expirationDate" type="text" placeholder="'+t('core', 'Expiration date')+'" style="display:none; width:90%;" />'; + html += '<div id="defaultExpireMessage">'+defaultExpireMessage+'</div>'; html += '</div>'; dropDownEl = $(html); dropDownEl = dropDownEl.appendTo(appendTo); @@ -490,19 +502,20 @@ OC.Share={ $('#linkPassText').attr('placeholder', '**********'); } $('#expiration').show(); + $('#defaultExpireMessage').show(); $('#emailPrivateLink #email').show(); $('#emailPrivateLink #emailButton').show(); $('#allowPublicUploadWrapper').show(); }, hideLink:function() { $('#linkText').hide('blind'); + $('#defaultExpireMessage').hide(); $('#showPassword').hide(); $('#showPassword+label').hide(); $('#linkPass').hide(); $('#emailPrivateLink #email').hide(); $('#emailPrivateLink #emailButton').hide(); $('#allowPublicUploadWrapper').hide(); - $('#expirationDate').hide(); }, dirname:function(path) { return path.replace(/\\/g,'/').replace(/\/[^\/]*$/, ''); @@ -734,6 +747,9 @@ $(document).ready(function() { OC.dialogs.alert(t('core', 'Error unsetting expiration date'), t('core', 'Error')); } $('#expirationDate').hide('blind'); + if (oc_appconfig.core.defaultExpireDateEnforced === 'no') { + $('#defaultExpireMessage'). show('blind'); + } }); } }); @@ -756,6 +772,10 @@ $(document).ready(function() { expirationDateField.tipsy({gravity: 'n', fade: true}); expirationDateField.tipsy('show'); expirationDateField.addClass('error'); + } else { + if (oc_appconfig.core.defaultExpireDateEnforced === 'no') { + $('#defaultExpireMessage'). hide('blind'); + } } }); }); |