diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2016-07-29 15:37:08 +0200 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2016-11-01 19:51:11 +0100 |
commit | 0a6f02801f333c17ca6455906bc816020883477d (patch) | |
tree | 790140cc6dd30d7ef9db50b281fca4769097119b /core/js/sharedialogview.js | |
parent | ef467c3195731cb1e4fff504b39c06b017deb5ec (diff) | |
download | nextcloud-server-0a6f02801f333c17ca6455906bc816020883477d.tar.gz nextcloud-server-0a6f02801f333c17ca6455906bc816020883477d.zip |
introduce share by mail, ui part
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'core/js/sharedialogview.js')
-rw-r--r-- | core/js/sharedialogview.js | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index 7efb361f512..78622faea29 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -154,10 +154,12 @@ var users = result.ocs.data.exact.users.concat(result.ocs.data.users); var groups = result.ocs.data.exact.groups.concat(result.ocs.data.groups); var remotes = result.ocs.data.exact.remotes.concat(result.ocs.data.remotes); + var emails = result.ocs.data.exact.emails.concat(result.ocs.data.emails); var usersLength; var groupsLength; var remotesLength; + var emailsLength; var i, j; @@ -212,10 +214,18 @@ break; } } + } else if (share.share_type === OC.Share.SHARE_TYPE_EMAIL) { + emailsLength = emails.length; + for (j = 0; j < emailsLength; j++) { + if (emails[j].value.shareWith === share.share_with) { + emails.splice(j, 1); + break; + } } } + } - var suggestions = users.concat(groups).concat(remotes); + var suggestions = users.concat(groups).concat(remotes).concat(emails); if (suggestions.length > 0) { $('.shareWithField').removeClass('error') @@ -268,6 +278,10 @@ sharee: text }); } + } else if (item.value.shareType === OC.Share.SHARE_TYPE_EMAIL) { + text = t('core', '{sharee} (email)', { + sharee: text + }); } var insert = $("<div class='share-autocomplete-item'/>"); var avatar = $("<div class='avatardiv'></div>").appendTo(insert); @@ -397,7 +411,7 @@ var infoTemplate = this._getRemoteShareInfoTemplate(); remoteShareInfo = infoTemplate({ docLink: this.configModel.getFederatedShareDocLink(), - tooltip: t('core', 'Share with people on other Nextclouds using the syntax username@example.com/nextcloud') + tooltip: t('core', 'Share with people on other servers using the syntax username@example.com/nextcloud') }); } @@ -405,16 +419,16 @@ }, _renderSharePlaceholderPart: function () { - var sharePlaceholder = t('core', 'Share with users…'); + var sharePlaceholder = t('core', 'Share with users, or by mail...'); if (this.configModel.get('allowGroupSharing')) { if (this.configModel.get('isRemoteShareAllowed')) { - sharePlaceholder = t('core', 'Share with users, groups or remote users…'); + sharePlaceholder = t('core', 'Share with users, groups, remote users, or by mail…'); } else { - sharePlaceholder = t('core', 'Share with users or groups…'); + sharePlaceholder = t('core', 'Share with users, groups or by mail...'); } } else if (this.configModel.get('isRemoteShareAllowed')) { - sharePlaceholder = t('core', 'Share with users or remote users…'); + sharePlaceholder = t('core', 'Share with users, remote users or by mail...'); } return sharePlaceholder; |