diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-07-03 17:00:23 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-07-03 17:00:23 -0400 |
commit | 1ad5e3e39f7e1c6d8279cf8e06781a8e6512b9fe (patch) | |
tree | 2c85e978c37e8c36969892905b4604d7ed8944f5 /core | |
parent | db33765e3662a6492c765bc737b3986a41ee82b9 (diff) | |
download | nextcloud-server-1ad5e3e39f7e1c6d8279cf8e06781a8e6512b9fe.tar.gz nextcloud-server-1ad5e3e39f7e1c6d8279cf8e06781a8e6512b9fe.zip |
Add parameter to showDropDown to not show private link UI, only files can be shared as private links
Diffstat (limited to 'core')
-rw-r--r-- | core/js/share.js | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/core/js/share.js b/core/js/share.js index 2dc2a54ee54..755e71e996e 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -63,20 +63,23 @@ OC.Share={ } }); }, - showDropDown:function(itemType, item, appendTo) { + showDropDown:function(itemType, item, appendTo, privateLink) { var html = '<div id="dropdown" class="drop" data-item-type="'+itemType+'" data-item="'+item+'">'; // TODO replace with autocomplete textbox html += '<input id="shareWith" type="text" placeholder="Share with" />'; html += '<ul id="shareWithList">'; html += '</ul>'; - html += '<div id="privateLink">'; - html += '<input type="checkbox" name="privateLinkCheckbox" id="privateLinkCheckbox" value="1" /><label for="privateLinkCheckbox">Share with private link</label>'; - html += '<br />'; - html += '<form id="emailPrivateLink">'; - html += '<input id="privateLinkText" style="display:none; width:90%;" />'; - html += '<input id="email" style="display:none; width:65%;" value="" placeholder="Email link to person" />'; - html += '<input id="emailButton" style="display:none;" type="submit" value="Send" />'; - html += '</form>'; + if (privateLink) { + html += '<div id="privateLink">'; + html += '<input type="checkbox" name="privateLinkCheckbox" id="privateLinkCheckbox" value="1" /><label for="privateLinkCheckbox">Share with private link</label>'; + html += '<br />'; + html += '<form id="emailPrivateLink">'; + html += '<input id="privateLinkText" style="display:none; width:90%;" />'; + html += '<input id="email" style="display:none; width:65%;" value="" placeholder="Email link to person" />'; + html += '<input id="emailButton" style="display:none;" type="submit" value="Send" />'; + html += '</form>'; + html += '</div>'; + } html += '</div>'; $(html).appendTo(appendTo); var data = OC.Share.loadItem(itemType, item); @@ -148,7 +151,11 @@ $(document).ready(function() { $('.share').live('click', function() { if ($(this).data('item-type') !== undefined && $(this).data('item') !== undefined) { - OC.Share.showDropDown($(this).data('item-type'), $(this).data('item'), $(this).parent().parent()); + var privateLink = false; + if ($(this).data('private-link') !== undefined && $(this).data('private-link') == true) { + privateLink = true; + } + OC.Share.showDropDown($(this).data('item-type'), $(this).data('item'), $(this).parent().parent(), privateLink); } }); @@ -187,12 +194,12 @@ $(document).ready(function() { OC.Share.hideDropDown(function () { $('tr').removeClass('mouseOver'); $('tr').filterAttr('data-file', filename).addClass('mouseOver'); - OC.Share.showDropDown('file', item, appendTo); + OC.Share.showDropDown('file', item, appendTo, true); }); } } else { $('tr').filterAttr('data-file',filename).addClass('mouseOver'); - OC.Share.showDropDown('file', item, appendTo); + OC.Share.showDropDown('file', item, appendTo, true); } }); } |