diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index 0562c3cb132..a519ec6d5c9 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -1,34 +1,10 @@
$(document).ready(function() {
FileActions.register('all', 'Share', OC.imagePath('core', 'actions/share'), function(filename) {
- var html = "
";
- html += "
";
- html += "
";
- html += "
";
- html += "
";
- html += "
";
- html += "TODO: Construct a public link";
- html += "";
- html += "
";
- html += "
";
- html += "
";
- html += "
";
- $(html).dialog({
- close: function(event, ui) {
- $(this).remove();
- }
- });
+ createShareDialog(filename);
+ });
+ $('.share').click(function(event) {
+ event.preventDefault();
+ createShareDialog(getSelectedFiles('name'));
});
$("input[name=share_type]").live('change', function() {
$('#private').toggle();
@@ -91,4 +67,36 @@ $(document).ready(function() {
});
}
});
-});
\ No newline at end of file
+});
+
+function createShareDialog(files) {
+ var html = "
";
+ html += "
";
+ html += "
";
+ html += "
";
+ html += "
";
+ html += "
";
+ html += "TODO: Construct a public link";
+ html += "";
+ html += "
";
+ html += "
";
+ html += "
";
+ html += "
";
+ $(html).dialog({
+ close: function(event, ui) {
+ $(this).remove();
+ }
+ });
+}
\ No newline at end of file
diff --git a/files/templates/index.php b/files/templates/index.php
index df78cf0bb2d..304ef4fe9aa 100644
--- a/files/templates/index.php
+++ b/files/templates/index.php
@@ -29,7 +29,7 @@
t( 'Name' ); ?>
-
+