diff options
-rw-r--r-- | apps/files/js/mainfileinfodetailview.js | 9 | ||||
-rw-r--r-- | apps/files/tests/js/mainfileinfodetailviewSpec.js | 29 | ||||
-rw-r--r-- | apps/files_external/l10n/it.js | 1 | ||||
-rw-r--r-- | apps/files_external/l10n/it.json | 1 | ||||
-rw-r--r-- | config/config.sample.php | 9 | ||||
-rw-r--r-- | core/css/styles.scss | 2 | ||||
-rw-r--r-- | core/js/jquery.avatar.js | 5 | ||||
-rw-r--r-- | core/js/placeholder.js | 1 | ||||
-rw-r--r-- | core/js/tests/specs/jquery.avatarSpec.js | 2 |
9 files changed, 43 insertions, 16 deletions
diff --git a/apps/files/js/mainfileinfodetailview.js b/apps/files/js/mainfileinfodetailview.js index ea3063f6176..626ab86ded3 100644 --- a/apps/files/js/mainfileinfodetailview.js +++ b/apps/files/js/mainfileinfodetailview.js @@ -20,9 +20,11 @@ '</a>' + '</div>' + ' <div class="file-details ellipsis">' + + ' {{#if hasFavoriteAction}}' + ' <a href="#" class="action action-favorite favorite permanent">' + ' <span class="icon {{starClass}}" title="{{starAltText}}"></span>' + ' </a>' + + ' {{/if}}' + ' {{#if hasSize}}<span class="size" title="{{altSize}}">{{size}}</span>, {{/if}}<span class="date live-relative-timestamp" data-timestamp="{{timestamp}}" title="{{altDate}}">{{date}}</span>' + ' </div>' + '</div>' + @@ -175,6 +177,12 @@ if (this.model) { var isFavorite = (this.model.get('tags') || []).indexOf(OC.TAG_FAVORITE) >= 0; + var availableActions = this._fileActions.get( + this.model.get('mimetype'), + this.model.get('type'), + this.model.get('permissions') + ); + var hasFavoriteAction = 'Favorite' in availableActions; this.$el.html(this.template({ type: this.model.isImage()? 'image': '', nameLabel: t('files', 'Name'), @@ -189,6 +197,7 @@ altDate: OC.Util.formatDate(this.model.get('mtime')), timestamp: this.model.get('mtime'), date: OC.Util.relativeModifiedDate(this.model.get('mtime')), + hasFavoriteAction: hasFavoriteAction, starAltText: isFavorite ? t('files', 'Favorited') : t('files', 'Favorite'), starClass: isFavorite ? 'icon-starred' : 'icon-star', permalink: this._makePermalink(this.model.get('id')), diff --git a/apps/files/tests/js/mainfileinfodetailviewSpec.js b/apps/files/tests/js/mainfileinfodetailviewSpec.js index faf0faa8d8f..0201429a472 100644 --- a/apps/files/tests/js/mainfileinfodetailviewSpec.js +++ b/apps/files/tests/js/mainfileinfodetailviewSpec.js @@ -68,6 +68,12 @@ describe('OCA.Files.MainFileInfoDetailView tests', function() { .toEqual(OC.getProtocol() + '://' + OC.getHost() + OC.generateUrl('/f/5')); }); it('displays favorite icon', function() { + fileActions.registerAction({ + name: 'Favorite', + mime: 'all', + permissions: OC.PERMISSION_NONE + }); + testFileInfo.set('tags', [OC.TAG_FAVORITE]); view.setFileInfo(testFileInfo); expect(view.$el.find('.action-favorite > span').hasClass('icon-starred')).toEqual(true); @@ -78,6 +84,15 @@ describe('OCA.Files.MainFileInfoDetailView tests', function() { expect(view.$el.find('.action-favorite > span').hasClass('icon-starred')).toEqual(false); expect(view.$el.find('.action-favorite > span').hasClass('icon-star')).toEqual(true); }); + it('does not display favorite icon if favorite action is not available', function() { + testFileInfo.set('tags', [OC.TAG_FAVORITE]); + view.setFileInfo(testFileInfo); + expect(view.$el.find('.action-favorite').length).toEqual(0); + + testFileInfo.set('tags', []); + view.setFileInfo(testFileInfo); + expect(view.$el.find('.action-favorite').length).toEqual(0); + }); it('displays mime icon', function() { // File var lazyLoadPreviewStub = sinon.stub(fileList, 'lazyLoadPreview'); @@ -183,6 +198,13 @@ describe('OCA.Files.MainFileInfoDetailView tests', function() { expect(view.$el.find('.fileName h3').attr('title')).toEqual('hello.txt'); }); it('rerenders when changes are made on the model', function() { + // Show the "Favorite" icon + fileActions.registerAction({ + name: 'Favorite', + mime: 'all', + permissions: OC.PERMISSION_NONE + }); + view.setFileInfo(testFileInfo); testFileInfo.set('tags', [OC.TAG_FAVORITE]); @@ -196,6 +218,13 @@ describe('OCA.Files.MainFileInfoDetailView tests', function() { expect(view.$el.find('.action-favorite > span').hasClass('icon-star')).toEqual(true); }); it('unbinds change listener from model', function() { + // Show the "Favorite" icon + fileActions.registerAction({ + name: 'Favorite', + mime: 'all', + permissions: OC.PERMISSION_NONE + }); + view.setFileInfo(testFileInfo); view.setFileInfo(new OCA.Files.FileInfoModel({ id: 999, diff --git a/apps/files_external/l10n/it.js b/apps/files_external/l10n/it.js index e19f6a657db..4bd2908b431 100644 --- a/apps/files_external/l10n/it.js +++ b/apps/files_external/l10n/it.js @@ -75,6 +75,7 @@ OC.L10N.register( "Region" : "Regione", "Enable SSL" : "Abilita SSL", "Enable Path Style" : "Abilita stile percorsi", + "Legacy (v2) authentication" : "Autenticazione tradizionale (v2)", "WebDAV" : "WebDAV", "URL" : "URL", "Remote subfolder" : "Sottocartella remota", diff --git a/apps/files_external/l10n/it.json b/apps/files_external/l10n/it.json index ecb8d2082e6..36d4b296199 100644 --- a/apps/files_external/l10n/it.json +++ b/apps/files_external/l10n/it.json @@ -73,6 +73,7 @@ "Region" : "Regione", "Enable SSL" : "Abilita SSL", "Enable Path Style" : "Abilita stile percorsi", + "Legacy (v2) authentication" : "Autenticazione tradizionale (v2)", "WebDAV" : "WebDAV", "URL" : "URL", "Remote subfolder" : "Sottocartella remota", diff --git a/config/config.sample.php b/config/config.sample.php index 05efcaa2738..7a815657ef4 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -859,15 +859,6 @@ $CONFIG = array( * Defaults to ``2048`` */ 'preview_max_y' => 2048, -/** - * If a lot of small pictures are stored on the Nextcloud instance and the - * preview system generates blurry previews, you might want to consider setting - * a maximum scale factor. By default, pictures are upscaled to 10 times the - * original size. A value of ``1`` or ``null`` disables scaling. - * - * Defaults to ``2`` - */ -'preview_max_scale_factor' => 10, /** * max file size for generating image previews with imagegd (default behavior) diff --git a/core/css/styles.scss b/core/css/styles.scss index b782c4e558a..4b02041976b 100644 --- a/core/css/styles.scss +++ b/core/css/styles.scss @@ -234,7 +234,7 @@ body { padding: 0; margin: 0; background-color: rgba($color-main-background, 0.95); - z-index: 55; + z-index: 60; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js index 958f0f9edd7..6da86341c1e 100644 --- a/core/js/jquery.avatar.js +++ b/core/js/jquery.avatar.js @@ -110,9 +110,8 @@ // If the new image loads successfully set it. img.onload = function() { - $div.text(''); - $div.append(img); $div.clearimageplaceholder(); + $div.append(img); if(typeof callback === 'function') { callback(); @@ -127,7 +126,6 @@ $div.imageplaceholder(user, displayname); } else { setAvatarForUnknownUser($div); - $div.removeClass('icon-loading'); } if(typeof callback === 'function') { @@ -136,7 +134,6 @@ }; $div.addClass('icon-loading'); - $div.show(); img.width = size; img.height = size; img.src = url; diff --git a/core/js/placeholder.js b/core/js/placeholder.js index 5cf7b9095ad..29f91b6698d 100644 --- a/core/js/placeholder.js +++ b/core/js/placeholder.js @@ -156,6 +156,7 @@ this.css('text-align', ''); this.css('line-height', ''); this.css('font-size', ''); + this.html(''); this.removeClass('icon-loading'); }; }(jQuery)); diff --git a/core/js/tests/specs/jquery.avatarSpec.js b/core/js/tests/specs/jquery.avatarSpec.js index bdd1fdcc163..4e13b7f26ff 100644 --- a/core/js/tests/specs/jquery.avatarSpec.js +++ b/core/js/tests/specs/jquery.avatarSpec.js @@ -202,8 +202,6 @@ describe('jquery.avatar tests', function() { expect(window.Image().height).toEqual(32); expect(window.Image().width).toEqual(32); expect(window.Image().src).toEqual('http://localhost/index.php/avatar/foo/32'); - - expect($div.css('display')).toEqual('block'); }); it('callback called', function() { |