|
|
|
@ -82,7 +82,7 @@ const basicSetup: Extension = (() => [
|
|
|
|
|
],
|
|
|
|
|
})
|
|
|
|
|
export class EditorComponent {
|
|
|
|
|
APP_URL = 'http://localhost:4200/'; // à retirer
|
|
|
|
|
APP_URL = 'http://localhost:4200'; // à retirer
|
|
|
|
|
|
|
|
|
|
@Input() currentWork!: Work;
|
|
|
|
|
isLoaded: boolean = false; // Pour vérifier si le chargement est terminé
|
|
|
|
@ -208,9 +208,9 @@ export class EditorComponent {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
shareButtonClicked() {
|
|
|
|
|
const link = this.addToDatabase();
|
|
|
|
|
const link = this.currentWork ? this.currentWork.link : this.addToDatabase();
|
|
|
|
|
const url = `${this.APP_URL}/work/${link}`;
|
|
|
|
|
const ok = TranslateModule;
|
|
|
|
|
|
|
|
|
|
// Vérifiez si l'API clipboard est disponible
|
|
|
|
|
if (navigator.clipboard) {
|
|
|
|
|
navigator.clipboard
|
|
|
|
@ -230,12 +230,17 @@ export class EditorComponent {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
saveButtonClicked() {
|
|
|
|
|
if (this.currentWork) {
|
|
|
|
|
this.workService.updateWork(
|
|
|
|
|
String(this.currentWork.id_work),
|
|
|
|
|
this.editorContent,
|
|
|
|
|
this.selectedLanguage.name
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
this.addToDatabase();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected readonly console = console;
|
|
|
|
|
}
|
|
|
|
|