<?php
/*
* Jirafeau, your web file repository
- * Copyright (C) 2015 Jerome Jutteau <j.jutteau@gmail.com>
+ * Copyright (C) 2015 Jerome Jutteau <jerome@jutteau.fr>
* Copyright (C) 2015 Nicola Spanti (RyDroid) <dev@nicola-spanti.info>
*
* This program is free software: you can redistribute it and/or modify
}
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;
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)
{
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
);
}
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
);
}
if (s <= 1000)
{
res = s.toString();
- scale = "Bit/s";
+ scale = "B/s";
}
else if (s < 1000000)
{
res = Math.floor(s/100) / 10;
- scale = "KBit/s";
+ scale = "KB/s";
}
else
{
res = Math.floor(s/100000) / 10;
- scale = "Mbit/s";
+ scale = "MB/s";
}
if (res == 0)
return '';
}
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