Merge tag 'v5.00' into develop
drop and drag upload
This commit is contained in:
@@ -12,40 +12,6 @@
|
|||||||
src='http://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js'>
|
src='http://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js'>
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
|
||||||
|
|
||||||
$('#id_file').on('change', function(evt) {
|
|
||||||
var f = this.files[0];
|
|
||||||
var istcx = false;
|
|
||||||
var isgzip = false;
|
|
||||||
var size1 = 10485760;
|
|
||||||
var size2 = 1048576;
|
|
||||||
if ((/\.(tcx|TCX)/i).test(f.name)) {
|
|
||||||
istcx = true;
|
|
||||||
console.log('tcx');
|
|
||||||
if ((/\.(gz|GZ)/i).test(f.name)) {
|
|
||||||
isgzip = true;
|
|
||||||
console.log('gzip');
|
|
||||||
size1 /= 5;
|
|
||||||
size2 /= 5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log(f);
|
|
||||||
console.log(size1)
|
|
||||||
console.log(size2)
|
|
||||||
if (f.size > size1) {
|
|
||||||
alert("File Size must be smaller than 10 MB");
|
|
||||||
this.value = null;
|
|
||||||
}
|
|
||||||
if (f.size > size2) {
|
|
||||||
$('#id_offline').val('True');
|
|
||||||
$('#id_offline').prop('checked','True');
|
|
||||||
console.log("Set offline to True");
|
|
||||||
$('#extra_message').text('Because of the large size, we recommend to use background processing. You will receive email when it is done. The extra actions will not be performed.');
|
|
||||||
$('#extra_message').addClass('message');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
@@ -123,6 +89,42 @@
|
|||||||
var frm = $("#file_form");
|
var frm = $("#file_form");
|
||||||
var data = new FormData(frm[0]);
|
var data = new FormData(frm[0]);
|
||||||
|
|
||||||
|
$('#id_file').on('change', function(evt) {
|
||||||
|
var f = this.files[0];
|
||||||
|
console.log(f);
|
||||||
|
var istcx = false;
|
||||||
|
var isgzip = false;
|
||||||
|
var size1 = 10485760;
|
||||||
|
var size2 = 1048576;
|
||||||
|
if ((/\.(tcx|TCX)/i).test(f.name)) {
|
||||||
|
istcx = true;
|
||||||
|
console.log('tcx');
|
||||||
|
if ((/\.(gz|GZ)/i).test(f.name)) {
|
||||||
|
isgzip = true;
|
||||||
|
console.log('gzip');
|
||||||
|
size1 /= 5;
|
||||||
|
size2 /= 5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(size1)
|
||||||
|
console.log(size2)
|
||||||
|
if (f.size > size1) {
|
||||||
|
alert("File Size must be smaller than 10 MB");
|
||||||
|
this.value = null;
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (f.size > size2) {
|
||||||
|
$('#id_offline').val('True');
|
||||||
|
$('#id_offline').prop('checked','True');
|
||||||
|
data.set($('#id_offline').attr('name'),$('#id_offline').prop('checked'));
|
||||||
|
console.log("Set offline to True");
|
||||||
|
$('#extra_message').text('Because of the large size, we recommend to use background processing. You will receive email when it is done. The extra actions will not be performed.');
|
||||||
|
$('#extra_message').addClass('message');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
$('input').each(function( i ) {
|
$('input').each(function( i ) {
|
||||||
$(this).change(function() {
|
$(this).change(function() {
|
||||||
if ($(this).attr('type') == 'checkbox') {
|
if ($(this).attr('type') == 'checkbox') {
|
||||||
@@ -209,6 +211,7 @@
|
|||||||
if (f.size > size2) {
|
if (f.size > size2) {
|
||||||
$('#id_offline').val('True');
|
$('#id_offline').val('True');
|
||||||
$('#id_offline').prop('checked','True');
|
$('#id_offline').prop('checked','True');
|
||||||
|
data.set($('#id_offline').attr('name'),$('#id_offline').prop('checked'));
|
||||||
console.log("Set offline to True");
|
console.log("Set offline to True");
|
||||||
$('#extra_message').text('Because of the large size, we recommend to use background processing. You will receive email when it is done. The extra actions will not be performed.');
|
$('#extra_message').text('Because of the large size, we recommend to use background processing. You will receive email when it is done. The extra actions will not be performed.');
|
||||||
$('#extra_message').addClass('message');
|
$('#extra_message').addClass('message');
|
||||||
|
|||||||
Reference in New Issue
Block a user