summaryrefslogtreecommitdiffstats
path: root/files/js/files.js
diff options
context:
space:
mode:
Diffstat (limited to 'files/js/files.js')
-rw-r--r--files/js/files.js38
1 files changed, 18 insertions, 20 deletions
diff --git a/files/js/files.js b/files/js/files.js
index 6eed25dfe99..89101ce4b8f 100644
--- a/files/js/files.js
+++ b/files/js/files.js
@@ -25,11 +25,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
@@ -38,7 +38,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');
@@ -103,9 +103,9 @@ $(document).ready(function() {
}
}
}
-
+
});
-
+
// Sets the select_all checkbox behaviour :
$('#select_all').click(function() {
if($(this).attr('checked')){
@@ -119,8 +119,8 @@ $(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;
@@ -148,23 +148,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();
@@ -354,7 +353,6 @@ $(document).ready(function() {
})
});
-
//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')
@@ -381,7 +379,7 @@ $(document).ready(function() {
text=text.substr(0,text.length-6)+'...';
crumb.text(text);
}
-
+
$(window).click(function(){
$('#new>ul').hide();
$('#new').removeClass('active');
@@ -405,14 +403,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('<p>'+$(element).data('text')+'</p>');
}
});
-
+
var type=$(this).data('type');
var text=$(this).children('p').text();
$(this).data('text',text);
@@ -474,7 +472,7 @@ $(document).ready(function() {
tr.find('td.filename').attr('style','background-image:url('+path+')');
});
}else{
-
+
}
}
);
@@ -544,7 +542,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');
@@ -570,7 +568,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);
});}