Skip to content
Snippets Groups Projects
Commit f0c1f38f authored by Michael Gapczynski's avatar Michael Gapczynski
Browse files

Add share action for mutliple selected files

parent 5fd77084
Branches
No related tags found
No related merge requests found
$(document).ready(function() { $(document).ready(function() {
FileActions.register('all', 'Share', OC.imagePath('core', 'actions/share'), function(filename) { FileActions.register('all', 'Share', OC.imagePath('core', 'actions/share'), function(filename) {
var html = "<div id='dialog' title='Share "+getSelectedFiles('name')+"' align='center'>"; createShareDialog(filename);
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>"; $('.share').click(function(event) {
html += "<br />"; event.preventDefault();
html += "<div id='private'>"; createShareDialog(getSelectedFiles('name'));
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();
}
});
}); });
$("input[name=share_type]").live('change', function() { $("input[name=share_type]").live('change', function() {
$('#private').toggle(); $('#private').toggle();
...@@ -91,4 +67,36 @@ $(document).ready(function() { ...@@ -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
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<span class='name'><?php echo $l->t( 'Name' ); ?></span> <span class='name'><?php echo $l->t( 'Name' ); ?></span>
<span class='selectedActions'> <span class='selectedActions'>
<a href="" title="Download" class="download"><img class='svg' alt="Download" src="../core/img/actions/download.svg" /></a> <a href="" title="Download" class="download"><img class='svg' alt="Download" src="../core/img/actions/download.svg" /></a>
<!--<a href="" title="" class="share">Share</a>--> <a href="" title="Share" class="share"><img class='svg' alt="Share" src="../core/img/actions/share.svg" /></a>
</span> </span>
</th> </th>
<th id='headerSize'><?php echo $l->t( 'Size MB' ); ?></th> <th id='headerSize'><?php echo $l->t( 'Size MB' ); ?></th>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment