require(JIRAFEAU_ROOT . 'lib/functions.php');
require(JIRAFEAU_ROOT . 'lib/lang.php');
-if ($cfg['download_password_requirement'] === "generated") {
+$download_pass = null;
+
+if ($cfg['download_password_requirement'] === 'generated') {
$download_pass = jirafeau_gen_download_pass($cfg['download_password_gen_len'], $cfg['download_password_gen_chars']);
}
?>
-<?php jirafeau_create_upload_finished_box($cfg['preview']); ?>
+<?php jirafeau_create_upload_finished_box($cfg['preview'], $download_pass); ?>
<div id="uploading">
<p>
if ($cfg['download_password_requirement'] === 'required') {
echo ' required';
}
- echo '/></td></tr>';
+ echo ' /> <input type="checkbox" id="show_password"> <label for="show_password">Show password</label>';
+ echo '</td></tr>';
}?>
<tr>
<td><label for="select_time"><?php echo t('TIME_LIM') . ':'; ?></label></td>
addCopyListener('delete_link_button', 'delete_link');
addTextCopyListener('password_copy_button', 'output_key');
// @license-end
+// show password toggle
+ document.getElementById('show_password')?.addEventListener('change', function() {
+ const pwd = document.getElementById('input_key');
+ if (pwd) {
+ pwd.type = this.checked ? 'text' : 'password';
+ }
+ });
</script>
<?php require(JIRAFEAU_ROOT . 'lib/template/footer.php'); ?>