1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-22 04:23:01 +00:00

Fix #71 (It says "Original Image" for PDFs).

This commit is contained in:
Starbeamrainbowlabs 2016-06-04 13:38:59 +01:00
parent 020b1ff32f
commit 0258757639
3 changed files with 9 additions and 3 deletions

View file

@ -3002,11 +3002,14 @@ register_module([
{
case "application":
case "image":
if($mime_type == "application/pdf")
$fileTypeDisplay = "file";
$preview_sizes = [ 256, 512, 768, 1024, 1440 ];
$preview_html .= "\t\t\t<figure class='preview'>
<img src='$previewUrl' />
<nav class='image-controls'>
<ul><li><a href='" . ($env->storage_prefix == "./" ? $filepath : "?action=preview&size=original&page=" . rawurlencode($env->page)) . "'>&#x01f304; Original image</a></li>";
<ul><li><a href='" . ($env->storage_prefix == "./" ? $filepath : "?action=preview&size=original&page=" . rawurlencode($env->page)) . "'>&#x01f304; Original $fileTypeDisplay</a></li>";
if($mime_type !== "image/svg+xml")
{
$preview_html .= "<li>Other Sizes: ";

View file

@ -77,7 +77,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File\/' prefix.",
"id": "feature-upload",
"lastupdate": 1465043339,
"lastupdate": 1465043901,
"optional": false
},
{

View file

@ -356,11 +356,14 @@ register_module([
{
case "application":
case "image":
if($mime_type == "application/pdf")
$fileTypeDisplay = "file";
$preview_sizes = [ 256, 512, 768, 1024, 1440 ];
$preview_html .= "\t\t\t<figure class='preview'>
<img src='$previewUrl' />
<nav class='image-controls'>
<ul><li><a href='" . ($env->storage_prefix == "./" ? $filepath : "?action=preview&size=original&page=" . rawurlencode($env->page)) . "'>&#x01f304; Original image</a></li>";
<ul><li><a href='" . ($env->storage_prefix == "./" ? $filepath : "?action=preview&size=original&page=" . rawurlencode($env->page)) . "'>&#x01f304; Original $fileTypeDisplay</a></li>";
if($mime_type !== "image/svg+xml")
{
$preview_html .= "<li>Other Sizes: ";