summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <hey@jancborchardt.net>2017-04-12 15:04:12 +0200
committerJan-Christoph Borchardt <hey@jancborchardt.net>2017-04-12 15:04:12 +0200
commit37145a275f9188290afa38683216c860aea00f91 (patch)
tree341141bdce54d4aaab4002ce87242a40a647d3ab /apps/files_sharing
parentaf42ca20252b166bec2da34970137ec790a18328 (diff)
downloadnextcloud-server-37145a275f9188290afa38683216c860aea00f91.tar.gz
nextcloud-server-37145a275f9188290afa38683216c860aea00f91.zip
Fix AdBlock blocking share icon, ref #866
Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/css/sharebreadcrumb.scss4
-rw-r--r--apps/files_sharing/js/app.js5
-rw-r--r--apps/files_sharing/js/share.js2
-rw-r--r--apps/files_sharing/js/sharebreadcrumbview.js8
-rw-r--r--apps/files_sharing/tests/js/shareSpec.js20
-rw-r--r--apps/files_sharing/tests/js/sharedbreadcrumviewSpec.js24
6 files changed, 31 insertions, 32 deletions
diff --git a/apps/files_sharing/css/sharebreadcrumb.scss b/apps/files_sharing/css/sharebreadcrumb.scss
index 792c8a31b7c..f3096f45013 100644
--- a/apps/files_sharing/css/sharebreadcrumb.scss
+++ b/apps/files_sharing/css/sharebreadcrumb.scss
@@ -20,7 +20,7 @@
*
*/
-div.crumb span.icon-share,
+div.crumb span.icon-shared,
div.crumb span.icon-public {
display: inline-block;
cursor: pointer;
@@ -28,7 +28,7 @@ div.crumb span.icon-public {
margin-right: 6px;
}
-div.crumb span.icon-share.shared,
+div.crumb span.icon-shared.shared,
div.crumb span.icon-public.shared {
opacity: 0.7;
}
diff --git a/apps/files_sharing/js/app.js b/apps/files_sharing/js/app.js
index 6f12b3d4456..e6c9159eda4 100644
--- a/apps/files_sharing/js/app.js
+++ b/apps/files_sharing/js/app.js
@@ -40,7 +40,7 @@ OCA.Sharing.App = {
this._extendFileList(this._inFileList);
this._inFileList.appName = t('files_sharing', 'Shared with you');
- this._inFileList.$el.find('#emptycontent').html('<div class="icon-share"></div>' +
+ this._inFileList.$el.find('#emptycontent').html('<div class="icon-shared"></div>' +
'<h2>' + t('files_sharing', 'Nothing shared with you yet') + '</h2>' +
'<p>' + t('files_sharing', 'Files and folders others share with you will show up here') + '</p>');
return this._inFileList;
@@ -63,7 +63,7 @@ OCA.Sharing.App = {
this._extendFileList(this._outFileList);
this._outFileList.appName = t('files_sharing', 'Shared with others');
- this._outFileList.$el.find('#emptycontent').html('<div class="icon-share"></div>' +
+ this._outFileList.$el.find('#emptycontent').html('<div class="icon-shared"></div>' +
'<h2>' + t('files_sharing', 'Nothing shared yet') + '</h2>' +
'<p>' + t('files_sharing', 'Files and folders you share will show up here') + '</p>');
return this._outFileList;
@@ -194,4 +194,3 @@ $(document).ready(function() {
OCA.Sharing.App.removeSharingLinks();
});
});
-
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index ed516efc3c9..c40ca07b76b 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -154,7 +154,7 @@
altText: t('core', 'Share'),
mime: 'all',
permissions: OC.PERMISSION_ALL,
- iconClass: 'icon-share',
+ iconClass: 'icon-shared',
type: OCA.Files.FileActions.TYPE_INLINE,
actionHandler: function(fileName) {
fileList.showDetailsView(fileName, 'shareTabView');
diff --git a/apps/files_sharing/js/sharebreadcrumbview.js b/apps/files_sharing/js/sharebreadcrumbview.js
index 36bbddfaec4..64d2df52d2c 100644
--- a/apps/files_sharing/js/sharebreadcrumbview.js
+++ b/apps/files_sharing/js/sharebreadcrumbview.js
@@ -44,21 +44,21 @@
if (this._dirInfo !== null && (this._dirInfo.path !== '/' || this._dirInfo.name !== '')) {
var isShared = data.dirInfo && data.dirInfo.shareTypes && data.dirInfo.shareTypes.length > 0;
- this.$el.removeClass('shared icon-public icon-share');
+ this.$el.removeClass('shared icon-public icon-shared');
if (isShared) {
this.$el.addClass('shared');
if (data.dirInfo.shareTypes.indexOf(OC.Share.SHARE_TYPE_LINK) !== -1) {
this.$el.addClass('icon-public');
} else {
- this.$el.addClass('icon-share');
+ this.$el.addClass('icon-shared');
}
} else {
- this.$el.addClass('icon-share');
+ this.$el.addClass('icon-shared');
}
this.$el.show();
this.delegateEvents();
} else {
- this.$el.removeClass('shared icon-public icon-share');
+ this.$el.removeClass('shared icon-public icon-shared');
this.$el.hide();
}
diff --git a/apps/files_sharing/tests/js/shareSpec.js b/apps/files_sharing/tests/js/shareSpec.js
index c34234bfe13..7568b06f27c 100644
--- a/apps/files_sharing/tests/js/shareSpec.js
+++ b/apps/files_sharing/tests/js/shareSpec.js
@@ -84,7 +84,7 @@ describe('OCA.Sharing.Util tests', function() {
}]);
$tr = fileList.$el.find('tbody tr:first');
$action = $tr.find('.action-share');
- expect($action.find('.icon').hasClass('icon-share')).toEqual(true);
+ expect($action.find('.icon').hasClass('icon-shared')).toEqual(true);
expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
expect(OC.basename(getImageUrl($tr.find('.filename .thumbnail')))).toEqual('folder.svg');
});
@@ -104,7 +104,7 @@ describe('OCA.Sharing.Util tests', function() {
$tr = fileList.$el.find('tbody tr:first');
$action = $tr.find('.action-share');
expect($action.find('>span').text().trim()).toEqual('Shared');
- expect($action.find('.icon').hasClass('icon-share')).toEqual(true);
+ expect($action.find('.icon').hasClass('icon-shared')).toEqual(true);
expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
expect(OC.basename(getImageUrl($tr.find('.filename .thumbnail')))).toEqual('folder-shared.svg');
});
@@ -125,7 +125,7 @@ describe('OCA.Sharing.Util tests', function() {
$tr = fileList.$el.find('tbody tr:first');
$action = $tr.find('.action-share');
expect($action.find('>span').text().trim()).toEqual('Shared');
- expect($action.find('.icon').hasClass('icon-share')).toEqual(false);
+ expect($action.find('.icon').hasClass('icon-shared')).toEqual(false);
expect($action.find('.icon').hasClass('icon-public')).toEqual(true);
expect(OC.basename(getImageUrl($tr.find('.filename .thumbnail')))).toEqual('folder-public.svg');
});
@@ -146,7 +146,7 @@ describe('OCA.Sharing.Util tests', function() {
$tr = fileList.$el.find('tbody tr:first');
$action = $tr.find('.action-share');
expect($action.find('>span').text().trim()).toEqual('User One');
- expect($action.find('.icon').hasClass('icon-share')).toEqual(true);
+ expect($action.find('.icon').hasClass('icon-shared')).toEqual(true);
expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
expect(OC.basename(getImageUrl($tr.find('.filename .thumbnail')))).toEqual('folder-shared.svg');
});
@@ -167,7 +167,7 @@ describe('OCA.Sharing.Util tests', function() {
$tr = fileList.$el.find('tbody tr:first');
$action = $tr.find('.action-share');
expect($action.find('>span').text().trim()).toEqual('Shared with User One, User Two');
- expect($action.find('.icon').hasClass('icon-share')).toEqual(true);
+ expect($action.find('.icon').hasClass('icon-shared')).toEqual(true);
expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
expect(OC.basename(getImageUrl($tr.find('.filename .thumbnail')))).toEqual('folder-shared.svg');
});
@@ -274,7 +274,7 @@ describe('OCA.Sharing.Util tests', function() {
expect($tr.attr('data-share-recipients')).toEqual('Group One, Group Two, User One, User Two');
expect($action.find('>span').text().trim()).toEqual('Shared with Group One, Group Two, User One, User Two');
- expect($action.find('.icon').hasClass('icon-share')).toEqual(true);
+ expect($action.find('.icon').hasClass('icon-shared')).toEqual(true);
expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
});
it('updates share icon after updating shares of a file', function() {
@@ -307,7 +307,7 @@ describe('OCA.Sharing.Util tests', function() {
expect($tr.attr('data-share-recipients')).toEqual('User One, User Three, User Two');
expect($action.find('>span').text().trim()).toEqual('Shared with User One, User Three, User Two');
- expect($action.find('.icon').hasClass('icon-share')).toEqual(true);
+ expect($action.find('.icon').hasClass('icon-shared')).toEqual(true);
expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
});
it('removes share icon after removing all shares from a file', function() {
@@ -363,7 +363,7 @@ describe('OCA.Sharing.Util tests', function() {
expect($tr.attr('data-share-recipients')).toEqual('User Two');
expect($action.find('>span').text().trim()).toEqual('User One');
- expect($action.find('.icon').hasClass('icon-share')).toEqual(true);
+ expect($action.find('.icon').hasClass('icon-shared')).toEqual(true);
expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
});
it('keep share text after unsharing reshare', function() {
@@ -394,7 +394,7 @@ describe('OCA.Sharing.Util tests', function() {
expect($tr.attr('data-share-recipients')).not.toBeDefined();
expect($action.find('>span').text().trim()).toEqual('User One');
- expect($action.find('.icon').hasClass('icon-share')).toEqual(true);
+ expect($action.find('.icon').hasClass('icon-shared')).toEqual(true);
expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
});
});
@@ -469,5 +469,5 @@ describe('OCA.Sharing.Util tests', function() {
expect($('[data-share-recipient]').length).toEqual(0);
});
});
-
+
});
diff --git a/apps/files_sharing/tests/js/sharedbreadcrumviewSpec.js b/apps/files_sharing/tests/js/sharedbreadcrumviewSpec.js
index 501dd819fa8..c58e038c4ab 100644
--- a/apps/files_sharing/tests/js/sharedbreadcrumviewSpec.js
+++ b/apps/files_sharing/tests/js/sharedbreadcrumviewSpec.js
@@ -57,7 +57,7 @@ describe('OCA.Sharing.ShareBreadCrumbView tests', function() {
bc.setDirectory('');
bc.render();
expect(bc.$el.hasClass('breadcrumb')).toEqual(true);
- expect(bc.$el.find('.icon-share').length).toEqual(0);
+ expect(bc.$el.find('.icon-shared').length).toEqual(0);
expect(bc.$el.find('.shared').length).toEqual(0);
expect(bc.$el.find('.icon-public').length).toEqual(0);
});
@@ -71,7 +71,7 @@ describe('OCA.Sharing.ShareBreadCrumbView tests', function() {
bc.setDirectory('/foo');
bc.render();
expect(bc.$el.hasClass('breadcrumb')).toEqual(true);
- expect(bc.$el.find('.icon-share').length).toEqual(1);
+ expect(bc.$el.find('.icon-shared').length).toEqual(1);
expect(bc.$el.find('.shared').length).toEqual(0);
expect(bc.$el.find('.icon-public').length).toEqual(0);
});
@@ -86,7 +86,7 @@ describe('OCA.Sharing.ShareBreadCrumbView tests', function() {
bc.setDirectory('/foo');
bc.render();
expect(bc.$el.hasClass('breadcrumb')).toEqual(true);
- expect(bc.$el.find('.icon-share').length).toEqual(1);
+ expect(bc.$el.find('.icon-shared').length).toEqual(1);
expect(bc.$el.find('.shared').length).toEqual(1);
expect(bc.$el.find('.icon-public').length).toEqual(0);
});
@@ -101,7 +101,7 @@ describe('OCA.Sharing.ShareBreadCrumbView tests', function() {
bc.setDirectory('/foo');
bc.render();
expect(bc.$el.hasClass('breadcrumb')).toEqual(true);
- expect(bc.$el.find('.icon-share').length).toEqual(1);
+ expect(bc.$el.find('.icon-shared').length).toEqual(1);
expect(bc.$el.find('.shared').length).toEqual(1);
expect(bc.$el.find('.icon-public').length).toEqual(0);
});
@@ -116,7 +116,7 @@ describe('OCA.Sharing.ShareBreadCrumbView tests', function() {
bc.setDirectory('/foo');
bc.render();
expect(bc.$el.hasClass('breadcrumb')).toEqual(true);
- expect(bc.$el.find('.icon-share').length).toEqual(0);
+ expect(bc.$el.find('.icon-shared').length).toEqual(0);
expect(bc.$el.find('.shared').length).toEqual(1);
expect(bc.$el.find('.icon-public').length).toEqual(1);
});
@@ -131,7 +131,7 @@ describe('OCA.Sharing.ShareBreadCrumbView tests', function() {
bc.setDirectory('/foo');
bc.render();
expect(bc.$el.hasClass('breadcrumb')).toEqual(true);
- expect(bc.$el.find('.icon-share').length).toEqual(1);
+ expect(bc.$el.find('.icon-shared').length).toEqual(1);
expect(bc.$el.find('.shared').length).toEqual(1);
expect(bc.$el.find('.icon-public').length).toEqual(0);
});
@@ -146,7 +146,7 @@ describe('OCA.Sharing.ShareBreadCrumbView tests', function() {
bc.setDirectory('/foo');
bc.render();
expect(bc.$el.hasClass('breadcrumb')).toEqual(true);
- expect(bc.$el.find('.icon-share').length).toEqual(1);
+ expect(bc.$el.find('.icon-shared').length).toEqual(1);
expect(bc.$el.find('.shared').length).toEqual(1);
expect(bc.$el.find('.icon-public').length).toEqual(0);
});
@@ -168,7 +168,7 @@ describe('OCA.Sharing.ShareBreadCrumbView tests', function() {
bc.setDirectory('/foo');
bc.render();
expect(bc.$el.hasClass('breadcrumb')).toEqual(true);
- expect(bc.$el.find('.icon-share').length).toEqual(0);
+ expect(bc.$el.find('.icon-shared').length).toEqual(0);
expect(bc.$el.find('.shared').length).toEqual(1);
expect(bc.$el.find('.icon-public').length).toEqual(1);
});
@@ -188,7 +188,7 @@ describe('OCA.Sharing.ShareBreadCrumbView tests', function() {
mock.showDetailsView = function() { };
OCA.Files.App.fileList = mock;
var spy = sinon.spy(mock, 'showDetailsView');
- bc.$el.find('.icon-share').click();
+ bc.$el.find('.icon-shared').click();
expect(spy.calledOnce).toEqual(true);
@@ -199,7 +199,7 @@ describe('OCA.Sharing.ShareBreadCrumbView tests', function() {
shareTab.trigger('sharesChanged', model);
expect(bc.$el.hasClass('breadcrumb')).toEqual(true);
- expect(bc.$el.find('.icon-share').length).toEqual(1);
+ expect(bc.$el.find('.icon-shared').length).toEqual(1);
expect(bc.$el.find('.shared').length).toEqual(0);
expect(bc.$el.find('.icon-public').length).toEqual(0);
});
@@ -219,7 +219,7 @@ describe('OCA.Sharing.ShareBreadCrumbView tests', function() {
mock.showDetailsView = function() { };
OCA.Files.App.fileList = mock;
var spy = sinon.spy(mock, 'showDetailsView');
- bc.$el.find('.icon-share').click();
+ bc.$el.find('.icon-shared').click();
expect(spy.calledOnce).toEqual(true);
@@ -232,7 +232,7 @@ describe('OCA.Sharing.ShareBreadCrumbView tests', function() {
shareTab.trigger('sharesChanged', model);
expect(bc.$el.hasClass('breadcrumb')).toEqual(true);
- expect(bc.$el.find('.icon-share').length).toEqual(0);
+ expect(bc.$el.find('.icon-shared').length).toEqual(0);
expect(bc.$el.find('.shared').length).toEqual(1);
expect(bc.$el.find('.icon-public').length).toEqual(1);
});