X-Git-Url: https://git.p6c8.net/jirafeau_project.git/blobdiff_plain/ce572328d7458af0492c4004b44bd9cca80cb180..3f8ba7f9359d8909300b01269056e5c2a578e310:/lib/functions.js?ds=inline diff --git a/lib/functions.js b/lib/functions.js index 816ea6d..8922e0e 100755 --- a/lib/functions.js +++ b/lib/functions.js @@ -18,16 +18,16 @@ function show_link (url, reference, delete_code, crypt_key, date) { - var download_link = url + 'file.php?h=' + reference; - var download_link_href = url + 'file.php?h=' + reference; + var download_link = url + 'f.php?h=' + reference; + var download_link_href = url + 'f.php?h=' + reference; if (crypt_key.length > 0) { download_link += '&k=' + crypt_key; download_link_href += '&k=' + crypt_key; } - var delete_link = url + 'file.php?h=' + reference + '&d=' + delete_code; - var delete_link_href = url + 'file.php?h=' + reference + '&d=' + delete_code; + var delete_link = url + 'f.php?h=' + reference + '&d=' + delete_code; + var delete_link_href = url + 'f.php?h=' + reference + '&d=' + delete_code; document.getElementById('upload_link').innerHTML = download_link; document.getElementById('upload_link').href = download_link_href; @@ -73,7 +73,7 @@ function upload_failed (e) alert ('Sorry, upload failed'); } -function classic_upload (url, file, time, password, one_time) +function classic_upload (url, file, time, password, one_time, upload_password) { var req = new XMLHttpRequest (); req.upload.addEventListener ("progress", upload_progress, false); @@ -118,6 +118,9 @@ function classic_upload (url, file, time, password, one_time) form.append ("key", password); if (one_time) form.append ("one_time_download", '1'); + if (upload_password.length > 0) + form.append ("upload_password", upload_password); + req.send (form); } @@ -136,7 +139,7 @@ var async_global_max_size = 0; var async_global_time; var async_global_transfering = 0; -function async_upload_start (url, max_size, file, time, password, one_time) +function async_upload_start (url, max_size, file, time, password, one_time, upload_password) { async_global_transfered = 0; async_global_url = url; @@ -171,6 +174,9 @@ function async_upload_start (url, max_size, file, time, password, one_time) form.append ("key", password); if (one_time) form.append ("one_time_download", '1'); + if (upload_password.length > 0) + form.append ("upload_password", upload_password); + req.send (form); } @@ -278,7 +284,8 @@ function upload (url, max_size) document.getElementById('file_select').files[0], document.getElementById('select_time').value, document.getElementById('input_key').value, - document.getElementById('one_time_download').checked + document.getElementById('one_time_download').checked, + document.getElementById('upload_password').value ); } else @@ -287,7 +294,8 @@ function upload (url, max_size) document.getElementById('file_select').files[0], document.getElementById('select_time').value, document.getElementById('input_key').value, - document.getElementById('one_time_download').checked + document.getElementById('one_time_download').checked, + document.getElementById('upload_password').value ); } }