Show correct public link url for folders

This commit is contained in:
Michael Gapczynski 2012-10-03 16:17:36 -04:00
parent 51321526e2
commit 7bee735877
1 changed files with 2 additions and 1 deletions

View File

@ -306,13 +306,14 @@ OC.Share={
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&file='+file;
var link = parent.location.protocol+'//'+location.host+OC.linkTo('', 'public.php')+'?service=files&'+type+'='+file;
$('#linkText').val(link);
$('#linkText').show('blind');
$('#showPassword').show();