From 31ebea0f6a9f6e26068b819d7d5989bf42a518af Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Sat, 26 Jan 2013 13:25:15 -0500 Subject: [PATCH 1/4] Permanently display shared status icons --- core/css/styles.css | 4 ++-- core/js/share.js | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index 022acab4d8a..7fb800f79e2 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -195,8 +195,8 @@ fieldset.warning legend { color:#b94a48 !important; } #notification { z-index:101; background-color:#fc4; border:0; padding:0 .7em .3em; display:none; position: relative; top:0; -moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em; -moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; } #notification span { cursor:pointer; font-weight:bold; margin-left:1em; } -tr .action, .selectedActions a { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0; } -tr:hover .action, .selectedActions a { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; filter:alpha(opacity=50); opacity:.5; } +tr .action:not(.permanent), .selectedActions a { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0; } +tr:hover .action, tr .action.permanent, .selectedActions a { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; filter:alpha(opacity=50); opacity:.5; } tr .action { width:16px; height:16px; } .header-action { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; filter:alpha(opacity=80); opacity:.8; } tr:hover .action:hover, .selectedActions a:hover, .header-action:hover { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter:alpha(opacity=100); opacity:1; } diff --git a/core/js/share.js b/core/js/share.js index bb3ec010ff5..d404b910e48 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -23,7 +23,9 @@ OC.Share={ } else { var file = $('tr').filterAttr('data-file', OC.basename(item)); if (file.length > 0) { - $(file).find('.fileactions .action').filterAttr('data-action', 'Share').find('img').attr('src', image); + var action = $(file).find('.fileactions .action').filterAttr('data-action', 'Share'); + action.find('img').attr('src', image); + action.addClass('permanent'); } var dir = $('#dir').val(); if (dir.length > 1) { @@ -32,9 +34,11 @@ OC.Share={ // Search for possible parent folders that are shared while (path != last) { if (path == item) { - var img = $('.fileactions .action').filterAttr('data-action', 'Share').find('img'); + var action = $('.fileactions .action').filterAttr('data-action', 'Share'); + var img = action.find('img'); if (img.attr('src') != OC.imagePath('core', 'actions/public')) { img.attr('src', image); + action.addClass('permanent'); } } last = path; @@ -48,7 +52,8 @@ OC.Share={ }, updateIcon:function(itemType, itemSource) { if (itemType == 'file' || itemType == 'folder') { - var filename = $('tr').filterAttr('data-id', String(itemSource)).data('file'); + var file = $('tr').filterAttr('data-id', String(itemSource)); + var filename = file.data('file'); if ($('#dir').val() == '/') { itemSource = $('#dir').val() + filename; } else { @@ -75,6 +80,14 @@ OC.Share={ }); if (itemType != 'file' && itemType != 'folder') { $('a.share[data-item="'+itemSource+'"]').css('background', 'url('+image+') no-repeat center'); + } else { + var action = $(file).find('.fileactions .action').filterAttr('data-action', 'Share'); + action.find('img').attr('src', image); + if (shares) { + action.addClass('permanent'); + } else { + action.removeClass('permanent'); + } } if (shares) { OC.Share.statuses[itemSource] = link; From 01b3c088a9d8fb150f841f401d3e5668d228b098 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Mon, 28 Jan 2013 19:47:51 +0100 Subject: [PATCH 2/4] fix color change on click --- apps/files/css/files.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 0c97b009b88..e65f724f688 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -104,7 +104,7 @@ table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; } #fileList tr:hover .fileactions { /* background to distinguish when overlaying with file names */ background:rgba(248,248,248,.9); box-shadow:-5px 0 7px rgba(248,248,248,.9); } -#fileList tr.selected:hover .fileactions { /* slightly darker color for selected rows */ +#fileList tr.selected:hover .fileactions, #fileList tr.mouseOver .fileactions { /* slightly darker color for selected rows */ background:rgba(238,238,238,.9); box-shadow:-5px 0 7px rgba(238,238,238,.9); } #fileList .fileactions a.action img { position:relative; top:.2em; } From ede7fccb004ed5e8fba95fb0ca90b8ba773aa56f Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Mon, 28 Jan 2013 23:13:38 -0500 Subject: [PATCH 3/4] Change file action text to 'Shared' --- core/js/share.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/js/share.js b/core/js/share.js index d404b910e48..1e3a34b7452 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -26,6 +26,7 @@ OC.Share={ var action = $(file).find('.fileactions .action').filterAttr('data-action', 'Share'); action.find('img').attr('src', image); action.addClass('permanent'); + action.html(action.html().replace(t('core', 'Share'), t('core', 'Shared'))); } var dir = $('#dir').val(); if (dir.length > 1) { @@ -85,8 +86,10 @@ OC.Share={ action.find('img').attr('src', image); if (shares) { action.addClass('permanent'); + action.html(action.html().replace(t('core', 'Share'), t('core', 'Shared'))); } else { action.removeClass('permanent'); + action.html(action.html().replace(t('core', 'Shared'), t('core', 'Share'))); } } if (shares) { From ed2ee8c411cdae7679944a8b6aac05425a51faed Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Mon, 28 Jan 2013 23:16:29 -0500 Subject: [PATCH 4/4] Change file action text for files inside shared folders as well --- core/js/share.js | 1 + 1 file changed, 1 insertion(+) diff --git a/core/js/share.js b/core/js/share.js index 1e3a34b7452..b9b7201dd8b 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -40,6 +40,7 @@ OC.Share={ if (img.attr('src') != OC.imagePath('core', 'actions/public')) { img.attr('src', image); action.addClass('permanent'); + action.html(action.html().replace(t('core', 'Share'), t('core', 'Shared'))); } } last = path;