Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ $(function(){
for (var i = 0; i < activity.previews.length; i++) {
var preview = activity.previews[i];
content += ((preview.link) ? '<a href="' + preview.link + '">' + "\n" : '')
+ '<img class="preview' + ((preview.isMimeTypeIcon) ? ' preview-mimetype-icon' : '') + '" src="' + preview.source + '" alt="' + t('activity', 'Open file') + '" />' + "\n"
+ '<img class="preview' + ((preview.isMimeTypeIcon) ? ' preview-mimetype-icon' : '') + '" src="' + preview.source + '" alt="' + t('activity', 'Open {filename}', preview) + '" />' + "\n"
+ ((preview.link) ? '</a>' + "\n" : '')
}
content += '</div>';
Expand Down
2 changes: 2 additions & 0 deletions lib/Controller/APIv2Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ protected function getPreview(string $owner, int $fileId, string $filePath): arr
'isMimeTypeIcon' => true,
'fileId' => $fileId,
'view' => $info['view'] ?: 'files',
'filename' => basename($filePath),
];

// show a preview image if the file still exists
Expand Down Expand Up @@ -401,6 +402,7 @@ protected function getPreviewFromPath(int $fileId, string $filePath, array $info
'isMimeTypeIcon' => true,
'fileId' => $fileId,
'view' => $info['view'] ?: 'files',
'filename' => basename($filePath),
];
}

Expand Down
3 changes: 3 additions & 0 deletions tests/Controller/APIv2ControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ public function testGetPreview(string $author, int $fileId, string $path, string
'isMimeTypeIcon' => $isMimeTypeIcon,
'fileId' => $fileId,
'view' => 'files',
'filename' => basename($path),
]);
}

Expand All @@ -775,6 +776,7 @@ public function testGetPreview(string $author, int $fileId, string $path, string
'isMimeTypeIcon' => $isMimeTypeIcon,
'fileId' => $fileId,
'view' => 'files',
'filename' => basename($path),
], self::invokePrivate($controller, 'getPreview', [$author, $fileId, $path]));
}

Expand Down Expand Up @@ -820,6 +822,7 @@ public function testGetPreviewFromPath(int $fileId, string $filePath, string $mi
'isMimeTypeIcon' => true,
'fileId' => $fileId,
'view' => $view ?: 'files',
'filename' => basename($filePath),
],
self::invokePrivate($controller, 'getPreviewFromPath', [$fileId, $filePath, ['path' => $filePath, 'is_dir' => $isDir, 'view' => $view]])
);
Expand Down