some documentation fixes

This commit is contained in:
2018-08-06 23:33:03 +02:00
parent a0110a6c2a
commit 5a36b3a843
6 changed files with 29 additions and 16 deletions

View File

@@ -33,7 +33,8 @@ var UploadProgressBar = /** @class */ (function () {
UploadProgressBar.prototype.onFailure = function (response, error) {
this.uploadDiv.setAttribute('style', 'background: #821C40');
this.uploadDivJQ.html(this.file.name + '<br/>'
+ 'Upload failed after three tries!');
+ 'Upload failed after three tries!<br/>'
+ "Message: " + error);
};
return UploadProgressBar;
}());
@@ -161,14 +162,14 @@ var UploadWorker = /** @class */ (function () {
UploadWorker.prototype.upload = function (file) {
console.debug("Starting upload of " + file.name);
var formData = new FormData();
formData.append('file', file.file);
formData.append("name", file.name);
formData.append('file', file.file);
var that = this; // jquery changes the definiton of "this"
$.ajax({
type: 'POST',
url: apiEndpoint + "/file",
data: formData,
timeout: 7200000,
timeout: 21600000,
cache: false,
async: true,
crossDomain: false,
@@ -192,7 +193,6 @@ var UploadWorker = /** @class */ (function () {
error: function (xhr, status, error) {
console.log("status: " + status + " error: " + error);
if (that.tries === 3) {
alert("Upload failed: " + status);
file.onFailure(status, error);
setTimeout(function () { that.newFile(); }, 2000); // Try to continue
return; // Upload failed

View File

@@ -16,7 +16,7 @@ body{
font-family: 'Ubuntu', sans-serif;
margin: 0;
text-align: center; /* Center the header and body */
line-height: 140%;
line-height: 1.5em;
height: 100%;
overflow-x: hidden;
color: var(--text_color);
@@ -116,6 +116,7 @@ body{
/* Common elements */
h1, h2, h3, h4, h5, h6 {line-height: 1em;}
h3{border-bottom: 1px var(--accent_color_light_border) solid;} /* Differentiate it a bit, else it just looks like bold text */
hr{

View File

@@ -54,7 +54,8 @@ class UploadProgressBar implements FileUpload {
this.uploadDiv.setAttribute('style', 'background: #821C40')
this.uploadDivJQ.html(
this.file.name+'<br/>'
+ 'Upload failed after three tries!'
+ 'Upload failed after three tries!<br/>'
+ "Message: " + error
)
}
}

View File

@@ -68,8 +68,8 @@ class UploadWorker {
console.debug("Starting upload of " + file.name)
var formData = new FormData()
formData.append('file', file.file)
formData.append("name", file.name)
formData.append('file', file.file)
var that = this // jquery changes the definiton of "this"
@@ -77,7 +77,7 @@ class UploadWorker {
type: 'POST',
url: apiEndpoint+"/file",
data: formData,
timeout: 7200000, // 2 hours
timeout: 21600000, // 6 hours, to account for slow connections
cache: false,
async: true,
crossDomain: false,
@@ -103,7 +103,6 @@ class UploadWorker {
console.log("status: "+status+" error: "+error)
if (that.tries === 3) {
alert("Upload failed: " + status);
file.onFailure(status, error)
setTimeout(function(){that.newFile()}, 2000) // Try to continue