diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2017-04-12 11:52:59 +0200 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2017-04-12 16:07:42 +0200 |
commit | a3c9dcf82a5b242f8b04bb6731522c151af08f0f (patch) | |
tree | f96a3626755c61dc7ca09f76d0a6df63dbbe7d91 /core | |
parent | b90e91144bc8d378f6f52025f04383ae2e7c647b (diff) | |
download | nextcloud-server-a3c9dcf82a5b242f8b04bb6731522c151af08f0f.tar.gz nextcloud-server-a3c9dcf82a5b242f8b04bb6731522c151af08f0f.zip |
change sharing tooltip with a more general description of all available share options
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/js/sharedialogview.js | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index 16a2be0c4a9..99a23cf9144 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -22,7 +22,7 @@ '<div class="oneline">' + ' <input id="shareWith-{{cid}}" class="shareWithField" type="text" placeholder="{{sharePlaceholder}}" />' + ' <span class="shareWithLoading icon-loading-small hidden"></span>'+ - '{{{remoteShareInfo}}}' + + '{{{shareInfo}}}' + '</div>' + '{{/if}}' + '<div class="shareeListView subView"></div>' + @@ -30,9 +30,9 @@ '<div class="expirationView subView"></div>' + '<div class="loading hidden" style="height: 50px"></div>'; - var TEMPLATE_REMOTE_SHARE_INFO = - '<a target="_blank" class="icon icon-info shareWithRemoteInfo hasTooltip" href="{{docLink}}" ' + - 'title="{{tooltip}}"></a>'; + var TEMPLATE_SHARE_INFO = + '<span class="icon icon-info shareWithRemoteInfo hasTooltip" ' + + 'title="{{tooltip}}"></span>'; /** * @class OCA.Share.ShareDialogView @@ -135,7 +135,7 @@ var $shareWithField = $('.shareWithField'), view = this, $loading = this.$el.find('.shareWithLoading'), - $remoteShareInfo = this.$el.find('.shareWithRemoteInfo'); + $shareInfo = this.$el.find('.shareWithRemoteInfo'); var count = oc_config['sharing.minSearchStringLength']; if (search.term.trim().length < count) { @@ -160,7 +160,7 @@ $loading.removeClass('hidden'); $loading.addClass('inlineblock'); - $remoteShareInfo.addClass('hidden'); + $shareInfo.addClass('hidden'); $shareWithField.removeClass('error') .tooltip('hide'); @@ -177,7 +177,7 @@ function (result) { $loading.addClass('hidden'); $loading.removeClass('inlineblock'); - $remoteShareInfo.removeClass('hidden'); + $shareInfo.removeClass('hidden'); if (result.ocs.meta.statuscode === 100) { var users = result.ocs.data.exact.users.concat(result.ocs.data.users); var groups = result.ocs.data.exact.groups.concat(result.ocs.data.groups); @@ -314,7 +314,7 @@ ).fail(function() { $loading.addClass('hidden'); $loading.removeClass('inlineblock'); - $remoteShareInfo.removeClass('hidden'); + $shareInfo.removeClass('hidden'); OC.Notification.show(t('core', 'An error occurred. Please try again')); window.setTimeout(OC.Notification.hide, 5000); }); @@ -359,22 +359,22 @@ var $loading = this.$el.find('.shareWithLoading'); $loading.removeClass('hidden') .addClass('inlineblock'); - var $remoteShareInfo = this.$el.find('.shareWithRemoteInfo'); - $remoteShareInfo.addClass('hidden'); + var $shareInfo = this.$el.find('.shareWithRemoteInfo'); + $shareInfo.addClass('hidden'); this.model.addShare(s.item.value, {success: function() { $(e.target).val('') .attr('disabled', false); $loading.addClass('hidden') .removeClass('inlineblock'); - $remoteShareInfo.removeClass('hidden'); + $shareInfo.removeClass('hidden'); }, error: function(obj, msg) { OC.Notification.showTemporary(msg); $(e.target).attr('disabled', false) .autocomplete('search', $(e.target).val()); $loading.addClass('hidden') .removeClass('inlineblock'); - $remoteShareInfo.removeClass('hidden'); + $shareInfo.removeClass('hidden'); }}); }, @@ -412,7 +412,7 @@ cid: this.cid, shareLabel: t('core', 'Share'), sharePlaceholder: this._renderSharePlaceholderPart(), - remoteShareInfo: this._renderRemoteShareInfoPart(), + shareInfo: this._renderShareInfoPart(), isSharingAllowed: this.model.sharePermissionPossible() })); @@ -457,17 +457,25 @@ this.linkShareView.showLink = this._showLink; }, - _renderRemoteShareInfoPart: function() { - var remoteShareInfo = ''; - if(this.configModel.get('isRemoteShareAllowed')) { - var infoTemplate = this._getRemoteShareInfoTemplate(); - remoteShareInfo = infoTemplate({ - docLink: this.configModel.getFederatedShareDocLink(), - tooltip: t('core', 'Share with people on other servers using their Federated Cloud ID username@example.com/nextcloud') + _renderShareInfoPart: function() { + var shareInfo = ''; + var infoTemplate = this._getShareInfoTemplate(); + + if(this.configModel.get('isMailShareAllowed') && this.configModel.get('isRemoteShareAllowed')) { + shareInfo = infoTemplate({ + tooltip: t('core', 'Share with other people by entering a user or group, a federated cloud ID or an email address.') + }); + } else if(this.configModel.get('isRemoteShareAllowed')) { + shareInfo = infoTemplate({ + tooltip: t('core', 'Share with other people by entering a user or group or a federated cloud ID.') + }); + } else if(this.configModel.get('isMailShareAllowed')) { + shareInfo = infoTemplate({ + tooltip: t('core', 'Share with other people by entering a user or group or an email address.') }); } - return remoteShareInfo; + return shareInfo; }, _renderSharePlaceholderPart: function () { @@ -520,8 +528,8 @@ * @returns {Function} * @private */ - _getRemoteShareInfoTemplate: function() { - return this._getTemplate('remoteShareInfo', TEMPLATE_REMOTE_SHARE_INFO); + _getShareInfoTemplate: function() { + return this._getTemplate('shareInfo', TEMPLATE_SHARE_INFO); } }); |