diff options
-rw-r--r-- | apps/files_sharing/js/share.js | 68 | ||||
-rw-r--r-- | 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 = "<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 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 @@ <span class='name'><?php echo $l->t( 'Name' ); ?></span> <span class='selectedActions'> <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> </th> <th id='headerSize'><?php echo $l->t( 'Size MB' ); ?></th> |