diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2017-03-19 20:45:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-19 20:45:55 +0100 |
commit | ef789f8480a152e1a31b8598f9e2f3b8e08b9088 (patch) | |
tree | 439c0386a64e5378daef2375646864f0c456d6ee /core | |
parent | 6677963902297d95dd7f73854e2a6b1ea3873a4e (diff) | |
parent | 69694012ab0eca1ec1f3dc0d2b10a3b1728b0927 (diff) | |
download | nextcloud-server-ef789f8480a152e1a31b8598f9e2f3b8e08b9088.tar.gz nextcloud-server-ef789f8480a152e1a31b8598f9e2f3b8e08b9088.zip |
Merge pull request #3906 from nextcloud/shares-circles-2
Support Circles
Diffstat (limited to 'core')
-rw-r--r-- | core/js/share.js | 1 | ||||
-rw-r--r-- | core/js/sharedialogshareelistview.js | 4 | ||||
-rw-r--r-- | core/js/sharedialogview.js | 20 |
3 files changed, 23 insertions, 2 deletions
diff --git a/core/js/share.js b/core/js/share.js index 5bde7e63f36..ba1afe08190 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -9,6 +9,7 @@ OC.Share = _.extend(OC.Share || {}, { SHARE_TYPE_LINK:3, SHARE_TYPE_EMAIL:4, SHARE_TYPE_REMOTE:6, + SHARE_TYPE_CIRCLE:7, /** * Regular expression for splitting parts of remote share owners: diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index 47dc62d14fe..e46a761db6c 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -158,6 +158,7 @@ shareWithDisplayName = shareWithDisplayName + " (" + t('core', 'remote') + ')'; } else if (shareType === OC.Share.SHARE_TYPE_EMAIL) { shareWithDisplayName = shareWithDisplayName + " (" + t('core', 'email') + ')'; + } else if (shareType === OC.Share.SHARE_TYPE_CIRCLE) { } if (shareType === OC.Share.SHARE_TYPE_GROUP) { @@ -166,6 +167,8 @@ shareWithTitle = shareWith + " (" + t('core', 'remote') + ')'; } else if (shareType === OC.Share.SHARE_TYPE_EMAIL) { shareWithTitle = shareWith + " (" + t('core', 'email') + ')'; + } else if (shareType === OC.Share.SHARE_TYPE_CIRCLE) { + shareWithTitle = shareWith; } return _.extend(hasPermissionOverride, { @@ -183,6 +186,7 @@ modSeed: shareType !== OC.Share.SHARE_TYPE_USER, isRemoteShare: shareType === OC.Share.SHARE_TYPE_REMOTE, isMailShare: shareType === OC.Share.SHARE_TYPE_EMAIL, + isCircleShare: shareType === OC.Share.SHARE_TYPE_CIRCLE, isFileSharedByMail: shareType === OC.Share.SHARE_TYPE_EMAIL && !this.model.isFolder() }); }, diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index a63960da2b8..58dd706fb1f 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -186,18 +186,24 @@ } else { var emails = []; } + if (typeof(result.ocs.data.circles) !== 'undefined') { + var circles = result.ocs.data.exact.circles.concat(result.ocs.data.circles); + } else { + var circles = []; + } var usersLength; var groupsLength; var remotesLength; var emailsLength; + var circlesLength; var lookupLength; var i, j; //Filter out the current user usersLength = users.length; - for (i = 0 ; i < usersLength; i++) { + for (i = 0; i < usersLength; i++) { if (users[i].value.shareWith === OC.currentUser) { users.splice(i, 1); break; @@ -254,10 +260,18 @@ break; } } + } else if (share.share_type === OC.Share.SHARE_TYPE_CIRCLE) { + circlesLength = circles.length; + for (j = 0; j < circlesLength; j++) { + if (circles[j].value.shareWith === share.share_with) { + circles.splice(j, 1); + break; + } + } } } - var suggestions = users.concat(groups).concat(remotes).concat(emails).concat(lookup); + var suggestions = users.concat(groups).concat(remotes).concat(emails).concat(circles).concat(lookup); if (suggestions.length > 0) { $shareWithField @@ -313,6 +327,8 @@ text = t('core', '{sharee} (remote)', { sharee: text }, undefined, { escape: false }); } else if (item.value.shareType === OC.Share.SHARE_TYPE_EMAIL) { text = t('core', '{sharee} (email)', { sharee: text }, undefined, { escape: false }); + } else if (item.value.shareType === OC.Share.SHARE_TYPE_CIRCLE) { + text = t('core', '{sharee} ({type}, {owner})', {sharee: text, type: item.value.circleInfo, owner: item.value.circleOwner}, undefined, {escape: false}); } var insert = $("<div class='share-autocomplete-item'/>"); var avatar = $("<div class='avatardiv'></div>").appendTo(insert); |