diff --git a/templates/pages/corpora/terms.html b/templates/pages/corpora/terms.html index 329baf359a7136b6539ccfd7fad171567480b9d1..0c55922cbc0a0599ebabe5a3517451941cefb8c8 100644 --- a/templates/pages/corpora/terms.html +++ b/templates/pages/corpora/terms.html @@ -131,7 +131,7 @@ em { <!-- save/import button --> <button id="ImportListOrSaveAll" class="btn btn-warning" style="font-size:120%" - onclick="$('#csvimport').modal('show');"> + onclick="$('#csvimport').modal('show'); document.getElementById('importsubmit').disabled = false ;"> <b>Import a Termlist</b> </button> </div> @@ -437,13 +437,22 @@ function listmergeCsvPost(theFile){ // reload after 3s setTimeout("location.reload(true)", 3000); }, - error: function(result) { - my_html = '<h3 style="color:red">Error</h3>' - my_html += "<p class='note'>please correct your CSV file and retry</p>" - my_html += "<p>"+ result.responseJSON['err']+"</p>" + error: function(result, t) { + if (t != 'timeout') { + my_html = '<h3 style="color:red">Error</h3>' + my_html += "<p class='note'>please correct your CSV file and retry</p>" + my_html += "<p>"+ result.responseJSON['err']+"</p>" + } + else { + my_html = '<h3 style="color:red">Timeout</h3>' + my_html += "<p>The CSV import timed out.</p>" + my_html += "<p>(This bug is currently being fixed. <br/>The import and indexation are now continuing in background on our servers. Results will show in a few minutes.)</p>" + document.getElementById('importsubmit').disabled = true + } $('#formanswer').html(my_html); console.error(result); }, + timeout: 15000 // 15s }); } };