Merge pull request #797 from nextcloud/bugfix/noid/pdf
Do not open optional formats on public pages by default
This commit is contained in:
Коммит
bec33de319
|
@ -39,7 +39,7 @@ const odfViewer = {
|
|||
isCollaboraConfigured: typeof OC.getCapabilities().richdocuments.collabora === 'object' && OC.getCapabilities().richdocuments.collabora.length !== 0,
|
||||
supportedMimes: OC.getCapabilities().richdocuments.mimetypes.concat(OC.getCapabilities().richdocuments.mimetypesNoDefaultOpen),
|
||||
excludeMimeFromDefaultOpen: OC.getCapabilities().richdocuments.mimetypesNoDefaultOpen,
|
||||
hideDownloadMimes: ['image/jpeg', 'image/svg+xml', 'image/cgm', 'image/vnd.dxf', 'image/x-emf', 'image/x-wmf', 'image/x-wpg', 'image/x-freehand', 'image/bmp', 'image/png', 'image/gif', 'image/tiff', 'image/jpg', 'image/jpeg', 'text/plain'],
|
||||
hideDownloadMimes: ['image/jpeg', 'image/svg+xml', 'image/cgm', 'image/vnd.dxf', 'image/x-emf', 'image/x-wmf', 'image/x-wpg', 'image/x-freehand', 'image/bmp', 'image/png', 'image/gif', 'image/tiff', 'image/jpg', 'image/jpeg', 'text/plain', 'application/pdf'],
|
||||
|
||||
register() {
|
||||
const EDIT_ACTION_NAME = 'Edit with ' + OC.getCapabilities().richdocuments.productName
|
||||
|
@ -429,7 +429,7 @@ $(document).ready(function() {
|
|||
}
|
||||
|
||||
// Open documents if a public page is opened for a supported mimetype
|
||||
const isSupportedMime = isPublic && odfViewer.supportedMimes.indexOf($('#mimetype').val()) !== -1
|
||||
const isSupportedMime = isPublic && odfViewer.supportedMimes.indexOf($('#mimetype').val()) !== -1 && odfViewer.excludeMimeFromDefaultOpen.indexOf($('#mimetype').val()) === -1
|
||||
const showSecureView = isPublic && isDownloadHidden && odfViewer.hideDownloadMimes.indexOf($('#mimetype').val()) !== -1
|
||||
if (isSupportedMime || showSecureView) {
|
||||
odfViewer.onEdit(document.getElementById('filename').value)
|
||||
|
|
Загрузка…
Ссылка в новой задаче