[Pkg-owncloud-commits] [owncloud] 49/145: Instead of 'No preview available for ...' we simple display the mime-type icon

David Prévot taffit at moszumanska.debian.org
Wed Feb 26 16:27:41 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit a3b351738a7ccdd153fa06ba5dc5594e471f9124
Author: Jörn Friedrich Dreyer <jfd at butonic.de>
Date:   Wed Feb 5 11:27:46 2014 +0100

    Instead of 'No preview available for ...' we simple display the mime-type icon
---
 apps/files_sharing/js/public.js         |  9 +--------
 apps/files_sharing/templates/public.php | 22 +++++++++-------------
 2 files changed, 10 insertions(+), 21 deletions(-)

diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index d95f634..730649c 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -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());
 			}
 		}
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index fb45401..652cd74 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -16,7 +16,7 @@
 		<div class="header-right">
 			<span id="details"><?php p($l->t('shared by %s', array($_['displayName']))) ?></span>
 		</div>
-	</div></header>
+</div></header>
 <div id="content">
 	<div id="preview">
 		<?php if (isset($_['folder'])): ?>
@@ -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>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list