|
@@ -85,6 +85,7 @@ export class JournalNotesComponent implements OnInit, OnDestroy {
|
|
|
this.currentEntryIndex = -1;
|
|
|
} else {
|
|
|
this.currentEntry = this.entries[0];
|
|
|
+ this.tooltipifiedEntry = JSON.parse(JSON.stringify(this.currentEntry));
|
|
|
}
|
|
|
this.tooltipify();
|
|
|
}
|
|
@@ -173,20 +174,19 @@ export class JournalNotesComponent implements OnInit, OnDestroy {
|
|
|
let result: any = this.tooltipService.tooltipifyEntry(
|
|
|
JSON.parse(JSON.stringify(this.currentEntry.content)),
|
|
|
);
|
|
|
- console.log(result);
|
|
|
- this.tooltipifiedEntry = result.content;
|
|
|
- result.npcs.forEach((name: string) => {
|
|
|
- this.addHighlightsToText(name);
|
|
|
- });
|
|
|
+ // console.log(result);
|
|
|
+ this.tooltipifiedEntry.content = result.content;
|
|
|
+
|
|
|
+ // console.log(result.content);
|
|
|
+ // console.log(this.tooltipifiedEntry);
|
|
|
+
|
|
|
+ // TODO: AB hier funktioniert es noch nicht.
|
|
|
+ setTimeout(() => {
|
|
|
+ result.npcs.forEach((name: string) => {
|
|
|
+ this.addHighlightsToText(name);
|
|
|
+ });
|
|
|
+ }, 1000);
|
|
|
|
|
|
- // result = {
|
|
|
- // enntryContent: string;
|
|
|
- // npcs: string[] = [xyz];
|
|
|
- // npcDescriptions: {
|
|
|
- // name1: 'description1',
|
|
|
- // name2: 'description2',
|
|
|
- // }
|
|
|
- // }
|
|
|
// result.forEach((entry: any) => {
|
|
|
// entry.content = this.sanitizer.bypassSecurityTrustHtml(entry.content);
|
|
|
// });
|
|
@@ -208,8 +208,12 @@ export class JournalNotesComponent implements OnInit, OnDestroy {
|
|
|
* @param name The name of the person which mentionings are to be highlighted.
|
|
|
*/
|
|
|
addHighlightsToText(name: string) {
|
|
|
+ console.log('Highlighting: ' + name);
|
|
|
+
|
|
|
// Target the correct containers
|
|
|
const parent = this.el.nativeElement.querySelectorAll('.' + name);
|
|
|
+ console.log(parent);
|
|
|
+
|
|
|
parent.forEach((element: any) => {
|
|
|
const componentRef = this.test.createComponent(HighlightComponent);
|
|
|
// The name
|