don't create firefox hardlock
This commit is contained in:
parent
ef25b32856
commit
3d5c13a3e1
|
@ -28,6 +28,6 @@ if(strpos($dir,'..') === false){
|
||||||
|
|
||||||
$error = $_FILES['file']['error'];
|
$error = $_FILES['file']['error'];
|
||||||
|
|
||||||
echo json_encode(array( 'status' => 'error', 'data' => array('error' => $error)));
|
echo json_encode(array( 'status' => 'error', 'data' => array('error' => $error, "file" => $fileName)));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#file_action_panel').attr('activeAction', false);
|
$('#file_action_panel').attr('activeAction', false);
|
||||||
$('#file_upload_start').attr('mode', 'menu');
|
$('#file_upload_start').attr('mode', 'menu');
|
||||||
|
$('#file_upload_form').attr('uploading', false);
|
||||||
|
|
||||||
// Sets browser table behaviour :
|
// Sets browser table behaviour :
|
||||||
$('.browser tr').hover(
|
$('.browser tr').hover(
|
||||||
|
@ -73,6 +74,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
$('#file_upload_start').click(function() {
|
$('#file_upload_start').click(function() {
|
||||||
if($('#file_upload_start').attr('mode') == 'menu') {
|
if($('#file_upload_start').attr('mode') == 'menu') {
|
||||||
|
$('#file_upload_form')[0].reset();
|
||||||
$('#fileSelector').change(function() {
|
$('#fileSelector').change(function() {
|
||||||
//Chromium prepends C:\fakepath....
|
//Chromium prepends C:\fakepath....
|
||||||
bspos = $('#fileSelector').val().lastIndexOf('\\')+1;
|
bspos = $('#fileSelector').val().lastIndexOf('\\')+1;
|
||||||
|
@ -90,6 +92,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
} else if($('#file_upload_start').attr('mode') == 'action') {
|
} else if($('#file_upload_start').attr('mode') == 'action') {
|
||||||
$('#file_upload_cancel').slideUp(250);
|
$('#file_upload_cancel').slideUp(250);
|
||||||
|
$('#file_upload_form').attr('uploading', true);
|
||||||
$('#file_upload_target').load(uploadFinished);
|
$('#file_upload_target').load(uploadFinished);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -184,8 +187,11 @@ $(document).ready(function() {
|
||||||
function uploadFinished() {
|
function uploadFinished() {
|
||||||
result = $('#file_upload_target').contents().text();
|
result = $('#file_upload_target').contents().text();
|
||||||
result = eval("(" + result + ");");
|
result = eval("(" + result + ");");
|
||||||
|
$('#file_upload_target').load(function(){});
|
||||||
if(result.status == "error") {
|
if(result.status == "error") {
|
||||||
alert('An error occcured, upload failed.\nError code: ' + result.data.error);
|
if($('#file_upload_form').attr('uploading') == true) {
|
||||||
|
alert('An error occcured, upload failed.\nError code: ' + result.data.error + '\nFilename: ' + result.data.file);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
dir = $('#dir').val();
|
dir = $('#dir').val();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -198,10 +204,10 @@ function uploadFinished() {
|
||||||
// $('p.actions a.upload:first').show();
|
// $('p.actions a.upload:first').show();
|
||||||
$('#file_upload_start').val('Upload ' + $('.max_human_file_size:first').val());
|
$('#file_upload_start').val('Upload ' + $('.max_human_file_size:first').val());
|
||||||
$('#file_upload_start').attr('mode', 'menu');
|
$('#file_upload_start').attr('mode', 'menu');
|
||||||
// $('#fileSelector').replaceWith('<input type="file" name="file" id="fileSelector">');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
$('#file_upload_form').attr('uploading', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetFileActionPanel() {
|
function resetFileActionPanel() {
|
||||||
|
|
Loading…
Reference in New Issue