var undeleteAction = $('tr').filterAttr('data-file',filename).children("td.date");
var files = tr.attr('data-file');
undeleteAction[0].innerHTML = undeleteAction[0].innerHTML+spinner;
- $(".action").css("display", "none");
- $(":input:checkbox").css("display", "none");
+ disableActions();
$.post(OC.filePath('files_trashbin','ajax','undelete.php'),
{files:JSON.stringify([files]), dirlisting:tr.attr('data-dirlisting') },
function(result){
if (result.status != 'success') {
OC.dialogs.alert(result.data.message, t('core', 'Error'));
}
- $(".action").css("display", "inline");
- $(":input:checkbox").css("display", "inline");
+ enableActions();
});
});
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;
-
+ disableActions();
$.post(OC.filePath('files_trashbin','ajax','delete.php'),
{files:JSON.stringify([files]), dirlisting:tr.attr('data-dirlisting') },
function(result){
if (result.status != 'success') {
OC.dialogs.alert(result.data.message, t('core', 'Error'));
}
+ enableActions();
});
});
var files=getSelectedFiles('file');
var fileslist = JSON.stringify(files);
var dirlisting=getSelectedFiles('dirlisting')[0];
-
+ disableActions();
for (var i=0; i<files.length; i++) {
var undeleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date");
undeleteAction[0].innerHTML = undeleteAction[0].innerHTML+spinner;
if (result.status != 'success') {
OC.dialogs.alert(result.data.message, t('core', 'Error'));
}
+ enableActions();
});
});
var fileslist = JSON.stringify(files);
var dirlisting=getSelectedFiles('dirlisting')[0];
+ disableActions();
for (var i=0; i<files.length; i++) {
var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date");
deleteAction[0].innerHTML = deleteAction[0].innerHTML+spinner;
if (result.status != 'success') {
OC.dialogs.alert(result.data.message, t('core', 'Error'));
}
+ enableActions();
});
});
function fileDownloadPath(dir, file) {
return OC.filePath('files_trashbin', '', 'download.php') + '?file='+encodeURIComponent(file);
}
+
+function enableActions() {
+ $(".action").css("display", "inline");
+ $(":input:checkbox").css("display", "inline");
+}
+
+function disableActions() {
+ $(".action").css("display", "none");
+ $(":input:checkbox").css("display", "none");
+}