1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-25 17:23:00 +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 "application":
case "image": case "image":
if($mime_type == "application/pdf")
$fileTypeDisplay = "file";
$preview_sizes = [ 256, 512, 768, 1024, 1440 ]; $preview_sizes = [ 256, 512, 768, 1024, 1440 ];
$preview_html .= "\t\t\t<figure class='preview'> $preview_html .= "\t\t\t<figure class='preview'>
<img src='$previewUrl' /> <img src='$previewUrl' />
<nav class='image-controls'> <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") if($mime_type !== "image/svg+xml")
{ {
$preview_html .= "<li>Other Sizes: "; $preview_html .= "<li>Other Sizes: ";

View file

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

View file

@ -356,11 +356,14 @@ register_module([
{ {
case "application": case "application":
case "image": case "image":
if($mime_type == "application/pdf")
$fileTypeDisplay = "file";
$preview_sizes = [ 256, 512, 768, 1024, 1440 ]; $preview_sizes = [ 256, 512, 768, 1024, 1440 ];
$preview_html .= "\t\t\t<figure class='preview'> $preview_html .= "\t\t\t<figure class='preview'>
<img src='$previewUrl' /> <img src='$previewUrl' />
<nav class='image-controls'> <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") if($mime_type !== "image/svg+xml")
{ {
$preview_html .= "<li>Other Sizes: "; $preview_html .= "<li>Other Sizes: ";