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
Better debug output on public pages
Signed-off-by: John Molakvoæ (skjnldsv) <[email protected]>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
  • Loading branch information
skjnldsv authored and backportbot[bot] committed Oct 16, 2020
commit da1832a4e8752e605a989674b8069e4352deed92
4 changes: 2 additions & 2 deletions js/files_pdfviewer-public.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/files_pdfviewer-public.js.map

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ import isPdf from './utils/isPdf'
import isSecureViewerAvailable from './utils/isSecureViewerAvailable'

window.addEventListener('DOMContentLoaded', function() {
if (isPublicPage() && isPdf() && !isSecureViewerAvailable()) {
console.debug('Files_PDFViewer initialized for public page', {
isPublicPage: isPublicPage(),
canDownload: canDownload(),
isSecureViewerAvailable: isSecureViewerAvailable(),
})
console.debug('Files_PDFViewer initialized for public page', {
isPublicPage: isPublicPage(),
canDownload: canDownload(),
isSecureViewerAvailable: isSecureViewerAvailable(),
})

if (isPublicPage() && isPdf() && !isSecureViewerAvailable()) {
const page = location.hash.split('page=')[1] || 0
const contentElmt = document.getElementById('files-public-content')
const sharingTokenElmt = document.getElementById('sharingToken')
Expand Down