summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2011-08-11 11:15:17 -0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2011-08-11 11:15:17 -0400
commit2af0269eb93c4511edbb300a43795e0b3c0e2209 (patch)
tree6e72701a594a567fa83f202e9dd1411d2d591a8f /apps/files_sharing
parent103d23b3a3b1399112f5628c3f36d5d427be7030 (diff)
parent568fd0df833ccc9c546242b53ce620b0c59e71b9 (diff)
downloadnextcloud-server-2af0269eb93c4511edbb300a43795e0b3c0e2209.tar.gz
nextcloud-server-2af0269eb93c4511edbb300a43795e0b3c0e2209.zip
Merge branch 'sharing' of git://anongit.kde.org/owncloud into sharing
Conflicts: apps/files_sharing/js/share.js
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/js/share.js23
-rw-r--r--apps/files_sharing/templates/list.php24
2 files changed, 30 insertions, 17 deletions
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index eb075f0c43f..9cf3f5f6589 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -1,8 +1,10 @@
$(document).ready(function() {
- FileActions.register('all', 'Share', OC.imagePath('core', 'actions/share'), function(filename) {
- createDropdown(filename, $('#dir').val()+'/'+filename);
- });
-
+ if (typeof FileActions !== 'undefined') {
+ FileActions.register('all', 'Share', OC.imagePath('core', 'actions/share'), function(filename) {
+ createDropdown(filename, $('#dir').val()+'/'+filename);
+ });
+ };
+
$('.share').click(function(event) {
event.preventDefault();
var filenames = getSelectedFiles('name');
@@ -13,6 +15,17 @@ $(document).ready(function() {
}
createDropdown(false, files);
});
+
+ $(this).click(function(event) {
+ if ($(event.target).parents().index($('#dropdown')) == -1) {
+ if ($('#dropdown').is(':visible')) {
+ $('#dropdown').hide('blind', function() {
+ $('#dropdown').remove();
+ $('tr').removeClass('mouseOver');
+ });
+ }
+ }
+ });
$(this).click(function(event) {
if ($(event.target).parents().index($('#dropdown')) == -1) {
@@ -182,6 +195,6 @@ function addUser(uid_shared_with, permissions, parentFolder) {
user += "<a href='' title='Unshare' class='unshare' style='display:none;'><img class='svg' src='"+OC.imagePath('core','actions/delete')+"'/></a></li>";
}
$('#share_with option[value="'+uid_shared_with+'"]').remove();
- $('share_with').trigger('liszt:updated');
+ $('#share_with').trigger('liszt:updated');
$(user).appendTo('#shared_list');
}
diff --git a/apps/files_sharing/templates/list.php b/apps/files_sharing/templates/list.php
index 76b30b31b09..7faf2cf4ba6 100644
--- a/apps/files_sharing/templates/list.php
+++ b/apps/files_sharing/templates/list.php
@@ -1,6 +1,6 @@
<fieldset>
<legend>Your Shared Files</legend>
- <table id='itemlist'>
+ <table id="itemlist">
<thead>
<tr>
<th>Item</th>
@@ -10,19 +10,19 @@
</thead>
<tbody>
<?php foreach($_['shared_items'] as $item):?>
- <tr class='item'>
- <td class='source'><?php echo substr($item['source'], strlen("/".$_SESSION['user_id']."/files/"));?></td>
- <td class='uid_shared_with'><?php echo $item['uid_shared_with'];?></td>
- <td class='permissions'><?php echo "Read"; echo($item['permissions'] & OC_SHARE::WRITE ? ", Edit" : ""); echo($item['permissions'] & OC_SHARE::DELETE ? ", Delete" : "");?></td>
- <td><button class='delete fancybutton' data-source='<?php echo $item['source'];?>' data-uid_shared_with='<?php echo $item['uid_shared_with'];?>'>Delete</button></td>
+ <tr class="item">
+ <td class="source"><?php echo substr($item['source'], strlen("/".$_SESSION['user_id']."/files/"));?></td>
+ <td class="uid_shared_with"><?php echo $item['uid_shared_with'];?></td>
+ <td class="permissions"><?php echo "Read"; echo($item['permissions'] & OC_SHARE::WRITE ? ", Edit" : ""); echo($item['permissions'] & OC_SHARE::DELETE ? ", Delete" : "");?></td>
+ <td><button class="delete" data-source="<?php echo $item['source'];?>" data-uid_shared_with="<?php echo $item['uid_shared_with'];?>">Delete</button></td>
</tr>
<?php endforeach;?>
- <tr id='share_item_row'>
- <form action='#' id='share_item'>
- <td class='source'><input placeholder='Item' id='source'/></td>
- <td class='uid_shared_with'><input placeholder='Share With' id='uid_shared_with'/></td>
- <td class='permissions'><input placeholder='Permissions' id='permissions'/></td>
- <td><input type='submit' value='Share'/></td>
+ <tr id="share_item_row">
+ <form action="#" id="share_item">
+ <td class="source"><input placeholder="Item" id="source" /></td>
+ <td class="uid_shared_with"><input placeholder="Share With" id="uid_shared_with" /></td>
+ <td class="permissions"><input placeholder="Permissions" id="permissions" /></td>
+ <td><input type="submit" value="Share" /></td>
</form>
</tr>
</tbody>