Sharing: Add a filename after public share link

We don't do anythink with the name, but it is nice to know the file the
link point to.
This commit is contained in:
Bart Visscher 2012-04-14 12:45:16 +02:00
parent 524bd2e75f
commit 5c55b9c5ac
1 changed files with 4 additions and 4 deletions

View File

@ -148,7 +148,7 @@ $(document).ready(function() {
data: data,
success: function(token) {
if (token) {
showPublicLink(token);
showPublicLink(token, source.substr(source.lastIndexOf('/')));
}
}
});
@ -206,7 +206,7 @@ function createDropdown(filename, files) {
if (users) {
$.each(users, function(index, row) {
if (row.uid_shared_with == 'public') {
showPublicLink(row.token);
showPublicLink(row.token, '/'+filename);
} else if (isNaN(index)) {
addUser(row.uid_shared_with, row.permissions, index.substr(0, index.lastIndexOf('-')));
} else {
@ -237,9 +237,9 @@ function addUser(uid_shared_with, permissions, parentFolder) {
$(user).appendTo('#shared_list');
}
function showPublicLink(token) {
function showPublicLink(token, file) {
$('#makelink').attr('checked', true);
$('#link').data('token', token);
$('#link').val(parent.location.protocol+'//'+location.host+OC.linkTo('files_sharing','get.php')+'?token='+token);
$('#link').val(parent.location.protocol+'//'+location.host+OC.linkTo('files_sharing','get.php')+'?token='+token+'&f='+file);
$('#link').show('blind');
}