diff options
author | Michael Gapczynski <GapczynskiM@gmail.com> | 2011-08-11 16:56:09 -0400 |
---|---|---|
committer | Michael Gapczynski <GapczynskiM@gmail.com> | 2011-08-11 16:56:09 -0400 |
commit | 9e35d5a886b192b1ab3e19ca0e1b9608a39d60ac (patch) | |
tree | 71dea9d58e303287421caf24b1a8610e4c06a3b3 /apps/files_sharing/js/share.js | |
parent | c65046773dc2a594184e626dd7a29e52b58c14be (diff) | |
download | nextcloud-server-9e35d5a886b192b1ab3e19ca0e1b9608a39d60ac.tar.gz nextcloud-server-9e35d5a886b192b1ab3e19ca0e1b9608a39d60ac.zip |
Remove hardcoded http:// when generating public links
Diffstat (limited to 'apps/files_sharing/js/share.js')
-rw-r--r-- | apps/files_sharing/js/share.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 7931f00fb68..83a7a68cb3a 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -14,7 +14,6 @@ $(document).ready(function() { } else { createDropdown(filename, $('#dir').val()+'/'+filename); } - }); }; @@ -33,7 +32,7 @@ $(document).ready(function() { if (!($(event.target).hasClass('drop')) && $(event.target).parents().index($('#dropdown')) == -1) { if ($('#dropdown').is(':visible')) { $('#dropdown').hide('blind', function() { - $('#dropdown').remove();S + $('#dropdown').remove(); $('tr').removeClass('mouseOver'); }); } @@ -111,9 +110,7 @@ $(document).ready(function() { data: data, success: function(token) { if (token) { - $('#link').data('token', token); - $('#link').val('http://'+location.host+OC.linkTo('files_publiclink','get.php')+'?token='+token); - $('#link').show('blind'); + showPublicLink(token); } } }); @@ -178,10 +175,7 @@ function createDropdown(filename, files) { }); $.getJSON(OC.linkTo('files_publiclink', 'ajax/getlink.php'), { path: files }, function(token) { if (token) { - $('#makelink').attr('checked', true); - $('#link').data('token', token); - $('#link').val('http://'+location.host+OC.linkTo('files_publiclink','get.php')+'?token='+token); - $('#link').show(); + showPublicLink(token); } }); $('#dropdown').show('blind'); @@ -202,3 +196,10 @@ function addUser(uid_shared_with, permissions, parentFolder) { $('#share_with').trigger('liszt:updated'); $(user).appendTo('#shared_list'); } + +function showPublicLink(token) { + $('#makelink').attr('checked', true); + $('#link').data('token', token); + $('#link').val(parent.location.protocol+"//"+location.host+OC.linkTo('files_publiclink','get.php')+'?token='+token); + $('#link').show('blind'); +} |