aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <hey@jancborchardt.net>2013-08-15 23:25:20 +0200
committerJan-Christoph Borchardt <hey@jancborchardt.net>2013-08-15 23:25:20 +0200
commit3563eecffff7879aa87b7fc8c54b43f8e14281f0 (patch)
tree25fbafb06ba5c4ce2f301dd92d82d30e9783ed64 /apps/files/js
parentb44cab5acc1adccf36ebd18ab7f4da9caf4c7932 (diff)
parentbd1895bdf8dff07bf9dc9803ce991e39daa52acc (diff)
downloadnextcloud-server-3563eecffff7879aa87b7fc8c54b43f8e14281f0.tar.gz
nextcloud-server-3563eecffff7879aa87b7fc8c54b43f8e14281f0.zip
merge master into more-whitespace
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/fileactions.js5
-rw-r--r--apps/files/js/filelist.js11
-rw-r--r--apps/files/js/files.js26
3 files changed, 22 insertions, 20 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index aa66a57a7b5..de67d13559e 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" />');
@@ -164,10 +164,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 cf3ce2e5089..f7cc3767b25 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -47,7 +47,7 @@ var FileList={
//size column
if(size!=t('files', 'Pending')){
- simpleSize=simpleFileSize(size);
+ simpleSize = humanFileSize(size);
}else{
simpleSize=t('files', 'Pending');
}
@@ -55,7 +55,6 @@ var FileList={
var lastModifiedTime = Math.round(lastModified.getTime() / 1000);
td = $('<td></td>').attr({
"class": "filesize",
- "title": humanFileSize(size),
"style": 'color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')'
}).text(simpleSize);
tr.append(td);
@@ -171,6 +170,8 @@ var FileList={
}
}else if(type=='dir' && $('tr[data-file]').length>0){
$('tr[data-file]').first().before(element);
+ } else if(type=='file' && $('tr[data-file]').length>0) {
+ $('tr[data-file]').last().before(element);
}else{
$('#fileList').append(element);
}
@@ -391,6 +392,7 @@ 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");
@@ -450,13 +452,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 51b3f31fb96..53fc25f41b0 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -121,7 +121,7 @@ $(document).ready(function() {
});
// Show trash bin
- $('#trash a').live('click', function() {
+ $('#trash').on('click', function() {
window.location=OC.filePath('files_trashbin', '', 'index.php');
});
@@ -756,26 +756,16 @@ function procesSelection(){
for(var i=0;i<selectedFolders.length;i++){
totalSize+=selectedFolders[i].size;
};
- simpleSize=simpleFileSize(totalSize);
- $('#headerSize').text(simpleSize);
- $('#headerSize').attr('title',humanFileSize(totalSize));
+ $('#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('');
@@ -847,3 +837,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");
+ }
+ });
+}