]> source.dussan.org Git - nextcloud-server.git/commitdiff
Show notification that no preview is available if no previewer is found for a public...
authorMichael Gapczynski <mtgap@owncloud.com>
Thu, 30 Aug 2012 01:12:10 +0000 (21:12 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Thu, 30 Aug 2012 01:12:23 +0000 (21:12 -0400)
apps/files_sharing/css/public.css
apps/files_sharing/js/public.js
apps/files_sharing/templates/public.php

index f38afae3dd8b4778fc5c069941b042e27c9f3090..a700cc2169b5521dfe8f02b88a10ee6697cfb073 100644 (file)
@@ -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
index 755382e073648c503117b77546734b5a5110404d..1ab61d476ecf0d50360f13ff0c76483ae641cdcb 100644 (file)
@@ -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());
+                       }
                }
        }
 
index 36e159dafeefb75c50006318b30764f6cd735f28..1c08b5b26af5cd239e582ea379c6c36a4f604a5a 100755 (executable)
        <?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> &ndash; <?php echo $l->t('web services under your control'); ?></p></footer>
\ No newline at end of file