From f0c1f38f98e3e329f0dc352c8e01d2375e67322c Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Fri, 29 Jul 2011 15:43:29 -0400 Subject: [PATCH] Add share action for mutliple selected files --- apps/files_sharing/js/share.js | 68 +++++++++++++++++++--------------- files/templates/index.php | 2 +- 2 files changed, 39 insertions(+), 31 deletions(-) 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 += ""; - html += "
"; - html += "Advanced"; - html += "
"; - html += ""; - 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 += ""; + html += "
"; + html += "Advanced"; + html += "
"; + html += ""; + 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' ); ?> Download - + t( 'Size MB' ); ?>