diff --git a/src/app/webide/source-code.ts b/src/app/webide/source-code.ts
index c1ed21e..e0610ef 100644
--- a/src/app/webide/source-code.ts
+++ b/src/app/webide/source-code.ts
@@ -4,4 +4,5 @@ export class SourceCode {
language: string;
files: string[];
saved: boolean;
+ command: string;
}
diff --git a/src/app/webide/webide.component.html b/src/app/webide/webide.component.html
index cfc18fa..a952aa0 100644
--- a/src/app/webide/webide.component.html
+++ b/src/app/webide/webide.component.html
@@ -2,7 +2,8 @@
@@ -17,7 +18,17 @@
+ [class.btn-warning]="saving === true"
+ [class.disabled]="saving === true"
+>Save
+ Saved!
+ Saving...
+
+Saved
+Saving
+Not Saved
+Not Saving
diff --git a/src/app/webide/webide.component.ts b/src/app/webide/webide.component.ts
index a080c3a..14110fb 100644
--- a/src/app/webide/webide.component.ts
+++ b/src/app/webide/webide.component.ts
@@ -21,6 +21,7 @@ export class WebideComponent implements OnInit {
theme = 'monokai';
files: string[];
saved = false;
+ saving = false;
constructor(private webSocketService: WebSocketService) { }
@@ -30,7 +31,7 @@ export class WebideComponent implements OnInit {
this.code = event.data.content;
this.language = event.data.language;
this.files = event.data.files;
- this.saved = event.data.saved;
+ if (event.data.command === 'write') { this.saved = true; this.saving = false; }
});
this.requestCode();
}
@@ -40,6 +41,8 @@ export class WebideComponent implements OnInit {
'command': 'write',
'content': this.code
});
+ this.saving = true;
+ this.saved = false;
}
requestCode() {