$(document).ready(function() { FileActions.register('all', 'Share', OC.imagePath('core', 'actions/share'), function(filename) { createShareDialog(filename, $('#dir').val()+'/'+filename); }); $('.share').click(function(event) { event.preventDefault(); var filenames = getSelectedFiles('name'); var length = filenames.length; var files = ''; for (var i = 0; i < length; i++) { files += $('#dir').val()+'/'+filenames[i]+';'; } var lastFileName = filenames.pop(); if (filenames.length > 0) { filenames = filenames.join(', ')+' and '+lastFileName; } else { filenames = lastFileName; } createShareDialog(filenames, files); }); $('#uid_shared_with').live('keyup', function() { $(this).autocomplete({ source: '../apps/files_sharing/ajax/userautocomplete.php' }); }); $('button.remove-uid_shared_with').live('click', function(event) { event.preventDefault(); alert("remove"); // TODO Remove corresponding row }); }); function createShareDialog(filenames, files) { var html = "