Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-12-02 18:27:40 +0400
committerBjoern Schiessle <schiessle@owncloud.com>2013-12-03 01:23:51 +0400
commit5e5e4fe3a452285d37790ea9fa1e3f34a46545d5 (patch)
treedc9ec7b20ce51f677396041198082a33fd068292 /apps/files_trashbin
parent2d1129012143ea54dd54f1f30a1a830aaad30ded (diff)
make it possible to select folders
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/css/trash.css3
-rw-r--r--apps/files_trashbin/index.php1
-rw-r--r--apps/files_trashbin/js/trash.js41
-rw-r--r--apps/files_trashbin/lib/helper.php2
-rw-r--r--apps/files_trashbin/templates/part.list.php13
5 files changed, 20 insertions, 40 deletions
diff --git a/apps/files_trashbin/css/trash.css b/apps/files_trashbin/css/trash.css
new file mode 100644
index 00000000000..97819f4e80b
--- /dev/null
+++ b/apps/files_trashbin/css/trash.css
@@ -0,0 +1,3 @@
+#fileList td a.file, #fileList td a.file span {
+ cursor: default;
+}
diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php
index d079af3fb6d..93f385dd30b 100644
--- a/apps/files_trashbin/index.php
+++ b/apps/files_trashbin/index.php
@@ -10,6 +10,7 @@ OCP\Util::addScript('files', 'fileactions');
$tmpl = new OCP\Template('files_trashbin', 'index', 'user');
OCP\Util::addStyle('files', 'files');
+OCP\Util::addStyle('files_trashbin', 'trash');
OCP\Util::addScript('files', 'filelist');
// filelist overrides
OCP\Util::addScript('files_trashbin', 'filelist');
diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js
index b157fdf1025..48e9629f7de 100644
--- a/apps/files_trashbin/js/trash.js
+++ b/apps/files_trashbin/js/trash.js
@@ -66,41 +66,6 @@ $(document).ready(function() {
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) {
event.preventDefault();
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) {
var mime = $(this).parent().parent().data('mime');
if (mime !== 'httpd/unix-directory') {
diff --git a/apps/files_trashbin/lib/helper.php b/apps/files_trashbin/lib/helper.php
index 4f442ee9304..c454b35a5f2 100644
--- a/apps/files_trashbin/lib/helper.php
+++ b/apps/files_trashbin/lib/helper.php
@@ -44,8 +44,10 @@ class Helper
}
$files = array();
+ $id = 0;
foreach ($result as $r) {
$i = array();
+ $i['id'] = $id++;
$i['name'] = $r['id'];
$i['date'] = \OCP\Util::formatDate($r['timestamp']);
$i['timestamp'] = $r['timestamp'];
diff --git a/apps/files_trashbin/templates/part.list.php b/apps/files_trashbin/templates/part.list.php
index 78709d986ae..c32d9fd54da 100644
--- a/apps/files_trashbin/templates/part.list.php
+++ b/apps/files_trashbin/templates/part.list.php
@@ -35,18 +35,21 @@
<?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( $_['dirlisting'] ): ?>
- <a class="name" href="<?php p($_['baseURL'].'/'.$name); ?>" title="">
+ <a class="name dir" href="<?php p($_['baseURL'].'/'.$name); ?>" title="">
<?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 else: ?>
<?php if( $_['dirlisting'] ): ?>
- <a class="name" href="<?php p($_['downloadURL'].'/'.$name); ?>" title="">
+ <a class="name file" href="<?php p($_['downloadURL'].'/'.$name); ?>" title="">
<?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; ?>
<span class="nametext">