From 7ff86cfebe27c6cf3fc1926faeea541b84b5eff9 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 31 Jan 2012 13:56:58 +0100 Subject: provide live feedback while scanning files --- files/js/files.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'files/js') diff --git a/files/js/files.js b/files/js/files.js index 28259606cea..a896314faf0 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -347,10 +347,15 @@ $(document).ready(function() { function scanFiles(force){ force=!!force; //cast to bool + var fileCount=0; $('#scanning-message').show(); + $('#fileList').remove(); var scannerEventSource=new OC.EventSource(OC.filePath('files','ajax','scan.php'),{force:force}); + scanFiles.cancel=scannerEventSource.close.bind(scannerEventSource); scannerEventSource.listen('scanned',function(file){ - console.log(file);//TODO: make this into proper feedback + fileCount++; + $('#scan-count').text(fileCount+' files scanned'); + $('#scan-current').text(file); }); scannerEventSource.listen('success',function(success){ if(success){ -- cgit v1.2.3