From 5c55b9c5acb678e1e3e329c5926a1a11b83ab5fb Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Sat, 14 Apr 2012 12:45:16 +0200 Subject: 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. --- apps/files_sharing/js/share.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/files_sharing') diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 42851b35051..54d749d833e 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -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'); } -- cgit v1.2.3