Instead of 'No preview available for ...' we simple display the mieme-type icon

This commit is contained in:
Thomas Müller 2014-01-23 20:15:10 +01:00
parent 799e744ad7
commit 617aa3cf29
2 changed files with 9 additions and 20 deletions

View File

@ -15,14 +15,7 @@ $(document).ready(function() {
if (mimetype.substr(0, mimetype.indexOf('/')) != 'image' && $('.publicpreview').length === 0) {
// Trigger default action if not download TODO
var action = FileActions.getDefault(mimetype, 'file', OC.PERMISSION_READ);
if (typeof action === 'undefined') {
$('#noPreview').show();
if (mimetype != 'httpd/unix-directory') {
// NOTE: Remove when a better file previewer solution exists
$('#content').remove();
$('table').remove();
}
} else {
if (typeof action !== 'undefined') {
action($('#filename').val());
}
}

View File

@ -32,16 +32,10 @@
<source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" />
</video>
</div>
<?php elseif (\OC\Preview::isMimeSupported($_['mimetype'])): ?>
<?php else: ?>
<div id="imgframe">
<img src="<?php p(OCP\Util::linkToRoute( 'core_ajax_public_preview', array('x' => 500, 'y' => 500, 'file' => urlencode($_['directory_path']), 't' => $_['dirToken']))); ?>" class="publicpreview"/>
</div>
<?php else: ?>
<ul id="noPreview">
<li class="error">
<?php p($l->t('No preview available for').' '.$_['filename']); ?><br />
</li>
</ul>
<?php endif; ?>
<div class="directDownload">
<a href="<?php p($_['downloadURL']); ?>" id="download" class="button">
@ -55,8 +49,10 @@
</div>
<?php endif; ?>
</div>
<footer>
<p class="info">
<?php print_unescaped($theme->getLongFooter()); ?>
</p>
</footer>
</div>
<footer>
<p class="info">
<?php print_unescaped($theme->getLongFooter()); ?>
</p>
</footer>