Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <hey@jancborchardt.net>2017-11-16 19:27:20 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-03-20 21:09:03 +0300
commitce7775acd04a00db92604827df1ea503c551f588 (patch)
tree19bbf5b5aeb3140b5108c2d8f5f96388e65f0acd /core/js/sharedialogview.js
parent29c551c88ff42e4cd0699787f038175b01e56980 (diff)
Replace information icon with confirmation button in share input
The confirmation button right now is just an icon; its behaviour will be added in the following commits. Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
Diffstat (limited to 'core/js/sharedialogview.js')
-rw-r--r--core/js/sharedialogview.js53
1 files changed, 9 insertions, 44 deletions
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js
index d2c63490141..f8f3efce2c5 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>'+
- '{{{shareInfo}}}' +
+ ' <span class="shareWithConfirm icon icon-confirm"></span>' +
'</div>' +
'{{/if}}' +
'<div class="shareeListView subView"></div>' +
@@ -30,10 +30,6 @@
'<div class="expirationView subView"></div>' +
'<div class="loading hidden" style="height: 50px"></div>';
- var TEMPLATE_SHARE_INFO =
- '<span class="icon icon-info shareWithRemoteInfo hasTooltip" ' +
- 'title="{{tooltip}}"></span>';
-
/**
* @class OCA.Share.ShareDialogView
* @member {OC.Share.ShareItemModel} model
@@ -142,7 +138,7 @@
var $shareWithField = $('.shareWithField'),
view = this,
$loading = this.$el.find('.shareWithLoading'),
- $shareInfo = this.$el.find('.shareWithRemoteInfo');
+ $confirm = this.$el.find('.shareWithConfirm');
var count = oc_config['sharing.minSearchStringLength'];
if (search.term.trim().length < count) {
@@ -167,7 +163,7 @@
$loading.removeClass('hidden');
$loading.addClass('inlineblock');
- $shareInfo.addClass('hidden');
+ $confirm.addClass('hidden');
$shareWithField.removeClass('error')
.tooltip('hide');
@@ -184,7 +180,7 @@
function (result) {
$loading.addClass('hidden');
$loading.removeClass('inlineblock');
- $shareInfo.removeClass('hidden');
+ $confirm.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);
@@ -318,7 +314,7 @@
).fail(function() {
$loading.addClass('hidden');
$loading.removeClass('inlineblock');
- $shareInfo.removeClass('hidden');
+ $confirm.removeClass('hidden');
OC.Notification.show(t('core', 'An error occurred. Please try again'));
window.setTimeout(OC.Notification.hide, 5000);
});
@@ -363,22 +359,22 @@
var $loading = this.$el.find('.shareWithLoading');
$loading.removeClass('hidden')
.addClass('inlineblock');
- var $shareInfo = this.$el.find('.shareWithRemoteInfo');
- $shareInfo.addClass('hidden');
+ var $confirm = this.$el.find('.shareWithConfirm');
+ $confirm.addClass('hidden');
this.model.addShare(s.item.value, {success: function() {
$(e.target).val('')
.attr('disabled', false);
$loading.addClass('hidden')
.removeClass('inlineblock');
- $shareInfo.removeClass('hidden');
+ $confirm.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');
- $shareInfo.removeClass('hidden');
+ $confirm.removeClass('hidden');
}});
},
@@ -416,7 +412,6 @@
cid: this.cid,
shareLabel: t('core', 'Share'),
sharePlaceholder: this._renderSharePlaceholderPart(),
- shareInfo: this._renderShareInfoPart(),
isSharingAllowed: this.model.sharePermissionPossible()
}));
@@ -461,27 +456,6 @@
this.linkShareView.showLink = this._showLink;
},
- _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 shareInfo;
- },
-
_renderSharePlaceholderPart: function () {
var allowRemoteSharing = this.configModel.get('isRemoteShareAllowed');
var allowMailSharing = this.configModel.get('isMailShareAllowed');
@@ -513,15 +487,6 @@
return this._templates[key];
},
- /**
- * returns the info template for remote sharing
- *
- * @returns {Function}
- * @private
- */
- _getShareInfoTemplate: function() {
- return this._getTemplate('shareInfo', TEMPLATE_SHARE_INFO);
- }
});
OC.Share.ShareDialogView = ShareDialogView;