From c34844cde8b9b58f4e8c24a8f26379f456500571 Mon Sep 17 00:00:00 2001 From: nonmakina Date: Sat, 9 Jan 2021 15:08:24 -0600 Subject: [PATCH 1/2] Turns on thumbnails for pdf and djvu filetypes --- inc/instance-config.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inc/instance-config.php b/inc/instance-config.php index eca5bb01..43741edd 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -128,6 +128,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'; From 554c19c24804c39b0c6605adde1d414c6f09eba6 Mon Sep 17 00:00:00 2001 From: nonmakina Date: Sat, 9 Jan 2021 16:41:05 -0600 Subject: [PATCH 2/2] Fixes inline-expanding.js to allow clickable pdf thumbnails --- js/inline-expanding.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/inline-expanding.js b/js/inline-expanding.js index 5db95c09..8a6c6a1b 100644 --- a/js/inline-expanding.js +++ b/js/inline-expanding.js @@ -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];