From f0c1f38f98e3e329f0dc352c8e01d2375e67322c Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Fri, 29 Jul 2011 15:43:29 -0400 Subject: Add share action for mutliple selected files --- apps/files_sharing/js/share.js | 68 +++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 30 deletions(-) (limited to 'apps/files_sharing/js') 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 -- cgit v1.2.3