X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/b80414684c97b6c406715eac10815f6be40893b2..a9ab012f12e417222a082bbb80515c781601e7a2:/lib/functions.js.php?ds=inline diff --git a/lib/functions.js.php b/lib/functions.js.php index 8447551..b2580b5 100644 --- a/lib/functions.js.php +++ b/lib/functions.js.php @@ -19,13 +19,13 @@ */ header('Content-Type: text/javascript'); - define('JIRAFEAU_ROOT', dirname(__FILE__) . '/../'); require(JIRAFEAU_ROOT . 'lib/settings.php'); require(JIRAFEAU_ROOT . 'lib/functions.php'); require(JIRAFEAU_ROOT . 'lib/lang.php'); ?> +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later var web_root = ""; var lang_array = ; @@ -145,11 +145,11 @@ function show_link (reference, delete_code, crypt_key, date) // Email link var filename = document.getElementById('file_select').files[0].name; - var b = encodeURIComponent(" \"" + filename + "\":") + "%0D"; - b += encodeURIComponent(web_root + download_link_href) + "%0D"; + var b = encodeURIComponent(" \"" + filename + "\":") + "%0D" + "%0A"; + b += encodeURIComponent(web_root + download_link_href) + "%0D" + "%0A"; if (false == isEmpty(date)) { - b += "%0D" + encodeURIComponent(": " + date.format('YYYY-MM-DD hh:mm (GMT O)')) + "%0D"; + b += "%0D" + "%0A" + encodeURIComponent(": " + date.format('YYYY-MM-DD hh:mm (GMT O)')) + "%0D" + "%0A"; document.getElementById('upload_link_email').href = "mailto:?body=" + b + "&subject=" + encodeURIComponent(filename); } @@ -316,17 +316,17 @@ function add_time_string_to_date(d, time) } if (time == 'month') { - d.setSeconds (d.getSeconds() + 2419200); + d.setSeconds (d.getSeconds() + 2592000); return true; } if (time == 'quarter') { - d.setSeconds (d.getSeconds() + 7257600); + d.setSeconds (d.getSeconds() + 7776000); return true; } if (time == 'year') { - d.setSeconds (d.getSeconds() + 29030400); + d.setSeconds (d.getSeconds() + 31536000); return true; } return false; @@ -558,6 +558,8 @@ function async_upload_end (code) function upload (max_size) { + var one_time_checkbox = document.getElementById('one_time_download'); + var one_time = one_time_checkbox !== null ? one_time_checkbox.checked : false; if (check_html5_file_api () && document.getElementById('file_select').files[0].size >= max_size) { @@ -566,7 +568,7 @@ function upload (max_size) document.getElementById('file_select').files[0], document.getElementById('select_time').value, document.getElementById('input_key').value, - document.getElementById('one_time_download').checked, + one_time, document.getElementById('upload_password').value ); } @@ -576,7 +578,7 @@ function upload (max_size) document.getElementById('file_select').files[0], document.getElementById('select_time').value, document.getElementById('input_key').value, - document.getElementById('one_time_download').checked, + one_time, document.getElementById('upload_password').value ); } @@ -742,7 +744,10 @@ function copyLinkToClipboard(link_id) { } function addCopyListener(button_id, link_id) { - document.getElementById(button_id) + if(document.getElementById(button_id)){ + document.getElementById(button_id) .addEventListener("click", function() { copyLinkToClipboard(link_id);}); + } } +// @license-end