summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/templates
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-09-30 15:23:16 +0200
committerLukas Reschke <lukas@owncloud.com>2014-09-30 15:49:49 +0200
commit306bf71c62c7ef0fe30c297da6aea54db0177ba4 (patch)
treeada3278d5065cfd0b1368755d62816e9481cf6ef /apps/files_sharing/templates
parent5292a14cdfa9efe6d9220b341f3261fe72c39b17 (diff)
downloadnextcloud-server-306bf71c62c7ef0fe30c297da6aea54db0177ba4.tar.gz
nextcloud-server-306bf71c62c7ef0fe30c297da6aea54db0177ba4.zip
Use SVG previews for public sharing
Fixes https://github.com/owncloud/core/pull/11367#issuecomment-57306037 and https://github.com/owncloud/core/issues/9218
Diffstat (limited to 'apps/files_sharing/templates')
-rw-r--r--apps/files_sharing/templates/public.php23
1 files changed, 11 insertions, 12 deletions
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index a4b3289d4c6..46bf90b1b41 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -1,5 +1,8 @@
<?php /** @var $l OC_L10N */ ?>
-<?php $thumbSize=1024; ?>
+<?php
+$thumbSize=1024;
+$previewSupported = OC\Preview::isMimeSupported($_['mimetype']) ? 'true' : 'false';
+?>
<?php if ( \OC\Preview::isMimeSupported($_['mimetype'])): /* This enables preview images for links (e.g. on Facebook, Google+, ...)*/?>
<link rel="image_src" href="<?php p(OCP\Util::linkToRoute( 'core_ajax_public_preview', array('x' => $thumbSize, 'y' => $thumbSize, 'file' => $_['directory_path'], 't' => $_['dirToken']))); ?>" />
<?php endif; ?>
@@ -15,6 +18,10 @@
<input type="hidden" name="sharingToken" value="<?php p($_['sharingToken']) ?>" id="sharingToken">
<input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename">
<input type="hidden" name="mimetype" value="<?php p($_['mimetype']) ?>" id="mimetype">
+<input type="hidden" name="previewSupported" value="<?php p($previewSupported); ?>" id="previewSupported">
+<input type="hidden" name="mimetypeIcon" value="<?php p(OC_Helper::mimetypeIcon($_['mimetype'])); ?>" id="mimetypeIcon">
+
+
<header><div id="header" class="<?php p((isset($_['folder']) ? 'share-folder' : 'share-file')) ?>">
<a href="<?php print_unescaped(link_to('', 'index.php')); ?>"
title="" id="owncloud">
@@ -47,23 +54,15 @@
<?php if (isset($_['folder'])): ?>
<?php print_unescaped($_['folder']); ?>
<?php else: ?>
- <?php if (substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'image'): ?>
- <div id="imgframe">
- </div>
- <?php elseif (substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'video'): ?>
+ <?php if (substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'video'): ?>
<div id="imgframe">
<video tabindex="0" controls="" preload="none">
<source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" />
</video>
</div>
<?php else: ?>
- <div id="imgframe">
- <?php $size = \OC\Preview::isMimeSupported($_['mimetype']) ? 500 : 128 ?>
- <img
- src="<?php p(OCP\Util::linkToRoute( 'core_ajax_public_preview', array('x' => $size, 'y' => $size, 'file' => $_['directory_path'], 't' => $_['dirToken']))); ?>"
- class="publicpreview"
- alt="" />
- </div>
+ <!-- Preview frame is filled via JS to support SVG images for modern browsers -->
+ <div id="imgframe"></div>
<?php endif; ?>
<div class="directDownload">
<a href="<?php p($_['downloadURL']); ?>" id="download" class="button">