summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js/share.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/js/share.js')
-rw-r--r--apps/files_sharing/js/share.js19
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');
+}