From ffecc3e4341102714a89ab6b5643c666c1feb0ee Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 30 Jan 2012 23:32:55 +0100 Subject: start of proper feedback during filessytem scan --- files/js/files.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'files/js') diff --git a/files/js/files.js b/files/js/files.js index 649f193aa2d..28259606cea 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -348,13 +348,17 @@ $(document).ready(function() { function scanFiles(force){ force=!!force; //cast to bool $('#scanning-message').show(); - $.get(OC.filePath('files','ajax','scan.php'),{force:force}, function(response) { - if(response && response.data && response.data.done){ + var scannerEventSource=new OC.EventSource(OC.filePath('files','ajax','scan.php'),{force:force}); + scannerEventSource.listen('scanned',function(file){ + console.log(file);//TODO: make this into proper feedback + }); + scannerEventSource.listen('success',function(success){ + if(success){ window.location.reload(); }else{ - alert('error') + alert('error while scanning'); } - }, "json"); + }); } function boolOperationFinished(data, callback) { -- cgit v1.2.3