From 51cfdb32b193e6575953d584320a646935edba5c Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 9 Oct 2013 12:43:56 +0200 Subject: [PATCH] fix indention --- apps/files_trashbin/js/trash.js | 198 ++++++++++++++++---------------- 1 file changed, 99 insertions(+), 99 deletions(-) diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js index 3cbe79686d7..58821cd300b 100644 --- a/apps/files_trashbin/js/trash.js +++ b/apps/files_trashbin/js/trash.js @@ -3,39 +3,39 @@ $(document).ready(function() { if (typeof FileActions !== 'undefined') { FileActions.register('all', 'Restore', OC.PERMISSION_READ, OC.imagePath('core', 'actions/history'), function(filename) { - var tr=$('tr').filterAttr('data-file', filename); - var deleteAction = $('tr').filterAttr('data-file',filename).children("td.date").children(".action.delete"); + var tr = $('tr').filterAttr('data-file', filename); + var deleteAction = $('tr').filterAttr('data-file', filename).children("td.date").children(".action.delete"); deleteAction.removeClass('delete-icon').addClass('progress-icon'); disableActions(); - $.post(OC.filePath('files_trashbin','ajax','undelete.php'), - {files:JSON.stringify([filename]), dirlisting:tr.attr('data-dirlisting') }, - function(result){ - console.log("get result"); - for (var i = 0; i < result.data.success.length; i++) { - var row = document.getElementById(result.data.success[i].filename); - row.parentNode.removeChild(row); - } - if (result.status !== 'success') { - OC.dialogs.alert(result.data.message, t('core', 'Error')); + $.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'), + {files: JSON.stringify([filename]), 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); + row.parentNode.removeChild(row); + } + if (result.status !== 'success') { + OC.dialogs.alert(result.data.message, t('core', 'Error')); + } + enableActions(); + FileList.updateFileSummary(); } - enableActions(); - FileList.updateFileSummary(); - }); + ); - }); - }; + }); + }; - FileActions.register('all', 'Delete', OC.PERMISSION_READ, function () { - return OC.imagePath('core', 'actions/delete'); - }, function (filename) { - $('.tipsy').remove(); - var tr=$('tr').filterAttr('data-file', filename); - var deleteAction = $('tr').filterAttr('data-file',filename).children("td.date").children(".action.delete"); - deleteAction.removeClass('delete-icon').addClass('progress-icon'); - disableActions(); - $.post(OC.filePath('files_trashbin','ajax','delete.php'), - {files:JSON.stringify([filename]), dirlisting:tr.attr('data-dirlisting') }, - function(result){ + FileActions.register('all', 'Delete', OC.PERMISSION_READ, function() { + return OC.imagePath('core', 'actions/delete'); + }, function(filename) { + $('.tipsy').remove(); + var tr = $('tr').filterAttr('data-file', filename); + var deleteAction = $('tr').filterAttr('data-file', filename).children("td.date").children(".action.delete"); + deleteAction.removeClass('delete-icon').addClass('progress-icon'); + disableActions(); + $.post(OC.filePath('files_trashbin', 'ajax', 'delete.php'), + {files: JSON.stringify([filename]), 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); row.parentNode.removeChild(row); @@ -46,67 +46,67 @@ $(document).ready(function() { enableActions(); FileList.updateFileSummary(); } - ); + ); - }); + }); - // Sets the select_all checkbox behaviour : - $('#select_all').click(function() { - if($(this).attr('checked')){ - // Check all - $('td.filename input:checkbox').attr('checked', true); - $('td.filename input:checkbox').parent().parent().addClass('selected'); - }else{ - // Uncheck all - $('td.filename input:checkbox').attr('checked', false); - $('td.filename input:checkbox').parent().parent().removeClass('selected'); - } - processSelection(); - }); + // Sets the select_all checkbox behaviour : + $('#select_all').click(function() { + if ($(this).attr('checked')) { + // Check all + $('td.filename input:checkbox').attr('checked', true); + $('td.filename input:checkbox').parent().parent().addClass('selected'); + } else { + // Uncheck all + $('td.filename input:checkbox').attr('checked', false); + $('td.filename input:checkbox').parent().parent().removeClass('selected'); + } + processSelection(); + }); - $('td.filename input:checkbox').live('change',function(event) { - if (event.shiftKey) { - var last = $(lastChecked).parent().parent().prevAll().length; - var first = $(this).parent().parent().prevAll().length; - var start = Math.min(first, last); - var end = Math.max(first, last); - var rows = $(this).parent().parent().parent().children('tr'); - for (var i = start; i < end; i++) { - $(rows).each(function(index) { - if (index === i) { - var checkbox = $(this).children().children('input:checkbox'); - $(checkbox).attr('checked', 'checked'); - $(checkbox).parent().parent().addClass('selected'); - } - }); - } + $('td.filename input:checkbox').live('change', function(event) { + if (event.shiftKey) { + var last = $(lastChecked).parent().parent().prevAll().length; + var first = $(this).parent().parent().prevAll().length; + var start = Math.min(first, last); + var end = Math.max(first, last); + var rows = $(this).parent().parent().parent().children('tr'); + for (var i = start; i < end; i++) { + $(rows).each(function(index) { + if (index === i) { + var checkbox = $(this).children().children('input:checkbox'); + $(checkbox).attr('checked', 'checked'); + $(checkbox).parent().parent().addClass('selected'); + } + }); } - var selectedCount=$('td.filename input:checkbox:checked').length; - $(this).parent().parent().toggleClass('selected'); - if(!$(this).attr('checked')){ - $('#select_all').attr('checked',false); - }else{ - if(selectedCount==$('td.filename input:checkbox').length){ - $('#select_all').attr('checked',true); - } + } + var selectedCount = $('td.filename input:checkbox:checked').length; + $(this).parent().parent().toggleClass('selected'); + if (!$(this).attr('checked')) { + $('#select_all').attr('checked', false); + } else { + if (selectedCount == $('td.filename input:checkbox').length) { + $('#select_all').attr('checked', true); } - processSelection(); - }); + } + processSelection(); + }); - $('.undelete').click('click',function(event) { - event.preventDefault(); - var files=getSelectedFiles('file'); - var fileslist = JSON.stringify(files); - var dirlisting=getSelectedFiles('dirlisting')[0]; - disableActions(); - for (var i=0; i