summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2011-08-12 11:34:17 -0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2011-08-12 11:34:17 -0400
commita8e6be601698622753bc948924c4ef564ffccaaa (patch)
tree85b7157bdfd8b91253aab4e15ddcc0496fd661e6
parentd78b75a0d1a8221e7855a3f2061928b5ec0471d8 (diff)
downloadnextcloud-server-a8e6be601698622753bc948924c4ef564ffccaaa.tar.gz
nextcloud-server-a8e6be601698622753bc948924c4ef564ffccaaa.zip
Change the share file action icon if the file is already shared with someone
-rw-r--r--apps/files_sharing/css/sharing.css4
-rw-r--r--apps/files_sharing/js/share.js22
2 files changed, 22 insertions, 4 deletions
diff --git a/apps/files_sharing/css/sharing.css b/apps/files_sharing/css/sharing.css
index 152f43577ac..0759af2c274 100644
--- a/apps/files_sharing/css/sharing.css
+++ b/apps/files_sharing/css/sharing.css
@@ -4,5 +4,5 @@
-moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; }
#shared_list { padding:0.5em; list-style-type: none; }
#public { border-top:1px solid #ddd; padding-top:0.5em; }
-a.unshare { float:right; display:inline; margin:0 .5em; padding:.3em .3em 0 .3em !important; }
-a.unshare:hover { background:#fff; -moz-box-shadow:0 0 10px #fff; -webkit-box-shadow:0 0 10px #fff; box-shadow:0 0 10px #fff; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; } \ No newline at end of file
+a.unshare { float:right; display:inline; margin:0 .5em; padding:.3em .3em 0 .3em !important; opacity:.5; }
+a.unshare:hover { opacity:1; } \ No newline at end of file
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index 83a7a68cb3a..2e284b868e5 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -1,7 +1,25 @@
$(document).ready(function() {
if (typeof FileActions !== 'undefined') {
- FileActions.register('all', 'Share', OC.imagePath('core', 'actions/share'), function(filename) {
- if (($('#dropdown').length)) {
+ FileActions.register('all', 'Share', function(filename) {
+ var icon;
+ var file = $('#dir').val()+'/'+filename;
+ $.ajax({
+ type: 'GET',
+ url: OC.linkTo('files_sharing', 'ajax/getitem.php'),
+ dataType: 'json',
+ data: 'source='+file,
+ async: false,
+ success: function(users) {
+ if (users.length > 0) {
+ icon = OC.imagePath('core', 'actions/shared');
+ } else {
+ icon = OC.imagePath('core', 'actions/share');
+ }
+ }
+ });
+ return icon;
+ }, function(filename) {
+ if (($('#dropdown').length > 0)) {
$('#dropdown').hide('blind', function() {
var dropdownFile = $('#dropdown').data('file')
var file = $('#dir').val()+'/'+filename;