1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-21 16:13:00 +00:00

Add download button for unsupported file types

This commit is contained in:
Starbeamrainbowlabs 2019-06-01 21:37:35 +01:00
parent c6db576980
commit 7df4c51834
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
4 changed files with 9 additions and 2 deletions

View file

@ -27,6 +27,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
- Added new `minify_pageindex` setting, which defaults to `true` and causes the page index to be minified when saved. Improves performance slightly (especially on larger wikis as the page index grows), but makes debugging and ninja-edits more awkward.
- [Module API] Added new `save_pageindex()` function which respects the above setting.
- Added PDF preview using your browser's default PDF viewer!
- Added download button for unsupported file types
### Changed
- Core sharding: split `core.php` into multiple files

View file

@ -155,7 +155,7 @@
"version": "0.5.17",
"author": "Starbeamrainbowlabs",
"description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File\/' prefix.",
"lastupdate": 1559416947,
"lastupdate": 1559420955,
"optional": false,
"extra_data": []
},

View file

@ -1,7 +1,7 @@
<?php
register_module([
"name" => "Uploader",
"version" => "0.5.17",
"version" => "0.6",
"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",
@ -510,6 +510,11 @@ register_module([
case "pdf":
$preview_html .= "\t\t\t<object type='application/pdf' data='$originalUrl'></object>";
break;
default:
$preview_html .= "\t\t\t<p><em>No preview is available, but you can download it instead:</em></p>
<a class='button' href='$originalUrl'>Download</a>";
break;
}
$fileInfo = [];

View file

@ -36,6 +36,7 @@ input[type=button], input[type=submit] { cursor: pointer; }
.image-controls ul { list-style-type: none; margin: 5px; padding: 5px; }
.image-controls li { display: inline-block; margin: 5px; padding: 5px; }
.link-display { margin-left: 0.5rem; }
.button { appearance: button; -moz-appearance: button; -webkit-appearance: button; text-decoration: none; }
audio, video, img { max-width: 100%; }
object { width: 100%; height: 90vh; }