diff --git a/.gitignore b/.gitignore
index f03aff9..f64d2da 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,3 @@
.vscode
main
-pdwebconfig.toml
-res/static/res/script/pixellib.js
-res/static/res/script/home.js
\ No newline at end of file
+pdwebconfig.toml
\ No newline at end of file
diff --git a/res/static/res/script/compiled/home.js b/res/static/res/script/compiled/home.js
index 0d52639..446b15e 100644
--- a/res/static/res/script/compiled/home.js
+++ b/res/static/res/script/compiled/home.js
@@ -29,6 +29,11 @@ var UploadProgressBar = /** @class */ (function () {
+ this.file.name + '
'
+ '' + window.location.hostname + '/u/' + id + '');
};
+ UploadProgressBar.prototype.onFailure = function (response, error) {
+ this.uploadDiv.setAttribute('style', 'background: #821C40');
+ this.uploadDivJQ.html(this.file.name + '
'
+ + 'Upload failed after three tries!');
+ };
return UploadProgressBar;
}());
function handleUploads(files) {
@@ -182,6 +187,8 @@ var UploadWorker = /** @class */ (function () {
if (that.tries === 3) {
alert("Upload failed: " + status);
that.uploading = false;
+ file.onFailure(status, error);
+ that.start(); // Try to continue
return; // Upload failed
}
// Try again
diff --git a/res/static/res/typescript/home/home.ts b/res/static/res/typescript/home/home.ts
index 8acdd44..92bcf4e 100644
--- a/res/static/res/typescript/home/home.ts
+++ b/res/static/res/typescript/home/home.ts
@@ -47,6 +47,13 @@ class UploadProgressBar implements FileUpload {
+ ''+window.location.hostname+'/u/'+id+''
)
}
+ public onFailure(response: JQuery.Ajax.ErrorTextStatus, error: string) {
+ this.uploadDiv.setAttribute('style', 'background: #821C40')
+ this.uploadDivJQ.html(
+ this.file.name+'
'
+ + 'Upload failed after three tries!'
+ )
+ }
}
function handleUploads(files: FileList) {
diff --git a/res/static/res/typescript/lib/uploader.ts b/res/static/res/typescript/lib/uploader.ts
index a4811b8..94d36cd 100644
--- a/res/static/res/typescript/lib/uploader.ts
+++ b/res/static/res/typescript/lib/uploader.ts
@@ -2,6 +2,7 @@ interface FileUpload {
file: File
onProgress(progress: number)
onFinished(id: string)
+ onFailure(response: JQuery.Ajax.ErrorTextStatus, error: string)
}
class UploadManager {
@@ -100,6 +101,9 @@ class UploadWorker {
if (that.tries === 3) {
alert("Upload failed: " + status);
that.uploading = false
+ file.onFailure(status, error)
+
+ that.start() // Try to continue
return; // Upload failed
}