aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2011-07-29 15:43:29 -0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2011-07-29 15:43:29 -0400
commitf0c1f38f98e3e329f0dc352c8e01d2375e67322c (patch)
tree38468abbf55c3dd839ce06e7654072181c0af368 /apps/files_sharing/js
parent5fd77084c44bf1d51939a71dcd57297bf4e8bd32 (diff)
downloadnextcloud-server-f0c1f38f98e3e329f0dc352c8e01d2375e67322c.tar.gz
nextcloud-server-f0c1f38f98e3e329f0dc352c8e01d2375e67322c.zip
Add share action for mutliple selected files
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r--apps/files_sharing/js/share.js68
1 files changed, 38 insertions, 30 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 = "<div id='dialog' title='Share "+getSelectedFiles('name')+"' align='center'>";
- html += "<label><input type='radio' name='share_type' value='private' checked='checked' /> Private</label>";
- html += "<label><input type='radio' name='share_type' value='public' /> Public</label>";
- html += "<br />";
- html += "<div id='private'>";
- html += "<label>Share with <input placeholder='User or Group' class='uid_shared_with' /></label>";
- html += "<button id='hey' class='add-uid_shared_with fancybutton'>+</button>";
- html += "<br />";
- html += "<a id='toggle-private-advanced'>Advanced</a>";
- html += "<br />";
- html += "<div id='private-advanced' style='display: none; text-align: left'>";
- html += "<label><input type='checkbox' name='share_permissions' value='read' checked='checked' disabled='disable' /> Read</label><br />";
- html += "<label><input type='checkbox' name='share_permissions' value='write' /> Write</label><br />";
- html += "<label><input type='checkbox' name='share_permissions' value='rename' /> Rename</label><br />";
- html += "<label><input type='checkbox' name='share_permissions' value='delete' /> Delete</label><br />";
- html += "</div>";
- html += "</div>";
- html += "<div id='public' style='display: none'>";
- html += "TODO: Construct a public link";
- html += "<input placeholder='Expires' id='expire' />";
- html += "</div>";
- html += "<br />";
- html += "<button class='submit fancybutton'>Share</button>";
- html += "<div>";
- $(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 = "<div id='dialog' title='Share "+files+"' align='center'>";
+ html += "<label><input type='radio' name='share_type' value='private' checked='checked' /> Private</label>";
+ html += "<label><input type='radio' name='share_type' value='public' /> Public</label>";
+ html += "<br />";
+ html += "<div id='private'>";
+ html += "<label>Share with <input placeholder='User or Group' class='uid_shared_with' /></label>";
+ html += "<button id='hey' class='add-uid_shared_with fancybutton'>+</button>";
+ html += "<br />";
+ html += "<a id='toggle-private-advanced'>Advanced</a>";
+ html += "<br />";
+ html += "<div id='private-advanced' style='display: none; text-align: left'>";
+ html += "<label><input type='checkbox' name='share_permissions' value='read' checked='checked' disabled='disable' /> Read</label><br />";
+ html += "<label><input type='checkbox' name='share_permissions' value='write' /> Write</label><br />";
+ html += "<label><input type='checkbox' name='share_permissions' value='rename' /> Rename</label><br />";
+ html += "<label><input type='checkbox' name='share_permissions' value='delete' /> Delete</label><br />";
+ html += "</div>";
+ html += "</div>";
+ html += "<div id='public' style='display: none'>";
+ html += "TODO: Construct a public link";
+ html += "<input placeholder='Expires' id='expire' />";
+ html += "</div>";
+ html += "<br />";
+ html += "<button class='submit fancybutton'>Share</button>";
+ html += "<div>";
+ $(html).dialog({
+ close: function(event, ui) {
+ $(this).remove();
+ }
+ });
+} \ No newline at end of file