diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-29 21:12:10 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-29 21:12:23 -0400 |
commit | f2534e7428be3b67273a45fc17dd628f0b3d4684 (patch) | |
tree | 9679e6ed47e8ee72fbb95b7ce8b314e1c34b9b0d /apps | |
parent | 756b514fee05bdeb9c7fc06876e498837974bb6c (diff) | |
download | nextcloud-server-f2534e7428be3b67273a45fc17dd628f0b3d4684.tar.gz nextcloud-server-f2534e7428be3b67273a45fc17dd628f0b3d4684.zip |
Show notification that no preview is available if no previewer is found for a public link to a file
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/css/public.css | 5 | ||||
-rw-r--r-- | apps/files_sharing/js/public.js | 6 | ||||
-rwxr-xr-x | apps/files_sharing/templates/public.php | 6 |
3 files changed, 14 insertions, 3 deletions
diff --git a/apps/files_sharing/css/public.css b/apps/files_sharing/css/public.css index f38afae3dd8..a700cc2169b 100644 --- a/apps/files_sharing/css/public.css +++ b/apps/files_sharing/css/public.css @@ -1,7 +1,8 @@ body { background:#ddd; } #header { position:fixed; top:0; left:0; right:0; z-index:100; height:2.5em; line-height:2.5em; padding:.5em; background:#1d2d44; -moz-box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; } #details { color:#fff; } -#download { margin-left:2em; font-weight:bold; color:#fff; } -#preview { min-height:30em; margin:50px auto; border-bottom:1px solid #f8f8f8; background:#eee; text-align:center; } +#header #download { margin-left:2em; font-weight:bold; color:#fff; } +#preview { min-height:30em; margin:50px auto; padding-top:2em; border-bottom:1px solid #f8f8f8; background:#eee; text-align:center; } +#noPreview { display:none; padding-top:5em; } p.info { width:22em; text-align: center; margin:2em auto; color:#777; text-shadow:#fff 0 1px 0; } p.info a { font-weight:bold; color:#777; }
\ No newline at end of file diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 755382e0736..1ab61d476ec 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -11,7 +11,11 @@ $(document).ready(function() { if (mimetype.substr(0, mimetype.indexOf('/')) != 'image') { // Trigger default action if not download TODO var action = FileActions.getDefault(mimetype, 'file', FileActions.PERMISSION_READ); - action($('#filename').val()); + if (typeof action === 'undefined') { + $('#noPreview').show(); + } else { + action($('#filename').val()); + } } } diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index 36e159dafee..1c08b5b26af 100755 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -13,5 +13,11 @@ <?php if (substr($_['mimetype'], 0 , strpos($_['mimetype'], '/')) == 'image'): ?> <img src="<?php echo $_['downloadURL']; ?>" /> <?php endif; ?> + <ul id="noPreview"> + <li class="error"> + <?php echo $l->t('No preview available for').' '.$_['filename']; ?><br /> + <a href="<?php echo $_['downloadURL']; ?>" id="download"><img class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" /><?php echo $l->t('Download')?></a> + </li> + </ul> </div> <footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> – <?php echo $l->t('web services under your control'); ?></p></footer>
\ No newline at end of file |