]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Show plain text files on attachment page.
authorMikael Nordfeldth <mmn@hethane.se>
Mon, 25 Jan 2016 15:54:40 +0000 (16:54 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 25 Jan 2016 15:54:40 +0000 (16:54 +0100)
lib/attachmentlistitem.php
theme/base/css/display.css

index 8adc07e6db7c59bd1c7ab40d8a245d3e6f0a0364..28ce9900b88392a8c0c74228ed27a52ebf337853 100644 (file)
@@ -169,6 +169,8 @@ class AttachmentListItem extends Widget
                 default:
                     unset($thumb);  // there's no need carrying this along
                     switch ($this->attachment->mimetype) {
+                    case 'text/plain':
+                        $this->element('div', ['class'=>'e-content plaintext'], file_get_contents($this->attachment->getPath()));
                     case 'text/html':
                         if (!empty($this->attachment->filename)
                                 && (GNUsocial::isAjax() || common_config('attachments', 'show_html'))) {
index e6ac8b4d47c1c35c20faafc7d929aea4fa1283f2..61696e6f11a7dbfdaa5ef45be92b8cabdc8eaa8d 100644 (file)
@@ -1503,6 +1503,13 @@ font-size:150%;
     font-style: normal;
 }
 
+div.e-content.plaintext {
+    border: dashed 1px gray;
+    font-family: monospace;
+    padding: 1em;
+    white-space: pre-line;
+}
+
 span.rtl {
     display: block;
     direction: rtl;