summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-08-17 13:15:22 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-08-17 13:15:22 +0200
commitcabe92ef1240e171a812f5822ac69b4d7742fd71 (patch)
tree469e9089107d440da0c12c291abbd626d6d08b33 /apps/files/js
parent7adfc27cafa6f94962a33c158af9c45e71e012c5 (diff)
parentd3e2f31adad5eeaf415154dd2fb88cb9fec0b3c1 (diff)
downloadnextcloud-server-cabe92ef1240e171a812f5822ac69b4d7742fd71.tar.gz
nextcloud-server-cabe92ef1240e171a812f5822ac69b4d7742fd71.zip
Merge branch 'master' into decrypt_files_again
Conflicts: apps/files_encryption/tests/keymanager.php
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/fileactions.js12
-rw-r--r--apps/files/js/filelist.js16
-rw-r--r--apps/files/js/files.js22
3 files changed, 24 insertions, 26 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index aa66a57a7b5..5027211b536 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -65,7 +65,7 @@ var FileActions = {
FileActions.currentFile = parent;
var actions = FileActions.get(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions());
var file = FileActions.getCurrentFile();
- if ($('tr').filterAttr('data-file', file).data('renaming')) {
+ if ($('tr[data-file="'+file+'"]').data('renaming')) {
return;
}
parent.children('a.name').append('<span class="fileactions" />');
@@ -123,14 +123,11 @@ var FileActions = {
img = img(file);
}
if (typeof trashBinApp !== 'undefined' && trashBinApp) {
- var html = '<a href="#" original-title="' + t('files', 'Delete permanently') + '" class="action delete" />';
+ var html = '<a href="#" original-title="' + t('files', 'Delete permanently') + '" class="action delete delete-icon" />';
} else {
- var html = '<a href="#" original-title="' + t('files', 'Delete') + '" class="action delete" />';
+ var html = '<a href="#" class="action delete delete-icon" />';
}
var element = $(html);
- if (img) {
- element.append($('<img class ="svg" src="' + img + '"/>'));
- }
element.data('action', actions['Delete']);
element.on('click', {a: null, elem: parent, actionFunc: actions['Delete']}, actionHandler);
parent.parent().children().last().append(element);
@@ -164,10 +161,11 @@ $(document).ready(function () {
window.location = OC.filePath('files', 'ajax', 'download.php') + '?files=' + encodeURIComponent(filename) + '&dir=' + encodeURIComponent($('#dir').val());
});
}
-
$('#fileList tr').each(function () {
FileActions.display($(this).children('td.filename'));
});
+
+ $('#fileList').trigger(jQuery.Event("fileActionsReady"));
});
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 04a9fb91649..10801af3ead 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -15,7 +15,7 @@ var FileList={
// filename td
td = $('<td></td>').attr({
"class": "filename",
- "style": 'background-image:url('+iconurl+')'
+ "style": 'background-image:url('+iconurl+'); background-size: 16px;'
});
td.append('<input type="checkbox" />');
var link_elem = $('<a></a>').attr({
@@ -371,9 +371,7 @@ var FileList={
}
for (var i=0; i<files.length; i++) {
var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date").children(".action.delete");
- var oldHTML = deleteAction.html();
- var newHTML = '<img class="move2trash" data-action="Delete" title="'+t('files', 'perform delete operation')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>';
- deleteAction.html(newHTML);
+ deleteAction.removeClass('delete-icon').addClass('progress-icon');
}
// Finish any existing actions
if (FileList.lastAction) {
@@ -392,10 +390,11 @@ var FileList={
files.removeClass('selected');
});
procesSelection();
+ checkTrashStatus();
} else {
$.each(files,function(index,file) {
- var deleteAction = $('tr').filterAttr('data-file',file).children("td.date").children(".move2trash");
- deleteAction.html(oldHTML);
+ var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date").children(".action.delete");
+ deleteAction.removeClass('progress-icon').addClass('delete-icon');
});
}
});
@@ -451,13 +450,14 @@ $(document).ready(function(){
var currentUploads = parseInt(uploadtext.attr('currentUploads'));
currentUploads += 1;
uploadtext.attr('currentUploads', currentUploads);
+ var translatedText = n('files', 'Uploading %n file', 'Uploading %n files', currentUploads);
if(currentUploads === 1) {
var img = OC.imagePath('core', 'loading.gif');
data.context.find('td.filename').attr('style','background-image:url('+img+')');
- uploadtext.text(t('files', '1 file uploading'));
+ uploadtext.text(translatedText);
uploadtext.show();
} else {
- uploadtext.text(currentUploads + ' ' + t('files', 'files uploading'));
+ uploadtext.text(translatedText);
}
} else {
// add as stand-alone row to filelist
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index f5db0207966..8753319020d 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -135,7 +135,7 @@ $(document).ready(function() {
});
// Show trash bin
- $('#trash a').live('click', function() {
+ $('#trash').on('click', function() {
window.location=OC.filePath('files_trashbin', '', 'index.php');
});
@@ -773,21 +773,13 @@ function procesSelection(){
$('#headerSize').text(humanFileSize(totalSize));
var selection='';
if(selectedFolders.length>0){
- if(selectedFolders.length==1){
- selection+=t('files','1 folder');
- }else{
- selection+=t('files','{count} folders',{count: selectedFolders.length});
- }
+ selection += n('files', '%n folder', '%n folders', selectedFolders.length);
if(selectedFiles.length>0){
selection+=' & ';
}
}
if(selectedFiles.length>0){
- if(selectedFiles.length==1){
- selection+=t('files','1 file');
- }else{
- selection+=t('files','{count} files',{count: selectedFiles.length});
- }
+ selection += n('files', '%n file', '%n files', selectedFiles.length);
}
$('#headerName>span.name').text(selection);
$('#modified').text('');
@@ -859,3 +851,11 @@ function getUniqueName(name){
}
return name;
}
+
+function checkTrashStatus() {
+ $.post(OC.filePath('files_trashbin', 'ajax', 'isEmpty.php'), function(result){
+ if (result.data.isEmpty === false) {
+ $("input[type=button][id=trash]").removeAttr("disabled");
+ }
+ });
+}