diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/css/files.css | 62 | ||||
-rw-r--r-- | apps/files/index.php | 1 | ||||
-rw-r--r-- | apps/files/js/filelist.js | 5 | ||||
-rw-r--r-- | apps/files/js/files.js | 21 | ||||
-rw-r--r-- | apps/files/templates/index.php | 2 | ||||
-rw-r--r-- | apps/files/templates/part.list.php | 18 | ||||
-rw-r--r-- | apps/files_sharing/public.php | 3 | ||||
-rw-r--r-- | apps/files_trashbin/lib/trash.php | 3 | ||||
-rw-r--r-- | apps/files_trashbin/templates/part.list.php | 6 |
9 files changed, 97 insertions, 24 deletions
diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 117aac4c93e..c66484db536 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -19,9 +19,9 @@ background:#f8f8f8; border:1px solid #ddd; border-radius:10px; border-top-left-radius:0; box-shadow:0 2px 7px rgba(170,170,170,.4); } -#new>ul>li { height:20px; margin:.3em; padding-left:2em; padding-bottom:0.1em; +#new>ul>li { height:36px; margin:.3em; padding-left:3em; padding-bottom:0.1em; background-repeat:no-repeat; cursor:pointer; } -#new>ul>li>p { cursor:pointer; } +#new>ul>li>p { cursor:pointer; padding-top: 7px; padding-bottom: 7px;} #new>ul>li>form>input { padding:0.3em; margin:-0.3em; } #trash { margin: 0 1em; z-index:1010; float: right; } @@ -62,7 +62,10 @@ color:#888; text-shadow:#fff 0 1px 0; } #filestable { position: relative; top:37px; width:100%; } -tbody tr { background-color:#fff; height:2.5em; } +tbody tr { + background-color: #fff; + height: 44px; +} tbody tr:hover, tbody tr:active { background-color: rgb(240,240,240); } @@ -75,12 +78,25 @@ span.extension { text-transform:lowercase; -ms-filter:"progid:DXImageTransform.M tr:hover span.extension { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter:alpha(opacity=100); opacity:1; color:#777; } table tr.mouseOver td { background-color:#eee; } table th { height:2em; padding:0 .5em; color:#999; } -table th .name { float:left; margin-left:.5em; } +table th .name { + float: left; + margin-left: 17px; +} table th, table td { border-bottom:1px solid #ddd; text-align:left; font-weight:normal; } -table td { border-bottom:1px solid #eee; font-style:normal; background-position:1em .5em; background-repeat:no-repeat; } +table td { + border-bottom: 1px solid #eee; + font-style: normal; + background-position: 8px center; + background-repeat: no-repeat; +} table th#headerName { width:100em; /* not really sure why this works better than 100% … table styling */ } table th#headerSize, table td.filesize { min-width:3em; padding:0 1em; text-align:right; } -table th#headerDate, table td.date { min-width:11em; padding:0 .1em 0 1em; text-align:left; } +table th#headerDate, table td.date { + position: relative; + min-width: 11em; + padding:0 .1em 0 1em; + text-align:left; +} /* Multiselect bar */ #filestable.multiselect { top:63px; } @@ -93,13 +109,29 @@ table.multiselect thead th { } table.multiselect #headerName { width: 100%; } table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } -table td.filename a.name { display:block; height:1.5em; vertical-align:middle; margin-left:3em; } +table td.filename a.name { + box-sizing: border-box; + display: block; + height: 44px; + vertical-align: middle; + margin-left: 50px; +} table tr[data-type="dir"] td.filename a.name span.nametext {font-weight:bold; } table td.filename input.filename { width:100%; cursor:text; } -table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:.2em .5em .5em 0; } +table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:.2em .5em .5em .3em; } table td.filename .nametext, .uploadtext, .modified { float:left; padding:.3em 0; } +.modified { + position: absolute; + top: 10px; +} /* TODO fix usability bug (accidental file/folder selection) */ -table td.filename .nametext { overflow:hidden; text-overflow:ellipsis; max-width:800px; } +table td.filename .nametext { + position: absolute; + top: 10px; + overflow: hidden; + text-overflow: ellipsis; + max-width: 800px; +} table td.filename .uploadtext { font-weight:normal; margin-left:.5em; } table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; } @@ -119,8 +151,10 @@ table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; } /* File actions */ .fileactions { - position:absolute; top:.6em; right:0; - font-size:.8em; + position: absolute; + top: 13px; + right: 0; + font-size: 11px; } #fileList .name { position:relative; /* Firefox needs to explicitly have this default set … */ } #fileList tr:hover .fileactions { /* background to distinguish when overlaying with file names */ @@ -132,7 +166,11 @@ table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; } box-shadow: -5px 0 7px rgba(230,230,230,.9); } #fileList .fileactions a.action img { position:relative; top:.2em; } -#fileList a.action { display:inline; margin:-.5em 0; padding:1em .5em 1em .5em !important; } +#fileList a.action { + display: inline; + margin: -.5em 0; + padding: 16px 8px !important; +} #fileList img.move2trash { display:inline; margin:-.5em 0; padding:1em .5em 1em .5em !important; float:right; } a.action.delete { float:right; } a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } diff --git a/apps/files/index.php b/apps/files/index.php index 4f9e881eb2d..e2ea8802d0d 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -95,6 +95,7 @@ $list->assign('files', $files); $list->assign('baseURL', OCP\Util::linkTo('files', 'index.php') . '?dir='); $list->assign('downloadURL', OCP\Util::linkToRoute('download', array('file' => '/'))); $list->assign('disableSharing', false); +$list->assign('isPublic', false); $breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', ''); $breadcrumbNav->assign('breadcrumb', $breadcrumb); $breadcrumbNav->assign('baseURL', OCP\Util::linkTo('files', 'index.php') . '?dir='); diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index b858e2580ee..288648693be 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -185,8 +185,9 @@ var FileList={ if (id != null) { tr.attr('data-id', id); } - getMimeIcon(mime,function(path){ - tr.find('td.filename').attr('style','background-image:url('+path+')'); + var path = $('#dir').val()+'/'+name; + getPreviewIcon(path, function(previewpath){ + tr.find('td.filename').attr('style','background-image:url('+previewpath+')'); }); tr.find('td.filename').draggable(dragOptions); }, diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 3fad3fae7d3..8b66ed6747b 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -366,8 +366,9 @@ $(document).ready(function() { var tr=$('tr').filterAttr('data-file',name); tr.attr('data-mime',result.data.mime); tr.attr('data-id', result.data.id); - getMimeIcon(result.data.mime,function(path){ - tr.find('td.filename').attr('style','background-image:url('+path+')'); + var path = $('#dir').val()+'/'+name; + getPreviewIcon(path, function(previewpath){ + tr.find('td.filename').attr('style','background-image:url('+previewpath+')'); }); } else { OC.dialogs.alert(result.data.message, t('core', 'Error')); @@ -430,8 +431,9 @@ $(document).ready(function() { var tr=$('tr').filterAttr('data-file',localName); tr.data('mime',mime).data('id',id); tr.attr('data-id', id); - getMimeIcon(mime,function(path){ - tr.find('td.filename').attr('style','background-image:url('+path+')'); + var path = $('#dir').val()+'/'+localName; + getPreviewIcon(path, function(previewpath){ + tr.find('td.filename').attr('style','background-image:url('+previewpath+')'); }); }); eventSource.listen('error',function(error){ @@ -636,8 +638,9 @@ var createDragShadow = function(event){ if (elem.type === 'dir') { newtr.find('td.filename').attr('style','background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')'); } else { - getMimeIcon(elem.mime,function(path){ - newtr.find('td.filename').attr('style','background-image:url('+path+')'); + var path = $('#dir').val()+'/'+elem.name; + getPreviewIcon(path, function(previewpath){ + newtr.find('td.filename').attr('style','background-image:url('+previewpath+')'); }); } }); @@ -821,6 +824,10 @@ function getMimeIcon(mime, ready){ } getMimeIcon.cache={}; +function getPreviewIcon(path, ready){ + ready(OC.Router.generate('core_ajax_preview', {file: encodeURIComponent(path), x:36, y:36})); +} + function getUniqueName(name){ if($('tr').filterAttr('data-file',name).length>0){ var parts=name.split('.'); @@ -852,4 +859,4 @@ function checkTrashStatus() { $("input[type=button][id=trash]").removeAttr("disabled"); } }); -}
\ No newline at end of file +} diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 79c283dc336..e4348904671 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -10,7 +10,7 @@ data-type='file'><p><?php p($l->t('Text file'));?></p></li> <li style="background-image:url('<?php p(OCP\mimetype_icon('dir')) ?>')" data-type='folder'><p><?php p($l->t('Folder'));?></p></li> - <li style="background-image:url('<?php p(OCP\image_path('core', 'actions/public.png')) ?>')" + <li style="background-image:url('<?php p(OCP\image_path('core', 'web.png')) ?>')" data-type='web'><p><?php p($l->t('From link'));?></p></li> </ul> </div> diff --git a/apps/files/templates/part.list.php b/apps/files/templates/part.list.php index 0c7d6936697..ab1b91167db 100644 --- a/apps/files/templates/part.list.php +++ b/apps/files/templates/part.list.php @@ -3,6 +3,7 @@ $totaldirs = 0; $totalsize = 0; ?> <?php foreach($_['files'] as $file): + $relativePath = substr($file['path'], 6); //strlen('files/') => 6 $totalsize += $file['size']; if ($file['type'] === 'dir') { $totaldirs++; @@ -28,7 +29,22 @@ $totalsize = 0; ?> <?php if($file['type'] == 'dir'): ?> style="background-image:url(<?php print_unescaped(OCP\mimetype_icon('dir')); ?>)" <?php else: ?> - style="background-image:url(<?php print_unescaped(OCP\mimetype_icon($file['mimetype'])); ?>)" + <?php if($_['isPublic']): ?> + <?php + $relativePath = substr($relativePath, strlen($_['sharingroot'])); + ?> + <?php if(\OCP\Preview::isMimeSupported($file['mimetype'])): ?> + style="background-image:url(<?php print_unescaped(OCP\publicPreview_icon($relativePath, $_['sharingtoken'])); ?>)" class="preview-icon" + <?php else: ?> + style="background-image:url(<?php print_unescaped(OCP\mimetype_icon($file['mimetype'])); ?>)" + <?php endif; ?> + <?php else: ?> + <?php if(\OCP\Preview::isMimeSupported($file['mimetype'])): ?> + style="background-image:url(<?php print_unescaped(OCP\preview_icon($relativePath)); ?>)" class="preview-icon" + <?php else: ?> + style="background-image:url(<?php print_unescaped(OCP\mimetype_icon($file['mimetype'])); ?>)" + <?php endif; ?> + <?php endif; ?> <?php endif; ?> > <?php if(!isset($_['readonly']) || !$_['readonly']): ?><input type="checkbox" /><?php endif; ?> diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index 741ab145384..b3d713097d2 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -194,6 +194,9 @@ if (isset($path)) { $list->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path='); $list->assign('downloadURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path='); + $list->assign('isPublic', true); + $list->assign('sharingtoken', $token); + $list->assign('sharingroot', $basePath); $breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', ''); $breadcrumbNav->assign('breadcrumb', $breadcrumb); $breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path='); diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php index 30913e00a47..615eafee617 100644 --- a/apps/files_trashbin/lib/trash.php +++ b/apps/files_trashbin/lib/trash.php @@ -908,4 +908,7 @@ class Trashbin { return true; } + public static function preview_icon($path) { + return \OC_Helper::linkToRoute( 'core_ajax_trashbin_preview', array('x' => 36, 'y' => 36, 'file' => urlencode($path) )); + } } diff --git a/apps/files_trashbin/templates/part.list.php b/apps/files_trashbin/templates/part.list.php index 254b08dd36a..6c6d2162846 100644 --- a/apps/files_trashbin/templates/part.list.php +++ b/apps/files_trashbin/templates/part.list.php @@ -25,7 +25,11 @@ <?php if($file['type'] === 'dir'): ?> style="background-image:url(<?php print_unescaped(OCP\mimetype_icon('dir')); ?>)" <?php else: ?> - style="background-image:url(<?php print_unescaped(OCP\mimetype_icon($file['mimetype'])); ?>)" + <?php if(\OCP\Preview::isMimeSupported($file['mimetype'])): ?> + style="background-image:url(<?php print_unescaped(OCA\Files_Trashbin\Trashbin::preview_icon(!$_['dirlisting'] ? ($file['name'].'.d'.$file['timestamp']) : ($file['directory'].'/'.$file['name']))); ?>)" class="preview-icon" + <?php else: ?> + style="background-image:url(<?php print_unescaped(OCP\mimetype_icon($file['mimetype'])); ?>)" + <?php endif; ?> <?php endif; ?> > <?php if(!isset($_['readonly']) || !$_['readonly']): ?><input type="checkbox" /><?php endif; ?> |