diff options
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r-- | apps/files/js/files.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 7e3caf71a03..a79d34c9b23 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -115,6 +115,11 @@ $(document).ready(function() { return false; }); + // Trigger cancelling of file upload + $('#uploadprogresswrapper .stop').on('click', function() { + Files.cancelUploads(); + }); + // Show trash bin $('#trash a').live('click', function() { window.location=OC.filePath('files_trashbin', '', 'index.php'); @@ -506,9 +511,9 @@ $(document).ready(function() { var date=new Date(); FileList.addFile(name,0,date,false,hidden); var tr=$('tr').filterAttr('data-file',name); - tr.attr('data-mime','text/plain'); + tr.attr('data-mime',result.data.mime); tr.attr('data-id', result.data.id); - getMimeIcon('text/plain',function(path){ + getMimeIcon(result.data.mime,function(path){ tr.find('td.filename').attr('style','background-image:url('+path+')'); }); } else { @@ -703,14 +708,14 @@ function scanFiles(force, dir){ var scannerEventSource = new OC.EventSource(OC.filePath('files','ajax','scan.php'),{force:force,dir:dir}); scanFiles.cancel = scannerEventSource.close.bind(scannerEventSource); scannerEventSource.listen('count',function(count){ - console.log(count + 'files scanned') + console.log(count + ' files scanned') }); scannerEventSource.listen('folder',function(path){ console.log('now scanning ' + path) }); scannerEventSource.listen('done',function(count){ scanFiles.scanning=false; - console.log('done after ' + count + 'files'); + console.log('done after ' + count + ' files'); }); } scanFiles.scanning=false; @@ -757,9 +762,9 @@ var createDragShadow = function(event){ var dir=$('#dir').val(); $(selectedFiles).each(function(i,elem){ - var newtr = $('<tr data-dir="'+dir+'" data-filename="'+elem.name+'">' - +'<td class="filename">'+elem.name+'</td><td class="size">'+humanFileSize(elem.size)+'</td>' - +'</tr>'); + var newtr = $('<tr/>').attr('data-dir', dir).attr('data-filename', elem.name); + newtr.append($('<td/>').addClass('filename').text(elem.name)); + newtr.append($('<td/>').addClass('size').text(humanFileSize(elem.size))); tbody.append(newtr); if (elem.type === 'dir') { newtr.find('td.filename').attr('style','background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')'); |