summaryrefslogtreecommitdiffstats
path: root/core/js/share.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js/share.js')
-rw-r--r--core/js/share.js18
1 files changed, 5 insertions, 13 deletions
diff --git a/core/js/share.js b/core/js/share.js
index 8fcea84af88..879befd95ba 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -179,7 +179,7 @@ OC.Share={
if (data.shares) {
$.each(data.shares, function(index, share) {
if (share.share_type == OC.Share.SHARE_TYPE_LINK) {
- OC.Share.showLink(itemSource, share.share_with);
+ OC.Share.showLink(share.token, share.share_with);
} else {
if (share.collection) {
OC.Share.addShareWith(share.share_type, share.share_with, share.permissions, possiblePermissions, share.collection);
@@ -323,18 +323,10 @@ OC.Share={
$('#expiration').show();
}
},
- showLink:function(itemSource, password) {
+ showLink:function(token, password) {
OC.Share.itemShares[OC.Share.SHARE_TYPE_LINK] = true;
$('#linkCheckbox').attr('checked', true);
- var filename = $('tr').filterAttr('data-id', String(itemSource)).data('file');
- var type = $('tr').filterAttr('data-id', String(itemSource)).data('type');
- if ($('#dir').val() == '/') {
- var file = $('#dir').val() + filename;
- } else {
- var file = $('#dir').val() + '/' + filename;
- }
- file = '/'+OC.currentUser+'/files'+file;
- var link = parent.location.protocol+'//'+location.host+OC.linkTo('', 'public.php')+'?service=files&'+type+'='+encodeURIComponent(file);
+ var link = parent.location.protocol+'//'+location.host+OC.linkTo('', 'public.php')+'?service=files&t='+token;
$('#linkText').val(link);
$('#linkText').show('blind');
$('#showPassword').show();
@@ -480,8 +472,8 @@ $(document).ready(function() {
var itemSource = $('#dropdown').data('item-source');
if (this.checked) {
// Create a link
- OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, '', OC.PERMISSION_READ, function() {
- OC.Share.showLink(itemSource);
+ OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, '', OC.PERMISSION_READ, function(data) {
+ OC.Share.showLink(data.token);
OC.Share.updateIcon(itemType, itemSource);
});
} else {