Merge pull request #6151 from owncloud/trash_fix_select

trash, make it possible to select folders
remotes/origin/ldap_group_count
Björn Schießle 11 years ago
commit 9d100b5f94
  1. 3
      apps/files_trashbin/css/trash.css
  2. 1
      apps/files_trashbin/index.php
  3. 41
      apps/files_trashbin/js/trash.js
  4. 2
      apps/files_trashbin/lib/helper.php
  5. 13
      apps/files_trashbin/templates/part.list.php

@ -0,0 +1,3 @@
#fileList td a.file, #fileList td a.file span {
cursor: default;
}

@ -10,6 +10,7 @@ OCP\Util::addScript('files', 'fileactions');
$tmpl = new OCP\Template('files_trashbin', 'index', 'user'); $tmpl = new OCP\Template('files_trashbin', 'index', 'user');
OCP\Util::addStyle('files', 'files'); OCP\Util::addStyle('files', 'files');
OCP\Util::addStyle('files_trashbin', 'trash');
OCP\Util::addScript('files', 'filelist'); OCP\Util::addScript('files', 'filelist');
// filelist overrides // filelist overrides
OCP\Util::addScript('files_trashbin', 'filelist'); OCP\Util::addScript('files_trashbin', 'filelist');

@ -66,41 +66,6 @@ $(document).ready(function() {
procesSelection(); procesSelection();
}); });
$('#fileList').on('click', 'td.filename a', function(event) {
if (event.shiftKey) {
event.preventDefault();
var last = $(lastChecked).parent().parent().prevAll().length;
var first = $(this).parent().parent().prevAll().length;
var start = Math.min(first, last);
var end = Math.max(first, last);
var rows = $(this).parent().parent().parent().children('tr');
for (var i = start; i < end; i++) {
$(rows).each(function(index) {
if (index == i) {
var checkbox = $(this).children().children('input:checkbox');
$(checkbox).attr('checked', 'checked');
$(checkbox).parent().parent().addClass('selected');
}
});
}
}
var checkbox = $(this).parent().children('input:checkbox');
lastChecked = checkbox;
if ($(checkbox).attr('checked')) {
$(checkbox).removeAttr('checked');
$(checkbox).parent().parent().removeClass('selected');
$('#select_all').removeAttr('checked');
} else {
$(checkbox).attr('checked', 'checked');
$(checkbox).parent().parent().toggleClass('selected');
var selectedCount = $('td.filename input:checkbox:checked').length;
if (selectedCount == $('td.filename input:checkbox').length) {
$('#select_all').attr('checked', 'checked');
}
}
procesSelection();
});
$('.undelete').click('click', function(event) { $('.undelete').click('click', function(event) {
event.preventDefault(); event.preventDefault();
var files = getSelectedFiles('file'); var files = getSelectedFiles('file');
@ -184,6 +149,12 @@ $(document).ready(function() {
}); });
$('#fileList').on('click', 'td.filename input', function() {
var checkbox = $(this).parent().children('input:checkbox');
$(checkbox).parent().parent().toggleClass('selected');
procesSelection();
});
$('#fileList').on('click', 'td.filename a', function(event) { $('#fileList').on('click', 'td.filename a', function(event) {
var mime = $(this).parent().parent().data('mime'); var mime = $(this).parent().parent().data('mime');
if (mime !== 'httpd/unix-directory') { if (mime !== 'httpd/unix-directory') {

@ -44,8 +44,10 @@ class Helper
} }
$files = array(); $files = array();
$id = 0;
foreach ($result as $r) { foreach ($result as $r) {
$i = array(); $i = array();
$i['id'] = $id++;
$i['name'] = $r['id']; $i['name'] = $r['id'];
$i['date'] = \OCP\Util::formatDate($r['timestamp']); $i['date'] = \OCP\Util::formatDate($r['timestamp']);
$i['timestamp'] = $r['timestamp']; $i['timestamp'] = $r['timestamp'];

@ -35,18 +35,21 @@
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>
> >
<?php if(!isset($_['readonly']) || !$_['readonly']): ?><input type="checkbox" /><?php endif; ?> <?php if(!isset($_['readonly']) || !$_['readonly']): ?>
<input id="select-<?php p($file['id']); ?>" type="checkbox" />
<label for="select-<?php p($file['id']); ?>"></label>
<?php endif; ?>
<?php if($file['type'] === 'dir'): ?> <?php if($file['type'] === 'dir'): ?>
<?php if( $_['dirlisting'] ): ?> <?php if( $_['dirlisting'] ): ?>
<a class="name" href="<?php p($_['baseURL'].'/'.$name); ?>" title=""> <a class="name dir" href="<?php p($_['baseURL'].'/'.$name); ?>" title="">
<?php else: ?> <?php else: ?>
<a class="name" href="<?php p($_['baseURL'].'/'.$name.'.d'.$file['timestamp']); ?>" title=""> <a class="name dir" href="<?php p($_['baseURL'].'/'.$name.'.d'.$file['timestamp']); ?>" title="">
<?php endif; ?> <?php endif; ?>
<?php else: ?> <?php else: ?>
<?php if( $_['dirlisting'] ): ?> <?php if( $_['dirlisting'] ): ?>
<a class="name" href="<?php p($_['downloadURL'].'/'.$name); ?>" title=""> <a class="name file" href="<?php p($_['downloadURL'].'/'.$name); ?>" title="">
<?php else: ?> <?php else: ?>
<a class="name" href="<?php p($_['downloadURL'].'/'.$name.'.d'.$file['timestamp']);?>" title=""> <a class="name file" href="<?php p($_['downloadURL'].'/'.$name.'.d'.$file['timestamp']);?>" title="">
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>
<span class="nametext"> <span class="nametext">

Loading…
Cancel
Save