Browse Source
Merge pull request #115 from nonmakina/pdfThumbnail
Turns on thumbnails for pdf and djvu filetypes
pull/40/head
towards-a-new-leftypol
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
1 deletions
-
inc/instance-config.php
-
js/inline-expanding.js
|
|
@ -133,6 +133,9 @@ $config['max_filesize'] = 50 * 1024 * 1024; // 50MB |
|
|
|
$config['webm']['allow_audio'] = true; |
|
|
|
$config['webm']['max_length'] = 1000; |
|
|
|
|
|
|
|
$config['pdf_file_thumbnail'] = true; |
|
|
|
$config['djvu_file_thumbnail'] = true; |
|
|
|
|
|
|
|
// Allowed image file extensions. |
|
|
|
$config['allowed_ext'][] = 'jpg'; |
|
|
|
$config['allowed_ext'][] = 'jpeg'; |
|
|
|
|
|
@ -100,7 +100,8 @@ $(document).ready(function(){ |
|
|
|
|
|
|
|
for (var i = 0; i < link.length; i++) { |
|
|
|
if (typeof link[i] == "object" && link[i].childNodes && typeof link[i].childNodes[0] !== 'undefined' && |
|
|
|
link[i].childNodes[0].src && link[i].childNodes[0].className.match(/post-image/) && !link[i].className.match(/file/)) { |
|
|
|
link[i].childNodes[0].src && link[i].childNodes[0].className.match(/post-image/) && !link[i].className.match(/file/) && |
|
|
|
!link[i].href.match("\\.(pdf|djvu|djv)$") ) { |
|
|
|
link[i].onclick = function(e) { |
|
|
|
var img, post_body, still_open, canvas, scroll; |
|
|
|
var thumb = this.childNodes[0]; |
|
|
|