From 3267d91bdaed42633656723ec4e239d1fe460824 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Fri, 16 Mar 2012 16:25:41 +0100 Subject: it may take time for zip file download, so give a message --- files/js/files.js | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'files/js/files.js') diff --git a/files/js/files.js b/files/js/files.js index a678e12cc2d..539d5598899 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -3,11 +3,11 @@ $(document).ready(function() { //little hack to set unescape filenames in attribute $(this).attr('data-file',decodeURIComponent($(this).attr('data-file'))); }); - + if($('tr[data-file]').length==0){ $('.file_upload_filename').addClass('highlight'); } - + $('#file_action_panel').attr('activeAction', false); //drag/drop of files @@ -16,7 +16,7 @@ $(document).ready(function() { $('div.crumb').droppable(crumbDropOptions); $('ul#apps>li:first-child').data('dir',''); $('ul#apps>li:first-child').droppable(crumbDropOptions); - + // Triggers invisible file input $('.file_upload_button_wrapper').live('click', function() { $(this).parent().children('.file_upload_start').trigger('click'); @@ -81,9 +81,9 @@ $(document).ready(function() { } } } - + }); - + // Sets the select_all checkbox behaviour : $('#select_all').click(function() { if($(this).attr('checked')){ @@ -97,7 +97,7 @@ $(document).ready(function() { } procesSelection(); }); - + $('td.filename input:checkbox').live('click',function(event) { if (event.shiftKey) { var last = $(lastChecked).parent().parent().prevAll().length; @@ -126,23 +126,22 @@ $(document).ready(function() { } procesSelection(); }); - + $('#file_newfolder_name').click(function(){ if($('#file_newfolder_name').val() == 'New Folder'){ $('#file_newfolder_name').val(''); } }); - + $('.download').click('click',function(event) { var files=getSelectedFiles('name').join(';'); - - //send the browser to the download location var dir=$('#dir').val()||'/'; -// alert(files); + $('#notification').text(t('files','generating ZIP-file, it may take some time.')); + $('#notification').fadeIn(); window.location='ajax/download.php?files='+encodeURIComponent(files)+'&dir='+encodeURIComponent(dir); return false; }); - + $('.delete').click(function(event) { var files=getSelectedFiles('name'); event.preventDefault(); @@ -228,7 +227,7 @@ $(document).ready(function() { form.hide(); } }); - + //add multiply file upload attribute to all browsers except konqueror (which crashes when it's used) if(navigator.userAgent.search(/konqueror/i)==-1){ $('.file_upload_start').attr('multiple','multiple') @@ -255,7 +254,7 @@ $(document).ready(function() { text=text.substr(0,text.length-6)+'...'; crumb.text(text); } - + $(window).click(function(){ $('#new>ul').hide(); $('#new').removeClass('active'); @@ -279,14 +278,14 @@ $(document).ready(function() { if($(this).children('p').length==0){ return; } - + $('#new li').each(function(i,element){ if($(element).children('p').length==0){ $(element).children('input').remove(); $(element).append('

'+$(element).data('text')+'

'); } }); - + var type=$(this).data('type'); var text=$(this).children('p').text(); $(this).data('text',text); @@ -348,7 +347,7 @@ $(document).ready(function() { tr.find('td.filename').attr('style','background-image:url('+path+')'); }); }else{ - + } } ); -- cgit v1.2.3 From af75ecf9da9d66f9ef772d4482a7e79a960fd464 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Thu, 29 Mar 2012 18:17:46 +0200 Subject: make checkboxes on files page work with IE8 () --- files/js/files.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'files/js/files.js') diff --git a/files/js/files.js b/files/js/files.js index 539d5598899..df9f45a7af4 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -98,7 +98,7 @@ $(document).ready(function() { procesSelection(); }); - $('td.filename input:checkbox').live('click',function(event) { + $('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; -- cgit v1.2.3 From 0c56f82db5f00601841341909028a0cc36ca2bf1 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Tue, 10 Apr 2012 13:53:27 +0200 Subject: fix: drag'n'drop actions with files containing special chars, fixes oc-420 --- files/js/files.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'files/js/files.js') diff --git a/files/js/files.js b/files/js/files.js index df9f45a7af4..1c0a40c2368 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -417,7 +417,7 @@ var folderDropOptions={ var dir=$('#dir').val(); $.ajax({ url: 'ajax/move.php', - data: "dir="+dir+"&file="+file+'&target='+dir+'/'+target, + data: "dir="+encodeURIComponent(dir)+"&file="+encodeURIComponent(file)+'&target='+encodeURIComponent(dir)+'/'+encodeURIComponent(target), complete: function(data){boolOperationFinished(data, function(){ var el = $('#fileList tr').filterAttr('data-file',file).find('td.filename'); el.draggable('destroy'); @@ -443,7 +443,7 @@ var crumbDropOptions={ } $.ajax({ url: 'ajax/move.php', - data: "dir="+dir+"&file="+file+'&target='+target, + data: "dir="+encodeURIComponent(dir)+"&file="+encodeURIComponent(file)+'&target='+encodeURIComponent(target), complete: function(data){boolOperationFinished(data, function(){ FileList.remove(file); });} -- cgit v1.2.3