From d32e3870d21c8a65e822212505213755a338e97a Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Thu, 26 Mar 2015 18:30:55 +0100 Subject: [PATCH 1/7] add hint in Share placeholder on remote share syntax --- core/js/share.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/js/share.js b/core/js/share.js index 061ac6affa2..551e1bf09ab 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -391,8 +391,13 @@ OC.Share={ } }); + var sharePlaceholder = t('core', 'Share with users or groups …'); + if(oc_appconfig.core.remoteShareAllowed) { + sharePlaceholder = t('core', 'Share with users, groups or remote (user@domain) …'); + } + html += ''; - html += ''; + html += ''; html += ''; html += ''; From aab5f6b6df64001338d3214ece31b90251f13106 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 26 Mar 2015 18:32:46 +0100 Subject: [PATCH 2/7] add remote share status to the config --- core/js/config.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/js/config.php b/core/js/config.php index b57289fde48..d9a77b368ba 100644 --- a/core/js/config.php +++ b/core/js/config.php @@ -58,6 +58,9 @@ if ($defaultExpireDateEnabled) { $value = \OCP\Config::getAppValue('core', 'shareapi_enforce_expire_date', 'no'); $enforceDefaultExpireDate = ($value === 'yes') ? true : false; } +$appConfig = \OC::$server->getAppConfig(); +$result = $appConfig->getValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes'); +$outgoingServer2serverShareEnabled = ($result === 'yes') ? true : false; $array = array( "oc_debug" => (defined('DEBUG') && DEBUG) ? 'true' : 'false', @@ -110,6 +113,7 @@ $array = array( 'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(), 'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(), 'resharingAllowed' => \OCP\Share::isResharingAllowed(), + 'remoteShareAllowed' => $outgoingServer2serverShareEnabled ) ) ), From 0d3bea37c3256e3386b968c327a2b64e357522bd Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Thu, 26 Mar 2015 20:30:51 +0100 Subject: [PATCH 3/7] correct remote share hint --- core/js/share.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/js/share.js b/core/js/share.js index 551e1bf09ab..0a36ca2bdbb 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -393,7 +393,7 @@ OC.Share={ var sharePlaceholder = t('core', 'Share with users or groups …'); if(oc_appconfig.core.remoteShareAllowed) { - sharePlaceholder = t('core', 'Share with users, groups or remote (user@domain) …'); + sharePlaceholder = t('core', 'Share with users, groups or remote users …'); } html += ''; From 000b09ee7a4f6ee70ac7a02c5182d218eed91629 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Thu, 9 Apr 2015 10:16:29 +0200 Subject: [PATCH 4/7] add more present info about remote shares, fix layout of inputs --- core/css/share.css | 9 +++++++-- core/js/share.js | 10 ++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/core/css/share.css b/core/css/share.css index 448f0bac239..bcfd90e4204 100644 --- a/core/css/share.css +++ b/core/css/share.css @@ -37,8 +37,12 @@ display: none !important; } +#dropdown .shareWithRemoteInfo { + padding: 11px 20px; +} + #dropdown .avatar { - margin-right: 2px; + margin-right: 8px; display: inline-block; overflow: hidden; vertical-align: middle; @@ -108,7 +112,8 @@ a.unshare { } #dropdown input[type="text"],#dropdown input[type="password"] { - width:90%; + width: 86%; + margin-left: 7px; } #dropdown form { diff --git a/core/js/share.js b/core/js/share.js index 0a36ca2bdbb..646123a6055 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -398,6 +398,11 @@ OC.Share={ html += ''; html += ''; + if(oc_appconfig.core.remoteShareAllowed) { + html += ''; + } html += ''; html += '
    '; html += '
'; @@ -448,6 +453,11 @@ OC.Share={ dropDownEl = $(html); dropDownEl = dropDownEl.appendTo(appendTo); + // trigger remote share info tooltip + if(oc_appconfig.core.remoteShareAllowed) { + $('.shareWithRemoteInfo').tipsy({gravity: 'e'}); + } + //Get owner avatars if (oc_config.enable_avatars === true && data !== false && data.reshare !== false && data.reshare.uid_owner !== undefined) { dropDownEl.find(".avatar").avatar(data.reshare.uid_owner, 32); From 7f237223e521288e90726a606f390519f20c58e8 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Thu, 9 Apr 2015 12:11:42 +0200 Subject: [PATCH 5/7] fix remote share info icon for IE8 --- core/js/share.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/js/share.js b/core/js/share.js index 646123a6055..29551654435 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -399,7 +399,7 @@ OC.Share={ html += ''; html += ''; if(oc_appconfig.core.remoteShareAllowed) { - html += ''; } From 4a01d5c5883094f297c2c68628a8bac4a3b25586 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 9 Apr 2015 12:19:42 +0200 Subject: [PATCH 6/7] Fix config usage --- core/js/config.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/core/js/config.php b/core/js/config.php index d9a77b368ba..f2bc24008dc 100644 --- a/core/js/config.php +++ b/core/js/config.php @@ -50,17 +50,16 @@ foreach(OC_App::getEnabledApps() as $app) { $apps_paths[$app] = OC_App::getAppWebPath($app); } -$value = \OCP\Config::getAppValue('core', 'shareapi_default_expire_date', 'no'); +$config = \OC::$server->getConfig(); +$value = $config->getAppValue('core', 'shareapi_default_expire_date', 'no'); $defaultExpireDateEnabled = ($value === 'yes') ? true :false; $defaultExpireDate = $enforceDefaultExpireDate = null; if ($defaultExpireDateEnabled) { - $defaultExpireDate = (int)\OCP\Config::getAppValue('core', 'shareapi_expire_after_n_days', '7'); - $value = \OCP\Config::getAppValue('core', 'shareapi_enforce_expire_date', 'no'); + $defaultExpireDate = (int) $config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); + $value = $config->getAppValue('core', 'shareapi_enforce_expire_date', 'no'); $enforceDefaultExpireDate = ($value === 'yes') ? true : false; } -$appConfig = \OC::$server->getAppConfig(); -$result = $appConfig->getValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes'); -$outgoingServer2serverShareEnabled = ($result === 'yes') ? true : false; +$outgoingServer2serverShareEnabled = $config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes'; $array = array( "oc_debug" => (defined('DEBUG') && DEBUG) ? 'true' : 'false', From 6f51beac23c48384103457c26cda71a7c7f42fc1 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 9 Apr 2015 12:30:18 +0200 Subject: [PATCH 7/7] Correctly generate the doc link via go.php --- core/js/config.php | 3 ++- core/js/share.js | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/js/config.php b/core/js/config.php index f2bc24008dc..d6946f671d1 100644 --- a/core/js/config.php +++ b/core/js/config.php @@ -112,7 +112,8 @@ $array = array( 'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(), 'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(), 'resharingAllowed' => \OCP\Share::isResharingAllowed(), - 'remoteShareAllowed' => $outgoingServer2serverShareEnabled + 'remoteShareAllowed' => $outgoingServer2serverShareEnabled, + 'federatedCloudShareDoc' => \OC::$server->getURLGenerator()->linkToDocs('user-sharing-federated') ) ) ), diff --git a/core/js/share.js b/core/js/share.js index 29551654435..56925417bfb 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -399,9 +399,9 @@ OC.Share={ html += ''; html += ''; if(oc_appconfig.core.remoteShareAllowed) { - html += ''; + var federatedCloudSharingDoc = ''; + html += federatedCloudSharingDoc.replace('{docLink}', oc_appconfig.core.federatedCloudShareDoc); } html += ''; html += '
    ';