Skip to content
Snippets Groups Projects
Commit 5c55b9c5 authored by Bart Visscher's avatar Bart Visscher
Browse files

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.
parent 524bd2e7
No related branches found
No related tags found
No related merge requests found
......@@ -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');
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment