|
|
|
@ -28,6 +28,7 @@ export class PinMarkerComponent {
|
|
|
|
|
currentIndex: number = 0;
|
|
|
|
|
imageUrls: SafeUrl[] = [];
|
|
|
|
|
imagesLoaded = false;
|
|
|
|
|
expandedDescriptions: { [index: number]: boolean } = {};
|
|
|
|
|
|
|
|
|
|
@Output() pinOpened = new EventEmitter<void>();
|
|
|
|
|
|
|
|
|
@ -36,7 +37,7 @@ export class PinMarkerComponent {
|
|
|
|
|
private modalService: ModalService,
|
|
|
|
|
private imageService: ImageService,
|
|
|
|
|
private sanitizer: DomSanitizer
|
|
|
|
|
) { }
|
|
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
// Écouter l'événement d'ouverture du popup
|
|
|
|
@ -44,6 +45,7 @@ export class PinMarkerComponent {
|
|
|
|
|
if (!this.imagesLoaded) {
|
|
|
|
|
this.loadImages();
|
|
|
|
|
this.pinOpened.emit();
|
|
|
|
|
// this.formatDescription(this.pin.description);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -84,17 +86,17 @@ export class PinMarkerComponent {
|
|
|
|
|
this.modalService.closeModal('confirm-modal-' + this.pin.id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get formattedDescription(): string {
|
|
|
|
|
return this.formatDescription(this.pin.description);
|
|
|
|
|
}
|
|
|
|
|
// get formattedDescription(): string {
|
|
|
|
|
// return this.formatDescription(this.pin.description);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
formatDescription(description: string): string {
|
|
|
|
|
const regex = /@(\w+(-\w+)*(\.\w+(-\w+)*)*)/g;
|
|
|
|
|
return description.replace(
|
|
|
|
|
regex,
|
|
|
|
|
`<a href="/profile/$1" class="text-blue-500 hover:underline">@$1</a>`
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
// formatDescription(description: string): string {
|
|
|
|
|
// const regex = /@(\w+(-\w+)*(\.\w+(-\w+)*)*)/g;
|
|
|
|
|
// return description.replace(
|
|
|
|
|
// regex,
|
|
|
|
|
// `<a href="/profile/$1" class="text-blue-500 hover:underline">@$1</a>`
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
prevSlide(): void {
|
|
|
|
|
this.currentIndex =
|
|
|
|
@ -111,4 +113,8 @@ export class PinMarkerComponent {
|
|
|
|
|
URL.revokeObjectURL(url.toString());
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
toggleDescription(index: number): void {
|
|
|
|
|
this.expandedDescriptions[index] = !this.expandedDescriptions[index];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|