diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-02-20 16:33:45 +0100 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-02-20 16:33:45 +0100 |
commit | 273e1a146b27e197a7450589594edcb9131e3b5e (patch) | |
tree | ee8a130d1e42e3fbd16a7ef8673c5334ce096e2e /apps/files_trashbin/js | |
parent | 3a364639b7649c12dcdd15e1c0344a35432aedc2 (diff) | |
download | nextcloud-server-273e1a146b27e197a7450589594edcb9131e3b5e.tar.gz nextcloud-server-273e1a146b27e197a7450589594edcb9131e3b5e.zip |
switch to json encoded file list
Diffstat (limited to 'apps/files_trashbin/js')
-rw-r--r-- | apps/files_trashbin/js/trash.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js index c8b862837a6..3841a098147 100644 --- a/apps/files_trashbin/js/trash.js +++ b/apps/files_trashbin/js/trash.js @@ -6,9 +6,10 @@ $(document).ready(function() { var tr=$('tr').filterAttr('data-file', filename); var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'perform restore operation')+'" src="'+ OC.imagePath('core', 'loader.gif') +'"></a>'; var undeleteAction = $('tr').filterAttr('data-file',filename).children("td.date"); + var files = tr.attr('data-file'); undeleteAction[0].innerHTML = undeleteAction[0].innerHTML+spinner; $.post(OC.filePath('files_trashbin','ajax','undelete.php'), - {files:tr.attr('data-file'), dirlisting:tr.attr('data-dirlisting') }, + {files:JSON.stringify([files]), dirlisting:tr.attr('data-dirlisting') }, function(result){ for (var i = 0; i < result.data.success.length; i++) { var row = document.getElementById(result.data.success[i].filename); @@ -31,10 +32,11 @@ $(document).ready(function() { var deleteAction = $('tr').filterAttr('data-file',filename).children("td.date").children(".action.delete"); var oldHTML = deleteAction[0].outerHTML; var newHTML = '<img class="move2trash" data-action="Delete" title="'+t('files', 'delete file permanently')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>'; + var files = tr.attr('data-file'); deleteAction[0].outerHTML = newHTML; $.post(OC.filePath('files_trashbin','ajax','delete.php'), - {files:tr.attr('data-file'), dirlisting:tr.attr('data-dirlisting') }, + {files:JSON.stringify([files]), dirlisting:tr.attr('data-dirlisting') }, function(result){ for (var i = 0; i < result.data.success.length; i++) { var row = document.getElementById(result.data.success[i].filename); @@ -93,7 +95,7 @@ $(document).ready(function() { $('.undelete').click('click',function(event) { var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'perform restore operation')+'" src="'+ OC.imagePath('core', 'loader.gif') +'"></a>'; var files=getSelectedFiles('file'); - var fileslist=files.join('|'); + var fileslist = JSON.stringify(files); var dirlisting=getSelectedFiles('dirlisting')[0]; for (var i in files) { @@ -118,7 +120,7 @@ $(document).ready(function() { console.log("delete selected"); var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'Delete permanently')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>'; var files=getSelectedFiles('file'); - var fileslist=files.join('|'); + var fileslist = JSON.stringify(files); var dirlisting=getSelectedFiles('dirlisting')[0]; for (var i in files) { |